@utilitywarehouse/hearth-react-native 0.8.1 → 0.9.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/.storybook/preview.tsx +1 -0
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +24 -0
- package/build/components/Banner/Banner.js +49 -10
- package/build/components/Banner/Banner.props.d.ts +4 -9
- package/build/components/BottomSheet/BottomSheetHandle.js +8 -0
- package/build/components/Card/Card.props.d.ts +1 -0
- package/build/components/Card/CardRoot.d.ts +1 -1
- package/build/components/Card/CardRoot.js +28 -1
- package/build/components/HighlightBanner/HighlightBanner.props.d.ts +1 -1
- package/build/components/List/List.js +1 -1
- package/build/components/List/ListAction/ListActionTrailingIcon.js +2 -2
- package/build/components/Menu/Menu.context.d.ts +5 -0
- package/build/components/Menu/Menu.context.js +9 -0
- package/build/components/Menu/Menu.d.ts +4 -0
- package/build/components/Menu/Menu.js +25 -0
- package/build/components/Menu/Menu.props.d.ts +21 -0
- package/build/components/Menu/Menu.props.js +1 -0
- package/build/components/Menu/MenuItem.d.ts +18 -0
- package/build/components/Menu/MenuItem.js +115 -0
- package/build/components/Menu/MenuItem.props.d.ts +27 -0
- package/build/components/Menu/MenuItem.props.js +1 -0
- package/build/components/Menu/MenuTrigger.d.ts +9 -0
- package/build/components/Menu/MenuTrigger.js +11 -0
- package/build/components/Menu/MenuTrigger.props.d.ts +12 -0
- package/build/components/Menu/MenuTrigger.props.js +1 -0
- package/build/components/Menu/index.d.ts +7 -0
- package/build/components/Menu/index.js +4 -0
- package/build/components/Modal/Modal.d.ts +1 -1
- package/build/components/Modal/Modal.js +32 -30
- package/build/components/Modal/Modal.props.d.ts +1 -0
- package/build/components/Modal/Modal.web.d.ts +1 -1
- package/build/components/Modal/Modal.web.js +25 -25
- package/build/components/RadioCard/RadioCardGroup.context.d.ts +12 -0
- package/build/components/RadioCard/RadioCardGroup.context.js +3 -0
- package/build/components/RadioCard/RadioCardGroup.js +15 -10
- package/build/components/RadioCard/RadioCardLabel.d.ts +1 -1
- package/build/components/RadioCard/RadioCardLabel.js +7 -1
- package/build/components/RadioCard/RadioCardRoot.js +13 -0
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/core/themes.d.ts +40 -0
- package/build/core/themes.js +20 -0
- package/build/tokens/components/dark/index.d.ts +3 -1
- package/build/tokens/components/dark/index.js +3 -1
- package/build/tokens/components/dark/input.d.ts +3 -0
- package/build/tokens/components/dark/input.js +3 -0
- package/build/tokens/components/dark/modal.d.ts +7 -4
- package/build/tokens/components/dark/modal.js +7 -4
- package/build/tokens/components/dark/rating.d.ts +8 -0
- package/build/tokens/components/dark/rating.js +7 -0
- package/build/tokens/components/dark/table.d.ts +0 -3
- package/build/tokens/components/dark/table.js +0 -3
- package/build/tokens/components/dark/time-picker.d.ts +29 -0
- package/build/tokens/components/dark/time-picker.js +28 -0
- package/build/tokens/components/dark/timeline.d.ts +27 -0
- package/build/tokens/components/dark/timeline.js +26 -0
- package/build/tokens/components/light/index.d.ts +3 -1
- package/build/tokens/components/light/index.js +3 -1
- package/build/tokens/components/light/input.d.ts +3 -0
- package/build/tokens/components/light/input.js +3 -0
- package/build/tokens/components/light/modal.d.ts +7 -4
- package/build/tokens/components/light/modal.js +7 -4
- package/build/tokens/components/light/rating.d.ts +8 -0
- package/build/tokens/components/light/rating.js +7 -0
- package/build/tokens/components/light/table.d.ts +0 -3
- package/build/tokens/components/light/table.js +0 -3
- package/build/tokens/components/light/time-picker.d.ts +29 -0
- package/build/tokens/components/light/time-picker.js +28 -0
- package/build/tokens/components/light/timeline.d.ts +27 -0
- package/build/tokens/components/light/timeline.js +26 -0
- package/docs/adding-shadows.mdx +43 -0
- package/docs/components/AllComponents.web.tsx +33 -0
- package/docs/components/BackToTopButton.tsx +1 -1
- package/package.json +3 -3
- package/src/components/Banner/Banner.docs.mdx +20 -11
- package/src/components/Banner/Banner.props.ts +4 -9
- package/src/components/Banner/Banner.stories.tsx +17 -4
- package/src/components/Banner/Banner.tsx +92 -37
- package/src/components/BottomSheet/BottomSheetHandle.tsx +12 -0
- package/src/components/Card/Card.docs.mdx +20 -1
- package/src/components/Card/Card.props.ts +9 -0
- package/src/components/Card/Card.stories.tsx +39 -0
- package/src/components/Card/CardRoot.tsx +29 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +19 -1
- package/src/components/DatePickerInput/DatePickerInput.docs.mdx +1 -1
- package/src/components/HighlightBanner/HighlightBanner.docs.mdx +1 -1
- package/src/components/HighlightBanner/HighlightBanner.props.ts +1 -0
- package/src/components/HighlightBanner/HighlightBanner.stories.tsx +15 -1
- package/src/components/List/List.tsx +5 -3
- package/src/components/List/ListAction/ListActionTrailingIcon.tsx +2 -2
- package/src/components/Menu/Menu.context.ts +15 -0
- package/src/components/Menu/Menu.docs.mdx +158 -0
- package/src/components/Menu/Menu.props.ts +24 -0
- package/src/components/Menu/Menu.stories.tsx +292 -0
- package/src/components/Menu/Menu.tsx +54 -0
- package/src/components/Menu/MenuItem.props.ts +29 -0
- package/src/components/Menu/MenuItem.tsx +145 -0
- package/src/components/Menu/MenuTrigger.props.ts +14 -0
- package/src/components/Menu/MenuTrigger.tsx +20 -0
- package/src/components/Menu/index.ts +7 -0
- package/src/components/Modal/Modal.docs.mdx +34 -5
- package/src/components/Modal/Modal.props.ts +1 -0
- package/src/components/Modal/Modal.stories.tsx +46 -0
- package/src/components/Modal/Modal.tsx +37 -33
- package/src/components/Modal/Modal.web.tsx +27 -27
- package/src/components/Radio/RadioGroup.stories.tsx +18 -0
- package/src/components/RadioCard/RadioCardGroup.context.ts +16 -0
- package/src/components/RadioCard/RadioCardGroup.stories.tsx +24 -0
- package/src/components/RadioCard/RadioCardGroup.tsx +28 -19
- package/src/components/RadioCard/RadioCardLabel.tsx +12 -1
- package/src/components/RadioCard/RadioCardRoot.tsx +15 -0
- package/src/components/index.ts +1 -0
- package/src/core/themes.ts +20 -0
- package/src/tokens/components/dark/index.ts +3 -1
- package/src/tokens/components/dark/input.ts +3 -0
- package/src/tokens/components/dark/modal.ts +7 -4
- package/src/tokens/components/dark/rating.ts +8 -0
- package/src/tokens/components/dark/table.ts +0 -3
- package/src/tokens/components/dark/time-picker.ts +29 -0
- package/src/tokens/components/dark/timeline.ts +27 -0
- package/src/tokens/components/light/index.ts +3 -1
- package/src/tokens/components/light/input.ts +3 -0
- package/src/tokens/components/light/modal.ts +7 -4
- package/src/tokens/components/light/rating.ts +8 -0
- package/src/tokens/components/light/table.ts +0 -3
- package/src/tokens/components/light/time-picker.ts +29 -0
- package/src/tokens/components/light/timeline.ts +27 -0
- package/build/tokens/components/dark/dialog.d.ts +0 -25
- package/build/tokens/components/dark/dialog.js +0 -24
- package/build/tokens/components/light/dialog.d.ts +0 -25
- package/build/tokens/components/light/dialog.js +0 -24
- package/src/tokens/components/dark/dialog.ts +0 -25
- package/src/tokens/components/light/dialog.ts +0 -25
|
@@ -10,17 +10,20 @@ export default {
|
|
|
10
10
|
gap: 12,
|
|
11
11
|
},
|
|
12
12
|
gap: 24,
|
|
13
|
-
|
|
13
|
+
heading: {
|
|
14
|
+
gap: 24,
|
|
15
|
+
},
|
|
16
|
+
illustration: {
|
|
17
|
+
padding: 48,
|
|
18
|
+
},
|
|
19
|
+
padding: 24,
|
|
14
20
|
mobile: {
|
|
15
|
-
padding: 16,
|
|
16
21
|
width: 360,
|
|
17
22
|
},
|
|
18
23
|
tablet: {
|
|
19
|
-
padding: 48,
|
|
20
24
|
width: 504,
|
|
21
25
|
},
|
|
22
26
|
desktop: {
|
|
23
|
-
padding: 48,
|
|
24
27
|
width: 680,
|
|
25
28
|
},
|
|
26
29
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: {
|
|
5
|
+
readonly gap: 6;
|
|
6
|
+
readonly gapContainer: 4;
|
|
7
|
+
readonly minWidth: 288;
|
|
8
|
+
readonly paddingHorizontal: 16;
|
|
9
|
+
readonly paddingVertical: 12;
|
|
10
|
+
readonly time: {
|
|
11
|
+
readonly columnGap: 4;
|
|
12
|
+
readonly content: {
|
|
13
|
+
readonly gap: 8;
|
|
14
|
+
readonly item: {
|
|
15
|
+
readonly gap: 2;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly footer: {
|
|
19
|
+
readonly gap: 8;
|
|
20
|
+
};
|
|
21
|
+
readonly gap: 16;
|
|
22
|
+
readonly item: {
|
|
23
|
+
readonly height: 40;
|
|
24
|
+
readonly width: 64;
|
|
25
|
+
};
|
|
26
|
+
readonly rowGap: 2;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export default {
|
|
5
|
+
gap: 6,
|
|
6
|
+
gapContainer: 4,
|
|
7
|
+
minWidth: 288,
|
|
8
|
+
paddingHorizontal: 16,
|
|
9
|
+
paddingVertical: 12,
|
|
10
|
+
time: {
|
|
11
|
+
columnGap: 4,
|
|
12
|
+
content: {
|
|
13
|
+
gap: 8,
|
|
14
|
+
item: {
|
|
15
|
+
gap: 2,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
footer: {
|
|
19
|
+
gap: 8,
|
|
20
|
+
},
|
|
21
|
+
gap: 16,
|
|
22
|
+
item: {
|
|
23
|
+
height: 40,
|
|
24
|
+
width: 64,
|
|
25
|
+
},
|
|
26
|
+
rowGap: 2,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: {
|
|
5
|
+
readonly bar: {
|
|
6
|
+
readonly width: 2;
|
|
7
|
+
};
|
|
8
|
+
readonly content: {
|
|
9
|
+
readonly gap: 8;
|
|
10
|
+
readonly paddingBottom: 24;
|
|
11
|
+
readonly paddingTop: 2;
|
|
12
|
+
};
|
|
13
|
+
readonly gap: 12;
|
|
14
|
+
readonly progress: {
|
|
15
|
+
readonly circle: {
|
|
16
|
+
readonly height: 24;
|
|
17
|
+
readonly width: 24;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly static: {
|
|
21
|
+
readonly circle: {
|
|
22
|
+
readonly height: 12;
|
|
23
|
+
readonly width: 12;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export default {
|
|
5
|
+
bar: {
|
|
6
|
+
width: 2,
|
|
7
|
+
},
|
|
8
|
+
content: {
|
|
9
|
+
gap: 8,
|
|
10
|
+
paddingBottom: 24,
|
|
11
|
+
paddingTop: 2,
|
|
12
|
+
},
|
|
13
|
+
gap: 12,
|
|
14
|
+
progress: {
|
|
15
|
+
circle: {
|
|
16
|
+
height: 24,
|
|
17
|
+
width: 24,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
static: {
|
|
21
|
+
circle: {
|
|
22
|
+
height: 12,
|
|
23
|
+
width: 12,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -17,7 +17,6 @@ export { default as carouselControl } from './carousel-control';
|
|
|
17
17
|
export { default as checkbox } from './checkbox';
|
|
18
18
|
export { default as datePicker } from './date-picker';
|
|
19
19
|
export { default as descriptionList } from './description-list';
|
|
20
|
-
export { default as dialog } from './dialog';
|
|
21
20
|
export { default as divider } from './divider';
|
|
22
21
|
export { default as drawer } from './drawer';
|
|
23
22
|
export { default as expandableCard } from './expandable-card';
|
|
@@ -40,6 +39,7 @@ export { default as pill } from './pill';
|
|
|
40
39
|
export { default as progressBar } from './progress-bar';
|
|
41
40
|
export { default as progressStepper } from './progress-stepper';
|
|
42
41
|
export { default as radio } from './radio';
|
|
42
|
+
export { default as rating } from './rating';
|
|
43
43
|
export { default as sectionHeader } from './section-header';
|
|
44
44
|
export { default as segmentedControl } from './segmented-control';
|
|
45
45
|
export { default as select } from './select';
|
|
@@ -48,6 +48,8 @@ export { default as spinner } from './spinner';
|
|
|
48
48
|
export { default as switch } from './switch';
|
|
49
49
|
export { default as table } from './table';
|
|
50
50
|
export { default as tabs } from './tabs';
|
|
51
|
+
export { default as timePicker } from './time-picker';
|
|
52
|
+
export { default as timeline } from './timeline';
|
|
51
53
|
export { default as toast } from './toast';
|
|
52
54
|
export { default as toggleButton } from './toggle-button';
|
|
53
55
|
export { default as tooltip } from './tooltip';
|
|
@@ -17,7 +17,6 @@ export { default as carouselControl } from './carousel-control';
|
|
|
17
17
|
export { default as checkbox } from './checkbox';
|
|
18
18
|
export { default as datePicker } from './date-picker';
|
|
19
19
|
export { default as descriptionList } from './description-list';
|
|
20
|
-
export { default as dialog } from './dialog';
|
|
21
20
|
export { default as divider } from './divider';
|
|
22
21
|
export { default as drawer } from './drawer';
|
|
23
22
|
export { default as expandableCard } from './expandable-card';
|
|
@@ -40,6 +39,7 @@ export { default as pill } from './pill';
|
|
|
40
39
|
export { default as progressBar } from './progress-bar';
|
|
41
40
|
export { default as progressStepper } from './progress-stepper';
|
|
42
41
|
export { default as radio } from './radio';
|
|
42
|
+
export { default as rating } from './rating';
|
|
43
43
|
export { default as sectionHeader } from './section-header';
|
|
44
44
|
export { default as segmentedControl } from './segmented-control';
|
|
45
45
|
export { default as select } from './select';
|
|
@@ -48,6 +48,8 @@ export { default as spinner } from './spinner';
|
|
|
48
48
|
export { default as switch } from './switch';
|
|
49
49
|
export { default as table } from './table';
|
|
50
50
|
export { default as tabs } from './tabs';
|
|
51
|
+
export { default as timePicker } from './time-picker';
|
|
52
|
+
export { default as timeline } from './timeline';
|
|
51
53
|
export { default as toast } from './toast';
|
|
52
54
|
export { default as toggleButton } from './toggle-button';
|
|
53
55
|
export { default as tooltip } from './tooltip';
|
|
@@ -10,17 +10,20 @@ declare const _default: {
|
|
|
10
10
|
readonly gap: 12;
|
|
11
11
|
};
|
|
12
12
|
readonly gap: 24;
|
|
13
|
-
readonly
|
|
13
|
+
readonly heading: {
|
|
14
|
+
readonly gap: 24;
|
|
15
|
+
};
|
|
16
|
+
readonly illustration: {
|
|
17
|
+
readonly padding: 48;
|
|
18
|
+
};
|
|
19
|
+
readonly padding: 24;
|
|
14
20
|
readonly mobile: {
|
|
15
|
-
readonly padding: 16;
|
|
16
21
|
readonly width: 360;
|
|
17
22
|
};
|
|
18
23
|
readonly tablet: {
|
|
19
|
-
readonly padding: 48;
|
|
20
24
|
readonly width: 504;
|
|
21
25
|
};
|
|
22
26
|
readonly desktop: {
|
|
23
|
-
readonly padding: 48;
|
|
24
27
|
readonly width: 680;
|
|
25
28
|
};
|
|
26
29
|
};
|
|
@@ -10,17 +10,20 @@ export default {
|
|
|
10
10
|
gap: 12,
|
|
11
11
|
},
|
|
12
12
|
gap: 24,
|
|
13
|
-
|
|
13
|
+
heading: {
|
|
14
|
+
gap: 24,
|
|
15
|
+
},
|
|
16
|
+
illustration: {
|
|
17
|
+
padding: 48,
|
|
18
|
+
},
|
|
19
|
+
padding: 24,
|
|
14
20
|
mobile: {
|
|
15
|
-
padding: 16,
|
|
16
21
|
width: 360,
|
|
17
22
|
},
|
|
18
23
|
tablet: {
|
|
19
|
-
padding: 48,
|
|
20
24
|
width: 504,
|
|
21
25
|
},
|
|
22
26
|
desktop: {
|
|
23
|
-
padding: 48,
|
|
24
27
|
width: 680,
|
|
25
28
|
},
|
|
26
29
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: {
|
|
5
|
+
readonly gap: 6;
|
|
6
|
+
readonly gapContainer: 4;
|
|
7
|
+
readonly minWidth: 288;
|
|
8
|
+
readonly paddingHorizontal: 16;
|
|
9
|
+
readonly paddingVertical: 12;
|
|
10
|
+
readonly time: {
|
|
11
|
+
readonly columnGap: 4;
|
|
12
|
+
readonly content: {
|
|
13
|
+
readonly gap: 8;
|
|
14
|
+
readonly item: {
|
|
15
|
+
readonly gap: 2;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
readonly footer: {
|
|
19
|
+
readonly gap: 8;
|
|
20
|
+
};
|
|
21
|
+
readonly gap: 16;
|
|
22
|
+
readonly item: {
|
|
23
|
+
readonly height: 40;
|
|
24
|
+
readonly width: 64;
|
|
25
|
+
};
|
|
26
|
+
readonly rowGap: 2;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export default {
|
|
5
|
+
gap: 6,
|
|
6
|
+
gapContainer: 4,
|
|
7
|
+
minWidth: 288,
|
|
8
|
+
paddingHorizontal: 16,
|
|
9
|
+
paddingVertical: 12,
|
|
10
|
+
time: {
|
|
11
|
+
columnGap: 4,
|
|
12
|
+
content: {
|
|
13
|
+
gap: 8,
|
|
14
|
+
item: {
|
|
15
|
+
gap: 2,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
footer: {
|
|
19
|
+
gap: 8,
|
|
20
|
+
},
|
|
21
|
+
gap: 16,
|
|
22
|
+
item: {
|
|
23
|
+
height: 40,
|
|
24
|
+
width: 64,
|
|
25
|
+
},
|
|
26
|
+
rowGap: 2,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
declare const _default: {
|
|
5
|
+
readonly bar: {
|
|
6
|
+
readonly width: 2;
|
|
7
|
+
};
|
|
8
|
+
readonly content: {
|
|
9
|
+
readonly gap: 8;
|
|
10
|
+
readonly paddingBottom: 24;
|
|
11
|
+
readonly paddingTop: 2;
|
|
12
|
+
};
|
|
13
|
+
readonly gap: 12;
|
|
14
|
+
readonly progress: {
|
|
15
|
+
readonly circle: {
|
|
16
|
+
readonly height: 28;
|
|
17
|
+
readonly width: 28;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly static: {
|
|
21
|
+
readonly circle: {
|
|
22
|
+
readonly height: 12;
|
|
23
|
+
readonly width: 12;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
export default {
|
|
5
|
+
bar: {
|
|
6
|
+
width: 2,
|
|
7
|
+
},
|
|
8
|
+
content: {
|
|
9
|
+
gap: 8,
|
|
10
|
+
paddingBottom: 24,
|
|
11
|
+
paddingTop: 2,
|
|
12
|
+
},
|
|
13
|
+
gap: 12,
|
|
14
|
+
progress: {
|
|
15
|
+
circle: {
|
|
16
|
+
height: 28,
|
|
17
|
+
width: 28,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
static: {
|
|
21
|
+
circle: {
|
|
22
|
+
height: 12,
|
|
23
|
+
width: 12,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import { BackToTopButton, NextPrevPage } from './components';
|
|
3
|
+
|
|
4
|
+
<Meta title="Guides / Adding Shadows" />
|
|
5
|
+
<BackToTopButton />
|
|
6
|
+
|
|
7
|
+
# Adding Shadows
|
|
8
|
+
|
|
9
|
+
You can add shadows to your components in Hearth React Native using the Unistyles styling system. Shadows help create depth and visual hierarchy in your UI.
|
|
10
|
+
|
|
11
|
+
- [Using Predefined Shadows](#using-predefined-shadows)
|
|
12
|
+
- [Components with Shadow Props](#components-with-shadow-props)
|
|
13
|
+
|
|
14
|
+
## Using Predefined Shadows
|
|
15
|
+
|
|
16
|
+
Hearth provides a set of predefined shadow styles that you can easily apply to your components. These shadows are defined in the theme and can be accessed via the `theme.helpers.shadow` object.
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { View } from 'react-native';
|
|
20
|
+
import { StyleSheet, Input } from '@utilitywarehouse/hearth-react-native';
|
|
21
|
+
|
|
22
|
+
const styles = StyleSheet.create(theme => ({
|
|
23
|
+
input: {
|
|
24
|
+
boxShadow: theme.helpers.shadow.functional, // Apply a predefined shadow
|
|
25
|
+
},
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
const MyComponent = () => (
|
|
29
|
+
<View>
|
|
30
|
+
<Input placeholder="Input with shadow" style={styles.input} />
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Components with Shadow Props
|
|
36
|
+
|
|
37
|
+
Some Hearth components, like `Card`, allow you to specify shadow colors directly via props. You can use the `shadowColor` prop to set the shadow color based on the theme.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { Card } from '@utilitywarehouse/hearth-react-native';
|
|
41
|
+
|
|
42
|
+
const MyComponent = () => <Card shadowColor="brand">{/* Card content */}</Card>;
|
|
43
|
+
```
|
|
@@ -6,9 +6,12 @@ import {
|
|
|
6
6
|
BroadbandMediumIcon,
|
|
7
7
|
CashbackCardMediumIcon,
|
|
8
8
|
ChevronRightMediumIcon,
|
|
9
|
+
EditSmallIcon,
|
|
9
10
|
ElectricityMediumIcon,
|
|
10
11
|
InsuranceMediumIcon,
|
|
11
12
|
MobileMediumIcon,
|
|
13
|
+
ShareSmallIcon,
|
|
14
|
+
TrashSmallIcon,
|
|
12
15
|
} from '@utilitywarehouse/hearth-react-native-icons';
|
|
13
16
|
// @ts-ignore
|
|
14
17
|
import SpotBillingDark from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-dark.svg';
|
|
@@ -60,6 +63,9 @@ import {
|
|
|
60
63
|
Link,
|
|
61
64
|
List,
|
|
62
65
|
ListItem,
|
|
66
|
+
Menu,
|
|
67
|
+
MenuItem,
|
|
68
|
+
MenuTrigger,
|
|
63
69
|
Modal,
|
|
64
70
|
OL,
|
|
65
71
|
ProgressStep,
|
|
@@ -159,6 +165,10 @@ const AllComponents: React.FC = () => {
|
|
|
159
165
|
}, [datePickerRef]);
|
|
160
166
|
const [switchEnabled, setSwitchEnabled] = React.useState(false);
|
|
161
167
|
const toggleSwitch = () => setSwitchEnabled(!switchEnabled);
|
|
168
|
+
const menuRef = useRef<any>(null);
|
|
169
|
+
const handleMenuOpenPress = useCallback(() => {
|
|
170
|
+
menuRef.current?.present();
|
|
171
|
+
}, []);
|
|
162
172
|
|
|
163
173
|
const [colorMode] = useColorMode();
|
|
164
174
|
const isDark = colorMode === 'dark';
|
|
@@ -564,6 +574,29 @@ const AllComponents: React.FC = () => {
|
|
|
564
574
|
</List>
|
|
565
575
|
</Center>
|
|
566
576
|
</ComponentWrapper>
|
|
577
|
+
<ComponentWrapper name="Menu" link="/?path=/docs/components-menu--docs">
|
|
578
|
+
<Center flex={1}>
|
|
579
|
+
<BottomSheetModalProvider>
|
|
580
|
+
<MenuTrigger onPress={handleMenuOpenPress}>
|
|
581
|
+
<Button>Open Menu</Button>
|
|
582
|
+
</MenuTrigger>
|
|
583
|
+
<Menu ref={menuRef} heading="Actions">
|
|
584
|
+
<MenuItem icon={EditSmallIcon} text="Edit" onPress={() => console.log('Edit')} />
|
|
585
|
+
<MenuItem
|
|
586
|
+
icon={ShareSmallIcon}
|
|
587
|
+
text="Share"
|
|
588
|
+
onPress={() => console.log('Share')}
|
|
589
|
+
/>
|
|
590
|
+
<MenuItem
|
|
591
|
+
icon={TrashSmallIcon}
|
|
592
|
+
text="Delete"
|
|
593
|
+
colorScheme="destructive"
|
|
594
|
+
onPress={() => console.log('Delete')}
|
|
595
|
+
/>
|
|
596
|
+
</Menu>
|
|
597
|
+
</BottomSheetModalProvider>
|
|
598
|
+
</Center>
|
|
599
|
+
</ComponentWrapper>
|
|
567
600
|
<ComponentWrapper name="Modal" link="/?path=/docs/components-modal--docs">
|
|
568
601
|
<Center flex={1}>
|
|
569
602
|
<Button onPress={handleModalOpenPress}>Open Modal</Button>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"vite": "^7.1.3",
|
|
57
57
|
"vite-plugin-svgr": "^4.5.0",
|
|
58
58
|
"vitest": "^3.2.4",
|
|
59
|
+
"@utilitywarehouse/hearth-fonts": "^0.0.4",
|
|
59
60
|
"@utilitywarehouse/hearth-react-icons": "^0.7.3",
|
|
60
61
|
"@utilitywarehouse/hearth-react-native-icons": "^0.7.3",
|
|
61
62
|
"@utilitywarehouse/hearth-svg-assets": "^0.2.0",
|
|
62
|
-
"@utilitywarehouse/hearth-
|
|
63
|
-
"@utilitywarehouse/hearth-tokens": "^0.1.3"
|
|
63
|
+
"@utilitywarehouse/hearth-tokens": "^0.2.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@gorhom/bottom-sheet": "^5.0.0",
|
|
@@ -24,7 +24,7 @@ The `Banner` component is a versatile card-based component for displaying inform
|
|
|
24
24
|
- [With Link](#with-link)
|
|
25
25
|
- [Pressable](#pressable)
|
|
26
26
|
- [With Close Button](#with-close-button)
|
|
27
|
-
- [Vertical Layout](#vertical-layout)
|
|
27
|
+
- [Vertical Layout](#vertical-layout-1)
|
|
28
28
|
- [Color Schemes](#color-schemes)
|
|
29
29
|
- [Complex Examples](#complex-examples)
|
|
30
30
|
|
|
@@ -69,8 +69,8 @@ const MyComponent = () => (
|
|
|
69
69
|
| iconContainerVariant | `'subtle' \| 'emphasis'` | Icon container visual style | `'subtle'` |
|
|
70
70
|
| iconContainerSize | `'sm' \| 'md' \| 'lg'` | Icon container size | `'md'` |
|
|
71
71
|
| iconContainerColor | `'pig' \| 'energy' \| 'broadband' \| 'mobile' \|` <br />`'insurance' \| 'cashback' \| 'highlight'` | Icon container color scheme | `'pig'` |
|
|
72
|
-
| illustration | `
|
|
73
|
-
| image | `
|
|
72
|
+
| illustration | `ThemedImageProps \| ImageProps` | Themed illustration object (mutually exclusive with icon/image) | `-` |
|
|
73
|
+
| image | `ThemedImageProps \| ImageProps` | Themed image object (mutually exclusive with icon/illustration) | `-` |
|
|
74
74
|
| heading | `string` | Heading text | `-` (required) |
|
|
75
75
|
| description | `string` | Description text | `-` (required) |
|
|
76
76
|
| direction | `'horizontal' \| 'vertical'` | Layout direction for icon/image and content | `'horizontal'` |
|
|
@@ -156,14 +156,23 @@ Display a themed image that automatically switches between light and dark modes:
|
|
|
156
156
|
import { Banner } from '@utilitywarehouse/hearth-react-native';
|
|
157
157
|
|
|
158
158
|
const MyComponent = () => (
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
159
|
+
<>
|
|
160
|
+
<Banner
|
|
161
|
+
image={{
|
|
162
|
+
source: { uri: 'https://example.com/image.jpg' },
|
|
163
|
+
}}
|
|
164
|
+
heading="Featured Content"
|
|
165
|
+
description="Discover amazing content curated just for you."
|
|
166
|
+
/>
|
|
167
|
+
<Banner
|
|
168
|
+
image={{
|
|
169
|
+
light: { uri: 'https://example.com/light-image.jpg' },
|
|
170
|
+
dark: { uri: 'https://example.com/dark-image.jpg' },
|
|
171
|
+
}}
|
|
172
|
+
heading="Featured Content"
|
|
173
|
+
description="Discover amazing content curated just for you."
|
|
174
|
+
/>
|
|
175
|
+
</>
|
|
167
176
|
);
|
|
168
177
|
```
|
|
169
178
|
|