@kaizen/components 0.0.0-canary-test-1-20250203230448 → 0.0.0-canary-v3-utils-export-20250211025631

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.
@@ -36,13 +36,12 @@ var Select = React__default.default.forwardRef(function (_a, ref) {
36
36
  description = _a.description,
37
37
  propsFullWidth = _a.fullWidth,
38
38
  propsClassName = _a.className,
39
- isDisabled = _a.isDisabled,
40
39
  placeholder = _a.placeholder,
41
- props = tslib.__rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className", "isDisabled", "placeholder"]);
40
+ props = tslib.__rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className", "placeholder"]);
42
41
  var reactId = React.useId();
43
42
  // the default for fullWidth depends on the variant
44
43
  var fullWidth = propsFullWidth !== null && propsFullWidth !== undefined ? propsFullWidth : !['secondary', 'secondary-small'].includes(variant);
45
- var classes = classnames__default.default(propsClassName, Select_module.specificityIncreaser, (!reversed || variant === 'default') && Select_module.default, reversed && Select_module.reversed, variant === 'secondary' && Select_module.secondary, variant === 'secondary-small' && Select_module.secondarySmall, !fullWidth && Select_module.notFullWidth, isDisabled && Select_module.disabled, status === 'error' && Select_module.error);
44
+ var classes = classnames__default.default(propsClassName, Select_module.specificityIncreaser, (!reversed || variant === 'default') && Select_module.default, reversed && Select_module.reversed, variant === 'secondary' && Select_module.secondary, variant === 'secondary-small' && Select_module.secondarySmall, !fullWidth && Select_module.notFullWidth, props.isDisabled && Select_module.disabled, status === 'error' && Select_module.error);
46
45
  var labelId = React.useState(label ? reactId : undefined)[0];
47
46
  return React__default.default.createElement(React__default.default.Fragment, null, label ? React__default.default.createElement(Label.Label, {
48
47
  reversed: reversed,
@@ -16,17 +16,19 @@ var ToggleSwitch = function (_a) {
16
16
  var toggledStatus = _a.toggledStatus,
17
17
  onToggle = _a.onToggle,
18
18
  reversed = _a.reversed,
19
- restProps = tslib.__rest(_a, ["toggledStatus", "onToggle", "reversed"]);
19
+ disabled = _a.disabled,
20
+ restProps = tslib.__rest(_a, ["toggledStatus", "onToggle", "reversed", "disabled"]);
20
21
  var isOn = toggledStatus === 'on';
21
22
  return React__default.default.createElement("span", {
22
23
  className: classnames__default.default(isOn ? ToggleSwitch_module.on : ToggleSwitch_module.off, reversed && ToggleSwitch_module.reversed)
23
24
  }, React__default.default.createElement("input", tslib.__assign({
24
25
  type: "checkbox",
25
- className: ToggleSwitch_module.checkbox,
26
+ className: classnames__default.default(ToggleSwitch_module.checkbox, disabled && ToggleSwitch_module.disabled),
26
27
  checked: isOn ? true : false,
27
- onChange: onToggle
28
+ onChange: onToggle,
29
+ disabled: disabled
28
30
  }, restProps)), React__default.default.createElement("span", {
29
- className: ToggleSwitch_module.track
31
+ className: classnames__default.default(ToggleSwitch_module.track, disabled && ToggleSwitch_module.disabled)
30
32
  }, React__default.default.createElement("span", {
31
33
  className: ToggleSwitch_module.thumb
32
34
  }, React__default.default.createElement(Icon.Icon, {
@@ -3,6 +3,7 @@
3
3
  var styles = {
4
4
  "checkbox": "ToggleSwitch-module_checkbox__ezWz3",
5
5
  "track": "ToggleSwitch-module_track__fcDMP",
6
+ "disabled": "ToggleSwitch-module_disabled__3H-9R",
6
7
  "thumb": "ToggleSwitch-module_thumb__8PULV",
7
8
  "checkIcon": "ToggleSwitch-module_checkIcon__8iitB",
8
9
  "on": "ToggleSwitch-module_on__CQpkh",
@@ -26,13 +26,12 @@ const Select = /*#__PURE__*/function () {
26
26
  description = _a.description,
27
27
  propsFullWidth = _a.fullWidth,
28
28
  propsClassName = _a.className,
29
- isDisabled = _a.isDisabled,
30
29
  placeholder = _a.placeholder,
31
- props = __rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className", "isDisabled", "placeholder"]);
30
+ props = __rest(_a, ["variant", "status", "reversed", "label", "validationMessage", "description", "fullWidth", "className", "placeholder"]);
32
31
  var reactId = useId();
33
32
  // the default for fullWidth depends on the variant
34
33
  var fullWidth = propsFullWidth !== null && propsFullWidth !== undefined ? propsFullWidth : !['secondary', 'secondary-small'].includes(variant);
35
- var classes = classnames(propsClassName, styles.specificityIncreaser, (!reversed || variant === 'default') && styles.default, reversed && styles.reversed, variant === 'secondary' && styles.secondary, variant === 'secondary-small' && styles.secondarySmall, !fullWidth && styles.notFullWidth, isDisabled && styles.disabled, status === 'error' && styles.error);
34
+ var classes = classnames(propsClassName, styles.specificityIncreaser, (!reversed || variant === 'default') && styles.default, reversed && styles.reversed, variant === 'secondary' && styles.secondary, variant === 'secondary-small' && styles.secondarySmall, !fullWidth && styles.notFullWidth, props.isDisabled && styles.disabled, status === 'error' && styles.error);
36
35
  var labelId = useState(label ? reactId : undefined)[0];
37
36
  return /*#__PURE__*/React.createElement(React.Fragment, null, label ? (/*#__PURE__*/React.createElement(Label, {
38
37
  reversed: reversed,
@@ -8,17 +8,19 @@ const ToggleSwitch = /*#__PURE__*/function () {
8
8
  var toggledStatus = _a.toggledStatus,
9
9
  onToggle = _a.onToggle,
10
10
  reversed = _a.reversed,
11
- restProps = __rest(_a, ["toggledStatus", "onToggle", "reversed"]);
11
+ disabled = _a.disabled,
12
+ restProps = __rest(_a, ["toggledStatus", "onToggle", "reversed", "disabled"]);
12
13
  var isOn = toggledStatus === 'on';
13
14
  return /*#__PURE__*/React.createElement("span", {
14
15
  className: classnames(isOn ? styles.on : styles.off, reversed && styles.reversed)
15
16
  }, /*#__PURE__*/React.createElement("input", __assign({
16
17
  type: "checkbox",
17
- className: styles.checkbox,
18
+ className: classnames(styles.checkbox, disabled && styles.disabled),
18
19
  checked: isOn ? true : false,
19
- onChange: onToggle
20
+ onChange: onToggle,
21
+ disabled: disabled
20
22
  }, restProps)), /*#__PURE__*/React.createElement("span", {
21
- className: styles.track
23
+ className: classnames(styles.track, disabled && styles.disabled)
22
24
  }, /*#__PURE__*/React.createElement("span", {
23
25
  className: styles.thumb
24
26
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -1,6 +1,7 @@
1
1
  var styles = {
2
2
  "checkbox": "ToggleSwitch-module_checkbox__ezWz3",
3
3
  "track": "ToggleSwitch-module_track__fcDMP",
4
+ "disabled": "ToggleSwitch-module_disabled__3H-9R",
4
5
  "thumb": "ToggleSwitch-module_thumb__8PULV",
5
6
  "checkIcon": "ToggleSwitch-module_checkIcon__8iitB",
6
7
  "on": "ToggleSwitch-module_on__CQpkh",
package/dist/styles.css CHANGED
@@ -11538,13 +11538,13 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
11538
11538
  /* stylelint-disable no-descending-specificity */
11539
11539
  /* stylelint-enable no-descending-specificity */
11540
11540
  }
11541
- .ToggleSwitch-module_checkbox__ezWz3:focus + .ToggleSwitch-module_track__fcDMP, .ToggleSwitch-module_checkbox__ezWz3:hover:focus + .ToggleSwitch-module_track__fcDMP {
11541
+ .ToggleSwitch-module_checkbox__ezWz3:not(.ToggleSwitch-module_disabled__3H-9R):focus + .ToggleSwitch-module_track__fcDMP, .ToggleSwitch-module_checkbox__ezWz3:not(.ToggleSwitch-module_disabled__3H-9R):hover:focus + .ToggleSwitch-module_track__fcDMP {
11542
11542
  border-color: transparent;
11543
11543
  outline: 2px solid var(--color-blue-500, #0168b3);
11544
11544
  outline-offset: 1px;
11545
11545
  background-color: var(--color-gray-600, #524e56);
11546
11546
  }
11547
- .ToggleSwitch-module_checkbox__ezWz3 + .ToggleSwitch-module_track__fcDMP:hover, label:hover .ToggleSwitch-module_checkbox__ezWz3 + .ToggleSwitch-module_track__fcDMP {
11547
+ .ToggleSwitch-module_checkbox__ezWz3:not(.ToggleSwitch-module_disabled__3H-9R) + .ToggleSwitch-module_track__fcDMP:hover, label:hover .ToggleSwitch-module_checkbox__ezWz3:not(.ToggleSwitch-module_disabled__3H-9R) + .ToggleSwitch-module_track__fcDMP {
11548
11548
  background-color: var(--color-purple-500, #844587);
11549
11549
  background-color: var(--color-gray-600, #524e56);
11550
11550
  }
@@ -11557,6 +11557,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
11557
11557
  border: var(--border-borderless-border-width, 2px) var(--border-borderless-border-style, solid) var(--border-borderless-border-color, transparent);
11558
11558
  border-radius: var(--spacing-md, 1.5rem);
11559
11559
  transition: left var(--animation-duration-immediate, 100ms) var(--animation-easing-function-linear, linear), right var(--animation-duration-immediate, 100ms) var(--animation-easing-function-linear, linear);
11560
+ cursor: default;
11560
11561
  }
11561
11562
 
11562
11563
  .ToggleSwitch-module_checkIcon__8iitB {
@@ -11572,7 +11573,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
11572
11573
  }
11573
11574
  .ToggleSwitch-module_on__CQpkh .ToggleSwitch-module_checkbox__ezWz3:focus + .ToggleSwitch-module_track__fcDMP {
11574
11575
  border-color: transparent;
11575
- background-color: var(--color-green-500, #3f9a86);
11576
+ background-color: var(--color-green-600, #2c7d67);
11576
11577
  }
11577
11578
  .ToggleSwitch-module_on__CQpkh .ToggleSwitch-module_thumb__8PULV {
11578
11579
  position: relative;
@@ -11584,7 +11585,7 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
11584
11585
  transition-delay: var(--animation-duration-immediate, 100ms);
11585
11586
  transition-duration: var(--animation-duration-fast, 300ms);
11586
11587
  }
11587
- .ToggleSwitch-module_on__CQpkh .ToggleSwitch-module_checkbox__ezWz3 + .ToggleSwitch-module_track__fcDMP:hover, label:hover .ToggleSwitch-module_on__CQpkh .ToggleSwitch-module_checkbox__ezWz3 + .ToggleSwitch-module_track__fcDMP {
11588
+ .ToggleSwitch-module_on__CQpkh .ToggleSwitch-module_checkbox__ezWz3:not(.ToggleSwitch-module_disabled__3H-9R) + .ToggleSwitch-module_track__fcDMP:hover, label:hover .ToggleSwitch-module_on__CQpkh .ToggleSwitch-module_checkbox__ezWz3:not(.ToggleSwitch-module_disabled__3H-9R) + .ToggleSwitch-module_track__fcDMP {
11588
11589
  background-color: var(--color-green-600, #2c7d67);
11589
11590
  }
11590
11591
 
@@ -11605,10 +11606,18 @@ input[type=range].InputRange-module_ratingScaleRange__gI-rs::-ms-thumb:not(:disa
11605
11606
  .ToggleSwitch-module_reversed__Q3-iM.ToggleSwitch-module_off__OhSEP .ToggleSwitch-module_checkbox__ezWz3:hover:focus + .ToggleSwitch-module_track__fcDMP {
11606
11607
  background-color: rgba(var(--color-white-rgb, 255, 255, 255), 0.65);
11607
11608
  }
11608
- .ToggleSwitch-module_reversed__Q3-iM.ToggleSwitch-module_off__OhSEP .ToggleSwitch-module_checkbox__ezWz3 + .ToggleSwitch-module_track__fcDMP:hover, label:hover .ToggleSwitch-module_reversed__Q3-iM.ToggleSwitch-module_off__OhSEP .ToggleSwitch-module_checkbox__ezWz3 + .ToggleSwitch-module_track__fcDMP {
11609
+ .ToggleSwitch-module_reversed__Q3-iM.ToggleSwitch-module_off__OhSEP .ToggleSwitch-module_checkbox__ezWz3:not(.ToggleSwitch-module_disabled__3H-9R) + .ToggleSwitch-module_track__fcDMP:hover, label:hover .ToggleSwitch-module_reversed__Q3-iM.ToggleSwitch-module_off__OhSEP .ToggleSwitch-module_checkbox__ezWz3:not(.ToggleSwitch-module_disabled__3H-9R) + .ToggleSwitch-module_track__fcDMP {
11609
11610
  background-color: rgba(var(--color-white-rgb, 255, 255, 255), 0.65);
11610
11611
  }
11611
11612
 
11613
+ label .ToggleSwitch-module_disabled__3H-9R.ToggleSwitch-module_track__fcDMP {
11614
+ opacity: 100%;
11615
+ }
11616
+
11617
+ .ToggleSwitch-module_disabled__3H-9R.ToggleSwitch-module_track__fcDMP {
11618
+ opacity: 30%;
11619
+ }
11620
+
11612
11621
  /* stylelint-enable no-descending-specificity */
11613
11622
  /** THIS IS AN AUTOGENERATED FILE **/
11614
11623
  .ToggleSwitchField-module_container__e7TXD {
@@ -10,6 +10,6 @@ export type ToggleSwitchProps = {
10
10
  reversed?: boolean;
11
11
  } & OverrideClassName<Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'onToggle'>>;
12
12
  export declare const ToggleSwitch: {
13
- ({ toggledStatus, onToggle, reversed, ...restProps }: ToggleSwitchProps): JSX.Element;
13
+ ({ toggledStatus, onToggle, reversed, disabled, ...restProps }: ToggleSwitchProps): JSX.Element;
14
14
  displayName: string;
15
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaizen/components",
3
- "version": "0.0.0-canary-test-1-20250203230448",
3
+ "version": "0.0.0-canary-v3-utils-export-20250211025631",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -81,9 +81,15 @@
81
81
  "require": "./dist/cjs/reactAriaComponentsV3.cjs",
82
82
  "types": "./dist/types/__react-aria-components__/index.d.ts"
83
83
  },
84
+ "./v3/utilities": {
85
+ "import": "./dist/esm/utilitiesV3.mjs",
86
+ "require": "./dist/cjs/utilitiesV3.cjs",
87
+ "types": "./dist/types/__utilities__/v3.d.ts"
88
+ },
84
89
  "./dist/styles.css": {
85
90
  "import": "./dist/styles.css",
86
- "require": "./dist/styles.css"
91
+ "require": "./dist/styles.css",
92
+ "style": "./dist/styles.css"
87
93
  }
88
94
  },
89
95
  "bin": {
@@ -57,7 +57,6 @@ export const Select = React.forwardRef<any, SelectProps>(
57
57
  description,
58
58
  fullWidth: propsFullWidth,
59
59
  className: propsClassName,
60
- isDisabled,
61
60
  placeholder,
62
61
  ...props
63
62
  },
@@ -76,7 +75,7 @@ export const Select = React.forwardRef<any, SelectProps>(
76
75
  variant === 'secondary' && styles.secondary,
77
76
  variant === 'secondary-small' && styles.secondarySmall,
78
77
  !fullWidth && styles.notFullWidth,
79
- isDisabled && styles.disabled,
78
+ props.isDisabled && styles.disabled,
80
79
  status === 'error' && styles.error,
81
80
  )
82
81
 
@@ -27,19 +27,20 @@ $focus-ring-offset: 1px;
27
27
 
28
28
  /* TODO: Fix */
29
29
  /* stylelint-disable no-descending-specificity */
30
- .checkbox:focus + &,
31
- .checkbox:hover:focus + & {
30
+ .checkbox:not(.disabled):focus + &,
31
+ .checkbox:not(.disabled):hover:focus + & {
32
32
  border-color: transparent;
33
33
  outline: 2px solid $color-blue-500;
34
34
  outline-offset: $focus-ring-offset;
35
35
  background-color: $color-gray-600;
36
36
  }
37
37
 
38
- .checkbox + &:hover,
39
- label:hover .checkbox + & {
38
+ .checkbox:not(.disabled) + &:hover,
39
+ label:hover .checkbox:not(.disabled) + & {
40
40
  background-color: $color-purple-500;
41
41
  background-color: $color-gray-600;
42
42
  }
43
+
43
44
  /* stylelint-enable no-descending-specificity */
44
45
  }
45
46
 
@@ -54,6 +55,7 @@ $focus-ring-offset: 1px;
54
55
  transition:
55
56
  left $animation-timing,
56
57
  right $animation-timing;
58
+ cursor: default;
57
59
  }
58
60
 
59
61
  .checkIcon {
@@ -71,7 +73,7 @@ $focus-ring-offset: 1px;
71
73
 
72
74
  .checkbox:focus + .track {
73
75
  border-color: transparent;
74
- background-color: $color-green-500;
76
+ background-color: $color-green-600;
75
77
  }
76
78
 
77
79
  .thumb {
@@ -86,8 +88,8 @@ $focus-ring-offset: 1px;
86
88
  transition-duration: $animation-duration-fast;
87
89
  }
88
90
 
89
- .checkbox + .track:hover,
90
- label:hover & .checkbox + .track {
91
+ .checkbox:not(.disabled) + .track:hover,
92
+ label:hover & .checkbox:not(.disabled) + .track {
91
93
  background-color: $color-green-600;
92
94
  }
93
95
  }
@@ -116,10 +118,20 @@ $focus-ring-offset: 1px;
116
118
  background-color: rgba($color-white-rgb, 0.65);
117
119
  }
118
120
 
119
- .checkbox + .track:hover,
120
- label:hover & .checkbox + .track {
121
+ .checkbox:not(.disabled) + .track:hover,
122
+ label:hover & .checkbox:not(.disabled) + .track {
121
123
  background-color: rgba($color-white-rgb, 0.65);
122
124
  }
123
125
  }
124
126
  }
127
+
128
+ // When the ToggleSwitch is used as part of the ToggleSwitchField, the disabled state opacity is set on the Label component
129
+ label .disabled.track {
130
+ opacity: 100%;
131
+ }
132
+
133
+ .disabled.track {
134
+ opacity: 30%;
135
+ }
136
+
125
137
  /* stylelint-enable no-descending-specificity */
@@ -19,6 +19,7 @@ export const ToggleSwitch = ({
19
19
  toggledStatus,
20
20
  onToggle,
21
21
  reversed,
22
+ disabled,
22
23
  ...restProps
23
24
  }: ToggleSwitchProps): JSX.Element => {
24
25
  const isOn = toggledStatus === 'on'
@@ -27,12 +28,13 @@ export const ToggleSwitch = ({
27
28
  <span className={classnames(isOn ? styles.on : styles.off, reversed && styles.reversed)}>
28
29
  <input
29
30
  type="checkbox"
30
- className={styles.checkbox}
31
+ className={classnames(styles.checkbox, disabled && styles.disabled)}
31
32
  checked={isOn ? true : false}
32
33
  onChange={onToggle}
34
+ disabled={disabled}
33
35
  {...restProps}
34
36
  />
35
- <span className={styles.track}>
37
+ <span className={classnames(styles.track, disabled && styles.disabled)}>
36
38
  <span className={styles.thumb}>
37
39
  <Icon name="check" isPresentational className={styles.checkIcon} />
38
40
  </span>