@oxyhq/bloom 0.16.2 → 0.18.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.
- package/README.md +54 -16
- package/lib/commonjs/admonition/index.js +24 -23
- package/lib/commonjs/admonition/index.js.map +1 -1
- package/lib/commonjs/combobox/Combobox.js +7 -7
- package/lib/commonjs/combobox/Combobox.js.map +1 -1
- package/lib/commonjs/context-menu/context.js +2 -2
- package/lib/commonjs/context-menu/context.js.map +1 -1
- package/lib/commonjs/context-menu/index.js +25 -25
- package/lib/commonjs/context-menu/index.js.map +1 -1
- package/lib/commonjs/context-menu/index.web.js +27 -27
- package/lib/commonjs/context-menu/index.web.js.map +1 -1
- package/lib/commonjs/dialog/SheetShell.js +1 -1
- package/lib/commonjs/index.js +134 -38
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +134 -38
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/input-group/InputGroup.js +1 -1
- package/lib/commonjs/menu/context.js +2 -2
- package/lib/commonjs/menu/context.js.map +1 -1
- package/lib/commonjs/menu/index.js +17 -17
- package/lib/commonjs/menu/index.js.map +1 -1
- package/lib/commonjs/menu/index.web.js +16 -16
- package/lib/commonjs/menu/index.web.js.map +1 -1
- package/lib/commonjs/popover/context.js +1 -1
- package/lib/commonjs/popover/context.js.map +1 -1
- package/lib/commonjs/popover/index.js +6 -6
- package/lib/commonjs/popover/index.js.map +1 -1
- package/lib/commonjs/popover/index.web.js +6 -6
- package/lib/commonjs/popover/index.web.js.map +1 -1
- package/lib/commonjs/search-input/index.js +4 -5
- package/lib/commonjs/search-input/index.js.map +1 -1
- package/lib/commonjs/segmented-control/index.js +18 -18
- package/lib/commonjs/segmented-control/index.js.map +1 -1
- package/lib/commonjs/select/common.js +2 -2
- package/lib/commonjs/select/common.js.map +1 -1
- package/lib/commonjs/select/index.js +34 -38
- package/lib/commonjs/select/index.js.map +1 -1
- package/lib/commonjs/select/index.web.js +31 -35
- package/lib/commonjs/select/index.web.js.map +1 -1
- package/lib/commonjs/tabs/Tabs.js +7 -7
- package/lib/commonjs/tabs/Tabs.js.map +1 -1
- package/lib/commonjs/tabs/index.js +6 -6
- package/lib/commonjs/text-field/index.js +14 -14
- package/lib/commonjs/text-field/index.js.map +1 -1
- package/lib/commonjs/theme/color-scope/style-builder.js +6 -6
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/theme/use-navigation-theme.js +54 -0
- package/lib/commonjs/theme/use-navigation-theme.js.map +1 -0
- package/lib/commonjs/tooltip/index.js +11 -11
- package/lib/commonjs/tooltip/index.js.map +1 -1
- package/lib/commonjs/tooltip/index.web.js +11 -11
- package/lib/commonjs/tooltip/index.web.js.map +1 -1
- package/lib/module/admonition/index.js +18 -17
- package/lib/module/admonition/index.js.map +1 -1
- package/lib/module/combobox/Combobox.js +7 -7
- package/lib/module/combobox/Combobox.js.map +1 -1
- package/lib/module/context-menu/context.js +2 -2
- package/lib/module/context-menu/context.js.map +1 -1
- package/lib/module/context-menu/index.js +17 -17
- package/lib/module/context-menu/index.js.map +1 -1
- package/lib/module/context-menu/index.web.js +19 -19
- package/lib/module/context-menu/index.web.js.map +1 -1
- package/lib/module/dialog/SheetShell.js +1 -1
- package/lib/module/index.js +11 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +11 -11
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/input-group/InputGroup.js +1 -1
- package/lib/module/menu/context.js +2 -2
- package/lib/module/menu/context.js.map +1 -1
- package/lib/module/menu/index.js +9 -9
- package/lib/module/menu/index.js.map +1 -1
- package/lib/module/menu/index.web.js +8 -8
- package/lib/module/menu/index.web.js.map +1 -1
- package/lib/module/popover/context.js +1 -1
- package/lib/module/popover/context.js.map +1 -1
- package/lib/module/popover/index.js +3 -3
- package/lib/module/popover/index.js.map +1 -1
- package/lib/module/popover/index.web.js +3 -3
- package/lib/module/popover/index.web.js.map +1 -1
- package/lib/module/search-input/index.js +4 -4
- package/lib/module/search-input/index.js.map +1 -1
- package/lib/module/segmented-control/index.js +15 -15
- package/lib/module/segmented-control/index.js.map +1 -1
- package/lib/module/select/common.js +1 -1
- package/lib/module/select/common.js.map +1 -1
- package/lib/module/select/index.js +25 -29
- package/lib/module/select/index.js.map +1 -1
- package/lib/module/select/index.web.js +22 -26
- package/lib/module/select/index.web.js.map +1 -1
- package/lib/module/tabs/Tabs.js +6 -6
- package/lib/module/tabs/Tabs.js.map +1 -1
- package/lib/module/tabs/index.js +1 -1
- package/lib/module/tabs/index.js.map +1 -1
- package/lib/module/text-field/index.js +8 -8
- package/lib/module/text-field/index.js.map +1 -1
- package/lib/module/theme/color-scope/style-builder.js +6 -6
- package/lib/module/theme/index.js +1 -0
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/use-navigation-theme.js +50 -0
- package/lib/module/theme/use-navigation-theme.js.map +1 -0
- package/lib/module/tooltip/index.js +6 -6
- package/lib/module/tooltip/index.js.map +1 -1
- package/lib/module/tooltip/index.web.js +6 -6
- package/lib/module/tooltip/index.web.js.map +1 -1
- package/lib/typescript/commonjs/admonition/index.d.ts +14 -13
- package/lib/typescript/commonjs/admonition/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/combobox/Combobox.d.ts +7 -7
- package/lib/typescript/commonjs/combobox/Combobox.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.d.ts +9 -9
- package/lib/typescript/commonjs/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.web.d.ts +9 -9
- package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/types.d.ts +6 -6
- package/lib/typescript/commonjs/context-menu/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/SheetShell.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +11 -11
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +11 -11
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/input-group/types.d.ts +1 -1
- package/lib/typescript/commonjs/menu/index.d.ts +9 -9
- package/lib/typescript/commonjs/menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/index.web.d.ts +9 -9
- package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/types.d.ts +5 -5
- package/lib/typescript/commonjs/menu/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/index.d.ts +5 -5
- package/lib/typescript/commonjs/popover/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/index.web.d.ts +5 -5
- package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/types.d.ts +1 -1
- package/lib/typescript/commonjs/popover/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/search-input/index.d.ts +3 -3
- package/lib/typescript/commonjs/search-input/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/segmented-control/index.d.ts +13 -13
- package/lib/typescript/commonjs/segmented-control/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/common.d.ts +1 -1
- package/lib/typescript/commonjs/select/common.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.d.ts +12 -12
- package/lib/typescript/commonjs/select/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.web.d.ts +12 -12
- package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/types.d.ts +10 -10
- package/lib/typescript/commonjs/select/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/tabs/Tabs.d.ts +4 -4
- package/lib/typescript/commonjs/tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/commonjs/tabs/index.d.ts +2 -2
- package/lib/typescript/commonjs/tabs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/tabs/types.d.ts +3 -3
- package/lib/typescript/commonjs/tabs/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/text-field/index.d.ts +8 -8
- package/lib/typescript/commonjs/text-field/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts +6 -6
- package/lib/typescript/commonjs/theme/index.d.ts +2 -0
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/use-navigation-theme.d.ts +31 -0
- package/lib/typescript/commonjs/theme/use-navigation-theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/tooltip/index.d.ts +6 -6
- package/lib/typescript/commonjs/tooltip/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/tooltip/index.web.d.ts +6 -6
- package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
- package/lib/typescript/module/admonition/index.d.ts +14 -13
- package/lib/typescript/module/admonition/index.d.ts.map +1 -1
- package/lib/typescript/module/combobox/Combobox.d.ts +7 -7
- package/lib/typescript/module/combobox/Combobox.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.d.ts +9 -9
- package/lib/typescript/module/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.web.d.ts +9 -9
- package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/types.d.ts +6 -6
- package/lib/typescript/module/context-menu/types.d.ts.map +1 -1
- package/lib/typescript/module/dialog/SheetShell.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +11 -11
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +11 -11
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/input-group/types.d.ts +1 -1
- package/lib/typescript/module/menu/index.d.ts +9 -9
- package/lib/typescript/module/menu/index.d.ts.map +1 -1
- package/lib/typescript/module/menu/index.web.d.ts +9 -9
- package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/menu/types.d.ts +5 -5
- package/lib/typescript/module/menu/types.d.ts.map +1 -1
- package/lib/typescript/module/popover/index.d.ts +5 -5
- package/lib/typescript/module/popover/index.d.ts.map +1 -1
- package/lib/typescript/module/popover/index.web.d.ts +5 -5
- package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/module/popover/types.d.ts +1 -1
- package/lib/typescript/module/popover/types.d.ts.map +1 -1
- package/lib/typescript/module/search-input/index.d.ts +3 -3
- package/lib/typescript/module/search-input/index.d.ts.map +1 -1
- package/lib/typescript/module/segmented-control/index.d.ts +13 -13
- package/lib/typescript/module/segmented-control/index.d.ts.map +1 -1
- package/lib/typescript/module/select/common.d.ts +1 -1
- package/lib/typescript/module/select/common.d.ts.map +1 -1
- package/lib/typescript/module/select/index.d.ts +12 -12
- package/lib/typescript/module/select/index.d.ts.map +1 -1
- package/lib/typescript/module/select/index.web.d.ts +12 -12
- package/lib/typescript/module/select/index.web.d.ts.map +1 -1
- package/lib/typescript/module/select/types.d.ts +10 -10
- package/lib/typescript/module/select/types.d.ts.map +1 -1
- package/lib/typescript/module/tabs/Tabs.d.ts +4 -4
- package/lib/typescript/module/tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/module/tabs/index.d.ts +2 -2
- package/lib/typescript/module/tabs/index.d.ts.map +1 -1
- package/lib/typescript/module/tabs/types.d.ts +3 -3
- package/lib/typescript/module/tabs/types.d.ts.map +1 -1
- package/lib/typescript/module/text-field/index.d.ts +8 -8
- package/lib/typescript/module/text-field/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/style-builder.d.ts +6 -6
- package/lib/typescript/module/theme/index.d.ts +2 -0
- package/lib/typescript/module/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/use-navigation-theme.d.ts +31 -0
- package/lib/typescript/module/theme/use-navigation-theme.d.ts.map +1 -0
- package/lib/typescript/module/tooltip/index.d.ts +6 -6
- package/lib/typescript/module/tooltip/index.d.ts.map +1 -1
- package/lib/typescript/module/tooltip/index.web.d.ts +6 -6
- package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/public-api-contract.test.ts +54 -0
- package/src/__tests__/useNavigationTheme.test.tsx +227 -0
- package/src/admonition/index.tsx +22 -21
- package/src/combobox/Combobox.tsx +14 -14
- package/src/context-menu/ContextMenu.stories.tsx +26 -18
- package/src/context-menu/context.ts +2 -2
- package/src/context-menu/index.tsx +24 -24
- package/src/context-menu/index.web.tsx +26 -26
- package/src/context-menu/types.ts +6 -6
- package/src/dialog/SheetShell.tsx +1 -1
- package/src/field/Field.stories.tsx +3 -3
- package/src/index.ts +11 -11
- package/src/index.web.ts +11 -11
- package/src/input-group/InputGroup.stories.tsx +4 -4
- package/src/input-group/InputGroup.tsx +1 -1
- package/src/input-group/types.ts +1 -1
- package/src/menu/Menu.stories.tsx +35 -35
- package/src/menu/context.ts +2 -2
- package/src/menu/index.tsx +15 -15
- package/src/menu/index.web.tsx +14 -14
- package/src/menu/types.ts +5 -5
- package/src/popover/Popover.stories.tsx +13 -13
- package/src/popover/context.ts +1 -1
- package/src/popover/index.tsx +5 -5
- package/src/popover/index.web.tsx +5 -5
- package/src/popover/types.ts +1 -1
- package/src/search-input/index.tsx +7 -7
- package/src/segmented-control/index.tsx +15 -15
- package/src/select/Select.stories.tsx +32 -23
- package/src/select/common.ts +1 -1
- package/src/select/index.tsx +39 -43
- package/src/select/index.web.tsx +33 -37
- package/src/select/types.ts +10 -10
- package/src/tabs/Tabs.tsx +9 -9
- package/src/tabs/index.ts +2 -2
- package/src/tabs/types.ts +3 -3
- package/src/text-field/TextField.stories.tsx +5 -5
- package/src/text-field/index.tsx +12 -12
- package/src/theme/color-scope/style-builder.ts +6 -6
- package/src/theme/index.ts +2 -0
- package/src/theme/use-navigation-theme.ts +59 -0
- package/src/tooltip/index.tsx +6 -6
- package/src/tooltip/index.web.tsx +6 -6
|
@@ -40,21 +40,21 @@ const InternalContext = createContext<{
|
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```tsx
|
|
43
|
-
* <SegmentedControl
|
|
44
|
-
* <
|
|
45
|
-
* <
|
|
43
|
+
* <SegmentedControl value={value} onChange={setValue}>
|
|
44
|
+
* <SegmentedControlItem value="one">
|
|
45
|
+
* <SegmentedControlItemText value="one">
|
|
46
46
|
* One
|
|
47
|
-
* </
|
|
48
|
-
* </
|
|
49
|
-
* <
|
|
50
|
-
* <
|
|
47
|
+
* </SegmentedControlItemText>
|
|
48
|
+
* </SegmentedControlItem>
|
|
49
|
+
* <SegmentedControlItem value="two">
|
|
50
|
+
* <SegmentedControlItemText value="two">
|
|
51
51
|
* Two
|
|
52
|
-
* </
|
|
53
|
-
* </
|
|
54
|
-
* </SegmentedControl
|
|
52
|
+
* </SegmentedControlItemText>
|
|
53
|
+
* </SegmentedControlItem>
|
|
54
|
+
* </SegmentedControl>
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
|
-
export function
|
|
57
|
+
export function SegmentedControl<T extends string>({
|
|
58
58
|
label,
|
|
59
59
|
type = 'radio',
|
|
60
60
|
size = 'large',
|
|
@@ -146,7 +146,7 @@ const InternalItemContext = createContext<{
|
|
|
146
146
|
active: boolean;
|
|
147
147
|
} | null>(null);
|
|
148
148
|
|
|
149
|
-
export function
|
|
149
|
+
export function SegmentedControlItem({
|
|
150
150
|
value,
|
|
151
151
|
style,
|
|
152
152
|
children,
|
|
@@ -177,7 +177,7 @@ export function Item({
|
|
|
177
177
|
const ctx = useContext(InternalContext);
|
|
178
178
|
if (!ctx) {
|
|
179
179
|
throw new Error(
|
|
180
|
-
'
|
|
180
|
+
'SegmentedControlItem must be used within a SegmentedControl',
|
|
181
181
|
);
|
|
182
182
|
}
|
|
183
183
|
|
|
@@ -264,7 +264,7 @@ export function Item({
|
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
export function
|
|
267
|
+
export function SegmentedControlItemText({
|
|
268
268
|
style,
|
|
269
269
|
children,
|
|
270
270
|
...props
|
|
@@ -276,7 +276,7 @@ export function ItemText({
|
|
|
276
276
|
const ctx = useContext(InternalItemContext);
|
|
277
277
|
if (!ctx) {
|
|
278
278
|
throw new Error(
|
|
279
|
-
'
|
|
279
|
+
'SegmentedControlItemText must be used within a SegmentedControlItem',
|
|
280
280
|
);
|
|
281
281
|
}
|
|
282
282
|
|
|
@@ -2,7 +2,16 @@ 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
|
|
5
|
+
import {
|
|
6
|
+
Select,
|
|
7
|
+
SelectTrigger,
|
|
8
|
+
SelectValue,
|
|
9
|
+
SelectIcon,
|
|
10
|
+
SelectContent,
|
|
11
|
+
SelectItem,
|
|
12
|
+
SelectItemIndicator,
|
|
13
|
+
SelectItemText,
|
|
14
|
+
} from './index';
|
|
6
15
|
|
|
7
16
|
const meta: Meta = {
|
|
8
17
|
title: 'Components/Select',
|
|
@@ -25,44 +34,44 @@ const FRUITS: Option[] = [
|
|
|
25
34
|
function BasicSelect() {
|
|
26
35
|
const [value, setValue] = useState<string>('apple');
|
|
27
36
|
return (
|
|
28
|
-
<Select
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
</
|
|
33
|
-
<
|
|
37
|
+
<Select value={value} onValueChange={setValue}>
|
|
38
|
+
<SelectTrigger label="Pick a fruit">
|
|
39
|
+
<SelectValue placeholder="Pick a fruit" />
|
|
40
|
+
<SelectIcon />
|
|
41
|
+
</SelectTrigger>
|
|
42
|
+
<SelectContent
|
|
34
43
|
label="Pick a fruit"
|
|
35
44
|
items={FRUITS}
|
|
36
45
|
renderItem={(item) => (
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
</
|
|
46
|
+
<SelectItem value={item.value} label={item.label}>
|
|
47
|
+
<SelectItemIndicator />
|
|
48
|
+
<SelectItemText>{item.label}</SelectItemText>
|
|
49
|
+
</SelectItem>
|
|
41
50
|
)}
|
|
42
51
|
/>
|
|
43
|
-
</Select
|
|
52
|
+
</Select>
|
|
44
53
|
);
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
function UncontrolledSelect() {
|
|
48
57
|
const [value, setValue] = useState<string | undefined>(undefined);
|
|
49
58
|
return (
|
|
50
|
-
<Select
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
</
|
|
55
|
-
<
|
|
59
|
+
<Select value={value} onValueChange={setValue}>
|
|
60
|
+
<SelectTrigger label="Pick a fruit">
|
|
61
|
+
<SelectValue placeholder="No fruit selected" />
|
|
62
|
+
<SelectIcon />
|
|
63
|
+
</SelectTrigger>
|
|
64
|
+
<SelectContent
|
|
56
65
|
label="Pick a fruit"
|
|
57
66
|
items={FRUITS}
|
|
58
67
|
renderItem={(item) => (
|
|
59
|
-
<
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
</
|
|
68
|
+
<SelectItem value={item.value} label={item.label}>
|
|
69
|
+
<SelectItemIndicator />
|
|
70
|
+
<SelectItemText>{item.label}</SelectItemText>
|
|
71
|
+
</SelectItem>
|
|
63
72
|
)}
|
|
64
73
|
/>
|
|
65
|
-
</Select
|
|
74
|
+
</Select>
|
|
66
75
|
);
|
|
67
76
|
}
|
|
68
77
|
|
package/src/select/common.ts
CHANGED
|
@@ -28,6 +28,6 @@ export const ItemContext = createContext<SelectItemContextValue>({
|
|
|
28
28
|
});
|
|
29
29
|
ItemContext.displayName = 'SelectItemContext';
|
|
30
30
|
|
|
31
|
-
export function
|
|
31
|
+
export function useSelectItemContext(): SelectItemContextValue {
|
|
32
32
|
return useContext(ItemContext);
|
|
33
33
|
}
|
package/src/select/index.tsx
CHANGED
|
@@ -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,
|
|
22
|
+
import { defaultItemValueExtractor, ItemContext, useSelectItemContext } from './common';
|
|
23
23
|
import type {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
SelectContentProps,
|
|
25
|
+
SelectIconProps,
|
|
26
|
+
SelectItemIndicatorProps,
|
|
27
|
+
SelectItemProps,
|
|
28
|
+
SelectItemTextProps,
|
|
29
|
+
SelectProps,
|
|
30
30
|
SelectItemContextValue,
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
SelectTriggerProps,
|
|
32
|
+
SelectValueProps,
|
|
33
33
|
} from './types';
|
|
34
34
|
|
|
35
|
-
export {
|
|
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<
|
|
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
|
|
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
|
-
//
|
|
62
|
+
// Select
|
|
63
63
|
// ---------------------------------------------------------------------------
|
|
64
64
|
|
|
65
|
-
export function
|
|
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
|
-
//
|
|
84
|
+
// SelectTrigger
|
|
85
85
|
// ---------------------------------------------------------------------------
|
|
86
86
|
|
|
87
|
-
export function
|
|
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
|
-
//
|
|
127
|
+
// SelectValue
|
|
128
128
|
// ---------------------------------------------------------------------------
|
|
129
129
|
|
|
130
|
-
export function
|
|
130
|
+
export function SelectValue({
|
|
131
131
|
placeholder,
|
|
132
132
|
children: extractLabel = defaultExtractLabel,
|
|
133
133
|
style,
|
|
134
|
-
}:
|
|
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
|
-
//
|
|
162
|
+
// SelectIcon
|
|
163
163
|
// ---------------------------------------------------------------------------
|
|
164
164
|
|
|
165
|
-
export function
|
|
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
|
-
//
|
|
171
|
+
// SelectContent
|
|
172
172
|
// ---------------------------------------------------------------------------
|
|
173
173
|
|
|
174
|
-
export function
|
|
174
|
+
export function SelectContent<T>({
|
|
175
175
|
items,
|
|
176
176
|
valueExtractor = defaultItemValueExtractor,
|
|
177
177
|
...props
|
|
178
|
-
}:
|
|
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
|
-
<
|
|
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
|
|
205
|
-
Pick<
|
|
204
|
+
type SelectContentInnerProps<T> = SelectContentProps<T> &
|
|
205
|
+
Pick<SelectProps, 'value' | 'onValueChange' | 'disabled'> & {
|
|
206
206
|
control: DialogControlProps;
|
|
207
207
|
};
|
|
208
208
|
|
|
209
|
-
function
|
|
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
|
-
}:
|
|
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
|
-
//
|
|
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
|
-
//
|
|
310
|
+
// SelectItemText
|
|
315
311
|
// ---------------------------------------------------------------------------
|
|
316
312
|
|
|
317
|
-
export function
|
|
318
|
-
const { selected } =
|
|
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
|
-
//
|
|
330
|
+
// SelectItemIndicator
|
|
335
331
|
// ---------------------------------------------------------------------------
|
|
336
332
|
|
|
337
|
-
export function
|
|
338
|
-
const { selected } =
|
|
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
|
-
//
|
|
348
|
+
// SelectSeparator
|
|
353
349
|
// ---------------------------------------------------------------------------
|
|
354
350
|
|
|
355
|
-
export function
|
|
351
|
+
export function SelectSeparator() {
|
|
356
352
|
const theme = useTheme();
|
|
357
353
|
|
|
358
354
|
return (
|
package/src/select/index.web.tsx
CHANGED
|
@@ -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,
|
|
14
|
+
import { defaultItemValueExtractor, ItemContext, useSelectItemContext } from './common';
|
|
15
15
|
import type {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
SelectContentProps,
|
|
17
|
+
SelectIconProps,
|
|
18
|
+
SelectItemIndicatorProps,
|
|
19
|
+
SelectItemProps,
|
|
20
|
+
SelectItemTextProps,
|
|
21
|
+
SelectProps,
|
|
22
22
|
SelectItemContextValue,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
SelectTriggerProps,
|
|
24
|
+
SelectValueProps,
|
|
25
25
|
} from './types';
|
|
26
26
|
|
|
27
|
-
export {
|
|
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<
|
|
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
|
|
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
|
-
//
|
|
53
|
+
// Select
|
|
54
54
|
// ---------------------------------------------------------------------------
|
|
55
55
|
|
|
56
|
-
export function
|
|
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
|
-
//
|
|
75
|
+
// SelectTrigger
|
|
76
76
|
// ---------------------------------------------------------------------------
|
|
77
77
|
|
|
78
|
-
export function
|
|
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
|
-
//
|
|
136
|
+
// SelectValue
|
|
137
137
|
// ---------------------------------------------------------------------------
|
|
138
138
|
|
|
139
|
-
export function
|
|
139
|
+
export function SelectValue({
|
|
140
140
|
children: extractLabel,
|
|
141
141
|
placeholder,
|
|
142
142
|
style,
|
|
143
|
-
}:
|
|
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
|
-
//
|
|
164
|
+
// SelectIcon
|
|
165
165
|
// ---------------------------------------------------------------------------
|
|
166
166
|
|
|
167
|
-
export function
|
|
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
|
-
//
|
|
173
|
+
// SelectContent
|
|
174
174
|
// ---------------------------------------------------------------------------
|
|
175
175
|
|
|
176
|
-
export function
|
|
176
|
+
export function SelectContent<T>({
|
|
177
177
|
items,
|
|
178
178
|
renderItem,
|
|
179
179
|
label = 'Select an option',
|
|
180
180
|
valueExtractor = defaultItemValueExtractor,
|
|
181
|
-
}:
|
|
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
|
-
//
|
|
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
|
-
//
|
|
266
|
+
// SelectItemText
|
|
271
267
|
// ---------------------------------------------------------------------------
|
|
272
268
|
|
|
273
|
-
export function
|
|
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
|
-
//
|
|
278
|
+
// SelectItemIndicator
|
|
283
279
|
// ---------------------------------------------------------------------------
|
|
284
280
|
|
|
285
|
-
export function
|
|
286
|
-
const { selected } =
|
|
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
|
-
//
|
|
296
|
+
// SelectSeparator
|
|
301
297
|
// ---------------------------------------------------------------------------
|
|
302
298
|
|
|
303
|
-
export function
|
|
299
|
+
export function SelectSeparator() {
|
|
304
300
|
const theme = useTheme();
|
|
305
301
|
|
|
306
302
|
return (
|
package/src/select/types.ts
CHANGED
|
@@ -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
|
|
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
|
|
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 `
|
|
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
|
|
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
|
|
49
|
+
export type SelectIconProps = {
|
|
50
50
|
style?: TextStyle;
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
export type
|
|
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 `
|
|
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
|
|
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
|
|
84
|
+
export type SelectItemTextProps = {
|
|
85
85
|
children: React.ReactNode;
|
|
86
86
|
style?: TextStyle;
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
export type
|
|
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,
|
|
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<
|
|
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<
|
|
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
|
|
194
|
-
|
|
193
|
+
export const Tabs = memo(TabsBarComponent);
|
|
194
|
+
Tabs.displayName = 'Tabs';
|
|
195
195
|
|
|
196
|
-
export const
|
|
197
|
-
|
|
196
|
+
export const TabsTrigger = memo(TabComponent);
|
|
197
|
+
TabsTrigger.displayName = 'TabsTrigger';
|
|
198
198
|
|
|
199
|
-
export const
|
|
200
|
-
|
|
199
|
+
export const TabsContent = memo(TabPanelComponent);
|
|
200
|
+
TabsContent.displayName = 'TabsContent';
|
package/src/tabs/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { TabsProps,
|
|
1
|
+
export { Tabs, TabsTrigger, TabsContent } from './Tabs';
|
|
2
|
+
export type { TabsProps, TabsTriggerProps, TabsContentProps, TabsVariant } from './types';
|