@12min/ds 1.0.0 → 3.0.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.
@@ -1,6 +1,6 @@
1
- export { Colors, Typography, colors, typography } from './tokens/index.mjs';
2
- import { T as Theme } from './darkTheme-gaad4-zD.mjs';
3
- export { d as darkTheme, l as lightTheme } from './darkTheme-gaad4-zD.mjs';
1
+ export { BorderWidth, Colors, Grid, Opacity, Radius, Shadow, Spacing, Typography, borderWidth, colors, grid, opacity, radius, shadow, spacing, typography } from './tokens/index.mjs';
2
+ import { T as Theme, C as ChipSize, a as CheckboxSize } from './Checkbox.styles-DPyXzxFJ.mjs';
3
+ export { d as darkTheme, l as lightTheme } from './Checkbox.styles-DPyXzxFJ.mjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { PressableProps, StyleProp, ViewStyle } from 'react-native';
6
6
 
@@ -25,21 +25,53 @@ type ButtonProps = {
25
25
  };
26
26
  declare function Button({ variant, size, disabled, children, onPress }: ButtonProps): react_jsx_runtime.JSX.Element;
27
27
 
28
+ type ButtonIconVariant = 'primary' | 'secondary' | 'ghost' | 'overlay';
29
+ type ButtonIconSize = 'sm' | 'md' | 'lg';
30
+ type ButtonIconProps = {
31
+ icon: React.ReactNode;
32
+ accessibilityLabel: string;
33
+ variant?: ButtonIconVariant;
34
+ size?: ButtonIconSize;
35
+ disabled?: boolean;
36
+ onPress?: PressableProps['onPress'];
37
+ };
38
+ declare function ButtonIcon({ icon, accessibilityLabel, variant, size, disabled, onPress }: ButtonIconProps): react_jsx_runtime.JSX.Element;
39
+
40
+ type DismissButtonVariant = 'subtle' | 'ghost';
41
+ type DismissButtonSize = 'xs' | 'sm' | 'md';
42
+ type DismissButtonProps = {
43
+ accessibilityLabel?: string;
44
+ variant?: DismissButtonVariant;
45
+ size?: DismissButtonSize;
46
+ disabled?: boolean;
47
+ onPress?: PressableProps['onPress'];
48
+ };
49
+ declare function DismissButton({ accessibilityLabel, variant, size, disabled, onPress }: DismissButtonProps): react_jsx_runtime.JSX.Element;
50
+
28
51
  type ChipProps = {
29
52
  children: React.ReactNode;
30
53
  checked?: boolean;
54
+ disabled?: boolean;
55
+ size?: ChipSize;
56
+ leading?: React.ReactNode;
57
+ trailing?: React.ReactNode;
31
58
  onPress?: () => void;
32
59
  style?: StyleProp<ViewStyle>;
33
60
  };
34
- declare function Chip({ children, checked, onPress, style }: ChipProps): react_jsx_runtime.JSX.Element;
61
+ declare function Chip({ children, checked, disabled, size, leading, trailing, onPress, style }: ChipProps): react_jsx_runtime.JSX.Element;
35
62
 
36
- type AlertVariant = 'success' | 'info';
63
+ type AlertVariant = 'success' | 'info' | 'warning' | 'error';
64
+ type AlertSize = 'default' | 'compact';
65
+ type AlertLayout = 'stacked' | 'inline';
37
66
  type AlertProps = {
38
67
  variant?: AlertVariant;
39
- title: string;
68
+ size?: AlertSize;
69
+ layout?: AlertLayout;
70
+ title?: string;
40
71
  description?: string;
72
+ onDismiss?: () => void;
41
73
  };
42
- declare function Alert({ variant, title, description }: AlertProps): react_jsx_runtime.JSX.Element;
74
+ declare function Alert({ variant, size, layout, title, description, onDismiss }: AlertProps): react_jsx_runtime.JSX.Element;
43
75
 
44
76
  type ProgressBarProps = {
45
77
  value: number;
@@ -52,29 +84,48 @@ type InputProps = {
52
84
  placeholder?: string;
53
85
  state?: InputState;
54
86
  leadingIcon?: React.ReactNode;
87
+ trailingIcon?: React.ReactNode;
55
88
  onChangeText?: (text: string) => void;
56
89
  onFocus?: () => void;
57
90
  onBlur?: () => void;
58
91
  style?: StyleProp<ViewStyle>;
59
92
  };
60
- declare function Input({ value, placeholder, state, leadingIcon, onChangeText, onFocus, onBlur, style }: InputProps): react_jsx_runtime.JSX.Element;
93
+ declare function Input({ value, placeholder, state, leadingIcon, trailingIcon, onChangeText, onFocus, onBlur, style }: InputProps): react_jsx_runtime.JSX.Element;
94
+
95
+ type InputFieldProps = {
96
+ label?: string;
97
+ required?: boolean;
98
+ helperText?: string;
99
+ error?: boolean;
100
+ value?: string;
101
+ placeholder?: string;
102
+ disabled?: boolean;
103
+ leadingIcon?: React.ReactNode;
104
+ trailingIcon?: React.ReactNode;
105
+ onChangeText?: (text: string) => void;
106
+ onFocus?: () => void;
107
+ onBlur?: () => void;
108
+ };
109
+ declare function InputField({ label, required, helperText, error, value, placeholder, disabled, leadingIcon, trailingIcon, onChangeText, onFocus, onBlur, }: InputFieldProps): react_jsx_runtime.JSX.Element;
61
110
 
62
111
  type CheckboxProps = {
63
112
  checked?: boolean;
64
113
  onChange?: (checked: boolean) => void;
65
114
  disabled?: boolean;
115
+ size?: CheckboxSize;
66
116
  };
67
- declare function Checkbox({ checked, onChange, disabled }: CheckboxProps): react_jsx_runtime.JSX.Element;
117
+ declare function Checkbox({ checked, onChange, disabled, size }: CheckboxProps): react_jsx_runtime.JSX.Element;
68
118
 
69
- type RadioItemProps = {
70
- label: string;
71
- description?: string;
72
- selected?: boolean;
73
- icon?: React.ReactNode;
74
- onPress?: () => void;
75
- style?: StyleProp<ViewStyle>;
119
+ type ToggleSwitchSize = 'xs' | 'sm' | 'md';
120
+ type ToggleSwitchProps = {
121
+ value?: boolean;
122
+ onChange?: (value: boolean) => void;
123
+ disabled?: boolean;
124
+ size?: ToggleSwitchSize;
125
+ accessibilityLabel: string;
126
+ onPress?: PressableProps['onPress'];
76
127
  };
77
- declare function RadioItem({ label, description, selected, icon, onPress, style }: RadioItemProps): react_jsx_runtime.JSX.Element;
128
+ declare function ToggleSwitch({ value, onChange, disabled, size, accessibilityLabel }: ToggleSwitchProps): react_jsx_runtime.JSX.Element;
78
129
 
79
130
  type RadioGroupProps = {
80
131
  children: React.ReactNode;
@@ -83,25 +134,39 @@ type RadioGroupProps = {
83
134
  };
84
135
  declare function RadioGroup({ children, label, style }: RadioGroupProps): react_jsx_runtime.JSX.Element;
85
136
 
86
- type ActionItemProps = {
137
+ type ChoiceCardType = 'radio' | 'checkbox' | 'action';
138
+ type ChoiceCardProps = {
139
+ type?: ChoiceCardType;
87
140
  label: string;
88
141
  description?: string;
89
142
  selected?: boolean;
90
- icon?: React.ReactNode;
143
+ disabled?: boolean;
144
+ leading?: React.ReactNode;
145
+ showTrailing?: boolean;
91
146
  onPress?: () => void;
92
- style?: StyleProp<ViewStyle>;
93
147
  };
94
- declare function ActionItem({ label, description, selected, icon, onPress, style }: ActionItemProps): react_jsx_runtime.JSX.Element;
148
+ declare function ChoiceCard({ type, label, description, selected, disabled, leading, showTrailing, onPress }: ChoiceCardProps): react_jsx_runtime.JSX.Element;
95
149
 
96
- type Step = {
150
+ type ListItemTrailing = 'none' | 'radio' | 'checkbox' | 'action' | 'switch';
151
+ type ListItemProps = {
152
+ trailing?: ListItemTrailing;
97
153
  label: string;
154
+ description?: string;
155
+ selected?: boolean;
156
+ disabled?: boolean;
157
+ leading?: React.ReactNode;
158
+ switchValue?: boolean;
159
+ onSwitchChange?: (value: boolean) => void;
160
+ onPress?: () => void;
98
161
  };
162
+ declare function ListItem({ trailing, label, description, selected, disabled, leading, switchValue, onSwitchChange, onPress }: ListItemProps): react_jsx_runtime.JSX.Element;
163
+
99
164
  type StepperProps = {
100
- steps: Step[];
165
+ totalSteps: number;
101
166
  currentStep: number;
102
167
  style?: StyleProp<ViewStyle>;
103
168
  };
104
- declare function Stepper({ steps, currentStep, style }: StepperProps): react_jsx_runtime.JSX.Element;
169
+ declare function Stepper({ totalSteps, currentStep, style }: StepperProps): react_jsx_runtime.JSX.Element;
105
170
 
106
171
  type RatingScaleOption = {
107
172
  emoji: string;
@@ -111,8 +176,9 @@ type RatingScaleProps = {
111
176
  value?: number | null;
112
177
  onChange?: (value: number) => void;
113
178
  options?: ReadonlyArray<RatingScaleOption>;
179
+ disabled?: boolean;
114
180
  style?: StyleProp<ViewStyle>;
115
181
  };
116
- declare function RatingScale({ value, onChange, options, style }: RatingScaleProps): react_jsx_runtime.JSX.Element;
182
+ declare function RatingScale({ value, onChange, options, disabled, style }: RatingScaleProps): react_jsx_runtime.JSX.Element;
117
183
 
118
- export { ActionItem, Alert, Button, Checkbox, Chip, DSThemeProvider, Input, ProgressBar, RadioGroup, RadioItem, RatingScale, Stepper, Theme, useTheme };
184
+ export { Alert, Button, ButtonIcon, Checkbox, Chip, ChoiceCard, DSThemeProvider, DismissButton, Input, InputField, ListItem, ProgressBar, RadioGroup, RatingScale, Stepper, Theme, ToggleSwitch, useTheme };
@@ -1,6 +1,6 @@
1
- export { Colors, Typography, colors, typography } from './tokens/index.js';
2
- import { T as Theme } from './darkTheme-gaad4-zD.js';
3
- export { d as darkTheme, l as lightTheme } from './darkTheme-gaad4-zD.js';
1
+ export { BorderWidth, Colors, Grid, Opacity, Radius, Shadow, Spacing, Typography, borderWidth, colors, grid, opacity, radius, shadow, spacing, typography } from './tokens/index.js';
2
+ import { T as Theme, C as ChipSize, a as CheckboxSize } from './Checkbox.styles-DPyXzxFJ.js';
3
+ export { d as darkTheme, l as lightTheme } from './Checkbox.styles-DPyXzxFJ.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { PressableProps, StyleProp, ViewStyle } from 'react-native';
6
6
 
@@ -25,21 +25,53 @@ type ButtonProps = {
25
25
  };
26
26
  declare function Button({ variant, size, disabled, children, onPress }: ButtonProps): react_jsx_runtime.JSX.Element;
27
27
 
28
+ type ButtonIconVariant = 'primary' | 'secondary' | 'ghost' | 'overlay';
29
+ type ButtonIconSize = 'sm' | 'md' | 'lg';
30
+ type ButtonIconProps = {
31
+ icon: React.ReactNode;
32
+ accessibilityLabel: string;
33
+ variant?: ButtonIconVariant;
34
+ size?: ButtonIconSize;
35
+ disabled?: boolean;
36
+ onPress?: PressableProps['onPress'];
37
+ };
38
+ declare function ButtonIcon({ icon, accessibilityLabel, variant, size, disabled, onPress }: ButtonIconProps): react_jsx_runtime.JSX.Element;
39
+
40
+ type DismissButtonVariant = 'subtle' | 'ghost';
41
+ type DismissButtonSize = 'xs' | 'sm' | 'md';
42
+ type DismissButtonProps = {
43
+ accessibilityLabel?: string;
44
+ variant?: DismissButtonVariant;
45
+ size?: DismissButtonSize;
46
+ disabled?: boolean;
47
+ onPress?: PressableProps['onPress'];
48
+ };
49
+ declare function DismissButton({ accessibilityLabel, variant, size, disabled, onPress }: DismissButtonProps): react_jsx_runtime.JSX.Element;
50
+
28
51
  type ChipProps = {
29
52
  children: React.ReactNode;
30
53
  checked?: boolean;
54
+ disabled?: boolean;
55
+ size?: ChipSize;
56
+ leading?: React.ReactNode;
57
+ trailing?: React.ReactNode;
31
58
  onPress?: () => void;
32
59
  style?: StyleProp<ViewStyle>;
33
60
  };
34
- declare function Chip({ children, checked, onPress, style }: ChipProps): react_jsx_runtime.JSX.Element;
61
+ declare function Chip({ children, checked, disabled, size, leading, trailing, onPress, style }: ChipProps): react_jsx_runtime.JSX.Element;
35
62
 
36
- type AlertVariant = 'success' | 'info';
63
+ type AlertVariant = 'success' | 'info' | 'warning' | 'error';
64
+ type AlertSize = 'default' | 'compact';
65
+ type AlertLayout = 'stacked' | 'inline';
37
66
  type AlertProps = {
38
67
  variant?: AlertVariant;
39
- title: string;
68
+ size?: AlertSize;
69
+ layout?: AlertLayout;
70
+ title?: string;
40
71
  description?: string;
72
+ onDismiss?: () => void;
41
73
  };
42
- declare function Alert({ variant, title, description }: AlertProps): react_jsx_runtime.JSX.Element;
74
+ declare function Alert({ variant, size, layout, title, description, onDismiss }: AlertProps): react_jsx_runtime.JSX.Element;
43
75
 
44
76
  type ProgressBarProps = {
45
77
  value: number;
@@ -52,29 +84,48 @@ type InputProps = {
52
84
  placeholder?: string;
53
85
  state?: InputState;
54
86
  leadingIcon?: React.ReactNode;
87
+ trailingIcon?: React.ReactNode;
55
88
  onChangeText?: (text: string) => void;
56
89
  onFocus?: () => void;
57
90
  onBlur?: () => void;
58
91
  style?: StyleProp<ViewStyle>;
59
92
  };
60
- declare function Input({ value, placeholder, state, leadingIcon, onChangeText, onFocus, onBlur, style }: InputProps): react_jsx_runtime.JSX.Element;
93
+ declare function Input({ value, placeholder, state, leadingIcon, trailingIcon, onChangeText, onFocus, onBlur, style }: InputProps): react_jsx_runtime.JSX.Element;
94
+
95
+ type InputFieldProps = {
96
+ label?: string;
97
+ required?: boolean;
98
+ helperText?: string;
99
+ error?: boolean;
100
+ value?: string;
101
+ placeholder?: string;
102
+ disabled?: boolean;
103
+ leadingIcon?: React.ReactNode;
104
+ trailingIcon?: React.ReactNode;
105
+ onChangeText?: (text: string) => void;
106
+ onFocus?: () => void;
107
+ onBlur?: () => void;
108
+ };
109
+ declare function InputField({ label, required, helperText, error, value, placeholder, disabled, leadingIcon, trailingIcon, onChangeText, onFocus, onBlur, }: InputFieldProps): react_jsx_runtime.JSX.Element;
61
110
 
62
111
  type CheckboxProps = {
63
112
  checked?: boolean;
64
113
  onChange?: (checked: boolean) => void;
65
114
  disabled?: boolean;
115
+ size?: CheckboxSize;
66
116
  };
67
- declare function Checkbox({ checked, onChange, disabled }: CheckboxProps): react_jsx_runtime.JSX.Element;
117
+ declare function Checkbox({ checked, onChange, disabled, size }: CheckboxProps): react_jsx_runtime.JSX.Element;
68
118
 
69
- type RadioItemProps = {
70
- label: string;
71
- description?: string;
72
- selected?: boolean;
73
- icon?: React.ReactNode;
74
- onPress?: () => void;
75
- style?: StyleProp<ViewStyle>;
119
+ type ToggleSwitchSize = 'xs' | 'sm' | 'md';
120
+ type ToggleSwitchProps = {
121
+ value?: boolean;
122
+ onChange?: (value: boolean) => void;
123
+ disabled?: boolean;
124
+ size?: ToggleSwitchSize;
125
+ accessibilityLabel: string;
126
+ onPress?: PressableProps['onPress'];
76
127
  };
77
- declare function RadioItem({ label, description, selected, icon, onPress, style }: RadioItemProps): react_jsx_runtime.JSX.Element;
128
+ declare function ToggleSwitch({ value, onChange, disabled, size, accessibilityLabel }: ToggleSwitchProps): react_jsx_runtime.JSX.Element;
78
129
 
79
130
  type RadioGroupProps = {
80
131
  children: React.ReactNode;
@@ -83,25 +134,39 @@ type RadioGroupProps = {
83
134
  };
84
135
  declare function RadioGroup({ children, label, style }: RadioGroupProps): react_jsx_runtime.JSX.Element;
85
136
 
86
- type ActionItemProps = {
137
+ type ChoiceCardType = 'radio' | 'checkbox' | 'action';
138
+ type ChoiceCardProps = {
139
+ type?: ChoiceCardType;
87
140
  label: string;
88
141
  description?: string;
89
142
  selected?: boolean;
90
- icon?: React.ReactNode;
143
+ disabled?: boolean;
144
+ leading?: React.ReactNode;
145
+ showTrailing?: boolean;
91
146
  onPress?: () => void;
92
- style?: StyleProp<ViewStyle>;
93
147
  };
94
- declare function ActionItem({ label, description, selected, icon, onPress, style }: ActionItemProps): react_jsx_runtime.JSX.Element;
148
+ declare function ChoiceCard({ type, label, description, selected, disabled, leading, showTrailing, onPress }: ChoiceCardProps): react_jsx_runtime.JSX.Element;
95
149
 
96
- type Step = {
150
+ type ListItemTrailing = 'none' | 'radio' | 'checkbox' | 'action' | 'switch';
151
+ type ListItemProps = {
152
+ trailing?: ListItemTrailing;
97
153
  label: string;
154
+ description?: string;
155
+ selected?: boolean;
156
+ disabled?: boolean;
157
+ leading?: React.ReactNode;
158
+ switchValue?: boolean;
159
+ onSwitchChange?: (value: boolean) => void;
160
+ onPress?: () => void;
98
161
  };
162
+ declare function ListItem({ trailing, label, description, selected, disabled, leading, switchValue, onSwitchChange, onPress }: ListItemProps): react_jsx_runtime.JSX.Element;
163
+
99
164
  type StepperProps = {
100
- steps: Step[];
165
+ totalSteps: number;
101
166
  currentStep: number;
102
167
  style?: StyleProp<ViewStyle>;
103
168
  };
104
- declare function Stepper({ steps, currentStep, style }: StepperProps): react_jsx_runtime.JSX.Element;
169
+ declare function Stepper({ totalSteps, currentStep, style }: StepperProps): react_jsx_runtime.JSX.Element;
105
170
 
106
171
  type RatingScaleOption = {
107
172
  emoji: string;
@@ -111,8 +176,9 @@ type RatingScaleProps = {
111
176
  value?: number | null;
112
177
  onChange?: (value: number) => void;
113
178
  options?: ReadonlyArray<RatingScaleOption>;
179
+ disabled?: boolean;
114
180
  style?: StyleProp<ViewStyle>;
115
181
  };
116
- declare function RatingScale({ value, onChange, options, style }: RatingScaleProps): react_jsx_runtime.JSX.Element;
182
+ declare function RatingScale({ value, onChange, options, disabled, style }: RatingScaleProps): react_jsx_runtime.JSX.Element;
117
183
 
118
- export { ActionItem, Alert, Button, Checkbox, Chip, DSThemeProvider, Input, ProgressBar, RadioGroup, RadioItem, RatingScale, Stepper, Theme, useTheme };
184
+ export { Alert, Button, ButtonIcon, Checkbox, Chip, ChoiceCard, DSThemeProvider, DismissButton, Input, InputField, ListItem, ProgressBar, RadioGroup, RatingScale, Stepper, Theme, ToggleSwitch, useTheme };