@dbcdk/react-components 0.0.4 → 0.0.6

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 (299) hide show
  1. package/dist/assets/logo.js +2 -85
  2. package/dist/components/__stories__/_data/table.d.ts +15 -0
  3. package/dist/components/__stories__/_data/table.js +49 -0
  4. package/dist/components/__stories__/story-components/Colors.d.ts +11 -0
  5. package/dist/components/__stories__/story-components/Colors.js +96 -0
  6. package/dist/components/__stories__/story-components/Colors.module.css +27 -0
  7. package/dist/components/__stories__/story-components/Spacing.d.ts +2 -0
  8. package/dist/components/__stories__/story-components/Spacing.js +76 -0
  9. package/dist/components/__stories__/story-components/Spacing.module.css +154 -0
  10. package/dist/components/app-header/AppHeader.d.ts +4 -3
  11. package/dist/components/app-header/AppHeader.js +3 -6
  12. package/dist/components/app-header/AppHeader.module.css +10 -15
  13. package/dist/components/attribute-chip/AttributeChip.d.ts +9 -0
  14. package/dist/components/attribute-chip/AttributeChip.js +5 -0
  15. package/dist/components/attribute-chip/AttributeChip.module.css +65 -0
  16. package/dist/components/avatar/Avatar.d.ts +5 -3
  17. package/dist/components/avatar/Avatar.js +37 -37
  18. package/dist/components/avatar/Avatar.module.css +27 -0
  19. package/dist/components/breadcrumbs/Breadcrumbs.d.ts +4 -4
  20. package/dist/components/breadcrumbs/Breadcrumbs.js +4 -14
  21. package/dist/components/breadcrumbs/Breadcrumbs.module.css +19 -22
  22. package/dist/components/button/Button.d.ts +6 -2
  23. package/dist/components/button/Button.js +56 -50
  24. package/dist/components/button/Button.module.css +119 -56
  25. package/dist/components/card/Card.d.ts +23 -7
  26. package/dist/components/card/Card.js +20 -21
  27. package/dist/components/card/Card.module.css +148 -44
  28. package/dist/components/card-container/CardContainer.d.ts +6 -3
  29. package/dist/components/card-container/CardContainer.js +4 -15
  30. package/dist/components/card-container/CardContainer.module.css +40 -0
  31. package/dist/components/chip/Chip.d.ts +7 -5
  32. package/dist/components/chip/Chip.js +14 -37
  33. package/dist/components/chip/Chip.module.css +50 -27
  34. package/dist/components/circle/Circle.d.ts +3 -2
  35. package/dist/components/circle/Circle.js +3 -10
  36. package/dist/components/circle/Circle.module.css +11 -11
  37. package/dist/components/clear-button/ClearButton.d.ts +2 -1
  38. package/dist/components/clear-button/ClearButton.js +6 -17
  39. package/dist/components/clear-button/ClearButton.module.css +8 -7
  40. package/dist/components/code-block/CodeBlock.d.ts +7 -0
  41. package/dist/components/code-block/CodeBlock.js +6 -0
  42. package/dist/components/code-block/CodeBlock.module.css +60 -0
  43. package/dist/components/copy-button/CopyButton.d.ts +10 -0
  44. package/dist/components/copy-button/CopyButton.js +22 -0
  45. package/dist/components/copy-button/CopyButton.module.css +6 -0
  46. package/dist/components/datetime-picker/DateTimePicker.d.ts +42 -0
  47. package/dist/components/datetime-picker/DateTimePicker.js +403 -0
  48. package/dist/components/datetime-picker/DateTimePicker.module.css +144 -0
  49. package/dist/components/filter-field/FilterField.d.ts +6 -3
  50. package/dist/components/filter-field/FilterField.js +130 -158
  51. package/dist/components/filter-field/FilterField.module.css +35 -25
  52. package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.d.ts +36 -0
  53. package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +53 -0
  54. package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +60 -0
  55. package/dist/components/forms/checkbox/Checkbox.d.ts +31 -0
  56. package/dist/components/forms/checkbox/Checkbox.js +27 -0
  57. package/dist/components/{checkbox → forms/checkbox}/Checkbox.module.css +10 -11
  58. package/dist/components/forms/checkbox-group/CheckboxGroup.d.ts +47 -0
  59. package/dist/components/forms/checkbox-group/CheckboxGroup.js +75 -0
  60. package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +115 -0
  61. package/dist/components/forms/input/Input.d.ts +22 -0
  62. package/dist/components/forms/input/Input.js +70 -0
  63. package/dist/components/forms/input/Input.module.css +160 -0
  64. package/dist/components/forms/input-container/InputContainer.d.ts +15 -0
  65. package/dist/components/forms/input-container/InputContainer.js +15 -0
  66. package/dist/components/forms/input-container/InputContainer.module.css +34 -0
  67. package/dist/components/forms/multi-select/MultiSelect.d.ts +20 -0
  68. package/dist/components/forms/multi-select/MultiSelect.js +19 -0
  69. package/dist/components/forms/select/Select.d.ts +21 -0
  70. package/dist/components/forms/select/Select.js +94 -0
  71. package/dist/components/forms/text-area/Textarea.d.ts +17 -0
  72. package/dist/components/forms/text-area/Textarea.js +33 -0
  73. package/dist/components/forms/text-area/Textarea.module.css +26 -0
  74. package/dist/components/headline/Headline.d.ts +9 -1
  75. package/dist/components/headline/Headline.js +18 -37
  76. package/dist/components/headline/Headline.module.css +32 -7
  77. package/dist/components/hyperlink/Hyperlink.d.ts +9 -0
  78. package/dist/components/hyperlink/Hyperlink.js +11 -0
  79. package/dist/components/hyperlink/Hyperlink.module.css +23 -0
  80. package/dist/components/icon/Icon.d.ts +4 -3
  81. package/dist/components/icon/Icon.js +11 -17
  82. package/dist/components/icon/Icon.module.css +10 -9
  83. package/dist/components/menu/Menu.js +25 -67
  84. package/dist/components/menu/Menu.module.css +10 -32
  85. package/dist/components/meta-bar/MetaBar.d.ts +11 -0
  86. package/dist/components/meta-bar/MetaBar.js +9 -0
  87. package/dist/components/meta-bar/MetaBar.module.css +12 -0
  88. package/dist/components/nav-bar/NavBar.d.ts +5 -5
  89. package/dist/components/nav-bar/NavBar.js +15 -45
  90. package/dist/components/nav-bar/NavBar.module.css +11 -16
  91. package/dist/components/overlay/modal/Modal.d.ts +23 -0
  92. package/dist/components/overlay/modal/Modal.js +92 -0
  93. package/dist/components/overlay/modal/Modal.module.css +66 -0
  94. package/dist/components/overlay/modal/provider/ModalProvider.d.ts +20 -0
  95. package/dist/components/overlay/modal/provider/ModalProvider.js +70 -0
  96. package/dist/components/overlay/side-panel/SidePanel.d.ts +16 -0
  97. package/dist/components/overlay/side-panel/SidePanel.js +10 -0
  98. package/dist/components/overlay/side-panel/SidePanel.module.css +56 -0
  99. package/dist/components/overlay/side-panel/useSidePanel.d.ts +5 -0
  100. package/dist/components/overlay/side-panel/useSidePanel.js +11 -0
  101. package/dist/components/overlay/tooltip/Tooltip.d.ts +13 -0
  102. package/dist/components/overlay/tooltip/Tooltip.js +17 -0
  103. package/dist/components/overlay/tooltip/Tooltip.module.css +106 -0
  104. package/dist/components/overlay/tooltip/TooltipProvider.d.ts +20 -0
  105. package/dist/components/overlay/tooltip/TooltipProvider.js +244 -0
  106. package/dist/components/overlay/tooltip/useTooltipTrigger.d.ts +24 -0
  107. package/dist/components/overlay/tooltip/useTooltipTrigger.js +108 -0
  108. package/dist/components/page/Page.d.ts +7 -6
  109. package/dist/components/page/Page.js +4 -21
  110. package/dist/components/page/Page.module.css +2 -2
  111. package/dist/components/page-layout/PageLayout.d.ts +12 -20
  112. package/dist/components/page-layout/PageLayout.js +35 -88
  113. package/dist/components/page-layout/PageLayout.module.css +4 -80
  114. package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.d.ts +11 -0
  115. package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.js +7 -0
  116. package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.module.css +84 -0
  117. package/dist/components/pagination/Pagination.d.ts +4 -1
  118. package/dist/components/pagination/Pagination.js +38 -105
  119. package/dist/components/pagination/Pagination.module.css +11 -3
  120. package/dist/components/panel/Panel.d.ts +4 -3
  121. package/dist/components/panel/Panel.js +5 -10
  122. package/dist/components/panel/Panel.module.css +5 -7
  123. package/dist/components/popover/Popover.d.ts +3 -1
  124. package/dist/components/popover/Popover.js +116 -124
  125. package/dist/components/popover/Popover.module.css +4 -6
  126. package/dist/components/search-box/SearchBox.d.ts +11 -8
  127. package/dist/components/search-box/SearchBox.js +112 -149
  128. package/dist/components/search-box/SearchBox.module.css +0 -1
  129. package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +1 -1
  130. package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +47 -88
  131. package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +5 -1
  132. package/dist/components/sidebar/Sidebar.d.ts +3 -1
  133. package/dist/components/sidebar/Sidebar.js +5 -29
  134. package/dist/components/sidebar/components/SidebarItem.js +6 -12
  135. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +4 -2
  136. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +48 -62
  137. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +9 -38
  138. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +9 -0
  139. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +13 -0
  140. package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +155 -0
  141. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +3 -1
  142. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +4 -18
  143. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +25 -12
  144. package/dist/components/sidebar/components/sidebar-items/SidebarItems.d.ts +1 -1
  145. package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +9 -22
  146. package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +20 -18
  147. package/dist/components/sidebar/providers/SidebarProvider.d.ts +9 -4
  148. package/dist/components/sidebar/providers/SidebarProvider.js +188 -73
  149. package/dist/components/skeleton-loader/SkeletonLoader.js +68 -266
  150. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +11 -34
  151. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +0 -12
  152. package/dist/components/split-button/SplitButton.d.ts +7 -5
  153. package/dist/components/split-button/SplitButton.js +4 -27
  154. package/dist/components/split-pane/SplitPane.d.ts +34 -0
  155. package/dist/components/split-pane/SplitPane.js +78 -0
  156. package/dist/components/split-pane/SplitPane.module.css +106 -0
  157. package/dist/components/split-pane/provider/SplitPaneContext.d.ts +23 -0
  158. package/dist/components/split-pane/provider/SplitPaneContext.js +85 -0
  159. package/dist/components/table/Table.d.ts +28 -10
  160. package/dist/components/table/Table.js +117 -172
  161. package/dist/components/table/Table.module.css +78 -47
  162. package/dist/components/table/components/column-resizer/ColumnResizer.js +4 -15
  163. package/dist/components/table/components/empty-state/EmptyState.d.ts +41 -0
  164. package/dist/components/table/components/empty-state/EmptyState.js +27 -0
  165. package/dist/components/table/components/empty-state/EmptyState.module.css +16 -0
  166. package/dist/components/table/components/table-settings/TableSettings.d.ts +8 -0
  167. package/dist/components/table/components/table-settings/TableSettings.js +12 -0
  168. package/dist/components/table/tanstack.d.ts +14 -0
  169. package/dist/components/table/tanstack.js +162 -0
  170. package/dist/components/tabs/Tabs.d.ts +7 -3
  171. package/dist/components/tabs/Tabs.js +32 -65
  172. package/dist/components/tabs/Tabs.module.css +9 -9
  173. package/dist/components/toast/Toast.d.ts +14 -0
  174. package/dist/components/toast/Toast.js +8 -0
  175. package/dist/components/toast/Toast.module.css +102 -0
  176. package/dist/components/toast/provider/ToastProvider.d.ts +23 -0
  177. package/dist/components/toast/provider/ToastProvider.js +64 -0
  178. package/dist/components/user-display/UserDisplay.d.ts +2 -1
  179. package/dist/components/user-display/UserDisplay.js +4 -20
  180. package/dist/components/user-display/UserDisplay.module.css +2 -2
  181. package/dist/constants/severity.d.ts +1 -1
  182. package/dist/constants/severity.js +14 -16
  183. package/dist/constants/severity.types.d.ts +1 -1
  184. package/dist/constants/severity.types.js +1 -1
  185. package/dist/constants/sizes.d.ts +1 -1
  186. package/dist/constants/sizes.js +6 -7
  187. package/dist/hooks/usePagination.d.ts +33 -0
  188. package/dist/hooks/usePagination.js +79 -0
  189. package/dist/hooks/useSorting.d.ts +49 -0
  190. package/dist/hooks/useSorting.js +118 -0
  191. package/dist/hooks/useTableData.d.ts +40 -0
  192. package/dist/hooks/useTableData.js +45 -0
  193. package/dist/hooks/useTableSelection.d.ts +25 -0
  194. package/dist/hooks/useTableSelection.js +128 -0
  195. package/dist/hooks/useTableSettings.d.ts +7 -0
  196. package/dist/hooks/useTableSettings.js +24 -0
  197. package/dist/hooks/useTheme.d.ts +3 -7
  198. package/dist/hooks/useTheme.js +52 -47
  199. package/dist/hooks/useTimeDuration.d.ts +22 -0
  200. package/dist/hooks/useTimeDuration.js +36 -0
  201. package/dist/hooks/useViewportFill.d.ts +3 -2
  202. package/dist/hooks/useViewportFill.js +55 -48
  203. package/dist/index.d.ts +32 -6
  204. package/dist/index.js +33 -6
  205. package/dist/src/styles/styles.css +101 -8
  206. package/dist/styles/css-helper-classes/flex.css +101 -0
  207. package/dist/styles/css-helper-classes/typography.css +7 -0
  208. package/dist/styles/styles.css +101 -8
  209. package/dist/styles/themes/dbc/dark.css +207 -100
  210. package/dist/styles/themes/dbc/light.css +185 -90
  211. package/dist/styles/themes/forfatterweb/light.css +1 -1
  212. package/dist/styles/themes/types.js +1 -1
  213. package/dist/types/a11y-props.types.d.ts +5 -5
  214. package/dist/types/a11y-props.types.js +1 -1
  215. package/dist/types/sizes.types.d.ts +2 -2
  216. package/dist/types/sizes.types.js +1 -1
  217. package/dist/utils/arrays/nested-filtering.js +43 -33
  218. package/dist/utils/date/formatDate.js +25 -16
  219. package/package.json +33 -18
  220. package/dist/assets/logo.cjs +0 -87
  221. package/dist/components/app-header/AppHeader.cjs +0 -14
  222. package/dist/components/avatar/Avatar.cjs +0 -67
  223. package/dist/components/breadcrumbs/Breadcrumbs.cjs +0 -23
  224. package/dist/components/button/Button.cjs +0 -79
  225. package/dist/components/card/Card.cjs +0 -29
  226. package/dist/components/card-container/CardContainer.cjs +0 -23
  227. package/dist/components/checkbox/Checkbox.cjs +0 -43
  228. package/dist/components/checkbox/Checkbox.d.ts +0 -12
  229. package/dist/components/checkbox/Checkbox.js +0 -37
  230. package/dist/components/chip/Chip.cjs +0 -49
  231. package/dist/components/circle/Circle.cjs +0 -18
  232. package/dist/components/clear-button/ClearButton.cjs +0 -26
  233. package/dist/components/data-summary/DataSummary.cjs +0 -49
  234. package/dist/components/data-summary/DataSummary.d.ts +0 -19
  235. package/dist/components/data-summary/DataSummary.js +0 -43
  236. package/dist/components/data-summary/DataSummary.module.css +0 -51
  237. package/dist/components/filter-field/FilterField.cjs +0 -174
  238. package/dist/components/headline/Headline.cjs +0 -47
  239. package/dist/components/icon/Icon.cjs +0 -27
  240. package/dist/components/input/Input.cjs +0 -48
  241. package/dist/components/input/Input.d.ts +0 -13
  242. package/dist/components/input/Input.js +0 -42
  243. package/dist/components/input/Input.module.css +0 -112
  244. package/dist/components/menu/Menu.cjs +0 -96
  245. package/dist/components/multi-select/MultiSelect.cjs +0 -48
  246. package/dist/components/multi-select/MultiSelect.d.ts +0 -18
  247. package/dist/components/multi-select/MultiSelect.js +0 -46
  248. package/dist/components/nav-bar/NavBar.cjs +0 -55
  249. package/dist/components/page/Page.cjs +0 -30
  250. package/dist/components/page-layout/PageLayout.cjs +0 -101
  251. package/dist/components/pagination/Pagination.cjs +0 -117
  252. package/dist/components/panel/Panel.cjs +0 -18
  253. package/dist/components/popover/Popover.cjs +0 -132
  254. package/dist/components/search-box/SearchBox.cjs +0 -162
  255. package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +0 -97
  256. package/dist/components/select/Select.cjs +0 -52
  257. package/dist/components/select/Select.d.ts +0 -11
  258. package/dist/components/select/Select.js +0 -50
  259. package/dist/components/sidebar/Sidebar.cjs +0 -38
  260. package/dist/components/sidebar/Sidebar.module.css +0 -66
  261. package/dist/components/sidebar/components/SidebarItem.cjs +0 -16
  262. package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +0 -74
  263. package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +0 -27
  264. package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +0 -28
  265. package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +0 -25
  266. package/dist/components/sidebar/providers/SidebarProvider.cjs +0 -81
  267. package/dist/components/skeleton-loader/SkeletonLoader.cjs +0 -270
  268. package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +0 -42
  269. package/dist/components/split-button/SplitButton.cjs +0 -37
  270. package/dist/components/table/Table.cjs +0 -181
  271. package/dist/components/table/components/column-resizer/ColumnResizer.cjs +0 -22
  272. package/dist/components/tabs/Tabs.cjs +0 -74
  273. package/dist/components/text-area/Textarea.cjs +0 -62
  274. package/dist/components/text-area/Textarea.d.ts +0 -14
  275. package/dist/components/text-area/Textarea.js +0 -56
  276. package/dist/components/text-area/Textarea.module.css +0 -3
  277. package/dist/components/tooltip/Tooltip.cjs +0 -78
  278. package/dist/components/tooltip/Tooltip.d.ts +0 -11
  279. package/dist/components/tooltip/Tooltip.js +0 -72
  280. package/dist/components/tooltip/Tooltip.module.css +0 -84
  281. package/dist/components/user-display/UserDisplay.cjs +0 -28
  282. package/dist/constants/severity.cjs +0 -21
  283. package/dist/constants/severity.types.cjs +0 -2
  284. package/dist/constants/sizes.cjs +0 -10
  285. package/dist/hooks/useTheme.cjs +0 -58
  286. package/dist/hooks/useViewportFill.cjs +0 -52
  287. package/dist/index.cjs +0 -264
  288. package/dist/styles/themes/types.cjs +0 -2
  289. package/dist/tanstack.cjs +0 -231
  290. package/dist/tanstack.d.ts +0 -25
  291. package/dist/tanstack.js +0 -206
  292. package/dist/types/a11y-props.types.cjs +0 -2
  293. package/dist/types/assets.d.cjs +0 -2
  294. package/dist/types/assets.d.js +0 -1
  295. package/dist/types/css.d.cjs +0 -2
  296. package/dist/types/css.d.js +0 -1
  297. package/dist/types/sizes.types.cjs +0 -2
  298. package/dist/utils/arrays/nested-filtering.cjs +0 -40
  299. package/dist/utils/date/formatDate.cjs +0 -19
@@ -1,268 +1,70 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { SkeletonLoaderItem } from './skeleton-loader-item/SkeletonLoaderItem';
3
-
4
- function SkeletonLoader({
5
- type,
6
- rows = 3,
7
- columns = 3,
8
- variant = "default",
9
- speedSec = 3
10
- }) {
11
- const line = (width, height = 14, radius = 6) => /* @__PURE__ */ jsx(
12
- SkeletonLoaderItem,
13
- {
14
- width,
15
- height,
16
- radius,
17
- variant,
18
- speedSec
19
- },
20
- `${String(width)}-${height}-${String(radius)}-${Math.random()}`
21
- );
22
- const pills = (count) => Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx(
23
- SkeletonLoaderItem,
24
- {
25
- width: 80 + i % 3 * 30,
26
- height: 30,
27
- radius: 6,
28
- variant,
29
- speedSec,
30
- ariaLabel: "Loading filter"
31
- },
32
- `pill-${i}`
33
- ));
34
- const textBlock = (count) => Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx(
35
- SkeletonLoaderItem,
36
- {
37
- width: i === count - 1 ? "60%" : `${90 - i % 3 * 10}%`,
38
- height: 12,
39
- radius: 4,
40
- variant,
41
- speedSec,
42
- ariaLabel: "Loading text line"
43
- },
44
- `text-${i}`
45
- ));
46
- const tableHeaderRow = () => /* @__PURE__ */ jsx(
47
- "div",
48
- {
49
- style: {
50
- display: "grid",
51
- gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
52
- gap: 12,
53
- alignItems: "center",
54
- width: "100%"
55
- },
56
- children: Array.from({ length: columns }).map((_, i) => /* @__PURE__ */ jsx(
57
- SkeletonLoaderItem,
58
- {
59
- height: 20,
60
- width: "90%",
61
- radius: 6,
62
- variant,
63
- speedSec,
64
- ariaLabel: "Loading table header"
65
- },
66
- `thead-${i}`
67
- ))
68
- }
69
- );
70
- const tableBodyRow = (rowIndex) => /* @__PURE__ */ jsx(
71
- "div",
72
- {
73
- style: {
74
- display: "grid",
75
- gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
76
- gap: 12,
77
- alignItems: "center",
78
- width: "100%"
79
- },
80
- children: Array.from({ length: columns }).map((_, colIndex) => /* @__PURE__ */ jsx(
81
- SkeletonLoaderItem,
82
- {
83
- height: 20,
84
- width: colIndex % 3 === 0 ? "93%" : colIndex % 3 === 1 ? "98%" : "90%",
85
- radius: 4,
86
- variant,
87
- speedSec,
88
- ariaLabel: "Loading table cell"
89
- },
90
- `tcell-${rowIndex}-${colIndex}`
91
- ))
92
- },
93
- `trow-${rowIndex}`
94
- );
95
- const getSkeletonItems = () => {
96
- switch (type) {
97
- case "button": {
98
- return /* @__PURE__ */ jsxs(
99
- "div",
100
- {
101
- style: {
102
- display: "flex",
103
- gap: 12,
104
- alignItems: "center",
105
- justifyContent: "flex-start",
106
- width: "100%",
107
- flexWrap: "wrap"
108
- },
109
- children: [
110
- /* @__PURE__ */ jsx(
111
- SkeletonLoaderItem,
112
- {
113
- width: 120,
114
- height: 40,
115
- radius: 8,
116
- variant,
117
- speedSec,
118
- ariaLabel: "Loading button"
119
- }
120
- ),
121
- /* @__PURE__ */ jsx(
122
- SkeletonLoaderItem,
123
- {
124
- width: 96,
125
- height: 40,
126
- radius: 8,
127
- variant,
128
- speedSec,
129
- ariaLabel: "Loading button"
130
- }
131
- )
132
- ]
133
- }
134
- );
135
- }
136
- case "card": {
137
- return /* @__PURE__ */ jsxs(
138
- "div",
139
- {
140
- style: {
141
- display: "flex",
142
- flexDirection: "column",
143
- gap: 12,
144
- width: "100%"
145
- },
146
- children: [
147
- /* @__PURE__ */ jsx(
148
- SkeletonLoaderItem,
149
- {
150
- width: "100%",
151
- height: 160,
152
- radius: 12,
153
- variant,
154
- speedSec,
155
- ariaLabel: "Loading card media"
156
- }
157
- ),
158
- line("60%", 16, 6),
159
- textBlock(3),
160
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 12, justifyContent: "flex-start" }, children: [
161
- /* @__PURE__ */ jsx(
162
- SkeletonLoaderItem,
163
- {
164
- width: 100,
165
- height: 30,
166
- variant,
167
- speedSec,
168
- ariaLabel: "Loading action"
169
- }
170
- ),
171
- /* @__PURE__ */ jsx(
172
- SkeletonLoaderItem,
173
- {
174
- width: 72,
175
- height: 30,
176
- variant,
177
- speedSec,
178
- ariaLabel: "Loading action"
179
- }
180
- )
181
- ] })
182
- ]
183
- }
184
- );
185
- }
186
- case "avatar": {
187
- return /* @__PURE__ */ jsxs(
188
- "div",
189
- {
190
- style: {
191
- display: "flex",
192
- gap: 12,
193
- alignItems: "center",
194
- width: "100%"
195
- },
196
- children: [
197
- /* @__PURE__ */ jsx(
198
- SkeletonLoaderItem,
199
- {
200
- width: 48,
201
- height: 48,
202
- radius: "50%",
203
- variant,
204
- speedSec,
205
- ariaLabel: "Loading avatar"
206
- }
207
- ),
208
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 8, flex: 1 }, children: [
209
- line("40%", 14),
210
- line("25%", 12)
211
- ] })
212
- ]
213
- }
214
- );
215
- }
216
- case "text": {
217
- return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 10, width: "100%" }, children: textBlock(rows) });
218
- }
219
- case "table": {
220
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 12, width: "100%" }, children: [
221
- tableHeaderRow(),
222
- Array.from({ length: rows }).map((_, r) => tableBodyRow(r))
223
- ] });
224
- }
225
- case "filterbar": {
226
- return /* @__PURE__ */ jsxs(
227
- "div",
228
- {
229
- style: {
230
- display: "flex",
231
- alignItems: "center",
232
- justifyContent: "space-between",
233
- gap: 12,
234
- flexWrap: "wrap",
235
- width: "100%"
236
- },
237
- children: [
238
- /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 12, flexWrap: "wrap" }, children: pills(columns) }),
239
- /* @__PURE__ */ jsx(
240
- SkeletonLoaderItem,
241
- {
242
- width: 240,
243
- height: 30,
244
- variant,
245
- speedSec,
246
- ariaLabel: "Loading"
247
- }
248
- )
249
- ]
250
- }
251
- );
252
- }
253
- default:
254
- return null;
255
- }
256
- };
257
- return /* @__PURE__ */ jsx(
258
- "div",
259
- {
260
- role: "status",
261
- "aria-label": "Loading content",
262
- style: { display: "flex", flexDirection: "column", gap: 16, width: "100%" },
263
- children: getSkeletonItems()
264
- }
265
- );
3
+ export function SkeletonLoader({ type, rows = 3, columns = 3, variant = 'default', speedSec = 3, }) {
4
+ const line = (width, height = 14, radius = 6) => (_jsx(SkeletonLoaderItem, { width: width, height: height, radius: radius, variant: variant, speedSec: speedSec }, `${String(width)}-${height}-${String(radius)}-${Math.random()}`));
5
+ const pills = (count) => Array.from({ length: count }).map((_, i) => (_jsx(SkeletonLoaderItem, { width: 80 + (i % 3) * 30, height: 30, radius: 6, variant: variant, speedSec: speedSec, ariaLabel: "Loading filter" }, `pill-${i}`)));
6
+ const textBlock = (count) => Array.from({ length: count }).map((_, i) => (_jsx(SkeletonLoaderItem, { width: i === count - 1 ? '60%' : `${90 - (i % 3) * 10}%`, height: 12, radius: 4, variant: variant, speedSec: speedSec, ariaLabel: "Loading text line" }, `text-${i}`)));
7
+ const tableHeaderRow = () => (_jsx("div", { style: {
8
+ display: 'grid',
9
+ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
10
+ gap: 12,
11
+ alignItems: 'center',
12
+ width: '100%',
13
+ }, children: Array.from({ length: columns }).map((_, i) => (_jsx(SkeletonLoaderItem, { height: 20, width: "90%", radius: 6, variant: variant, speedSec: speedSec, ariaLabel: "Loading table header" }, `thead-${i}`))) }));
14
+ const tableBodyRow = (rowIndex) => (_jsx("div", { style: {
15
+ display: 'grid',
16
+ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
17
+ gap: 12,
18
+ alignItems: 'center',
19
+ width: '100%',
20
+ }, children: Array.from({ length: columns }).map((_, colIndex) => (_jsx(SkeletonLoaderItem, { height: 20, width: colIndex % 3 === 0 ? '93%' : colIndex % 3 === 1 ? '98%' : '90%', radius: 4, variant: variant, speedSec: speedSec, ariaLabel: "Loading table cell" }, `tcell-${rowIndex}-${colIndex}`))) }, `trow-${rowIndex}`));
21
+ const getSkeletonItems = () => {
22
+ switch (type) {
23
+ case 'button': {
24
+ return (_jsxs("div", { style: {
25
+ display: 'flex',
26
+ gap: 12,
27
+ alignItems: 'center',
28
+ justifyContent: 'flex-start',
29
+ width: '100%',
30
+ flexWrap: 'wrap',
31
+ }, children: [_jsx(SkeletonLoaderItem, { width: 120, height: 40, radius: 8, variant: variant, speedSec: speedSec, ariaLabel: "Loading button" }), _jsx(SkeletonLoaderItem, { width: 96, height: 40, radius: 8, variant: variant, speedSec: speedSec, ariaLabel: "Loading button" })] }));
32
+ }
33
+ case 'card': {
34
+ return (_jsxs("div", { style: {
35
+ display: 'flex',
36
+ flexDirection: 'column',
37
+ gap: 12,
38
+ width: '100%',
39
+ }, children: [_jsx(SkeletonLoaderItem, { width: "100%", height: 160, radius: 12, variant: variant, speedSec: speedSec, ariaLabel: "Loading card media" }), line('60%', 16, 6), textBlock(3), _jsxs("div", { style: { display: 'flex', gap: 12, justifyContent: 'flex-start' }, children: [_jsx(SkeletonLoaderItem, { width: 100, height: 30, variant: variant, speedSec: speedSec, ariaLabel: "Loading action" }), _jsx(SkeletonLoaderItem, { width: 72, height: 30, variant: variant, speedSec: speedSec, ariaLabel: "Loading action" })] })] }));
40
+ }
41
+ case 'avatar': {
42
+ return (_jsxs("div", { style: {
43
+ display: 'flex',
44
+ gap: 12,
45
+ alignItems: 'center',
46
+ width: '100%',
47
+ }, children: [_jsx(SkeletonLoaderItem, { width: 48, height: 48, radius: "50%", variant: variant, speedSec: speedSec, ariaLabel: "Loading avatar" }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 8, flex: 1 }, children: [line('40%', 14), line('25%', 12)] })] }));
48
+ }
49
+ case 'text': {
50
+ return (_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: 10, width: '100%' }, children: textBlock(rows) }));
51
+ }
52
+ case 'table': {
53
+ return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 12, width: '100%' }, children: [tableHeaderRow(), Array.from({ length: rows }).map((_, r) => tableBodyRow(r))] }));
54
+ }
55
+ case 'filterbar': {
56
+ return (_jsxs("div", { style: {
57
+ display: 'flex',
58
+ alignItems: 'center',
59
+ justifyContent: 'space-between',
60
+ gap: 12,
61
+ flexWrap: 'wrap',
62
+ width: '100%',
63
+ }, children: [_jsx("div", { style: { display: 'flex', gap: 12, flexWrap: 'wrap' }, children: pills(columns) }), _jsx(SkeletonLoaderItem, { width: 240, height: 30, variant: variant, speedSec: speedSec, ariaLabel: "Loading" })] }));
64
+ }
65
+ default:
66
+ return null;
67
+ }
68
+ };
69
+ return (_jsx("div", { role: "status", "aria-label": "Loading content", style: { display: 'flex', flexDirection: 'column', gap: 16, width: '100%' }, children: getSkeletonItems() }));
266
70
  }
267
-
268
- export { SkeletonLoader };
@@ -1,36 +1,13 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import styles from './SkeletonLoaderItem.module.css';
3
-
4
- function SkeletonLoaderItem({
5
- height = 14,
6
- width = "100%",
7
- radius = 6,
8
- speedSec = 3,
9
- ariaLabel = "Loading",
10
- variant = "default"
11
- }) {
12
- const h = typeof height === "number" ? `${height}px` : height;
13
- const w = typeof width === "number" ? `${width}px` : width;
14
- const r = typeof radius === "number" ? `${radius}px` : radius;
15
- return /* @__PURE__ */ jsxs(
16
- "div",
17
- {
18
- className: `${styles.skeletonLoader} ${styles[variant]}`,
19
- role: "status",
20
- "aria-label": ariaLabel,
21
- "aria-live": "polite",
22
- style: {
23
- ["--h"]: h,
24
- ["--r"]: r,
25
- ["--speed"]: `${speedSec}s`,
26
- ["--width"]: w
27
- },
28
- children: [
29
- /* @__PURE__ */ jsx("span", { className: styles.bar, "aria-hidden": "true" }),
30
- /* @__PURE__ */ jsx("span", { className: styles.srOnly, children: "Loading\u2026" })
31
- ]
32
- }
33
- );
3
+ export function SkeletonLoaderItem({ height = 14, width = '100%', radius = 6, speedSec = 3, ariaLabel = 'Loading', variant = 'default', }) {
4
+ const h = typeof height === 'number' ? `${height}px` : height;
5
+ const w = typeof width === 'number' ? `${width}px` : width;
6
+ const r = typeof radius === 'number' ? `${radius}px` : radius;
7
+ return (_jsxs("div", { className: `${styles.skeletonLoader} ${styles[variant]}`, role: "status", "aria-label": ariaLabel, "aria-live": "polite", style: {
8
+ ['--h']: h,
9
+ ['--r']: r,
10
+ ['--speed']: `${speedSec}s`,
11
+ ['--width']: w,
12
+ }, children: [_jsx("span", { className: styles.bar, "aria-hidden": "true" }), _jsx("span", { className: "srOnly", children: "Loading\u2026" })] }));
34
13
  }
35
-
36
- export { SkeletonLoaderItem };
@@ -35,18 +35,6 @@
35
35
  border-radius: inherit;
36
36
  }
37
37
 
38
- .srOnly {
39
- position: absolute;
40
- inline-size: 1px;
41
- block-size: 1px;
42
- padding: 0;
43
- margin: -1px;
44
- overflow: hidden;
45
- clip: rect(0 0 0 0);
46
- white-space: nowrap;
47
- border: 0;
48
- }
49
-
50
38
  @keyframes shimmer {
51
39
  0% {
52
40
  background-position: 200% 0;
@@ -1,14 +1,16 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import { Button } from '../button/Button';
1
3
  interface SplitButtonItem {
2
4
  label?: string;
3
5
  onClick: () => void;
4
- icon?: React.ReactNode;
6
+ icon?: ReactNode;
5
7
  active?: boolean;
6
8
  }
7
- interface SplitButtonProps {
9
+ interface SplitButtonProps extends ComponentProps<typeof Button> {
8
10
  onClick?: () => void;
9
- icon?: React.ReactNode;
11
+ icon?: ReactNode;
10
12
  options: SplitButtonItem[];
11
- children?: React.ReactNode;
13
+ children?: ReactNode;
12
14
  }
13
- export declare function SplitButton({ children, options, onClick, icon, }: SplitButtonProps): React.ReactNode;
15
+ export declare function SplitButton({ children, options, onClick, icon, ...rest }: SplitButtonProps): ReactNode;
14
16
  export {};
@@ -1,31 +1,8 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import styles from './SplitButton.module.css';
2
3
  import { Button } from '../button/Button';
3
4
  import { Menu } from '../menu/Menu';
4
5
  import { Popover } from '../popover/Popover';
5
- import styles from './SplitButton.module.css';
6
-
7
- function SplitButton({
8
- children,
9
- options,
10
- onClick,
11
- icon
12
- }) {
13
- return /* @__PURE__ */ jsxs("div", { className: styles.container, style: { display: "inline-flex", alignItems: "center" }, children: [
14
- /* @__PURE__ */ jsxs(Button, { onClick, children: [
15
- icon,
16
- children
17
- ] }),
18
- /* @__PURE__ */ jsx(
19
- Popover,
20
- {
21
- trigger: (onClick2, icon2) => /* @__PURE__ */ jsx("span", { className: styles.triggerContainer, children: /* @__PURE__ */ jsx(Button, { onClick: onClick2, children: icon2 }) }),
22
- children: /* @__PURE__ */ jsx(Menu, { children: options.map((option) => /* @__PURE__ */ jsx(Menu.Item, { active: option.active, children: /* @__PURE__ */ jsxs("button", { onClick: option.onClick, children: [
23
- option.icon,
24
- option.label
25
- ] }) }, option.label)) })
26
- }
27
- )
28
- ] });
6
+ export function SplitButton({ children, options, onClick, icon, ...rest }) {
7
+ return (_jsxs("div", { className: styles.container, style: { display: 'inline-flex', alignItems: 'center' }, children: [_jsxs(Button, { ...rest, onClick: onClick, children: [icon, children] }), _jsx(Popover, { trigger: (handleClick, icon) => (_jsx("span", { className: styles.triggerContainer, children: _jsx(Button, { ...rest, onClick: handleClick, children: icon }) })), children: _jsx(Menu, { children: options.map(option => (_jsx(Menu.Item, { active: option.active, children: _jsxs("button", { onClick: option.onClick, children: [option.icon, option.label] }) }, option.label))) }) })] }));
29
8
  }
30
-
31
- export { SplitButton };
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { SplitDirection } from './provider/SplitPaneContext';
3
+ interface SplitPaneProps {
4
+ children: React.ReactNode;
5
+ initialPrimarySize?: number;
6
+ minPrimarySize?: number;
7
+ minSecondarySize?: number;
8
+ direction?: SplitDirection;
9
+ showDivider?: 'hover' | 'always' | 'never';
10
+ /**
11
+ * Gutter size (px). This is the space between panes and contains the resizer hit area.
12
+ * Example: 8 => 4px breathing room on each side if the divider line is centered.
13
+ */
14
+ gutterSize?: number;
15
+ /**
16
+ * If provided, primary size is persisted per key in localStorage.
17
+ * Only SplitPanes sharing the same key will share size.
18
+ */
19
+ storageKey?: string;
20
+ }
21
+ export declare function SplitPane({ children, initialPrimarySize, minPrimarySize, minSecondarySize, direction, showDivider, gutterSize, storageKey, }: SplitPaneProps): React.ReactNode;
22
+ /**
23
+ * IMPORTANT:
24
+ * This component now renders ONLY the primary content (scrollable).
25
+ * The resizer lives in a dedicated <SplitPaneGutter /> so it never overlaps scrollbars.
26
+ */
27
+ export declare function SplitPanePrimary({ children }: {
28
+ children: React.ReactNode;
29
+ }): React.ReactNode;
30
+ export declare function SplitPaneGutter(): React.ReactNode;
31
+ export declare function SplitPaneSecondary({ children }: {
32
+ children: React.ReactNode;
33
+ }): React.ReactNode;
34
+ export {};
@@ -0,0 +1,78 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useEffect, useRef } from 'react';
4
+ import { SplitPaneProvider, useSplitPaneContext } from './provider/SplitPaneContext';
5
+ import styles from './SplitPane.module.css';
6
+ function clamp(n, min, max) {
7
+ return Math.max(min, Math.min(max, n));
8
+ }
9
+ export function SplitPane({ children, initialPrimarySize = 300, minPrimarySize = 160, minSecondarySize = 160, direction = 'horizontal', showDivider = 'hover', gutterSize = 8, storageKey, }) {
10
+ return (_jsx(SplitPaneProvider, { direction: direction, initialPrimarySize: initialPrimarySize, minPrimarySize: minPrimarySize, minSecondarySize: minSecondarySize, storageKey: storageKey, children: _jsx(SplitPaneContainer, { showDivider: showDivider, gutterSize: gutterSize, children: children }) }));
11
+ }
12
+ function SplitPaneContainer({ children, showDivider, gutterSize, }) {
13
+ const { direction, primarySize, containerRef } = useSplitPaneContext();
14
+ return (_jsx("div", { ref: containerRef, className: styles.container, "data-direction": direction, "data-divider": showDivider, style: {
15
+ '--split-pane-primary-size': `${primarySize}px`,
16
+ '--split-pane-gutter': `${gutterSize}px`,
17
+ }, children: children }));
18
+ }
19
+ /**
20
+ * IMPORTANT:
21
+ * This component now renders ONLY the primary content (scrollable).
22
+ * The resizer lives in a dedicated <SplitPaneGutter /> so it never overlaps scrollbars.
23
+ */
24
+ export function SplitPanePrimary({ children }) {
25
+ return _jsx("div", { className: styles.primary, children: children });
26
+ }
27
+ export function SplitPaneGutter() {
28
+ const { direction, primarySize, setPrimarySize, minPrimarySize, minSecondarySize, containerRef } = useSplitPaneContext();
29
+ const isDraggingRef = useRef(false);
30
+ const startPosRef = useRef(0);
31
+ const startSizeRef = useRef(primarySize);
32
+ useEffect(() => {
33
+ if (!window) {
34
+ return;
35
+ }
36
+ const onMove = (e) => {
37
+ if (!isDraggingRef.current)
38
+ return;
39
+ const el = containerRef.current;
40
+ if (!el)
41
+ return;
42
+ const rect = el.getBoundingClientRect();
43
+ const total = direction === 'horizontal' ? rect.width : rect.height;
44
+ const clientPos = direction === 'horizontal' ? e.clientX : e.clientY;
45
+ const delta = clientPos - startPosRef.current;
46
+ // Note: total includes gutter. That's fine because max clamps against secondary min.
47
+ const next = startSizeRef.current + delta;
48
+ const maxPrimary = Math.max(minPrimarySize, total - minSecondarySize);
49
+ setPrimarySize(clamp(next, minPrimarySize, maxPrimary));
50
+ };
51
+ const onUp = () => {
52
+ if (!isDraggingRef.current)
53
+ return;
54
+ isDraggingRef.current = false;
55
+ document.body.style.cursor = '';
56
+ document.body.style.userSelect = '';
57
+ };
58
+ window.addEventListener('mousemove', onMove);
59
+ window.addEventListener('mouseup', onUp);
60
+ return () => {
61
+ if (window) {
62
+ window.removeEventListener('mousemove', onMove);
63
+ window.removeEventListener('mouseup', onUp);
64
+ }
65
+ };
66
+ }, [containerRef, direction, minPrimarySize, minSecondarySize, setPrimarySize]);
67
+ const handleMouseDown = (event) => {
68
+ isDraggingRef.current = true;
69
+ startPosRef.current = direction === 'horizontal' ? event.clientX : event.clientY;
70
+ startSizeRef.current = primarySize;
71
+ document.body.style.cursor = direction === 'horizontal' ? 'col-resize' : 'row-resize';
72
+ document.body.style.userSelect = 'none';
73
+ };
74
+ return (_jsx("div", { className: styles.gutter, "aria-hidden": "true", children: _jsx("span", { className: styles.resizer, onMouseDown: handleMouseDown, role: "separator", "aria-orientation": direction === 'horizontal' ? 'vertical' : 'horizontal', "aria-valuenow": Math.round(primarySize), tabIndex: 0 }) }));
75
+ }
76
+ export function SplitPaneSecondary({ children }) {
77
+ return _jsx("div", { className: styles.secondary, children: children });
78
+ }