@hitachivantara/uikit-react-core 5.44.2 → 5.44.4
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/cjs/FilterGroup/Counter/Counter.cjs +1 -1
- package/dist/cjs/FilterGroup/Counter/Counter.cjs.map +1 -1
- package/dist/cjs/FilterGroup/RightPanel/RightPanel.cjs +1 -4
- package/dist/cjs/FilterGroup/RightPanel/RightPanel.cjs.map +1 -1
- package/dist/cjs/Tag/Tag.cjs +4 -2
- package/dist/cjs/Tag/Tag.cjs.map +1 -1
- package/dist/cjs/Typography/Typography.cjs.map +1 -1
- package/dist/cjs/Typography/Typography.styles.cjs +1 -0
- package/dist/cjs/Typography/Typography.styles.cjs.map +1 -1
- package/dist/esm/FilterGroup/Counter/Counter.js +1 -1
- package/dist/esm/FilterGroup/Counter/Counter.js.map +1 -1
- package/dist/esm/FilterGroup/RightPanel/RightPanel.js +1 -4
- package/dist/esm/FilterGroup/RightPanel/RightPanel.js.map +1 -1
- package/dist/esm/Tag/Tag.js +4 -2
- package/dist/esm/Tag/Tag.js.map +1 -1
- package/dist/esm/Typography/Typography.js.map +1 -1
- package/dist/esm/Typography/Typography.styles.js +1 -0
- package/dist/esm/Typography/Typography.styles.js.map +1 -1
- package/dist/types/index.d.ts +5 -2
- package/package.json +3 -3
|
@@ -31,7 +31,7 @@ const HvFilterGroupCounter = (props) => {
|
|
|
31
31
|
] : filterOptions;
|
|
32
32
|
const optionIdx = filterOptions.findIndex((option) => option.id === id);
|
|
33
33
|
let groupsCounter = 0;
|
|
34
|
-
appliedFilters.
|
|
34
|
+
appliedFilters.forEach((fg, i) => {
|
|
35
35
|
groupsCounter += getExistingFiltersById(i, filterValues, filterOptions);
|
|
36
36
|
});
|
|
37
37
|
const partialCounter = id ? getExistingFiltersById(optionIdx, filterValues, filterOptions) || 0 : groupsCounter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Counter.cjs","sources":["../../../../src/FilterGroup/Counter/Counter.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { ExtractNames } from \"../../utils/classes\";\n\nimport { useDefaultProps } from \"../../hooks/useDefaultProps\";\n\nimport { HvFilterGroupContext } from \"../FilterGroupContext\";\nimport { staticClasses, useClasses } from \"./Counter.styles\";\nimport { HvFilterGroupFilters, HvFilterGroupValue } from \"../types\";\n\nexport { staticClasses as filterGroupCounterClasses };\n\nexport type HvFilterGroupCounterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFilterGroupCounterProps {\n className?: string;\n id?: string;\n classes?: HvFilterGroupCounterClasses;\n}\n\nconst getExistingFiltersById = (\n idx: number,\n filterValues: HvFilterGroupValue,\n filterOptions: HvFilterGroupFilters\n) => {\n let total = 0;\n filterValues[idx]?.forEach((fv) => {\n if (filterOptions[idx]?.data.find((f) => f.id === fv)) {\n total += 1;\n }\n });\n return total;\n};\n\nexport const HvFilterGroupCounter = (props: HvFilterGroupCounterProps) => {\n const {\n className,\n id,\n classes: classesProp,\n } = useDefaultProps(\"HvFilterGroupCounter\", props);\n const { classes, cx } = useClasses(classesProp);\n const {\n filterOptions,\n filterValues = [],\n appliedFilters = [],\n } = useContext(HvFilterGroupContext);\n\n const options =\n id && filterOptions.find((option) => option.id === id)\n ? ([\n filterOptions.find((option) => option.id === id),\n ] as HvFilterGroupFilters)\n : filterOptions;\n const optionIdx = filterOptions.findIndex((option) => option.id === id);\n\n let groupsCounter = 0;\n appliedFilters
|
|
1
|
+
{"version":3,"file":"Counter.cjs","sources":["../../../../src/FilterGroup/Counter/Counter.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { ExtractNames } from \"../../utils/classes\";\n\nimport { useDefaultProps } from \"../../hooks/useDefaultProps\";\n\nimport { HvFilterGroupContext } from \"../FilterGroupContext\";\nimport { staticClasses, useClasses } from \"./Counter.styles\";\nimport { HvFilterGroupFilters, HvFilterGroupValue } from \"../types\";\n\nexport { staticClasses as filterGroupCounterClasses };\n\nexport type HvFilterGroupCounterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFilterGroupCounterProps {\n className?: string;\n id?: string;\n classes?: HvFilterGroupCounterClasses;\n}\n\nconst getExistingFiltersById = (\n idx: number,\n filterValues: HvFilterGroupValue,\n filterOptions: HvFilterGroupFilters\n) => {\n let total = 0;\n filterValues[idx]?.forEach((fv) => {\n if (filterOptions[idx]?.data.find((f) => f.id === fv)) {\n total += 1;\n }\n });\n return total;\n};\n\nexport const HvFilterGroupCounter = (props: HvFilterGroupCounterProps) => {\n const {\n className,\n id,\n classes: classesProp,\n } = useDefaultProps(\"HvFilterGroupCounter\", props);\n const { classes, cx } = useClasses(classesProp);\n const {\n filterOptions,\n filterValues = [],\n appliedFilters = [],\n } = useContext(HvFilterGroupContext);\n\n const options =\n id && filterOptions.find((option) => option.id === id)\n ? ([\n filterOptions.find((option) => option.id === id),\n ] as HvFilterGroupFilters)\n : filterOptions;\n const optionIdx = filterOptions.findIndex((option) => option.id === id);\n\n let groupsCounter = 0;\n appliedFilters.forEach((fg, i) => {\n groupsCounter += getExistingFiltersById(i, filterValues, filterOptions);\n });\n\n const partialCounter = id\n ? getExistingFiltersById(optionIdx, filterValues, filterOptions) || 0\n : groupsCounter;\n\n const totalCounter = options.reduce(\n (acc, option) => acc + option.data.length,\n 0\n );\n\n return (\n <div className={cx(classes.root, className)}>\n {partialCounter > 0 ? (\n <p className={classes.partialCounter}>{partialCounter}</p>\n ) : (\n partialCounter\n )}\n {` / ${totalCounter}`}\n </div>\n );\n};\n"],"names":["useDefaultProps","useClasses","useContext","HvFilterGroupContext","jsx"],"mappings":";;;;;;;AAoBA,MAAM,yBAAyB,CAC7B,KACA,cACA,kBACG;AACH,MAAI,QAAQ;AACZ,eAAa,GAAG,GAAG,QAAQ,CAAC,OAAO;AAC7B,QAAA,cAAc,GAAG,GAAG,KAAK,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG;AAC5C,eAAA;AAAA,IACX;AAAA,EAAA,CACD;AACM,SAAA;AACT;AAEa,MAAA,uBAAuB,CAAC,UAAqC;AAClE,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EAAA,IACPA,gBAAgB,gBAAA,wBAAwB,KAAK;AACjD,QAAM,EAAE,SAAS,GAAG,IAAIC,0BAAW,WAAW;AACxC,QAAA;AAAA,IACJ;AAAA,IACA,eAAe,CAAC;AAAA,IAChB,iBAAiB,CAAC;AAAA,EAAA,IAChBC,MAAAA,WAAWC,mBAAAA,oBAAoB;AAE7B,QAAA,UACJ,MAAM,cAAc,KAAK,CAAC,WAAW,OAAO,OAAO,EAAE,IAChD;AAAA,IACC,cAAc,KAAK,CAAC,WAAW,OAAO,OAAO,EAAE;AAAA,EAEjD,IAAA;AACN,QAAM,YAAY,cAAc,UAAU,CAAC,WAAW,OAAO,OAAO,EAAE;AAEtE,MAAI,gBAAgB;AACL,iBAAA,QAAQ,CAAC,IAAI,MAAM;AACf,qBAAA,uBAAuB,GAAG,cAAc,aAAa;AAAA,EAAA,CACvE;AAED,QAAM,iBAAiB,KACnB,uBAAuB,WAAW,cAAc,aAAa,KAAK,IAClE;AAEJ,QAAM,eAAe,QAAQ;AAAA,IAC3B,CAAC,KAAK,WAAW,MAAM,OAAO,KAAK;AAAA,IACnC;AAAA,EAAA;AAGF,yCACG,OAAI,EAAA,WAAW,GAAG,QAAQ,MAAM,SAAS,GACvC,UAAA;AAAA,IAAA,iBAAiB,IACfC,+BAAA,KAAA,EAAE,WAAW,QAAQ,gBAAiB,0BAAe,IAEtD;AAAA,IAED,MAAM,YAAY;AAAA,EACrB,EAAA,CAAA;AAEJ;;;"}
|
|
@@ -79,10 +79,7 @@ const HvFilterGroupRightPanel = ({
|
|
|
79
79
|
newFilterValues[activeGroup] = [];
|
|
80
80
|
}
|
|
81
81
|
} else {
|
|
82
|
-
newFilterValues[activeGroup] = [
|
|
83
|
-
...filterValues[activeGroup],
|
|
84
|
-
...activeGroupOptions
|
|
85
|
-
];
|
|
82
|
+
newFilterValues[activeGroup] = [...activeGroupOptions];
|
|
86
83
|
}
|
|
87
84
|
setFilterValues(newFilterValues);
|
|
88
85
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightPanel.cjs","sources":["../../../../src/FilterGroup/RightPanel/RightPanel.tsx"],"sourcesContent":["import { useCallback, useContext, useEffect, useMemo, useState } from \"react\";\n\nimport cloneDeep from \"lodash/cloneDeep\";\n\nimport { HvCheckBox } from \"../../CheckBox\";\nimport { HvInput } from \"../../Input\";\nimport { HvList, HvListProps } from \"../../List\";\nimport { HvPanel } from \"../../Panel\";\nimport { HvTypography } from \"../../Typography\";\nimport { ExtractNames } from \"../../utils/classes\";\nimport { setId } from \"../../utils/setId\";\n\nimport { HvFilterGroupContext } from \"../FilterGroupContext\";\nimport { staticClasses, useClasses } from \"./RightPanel.styles\";\n\nexport { staticClasses as filterGroupRightPanelClasses };\n\nexport type HvFilterGroupRightPanelClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFilterGroupRightPanelProps {\n id?: string;\n className?: string;\n labels?: {\n searchBoxPlaceholder?: string;\n selectAll?: string;\n multiSelectionConjunction?: string;\n };\n emptyElement?: React.ReactNode;\n classes?: HvFilterGroupRightPanelClasses;\n}\n\nexport const HvFilterGroupRightPanel = ({\n id,\n className,\n labels,\n emptyElement,\n classes: classesProp,\n}: HvFilterGroupRightPanelProps) => {\n const { classes } = useClasses(classesProp);\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const [allSelected, setAllSelected] = useState<boolean>(false);\n const [anySelected, setAnySelected] = useState<boolean>(false);\n\n const {\n filterOptions,\n filterValues = [],\n setFilterValues,\n activeGroup,\n } = useContext(HvFilterGroupContext);\n\n const activeGroupOptions = useMemo(\n () =>\n filterOptions[activeGroup]?.data\n .filter((option) =>\n option.name.toLowerCase().includes(searchStr.toLowerCase())\n )\n .map((option) => option.id) || [],\n [filterOptions, activeGroup, searchStr]\n );\n\n const activeFilterValues = useMemo(\n () =>\n filterValues[activeGroup]?.filter((value) =>\n activeGroupOptions.includes(value)\n ) || [],\n [filterValues, activeGroupOptions, activeGroup]\n );\n\n const listValues = useMemo(\n () =>\n filterOptions[activeGroup]?.data.map((option) => ({\n ...option,\n label: option.name,\n selected: filterValues[activeGroup]?.includes(option.id),\n isHidden:\n option.name.toLowerCase().indexOf(searchStr.toLowerCase()) < 0,\n })) || [],\n [filterOptions, filterValues, activeGroup, searchStr]\n );\n\n const updateSelectAll = useCallback(() => {\n const nbrSelected = activeFilterValues?.length;\n const hasSelection = nbrSelected > 0;\n const allSelect = nbrSelected === activeGroupOptions.length;\n\n setAnySelected(hasSelection);\n setAllSelected(hasSelection && allSelect);\n }, [activeFilterValues, activeGroupOptions]);\n\n useEffect(() => {\n updateSelectAll();\n }, [activeFilterValues, updateSelectAll]);\n\n useEffect(() => setSearchStr(\"\"), [activeGroup]);\n\n const onChangeHandler: HvListProps[\"onChange\"] = (values) => {\n const newFilterValues = filterOptions.map((_, i) =>\n activeGroup === i\n ? values.filter((v) => v.selected).map((v) => v.id)\n : [...(filterValues[i] || [])]\n );\n setFilterValues(newFilterValues as any);\n };\n\n const handleSelectAll = useCallback(() => {\n const newFilterValues = cloneDeep(filterValues);\n\n if (anySelected) {\n if (searchStr !== \"\") {\n newFilterValues[activeGroup] = filterValues[activeGroup]?.filter(\n (value) => !activeGroupOptions.includes(value)\n );\n } else {\n newFilterValues[activeGroup] = [];\n }\n } else {\n newFilterValues[activeGroup] = [
|
|
1
|
+
{"version":3,"file":"RightPanel.cjs","sources":["../../../../src/FilterGroup/RightPanel/RightPanel.tsx"],"sourcesContent":["import { useCallback, useContext, useEffect, useMemo, useState } from \"react\";\n\nimport cloneDeep from \"lodash/cloneDeep\";\n\nimport { HvCheckBox } from \"../../CheckBox\";\nimport { HvInput } from \"../../Input\";\nimport { HvList, HvListProps } from \"../../List\";\nimport { HvPanel } from \"../../Panel\";\nimport { HvTypography } from \"../../Typography\";\nimport { ExtractNames } from \"../../utils/classes\";\nimport { setId } from \"../../utils/setId\";\n\nimport { HvFilterGroupContext } from \"../FilterGroupContext\";\nimport { staticClasses, useClasses } from \"./RightPanel.styles\";\n\nexport { staticClasses as filterGroupRightPanelClasses };\n\nexport type HvFilterGroupRightPanelClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFilterGroupRightPanelProps {\n id?: string;\n className?: string;\n labels?: {\n searchBoxPlaceholder?: string;\n selectAll?: string;\n multiSelectionConjunction?: string;\n };\n emptyElement?: React.ReactNode;\n classes?: HvFilterGroupRightPanelClasses;\n}\n\nexport const HvFilterGroupRightPanel = ({\n id,\n className,\n labels,\n emptyElement,\n classes: classesProp,\n}: HvFilterGroupRightPanelProps) => {\n const { classes } = useClasses(classesProp);\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const [allSelected, setAllSelected] = useState<boolean>(false);\n const [anySelected, setAnySelected] = useState<boolean>(false);\n\n const {\n filterOptions,\n filterValues = [],\n setFilterValues,\n activeGroup,\n } = useContext(HvFilterGroupContext);\n\n const activeGroupOptions = useMemo(\n () =>\n filterOptions[activeGroup]?.data\n .filter((option) =>\n option.name.toLowerCase().includes(searchStr.toLowerCase())\n )\n .map((option) => option.id) || [],\n [filterOptions, activeGroup, searchStr]\n );\n\n const activeFilterValues = useMemo(\n () =>\n filterValues[activeGroup]?.filter((value) =>\n activeGroupOptions.includes(value)\n ) || [],\n [filterValues, activeGroupOptions, activeGroup]\n );\n\n const listValues = useMemo(\n () =>\n filterOptions[activeGroup]?.data.map((option) => ({\n ...option,\n label: option.name,\n selected: filterValues[activeGroup]?.includes(option.id),\n isHidden:\n option.name.toLowerCase().indexOf(searchStr.toLowerCase()) < 0,\n })) || [],\n [filterOptions, filterValues, activeGroup, searchStr]\n );\n\n const updateSelectAll = useCallback(() => {\n const nbrSelected = activeFilterValues?.length;\n const hasSelection = nbrSelected > 0;\n const allSelect = nbrSelected === activeGroupOptions.length;\n\n setAnySelected(hasSelection);\n setAllSelected(hasSelection && allSelect);\n }, [activeFilterValues, activeGroupOptions]);\n\n useEffect(() => {\n updateSelectAll();\n }, [activeFilterValues, updateSelectAll]);\n\n useEffect(() => setSearchStr(\"\"), [activeGroup]);\n\n const onChangeHandler: HvListProps[\"onChange\"] = (values) => {\n const newFilterValues = filterOptions.map((_, i) =>\n activeGroup === i\n ? values.filter((v) => v.selected).map((v) => v.id)\n : [...(filterValues[i] || [])]\n );\n setFilterValues(newFilterValues as any);\n };\n\n const handleSelectAll = useCallback(() => {\n const newFilterValues = cloneDeep(filterValues);\n\n if (anySelected) {\n if (searchStr !== \"\") {\n newFilterValues[activeGroup] = filterValues[activeGroup]?.filter(\n (value) => !activeGroupOptions.includes(value)\n );\n } else {\n newFilterValues[activeGroup] = [];\n }\n } else {\n newFilterValues[activeGroup] = [...activeGroupOptions];\n }\n\n setFilterValues(newFilterValues);\n }, [\n activeGroup,\n activeGroupOptions,\n anySelected,\n filterValues,\n setFilterValues,\n searchStr,\n ]);\n\n /**\n * Create selectAll component.\n *\n * @returns {*}\n */\n const SelectAll = useCallback(() => {\n const nbrSelected = activeFilterValues?.length;\n\n const defaultLabel = (\n <HvTypography component=\"span\">\n {nbrSelected > 0 ? (\n <>\n <b>{nbrSelected}</b>\n {` ${labels?.multiSelectionConjunction} ${activeGroupOptions.length}`}\n </>\n ) : (\n <>\n <b>{labels?.selectAll}</b>\n {` (${activeGroupOptions.length})`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select-all\")}\n label={defaultLabel}\n onChange={() => handleSelectAll()}\n className={classes.selectAll}\n indeterminate={anySelected && !allSelected}\n checked={allSelected}\n />\n </div>\n );\n }, [\n activeFilterValues?.length,\n activeGroupOptions.length,\n allSelected,\n anySelected,\n handleSelectAll,\n id,\n labels,\n classes?.selectAllContainer,\n classes?.selectAll,\n ]);\n\n return (\n <HvPanel id={setId(id, \"rightPanel\")} className={className}>\n {listValues.length > 0 ? (\n <>\n <HvInput\n id={setId(id, \"search\")}\n classes={{\n root: classes.search,\n }}\n type=\"search\"\n placeholder={labels?.searchBoxPlaceholder}\n value={searchStr}\n onChange={(_, str) => setSearchStr(str)}\n />\n <SelectAll />\n <HvList\n key={activeGroup}\n id={setId(id, \"list\")}\n values={listValues}\n className={classes.list}\n multiSelect\n useSelector\n showSelectAll={false}\n onChange={onChangeHandler}\n selectable\n condensed\n hasTooltips\n />\n </>\n ) : (\n emptyElement\n )}\n </HvPanel>\n );\n};\n"],"names":["useClasses","useState","useContext","HvFilterGroupContext","useMemo","useCallback","useEffect","cloneDeep","jsx","HvTypography","jsxs","Fragment","HvCheckBox","setId","HvPanel","HvInput","HvList"],"mappings":";;;;;;;;;;;;;;;AA+BO,MAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AACX,MAAoC;AAClC,QAAM,EAAE,QAAA,IAAYA,kBAAA,WAAW,WAAW;AAC1C,QAAM,CAAC,WAAW,YAAY,IAAIC,eAAiB,EAAE;AACrD,QAAM,CAAC,aAAa,cAAc,IAAIA,eAAkB,KAAK;AAC7D,QAAM,CAAC,aAAa,cAAc,IAAIA,eAAkB,KAAK;AAEvD,QAAA;AAAA,IACJ;AAAA,IACA,eAAe,CAAC;AAAA,IAChB;AAAA,IACA;AAAA,EAAA,IACEC,MAAAA,WAAWC,mBAAAA,oBAAoB;AAEnC,QAAM,qBAAqBC,MAAA;AAAA,IACzB,MACE,cAAc,WAAW,GAAG,KACzB;AAAA,MAAO,CAAC,WACP,OAAO,KAAK,YAAc,EAAA,SAAS,UAAU,aAAa;AAAA,MAE3D,IAAI,CAAC,WAAW,OAAO,EAAE,KAAK,CAAC;AAAA,IACpC,CAAC,eAAe,aAAa,SAAS;AAAA,EAAA;AAGxC,QAAM,qBAAqBA,MAAA;AAAA,IACzB,MACE,aAAa,WAAW,GAAG;AAAA,MAAO,CAAC,UACjC,mBAAmB,SAAS,KAAK;AAAA,IAAA,KAC9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,IAACM,MAAAA,SAAQ,EAAA,IAAID,MAAM,MAAA,IAAI,YAAY,GAAG,WACnC,UAAA,WAAW,SAAS,IAEjBH,2BAAAA,KAAAC,WAAAA,UAAA,EAAA,UAAA;AAAA,IAAAH,2BAAA;AAAA,MAACO,MAAA;AAAA,MAAA;AAAA,QACC,IAAIF,MAAAA,MAAM,IAAI,QAAQ;AAAA,QACtB,SAAS;AAAA,UACP,MAAM,QAAQ;AAAA,QAChB;AAAA,QACA,MAAK;AAAA,QACL,aAAa,QAAQ;AAAA,QACrB,OAAO;AAAA,QACP,UAAU,CAAC,GAAG,QAAQ,aAAa,GAAG;AAAA,MAAA;AAAA,IACxC;AAAA,mCACC,WAAU,EAAA;AAAA,IACXL,2BAAA;AAAA,MAACQ,KAAA;AAAA,MAAA;AAAA,QAEC,IAAIH,MAAAA,MAAM,IAAI,MAAM;AAAA,QACpB,QAAQ;AAAA,QACR,WAAW,QAAQ;AAAA,QACnB,aAAW;AAAA,QACX,aAAW;AAAA,QACX,eAAe;AAAA,QACf,UAAU;AAAA,QACV,YAAU;AAAA,QACV,WAAS;AAAA,QACT,aAAW;AAAA,MAAA;AAAA,MAVN;AAAA,IAWP;AAAA,EAAA,GACF,IAEA,aAEJ,CAAA;AAEJ;;;"}
|
package/dist/cjs/Tag/Tag.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
4
5
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
6
|
const Chip = require("@mui/material/Chip");
|
|
6
7
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
@@ -13,7 +14,7 @@ const Chip__default = /* @__PURE__ */ _interopDefault(Chip);
|
|
|
13
14
|
const getCategoricalColor = (customColor, colors) => {
|
|
14
15
|
return customColor && colors?.[customColor] || customColor || colors?.cat1;
|
|
15
16
|
};
|
|
16
|
-
const HvTag = (props) => {
|
|
17
|
+
const HvTag = React.forwardRef((props, ref) => {
|
|
17
18
|
const {
|
|
18
19
|
classes: classesProp,
|
|
19
20
|
className,
|
|
@@ -62,6 +63,7 @@ const HvTag = (props) => {
|
|
|
62
63
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
64
|
Chip__default.default,
|
|
64
65
|
{
|
|
66
|
+
ref,
|
|
65
67
|
label,
|
|
66
68
|
disabled,
|
|
67
69
|
className: cx({ [clickableClass]: isClickable }, className),
|
|
@@ -98,7 +100,7 @@ const HvTag = (props) => {
|
|
|
98
100
|
...others
|
|
99
101
|
}
|
|
100
102
|
);
|
|
101
|
-
};
|
|
103
|
+
});
|
|
102
104
|
exports.tagClasses = Tag_styles.staticClasses;
|
|
103
105
|
exports.HvTag = HvTag;
|
|
104
106
|
//# sourceMappingURL=Tag.cjs.map
|
package/dist/cjs/Tag/Tag.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.cjs","sources":["../../../src/Tag/Tag.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\";\nimport { HvColorAny, getColor } from \"@hitachivantara/uikit-styles\";\nimport Chip, { ChipProps as MuiChipProps } from \"@mui/material/Chip\";\n\nimport {\n Checkbox,\n CheckboxCheck,\n CloseXS,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { ExtractNames } from \"../utils/classes\";\n\nimport { useControlled } from \"../hooks/useControlled\";\n\nimport { staticClasses, useClasses } from \"./Tag.styles\";\n\nexport { staticClasses as tagClasses };\n\nexport type HvTagClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTagProps\n extends Omit<MuiChipProps, \"color\" | \"classes\" | \"onSelect\"> {\n /** The label of the tag element. */\n label?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** The type of the tag element. A tag can be of semantic or categoric type. */\n type?: \"semantic\" | \"categorical\";\n /** Background color to be applied to the tag */\n color?: HvColorAny;\n /** Icon used to customize the delete icon in the Chip element */\n deleteIcon?: React.ReactElement;\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component, in order to render the delete icon\n * */\n onDelete?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Callback triggered when any item is clicked. */\n onClick?: (event: React.MouseEvent<HTMLElement>, selected?: boolean) => void;\n /** Aria properties to apply to delete button in tag\n * @deprecated no longer used\n */\n deleteButtonArialLabel?: string;\n /** Props to apply to delete icon */\n deleteButtonProps?: HTMLAttributes<HTMLDivElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTagClasses;\n /** @ignore */\n ref?: MuiChipProps[\"ref\"];\n /** @ignore */\n component?: MuiChipProps[\"component\"];\n /** Determines whether or not the tag is selectable. */\n selectable?: boolean;\n /** Defines if the tag is selected. When defined the tag state becomes controlled. */\n selected?: boolean;\n /** When uncontrolled, defines the initial selected state. */\n defaultSelected?: boolean;\n}\n\nconst getCategoricalColor = (customColor?: HvColorAny, colors?: any) => {\n return (customColor && colors?.[customColor]) || customColor || colors?.cat1;\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 */\nexport const HvTag = (props
|
|
1
|
+
{"version":3,"file":"Tag.cjs","sources":["../../../src/Tag/Tag.tsx"],"sourcesContent":["import React, { HTMLAttributes, forwardRef } from \"react\";\nimport { HvColorAny, getColor } from \"@hitachivantara/uikit-styles\";\nimport Chip, { ChipProps as MuiChipProps } from \"@mui/material/Chip\";\n\nimport {\n Checkbox,\n CheckboxCheck,\n CloseXS,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { ExtractNames } from \"../utils/classes\";\n\nimport { useControlled } from \"../hooks/useControlled\";\n\nimport { staticClasses, useClasses } from \"./Tag.styles\";\n\nexport { staticClasses as tagClasses };\n\nexport type HvTagClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTagProps\n extends Omit<MuiChipProps, \"color\" | \"classes\" | \"onSelect\"> {\n /** The label of the tag element. */\n label?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** The type of the tag element. A tag can be of semantic or categoric type. */\n type?: \"semantic\" | \"categorical\";\n /** Background color to be applied to the tag */\n color?: HvColorAny;\n /** Icon used to customize the delete icon in the Chip element */\n deleteIcon?: React.ReactElement;\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component, in order to render the delete icon\n * */\n onDelete?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Callback triggered when any item is clicked. */\n onClick?: (event: React.MouseEvent<HTMLElement>, selected?: boolean) => void;\n /** Aria properties to apply to delete button in tag\n * @deprecated no longer used\n */\n deleteButtonArialLabel?: string;\n /** Props to apply to delete icon */\n deleteButtonProps?: HTMLAttributes<HTMLDivElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTagClasses;\n /** @ignore */\n ref?: MuiChipProps[\"ref\"];\n /** @ignore */\n component?: MuiChipProps[\"component\"];\n /** Determines whether or not the tag is selectable. */\n selectable?: boolean;\n /** Defines if the tag is selected. When defined the tag state becomes controlled. */\n selected?: boolean;\n /** When uncontrolled, defines the initial selected state. */\n defaultSelected?: boolean;\n}\n\nconst getCategoricalColor = (customColor?: HvColorAny, colors?: any) => {\n return (customColor && colors?.[customColor]) || customColor || colors?.cat1;\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 */\nexport const HvTag = forwardRef<HTMLDivElement, HvTagProps>((props, ref) => {\n const {\n classes: classesProp,\n className,\n style,\n label,\n disabled,\n type = \"semantic\",\n selectable,\n selected,\n defaultSelected = false,\n color,\n deleteIcon,\n onDelete,\n onClick,\n // TODO: remove from API\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n deleteButtonArialLabel = \"Delete tag\",\n deleteButtonProps = {},\n ...others\n } = useDefaultProps(\"HvTag\", props);\n const { colors } = useTheme();\n const { classes, cx, css } = useClasses(classesProp);\n\n const [isSelected, setIsSelected] = useControlled(\n selected,\n Boolean(defaultSelected)\n );\n\n const defaultDeleteIcon = (\n <CloseXS\n role=\"none\"\n className={cx(classes.button, classes.tagButton)}\n iconSize=\"XS\"\n {...deleteButtonProps}\n />\n );\n\n const categoricalBackgroundColor =\n type === \"categorical\" ? getCategoricalColor(color, colors) : undefined;\n\n const backgroundColor =\n (type === \"semantic\" && getColor(color, \"neutral_20\")) ||\n (type === \"categorical\" && `${categoricalBackgroundColor}30`) ||\n undefined;\n\n const isClickable = !!(onClick || onDelete) && !disabled;\n\n const clickableClass = css({\n \"&:hover\": {\n boxShadow: `0 0 0 1pt ${categoricalBackgroundColor}`,\n },\n });\n\n const colorOverride = (disabled && [\"atmo3\", \"secondary_60\"]) || undefined;\n\n const avatarIcon = isSelected ? (\n <CheckboxCheck color={colorOverride} iconSize=\"XS\" />\n ) : (\n <Checkbox color={colorOverride} iconSize=\"XS\" />\n );\n\n return (\n <Chip\n ref={ref}\n label={label}\n disabled={disabled}\n className={cx({ [clickableClass]: isClickable }, className)}\n style={{\n ...(disabled ? null : { backgroundColor }),\n ...style,\n }}\n classes={{\n root: cx(classes.root, classes.chipRoot, {\n [classes.disabled]: disabled,\n [classes.clickable]: isClickable,\n [classes.categorical]: type === \"categorical\",\n [classes.categoricalFocus]: type === \"categorical\" && !disabled,\n [classes.categoricalDisabled]: type === \"categorical\" && disabled,\n }),\n label: classes.label,\n deleteIcon: cx(classes.deleteIcon, {\n [classes.disabledDeleteIcon]: disabled,\n }),\n }}\n deleteIcon={deleteIcon || defaultDeleteIcon}\n onDelete={disabled ? undefined : onDelete}\n onClick={(event) => {\n if (disabled) return;\n if (selectable) setIsSelected(!isSelected);\n onClick?.(event, !isSelected);\n }}\n aria-pressed={isSelected}\n {...(selectable &&\n type === \"semantic\" && {\n avatar: avatarIcon,\n })}\n {...others}\n />\n );\n});\n"],"names":["forwardRef","useDefaultProps","useTheme","useClasses","useControlled","jsx","CloseXS","getColor","CheckboxCheck","Checkbox","Chip"],"mappings":";;;;;;;;;;;;;AA6DA,MAAM,sBAAsB,CAAC,aAA0B,WAAiB;AACtE,SAAQ,eAAe,SAAS,WAAW,KAAM,eAAe,QAAQ;AAC1E;AAUO,MAAM,QAAQA,MAAA,WAAuC,CAAC,OAAO,QAAQ;AACpE,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA,IAGA,yBAAyB;AAAA,IACzB,oBAAoB,CAAC;AAAA,IACrB,GAAG;AAAA,EAAA,IACDC,gBAAgB,gBAAA,SAAS,KAAK;AAC5B,QAAA,EAAE,WAAWC,SAAAA;AACnB,QAAM,EAAE,SAAS,IAAI,IAAI,IAAIC,WAAAA,WAAW,WAAW;AAE7C,QAAA,CAAC,YAAY,aAAa,IAAIC,cAAA;AAAA,IAClC;AAAA,IACA,QAAQ,eAAe;AAAA,EAAA;AAGzB,QAAM,oBACJC,2BAAA;AAAA,IAACC,gBAAA;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAW,GAAG,QAAQ,QAAQ,QAAQ,SAAS;AAAA,MAC/C,UAAS;AAAA,MACR,GAAG;AAAA,IAAA;AAAA,EAAA;AAIR,QAAM,6BACJ,SAAS,gBAAgB,oBAAoB,OAAO,MAAM,IAAI;AAE1D,QAAA,kBACH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AAAU;AACV,YAAA;AAAY,wBAAc,CAAC,UAAU;AAC/B,kBAAA,OAAO,CAAC,UAAU;AAAA,MAC9B;AAAA,MACA,gBAAc;AAAA,MACb,GAAI,cACH,SAAS,cAAc;AAAA,QACrB,QAAQ;AAAA,MACV;AAAA,MACD,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.cjs","sources":["../../../src/Typography/Typography.tsx"],"sourcesContent":["import { ElementType, forwardRef } from \"react\";\n\nimport { PolymorphicComponentRef, PolymorphicRef } from \"../types/generic\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport {\n HvTypographyLegacyVariants,\n HvTypographyVariants,\n mapVariant,\n} from \"./utils\";\nimport { staticClasses, useClasses } from \"./Typography.styles\";\n\nexport { staticClasses as typographyClasses };\n\nexport type HvTypographyClasses = ExtractNames<typeof useClasses>;\n\nconst HvTypographyMap = {\n display: \"h1\",\n title1: \"h1\",\n title2: \"h2\",\n title3: \"h3\",\n title4: \"h4\",\n body: \"p\",\n label: \"span\",\n caption1: \"p\",\n caption2: \"p\",\n // LEGACY\n \"5xlTitle\": \"h1\",\n \"4xlTitle\": \"h1\",\n \"3xlTitle\": \"h1\",\n xxlTitle: \"h1\",\n xlTitle: \"h1\",\n lTitle: \"h2\",\n mTitle: \"h3\",\n sTitle: \"h4\",\n xsTitle: \"h5\",\n xxsTitle: \"h6\",\n sectionTitle: \"p\",\n highlightText: \"p\",\n normalText: \"p\",\n placeholderText: \"p\",\n link: \"p\",\n disabledText: \"p\",\n selectedNavText: \"p\",\n vizText: \"p\",\n vizTextDisabled: \"p\",\n xsInlineLink: \"p\",\n} satisfies Record<\n HvTypographyVariants | HvTypographyLegacyVariants,\n ElementType\n>;\n\nexport type HvTypographyProps<C extends React.ElementType = \"p\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the Typography. */\n variant?: HvTypographyVariants | HvTypographyLegacyVariants;\n /** If `true` the typography will display the look of a link. */\n link?: boolean;\n /** If `true` the typography will display the look of a disabled state. */\n disabled?: boolean;\n
|
|
1
|
+
{"version":3,"file":"Typography.cjs","sources":["../../../src/Typography/Typography.tsx"],"sourcesContent":["import { ElementType, forwardRef } from \"react\";\n\nimport { PolymorphicComponentRef, PolymorphicRef } from \"../types/generic\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport {\n HvTypographyLegacyVariants,\n HvTypographyVariants,\n mapVariant,\n} from \"./utils\";\nimport { staticClasses, useClasses } from \"./Typography.styles\";\n\nexport { staticClasses as typographyClasses };\n\nexport type HvTypographyClasses = ExtractNames<typeof useClasses>;\n\nconst HvTypographyMap = {\n display: \"h1\",\n title1: \"h1\",\n title2: \"h2\",\n title3: \"h3\",\n title4: \"h4\",\n body: \"p\",\n label: \"span\",\n caption1: \"p\",\n caption2: \"p\",\n // LEGACY\n \"5xlTitle\": \"h1\",\n \"4xlTitle\": \"h1\",\n \"3xlTitle\": \"h1\",\n xxlTitle: \"h1\",\n xlTitle: \"h1\",\n lTitle: \"h2\",\n mTitle: \"h3\",\n sTitle: \"h4\",\n xsTitle: \"h5\",\n xxsTitle: \"h6\",\n sectionTitle: \"p\",\n highlightText: \"p\",\n normalText: \"p\",\n placeholderText: \"p\",\n link: \"p\",\n disabledText: \"p\",\n selectedNavText: \"p\",\n vizText: \"p\",\n vizTextDisabled: \"p\",\n xsInlineLink: \"p\",\n} satisfies Record<\n HvTypographyVariants | HvTypographyLegacyVariants,\n ElementType\n>;\n\nexport type HvTypographyProps<C extends React.ElementType = \"p\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the Typography. */\n variant?: HvTypographyVariants | HvTypographyLegacyVariants;\n /** If `true` the typography will display the look of a link. */\n link?: boolean;\n /** If `true` the typography will display the look of a disabled state. */\n disabled?: boolean;\n /**\n * If `true`, the typography will render a \"p\" element\n * @deprecated use `component=\"p\"` instead\n * */\n paragraph?: boolean;\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n */\n noWrap?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTypographyClasses;\n }\n >;\n\n/**\n * Typography component is used to render text and paragraphs within an interface.\n */\nexport const HvTypography: <C extends React.ElementType = \"p\">(\n props: HvTypographyProps<C>\n) => React.ReactElement | null = forwardRef(\n <C extends React.ElementType = \"p\">(\n props: HvTypographyProps<C>,\n ref: PolymorphicRef<C>\n ) => {\n const {\n className,\n component: ComponentProp,\n classes: classesProp,\n variant: variantProp = \"body\",\n link = false,\n noWrap = false,\n paragraph = false,\n disabled = false,\n ...others\n } = useDefaultProps(\"HvTypography\", props);\n const { classes, cx } = useClasses(classesProp);\n const { activeTheme } = useTheme();\n\n const variant = mapVariant(variantProp, activeTheme?.name);\n\n const Component =\n ComponentProp || (paragraph && \"p\") || HvTypographyMap[variant] || \"span\";\n\n return (\n <Component\n ref={ref}\n className={cx(\n classes.root,\n classes[variant],\n {\n [classes.isLink]: link,\n [classes.noWrap]: noWrap,\n [classes.disabled]: disabled,\n },\n className\n )}\n disabled={disabled}\n {...others}\n />\n );\n }\n);\n"],"names":["forwardRef","useDefaultProps","useClasses","useTheme","mapVariant","jsx"],"mappings":";;;;;;;;AAiBA,MAAM,kBAAkB;AAAA,EACtB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA;AAAA,EAEV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAmCO,MAAM,eAEoBA,MAAA;AAAA,EAC/B,CACE,OACA,QACG;AACG,UAAA;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,MACX,SAAS;AAAA,MACT,SAAS,cAAc;AAAA,MACvB,OAAO;AAAA,MACP,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,GAAG;AAAA,IAAA,IACDC,gBAAgB,gBAAA,gBAAgB,KAAK;AACzC,UAAM,EAAE,SAAS,GAAG,IAAIC,6BAAW,WAAW;AACxC,UAAA,EAAE,gBAAgBC,SAAAA;AAExB,UAAM,UAAUC,MAAA,WAAW,aAAa,aAAa,IAAI;AAEzD,UAAM,YACJ,iBAAkB,aAAa,OAAQ,gBAAgB,OAAO,KAAK;AAGnE,WAAAC,2BAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ,OAAO;AAAA,UACf;AAAA,YACE,CAAC,QAAQ,MAAM,GAAG;AAAA,YAClB,CAAC,QAAQ,MAAM,GAAG;AAAA,YAClB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.styles.cjs","sources":["../../../src/Typography/Typography.styles.ts"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvTypography\", {\n root: {\n fontFamily: theme.fontFamily.body,\n },\n disabled: {\n color: theme.colors.secondary_60,\n },\n isLink: {\n color: theme.colors.primary,\n textDecoration: \"underline\",\n },\n noWrap: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n // variants\n display: { ...theme.typography.display },\n title1: { ...theme.typography.title1 },\n title2: { ...theme.typography.title2 },\n title3: { ...theme.typography.title3 },\n title4: { ...theme.typography.title4 },\n body: { ...theme.typography.body },\n label: { ...theme.typography.label },\n caption1: { ...theme.typography.caption1 },\n caption2: { ...theme.typography.caption2 },\n // legacy variants\n \"5xlTitle\": { ...theme.typography[\"5xlTitle\"] },\n \"4xlTitle\": { ...theme.typography[\"4xlTitle\"] },\n // @ts-ignore non-existent variant\n \"3xlTitle\": { ...theme.typography[\"3xlTitle\"] },\n xxlTitle: { ...theme.typography.xxlTitle },\n xlTitle: {},\n lTitle: { ...theme.typography.lTitle },\n mTitle: {},\n sTitle: { ...theme.typography.sTitle },\n xsTitle: {},\n xxsTitle: { ...theme.typography.xxsTitle },\n sectionTitle: {\n ...theme.typography.sectionTitle,\n textTransform: \"uppercase\",\n },\n highlightText: {},\n normalText: {},\n placeholderText: { ...theme.typography.placeholderText },\n link: {\n ...theme.typography.link,\n cursor: \"pointer\",\n textDecoration: \"underline\",\n },\n disabledText: { ...theme.typography.disabledText },\n selectedNavText: { ...theme.typography.selectedNavText },\n vizText: {},\n vizTextDisabled: { ...theme.typography.vizTextDisabled },\n xsInlineLink: { ...theme.typography.xsInlineLink },\n});\n"],"names":["createClasses","theme"],"mappings":";;;;AAIO,MAAM,EAAE,YAAY,kBAAkBA,QAAAA,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,YAAYC,YAAAA,MAAM,WAAW;AAAA,EAC/B;AAAA,EACA,UAAU;AAAA,IACR,OAAOA,YAAAA,MAAM,OAAO;AA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AAAA,EAChB,YAAY,CAAC;AAAA,EACb,iBAAiB,EAAE,GAAGA,kBAAM,WAAW,gBAAgB;AAAA,EACvD,MAAM;AAAA,IACJ,GAAGA,YAAAA,MAAM,WAAW;AAAA,IACpB,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA,cAAc,EAAE,GAAGA,kBAAM,WAAW,aAAa;AAAA,EACjD,iBAAiB,EAAE,GAAGA,kBAAM,WAAW,gBAAgB;AAAA,EACvD,SAAS,CAAC;AAAA,EACV,iBAAiB,EAAE,GAAGA,kBAAM,WAAW,gBAAgB;AAAA,EACvD,cAAc,EAAE,GAAGA,kBAAM,WAAW,aAAa;AACnD,CAAC;;;"}
|
|
1
|
+
{"version":3,"file":"Typography.styles.cjs","sources":["../../../src/Typography/Typography.styles.ts"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvTypography\", {\n root: {\n fontFamily: theme.fontFamily.body,\n },\n disabled: {\n color: theme.colors.secondary_60,\n },\n isLink: {\n cursor: \"pointer\",\n color: theme.colors.primary,\n textDecoration: \"underline\",\n },\n noWrap: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n // variants\n display: { ...theme.typography.display },\n title1: { ...theme.typography.title1 },\n title2: { ...theme.typography.title2 },\n title3: { ...theme.typography.title3 },\n title4: { ...theme.typography.title4 },\n body: { ...theme.typography.body },\n label: { ...theme.typography.label },\n caption1: { ...theme.typography.caption1 },\n caption2: { ...theme.typography.caption2 },\n // legacy variants\n \"5xlTitle\": { ...theme.typography[\"5xlTitle\"] },\n \"4xlTitle\": { ...theme.typography[\"4xlTitle\"] },\n // @ts-ignore non-existent variant\n \"3xlTitle\": { ...theme.typography[\"3xlTitle\"] },\n xxlTitle: { ...theme.typography.xxlTitle },\n xlTitle: {},\n lTitle: { ...theme.typography.lTitle },\n mTitle: {},\n sTitle: { ...theme.typography.sTitle },\n xsTitle: {},\n xxsTitle: { ...theme.typography.xxsTitle },\n sectionTitle: {\n ...theme.typography.sectionTitle,\n textTransform: \"uppercase\",\n },\n highlightText: {},\n normalText: {},\n placeholderText: { ...theme.typography.placeholderText },\n link: {\n ...theme.typography.link,\n cursor: \"pointer\",\n textDecoration: \"underline\",\n },\n disabledText: { ...theme.typography.disabledText },\n selectedNavText: { ...theme.typography.selectedNavText },\n vizText: {},\n vizTextDisabled: { ...theme.typography.vizTextDisabled },\n xsInlineLink: { ...theme.typography.xsInlineLink },\n});\n"],"names":["createClasses","theme"],"mappings":";;;;AAIO,MAAM,EAAE,YAAY,kBAAkBA,QAAAA,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,YAAYC,YAAAA,MAAM,WAAW;AAAA,EAC/B;AAAA,EACA,UAAU;AAAA,IACR,OAAOA,YAAAA,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,OAAOA,YAAAA,MAAM,OAAO;AAAA,IACpB,gBAAgB;AAAA,EAClB;AAAA,EACA,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA;AAAA,EAEA,SAAS,EAAE,GAAGA,kBAAM,WAAW,QAAQ;AAAA,EACvC,QAAQ,EAAE,GAAGA,kBAAM,WAAW,OAAO;AAAA,EACrC,QAAQ,EAAE,GAAGA,kBAAM,WAAW,OAAO;AAAA,EACrC,QAAQ,EAAE,GAAGA,kBAAM,WAAW,OAAO;AAAA,EACrC,QAAQ,EAAE,GAAGA,kBAAM,WAAW,OAAO;AAAA,EACrC,MAAM,EAAE,GAAGA,kBAAM,WAAW,KAAK;AAAA,EACjC,OAAO,EAAE,GAAGA,kBAAM,WAAW,MAAM;AAAA,EACnC,UAAU,EAAE,GAAGA,kBAAM,WAAW,SAAS;AAAA,EACzC,UAAU,EAAE,GAAGA,kBAAM,WAAW,SAAS;AAAA;AAAA,EAEzC,YAAY,EAAE,GAAGA,YAAAA,MAAM,WAAW,UAAU,EAAE;AAAA,EAC9C,YAAY,EAAE,GAAGA,YAAAA,MAAM,WAAW,UAAU,EAAE;AAAA;AAAA,EAE9C,YAAY,EAAE,GAAGA,YAAAA,MAAM,WAAW,UAAU,EAAE;AAAA,EAC9C,UAAU,EAAE,GAAGA,kBAAM,WAAW,SAAS;AAAA,EACzC,SAAS,CAAC;AAAA,EACV,QAAQ,EAAE,GAAGA,kBAAM,WAAW,OAAO;AAAA,EACrC,QAAQ,CAAC;AAAA,EACT,QAAQ,EAAE,GAAGA,kBAAM,WAAW,OAAO;AAAA,EACrC,SAAS,CAAC;AAAA,EACV,UAAU,EAAE,GAAGA,kBAAM,WAAW,SAAS;AAAA,EACzC,cAAc;AAAA,IACZ,GAAGA,YAAAA,MAAM,WAAW;AAAA,IACpB,eAAe;AAAA,EACjB;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,YAAY,CAAC;AAAA,EACb,iBAAiB,EAAE,GAAGA,kBAAM,WAAW,gBAAgB;AAAA,EACvD,MAAM;AAAA,IACJ,GAAGA,YAAAA,MAAM,WAAW;AAAA,IACpB,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA,cAAc,EAAE,GAAGA,kBAAM,WAAW,aAAa;AAAA,EACjD,iBAAiB,EAAE,GAAGA,kBAAM,WAAW,gBAAgB;AAAA,EACvD,SAAS,CAAC;AAAA,EACV,iBAAiB,EAAE,GAAGA,kBAAM,WAAW,gBAAgB;AAAA,EACvD,cAAc,EAAE,GAAGA,kBAAM,WAAW,aAAa;AACnD,CAAC;;;"}
|
|
@@ -30,7 +30,7 @@ const HvFilterGroupCounter = (props) => {
|
|
|
30
30
|
] : filterOptions;
|
|
31
31
|
const optionIdx = filterOptions.findIndex((option) => option.id === id);
|
|
32
32
|
let groupsCounter = 0;
|
|
33
|
-
appliedFilters.
|
|
33
|
+
appliedFilters.forEach((fg, i) => {
|
|
34
34
|
groupsCounter += getExistingFiltersById(i, filterValues, filterOptions);
|
|
35
35
|
});
|
|
36
36
|
const partialCounter = id ? getExistingFiltersById(optionIdx, filterValues, filterOptions) || 0 : groupsCounter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Counter.js","sources":["../../../../src/FilterGroup/Counter/Counter.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { ExtractNames } from \"../../utils/classes\";\n\nimport { useDefaultProps } from \"../../hooks/useDefaultProps\";\n\nimport { HvFilterGroupContext } from \"../FilterGroupContext\";\nimport { staticClasses, useClasses } from \"./Counter.styles\";\nimport { HvFilterGroupFilters, HvFilterGroupValue } from \"../types\";\n\nexport { staticClasses as filterGroupCounterClasses };\n\nexport type HvFilterGroupCounterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFilterGroupCounterProps {\n className?: string;\n id?: string;\n classes?: HvFilterGroupCounterClasses;\n}\n\nconst getExistingFiltersById = (\n idx: number,\n filterValues: HvFilterGroupValue,\n filterOptions: HvFilterGroupFilters\n) => {\n let total = 0;\n filterValues[idx]?.forEach((fv) => {\n if (filterOptions[idx]?.data.find((f) => f.id === fv)) {\n total += 1;\n }\n });\n return total;\n};\n\nexport const HvFilterGroupCounter = (props: HvFilterGroupCounterProps) => {\n const {\n className,\n id,\n classes: classesProp,\n } = useDefaultProps(\"HvFilterGroupCounter\", props);\n const { classes, cx } = useClasses(classesProp);\n const {\n filterOptions,\n filterValues = [],\n appliedFilters = [],\n } = useContext(HvFilterGroupContext);\n\n const options =\n id && filterOptions.find((option) => option.id === id)\n ? ([\n filterOptions.find((option) => option.id === id),\n ] as HvFilterGroupFilters)\n : filterOptions;\n const optionIdx = filterOptions.findIndex((option) => option.id === id);\n\n let groupsCounter = 0;\n appliedFilters
|
|
1
|
+
{"version":3,"file":"Counter.js","sources":["../../../../src/FilterGroup/Counter/Counter.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { ExtractNames } from \"../../utils/classes\";\n\nimport { useDefaultProps } from \"../../hooks/useDefaultProps\";\n\nimport { HvFilterGroupContext } from \"../FilterGroupContext\";\nimport { staticClasses, useClasses } from \"./Counter.styles\";\nimport { HvFilterGroupFilters, HvFilterGroupValue } from \"../types\";\n\nexport { staticClasses as filterGroupCounterClasses };\n\nexport type HvFilterGroupCounterClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFilterGroupCounterProps {\n className?: string;\n id?: string;\n classes?: HvFilterGroupCounterClasses;\n}\n\nconst getExistingFiltersById = (\n idx: number,\n filterValues: HvFilterGroupValue,\n filterOptions: HvFilterGroupFilters\n) => {\n let total = 0;\n filterValues[idx]?.forEach((fv) => {\n if (filterOptions[idx]?.data.find((f) => f.id === fv)) {\n total += 1;\n }\n });\n return total;\n};\n\nexport const HvFilterGroupCounter = (props: HvFilterGroupCounterProps) => {\n const {\n className,\n id,\n classes: classesProp,\n } = useDefaultProps(\"HvFilterGroupCounter\", props);\n const { classes, cx } = useClasses(classesProp);\n const {\n filterOptions,\n filterValues = [],\n appliedFilters = [],\n } = useContext(HvFilterGroupContext);\n\n const options =\n id && filterOptions.find((option) => option.id === id)\n ? ([\n filterOptions.find((option) => option.id === id),\n ] as HvFilterGroupFilters)\n : filterOptions;\n const optionIdx = filterOptions.findIndex((option) => option.id === id);\n\n let groupsCounter = 0;\n appliedFilters.forEach((fg, i) => {\n groupsCounter += getExistingFiltersById(i, filterValues, filterOptions);\n });\n\n const partialCounter = id\n ? getExistingFiltersById(optionIdx, filterValues, filterOptions) || 0\n : groupsCounter;\n\n const totalCounter = options.reduce(\n (acc, option) => acc + option.data.length,\n 0\n );\n\n return (\n <div className={cx(classes.root, className)}>\n {partialCounter > 0 ? (\n <p className={classes.partialCounter}>{partialCounter}</p>\n ) : (\n partialCounter\n )}\n {` / ${totalCounter}`}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAoBA,MAAM,yBAAyB,CAC7B,KACA,cACA,kBACG;AACH,MAAI,QAAQ;AACZ,eAAa,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
|
78
78
|
} else {
|
|
79
|
-
newFilterValues[activeGroup] = [
|
|
80
|
-
...filterValues[activeGroup],
|
|
81
|
-
...activeGroupOptions
|
|
82
|
-
];
|
|
79
|
+
newFilterValues[activeGroup] = [...activeGroupOptions];
|
|
83
80
|
}
|
|
84
81
|
setFilterValues(newFilterValues);
|
|
85
82
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightPanel.js","sources":["../../../../src/FilterGroup/RightPanel/RightPanel.tsx"],"sourcesContent":["import { useCallback, useContext, useEffect, useMemo, useState } from \"react\";\n\nimport cloneDeep from \"lodash/cloneDeep\";\n\nimport { HvCheckBox } from \"../../CheckBox\";\nimport { HvInput } from \"../../Input\";\nimport { HvList, HvListProps } from \"../../List\";\nimport { HvPanel } from \"../../Panel\";\nimport { HvTypography } from \"../../Typography\";\nimport { ExtractNames } from \"../../utils/classes\";\nimport { setId } from \"../../utils/setId\";\n\nimport { HvFilterGroupContext } from \"../FilterGroupContext\";\nimport { staticClasses, useClasses } from \"./RightPanel.styles\";\n\nexport { staticClasses as filterGroupRightPanelClasses };\n\nexport type HvFilterGroupRightPanelClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFilterGroupRightPanelProps {\n id?: string;\n className?: string;\n labels?: {\n searchBoxPlaceholder?: string;\n selectAll?: string;\n multiSelectionConjunction?: string;\n };\n emptyElement?: React.ReactNode;\n classes?: HvFilterGroupRightPanelClasses;\n}\n\nexport const HvFilterGroupRightPanel = ({\n id,\n className,\n labels,\n emptyElement,\n classes: classesProp,\n}: HvFilterGroupRightPanelProps) => {\n const { classes } = useClasses(classesProp);\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const [allSelected, setAllSelected] = useState<boolean>(false);\n const [anySelected, setAnySelected] = useState<boolean>(false);\n\n const {\n filterOptions,\n filterValues = [],\n setFilterValues,\n activeGroup,\n } = useContext(HvFilterGroupContext);\n\n const activeGroupOptions = useMemo(\n () =>\n filterOptions[activeGroup]?.data\n .filter((option) =>\n option.name.toLowerCase().includes(searchStr.toLowerCase())\n )\n .map((option) => option.id) || [],\n [filterOptions, activeGroup, searchStr]\n );\n\n const activeFilterValues = useMemo(\n () =>\n filterValues[activeGroup]?.filter((value) =>\n activeGroupOptions.includes(value)\n ) || [],\n [filterValues, activeGroupOptions, activeGroup]\n );\n\n const listValues = useMemo(\n () =>\n filterOptions[activeGroup]?.data.map((option) => ({\n ...option,\n label: option.name,\n selected: filterValues[activeGroup]?.includes(option.id),\n isHidden:\n option.name.toLowerCase().indexOf(searchStr.toLowerCase()) < 0,\n })) || [],\n [filterOptions, filterValues, activeGroup, searchStr]\n );\n\n const updateSelectAll = useCallback(() => {\n const nbrSelected = activeFilterValues?.length;\n const hasSelection = nbrSelected > 0;\n const allSelect = nbrSelected === activeGroupOptions.length;\n\n setAnySelected(hasSelection);\n setAllSelected(hasSelection && allSelect);\n }, [activeFilterValues, activeGroupOptions]);\n\n useEffect(() => {\n updateSelectAll();\n }, [activeFilterValues, updateSelectAll]);\n\n useEffect(() => setSearchStr(\"\"), [activeGroup]);\n\n const onChangeHandler: HvListProps[\"onChange\"] = (values) => {\n const newFilterValues = filterOptions.map((_, i) =>\n activeGroup === i\n ? values.filter((v) => v.selected).map((v) => v.id)\n : [...(filterValues[i] || [])]\n );\n setFilterValues(newFilterValues as any);\n };\n\n const handleSelectAll = useCallback(() => {\n const newFilterValues = cloneDeep(filterValues);\n\n if (anySelected) {\n if (searchStr !== \"\") {\n newFilterValues[activeGroup] = filterValues[activeGroup]?.filter(\n (value) => !activeGroupOptions.includes(value)\n );\n } else {\n newFilterValues[activeGroup] = [];\n }\n } else {\n newFilterValues[activeGroup] = [
|
|
1
|
+
{"version":3,"file":"RightPanel.js","sources":["../../../../src/FilterGroup/RightPanel/RightPanel.tsx"],"sourcesContent":["import { useCallback, useContext, useEffect, useMemo, useState } from \"react\";\n\nimport cloneDeep from \"lodash/cloneDeep\";\n\nimport { HvCheckBox } from \"../../CheckBox\";\nimport { HvInput } from \"../../Input\";\nimport { HvList, HvListProps } from \"../../List\";\nimport { HvPanel } from \"../../Panel\";\nimport { HvTypography } from \"../../Typography\";\nimport { ExtractNames } from \"../../utils/classes\";\nimport { setId } from \"../../utils/setId\";\n\nimport { HvFilterGroupContext } from \"../FilterGroupContext\";\nimport { staticClasses, useClasses } from \"./RightPanel.styles\";\n\nexport { staticClasses as filterGroupRightPanelClasses };\n\nexport type HvFilterGroupRightPanelClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFilterGroupRightPanelProps {\n id?: string;\n className?: string;\n labels?: {\n searchBoxPlaceholder?: string;\n selectAll?: string;\n multiSelectionConjunction?: string;\n };\n emptyElement?: React.ReactNode;\n classes?: HvFilterGroupRightPanelClasses;\n}\n\nexport const HvFilterGroupRightPanel = ({\n id,\n className,\n labels,\n emptyElement,\n classes: classesProp,\n}: HvFilterGroupRightPanelProps) => {\n const { classes } = useClasses(classesProp);\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const [allSelected, setAllSelected] = useState<boolean>(false);\n const [anySelected, setAnySelected] = useState<boolean>(false);\n\n const {\n filterOptions,\n filterValues = [],\n setFilterValues,\n activeGroup,\n } = useContext(HvFilterGroupContext);\n\n const activeGroupOptions = useMemo(\n () =>\n filterOptions[activeGroup]?.data\n .filter((option) =>\n option.name.toLowerCase().includes(searchStr.toLowerCase())\n )\n .map((option) => option.id) || [],\n [filterOptions, activeGroup, searchStr]\n );\n\n const activeFilterValues = useMemo(\n () =>\n filterValues[activeGroup]?.filter((value) =>\n activeGroupOptions.includes(value)\n ) || [],\n [filterValues, activeGroupOptions, activeGroup]\n );\n\n const listValues = useMemo(\n () =>\n filterOptions[activeGroup]?.data.map((option) => ({\n ...option,\n label: option.name,\n selected: filterValues[activeGroup]?.includes(option.id),\n isHidden:\n option.name.toLowerCase().indexOf(searchStr.toLowerCase()) < 0,\n })) || [],\n [filterOptions, filterValues, activeGroup, searchStr]\n );\n\n const updateSelectAll = useCallback(() => {\n const nbrSelected = activeFilterValues?.length;\n const hasSelection = nbrSelected > 0;\n const allSelect = nbrSelected === activeGroupOptions.length;\n\n setAnySelected(hasSelection);\n setAllSelected(hasSelection && allSelect);\n }, [activeFilterValues, activeGroupOptions]);\n\n useEffect(() => {\n updateSelectAll();\n }, [activeFilterValues, updateSelectAll]);\n\n useEffect(() => setSearchStr(\"\"), [activeGroup]);\n\n const onChangeHandler: HvListProps[\"onChange\"] = (values) => {\n const newFilterValues = filterOptions.map((_, i) =>\n activeGroup === i\n ? values.filter((v) => v.selected).map((v) => v.id)\n : [...(filterValues[i] || [])]\n );\n setFilterValues(newFilterValues as any);\n };\n\n const handleSelectAll = useCallback(() => {\n const newFilterValues = cloneDeep(filterValues);\n\n if (anySelected) {\n if (searchStr !== \"\") {\n newFilterValues[activeGroup] = filterValues[activeGroup]?.filter(\n (value) => !activeGroupOptions.includes(value)\n );\n } else {\n newFilterValues[activeGroup] = [];\n }\n } else {\n newFilterValues[activeGroup] = [...activeGroupOptions];\n }\n\n setFilterValues(newFilterValues);\n }, [\n activeGroup,\n activeGroupOptions,\n anySelected,\n filterValues,\n setFilterValues,\n searchStr,\n ]);\n\n /**\n * Create selectAll component.\n *\n * @returns {*}\n */\n const SelectAll = useCallback(() => {\n const nbrSelected = activeFilterValues?.length;\n\n const defaultLabel = (\n <HvTypography component=\"span\">\n {nbrSelected > 0 ? (\n <>\n <b>{nbrSelected}</b>\n {` ${labels?.multiSelectionConjunction} ${activeGroupOptions.length}`}\n </>\n ) : (\n <>\n <b>{labels?.selectAll}</b>\n {` (${activeGroupOptions.length})`}\n </>\n )}\n </HvTypography>\n );\n\n return (\n <div className={classes.selectAllContainer}>\n <HvCheckBox\n id={setId(id, \"select-all\")}\n label={defaultLabel}\n onChange={() => handleSelectAll()}\n className={classes.selectAll}\n indeterminate={anySelected && !allSelected}\n checked={allSelected}\n />\n </div>\n );\n }, [\n activeFilterValues?.length,\n activeGroupOptions.length,\n allSelected,\n anySelected,\n handleSelectAll,\n id,\n labels,\n classes?.selectAllContainer,\n classes?.selectAll,\n ]);\n\n return (\n <HvPanel id={setId(id, \"rightPanel\")} className={className}>\n {listValues.length > 0 ? (\n <>\n <HvInput\n id={setId(id, \"search\")}\n classes={{\n root: classes.search,\n }}\n type=\"search\"\n placeholder={labels?.searchBoxPlaceholder}\n value={searchStr}\n onChange={(_, str) => setSearchStr(str)}\n />\n <SelectAll />\n <HvList\n key={activeGroup}\n id={setId(id, \"list\")}\n values={listValues}\n className={classes.list}\n multiSelect\n useSelector\n showSelectAll={false}\n onChange={onChangeHandler}\n selectable\n condensed\n hasTooltips\n />\n </>\n ) : (\n emptyElement\n )}\n </HvPanel>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA+BO,MAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AACX,MAAoC;AAClC,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AAC1C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAiB,EAAE;AACrD,QAAM,CAAC,aAAa,cAAc,IAAI,SAAkB,KAAK;AAC7D,QAAM,CAAC,aAAa,cAAc,IAAI,SAAkB,KAAK;AAEvD,QAAA;AAAA,IACJ;AAAA,IACA,eAAe,CAAC;AAAA,IAChB;AAAA,IACA;AAAA,EAAA,IACE,WAAW,oBAAoB;AAEnC,QAAM,qBAAqB;AAAA,IACzB,MACE,cAAc,WAAW,GAAG,KACzB;AAAA,MAAO,CAAC,WACP,OAAO,KAAK,YAAc,EAAA,SAAS,UAAU,aAAa;AAAA,MAE3D,IAAI,CAAC,WAAW,OAAO,EAAE,KAAK,CAAC;AAAA,IACpC,CAAC,eAAe,aAAa,SAAS;AAAA,EAAA;AAGxC,QAAM,qBAAqB;AAAA,IACzB,MACE,aAAa,WAAW,GAAG;AAAA,MAAO,CAAC,UACjC,mBAAmB,SAAS,KAAK;AAAA,IAAA,KAC9B,CAAC;AAAA,IACR,CAAC,cAAc,oBAAoB,WAAW;A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AS;AAAA,UACP,MAAM,QAAQ;AAAA,QAChB;AAAA,QACA,MAAK;AAAA,QACL,aAAa,QAAQ;AAAA,QACrB,OAAO;AAAA,QACP,UAAU,CAAC,GAAG,QAAQ,aAAa,GAAG;AAAA,MAAA;AAAA,IACxC;AAAA,wBACC,WAAU,EAAA;AAAA,IACX;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,IAAI,MAAM,IAAI,MAAM;AAAA,QACpB,QAAQ;AAAA,QACR,WAAW,QAAQ;AAAA,QACnB,aAAW;AAAA,QACX,aAAW;AAAA,QACX,eAAe;AAAA,QACf,UAAU;AAAA,QACV,YAAU;AAAA,QACV,WAAS;AAAA,QACT,aAAW;AAAA,MAAA;AAAA,MAVN;AAAA,IAWP;AAAA,EAAA,GACF,IAEA,aAEJ,CAAA;AAEJ;"}
|
package/dist/esm/Tag/Tag.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
2
3
|
import { getColor } from "@hitachivantara/uikit-styles";
|
|
3
4
|
import Chip from "@mui/material/Chip";
|
|
4
5
|
import { CloseXS, CheckboxCheck, Checkbox } from "@hitachivantara/uikit-react-icons";
|
|
@@ -10,7 +11,7 @@ import { staticClasses } from "./Tag.styles.js";
|
|
|
10
11
|
const getCategoricalColor = (customColor, colors) => {
|
|
11
12
|
return customColor && colors?.[customColor] || customColor || colors?.cat1;
|
|
12
13
|
};
|
|
13
|
-
const HvTag = (props) => {
|
|
14
|
+
const HvTag = forwardRef((props, ref) => {
|
|
14
15
|
const {
|
|
15
16
|
classes: classesProp,
|
|
16
17
|
className,
|
|
@@ -59,6 +60,7 @@ const HvTag = (props) => {
|
|
|
59
60
|
return /* @__PURE__ */ jsx(
|
|
60
61
|
Chip,
|
|
61
62
|
{
|
|
63
|
+
ref,
|
|
62
64
|
label,
|
|
63
65
|
disabled,
|
|
64
66
|
className: cx({ [clickableClass]: isClickable }, className),
|
|
@@ -95,7 +97,7 @@ const HvTag = (props) => {
|
|
|
95
97
|
...others
|
|
96
98
|
}
|
|
97
99
|
);
|
|
98
|
-
};
|
|
100
|
+
});
|
|
99
101
|
export {
|
|
100
102
|
HvTag,
|
|
101
103
|
staticClasses as tagClasses
|
package/dist/esm/Tag/Tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.js","sources":["../../../src/Tag/Tag.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\";\nimport { HvColorAny, getColor } from \"@hitachivantara/uikit-styles\";\nimport Chip, { ChipProps as MuiChipProps } from \"@mui/material/Chip\";\n\nimport {\n Checkbox,\n CheckboxCheck,\n CloseXS,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { ExtractNames } from \"../utils/classes\";\n\nimport { useControlled } from \"../hooks/useControlled\";\n\nimport { staticClasses, useClasses } from \"./Tag.styles\";\n\nexport { staticClasses as tagClasses };\n\nexport type HvTagClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTagProps\n extends Omit<MuiChipProps, \"color\" | \"classes\" | \"onSelect\"> {\n /** The label of the tag element. */\n label?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** The type of the tag element. A tag can be of semantic or categoric type. */\n type?: \"semantic\" | \"categorical\";\n /** Background color to be applied to the tag */\n color?: HvColorAny;\n /** Icon used to customize the delete icon in the Chip element */\n deleteIcon?: React.ReactElement;\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component, in order to render the delete icon\n * */\n onDelete?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Callback triggered when any item is clicked. */\n onClick?: (event: React.MouseEvent<HTMLElement>, selected?: boolean) => void;\n /** Aria properties to apply to delete button in tag\n * @deprecated no longer used\n */\n deleteButtonArialLabel?: string;\n /** Props to apply to delete icon */\n deleteButtonProps?: HTMLAttributes<HTMLDivElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTagClasses;\n /** @ignore */\n ref?: MuiChipProps[\"ref\"];\n /** @ignore */\n component?: MuiChipProps[\"component\"];\n /** Determines whether or not the tag is selectable. */\n selectable?: boolean;\n /** Defines if the tag is selected. When defined the tag state becomes controlled. */\n selected?: boolean;\n /** When uncontrolled, defines the initial selected state. */\n defaultSelected?: boolean;\n}\n\nconst getCategoricalColor = (customColor?: HvColorAny, colors?: any) => {\n return (customColor && colors?.[customColor]) || customColor || colors?.cat1;\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 */\nexport const HvTag = (props
|
|
1
|
+
{"version":3,"file":"Tag.js","sources":["../../../src/Tag/Tag.tsx"],"sourcesContent":["import React, { HTMLAttributes, forwardRef } from \"react\";\nimport { HvColorAny, getColor } from \"@hitachivantara/uikit-styles\";\nimport Chip, { ChipProps as MuiChipProps } from \"@mui/material/Chip\";\n\nimport {\n Checkbox,\n CheckboxCheck,\n CloseXS,\n} from \"@hitachivantara/uikit-react-icons\";\n\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { ExtractNames } from \"../utils/classes\";\n\nimport { useControlled } from \"../hooks/useControlled\";\n\nimport { staticClasses, useClasses } from \"./Tag.styles\";\n\nexport { staticClasses as tagClasses };\n\nexport type HvTagClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTagProps\n extends Omit<MuiChipProps, \"color\" | \"classes\" | \"onSelect\"> {\n /** The label of the tag element. */\n label?: React.ReactNode;\n /** Indicates that the form element is disabled. */\n disabled?: boolean;\n /** The type of the tag element. A tag can be of semantic or categoric type. */\n type?: \"semantic\" | \"categorical\";\n /** Background color to be applied to the tag */\n color?: HvColorAny;\n /** Icon used to customize the delete icon in the Chip element */\n deleteIcon?: React.ReactElement;\n /**\n * The callback fired when the delete icon is pressed.\n * This function has to be provided to the component, in order to render the delete icon\n * */\n onDelete?: (event: React.MouseEvent<HTMLElement>) => void;\n /** Callback triggered when any item is clicked. */\n onClick?: (event: React.MouseEvent<HTMLElement>, selected?: boolean) => void;\n /** Aria properties to apply to delete button in tag\n * @deprecated no longer used\n */\n deleteButtonArialLabel?: string;\n /** Props to apply to delete icon */\n deleteButtonProps?: HTMLAttributes<HTMLDivElement>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTagClasses;\n /** @ignore */\n ref?: MuiChipProps[\"ref\"];\n /** @ignore */\n component?: MuiChipProps[\"component\"];\n /** Determines whether or not the tag is selectable. */\n selectable?: boolean;\n /** Defines if the tag is selected. When defined the tag state becomes controlled. */\n selected?: boolean;\n /** When uncontrolled, defines the initial selected state. */\n defaultSelected?: boolean;\n}\n\nconst getCategoricalColor = (customColor?: HvColorAny, colors?: any) => {\n return (customColor && colors?.[customColor]) || customColor || colors?.cat1;\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 */\nexport const HvTag = forwardRef<HTMLDivElement, HvTagProps>((props, ref) => {\n const {\n classes: classesProp,\n className,\n style,\n label,\n disabled,\n type = \"semantic\",\n selectable,\n selected,\n defaultSelected = false,\n color,\n deleteIcon,\n onDelete,\n onClick,\n // TODO: remove from API\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n deleteButtonArialLabel = \"Delete tag\",\n deleteButtonProps = {},\n ...others\n } = useDefaultProps(\"HvTag\", props);\n const { colors } = useTheme();\n const { classes, cx, css } = useClasses(classesProp);\n\n const [isSelected, setIsSelected] = useControlled(\n selected,\n Boolean(defaultSelected)\n );\n\n const defaultDeleteIcon = (\n <CloseXS\n role=\"none\"\n className={cx(classes.button, classes.tagButton)}\n iconSize=\"XS\"\n {...deleteButtonProps}\n />\n );\n\n const categoricalBackgroundColor =\n type === \"categorical\" ? getCategoricalColor(color, colors) : undefined;\n\n const backgroundColor =\n (type === \"semantic\" && getColor(color, \"neutral_20\")) ||\n (type === \"categorical\" && `${categoricalBackgroundColor}30`) ||\n undefined;\n\n const isClickable = !!(onClick || onDelete) && !disabled;\n\n const clickableClass = css({\n \"&:hover\": {\n boxShadow: `0 0 0 1pt ${categoricalBackgroundColor}`,\n },\n });\n\n const colorOverride = (disabled && [\"atmo3\", \"secondary_60\"]) || undefined;\n\n const avatarIcon = isSelected ? (\n <CheckboxCheck color={colorOverride} iconSize=\"XS\" />\n ) : (\n <Checkbox color={colorOverride} iconSize=\"XS\" />\n );\n\n return (\n <Chip\n ref={ref}\n label={label}\n disabled={disabled}\n className={cx({ [clickableClass]: isClickable }, className)}\n style={{\n ...(disabled ? null : { backgroundColor }),\n ...style,\n }}\n classes={{\n root: cx(classes.root, classes.chipRoot, {\n [classes.disabled]: disabled,\n [classes.clickable]: isClickable,\n [classes.categorical]: type === \"categorical\",\n [classes.categoricalFocus]: type === \"categorical\" && !disabled,\n [classes.categoricalDisabled]: type === \"categorical\" && disabled,\n }),\n label: classes.label,\n deleteIcon: cx(classes.deleteIcon, {\n [classes.disabledDeleteIcon]: disabled,\n }),\n }}\n deleteIcon={deleteIcon || defaultDeleteIcon}\n onDelete={disabled ? undefined : onDelete}\n onClick={(event) => {\n if (disabled) return;\n if (selectable) setIsSelected(!isSelected);\n onClick?.(event, !isSelected);\n }}\n aria-pressed={isSelected}\n {...(selectable &&\n type === \"semantic\" && {\n avatar: avatarIcon,\n })}\n {...others}\n />\n );\n});\n"],"names":[],"mappings":";;;;;;;;;;AA6DA,MAAM,sBAAsB,CAAC,aAA0B,WAAiB;AACtE,SAAQ,eAAe,SAAS,WAAW,KAAM,eAAe,QAAQ;AAC1E;AAUO,MAAM,QAAQ,WAAuC,CAAC,OAAO,QAAQ;AACpE,QAAA;AAAA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A,MAC1D,OAAO;AAAA,QACL,GAAI,WAAW,OAAO,EAAE,gBAAgB;AAAA,QACxC,GAAG;AAAA,MACL;AAAA,MACA,SAAS;AAAA,QACP,MAAM,GAAG,QAAQ,MAAM,QAAQ,UAAU;AAAA,UACvC,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACpB,CAAC,QAAQ,SAAS,GAAG;AAAA,UACrB,CAAC,QAAQ,WAAW,GAAG,SAAS;AAAA,UAChC,CAAC,QAAQ,gBAAgB,GAAG,SAAS,iBAAiB,CAAC;AAAA,UACvD,CAAC,QAAQ,mBAAmB,GAAG,SAAS,iBAAiB;AAAA,QAAA,CAC1D;AAAA,QACD,OAAO,QAAQ;AAAA,QACf,YAAY,GAAG,QAAQ,YAAY;AAAA,UACjC,CAAC,QAAQ,kBAAkB,GAAG;AAAA,QAAA,CAC/B;AAAA,MACH;AAAA,MACA,YAAY,cAAc;AAAA,MAC1B,UAAU,WAAW,SAAY;AAAA,MACjC,SAAS,CAAC,UAAU;AACd,YAAA;AAAU;AACV,YAAA;AAAY,wBAAc,CAAC,UAAU;AAC/B,kBAAA,OAAO,CAAC,UAAU;AAAA,MAC9B;AAAA,MACA,gBAAc;AAAA,MACb,GAAI,cACH,SAAS,cAAc;AAAA,QACrB,QAAQ;AAAA,MACV;AAAA,MACD,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.js","sources":["../../../src/Typography/Typography.tsx"],"sourcesContent":["import { ElementType, forwardRef } from \"react\";\n\nimport { PolymorphicComponentRef, PolymorphicRef } from \"../types/generic\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport {\n HvTypographyLegacyVariants,\n HvTypographyVariants,\n mapVariant,\n} from \"./utils\";\nimport { staticClasses, useClasses } from \"./Typography.styles\";\n\nexport { staticClasses as typographyClasses };\n\nexport type HvTypographyClasses = ExtractNames<typeof useClasses>;\n\nconst HvTypographyMap = {\n display: \"h1\",\n title1: \"h1\",\n title2: \"h2\",\n title3: \"h3\",\n title4: \"h4\",\n body: \"p\",\n label: \"span\",\n caption1: \"p\",\n caption2: \"p\",\n // LEGACY\n \"5xlTitle\": \"h1\",\n \"4xlTitle\": \"h1\",\n \"3xlTitle\": \"h1\",\n xxlTitle: \"h1\",\n xlTitle: \"h1\",\n lTitle: \"h2\",\n mTitle: \"h3\",\n sTitle: \"h4\",\n xsTitle: \"h5\",\n xxsTitle: \"h6\",\n sectionTitle: \"p\",\n highlightText: \"p\",\n normalText: \"p\",\n placeholderText: \"p\",\n link: \"p\",\n disabledText: \"p\",\n selectedNavText: \"p\",\n vizText: \"p\",\n vizTextDisabled: \"p\",\n xsInlineLink: \"p\",\n} satisfies Record<\n HvTypographyVariants | HvTypographyLegacyVariants,\n ElementType\n>;\n\nexport type HvTypographyProps<C extends React.ElementType = \"p\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the Typography. */\n variant?: HvTypographyVariants | HvTypographyLegacyVariants;\n /** If `true` the typography will display the look of a link. */\n link?: boolean;\n /** If `true` the typography will display the look of a disabled state. */\n disabled?: boolean;\n
|
|
1
|
+
{"version":3,"file":"Typography.js","sources":["../../../src/Typography/Typography.tsx"],"sourcesContent":["import { ElementType, forwardRef } from \"react\";\n\nimport { PolymorphicComponentRef, PolymorphicRef } from \"../types/generic\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { useTheme } from \"../hooks/useTheme\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport {\n HvTypographyLegacyVariants,\n HvTypographyVariants,\n mapVariant,\n} from \"./utils\";\nimport { staticClasses, useClasses } from \"./Typography.styles\";\n\nexport { staticClasses as typographyClasses };\n\nexport type HvTypographyClasses = ExtractNames<typeof useClasses>;\n\nconst HvTypographyMap = {\n display: \"h1\",\n title1: \"h1\",\n title2: \"h2\",\n title3: \"h3\",\n title4: \"h4\",\n body: \"p\",\n label: \"span\",\n caption1: \"p\",\n caption2: \"p\",\n // LEGACY\n \"5xlTitle\": \"h1\",\n \"4xlTitle\": \"h1\",\n \"3xlTitle\": \"h1\",\n xxlTitle: \"h1\",\n xlTitle: \"h1\",\n lTitle: \"h2\",\n mTitle: \"h3\",\n sTitle: \"h4\",\n xsTitle: \"h5\",\n xxsTitle: \"h6\",\n sectionTitle: \"p\",\n highlightText: \"p\",\n normalText: \"p\",\n placeholderText: \"p\",\n link: \"p\",\n disabledText: \"p\",\n selectedNavText: \"p\",\n vizText: \"p\",\n vizTextDisabled: \"p\",\n xsInlineLink: \"p\",\n} satisfies Record<\n HvTypographyVariants | HvTypographyLegacyVariants,\n ElementType\n>;\n\nexport type HvTypographyProps<C extends React.ElementType = \"p\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the Typography. */\n variant?: HvTypographyVariants | HvTypographyLegacyVariants;\n /** If `true` the typography will display the look of a link. */\n link?: boolean;\n /** If `true` the typography will display the look of a disabled state. */\n disabled?: boolean;\n /**\n * If `true`, the typography will render a \"p\" element\n * @deprecated use `component=\"p\"` instead\n * */\n paragraph?: boolean;\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n */\n noWrap?: boolean;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvTypographyClasses;\n }\n >;\n\n/**\n * Typography component is used to render text and paragraphs within an interface.\n */\nexport const HvTypography: <C extends React.ElementType = \"p\">(\n props: HvTypographyProps<C>\n) => React.ReactElement | null = forwardRef(\n <C extends React.ElementType = \"p\">(\n props: HvTypographyProps<C>,\n ref: PolymorphicRef<C>\n ) => {\n const {\n className,\n component: ComponentProp,\n classes: classesProp,\n variant: variantProp = \"body\",\n link = false,\n noWrap = false,\n paragraph = false,\n disabled = false,\n ...others\n } = useDefaultProps(\"HvTypography\", props);\n const { classes, cx } = useClasses(classesProp);\n const { activeTheme } = useTheme();\n\n const variant = mapVariant(variantProp, activeTheme?.name);\n\n const Component =\n ComponentProp || (paragraph && \"p\") || HvTypographyMap[variant] || \"span\";\n\n return (\n <Component\n ref={ref}\n className={cx(\n classes.root,\n classes[variant],\n {\n [classes.isLink]: link,\n [classes.noWrap]: noWrap,\n [classes.disabled]: disabled,\n },\n className\n )}\n disabled={disabled}\n {...others}\n />\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;AAiBA,MAAM,kBAAkB;AAAA,EACtB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,UAAU;AAAA;AAAA,EAEV,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,cAAc;AAChB;AAmCO,MAAM,eAEoB;AAAA,EAC/B,CACE,OACA,QACG;AACG,UAAA;AAAA,MACJ;AAAA,MACA,WAAW;AAAA,MACX,SAAS;AAAA,MACT,SAAS,cAAc;AAAA,MACvB,OAAO;AAAA,MACP,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,GAAG;AAAA,IAAA,IACD,gBAAgB,gBAAgB,KAAK;AACzC,UAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AACxC,UAAA,EAAE,gBAAgB;AAExB,UAAM,UAAU,WAAW,aAAa,aAAa,IAAI;AAEzD,UAAM,YACJ,iBAAkB,aAAa,OAAQ,gBAAgB,OAAO,KAAK;AAGnE,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,UACR,QAAQ,OAAO;AAAA,UACf;AAAA,YACE,CAAC,QAAQ,MAAM,GAAG;AAAA,YAClB,CAAC,QAAQ,MAAM,GAAG;AAAA,YAClB,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACtB;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACC,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.styles.js","sources":["../../../src/Typography/Typography.styles.ts"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvTypography\", {\n root: {\n fontFamily: theme.fontFamily.body,\n },\n disabled: {\n color: theme.colors.secondary_60,\n },\n isLink: {\n color: theme.colors.primary,\n textDecoration: \"underline\",\n },\n noWrap: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n // variants\n display: { ...theme.typography.display },\n title1: { ...theme.typography.title1 },\n title2: { ...theme.typography.title2 },\n title3: { ...theme.typography.title3 },\n title4: { ...theme.typography.title4 },\n body: { ...theme.typography.body },\n label: { ...theme.typography.label },\n caption1: { ...theme.typography.caption1 },\n caption2: { ...theme.typography.caption2 },\n // legacy variants\n \"5xlTitle\": { ...theme.typography[\"5xlTitle\"] },\n \"4xlTitle\": { ...theme.typography[\"4xlTitle\"] },\n // @ts-ignore non-existent variant\n \"3xlTitle\": { ...theme.typography[\"3xlTitle\"] },\n xxlTitle: { ...theme.typography.xxlTitle },\n xlTitle: {},\n lTitle: { ...theme.typography.lTitle },\n mTitle: {},\n sTitle: { ...theme.typography.sTitle },\n xsTitle: {},\n xxsTitle: { ...theme.typography.xxsTitle },\n sectionTitle: {\n ...theme.typography.sectionTitle,\n textTransform: \"uppercase\",\n },\n highlightText: {},\n normalText: {},\n placeholderText: { ...theme.typography.placeholderText },\n link: {\n ...theme.typography.link,\n cursor: \"pointer\",\n textDecoration: \"underline\",\n },\n disabledText: { ...theme.typography.disabledText },\n selectedNavText: { ...theme.typography.selectedNavText },\n vizText: {},\n vizTextDisabled: { ...theme.typography.vizTextDisabled },\n xsInlineLink: { ...theme.typography.xsInlineLink },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,YAAY,kBAAkB,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,YAAY,MAAM,WAAW;AAAA,EAC/B;AAAA,EACA,UAAU;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,QAAQ;AAAA,IACN,OAAO,MAAM,OAAO;AAAA,IACpB,gBAAgB;AAAA,EAClB;AAAA,EACA,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA;AAAA,EAEA,SAAS,EAAE,GAAG,MAAM,WAAW,QAAQ;AAAA,EACvC,QAAQ,EAAE,GAAG,MAAM,WAAW,OAAO;AAAA,EACrC,QAAQ,EAAE,GAAG,MAAM,WAAW,OAAO;AAAA,EACrC,QAAQ,EAAE,GAAG,MAAM,WAAW,OAAO;AAAA,EACrC,QAAQ,EAAE,GAAG,MAAM,WAAW,OAAO;AAAA,EACrC,MAAM,EAAE,GAAG,MAAM,WAAW,KAAK;AAAA,EACjC,OAAO,EAAE,GAAG,MAAM,WAAW,MAAM;AAAA,EACnC,UAAU,EAAE,GAAG,MAAM,WAAW,SAAS;AAAA,EACzC,UAAU,EAAE,GAAG,MAAM,WAAW,SAAS;AAAA;AAAA,EAEzC,YAAY,EAAE,GAAG,MAAM,WAAW,UAAU,EAAE;AAAA,EAC9C,YAAY,EAAE,GAAG,MAAM,WAAW,UAAU,EAAE;AAAA;AAAA,EAE9C,YAAY,EAAE,GAAG,MAAM,WAAW,UAAU,EAAE;AAAA,EAC9C,UAAU,EAAE,GAAG,MAAM,WAAW,SAAS;AAAA,EACzC,SAAS,CAAC;AAAA,EACV,QAAQ,EAAE,GAAG,MAAM,WAAW,OAAO;AAAA,EACrC,QAAQ,CAAC;AAAA,EACT,QAAQ,EAAE,GAAG,MAAM,WAAW,OAAO;AAAA,EACrC,SAAS,CAAC;AAAA,EACV,UAAU,EAAE,GAAG,MAAM,WAAW,SAAS;AAAA,EACzC,cAAc;AAAA,IACZ,GAAG,MAAM,WAAW;AAAA,IACpB,eAAe;AAAA,EACjB;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,YAAY,CAAC;AAAA,EACb,iBAAiB,EAAE,GAAG,MAAM,WAAW,gBAAgB;AAAA,EACvD,MAAM;AAAA,IACJ,GAAG,MAAM,WAAW;AAAA,IACpB,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAClB;AAAA,EACA,cAAc,EAAE,GAAG,MAAM,WAAW,aAAa;AAAA,EACjD,iBAAiB,EAAE,GAAG,MAAM,WAAW,gBAAgB;AAAA,EACvD,SAAS,CAAC;AAAA,EACV,iBAAiB,EAAE,GAAG,MAAM,WAAW,gBAAgB;AAAA,EACvD,cAAc,EAAE,GAAG,MAAM,WAAW,aAAa;AACnD,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Typography.styles.js","sources":["../../../src/Typography/Typography.styles.ts"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvTypography\", {\n root: {\n fontFamily: theme.fontFamily.body,\n },\n disabled: {\n color: theme.colors.secondary_60,\n },\n isLink: {\n cursor: \"pointer\",\n color: theme.colors.primary,\n textDecoration: \"underline\",\n },\n noWrap: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n // variants\n display: { ...theme.typography.display },\n title1: { ...theme.typography.title1 },\n title2: { ...theme.typography.title2 },\n title3: { ...theme.typography.title3 },\n title4: { ...theme.typography.title4 },\n body: { ...theme.typography.body },\n label: { ...theme.typography.label },\n caption1: { ...theme.typography.caption1 },\n caption2: { ...theme.typography.caption2 },\n // legacy variants\n \"5xlTitle\": { ...theme.typography[\"5xlTitle\"] },\n \"4xlTitle\": { ...theme.typography[\"4xlTitle\"] },\n // @ts-ignore non-existent variant\n \"3xlTitle\": { ...theme.typography[\"3xlTitle\"] },\n xxlTitle: { ...theme.typography.xxlTitle },\n xlTitle: {},\n lTitle: { ...theme.typography.lTitle },\n mTitle: {},\n sTitle: { ...theme.typography.sTitle },\n xsTitle: {},\n xxsTitle: { ...theme.typography.xxsTitle },\n sectionTitle: {\n ...theme.typography.sectionTitle,\n textTransform: \"uppercase\",\n },\n highlightText: {},\n normalText: {},\n placeholderText: { ...theme.typography.placeholderText },\n link: {\n ...theme.typography.link,\n cursor: \"pointer\",\n textDecoration: \"underline\",\n },\n disabledText: { ...theme.typography.disabledText },\n selectedNavText: { ...theme.typography.selectedNavText },\n vizText: {},\n vizTextDisabled: { ...theme.typography.vizTextDisabled },\n xsInlineLink: { ...theme.typography.xsInlineLink },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,YAAY,kBAAkB,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,YAAY,MAAM,WAAW;AAAA,EAC/B;AAAA,EACA,UAAU;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,IACpB,gBAAgB;AAAA,EAClB;AAAA,EACA,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA;AAAA,EAEA,SAAS,EAAE,GAAG,MAAM,WAAW,QAAQ;AAAA,EACvC,QAAQ,EAAE,GAAG,MAAM,WAAW,OAAO;AAAA,EAC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,EACvD,cAAc,EAAE,GAAG,MAAM,WAAW,aAAa;AACnD,CAAC;"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6376,7 +6376,7 @@ export declare interface HvTabsProps extends Omit<TabsProps, "onChange"> {
|
|
|
6376
6376
|
*
|
|
6377
6377
|
* It leverages the Chip component from Material UI
|
|
6378
6378
|
*/
|
|
6379
|
-
export declare const HvTag:
|
|
6379
|
+
export declare const HvTag: React_2.ForwardRefExoticComponent<Omit<HvTagProps, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
6380
6380
|
|
|
6381
6381
|
export declare type HvTagClasses = ExtractNames<typeof useClasses_107>;
|
|
6382
6382
|
|
|
@@ -6920,7 +6920,10 @@ export declare type HvTypographyProps<C extends React.ElementType = "p"> = Polym
|
|
|
6920
6920
|
link?: boolean;
|
|
6921
6921
|
/** If `true` the typography will display the look of a disabled state. */
|
|
6922
6922
|
disabled?: boolean;
|
|
6923
|
-
/**
|
|
6923
|
+
/**
|
|
6924
|
+
* If `true`, the typography will render a "p" element
|
|
6925
|
+
* @deprecated use `component="p"` instead
|
|
6926
|
+
* */
|
|
6924
6927
|
paragraph?: boolean;
|
|
6925
6928
|
/**
|
|
6926
6929
|
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/uikit-react-core",
|
|
3
|
-
"version": "5.44.
|
|
3
|
+
"version": "5.44.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Hitachi Vantara UI Kit Team",
|
|
6
6
|
"description": "Core React components for the NEXT Design System.",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@emotion/css": "^11.11.2",
|
|
34
34
|
"@emotion/serialize": "^1.1.2",
|
|
35
35
|
"@emotion/utils": "^1.2.1",
|
|
36
|
-
"@hitachivantara/uikit-react-icons": "^5.
|
|
36
|
+
"@hitachivantara/uikit-react-icons": "^5.8.0",
|
|
37
37
|
"@hitachivantara/uikit-react-shared": "^5.1.26",
|
|
38
38
|
"@hitachivantara/uikit-styles": "^5.17.2",
|
|
39
39
|
"@internationalized/date": "^3.2.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"access": "public",
|
|
64
64
|
"directory": "package"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "a136a3abf840bf79f41019eab7b48ee531f39c05",
|
|
67
67
|
"main": "dist/cjs/index.cjs",
|
|
68
68
|
"exports": {
|
|
69
69
|
".": {
|