@calcifer-design/ui 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/components/Alert/Alert.d.ts +5 -2
  2. package/dist/components/Alert/Alert.js +1 -0
  3. package/dist/components/Alert/Alert.module.js +5 -5
  4. package/dist/components/Alert/Alert_module.css +20 -17
  5. package/dist/components/Avatar/Avatar.d.ts +16 -2
  6. package/dist/components/Avatar/Avatar.js +23 -7
  7. package/dist/components/Avatar/Avatar.module.js +3 -3
  8. package/dist/components/Avatar/Avatar_module.css +58 -17
  9. package/dist/components/Avatar/avatarColor.d.ts +12 -0
  10. package/dist/components/Avatar/avatarColor.js +12 -0
  11. package/dist/components/AvatarGroup/AvatarGroup.d.ts +37 -0
  12. package/dist/components/AvatarGroup/AvatarGroup.js +52 -0
  13. package/dist/components/AvatarGroup/AvatarGroup.module.js +8 -0
  14. package/dist/components/AvatarGroup/AvatarGroup_module.css +67 -0
  15. package/dist/components/Breadcrumb/Breadcrumb.module.js +6 -6
  16. package/dist/components/Breadcrumb/Breadcrumb_module.css +7 -7
  17. package/dist/components/Button/Button.d.ts +40 -4
  18. package/dist/components/Button/Button.js +48 -11
  19. package/dist/components/Button/Button.module.js +6 -2
  20. package/dist/components/Button/Button_module.css +143 -17
  21. package/dist/components/Button/LinkButton.d.ts +10 -3
  22. package/dist/components/Button/LinkButton.js +16 -5
  23. package/dist/components/Card/Card.module.js +5 -5
  24. package/dist/components/Card/Card_module.css +15 -9
  25. package/dist/components/CardList/CardList.module.js +3 -3
  26. package/dist/components/CardList/CardList_module.css +5 -3
  27. package/dist/components/Checkbox/Checkbox.module.js +2 -2
  28. package/dist/components/Checkbox/Checkbox_module.css +3 -3
  29. package/dist/components/ChoiceCard/ChoiceCard.d.ts +34 -0
  30. package/dist/components/ChoiceCard/ChoiceCard.js +81 -0
  31. package/dist/components/ChoiceCard/ChoiceCard.module.js +12 -0
  32. package/dist/components/ChoiceCard/ChoiceCard_module.css +161 -0
  33. package/dist/components/Collapsible/Collapsible.d.ts +39 -0
  34. package/dist/components/Collapsible/Collapsible.js +63 -0
  35. package/dist/components/Collapsible/Collapsible.module.js +10 -0
  36. package/dist/components/Collapsible/Collapsible_module.css +80 -0
  37. package/dist/components/DataGrid/DataGrid.d.ts +3 -0
  38. package/dist/components/DataGrid/DataGrid.js +436 -0
  39. package/dist/components/DataGrid/DataGrid.module.js +36 -0
  40. package/dist/components/DataGrid/DataGrid_module.css +372 -0
  41. package/dist/components/DataGrid/GridCardHeader.d.ts +16 -0
  42. package/dist/components/DataGrid/GridCardHeader.js +40 -0
  43. package/dist/components/DataGrid/GridCheckbox.d.ts +15 -0
  44. package/dist/components/DataGrid/GridCheckbox.js +25 -0
  45. package/dist/components/DataGrid/GridHeaderCell.d.ts +14 -0
  46. package/dist/components/DataGrid/GridHeaderCell.js +29 -0
  47. package/dist/components/DataGrid/GridHeaderRow.d.ts +35 -0
  48. package/dist/components/DataGrid/GridHeaderRow.js +56 -0
  49. package/dist/components/DataGrid/GridRow.d.ts +69 -0
  50. package/dist/components/DataGrid/GridRow.js +139 -0
  51. package/dist/components/DataGrid/GridStateRows.d.ts +24 -0
  52. package/dist/components/DataGrid/GridStateRows.js +59 -0
  53. package/dist/components/DataGrid/columns.d.ts +40 -0
  54. package/dist/components/DataGrid/columns.js +37 -0
  55. package/dist/components/DataGrid/labels.d.ts +20 -0
  56. package/dist/components/DataGrid/labels.js +25 -0
  57. package/dist/components/DataGrid/types.d.ts +88 -0
  58. package/dist/components/DataGrid/types.js +0 -0
  59. package/dist/components/DataGrid/useGridEntries.d.ts +17 -0
  60. package/dist/components/DataGrid/useGridEntries.js +40 -0
  61. package/dist/components/DataGrid/useGridHighlight.d.ts +16 -0
  62. package/dist/components/DataGrid/useGridHighlight.js +24 -0
  63. package/dist/components/DataGrid/useGridKeyboard.d.ts +50 -0
  64. package/dist/components/DataGrid/useGridKeyboard.js +242 -0
  65. package/dist/components/DataGrid/useGridMetrics.d.ts +13 -0
  66. package/dist/components/DataGrid/useGridMetrics.js +35 -0
  67. package/dist/components/DataGrid/useLatest.d.ts +7 -0
  68. package/dist/components/DataGrid/useLatest.js +9 -0
  69. package/dist/components/DataGrid/useLoadMore.d.ts +30 -0
  70. package/dist/components/DataGrid/useLoadMore.js +39 -0
  71. package/dist/components/DataGrid/useRowExpansion.d.ts +14 -0
  72. package/dist/components/DataGrid/useRowExpansion.js +21 -0
  73. package/dist/components/DataGrid/useRowSelection.d.ts +43 -0
  74. package/dist/components/DataGrid/useRowSelection.js +107 -0
  75. package/dist/components/DataTable/DataTable.module.js +9 -9
  76. package/dist/components/DataTable/DataTable_module.css +24 -21
  77. package/dist/components/DatePicker/DatePicker.d.ts +15 -1
  78. package/dist/components/DatePicker/DatePicker.js +30 -5
  79. package/dist/components/DatePicker/DatePicker.module.js +10 -10
  80. package/dist/components/DatePicker/DatePicker_module.css +22 -21
  81. package/dist/components/Descriptions/Descriptions.module.js +4 -4
  82. package/dist/components/Descriptions/Descriptions_module.css +12 -8
  83. package/dist/components/Dialog/Dialog.d.ts +30 -2
  84. package/dist/components/Dialog/Dialog.js +52 -11
  85. package/dist/components/Dialog/Dialog.module.js +8 -6
  86. package/dist/components/Dialog/Dialog_module.css +60 -13
  87. package/dist/components/EmptyState/EmptyState.d.ts +41 -0
  88. package/dist/components/EmptyState/EmptyState.js +39 -0
  89. package/dist/components/EmptyState/EmptyState.module.js +9 -0
  90. package/dist/components/EmptyState/EmptyState_module.css +65 -0
  91. package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +5 -2
  92. package/dist/components/ErrorBoundary/ErrorBoundary.module.js +1 -1
  93. package/dist/components/ErrorBoundary/ErrorBoundary_module.css +1 -1
  94. package/dist/components/Field/AffixInput.d.ts +28 -0
  95. package/dist/components/Field/AffixInput.js +50 -0
  96. package/dist/components/Field/GroupFrame.d.ts +19 -0
  97. package/dist/components/Field/GroupFrame.js +31 -0
  98. package/dist/components/Field/PickerField.d.ts +8 -2
  99. package/dist/components/Field/PickerField.js +12 -8
  100. package/dist/components/Field/PickerField.module.js +4 -4
  101. package/dist/components/Field/PickerField_module.css +11 -6
  102. package/dist/components/FilterBar/FilterBar.module.js +9 -9
  103. package/dist/components/FilterBar/FilterBar_module.css +13 -13
  104. package/dist/components/Form/Form.d.ts +9 -7
  105. package/dist/components/Form/Form.module.js +1 -1
  106. package/dist/components/Form/Form_module.css +1 -1
  107. package/dist/components/IconButton/IconButton.d.ts +1 -1
  108. package/dist/components/IconButton/IconButton.module.js +2 -2
  109. package/dist/components/IconButton/IconButton_module.css +28 -17
  110. package/dist/components/Menu/Menu.js +3 -0
  111. package/dist/components/Menu/Menu.module.js +2 -2
  112. package/dist/components/Menu/Menu_module.css +5 -4
  113. package/dist/components/NavMenu/NavMenu.d.ts +27 -4
  114. package/dist/components/NavMenu/NavMenu.js +10 -8
  115. package/dist/components/NavMenu/NavMenu.module.js +6 -6
  116. package/dist/components/NavMenu/NavMenu_module.css +37 -19
  117. package/dist/components/NavMenu/currentPath.d.ts +9 -0
  118. package/dist/components/NavMenu/currentPath.js +5 -0
  119. package/dist/components/PageHeading/PageHeading.module.js +3 -3
  120. package/dist/components/PageHeading/PageHeading_module.css +12 -9
  121. package/dist/components/PageShell/PageShell.module.js +5 -5
  122. package/dist/components/PageShell/PageShell_module.css +9 -9
  123. package/dist/components/Popover/Popover.js +3 -0
  124. package/dist/components/Popover/Popover.module.js +2 -2
  125. package/dist/components/Popover/Popover_module.css +6 -3
  126. package/dist/components/ProgressBar/ProgressBar.d.ts +55 -0
  127. package/dist/components/ProgressBar/ProgressBar.js +76 -0
  128. package/dist/components/ProgressBar/ProgressBar.module.js +12 -0
  129. package/dist/components/ProgressBar/ProgressBar_module.css +120 -0
  130. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  131. package/dist/components/RadioGroup/RadioGroup.js +35 -49
  132. package/dist/components/RadioGroup/RadioGroup.module.js +2 -2
  133. package/dist/components/RadioGroup/RadioGroup_module.css +2 -2
  134. package/dist/components/SearchField/SearchField.d.ts +32 -0
  135. package/dist/components/SearchField/SearchField.js +100 -0
  136. package/dist/components/SearchField/SearchField.module.js +8 -0
  137. package/dist/components/SearchField/SearchField_module.css +34 -0
  138. package/dist/components/Segmented/Segmented.d.ts +23 -6
  139. package/dist/components/Segmented/Segmented.js +37 -20
  140. package/dist/components/Segmented/Segmented.module.js +4 -3
  141. package/dist/components/Segmented/Segmented_module.css +46 -20
  142. package/dist/components/Select/Select.js +3 -0
  143. package/dist/components/Select/Select.module.js +5 -5
  144. package/dist/components/Select/Select_module.css +12 -11
  145. package/dist/components/Skeleton/Skeleton.module.js +3 -3
  146. package/dist/components/Skeleton/Skeleton_module.css +9 -9
  147. package/dist/components/SkipLink/SkipLink.module.js +1 -1
  148. package/dist/components/SkipLink/SkipLink_module.css +4 -4
  149. package/dist/components/Spinner/Spinner.module.js +3 -3
  150. package/dist/components/Spinner/Spinner_module.css +7 -7
  151. package/dist/components/StatusDot/StatusDot.module.js +5 -5
  152. package/dist/components/StatusDot/StatusDot_module.css +11 -11
  153. package/dist/components/Steps/Steps.module.js +6 -6
  154. package/dist/components/Steps/Steps_module.css +19 -19
  155. package/dist/components/Switch/Switch.module.js +2 -2
  156. package/dist/components/Switch/Switch_module.css +5 -5
  157. package/dist/components/TabBar/TabBar.d.ts +26 -0
  158. package/dist/components/TabBar/TabBar.js +52 -0
  159. package/dist/components/TabBar/TabBar.module.js +11 -0
  160. package/dist/components/TabBar/TabBar_module.css +100 -0
  161. package/dist/components/Tabs/Tabs.module.js +4 -4
  162. package/dist/components/Tabs/Tabs_module.css +9 -8
  163. package/dist/components/Tag/Tag.module.js +1 -1
  164. package/dist/components/Tag/Tag_module.css +3 -2
  165. package/dist/components/TextArea/TextArea.module.js +1 -1
  166. package/dist/components/TextArea/TextArea_module.css +6 -2
  167. package/dist/components/TextInput/TextInput.d.ts +14 -2
  168. package/dist/components/TextInput/TextInput.js +4 -5
  169. package/dist/components/ThemeScope/PortalContainerContext.d.ts +17 -0
  170. package/dist/components/ThemeScope/PortalContainerContext.js +6 -0
  171. package/dist/components/ThemeScope/ThemeScope.d.ts +23 -0
  172. package/dist/components/ThemeScope/ThemeScope.js +29 -0
  173. package/dist/components/ThemeScope/ThemeScope.module.js +6 -0
  174. package/dist/components/ThemeScope/ThemeScope_module.css +10 -0
  175. package/dist/components/TimePicker/TimePicker.d.ts +15 -2
  176. package/dist/components/TimePicker/TimePicker.js +5 -5
  177. package/dist/components/Timeline/Timeline.module.js +8 -8
  178. package/dist/components/Timeline/Timeline_module.css +15 -13
  179. package/dist/components/ToastRegion/ToastRegion.js +3 -0
  180. package/dist/components/ToastRegion/ToastRegion.module.js +6 -6
  181. package/dist/components/ToastRegion/ToastRegion_module.css +23 -19
  182. package/dist/components/ToggleChip/ToggleChip.d.ts +49 -0
  183. package/dist/components/ToggleChip/ToggleChip.js +45 -0
  184. package/dist/components/ToggleChip/ToggleChip.module.js +9 -0
  185. package/dist/components/ToggleChip/ToggleChipGroup.d.ts +57 -0
  186. package/dist/components/ToggleChip/ToggleChipGroup.js +93 -0
  187. package/dist/components/ToggleChip/ToggleChip_module.css +97 -0
  188. package/dist/components/Toolbar/Toolbar.module.js +3 -3
  189. package/dist/components/Toolbar/Toolbar_module.css +5 -5
  190. package/dist/components/Tooltip/Tooltip.js +3 -0
  191. package/dist/components/Tree/Tree.module.js +8 -8
  192. package/dist/components/Tree/Tree_module.css +20 -20
  193. package/dist/components/TreeSelect/TreeSelect.js +3 -0
  194. package/dist/components/TreeSelect/TreeSelect.module.js +3 -3
  195. package/dist/components/TreeSelect/TreeSelect_module.css +4 -4
  196. package/dist/components/Upload/Upload.module.js +8 -8
  197. package/dist/components/Upload/Upload_module.css +16 -16
  198. package/dist/components/ViewField/ViewField.module.js +2 -2
  199. package/dist/components/ViewField/ViewField_module.css +3 -3
  200. package/dist/hooks/useControllable.d.ts +11 -0
  201. package/dist/hooks/useControllable.js +13 -0
  202. package/dist/hooks/useIndexedToggleGroup.d.ts +30 -0
  203. package/dist/hooks/useIndexedToggleGroup.js +26 -0
  204. package/dist/hooks/useOverflowFocusable.d.ts +17 -0
  205. package/dist/hooks/useOverflowFocusable.js +36 -0
  206. package/dist/icons/ChevronRightIcon.d.ts +6 -0
  207. package/dist/icons/ChevronRightIcon.js +17 -0
  208. package/dist/icons/RefreshIcon.d.ts +6 -0
  209. package/dist/icons/RefreshIcon.js +22 -0
  210. package/dist/icons/SearchIcon.d.ts +9 -0
  211. package/dist/icons/SearchIcon.js +23 -0
  212. package/dist/index.d.ts +31 -0
  213. package/dist/index.js +14 -0
  214. package/dist/styles/a11y.module.js +1 -1
  215. package/dist/styles/a11y_module.css +1 -1
  216. package/dist/styles/base.css +17 -0
  217. package/dist/styles/closeCircle.module.js +5 -0
  218. package/dist/styles/closeCircle_module.css +12 -0
  219. package/dist/styles/field.module.js +14 -11
  220. package/dist/styles/field_module.css +92 -23
  221. package/dist/styles/pair.module.js +2 -2
  222. package/dist/styles/pair_module.css +5 -3
  223. package/dist/styles/popup.module.js +5 -5
  224. package/dist/styles/popup_module.css +35 -28
  225. package/dist/utils/focusInputFromPill.d.ts +12 -0
  226. package/dist/utils/focusInputFromPill.js +7 -0
  227. package/dist/utils/hasContent.d.ts +8 -0
  228. package/dist/utils/hasContent.js +4 -0
  229. package/package.json +4 -3
@@ -0,0 +1,161 @@
1
+ .ui0-7-0-grid-oumaG {
2
+ grid-template-columns: repeat(var(--choice-card-columns), minmax(0, 1fr));
3
+ gap: var(--space-2);
4
+ display: grid;
5
+ }
6
+
7
+ .ui0-7-0-grid-oumaG[data-columns="1"] {
8
+ --choice-card-columns: 1;
9
+ }
10
+
11
+ .ui0-7-0-grid-oumaG[data-columns="2"] {
12
+ --choice-card-columns: 2;
13
+ }
14
+
15
+ .ui0-7-0-item-eo3zz {
16
+ flex-direction: column;
17
+ display: flex;
18
+ }
19
+
20
+ .ui0-7-0-card-bDmw_ {
21
+ --choice-card-ring: inset 0 0 0 1px var(--color-border-strong);
22
+ --choice-card-dot: inset 0 0 0 var(--border-width-emphasis) var(--color-border-strong);
23
+ --choice-card-ring-size: 1.125rem;
24
+ --choice-card-ring-clearance: calc(var(--choice-card-ring-size) + var(--space-2));
25
+ padding: var(--space-3);
26
+ border-radius: var(--radius-panel);
27
+ background: var(--color-surface-raised);
28
+ box-shadow: var(--choice-card-ring);
29
+ color: var(--color-text);
30
+ cursor: pointer;
31
+ overflow-wrap: anywhere;
32
+ flex-direction: column;
33
+ flex-grow: 1;
34
+ align-items: flex-start;
35
+ display: flex;
36
+ position: relative;
37
+ }
38
+
39
+ .ui0-7-0-card-bDmw_[data-checked] {
40
+ --choice-card-ring: inset 0 0 0 var(--border-width-emphasis) var(--color-selected);
41
+ background: var(--color-selected-soft);
42
+ }
43
+
44
+ .ui0-7-0-card-bDmw_[data-disabled] {
45
+ cursor: not-allowed;
46
+ opacity: .45;
47
+ }
48
+
49
+ .ui0-7-0-card-bDmw_:has(.ui0-7-0-ring-eysJU:focus-visible) {
50
+ outline: var(--focus-ring-width) solid var(--color-focus);
51
+ outline-offset: var(--focus-ring-offset);
52
+ }
53
+
54
+ @supports selector(:has(*)) {
55
+ .ui0-7-0-ring-eysJU:focus-visible {
56
+ outline: none;
57
+ }
58
+ }
59
+
60
+ .ui0-7-0-disc-sj8HT {
61
+ border-radius: var(--radius-full);
62
+ background: var(--color-surface-2);
63
+ width: 1.875rem;
64
+ height: 1.875rem;
65
+ color: var(--color-text-muted);
66
+ flex: none;
67
+ justify-content: center;
68
+ align-items: center;
69
+ display: flex;
70
+ }
71
+
72
+ .ui0-7-0-card-bDmw_[data-checked] .ui0-7-0-disc-sj8HT {
73
+ background: var(--color-surface-raised);
74
+ color: var(--color-selected-soft-text);
75
+ }
76
+
77
+ .ui0-7-0-disc-sj8HT > svg {
78
+ width: .9375rem;
79
+ height: .9375rem;
80
+ }
81
+
82
+ .ui0-7-0-title-bCoo6 {
83
+ font-family: var(--font-sans);
84
+ font-weight: var(--font-weight-heading);
85
+ font-size: var(--text-md);
86
+ line-height: var(--leading-snug);
87
+ }
88
+
89
+ .ui0-7-0-disc-sj8HT + .ui0-7-0-title-bCoo6 {
90
+ margin-top: var(--space-2);
91
+ }
92
+
93
+ .ui0-7-0-title-bCoo6:first-child {
94
+ padding-inline-end: var(--choice-card-ring-clearance);
95
+ }
96
+
97
+ .ui0-7-0-description-oa_zk {
98
+ margin-top: var(--space-1);
99
+ color: var(--color-text-muted);
100
+ font-family: var(--font-body);
101
+ font-weight: var(--font-weight-body);
102
+ font-size: var(--text-sm);
103
+ line-height: var(--leading-snug);
104
+ }
105
+
106
+ .ui0-7-0-ring-eysJU {
107
+ width: var(--choice-card-ring-size);
108
+ height: var(--choice-card-ring-size);
109
+ border-radius: var(--radius-full);
110
+ box-shadow: var(--choice-card-dot);
111
+ cursor: inherit;
112
+ justify-content: center;
113
+ align-items: center;
114
+ display: flex;
115
+ position: absolute;
116
+ inset-block-start: var(--space-3);
117
+ inset-inline-end: var(--space-3);
118
+ }
119
+
120
+ .ui0-7-0-ring-eysJU[data-invalid] {
121
+ --choice-card-dot: inset 0 0 0 var(--border-width-emphasis) var(--color-danger-border);
122
+ }
123
+
124
+ .ui0-7-0-ring-eysJU[data-checked] {
125
+ --choice-card-dot: none;
126
+ background: var(--color-selected);
127
+ color: var(--color-selected-text);
128
+ }
129
+
130
+ .ui0-7-0-mark-PphgZ {
131
+ display: flex;
132
+ }
133
+
134
+ .ui0-7-0-mark-PphgZ > svg {
135
+ width: .6875rem;
136
+ height: .6875rem;
137
+ }
138
+
139
+ @media (forced-colors: active) {
140
+ .ui0-7-0-card-bDmw_, .ui0-7-0-ring-eysJU {
141
+ border: 1px solid #0000;
142
+ }
143
+
144
+ .ui0-7-0-card-bDmw_[data-checked] {
145
+ border-color: highlight;
146
+ }
147
+
148
+ .ui0-7-0-card-bDmw_[data-disabled] {
149
+ opacity: 1;
150
+ color: graytext;
151
+ border-color: graytext;
152
+ }
153
+
154
+ .ui0-7-0-ring-eysJU[data-checked] {
155
+ forced-color-adjust: none;
156
+ color: highlighttext;
157
+ background: highlight;
158
+ border-color: highlight;
159
+ }
160
+ }
161
+
@@ -0,0 +1,39 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface CollapsibleProps {
3
+ /** The label on the row. It is the trigger's accessible name, with `headingAside` after it. */
4
+ heading: ReactNode;
5
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
6
+ /**
7
+ * After the heading text and before the chevron: a count, a status word. It sits inside the
8
+ * trigger button, so it must be decorative or plain text; an interactive node here is a caller
9
+ * error, because a button cannot hold another control.
10
+ */
11
+ headingAside?: ReactNode;
12
+ /** Controlled. Pair it with `onOpenChange`; use `defaultOpen` for an uncontrolled one. */
13
+ open?: boolean;
14
+ /** Closed on arrival unless this is set; a screen that opens every group passes `true`. */
15
+ defaultOpen?: boolean;
16
+ /** Called with the next state each time the trigger asks to change it. */
17
+ onOpenChange?: (open: boolean) => void;
18
+ /**
19
+ * The trigger stays in the tab order, announced as disabled, and does nothing. This is Base UI's
20
+ * `disabled`: a native `disabled` button would drop out of the tab order, and a keyboard user
21
+ * would not learn the row exists.
22
+ */
23
+ disabled?: boolean;
24
+ children: ReactNode;
25
+ /**
26
+ * A class for the root, joined after the component's own. It is how a consumer sets the one
27
+ * size hook, `--collapsible-heading-size`, which resizes the heading (default `--text-md`). Like
28
+ * any custom property the hook inherits, so a wrapper that sets it resizes every collapsible
29
+ * inside it.
30
+ */
31
+ className?: string;
32
+ }
33
+ /**
34
+ * A heading row that opens and closes a region under it: the item of an accordion, not the
35
+ * accordion (a stack with one open at a time is a later component). The region stays mounted
36
+ * while closed and is `hidden`, so what is inside keeps its state and the trigger's
37
+ * `aria-controls` always names an element that exists.
38
+ */
39
+ export declare function Collapsible({ heading, headingLevel, headingAside, open, defaultOpen, onOpenChange, disabled, children, className, }: CollapsibleProps): import("react").JSX.Element;
@@ -0,0 +1,63 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Collapsible } from "@base-ui/react/collapsible";
3
+ import { useId } from "react";
4
+ import { ChevronDownIcon } from "../../icons/ChevronDownIcon.js";
5
+ import { hasContent } from "../../utils/hasContent.js";
6
+ import Collapsible_module from "./Collapsible.module.js";
7
+ const headingTags = {
8
+ 2: 'h2',
9
+ 3: 'h3',
10
+ 4: 'h4',
11
+ 5: 'h5',
12
+ 6: 'h6'
13
+ };
14
+ function Collapsible_Collapsible({ heading, headingLevel = 3, headingAside, open, defaultOpen = false, onOpenChange, disabled = false, children, className }) {
15
+ const Heading = headingTags[headingLevel] ?? 'h3';
16
+ const panelId = useId();
17
+ return /*#__PURE__*/ jsxs(Collapsible.Root, {
18
+ render: /*#__PURE__*/ jsx("section", {}),
19
+ className: [
20
+ Collapsible_module.root,
21
+ className
22
+ ].filter(Boolean).join(' '),
23
+ open: open,
24
+ defaultOpen: defaultOpen,
25
+ disabled: disabled,
26
+ onOpenChange: (nextOpen)=>onOpenChange?.(nextOpen),
27
+ children: [
28
+ /*#__PURE__*/ jsx(Heading, {
29
+ className: Collapsible_module.heading,
30
+ children: /*#__PURE__*/ jsxs(Collapsible.Trigger, {
31
+ className: Collapsible_module.trigger,
32
+ "aria-controls": panelId,
33
+ children: [
34
+ /*#__PURE__*/ jsx("span", {
35
+ className: Collapsible_module.label,
36
+ children: heading
37
+ }),
38
+ hasContent(headingAside) ? /*#__PURE__*/ jsxs(Fragment, {
39
+ children: [
40
+ ' ',
41
+ /*#__PURE__*/ jsx("span", {
42
+ children: headingAside
43
+ })
44
+ ]
45
+ }) : null,
46
+ /*#__PURE__*/ jsx("span", {
47
+ className: Collapsible_module.chevron,
48
+ "aria-hidden": "true",
49
+ children: /*#__PURE__*/ jsx(ChevronDownIcon, {})
50
+ })
51
+ ]
52
+ })
53
+ }),
54
+ /*#__PURE__*/ jsx(Collapsible.Panel, {
55
+ id: panelId,
56
+ className: Collapsible_module.panel,
57
+ keepMounted: true,
58
+ children: children
59
+ })
60
+ ]
61
+ });
62
+ }
63
+ export { Collapsible_Collapsible as Collapsible };
@@ -0,0 +1,10 @@
1
+ import "./Collapsible_module.css";
2
+ const Collapsible_module = {
3
+ root: "ui0-7-0-root-D02Wt",
4
+ heading: "ui0-7-0-heading-Q0_vs",
5
+ trigger: "ui0-7-0-trigger-jzj48",
6
+ label: "ui0-7-0-label-i75Ot",
7
+ chevron: "ui0-7-0-chevron-sH_XL",
8
+ panel: "ui0-7-0-panel-TIli5"
9
+ };
10
+ export default Collapsible_module;
@@ -0,0 +1,80 @@
1
+ .ui0-7-0-root-D02Wt {
2
+ min-width: 0;
3
+ }
4
+
5
+ .ui0-7-0-heading-Q0_vs {
6
+ color: var(--color-text);
7
+ font-size: var(--collapsible-heading-size, var(--text-md));
8
+ font-family: var(--font-display);
9
+ font-weight: var(--font-weight-display);
10
+ font-stretch: var(--font-stretch-display);
11
+ text-transform: var(--text-transform-display);
12
+ letter-spacing: var(--tracking-heading);
13
+ line-height: var(--leading-snug);
14
+ margin: 0;
15
+ }
16
+
17
+ .ui0-7-0-trigger-jzj48 {
18
+ align-items: center;
19
+ gap: var(--space-2);
20
+ width: 100%;
21
+ font: inherit;
22
+ letter-spacing: inherit;
23
+ text-transform: inherit;
24
+ text-align: start;
25
+ color: inherit;
26
+ cursor: pointer;
27
+ -webkit-tap-highlight-color: transparent;
28
+ background: none;
29
+ border: 0;
30
+ padding: 0;
31
+ display: flex;
32
+ position: relative;
33
+ }
34
+
35
+ .ui0-7-0-trigger-jzj48:before {
36
+ content: "";
37
+ position: absolute;
38
+ inset-block: min(0px, 50% - .75rem);
39
+ inset-inline: 0;
40
+ }
41
+
42
+ .ui0-7-0-trigger-jzj48[data-disabled] {
43
+ cursor: not-allowed;
44
+ }
45
+
46
+ .ui0-7-0-trigger-jzj48[data-disabled] > * {
47
+ opacity: .45;
48
+ }
49
+
50
+ .ui0-7-0-label-i75Ot {
51
+ min-width: 0;
52
+ }
53
+
54
+ .ui0-7-0-chevron-sH_XL {
55
+ width: 1rem;
56
+ height: 1rem;
57
+ color: var(--color-text-muted);
58
+ transition-property: transform;
59
+ transition-duration: var(--motion-duration-1);
60
+ transition-timing-function: var(--motion-ease);
61
+ flex: none;
62
+ justify-content: center;
63
+ align-items: center;
64
+ margin-inline-start: auto;
65
+ display: inline-flex;
66
+ }
67
+
68
+ .ui0-7-0-chevron-sH_XL > svg {
69
+ width: 100%;
70
+ height: 100%;
71
+ }
72
+
73
+ .ui0-7-0-trigger-jzj48[data-panel-open] .ui0-7-0-chevron-sH_XL {
74
+ transform: rotate(180deg);
75
+ }
76
+
77
+ .ui0-7-0-panel-TIli5 {
78
+ padding-block-start: var(--space-3);
79
+ }
80
+
@@ -0,0 +1,3 @@
1
+ import { type RowData } from '@tanstack/react-table';
2
+ import type { DataGridProps } from './types.js';
3
+ export declare function DataGrid<Row extends RowData>({ heading, headingLevel, rows, columns, getRowId, getRowLabel, actions, mode, totalRowCount, hasMore, loadingMore, loadError, onLoadMore, onQueryChange, initialSorting, enableSorting, multiSort, density, maxHeight, fill, hideFooter, loading, emptyState, onRefresh, refreshing, highlightOnClick, highlightedRowId, onHighlightChange, selectionMode, selectedRowIds, defaultSelectedRowIds, onSelectedRowIdsChange, isRowSelectable, onRowClick, onRowDoubleClick, onRowContextMenu, renderRowActions, rowActionsHeader, renderExpandedRow, isRowExpandable, expandedRowIds, defaultExpandedRowIds, onExpandedRowIdsChange, labels, }: DataGridProps<Row>): import("react").JSX.Element;