@calcifer-design/ui 0.6.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 (189) 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.module.js +32 -32
  38. package/dist/components/DataGrid/DataGrid_module.css +67 -62
  39. package/dist/components/DataTable/DataTable.module.js +9 -9
  40. package/dist/components/DataTable/DataTable_module.css +24 -21
  41. package/dist/components/DatePicker/DatePicker.d.ts +15 -1
  42. package/dist/components/DatePicker/DatePicker.js +30 -5
  43. package/dist/components/DatePicker/DatePicker.module.js +10 -10
  44. package/dist/components/DatePicker/DatePicker_module.css +22 -21
  45. package/dist/components/Descriptions/Descriptions.module.js +4 -4
  46. package/dist/components/Descriptions/Descriptions_module.css +12 -8
  47. package/dist/components/Dialog/Dialog.d.ts +30 -2
  48. package/dist/components/Dialog/Dialog.js +52 -11
  49. package/dist/components/Dialog/Dialog.module.js +8 -6
  50. package/dist/components/Dialog/Dialog_module.css +60 -13
  51. package/dist/components/EmptyState/EmptyState.d.ts +41 -0
  52. package/dist/components/EmptyState/EmptyState.js +39 -0
  53. package/dist/components/EmptyState/EmptyState.module.js +9 -0
  54. package/dist/components/EmptyState/EmptyState_module.css +65 -0
  55. package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +5 -2
  56. package/dist/components/ErrorBoundary/ErrorBoundary.module.js +1 -1
  57. package/dist/components/ErrorBoundary/ErrorBoundary_module.css +1 -1
  58. package/dist/components/Field/AffixInput.d.ts +28 -0
  59. package/dist/components/Field/AffixInput.js +50 -0
  60. package/dist/components/Field/GroupFrame.d.ts +19 -0
  61. package/dist/components/Field/GroupFrame.js +31 -0
  62. package/dist/components/Field/PickerField.d.ts +8 -2
  63. package/dist/components/Field/PickerField.js +12 -8
  64. package/dist/components/Field/PickerField.module.js +4 -4
  65. package/dist/components/Field/PickerField_module.css +11 -6
  66. package/dist/components/FilterBar/FilterBar.module.js +9 -9
  67. package/dist/components/FilterBar/FilterBar_module.css +13 -13
  68. package/dist/components/Form/Form.d.ts +9 -7
  69. package/dist/components/Form/Form.module.js +1 -1
  70. package/dist/components/Form/Form_module.css +1 -1
  71. package/dist/components/IconButton/IconButton.d.ts +1 -1
  72. package/dist/components/IconButton/IconButton.module.js +2 -2
  73. package/dist/components/IconButton/IconButton_module.css +28 -17
  74. package/dist/components/Menu/Menu.js +3 -0
  75. package/dist/components/Menu/Menu.module.js +2 -2
  76. package/dist/components/Menu/Menu_module.css +5 -4
  77. package/dist/components/NavMenu/NavMenu.d.ts +27 -4
  78. package/dist/components/NavMenu/NavMenu.js +10 -8
  79. package/dist/components/NavMenu/NavMenu.module.js +6 -6
  80. package/dist/components/NavMenu/NavMenu_module.css +37 -19
  81. package/dist/components/NavMenu/currentPath.d.ts +9 -0
  82. package/dist/components/NavMenu/currentPath.js +5 -0
  83. package/dist/components/PageHeading/PageHeading.module.js +3 -3
  84. package/dist/components/PageHeading/PageHeading_module.css +12 -9
  85. package/dist/components/PageShell/PageShell.module.js +5 -5
  86. package/dist/components/PageShell/PageShell_module.css +9 -9
  87. package/dist/components/Popover/Popover.js +3 -0
  88. package/dist/components/Popover/Popover.module.js +2 -2
  89. package/dist/components/Popover/Popover_module.css +6 -3
  90. package/dist/components/ProgressBar/ProgressBar.d.ts +55 -0
  91. package/dist/components/ProgressBar/ProgressBar.js +76 -0
  92. package/dist/components/ProgressBar/ProgressBar.module.js +12 -0
  93. package/dist/components/ProgressBar/ProgressBar_module.css +120 -0
  94. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  95. package/dist/components/RadioGroup/RadioGroup.js +35 -49
  96. package/dist/components/RadioGroup/RadioGroup.module.js +2 -2
  97. package/dist/components/RadioGroup/RadioGroup_module.css +2 -2
  98. package/dist/components/SearchField/SearchField.d.ts +32 -0
  99. package/dist/components/SearchField/SearchField.js +100 -0
  100. package/dist/components/SearchField/SearchField.module.js +8 -0
  101. package/dist/components/SearchField/SearchField_module.css +34 -0
  102. package/dist/components/Segmented/Segmented.d.ts +23 -6
  103. package/dist/components/Segmented/Segmented.js +37 -20
  104. package/dist/components/Segmented/Segmented.module.js +4 -3
  105. package/dist/components/Segmented/Segmented_module.css +46 -20
  106. package/dist/components/Select/Select.js +3 -0
  107. package/dist/components/Select/Select.module.js +5 -5
  108. package/dist/components/Select/Select_module.css +12 -11
  109. package/dist/components/Skeleton/Skeleton.module.js +3 -3
  110. package/dist/components/Skeleton/Skeleton_module.css +9 -9
  111. package/dist/components/SkipLink/SkipLink.module.js +1 -1
  112. package/dist/components/SkipLink/SkipLink_module.css +4 -4
  113. package/dist/components/Spinner/Spinner.module.js +3 -3
  114. package/dist/components/Spinner/Spinner_module.css +7 -7
  115. package/dist/components/StatusDot/StatusDot.module.js +5 -5
  116. package/dist/components/StatusDot/StatusDot_module.css +11 -11
  117. package/dist/components/Steps/Steps.module.js +6 -6
  118. package/dist/components/Steps/Steps_module.css +19 -19
  119. package/dist/components/Switch/Switch.module.js +2 -2
  120. package/dist/components/Switch/Switch_module.css +5 -5
  121. package/dist/components/TabBar/TabBar.d.ts +26 -0
  122. package/dist/components/TabBar/TabBar.js +52 -0
  123. package/dist/components/TabBar/TabBar.module.js +11 -0
  124. package/dist/components/TabBar/TabBar_module.css +100 -0
  125. package/dist/components/Tabs/Tabs.module.js +4 -4
  126. package/dist/components/Tabs/Tabs_module.css +9 -8
  127. package/dist/components/Tag/Tag.module.js +1 -1
  128. package/dist/components/Tag/Tag_module.css +3 -2
  129. package/dist/components/TextArea/TextArea.module.js +1 -1
  130. package/dist/components/TextArea/TextArea_module.css +6 -2
  131. package/dist/components/TextInput/TextInput.d.ts +14 -2
  132. package/dist/components/TextInput/TextInput.js +4 -5
  133. package/dist/components/ThemeScope/PortalContainerContext.d.ts +17 -0
  134. package/dist/components/ThemeScope/PortalContainerContext.js +6 -0
  135. package/dist/components/ThemeScope/ThemeScope.d.ts +23 -0
  136. package/dist/components/ThemeScope/ThemeScope.js +29 -0
  137. package/dist/components/ThemeScope/ThemeScope.module.js +6 -0
  138. package/dist/components/ThemeScope/ThemeScope_module.css +10 -0
  139. package/dist/components/TimePicker/TimePicker.d.ts +15 -2
  140. package/dist/components/TimePicker/TimePicker.js +5 -5
  141. package/dist/components/Timeline/Timeline.module.js +8 -8
  142. package/dist/components/Timeline/Timeline_module.css +15 -13
  143. package/dist/components/ToastRegion/ToastRegion.js +3 -0
  144. package/dist/components/ToastRegion/ToastRegion.module.js +6 -6
  145. package/dist/components/ToastRegion/ToastRegion_module.css +23 -19
  146. package/dist/components/ToggleChip/ToggleChip.d.ts +49 -0
  147. package/dist/components/ToggleChip/ToggleChip.js +45 -0
  148. package/dist/components/ToggleChip/ToggleChip.module.js +9 -0
  149. package/dist/components/ToggleChip/ToggleChipGroup.d.ts +57 -0
  150. package/dist/components/ToggleChip/ToggleChipGroup.js +93 -0
  151. package/dist/components/ToggleChip/ToggleChip_module.css +97 -0
  152. package/dist/components/Toolbar/Toolbar.module.js +3 -3
  153. package/dist/components/Toolbar/Toolbar_module.css +5 -5
  154. package/dist/components/Tooltip/Tooltip.js +3 -0
  155. package/dist/components/Tree/Tree.module.js +8 -8
  156. package/dist/components/Tree/Tree_module.css +20 -20
  157. package/dist/components/TreeSelect/TreeSelect.js +3 -0
  158. package/dist/components/TreeSelect/TreeSelect.module.js +3 -3
  159. package/dist/components/TreeSelect/TreeSelect_module.css +4 -4
  160. package/dist/components/Upload/Upload.module.js +8 -8
  161. package/dist/components/Upload/Upload_module.css +16 -16
  162. package/dist/components/ViewField/ViewField.module.js +2 -2
  163. package/dist/components/ViewField/ViewField_module.css +3 -3
  164. package/dist/hooks/useControllable.d.ts +11 -0
  165. package/dist/hooks/useControllable.js +13 -0
  166. package/dist/hooks/useIndexedToggleGroup.d.ts +30 -0
  167. package/dist/hooks/useIndexedToggleGroup.js +26 -0
  168. package/dist/hooks/useOverflowFocusable.d.ts +17 -0
  169. package/dist/hooks/useOverflowFocusable.js +36 -0
  170. package/dist/icons/SearchIcon.d.ts +9 -0
  171. package/dist/icons/SearchIcon.js +23 -0
  172. package/dist/index.d.ts +26 -0
  173. package/dist/index.js +12 -0
  174. package/dist/styles/a11y.module.js +1 -1
  175. package/dist/styles/a11y_module.css +1 -1
  176. package/dist/styles/base.css +17 -0
  177. package/dist/styles/closeCircle.module.js +5 -0
  178. package/dist/styles/closeCircle_module.css +12 -0
  179. package/dist/styles/field.module.js +14 -11
  180. package/dist/styles/field_module.css +92 -23
  181. package/dist/styles/pair.module.js +2 -2
  182. package/dist/styles/pair_module.css +5 -3
  183. package/dist/styles/popup.module.js +5 -5
  184. package/dist/styles/popup_module.css +35 -28
  185. package/dist/utils/focusInputFromPill.d.ts +12 -0
  186. package/dist/utils/focusInputFromPill.js +7 -0
  187. package/dist/utils/hasContent.d.ts +8 -0
  188. package/dist/utils/hasContent.js +4 -0
  189. package/package.json +2 -2
@@ -1,15 +1,15 @@
1
- .root-dqkRl, .group-nEZG3 {
1
+ .ui0-7-0-root-dqkRl, .ui0-7-0-group-nEZG3 {
2
2
  margin: 0;
3
3
  padding: 0;
4
4
  list-style: none;
5
5
  }
6
6
 
7
- .root-dqkRl {
7
+ .ui0-7-0-root-dqkRl {
8
8
  min-width: 0;
9
9
  padding: var(--space-1);
10
10
  }
11
11
 
12
- .row-Idt69 {
12
+ .ui0-7-0-row-Idt69 {
13
13
  --tree-indent: min(calc(var(--tree-level) * var(--space-4)), 40%);
14
14
  align-items: center;
15
15
  gap: var(--space-1);
@@ -30,49 +30,49 @@
30
30
  display: flex;
31
31
  }
32
32
 
33
- .item-ZpP2D:focus-visible {
33
+ .ui0-7-0-item-ZpP2D:focus-visible {
34
34
  outline: none;
35
35
  }
36
36
 
37
- .item-ZpP2D:focus-visible > .row-Idt69 {
37
+ .ui0-7-0-item-ZpP2D:focus-visible > .ui0-7-0-row-Idt69 {
38
38
  outline: var(--focus-ring-width) solid var(--color-focus);
39
39
  outline-offset: var(--focus-ring-offset);
40
40
  }
41
41
 
42
42
  @media (hover: hover) {
43
- .row-Idt69:hover {
43
+ .ui0-7-0-row-Idt69:hover {
44
44
  background: var(--color-surface-2);
45
45
  }
46
46
 
47
- .item-ZpP2D[aria-selected="true"] > .row-Idt69:hover {
47
+ .ui0-7-0-item-ZpP2D[aria-selected="true"] > .ui0-7-0-row-Idt69:hover {
48
48
  background: var(--color-accent-hover);
49
49
  }
50
50
  }
51
51
 
52
- .item-ZpP2D[aria-selected="true"] > .row-Idt69 {
52
+ .ui0-7-0-item-ZpP2D[aria-selected="true"] > .ui0-7-0-row-Idt69 {
53
53
  background: var(--color-accent);
54
54
  color: var(--color-accent-text);
55
55
  }
56
56
 
57
- .item-ZpP2D[aria-disabled="true"] > .row-Idt69 {
57
+ .ui0-7-0-item-ZpP2D[aria-disabled="true"] > .ui0-7-0-row-Idt69 {
58
58
  cursor: not-allowed;
59
59
  }
60
60
 
61
- .item-ZpP2D[aria-disabled="true"] > .row-Idt69 > * {
61
+ .ui0-7-0-item-ZpP2D[aria-disabled="true"] > .ui0-7-0-row-Idt69 > * {
62
62
  opacity: .45;
63
63
  }
64
64
 
65
- .icon-Vc8zg, .check-Ccwtp {
65
+ .ui0-7-0-icon-Vc8zg, .ui0-7-0-check-Ccwtp {
66
66
  flex: none;
67
67
  display: inline-flex;
68
68
  }
69
69
 
70
- .icon-Vc8zg > svg, .check-Ccwtp > svg {
70
+ .ui0-7-0-icon-Vc8zg > svg, .ui0-7-0-check-Ccwtp > svg {
71
71
  width: 1rem;
72
72
  height: 1rem;
73
73
  }
74
74
 
75
- .toggle-Dv2Gv {
75
+ .ui0-7-0-toggle-Dv2Gv {
76
76
  flex: none;
77
77
  justify-content: center;
78
78
  align-self: stretch;
@@ -81,7 +81,7 @@
81
81
  display: inline-flex;
82
82
  }
83
83
 
84
- .toggle-Dv2Gv > svg {
84
+ .ui0-7-0-toggle-Dv2Gv > svg {
85
85
  width: 1rem;
86
86
  height: 1rem;
87
87
  transition-property: transform;
@@ -90,15 +90,15 @@
90
90
  transform: rotate(-90deg);
91
91
  }
92
92
 
93
- .root-dqkRl[data-direction="rtl"] .toggle-Dv2Gv > svg {
93
+ .ui0-7-0-root-dqkRl[data-direction="rtl"] .ui0-7-0-toggle-Dv2Gv > svg {
94
94
  transform: rotate(90deg);
95
95
  }
96
96
 
97
- .item-ZpP2D[aria-expanded="true"] > .row-Idt69 > .toggle-Dv2Gv > svg, .root-dqkRl[data-direction="rtl"] .item-ZpP2D[aria-expanded="true"] > .row-Idt69 > .toggle-Dv2Gv > svg {
97
+ .ui0-7-0-item-ZpP2D[aria-expanded="true"] > .ui0-7-0-row-Idt69 > .ui0-7-0-toggle-Dv2Gv > svg, .ui0-7-0-root-dqkRl[data-direction="rtl"] .ui0-7-0-item-ZpP2D[aria-expanded="true"] > .ui0-7-0-row-Idt69 > .ui0-7-0-toggle-Dv2Gv > svg {
98
98
  transform: none;
99
99
  }
100
100
 
101
- .label-u_zOq {
101
+ .ui0-7-0-label-u_zOq {
102
102
  min-width: 0;
103
103
  padding-block: var(--space-2);
104
104
  overflow-wrap: anywhere;
@@ -106,18 +106,18 @@
106
106
  }
107
107
 
108
108
  @media (forced-colors: active) {
109
- .item-ZpP2D[aria-selected="true"] > .row-Idt69, .item-ZpP2D[aria-selected="true"] > .row-Idt69:hover {
109
+ .ui0-7-0-item-ZpP2D[aria-selected="true"] > .ui0-7-0-row-Idt69, .ui0-7-0-item-ZpP2D[aria-selected="true"] > .ui0-7-0-row-Idt69:hover {
110
110
  forced-color-adjust: none;
111
111
  color: highlighttext;
112
112
  background: highlight;
113
113
  outline-color: canvastext;
114
114
  }
115
115
 
116
- .item-ZpP2D[aria-disabled="true"] > .row-Idt69 > * {
116
+ .ui0-7-0-item-ZpP2D[aria-disabled="true"] > .ui0-7-0-row-Idt69 > * {
117
117
  opacity: 1;
118
118
  }
119
119
 
120
- .item-ZpP2D[aria-disabled="true"]:not([aria-selected="true"]) > .row-Idt69 {
120
+ .ui0-7-0-item-ZpP2D[aria-disabled="true"]:not([aria-selected="true"]) > .ui0-7-0-row-Idt69 {
121
121
  color: graytext;
122
122
  }
123
123
  }
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { Popover } from "@base-ui/react/popover";
3
3
  import { useLayoutEffect, useMemo, useRef, useState } from "react";
4
4
  import { ChevronDownIcon } from "../../icons/ChevronDownIcon.js";
5
+ import { usePortalContainer } from "../ThemeScope/PortalContainerContext.js";
5
6
  import popup_module from "../../styles/popup.module.js";
6
7
  import { PickerField } from "../Field/PickerField.js";
7
8
  import { TreeView } from "../Tree/Tree.js";
@@ -14,6 +15,7 @@ const DEFAULT_LABELS = {
14
15
  };
15
16
  function TreeSelect({ label, name, items, description, error, required = false, disabled = false, value, defaultValue, onValueChange, onBlur, placeholder = 'Select…', clearable = false, labels }) {
16
17
  const popupRef = useRef(null);
18
+ const container = usePortalContainer();
17
19
  const [heldValue, setHeldValue] = useState(defaultValue ?? null);
18
20
  const [expandedIds, setExpandedIds] = useState([]);
19
21
  const [open, setOpen] = useState(false);
@@ -79,6 +81,7 @@ function TreeSelect({ label, name, items, description, error, required = false,
79
81
  open: open,
80
82
  onOpenChange: changeOpen,
81
83
  children: /*#__PURE__*/ jsx(Popover.Portal, {
84
+ container: container,
82
85
  children: /*#__PURE__*/ jsx(Popover.Positioner, {
83
86
  className: popup_module.layer,
84
87
  align: "start",
@@ -1,7 +1,7 @@
1
1
  import "./TreeSelect_module.css";
2
2
  const TreeSelect_module = {
3
- chevron: "chevron-HJ0ky",
4
- popup: "popup-KUQxt",
5
- empty: "empty-RdOM_"
3
+ chevron: "ui0-7-0-chevron-HJ0ky",
4
+ popup: "ui0-7-0-popup-KUQxt",
5
+ empty: "ui0-7-0-empty-RdOM_"
6
6
  };
7
7
  export default TreeSelect_module;
@@ -1,19 +1,19 @@
1
- .chevron-HJ0ky {
1
+ .ui0-7-0-chevron-HJ0ky {
2
2
  transition-property: transform;
3
3
  transition-duration: var(--motion-duration-1);
4
4
  transition-timing-function: var(--motion-ease);
5
5
  }
6
6
 
7
- [data-popup-open] > .chevron-HJ0ky {
7
+ [data-popup-open] > .ui0-7-0-chevron-HJ0ky {
8
8
  transform: rotate(180deg);
9
9
  }
10
10
 
11
- .popup-KUQxt[data-popup] {
11
+ .ui0-7-0-popup-KUQxt[data-popup] {
12
12
  width: max(var(--anchor-width), 18rem);
13
13
  max-height: min(24rem, var(--available-height));
14
14
  }
15
15
 
16
- .empty-RdOM_ {
16
+ .ui0-7-0-empty-RdOM_ {
17
17
  padding: var(--space-2) var(--space-3);
18
18
  color: var(--color-text-muted);
19
19
  font-size: var(--text-sm);
@@ -1,12 +1,12 @@
1
1
  import "./Upload_module.css";
2
2
  const Upload_module = {
3
- zone: "zone-ZaTfF",
4
- input: "input-nfdVe",
5
- face: "face-ZjTYq",
6
- hint: "hint-UVfUW",
7
- list: "list-jDElN",
8
- file: "file-Ui1KG",
9
- fileName: "fileName-CHIc8",
10
- rejection: "rejection-mI7_p"
3
+ zone: "ui0-7-0-zone-ZaTfF",
4
+ input: "ui0-7-0-input-nfdVe",
5
+ face: "ui0-7-0-face-ZjTYq",
6
+ hint: "ui0-7-0-hint-UVfUW",
7
+ list: "ui0-7-0-list-jDElN",
8
+ file: "ui0-7-0-file-Ui1KG",
9
+ fileName: "ui0-7-0-fileName-CHIc8",
10
+ rejection: "ui0-7-0-rejection-mI7_p"
11
11
  };
12
12
  export default Upload_module;
@@ -1,8 +1,8 @@
1
- .zone-ZaTfF {
1
+ .ui0-7-0-zone-ZaTfF {
2
2
  position: relative;
3
3
  }
4
4
 
5
- .input-nfdVe {
5
+ .ui0-7-0-input-nfdVe {
6
6
  opacity: 0;
7
7
  cursor: pointer;
8
8
  width: 100%;
@@ -11,59 +11,59 @@
11
11
  inset: 0;
12
12
  }
13
13
 
14
- .input-nfdVe::file-selector-button {
14
+ .ui0-7-0-input-nfdVe::file-selector-button {
15
15
  cursor: pointer;
16
16
  }
17
17
 
18
- .input-nfdVe:disabled {
18
+ .ui0-7-0-input-nfdVe:disabled {
19
19
  cursor: not-allowed;
20
20
  }
21
21
 
22
- .input-nfdVe:disabled::file-selector-button {
22
+ .ui0-7-0-input-nfdVe:disabled::file-selector-button {
23
23
  cursor: not-allowed;
24
24
  }
25
25
 
26
- .zone-ZaTfF .face-ZjTYq {
26
+ .ui0-7-0-zone-ZaTfF .ui0-7-0-face-ZjTYq {
27
27
  gap: var(--space-3);
28
28
  padding: var(--space-4);
29
29
  border-style: dashed;
30
30
  flex-wrap: wrap;
31
31
  }
32
32
 
33
- .hint-UVfUW {
33
+ .ui0-7-0-hint-UVfUW {
34
34
  color: var(--color-text-muted);
35
35
  font-size: var(--text-sm);
36
36
  line-height: var(--leading-snug);
37
37
  }
38
38
 
39
- .input-nfdVe:focus-visible + .face-ZjTYq {
39
+ .ui0-7-0-input-nfdVe:focus-visible + .ui0-7-0-face-ZjTYq {
40
40
  border-color: var(--color-accent);
41
41
  outline: var(--focus-ring-width) solid var(--color-focus);
42
42
  outline-offset: var(--focus-ring-offset);
43
43
  }
44
44
 
45
45
  @media (hover: hover) {
46
- .zone-ZaTfF:not([data-disabled]):hover .face-ZjTYq {
46
+ .ui0-7-0-zone-ZaTfF:not([data-disabled]):hover .ui0-7-0-face-ZjTYq {
47
47
  background: var(--color-surface-2);
48
48
  }
49
49
  }
50
50
 
51
- .zone-ZaTfF[data-dragging] .face-ZjTYq {
51
+ .ui0-7-0-zone-ZaTfF[data-dragging] .ui0-7-0-face-ZjTYq {
52
52
  border-style: solid;
53
53
  border-color: var(--color-accent);
54
54
  background: var(--color-accent-wash);
55
55
  }
56
56
 
57
- .input-nfdVe[data-invalid] + .face-ZjTYq {
57
+ .ui0-7-0-input-nfdVe[data-invalid] + .ui0-7-0-face-ZjTYq {
58
58
  border-color: var(--color-danger-border);
59
59
  background: var(--color-danger-surface);
60
60
  }
61
61
 
62
- .zone-ZaTfF[data-disabled] .face-ZjTYq {
62
+ .ui0-7-0-zone-ZaTfF[data-disabled] .ui0-7-0-face-ZjTYq {
63
63
  opacity: .55;
64
64
  }
65
65
 
66
- .list-jDElN {
66
+ .ui0-7-0-list-jDElN {
67
67
  gap: var(--space-1);
68
68
  flex-direction: column;
69
69
  margin: 0;
@@ -72,7 +72,7 @@
72
72
  display: flex;
73
73
  }
74
74
 
75
- .file-Ui1KG {
75
+ .ui0-7-0-file-Ui1KG {
76
76
  justify-content: space-between;
77
77
  align-items: center;
78
78
  gap: var(--space-2);
@@ -85,12 +85,12 @@
85
85
  display: flex;
86
86
  }
87
87
 
88
- .fileName-CHIc8 {
88
+ .ui0-7-0-fileName-CHIc8 {
89
89
  overflow-wrap: anywhere;
90
90
  min-width: 0;
91
91
  }
92
92
 
93
- .rejection-mI7_p {
93
+ .ui0-7-0-rejection-mI7_p {
94
94
  margin: 0;
95
95
  }
96
96
 
@@ -1,6 +1,6 @@
1
1
  import "./ViewField_module.css";
2
2
  const ViewField_module = {
3
- root: "root-aO02E",
4
- group: "group-qyjwG"
3
+ root: "ui0-7-0-root-aO02E",
4
+ group: "ui0-7-0-group-qyjwG"
5
5
  };
6
6
  export default ViewField_module;
@@ -1,15 +1,15 @@
1
- .root-aO02E {
1
+ .ui0-7-0-root-aO02E {
2
2
  margin: 0;
3
3
  }
4
4
 
5
- .group-qyjwG {
5
+ .ui0-7-0-group-qyjwG {
6
6
  gap: var(--space-1);
7
7
  overflow-wrap: anywhere;
8
8
  flex-direction: column;
9
9
  display: flex;
10
10
  }
11
11
 
12
- .group-qyjwG[data-layout="inline"] {
12
+ .ui0-7-0-group-qyjwG[data-layout="inline"] {
13
13
  align-items: baseline;
14
14
  gap: var(--space-1) var(--space-3);
15
15
  flex-flow: wrap;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Internal, not exported from `src/index.ts`. A value the caller may control: theirs while
3
+ * `controlledValue` is defined (`null` included, which is a value), otherwise one held here from
4
+ * `defaultValue`. A component that must know its value even when it does not own it (to mark the
5
+ * chosen card, to submit to a `Form`) reads it from here.
6
+ *
7
+ * The setter changes the held value and does nothing while the caller controls it, so a change
8
+ * handler sets it and reports the change without a branch of its own. The setter is a new function
9
+ * every render, so it must not go in a dependency array.
10
+ */
11
+ export declare function useControllable<Value>(controlledValue: Value | undefined, defaultValue: Value): [Value, (nextValue: Value) => void];
@@ -0,0 +1,13 @@
1
+ import { useState } from "react";
2
+ function useControllable(controlledValue, defaultValue) {
3
+ const [heldValue, setHeldValue] = useState(defaultValue);
4
+ const controlled = void 0 !== controlledValue;
5
+ function setValue(nextValue) {
6
+ if (!controlled) setHeldValue(nextValue);
7
+ }
8
+ return [
9
+ controlled ? controlledValue : heldValue,
10
+ setValue
11
+ ];
12
+ }
13
+ export { useControllable };
@@ -0,0 +1,30 @@
1
+ import { type FocusEvent } from 'react';
2
+ interface IndexedOption {
3
+ value: string;
4
+ disabled?: boolean;
5
+ }
6
+ /**
7
+ * Internal, not exported from `src/index.ts`. What `Segmented` and `ToggleChipGroup` share on top
8
+ * of Base UI's `ToggleGroup`.
9
+ *
10
+ * Each option is heard by its index, because Base UI's `Toggle` takes `''` for no value at all and
11
+ * generates an id instead: `groupValue` turns the pressed indexes into the group's value, and
12
+ * `optionsAt` reads a new value back as options, in the options' order.
13
+ *
14
+ * Tab lands on the option at `tabStopIndex`. Base UI's `ToggleGroup` has no prop for that and roves
15
+ * from the first enabled option, so while focus is outside the group each `Toggle` is told its
16
+ * `tabIndex` (spread `itemProps` on it, and hand `onGroupBlur` to an element holding them all).
17
+ * Inside the group Base UI roves as usual: an override there would leave the stop's option as a
18
+ * second stop on the way out. A disabled option cannot take focus, so Base UI decides then too, as
19
+ * it does for a `tabStopIndex` of -1.
20
+ */
21
+ export declare function useIndexedToggleGroup<Option extends IndexedOption>(options: readonly Option[], tabStopIndex: number): {
22
+ groupValue: (pressedIndexes: readonly number[]) => string[];
23
+ optionsAt: (nextIndexes: readonly string[]) => Option[];
24
+ onGroupBlur: (event: FocusEvent<HTMLElement>) => void;
25
+ itemProps: (option: Option, index: number) => {
26
+ tabIndex?: number | undefined;
27
+ onFocus: () => void;
28
+ };
29
+ };
30
+ export {};
@@ -0,0 +1,26 @@
1
+ import { useState } from "react";
2
+ function useIndexedToggleGroup(options, tabStopIndex) {
3
+ const [focusedValue, setFocusedValue] = useState(null);
4
+ const focusIsInside = options.some((option)=>option.value === focusedValue && !option.disabled);
5
+ const tabStopOption = options[tabStopIndex];
6
+ const placesTabStop = !focusIsInside && void 0 !== tabStopOption && !tabStopOption.disabled;
7
+ return {
8
+ groupValue: (pressedIndexes)=>pressedIndexes.map(String),
9
+ optionsAt: (nextIndexes)=>nextIndexes.map(Number).sort((first, second)=>first - second).flatMap((index)=>{
10
+ const option = options[index];
11
+ return option ? [
12
+ option
13
+ ] : [];
14
+ }),
15
+ onGroupBlur: (event)=>{
16
+ if (!event.currentTarget.contains(event.relatedTarget)) setFocusedValue(null);
17
+ },
18
+ itemProps: (option, index)=>({
19
+ onFocus: ()=>setFocusedValue(option.value),
20
+ ...placesTabStop ? {
21
+ tabIndex: index === tabStopIndex ? 0 : -1
22
+ } : null
23
+ })
24
+ };
25
+ }
26
+ export { useIndexedToggleGroup };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Internal, not exported from `src/index.ts`. Reports whether an element's content overflows its
3
+ * box in either direction (`scrollHeight > clientHeight` or `scrollWidth > clientWidth`), so a
4
+ * scrolling region with nothing focusable inside it can be made a Tab stop while, and only while,
5
+ * it scrolls (WCAG 2.1.1: Safari does not make a scroller focusable on its own). Returns a
6
+ * callback ref for the element and the current answer.
7
+ *
8
+ * A ResizeObserver watches the element and each of its children, so the answer follows both the
9
+ * box (a resized viewport) and the content (a paragraph that grows); a MutationObserver measures
10
+ * again when text or children change, watching the children that arrive and letting go of the
11
+ * ones that leave. Where there is no ResizeObserver the answer stays `false`, and the element is
12
+ * left as it was.
13
+ */
14
+ export declare function useOverflowFocusable<Target extends HTMLElement>(): [
15
+ (element: Target | null) => void,
16
+ boolean
17
+ ];
@@ -0,0 +1,36 @@
1
+ import { useEffect, useState } from "react";
2
+ function useOverflowFocusable() {
3
+ const [element, setElement] = useState(null);
4
+ const [overflowing, setOverflowing] = useState(false);
5
+ useEffect(()=>{
6
+ if (null === element || "u" < typeof ResizeObserver) return;
7
+ const measure = ()=>setOverflowing(element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth);
8
+ const resizeObserver = new ResizeObserver(measure);
9
+ resizeObserver.observe(element);
10
+ for (const child of Array.from(element.children))resizeObserver.observe(child);
11
+ const mutationObserver = "u" < typeof MutationObserver ? null : new MutationObserver((records)=>{
12
+ for (const record of records)if (record.target === element) {
13
+ for (const node of Array.from(record.addedNodes))if (node instanceof Element) resizeObserver.observe(node);
14
+ for (const node of Array.from(record.removedNodes))if (node instanceof Element) resizeObserver.unobserve(node);
15
+ }
16
+ measure();
17
+ });
18
+ mutationObserver?.observe(element, {
19
+ childList: true,
20
+ characterData: true,
21
+ subtree: true
22
+ });
23
+ return ()=>{
24
+ setOverflowing(false);
25
+ resizeObserver.disconnect();
26
+ mutationObserver?.disconnect();
27
+ };
28
+ }, [
29
+ element
30
+ ]);
31
+ return [
32
+ setElement,
33
+ null !== element && overflowing
34
+ ];
35
+ }
36
+ export { useOverflowFocusable };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The library's search glyph, drawn in `CloseIcon`'s style: a 16-unit box, a 1.5 stroke in the
3
+ * current colour and round caps. `SearchField` leads with it.
4
+ *
5
+ * Internal on purpose, for the reason `CloseIcon` records: the barrel does not export it, it is
6
+ * decorative (the field around it carries the accessible name, so it is `aria-hidden` and not
7
+ * focusable) and it declares no size, because the holder sizes it.
8
+ */
9
+ export declare function SearchIcon(): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ function SearchIcon() {
3
+ return /*#__PURE__*/ jsxs("svg", {
4
+ viewBox: "0 0 16 16",
5
+ fill: "none",
6
+ stroke: "currentColor",
7
+ strokeWidth: "1.5",
8
+ strokeLinecap: "round",
9
+ "aria-hidden": "true",
10
+ focusable: "false",
11
+ children: [
12
+ /*#__PURE__*/ jsx("circle", {
13
+ cx: "7",
14
+ cy: "7",
15
+ r: "4.5"
16
+ }),
17
+ /*#__PURE__*/ jsx("path", {
18
+ d: "m10.5 10.5 3 3"
19
+ })
20
+ ]
21
+ });
22
+ }
23
+ export { SearchIcon };
package/dist/index.d.ts CHANGED
@@ -96,3 +96,29 @@ export { createDataGridColumnHelper } from './components/DataGrid/columns.js';
96
96
  export type { DataGridColumnDef } from './components/DataGrid/columns.js';
97
97
  export type { DataGridProps, DataGridQuery, DataGridFilterValue, DataGridDensity, DataGridMode, DataGridRowEvent, } from './components/DataGrid/types.js';
98
98
  export type { DataGridLabels } from './components/DataGrid/labels.js';
99
+ export { ThemeScope } from './components/ThemeScope/ThemeScope.js';
100
+ export { usePortalContainer } from './components/ThemeScope/PortalContainerContext.js';
101
+ export type { ThemeScopeProps, ThemeMode } from './components/ThemeScope/ThemeScope.js';
102
+ export type { PortalContainer } from './components/ThemeScope/PortalContainerContext.js';
103
+ export type { ButtonTone } from './components/Button/Button.js';
104
+ export { SearchField } from './components/SearchField/SearchField.js';
105
+ export type { SearchFieldProps } from './components/SearchField/SearchField.js';
106
+ export { avatarColorIndex, AVATAR_COLOR_COUNT } from './components/Avatar/avatarColor.js';
107
+ export type { AvatarColorIndex } from './components/Avatar/avatarColor.js';
108
+ export type { AvatarSize } from './components/Avatar/Avatar.js';
109
+ export { Collapsible } from './components/Collapsible/Collapsible.js';
110
+ export type { CollapsibleProps } from './components/Collapsible/Collapsible.js';
111
+ export { TabBar } from './components/TabBar/TabBar.js';
112
+ export type { TabBarProps, TabBarItem } from './components/TabBar/TabBar.js';
113
+ export { EmptyState } from './components/EmptyState/EmptyState.js';
114
+ export type { EmptyStateProps } from './components/EmptyState/EmptyState.js';
115
+ export { AvatarGroup } from './components/AvatarGroup/AvatarGroup.js';
116
+ export type { AvatarGroupProps, AvatarGroupItem } from './components/AvatarGroup/AvatarGroup.js';
117
+ export { ChoiceCard } from './components/ChoiceCard/ChoiceCard.js';
118
+ export type { ChoiceCardProps, ChoiceCardOption } from './components/ChoiceCard/ChoiceCard.js';
119
+ export { ToggleChip } from './components/ToggleChip/ToggleChip.js';
120
+ export { ToggleChipGroup } from './components/ToggleChip/ToggleChipGroup.js';
121
+ export type { ToggleChipProps } from './components/ToggleChip/ToggleChip.js';
122
+ export type { ToggleChipGroupProps, ToggleChipOption, ToggleChipGroupSingleProps, ToggleChipGroupMultipleProps, } from './components/ToggleChip/ToggleChipGroup.js';
123
+ export { ProgressBar } from './components/ProgressBar/ProgressBar.js';
124
+ export type { ProgressBarProps } from './components/ProgressBar/ProgressBar.js';
package/dist/index.js CHANGED
@@ -47,3 +47,15 @@ export { CardList } from "./components/CardList/CardList.js";
47
47
  export { Timeline } from "./components/Timeline/Timeline.js";
48
48
  export { DataGrid } from "./components/DataGrid/DataGrid.js";
49
49
  export { createDataGridColumnHelper } from "./components/DataGrid/columns.js";
50
+ export { ThemeScope } from "./components/ThemeScope/ThemeScope.js";
51
+ export { usePortalContainer } from "./components/ThemeScope/PortalContainerContext.js";
52
+ export { SearchField } from "./components/SearchField/SearchField.js";
53
+ export { AVATAR_COLOR_COUNT, avatarColorIndex } from "./components/Avatar/avatarColor.js";
54
+ export { Collapsible } from "./components/Collapsible/Collapsible.js";
55
+ export { TabBar } from "./components/TabBar/TabBar.js";
56
+ export { EmptyState } from "./components/EmptyState/EmptyState.js";
57
+ export { AvatarGroup } from "./components/AvatarGroup/AvatarGroup.js";
58
+ export { ChoiceCard } from "./components/ChoiceCard/ChoiceCard.js";
59
+ export { ToggleChip } from "./components/ToggleChip/ToggleChip.js";
60
+ export { ToggleChipGroup } from "./components/ToggleChip/ToggleChipGroup.js";
61
+ export { ProgressBar } from "./components/ProgressBar/ProgressBar.js";
@@ -1,5 +1,5 @@
1
1
  import "./a11y_module.css";
2
2
  const a11y_module = {
3
- visuallyHidden: "visuallyHidden-mBQuJ"
3
+ visuallyHidden: "ui0-7-0-visuallyHidden-mBQuJ"
4
4
  };
5
5
  export default a11y_module;
@@ -1,4 +1,4 @@
1
- .visuallyHidden-mBQuJ {
1
+ .ui0-7-0-visuallyHidden-mBQuJ {
2
2
  clip-path: inset(50%);
3
3
  white-space: nowrap;
4
4
  border: 0;
@@ -47,6 +47,23 @@ h3 {
47
47
  margin: 0;
48
48
  }
49
49
 
50
+ h1,
51
+ h2,
52
+ h3,
53
+ h4,
54
+ h5,
55
+ h6 {
56
+ font-family: var(--font-display);
57
+ }
58
+
59
+ /* The user agent's block margins go from the lower levels too, as from `h1`–`h3` above, so a
60
+ component's `h4` (a `Dialog` or an `Alert` one level down) sits where its `h3` would. */
61
+ h4,
62
+ h5,
63
+ h6 {
64
+ margin: 0;
65
+ }
66
+
50
67
  p {
51
68
  margin: 0;
52
69
  max-width: var(--measure);
@@ -0,0 +1,5 @@
1
+ import "./closeCircle_module.css";
2
+ const closeCircle_module = {
3
+ close: "ui0-7-0-close-KRRaE"
4
+ };
5
+ export default closeCircle_module;
@@ -0,0 +1,12 @@
1
+ .ui0-7-0-close-KRRaE[data-variant][data-size] {
2
+ min-height: var(--size-close);
3
+ min-width: var(--size-close);
4
+ position: relative;
5
+ }
6
+
7
+ .ui0-7-0-close-KRRaE[data-variant][data-size]:before {
8
+ content: "";
9
+ inset: calc(50% - var(--size-touch) / 2);
10
+ position: absolute;
11
+ }
12
+
@@ -1,15 +1,18 @@
1
1
  import "./field_module.css";
2
2
  const field_module = {
3
- frame: "frame-J0Ojt",
4
- inlineFrame: "inlineFrame-zSCRB",
5
- label: "label-biJfU",
6
- legend: "legend-de1mj",
7
- required: "required-Gk1aH",
8
- optionLabel: "optionLabel-iP92d",
9
- options: "options-hWZ0_",
10
- description: "description-nT8MY",
11
- error: "error-WHv_B",
12
- control: "control-Hqf8o",
13
- controlBox: "controlBox-m9xtL"
3
+ frame: "ui0-7-0-frame-J0Ojt",
4
+ inlineFrame: "ui0-7-0-inlineFrame-zSCRB",
5
+ label: "ui0-7-0-label-biJfU",
6
+ legend: "ui0-7-0-legend-de1mj",
7
+ required: "ui0-7-0-required-Gk1aH",
8
+ optionLabel: "ui0-7-0-optionLabel-iP92d",
9
+ options: "ui0-7-0-options-hWZ0_",
10
+ description: "ui0-7-0-description-nT8MY",
11
+ error: "ui0-7-0-error-WHv_B",
12
+ control: "ui0-7-0-control-Hqf8o",
13
+ affix: "ui0-7-0-affix-P3VuY",
14
+ affixInput: "ui0-7-0-affixInput-VUm8c",
15
+ affixIcon: "ui0-7-0-affixIcon-_yYxW",
16
+ controlBox: "ui0-7-0-controlBox-m9xtL"
14
17
  };
15
18
  export default field_module;