@bitrise/bitkit 13.271.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.271.0",
4
+ "version": "13.273.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -30,6 +30,7 @@ const SelectTheme: StyleConfig = {
30
30
  },
31
31
  _readOnly: {
32
32
  cursor: 'default',
33
+ color: isPlaceholderShown ? 'input/text/placeholder' : 'input/text/inputValue',
33
34
  },
34
35
  },
35
36
  icon: {
@@ -59,7 +59,7 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
59
59
  const isSelectInvalid = isInvalid || !!errorText;
60
60
 
61
61
  const formControlProps = {
62
- isDisabled: isDisabled || isLoading || isReadOnly,
62
+ isDisabled: isDisabled || isLoading,
63
63
  isInvalid: isSelectInvalid,
64
64
  isReadOnly,
65
65
  ...rest,
@@ -68,6 +68,7 @@ const Select = forwardRef<SelectProps, 'div'>((props, ref) => {
68
68
  defaultValue,
69
69
  icon: isLoading ? <ProgressSpinner marginEnd="4" /> : <Icon fontSize="24" name="SelectChevron" />,
70
70
  name,
71
+ isDisabled: formControlProps.isDisabled || isReadOnly,
71
72
  onBlur,
72
73
  onChange,
73
74
  size,
@@ -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
- export const SettingsCardToggle = (props: Omit<ToggleProps, 'variant'> & { label: ReactNode }) => {
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}>