@hitachivantara/uikit-react-core 5.68.0 → 5.69.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 +1 -1
- package/dist/cjs/Calendar/CalendarHeader/CalendarHeader.styles.cjs +1 -1
- package/dist/cjs/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.cjs +1 -1
- package/dist/cjs/Calendar/SingleCalendar/SingleCalendar.cjs +4 -3
- package/dist/cjs/Calendar/SingleCalendar/SingleCalendar.styles.cjs +4 -12
- package/dist/cjs/Calendar/utils.cjs +5 -5
- package/dist/cjs/Carousel/Carousel.cjs +2 -3
- package/dist/cjs/Dropdown/List/List.cjs +14 -22
- package/dist/cjs/Dropdown/List/List.styles.cjs +13 -1
- package/dist/cjs/Pagination/Pagination.cjs +1 -2
- package/dist/cjs/ProgressBar/ProgressBar.cjs +1 -2
- package/dist/cjs/Table/TableBody/TableBody.cjs +1 -1
- package/dist/cjs/Table/TableCell/TableCell.cjs +1 -1
- package/dist/cjs/Table/TableHead/TableHead.cjs +1 -1
- package/dist/cjs/Table/TableHeader/TableHeader.cjs +1 -1
- package/dist/cjs/Table/TableRow/TableRow.cjs +1 -1
- package/dist/cjs/Table/TableSectionContext.cjs +2 -2
- package/dist/cjs/Typography/Typography.cjs +1 -1
- package/dist/cjs/providers/ThemeProvider.cjs +31 -4
- package/dist/cjs/utils/helpers.cjs +0 -4
- package/dist/esm/BaseSwitch/BaseSwitch.js.map +1 -1
- package/dist/esm/Button/Button.js +1 -1
- package/dist/esm/Button/Button.js.map +1 -1
- package/dist/esm/Calendar/CalendarHeader/CalendarHeader.styles.js +1 -1
- package/dist/esm/Calendar/CalendarHeader/CalendarHeader.styles.js.map +1 -1
- package/dist/esm/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js +1 -1
- package/dist/esm/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js.map +1 -1
- package/dist/esm/Calendar/SingleCalendar/SingleCalendar.js +5 -4
- package/dist/esm/Calendar/SingleCalendar/SingleCalendar.js.map +1 -1
- package/dist/esm/Calendar/SingleCalendar/SingleCalendar.styles.js +4 -12
- package/dist/esm/Calendar/SingleCalendar/SingleCalendar.styles.js.map +1 -1
- package/dist/esm/Calendar/utils.js +5 -5
- package/dist/esm/Calendar/utils.js.map +1 -1
- package/dist/esm/Carousel/Carousel.js +2 -3
- package/dist/esm/Carousel/Carousel.js.map +1 -1
- package/dist/esm/Dropdown/List/List.js +15 -23
- package/dist/esm/Dropdown/List/List.js.map +1 -1
- package/dist/esm/Dropdown/List/List.styles.js +13 -1
- package/dist/esm/Dropdown/List/List.styles.js.map +1 -1
- package/dist/esm/Pagination/Pagination.js +1 -2
- package/dist/esm/Pagination/Pagination.js.map +1 -1
- package/dist/esm/ProgressBar/ProgressBar.js +1 -2
- package/dist/esm/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/esm/Switch/Switch.js.map +1 -1
- package/dist/esm/Table/TableBody/TableBody.js +1 -1
- package/dist/esm/Table/TableBody/TableBody.js.map +1 -1
- package/dist/esm/Table/TableCell/TableCell.js +1 -1
- package/dist/esm/Table/TableCell/TableCell.js.map +1 -1
- package/dist/esm/Table/TableHead/TableHead.js +1 -1
- package/dist/esm/Table/TableHead/TableHead.js.map +1 -1
- package/dist/esm/Table/TableHeader/TableHeader.js +1 -1
- package/dist/esm/Table/TableHeader/TableHeader.js.map +1 -1
- package/dist/esm/Table/TableRow/TableRow.js +1 -1
- package/dist/esm/Table/TableRow/TableRow.js.map +1 -1
- package/dist/esm/Table/TableSectionContext.js +1 -1
- package/dist/esm/Table/TableSectionContext.js.map +1 -1
- package/dist/esm/Typography/Typography.js +1 -1
- package/dist/esm/Typography/Typography.js.map +1 -1
- package/dist/esm/Typography/utils.js.map +1 -1
- package/dist/esm/providers/ThemeProvider.js +31 -4
- package/dist/esm/providers/ThemeProvider.js.map +1 -1
- package/dist/esm/utils/helpers.js +0 -4
- package/dist/esm/utils/helpers.js.map +1 -1
- package/dist/types/index.d.ts +27 -26
- package/package.json +7 -6
|
@@ -40,7 +40,7 @@ const HvButton = generic.fixedForwardRef(function HvButton2(props, ref) {
|
|
|
40
40
|
const { activeTheme } = uikitReactUtils.useTheme();
|
|
41
41
|
const variant = mapVariant(
|
|
42
42
|
variantProp ?? (icon ? "secondaryGhost" : "primary"),
|
|
43
|
-
activeTheme?.
|
|
43
|
+
activeTheme?.base
|
|
44
44
|
);
|
|
45
45
|
const handleClick = (e) => {
|
|
46
46
|
if (disabled) return;
|
|
@@ -4,7 +4,7 @@ const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
|
4
4
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
5
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvCalendarHeader", {
|
|
6
6
|
root: {
|
|
7
|
-
paddingBottom: uikitStyles.theme.space.
|
|
7
|
+
paddingBottom: uikitStyles.theme.space.sm,
|
|
8
8
|
"&$invalid": {
|
|
9
9
|
paddingBottom: 0
|
|
10
10
|
}
|
package/dist/cjs/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.cjs
CHANGED
|
@@ -8,7 +8,7 @@ const { staticClasses, useClasses } = uikitReactUtils.createClasses(
|
|
|
8
8
|
navigationContainer: {
|
|
9
9
|
display: "flex",
|
|
10
10
|
justifyContent: "space-between",
|
|
11
|
-
|
|
11
|
+
paddingBottom: uikitStyles.theme.space.xs
|
|
12
12
|
},
|
|
13
13
|
navigationMonth: {
|
|
14
14
|
minWidth: "160px"
|
|
@@ -11,6 +11,7 @@ const CalendarCell = require("./CalendarCell.cjs");
|
|
|
11
11
|
const SingleCalendar_styles = require("./SingleCalendar.styles.cjs");
|
|
12
12
|
const ComposedNavigation = require("../CalendarNavigation/ComposedNavigation/ComposedNavigation.cjs");
|
|
13
13
|
const MonthSelector = require("../CalendarNavigation/MonthSelector/MonthSelector.cjs");
|
|
14
|
+
const Panel = require("../../Panel/Panel.cjs");
|
|
14
15
|
const Typography = require("../../Typography/Typography.cjs");
|
|
15
16
|
const HvSingleCalendar = ({
|
|
16
17
|
classes: classesProp,
|
|
@@ -98,7 +99,7 @@ const HvSingleCalendar = ({
|
|
|
98
99
|
currentDate.toString()
|
|
99
100
|
);
|
|
100
101
|
};
|
|
101
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
102
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Panel.HvPanel, { id, className: cx(classes.root, className), ...others, children: [
|
|
102
103
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
103
104
|
CalendarHeader.HvCalendarHeader,
|
|
104
105
|
{
|
|
@@ -110,7 +111,7 @@ const HvSingleCalendar = ({
|
|
|
110
111
|
invalidDateLabel
|
|
111
112
|
}
|
|
112
113
|
),
|
|
113
|
-
calViewMode === "calendar" && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
114
|
+
calViewMode === "calendar" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
114
115
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
115
116
|
ComposedNavigation.HvComposedNavigation,
|
|
116
117
|
{
|
|
@@ -145,7 +146,7 @@ const HvSingleCalendar = ({
|
|
|
145
146
|
rangeMode
|
|
146
147
|
}
|
|
147
148
|
)
|
|
148
|
-
] })
|
|
149
|
+
] });
|
|
149
150
|
};
|
|
150
151
|
exports.singleCalendarClasses = SingleCalendar_styles.staticClasses;
|
|
151
152
|
exports.HvSingleCalendar = HvSingleCalendar;
|
|
@@ -3,20 +3,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
4
4
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
5
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvSingleCalendar", {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
minHeight: "440px",
|
|
9
|
-
position: "relative"
|
|
10
|
-
},
|
|
11
|
-
calendarWrapper: {
|
|
12
|
-
overflow: "hidden",
|
|
13
|
-
backgroundColor: uikitStyles.theme.colors.atmo1,
|
|
14
|
-
padding: uikitStyles.theme.spacing("sm")
|
|
6
|
+
root: {
|
|
7
|
+
overflow: "hidden"
|
|
15
8
|
},
|
|
16
9
|
calendarGrid: {
|
|
17
|
-
display: "
|
|
18
|
-
|
|
19
|
-
width: "280px",
|
|
10
|
+
display: "grid",
|
|
11
|
+
gridTemplateColumns: "repeat(7, 1fr)",
|
|
20
12
|
"& $cellsInRange": {
|
|
21
13
|
backgroundColor: uikitStyles.theme.colors.atmo3,
|
|
22
14
|
"& $startBookend": {
|
|
@@ -30,7 +30,7 @@ const getNextMonth = (month, year) => {
|
|
|
30
30
|
};
|
|
31
31
|
const getMonthNamesList = (locale, representationValue = "long") => {
|
|
32
32
|
const options = { month: representationValue, timeZone: "UTC" };
|
|
33
|
-
return [...
|
|
33
|
+
return [...Array(12).keys()].map((index) => {
|
|
34
34
|
const auxDate = makeUTCDate(1970, index, 1);
|
|
35
35
|
return helpers.capitalize(Intl.DateTimeFormat(locale, options).format(auxDate));
|
|
36
36
|
});
|
|
@@ -40,7 +40,7 @@ const getWeekdayNamesList = (locale) => {
|
|
|
40
40
|
weekday: "narrow",
|
|
41
41
|
timeZone: "UTC"
|
|
42
42
|
});
|
|
43
|
-
return [...
|
|
43
|
+
return [...Array(7).keys()].map((index) => {
|
|
44
44
|
return formatter.format(makeUTCDate(1970, 0, 4 + index));
|
|
45
45
|
});
|
|
46
46
|
};
|
|
@@ -53,15 +53,15 @@ const createDatesArray = (month, year) => {
|
|
|
53
53
|
const prevMonthYear = getPreviousMonth(month, year);
|
|
54
54
|
const nextMonthYear = getNextMonth(month, year);
|
|
55
55
|
const prevMonthDays = getMonthDays(prevMonthYear.month, prevMonthYear.year);
|
|
56
|
-
const prevMonthDates = [...
|
|
56
|
+
const prevMonthDates = [...Array(daysFromPrevMonth).keys()].map((index) => {
|
|
57
57
|
const day = index + 1 + (prevMonthDays - daysFromPrevMonth);
|
|
58
58
|
return new Date(prevMonthYear.year, prevMonthYear.month - 1, day);
|
|
59
59
|
});
|
|
60
|
-
const currentMonthDates = [...
|
|
60
|
+
const currentMonthDates = [...Array(monthDays).keys()].map((index) => {
|
|
61
61
|
const day = index + 1;
|
|
62
62
|
return new Date(year, month - 1, day);
|
|
63
63
|
});
|
|
64
|
-
const nextMonthDates = [...
|
|
64
|
+
const nextMonthDates = [...Array(daysFromNextMonth).keys()].map((index) => {
|
|
65
65
|
const day = index + 1;
|
|
66
66
|
return new Date(nextMonthYear.year, nextMonthYear.month - 1, day);
|
|
67
67
|
});
|
|
@@ -6,7 +6,6 @@ const useCarousel = require("embla-carousel-react");
|
|
|
6
6
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
7
7
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
8
8
|
const useLabels = require("../hooks/useLabels.cjs");
|
|
9
|
-
const helpers = require("../utils/helpers.cjs");
|
|
10
9
|
const Carousel_styles = require("./Carousel.styles.cjs");
|
|
11
10
|
const CarouselControls = require("./CarouselControls.cjs");
|
|
12
11
|
const CarouselThumbnails = require("./CarouselThumbnails.cjs");
|
|
@@ -51,7 +50,7 @@ const HvCarousel = (props) => {
|
|
|
51
50
|
const labels = useLabels.useLabels(DEFAULT_LABELS, labelsProps);
|
|
52
51
|
const thumbnailsRef = React.useRef(null);
|
|
53
52
|
const [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
54
|
-
const isDs3 = activeTheme?.
|
|
53
|
+
const isDs3 = activeTheme?.base === "ds3";
|
|
55
54
|
const actionsPosition = isDs3 ? "header" : "controls";
|
|
56
55
|
const controlsPosition = controlsPositionProp ?? (isDs3 ? "bottom" : "top");
|
|
57
56
|
const thumbnailsPosition = thumbnailsPositionProp ?? "bottom";
|
|
@@ -93,7 +92,7 @@ const HvCarousel = (props) => {
|
|
|
93
92
|
React.useEffect(() => {
|
|
94
93
|
if (!controller) return;
|
|
95
94
|
controller.reInit();
|
|
96
|
-
setSelectedIndex((currentIndex) =>
|
|
95
|
+
setSelectedIndex((currentIndex) => uikitReactUtils.clamp(currentIndex, numSlides));
|
|
97
96
|
}, [numSlides, controller]);
|
|
98
97
|
const handleFullscreen = (event) => {
|
|
99
98
|
onFullscreen?.(event, !isFullscreen);
|
|
@@ -31,12 +31,12 @@ const HvDropdownList = (props) => {
|
|
|
31
31
|
notifyChangesOnFirstRender = false,
|
|
32
32
|
hasTooltips = false,
|
|
33
33
|
singleSelectionToggle,
|
|
34
|
-
height:
|
|
34
|
+
height: heightProp,
|
|
35
35
|
maxHeight,
|
|
36
36
|
virtualized = false,
|
|
37
37
|
...others
|
|
38
38
|
} = uikitReactUtils.useDefaultProps("HvDropdownList", props);
|
|
39
|
-
const { classes, cx
|
|
39
|
+
const { classes, cx } = List_styles.useClasses(classesProp);
|
|
40
40
|
const [searchStr, setSearchStr] = React.useState("");
|
|
41
41
|
const [list, setList] = React.useState(clone(values));
|
|
42
42
|
const [allSelected, setAllSelected] = React.useState(false);
|
|
@@ -169,6 +169,9 @@ const HvDropdownList = (props) => {
|
|
|
169
169
|
] });
|
|
170
170
|
};
|
|
171
171
|
const showList = valuesExist(values);
|
|
172
|
+
const elementsSize = uikitStyles.theme.spacing(
|
|
173
|
+
5 + 2 + (showSearch ? 5 : 0) + (showList && multiSelect ? 4 + 6 : 0)
|
|
174
|
+
);
|
|
172
175
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.rootList, children: [
|
|
173
176
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.listBorderDown }),
|
|
174
177
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.listContainer, children: [
|
|
@@ -178,26 +181,15 @@ const HvDropdownList = (props) => {
|
|
|
178
181
|
List.HvList,
|
|
179
182
|
{
|
|
180
183
|
id: setId.setId(id, "list"),
|
|
184
|
+
style: uikitReactUtils.mergeStyles(void 0, {
|
|
185
|
+
height: heightProp,
|
|
186
|
+
"--maxW": width,
|
|
187
|
+
"--maxH": maxHeight ?? `calc(${height}px - ${elementsSize})`
|
|
188
|
+
}),
|
|
181
189
|
classes: {
|
|
182
|
-
root: cx(
|
|
183
|
-
classes.
|
|
184
|
-
|
|
185
|
-
maxWidth: width,
|
|
186
|
-
maxHeight: maxHeight ?? `calc(${height}px - 32px - ${uikitStyles.theme.space.xs} - ${uikitStyles.theme.space.sm})`,
|
|
187
|
-
overflow: "auto",
|
|
188
|
-
padding: 4,
|
|
189
|
-
margin: -4
|
|
190
|
-
}),
|
|
191
|
-
dropdownHeight && css({
|
|
192
|
-
height: dropdownHeight
|
|
193
|
-
}),
|
|
194
|
-
virtualized && css({
|
|
195
|
-
maxWidth: "inherit",
|
|
196
|
-
maxHeight: "inherit",
|
|
197
|
-
overflow: "inherit",
|
|
198
|
-
padding: 0
|
|
199
|
-
})
|
|
200
|
-
)
|
|
190
|
+
root: cx(classes.dropdownListContainer, {
|
|
191
|
+
[classes.virtualized]: virtualized
|
|
192
|
+
})
|
|
201
193
|
},
|
|
202
194
|
values: list,
|
|
203
195
|
multiSelect,
|
|
@@ -209,7 +201,7 @@ const HvDropdownList = (props) => {
|
|
|
209
201
|
selectable: true,
|
|
210
202
|
condensed: true,
|
|
211
203
|
singleSelectionToggle,
|
|
212
|
-
height:
|
|
204
|
+
height: heightProp,
|
|
213
205
|
virtualized,
|
|
214
206
|
...others
|
|
215
207
|
}
|
|
@@ -4,7 +4,19 @@ const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
|
4
4
|
const uikitStyles = require("@hitachivantara/uikit-styles");
|
|
5
5
|
const { staticClasses, useClasses } = uikitReactUtils.createClasses("HvDropdownList", {
|
|
6
6
|
rootList: {},
|
|
7
|
-
dropdownListContainer: {
|
|
7
|
+
dropdownListContainer: {
|
|
8
|
+
overflow: "auto",
|
|
9
|
+
padding: 4,
|
|
10
|
+
margin: -4,
|
|
11
|
+
maxWidth: "var(--maxW)",
|
|
12
|
+
maxHeight: "var(--maxH)"
|
|
13
|
+
},
|
|
14
|
+
virtualized: {
|
|
15
|
+
maxWidth: "inherit",
|
|
16
|
+
maxHeight: "inherit",
|
|
17
|
+
overflow: "inherit",
|
|
18
|
+
padding: 0
|
|
19
|
+
},
|
|
8
20
|
searchContainer: { marginBottom: uikitStyles.theme.space.xs },
|
|
9
21
|
listBorderDown: {},
|
|
10
22
|
listContainer: { padding: uikitStyles.theme.space.sm },
|
|
@@ -6,7 +6,6 @@ const Hidden = require("@mui/material/Hidden");
|
|
|
6
6
|
const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
|
|
7
7
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
8
8
|
const useLabels = require("../hooks/useLabels.cjs");
|
|
9
|
-
const helpers = require("../utils/helpers.cjs");
|
|
10
9
|
const setId = require("../utils/setId.cjs");
|
|
11
10
|
const Pagination_styles = require("./Pagination.styles.cjs");
|
|
12
11
|
const Select = require("./Select.cjs");
|
|
@@ -70,7 +69,7 @@ const HvPagination = (props) => {
|
|
|
70
69
|
const [pageInput, setPageInput] = React.useState(page);
|
|
71
70
|
const changePage = React.useCallback(
|
|
72
71
|
(newPage) => {
|
|
73
|
-
const safePage = Number.isNaN(newPage) ? page :
|
|
72
|
+
const safePage = Number.isNaN(newPage) ? page : uikitReactUtils.clamp(newPage, pages - 1);
|
|
74
73
|
onPageChange?.(safePage);
|
|
75
74
|
setPageInput(safePage);
|
|
76
75
|
},
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const uikitReactUtils = require("@hitachivantara/uikit-react-utils");
|
|
5
|
-
const helpers = require("../utils/helpers.cjs");
|
|
6
5
|
const ProgressBar_styles = require("./ProgressBar.styles.cjs");
|
|
7
6
|
const Typography = require("../Typography/Typography.cjs");
|
|
8
7
|
const HvProgressBar = (props) => {
|
|
@@ -16,7 +15,7 @@ const HvProgressBar = (props) => {
|
|
|
16
15
|
...others
|
|
17
16
|
} = uikitReactUtils.useDefaultProps("HvProgressBar", props);
|
|
18
17
|
const { classes, cx } = ProgressBar_styles.useClasses(classesProp);
|
|
19
|
-
const clampedValue =
|
|
18
|
+
const clampedValue = uikitReactUtils.clamp(value, 100);
|
|
20
19
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21
20
|
"div",
|
|
22
21
|
{
|
|
@@ -26,7 +26,7 @@ const HvTableBody = React.forwardRef(
|
|
|
26
26
|
const bodyRef = React.useRef(null);
|
|
27
27
|
const handleRef = useForkRef.useForkRef(externalRef, bodyRef);
|
|
28
28
|
const Component = component || tableContext?.components?.TBody || defaultComponent;
|
|
29
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TableSectionContext.
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableSectionContext.TableSectionContext.Provider, { value: tableSectionContext, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
30
|
Component,
|
|
31
31
|
{
|
|
32
32
|
className: cx(classes.root, className),
|
|
@@ -31,7 +31,7 @@ const HvTableCell = React.forwardRef(
|
|
|
31
31
|
} = uikitReactUtils.useDefaultProps("HvTableCell", props);
|
|
32
32
|
const { classes, cx } = TableCell_styles.useClasses(classesProp);
|
|
33
33
|
const tableContext = React.useContext(TableContext.default);
|
|
34
|
-
const tableSectionContext = React.useContext(TableSectionContext.
|
|
34
|
+
const tableSectionContext = React.useContext(TableSectionContext.TableSectionContext);
|
|
35
35
|
const type = typeProp || tableSectionContext?.type || "body";
|
|
36
36
|
const Component = component || tableContext?.components?.Td || defaultComponent;
|
|
37
37
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -14,7 +14,7 @@ const HvTableHead = React.forwardRef(
|
|
|
14
14
|
const { classes, cx } = TableHead_styles.useClasses(classesProp);
|
|
15
15
|
const tableContext = React.useContext(TableContext.default);
|
|
16
16
|
const Component = component || tableContext?.components?.THead || defaultComponent;
|
|
17
|
-
return /* @__PURE__ */ jsxRuntime.jsx(TableSectionContext.
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableSectionContext.TableSectionContext.Provider, { value: tableSectionContext, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18
18
|
Component,
|
|
19
19
|
{
|
|
20
20
|
className: cx(
|
|
@@ -43,7 +43,7 @@ const HvTableHeader = React.forwardRef(
|
|
|
43
43
|
const { classes, cx, css } = TableHeader_styles.useClasses(classesProp);
|
|
44
44
|
const { colors } = uikitReactUtils.useTheme();
|
|
45
45
|
const tableContext = React.useContext(TableContext.default);
|
|
46
|
-
const tableSectionContext = React.useContext(TableSectionContext.
|
|
46
|
+
const tableSectionContext = React.useContext(TableSectionContext.TableSectionContext);
|
|
47
47
|
const type = typeProp || tableSectionContext?.type || "body";
|
|
48
48
|
const isHeadCell = type === "head";
|
|
49
49
|
const scope = scopeProp ?? (isHeadCell ? "col" : "row");
|
|
@@ -21,7 +21,7 @@ const HvTableRow = React.forwardRef(
|
|
|
21
21
|
} = uikitReactUtils.useDefaultProps("HvTableRow", props);
|
|
22
22
|
const { classes, cx } = TableRow_styles.useClasses(classesProp);
|
|
23
23
|
const tableContext = React.useContext(TableContext.default);
|
|
24
|
-
const tableSectionContext = React.useContext(TableSectionContext.
|
|
24
|
+
const tableSectionContext = React.useContext(TableSectionContext.TableSectionContext);
|
|
25
25
|
const type = tableSectionContext?.type || "body";
|
|
26
26
|
const isList = tableContext.variant === "listrow";
|
|
27
27
|
const Component = component || tableContext?.components?.Tr || defaultComponent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const TableSectionContext = React.createContext({});
|
|
5
|
-
exports.
|
|
5
|
+
exports.TableSectionContext = TableSectionContext;
|
|
@@ -52,7 +52,7 @@ const HvTypography = generic.fixedForwardRef(function HvTypography2(props, ref)
|
|
|
52
52
|
} = uikitReactUtils.useDefaultProps("HvTypography", props);
|
|
53
53
|
const { classes, cx } = Typography_styles.useClasses(classesProp);
|
|
54
54
|
const { activeTheme } = uikitReactUtils.useTheme();
|
|
55
|
-
const variant = utils.mapVariant(variantProp, activeTheme?.
|
|
55
|
+
const variant = utils.mapVariant(variantProp, activeTheme?.base);
|
|
56
56
|
const Component = ComponentProp || paragraph && "p" || HvTypographyMap[variant] || "span";
|
|
57
57
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
58
|
Component,
|
|
@@ -59,7 +59,36 @@ const HvThemeProvider = ({
|
|
|
59
59
|
]
|
|
60
60
|
);
|
|
61
61
|
const muiTheme = React.useMemo(() => {
|
|
62
|
+
const colors = activeTheme.colors.modes[colorMode];
|
|
62
63
|
return styles.createTheme({
|
|
64
|
+
spacing: activeTheme.space.base,
|
|
65
|
+
typography: {
|
|
66
|
+
fontFamily: activeTheme.fontFamily.body
|
|
67
|
+
},
|
|
68
|
+
palette: {
|
|
69
|
+
primary: { main: colors.primary },
|
|
70
|
+
success: { main: colors.positive },
|
|
71
|
+
warning: { main: colors.warning },
|
|
72
|
+
error: { main: colors.negative },
|
|
73
|
+
info: { main: colors.primary },
|
|
74
|
+
text: {
|
|
75
|
+
primary: colors.secondary,
|
|
76
|
+
secondary: colors.secondary_80,
|
|
77
|
+
disabled: colors.secondary_60
|
|
78
|
+
},
|
|
79
|
+
background: {
|
|
80
|
+
default: colors.atmo2,
|
|
81
|
+
paper: colors.atmo1
|
|
82
|
+
},
|
|
83
|
+
divider: colors.atmo4,
|
|
84
|
+
action: {
|
|
85
|
+
active: colors.primary,
|
|
86
|
+
hover: colors.primary_80,
|
|
87
|
+
selected: colors.primary_80,
|
|
88
|
+
disabled: colors.secondary_60,
|
|
89
|
+
disabledBackground: colors.atmo3
|
|
90
|
+
}
|
|
91
|
+
},
|
|
63
92
|
components: {
|
|
64
93
|
MuiButtonBase: {
|
|
65
94
|
defaultProps: {
|
|
@@ -67,11 +96,9 @@ const HvThemeProvider = ({
|
|
|
67
96
|
}
|
|
68
97
|
}
|
|
69
98
|
},
|
|
70
|
-
breakpoints:
|
|
71
|
-
...activeTheme.breakpoints
|
|
72
|
-
}
|
|
99
|
+
breakpoints: activeTheme.breakpoints
|
|
73
100
|
});
|
|
74
|
-
}, [activeTheme
|
|
101
|
+
}, [activeTheme, colorMode]);
|
|
75
102
|
const emotionCacheValue = React.useMemo(
|
|
76
103
|
() => ({ cache: emotionCache }),
|
|
77
104
|
[emotionCache]
|
|
@@ -9,9 +9,6 @@ const range = (length, start = 0) => {
|
|
|
9
9
|
const capitalize = (string = "") => {
|
|
10
10
|
return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
|
11
11
|
};
|
|
12
|
-
const clamp = (value, max = 100, min = 0) => {
|
|
13
|
-
return Math.min(Math.max(value, min), max);
|
|
14
|
-
};
|
|
15
12
|
function isEqual(obj1, obj2) {
|
|
16
13
|
if (!obj1 || !obj2 || typeof obj1 !== "object" || typeof obj2 !== "object") {
|
|
17
14
|
return obj1 === obj2;
|
|
@@ -26,7 +23,6 @@ function isEqual(obj1, obj2) {
|
|
|
26
23
|
return true;
|
|
27
24
|
}
|
|
28
25
|
exports.capitalize = capitalize;
|
|
29
|
-
exports.clamp = clamp;
|
|
30
26
|
exports.isEqual = isEqual;
|
|
31
27
|
exports.range = range;
|
|
32
28
|
exports.uniqueId = uniqueId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSwitch.js","sources":["../../../src/BaseSwitch/BaseSwitch.tsx"],"sourcesContent":["import { forwardRef, useCallback, useState } from \"react\";\nimport MuiSwitch, { SwitchProps as MuiSwitchProps } from \"@mui/material/Switch\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { staticClasses, useClasses } from \"./BaseSwitch.styles\";\n\nexport { staticClasses as baseSwitchClasses };\n\nexport type HvBaseSwitchClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBaseSwitchProps\n extends Omit<MuiSwitchProps, \"onChange\" | \"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 to the switch.\n */\n classes?: HvBaseSwitchClasses;\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * The input name.\n */\n name?: string;\n /**\n * The value of the input.\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 * Indicates that user input is required.\n */\n required?: boolean;\n /**\n * Indicates that the input is not editable.\n */\n readOnly?: boolean;\n /**\n * Indicates that the input is disabled.\n */\n disabled?: 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 callback fired when the switch is pressed.\n */\n onChange?: (event: React.ChangeEvent
|
|
1
|
+
{"version":3,"file":"BaseSwitch.js","sources":["../../../src/BaseSwitch/BaseSwitch.tsx"],"sourcesContent":["import { forwardRef, useCallback, useState } from \"react\";\nimport MuiSwitch, { SwitchProps as MuiSwitchProps } from \"@mui/material/Switch\";\nimport {\n useDefaultProps,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport { staticClasses, useClasses } from \"./BaseSwitch.styles\";\n\nexport { staticClasses as baseSwitchClasses };\n\nexport type HvBaseSwitchClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvBaseSwitchProps\n extends Omit<MuiSwitchProps, \"onChange\" | \"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 to the switch.\n */\n classes?: HvBaseSwitchClasses;\n /**\n * Id to be applied to the root node.\n */\n id?: string;\n /**\n * The input name.\n */\n name?: string;\n /**\n * The value of the input.\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 * Indicates that user input is required.\n */\n required?: boolean;\n /**\n * Indicates that the input is not editable.\n */\n readOnly?: boolean;\n /**\n * Indicates that the input is disabled.\n */\n disabled?: 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 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 /**\n * Callback fired when the component is focused with a keyboard.\n * We trigger a `onFocus` callback too.\n */\n onFocusVisible?: (event: React.FocusEvent<any>) => void;\n /**\n * @ignore\n */\n onBlur?: (event: React.FocusEvent<any>) => void;\n}\n\n/**\n * A Switch is <b>binary</b> and work as a digital on/off button.\n *\n * The Base Switch is a building block of the Switch form element. Don't use unless\n * implementing a custom use case not covered by the Switch form element.\n */\nexport const HvBaseSwitch = forwardRef<HTMLButtonElement, HvBaseSwitchProps>(\n (props, ref) => {\n const {\n classes: classesProp,\n className,\n\n id,\n name,\n value = \"on\",\n\n required = false,\n readOnly = false,\n disabled = false,\n\n checked,\n defaultChecked,\n\n onChange,\n\n inputProps,\n\n onFocusVisible,\n onBlur,\n\n ...others\n } = useDefaultProps(\"HvBaseSwitch\", props);\n\n const { classes, cx } = useClasses(classesProp);\n\n const [focusVisible, setFocusVisible] = useState(false);\n\n const onFocusVisibleCallback = useCallback(\n (evt: React.FocusEvent<any, Element>) => {\n setFocusVisible(true);\n onFocusVisible?.(evt);\n },\n [onFocusVisible],\n );\n\n const onBlurCallback = useCallback(\n (evt: React.FocusEvent<any, Element>) => {\n setFocusVisible(false);\n onBlur?.(evt);\n },\n [onBlur],\n );\n\n const onLocalChange = useCallback(\n (evt: React.ChangeEvent<HTMLInputElement>) => {\n if (readOnly) {\n return;\n }\n\n onChange?.(evt, evt.target.checked, value);\n },\n [onChange, readOnly, value],\n );\n\n return (\n <MuiSwitch\n ref={ref}\n id={id}\n name={name}\n className={cx(\n classes.root,\n {\n [classes.disabled]: disabled,\n [classes.readOnly]: readOnly,\n [classes.focusVisible]: focusVisible,\n },\n className,\n )}\n color=\"default\"\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n disableRipple\n onChange={onLocalChange}\n value={value}\n checked={checked}\n defaultChecked={defaultChecked}\n classes={{\n root: classes.switch,\n switchBase: classes.switchBase,\n checked: classes.checked,\n track: classes.track,\n thumb: classes.thumb,\n disabled: classes.disabled,\n }}\n inputProps={inputProps}\n onFocusVisible={onFocusVisibleCallback}\n onBlur={onBlurCallback}\n {...others}\n />\n );\n },\n);\n"],"names":[],"mappings":";;;;;;AA2FO,MAAM,eAAe;AAAA,EAC1B,CAAC,OAAO,QAAQ;AACR,UAAA;AAAA,MACJ,SAAS;AAAA,MACT;AAAA,MAEA;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MAER,WAAW;AAAA,MACX,WAAW;AAAA,MACX,WAAW;AAAA,MAEX;AAAA,MACA;AAAA,MAEA;AAAA,MAEA;AAAA,MAEA;AAAA,MACA;AAAA,MAEA,GAAG;AAAA,IAAA,IACD,gBAAgB,gBAAgB,KAAK;AAEzC,UAAM,EAAE,SAAS,GAAG,IAAI,WAAW,WAAW;AAE9C,UAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AAEtD,UAAM,yBAAyB;AAAA,MAC7B,CAAC,QAAwC;AACvC,wBAAgB,IAAI;AACpB,yBAAiB,GAAG;AAAA,MACtB;AAAA,MACA,CAAC,cAAc;AAAA,IAAA;AAGjB,UAAM,iBAAiB;AAAA,MACrB,CAAC,QAAwC;AACvC,wBAAgB,KAAK;AACrB,iBAAS,GAAG;AAAA,MACd;AAAA,MACA,CAAC,MAAM;AAAA,IAAA;AAGT,UAAM,gBAAgB;AAAA,MACpB,CAAC,QAA6C;AAC5C,YAAI,UAAU;AACZ;AAAA,QACF;AAEA,mBAAW,KAAK,IAAI,OAAO,SAAS,KAAK;AAAA,MAC3C;AAAA,MACA,CAAC,UAAU,UAAU,KAAK;AAAA,IAAA;AAI1B,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAW;AAAA,UACT,QAAQ;AAAA,UACR;AAAA,YACE,CAAC,QAAQ,QAAQ,GAAG;AAAA,YACpB,CAAC,QAAQ,QAAQ,GAAG;AAAA,YACpB,CAAC,QAAQ,YAAY,GAAG;AAAA,UAC1B;AAAA,UACA;AAAA,QACF;AAAA,QACA,OAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAa;AAAA,QACb,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS;AAAA,UACP,MAAM,QAAQ;AAAA,UACd,YAAY,QAAQ;AAAA,UACpB,SAAS,QAAQ;AAAA,UACjB,OAAO,QAAQ;AAAA,UACf,OAAO,QAAQ;AAAA,UACf,UAAU,QAAQ;AAAA,QACpB;AAAA,QACA;AAAA,QACA,gBAAgB;AAAA,QAChB,QAAQ;AAAA,QACP,GAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
@@ -39,7 +39,7 @@ const HvButton = fixedForwardRef(function HvButton2(props, ref) {
|
|
|
39
39
|
const { activeTheme } = useTheme();
|
|
40
40
|
const variant = mapVariant(
|
|
41
41
|
variantProp ?? (icon ? "secondaryGhost" : "primary"),
|
|
42
|
-
activeTheme?.
|
|
42
|
+
activeTheme?.base
|
|
43
43
|
);
|
|
44
44
|
const handleClick = (e) => {
|
|
45
45
|
if (disabled) return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/Button/Button.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n useDefaultProps,\n useTheme,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport {\n staticClasses as buttonClasses,\n getColoringStyle,\n getIconSizeStyles,\n getOverrideColors,\n getRadiusStyles,\n getSizeStyles,\n useClasses,\n} from \"./Button.styles\";\nimport { HvButtonRadius, HvButtonSize, HvButtonVariant } from \"./types\";\n\nexport { buttonClasses };\n\nexport type HvButtonClasses = ExtractNames<typeof useClasses>;\n\nexport type HvButtonProps<C extends React.ElementType = \"button\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the button. */\n variant?: HvButtonVariant;\n /** Whether the button is an icon-only button. */\n icon?: boolean;\n /** Whether the button is disabled or not. */\n disabled?: boolean;\n /** Class names to be applied. */\n className?: string;\n /** Element placed before the children. */\n startIcon?: React.ReactNode;\n /** Element placed after the children. */\n endIcon?: React.ReactNode;\n /** Button size. */\n size?: HvButtonSize;\n /** Button border radius. */\n radius?: HvButtonRadius;\n /** Defines the default colors of the button are forced into the icon. */\n overrideIconColors?: boolean;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvButtonClasses;\n /** Whether the button is selected or not. */\n selected?: boolean;\n /**\n * Whether the button is focusable when disabled.\n * Without this property, the accessibility of the button decreases when disabled since it's not read by screen readers.\n * Set this property to `true` when you need the button to still be focusable when disabled for accessibility purposes.\n */\n focusableWhenDisabled?: boolean;\n }\n >;\n\n/**\n * Normalize the button variant. It's meant to give us some retro-compatibility with\n * the DS 3.6 API.\n * @returns the normalized variant in DS 5 API\n */\nconst mapVariant = (\n variant: HvButtonVariant,\n theme?:
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/Button/Button.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport {\n useDefaultProps,\n useTheme,\n type ExtractNames,\n} from \"@hitachivantara/uikit-react-utils\";\nimport { HvBaseTheme } from \"@hitachivantara/uikit-styles\";\n\nimport {\n fixedForwardRef,\n PolymorphicComponentRef,\n PolymorphicRef,\n} from \"../types/generic\";\nimport {\n staticClasses as buttonClasses,\n getColoringStyle,\n getIconSizeStyles,\n getOverrideColors,\n getRadiusStyles,\n getSizeStyles,\n useClasses,\n} from \"./Button.styles\";\nimport { HvButtonRadius, HvButtonSize, HvButtonVariant } from \"./types\";\n\nexport { buttonClasses };\n\nexport type HvButtonClasses = ExtractNames<typeof useClasses>;\n\nexport type HvButtonProps<C extends React.ElementType = \"button\"> =\n PolymorphicComponentRef<\n C,\n {\n /** Use the variant prop to change the visual style of the button. */\n variant?: HvButtonVariant;\n /** Whether the button is an icon-only button. */\n icon?: boolean;\n /** Whether the button is disabled or not. */\n disabled?: boolean;\n /** Class names to be applied. */\n className?: string;\n /** Element placed before the children. */\n startIcon?: React.ReactNode;\n /** Element placed after the children. */\n endIcon?: React.ReactNode;\n /** Button size. */\n size?: HvButtonSize;\n /** Button border radius. */\n radius?: HvButtonRadius;\n /** Defines the default colors of the button are forced into the icon. */\n overrideIconColors?: boolean;\n /** A Jss Object used to override or extend the styles applied. */\n classes?: HvButtonClasses;\n /** Whether the button is selected or not. */\n selected?: boolean;\n /**\n * Whether the button is focusable when disabled.\n * Without this property, the accessibility of the button decreases when disabled since it's not read by screen readers.\n * Set this property to `true` when you need the button to still be focusable when disabled for accessibility purposes.\n */\n focusableWhenDisabled?: boolean;\n }\n >;\n\n/**\n * Normalize the button variant. It's meant to give us some retro-compatibility with\n * the DS 3.6 API.\n * @returns the normalized variant in DS 5 API\n */\nconst mapVariant = (\n variant: HvButtonVariant,\n theme?: HvBaseTheme,\n): HvButtonVariant => {\n if (theme === \"ds3\") return variant;\n\n const deprecatedVariantMap: Record<string, HvButtonVariant> = {\n secondary: \"secondarySubtle\",\n ghost: \"primaryGhost\",\n };\n\n const mappedVariant = deprecatedVariantMap[variant];\n\n if (import.meta.env.DEV && mappedVariant) {\n // eslint-disable-next-line no-console\n console.warn(\n `Button variant '${variant}' is deprecated. Please use '${mappedVariant}'.`,\n );\n }\n\n return mappedVariant || variant;\n};\n\n/**\n * Button component is used to trigger an action or event.\n */\nexport const HvButton = fixedForwardRef(function HvButton<\n C extends React.ElementType = \"button\",\n>(props: HvButtonProps<C>, ref: PolymorphicRef<C>) {\n const {\n classes: classesProp,\n children,\n variant: variantProp, // TODO - should we split into two props (color and type) in v6?\n disabled = false,\n className,\n startIcon,\n endIcon,\n icon = false,\n size,\n radius,\n overrideIconColors = true,\n component: Component = \"button\",\n focusableWhenDisabled,\n onClick: onClickProp,\n onMouseDown: onMouseDownProp,\n selected,\n style,\n ...others\n } = useDefaultProps(\"HvButton\", props);\n const { classes, css, cx } = useClasses(classesProp);\n const { activeTheme } = useTheme();\n const variant = mapVariant(\n variantProp ?? (icon ? \"secondaryGhost\" : \"primary\"),\n activeTheme?.base,\n );\n\n const handleClick: HvButtonProps[\"onClick\"] = (e) => {\n if (disabled) return;\n onClickProp?.(e);\n };\n\n const handleMouseDown: HvButtonProps[\"onMouseDown\"] = (e) => {\n if (disabled) return;\n onMouseDownProp?.(e);\n };\n\n const [color, type] = useMemo(() => {\n const result = variant.split(/(?=[A-Z])/);\n if (\n result[0] === \"ghost\" ||\n result[0] === \"semantic\" ||\n (result[0] === \"secondary\" && !result[1])\n )\n return [];\n return result.map((x) => x.toLowerCase());\n }, [variant]);\n\n const sizeStyles = useMemo(\n () =>\n size ? (icon ? getIconSizeStyles(size) : getSizeStyles(size)) : undefined,\n [size, icon],\n );\n\n return (\n <Component\n ref={ref}\n style={{\n ...style,\n \"--HvButton-height\": sizeStyles ? sizeStyles.height : \"32px\",\n }}\n className={cx(\n classes.root,\n type && classes[type as keyof HvButtonClasses],\n color && css(getColoringStyle(color, type)),\n classes[variant as keyof HvButtonClasses], // Placed after type and color CSS for DS3 override\n radius && css(getRadiusStyles(radius)),\n overrideIconColors && css(getOverrideColors()),\n {\n [classes.icon]: icon,\n [classes.disabled]: disabled,\n },\n sizeStyles && css(sizeStyles),\n className,\n )}\n onClick={handleClick}\n onMouseDown={handleMouseDown}\n {...(Component === \"button\" && { type: \"button\" })}\n {...(disabled && {\n disabled: !focusableWhenDisabled,\n tabIndex: focusableWhenDisabled ? 0 : -1,\n \"aria-disabled\": true,\n })}\n {...(selected && { \"aria-pressed\": selected })}\n {...others}\n >\n {startIcon && <span className={classes.startIcon}>{startIcon}</span>}\n {children}\n {endIcon && <span className={classes.endIcon}>{endIcon}</span>}\n </Component>\n );\n});\n"],"names":["HvButton"],"mappings":";;;;;;AAoEA,MAAM,aAAa,CACjB,SACA,UACoB;AAChB,MAAA,UAAU,MAAc,QAAA;AAE5B,QAAM,uBAAwD;AAAA,IAC5D,WAAW;AAAA,IACX,OAAO;AAAA,EAAA;AAGH,QAAA,gBAAgB,qBAAqB,OAAO;AASlD,SAAO,iBAAiB;AAC1B;AAKO,MAAM,WAAW,gBAAgB,SAASA,UAE/C,OAAyB,KAAwB;AAC3C,QAAA;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA,SAAS;AAAA;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB,WAAW,YAAY;AAAA,IACvB;AAAA,IACA,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,IACD,gBAAgB,YAAY,KAAK;AACrC,QAAM,EAAE,SAAS,KAAK,GAAG,IAAI,WAAW,WAAW;AAC7C,QAAA,EAAE,gBAAgB;AACxB,QAAM,UAAU;AAAA,IACd,gBAAgB,OAAO,mBAAmB;AAAA,IAC1C,aAAa;AAAA,EAAA;AAGT,QAAA,cAAwC,CAAC,MAAM;AACnD,QAAI,SAAU;AACd,kBAAc,CAAC;AAAA,EAAA;AAGX,QAAA,kBAAgD,CAAC,MAAM;AAC3D,QAAI,SAAU;AACd,sBAAkB,CAAC;AAAA,EAAA;AAGrB,QAAM,CAAC,OAAO,IAAI,IAAI,QAAQ,MAAM;AAC5B,UAAA,SAAS,QAAQ,MAAM,WAAW;AACxC,QACE,OAAO,CAAC,MAAM,WACd,OAAO,CAAC,MAAM,cACb,OAAO,CAAC,MAAM,eAAe,CAAC,OAAO,CAAC;AAEvC,aAAO;AACT,WAAO,OAAO,IAAI,CAAC,MAAM,EAAE,aAAa;AAAA,EAAA,GACvC,CAAC,OAAO,CAAC;AAEZ,QAAM,aAAa;AAAA,IACjB,MACE,OAAQ,OAAO,kBAAkB,IAAI,IAAI,cAAc,IAAI,IAAK;AAAA,IAClE,CAAC,MAAM,IAAI;AAAA,EAAA;AAIX,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC;AAAA,MACA,OAAO;AAAA,QACL,GAAG;AAAA,QACH,qBAAqB,aAAa,WAAW,SAAS;AAAA,MACxD;AAAA,MACA,WAAW;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ,QAAQ,IAA6B;AAAA,QAC7C,SAAS,IAAI,iBAAiB,OAAO,IAAI,CAAC;AAAA,QAC1C,QAAQ,OAAgC;AAAA;AAAA,QACxC,UAAU,IAAI,gBAAgB,MAAM,CAAC;AAAA,QACrC,sBAAsB,IAAI,mBAAmB;AAAA,QAC7C;AAAA,UACE,CAAC,QAAQ,IAAI,GAAG;AAAA,UAChB,CAAC,QAAQ,QAAQ,GAAG;AAAA,QACtB;AAAA,QACA,cAAc,IAAI,UAAU;AAAA,QAC5B;AAAA,MACF;AAAA,MACA,SAAS;AAAA,MACT,aAAa;AAAA,MACZ,GAAI,cAAc,YAAY,EAAE,MAAM,SAAS;AAAA,MAC/C,GAAI,YAAY;AAAA,QACf,UAAU,CAAC;AAAA,QACX,UAAU,wBAAwB,IAAI;AAAA,QACtC,iBAAiB;AAAA,MACnB;AAAA,MACC,GAAI,YAAY,EAAE,gBAAgB,SAAS;AAAA,MAC3C,GAAG;AAAA,MAEH,UAAA;AAAA,QAAA,aAAc,oBAAA,QAAA,EAAK,WAAW,QAAQ,WAAY,UAAU,WAAA;AAAA,QAC5D;AAAA,QACA,WAAY,oBAAA,QAAA,EAAK,WAAW,QAAQ,SAAU,UAAQ,SAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG7D,CAAC;"}
|
|
@@ -2,7 +2,7 @@ import { createClasses } from "@hitachivantara/uikit-react-utils";
|
|
|
2
2
|
import { theme } from "@hitachivantara/uikit-styles";
|
|
3
3
|
const { staticClasses, useClasses } = createClasses("HvCalendarHeader", {
|
|
4
4
|
root: {
|
|
5
|
-
paddingBottom: theme.space.
|
|
5
|
+
paddingBottom: theme.space.sm,
|
|
6
6
|
"&$invalid": {
|
|
7
7
|
paddingBottom: 0
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarHeader.styles.js","sources":["../../../../src/Calendar/CalendarHeader/CalendarHeader.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCalendarHeader\", {\n root: {\n paddingBottom: theme.space.
|
|
1
|
+
{"version":3,"file":"CalendarHeader.styles.js","sources":["../../../../src/Calendar/CalendarHeader/CalendarHeader.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvCalendarHeader\", {\n root: {\n paddingBottom: theme.space.sm,\n\n \"&$invalid\": {\n paddingBottom: 0,\n },\n },\n invalid: {},\n headerDayOfWeek: {\n color: theme.colors.secondary_80,\n },\n headerDate: {},\n input: {},\n inputBorderContainer: {},\n invalidMessageStyling: {},\n});\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,oBAAoB;AAAA,EAC7E,MAAM;AAAA,IACJ,eAAe,MAAM,MAAM;AAAA,IAE3B,aAAa;AAAA,MACX,eAAe;AAAA,IACjB;AAAA,EACF;AAAA,EACA,SAAS,CAAC;AAAA,EACV,iBAAiB;AAAA,IACf,OAAO,MAAM,OAAO;AAAA,EACtB;AAAA,EACA,YAAY,CAAC;AAAA,EACb,OAAO,CAAC;AAAA,EACR,sBAAsB,CAAC;AAAA,EACvB,uBAAuB,CAAC;AAC1B,CAAC;"}
|
package/dist/esm/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComposedNavigation.styles.js","sources":["../../../../../src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\n \"HvComposedNavigation\",\n {\n navigationContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n
|
|
1
|
+
{"version":3,"file":"ComposedNavigation.styles.js","sources":["../../../../../src/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.tsx"],"sourcesContent":["import { createClasses } from \"@hitachivantara/uikit-react-utils\";\nimport { theme } from \"@hitachivantara/uikit-styles\";\n\nexport const { staticClasses, useClasses } = createClasses(\n \"HvComposedNavigation\",\n {\n navigationContainer: {\n display: \"flex\",\n justifyContent: \"space-between\",\n paddingBottom: theme.space.xs,\n },\n navigationMonth: {\n minWidth: \"160px\",\n },\n },\n);\n"],"names":[],"mappings":";;AAGa,MAAA,EAAE,eAAe,WAAA,IAAe;AAAA,EAC3C;AAAA,EACA;AAAA,IACE,qBAAqB;AAAA,MACnB,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,eAAe,MAAM,MAAM;AAAA,IAC7B;AAAA,IACA,iBAAiB;AAAA,MACf,UAAU;AAAA,IACZ;AAAA,EACF;AACF;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx,
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useMemo } from "react";
|
|
3
3
|
import { isKey } from "../../utils/keyboardUtils.js";
|
|
4
4
|
import { setId } from "../../utils/setId.js";
|
|
@@ -10,6 +10,7 @@ import { useClasses } from "./SingleCalendar.styles.js";
|
|
|
10
10
|
import { staticClasses } from "./SingleCalendar.styles.js";
|
|
11
11
|
import { HvComposedNavigation } from "../CalendarNavigation/ComposedNavigation/ComposedNavigation.js";
|
|
12
12
|
import { HvMonthSelector } from "../CalendarNavigation/MonthSelector/MonthSelector.js";
|
|
13
|
+
import { HvPanel } from "../../Panel/Panel.js";
|
|
13
14
|
import { HvTypography } from "../../Typography/Typography.js";
|
|
14
15
|
const HvSingleCalendar = ({
|
|
15
16
|
classes: classesProp,
|
|
@@ -97,7 +98,7 @@ const HvSingleCalendar = ({
|
|
|
97
98
|
currentDate.toString()
|
|
98
99
|
);
|
|
99
100
|
};
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ jsxs(HvPanel, { id, className: cx(classes.root, className), ...others, children: [
|
|
101
102
|
/* @__PURE__ */ jsx(
|
|
102
103
|
HvCalendarHeader,
|
|
103
104
|
{
|
|
@@ -109,7 +110,7 @@ const HvSingleCalendar = ({
|
|
|
109
110
|
invalidDateLabel
|
|
110
111
|
}
|
|
111
112
|
),
|
|
112
|
-
calViewMode === "calendar" && /* @__PURE__ */ jsxs(
|
|
113
|
+
calViewMode === "calendar" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
113
114
|
/* @__PURE__ */ jsx(
|
|
114
115
|
HvComposedNavigation,
|
|
115
116
|
{
|
|
@@ -144,7 +145,7 @@ const HvSingleCalendar = ({
|
|
|
144
145
|
rangeMode
|
|
145
146
|
}
|
|
146
147
|
)
|
|
147
|
-
] })
|
|
148
|
+
] });
|
|
148
149
|
};
|
|
149
150
|
export {
|
|
150
151
|
HvSingleCalendar,
|