@hitachivantara/uikit-react-core 6.0.0-next.9 → 6.2.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/Badge/Badge.styles.js +0 -2
- package/dist/Banner/Banner.js +2 -0
- package/dist/Banner/BannerContent/BannerContent.js +1 -0
- package/dist/Banner/BannerContent/BannerContent.styles.js +2 -8
- package/dist/BaseSwitch/BaseSwitch.js +5 -2
- package/dist/Calendar/SingleCalendar/SingleCalendar.js +32 -25
- package/dist/Calendar/SingleCalendar/SingleCalendar.styles.js +3 -2
- package/dist/Calendar/utils.js +5 -1
- package/dist/CheckBoxGroup/CheckBoxGroup.js +1 -1
- package/dist/RadioGroup/RadioGroup.js +1 -1
- package/dist/SelectionList/SelectionList.js +1 -1
- package/dist/StatusIcon/StatusIcon.styles.js +5 -3
- package/dist/index.d.ts +356 -298
- package/dist/providers/ThemeProvider.js +22 -52
- package/dist/providers/utils.js +52 -0
- package/dist/themes/pentaho.js +168 -0
- package/dist/utils/Callout.js +19 -4
- package/package.json +5 -5
package/dist/Banner/Banner.js
CHANGED
|
@@ -26,6 +26,7 @@ const HvBanner = forwardRef(function HvBanner2(props, ref) {
|
|
|
26
26
|
label,
|
|
27
27
|
offset = 60,
|
|
28
28
|
bannerContentProps,
|
|
29
|
+
size,
|
|
29
30
|
...others
|
|
30
31
|
} = useDefaultProps("HvBanner", props);
|
|
31
32
|
const { classes, cx } = useClasses(classesProp);
|
|
@@ -71,6 +72,7 @@ const HvBanner = forwardRef(function HvBanner2(props, ref) {
|
|
|
71
72
|
onAction,
|
|
72
73
|
actionsPosition,
|
|
73
74
|
onClose,
|
|
75
|
+
size,
|
|
74
76
|
...bannerContentProps,
|
|
75
77
|
children: label
|
|
76
78
|
}
|
|
@@ -5,8 +5,7 @@ const { useClasses, staticClasses } = createClasses("HvBannerContent", {
|
|
|
5
5
|
minWidth: "100%",
|
|
6
6
|
width: "100%",
|
|
7
7
|
position: "relative",
|
|
8
|
-
gap: theme.space.xs
|
|
9
|
-
minHeight: 48
|
|
8
|
+
gap: theme.space.xs
|
|
10
9
|
},
|
|
11
10
|
success: {},
|
|
12
11
|
warning: {},
|
|
@@ -16,22 +15,17 @@ const { useClasses, staticClasses } = createClasses("HvBannerContent", {
|
|
|
16
15
|
accent: {},
|
|
17
16
|
message: {
|
|
18
17
|
gap: theme.space.xs,
|
|
19
|
-
padding: theme.spacing("xs", 0),
|
|
20
|
-
paddingLeft: theme.space.sm,
|
|
21
18
|
...theme.typography.body,
|
|
22
19
|
color: theme.colors.textDark
|
|
23
20
|
},
|
|
24
21
|
action: {
|
|
25
|
-
padding: theme.space.xs,
|
|
26
22
|
flex: "0 0 auto",
|
|
27
23
|
placeSelf: "stretch"
|
|
28
24
|
},
|
|
29
25
|
messageContainer: {
|
|
30
26
|
maxWidth: 700
|
|
31
27
|
},
|
|
32
|
-
iconContainer: {
|
|
33
|
-
marginLeft: theme.spacing(-1)
|
|
34
|
-
},
|
|
28
|
+
iconContainer: {},
|
|
35
29
|
messageActions: {
|
|
36
30
|
flex: "0 0 auto"
|
|
37
31
|
},
|
|
@@ -75,7 +75,7 @@ const HvBaseSwitch = forwardRef(
|
|
|
75
75
|
defaultChecked,
|
|
76
76
|
classes: {
|
|
77
77
|
root: classes.switch,
|
|
78
|
-
switchBase:
|
|
78
|
+
switchBase: classes.switchBase,
|
|
79
79
|
checked: classes.checked,
|
|
80
80
|
track: cx(
|
|
81
81
|
classes.track,
|
|
@@ -92,7 +92,10 @@ const HvBaseSwitch = forwardRef(
|
|
|
92
92
|
),
|
|
93
93
|
disabled: classes.disabled
|
|
94
94
|
},
|
|
95
|
-
|
|
95
|
+
slotProps: {
|
|
96
|
+
// keep switch squashed by `slotProps.input` https://github.com/mui/material-ui/pull/46482
|
|
97
|
+
input: { role: "switch", ...inputProps }
|
|
98
|
+
},
|
|
96
99
|
onFocusVisible: onFocusVisibleCallback,
|
|
97
100
|
onBlur: onBlurCallback,
|
|
98
101
|
"data-size": size,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useMemo } from "react";
|
|
3
|
+
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
3
4
|
import { isKey } from "../../utils/keyboardUtils.js";
|
|
4
5
|
import { HvCalendarHeader } from "../CalendarHeader/CalendarHeader.js";
|
|
5
6
|
import { generateCalendarModel } from "../model.js";
|
|
6
|
-
import { isDate, getWeekdayNamesList,
|
|
7
|
+
import { DEFAULT_LOCALE, isDate, getWeekdayNamesList, isRange } from "../utils.js";
|
|
7
8
|
import { HvCalendarCell } from "./CalendarCell.js";
|
|
8
9
|
import { useClasses } from "./SingleCalendar.styles.js";
|
|
9
10
|
import { staticClasses } from "./SingleCalendar.styles.js";
|
|
@@ -11,25 +12,26 @@ import { HvComposedNavigation } from "../CalendarNavigation/ComposedNavigation/C
|
|
|
11
12
|
import { HvMonthSelector } from "../CalendarNavigation/MonthSelector/MonthSelector.js";
|
|
12
13
|
import { HvPanel } from "../../Panel/Panel.js";
|
|
13
14
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
14
|
-
const HvSingleCalendar = ({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
const HvSingleCalendar = (props) => {
|
|
16
|
+
const {
|
|
17
|
+
classes: classesProp,
|
|
18
|
+
className,
|
|
19
|
+
id,
|
|
20
|
+
locale = DEFAULT_LOCALE,
|
|
21
|
+
value,
|
|
22
|
+
visibleMonth,
|
|
23
|
+
visibleYear,
|
|
24
|
+
minimumDate,
|
|
25
|
+
maximumDate,
|
|
26
|
+
onChange,
|
|
27
|
+
onInputChange,
|
|
28
|
+
onVisibleDateChange,
|
|
29
|
+
showEndDate,
|
|
30
|
+
showDayOfWeek,
|
|
31
|
+
invalidDateLabel,
|
|
32
|
+
children,
|
|
33
|
+
...others
|
|
34
|
+
} = useDefaultProps("HvSingleCalendar", props);
|
|
33
35
|
const { classes, cx } = useClasses(classesProp);
|
|
34
36
|
const today = /* @__PURE__ */ new Date();
|
|
35
37
|
const localValue = value ?? today;
|
|
@@ -121,15 +123,20 @@ const HvSingleCalendar = ({
|
|
|
121
123
|
visibleMonth: visibleMonth || today.getMonth() + 1
|
|
122
124
|
}
|
|
123
125
|
),
|
|
124
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
className: cx(classes.calendarGrid, classes.weekdays),
|
|
130
|
+
"aria-controls": HvCalendarHeader?.[0]?.id,
|
|
131
|
+
children: listWeekdayNames.map(renderWeekLabel)
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ jsx(
|
|
125
135
|
"div",
|
|
126
136
|
{
|
|
127
137
|
className: classes.calendarGrid,
|
|
128
138
|
"aria-controls": HvCalendarHeader?.[0]?.id,
|
|
129
|
-
children:
|
|
130
|
-
listWeekdayNames.map(renderWeekLabel),
|
|
131
|
-
calModel.dates.map(renderCalendarDate)
|
|
132
|
-
]
|
|
139
|
+
children: calModel.dates.map(renderCalendarDate)
|
|
133
140
|
}
|
|
134
141
|
)
|
|
135
142
|
] }),
|
|
@@ -27,7 +27,7 @@ const { staticClasses, useClasses } = createClasses("HvSingleCalendar", {
|
|
|
27
27
|
"& $cellsInRange:hover": {
|
|
28
28
|
backgroundColor: theme.colors.bgPageSecondary,
|
|
29
29
|
"& $calendarDate": {
|
|
30
|
-
borderRight: `
|
|
30
|
+
borderRight: `2px solid ${theme.colors.text}`
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"& $cellsInRange:hover ~ $cellsInRange": {
|
|
@@ -61,7 +61,8 @@ const { staticClasses, useClasses } = createClasses("HvSingleCalendar", {
|
|
|
61
61
|
backgroundColor: theme.colors.bgPageSecondary
|
|
62
62
|
},
|
|
63
63
|
cellsOutsideRange: {},
|
|
64
|
-
cellContainer: {}
|
|
64
|
+
cellContainer: {},
|
|
65
|
+
weekdays: {}
|
|
65
66
|
});
|
|
66
67
|
export {
|
|
67
68
|
staticClasses,
|
package/dist/Calendar/utils.js
CHANGED
|
@@ -15,7 +15,11 @@ const isSameDay = (date1, date2) => {
|
|
|
15
15
|
return date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear();
|
|
16
16
|
};
|
|
17
17
|
const getDateISO = (date) => {
|
|
18
|
-
|
|
18
|
+
const d = new Date(date);
|
|
19
|
+
const year = d.getFullYear();
|
|
20
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
21
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
22
|
+
return `${year}-${month}-${day}`;
|
|
19
23
|
};
|
|
20
24
|
const getPreviousMonth = (month, year) => {
|
|
21
25
|
const prevMonth = month > 1 ? month - 1 : 12;
|
|
@@ -62,7 +62,7 @@ const HvCheckBoxGroup = forwardRef(
|
|
|
62
62
|
defaultValue !== void 0 ? defaultValue : (
|
|
63
63
|
// When uncontrolled and no default value is given,
|
|
64
64
|
// extract the initial selected values from the children own state
|
|
65
|
-
() => getValueFromSelectedChildren(children)
|
|
65
|
+
(() => getValueFromSelectedChildren(children))
|
|
66
66
|
)
|
|
67
67
|
);
|
|
68
68
|
const [validationState, setValidationState] = useControlled(
|
|
@@ -54,7 +54,7 @@ const HvRadioGroup = forwardRef(
|
|
|
54
54
|
defaultValue !== void 0 ? defaultValue : (
|
|
55
55
|
// When uncontrolled and no default value is given,
|
|
56
56
|
// extract the initial selected values from the children own state
|
|
57
|
-
() => getValueFromSelectedChildren(children)
|
|
57
|
+
(() => getValueFromSelectedChildren(children))
|
|
58
58
|
)
|
|
59
59
|
);
|
|
60
60
|
const onChildChangeInterceptor = useCallback(
|
|
@@ -55,7 +55,7 @@ const HvSelectionList = forwardRef(function HvSelectionList2(props, ref) {
|
|
|
55
55
|
defaultValue !== void 0 ? defaultValue : (
|
|
56
56
|
// when uncontrolled and no default value is given,
|
|
57
57
|
// extract the initial selected values from the children own state
|
|
58
|
-
() => getValueFromSelectedChildren(children, multiple)
|
|
58
|
+
(() => getValueFromSelectedChildren(children, multiple))
|
|
59
59
|
)
|
|
60
60
|
);
|
|
61
61
|
const [validationState, setValidationState] = useControlled(
|
|
@@ -36,10 +36,12 @@ const { staticClasses, useClasses } = createClasses("HvStatusIcon", {
|
|
|
36
36
|
}
|
|
37
37
|
])
|
|
38
38
|
),
|
|
39
|
-
":where([data-variant=default]
|
|
39
|
+
":where([data-variant=default])": {
|
|
40
40
|
color: theme.colors.text,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
":where([data-type=full])": {
|
|
42
|
+
backgroundColor: theme.colors.bgPage,
|
|
43
|
+
outline: `1px solid ${theme.colors.borderSubtle}`
|
|
44
|
+
}
|
|
43
45
|
}
|
|
44
46
|
},
|
|
45
47
|
icon: {
|