@utilitywarehouse/hearth-react-native 0.35.7 → 0.35.9
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/SKILL.md +129 -3
- package/build/components/Accordion/Accordion.figma.d.ts +15 -0
- package/build/components/Accordion/Accordion.figma.js +20 -0
- package/build/components/Accordion/AccordionItem.figma.d.ts +17 -0
- package/build/components/Accordion/AccordionItem.figma.js +26 -0
- package/build/components/Accordion/AccordionTrigger.js +1 -1
- package/build/components/Alert/Alert.figma.d.ts +33 -0
- package/build/components/Alert/Alert.figma.js +40 -0
- package/build/components/Avatar/Avatar.figma.d.ts +16 -0
- package/build/components/Avatar/Avatar.figma.js +29 -0
- package/build/components/Badge/Badge.figma.d.ts +21 -0
- package/build/components/Badge/Badge.figma.js +47 -0
- package/build/components/Banner/Banner.figma.d.ts +26 -0
- package/build/components/Banner/Banner.figma.js +47 -0
- package/build/components/Banner/BannerIllustration.figma.d.ts +11 -0
- package/build/components/Banner/BannerIllustration.figma.js +13 -0
- package/build/components/BottomSheet/BottomSheetModal.figma.d.ts +11 -0
- package/build/components/BottomSheet/BottomSheetModal.figma.js +11 -0
- package/build/components/Button/Button.figma.d.ts +38 -0
- package/build/components/Button/Button.figma.js +84 -0
- package/build/components/Card/Card.figma.d.ts +16 -0
- package/build/components/Card/Card.figma.js +49 -0
- package/build/components/Card/CardAction/CardAction.figma.d.ts +35 -0
- package/build/components/Card/CardAction/CardAction.figma.js +104 -0
- package/build/components/Card/CardAction/CardActionRoot.js +4 -0
- package/build/components/Card/CardRoot.js +5 -1
- package/build/components/Carousel/Carousel.figma.d.ts +17 -0
- package/build/components/Carousel/Carousel.figma.js +18 -0
- package/build/components/Checkbox/Checkbox.figma.d.ts +22 -0
- package/build/components/Checkbox/Checkbox.figma.js +29 -0
- package/build/components/Checkbox/CheckboxGroup.figma.d.ts +26 -0
- package/build/components/Checkbox/CheckboxGroup.figma.js +46 -0
- package/build/components/Checkbox/CheckboxImage.figma.d.ts +11 -0
- package/build/components/Checkbox/CheckboxImage.figma.js +10 -0
- package/build/components/Checkbox/CheckboxTileRoot.figma.d.ts +20 -0
- package/build/components/Checkbox/CheckboxTileRoot.figma.js +22 -0
- package/build/components/Combobox/Combobox.figma.d.ts +23 -0
- package/build/components/Combobox/Combobox.figma.js +69 -0
- package/build/components/CurrencyInput/CurrencyInput.figma.d.ts +31 -0
- package/build/components/CurrencyInput/CurrencyInput.figma.js +51 -0
- package/build/components/DateInput/DateInput.figma.d.ts +41 -0
- package/build/components/DateInput/DateInput.figma.js +87 -0
- package/build/components/DatePicker/DatePicker.figma.d.ts +25 -0
- package/build/components/DatePicker/DatePicker.figma.js +23 -0
- package/build/components/DatePicker/DatePickerDay.js +3 -3
- package/build/components/DatePickerInput/DatePickerInput.figma.d.ts +25 -0
- package/build/components/DatePickerInput/DatePickerInput.figma.js +52 -0
- package/build/components/DescriptionList/DescriptionList.figma.d.ts +26 -0
- package/build/components/DescriptionList/DescriptionList.figma.js +59 -0
- package/build/components/DescriptionList/DescriptionListItem.figma.d.ts +22 -0
- package/build/components/DescriptionList/DescriptionListItem.figma.js +42 -0
- package/build/components/Divider/Divider.figma.d.ts +13 -0
- package/build/components/Divider/Divider.figma.js +14 -0
- package/build/components/ExpandableCard/ExpandableCard.figma.d.ts +28 -0
- package/build/components/ExpandableCard/ExpandableCard.figma.js +52 -0
- package/build/components/ExpandableCard/ExpandableCardGroup.figma.d.ts +23 -0
- package/build/components/ExpandableCard/ExpandableCardGroup.figma.js +55 -0
- package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +4 -0
- package/build/components/FormField/FormField.figma.d.ts +15 -0
- package/build/components/FormField/FormField.figma.js +27 -0
- package/build/components/Helper/HelperText.figma.d.ts +13 -0
- package/build/components/Helper/HelperText.figma.js +12 -0
- package/build/components/HighlightBanner/HighlightBanner.figma.d.ts +19 -0
- package/build/components/HighlightBanner/HighlightBanner.figma.js +45 -0
- package/build/components/IconButton/IconButton.figma.d.ts +22 -0
- package/build/components/IconButton/IconButton.figma.js +47 -0
- package/build/components/IconContainer/IconContainer.figma.d.ts +20 -0
- package/build/components/IconContainer/IconContainer.figma.js +43 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.figma.d.ts +17 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.figma.js +23 -0
- package/build/components/InlineLink/InlineLink.d.ts +1 -1
- package/build/components/InlineLink/InlineLink.js +7 -2
- package/build/components/InlineLink/InlineLink.props.d.ts +2 -0
- package/build/components/InlineLink/InlineLinkRoot.d.ts +1 -1
- package/build/components/InlineLink/InlineLinkRoot.js +8 -3
- package/build/components/Input/Input.figma.d.ts +28 -0
- package/build/components/Input/Input.figma.js +67 -0
- package/build/components/Input/Input_1.figma.d.ts +22 -0
- package/build/components/Input/Input_1.figma.js +54 -0
- package/build/components/Input/Input_2.figma.d.ts +17 -0
- package/build/components/Input/Input_2.figma.js +34 -0
- package/build/components/Label/Label.figma.d.ts +14 -0
- package/build/components/Label/Label.figma.js +19 -0
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.figma.d.ts +27 -0
- package/build/components/Link/Link.figma.js +45 -0
- package/build/components/Link/Link.js +7 -2
- package/build/components/Link/Link.props.d.ts +2 -0
- package/build/components/Link/LinkRoot.d.ts +1 -1
- package/build/components/Link/LinkRoot.js +8 -3
- package/build/components/List/List.figma.d.ts +21 -0
- package/build/components/List/List.figma.js +49 -0
- package/build/components/List/ListAction/ListAction.figma.d.ts +15 -0
- package/build/components/List/ListAction/ListAction.figma.js +17 -0
- package/build/components/List/ListAction/ListAction.js +1 -0
- package/build/components/List/ListItem/ListItem.figma.d.ts +33 -0
- package/build/components/List/ListItem/ListItem.figma.js +83 -0
- package/build/components/List/ListItem/ListItemHelperText.d.ts +1 -1
- package/build/components/List/ListItem/ListItemHelperText.js +2 -8
- package/build/components/List/ListItem/ListItemLeadingContent.figma.d.ts +14 -0
- package/build/components/List/ListItem/ListItemLeadingContent.figma.js +17 -0
- package/build/components/List/ListItem/ListItemRoot.js +1 -0
- package/build/components/List/ListItem/ListItemTrailingContent.figma.d.ts +13 -0
- package/build/components/List/ListItem/ListItemTrailingContent.figma.js +14 -0
- package/build/components/Menu/Menu.figma.d.ts +14 -0
- package/build/components/Menu/Menu.figma.js +33 -0
- package/build/components/Menu/MenuItem.figma.d.ts +29 -0
- package/build/components/Menu/MenuItem.figma.js +45 -0
- package/build/components/Modal/Modal.figma.d.ts +24 -0
- package/build/components/Modal/Modal.figma.js +64 -0
- package/build/components/NavModal/NavModal.figma.d.ts +19 -0
- package/build/components/NavModal/NavModal.figma.js +42 -0
- package/build/components/Pagination/Pagination.figma.d.ts +16 -0
- package/build/components/Pagination/Pagination.figma.js +20 -0
- package/build/components/PillGroup/Pill.figma.d.ts +17 -0
- package/build/components/PillGroup/Pill.figma.js +21 -0
- package/build/components/PillGroup/PillGroup.figma.d.ts +13 -0
- package/build/components/PillGroup/PillGroup.figma.js +18 -0
- package/build/components/ProgressBar/ProgressBar.circular.figma.d.ts +16 -0
- package/build/components/ProgressBar/ProgressBar.circular.figma.js +35 -0
- package/build/components/ProgressBar/ProgressBar.figma.d.ts +15 -0
- package/build/components/ProgressBar/ProgressBar.figma.js +31 -0
- package/build/components/ProgressStepper/ProgressStep.figma.d.ts +15 -0
- package/build/components/ProgressStepper/ProgressStep.figma.js +17 -0
- package/build/components/ProgressStepper/ProgressStepper.figma.d.ts +13 -0
- package/build/components/ProgressStepper/ProgressStepper.figma.js +14 -0
- package/build/components/Radio/Radio.figma.d.ts +15 -0
- package/build/components/Radio/Radio.figma.js +17 -0
- package/build/components/Radio/RadioGroup.figma.d.ts +19 -0
- package/build/components/Radio/RadioGroup.figma.js +45 -0
- package/build/components/Radio/RadioImage.figma.d.ts +11 -0
- package/build/components/Radio/RadioImage.figma.js +10 -0
- package/build/components/Radio/RadioTile.figma.d.ts +16 -0
- package/build/components/Radio/RadioTile.figma.js +23 -0
- package/build/components/RadioCard/RadioCard.figma.d.ts +16 -0
- package/build/components/RadioCard/RadioCard.figma.js +22 -0
- package/build/components/RadioCard/RadioCardIndicator.js +0 -3
- package/build/components/RadioCard/RadioCardRoot.js +3 -3
- package/build/components/Rating/Rating.figma.d.ts +12 -0
- package/build/components/Rating/Rating.figma.js +18 -0
- package/build/components/Roundel/Roundel.figma.d.ts +13 -0
- package/build/components/Roundel/Roundel.figma.js +15 -0
- package/build/components/SectionHeader/SectionHeader.figma.d.ts +21 -0
- package/build/components/SectionHeader/SectionHeader.figma.js +50 -0
- package/build/components/SegmentedControl/SegmentedControl.figma.d.ts +16 -0
- package/build/components/SegmentedControl/SegmentedControl.figma.js +20 -0
- package/build/components/SegmentedControl/SegmentedControlOption.figma.d.ts +17 -0
- package/build/components/SegmentedControl/SegmentedControlOption.figma.js +23 -0
- package/build/components/SegmentedControl/SegmentedControlOption.js +3 -0
- package/build/components/Select/Select.figma.d.ts +24 -0
- package/build/components/Select/Select.figma.js +65 -0
- package/build/components/Select/SelectOption.figma.d.ts +15 -0
- package/build/components/Select/SelectOption.figma.js +27 -0
- package/build/components/Spinner/Spinner.figma.d.ts +13 -0
- package/build/components/Spinner/Spinner.figma.js +16 -0
- package/build/components/Spinner/Spinner.js +1 -1
- package/build/components/Spinner/Spinner.web.js +1 -1
- package/build/components/StepperInput/StepperInput.figma.d.ts +25 -0
- package/build/components/StepperInput/StepperInput.figma.js +32 -0
- package/build/components/Switch/Switch.figma.d.ts +15 -0
- package/build/components/Switch/Switch.figma.js +18 -0
- package/build/components/Switch/Switch.js +25 -1
- package/build/components/Switch/Switch.web.js +25 -1
- package/build/components/Table/Table.figma.d.ts +14 -0
- package/build/components/Table/Table.figma.js +38 -0
- package/build/components/Table/TableHeaderCell.figma.d.ts +15 -0
- package/build/components/Table/TableHeaderCell.figma.js +31 -0
- package/build/components/Tabs/Tab.figma.d.ts +14 -0
- package/build/components/Tabs/Tab.figma.js +14 -0
- package/build/components/Tabs/Tab.js +6 -6
- package/build/components/Tabs/Tabs.figma.d.ts +14 -0
- package/build/components/Tabs/Tabs.figma.js +21 -0
- package/build/components/Textarea/Textarea.figma.d.ts +27 -0
- package/build/components/Textarea/Textarea.figma.js +53 -0
- package/build/components/TimePicker/TimePicker.figma.d.ts +16 -0
- package/build/components/TimePicker/TimePicker.figma.js +30 -0
- package/build/components/TimePickerInput/TimePickerInput.figma.d.ts +29 -0
- package/build/components/TimePickerInput/TimePickerInput.figma.js +53 -0
- package/build/components/Timeline/Timeline.figma.d.ts +14 -0
- package/build/components/Timeline/Timeline.figma.js +23 -0
- package/build/components/Timeline/TimelineItemProgress.figma.d.ts +16 -0
- package/build/components/Timeline/TimelineItemProgress.figma.js +30 -0
- package/build/components/Timeline/TimelineItemStatic.figma.d.ts +16 -0
- package/build/components/Timeline/TimelineItemStatic.figma.js +30 -0
- package/build/components/Toast/ToastItem.figma.d.ts +20 -0
- package/build/components/Toast/ToastItem.figma.js +42 -0
- package/build/components/ToggleButton/ToggleButtonRoot.js +1 -1
- package/build/components/ToggleButtonCard/ToggleButtonCard.figma.d.ts +14 -0
- package/build/components/ToggleButtonCard/ToggleButtonCard.figma.js +28 -0
- package/build/components/ToggleButtonCard/ToggleButtonCardRoot.js +16 -8
- package/build/components/UnstyledIconButton/UnstyledIconButton.figma.d.ts +21 -0
- package/build/components/UnstyledIconButton/UnstyledIconButton.figma.js +32 -0
- package/build/components/UnstyledIconButton/UnstyledIconButtonRoot.js +1 -1
- package/build/components/VerificationInput/VerificationInput.figma.d.ts +19 -0
- package/build/components/VerificationInput/VerificationInput.figma.js +22 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/core/themes.d.ts +16 -16
- package/package.json +5 -4
- package/public/llms/components/list.md +6 -11
- package/public/llms/docs/{ai-tooling.md → ai-toolkit.md} +29 -7
- package/public/llms/docs/introduction.md +1 -1
- package/public/llms.txt +1 -1
|
@@ -67,7 +67,7 @@ const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = '
|
|
|
67
67
|
const onPressOut = () => {
|
|
68
68
|
scale.value = withSpring(1);
|
|
69
69
|
};
|
|
70
|
-
return (_jsx(Pressable, { onPress: toggleSwitch, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, "aria-checked": value, accessibilityRole: "switch", accessibilityState: { checked: value, disabled }, accessibilityLabel: accessibilityProps.accessibilityLabel, accessibilityHint: accessibilityProps.accessibilityHint, ...accessibilityProps, children: _jsx(AnimatedView, { style: [styles.switch, animatedSwitchBackgroundStyle, animatedSwitchStyle], children: _jsxs(AnimatedView, { style: [styles.thumb, animatedThumbStyle], children: [_jsx(AnimatedView, { style: [styles.iconWrap, animatedTickStyle], children: (() => {
|
|
70
|
+
return (_jsx(Pressable, { onPress: toggleSwitch, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, "aria-checked": value, accessibilityRole: "switch", accessibilityState: { checked: value, disabled }, accessibilityLabel: accessibilityProps.accessibilityLabel, accessibilityHint: accessibilityProps.accessibilityHint, style: styles.pressable, ...accessibilityProps, children: _jsx(AnimatedView, { style: [styles.switch, animatedSwitchBackgroundStyle, animatedSwitchStyle], children: _jsxs(AnimatedView, { style: [styles.thumb, animatedThumbStyle], children: [_jsx(AnimatedView, { style: [styles.iconWrap, animatedTickStyle], children: (() => {
|
|
71
71
|
const IconAny = Icon;
|
|
72
72
|
return _jsx(IconAny, { as: TickSmallIcon, style: styles.icon });
|
|
73
73
|
})() }), _jsx(AnimatedView, { style: [styles.iconWrap, animatedCrossStyle], children: (() => {
|
|
@@ -76,6 +76,20 @@ const CustomSwitch = ({ value = false, onValueChange, disabled = false, size = '
|
|
|
76
76
|
})() })] }) }) }));
|
|
77
77
|
};
|
|
78
78
|
const styles = StyleSheet.create(theme => ({
|
|
79
|
+
pressable: {
|
|
80
|
+
variants: {
|
|
81
|
+
disabled: {
|
|
82
|
+
false: {
|
|
83
|
+
_web: {
|
|
84
|
+
'_focus-visible': { outline: 'none' },
|
|
85
|
+
'_focus-visible > div:nth-child(1)': {
|
|
86
|
+
...theme.helpers.focusVisible,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
79
93
|
switch: {
|
|
80
94
|
justifyContent: 'center',
|
|
81
95
|
variants: {
|
|
@@ -96,9 +110,19 @@ const styles = StyleSheet.create(theme => ({
|
|
|
96
110
|
value: {
|
|
97
111
|
true: {
|
|
98
112
|
backgroundColor: theme.color.interactive.brand.surface.strong.default,
|
|
113
|
+
_web: {
|
|
114
|
+
_hover: {
|
|
115
|
+
backgroundColor: theme.color.interactive.brand.surface.strong.hover,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
99
118
|
},
|
|
100
119
|
false: {
|
|
101
120
|
backgroundColor: theme.color.interactive.functional.surface.strong.default,
|
|
121
|
+
_web: {
|
|
122
|
+
_hover: {
|
|
123
|
+
backgroundColor: theme.color.interactive.functional.surface.strong.hover,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
102
126
|
},
|
|
103
127
|
},
|
|
104
128
|
disabled: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
container: string | undefined;
|
|
10
|
+
pagination: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6403-17515&t=pZwKJYFo1y1QRQD1-4
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Table/Table.tsx
|
|
3
|
+
// component=Table
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const container = instance.getEnum('Container', {
|
|
7
|
+
Subtle: 'subtle',
|
|
8
|
+
Emphasis: 'emphasis',
|
|
9
|
+
None: 'none',
|
|
10
|
+
});
|
|
11
|
+
const pagination = instance.getBoolean('Pagination?');
|
|
12
|
+
export default {
|
|
13
|
+
id: 'Table',
|
|
14
|
+
imports: [
|
|
15
|
+
"import { ExpandSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';",
|
|
16
|
+
"import { UnstyledIconButton, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TableRow } from '@utilitywarehouse/hearth-react-native';",
|
|
17
|
+
],
|
|
18
|
+
example: figma.code `<Table${figma.helpers.react.renderProp('container', container)}${figma.helpers.react.renderProp('pagination', pagination)}>
|
|
19
|
+
<TableHeader color="purple">
|
|
20
|
+
<TableHeaderCell trailingContent={<UnstyledIconButton accessibilityLabel="Sort" icon={ExpandSmallIcon} inverted size="sm" />}>
|
|
21
|
+
Header
|
|
22
|
+
</TableHeaderCell>
|
|
23
|
+
<TableHeaderCell trailingContent={<UnstyledIconButton accessibilityLabel="Sort" icon={ExpandSmallIcon} inverted size="sm" />}>
|
|
24
|
+
Header
|
|
25
|
+
</TableHeaderCell>
|
|
26
|
+
</TableHeader>
|
|
27
|
+
<TableBody>
|
|
28
|
+
<TableRow>
|
|
29
|
+
<TableHeaderCell row>Row title</TableHeaderCell>
|
|
30
|
+
<TableCell>Value</TableCell>
|
|
31
|
+
</TableRow>
|
|
32
|
+
</TableBody>
|
|
33
|
+
</Table>`,
|
|
34
|
+
metadata: {
|
|
35
|
+
nestable: true,
|
|
36
|
+
props: { container, pagination },
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
sort: boolean;
|
|
10
|
+
color: string | undefined;
|
|
11
|
+
variant: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6414-6728&t=pZwKJYFo1y1QRQD1-4
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Table/TableHeaderCell.tsx
|
|
3
|
+
// component=TableHeaderCell
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const sort = instance.getBoolean('Sort?');
|
|
7
|
+
const color = instance.getEnum('Color', {
|
|
8
|
+
Purple: 'purple',
|
|
9
|
+
White: 'white',
|
|
10
|
+
});
|
|
11
|
+
const variant = instance.getEnum('Variant', {
|
|
12
|
+
Text: 'text',
|
|
13
|
+
Blank: 'blank',
|
|
14
|
+
});
|
|
15
|
+
const trailingContent = sort
|
|
16
|
+
? figma.code `<UnstyledIconButton accessibilityLabel="Sort" icon={ExpandSmallIcon} size="sm" />`
|
|
17
|
+
: '';
|
|
18
|
+
export default {
|
|
19
|
+
id: 'TableHeaderCell',
|
|
20
|
+
imports: [
|
|
21
|
+
"import { ExpandSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';",
|
|
22
|
+
"import { UnstyledIconButton, TableHeaderCell } from '@utilitywarehouse/hearth-react-native';",
|
|
23
|
+
],
|
|
24
|
+
example: figma.code `<TableHeaderCell${figma.helpers.react.renderProp('color', color)}${trailingContent ? ` trailingContent={${trailingContent}}` : ''}>
|
|
25
|
+
Header
|
|
26
|
+
</TableHeaderCell>`,
|
|
27
|
+
metadata: {
|
|
28
|
+
nestable: true,
|
|
29
|
+
props: { sort, color, variant },
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
label: string;
|
|
10
|
+
icon: figma.ResultSection[] | undefined;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6464-2288&m=dev
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Tabs/Tab.tsx
|
|
3
|
+
// component=Tab
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const label = figma.selectedInstance.getString('Label');
|
|
6
|
+
const icon = figma.selectedInstance.getBoolean('Icon?', {
|
|
7
|
+
true: figma.selectedInstance.getInstanceSwap('Icon-20')?.executeTemplate().example,
|
|
8
|
+
});
|
|
9
|
+
export default {
|
|
10
|
+
id: 'Tab',
|
|
11
|
+
imports: ["import { Tab } from '@utilitywarehouse/hearth-react-native';"],
|
|
12
|
+
example: figma.code `<Tab${figma.helpers.react.renderProp('value', label)}${figma.helpers.react.renderProp('icon', icon)}>${figma.helpers.react.renderChildren(label)}</Tab>`,
|
|
13
|
+
metadata: { nestable: true, props: { label, icon } },
|
|
14
|
+
};
|
|
@@ -22,7 +22,7 @@ const Tab = ({ value, children, icon, disabled, style, states, ...props }) => {
|
|
|
22
22
|
registerTabLayout(value, { x, y, width, height });
|
|
23
23
|
}, [value, registerTabLayout]);
|
|
24
24
|
return (_jsx(Pressable, { ref: ref, accessibilityRole: "tab", accessibilityState: { selected: isActive, disabled: !!(disabled || allDisabled) }, onPress: handlePress, onLayout: handleLayout, style: [styles.tab, style], ...(Platform.OS === 'web'
|
|
25
|
-
? { id: `tab-${value}`, 'aria-controls': `tabpanel-${value}
|
|
25
|
+
? { id: `tab-${value}`, 'aria-controls': `tabpanel-${value}`, 'aria-selected': isActive }
|
|
26
26
|
: null), ...props, children: _jsxs(View, { style: styles.content, children: [icon ? _jsx(Icon, { as: icon }) : null, _jsx(BodyText, { size: size, weight: "semibold", children: children })] }) }));
|
|
27
27
|
};
|
|
28
28
|
Tab.displayName = 'Tab';
|
|
@@ -38,11 +38,11 @@ const styles = StyleSheet.create(theme => ({
|
|
|
38
38
|
_hover: {
|
|
39
39
|
backgroundColor: theme.color.interactive.neutral.surface.subtle.hover,
|
|
40
40
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
'_focus-visible': {
|
|
42
|
+
...theme.helpers.focusVisible,
|
|
43
|
+
outlineOffset: -2,
|
|
44
|
+
borderRadius: theme.borderRadius.sm,
|
|
45
|
+
},
|
|
46
46
|
_active: {
|
|
47
47
|
backgroundColor: theme.color.interactive.neutral.surface.subtle.active,
|
|
48
48
|
},
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
size: string | undefined;
|
|
10
|
+
tabs: figma.ResultSection[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6464%3A8744
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Tabs/Tabs.tsx
|
|
3
|
+
// component=Tabs
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const size = figma.selectedInstance.getEnum('Size', {
|
|
6
|
+
'MD-56': 'md',
|
|
7
|
+
'LG-64': 'lg',
|
|
8
|
+
});
|
|
9
|
+
const tabs = figma.properties.children(['Tab item']);
|
|
10
|
+
export default {
|
|
11
|
+
id: 'Tabs',
|
|
12
|
+
imports: ["import { TabPanel, Tabs, TabsList } from '@utilitywarehouse/hearth-react-native';"],
|
|
13
|
+
example: figma.code `<Tabs${figma.helpers.react.renderProp('size', size)}>
|
|
14
|
+
<TabsList>${figma.helpers.react.renderChildren(tabs)}</TabsList>
|
|
15
|
+
{/* Example TabPanel content, make sure they match the value of your Tab items */}
|
|
16
|
+
<TabPanel value="account">Account content</TabPanel>
|
|
17
|
+
<TabPanel value="billing">Billing content</TabPanel>
|
|
18
|
+
<TabPanel value="usage">Usage content</TabPanel>
|
|
19
|
+
</Tabs>`,
|
|
20
|
+
metadata: { nestable: true, props: { size, tabs } },
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
disabled: boolean | undefined;
|
|
10
|
+
readonly: boolean | undefined;
|
|
11
|
+
placeholder: string | undefined;
|
|
12
|
+
value: string | undefined;
|
|
13
|
+
label: string;
|
|
14
|
+
labelVariant: string | undefined;
|
|
15
|
+
helperText: string;
|
|
16
|
+
validationStatus: string | undefined;
|
|
17
|
+
invalidText: string | undefined;
|
|
18
|
+
validText: string | undefined;
|
|
19
|
+
required: figma.EnumOptionsValues<{
|
|
20
|
+
true: boolean;
|
|
21
|
+
false: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
focused: boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=2356:5180
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Textarea/Textarea.tsx
|
|
3
|
+
// component=Textarea
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const disabled = instance.getEnum('State', { Disabled: true });
|
|
7
|
+
const readonly = instance.getEnum('State', { 'Read-only': true });
|
|
8
|
+
const placeholder = instance.getEnum('Value type', {
|
|
9
|
+
Placeholder: instance.getString('Value'),
|
|
10
|
+
});
|
|
11
|
+
const value = instance.getEnum('Value type', { Filled: instance.getString('Value') });
|
|
12
|
+
const label = instance.getString('Label');
|
|
13
|
+
const labelVariant = instance.getEnum('Label variant', { Body: 'body', Heading: 'heading' });
|
|
14
|
+
const helperText = instance.getBoolean('Helper text?', {
|
|
15
|
+
true: instance.getString('Helper text'),
|
|
16
|
+
});
|
|
17
|
+
const validationStatus = instance.getEnum('State', {
|
|
18
|
+
Invalid: 'invalid',
|
|
19
|
+
Valid: 'valid',
|
|
20
|
+
});
|
|
21
|
+
const invalidText = instance.getEnum('State', {
|
|
22
|
+
Invalid: instance.getString('Validation'),
|
|
23
|
+
});
|
|
24
|
+
const validText = instance.getEnum('State', {
|
|
25
|
+
Valid: instance.getString('Validation'),
|
|
26
|
+
});
|
|
27
|
+
const required = instance.getBoolean('Optional?', {
|
|
28
|
+
true: false,
|
|
29
|
+
false: true,
|
|
30
|
+
});
|
|
31
|
+
const focused = instance.getEnum('Focus?', { True: true });
|
|
32
|
+
export default {
|
|
33
|
+
id: 'textarea',
|
|
34
|
+
imports: ['import { Textarea } from "@utilitywarehouse/hearth-react-native";'],
|
|
35
|
+
example: figma.code `<Textarea${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('readonly', readonly)}${figma.helpers.react.renderProp('placeholder', placeholder)}${figma.helpers.react.renderProp('value', value)}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('labelVariant', labelVariant)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('invalidText', invalidText)}${figma.helpers.react.renderProp('validText', validText)}${figma.helpers.react.renderProp('required', required)}${figma.helpers.react.renderProp('focused', focused)} />`,
|
|
36
|
+
metadata: {
|
|
37
|
+
nestable: true,
|
|
38
|
+
props: {
|
|
39
|
+
disabled,
|
|
40
|
+
readonly,
|
|
41
|
+
placeholder,
|
|
42
|
+
value,
|
|
43
|
+
label,
|
|
44
|
+
labelVariant,
|
|
45
|
+
helperText,
|
|
46
|
+
validationStatus,
|
|
47
|
+
invalidText,
|
|
48
|
+
validText,
|
|
49
|
+
required,
|
|
50
|
+
focused,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
hideFooter: figma.EnumOptionsValues<{
|
|
10
|
+
true: boolean;
|
|
11
|
+
false: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10334-16770&t=Jg2fPJPQNzOyspmQ-4
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/TimePicker/TimePicker.tsx
|
|
3
|
+
// component=TimePicker
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const hideFooter = figma.selectedInstance.getBoolean('Footer?', {
|
|
6
|
+
true: false,
|
|
7
|
+
false: true,
|
|
8
|
+
});
|
|
9
|
+
export default {
|
|
10
|
+
id: 'time-picker',
|
|
11
|
+
imports: [
|
|
12
|
+
"import { useRef, useState } from 'react';",
|
|
13
|
+
"import { BottomSheetModalProvider, Button, TimePicker } from '@utilitywarehouse/hearth-react-native';",
|
|
14
|
+
"import type { DateType } from '@utilitywarehouse/hearth-react-native';",
|
|
15
|
+
],
|
|
16
|
+
example: figma.code `const pickerRef = useRef(null);
|
|
17
|
+
const [time, setTime] = useState<DateType>();
|
|
18
|
+
|
|
19
|
+
<BottomSheetModalProvider>
|
|
20
|
+
<Button onPress={() => pickerRef.current?.present()}>Choose time</Button>
|
|
21
|
+
<TimePicker
|
|
22
|
+
ref={pickerRef}
|
|
23
|
+
date={time}
|
|
24
|
+
onChange={({ date }) => setTime(date)}
|
|
25
|
+
onCancel={() => setTime(undefined)}
|
|
26
|
+
use12Hours={false}${figma.helpers.react.renderProp('hideFooter', hideFooter)}
|
|
27
|
+
/>
|
|
28
|
+
</BottomSheetModalProvider>`,
|
|
29
|
+
metadata: { nestable: true, props: { hideFooter } },
|
|
30
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
disabled: boolean | undefined;
|
|
10
|
+
validationStatus: figma.EnumOptionsValues<{
|
|
11
|
+
Default: undefined;
|
|
12
|
+
Valid: string;
|
|
13
|
+
Invalid: string;
|
|
14
|
+
}>;
|
|
15
|
+
readonly: boolean | undefined;
|
|
16
|
+
label: string;
|
|
17
|
+
validText: string | undefined;
|
|
18
|
+
invalidText: string | undefined;
|
|
19
|
+
placeholder: string | undefined;
|
|
20
|
+
value: string | undefined;
|
|
21
|
+
helperText: figma.EnumOptionsValues<{
|
|
22
|
+
true: string;
|
|
23
|
+
false: undefined;
|
|
24
|
+
}>;
|
|
25
|
+
focused: boolean | undefined;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10334-6212&t=Jg2fPJPQNzOyspmQ-4
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/TimePickerInput/TimePickerInput.tsx
|
|
3
|
+
// component=TimePickerInput
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const disabled = figma.selectedInstance.getEnum('Variant', {
|
|
6
|
+
Disabled: true,
|
|
7
|
+
});
|
|
8
|
+
const validationStatus = figma.selectedInstance.getEnum('Variant', {
|
|
9
|
+
Default: undefined,
|
|
10
|
+
Valid: 'valid',
|
|
11
|
+
Invalid: 'invalid',
|
|
12
|
+
});
|
|
13
|
+
const readonly = figma.selectedInstance.getEnum('Variant', {
|
|
14
|
+
'Read-only': true,
|
|
15
|
+
});
|
|
16
|
+
const label = figma.selectedInstance.getString('Label');
|
|
17
|
+
const validText = figma.selectedInstance.getEnum('Variant', {
|
|
18
|
+
Valid: figma.selectedInstance.getString('Validation'),
|
|
19
|
+
});
|
|
20
|
+
const invalidText = figma.selectedInstance.getEnum('Variant', {
|
|
21
|
+
Invalid: figma.selectedInstance.getString('Validation'),
|
|
22
|
+
});
|
|
23
|
+
const placeholder = figma.selectedInstance.getEnum('Value type', {
|
|
24
|
+
Placeholder: figma.selectedInstance.getString('Value'),
|
|
25
|
+
});
|
|
26
|
+
const value = figma.selectedInstance.getEnum('Value type', {
|
|
27
|
+
Filled: figma.selectedInstance.getString('Value'),
|
|
28
|
+
});
|
|
29
|
+
const helperText = figma.selectedInstance.getBoolean('Helper text?', {
|
|
30
|
+
true: figma.selectedInstance.getString('Helper text'),
|
|
31
|
+
false: undefined,
|
|
32
|
+
});
|
|
33
|
+
const focused = figma.selectedInstance.getEnum('Focus?', { Yes: true });
|
|
34
|
+
export default {
|
|
35
|
+
id: 'TimePickerInput',
|
|
36
|
+
imports: ["import { TimePickerInput } from '@utilitywarehouse/hearth-react-native';"],
|
|
37
|
+
example: figma.code `<TimePickerInput${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('readonly', readonly)}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('validText', validText)}${figma.helpers.react.renderProp('invalidText', invalidText)}${figma.helpers.react.renderProp('placeholder', placeholder)}${figma.helpers.react.renderProp('value', value)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('focused', focused)}/>`,
|
|
38
|
+
metadata: {
|
|
39
|
+
nestable: true,
|
|
40
|
+
props: {
|
|
41
|
+
disabled,
|
|
42
|
+
validationStatus,
|
|
43
|
+
readonly,
|
|
44
|
+
label,
|
|
45
|
+
validText,
|
|
46
|
+
invalidText,
|
|
47
|
+
placeholder,
|
|
48
|
+
value,
|
|
49
|
+
helperText,
|
|
50
|
+
focused,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
variant: string | undefined;
|
|
10
|
+
items: figma.ResultSection[][];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10592-5483&t=pZwKJYFo1y1QRQD1-4
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Timeline/Timeline.tsx
|
|
3
|
+
// component=Timeline
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const variant = figma.selectedInstance.getEnum('Variant', {
|
|
6
|
+
Progress: 'progress',
|
|
7
|
+
Static: 'static',
|
|
8
|
+
});
|
|
9
|
+
const itemLayers = figma.selectedInstance
|
|
10
|
+
.findLayers(n => n.type === 'INSTANCE')
|
|
11
|
+
.filter((layer) => layer.type === 'INSTANCE');
|
|
12
|
+
const items = itemLayers
|
|
13
|
+
.filter(layer => layer.hasCodeConnect())
|
|
14
|
+
.map(layer => layer.executeTemplate().example);
|
|
15
|
+
export default {
|
|
16
|
+
id: 'Timeline',
|
|
17
|
+
imports: ['import { Timeline } from "@utilitywarehouse/hearth-react-native";'],
|
|
18
|
+
example: figma.code `<Timeline${figma.helpers.react.renderProp('variant', variant)}>${figma.helpers.react.renderChildren(items.flat())}</Timeline>`,
|
|
19
|
+
metadata: {
|
|
20
|
+
nestable: true,
|
|
21
|
+
props: { variant, items },
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
label: string;
|
|
10
|
+
helperText: string;
|
|
11
|
+
state: string | undefined;
|
|
12
|
+
customContent: figma.ResultSection[][];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10562-2810&t=pZwKJYFo1y1QRQD1-4
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Timeline/TimelineItem.tsx
|
|
3
|
+
// component=TimelineItem
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const label = figma.selectedInstance.getString('Label');
|
|
6
|
+
const helperText = figma.selectedInstance.getBoolean('Helper text?', {
|
|
7
|
+
true: figma.selectedInstance.getString('Helper text'),
|
|
8
|
+
});
|
|
9
|
+
const state = figma.selectedInstance.getEnum('State', {
|
|
10
|
+
Complete: 'complete',
|
|
11
|
+
Active: 'active',
|
|
12
|
+
Incomplete: 'incomplete',
|
|
13
|
+
});
|
|
14
|
+
const slot = figma.selectedInstance.getSlot('Slot');
|
|
15
|
+
const customContentInstance = figma.selectedInstance.getBoolean('Custom content?', {
|
|
16
|
+
true: figma.selectedInstance.getInstanceSwap('Custom content')?.executeTemplate().example,
|
|
17
|
+
});
|
|
18
|
+
const customContent = [
|
|
19
|
+
...(slot?.connectedInstances.map(i => i.executeTemplate().example) ?? []),
|
|
20
|
+
...(customContentInstance ? [customContentInstance] : []),
|
|
21
|
+
];
|
|
22
|
+
export default {
|
|
23
|
+
id: 'TimelineItem',
|
|
24
|
+
imports: ['import { TimelineItem } from "@utilitywarehouse/hearth-react-native";'],
|
|
25
|
+
example: figma.code `<TimelineItem variant="progress" position="middle"${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('state', state)}>${figma.helpers.react.renderChildren(customContent.flat())}</TimelineItem>`,
|
|
26
|
+
metadata: {
|
|
27
|
+
nestable: true,
|
|
28
|
+
props: { label, helperText, state, customContent },
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
label: string;
|
|
10
|
+
helperText: string;
|
|
11
|
+
position: string | undefined;
|
|
12
|
+
customContent: figma.ResultSection[][];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=10592-5189&t=pZwKJYFo1y1QRQD1-4
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Timeline/TimelineItem.tsx
|
|
3
|
+
// component=TimelineItem
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const label = figma.selectedInstance.getString('Label');
|
|
6
|
+
const helperText = figma.selectedInstance.getBoolean('Helper text?', {
|
|
7
|
+
true: figma.selectedInstance.getString('Helper text'),
|
|
8
|
+
});
|
|
9
|
+
const position = figma.selectedInstance.getEnum('Variant', {
|
|
10
|
+
Start: 'start',
|
|
11
|
+
Middle: 'middle',
|
|
12
|
+
End: 'end',
|
|
13
|
+
});
|
|
14
|
+
const slot = figma.selectedInstance.getSlot('Slot');
|
|
15
|
+
const customContentInstance = figma.selectedInstance.getBoolean('Custom content?', {
|
|
16
|
+
true: figma.selectedInstance.getInstanceSwap('Custom content')?.executeTemplate().example,
|
|
17
|
+
});
|
|
18
|
+
const customContent = [
|
|
19
|
+
...(slot?.connectedInstances.map(i => i.executeTemplate().example) ?? []),
|
|
20
|
+
...(customContentInstance ? [customContentInstance] : []),
|
|
21
|
+
];
|
|
22
|
+
export default {
|
|
23
|
+
id: 'TimelineItem',
|
|
24
|
+
imports: ['import { TimelineItem } from "@utilitywarehouse/hearth-react-native";'],
|
|
25
|
+
example: figma.code `<TimelineItem variant="static"${figma.helpers.react.renderProp('position', position)}${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('helperText', helperText)}>${figma.helpers.react.renderChildren(customContent.flat())}</TimelineItem>`,
|
|
26
|
+
metadata: {
|
|
27
|
+
nestable: true,
|
|
28
|
+
props: { label, helperText, position, customContent },
|
|
29
|
+
},
|
|
30
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import figma from 'figma';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
id: string;
|
|
4
|
+
imports: string[];
|
|
5
|
+
example: figma.TemplateStringResult;
|
|
6
|
+
metadata: {
|
|
7
|
+
nestable: boolean;
|
|
8
|
+
props: {
|
|
9
|
+
text: string;
|
|
10
|
+
hasIcon: boolean;
|
|
11
|
+
icon: figma.EnumOptionsValues<{
|
|
12
|
+
true: figma.ResultSection[] | undefined;
|
|
13
|
+
false: string;
|
|
14
|
+
}>;
|
|
15
|
+
hasLink: boolean;
|
|
16
|
+
hasDismiss: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|