@hitachivantara/uikit-react-core 5.77.0 → 5.79.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/Button/Button.cjs +24 -31
- package/dist/cjs/Button/Button.styles.cjs +38 -59
- package/dist/cjs/Footer/Footer.cjs +1 -1
- package/dist/cjs/Loading/Loading.styles.cjs +4 -2
- package/dist/cjs/MultiButton/MultiButton.cjs +12 -39
- package/dist/cjs/MultiButton/MultiButton.styles.cjs +25 -56
- package/dist/cjs/Select/Select.styles.cjs +1 -0
- package/dist/cjs/Switch/Switch.cjs +14 -1
- package/dist/cjs/Table/TableCell/TableCell.styles.cjs +3 -0
- package/dist/cjs/Table/TableHeader/TableHeader.styles.cjs +3 -0
- package/dist/cjs/Table/TableRow/TableRow.styles.cjs +1 -0
- package/dist/cjs/Table/hooks/useRowExpand.cjs +3 -3
- package/dist/cjs/Tooltip/Tooltip.styles.cjs +12 -6
- package/dist/cjs/index.cjs +0 -4
- package/dist/esm/Button/Button.js +26 -33
- package/dist/esm/Button/Button.js.map +1 -1
- package/dist/esm/Button/Button.styles.js +38 -59
- package/dist/esm/Button/Button.styles.js.map +1 -1
- package/dist/esm/DropDownMenu/DropDownMenu.js.map +1 -1
- package/dist/esm/Footer/Footer.js +1 -1
- package/dist/esm/Footer/Footer.js.map +1 -1
- package/dist/esm/Loading/Loading.styles.js +4 -2
- package/dist/esm/Loading/Loading.styles.js.map +1 -1
- package/dist/esm/MultiButton/MultiButton.js +15 -42
- package/dist/esm/MultiButton/MultiButton.js.map +1 -1
- package/dist/esm/MultiButton/MultiButton.styles.js +25 -56
- package/dist/esm/MultiButton/MultiButton.styles.js.map +1 -1
- package/dist/esm/Select/Select.styles.js +1 -0
- package/dist/esm/Select/Select.styles.js.map +1 -1
- package/dist/esm/Switch/Switch.js +14 -1
- package/dist/esm/Switch/Switch.js.map +1 -1
- package/dist/esm/Table/TableCell/TableCell.styles.js +3 -0
- package/dist/esm/Table/TableCell/TableCell.styles.js.map +1 -1
- package/dist/esm/Table/TableHeader/TableHeader.styles.js +3 -0
- package/dist/esm/Table/TableHeader/TableHeader.styles.js.map +1 -1
- package/dist/esm/Table/TableRow/TableRow.styles.js +1 -0
- package/dist/esm/Table/TableRow/TableRow.styles.js.map +1 -1
- package/dist/esm/Table/hooks/useRowExpand.js +4 -4
- package/dist/esm/Table/hooks/useRowExpand.js.map +1 -1
- package/dist/esm/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/Tooltip/Tooltip.styles.js +12 -6
- package/dist/esm/Tooltip/Tooltip.styles.js.map +1 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +39 -34
- package/package.json +6 -6
- package/dist/cjs/Button/types.cjs +0 -33
- package/dist/esm/Button/types.js +0 -33
- package/dist/esm/Button/types.js.map +0 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createClasses } from "@hitachivantara/uikit-react-utils";
|
|
2
2
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
3
|
-
import { getColoringStyle, getSizeStyles } from "../Button/Button.styles.js";
|
|
4
3
|
import { staticClasses as staticClasses$1 } from "../DropDownMenu/DropDownMenu.styles.js";
|
|
5
4
|
import "../DropDownMenu/DropDownMenu.js";
|
|
6
5
|
const { staticClasses, useClasses } = createClasses("HvMultiButton", {
|
|
@@ -96,44 +95,40 @@ const { staticClasses, useClasses } = createClasses("HvMultiButton", {
|
|
|
96
95
|
splitGroup: {
|
|
97
96
|
width: "fit-content",
|
|
98
97
|
background: theme.colors.atmo1,
|
|
99
|
-
//
|
|
100
|
-
"& button$button": {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
marginLeft: -1
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"&$lastButton": {
|
|
109
|
-
borderTopLeftRadius: 0,
|
|
110
|
-
borderBottomLeftRadius: 0
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
// Dropdown Menu
|
|
114
|
-
[`& .${staticClasses$1.root}`]: {
|
|
115
|
-
"&:has($firstButton)": {
|
|
116
|
-
"& + div$splitContainer": {
|
|
117
|
-
marginRight: -1
|
|
118
|
-
}
|
|
98
|
+
// HvButton, HvDropDownMenu
|
|
99
|
+
"& button$button:not($firstButton), & $button:not($firstButton) button": {
|
|
100
|
+
borderTopLeftRadius: 0,
|
|
101
|
+
borderBottomLeftRadius: 0,
|
|
102
|
+
"&:not([aria-controls])": {
|
|
103
|
+
borderLeftWidth: 0
|
|
119
104
|
}
|
|
120
105
|
},
|
|
121
|
-
|
|
122
|
-
|
|
106
|
+
// HvButton, HvDropDownMenu
|
|
107
|
+
"& button$button:not($lastButton), & $button:not($lastButton) button": {
|
|
123
108
|
borderTopRightRadius: 0,
|
|
124
|
-
borderBottomRightRadius: 0
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
109
|
+
borderBottomRightRadius: 0,
|
|
110
|
+
"&:not([aria-controls])": {
|
|
111
|
+
borderRightWidth: 0
|
|
112
|
+
},
|
|
113
|
+
"&::after": {
|
|
114
|
+
content: "''",
|
|
115
|
+
position: "absolute",
|
|
116
|
+
inset: "4px -1px 4px auto",
|
|
117
|
+
width: 1,
|
|
118
|
+
zIndex: 1,
|
|
119
|
+
height: "auto",
|
|
120
|
+
backgroundColor: "currentcolor"
|
|
121
|
+
}
|
|
130
122
|
},
|
|
123
|
+
// HvDropDownMenu
|
|
131
124
|
[`& .${staticClasses$1.iconSelected}`]: {
|
|
132
125
|
zIndex: 2
|
|
133
126
|
}
|
|
134
127
|
},
|
|
135
128
|
splitGroupDisabled: { background: theme.colors.atmo3 },
|
|
136
|
-
button: {
|
|
129
|
+
button: {
|
|
130
|
+
position: "relative"
|
|
131
|
+
},
|
|
137
132
|
selected: {},
|
|
138
133
|
vertical: {
|
|
139
134
|
flexDirection: "column",
|
|
@@ -195,23 +190,6 @@ const { staticClasses, useClasses } = createClasses("HvMultiButton", {
|
|
|
195
190
|
}
|
|
196
191
|
}
|
|
197
192
|
},
|
|
198
|
-
split: {
|
|
199
|
-
width: 1,
|
|
200
|
-
height: "100%",
|
|
201
|
-
background: "currentColor"
|
|
202
|
-
},
|
|
203
|
-
splitContainer: {
|
|
204
|
-
display: "flex",
|
|
205
|
-
justifyContent: "center",
|
|
206
|
-
zIndex: 1,
|
|
207
|
-
width: 2,
|
|
208
|
-
paddingTop: 4,
|
|
209
|
-
paddingBottom: 4,
|
|
210
|
-
height: "calc(32px - 2px)"
|
|
211
|
-
},
|
|
212
|
-
splitDisabled: {
|
|
213
|
-
color: theme.colors.secondary_60
|
|
214
|
-
},
|
|
215
193
|
firstButton: {},
|
|
216
194
|
lastButton: {},
|
|
217
195
|
// TODO - review the need for these classes in v6
|
|
@@ -222,16 +200,7 @@ const { staticClasses, useClasses } = createClasses("HvMultiButton", {
|
|
|
222
200
|
secondarySubtle: {},
|
|
223
201
|
secondaryGhost: {}
|
|
224
202
|
});
|
|
225
|
-
const getSplitContainerColor = (color, type, disabled) => ({
|
|
226
|
-
color: getColoringStyle(color, type).color,
|
|
227
|
-
backgroundColor: disabled ? theme.colors.atmo3 : type === "subtle" ? theme.colors.atmo1 : "transparent"
|
|
228
|
-
});
|
|
229
|
-
const getSplitContainerHeight = (size) => ({
|
|
230
|
-
height: `calc(${getSizeStyles(size).height} - 2px)`
|
|
231
|
-
});
|
|
232
203
|
export {
|
|
233
|
-
getSplitContainerColor,
|
|
234
|
-
getSplitContainerHeight,
|
|
235
204
|
staticClasses,
|
|
236
205
|
useClasses
|
|
237
206
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiButton.styles.js","sources":["../../../src/MultiButton/MultiButton.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { HvButtonSize } from \"../Button\";\nimport { getColoringStyle, getSizeStyles } from \"../Button/Button.styles\";\nimport { dropDownMenuClasses } from \"../DropDownMenu\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvMultiButton\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n transition: \"none\",\n position: \"relative\",\n zIndex: 0,\n },\n multiple: {\n background: theme.colors.atmo2,\n\n // prevent the focus ring to be hidden by sibling hover background\n \"&>.HvIsFocusVisible\": {\n zIndex: 5,\n },\n\n \"& button$button\": {\n minWidth: \"unset\",\n width: \"100%\",\n maxWidth: 200,\n padding: 0,\n transition: \"none\",\n flex: \"1 0 0px\",\n borderTop: `solid 1px ${theme.colors.atmo4}`,\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n borderLeft: \"solid 1px transparent\",\n borderRight: \"solid 1px transparent\",\n borderRadius: 0,\n fontWeight: theme.typography.body.fontWeight,\n fontSize: theme.typography.body.fontSize,\n \"&:disabled\": {\n color: theme.colors.secondary_60,\n borderTop: `solid 1px ${theme.colors.atmo4}`,\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n \"&:hover\": {\n borderTop: `solid 1px ${theme.colors.atmo4}`,\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n borderLeft: \"solid 1px transparent\",\n borderRight: \"solid 1px transparent\",\n },\n },\n \"&$firstButton\": {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n borderTopLeftRadius: theme.radii.base,\n borderBottomLeftRadius: theme.radii.base,\n \"&:disabled\": {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n \"&$lastButton\": {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n borderTopRightRadius: theme.radii.base,\n borderBottomRightRadius: theme.radii.base,\n \"&:disabled\": {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n \"&:disabled:hover\": {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n \"&:not($firstButton)\": {\n marginLeft: \"-1px\",\n },\n \"&$selected\": {\n background: theme.colors.atmo1,\n ...theme.typography.label,\n borderRadius: theme.radii.base,\n border: `solid 1px ${theme.colors.secondary}`,\n zIndex: 2,\n \"&:hover\": {\n background: theme.colors.atmo3,\n \"&:not(:disabled)\": {\n border: `solid 1px ${theme.colors.secondary}`,\n },\n \"&:disabled\": {\n border: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n // prevent the focus ring to be hidden by sibling hover background\n // even when selected\n \"&.HvIsFocusVisible\": {\n zIndex: 5,\n },\n \"&:disabled\": {\n zIndex: 1,\n color: theme.colors.secondary_60,\n background: theme.colors.atmo1,\n border: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n },\n },\n splitGroup: {\n width: \"fit-content\",\n background: theme.colors.atmo1,\n\n // Button\n \"& button$button\": {\n \"&$firstButton\": {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n \"& + div$splitContainer\": {\n marginLeft: -1,\n },\n },\n \"&$lastButton\": {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n },\n\n // Dropdown Menu\n [`& .${dropDownMenuClasses.root}`]: {\n \"&:has($firstButton)\": {\n \"& + div$splitContainer\": {\n marginRight: -1,\n },\n },\n },\n \"& $button$firstButton > button\": {\n marginRight: -1.5,\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n \"& $button$lastButton > button\": {\n marginLeft: -1.5,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n [`& .${dropDownMenuClasses.iconSelected}`]: {\n zIndex: 2,\n },\n },\n splitGroupDisabled: { background: theme.colors.atmo3 },\n button: {},\n selected: {},\n vertical: {\n flexDirection: \"column\",\n height: \"auto\",\n \"& button$button\": {\n minWidth: 32,\n width: \"100%\",\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n borderTop: \"solid 1px transparent\",\n borderBottom: \"solid 1px transparent\",\n \"&:disabled\": {\n color: theme.colors.secondary_60,\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n borderTop: \"solid 1px transparent\",\n borderBottom: \"solid 1px transparent\",\n \"&:hover\": {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n borderTop: \"solid 1px transparent\",\n borderBottom: \"solid 1px transparent\",\n },\n },\n \"&$firstButton\": {\n borderTop: `solid 1px ${theme.colors.atmo4}`,\n borderTopLeftRadius: theme.radii.base,\n borderTopRightRadius: theme.radii.base,\n },\n \"&$lastButton\": {\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n borderBottomLeftRadius: theme.radii.base,\n borderBottomRightRadius: theme.radii.base,\n \"&:disabled:hover\": {\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n \"&:not($firstButton)\": {\n marginLeft: 0,\n marginTop: -1,\n },\n \"&$selected\": {\n height: 32,\n width: `calc(100% + 2px) !important`,\n background: theme.colors.atmo1,\n ...theme.typography.label,\n borderRadius: theme.radii.base,\n border: `solid 1px ${theme.colors.secondary}`,\n zIndex: 2,\n \"&:hover, &:focus\": {\n background: theme.colors.atmo3,\n },\n \"&:disabled\": {\n zIndex: 1,\n color: theme.colors.secondary_60,\n background: theme.colors.atmo1,\n border: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n },\n },\n split: {\n width: 1,\n height: \"100%\",\n background: \"currentColor\",\n },\n splitContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n zIndex: 1,\n width: 2,\n paddingTop: 4,\n paddingBottom: 4,\n height: \"calc(32px - 2px)\",\n },\n splitDisabled: {\n color: theme.colors.secondary_60,\n },\n firstButton: {},\n lastButton: {},\n\n // TODO - review the need for these classes in v6\n primary: {},\n primarySubtle: {},\n primaryGhost: {},\n secondary: {},\n secondarySubtle: {},\n secondaryGhost: {},\n});\n\nexport const getSplitContainerColor = (\n color: string,\n type?: string,\n disabled?: boolean,\n) => ({\n color: getColoringStyle(color, type).color,\n backgroundColor: disabled\n ? theme.colors.atmo3\n : type === \"subtle\"\n ? theme.colors.atmo1\n : \"transparent\",\n});\n\nexport const getSplitContainerHeight = (size: HvButtonSize) => ({\n height: `calc(${getSizeStyles(size).height} - 2px)`,\n});\n"],"names":["dropDownMenuClasses"],"mappings":";;;;;AAOO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,YAAY,MAAM,OAAO;AAAA;AAAA,IAGzB,uBAAuB;AAAA,MACrB,QAAQ;AAAA,IACV;AAAA,IAEA,mBAAmB;AAAA,MACjB,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,WAAW,aAAa,MAAM,OAAO,KAAK;AAAA,MAC1C,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,MAC7C,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,cAAc;AAAA,MACd,YAAY,MAAM,WAAW,KAAK;AAAA,MAClC,UAAU,MAAM,WAAW,KAAK;AAAA,MAChC,cAAc;AAAA,QACZ,OAAO,MAAM,OAAO;AAAA,QACpB,WAAW,aAAa,MAAM,OAAO,KAAK;AAAA,QAC1C,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,QAC7C,WAAW;AAAA,UACT,WAAW,aAAa,MAAM,OAAO,KAAK;AAAA,UAC1C,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,UAC7C,YAAY;AAAA,UACZ,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,iBAAiB;AAAA,QACf,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,QAC3C,qBAAqB,MAAM,MAAM;AAAA,QACjC,wBAAwB,MAAM,MAAM;AAAA,QACpC,cAAc;AAAA,UACZ,YAAY,aAAa,MAAM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C;AAAA,EAClB,gBAAgB,CAAC;AACnB,CAAC;AAEM,MAAM,yBAAyB,CACpC,OACA,MACA,cACI;AAAA,EACJ,OAAO,iBAAiB,OAAO,IAAI,EAAE;AAAA,EACrC,iBAAiB,WACb,MAAM,OAAO,QACb,SAAS,WACP,MAAM,OAAO,QACb;AACR;AAEa,MAAA,0BAA0B,CAAC,UAAwB;AAAA,EAC9D,QAAQ,QAAQ,cAAc,IAAI,EAAE,MAAM;AAC5C;"}
|
|
1
|
+
{"version":3,"file":"MultiButton.styles.js","sources":["../../../src/MultiButton/MultiButton.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { dropDownMenuClasses } from \"../DropDownMenu\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvMultiButton\", {\n root: {\n display: \"flex\",\n alignItems: \"center\",\n transition: \"none\",\n position: \"relative\",\n zIndex: 0,\n },\n multiple: {\n background: theme.colors.atmo2,\n\n // prevent the focus ring to be hidden by sibling hover background\n \"&>.HvIsFocusVisible\": {\n zIndex: 5,\n },\n\n \"& button$button\": {\n minWidth: \"unset\",\n width: \"100%\",\n maxWidth: 200,\n padding: 0,\n transition: \"none\",\n flex: \"1 0 0px\",\n borderTop: `solid 1px ${theme.colors.atmo4}`,\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n borderLeft: \"solid 1px transparent\",\n borderRight: \"solid 1px transparent\",\n borderRadius: 0,\n fontWeight: theme.typography.body.fontWeight,\n fontSize: theme.typography.body.fontSize,\n \"&:disabled\": {\n color: theme.colors.secondary_60,\n borderTop: `solid 1px ${theme.colors.atmo4}`,\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n \"&:hover\": {\n borderTop: `solid 1px ${theme.colors.atmo4}`,\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n borderLeft: \"solid 1px transparent\",\n borderRight: \"solid 1px transparent\",\n },\n },\n \"&$firstButton\": {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n borderTopLeftRadius: theme.radii.base,\n borderBottomLeftRadius: theme.radii.base,\n \"&:disabled\": {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n \"&$lastButton\": {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n borderTopRightRadius: theme.radii.base,\n borderBottomRightRadius: theme.radii.base,\n \"&:disabled\": {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n \"&:disabled:hover\": {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n \"&:not($firstButton)\": {\n marginLeft: \"-1px\",\n },\n \"&$selected\": {\n background: theme.colors.atmo1,\n ...theme.typography.label,\n borderRadius: theme.radii.base,\n border: `solid 1px ${theme.colors.secondary}`,\n zIndex: 2,\n \"&:hover\": {\n background: theme.colors.atmo3,\n \"&:not(:disabled)\": {\n border: `solid 1px ${theme.colors.secondary}`,\n },\n \"&:disabled\": {\n border: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n // prevent the focus ring to be hidden by sibling hover background\n // even when selected\n \"&.HvIsFocusVisible\": {\n zIndex: 5,\n },\n \"&:disabled\": {\n zIndex: 1,\n color: theme.colors.secondary_60,\n background: theme.colors.atmo1,\n border: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n },\n },\n splitGroup: {\n width: \"fit-content\",\n background: theme.colors.atmo1,\n\n // HvButton, HvDropDownMenu\n \"& button$button:not($firstButton), & $button:not($firstButton) button\": {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n \"&:not([aria-controls])\": {\n borderLeftWidth: 0,\n },\n },\n // HvButton, HvDropDownMenu\n \"& button$button:not($lastButton), & $button:not($lastButton) button\": {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n \"&:not([aria-controls])\": {\n borderRightWidth: 0,\n },\n\n \"&::after\": {\n content: \"''\",\n position: \"absolute\",\n inset: \"4px -1px 4px auto\",\n width: 1,\n zIndex: 1,\n height: \"auto\",\n backgroundColor: \"currentcolor\",\n },\n },\n // HvDropDownMenu\n [`& .${dropDownMenuClasses.iconSelected}`]: {\n zIndex: 2,\n },\n },\n splitGroupDisabled: { background: theme.colors.atmo3 },\n button: {\n position: \"relative\",\n },\n selected: {},\n vertical: {\n flexDirection: \"column\",\n height: \"auto\",\n \"& button$button\": {\n minWidth: 32,\n width: \"100%\",\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n borderTop: \"solid 1px transparent\",\n borderBottom: \"solid 1px transparent\",\n \"&:disabled\": {\n color: theme.colors.secondary_60,\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n borderTop: \"solid 1px transparent\",\n borderBottom: \"solid 1px transparent\",\n \"&:hover\": {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n borderTop: \"solid 1px transparent\",\n borderBottom: \"solid 1px transparent\",\n },\n },\n \"&$firstButton\": {\n borderTop: `solid 1px ${theme.colors.atmo4}`,\n borderTopLeftRadius: theme.radii.base,\n borderTopRightRadius: theme.radii.base,\n },\n \"&$lastButton\": {\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n borderBottomLeftRadius: theme.radii.base,\n borderBottomRightRadius: theme.radii.base,\n \"&:disabled:hover\": {\n borderBottom: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n \"&:not($firstButton)\": {\n marginLeft: 0,\n marginTop: -1,\n },\n \"&$selected\": {\n height: 32,\n width: `calc(100% + 2px) !important`,\n background: theme.colors.atmo1,\n ...theme.typography.label,\n borderRadius: theme.radii.base,\n border: `solid 1px ${theme.colors.secondary}`,\n zIndex: 2,\n \"&:hover, &:focus\": {\n background: theme.colors.atmo3,\n },\n \"&:disabled\": {\n zIndex: 1,\n color: theme.colors.secondary_60,\n background: theme.colors.atmo1,\n border: `solid 1px ${theme.colors.atmo4}`,\n },\n },\n },\n },\n firstButton: {},\n lastButton: {},\n\n // TODO - review the need for these classes in v6\n primary: {},\n primarySubtle: {},\n primaryGhost: {},\n secondary: {},\n secondarySubtle: {},\n secondaryGhost: {},\n});\n"],"names":["dropDownMenuClasses"],"mappings":";;;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,YAAY,MAAM,OAAO;AAAA;AAAA,IAGzB,uBAAuB;AAAA,MACrB,QAAQ;AAAA,IACV;AAAA,IAEA,mBAAmB;AAAA,MACjB,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,MAAM;AAAA,MACN,WAAW,aAAa,MAAM,OAAO,KAAK;AAAA,MAC1C,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,MAC7C,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,cAAc;AAAA,MACd,YAAY,MAAM,WAAW,KAAK;AAAA,MAClC,UAAU,MAAM,WAAW,KAAK;AAAA,MAChC,cAAc;AAAA,QACZ,OAAO,MAAM,OAAO;AAAA,QACpB,WAAW,aAAa,MAAM,OAAO,KAAK;AAAA,QAC1C,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,QAC7C,WAAW;AAAA,UACT,WAAW,aAAa,MAAM,OAAO,KAAK;AAAA,UAC1C,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,UAC7C,YAAY;AAAA,UACZ,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,iBAAiB;AAAA,QACf,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,QAC3C,qBAAqB,MAAM,MAAM;AAAA,QACjC,wBAAwB,MAAM,MAAM;AAAA,QACpC,cAAc;AAAA,UACZ,YAAY,aAAa,MAAM,OAAO,KAA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AAM;AAAA,QACpC,yBAAyB,MAAM,MAAM;AAAA,QACrC,oBAAoB;AAAA,UAClB,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,QAC/C;AAAA,MACF;AAAA,MACA,uBAAuB;AAAA,QACrB,YAAY;AAAA,QACZ,WAAW;AAAA,MACb;AAAA,MACA,cAAc;AAAA,QACZ,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,YAAY,MAAM,OAAO;AAAA,QACzB,GAAG,MAAM,WAAW;AAAA,QACpB,cAAc,MAAM,MAAM;AAAA,QAC1B,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,QAC3C,QAAQ;AAAA,QACR,oBAAoB;AAAA,UAClB,YAAY,MAAM,OAAO;AAAA,QAC3B;AAAA,QACA,cAAc;AAAA,UACZ,QAAQ;AAAA,UACR,OAAO,MAAM,OAAO;AAAA,UACpB,YAAY,MAAM,OAAO;AAAA,UACzB,QAAQ,aAAa,MAAM,OAAO,KAAK;AAAA,QACzC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EACA,aAAa,CAAC;AAAA,EACd,YAAY,CAAC;AAAA;AAAA,EAGb,SAAS,CAAC;AAAA,EACV,eAAe,CAAC;AAAA,EAChB,cAAc,CAAC;AAAA,EACf,WAAW,CAAC;AAAA,EACZ,iBAAiB,CAAC;AAAA,EAClB,gBAAgB,CAAC;AACnB,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.styles.js","sources":["../../../src/Select/Select.styles.ts"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvSelect\", {\n root: {\n position: \"relative\",\n \"&$disabled,&$readOnly\": {\n pointerEvents: \"none\",\n },\n },\n disabled: {},\n readOnly: {},\n invalid: {\n border: `1px solid ${theme.colors.negative}`,\n },\n labelContainer: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n label: {\n display: \"block\",\n paddingBottom: 6,\n },\n description: {},\n select: {},\n popper: {\n zIndex: theme.zIndices.popover,\n },\n panel: {\n border: `1px solid ${theme.colors.secondary}`,\n marginTop: -1,\n marginBottom: -1,\n },\n panelOpenedUp: {\n borderRadius: `${theme.radii.base} ${theme.radii.base} 0 0`,\n },\n panelOpenedDown: {\n borderRadius: `0 0 ${theme.radii.base} ${theme.radii.base}`,\n },\n error: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,yBAAyB;AAAA,MACvB,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EACA,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,SAAS;AAAA,IACP,QAAQ,aAAa,MAAM,OAAO,QAAQ;AAAA,EAC5C;AAAA,EACA,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,EACd;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,eAAe;AAAA,EACjB;AAAA,EACA,aAAa,CAAC;AAAA,EACd,QAAQ,CAAC;AAAA,EACT,QAAQ;AAAA,IACN,QAAQ,MAAM,SAAS;AAAA,EACzB;AAAA,EACA,OAAO;AAAA,IACL,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,IAC3C,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AAAA,EACA,eAAe;AAAA,IACb,cAAc,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EACvD;AAAA,EACA,iBAAiB;AAAA,IACf,cAAc,OAAO,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EAC3D;AAAA,EACA,OAAO,CAAC;AACV,CAAC;"}
|
|
1
|
+
{"version":3,"file":"Select.styles.js","sources":["../../../src/Select/Select.styles.ts"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvSelect\", {\n root: {\n position: \"relative\",\n \"&$disabled,&$readOnly\": {\n pointerEvents: \"none\",\n },\n },\n disabled: {},\n readOnly: {},\n invalid: {\n border: `1px solid ${theme.colors.negative}`,\n },\n labelContainer: {\n display: \"flex\",\n alignItems: \"flex-start\",\n },\n label: {\n display: \"block\",\n paddingBottom: 6,\n },\n description: {},\n select: {},\n popper: {\n zIndex: theme.zIndices.popover,\n },\n panel: {\n maxHeight: 400,\n border: `1px solid ${theme.colors.secondary}`,\n marginTop: -1,\n marginBottom: -1,\n },\n panelOpenedUp: {\n borderRadius: `${theme.radii.base} ${theme.radii.base} 0 0`,\n },\n panelOpenedDown: {\n borderRadius: `0 0 ${theme.radii.base} ${theme.radii.base}`,\n },\n error: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,YAAY;AAAA,EACrE,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,yBAAyB;AAAA,MACvB,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EACA,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,SAAS;AAAA,IACP,QAAQ,aAAa,MAAM,OAAO,QAAQ;AAAA,EAC5C;AAAA,EACA,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,YAAY;AAAA,EACd;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,eAAe;AAAA,EACjB;AAAA,EACA,aAAa,CAAC;AAAA,EACd,QAAQ,CAAC;AAAA,EACT,QAAQ;AAAA,IACN,QAAQ,MAAM,SAAS;AAAA,EACzB;AAAA,EACA,OAAO;AAAA,IACL,WAAW;AAAA,IACX,QAAQ,aAAa,MAAM,OAAO,SAAS;AAAA,IAC3C,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AAAA,EACA,eAAe;AAAA,IACb,cAAc,GAAG,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EACvD;AAAA,EACA,iBAAiB;AAAA,IACf,cAAc,OAAO,MAAM,MAAM,IAAI,IAAI,MAAM,MAAM,IAAI;AAAA,EAC3D;AAAA,EACA,OAAO,CAAC;AACV,CAAC;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useCallback } from "react";
|
|
3
3
|
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
4
|
+
import { getColor } from "@hitachivantara/uikit-styles";
|
|
4
5
|
import { isInvalid } from "../Forms/FormElement/validationStates.js";
|
|
5
6
|
import { useControlled } from "../hooks/useControlled.js";
|
|
6
7
|
import { useUniqueId } from "../hooks/useUniqueId.js";
|
|
@@ -11,6 +12,7 @@ import { HvBaseSwitch } from "../BaseSwitch/BaseSwitch.js";
|
|
|
11
12
|
import { HvFormElement } from "../Forms/FormElement/FormElement.js";
|
|
12
13
|
import { HvLabel } from "../Forms/Label/Label.js";
|
|
13
14
|
import { HvWarningText } from "../Forms/WarningText/WarningText.js";
|
|
15
|
+
const isSemantical = (color) => ["positive", "negative", "warning"].includes(color);
|
|
14
16
|
const HvSwitch = forwardRef(
|
|
15
17
|
(props, ref) => {
|
|
16
18
|
const {
|
|
@@ -34,9 +36,10 @@ const HvSwitch = forwardRef(
|
|
|
34
36
|
statusMessage,
|
|
35
37
|
"aria-errormessage": ariaErrorMessage,
|
|
36
38
|
inputProps,
|
|
39
|
+
color,
|
|
37
40
|
...others
|
|
38
41
|
} = useDefaultProps("HvSwitch", props);
|
|
39
|
-
const { classes, cx } = useClasses(classesProp);
|
|
42
|
+
const { classes, cx, css } = useClasses(classesProp);
|
|
40
43
|
const elementId = useUniqueId(id);
|
|
41
44
|
const [isChecked, setIsChecked] = useControlled(
|
|
42
45
|
checked,
|
|
@@ -114,6 +117,16 @@ const HvSwitch = forwardRef(
|
|
|
114
117
|
"aria-describedby": ariaDescribedBy,
|
|
115
118
|
...inputProps
|
|
116
119
|
},
|
|
120
|
+
...color && {
|
|
121
|
+
classes: {
|
|
122
|
+
switchBase: css({
|
|
123
|
+
"&&&+.HvBaseSwitch-track,&&&.HvBaseSwitch-checked+.HvBaseSwitch-track": {
|
|
124
|
+
backgroundColor: getColor(color),
|
|
125
|
+
borderColor: isSemantical(color) ? getColor(`${color}_120`) : "#00000032"
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
},
|
|
117
130
|
...others
|
|
118
131
|
}
|
|
119
132
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","sources":["../../../src/Switch/Switch.tsx"],"sourcesContent":["import { forwardRef, useCallback } from \"react\";\nimport { SwitchProps as MuiSwitchProps } from \"@mui/material/Switch\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { HvBaseSwitch } from \"../BaseSwitch\";\nimport {\n HvFormElement,\n HvFormStatus,\n HvLabel,\n HvLabelProps,\n HvWarningText,\n} from \"../Forms\";\nimport { isInvalid } from \"../Forms/FormElement/validationStates\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Switch.styles\";\n\nexport { staticClasses as switchClasses };\n\nexport type HvSwitchClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvSwitchProps\n extends Omit<MuiSwitchProps, \"onChange\" | \"classes\"> {\n /**\n * A Jss Object used to override or extend the styles applied to the switch.\n */\n classes?: HvSwitchClasses;\n /**\n * The form element name.\n */\n name?: string;\n /**\n * The value of the form element.\n *\n * Is up to the application's logic when to consider the submission of this value.\n * Generally it should be used only when the switch is neither unchecked nor indeterminate.\n *\n * The default value is \"on\".\n */\n value?: any;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be inputted via inputProps.\n */\n label?: React.ReactNode;\n /**\n * Properties passed on to the label element.\n */\n labelProps?: HvLabelProps;\n /**\n * Indicates that the form element is disabled.\n */\n disabled?: boolean;\n /**\n * Indicates that the form element is not editable.\n */\n readOnly?: boolean;\n /**\n * Indicates that user input is required on the form element.\n */\n required?: boolean;\n /**\n * If `true` the switch is selected, if set to `false` the switch is not selected.\n *\n * When defined the switch state becomes controlled.\n */\n checked?: boolean;\n /**\n * When uncontrolled, defines the initial checked state.\n */\n defaultChecked?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to `checked`, depending of the values of both `required` and `checked`.\n */\n status?: HvFormStatus;\n /**\n * The error message to show when the validation status is \"invalid\".\n *\n * Defaults to \"Required\" when the status is uncontrolled and no `aria-errormessage` is provided.\n */\n statusMessage?: string;\n /**\n * Identifies the element that provides an error message for the switch.\n *\n * Will only be used when the validation status is invalid.\n */\n \"aria-errormessage\"?: string;\n /**\n * The callback fired when the switch is pressed.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement>,\n checked: boolean,\n value: any,\n ) => void;\n /**\n * Properties passed on to the input element.\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** @ignore */\n ref?: MuiSwitchProps[\"ref\"];\n /** @ignore */\n component?: MuiSwitchProps[\"component\"];\n}\n\n/**\n * A Switch is <b>binary</b> and work as a digital on/off button.\n *\n * Use when two states are <b>opposite</b> and to trigger immediate\n * changes in the system.\n */\nexport const HvSwitch = forwardRef<HTMLButtonElement, HvSwitchProps>(\n (props, ref) => {\n const {\n classes: classesProp,\n className,\n\n id,\n name,\n value = \"on\",\n required = false,\n readOnly = false,\n disabled = false,\n\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n labelProps,\n\n checked,\n defaultChecked = false,\n\n onChange,\n\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n\n inputProps,\n\n ...others\n } = useDefaultProps(\"HvSwitch\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const elementId = useUniqueId(id);\n\n const [isChecked, setIsChecked] = useControlled(\n checked,\n Boolean(defaultChecked),\n );\n\n const [validationState, setValidationState] = useControlled<HvFormStatus>(\n status,\n \"standBy\",\n );\n\n const [validationMessage] = useControlled(statusMessage, \"Required\");\n\n const onLocalChange = useCallback(\n (evt: React.ChangeEvent<HTMLInputElement>, newChecked: boolean) => {\n setIsChecked(() => {\n // this will only run if uncontrolled\n if (required && !newChecked) {\n setValidationState(\"invalid\");\n } else {\n setValidationState(\"valid\");\n }\n\n return newChecked;\n });\n\n onChange?.(evt, newChecked, value);\n },\n [onChange, required, setIsChecked, setValidationState, value],\n );\n\n // the error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and required is true\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined && required));\n\n const isStateInvalid = isInvalid(validationState);\n\n let errorMessageId: string | undefined;\n if (isStateInvalid) {\n errorMessageId = canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage;\n }\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={cx(classes.root, className)}\n >\n {label && (\n <HvLabel\n id={setId(elementId, \"label\")}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n className={classes.label}\n {...labelProps}\n />\n )}\n <div\n className={cx(classes.switchContainer, {\n [classes.invalidSwitch]: isStateInvalid,\n })}\n >\n <HvBaseSwitch\n ref={ref}\n id={label ? setId(elementId, \"input\") : setId(id, \"input\")}\n name={name}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n onChange={onLocalChange}\n value={value}\n checked={isChecked}\n inputProps={{\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...inputProps,\n }}\n {...others}\n />\n </div>\n {canShowError && (\n <HvWarningText\n id={setId(elementId, \"error\")}\n className={classes.error}\n disableBorder\n disableAdornment\n hideText\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;AA0HO,MAAM,WAAW;AAAA,EACtB,CAAC,OAAO,QAAQ;AACR,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MAEA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MAEX;AAAA,MACA,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB;AAAA,MAEA;AAAA,MACA,iBAAiB;AAAA,MAEjB;AAAA,MAEA;AAAA,MACA;AAAA,MACA,qBAAqB;AAAA,MAErB;AAAA,MAEA,GAAG;AAAA,IAAA,IACD,gBAAgB,YAAY,KAAK;AAErC,UAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAExC,UAAA,YAAY,YAAY,EAAE;AAE1B,UAAA,CAAC,WAAW,YAAY,IAAI;AAAA,MAChC;AAAA,MACA,QAAQ,cAAc;AAAA,IAAA;AAGlB,UAAA,CAAC,iBAAiB,kBAAkB,IAAI;AAAA,MAC5C;AAAA,MACA;AAAA,IAAA;AAGF,UAAM,CAAC,iBAAiB,IAAI,cAAc,eAAe,UAAU;AAEnE,UAAM,gBAAgB;AAAA,MACpB,CAAC,KAA0C,eAAwB;AACjE,qBAAa,MAAM;AAEb,cAAA,YAAY,CAAC,YAAY;AAC3B,+BAAmB,SAAS;AAAA,UAAA,OACvB;AACL,+BAAmB,OAAO;AAAA,UAC5B;AAEO,iBAAA;AAAA,QAAA,CACR;AAEU,mBAAA,KAAK,YAAY,K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;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI,MAAM,WAAW,OAAO;AAAA,cAC5B,WAAW,QAAQ;AAAA,cACnB,eAAa;AAAA,cACb,kBAAgB;AAAA,cAChB,UAAQ;AAAA,cAEP,UAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
|
|
1
|
+
{"version":3,"file":"Switch.js","sources":["../../../src/Switch/Switch.tsx"],"sourcesContent":["import { forwardRef, useCallback } from \"react\";\nimport { SwitchProps as MuiSwitchProps } from \"@mui/material/Switch\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { getColor, HvColorAny } from \"@hitachivantara/uikit-styles\";\n\nimport { HvBaseSwitch } from \"../BaseSwitch\";\nimport {\n HvFormElement,\n HvFormStatus,\n HvLabel,\n HvLabelProps,\n HvWarningText,\n} from \"../Forms\";\nimport { isInvalid } from \"../Forms/FormElement/validationStates\";\nimport { useControlled } from \"../hooks/useControlled\";\nimport { useUniqueId } from \"../hooks/useUniqueId\";\nimport { setId } from \"../utils/setId\";\nimport { staticClasses, useClasses } from \"./Switch.styles\";\n\nexport { staticClasses as switchClasses };\n\nexport type HvSwitchClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvSwitchProps\n extends Omit<MuiSwitchProps, \"color\" | \"onChange\" | \"classes\"> {\n /**\n * A Jss Object used to override or extend the styles applied to the switch.\n */\n classes?: HvSwitchClasses;\n /**\n * The form element name.\n */\n name?: string;\n /**\n * The value of the form element.\n *\n * Is up to the application's logic when to consider the submission of this value.\n * Generally it should be used only when the switch is neither unchecked nor indeterminate.\n *\n * The default value is \"on\".\n */\n value?: any;\n /**\n * The label of the form element.\n *\n * The form element must be labeled for accessibility reasons.\n * If not provided, an aria-label or aria-labelledby must be inputted via inputProps.\n */\n label?: React.ReactNode;\n /**\n * Properties passed on to the label element.\n */\n labelProps?: HvLabelProps;\n /**\n * Indicates that the form element is disabled.\n */\n disabled?: boolean;\n /**\n * Indicates that the form element is not editable.\n */\n readOnly?: boolean;\n /**\n * Indicates that user input is required on the form element.\n */\n required?: boolean;\n /**\n * If `true` the switch is selected, if set to `false` the switch is not selected.\n *\n * When defined the switch state becomes controlled.\n */\n checked?: boolean;\n /**\n * When uncontrolled, defines the initial checked state.\n */\n defaultChecked?: boolean;\n /**\n * The status of the form element.\n *\n * Valid is correct, invalid is incorrect and standBy means no validations have run.\n *\n * When uncontrolled and unspecified it will default to \"standBy\" and change to either \"valid\"\n * or \"invalid\" after any change to `checked`, depending of the values of both `required` and `checked`.\n */\n status?: HvFormStatus;\n /**\n * The error message to show when the validation status is \"invalid\".\n *\n * Defaults to \"Required\" when the status is uncontrolled and no `aria-errormessage` is provided.\n */\n statusMessage?: string;\n /**\n * Identifies the element that provides an error message for the switch.\n *\n * Will only be used when the validation status is invalid.\n */\n \"aria-errormessage\"?: string;\n /**\n * The callback fired when the switch is pressed.\n */\n onChange?: (\n event: React.ChangeEvent<HTMLInputElement>,\n checked: boolean,\n value: any,\n ) => void;\n /**\n * Properties passed on to the input element.\n */\n inputProps?: React.InputHTMLAttributes<HTMLInputElement>;\n /** @ignore */\n ref?: MuiSwitchProps[\"ref\"];\n /** @ignore */\n component?: MuiSwitchProps[\"component\"];\n /** Color applied to the switch. */\n color?: HvColorAny;\n}\n\nconst isSemantical = (color: HvColorAny) =>\n [\"positive\", \"negative\", \"warning\"].includes(color);\n\n/**\n * A Switch is <b>binary</b> and work as a digital on/off button.\n *\n * Use when two states are <b>opposite</b> and to trigger immediate\n * changes in the system.\n */\nexport const HvSwitch = forwardRef<HTMLButtonElement, HvSwitchProps>(\n (props, ref) => {\n const {\n classes: classesProp,\n className,\n\n id,\n name,\n value = \"on\",\n required = false,\n readOnly = false,\n disabled = false,\n\n label,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n labelProps,\n\n checked,\n defaultChecked = false,\n\n onChange,\n\n status,\n statusMessage,\n \"aria-errormessage\": ariaErrorMessage,\n\n inputProps,\n\n color,\n\n ...others\n } = useDefaultProps(\"HvSwitch\", props);\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const elementId = useUniqueId(id);\n\n const [isChecked, setIsChecked] = useControlled(\n checked,\n Boolean(defaultChecked),\n );\n\n const [validationState, setValidationState] = useControlled<HvFormStatus>(\n status,\n \"standBy\",\n );\n\n const [validationMessage] = useControlled(statusMessage, \"Required\");\n\n const onLocalChange = useCallback(\n (evt: React.ChangeEvent<HTMLInputElement>, newChecked: boolean) => {\n setIsChecked(() => {\n // this will only run if uncontrolled\n if (required && !newChecked) {\n setValidationState(\"invalid\");\n } else {\n setValidationState(\"valid\");\n }\n\n return newChecked;\n });\n\n onChange?.(evt, newChecked, value);\n },\n [onChange, required, setIsChecked, setValidationState, value],\n );\n\n // the error message area will only be created if:\n // - an external element that provides an error message isn't identified via aria-errormessage AND\n // - both status and statusMessage properties are being controlled OR\n // - status is uncontrolled and required is true\n const canShowError =\n ariaErrorMessage == null &&\n ((status !== undefined && statusMessage !== undefined) ||\n (status === undefined && required));\n\n const isStateInvalid = isInvalid(validationState);\n\n let errorMessageId: string | undefined;\n if (isStateInvalid) {\n errorMessageId = canShowError\n ? setId(elementId, \"error\")\n : ariaErrorMessage;\n }\n\n return (\n <HvFormElement\n id={id}\n name={name}\n status={validationState}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n className={cx(classes.root, className)}\n >\n {label && (\n <HvLabel\n id={setId(elementId, \"label\")}\n htmlFor={setId(elementId, \"input\")}\n label={label}\n className={classes.label}\n {...labelProps}\n />\n )}\n <div\n className={cx(classes.switchContainer, {\n [classes.invalidSwitch]: isStateInvalid,\n })}\n >\n <HvBaseSwitch\n ref={ref}\n id={label ? setId(elementId, \"input\") : setId(id, \"input\")}\n name={name}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n onChange={onLocalChange}\n value={value}\n checked={isChecked}\n inputProps={{\n \"aria-invalid\": isStateInvalid ? true : undefined,\n \"aria-errormessage\": errorMessageId,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...inputProps,\n }}\n {...(color && {\n classes: {\n switchBase: css({\n \"&&&+.HvBaseSwitch-track,&&&.HvBaseSwitch-checked+.HvBaseSwitch-track\":\n {\n backgroundColor: getColor(color),\n borderColor: isSemantical(color)\n ? getColor(`${color}_120`)\n : \"#00000032\",\n },\n }),\n },\n })}\n {...others}\n />\n </div>\n {canShowError && (\n <HvWarningText\n id={setId(elementId, \"error\")}\n className={classes.error}\n disableBorder\n disableAdornment\n hideText\n >\n {validationMessage}\n </HvWarningText>\n )}\n </HvFormElement>\n );\n },\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuHA,MAAM,eAAe,CAAC,UACpB,CAAC,YAAY,YAAY,SAAS,EAAE,SAAS,KAAK;AAQ7C,MAAM,WAAW;AAAA,EACtB,CAAC,OAAO,QAAQ;AACR,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MAEA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MAEX;AAAA,MACA,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,oBAAoB;AAAA,MACpB;AAAA,MAEA;AAAA,MACA,iBAAiB;AAAA,MAEjB;AAAA,MAEA;AAAA,MACA;AAAA,MACA,qBAAqB;AAAA,MAErB;AAAA,MAEA;AAAA,MAEA,GAAG;AAAA,IAAA,IACD,gBAAgB,YAAY,KAAK;AAErC,UAAM,EAAE,SAAS,IAAI,IAAI,IAAI,WAAW,WAAW;AAE7C,UAAA,YAAY,YAAY,EAAE;AAE1B,UAAA,CAAC,WAAW,YAAY,IAAI;AAAA,MAChC;AAAA,MACA,QAAQ,cAAc;AAAA,IAAA;AAGlB,UAAA,CAAC,iBAAiB,kBAAkB,IAAI;AAAA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kBACA;AAAA,kBACA;AAAA,kBACA,UAAU;AAAA,kBACV;AAAA,kBACA,SAAS;AAAA,kBACT,YAAY;AAAA,oBACV,gBAAgB,iBAAiB,OAAO;AAAA,oBACxC,qBAAqB;AAAA,oBACrB,cAAc;AAAA,oBACd,mBAAmB;AAAA,oBACnB,oBAAoB;AAAA,oBACpB,GAAG;AAAA,kBACL;AAAA,kBACC,GAAI,SAAS;AAAA,oBACZ,SAAS;AAAA,sBACP,YAAY,IAAI;AAAA,wBACd,wEACE;AAAA,0BACE,iBAAiB,SAAS,KAAK;AAAA,0BAC/B,aAAa,aAAa,KAAK,IAC3B,SAAS,GAAG,KAAK,MAAM,IACvB;AAAA,wBACN;AAAA,sBAAA,CACH;AAAA,oBACH;AAAA,kBACF;AAAA,kBACC,GAAG;AAAA,gBAAA;AAAA,cACN;AAAA,YAAA;AAAA,UACF;AAAA,UACC,gBACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI,MAAM,WAAW,OAAO;AAAA,cAC5B,WAAW,QAAQ;AAAA,cACnB,eAAa;AAAA,cACb,kBAAgB;AAAA,cAChB,UAAQ;AAAA,cAEP,UAAA;AAAA,YAAA;AAAA,UACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;"}
|
|
@@ -5,6 +5,7 @@ const { staticClasses, useClasses } = createClasses("HvTableCell", {
|
|
|
5
5
|
/** Styles applied to the component root class. */
|
|
6
6
|
root: {
|
|
7
7
|
verticalAlign: "inherit",
|
|
8
|
+
alignContent: "inherit",
|
|
8
9
|
textAlign: "left",
|
|
9
10
|
padding: `calc(${theme.space.xs} - 2px ) ${theme.space.xs} calc(${theme.space.xs} - 3px ) ${theme.spacing(4)}`,
|
|
10
11
|
borderBottom: `1px solid ${theme.colors.atmo4}`
|
|
@@ -13,6 +14,7 @@ const { staticClasses, useClasses } = createClasses("HvTableCell", {
|
|
|
13
14
|
head: {
|
|
14
15
|
height: 52,
|
|
15
16
|
verticalAlign: "top",
|
|
17
|
+
alignContent: "start",
|
|
16
18
|
backgroundColor: theme.colors.atmo1,
|
|
17
19
|
borderTop: "1px solid transparent",
|
|
18
20
|
borderBottom: `1px solid ${theme.colors.atmo4}`,
|
|
@@ -97,6 +99,7 @@ const { staticClasses, useClasses } = createClasses("HvTableCell", {
|
|
|
97
99
|
/** Styles applied to the cell when its variant is list and actions. */
|
|
98
100
|
variantListactions: {
|
|
99
101
|
verticalAlign: "middle",
|
|
102
|
+
alignContent: "center",
|
|
100
103
|
borderLeft: "none",
|
|
101
104
|
paddingLeft: "0",
|
|
102
105
|
textAlign: "center",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableCell.styles.js","sources":["../../../../src/Table/TableCell/TableCell.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nconst sortedColor = theme.alpha(\"primary\", 0.1);\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableCell\", {\n /** Styles applied to the component root class. */\n root: {\n verticalAlign: \"inherit\",\n textAlign: \"left\",\n padding: `calc(${theme.space.xs} - 2px ) ${theme.space.xs} calc(${\n theme.space.xs\n } - 3px ) ${theme.spacing(4)}`,\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n },\n /** Styles applied to the cell when it's in the table head. */\n head: {\n height: 52,\n verticalAlign: \"top\",\n\n backgroundColor: theme.colors.atmo1,\n borderTop: \"1px solid transparent\",\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n ...(theme.typography.label as React.CSSProperties),\n },\n /** Styles applied to the cell when it's in the table body. */\n body: {\n minHeight: 32,\n \"td&\": {\n height: 32,\n },\n backgroundColor: \"inherit\",\n ...(theme.typography.body as React.CSSProperties),\n fontFamily: theme.fontFamily.body,\n\n \"&$sorted\": {\n backgroundImage: `linear-gradient(to right, ${sortedColor}, ${sortedColor})`,\n },\n },\n /** Styles applied to the cell when it's in the table footer. */\n footer: {},\n /** Styles applied to the cell when it's part of a sorted column. */\n sorted: {},\n /** Styles applied to the component root when it is left aligned */\n alignLeft: {\n textAlign: \"left\",\n },\n /** Styles applied to the component root when it is center aligned */\n alignCenter: {\n textAlign: \"center\",\n },\n /** Styles applied to the component root when it is right aligned */\n alignRight: {\n textAlign: \"right\",\n flexDirection: \"row-reverse\",\n },\n /** Styles applied to the component root when it is justified */\n alignJustify: {\n textAlign: \"justify\",\n },\n\n /** Styles applied to the component root when its variant is none */\n variantNone: {\n padding: 0,\n },\n /** Styles applied to the component root when its variant is checkbox */\n variantCheckbox: {\n boxSizing: \"content-box\",\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n /** Styles applied to the component root when its variant is actions */\n variantActions: {\n boxSizing: \"content-box\",\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n /** Styles applied to the component root when its variant is expand */\n variantExpand: {\n paddingLeft: 0,\n paddingTop: 0,\n paddingBottom: 0,\n },\n /** Styles applied to the component root when its variant is list */\n variantList: {\n minHeight: 52,\n \"td&\": {\n height: 52,\n },\n padding: \"0, 0, 0, 32px\",\n border: 0,\n },\n /** Styles applied to the cell when its variant is list and the type is head. */\n variantListHead: {\n backgroundColor: \"inherit\",\n \"td&\": {\n height: 16,\n },\n },\n /** Styles applied to the cell when its variant is list and actions. */\n variantListactions: {\n verticalAlign: \"middle\",\n borderLeft: \"none\",\n paddingLeft: \"0\",\n textAlign: \"center\",\n width: 130,\n maxWidth: 130,\n },\n /** Styles applied to the cell when its variant is list and checkbox. */\n variantListcheckbox: {\n borderRight: \"none\",\n padding: 0,\n textAlign: \"center\",\n width: 34,\n maxWidth: 34,\n },\n /** Styles applied to the cell when it's part of a sticky column. */\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n backgroundColor: theme.colors.atmo2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n },\n /** Styles applied to the cell when it's part of the last sticky to the left column. */\n stickyColumnMostLeft: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n /** Styles applied to the cell when it's part of the first right sticky column. */\n stickyColumnLeastRight: {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n\n /** Styles applied to the cell when it's part of the first column in the group. */\n groupColumnMostLeft: {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n\n \"&:first-of-type\": {\n borderLeft: 0,\n },\n },\n /** Styles applied to the cell when it's part of the last column in the group. */\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n\n /** Styles applied to the cell when it's part of a resizable column. */\n resizable: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n /** Styles applied to the cell when it's part of a resizing column. */\n resizing: {\n borderRight: `solid 2px ${theme.colors.secondary}`,\n },\n});\n"],"names":[],"mappings":";;AAGA,MAAM,cAAc,MAAM,MAAM,WAAW,GAAG;AAEvC,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA;AAAA,EAExE,MAAM;AAAA,IACJ,eAAe;AAAA,IACf,WAAW;AAAA,IACX,SAAS,QAAQ,MAAM,MAAM,EAAE,YAAY,MAAM,MAAM,EAAE,SACvD,MAAM,MAAM,EACd,YAAY,MAAM,QAAQ,CAAC,CAAC;AAAA,IAC5B,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,EAC/C;AAAA;AAAA,EAEA,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,eAAe;AAAA,
|
|
1
|
+
{"version":3,"file":"TableCell.styles.js","sources":["../../../../src/Table/TableCell/TableCell.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nconst sortedColor = theme.alpha(\"primary\", 0.1);\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableCell\", {\n /** Styles applied to the component root class. */\n root: {\n verticalAlign: \"inherit\",\n alignContent: \"inherit\",\n textAlign: \"left\",\n padding: `calc(${theme.space.xs} - 2px ) ${theme.space.xs} calc(${\n theme.space.xs\n } - 3px ) ${theme.spacing(4)}`,\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n },\n /** Styles applied to the cell when it's in the table head. */\n head: {\n height: 52,\n verticalAlign: \"top\",\n alignContent: \"start\",\n\n backgroundColor: theme.colors.atmo1,\n borderTop: \"1px solid transparent\",\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n ...(theme.typography.label as React.CSSProperties),\n },\n /** Styles applied to the cell when it's in the table body. */\n body: {\n minHeight: 32,\n \"td&\": {\n height: 32,\n },\n backgroundColor: \"inherit\",\n ...(theme.typography.body as React.CSSProperties),\n fontFamily: theme.fontFamily.body,\n\n \"&$sorted\": {\n backgroundImage: `linear-gradient(to right, ${sortedColor}, ${sortedColor})`,\n },\n },\n /** Styles applied to the cell when it's in the table footer. */\n footer: {},\n /** Styles applied to the cell when it's part of a sorted column. */\n sorted: {},\n /** Styles applied to the component root when it is left aligned */\n alignLeft: {\n textAlign: \"left\",\n },\n /** Styles applied to the component root when it is center aligned */\n alignCenter: {\n textAlign: \"center\",\n },\n /** Styles applied to the component root when it is right aligned */\n alignRight: {\n textAlign: \"right\",\n flexDirection: \"row-reverse\",\n },\n /** Styles applied to the component root when it is justified */\n alignJustify: {\n textAlign: \"justify\",\n },\n\n /** Styles applied to the component root when its variant is none */\n variantNone: {\n padding: 0,\n },\n /** Styles applied to the component root when its variant is checkbox */\n variantCheckbox: {\n boxSizing: \"content-box\",\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n /** Styles applied to the component root when its variant is actions */\n variantActions: {\n boxSizing: \"content-box\",\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n /** Styles applied to the component root when its variant is expand */\n variantExpand: {\n paddingLeft: 0,\n paddingTop: 0,\n paddingBottom: 0,\n },\n /** Styles applied to the component root when its variant is list */\n variantList: {\n minHeight: 52,\n \"td&\": {\n height: 52,\n },\n padding: \"0, 0, 0, 32px\",\n border: 0,\n },\n /** Styles applied to the cell when its variant is list and the type is head. */\n variantListHead: {\n backgroundColor: \"inherit\",\n \"td&\": {\n height: 16,\n },\n },\n /** Styles applied to the cell when its variant is list and actions. */\n variantListactions: {\n verticalAlign: \"middle\",\n alignContent: \"center\",\n borderLeft: \"none\",\n paddingLeft: \"0\",\n textAlign: \"center\",\n width: 130,\n maxWidth: 130,\n },\n /** Styles applied to the cell when its variant is list and checkbox. */\n variantListcheckbox: {\n borderRight: \"none\",\n padding: 0,\n textAlign: \"center\",\n width: 34,\n maxWidth: 34,\n },\n /** Styles applied to the cell when it's part of a sticky column. */\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n backgroundColor: theme.colors.atmo2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n },\n /** Styles applied to the cell when it's part of the last sticky to the left column. */\n stickyColumnMostLeft: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n /** Styles applied to the cell when it's part of the first right sticky column. */\n stickyColumnLeastRight: {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n\n /** Styles applied to the cell when it's part of the first column in the group. */\n groupColumnMostLeft: {\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n\n \"&:first-of-type\": {\n borderLeft: 0,\n },\n },\n /** Styles applied to the cell when it's part of the last column in the group. */\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n\n /** Styles applied to the cell when it's part of a resizable column. */\n resizable: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n /** Styles applied to the cell when it's part of a resizing column. */\n resizing: {\n borderRight: `solid 2px ${theme.colors.secondary}`,\n },\n});\n"],"names":[],"mappings":";;AAGA,MAAM,cAAc,MAAM,MAAM,WAAW,GAAG;AAEvC,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA;AAAA,EAExE,MAAM;AAAA,IACJ,eAAe;AAAA,IACf,cAAc;AAAA,IACd,WAAW;AAAA,IACX,SAAS,QAAQ,MAAM,MAAM,EAAE,YAAY,MAAM,MAAM,EAAE,SACvD,MAAM,MAAM,EACd,YAAY,MAAM,QAAQ,CAAC,CAAC;AAAA,IAC5B,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,EAC/C;AAAA;AAAA,EAEA,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,cAAc;AAAA,IAEd,iBAAiB,MAAM,OAAO;AAAA,IAC9B,WAAW;AAAA,IACX,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,IAC7C,GAAI,MAAM,WAAW;AAAA,EACvB;AAAA;AAAA,EAEA,MAAM;AAAA,IACJ,WAAW;AAAA,IACX,OAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,IACA,iBAAiB;AAAA,IACjB,GAAI,MAAM,WAAW;AAAA,IACrB,YAAY,MAAM,WAAW;AAAA,IAE7B,YAAY;AAAA,MACV,iBAAiB,6BAA6B,WAAW,KAAK,WAAW;AAAA,IAC3E;AAAA,EACF;AAAA;AAAA,EAEA,QAAQ,CAAC;AAAA;AAAA,EAET,QAAQ,CAAC;AAAA;AAAA,EAET,WAAW;AAAA,IACT,WAAW;AAAA,EACb;A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wCAAwC;AAAA,MACtC,YAAY;AAAA,IACd;AAAA,EACF;AAAA;AAAA,EAEA,sBAAsB;AAAA,IACpB,aAAa,aAAa,MAAM,OAAO,KAAK;AAAA,EAC9C;AAAA;AAAA,EAEA,wBAAwB;AAAA,IACtB,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,EAC7C;AAAA;AAAA,EAGA,qBAAqB;AAAA,IACnB,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,IAE3C,mBAAmB;AAAA,MACjB,YAAY;AAAA,IACd;AAAA,EACF;AAAA;AAAA,EAEA,sBAAsB;AAAA,IACpB,aAAa,aAAa,MAAM,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,IAM5C,gBAAgB;AAAA,MACd,aAAa;AAAA,IACf;AAAA,IAEA,yBAAyB;AAAA,MACvB,YAAY;AAAA,IACd;AAAA,EACF;AAAA;AAAA,EAGA,WAAW;AAAA,IACT,aAAa,aAAa,MAAM,OAAO,KAAK;AAAA,EAC9C;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,aAAa,aAAa,MAAM,OAAO,SAAS;AAAA,EAClD;AACF,CAAC;"}
|
|
@@ -6,6 +6,7 @@ const { staticClasses, useClasses } = createClasses("HvTableHeader", {
|
|
|
6
6
|
"--cell-height": "32px",
|
|
7
7
|
height: "var(--cell-height)",
|
|
8
8
|
verticalAlign: "inherit",
|
|
9
|
+
alignContent: "inherit",
|
|
9
10
|
textAlign: "left",
|
|
10
11
|
padding: theme.spacing(0, 1, 0, 4),
|
|
11
12
|
borderBottom: `1px solid ${theme.colors.atmo4}`
|
|
@@ -13,6 +14,7 @@ const { staticClasses, useClasses } = createClasses("HvTableHeader", {
|
|
|
13
14
|
head: {
|
|
14
15
|
paddingTop: 8,
|
|
15
16
|
verticalAlign: "top",
|
|
17
|
+
alignContent: "start",
|
|
16
18
|
...theme.typography.label,
|
|
17
19
|
transition: "background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",
|
|
18
20
|
backgroundColor: theme.colors.atmo1,
|
|
@@ -30,6 +32,7 @@ const { staticClasses, useClasses } = createClasses("HvTableHeader", {
|
|
|
30
32
|
},
|
|
31
33
|
"&$sortable": {
|
|
32
34
|
verticalAlign: "initial",
|
|
35
|
+
alignContent: "initial",
|
|
33
36
|
paddingTop: 0,
|
|
34
37
|
paddingLeft: 0,
|
|
35
38
|
cursor: "pointer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableHeader.styles.js","sources":["../../../../src/Table/TableHeader/TableHeader.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableHeader\", {\n root: {\n \"--first-row-cell-height\": \"52px\",\n \"--cell-height\": \"32px\",\n height: \"var(--cell-height)\",\n verticalAlign: \"inherit\",\n textAlign: \"left\",\n padding: theme.spacing(0, 1, 0, 4),\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n },\n head: {\n paddingTop: 8,\n verticalAlign: \"top\",\n ...theme.typography.label,\n transition: \"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n backgroundColor: theme.colors.atmo1,\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n\n \"*:first-of-type > &\": {\n height: \"var(--first-row-cell-height)\",\n borderTop: \"1px solid transparent\",\n },\n\n \"&$variantList\": {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n \"*:first-of-type > &\": {\n borderTop: 0,\n },\n },\n\n \"&$sortable\": {\n verticalAlign: \"initial\",\n paddingTop: 0,\n paddingLeft: 0,\n cursor: \"pointer\",\n\n \"&:hover\": {\n backgroundColor: \"transparent\",\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n \"&:focus-within\": {\n backgroundColor: \"transparent\",\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n },\n },\n body: {\n backgroundColor: \"inherit\",\n ...theme.typography.body,\n \"&$sortable:not($variantNone)\": {\n paddingLeft: 32,\n },\n },\n footer: {},\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n },\n stickyColumnMostLeft: { borderRight: `solid 1px ${theme.colors.atmo4}` },\n stickyColumnLeastRight: { borderLeft: `solid 1px ${theme.colors.atmo4}` },\n groupColumnMostLeft: { borderLeft: `solid 1px ${theme.colors.atmo4}` },\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n headerContent: { display: \"flex\", alignItems: \"flex-start\", width: \"100%\" },\n headerText: { overflow: \"hidden\", textOverflow: \"ellipsis\" },\n headerParagraph: { overflow: \"hidden\", display: \"-webkit-box\" },\n sortableHeaderText: { paddingTop: \"8px\" },\n sorted: {\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n sortable: {},\n sortButton: {\n \"$root$sortable &\": {\n boxShadow: \"none\",\n backgroundColor: \"transparent\",\n \"&:hover\": {\n backgroundColor: theme.colors.primary_20,\n },\n },\n },\n sortIcon: { display: \"inline-flex\", visibility: \"hidden\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\", flexDirection: \"row-reverse\" },\n alignCenter: { textAlign: \"center\" },\n alignJustify: { textAlign: \"justify\" },\n alignFlexLeft: { justifyContent: \"flex-start\" },\n alignFlexRight: { justifyContent: \"flex-end\" },\n alignFlexCenter: { justifyContent: \"center\" },\n alignFlexJustify: { textAlign: \"justify\" },\n variantCheckbox: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n variantExpand: {},\n variantActions: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n variantNone: { padding: 0 },\n variantList: {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n height: 16,\n \":first-of-type > &\": {\n borderTop: 0,\n height: 16,\n },\n },\n resizable: { borderRight: `solid 1px ${theme.colors.atmo4}` },\n resizing: { borderRight: `solid 2px ${theme.colors.secondary}` },\n resizer: {\n display: \"inline-block\",\n width: 10,\n height: \"100%\",\n position: \"absolute\",\n right: 0,\n top: 0,\n transform: \"translateX(50%)\",\n zIndex: 1,\n touchAction: \"none\",\n },\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,iBAAiB;AAAA,EAC1E,MAAM;AAAA,IACJ,2BAA2B;AAAA,IAC3B,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,eAAe;AAAA,IACf,WAAW;AAAA,IACX,SAAS,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC;AAAA,IACjC,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,EAC/C;AAAA,EACA,MAAM;AAAA,IACJ,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,GAAG,MAAM,WAAW;AAAA,IACpB,YAAY;AAAA,IACZ,iBAAiB,MAAM,OAAO;AAAA,IAC9B,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,IAE7C,uBAAuB;AAAA,MACrB,QAAQ;AAAA,MACR,WAAW;AAAA,IACb;AAAA,IAEA,iBAAiB;AAAA,MACf,iBAAiB;AAAA,MACjB,cAAc;AAAA,MACd,uBAAuB;AAAA,QACrB,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IAEA,cAAc;AAAA,MACZ,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,aAAa;AAAA,MACb,QAAQ;AAAA,MAER,WAAW;AAAA,QACT,iBAAiB;AAAA,QAEjB,eAAe;AAAA,UACb,YAAY;AAAA,QACd;AAAA,MACF;AA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U,EAAE,SAAS,eAAe,YAAY,SAAS;AAAA,EACzD,WAAW,EAAE,WAAW,OAAO;AAAA,EAC/B,YAAY,EAAE,WAAW,SAAS,eAAe,cAAc;AAAA,EAC/D,aAAa,EAAE,WAAW,SAAS;AAAA,EACnC,cAAc,EAAE,WAAW,UAAU;AAAA,EACrC,eAAe,EAAE,gBAAgB,aAAa;AAAA,EAC9C,gBAAgB,EAAE,gBAAgB,WAAW;AAAA,EAC7C,iBAAiB,EAAE,gBAAgB,SAAS;AAAA,EAC5C,kBAAkB,EAAE,WAAW,UAAU;AAAA,EACzC,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa,aAAa,MAAM,OAAO,KAAK;AAAA,EAC9C;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,EAC7C;AAAA,EACA,aAAa,EAAE,SAAS,EAAE;AAAA,EAC1B,aAAa;AAAA,IACX,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,sBAAsB;AAAA,MACpB,WAAW;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,EACF;AAAA,EACA,WAAW,EAAE,aAAa,aAAa,MAAM,OAAO,KAAK,GAAG;AAAA,EAC5D,UAAU,EAAE,aAAa,aAAa,MAAM,OAAO,SAAS,GAAG;AAAA,EAC/D,SAAS;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,KAAK;AAAA,IACL,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,aAAa;AAAA,EACf;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"TableHeader.styles.js","sources":["../../../../src/Table/TableHeader/TableHeader.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableHeader\", {\n root: {\n \"--first-row-cell-height\": \"52px\",\n \"--cell-height\": \"32px\",\n height: \"var(--cell-height)\",\n verticalAlign: \"inherit\",\n alignContent: \"inherit\",\n textAlign: \"left\",\n padding: theme.spacing(0, 1, 0, 4),\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n },\n head: {\n paddingTop: 8,\n verticalAlign: \"top\",\n alignContent: \"start\",\n ...theme.typography.label,\n transition: \"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n backgroundColor: theme.colors.atmo1,\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n\n \"*:first-of-type > &\": {\n height: \"var(--first-row-cell-height)\",\n borderTop: \"1px solid transparent\",\n },\n\n \"&$variantList\": {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n \"*:first-of-type > &\": {\n borderTop: 0,\n },\n },\n\n \"&$sortable\": {\n verticalAlign: \"initial\",\n alignContent: \"initial\",\n paddingTop: 0,\n paddingLeft: 0,\n cursor: \"pointer\",\n\n \"&:hover\": {\n backgroundColor: \"transparent\",\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n \"&:focus-within\": {\n backgroundColor: \"transparent\",\n\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n },\n },\n body: {\n backgroundColor: \"inherit\",\n ...theme.typography.body,\n \"&$sortable:not($variantNone)\": {\n paddingLeft: 32,\n },\n },\n footer: {},\n stickyColumn: {\n position: \"sticky\",\n zIndex: 2,\n\n \"&$groupColumnMostRight+$stickyColumn\": {\n borderLeft: 0,\n },\n },\n stickyColumnMostLeft: { borderRight: `solid 1px ${theme.colors.atmo4}` },\n stickyColumnLeastRight: { borderLeft: `solid 1px ${theme.colors.atmo4}` },\n groupColumnMostLeft: { borderLeft: `solid 1px ${theme.colors.atmo4}` },\n groupColumnMostRight: {\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n // due to the \":has()\" selector not being supported in browsers,\n // this need to be managed with inline styles\n // To be uncommented when not needed (see comment in src/Table/hooks/useSticky.js)\n // \"&:last-child,&:has(+ $stickyColumnLeastRight)\": {\n \"&:last-child\": {\n borderRight: 0,\n },\n \"&+:not($stickyColumn)\": {\n borderLeft: 0,\n },\n },\n headerContent: { display: \"flex\", alignItems: \"flex-start\", width: \"100%\" },\n headerText: { overflow: \"hidden\", textOverflow: \"ellipsis\" },\n headerParagraph: { overflow: \"hidden\", display: \"-webkit-box\" },\n sortableHeaderText: { paddingTop: \"8px\" },\n sorted: {\n \"& $sortIcon\": {\n visibility: \"visible\",\n },\n },\n sortable: {},\n sortButton: {\n \"$root$sortable &\": {\n boxShadow: \"none\",\n backgroundColor: \"transparent\",\n \"&:hover\": {\n backgroundColor: theme.colors.primary_20,\n },\n },\n },\n sortIcon: { display: \"inline-flex\", visibility: \"hidden\" },\n alignLeft: { textAlign: \"left\" },\n alignRight: { textAlign: \"right\", flexDirection: \"row-reverse\" },\n alignCenter: { textAlign: \"center\" },\n alignJustify: { textAlign: \"justify\" },\n alignFlexLeft: { justifyContent: \"flex-start\" },\n alignFlexRight: { justifyContent: \"flex-end\" },\n alignFlexCenter: { justifyContent: \"center\" },\n alignFlexJustify: { textAlign: \"justify\" },\n variantCheckbox: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderRight: `solid 1px ${theme.colors.atmo4}`,\n },\n variantExpand: {},\n variantActions: {\n padding: 0,\n width: 32,\n maxWidth: 32,\n borderLeft: `solid 1px ${theme.colors.atmo4}`,\n },\n variantNone: { padding: 0 },\n variantList: {\n backgroundColor: \"inherit\",\n borderBottom: 0,\n height: 16,\n \":first-of-type > &\": {\n borderTop: 0,\n height: 16,\n },\n },\n resizable: { borderRight: `solid 1px ${theme.colors.atmo4}` },\n resizing: { borderRight: `solid 2px ${theme.colors.secondary}` },\n resizer: {\n display: \"inline-block\",\n width: 10,\n height: \"100%\",\n position: \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;AAAA,EAC7C,iBAAiB,EAAE,gBAAgB,SAAS;AAAA,EAC5C,kBAAkB,EAAE,WAAW,UAAU;AAAA,EACzC,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa,aAAa,MAAM,OAAO,KAAK;AAAA,EAC9C;AAAA,EACA,eAAe,CAAC;AAAA,EAChB,gBAAgB;AAAA,IACd,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY,aAAa,MAAM,OAAO,KAAK;AAAA,EAC7C;AAAA,EACA,aAAa,EAAE,SAAS,EAAE;AAAA,EAC1B,aAAa;AAAA,IACX,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,sBAAsB;AAAA,MACpB,WAAW;AAAA,MACX,QAAQ;AAAA,IACV;AAAA,EACF;AAAA,EACA,WAAW,EAAE,aAAa,aAAa,MAAM,OAAO,KAAK,GAAG;AAAA,EAC5D,UAAU,EAAE,aAAa,aAAa,MAAM,OAAO,SAAS,GAAG;AAAA,EAC/D,SAAS;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,OAAO;AAAA,IACP,KAAK;AAAA,IACL,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,aAAa;AAAA,EACf;AACF,CAAC;"}
|
|
@@ -7,6 +7,7 @@ const { staticClasses, useClasses } = createClasses("HvTableRow", {
|
|
|
7
7
|
color: "inherit",
|
|
8
8
|
backgroundColor: theme.colors.atmo1,
|
|
9
9
|
verticalAlign: "middle",
|
|
10
|
+
alignContent: "center",
|
|
10
11
|
outline: 0
|
|
11
12
|
},
|
|
12
13
|
/** Styles applied to the component root when inside a `HvTableHead`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableRow.styles.js","sources":["../../../../src/Table/TableRow/TableRow.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { getBorderStyles } from \"../utils/utils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableRow\", {\n /** Styles applied to the component root class. */\n root: {\n color: \"inherit\",\n backgroundColor: theme.colors.atmo1,\n verticalAlign: \"middle\",\n outline: 0,\n },\n /** Styles applied to the component root when inside a `HvTableHead`. */\n head: {},\n /** Styles applied to the component root when inside a `HvTableBody`. */\n body: {},\n /** Styles applied to the component root when inside a `HvTableFooter`. */\n footer: {},\n /** Styles applied to the component root when selected. */\n selected: {\n backgroundColor: theme.colors.atmo2,\n },\n /** Styles applied to the component root when expanded. */\n expanded: {\n backgroundColor: theme.colors.atmo1,\n \"& > *[role=cell]\": {\n borderBottom: \"none\",\n },\n },\n /** Styles applied to the component root when striped. */\n striped: {\n \"&:nth-of-type(even)\": {\n backgroundColor: theme.alpha(\"atmo1\", 0.6),\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n \"&:nth-of-type(odd)\": {\n backgroundColor: \"transparent\",\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n },\n /** Styles applied to the component root on hover. */\n hover: {\n transition: \"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n /** Styles applied to the component root when its table variant is list. */\n variantList: {\n // only applied on custom `display`\n marginBottom: theme.space.xs,\n borderRadius: theme.radii.round,\n\n ...getBorderStyles(theme.colors.atmo4, theme.radii.round),\n backgroundColor: theme.colors.atmo1,\n \"&$selected\": {\n ...getBorderStyles(theme.colors.secondary, theme.radii.round),\n\n \"&:hover\": {\n ...getBorderStyles(theme.colors.atmo4, theme.radii.round),\n },\n },\n\n \"&:hover\": {\n ...getBorderStyles(theme.colors.atmo4, theme.radii.round),\n },\n \"&.HvIsFocused\": {\n borderRadius: theme.radii.round,\n },\n },\n /** Styles applied to the component root when its table variant is list. */\n variantListHead: {\n backgroundColor: \"transparent\",\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA;AAAA,EAEvE,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,iBAAiB,MAAM,OAAO;AAAA,IAC9B,eAAe;AAAA,IACf,SAAS;AAAA,EACX;AAAA;AAAA,EAEA,MAAM,CAAC;AAAA;AAAA,EAEP,MAAM,CAAC;AAAA;AAAA,EAEP,QAAQ,CAAC;AAAA;AAAA,EAET,UAAU;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,IAC9B,oBAAoB;AAAA,MAClB,cAAc;AAAA,IAChB;AAAA,EACF;AAAA;AAAA,EAEA,SAAS;AAAA,IACP,uBAAuB;AAAA,MACrB,iBAAiB,MAAM,MAAM,SAAS,GAAG;AAAA,MAEzC,WAAW;AAAA,QACT,iBAAiB,MAAM,OAAO;AAAA,MAChC;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB,iBAAiB;AAAA,MAEjB,WAAW;AAAA,QACT,iBAAiB,MAAM,OAAO;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAEA,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,EACF;AAAA;AAAA,EAEA,aAAa;AAAA;AAAA,IAEX,cAAc,MAAM,MAAM;AAAA,IAC1B,cAAc,MAAM,MAAM;AAAA,IAE1B,GAAG,gBAAgB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK;AAAA,IACxD,iBAAiB,MAAM,OAAO;AAAA,IAC9B,cAAc;AAAA,MACZ,GAAG,gBAAgB,MAAM,OAAO,WAAW,MAAM,MAAM,KAAK;AAAA,MAE5D,WAAW;AAAA,QACT,GAAG,gBAAgB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK;AAAA,MAC1D;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,GAAG,gBAAgB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK;AAAA,IAC1D;AAAA,IACA,iBAAiB;AAAA,MACf,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,EACF;AAAA;AAAA,EAEA,iBAAiB;AAAA,IACf,iBAAiB;AAAA,EACnB;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"TableRow.styles.js","sources":["../../../../src/Table/TableRow/TableRow.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nimport { getBorderStyles } from \"../utils/utils\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTableRow\", {\n /** Styles applied to the component root class. */\n root: {\n color: \"inherit\",\n backgroundColor: theme.colors.atmo1,\n verticalAlign: \"middle\",\n alignContent: \"center\",\n outline: 0,\n },\n /** Styles applied to the component root when inside a `HvTableHead`. */\n head: {},\n /** Styles applied to the component root when inside a `HvTableBody`. */\n body: {},\n /** Styles applied to the component root when inside a `HvTableFooter`. */\n footer: {},\n /** Styles applied to the component root when selected. */\n selected: {\n backgroundColor: theme.colors.atmo2,\n },\n /** Styles applied to the component root when expanded. */\n expanded: {\n backgroundColor: theme.colors.atmo1,\n \"& > *[role=cell]\": {\n borderBottom: \"none\",\n },\n },\n /** Styles applied to the component root when striped. */\n striped: {\n \"&:nth-of-type(even)\": {\n backgroundColor: theme.alpha(\"atmo1\", 0.6),\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n \"&:nth-of-type(odd)\": {\n backgroundColor: \"transparent\",\n\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n },\n /** Styles applied to the component root on hover. */\n hover: {\n transition: \"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n \"&:hover\": {\n backgroundColor: theme.colors.containerBackgroundHover,\n },\n },\n /** Styles applied to the component root when its table variant is list. */\n variantList: {\n // only applied on custom `display`\n marginBottom: theme.space.xs,\n borderRadius: theme.radii.round,\n\n ...getBorderStyles(theme.colors.atmo4, theme.radii.round),\n backgroundColor: theme.colors.atmo1,\n \"&$selected\": {\n ...getBorderStyles(theme.colors.secondary, theme.radii.round),\n\n \"&:hover\": {\n ...getBorderStyles(theme.colors.atmo4, theme.radii.round),\n },\n },\n\n \"&:hover\": {\n ...getBorderStyles(theme.colors.atmo4, theme.radii.round),\n },\n \"&.HvIsFocused\": {\n borderRadius: theme.radii.round,\n },\n },\n /** Styles applied to the component root when its table variant is list. */\n variantListHead: {\n backgroundColor: \"transparent\",\n },\n});\n"],"names":[],"mappings":";;;AAKO,MAAM,EAAE,eAAe,eAAe,cAAc,cAAc;AAAA;AAAA,EAEvE,MAAM;AAAA,IACJ,OAAO;AAAA,IACP,iBAAiB,MAAM,OAAO;AAAA,IAC9B,eAAe;AAAA,IACf,cAAc;AAAA,IACd,SAAS;AAAA,EACX;AAAA;AAAA,EAEA,MAAM,CAAC;AAAA;AAAA,EAEP,MAAM,CAAC;AAAA;AAAA,EAEP,QAAQ,CAAC;AAAA;AAAA,EAET,UAAU;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,EAChC;AAAA;AAAA,EAEA,UAAU;AAAA,IACR,iBAAiB,MAAM,OAAO;AAAA,IAC9B,oBAAoB;AAAA,MAClB,cAAc;AAAA,IAChB;AAAA,EACF;AAAA;AAAA,EAEA,SAAS;AAAA,IACP,uBAAuB;AAAA,MACrB,iBAAiB,MAAM,MAAM,SAAS,GAAG;AAAA,MAEzC,WAAW;AAAA,QACT,iBAAiB,MAAM,OAAO;AAAA,MAChC;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB,iBAAiB;AAAA,MAEjB,WAAW;AAAA,QACT,iBAAiB,MAAM,OAAO;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAAA;AAAA,EAEA,OAAO;AAAA,IACL,YAAY;AAAA,IACZ,WAAW;AAAA,MACT,iBAAiB,MAAM,OAAO;AAAA,IAChC;AAAA,EACF;AAAA;AAAA,EAEA,aAAa;AAAA;AAAA,IAEX,cAAc,MAAM,MAAM;AAAA,IAC1B,cAAc,MAAM,MAAM;AAAA,IAE1B,GAAG,gBAAgB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK;AAAA,IACxD,iBAAiB,MAAM,OAAO;AAAA,IAC9B,cAAc;AAAA,MACZ,GAAG,gBAAgB,MAAM,OAAO,WAAW,MAAM,MAAM,KAAK;AAAA,MAE5D,WAAW;AAAA,QACT,GAAG,gBAAgB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK;AAAA,MAC1D;AAAA,IACF;AAAA,IAEA,WAAW;AAAA,MACT,GAAG,gBAAgB,MAAM,OAAO,OAAO,MAAM,MAAM,KAAK;AAAA,IAC1D;AAAA,IACA,iBAAiB;AAAA,MACf,cAAc,MAAM,MAAM;AAAA,IAC5B;AAAA,EACF;AAAA;AAAA,EAEA,iBAAiB;AAAA,IACf,iBAAiB;AAAA,EACnB;AACF,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DropDownXS
|
|
2
|
+
import { DropDownXS } from "@hitachivantara/uikit-react-icons";
|
|
3
3
|
import { useLabels } from "../../hooks/useLabels.js";
|
|
4
4
|
import { HvButton } from "../../Button/Button.js";
|
|
5
5
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
@@ -13,7 +13,7 @@ const CellWithExpandButton = ({
|
|
|
13
13
|
labels: labelsProp
|
|
14
14
|
}) => {
|
|
15
15
|
const labels = useLabels(DEFAULT_LABELS, labelsProp);
|
|
16
|
-
const
|
|
16
|
+
const rowProps = row.getToggleRowExpandedProps?.();
|
|
17
17
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
18
|
/* @__PURE__ */ jsx(
|
|
19
19
|
HvButton,
|
|
@@ -21,8 +21,8 @@ const CellWithExpandButton = ({
|
|
|
21
21
|
icon: true,
|
|
22
22
|
"aria-label": row.isExpanded ? labels.collapseRowButtonAriaLabel : labels.expandRowButtonAriaLabel,
|
|
23
23
|
"aria-expanded": row.isExpanded,
|
|
24
|
-
onClick,
|
|
25
|
-
children:
|
|
24
|
+
onClick: rowProps?.onClick,
|
|
25
|
+
children: /* @__PURE__ */ jsx(DropDownXS, { style: { rotate: row.isExpanded ? "180deg" : void 0 } })
|
|
26
26
|
}
|
|
27
27
|
),
|
|
28
28
|
cell?.value && /* @__PURE__ */ jsx(HvTypography, { variant: "label", component: "span", children: cell.value })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRowExpand.js","sources":["../../../../src/Table/hooks/useRowExpand.tsx"],"sourcesContent":["import {\n Hooks,\n TableExpandedToggleProps,\n UseExpandedRowProps,\n} from \"react-table\";\nimport { DropDownXS
|
|
1
|
+
{"version":3,"file":"useRowExpand.js","sources":["../../../../src/Table/hooks/useRowExpand.tsx"],"sourcesContent":["import {\n Hooks,\n TableExpandedToggleProps,\n UseExpandedRowProps,\n} from \"react-table\";\nimport { DropDownXS } from \"@hitachivantara/uikit-react-icons\";\n\nimport { HvButton } from \"../../Button\";\nimport { useLabels } from \"../../hooks/useLabels\";\nimport { HvTypography } from \"../../Typography\";\nimport type { HvCellProps } from \"./useTable\";\n\n// #region ##### TYPES #####\n\nexport interface UseHvRowExpandTableRowProps {\n expanded?: boolean;\n}\n\nexport type UseHvRowExpandTableOptions = {\n disableCreateExpandButton?: boolean;\n};\n\nexport interface UseHvRowExpandRowToggleProps extends TableExpandedToggleProps {\n onClick?: React.MouseEventHandler<unknown>;\n}\n\nexport interface UseHvRowExpandRowInstance<\n D extends object = Record<string, unknown>,\n> extends UseExpandedRowProps<D> {\n getToggleRowExpandedProps: (\n props?: Partial<TableExpandedToggleProps>,\n ) => UseHvRowExpandRowToggleProps;\n}\n\nexport type UseRowExpandProps = (<D extends object = Record<string, unknown>>(\n hooks: Hooks<D>,\n) => void) & { pluginName: string };\n\n// #endregion ##### TYPES #####\n\nconst DEFAULT_LABELS = {\n expandRowButtonAriaLabel: \"Expand this row\",\n collapseRowButtonAriaLabel: \"Collapse this row\",\n};\n\nexport const CellWithExpandButton = ({\n row,\n cell,\n labels: labelsProp,\n}: HvCellProps<any>) => {\n const labels = useLabels(DEFAULT_LABELS, labelsProp);\n const rowProps = row.getToggleRowExpandedProps?.();\n\n return (\n <>\n <HvButton\n icon\n aria-label={\n row.isExpanded\n ? labels.collapseRowButtonAriaLabel\n : labels.expandRowButtonAriaLabel\n }\n aria-expanded={row.isExpanded}\n onClick={rowProps?.onClick}\n >\n <DropDownXS style={{ rotate: row.isExpanded ? \"180deg\" : undefined }} />\n </HvButton>\n {cell?.value && (\n <HvTypography variant=\"label\" component=\"span\">\n {cell.value}\n </HvTypography>\n )}\n </>\n );\n};\n\nconst visibleColumnsHook = (columns: any, { instance }: any) => {\n if (instance.disableCreateExpandButton) {\n return columns;\n }\n\n // add a button to first data column, unless it has a custom renderer\n // if so, add an extra column instead\n const firstDataColumnIndex = columns.findIndex(\n (c: any) => c.id?.indexOf(\"_hv_\") !== 0,\n );\n\n if (firstDataColumnIndex !== -1) {\n const firstDataColumn = columns[firstDataColumnIndex];\n\n if (firstDataColumn.Cell == null) {\n firstDataColumn.Cell = CellWithExpandButton;\n firstDataColumn.variant = \"expand\";\n\n return columns;\n }\n }\n\n const expandColumn = {\n id: \"_hv_expand\",\n variant: \"none\",\n\n width: 32,\n\n // this will only work when using useHvTableSticky\n // but ensures it stays left of any sticky column\n sticky: \"left\",\n\n Cell: CellWithExpandButton,\n };\n\n const columnsCopy = [...columns];\n columnsCopy.splice(\n firstDataColumnIndex !== -1 ? firstDataColumnIndex : 0,\n 0,\n expandColumn,\n );\n\n return columnsCopy;\n};\n\nconst getRowPropsHook = (props: any, { row }: any) => {\n const nextProps: UseHvRowExpandTableRowProps = {\n expanded: row.isExpanded,\n };\n\n return [props, nextProps];\n};\n\nconst useRowExpand: UseRowExpandProps = (hooks) => {\n hooks.visibleColumns.push(visibleColumnsHook);\n hooks.getRowProps.push(getRowPropsHook);\n};\nuseRowExpand.pluginName = \"useHvRowExpand\";\n\nexport default useRowExpand;\n"],"names":[],"mappings":";;;;;AAwCA,MAAM,iBAAiB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,4BAA4B;AAC9B;AAEO,MAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA,QAAQ;AACV,MAAwB;AAChB,QAAA,SAAS,UAAU,gBAAgB,UAAU;AAC7C,QAAA,WAAW,IAAI;AAErB,SAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAI;AAAA,QACJ,cACE,IAAI,aACA,OAAO,6BACP,OAAO;AAAA,QAEb,iBAAe,IAAI;AAAA,QACnB,SAAS,UAAU;AAAA,QAEnB,UAAA,oBAAC,cAAW,OAAO,EAAE,QAAQ,IAAI,aAAa,WAAW,OAAa,EAAA,CAAA;AAAA,MAAA;AAAA,IACxE;AAAA,IACC,MAAM,SACJ,oBAAA,cAAA,EAAa,SAAQ,SAAQ,WAAU,QACrC,UAAA,KAAK,MACR,CAAA;AAAA,EAEJ,EAAA,CAAA;AAEJ;AAEA,MAAM,qBAAqB,CAAC,SAAc,EAAE,eAAoB;AAC9D,MAAI,SAAS,2BAA2B;AAC/B,WAAA;AAAA,EACT;AAIA,QAAM,uBAAuB,QAAQ;AAAA,IACnC,CAAC,MAAW,EAAE,IAAI,QAAQ,MAAM,MAAM;AAAA,EAAA;AAGxC,MAAI,yBAAyB,IAAI;AACzB,UAAA,kBAAkB,QAAQ,oBAAoB;AAEhD,QAAA,gBAAgB,QAAQ,MAAM;AAChC,sBAAgB,OAAO;AACvB,sBAAgB,UAAU;AAEnB,aAAA;AAAA,IACT;AAAA,EACF;AAEA,QAAM,eAAe;AAAA,IACnB,IAAI;AAAA,IACJ,SAAS;AAAA,IAET,OAAO;AAAA;AAAA;AAAA,IAIP,QAAQ;AAAA,IAER,MAAM;AAAA,EAAA;AAGF,QAAA,cAAc,CAAC,GAAG,OAAO;AACnB,cAAA;AAAA,IACV,yBAAyB,KAAK,uBAAuB;AAAA,IACrD;AAAA,IACA;AAAA,EAAA;AAGK,SAAA;AACT;AAEA,MAAM,kBAAkB,CAAC,OAAY,EAAE,UAAe;AACpD,QAAM,YAAyC;AAAA,IAC7C,UAAU,IAAI;AAAA,EAAA;AAGT,SAAA,CAAC,OAAO,SAAS;AAC1B;AAEM,MAAA,eAAkC,CAAC,UAAU;AAC3C,QAAA,eAAe,KAAK,kBAAkB;AACtC,QAAA,YAAY,KAAK,eAAe;AACxC;AACA,aAAa,aAAa;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import { forwardRef, useEffect, useState } from \"react\";\nimport Fade from \"@mui/material/Fade\";\nimport Tooltip, {\n TooltipProps as MuiTooltipProps,\n} from \"@mui/material/Tooltip\";\nimport {\n useDefaultProps,\n useTheme,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { getElementById } from \"../utils/document\";\nimport { staticClasses, useClasses } from \"./Tooltip.styles\";\n\nexport { staticClasses as tooltipClasses };\n\nexport type HvTooltipClasses = ExtractNames<typeof useClasses>;\nexport type HvTooltipPlacementType = MuiTooltipProps[\"placement\"];\n\nexport interface HvTooltipProps extends Omit<MuiTooltipProps, \"classes\"> {\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvTooltipClasses;\n /**\n * If true, the tooltip is shown.\n */\n open?: boolean;\n /**\n * Tooltip placement.\n */\n placement?: HvTooltipPlacementType;\n /**\n * The number of milliseconds to wait before showing the tooltip.\n * This property won't impact the enter touch delay (enterTouchDelay).\n */\n enterDelay?: number;\n /** @inheritdoc */\n title: MuiTooltipProps[\"title\"];\n /** @inheritdoc */\n TransitionComponent?: MuiTooltipProps[\"TransitionComponent\"];\n /** @inheritdoc */\n TransitionProps?: MuiTooltipProps[\"TransitionProps\"];\n /**\n * Defines if should use a single or multiline tooltip.\n */\n useSingle?: boolean;\n /**\n * Node to apply the tooltip.\n */\n children: React.ReactElement;\n /**\n * Id attribute value of an HTML Element to have the tooltip appended to it.\n */\n containerId?: string;\n}\n\n/**\n * Tooltips display informative text when users hover over, focus on, or tap an element.\n * Accessibility-wise, the tooltip automatically labels the `children` content.\n *\n * If you are looking to wrap an icon only button with a tooltip, take a look at the `HvIconButton` component\n * which offers you thus behavior out of the box.\n */\nexport const HvTooltip = forwardRef((props: HvTooltipProps, ref) => {\n const {\n className,\n classes: classesProp,\n open,\n enterDelay = 300,\n placement = \"top\",\n useSingle = true,\n children,\n title,\n TransitionComponent = Fade,\n TransitionProps = { timeout: 400, placement: \"top\" },\n containerId,\n ...others\n } = useDefaultProps(\"HvTooltip\", props);\n\n const { rootId } = useTheme();\n const { classes } = useClasses(classesProp);\n const [container, setContainer] = useState(() =>\n getElementById(containerId ?? rootId),\n );\n\n // force extra render to get the correct container DOM element\n useEffect(() => {\n setContainer(getElementById(containerId ?? rootId));\n }, [containerId, rootId]);\n\n return (\n <Tooltip\n ref={ref}\n open={open}\n enterDelay={enterDelay}\n placement={placement}\n TransitionComponent={TransitionComponent}\n TransitionProps={TransitionProps}\n className={className}\n classes={{\n tooltip: useSingle ? classes.tooltip : classes.tooltipMulti,\n popper: classes.popper,\n }}\n title={title}\n PopperProps={{ container }}\n {...others}\n >\n {children}\n </Tooltip>\n );\n});\n"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["import { forwardRef, useEffect, useState } from \"react\";\nimport Fade from \"@mui/material/Fade\";\nimport Tooltip, {\n TooltipProps as MuiTooltipProps,\n} from \"@mui/material/Tooltip\";\nimport {\n useDefaultProps,\n useTheme,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { getElementById } from \"../utils/document\";\nimport { staticClasses, useClasses } from \"./Tooltip.styles\";\n\nexport { staticClasses as tooltipClasses };\n\nexport type HvTooltipClasses = ExtractNames<typeof useClasses>;\nexport type HvTooltipPlacementType = MuiTooltipProps[\"placement\"];\n\nexport interface HvTooltipProps extends Omit<MuiTooltipProps, \"classes\"> {\n /**\n * Class names to be applied.\n */\n className?: string;\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes?: HvTooltipClasses;\n /**\n * If true, the tooltip is shown.\n */\n open?: boolean;\n /**\n * Tooltip placement.\n */\n placement?: HvTooltipPlacementType;\n /**\n * The number of milliseconds to wait before showing the tooltip.\n * This property won't impact the enter touch delay (enterTouchDelay).\n */\n enterDelay?: number;\n /** @inheritdoc */\n title: MuiTooltipProps[\"title\"];\n /** @inheritdoc */\n TransitionComponent?: MuiTooltipProps[\"TransitionComponent\"];\n /** @inheritdoc */\n TransitionProps?: MuiTooltipProps[\"TransitionProps\"];\n /**\n * Defines if should use a single or multiline tooltip.\n * @deprecated tooltips already support multiline and can be styled accordingly.\n */\n useSingle?: boolean;\n /**\n * Node to apply the tooltip.\n */\n children: React.ReactElement;\n /**\n * Id attribute value of an HTML Element to have the tooltip appended to it.\n */\n containerId?: string;\n}\n\n/**\n * Tooltips display informative text when users hover over, focus on, or tap an element.\n * Accessibility-wise, the tooltip automatically labels the `children` content.\n *\n * If you are looking to wrap an icon only button with a tooltip, take a look at the `HvIconButton` component\n * which offers you thus behavior out of the box.\n */\nexport const HvTooltip = forwardRef((props: HvTooltipProps, ref) => {\n const {\n className,\n classes: classesProp,\n open,\n enterDelay = 300,\n placement = \"top\",\n useSingle = true,\n children,\n title,\n TransitionComponent = Fade,\n TransitionProps = { timeout: 400, placement: \"top\" },\n containerId,\n ...others\n } = useDefaultProps(\"HvTooltip\", props);\n\n const { rootId } = useTheme();\n const { classes } = useClasses(classesProp);\n const [container, setContainer] = useState(() =>\n getElementById(containerId ?? rootId),\n );\n\n // force extra render to get the correct container DOM element\n useEffect(() => {\n setContainer(getElementById(containerId ?? rootId));\n }, [containerId, rootId]);\n\n return (\n <Tooltip\n ref={ref}\n open={open}\n enterDelay={enterDelay}\n placement={placement}\n TransitionComponent={TransitionComponent}\n TransitionProps={TransitionProps}\n className={className}\n classes={{\n tooltip: useSingle ? classes.tooltip : classes.tooltipMulti,\n popper: classes.popper,\n }}\n title={title}\n PopperProps={{ container }}\n {...others}\n >\n {children}\n </Tooltip>\n );\n});\n"],"names":[],"mappings":";;;;;;;;AAqEO,MAAM,YAAY,WAAW,CAAC,OAAuB,QAAQ;AAC5D,QAAA;AAAA,IACJ;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,IACtB,kBAAkB,EAAE,SAAS,KAAK,WAAW,MAAM;AAAA,IACnD;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,aAAa,KAAK;AAEhC,QAAA,EAAE,WAAW;AACnB,QAAM,EAAE,QAAA,IAAY,WAAW,WAAW;AACpC,QAAA,CAAC,WAAW,YAAY,IAAI;AAAA,IAAS,MACzC,eAAe,eAAe,MAAM;AAAA,EAAA;AAItC,YAAU,MAAM;AACD,iBAAA,eAAe,eAAe,MAAM,CAAC;AAAA,EAAA,GACjD,CAAC,aAAa,MAAM,CAAC;AAGtB,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA,QACP,SAAS,YAAY,QAAQ,UAAU,QAAQ;AAAA,QAC/C,QAAQ,QAAQ;AAAA,MAClB;AAAA,MACA;AAAA,MACA,aAAa,EAAE,UAAU;AAAA,MACxB,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
|
@@ -4,13 +4,9 @@ import { theme } from "@hitachivantara/uikit-styles";
|
|
|
4
4
|
const { staticClasses, useClasses } = createClasses("HvTooltip", {
|
|
5
5
|
root: {},
|
|
6
6
|
tooltip: {},
|
|
7
|
-
tooltipMulti: {},
|
|
8
7
|
popper: {
|
|
9
|
-
|
|
10
|
-
opacity: 1
|
|
11
|
-
},
|
|
8
|
+
// TODO: move this to `tooltip` in v6 and make class always be applied
|
|
12
9
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
13
|
-
fontFamily: theme.fontFamily.body,
|
|
14
10
|
...theme.typography.body,
|
|
15
11
|
display: "flex",
|
|
16
12
|
width: "fit-content",
|
|
@@ -54,19 +50,29 @@ const { staticClasses, useClasses } = createClasses("HvTooltip", {
|
|
|
54
50
|
padding: theme.space.sm
|
|
55
51
|
},
|
|
56
52
|
"& $tooltip": {
|
|
57
|
-
padding:
|
|
53
|
+
padding: theme.space.sm,
|
|
58
54
|
borderRadius: theme.radii.round,
|
|
59
55
|
"& p": {
|
|
60
56
|
wordBreak: "break-word"
|
|
61
57
|
}
|
|
62
58
|
}
|
|
63
59
|
},
|
|
60
|
+
// TODO: remove in v6
|
|
61
|
+
/** @deprecated */
|
|
62
|
+
tooltipMulti: {},
|
|
63
|
+
/** @deprecated */
|
|
64
64
|
title: {},
|
|
65
|
+
/** @deprecated */
|
|
65
66
|
valuesContainer: {},
|
|
67
|
+
/** @deprecated */
|
|
66
68
|
values: {},
|
|
69
|
+
/** @deprecated */
|
|
67
70
|
color: {},
|
|
71
|
+
/** @deprecated */
|
|
68
72
|
separatorColor: {},
|
|
73
|
+
/** @deprecated */
|
|
69
74
|
separator: {},
|
|
75
|
+
/** @deprecated */
|
|
70
76
|
valueWrapper: {}
|
|
71
77
|
});
|
|
72
78
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.styles.js","sources":["../../../src/Tooltip/Tooltip.styles.tsx"],"sourcesContent":["import { tooltipClasses as MuitooltipClasses } from \"@mui/material/Tooltip\";\nimport { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTooltip\", {\n root: {},\n tooltip: {},\n
|
|
1
|
+
{"version":3,"file":"Tooltip.styles.js","sources":["../../../src/Tooltip/Tooltip.styles.tsx"],"sourcesContent":["import { tooltipClasses as MuitooltipClasses } from \"@mui/material/Tooltip\";\nimport { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvTooltip\", {\n root: {},\n tooltip: {},\n popper: {\n // TODO: move this to `tooltip` in v6 and make class always be applied\n [`& .${MuitooltipClasses.tooltip}`]: {\n ...theme.typography.body,\n display: \"flex\",\n width: \"fit-content\",\n maxWidth: 532,\n backgroundColor: theme.colors.atmo1,\n boxShadow: theme.colors.shadow,\n padding: 0,\n\n \"& p\": {\n display: \"-webkit-box\",\n width: \"fit-content\",\n boxOrient: \"vertical\",\n textOverflow: \"ellipsis\",\n overflow: \"hidden\",\n },\n },\n \"& $title\": {\n padding: \"15px 20px\",\n borderBottom: `3px solid ${theme.colors.atmo2}`,\n },\n \"& $valuesContainer\": {\n padding: theme.space.sm,\n },\n \"& $values\": {\n display: \"flex\",\n justifyContent: \"space-between\",\n paddingBottom: \"10px\",\n \"&:last-child\": {\n paddingBottom: 0,\n },\n },\n \"& $color\": {\n width: theme.space.xs,\n },\n \"& $separator\": {\n width: theme.space.xs,\n },\n \"& $separatorColor\": {\n width: \"5px\",\n },\n \"& $valueWrapper\": {\n padding: theme.space.sm,\n },\n \"& $tooltip\": {\n padding: theme.space.sm,\n borderRadius: theme.radii.round,\n \"& p\": {\n wordBreak: \"break-word\",\n },\n },\n },\n // TODO: remove in v6\n /** @deprecated */\n tooltipMulti: {},\n /** @deprecated */\n title: {},\n /** @deprecated */\n valuesContainer: {},\n /** @deprecated */\n values: {},\n /** @deprecated */\n color: {},\n /** @deprecated */\n separatorColor: {},\n /** @deprecated */\n separator: {},\n /** @deprecated */\n valueWrapper: {},\n});\n"],"names":["MuitooltipClasses"],"mappings":";;;AAIO,MAAM,EAAE,eAAe,eAAe,cAAc,aAAa;AAAA,EACtE,MAAM,CAAC;AAAA,EACP,SAAS,CAAC;AAAA,EACV,QAAQ;AAAA;AAAA,IAEN,CAAC,MAAMA,eAAkB,OAAO,EAAE,GAAG;AAAA,MACnC,GAAG,MAAM,WAAW;AAAA,MACpB,SAAS;AAAA,MACT,OAAO;AAAA,MACP,UAAU;AAAA,MACV,iBAAiB,MAAM,OAAO;AAAA,MAC9B,WAAW,MAAM,OAAO;AAAA,MACxB,SAAS;AAAA,MAET,OAAO;AAAA,QACL,SAAS;AAAA,QACT,OAAO;AAAA,QACP,WAAW;AAAA,QACX,cAAc;AAAA,QACd,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,SAAS;AAAA,MACT,cAAc,aAAa,MAAM,OAAO,KAAK;AAAA,IAC/C;AAAA,IACA,sBAAsB;AAAA,MACpB,SAAS,MAAM,MAAM;AAAA,IACvB;AAAA,IACA,aAAa;AAAA,MACX,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,eAAe;AAAA,MACf,gBAAgB;AAAA,QACd,eAAe;AAAA,MACjB;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV,OAAO,MAAM,MAAM;AAAA,IACrB;AAAA,IACA,gBAAgB;AAAA,MACd,OAAO,MAAM,MAAM;AAAA,IACrB;AAAA,IACA,qBAAqB;AAAA,MACnB,OAAO;AAAA,IACT;AAAA,IACA,mBAAmB;AAAA,MACjB,SAAS,MAAM,MAAM;AAAA,IACvB;AAAA,IACA,cAAc;AAAA,MACZ,SAAS,MAAM,MAAM;AAAA,MACrB,cAAc,MAAM,MAAM;AAAA,MAC1B,OAA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