@oxyhq/bloom 0.17.0 → 0.18.1

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 (245) hide show
  1. package/lib/commonjs/admonition/index.js +24 -23
  2. package/lib/commonjs/admonition/index.js.map +1 -1
  3. package/lib/commonjs/combobox/Combobox.js +7 -7
  4. package/lib/commonjs/combobox/Combobox.js.map +1 -1
  5. package/lib/commonjs/context-menu/context.js +2 -2
  6. package/lib/commonjs/context-menu/context.js.map +1 -1
  7. package/lib/commonjs/context-menu/index.js +25 -25
  8. package/lib/commonjs/context-menu/index.js.map +1 -1
  9. package/lib/commonjs/context-menu/index.web.js +27 -27
  10. package/lib/commonjs/context-menu/index.web.js.map +1 -1
  11. package/lib/commonjs/dialog/SheetShell.js +1 -1
  12. package/lib/commonjs/index.js +134 -38
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/index.web.js +134 -38
  15. package/lib/commonjs/index.web.js.map +1 -1
  16. package/lib/commonjs/input-group/InputGroup.js +1 -1
  17. package/lib/commonjs/menu/context.js +2 -2
  18. package/lib/commonjs/menu/context.js.map +1 -1
  19. package/lib/commonjs/menu/index.js +17 -17
  20. package/lib/commonjs/menu/index.js.map +1 -1
  21. package/lib/commonjs/menu/index.web.js +16 -16
  22. package/lib/commonjs/menu/index.web.js.map +1 -1
  23. package/lib/commonjs/popover/context.js +1 -1
  24. package/lib/commonjs/popover/context.js.map +1 -1
  25. package/lib/commonjs/popover/index.js +6 -6
  26. package/lib/commonjs/popover/index.js.map +1 -1
  27. package/lib/commonjs/popover/index.web.js +6 -6
  28. package/lib/commonjs/popover/index.web.js.map +1 -1
  29. package/lib/commonjs/search-input/index.js +4 -5
  30. package/lib/commonjs/search-input/index.js.map +1 -1
  31. package/lib/commonjs/segmented-control/index.js +18 -18
  32. package/lib/commonjs/segmented-control/index.js.map +1 -1
  33. package/lib/commonjs/select/common.js +2 -2
  34. package/lib/commonjs/select/common.js.map +1 -1
  35. package/lib/commonjs/select/index.js +34 -38
  36. package/lib/commonjs/select/index.js.map +1 -1
  37. package/lib/commonjs/select/index.web.js +31 -35
  38. package/lib/commonjs/select/index.web.js.map +1 -1
  39. package/lib/commonjs/tabs/Tabs.js +7 -7
  40. package/lib/commonjs/tabs/Tabs.js.map +1 -1
  41. package/lib/commonjs/tabs/index.js +6 -6
  42. package/lib/commonjs/text-field/index.js +14 -14
  43. package/lib/commonjs/text-field/index.js.map +1 -1
  44. package/lib/commonjs/theme/color-scope/style-builder.js +6 -6
  45. package/lib/commonjs/tooltip/index.js +11 -11
  46. package/lib/commonjs/tooltip/index.js.map +1 -1
  47. package/lib/commonjs/tooltip/index.web.js +11 -11
  48. package/lib/commonjs/tooltip/index.web.js.map +1 -1
  49. package/lib/module/admonition/index.js +18 -17
  50. package/lib/module/admonition/index.js.map +1 -1
  51. package/lib/module/combobox/Combobox.js +7 -7
  52. package/lib/module/combobox/Combobox.js.map +1 -1
  53. package/lib/module/context-menu/context.js +2 -2
  54. package/lib/module/context-menu/context.js.map +1 -1
  55. package/lib/module/context-menu/index.js +17 -17
  56. package/lib/module/context-menu/index.js.map +1 -1
  57. package/lib/module/context-menu/index.web.js +19 -19
  58. package/lib/module/context-menu/index.web.js.map +1 -1
  59. package/lib/module/dialog/SheetShell.js +1 -1
  60. package/lib/module/index.js +11 -11
  61. package/lib/module/index.js.map +1 -1
  62. package/lib/module/index.web.js +11 -11
  63. package/lib/module/index.web.js.map +1 -1
  64. package/lib/module/input-group/InputGroup.js +1 -1
  65. package/lib/module/menu/context.js +2 -2
  66. package/lib/module/menu/context.js.map +1 -1
  67. package/lib/module/menu/index.js +9 -9
  68. package/lib/module/menu/index.js.map +1 -1
  69. package/lib/module/menu/index.web.js +8 -8
  70. package/lib/module/menu/index.web.js.map +1 -1
  71. package/lib/module/popover/context.js +1 -1
  72. package/lib/module/popover/context.js.map +1 -1
  73. package/lib/module/popover/index.js +3 -3
  74. package/lib/module/popover/index.js.map +1 -1
  75. package/lib/module/popover/index.web.js +3 -3
  76. package/lib/module/popover/index.web.js.map +1 -1
  77. package/lib/module/search-input/index.js +4 -4
  78. package/lib/module/search-input/index.js.map +1 -1
  79. package/lib/module/segmented-control/index.js +15 -15
  80. package/lib/module/segmented-control/index.js.map +1 -1
  81. package/lib/module/select/common.js +1 -1
  82. package/lib/module/select/common.js.map +1 -1
  83. package/lib/module/select/index.js +25 -29
  84. package/lib/module/select/index.js.map +1 -1
  85. package/lib/module/select/index.web.js +22 -26
  86. package/lib/module/select/index.web.js.map +1 -1
  87. package/lib/module/tabs/Tabs.js +6 -6
  88. package/lib/module/tabs/Tabs.js.map +1 -1
  89. package/lib/module/tabs/index.js +1 -1
  90. package/lib/module/tabs/index.js.map +1 -1
  91. package/lib/module/text-field/index.js +8 -8
  92. package/lib/module/text-field/index.js.map +1 -1
  93. package/lib/module/theme/color-scope/style-builder.js +6 -6
  94. package/lib/module/tooltip/index.js +6 -6
  95. package/lib/module/tooltip/index.js.map +1 -1
  96. package/lib/module/tooltip/index.web.js +6 -6
  97. package/lib/module/tooltip/index.web.js.map +1 -1
  98. package/lib/typescript/commonjs/admonition/index.d.ts +14 -13
  99. package/lib/typescript/commonjs/admonition/index.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/combobox/Combobox.d.ts +7 -7
  101. package/lib/typescript/commonjs/combobox/Combobox.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/context-menu/index.d.ts +9 -9
  103. package/lib/typescript/commonjs/context-menu/index.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/context-menu/index.web.d.ts +9 -9
  105. package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/context-menu/types.d.ts +6 -6
  107. package/lib/typescript/commonjs/context-menu/types.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/dialog/SheetShell.d.ts +1 -1
  109. package/lib/typescript/commonjs/index.d.ts +11 -11
  110. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  111. package/lib/typescript/commonjs/index.web.d.ts +11 -11
  112. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  113. package/lib/typescript/commonjs/input-group/types.d.ts +1 -1
  114. package/lib/typescript/commonjs/menu/index.d.ts +9 -9
  115. package/lib/typescript/commonjs/menu/index.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/menu/index.web.d.ts +9 -9
  117. package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
  118. package/lib/typescript/commonjs/menu/types.d.ts +5 -5
  119. package/lib/typescript/commonjs/menu/types.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/popover/index.d.ts +5 -5
  121. package/lib/typescript/commonjs/popover/index.d.ts.map +1 -1
  122. package/lib/typescript/commonjs/popover/index.web.d.ts +5 -5
  123. package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/popover/types.d.ts +1 -1
  125. package/lib/typescript/commonjs/popover/types.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/search-input/index.d.ts +3 -3
  127. package/lib/typescript/commonjs/search-input/index.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/segmented-control/index.d.ts +13 -13
  129. package/lib/typescript/commonjs/segmented-control/index.d.ts.map +1 -1
  130. package/lib/typescript/commonjs/select/common.d.ts +1 -1
  131. package/lib/typescript/commonjs/select/common.d.ts.map +1 -1
  132. package/lib/typescript/commonjs/select/index.d.ts +12 -12
  133. package/lib/typescript/commonjs/select/index.d.ts.map +1 -1
  134. package/lib/typescript/commonjs/select/index.web.d.ts +12 -12
  135. package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/select/types.d.ts +10 -10
  137. package/lib/typescript/commonjs/select/types.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/tabs/Tabs.d.ts +4 -4
  139. package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/tabs/index.d.ts +2 -2
  141. package/lib/typescript/commonjs/tabs/index.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/tabs/types.d.ts +3 -3
  143. package/lib/typescript/commonjs/tabs/types.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/text-field/index.d.ts +8 -8
  145. package/lib/typescript/commonjs/text-field/index.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts +6 -6
  147. package/lib/typescript/commonjs/tooltip/index.d.ts +6 -6
  148. package/lib/typescript/commonjs/tooltip/index.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/tooltip/index.web.d.ts +6 -6
  150. package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
  151. package/lib/typescript/module/admonition/index.d.ts +14 -13
  152. package/lib/typescript/module/admonition/index.d.ts.map +1 -1
  153. package/lib/typescript/module/combobox/Combobox.d.ts +7 -7
  154. package/lib/typescript/module/combobox/Combobox.d.ts.map +1 -1
  155. package/lib/typescript/module/context-menu/index.d.ts +9 -9
  156. package/lib/typescript/module/context-menu/index.d.ts.map +1 -1
  157. package/lib/typescript/module/context-menu/index.web.d.ts +9 -9
  158. package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
  159. package/lib/typescript/module/context-menu/types.d.ts +6 -6
  160. package/lib/typescript/module/context-menu/types.d.ts.map +1 -1
  161. package/lib/typescript/module/dialog/SheetShell.d.ts +1 -1
  162. package/lib/typescript/module/index.d.ts +11 -11
  163. package/lib/typescript/module/index.d.ts.map +1 -1
  164. package/lib/typescript/module/index.web.d.ts +11 -11
  165. package/lib/typescript/module/index.web.d.ts.map +1 -1
  166. package/lib/typescript/module/input-group/types.d.ts +1 -1
  167. package/lib/typescript/module/menu/index.d.ts +9 -9
  168. package/lib/typescript/module/menu/index.d.ts.map +1 -1
  169. package/lib/typescript/module/menu/index.web.d.ts +9 -9
  170. package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
  171. package/lib/typescript/module/menu/types.d.ts +5 -5
  172. package/lib/typescript/module/menu/types.d.ts.map +1 -1
  173. package/lib/typescript/module/popover/index.d.ts +5 -5
  174. package/lib/typescript/module/popover/index.d.ts.map +1 -1
  175. package/lib/typescript/module/popover/index.web.d.ts +5 -5
  176. package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
  177. package/lib/typescript/module/popover/types.d.ts +1 -1
  178. package/lib/typescript/module/popover/types.d.ts.map +1 -1
  179. package/lib/typescript/module/search-input/index.d.ts +3 -3
  180. package/lib/typescript/module/search-input/index.d.ts.map +1 -1
  181. package/lib/typescript/module/segmented-control/index.d.ts +13 -13
  182. package/lib/typescript/module/segmented-control/index.d.ts.map +1 -1
  183. package/lib/typescript/module/select/common.d.ts +1 -1
  184. package/lib/typescript/module/select/common.d.ts.map +1 -1
  185. package/lib/typescript/module/select/index.d.ts +12 -12
  186. package/lib/typescript/module/select/index.d.ts.map +1 -1
  187. package/lib/typescript/module/select/index.web.d.ts +12 -12
  188. package/lib/typescript/module/select/index.web.d.ts.map +1 -1
  189. package/lib/typescript/module/select/types.d.ts +10 -10
  190. package/lib/typescript/module/select/types.d.ts.map +1 -1
  191. package/lib/typescript/module/tabs/Tabs.d.ts +4 -4
  192. package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
  193. package/lib/typescript/module/tabs/index.d.ts +2 -2
  194. package/lib/typescript/module/tabs/index.d.ts.map +1 -1
  195. package/lib/typescript/module/tabs/types.d.ts +3 -3
  196. package/lib/typescript/module/tabs/types.d.ts.map +1 -1
  197. package/lib/typescript/module/text-field/index.d.ts +8 -8
  198. package/lib/typescript/module/text-field/index.d.ts.map +1 -1
  199. package/lib/typescript/module/theme/color-scope/style-builder.d.ts +6 -6
  200. package/lib/typescript/module/tooltip/index.d.ts +6 -6
  201. package/lib/typescript/module/tooltip/index.d.ts.map +1 -1
  202. package/lib/typescript/module/tooltip/index.web.d.ts +6 -6
  203. package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
  204. package/package.json +1 -7
  205. package/src/__tests__/public-api-contract.test.ts +19 -7
  206. package/src/__tests__/useNavigationTheme.test.tsx +227 -0
  207. package/src/admonition/index.tsx +22 -21
  208. package/src/combobox/Combobox.tsx +14 -14
  209. package/src/context-menu/ContextMenu.stories.tsx +26 -18
  210. package/src/context-menu/context.ts +2 -2
  211. package/src/context-menu/index.tsx +24 -24
  212. package/src/context-menu/index.web.tsx +26 -26
  213. package/src/context-menu/types.ts +6 -6
  214. package/src/dialog/SheetShell.tsx +1 -1
  215. package/src/field/Field.stories.tsx +3 -3
  216. package/src/index.ts +11 -11
  217. package/src/index.web.ts +11 -11
  218. package/src/input-group/InputGroup.stories.tsx +4 -4
  219. package/src/input-group/InputGroup.tsx +1 -1
  220. package/src/input-group/types.ts +1 -1
  221. package/src/menu/Menu.stories.tsx +35 -35
  222. package/src/menu/context.ts +2 -2
  223. package/src/menu/index.tsx +15 -15
  224. package/src/menu/index.web.tsx +14 -14
  225. package/src/menu/types.ts +5 -5
  226. package/src/popover/Popover.stories.tsx +13 -13
  227. package/src/popover/context.ts +1 -1
  228. package/src/popover/index.tsx +5 -5
  229. package/src/popover/index.web.tsx +5 -5
  230. package/src/popover/types.ts +1 -1
  231. package/src/search-input/index.tsx +7 -7
  232. package/src/segmented-control/index.tsx +15 -15
  233. package/src/select/Select.stories.tsx +32 -23
  234. package/src/select/common.ts +1 -1
  235. package/src/select/index.tsx +39 -43
  236. package/src/select/index.web.tsx +33 -37
  237. package/src/select/types.ts +10 -10
  238. package/src/tabs/Tabs.tsx +9 -9
  239. package/src/tabs/index.ts +2 -2
  240. package/src/tabs/types.ts +3 -3
  241. package/src/text-field/TextField.stories.tsx +5 -5
  242. package/src/text-field/index.tsx +12 -12
  243. package/src/theme/color-scope/style-builder.ts +6 -6
  244. package/src/tooltip/index.tsx +6 -6
  245. package/src/tooltip/index.web.tsx +6 -6
@@ -19,20 +19,20 @@ import { useInteractionState } from '../hooks/useInteractionState';
19
19
  import {
20
20
  ChevronTopBottom_Stroke2_Corner0_Rounded as ChevronUpDownIcon,
21
21
  } from '../icons/Chevron';
22
- import { defaultItemValueExtractor, ItemContext, useItemContext } from './common';
22
+ import { defaultItemValueExtractor, ItemContext, useSelectItemContext } from './common';
23
23
  import type {
24
- ContentProps,
25
- IconProps,
26
- ItemIndicatorProps,
27
- ItemProps,
28
- ItemTextProps,
29
- RootProps,
24
+ SelectContentProps,
25
+ SelectIconProps,
26
+ SelectItemIndicatorProps,
27
+ SelectItemProps,
28
+ SelectItemTextProps,
29
+ SelectProps,
30
30
  SelectItemContextValue,
31
- TriggerProps,
32
- ValueTextProps,
31
+ SelectTriggerProps,
32
+ SelectValueProps,
33
33
  } from './types';
34
34
 
35
- export { useItemContext };
35
+ export { useSelectItemContext };
36
36
 
37
37
  // ---------------------------------------------------------------------------
38
38
  // Context
@@ -40,7 +40,7 @@ export { useItemContext };
40
40
 
41
41
  type SelectContextValue = {
42
42
  control: DialogControlProps;
43
- } & Pick<RootProps, 'value' | 'onValueChange' | 'disabled'>;
43
+ } & Pick<SelectProps, 'value' | 'onValueChange' | 'disabled'>;
44
44
 
45
45
  const SelectContext = createContext<SelectContextValue | null>(null);
46
46
  SelectContext.displayName = 'SelectContext';
@@ -53,16 +53,16 @@ ValueStoreContext.displayName = 'SelectValueStoreContext';
53
53
  function useSelectContext(): SelectContextValue {
54
54
  const ctx = useContext(SelectContext);
55
55
  if (!ctx) {
56
- throw new Error('Select components must be used within a Select.Root');
56
+ throw new Error('Select components must be used within a Select');
57
57
  }
58
58
  return ctx;
59
59
  }
60
60
 
61
61
  // ---------------------------------------------------------------------------
62
- // Root
62
+ // Select
63
63
  // ---------------------------------------------------------------------------
64
64
 
65
- export function Root({ children, value, onValueChange, disabled }: RootProps) {
65
+ export function Select({ children, value, onValueChange, disabled }: SelectProps) {
66
66
  const control = useDialogControl();
67
67
  const valueStoreState = useState<unknown>(undefined);
68
68
 
@@ -81,10 +81,10 @@ export function Root({ children, value, onValueChange, disabled }: RootProps) {
81
81
  }
82
82
 
83
83
  // ---------------------------------------------------------------------------
84
- // Trigger
84
+ // SelectTrigger
85
85
  // ---------------------------------------------------------------------------
86
86
 
87
- export function Trigger({ children, label }: TriggerProps) {
87
+ export function SelectTrigger({ children, label }: SelectTriggerProps) {
88
88
  const { control } = useSelectContext();
89
89
  const { state: focused, onIn: onFocus, onOut: onBlur } = useInteractionState();
90
90
  const {
@@ -124,14 +124,14 @@ export function Trigger({ children, label }: TriggerProps) {
124
124
  }
125
125
 
126
126
  // ---------------------------------------------------------------------------
127
- // ValueText
127
+ // SelectValue
128
128
  // ---------------------------------------------------------------------------
129
129
 
130
- export function ValueText({
130
+ export function SelectValue({
131
131
  placeholder,
132
132
  children: extractLabel = defaultExtractLabel,
133
133
  style,
134
- }: ValueTextProps) {
134
+ }: SelectValueProps) {
135
135
  const [storedValue] = useContext(ValueStoreContext);
136
136
  const theme = useTheme();
137
137
 
@@ -159,23 +159,23 @@ function defaultExtractLabel(item: unknown): React.ReactNode {
159
159
  }
160
160
 
161
161
  // ---------------------------------------------------------------------------
162
- // Icon
162
+ // SelectIcon
163
163
  // ---------------------------------------------------------------------------
164
164
 
165
- export function Icon(_props: IconProps) {
165
+ export function SelectIcon(_props: SelectIconProps) {
166
166
  const theme = useTheme();
167
167
  return <ChevronUpDownIcon size="sm" fill={theme.colors.textSecondary} />;
168
168
  }
169
169
 
170
170
  // ---------------------------------------------------------------------------
171
- // Content
171
+ // SelectContent
172
172
  // ---------------------------------------------------------------------------
173
173
 
174
- export function Content<T>({
174
+ export function SelectContent<T>({
175
175
  items,
176
176
  valueExtractor = defaultItemValueExtractor,
177
177
  ...props
178
- }: ContentProps<T>) {
178
+ }: SelectContentProps<T>) {
179
179
  const { control, ...context } = useSelectContext();
180
180
  const [, setStoredValue] = useContext(ValueStoreContext);
181
181
 
@@ -189,7 +189,7 @@ export function Content<T>({
189
189
  }, [items, context.value, valueExtractor, setStoredValue]);
190
190
 
191
191
  return (
192
- <ContentInner
192
+ <SelectContentInner
193
193
  control={control}
194
194
  items={items}
195
195
  valueExtractor={valueExtractor}
@@ -201,19 +201,19 @@ export function Content<T>({
201
201
  );
202
202
  }
203
203
 
204
- type ContentInnerProps<T> = ContentProps<T> &
205
- Pick<RootProps, 'value' | 'onValueChange' | 'disabled'> & {
204
+ type SelectContentInnerProps<T> = SelectContentProps<T> &
205
+ Pick<SelectProps, 'value' | 'onValueChange' | 'disabled'> & {
206
206
  control: DialogControlProps;
207
207
  };
208
208
 
209
- function ContentInner<T>({
209
+ function SelectContentInner<T>({
210
210
  label = 'Select an option',
211
211
  items,
212
212
  renderItem,
213
213
  valueExtractor = defaultItemValueExtractor,
214
214
  control,
215
215
  ...contextValues
216
- }: ContentInnerProps<T>) {
216
+ }: SelectContentInnerProps<T>) {
217
217
  const theme = useTheme();
218
218
 
219
219
  const render = useCallback(
@@ -258,14 +258,10 @@ function ContentInner<T>({
258
258
  }
259
259
 
260
260
  // ---------------------------------------------------------------------------
261
- // Item context + value extractor (shared across platforms)
261
+ // SelectItem
262
262
  // ---------------------------------------------------------------------------
263
263
 
264
- // ---------------------------------------------------------------------------
265
- // Item
266
- // ---------------------------------------------------------------------------
267
-
268
- export function Item({ children, value, label, style }: ItemProps) {
264
+ export function SelectItem({ children, value, label, style }: SelectItemProps) {
269
265
  const theme = useTheme();
270
266
  const { close } = useDialogContext();
271
267
  const { value: selectedValue, onValueChange } = useSelectContext();
@@ -311,11 +307,11 @@ export function Item({ children, value, label, style }: ItemProps) {
311
307
  }
312
308
 
313
309
  // ---------------------------------------------------------------------------
314
- // ItemText
310
+ // SelectItemText
315
311
  // ---------------------------------------------------------------------------
316
312
 
317
- export function ItemText({ children, style }: ItemTextProps) {
318
- const { selected } = useItemContext();
313
+ export function SelectItemText({ children, style }: SelectItemTextProps) {
314
+ const { selected } = useSelectItemContext();
319
315
 
320
316
  return (
321
317
  <Text
@@ -331,11 +327,11 @@ export function ItemText({ children, style }: ItemTextProps) {
331
327
  }
332
328
 
333
329
  // ---------------------------------------------------------------------------
334
- // ItemIndicator
330
+ // SelectItemIndicator
335
331
  // ---------------------------------------------------------------------------
336
332
 
337
- export function ItemIndicator({ icon: IconComponent }: ItemIndicatorProps) {
338
- const { selected } = useItemContext();
333
+ export function SelectItemIndicator({ icon: IconComponent }: SelectItemIndicatorProps) {
334
+ const { selected } = useSelectItemContext();
339
335
 
340
336
  if (IconComponent) {
341
337
  return (
@@ -349,10 +345,10 @@ export function ItemIndicator({ icon: IconComponent }: ItemIndicatorProps) {
349
345
  }
350
346
 
351
347
  // ---------------------------------------------------------------------------
352
- // Separator
348
+ // SelectSeparator
353
349
  // ---------------------------------------------------------------------------
354
350
 
355
- export function Separator() {
351
+ export function SelectSeparator() {
356
352
  const theme = useTheme();
357
353
 
358
354
  return (
@@ -11,20 +11,20 @@ import {
11
11
  ChevronBottom_Stroke2_Corner0_Rounded as ChevronDownIcon,
12
12
  } from '../icons/Chevron';
13
13
  import { Check_Stroke2_Corner0_Rounded as CheckIcon } from '../icons/Check';
14
- import { defaultItemValueExtractor, ItemContext, useItemContext } from './common';
14
+ import { defaultItemValueExtractor, ItemContext, useSelectItemContext } from './common';
15
15
  import type {
16
- ContentProps,
17
- IconProps,
18
- ItemIndicatorProps,
19
- ItemProps,
20
- ItemTextProps,
21
- RootProps,
16
+ SelectContentProps,
17
+ SelectIconProps,
18
+ SelectItemIndicatorProps,
19
+ SelectItemProps,
20
+ SelectItemTextProps,
21
+ SelectProps,
22
22
  SelectItemContextValue,
23
- TriggerProps,
24
- ValueTextProps,
23
+ SelectTriggerProps,
24
+ SelectValueProps,
25
25
  } from './types';
26
26
 
27
- export { useItemContext };
27
+ export { useSelectItemContext };
28
28
 
29
29
  const selectZIndex = createOverlayZIndex();
30
30
 
@@ -32,7 +32,7 @@ const selectZIndex = createOverlayZIndex();
32
32
  // Context
33
33
  // ---------------------------------------------------------------------------
34
34
 
35
- type SelectContextValue = Pick<RootProps, 'value' | 'onValueChange' | 'disabled'> & {
35
+ type SelectContextValue = Pick<SelectProps, 'value' | 'onValueChange' | 'disabled'> & {
36
36
  isOpen: boolean;
37
37
  open: () => void;
38
38
  close: () => void;
@@ -44,16 +44,16 @@ SelectContext.displayName = 'SelectContext';
44
44
  function useSelectContext(): SelectContextValue {
45
45
  const ctx = useContext(SelectContext);
46
46
  if (!ctx) {
47
- throw new Error('Select components must be used within a Select.Root');
47
+ throw new Error('Select components must be used within a Select');
48
48
  }
49
49
  return ctx;
50
50
  }
51
51
 
52
52
  // ---------------------------------------------------------------------------
53
- // Root
53
+ // Select
54
54
  // ---------------------------------------------------------------------------
55
55
 
56
- export function Root({ children, value, onValueChange, disabled }: RootProps) {
56
+ export function Select({ children, value, onValueChange, disabled }: SelectProps) {
57
57
  const [isOpen, setIsOpen] = useState(false);
58
58
 
59
59
  const ctx = useMemo<SelectContextValue>(
@@ -72,10 +72,10 @@ export function Root({ children, value, onValueChange, disabled }: RootProps) {
72
72
  }
73
73
 
74
74
  // ---------------------------------------------------------------------------
75
- // Trigger
75
+ // SelectTrigger
76
76
  // ---------------------------------------------------------------------------
77
77
 
78
- export function Trigger({ children, label }: TriggerProps) {
78
+ export function SelectTrigger({ children, label }: SelectTriggerProps) {
79
79
  const ctx = useSelectContext();
80
80
  const theme = useTheme();
81
81
  const triggerId = useId();
@@ -133,14 +133,14 @@ export function Trigger({ children, label }: TriggerProps) {
133
133
  }
134
134
 
135
135
  // ---------------------------------------------------------------------------
136
- // ValueText
136
+ // SelectValue
137
137
  // ---------------------------------------------------------------------------
138
138
 
139
- export function ValueText({
139
+ export function SelectValue({
140
140
  children: extractLabel,
141
141
  placeholder,
142
142
  style,
143
- }: ValueTextProps) {
143
+ }: SelectValueProps) {
144
144
  const { value } = useSelectContext();
145
145
  const theme = useTheme();
146
146
 
@@ -161,24 +161,24 @@ export function ValueText({
161
161
  }
162
162
 
163
163
  // ---------------------------------------------------------------------------
164
- // Icon
164
+ // SelectIcon
165
165
  // ---------------------------------------------------------------------------
166
166
 
167
- export function Icon({ style }: IconProps) {
167
+ export function SelectIcon({ style }: SelectIconProps) {
168
168
  const theme = useTheme();
169
169
  return <ChevronDownIcon style={style} size="xs" fill={theme.colors.textSecondary} />;
170
170
  }
171
171
 
172
172
  // ---------------------------------------------------------------------------
173
- // Content
173
+ // SelectContent
174
174
  // ---------------------------------------------------------------------------
175
175
 
176
- export function Content<T>({
176
+ export function SelectContent<T>({
177
177
  items,
178
178
  renderItem,
179
179
  label = 'Select an option',
180
180
  valueExtractor = defaultItemValueExtractor,
181
- }: ContentProps<T>) {
181
+ }: SelectContentProps<T>) {
182
182
  const ctx = useSelectContext();
183
183
  const theme = useTheme();
184
184
 
@@ -216,14 +216,10 @@ export function Content<T>({
216
216
  }
217
217
 
218
218
  // ---------------------------------------------------------------------------
219
- // Item context + value extractor (shared across platforms)
219
+ // SelectItem
220
220
  // ---------------------------------------------------------------------------
221
221
 
222
- // ---------------------------------------------------------------------------
223
- // Item
224
- // ---------------------------------------------------------------------------
225
-
226
- export function Item({ ref, value, children, style }: ItemProps) {
222
+ export function SelectItem({ ref, value, children, style }: SelectItemProps) {
227
223
  const theme = useTheme();
228
224
  const ctx = useSelectContext();
229
225
  const {
@@ -267,10 +263,10 @@ export function Item({ ref, value, children, style }: ItemProps) {
267
263
  }
268
264
 
269
265
  // ---------------------------------------------------------------------------
270
- // ItemText
266
+ // SelectItemText
271
267
  // ---------------------------------------------------------------------------
272
268
 
273
- export function ItemText({ children, style }: ItemTextProps) {
269
+ export function SelectItemText({ children, style }: SelectItemTextProps) {
274
270
  return (
275
271
  <Text style={[styles.itemText, ...(style ? [style] : [])]}>
276
272
  {children}
@@ -279,11 +275,11 @@ export function ItemText({ children, style }: ItemTextProps) {
279
275
  }
280
276
 
281
277
  // ---------------------------------------------------------------------------
282
- // ItemIndicator
278
+ // SelectItemIndicator
283
279
  // ---------------------------------------------------------------------------
284
280
 
285
- export function ItemIndicator({ icon: IconComponent = CheckIcon }: ItemIndicatorProps) {
286
- const { selected } = useItemContext();
281
+ export function SelectItemIndicator({ icon: IconComponent = CheckIcon }: SelectItemIndicatorProps) {
282
+ const { selected } = useSelectItemContext();
287
283
 
288
284
  if (!selected) {
289
285
  return <View style={styles.itemIndicatorPlaceholder} />;
@@ -297,10 +293,10 @@ export function ItemIndicator({ icon: IconComponent = CheckIcon }: ItemIndicator
297
293
  }
298
294
 
299
295
  // ---------------------------------------------------------------------------
300
- // Separator
296
+ // SelectSeparator
301
297
  // ---------------------------------------------------------------------------
302
298
 
303
- export function Separator() {
299
+ export function SelectSeparator() {
304
300
  const theme = useTheme();
305
301
 
306
302
  return (
@@ -3,14 +3,14 @@ import type { StyleProp, TextStyle, View, ViewStyle } from 'react-native';
3
3
  import type { Props as SVGIconProps } from '../icons/common';
4
4
  import type { DialogControlProps } from '../dialog/types';
5
5
 
6
- export type RootProps = {
6
+ export type SelectProps = {
7
7
  children?: React.ReactNode;
8
8
  value?: string;
9
9
  onValueChange?: (value: string) => void;
10
10
  disabled?: boolean;
11
11
  };
12
12
 
13
- export type TriggerProps = {
13
+ export type SelectTriggerProps = {
14
14
  children: React.ReactNode | ((props: TriggerChildProps) => React.ReactNode);
15
15
  label: string;
16
16
  };
@@ -31,12 +31,12 @@ export type TriggerChildProps = {
31
31
  };
32
32
 
33
33
  /**
34
- * Shows the currently selected value inside a `Select.Trigger`.
34
+ * Shows the currently selected value inside a `SelectTrigger`.
35
35
  *
36
36
  * Pass a `children` function to extract a display string from the selected
37
37
  * item when items are not plain `{ value, label }` objects.
38
38
  */
39
- export type ValueTextProps = {
39
+ export type SelectValueProps = {
40
40
  /**
41
41
  * Extracts the display text from the currently-selected item.
42
42
  * Defaults to `item => item.label`.
@@ -46,11 +46,11 @@ export type ValueTextProps = {
46
46
  style?: TextStyle;
47
47
  };
48
48
 
49
- export type IconProps = {
49
+ export type SelectIconProps = {
50
50
  style?: TextStyle;
51
51
  };
52
52
 
53
- export type ContentProps<T> = {
53
+ export type SelectContentProps<T> = {
54
54
  /**
55
55
  * Label displayed at the top of the selection sheet (native) or
56
56
  * used as an ARIA label (web).
@@ -60,7 +60,7 @@ export type ContentProps<T> = {
60
60
  label?: string;
61
61
  /** The array of items to choose from. */
62
62
  items: T[];
63
- /** Renders a single item. Use `Select.Item` inside this callback. */
63
+ /** Renders a single item. Use `SelectItem` inside this callback. */
64
64
  renderItem: (
65
65
  item: T,
66
66
  index: number,
@@ -73,7 +73,7 @@ export type ContentProps<T> = {
73
73
  valueExtractor?: (item: T) => string;
74
74
  };
75
75
 
76
- export type ItemProps = {
76
+ export type SelectItemProps = {
77
77
  ref?: React.Ref<View>;
78
78
  value: string;
79
79
  label: string;
@@ -81,12 +81,12 @@ export type ItemProps = {
81
81
  style?: StyleProp<ViewStyle>;
82
82
  };
83
83
 
84
- export type ItemTextProps = {
84
+ export type SelectItemTextProps = {
85
85
  children: React.ReactNode;
86
86
  style?: TextStyle;
87
87
  };
88
88
 
89
- export type ItemIndicatorProps = {
89
+ export type SelectItemIndicatorProps = {
90
90
  icon?: React.ComponentType<SVGIconProps>;
91
91
  };
92
92
 
package/src/tabs/Tabs.tsx CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  import { useTheme } from '../theme/use-theme';
19
19
  import { usePressAnimation } from '../hooks/usePressAnimation';
20
20
  import { borderRadius, space } from '../styles/tokens';
21
- import type { TabsProps, TabProps, TabPanelProps, TabsVariant } from './types';
21
+ import type { TabsProps, TabsTriggerProps, TabsContentProps, TabsVariant } from './types';
22
22
 
23
23
  interface TabsContextValue {
24
24
  value: string;
@@ -88,7 +88,7 @@ const TabsBarComponent: React.FC<TabsProps> = ({
88
88
  );
89
89
  };
90
90
 
91
- const TabComponent: React.FC<TabProps> = ({
91
+ const TabComponent: React.FC<TabsTriggerProps> = ({
92
92
  value,
93
93
  label,
94
94
  icon,
@@ -182,7 +182,7 @@ const TabComponent: React.FC<TabProps> = ({
182
182
  );
183
183
  };
184
184
 
185
- const TabPanelComponent: React.FC<TabPanelProps> = ({ value, children, style }) => {
185
+ const TabPanelComponent: React.FC<TabsContentProps> = ({ value, children, style }) => {
186
186
  const { value: selectedValue } = useContext(TabsContext);
187
187
 
188
188
  if (value !== selectedValue) return null;
@@ -190,11 +190,11 @@ const TabPanelComponent: React.FC<TabPanelProps> = ({ value, children, style })
190
190
  return <View style={style}>{children}</View>;
191
191
  };
192
192
 
193
- export const TabsBar = memo(TabsBarComponent);
194
- TabsBar.displayName = 'TabsBar';
193
+ export const Tabs = memo(TabsBarComponent);
194
+ Tabs.displayName = 'Tabs';
195
195
 
196
- export const Tab = memo(TabComponent);
197
- Tab.displayName = 'Tab';
196
+ export const TabsTrigger = memo(TabComponent);
197
+ TabsTrigger.displayName = 'TabsTrigger';
198
198
 
199
- export const TabPanel = memo(TabPanelComponent);
200
- TabPanel.displayName = 'TabPanel';
199
+ export const TabsContent = memo(TabPanelComponent);
200
+ TabsContent.displayName = 'TabsContent';
package/src/tabs/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { TabsBar, Tab, TabPanel } from './Tabs';
2
- export type { TabsProps, TabProps, TabPanelProps, TabsVariant } from './types';
1
+ export { Tabs, TabsTrigger, TabsContent } from './Tabs';
2
+ export type { TabsProps, TabsTriggerProps, TabsContentProps, TabsVariant } from './types';
package/src/tabs/types.ts CHANGED
@@ -9,13 +9,13 @@ export interface TabsProps {
9
9
  onValueChange: (value: string) => void;
10
10
  /** Visual variant for the tab bar. */
11
11
  variant?: TabsVariant;
12
- /** The tab items. Must be Tab components. */
12
+ /** The tab items. Must be TabsTrigger components. */
13
13
  children: React.ReactNode;
14
14
  style?: StyleProp<ViewStyle>;
15
15
  testID?: string;
16
16
  }
17
17
 
18
- export interface TabProps {
18
+ export interface TabsTriggerProps {
19
19
  /** Unique value identifying this tab. */
20
20
  value: string;
21
21
  /** Tab label text. */
@@ -28,7 +28,7 @@ export interface TabProps {
28
28
  textStyle?: StyleProp<TextStyle>;
29
29
  }
30
30
 
31
- export interface TabPanelProps {
31
+ export interface TabsContentProps {
32
32
  /** The tab value this panel corresponds to. */
33
33
  value: string;
34
34
  /** Panel content. */
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import type { Meta, StoryObj } from '@storybook/react-vite';
4
4
 
5
- import * as TextField from './index';
5
+ import { TextField, TextFieldInput, TextFieldLabel } from './index';
6
6
 
7
7
  const meta: Meta = {
8
8
  title: 'Components/TextField',
@@ -28,9 +28,9 @@ function ControlledField({
28
28
  const [value, setValue] = useState(initial);
29
29
  return (
30
30
  <View style={{ width: 320 }}>
31
- <TextField.LabelText>{label}</TextField.LabelText>
32
- <TextField.Root isInvalid={isInvalid}>
33
- <TextField.Input
31
+ <TextFieldLabel>{label}</TextFieldLabel>
32
+ <TextField isInvalid={isInvalid}>
33
+ <TextFieldInput
34
34
  label={label}
35
35
  placeholder={placeholder}
36
36
  value={value}
@@ -38,7 +38,7 @@ function ControlledField({
38
38
  editable={editable}
39
39
  isInvalid={isInvalid}
40
40
  />
41
- </TextField.Root>
41
+ </TextField>
42
42
  </View>
43
43
  );
44
44
  }
@@ -46,11 +46,11 @@ const Context = createContext<{
46
46
  });
47
47
  Context.displayName = 'TextFieldContext';
48
48
 
49
- export type RootProps = React.PropsWithChildren<
49
+ export type TextFieldProps = React.PropsWithChildren<
50
50
  { isInvalid?: boolean } & ViewStyleProp
51
51
  >;
52
52
 
53
- export function Root({ children, isInvalid = false, style }: RootProps) {
53
+ export function TextField({ children, isInvalid = false, style }: TextFieldProps) {
54
54
  const inputRef = useRef<TextInput>(null);
55
55
  const {
56
56
  state: hovered,
@@ -122,7 +122,7 @@ export function useSharedInputStyles() {
122
122
  }, [theme]);
123
123
  }
124
124
 
125
- export type InputProps = Omit<
125
+ export type TextFieldInputProps = Omit<
126
126
  TextInputProps,
127
127
  'value' | 'onChangeText' | 'placeholder'
128
128
  > & {
@@ -134,7 +134,7 @@ export type InputProps = Omit<
134
134
  placeholder?: string | null | undefined;
135
135
  };
136
136
 
137
- export function Input({
137
+ export function TextFieldInput({
138
138
  label,
139
139
  placeholder,
140
140
  value,
@@ -145,7 +145,7 @@ export function Input({
145
145
  inputRef,
146
146
  style,
147
147
  ...rest
148
- }: InputProps) {
148
+ }: TextFieldInputProps) {
149
149
  const theme = useTheme();
150
150
  const ctx = useContext(Context);
151
151
  const withinRoot = Boolean(ctx.inputRef);
@@ -155,8 +155,8 @@ export function Input({
155
155
 
156
156
  if (!withinRoot) {
157
157
  return (
158
- <Root isInvalid={isInvalid}>
159
- <Input
158
+ <TextField isInvalid={isInvalid}>
159
+ <TextFieldInput
160
160
  label={label}
161
161
  placeholder={placeholder}
162
162
  value={value}
@@ -164,7 +164,7 @@ export function Input({
164
164
  isInvalid={isInvalid}
165
165
  {...rest}
166
166
  />
167
- </Root>
167
+ </TextField>
168
168
  );
169
169
  }
170
170
 
@@ -246,7 +246,7 @@ export function Input({
246
246
  );
247
247
  }
248
248
 
249
- export function LabelText({
249
+ export function TextFieldLabel({
250
250
  nativeID,
251
251
  children,
252
252
  }: React.PropsWithChildren<{ nativeID?: string }>) {
@@ -265,7 +265,7 @@ export function LabelText({
265
265
  );
266
266
  }
267
267
 
268
- export function Icon({ icon: Comp }: { icon: React.ComponentType<SVGIconProps> }) {
268
+ export function TextFieldIcon({ icon: Comp }: { icon: React.ComponentType<SVGIconProps> }) {
269
269
  const theme = useTheme();
270
270
  const ctx = useContext(Context);
271
271
 
@@ -297,7 +297,7 @@ export function Icon({ icon: Comp }: { icon: React.ComponentType<SVGIconProps> }
297
297
  );
298
298
  }
299
299
 
300
- export function SuffixText({
300
+ export function TextFieldSuffix({
301
301
  children,
302
302
  label,
303
303
  accessibilityHint,
@@ -330,7 +330,7 @@ export function SuffixText({
330
330
  );
331
331
  }
332
332
 
333
- export function GhostText({
333
+ export function TextFieldGhost({
334
334
  children,
335
335
  value,
336
336
  }: {