@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,82 +1,88 @@
1
- .frame-J0Ojt, .inlineFrame-zSCRB {
1
+ .ui0-7-0-frame-J0Ojt, .ui0-7-0-inlineFrame-zSCRB {
2
2
  gap: var(--space-2);
3
3
  flex-direction: column;
4
4
  display: flex;
5
5
  }
6
6
 
7
- .inlineFrame-zSCRB {
7
+ .ui0-7-0-inlineFrame-zSCRB {
8
8
  gap: var(--space-1);
9
9
  }
10
10
 
11
- .label-biJfU, .legend-de1mj {
11
+ .ui0-7-0-label-biJfU, .ui0-7-0-legend-de1mj {
12
12
  align-items: center;
13
13
  gap: var(--space-1);
14
14
  color: var(--color-text);
15
+ font-family: var(--font-sans);
15
16
  font-size: var(--text-sm);
16
- font-weight: 500;
17
+ font-weight: var(--font-weight-label);
17
18
  line-height: var(--leading-snug);
18
19
  display: flex;
19
20
  }
20
21
 
21
- .label-biJfU[data-disabled], .legend-de1mj[data-disabled] {
22
+ .ui0-7-0-label-biJfU[data-disabled], .ui0-7-0-legend-de1mj[data-disabled] {
22
23
  color: var(--color-text-muted);
23
24
  }
24
25
 
25
- .required-Gk1aH {
26
+ .ui0-7-0-required-Gk1aH {
26
27
  color: var(--color-danger);
27
28
  }
28
29
 
29
- .required-Gk1aH:after {
30
+ .ui0-7-0-required-Gk1aH:after {
30
31
  content: "*";
31
32
  }
32
33
 
33
- .optionLabel-iP92d {
34
+ .ui0-7-0-optionLabel-iP92d {
34
35
  align-items: center;
35
36
  gap: var(--space-3);
36
37
  color: var(--color-text);
38
+ font-family: var(--font-sans);
37
39
  font-size: var(--text-md);
38
40
  line-height: var(--leading-snug);
39
41
  cursor: pointer;
40
42
  display: flex;
41
43
  }
42
44
 
43
- .optionLabel-iP92d[data-disabled] {
45
+ .ui0-7-0-optionLabel-iP92d[data-disabled] {
44
46
  cursor: not-allowed;
45
47
  color: var(--color-text-muted);
46
48
  }
47
49
 
48
- .options-hWZ0_ {
50
+ .ui0-7-0-options-hWZ0_ {
49
51
  gap: var(--space-2);
50
52
  flex-direction: column;
51
53
  display: flex;
52
54
  }
53
55
 
54
- .options-hWZ0_[data-orientation="horizontal"] {
56
+ .ui0-7-0-options-hWZ0_[data-orientation="horizontal"] {
55
57
  gap: var(--space-4);
56
58
  flex-flow: wrap;
57
59
  }
58
60
 
59
- .description-nT8MY {
61
+ .ui0-7-0-description-nT8MY {
60
62
  color: var(--color-text-muted);
63
+ font-family: var(--font-body);
64
+ font-weight: var(--font-weight-body);
61
65
  font-size: var(--text-sm);
62
66
  line-height: var(--leading-prose);
63
67
  margin: 0;
64
68
  }
65
69
 
66
- .error-WHv_B {
70
+ .ui0-7-0-error-WHv_B {
67
71
  color: var(--color-danger);
68
72
  font-size: var(--text-sm);
69
73
  line-height: var(--leading-snug);
70
74
  }
71
75
 
72
- .control-Hqf8o {
76
+ .ui0-7-0-control-Hqf8o {
73
77
  width: 100%;
74
78
  min-height: var(--size-touch);
75
79
  padding: var(--space-2) var(--space-3);
76
80
  border: 1px solid var(--color-border-strong);
77
- border-radius: var(--radius-md);
81
+ border-radius: var(--radius-control);
78
82
  background: var(--color-surface-input);
79
83
  color: var(--color-text);
84
+ font-family: var(--font-body);
85
+ font-weight: var(--font-weight-body);
80
86
  font-size: var(--text-md);
81
87
  line-height: var(--leading-snug);
82
88
  transition-property: border-color, background-color;
@@ -86,25 +92,88 @@
86
92
  display: flex;
87
93
  }
88
94
 
89
- .control-Hqf8o::placeholder {
95
+ .ui0-7-0-control-Hqf8o::placeholder {
90
96
  color: var(--color-text-subtle);
91
97
  }
92
98
 
93
- .control-Hqf8o:focus-visible {
99
+ .ui0-7-0-control-Hqf8o:focus-visible {
94
100
  border-color: var(--color-accent);
95
101
  }
96
102
 
97
- .control-Hqf8o[data-invalid] {
103
+ .ui0-7-0-control-Hqf8o[data-invalid] {
98
104
  border-color: var(--color-danger-border);
99
105
  background: var(--color-danger-surface);
100
106
  }
101
107
 
102
- .control-Hqf8o[data-disabled] {
108
+ .ui0-7-0-control-Hqf8o[data-disabled] {
103
109
  cursor: not-allowed;
104
110
  opacity: .55;
105
111
  }
106
112
 
107
- .controlBox-m9xtL {
113
+ .ui0-7-0-affix-P3VuY {
114
+ gap: var(--space-2);
115
+ cursor: text;
116
+ }
117
+
118
+ .ui0-7-0-affix-P3VuY:has( > .ui0-7-0-affixInput-VUm8c:focus-visible) {
119
+ border-color: var(--color-accent);
120
+ outline: var(--focus-ring-width) solid var(--color-focus);
121
+ outline-offset: var(--focus-ring-offset);
122
+ }
123
+
124
+ .ui0-7-0-affix-P3VuY:has( > .ui0-7-0-affixInput-VUm8c[data-invalid]) {
125
+ border-color: var(--color-danger-border);
126
+ background: var(--color-danger-surface);
127
+ }
128
+
129
+ .ui0-7-0-affix-P3VuY:has( > .ui0-7-0-affixInput-VUm8c[data-disabled]) {
130
+ cursor: not-allowed;
131
+ opacity: .55;
132
+ }
133
+
134
+ .ui0-7-0-affixInput-VUm8c {
135
+ background: none;
136
+ border: 0;
137
+ flex: 1;
138
+ align-self: stretch;
139
+ min-width: 0;
140
+ padding: 0;
141
+ }
142
+
143
+ @supports selector(:has(*)) {
144
+ .ui0-7-0-affixInput-VUm8c:focus-visible {
145
+ outline: none;
146
+ }
147
+ }
148
+
149
+ .ui0-7-0-affixInput-VUm8c:disabled {
150
+ cursor: not-allowed;
151
+ }
152
+
153
+ .ui0-7-0-affix-P3VuY[data-icon-opens-picker] > .ui0-7-0-affixInput-VUm8c::-webkit-calendar-picker-indicator {
154
+ display: none;
155
+ }
156
+
157
+ .ui0-7-0-affixInput-VUm8c::placeholder {
158
+ color: var(--color-text-subtle);
159
+ }
160
+
161
+ .ui0-7-0-affixIcon-_yYxW {
162
+ color: var(--color-text-muted);
163
+ flex: none;
164
+ display: inline-flex;
165
+ }
166
+
167
+ .ui0-7-0-affixIcon-_yYxW > svg {
168
+ width: 1rem;
169
+ height: 1rem;
170
+ }
171
+
172
+ .ui0-7-0-affix-P3VuY[data-icon-opens-picker]:not(:has( > .ui0-7-0-affixInput-VUm8c[data-disabled])) > .ui0-7-0-affixIcon-_yYxW {
173
+ cursor: pointer;
174
+ }
175
+
176
+ .ui0-7-0-controlBox-m9xtL {
108
177
  border: 1px solid var(--color-border-strong);
109
178
  background: var(--color-surface-input);
110
179
  cursor: pointer;
@@ -117,16 +186,16 @@
117
186
  display: inline-flex;
118
187
  }
119
188
 
120
- .controlBox-m9xtL[data-checked], .controlBox-m9xtL[data-indeterminate] {
189
+ .ui0-7-0-controlBox-m9xtL[data-checked], .ui0-7-0-controlBox-m9xtL[data-indeterminate] {
121
190
  border-color: var(--color-accent);
122
191
  background: var(--color-accent);
123
192
  }
124
193
 
125
- .controlBox-m9xtL[data-invalid] {
194
+ .ui0-7-0-controlBox-m9xtL[data-invalid] {
126
195
  border-color: var(--color-danger-border);
127
196
  }
128
197
 
129
- .controlBox-m9xtL[data-disabled] {
198
+ .ui0-7-0-controlBox-m9xtL[data-disabled] {
130
199
  cursor: not-allowed;
131
200
  opacity: .55;
132
201
  }
@@ -1,6 +1,6 @@
1
1
  import "./pair_module.css";
2
2
  const pair_module = {
3
- label: "label-cvNZv",
4
- value: "value-E8RzY"
3
+ label: "ui0-7-0-label-cvNZv",
4
+ value: "ui0-7-0-value-E8RzY"
5
5
  };
6
6
  export default pair_module;
@@ -1,18 +1,20 @@
1
- .label-cvNZv {
1
+ .ui0-7-0-label-cvNZv {
2
2
  color: var(--color-text-muted);
3
3
  font-size: var(--text-sm);
4
4
  line-height: var(--leading-snug);
5
5
  }
6
6
 
7
- .value-E8RzY {
7
+ .ui0-7-0-value-E8RzY {
8
8
  min-width: 0;
9
9
  color: var(--color-text);
10
+ font-family: var(--font-body);
11
+ font-weight: var(--font-weight-body);
10
12
  font-size: var(--text-md);
11
13
  line-height: var(--leading-snug);
12
14
  margin: 0;
13
15
  }
14
16
 
15
- .value-E8RzY[data-empty] {
17
+ .ui0-7-0-value-E8RzY[data-empty] {
16
18
  color: var(--color-text-muted);
17
19
  }
18
20
 
@@ -1,9 +1,9 @@
1
1
  import "./popup_module.css";
2
2
  const popup_module = {
3
- layer: "layer-l8dxw",
4
- dialogLayer: "dialogLayer-lHsEi",
5
- toastLayer: "toastLayer-A8Jfk",
6
- surface: "surface-_qTRv",
7
- scrim: "scrim-HnQwr"
3
+ layer: "ui0-7-0-layer-l8dxw",
4
+ dialogLayer: "ui0-7-0-dialogLayer-lHsEi",
5
+ toastLayer: "ui0-7-0-toastLayer-A8Jfk",
6
+ surface: "ui0-7-0-surface-_qTRv",
7
+ scrim: "ui0-7-0-scrim-HnQwr"
8
8
  };
9
9
  export default popup_module;
@@ -1,22 +1,22 @@
1
- .layer-l8dxw, .dialogLayer-lHsEi {
1
+ .ui0-7-0-layer-l8dxw, .ui0-7-0-dialogLayer-lHsEi {
2
2
  z-index: 50;
3
3
  }
4
4
 
5
- .toastLayer-A8Jfk {
5
+ .ui0-7-0-toastLayer-A8Jfk {
6
6
  z-index: 70;
7
7
  }
8
8
 
9
- .surface-_qTRv {
9
+ .ui0-7-0-surface-_qTRv {
10
10
  gap: var(--space-2);
11
11
  max-width: var(--available-width);
12
12
  max-height: var(--available-height);
13
13
  padding: var(--space-2);
14
14
  overscroll-behavior: contain;
15
15
  border: 1px solid var(--color-border);
16
- border-radius: var(--radius-lg);
16
+ border-radius: var(--radius-popup);
17
17
  background: var(--color-surface-raised);
18
18
  color: var(--color-text);
19
- box-shadow: var(--elevation-2);
19
+ box-shadow: var(--shadow-raised);
20
20
  transform-origin: var(--transform-origin);
21
21
  transition-property: opacity, transform;
22
22
  transition-duration: var(--motion-duration-2);
@@ -26,75 +26,78 @@
26
26
  overflow-y: auto;
27
27
  }
28
28
 
29
- .surface-_qTRv[data-popup="popover"] {
29
+ .ui0-7-0-surface-_qTRv[data-popup="popover"] {
30
30
  gap: var(--space-3);
31
31
  min-width: 14rem;
32
32
  padding: var(--space-4);
33
33
  }
34
34
 
35
- .surface-_qTRv[data-popup="menu"] {
35
+ .ui0-7-0-surface-_qTRv[data-popup="menu"] {
36
36
  gap: 0;
37
37
  min-width: 12rem;
38
38
  }
39
39
 
40
- .surface-_qTRv[data-popup="tooltip"] {
40
+ .ui0-7-0-surface-_qTRv[data-popup="tooltip"] {
41
41
  max-width: min(18rem, var(--available-width));
42
42
  padding: var(--space-2) var(--space-3);
43
+ font-family: var(--font-body);
44
+ font-weight: var(--font-weight-body);
43
45
  font-size: var(--text-sm);
44
46
  }
45
47
 
46
- .surface-_qTRv[data-popup="dialog"] {
48
+ .ui0-7-0-surface-_qTRv[data-popup="dialog"] {
47
49
  gap: var(--space-4);
48
50
  width: min(32rem, 100%);
49
51
  max-width: 100%;
50
- max-height: 85dvh;
52
+ max-height: 85%;
51
53
  padding: var(--space-5);
52
- border-radius: var(--radius-xl);
53
- box-shadow: var(--elevation-3);
54
+ border-radius: var(--radius-dialog);
55
+ box-shadow: var(--shadow-dialog);
54
56
  }
55
57
 
56
- .surface-_qTRv[data-popup="sheet"] {
58
+ .ui0-7-0-surface-_qTRv[data-popup="sheet"] {
57
59
  gap: var(--space-4);
58
60
  width: 100%;
59
61
  max-width: 100%;
60
- max-height: 85dvh;
62
+ max-height: 85%;
61
63
  padding: var(--space-5);
62
- border-radius: var(--radius-xl) var(--radius-xl) 0 0;
63
- box-shadow: var(--elevation-3);
64
+ border-radius: var(--radius-dialog) var(--radius-dialog) 0 0;
65
+ box-shadow: var(--shadow-sheet);
64
66
  }
65
67
 
66
- .surface-_qTRv[data-popup="select"] {
68
+ .ui0-7-0-surface-_qTRv[data-popup="select"] {
67
69
  min-width: max(var(--anchor-width), 10rem);
68
70
  padding: var(--space-1);
69
71
  gap: 0;
70
72
  }
71
73
 
72
- .surface-_qTRv[data-starting-style], .surface-_qTRv[data-ending-style] {
74
+ .ui0-7-0-surface-_qTRv[data-starting-style], .ui0-7-0-surface-_qTRv[data-ending-style] {
73
75
  opacity: 0;
74
76
  transform: scale(.96);
75
77
  }
76
78
 
77
- .surface-_qTRv[data-popup="sheet"][data-starting-style], .surface-_qTRv[data-popup="sheet"][data-ending-style] {
79
+ .ui0-7-0-surface-_qTRv[data-popup="sheet"][data-starting-style], .ui0-7-0-surface-_qTRv[data-popup="sheet"][data-ending-style] {
78
80
  opacity: 1;
79
81
  transform: translateY(100%);
80
82
  }
81
83
 
82
- .surface-_qTRv[data-popup="sheet"][data-side="end"] {
83
- border-radius: 0;
84
- width: min(28rem, 100%);
85
- height: 100dvh;
86
- max-height: 100dvh;
84
+ .ui0-7-0-surface-_qTRv[data-popup="sheet"][data-side="end"] {
85
+ width: min(var(--size-drawer), 100%);
86
+ border-radius: var(--radius-dialog) 0 0 var(--radius-dialog);
87
+ height: 100%;
88
+ max-height: 100%;
89
+ box-shadow: var(--shadow-drawer);
87
90
  }
88
91
 
89
- .surface-_qTRv[data-popup="sheet"][data-side="end"][data-starting-style], .surface-_qTRv[data-popup="sheet"][data-side="end"][data-ending-style] {
92
+ .ui0-7-0-surface-_qTRv[data-popup="sheet"][data-side="end"][data-starting-style], .ui0-7-0-surface-_qTRv[data-popup="sheet"][data-side="end"][data-ending-style] {
90
93
  transform: translateX(100%);
91
94
  }
92
95
 
93
- .surface-_qTRv[data-instant] {
96
+ .ui0-7-0-surface-_qTRv[data-instant] {
94
97
  transition-property: none;
95
98
  }
96
99
 
97
- .scrim-HnQwr {
100
+ .ui0-7-0-scrim-HnQwr {
98
101
  background: var(--color-scrim);
99
102
  transition-property: opacity;
100
103
  transition-duration: var(--motion-duration-2);
@@ -103,7 +106,11 @@
103
106
  inset: 0;
104
107
  }
105
108
 
106
- .scrim-HnQwr[data-starting-style], .scrim-HnQwr[data-ending-style] {
109
+ .ui0-7-0-scrim-HnQwr[data-variant="sheet"][data-side="bottom"] {
110
+ background: var(--color-scrim-sheet);
111
+ }
112
+
113
+ .ui0-7-0-scrim-HnQwr[data-starting-style], .ui0-7-0-scrim-HnQwr[data-ending-style] {
107
114
  opacity: 0;
108
115
  }
109
116
 
@@ -0,0 +1,12 @@
1
+ import type { MouseEvent } from 'react';
2
+ /**
3
+ * Internal, not exported from `src/index.ts`. The `mousedown` handler of a pill that wraps an
4
+ * input (`AffixInput`, `SearchField`). The input is one line tall inside a taller pill, so a press
5
+ * on the glyph or above and below the text would focus nothing. Cancelling the press and focusing
6
+ * the input puts the caret where a bare input's whole-box press would. The input and any button
7
+ * inside keep their own presses, so a caret placed by pointer, a selection drag, a native picker
8
+ * button and a clear control all behave as they do without the pill.
9
+ *
10
+ * Returns whether the press was taken over, so a caller can do more with it.
11
+ */
12
+ export declare function focusInputFromPill(event: MouseEvent<HTMLElement>, input: HTMLElement | null): boolean;
@@ -0,0 +1,7 @@
1
+ function focusInputFromPill(event, input) {
2
+ if (event.target instanceof Element && null !== event.target.closest('input, button')) return false;
3
+ event.preventDefault();
4
+ input?.focus();
5
+ return true;
6
+ }
7
+ export { focusInputFromPill };
@@ -0,0 +1,8 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * Internal, not exported from `src/index.ts`. Whether a slot holds something React draws: `true`,
4
+ * `false`, `null` and `undefined` render nothing, and `''` renders an empty text node, so none of
5
+ * them may leave an empty wrapper, a separating space or a dangling `aria-describedby` behind. `0`
6
+ * is drawn (a count) and counts as content.
7
+ */
8
+ export declare function hasContent(node: ReactNode): boolean;
@@ -0,0 +1,4 @@
1
+ function hasContent(node) {
2
+ return null != node && '' !== node && 'boolean' != typeof node;
3
+ }
4
+ export { hasContent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcifer-design/ui",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@base-ui/react": "^1.8.0",
44
- "@calcifer-design/tokens": "^0.2.0",
44
+ "@calcifer-design/tokens": "^0.3.0",
45
45
  "@tanstack/react-table": "^9.2.4",
46
46
  "@tanstack/react-virtual": "^3.14.21"
47
47
  },