diff --git a/apps/store/src/components/DetailsList/DetailsList.css.ts b/apps/store/src/components/DetailsList/DetailsList.css.ts new file mode 100644 index 0000000000..a58a136b82 --- /dev/null +++ b/apps/store/src/components/DetailsList/DetailsList.css.ts @@ -0,0 +1,22 @@ +import { style } from '@vanilla-extract/css' +import { tokens, xStack } from 'ui' + +export const detailsListRoot = style({ + listStyle: 'none', + color: tokens.colors.textTranslucentSecondary, +}) + +export const detailsListItem = style([ + xStack({ justifyContent: 'space-between' }), + { + fontSize: 'inherit', + }, +]) + +export const detailsListLabel = style({ + textAlign: 'start', +}) + +export const detailsListValue = style({ + textAlign: 'end', +}) diff --git a/apps/store/src/components/DetailsList/DetailsList.tsx b/apps/store/src/components/DetailsList/DetailsList.tsx new file mode 100644 index 0000000000..424b559f44 --- /dev/null +++ b/apps/store/src/components/DetailsList/DetailsList.tsx @@ -0,0 +1,54 @@ +import clsx from 'clsx' +import { type ComponentProps } from 'react' +import { type FontSizeProps, sprinkles } from 'ui' +import { + detailsListItem, + detailsListLabel, + detailsListRoot, + detailsListValue, +} from './DetailsList.css' + +type RootProps = ComponentProps<'ul'> & { + size?: FontSizeProps +} +const DetailsListRoot = ({ size = 'xs', className, children, ...props }: RootProps) => { + return ( + + ) +} + +type ItemProps = ComponentProps<'li'> +const DetailsListItem = ({ className, children, ...props }: ItemProps) => { + return ( +
  • + {children} +
  • + ) +} + +type LabelProps = ComponentProps<'span'> +const DetailsListLabel = ({ className, children, ...props }: LabelProps) => { + return ( + + {children} + + ) +} + +type ValueProps = ComponentProps<'span'> +const DetailsListValue = ({ className, children, ...props }: ValueProps) => { + return ( + + {children} + + ) +} + +export const DetailsList = { + Root: DetailsListRoot, + Item: DetailsListItem, + Label: DetailsListLabel, + Value: DetailsListValue, +}