@utilitywarehouse/hearth-react-native 0.35.3 → 0.35.4

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.
@@ -6,7 +6,7 @@ declare const RadioCardIcon: import("react").ForwardRefExoticComponent<import("r
6
6
  }>;
7
7
  declare const RadioCardLabel: import("react").ForwardRefExoticComponent<import("react").RefAttributes<import("../Label/Label.props").default> & Omit<import("../Label/Label.props").default, "ref">>;
8
8
  declare const RadioCardGroup: {
9
- ({ onChange, onValueChange, ...props }: RadioCardGroupProps): import("react/jsx-runtime").JSX.Element;
9
+ ({ onChange, onValueChange, disabled, ...props }: RadioCardGroupProps): import("react/jsx-runtime").JSX.Element;
10
10
  displayName: string;
11
11
  };
12
12
  declare const RadioCard: {
@@ -19,7 +19,7 @@ const RadioCardGroupComponent = RadioCardComponent.Group;
19
19
  const RadioCardIndicator = RadioCardComponent.Indicator;
20
20
  const RadioCardIcon = RadioCardComponent.Icon;
21
21
  const RadioCardLabel = RadioCardComponent.Label;
22
- const RadioCardGroup = ({ onChange, onValueChange, ...props }) => (_jsx(RadioCardGroupComponent, { ...props, onChange: (value) => {
22
+ const RadioCardGroup = ({ onChange, onValueChange, disabled, ...props }) => (_jsx(RadioCardGroupComponent, { ...props, disabled: disabled, isDisabled: disabled, onChange: (value) => {
23
23
  onChange?.(value);
24
24
  onValueChange?.(value);
25
25
  } }));
@@ -3,10 +3,12 @@ export declare const RadioCardGroupContext: import("react").Context<{
3
3
  flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
4
4
  justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly";
5
5
  alignItems?: "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
6
+ disabled?: boolean;
6
7
  }>;
7
8
  export declare const useRadioCardGroupContext: () => {
8
9
  flexDirection?: "row" | "column" | "row-reverse" | "column-reverse";
9
10
  flexWrap?: "nowrap" | "wrap" | "wrap-reverse";
10
11
  justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly";
11
12
  alignItems?: "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
13
+ disabled?: boolean;
12
14
  };
@@ -1,6 +1,8 @@
1
1
  import RadioCardGroupProps from './RadioCardGroup.props';
2
2
  declare const RadioCardGroup: {
3
- ({ children, gap, style, flexDirection, flexWrap, justifyContent, alignItems, columns, ...props }: RadioCardGroupProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ children, gap, style, flexDirection, flexWrap, justifyContent, alignItems, columns, disabled, isDisabled, ...props }: RadioCardGroupProps & {
4
+ isDisabled?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
4
6
  displayName: string;
5
7
  };
6
8
  export default RadioCardGroup;
@@ -4,10 +4,12 @@ import { View } from 'react-native';
4
4
  import { StyleSheet } from 'react-native-unistyles';
5
5
  import { Grid } from '../Grid';
6
6
  import { RadioCardGroupContext } from './RadioCardGroup.context';
7
- const RadioCardGroup = ({ children, gap = '200', style, flexDirection = 'row', flexWrap, justifyContent, alignItems, columns, ...props }) => {
7
+ const RadioCardGroup = ({ children, gap = '200', style, flexDirection = 'row', flexWrap, justifyContent, alignItems, columns, disabled,
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ isDisabled, ...props }) => {
8
10
  const context = useMemo(() => {
9
- return { flexDirection, flexWrap, justifyContent, alignItems };
10
- }, [flexDirection, flexWrap, justifyContent, alignItems]);
11
+ return { flexDirection, flexWrap, justifyContent, alignItems, disabled };
12
+ }, [flexDirection, flexWrap, justifyContent, alignItems, disabled]);
11
13
  return columns ? (_jsx(RadioCardGroupContext.Provider, { value: context, children: _jsx(Grid, { ...props, gap: gap, columns: columns, style: style, children: children }) })) : (_jsx(RadioCardGroupContext.Provider, { value: context, children: _jsx(View, { ...props, style: [
12
14
  styles.containerGap(gap),
13
15
  {
@@ -10,6 +10,7 @@ type RadioCardGroupBaseProps = {
10
10
  */
11
11
  onChange?: (value: string) => void;
12
12
  gap?: keyof typeof space;
13
+ disabled?: boolean;
13
14
  ref?: Ref<View>;
14
15
  } & ViewProps;
15
16
  type RadioCardGroupFlexProps = {
@@ -1,6 +1,6 @@
1
1
  import type RadioCardProps from './RadioCard.props';
2
2
  declare const RadioCardRoot: {
3
- ({ children, style, states, ...props }: RadioCardProps & {
3
+ ({ children, style, states, disabled, ...props }: RadioCardProps & {
4
4
  states?: {
5
5
  disabled?: boolean;
6
6
  checked?: boolean;
@@ -4,9 +4,10 @@ import { StyleSheet } from 'react-native-unistyles';
4
4
  import { Pressable } from 'react-native';
5
5
  import { RadioCardContext } from './RadioCard.context';
6
6
  import { useRadioCardGroupContext } from './RadioCardGroup.context';
7
- const RadioCardRoot = ({ children, style, states, ...props }) => {
7
+ const RadioCardRoot = ({ children, style, states, disabled, ...props }) => {
8
8
  const { checked, active } = states ?? {};
9
- const { flexDirection } = useRadioCardGroupContext() ?? {};
9
+ const { flexDirection, disabled: groupDisabled } = useRadioCardGroupContext() ?? {};
10
+ const isDisabled = groupDisabled ?? disabled ?? undefined;
10
11
  const value = useMemo(() => ({
11
12
  checked,
12
13
  active,
@@ -14,8 +15,9 @@ const RadioCardRoot = ({ children, style, states, ...props }) => {
14
15
  styles.useVariants({
15
16
  selected: checked,
16
17
  flexDirection,
18
+ disabled: isDisabled,
17
19
  });
18
- return (_jsx(RadioCardContext.Provider, { value: value, children: _jsx(Pressable, { ...props, style: [styles.container, style], children: children }) }));
20
+ return (_jsx(RadioCardContext.Provider, { value: value, children: _jsx(Pressable, { ...props, disabled: isDisabled, style: [styles.container, style], children: children }) }));
19
21
  };
20
22
  RadioCardRoot.displayName = 'RadioCardRoot';
21
23
  const styles = StyleSheet.create(theme => ({
@@ -50,6 +52,11 @@ const styles = StyleSheet.create(theme => ({
50
52
  width: '100%',
51
53
  },
52
54
  },
55
+ disabled: {
56
+ true: {
57
+ opacity: theme.opacity.disabled,
58
+ },
59
+ },
53
60
  },
54
61
  _web: {
55
62
  // '_focus-visible': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.35.3",
3
+ "version": "0.35.4",
4
4
  "description": "Utility Warehouse React Native UI library",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -78,8 +78,8 @@
78
78
  "vitest": "^4.1.7",
79
79
  "@utilitywarehouse/hearth-storybook-utils": "0.0.0",
80
80
  "@utilitywarehouse/hearth-fonts": "^0.1.1",
81
- "@utilitywarehouse/hearth-react-icons": "^0.9.0",
82
81
  "@utilitywarehouse/hearth-react-native-icons": "^0.9.0",
82
+ "@utilitywarehouse/hearth-react-icons": "^0.9.0",
83
83
  "@utilitywarehouse/hearth-svg-assets": "^0.6.5",
84
84
  "@utilitywarehouse/hearth-tokens": "^0.4.4"
85
85
  },
@@ -89,6 +89,7 @@ Contains all Group related layout style props and actions. It inherits all the p
89
89
  | `onChange` | `(value: string) => void` | - | **Deprecated** — use `onValueChange` instead. |
90
90
  | `gap` | `keyof typeof space` | - | The gap between the `RadioCard` items. |
91
91
  | `columns` | `GridProps['columns']` | - | If set, the group will use a grid layout with the specified number of columns. Otherwise, it uses flexbox. |
92
+ | `disabled` | `boolean` | - | If `true`, disables all `RadioCard`s in the group. |
92
93
  | `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | `'row'` | (Flexbox only) Sets the direction of the flex items. |
93
94
  | `flexWrap` | `'wrap' \| 'nowrap' \| 'wrap-reverse'` | `'wrap'` | (Flexbox only) Sets whether flex items are forced onto one line or can wrap. |
94
95
  | `alignItems` | `'flex-start' \| 'flex-end' \| 'center' \| `<br />`'stretch' \| 'baseline'` | - | (Flexbox only) Sets the alignment of flex items on the cross axis. |
@@ -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.3
4
+ Current version: v0.35.4
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