@hitachivantara/uikit-react-core 5.88.0 → 5.89.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/ActionsGeneric/ActionsGeneric.cjs +1 -2
- package/dist/cjs/AppSwitcher/Action/Action.styles.cjs +2 -2
- package/dist/cjs/Banner/Banner.cjs +5 -5
- package/dist/cjs/Banner/BannerContent/BannerContent.cjs +59 -97
- package/dist/cjs/Banner/BannerContent/BannerContent.styles.cjs +18 -46
- package/dist/cjs/BaseDropdown/BaseDropdown.styles.cjs +1 -2
- package/dist/cjs/Button/Button.cjs +1 -2
- package/dist/cjs/Button/Button.styles.cjs +0 -6
- package/dist/cjs/DotPagination/DotPagination.styles.cjs +3 -0
- package/dist/cjs/FormElement/Adornment/Adornment.styles.cjs +1 -4
- package/dist/cjs/IconContainer/IconContainer.cjs +81 -0
- package/dist/cjs/ListContainer/ListItem/ListItem.styles.cjs +0 -6
- package/dist/cjs/Loading/Loading.cjs +1 -2
- package/dist/cjs/Loading/Loading.styles.cjs +3 -1
- package/dist/cjs/Snackbar/Snackbar.cjs +6 -5
- package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.cjs +20 -28
- package/dist/cjs/Snackbar/SnackbarContent/SnackbarContent.styles.cjs +26 -56
- package/dist/cjs/{TableSection → Table/TableSection}/TableSection.cjs +2 -2
- package/dist/cjs/{TableSection → Table/TableSection}/TableSection.styles.cjs +12 -12
- package/dist/cjs/Table/hooks/useHvRowExpand.cjs +3 -3
- package/dist/cjs/Tabs/Tab/Tab.styles.cjs +0 -3
- package/dist/cjs/TagsInput/TagsInput.styles.cjs +1 -1
- package/dist/cjs/Typography/Typography.styles.cjs +2 -1
- package/dist/cjs/VerticalNavigation/NavigationSlider/NavigationSlider.styles.cjs +0 -3
- package/dist/cjs/VerticalNavigation/TreeView/TreeViewItem.styles.cjs +0 -4
- package/dist/cjs/index.cjs +9 -4
- package/dist/cjs/utils/Callout.cjs +134 -0
- package/dist/esm/ActionsGeneric/ActionsGeneric.js +1 -2
- package/dist/esm/ActionsGeneric/ActionsGeneric.js.map +1 -1
- package/dist/esm/AppSwitcher/Action/Action.styles.js +2 -2
- package/dist/esm/AppSwitcher/Action/Action.styles.js.map +1 -1
- package/dist/esm/Banner/Banner.js +5 -5
- package/dist/esm/Banner/Banner.js.map +1 -1
- package/dist/esm/Banner/BannerContent/BannerContent.js +60 -96
- package/dist/esm/Banner/BannerContent/BannerContent.js.map +1 -1
- package/dist/esm/Banner/BannerContent/BannerContent.styles.js +18 -46
- package/dist/esm/Banner/BannerContent/BannerContent.styles.js.map +1 -1
- package/dist/esm/BaseDropdown/BaseDropdown.styles.js +1 -2
- package/dist/esm/BaseDropdown/BaseDropdown.styles.js.map +1 -1
- package/dist/esm/Button/Button.js +2 -3
- package/dist/esm/Button/Button.js.map +1 -1
- package/dist/esm/Button/Button.styles.js +0 -6
- package/dist/esm/Button/Button.styles.js.map +1 -1
- package/dist/esm/DotPagination/DotPagination.styles.js +3 -0
- package/dist/esm/DotPagination/DotPagination.styles.js.map +1 -1
- package/dist/esm/FormElement/Adornment/Adornment.styles.js +1 -4
- package/dist/esm/FormElement/Adornment/Adornment.styles.js.map +1 -1
- package/dist/esm/IconContainer/IconContainer.js +81 -0
- package/dist/esm/IconContainer/IconContainer.js.map +1 -0
- package/dist/esm/ListContainer/ListItem/ListItem.styles.js +0 -6
- package/dist/esm/ListContainer/ListItem/ListItem.styles.js.map +1 -1
- package/dist/esm/Loading/Loading.js +1 -2
- package/dist/esm/Loading/Loading.js.map +1 -1
- package/dist/esm/Loading/Loading.styles.js +3 -1
- package/dist/esm/Loading/Loading.styles.js.map +1 -1
- package/dist/esm/Snackbar/Snackbar.js +6 -5
- package/dist/esm/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js +23 -29
- package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.js.map +1 -1
- package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js +26 -56
- package/dist/esm/Snackbar/SnackbarContent/SnackbarContent.styles.js.map +1 -1
- package/dist/esm/Table/Table.js.map +1 -1
- package/dist/esm/{TableSection → Table/TableSection}/TableSection.js +2 -2
- package/dist/esm/Table/TableSection/TableSection.js.map +1 -0
- package/dist/esm/{TableSection → Table/TableSection}/TableSection.styles.js +12 -12
- package/dist/esm/Table/TableSection/TableSection.styles.js.map +1 -0
- package/dist/esm/Table/hooks/useHvRowExpand.js +3 -3
- package/dist/esm/Table/hooks/useHvRowExpand.js.map +1 -1
- package/dist/esm/Tabs/Tab/Tab.styles.js +0 -3
- package/dist/esm/Tabs/Tab/Tab.styles.js.map +1 -1
- package/dist/esm/TagsInput/TagsInput.styles.js +1 -1
- package/dist/esm/TagsInput/TagsInput.styles.js.map +1 -1
- package/dist/esm/Typography/Typography.styles.js +2 -1
- package/dist/esm/Typography/Typography.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +0 -3
- package/dist/esm/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js.map +1 -1
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js +0 -4
- package/dist/esm/VerticalNavigation/TreeView/TreeViewItem.styles.js.map +1 -1
- package/dist/esm/index.js +56 -51
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/Callout.js +132 -0
- package/dist/esm/utils/Callout.js.map +1 -0
- package/dist/types/index.d.ts +518 -452
- package/package.json +6 -6
- package/dist/esm/TableSection/TableSection.js.map +0 -1
- package/dist/esm/TableSection/TableSection.styles.js.map +0 -1
|
@@ -1,106 +1,70 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { iconVariant } from "../../utils/iconVariant.js";
|
|
6
|
-
import { setId } from "../../utils/setId.js";
|
|
3
|
+
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
4
|
+
import { HvCallout } from "../../utils/Callout.js";
|
|
7
5
|
import { useClasses } from "./BannerContent.styles.js";
|
|
8
6
|
import { staticClasses } from "./BannerContent.styles.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
const HvBannerContent = forwardRef(function HvBannerContent2(props, ref) {
|
|
8
|
+
const {
|
|
9
|
+
id,
|
|
10
|
+
classes: classesProp,
|
|
11
|
+
className,
|
|
12
|
+
showIcon,
|
|
13
|
+
customIcon,
|
|
14
|
+
variant = "default",
|
|
15
|
+
onClose,
|
|
16
|
+
actions,
|
|
17
|
+
actionsCallback,
|
|
18
|
+
// TODO - remove in v6
|
|
19
|
+
onAction,
|
|
20
|
+
actionsPosition = "auto",
|
|
21
|
+
content,
|
|
22
|
+
children,
|
|
23
|
+
actionProps,
|
|
24
|
+
...others
|
|
25
|
+
} = useDefaultProps("HvBannerContent", props);
|
|
26
|
+
const { classes, cx } = useClasses(classesProp);
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
HvCallout,
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
14
31
|
id,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
showIcon
|
|
32
|
+
variant,
|
|
33
|
+
showClose: true,
|
|
34
|
+
showIcon,
|
|
18
35
|
customIcon,
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
classes: {
|
|
37
|
+
root: cx(
|
|
38
|
+
classes.root,
|
|
39
|
+
classes.outContainer,
|
|
40
|
+
classes.baseVariant,
|
|
41
|
+
classes[variant],
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
message: classes.message,
|
|
45
|
+
action: classes.action,
|
|
46
|
+
messageIcon: classes.iconContainer,
|
|
47
|
+
messageContent: classes.messageContainer,
|
|
48
|
+
actionCustom: classes.messageActions,
|
|
49
|
+
actionContent: cx(
|
|
50
|
+
classes.actionContainer,
|
|
51
|
+
classes.actionsInnerContainer
|
|
52
|
+
),
|
|
53
|
+
actionClose: classes.closeAction
|
|
54
|
+
},
|
|
21
55
|
actions,
|
|
22
|
-
|
|
23
|
-
// TODO - remove in v6
|
|
24
|
-
onAction,
|
|
25
|
-
actionsPosition = "auto",
|
|
26
|
-
content,
|
|
27
|
-
children,
|
|
56
|
+
actionsPosition,
|
|
28
57
|
actionProps,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
SnackbarContent,
|
|
40
|
-
{
|
|
41
|
-
ref,
|
|
42
|
-
id,
|
|
43
|
-
classes: {
|
|
44
|
-
root: classes.root,
|
|
45
|
-
message: classes.message,
|
|
46
|
-
action: classes.action
|
|
47
|
-
},
|
|
48
|
-
className: cx(classes.baseVariant, classes[variant], className),
|
|
49
|
-
message: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
-
icon && /* @__PURE__ */ jsx("div", { className: classes.iconContainer, children: icon }),
|
|
51
|
-
/* @__PURE__ */ jsx(
|
|
52
|
-
"div",
|
|
53
|
-
{
|
|
54
|
-
id: setId(id, "message-text"),
|
|
55
|
-
className: classes.messageContainer,
|
|
56
|
-
children: children ?? content
|
|
57
|
-
}
|
|
58
|
-
),
|
|
59
|
-
actions && effectiveActionsPosition === "inline" && /* @__PURE__ */ jsx(
|
|
60
|
-
"div",
|
|
61
|
-
{
|
|
62
|
-
id: setId(id, "message-actions"),
|
|
63
|
-
className: classes.messageActions,
|
|
64
|
-
children: /* @__PURE__ */ jsx(
|
|
65
|
-
HvActionsGeneric,
|
|
66
|
-
{
|
|
67
|
-
id,
|
|
68
|
-
variant: "semantic",
|
|
69
|
-
actions,
|
|
70
|
-
onAction: handleAction
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
] }),
|
|
76
|
-
action: /* @__PURE__ */ jsxs("div", { className: classes.actionContainer, children: [
|
|
77
|
-
/* @__PURE__ */ jsx(
|
|
78
|
-
HvButton,
|
|
79
|
-
{
|
|
80
|
-
icon: true,
|
|
81
|
-
className: classes.closeAction,
|
|
82
|
-
variant: "semantic",
|
|
83
|
-
"aria-label": "Close",
|
|
84
|
-
onClick: onClose,
|
|
85
|
-
...actionProps,
|
|
86
|
-
children: /* @__PURE__ */ jsx(Close, { size: "XS" })
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
actions && effectiveActionsPosition === "bottom-right" && /* @__PURE__ */ jsx("div", { className: classes.actionsInnerContainer, children: /* @__PURE__ */ jsx(
|
|
90
|
-
HvActionsGeneric,
|
|
91
|
-
{
|
|
92
|
-
id,
|
|
93
|
-
variant: "semantic",
|
|
94
|
-
actions,
|
|
95
|
-
onAction: handleAction
|
|
96
|
-
}
|
|
97
|
-
) })
|
|
98
|
-
] }),
|
|
99
|
-
...others
|
|
100
|
-
}
|
|
101
|
-
) });
|
|
102
|
-
}
|
|
103
|
-
);
|
|
58
|
+
onClose: (evt) => onClose?.(evt),
|
|
59
|
+
onAction: (evt, action) => {
|
|
60
|
+
onAction?.(evt, action);
|
|
61
|
+
actionsCallback?.(evt, id, action);
|
|
62
|
+
},
|
|
63
|
+
...others,
|
|
64
|
+
children: children ?? content
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
});
|
|
104
68
|
export {
|
|
105
69
|
HvBannerContent,
|
|
106
70
|
staticClasses as bannerContentClasses
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerContent.js","sources":["../../../../src/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport
|
|
1
|
+
{"version":3,"file":"BannerContent.js","sources":["../../../../src/Banner/BannerContent/BannerContent.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { SnackbarContentProps as MuiSnackbarContentProps } from \"@mui/material/SnackbarContent\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvActionsGenericProps } from \"../../ActionsGeneric\";\nimport { HvButtonProps } from \"../../Button\";\nimport { HvCallout } from \"../../utils/Callout\";\nimport { HvBannerActionPosition, HvBannerVariant } from \"../types\";\nimport { staticClasses, useClasses } from \"./BannerContent.styles\";\n\nexport { staticClasses as bannerContentClasses };\n\nexport type HvBannerContentClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBannerContentProps\n extends Omit<MuiSnackbarContentProps, \"variant\" | \"classes\" | \"onClose\"> {\n /** The message to display. @deprecated use `children` instead */\n content?: string;\n /** The message to display. */\n children?: React.ReactNode;\n /** Variant of the snackbar. */\n variant?: HvBannerVariant;\n /** Controls if the associated icon to the variant should be shown. */\n showIcon?: boolean;\n /** Custom icon to replace the variant default. */\n customIcon?: React.ReactNode;\n /** Function called when clicking on the close button. */\n onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n /** Actions to display on the right side. */\n actions?: HvActionsGenericProps[\"actions\"];\n /**\n * The callback function called when an action is triggered, receiving `action` as parameter.\n *\n * @deprecated Use `onAction` instead.\n * */\n actionsCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** The callback function called when an action is triggered, receiving `action` as parameter. */\n onAction?: HvActionsGenericProps[\"onAction\"];\n /** The position property of the header. */\n actionsPosition?: HvBannerActionPosition;\n /** The props to pass down to the Action Container. */\n actionProps?: Partial<HvButtonProps>;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvBannerContentClasses;\n}\n\nexport const HvBannerContent = forwardRef<\n // no-indent\n HTMLDivElement,\n HvBannerContentProps\n>(function HvBannerContent(props, ref) {\n const {\n id,\n classes: classesProp,\n className,\n showIcon,\n customIcon,\n variant = \"default\",\n onClose,\n actions,\n actionsCallback, // TODO - remove in v6\n onAction,\n actionsPosition = \"auto\",\n content,\n children,\n actionProps,\n ...others\n } = useDefaultProps(\"HvBannerContent\", props);\n const { classes, cx } = useClasses(classesProp);\n\n return (\n <HvCallout\n ref={ref}\n id={id}\n variant={variant}\n showClose\n showIcon={showIcon}\n customIcon={customIcon}\n classes={{\n root: cx(\n classes.root,\n classes.outContainer,\n classes.baseVariant,\n classes[variant],\n className,\n ),\n message: classes.message,\n action: classes.action,\n messageIcon: classes.iconContainer,\n messageContent: classes.messageContainer,\n actionCustom: classes.messageActions,\n actionContent: cx(\n classes.actionContainer,\n classes.actionsInnerContainer,\n ),\n actionClose: classes.closeAction,\n }}\n actions={actions}\n actionsPosition={actionsPosition}\n actionProps={actionProps}\n onClose={(evt) => onClose?.(evt as React.MouseEvent<any>)}\n onAction={(evt, action) => {\n onAction?.(evt, action);\n actionsCallback?.(evt, id!, action);\n }}\n {...others}\n >\n {children ?? content}\n </HvCallout>\n );\n});\n"],"names":["HvBannerContent"],"mappings":";;;;;;AAiDO,MAAM,kBAAkB,WAI7B,SAASA,iBAAgB,OAAO,KAAK;AAC/B,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,mBAAmB,KAAK;AAC5C,QAAM,EAAE,SAAS,OAAO,WAAW,WAAW;AAG5C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,SAAS;AAAA,QACP,MAAM;AAAA,UACJ,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ;AAAA,UACR,QAAQ,OAAO;AAAA,UACf;AAAA,QACF;AAAA,QACA,SAAS,QAAQ;AAAA,QACjB,QAAQ,QAAQ;AAAA,QAChB,aAAa,QAAQ;AAAA,QACrB,gBAAgB,QAAQ;AAAA,QACxB,cAAc,QAAQ;AAAA,QACtB,eAAe;AAAA,UACb,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV;AAAA,QACA,aAAa,QAAQ;AAAA,MACvB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,CAAC,QAAQ,UAAU,GAA4B;AAAA,MACxD,UAAU,CAAC,KAAK,WAAW;AACzB,mBAAW,KAAK,MAAM;AACJ,0BAAA,KAAK,IAAK,MAAM;AAAA,MACpC;AAAA,MACC,GAAG;AAAA,MAEH,UAAY,YAAA;AAAA,IAAA;AAAA,EACf;AAEJ,CAAC;"}
|
|
@@ -3,72 +3,44 @@ import { theme } from "@hitachivantara/uikit-styles";
|
|
|
3
3
|
const { useClasses, staticClasses } = createClasses("HvBannerContent", {
|
|
4
4
|
root: {
|
|
5
5
|
minWidth: "100%",
|
|
6
|
+
width: "100%",
|
|
6
7
|
position: "relative",
|
|
7
|
-
|
|
8
|
-
flexWrap: "nowrap",
|
|
9
|
-
boxShadow: "none",
|
|
8
|
+
gap: theme.space.xs,
|
|
10
9
|
borderRadius: theme.radii.none
|
|
11
10
|
},
|
|
11
|
+
success: {},
|
|
12
|
+
warning: {},
|
|
13
|
+
error: {},
|
|
14
|
+
default: {},
|
|
12
15
|
message: {
|
|
13
|
-
|
|
14
|
-
alignItems: "center",
|
|
16
|
+
gap: theme.space.xs,
|
|
15
17
|
padding: theme.spacing("xs", 0),
|
|
16
18
|
paddingLeft: theme.space.sm,
|
|
17
19
|
...theme.typography.body,
|
|
18
20
|
color: theme.colors.base_dark
|
|
19
21
|
},
|
|
20
22
|
action: {
|
|
21
|
-
padding: theme.
|
|
22
|
-
marginRight: 0,
|
|
23
|
+
padding: theme.space.xs,
|
|
23
24
|
flex: "0 0 auto",
|
|
24
25
|
placeSelf: "stretch"
|
|
25
26
|
},
|
|
26
|
-
baseVariant: {
|
|
27
|
-
padding: 0
|
|
28
|
-
},
|
|
29
|
-
success: {
|
|
30
|
-
backgroundColor: theme.colors.positive_20
|
|
31
|
-
},
|
|
32
|
-
warning: {
|
|
33
|
-
backgroundColor: theme.colors.warning_20
|
|
34
|
-
},
|
|
35
|
-
error: {
|
|
36
|
-
backgroundColor: theme.colors.negative_20
|
|
37
|
-
},
|
|
38
|
-
default: {
|
|
39
|
-
backgroundColor: theme.colors.neutral_20
|
|
40
|
-
},
|
|
41
|
-
outContainer: {
|
|
42
|
-
width: "100%",
|
|
43
|
-
position: "relative"
|
|
44
|
-
},
|
|
45
27
|
messageContainer: {
|
|
46
|
-
|
|
47
|
-
maxWidth: 700,
|
|
48
|
-
overflow: "hidden",
|
|
49
|
-
marginRight: 10
|
|
28
|
+
maxWidth: 700
|
|
50
29
|
},
|
|
51
30
|
iconContainer: {
|
|
52
|
-
|
|
53
|
-
marginLeft: -theme.space.xs
|
|
31
|
+
marginLeft: theme.spacing(-1)
|
|
54
32
|
},
|
|
55
33
|
messageActions: {
|
|
56
34
|
flex: "0 0 auto"
|
|
57
35
|
},
|
|
58
|
-
actionContainer: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
marginTop: "8px"
|
|
67
|
-
// avoid overlap with close button outline focus ring
|
|
68
|
-
},
|
|
69
|
-
closeAction: {
|
|
70
|
-
alignSelf: "flex-end"
|
|
71
|
-
}
|
|
36
|
+
actionContainer: {},
|
|
37
|
+
closeAction: {},
|
|
38
|
+
/** @deprecated use ´classes.root` instead */
|
|
39
|
+
baseVariant: {},
|
|
40
|
+
/** @deprecated use `classes.root` instead */
|
|
41
|
+
outContainer: {},
|
|
42
|
+
/** @deprecated use `classes.actionContainer` instead */
|
|
43
|
+
actionsInnerContainer: {}
|
|
72
44
|
});
|
|
73
45
|
export {
|
|
74
46
|
staticClasses,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerContent.styles.js","sources":["../../../../src/Banner/BannerContent/BannerContent.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvBannerContent\", {\n root: {\n minWidth: \"100%\",\n
|
|
1
|
+
{"version":3,"file":"BannerContent.styles.js","sources":["../../../../src/Banner/BannerContent/BannerContent.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvBannerContent\", {\n root: {\n minWidth: \"100%\",\n width: \"100%\",\n position: \"relative\",\n gap: theme.space.xs,\n borderRadius: theme.radii.none,\n },\n success: {},\n warning: {},\n error: {},\n default: {},\n message: {\n gap: theme.space.xs,\n padding: theme.spacing(\"xs\", 0),\n paddingLeft: theme.space.sm,\n ...theme.typography.body,\n color: theme.colors.base_dark,\n },\n action: {\n padding: theme.space.xs,\n flex: \"0 0 auto\",\n placeSelf: \"stretch\",\n },\n messageContainer: {\n maxWidth: 700,\n },\n iconContainer: {\n marginLeft: theme.spacing(-1),\n },\n messageActions: {\n flex: \"0 0 auto\",\n },\n actionContainer: {},\n closeAction: {},\n /** @deprecated use ´classes.root` instead */\n baseVariant: {},\n /** @deprecated use `classes.root` instead */\n outContainer: {},\n /** @deprecated use `classes.actionContainer` instead */\n actionsInnerContainer: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,YAAY,kBAAkB,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,OAAO;AAAA,IACP,UAAU;AAAA,IACV,KAAK,MAAM,MAAM;AAAA,IACjB,cAAc,MAAM,MAAM;AAAA,EAC5B;AAAA,EACA,SAAS,CAAC;AAAA,EACV,SAAS,CAAC;AAAA,EACV,OAAO,CAAC;AAAA,EACR,SAAS,CAAC;AAAA,EACV,SAAS;AAAA,IACP,KAAK,MAAM,MAAM;AAAA,IACjB,SAAS,MAAM,QAAQ,MAAM,CAAC;AAAA,IAC9B,aAAa,MAAM,MAAM;AAAA,IACzB,GAAG,MAAM,WAAW;AAAA,IACpB,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,MAAM,MAAM;AAAA,IACrB,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA,kBAAkB;AAAA,IAChB,UAAU;AAAA,EACZ;AAAA,EACA,eAAe;AAAA,IACb,YAAY,MAAM,QAAQ,EAAE;AAAA,EAC9B;AAAA,EACA,gBAAgB;AAAA,IACd,MAAM;AAAA,EACR;AAAA,EACA,iBAAiB,CAAC;AAAA,EAClB,aAAa,CAAC;AAAA;AAAA,EAEd,aAAa,CAAC;AAAA;AAAA,EAEd,cAAc,CAAC;AAAA;AAAA,EAEf,uBAAuB,CAAA;AACzB,CAAC;"}
|
|
@@ -77,8 +77,7 @@ const { useClasses, staticClasses } = createClasses("HvBaseDropdown", {
|
|
|
77
77
|
height: "30px",
|
|
78
78
|
boxSizing: "border-box",
|
|
79
79
|
paddingLeft: theme.space.xs,
|
|
80
|
-
paddingRight: theme.sizes.sm
|
|
81
|
-
color: "inherit"
|
|
80
|
+
paddingRight: theme.sizes.sm
|
|
82
81
|
},
|
|
83
82
|
selectionDisabled: {},
|
|
84
83
|
placeholder: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDropdown.styles.js","sources":["../../../src/BaseDropdown/BaseDropdown.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 { useClasses, staticClasses } = createClasses(\"HvBaseDropdown\", {\n root: { width: \"100%\", position: \"relative\" },\n rootDisabled: {\n cursor: \"not-allowed\",\n \"&:focus\": {\n outline: \"none\",\n },\n },\n anchor: { display: \"inline-block\", width: \"100%\" },\n container: { zIndex: theme.zIndices.popover, width: \"auto\" },\n header: {\n cursor: \"pointer\",\n userSelect: \"none\",\n position: \"relative\",\n background: theme.colors.atmo1,\n boxSizing: \"border-box\",\n border: `1px solid ${theme.colors.secondary}`,\n borderRadius: theme.radii.base,\n \"&:hover\": {\n border: `1px solid ${theme.colors.primary}`,\n },\n \"&:focus\": {\n outline: \"none\",\n },\n \"&:focus-visible\": {\n ...outlineStyles,\n border: `1px solid ${theme.colors.primary}`,\n },\n },\n headerOpen: {\n border: `1px solid ${theme.colors.secondary}`,\n\n \"&:hover\": {\n border: `1px solid ${theme.colors.secondary}`,\n },\n },\n headerOpenUp: {\n borderRadius: `0px 0px ${theme.radii.base} ${theme.radii.base}`,\n },\n headerOpenDown: {\n borderRadius: `${theme.radii.base} ${theme.radii.base} 0px 0px`,\n },\n headerDisabled: {\n cursor: \"not-allowed\",\n pointerEvents: \"none\",\n color: theme.colors.secondary_60,\n border: `1px solid ${theme.colors.secondary_60}`,\n background: theme.colors.atmo2,\n \"&:hover\": {\n border: `1px solid ${theme.colors.secondary_60}`,\n },\n },\n headerReadOnly: {\n cursor: \"not-allowed\",\n pointerEvents: \"none\",\n color: theme.colors.secondary_80,\n border: `1px solid ${theme.colors.secondary_60}`,\n background: theme.colors.atmo2,\n userSelect: \"text\",\n \"&:focus-visible\": {\n outline: \"none\",\n border: `1px solid ${theme.colors.secondary_60}`,\n },\n },\n arrowContainer: {\n position: \"absolute\",\n pointerEvents: \"none\",\n top: -1,\n right: -1,\n },\n arrow: {},\n selection: {\n display: \"flex\",\n alignItems: \"center\",\n height: \"30px\",\n boxSizing: \"border-box\",\n paddingLeft: theme.space.xs,\n paddingRight: theme.sizes.sm,\n
|
|
1
|
+
{"version":3,"file":"BaseDropdown.styles.js","sources":["../../../src/BaseDropdown/BaseDropdown.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 { useClasses, staticClasses } = createClasses(\"HvBaseDropdown\", {\n root: { width: \"100%\", position: \"relative\" },\n rootDisabled: {\n cursor: \"not-allowed\",\n \"&:focus\": {\n outline: \"none\",\n },\n },\n anchor: { display: \"inline-block\", width: \"100%\" },\n container: { zIndex: theme.zIndices.popover, width: \"auto\" },\n header: {\n cursor: \"pointer\",\n userSelect: \"none\",\n position: \"relative\",\n background: theme.colors.atmo1,\n boxSizing: \"border-box\",\n border: `1px solid ${theme.colors.secondary}`,\n borderRadius: theme.radii.base,\n \"&:hover\": {\n border: `1px solid ${theme.colors.primary}`,\n },\n \"&:focus\": {\n outline: \"none\",\n },\n \"&:focus-visible\": {\n ...outlineStyles,\n border: `1px solid ${theme.colors.primary}`,\n },\n },\n headerOpen: {\n border: `1px solid ${theme.colors.secondary}`,\n\n \"&:hover\": {\n border: `1px solid ${theme.colors.secondary}`,\n },\n },\n headerOpenUp: {\n borderRadius: `0px 0px ${theme.radii.base} ${theme.radii.base}`,\n },\n headerOpenDown: {\n borderRadius: `${theme.radii.base} ${theme.radii.base} 0px 0px`,\n },\n headerDisabled: {\n cursor: \"not-allowed\",\n pointerEvents: \"none\",\n color: theme.colors.secondary_60,\n border: `1px solid ${theme.colors.secondary_60}`,\n background: theme.colors.atmo2,\n \"&:hover\": {\n border: `1px solid ${theme.colors.secondary_60}`,\n },\n },\n headerReadOnly: {\n cursor: \"not-allowed\",\n pointerEvents: \"none\",\n color: theme.colors.secondary_80,\n border: `1px solid ${theme.colors.secondary_60}`,\n background: theme.colors.atmo2,\n userSelect: \"text\",\n \"&:focus-visible\": {\n outline: \"none\",\n border: `1px solid ${theme.colors.secondary_60}`,\n },\n },\n arrowContainer: {\n position: \"absolute\",\n pointerEvents: \"none\",\n top: -1,\n right: -1,\n },\n arrow: {},\n selection: {\n display: \"flex\",\n alignItems: \"center\",\n height: \"30px\",\n boxSizing: \"border-box\",\n paddingLeft: theme.space.xs,\n paddingRight: theme.sizes.sm,\n },\n selectionDisabled: {},\n placeholder: {\n display: \"block\",\n color: theme.colors.secondary_80,\n },\n panel: {\n // TODO: remove padding override in v6 (most elements need it)\n padding: 0,\n border: `1px solid ${theme.colors.secondary}`,\n },\n panelOpenedUp: {\n top: 1,\n borderRadius: `${theme.radii.base} ${theme.radii.base} 0 0`,\n },\n panelOpenedDown: {\n top: -1,\n borderRadius: `0 0 ${theme.radii.base} ${theme.radii.base}`,\n },\n inputExtensionOpen: {\n height: \"0px\",\n backgroundColor: theme.colors.atmo1,\n borderTop: \"none\",\n borderBottom: \"none\",\n borderRight: `1px solid ${theme.colors.secondary}`,\n borderLeft: `1px solid ${theme.colors.secondary}`,\n },\n inputExtensionLeftPosition: { marginLeft: \"auto\" },\n inputExtensionOpenShadow: {\n boxShadow: `0px 8px 0px ${theme.colors.atmo1}, 0px 0px 9px 0px rgba(65,65,65,.12)`,\n },\n inputExtensionFloatRight: { float: \"right\" },\n inputExtensionFloatLeft: { float: \"left\" },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,YAAY,kBAAkB,cAAc,kBAAkB;AAAA,EAC3E,MAAM,EAAE,OAAO,QAAQ,UAAU,WAAW;AAAA,EAC5C,cAAc;AAAA,IACZ,QAAQ;AAAA,IACR,WAAW;AAAA,MACT,SAAS;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,QAAQ,EAAE,SAAS,gBAAgB,OAAO,OAAO;AAAA,EACjD,WAAW,EAAE,QAAQ,MAAM,SAAS,SAAS,OAAO,OAAO;AAAA,EAC3D,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,YAAY,MAAM,OAAO;AAAA,IACzB,WAAW;AAAA,IACX,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,IAC3C,cAAc,MAAM,MAAM;AAAA,IAC1B,WAAW;AAAA,MACT,QAAQ,aAAa,MAAM,OAAO,OAAO;AAAA,IAC3C;AAAA,IACA,WAAW;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,mBAAmB;AAAA,MACj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B,CAAC;AAAA,EACpB,aAAa;AAAA,IACX,SAAS;AAAA,IACT,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,OAAO;AAAA;AAAA,IAEL,SAAS;AAAA,IACT,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,EAC7C;AAAA,EACA,eAAe;AAAA,IACb,KAAK;AAAA,IACL,cAAc,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EACvD;AAAA,EACA,iBAAiB;AAAA,IACf,KAAK;AAAA,IACL,cAAc,OAAO,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EAC3D;AAAA,EACA,oBAAoB;AAAA,IAClB,QAAQ;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW;AAAA,IACX,cAAc;AAAA,IACd,aAAa,aAAa,MAAM,OAAO,SAAS;AAAA,IAChD,YAAY,aAAa,MAAM,OAAO,SAAS;AAAA,EACjD;AAAA,EACA,4BAA4B,EAAE,YAAY,OAAO;AAAA,EACjD,0BAA0B;AAAA,IACxB,WAAW,eAAe,MAAM,OAAO,KAAK;AAAA,EAC9C;AAAA,EACA,0BAA0B,EAAE,OAAO,QAAQ;AAAA,EAC3C,yBAAyB,EAAE,OAAO,OAAO;AAC3C,CAAC;"}
|
|
@@ -3,7 +3,7 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { useDefaultProps, mergeStyles } from "@hitachivantara/uikit-react-utils";
|
|
4
4
|
import { theme, getColor } from "@hitachivantara/uikit-styles";
|
|
5
5
|
import { fixedForwardRef } from "../types/generic.js";
|
|
6
|
-
import { useClasses, getIconSizeStyles, getSizeStyles
|
|
6
|
+
import { useClasses, getIconSizeStyles, getSizeStyles } from "./Button.styles.js";
|
|
7
7
|
import { staticClasses } from "./Button.styles.js";
|
|
8
8
|
function parseVariant(variant) {
|
|
9
9
|
if (variant === "semantic") return ["inherit", "ghost"];
|
|
@@ -29,7 +29,7 @@ const HvButton = fixedForwardRef(function HvButton2(props, ref) {
|
|
|
29
29
|
endIcon,
|
|
30
30
|
size,
|
|
31
31
|
radius,
|
|
32
|
-
overrideIconColors
|
|
32
|
+
overrideIconColors,
|
|
33
33
|
component: Component = "button",
|
|
34
34
|
focusableWhenDisabled,
|
|
35
35
|
onClick: onClickProp,
|
|
@@ -67,7 +67,6 @@ const HvButton = fixedForwardRef(function HvButton2(props, ref) {
|
|
|
67
67
|
classes[variant],
|
|
68
68
|
classes[variantProp],
|
|
69
69
|
// Placed after type and color CSS for DS3 override
|
|
70
|
-
overrideIconColors && css(getOverrideColors()),
|
|
71
70
|
{
|
|
72
71
|
[classes.icon]: icon,
|
|
73
72
|
[classes.disabled]: disabled
|
|
@@ -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
|
|
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 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. @deprecated unused */\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,\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 {\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":";;;;;;;AAsEA,SAAS,aAAa,SAAiD;AAcrE,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A,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;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,QAAQ,EAAE,gBAAgB,SAAS;AAAA,MACnD,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,aAAc,oBAAA,QAAA,EAAK,WAAW,QAAQ,WAAY,UAAU,WAAA;AAAA,QAC5D;AAAA,QACA,WAAY,oBAAA,QAAA,EAAK,WAAW,QAAQ,SAAU,UAAQ,QAAA,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACzD;AAEJ,CAAC;"}
|
|
@@ -128,14 +128,8 @@ const getIconSizeStyles = (size) => {
|
|
|
128
128
|
width: height
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
|
-
const getOverrideColors = () => ({
|
|
132
|
-
"& svg .color0": {
|
|
133
|
-
fill: "currentcolor"
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
131
|
export {
|
|
137
132
|
getIconSizeStyles,
|
|
138
|
-
getOverrideColors,
|
|
139
133
|
getSizeStyles,
|
|
140
134
|
staticClasses,
|
|
141
135
|
useClasses
|
|
@@ -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 /** 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
|
|
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"],"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,GAA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ChD;AAAA,IACA,YAAY;AAAA,MACV,iBAAiB,MAAM,MAAM,cAAc,GAAG;AAAA,IAChD;AAAA,IACA,cAAc;AAAA,MACZ,iBAAiB,MAAM,MAAM,cAAc,GAAG;AAAA,IAAA;AAAA,EAElD;AAAA;AAAA,EAGA,SAAS,CAAC;AAAA,EACV,eAAe,CAAC;AAAA,EAChB,cAAc,CAAC;AAAA,EACf,iBAAiB,CAAC;AAAA,EAClB,gBAAgB,CAAC;AAAA;AAAA,EAGjB,WAAW,CAAA;AACb,CAAC;AAGD,MAAM,QAGF;AAAA,EACF,IAAI,EAAE,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;"}
|
|
@@ -13,6 +13,7 @@ const { useClasses, staticClasses } = createClasses("HvDotPagination", {
|
|
|
13
13
|
height: 16,
|
|
14
14
|
width: 16,
|
|
15
15
|
minWidth: 16,
|
|
16
|
+
color: "inherit",
|
|
16
17
|
"&:hover": {
|
|
17
18
|
backgroundColor: theme.colors.neutral_20,
|
|
18
19
|
borderRadius: "100%"
|
|
@@ -22,7 +23,9 @@ const { useClasses, staticClasses } = createClasses("HvDotPagination", {
|
|
|
22
23
|
minWidth: 0,
|
|
23
24
|
width: 16,
|
|
24
25
|
height: 16,
|
|
26
|
+
color: "inherit",
|
|
25
27
|
"&& svg": {
|
|
28
|
+
color: "inherit",
|
|
26
29
|
border: "none",
|
|
27
30
|
width: "unset",
|
|
28
31
|
height: "unset"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DotPagination.styles.js","sources":["../../../src/DotPagination/DotPagination.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvDotPagination\", {\n root: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n\n horizontal: {\n width: \"auto\",\n },\n\n radioRoot: {},\n\n radio: {\n height: 16,\n width: 16,\n minWidth: 16,\n\n \"&:hover\": {\n backgroundColor: theme.colors.neutral_20,\n borderRadius: \"100%\",\n },\n },\n\n icon: {\n minWidth: 0,\n width: 16,\n height: 16,\n \"&& svg\": {\n border: \"none\",\n width: \"unset\",\n height: \"unset\",\n },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,YAAY,kBAAkB,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,gBAAgB;AAAA,EAClB;AAAA,EAEA,YAAY;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EAEA,WAAW,CAAC;AAAA,EAEZ,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,
|
|
1
|
+
{"version":3,"file":"DotPagination.styles.js","sources":["../../../src/DotPagination/DotPagination.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { useClasses, staticClasses } = createClasses(\"HvDotPagination\", {\n root: {\n display: \"flex\",\n justifyContent: \"center\",\n },\n\n horizontal: {\n width: \"auto\",\n },\n\n radioRoot: {},\n\n radio: {\n height: 16,\n width: 16,\n minWidth: 16,\n color: \"inherit\",\n\n \"&:hover\": {\n backgroundColor: theme.colors.neutral_20,\n borderRadius: \"100%\",\n },\n },\n\n icon: {\n minWidth: 0,\n width: 16,\n height: 16,\n color: \"inherit\",\n \"&& svg\": {\n color: \"inherit\",\n border: \"none\",\n width: \"unset\",\n height: \"unset\",\n },\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,YAAY,kBAAkB,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,gBAAgB;AAAA,EAClB;AAAA,EAEA,YAAY;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EAEA,WAAW,CAAC;AAAA,EAEZ,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,IACV,OAAO;AAAA,IAEP,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,MAC9B,cAAc;AAAA,IAAA;AAAA,EAElB;AAAA,EAEA,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,UAAU;AAAA,MACR,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,QAAQ;AAAA,IAAA;AAAA,EACV;AAEJ,CAAC;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createClasses } from "@hitachivantara/uikit-react-utils";
|
|
2
|
-
import { theme } from "@hitachivantara/uikit-styles";
|
|
3
2
|
const { staticClasses, useClasses } = createClasses("HvAdornment", {
|
|
4
3
|
root: {
|
|
5
4
|
width: 32,
|
|
@@ -14,9 +13,7 @@ const { staticClasses, useClasses } = createClasses("HvAdornment", {
|
|
|
14
13
|
hideIcon: { display: "none" },
|
|
15
14
|
/** @deprecated use `classes.root` */
|
|
16
15
|
adornmentButton: {},
|
|
17
|
-
disabled: {
|
|
18
|
-
"& svg *.color0": { fill: theme.colors.secondary_60 }
|
|
19
|
-
}
|
|
16
|
+
disabled: {}
|
|
20
17
|
});
|
|
21
18
|
export {
|
|
22
19
|
staticClasses,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Adornment.styles.js","sources":["../../../../src/FormElement/Adornment/Adornment.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\
|
|
1
|
+
{"version":3,"file":"Adornment.styles.js","sources":["../../../../src/FormElement/Adornment/Adornment.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvAdornment\", {\n root: {\n width: 32,\n height: 30,\n },\n /** @deprecated use `classes.root` */\n icon: {},\n /** @deprecated use `classes.root` */\n adornment: {},\n /** @deprecated use `classes.root` */\n adornmentIcon: {},\n hideIcon: { display: \"none\" },\n /** @deprecated use `classes.root` */\n adornmentButton: {},\n disabled: {},\n});\n"],"names":[],"mappings":";AAEO,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA,EACxE,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA;AAAA,EAEA,MAAM,CAAC;AAAA;AAAA,EAEP,WAAW,CAAC;AAAA;AAAA,EAEZ,eAAe,CAAC;AAAA,EAChB,UAAU,EAAE,SAAS,OAAO;AAAA;AAAA,EAE5B,iBAAiB,CAAC;AAAA,EAClB,UAAU,CAAA;AACZ,CAAC;"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { createClasses, useDefaultProps, mergeStyles } from "@hitachivantara/uikit-react-utils";
|
|
4
|
+
import { getColor } from "@hitachivantara/uikit-styles";
|
|
5
|
+
const { staticClasses, useClasses } = createClasses("HvIconContainer", {
|
|
6
|
+
root: {
|
|
7
|
+
display: "inline-flex",
|
|
8
|
+
flex: "0 0 auto",
|
|
9
|
+
// ensure icon doesn't flex grow/shrink
|
|
10
|
+
fontSize: `var(--icsize, 16px)`,
|
|
11
|
+
// default size of 16px
|
|
12
|
+
transition: "rotate 0.2s ease",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
padding: 8
|
|
16
|
+
// default padding
|
|
17
|
+
// we're assuming svg children inherits from text color and size
|
|
18
|
+
},
|
|
19
|
+
xs: {
|
|
20
|
+
fontSize: 12,
|
|
21
|
+
padding: 10
|
|
22
|
+
},
|
|
23
|
+
sm: {
|
|
24
|
+
fontSize: 16
|
|
25
|
+
},
|
|
26
|
+
md: {
|
|
27
|
+
fontSize: 32
|
|
28
|
+
},
|
|
29
|
+
lg: {
|
|
30
|
+
fontSize: 96
|
|
31
|
+
},
|
|
32
|
+
xl: {
|
|
33
|
+
fontSize: 112
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const HvIconContainer = forwardRef(function HvIconContainer2(props, ref) {
|
|
37
|
+
const {
|
|
38
|
+
className,
|
|
39
|
+
classes: classesProp,
|
|
40
|
+
style,
|
|
41
|
+
color,
|
|
42
|
+
size: sizeProp = "S",
|
|
43
|
+
rotate,
|
|
44
|
+
children,
|
|
45
|
+
...others
|
|
46
|
+
} = useDefaultProps("HvIconContainer", props);
|
|
47
|
+
const { cx, classes } = useClasses(classesProp);
|
|
48
|
+
const size = mapSizes(sizeProp);
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
className: cx(classes.root, className, {
|
|
54
|
+
[classes[size]]: size
|
|
55
|
+
}),
|
|
56
|
+
style: mergeStyles(style, {
|
|
57
|
+
color: getColor(color),
|
|
58
|
+
rotate: rotate ? "180deg" : void 0,
|
|
59
|
+
...style
|
|
60
|
+
}),
|
|
61
|
+
...others,
|
|
62
|
+
children
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
});
|
|
66
|
+
function mapSizes(size) {
|
|
67
|
+
if (typeof size === "number") return void 0;
|
|
68
|
+
const iconSizeMap = {
|
|
69
|
+
XS: "xs",
|
|
70
|
+
S: "sm",
|
|
71
|
+
M: "md",
|
|
72
|
+
L: "lg"
|
|
73
|
+
};
|
|
74
|
+
return iconSizeMap[size] || size;
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
HvIconContainer,
|
|
78
|
+
staticClasses as iconContainerClasses,
|
|
79
|
+
staticClasses,
|
|
80
|
+
useClasses
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconContainer.js","sources":["../../../src/IconContainer/IconContainer.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport {\n createClasses,\n ExtractNames,\n mergeStyles,\n useDefaultProps,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny, HvSize } from \"@hitachivantara/uikit-styles\";\n\ntype HvIconSize = \"XS\" | \"S\" | \"M\" | \"L\";\n\n// keep this aligned with `icon`'s package, TODO: dedupe\nexport const { staticClasses, useClasses } = createClasses(\"HvIconContainer\", {\n root: {\n display: \"inline-flex\",\n flex: \"0 0 auto\", // ensure icon doesn't flex grow/shrink\n fontSize: `var(--icsize, 16px)`, // default size of 16px\n transition: \"rotate 0.2s ease\",\n justifyContent: \"center\",\n alignItems: \"center\",\n padding: 8, // default padding\n // we're assuming svg children inherits from text color and size\n },\n xs: {\n fontSize: 12,\n padding: 10,\n },\n sm: {\n fontSize: 16,\n },\n md: {\n fontSize: 32,\n },\n lg: {\n fontSize: 96,\n },\n xl: {\n fontSize: 112,\n },\n});\n\nexport { staticClasses as iconContainerClasses };\n\nexport type HvIconContainerClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvIconContainerProps\n extends React.HTMLAttributes<HTMLDivElement> {\n classes?: HvIconContainerClasses;\n /**\n * A color to override the default icon colors.\n * Accepts any valid CSS color or color from the UI Kit palette.\n * @example \"warning\"\n */\n color?: HvColorAny;\n /**\n * The size of the icon container. Takes in a `number` in pixels or any `HvSize` or `IconSize`.\n *\n * This will also affect the size of the icon by changing the `font-size`.\n *\n * @example\n * size={16}\n * size=\"S\"\n * size=\"lg\"\n *\n * @default \"S\"\n */\n size?: HvSize | HvIconSize | number;\n /** Whether to rotate the icon 180deg. @private */\n rotate?: boolean;\n}\n/**\n * This component allows using the theme utilities, such as `color` and `size` in icons from\n * external icon libraries, such as FontAwesome or Phosphor.\n *\n * @example\n * <HvIconContainer size=\"lg\" color=\"warning\">\n * <FontAwesomeIcon icon={faUser} />\n * </HvIconContainer>\n */\nexport const HvIconContainer = forwardRef<\n // no-indent\n HTMLDivElement,\n HvIconContainerProps\n>(function HvIconContainer(props, ref) {\n const {\n className,\n classes: classesProp,\n style,\n color,\n size: sizeProp = \"S\",\n rotate,\n children,\n ...others\n } = useDefaultProps(\"HvIconContainer\", props);\n const { cx, classes } = useClasses(classesProp);\n\n const size = mapSizes(sizeProp);\n\n return (\n <div\n ref={ref}\n className={cx(classes.root, className, {\n [classes[size!]]: size,\n })}\n style={mergeStyles(style, {\n color: getColor(color),\n rotate: rotate ? \"180deg\" : undefined,\n ...style,\n })}\n {...others}\n >\n {children}\n </div>\n );\n});\n\nfunction mapSizes(size: HvSize | HvIconSize | number) {\n if (typeof size === \"number\") return undefined;\n const iconSizeMap: Record<HvIconSize, HvSize> = {\n XS: \"xs\",\n S: \"sm\",\n M: \"md\",\n L: \"lg\",\n };\n return iconSizeMap[size as HvIconSize] || size;\n}\n"],"names":["HvIconContainer"],"mappings":";;;;AAYO,MAAM,EAAE,eAAe,eAAe,cAAc,mBAAmB;AAAA,EAC5E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA;AAAA,IACN,UAAU;AAAA;AAAA,IACV,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAY;AAAA,IACZ,SAAS;AAAA;AAAA;AAAA,EAEX;AAAA,EACA,IAAI;AAAA,IACF,UAAU;AAAA,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