@hitachivantara/uikit-react-core 5.87.0 → 5.87.2

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 (38) hide show
  1. package/dist/cjs/BaseRadio/BaseRadio.styles.cjs +7 -6
  2. package/dist/cjs/BulkActions/BulkActions.cjs +9 -18
  3. package/dist/cjs/CheckBoxGroup/CheckBoxGroup.cjs +9 -9
  4. package/dist/cjs/FilterGroup/RightPanel/RightPanel.cjs +11 -12
  5. package/dist/cjs/Radio/Radio.cjs +2 -1
  6. package/dist/cjs/Radio/Radio.styles.cjs +7 -27
  7. package/dist/cjs/Table/TableCell/TableCell.styles.cjs +14 -14
  8. package/dist/cjs/Table/TableHeader/TableHeader.styles.cjs +16 -15
  9. package/dist/cjs/utils/CounterLabel.cjs +15 -0
  10. package/dist/esm/BaseRadio/BaseRadio.styles.js +7 -6
  11. package/dist/esm/BaseRadio/BaseRadio.styles.js.map +1 -1
  12. package/dist/esm/BulkActions/BulkActions.js +10 -19
  13. package/dist/esm/BulkActions/BulkActions.js.map +1 -1
  14. package/dist/esm/CheckBox/CheckBox.js.map +1 -1
  15. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js +10 -10
  16. package/dist/esm/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
  17. package/dist/esm/Dialog/Dialog.js.map +1 -1
  18. package/dist/esm/FilterGroup/RightPanel/RightPanel.js +11 -12
  19. package/dist/esm/FilterGroup/RightPanel/RightPanel.js.map +1 -1
  20. package/dist/esm/Radio/Radio.js +2 -1
  21. package/dist/esm/Radio/Radio.js.map +1 -1
  22. package/dist/esm/Radio/Radio.styles.js +7 -27
  23. package/dist/esm/Radio/Radio.styles.js.map +1 -1
  24. package/dist/esm/RadioGroup/RadioGroup.js.map +1 -1
  25. package/dist/esm/Snackbar/Snackbar.js.map +1 -1
  26. package/dist/esm/SnackbarProvider/SnackbarProvider.js.map +1 -1
  27. package/dist/esm/Switch/Switch.js.map +1 -1
  28. package/dist/esm/Table/TableCell/TableCell.styles.js +14 -14
  29. package/dist/esm/Table/TableCell/TableCell.styles.js.map +1 -1
  30. package/dist/esm/Table/TableHeader/TableHeader.styles.js +16 -15
  31. package/dist/esm/Table/TableHeader/TableHeader.styles.js.map +1 -1
  32. package/dist/esm/Tag/Tag.js.map +1 -1
  33. package/dist/esm/ToggleButton/ToggleButton.js.map +1 -1
  34. package/dist/esm/TreeView/TreeView.js.map +1 -1
  35. package/dist/esm/utils/CounterLabel.js +15 -0
  36. package/dist/esm/utils/CounterLabel.js.map +1 -0
  37. package/dist/types/index.d.ts +23 -14
  38. package/package.json +6 -6
@@ -18,7 +18,8 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseRadio
18
18
  width: 16,
19
19
  height: 16,
20
20
  borderRadius: uikitStyles.theme.radii.circle,
21
- border: `1px solid ${uikitStyles.theme.colors.secondary}`,
21
+ borderWidth: 1,
22
+ borderColor: uikitStyles.theme.colors.secondary,
22
23
  backgroundColor: uikitStyles.theme.colors.atmo1
23
24
  },
24
25
  borderRadius: 0
@@ -27,7 +28,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseRadio
27
28
  cursor: "not-allowed",
28
29
  pointerEvents: "initial",
29
30
  "& svg": {
30
- border: `1px solid ${uikitStyles.theme.colors.secondary_60}`,
31
+ borderColor: uikitStyles.theme.colors.secondary_60,
31
32
  backgroundColor: uikitStyles.theme.colors.atmo3
32
33
  }
33
34
  },
@@ -40,20 +41,20 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseRadio
40
41
  icon: {},
41
42
  checked: {
42
43
  "& svg": {
43
- border: `1px solid ${uikitStyles.theme.colors.secondary}`,
44
+ borderColor: uikitStyles.theme.colors.secondary,
44
45
  backgroundColor: uikitStyles.theme.colors.secondary,
45
46
  color: uikitStyles.theme.colors.atmo2
46
47
  },
47
48
  "&$semantic": {
48
49
  "& svg": {
49
- border: `1px solid ${uikitStyles.theme.colors.base_dark}`,
50
+ borderColor: uikitStyles.theme.colors.base_dark,
50
51
  backgroundColor: uikitStyles.theme.colors.base_light,
51
52
  color: uikitStyles.theme.colors.base_dark
52
53
  }
53
54
  },
54
55
  "&$disabled": {
55
56
  "& svg": {
56
- border: `1px solid ${uikitStyles.theme.colors.secondary_60}`,
57
+ borderColor: uikitStyles.theme.colors.secondary_60,
57
58
  backgroundColor: uikitStyles.theme.colors.secondary_60,
58
59
  color: uikitStyles.theme.colors.atmo3
59
60
  }
@@ -61,7 +62,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvBaseRadio
61
62
  },
62
63
  semantic: {
63
64
  "& svg": {
64
- border: `1px solid ${uikitStyles.theme.colors.base_dark}`,
65
+ borderColor: uikitStyles.theme.colors.base_dark,
65
66
  backgroundColor: uikitStyles.theme.colors.base_light
66
67
  }
67
68
  }
@@ -3,10 +3,10 @@ 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 CounterLabel = require("../utils/CounterLabel.cjs");
6
7
  const setId = require("../utils/setId.cjs");
7
8
  const BulkActions_styles = require("./BulkActions.styles.cjs");
8
9
  const Button = require("../Button/Button.cjs");
9
- const Typography = require("../Typography/Typography.cjs");
10
10
  const CheckBox = require("../CheckBox/CheckBox.cjs");
11
11
  const ActionsGeneric = require("../ActionsGeneric/ActionsGeneric.cjs");
12
12
  const HvBulkActions = React.forwardRef(function HvBulkActions2(props, ref) {
@@ -21,7 +21,6 @@ const HvBulkActions = React.forwardRef(function HvBulkActions2(props, ref) {
21
21
  actions,
22
22
  numTotal = 0,
23
23
  numSelected = 0,
24
- selectAllLabel = "All",
25
24
  selectAllConjunctionLabel = "/",
26
25
  showSelectAllPages = false,
27
26
  semantic = true,
@@ -36,21 +35,6 @@ const HvBulkActions = React.forwardRef(function HvBulkActions2(props, ref) {
36
35
  const { activeTheme } = uikitReactUtils.useTheme();
37
36
  const anySelected = numSelected > 0;
38
37
  const isSemantic = semantic && anySelected;
39
- const selectAllLabelComponent = /* @__PURE__ */ jsxRuntime.jsx(
40
- Typography.HvTypography,
41
- {
42
- component: "span",
43
- disabled: checkboxProps?.disabled,
44
- variant: "body",
45
- children: !anySelected ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
46
- /* @__PURE__ */ jsxRuntime.jsx(Typography.HvTypography, { variant: "label", children: selectAllLabel }),
47
- ` (${numTotal})`
48
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
49
- /* @__PURE__ */ jsxRuntime.jsx(Typography.HvTypography, { variant: "label", children: numSelected }),
50
- ` ${selectAllConjunctionLabel} ${numTotal}`
51
- ] })
52
- }
53
- );
54
38
  return /* @__PURE__ */ jsxRuntime.jsxs(
55
39
  "div",
56
40
  {
@@ -73,7 +57,14 @@ const HvBulkActions = React.forwardRef(function HvBulkActions2(props, ref) {
73
57
  semantic: isSemantic,
74
58
  onChange: onSelectAll,
75
59
  indeterminate: numSelected > 0 && numSelected < numTotal,
76
- label: selectAllLabelComponent,
60
+ label: /* @__PURE__ */ jsxRuntime.jsx(
61
+ CounterLabel.CounterLabel,
62
+ {
63
+ selected: numSelected,
64
+ total: numTotal,
65
+ conjunctionLabel: selectAllConjunctionLabel
66
+ }
67
+ ),
77
68
  ...checkboxProps
78
69
  }
79
70
  ),
@@ -5,6 +5,7 @@ const React = require("react");
5
5
  const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
6
6
  const useControlled = require("../hooks/useControlled.cjs");
7
7
  const useUniqueId = require("../hooks/useUniqueId.cjs");
8
+ const CounterLabel = require("../utils/CounterLabel.cjs");
8
9
  const multiSelectionEventHandler = require("../utils/multiSelectionEventHandler.cjs");
9
10
  const setId = require("../utils/setId.cjs");
10
11
  const CheckBoxGroup_styles = require("./CheckBoxGroup.styles.cjs");
@@ -49,7 +50,6 @@ const HvCheckBoxGroup = React.forwardRef(
49
50
  disabled,
50
51
  showSelectAll,
51
52
  orientation = "vertical",
52
- selectAllLabel = "All",
53
53
  selectAllConjunctionLabel = "/",
54
54
  "aria-label": ariaLabel,
55
55
  "aria-labelledby": ariaLabelledBy,
@@ -166,13 +166,6 @@ const HvCheckBoxGroup = React.forwardRef(
166
166
  return newValue;
167
167
  });
168
168
  };
169
- const selectAllLabelComponent = selectedCount === 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
170
- /* @__PURE__ */ jsxRuntime.jsx("b", { children: selectAllLabel }),
171
- ` (${React.Children.toArray(children).length})`
172
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
173
- /* @__PURE__ */ jsxRuntime.jsx("b", { children: selectedCount }),
174
- ` ${selectAllConjunctionLabel} ${React.Children.toArray(children).length}`
175
- ] });
176
169
  const canShowError = ariaErrorMessage == null && (status !== void 0 && statusMessage !== void 0 || status === void 0 && required);
177
170
  const errorMessageId = canShowError ? setId.setId(elementId, "error") : ariaErrorMessage;
178
171
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -219,7 +212,14 @@ const HvCheckBoxGroup = React.forwardRef(
219
212
  {
220
213
  checked: selectAllState === "all",
221
214
  indeterminate: selectAllState === "some",
222
- label: selectAllLabelComponent,
215
+ label: /* @__PURE__ */ jsxRuntime.jsx(
216
+ CounterLabel.CounterLabel,
217
+ {
218
+ selected: selectedCount,
219
+ total: React.Children.count(children),
220
+ conjunctionLabel: selectAllConjunctionLabel
221
+ }
222
+ ),
223
223
  disabled,
224
224
  readOnly,
225
225
  className: classes.selectAll,
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
+ const CounterLabel = require("../../utils/CounterLabel.cjs");
5
6
  const setId = require("../../utils/setId.cjs");
6
7
  const FilterGroupContext = require("../FilterGroupContext.cjs");
7
8
  const RightPanel_styles = require("./RightPanel.styles.cjs");
8
- const Typography = require("../../Typography/Typography.cjs");
9
9
  const CheckBox = require("../../CheckBox/CheckBox.cjs");
10
10
  const Panel = require("../../Panel/Panel.cjs");
11
11
  const Input = require("../../Input/Input.cjs");
@@ -32,8 +32,8 @@ const HvFilterGroupRightPanel = ({
32
32
  (option) => option.name.toLowerCase().includes(searchStr.toLowerCase())
33
33
  );
34
34
  return {
35
- all: filteredOptions.map((option) => option.id) || [],
36
- enabled: filteredOptions.filter((option) => !option.disabled).map((option) => option.id) || []
35
+ all: filteredOptions?.map((option) => option.id) || [],
36
+ enabled: filteredOptions?.filter((option) => !option.disabled)?.map((option) => option.id) || []
37
37
  };
38
38
  }, [filterOptions, activeGroup, searchStr]);
39
39
  const activeFilterValues = React.useMemo(
@@ -95,19 +95,18 @@ const HvFilterGroupRightPanel = ({
95
95
  searchStr
96
96
  ]);
97
97
  const SelectAll = React.useCallback(() => {
98
- const nbrSelected = activeFilterValues?.length;
99
- const defaultLabel = /* @__PURE__ */ jsxRuntime.jsx(Typography.HvTypography, { component: "span", children: nbrSelected > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
100
- /* @__PURE__ */ jsxRuntime.jsx("b", { children: nbrSelected }),
101
- ` ${labels?.multiSelectionConjunction} ${allActiveGroupOptions.length}`
102
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
103
- /* @__PURE__ */ jsxRuntime.jsx("b", { children: labels?.selectAll }),
104
- ` (${allActiveGroupOptions.length})`
105
- ] }) });
106
98
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.selectAllContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
107
99
  CheckBox.HvCheckBox,
108
100
  {
109
101
  id: setId.setId(id, "select-all"),
110
- label: defaultLabel,
102
+ label: /* @__PURE__ */ jsxRuntime.jsx(
103
+ CounterLabel.CounterLabel,
104
+ {
105
+ selected: activeFilterValues?.length,
106
+ total: allActiveGroupOptions.length,
107
+ conjunctionLabel: labels?.multiSelectionConjunction
108
+ }
109
+ ),
111
110
  onChange: () => handleSelectAll(),
112
111
  className: classes.selectAll,
113
112
  indeterminate: anySelected && !allSelected,
@@ -126,6 +126,7 @@ const HvRadio = React.forwardRef(
126
126
  /* @__PURE__ */ jsxRuntime.jsx(
127
127
  Label.HvLabel,
128
128
  {
129
+ noWrap: true,
129
130
  id: setId.setId(elementId, "label"),
130
131
  htmlFor: setId.setId(elementId, "input"),
131
132
  label,
@@ -136,7 +137,7 @@ const HvRadio = React.forwardRef(
136
137
  ]
137
138
  }
138
139
  ) : radio,
139
- canShowError && /* @__PURE__ */ jsxRuntime.jsx(WarningText.HvWarningText, { id: setId.setId(elementId, "error"), disableBorder: true, children: statusMessage })
140
+ canShowError && /* @__PURE__ */ jsxRuntime.jsx(WarningText.HvWarningText, { id: setId.setId(elementId, "error"), children: statusMessage })
140
141
  ]
141
142
  }
142
143
  );
@@ -8,50 +8,30 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvRadio", {
8
8
  container: {
9
9
  cursor: "pointer",
10
10
  display: "flex",
11
- height: "32px",
12
- transitionProperty: "background-color",
13
- transitionDuration: "150ms",
14
- transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
15
- transitionDelay: "0ms",
16
- "&:hover": {
17
- backgroundColor: uikitStyles.theme.colors.containerBackgroundHover,
18
- borderRadius: uikitStyles.theme.radii.base
19
- }
20
- },
21
- invalidContainer: {
22
- borderBottom: `1px solid ${uikitStyles.theme.colors.negative_120}`,
23
- "&:hover": {
24
- borderBottomLeftRadius: "0px",
25
- borderBottomRightRadius: "0px"
11
+ alignItems: "center",
12
+ transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
13
+ borderRadius: uikitStyles.theme.radii.base,
14
+ ":hover:not($disabled)": {
15
+ backgroundColor: uikitStyles.theme.colors.containerBackgroundHover
26
16
  }
27
17
  },
18
+ invalidContainer: {},
28
19
  disabled: {
29
20
  cursor: "not-allowed",
30
21
  "& $label": { color: uikitStyles.theme.colors.secondary_60, cursor: "not-allowed" }
31
22
  },
32
23
  radio: {
33
- height: "32px",
34
24
  "& svg": {
35
25
  outline: "none",
36
26
  boxShadow: "none"
37
27
  }
38
28
  },
39
- invalidRadio: {
40
- borderBottom: `1px solid ${uikitStyles.theme.colors.negative_120}`,
41
- "&:hover": {
42
- borderBottomLeftRadius: "0px",
43
- borderBottomRightRadius: "0px"
44
- }
45
- },
29
+ invalidRadio: {},
46
30
  label: {
47
- overflow: "hidden",
48
- textOverflow: "ellipsis",
49
31
  verticalAlign: "middle",
50
32
  paddingRight: uikitStyles.theme.space.xs,
51
- whiteSpace: "nowrap",
52
33
  ...uikitStyles.theme.typography.body,
53
34
  cursor: "pointer",
54
- height: "32px",
55
35
  lineHeight: "32px",
56
36
  width: "100%"
57
37
  },
@@ -8,8 +8,9 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
8
8
  verticalAlign: "inherit",
9
9
  alignContent: "inherit",
10
10
  textAlign: "left",
11
+ borderColor: uikitStyles.theme.colors.atmo4,
11
12
  padding: `calc(${uikitStyles.theme.space.xs} - 2px ) ${uikitStyles.theme.space.xs} calc(${uikitStyles.theme.space.xs} - 3px ) ${uikitStyles.theme.spacing(4)}`,
12
- borderBottom: `1px solid ${uikitStyles.theme.colors.atmo4}`
13
+ borderBottomWidth: 1
13
14
  },
14
15
  /** Styles applied to the cell when it's in the table head. */
15
16
  head: {
@@ -18,7 +19,6 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
18
19
  alignContent: "start",
19
20
  backgroundColor: uikitStyles.theme.colors.atmo1,
20
21
  borderTop: "1px solid transparent",
21
- borderBottom: `1px solid ${uikitStyles.theme.colors.atmo4}`,
22
22
  ...uikitStyles.theme.typography.label
23
23
  },
24
24
  /** Styles applied to the cell when it's in the table body. */
@@ -63,7 +63,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
63
63
  padding: 0,
64
64
  width: 32,
65
65
  maxWidth: 32,
66
- borderRight: `solid 1px ${uikitStyles.theme.colors.atmo4}`
66
+ borderRightWidth: 1
67
67
  },
68
68
  /** Styles applied to the component root when its variant is actions */
69
69
  variantActions: {
@@ -71,7 +71,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
71
71
  padding: 0,
72
72
  width: 32,
73
73
  maxWidth: 32,
74
- borderLeft: `solid 1px ${uikitStyles.theme.colors.atmo4}`
74
+ borderLeftWidth: 1
75
75
  },
76
76
  /** Styles applied to the component root when its variant is expand */
77
77
  variantExpand: {
@@ -86,7 +86,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
86
86
  height: 52
87
87
  },
88
88
  padding: "0, 0, 0, 32px",
89
- border: 0
89
+ borderWidth: 0
90
90
  },
91
91
  /** Styles applied to the cell when its variant is list and the type is head. */
92
92
  variantListHead: {
@@ -124,40 +124,40 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableCell
124
124
  },
125
125
  /** Styles applied to the cell when it's part of the last sticky to the left column. */
126
126
  stickyColumnMostLeft: {
127
- borderRight: `solid 1px ${uikitStyles.theme.colors.atmo4}`
127
+ borderRightWidth: 1
128
128
  },
129
129
  /** Styles applied to the cell when it's part of the first right sticky column. */
130
130
  stickyColumnLeastRight: {
131
- borderLeft: `solid 1px ${uikitStyles.theme.colors.atmo4}`
131
+ borderLeftWidth: 1
132
132
  },
133
133
  /** Styles applied to the cell when it's part of the first column in the group. */
134
134
  groupColumnMostLeft: {
135
- borderLeft: `solid 1px ${uikitStyles.theme.colors.atmo4}`,
135
+ borderLeftWidth: 1,
136
136
  "&:first-of-type": {
137
- borderLeft: 0
137
+ borderLeftWidth: 0
138
138
  }
139
139
  },
140
140
  /** Styles applied to the cell when it's part of the last column in the group. */
141
141
  groupColumnMostRight: {
142
- borderRight: `solid 1px ${uikitStyles.theme.colors.atmo4}`,
142
+ borderRightWidth: 1,
143
143
  // due to the ":has()" selector not being supported in browsers,
144
144
  // this need to be managed with inline styles
145
145
  // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)
146
146
  // "&:last-child,&:has(+ $stickyColumnLeastRight)": {
147
147
  "&:last-child": {
148
- borderRight: 0
148
+ borderRightWidth: 0
149
149
  },
150
150
  "&+:not($stickyColumn)": {
151
- borderLeft: 0
151
+ borderLeftWidth: 0
152
152
  }
153
153
  },
154
154
  /** Styles applied to the cell when it's part of a resizable column. */
155
155
  resizable: {
156
- borderRight: `solid 1px ${uikitStyles.theme.colors.atmo4}`
156
+ borderRightWidth: 1
157
157
  },
158
158
  /** Styles applied to the cell when it's part of a resizing column. */
159
159
  resizing: {
160
- borderRight: `solid 2px ${uikitStyles.theme.colors.primary_80}`
160
+ borderRight: `2px solid ${uikitStyles.theme.colors.primary_80}`
161
161
  }
162
162
  });
163
163
  exports.staticClasses = staticClasses;
@@ -11,7 +11,8 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableHead
11
11
  alignContent: "inherit",
12
12
  textAlign: "left",
13
13
  padding: uikitStyles.theme.spacing(0, 1, 0, 4),
14
- borderBottom: `1px solid ${uikitStyles.theme.colors.atmo4}`
14
+ borderColor: uikitStyles.theme.colors.atmo4,
15
+ borderBottomWidth: 1
15
16
  },
16
17
  head: {
17
18
  paddingTop: 8,
@@ -19,14 +20,14 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableHead
19
20
  alignContent: "start",
20
21
  ...uikitStyles.theme.typography.label,
21
22
  backgroundColor: uikitStyles.theme.colors.atmo1,
22
- borderBottom: `1px solid ${uikitStyles.theme.colors.atmo4}`,
23
+ borderBottomWidth: 1,
23
24
  "*:first-of-type > &": {
24
25
  height: "var(--first-row-cell-height)",
25
26
  borderTop: "1px solid transparent"
26
27
  },
27
28
  "&$variantList": {
28
29
  backgroundColor: "inherit",
29
- borderBottom: 0,
30
+ borderBottomWidth: 0,
30
31
  "*:first-of-type > &": {
31
32
  borderTop: 0
32
33
  }
@@ -60,23 +61,23 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableHead
60
61
  position: "sticky",
61
62
  zIndex: 2,
62
63
  "&$groupColumnMostRight+$stickyColumn": {
63
- borderLeft: 0
64
+ borderLeftWidth: 0
64
65
  }
65
66
  },
66
- stickyColumnMostLeft: { borderRight: `solid 1px ${uikitStyles.theme.colors.atmo4}` },
67
- stickyColumnLeastRight: { borderLeft: `solid 1px ${uikitStyles.theme.colors.atmo4}` },
68
- groupColumnMostLeft: { borderLeft: `solid 1px ${uikitStyles.theme.colors.atmo4}` },
67
+ stickyColumnMostLeft: { borderRightWidth: 1 },
68
+ stickyColumnLeastRight: { borderLeftWidth: 1 },
69
+ groupColumnMostLeft: { borderLeftWidth: 1 },
69
70
  groupColumnMostRight: {
70
- borderRight: `solid 1px ${uikitStyles.theme.colors.atmo4}`,
71
+ borderRightWidth: 1,
71
72
  // due to the ":has()" selector not being supported in browsers,
72
73
  // this need to be managed with inline styles
73
74
  // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)
74
75
  // "&:last-child,&:has(+ $stickyColumnLeastRight)": {
75
76
  "&:last-child": {
76
- borderRight: 0
77
+ borderRightWidth: 0
77
78
  },
78
79
  "&+:not($stickyColumn)": {
79
- borderLeft: 0
80
+ borderLeftWidth: 0
80
81
  }
81
82
  },
82
83
  headerContent: { display: "flex", alignItems: "flex-start", width: "100%" },
@@ -108,27 +109,27 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvTableHead
108
109
  padding: 0,
109
110
  width: 32,
110
111
  maxWidth: 32,
111
- borderRight: `solid 1px ${uikitStyles.theme.colors.atmo4}`
112
+ borderRightWidth: 1
112
113
  },
113
114
  variantExpand: {},
114
115
  variantActions: {
115
116
  padding: 0,
116
117
  width: 32,
117
118
  maxWidth: 32,
118
- borderLeft: `solid 1px ${uikitStyles.theme.colors.atmo4}`
119
+ borderLeftWidth: 1
119
120
  },
120
121
  variantNone: { padding: 0 },
121
122
  variantList: {
122
123
  backgroundColor: "inherit",
123
- borderBottom: 0,
124
+ borderBottomWidth: 0,
124
125
  height: 16,
125
126
  ":first-of-type > &": {
126
- borderTop: 0,
127
+ borderTopWidth: 0,
127
128
  height: 16
128
129
  }
129
130
  },
130
131
  resizable: {
131
- borderRight: `1px solid ${uikitStyles.theme.colors.atmo4}`,
132
+ borderRightWidth: 1,
132
133
  ":has($resizer:hover)": {
133
134
  borderRight: `2px solid ${uikitStyles.theme.colors.primary_80}`
134
135
  }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const CounterLabel = ({
5
+ selected,
6
+ total,
7
+ conjunctionLabel = "/"
8
+ }) => {
9
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
10
+ /* @__PURE__ */ jsxRuntime.jsx("b", { children: selected }),
11
+ " ",
12
+ ` ${conjunctionLabel} ${total}`
13
+ ] });
14
+ };
15
+ exports.CounterLabel = CounterLabel;
@@ -16,7 +16,8 @@ const { staticClasses, useClasses } = createClasses("HvBaseRadio", {
16
16
  width: 16,
17
17
  height: 16,
18
18
  borderRadius: theme.radii.circle,
19
- border: `1px solid ${theme.colors.secondary}`,
19
+ borderWidth: 1,
20
+ borderColor: theme.colors.secondary,
20
21
  backgroundColor: theme.colors.atmo1
21
22
  },
22
23
  borderRadius: 0
@@ -25,7 +26,7 @@ const { staticClasses, useClasses } = createClasses("HvBaseRadio", {
25
26
  cursor: "not-allowed",
26
27
  pointerEvents: "initial",
27
28
  "& svg": {
28
- border: `1px solid ${theme.colors.secondary_60}`,
29
+ borderColor: theme.colors.secondary_60,
29
30
  backgroundColor: theme.colors.atmo3
30
31
  }
31
32
  },
@@ -38,20 +39,20 @@ const { staticClasses, useClasses } = createClasses("HvBaseRadio", {
38
39
  icon: {},
39
40
  checked: {
40
41
  "& svg": {
41
- border: `1px solid ${theme.colors.secondary}`,
42
+ borderColor: theme.colors.secondary,
42
43
  backgroundColor: theme.colors.secondary,
43
44
  color: theme.colors.atmo2
44
45
  },
45
46
  "&$semantic": {
46
47
  "& svg": {
47
- border: `1px solid ${theme.colors.base_dark}`,
48
+ borderColor: theme.colors.base_dark,
48
49
  backgroundColor: theme.colors.base_light,
49
50
  color: theme.colors.base_dark
50
51
  }
51
52
  },
52
53
  "&$disabled": {
53
54
  "& svg": {
54
- border: `1px solid ${theme.colors.secondary_60}`,
55
+ borderColor: theme.colors.secondary_60,
55
56
  backgroundColor: theme.colors.secondary_60,
56
57
  color: theme.colors.atmo3
57
58
  }
@@ -59,7 +60,7 @@ const { staticClasses, useClasses } = createClasses("HvBaseRadio", {
59
60
  },
60
61
  semantic: {
61
62
  "& svg": {
62
- border: `1px solid ${theme.colors.base_dark}`,
63
+ borderColor: theme.colors.base_dark,
63
64
  backgroundColor: theme.colors.base_light
64
65
  }
65
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BaseRadio.styles.js","sources":["../../../src/BaseRadio/BaseRadio.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBaseRadio\", {\n root: {\n padding: 0,\n width: 32,\n minWidth: 32,\n height: 32,\n cursor: \"pointer\",\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n borderRadius: theme.radii.base,\n },\n \"& svg\": {\n width: 16,\n height: 16,\n borderRadius: theme.radii.circle,\n border: `1px solid ${theme.colors.secondary}`,\n backgroundColor: theme.colors.atmo1,\n },\n borderRadius: 0,\n },\n disabled: {\n cursor: \"not-allowed\",\n pointerEvents: \"initial\",\n \"& svg\": {\n border: `1px solid ${theme.colors.secondary_60}`,\n backgroundColor: theme.colors.atmo3,\n },\n },\n focusVisible: {\n \"& svg\": {\n borderRadius: \"8px\",\n ...outlineStyles,\n },\n },\n icon: {},\n checked: {\n \"& svg\": {\n border: `1px solid ${theme.colors.secondary}`,\n backgroundColor: theme.colors.secondary,\n color: theme.colors.atmo2,\n },\n \"&$semantic\": {\n \"& svg\": {\n border: `1px solid ${theme.colors.base_dark}`,\n backgroundColor: theme.colors.base_light,\n color: theme.colors.base_dark,\n },\n },\n \"&$disabled\": {\n \"& svg\": {\n border: `1px solid ${theme.colors.secondary_60}`,\n backgroundColor: theme.colors.secondary_60,\n color: theme.colors.atmo3,\n },\n },\n },\n semantic: {\n \"& svg\": {\n border: `1px solid ${theme.colors.base_dark}`,\n backgroundColor: theme.colors.base_light,\n },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA,EACxE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,IAER,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,MAC9B,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,cAAc,MAAM,MAAM;AAAA,MAC1B,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,MAC3C,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,cAAc;AAAA,EAChB;AAAA,EACA,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,SAAS;AAAA,MACP,QAAQ,aAAa,MAAM,OAAO,YAAY;AAAA,MAC9C,iBAAiB,MAAM,OAAO;AAAA,IAAA;AAAA,EAElC;AAAA,EACA,cAAc;AAAA,IACZ,SAAS;AAAA,MACP,cAAc;AAAA,MACd,GAAG;AAAA,IAAA;AAAA,EAEP;AAAA,EACA,MAAM,CAAC;AAAA,EACP,SAAS;AAAA,IACP,SAAS;AAAA,MACP,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,MAC3C,iBAAiB,MAAM,OAAO;AAAA,MAC9B,OAAO,MAAM,OAAO;AAAA,IACtB;AAAA,IACA,cAAc;AAAA,MACZ,SAAS;AAAA,QACP,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,QAC3C,iBAAiB,MAAM,OAAO;AAAA,QAC9B,OAAO,MAAM,OAAO;AAAA,MAAA;AAAA,IAExB;AAAA,IACA,cAAc;AAAA,MACZ,SAAS;AAAA,QACP,QAAQ,aAAa,MAAM,OAAO,YAAY;AAAA,QAC9C,iBAAiB,MAAM,OAAO;AAAA,QAC9B,OAAO,MAAM,OAAO;AAAA,MAAA;AAAA,IACtB;AAAA,EAEJ;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,MAC3C,iBAAiB,MAAM,OAAO;AAAA,IAAA;AAAA,EAChC;AAEJ,CAAC;"}
1
+ {"version":3,"file":"BaseRadio.styles.js","sources":["../../../src/BaseRadio/BaseRadio.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBaseRadio\", {\n root: {\n padding: 0,\n width: 32,\n minWidth: 32,\n height: 32,\n cursor: \"pointer\",\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n borderRadius: theme.radii.base,\n },\n \"& svg\": {\n width: 16,\n height: 16,\n borderRadius: theme.radii.circle,\n borderWidth: 1,\n borderColor: theme.colors.secondary,\n backgroundColor: theme.colors.atmo1,\n },\n borderRadius: 0,\n },\n disabled: {\n cursor: \"not-allowed\",\n pointerEvents: \"initial\",\n \"& svg\": {\n borderColor: theme.colors.secondary_60,\n backgroundColor: theme.colors.atmo3,\n },\n },\n focusVisible: {\n \"& svg\": {\n borderRadius: \"8px\",\n ...outlineStyles,\n },\n },\n icon: {},\n checked: {\n \"& svg\": {\n borderColor: theme.colors.secondary,\n backgroundColor: theme.colors.secondary,\n color: theme.colors.atmo2,\n },\n \"&$semantic\": {\n \"& svg\": {\n borderColor: theme.colors.base_dark,\n backgroundColor: theme.colors.base_light,\n color: theme.colors.base_dark,\n },\n },\n \"&$disabled\": {\n \"& svg\": {\n borderColor: theme.colors.secondary_60,\n backgroundColor: theme.colors.secondary_60,\n color: theme.colors.atmo3,\n },\n },\n },\n semantic: {\n \"& svg\": {\n borderColor: theme.colors.base_dark,\n backgroundColor: theme.colors.base_light,\n },\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA,EACxE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,IAER,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,MAC9B,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,IACA,SAAS;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,cAAc,MAAM,MAAM;AAAA,MAC1B,aAAa;AAAA,MACb,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IACA,cAAc;AAAA,EAChB;AAAA,EACA,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,SAAS;AAAA,MACP,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB,MAAM,OAAO;AAAA,IAAA;AAAA,EAElC;AAAA,EACA,cAAc;AAAA,IACZ,SAAS;AAAA,MACP,cAAc;AAAA,MACd,GAAG;AAAA,IAAA;AAAA,EAEP;AAAA,EACA,MAAM,CAAC;AAAA,EACP,SAAS;AAAA,IACP,SAAS;AAAA,MACP,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB,MAAM,OAAO;AAAA,MAC9B,OAAO,MAAM,OAAO;AAAA,IACtB;AAAA,IACA,cAAc;AAAA,MACZ,SAAS;AAAA,QACP,aAAa,MAAM,OAAO;AAAA,QAC1B,iBAAiB,MAAM,OAAO;AAAA,QAC9B,OAAO,MAAM,OAAO;AAAA,MAAA;AAAA,IAExB;AAAA,IACA,cAAc;AAAA,MACZ,SAAS;AAAA,QACP,aAAa,MAAM,OAAO;AAAA,QAC1B,iBAAiB,MAAM,OAAO;AAAA,QAC9B,OAAO,MAAM,OAAO;AAAA,MAAA;AAAA,IACtB;AAAA,EAEJ;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,MACP,aAAa,MAAM,OAAO;AAAA,MAC1B,iBAAiB,MAAM,OAAO;AAAA,IAAA;AAAA,EAChC;AAEJ,CAAC;"}
@@ -1,11 +1,11 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import { useDefaultProps, useTheme } from "@hitachivantara/uikit-react-utils";
4
+ import { CounterLabel } from "../utils/CounterLabel.js";
4
5
  import { setId } from "../utils/setId.js";
5
6
  import { useClasses } from "./BulkActions.styles.js";
6
7
  import { staticClasses } from "./BulkActions.styles.js";
7
8
  import { HvButton } from "../Button/Button.js";
8
- import { HvTypography } from "../Typography/Typography.js";
9
9
  import { HvCheckBox } from "../CheckBox/CheckBox.js";
10
10
  import { HvActionsGeneric } from "../ActionsGeneric/ActionsGeneric.js";
11
11
  const HvBulkActions = forwardRef(function HvBulkActions2(props, ref) {
@@ -20,7 +20,6 @@ const HvBulkActions = forwardRef(function HvBulkActions2(props, ref) {
20
20
  actions,
21
21
  numTotal = 0,
22
22
  numSelected = 0,
23
- selectAllLabel = "All",
24
23
  selectAllConjunctionLabel = "/",
25
24
  showSelectAllPages = false,
26
25
  semantic = true,
@@ -35,21 +34,6 @@ const HvBulkActions = forwardRef(function HvBulkActions2(props, ref) {
35
34
  const { activeTheme } = useTheme();
36
35
  const anySelected = numSelected > 0;
37
36
  const isSemantic = semantic && anySelected;
38
- const selectAllLabelComponent = /* @__PURE__ */ jsx(
39
- HvTypography,
40
- {
41
- component: "span",
42
- disabled: checkboxProps?.disabled,
43
- variant: "body",
44
- children: !anySelected ? /* @__PURE__ */ jsxs(Fragment, { children: [
45
- /* @__PURE__ */ jsx(HvTypography, { variant: "label", children: selectAllLabel }),
46
- ` (${numTotal})`
47
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
48
- /* @__PURE__ */ jsx(HvTypography, { variant: "label", children: numSelected }),
49
- ` ${selectAllConjunctionLabel} ${numTotal}`
50
- ] })
51
- }
52
- );
53
37
  return /* @__PURE__ */ jsxs(
54
38
  "div",
55
39
  {
@@ -72,7 +56,14 @@ const HvBulkActions = forwardRef(function HvBulkActions2(props, ref) {
72
56
  semantic: isSemantic,
73
57
  onChange: onSelectAll,
74
58
  indeterminate: numSelected > 0 && numSelected < numTotal,
75
- label: selectAllLabelComponent,
59
+ label: /* @__PURE__ */ jsx(
60
+ CounterLabel,
61
+ {
62
+ selected: numSelected,
63
+ total: numTotal,
64
+ conjunctionLabel: selectAllConjunctionLabel
65
+ }
66
+ ),
76
67
  ...checkboxProps
77
68
  }
78
69
  ),
@@ -1 +1 @@
1
- {"version":3,"file":"BulkActions.js","sources":["../../../src/BulkActions/BulkActions.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n useDefaultProps,\n useTheme,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGeneric, HvActionsGenericProps } from \"../ActionsGeneric\";\nimport { HvButton, HvButtonProps, HvButtonVariant } from \"../Button\";\nimport { HvCheckBox, HvCheckBoxProps } from \"../CheckBox\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography } from \"../Typography\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./BulkActions.styles\";\n\nexport { staticClasses as bulkActionsClasses };\n\nexport type HvBulkActionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBulkActionsProps extends HvBaseProps {\n /** Custom label for select all checkbox */\n selectAllLabel?: React.ReactNode;\n /** Custom label for select all checkbox conjunction */\n selectAllConjunctionLabel?: string;\n /** Custom label for select all pages button */\n selectAllPagesLabel?: React.ReactNode;\n /** Whether select all pages element should be visible */\n showSelectAllPages?: boolean;\n /** The total number of elements */\n numTotal?: number;\n /** The number of elements currently selected */\n numSelected?: number;\n /** Function called when the \"select all\" Checkbox is toggled. */\n onSelectAll?: HvCheckBoxProps[\"onChange\"];\n /** Function called when the \"select all pages\" button is clicked toggled. */\n onSelectAllPages?: HvButtonProps[\"onClick\"];\n /** Whether the bulk actions should use the semantic styles when there are selected elements. */\n semantic?: boolean;\n /** The renderable content inside the right actions slot, or an array of actions `{ id, label, icon, disabled, ... }` */\n actions?: HvActionsGenericProps[\"actions\"];\n /** Whether actions should be all disabled */\n actionsDisabled?: boolean;\n /**\n * The callback function called when an action is triggered, receiving `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** The callback function called when an action is triggered, receiving `action` as parameter. */\n onAction?: HvActionsGenericProps[\"onAction\"];\n /** The number of maximum visible actions before they're collapsed into a `DropDownMenu`. */\n maxVisibleActions?: number;\n /** Properties to be passed onto the checkbox component, the values of the object are equivalent to the HvCheckbox API. */\n checkboxProps?: HvCheckBoxProps;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvBulkActionsClasses;\n}\n\n/**\n * Bulk Actions allow users to perform an action on a single or multiple items.\n * Also known as \"batch production\" of multiple items at once, one stage at a time.\n */\nexport const HvBulkActions = forwardRef<\n React.ComponentRef<\"div\">,\n HvBulkActionsProps\n>(function HvBulkActions(props, ref) {\n const {\n id,\n className,\n classes: classesProp,\n selectAllPagesLabel,\n actionsDisabled,\n maxVisibleActions,\n checkboxProps,\n actions,\n numTotal = 0,\n numSelected = 0,\n selectAllLabel = \"All\",\n selectAllConjunctionLabel = \"/\",\n showSelectAllPages = false,\n semantic = true,\n actionsCallback, // TODO - remove in v6\n onAction,\n onSelectAll,\n onSelectAllPages,\n ...others\n } = useDefaultProps(\"HvBulkActions\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { activeTheme } = useTheme();\n\n const anySelected = numSelected > 0;\n const isSemantic = semantic && anySelected;\n\n const selectAllLabelComponent = (\n <HvTypography\n component=\"span\"\n disabled={checkboxProps?.disabled}\n variant=\"body\"\n >\n {!anySelected ? (\n <>\n <HvTypography variant=\"label\">{selectAllLabel}</HvTypography>\n {` (${numTotal})`}\n </>\n ) : (\n <>\n <HvTypography variant=\"label\">{numSelected}</HvTypography>\n {` ${selectAllConjunctionLabel} ${numTotal}`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div\n ref={ref}\n id={id}\n className={cx(\n classes.root,\n { [classes.semantic]: isSemantic },\n className,\n )}\n {...others}\n >\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select\")}\n className={classes.selectAll}\n checked={numSelected > 0}\n semantic={isSemantic}\n onChange={onSelectAll}\n indeterminate={numSelected > 0 && numSelected < numTotal}\n label={selectAllLabelComponent}\n {...checkboxProps}\n />\n {showSelectAllPages && anySelected && numSelected < numTotal && (\n <>\n <div className={classes.divider} />\n <HvButton\n id={setId(id, \"pages\")}\n className={classes.selectAllPages}\n variant={\n isSemantic\n ? (activeTheme?.bulkActions\n .actionButtonVariant as HvButtonVariant)\n : \"secondaryGhost\"\n }\n onClick={onSelectAllPages}\n >\n {selectAllPagesLabel ?? `Select all ${numTotal} items`}\n </HvButton>\n </>\n )}\n </div>\n <HvActionsGeneric\n id={setId(id, \"actions\")}\n classes={{ root: classes.actions }}\n variant={\n isSemantic\n ? (activeTheme?.bulkActions.actionButtonVariant as HvButtonVariant)\n : \"secondaryGhost\"\n }\n actions={actions}\n disabled={actionsDisabled ?? numSelected === 0}\n actionsCallback={actionsCallback}\n onAction={onAction}\n maxVisibleActions={maxVisibleActions}\n />\n </div>\n );\n});\n"],"names":["HvBulkActions"],"mappings":";;;;;;;;;;AA8DO,MAAM,gBAAgB,WAG3B,SAASA,eAAc,OAAO,KAAK;AAC7B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,4BAA4B;AAAA,IAC5B,qBAAqB;AAAA,IACrB,WAAW;AAAA,IACX;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,EAAE,YAAY,IAAI,SAAS;AAEjC,QAAM,cAAc,cAAc;AAClC,QAAM,aAAa,YAAY;AAE/B,QAAM,0BACJ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,UAAU,eAAe;AAAA,MACzB,SAAQ;AAAA,MAEP,UAAA,CAAC,cAEE,qBAAA,UAAA,EAAA,UAAA;AAAA,QAAC,oBAAA,cAAA,EAAa,SAAQ,SAAS,UAAe,gBAAA;AAAA,QAC7C,KAAK,QAAQ;AAAA,MAAA,EAAA,CAChB,IAGE,qBAAA,UAAA,EAAA,UAAA;AAAA,QAAC,oBAAA,cAAA,EAAa,SAAQ,SAAS,UAAY,aAAA;AAAA,QAC1C,IAAI,yBAAyB,IAAI,QAAQ;AAAA,MAAA,EAC5C,CAAA;AAAA,IAAA;AAAA,EAEJ;AAIA,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,EAAE,CAAC,QAAQ,QAAQ,GAAG,WAAW;AAAA,QACjC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC,qBAAA,OAAA,EAAI,WAAW,QAAQ,oBACtB,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI,MAAM,IAAI,QAAQ;AAAA,cACtB,WAAW,QAAQ;AAAA,cACnB,SAAS,cAAc;AAAA,cACvB,UAAU;AAAA,cACV,UAAU;AAAA,cACV,eAAe,cAAc,KAAK,cAAc;AAAA,cAChD,OAAO;AAAA,cACN,GAAG;AAAA,YAAA;AAAA,UACN;AAAA,UACC,sBAAsB,eAAe,cAAc,YAEhD,qBAAA,UAAA,EAAA,UAAA;AAAA,YAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,QAAS,CAAA;AAAA,YACjC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAI,MAAM,IAAI,OAAO;AAAA,gBACrB,WAAW,QAAQ;AAAA,gBACnB,SACE,aACK,aAAa,YACX,sBACH;AAAA,gBAEN,SAAS;AAAA,gBAER,UAAA,uBAAuB,cAAc,QAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UAChD,EACF,CAAA;AAAA,QAAA,GAEJ;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI,MAAM,IAAI,SAAS;AAAA,YACvB,SAAS,EAAE,MAAM,QAAQ,QAAQ;AAAA,YACjC,SACE,aACK,aAAa,YAAY,sBAC1B;AAAA,YAEN;AAAA,YACA,UAAU,mBAAmB,gBAAgB;AAAA,YAC7C;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"BulkActions.js","sources":["../../../src/BulkActions/BulkActions.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n useDefaultProps,\n useTheme,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGeneric, HvActionsGenericProps } from \"../ActionsGeneric\";\nimport { HvButton, HvButtonProps, HvButtonVariant } from \"../Button\";\nimport { HvCheckBox, HvCheckBoxProps } from \"../CheckBox\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { CounterLabel } from \"../utils/CounterLabel\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./BulkActions.styles\";\n\nexport { staticClasses as bulkActionsClasses };\n\nexport type HvBulkActionsClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBulkActionsProps extends HvBaseProps {\n /** Custom label for select all checkbox. @deprecated no longer used */\n selectAllLabel?: React.ReactNode;\n /** Custom label for select all checkbox conjunction */\n selectAllConjunctionLabel?: string;\n /** Custom label for select all pages button */\n selectAllPagesLabel?: React.ReactNode;\n /** Whether select all pages element should be visible */\n showSelectAllPages?: boolean;\n /** The total number of elements */\n numTotal?: number;\n /** The number of elements currently selected */\n numSelected?: number;\n /** Function called when the \"select all\" Checkbox is toggled. */\n onSelectAll?: HvCheckBoxProps[\"onChange\"];\n /** Function called when the \"select all pages\" button is clicked toggled. */\n onSelectAllPages?: HvButtonProps[\"onClick\"];\n /** Whether the bulk actions should use the semantic styles when there are selected elements. */\n semantic?: boolean;\n /** The renderable content inside the right actions slot, or an array of actions `{ id, label, icon, disabled, ... }` */\n actions?: HvActionsGenericProps[\"actions\"];\n /** Whether actions should be all disabled */\n actionsDisabled?: boolean;\n /**\n * The callback function called when an action is triggered, receiving `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** The callback function called when an action is triggered, receiving `action` as parameter. */\n onAction?: HvActionsGenericProps[\"onAction\"];\n /** The number of maximum visible actions before they're collapsed into a `DropDownMenu`. */\n maxVisibleActions?: number;\n /** Properties to be passed onto the checkbox component, the values of the object are equivalent to the HvCheckbox API. */\n checkboxProps?: HvCheckBoxProps;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvBulkActionsClasses;\n}\n\n/**\n * Bulk Actions allow users to perform an action on a single or multiple items.\n * Also known as \"batch production\" of multiple items at once, one stage at a time.\n */\nexport const HvBulkActions = forwardRef<\n React.ComponentRef<\"div\">,\n HvBulkActionsProps\n>(function HvBulkActions(props, ref) {\n const {\n id,\n className,\n classes: classesProp,\n selectAllPagesLabel,\n actionsDisabled,\n maxVisibleActions,\n checkboxProps,\n actions,\n numTotal = 0,\n numSelected = 0,\n selectAllConjunctionLabel = \"/\",\n showSelectAllPages = false,\n semantic = true,\n actionsCallback, // TODO - remove in v6\n onAction,\n onSelectAll,\n onSelectAllPages,\n ...others\n } = useDefaultProps(\"HvBulkActions\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const { activeTheme } = useTheme();\n\n const anySelected = numSelected > 0;\n const isSemantic = semantic && anySelected;\n\n return (\n <div\n ref={ref}\n id={id}\n className={cx(\n classes.root,\n { [classes.semantic]: isSemantic },\n className,\n )}\n {...others}\n >\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select\")}\n className={classes.selectAll}\n checked={numSelected > 0}\n semantic={isSemantic}\n onChange={onSelectAll}\n indeterminate={numSelected > 0 && numSelected < numTotal}\n label={\n <CounterLabel\n selected={numSelected}\n total={numTotal}\n conjunctionLabel={selectAllConjunctionLabel}\n />\n }\n {...checkboxProps}\n />\n {showSelectAllPages && anySelected && numSelected < numTotal && (\n <>\n <div className={classes.divider} />\n <HvButton\n id={setId(id, \"pages\")}\n className={classes.selectAllPages}\n variant={\n isSemantic\n ? (activeTheme?.bulkActions\n .actionButtonVariant as HvButtonVariant)\n : \"secondaryGhost\"\n }\n onClick={onSelectAllPages}\n >\n {selectAllPagesLabel ?? `Select all ${numTotal} items`}\n </HvButton>\n </>\n )}\n </div>\n <HvActionsGeneric\n id={setId(id, \"actions\")}\n classes={{ root: classes.actions }}\n variant={\n isSemantic\n ? (activeTheme?.bulkActions.actionButtonVariant as HvButtonVariant)\n : \"secondaryGhost\"\n }\n actions={actions}\n disabled={actionsDisabled ?? numSelected === 0}\n actionsCallback={actionsCallback}\n onAction={onAction}\n maxVisibleActions={maxVisibleActions}\n />\n </div>\n );\n});\n"],"names":["HvBulkActions"],"mappings":";;;;;;;;;;AA8DO,MAAM,gBAAgB,WAG3B,SAASA,eAAc,OAAO,KAAK;AAC7B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,cAAc;AAAA,IACd,4BAA4B;AAAA,IAC5B,qBAAqB;AAAA,IACrB,WAAW;AAAA,IACX;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,iBAAiB,KAAK;AAE1C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,EAAE,YAAY,IAAI,SAAS;AAEjC,QAAM,cAAc,cAAc;AAClC,QAAM,aAAa,YAAY;AAG7B,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,EAAE,CAAC,QAAQ,QAAQ,GAAG,WAAW;AAAA,QACjC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC,qBAAA,OAAA,EAAI,WAAW,QAAQ,oBACtB,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI,MAAM,IAAI,QAAQ;AAAA,cACtB,WAAW,QAAQ;AAAA,cACnB,SAAS,cAAc;AAAA,cACvB,UAAU;AAAA,cACV,UAAU;AAAA,cACV,eAAe,cAAc,KAAK,cAAc;AAAA,cAChD,OACE;AAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,UAAU;AAAA,kBACV,OAAO;AAAA,kBACP,kBAAkB;AAAA,gBAAA;AAAA,cACpB;AAAA,cAED,GAAG;AAAA,YAAA;AAAA,UACN;AAAA,UACC,sBAAsB,eAAe,cAAc,YAEhD,qBAAA,UAAA,EAAA,UAAA;AAAA,YAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,QAAS,CAAA;AAAA,YACjC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,IAAI,MAAM,IAAI,OAAO;AAAA,gBACrB,WAAW,QAAQ;AAAA,gBACnB,SACE,aACK,aAAa,YACX,sBACH;AAAA,gBAEN,SAAS;AAAA,gBAER,UAAA,uBAAuB,cAAc,QAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,UAChD,EACF,CAAA;AAAA,QAAA,GAEJ;AAAA,QACA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAI,MAAM,IAAI,SAAS;AAAA,YACvB,SAAS,EAAE,MAAM,QAAQ,QAAQ;AAAA,YACjC,SACE,aACK,aAAa,YAAY,sBAC1B;AAAA,YAEN;AAAA,YACA,UAAU,mBAAmB,gBAAgB;AAAA,YAC7C;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EACF;AAEJ,CAAC;"}