@splunk/react-ui 5.0.0-beta.4 → 5.0.0-beta.5

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.
Files changed (74) hide show
  1. package/Button.js +3 -1
  2. package/CHANGELOG.md +4 -1
  3. package/CHANGELOG.v5.mdx +35 -0
  4. package/Card.js +163 -162
  5. package/Chip.js +171 -225
  6. package/Clickable.js +79 -76
  7. package/ComboBox.js +1 -1
  8. package/Date.js +160 -184
  9. package/DualListbox.js +439 -504
  10. package/File.js +449 -324
  11. package/FormRows.js +143 -142
  12. package/JSONTree.js +496 -521
  13. package/Layer.js +162 -97
  14. package/Link.js +20 -13
  15. package/MIGRATION.v5.mdx +47 -0
  16. package/Markdown.js +1 -1
  17. package/Message.js +119 -141
  18. package/MessageBar.js +109 -168
  19. package/Multiselect.js +595 -602
  20. package/Popover.js +194 -190
  21. package/Progress.js +68 -54
  22. package/RadioBar.js +4 -1
  23. package/RadioList.js +67 -65
  24. package/Resize.js +377 -265
  25. package/ResultsMenu.js +573 -661
  26. package/ScrollContainerContext.js +13 -9
  27. package/Search.js +1 -1
  28. package/Select.js +206 -199
  29. package/Slider.js +455 -329
  30. package/StepBar.js +2 -2
  31. package/Switch.js +88 -87
  32. package/TabBar.js +322 -317
  33. package/TabLayout.js +34 -34
  34. package/Table.js +548 -525
  35. package/Text.js +20 -19
  36. package/TextArea.js +278 -152
  37. package/Tooltip.js +173 -177
  38. package/Tree.js +2 -2
  39. package/Typography.js +30 -28
  40. package/WaitSpinner.js +6 -11
  41. package/cypress/support/commands.ts +14 -4
  42. package/cypress/support/index.d.ts +1 -1
  43. package/package.json +5 -5
  44. package/stubs-splunkui.d.ts +0 -4
  45. package/types/src/Card/Card.d.ts +3 -1
  46. package/types/src/Card/Header.d.ts +2 -0
  47. package/types/src/Card/docs/examples/HeadingTitle.d.ts +3 -0
  48. package/types/src/Clickable/Clickable.d.ts +11 -3
  49. package/types/src/Link/Link.d.ts +4 -0
  50. package/types/src/Message/Message.d.ts +1 -1
  51. package/types/src/MessageBar/MessageBar.d.ts +1 -1
  52. package/types/src/Multiselect/Multiselect.d.ts +1 -8
  53. package/types/src/Multiselect/Normal.d.ts +1 -7
  54. package/types/src/Multiselect/docs/examples/Children.d.ts +2 -9
  55. package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -9
  56. package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -9
  57. package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -9
  58. package/types/src/Multiselect/docs/examples/Error.d.ts +2 -9
  59. package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -22
  60. package/types/src/Multiselect/docs/examples/Headings.d.ts +2 -1
  61. package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -25
  62. package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -9
  63. package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -9
  64. package/types/src/ResultsMenu/ResultsMenu.d.ts +23 -34
  65. package/types/src/Select/SelectBase.d.ts +2 -2
  66. package/types/src/TabBar/TabBar.d.ts +8 -5
  67. package/types/src/TabBar/TabBarContext.d.ts +1 -1
  68. package/types/src/TabLayout/TabLayout.d.ts +8 -5
  69. package/types/src/Typography/Typography.d.ts +27 -22
  70. package/types/src/Date/Icon.d.ts +0 -3
  71. package/types/src/TabBar/docs/examples/IconsAbove.d.ts +0 -3
  72. package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +0 -3
  73. /package/types/src/TabBar/docs/examples/{IconsLeft.d.ts → Icons.d.ts} +0 -0
  74. /package/types/src/TabBar/docs/examples/{VerticalIconsLeft.d.ts → VerticalIcons.d.ts} +0 -0
package/StepBar.js CHANGED
@@ -96,9 +96,9 @@
96
96
  var h = c().li.withConfig({
97
97
  displayName: "StepStyles__Styled",
98
98
  componentId: "sc-756fxp-1"
99
- })([ "display:grid;gap:", ";grid-template-rows:auto 1fr;justify-items:center;min-width:min-content;position:relative;overflow:hidden;", ";text-align:center;color:", ";counter-increment:", ";&:not(:first-of-type){", "{&::before{box-shadow:inset 500px 0 ", ";width:calc(50% - ", ");}}}&:not(:last-of-type){", "{&::after{width:50%;position:absolute;top:0;box-shadow:inset 500px 0 ", ";left:calc(50% + ", ");}}}" ], v.variables.spacingXSmall, v.mixins.typography("body", {
99
+ })([ "", ";display:grid;gap:", ";grid-template-rows:auto 1fr;justify-items:center;min-width:min-content;position:relative;overflow:hidden;text-align:center;color:", ";counter-increment:", ";&:not(:first-of-type){", "{&::before{box-shadow:inset 500px 0 ", ";width:calc(50% - ", ");}}}&:not(:last-of-type){", "{&::after{width:50%;position:absolute;top:0;box-shadow:inset 500px 0 ", ";left:calc(50% + ", ");}}}" ], v.mixins.typography("body", {
100
100
  weight: "semiBold"
101
- }), (0, v.pickVariant)("$status", {
101
+ }), v.variables.spacingXSmall, (0, v.pickVariant)("$status", {
102
102
  error: v.variables.contentColorActive,
103
103
  active: v.variables.contentColorAccent,
104
104
  next: v.variables.contentColorDefault,
package/Switch.js CHANGED
@@ -68,9 +68,9 @@
68
68
  var o = e.n(a);
69
69
  // CONCATENATED MODULE: external "prop-types"
70
70
  const l = require("prop-types");
71
- var t = e.n(l);
71
+ var i = e.n(l);
72
72
  // CONCATENATED MODULE: external "@splunk/react-ui/AnimationToggle"
73
- const i = require("@splunk/react-ui/AnimationToggle");
73
+ const t = require("@splunk/react-ui/AnimationToggle");
74
74
  // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
75
75
  const n = require("@splunk/react-ui/ScreenReaderContent");
76
76
  var c = e.n(n);
@@ -84,9 +84,9 @@
84
84
  var v = e.n(b);
85
85
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
86
86
  const f = require("@splunk/react-ui/Clickable");
87
- var p = e.n(f);
87
+ var g = e.n(f);
88
88
  // CONCATENATED MODULE: external "@splunk/themes"
89
- const g = require("@splunk/themes");
89
+ const p = require("@splunk/themes");
90
90
  // CONCATENATED MODULE: external "@splunk/react-icons/CheckBoxCompleted"
91
91
  const h = require("@splunk/react-icons/CheckBoxCompleted");
92
92
  var m = e.n(h);
@@ -96,35 +96,36 @@
96
96
  // CONCATENATED MODULE: ./src/Switch/SwitchStyles.ts
97
97
  var C = "20px";
98
98
  var w = "12px";
99
- var S = "2px";
100
- var x = u()(v()).withConfig({
99
+ var S = "4px";
100
+ // diameter - toggleIndicatorDiameter / 2
101
+ var x = u()(v()).withConfig({
101
102
  displayName: "SwitchStyles__StyledBox",
102
103
  componentId: "sc-844ieu-0"
103
- })([ "display:inline;position:relative;flex-shrink:0;gap:", ";min-height:", ";align-items:center;color:", ";", "" ], g.variables.spacingSmall, g.variables.inputHeight, g.variables.contentColorActive, (function(e) {
104
+ })([ "display:inline;position:relative;flex-shrink:0;gap:", ";min-height:", ";align-items:center;color:", ";", "" ], p.variables.spacingSmall, p.variables.inputHeight, p.variables.contentColorActive, (function(e) {
104
105
  var r = e.$disabled;
105
- return r && (0, d.css)([ "color:", ";" ], g.variables.contentColorDisabled);
106
+ return r && (0, d.css)([ "color:", ";" ], p.variables.contentColorDisabled);
106
107
  }));
107
- var B = (0, d.css)([ "", " position:relative;width:", ";height:", ";line-height:", ";border-radius:", ";border:", " solid ", ";background-color:", ";cursor:pointer;flex:0 0 auto;&:not([disabled]){&:focus{box-shadow:", ";}color:", ";", "}&[disabled]{border-color:", ";background-color:", ";color:", ";cursor:not-allowed;", ";}" ], g.mixins.reset("inline"), C, C, C, g.variables.borderRadius, g.variables.inputBorderWidth, g.variables.interactiveColorBorder, g.variables.interactiveColorBackground, g.variables.focusShadow, (0,
108
- g.pick)({
109
- light: g.variables.white,
110
- dark: g.variables.black
108
+ var B = (0, d.css)([ "", " position:relative;width:", ";height:", ";line-height:", ";border-radius:", ";border:", " solid ", ";background-color:", ";cursor:pointer;flex:0 0 auto;&:not([disabled]){&:focus{box-shadow:", ";}color:", ";", "}&[disabled]{border-color:", ";background-color:", ";color:", ";cursor:not-allowed;", ";}" ], p.mixins.reset("inline"), C, C, C, p.variables.borderRadius, p.variables.inputBorderWidth, p.variables.interactiveColorBorder, p.variables.interactiveColorBackground, p.variables.focusShadow, (0,
109
+ p.pick)({
110
+ light: p.variables.white,
111
+ dark: p.variables.black
111
112
  }), (function(e) {
112
113
  var r = e.$error, a = e.$selected;
113
114
  if (a && !r) {
114
- return (0, d.css)([ "background-color:", ";border:none;" ], g.variables.interactiveColorAccent);
115
+ return (0, d.css)([ "background-color:", ";border:none;" ], p.variables.interactiveColorAccent);
115
116
  }
116
117
  if (!a && r) {
117
- return (0, d.css)([ "border-color:", ";&:hover{border-color:", ";background-color:", ";}" ], g.variables.interactiveColorAccentError, g.mixins.overlayColors(g.variables.interactiveColorAccentError, g.variables.interactiveColorBorderHover), g.mixins.overlayColors(g.variables.interactiveColorBackground, g.variables.interactiveColorOverlayHover));
118
+ return (0, d.css)([ "border-color:", ";&:hover{border-color:", ";background-color:", ";}" ], p.variables.interactiveColorAccentError, p.mixins.overlayColors(p.variables.interactiveColorAccentError, p.variables.interactiveColorBorderHover), p.mixins.overlayColors(p.variables.interactiveColorBackground, p.variables.interactiveColorOverlayHover));
118
119
  }
119
120
  if (a && r) {
120
- return (0, d.css)([ "background-color:", ";border:none;" ], g.variables.interactiveColorAccentError);
121
+ return (0, d.css)([ "background-color:", ";border:none;" ], p.variables.interactiveColorAccentError);
121
122
  }
122
- return (0, d.css)([ "&:hover{border-color:", ";background-color:", ";}" ], g.variables.interactiveColorBorderHover, g.mixins.overlayColors(g.variables.interactiveColorBackground, g.variables.interactiveColorOverlayHover));
123
- }), g.variables.interactiveColorBorderDisabled, g.variables.interactiveColorBackgroundDisabled, g.variables.contentColorDisabled, (function(e) {
123
+ return (0, d.css)([ "&:hover{border-color:", ";background-color:", ";}" ], p.variables.interactiveColorBorderHover, p.mixins.overlayColors(p.variables.interactiveColorBackground, p.variables.interactiveColorOverlayHover));
124
+ }), p.variables.interactiveColorBorderDisabled, p.variables.interactiveColorBackgroundDisabled, p.variables.contentColorDisabled, (function(e) {
124
125
  var r = e.$selected;
125
- return r && (0, d.css)([ "border:none;background-color:", ";" ], g.variables.neutral100);
126
+ return r && (0, d.css)([ "border:none;background-color:", ";" ], p.variables.neutral100);
126
127
  }));
127
- var O = u()(p()).withConfig({
128
+ var O = u()(g()).withConfig({
128
129
  displayName: "SwitchStyles__StyledCheckboxClickable",
129
130
  componentId: "sc-844ieu-1"
130
131
  })([ "", "" ], B);
@@ -140,46 +141,46 @@
140
141
  var q = u().div.withConfig({
141
142
  displayName: "SwitchStyles__StyledToggleIndicator",
142
143
  componentId: "sc-844ieu-4"
143
- })([ "background-color:", ";border-radius:50%;box-sizing:border-box;width:", ";height:", ";position:absolute;left:", ";top:", ";", ";", " ", " ", ";" ], (0,
144
- g.pick)({
145
- light: g.variables.black,
146
- dark: g.variables.white
147
- }), w, w, S, S, (function(e) {
144
+ })([ "--toggle-indicator-margin:calc(", " - ", ");background-color:", ";border-radius:50%;box-sizing:border-box;width:", ";height:", ";position:absolute;left:var(--toggle-indicator-margin);top:var(--toggle-indicator-margin);", ";", " ", " ", ";" ], S, p.variables.inputBorderWidth, (0,
145
+ p.pick)({
146
+ light: p.variables.black,
147
+ dark: p.variables.white
148
+ }), w, w, (function(e) {
148
149
  var r = e.$delay;
149
150
  return r && (0, d.css)([ "transition:left ", ";" ], r);
150
- }), (0, g.pick)({
151
- prisma: (0, d.css)([ "box-shadow:", ";" ], g.variables.embossShadow)
151
+ }), (0, p.pick)({
152
+ prisma: (0, d.css)([ "box-shadow:", ";" ], p.variables.embossShadow)
152
153
  }), (function(e) {
153
154
  var r = e.$selected, a = e.$disabled;
154
- return (0, d.css)([ "", " ", "" ], r && (0, d.css)([ "left:calc(100% - (", " + ", " * 2));" ], w, S), !a && r && (0,
155
- d.css)([ "left:calc(100% - (", " + ", "));background-color:", ";" ], w, S, (0, g.pick)({
156
- light: g.variables.white,
157
- dark: g.variables.black
155
+ return (0, d.css)([ "", " ", "" ], r && (0, d.css)([ "left:calc(100% - (", " + var(--toggle-indicator-margin)));" ], w), !a && r && (0,
156
+ d.css)([ "background-color:", ";" ], (0, p.pick)({
157
+ light: p.variables.white,
158
+ dark: p.variables.black
158
159
  })));
159
160
  }), (function(e) {
160
161
  var r = e.$disabled;
161
- return r && (0, d.css)([ "background-color:", ";" ], g.variables.neutral400);
162
+ return r && (0, d.css)([ "background-color:", ";" ], p.variables.neutral400);
162
163
  }));
163
- var I = (0, d.css)([ "position:relative;width:calc(", " * 2);height:", ";background-color:", ";transition:background-color ", ";flex:0 0 auto;border-radius:calc(", " / 2);border:", " solid ", ";&:not([disabled]){&:focus{box-shadow:", ";}", "}&[disabled]{border:", " solid ", ";background-color:", ";", "}" ], C, C, g.variables.interactiveColorBackground, (function(e) {
164
+ var I = (0, d.css)([ "position:relative;width:calc(", " * 2);height:", ";background-color:", ";transition:background-color ", ";flex:0 0 auto;border-radius:calc(", " / 2);border:", " solid ", ";&:not([disabled]){&:focus{box-shadow:", ";}", "}&[disabled]{border:", " solid ", ";background-color:", ";", "}" ], C, C, p.variables.interactiveColorBackground, (function(e) {
164
165
  return e.$delay;
165
- }), C, g.variables.inputBorderWidth, g.variables.interactiveColorBorder, g.variables.focusShadow, (function(e) {
166
+ }), C, p.variables.inputBorderWidth, p.variables.interactiveColorBorder, p.variables.focusShadow, (function(e) {
166
167
  var r = e.$selected;
167
168
  if (!r) {
168
- return (0, d.css)([ "&:hover{border-color:", ";background-color:", ";}" ], g.variables.interactiveColorBorderHover, g.mixins.overlayColors(g.variables.interactiveColorBackground, g.variables.interactiveColorOverlayHover));
169
+ return (0, d.css)([ "&:hover{border-color:", ";background-color:", ";}" ], p.variables.interactiveColorBorderHover, p.mixins.overlayColors(p.variables.interactiveColorBackground, p.variables.interactiveColorOverlayHover));
169
170
  }
170
- return (0, d.css)([ "border-color:transparent;background-color:", ";" ], g.variables.interactiveColorAccent);
171
- }), g.variables.inputBorderWidth, g.variables.interactiveColorBorderDisabled, g.variables.interactiveColorBackgroundDisabled, (function(e) {
171
+ return (0, d.css)([ "border-color:transparent;background-color:", ";" ], p.variables.interactiveColorAccent);
172
+ }), p.variables.inputBorderWidth, p.variables.interactiveColorBorderDisabled, p.variables.interactiveColorBackgroundDisabled, (function(e) {
172
173
  var r = e.$selected;
173
- return r && (0, d.css)([ "background-color:", ";" ], g.variables.neutral100);
174
+ return r && (0, d.css)([ "background-color:", ";" ], p.variables.neutral100);
174
175
  }));
175
- var j = u()(p()).withConfig({
176
+ var j = u()(g()).withConfig({
176
177
  displayName: "SwitchStyles__StyledToggleClickable",
177
178
  componentId: "sc-844ieu-5"
178
179
  })([ "", "" ], I);
179
180
  var D = u().label.withConfig({
180
181
  displayName: "SwitchStyles__StyledLabel",
181
182
  componentId: "sc-844ieu-6"
182
- })([ "", " flex:1 1 auto;color:inherit;line-height:", ";", ";" ], g.mixins.reset("inline-block"), g.variables.lineHeight, (function(e) {
183
+ })([ "", " flex:1 1 auto;color:inherit;line-height:", ";", ";" ], p.mixins.reset("inline-block"), p.variables.lineHeight, (function(e) {
183
184
  var r = e.$disabled;
184
185
  return !r && (0, d.css)([ "cursor:pointer;" ]);
185
186
  }));
@@ -218,9 +219,9 @@
218
219
  if (null == e) return {};
219
220
  var a, o, l = A(e, r);
220
221
  if (Object.getOwnPropertySymbols) {
221
- var t = Object.getOwnPropertySymbols(e);
222
- for (o = 0; o < t.length; o++) {
223
- a = t[o], r.includes(a) || {}.propertyIsEnumerable.call(e, a) && (l[a] = e[a]);
222
+ var i = Object.getOwnPropertySymbols(e);
223
+ for (o = 0; o < i.length; o++) {
224
+ a = i[o], r.includes(a) || {}.propertyIsEnumerable.call(e, a) && (l[a] = e[a]);
224
225
  }
225
226
  }
226
227
  return l;
@@ -238,28 +239,28 @@
238
239
  }
239
240
  /** @public */
240
241
  /** @public */ var H = {
241
- appearance: t().oneOf([ "checkbox", "toggle" ]),
242
- children: t().node,
243
- disabled: t().bool,
244
- elementRef: t().oneOfType([ t().func, t().object ]),
245
- error: t().bool,
246
- id: t().string,
247
- inline: t().bool,
248
- labelledBy: t().string,
249
- onClick: t().func,
242
+ appearance: i().oneOf([ "checkbox", "toggle" ]),
243
+ children: i().node,
244
+ disabled: i().bool,
245
+ elementRef: i().oneOfType([ i().func, i().object ]),
246
+ error: i().bool,
247
+ id: i().string,
248
+ inline: i().bool,
249
+ labelledBy: i().string,
250
+ onClick: i().func,
250
251
  /** @private. */
251
- required: t().bool,
252
- selected: t().oneOf([ true, false, "some" ]),
253
- selectedLabel: t().string,
254
- toggleRef: t().oneOfType([ t().func, t().object ]),
255
- someSelectedLabel: t().string,
256
- unselectedLabel: t().string,
257
- value: t().any
252
+ required: i().bool,
253
+ selected: i().oneOf([ true, false, "some" ]),
254
+ selectedLabel: i().string,
255
+ toggleRef: i().oneOfType([ i().func, i().object ]),
256
+ someSelectedLabel: i().string,
257
+ unselectedLabel: i().string,
258
+ value: i().any
258
259
  };
259
260
  var P = function e(r) {
260
- var a = r.disabled, l = r.selected, t = T(r, [ "disabled", "selected" ]);
261
+ var a = r.disabled, l = r.selected, i = T(r, [ "disabled", "selected" ]);
261
262
  var n = a === true ? "disabled" : undefined;
262
- var c = (0, i.useAnimationToggle)();
263
+ var c = (0, t.useAnimationToggle)();
263
264
  var s = c === "on" ? "200ms" : undefined;
264
265
  var d = o().createElement(q, {
265
266
  $delay: s,
@@ -272,10 +273,10 @@
272
273
  $delay: s,
273
274
  disabled: n,
274
275
  $selected: l || false
275
- }, t), d);
276
+ }, i), d);
276
277
  };
277
278
  var N = function e(r) {
278
- var a = r.appearance, l = r.disabled, t = r.error, i = r.role, n = r.selected, c = T(r, [ "appearance", "disabled", "error", "role", "selected" ]);
279
+ var a = r.appearance, l = r.disabled, i = r.error, t = r.role, n = r.selected, c = T(r, [ "appearance", "disabled", "error", "role", "selected" ]);
279
280
  /* Setting viewbox to rescale the icons to appear larger. Cannot directly adjust svg
280
281
  * width and height without the svg being larger than the checkbox and box-model.
281
282
  */ var s = "4 4 16 16";
@@ -287,39 +288,39 @@
287
288
  var u = l === true ? "disabled" : undefined;
288
289
 
289
290
  return o().createElement(O, R({
290
- as: i === "presentation" ? "div" : undefined,
291
- role: i || a,
291
+ as: t === "presentation" ? "div" : undefined,
292
+ role: t || a,
292
293
  disabled: u,
293
- $error: t || false,
294
+ $error: i || false,
294
295
  $selected: n === "some" || n || false
295
296
  }, {
296
- inert: i === "presentation" ? "true" : undefined
297
+ inert: t === "presentation" ? "true" : undefined
297
298
  }, c), d);
298
299
  };
299
300
  /**
300
301
  * `Switch` is a basic form control with an on/off state.
301
302
  */ function M(e) {
302
- var r = e.appearance, l = r === void 0 ? "checkbox" : r, t = e.children, i = e.disabled, n = e.elementRef, d = e.error, u = e.id, b = e.inline, v = e.labelledBy, f = e.onClick, p = e.required, g = e.selected, h = e.selectedLabel, m = e.someSelectedLabel, k = e.toggleRef, y = e.unselectedLabel, C = e.value, w = T(e, [ "appearance", "children", "disabled", "elementRef", "error", "id", "inline", "labelledBy", "onClick", "required", "selected", "selectedLabel", "someSelectedLabel", "toggleRef", "unselectedLabel", "value" ]);
303
+ var r = e.appearance, l = r === void 0 ? "checkbox" : r, i = e.children, t = e.disabled, n = e.elementRef, d = e.error, u = e.id, b = e.inline, v = e.labelledBy, f = e.onClick, g = e.required, p = e.selected, h = e.selectedLabel, m = e.someSelectedLabel, k = e.toggleRef, y = e.unselectedLabel, C = e.value, w = T(e, [ "appearance", "children", "disabled", "elementRef", "error", "id", "inline", "labelledBy", "onClick", "required", "selected", "selectedLabel", "someSelectedLabel", "toggleRef", "unselectedLabel", "value" ]);
303
304
  // @docs-props-type SwitchPropsBase
304
305
  /* If has internal label defined with children, must have an id and must use generated labelId.
305
306
  * Otherwise, use customer defined id and external label.
306
- */ var S = t && u == null ? (0, s.createDOMID)("clickable") : u;
307
- var B = t ? (0, s.createDOMID)("label") : v;
307
+ */ var S = i && u == null ? (0, s.createDOMID)("clickable") : u;
308
+ var B = i ? (0, s.createDOMID)("label") : v;
308
309
  (0, a.useEffect)((function() {
309
310
  if (false) {}
310
311
  if (false) {}
311
- }), [ g, l, d ]);
312
+ }), [ p, l, d ]);
312
313
  var O = (0, a.useCallback)((function(e) {
313
314
  f === null || f === void 0 ? void 0 : f(e, {
314
315
  value: C,
315
316
  // @ts-expect-error - safe due to individual prop interfaces
316
- selected: g
317
+ selected: p
317
318
  });
318
- }), [ f, C, g ]);
319
+ }), [ f, C, p ]);
319
320
  var $ = (0, a.useCallback)((function(e) {
320
321
  L(k, e);
321
322
  }), [ k ]);
322
- var _ = g === "some" ? "mixed" : g;
323
+ var _ = p === "some" ? "mixed" : p;
323
324
  var E = {
324
325
  true: h,
325
326
  false: y,
@@ -327,15 +328,15 @@
327
328
  };
328
329
  var q = {
329
330
  id: S,
330
- onClick: i || O,
331
+ onClick: t || O,
331
332
  elementRef: $,
332
333
  "aria-labelledby": B,
333
334
  "aria-checked": _,
334
335
  "aria-invalid": d ? true : undefined,
335
- "aria-required": p,
336
+ "aria-required": g,
336
337
  // TODO(SUI-7658): Hopefully handled cleaner when Checkbox is removed out of Switch and NonInteractiveCheckbox uptakes that. For now intentionally not spread like others and access directly from otherProps to stress not specific to Switch but base HTML element props.
337
338
  "data-test": w.role === "presentation" ? "presentation-toggle" : "toggle",
338
- "data-selected": g,
339
+ "data-selected": p,
339
340
  // TODO(SUI-7658): Hopefully handled cleaner when Checkbox is removed out of Switch and NonInteractiveCheckbox uptakes that. For now intentionally not spread like others and access directly from otherProps to stress not specific to Switch but base HTML element props.
340
341
  role: w.role,
341
342
  tabIndex: w.tabIndex
@@ -346,28 +347,28 @@
346
347
  flex: true,
347
348
  inline: b,
348
349
  "data-test": "switch",
349
- "data-test-selected": g,
350
+ "data-test-selected": p,
350
351
  "data-test-value": C,
351
352
  "data-test-error": d ? true : undefined,
352
353
  "data-error": d ? true : undefined,
353
- "data-disabled": i ? true : undefined,
354
+ "data-test-disabled": t ? "disabled" : undefined,
354
355
  elementRef: n,
355
- $disabled: i || false
356
+ $disabled: t || false
356
357
  }, w), l === "toggle" ? o().createElement(P, R({
357
- disabled: i || false,
358
- selected: !!g
358
+ disabled: t || false,
359
+ selected: !!p
359
360
  }, q)) : o().createElement(N, R({
360
361
  appearance: "checkbox",
361
362
  error: d || false,
362
- disabled: i || false,
363
- selected: g
364
- }, q)), I && o().createElement(c(), null, E["".concat(g)]), t && o().createElement(D, {
365
- $disabled: i || false,
363
+ disabled: t || false,
364
+ selected: p
365
+ }, q)), I && o().createElement(c(), null, E["".concat(p)]), i && o().createElement(D, {
366
+ $disabled: t || false,
366
367
  "data-test": "label",
367
368
  id: B,
368
369
  htmlFor: S,
369
- "data-disabled": i || null
370
- }, t));
370
+ "data-disabled": t || null
371
+ }, i));
371
372
  }
372
373
  M.propTypes = H;
373
374
  /* harmony default export */ const W = M;