@bitrise/bitkit 13.126.0 → 13.126.1-alpha.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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "13.126.0",
|
|
4
|
+
"version": "13.126.1-alpha.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"@fontsource/source-code-pro": "^5.0.18",
|
|
41
41
|
"framer-motion": "^11.3.6",
|
|
42
42
|
"luxon": "^3.4.4",
|
|
43
|
-
"react": "^18.
|
|
44
|
-
"react-dom": "^18.
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"react-dom": "^18.2.0",
|
|
45
45
|
"react-focus-lock": "^2.12.1",
|
|
46
46
|
"react-imask": "^7.6.1",
|
|
47
47
|
"react-markdown": "^9.0.1"
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"jest": "^29.7.0",
|
|
84
84
|
"jest-environment-jsdom": "^29.7.0",
|
|
85
85
|
"jsdom": "^24.1.0",
|
|
86
|
+
"lodash": "^4.17.21",
|
|
86
87
|
"prettier": "^3.3.3",
|
|
87
88
|
"react-hook-form": "^7.52.1",
|
|
88
89
|
"release-it": "^17.6.0",
|
|
@@ -15,7 +15,11 @@ import Skeleton from '../Skeleton/Skeleton';
|
|
|
15
15
|
import SkeletonBox from '../Skeleton/SkeletonBox';
|
|
16
16
|
import ToggleComponent from './ToggleComponent';
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
type VariantLabel =
|
|
19
|
+
| { variant?: undefined; label?: ReactNode }
|
|
20
|
+
| { variant: 'dynamic'; label?: ReactNode }
|
|
21
|
+
| { variant: 'fixed'; label: ReactNode };
|
|
22
|
+
export type ToggleProps = Omit<FormControlProps, 'label' | 'onBlur' | 'onChange'> & {
|
|
19
23
|
'data-testid'?: string;
|
|
20
24
|
defaultChecked?: SwitchProps['defaultChecked'];
|
|
21
25
|
id?: SwitchProps['id'];
|
|
@@ -23,15 +27,13 @@ export interface ToggleProps extends Omit<FormControlProps, 'label' | 'onBlur' |
|
|
|
23
27
|
isDisabled?: SwitchProps['isDisabled'];
|
|
24
28
|
isLoading?: boolean;
|
|
25
29
|
helperText?: ReactNode;
|
|
26
|
-
label: ReactNode;
|
|
27
30
|
name?: string;
|
|
28
31
|
onBlur?: SwitchProps['onBlur'];
|
|
29
32
|
onChange?: SwitchProps['onChange'];
|
|
30
33
|
tooltip?: Omit<TooltipProps, 'children'>;
|
|
31
34
|
value?: SwitchProps['value'];
|
|
32
35
|
valueText?: ReactNode;
|
|
33
|
-
|
|
34
|
-
}
|
|
36
|
+
} & VariantLabel;
|
|
35
37
|
|
|
36
38
|
/**
|
|
37
39
|
* The Toggle component is used as an alternative for the checkbox component.
|
|
@@ -83,6 +85,7 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
|
|
|
83
85
|
size,
|
|
84
86
|
};
|
|
85
87
|
const helperBlock = () => {
|
|
88
|
+
if (!helperText) return;
|
|
86
89
|
if (isLoading) {
|
|
87
90
|
return (
|
|
88
91
|
<Skeleton marginTop="4" maxWidth="120px" isActive paddingY="0.125rem">
|
|
@@ -91,13 +94,9 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
|
|
|
91
94
|
);
|
|
92
95
|
}
|
|
93
96
|
return (
|
|
94
|
-
|
|
95
|
-
{helperText
|
|
96
|
-
|
|
97
|
-
{helperText}
|
|
98
|
-
</FormHelperText>
|
|
99
|
-
)}
|
|
100
|
-
</>
|
|
97
|
+
<FormHelperText sx={css.helperText} as="p">
|
|
98
|
+
{helperText}
|
|
99
|
+
</FormHelperText>
|
|
101
100
|
);
|
|
102
101
|
};
|
|
103
102
|
const switchComponent = () => {
|
|
@@ -126,9 +125,11 @@ const Toggle = forwardRef<ToggleProps, 'div'>((props, ref) => {
|
|
|
126
125
|
)}
|
|
127
126
|
{variant === 'dynamic' && (
|
|
128
127
|
<>
|
|
129
|
-
|
|
130
|
-
{label}
|
|
131
|
-
|
|
128
|
+
{label && (
|
|
129
|
+
<FormLabel htmlFor={id} sx={css.label}>
|
|
130
|
+
{label}
|
|
131
|
+
</FormLabel>
|
|
132
|
+
)}
|
|
132
133
|
<Box display="flex" flexDirection="row" alignItems="center" gap="8">
|
|
133
134
|
{switchComponent()}
|
|
134
135
|
{isLoading ? (
|
|
@@ -520,9 +520,9 @@
|
|
|
520
520
|
},
|
|
521
521
|
"toggle": {
|
|
522
522
|
"frameOn": "sys.success.bold",
|
|
523
|
-
"frameOn-disabled": "
|
|
523
|
+
"frameOn-disabled": "rbga(78, 183, 108, 0.5)",
|
|
524
524
|
"frameOff": "sys.neutral.bold",
|
|
525
|
-
"frameOff-disabled": "
|
|
525
|
+
"frameOff-disabled": "rbga(148, 135, 155, 0.5)",
|
|
526
526
|
"slideOn": "sys.bg.surface",
|
|
527
527
|
"slideOn-disabled": "sys.bg.surface",
|
|
528
528
|
"slideOff": "sys.bg.surface",
|
|
@@ -580,8 +580,8 @@
|
|
|
580
580
|
}
|
|
581
581
|
},
|
|
582
582
|
"utilities": {
|
|
583
|
-
"overlay": "
|
|
584
|
-
"overlay-light": "
|
|
583
|
+
"overlay": "rbga(32, 27, 34, 0.8)",
|
|
584
|
+
"overlay-light": "rbga(32, 27, 34, 0.16)",
|
|
585
585
|
"skeleton": "sys.bg.subtle",
|
|
586
586
|
"skeleton-strong": "sys.fg.minimal"
|
|
587
587
|
},
|
|
@@ -786,9 +786,9 @@
|
|
|
786
786
|
"input/checkbox/selection": "sys.interactive.base",
|
|
787
787
|
"input/checkbox/selection-disabled": "sys.interactive.disabled",
|
|
788
788
|
"input/toggle/frameOn": "sys.success.bold",
|
|
789
|
-
"input/toggle/frameOn-disabled": "
|
|
789
|
+
"input/toggle/frameOn-disabled": "rbga(78, 183, 108, 0.5)",
|
|
790
790
|
"input/toggle/frameOff": "sys.neutral.bold",
|
|
791
|
-
"input/toggle/frameOff-disabled": "
|
|
791
|
+
"input/toggle/frameOff-disabled": "rbga(148, 135, 155, 0.5)",
|
|
792
792
|
"input/toggle/slideOn": "sys.bg.surface",
|
|
793
793
|
"input/toggle/slideOn-disabled": "sys.bg.surface",
|
|
794
794
|
"input/toggle/slideOff": "sys.bg.surface",
|
|
@@ -829,8 +829,8 @@
|
|
|
829
829
|
"status/neutral/border": "sys.neutral.muted",
|
|
830
830
|
"status/neutral/icon": "sys.neutral.strong",
|
|
831
831
|
"status/neutral/text": "sys.neutral.strong",
|
|
832
|
-
"utilities/overlay": "
|
|
833
|
-
"utilities/overlay-light": "
|
|
832
|
+
"utilities/overlay": "rbga(32, 27, 34, 0.8)",
|
|
833
|
+
"utilities/overlay-light": "rbga(32, 27, 34, 0.16)",
|
|
834
834
|
"utilities/skeleton": "sys.bg.subtle",
|
|
835
835
|
"utilities/skeleton-strong": "sys.fg.minimal"
|
|
836
836
|
}
|