@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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=7072%3A913
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/Toast/ToastItem.tsx
|
|
3
|
+
// component=ToastItem
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const text = instance.getString('Text');
|
|
7
|
+
const hasIcon = instance.getBoolean('Icon?');
|
|
8
|
+
const icon = instance.getBoolean('Icon?', {
|
|
9
|
+
true: instance.getInstanceSwap('Icon-24')?.executeTemplate().example,
|
|
10
|
+
false: '',
|
|
11
|
+
});
|
|
12
|
+
const hasLink = instance.getBoolean('Link?');
|
|
13
|
+
const hasDismiss = instance.getBoolean('Dismiss?');
|
|
14
|
+
export default {
|
|
15
|
+
id: 'toast-item',
|
|
16
|
+
imports: [
|
|
17
|
+
"import { ToastItem } from '@utilitywarehouse/hearth-react-native';",
|
|
18
|
+
"import type { ToastInstance } from '@utilitywarehouse/hearth-react-native';",
|
|
19
|
+
],
|
|
20
|
+
example: figma.code `<ToastItem
|
|
21
|
+
toast={{
|
|
22
|
+
id: 'toast-1',
|
|
23
|
+
text: '${text || 'Toast notification'}',
|
|
24
|
+
${hasIcon ? figma.code `icon: ${icon},` : ''}
|
|
25
|
+
${hasLink ? "actionText: 'Action'," : ''}
|
|
26
|
+
showDismissIcon: ${hasDismiss},
|
|
27
|
+
dismissOnPress: false,
|
|
28
|
+
duration: 6000,
|
|
29
|
+
}}
|
|
30
|
+
onClose={() => {}}
|
|
31
|
+
/>`,
|
|
32
|
+
metadata: {
|
|
33
|
+
nestable: true,
|
|
34
|
+
props: {
|
|
35
|
+
text,
|
|
36
|
+
hasIcon,
|
|
37
|
+
icon,
|
|
38
|
+
hasLink,
|
|
39
|
+
hasDismiss,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -32,7 +32,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
32
32
|
borderColor: theme.color.interactive.neutral.border.subtle,
|
|
33
33
|
height: theme.components.toggleButton.height,
|
|
34
34
|
_web: {
|
|
35
|
-
|
|
35
|
+
'_focus-visible': theme.helpers.focusVisible,
|
|
36
36
|
_hover: {
|
|
37
37
|
backgroundColor: theme.color.interactive.neutral.surface.subtle.hover,
|
|
38
38
|
},
|
|
@@ -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 | undefined;
|
|
10
|
+
contentItems: figma.ResultSection[][];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=2164-727&t=Uq6QfQcygdNGv5lM-4
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/ToggleButtonCard/ToggleButtonCard.tsx
|
|
3
|
+
// component=ToggleButtonCard
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
// Get label from the nested Toggle Button instance
|
|
7
|
+
const label = (function () {
|
|
8
|
+
const nestedToggleButton = instance.findInstance('Toggle Button');
|
|
9
|
+
if (nestedToggleButton?.type !== 'ERROR') {
|
|
10
|
+
return nestedToggleButton.getString('Label');
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
})();
|
|
14
|
+
// Content is a SLOT property
|
|
15
|
+
const contentSlot = instance.getSlot('Content');
|
|
16
|
+
const contentItems = contentSlot?.connectedInstances.map(i => i.executeTemplate().example) ?? [];
|
|
17
|
+
export default {
|
|
18
|
+
id: 'ToggleButtonCard',
|
|
19
|
+
imports: ["import { ToggleButtonCard } from '@utilitywarehouse/hearth-react-native';"],
|
|
20
|
+
example: figma.code `// This should be wrapped in a ToggleButtonCardGroup, see docs
|
|
21
|
+
<ToggleButtonCard${figma.helpers.react.renderProp('label', label)} value="someValue">
|
|
22
|
+
${contentItems.flat()}
|
|
23
|
+
</ToggleButtonCard>`,
|
|
24
|
+
metadata: {
|
|
25
|
+
nestable: true,
|
|
26
|
+
props: { label, contentItems },
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { Pressable, View } from 'react-native';
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
3
|
+
import { Platform, Pressable, View } from 'react-native';
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
5
|
import ToggleButton from '../ToggleButton/ToggleButton';
|
|
6
6
|
import { ToggleButtonCardContext } from './ToggleButtonCard.context';
|
|
7
7
|
const ToggleButtonCardRoot = ({ children, style, label, states, onPress, ...props }) => {
|
|
8
8
|
const { checked, active } = states ?? {};
|
|
9
|
+
const containerRef = useRef(null);
|
|
9
10
|
const value = useMemo(() => ({
|
|
10
11
|
checked,
|
|
11
12
|
active,
|
|
@@ -14,10 +15,22 @@ const ToggleButtonCardRoot = ({ children, style, label, states, onPress, ...prop
|
|
|
14
15
|
selected: checked,
|
|
15
16
|
});
|
|
16
17
|
const handlePress = (e) => {
|
|
18
|
+
// gluestack's Radio selection state on web is driven by the hidden native
|
|
19
|
+
// <input type="radio"> receiving a real click (label-forwarding). The
|
|
20
|
+
// ToggleButton nested inside is itself an interactive element, so browsers
|
|
21
|
+
// don't forward the click to that hidden input. Click it directly instead.
|
|
22
|
+
if (Platform.OS === 'web') {
|
|
23
|
+
const node = containerRef.current;
|
|
24
|
+
const input = node?.querySelector?.('input[type="radio"]');
|
|
25
|
+
if (input && !input.checked) {
|
|
26
|
+
input.click();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
17
30
|
onPress?.(e);
|
|
18
31
|
props.onChange?.(!checked);
|
|
19
32
|
};
|
|
20
|
-
return (_jsx(ToggleButtonCardContext.Provider, { value: value, children: _jsxs(Pressable, { ...props, onPress: onPress, style: [styles.container, style], children: [children, _jsx(View, { style: styles.buttonContainer, children: _jsx(ToggleButton, { text: label, toggled: checked, onPress: handlePress, style: styles.button }) })] }) }));
|
|
33
|
+
return (_jsx(ToggleButtonCardContext.Provider, { value: value, children: _jsxs(Pressable, { ...props, ref: containerRef, onPress: onPress, style: [styles.container, style], children: [children, _jsx(View, { style: styles.buttonContainer, children: _jsx(ToggleButton, { text: label, toggled: checked, onPress: handlePress, style: styles.button }) })] }) }));
|
|
21
34
|
};
|
|
22
35
|
ToggleButtonCardRoot.displayName = 'ToggleButtonCardRoot';
|
|
23
36
|
const styles = StyleSheet.create(theme => ({
|
|
@@ -43,11 +56,6 @@ const styles = StyleSheet.create(theme => ({
|
|
|
43
56
|
},
|
|
44
57
|
},
|
|
45
58
|
},
|
|
46
|
-
_web: {
|
|
47
|
-
// '_focus-visible': {
|
|
48
|
-
// ...theme.helpers.focusVisible,
|
|
49
|
-
// },
|
|
50
|
-
},
|
|
51
59
|
},
|
|
52
60
|
buttonContainer: {
|
|
53
61
|
flexDirection: 'row',
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
state: string | undefined;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
inverted: boolean;
|
|
14
|
+
icon: {
|
|
15
|
+
$value: string;
|
|
16
|
+
$type: "react-component";
|
|
17
|
+
} | undefined;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2926%3A2430
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/UnstyledIconButton/UnstyledIconButton.tsx
|
|
3
|
+
// component=UnstyledIconButton
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const size = instance.getEnum('Size', { 'SM-20': 'sm', 'MD-24': 'md' });
|
|
7
|
+
const state = instance.getEnum('State', {
|
|
8
|
+
Default: 'default',
|
|
9
|
+
Hover: 'hover',
|
|
10
|
+
Active: 'active',
|
|
11
|
+
Focus: 'focus',
|
|
12
|
+
Disabled: 'disabled',
|
|
13
|
+
Loading: 'loading',
|
|
14
|
+
});
|
|
15
|
+
const disabled = state === 'disabled';
|
|
16
|
+
const loading = state === 'loading';
|
|
17
|
+
const inverted = instance.getBoolean('Inverted?');
|
|
18
|
+
const iconName = (size === 'sm'
|
|
19
|
+
? instance.getInstanceSwap('Icon-20')?.executeTemplate().metadata?.props?.componentName
|
|
20
|
+
: instance.getInstanceSwap('Icon-24')?.executeTemplate().metadata?.props?.componentName);
|
|
21
|
+
const icon = iconName ? figma.helpers.react.reactComponent(iconName) : undefined;
|
|
22
|
+
export default {
|
|
23
|
+
id: 'unstyled-icon-button',
|
|
24
|
+
imports: [
|
|
25
|
+
'import { UnstyledIconButton } from "@utilitywarehouse/hearth-react-native";',
|
|
26
|
+
...(iconName
|
|
27
|
+
? [`import { ${iconName} } from '@utilitywarehouse/hearth-react-native-icons';`]
|
|
28
|
+
: []),
|
|
29
|
+
],
|
|
30
|
+
example: figma.code `<UnstyledIconButton${figma.helpers.react.renderProp('size', size)}${figma.helpers.react.renderProp('disabled', disabled)}${figma.helpers.react.renderProp('loading', loading)}${figma.helpers.react.renderProp('inverted', inverted)}${figma.helpers.react.renderProp('icon', icon)} />`,
|
|
31
|
+
metadata: { nestable: true, props: { size, state, disabled, loading, inverted, icon } },
|
|
32
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
validationStatus: string | undefined;
|
|
10
|
+
valueType: string | undefined;
|
|
11
|
+
label: string;
|
|
12
|
+
labelVariant: string | undefined;
|
|
13
|
+
value: string;
|
|
14
|
+
helperText: string;
|
|
15
|
+
invalidText: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// url=https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=4049-3615
|
|
2
|
+
// source=https://github.com/utilitywarehouse/hearth/blob/main/packages/react-native/src/components/VerificationInput/VerificationInput.tsx
|
|
3
|
+
// component=VerificationInput
|
|
4
|
+
import figma from 'figma';
|
|
5
|
+
const instance = figma.selectedInstance;
|
|
6
|
+
const validationStatus = instance.getEnum('State', { Default: 'initial', Invalid: 'invalid' });
|
|
7
|
+
const valueType = instance.getEnum('Value type', { Empty: '', Filled: 'filled' });
|
|
8
|
+
const label = instance.getString('Label');
|
|
9
|
+
const labelVariant = instance.getEnum('Label variant', { Body: 'body', Heading: 'heading' });
|
|
10
|
+
const value = valueType === 'filled' ? instance.getString('Value 1') : '';
|
|
11
|
+
const showHelperText = instance.getBoolean('Helper text?');
|
|
12
|
+
const helperText = showHelperText ? instance.getString('Helper text') : '';
|
|
13
|
+
const invalidText = validationStatus === 'invalid' ? instance.getString('Validation') : '';
|
|
14
|
+
export default {
|
|
15
|
+
id: 'verification-input',
|
|
16
|
+
imports: ['import { VerificationInput } from "@utilitywarehouse/hearth-react-native";'],
|
|
17
|
+
example: figma.code `<VerificationInput${figma.helpers.react.renderProp('label', label)}${figma.helpers.react.renderProp('labelVariant', labelVariant)}${figma.helpers.react.renderProp('validationStatus', validationStatus)}${figma.helpers.react.renderProp('value', value)}${figma.helpers.react.renderProp('helperText', helperText)}${figma.helpers.react.renderProp('invalidText', invalidText)} />`,
|
|
18
|
+
metadata: {
|
|
19
|
+
nestable: true,
|
|
20
|
+
props: { validationStatus, valueType, label, labelVariant, value, helperText, invalidText },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -65,6 +65,7 @@ export * from './TimePicker';
|
|
|
65
65
|
export * from './TimePickerInput';
|
|
66
66
|
export * from './Toast';
|
|
67
67
|
export * from './ToggleButtonCard';
|
|
68
|
+
export * from './UnstyledIconButton';
|
|
68
69
|
export * from './VerificationInput';
|
|
69
70
|
export { FlatList, Image, KeyboardAvoidingView, ScrollView, SectionList, View } from 'react-native';
|
|
70
71
|
export { Pressable } from 'react-native';
|
|
@@ -66,6 +66,7 @@ export * from './TimePicker';
|
|
|
66
66
|
export * from './TimePickerInput';
|
|
67
67
|
export * from './Toast';
|
|
68
68
|
export * from './ToggleButtonCard';
|
|
69
|
+
export * from './UnstyledIconButton';
|
|
69
70
|
export * from './VerificationInput';
|
|
70
71
|
export { FlatList, Image, KeyboardAvoidingView, ScrollView, SectionList, View } from 'react-native';
|
|
71
72
|
export { Pressable } from 'react-native';
|
package/build/core/themes.d.ts
CHANGED
|
@@ -36,10 +36,10 @@ export declare const lightTheme: {
|
|
|
36
36
|
pig: string;
|
|
37
37
|
};
|
|
38
38
|
readonly focusVisible: {
|
|
39
|
-
outlineStyle:
|
|
40
|
-
outlineWidth:
|
|
41
|
-
outlineColor: "#101010";
|
|
42
|
-
outlineOffset:
|
|
39
|
+
readonly outlineStyle: "solid";
|
|
40
|
+
readonly outlineWidth: 2;
|
|
41
|
+
readonly outlineColor: "#101010";
|
|
42
|
+
readonly outlineOffset: 1;
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
readonly platform: "ios" | "android" | "windows" | "macos" | "web";
|
|
@@ -1337,10 +1337,10 @@ export declare const darkTheme: {
|
|
|
1337
1337
|
pig: string;
|
|
1338
1338
|
};
|
|
1339
1339
|
readonly focusVisible: {
|
|
1340
|
-
outlineStyle:
|
|
1341
|
-
outlineWidth:
|
|
1342
|
-
outlineColor: "#ebebeb";
|
|
1343
|
-
outlineOffset:
|
|
1340
|
+
readonly outlineStyle: "solid";
|
|
1341
|
+
readonly outlineWidth: 2;
|
|
1342
|
+
readonly outlineColor: "#ebebeb";
|
|
1343
|
+
readonly outlineOffset: 1;
|
|
1344
1344
|
};
|
|
1345
1345
|
};
|
|
1346
1346
|
readonly platform: "ios" | "android" | "windows" | "macos" | "web";
|
|
@@ -2650,10 +2650,10 @@ export declare const themes: {
|
|
|
2650
2650
|
pig: string;
|
|
2651
2651
|
};
|
|
2652
2652
|
readonly focusVisible: {
|
|
2653
|
-
outlineStyle:
|
|
2654
|
-
outlineWidth:
|
|
2655
|
-
outlineColor: "#101010";
|
|
2656
|
-
outlineOffset:
|
|
2653
|
+
readonly outlineStyle: "solid";
|
|
2654
|
+
readonly outlineWidth: 2;
|
|
2655
|
+
readonly outlineColor: "#101010";
|
|
2656
|
+
readonly outlineOffset: 1;
|
|
2657
2657
|
};
|
|
2658
2658
|
};
|
|
2659
2659
|
readonly platform: "ios" | "android" | "windows" | "macos" | "web";
|
|
@@ -3951,10 +3951,10 @@ export declare const themes: {
|
|
|
3951
3951
|
pig: string;
|
|
3952
3952
|
};
|
|
3953
3953
|
readonly focusVisible: {
|
|
3954
|
-
outlineStyle:
|
|
3955
|
-
outlineWidth:
|
|
3956
|
-
outlineColor: "#ebebeb";
|
|
3957
|
-
outlineOffset:
|
|
3954
|
+
readonly outlineStyle: "solid";
|
|
3955
|
+
readonly outlineWidth: 2;
|
|
3956
|
+
readonly outlineColor: "#ebebeb";
|
|
3957
|
+
readonly outlineOffset: 1;
|
|
3958
3958
|
};
|
|
3959
3959
|
};
|
|
3960
3960
|
readonly platform: "ios" | "android" | "windows" | "macos" | "web";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.9",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
|
|
49
|
+
"@figma/code-connect": "^1.4.9",
|
|
49
50
|
"@gorhom/bottom-sheet": "5.2.6",
|
|
50
51
|
"@storybook/addon-a11y": "^10.2.1",
|
|
51
52
|
"@storybook/addon-docs": "^10.2.1",
|
|
@@ -78,12 +79,12 @@
|
|
|
78
79
|
"vite": "^7.1.3",
|
|
79
80
|
"vite-plugin-svgr": "^4.5.0",
|
|
80
81
|
"vitest": "^4.1.7",
|
|
81
|
-
"@utilitywarehouse/hearth-react-native-icons": "^0.9.0",
|
|
82
|
-
"@utilitywarehouse/hearth-react-icons": "^0.9.0",
|
|
83
82
|
"@utilitywarehouse/hearth-fonts": "^0.1.1",
|
|
83
|
+
"@utilitywarehouse/hearth-react-icons": "^0.9.0",
|
|
84
|
+
"@utilitywarehouse/hearth-react-native-icons": "^0.9.0",
|
|
84
85
|
"@utilitywarehouse/hearth-storybook-utils": "0.0.0",
|
|
85
86
|
"@utilitywarehouse/hearth-svg-assets": "^0.6.5",
|
|
86
|
-
"@utilitywarehouse/hearth-tokens": "^0.4.
|
|
87
|
+
"@utilitywarehouse/hearth-tokens": "^0.4.5"
|
|
87
88
|
},
|
|
88
89
|
"peerDependencies": {
|
|
89
90
|
"@gorhom/bottom-sheet": ">=5.0.0",
|
|
@@ -329,15 +329,9 @@ You can use the `SectionHeader` component to add a heading and supporting text t
|
|
|
329
329
|
|
|
330
330
|
```tsx
|
|
331
331
|
// Example usage
|
|
332
|
-
import {
|
|
333
|
-
List,
|
|
334
|
-
ListItem,
|
|
335
|
-
ListItemIcon,
|
|
336
|
-
ListItemTrailingIcon,
|
|
337
|
-
} from '@utilitywarehouse/hearth-react-native';
|
|
332
|
+
import { List, ListItem, ListItemIcon } from '@utilitywarehouse/hearth-react-native';
|
|
338
333
|
import {
|
|
339
334
|
BillMediumIcon,
|
|
340
|
-
ChevronRightSmallIcon,
|
|
341
335
|
PaymentMediumIcon,
|
|
342
336
|
HomeMediumIcon,
|
|
343
337
|
UserMediumIcon,
|
|
@@ -353,34 +347,35 @@ const MyComponent = ({ navigate }) => (
|
|
|
353
347
|
heading="Bills"
|
|
354
348
|
helperText="View your bills"
|
|
355
349
|
leadingContent={<ListItemIcon as={BillMediumIcon} />}
|
|
356
|
-
trailingContent={<ListItemTrailingIcon as={ChevronRightSmallIcon} />}
|
|
357
350
|
onPress={() => console.log('pressed')}
|
|
358
351
|
/>
|
|
359
352
|
<ListItem
|
|
360
353
|
heading="Payments"
|
|
361
354
|
helperText="Make a payment"
|
|
362
355
|
leadingContent={<ListItemIcon as={PaymentMediumIcon} />}
|
|
363
|
-
trailingContent={<ListItemTrailingIcon as={ChevronRightSmallIcon} />}
|
|
364
356
|
onPress={() => console.log('pressed')}
|
|
365
357
|
/>
|
|
366
358
|
<ListItem
|
|
367
359
|
heading="Moving home"
|
|
368
360
|
helperText="Tell us if you're moving"
|
|
369
361
|
leadingContent={<ListItemIcon as={HomeMediumIcon} />}
|
|
370
|
-
trailingContent={<ListItemTrailingIcon as={ChevronRightSmallIcon} />}
|
|
371
362
|
onPress={() => console.log('pressed')}
|
|
372
363
|
/>
|
|
373
364
|
<ListItem
|
|
374
365
|
heading="Refer a friend"
|
|
375
366
|
helperText="Get rewarded with a friend"
|
|
376
367
|
leadingContent={<ListItemIcon as={UserMediumIcon} />}
|
|
377
|
-
trailingContent={<ListItemTrailingIcon as={ChevronRightSmallIcon} />}
|
|
378
368
|
onPress={() => console.log('pressed')}
|
|
379
369
|
/>
|
|
380
370
|
</List>
|
|
381
371
|
);
|
|
382
372
|
```
|
|
383
373
|
|
|
374
|
+
`ListItem` renders its own trailing chevron automatically when `onPress` is
|
|
375
|
+
set and `trailingContent` is omitted — no need to pass
|
|
376
|
+
`trailingContent={<ListItemTrailingIcon as={ChevronRightSmallIcon} />}`
|
|
377
|
+
yourself unless you want a different trailing element.
|
|
378
|
+
|
|
384
379
|
### `List` with `ListAction`
|
|
385
380
|
|
|
386
381
|
You can use the `ListAction` component to add actionable items to your list.
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
# AI
|
|
1
|
+
# AI Toolkit
|
|
2
2
|
|
|
3
3
|
- [Plugin](#plugin)
|
|
4
|
+
- [Claude CLI](#claude-cli)
|
|
5
|
+
- [Claude Desktop](#claude-desktop)
|
|
4
6
|
- [llms.txt and markdown docs](#llms-txt-and-markdown-docs)
|
|
5
7
|
- [Agent Skill](#agent-skill)
|
|
6
8
|
- [Hearth React Native MCP Server](#hearth-react-native-mcp-server)
|
|
@@ -13,9 +15,9 @@ context it needs to build with Hearth correctly.
|
|
|
13
15
|
If you're building UI from a design in Figma, start with Figma's MCP Server.
|
|
14
16
|
This should be the first step, since it gives your agent direct access to the
|
|
15
17
|
design you're implementing. You can read more information about setting this up
|
|
16
|
-
in the root AI Toolkit documentation.
|
|
18
|
+
in the [root AI Toolkit documentation](https://hearth.prod.uw.systems/?path=/docs/ai-toolkit--docs).
|
|
17
19
|
|
|
18
|
-
Hearth's own AI
|
|
20
|
+
Hearth's own AI toolkit then supplements it for most use cases, filling in the
|
|
19
21
|
parts of the Hearth React Native API and usage guidance that the design alone
|
|
20
22
|
doesn't capture:
|
|
21
23
|
|
|
@@ -26,10 +28,30 @@ doesn't capture:
|
|
|
26
28
|
## Plugin
|
|
27
29
|
|
|
28
30
|
The Hearth AI Toolkit plugin is the recommended way to set up your agent with
|
|
29
|
-
the Hearth React Native AI Tools. It will automatically add the
|
|
30
|
-
server to your agent configuration, and ensure that your agent has
|
|
31
|
-
the latest Hearth React Native documentation and usage guidance.
|
|
32
|
-
|
|
31
|
+
the Hearth React Native AI Tools. It will automatically add the `hearth-react-native`
|
|
32
|
+
skill and MCP server to your agent configuration, and ensure that your agent has
|
|
33
|
+
access to the latest Hearth React Native documentation and usage guidance.
|
|
34
|
+
|
|
35
|
+
### Claude CLI
|
|
36
|
+
|
|
37
|
+
```console
|
|
38
|
+
/plugin marketplace add utilitywarehouse/hearth
|
|
39
|
+
/plugin install hearth-ai-toolkit@hearth-plugins
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Claude Desktop
|
|
43
|
+
|
|
44
|
+
In the desktop app, click on **Customize** in the sidebar, then navigate to
|
|
45
|
+
**Plugins**. In the **Add** menu, choose **Add Marketplace**, then select the
|
|
46
|
+
**utilitywarehouse/hearth** repository, and click **Sync**.
|
|
47
|
+
|
|
48
|
+
This will add the `hearth-plugins` marketplace to Claude, and if you then click
|
|
49
|
+
the **+** symbol in the corner of the Hearth Design Systems card, you will have
|
|
50
|
+
the plugin installed and ready to use.
|
|
51
|
+
|
|
52
|
+
See the [root AI Toolkit documentation](https://hearth.prod.uw.systems/?path=/docs/ai-toolkit--docs)
|
|
53
|
+
for the full plugin scope (it also covers `hearth-react`), and for how to
|
|
54
|
+
combine it with the Figma MCP Server.
|
|
33
55
|
|
|
34
56
|
## llms.txt and markdown docs
|
|
35
57
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Hearth React Native
|
|
2
2
|
|
|
3
3
|
React Native component library for building UIs at Utility Warehouse.<br/>
|
|
4
|
-
Current version: v0.35.
|
|
4
|
+
Current version: v0.35.9
|
|
5
5
|
|
|
6
6
|
Hearth React Native is a comprehensive design system library for React Native, providing reusable components, consistent styling, and tools to streamline UI development. It is built to enhance productivity and maintain design consistency across projects.
|
|
7
7
|
|
package/public/llms.txt
CHANGED