@bitrise/bitkit 13.272.0 → 13.273.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/package.json
CHANGED
|
@@ -19,12 +19,13 @@ type VariantLabel =
|
|
|
19
19
|
| { variant?: undefined; label?: ReactNode }
|
|
20
20
|
| { variant: 'dynamic'; label?: ReactNode }
|
|
21
21
|
| { variant: 'fixed'; label: ReactNode };
|
|
22
|
-
export type ToggleProps = Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'> & {
|
|
22
|
+
export type ToggleProps = Omit<FormControlProps, 'label' | 'onBlur' | 'onChange' | 'isReadOnly'> & {
|
|
23
23
|
'data-testid'?: string;
|
|
24
24
|
defaultChecked?: SwitchProps['defaultChecked'];
|
|
25
25
|
id?: SwitchProps['id'];
|
|
26
26
|
isChecked?: SwitchProps['isChecked'];
|
|
27
27
|
isDisabled?: SwitchProps['isDisabled'];
|
|
28
|
+
isReadOnly?: SwitchProps['isReadOnly'] | 'toggle';
|
|
28
29
|
isLoading?: boolean;
|
|
29
30
|
helperText?: ReactNode;
|
|
30
31
|
name?: string;
|
|
@@ -75,8 +76,8 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
|
|
|
75
76
|
defaultChecked,
|
|
76
77
|
id,
|
|
77
78
|
isChecked,
|
|
78
|
-
isDisabled,
|
|
79
|
-
isReadOnly,
|
|
79
|
+
isDisabled: isDisabled || isReadOnly === 'toggle',
|
|
80
|
+
isReadOnly: isReadOnly === true,
|
|
80
81
|
isLoading,
|
|
81
82
|
name,
|
|
82
83
|
onBlur,
|
|
@@ -102,7 +103,7 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
|
|
|
102
103
|
const switchComponent = () => {
|
|
103
104
|
if (tooltip)
|
|
104
105
|
return (
|
|
105
|
-
<Tooltip {...tooltip}>
|
|
106
|
+
<Tooltip {...tooltip} shouldWrapChildren>
|
|
106
107
|
<ToggleComponent {...switchProps} />
|
|
107
108
|
</Tooltip>
|
|
108
109
|
);
|
|
@@ -41,7 +41,12 @@ export const SettingsCardOnOffValue = (props: Pick<ToggleProps, 'isChecked' | 'v
|
|
|
41
41
|
);
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
interface SettingsCardToggleProps extends Omit<ToggleProps, 'variant' | 'isReadOnly'> {
|
|
45
|
+
label: ReactNode;
|
|
46
|
+
isReadOnly?: boolean | 'toggle';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const SettingsCardToggle = (props: SettingsCardToggleProps) => {
|
|
45
50
|
const { data } = useSettingsCardStyle();
|
|
46
51
|
return (
|
|
47
52
|
<Box __css={data}>
|