diff --git a/centrifuge-app/src/components/TextLink.tsx b/centrifuge-app/src/components/TextLink.tsx
index 820df816f9..b326046cd1 100644
--- a/centrifuge-app/src/components/TextLink.tsx
+++ b/centrifuge-app/src/components/TextLink.tsx
@@ -31,10 +31,9 @@ export const TextLink = styled.span`
}
}
`
+export const RouterTextLink = (props: any) =>
+export const ButtonTextLink = (props: any) =>
-export const RouterTextLink = TextLink.withComponent(Link)
-
-export const ButtonTextLink = TextLink.withComponent('button')
ButtonTextLink.defaultProps = {
type: 'button',
}
diff --git a/fabric/src/components/Accordion/index.tsx b/fabric/src/components/Accordion/index.tsx
index a54e3ee653..d44ca9edae 100644
--- a/fabric/src/components/Accordion/index.tsx
+++ b/fabric/src/components/Accordion/index.tsx
@@ -8,6 +8,10 @@ import { Text } from '../Text'
export type AccordionProps = BoxProps & {
items: { title: React.ReactNode; body: React.ReactNode }[]
}
+interface AccordionEntryProps extends Omit {
+ title: React.ReactNode
+ body: React.ReactNode
+}
const Root = styled(Box)`
list-style: none;
@@ -33,7 +37,6 @@ const Toggle = styled(Shelf)`
export function Accordion({ items, ...boxProps }: AccordionProps) {
return (
+
(null)
@@ -54,9 +58,9 @@ export function Banner({ children, title, ...props }: BannerProps) {
style={{ marginLeft: 'auto' }}
/>
-
+
{children}
-
+
) : null
diff --git a/fabric/src/components/Box/index.ts b/fabric/src/components/Box/index.ts
index 58aa9e93b9..b4e9a53897 100644
--- a/fabric/src/components/Box/index.ts
+++ b/fabric/src/components/Box/index.ts
@@ -69,7 +69,6 @@ interface SystemProps
PositionProps,
BleedProps,
AspectProps {}
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface StyledBoxProps extends SystemProps {}
diff --git a/fabric/src/components/Button/WalletButton.tsx b/fabric/src/components/Button/WalletButton.tsx
index 565bbdbcc9..6dc7f69990 100644
--- a/fabric/src/components/Button/WalletButton.tsx
+++ b/fabric/src/components/Button/WalletButton.tsx
@@ -8,6 +8,20 @@ import { Shelf } from '../Shelf'
import { Text } from '../Text'
import { VisualButton, VisualButtonProps } from './VisualButton'
+const StyledInteractiveText = styled(Text)`
+ overflow: hidden;
+ text-overflow: ellipsis;
+`
+
+const StyledText = styled(Text)`
+ marginleft: auto;
+`
+
+const StyledBodyText = styled(Text)<{ margin?: string | number }>`
+ margin-left: auto;
+ ${({ margin }) => margin && `margin: ${margin};`}
+`
+
export type WalletButtonProps = Omit<
VisualButtonProps & React.ComponentPropsWithoutRef<'button'>,
'variant' | 'iconRight' | 'type' | 'children' | 'icon'
@@ -72,33 +86,20 @@ export function WalletButton({
{address && alias ? (
-
+
{alias}
-
+
) : (
-
+
{displayAddress ? truncate(displayAddress) : connectLabel}
-
+
)}
{address && balance && (
-
+
{balance}
-
+
)}
diff --git a/fabric/src/components/CurrencyInput/index.tsx b/fabric/src/components/CurrencyInput/index.tsx
index 0e85ff87d0..8a45efe915 100644
--- a/fabric/src/components/CurrencyInput/index.tsx
+++ b/fabric/src/components/CurrencyInput/index.tsx
@@ -13,7 +13,7 @@ export type CurrencyInputProps = Omit theme.shadows.buttonPrimary};
}
-`.withComponent('button')
+`
StyledMaxButton.defaultProps = {
type: 'button',
diff --git a/fabric/src/components/Divider/index.tsx b/fabric/src/components/Divider/index.tsx
index 87cb8227c0..f020cbde22 100644
--- a/fabric/src/components/Divider/index.tsx
+++ b/fabric/src/components/Divider/index.tsx
@@ -1,7 +1,7 @@
import styled from 'styled-components'
-import { Box } from '../Box'
+import { Box, BoxProps } from '../Box'
-const Hr = Box.withComponent('hr')
+const Hr = styled(Box).attrs({ as: 'hr' })``
export const Divider = styled(Hr)`
margin: 0;
diff --git a/fabric/src/components/ImageUpload/index.tsx b/fabric/src/components/ImageUpload/index.tsx
index 0aa1edb918..07ea64400e 100644
--- a/fabric/src/components/ImageUpload/index.tsx
+++ b/fabric/src/components/ImageUpload/index.tsx
@@ -70,6 +70,13 @@ const Container = styled(Grid)<{ $disabled?: boolean; $active: boolean }>`
}
`
+const StyledText = styled(Text)`
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ direction: rtl;
+`
+
export type ImageUploadProps = Omit & {
file?: File | null
requirements?: string
@@ -227,18 +234,9 @@ export function ImageUpload({
-
+
{curFile && (typeof curFile === 'string' ? curFile : curFile.name)}
-
+
{!disabled && }
diff --git a/fabric/src/components/InputUnit/index.tsx b/fabric/src/components/InputUnit/index.tsx
index 0de1fd4e19..b5cdff098c 100644
--- a/fabric/src/components/InputUnit/index.tsx
+++ b/fabric/src/components/InputUnit/index.tsx
@@ -1,4 +1,5 @@
import * as React from 'react'
+import styled from 'styled-components'
import { Stack } from '../Stack'
import { Text } from '../Text'
@@ -24,17 +25,9 @@ export function InputUnit({ id, label, secondaryLabel, errorMessage, inputElemen
{label && {label}}
-
+
{inputElement}
-
+
{secondaryLabel && (
{secondaryLabel}
@@ -48,7 +41,12 @@ export function InputUnit({ id, label, secondaryLabel, errorMessage, inputElemen
export function InputLabel({ children, disabled }: { children: React.ReactNode; disabled?: boolean }) {
return (
-
+
{children}
)
@@ -61,3 +59,9 @@ export function InputErrorMessage({ children }: { children: React.ReactNode }) {
)
}
+
+const StyledText = styled(Text)`
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+`
diff --git a/fabric/src/components/Pagination/Pagination.tsx b/fabric/src/components/Pagination/Pagination.tsx
index fdbd35eb92..76eed3d83d 100644
--- a/fabric/src/components/Pagination/Pagination.tsx
+++ b/fabric/src/components/Pagination/Pagination.tsx
@@ -8,6 +8,10 @@ import { Text } from '../Text'
import { usePaginationContext } from './PaginationContainer'
import { PaginationState } from './usePagination'
+const StyledText = styled(Text)`
+ user-select: none;
+`
+
const StyledButton = styled.button<{
$active?: boolean
}>(
@@ -96,11 +100,7 @@ export function Pagination({ pagination }: { pagination?: PaginationState }) {
- {firstShown > 1 && (
-
- …
-
- )}
+ {firstShown > 1 && …}
{pages.map((n) => (
))}
- {lastShown < pageCount && (
-
- …
-
- )}
+ {lastShown < pageCount && …}
goToNext()} disabled={!canNextPage} aria-label="next page">
diff --git a/fabric/src/components/RadioButton/index.tsx b/fabric/src/components/RadioButton/index.tsx
index d9f016b3b3..d316024805 100644
--- a/fabric/src/components/RadioButton/index.tsx
+++ b/fabric/src/components/RadioButton/index.tsx
@@ -1,5 +1,6 @@
import * as React from 'react'
import styled from 'styled-components'
+import { DefaultTheme } from 'styled-components/dist/types'
import { Flex } from '../Flex'
import { Shelf } from '../Shelf'
import { Stack } from '../Stack'
@@ -8,7 +9,7 @@ import { Text } from '../Text'
export type RadioButtonProps = React.InputHTMLAttributes & {
label?: string
errorMessage?: string
- textStyle?: string
+ textStyle?: keyof DefaultTheme['typography']
}
export function RadioButton({ label, errorMessage, textStyle, ...radioProps }: RadioButtonProps) {
diff --git a/fabric/src/components/StatusChip/index.tsx b/fabric/src/components/StatusChip/index.tsx
index 76b6af9722..bbbd061d6b 100644
--- a/fabric/src/components/StatusChip/index.tsx
+++ b/fabric/src/components/StatusChip/index.tsx
@@ -27,10 +27,10 @@ const Chip = styled(Text)((props) =>
css({
display: 'inline-block',
px: 1,
- bg: `${props.backgroundColor}Bg`,
+ bg: `${String(props.backgroundColor)}Bg`,
borderRadius: 'chip',
whiteSpace: 'nowrap',
- color: `${props.color}`,
+ color: `${String(props.color)}`,
})
)
diff --git a/fabric/src/components/Text/index.tsx b/fabric/src/components/Text/index.tsx
index 31e6138ebe..38fe35132b 100644
--- a/fabric/src/components/Text/index.tsx
+++ b/fabric/src/components/Text/index.tsx
@@ -50,6 +50,7 @@ interface TextProps extends StyledTextProps {
textOverflow?: 'ellipsis'
as?: keyof JSX.IntrinsicElements | React.ComponentType
children?: React.ReactNode
+ htmlFor?: string
}
const Text = React.forwardRef((props, ref) => {
const isInText = useTextContext()
diff --git a/fabric/src/components/TextWithPlaceholder/TextWithPlaceholder.stories.tsx b/fabric/src/components/TextWithPlaceholder/TextWithPlaceholder.stories.tsx
index 30d38eab1c..ec4fe9cd29 100644
--- a/fabric/src/components/TextWithPlaceholder/TextWithPlaceholder.stories.tsx
+++ b/fabric/src/components/TextWithPlaceholder/TextWithPlaceholder.stories.tsx
@@ -1,11 +1,15 @@
import { Meta, StoryFn } from '@storybook/react'
import * as React from 'react'
-import { useTheme } from 'styled-components'
+import styled, { useTheme } from 'styled-components'
import { TextWithPlaceholder } from '.'
import { TextVariantName } from '../../theme'
import { Stack } from '../Stack'
import { Text } from '../Text'
+const StyledTextWithPlaceholder = styled(TextWithPlaceholder)`
+ max-width: 70ch;
+`
+
export default {
title: 'Components/TextWithPlaceholder',
component: TextWithPlaceholder,
@@ -19,12 +23,12 @@ const ParagraphTemplate: TextWithPlaceholderStory = (args) => (
Body 1
-
+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Corporis, ex?
Nesciunt consequatur consectetur magnam delectus distinctio ipsa{' '}
tempore maiores pariatur ipsum necessitatibus harum ea, labore quas impedit id
iure perferendis.
-
+
)