@utilitywarehouse/hearth-react-native 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +3 -1
- package/CHANGELOG.md +12 -0
- package/build/components/Alert/AlertCloseButton.js +25 -3
- package/build/components/Alert/AlertIcon.js +17 -1
- package/build/components/Alert/AlertIconButton.js +27 -1
- package/build/components/Alert/AlertLink.js +47 -1
- package/build/components/Alert/AlertText.d.ts +1 -1
- package/build/components/Alert/AlertText.js +26 -2
- package/build/components/Alert/AlertTitle.d.ts +1 -1
- package/build/components/Alert/AlertTitle.js +26 -2
- package/build/components/Badge/BadgeIcon.js +72 -0
- package/build/components/Badge/BadgeText.js +72 -0
- package/build/components/Button/ButtonRoot.js +1 -0
- package/build/components/Checkbox/Checkbox.d.ts +2 -2
- package/build/components/Checkbox/Checkbox.js +11 -10
- package/build/components/Checkbox/Checkbox.props.d.ts +3 -1
- package/build/components/Checkbox/CheckboxIcon.js +1 -1
- package/build/components/Checkbox/CheckboxImage.d.ts +6 -0
- package/build/components/Checkbox/CheckboxImage.js +5 -0
- package/build/components/Checkbox/CheckboxTileRoot.js +1 -1
- package/build/components/Checkbox/index.d.ts +3 -2
- package/build/components/Checkbox/index.js +2 -1
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.js +4 -4
- package/build/components/Link/Link.props.d.ts +3 -0
- package/build/components/Radio/Radio.d.ts +2 -2
- package/build/components/Radio/Radio.js +9 -8
- package/build/components/Radio/Radio.props.d.ts +3 -1
- package/build/components/Radio/RadioImage.d.ts +6 -0
- package/build/components/Radio/RadioImage.js +5 -0
- package/build/components/Radio/RadioTileRoot.js +1 -1
- package/build/components/Radio/index.d.ts +3 -2
- package/build/components/Radio/index.js +2 -1
- package/build/components/Select/SelectOption.js +1 -7
- package/build/components/UnstyledIconButton/UnstyledIconButton.d.ts +1 -1
- package/build/components/UnstyledIconButton/UnstyledIconButton.js +4 -4
- package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +2 -1
- package/build/core/themes.d.ts +12 -12
- package/build/tokens/color.d.ts +12 -12
- package/build/tokens/color.js +6 -6
- package/build/tokens/components/dark/alert.d.ts +13 -0
- package/build/tokens/components/dark/alert.js +13 -0
- package/build/tokens/components/dark/checkbox.d.ts +3 -0
- package/build/tokens/components/dark/checkbox.js +3 -0
- package/build/tokens/components/dark/icon-button.d.ts +7 -0
- package/build/tokens/components/dark/icon-button.js +7 -0
- package/build/tokens/components/dark/index.d.ts +1 -0
- package/build/tokens/components/dark/index.js +1 -0
- package/build/tokens/components/dark/link.d.ts +5 -0
- package/build/tokens/components/dark/link.js +5 -0
- package/build/tokens/components/dark/progress-bar.d.ts +41 -0
- package/build/tokens/components/dark/progress-bar.js +40 -0
- package/build/tokens/components/light/alert.d.ts +13 -0
- package/build/tokens/components/light/alert.js +13 -0
- package/build/tokens/components/light/checkbox.d.ts +3 -0
- package/build/tokens/components/light/checkbox.js +3 -0
- package/build/tokens/components/light/icon-button.d.ts +7 -0
- package/build/tokens/components/light/icon-button.js +7 -0
- package/build/tokens/components/light/index.d.ts +1 -0
- package/build/tokens/components/light/index.js +1 -0
- package/build/tokens/components/light/link.d.ts +5 -0
- package/build/tokens/components/light/link.js +5 -0
- package/build/tokens/components/light/progress-bar.d.ts +41 -0
- package/build/tokens/components/light/progress-bar.js +40 -0
- package/build/tokens/index.d.ts +1 -0
- package/build/tokens/index.js +1 -0
- package/build/tokens/motion.d.ts +23 -0
- package/build/tokens/motion.js +22 -0
- package/build/tokens/primitive.d.ts +19 -0
- package/build/tokens/primitive.js +19 -0
- package/build/tokens/semantic-dark.d.ts +5 -5
- package/build/tokens/semantic-dark.js +5 -5
- package/build/tokens/semantic-light.d.ts +1 -1
- package/build/tokens/semantic-light.js +1 -1
- package/docs/assets/bank-logo.png +0 -0
- package/docs/assets/bank-logo1.png +0 -0
- package/docs/components/index.ts +6 -7
- package/docs/introduction.mdx +3 -3
- package/package.json +12 -11
- package/src/components/Alert/AlertCloseButton.tsx +33 -5
- package/src/components/Alert/AlertIcon.tsx +17 -1
- package/src/components/Alert/AlertIconButton.tsx +37 -4
- package/src/components/Alert/AlertLink.tsx +52 -1
- package/src/components/Alert/AlertText.tsx +28 -3
- package/src/components/Alert/AlertTitle.tsx +28 -3
- package/src/components/Badge/BadgeIcon.tsx +72 -0
- package/src/components/Badge/BadgeText.tsx +72 -0
- package/src/components/Button/ButtonRoot.tsx +1 -0
- package/src/components/Checkbox/Checkbox.docs.mdx +45 -7
- package/src/components/Checkbox/Checkbox.props.ts +3 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +37 -1
- package/src/components/Checkbox/Checkbox.tsx +12 -9
- package/src/components/Checkbox/CheckboxIcon.tsx +1 -1
- package/src/components/Checkbox/CheckboxImage.tsx +9 -0
- package/src/components/Checkbox/CheckboxTileRoot.tsx +1 -1
- package/src/components/Checkbox/index.ts +3 -2
- package/src/components/IconContainer/IconContainer.docs.mdx +4 -4
- package/src/components/Link/Link.props.ts +3 -0
- package/src/components/Link/Link.tsx +12 -6
- package/src/components/List/List.docs.mdx +24 -23
- package/src/components/Radio/Radio.docs.mdx +96 -124
- package/src/components/Radio/Radio.props.ts +3 -1
- package/src/components/Radio/Radio.stories.tsx +47 -0
- package/src/components/Radio/Radio.tsx +10 -7
- package/src/components/Radio/RadioImage.tsx +9 -0
- package/src/components/Radio/RadioTileRoot.tsx +1 -1
- package/src/components/Radio/index.ts +3 -2
- package/src/components/Select/Select.docs.mdx +6 -6
- package/src/components/Select/Select.stories.tsx +7 -7
- package/src/components/Select/SelectOption.tsx +4 -10
- package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
- package/src/components/UnstyledIconButton/UnstyledIconButton.tsx +9 -3
- package/src/tokens/color.ts +6 -6
- package/src/tokens/components/dark/alert.ts +13 -0
- package/src/tokens/components/dark/checkbox.ts +3 -0
- package/src/tokens/components/dark/icon-button.ts +7 -0
- package/src/tokens/components/dark/index.ts +1 -0
- package/src/tokens/components/dark/link.ts +5 -0
- package/src/tokens/components/dark/progress-bar.ts +41 -0
- package/src/tokens/components/light/alert.ts +13 -0
- package/src/tokens/components/light/checkbox.ts +3 -0
- package/src/tokens/components/light/icon-button.ts +7 -0
- package/src/tokens/components/light/index.ts +1 -0
- package/src/tokens/components/light/link.ts +5 -0
- package/src/tokens/components/light/progress-bar.ts +41 -0
- package/src/tokens/index.ts +1 -0
- package/src/tokens/motion.ts +23 -0
- package/src/tokens/primitive.ts +19 -0
- package/src/tokens/semantic-dark.ts +5 -5
- package/src/tokens/semantic-light.ts +1 -1
- package/docs/assets/react-native-pig.png +0 -0
- package/docs/components/AdvancedRadioExample.tsx +0 -126
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @utilitywarehouse/hearth-react-native@0.3.
|
|
2
|
+
> @utilitywarehouse/hearth-react-native@0.3.1 lint /home/runner/work/hearth/hearth/packages/react-native
|
|
3
3
|
> TIMING=1 eslint --max-warnings 0
|
|
4
4
|
|
|
5
5
|
Rule | Time (ms) | Relative
|
|
6
6
|
:----|----------:|--------:
|
|
7
|
+
Rule | Time (ms) | Relative
|
|
8
|
+
:----|----------:|--------:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @utilitywarehouse/hearth-react-native
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#472](https://github.com/utilitywarehouse/hearth/pull/472) [`009fe4b`](https://github.com/utilitywarehouse/hearth/commit/009fe4bff4fc54e424f22629040f715d3d4714ea) Thanks [@jordmccord](https://github.com/jordmccord)! - Add `image` prop to `Checkbox` and `Radio` components
|
|
8
|
+
|
|
9
|
+
- [#500](https://github.com/utilitywarehouse/hearth/pull/500) [`cc49e74`](https://github.com/utilitywarehouse/hearth/commit/cc49e74e3736b9647e8c5576ce45020add258625) Thanks [@jordmccord](https://github.com/jordmccord)! - - Updated dependencies [[`8dac8c1`](https://github.com/utilitywarehouse/hearth/commit/8dac8c1def9083d8e4efa1385e0ee7be23428c46)]:
|
|
10
|
+
|
|
11
|
+
- @utilitywarehouse/hearth-react-native-icons@0.4.0
|
|
12
|
+
|
|
13
|
+
- [#499](https://github.com/utilitywarehouse/hearth/pull/499) [`7b6781c`](https://github.com/utilitywarehouse/hearth/commit/7b6781cc054cf9f1ed4969a2c663abceb526c249) Thanks [@jordmccord](https://github.com/jordmccord)! - Fixes dark mode styles for several components
|
|
14
|
+
|
|
3
15
|
## 0.3.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -2,14 +2,36 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { CloseSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
5
|
-
|
|
5
|
+
import { useAlertContext } from './Alert.context';
|
|
6
|
+
const AlertCloseButton = ({ style, icon = CloseSmallIcon, ...props }) => {
|
|
7
|
+
const { colorScheme } = useAlertContext();
|
|
8
|
+
styles.useVariants({ colorScheme });
|
|
9
|
+
return (_jsx(UnstyledIconButton, { ...props, size: "sm", style: [styles.button, style], icon: icon, iconStyle: styles.icon }));
|
|
10
|
+
};
|
|
6
11
|
const styles = StyleSheet.create(theme => ({
|
|
7
|
-
|
|
12
|
+
button: {
|
|
8
13
|
alignSelf: 'flex-start',
|
|
9
|
-
color: theme.color.icon.primary,
|
|
10
14
|
minWidth: 20,
|
|
11
15
|
minHeight: 20,
|
|
12
16
|
},
|
|
17
|
+
icon: {
|
|
18
|
+
variants: {
|
|
19
|
+
colorScheme: {
|
|
20
|
+
info: {
|
|
21
|
+
color: theme.color.feedback.info.foreground.default,
|
|
22
|
+
},
|
|
23
|
+
positive: {
|
|
24
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
25
|
+
},
|
|
26
|
+
danger: {
|
|
27
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
28
|
+
},
|
|
29
|
+
warning: {
|
|
30
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
13
35
|
}));
|
|
14
36
|
AlertCloseButton.displayName = 'AlertCloseButton';
|
|
15
37
|
export default AlertCloseButton;
|
|
@@ -14,6 +14,7 @@ const AlertIcon = (props) => {
|
|
|
14
14
|
}
|
|
15
15
|
return InfoMediumIcon;
|
|
16
16
|
})();
|
|
17
|
+
styles.useVariants({ colorScheme });
|
|
17
18
|
return _jsx(Icon, { ...props, as: props.as ?? asProp, style: styles.icon });
|
|
18
19
|
};
|
|
19
20
|
AlertIcon.displayName = 'AlertIcon';
|
|
@@ -24,7 +25,22 @@ const styles = StyleSheet.create(theme => ({
|
|
|
24
25
|
minWidth: 24,
|
|
25
26
|
minHeight: 24,
|
|
26
27
|
alignSelf: 'flex-start',
|
|
27
|
-
|
|
28
|
+
variants: {
|
|
29
|
+
colorScheme: {
|
|
30
|
+
info: {
|
|
31
|
+
color: theme.color.feedback.info.foreground.default,
|
|
32
|
+
},
|
|
33
|
+
positive: {
|
|
34
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
35
|
+
},
|
|
36
|
+
danger: {
|
|
37
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
38
|
+
},
|
|
39
|
+
warning: {
|
|
40
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
28
44
|
},
|
|
29
45
|
}));
|
|
30
46
|
export default AlertIcon;
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
3
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
3
4
|
import { UnstyledIconButton } from '../UnstyledIconButton';
|
|
4
|
-
|
|
5
|
+
import { useAlertContext } from './Alert.context';
|
|
6
|
+
const AlertIconButton = ({ style, icon = ChevronRightSmallIcon, ...props }) => {
|
|
7
|
+
const { colorScheme } = useAlertContext();
|
|
8
|
+
styles.useVariants({ colorScheme });
|
|
9
|
+
return (_jsx(UnstyledIconButton, { ...props, size: "sm", style: style, icon: icon, iconStyle: styles.icon }));
|
|
10
|
+
};
|
|
11
|
+
const styles = StyleSheet.create(theme => ({
|
|
12
|
+
icon: {
|
|
13
|
+
variants: {
|
|
14
|
+
colorScheme: {
|
|
15
|
+
info: {
|
|
16
|
+
color: theme.color.feedback.info.foreground.default,
|
|
17
|
+
},
|
|
18
|
+
positive: {
|
|
19
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
20
|
+
},
|
|
21
|
+
danger: {
|
|
22
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
23
|
+
},
|
|
24
|
+
warning: {
|
|
25
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}));
|
|
5
31
|
AlertIconButton.displayName = 'AlertIconButton';
|
|
6
32
|
export default AlertIconButton;
|
|
@@ -1,7 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
3
|
import { Link } from '../Link';
|
|
4
|
+
import { useAlertContext } from './Alert.context';
|
|
3
5
|
const AlertLink = ({ children, ...props }) => {
|
|
4
|
-
|
|
6
|
+
const { colorScheme } = useAlertContext();
|
|
7
|
+
styles.useVariants({ colorScheme });
|
|
8
|
+
return (_jsx(Link, { ...props, textStyle: styles.text, iconStyle: styles.icon, children: children }));
|
|
5
9
|
};
|
|
10
|
+
const styles = StyleSheet.create(theme => ({
|
|
11
|
+
text: {
|
|
12
|
+
variants: {
|
|
13
|
+
colorScheme: {
|
|
14
|
+
info: {
|
|
15
|
+
color: theme.color.feedback.info.foreground.default,
|
|
16
|
+
textDecorationColor: theme.color.feedback.info.foreground.default,
|
|
17
|
+
},
|
|
18
|
+
positive: {
|
|
19
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
20
|
+
textDecorationColor: theme.color.feedback.positive.foreground.default,
|
|
21
|
+
},
|
|
22
|
+
danger: {
|
|
23
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
24
|
+
textDecorationColor: theme.color.feedback.danger.foreground.default,
|
|
25
|
+
},
|
|
26
|
+
warning: {
|
|
27
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
28
|
+
textDecorationColor: theme.color.feedback.warning.foreground.default,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
icon: {
|
|
34
|
+
variants: {
|
|
35
|
+
colorScheme: {
|
|
36
|
+
info: {
|
|
37
|
+
color: theme.color.feedback.info.foreground.default,
|
|
38
|
+
},
|
|
39
|
+
positive: {
|
|
40
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
41
|
+
},
|
|
42
|
+
danger: {
|
|
43
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
44
|
+
},
|
|
45
|
+
warning: {
|
|
46
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
}));
|
|
6
52
|
AlertLink.displayName = 'AlertLink';
|
|
7
53
|
export default AlertLink;
|
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
3
|
import { BodyText } from '../BodyText';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import { useAlertContext } from './Alert.context';
|
|
5
|
+
const AlertText = ({ children, style, ...props }) => {
|
|
6
|
+
const { colorScheme } = useAlertContext();
|
|
7
|
+
styles.useVariants({ colorScheme });
|
|
8
|
+
return (_jsx(BodyText, { size: "md", style: [styles.text, style], ...props, children: children }));
|
|
5
9
|
};
|
|
10
|
+
const styles = StyleSheet.create(theme => ({
|
|
11
|
+
text: {
|
|
12
|
+
variants: {
|
|
13
|
+
colorScheme: {
|
|
14
|
+
info: {
|
|
15
|
+
color: theme.color.feedback.info.foreground.default,
|
|
16
|
+
},
|
|
17
|
+
positive: {
|
|
18
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
19
|
+
},
|
|
20
|
+
danger: {
|
|
21
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
22
|
+
},
|
|
23
|
+
warning: {
|
|
24
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
6
30
|
AlertText.displayName = 'AlertText';
|
|
7
31
|
export default AlertText;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TextProps } from 'react-native';
|
|
2
2
|
declare const AlertTitle: {
|
|
3
|
-
({ children, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
({ children, style, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default AlertTitle;
|
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
2
3
|
import { DetailText } from '../DetailText';
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import { useAlertContext } from './Alert.context';
|
|
5
|
+
const AlertTitle = ({ children, style, ...props }) => {
|
|
6
|
+
const { colorScheme } = useAlertContext();
|
|
7
|
+
styles.useVariants({ colorScheme });
|
|
8
|
+
return (_jsx(DetailText, { size: "md", style: [styles.title, style], ...props, children: children }));
|
|
5
9
|
};
|
|
10
|
+
const styles = StyleSheet.create(theme => ({
|
|
11
|
+
title: {
|
|
12
|
+
variants: {
|
|
13
|
+
colorScheme: {
|
|
14
|
+
info: {
|
|
15
|
+
color: theme.color.feedback.info.foreground,
|
|
16
|
+
},
|
|
17
|
+
positive: {
|
|
18
|
+
color: theme.color.feedback.positive.foreground,
|
|
19
|
+
},
|
|
20
|
+
danger: {
|
|
21
|
+
color: theme.color.feedback.danger.foreground,
|
|
22
|
+
},
|
|
23
|
+
warning: {
|
|
24
|
+
color: theme.color.feedback.warning.foreground,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
}));
|
|
6
30
|
AlertTitle.displayName = 'AlertTitle';
|
|
7
31
|
export default AlertTitle;
|
|
@@ -40,6 +40,78 @@ const styles = StyleSheet.create(theme => ({
|
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
42
|
compoundVariants: [
|
|
43
|
+
// Emphasis
|
|
44
|
+
{
|
|
45
|
+
colorScheme: 'info',
|
|
46
|
+
variant: 'emphasis',
|
|
47
|
+
styles: {
|
|
48
|
+
color: theme.color.feedback.info.foreground.default,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
colorScheme: 'danger',
|
|
53
|
+
variant: 'emphasis',
|
|
54
|
+
styles: {
|
|
55
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
colorScheme: 'positive',
|
|
60
|
+
variant: 'emphasis',
|
|
61
|
+
styles: {
|
|
62
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
colorScheme: 'warning',
|
|
67
|
+
variant: 'emphasis',
|
|
68
|
+
styles: {
|
|
69
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
colorScheme: 'functional',
|
|
74
|
+
variant: 'emphasis',
|
|
75
|
+
styles: {
|
|
76
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
// Subtle
|
|
80
|
+
{
|
|
81
|
+
colorScheme: 'info',
|
|
82
|
+
variant: 'subtle',
|
|
83
|
+
styles: {
|
|
84
|
+
color: theme.color.feedback.info.foreground.default,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
colorScheme: 'danger',
|
|
89
|
+
variant: 'subtle',
|
|
90
|
+
styles: {
|
|
91
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
colorScheme: 'positive',
|
|
96
|
+
variant: 'subtle',
|
|
97
|
+
styles: {
|
|
98
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
colorScheme: 'warning',
|
|
103
|
+
variant: 'subtle',
|
|
104
|
+
styles: {
|
|
105
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
colorScheme: 'functional',
|
|
110
|
+
variant: 'subtle',
|
|
111
|
+
styles: {
|
|
112
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
43
115
|
// Outline
|
|
44
116
|
{
|
|
45
117
|
colorScheme: 'info',
|
|
@@ -36,6 +36,78 @@ const styles = StyleSheet.create(theme => ({
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
compoundVariants: [
|
|
39
|
+
// Emphasis
|
|
40
|
+
{
|
|
41
|
+
colorScheme: 'info',
|
|
42
|
+
variant: 'emphasis',
|
|
43
|
+
styles: {
|
|
44
|
+
color: theme.color.feedback.info.foreground.default,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
colorScheme: 'danger',
|
|
49
|
+
variant: 'emphasis',
|
|
50
|
+
styles: {
|
|
51
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
colorScheme: 'positive',
|
|
56
|
+
variant: 'emphasis',
|
|
57
|
+
styles: {
|
|
58
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
colorScheme: 'warning',
|
|
63
|
+
variant: 'emphasis',
|
|
64
|
+
styles: {
|
|
65
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
colorScheme: 'functional',
|
|
70
|
+
variant: 'emphasis',
|
|
71
|
+
styles: {
|
|
72
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
// Subtle
|
|
76
|
+
{
|
|
77
|
+
colorScheme: 'info',
|
|
78
|
+
variant: 'subtle',
|
|
79
|
+
styles: {
|
|
80
|
+
color: theme.color.feedback.info.foreground.default,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
colorScheme: 'danger',
|
|
85
|
+
variant: 'subtle',
|
|
86
|
+
styles: {
|
|
87
|
+
color: theme.color.feedback.danger.foreground.default,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
colorScheme: 'positive',
|
|
92
|
+
variant: 'subtle',
|
|
93
|
+
styles: {
|
|
94
|
+
color: theme.color.feedback.positive.foreground.default,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
colorScheme: 'warning',
|
|
99
|
+
variant: 'subtle',
|
|
100
|
+
styles: {
|
|
101
|
+
color: theme.color.feedback.warning.foreground.default,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
colorScheme: 'functional',
|
|
106
|
+
variant: 'subtle',
|
|
107
|
+
styles: {
|
|
108
|
+
color: theme.color.feedback.functional.foreground.default,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
39
111
|
// Outline
|
|
40
112
|
{
|
|
41
113
|
colorScheme: 'info',
|
|
@@ -177,6 +177,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
177
177
|
colorScheme: 'affirmative',
|
|
178
178
|
styles: {
|
|
179
179
|
backgroundColor: theme.color.interactive.affirmative.surface.strong.default,
|
|
180
|
+
borderColor: theme.color.interactive.affirmative.border.strong,
|
|
180
181
|
_web: {
|
|
181
182
|
_hover: {
|
|
182
183
|
backgroundColor: theme.color.interactive.affirmative.surface.strong.hover,
|
|
@@ -10,12 +10,12 @@ declare const CheckboxIcon: import("react").ForwardRefExoticComponent<import("re
|
|
|
10
10
|
}>;
|
|
11
11
|
declare const CheckboxLabel: import("react").ForwardRefExoticComponent<import("react").RefAttributes<import("../Label/Label.props").default> & Omit<import("../Label/Label.props").default, "ref">>;
|
|
12
12
|
declare const Checkbox: {
|
|
13
|
-
({ children, label, disabled, checked, helperIcon, helperText, invalidText, validText, validationStatus: validation, showValidationIcon, type, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
({ children, label, disabled, checked, helperIcon, helperText, invalidText, validText, validationStatus: validation, showValidationIcon, type, image, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
16
16
|
declare const CheckboxTile: {
|
|
17
17
|
({ type, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
displayName: string;
|
|
19
19
|
};
|
|
20
|
-
export { Checkbox, CheckboxGroup,
|
|
20
|
+
export { Checkbox, CheckboxGroup, CheckboxIcon, CheckboxIndicator, CheckboxLabel, CheckboxTile };
|
|
21
21
|
export default Checkbox;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { createCheckbox } from '@gluestack-ui/checkbox';
|
|
3
|
-
import
|
|
4
|
-
import StyledCheckboxIndicator from './CheckboxIndicator';
|
|
5
|
-
import StyledCheckboxIcon from './CheckboxIcon';
|
|
6
|
-
import StyledCheckboxLabel from './CheckboxLabel';
|
|
7
|
-
import StyledCheckboxGroup from './CheckboxGroupRoot';
|
|
3
|
+
import { useFormFieldContext } from '../FormField';
|
|
8
4
|
import { Helper } from '../Helper';
|
|
9
5
|
import { useCheckboxGroupContext } from './CheckboxGroup.context';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
6
|
+
import StyledCheckboxGroup from './CheckboxGroupRoot';
|
|
7
|
+
import StyledCheckboxIcon from './CheckboxIcon';
|
|
8
|
+
import CheckboxImage from './CheckboxImage';
|
|
9
|
+
import StyledCheckboxIndicator from './CheckboxIndicator';
|
|
10
|
+
import StyledCheckboxLabel from './CheckboxLabel';
|
|
11
|
+
import StyledCheckbox from './CheckboxRoot';
|
|
12
12
|
import CheckboxTextContent from './CheckboxTextContent';
|
|
13
|
+
import CheckboxTileRoot from './CheckboxTileRoot';
|
|
13
14
|
const CheckboxComponent = createCheckbox({
|
|
14
15
|
Root: StyledCheckbox,
|
|
15
16
|
Group: StyledCheckboxGroup,
|
|
@@ -25,12 +26,12 @@ CheckboxGroup.displayName = 'CheckboxGroup';
|
|
|
25
26
|
CheckboxIndicator.displayName = 'CheckboxIndicator';
|
|
26
27
|
CheckboxIcon.displayName = 'CheckboxIcon';
|
|
27
28
|
CheckboxLabel.displayName = 'CheckboxLabel';
|
|
28
|
-
const Checkbox = ({ children, label, disabled, checked, helperIcon, helperText, invalidText, validText, validationStatus: validation, showValidationIcon, type = 'default', ...props }) => {
|
|
29
|
+
const Checkbox = ({ children, label, disabled, checked, helperIcon, helperText, invalidText, validText, validationStatus: validation, showValidationIcon, type = 'default', image, ...props }) => {
|
|
29
30
|
const { validationStatus: fieldValidationStatus } = useFormFieldContext();
|
|
30
31
|
const { validationStatus: groupValidationStatus, type: groupType } = useCheckboxGroupContext();
|
|
31
32
|
const validationStatus = fieldValidationStatus ?? groupValidationStatus ?? validation ?? 'initial';
|
|
32
33
|
const checkboxType = groupType ?? type;
|
|
33
|
-
const checkboxChildren = children ? (children) : (_jsxs(_Fragment, { children: [_jsx(CheckboxIndicator, { children: _jsx(CheckboxIcon, {}) }), _jsxs(CheckboxTextContent, { children: [!!label && _jsx(CheckboxLabel, { children: label }), !!helperText && _jsx(Helper, { disabled: disabled, icon: helperIcon, text: helperText }), validationStatus === 'invalid' && !!invalidText && (_jsx(Helper, { showIcon: showValidationIcon, disabled: disabled, validationStatus: "invalid", text: invalidText })), validationStatus === 'valid' && !!validText && (_jsx(Helper, { disabled: disabled, showIcon: showValidationIcon, validationStatus: "valid", text: validText }))] })] }));
|
|
34
|
+
const checkboxChildren = children ? (children) : (_jsxs(_Fragment, { children: [_jsx(CheckboxIndicator, { children: _jsx(CheckboxIcon, {}) }), image ? _jsx(CheckboxImage, { ...image }) : null, _jsxs(CheckboxTextContent, { children: [!!label && _jsx(CheckboxLabel, { children: label }), !!helperText && _jsx(Helper, { disabled: disabled, icon: helperIcon, text: helperText }), validationStatus === 'invalid' && !!invalidText && (_jsx(Helper, { showIcon: showValidationIcon, disabled: disabled, validationStatus: "invalid", text: invalidText })), validationStatus === 'valid' && !!validText && (_jsx(Helper, { disabled: disabled, showIcon: showValidationIcon, validationStatus: "valid", text: validText }))] })] }));
|
|
34
35
|
return (
|
|
35
36
|
// @ts-expect-error - type
|
|
36
37
|
_jsx(CheckboxComponent, { ...props, isDisabled: disabled, isChecked: checked, children: checkboxType === 'tile' ? (_jsx(CheckboxTileRoot, { children: checkboxChildren })) : (checkboxChildren) }));
|
|
@@ -40,5 +41,5 @@ const CheckboxTile = ({ type = 'tile', ...props }) => {
|
|
|
40
41
|
};
|
|
41
42
|
CheckboxTile.displayName = 'CheckboxTile';
|
|
42
43
|
Checkbox.displayName = 'Checkbox';
|
|
43
|
-
export { Checkbox, CheckboxGroup,
|
|
44
|
+
export { Checkbox, CheckboxGroup, CheckboxIcon, CheckboxIndicator, CheckboxLabel, CheckboxTile };
|
|
44
45
|
export default Checkbox;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type { PressableProps, ViewProps } from 'react-native';
|
|
2
|
+
import type { ImageProps, PressableProps, ViewProps } from 'react-native';
|
|
3
3
|
type CheckboxBaseProps = {
|
|
4
4
|
onChange?: (isSelected: boolean) => void;
|
|
5
5
|
disabled?: boolean;
|
|
@@ -20,6 +20,7 @@ type CheckboxWithChildrenProps = {
|
|
|
20
20
|
invalidText?: never;
|
|
21
21
|
validText?: never;
|
|
22
22
|
showValidationIcon?: never;
|
|
23
|
+
image?: never;
|
|
23
24
|
} & CheckboxBaseProps;
|
|
24
25
|
type CheckboxWithoutChildrenProps = {
|
|
25
26
|
children?: never;
|
|
@@ -29,6 +30,7 @@ type CheckboxWithoutChildrenProps = {
|
|
|
29
30
|
invalidText?: string;
|
|
30
31
|
validText?: string;
|
|
31
32
|
showValidationIcon?: boolean;
|
|
33
|
+
image?: ImageProps;
|
|
32
34
|
} & CheckboxBaseProps;
|
|
33
35
|
type CheckboxProps = CheckboxWithChildrenProps | CheckboxWithoutChildrenProps;
|
|
34
36
|
export default CheckboxProps;
|
|
@@ -10,7 +10,7 @@ const CheckboxIcon = ({ style, ...props }) => {
|
|
|
10
10
|
};
|
|
11
11
|
const styles = StyleSheet.create(theme => ({
|
|
12
12
|
icon: {
|
|
13
|
-
color: theme.
|
|
13
|
+
color: theme.components.checkbox.checked.icon.color,
|
|
14
14
|
},
|
|
15
15
|
}));
|
|
16
16
|
CheckboxIcon.displayName = 'CheckboxIcon';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
|
+
const CheckboxImage = ({ source, style, ...props }) => (_jsx(Image, { source: source, style: style, ...props }));
|
|
4
|
+
CheckboxImage.displayName = 'CheckboxImage';
|
|
5
|
+
export default CheckboxImage;
|
|
@@ -18,7 +18,7 @@ const styles = StyleSheet.create(theme => ({
|
|
|
18
18
|
gap: theme.components.checkbox.gap,
|
|
19
19
|
padding: theme.components.checkbox.tile.padding,
|
|
20
20
|
borderWidth: theme.components.checkbox.tile.borderWidth,
|
|
21
|
-
borderColor: theme.color.border.
|
|
21
|
+
borderColor: theme.color.border.strong,
|
|
22
22
|
borderRadius: theme.components.checkbox.tile.borderRadius,
|
|
23
23
|
backgroundColor: theme.color.surface.neutral.strong,
|
|
24
24
|
variants: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { default as Checkbox, CheckboxIndicator, CheckboxLabel,
|
|
1
|
+
export { default as Checkbox, CheckboxIcon, CheckboxIndicator, CheckboxLabel, CheckboxTile, } from './Checkbox';
|
|
2
|
+
export type { default as CheckboxProps } from './Checkbox.props';
|
|
2
3
|
export { default as CheckboxGroup } from './CheckboxGroup';
|
|
3
4
|
export { default as CheckboxGroupTextContent } from './CheckboxGroupTextContent';
|
|
5
|
+
export { default as CheckboxImage } from './CheckboxImage';
|
|
4
6
|
export { default as CheckboxTextContent } from './CheckboxTextContent';
|
|
5
|
-
export type { default as CheckboxProps } from './Checkbox.props';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { default as Checkbox, CheckboxIndicator, CheckboxLabel,
|
|
1
|
+
export { default as Checkbox, CheckboxIcon, CheckboxIndicator, CheckboxLabel, CheckboxTile, } from './Checkbox';
|
|
2
2
|
export { default as CheckboxGroup } from './CheckboxGroup';
|
|
3
3
|
export { default as CheckboxGroupTextContent } from './CheckboxGroupTextContent';
|
|
4
|
+
export { default as CheckboxImage } from './CheckboxImage';
|
|
4
5
|
export { default as CheckboxTextContent } from './CheckboxTextContent';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LinkProps } from './Link.props';
|
|
2
2
|
export declare const LinkText: import("react").ForwardRefExoticComponent<import("react-native").TextProps & import("react").RefAttributes<import("react-native").TextProps>>;
|
|
3
3
|
declare const Link: {
|
|
4
|
-
({ children, icon, disabled, target, iconPosition, showIcon, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
({ children, icon, disabled, target, iconPosition, showIcon, textStyle, iconStyle, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
export default Link;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { createLink } from '@gluestack-ui/link';
|
|
3
|
+
import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
4
|
+
import LinkIcon from './LinkIcon';
|
|
3
5
|
import LinkRoot from './LinkRoot';
|
|
4
6
|
import LinkTextComponent from './LinkText';
|
|
5
|
-
import LinkIcon from './LinkIcon';
|
|
6
|
-
import { ChevronRightSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
7
7
|
const LinkComponent = createLink({
|
|
8
8
|
Root: LinkRoot,
|
|
9
9
|
Text: LinkTextComponent,
|
|
10
10
|
});
|
|
11
11
|
export const LinkText = LinkComponent.Text;
|
|
12
12
|
LinkText.displayName = 'LinkText';
|
|
13
|
-
const Link = ({ children, icon = ChevronRightSmallIcon, disabled = false, target = '_self', iconPosition = 'right', showIcon = true, ...props }) => {
|
|
13
|
+
const Link = ({ children, icon = ChevronRightSmallIcon, disabled = false, target = '_self', iconPosition = 'right', showIcon = true, textStyle, iconStyle, ...props }) => {
|
|
14
14
|
const LinkAny = LinkComponent;
|
|
15
|
-
return (_jsxs(LinkAny, { ...props, isDisabled: disabled, isExternal: target === '_blank', children: [showIcon && icon && iconPosition === 'left' ? _jsx(LinkIcon, { as: icon }) : null, _jsx(LinkText, { children: children }), showIcon && icon && iconPosition === 'right' ? _jsx(LinkIcon, { as: icon }) : null] }));
|
|
15
|
+
return (_jsxs(LinkAny, { ...props, isDisabled: disabled, isExternal: target === '_blank', children: [showIcon && icon && iconPosition === 'left' ? (_jsx(LinkIcon, { as: icon, style: iconStyle })) : null, _jsx(LinkText, { style: textStyle, children: children }), showIcon && icon && iconPosition === 'right' ? (_jsx(LinkIcon, { as: icon, style: iconStyle })) : null] }));
|
|
16
16
|
};
|
|
17
17
|
Link.displayName = 'Link';
|
|
18
18
|
export default Link;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
import { PressableProps, TextProps } from 'react-native';
|
|
3
|
+
import { IconProps } from '../Icon';
|
|
3
4
|
export interface LinkProps extends Omit<PressableProps, 'children'> {
|
|
4
5
|
children: TextProps['children'];
|
|
5
6
|
href?: string;
|
|
@@ -9,5 +10,7 @@ export interface LinkProps extends Omit<PressableProps, 'children'> {
|
|
|
9
10
|
icon?: ComponentType;
|
|
10
11
|
iconPosition?: 'left' | 'right';
|
|
11
12
|
showIcon?: boolean;
|
|
13
|
+
textStyle?: TextProps['style'];
|
|
14
|
+
iconStyle?: IconProps['style'];
|
|
12
15
|
}
|
|
13
16
|
export default LinkProps;
|