@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
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import * as DialogPrimitive from '@radix-ui/react-dialog';
5
5
  import { cn } from '@timmbr/utils';
6
6
  import { X } from '@timmbr/icons';
7
7
  import { resolveMotion } from '../../types/motion.js';
8
- import { drawerContentVariants, drawerFooterVariants, drawerHeaderVariants, drawerOverlayVariants } from './Drawer.styles.js';
8
+ import { drawerBodyVariants, drawerContentVariants, drawerDescriptionVariants, drawerFooterVariants, drawerHeaderVariants, drawerOverlayVariants, drawerTitleVariants } from './Drawer.styles.js';
9
9
  import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
10
10
 
11
11
  const Drawer = DialogPrimitive.Root;
@@ -40,7 +40,14 @@ const DrawerContent = React.forwardRef(({ className, children, side = "right", m
40
40
  ),
41
41
  ...props,
42
42
  children: [
43
- side === "bottom" && /* @__PURE__ */ jsx("div", { className: "mx-auto mb-4 h-1.5 w-12 rounded-full bg-grey-300 dark:bg-grey-700" }),
43
+ side === "bottom" && /* @__PURE__ */ jsx(
44
+ "div",
45
+ {
46
+ "aria-hidden": "true",
47
+ "data-slot": "drawer-handle",
48
+ className: "mx-auto h-1.5 w-12 shrink-0 rounded-full bg-grey-300 dark:bg-grey-700"
49
+ }
50
+ ),
44
51
  children,
45
52
  /* @__PURE__ */ jsxs(
46
53
  DialogPrimitive.Close,
@@ -63,7 +70,27 @@ const DrawerHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { c
63
70
  DrawerHeader.displayName = "DrawerHeader";
64
71
  const DrawerFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(drawerFooterVariants(), className), ...props });
65
72
  DrawerFooter.displayName = "DrawerFooter";
66
- const DrawerTitle = DialogPrimitive.Title;
67
- const DrawerDescription = DialogPrimitive.Description;
73
+ const DrawerBody = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "drawer-body", className: cn(drawerBodyVariants(), className), ...props });
74
+ DrawerBody.displayName = "DrawerBody";
75
+ const DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
76
+ DialogPrimitive.Title,
77
+ {
78
+ ref,
79
+ "data-slot": "drawer-title",
80
+ className: cn(drawerTitleVariants(), className),
81
+ ...props
82
+ }
83
+ ));
84
+ DrawerTitle.displayName = DialogPrimitive.Title.displayName;
85
+ const DrawerDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
86
+ DialogPrimitive.Description,
87
+ {
88
+ ref,
89
+ "data-slot": "drawer-description",
90
+ className: cn(drawerDescriptionVariants(), className),
91
+ ...props
92
+ }
93
+ ));
94
+ DrawerDescription.displayName = DialogPrimitive.Description.displayName;
68
95
 
69
- export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
96
+ export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
@@ -5,5 +5,9 @@ export declare const drawerContentVariants: (props?: ({
5
5
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
6
  export declare const drawerHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
7
  export declare const drawerFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
+ /** Scrolls on its own so the header and footer stay in view (bottom sheets with long forms). */
9
+ export declare const drawerBodyVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
+ export declare const drawerTitleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
+ export declare const drawerDescriptionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
12
  export type DrawerContentVariants = VariantProps<typeof drawerContentVariants>;
9
13
  //# sourceMappingURL=Drawer.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;8EAejC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
1
+ {"version":3,"file":"Drawer.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;8EAejC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,kBAAkB,oFAAsE,CAAC;AAEtG,eAAO,MAAM,mBAAmB,oFAA2E,CAAC;AAE5G,eAAO,MAAM,yBAAyB,oFAA2D,CAAC;AAElG,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -4,12 +4,12 @@ const drawerOverlayVariants = cva(
4
4
  "fixed inset-0 z-50 bg-grey-1000/60 backdrop-blur-xs transition-opacity duration-300 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out"
5
5
  );
6
6
  const drawerContentVariants = cva(
7
- "fixed z-50 gap-4 bg-grey-50 dark:bg-grey-900 p-6 shadow-2xl transition ease-in-out duration-300 font-sans text-foreground border-grey-200 dark:border-grey-800",
7
+ "fixed z-50 flex flex-col gap-4 bg-grey-50 dark:bg-grey-900 p-6 shadow-2xl transition ease-in-out duration-300 font-sans text-foreground border-grey-200 dark:border-grey-800",
8
8
  {
9
9
  variants: {
10
10
  side: {
11
11
  top: "inset-x-0 top-0 border-b data-[state=open]:animate-slide-in-from-top data-[state=closed]:animate-slide-out-to-top",
12
- bottom: "inset-x-0 bottom-0 border-t rounded-t-2xl max-h-[85vh] data-[state=open]:animate-slide-in-from-bottom data-[state=closed]:animate-slide-out-to-bottom",
12
+ bottom: "inset-x-0 bottom-0 border-t rounded-t-2xl max-h-[90dvh] pt-3 pb-[max(1.5rem,env(safe-area-inset-bottom))] data-[state=open]:animate-slide-in-from-bottom data-[state=closed]:animate-slide-out-to-bottom",
13
13
  left: "inset-y-0 left-0 h-full w-3/4 max-w-sm border-r data-[state=open]:animate-slide-in-from-left data-[state=closed]:animate-slide-out-to-left",
14
14
  right: "inset-y-0 right-0 h-full w-3/4 max-w-md border-l data-[state=open]:animate-slide-in-from-right data-[state=closed]:animate-slide-out-to-right"
15
15
  }
@@ -20,10 +20,13 @@ const drawerContentVariants = cva(
20
20
  }
21
21
  );
22
22
  const drawerHeaderVariants = cva(
23
- "flex flex-col space-y-1.5 text-left"
23
+ "flex shrink-0 flex-col space-y-1.5 text-left pr-8"
24
24
  );
25
25
  const drawerFooterVariants = cva(
26
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 gap-2 mt-auto pt-4"
26
+ "flex shrink-0 flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 gap-2 mt-auto pt-4"
27
27
  );
28
+ const drawerBodyVariants = cva("-mx-6 min-h-0 flex-1 overflow-y-auto overscroll-contain px-6");
29
+ const drawerTitleVariants = cva("text-h5 font-semibold leading-none tracking-tight text-foreground");
30
+ const drawerDescriptionVariants = cva("text-body-2 text-muted-foreground leading-relaxed");
28
31
 
29
- export { drawerContentVariants, drawerFooterVariants, drawerHeaderVariants, drawerOverlayVariants };
32
+ export { drawerBodyVariants, drawerContentVariants, drawerDescriptionVariants, drawerFooterVariants, drawerHeaderVariants, drawerOverlayVariants, drawerTitleVariants };
@@ -11,4 +11,5 @@ export interface DrawerContentProps extends React.ComponentPropsWithoutRef<typeo
11
11
  }
12
12
  export type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
13
13
  export type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
14
+ export type DrawerBodyProps = React.HTMLAttributes<HTMLDivElement>;
14
15
  //# sourceMappingURL=Drawer.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.types.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;AAEtD,MAAM,WAAW,kBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EACpE,qBAAqB;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"Drawer.types.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;AAEtD,MAAM,WAAW,kBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EACpE,qBAAqB;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACrE,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAMvE,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAA8B,CAAC;AACpF,eAAO,MAAM,mBAAmB,0HAAgC,CAAC;AACjE,eAAO,MAAM,iBAAiB,qHAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,yDAA+B,CAAC;AAC/D,eAAO,MAAM,eAAe,sDAA4B,CAAC;AACzD,eAAO,MAAM,sBAAsB,0HAAmC,CAAC;AAEvE,eAAO,MAAM,sBAAsB;YAGvB,OAAO;wCAiBjB,CAAC;AAGH,eAAO,MAAM,sBAAsB,6KAUjC,CAAC;AAGH,eAAO,MAAM,mBAAmB,iGAuB9B,CAAC;AAGH,eAAO,MAAM,gBAAgB,8FAU3B,CAAC;AAGH,eAAO,MAAM,wBAAwB,+KAsBnC,CAAC;AAGH,eAAO,MAAM,iBAAiB;YAGlB,OAAO;wCAajB,CAAC;AAGH,eAAO,MAAM,qBAAqB,4KAUhC,CAAC;AAGH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAUhF,CAAC"}
1
+ {"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAMvE,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAA8B,CAAC;AACpF,eAAO,MAAM,mBAAmB,0HAAgC,CAAC;AACjE,eAAO,MAAM,iBAAiB,qHAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,yDAA+B,CAAC;AAC/D,eAAO,MAAM,eAAe,sDAA4B,CAAC;AACzD,eAAO,MAAM,sBAAsB,0HAAmC,CAAC;AAEvE,eAAO,MAAM,sBAAsB;YAGvB,OAAO;wCAiBjB,CAAC;AAGH,eAAO,MAAM,sBAAsB,6KAUjC,CAAC;AAGH,eAAO,MAAM,mBAAmB,iGAuB9B,CAAC;AAGH,eAAO,MAAM,gBAAgB,8FAoC3B,CAAC;AAGH,eAAO,MAAM,wBAAwB,+KAsBnC,CAAC;AAGH,eAAO,MAAM,iBAAiB;YAGlB,OAAO;wCAajB,CAAC;AAGH,eAAO,MAAM,qBAAqB,4KAUhC,CAAC;AAGH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAUhF,CAAC"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
5
5
  import { cn } from '@timmbr/utils';
6
6
  import { Check, ChevronRight } from '@timmbr/icons';
7
7
  import { resolveMotion } from '../../types/motion.js';
8
- import { dropdownItemVariants, dropdownContentVariants } from './Dropdown.styles.js';
8
+ import { dropdownItemVariants, dropdownContentVariants, dropdownItemIconVariants } from './Dropdown.styles.js';
9
9
  import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
10
10
 
11
11
  const DropdownMenu = DropdownMenuPrimitive.Root;
@@ -63,15 +63,28 @@ const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, motio
63
63
  ) });
64
64
  });
65
65
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
66
- const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
67
- DropdownMenuPrimitive.Item,
68
- {
69
- ref,
70
- "data-slot": "dropdown-item",
71
- className: cn(dropdownItemVariants(), inset && "pl-8", className),
72
- ...props
66
+ const DropdownMenuItem = React.forwardRef(({ className, inset, icon, destructive, asChild, children, ...props }, ref) => {
67
+ const iconNode = icon ? /* @__PURE__ */ jsx("span", { "data-slot": "dropdown-item-icon", "aria-hidden": "true", className: dropdownItemIconVariants(), children: icon }) : null;
68
+ let content = children;
69
+ if (iconNode) {
70
+ content = asChild && React.isValidElement(children) ? React.cloneElement(children, void 0, iconNode, children.props.children) : /* @__PURE__ */ jsxs(Fragment, { children: [
71
+ iconNode,
72
+ children
73
+ ] });
73
74
  }
74
- ));
75
+ return /* @__PURE__ */ jsx(
76
+ DropdownMenuPrimitive.Item,
77
+ {
78
+ ref,
79
+ asChild,
80
+ "data-slot": "dropdown-item",
81
+ "data-destructive": destructive ? "" : void 0,
82
+ className: cn(dropdownItemVariants({ destructive }), icon && "gap-2", inset && "pl-8", className),
83
+ ...props,
84
+ children: content
85
+ }
86
+ );
87
+ });
75
88
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
76
89
  const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
77
90
  DropdownMenuPrimitive.CheckboxItem,
@@ -1,3 +1,7 @@
1
1
  export declare const dropdownContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
2
- export declare const dropdownItemVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
2
+ export declare const dropdownItemVariants: (props?: ({
3
+ destructive?: boolean | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ /** Leading icon of a menu item. */
6
+ export declare const dropdownItemIconVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
3
7
  //# sourceMappingURL=Dropdown.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,oFAEnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC"}
1
+ {"version":3,"file":"Dropdown.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,oFAEnC,CAAC;AAEF,eAAO,MAAM,oBAAoB;;8EAWhC,CAAC;AAEF,mCAAmC;AACnC,eAAO,MAAM,wBAAwB,oFAAyE,CAAC"}
@@ -4,7 +4,17 @@ const dropdownContentVariants = cva(
4
4
  "z-50 min-w-[8rem] overflow-hidden rounded-md border border-grey-200 dark:border-grey-700 bg-grey-50 dark:bg-grey-900 p-1 text-foreground shadow-lg font-sans transition-all duration-150 data-[state=open]:animate-scale-in data-[state=closed]:animate-scale-out"
5
5
  );
6
6
  const dropdownItemVariants = cva(
7
- "relative flex cursor-pointer select-none items-center rounded-sm px-2.5 py-1.5 text-body-2 outline-none transition-colors hover:bg-grey-100 dark:hover:bg-grey-800 focus:bg-grey-100 dark:focus:bg-grey-800 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
7
+ "relative flex cursor-pointer select-none items-center rounded-sm px-2.5 py-1.5 text-body-2 outline-none transition-colors hover:bg-grey-100 dark:hover:bg-grey-800 focus:bg-grey-100 dark:focus:bg-grey-800 focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
8
+ {
9
+ variants: {
10
+ destructive: {
11
+ true: "text-destructive hover:bg-destructive/10 focus:bg-destructive/10 focus:text-destructive dark:hover:bg-destructive/15 dark:focus:bg-destructive/15",
12
+ false: ""
13
+ }
14
+ },
15
+ defaultVariants: { destructive: false }
16
+ }
8
17
  );
18
+ const dropdownItemIconVariants = cva("flex size-4 shrink-0 items-center justify-center [&_svg]:size-4");
9
19
 
10
- export { dropdownContentVariants, dropdownItemVariants };
20
+ export { dropdownContentVariants, dropdownItemIconVariants, dropdownItemVariants };
@@ -10,5 +10,9 @@ export interface DropdownMenuContentProps extends React.ComponentPropsWithoutRef
10
10
  }
11
11
  export interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {
12
12
  inset?: boolean;
13
+ /** Leading icon (also placed inside an `asChild` link). */
14
+ icon?: React.ReactNode;
15
+ /** Destructive action (e.g. Log out, Delete): red text and highlight. */
16
+ destructive?: boolean;
13
17
  }
14
18
  //# sourceMappingURL=Dropdown.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dropdown.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,iBAAiB,CAAC;AAExE,MAAM,WAAW,wBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC;IAC5E;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,qBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
1
+ {"version":3,"file":"Dropdown.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,iBAAiB,CAAC;AAExE,MAAM,WAAW,wBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC;IAC5E;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,qBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,UAAU,wFAyEtB,CAAC"}
1
+ {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,UAAU,wFA0EtB,CAAC"}
@@ -12,6 +12,7 @@ const EmptyState = React.forwardRef(
12
12
  className,
13
13
  variant = "default",
14
14
  size = "default",
15
+ fullWidth = false,
15
16
  icon,
16
17
  title,
17
18
  description,
@@ -29,7 +30,7 @@ const EmptyState = React.forwardRef(
29
30
  ref,
30
31
  "data-slot": "empty-state",
31
32
  className: cn(
32
- emptyStateVariants({ variant, size }),
33
+ emptyStateVariants({ variant, size, fullWidth }),
33
34
  !shouldAnimate && "transition-none animate-none",
34
35
  motionClass,
35
36
  className
@@ -1,10 +1,11 @@
1
1
  import { type VariantProps } from 'class-variance-authority';
2
2
  export declare const emptyStateVariants: (props?: ({
3
3
  variant?: "default" | "subtle" | "bordered" | null | undefined;
4
- size?: "default" | "sm" | "lg" | null | undefined;
4
+ size?: "sm" | "lg" | "default" | null | undefined;
5
+ fullWidth?: boolean | null | undefined;
5
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
7
  export declare const emptyStateIconWrapperVariants: (props?: ({
7
- size?: "default" | "sm" | "lg" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | null | undefined;
8
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
10
  export type EmptyStateVariants = VariantProps<typeof emptyStateVariants>;
10
11
  //# sourceMappingURL=EmptyState.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.styles.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyState/EmptyState.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,kBAAkB;;;8EAsB9B,CAAC;AAEF,eAAO,MAAM,6BAA6B;;8EAczC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"EmptyState.styles.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyState/EmptyState.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,kBAAkB;;;;8EA2B9B,CAAC;AAEF,eAAO,MAAM,6BAA6B;;8EAczC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -13,6 +13,11 @@ const emptyStateVariants = cva(
13
13
  sm: "py-6 px-4 max-w-sm",
14
14
  default: "py-10 px-6 max-w-md",
15
15
  lg: "py-16 px-8 max-w-lg"
16
+ },
17
+ /** Fill the container instead of the size's max width. */
18
+ fullWidth: {
19
+ true: "w-full max-w-none",
20
+ false: ""
16
21
  }
17
22
  },
18
23
  defaultVariants: {
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { type GapValue } from '../../utils/gap';
3
+ export interface FieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {
4
+ /** Group title (an overline label above the fields). */
5
+ legend: React.ReactNode;
6
+ /** Space between the fields. @default 4 */
7
+ gap?: GapValue;
8
+ }
9
+ /**
10
+ * Groups related form fields under a label ("Contact", "Address"…). Fixes the
11
+ * fieldset quirks: it can shrink (`min-w-0`) and the legend gets its spacing.
12
+ */
13
+ export declare const Fieldset: React.ForwardRefExoticComponent<FieldsetProps & React.RefAttributes<HTMLFieldSetElement>>;
14
+ //# sourceMappingURL=Fieldset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fieldset.d.ts","sourceRoot":"","sources":["../../../src/components/Fieldset/Fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3D,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC;IACtF,wDAAwD;IACxD,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,QAAQ,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,2FAiBpB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { cn } from '@timmbr/utils';
4
+ import { formatGap } from '../../utils/gap.js';
5
+ import { Text } from '../Text/Text.js';
6
+
7
+ const Fieldset = React.forwardRef(
8
+ ({ legend, gap = 4, className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
9
+ "fieldset",
10
+ {
11
+ ref,
12
+ "data-slot": "fieldset",
13
+ className: cn("flex min-w-0 flex-col border-0 p-0 m-0", formatGap(gap), className),
14
+ ...props,
15
+ children: [
16
+ /* @__PURE__ */ jsx(Text, { asChild: true, variant: "overline", foreground: "muted", children: /* @__PURE__ */ jsx("legend", { "data-slot": "fieldset-legend", className: "mb-3 p-0", children: legend }) }),
17
+ children
18
+ ]
19
+ }
20
+ )
21
+ );
22
+ Fieldset.displayName = "Fieldset";
23
+
24
+ export { Fieldset };
@@ -0,0 +1,2 @@
1
+ export * from './Fieldset';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Fieldset/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export interface FormActionsProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ /** Line above the buttons. */
4
+ divider?: boolean;
5
+ /** Where the buttons sit from `sm` up. @default 'end' */
6
+ align?: 'start' | 'end' | 'between';
7
+ }
8
+ /**
9
+ * The buttons at the end of a form. Small screens stack them full width with
10
+ * the primary (last) button on top; from `sm` up they sit in a row.
11
+ */
12
+ export declare const FormActions: React.ForwardRefExoticComponent<FormActionsProps & React.RefAttributes<HTMLDivElement>>;
13
+ //# sourceMappingURL=FormActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormActions.d.ts","sourceRoot":"","sources":["../../../src/components/FormActions/FormActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,8BAA8B;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;CACrC;AAID;;;GAGG;AACH,eAAO,MAAM,WAAW,yFAcvB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { cn } from '@timmbr/utils';
4
+
5
+ const ALIGN = { start: "sm:justify-start", end: "sm:justify-end", between: "sm:justify-between" };
6
+ const FormActions = React.forwardRef(
7
+ ({ divider = false, align = "end", className, ...props }, ref) => /* @__PURE__ */ jsx(
8
+ "div",
9
+ {
10
+ ref,
11
+ "data-slot": "form-actions",
12
+ className: cn(
13
+ "flex flex-col-reverse gap-2 sm:flex-row sm:items-center",
14
+ ALIGN[align],
15
+ divider && "border-t border-border pt-4",
16
+ className
17
+ ),
18
+ ...props
19
+ }
20
+ )
21
+ );
22
+ FormActions.displayName = "FormActions";
23
+
24
+ export { FormActions };
@@ -0,0 +1,2 @@
1
+ export * from './FormActions';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FormActions/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -1,4 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { GridProps } from './Grid.types';
2
+ import type { GridItemProps, GridProps } from './Grid.types';
3
3
  export declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
4
+ /** A grid cell that spans several columns (optionally per breakpoint). */
5
+ export declare const GridItem: React.ForwardRefExoticComponent<GridItemProps & React.RefAttributes<HTMLDivElement>>;
4
6
  //# sourceMappingURL=Grid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,eAAO,MAAM,IAAI,kFAsDhB,CAAC"}
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI7D,eAAO,MAAM,IAAI,kFAqEhB,CAAC;AAIF,0EAA0E;AAC1E,eAAO,MAAM,QAAQ,sFAUpB,CAAC"}
@@ -3,9 +3,10 @@ import { jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import { Slot } from '@radix-ui/react-slot';
5
5
  import { cn } from '@timmbr/utils';
6
- import { formatGap } from '../../utils/gap.js';
7
- import { colsMap, smColsMap, mdColsMap, lgColsMap, xlColsMap, gridVariants } from './Grid.styles.js';
6
+ import { formatGap, formatAxisGap } from '../../utils/gap.js';
7
+ import { colsMap, smColsMap, mdColsMap, lgColsMap, xlColsMap, templateClassMap, gridVariants, spanClassMap } from './Grid.styles.js';
8
8
 
9
+ const BREAKPOINTS = ["base", "sm", "md", "lg", "xl"];
9
10
  const Grid = React.forwardRef(
10
11
  ({
11
12
  className,
@@ -16,6 +17,7 @@ const Grid = React.forwardRef(
16
17
  colGap,
17
18
  autoFit = false,
18
19
  minChildWidth = "240px",
20
+ template,
19
21
  asChild = false,
20
22
  children,
21
23
  ...props
@@ -28,15 +30,27 @@ const Grid = React.forwardRef(
28
30
  } else if (typeof cols === "number") {
29
31
  responsiveClasses.push(colsMap[cols] || "grid-cols-1");
30
32
  } else if (typeof cols === "object") {
33
+ if (cols.base) responsiveClasses.push(colsMap[cols.base] || "");
31
34
  if (cols.sm) responsiveClasses.push(smColsMap[cols.sm] || "");
32
35
  if (cols.md) responsiveClasses.push(mdColsMap[cols.md] || "");
33
36
  if (cols.lg) responsiveClasses.push(lgColsMap[cols.lg] || "");
34
37
  if (cols.xl) responsiveClasses.push(xlColsMap[cols.xl] || "");
35
38
  }
36
39
  const gapClass = formatGap(gap);
37
- const rowGapClass = rowGap !== void 0 ? typeof rowGap === "number" ? `gap-y-${rowGap}` : `gap-y-[${rowGap}]` : "";
38
- const colGapClass = colGap !== void 0 ? typeof colGap === "number" ? `gap-x-${colGap}` : `gap-x-[${colGap}]` : "";
40
+ const rowGapClass = formatAxisGap("y", rowGap);
41
+ const colGapClass = formatAxisGap("x", colGap);
42
+ const templateVars = {};
43
+ if (template) {
44
+ const byBreakpoint = typeof template === "string" ? { base: template } : template;
45
+ for (const bp of BREAKPOINTS) {
46
+ const value = byBreakpoint[bp];
47
+ if (!value) continue;
48
+ templateVars[bp === "base" ? "--grid-template" : `--grid-template-${bp}`] = value;
49
+ responsiveClasses.push(templateClassMap[bp]);
50
+ }
51
+ }
39
52
  const gridStyles = {
53
+ ...templateVars,
40
54
  ...style,
41
55
  ...customGridTemplate ? { gridTemplateColumns: customGridTemplate } : {}
42
56
  };
@@ -54,5 +68,17 @@ const Grid = React.forwardRef(
54
68
  }
55
69
  );
56
70
  Grid.displayName = "Grid";
71
+ const GridItem = React.forwardRef(
72
+ ({ className, span, asChild = false, ...props }, ref) => {
73
+ const Component = asChild ? Slot : "div";
74
+ const bySize = span === void 0 ? {} : typeof span === "object" ? span : { base: span };
75
+ const spanClasses = BREAKPOINTS.map((bp) => {
76
+ const value = bySize[bp];
77
+ return value === void 0 ? void 0 : spanClassMap[bp][String(value)];
78
+ });
79
+ return /* @__PURE__ */ jsx(Component, { ref, "data-slot": "grid-item", className: cn(spanClasses, className), ...props });
80
+ }
81
+ );
82
+ GridItem.displayName = "GridItem";
57
83
 
58
- export { Grid };
84
+ export { Grid, GridItem };
@@ -4,4 +4,90 @@ export declare const smColsMap: Record<number, string>;
4
4
  export declare const mdColsMap: Record<number, string>;
5
5
  export declare const lgColsMap: Record<number, string>;
6
6
  export declare const xlColsMap: Record<number, string>;
7
+ /** `template`: the column template comes from a CSS variable per breakpoint (literal classes). */
8
+ export declare const templateClassMap: {
9
+ readonly base: "grid-cols-[var(--grid-template)]";
10
+ readonly sm: "sm:grid-cols-[var(--grid-template-sm)]";
11
+ readonly md: "md:grid-cols-[var(--grid-template-md)]";
12
+ readonly lg: "lg:grid-cols-[var(--grid-template-lg)]";
13
+ readonly xl: "xl:grid-cols-[var(--grid-template-xl)]";
14
+ };
15
+ /** GridItem `span` classes per breakpoint. */
16
+ export declare const spanClassMap: {
17
+ readonly base: {
18
+ readonly 1: "col-span-1";
19
+ readonly 2: "col-span-2";
20
+ readonly 3: "col-span-3";
21
+ readonly 4: "col-span-4";
22
+ readonly 5: "col-span-5";
23
+ readonly 6: "col-span-6";
24
+ readonly 7: "col-span-7";
25
+ readonly 8: "col-span-8";
26
+ readonly 9: "col-span-9";
27
+ readonly 10: "col-span-10";
28
+ readonly 11: "col-span-11";
29
+ readonly 12: "col-span-12";
30
+ readonly full: "col-span-full";
31
+ };
32
+ readonly sm: {
33
+ readonly 1: "sm:col-span-1";
34
+ readonly 2: "sm:col-span-2";
35
+ readonly 3: "sm:col-span-3";
36
+ readonly 4: "sm:col-span-4";
37
+ readonly 5: "sm:col-span-5";
38
+ readonly 6: "sm:col-span-6";
39
+ readonly 7: "sm:col-span-7";
40
+ readonly 8: "sm:col-span-8";
41
+ readonly 9: "sm:col-span-9";
42
+ readonly 10: "sm:col-span-10";
43
+ readonly 11: "sm:col-span-11";
44
+ readonly 12: "sm:col-span-12";
45
+ readonly full: "sm:col-span-full";
46
+ };
47
+ readonly md: {
48
+ readonly 1: "md:col-span-1";
49
+ readonly 2: "md:col-span-2";
50
+ readonly 3: "md:col-span-3";
51
+ readonly 4: "md:col-span-4";
52
+ readonly 5: "md:col-span-5";
53
+ readonly 6: "md:col-span-6";
54
+ readonly 7: "md:col-span-7";
55
+ readonly 8: "md:col-span-8";
56
+ readonly 9: "md:col-span-9";
57
+ readonly 10: "md:col-span-10";
58
+ readonly 11: "md:col-span-11";
59
+ readonly 12: "md:col-span-12";
60
+ readonly full: "md:col-span-full";
61
+ };
62
+ readonly lg: {
63
+ readonly 1: "lg:col-span-1";
64
+ readonly 2: "lg:col-span-2";
65
+ readonly 3: "lg:col-span-3";
66
+ readonly 4: "lg:col-span-4";
67
+ readonly 5: "lg:col-span-5";
68
+ readonly 6: "lg:col-span-6";
69
+ readonly 7: "lg:col-span-7";
70
+ readonly 8: "lg:col-span-8";
71
+ readonly 9: "lg:col-span-9";
72
+ readonly 10: "lg:col-span-10";
73
+ readonly 11: "lg:col-span-11";
74
+ readonly 12: "lg:col-span-12";
75
+ readonly full: "lg:col-span-full";
76
+ };
77
+ readonly xl: {
78
+ readonly 1: "xl:col-span-1";
79
+ readonly 2: "xl:col-span-2";
80
+ readonly 3: "xl:col-span-3";
81
+ readonly 4: "xl:col-span-4";
82
+ readonly 5: "xl:col-span-5";
83
+ readonly 6: "xl:col-span-6";
84
+ readonly 7: "xl:col-span-7";
85
+ readonly 8: "xl:col-span-8";
86
+ readonly 9: "xl:col-span-9";
87
+ readonly 10: "xl:col-span-10";
88
+ readonly 11: "xl:col-span-11";
89
+ readonly 12: "xl:col-span-12";
90
+ readonly full: "xl:col-span-full";
91
+ };
92
+ };
7
93
  //# sourceMappingURL=Grid.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Grid.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,oFAAqB,CAAC;AAE/C,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa1C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5C,CAAC"}
1
+ {"version":3,"file":"Grid.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,oFAAqB,CAAC;AAE/C,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa1C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5C,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAa5C,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAEX,8CAA8C;AAC9C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Ef,CAAC"}