@hitachivantara/uikit-react-core 5.81.1 → 5.82.0
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/Accordion/Accordion.cjs +2 -8
- package/dist/cjs/BaseInput/BaseInput.styles.cjs +6 -6
- package/dist/cjs/Button/Button.cjs +1 -1
- package/dist/cjs/Button/Button.styles.cjs +9 -3
- package/dist/cjs/Card/Card.cjs +2 -1
- package/dist/cjs/CheckBox/CheckBox.styles.cjs +2 -2
- package/dist/cjs/CheckBoxGroup/CheckBoxGroup.styles.cjs +1 -1
- package/dist/cjs/DatePicker/DatePicker.styles.cjs +2 -2
- package/dist/cjs/Dropdown/Dropdown.styles.cjs +1 -1
- package/dist/cjs/DropdownButton/DropdownButton.cjs +1 -1
- package/dist/cjs/Forms/Adornment/Adornment.cjs +57 -56
- package/dist/cjs/Forms/Suggestions/Suggestions.cjs +2 -0
- package/dist/cjs/Forms/WarningText/WarningText.cjs +13 -16
- package/dist/cjs/Forms/WarningText/WarningText.styles.cjs +7 -3
- package/dist/cjs/Input/Input.cjs +2 -2
- package/dist/cjs/Input/Input.styles.cjs +3 -5
- package/dist/cjs/MultiButton/MultiButton.styles.cjs +1 -2
- package/dist/cjs/Radio/Radio.styles.cjs +2 -2
- package/dist/cjs/RadioGroup/RadioGroup.styles.cjs +1 -1
- package/dist/cjs/Section/Section.cjs +1 -1
- package/dist/cjs/Select/Select.styles.cjs +1 -1
- package/dist/cjs/SelectionList/SelectionList.styles.cjs +1 -1
- package/dist/cjs/Switch/Switch.styles.cjs +1 -1
- package/dist/cjs/Table/hooks/useRowExpand.cjs +1 -1
- package/dist/cjs/TagsInput/TagsInput.styles.cjs +2 -2
- package/dist/cjs/TimePicker/TimePicker.styles.cjs +2 -2
- package/dist/cjs/TimePicker/Unit/Unit.cjs +6 -7
- package/dist/cjs/ToggleButton/ToggleButton.cjs +5 -6
- package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.cjs +1 -7
- package/dist/esm/Accordion/Accordion.js +2 -8
- package/dist/esm/Accordion/Accordion.js.map +1 -1
- package/dist/esm/BaseInput/BaseInput.styles.js +6 -6
- package/dist/esm/BaseInput/BaseInput.styles.js.map +1 -1
- package/dist/esm/Button/Button.js +1 -1
- package/dist/esm/Button/Button.js.map +1 -1
- package/dist/esm/Button/Button.styles.js +9 -3
- package/dist/esm/Button/Button.styles.js.map +1 -1
- package/dist/esm/Card/Card.js +2 -1
- package/dist/esm/Card/Card.js.map +1 -1
- package/dist/esm/CheckBox/CheckBox.styles.js +2 -2
- package/dist/esm/CheckBox/CheckBox.styles.js.map +1 -1
- package/dist/esm/CheckBoxGroup/CheckBoxGroup.styles.js +1 -1
- package/dist/esm/CheckBoxGroup/CheckBoxGroup.styles.js.map +1 -1
- package/dist/esm/DatePicker/DatePicker.styles.js +2 -2
- package/dist/esm/DatePicker/DatePicker.styles.js.map +1 -1
- package/dist/esm/Dropdown/Dropdown.styles.js +1 -1
- package/dist/esm/Dropdown/Dropdown.styles.js.map +1 -1
- package/dist/esm/DropdownButton/DropdownButton.js +1 -1
- package/dist/esm/DropdownButton/DropdownButton.js.map +1 -1
- package/dist/esm/Forms/Adornment/Adornment.js +57 -56
- package/dist/esm/Forms/Adornment/Adornment.js.map +1 -1
- package/dist/esm/Forms/Suggestions/Suggestions.js +2 -0
- package/dist/esm/Forms/Suggestions/Suggestions.js.map +1 -1
- package/dist/esm/Forms/WarningText/WarningText.js +13 -16
- package/dist/esm/Forms/WarningText/WarningText.js.map +1 -1
- package/dist/esm/Forms/WarningText/WarningText.styles.js +7 -3
- package/dist/esm/Forms/WarningText/WarningText.styles.js.map +1 -1
- package/dist/esm/Input/Input.js +2 -2
- package/dist/esm/Input/Input.js.map +1 -1
- package/dist/esm/Input/Input.styles.js +3 -5
- package/dist/esm/Input/Input.styles.js.map +1 -1
- package/dist/esm/MultiButton/MultiButton.styles.js +1 -2
- package/dist/esm/MultiButton/MultiButton.styles.js.map +1 -1
- package/dist/esm/Radio/Radio.styles.js +2 -2
- package/dist/esm/Radio/Radio.styles.js.map +1 -1
- package/dist/esm/RadioGroup/RadioGroup.styles.js +1 -1
- package/dist/esm/RadioGroup/RadioGroup.styles.js.map +1 -1
- package/dist/esm/Section/Section.js +1 -1
- package/dist/esm/Section/Section.js.map +1 -1
- package/dist/esm/Select/Select.styles.js +1 -1
- package/dist/esm/Select/Select.styles.js.map +1 -1
- package/dist/esm/SelectionList/SelectionList.styles.js +1 -1
- package/dist/esm/SelectionList/SelectionList.styles.js.map +1 -1
- package/dist/esm/Switch/Switch.styles.js +1 -1
- package/dist/esm/Switch/Switch.styles.js.map +1 -1
- package/dist/esm/Table/hooks/useRowExpand.js +1 -1
- package/dist/esm/Table/hooks/useRowExpand.js.map +1 -1
- package/dist/esm/TagsInput/TagsInput.styles.js +2 -2
- package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
- package/dist/esm/TimePicker/TimePicker.styles.js +2 -2
- package/dist/esm/TimePicker/TimePicker.styles.js.map +1 -1
- package/dist/esm/TimePicker/Unit/Unit.js +6 -7
- package/dist/esm/TimePicker/Unit/Unit.js.map +1 -1
- package/dist/esm/ToggleButton/ToggleButton.js +5 -6
- package/dist/esm/ToggleButton/ToggleButton.js.map +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js +1 -7
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.js.map +1 -1
- package/dist/types/index.d.ts +5 -2
- package/package.json +6 -6
|
@@ -4,8 +4,8 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
5
5
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
6
6
|
const Unit_styles = require("./Unit.styles.cjs");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const Button = require("../../Button/Button.cjs");
|
|
8
|
+
const BaseInput = require("../../BaseInput/BaseInput.cjs");
|
|
9
9
|
const Unit = ({
|
|
10
10
|
id,
|
|
11
11
|
state,
|
|
@@ -21,12 +21,11 @@ const Unit = ({
|
|
|
21
21
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.root, children: [
|
|
22
22
|
type !== "literal" && /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropUpXS, { onClick: onAdd }),
|
|
23
23
|
type === "literal" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.separator, children: text }),
|
|
24
|
-
type === "dayPeriod" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
type === "dayPeriod" && /* @__PURE__ */ jsxRuntime.jsx(Button.HvButton, { icon: true, className: classes.periodToggle, onClick: onAdd, children: text }),
|
|
25
25
|
["hour", "minute", "second"].includes(type) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
|
-
|
|
26
|
+
BaseInput.HvBaseInput,
|
|
27
27
|
{
|
|
28
28
|
id,
|
|
29
|
-
disableClear: true,
|
|
30
29
|
style: {
|
|
31
30
|
...uikitStyles.theme.typography.title3
|
|
32
31
|
},
|
|
@@ -37,13 +36,13 @@ const Unit = ({
|
|
|
37
36
|
inputRoot: classes.inputRoot
|
|
38
37
|
},
|
|
39
38
|
onKeyDown: (event) => {
|
|
40
|
-
if (event.key === "Enter") {
|
|
39
|
+
if ("key" in event && event.key === "Enter") {
|
|
41
40
|
event.preventDefault();
|
|
42
41
|
event.stopPropagation();
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
required: true,
|
|
46
|
-
|
|
45
|
+
invalid: state.isInvalid,
|
|
47
46
|
value: text.padStart(2, "0"),
|
|
48
47
|
onChange,
|
|
49
48
|
placeholder,
|
|
@@ -19,17 +19,16 @@ const HvToggleButton = React.forwardRef(function HvToggleButton2(props, ref) {
|
|
|
19
19
|
selected,
|
|
20
20
|
Boolean(defaultSelected)
|
|
21
21
|
);
|
|
22
|
-
const onClickHandler = (event) => {
|
|
23
|
-
setIsSelected(!isSelected);
|
|
24
|
-
onClick?.(event, !isSelected);
|
|
25
|
-
};
|
|
26
22
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27
23
|
Button.HvButton,
|
|
28
24
|
{
|
|
29
25
|
ref,
|
|
30
26
|
icon: true,
|
|
31
|
-
|
|
32
|
-
onClick:
|
|
27
|
+
selected: isSelected,
|
|
28
|
+
onClick: (event) => {
|
|
29
|
+
setIsSelected(!isSelected);
|
|
30
|
+
onClick?.(event, !isSelected);
|
|
31
|
+
},
|
|
33
32
|
...others,
|
|
34
33
|
children: children || (!isSelected ? notSelectedIcon : selectedIcon)
|
|
35
34
|
}
|
|
@@ -328,13 +328,7 @@ const HvVerticalNavigationTreeViewItem = React.forwardRef(
|
|
|
328
328
|
children: /* @__PURE__ */ jsxRuntime.jsx(OverflowTooltip.HvOverflowTooltip, { data: label })
|
|
329
329
|
}
|
|
330
330
|
),
|
|
331
|
-
isOpen && expandable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
332
|
-
uikitReactIcons.DropDownXS,
|
|
333
|
-
{
|
|
334
|
-
color: "currentcolor",
|
|
335
|
-
style: { rotate: expanded ? "180deg" : void 0 }
|
|
336
|
-
}
|
|
337
|
-
)
|
|
331
|
+
isOpen && expandable && /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropDownXS, { color: "currentcolor", rotate: expanded })
|
|
338
332
|
]
|
|
339
333
|
}
|
|
340
334
|
) });
|
|
@@ -5,8 +5,8 @@ import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
|
5
5
|
import { useExpandable } from "../hooks/useExpandable.js";
|
|
6
6
|
import { useClasses } from "./Accordion.styles.js";
|
|
7
7
|
import { staticClasses } from "./Accordion.styles.js";
|
|
8
|
-
import { HvButtonBase } from "../ButtonBase/ButtonBase.js";
|
|
9
8
|
import { HvTypography } from "../Typography/Typography.js";
|
|
9
|
+
import { HvButtonBase } from "../ButtonBase/ButtonBase.js";
|
|
10
10
|
const HvAccordion = forwardRef(function HvAccordion2(props, ref) {
|
|
11
11
|
const {
|
|
12
12
|
id,
|
|
@@ -55,13 +55,7 @@ const HvAccordion = forwardRef(function HvAccordion2(props, ref) {
|
|
|
55
55
|
onClick: handleClick,
|
|
56
56
|
variant: labelVariant,
|
|
57
57
|
children: [
|
|
58
|
-
/* @__PURE__ */ jsx(
|
|
59
|
-
DropUpXS,
|
|
60
|
-
{
|
|
61
|
-
color: "inherit",
|
|
62
|
-
style: { rotate: isOpen ? void 0 : "180deg" }
|
|
63
|
-
}
|
|
64
|
-
),
|
|
58
|
+
/* @__PURE__ */ jsx(DropUpXS, { color: "inherit", rotate: !isOpen }),
|
|
65
59
|
label
|
|
66
60
|
]
|
|
67
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../../src/Accordion/Accordion.tsx"],"sourcesContent":["import { forwardRef, useCallback, useMemo } from \"react\";\nimport { DropUpXS } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButtonBase } from \"../ButtonBase\";\nimport { useExpandable } from \"../hooks/useExpandable\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography, HvTypographyVariants } from \"../Typography\";\nimport { staticClasses, useClasses } from \"./Accordion.styles\";\n\nexport { staticClasses as accordionClasses };\n\nexport type HvAccordionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAccordionProps\n extends HvBaseProps<HTMLDivElement, \"onChange\" | \"children\"> {\n /** Content to be rendered. */\n children: React.ReactNode;\n /** The accordion label button. */\n label?: string;\n /** The function that will be executed whenever the accordion toggles. It will receive the state of the accordion. */\n onChange?: (event: React.SyntheticEvent, value: boolean) => void;\n /** Whether the accordion is open or not. If this property is defined the accordion must be fully controlled. */\n expanded?: boolean;\n /** When uncontrolled, defines the initial expanded state. */\n defaultExpanded?: boolean;\n /** An object containing props to be passed onto container holding the accordion children. */\n containerProps?: React.HTMLAttributes<HTMLDivElement>;\n /** Heading level to apply to accordion button. If ´undefined´ the button won't have a header wrapper. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** Whether the accordion is disabled. */\n disabled?: boolean;\n /** Typography variant for the label. */\n labelVariant?: HvTypographyVariants;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvAccordionClasses;\n /** Whether to disable the internal usage of `preventDefault` and `stopPropagation` when the `onChange` event is triggered. */\n disableEventHandling?: boolean; // TODO - remove in v6 as this should be the default behavior: `preventDefault` and `stopPropagation` shouldn't be triggered internally\n}\n\n/**\n * A accordion is a design element that expands in place to expose hidden information.\n */\nexport const HvAccordion = forwardRef<\n React.ComponentRef<\"div\">,\n HvAccordionProps\n>(function HvAccordion(props, ref) {\n const {\n id,\n className,\n classes: classesProp,\n disabled = false,\n label,\n onChange,\n children,\n expanded,\n headingLevel,\n defaultExpanded = false,\n containerProps,\n labelVariant = \"label\",\n disableEventHandling,\n ...others\n } = useDefaultProps(\"HvAccordion\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const { isOpen, toggleOpen, buttonProps, regionProps } = useExpandable({\n id,\n expanded,\n disabled,\n defaultExpanded,\n });\n\n const handleClick = useCallback(\n (event: React.SyntheticEvent) => {\n if (!disabled) {\n onChange?.(event, isOpen);\n toggleOpen();\n }\n\n if (!disableEventHandling) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [disableEventHandling, disabled, isOpen, onChange, toggleOpen],\n );\n\n const accordionHeader = useMemo(() => {\n const accordionButton = (\n <HvTypography\n {...buttonProps}\n component={HvButtonBase}\n className={cx(classes.label, { [classes.disabled]: disabled })}\n disabled={disabled}\n onClick={handleClick}\n variant={labelVariant}\n >\n <DropUpXS
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../../src/Accordion/Accordion.tsx"],"sourcesContent":["import { forwardRef, useCallback, useMemo } from \"react\";\nimport { DropUpXS } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButtonBase } from \"../ButtonBase\";\nimport { useExpandable } from \"../hooks/useExpandable\";\nimport { HvBaseProps } from \"../types/generic\";\nimport { HvTypography, HvTypographyVariants } from \"../Typography\";\nimport { staticClasses, useClasses } from \"./Accordion.styles\";\n\nexport { staticClasses as accordionClasses };\n\nexport type HvAccordionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvAccordionProps\n extends HvBaseProps<HTMLDivElement, \"onChange\" | \"children\"> {\n /** Content to be rendered. */\n children: React.ReactNode;\n /** The accordion label button. */\n label?: string;\n /** The function that will be executed whenever the accordion toggles. It will receive the state of the accordion. */\n onChange?: (event: React.SyntheticEvent, value: boolean) => void;\n /** Whether the accordion is open or not. If this property is defined the accordion must be fully controlled. */\n expanded?: boolean;\n /** When uncontrolled, defines the initial expanded state. */\n defaultExpanded?: boolean;\n /** An object containing props to be passed onto container holding the accordion children. */\n containerProps?: React.HTMLAttributes<HTMLDivElement>;\n /** Heading level to apply to accordion button. If ´undefined´ the button won't have a header wrapper. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** Whether the accordion is disabled. */\n disabled?: boolean;\n /** Typography variant for the label. */\n labelVariant?: HvTypographyVariants;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvAccordionClasses;\n /** Whether to disable the internal usage of `preventDefault` and `stopPropagation` when the `onChange` event is triggered. */\n disableEventHandling?: boolean; // TODO - remove in v6 as this should be the default behavior: `preventDefault` and `stopPropagation` shouldn't be triggered internally\n}\n\n/**\n * A accordion is a design element that expands in place to expose hidden information.\n */\nexport const HvAccordion = forwardRef<\n React.ComponentRef<\"div\">,\n HvAccordionProps\n>(function HvAccordion(props, ref) {\n const {\n id,\n className,\n classes: classesProp,\n disabled = false,\n label,\n onChange,\n children,\n expanded,\n headingLevel,\n defaultExpanded = false,\n containerProps,\n labelVariant = \"label\",\n disableEventHandling,\n ...others\n } = useDefaultProps(\"HvAccordion\", props);\n const { classes, cx } = useClasses(classesProp);\n\n const { isOpen, toggleOpen, buttonProps, regionProps } = useExpandable({\n id,\n expanded,\n disabled,\n defaultExpanded,\n });\n\n const handleClick = useCallback(\n (event: React.SyntheticEvent) => {\n if (!disabled) {\n onChange?.(event, isOpen);\n toggleOpen();\n }\n\n if (!disableEventHandling) {\n event.preventDefault();\n event.stopPropagation();\n }\n },\n [disableEventHandling, disabled, isOpen, onChange, toggleOpen],\n );\n\n const accordionHeader = useMemo(() => {\n const accordionButton = (\n <HvTypography\n {...buttonProps}\n component={HvButtonBase}\n className={cx(classes.label, { [classes.disabled]: disabled })}\n disabled={disabled}\n onClick={handleClick}\n variant={labelVariant}\n >\n <DropUpXS color=\"inherit\" rotate={!isOpen} />\n {label}\n </HvTypography>\n );\n\n return headingLevel === undefined ? (\n accordionButton\n ) : (\n <HvTypography component={`h${headingLevel}`} variant={labelVariant}>\n {accordionButton}\n </HvTypography>\n );\n }, [\n cx,\n classes,\n handleClick,\n label,\n buttonProps,\n disabled,\n headingLevel,\n isOpen,\n labelVariant,\n ]);\n\n return (\n <div ref={ref} id={id} className={cx(classes.root, className)} {...others}>\n {accordionHeader}\n <div\n className={cx(classes.container, { [classes.hidden]: !isOpen })}\n hidden={!isOpen}\n {...regionProps}\n {...containerProps}\n >\n {children}\n </div>\n </div>\n );\n});\n"],"names":["HvAccordion"],"mappings":";;;;;;;;;AA8CO,MAAM,cAAc,WAGzB,SAASA,aAAY,OAAO,KAAK;AAC3B,QAAA;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA,eAAe;AAAA,IACf;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,eAAe,KAAK;AACxC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,EAAE,QAAQ,YAAY,aAAa,YAAA,IAAgB,cAAc;AAAA,IACrE;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AAA;AAAA,EACH,GACF;AAEJ,CAAC;"}
|
|
@@ -44,24 +44,24 @@ const { staticClasses, useClasses } = createClasses("HvBaseInput", {
|
|
|
44
44
|
invalid: {
|
|
45
45
|
"&:not(.disabled)": {
|
|
46
46
|
"& $inputBorderContainer": {
|
|
47
|
-
backgroundColor: theme.colors.
|
|
47
|
+
backgroundColor: theme.colors.negative_120
|
|
48
48
|
},
|
|
49
49
|
"&:hover $inputBorderContainer": {
|
|
50
|
-
backgroundColor: theme.colors.
|
|
50
|
+
backgroundColor: theme.colors.negative_120
|
|
51
51
|
},
|
|
52
52
|
"& $inputRootMultiline": {
|
|
53
53
|
"& $input": {
|
|
54
|
-
border: `1px solid ${theme.colors.
|
|
54
|
+
border: `1px solid ${theme.colors.negative_120}`
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"&:hover $inputRootMultiline": {
|
|
58
58
|
"& $input": {
|
|
59
|
-
border: `1px solid ${theme.colors.
|
|
59
|
+
border: `1px solid ${theme.colors.negative_120}`
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"&:focus-within $inputRootMultiline": {
|
|
63
63
|
"& $input": {
|
|
64
|
-
border: `1px solid ${theme.colors.
|
|
64
|
+
border: `1px solid ${theme.colors.negative_120}`
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -104,7 +104,7 @@ const { staticClasses, useClasses } = createClasses("HvBaseInput", {
|
|
|
104
104
|
left: "2px",
|
|
105
105
|
backgroundColor: theme.colors.atmo4
|
|
106
106
|
},
|
|
107
|
-
inputRootInvalid: { borderColor: theme.colors.
|
|
107
|
+
inputRootInvalid: { borderColor: theme.colors.negative_120 },
|
|
108
108
|
inputRootReadOnly: {
|
|
109
109
|
borderColor: theme.colors.secondary_60,
|
|
110
110
|
backgroundColor: theme.colors.atmo2
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.styles.js","sources":["../../../src/BaseInput/BaseInput.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBaseInput\", {\n root: {\n display: \"inline-block\",\n width: \"100%\",\n position: \"relative\",\n\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.colors.primary,\n },\n\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: theme.colors.primary,\n },\n },\n disabled: {\n \"& $inputRoot\": {\n backgroundColor: theme.colors.atmo2,\n borderColor: theme.colors.secondary_60,\n },\n\n \"& $inputBorderContainer\": {\n backgroundColor: theme.colors.atmo4,\n },\n\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.colors.atmo4,\n },\n\n \"&& $input\": {\n color: theme.colors.secondary_60,\n WebkitTextFillColor: theme.colors.secondary_60,\n },\n\n \"& $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.colors.atmo2,\n border: `1px solid ${theme.colors.secondary_60}`,\n },\n },\n\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.colors.atmo2,\n border: `1px solid ${theme.colors.secondary_60}`,\n },\n },\n },\n invalid: {\n \"&:not(.disabled)\": {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.colors.
|
|
1
|
+
{"version":3,"file":"BaseInput.styles.js","sources":["../../../src/BaseInput/BaseInput.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvBaseInput\", {\n root: {\n display: \"inline-block\",\n width: \"100%\",\n position: \"relative\",\n\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.colors.primary,\n },\n\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: theme.colors.primary,\n },\n },\n disabled: {\n \"& $inputRoot\": {\n backgroundColor: theme.colors.atmo2,\n borderColor: theme.colors.secondary_60,\n },\n\n \"& $inputBorderContainer\": {\n backgroundColor: theme.colors.atmo4,\n },\n\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.colors.atmo4,\n },\n\n \"&& $input\": {\n color: theme.colors.secondary_60,\n WebkitTextFillColor: theme.colors.secondary_60,\n },\n\n \"& $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.colors.atmo2,\n border: `1px solid ${theme.colors.secondary_60}`,\n },\n },\n\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n backgroundColor: theme.colors.atmo2,\n border: `1px solid ${theme.colors.secondary_60}`,\n },\n },\n },\n invalid: {\n \"&:not(.disabled)\": {\n \"& $inputBorderContainer\": {\n backgroundColor: theme.colors.negative_120,\n },\n\n \"&:hover $inputBorderContainer\": {\n backgroundColor: theme.colors.negative_120,\n },\n\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.colors.negative_120}`,\n },\n },\n\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.colors.negative_120}`,\n },\n },\n\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.colors.negative_120}`,\n },\n },\n },\n },\n resizable: { width: \"auto\" },\n readOnly: {\n \"& $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n\n \"&:hover $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n\n \"&:focus-within $inputBorderContainer\": {\n backgroundColor: \"transparent\",\n },\n\n \"& $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.colors.secondary_60}`,\n backgroundColor: theme.colors.atmo2,\n },\n },\n\n \"&:hover $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.colors.secondary_60}`,\n backgroundColor: theme.colors.atmo2,\n },\n },\n\n \"&:focus-within $inputRootMultiline\": {\n \"& $input\": {\n border: `1px solid ${theme.colors.secondary_60}`,\n backgroundColor: theme.colors.atmo2,\n },\n },\n },\n inputBorderContainer: {\n position: \"absolute\",\n width: \"calc(100% - 4px)\",\n height: \"0px\",\n top: \"31px\",\n left: \"2px\",\n backgroundColor: theme.colors.atmo4,\n },\n inputRootInvalid: { borderColor: theme.colors.negative_120 },\n inputRootReadOnly: {\n borderColor: theme.colors.secondary_60,\n backgroundColor: theme.colors.atmo2,\n },\n inputRoot: {\n margin: 0,\n width: \"100%\",\n borderRadius: theme.radii.base,\n height: \"32px\",\n border: `1px solid ${theme.colors.secondary}`,\n boxSizing: \"border-box\",\n backgroundColor: theme.colors.atmo1,\n fontFamily: theme.fontFamily.body,\n\n \"&:hover:not($inputRootDisabled):not($inputRootInvalid):not($inputRootReadOnly)\":\n {\n borderColor: theme.colors.primary,\n },\n\n \"&:hover:not($inputRootDisabled)::before\": {\n borderBottom: \"none\",\n },\n\n \"&::before\": {\n borderBottom: \"none\",\n },\n\n \"&::after\": {\n borderBottom: \"none\",\n },\n },\n inputRootFocused: {\n backgroundColor: theme.colors.atmo1,\n ...outlineStyles,\n\n \"&:hover\": {\n backgroundColor: theme.colors.atmo1,\n },\n\n \"&$inputRootReadOnly\": {\n backgroundColor: theme.colors.atmo2,\n },\n },\n inputRootDisabled: {\n cursor: \"not-allowed\",\n\n \"&&::before\": {\n borderBottomStyle: \"none\",\n },\n },\n inputRootMultiline: {\n padding: 0,\n backgroundColor: \"transparent\",\n overflow: \"auto\",\n border: \"none\",\n height: \"auto\",\n\n \"& $input\": {\n border: `1px solid ${theme.colors.secondary}`,\n borderRadius: theme.radii.base,\n backgroundColor: theme.colors.atmo1,\n height: \"auto\",\n minHeight: \"21px\",\n padding: \"5px 10px\",\n overflow: \"auto\",\n marginLeft: \"0px\",\n marginRight: \"0px\",\n\n \"&:hover\": {\n border: `1px solid ${theme.colors.primary}`,\n },\n },\n },\n input: {\n height: \"19px\",\n marginLeft: theme.space.xs,\n marginRight: theme.space.xs,\n padding: \"6px 0 5px\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n outline: \"none\",\n width: \"initial\",\n flexGrow: 1,\n ...(theme.typography.body as React.CSSProperties),\n\n \"&::placeholder\": {\n opacity: 1,\n color: theme.colors.secondary_80,\n },\n\n \"&::-ms-clear\": {\n display: \"none\",\n },\n },\n inputDisabled: {},\n inputReadOnly: {\n color: theme.colors.secondary_80,\n },\n inputResizable: { resize: \"both\", width: \"100%\" },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA,EACxE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IAEV,iCAAiC;AAAA,MAC/B,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IAEA,wCAAwC;AAAA,MACtC,iBAAiB,MAAM,OAAO;AAAA,IAAA;AAAA,EAElC;AAAA,EACA,UAAU;AAAA,IACR,gBAAgB;AAAA,MACd,iBAAiB,MAAM,OAAO;AAAA,MAC9B,aAAa,MAAM,OAAO;AAAA,IAC5B;AAAA,IAEA,2BAA2B;AAAA,MACzB,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IAEA,iCAAiC;AAAA,MAC/B,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,IAEA,aAAa;AAAA,MACX,OAAO,MAAM,OAAO;AAAA,MACpB,qBAAqB,MAAM,OAAO;AAAA,IACpC;AAAA,IAEA,yBAAyB;AAAA,MACvB,YAAY;AAAA,QACV,iBAAiB,MAAM,OAAO;AAAA,QAC9B,QAAQ,aAAa,MAAM,OAAO,YAAY;AAAA,MAAA;AAAA,IAElD;AAAA,IAEA,+BAA+B;AAAA,MAC7B,YAAY;AAAA,QACV,iBAAiB,MAAM,OAAO;AAAA,QAC9B,QAAQ,aAAa,MAAM,OAAO,YAAY;AAAA,MAAA;AAAA,IAChD;AAAA,EAEJ;AAAA,EACA,SAAS;AAAA,IACP,oBAAoB;AAAA,MAClB,2BAA2B;AAAA,QACzB,iBAAiB,M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A,MAEb,WAAW;AAAA,QACT,QAAQ,aAAa,MAAM,OAAO,OAAO;AAAA,MAAA;AAAA,IAC3C;AAAA,EAEJ;AAAA,EACA,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,YAAY,MAAM,MAAM;AAAA,IACxB,aAAa,MAAM,MAAM;AAAA,IACzB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,cAAc;AAAA,IACd,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,GAAI,MAAM,WAAW;AAAA,IAErB,kBAAkB;AAAA,MAChB,SAAS;AAAA,MACT,OAAO,MAAM,OAAO;AAAA,IACtB;AAAA,IAEA,gBAAgB;AAAA,MACd,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,eAAe;AAAA,IACb,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,gBAAgB,EAAE,QAAQ,QAAQ,OAAO,OAAO;AAClD,CAAC;"}
|
|
@@ -84,7 +84,7 @@ const HvButton = fixedForwardRef(function HvButton2(props, ref) {
|
|
|
84
84
|
tabIndex: focusableWhenDisabled ? 0 : -1,
|
|
85
85
|
"aria-disabled": true
|
|
86
86
|
},
|
|
87
|
-
...selected && { "aria-pressed": selected },
|
|
87
|
+
...selected != null && { "aria-pressed": selected },
|
|
88
88
|
...others,
|
|
89
89
|
children: [
|
|
90
90
|
startIcon && /* @__PURE__ */ jsx("span", { className: classes.startIcon, children: startIcon }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/Button/Button.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport {\n getColor,\n HvColorAny,\n HvRadius,\n HvSize,\n theme,\n} from \"@hitachivantara/uikit-styles\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport {\n getIconSizeStyles,\n getOverrideColors,\n getSizeStyles,\n staticClasses,\n useClasses,\n} from \"./Button.styles\";\nimport { HvButtonVariant } from \"./types\";\n\ntype Variant = \"contained\" | \"subtle\" | \"ghost\";\n\nexport { staticClasses as buttonClasses };\n\nexport type HvButtonClasses = ExtractNames<typeof useClasses>;\n\nexport type HvButtonProps<C extends React.ElementType = \"button\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the button. */\n variant?: HvButtonVariant;\n /** Whether the button is an icon-only button. */\n icon?: boolean;\n /** Whether the button is disabled or not. */\n disabled?: boolean;\n /** Class names to be applied. */\n className?: string;\n /** Element placed before the children. */\n startIcon?: React.ReactNode;\n /** Element placed after the children. */\n endIcon?: React.ReactNode;\n /** Color of the button. */\n color?: HvColorAny;\n /** Button size. */\n size?: HvSize;\n /** Button border radius. */\n radius?: HvRadius;\n /** Defines the default colors of the button are forced into the icon. */\n overrideIconColors?: boolean;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvButtonClasses;\n /** Whether the button is selected or not. */\n selected?: boolean;\n /**\n * Whether the button is focusable when disabled.\n * Without this property, the accessibility of the button decreases when disabled since it's not read by screen readers.\n * Set this property to `true` when you need the button to still be focusable when disabled for accessibility purposes.\n */\n focusableWhenDisabled?: boolean;\n }\n >;\n\nfunction parseVariant(variant: HvButtonVariant): [HvColorAny, Variant] {\n const deprecatedVariantMap: Record<string, HvButtonVariant> = {\n secondary: \"secondarySubtle\",\n };\n\n const mappedVariant = deprecatedVariantMap[variant];\n\n if (import.meta.env.DEV && mappedVariant) {\n // eslint-disable-next-line no-console\n console.warn(\n `HvButton variant '${variant}' is deprecated. Please use '${mappedVariant}'.`,\n );\n }\n\n if (variant === \"semantic\") return [\"inherit\", \"ghost\"];\n if (variant === \"secondary\") return [\"secondary\", \"subtle\"];\n if (variant === \"ghost\") return [\"primary\", \"ghost\"];\n if (variant === \"contained\" || variant === \"subtle\") {\n return [\"secondary\", variant];\n }\n\n const result = variant.split(/(?=[A-Z])/);\n if (!result[1]) return [result[0], \"contained\"];\n\n return result.map((x) => x.toLowerCase()) as [HvColorAny, Variant];\n}\n/**\n * Button component is used to trigger an action or event.\n */\nexport const HvButton = fixedForwardRef(function HvButton<\n C extends React.ElementType = \"button\",\n>(props: HvButtonProps<C>, ref: PolymorphicRef<C>) {\n const {\n classes: classesProp,\n children,\n icon = false,\n variant: variantProp = icon ? \"secondaryGhost\" : \"primary\",\n color: colorProp,\n disabled = false,\n className,\n startIcon,\n endIcon,\n size,\n radius,\n overrideIconColors = true,\n component: Component = \"button\",\n focusableWhenDisabled,\n onClick: onClickProp,\n onMouseDown: onMouseDownProp,\n selected,\n style,\n ...others\n } = useDefaultProps(\"HvButton\", props);\n const { classes, css, cx } = useClasses(classesProp);\n const [parsedColor, variant] = parseVariant(variantProp);\n const color = colorProp ?? parsedColor;\n\n const handleClick: HvButtonProps[\"onClick\"] = (e) => {\n if (disabled) return;\n onClickProp?.(e);\n };\n\n const handleMouseDown: HvButtonProps[\"onMouseDown\"] = (e) => {\n if (disabled) return;\n onMouseDownProp?.(e);\n };\n\n const sizeStyles = useMemo(\n () => size && (icon ? getIconSizeStyles(size) : getSizeStyles(size)),\n [size, icon],\n );\n\n return (\n <Component\n ref={ref}\n style={mergeStyles(style, {\n \"--color\": color && getColor(color),\n \"--radius\": radius && theme.radii[radius],\n \"--HvButton-height\": sizeStyles?.height ?? \"32px\",\n })}\n className={cx(\n classes.root,\n classes[variant],\n classes[variantProp as keyof HvButtonClasses], // Placed after type and color CSS for DS3 override\n overrideIconColors && css(getOverrideColors()),\n {\n [classes.icon]: icon,\n [classes.disabled]: disabled,\n },\n sizeStyles && css(sizeStyles),\n className,\n )}\n data-color={color}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n {...(Component === \"button\" && { type: \"button\" })}\n {...(disabled && {\n disabled: !focusableWhenDisabled,\n tabIndex: focusableWhenDisabled ? 0 : -1,\n \"aria-disabled\": true,\n })}\n {...(selected && { \"aria-pressed\": selected })}\n {...others}\n >\n {startIcon && <span className={classes.startIcon}>{startIcon}</span>}\n {children}\n {endIcon && <span className={classes.endIcon}>{endIcon}</span>}\n </Component>\n );\n});\n"],"names":["HvButton"],"mappings":";;;;;;;AAuEA,SAAS,aAAa,SAAiD;AAcrE,MAAI,YAAY,WAAmB,QAAA,CAAC,WAAW,OAAO;AACtD,MAAI,YAAY,YAAoB,QAAA,CAAC,aAAa,QAAQ;AAC1D,MAAI,YAAY,QAAgB,QAAA,CAAC,WAAW,OAAO;AAC/C,MAAA,YAAY,eAAe,YAAY,UAAU;AAC5C,WAAA,CAAC,aAAa,OAAO;AAAA,EAAA;AAGxB,QAAA,SAAS,QAAQ,MAAM,WAAW;AACpC,MAAA,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,WAAW;AAE9C,SAAO,OAAO,IAAI,CAAC,MAAM,EAAE,aAAa;AAC1C;AAIO,MAAM,WAAW,gBAAgB,SAASA,UAE/C,OAAyB,KAAwB;AAC3C,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA,OAAO;AAAA,IACP,SAAS,cAAc,OAAO,mBAAmB;AAAA,IACjD,OAAO;AAAA,IACP,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB,WAAW,YAAY;AAAA,IACvB;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,YAAY,KAAK;AACrC,QAAM,EAAE,SAAS,KAAK,GAAG,IAAI,WAAW,WAAW;AACnD,QAAM,CAAC,aAAa,OAAO,IAAI,aAAa,WAAW;AACvD,QAAM,QAAQ,aAAa;AAErB,QAAA,cAAwC,CAAC,MAAM;AACnD,QAAI,SAAU;AACd,kBAAc,CAAC;AAAA,EACjB;AAEM,QAAA,kBAAgD,CAAC,MAAM;AAC3D,QAAI,SAAU;AACd,sBAAkB,CAAC;AAAA,EACrB;AAEA,QAAM,aAAa;AAAA,IACjB,MAAM,SAAS,OAAO,kBAAkB,IAAI,IAAI,cAAc,IAAI;AAAA,IAClE,CAAC,MAAM,IAAI;AAAA,EACb;AAGE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,OAAO,YAAY,OAAO;AAAA,QACxB,WAAW,SAAS,SAAS,KAAK;AAAA,QAClC,YAAY,UAAU,MAAM,MAAM,MAAM;AAAA,QACxC,qBAAqB,YAAY,UAAU;AAAA,MAAA,CAC5C;AAAA,MACD,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ,OAAO;AAAA,QACf,QAAQ,WAAoC;AAAA;AAAA,QAC5C,sBAAsB,IAAI,mBAAmB;AAAA,QAC7C;AAAA,UACE,CAAC,QAAQ,IAAI,GAAG;AAAA,UAChB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA,cAAc,IAAI,UAAU;AAAA,QAC5B;AAAA,MACF;AAAA,MACA,cAAY;AAAA,MACZ,SAAS;AAAA,MACT,aAAa;AAAA,MACZ,GAAI,cAAc,YAAY,EAAE,MAAM,SAAS;AAAA,MAC/C,GAAI,YAAY;AAAA,QACf,UAAU,CAAC;AAAA,QACX,UAAU,wBAAwB,IAAI;AAAA,QACtC,iBAAiB;AAAA,MACnB;AAAA,MACC,GAAI,YAAY,EAAE,gBAAgB,SAAS;AAAA,
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/Button/Button.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport {\n getColor,\n HvColorAny,\n HvRadius,\n HvSize,\n theme,\n} from \"@hitachivantara/uikit-styles\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport {\n getIconSizeStyles,\n getOverrideColors,\n getSizeStyles,\n staticClasses,\n useClasses,\n} from \"./Button.styles\";\nimport { HvButtonVariant } from \"./types\";\n\ntype Variant = \"contained\" | \"subtle\" | \"ghost\";\n\nexport { staticClasses as buttonClasses };\n\nexport type HvButtonClasses = ExtractNames<typeof useClasses>;\n\nexport type HvButtonProps<C extends React.ElementType = \"button\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the button. */\n variant?: HvButtonVariant;\n /** Whether the button is an icon-only button. */\n icon?: boolean;\n /** Whether the button is disabled or not. */\n disabled?: boolean;\n /** Class names to be applied. */\n className?: string;\n /** Element placed before the children. */\n startIcon?: React.ReactNode;\n /** Element placed after the children. */\n endIcon?: React.ReactNode;\n /** Color of the button. */\n color?: HvColorAny;\n /** Button size. */\n size?: HvSize;\n /** Button border radius. */\n radius?: HvRadius;\n /** Defines the default colors of the button are forced into the icon. */\n overrideIconColors?: boolean;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvButtonClasses;\n /** Whether the button is selected or not. */\n selected?: boolean;\n /**\n * Whether the button is focusable when disabled.\n * Without this property, the accessibility of the button decreases when disabled since it's not read by screen readers.\n * Set this property to `true` when you need the button to still be focusable when disabled for accessibility purposes.\n */\n focusableWhenDisabled?: boolean;\n }\n >;\n\nfunction parseVariant(variant: HvButtonVariant): [HvColorAny, Variant] {\n const deprecatedVariantMap: Record<string, HvButtonVariant> = {\n secondary: \"secondarySubtle\",\n };\n\n const mappedVariant = deprecatedVariantMap[variant];\n\n if (import.meta.env.DEV && mappedVariant) {\n // eslint-disable-next-line no-console\n console.warn(\n `HvButton variant '${variant}' is deprecated. Please use '${mappedVariant}'.`,\n );\n }\n\n if (variant === \"semantic\") return [\"inherit\", \"ghost\"];\n if (variant === \"secondary\") return [\"secondary\", \"subtle\"];\n if (variant === \"ghost\") return [\"primary\", \"ghost\"];\n if (variant === \"contained\" || variant === \"subtle\") {\n return [\"secondary\", variant];\n }\n\n const result = variant.split(/(?=[A-Z])/);\n if (!result[1]) return [result[0], \"contained\"];\n\n return result.map((x) => x.toLowerCase()) as [HvColorAny, Variant];\n}\n/**\n * Button component is used to trigger an action or event.\n */\nexport const HvButton = fixedForwardRef(function HvButton<\n C extends React.ElementType = \"button\",\n>(props: HvButtonProps<C>, ref: PolymorphicRef<C>) {\n const {\n classes: classesProp,\n children,\n icon = false,\n variant: variantProp = icon ? \"secondaryGhost\" : \"primary\",\n color: colorProp,\n disabled = false,\n className,\n startIcon,\n endIcon,\n size,\n radius,\n overrideIconColors = true,\n component: Component = \"button\",\n focusableWhenDisabled,\n onClick: onClickProp,\n onMouseDown: onMouseDownProp,\n selected,\n style,\n ...others\n } = useDefaultProps(\"HvButton\", props);\n const { classes, css, cx } = useClasses(classesProp);\n const [parsedColor, variant] = parseVariant(variantProp);\n const color = colorProp ?? parsedColor;\n\n const handleClick: HvButtonProps[\"onClick\"] = (e) => {\n if (disabled) return;\n onClickProp?.(e);\n };\n\n const handleMouseDown: HvButtonProps[\"onMouseDown\"] = (e) => {\n if (disabled) return;\n onMouseDownProp?.(e);\n };\n\n const sizeStyles = useMemo(\n () => size && (icon ? getIconSizeStyles(size) : getSizeStyles(size)),\n [size, icon],\n );\n\n return (\n <Component\n ref={ref}\n style={mergeStyles(style, {\n \"--color\": color && getColor(color),\n \"--radius\": radius && theme.radii[radius],\n \"--HvButton-height\": sizeStyles?.height ?? \"32px\",\n })}\n className={cx(\n classes.root,\n classes[variant],\n classes[variantProp as keyof HvButtonClasses], // Placed after type and color CSS for DS3 override\n overrideIconColors && css(getOverrideColors()),\n {\n [classes.icon]: icon,\n [classes.disabled]: disabled,\n },\n sizeStyles && css(sizeStyles),\n className,\n )}\n data-color={color}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n {...(Component === \"button\" && { type: \"button\" })}\n {...(disabled && {\n disabled: !focusableWhenDisabled,\n tabIndex: focusableWhenDisabled ? 0 : -1,\n \"aria-disabled\": true,\n })}\n {...(selected != null && { \"aria-pressed\": selected })}\n {...others}\n >\n {startIcon && <span className={classes.startIcon}>{startIcon}</span>}\n {children}\n {endIcon && <span className={classes.endIcon}>{endIcon}</span>}\n </Component>\n );\n});\n"],"names":["HvButton"],"mappings":";;;;;;;AAuEA,SAAS,aAAa,SAAiD;AAcrE,MAAI,YAAY,WAAmB,QAAA,CAAC,WAAW,OAAO;AACtD,MAAI,YAAY,YAAoB,QAAA,CAAC,aAAa,QAAQ;AAC1D,MAAI,YAAY,QAAgB,QAAA,CAAC,WAAW,OAAO;AAC/C,MAAA,YAAY,eAAe,YAAY,UAAU;AAC5C,WAAA,CAAC,aAAa,OAAO;AAAA,EAAA;AAGxB,QAAA,SAAS,QAAQ,MAAM,WAAW;AACpC,MAAA,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,WAAW;AAE9C,SAAO,OAAO,IAAI,CAAC,MAAM,EAAE,aAAa;AAC1C;AAIO,MAAM,WAAW,gBAAgB,SAASA,UAE/C,OAAyB,KAAwB;AAC3C,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA,OAAO;AAAA,IACP,SAAS,cAAc,OAAO,mBAAmB;AAAA,IACjD,OAAO;AAAA,IACP,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB,WAAW,YAAY;AAAA,IACvB;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,YAAY,KAAK;AACrC,QAAM,EAAE,SAAS,KAAK,GAAG,IAAI,WAAW,WAAW;AACnD,QAAM,CAAC,aAAa,OAAO,IAAI,aAAa,WAAW;AACvD,QAAM,QAAQ,aAAa;AAErB,QAAA,cAAwC,CAAC,MAAM;AACnD,QAAI,SAAU;AACd,kBAAc,CAAC;AAAA,EACjB;AAEM,QAAA,kBAAgD,CAAC,MAAM;AAC3D,QAAI,SAAU;AACd,sBAAkB,CAAC;AAAA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import { outlineStyles } from "../utils/focusUtils.js";
|
|
4
4
|
const { staticClasses, useClasses } = createClasses("HvButton", {
|
|
5
|
-
/**
|
|
6
|
-
* Classes applied to the root element
|
|
7
|
-
*/
|
|
5
|
+
/** applied to the root element */
|
|
8
6
|
root: {
|
|
9
7
|
display: "inline-flex",
|
|
10
8
|
alignItems: "center",
|
|
@@ -31,17 +29,20 @@ const { staticClasses, useClasses } = createClasses("HvButton", {
|
|
|
31
29
|
borderRadius: `var(--radius, ${theme.radii.base})`,
|
|
32
30
|
padding: theme.spacing(0, "sm")
|
|
33
31
|
},
|
|
32
|
+
/** applied to the _left_ icon container */
|
|
34
33
|
startIcon: {
|
|
35
34
|
marginLeft: theme.spacing(-1),
|
|
36
35
|
marginTop: -1,
|
|
37
36
|
marginBottom: -1
|
|
38
37
|
},
|
|
38
|
+
/** applied to the _right_ icon container */
|
|
39
39
|
endIcon: {
|
|
40
40
|
marginRight: theme.spacing(-1),
|
|
41
41
|
marginTop: -1,
|
|
42
42
|
marginBottom: -1
|
|
43
43
|
},
|
|
44
44
|
focusVisible: {},
|
|
45
|
+
/** applied to the root element when disabled */
|
|
45
46
|
disabled: {
|
|
46
47
|
cursor: "not-allowed",
|
|
47
48
|
color: theme.colors.secondary_60,
|
|
@@ -52,6 +53,7 @@ const { staticClasses, useClasses } = createClasses("HvButton", {
|
|
|
52
53
|
borderColor: "transparent"
|
|
53
54
|
}
|
|
54
55
|
},
|
|
56
|
+
/** applied to the root element when is icon-only */
|
|
55
57
|
icon: {
|
|
56
58
|
margin: 0,
|
|
57
59
|
padding: 0,
|
|
@@ -60,6 +62,7 @@ const { staticClasses, useClasses } = createClasses("HvButton", {
|
|
|
60
62
|
margin: -1
|
|
61
63
|
}
|
|
62
64
|
},
|
|
65
|
+
/** applied to the root element when using the `contained` variant */
|
|
63
66
|
contained: {
|
|
64
67
|
color: theme.colors.atmo1,
|
|
65
68
|
// `color-contrast(var(--color) vs ${colors.atmo1}, ${colors.base_light}, ${colors.base_dark})`,
|
|
@@ -73,10 +76,13 @@ const { staticClasses, useClasses } = createClasses("HvButton", {
|
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
},
|
|
79
|
+
/** applied to the root element when using the `subtle` variant */
|
|
76
80
|
subtle: {
|
|
77
81
|
borderColor: "currentcolor"
|
|
78
82
|
},
|
|
83
|
+
/** applied to the root element when using the `ghost` variant */
|
|
79
84
|
ghost: {},
|
|
85
|
+
/** applied to the root element when using the `semantic` variant */
|
|
80
86
|
semantic: {
|
|
81
87
|
color: theme.colors.base_dark,
|
|
82
88
|
backgroundColor: "transparent",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styles.js","sources":["../../../src/Button/Button.styles.ts"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme, type HvSize } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvButton\", {\n
|
|
1
|
+
{"version":3,"file":"Button.styles.js","sources":["../../../src/Button/Button.styles.ts"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme, type HvSize } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvButton\", {\n /** applied to the root element */\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n textTransform: \"none\",\n cursor: \"pointer\",\n whiteSpace: \"nowrap\",\n\n // Background color common for almost all variants\n \":where(:not($disabled))\": {\n \":hover, :focus-visible\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n \":focus-visible\": {\n ...outlineStyles,\n },\n\n // Default button - no size specified\n fontFamily: theme.fontFamily.body,\n ...theme.typography.label,\n color: \"var(--color, currentcolor)\",\n backgroundColor: \"transparent\",\n height: \"var(--HvButton-height)\",\n border: \"1px solid transparent\",\n borderRadius: `var(--radius, ${theme.radii.base})`,\n padding: theme.spacing(0, \"sm\"),\n },\n /** applied to the _left_ icon container */\n startIcon: {\n marginLeft: theme.spacing(-1),\n marginTop: -1,\n marginBottom: -1,\n },\n /** applied to the _right_ icon container */\n endIcon: {\n marginRight: theme.spacing(-1),\n marginTop: -1,\n marginBottom: -1,\n },\n focusVisible: {},\n /** applied to the root element when disabled */\n disabled: {\n cursor: \"not-allowed\",\n color: theme.colors.secondary_60,\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n \":hover, :focus-visible\": {\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n },\n },\n /** applied to the root element when is icon-only */\n icon: {\n margin: 0,\n padding: 0,\n height: \"fit-content\",\n \"& > *\": {\n margin: -1,\n },\n },\n /** applied to the root element when using the `contained` variant */\n contained: {\n color: theme.colors.atmo1, // `color-contrast(var(--color) vs ${colors.atmo1}, ${colors.base_light}, ${colors.base_dark})`,\n backgroundColor: \"var(--color)\",\n \":where(:not($disabled))\": {\n \":hover, :focus-visible\": {\n backgroundColor: \"color-mix(in srgb, var(--color), black 20%)\",\n },\n \":active\": {\n backgroundColor: \"color-mix(in srgb, var(--color), black 30%)\",\n },\n },\n },\n /** applied to the root element when using the `subtle` variant */\n subtle: {\n borderColor: \"currentcolor\",\n },\n /** applied to the root element when using the `ghost` variant */\n ghost: {},\n /** applied to the root element when using the `semantic` variant */\n semantic: {\n color: theme.colors.base_dark,\n backgroundColor: \"transparent\",\n borderColor: \"transparent\",\n \"&:hover, &:focus-visible\": {\n backgroundColor: theme.alpha(\"base_light\", 0.3),\n },\n \"&:active\": {\n backgroundColor: theme.alpha(\"base_light\", 0.5),\n },\n \"&$disabled\": {\n backgroundColor: theme.alpha(\"base_light\", 0.1),\n },\n },\n\n // TODO - remove in v6\n primary: {},\n primarySubtle: {},\n primaryGhost: {},\n secondarySubtle: {},\n secondaryGhost: {},\n\n // Deprecated (DS3)\n secondary: {},\n});\n\n// TODO - remove xs and xl in v6 since they are not DS spec\nconst sizes: Record<\n HvSize,\n { height: string; space?: HvSize; fontSize?: keyof typeof theme.fontSizes }\n> = {\n xs: { height: \"24px\", fontSize: \"sm\" },\n sm: { height: \"24px\", fontSize: \"sm\" },\n md: { height: \"32px\" },\n lg: { height: \"48px\", space: \"md\" },\n xl: { height: \"48px\", space: \"md\" },\n};\n\nexport const getSizeStyles = (size: HvSize) => {\n const { height, space = \"sm\", fontSize } = sizes[size];\n return {\n height,\n padding: theme.spacing(0, space),\n fontSize: fontSize && theme.fontSizes[fontSize],\n };\n};\n\nexport const getIconSizeStyles = (size: HvSize) => {\n const { height } = sizes[size];\n return {\n height,\n width: height,\n };\n};\n\nexport const getOverrideColors = () => ({\n \"& svg .color0\": {\n fill: \"currentcolor\",\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA;AAAA,EAErE,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,YAAY;AAAA;AAAA,IAGZ,2BAA2B;AAAA,MACzB,0BAA0B;AAAA,QACxB,iBAAiB,MAAM,OAAO;AAAA,MAAA;AAAA,IAElC;AAAA,IACA,kBAAkB;AAAA,MAChB,GAAG;AAAA,IACL;AAAA;AAAA,IAGA,YAAY,MAAM,WAAW;AAAA,IAC7B,GAAG,MAAM,WAAW;AAAA,IACpB,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,cAAc,iBAAiB,MAAM,MAAM,IAAI;AAAA,IAC/C,SAAS,MAAM,QAAQ,GAAG,IAAI;AAAA,EAChC;AAAA;AAAA,EAEA,WAAW;AAAA,IACT,YAAY,MAAM,QAAQ,EAAE;AAAA,IAC5B,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AAAA;AAAA,EAEA,SAAS;AAAA,IACP,aAAa,MAAM,QAAQ,EAAE;AAAA,IAC7B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AE,QAAQ,QAAQ,UAAU,KAAK;AAAA,EACrC,IAAI,EAAE,QAAQ,QAAQ,UAAU,KAAK;AAAA,EACrC,IAAI,EAAE,QAAQ,OAAO;AAAA,EACrB,IAAI,EAAE,QAAQ,QAAQ,OAAO,KAAK;AAAA,EAClC,IAAI,EAAE,QAAQ,QAAQ,OAAO,KAAK;AACpC;AAEa,MAAA,gBAAgB,CAAC,SAAiB;AAC7C,QAAM,EAAE,QAAQ,QAAQ,MAAM,SAAS,IAAI,MAAM,IAAI;AAC9C,SAAA;AAAA,IACL;AAAA,IACA,SAAS,MAAM,QAAQ,GAAG,KAAK;AAAA,IAC/B,UAAU,YAAY,MAAM,UAAU,QAAQ;AAAA,EAChD;AACF;AAEa,MAAA,oBAAoB,CAAC,SAAiB;AACjD,QAAM,EAAE,OAAA,IAAW,MAAM,IAAI;AACtB,SAAA;AAAA,IACL;AAAA,IACA,OAAO;AAAA,EACT;AACF;AAEO,MAAM,oBAAoB,OAAO;AAAA,EACtC,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV;"}
|
package/dist/esm/Card/Card.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useDefaultProps, mergeStyles } from "@hitachivantara/uikit-react-utils"
|
|
|
4
4
|
import { getColor } from "@hitachivantara/uikit-styles";
|
|
5
5
|
import { useClasses } from "./Card.styles.js";
|
|
6
6
|
import { staticClasses } from "./Card.styles.js";
|
|
7
|
-
const HvCard = forwardRef((props) => {
|
|
7
|
+
const HvCard = forwardRef((props, ref) => {
|
|
8
8
|
const {
|
|
9
9
|
classes: classesProp,
|
|
10
10
|
style,
|
|
@@ -22,6 +22,7 @@ const HvCard = forwardRef((props) => {
|
|
|
22
22
|
return /* @__PURE__ */ jsxs(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
|
+
ref,
|
|
25
26
|
style: mergeStyles(style, {
|
|
26
27
|
"--bg-color": getColor(bgcolor),
|
|
27
28
|
"--bar-height": `${selected ? 4 : 2}px`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sources":["../../../src/Card/Card.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./Card.styles\";\n\nexport { staticClasses as cardClasses };\n\nexport type HvCardClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvCardProps extends HvBaseProps {\n /** The renderable content inside the icon slot of the header. */\n icon?: React.ReactNode;\n /** Whether the card is selectable. */\n selectable?: boolean;\n /** Whether the card is currently selected. */\n selected?: boolean;\n /** The background color of the card. */\n bgcolor?: \"sema0\" | HvColorAny;\n /**\n * The border color at the top of the card. Must be one of palette semantic or atmosphere colors.\n * To set another color, the borderTop should be override.\n */\n statusColor?: \"sema0\" | HvColorAny;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvCardClasses;\n}\n\n/**\n * A card is a container for a few short and related pieces of content.\n * It roughly resembles a playing card in size and shape and is intended as a\n * linked short representation of a conceptual unit. For that reason,\n * this pattern must be used as an entry-point for further information.\n */\nexport const HvCard = forwardRef<\n // no-indent\n React.ComponentRef<\"div\">,\n HvCardProps\n>((props) => {\n const {\n classes: classesProp,\n style,\n className,\n children,\n icon,\n selectable = false,\n selected = false,\n statusColor = \"sema0\",\n bgcolor,\n ...others\n } = useDefaultProps(\"HvCard\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const barColor =\n (statusColor !== \"sema0\" && statusColor) ||\n (selected && \"secondary\") ||\n \"atmo4\";\n\n return (\n <div\n style={mergeStyles(style, {\n \"--bg-color\": getColor(bgcolor),\n \"--bar-height\": `${selected ? 4 : 2}px`,\n \"--bar-color\": getColor(barColor),\n })}\n className={cx(\n \"HvIsCardGridElement\",\n classes.root,\n {\n [classes.selectable]: selectable,\n [classes.selected]: selected,\n },\n className,\n )}\n {...others}\n >\n <div className={classes.semanticContainer}>\n <div className={classes.semanticBar} />\n <div className={classes.icon}>{icon}</div>\n </div>\n {children}\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Card.js","sources":["../../../src/Card/Card.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n mergeStyles,\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { staticClasses, useClasses } from \"./Card.styles\";\n\nexport { staticClasses as cardClasses };\n\nexport type HvCardClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvCardProps extends HvBaseProps {\n /** The renderable content inside the icon slot of the header. */\n icon?: React.ReactNode;\n /** Whether the card is selectable. */\n selectable?: boolean;\n /** Whether the card is currently selected. */\n selected?: boolean;\n /** The background color of the card. */\n bgcolor?: \"sema0\" | HvColorAny;\n /**\n * The border color at the top of the card. Must be one of palette semantic or atmosphere colors.\n * To set another color, the borderTop should be override.\n */\n statusColor?: \"sema0\" | HvColorAny;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvCardClasses;\n}\n\n/**\n * A card is a container for a few short and related pieces of content.\n * It roughly resembles a playing card in size and shape and is intended as a\n * linked short representation of a conceptual unit. For that reason,\n * this pattern must be used as an entry-point for further information.\n */\nexport const HvCard = forwardRef<\n // no-indent\n React.ComponentRef<\"div\">,\n HvCardProps\n>((props, ref) => {\n const {\n classes: classesProp,\n style,\n className,\n children,\n icon,\n selectable = false,\n selected = false,\n statusColor = \"sema0\",\n bgcolor,\n ...others\n } = useDefaultProps(\"HvCard\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const barColor =\n (statusColor !== \"sema0\" && statusColor) ||\n (selected && \"secondary\") ||\n \"atmo4\";\n\n return (\n <div\n ref={ref}\n style={mergeStyles(style, {\n \"--bg-color\": getColor(bgcolor),\n \"--bar-height\": `${selected ? 4 : 2}px`,\n \"--bar-color\": getColor(barColor),\n })}\n className={cx(\n \"HvIsCardGridElement\",\n classes.root,\n {\n [classes.selectable]: selectable,\n [classes.selected]: selected,\n },\n className,\n )}\n {...others}\n >\n <div className={classes.semanticContainer}>\n <div className={classes.semanticBar} />\n <div className={classes.icon}>{icon}</div>\n </div>\n {children}\n </div>\n );\n});\n"],"names":[],"mappings":";;;;;;AAuCO,MAAM,SAAS,WAIpB,CAAC,OAAO,QAAQ;AACV,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb,WAAW;AAAA,IACX,cAAc;AAAA,IACd;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,UAAU,KAAK;AAEnC,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAE9C,QAAM,WACH,gBAAgB,WAAW,eAC3B,YAAY,eACb;AAGA,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,OAAO,YAAY,OAAO;AAAA,QACxB,cAAc,SAAS,OAAO;AAAA,QAC9B,gBAAgB,GAAG,WAAW,IAAI,CAAC;AAAA,QACnC,eAAe,SAAS,QAAQ;AAAA,MAAA,CACjC;AAAA,MACD,WAAW;AAAA,QACT;AAAA,QACA,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,UAAU,GAAG;AAAA,UACtB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,UAAA;AAAA,QAAC,qBAAA,OAAA,EAAI,WAAW,QAAQ,mBACtB,UAAA;AAAA,UAAC,oBAAA,OAAA,EAAI,WAAW,QAAQ,YAAa,CAAA;AAAA,UACpC,oBAAA,OAAA,EAAI,WAAW,QAAQ,MAAO,UAAK,KAAA,CAAA;AAAA,QAAA,GACtC;AAAA,QACC;AAAA,MAAA;AAAA,IAAA;AAAA,EACH;AAEJ,CAAC;"}
|
|
@@ -28,7 +28,7 @@ const { staticClasses, useClasses } = createClasses("HvCheckBox", {
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
invalidContainer: {
|
|
31
|
-
borderBottom: `1px solid ${theme.colors.
|
|
31
|
+
borderBottom: `1px solid ${theme.colors.negative_120}`,
|
|
32
32
|
"&:hover": {
|
|
33
33
|
borderBottomLeftRadius: "0px",
|
|
34
34
|
borderBottomRightRadius: "0px"
|
|
@@ -36,7 +36,7 @@ const { staticClasses, useClasses } = createClasses("HvCheckBox", {
|
|
|
36
36
|
},
|
|
37
37
|
checkbox: { height: "32px" },
|
|
38
38
|
invalidCheckbox: {
|
|
39
|
-
borderBottom: `1px solid ${theme.colors.
|
|
39
|
+
borderBottom: `1px solid ${theme.colors.negative_120}`,
|
|
40
40
|
borderBottomLeftRadius: "0px",
|
|
41
41
|
borderBottomRightRadius: "0px"
|
|
42
42
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckBox.styles.js","sources":["../../../src/CheckBox/CheckBox.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCheckBox\", {\n root: { display: \"inline-block\" },\n container: {\n cursor: \"pointer\",\n display: \"flex\",\n height: \"32px\",\n transition: \"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n borderRadius: theme.radii.base,\n },\n },\n disabled: {\n cursor: \"not-allowed\",\n \"& $label\": { color: theme.colors.secondary_60, cursor: \"not-allowed\" },\n },\n focusVisible: {\n ...outlineStyles,\n\n \"& div\": {\n backgroundColor: theme.colors.atmo3,\n },\n\n [`& $checkbox div > svg`]: {\n outline: \"none\",\n boxShadow: \"none\",\n },\n },\n invalidContainer: {\n borderBottom: `1px solid ${theme.colors.
|
|
1
|
+
{"version":3,"file":"CheckBox.styles.js","sources":["../../../src/CheckBox/CheckBox.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { outlineStyles } from \"../utils/focusUtils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCheckBox\", {\n root: { display: \"inline-block\" },\n container: {\n cursor: \"pointer\",\n display: \"flex\",\n height: \"32px\",\n transition: \"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n borderRadius: theme.radii.base,\n },\n },\n disabled: {\n cursor: \"not-allowed\",\n \"& $label\": { color: theme.colors.secondary_60, cursor: \"not-allowed\" },\n },\n focusVisible: {\n ...outlineStyles,\n\n \"& div\": {\n backgroundColor: theme.colors.atmo3,\n },\n\n [`& $checkbox div > svg`]: {\n outline: \"none\",\n boxShadow: \"none\",\n },\n },\n invalidContainer: {\n borderBottom: `1px solid ${theme.colors.negative_120}`,\n\n \"&:hover\": {\n borderBottomLeftRadius: \"0px\",\n borderBottomRightRadius: \"0px\",\n },\n },\n checkbox: { height: \"32px\" },\n invalidCheckbox: {\n borderBottom: `1px solid ${theme.colors.negative_120}`,\n borderBottomLeftRadius: \"0px\",\n borderBottomRightRadius: \"0px\",\n },\n label: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n verticalAlign: \"middle\",\n paddingRight: theme.space.xs,\n whiteSpace: \"nowrap\",\n ...theme.typography.body,\n cursor: \"pointer\",\n height: \"32px\",\n lineHeight: \"32px\",\n width: \"100%\",\n },\n checked: {},\n indeterminate: {},\n semantic: {},\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM,EAAE,SAAS,eAAe;AAAA,EAChC,W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borderBottom: `1px solid ${theme.colors.
|
|
29
|
+
borderBottom: `1px solid ${theme.colors.negative_120}`
|
|
30
30
|
},
|
|
31
31
|
selectAll: {},
|
|
32
32
|
error: {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckBoxGroup.styles.js","sources":["../../../src/CheckBoxGroup/CheckBoxGroup.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCheckBoxGroup\", {\n root: {\n display: \"inline-block\",\n overflow: \"clip\",\n overflowClipMargin: 4,\n verticalAlign: \"top\",\n },\n label: { marginBottom: theme.space.xs },\n group: { display: \"flex\" },\n vertical: {\n flexDirection: \"column\",\n\n // Prevent the focus ring to be hidden by sibling hover background\n \"&>*\": {\n zIndex: 0,\n },\n \"&>*:focus-within\": {\n zIndex: 1,\n },\n },\n horizontal: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: theme.space.sm,\n },\n invalid: {\n paddingBottom: theme.space.xs,\n borderBottom: `1px solid ${theme.colors.
|
|
1
|
+
{"version":3,"file":"CheckBoxGroup.styles.js","sources":["../../../src/CheckBoxGroup/CheckBoxGroup.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCheckBoxGroup\", {\n root: {\n display: \"inline-block\",\n overflow: \"clip\",\n overflowClipMargin: 4,\n verticalAlign: \"top\",\n },\n label: { marginBottom: theme.space.xs },\n group: { display: \"flex\" },\n vertical: {\n flexDirection: \"column\",\n\n // Prevent the focus ring to be hidden by sibling hover background\n \"&>*\": {\n zIndex: 0,\n },\n \"&>*:focus-within\": {\n zIndex: 1,\n },\n },\n horizontal: {\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n gap: theme.space.sm,\n },\n invalid: {\n paddingBottom: theme.space.xs,\n borderBottom: `1px solid ${theme.colors.negative_120}`,\n },\n selectAll: {},\n error: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,UAAU;AAAA,IACV,oBAAoB;AAAA,IACpB,eAAe;AAAA,EACjB;AAAA,EACA,OAAO,EAAE,cAAc,MAAM,MAAM,GAAG;AAAA,EACtC,OAAO,EAAE,SAAS,OAAO;AAAA,EACzB,UAAU;AAAA,IACR,eAAe;AAAA;AAAA,IAGf,OAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,IACA,oBAAoB;AAAA,MAClB,QAAQ;AAAA,IAAA;AAAA,EAEZ;AAAA,EACA,YAAY;AAAA,IACV,eAAe;AAAA,IACf,UAAU;AAAA,IACV,KAAK,MAAM,MAAM;AAAA,EACnB;AAAA,EACA,SAAS;AAAA,IACP,eAAe,MAAM,MAAM;AAAA,IAC3B,cAAc,aAAa,MAAM,OAAO,YAAY;AAAA,EACtD;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,OAAO,CAAA;AACT,CAAC;"}
|
|
@@ -24,9 +24,9 @@ const { staticClasses, useClasses } = createClasses("HvDatePicker", {
|
|
|
24
24
|
},
|
|
25
25
|
panel: {},
|
|
26
26
|
dropdownHeaderInvalid: {
|
|
27
|
-
border: `1px solid ${theme.colors.
|
|
27
|
+
border: `1px solid ${theme.colors.negative_120}`,
|
|
28
28
|
"&:hover": {
|
|
29
|
-
border: `1px solid ${theme.colors.
|
|
29
|
+
border: `1px solid ${theme.colors.negative_120}`
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
dropdownHeaderOpen: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.styles.js","sources":["../../../src/DatePicker/DatePicker.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDatePicker\", {\n root: {\n position: \"relative\",\n },\n actionContainer: {\n justifyContent: \"space-between\",\n },\n leftContainer: {},\n rightContainer: {},\n\n labelContainer: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n label: {\n paddingBottom: \"6px\",\n display: \"block\",\n },\n description: {},\n error: {},\n\n dropdown: {\n display: \"block\",\n },\n panel: {},\n\n dropdownHeaderInvalid: {\n border: `1px solid ${theme.colors.
|
|
1
|
+
{"version":3,"file":"DatePicker.styles.js","sources":["../../../src/DatePicker/DatePicker.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDatePicker\", {\n root: {\n position: \"relative\",\n },\n actionContainer: {\n justifyContent: \"space-between\",\n },\n leftContainer: {},\n rightContainer: {},\n\n labelContainer: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n label: {\n paddingBottom: \"6px\",\n display: \"block\",\n },\n description: {},\n error: {},\n\n dropdown: {\n display: \"block\",\n },\n panel: {},\n\n dropdownHeaderInvalid: {\n border: `1px solid ${theme.colors.negative_120}`,\n \"&:hover\": {\n border: `1px solid ${theme.colors.negative_120}`,\n },\n },\n dropdownHeaderOpen: {},\n icon: {},\n action: {\n \"&:first-of-type\": {\n marginRight: theme.space.xs,\n },\n },\n inputText: {},\n dateText: {\n color: \"inherit\",\n fontWeight: theme.typography.label.fontWeight,\n },\n container: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,gBAAgB;AAAA,EACzE,MAAM;AAAA,IACJ,UAAU;AAAA,EACZ;AAAA,EACA,iBAAiB;AAAA,IACf,gBAAgB;AAAA,EAClB;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,gBAAgB,CAAC;AAAA,EAEjB,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,EACd;AAAA,EACA,OAAO;AAAA,IACL,eAAe;AAAA,IACf,SAAS;AAAA,EACX;AAAA,EACA,aAAa,CAAC;AAAA,EACd,OAAO,CAAC;AAAA,EAER,UAAU;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,OAAO,CAAC;AAAA,EAER,uBAAuB;AAAA,IACrB,QAAQ,aAAa,MAAM,OAAO,YAAY;AAAA,IAC9C,WAAW;AAAA,MACT,QAAQ,aAAa,MAAM,OAAO,YAAY;AAAA,IAAA;AAAA,EAElD;AAAA,EACA,oBAAoB,CAAC;AAAA,EACrB,MAAM,CAAC;AAAA,EACP,QAAQ;AAAA,IACN,mBAAmB;AAAA,MACjB,aAAa,MAAM,MAAM;AAAA,IAAA;AAAA,EAE7B;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,UAAU;AAAA,IACR,OAAO;AAAA,IACP,YAAY,MAAM,WAAW,MAAM;AAAA,EACrC;AAAA,EACA,WAAW,CAAA;AACb,CAAC;"}
|
|
@@ -26,7 +26,7 @@ const { staticClasses, useClasses } = createClasses("HvDropdown", {
|
|
|
26
26
|
width: "100%",
|
|
27
27
|
borderRadius: theme.radii.base,
|
|
28
28
|
"& $dropdownHeaderInvalid": {
|
|
29
|
-
border: `1px solid ${theme.colors.
|
|
29
|
+
border: `1px solid ${theme.colors.negative_120}`
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
arrow: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.styles.js","sources":["../../../src/Dropdown/Dropdown.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropdown\", {\n root: {\n width: \"100%\",\n position: \"relative\",\n display: \"inline-block\",\n },\n labelContainer: { display: \"flex\", alignItems: \"flex-start\" },\n label: { paddingBottom: \"6px\", display: \"block\" },\n description: {},\n error: {},\n placeholder: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n placeholderClosed: {\n color: theme.colors.secondary_80,\n },\n selectionDisabled: {\n lineHeight: theme.space.md,\n color: theme.colors.secondary_60,\n },\n dropdown: {\n width: \"100%\",\n borderRadius: theme.radii.base,\n\n \"& $dropdownHeaderInvalid\": {\n border: `1px solid ${theme.colors.
|
|
1
|
+
{"version":3,"file":"Dropdown.styles.js","sources":["../../../src/Dropdown/Dropdown.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDropdown\", {\n root: {\n width: \"100%\",\n position: \"relative\",\n display: \"inline-block\",\n },\n labelContainer: { display: \"flex\", alignItems: \"flex-start\" },\n label: { paddingBottom: \"6px\", display: \"block\" },\n description: {},\n error: {},\n placeholder: {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n },\n placeholderClosed: {\n color: theme.colors.secondary_80,\n },\n selectionDisabled: {\n lineHeight: theme.space.md,\n color: theme.colors.secondary_60,\n },\n dropdown: {\n width: \"100%\",\n borderRadius: theme.radii.base,\n\n \"& $dropdownHeaderInvalid\": {\n border: `1px solid ${theme.colors.negative_120}`,\n },\n },\n arrow: {},\n dropdownHeader: {},\n dropdownHeaderInvalid: {},\n dropdownHeaderOpen: {},\n dropdownListContainer: {},\n rootList: {},\n disabled: {\n color: theme.colors.secondary_60,\n },\n readOnly: {\n \"& $dropdownHeader\": {\n border: `1px solid ${theme.colors.secondary_80}`,\n backgroundColor: theme.colors.atmo1,\n },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA,EACvE,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,EACX;AAAA,EACA,gBAAgB,EAAE,SAAS,QAAQ,YAAY,aAAa;AAAA,EAC5D,OAAO,EAAE,eAAe,OAAO,SAAS,QAAQ;AAAA,EAChD,aAAa,CAAC;AAAA,EACd,OAAO,CAAC;AAAA,EACR,aAAa;AAAA,IACX,UAAU;AAAA,IACV,cAAc;AAAA,IACd,YAAY;AAAA,EACd;AAAA,EACA,mBAAmB;AAAA,IACjB,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,mBAAmB;AAAA,IACjB,YAAY,MAAM,MAAM;AAAA,IACxB,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,cAAc,MAAM,MAAM;AAAA,IAE1B,4BAA4B;AAAA,MAC1B,QAAQ,aAAa,MAAM,OAAO,YAAY;AAAA,IAAA;AAAA,EAElD;AAAA,EACA,OAAO,CAAC;AAAA,EACR,gBAAgB,CAAC;AAAA,EACjB,uBAAuB,CAAC;AAAA,EACxB,oBAAoB,CAAC;AAAA,EACrB,uBAAuB,CAAC;AAAA,EACxB,UAAU,CAAC;AAAA,EACX,UAAU;AAAA,IACR,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,UAAU;AAAA,IACR,qBAAqB;AAAA,MACnB,QAAQ,aAAa,MAAM,OAAO,YAAY;AAAA,MAC9C,iBAAiB,MAAM,OAAO;AAAA,IAAA;AAAA,EAChC;AAEJ,CAAC;"}
|
|
@@ -19,7 +19,7 @@ const HvDropdownButton = forwardRef(function HvDropdownButton2(props, ref) {
|
|
|
19
19
|
...others
|
|
20
20
|
} = useDefaultProps("HvDropdownButton", props);
|
|
21
21
|
const { classes, cx } = useClasses(classesProp);
|
|
22
|
-
const endIcon = icon ? void 0 : /* @__PURE__ */ jsx(DropDownXS, {
|
|
22
|
+
const endIcon = icon ? void 0 : /* @__PURE__ */ jsx(DropDownXS, { size: "XS", rotate: open });
|
|
23
23
|
return /* @__PURE__ */ jsx(
|
|
24
24
|
HvButton,
|
|
25
25
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownButton.js","sources":["../../../src/DropdownButton/DropdownButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { Placement } from \"@popperjs/core\";\nimport { DropDownXS } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps } from \"../Button\";\nimport { staticClasses, useClasses } from \"./DropdownButton.styles\";\n\nexport { staticClasses as dropdownButtonClasses };\n\nexport type HvDropdownButtonClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDropdownButtonProps\n extends Omit<HvButtonProps, \"startAdornment\" | \"endAdornment\" | \"classes\"> {\n /** Whether the button is in read only mode when used as a form element. */\n readOnly?: boolean;\n /** Whether the content triggered by the button is opened or not. */\n open?: boolean;\n /** Placement of the content triggered by the button. @default bottom */\n placement?: Placement;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvDropdownButtonClasses;\n}\n\n/**\n * IMPORTANT: This component is not ready to be exported to external users.\n *\n * Implements the DS dropdown button pattern.\n */\nexport const HvDropdownButton = forwardRef<\n HTMLButtonElement,\n HvDropdownButtonProps\n>(function HvDropdownButton(props, ref) {\n const {\n className,\n classes: classesProp,\n placement = \"bottom\",\n disabled,\n open,\n icon,\n readOnly,\n children,\n variant,\n ...others\n } = useDefaultProps(\"HvDropdownButton\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const endIcon = icon ? undefined :
|
|
1
|
+
{"version":3,"file":"DropdownButton.js","sources":["../../../src/DropdownButton/DropdownButton.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { Placement } from \"@popperjs/core\";\nimport { DropDownXS } from \"@hitachivantara/uikit-react-icons\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvButton, HvButtonProps } from \"../Button\";\nimport { staticClasses, useClasses } from \"./DropdownButton.styles\";\n\nexport { staticClasses as dropdownButtonClasses };\n\nexport type HvDropdownButtonClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDropdownButtonProps\n extends Omit<HvButtonProps, \"startAdornment\" | \"endAdornment\" | \"classes\"> {\n /** Whether the button is in read only mode when used as a form element. */\n readOnly?: boolean;\n /** Whether the content triggered by the button is opened or not. */\n open?: boolean;\n /** Placement of the content triggered by the button. @default bottom */\n placement?: Placement;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvDropdownButtonClasses;\n}\n\n/**\n * IMPORTANT: This component is not ready to be exported to external users.\n *\n * Implements the DS dropdown button pattern.\n */\nexport const HvDropdownButton = forwardRef<\n HTMLButtonElement,\n HvDropdownButtonProps\n>(function HvDropdownButton(props, ref) {\n const {\n className,\n classes: classesProp,\n placement = \"bottom\",\n disabled,\n open,\n icon,\n readOnly,\n children,\n variant,\n ...others\n } = useDefaultProps(\"HvDropdownButton\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const endIcon = icon ? undefined : <DropDownXS size=\"XS\" rotate={open} />;\n\n return (\n <HvButton\n ref={ref}\n icon={icon}\n disabled={disabled || readOnly}\n className={cx(\n classes.root,\n {\n [classes.open]: open,\n [classes.openUp]: open && placement.includes(\"top\"),\n [classes.openDown]: open && placement.includes(\"bottom\"),\n [classes.disabled]: disabled,\n [classes.readOnly]: readOnly,\n },\n className,\n )}\n classes={{ endIcon: classes.arrowContainer }}\n endIcon={endIcon}\n variant={open ? \"secondarySubtle\" : variant}\n {...others}\n >\n <div className={cx({ [classes.selection]: !icon })}>\n {children && typeof children === \"string\" ? (\n <div className={classes.placeholder}>{children}</div>\n ) : (\n children\n )}\n </div>\n </HvButton>\n );\n});\n"],"names":["HvDropdownButton"],"mappings":";;;;;;;AAgCO,MAAM,mBAAmB,WAG9B,SAASA,kBAAiB,OAAO,KAAK;AAChC,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,oBAAoB,KAAK;AAE7C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAExC,QAAA,UAAU,OAAO,SAAY,oBAAC,cAAW,MAAK,MAAK,QAAQ,KAAM,CAAA;AAGrE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU,YAAY;AAAA,MACtB,WAAW;AAAA,QACT,QAAQ;AAAA,QACR;AAAA,UACE,CAAC,QAAQ,IAAI,GAAG;AAAA,UAChB,CAAC,QAAQ,MAAM,GAAG,QAAQ,UAAU,SAAS,KAAK;AAAA,UAClD,CAAC,QAAQ,QAAQ,GAAG,QAAQ,UAAU,SAAS,QAAQ;AAAA,UACvD,CAAC,QAAQ,QAAQ,GAAG;AAAA,UACpB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAS,EAAE,SAAS,QAAQ,eAAe;AAAA,MAC3C;AAAA,MACA,SAAS,OAAO,oBAAoB;AAAA,MACnC,GAAG;AAAA,MAEJ,UAAA,oBAAC,OAAI,EAAA,WAAW,GAAG,EAAE,CAAC,QAAQ,SAAS,GAAG,CAAC,KAAM,CAAA,GAC9C,UAAY,YAAA,OAAO,aAAa,WAC9B,oBAAA,OAAA,EAAI,WAAW,QAAQ,aAAc,SAAS,CAAA,IAE/C,SAEJ,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ,CAAC;"}
|