@furcrer/fullstack-components 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 (249) hide show
  1. package/README.md +328 -0
  2. package/dist/index.js +2067 -0
  3. package/dist/styles.css +1 -0
  4. package/dist/types/components/containers/Grid/Grid.d.ts +7 -0
  5. package/dist/types/components/containers/Grid/Grid.fixture.d.ts +2 -0
  6. package/dist/types/components/containers/Grid/index.d.ts +2 -0
  7. package/dist/types/components/containers/Stack/Stack.d.ts +7 -0
  8. package/dist/types/components/containers/Stack/Stack.fixture.d.ts +2 -0
  9. package/dist/types/components/containers/Stack/index.d.ts +2 -0
  10. package/dist/types/components/data/CrudExample/CrudExample.d.ts +4 -0
  11. package/dist/types/components/data/CrudExample/CrudExample.preview.d.ts +2 -0
  12. package/dist/types/components/data/CrudExample/index.d.ts +2 -0
  13. package/dist/types/components/data/ResourceTable/ResourceTable.d.ts +12 -0
  14. package/dist/types/components/data/ResourceTable/ResourceTable.preview.d.ts +2 -0
  15. package/dist/types/components/data/ResourceTable/index.d.ts +2 -0
  16. package/dist/types/components/forms/ColorInput/ColorInput.d.ts +5 -0
  17. package/dist/types/components/forms/ColorInput/ColorInput.fixture.d.ts +2 -0
  18. package/dist/types/components/forms/ColorInput/index.d.ts +2 -0
  19. package/dist/types/components/forms/DateInput/DateInput.d.ts +5 -0
  20. package/dist/types/components/forms/DateInput/DateInput.fixture.d.ts +2 -0
  21. package/dist/types/components/forms/DateInput/index.d.ts +2 -0
  22. package/dist/types/components/forms/FileInput/FileInput.d.ts +4 -0
  23. package/dist/types/components/forms/FileInput/FileInput.fixture.d.ts +2 -0
  24. package/dist/types/components/forms/FileInput/index.d.ts +2 -0
  25. package/dist/types/components/forms/NumberInput/NumberInput.d.ts +4 -0
  26. package/dist/types/components/forms/NumberInput/NumberInput.fixture.d.ts +2 -0
  27. package/dist/types/components/forms/NumberInput/index.d.ts +2 -0
  28. package/dist/types/components/forms/PasswordInput/PasswordInput.d.ts +4 -0
  29. package/dist/types/components/forms/PasswordInput/PasswordInput.fixture.d.ts +2 -0
  30. package/dist/types/components/forms/PasswordInput/index.d.ts +2 -0
  31. package/dist/types/components/forms/RadioGroup/RadioGroup.d.ts +13 -0
  32. package/dist/types/components/forms/RadioGroup/RadioGroup.fixture.d.ts +2 -0
  33. package/dist/types/components/forms/RadioGroup/index.d.ts +2 -0
  34. package/dist/types/components/forms/SearchInput/SearchInput.d.ts +4 -0
  35. package/dist/types/components/forms/SearchInput/SearchInput.fixture.d.ts +2 -0
  36. package/dist/types/components/forms/SearchInput/index.d.ts +2 -0
  37. package/dist/types/components/forms/Slider/Slider.d.ts +5 -0
  38. package/dist/types/components/forms/Slider/Slider.fixture.d.ts +2 -0
  39. package/dist/types/components/forms/Slider/index.d.ts +2 -0
  40. package/dist/types/components/primitives/Accordion/Accordion.d.ts +10 -0
  41. package/dist/types/components/primitives/Accordion/Accordion.fixture.d.ts +2 -0
  42. package/dist/types/components/primitives/Accordion/index.d.ts +2 -0
  43. package/dist/types/components/primitives/Alert/Alert.d.ts +6 -0
  44. package/dist/types/components/primitives/Alert/Alert.fixture.d.ts +2 -0
  45. package/dist/types/components/primitives/Alert/index.d.ts +2 -0
  46. package/dist/types/components/primitives/Avatar/Avatar.d.ts +8 -0
  47. package/dist/types/components/primitives/Avatar/Avatar.fixture.d.ts +2 -0
  48. package/dist/types/components/primitives/Avatar/index.d.ts +2 -0
  49. package/dist/types/components/primitives/Badge/Badge.d.ts +3 -0
  50. package/dist/types/components/primitives/Badge/Badge.fixture.d.ts +3 -0
  51. package/dist/types/components/primitives/Badge/Badge.types.d.ts +9 -0
  52. package/dist/types/components/primitives/Badge/index.d.ts +2 -0
  53. package/dist/types/components/primitives/Button/Button.d.ts +6 -0
  54. package/dist/types/components/primitives/Button/Button.fixture.d.ts +3 -0
  55. package/dist/types/components/primitives/Button/Button.types.d.ts +15 -0
  56. package/dist/types/components/primitives/Button/index.d.ts +2 -0
  57. package/dist/types/components/primitives/Card/Card.d.ts +3 -0
  58. package/dist/types/components/primitives/Card/Card.fixture.d.ts +3 -0
  59. package/dist/types/components/primitives/Card/Card.types.d.ts +9 -0
  60. package/dist/types/components/primitives/Card/index.d.ts +2 -0
  61. package/dist/types/components/primitives/Carousel/Carousel.d.ts +7 -0
  62. package/dist/types/components/primitives/Carousel/Carousel.fixture.d.ts +2 -0
  63. package/dist/types/components/primitives/Carousel/index.d.ts +2 -0
  64. package/dist/types/components/primitives/Checkbox/Checkbox.d.ts +3 -0
  65. package/dist/types/components/primitives/Checkbox/Checkbox.fixture.d.ts +3 -0
  66. package/dist/types/components/primitives/Checkbox/Checkbox.types.d.ts +5 -0
  67. package/dist/types/components/primitives/Checkbox/index.d.ts +2 -0
  68. package/dist/types/components/primitives/Combobox/Combobox.d.ts +14 -0
  69. package/dist/types/components/primitives/Combobox/Combobox.fixture.d.ts +2 -0
  70. package/dist/types/components/primitives/Combobox/index.d.ts +2 -0
  71. package/dist/types/components/primitives/CommandPalette/CommandPalette.d.ts +14 -0
  72. package/dist/types/components/primitives/CommandPalette/CommandPalette.fixture.d.ts +2 -0
  73. package/dist/types/components/primitives/CommandPalette/index.d.ts +2 -0
  74. package/dist/types/components/primitives/ContextMenu/ContextMenu.d.ts +11 -0
  75. package/dist/types/components/primitives/ContextMenu/ContextMenu.fixture.d.ts +2 -0
  76. package/dist/types/components/primitives/ContextMenu/index.d.ts +2 -0
  77. package/dist/types/components/primitives/DatePicker/DatePicker.d.ts +8 -0
  78. package/dist/types/components/primitives/DatePicker/DatePicker.fixture.d.ts +2 -0
  79. package/dist/types/components/primitives/DatePicker/index.d.ts +2 -0
  80. package/dist/types/components/primitives/Drawer/Drawer.d.ts +9 -0
  81. package/dist/types/components/primitives/Drawer/Drawer.fixture.d.ts +2 -0
  82. package/dist/types/components/primitives/Drawer/index.d.ts +2 -0
  83. package/dist/types/components/primitives/DropdownMenu/DropdownMenu.d.ts +11 -0
  84. package/dist/types/components/primitives/DropdownMenu/DropdownMenu.fixture.d.ts +2 -0
  85. package/dist/types/components/primitives/DropdownMenu/index.d.ts +2 -0
  86. package/dist/types/components/primitives/EmptyState/EmptyState.d.ts +3 -0
  87. package/dist/types/components/primitives/EmptyState/EmptyState.fixture.d.ts +3 -0
  88. package/dist/types/components/primitives/EmptyState/EmptyState.types.d.ts +9 -0
  89. package/dist/types/components/primitives/EmptyState/index.d.ts +2 -0
  90. package/dist/types/components/primitives/ErrorState/ErrorState.d.ts +3 -0
  91. package/dist/types/components/primitives/ErrorState/ErrorState.fixture.d.ts +3 -0
  92. package/dist/types/components/primitives/ErrorState/ErrorState.types.d.ts +9 -0
  93. package/dist/types/components/primitives/ErrorState/index.d.ts +2 -0
  94. package/dist/types/components/primitives/FileUpload/FileUpload.d.ts +8 -0
  95. package/dist/types/components/primitives/FileUpload/FileUpload.fixture.d.ts +2 -0
  96. package/dist/types/components/primitives/FileUpload/index.d.ts +2 -0
  97. package/dist/types/components/primitives/FormField/FormField.d.ts +3 -0
  98. package/dist/types/components/primitives/FormField/FormField.fixture.d.ts +3 -0
  99. package/dist/types/components/primitives/FormField/FormField.types.d.ts +11 -0
  100. package/dist/types/components/primitives/FormField/index.d.ts +2 -0
  101. package/dist/types/components/primitives/Heading/Heading.d.ts +6 -0
  102. package/dist/types/components/primitives/Heading/Heading.fixture.d.ts +2 -0
  103. package/dist/types/components/primitives/Heading/index.d.ts +2 -0
  104. package/dist/types/components/primitives/IconButton/IconButton.d.ts +3 -0
  105. package/dist/types/components/primitives/IconButton/IconButton.fixture.d.ts +3 -0
  106. package/dist/types/components/primitives/IconButton/IconButton.types.d.ts +13 -0
  107. package/dist/types/components/primitives/IconButton/index.d.ts +2 -0
  108. package/dist/types/components/primitives/Input/Input.d.ts +3 -0
  109. package/dist/types/components/primitives/Input/Input.fixture.d.ts +3 -0
  110. package/dist/types/components/primitives/Input/Input.types.d.ts +5 -0
  111. package/dist/types/components/primitives/Input/index.d.ts +2 -0
  112. package/dist/types/components/primitives/Label/Label.d.ts +3 -0
  113. package/dist/types/components/primitives/Label/Label.fixture.d.ts +3 -0
  114. package/dist/types/components/primitives/Label/Label.types.d.ts +7 -0
  115. package/dist/types/components/primitives/Label/index.d.ts +2 -0
  116. package/dist/types/components/primitives/Link/Link.d.ts +5 -0
  117. package/dist/types/components/primitives/Link/Link.fixture.d.ts +2 -0
  118. package/dist/types/components/primitives/Link/index.d.ts +2 -0
  119. package/dist/types/components/primitives/LoadingState/LoadingState.d.ts +3 -0
  120. package/dist/types/components/primitives/LoadingState/LoadingState.fixture.d.ts +3 -0
  121. package/dist/types/components/primitives/LoadingState/LoadingState.types.d.ts +7 -0
  122. package/dist/types/components/primitives/LoadingState/index.d.ts +2 -0
  123. package/dist/types/components/primitives/Menubar/Menubar.d.ts +9 -0
  124. package/dist/types/components/primitives/Menubar/Menubar.fixture.d.ts +2 -0
  125. package/dist/types/components/primitives/Menubar/index.d.ts +2 -0
  126. package/dist/types/components/primitives/Modal/Modal.d.ts +3 -0
  127. package/dist/types/components/primitives/Modal/Modal.fixture.d.ts +3 -0
  128. package/dist/types/components/primitives/Modal/Modal.types.d.ts +13 -0
  129. package/dist/types/components/primitives/Modal/index.d.ts +2 -0
  130. package/dist/types/components/primitives/MultiSelect/MultiSelect.d.ts +13 -0
  131. package/dist/types/components/primitives/MultiSelect/MultiSelect.fixture.d.ts +2 -0
  132. package/dist/types/components/primitives/MultiSelect/index.d.ts +2 -0
  133. package/dist/types/components/primitives/NavigationMenu/NavigationMenu.d.ts +10 -0
  134. package/dist/types/components/primitives/NavigationMenu/NavigationMenu.fixture.d.ts +2 -0
  135. package/dist/types/components/primitives/NavigationMenu/index.d.ts +2 -0
  136. package/dist/types/components/primitives/Pagination/Pagination.d.ts +7 -0
  137. package/dist/types/components/primitives/Pagination/Pagination.fixture.d.ts +2 -0
  138. package/dist/types/components/primitives/Pagination/index.d.ts +2 -0
  139. package/dist/types/components/primitives/Popover/Popover.d.ts +8 -0
  140. package/dist/types/components/primitives/Popover/Popover.fixture.d.ts +2 -0
  141. package/dist/types/components/primitives/Popover/index.d.ts +2 -0
  142. package/dist/types/components/primitives/Progress/Progress.d.ts +7 -0
  143. package/dist/types/components/primitives/Progress/Progress.fixture.d.ts +2 -0
  144. package/dist/types/components/primitives/Progress/index.d.ts +2 -0
  145. package/dist/types/components/primitives/Radio/Radio.d.ts +3 -0
  146. package/dist/types/components/primitives/Radio/Radio.fixture.d.ts +3 -0
  147. package/dist/types/components/primitives/Radio/Radio.types.d.ts +5 -0
  148. package/dist/types/components/primitives/Radio/index.d.ts +2 -0
  149. package/dist/types/components/primitives/ResizablePanel/ResizablePanel.d.ts +8 -0
  150. package/dist/types/components/primitives/ResizablePanel/ResizablePanel.fixture.d.ts +2 -0
  151. package/dist/types/components/primitives/ResizablePanel/index.d.ts +2 -0
  152. package/dist/types/components/primitives/SearchBar/SearchBar.d.ts +5 -0
  153. package/dist/types/components/primitives/SearchBar/SearchBar.fixture.d.ts +2 -0
  154. package/dist/types/components/primitives/SearchBar/index.d.ts +2 -0
  155. package/dist/types/components/primitives/Select/Select.d.ts +3 -0
  156. package/dist/types/components/primitives/Select/Select.fixture.d.ts +3 -0
  157. package/dist/types/components/primitives/Select/Select.types.d.ts +15 -0
  158. package/dist/types/components/primitives/Select/index.d.ts +2 -0
  159. package/dist/types/components/primitives/Separator/Separator.d.ts +5 -0
  160. package/dist/types/components/primitives/Separator/Separator.fixture.d.ts +2 -0
  161. package/dist/types/components/primitives/Separator/index.d.ts +2 -0
  162. package/dist/types/components/primitives/Sidebar/Sidebar.d.ts +7 -0
  163. package/dist/types/components/primitives/Sidebar/Sidebar.fixture.d.ts +2 -0
  164. package/dist/types/components/primitives/Sidebar/index.d.ts +2 -0
  165. package/dist/types/components/primitives/Skeleton/Skeleton.d.ts +7 -0
  166. package/dist/types/components/primitives/Skeleton/Skeleton.fixture.d.ts +2 -0
  167. package/dist/types/components/primitives/Skeleton/index.d.ts +2 -0
  168. package/dist/types/components/primitives/Spinner/Spinner.d.ts +6 -0
  169. package/dist/types/components/primitives/Spinner/Spinner.fixture.d.ts +2 -0
  170. package/dist/types/components/primitives/Spinner/index.d.ts +2 -0
  171. package/dist/types/components/primitives/StatCard/StatCard.d.ts +3 -0
  172. package/dist/types/components/primitives/StatCard/StatCard.fixture.d.ts +3 -0
  173. package/dist/types/components/primitives/StatCard/StatCard.preview.d.ts +3 -0
  174. package/dist/types/components/primitives/StatCard/StatCard.types.d.ts +13 -0
  175. package/dist/types/components/primitives/StatCard/index.d.ts +2 -0
  176. package/dist/types/components/primitives/Stepper/Stepper.d.ts +13 -0
  177. package/dist/types/components/primitives/Stepper/Stepper.fixture.d.ts +2 -0
  178. package/dist/types/components/primitives/Stepper/index.d.ts +2 -0
  179. package/dist/types/components/primitives/Switch/Switch.d.ts +3 -0
  180. package/dist/types/components/primitives/Switch/Switch.fixture.d.ts +3 -0
  181. package/dist/types/components/primitives/Switch/Switch.types.d.ts +5 -0
  182. package/dist/types/components/primitives/Switch/index.d.ts +2 -0
  183. package/dist/types/components/primitives/Tabs/Tabs.d.ts +14 -0
  184. package/dist/types/components/primitives/Tabs/Tabs.fixture.d.ts +2 -0
  185. package/dist/types/components/primitives/Tabs/index.d.ts +2 -0
  186. package/dist/types/components/primitives/Text/Text.d.ts +6 -0
  187. package/dist/types/components/primitives/Text/Text.fixture.d.ts +2 -0
  188. package/dist/types/components/primitives/Text/index.d.ts +2 -0
  189. package/dist/types/components/primitives/Textarea/Textarea.d.ts +3 -0
  190. package/dist/types/components/primitives/Textarea/Textarea.fixture.d.ts +3 -0
  191. package/dist/types/components/primitives/Textarea/Textarea.types.d.ts +7 -0
  192. package/dist/types/components/primitives/Textarea/index.d.ts +2 -0
  193. package/dist/types/components/primitives/Toast/Toast.d.ts +8 -0
  194. package/dist/types/components/primitives/Toast/Toast.fixture.d.ts +2 -0
  195. package/dist/types/components/primitives/Toast/index.d.ts +2 -0
  196. package/dist/types/components/primitives/Tooltip/Tooltip.d.ts +6 -0
  197. package/dist/types/components/primitives/Tooltip/Tooltip.fixture.d.ts +2 -0
  198. package/dist/types/components/primitives/Tooltip/index.d.ts +2 -0
  199. package/dist/types/components/primitives/TreeView/TreeView.d.ts +12 -0
  200. package/dist/types/components/primitives/TreeView/TreeView.fixture.d.ts +2 -0
  201. package/dist/types/components/primitives/TreeView/index.d.ts +2 -0
  202. package/dist/types/data/Table.d.ts +13 -0
  203. package/dist/types/data/Table.fixture.d.ts +2 -0
  204. package/dist/types/data/api.d.ts +25 -0
  205. package/dist/types/data/crud.d.ts +20 -0
  206. package/dist/types/data/index.d.ts +9 -0
  207. package/dist/types/data/react-crud.d.ts +6 -0
  208. package/dist/types/data/react-table.d.ts +6 -0
  209. package/dist/types/data/resource-controller.d.ts +28 -0
  210. package/dist/types/data/resource-controller.test.d.ts +1 -0
  211. package/dist/types/data/resource.d.ts +2 -0
  212. package/dist/types/data/table-controller.d.ts +28 -0
  213. package/dist/types/data/types.d.ts +36 -0
  214. package/dist/types/forms/FormActions.d.ts +4 -0
  215. package/dist/types/forms/FormActions.fixture.d.ts +3 -0
  216. package/dist/types/forms/FormField.d.ts +8 -0
  217. package/dist/types/forms/FormField.fixture.d.ts +2 -0
  218. package/dist/types/forms/adapters.d.ts +19 -0
  219. package/dist/types/forms/adapters.fixture.d.ts +2 -0
  220. package/dist/types/forms/field.d.ts +16 -0
  221. package/dist/types/forms/form-store.d.ts +8 -0
  222. package/dist/types/forms/index.d.ts +10 -0
  223. package/dist/types/forms/react-field.d.ts +7 -0
  224. package/dist/types/forms/react-form.d.ts +10 -0
  225. package/dist/types/forms/react-form.fixture.d.ts +2 -0
  226. package/dist/types/forms/react.d.ts +16 -0
  227. package/dist/types/forms/react.fixture.d.ts +2 -0
  228. package/dist/types/forms/resource-form.d.ts +13 -0
  229. package/dist/types/forms/types.d.ts +25 -0
  230. package/dist/types/generated/component-registry.d.ts +2238 -0
  231. package/dist/types/generated/public-exports.d.ts +123 -0
  232. package/dist/types/index.d.ts +17 -0
  233. package/dist/types/theme/index.d.ts +4 -0
  234. package/dist/types/theme/provider.d.ts +20 -0
  235. package/dist/types/theme/theme.d.ts +47 -0
  236. package/dist/types/theme/theme.test.d.ts +1 -0
  237. package/dist/types/tokens/index.d.ts +1 -0
  238. package/dist/types/tokens/tokens.d.ts +55 -0
  239. package/dist/types/tooling/discovery/discover.d.ts +9 -0
  240. package/dist/types/tooling/discovery/discover.test.d.ts +1 -0
  241. package/dist/types/tooling/discovery/generate-exports.d.ts +6 -0
  242. package/dist/types/tooling/discovery/generate-registry.d.ts +6 -0
  243. package/dist/types/tooling/discovery/generate-registry.test.d.ts +1 -0
  244. package/dist/types/tooling/discovery/generate.d.ts +1 -0
  245. package/dist/types/tooling/discovery/vite-plugin.d.ts +8 -0
  246. package/dist/types/types/component.d.ts +12 -0
  247. package/dist/types/types/index.d.ts +2 -0
  248. package/dist/types/types/metadata.d.ts +48 -0
  249. package/package.json +56 -0
package/dist/index.js ADDED
@@ -0,0 +1,2067 @@
1
+ import ye, { createContext as re, useState as T, useEffect as M, useMemo as P, useContext as ne, useRef as $, useSyncExternalStore as N, useCallback as E, useId as ae } from "react";
2
+ const Se = {
3
+ 0: "0rem",
4
+ 1: "0.25rem",
5
+ 2: "0.5rem",
6
+ 3: "0.75rem",
7
+ 4: "1rem",
8
+ 5: "1.25rem",
9
+ 6: "1.5rem",
10
+ 8: "2rem",
11
+ 10: "2.5rem",
12
+ 12: "3rem",
13
+ 16: "4rem"
14
+ }, we = {
15
+ none: "0",
16
+ small: "0.25rem",
17
+ medium: "0.5rem",
18
+ large: "0.75rem",
19
+ full: "9999px"
20
+ }, Ee = {
21
+ xs: "0.75rem",
22
+ sm: "0.875rem",
23
+ md: "1rem",
24
+ lg: "1.125rem",
25
+ xl: "1.25rem",
26
+ "2xl": "1.5rem",
27
+ "3xl": "1.875rem"
28
+ }, Te = {
29
+ regular: 400,
30
+ medium: 500,
31
+ semibold: 600,
32
+ bold: 700
33
+ }, Ce = {
34
+ none: "none",
35
+ sm: "0 1px 2px rgb(0 0 0 / 0.08)",
36
+ md: "0 4px 10px rgb(0 0 0 / 0.12)",
37
+ lg: "0 12px 28px rgb(0 0 0 / 0.16)"
38
+ }, ke = {
39
+ base: 0,
40
+ dropdown: 100,
41
+ sticky: 200,
42
+ overlay: 300,
43
+ modal: 400,
44
+ toast: 500
45
+ }, R = {
46
+ colors: {
47
+ surface: "#ffffff",
48
+ surfaceMuted: "#f7f7f7",
49
+ text: "#171717",
50
+ textMuted: "#737373",
51
+ border: "#d4d4d4",
52
+ primary: "#2563eb",
53
+ primaryContrast: "#ffffff",
54
+ danger: "#b91c1c",
55
+ dangerContrast: "#ffffff"
56
+ },
57
+ states: {
58
+ focusRing: "#2563eb",
59
+ disabledSurface: "#e5e5e5",
60
+ disabledText: "#737373",
61
+ disabledOpacity: 0.55,
62
+ error: "#b91c1c",
63
+ errorContrast: "#ffffff",
64
+ errorSurface: "#fef2f2",
65
+ success: "#15803d",
66
+ successContrast: "#ffffff",
67
+ successSurface: "#f0fdf4",
68
+ warning: "#a16207",
69
+ warningContrast: "#ffffff",
70
+ warningSurface: "#fffbeb"
71
+ },
72
+ spacing: Se,
73
+ radius: we,
74
+ fontSize: Ee,
75
+ fontWeight: Te,
76
+ shadows: Ce,
77
+ zIndex: ke
78
+ };
79
+ function Re(e = {}) {
80
+ return {
81
+ colors: { ...R.colors, ...e.colors },
82
+ states: { ...R.states, ...e.states },
83
+ spacing: { ...R.spacing, ...e.spacing },
84
+ radius: { ...R.radius, ...e.radius },
85
+ fontSize: { ...R.fontSize, ...e.fontSize },
86
+ fontWeight: { ...R.fontWeight, ...e.fontWeight },
87
+ shadows: { ...R.shadows, ...e.shadows },
88
+ zIndex: { ...R.zIndex, ...e.zIndex }
89
+ };
90
+ }
91
+ const _e = Re({
92
+ colors: {
93
+ surface: "#171717",
94
+ surfaceMuted: "#262626",
95
+ text: "#f5f5f5",
96
+ textMuted: "#a3a3a3",
97
+ border: "#404040",
98
+ primary: "#60a5fa",
99
+ primaryContrast: "#0f172a",
100
+ danger: "#f87171",
101
+ dangerContrast: "#450a0a"
102
+ },
103
+ states: {
104
+ focusRing: "#93c5fd",
105
+ disabledSurface: "#404040",
106
+ disabledText: "#a3a3a3",
107
+ disabledOpacity: 0.55,
108
+ error: "#f87171",
109
+ errorContrast: "#450a0a",
110
+ errorSurface: "#450a0a",
111
+ success: "#4ade80",
112
+ successContrast: "#052e16",
113
+ successSurface: "#052e16",
114
+ warning: "#fbbf24",
115
+ warningContrast: "#422006",
116
+ warningSurface: "#422006"
117
+ }
118
+ });
119
+ function Pe(e) {
120
+ return e.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`);
121
+ }
122
+ const Oe = {
123
+ colors: "color",
124
+ states: "state",
125
+ spacing: "space",
126
+ radius: "radius",
127
+ fontSize: "font-size",
128
+ fontWeight: "font-weight",
129
+ shadows: "shadow",
130
+ zIndex: "z-index"
131
+ };
132
+ function se(e) {
133
+ const r = {};
134
+ for (const [t, n] of Object.entries(e)) {
135
+ const s = Oe[t];
136
+ for (const [o, i] of Object.entries(n))
137
+ r[`--fsc-${s}-${Pe(o)}`] = String(i);
138
+ }
139
+ return r;
140
+ }
141
+ function ut(e) {
142
+ const r = se(e);
143
+ return `:root {
144
+ ${Object.entries(r).map(([n, s]) => ` ${n}: ${s};`).join(`
145
+ `)}
146
+ }`;
147
+ }
148
+ function Ae(e) {
149
+ const r = [];
150
+ for (const [t, n] of Object.entries(e)) {
151
+ if (!n || typeof n != "object") {
152
+ r.push(`Missing theme group: ${t}`);
153
+ continue;
154
+ }
155
+ for (const [s, o] of Object.entries(n))
156
+ (o == null || typeof o == "string" && o.trim() === "") && r.push(`Missing theme value: ${t}.${s}`);
157
+ }
158
+ return r;
159
+ }
160
+ function $e(e, r, t) {
161
+ const n = Ae(r);
162
+ if (n.length > 0)
163
+ throw new Error(`Invalid theme: ${n.join(", ")}`);
164
+ const s = se(r), o = /* @__PURE__ */ new Map(), i = e.style.colorScheme, c = e.dataset.theme;
165
+ for (const [u, f] of Object.entries(s))
166
+ o.set(u, e.style.getPropertyValue(u)), e.style.setProperty(u, f);
167
+ return t && (e.dataset.theme = t, e.style.colorScheme = t), () => {
168
+ for (const [u, f] of o)
169
+ f ? e.style.setProperty(u, f) : e.style.removeProperty(u);
170
+ c === void 0 ? delete e.dataset.theme : e.dataset.theme = c, e.style.colorScheme = i;
171
+ };
172
+ }
173
+ var F = { exports: {} }, z = {};
174
+ var H;
175
+ function Ne() {
176
+ if (H) return z;
177
+ H = 1;
178
+ var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
179
+ function t(n, s, o) {
180
+ var i = null;
181
+ if (o !== void 0 && (i = "" + o), s.key !== void 0 && (i = "" + s.key), "key" in s) {
182
+ o = {};
183
+ for (var c in s)
184
+ c !== "key" && (o[c] = s[c]);
185
+ } else o = s;
186
+ return s = o.ref, {
187
+ $$typeof: e,
188
+ type: n,
189
+ key: i,
190
+ ref: s !== void 0 ? s : null,
191
+ props: o
192
+ };
193
+ }
194
+ return z.Fragment = r, z.jsx = t, z.jsxs = t, z;
195
+ }
196
+ var I = {};
197
+ var X;
198
+ function ze() {
199
+ return X || (X = 1, process.env.NODE_ENV !== "production" && (function() {
200
+ function e(l) {
201
+ if (l == null) return null;
202
+ if (typeof l == "function")
203
+ return l.$$typeof === ve ? null : l.displayName || l.name || null;
204
+ if (typeof l == "string") return l;
205
+ switch (l) {
206
+ case m:
207
+ return "Fragment";
208
+ case C:
209
+ return "Profiler";
210
+ case v:
211
+ return "StrictMode";
212
+ case me:
213
+ return "Suspense";
214
+ case pe:
215
+ return "SuspenseList";
216
+ case be:
217
+ return "Activity";
218
+ case xe:
219
+ return "ViewTransition";
220
+ }
221
+ if (typeof l == "object")
222
+ switch (typeof l.tag == "number" && console.error(
223
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
224
+ ), l.$$typeof) {
225
+ case x:
226
+ return "Portal";
227
+ case de:
228
+ return l.displayName || "Context";
229
+ case O:
230
+ return (l._context.displayName || "Context") + ".Consumer";
231
+ case fe:
232
+ var p = l.render;
233
+ return l = l.displayName, l || (l = p.displayName || p.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
234
+ case he:
235
+ return p = l.displayName || null, p !== null ? p : e(l.type) || "Memo";
236
+ case L:
237
+ p = l._payload, l = l._init;
238
+ try {
239
+ return e(l(p));
240
+ } catch {
241
+ }
242
+ }
243
+ return null;
244
+ }
245
+ function r(l) {
246
+ return "" + l;
247
+ }
248
+ function t(l) {
249
+ try {
250
+ r(l);
251
+ var p = !1;
252
+ } catch {
253
+ p = !0;
254
+ }
255
+ if (p) {
256
+ p = console;
257
+ var y = p.error, S = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
258
+ return y.call(
259
+ p,
260
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
261
+ S
262
+ ), r(l);
263
+ }
264
+ }
265
+ function n(l) {
266
+ if (l === m) return "<>";
267
+ if (typeof l == "object" && l !== null && l.$$typeof === L)
268
+ return "<...>";
269
+ try {
270
+ var p = e(l);
271
+ return p ? "<" + p + ">" : "<...>";
272
+ } catch {
273
+ return "<...>";
274
+ }
275
+ }
276
+ function s() {
277
+ var l = D.A;
278
+ return l === null ? null : l.getOwner();
279
+ }
280
+ function o() {
281
+ return Error("react-stack-top-frame");
282
+ }
283
+ function i(l) {
284
+ if (W.call(l, "key")) {
285
+ var p = Object.getOwnPropertyDescriptor(l, "key").get;
286
+ if (p && p.isReactWarning) return !1;
287
+ }
288
+ return l.key !== void 0;
289
+ }
290
+ function c(l, p) {
291
+ function y() {
292
+ J || (J = !0, console.error(
293
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
294
+ p
295
+ ));
296
+ }
297
+ y.isReactWarning = !0, Object.defineProperty(l, "key", {
298
+ get: y,
299
+ configurable: !0
300
+ });
301
+ }
302
+ function u() {
303
+ var l = e(this.type);
304
+ return Q[l] || (Q[l] = !0, console.error(
305
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
306
+ )), l = this.props.ref, l !== void 0 ? l : null;
307
+ }
308
+ function f(l, p, y, S, _, k) {
309
+ var w = y.ref;
310
+ return l = {
311
+ $$typeof: j,
312
+ type: l,
313
+ key: p,
314
+ props: y,
315
+ _owner: S
316
+ }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(l, "ref", {
317
+ enumerable: !1,
318
+ get: u
319
+ }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
320
+ configurable: !1,
321
+ enumerable: !1,
322
+ writable: !0,
323
+ value: 0
324
+ }), Object.defineProperty(l, "_debugInfo", {
325
+ configurable: !1,
326
+ enumerable: !1,
327
+ writable: !0,
328
+ value: null
329
+ }), Object.defineProperty(l, "_debugStack", {
330
+ configurable: !1,
331
+ enumerable: !1,
332
+ writable: !0,
333
+ value: _
334
+ }), Object.defineProperty(l, "_debugTask", {
335
+ configurable: !1,
336
+ enumerable: !1,
337
+ writable: !0,
338
+ value: k
339
+ }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
340
+ }
341
+ function h(l, p, y, S, _, k) {
342
+ var w = p.children;
343
+ if (w !== void 0)
344
+ if (S)
345
+ if (ge(w)) {
346
+ for (S = 0; S < w.length; S++)
347
+ d(w[S]);
348
+ Object.freeze && Object.freeze(w);
349
+ } else
350
+ console.error(
351
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
352
+ );
353
+ else d(w);
354
+ if (W.call(p, "key")) {
355
+ w = e(l);
356
+ var A = Object.keys(p).filter(function(je) {
357
+ return je !== "key";
358
+ });
359
+ S = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", Z[w + S] || (A = 0 < A.length ? "{" + A.join(": ..., ") + ": ...}" : "{}", console.error(
360
+ `A props object containing a "key" prop is being spread into JSX:
361
+ let props = %s;
362
+ <%s {...props} />
363
+ React keys must be passed directly to JSX without using spread:
364
+ let props = %s;
365
+ <%s key={someKey} {...props} />`,
366
+ S,
367
+ w,
368
+ A,
369
+ w
370
+ ), Z[w + S] = !0);
371
+ }
372
+ if (w = null, y !== void 0 && (t(y), w = "" + y), i(p) && (t(p.key), w = "" + p.key), "key" in p) {
373
+ y = {};
374
+ for (var U in p)
375
+ U !== "key" && (y[U] = p[U]);
376
+ } else y = p;
377
+ return w && c(
378
+ y,
379
+ typeof l == "function" ? l.displayName || l.name || "Unknown" : l
380
+ ), f(
381
+ l,
382
+ w,
383
+ y,
384
+ s(),
385
+ _,
386
+ k
387
+ );
388
+ }
389
+ function d(l) {
390
+ g(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === L && (l._payload.status === "fulfilled" ? g(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
391
+ }
392
+ function g(l) {
393
+ return typeof l == "object" && l !== null && l.$$typeof === j;
394
+ }
395
+ var b = ye, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), x = /* @__PURE__ */ Symbol.for("react.portal"), m = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), O = /* @__PURE__ */ Symbol.for("react.consumer"), de = /* @__PURE__ */ Symbol.for("react.context"), fe = /* @__PURE__ */ Symbol.for("react.forward_ref"), me = /* @__PURE__ */ Symbol.for("react.suspense"), pe = /* @__PURE__ */ Symbol.for("react.suspense_list"), he = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), be = /* @__PURE__ */ Symbol.for("react.activity"), xe = /* @__PURE__ */ Symbol.for("react.view_transition"), ve = /* @__PURE__ */ Symbol.for("react.client.reference"), D = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, ge = Array.isArray, V = console.createTask ? console.createTask : function() {
396
+ return null;
397
+ };
398
+ b = {
399
+ react_stack_bottom_frame: function(l) {
400
+ return l();
401
+ }
402
+ };
403
+ var J, Q = {}, G = b.react_stack_bottom_frame.bind(
404
+ b,
405
+ o
406
+ )(), q = V(n(o)), Z = {};
407
+ I.Fragment = m, I.jsx = function(l, p, y) {
408
+ var S = 1e4 > D.recentlyCreatedOwnerStacks++;
409
+ if (S) {
410
+ var _ = Error.stackTraceLimit;
411
+ Error.stackTraceLimit = 10;
412
+ var k = Error("react-stack-top-frame");
413
+ Error.stackTraceLimit = _;
414
+ } else k = G;
415
+ return h(
416
+ l,
417
+ p,
418
+ y,
419
+ !1,
420
+ k,
421
+ S ? V(n(l)) : q
422
+ );
423
+ }, I.jsxs = function(l, p, y) {
424
+ var S = 1e4 > D.recentlyCreatedOwnerStacks++;
425
+ if (S) {
426
+ var _ = Error.stackTraceLimit;
427
+ Error.stackTraceLimit = 10;
428
+ var k = Error("react-stack-top-frame");
429
+ Error.stackTraceLimit = _;
430
+ } else k = G;
431
+ return h(
432
+ l,
433
+ p,
434
+ y,
435
+ !0,
436
+ k,
437
+ S ? V(n(l)) : q
438
+ );
439
+ };
440
+ })()), I;
441
+ }
442
+ var K;
443
+ function Ie() {
444
+ return K || (K = 1, process.env.NODE_ENV === "production" ? F.exports = Ne() : F.exports = ze()), F.exports;
445
+ }
446
+ var a = Ie();
447
+ const oe = re(null);
448
+ function Fe() {
449
+ return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
450
+ }
451
+ function Me() {
452
+ return Fe() ? "dark" : "light";
453
+ }
454
+ function dt({
455
+ children: e,
456
+ mode: r,
457
+ defaultMode: t = "system",
458
+ lightTheme: n = R,
459
+ darkTheme: s = _e,
460
+ container: o
461
+ }) {
462
+ const [i, c] = T(t), u = r ?? i, [f, h] = T(Me);
463
+ M(() => {
464
+ if (typeof window > "u" || typeof window.matchMedia != "function") return;
465
+ const j = window.matchMedia("(prefers-color-scheme: dark)"), x = () => h(j.matches ? "dark" : "light");
466
+ return x(), j.addEventListener?.("change", x), () => j.removeEventListener?.("change", x);
467
+ }, []);
468
+ const d = u === "system" ? f : u, g = d === "dark" ? s : n, b = P(
469
+ () => ({
470
+ mode: u,
471
+ resolvedMode: d,
472
+ theme: g,
473
+ setMode: c
474
+ }),
475
+ [u, d, g]
476
+ );
477
+ return M(() => {
478
+ const j = o ?? (typeof document < "u" ? document.documentElement : null);
479
+ if (j)
480
+ return $e(j, g, d);
481
+ }, [o, d, g]), /* @__PURE__ */ a.jsx(oe.Provider, { value: b, children: e });
482
+ }
483
+ function ft() {
484
+ const e = ne(oe);
485
+ if (!e) throw new Error("useTheme must be used within a ThemeProvider.");
486
+ return e;
487
+ }
488
+ function Y(e) {
489
+ let r = { ...e.initialValues }, t = {
490
+ values: { ...r },
491
+ errors: {},
492
+ touched: {},
493
+ dirty: !1,
494
+ submitting: !1,
495
+ status: "idle"
496
+ };
497
+ const n = /* @__PURE__ */ new Set(), s = () => {
498
+ for (const f of n) f();
499
+ }, o = (f) => {
500
+ t = f, s();
501
+ }, i = async () => {
502
+ if (!e.validate)
503
+ return Object.keys(t.errors).length === 0 ? {} : (o({ ...t, errors: {} }), {});
504
+ const f = await e.validate(t.values);
505
+ return o({ ...t, errors: f }), f;
506
+ };
507
+ return {
508
+ getState: () => t,
509
+ setValue: (f, h) => {
510
+ o({
511
+ ...t,
512
+ values: { ...t.values, [f]: h },
513
+ dirty: !0,
514
+ status: t.status === "success" || t.status === "error" ? "idle" : t.status,
515
+ submitError: void 0
516
+ });
517
+ },
518
+ setTouched: (f, h = !0) => {
519
+ o({
520
+ ...t,
521
+ touched: { ...t.touched, [f]: h }
522
+ });
523
+ },
524
+ setErrors: (f) => {
525
+ o({ ...t, errors: f, status: "error" });
526
+ },
527
+ reset: (f = r) => {
528
+ r = { ...f }, o({
529
+ values: { ...f },
530
+ errors: {},
531
+ touched: {},
532
+ dirty: !1,
533
+ submitting: !1,
534
+ status: "idle",
535
+ submitError: void 0
536
+ });
537
+ },
538
+ validate: i,
539
+ submit: async () => {
540
+ if (t.submitting) return !1;
541
+ const f = await i();
542
+ if (Object.keys(f).length > 0)
543
+ return o({ ...t, errors: f, status: "error", submitting: !1 }), !1;
544
+ const h = t.values;
545
+ o({ ...t, submitting: !0, status: "submitting", submitError: void 0 });
546
+ try {
547
+ return await e.onSubmit(h), o({ ...t, submitting: !1, status: "success", errors: {} }), !0;
548
+ } catch (d) {
549
+ return o({
550
+ ...t,
551
+ submitting: !1,
552
+ status: "error",
553
+ submitError: d instanceof Error ? d.message : String(d)
554
+ }), !1;
555
+ }
556
+ },
557
+ subscribe: (f) => (n.add(f), () => n.delete(f))
558
+ };
559
+ }
560
+ function Le(e, r) {
561
+ let t, n;
562
+ return {
563
+ name: r,
564
+ getState: () => {
565
+ const o = e.getState();
566
+ return o === t && n || (t = o, n = {
567
+ value: o.values[r],
568
+ error: o.errors[r],
569
+ touched: o.touched[r] === !0,
570
+ dirty: o.dirty,
571
+ submitting: o.submitting
572
+ }), n;
573
+ },
574
+ setValue: (o) => e.setValue(r, o),
575
+ setTouched: (o = !0) => e.setTouched(r, o)
576
+ };
577
+ }
578
+ const ie = re(null);
579
+ function le({
580
+ store: e,
581
+ children: r
582
+ }) {
583
+ return /* @__PURE__ */ a.jsx(ie.Provider, { value: e, children: r });
584
+ }
585
+ function B() {
586
+ const e = ne(ie);
587
+ if (!e)
588
+ throw new Error("useFormStore must be used inside a FormProvider.");
589
+ return e;
590
+ }
591
+ function mt(e) {
592
+ const r = $(null);
593
+ r.current || (r.current = Y(e));
594
+ const t = r.current, n = N(
595
+ t.subscribe,
596
+ t.getState,
597
+ t.getState
598
+ );
599
+ return {
600
+ store: t,
601
+ state: n,
602
+ submit: t.submit,
603
+ reset: t.reset,
604
+ validate: t.validate
605
+ };
606
+ }
607
+ function De() {
608
+ const e = B();
609
+ return N(
610
+ e.subscribe,
611
+ e.getState,
612
+ e.getState
613
+ );
614
+ }
615
+ function ce(e) {
616
+ const r = B(), t = P(
617
+ () => Le(r, e),
618
+ [r, e]
619
+ );
620
+ return {
621
+ ...N(
622
+ r.subscribe,
623
+ t.getState,
624
+ t.getState
625
+ ),
626
+ setValue: t.setValue,
627
+ setTouched: t.setTouched
628
+ };
629
+ }
630
+ function pt({
631
+ store: e,
632
+ children: r,
633
+ onSubmitResult: t,
634
+ onReset: n,
635
+ ...s
636
+ }) {
637
+ const o = async (c) => {
638
+ c.preventDefault();
639
+ const u = await e.submit();
640
+ await t?.(u);
641
+ }, i = (c) => {
642
+ c.preventDefault(), e.reset(), n?.();
643
+ };
644
+ return /* @__PURE__ */ a.jsx(le, { store: e, children: /* @__PURE__ */ a.jsx("form", { ...s, onSubmit: o, onReset: i, children: r }) });
645
+ }
646
+ function ee({ name: e, children: r, ...t }) {
647
+ const n = ce(e);
648
+ if (r)
649
+ return r(n);
650
+ const s = n.value, o = typeof s == "string" || typeof s == "number" ? s : "";
651
+ return /* @__PURE__ */ a.jsx(
652
+ "input",
653
+ {
654
+ ...t,
655
+ name: String(e),
656
+ value: o,
657
+ onChange: (i) => n.setValue(i.target.value),
658
+ onBlur: () => n.setTouched(),
659
+ "aria-invalid": n.error ? !0 : void 0
660
+ }
661
+ );
662
+ }
663
+ function ue(e, r) {
664
+ return e ? `${r} ${e}` : r;
665
+ }
666
+ function Ve(e) {
667
+ const { children: r = "Submit", disabled: t, className: n, ...s } = e, { submitting: o } = B().getState();
668
+ return /* @__PURE__ */ a.jsx(
669
+ "button",
670
+ {
671
+ ...s,
672
+ className: ue(n, "fsc-form-action"),
673
+ type: "submit",
674
+ disabled: t || o,
675
+ "aria-busy": o || void 0,
676
+ children: r
677
+ }
678
+ );
679
+ }
680
+ function Ue(e) {
681
+ const { children: r = "Reset", className: t, ...n } = e;
682
+ return /* @__PURE__ */ a.jsx(
683
+ "button",
684
+ {
685
+ ...n,
686
+ className: ue(t, "fsc-form-action"),
687
+ type: "reset",
688
+ children: r
689
+ }
690
+ );
691
+ }
692
+ function ht({ name: e, render: r }) {
693
+ const t = ce(e);
694
+ return r({
695
+ value: t.value,
696
+ onChange: t.setValue,
697
+ onBlur: () => t.setTouched(),
698
+ error: t.error
699
+ });
700
+ }
701
+ function bt(e) {
702
+ return function(t) {
703
+ const { field: n, ...s } = t;
704
+ return /* @__PURE__ */ a.jsx(e, { ...s, ...n });
705
+ };
706
+ }
707
+ function xt(e) {
708
+ const { resource: r, mode: t, id: n, initialValues: s, validate: o, transform: i, onSuccess: c } = e;
709
+ if (t === "edit" && n === void 0)
710
+ throw new Error("An id is required when creating an edit resource form.");
711
+ return Y({
712
+ initialValues: s,
713
+ validate: o,
714
+ onSubmit: async (f) => {
715
+ const h = i ? i(f) : f;
716
+ let d;
717
+ if (t === "create") {
718
+ if (!r.create)
719
+ throw new Error(`Resource "${r.name}" does not support create.`);
720
+ d = await r.create(h);
721
+ } else {
722
+ if (!r.update)
723
+ throw new Error(`Resource "${r.name}" does not support update.`);
724
+ d = await r.update(n, h);
725
+ }
726
+ await c?.(d);
727
+ }
728
+ });
729
+ }
730
+ function Ye(e) {
731
+ const r = /* @__PURE__ */ new Set();
732
+ for (const t of e)
733
+ for (const n of Object.keys(t)) r.add(n);
734
+ return [...r].map((t) => ({
735
+ key: t,
736
+ header: t
737
+ }));
738
+ }
739
+ function Be(e, r) {
740
+ return e === r ? 0 : e == null ? -1 : r == null ? 1 : String(e).localeCompare(String(r), void 0, { numeric: !0, sensitivity: "base" });
741
+ }
742
+ function We(e, r) {
743
+ let t = [...r];
744
+ return {
745
+ name: e,
746
+ async list(n = {}) {
747
+ let s = [...t];
748
+ if (n.search) {
749
+ const i = n.search.trim().toLowerCase();
750
+ i && (s = s.filter(
751
+ (c) => Object.values(c).some(
752
+ (u) => String(u ?? "").toLowerCase().includes(i)
753
+ )
754
+ ));
755
+ }
756
+ if (n.sort) {
757
+ const { field: i, direction: c } = n.sort;
758
+ s.sort((u, f) => {
759
+ const h = Be(u[i], f[i]);
760
+ return c === "desc" ? -h : h;
761
+ });
762
+ }
763
+ const o = s.length;
764
+ if (n.pageSize && n.pageSize > 0) {
765
+ const c = (Math.max(n.page ?? 1, 1) - 1) * n.pageSize;
766
+ s = s.slice(c, c + n.pageSize);
767
+ }
768
+ return { data: s, total: o };
769
+ },
770
+ async get(n) {
771
+ const s = t.find((o) => String(o.id) === n);
772
+ if (!s) throw new Error(`${e} record "${n}" was not found.`);
773
+ return s;
774
+ },
775
+ async create(n) {
776
+ const s = {
777
+ ...n,
778
+ id: globalThis.crypto.randomUUID()
779
+ };
780
+ return t.push(s), s;
781
+ },
782
+ async update(n, s) {
783
+ const o = t.findIndex((c) => String(c.id) === n);
784
+ if (o < 0) throw new Error(`${e} record "${n}" was not found.`);
785
+ const i = { ...t[o], ...s };
786
+ return t[o] = i, i;
787
+ },
788
+ async delete(n) {
789
+ const s = t.findIndex((o) => String(o.id) === n);
790
+ if (s < 0) throw new Error(`${e} record "${n}" was not found.`);
791
+ t.splice(s, 1);
792
+ }
793
+ };
794
+ }
795
+ function Je(e, r = {}) {
796
+ let t = {
797
+ data: [],
798
+ operation: "idle",
799
+ lastQuery: r.initialQuery
800
+ };
801
+ const n = /* @__PURE__ */ new Set(), s = () => {
802
+ for (const m of n) m();
803
+ }, o = (m) => {
804
+ t = {
805
+ ...t,
806
+ ...m,
807
+ lastUpdated: Date.now()
808
+ }, s();
809
+ }, i = (m) => m instanceof Error ? m : new Error(String(m)), c = async (m, v) => {
810
+ o({ operation: m, error: void 0 });
811
+ try {
812
+ const C = await v();
813
+ return o({ operation: "idle" }), C;
814
+ } catch (C) {
815
+ const O = i(C);
816
+ throw o({
817
+ operation: "idle",
818
+ error: O
819
+ }), O;
820
+ }
821
+ }, u = async (m = t.lastQuery ?? {}) => {
822
+ const v = await e.list(m);
823
+ return o({
824
+ data: v.data,
825
+ total: v.total,
826
+ lastQuery: m
827
+ }), v;
828
+ }, f = (m = t.lastQuery ?? {}) => c("listing", () => u(m)), h = (m) => c("reading", async () => {
829
+ const v = await e.get(m);
830
+ return o({ selected: v }), v;
831
+ }), d = (m) => {
832
+ if (!e.create) {
833
+ const v = new Error(
834
+ `Resource "${e.name}" does not support create().`
835
+ );
836
+ return o({ operation: "idle", error: v }), Promise.reject(v);
837
+ }
838
+ return c("creating", async () => {
839
+ const v = await e.create(m);
840
+ return await j(), o({ selected: v }), v;
841
+ });
842
+ }, g = (m, v) => {
843
+ if (!e.update) {
844
+ const C = new Error(
845
+ `Resource "${e.name}" does not support update().`
846
+ );
847
+ return o({ operation: "idle", error: C }), Promise.reject(C);
848
+ }
849
+ return c("updating", async () => {
850
+ const C = await e.update(m, v);
851
+ return await j(), o({ selected: C }), C;
852
+ });
853
+ }, b = (m) => {
854
+ if (!e.delete) {
855
+ const v = new Error(
856
+ `Resource "${e.name}" does not support delete().`
857
+ );
858
+ return o({ operation: "idle", error: v }), Promise.reject(v);
859
+ }
860
+ return c("deleting", async () => {
861
+ await e.delete(m), await j(), t.selected && String(t.selected.id) === String(m) && o({ selected: void 0 });
862
+ });
863
+ }, j = async () => {
864
+ const m = t.lastQuery ?? {}, v = await e.list(m);
865
+ o({
866
+ data: v.data,
867
+ total: v.total,
868
+ lastQuery: m
869
+ });
870
+ };
871
+ return {
872
+ getState: () => t,
873
+ list: f,
874
+ get: h,
875
+ create: d,
876
+ update: g,
877
+ remove: b,
878
+ refresh: () => f(t.lastQuery ?? {}),
879
+ select: (m) => o({ selected: m }),
880
+ clearSelection: () => o({ selected: void 0 }),
881
+ clearError: () => o({ error: void 0 }),
882
+ subscribe: (m) => (n.add(m), () => n.delete(m))
883
+ };
884
+ }
885
+ function Qe(e) {
886
+ let r = {
887
+ data: [],
888
+ columns: e.columns ?? [],
889
+ loading: !1,
890
+ error: null,
891
+ page: 1,
892
+ pageSize: Math.max(e.pageSize ?? 20, 1),
893
+ total: void 0,
894
+ search: "",
895
+ sort: void 0
896
+ };
897
+ const t = /* @__PURE__ */ new Set(), n = () => t.forEach((d) => d()), s = (d) => {
898
+ r = d, n();
899
+ }, o = async () => {
900
+ const d = r;
901
+ s({ ...d, loading: !0, error: null });
902
+ try {
903
+ const g = await e.resource.list({
904
+ page: d.page,
905
+ pageSize: d.pageSize,
906
+ search: d.search || void 0,
907
+ sort: d.sort
908
+ });
909
+ if (r.page !== d.page || r.pageSize !== d.pageSize || r.search !== d.search || r.sort !== d.sort)
910
+ return;
911
+ s({
912
+ ...r,
913
+ data: g.data,
914
+ columns: e.columns ?? Ye(g.data),
915
+ total: g.total,
916
+ loading: !1,
917
+ error: null
918
+ });
919
+ } catch (g) {
920
+ if (r.page !== d.page || r.pageSize !== d.pageSize || r.search !== d.search || r.sort !== d.sort)
921
+ return;
922
+ s({
923
+ ...r,
924
+ loading: !1,
925
+ error: g instanceof Error ? g : new Error(String(g))
926
+ });
927
+ }
928
+ };
929
+ return {
930
+ getState: () => r,
931
+ load: o,
932
+ setSearch: async (d) => {
933
+ s({ ...r, search: d, page: 1 }), await o();
934
+ },
935
+ setPage: async (d) => {
936
+ !Number.isInteger(d) || d < 1 || (s({ ...r, page: d }), await o());
937
+ },
938
+ setPageSize: async (d) => {
939
+ !Number.isInteger(d) || d < 1 || (s({ ...r, pageSize: d, page: 1 }), await o());
940
+ },
941
+ setSort: async (d) => {
942
+ const g = r.sort, b = g?.field === d && g.direction === "asc" ? "desc" : "asc";
943
+ s({ ...r, sort: { field: d, direction: b }, page: 1 }), await o();
944
+ },
945
+ reset: async () => {
946
+ s({ ...r, data: [], page: 1, search: "", sort: void 0, error: null }), await o();
947
+ },
948
+ subscribe: (d) => (t.add(d), () => t.delete(d))
949
+ };
950
+ }
951
+ function Ge(e) {
952
+ const r = P(
953
+ () => Qe(e),
954
+ [e.resource, e.columns, e.pageSize]
955
+ ), t = E(
956
+ (o) => r.subscribe(o),
957
+ [r]
958
+ ), n = E(() => r.getState(), [r]), s = N(t, n, n);
959
+ return { controller: r, state: s };
960
+ }
961
+ function qe({
962
+ data: e,
963
+ columns: r,
964
+ emptyState: t = null,
965
+ caption: n,
966
+ ...s
967
+ }) {
968
+ return /* @__PURE__ */ a.jsxs("table", { ...s, children: [
969
+ n !== void 0 ? /* @__PURE__ */ a.jsx("caption", { children: n }) : null,
970
+ /* @__PURE__ */ a.jsx("thead", { children: /* @__PURE__ */ a.jsx("tr", { children: r.map((o) => /* @__PURE__ */ a.jsx("th", { scope: "col", children: o.header ?? o.key }, o.key)) }) }),
971
+ /* @__PURE__ */ a.jsx("tbody", { children: e.length === 0 ? /* @__PURE__ */ a.jsx("tr", { children: /* @__PURE__ */ a.jsx("td", { colSpan: Math.max(r.length, 1), children: t }) }) : e.map((o, i) => /* @__PURE__ */ a.jsx("tr", { children: r.map((c) => {
972
+ const u = o[c.key];
973
+ return /* @__PURE__ */ a.jsx("td", { children: c.render ? c.render(u, o) : String(u ?? "") }, c.key);
974
+ }) }, String(o.id ?? i))) })
975
+ ] });
976
+ }
977
+ class Ze extends Error {
978
+ status;
979
+ code;
980
+ details;
981
+ constructor(r, t) {
982
+ super(t?.message ?? `API request failed with status ${r}.`), this.name = "ApiError", this.status = r, this.code = t?.code, this.details = t?.details;
983
+ }
984
+ }
985
+ function He(e, r) {
986
+ const t = new URLSearchParams();
987
+ for (const [s, o] of Object.entries(r))
988
+ o != null && (typeof o == "object" ? t.set(s, JSON.stringify(o)) : t.set(s, String(o)));
989
+ const n = t.toString();
990
+ return n ? `${e}${e.includes("?") ? "&" : "?"}${n}` : e;
991
+ }
992
+ function te(e) {
993
+ return (e.headers.get("content-type") ?? "").toLowerCase().includes("application/json");
994
+ }
995
+ function vt(e = "") {
996
+ const r = async (t, n) => {
997
+ const s = await fetch(`${e}${t}`, {
998
+ ...n,
999
+ headers: {
1000
+ Accept: "application/json",
1001
+ ...n?.body !== void 0 ? { "Content-Type": "application/json" } : {},
1002
+ ...n?.headers
1003
+ }
1004
+ });
1005
+ if (!s.ok) {
1006
+ let o;
1007
+ if (te(s))
1008
+ try {
1009
+ o = await s.json();
1010
+ } catch {
1011
+ o = void 0;
1012
+ }
1013
+ throw new Ze(s.status, o);
1014
+ }
1015
+ if (s.status !== 204 && te(s))
1016
+ return await s.json();
1017
+ };
1018
+ return {
1019
+ request: r,
1020
+ get: (t, n = {}) => r(He(t, n)),
1021
+ post: (t, n) => r(t, { method: "POST", body: JSON.stringify(n) }),
1022
+ patch: (t, n) => r(t, { method: "PATCH", body: JSON.stringify(n) }),
1023
+ delete: (t) => r(t, { method: "DELETE" })
1024
+ };
1025
+ }
1026
+ function gt(e) {
1027
+ const { client: r, path: t } = e;
1028
+ return {
1029
+ name: t.replace(/^\/+/, "").replace(/\/+$/, "") || "resource",
1030
+ async list(n = {}) {
1031
+ return r.get(t, n);
1032
+ },
1033
+ get: (n) => r.get(`${t}/${encodeURIComponent(String(n))}`),
1034
+ create: (n) => r.post(t, n),
1035
+ update: (n, s) => r.patch(`${t}/${encodeURIComponent(String(n))}`, s),
1036
+ delete: async (n) => {
1037
+ await r.delete(`${t}/${encodeURIComponent(String(n))}`);
1038
+ }
1039
+ };
1040
+ }
1041
+ function Xe({ resource: e }) {
1042
+ let r = {
1043
+ status: "idle",
1044
+ error: null
1045
+ };
1046
+ const t = /* @__PURE__ */ new Set(), n = () => t.forEach((i) => i()), s = (i) => {
1047
+ r = i, n();
1048
+ }, o = async (i) => {
1049
+ s({ ...r, status: "loading", error: null });
1050
+ try {
1051
+ const c = await i();
1052
+ return s({
1053
+ status: "success",
1054
+ data: c && typeof c == "object" ? c : r.data,
1055
+ error: null
1056
+ }), c;
1057
+ } catch (c) {
1058
+ s({
1059
+ ...r,
1060
+ status: "error",
1061
+ error: c instanceof Error ? c : new Error(String(c))
1062
+ });
1063
+ return;
1064
+ }
1065
+ };
1066
+ return {
1067
+ getState: () => r,
1068
+ get: (i) => o(() => e.get(i)),
1069
+ create: async (i) => {
1070
+ if (!e.create) {
1071
+ const c = new Error(`Resource "${e.name}" does not support create.`);
1072
+ s({ ...r, status: "error", error: c });
1073
+ return;
1074
+ }
1075
+ return o(() => e.create(i));
1076
+ },
1077
+ update: async (i, c) => {
1078
+ if (!e.update) {
1079
+ const u = new Error(`Resource "${e.name}" does not support update.`);
1080
+ s({ ...r, status: "error", error: u });
1081
+ return;
1082
+ }
1083
+ return o(() => e.update(i, c));
1084
+ },
1085
+ remove: async (i) => {
1086
+ if (!e.delete) {
1087
+ const u = new Error(`Resource "${e.name}" does not support delete.`);
1088
+ return s({ ...r, status: "error", error: u }), !1;
1089
+ }
1090
+ return await o(async () => (await e.delete(i), !0)) === !0;
1091
+ },
1092
+ reset: () => s({ status: "idle", error: null }),
1093
+ subscribe: (i) => (t.add(i), () => t.delete(i))
1094
+ };
1095
+ }
1096
+ function jt(e) {
1097
+ const r = $(null);
1098
+ (!r.current || r.current.resource !== e) && (r.current = {
1099
+ resource: e,
1100
+ controller: Xe({ resource: e })
1101
+ });
1102
+ const t = r.current.controller, n = N(
1103
+ t.subscribe,
1104
+ t.getState,
1105
+ t.getState
1106
+ );
1107
+ return {
1108
+ ...t,
1109
+ ...n
1110
+ };
1111
+ }
1112
+ function Ke(e) {
1113
+ const r = $(null);
1114
+ (!r.current || r.current.resource !== e) && (r.current = {
1115
+ resource: e,
1116
+ controller: Je(e)
1117
+ });
1118
+ const t = r.current.controller, n = N(
1119
+ t.subscribe,
1120
+ t.getState,
1121
+ t.getState
1122
+ ), s = E(
1123
+ (b) => t.list(b),
1124
+ [t]
1125
+ ), o = E((b) => t.get(b), [t]), i = E((b) => t.create(b), [t]), c = E(
1126
+ (b, j) => t.update(b, j),
1127
+ [t]
1128
+ ), u = E((b) => t.remove(b), [t]), f = E(() => t.refresh(), [t]), h = E((b) => t.select(b), [t]), d = E(() => t.clearSelection(), [t]), g = E(() => t.clearError(), [t]);
1129
+ return {
1130
+ ...t,
1131
+ ...n,
1132
+ list: s,
1133
+ get: o,
1134
+ create: i,
1135
+ update: c,
1136
+ remove: u,
1137
+ refresh: f,
1138
+ select: h,
1139
+ clearSelection: d,
1140
+ clearError: g
1141
+ };
1142
+ }
1143
+ function yt({ children: e, columns: r = 1, gap: t, ...n }) {
1144
+ const s = typeof r == "number" ? "repeat(" + r + ", minmax(0, 1fr))" : r;
1145
+ return /* @__PURE__ */ a.jsx("div", { ...n, style: { display: "grid", gridTemplateColumns: s, gap: t, ...n.style }, children: e });
1146
+ }
1147
+ function St({ children: e, direction: r = "column", gap: t, ...n }) {
1148
+ return /* @__PURE__ */ a.jsx("div", { ...n, "data-direction": r, style: { display: "flex", flexDirection: r, gap: t, ...n.style }, children: e });
1149
+ }
1150
+ function et({
1151
+ label: e = "Loading…",
1152
+ "aria-label": r,
1153
+ ...t
1154
+ }) {
1155
+ const n = r ?? (typeof e == "string" || typeof e == "number" ? String(e) : void 0);
1156
+ return /* @__PURE__ */ a.jsx(
1157
+ "div",
1158
+ {
1159
+ ...t,
1160
+ role: "status",
1161
+ "aria-label": n,
1162
+ "aria-live": "polite",
1163
+ "aria-busy": "true",
1164
+ children: e
1165
+ }
1166
+ );
1167
+ }
1168
+ function tt({
1169
+ resource: e,
1170
+ columns: r,
1171
+ pageSize: t,
1172
+ emptyState: n = "No records.",
1173
+ reloadKey: s,
1174
+ className: o,
1175
+ ...i
1176
+ }) {
1177
+ const { controller: c, state: u } = Ge({ resource: e, columns: r, pageSize: t });
1178
+ return M(() => {
1179
+ c.load();
1180
+ }, [c, s]), /* @__PURE__ */ a.jsx(
1181
+ qe,
1182
+ {
1183
+ ...i,
1184
+ className: o ? `fsc-resource-table ${o}` : "fsc-resource-table",
1185
+ data: u.data,
1186
+ columns: u.columns,
1187
+ emptyState: u.loading ? /* @__PURE__ */ a.jsx(et, {}) : u.error?.message ?? n
1188
+ }
1189
+ );
1190
+ }
1191
+ const rt = [
1192
+ { id: "1", name: "Phone", price: 499 },
1193
+ { id: "2", name: "Vacuum", price: 299 },
1194
+ { id: "3", name: "Tablet", price: 349 }
1195
+ ], nt = { name: "", price: "" };
1196
+ function at(e) {
1197
+ return e ? { name: e.name, price: String(e.price) } : nt;
1198
+ }
1199
+ function st({
1200
+ store: e,
1201
+ operation: r,
1202
+ controllerError: t,
1203
+ editing: n,
1204
+ onSuccess: s,
1205
+ onCancel: o
1206
+ }) {
1207
+ const i = De(), c = i.submitting || r === "creating" || r === "updating";
1208
+ return /* @__PURE__ */ a.jsxs(
1209
+ "form",
1210
+ {
1211
+ className: "fsc-crud-example__editor",
1212
+ onSubmit: async (u) => {
1213
+ u.preventDefault(), await e.submit() && s();
1214
+ },
1215
+ onReset: (u) => {
1216
+ u.preventDefault(), e.reset();
1217
+ },
1218
+ children: [
1219
+ /* @__PURE__ */ a.jsx("strong", { children: n ? "Upraviť záznam" : "Nový záznam" }),
1220
+ /* @__PURE__ */ a.jsx(ee, { name: "name", children: (u) => /* @__PURE__ */ a.jsxs("label", { className: "fsc-crud-example__field", children: [
1221
+ /* @__PURE__ */ a.jsx("span", { children: "Názov" }),
1222
+ /* @__PURE__ */ a.jsx(
1223
+ "input",
1224
+ {
1225
+ value: u.value,
1226
+ onChange: (f) => u.setValue(f.target.value),
1227
+ onBlur: () => u.setTouched(),
1228
+ disabled: c,
1229
+ "aria-invalid": u.error ? !0 : void 0
1230
+ }
1231
+ ),
1232
+ u.error ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: u.error }) : null
1233
+ ] }) }),
1234
+ /* @__PURE__ */ a.jsx(ee, { name: "price", children: (u) => /* @__PURE__ */ a.jsxs("label", { className: "fsc-crud-example__field", children: [
1235
+ /* @__PURE__ */ a.jsx("span", { children: "Cena (€)" }),
1236
+ /* @__PURE__ */ a.jsx(
1237
+ "input",
1238
+ {
1239
+ type: "number",
1240
+ min: "0",
1241
+ step: "0.01",
1242
+ value: u.value,
1243
+ onChange: (f) => u.setValue(f.target.value),
1244
+ onBlur: () => u.setTouched(),
1245
+ disabled: c,
1246
+ "aria-invalid": u.error ? !0 : void 0
1247
+ }
1248
+ ),
1249
+ u.error ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: u.error }) : null
1250
+ ] }) }),
1251
+ t ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: t.message }) : null,
1252
+ i.submitError && !t ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: i.submitError }) : null,
1253
+ /* @__PURE__ */ a.jsxs("div", { className: "fsc-crud-example__actions", children: [
1254
+ /* @__PURE__ */ a.jsx(Ve, { disabled: c, children: r === "creating" ? "Vytváram…" : r === "updating" ? "Ukladám…" : n ? "Uložiť zmeny" : "Vytvoriť" }),
1255
+ /* @__PURE__ */ a.jsx(Ue, { disabled: c, children: "Reset" }),
1256
+ /* @__PURE__ */ a.jsx("button", { type: "button", onClick: o, disabled: c, children: "Zrušiť" }),
1257
+ c ? /* @__PURE__ */ a.jsx("span", { "aria-live": "polite", children: "Spracovávam…" }) : null
1258
+ ] })
1259
+ ]
1260
+ }
1261
+ );
1262
+ }
1263
+ function ot(e) {
1264
+ return /* @__PURE__ */ a.jsx(le, { store: e.store, children: /* @__PURE__ */ a.jsx(st, { ...e }) });
1265
+ }
1266
+ function wt({ onEvent: e } = {}) {
1267
+ const r = P(
1268
+ () => We("crud-example", rt),
1269
+ []
1270
+ ), t = Ke(r), [n, s] = T(!1), [o, i] = T(), [c, u] = T(0), f = E(() => {
1271
+ i(void 0), s(!0);
1272
+ }, []), h = E((x) => {
1273
+ i(x), s(!0);
1274
+ }, []), d = E(
1275
+ async (x) => {
1276
+ if (t.operation === "idle")
1277
+ try {
1278
+ await t.remove(x.id), u((m) => m + 1), e?.("delete");
1279
+ } catch {
1280
+ e?.("error");
1281
+ }
1282
+ },
1283
+ [t, e]
1284
+ ), g = P(
1285
+ () => Y({
1286
+ initialValues: at(o),
1287
+ validate: async (x) => {
1288
+ const m = {};
1289
+ x.name.trim() || (m.name = "Názov je povinný.");
1290
+ const v = Number(x.price);
1291
+ return (!x.price.trim() || !Number.isFinite(v) || v < 0) && (m.price = "Zadajte platnú cenu."), m;
1292
+ },
1293
+ onSubmit: async (x) => {
1294
+ const m = { name: x.name.trim(), price: Number(x.price) };
1295
+ o ? (await t.update(o.id, m), e?.("update")) : (await t.create(m), e?.("create"));
1296
+ }
1297
+ }),
1298
+ [t.create, t.update, o, e]
1299
+ ), b = P(
1300
+ () => [
1301
+ {
1302
+ key: "name",
1303
+ header: "Produkt",
1304
+ render: (x, m) => /* @__PURE__ */ a.jsxs("div", { className: "fsc-crud-example__row-action", children: [
1305
+ /* @__PURE__ */ a.jsx("span", { children: String(x) }),
1306
+ /* @__PURE__ */ a.jsx(
1307
+ "button",
1308
+ {
1309
+ type: "button",
1310
+ onClick: () => h(m),
1311
+ disabled: t.operation !== "idle",
1312
+ children: "Upraviť"
1313
+ }
1314
+ )
1315
+ ] })
1316
+ },
1317
+ {
1318
+ key: "price",
1319
+ header: "Cena",
1320
+ render: (x) => `${String(x)} €`
1321
+ },
1322
+ {
1323
+ key: "id",
1324
+ header: "Akcie",
1325
+ render: (x, m) => /* @__PURE__ */ a.jsx(
1326
+ "button",
1327
+ {
1328
+ type: "button",
1329
+ onClick: () => {
1330
+ d(m);
1331
+ },
1332
+ disabled: t.operation !== "idle",
1333
+ children: "Zmazať"
1334
+ }
1335
+ )
1336
+ }
1337
+ ],
1338
+ [t.operation, d, h]
1339
+ ), j = E(() => {
1340
+ u((x) => x + 1), s(!1), i(void 0);
1341
+ }, []);
1342
+ return /* @__PURE__ */ a.jsxs("div", { className: "fsc-crud-example", children: [
1343
+ /* @__PURE__ */ a.jsxs("div", { className: "fsc-crud-example__toolbar", children: [
1344
+ /* @__PURE__ */ a.jsx("button", { type: "button", onClick: f, disabled: t.operation !== "idle", children: "Vytvoriť nový záznam" }),
1345
+ /* @__PURE__ */ a.jsxs("span", { "aria-live": "polite", children: [
1346
+ "Stav: ",
1347
+ t.operation === "idle" ? "Pripravené" : t.operation
1348
+ ] }),
1349
+ t.error ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: t.error.message }) : null
1350
+ ] }),
1351
+ /* @__PURE__ */ a.jsx(
1352
+ tt,
1353
+ {
1354
+ resource: r,
1355
+ columns: b,
1356
+ pageSize: 10,
1357
+ reloadKey: c
1358
+ }
1359
+ ),
1360
+ n ? /* @__PURE__ */ a.jsx(
1361
+ ot,
1362
+ {
1363
+ store: g,
1364
+ operation: t.operation,
1365
+ controllerError: t.error,
1366
+ editing: !!o,
1367
+ onSuccess: j,
1368
+ onCancel: () => {
1369
+ s(!1), i(void 0);
1370
+ }
1371
+ }
1372
+ ) : null
1373
+ ] });
1374
+ }
1375
+ function Et(e) {
1376
+ return /* @__PURE__ */ a.jsx("input", { ...e, type: "color" });
1377
+ }
1378
+ function Tt(e) {
1379
+ return /* @__PURE__ */ a.jsx("input", { ...e, type: "date" });
1380
+ }
1381
+ function Ct(e) {
1382
+ return /* @__PURE__ */ a.jsx("input", { ...e, type: "file" });
1383
+ }
1384
+ function kt(e) {
1385
+ return /* @__PURE__ */ a.jsx("input", { ...e, type: "number" });
1386
+ }
1387
+ function Rt(e) {
1388
+ return /* @__PURE__ */ a.jsx("input", { ...e, type: "password" });
1389
+ }
1390
+ function _t({ name: e, options: r, value: t, onValueChange: n }) {
1391
+ return /* @__PURE__ */ a.jsx("div", { role: "radiogroup", children: r.map((s) => /* @__PURE__ */ a.jsxs("label", { children: [
1392
+ /* @__PURE__ */ a.jsx("input", { type: "radio", name: e, value: s.value, checked: t === s.value, disabled: s.disabled, onChange: () => n?.(s.value) }),
1393
+ s.label
1394
+ ] }, s.value)) });
1395
+ }
1396
+ function Pt(e) {
1397
+ return /* @__PURE__ */ a.jsx("input", { ...e, type: "search" });
1398
+ }
1399
+ function Ot(e) {
1400
+ return /* @__PURE__ */ a.jsx("input", { ...e, type: "range" });
1401
+ }
1402
+ function At({ items: e }) {
1403
+ return /* @__PURE__ */ a.jsx("div", { children: e.map((r) => /* @__PURE__ */ a.jsxs("details", { children: [
1404
+ /* @__PURE__ */ a.jsx("summary", { children: r.title }),
1405
+ /* @__PURE__ */ a.jsx("div", { children: r.content })
1406
+ ] }, r.id)) });
1407
+ }
1408
+ function $t({ children: e, variant: r = "info", ...t }) {
1409
+ return /* @__PURE__ */ a.jsx("div", { ...t, role: "alert", "data-variant": r, children: e });
1410
+ }
1411
+ function Nt({ src: e, alt: r = "", fallback: t, ...n }) {
1412
+ return e ? /* @__PURE__ */ a.jsx("img", { ...n, src: e, alt: r }) : /* @__PURE__ */ a.jsx("span", { ...n, role: "img", "aria-label": r, children: t });
1413
+ }
1414
+ function zt({
1415
+ children: e,
1416
+ variant: r = "neutral",
1417
+ size: t = "medium",
1418
+ ...n
1419
+ }) {
1420
+ return /* @__PURE__ */ a.jsx(
1421
+ "span",
1422
+ {
1423
+ ...n,
1424
+ "data-variant": r,
1425
+ "data-size": t,
1426
+ children: e
1427
+ }
1428
+ );
1429
+ }
1430
+ function It({
1431
+ children: e,
1432
+ variant: r = "primary",
1433
+ size: t = "medium",
1434
+ loading: n = !1,
1435
+ disabled: s = !1,
1436
+ type: o = "button",
1437
+ className: i,
1438
+ ...c
1439
+ }) {
1440
+ const u = s || n;
1441
+ return /* @__PURE__ */ a.jsx(
1442
+ "button",
1443
+ {
1444
+ ...c,
1445
+ className: i ? `fsc-button ${i}` : "fsc-button",
1446
+ type: o,
1447
+ "data-variant": r,
1448
+ "data-size": t,
1449
+ "data-loading": n || void 0,
1450
+ "aria-busy": n || void 0,
1451
+ "aria-disabled": u || void 0,
1452
+ disabled: u,
1453
+ children: e
1454
+ }
1455
+ );
1456
+ }
1457
+ function Ft({
1458
+ children: e,
1459
+ padding: r = "medium",
1460
+ variant: t = "default",
1461
+ ...n
1462
+ }) {
1463
+ return /* @__PURE__ */ a.jsx(
1464
+ "div",
1465
+ {
1466
+ ...n,
1467
+ "data-padding": r,
1468
+ "data-variant": t,
1469
+ children: e
1470
+ }
1471
+ );
1472
+ }
1473
+ function Mt({ items: e, initialIndex: r = 0, onIndexChange: t }) {
1474
+ const [n, s] = T(r);
1475
+ if (!e.length) return null;
1476
+ const o = (i) => {
1477
+ const c = (i + e.length) % e.length;
1478
+ s(c), t?.(c);
1479
+ };
1480
+ return /* @__PURE__ */ a.jsxs("section", { "aria-roledescription": "carousel", children: [
1481
+ /* @__PURE__ */ a.jsx("div", { "aria-live": "polite", children: e[n] }),
1482
+ /* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => o(n - 1), children: "Previous" }),
1483
+ /* @__PURE__ */ a.jsxs("span", { children: [
1484
+ n + 1,
1485
+ " / ",
1486
+ e.length
1487
+ ] }),
1488
+ /* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => o(n + 1), children: "Next" })
1489
+ ] });
1490
+ }
1491
+ function Lt({
1492
+ size: e = "medium",
1493
+ disabled: r = !1,
1494
+ ...t
1495
+ }) {
1496
+ return /* @__PURE__ */ a.jsx(
1497
+ "input",
1498
+ {
1499
+ ...t,
1500
+ type: "checkbox",
1501
+ "data-size": e,
1502
+ disabled: r
1503
+ }
1504
+ );
1505
+ }
1506
+ function Dt({ options: e, value: r, defaultValue: t, placeholder: n = "Select...", onValueChange: s }) {
1507
+ const [o, i] = T(""), [c, u] = T(t ?? ""), f = r ?? c, h = P(() => e.filter((d) => String(d.label).toLowerCase().includes(o.toLowerCase())), [e, o]);
1508
+ return /* @__PURE__ */ a.jsxs("div", { children: [
1509
+ /* @__PURE__ */ a.jsx("input", { role: "combobox", value: o, placeholder: f ? String(e.find((d) => d.value === f)?.label ?? f) : n, onChange: (d) => i(d.target.value), "aria-expanded": "true" }),
1510
+ /* @__PURE__ */ a.jsx("ul", { role: "listbox", children: h.map((d) => /* @__PURE__ */ a.jsx("li", { children: /* @__PURE__ */ a.jsx("button", { type: "button", role: "option", "aria-selected": d.value === f, disabled: d.disabled, onClick: () => {
1511
+ u(d.value), s?.(d.value), i("");
1512
+ }, children: d.label }) }, d.value)) })
1513
+ ] });
1514
+ }
1515
+ function Vt({ items: e, open: r = !0, placeholder: t = "Search commands" }) {
1516
+ const [n, s] = T(""), o = P(() => e.filter((i) => (String(i.label) + " " + (i.keywords ?? []).join(" ")).toLowerCase().includes(n.toLowerCase())), [e, n]);
1517
+ return r ? /* @__PURE__ */ a.jsxs("div", { role: "dialog", "aria-label": "Command palette", children: [
1518
+ /* @__PURE__ */ a.jsx("input", { autoFocus: !0, value: n, placeholder: t, onChange: (i) => s(i.target.value) }),
1519
+ /* @__PURE__ */ a.jsx("div", { role: "listbox", children: o.map((i) => /* @__PURE__ */ a.jsx("button", { type: "button", role: "option", disabled: i.disabled, onClick: i.onSelect, children: i.label }, i.id)) })
1520
+ ] }) : null;
1521
+ }
1522
+ function Ut({ children: e, items: r }) {
1523
+ const [t, n] = T(!1);
1524
+ return /* @__PURE__ */ a.jsxs("div", { onContextMenu: (s) => {
1525
+ s.preventDefault(), n(!0);
1526
+ }, onBlur: () => n(!1), tabIndex: 0, children: [
1527
+ e,
1528
+ t && /* @__PURE__ */ a.jsx("div", { role: "menu", children: r.map((s, o) => /* @__PURE__ */ a.jsx("button", { type: "button", role: "menuitem", disabled: s.disabled, onClick: () => {
1529
+ s.onSelect?.(), n(!1);
1530
+ }, children: s.label }, o)) })
1531
+ ] });
1532
+ }
1533
+ function Yt({ value: e, defaultValue: r, min: t, max: n, onValueChange: s }) {
1534
+ const [o, i] = T(r ?? ""), c = e ?? o;
1535
+ return /* @__PURE__ */ a.jsx("input", { type: "date", value: c, min: t, max: n, onChange: (u) => {
1536
+ i(u.target.value), s?.(u.target.value);
1537
+ } });
1538
+ }
1539
+ function Bt({ open: e, children: r, title: t, onClose: n, side: s = "right" }) {
1540
+ return e ? /* @__PURE__ */ a.jsxs("aside", { "data-side": s, children: [
1541
+ t && /* @__PURE__ */ a.jsx("h2", { children: t }),
1542
+ /* @__PURE__ */ a.jsx("button", { type: "button", onClick: n, children: "Close" }),
1543
+ r
1544
+ ] }) : null;
1545
+ }
1546
+ function Wt({ label: e, items: r }) {
1547
+ return /* @__PURE__ */ a.jsxs("details", { children: [
1548
+ /* @__PURE__ */ a.jsx("summary", { children: e }),
1549
+ /* @__PURE__ */ a.jsx("div", { role: "menu", children: r.map((t, n) => /* @__PURE__ */ a.jsx("button", { type: "button", role: "menuitem", disabled: t.disabled, onClick: t.onSelect, children: t.label }, n)) })
1550
+ ] });
1551
+ }
1552
+ function Jt({
1553
+ title: e,
1554
+ description: r,
1555
+ action: t,
1556
+ ...n
1557
+ }) {
1558
+ return /* @__PURE__ */ a.jsxs("div", { ...n, role: "status", "aria-live": "polite", children: [
1559
+ /* @__PURE__ */ a.jsx("h2", { children: e }),
1560
+ r ? /* @__PURE__ */ a.jsx("p", { children: r }) : null,
1561
+ t ? /* @__PURE__ */ a.jsx("div", { children: t }) : null
1562
+ ] });
1563
+ }
1564
+ function Qt({
1565
+ title: e = "Something went wrong",
1566
+ description: r,
1567
+ action: t,
1568
+ ...n
1569
+ }) {
1570
+ return /* @__PURE__ */ a.jsxs("div", { ...n, role: "alert", "aria-live": "assertive", children: [
1571
+ /* @__PURE__ */ a.jsx("h2", { children: e }),
1572
+ r ? /* @__PURE__ */ a.jsx("p", { children: r }) : null,
1573
+ t ? /* @__PURE__ */ a.jsx("div", { children: t }) : null
1574
+ ] });
1575
+ }
1576
+ function Gt({ accept: e, multiple: r, children: t = "Choose files", onFilesChange: n }) {
1577
+ const s = (o) => n?.(Array.from(o.target.files ?? []));
1578
+ return /* @__PURE__ */ a.jsxs("label", { children: [
1579
+ t,
1580
+ /* @__PURE__ */ a.jsx("input", { type: "file", hidden: !0, accept: e, multiple: r, onChange: s })
1581
+ ] });
1582
+ }
1583
+ function qt({
1584
+ label: e,
1585
+ description: r,
1586
+ error: t,
1587
+ size: n = "medium",
1588
+ id: s,
1589
+ required: o = !1,
1590
+ className: i,
1591
+ ...c
1592
+ }) {
1593
+ const u = ae(), f = s ?? u, h = r ? `${f}-description` : void 0, d = t ? `${f}-error` : void 0, b = [c["aria-describedby"], h, d].filter(Boolean).join(" ") || void 0, j = c["aria-invalid"];
1594
+ return /* @__PURE__ */ a.jsxs(
1595
+ "div",
1596
+ {
1597
+ className: i ? `fsc-form-field ${i}` : "fsc-form-field",
1598
+ "data-size": n,
1599
+ "data-invalid": t ? "true" : void 0,
1600
+ children: [
1601
+ /* @__PURE__ */ a.jsxs("label", { htmlFor: f, children: [
1602
+ e,
1603
+ o ? /* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", children: " *" }) : null
1604
+ ] }),
1605
+ /* @__PURE__ */ a.jsx(
1606
+ "input",
1607
+ {
1608
+ ...c,
1609
+ id: f,
1610
+ required: o,
1611
+ "aria-describedby": b,
1612
+ "aria-invalid": t ? !0 : j
1613
+ }
1614
+ ),
1615
+ r ? /* @__PURE__ */ a.jsx("div", { "data-role": "description", id: h, children: r }) : null,
1616
+ t ? /* @__PURE__ */ a.jsx("div", { "data-role": "error", id: d, role: "alert", children: t }) : null
1617
+ ]
1618
+ }
1619
+ );
1620
+ }
1621
+ function Zt({ children: e, level: r = 2, ...t }) {
1622
+ const n = { 1: "h1", 2: "h2", 3: "h3", 4: "h4", 5: "h5", 6: "h6" }[r];
1623
+ return /* @__PURE__ */ a.jsx(n, { ...t, children: e });
1624
+ }
1625
+ function Ht({
1626
+ icon: e,
1627
+ label: r,
1628
+ variant: t = "ghost",
1629
+ size: n = "medium",
1630
+ loading: s = !1,
1631
+ disabled: o = !1,
1632
+ type: i = "button",
1633
+ ...c
1634
+ }) {
1635
+ return /* @__PURE__ */ a.jsx(
1636
+ "button",
1637
+ {
1638
+ ...c,
1639
+ type: i,
1640
+ "aria-label": r,
1641
+ "aria-busy": s || void 0,
1642
+ "data-variant": t,
1643
+ "data-size": n,
1644
+ disabled: o || s,
1645
+ children: e
1646
+ }
1647
+ );
1648
+ }
1649
+ function Xt({
1650
+ size: e = "medium",
1651
+ disabled: r = !1,
1652
+ className: t,
1653
+ ...n
1654
+ }) {
1655
+ return /* @__PURE__ */ a.jsx(
1656
+ "input",
1657
+ {
1658
+ ...n,
1659
+ className: t ? `fsc-input ${t}` : "fsc-input",
1660
+ "data-size": e,
1661
+ disabled: r
1662
+ }
1663
+ );
1664
+ }
1665
+ function Kt({
1666
+ children: e,
1667
+ required: r = !1,
1668
+ "aria-label": t,
1669
+ ...n
1670
+ }) {
1671
+ const s = t ?? (r && typeof e == "string" ? e : void 0);
1672
+ return /* @__PURE__ */ a.jsxs("label", { ...n, "aria-label": s, children: [
1673
+ e,
1674
+ r ? /* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", children: " *" }) : null
1675
+ ] });
1676
+ }
1677
+ function er({ children: e, ...r }) {
1678
+ return /* @__PURE__ */ a.jsx("a", { ...r, children: e });
1679
+ }
1680
+ function tr({ items: e }) {
1681
+ return /* @__PURE__ */ a.jsx("nav", { "aria-label": "Menu", children: /* @__PURE__ */ a.jsx("ul", { role: "menubar", children: e.map((r, t) => /* @__PURE__ */ a.jsxs("li", { children: [
1682
+ /* @__PURE__ */ a.jsx("button", { type: "button", role: "menuitem", children: r.label }),
1683
+ r.items && /* @__PURE__ */ a.jsx("ul", { role: "menu", children: r.items.map((n, s) => /* @__PURE__ */ a.jsx("li", { children: n }, s)) })
1684
+ ] }, t)) }) });
1685
+ }
1686
+ const it = [
1687
+ "a[href]",
1688
+ "area[href]",
1689
+ "button:not([disabled])",
1690
+ "input:not([disabled])",
1691
+ "select:not([disabled])",
1692
+ "textarea:not([disabled])",
1693
+ '[contenteditable="true"]',
1694
+ '[tabindex]:not([tabindex="-1"])'
1695
+ ].join(",");
1696
+ function rr({
1697
+ open: e,
1698
+ title: r,
1699
+ children: t,
1700
+ onClose: n,
1701
+ dismissible: s = !0,
1702
+ ...o
1703
+ }) {
1704
+ const i = ae(), c = $(null), u = $(null), f = $(n);
1705
+ return f.current = n, M(() => {
1706
+ if (!e) return;
1707
+ u.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
1708
+ const h = document.body.style.overflow;
1709
+ document.body.style.overflow = "hidden";
1710
+ const d = requestAnimationFrame(() => {
1711
+ c.current?.focus();
1712
+ }), g = (b) => {
1713
+ if (b.key === "Escape" && s) {
1714
+ b.preventDefault(), f.current?.();
1715
+ return;
1716
+ }
1717
+ if (b.key !== "Tab") return;
1718
+ const j = c.current;
1719
+ if (!j) return;
1720
+ const x = Array.from(
1721
+ j.querySelectorAll(it)
1722
+ ).filter((O) => O.getAttribute("aria-hidden") !== "true");
1723
+ if (x.length === 0) {
1724
+ b.preventDefault(), j.focus();
1725
+ return;
1726
+ }
1727
+ const m = document.activeElement, v = x.indexOf(m);
1728
+ if (b.preventDefault(), m === j || v === -1) {
1729
+ (b.shiftKey ? x[x.length - 1] : x[0]).focus();
1730
+ return;
1731
+ }
1732
+ const C = b.shiftKey ? (v - 1 + x.length) % x.length : (v + 1) % x.length;
1733
+ x[C].focus();
1734
+ };
1735
+ return document.addEventListener("keydown", g), () => {
1736
+ cancelAnimationFrame(d), document.removeEventListener("keydown", g), document.body.style.overflow = h, u.current?.focus();
1737
+ };
1738
+ }, [s, e]), e ? /* @__PURE__ */ a.jsx(
1739
+ "div",
1740
+ {
1741
+ role: "presentation",
1742
+ "data-modal-backdrop": "true",
1743
+ onMouseDown: (h) => {
1744
+ s && h.target === h.currentTarget && f.current?.();
1745
+ },
1746
+ children: /* @__PURE__ */ a.jsxs(
1747
+ "div",
1748
+ {
1749
+ ...o,
1750
+ ref: c,
1751
+ role: "dialog",
1752
+ "aria-modal": "true",
1753
+ "aria-labelledby": i,
1754
+ tabIndex: -1,
1755
+ children: [
1756
+ /* @__PURE__ */ a.jsx("header", { children: /* @__PURE__ */ a.jsx("h2", { id: i, children: r }) }),
1757
+ /* @__PURE__ */ a.jsx("div", { children: t })
1758
+ ]
1759
+ }
1760
+ )
1761
+ }
1762
+ ) : null;
1763
+ }
1764
+ function nr({ options: e, value: r, defaultValue: t = [], onValueChange: n }) {
1765
+ const [s, o] = T(t), i = r ?? s, c = (u) => {
1766
+ const f = i.includes(u) ? i.filter((h) => h !== u) : [...i, u];
1767
+ o(f), n?.(f);
1768
+ };
1769
+ return /* @__PURE__ */ a.jsx("div", { role: "group", children: e.map((u) => /* @__PURE__ */ a.jsxs("label", { children: [
1770
+ /* @__PURE__ */ a.jsx("input", { type: "checkbox", checked: i.includes(u.value), disabled: u.disabled, onChange: () => c(u.value) }),
1771
+ u.label
1772
+ ] }, u.value)) });
1773
+ }
1774
+ function ar({ items: e }) {
1775
+ const r = (t) => t.map((n, s) => /* @__PURE__ */ a.jsxs("li", { children: [
1776
+ n.href ? /* @__PURE__ */ a.jsx("a", { href: n.href, children: n.label }) : /* @__PURE__ */ a.jsx("span", { children: n.label }),
1777
+ n.children && /* @__PURE__ */ a.jsx("ul", { children: r(n.children) })
1778
+ ] }, s));
1779
+ return /* @__PURE__ */ a.jsx("nav", { "aria-label": "Navigation", children: /* @__PURE__ */ a.jsx("ul", { children: r(e) }) });
1780
+ }
1781
+ function sr({ page: e, pageCount: r, onPageChange: t, ...n }) {
1782
+ return /* @__PURE__ */ a.jsxs("nav", { ...n, "aria-label": "Pagination", children: [
1783
+ /* @__PURE__ */ a.jsx("button", { type: "button", disabled: e <= 1, onClick: () => t?.(e - 1), children: "Previous" }),
1784
+ /* @__PURE__ */ a.jsxs("span", { children: [
1785
+ e,
1786
+ " / ",
1787
+ r
1788
+ ] }),
1789
+ /* @__PURE__ */ a.jsx("button", { type: "button", disabled: e >= r, onClick: () => t?.(e + 1), children: "Next" })
1790
+ ] });
1791
+ }
1792
+ function or({ trigger: e, children: r, open: t, onOpenChange: n }) {
1793
+ const [s, o] = T(!1), i = t ?? s, c = (u) => {
1794
+ o(u), n?.(u);
1795
+ };
1796
+ return /* @__PURE__ */ a.jsxs("div", { children: [
1797
+ /* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => c(!i), "aria-expanded": i, children: e }),
1798
+ i && /* @__PURE__ */ a.jsxs("div", { role: "dialog", children: [
1799
+ r,
1800
+ /* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => c(!1), children: "Close" })
1801
+ ] })
1802
+ ] });
1803
+ }
1804
+ function ir({ value: e = 0, max: r = 100, label: t, ...n }) {
1805
+ return /* @__PURE__ */ a.jsx("div", { ...n, role: "progressbar", "aria-label": t, "aria-valuenow": e, "aria-valuemin": 0, "aria-valuemax": r });
1806
+ }
1807
+ function lr({
1808
+ size: e = "medium",
1809
+ disabled: r = !1,
1810
+ ...t
1811
+ }) {
1812
+ return /* @__PURE__ */ a.jsx(
1813
+ "input",
1814
+ {
1815
+ ...t,
1816
+ type: "radio",
1817
+ "data-size": e,
1818
+ disabled: r
1819
+ }
1820
+ );
1821
+ }
1822
+ function cr({ children: e, initialSize: r = 300, minSize: t = 120, maxSize: n = 800 }) {
1823
+ const [s, o] = T(r);
1824
+ return /* @__PURE__ */ a.jsxs("div", { style: { width: s }, children: [
1825
+ /* @__PURE__ */ a.jsx("div", { children: e }),
1826
+ /* @__PURE__ */ a.jsx("input", { "aria-label": "Panel size", type: "range", min: t, max: n, value: s, onChange: (i) => o(Number(i.target.value)) })
1827
+ ] });
1828
+ }
1829
+ function ur({ onClear: e, ...r }) {
1830
+ return /* @__PURE__ */ a.jsxs("div", { children: [
1831
+ /* @__PURE__ */ a.jsx("input", { ...r, type: "search" }),
1832
+ e && /* @__PURE__ */ a.jsx("button", { type: "button", onClick: e, children: "Clear" })
1833
+ ] });
1834
+ }
1835
+ const lt = [
1836
+ { value: "first", label: "First option" },
1837
+ { value: "second", label: "Second option" },
1838
+ { value: "third", label: "Third option" }
1839
+ ];
1840
+ function dr({
1841
+ size: e = "medium",
1842
+ options: r = lt,
1843
+ disabled: t = !1,
1844
+ ...n
1845
+ }) {
1846
+ return /* @__PURE__ */ a.jsx(
1847
+ "select",
1848
+ {
1849
+ ...n,
1850
+ "data-size": e,
1851
+ disabled: t,
1852
+ children: r.map((s) => /* @__PURE__ */ a.jsx(
1853
+ "option",
1854
+ {
1855
+ value: s.value,
1856
+ disabled: s.disabled,
1857
+ children: s.label
1858
+ },
1859
+ s.value
1860
+ ))
1861
+ }
1862
+ );
1863
+ }
1864
+ function fr({ orientation: e = "horizontal", ...r }) {
1865
+ return /* @__PURE__ */ a.jsx("hr", { ...r, "aria-orientation": e });
1866
+ }
1867
+ function mr({ children: e, open: r = !0, width: t = "280px" }) {
1868
+ return /* @__PURE__ */ a.jsx("aside", { hidden: !r, style: { width: t }, "aria-label": "Sidebar", children: e });
1869
+ }
1870
+ function pr({ width: e, height: r, variant: t = "rect", style: n, ...s }) {
1871
+ return /* @__PURE__ */ a.jsx("div", { ...s, "aria-hidden": "true", "data-variant": t, style: { width: e, height: r, ...n } });
1872
+ }
1873
+ function hr({ label: e = "Loading", ...r }) {
1874
+ return /* @__PURE__ */ a.jsx("span", { ...r, role: "status", "aria-label": e });
1875
+ }
1876
+ function br({
1877
+ label: e,
1878
+ value: r,
1879
+ description: t,
1880
+ trend: n = "neutral",
1881
+ trendValue: s,
1882
+ className: o,
1883
+ ...i
1884
+ }) {
1885
+ return /* @__PURE__ */ a.jsxs(
1886
+ "div",
1887
+ {
1888
+ ...i,
1889
+ className: o ? `fsc-stat-card ${o}` : "fsc-stat-card",
1890
+ "data-trend": n,
1891
+ children: [
1892
+ /* @__PURE__ */ a.jsx("span", { "data-role": "label", children: e }),
1893
+ /* @__PURE__ */ a.jsx("strong", { "data-role": "value", children: r }),
1894
+ t ? /* @__PURE__ */ a.jsx("span", { "data-role": "description", children: t }) : null,
1895
+ s ? /* @__PURE__ */ a.jsx("span", { "data-role": "trend", children: s }) : null
1896
+ ]
1897
+ }
1898
+ );
1899
+ }
1900
+ function xr({ steps: e, current: r, orientation: t = "horizontal" }) {
1901
+ return /* @__PURE__ */ a.jsx("ol", { "data-orientation": t, children: e.map((n, s) => /* @__PURE__ */ a.jsxs("li", { "aria-current": s === r ? "step" : void 0, "aria-disabled": n.disabled, children: [
1902
+ n.label,
1903
+ n.description && /* @__PURE__ */ a.jsx("small", { children: n.description })
1904
+ ] }, n.id)) });
1905
+ }
1906
+ function vr({
1907
+ size: e = "medium",
1908
+ disabled: r = !1,
1909
+ ...t
1910
+ }) {
1911
+ return /* @__PURE__ */ a.jsx(
1912
+ "input",
1913
+ {
1914
+ ...t,
1915
+ type: "checkbox",
1916
+ role: "switch",
1917
+ "data-size": e,
1918
+ disabled: r
1919
+ }
1920
+ );
1921
+ }
1922
+ function gr({ items: e, value: r, defaultValue: t, onValueChange: n }) {
1923
+ const s = r ?? t ?? e[0]?.id;
1924
+ return /* @__PURE__ */ a.jsxs("div", { children: [
1925
+ /* @__PURE__ */ a.jsx("div", { role: "tablist", children: e.map((o) => /* @__PURE__ */ a.jsx("button", { type: "button", role: "tab", "aria-selected": o.id === s, disabled: o.disabled, onClick: () => n?.(o.id), children: o.label }, o.id)) }),
1926
+ e.map((o) => o.id === s ? /* @__PURE__ */ a.jsx("div", { role: "tabpanel", children: o.content }, o.id) : null)
1927
+ ] });
1928
+ }
1929
+ function jr({ children: e, as: r = "p", ...t }) {
1930
+ const n = r;
1931
+ return /* @__PURE__ */ a.jsx(n, { ...t, children: e });
1932
+ }
1933
+ function yr({
1934
+ size: e = "medium",
1935
+ rows: r = 4,
1936
+ disabled: t = !1,
1937
+ ...n
1938
+ }) {
1939
+ return /* @__PURE__ */ a.jsx(
1940
+ "textarea",
1941
+ {
1942
+ ...n,
1943
+ rows: r,
1944
+ "data-size": e,
1945
+ disabled: t
1946
+ }
1947
+ );
1948
+ }
1949
+ function Sr({ open: e = !0, children: r, variant: t = "info", onClose: n }) {
1950
+ return e ? /* @__PURE__ */ a.jsxs("div", { role: "status", "data-variant": t, children: [
1951
+ r,
1952
+ /* @__PURE__ */ a.jsx("button", { type: "button", onClick: n, children: "Close" })
1953
+ ] }) : null;
1954
+ }
1955
+ function wr({ content: e, children: r }) {
1956
+ return /* @__PURE__ */ a.jsx("span", { title: typeof e == "string" ? e : void 0, children: r });
1957
+ }
1958
+ function Er({ nodes: e, onSelect: r }) {
1959
+ const t = (n) => /* @__PURE__ */ a.jsx("ul", { role: "tree", children: n.map((s) => /* @__PURE__ */ a.jsxs("li", { role: "treeitem", "aria-disabled": s.disabled, children: [
1960
+ /* @__PURE__ */ a.jsx("button", { type: "button", disabled: s.disabled, onClick: () => r?.(s.id), children: s.label }),
1961
+ s.children && t(s.children)
1962
+ ] }, s.id)) });
1963
+ return t(e);
1964
+ }
1965
+ export {
1966
+ At as Accordion,
1967
+ $t as Alert,
1968
+ Ze as ApiError,
1969
+ Nt as Avatar,
1970
+ zt as Badge,
1971
+ ee as BoundFormField,
1972
+ It as Button,
1973
+ Ft as Card,
1974
+ Mt as Carousel,
1975
+ Lt as Checkbox,
1976
+ Et as ColorInput,
1977
+ Dt as Combobox,
1978
+ Vt as CommandPalette,
1979
+ Ut as ContextMenu,
1980
+ wt as CrudExample,
1981
+ Tt as DateInput,
1982
+ Yt as DatePicker,
1983
+ Bt as Drawer,
1984
+ Wt as DropdownMenu,
1985
+ Jt as EmptyState,
1986
+ Qt as ErrorState,
1987
+ Ct as FileInput,
1988
+ Gt as FileUpload,
1989
+ pt as Form,
1990
+ qt as FormField,
1991
+ ht as FormFieldAdapter,
1992
+ le as FormProvider,
1993
+ Ue as FormReset,
1994
+ Ve as FormSubmit,
1995
+ yt as Grid,
1996
+ Zt as Heading,
1997
+ Ht as IconButton,
1998
+ Xt as Input,
1999
+ Kt as Label,
2000
+ er as Link,
2001
+ et as LoadingState,
2002
+ tr as Menubar,
2003
+ rr as Modal,
2004
+ nr as MultiSelect,
2005
+ ar as NavigationMenu,
2006
+ kt as NumberInput,
2007
+ sr as Pagination,
2008
+ Rt as PasswordInput,
2009
+ or as Popover,
2010
+ ir as Progress,
2011
+ lr as Radio,
2012
+ _t as RadioGroup,
2013
+ cr as ResizablePanel,
2014
+ tt as ResourceTable,
2015
+ ur as SearchBar,
2016
+ Pt as SearchInput,
2017
+ dr as Select,
2018
+ fr as Separator,
2019
+ mr as Sidebar,
2020
+ pr as Skeleton,
2021
+ Ot as Slider,
2022
+ hr as Spinner,
2023
+ St as Stack,
2024
+ br as StatCard,
2025
+ xr as Stepper,
2026
+ vr as Switch,
2027
+ qe as Table,
2028
+ gr as Tabs,
2029
+ jr as Text,
2030
+ yr as Textarea,
2031
+ dt as ThemeProvider,
2032
+ Sr as Toast,
2033
+ wr as Tooltip,
2034
+ Er as TreeView,
2035
+ $e as applyTheme,
2036
+ gt as createApiResource,
2037
+ We as createArrayResource,
2038
+ Xe as createCrudController,
2039
+ vt as createFetchApiClient,
2040
+ bt as createFieldAdapter,
2041
+ Le as createFieldController,
2042
+ Y as createFormStore,
2043
+ Je as createResourceController,
2044
+ xt as createResourceForm,
2045
+ Qe as createTableController,
2046
+ Re as createTheme,
2047
+ _e as darkTheme,
2048
+ R as defaultTheme,
2049
+ Ee as fontSize,
2050
+ Te as fontWeight,
2051
+ Ye as inferTableColumns,
2052
+ we as radius,
2053
+ Ce as shadows,
2054
+ Se as spacing,
2055
+ ut as themeToCss,
2056
+ se as themeToCssVariables,
2057
+ jt as useCrud,
2058
+ ce as useField,
2059
+ mt as useForm,
2060
+ De as useFormState,
2061
+ B as useFormStore,
2062
+ Ke as useResourceCrud,
2063
+ Ge as useTable,
2064
+ ft as useTheme,
2065
+ Ae as validateTheme,
2066
+ ke as zIndex
2067
+ };