@duestel/ui 0.1.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 (226) hide show
  1. package/README.md +110 -0
  2. package/dist/components/accordion/Accordion.d.ts +34 -0
  3. package/dist/components/accordion/Accordion.js +54 -0
  4. package/dist/components/accordion/Accordion.js.map +1 -0
  5. package/dist/components/accordion/index.d.ts +1 -0
  6. package/dist/components/accordion/index.js +2 -0
  7. package/dist/components/alert-dialog/AlertDialog.d.ts +53 -0
  8. package/dist/components/alert-dialog/AlertDialog.js +69 -0
  9. package/dist/components/alert-dialog/AlertDialog.js.map +1 -0
  10. package/dist/components/alert-dialog/index.d.ts +1 -0
  11. package/dist/components/alert-dialog/index.js +2 -0
  12. package/dist/components/autocomplete/Autocomplete.d.ts +90 -0
  13. package/dist/components/autocomplete/Autocomplete.js +137 -0
  14. package/dist/components/autocomplete/Autocomplete.js.map +1 -0
  15. package/dist/components/autocomplete/index.d.ts +1 -0
  16. package/dist/components/autocomplete/index.js +2 -0
  17. package/dist/components/avatar/Avatar.d.ts +44 -0
  18. package/dist/components/avatar/Avatar.js +45 -0
  19. package/dist/components/avatar/Avatar.js.map +1 -0
  20. package/dist/components/avatar/index.d.ts +2 -0
  21. package/dist/components/avatar/index.js +2 -0
  22. package/dist/components/badge/Badge.d.ts +43 -0
  23. package/dist/components/badge/Badge.js +32 -0
  24. package/dist/components/badge/Badge.js.map +1 -0
  25. package/dist/components/badge/index.d.ts +2 -0
  26. package/dist/components/badge/index.js +2 -0
  27. package/dist/components/button/Button.d.ts +60 -0
  28. package/dist/components/button/Button.js +61 -0
  29. package/dist/components/button/Button.js.map +1 -0
  30. package/dist/components/button/index.d.ts +1 -0
  31. package/dist/components/button/index.js +2 -0
  32. package/dist/components/carousel/Carousel.d.ts +32 -0
  33. package/dist/components/carousel/Carousel.js +113 -0
  34. package/dist/components/carousel/Carousel.js.map +1 -0
  35. package/dist/components/carousel/index.d.ts +1 -0
  36. package/dist/components/carousel/index.js +2 -0
  37. package/dist/components/checkbox/Checkbox.d.ts +64 -0
  38. package/dist/components/checkbox/Checkbox.js +59 -0
  39. package/dist/components/checkbox/Checkbox.js.map +1 -0
  40. package/dist/components/checkbox/index.d.ts +1 -0
  41. package/dist/components/checkbox/index.js +2 -0
  42. package/dist/components/collapsible/Collapsible.d.ts +28 -0
  43. package/dist/components/collapsible/Collapsible.js +40 -0
  44. package/dist/components/collapsible/Collapsible.js.map +1 -0
  45. package/dist/components/collapsible/index.d.ts +1 -0
  46. package/dist/components/collapsible/index.js +2 -0
  47. package/dist/components/combobox/Combobox.d.ts +113 -0
  48. package/dist/components/combobox/Combobox.js +189 -0
  49. package/dist/components/combobox/Combobox.js.map +1 -0
  50. package/dist/components/combobox/index.d.ts +1 -0
  51. package/dist/components/combobox/index.js +2 -0
  52. package/dist/components/command/Command.d.ts +37 -0
  53. package/dist/components/command/Command.js +90 -0
  54. package/dist/components/command/Command.js.map +1 -0
  55. package/dist/components/command/index.d.ts +1 -0
  56. package/dist/components/command/index.js +2 -0
  57. package/dist/components/context-menu/ContextMenu.d.ts +76 -0
  58. package/dist/components/context-menu/ContextMenu.js +132 -0
  59. package/dist/components/context-menu/ContextMenu.js.map +1 -0
  60. package/dist/components/context-menu/index.d.ts +1 -0
  61. package/dist/components/context-menu/index.js +2 -0
  62. package/dist/components/data-table/DataTable.d.ts +32 -0
  63. package/dist/components/data-table/DataTable.js +102 -0
  64. package/dist/components/data-table/DataTable.js.map +1 -0
  65. package/dist/components/data-table/Table.d.ts +51 -0
  66. package/dist/components/data-table/Table.js +69 -0
  67. package/dist/components/data-table/Table.js.map +1 -0
  68. package/dist/components/data-table/index.d.ts +3 -0
  69. package/dist/components/data-table/index.js +3 -0
  70. package/dist/components/date-picker/DatePicker.d.ts +63 -0
  71. package/dist/components/date-picker/DatePicker.js +247 -0
  72. package/dist/components/date-picker/DatePicker.js.map +1 -0
  73. package/dist/components/date-picker/index.d.ts +2 -0
  74. package/dist/components/date-picker/index.js +2 -0
  75. package/dist/components/dialog/Dialog.d.ts +59 -0
  76. package/dist/components/dialog/Dialog.js +71 -0
  77. package/dist/components/dialog/Dialog.js.map +1 -0
  78. package/dist/components/dialog/index.d.ts +1 -0
  79. package/dist/components/dialog/index.js +2 -0
  80. package/dist/components/drawer/Drawer.d.ts +93 -0
  81. package/dist/components/drawer/Drawer.js +106 -0
  82. package/dist/components/drawer/Drawer.js.map +1 -0
  83. package/dist/components/drawer/index.d.ts +1 -0
  84. package/dist/components/drawer/index.js +2 -0
  85. package/dist/components/form/Field.d.ts +52 -0
  86. package/dist/components/form/Field.js +54 -0
  87. package/dist/components/form/Field.js.map +1 -0
  88. package/dist/components/form/Fieldset.d.ts +24 -0
  89. package/dist/components/form/Fieldset.js +24 -0
  90. package/dist/components/form/Fieldset.js.map +1 -0
  91. package/dist/components/form/Form.d.ts +18 -0
  92. package/dist/components/form/Form.js +14 -0
  93. package/dist/components/form/Form.js.map +1 -0
  94. package/dist/components/form/Input.d.ts +33 -0
  95. package/dist/components/form/Input.js +99 -0
  96. package/dist/components/form/Input.js.map +1 -0
  97. package/dist/components/form/app-form.d.ts +71 -0
  98. package/dist/components/form/app-form.js +95 -0
  99. package/dist/components/form/app-form.js.map +1 -0
  100. package/dist/components/form/index.d.ts +5 -0
  101. package/dist/components/form/index.js +6 -0
  102. package/dist/components/hotkeys/Kbd.d.ts +20 -0
  103. package/dist/components/hotkeys/Kbd.js +31 -0
  104. package/dist/components/hotkeys/Kbd.js.map +1 -0
  105. package/dist/components/hotkeys/hotkeys.d.ts +14 -0
  106. package/dist/components/hotkeys/hotkeys.js +2 -0
  107. package/dist/components/hotkeys/index.d.ts +2 -0
  108. package/dist/components/hotkeys/index.js +3 -0
  109. package/dist/components/menu/Menu.d.ts +84 -0
  110. package/dist/components/menu/Menu.js +142 -0
  111. package/dist/components/menu/Menu.js.map +1 -0
  112. package/dist/components/menu/index.d.ts +1 -0
  113. package/dist/components/menu/index.js +2 -0
  114. package/dist/components/menubar/Menubar.d.ts +87 -0
  115. package/dist/components/menubar/Menubar.js +142 -0
  116. package/dist/components/menubar/Menubar.js.map +1 -0
  117. package/dist/components/menubar/index.d.ts +1 -0
  118. package/dist/components/menubar/index.js +2 -0
  119. package/dist/components/meter/Meter.d.ts +33 -0
  120. package/dist/components/meter/Meter.js +45 -0
  121. package/dist/components/meter/Meter.js.map +1 -0
  122. package/dist/components/meter/index.d.ts +1 -0
  123. package/dist/components/meter/index.js +2 -0
  124. package/dist/components/navigation-menu/NavigationMenu.d.ts +81 -0
  125. package/dist/components/navigation-menu/NavigationMenu.js +112 -0
  126. package/dist/components/navigation-menu/NavigationMenu.js.map +1 -0
  127. package/dist/components/navigation-menu/index.d.ts +1 -0
  128. package/dist/components/navigation-menu/index.js +2 -0
  129. package/dist/components/number-field/NumberField.d.ts +53 -0
  130. package/dist/components/number-field/NumberField.js +72 -0
  131. package/dist/components/number-field/NumberField.js.map +1 -0
  132. package/dist/components/number-field/index.d.ts +1 -0
  133. package/dist/components/number-field/index.js +2 -0
  134. package/dist/components/otp-field/OtpField.d.ts +33 -0
  135. package/dist/components/otp-field/OtpField.js +31 -0
  136. package/dist/components/otp-field/OtpField.js.map +1 -0
  137. package/dist/components/otp-field/index.d.ts +1 -0
  138. package/dist/components/otp-field/index.js +2 -0
  139. package/dist/components/pagination/Pagination.d.ts +17 -0
  140. package/dist/components/pagination/Pagination.js +75 -0
  141. package/dist/components/pagination/Pagination.js.map +1 -0
  142. package/dist/components/pagination/index.d.ts +1 -0
  143. package/dist/components/pagination/index.js +2 -0
  144. package/dist/components/popover/Popover.d.ts +73 -0
  145. package/dist/components/popover/Popover.js +97 -0
  146. package/dist/components/popover/Popover.js.map +1 -0
  147. package/dist/components/popover/index.d.ts +1 -0
  148. package/dist/components/popover/index.js +2 -0
  149. package/dist/components/preview-card/PreviewCard.d.ts +60 -0
  150. package/dist/components/preview-card/PreviewCard.js +83 -0
  151. package/dist/components/preview-card/PreviewCard.js.map +1 -0
  152. package/dist/components/preview-card/index.d.ts +1 -0
  153. package/dist/components/preview-card/index.js +2 -0
  154. package/dist/components/progress/Progress.d.ts +36 -0
  155. package/dist/components/progress/Progress.js +45 -0
  156. package/dist/components/progress/Progress.js.map +1 -0
  157. package/dist/components/progress/index.d.ts +1 -0
  158. package/dist/components/progress/index.js +2 -0
  159. package/dist/components/radio/Radio.d.ts +39 -0
  160. package/dist/components/radio/Radio.js +39 -0
  161. package/dist/components/radio/Radio.js.map +1 -0
  162. package/dist/components/radio/index.d.ts +1 -0
  163. package/dist/components/radio/index.js +2 -0
  164. package/dist/components/resizable/Resizable.d.ts +35 -0
  165. package/dist/components/resizable/Resizable.js +38 -0
  166. package/dist/components/resizable/Resizable.js.map +1 -0
  167. package/dist/components/resizable/index.d.ts +1 -0
  168. package/dist/components/resizable/index.js +2 -0
  169. package/dist/components/scroll-area/ScrollArea.d.ts +37 -0
  170. package/dist/components/scroll-area/ScrollArea.js +52 -0
  171. package/dist/components/scroll-area/ScrollArea.js.map +1 -0
  172. package/dist/components/scroll-area/index.d.ts +1 -0
  173. package/dist/components/scroll-area/index.js +2 -0
  174. package/dist/components/select/Select.d.ts +94 -0
  175. package/dist/components/select/Select.js +151 -0
  176. package/dist/components/select/Select.js.map +1 -0
  177. package/dist/components/select/index.d.ts +1 -0
  178. package/dist/components/select/index.js +2 -0
  179. package/dist/components/separator/Separator.d.ts +29 -0
  180. package/dist/components/separator/Separator.js +20 -0
  181. package/dist/components/separator/Separator.js.map +1 -0
  182. package/dist/components/separator/index.d.ts +1 -0
  183. package/dist/components/separator/index.js +2 -0
  184. package/dist/components/slider/Slider.d.ts +53 -0
  185. package/dist/components/slider/Slider.js +70 -0
  186. package/dist/components/slider/Slider.js.map +1 -0
  187. package/dist/components/slider/index.d.ts +1 -0
  188. package/dist/components/slider/index.js +2 -0
  189. package/dist/components/switch/Switch.d.ts +28 -0
  190. package/dist/components/switch/Switch.js +31 -0
  191. package/dist/components/switch/Switch.js.map +1 -0
  192. package/dist/components/switch/index.d.ts +1 -0
  193. package/dist/components/switch/index.js +2 -0
  194. package/dist/components/tabs/Tabs.d.ts +41 -0
  195. package/dist/components/tabs/Tabs.js +45 -0
  196. package/dist/components/tabs/Tabs.js.map +1 -0
  197. package/dist/components/tabs/index.d.ts +1 -0
  198. package/dist/components/tabs/index.js +2 -0
  199. package/dist/components/toast/Toast.d.ts +70 -0
  200. package/dist/components/toast/Toast.js +95 -0
  201. package/dist/components/toast/Toast.js.map +1 -0
  202. package/dist/components/toast/index.d.ts +1 -0
  203. package/dist/components/toast/index.js +2 -0
  204. package/dist/components/toggle/Toggle.d.ts +38 -0
  205. package/dist/components/toggle/Toggle.js +30 -0
  206. package/dist/components/toggle/Toggle.js.map +1 -0
  207. package/dist/components/toggle/index.d.ts +1 -0
  208. package/dist/components/toggle/index.js +2 -0
  209. package/dist/components/toolbar/Toolbar.d.ts +50 -0
  210. package/dist/components/toolbar/Toolbar.js +59 -0
  211. package/dist/components/toolbar/Toolbar.js.map +1 -0
  212. package/dist/components/toolbar/index.d.ts +1 -0
  213. package/dist/components/toolbar/index.js +2 -0
  214. package/dist/components/tooltip/Tooltip.d.ts +58 -0
  215. package/dist/components/tooltip/Tooltip.js +57 -0
  216. package/dist/components/tooltip/Tooltip.js.map +1 -0
  217. package/dist/components/tooltip/index.d.ts +1 -0
  218. package/dist/components/tooltip/index.js +2 -0
  219. package/dist/index.d.ts +60 -0
  220. package/dist/index.js +48 -0
  221. package/dist/lib/cn.d.ts +3 -0
  222. package/dist/lib/cn.js +29 -0
  223. package/dist/lib/cn.js.map +1 -0
  224. package/dist/styles.css +2 -0
  225. package/dist/theme.css +109 -0
  226. package/package.json +131 -0
@@ -0,0 +1,106 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { Drawer as n } from "@base-ui/react/drawer";
4
+ //#region src/components/drawer/Drawer.tsx
5
+ var r = n.Root, i = n.Portal, a = n.Provider, o = n.Handle, s = n.createHandle;
6
+ function c({ className: r, ...i }) {
7
+ return /* @__PURE__ */ t(n.Trigger, {
8
+ className: e(r),
9
+ ...i
10
+ });
11
+ }
12
+ function l({ className: r, ...i }) {
13
+ return /* @__PURE__ */ t(n.Backdrop, {
14
+ className: e("fixed inset-0 z-40 bg-scrim transition-opacity duration-[450ms] ease-out", "data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", r),
15
+ ...i
16
+ });
17
+ }
18
+ function u({ className: r, ...i }) {
19
+ return /* @__PURE__ */ t(n.Viewport, {
20
+ className: e("fixed inset-0 z-50 flex", r),
21
+ ...i
22
+ });
23
+ }
24
+ var d = {
25
+ bottom: e("mx-auto self-end rounded-t-extra-large", "w-full max-w-[640px]", "max-h-[calc(100dvh-72px)]", "[transform:translateY(calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y,0px)))]", "data-[ending-style]:translate-y-full data-[starting-style]:translate-y-full"),
26
+ left: e("mr-auto rounded-r-large", "h-full w-[360px] max-w-[85vw]", "[transform:translateX(var(--drawer-swipe-movement-x,0px))]", "data-[ending-style]:-translate-x-full data-[starting-style]:-translate-x-full"),
27
+ right: e("ml-auto rounded-l-large", "h-full w-[360px] max-w-[85vw]", "[transform:translateX(var(--drawer-swipe-movement-x,0px))]", "data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full")
28
+ };
29
+ function f({ className: r, side: i = "bottom", ...a }) {
30
+ return /* @__PURE__ */ t(n.Popup, {
31
+ className: e("relative flex flex-col overflow-hidden bg-surface-container text-on-surface shadow-mm-1", "transition-transform duration-[calc(var(--drawer-swipe-strength,1)*450ms)] ease-[cubic-bezier(0.32,0.72,0,1)]", "data-[swiping]:duration-0", "focus:outline-none", d[i], r),
32
+ ...a
33
+ });
34
+ }
35
+ function p({ className: r, ...i }) {
36
+ return /* @__PURE__ */ t(n.Content, {
37
+ className: e("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-6", r),
38
+ ...i
39
+ });
40
+ }
41
+ function m({ className: r, ...i }) {
42
+ return /* @__PURE__ */ t(n.Title, {
43
+ className: e("m-0 text-title-large text-on-surface", r),
44
+ ...i
45
+ });
46
+ }
47
+ function h({ className: r, ...i }) {
48
+ return /* @__PURE__ */ t(n.Description, {
49
+ className: e("m-0 text-body-medium text-on-surface-variant", r),
50
+ ...i
51
+ });
52
+ }
53
+ function g({ className: r, ...i }) {
54
+ return /* @__PURE__ */ t(n.Close, {
55
+ className: e("inline-flex h-10 cursor-pointer items-center justify-center rounded-full px-3", "text-label-large text-primary transition-colors", "hover:bg-primary/[0.08] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary", "disabled:cursor-not-allowed disabled:opacity-[0.38]", r),
56
+ ...i
57
+ });
58
+ }
59
+ function _({ className: n, ...r }) {
60
+ return /* @__PURE__ */ t("div", {
61
+ "aria-hidden": !0,
62
+ className: e("mx-auto mt-4 mb-1.5 h-1 w-8 shrink-0 rounded-full bg-on-surface-variant/40", n),
63
+ ...r
64
+ });
65
+ }
66
+ function v({ className: r, ...i }) {
67
+ return /* @__PURE__ */ t(n.SwipeArea, {
68
+ className: e(r),
69
+ ...i
70
+ });
71
+ }
72
+ function y({ className: r, ...i }) {
73
+ return /* @__PURE__ */ t(n.Indent, {
74
+ className: e("origin-top bg-surface transition-transform duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)]", "data-[active]:scale-[0.98] data-[active]:rounded-extra-large", r),
75
+ ...i
76
+ });
77
+ }
78
+ function b({ className: r, ...i }) {
79
+ return /* @__PURE__ */ t(n.IndentBackground, {
80
+ className: e("fixed inset-0 bg-inverse-surface opacity-0 transition-opacity duration-[450ms]", "data-[active]:opacity-100", r),
81
+ ...i
82
+ });
83
+ }
84
+ var x = {
85
+ Root: r,
86
+ Trigger: c,
87
+ Portal: i,
88
+ Backdrop: l,
89
+ Viewport: u,
90
+ Popup: f,
91
+ Content: p,
92
+ Title: m,
93
+ Description: h,
94
+ Close: g,
95
+ DragHandle: _,
96
+ SwipeArea: v,
97
+ Provider: a,
98
+ Indent: y,
99
+ IndentBackground: b,
100
+ Handle: o,
101
+ createHandle: s
102
+ };
103
+ //#endregion
104
+ export { l as Backdrop, g as Close, p as Content, h as Description, _ as DragHandle, x as Drawer, o as Handle, y as Indent, b as IndentBackground, f as Popup, i as Portal, a as Provider, r as Root, v as SwipeArea, m as Title, c as Trigger, u as Viewport, s as createHandle };
105
+
106
+ //# sourceMappingURL=Drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.js","names":[],"sources":["../../../src/components/drawer/Drawer.tsx"],"sourcesContent":["import { Drawer as BaseDrawer } from '@base-ui/react/drawer'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Drawer — Material 3 styled wrapper over Base UI's headless Drawer.\n * Behaviour/accessibility (focus trap, scroll lock, swipe-to-dismiss, snap\n * points): Base UI (https://base-ui.com/react/components/drawer).\n * Visuals: M3 sheet anatomy — scrim, drag handle (32×4 on-surface-variant),\n * surface-container panel, extra-large top corner for bottom sheets, large\n * side corner for side sheets / modal navigation drawers, title-large header.\n * Design refs: port/core/ui/components/sheets (BottomSheet, SideSheet) and\n * port/core/ui/components/navigation-drawer (see CLAUDE.md).\n *\n * Compound API mirrors Base UI:\n * <Drawer.Root> // swipeDirection: 'down' (default) | 'left' | 'right' | 'up'\n * <Drawer.Trigger>Open</Drawer.Trigger>\n * <Drawer.Portal>\n * <Drawer.Backdrop />\n * <Drawer.Viewport>\n * <Drawer.Popup side=\"bottom\"> // side: 'bottom' | 'left' | 'right'\n * <Drawer.DragHandle /> // bottom sheets only\n * <Drawer.Content>\n * <Drawer.Title>Title</Drawer.Title>\n * <Drawer.Description>Supporting text</Drawer.Description>\n * <Drawer.Close>Done</Drawer.Close>\n * </Drawer.Content>\n * </Drawer.Popup>\n * </Drawer.Viewport>\n * </Drawer.Portal>\n * </Drawer.Root>\n *\n * App-shell parts (optional): wrap the page in <Drawer.Provider> with\n * <Drawer.IndentBackground /> + <Drawer.Indent> to scale the app behind an\n * open drawer. <Drawer.SwipeArea> opens the drawer from a screen edge.\n */\n\nconst Root = BaseDrawer.Root\nconst Portal = BaseDrawer.Portal\nconst Provider = BaseDrawer.Provider\nconst Handle = BaseDrawer.Handle\nconst createHandle = BaseDrawer.createHandle\n\nfunction Trigger({ className, ...props }: ComponentProps<typeof BaseDrawer.Trigger>) {\n return <BaseDrawer.Trigger className={cn(className)} {...props} />\n}\n\nfunction Backdrop({ className, ...props }: ComponentProps<typeof BaseDrawer.Backdrop>) {\n return (\n <BaseDrawer.Backdrop\n className={cn(\n 'fixed inset-0 z-40 bg-scrim transition-opacity duration-[450ms] ease-out',\n 'data-[ending-style]:opacity-0 data-[starting-style]:opacity-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Viewport({ className, ...props }: ComponentProps<typeof BaseDrawer.Viewport>) {\n return <BaseDrawer.Viewport className={cn('fixed inset-0 z-50 flex', className)} {...props} />\n}\n\n/** Where the sheet rests: M3 bottom sheet, or side sheet / modal nav drawer. */\ntype DrawerSide = 'bottom' | 'left' | 'right'\n\nconst popupSideClasses: Record<DrawerSide, string> = {\n // M3 bottom sheet: full-width docked panel, extra-large top corners,\n // tracks vertical swipe + snap-point offset via Base UI CSS vars.\n bottom: cn(\n 'mx-auto self-end rounded-t-extra-large',\n 'w-full max-w-[640px]',\n 'max-h-[calc(100dvh-72px)]',\n '[transform:translateY(calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y,0px)))]',\n 'data-[ending-style]:translate-y-full data-[starting-style]:translate-y-full',\n ),\n // M3 modal navigation drawer: leading edge, large trailing corners.\n left: cn(\n 'mr-auto rounded-r-large',\n 'h-full w-[360px] max-w-[85vw]',\n '[transform:translateX(var(--drawer-swipe-movement-x,0px))]',\n 'data-[ending-style]:-translate-x-full data-[starting-style]:-translate-x-full',\n ),\n // M3 modal side sheet: trailing edge, large leading corners.\n right: cn(\n 'ml-auto rounded-l-large',\n 'h-full w-[360px] max-w-[85vw]',\n '[transform:translateX(var(--drawer-swipe-movement-x,0px))]',\n 'data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full',\n ),\n}\n\ntype PopupProps = ComponentProps<typeof BaseDrawer.Popup> & {\n /**\n * Edge the sheet is docked to. Pair with the matching `swipeDirection` on\n * `Drawer.Root` ('down' for bottom, 'left'/'right' for side sheets).\n * @default 'bottom'\n */\n side?: DrawerSide\n}\n\nfunction Popup({ className, side = 'bottom', ...props }: PopupProps) {\n return (\n <BaseDrawer.Popup\n className={cn(\n 'relative flex flex-col overflow-hidden bg-surface-container text-on-surface shadow-mm-1',\n // Swipe release duration scales with Base UI's swipe-strength scalar;\n // transforms are instant while the user is dragging.\n 'transition-transform duration-[calc(var(--drawer-swipe-strength,1)*450ms)] ease-[cubic-bezier(0.32,0.72,0,1)]',\n 'data-[swiping]:duration-0',\n 'focus:outline-none',\n popupSideClasses[side],\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Scrollable body of the sheet. */\nfunction Content({ className, ...props }: ComponentProps<typeof BaseDrawer.Content>) {\n return (\n <BaseDrawer.Content\n className={cn('flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-6', className)}\n {...props}\n />\n )\n}\n\nfunction Title({ className, ...props }: ComponentProps<typeof BaseDrawer.Title>) {\n return (\n <BaseDrawer.Title\n className={cn('m-0 text-title-large text-on-surface', className)}\n {...props}\n />\n )\n}\n\nfunction Description({ className, ...props }: ComponentProps<typeof BaseDrawer.Description>) {\n return (\n <BaseDrawer.Description\n className={cn('m-0 text-body-medium text-on-surface-variant', className)}\n {...props}\n />\n )\n}\n\n/** Closes the drawer; styled as an M3 text button. */\nfunction Close({ className, ...props }: ComponentProps<typeof BaseDrawer.Close>) {\n return (\n <BaseDrawer.Close\n className={cn(\n 'inline-flex h-10 cursor-pointer items-center justify-center rounded-full px-3',\n 'text-label-large text-primary transition-colors',\n 'hover:bg-primary/[0.08] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',\n 'disabled:cursor-not-allowed disabled:opacity-[0.38]',\n className,\n )}\n {...props}\n />\n )\n}\n\n/**\n * M3 drag handle (32×4, on-surface-variant @ 40%) shown at the top of a\n * bottom sheet to signal swipeability. Not a Base UI part — plain `<div>`.\n */\nfunction DragHandle({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n aria-hidden\n className={cn(\n 'mx-auto mt-4 mb-1.5 h-1 w-8 shrink-0 rounded-full bg-on-surface-variant/40',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Invisible screen-edge area that opens the drawer on swipe. */\nfunction SwipeArea({ className, ...props }: ComponentProps<typeof BaseDrawer.SwipeArea>) {\n return <BaseDrawer.SwipeArea className={cn(className)} {...props} />\n}\n\n/**\n * Wraps the app's main UI inside `<Drawer.Provider>`; gets `data-active`\n * while any drawer is open, scaling the page back behind the sheet.\n */\nfunction Indent({ className, ...props }: ComponentProps<typeof BaseDrawer.Indent>) {\n return (\n <BaseDrawer.Indent\n className={cn(\n 'origin-top bg-surface transition-transform duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)]',\n 'data-[active]:scale-[0.98] data-[active]:rounded-extra-large',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** Background layer revealed behind a scaled `<Drawer.Indent>`. */\nfunction IndentBackground({\n className,\n ...props\n}: ComponentProps<typeof BaseDrawer.IndentBackground>) {\n return (\n <BaseDrawer.IndentBackground\n className={cn(\n 'fixed inset-0 bg-inverse-surface opacity-0 transition-opacity duration-[450ms]',\n 'data-[active]:opacity-100',\n className,\n )}\n {...props}\n />\n )\n}\n\nexport const Drawer = {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Viewport,\n Popup,\n Content,\n Title,\n Description,\n Close,\n DragHandle,\n SwipeArea,\n Provider,\n Indent,\n IndentBackground,\n Handle,\n createHandle,\n}\nexport {\n Root,\n Trigger,\n Portal,\n Backdrop,\n Viewport,\n Popup,\n Content,\n Title,\n Description,\n Close,\n DragHandle,\n SwipeArea,\n Provider,\n Indent,\n IndentBackground,\n Handle,\n createHandle,\n}\n"],"mappings":";;;;AAsCA,IAAM,IAAO,EAAW,MAClB,IAAS,EAAW,QACpB,IAAW,EAAW,UACtB,IAAS,EAAW,QACpB,IAAe,EAAW;AAEhC,SAAS,EAAQ,EAAE,cAAW,GAAG,KAAoD;CACnF,OAAO,kBAAC,EAAW,SAAZ;EAAoB,WAAW,EAAG,CAAS;EAAG,GAAI;CAAQ,CAAA;AACnE;AAEA,SAAS,EAAS,EAAE,cAAW,GAAG,KAAqD;CACrF,OACE,kBAAC,EAAW,UAAZ;EACE,WAAW,EACT,4EACA,iEACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAS,EAAE,cAAW,GAAG,KAAqD;CACrF,OAAO,kBAAC,EAAW,UAAZ;EAAqB,WAAW,EAAG,2BAA2B,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC/F;AAKA,IAAM,IAA+C;CAGnD,QAAQ,EACN,0CACA,wBACA,6BACA,wGACA,6EACF;CAEA,MAAM,EACJ,2BACA,iCACA,8DACA,+EACF;CAEA,OAAO,EACL,2BACA,iCACA,8DACA,6EACF;AACF;AAWA,SAAS,EAAM,EAAE,cAAW,UAAO,UAAU,GAAG,KAAqB;CACnE,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EACT,2FAGA,iHACA,6BACA,sBACA,EAAiB,IACjB,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAQ,EAAE,cAAW,GAAG,KAAoD;CACnF,OACE,kBAAC,EAAW,SAAZ;EACE,WAAW,EAAG,0DAA0D,CAAS;EACjF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EAAG,wCAAwC,CAAS;EAC/D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAY,EAAE,cAAW,GAAG,KAAwD;CAC3F,OACE,kBAAC,EAAW,aAAZ;EACE,WAAW,EAAG,gDAAgD,CAAS;EACvE,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAkD;CAC/E,OACE,kBAAC,EAAW,OAAZ;EACE,WAAW,EACT,iFACA,mDACA,gHACA,uDACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAMA,SAAS,EAAW,EAAE,cAAW,GAAG,KAAgC;CAClE,OACE,kBAAC,OAAD;EACE,eAAA;EACA,WAAW,EACT,8EACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAU,EAAE,cAAW,GAAG,KAAsD;CACvF,OAAO,kBAAC,EAAW,WAAZ;EAAsB,WAAW,EAAG,CAAS;EAAG,GAAI;CAAQ,CAAA;AACrE;AAMA,SAAS,EAAO,EAAE,cAAW,GAAG,KAAmD;CACjF,OACE,kBAAC,EAAW,QAAZ;EACE,WAAW,EACT,kGACA,gEACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAiB,EACxB,cACA,GAAG,KACkD;CACrD,OACE,kBAAC,EAAW,kBAAZ;EACE,WAAW,EACT,kFACA,6BACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,IAAS;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
@@ -0,0 +1 @@
1
+ export { Drawer, Root, Trigger, Portal, Backdrop, Viewport, Popup, Content, Title, Description, Close, DragHandle, SwipeArea, Provider, Indent, IndentBackground, Handle, createHandle, } from './Drawer';
@@ -0,0 +1,2 @@
1
+ import { Backdrop as e, Close as t, Content as n, Description as r, DragHandle as i, Drawer as a, Handle as o, Indent as s, IndentBackground as c, Popup as l, Portal as u, Provider as d, Root as f, SwipeArea as p, Title as m, Trigger as h, Viewport as g, createHandle as _ } from "./Drawer.js";
2
+ export { e as Backdrop, t as Close, n as Content, r as Description, i as DragHandle, a as Drawer, o as Handle, s as Indent, c as IndentBackground, l as Popup, u as Portal, d as Provider, f as Root, p as SwipeArea, m as Title, h as Trigger, g as Viewport, _ as createHandle };
@@ -0,0 +1,52 @@
1
+ import { Field as BaseField } from '@base-ui/react/field';
2
+ import { ComponentProps } from 'react';
3
+ /**
4
+ * Field — Material 3 styled wrapper over Base UI's headless Field.
5
+ * Behaviour/accessibility (label association, aria-invalid, validation state
6
+ * data-attributes, error wiring): Base UI (https://base-ui.com/react/components/field).
7
+ * Visuals ported from port/core/ui/components/text-field (InputOutlined) and
8
+ * port/pages/examples/text-fields (see CLAUDE.md): 56px outlined box with 8px
9
+ * corner, floating label that rests as hint text and floats to the top INSIDE
10
+ * the box when focused/filled (same anatomy as Input/InputOutlined — the two
11
+ * stay visually identical), body-small supporting/error text.
12
+ *
13
+ * Compound API mirrors Base UI:
14
+ * <Field.Root name="email">
15
+ * <Field.Label>Email</Field.Label>
16
+ * <Field.Control type="email" required />
17
+ * <Field.Description>We never share it.</Field.Description>
18
+ * <Field.Error match="valueMissing">Enter your email.</Field.Error>
19
+ * </Field.Root>
20
+ */
21
+ /**
22
+ * M3 outlined text-field control classes — shared by Field.Control and Input
23
+ * so both render the same outlined box.
24
+ */
25
+ export declare const fieldControlClasses: string;
26
+ declare function Root({ className, ...props }: ComponentProps<typeof BaseField.Root>): import("react").JSX.Element;
27
+ /**
28
+ * Floating label, port anatomy: rests as hint text in the box, floats to the
29
+ * top INSIDE the box once the field is focused or filled — driven purely by
30
+ * Base UI's data-focused/data-filled attributes. Override the positioning via
31
+ * className when pairing with non-text controls (checkbox, radio…).
32
+ */
33
+ declare function Label({ className, ...props }: ComponentProps<typeof BaseField.Label>): import("react").JSX.Element;
34
+ declare function Control({ className, ...props }: ComponentProps<typeof BaseField.Control>): import("react").JSX.Element;
35
+ /** M3 supporting text: body-small, on-surface-variant, inset to the text box. */
36
+ declare function Description({ className, ...props }: ComponentProps<typeof BaseField.Description>): import("react").JSX.Element;
37
+ /** M3 error supporting text: body-small in the error role. */
38
+ declare function Error({ className, ...props }: ComponentProps<typeof BaseField.Error>): import("react").JSX.Element;
39
+ /** Groups one control of a checkbox/radio group with its label + description. */
40
+ declare function Item({ className, ...props }: ComponentProps<typeof BaseField.Item>): import("react").JSX.Element;
41
+ /** Render-prop helper exposing the field's ValidityState — no styling hook. */
42
+ declare const Validity: import('react').FC<import('@base-ui/react').FieldValidityProps>;
43
+ export declare const Field: {
44
+ Root: typeof Root;
45
+ Label: typeof Label;
46
+ Control: typeof Control;
47
+ Description: typeof Description;
48
+ Error: typeof Error;
49
+ Validity: import('react').FC<import('@base-ui/react').FieldValidityProps>;
50
+ Item: typeof Item;
51
+ };
52
+ export { Root, Label, Control, Description, Error, Validity, Item };
@@ -0,0 +1,54 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { Field as n } from "@base-ui/react/field";
4
+ //#region src/components/form/Field.tsx
5
+ var r = e("h-14 w-full rounded-small border border-outline bg-transparent px-3 pt-6", "text-body-medium text-on-surface placeholder:text-transparent", "transition-[border-color,box-shadow] duration-150 ease-out", "hover:border-on-surface", "focus:border-primary focus:outline-none", "data-[invalid]:border-error data-[invalid]:hover:border-error", "data-[invalid]:focus:border-error", "disabled:cursor-not-allowed disabled:opacity-[0.38]");
6
+ function i({ className: r, ...i }) {
7
+ return /* @__PURE__ */ t(n.Root, {
8
+ className: e("relative flex w-full flex-col gap-1", r),
9
+ ...i
10
+ });
11
+ }
12
+ function a({ className: r, ...i }) {
13
+ return /* @__PURE__ */ t(n.Label, {
14
+ className: e("pointer-events-none absolute left-3 top-[17px] max-w-[calc(100%-2rem)] truncate", "text-body-medium text-on-surface-variant transition-all duration-150 ease-out", "data-[filled]:top-1.5 data-[filled]:text-body-small", "data-[focused]:top-1.5 data-[focused]:text-body-small", "data-[invalid]:text-error", "data-[disabled]:opacity-[0.38]", r),
15
+ ...i
16
+ });
17
+ }
18
+ function o({ className: i, ...a }) {
19
+ return /* @__PURE__ */ t(n.Control, {
20
+ className: e(r, i),
21
+ ...a
22
+ });
23
+ }
24
+ function s({ className: r, ...i }) {
25
+ return /* @__PURE__ */ t(n.Description, {
26
+ className: e("m-0 px-3 text-body-small text-on-surface-variant data-[disabled]:opacity-[0.38]", r),
27
+ ...i
28
+ });
29
+ }
30
+ function c({ className: r, ...i }) {
31
+ return /* @__PURE__ */ t(n.Error, {
32
+ className: e("px-3 text-body-small text-error", r),
33
+ ...i
34
+ });
35
+ }
36
+ function l({ className: r, ...i }) {
37
+ return /* @__PURE__ */ t(n.Item, {
38
+ className: e("flex items-center gap-3", r),
39
+ ...i
40
+ });
41
+ }
42
+ var u = {
43
+ Root: i,
44
+ Label: a,
45
+ Control: o,
46
+ Description: s,
47
+ Error: c,
48
+ Validity: n.Validity,
49
+ Item: l
50
+ };
51
+ //#endregion
52
+ export { u as Field, r as fieldControlClasses };
53
+
54
+ //# sourceMappingURL=Field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.js","names":[],"sources":["../../../src/components/form/Field.tsx"],"sourcesContent":["import { Field as BaseField } from '@base-ui/react/field'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Field — Material 3 styled wrapper over Base UI's headless Field.\n * Behaviour/accessibility (label association, aria-invalid, validation state\n * data-attributes, error wiring): Base UI (https://base-ui.com/react/components/field).\n * Visuals ported from port/core/ui/components/text-field (InputOutlined) and\n * port/pages/examples/text-fields (see CLAUDE.md): 56px outlined box with 8px\n * corner, floating label that rests as hint text and floats to the top INSIDE\n * the box when focused/filled (same anatomy as Input/InputOutlined — the two\n * stay visually identical), body-small supporting/error text.\n *\n * Compound API mirrors Base UI:\n * <Field.Root name=\"email\">\n * <Field.Label>Email</Field.Label>\n * <Field.Control type=\"email\" required />\n * <Field.Description>We never share it.</Field.Description>\n * <Field.Error match=\"valueMissing\">Enter your email.</Field.Error>\n * </Field.Root>\n */\n\n/**\n * M3 outlined text-field control classes — shared by Field.Control and Input\n * so both render the same outlined box.\n */\nexport const fieldControlClasses = cn(\n 'h-14 w-full rounded-small border border-outline bg-transparent px-3 pt-6',\n 'text-body-medium text-on-surface placeholder:text-transparent',\n 'transition-[border-color,box-shadow] duration-150 ease-out',\n 'hover:border-on-surface',\n 'focus:border-primary focus:outline-none',\n 'data-[invalid]:border-error data-[invalid]:hover:border-error',\n 'data-[invalid]:focus:border-error',\n 'disabled:cursor-not-allowed disabled:opacity-[0.38]',\n)\n\nfunction Root({ className, ...props }: ComponentProps<typeof BaseField.Root>) {\n return (\n <BaseField.Root className={cn('relative flex w-full flex-col gap-1', className)} {...props} />\n )\n}\n\n/**\n * Floating label, port anatomy: rests as hint text in the box, floats to the\n * top INSIDE the box once the field is focused or filled — driven purely by\n * Base UI's data-focused/data-filled attributes. Override the positioning via\n * className when pairing with non-text controls (checkbox, radio…).\n */\nfunction Label({ className, ...props }: ComponentProps<typeof BaseField.Label>) {\n return (\n <BaseField.Label\n className={cn(\n 'pointer-events-none absolute left-3 top-[17px] max-w-[calc(100%-2rem)] truncate',\n 'text-body-medium text-on-surface-variant transition-all duration-150 ease-out',\n 'data-[filled]:top-1.5 data-[filled]:text-body-small',\n 'data-[focused]:top-1.5 data-[focused]:text-body-small',\n 'data-[invalid]:text-error',\n 'data-[disabled]:opacity-[0.38]',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Control({ className, ...props }: ComponentProps<typeof BaseField.Control>) {\n return <BaseField.Control className={cn(fieldControlClasses, className)} {...props} />\n}\n\n/** M3 supporting text: body-small, on-surface-variant, inset to the text box. */\nfunction Description({ className, ...props }: ComponentProps<typeof BaseField.Description>) {\n return (\n <BaseField.Description\n className={cn(\n 'm-0 px-3 text-body-small text-on-surface-variant data-[disabled]:opacity-[0.38]',\n className,\n )}\n {...props}\n />\n )\n}\n\n/** M3 error supporting text: body-small in the error role. */\nfunction Error({ className, ...props }: ComponentProps<typeof BaseField.Error>) {\n return <BaseField.Error className={cn('px-3 text-body-small text-error', className)} {...props} />\n}\n\n/** Groups one control of a checkbox/radio group with its label + description. */\nfunction Item({ className, ...props }: ComponentProps<typeof BaseField.Item>) {\n return <BaseField.Item className={cn('flex items-center gap-3', className)} {...props} />\n}\n\n/** Render-prop helper exposing the field's ValidityState — no styling hook. */\nconst Validity = BaseField.Validity\n\nexport const Field = { Root, Label, Control, Description, Error, Validity, Item }\nexport { Root, Label, Control, Description, Error, Validity, Item }\n"],"mappings":";;;;AA4BA,IAAa,IAAsB,EACjC,4EACA,iEACA,8DACA,2BACA,2CACA,iEACA,qCACA,qDACF;AAEA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAgD;CAC5E,OACE,kBAAC,EAAU,MAAX;EAAgB,WAAW,EAAG,uCAAuC,CAAS;EAAG,GAAI;CAAQ,CAAA;AAEjG;AAQA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAiD;CAC9E,OACE,kBAAC,EAAU,OAAX;EACE,WAAW,EACT,mFACA,iFACA,uDACA,yDACA,6BACA,kCACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAQ,EAAE,cAAW,GAAG,KAAmD;CAClF,OAAO,kBAAC,EAAU,SAAX;EAAmB,WAAW,EAAG,GAAqB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACvF;AAGA,SAAS,EAAY,EAAE,cAAW,GAAG,KAAuD;CAC1F,OACE,kBAAC,EAAU,aAAX;EACE,WAAW,EACT,mFACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAGA,SAAS,EAAM,EAAE,cAAW,GAAG,KAAiD;CAC9E,OAAO,kBAAC,EAAU,OAAX;EAAiB,WAAW,EAAG,mCAAmC,CAAS;EAAG,GAAI;CAAQ,CAAA;AACnG;AAGA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAgD;CAC5E,OAAO,kBAAC,EAAU,MAAX;EAAgB,WAAW,EAAG,2BAA2B,CAAS;EAAG,GAAI;CAAQ,CAAA;AAC1F;AAKA,IAAa,IAAQ;CAAE;CAAM;CAAO;CAAS;CAAa;CAAO,UAFhD,EAAU;CAEgD;AAAK"}
@@ -0,0 +1,24 @@
1
+ import { Fieldset as BaseFieldset } from '@base-ui/react/fieldset';
2
+ import { ComponentProps } from 'react';
3
+ /**
4
+ * Fieldset — Material 3 styled wrapper over Base UI's headless Fieldset.
5
+ * Behaviour/accessibility (native `<fieldset>`, legend labelling): Base UI
6
+ * (https://base-ui.com/react/components/fieldset).
7
+ * Visuals: M3 grouped-section treatment — medium corner, outline-variant
8
+ * border, title-small legend (mirrors grouped fields on the text-fields
9
+ * example page).
10
+ * Design ref: port/pages/examples/text-fields (see CLAUDE.md).
11
+ *
12
+ * Compound API mirrors Base UI:
13
+ * <Fieldset.Root>
14
+ * <Fieldset.Legend>Shipping address</Fieldset.Legend>
15
+ * <Field.Root>…</Field.Root>
16
+ * </Fieldset.Root>
17
+ */
18
+ declare function Root({ className, ...props }: ComponentProps<typeof BaseFieldset.Root>): import("react").JSX.Element;
19
+ declare function Legend({ className, ...props }: ComponentProps<typeof BaseFieldset.Legend>): import("react").JSX.Element;
20
+ export declare const Fieldset: {
21
+ Root: typeof Root;
22
+ Legend: typeof Legend;
23
+ };
24
+ export { Root, Legend };
@@ -0,0 +1,24 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { Fieldset as n } from "@base-ui/react/fieldset";
4
+ //#region src/components/form/Fieldset.tsx
5
+ function r({ className: r, ...i }) {
6
+ return /* @__PURE__ */ t(n.Root, {
7
+ className: e("m-0 flex w-full min-w-0 flex-col gap-5 rounded-medium border border-outline-variant p-4", r),
8
+ ...i
9
+ });
10
+ }
11
+ function i({ className: r, ...i }) {
12
+ return /* @__PURE__ */ t(n.Legend, {
13
+ className: e("text-title-small text-on-surface", r),
14
+ ...i
15
+ });
16
+ }
17
+ var a = {
18
+ Root: r,
19
+ Legend: i
20
+ };
21
+ //#endregion
22
+ export { a as Fieldset };
23
+
24
+ //# sourceMappingURL=Fieldset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fieldset.js","names":[],"sources":["../../../src/components/form/Fieldset.tsx"],"sourcesContent":["import { Fieldset as BaseFieldset } from '@base-ui/react/fieldset'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Fieldset — Material 3 styled wrapper over Base UI's headless Fieldset.\n * Behaviour/accessibility (native `<fieldset>`, legend labelling): Base UI\n * (https://base-ui.com/react/components/fieldset).\n * Visuals: M3 grouped-section treatment — medium corner, outline-variant\n * border, title-small legend (mirrors grouped fields on the text-fields\n * example page).\n * Design ref: port/pages/examples/text-fields (see CLAUDE.md).\n *\n * Compound API mirrors Base UI:\n * <Fieldset.Root>\n * <Fieldset.Legend>Shipping address</Fieldset.Legend>\n * <Field.Root>…</Field.Root>\n * </Fieldset.Root>\n */\n\nfunction Root({ className, ...props }: ComponentProps<typeof BaseFieldset.Root>) {\n return (\n <BaseFieldset.Root\n className={cn(\n 'm-0 flex w-full min-w-0 flex-col gap-5 rounded-medium border border-outline-variant p-4',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction Legend({ className, ...props }: ComponentProps<typeof BaseFieldset.Legend>) {\n return (\n <BaseFieldset.Legend\n className={cn('text-title-small text-on-surface', className)}\n {...props}\n />\n )\n}\n\nexport const Fieldset = { Root, Legend }\nexport { Root, Legend }\n"],"mappings":";;;;AAqBA,SAAS,EAAK,EAAE,cAAW,GAAG,KAAmD;CAC/E,OACE,kBAAC,EAAa,MAAd;EACE,WAAW,EACT,2FACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAO,EAAE,cAAW,GAAG,KAAqD;CACnF,OACE,kBAAC,EAAa,QAAd;EACE,WAAW,EAAG,oCAAoC,CAAS;EAC3D,GAAI;CACL,CAAA;AAEL;AAEA,IAAa,IAAW;CAAE;CAAM;AAAO"}
@@ -0,0 +1,18 @@
1
+ import { Form as BaseForm } from '@base-ui/react/form';
2
+ import { ComponentProps } from 'react';
3
+ /**
4
+ * Form — Material 3 styled wrapper over Base UI's headless Form.
5
+ * Behaviour/accessibility (consolidated validation, server errors, submit
6
+ * handling): Base UI (https://base-ui.com/react/components/form).
7
+ * Visuals: vertical M3 form layout — column of fields on the standard
8
+ * 24px rhythm (mirrors the stacked containers on the text-fields example
9
+ * page).
10
+ * Design ref: port/pages/examples/text-fields (see CLAUDE.md).
11
+ *
12
+ * Usage mirrors Base UI:
13
+ * <Form errors={errors} onFormSubmit={…}>
14
+ * <Field.Root name="email">…</Field.Root>
15
+ * </Form>
16
+ */
17
+ declare function Form({ className, ...props }: ComponentProps<typeof BaseForm>): import("react").JSX.Element;
18
+ export { Form };
@@ -0,0 +1,14 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { Form as n } from "@base-ui/react/form";
4
+ //#region src/components/form/Form.tsx
5
+ function r({ className: r, ...i }) {
6
+ return /* @__PURE__ */ t(n, {
7
+ className: e("flex w-full flex-col gap-6", r),
8
+ ...i
9
+ });
10
+ }
11
+ //#endregion
12
+ export { r as Form };
13
+
14
+ //# sourceMappingURL=Form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Form.js","names":[],"sources":["../../../src/components/form/Form.tsx"],"sourcesContent":["import { Form as BaseForm } from '@base-ui/react/form'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps } from 'react'\n\n/**\n * Form — Material 3 styled wrapper over Base UI's headless Form.\n * Behaviour/accessibility (consolidated validation, server errors, submit\n * handling): Base UI (https://base-ui.com/react/components/form).\n * Visuals: vertical M3 form layout — column of fields on the standard\n * 24px rhythm (mirrors the stacked containers on the text-fields example\n * page).\n * Design ref: port/pages/examples/text-fields (see CLAUDE.md).\n *\n * Usage mirrors Base UI:\n * <Form errors={errors} onFormSubmit={…}>\n * <Field.Root name=\"email\">…</Field.Root>\n * </Form>\n */\n\nfunction Form({ className, ...props }: ComponentProps<typeof BaseForm>) {\n return <BaseForm className={cn('flex w-full flex-col gap-6', className)} {...props} />\n}\n\nexport { Form }\n"],"mappings":";;;;AAoBA,SAAS,EAAK,EAAE,cAAW,GAAG,KAA0C;CACtE,OAAO,kBAAC,GAAD;EAAU,WAAW,EAAG,8BAA8B,CAAS;EAAG,GAAI;CAAQ,CAAA;AACvF"}
@@ -0,0 +1,33 @@
1
+ import { Input as BaseInput } from '@base-ui/react/input';
2
+ import { ComponentProps, ReactNode } from 'react';
3
+ type InputProps = ComponentProps<typeof BaseInput> & {
4
+ variant?: 'outlined' | 'filled';
5
+ /** Floating label (port: the placeholder doubles as the label). */
6
+ label?: ReactNode;
7
+ /** Leading slot, centered in a 56px box (icon, avatar…). */
8
+ leftElement?: ReactNode;
9
+ /** Trailing slot (icon button, clear affordance…). */
10
+ rightElement?: ReactNode;
11
+ };
12
+ declare function Input({ className, variant, label, leftElement, rightElement, id, placeholder, ...props }: InputProps): import("react").JSX.Element;
13
+ type TextFieldProps = ComponentProps<'textarea'> & {
14
+ variant?: 'outlined' | 'filled';
15
+ label?: ReactNode;
16
+ leftElement?: ReactNode;
17
+ rightElement?: ReactNode;
18
+ };
19
+ /**
20
+ * Multi-line text field (port TextFieldOutlined/TextFieldFilled): textarea
21
+ * with the same floating-label anatomy, 4 rows by default. The filled skin
22
+ * masks the label on a surface-container-low chip so content scrolls under it,
23
+ * per the port.
24
+ */
25
+ declare function TextField({ className, variant, label, leftElement, rightElement, id, placeholder, rows, ...props }: TextFieldProps): import("react").JSX.Element;
26
+ type PortLabelProps = {
27
+ children?: ReactNode;
28
+ };
29
+ declare function InputOutlined({ placeholder, children, ...props }: Omit<InputProps, 'variant' | 'label'> & PortLabelProps): import("react").JSX.Element;
30
+ declare function InputFilled({ placeholder, children, ...props }: Omit<InputProps, 'variant' | 'label'> & PortLabelProps): import("react").JSX.Element;
31
+ declare function TextFieldOutlined({ placeholder, children, ...props }: Omit<TextFieldProps, 'variant' | 'label'> & PortLabelProps): import("react").JSX.Element;
32
+ declare function TextFieldFilled({ placeholder, children, ...props }: Omit<TextFieldProps, 'variant' | 'label'> & PortLabelProps): import("react").JSX.Element;
33
+ export { Input, TextField, InputOutlined, InputFilled, TextFieldOutlined, TextFieldFilled };
@@ -0,0 +1,99 @@
1
+ import { cn as e } from "../../lib/cn.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { useId as r } from "react";
4
+ import { Input as i } from "@base-ui/react/input";
5
+ //#region src/components/form/Input.tsx
6
+ var a = {
7
+ outlined: e("rounded-small border border-outline bg-transparent", "hover:border-on-surface focus:border-primary", "data-[invalid]:border-error data-[invalid]:hover:border-error data-[invalid]:focus:border-error"),
8
+ filled: e("rounded-t-small border-x-0 border-b-2 border-t-0 border-on-surface-variant bg-surface-container", "hover:bg-surface-container-high focus:border-primary", "data-[invalid]:border-error")
9
+ }, o = e("peer w-full px-3 text-body-medium text-on-surface", "transition-all duration-150 ease-out focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-[0.38]");
10
+ function s(e, t) {
11
+ return t ?? (typeof e == "string" ? e : " ");
12
+ }
13
+ function c({ children: e }) {
14
+ return /* @__PURE__ */ t("div", {
15
+ className: "absolute left-0 top-0 z-10 flex h-14 w-14 items-center justify-center text-on-surface-variant",
16
+ children: e
17
+ });
18
+ }
19
+ function l({ children: e }) {
20
+ return /* @__PURE__ */ t("div", {
21
+ className: "absolute right-2 top-0 z-10 flex h-14 items-center justify-end text-on-surface",
22
+ children: e
23
+ });
24
+ }
25
+ function u({ className: u, variant: d = "outlined", label: f, leftElement: p, rightElement: m, id: h, placeholder: g, ..._ }) {
26
+ let v = r(), y = h ?? v, b = /* @__PURE__ */ t(i, {
27
+ id: y,
28
+ placeholder: s(f, g),
29
+ className: e(o, "h-14", a[d], "placeholder:text-transparent", f && "pt-6", p && "pl-[60px]", m && "pr-12", u),
30
+ ..._
31
+ });
32
+ return !f && !p && !m ? b : /* @__PURE__ */ n("div", {
33
+ className: "relative flex w-full",
34
+ children: [
35
+ p && /* @__PURE__ */ t(c, { children: p }),
36
+ b,
37
+ f && /* @__PURE__ */ t("label", {
38
+ htmlFor: y,
39
+ className: e("pointer-events-none absolute top-1.5 cursor-text", "text-body-small text-on-surface-variant transition-all duration-150 ease-out", "peer-placeholder-shown:top-[17px] peer-placeholder-shown:text-body-medium", "peer-focus:top-1.5 peer-focus:text-body-small", "peer-data-[invalid]:text-error peer-disabled:opacity-[0.38]", p ? "left-12 px-3" : "left-3"),
40
+ children: f
41
+ }),
42
+ m && /* @__PURE__ */ t(l, { children: m })
43
+ ]
44
+ });
45
+ }
46
+ function d({ className: i, variant: u = "outlined", label: d, leftElement: f, rightElement: p, id: m, placeholder: h, rows: g = 4, ..._ }) {
47
+ let v = r(), y = m ?? v, b = /* @__PURE__ */ t("textarea", {
48
+ id: y,
49
+ rows: g,
50
+ placeholder: s(d, h),
51
+ className: e(o, u === "outlined" ? a.outlined : e("rounded-t-small border-x-0 border-b-2 border-t-0 border-outline bg-surface-container-low", "hover:bg-surface-container focus:border-primary"), "placeholder:text-transparent", d && "pt-[26px] sm:pt-[28px]", f && "pl-[60px]", p && "pr-12", i),
52
+ ..._
53
+ });
54
+ return !d && !f && !p ? b : /* @__PURE__ */ n("div", {
55
+ className: "relative flex w-full",
56
+ children: [
57
+ f && /* @__PURE__ */ t(c, { children: f }),
58
+ b,
59
+ d && /* @__PURE__ */ t("label", {
60
+ htmlFor: y,
61
+ className: e("pointer-events-none absolute top-1 cursor-text px-3 py-1.5", "text-body-small text-on-surface-variant transition-all duration-150 ease-out", "peer-placeholder-shown:top-2 peer-placeholder-shown:text-body-medium", "peer-focus:top-1 peer-focus:text-body-small", "peer-disabled:opacity-[0.38]", u === "filled" && "rounded-br-small rounded-tl-small bg-surface-container-low", f ? "left-12" : "left-0"),
62
+ children: d
63
+ }),
64
+ p && /* @__PURE__ */ t(l, { children: p })
65
+ ]
66
+ });
67
+ }
68
+ function f({ placeholder: e, children: n, ...r }) {
69
+ return /* @__PURE__ */ t(u, {
70
+ variant: "outlined",
71
+ label: n ?? e,
72
+ ...r
73
+ });
74
+ }
75
+ function p({ placeholder: e, children: n, ...r }) {
76
+ return /* @__PURE__ */ t(u, {
77
+ variant: "filled",
78
+ label: n ?? e,
79
+ ...r
80
+ });
81
+ }
82
+ function m({ placeholder: e, children: n, ...r }) {
83
+ return /* @__PURE__ */ t(d, {
84
+ variant: "outlined",
85
+ label: n ?? e,
86
+ ...r
87
+ });
88
+ }
89
+ function h({ placeholder: e, children: n, ...r }) {
90
+ return /* @__PURE__ */ t(d, {
91
+ variant: "filled",
92
+ label: n ?? e,
93
+ ...r
94
+ });
95
+ }
96
+ //#endregion
97
+ export { u as Input, p as InputFilled, f as InputOutlined, d as TextField, h as TextFieldFilled, m as TextFieldOutlined };
98
+
99
+ //# sourceMappingURL=Input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.js","names":[],"sources":["../../../src/components/form/Input.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { Input as BaseInput } from '@base-ui/react/input'\nimport { cn } from '#/lib/cn'\n\nimport type { ComponentProps, ReactNode } from 'react'\n\n/**\n * Text fields ported from port/core/ui/components/text-field (see CLAUDE.md):\n * 56px single-line fields and multi-line textareas, filled + outlined skins,\n * floating label that rests as placeholder text and floats to the top of the\n * box on focus/fill, 56px left element and trailing right element slots.\n *\n * Port-compatible API (placeholder/children become the floating label):\n * <InputOutlined name=\"email\" placeholder=\"Enter email\" />\n * <InputOutlined leftElement={<ChartLine />} rightElement={<Button.Icon …/>}>\n * Search pools or tokens\n * </InputOutlined>\n * <TextFieldOutlined rightElement={…}>Tell your story</TextFieldOutlined>\n *\n * Lower-level parts: <Input variant label …/> (Base UI input — composes with\n * Field.Root/Field.Label when label is omitted) and <TextField …/> (textarea).\n */\n\nconst variantClasses = {\n outlined: cn(\n 'rounded-small border border-outline bg-transparent',\n 'hover:border-on-surface focus:border-primary',\n 'data-[invalid]:border-error data-[invalid]:hover:border-error data-[invalid]:focus:border-error',\n ),\n filled: cn(\n 'rounded-t-small border-x-0 border-b-2 border-t-0 border-on-surface-variant bg-surface-container',\n 'hover:bg-surface-container-high focus:border-primary',\n 'data-[invalid]:border-error',\n ),\n}\n\nconst controlBaseClasses = cn(\n 'peer w-full px-3 text-body-medium text-on-surface',\n 'transition-all duration-150 ease-out focus:outline-none',\n 'disabled:cursor-not-allowed disabled:opacity-[0.38]',\n)\n\n/**\n * Text fields have NO visible placeholders (port/M3: the floating label is the\n * only hint text). The native placeholder attribute exists purely to drive the\n * :placeholder-shown float trick and is always transparent.\n */\nfunction floatPlaceholder(label: ReactNode, placeholder: string | undefined) {\n return placeholder ?? (typeof label === 'string' ? label : ' ')\n}\n\nfunction LeftElement({ children }: { children: ReactNode }) {\n return (\n <div className=\"absolute left-0 top-0 z-10 flex h-14 w-14 items-center justify-center text-on-surface-variant\">\n {children}\n </div>\n )\n}\n\nfunction RightElement({ children }: { children: ReactNode }) {\n return (\n <div className=\"absolute right-2 top-0 z-10 flex h-14 items-center justify-end text-on-surface\">\n {children}\n </div>\n )\n}\n\ntype InputProps = ComponentProps<typeof BaseInput> & {\n variant?: 'outlined' | 'filled'\n /** Floating label (port: the placeholder doubles as the label). */\n label?: ReactNode\n /** Leading slot, centered in a 56px box (icon, avatar…). */\n leftElement?: ReactNode\n /** Trailing slot (icon button, clear affordance…). */\n rightElement?: ReactNode\n}\n\nfunction Input({\n className,\n variant = 'outlined',\n label,\n leftElement,\n rightElement,\n id,\n placeholder,\n ...props\n}: InputProps) {\n const autoId = useId()\n const inputId = id ?? autoId\n\n const control = (\n <BaseInput\n id={inputId}\n placeholder={floatPlaceholder(label, placeholder)}\n className={cn(\n controlBaseClasses,\n 'h-14',\n variantClasses[variant],\n 'placeholder:text-transparent',\n label && 'pt-6',\n leftElement && 'pl-[60px]',\n rightElement && 'pr-12',\n className,\n )}\n {...props}\n />\n )\n\n // Bare control (no label/slots): composes with Field.Label inside Field.Root.\n if (!label && !leftElement && !rightElement) return control\n\n return (\n <div className=\"relative flex w-full\">\n {leftElement && <LeftElement>{leftElement}</LeftElement>}\n {control}\n {label && (\n <label\n htmlFor={inputId}\n className={cn(\n 'pointer-events-none absolute top-1.5 cursor-text',\n 'text-body-small text-on-surface-variant transition-all duration-150 ease-out',\n 'peer-placeholder-shown:top-[17px] peer-placeholder-shown:text-body-medium',\n 'peer-focus:top-1.5 peer-focus:text-body-small',\n 'peer-data-[invalid]:text-error peer-disabled:opacity-[0.38]',\n leftElement ? 'left-12 px-3' : 'left-3',\n )}\n >\n {label}\n </label>\n )}\n {rightElement && <RightElement>{rightElement}</RightElement>}\n </div>\n )\n}\n\ntype TextFieldProps = ComponentProps<'textarea'> & {\n variant?: 'outlined' | 'filled'\n label?: ReactNode\n leftElement?: ReactNode\n rightElement?: ReactNode\n}\n\n/**\n * Multi-line text field (port TextFieldOutlined/TextFieldFilled): textarea\n * with the same floating-label anatomy, 4 rows by default. The filled skin\n * masks the label on a surface-container-low chip so content scrolls under it,\n * per the port.\n */\nfunction TextField({\n className,\n variant = 'outlined',\n label,\n leftElement,\n rightElement,\n id,\n placeholder,\n rows = 4,\n ...props\n}: TextFieldProps) {\n const autoId = useId()\n const inputId = id ?? autoId\n\n const control = (\n <textarea\n id={inputId}\n rows={rows}\n placeholder={floatPlaceholder(label, placeholder)}\n className={cn(\n controlBaseClasses,\n variant === 'outlined'\n ? variantClasses.outlined\n : cn(\n 'rounded-t-small border-x-0 border-b-2 border-t-0 border-outline bg-surface-container-low',\n 'hover:bg-surface-container focus:border-primary',\n ),\n 'placeholder:text-transparent',\n label && 'pt-[26px] sm:pt-[28px]',\n leftElement && 'pl-[60px]',\n rightElement && 'pr-12',\n className,\n )}\n {...props}\n />\n )\n\n if (!label && !leftElement && !rightElement) return control\n\n return (\n <div className=\"relative flex w-full\">\n {leftElement && <LeftElement>{leftElement}</LeftElement>}\n {control}\n {label && (\n <label\n htmlFor={inputId}\n className={cn(\n 'pointer-events-none absolute top-1 cursor-text px-3 py-1.5',\n 'text-body-small text-on-surface-variant transition-all duration-150 ease-out',\n 'peer-placeholder-shown:top-2 peer-placeholder-shown:text-body-medium',\n 'peer-focus:top-1 peer-focus:text-body-small',\n 'peer-disabled:opacity-[0.38]',\n variant === 'filled' && 'rounded-br-small rounded-tl-small bg-surface-container-low',\n leftElement ? 'left-12' : 'left-0',\n )}\n >\n {label}\n </label>\n )}\n {rightElement && <RightElement>{rightElement}</RightElement>}\n </div>\n )\n}\n\n/* ----------------------------------------------------------------------------\n * Port-compatible named components — same names and usage as the port:\n * placeholder (or children) is the floating label.\n * -------------------------------------------------------------------------- */\n\ntype PortLabelProps = { children?: ReactNode }\n\nfunction InputOutlined({ placeholder, children, ...props }: Omit<InputProps, 'variant' | 'label'> & PortLabelProps) {\n return <Input variant=\"outlined\" label={children ?? placeholder} {...props} />\n}\n\nfunction InputFilled({ placeholder, children, ...props }: Omit<InputProps, 'variant' | 'label'> & PortLabelProps) {\n return <Input variant=\"filled\" label={children ?? placeholder} {...props} />\n}\n\nfunction TextFieldOutlined({ placeholder, children, ...props }: Omit<TextFieldProps, 'variant' | 'label'> & PortLabelProps) {\n return <TextField variant=\"outlined\" label={children ?? placeholder} {...props} />\n}\n\nfunction TextFieldFilled({ placeholder, children, ...props }: Omit<TextFieldProps, 'variant' | 'label'> & PortLabelProps) {\n return <TextField variant=\"filled\" label={children ?? placeholder} {...props} />\n}\n\nexport { Input, TextField, InputOutlined, InputFilled, TextFieldOutlined, TextFieldFilled }\n"],"mappings":";;;;;AAuBA,IAAM,IAAiB;CACrB,UAAU,EACR,sDACA,gDACA,iGACF;CACA,QAAQ,EACN,mGACA,wDACA,6BACF;AACF,GAEM,IAAqB,EACzB,qDACA,2DACA,qDACF;AAOA,SAAS,EAAiB,GAAkB,GAAiC;CAC3E,OAAO,MAAgB,OAAO,KAAU,WAAW,IAAQ;AAC7D;AAEA,SAAS,EAAY,EAAE,eAAqC;CAC1D,OACE,kBAAC,OAAD;EAAK,WAAU;EACZ;CACE,CAAA;AAET;AAEA,SAAS,EAAa,EAAE,eAAqC;CAC3D,OACE,kBAAC,OAAD;EAAK,WAAU;EACZ;CACE,CAAA;AAET;AAYA,SAAS,EAAM,EACb,cACA,aAAU,YACV,UACA,gBACA,iBACA,OACA,gBACA,GAAG,KACU;CACb,IAAM,IAAS,EAAM,GACf,IAAU,KAAM,GAEhB,IACJ,kBAAC,GAAD;EACE,IAAI;EACJ,aAAa,EAAiB,GAAO,CAAW;EAChD,WAAW,EACT,GACA,QACA,EAAe,IACf,gCACA,KAAS,QACT,KAAe,aACf,KAAgB,SAChB,CACF;EACA,GAAI;CACL,CAAA;CAMH,OAFI,CAAC,KAAS,CAAC,KAAe,CAAC,IAAqB,IAGlD,kBAAC,OAAD;EAAK,WAAU;YAAf;GACG,KAAe,kBAAC,GAAD,EAAA,UAAc,EAAyB,CAAA;GACtD;GACA,KACC,kBAAC,SAAD;IACE,SAAS;IACT,WAAW,EACT,oDACA,gFACA,6EACA,iDACA,+DACA,IAAc,iBAAiB,QACjC;cAEC;GACI,CAAA;GAER,KAAgB,kBAAC,GAAD,EAAA,UAAe,EAA2B,CAAA;EACxD;;AAET;AAeA,SAAS,EAAU,EACjB,cACA,aAAU,YACV,UACA,gBACA,iBACA,OACA,gBACA,UAAO,GACP,GAAG,KACc;CACjB,IAAM,IAAS,EAAM,GACf,IAAU,KAAM,GAEhB,IACJ,kBAAC,YAAD;EACE,IAAI;EACE;EACN,aAAa,EAAiB,GAAO,CAAW;EAChD,WAAW,EACT,GACA,MAAY,aACR,EAAe,WACf,EACE,4FACA,iDACF,GACJ,gCACA,KAAS,0BACT,KAAe,aACf,KAAgB,SAChB,CACF;EACA,GAAI;CACL,CAAA;CAKH,OAFI,CAAC,KAAS,CAAC,KAAe,CAAC,IAAqB,IAGlD,kBAAC,OAAD;EAAK,WAAU;YAAf;GACG,KAAe,kBAAC,GAAD,EAAA,UAAc,EAAyB,CAAA;GACtD;GACA,KACC,kBAAC,SAAD;IACE,SAAS;IACT,WAAW,EACT,8DACA,gFACA,wEACA,+CACA,gCACA,MAAY,YAAY,8DACxB,IAAc,YAAY,QAC5B;cAEC;GACI,CAAA;GAER,KAAgB,kBAAC,GAAD,EAAA,UAAe,EAA2B,CAAA;EACxD;;AAET;AASA,SAAS,EAAc,EAAE,gBAAa,aAAU,GAAG,KAAiE;CAClH,OAAO,kBAAC,GAAD;EAAO,SAAQ;EAAW,OAAO,KAAY;EAAa,GAAI;CAAQ,CAAA;AAC/E;AAEA,SAAS,EAAY,EAAE,gBAAa,aAAU,GAAG,KAAiE;CAChH,OAAO,kBAAC,GAAD;EAAO,SAAQ;EAAS,OAAO,KAAY;EAAa,GAAI;CAAQ,CAAA;AAC7E;AAEA,SAAS,EAAkB,EAAE,gBAAa,aAAU,GAAG,KAAqE;CAC1H,OAAO,kBAAC,GAAD;EAAW,SAAQ;EAAW,OAAO,KAAY;EAAa,GAAI;CAAQ,CAAA;AACnF;AAEA,SAAS,EAAgB,EAAE,gBAAa,aAAU,GAAG,KAAqE;CACxH,OAAO,kBAAC,GAAD;EAAW,SAAQ;EAAS,OAAO,KAAY;EAAa,GAAI;CAAQ,CAAA;AACjF"}
@@ -0,0 +1,71 @@
1
+ import { Button } from '../../../components/button';
2
+ import { DatePicker } from '../../../components/date-picker';
3
+ import { Input, TextField } from './Input';
4
+ import { ComponentProps, ReactNode } from 'react';
5
+ /**
6
+ * App forms — TanStack Form (https://tanstack.com/form) bound to the M3 text
7
+ * fields ported from port/core/ui/components/text-field. This is the
8
+ * recommended way to build forms in this app; the Base UI Form/Field family
9
+ * remains for the design-guide catalog.
10
+ *
11
+ * `useAppForm` pre-binds field components via TanStack's createFormHook, so
12
+ * fields read state from field context — no manual value/onChange wiring:
13
+ *
14
+ * const form = useAppForm({
15
+ * defaultValues: { email: '', story: '', agree: false },
16
+ * onSubmit: async ({ value }) => save(value),
17
+ * })
18
+ *
19
+ * <form onSubmit={(e) => { e.preventDefault(); form.handleSubmit() }}>
20
+ * <form.AppField
21
+ * name="email"
22
+ * validators={{ onChange: ({ value }) => (!value ? 'Required' : undefined) }}
23
+ * >
24
+ * {(field) => <field.TextField label="Email" />}
25
+ * </form.AppField>
26
+ * <form.AppForm>
27
+ * <form.SubmitButton>Save</form.SubmitButton>
28
+ * </form.AppForm>
29
+ * </form>
30
+ */
31
+ export declare const fieldContext: import('react').Context<import('@tanstack/react-form').AnyFieldApi>, formContext: import('react').Context<import('@tanstack/react-form').AnyFormApi>, useFieldContext: <TData>() => import('@tanstack/react-form').FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, useFormContext: () => import('@tanstack/react-form').ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
32
+ type BoundTextFieldProps = Omit<ComponentProps<typeof Input>, 'value' | 'onChange' | 'onBlur' | 'name'>;
33
+ /** Single-line M3 text field bound to the field context (port anatomy). */
34
+ declare function AppTextField({ className, ...props }: BoundTextFieldProps): import("react").JSX.Element;
35
+ type BoundTextAreaProps = Omit<ComponentProps<typeof TextField>, 'value' | 'onChange' | 'onBlur' | 'name'>;
36
+ /** Multi-line M3 text field bound to the field context (port anatomy). */
37
+ declare function AppTextArea({ className, ...props }: BoundTextAreaProps): import("react").JSX.Element;
38
+ /** Port-styled checkbox bound to a boolean field. */
39
+ declare function AppCheckbox({ label }: {
40
+ label: ReactNode;
41
+ }): import("react").JSX.Element;
42
+ type BoundDatePickerProps = Omit<ComponentProps<typeof DatePicker>, 'value' | 'onChange' | 'name'>;
43
+ /** M3 docked date picker bound to a `Date | null` field. */
44
+ declare function AppDatePicker({ className, ...props }: BoundDatePickerProps): import("react").JSX.Element;
45
+ /** Filled M3 submit button; disabled while the form can't submit. */
46
+ declare function SubmitButton({ children, ...props }: ComponentProps<typeof Button.Root>): import("react").JSX.Element;
47
+ export declare const useAppForm: <TFormData, TOnMount extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnChange extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: import('@tanstack/react-form').FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => import('@tanstack/react-form').AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
48
+ readonly TextField: typeof AppTextField;
49
+ readonly TextArea: typeof AppTextArea;
50
+ readonly Checkbox: typeof AppCheckbox;
51
+ readonly DatePicker: typeof AppDatePicker;
52
+ }, {
53
+ readonly SubmitButton: typeof SubmitButton;
54
+ }>, withForm: <TFormData, TOnMount extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnChange extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import('@tanstack/react-form').FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends object = {}>({ render, props, }: import('@tanstack/react-form').WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
55
+ readonly TextField: typeof AppTextField;
56
+ readonly TextArea: typeof AppTextArea;
57
+ readonly Checkbox: typeof AppCheckbox;
58
+ readonly DatePicker: typeof AppDatePicker;
59
+ }, {
60
+ readonly SubmitButton: typeof SubmitButton;
61
+ }, TRenderProps>) => import('react').FunctionComponent<import('react').PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
62
+ form: import('@tanstack/react-form').AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import('@tanstack/react-form').FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
63
+ readonly TextField: typeof AppTextField;
64
+ readonly TextArea: typeof AppTextArea;
65
+ readonly Checkbox: typeof AppCheckbox;
66
+ readonly DatePicker: typeof AppDatePicker;
67
+ }, {
68
+ readonly SubmitButton: typeof SubmitButton;
69
+ }>;
70
+ }>>;
71
+ export {};