@hitachivantara/uikit-react-core 5.46.2 → 5.47.1
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/ColorPicker/ColorPicker.cjs +3 -3
- package/dist/cjs/ColorPicker/ColorPicker.cjs.map +1 -1
- package/dist/cjs/DatePicker/DatePicker.cjs +5 -1
- package/dist/cjs/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/cjs/Dropdown/Dropdown.cjs +6 -0
- package/dist/cjs/Dropdown/Dropdown.cjs.map +1 -1
- package/dist/cjs/Dropdown/List/List.cjs.map +1 -1
- package/dist/cjs/Dropdown/utils.cjs.map +1 -1
- package/dist/cjs/FilterGroup/FilterContent/FilterContent.cjs.map +1 -1
- package/dist/cjs/FilterGroup/FilterGroup.cjs +7 -0
- package/dist/cjs/FilterGroup/FilterGroup.cjs.map +1 -1
- package/dist/cjs/Input/Input.cjs +5 -0
- package/dist/cjs/Input/Input.cjs.map +1 -1
- package/dist/cjs/Kpi/Kpi.cjs +12 -8
- package/dist/cjs/Kpi/Kpi.cjs.map +1 -1
- package/dist/cjs/ListContainer/ListItem/ListItem.cjs +27 -32
- package/dist/cjs/ListContainer/ListItem/ListItem.cjs.map +1 -1
- package/dist/cjs/Pagination/Pagination.cjs +14 -1
- package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
- package/dist/cjs/Panel/Panel.cjs +13 -11
- package/dist/cjs/Panel/Panel.cjs.map +1 -1
- package/dist/cjs/Section/Section.cjs +32 -20
- package/dist/cjs/Section/Section.cjs.map +1 -1
- package/dist/cjs/Section/Section.styles.cjs +13 -3
- package/dist/cjs/Section/Section.styles.cjs.map +1 -1
- package/dist/cjs/TableSection/TableSection.cjs +24 -0
- package/dist/cjs/TableSection/TableSection.cjs.map +1 -0
- package/dist/cjs/TableSection/TableSection.styles.cjs +81 -0
- package/dist/cjs/TableSection/TableSection.styles.cjs.map +1 -0
- package/dist/cjs/hooks/useLabels.cjs +1 -4
- package/dist/cjs/hooks/useLabels.cjs.map +1 -1
- package/dist/cjs/index.cjs +4 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/ColorPicker/ColorPicker.js +3 -3
- package/dist/esm/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/esm/DatePicker/DatePicker.js +5 -1
- package/dist/esm/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/Dropdown/Dropdown.js +6 -0
- package/dist/esm/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/Dropdown/List/List.js.map +1 -1
- package/dist/esm/Dropdown/utils.js.map +1 -1
- package/dist/esm/FilterGroup/FilterContent/FilterContent.js.map +1 -1
- package/dist/esm/FilterGroup/FilterGroup.js +7 -0
- package/dist/esm/FilterGroup/FilterGroup.js.map +1 -1
- package/dist/esm/Input/Input.js +5 -0
- package/dist/esm/Input/Input.js.map +1 -1
- package/dist/esm/Kpi/Kpi.js +12 -8
- package/dist/esm/Kpi/Kpi.js.map +1 -1
- package/dist/esm/ListContainer/ListItem/ListItem.js +27 -32
- package/dist/esm/ListContainer/ListItem/ListItem.js.map +1 -1
- package/dist/esm/Pagination/Pagination.js +14 -1
- package/dist/esm/Pagination/Pagination.js.map +1 -1
- package/dist/esm/Panel/Panel.js +13 -11
- package/dist/esm/Panel/Panel.js.map +1 -1
- package/dist/esm/Section/Section.js +32 -20
- package/dist/esm/Section/Section.js.map +1 -1
- package/dist/esm/Section/Section.styles.js +13 -3
- package/dist/esm/Section/Section.styles.js.map +1 -1
- package/dist/esm/TableSection/TableSection.js +25 -0
- package/dist/esm/TableSection/TableSection.js.map +1 -0
- package/dist/esm/TableSection/TableSection.styles.js +81 -0
- package/dist/esm/TableSection/TableSection.styles.js.map +1 -0
- package/dist/esm/hooks/useLabels.js +2 -3
- package/dist/esm/hooks/useLabels.js.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +161 -128
- package/package.json +2 -2
|
@@ -21,6 +21,7 @@ const HvSection = forwardRef(
|
|
|
21
21
|
actions,
|
|
22
22
|
onToggle,
|
|
23
23
|
expandButtonProps,
|
|
24
|
+
raisedHeader,
|
|
24
25
|
children,
|
|
25
26
|
...others
|
|
26
27
|
} = useDefaultProps("HvSection", props);
|
|
@@ -40,31 +41,42 @@ const HvSection = forwardRef(
|
|
|
40
41
|
className: cx(classes.root, className),
|
|
41
42
|
...others,
|
|
42
43
|
children: [
|
|
43
|
-
/* @__PURE__ */ jsxs(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
44
|
+
(title || actions || expandable) && /* @__PURE__ */ jsxs(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: cx(classes.header, {
|
|
48
|
+
[classes.raisedHeader]: raisedHeader && isOpen
|
|
49
|
+
}),
|
|
50
|
+
children: [
|
|
51
|
+
expandable && /* @__PURE__ */ jsx(
|
|
52
|
+
HvButton,
|
|
53
|
+
{
|
|
54
|
+
icon: true,
|
|
55
|
+
onClick: (event) => {
|
|
56
|
+
setIsOpen((o) => !o);
|
|
57
|
+
onToggle?.(event, !isOpen);
|
|
58
|
+
},
|
|
59
|
+
"aria-expanded": isOpen,
|
|
60
|
+
"aria-controls": contentId,
|
|
61
|
+
"aria-label": isOpen ? "Collapse" : "Expand",
|
|
62
|
+
...expandButtonProps,
|
|
63
|
+
children: isOpen ? /* @__PURE__ */ jsx(Up, {}) : /* @__PURE__ */ jsx(Down, {})
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
title,
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: classes.actions, children: actions })
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
),
|
|
62
71
|
/* @__PURE__ */ jsx(
|
|
63
72
|
"div",
|
|
64
73
|
{
|
|
65
74
|
id: contentId,
|
|
66
75
|
hidden: !isOpen,
|
|
67
|
-
className: cx(classes.content, {
|
|
76
|
+
className: cx(classes.content, {
|
|
77
|
+
[classes.hidden]: !showContent,
|
|
78
|
+
[classes.spaceTop]: !(title || actions || expandable)
|
|
79
|
+
}),
|
|
68
80
|
children
|
|
69
81
|
}
|
|
70
82
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.js","sources":["../../../src/Section/Section.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Down, Up } from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { HvButton, HvButtonProps } from \"../Button\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { setId } from \"../utils/setId\";\n\nimport { staticClasses, useClasses } from \"./Section.styles\";\n\nexport { staticClasses as sectionClasses };\n\nexport type HvSectionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvSectionProps\n extends Omit<HvBaseProps<HTMLDivElement>, \"title\"> {\n /** The title of the section */\n title?: React.ReactNode;\n /** Whether or not the section is expandable. */\n expandable?: boolean;\n /** Whether the section 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 /** Section actions */\n actions?: React.ReactNode;\n /** Section onExpand callback */\n onToggle?: (\n event: React.MouseEvent<HTMLButtonElement>,\n open: boolean\n ) => void;\n /** Props to be passed to the expand button */\n expandButtonProps?: HvButtonProps;\n /** A Jss Object used to override or extend the styles applied to the empty state component. */\n classes?: HvSectionClasses;\n}\n\n/**\n * Sections allow grouping information on a page under the same topic.\n */\nexport const HvSection = forwardRef<HTMLDivElement, HvSectionProps>(\n (props, ref) => {\n const {\n id,\n classes: classesProp,\n className,\n title,\n expandable,\n expanded,\n defaultExpanded = true,\n actions,\n onToggle,\n expandButtonProps,\n children,\n ...others\n } = useDefaultProps(\"HvSection\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const [isOpen, setIsOpen] = useControlled(\n expanded,\n Boolean(defaultExpanded)\n );\n\n const elementId = useUniqueId(id, \"hvSection\");\n const contentId = setId(elementId, \"content\");\n\n const showContent = expandable ? !!isOpen : true;\n\n return (\n <div\n ref={ref}\n id={elementId}\n className={cx(classes.root, className)}\n {...others}\n >\n <div
|
|
1
|
+
{"version":3,"file":"Section.js","sources":["../../../src/Section/Section.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { Down, Up } from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvBaseProps } from \"../types/generic\";\nimport { ExtractNames } from \"../utils/classes\";\nimport { HvButton, HvButtonProps } from \"../Button\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { setId } from \"../utils/setId\";\n\nimport { staticClasses, useClasses } from \"./Section.styles\";\n\nexport { staticClasses as sectionClasses };\n\nexport type HvSectionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvSectionProps\n extends Omit<HvBaseProps<HTMLDivElement>, \"title\"> {\n /** The title of the section */\n title?: React.ReactNode;\n /** Whether or not the section is expandable. */\n expandable?: boolean;\n /** Whether the section 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 /** Section actions */\n actions?: React.ReactNode;\n /** Section onExpand callback */\n onToggle?: (\n event: React.MouseEvent<HTMLButtonElement>,\n open: boolean\n ) => void;\n /** Props to be passed to the expand button */\n expandButtonProps?: HvButtonProps;\n /** Determines whether or not the header has a shadow on the bottom border. */\n raisedHeader?: boolean;\n /** A Jss Object used to override or extend the styles applied to the empty state component. */\n classes?: HvSectionClasses;\n}\n\n/**\n * Sections allow grouping information on a page under the same topic.\n */\nexport const HvSection = forwardRef<HTMLDivElement, HvSectionProps>(\n (props, ref) => {\n const {\n id,\n classes: classesProp,\n className,\n title,\n expandable,\n expanded,\n defaultExpanded = true,\n actions,\n onToggle,\n expandButtonProps,\n raisedHeader,\n children,\n ...others\n } = useDefaultProps(\"HvSection\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const [isOpen, setIsOpen] = useControlled(\n expanded,\n Boolean(defaultExpanded)\n );\n\n const elementId = useUniqueId(id, \"hvSection\");\n const contentId = setId(elementId, \"content\");\n\n const showContent = expandable ? !!isOpen : true;\n\n return (\n <div\n ref={ref}\n id={elementId}\n className={cx(classes.root, className)}\n {...others}\n >\n {(title || actions || expandable) && (\n <div\n className={cx(classes.header, {\n [classes.raisedHeader]: raisedHeader && isOpen,\n })}\n >\n {expandable && (\n <HvButton\n icon\n onClick={(event) => {\n setIsOpen((o) => !o);\n onToggle?.(event, !isOpen);\n }}\n aria-expanded={isOpen}\n aria-controls={contentId}\n aria-label={isOpen ? \"Collapse\" : \"Expand\"}\n {...expandButtonProps}\n >\n {isOpen ? <Up /> : <Down />}\n </HvButton>\n )}\n {title}\n <div className={classes.actions}>{actions}</div>\n </div>\n )}\n <div\n id={contentId}\n hidden={!isOpen}\n className={cx(classes.content, {\n [classes.hidden]: !showContent,\n [classes.spaceTop]: !(title || actions || expandable),\n })}\n >\n {children}\n </div>\n </div>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;;AA6CO,MAAM,YAAY;AAAA,EACvB,CAAC,OAAO,QAAQ;AACR,UAAA;AAAA,MACJ;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,kBAAkB;AAAA,MAClB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IAAA,IACD,gBAAgB,aAAa,KAAK;AAEtC,UAAM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,EAAE,SAAS,WAAW;AAAA,cAAA,CAC3C;AAAA,cAEA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;"}
|
|
@@ -5,7 +5,6 @@ const { staticClasses, useClasses } = createClasses("HvSection", {
|
|
|
5
5
|
width: "100%",
|
|
6
6
|
display: "flex",
|
|
7
7
|
flexDirection: "column",
|
|
8
|
-
padding: theme.space.sm,
|
|
9
8
|
backgroundColor: theme.colors.atmo1,
|
|
10
9
|
borderRadius: theme.radii.round,
|
|
11
10
|
border: `1px solid ${theme.colors.atmo4}`
|
|
@@ -15,16 +14,27 @@ const { staticClasses, useClasses } = createClasses("HvSection", {
|
|
|
15
14
|
display: "flex",
|
|
16
15
|
alignItems: "center",
|
|
17
16
|
position: "relative",
|
|
18
|
-
minHeight: theme.sizes.sm
|
|
17
|
+
minHeight: theme.sizes.sm,
|
|
18
|
+
padding: theme.space.sm
|
|
19
19
|
},
|
|
20
20
|
content: {
|
|
21
|
-
|
|
21
|
+
padding: theme.spacing(0, "sm", "sm", "sm")
|
|
22
|
+
},
|
|
23
|
+
spaceTop: {
|
|
24
|
+
paddingTop: theme.space.sm
|
|
22
25
|
},
|
|
23
26
|
actions: {
|
|
24
27
|
display: "flex",
|
|
25
28
|
gap: theme.space.xs,
|
|
26
29
|
position: "absolute",
|
|
27
30
|
right: 0
|
|
31
|
+
},
|
|
32
|
+
raisedHeader: {
|
|
33
|
+
zIndex: 1,
|
|
34
|
+
boxShadow: theme.colors.shadow,
|
|
35
|
+
"+ div": {
|
|
36
|
+
paddingTop: theme.space.sm
|
|
37
|
+
}
|
|
28
38
|
}
|
|
29
39
|
});
|
|
30
40
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.styles.js","sources":["../../../src/Section/Section.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvSection\", {\n root: {\n width: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n
|
|
1
|
+
{"version":3,"file":"Section.styles.js","sources":["../../../src/Section/Section.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvSection\", {\n root: {\n width: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n backgroundColor: theme.colors.atmo1,\n borderRadius: theme.radii.round,\n border: `1px solid ${theme.colors.atmo4}`,\n },\n hidden: { height: 0, display: \"none\" },\n header: {\n display: \"flex\",\n alignItems: \"center\",\n position: \"relative\",\n minHeight: theme.sizes.sm,\n padding: theme.space.sm,\n },\n content: {\n padding: theme.spacing(0, \"sm\", \"sm\", \"sm\"),\n },\n spaceTop: {\n paddingTop: theme.space.sm,\n },\n actions: {\n display: \"flex\",\n gap: theme.space.xs,\n position: \"absolute\",\n right: 0,\n },\n raisedHeader: {\n zIndex: 1,\n boxShadow: theme.colors.shadow,\n \"+ div\": {\n paddingTop: theme.space.sm,\n },\n },\n});\n"],"names":[],"mappings":";;AAIO,MAAM,EAAE,eAAe,eAAe,cAAc,aAAa;AAAA,EACtE,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,eAAe;AAAA,IACf,iBAAiB,MAAM,OAAO;AAAA,IAC9B,cAAc,MAAM,MAAM;AAAA,IAC1B,QAAQ,aAAa,MAAM,OAAO,KAAK;AAAA,EACzC;AAAA,EACA,QAAQ,EAAE,QAAQ,GAAG,SAAS,OAAO;AAAA,EACrC,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,WAAW,MAAM,MAAM;AAAA,IACvB,SAAS,MAAM,MAAM;AAAA,EACvB;AAAA,EACA,SAAS;AAAA,IACP,SAAS,MAAM,QAAQ,GAAG,MAAM,MAAM,IAAI;AAAA,EAC5C;AAAA,EACA,UAAU;AAAA,IACR,YAAY,MAAM,MAAM;AAAA,EAC1B;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,IACT,KAAK,MAAM,MAAM;AAAA,IACjB,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AAAA,EACA,cAAc;AAAA,IACZ,QAAQ;AAAA,IACR,WAAW,MAAM,OAAO;AAAA,IACxB,SAAS;AAAA,MACP,YAAY,MAAM,MAAM;AAAA,IAC1B;AAAA,EACF;AACF,CAAC;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useDefaultProps } from "../hooks/useDefaultProps.js";
|
|
4
|
+
import { useUniqueId } from "../hooks/useUniqueId.js";
|
|
5
|
+
import { useClasses } from "./TableSection.styles.js";
|
|
6
|
+
import { staticClasses } from "./TableSection.styles.js";
|
|
7
|
+
import { HvSection } from "../Section/Section.js";
|
|
8
|
+
const HvTableSection = forwardRef(
|
|
9
|
+
(props, ref) => {
|
|
10
|
+
const {
|
|
11
|
+
id,
|
|
12
|
+
classes: classesProp,
|
|
13
|
+
children,
|
|
14
|
+
...others
|
|
15
|
+
} = useDefaultProps("HvTableSection", props);
|
|
16
|
+
const { classes } = useClasses(classesProp);
|
|
17
|
+
const elementId = useUniqueId(id, "hvTableSection");
|
|
18
|
+
return /* @__PURE__ */ jsx(HvSection, { id: elementId, ref, classes, ...others, children });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
export {
|
|
22
|
+
HvTableSection,
|
|
23
|
+
staticClasses as tableSectionClasses
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=TableSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableSection.js","sources":["../../../src/TableSection/TableSection.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\n\nimport { ExtractNames } from \"../utils/classes\";\nimport { useDefaultProps } from \"../hooks/useDefaultProps\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { staticClasses, useClasses } from \"./TableSection.styles\";\nimport { HvSection, HvSectionProps } from \"../Section\";\n\nexport { staticClasses as tableSectionClasses };\n\nexport type HvTableSectionClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvTableSectionProps extends HvSectionProps {}\n\n/**\n * The `TableSection` component is a wrapper for the `Section` component that applies\n * specific stylings for tables that follow the latest DS specifications.\n */\nexport const HvTableSection = forwardRef<HTMLDivElement, HvTableSectionProps>(\n (props, ref) => {\n const {\n id,\n classes: classesProp,\n children,\n ...others\n } = useDefaultProps(\"HvTableSection\", props);\n\n const { classes } = useClasses(classesProp);\n const elementId = useUniqueId(id, \"hvTableSection\");\n\n return (\n <HvSection id={elementId} ref={ref} classes={classes} {...others}>\n {children}\n </HvSection>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;AAkBO,MAAM,iBAAiB;AAAA,EAC5B,CAAC,OAAO,QAAQ;AACR,UAAA;AAAA,MACJ;AAAA,MACA,SAAS;AAAA,MACT;AAAA,MACA,GAAG;AAAA,IAAA,IACD,gBAAgB,kBAAkB,KAAK;AAE3C,UAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AACpC,UAAA,YAAY,YAAY,IAAI,gBAAgB;AAGhD,WAAA,oBAAC,aAAU,IAAI,WAAW,KAAU,SAAmB,GAAG,QACvD,SACH,CAAA;AAAA,EAEJ;AACF;"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { theme } from "@hitachivantara/uikit-styles";
|
|
2
|
+
import { createClasses } from "../utils/classes.js";
|
|
3
|
+
import { staticClasses as staticClasses$1 } from "../Section/Section.styles.js";
|
|
4
|
+
import "../Section/Section.js";
|
|
5
|
+
import { staticClasses as staticClasses$2 } from "../Table/TableContainer/TableContainer.styles.js";
|
|
6
|
+
import "../Table/TableContainer/TableContainer.js";
|
|
7
|
+
import { staticClasses as staticClasses$3 } from "../Table/TableHeader/TableHeader.styles.js";
|
|
8
|
+
import "../Table/TableHeader/TableHeader.js";
|
|
9
|
+
import { staticClasses as staticClasses$4 } from "../Table/TableCell/TableCell.styles.js";
|
|
10
|
+
import "../Table/TableCell/TableCell.js";
|
|
11
|
+
import { staticClasses as staticClasses$5 } from "../BulkActions/BulkActions.styles.js";
|
|
12
|
+
import "@emotion/react/jsx-runtime";
|
|
13
|
+
import { staticClasses as staticClasses$6 } from "../Pagination/Pagination.styles.js";
|
|
14
|
+
import "react";
|
|
15
|
+
import "@mui/material/Hidden";
|
|
16
|
+
import "@hitachivantara/uikit-react-icons";
|
|
17
|
+
const { staticClasses, useClasses } = createClasses("HvTableSection", {
|
|
18
|
+
root: {
|
|
19
|
+
padding: 0
|
|
20
|
+
},
|
|
21
|
+
header: {
|
|
22
|
+
padding: theme.spacing("xs", "xs", "xs", "sm"),
|
|
23
|
+
borderBottom: `1px solid ${theme.colors.atmo3}`,
|
|
24
|
+
[`&.${staticClasses$1.raisedHeader}`]: {
|
|
25
|
+
"+ div": {
|
|
26
|
+
paddingTop: `0`
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
actions: {
|
|
31
|
+
right: theme.space.sm
|
|
32
|
+
},
|
|
33
|
+
content: {
|
|
34
|
+
marginTop: 0,
|
|
35
|
+
padding: 0,
|
|
36
|
+
[`&&`]: {
|
|
37
|
+
paddingTop: 0
|
|
38
|
+
},
|
|
39
|
+
[`& .${staticClasses$2.root}`]: {
|
|
40
|
+
paddingBottom: 0,
|
|
41
|
+
borderRadius: `${theme.radii.round} ${theme.radii.round} 0 0`
|
|
42
|
+
},
|
|
43
|
+
[`& .${staticClasses$3.head}`]: {
|
|
44
|
+
backgroundColor: theme.colors.atmo2,
|
|
45
|
+
borderBottomColor: theme.colors.atmo3,
|
|
46
|
+
[`&.${staticClasses$3.variantCheckbox}`]: {
|
|
47
|
+
borderRight: "none"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
[`& .${staticClasses$4.root}`]: {
|
|
51
|
+
borderBottomColor: theme.colors.atmo3
|
|
52
|
+
},
|
|
53
|
+
[`& .${staticClasses$4.variantCheckbox}`]: {
|
|
54
|
+
borderRight: "none"
|
|
55
|
+
},
|
|
56
|
+
[`& .${staticClasses$5.root}`]: {
|
|
57
|
+
marginBottom: 0,
|
|
58
|
+
border: "none",
|
|
59
|
+
borderBottom: `1px solid ${theme.colors.atmo3}`,
|
|
60
|
+
padding: theme.spacing("xs", "sm"),
|
|
61
|
+
borderRadius: `${theme.radii.round} ${theme.radii.round} 0 0`
|
|
62
|
+
},
|
|
63
|
+
[`& .${staticClasses$6.root}`]: {
|
|
64
|
+
margin: 0,
|
|
65
|
+
backgroundColor: theme.colors.atmo2,
|
|
66
|
+
padding: theme.space.xs,
|
|
67
|
+
borderRadius: `0 0 ${theme.radii.round} ${theme.radii.round}`
|
|
68
|
+
},
|
|
69
|
+
[`& .${staticClasses$6.pageSizeOptions}`]: {
|
|
70
|
+
left: theme.space.sm
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
hidden: {},
|
|
74
|
+
raisedHeader: {},
|
|
75
|
+
spaceTop: {}
|
|
76
|
+
});
|
|
77
|
+
export {
|
|
78
|
+
staticClasses,
|
|
79
|
+
useClasses
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=TableSection.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableSection.styles.js","sources":["../../../src/TableSection/TableSection.styles.tsx"],"sourcesContent":["import { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { bulkActionsClasses } from \"../BulkActions\";\nimport { paginationClasses } from \"../Pagination\";\nimport { sectionClasses } from \"../Section\";\n\nimport { tableCellClasses } from \"../Table/TableCell\";\nimport { tableContainerClasses } from \"../Table/TableContainer\";\nimport { tableHeaderClasses } from \"../Table/TableHeader\";\n\nimport { createClasses } from \"../utils/classes\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableSection\", {\n root: {\n padding: 0,\n },\n header: {\n padding: theme.spacing(\"xs\", \"xs\", \"xs\", \"sm\"),\n borderBottom: `1px solid ${theme.colors.atmo3}`,\n [`&.${sectionClasses.raisedHeader}`]: {\n \"+ div\": {\n paddingTop: `0`,\n },\n },\n },\n actions: {\n right: theme.space.sm,\n },\n content: {\n marginTop: 0,\n padding: 0,\n [`&&`]: {\n paddingTop: 0,\n },\n [`& .${tableContainerClasses.root}`]: {\n paddingBottom: 0,\n borderRadius: `${theme.radii.round} ${theme.radii.round} 0 0`,\n },\n [`& .${tableHeaderClasses.head}`]: {\n backgroundColor: theme.colors.atmo2,\n borderBottomColor: theme.colors.atmo3,\n [`&.${tableHeaderClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n },\n [`& .${tableCellClasses.root}`]: {\n borderBottomColor: theme.colors.atmo3,\n },\n [`& .${tableCellClasses.variantCheckbox}`]: {\n borderRight: \"none\",\n },\n [`& .${bulkActionsClasses.root}`]: {\n marginBottom: 0,\n border: \"none\",\n borderBottom: `1px solid ${theme.colors.atmo3}`,\n padding: theme.spacing(\"xs\", \"sm\"),\n borderRadius: `${theme.radii.round} ${theme.radii.round} 0 0`,\n },\n [`& .${paginationClasses.root}`]: {\n margin: 0,\n backgroundColor: theme.colors.atmo2,\n padding: theme.space.xs,\n borderRadius: `0 0 ${theme.radii.round} ${theme.radii.round}`,\n },\n [`& .${paginationClasses.pageSizeOptions}`]: {\n left: theme.space.sm,\n },\n },\n hidden: {},\n raisedHeader: {},\n spaceTop: {},\n});\n"],"names":["sectionClasses","tableContainerClasses","tableHeaderClasses","tableCellClasses","bulkActionsClasses","paginationClasses"],"mappings":";;;;;;;;;;;;;;;;AAYO,MAAM,EAAE,eAAe,eAAe,cAAc,kBAAkB;AAAA,EAC3E,MAAM;AAAA,IACJ,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,MAAM,QAAQ,MAAM,MAAM,MAAM,IAAI;AAAA,IAC7C,cAAc,aAAa,MAAM,OAAO,KAA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AAM,KAAK,IAAI,MAAM,MAAM,KAAK;AAAA,IAC7D;AAAA,IACA,CAAC,MAAMA,gBAAkB,eAAe,EAAE,GAAG;AAAA,MAC3C,MAAM,MAAM,MAAM;AAAA,IACpB;AAAA,EACF;AAAA,EACA,QAAQ,CAAC;AAAA,EACT,cAAc,CAAC;AAAA,EACf,UAAU,CAAC;AACb,CAAC;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useMemo } from "react";
|
|
2
2
|
function useLabels(defaultLabels, labels) {
|
|
3
|
-
|
|
3
|
+
return useMemo(() => {
|
|
4
4
|
return { ...defaultLabels, ...labels };
|
|
5
5
|
}, [defaultLabels, labels]);
|
|
6
|
-
return merged;
|
|
7
6
|
}
|
|
8
7
|
export {
|
|
9
8
|
useLabels
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLabels.js","sources":["../../../src/hooks/useLabels.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"useLabels.js","sources":["../../../src/hooks/useLabels.ts"],"sourcesContent":["import { useMemo } from \"react\";\n\nexport function useLabels<T>(defaultLabels: T, labels?: Partial<T>): T {\n return useMemo(() => {\n return { ...defaultLabels, ...labels };\n }, [defaultLabels, labels]);\n}\n"],"names":[],"mappings":";AAEgB,SAAA,UAAa,eAAkB,QAAwB;AACrE,SAAO,QAAQ,MAAM;AACnB,WAAO,EAAE,GAAG,eAAe,GAAG;EAAO,GACpC,CAAC,eAAe,MAAM,CAAC;AAC5B;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -300,6 +300,8 @@ import { HvVerticalNavigationTreeView } from "./VerticalNavigation/TreeView/Tree
|
|
|
300
300
|
import { staticClasses as staticClasses116 } from "./VerticalNavigation/TreeView/TreeViewItem.styles.js";
|
|
301
301
|
import { HvVerticalNavigationTreeViewItem } from "./VerticalNavigation/TreeView/TreeViewItem.js";
|
|
302
302
|
import { VerticalNavigationContext } from "./VerticalNavigation/VerticalNavigationContext.js";
|
|
303
|
+
import { staticClasses as staticClasses117 } from "./TableSection/TableSection.styles.js";
|
|
304
|
+
import { HvTableSection } from "./TableSection/TableSection.js";
|
|
303
305
|
import { EmotionContext, HvThemeContext, defaultCacheKey, defaultEmotionCache } from "@hitachivantara/uikit-react-shared";
|
|
304
306
|
export {
|
|
305
307
|
CellWithCheckBox,
|
|
@@ -421,6 +423,7 @@ export {
|
|
|
421
423
|
HvTableHead,
|
|
422
424
|
HvTableHeader,
|
|
423
425
|
HvTableRow,
|
|
426
|
+
HvTableSection,
|
|
424
427
|
HvTabs,
|
|
425
428
|
HvTag,
|
|
426
429
|
HvTagsInput,
|
|
@@ -608,6 +611,7 @@ export {
|
|
|
608
611
|
staticClasses96 as tableHeadClasses,
|
|
609
612
|
staticClasses97 as tableHeaderClasses,
|
|
610
613
|
staticClasses98 as tableRowClasses,
|
|
614
|
+
staticClasses117 as tableSectionClasses,
|
|
611
615
|
staticClasses100 as tabsClasses,
|
|
612
616
|
staticClasses101 as tagClasses,
|
|
613
617
|
staticClasses102 as tagsInputClasses,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|