@hitachivantara/uikit-react-core 5.99.1 → 5.100.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.
@@ -4,6 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const MuiSwitch = require("@mui/material/Switch");
6
6
  const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
7
+ const uikitStyles = require("@hitachivantara/uikit-styles");
7
8
  const BaseSwitch_styles = require("./BaseSwitch.styles.cjs");
8
9
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
9
10
  const MuiSwitch__default = /* @__PURE__ */ _interopDefault(MuiSwitch);
@@ -24,9 +25,11 @@ const HvBaseSwitch = React.forwardRef(
24
25
  inputProps,
25
26
  onFocusVisible,
26
27
  onBlur,
28
+ size = "sm",
29
+ color,
27
30
  ...others
28
31
  } = uikitReactUtils.useDefaultProps("HvBaseSwitch", props);
29
- const { classes, cx } = BaseSwitch_styles.useClasses(classesProp);
32
+ const { classes, cx, css } = BaseSwitch_styles.useClasses(classesProp);
30
33
  const [focusVisible, setFocusVisible] = React.useState(false);
31
34
  const onFocusVisibleCallback = React.useCallback(
32
35
  (evt) => {
@@ -66,7 +69,6 @@ const HvBaseSwitch = React.forwardRef(
66
69
  },
67
70
  className
68
71
  ),
69
- color: "default",
70
72
  disabled,
71
73
  required,
72
74
  readOnly,
@@ -76,15 +78,27 @@ const HvBaseSwitch = React.forwardRef(
76
78
  defaultChecked,
77
79
  classes: {
78
80
  root: classes.switch,
79
- switchBase: classes.switchBase,
81
+ switchBase: cx(classes.switchBase),
80
82
  checked: classes.checked,
81
- track: classes.track,
82
- thumb: classes.thumb,
83
+ track: cx(
84
+ classes.track,
85
+ color ? css({
86
+ backgroundColor: `${uikitStyles.getColor(color, "transparent")}!important`,
87
+ border: "none"
88
+ }) : void 0
89
+ ),
90
+ thumb: cx(
91
+ classes.thumb,
92
+ color ? css({
93
+ border: "none"
94
+ }) : void 0
95
+ ),
83
96
  disabled: classes.disabled
84
97
  },
85
98
  inputProps,
86
99
  onFocusVisible: onFocusVisibleCallback,
87
100
  onBlur: onBlurCallback,
101
+ "data-size": size,
88
102
  ...others
89
103
  }
90
104
  );
@@ -5,10 +5,10 @@ const uikitStyles = require("@hitachivantara/uikit-styles");
5
5
  const focusUtils = require("../utils/focusUtils.cjs");
6
6
  const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseSwitch", {
7
7
  root: {
8
- padding: 0,
8
+ padding: uikitStyles.theme.space.xs,
9
9
  cursor: "pointer",
10
- width: "40px",
11
- height: "32px",
10
+ width: "fit-content",
11
+ height: "fit-content",
12
12
  alignItems: "center",
13
13
  justifyContent: "center",
14
14
  borderRadius: uikitStyles.theme.radii.round,
@@ -27,7 +27,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseSwitc
27
27
  backgroundColor: uikitStyles.theme.colors.primary,
28
28
  borderColor: "transparent"
29
29
  },
30
- "& $thumb:not:has($disabled)": {
30
+ "&:not($disabled) $thumb": {
31
31
  borderColor: "transparent"
32
32
  },
33
33
  "&:hover": {
@@ -57,7 +57,23 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseSwitc
57
57
  switchBase: {
58
58
  width: "40px",
59
59
  height: "32px",
60
- padding: 0
60
+ padding: 0,
61
+ "&[data-size=medium]": {
62
+ "+.HvBaseSwitch-track": {
63
+ width: 48,
64
+ height: 22
65
+ },
66
+ "& $thumb": {
67
+ left: -2,
68
+ top: 3,
69
+ width: 18,
70
+ height: 18
71
+ },
72
+ "&$checked $thumb": {
73
+ left: 8,
74
+ top: 3
75
+ }
76
+ }
61
77
  },
62
78
  track: {
63
79
  opacity: 1,
@@ -69,7 +85,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseSwitc
69
85
  },
70
86
  thumb: {
71
87
  position: "relative",
72
- left: "-9px",
88
+ left: "-5px",
73
89
  width: "10px",
74
90
  height: "10px",
75
91
  border: `solid 1px ${uikitStyles.theme.colors.borderStrong}`,
@@ -25,6 +25,7 @@ const HvLoading = React.forwardRef(function HvLoading2(props, ref) {
25
25
  {
26
26
  ref,
27
27
  hidden: !!hidden,
28
+ "data-size": size,
28
29
  style: uikitReactUtils.mergeStyles(style, {
29
30
  color: uikitStyles.getColor(color, small ? "text" : "brand"),
30
31
  "--customColor": uikitStyles.getColor(color)
@@ -8,28 +8,27 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvLoading",
8
8
  flexDirection: "column",
9
9
  alignItems: "center",
10
10
  justifyContent: "center",
11
- gap: uikitStyles.theme.space.xs
11
+ gap: uikitStyles.theme.space.xs,
12
+ "&[data-size=small]": {
13
+ "--bar-size": "2px",
14
+ "--size": "18px",
15
+ "--height": "40%"
16
+ }
12
17
  },
13
18
  barContainer: {
14
19
  display: "flex",
15
20
  alignItems: "center",
16
21
  justifyContent: "space-around",
17
- ":has($regular)": {
18
- width: 30,
19
- height: 30
20
- },
21
- ":has($small)": {
22
- "--height": "40%",
23
- width: 18,
24
- height: 18
25
- }
22
+ width: "var(--size, 30px)",
23
+ height: "var(--size, 30px)"
26
24
  },
27
25
  loadingBar: {
28
26
  backgroundColor: "currentcolor",
29
27
  display: "inline-block",
30
28
  animation: "loading 1s ease-in-out infinite",
31
29
  // TODO: make this the default when it has better support
32
- width: "round(up, 0.11em, 2px)",
30
+ // width: "round(up, 0.11em, 2px)",
31
+ width: "var(--bar-size, 4px)",
33
32
  height: "100%",
34
33
  "@keyframes loading": {
35
34
  "50%": {
@@ -46,13 +45,13 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvLoading",
46
45
  overlay: {},
47
46
  blur: {},
48
47
  hidden: { display: "none" },
49
- small: {
50
- width: 2
51
- },
52
- regular: {
53
- width: 4
54
- },
48
+ /** @deprecated use data-size=small instead */
49
+ small: {},
50
+ /** @deprecated use data-size=regular instead */
51
+ regular: {},
52
+ /** @deprecated leverage data-size=small instead */
55
53
  smallColor: {},
54
+ /** @deprecated leverage data-size=regular instead */
56
55
  regularColor: {}
57
56
  });
58
57
  exports.staticClasses = staticClasses;
@@ -26,7 +26,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(name, {
26
26
  fontSize: 4,
27
27
  color: uikitStyles.theme.colors.textDisabled
28
28
  },
29
- // TODO: remove in v6 (use classes.button)
29
+ /** @deprecated: use classes.button instead */
30
30
  text: {},
31
31
  button: {
32
32
  display: "flex",
@@ -3,7 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
6
- const uikitStyles = require("@hitachivantara/uikit-styles");
7
6
  const useControlled = require("../hooks/useControlled.cjs");
8
7
  const useUniqueId = require("../hooks/useUniqueId.cjs");
9
8
  const setId = require("../utils/setId.cjs");
@@ -13,7 +12,6 @@ const FormElement = require("../FormElement/FormElement.cjs");
13
12
  const Label = require("../FormElement/Label/Label.cjs");
14
13
  const utils = require("../FormElement/utils.cjs");
15
14
  const WarningText = require("../FormElement/WarningText/WarningText.cjs");
16
- const isSemantical = (color) => ["positive", "negative", "warning"].includes(color);
17
15
  const HvSwitch = React.forwardRef(
18
16
  function HvSwitch2(props, ref) {
19
17
  const {
@@ -37,10 +35,9 @@ const HvSwitch = React.forwardRef(
37
35
  statusMessage,
38
36
  "aria-errormessage": ariaErrorMessage,
39
37
  inputProps,
40
- color,
41
38
  ...others
42
39
  } = uikitReactUtils.useDefaultProps("HvSwitch", props);
43
- const { classes, cx, css } = Switch_styles.useClasses(classesProp);
40
+ const { classes, cx } = Switch_styles.useClasses(classesProp);
44
41
  const elementId = useUniqueId.useUniqueId(id);
45
42
  const [isChecked, setIsChecked] = useControlled.useControlled(checked, defaultChecked);
46
43
  const [validationState, setValidationState] = useControlled.useControlled(
@@ -116,16 +113,6 @@ const HvSwitch = React.forwardRef(
116
113
  "aria-describedby": ariaDescribedBy,
117
114
  ...inputProps
118
115
  },
119
- ...color && {
120
- classes: {
121
- switchBase: css({
122
- "&&&+.HvBaseSwitch-track,&&&.HvBaseSwitch-checked+.HvBaseSwitch-track": {
123
- backgroundColor: uikitStyles.getColor(color),
124
- borderColor: isSemantical(color) ? uikitStyles.getColor(`${color}Deep`) : "#00000032"
125
- }
126
- })
127
- }
128
- },
129
116
  ...others
130
117
  }
131
118
  )
@@ -181,9 +181,7 @@ const ds3 = uikitStyles.mergeTheme(uikitStyles.ds3, {
181
181
  HvBaseSwitch: {
182
182
  classes: {
183
183
  root: {
184
- width: "32px",
185
- height: "16px",
186
- borderRadius: 0,
184
+ padding: 0,
187
185
  "&:hover": {
188
186
  backgroundColor: "transparent"
189
187
  },
@@ -204,7 +202,8 @@ const ds3 = uikitStyles.mergeTheme(uikitStyles.ds3, {
204
202
  },
205
203
  thumb: {
206
204
  width: 12,
207
- height: 12
205
+ height: 12,
206
+ left: -9
208
207
  }
209
208
  }
210
209
  },
@@ -114,39 +114,71 @@ const pentahoPlus = uikitStyles.mergeTheme(uikitStyles.pentahoPlus, {
114
114
  HvBaseSwitch: {
115
115
  classes: {
116
116
  root: {
117
- borderRadius: uikitStyles.theme.radii.base,
117
+ padding: uikitStyles.theme.space.xxs,
118
+ borderRadius: uikitStyles.theme.radii.full,
118
119
  "&:hover": {
119
120
  backgroundColor: uikitStyles.theme.colors.bgHover
120
121
  },
121
122
  "& .HvBaseSwitch-switchBase": {
122
123
  "& .HvBaseSwitch-thumb": {
123
124
  borderColor: "transparent",
124
- boxShadow: `0px 1px 1px 0px ${uikitStyles.theme.alpha(uikitStyles.slate[700], 0.16)}`
125
+ backgroundColor: "#FFFFFF",
126
+ left: -8,
127
+ top: -3,
128
+ width: 14,
129
+ height: 14
125
130
  },
126
131
  "+.HvBaseSwitch-track": {
127
- height: 14,
128
132
  backgroundColor: uikitStyles.theme.colors.textDimmed,
129
- borderColor: uikitStyles.theme.colors.textSubtle
133
+ border: "none",
134
+ width: 40,
135
+ height: 18
130
136
  },
131
137
  "&.HvBaseSwitch-checked": {
132
- "& .HvBaseSwitch-thumb": {
133
- border: `1px solid ${uikitStyles.theme.colors.bgContainer}`
134
- },
135
138
  "+.HvBaseSwitch-track": {
136
- borderColor: uikitStyles.theme.colors.primaryStrong
139
+ backgroundColor: uikitStyles.theme.colors.positive
140
+ },
141
+ "& .HvBaseSwitch-thumb": {
142
+ left: -2
137
143
  }
138
144
  },
139
145
  "&.HvBaseSwitch-disabled": {
140
146
  "& .HvBaseSwitch-thumb": {
141
- backgroundColor: uikitStyles.theme.colors.borderDisabled,
142
- borderColor: uikitStyles.theme.colors.borderDisabled
147
+ borderColor: uikitStyles.theme.colors.textDisabled
143
148
  },
144
149
  "+.HvBaseSwitch-track": {
145
- borderColor: uikitStyles.theme.colors.borderDisabled,
146
- backgroundColor: uikitStyles.theme.colors.bgDisabled
150
+ backgroundColor: uikitStyles.theme.colors.bgDisabled,
151
+ border: "none"
152
+ }
153
+ },
154
+ "&[data-size=medium]": {
155
+ "+.HvBaseSwitch-track": {
156
+ width: 48,
157
+ height: 24
158
+ },
159
+ "& .HvBaseSwitch-thumb": {
160
+ left: -5,
161
+ top: 0,
162
+ width: 16,
163
+ height: 16
164
+ },
165
+ "&.HvBaseSwitch-checked .HvBaseSwitch-thumb": {
166
+ left: 3,
167
+ top: 0
147
168
  }
148
169
  }
149
170
  }
171
+ },
172
+ readOnly: {
173
+ ":hover": {
174
+ backgroundColor: "transparent"
175
+ },
176
+ "& .HvBaseSwitch-switchBase + .HvBaseSwitch-track": {
177
+ backgroundColor: uikitStyles.theme.colors.border
178
+ },
179
+ "& .HvBaseSwitch-switchBase.HvBaseSwitch-checked + .HvBaseSwitch-track": {
180
+ backgroundColor: uikitStyles.theme.mix("positive", 0.5, "dimmer")
181
+ }
150
182
  }
151
183
  }
152
184
  },
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useState, useCallback } from "react";
3
3
  import MuiSwitch from "@mui/material/Switch";
4
4
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
5
+ import { getColor } from "@hitachivantara/uikit-styles";
5
6
  import { useClasses } from "./BaseSwitch.styles.js";
6
7
  import { staticClasses } from "./BaseSwitch.styles.js";
7
8
  const HvBaseSwitch = forwardRef(
@@ -21,9 +22,11 @@ const HvBaseSwitch = forwardRef(
21
22
  inputProps,
22
23
  onFocusVisible,
23
24
  onBlur,
25
+ size = "sm",
26
+ color,
24
27
  ...others
25
28
  } = useDefaultProps("HvBaseSwitch", props);
26
- const { classes, cx } = useClasses(classesProp);
29
+ const { classes, cx, css } = useClasses(classesProp);
27
30
  const [focusVisible, setFocusVisible] = useState(false);
28
31
  const onFocusVisibleCallback = useCallback(
29
32
  (evt) => {
@@ -63,7 +66,6 @@ const HvBaseSwitch = forwardRef(
63
66
  },
64
67
  className
65
68
  ),
66
- color: "default",
67
69
  disabled,
68
70
  required,
69
71
  readOnly,
@@ -73,15 +75,27 @@ const HvBaseSwitch = forwardRef(
73
75
  defaultChecked,
74
76
  classes: {
75
77
  root: classes.switch,
76
- switchBase: classes.switchBase,
78
+ switchBase: cx(classes.switchBase),
77
79
  checked: classes.checked,
78
- track: classes.track,
79
- thumb: classes.thumb,
80
+ track: cx(
81
+ classes.track,
82
+ color ? css({
83
+ backgroundColor: `${getColor(color, "transparent")}!important`,
84
+ border: "none"
85
+ }) : void 0
86
+ ),
87
+ thumb: cx(
88
+ classes.thumb,
89
+ color ? css({
90
+ border: "none"
91
+ }) : void 0
92
+ ),
80
93
  disabled: classes.disabled
81
94
  },
82
95
  inputProps,
83
96
  onFocusVisible: onFocusVisibleCallback,
84
97
  onBlur: onBlurCallback,
98
+ "data-size": size,
85
99
  ...others
86
100
  }
87
101
  );
@@ -3,10 +3,10 @@ import { theme } from "@hitachivantara/uikit-styles";
3
3
  import { outlineStyles } from "../utils/focusUtils.js";
4
4
  const { staticClasses, useClasses } = createClasses("HvBaseSwitch", {
5
5
  root: {
6
- padding: 0,
6
+ padding: theme.space.xs,
7
7
  cursor: "pointer",
8
- width: "40px",
9
- height: "32px",
8
+ width: "fit-content",
9
+ height: "fit-content",
10
10
  alignItems: "center",
11
11
  justifyContent: "center",
12
12
  borderRadius: theme.radii.round,
@@ -25,7 +25,7 @@ const { staticClasses, useClasses } = createClasses("HvBaseSwitch", {
25
25
  backgroundColor: theme.colors.primary,
26
26
  borderColor: "transparent"
27
27
  },
28
- "& $thumb:not:has($disabled)": {
28
+ "&:not($disabled) $thumb": {
29
29
  borderColor: "transparent"
30
30
  },
31
31
  "&:hover": {
@@ -55,7 +55,23 @@ const { staticClasses, useClasses } = createClasses("HvBaseSwitch", {
55
55
  switchBase: {
56
56
  width: "40px",
57
57
  height: "32px",
58
- padding: 0
58
+ padding: 0,
59
+ "&[data-size=medium]": {
60
+ "+.HvBaseSwitch-track": {
61
+ width: 48,
62
+ height: 22
63
+ },
64
+ "& $thumb": {
65
+ left: -2,
66
+ top: 3,
67
+ width: 18,
68
+ height: 18
69
+ },
70
+ "&$checked $thumb": {
71
+ left: 8,
72
+ top: 3
73
+ }
74
+ }
59
75
  },
60
76
  track: {
61
77
  opacity: 1,
@@ -67,7 +83,7 @@ const { staticClasses, useClasses } = createClasses("HvBaseSwitch", {
67
83
  },
68
84
  thumb: {
69
85
  position: "relative",
70
- left: "-9px",
86
+ left: "-5px",
71
87
  width: "10px",
72
88
  height: "10px",
73
89
  border: `solid 1px ${theme.colors.borderStrong}`,
@@ -24,6 +24,7 @@ const HvLoading = forwardRef(function HvLoading2(props, ref) {
24
24
  {
25
25
  ref,
26
26
  hidden: !!hidden,
27
+ "data-size": size,
27
28
  style: mergeStyles(style, {
28
29
  color: getColor(color, small ? "text" : "brand"),
29
30
  "--customColor": getColor(color)
@@ -6,28 +6,27 @@ const { staticClasses, useClasses } = createClasses("HvLoading", {
6
6
  flexDirection: "column",
7
7
  alignItems: "center",
8
8
  justifyContent: "center",
9
- gap: theme.space.xs
9
+ gap: theme.space.xs,
10
+ "&[data-size=small]": {
11
+ "--bar-size": "2px",
12
+ "--size": "18px",
13
+ "--height": "40%"
14
+ }
10
15
  },
11
16
  barContainer: {
12
17
  display: "flex",
13
18
  alignItems: "center",
14
19
  justifyContent: "space-around",
15
- ":has($regular)": {
16
- width: 30,
17
- height: 30
18
- },
19
- ":has($small)": {
20
- "--height": "40%",
21
- width: 18,
22
- height: 18
23
- }
20
+ width: "var(--size, 30px)",
21
+ height: "var(--size, 30px)"
24
22
  },
25
23
  loadingBar: {
26
24
  backgroundColor: "currentcolor",
27
25
  display: "inline-block",
28
26
  animation: "loading 1s ease-in-out infinite",
29
27
  // TODO: make this the default when it has better support
30
- width: "round(up, 0.11em, 2px)",
28
+ // width: "round(up, 0.11em, 2px)",
29
+ width: "var(--bar-size, 4px)",
31
30
  height: "100%",
32
31
  "@keyframes loading": {
33
32
  "50%": {
@@ -44,13 +43,13 @@ const { staticClasses, useClasses } = createClasses("HvLoading", {
44
43
  overlay: {},
45
44
  blur: {},
46
45
  hidden: { display: "none" },
47
- small: {
48
- width: 2
49
- },
50
- regular: {
51
- width: 4
52
- },
46
+ /** @deprecated use data-size=small instead */
47
+ small: {},
48
+ /** @deprecated use data-size=regular instead */
49
+ regular: {},
50
+ /** @deprecated leverage data-size=small instead */
53
51
  smallColor: {},
52
+ /** @deprecated leverage data-size=regular instead */
54
53
  regularColor: {}
55
54
  });
56
55
  export {
@@ -24,7 +24,7 @@ const { staticClasses, useClasses } = createClasses(name, {
24
24
  fontSize: 4,
25
25
  color: theme.colors.textDisabled
26
26
  },
27
- // TODO: remove in v6 (use classes.button)
27
+ /** @deprecated: use classes.button instead */
28
28
  text: {},
29
29
  button: {
30
30
  display: "flex",
@@ -1,7 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback } from "react";
3
3
  import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
4
- import { getColor } from "@hitachivantara/uikit-styles";
5
4
  import { useControlled } from "../hooks/useControlled.js";
6
5
  import { useUniqueId } from "../hooks/useUniqueId.js";
7
6
  import { setId } from "../utils/setId.js";
@@ -12,7 +11,6 @@ import { HvFormElement } from "../FormElement/FormElement.js";
12
11
  import { HvLabel } from "../FormElement/Label/Label.js";
13
12
  import { isInvalid } from "../FormElement/utils.js";
14
13
  import { HvWarningText } from "../FormElement/WarningText/WarningText.js";
15
- const isSemantical = (color) => ["positive", "negative", "warning"].includes(color);
16
14
  const HvSwitch = forwardRef(
17
15
  function HvSwitch2(props, ref) {
18
16
  const {
@@ -36,10 +34,9 @@ const HvSwitch = forwardRef(
36
34
  statusMessage,
37
35
  "aria-errormessage": ariaErrorMessage,
38
36
  inputProps,
39
- color,
40
37
  ...others
41
38
  } = useDefaultProps("HvSwitch", props);
42
- const { classes, cx, css } = useClasses(classesProp);
39
+ const { classes, cx } = useClasses(classesProp);
43
40
  const elementId = useUniqueId(id);
44
41
  const [isChecked, setIsChecked] = useControlled(checked, defaultChecked);
45
42
  const [validationState, setValidationState] = useControlled(
@@ -115,16 +112,6 @@ const HvSwitch = forwardRef(
115
112
  "aria-describedby": ariaDescribedBy,
116
113
  ...inputProps
117
114
  },
118
- ...color && {
119
- classes: {
120
- switchBase: css({
121
- "&&&+.HvBaseSwitch-track,&&&.HvBaseSwitch-checked+.HvBaseSwitch-track": {
122
- backgroundColor: getColor(color),
123
- borderColor: isSemantical(color) ? getColor(`${color}Deep`) : "#00000032"
124
- }
125
- })
126
- }
127
- },
128
115
  ...others
129
116
  }
130
117
  )
@@ -179,9 +179,7 @@ const ds3 = mergeTheme(ds3$1, {
179
179
  HvBaseSwitch: {
180
180
  classes: {
181
181
  root: {
182
- width: "32px",
183
- height: "16px",
184
- borderRadius: 0,
182
+ padding: 0,
185
183
  "&:hover": {
186
184
  backgroundColor: "transparent"
187
185
  },
@@ -202,7 +200,8 @@ const ds3 = mergeTheme(ds3$1, {
202
200
  },
203
201
  thumb: {
204
202
  width: 12,
205
- height: 12
203
+ height: 12,
204
+ left: -9
206
205
  }
207
206
  }
208
207
  },
@@ -112,39 +112,71 @@ const pentahoPlus = mergeTheme(pentahoPlus$1, {
112
112
  HvBaseSwitch: {
113
113
  classes: {
114
114
  root: {
115
- borderRadius: theme.radii.base,
115
+ padding: theme.space.xxs,
116
+ borderRadius: theme.radii.full,
116
117
  "&:hover": {
117
118
  backgroundColor: theme.colors.bgHover
118
119
  },
119
120
  "& .HvBaseSwitch-switchBase": {
120
121
  "& .HvBaseSwitch-thumb": {
121
122
  borderColor: "transparent",
122
- boxShadow: `0px 1px 1px 0px ${theme.alpha(slate[700], 0.16)}`
123
+ backgroundColor: "#FFFFFF",
124
+ left: -8,
125
+ top: -3,
126
+ width: 14,
127
+ height: 14
123
128
  },
124
129
  "+.HvBaseSwitch-track": {
125
- height: 14,
126
130
  backgroundColor: theme.colors.textDimmed,
127
- borderColor: theme.colors.textSubtle
131
+ border: "none",
132
+ width: 40,
133
+ height: 18
128
134
  },
129
135
  "&.HvBaseSwitch-checked": {
130
- "& .HvBaseSwitch-thumb": {
131
- border: `1px solid ${theme.colors.bgContainer}`
132
- },
133
136
  "+.HvBaseSwitch-track": {
134
- borderColor: theme.colors.primaryStrong
137
+ backgroundColor: theme.colors.positive
138
+ },
139
+ "& .HvBaseSwitch-thumb": {
140
+ left: -2
135
141
  }
136
142
  },
137
143
  "&.HvBaseSwitch-disabled": {
138
144
  "& .HvBaseSwitch-thumb": {
139
- backgroundColor: theme.colors.borderDisabled,
140
- borderColor: theme.colors.borderDisabled
145
+ borderColor: theme.colors.textDisabled
141
146
  },
142
147
  "+.HvBaseSwitch-track": {
143
- borderColor: theme.colors.borderDisabled,
144
- backgroundColor: theme.colors.bgDisabled
148
+ backgroundColor: theme.colors.bgDisabled,
149
+ border: "none"
150
+ }
151
+ },
152
+ "&[data-size=medium]": {
153
+ "+.HvBaseSwitch-track": {
154
+ width: 48,
155
+ height: 24
156
+ },
157
+ "& .HvBaseSwitch-thumb": {
158
+ left: -5,
159
+ top: 0,
160
+ width: 16,
161
+ height: 16
162
+ },
163
+ "&.HvBaseSwitch-checked .HvBaseSwitch-thumb": {
164
+ left: 3,
165
+ top: 0
145
166
  }
146
167
  }
147
168
  }
169
+ },
170
+ readOnly: {
171
+ ":hover": {
172
+ backgroundColor: "transparent"
173
+ },
174
+ "& .HvBaseSwitch-switchBase + .HvBaseSwitch-track": {
175
+ backgroundColor: theme.colors.border
176
+ },
177
+ "& .HvBaseSwitch-switchBase.HvBaseSwitch-checked + .HvBaseSwitch-track": {
178
+ backgroundColor: theme.mix("positive", 0.5, "dimmer")
179
+ }
148
180
  }
149
181
  }
150
182
  },
@@ -1794,7 +1794,7 @@ export declare const HvBaseSwitch: ForwardRefExoticComponent<Omit<HvBaseSwitchPr
1794
1794
 
1795
1795
  export declare type HvBaseSwitchClasses = ExtractNames<typeof useClasses_34>;
1796
1796
 
1797
- export declare interface HvBaseSwitchProps extends Omit<SwitchProps, "onChange" | "classes"> {
1797
+ export declare interface HvBaseSwitchProps extends Omit<SwitchProps, "onChange" | "classes" | "color"> {
1798
1798
  /**
1799
1799
  * Class names to be applied.
1800
1800
  */
@@ -1859,6 +1859,12 @@ export declare interface HvBaseSwitchProps extends Omit<SwitchProps, "onChange"
1859
1859
  * @ignore
1860
1860
  */
1861
1861
  onBlur?: (event: React.FocusEvent<any>) => void;
1862
+ /**
1863
+ * The size of the switch.
1864
+ */
1865
+ size?: SwitchProps["size"];
1866
+ /** Color applied to the switch. */
1867
+ color?: HvColorAny;
1862
1868
  }
1863
1869
 
1864
1870
  export { HvBaseTheme }
@@ -6122,7 +6128,7 @@ export declare interface HvSwitchColumnCellProp {
6122
6128
  switchProps?: HvBaseSwitchProps;
6123
6129
  }
6124
6130
 
6125
- export declare interface HvSwitchProps extends Omit<SwitchProps, "color" | "onChange" | "classes"> {
6131
+ export declare interface HvSwitchProps extends Omit<SwitchProps, "color" | "onChange" | "classes" | "size"> {
6126
6132
  /**
6127
6133
  * A Jss Object used to override or extend the styles applied to the switch.
6128
6134
  */
@@ -6208,6 +6214,8 @@ export declare interface HvSwitchProps extends Omit<SwitchProps, "color" | "onCh
6208
6214
  component?: SwitchProps["component"];
6209
6215
  /** Color applied to the switch. */
6210
6216
  color?: HvColorAny;
6217
+ /** The size of the switch. */
6218
+ size?: HvBaseSwitchProps["size"];
6211
6219
  }
6212
6220
 
6213
6221
  export declare const HvTab: ForwardRefExoticComponent<Omit<HvTabProps, "ref"> & RefAttributes<HTMLDivElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-core",
3
- "version": "5.99.1",
3
+ "version": "5.100.0",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "UI Kit Core React components.",
@@ -61,7 +61,7 @@
61
61
  "access": "public",
62
62
  "directory": "package"
63
63
  },
64
- "gitHead": "581850c6252b29a8cd9820a6e87b2df89830155f",
64
+ "gitHead": "8661e8a73c6ae39431fe12f6cc95e8eb282968e2",
65
65
  "exports": {
66
66
  ".": {
67
67
  "types": "./dist/types/index.d.ts",