@hitachivantara/uikit-react-core 4.0.1-next.2 → 4.0.1-next.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 (49) hide show
  1. package/dist/Controls/Controls.d.ts +2 -10
  2. package/dist/Controls/RightControl/RightControl.d.ts +1 -1
  3. package/dist/Provider/Provider.d.ts +5 -18
  4. package/dist/Provider/Provider.js +25 -38
  5. package/dist/Provider/Provider.js.map +1 -1
  6. package/dist/SimpleGrid/SimpleGrid.d.ts +7 -8
  7. package/dist/Table/TableBody/TableBody.d.ts +4 -0
  8. package/dist/Table/renderers/index.js +50 -0
  9. package/dist/Table/renderers/index.js.map +1 -1
  10. package/dist/Table/renderers/renderers.js +9 -15
  11. package/dist/Table/renderers/renderers.js.map +1 -1
  12. package/dist/Tag/Tag.js +1 -13
  13. package/dist/Tag/Tag.js.map +1 -1
  14. package/dist/Tag/styles.js +5 -3
  15. package/dist/Tag/styles.js.map +1 -1
  16. package/dist/legacy/Controls/Controls.d.ts +2 -10
  17. package/dist/legacy/Controls/RightControl/RightControl.d.ts +1 -1
  18. package/dist/legacy/Provider/Provider.d.ts +5 -18
  19. package/dist/legacy/Provider/Provider.js +29 -40
  20. package/dist/legacy/Provider/Provider.js.map +1 -1
  21. package/dist/legacy/SimpleGrid/SimpleGrid.d.ts +7 -8
  22. package/dist/legacy/Table/TableBody/TableBody.d.ts +4 -0
  23. package/dist/legacy/Table/renderers/index.js +1 -0
  24. package/dist/legacy/Table/renderers/index.js.map +1 -1
  25. package/dist/legacy/Table/renderers/renderers.js +6 -6
  26. package/dist/legacy/Table/renderers/renderers.js.map +1 -1
  27. package/dist/legacy/Tag/Tag.js +3 -15
  28. package/dist/legacy/Tag/Tag.js.map +1 -1
  29. package/dist/legacy/Tag/styles.js +5 -3
  30. package/dist/legacy/Tag/styles.js.map +1 -1
  31. package/dist/legacy/theme/index.d.ts +2 -1
  32. package/dist/modern/Controls/Controls.d.ts +2 -10
  33. package/dist/modern/Controls/RightControl/RightControl.d.ts +1 -1
  34. package/dist/modern/Provider/Provider.d.ts +5 -18
  35. package/dist/modern/Provider/Provider.js +28 -38
  36. package/dist/modern/Provider/Provider.js.map +1 -1
  37. package/dist/modern/SimpleGrid/SimpleGrid.d.ts +7 -8
  38. package/dist/modern/Table/TableBody/TableBody.d.ts +4 -0
  39. package/dist/modern/Table/renderers/index.js +1 -0
  40. package/dist/modern/Table/renderers/index.js.map +1 -1
  41. package/dist/modern/Table/renderers/renderers.js +6 -6
  42. package/dist/modern/Table/renderers/renderers.js.map +1 -1
  43. package/dist/modern/Tag/Tag.js +3 -15
  44. package/dist/modern/Tag/Tag.js.map +1 -1
  45. package/dist/modern/Tag/styles.js +5 -3
  46. package/dist/modern/Tag/styles.js.map +1 -1
  47. package/dist/modern/theme/index.d.ts +2 -1
  48. package/dist/theme/index.d.ts +2 -1
  49. package/package.json +2 -2
@@ -1,22 +1,14 @@
1
1
  import { StandardProps } from "@mui/material";
2
+ import { HvTableInstance } from "../Table";
2
3
 
3
4
  export type HvControlsClassKey = "root" | "rightSection" | "leftSection";
4
5
 
5
- export interface HvControlsSortValue {
6
- id: string;
7
- desc: string;
8
- }
9
6
  export interface HvControlsViewConfiguration extends Record<string, unknown> {
10
7
  id: string;
11
8
  label: string;
12
9
  icon: React.ReactNode;
13
10
  }
14
11
 
15
- export interface HvControlsCallbacks extends Record<string, unknown> {
16
- setSortBy?: (v: HvControlsSortValue[]) => void;
17
- setGlobalFilter?: (v: string) => void;
18
- }
19
-
20
12
  export interface HvControlsProps
21
13
  extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvControlsClassKey> {
22
14
  /** Children to be rendered. */
@@ -29,7 +21,7 @@ export interface HvControlsProps
29
21
  * An instance of useHvTable or useTable used to manage the data
30
22
  * if this is not provided data sorting and search must be handled externally
31
23
  */
32
- callbacks?: HvControlsCallbacks;
24
+ callbacks?: Pick<HvTableInstance, "setSortBy" | "setGlobalFilter">;
33
25
  /**
34
26
  * Views configuration required for the view buttons
35
27
  */
@@ -10,7 +10,7 @@ export interface HvControlsViewConfiguration extends Record<string, unknown> {
10
10
  }
11
11
 
12
12
  export interface RightListControls extends ListValueProp {
13
- accesor: string;
13
+ accessor: string;
14
14
  desc: boolean;
15
15
  }
16
16
 
@@ -52,32 +52,19 @@ export interface HvProviderProps {
52
52
  * Ignored if a custom `generateClassName` is provided.
53
53
  */
54
54
  generateClassNameOptions?: GenerateClassNameOptions;
55
- /**
56
- * Injects the generated stylesheets at the top of the `<head>` element of the page.
57
- * This can ease the override of UI Kit components styles.
58
- *
59
- * By default, the styles are injected last in the `<head>` element of the page.
60
- */
61
- injectStylesFirst?: boolean;
62
55
  /**
63
56
  * Disables the generation of the styles.
64
57
  */
65
58
  disableStylesGeneration?: boolean;
66
59
 
67
60
  /**
68
- * Disables the generation of the baseline css styles.
69
- *
70
- * This will be the default behavior in the future.
71
- *
72
- * The application using UI Kit should be responsible for adding the baseline css styles, by
73
- * either using the `<HvCssBaseline />` component, using the `<HvScopedCssBaseline />` component,
74
- * or ensuring that the necessary base styles are applied.
75
- *
76
- * Defaults to `false`. Will be removed in the next major release.
61
+ * By default the baseline styles are applied globally to the application.
62
+ * If you need to scope the CSS to avoid styling conflicts, you can set this prop to `"scoped"`.
63
+ * If you are providing the baseline styles, you can set this prop to false.
77
64
  *
78
- * @see https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main
65
+ * @see https://lumada-design.github.io/uikit/master/?path=/docs/theme-css-baseline--page
79
66
  */
80
- disableCssBaseline?: boolean;
67
+ cssBaseline?: "global" | "scoped" | "none";
81
68
  }
82
69
 
83
70
  export default function HvProvider(props: HvProviderProps): JSX.Element | null;
@@ -53,13 +53,12 @@ var _context = _interopRequireDefault(require("./context"));
53
53
 
54
54
  var _jsxRuntime = require("react/jsx-runtime");
55
55
 
56
- var _HvCssBaseline;
56
+ var _HvCssBaseline, _HvScopedCssBaseline;
57
57
 
58
58
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
59
59
 
60
60
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
61
61
 
62
- var warnedOnce = false;
63
62
  /**
64
63
  * Augments the target theme with the differences found in the source theme.
65
64
  *
@@ -67,7 +66,6 @@ var warnedOnce = false;
67
66
  * @param {Object} InputSourceTheme - A material UI Theme to apply on top.
68
67
  * @returns {Object} - A new modified material UI theme.
69
68
  */
70
-
71
69
  var applyCustomTheme = function applyCustomTheme(InputTargetTheme, InputSourceTheme) {
72
70
  var muiDefaultTheme = (0, _material.createTheme)();
73
71
  var targetTheme = (0, _cloneDeep.default)(InputTargetTheme);
@@ -124,31 +122,21 @@ var HvProvider = function HvProvider(_ref) {
124
122
  locale = _ref$locale === void 0 ? "en-US" : _ref$locale,
125
123
  generateClassNameProp = _ref.generateClassName,
126
124
  generateClassNameOptions = _ref.generateClassNameOptions,
127
- _ref$injectStylesFirs = _ref.injectStylesFirst,
128
- injectStylesFirst = _ref$injectStylesFirs === void 0 ? true : _ref$injectStylesFirs,
129
125
  _ref$disableStylesGen = _ref.disableStylesGeneration,
130
126
  disableStylesGeneration = _ref$disableStylesGen === void 0 ? false : _ref$disableStylesGen,
131
- _ref$disableCssBaseli = _ref.disableCssBaseline,
132
- disableCssBaseline = _ref$disableCssBaseli === void 0 ? false : _ref$disableCssBaseli;
133
-
134
- if (process.env.NODE_ENV !== "production") {
135
- if (!warnedOnce && !disableCssBaseline) {
136
- warnedOnce = true; // eslint-disable-next-line no-console
137
-
138
- console.warn("UI Kit HvProvider's automatic definition of a css styles baseline will be removed in the next major version.\n" + "You can use the `disableCssBaseline` property to disable it already.\n" + "See https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main");
139
- }
140
- }
127
+ _ref$cssBaseline = _ref.cssBaseline,
128
+ cssBaseline = _ref$cssBaseline === void 0 ? "global" : _ref$cssBaseline;
141
129
 
142
130
  var _useState = (0, _react.useState)(locale),
143
131
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
144
132
  localeSetting = _useState2[0],
145
- setLocaleStting = _useState2[1];
133
+ setLocaleSetting = _useState2[1];
146
134
 
147
135
  (0, _react.useEffect)(function () {
148
136
  var _navigator;
149
137
 
150
138
  // ssr - only runs at the rendering phase, so it won't run on the server
151
- setLocaleStting(locale || ((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.language));
139
+ setLocaleSetting(locale || ((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.language));
152
140
  }, [locale]);
153
141
  var rawUiKitTheme = (0, _theme.getTheme)(uiKitTheme);
154
142
  var customTheme = applyCustomTheme((0, _theme.themeBuilder)(rawUiKitTheme), theme);
@@ -159,14 +147,27 @@ var HvProvider = function HvProvider(_ref) {
159
147
  locale: localeSetting
160
148
  };
161
149
  }, [changeTheme, localeSetting]);
150
+
151
+ var renderCssBaseline = function renderCssBaseline() {
152
+ if (cssBaseline === "global") {
153
+ return _HvCssBaseline || (_HvCssBaseline = /*#__PURE__*/(0, _jsxRuntime.jsx)(_theme.HvCssBaseline, {}));
154
+ }
155
+
156
+ if (cssBaseline === "scoped") {
157
+ return _HvScopedCssBaseline || (_HvScopedCssBaseline = /*#__PURE__*/(0, _jsxRuntime.jsx)(_theme.HvScopedCssBaseline, {}));
158
+ }
159
+
160
+ return null;
161
+ };
162
+
162
163
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles2.StyledEngineProvider, {
163
- injectFirst: injectStylesFirst,
164
+ injectFirst: true,
164
165
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StylesProvider, {
165
166
  generateClassName: generateClassName,
166
167
  disableGeneration: disableStylesGeneration,
167
168
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ThemeProvider, {
168
169
  theme: customTheme,
169
- children: [!disableCssBaseline && (_HvCssBaseline || (_HvCssBaseline = /*#__PURE__*/(0, _jsxRuntime.jsx)(_theme.HvCssBaseline, {}))), /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.default.Provider, {
170
+ children: [renderCssBaseline(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.default.Provider, {
170
171
  value: pConfig,
171
172
  children: children
172
173
  })]
@@ -237,33 +238,19 @@ process.env.NODE_ENV !== "production" ? HvProvider.propTypes = {
237
238
  seed: _propTypes.default.string
238
239
  }),
239
240
 
240
- /**
241
- * Injects the generated stylesheets at the top of the `<head>` element of the page.
242
- * This can ease the override of UI Kit components styles.
243
- *
244
- * By default, the styles are injected last in the `<head>` element of the page.
245
- */
246
- injectStylesFirst: _propTypes.default.bool,
247
-
248
241
  /**
249
242
  * Disables the generation of the styles.
250
243
  */
251
244
  disableStylesGeneration: _propTypes.default.bool,
252
245
 
253
246
  /**
254
- * Disables the generation of the baseline css styles.
255
- *
256
- * This will be the default behavior in the future.
257
- *
258
- * The application using UI Kit should be responsible for adding the baseline css styles, by
259
- * either using the `<HvCssBaseline />` component, using the `<HvScopedCssBaseline />` component,
260
- * or ensuring that the necessary base styles are applied.
261
- *
262
- * Defaults to `false`. Will be removed in the next major release.
247
+ * By default the baseline styles are applied globally to the application.
248
+ * If you need to scope the CSS to avoid styling conflicts, you can set this prop to `"scoped"`.
249
+ * If you are providing the baseline styles, you can set this prop to false.
263
250
  *
264
- * @see https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main
251
+ * @see https://lumada-design.github.io/uikit/master/?path=/docs/theme-css-baseline--page
265
252
  */
266
- disableCssBaseline: _propTypes.default.bool
253
+ cssBaseline: _propTypes.default.oneOf(["global", "scoped", "none"])
267
254
  } : void 0;
268
255
  var _default = HvProvider;
269
256
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.js","names":["warnedOnce","applyCustomTheme","InputTargetTheme","InputSourceTheme","muiDefaultTheme","createTheme","targetTheme","cloneDeep","sourceTheme","deleteDifference","isEmpty","diff","observableDiff","difference","partialCustomTheme","set","path","rhs","kind","merge","HvProvider","children","uiKitTheme","theme","changeTheme","locale","generateClassNameProp","generateClassName","generateClassNameOptions","injectStylesFirst","disableStylesGeneration","disableCssBaseline","process","env","NODE_ENV","console","warn","useState","localeSetting","setLocaleStting","useEffect","navigator","language","rawUiKitTheme","getTheme","customTheme","themeBuilder","createGenerateClassName","pConfig","useMemo","propTypes","PropTypes","node","isRequired","oneOf","instanceOf","Object","func","string","shape","disableGlobal","bool","productionPrefix","seed"],"sources":["../../src/Provider/Provider.js"],"sourcesContent":["import React, { useState, useEffect, useMemo } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport set from \"lodash/set\";\nimport merge from \"lodash/merge\";\nimport isEmpty from \"lodash/isEmpty\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport diff from \"deep-diff\";\n\nimport \"focus-within-polyfill\";\nimport \"focus-visible\";\n\nimport { createTheme, ThemeProvider } from \"@mui/material\";\nimport { StylesProvider } from \"@mui/styles\";\nimport { StyledEngineProvider } from \"@mui/material/styles\";\nimport { themeBuilder, createGenerateClassName, HvCssBaseline, getTheme } from \"../theme\";\n\nimport ConfigContext from \"./context\";\n\nlet warnedOnce = false;\n\n/**\n * Augments the target theme with the differences found in the source theme.\n *\n * @param {Object} InputTargetTheme - A material UI Theme to be changed.\n * @param {Object} InputSourceTheme - A material UI Theme to apply on top.\n * @returns {Object} - A new modified material UI theme.\n */\nconst applyCustomTheme = (InputTargetTheme, InputSourceTheme) => {\n const muiDefaultTheme = createTheme();\n const targetTheme = cloneDeep(InputTargetTheme);\n const sourceTheme = cloneDeep(InputSourceTheme);\n const deleteDifference = \"D\";\n if (!isEmpty(targetTheme) && !isEmpty(sourceTheme)) {\n diff.observableDiff(muiDefaultTheme, sourceTheme, (difference) => {\n const partialCustomTheme = set({}, difference.path, difference.rhs);\n if (difference.kind !== deleteDifference) {\n // Do not include the differences of type \"delete\"\n merge(targetTheme, partialCustomTheme);\n }\n });\n return targetTheme;\n }\n return targetTheme;\n};\n\n/**\n * This component makes cross-component properties, like the active `theme` and `locale`,\n * available down the React tree thanks to React context.\n *\n * This component should preferably be used at **the root of your component tree** and\n * be unique in the App in most cases.\n *\n * ```jsx\n * <HvProvider>\n * <MyApp />\n * <HvProvider/>\n * ```\n *\n * If several `HvProvider`'s are used, either nested or in parallel, the `generateClassNameOptions`\n * must be tweaked to avoid CSS classnames collision. Or a custom JSS's class name generator can\n * be provided via the `generateClassName` property.\n *\n * **UI Kit components will not work at all if the `HvProvider` is not configured correctly**,\n * as they will not be able to access the properties of the active theme..\n *\n */\nconst HvProvider = ({\n children,\n\n uiKitTheme = \"dawn\",\n theme = null,\n changeTheme = () => {},\n\n locale = \"en-US\",\n\n generateClassName: generateClassNameProp,\n generateClassNameOptions,\n injectStylesFirst = true,\n disableStylesGeneration = false,\n\n disableCssBaseline = false,\n}) => {\n if (process.env.NODE_ENV !== \"production\") {\n if (!warnedOnce && !disableCssBaseline) {\n warnedOnce = true;\n // eslint-disable-next-line no-console\n console.warn(\n \"UI Kit HvProvider's automatic definition of a css styles baseline will be removed in the next major version.\\n\" +\n \"You can use the `disableCssBaseline` property to disable it already.\\n\" +\n \"See https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main\"\n );\n }\n }\n\n const [localeSetting, setLocaleStting] = useState(locale);\n\n useEffect(() => {\n // ssr - only runs at the rendering phase, so it won't run on the server\n setLocaleStting(locale || navigator?.language);\n }, [locale]);\n\n const rawUiKitTheme = getTheme(uiKitTheme);\n const customTheme = applyCustomTheme(themeBuilder(rawUiKitTheme), theme);\n\n const generateClassName =\n generateClassNameProp || createGenerateClassName(generateClassNameOptions);\n\n const pConfig = useMemo(\n () => ({ changeTheme, locale: localeSetting }),\n [changeTheme, localeSetting]\n );\n\n return (\n <StyledEngineProvider injectFirst={injectStylesFirst}>\n <StylesProvider\n generateClassName={generateClassName}\n disableGeneration={disableStylesGeneration}\n >\n <ThemeProvider theme={customTheme}>\n {!disableCssBaseline && <HvCssBaseline />}\n <ConfigContext.Provider value={pConfig}>{children}</ConfigContext.Provider>\n </ThemeProvider>\n </StylesProvider>\n </StyledEngineProvider>\n );\n};\n\nHvProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node.isRequired,\n\n /**\n * The Design System base theme in use. Defaults to `\"dawn\"`.\n */\n uiKitTheme: PropTypes.oneOf([\"dawn\", \"wicked\"]),\n /**\n * The UI Kit theme object to be applied on top of the base theme.\n */\n theme: PropTypes.instanceOf(Object),\n /**\n * Function stored in the provider's context to allow runtime switching of the active theme.\n * The implementation is up to each App.\n */\n changeTheme: PropTypes.func,\n\n /**\n * The locale to be used.\n * Defaults to the browser's configured locale or \"en-US\" if not available.\n */\n locale: PropTypes.string,\n\n /**\n * Custom JSS's class name generator.\n */\n generateClassName: PropTypes.func,\n /**\n * Built-in JSS's class name generator options.\n * Ignored if a custom `generateClassName` is provided.\n *\n * `disableGlobal`: Disable the generation of deterministic class names. Defaults to `false`.\n *\n * `productionPrefix`: The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n *\n * `seed`: The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n generateClassNameOptions: PropTypes.shape({\n /**\n * Disable the generation of deterministic class names. Defaults to `false`.\n */\n disableGlobal: PropTypes.bool,\n /**\n * The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n */\n productionPrefix: PropTypes.string,\n /**\n * The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n seed: PropTypes.string,\n }),\n /**\n * Injects the generated stylesheets at the top of the `<head>` element of the page.\n * This can ease the override of UI Kit components styles.\n *\n * By default, the styles are injected last in the `<head>` element of the page.\n */\n injectStylesFirst: PropTypes.bool,\n /**\n * Disables the generation of the styles.\n */\n disableStylesGeneration: PropTypes.bool,\n\n /**\n * Disables the generation of the baseline css styles.\n *\n * This will be the default behavior in the future.\n *\n * The application using UI Kit should be responsible for adding the baseline css styles, by\n * either using the `<HvCssBaseline />` component, using the `<HvScopedCssBaseline />` component,\n * or ensuring that the necessary base styles are applied.\n *\n * Defaults to `false`. Will be removed in the next major release.\n *\n * @see https://lumada-design.github.io/uikit/master/?path=/docs/foundation-css-baseline--main\n */\n disableCssBaseline: PropTypes.bool,\n};\n\nexport default HvProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;;;;;;;;;AAEA,IAAIA,UAAU,GAAG,KAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,gBAAD,EAAmBC,gBAAnB,EAAwC;EAC/D,IAAMC,eAAe,GAAG,IAAAC,qBAAA,GAAxB;EACA,IAAMC,WAAW,GAAG,IAAAC,kBAAA,EAAUL,gBAAV,CAApB;EACA,IAAMM,WAAW,GAAG,IAAAD,kBAAA,EAAUJ,gBAAV,CAApB;EACA,IAAMM,gBAAgB,GAAG,GAAzB;;EACA,IAAI,CAAC,IAAAC,gBAAA,EAAQJ,WAAR,CAAD,IAA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B;AACF;AACA;EACE/B,UAAU,EAAE6B,kBAAA,CAAUG,KAAV,CAAgB,CAAC,MAAD,EAAS,QAAT,CAAhB,CATS;;EAUrB;AACF;AACA;EACE/B,KAAK,EAAE4B,kBAAA,CAAUI,UAAV,CAAqBC,MAArB,CAbc;;EAcrB;AACF;AACA;AACA;EACEhC,WAAW,EAAE2B,kBAAA,CAAUM,IAlBF;;EAoBrB;AACF;AACA;AACA;EACEhC,MAAM,EAAE0B,kBAAA,CAAUO,MAxBG;;EA0BrB;AACF;AACA;EACE/B,iBAAiB,EAAEwB,kBAAA,CAAUM,IA7BR;;EA8BrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE7B,wBAAwB,EAAEuB,kBAAA,CAAUQ,KAAV,CAAgB;IACxC;AACJ;AACA;IACIC,aAAa,EAAET,kBAAA,CAAUU,IAJe;;IAKxC;AACJ;AACA;IACIC,gBAAgB,EAAEX,kBAAA,CAAUO,MARY;;IASxC;AACJ;AACA;AACA;IACIK,IAAI,EAAEZ,kBAAA,CAAUO;EAbwB,CAAhB,CAzCL;;EAwDrB;AACF;AACA;AACA;AACA;AACA;EACE7B,iBAAiB,EAAEsB,kBAAA,CAAUU,IA9DR;;EA+DrB;AACF;AACA;EACE/B,uBAAuB,EAAEqB,kBAAA,CAAUU,IAlEd;;EAoErB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE9B,kBAAkB,EAAEoB,kBAAA,CAAUU;AAjFT,CAAvB;eAoFezC,U"}
1
+ {"version":3,"file":"Provider.js","names":["applyCustomTheme","InputTargetTheme","InputSourceTheme","muiDefaultTheme","createTheme","targetTheme","cloneDeep","sourceTheme","deleteDifference","isEmpty","diff","observableDiff","difference","partialCustomTheme","set","path","rhs","kind","merge","HvProvider","children","uiKitTheme","theme","changeTheme","locale","generateClassNameProp","generateClassName","generateClassNameOptions","disableStylesGeneration","cssBaseline","useState","localeSetting","setLocaleSetting","useEffect","navigator","language","rawUiKitTheme","getTheme","customTheme","themeBuilder","createGenerateClassName","pConfig","useMemo","renderCssBaseline","propTypes","PropTypes","node","isRequired","oneOf","instanceOf","Object","func","string","shape","disableGlobal","bool","productionPrefix","seed"],"sources":["../../src/Provider/Provider.js"],"sourcesContent":["import React, { useState, useEffect, useMemo } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport set from \"lodash/set\";\nimport merge from \"lodash/merge\";\nimport isEmpty from \"lodash/isEmpty\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport diff from \"deep-diff\";\n\nimport \"focus-within-polyfill\";\nimport \"focus-visible\";\n\nimport { createTheme, ThemeProvider } from \"@mui/material\";\nimport { StylesProvider } from \"@mui/styles\";\nimport { StyledEngineProvider } from \"@mui/material/styles\";\nimport {\n themeBuilder,\n createGenerateClassName,\n HvCssBaseline,\n getTheme,\n HvScopedCssBaseline,\n} from \"../theme\";\n\nimport ConfigContext from \"./context\";\n\n/**\n * Augments the target theme with the differences found in the source theme.\n *\n * @param {Object} InputTargetTheme - A material UI Theme to be changed.\n * @param {Object} InputSourceTheme - A material UI Theme to apply on top.\n * @returns {Object} - A new modified material UI theme.\n */\nconst applyCustomTheme = (InputTargetTheme, InputSourceTheme) => {\n const muiDefaultTheme = createTheme();\n const targetTheme = cloneDeep(InputTargetTheme);\n const sourceTheme = cloneDeep(InputSourceTheme);\n const deleteDifference = \"D\";\n if (!isEmpty(targetTheme) && !isEmpty(sourceTheme)) {\n diff.observableDiff(muiDefaultTheme, sourceTheme, (difference) => {\n const partialCustomTheme = set({}, difference.path, difference.rhs);\n if (difference.kind !== deleteDifference) {\n // Do not include the differences of type \"delete\"\n merge(targetTheme, partialCustomTheme);\n }\n });\n return targetTheme;\n }\n return targetTheme;\n};\n\n/**\n * This component makes cross-component properties, like the active `theme` and `locale`,\n * available down the React tree thanks to React context.\n *\n * This component should preferably be used at **the root of your component tree** and\n * be unique in the App in most cases.\n *\n * ```jsx\n * <HvProvider>\n * <MyApp />\n * <HvProvider/>\n * ```\n *\n * If several `HvProvider`'s are used, either nested or in parallel, the `generateClassNameOptions`\n * must be tweaked to avoid CSS classnames collision. Or a custom JSS's class name generator can\n * be provided via the `generateClassName` property.\n *\n * **UI Kit components will not work at all if the `HvProvider` is not configured correctly**,\n * as they will not be able to access the properties of the active theme..\n *\n */\nconst HvProvider = ({\n children,\n\n uiKitTheme = \"dawn\",\n theme = null,\n changeTheme = () => {},\n\n locale = \"en-US\",\n\n generateClassName: generateClassNameProp,\n generateClassNameOptions,\n disableStylesGeneration = false,\n\n cssBaseline = \"global\",\n}) => {\n const [localeSetting, setLocaleSetting] = useState(locale);\n\n useEffect(() => {\n // ssr - only runs at the rendering phase, so it won't run on the server\n setLocaleSetting(locale || navigator?.language);\n }, [locale]);\n\n const rawUiKitTheme = getTheme(uiKitTheme);\n const customTheme = applyCustomTheme(themeBuilder(rawUiKitTheme), theme);\n\n const generateClassName =\n generateClassNameProp || createGenerateClassName(generateClassNameOptions);\n\n const pConfig = useMemo(\n () => ({ changeTheme, locale: localeSetting }),\n [changeTheme, localeSetting]\n );\n\n const renderCssBaseline = () => {\n if (cssBaseline === \"global\") {\n return <HvCssBaseline />;\n }\n if (cssBaseline === \"scoped\") {\n return <HvScopedCssBaseline />;\n }\n return null;\n };\n\n return (\n <StyledEngineProvider injectFirst>\n <StylesProvider\n generateClassName={generateClassName}\n disableGeneration={disableStylesGeneration}\n >\n <ThemeProvider theme={customTheme}>\n {renderCssBaseline()}\n <ConfigContext.Provider value={pConfig}>{children}</ConfigContext.Provider>\n </ThemeProvider>\n </StylesProvider>\n </StyledEngineProvider>\n );\n};\n\nHvProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node.isRequired,\n\n /**\n * The Design System base theme in use. Defaults to `\"dawn\"`.\n */\n uiKitTheme: PropTypes.oneOf([\"dawn\", \"wicked\"]),\n /**\n * The UI Kit theme object to be applied on top of the base theme.\n */\n theme: PropTypes.instanceOf(Object),\n /**\n * Function stored in the provider's context to allow runtime switching of the active theme.\n * The implementation is up to each App.\n */\n changeTheme: PropTypes.func,\n\n /**\n * The locale to be used.\n * Defaults to the browser's configured locale or \"en-US\" if not available.\n */\n locale: PropTypes.string,\n\n /**\n * Custom JSS's class name generator.\n */\n generateClassName: PropTypes.func,\n /**\n * Built-in JSS's class name generator options.\n * Ignored if a custom `generateClassName` is provided.\n *\n * `disableGlobal`: Disable the generation of deterministic class names. Defaults to `false`.\n *\n * `productionPrefix`: The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n *\n * `seed`: The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n generateClassNameOptions: PropTypes.shape({\n /**\n * Disable the generation of deterministic class names. Defaults to `false`.\n */\n disableGlobal: PropTypes.bool,\n /**\n * The string used to prefix the class names in production. Defaults to `\"jss-uikit\"`.\n */\n productionPrefix: PropTypes.string,\n /**\n * The string used to uniquely identify the generator. Defaults to `\"\"`.\n * It can be used to avoid class name collisions when using multiple generators in the same document.\n */\n seed: PropTypes.string,\n }),\n /**\n * Disables the generation of the styles.\n */\n disableStylesGeneration: PropTypes.bool,\n /**\n * By default the baseline styles are applied globally to the application.\n * If you need to scope the CSS to avoid styling conflicts, you can set this prop to `\"scoped\"`.\n * If you are providing the baseline styles, you can set this prop to false.\n *\n * @see https://lumada-design.github.io/uikit/master/?path=/docs/theme-css-baseline--page\n */\n cssBaseline: PropTypes.oneOf([\"global\", \"scoped\", \"none\"]),\n};\n\nexport default HvProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAQA;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,CAACC,gBAAD,EAAmBC,gBAAnB,EAAwC;EAC/D,IAAMC,eAAe,GAAG,IA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DD;;AA0DA,wCAAAD,UAAU,CAACyB,SAAX,GAAuB;EACrB;AACF;AACA;EACExB,QAAQ,EAAEyB,kBAAA,CAAUC,IAAV,CAAeC,UAJJ;;EAMrB;AACF;AACA;EACE1B,UAAU,EAAEwB,kBAAA,CAAUG,KAAV,CAAgB,CAAC,MAAD,EAAS,QAAT,CAAhB,CATS;;EAUrB;AACF;AACA;EACE1B,KAAK,EAAEuB,kBAAA,CAAUI,UAAV,CAAqBC,MAArB,CAbc;;EAcrB;AACF;AACA;AACA;EACE3B,WAAW,EAAEsB,kBAAA,CAAUM,IAlBF;;EAoBrB;AACF;AACA;AACA;EACE3B,MAAM,EAAEqB,kBAAA,CAAUO,MAxBG;;EA0BrB;AACF;AACA;EACE1B,iBAAiB,EAAEmB,kBAAA,CAAUM,IA7BR;;EA8BrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACExB,wBAAwB,EAAEkB,kBAAA,CAAUQ,KAAV,CAAgB;IACxC;AACJ;AACA;IACIC,aAAa,EAAET,kBAAA,CAAUU,IAJe;;IAKxC;AACJ;AACA;IACIC,gBAAgB,EAAEX,kBAAA,CAAUO,MARY;;IASxC;AACJ;AACA;AACA;IACIK,IAAI,EAAEZ,kBAAA,CAAUO;EAbwB,CAAhB,CAzCL;;EAwDrB;AACF;AACA;EACExB,uBAAuB,EAAEiB,kBAAA,CAAUU,IA3Dd;;EA4DrB;AACF;AACA;AACA;AACA;AACA;AACA;EACE1B,WAAW,EAAEgB,kBAAA,CAAUG,KAAV,CAAgB,CAAC,QAAD,EAAW,QAAX,EAAqB,MAArB,CAAhB;AAnEQ,CAAvB;eAsEe7B,U"}
@@ -1,17 +1,16 @@
1
- import { FunctionComponent } from "react";
2
-
3
- export type GridSpacing = "xs" | "sm" | "md" | "lg";
4
- export type Breakpoints = {
1
+ export type Spacing = "xs" | "sm" | "md" | "lg";
2
+ export type Breakpoint = {
5
3
  cols?: number;
6
4
  maxWidth?: number;
7
5
  minWidth?: number;
8
- spacing?: GridSpacing;
6
+ spacing?: Spacing;
9
7
  };
10
8
 
11
- export interface SimpleGridProps extends FunctionComponent {
12
- spacing?: GridSpacing;
9
+ export interface SimpleGridProps {
10
+ children?: JSX.Element | JSX.Element[];
11
+ spacing?: Spacing;
13
12
  cols?: number;
14
- breakpoints?: Breakpoints;
13
+ breakpoints?: Breakpoint[];
15
14
  }
16
15
 
17
16
  export default function HvSimpleGrid(props: SimpleGridProps): JSX.Element | null;
@@ -9,6 +9,10 @@ export interface HvTableBodyProps
9
9
  * Defaults to `thead`.
10
10
  */
11
11
  component?: React.ElementType<React.HTMLAttributes<HTMLElement>>;
12
+ /**
13
+ * Sets whether or not there should be arrow navigation between the table rows
14
+ */
15
+ withNavigation?: boolean;
12
16
  }
13
17
 
14
18
  export default function HvTableBody(props: HvTableBodyProps): JSX.Element | null;
@@ -43,6 +43,54 @@ Object.defineProperty(exports, "HvSwitchColumnCell", {
43
43
  return _SwitchColumnCell.default;
44
44
  }
45
45
  });
46
+ Object.defineProperty(exports, "hvDateColumn", {
47
+ enumerable: true,
48
+ get: function get() {
49
+ return _renderers.hvDateColumn;
50
+ }
51
+ });
52
+ Object.defineProperty(exports, "hvDropdownColumn", {
53
+ enumerable: true,
54
+ get: function get() {
55
+ return _renderers.hvDropdownColumn;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, "hvExpandColumn", {
59
+ enumerable: true,
60
+ get: function get() {
61
+ return _renderers.hvExpandColumn;
62
+ }
63
+ });
64
+ Object.defineProperty(exports, "hvNumberColumn", {
65
+ enumerable: true,
66
+ get: function get() {
67
+ return _renderers.hvNumberColumn;
68
+ }
69
+ });
70
+ Object.defineProperty(exports, "hvProgressColumn", {
71
+ enumerable: true,
72
+ get: function get() {
73
+ return _renderers.hvProgressColumn;
74
+ }
75
+ });
76
+ Object.defineProperty(exports, "hvSwitchColumn", {
77
+ enumerable: true,
78
+ get: function get() {
79
+ return _renderers.hvSwitchColumn;
80
+ }
81
+ });
82
+ Object.defineProperty(exports, "hvTagColumn", {
83
+ enumerable: true,
84
+ get: function get() {
85
+ return _renderers.hvTagColumn;
86
+ }
87
+ });
88
+ Object.defineProperty(exports, "hvTextColumn", {
89
+ enumerable: true,
90
+ get: function get() {
91
+ return _renderers.hvTextColumn;
92
+ }
93
+ });
46
94
  Object.defineProperty(exports, "normalizeProgressBar", {
47
95
  enumerable: true,
48
96
  get: function get() {
@@ -50,6 +98,8 @@ Object.defineProperty(exports, "normalizeProgressBar", {
50
98
  }
51
99
  });
52
100
 
101
+ var _renderers = require("./renderers");
102
+
53
103
  var _DateColumnCell = _interopRequireDefault(require("./DateColumnCell"));
54
104
 
55
105
  var _DropdownColumnCell = _interopRequireDefault(require("./DropdownColumnCell"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/Table/renderers/index.js"],"sourcesContent":["export { default as HvDateColumnCell } from \"./DateColumnCell\";\nexport { default as HvDropdownColumnCell } from \"./DropdownColumnCell\";\nexport { default as HvProgressColumnCell, normalizeProgressBar } from \"./ProgressColumnCell\";\nexport { default as HvSwitchColumnCell } from \"./SwitchColumnCell\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/Table/renderers/index.js"],"sourcesContent":["export {\n hvTextColumn,\n hvNumberColumn,\n hvDateColumn,\n hvExpandColumn,\n hvTagColumn,\n hvSwitchColumn,\n hvDropdownColumn,\n hvProgressColumn,\n} from \"./renderers\";\nexport { default as HvDateColumnCell } from \"./DateColumnCell\";\nexport { default as HvDropdownColumnCell } from \"./DropdownColumnCell\";\nexport { default as HvProgressColumnCell, normalizeProgressBar } from \"./ProgressColumnCell\";\nexport { default as HvSwitchColumnCell } from \"./SwitchColumnCell\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAUA;;AACA;;AACA;;AACA"}
@@ -19,14 +19,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
19
19
  Object.defineProperty(exports, "__esModule", {
20
20
  value: true
21
21
  });
22
- exports.hvDateColumn = void 0;
22
+ exports.hvDateColumn = hvDateColumn;
23
23
  exports.hvDropdownColumn = hvDropdownColumn;
24
24
  exports.hvExpandColumn = hvExpandColumn;
25
- exports.hvNumberColumn = void 0;
25
+ exports.hvNumberColumn = hvNumberColumn;
26
26
  exports.hvProgressColumn = hvProgressColumn;
27
27
  exports.hvSwitchColumn = hvSwitchColumn;
28
28
  exports.hvTagColumn = hvTagColumn;
29
- exports.hvTextColumn = void 0;
29
+ exports.hvTextColumn = hvTextColumn;
30
30
 
31
31
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
32
32
 
@@ -62,7 +62,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
62
62
 
63
63
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
64
64
 
65
- var hvTextColumn = function hvTextColumn(col) {
65
+ function hvTextColumn(col) {
66
66
  return _objectSpread({
67
67
  Cell: function Cell(cellProps) {
68
68
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_OverflowTooltip.default, {
@@ -71,11 +71,9 @@ var hvTextColumn = function hvTextColumn(col) {
71
71
  },
72
72
  sortType: "alphanumeric"
73
73
  }, col);
74
- };
75
-
76
- exports.hvTextColumn = hvTextColumn;
74
+ }
77
75
 
78
- var hvNumberColumn = function hvNumberColumn(col) {
76
+ function hvNumberColumn(col) {
79
77
  return _objectSpread({
80
78
  Cell: function Cell(_ref) {
81
79
  var value = _ref.value;
@@ -84,11 +82,9 @@ var hvNumberColumn = function hvNumberColumn(col) {
84
82
  align: "right",
85
83
  sortType: "number"
86
84
  }, col);
87
- };
88
-
89
- exports.hvNumberColumn = hvNumberColumn;
85
+ }
90
86
 
91
- var hvDateColumn = function hvDateColumn(col, dateFormat) {
87
+ function hvDateColumn(col, dateFormat) {
92
88
  return _objectSpread({
93
89
  Cell: function Cell(cellProps) {
94
90
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DateColumnCell.default, {
@@ -99,9 +95,7 @@ var hvDateColumn = function hvDateColumn(col, dateFormat) {
99
95
  sortType: "alphanumeric",
100
96
  sortDescFirst: true
101
97
  }, col);
102
- };
103
-
104
- exports.hvDateColumn = hvDateColumn;
98
+ }
105
99
 
106
100
  function hvExpandColumn(col, expandRowButtonAriaLabel, collapseRowButtonAriaLabel, getCanRowExpand) {
107
101
  return _objectSpread({
@@ -1 +1 @@
1
- {"version":3,"file":"renderers.js","names":["hvTextColumn","col","Cell","cellProps","hvStringFallback","value","sortType","hvNumberColumn","hvNumberFallback","align","hvDateColumn","dateFormat","sortDescFirst","hvExpandColumn","expandRowButtonAriaLabel","collapseRowButtonAriaLabel","getCanRowExpand","row","getToggleRowExpandedProps","onClick","hasContent","isExpanded","position","left","top","cellStyle","hvTagColumn","valueDataKey","colorDataKey","textColorDataKey","fromRowData","tagProps","original","name","color","textColor","paddingTop","paddingBottom","hvSwitchColumn","switchLabel","falseLabel","trueLabel","switchProps","id","hvDropdownColumn","placeholder","disabledPlaceholder","onChange","column","dsbld","length","val","setId","hvProgressColumn","getPartial","getTotal","partial","total"],"sources":["../../../src/Table/renderers/renderers.js"],"sourcesContent":["import React from \"react\";\nimport { DropDownXS, DropRightXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport HvButton from \"../../Button\";\nimport HvTag from \"../../Tag\";\nimport HvTypography from \"../../Typography\";\nimport HvOverflowTooltip from \"../../OverflowTooltip\";\nimport { setId } from \"../../utils\";\n\nimport DateColumnCell from \"./DateColumnCell\";\nimport SwitchColumnCell from \"./SwitchColumnCell\";\nimport ProgressColumnCell from \"./ProgressColumnCell\";\nimport DropdownColumnCell from \"./DropdownColumnCell\";\nimport { hvStringFallback, hvNumberFallback } from \"../utils\";\n\nexport const hvTextColumn = (col) => {\n return {\n Cell: (cellProps) => <HvOverflowTooltip data={hvStringFallback(cellProps?.value)} />,\n sortType: \"alphanumeric\",\n ...col,\n };\n};\n\nexport const hvNumberColumn = (col) => {\n return {\n Cell: ({ value }) => hvNumberFallback(value),\n align: \"right\",\n sortType: \"number\",\n ...col,\n };\n};\n\nexport const hvDateColumn = (col, dateFormat) => {\n return {\n Cell: (cellProps) => <DateColumnCell date={cellProps?.value} dateFormat={dateFormat} />,\n sortType: \"alphanumeric\",\n sortDescFirst: true,\n ...col,\n };\n};\n\nexport function hvExpandColumn(\n col,\n expandRowButtonAriaLabel,\n collapseRowButtonAriaLabel,\n getCanRowExpand\n) {\n return {\n Cell: (cellProps) => {\n const { value, row } = cellProps;\n const { onClick } = row.getToggleRowExpandedProps();\n\n const hasContent = getCanRowExpand?.(row) ?? true;\n\n return (\n <>\n {hasContent && (\n <HvButton\n icon\n category=\"ghost\"\n aria-label={row.isExpanded ? collapseRowButtonAriaLabel : expandRowButtonAriaLabel}\n aria-expanded={row.isExpanded}\n onClick={onClick}\n style={{ position: \"absolute\", left: 0, top: 0 }}\n >\n {row.isExpanded ? <DropDownXS /> : <DropRightXS />}\n </HvButton>\n )}\n\n <HvOverflowTooltip data={hvStringFallback(value)} />\n </>\n );\n },\n sortType: \"alphanumeric\",\n cellStyle: {\n position: \"relative\",\n },\n ...col,\n };\n}\n\nexport function hvTagColumn(\n col,\n valueDataKey,\n colorDataKey,\n textColorDataKey,\n fromRowData = false,\n tagProps\n) {\n return {\n Cell: (cellProps) => {\n const { value, row } = cellProps;\n if (!value) {\n return \"—\";\n }\n\n const {\n [valueDataKey]: name,\n [colorDataKey]: color,\n [textColorDataKey]: textColor,\n } = fromRowData ? row.original : value;\n\n return (\n <HvTag\n label={<HvTypography variant=\"normalText\">{name}</HvTypography>}\n type=\"semantic\"\n color={color}\n style={textColor != null ? { color: textColor } : {}}\n tabIndex={-1}\n {...tagProps}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvSwitchColumn(col, switchLabel, falseLabel, trueLabel, switchProps) {\n return {\n Cell: (cellProps) => {\n const { value, row } = cellProps;\n return (\n <SwitchColumnCell\n checked={value}\n value={row.id}\n switchLabel={switchLabel}\n falseLabel={falseLabel}\n trueLabel={trueLabel}\n switchProps={switchProps}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvDropdownColumn(col, id, placeholder, disabledPlaceholder, onChange) {\n return {\n Cell: (cellProps) => {\n const { value, row, column } = cellProps;\n const dsbld = value.length < 1;\n return (\n <DropdownColumnCell\n values={value}\n placeholder={dsbld ? disabledPlaceholder : placeholder}\n onChange={(val) => onChange?.(row.id, val)}\n disabled={dsbld}\n dropdownProps={{\n \"aria-labelledby\": setId(id, column.id),\n }}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvProgressColumn(col, getPartial, getTotal, color) {\n return {\n Cell: (cellProps) => {\n const { row } = cellProps;\n const partial = getPartial?.(row);\n const total = getTotal?.(row);\n\n if (total) {\n return <ProgressColumnCell partial={partial} total={total} color={color} />;\n }\n\n return \"—\";\n },\n\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA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AG5C,KAAK,CAAC6C,MAAN,GAAe,CAA7B;MACA,oBACE,qBAAC,2BAAD;QACE,MAAM,EAAE7C,KADV;QAEE,WAAW,EAAE4C,KAAK,GAAGH,mBAAH,GAAyBD,WAF7C;QAGE,QAAQ,EAAE,kBAACM,GAAD;UAAA,OAASJ,SAAT,aAASA,SAAT,uBAASA,SAAQ,CAAG9B,GAAG,CAAC0B,EAAP,EAAWQ,GAAX,CAAjB;QAAA,CAHZ;QAIE,QAAQ,EAAEF,KAJZ;QAKE,aAAa,EAAE;UACb,mBAAmB,IAAAG,YAAA,EAAMT,EAAN,EAAUK,MAAM,CAACL,EAAjB;QADN;MALjB,EADF;IAWD,CAfH;IAgBElB,SAAS,EAAE;MACTW,UAAU,EAAE,CADH;MAETC,aAAa,EAAE;IAFN;EAhBb,GAoBKpC,GApBL;AAsBD;;AAEM,SAASoD,gBAAT,CAA0BpD,GAA1B,EAA+BqD,UAA/B,EAA2CC,QAA3C,EAAqDrB,KAArD,EAA4D;EACjE;IACEhC,IAAI,EAAE,cAACC,SAAD,EAAe;MACnB,IAAQc,GAAR,GAAgBd,SAAhB,CAAQc,GAAR;MACA,IAAMuC,OAAO,GAAGF,UAAH,aAAGA,UAAH,uBAAGA,UAAU,CAAGrC,GAAH,CAA1B;MACA,IAAMwC,KAAK,GAAGF,QAAH,aAAGA,QAAH,uBAAGA,QAAQ,CAAGtC,GAAH,CAAtB;;MAEA,IAAIwC,KAAJ,EAAW;QACT,oBAAO,qBAAC,2BAAD;UAAoB,OAAO,EAAED,OAA7B;UAAsC,KAAK,EAAEC,KAA7C;UAAoD,KAAK,EAAEvB;QAA3D,EAAP;MACD;;MAED,OAAO,GAAP;IACD,CAXH;IAaET,SAAS,EAAE;MACTW,UAAU,EAAE,CADH;MAETC,aAAa,EAAE;IAFN;EAbb,GAiBKpC,GAjBL;AAmBD"}
1
+ {"version":3,"file":"renderers.js","names":["hvTextColumn","col","Cell","cellProps","hvStringFallback","value","sortType","hvNumberColumn","hvNumberFallback","align","hvDateColumn","dateFormat","sortDescFirst","hvExpandColumn","expandRowButtonAriaLabel","collapseRowButtonAriaLabel","getCanRowExpand","row","getToggleRowExpandedProps","onClick","hasContent","isExpanded","position","left","top","cellStyle","hvTagColumn","valueDataKey","colorDataKey","textColorDataKey","fromRowData","tagProps","original","name","color","textColor","paddingTop","paddingBottom","hvSwitchColumn","switchLabel","falseLabel","trueLabel","switchProps","id","hvDropdownColumn","placeholder","disabledPlaceholder","onChange","column","dsbld","length","val","setId","hvProgressColumn","getPartial","getTotal","partial","total"],"sources":["../../../src/Table/renderers/renderers.js"],"sourcesContent":["import React from \"react\";\nimport { DropDownXS, DropRightXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport HvButton from \"../../Button\";\nimport HvTag from \"../../Tag\";\nimport HvTypography from \"../../Typography\";\nimport HvOverflowTooltip from \"../../OverflowTooltip\";\nimport { setId } from \"../../utils\";\n\nimport DateColumnCell from \"./DateColumnCell\";\nimport SwitchColumnCell from \"./SwitchColumnCell\";\nimport ProgressColumnCell from \"./ProgressColumnCell\";\nimport DropdownColumnCell from \"./DropdownColumnCell\";\nimport { hvStringFallback, hvNumberFallback } from \"../utils\";\n\nexport function hvTextColumn(col) {\n return {\n Cell: (cellProps) => <HvOverflowTooltip data={hvStringFallback(cellProps?.value)} />,\n sortType: \"alphanumeric\",\n ...col,\n };\n}\n\nexport function hvNumberColumn(col) {\n return {\n Cell: ({ value }) => hvNumberFallback(value),\n align: \"right\",\n sortType: \"number\",\n ...col,\n };\n}\n\nexport function hvDateColumn(col, dateFormat) {\n return {\n Cell: (cellProps) => <DateColumnCell date={cellProps?.value} dateFormat={dateFormat} />,\n sortType: \"alphanumeric\",\n sortDescFirst: true,\n ...col,\n };\n}\n\nexport function hvExpandColumn(\n col,\n expandRowButtonAriaLabel,\n collapseRowButtonAriaLabel,\n getCanRowExpand\n) {\n return {\n Cell: (cellProps) => {\n const { value, row } = cellProps;\n const { onClick } = row.getToggleRowExpandedProps();\n\n const hasContent = getCanRowExpand?.(row) ?? true;\n\n return (\n <>\n {hasContent && (\n <HvButton\n icon\n category=\"ghost\"\n aria-label={row.isExpanded ? collapseRowButtonAriaLabel : expandRowButtonAriaLabel}\n aria-expanded={row.isExpanded}\n onClick={onClick}\n style={{ position: \"absolute\", left: 0, top: 0 }}\n >\n {row.isExpanded ? <DropDownXS /> : <DropRightXS />}\n </HvButton>\n )}\n\n <HvOverflowTooltip data={hvStringFallback(value)} />\n </>\n );\n },\n sortType: \"alphanumeric\",\n cellStyle: {\n position: \"relative\",\n },\n ...col,\n };\n}\n\nexport function hvTagColumn(\n col,\n valueDataKey,\n colorDataKey,\n textColorDataKey,\n fromRowData = false,\n tagProps\n) {\n return {\n Cell: (cellProps) => {\n const { value, row } = cellProps;\n if (!value) {\n return \"—\";\n }\n\n const {\n [valueDataKey]: name,\n [colorDataKey]: color,\n [textColorDataKey]: textColor,\n } = fromRowData ? row.original : value;\n\n return (\n <HvTag\n label={<HvTypography variant=\"normalText\">{name}</HvTypography>}\n type=\"semantic\"\n color={color}\n style={textColor != null ? { color: textColor } : {}}\n tabIndex={-1}\n {...tagProps}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvSwitchColumn(col, switchLabel, falseLabel, trueLabel, switchProps) {\n return {\n Cell: (cellProps) => {\n const { value, row } = cellProps;\n return (\n <SwitchColumnCell\n checked={value}\n value={row.id}\n switchLabel={switchLabel}\n falseLabel={falseLabel}\n trueLabel={trueLabel}\n switchProps={switchProps}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvDropdownColumn(col, id, placeholder, disabledPlaceholder, onChange) {\n return {\n Cell: (cellProps) => {\n const { value, row, column } = cellProps;\n const dsbld = value.length < 1;\n return (\n <DropdownColumnCell\n values={value}\n placeholder={dsbld ? disabledPlaceholder : placeholder}\n onChange={(val) => onChange?.(row.id, val)}\n disabled={dsbld}\n dropdownProps={{\n \"aria-labelledby\": setId(id, column.id),\n }}\n />\n );\n },\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n\nexport function hvProgressColumn(col, getPartial, getTotal, color) {\n return {\n Cell: (cellProps) => {\n const { row } = cellProps;\n const partial = getPartial?.(row);\n const total = getTotal?.(row);\n\n if (total) {\n return <ProgressColumnCell partial={partial} total={total} color={color} />;\n }\n\n return \"—\";\n },\n\n cellStyle: {\n paddingTop: 0,\n paddingBottom: 0,\n },\n ...col,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEO,SAASA,YAAT,CAAsBC,GAAtB,EAA2B;EAChC;IACEC,IAAI,EAAE,cAACC,SAAD;MAAA,oBAAe,qBAAC,wBAAD;QAAmB,IAAI,EAAE,IAAAC,wBAAA,EAAiBD,SAAjB,aAAiBA,SAAjB,uBAAiBA,SAAS,CAAEE,KAA5B;MAAzB,EAAf;IAAA,CADR;IAEEC,QAAQ,EAAE;EAFZ,GAGKL,GAHL;AAKD;;AAEM,SAASM,cAAT,CAAwBN,GAAxB,EAA6B;EAClC;IACEC,IAAI,EAAE;MAAA,IAAGG,KAAH,QAAGA,KAAH;MAAA,OAAe,IAAAG,wBAAA,EAAiBH,KAAjB,CAAf;IAAA,CADR;IAEEI,KAAK,EAAE,OAFT;IAGEH,QAAQ,EAAE;EAHZ,GAIKL,GAJL;AAMD;;AAEM,SAASS,YAAT,CAAsBT,GAAtB,EAA2BU,UAA3B,EAAuC;EAC5C;IACET,IAAI,EAAE,cAACC,SAAD;MAAA,oBAAe,qBAAC,uBAAD;QAAgB,IAAI,EAAEA,SAAF,aAAEA,SAAF,uBAAEA,SAAS,CAAEE,KAAjC;QAAwC,UAAU,EAAEM;MAApD,EAAf;IAAA,CADR;IAEEL,QAAQ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H,uBAAGA,QAAQ,CAAGtC,GAAH,CAAtB;;MAEA,IAAIwC,KAAJ,EAAW;QACT,oBAAO,qBAAC,2BAAD;UAAoB,OAAO,EAAED,OAA7B;UAAsC,KAAK,EAAEC,KAA7C;UAAoD,KAAK,EAAEvB;QAA3D,EAAP;MACD;;MAED,OAAO,GAAP;IACD,CAXH;IAaET,SAAS,EAAE;MACTW,UAAU,EAAE,CADH;MAETC,aAAa,EAAE;IAFN;EAbb,GAiBKpC,GAjBL;AAmBD"}
package/dist/Tag/Tag.js CHANGED
@@ -95,8 +95,6 @@ var getColor = function getColor(theme, customColor, type) {
95
95
 
96
96
 
97
97
  var HvTag = function HvTag(props) {
98
- var _HvTypography;
99
-
100
98
  var classes = props.classes,
101
99
  style = props.style,
102
100
  className = props.className,
@@ -158,18 +156,8 @@ var HvTag = function HvTag(props) {
158
156
  hover = _useState2[0],
159
157
  setHover = _useState2[1];
160
158
 
161
- var chipLabel = (0, _react.useMemo)(function () {
162
- if (typeof label === "string") {
163
- return _HvTypography || (_HvTypography = /*#__PURE__*/(0, _jsxRuntime.jsx)(_.HvTypography, {
164
- variant: "normalText",
165
- children: label
166
- }));
167
- }
168
-
169
- return label;
170
- }, [label]);
171
159
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, _objectSpread({
172
- label: chipLabel,
160
+ label: label,
173
161
  className: (0, _clsx.default)(classes.root, className),
174
162
  onMouseEnter: function onMouseEnter() {
175
163
  setHover(!!onClick);
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.js","names":["getColor","theme","customColor","type","defaultSemanticColor","hv","palette","semantic","sema7","defaultCategoricalColor","viz","categorical","cviz1","backgroundColor","HvTag","props","classes","style","className","label","disabled","color","deleteIcon","onDelete","onClick","role","deleteButtonArialLabel","deleteButtonProps","others","getDeleteIcon","disabledSemanticColor","tabIndex","startIcon","tagButton","focusVisible","primary","primaryButton","cursor","undefined","height","useTheme","inlineStyle","categoricalBackgroundColor","fade","useState","hover","setHover","chipLabel","useMemo","clsx","root","boxShadow","chipRoot","clickable","categoricalDisabled","categoricalFocus","disabledDeleteIcon","hasDeleteAction","getOnDeleteCallback","hasClickAction","propTypes","PropTypes","shape","string","titleOverflow","semanticTextColor","categoricalTextColor","deletable","isRequired","instanceOf","Object","node","bool","oneOf","func","withStyles","styles","name"],"sources":["../../src/Tag/Tag.js"],"sourcesContent":["import React, { useMemo, useState } from \"react\";\nimport { Chip } from \"@mui/material\";\nimport { withStyles, useTheme } from \"@mui/styles\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { CloseXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport fade from \"../utils/hexToRgbA\";\nimport { HvButton, HvTypography } from \"..\";\nimport styles from \"./styles\";\nimport { getOnDeleteCallback, hasDeleteAction, hasClickAction } from \"./utils\";\n\nconst getColor = (theme, customColor, type) => {\n const defaultSemanticColor = theme.hv.palette.semantic.sema7;\n const defaultCategoricalColor = theme.hv.viz.palette.categorical.cviz1;\n\n let backgroundColor;\n\n if (type === \"semantic\") {\n backgroundColor = theme.palette[customColor] || customColor || defaultSemanticColor;\n }\n if (type === \"categorical\") {\n backgroundColor =\n theme.hv.viz.palette.categorical[customColor] || customColor || defaultCategoricalColor;\n }\n\n return backgroundColor;\n};\n\n/**\n * A Tag is one word that describes a specific aspect of an asset. A single asset can have\n * multiple tags.\n * Use tags to highlight an item's status for quick recognition and navigation\n * Use color to indicate meanings that users can learn and recognize across products\n *\n * It leverages the Chip component from Material UI\n */\nconst HvTag = (props) => {\n const {\n classes,\n style,\n className,\n label,\n disabled,\n type = \"semantic\",\n color,\n deleteIcon,\n onDelete,\n onClick,\n role,\n deleteButtonArialLabel = \"Delete tag\",\n deleteButtonProps = {},\n ...others\n } = props;\n\n const getDeleteIcon = () => {\n const disabledSemanticColor = type === \"semantic\" ? \"atmo5\" : \"base2\";\n const { tabIndex = 0 } = deleteButtonProps;\n\n return (\n <HvButton\n classes={{\n startIcon: classes.tagButton,\n focusVisible: classes.focusVisible,\n primary: classes.primaryButton,\n }}\n aria-label={deleteButtonArialLabel}\n tabIndex={tabIndex}\n {...deleteButtonProps}\n >\n <CloseXS\n iconSize=\"XS\"\n style={{\n ...(disabled ? { cursor: \"not-allowed\" } : undefined),\n height: 16,\n }}\n color={disabled ? disabledSemanticColor : \"base2\"}\n />\n </HvButton>\n );\n };\n\n const theme = useTheme();\n\n const inlineStyle = {\n ...style,\n };\n\n let categoricalBackgroundColor;\n\n if (type === \"semantic\") {\n inlineStyle.backgroundColor = getColor(theme, color, type);\n } else if (type === \"categorical\") {\n categoricalBackgroundColor = getColor(theme, color, type);\n\n inlineStyle.backgroundColor = fade(categoricalBackgroundColor, 0.3);\n }\n\n const [hover, setHover] = useState(false);\n\n const chipLabel = useMemo(() => {\n if (typeof label === \"string\") {\n return <HvTypography variant=\"normalText\">{label}</HvTypography>;\n }\n\n return label;\n }, [label]);\n\n return (\n <Chip\n label={chipLabel}\n className={clsx(classes.root, className)}\n onMouseEnter={() => {\n setHover(!!onClick);\n }}\n onMouseLeave={() => {\n setHover(false);\n }}\n style={{\n ...(disabled ? null : inlineStyle),\n ...(hover && !disabled ? { boxShadow: `0 0 0 1pt ${categoricalBackgroundColor}` } : null),\n }}\n classes={{\n root: clsx(classes.chipRoot, {\n [classes.disabled]: disabled,\n [classes.clickable]: !!onClick,\n [classes.categorical]: type === \"categorical\",\n [classes.categoricalFocus]: type === \"categorical\" && !disabled,\n [classes.categoricalDisabled]: type === \"categorical\" && disabled,\n }),\n label: classes.label,\n deleteIcon: clsx(classes.deleteIcon, {\n [classes.disabledDeleteIcon]: disabled,\n }),\n }}\n deleteIcon={(hasDeleteAction(onDelete) && deleteIcon) || getDeleteIcon()}\n onDelete={getOnDeleteCallback(disabled, onDelete)}\n onClick={disabled ? undefined : onClick}\n role={role || (hasClickAction(onClick) ? \"button\" : undefined)}\n tabIndex={hasDeleteAction(onDelete) ? undefined : 0}\n {...others}\n />\n );\n};\n\nHvTag.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied to the radio button.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n chipRoot: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n label: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n tagButton: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n deleteIcon: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n disabledDeleteIcon: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n titleOverflow: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n categorical: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n categoricalDisabled: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n disabled: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n semanticTextColor: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n categoricalTextColor: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n deletable: PropTypes.string,\n /**\n * Styles applied to the component if has onClick.\n */\n clickable: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n focusVisible: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n primaryButton: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n categoricalFocus: PropTypes.string,\n }).isRequired,\n\n /**\n * Inline styles to be applied to the root element.\n */\n style: PropTypes.instanceOf(Object),\n\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n\n /**\n * The label of the tag element.\n *\n */\n label: PropTypes.node,\n\n /**\n * Indicates that the form element is disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * The type of the tag element.\n *\n * A tag can be of semantic or categoric type\n */\n type: PropTypes.oneOf([\"semantic\", \"categorical\"]),\n\n /**\n * Background color to be applied to the tag\n */\n color: PropTypes.string,\n /**\n * Icon used to customize the delete icon in the Chip element\n */\n deleteIcon: PropTypes.node,\n\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component,\n * in order to render the delete icon\n */\n onDelete: PropTypes.func,\n /**\n * Callback triggered when any item is clicked.\n */\n onClick: PropTypes.func,\n\n /**\n * The role of the element with an attributed event.\n */\n role: PropTypes.string,\n /**\n * Aria properties to apply to delete button in tag\n */\n deleteButtonArialLabel: PropTypes.string,\n /**\n * Props to apply to delete button\n */\n deleteButtonProps: PropTypes.instanceOf(Object),\n};\n\nexport default withStyles(styles, { name: \"HvTag\" })(HvTag);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAQC,WAAR,EAAqBC,IAArB,EAA8B;EAC7C,IAAMC,oBAAoB,GAAGH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,QAAjB,CAA0BC,KAAvD;EACA,IAAMC,uBAAuB,GAAGR,KAAK,CAACI,EAAN,CAASK,GAAT,CAAaJ,OAAb,CAAqBK,WAArB,CAAiCC,KAAjE;EAEA,IAAIC,eAAJ;;EAEA,IAAIV,IAAI,KAAK,UAAb,EAAyB;IACvBU,eAAe,GAAGZ,KAAK,CAACK,OAAN,CAAcJ,WAAd,KAA8BA,WAA9B,IAA6CE,oBAA/D;EACD;;EACD,IAAID,IAAI,KAAK,aAAb,EAA4B;IAC1BU,eAAe,GACbZ,KAAK,CAACI,EAAN,CAASK,GAAT,CAAaJ,OAAb,CAAqBK,WAArB,CAAiCT,WAAjC,KAAiDA,WAAjD,IAAgEO,uBADlE;EAED;;EAED,OAAOI,eAAP;AACD,CAfD;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD,EAAW;EAAA;;EACvB,IACEC,OADF,GAeID,KAfJ,CACEC,OADF;EAAA,IAEEC,KAFF,GAeIF,KAfJ,CAEEE,KAFF;EAAA,IAGEC,SAHF,GAeIH,KAfJ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,UAAD,EAAa,aAAb,CAAhB,CArGU;;EAuGhB;AACF;AACA;EACEpD,KAAK,EAAEwC,kBAAA,CAAUE,MA1GD;;EA2GhB;AACF;AACA;EACEzC,UAAU,EAAEuC,kBAAA,CAAUU,IA9GN;;EAgHhB;AACF;AACA;AACA;AACA;EACEhD,QAAQ,EAAEsC,kBAAA,CAAUa,IArHJ;;EAsHhB;AACF;AACA;EACElD,OAAO,EAAEqC,kBAAA,CAAUa,IAzHH;;EA2HhB;AACF;AACA;EACEjD,IAAI,EAAEoC,kBAAA,CAAUE,MA9HA;;EA+HhB;AACF;AACA;EACErC,sBAAsB,EAAEmC,kBAAA,CAAUE,MAlIlB;;EAmIhB;AACF;AACA;EACEpC,iBAAiB,EAAEkC,kBAAA,CAAUQ,UAAV,CAAqBC,MAArB;AAtIH,CAAlB;;eAyIe,IAAAK,kBAAA,EAAWC,gBAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAsC/D,KAAtC,C"}
1
+ {"version":3,"file":"Tag.js","names":["getColor","theme","customColor","type","defaultSemanticColor","hv","palette","semantic","sema7","defaultCategoricalColor","viz","categorical","cviz1","backgroundColor","HvTag","props","classes","style","className","label","disabled","color","deleteIcon","onDelete","onClick","role","deleteButtonArialLabel","deleteButtonProps","others","getDeleteIcon","disabledSemanticColor","tabIndex","startIcon","tagButton","focusVisible","primary","primaryButton","cursor","undefined","height","useTheme","inlineStyle","categoricalBackgroundColor","fade","useState","hover","setHover","clsx","root","boxShadow","chipRoot","clickable","categoricalDisabled","categoricalFocus","disabledDeleteIcon","hasDeleteAction","getOnDeleteCallback","hasClickAction","propTypes","PropTypes","shape","string","titleOverflow","semanticTextColor","categoricalTextColor","deletable","isRequired","instanceOf","Object","node","bool","oneOf","func","withStyles","styles","name"],"sources":["../../src/Tag/Tag.js"],"sourcesContent":["import React, { useState } from \"react\";\nimport { Chip } from \"@mui/material\";\nimport { withStyles, useTheme } from \"@mui/styles\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { CloseXS } from \"@hitachivantara/uikit-react-icons\";\nimport fade from \"../utils/hexToRgbA\";\nimport { HvButton } from \"..\";\nimport styles from \"./styles\";\nimport { getOnDeleteCallback, hasDeleteAction, hasClickAction } from \"./utils\";\n\nconst getColor = (theme, customColor, type) => {\n const defaultSemanticColor = theme.hv.palette.semantic.sema7;\n const defaultCategoricalColor = theme.hv.viz.palette.categorical.cviz1;\n\n let backgroundColor;\n\n if (type === \"semantic\") {\n backgroundColor = theme.palette[customColor] || customColor || defaultSemanticColor;\n }\n if (type === \"categorical\") {\n backgroundColor =\n theme.hv.viz.palette.categorical[customColor] || customColor || defaultCategoricalColor;\n }\n\n return backgroundColor;\n};\n\n/**\n * A Tag is one word that describes a specific aspect of an asset. A single asset can have\n * multiple tags.\n * Use tags to highlight an item's status for quick recognition and navigation\n * Use color to indicate meanings that users can learn and recognize across products\n *\n * It leverages the Chip component from Material UI\n */\nconst HvTag = (props) => {\n const {\n classes,\n style,\n className,\n label,\n disabled,\n type = \"semantic\",\n color,\n deleteIcon,\n onDelete,\n onClick,\n role,\n deleteButtonArialLabel = \"Delete tag\",\n deleteButtonProps = {},\n ...others\n } = props;\n\n const getDeleteIcon = () => {\n const disabledSemanticColor = type === \"semantic\" ? \"atmo5\" : \"base2\";\n const { tabIndex = 0 } = deleteButtonProps;\n\n return (\n <HvButton\n classes={{\n startIcon: classes.tagButton,\n focusVisible: classes.focusVisible,\n primary: classes.primaryButton,\n }}\n aria-label={deleteButtonArialLabel}\n tabIndex={tabIndex}\n {...deleteButtonProps}\n >\n <CloseXS\n iconSize=\"XS\"\n style={{\n ...(disabled ? { cursor: \"not-allowed\" } : undefined),\n height: 16,\n }}\n color={disabled ? disabledSemanticColor : \"base2\"}\n />\n </HvButton>\n );\n };\n\n const theme = useTheme();\n\n const inlineStyle = {\n ...style,\n };\n\n let categoricalBackgroundColor;\n\n if (type === \"semantic\") {\n inlineStyle.backgroundColor = getColor(theme, color, type);\n } else if (type === \"categorical\") {\n categoricalBackgroundColor = getColor(theme, color, type);\n\n inlineStyle.backgroundColor = fade(categoricalBackgroundColor, 0.3);\n }\n\n const [hover, setHover] = useState(false);\n\n return (\n <Chip\n label={label}\n className={clsx(classes.root, className)}\n onMouseEnter={() => {\n setHover(!!onClick);\n }}\n onMouseLeave={() => {\n setHover(false);\n }}\n style={{\n ...(disabled ? null : inlineStyle),\n ...(hover && !disabled ? { boxShadow: `0 0 0 1pt ${categoricalBackgroundColor}` } : null),\n }}\n classes={{\n root: clsx(classes.chipRoot, {\n [classes.disabled]: disabled,\n [classes.clickable]: !!onClick,\n [classes.categorical]: type === \"categorical\",\n [classes.categoricalFocus]: type === \"categorical\" && !disabled,\n [classes.categoricalDisabled]: type === \"categorical\" && disabled,\n }),\n label: classes.label,\n deleteIcon: clsx(classes.deleteIcon, {\n [classes.disabledDeleteIcon]: disabled,\n }),\n }}\n deleteIcon={(hasDeleteAction(onDelete) && deleteIcon) || getDeleteIcon()}\n onDelete={getOnDeleteCallback(disabled, onDelete)}\n onClick={disabled ? undefined : onClick}\n role={role || (hasClickAction(onClick) ? \"button\" : undefined)}\n tabIndex={hasDeleteAction(onDelete) ? undefined : 0}\n {...others}\n />\n );\n};\n\nHvTag.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied to the radio button.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n chipRoot: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n label: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n tagButton: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n deleteIcon: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n disabledDeleteIcon: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n titleOverflow: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n categorical: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n categoricalDisabled: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n disabled: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n semanticTextColor: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n categoricalTextColor: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n deletable: PropTypes.string,\n /**\n * Styles applied to the component if has onClick.\n */\n clickable: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n focusVisible: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n primaryButton: PropTypes.string,\n /**\n * Styles applied to the component.\n */\n categoricalFocus: PropTypes.string,\n }).isRequired,\n\n /**\n * Inline styles to be applied to the root element.\n */\n style: PropTypes.instanceOf(Object),\n\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n\n /**\n * The label of the tag element.\n *\n */\n label: PropTypes.node,\n\n /**\n * Indicates that the form element is disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * The type of the tag element.\n *\n * A tag can be of semantic or categoric type\n */\n type: PropTypes.oneOf([\"semantic\", \"categorical\"]),\n\n /**\n * Background color to be applied to the tag\n */\n color: PropTypes.string,\n /**\n * Icon used to customize the delete icon in the Chip element\n */\n deleteIcon: PropTypes.node,\n\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component,\n * in order to render the delete icon\n */\n onDelete: PropTypes.func,\n /**\n * Callback triggered when any item is clicked.\n */\n onClick: PropTypes.func,\n\n /**\n * The role of the element with an attributed event.\n */\n role: PropTypes.string,\n /**\n * Aria properties to apply to delete button in tag\n */\n deleteButtonArialLabel: PropTypes.string,\n /**\n * Props to apply to delete button\n */\n deleteButtonProps: PropTypes.instanceOf(Object),\n};\n\nexport default withStyles(styles, { name: \"HvTag\" })(HvTag);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,CAACC,KAAD,EAAQC,WAAR,EAAqBC,I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kBAAA,CAAUE,MA5DD;;IA6DvB;AACJ;AACA;IACIzB,aAAa,EAAEuB,kBAAA,CAAUE,MAhEF;;IAiEvB;AACJ;AACA;IACIR,gBAAgB,EAAEM,kBAAA,CAAUE;EApEL,CAAhB,EAqENK,UAzEa;;EA2EhB;AACF;AACA;EACEjD,KAAK,EAAE0C,kBAAA,CAAUQ,UAAV,CAAqBC,MAArB,CA9ES;;EAgFhB;AACF;AACA;EACElD,SAAS,EAAEyC,kBAAA,CAAUE,MAnFL;;EAqFhB;AACF;AACA;AACA;EACE1C,KAAK,EAAEwC,kBAAA,CAAUU,IAzFD;;EA2FhB;AACF;AACA;EACEjD,QAAQ,EAAEuC,kBAAA,CAAUW,IA9FJ;;EAgGhB;AACF;AACA;AACA;AACA;EACEnE,IAAI,EAAEwD,kBAAA,CAAUY,KAAV,CAAgB,CAAC,UAAD,EAAa,aAAb,CAAhB,CArGU;;EAuGhB;AACF;AACA;EACElD,KAAK,EAAEsC,kBAAA,CAAUE,MA1GD;;EA2GhB;AACF;AACA;EACEvC,UAAU,EAAEqC,kBAAA,CAAUU,IA9GN;;EAgHhB;AACF;AACA;AACA;AACA;EACE9C,QAAQ,EAAEoC,kBAAA,CAAUa,IArHJ;;EAsHhB;AACF;AACA;EACEhD,OAAO,EAAEmC,kBAAA,CAAUa,IAzHH;;EA2HhB;AACF;AACA;EACE/C,IAAI,EAAEkC,kBAAA,CAAUE,MA9HA;;EA+HhB;AACF;AACA;EACEnC,sBAAsB,EAAEiC,kBAAA,CAAUE,MAlIlB;;EAmIhB;AACF;AACA;EACElC,iBAAiB,EAAEgC,kBAAA,CAAUQ,UAAV,CAAqBC,MAArB;AAtIH,CAAlB;;eAyIe,IAAAK,kBAAA,EAAWC,gBAAX,EAAmB;EAAEC,IAAI,EAAE;AAAR,CAAnB,EAAsC7D,KAAtC,C"}
@@ -46,13 +46,15 @@ var styles = function styles(theme) {
46
46
  primaryButton: {
47
47
  background: "transparent"
48
48
  },
49
- label: {
49
+ label: _objectSpread(_objectSpread({
50
50
  paddingLeft: theme.hv.spacing.xs,
51
- paddingRight: theme.hv.spacing.xs,
51
+ paddingRight: theme.hv.spacing.xs
52
+ }, theme.hv.typography.normalText), {}, {
53
+ color: theme.palette.base2,
52
54
  "& p": {
53
55
  color: theme.hv.palette.base.base2
54
56
  }
55
- },
57
+ }),
56
58
  tagButton: {
57
59
  width: 16,
58
60
  height: 16,