@hitachivantara/uikit-react-core 4.0.1-next.3 → 4.0.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.
- package/dist/Controls/Controls.d.ts +2 -10
- package/dist/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/Provider/Provider.d.ts +5 -18
- package/dist/Provider/Provider.js +25 -38
- package/dist/Provider/Provider.js.map +1 -1
- package/dist/SimpleGrid/SimpleGrid.d.ts +7 -8
- package/dist/Table/TableBody/TableBody.d.ts +4 -0
- package/dist/Tag/Tag.js +1 -13
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tag/styles.js +5 -3
- package/dist/Tag/styles.js.map +1 -1
- package/dist/legacy/Controls/Controls.d.ts +2 -10
- package/dist/legacy/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/legacy/Provider/Provider.d.ts +5 -18
- package/dist/legacy/Provider/Provider.js +29 -40
- package/dist/legacy/Provider/Provider.js.map +1 -1
- package/dist/legacy/SimpleGrid/SimpleGrid.d.ts +7 -8
- package/dist/legacy/Table/TableBody/TableBody.d.ts +4 -0
- package/dist/legacy/Tag/Tag.js +3 -15
- package/dist/legacy/Tag/Tag.js.map +1 -1
- package/dist/legacy/Tag/styles.js +5 -3
- package/dist/legacy/Tag/styles.js.map +1 -1
- package/dist/legacy/theme/index.d.ts +2 -1
- package/dist/modern/Controls/Controls.d.ts +2 -10
- package/dist/modern/Controls/RightControl/RightControl.d.ts +1 -1
- package/dist/modern/Provider/Provider.d.ts +5 -18
- package/dist/modern/Provider/Provider.js +28 -38
- package/dist/modern/Provider/Provider.js.map +1 -1
- package/dist/modern/SimpleGrid/SimpleGrid.d.ts +7 -8
- package/dist/modern/Table/TableBody/TableBody.d.ts +4 -0
- package/dist/modern/Tag/Tag.js +3 -15
- package/dist/modern/Tag/Tag.js.map +1 -1
- package/dist/modern/Tag/styles.js +5 -3
- package/dist/modern/Tag/styles.js.map +1 -1
- package/dist/modern/theme/index.d.ts +2 -1
- package/dist/theme/index.d.ts +2 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Provider.js","names":["React","useState","useEffect","useMemo","PropTypes","set","merge","isEmpty","cloneDeep","diff","createTheme","ThemeProvider","StylesProvider","StyledEngineProvider","themeBuilder","createGenerateClassName","HvCssBaseline","getTheme","ConfigContext","warnedOnce","applyCustomTheme","InputTargetTheme","InputSourceTheme","muiDefaultTheme","targetTheme","sourceTheme","deleteDifference","observableDiff","difference","partialCustomTheme","path","rhs","kind","HvProvider","children","uiKitTheme","theme","changeTheme","locale","generateClassName","generateClassNameProp","generateClassNameOptions","injectStylesFirst","disableStylesGeneration","disableCssBaseline","process","env","NODE_ENV","console","warn","localeSetting","setLocaleStting","navigator","language","rawUiKitTheme","customTheme","pConfig","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,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,OAArC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,GAAP,MAAgB,YAAhB;AACA,OAAOC,KAAP,MAAkB,cAAlB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,SAAP,MAAsB,kBAAtB;AACA,OAAOC,IAAP,MAAiB,WAAjB;AAEA,OAAO,uBAAP;AACA,OAAO,eAAP;AAEA,SAASC,WAAT,EAAsBC,aAAtB,QAA2C,eAA3C;AACA,SAASC,cAAT,QAA+B,aAA/B;AACA,SAASC,oBAAT,QAAqC,sBAArC;AACA,SAASC,YAAT,EAAuBC,uBAAvB,EAAgDC,aAAhD,EAA+DC,QAA/D,QAA+E,UAA/E;AAEA,OAAOC,aAAP,MAA0B,WAA1B;;;AAEA,IAAIC,UAAU,GAAG,KAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,gBAAgB,GAAG,CAACC,gBAAD,EAAmBC,gBAAnB,KAAwC;EAC/D,MAAMC,eAAe,GAAGb,WAAW,EAAnC;EACA,MAAM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AAqBC,MAArB,CAbc;;EAcrB;AACF;AACA;AACA;EACEzB,WAAW,EAAEjC,SAAS,CAAC2D,IAlBF;;EAoBrB;AACF;AACA;AACA;EACEzB,MAAM,EAAElC,SAAS,CAAC4D,MAxBG;;EA0BrB;AACF;AACA;EACEzB,iBAAiB,EAAEnC,SAAS,CAAC2D,IA7BR;;EA8BrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEtB,wBAAwB,EAAErC,SAAS,CAAC6D,KAAV,CAAgB;IACxC;AACJ;AACA;IACIC,aAAa,EAAE9D,SAAS,CAAC+D,IAJe;;IAKxC;AACJ;AACA;IACIC,gBAAgB,EAAEhE,SAAS,CAAC4D,MARY;;IASxC;AACJ;AACA;AACA;IACIK,IAAI,EAAEjE,SAAS,CAAC4D;EAbwB,CAAhB,CAzCL;;EAwDrB;AACF;AACA;AACA;AACA;AACA;EACEtB,iBAAiB,EAAEtC,SAAS,CAAC+D,IA9DR;;EA+DrB;AACF;AACA;EACExB,uBAAuB,EAAEvC,SAAS,CAAC+D,IAlEd;;EAoErB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEvB,kBAAkB,EAAExC,SAAS,CAAC+D;AAjFT,CAAvB;AAoFA,eAAelC,UAAf"}
|
|
1
|
+
{"version":3,"file":"Provider.js","names":["React","useState","useEffect","useMemo","PropTypes","set","merge","isEmpty","cloneDeep","diff","createTheme","ThemeProvider","StylesProvider","StyledEngineProvider","themeBuilder","createGenerateClassName","HvCssBaseline","getTheme","HvScopedCssBaseline","ConfigContext","applyCustomTheme","InputTargetTheme","InputSourceTheme","muiDefaultTheme","targetTheme","sourceTheme","deleteDifference","observableDiff","difference","partialCustomTheme","path","rhs","kind","HvProvider","children","uiKitTheme","theme","changeTheme","locale","generateClassName","generateClassNameProp","generateClassNameOptions","disableStylesGeneration","cssBaseline","localeSetting","setLocaleSetting","navigator","language","rawUiKitTheme","customTheme","pConfig","renderCssBaseline","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,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,OAArC,QAAoD,OAApD;AACA,OAAOC,SAAP,MAAsB,YAAtB;AAEA,OAAOC,GAAP,MAAgB,YAAhB;AACA,OAAOC,KAAP,MAAkB,cAAlB;AACA,OAAOC,OAAP,MAAoB,gBAApB;AACA,OAAOC,SAAP,MAAsB,kBAAtB;AACA,OAAOC,IAAP,MAAiB,WAAjB;AAEA,OAAO,uBAAP;AACA,OAAO,eAAP;AAEA,SAASC,WAAT,EAAsBC,aAAtB,QA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,wCAAAD,UAAU,CAACmB,SAAX,GAAuB;EACrB;AACF;AACA;EACElB,QAAQ,EAAE9B,SAAS,CAACiD,IAAV,CAAeC,UAJJ;;EAMrB;AACF;AACA;EACEnB,UAAU,EAAE/B,SAAS,CAACmD,KAAV,CAAgB,CAAC,MAAD,EAAS,QAAT,CAAhB,CATS;;EAUrB;AACF;AACA;EACEnB,KAAK,EAAEhC,SAAS,CAACoD,UAAV,CAAqBC,MAArB,CAbc;;EAcrB;AACF;AACA;AACA;EACEpB,WAAW,EAAEjC,SAAS,CAACsD,IAlBF;;EAoBrB;AACF;AACA;AACA;EACEpB,MAAM,EAAElC,SAAS,CAACuD,MAxBG;;EA0BrB;AACF;AACA;EACEpB,iBAAiB,EAAEnC,SAAS,CAACsD,IA7BR;;EA8BrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACEjB,wBAAwB,EAAErC,SAAS,CAACwD,KAAV,CAAgB;IACxC;AACJ;AACA;IACIC,aAAa,EAAEzD,SAAS,CAAC0D,IAJe;;IAKxC;AACJ;AACA;IACIC,gBAAgB,EAAE3D,SAAS,CAACuD,MARY;;IASxC;AACJ;AACA;AACA;IACIK,IAAI,EAAE5D,SAAS,CAACuD;EAbwB,CAAhB,CAzCL;;EAwDrB;AACF;AACA;EACEjB,uBAAuB,EAAEtC,SAAS,CAAC0D,IA3Dd;;EA4DrB;AACF;AACA;AACA;AACA;AACA;AACA;EACEnB,WAAW,EAAEvC,SAAS,CAACmD,KAAV,CAAgB,CAAC,QAAD,EAAW,QAAX,EAAqB,MAArB,CAAhB;AAnEQ,CAAvB;AAsEA,eAAetB,UAAf"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
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?:
|
|
6
|
+
spacing?: Spacing;
|
|
9
7
|
};
|
|
10
8
|
|
|
11
|
-
export interface SimpleGridProps
|
|
12
|
-
|
|
9
|
+
export interface SimpleGridProps {
|
|
10
|
+
children?: JSX.Element | JSX.Element[];
|
|
11
|
+
spacing?: Spacing;
|
|
13
12
|
cols?: number;
|
|
14
|
-
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;
|
package/dist/modern/Tag/Tag.js
CHANGED
|
@@ -7,14 +7,14 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
7
7
|
|
|
8
8
|
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) { _defineProperty(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; }
|
|
9
9
|
|
|
10
|
-
import React, {
|
|
10
|
+
import React, { useState } from "react";
|
|
11
11
|
import { Chip } from "@mui/material";
|
|
12
12
|
import { withStyles, useTheme } from "@mui/styles";
|
|
13
13
|
import PropTypes from "prop-types";
|
|
14
14
|
import clsx from "clsx";
|
|
15
15
|
import { CloseXS } from "@hitachivantara/uikit-react-icons";
|
|
16
16
|
import fade from "../utils/hexToRgbA";
|
|
17
|
-
import { HvButton
|
|
17
|
+
import { HvButton } from "..";
|
|
18
18
|
import styles from "./styles";
|
|
19
19
|
import { getOnDeleteCallback, hasDeleteAction, hasClickAction } from "./utils";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -45,8 +45,6 @@ const getColor = (theme, customColor, type) => {
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
const HvTag = props => {
|
|
48
|
-
var _HvTypography;
|
|
49
|
-
|
|
50
48
|
const {
|
|
51
49
|
classes,
|
|
52
50
|
style,
|
|
@@ -104,18 +102,8 @@ const HvTag = props => {
|
|
|
104
102
|
}
|
|
105
103
|
|
|
106
104
|
const [hover, setHover] = useState(false);
|
|
107
|
-
const chipLabel = useMemo(() => {
|
|
108
|
-
if (typeof label === "string") {
|
|
109
|
-
return _HvTypography || (_HvTypography = /*#__PURE__*/_jsx(HvTypography, {
|
|
110
|
-
variant: "normalText",
|
|
111
|
-
children: label
|
|
112
|
-
}));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return label;
|
|
116
|
-
}, [label]);
|
|
117
105
|
return /*#__PURE__*/_jsx(Chip, _objectSpread({
|
|
118
|
-
label:
|
|
106
|
+
label: label,
|
|
119
107
|
className: clsx(classes.root, className),
|
|
120
108
|
onMouseEnter: () => {
|
|
121
109
|
setHover(!!onClick);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","names":["React","useMemo","useState","Chip","withStyles","useTheme","PropTypes","clsx","CloseXS","fade","HvButton","HvTypography","styles","getOnDeleteCallback","hasDeleteAction","hasClickAction","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","inlineStyle","categoricalBackgroundColor","hover","setHover","chipLabel","root","boxShadow","chipRoot","clickable","categoricalDisabled","categoricalFocus","disabledDeleteIcon","propTypes","shape","string","titleOverflow","semanticTextColor","categoricalTextColor","deletable","isRequired","instanceOf","Object","node","bool","oneOf","func","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,OAAOA,KAAP,IAAgBC,OAAhB,EAAyBC,QAAzB,QAAyC,OAAzC;AACA,SAASC,IAAT,QAAqB,eAArB;AACA,SAASC,UAAT,EAAqBC,QAArB,QAAqC,aAArC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,OAAT,QAAwB,mCAAxB;AAEA,OAAOC,IAAP,MAAiB,oBAAjB;AACA,SAASC,QAAT,EAAmBC,YAAnB,QAAuC,IAAvC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASC,mBAAT,EAA8BC,eAA9B,EAA+CC,cAA/C,QAAqE,SAArE;;;AAEA,MAAMC,QAAQ,GAAG,CAACC,KAAD,EAAQC,WAAR,EAAqBC,IAArB,KAA8B;EAC7C,MAAMC,oBAAoB,GAAGH,KAAK,CAACI,EAAN,CAASC,OAAT,CAAiBC,QAAjB,CAA0BC,KAAvD;EACA,MAAMC,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,GAC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S,CAAC2E,IArHJ;;EAsHhB;AACF;AACA;EACEzC,OAAO,EAAElC,SAAS,CAAC2E,IAzHH;;EA2HhB;AACF;AACA;EACExC,IAAI,EAAEnC,SAAS,CAACgE,MA9HA;;EA+HhB;AACF;AACA;EACE5B,sBAAsB,EAAEpC,SAAS,CAACgE,MAlIlB;;EAmIhB;AACF;AACA;EACE3B,iBAAiB,EAAErC,SAAS,CAACsE,UAAV,CAAqBC,MAArB;AAtIH,CAAlB;AAyIA,eAAezE,UAAU,CAACQ,MAAD,EAAS;EAAEsE,IAAI,EAAE;AAAR,CAAT,CAAV,CAAsCpD,KAAtC,CAAf"}
|
|
1
|
+
{"version":3,"file":"Tag.js","names":["React","useState","Chip","withStyles","useTheme","PropTypes","clsx","CloseXS","fade","HvButton","styles","getOnDeleteCallback","hasDeleteAction","hasClickAction","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","inlineStyle","categoricalBackgroundColor","hover","setHover","root","boxShadow","chipRoot","clickable","categoricalDisabled","categoricalFocus","disabledDeleteIcon","propTypes","shape","string","titleOverflow","semanticTextColor","categoricalTextColor","deletable","isRequired","instanceOf","Object","node","bool","oneOf","func","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,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,IAAT,QAAqB,eAArB;AACA,SAASC,UAAT,EAAqBC,QAArB,QAAqC,aAArC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,MAAiB,MAAjB;AACA,SAASC,OAAT,QAAwB,mCAAxB;AACA,OAAOC,IAAP,MAAiB,oBAAjB;AACA,SAASC,QAAT,QAAyB,IAAzB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASC,mBAAT,EAA8BC,eAA9B,EAA+CC,cAA/C,QAA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3D,IAAI,EAAEZ,SAAS,CAACwE,KAAV,CAAgB,CAAC,UAAD,EAAa,aAAb,CAAhB,CArGU;;EAuGhB;AACF;AACA;EACE1C,KAAK,EAAE9B,SAAS,CAAC8D,MA1GD;;EA2GhB;AACF;AACA;EACE/B,UAAU,EAAE/B,SAAS,CAACsE,IA9GN;;EAgHhB;AACF;AACA;AACA;AACA;EACEtC,QAAQ,EAAEhC,SAAS,CAACyE,IArHJ;;EAsHhB;AACF;AACA;EACExC,OAAO,EAAEjC,SAAS,CAACyE,IAzHH;;EA2HhB;AACF;AACA;EACEvC,IAAI,EAAElC,SAAS,CAAC8D,MA9HA;;EA+HhB;AACF;AACA;EACE3B,sBAAsB,EAAEnC,SAAS,CAAC8D,MAlIlB;;EAmIhB;AACF;AACA;EACE1B,iBAAiB,EAAEpC,SAAS,CAACoE,UAAV,CAAqBC,MAArB;AAtIH,CAAlB;AAyIA,eAAevE,UAAU,CAACO,MAAD,EAAS;EAAEqE,IAAI,EAAE;AAAR,CAAT,CAAV,CAAsCnD,KAAtC,CAAf"}
|
|
@@ -21,13 +21,15 @@ const styles = theme => ({
|
|
|
21
21
|
primaryButton: {
|
|
22
22
|
background: "transparent"
|
|
23
23
|
},
|
|
24
|
-
label: {
|
|
24
|
+
label: _objectSpread(_objectSpread({
|
|
25
25
|
paddingLeft: theme.hv.spacing.xs,
|
|
26
|
-
paddingRight: theme.hv.spacing.xs
|
|
26
|
+
paddingRight: theme.hv.spacing.xs
|
|
27
|
+
}, theme.hv.typography.normalText), {}, {
|
|
28
|
+
color: theme.palette.base2,
|
|
27
29
|
"& p": {
|
|
28
30
|
color: theme.hv.palette.base.base2
|
|
29
31
|
}
|
|
30
|
-
},
|
|
32
|
+
}),
|
|
31
33
|
tagButton: {
|
|
32
34
|
width: 16,
|
|
33
35
|
height: 16,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["fade","outlineStyles","styles","theme","root","chipRoot","height","borderRadius","maxWidth","backgroundColor","palette","base1","focusVisible","primaryButton","background","label","paddingLeft","hv","spacing","xs","paddingRight","
|
|
1
|
+
{"version":3,"file":"styles.js","names":["fade","outlineStyles","styles","theme","root","chipRoot","height","borderRadius","maxWidth","backgroundColor","palette","base1","focusVisible","primaryButton","background","label","paddingLeft","hv","spacing","xs","paddingRight","typography","normalText","color","base2","base","tagButton","width","minWidth","minHeight","padding","margin","deleteIcon","marginRight","outline","boxShadow","disabledDeleteIcon","atmosphere","atmo3","outlineOffset","titleOverflow","whiteSpace","overflow","textOverflow","categorical","cursor","accent","acce1","clickable","categoricalFocus","disabled","atmo5","categoricalDisabled","semanticTextColor","categoricalTextColor"],"sources":["../../../src/Tag/styles.js"],"sourcesContent":["import fade from \"../utils/hexToRgbA\";\nimport { outlineStyles } from \"../Focus/styles\";\n\nconst styles = (theme) => ({\n root: {},\n\n chipRoot: {\n height: 16,\n borderRadius: 0,\n maxWidth: 180,\n \"& $focusVisible\": {\n backgroundColor: fade(theme.palette.base1, 0.3),\n },\n },\n\n focusVisible: {},\n\n primaryButton: {\n background: \"transparent\",\n },\n\n label: {\n paddingLeft: theme.hv.spacing.xs,\n paddingRight: theme.hv.spacing.xs,\n ...theme.hv.typography.normalText,\n color: theme.palette.base2,\n \"& p\": {\n color: theme.hv.palette.base.base2,\n },\n },\n\n tagButton: {\n width: 16,\n height: 16,\n minWidth: 16,\n minHeight: 16,\n padding: 0,\n margin: 0,\n },\n\n deleteIcon: {\n marginRight: 0,\n width: 16,\n height: 16,\n minWidth: 16,\n minHeight: 16,\n padding: 0,\n \"&:hover\": {\n backgroundColor: fade(theme.palette.base1, 0.3),\n },\n \"&:focus\": {\n ...outlineStyles,\n borderRadius: 0,\n },\n \"&:focus:not(:focus-visible)\": {\n outline: \"0 !important\",\n boxShadow: \"none !important\",\n },\n },\n disabledDeleteIcon: {\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n \"&:focus\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n outline: \"none\",\n boxShadow: \"none\",\n outlineOffset: 0,\n },\n },\n titleOverflow: {\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n },\n categorical: {\n borderRadius: 8,\n \"&$clickable\": {\n cursor: \"pointer\",\n },\n \"&:hover\": {\n borderRadius: 8,\n },\n \"& $label > p\": {\n color: theme.hv.palette.accent.acce1,\n },\n \"&:focus:not(:focus-visible)\": {\n outline: \"0 !important\",\n boxShadow: \"none !important\",\n },\n },\n clickable: {},\n\n categoricalFocus: {\n \"&:focus\": {\n ...outlineStyles,\n },\n },\n\n disabled: {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n cursor: \"not-allowed\",\n \"& $label > p\": {\n color: theme.hv.palette.atmosphere.atmo5,\n },\n },\n\n categoricalDisabled: {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n cursor: \"not-allowed\",\n \"& $label > p\": {\n color: theme.hv.palette.atmosphere.atmo5,\n },\n \"&:hover\": {\n backgroundColor: theme.hv.palette.atmosphere.atmo3,\n },\n \"&:focus\": {\n outline: \"none\",\n },\n },\n\n semanticTextColor: {\n color: theme.hv.palette.base.base2,\n },\n categoricalTextColor: {\n color: theme.hv.palette.accent.acce1,\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,OAAOA,IAAP,MAAiB,oBAAjB;AACA,SAASC,aAAT,QAA8B,iBAA9B;;AAEA,MAAMC,MAAM,GAAIC,KAAD,KAAY;EACzBC,IAAI,EAAE,EADmB;EAGzBC,QAAQ,EAAE;IACRC,MAAM,EAAE,EADA;IAERC,YAAY,EAAE,CAFN;IAGRC,QAAQ,EAAE,GAHF;IAIR,mBAAmB;MACjBC,eAAe,EAAET,IAAI,CAACG,KAAK,CAACO,OAAN,CAAcC,KAAf,EAAsB,GAAtB;IADJ;EAJX,CAHe;EAYzBC,YAAY,EAAE,EAZW;EAczBC,aAAa,EAAE;IACbC,UAAU,EAAE;EADC,CAdU;EAkBzBC,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iBe,IAAjB,CAAsBD;EADZ,CAtHM;EAyHzB8B,oBAAoB,EAAE;IACpB/B,KAAK,EAAEpB,KAAK,CAACc,EAAN,CAASP,OAAT,CAAiBoC,MAAjB,CAAwBC;EADX;AAzHG,CAAZ,CAAf;;AA8HA,eAAe7C,MAAf"}
|
|
@@ -139,8 +139,9 @@ export interface HvTheme {
|
|
|
139
139
|
type: string;
|
|
140
140
|
name: string;
|
|
141
141
|
palette: HvThemePalette;
|
|
142
|
-
|
|
142
|
+
shadows: string[];
|
|
143
143
|
spacing: HvThemeSpacing;
|
|
144
|
+
typography: HvThemeTypography;
|
|
144
145
|
viz: HvThemeVizPalette;
|
|
145
146
|
}
|
|
146
147
|
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -139,8 +139,9 @@ export interface HvTheme {
|
|
|
139
139
|
type: string;
|
|
140
140
|
name: string;
|
|
141
141
|
palette: HvThemePalette;
|
|
142
|
-
|
|
142
|
+
shadows: string[];
|
|
143
143
|
spacing: HvThemeSpacing;
|
|
144
|
+
typography: HvThemeTypography;
|
|
144
145
|
viz: HvThemeVizPalette;
|
|
145
146
|
}
|
|
146
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-core",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "A collection of React components for the Hitachi Vantara's Design System.",
|
|
5
5
|
"homepage": "https://github.com/lumada-design/hv-uikit-react",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"react-dom": "^16.13.1 || ^17.0.2"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@hitachivantara/uikit-common-themes": "^4.0.
|
|
48
|
-
"@hitachivantara/uikit-react-icons": "^4.0.
|
|
47
|
+
"@hitachivantara/uikit-common-themes": "^4.0.2",
|
|
48
|
+
"@hitachivantara/uikit-react-icons": "^4.0.2",
|
|
49
49
|
"@popperjs/core": "2.11.5",
|
|
50
50
|
"@types/react-table": "^7.7.12",
|
|
51
51
|
"attr-accept": "^2.2.2",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "785f30259602f40b74ffd12b4d255a7a77fe7f24"
|
|
87
87
|
}
|