@timmbr/ui 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/README.md +12 -10
  2. package/dist/components/Alert/Alert.styles.d.ts +2 -2
  3. package/dist/components/AlertDialog/AlertDialog.d.ts +5 -3
  4. package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -1
  5. package/dist/components/AlertDialog/AlertDialog.js +21 -8
  6. package/dist/components/AlertDialog/AlertDialog.styles.d.ts +7 -1
  7. package/dist/components/AlertDialog/AlertDialog.styles.d.ts.map +1 -1
  8. package/dist/components/AlertDialog/AlertDialog.styles.js +26 -3
  9. package/dist/components/AlertDialog/AlertDialog.types.d.ts +19 -2
  10. package/dist/components/AlertDialog/AlertDialog.types.d.ts.map +1 -1
  11. package/dist/components/Avatar/Avatar.styles.d.ts +2 -2
  12. package/dist/components/Badge/Badge.styles.d.ts +2 -2
  13. package/dist/components/Badge/Badge.styles.d.ts.map +1 -1
  14. package/dist/components/Badge/Badge.styles.js +3 -1
  15. package/dist/components/Button/Button.d.ts.map +1 -1
  16. package/dist/components/Button/Button.js +6 -0
  17. package/dist/components/Button/Button.styles.d.ts +4 -2
  18. package/dist/components/Button/Button.styles.d.ts.map +1 -1
  19. package/dist/components/Button/Button.styles.js +26 -7
  20. package/dist/components/Card/Card.d.ts.map +1 -1
  21. package/dist/components/Card/Card.js +51 -32
  22. package/dist/components/Card/Card.styles.d.ts +32 -5
  23. package/dist/components/Card/Card.styles.d.ts.map +1 -1
  24. package/dist/components/Card/Card.styles.js +69 -10
  25. package/dist/components/Card/Card.types.d.ts +14 -3
  26. package/dist/components/Card/Card.types.d.ts.map +1 -1
  27. package/dist/components/Checkbox/Checkbox.styles.d.ts +2 -2
  28. package/dist/components/Chip/Chip.styles.d.ts +1 -1
  29. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +30 -0
  30. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
  31. package/dist/components/ConfirmDialog/ConfirmDialog.js +57 -0
  32. package/dist/components/ConfirmDialog/index.d.ts +2 -0
  33. package/dist/components/ConfirmDialog/index.d.ts.map +1 -0
  34. package/dist/components/Container/Container.styles.d.ts +1 -1
  35. package/dist/components/DataList/DataList.d.ts +3 -1
  36. package/dist/components/DataList/DataList.d.ts.map +1 -1
  37. package/dist/components/DataList/DataList.js +53 -15
  38. package/dist/components/DataList/DataList.styles.d.ts +17 -4
  39. package/dist/components/DataList/DataList.styles.d.ts.map +1 -1
  40. package/dist/components/DataList/DataList.styles.js +53 -10
  41. package/dist/components/DataList/DataList.types.d.ts +19 -2
  42. package/dist/components/DataList/DataList.types.d.ts.map +1 -1
  43. package/dist/components/Drawer/Drawer.d.ts +4 -3
  44. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  45. package/dist/components/Drawer/Drawer.js +33 -6
  46. package/dist/components/Drawer/Drawer.styles.d.ts +4 -0
  47. package/dist/components/Drawer/Drawer.styles.d.ts.map +1 -1
  48. package/dist/components/Drawer/Drawer.styles.js +8 -5
  49. package/dist/components/Drawer/Drawer.types.d.ts +1 -0
  50. package/dist/components/Drawer/Drawer.types.d.ts.map +1 -1
  51. package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
  52. package/dist/components/Dropdown/Dropdown.js +23 -10
  53. package/dist/components/Dropdown/Dropdown.styles.d.ts +5 -1
  54. package/dist/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
  55. package/dist/components/Dropdown/Dropdown.styles.js +12 -2
  56. package/dist/components/Dropdown/Dropdown.types.d.ts +4 -0
  57. package/dist/components/Dropdown/Dropdown.types.d.ts.map +1 -1
  58. package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
  59. package/dist/components/EmptyState/EmptyState.js +2 -1
  60. package/dist/components/EmptyState/EmptyState.styles.d.ts +3 -2
  61. package/dist/components/EmptyState/EmptyState.styles.d.ts.map +1 -1
  62. package/dist/components/EmptyState/EmptyState.styles.js +5 -0
  63. package/dist/components/Fieldset/Fieldset.d.ts +14 -0
  64. package/dist/components/Fieldset/Fieldset.d.ts.map +1 -0
  65. package/dist/components/Fieldset/Fieldset.js +24 -0
  66. package/dist/components/Fieldset/index.d.ts +2 -0
  67. package/dist/components/Fieldset/index.d.ts.map +1 -0
  68. package/dist/components/FormActions/FormActions.d.ts +13 -0
  69. package/dist/components/FormActions/FormActions.d.ts.map +1 -0
  70. package/dist/components/FormActions/FormActions.js +24 -0
  71. package/dist/components/FormActions/index.d.ts +2 -0
  72. package/dist/components/FormActions/index.d.ts.map +1 -0
  73. package/dist/components/Grid/Grid.d.ts +3 -1
  74. package/dist/components/Grid/Grid.d.ts.map +1 -1
  75. package/dist/components/Grid/Grid.js +31 -5
  76. package/dist/components/Grid/Grid.styles.d.ts +86 -0
  77. package/dist/components/Grid/Grid.styles.d.ts.map +1 -1
  78. package/dist/components/Grid/Grid.styles.js +85 -1
  79. package/dist/components/Grid/Grid.types.d.ts +31 -3
  80. package/dist/components/Grid/Grid.types.d.ts.map +1 -1
  81. package/dist/components/Heading/Heading.styles.d.ts +2 -2
  82. package/dist/components/Heading/Heading.styles.d.ts.map +1 -1
  83. package/dist/components/Heading/Heading.styles.js +3 -1
  84. package/dist/components/Heading/Heading.types.d.ts +1 -1
  85. package/dist/components/Heading/Heading.types.d.ts.map +1 -1
  86. package/dist/components/Icon/Icon.styles.d.ts +2 -2
  87. package/dist/components/Icon/Icon.styles.d.ts.map +1 -1
  88. package/dist/components/Icon/Icon.styles.js +6 -2
  89. package/dist/components/IconTile/IconTile.d.ts +8 -0
  90. package/dist/components/IconTile/IconTile.d.ts.map +1 -0
  91. package/dist/components/IconTile/IconTile.js +23 -0
  92. package/dist/components/IconTile/IconTile.styles.d.ts +7 -0
  93. package/dist/components/IconTile/IconTile.styles.d.ts.map +1 -0
  94. package/dist/components/IconTile/IconTile.styles.js +24 -0
  95. package/dist/components/IconTile/IconTile.types.d.ts +12 -0
  96. package/dist/components/IconTile/IconTile.types.d.ts.map +1 -0
  97. package/dist/components/IconTile/index.d.ts +4 -0
  98. package/dist/components/IconTile/index.d.ts.map +1 -0
  99. package/dist/components/Inline/Inline.d.ts.map +1 -1
  100. package/dist/components/Inline/Inline.js +10 -2
  101. package/dist/components/Inline/Inline.types.d.ts +6 -1
  102. package/dist/components/Inline/Inline.types.d.ts.map +1 -1
  103. package/dist/components/Input/Input.styles.d.ts +1 -1
  104. package/dist/components/Label/Label.styles.d.ts +1 -1
  105. package/dist/components/LinkButton/LinkButton.d.ts.map +1 -1
  106. package/dist/components/LinkButton/LinkButton.js +2 -0
  107. package/dist/components/LinkButton/LinkButton.styles.d.ts +3 -2
  108. package/dist/components/LinkButton/LinkButton.styles.d.ts.map +1 -1
  109. package/dist/components/LinkButton/LinkButton.styles.js +6 -0
  110. package/dist/components/List/List.d.ts.map +1 -1
  111. package/dist/components/List/List.js +18 -5
  112. package/dist/components/List/List.styles.d.ts +3 -1
  113. package/dist/components/List/List.styles.d.ts.map +1 -1
  114. package/dist/components/List/List.styles.js +4 -3
  115. package/dist/components/List/List.types.d.ts +7 -0
  116. package/dist/components/List/List.types.d.ts.map +1 -1
  117. package/dist/components/MediaCard/MediaCard.d.ts +13 -0
  118. package/dist/components/MediaCard/MediaCard.d.ts.map +1 -0
  119. package/dist/components/MediaCard/MediaCard.js +125 -0
  120. package/dist/components/MediaCard/MediaCard.styles.d.ts +17 -0
  121. package/dist/components/MediaCard/MediaCard.styles.d.ts.map +1 -0
  122. package/dist/components/MediaCard/MediaCard.styles.js +57 -0
  123. package/dist/components/MediaCard/MediaCard.types.d.ts +82 -0
  124. package/dist/components/MediaCard/MediaCard.types.d.ts.map +1 -0
  125. package/dist/components/MediaCard/index.d.ts +4 -0
  126. package/dist/components/MediaCard/index.d.ts.map +1 -0
  127. package/dist/components/NavFooter/NavFooter.styles.d.ts +1 -1
  128. package/dist/components/NavHeader/NavHeader.d.ts.map +1 -1
  129. package/dist/components/NavHeader/NavHeader.js +2 -1
  130. package/dist/components/NavHeader/NavHeader.styles.d.ts +1 -1
  131. package/dist/components/NavHeader/NavHeader.types.d.ts +22 -0
  132. package/dist/components/NavHeader/NavHeader.types.d.ts.map +1 -1
  133. package/dist/components/NavHeader/index.d.ts +1 -1
  134. package/dist/components/NavHeader/index.d.ts.map +1 -1
  135. package/dist/components/NavHeader/subcomponents/NavActions.d.ts +5 -0
  136. package/dist/components/NavHeader/subcomponents/NavActions.d.ts.map +1 -1
  137. package/dist/components/NavHeader/subcomponents/NavActions.js +32 -2
  138. package/dist/components/OtpInput/OtpInput.styles.d.ts +1 -1
  139. package/dist/components/PageHeader/PageHeader.d.ts +8 -0
  140. package/dist/components/PageHeader/PageHeader.d.ts.map +1 -0
  141. package/dist/components/PageHeader/PageHeader.js +55 -0
  142. package/dist/components/PageHeader/PageHeader.styles.d.ts +10 -0
  143. package/dist/components/PageHeader/PageHeader.styles.d.ts.map +1 -0
  144. package/dist/components/PageHeader/PageHeader.styles.js +23 -0
  145. package/dist/components/PageHeader/PageHeader.types.d.ts +24 -0
  146. package/dist/components/PageHeader/PageHeader.types.d.ts.map +1 -0
  147. package/dist/components/PageHeader/index.d.ts +4 -0
  148. package/dist/components/PageHeader/index.d.ts.map +1 -0
  149. package/dist/components/Pagination/Pagination.d.ts +9 -3
  150. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  151. package/dist/components/Pagination/Pagination.js +60 -39
  152. package/dist/components/Pagination/Pagination.styles.d.ts +1 -1
  153. package/dist/components/Pagination/Pagination.types.d.ts +23 -14
  154. package/dist/components/Pagination/Pagination.types.d.ts.map +1 -1
  155. package/dist/components/Price/Price.d.ts +10 -0
  156. package/dist/components/Price/Price.d.ts.map +1 -0
  157. package/dist/components/Price/Price.js +49 -0
  158. package/dist/components/Price/Price.styles.d.ts +15 -0
  159. package/dist/components/Price/Price.styles.d.ts.map +1 -0
  160. package/dist/components/Price/Price.styles.js +44 -0
  161. package/dist/components/Price/Price.types.d.ts +22 -0
  162. package/dist/components/Price/Price.types.d.ts.map +1 -0
  163. package/dist/components/Price/index.d.ts +4 -0
  164. package/dist/components/Price/index.d.ts.map +1 -0
  165. package/dist/components/Progress/Progress.styles.d.ts +1 -1
  166. package/dist/components/Radio/Radio.styles.d.ts +2 -2
  167. package/dist/components/Rating/Rating.d.ts +5 -0
  168. package/dist/components/Rating/Rating.d.ts.map +1 -0
  169. package/dist/components/Rating/Rating.js +38 -0
  170. package/dist/components/Rating/Rating.styles.d.ts +6 -0
  171. package/dist/components/Rating/Rating.styles.d.ts.map +1 -0
  172. package/dist/components/Rating/Rating.styles.js +13 -0
  173. package/dist/components/Rating/Rating.types.d.ts +18 -0
  174. package/dist/components/Rating/Rating.types.d.ts.map +1 -0
  175. package/dist/components/Rating/index.d.ts +4 -0
  176. package/dist/components/Rating/index.d.ts.map +1 -0
  177. package/dist/components/ResponsiveDialog/ResponsiveDialog.d.ts +29 -0
  178. package/dist/components/ResponsiveDialog/ResponsiveDialog.d.ts.map +1 -0
  179. package/dist/components/ResponsiveDialog/ResponsiveDialog.js +74 -0
  180. package/dist/components/ResponsiveDialog/ResponsiveDialog.types.d.ts +27 -0
  181. package/dist/components/ResponsiveDialog/ResponsiveDialog.types.d.ts.map +1 -0
  182. package/dist/components/ResponsiveDialog/index.d.ts +3 -0
  183. package/dist/components/ResponsiveDialog/index.d.ts.map +1 -0
  184. package/dist/components/SectionNav/SectionNav.d.ts +12 -0
  185. package/dist/components/SectionNav/SectionNav.d.ts.map +1 -0
  186. package/dist/components/SectionNav/SectionNav.js +67 -0
  187. package/dist/components/SectionNav/SectionNav.styles.d.ts +11 -0
  188. package/dist/components/SectionNav/SectionNav.styles.d.ts.map +1 -0
  189. package/dist/components/SectionNav/SectionNav.styles.js +28 -0
  190. package/dist/components/SectionNav/SectionNav.types.d.ts +37 -0
  191. package/dist/components/SectionNav/SectionNav.types.d.ts.map +1 -0
  192. package/dist/components/SectionNav/index.d.ts +4 -0
  193. package/dist/components/SectionNav/index.d.ts.map +1 -0
  194. package/dist/components/Select/Select.styles.d.ts +1 -1
  195. package/dist/components/Spinner/Spinner.styles.d.ts +1 -1
  196. package/dist/components/Stack/Stack.d.ts.map +1 -1
  197. package/dist/components/Stack/Stack.js +16 -1
  198. package/dist/components/Stack/Stack.types.d.ts +14 -1
  199. package/dist/components/Stack/Stack.types.d.ts.map +1 -1
  200. package/dist/components/Stepper/Stepper.d.ts +9 -0
  201. package/dist/components/Stepper/Stepper.d.ts.map +1 -0
  202. package/dist/components/Stepper/Stepper.js +81 -0
  203. package/dist/components/Stepper/Stepper.styles.d.ts +14 -0
  204. package/dist/components/Stepper/Stepper.styles.d.ts.map +1 -0
  205. package/dist/components/Stepper/Stepper.styles.js +40 -0
  206. package/dist/components/Stepper/Stepper.types.d.ts +17 -0
  207. package/dist/components/Stepper/Stepper.types.d.ts.map +1 -0
  208. package/dist/components/Stepper/index.d.ts +4 -0
  209. package/dist/components/Stepper/index.d.ts.map +1 -0
  210. package/dist/components/Steps/Steps.d.ts +9 -0
  211. package/dist/components/Steps/Steps.d.ts.map +1 -0
  212. package/dist/components/Steps/Steps.js +81 -0
  213. package/dist/components/Steps/Steps.styles.d.ts +14 -0
  214. package/dist/components/Steps/Steps.styles.d.ts.map +1 -0
  215. package/dist/components/Steps/Steps.styles.js +40 -0
  216. package/dist/components/Steps/Steps.types.d.ts +17 -0
  217. package/dist/components/Steps/Steps.types.d.ts.map +1 -0
  218. package/dist/components/Steps/index.d.ts +4 -0
  219. package/dist/components/Steps/index.d.ts.map +1 -0
  220. package/dist/components/SubNav/SubNav.d.ts +17 -0
  221. package/dist/components/SubNav/SubNav.d.ts.map +1 -0
  222. package/dist/components/SubNav/SubNav.js +87 -0
  223. package/dist/components/SubNav/SubNav.styles.d.ts +18 -0
  224. package/dist/components/SubNav/SubNav.styles.d.ts.map +1 -0
  225. package/dist/components/SubNav/SubNav.styles.js +33 -0
  226. package/dist/components/SubNav/SubNav.types.d.ts +45 -0
  227. package/dist/components/SubNav/SubNav.types.d.ts.map +1 -0
  228. package/dist/components/SubNav/index.d.ts +4 -0
  229. package/dist/components/SubNav/index.d.ts.map +1 -0
  230. package/dist/components/Switch/Switch.styles.d.ts +2 -2
  231. package/dist/components/Table/Table.styles.d.ts +1 -1
  232. package/dist/components/Tabs/Tabs.d.ts.map +1 -1
  233. package/dist/components/Tabs/Tabs.js +73 -6
  234. package/dist/components/Tabs/Tabs.styles.d.ts +10 -2
  235. package/dist/components/Tabs/Tabs.styles.d.ts.map +1 -1
  236. package/dist/components/Tabs/Tabs.styles.js +17 -2
  237. package/dist/components/Tabs/Tabs.types.d.ts +13 -0
  238. package/dist/components/Tabs/Tabs.types.d.ts.map +1 -1
  239. package/dist/components/Text/Text.d.ts.map +1 -1
  240. package/dist/components/Text/Text.js +4 -0
  241. package/dist/components/Text/Text.styles.d.ts +4 -2
  242. package/dist/components/Text/Text.styles.d.ts.map +1 -1
  243. package/dist/components/Text/Text.styles.js +16 -2
  244. package/dist/components/Text/Text.types.d.ts +1 -1
  245. package/dist/components/Text/Text.types.d.ts.map +1 -1
  246. package/dist/components/Textarea/Textarea.styles.d.ts +1 -1
  247. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +8 -0
  248. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
  249. package/dist/components/VisuallyHidden/VisuallyHidden.js +14 -0
  250. package/dist/components/VisuallyHidden/index.d.ts +2 -0
  251. package/dist/components/VisuallyHidden/index.d.ts.map +1 -0
  252. package/dist/index.d.ts +13 -0
  253. package/dist/index.d.ts.map +1 -1
  254. package/dist/index.js +32 -13
  255. package/dist/utils/gap.d.ts +21 -1
  256. package/dist/utils/gap.d.ts.map +1 -1
  257. package/dist/utils/gap.js +306 -46
  258. package/package.json +5 -5
@@ -5,10 +5,12 @@ const cardVariants = cva(
5
5
  {
6
6
  variants: {
7
7
  variant: {
8
- outline: "border border-grey-200 dark:border-grey-800 bg-grey-50 dark:bg-grey-900 shadow-sm",
9
- elevated: "border border-transparent bg-grey-50 dark:bg-grey-900 shadow-md hover:shadow-lg",
10
- subtle: "border border-transparent bg-grey-50 dark:bg-grey-950",
11
- interactive: "border border-grey-200 dark:border-grey-800 bg-grey-50 dark:bg-grey-900 shadow-sm hover:border-primary hover:shadow-md cursor-pointer"
8
+ outline: "border border-grey-200 dark:border-grey-800 bg-card shadow-sm",
9
+ elevated: "border border-transparent bg-card shadow-md hover:shadow-lg",
10
+ subtle: "border border-transparent bg-card",
11
+ interactive: "border border-grey-200 dark:border-grey-800 bg-card shadow-sm hover:border-primary hover:shadow-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
12
+ /** Flat, recessed panel inside other surfaces (forms, dialogs). */
13
+ inset: "border border-border bg-bg-subtle"
12
14
  },
13
15
  padding: {
14
16
  none: "p-0",
@@ -16,18 +18,75 @@ const cardVariants = cva(
16
18
  default: "p-6",
17
19
  md: "p-6",
18
20
  lg: "p-8"
21
+ },
22
+ /** Highlighted (e.g. the default address, a chosen option). */
23
+ selected: {
24
+ true: "border-primary/50",
25
+ false: ""
26
+ },
27
+ /** Header / content / footer get the padding instead, with full-width dividers. */
28
+ sectioned: {
29
+ true: "flex flex-col p-0",
30
+ false: ""
19
31
  }
20
32
  },
21
33
  defaultVariants: {
22
34
  variant: "outline",
23
- padding: "default"
35
+ padding: "default",
36
+ selected: false,
37
+ sectioned: false
24
38
  }
25
39
  }
26
40
  );
27
- const cardHeaderVariants = cva("flex flex-col gap-1.5 mb-4");
41
+ const cardSectionPadding = {
42
+ none: "",
43
+ sm: "p-4",
44
+ default: "p-6",
45
+ md: "p-6",
46
+ lg: "p-8"
47
+ };
48
+ const cardSectionFooterPadding = {
49
+ none: "",
50
+ sm: "px-4 py-2",
51
+ default: "px-6 py-3",
52
+ md: "px-6 py-3",
53
+ lg: "px-8 py-4"
54
+ };
55
+ const cardHeaderVariants = cva("flex flex-col gap-1.5", {
56
+ variants: {
57
+ sectioned: {
58
+ true: "",
59
+ false: "mb-4"
60
+ },
61
+ divider: {
62
+ true: "border-b border-border",
63
+ false: ""
64
+ }
65
+ },
66
+ compoundVariants: [{ sectioned: false, divider: true, className: "pb-4" }],
67
+ defaultVariants: { sectioned: false, divider: false }
68
+ });
28
69
  const cardTitleVariants = cva("text-h6 font-bold text-foreground leading-tight tracking-tight");
29
- const cardDescriptionVariants = cva("text-body-2 text-muted leading-relaxed");
30
- const cardContentVariants = cva("flex flex-col gap-4");
31
- const cardFooterVariants = cva("flex items-center justify-between pt-4 mt-4 border-t border-grey-100 dark:border-grey-800");
70
+ const cardDescriptionVariants = cva("text-body-2 text-muted-foreground leading-relaxed");
71
+ const cardContentVariants = cva("flex flex-col gap-4", {
72
+ variants: {
73
+ sectioned: { true: "flex-1", false: "" }
74
+ },
75
+ defaultVariants: { sectioned: false }
76
+ });
77
+ const cardFooterVariants = cva(
78
+ "flex items-center gap-2 border-t border-border",
79
+ {
80
+ variants: {
81
+ sectioned: { true: "", false: "pt-4 mt-4" },
82
+ justify: {
83
+ start: "justify-start",
84
+ between: "justify-between",
85
+ end: "justify-end"
86
+ }
87
+ },
88
+ defaultVariants: { sectioned: false, justify: "between" }
89
+ }
90
+ );
32
91
 
33
- export { cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardVariants };
92
+ export { cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardSectionFooterPadding, cardSectionPadding, cardTitleVariants, cardVariants };
@@ -1,13 +1,24 @@
1
1
  import type * as React from 'react';
2
- import type { CardVariants } from './Card.styles';
3
- export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, CardVariants {
2
+ import type { CardFooterVariants, CardVariants } from './Card.styles';
3
+ export interface CardProps extends React.HTMLAttributes<HTMLDivElement>, Omit<CardVariants, 'selected' | 'sectioned'> {
4
4
  /**
5
5
  * If true, delegates rendering to the direct child element using Radix Slot.
6
6
  */
7
7
  asChild?: boolean;
8
+ /** Highlights the card (e.g. the default or chosen item). */
9
+ selected?: boolean;
10
+ /**
11
+ * The `padding` goes to CardHeader / CardContent / CardFooter instead of the
12
+ * card, so header and footer dividers run edge to edge.
13
+ */
14
+ sectioned?: boolean;
8
15
  }
9
16
  export interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
10
17
  asChild?: boolean;
18
+ /** Line under the header (full width in a `sectioned` card). */
19
+ divider?: boolean;
20
+ /** Content at the end of the header row (badges, buttons). */
21
+ actions?: React.ReactNode;
11
22
  }
12
23
  export interface CardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
13
24
  asChild?: boolean;
@@ -18,7 +29,7 @@ export interface CardDescriptionProps extends React.HTMLAttributes<HTMLParagraph
18
29
  export interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
19
30
  asChild?: boolean;
20
31
  }
21
- export interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
32
+ export interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement>, Omit<CardFooterVariants, 'sectioned'> {
22
33
  asChild?: boolean;
23
34
  }
24
35
  //# sourceMappingURL=Card.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Card.types.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,WAAW,SACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cACf,SAAQ,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WA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O,CAAC;CACnB;AAED,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -1,10 +1,10 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  export declare const checkboxVariants: (props?: ({
3
- size?: "default" | "sm" | "lg" | "md" | null | undefined;
3
+ size?: "sm" | "md" | "lg" | "default" | null | undefined;
4
4
  isError?: boolean | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export declare const checkboxIndicatorVariants: (props?: ({
7
- size?: "default" | "sm" | "lg" | "md" | null | undefined;
7
+ size?: "sm" | "md" | "lg" | "default" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  export type CheckboxVariants = VariantProps<typeof checkboxVariants>;
10
10
  //# sourceMappingURL=Checkbox.styles.d.ts.map
@@ -2,7 +2,7 @@ import { type VariantProps } from 'class-variance-authority';
2
2
  export declare const chipVariants: (props?: ({
3
3
  variant?: "filled" | "subtle" | "outlined" | null | undefined;
4
4
  color?: "default" | "destructive" | "success" | "warning" | "primary" | null | undefined;
5
- size?: "default" | "sm" | "lg" | null | undefined;
5
+ size?: "sm" | "lg" | "default" | null | undefined;
6
6
  clickable?: boolean | null | undefined;
7
7
  selected?: boolean | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ export interface ConfirmDialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ title: React.ReactNode;
6
+ description?: React.ReactNode;
7
+ /** Extra content between the description and the buttons (e.g. what will be deleted). */
8
+ children?: React.ReactNode;
9
+ /** `destructive` for deletes / sign-outs: red confirm button and icon. */
10
+ tone?: 'default' | 'destructive';
11
+ /** Icon in the circle above the title. */
12
+ icon?: React.ReactNode;
13
+ confirmLabel: React.ReactNode;
14
+ cancelLabel: React.ReactNode;
15
+ /** Icon on the confirm button. */
16
+ confirmIcon?: React.ReactNode;
17
+ /**
18
+ * Runs on confirm. The dialog stays open with a spinner until it settles,
19
+ * then closes; if it throws, it stays open (show the error yourself).
20
+ */
21
+ onConfirm: () => void | Promise<void>;
22
+ /** @default 'sm' */
23
+ size?: 'sm' | 'md' | 'lg';
24
+ }
25
+ /** A confirmation with Cancel / Confirm that waits for the action to finish. */
26
+ export declare function ConfirmDialog({ open, onOpenChange, title, description, children, tone, icon, confirmLabel, cancelLabel, confirmIcon, onConfirm, size, }: ConfirmDialogProps): React.JSX.Element;
27
+ export declare namespace ConfirmDialog {
28
+ var displayName: string;
29
+ }
30
+ //# sourceMappingURL=ConfirmDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAe/B,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IACjC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,kCAAkC;IAClC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;OAGG;IACH,SAAS,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,oBAAoB;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAgB,EAChB,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,EACT,IAAW,GACZ,EAAE,kBAAkB,qBA0CpB;yBAvDe,aAAa"}
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogMedia, AlertDialogTitle, AlertDialogDescription, AlertDialogBody, AlertDialogFooter, AlertDialogCancel, AlertDialogAction } from '../AlertDialog/AlertDialog.js';
5
+ import { Button } from '../Button/Button.js';
6
+
7
+ function ConfirmDialog({
8
+ open,
9
+ onOpenChange,
10
+ title,
11
+ description,
12
+ children,
13
+ tone = "default",
14
+ icon,
15
+ confirmLabel,
16
+ cancelLabel,
17
+ confirmIcon,
18
+ onConfirm,
19
+ size = "sm"
20
+ }) {
21
+ const [busy, setBusy] = React.useState(false);
22
+ const confirm = async (event) => {
23
+ event.preventDefault();
24
+ setBusy(true);
25
+ try {
26
+ await onConfirm();
27
+ onOpenChange(false);
28
+ } catch {
29
+ } finally {
30
+ setBusy(false);
31
+ }
32
+ };
33
+ return /* @__PURE__ */ jsx(AlertDialog, { open, onOpenChange: (next) => !busy && onOpenChange(next), children: /* @__PURE__ */ jsxs(AlertDialogContent, { size, children: [
34
+ /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
35
+ icon && /* @__PURE__ */ jsx(AlertDialogMedia, { tone: tone === "destructive" ? "destructive" : "default", children: icon }),
36
+ /* @__PURE__ */ jsx(AlertDialogTitle, { children: title }),
37
+ description && /* @__PURE__ */ jsx(AlertDialogDescription, { children: description })
38
+ ] }),
39
+ children && /* @__PURE__ */ jsx(AlertDialogBody, { children }),
40
+ /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
41
+ /* @__PURE__ */ jsx(AlertDialogCancel, { disabled: busy, children: cancelLabel }),
42
+ /* @__PURE__ */ jsx(AlertDialogAction, { asChild: true, children: /* @__PURE__ */ jsx(
43
+ Button,
44
+ {
45
+ variant: tone === "destructive" ? "destructive" : "primary",
46
+ leftIcon: confirmIcon,
47
+ loading: busy,
48
+ onClick: confirm,
49
+ children: confirmLabel
50
+ }
51
+ ) })
52
+ ] })
53
+ ] }) });
54
+ }
55
+ ConfirmDialog.displayName = "ConfirmDialog";
56
+
57
+ export { ConfirmDialog };
@@ -0,0 +1,2 @@
1
+ export * from './ConfirmDialog';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ConfirmDialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  export declare const containerVariants: (props?: ({
3
- maxWidth?: "sm" | "lg" | "md" | "xl" | "2xl" | "full" | null | undefined;
3
+ maxWidth?: "sm" | "md" | "lg" | "xl" | "2xl" | "full" | null | undefined;
4
4
  padded?: boolean | null | undefined;
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export type ContainerVariants = VariantProps<typeof containerVariants>;
@@ -1,7 +1,9 @@
1
1
  import * as React from 'react';
2
- import type { DataListProps, DataListItemProps, DataListLabelProps, DataListValueProps } from './DataList.types';
2
+ import type { DataListProps, DataListItemProps, DataListLabelProps, DataListValueProps, DataListActionProps } from './DataList.types';
3
3
  export declare const DataList: React.ForwardRefExoticComponent<DataListProps & React.RefAttributes<HTMLDListElement>>;
4
4
  export declare const DataListItem: React.ForwardRefExoticComponent<DataListItemProps & React.RefAttributes<HTMLDivElement>>;
5
5
  export declare const DataListLabel: React.ForwardRefExoticComponent<DataListLabelProps & React.RefAttributes<HTMLElement>>;
6
6
  export declare const DataListValue: React.ForwardRefExoticComponent<DataListValueProps & React.RefAttributes<HTMLElement>>;
7
+ /** Buttons or a status at the end of a row (under the value on small screens). */
8
+ export declare const DataListAction: React.ForwardRefExoticComponent<DataListActionProps & React.RefAttributes<HTMLElement>>;
7
9
  //# sourceMappingURL=DataList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataList.d.ts","sourceRoot":"","sources":["../../../src/components/DataList/DataList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AAY1B,eAAO,MAAM,QAAQ,wFAyBpB,CAAC;AAGF,eAAO,MAAM,YAAY,0FAsBxB,CAAC;AAGF,eAAO,MAAM,aAAa,wFAoBzB,CAAC;AAGF,eAAO,MAAM,aAAa,wFAazB,CAAC"}
1
+ {"version":3,"file":"DataList.d.ts","sourceRoot":"","sources":["../../../src/components/DataList/DataList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAc1B,eAAO,MAAM,QAAQ,wFA0BpB,CAAC;AAGF,eAAO,MAAM,YAAY,0FAuBxB,CAAC;AAGF,eAAO,MAAM,aAAa,wFAiDzB,CAAC;AAGF,eAAO,MAAM,aAAa,wFAazB,CAAC;AAGF,kFAAkF;AAClF,eAAO,MAAM,cAAc,yFAW1B,CAAC"}
@@ -2,11 +2,13 @@
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { cn } from '@timmbr/utils';
5
- import { dataListVariants, dataListItemVariants, dataListLabelVariants, dataListValueVariants } from './DataList.styles.js';
5
+ import { dataListVariants, dataListActionVariants, dataListItemVariants, dataListInsetPadding, dataListLabelVariants, dataListValueVariants } from './DataList.styles.js';
6
+ import { Text } from '../Text/Text.js';
6
7
 
7
8
  const DataListContext = React.createContext({
8
9
  orientation: "horizontal",
9
- size: "default"
10
+ size: "default",
11
+ inset: "none"
10
12
  });
11
13
  const DataList = React.forwardRef(
12
14
  ({
@@ -14,15 +16,16 @@ const DataList = React.forwardRef(
14
16
  orientation = "horizontal",
15
17
  size = "default",
16
18
  divided = false,
19
+ inset = "none",
17
20
  children,
18
21
  ...props
19
22
  }, ref) => {
20
- return /* @__PURE__ */ jsx(DataListContext.Provider, { value: { orientation, size }, children: /* @__PURE__ */ jsx(
23
+ return /* @__PURE__ */ jsx(DataListContext.Provider, { value: { orientation, size, inset }, children: /* @__PURE__ */ jsx(
21
24
  "dl",
22
25
  {
23
26
  ref,
24
27
  "data-slot": "data-list",
25
- className: cn(dataListVariants({ orientation, size, divided }), className),
28
+ className: cn(dataListVariants({ orientation, size, divided }), inset !== "none" && "gap-0", className),
26
29
  ...props,
27
30
  children
28
31
  }
@@ -31,7 +34,7 @@ const DataList = React.forwardRef(
31
34
  );
32
35
  DataList.displayName = "DataList";
33
36
  const DataListItem = React.forwardRef(
34
- ({ className, orientation: itemOrientation, align = "baseline", children, ...props }, ref) => {
37
+ ({ className, orientation: itemOrientation, align = "baseline", emphasis = "none", children, ...props }, ref) => {
35
38
  const context = React.useContext(DataListContext);
36
39
  const orientation = itemOrientation ?? context.orientation;
37
40
  return /* @__PURE__ */ jsx(
@@ -40,10 +43,11 @@ const DataListItem = React.forwardRef(
40
43
  ref,
41
44
  "data-slot": "data-list-item",
42
45
  className: cn(
43
- dataListItemVariants({ orientation, align }),
44
- context.size === "sm" && "py-1",
45
- context.size === "default" && "py-1.5",
46
- context.size === "lg" && "py-2",
46
+ dataListItemVariants({ orientation, align, emphasis }),
47
+ context.inset === "none" && context.size === "sm" && "py-1",
48
+ context.inset === "none" && context.size === "default" && "py-1.5",
49
+ context.inset === "none" && context.size === "lg" && "py-2",
50
+ dataListInsetPadding[context.inset],
47
51
  className
48
52
  ),
49
53
  ...props,
@@ -54,10 +58,14 @@ const DataListItem = React.forwardRef(
54
58
  );
55
59
  DataListItem.displayName = "DataListItem";
56
60
  const DataListLabel = React.forwardRef(
57
- ({ className, minWidth, icon, style, children, ...props }, ref) => {
61
+ ({ className, minWidth, icon, description, tone, style, children, ...props }, ref) => {
62
+ const { orientation } = React.useContext(DataListContext);
63
+ const width = minWidth ? typeof minWidth === "number" ? `${minWidth}px` : minWidth : void 0;
64
+ const responsiveWidth = Boolean(width) && orientation === "horizontal";
58
65
  const computedStyle = {
59
66
  ...style,
60
- ...minWidth ? { minWidth: typeof minWidth === "number" ? `${minWidth}px` : minWidth } : {}
67
+ ...width && !responsiveWidth ? { minWidth: width } : {},
68
+ ...responsiveWidth ? { "--data-list-label-min": width } : {}
61
69
  };
62
70
  return /* @__PURE__ */ jsxs(
63
71
  "dt",
@@ -65,11 +73,28 @@ const DataListLabel = React.forwardRef(
65
73
  ref,
66
74
  "data-slot": "data-list-label",
67
75
  style: computedStyle,
68
- className: cn(dataListLabelVariants(), className),
76
+ className: cn(
77
+ dataListLabelVariants({ tone, withDescription: Boolean(description) }),
78
+ responsiveWidth && "sm:min-w-[var(--data-list-label-min)]",
79
+ className
80
+ ),
69
81
  ...props,
70
82
  children: [
71
- icon && /* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0 items-center justify-center text-grey-400 dark:text-grey-500", children: icon }),
72
- children
83
+ icon && /* @__PURE__ */ jsx(
84
+ "span",
85
+ {
86
+ "aria-hidden": "true",
87
+ className: cn(
88
+ "inline-flex shrink-0 items-center justify-center text-muted-foreground",
89
+ description && "mt-0.5"
90
+ ),
91
+ children: icon
92
+ }
93
+ ),
94
+ description ? /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
95
+ /* @__PURE__ */ jsx("span", { children }),
96
+ /* @__PURE__ */ jsx(Text, { as: "span", variant: "body-3", foreground: "muted", weight: "normal", children: description })
97
+ ] }) : children
73
98
  ]
74
99
  }
75
100
  );
@@ -91,5 +116,18 @@ const DataListValue = React.forwardRef(
91
116
  }
92
117
  );
93
118
  DataListValue.displayName = "DataListValue";
119
+ const DataListAction = React.forwardRef(
120
+ ({ className, placement, children, ...props }, ref) => /* @__PURE__ */ jsx(
121
+ "dd",
122
+ {
123
+ ref,
124
+ "data-slot": "data-list-action",
125
+ className: cn(dataListActionVariants({ placement }), className),
126
+ ...props,
127
+ children
128
+ }
129
+ )
130
+ );
131
+ DataListAction.displayName = "DataListAction";
94
132
 
95
- export { DataList, DataListItem, DataListLabel, DataListValue };
133
+ export { DataList, DataListAction, DataListItem, DataListLabel, DataListValue };
@@ -1,14 +1,27 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  export declare const dataListVariants: (props?: ({
3
- orientation?: "horizontal" | "vertical" | null | undefined;
4
- size?: "default" | "sm" | "lg" | null | undefined;
3
+ orientation?: "horizontal" | "vertical" | "justified" | null | undefined;
4
+ size?: "sm" | "lg" | "default" | null | undefined;
5
5
  divided?: boolean | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export declare const dataListItemVariants: (props?: ({
8
- orientation?: "horizontal" | "vertical" | null | undefined;
8
+ orientation?: "horizontal" | "vertical" | "justified" | null | undefined;
9
+ emphasis?: "none" | "total" | null | undefined;
9
10
  align?: "center" | "start" | "baseline" | null | undefined;
10
11
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
- export declare const dataListLabelVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
12
+ /** Item padding when rows run edge to edge (e.g. directly inside a sectioned Card). */
13
+ export declare const dataListInsetPadding: {
14
+ readonly none: "";
15
+ readonly sm: "px-4 py-3";
16
+ readonly default: "px-6 py-4";
17
+ };
18
+ export declare const dataListActionVariants: (props?: ({
19
+ placement?: "end" | "below" | null | undefined;
20
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
21
+ export declare const dataListLabelVariants: (props?: ({
22
+ tone?: "strong" | "muted" | null | undefined;
23
+ withDescription?: boolean | null | undefined;
24
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
25
  export declare const dataListValueVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
13
26
  export type DataListVariants = VariantProps<typeof dataListVariants>;
14
27
  //# sourceMappingURL=DataList.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataList.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DataList/DataList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;8EAqB3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;8EAgB/B,CAAC;AAEH,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"DataList.styles.d.ts","sourceRoot":"","sources":["../../../src/components/DataList/DataList.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,gBAAgB;;;;8EAsB3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;8EA6B/B,CAAC;AAEH,uFAAuF;AACvF,eAAO,MAAM,oBAAoB;;;;CAIvB,CAAC;AAEX,eAAO,MAAM,sBAAsB;;8EAajC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;8EAahC,CAAC;AAEH,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -4,7 +4,8 @@ const dataListVariants = cva("font-sans text-foreground", {
4
4
  variants: {
5
5
  orientation: {
6
6
  horizontal: "flex flex-col",
7
- vertical: "flex flex-col"
7
+ vertical: "flex flex-col",
8
+ justified: "flex flex-col"
8
9
  },
9
10
  size: {
10
11
  sm: "text-body-3 gap-1.5",
@@ -12,7 +13,7 @@ const dataListVariants = cva("font-sans text-foreground", {
12
13
  lg: "text-body-1 gap-3.5"
13
14
  },
14
15
  divided: {
15
- true: "divide-y divide-grey-200 dark:divide-grey-800",
16
+ true: "divide-y divide-border",
16
17
  false: ""
17
18
  }
18
19
  },
@@ -25,8 +26,19 @@ const dataListVariants = cva("font-sans text-foreground", {
25
26
  const dataListItemVariants = cva("flex", {
26
27
  variants: {
27
28
  orientation: {
28
- horizontal: "flex-col sm:flex-row sm:items-baseline gap-1 sm:gap-6",
29
- vertical: "flex-col gap-1"
29
+ /**
30
+ * Small screens: label and value stacked on the left, an action on the
31
+ * right (a two-column grid). From `sm`: one row.
32
+ */
33
+ horizontal: "grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-1 sm:flex sm:flex-row sm:items-baseline sm:gap-6",
34
+ vertical: "flex-col gap-1",
35
+ /** Label left, value right on every screen (totals, receipts). */
36
+ justified: "flex-row items-baseline justify-between gap-4 [&>[data-slot=data-list-value]]:text-right"
37
+ },
38
+ emphasis: {
39
+ none: "",
40
+ /** A total line: label and value in the foreground colour, semibold. */
41
+ total: "font-semibold [&>[data-slot=data-list-label]]:text-foreground [&>[data-slot=data-list-label]]:font-semibold"
30
42
  },
31
43
  align: {
32
44
  baseline: "sm:items-baseline",
@@ -36,14 +48,45 @@ const dataListItemVariants = cva("flex", {
36
48
  },
37
49
  defaultVariants: {
38
50
  orientation: "horizontal",
39
- align: "baseline"
51
+ align: "baseline",
52
+ emphasis: "none"
40
53
  }
41
54
  });
42
- const dataListLabelVariants = cva(
43
- "font-medium text-grey-500 dark:text-grey-400 shrink-0 flex items-center gap-1.5 select-none"
44
- );
55
+ const dataListInsetPadding = {
56
+ none: "",
57
+ sm: "px-4 py-3",
58
+ default: "px-6 py-4"
59
+ };
60
+ const dataListActionVariants = cva("flex shrink-0 items-center gap-2 sm:ms-auto", {
61
+ variants: {
62
+ /**
63
+ * Small screens: `end` keeps the action on the right of the label;
64
+ * `below` puts it under the label (wide buttons, long descriptions).
65
+ * From `sm` up it always ends the row.
66
+ */
67
+ placement: {
68
+ end: "col-start-2 row-span-2 row-start-1 justify-end self-center",
69
+ below: "col-span-2 col-start-1 mt-2 justify-start sm:mt-0"
70
+ }
71
+ },
72
+ defaultVariants: { placement: "end" }
73
+ });
74
+ const dataListLabelVariants = cva("col-start-1 shrink-0 flex gap-1.5 select-none", {
75
+ variants: {
76
+ tone: {
77
+ muted: "font-medium text-muted-foreground",
78
+ /** For rows whose label is the main text (settings, sign-in methods). */
79
+ strong: "font-semibold text-foreground"
80
+ },
81
+ withDescription: {
82
+ true: "items-start",
83
+ false: "items-center"
84
+ }
85
+ },
86
+ defaultVariants: { tone: "muted", withDescription: false }
87
+ });
45
88
  const dataListValueVariants = cva(
46
- "font-normal text-foreground flex-1 min-w-0"
89
+ "col-start-1 font-normal text-foreground flex-1 min-w-0"
47
90
  );
48
91
 
49
- export { dataListItemVariants, dataListLabelVariants, dataListValueVariants, dataListVariants };
92
+ export { dataListActionVariants, dataListInsetPadding, dataListItemVariants, dataListLabelVariants, dataListValueVariants, dataListVariants };
@@ -5,7 +5,13 @@ export interface DataListProps extends React.HTMLAttributes<HTMLDListElement>, D
5
5
  * Orientation layout of labels and values.
6
6
  * @default 'horizontal'
7
7
  */
8
- orientation?: 'horizontal' | 'vertical';
8
+ orientation?: 'horizontal' | 'vertical' | 'justified';
9
+ /**
10
+ * Pads each item for edge-to-edge rows (e.g. directly inside a
11
+ * `sectioned` Card, with `divided`).
12
+ * @default 'none'
13
+ */
14
+ inset?: 'none' | 'sm' | 'default';
9
15
  /**
10
16
  * Scale size of fonts and spacing.
11
17
  * @default 'default'
@@ -25,7 +31,9 @@ export interface DataListItemProps extends React.HTMLAttributes<HTMLDivElement>
25
31
  /**
26
32
  * Item-level orientation override.
27
33
  */
28
- orientation?: 'horizontal' | 'vertical';
34
+ orientation?: 'horizontal' | 'vertical' | 'justified';
35
+ /** `total`: a summary line (semibold label and value). */
36
+ emphasis?: 'none' | 'total';
29
37
  /**
30
38
  * Vertical alignment of label and value in horizontal mode.
31
39
  * @default 'baseline'
@@ -45,11 +53,20 @@ export interface DataListLabelProps extends React.HTMLAttributes<HTMLElement> {
45
53
  * Optional icon node beside the label.
46
54
  */
47
55
  icon?: React.ReactNode;
56
+ /** Secondary line under the label. */
57
+ description?: React.ReactNode;
58
+ /** `strong`: foreground semibold, when the label is the main text of the row. */
59
+ tone?: 'muted' | 'strong';
48
60
  /**
49
61
  * Content element.
50
62
  */
51
63
  children?: React.ReactNode;
52
64
  }
65
+ export interface DataListActionProps extends React.HTMLAttributes<HTMLElement> {
66
+ /** Small screens: on the right of the label (`end`) or under it (`below`). */
67
+ placement?: 'end' | 'below';
68
+ children?: React.ReactNode;
69
+ }
53
70
  export interface DataListValueProps extends React.HTMLAttributes<HTMLElement> {
54
71
  /**
55
72
  * Content element.
@@ -1 +1 @@
1
- {"version":3,"file":"DataList.types.d.ts","sourceRoot":"","sources":["../../../src/components/DataList/DataList.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAC5C,gBAAgB;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;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AC,WAAW,CAAC;IAC3E;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- import type { DrawerProps, DrawerContentProps, DrawerHeaderProps, DrawerFooterProps } from './Drawer.types';
3
+ import type { DrawerProps, DrawerContentProps, DrawerHeaderProps, DrawerFooterProps, DrawerBodyProps } from './Drawer.types';
4
4
  export declare const Drawer: React.FC<DrawerProps>;
5
5
  export declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
6
  export declare const DrawerPortal: React.FC<DialogPrimitive.DialogPortalProps>;
@@ -9,6 +9,7 @@ export declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<DialogP
9
9
  export declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
10
10
  export declare const DrawerHeader: React.FC<DrawerHeaderProps>;
11
11
  export declare const DrawerFooter: React.FC<DrawerFooterProps>;
12
- export declare const DrawerTitle: React.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
13
- export declare const DrawerDescription: React.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
12
+ export declare const DrawerBody: React.FC<DrawerBodyProps>;
13
+ export declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
14
+ export declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
14
15
  //# sourceMappingURL=Drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAW1D,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAwB,CAAC;AAClE,eAAO,MAAM,aAAa,8GAA0B,CAAC;AACrD,eAAO,MAAM,YAAY,6CAAyB,CAAC;AACnD,eAAO,MAAM,WAAW,4GAAwB,CAAC;AAEjD,eAAO,MAAM,aAAa,8JAUxB,CAAC;AAGH,eAAO,MAAM,aAAa,2FAmCxB,CAAC;AAGH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAEpD,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAEpD,CAAC;AAGF,eAAO,MAAM,WAAW,6GAAwB,CAAC;AACjD,eAAO,MAAM,iBAAiB,qHAA8B,CAAC"}
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAc1D,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAwB,CAAC;AAClE,eAAO,MAAM,aAAa,8GAA0B,CAAC;AACrD,eAAO,MAAM,YAAY,6CAAyB,CAAC;AACnD,eAAO,MAAM,WAAW,4GAAwB,CAAC;AAEjD,eAAO,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