@kaizen/components 2.1.1 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/src/Button/Button.cjs +1 -0
- package/dist/cjs/src/Calendar/CalendarRange/CalendarRange.cjs +4 -2
- package/dist/cjs/src/Calendar/CalendarRange/CalendarRange.module.scss.cjs +2 -1
- package/dist/cjs/src/Calendar/CalendarSingle/CalendarSingle.cjs +9 -5
- package/dist/cjs/src/Calendar/CalendarSingle/CalendarSingle.module.scss.cjs +2 -1
- package/dist/cjs/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.cjs +4 -2
- package/dist/cjs/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.module.scss.cjs +2 -1
- package/dist/cjs/src/LinkButton/LinkButton.cjs +1 -0
- package/dist/cjs/src/Pagination/Pagination.cjs +1 -0
- package/dist/cjs/src/TitleBlock/TitleBlock.module.scss.cjs +1 -0
- package/dist/cjs/src/TitleBlock/utils.cjs +1 -1
- package/dist/cjs/src/Tooltip/OverlayArrow.cjs +1 -0
- package/dist/cjs/src/Tooltip/Tooltip.cjs +1 -0
- package/dist/cjs/src/utils/useContainerQueries.cjs +89 -0
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/src/Button/Button.mjs +1 -0
- package/dist/esm/src/Calendar/CalendarRange/CalendarRange.mjs +4 -2
- package/dist/esm/src/Calendar/CalendarRange/CalendarRange.module.scss.mjs +2 -1
- package/dist/esm/src/Calendar/CalendarSingle/CalendarSingle.mjs +9 -5
- package/dist/esm/src/Calendar/CalendarSingle/CalendarSingle.module.scss.mjs +2 -1
- package/dist/esm/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.mjs +4 -2
- package/dist/esm/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.module.scss.mjs +2 -1
- package/dist/esm/src/LinkButton/LinkButton.mjs +1 -0
- package/dist/esm/src/Pagination/Pagination.mjs +1 -0
- package/dist/esm/src/TitleBlock/TitleBlock.module.scss.mjs +1 -0
- package/dist/esm/src/TitleBlock/utils.mjs +1 -1
- package/dist/esm/src/Tooltip/OverlayArrow.mjs +1 -0
- package/dist/esm/src/Tooltip/Tooltip.mjs +1 -0
- package/dist/esm/src/utils/useContainerQueries.mjs +87 -0
- package/dist/styles.css +34 -5
- package/dist/types/Calendar/CalendarSingle/CalendarSingle.d.ts +3 -1
- package/dist/types/TitleBlock/types.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/useContainerQueries.d.ts +21 -0
- package/package.json +1 -1
- package/src/Calendar/CalendarRange/CalendarRange.module.scss +4 -0
- package/src/Calendar/CalendarRange/CalendarRange.tsx +16 -2
- package/src/Calendar/CalendarSingle/CalendarSingle.module.scss +4 -0
- package/src/Calendar/CalendarSingle/CalendarSingle.tsx +20 -2
- package/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.module.scss +4 -0
- package/src/Calendar/LegacyCalendarRange/LegacyCalendarRange.tsx +16 -2
- package/src/TitleBlock/TitleBlock.module.scss +29 -0
- package/src/TitleBlock/_docs/TitleBlock--usage-guidelines.mdx +4 -0
- package/src/TitleBlock/_docs/TitleBlock.stories.tsx +108 -0
- package/src/TitleBlock/_variables.scss +1 -0
- package/src/TitleBlock/types.ts +1 -1
- package/src/TitleBlock/utils.ts +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/useContainerQueries.spec.tsx +209 -0
- package/src/utils/useContainerQueries.tsx +121 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -172,6 +172,7 @@ var ToggleSwitchField = require('./src/ToggleSwitch/ToggleSwitchField/ToggleSwit
|
|
|
172
172
|
var Tooltip = require('./src/Tooltip/Tooltip.cjs');
|
|
173
173
|
var TooltipTrigger = require('./src/Tooltip/TooltipTrigger.cjs');
|
|
174
174
|
var useMediaQueries = require('./src/utils/useMediaQueries.cjs');
|
|
175
|
+
var useContainerQueries = require('./src/utils/useContainerQueries.cjs');
|
|
175
176
|
var hostedAssets = require('./src/utils/hostedAssets.cjs');
|
|
176
177
|
var ReversedColors = require('./src/utils/ReversedColors/ReversedColors.cjs');
|
|
177
178
|
var VisuallyHidden = require('./src/VisuallyHidden/VisuallyHidden.cjs');
|
|
@@ -573,6 +574,7 @@ exports.Tooltip = Tooltip.Tooltip;
|
|
|
573
574
|
exports.TooltipTrigger = TooltipTrigger.TooltipTrigger;
|
|
574
575
|
exports.subtractOnePixel = useMediaQueries.subtractOnePixel;
|
|
575
576
|
exports.useMediaQueries = useMediaQueries.useMediaQueries;
|
|
577
|
+
exports.useContainerQueries = useContainerQueries.useContainerQueries;
|
|
576
578
|
exports.assetUrl = hostedAssets.assetUrl;
|
|
577
579
|
exports.ReversedColors = ReversedColors.ReversedColors;
|
|
578
580
|
exports.useReversedColors = ReversedColors.useReversedColors;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var tslib = require('tslib');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactAriaComponents = require('react-aria-components');
|
|
6
|
+
require('use-debounce');
|
|
6
7
|
var ReversedColors = require('../utils/ReversedColors/ReversedColors.cjs');
|
|
7
8
|
var mergeClassNames = require('../utils/mergeClassNames.cjs');
|
|
8
9
|
var PendingContent = require('./subcomponents/PendingContent/PendingContent.cjs');
|
|
@@ -60,13 +60,15 @@ var CalendarRange = function (_a) {
|
|
|
60
60
|
return React__default.default.createElement(Icon.Icon, {
|
|
61
61
|
name: "arrow_back",
|
|
62
62
|
isPresentational: true,
|
|
63
|
-
shouldMirrorInRTL: true
|
|
63
|
+
shouldMirrorInRTL: true,
|
|
64
|
+
className: CalendarRange_module.chevronIcon
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
return React__default.default.createElement(Icon.Icon, {
|
|
67
68
|
name: "arrow_forward",
|
|
68
69
|
isPresentational: true,
|
|
69
|
-
shouldMirrorInRTL: true
|
|
70
|
+
shouldMirrorInRTL: true,
|
|
71
|
+
className: CalendarRange_module.chevronIcon
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
},
|
|
@@ -7,6 +7,7 @@ var styles = {
|
|
|
7
7
|
"dayRangeStart": "CalendarRange-module_dayRangeStart__TwdDT",
|
|
8
8
|
"dayRangeEnd": "CalendarRange-module_dayRangeEnd__y6dEB",
|
|
9
9
|
"dayRangeMiddle": "CalendarRange-module_dayRangeMiddle__SybKY",
|
|
10
|
-
"hidden": "CalendarRange-module_hidden__D47kb"
|
|
10
|
+
"hidden": "CalendarRange-module_hidden__D47kb",
|
|
11
|
+
"chevronIcon": "CalendarRange-module_chevronIcon__ULJzd"
|
|
11
12
|
};
|
|
12
13
|
module.exports = styles;
|
|
@@ -25,7 +25,9 @@ var CalendarSingle = function (_a) {
|
|
|
25
25
|
weekStartsOn = _a.weekStartsOn,
|
|
26
26
|
_b = _a.locale,
|
|
27
27
|
locale$1 = _b === void 0 ? locale.enAU : _b,
|
|
28
|
-
|
|
28
|
+
_c = _a.components,
|
|
29
|
+
components = _c === void 0 ? {} : _c,
|
|
30
|
+
restProps = tslib.__rest(_a, ["id", "onMount", "classNameOverride", "selected", "defaultMonth", "weekStartsOn", "locale", "components"]);
|
|
29
31
|
var calendarRef = React.useRef(null);
|
|
30
32
|
React.useEffect(function () {
|
|
31
33
|
if (calendarRef.current) onMount === null || onMount === void 0 ? void 0 : onMount(calendarRef.current);
|
|
@@ -48,22 +50,24 @@ var CalendarSingle = function (_a) {
|
|
|
48
50
|
defaultMonth: selectedMonth,
|
|
49
51
|
weekStartsOn: isValidWeekStartsOn.isValidWeekStartsOn(weekStartsOn) ? weekStartsOn : undefined,
|
|
50
52
|
classNames: classNames,
|
|
51
|
-
components: {
|
|
53
|
+
components: tslib.__assign({
|
|
52
54
|
Chevron: function (props) {
|
|
53
55
|
if (props.orientation === 'left') {
|
|
54
56
|
return React__default.default.createElement(Icon.Icon, {
|
|
55
57
|
name: "arrow_back",
|
|
56
58
|
isPresentational: true,
|
|
57
|
-
shouldMirrorInRTL: true
|
|
59
|
+
shouldMirrorInRTL: true,
|
|
60
|
+
className: CalendarSingle_module.chevronIcon
|
|
58
61
|
});
|
|
59
62
|
}
|
|
60
63
|
return React__default.default.createElement(Icon.Icon, {
|
|
61
64
|
name: "arrow_forward",
|
|
62
65
|
isPresentational: true,
|
|
63
|
-
shouldMirrorInRTL: true
|
|
66
|
+
shouldMirrorInRTL: true,
|
|
67
|
+
className: CalendarSingle_module.chevronIcon
|
|
64
68
|
});
|
|
65
69
|
}
|
|
66
|
-
},
|
|
70
|
+
}, components),
|
|
67
71
|
locale: locale$1
|
|
68
72
|
}, restProps)));
|
|
69
73
|
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var styles = {
|
|
4
4
|
"nav": "CalendarSingle-module_nav__wSVua",
|
|
5
|
-
"navButtonNext": "CalendarSingle-module_navButtonNext__-GrZx"
|
|
5
|
+
"navButtonNext": "CalendarSingle-module_navButtonNext__-GrZx",
|
|
6
|
+
"chevronIcon": "CalendarSingle-module_chevronIcon__0PRnR"
|
|
6
7
|
};
|
|
7
8
|
module.exports = styles;
|
|
@@ -52,13 +52,15 @@ var LegacyCalendarRange = function (_a) {
|
|
|
52
52
|
return React__default.default.createElement(Icon.Icon, {
|
|
53
53
|
name: "arrow_back",
|
|
54
54
|
isPresentational: true,
|
|
55
|
-
shouldMirrorInRTL: true
|
|
55
|
+
shouldMirrorInRTL: true,
|
|
56
|
+
className: LegacyCalendarRange_module.chevronIcon
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
return React__default.default.createElement(Icon.Icon, {
|
|
59
60
|
name: "arrow_forward",
|
|
60
61
|
isPresentational: true,
|
|
61
|
-
shouldMirrorInRTL: true
|
|
62
|
+
shouldMirrorInRTL: true,
|
|
63
|
+
className: LegacyCalendarRange_module.chevronIcon
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
},
|
|
@@ -4,6 +4,7 @@ var styles = {
|
|
|
4
4
|
"nav": "LegacyCalendarRange-module_nav__DsZpy",
|
|
5
5
|
"dayRangeStart": "LegacyCalendarRange-module_dayRangeStart__vRr5P",
|
|
6
6
|
"dayRangeEnd": "LegacyCalendarRange-module_dayRangeEnd__PfuWy",
|
|
7
|
-
"dayRangeMiddle": "LegacyCalendarRange-module_dayRangeMiddle__M27gR"
|
|
7
|
+
"dayRangeMiddle": "LegacyCalendarRange-module_dayRangeMiddle__M27gR",
|
|
8
|
+
"chevronIcon": "LegacyCalendarRange-module_chevronIcon__Q6pOJ"
|
|
8
9
|
};
|
|
9
10
|
module.exports = styles;
|
|
@@ -11,6 +11,7 @@ require('../Loading/LoadingParagraph/LoadingParagraph.cjs');
|
|
|
11
11
|
require('../Loading/LoadingSpinner/LoadingSpinner.cjs');
|
|
12
12
|
require('../VisuallyHidden/VisuallyHidden.cjs');
|
|
13
13
|
var ButtonContent = require('../Button/subcomponents/ButtonContent/ButtonContent.cjs');
|
|
14
|
+
require('use-debounce');
|
|
14
15
|
var ReversedColors = require('../utils/ReversedColors/ReversedColors.cjs');
|
|
15
16
|
var mergeClassNames = require('../utils/mergeClassNames.cjs');
|
|
16
17
|
var Button_module = require('../Button/Button.module.css.cjs');
|
|
@@ -4,6 +4,7 @@ var tslib = require('tslib');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var classnames = require('classnames');
|
|
6
6
|
var useMediaQueries = require('../utils/useMediaQueries.cjs');
|
|
7
|
+
require('use-debounce');
|
|
7
8
|
require('../utils/ReversedColors/ReversedColors.cjs');
|
|
8
9
|
var DirectionalLink = require('./subcomponents/DirectionalLink/DirectionalLink.cjs');
|
|
9
10
|
var PaginationLink = require('./subcomponents/PaginationLink/PaginationLink.cjs');
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var styles = {
|
|
4
4
|
"titleBlock": "TitleBlock-module_titleBlock__7jxn3",
|
|
5
|
+
"lightVariant": "TitleBlock-module_lightVariant__1EeLV",
|
|
5
6
|
"educationVariant": "TitleBlock-module_educationVariant__YvpWa",
|
|
6
7
|
"adminVariant": "TitleBlock-module_adminVariant__s95nS",
|
|
7
8
|
"titleRow": "TitleBlock-module_titleRow__Ifqiu",
|
|
@@ -4,7 +4,7 @@ var tslib = require('tslib');
|
|
|
4
4
|
var isMenuGroupNotButton = function (value) {
|
|
5
5
|
return 'menuItems' in value;
|
|
6
6
|
};
|
|
7
|
-
var NON_REVERSED_VARIANTS = ['education', 'admin'];
|
|
7
|
+
var NON_REVERSED_VARIANTS = ['light', 'education', 'admin'];
|
|
8
8
|
var isReversed = function (variant) {
|
|
9
9
|
// The default variant (no variant prop) is reversed (dark background)
|
|
10
10
|
if (variant === undefined) return true;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var tslib = require('tslib');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactAriaComponents = require('react-aria-components');
|
|
6
|
+
require('use-debounce');
|
|
6
7
|
var ReversedColors = require('../utils/ReversedColors/ReversedColors.cjs');
|
|
7
8
|
var mergeClassNames = require('../utils/mergeClassNames.cjs');
|
|
8
9
|
var OverlayArrow_module = require('./OverlayArrow.module.scss.cjs');
|
|
@@ -4,6 +4,7 @@ var tslib = require('tslib');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var reactAriaComponents = require('react-aria-components');
|
|
6
6
|
var VisuallyHidden = require('../VisuallyHidden/VisuallyHidden.cjs');
|
|
7
|
+
require('use-debounce');
|
|
7
8
|
var ReversedColors = require('../utils/ReversedColors/ReversedColors.cjs');
|
|
8
9
|
var mergeClassNames = require('../utils/mergeClassNames.cjs');
|
|
9
10
|
var OverlayArrow = require('./OverlayArrow.cjs');
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var useDebounce = require('use-debounce');
|
|
5
|
+
var DEFAULT_DEBOUNCE_MS = 1000;
|
|
6
|
+
/**
|
|
7
|
+
* Tailwind CSS default container query breakpoints in pixels
|
|
8
|
+
* These match the default ranges from Tailwind CSS documentation
|
|
9
|
+
* https://tailwindcss.com/docs/responsive-design#container-size-reference
|
|
10
|
+
*/
|
|
11
|
+
var DEFAULT_BREAKPOINTS = {
|
|
12
|
+
'3xs': 256,
|
|
13
|
+
'2xs': 288,
|
|
14
|
+
'xs': 320,
|
|
15
|
+
'sm': 384,
|
|
16
|
+
'md': 448,
|
|
17
|
+
'lg': 512,
|
|
18
|
+
'xl': 576,
|
|
19
|
+
'2xl': 672,
|
|
20
|
+
'3xl': 768,
|
|
21
|
+
'4xl': 896,
|
|
22
|
+
'5xl': 1024,
|
|
23
|
+
'6xl': 1152,
|
|
24
|
+
'7xl': 1280
|
|
25
|
+
};
|
|
26
|
+
var useContainerQueries = function () {
|
|
27
|
+
var isClient = typeof window !== 'undefined';
|
|
28
|
+
var _a = React.useState(0),
|
|
29
|
+
containerWidth = _a[0],
|
|
30
|
+
setContainerWidth = _a[1];
|
|
31
|
+
var resizeObserverRef = React.useRef(null);
|
|
32
|
+
var debouncedSetContainerWidth = useDebounce.useDebouncedCallback(function (width) {
|
|
33
|
+
setContainerWidth(width);
|
|
34
|
+
}, DEFAULT_DEBOUNCE_MS);
|
|
35
|
+
var containerRef = React.useCallback(function (node) {
|
|
36
|
+
// Skip if SSR
|
|
37
|
+
if (!isClient) return;
|
|
38
|
+
// Cleanup previous observer
|
|
39
|
+
if (resizeObserverRef.current) {
|
|
40
|
+
resizeObserverRef.current.disconnect();
|
|
41
|
+
resizeObserverRef.current = null;
|
|
42
|
+
}
|
|
43
|
+
if (node) {
|
|
44
|
+
// Create new ResizeObserver
|
|
45
|
+
resizeObserverRef.current = new ResizeObserver(function (entries) {
|
|
46
|
+
var _a, _b, _c;
|
|
47
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
48
|
+
var entry = entries_1[_i];
|
|
49
|
+
// Use borderBoxSize for more accurate measurements
|
|
50
|
+
var width_1 = (_c = (_b = (_a = entry.borderBoxSize) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.inlineSize) !== null && _c !== void 0 ? _c : entry.contentRect.width;
|
|
51
|
+
debouncedSetContainerWidth(width_1);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
resizeObserverRef.current.observe(node);
|
|
55
|
+
// Set initial width immediately (no debounce for initial render)
|
|
56
|
+
var width = node.getBoundingClientRect().width;
|
|
57
|
+
setContainerWidth(width);
|
|
58
|
+
}
|
|
59
|
+
}, [debouncedSetContainerWidth, isClient]);
|
|
60
|
+
React.useEffect(function () {
|
|
61
|
+
return function () {
|
|
62
|
+
if (resizeObserverRef.current) {
|
|
63
|
+
resizeObserverRef.current.disconnect();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
var queries = React.useMemo(function () {
|
|
68
|
+
return {
|
|
69
|
+
is3xsOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['3xs'],
|
|
70
|
+
is2xsOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['2xs'],
|
|
71
|
+
isXsOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.xs,
|
|
72
|
+
isSmOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.sm,
|
|
73
|
+
isMdOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.md,
|
|
74
|
+
isLgOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.lg,
|
|
75
|
+
isXlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.xl,
|
|
76
|
+
is2xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['2xl'],
|
|
77
|
+
is3xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['3xl'],
|
|
78
|
+
is4xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['4xl'],
|
|
79
|
+
is5xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['5xl'],
|
|
80
|
+
is6xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['6xl'],
|
|
81
|
+
is7xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['7xl']
|
|
82
|
+
};
|
|
83
|
+
}, [containerWidth]);
|
|
84
|
+
return {
|
|
85
|
+
containerRef: containerRef,
|
|
86
|
+
queries: queries
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
exports.useContainerQueries = useContainerQueries;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -177,6 +177,7 @@ export { ToggleSwitchField } from './src/ToggleSwitch/ToggleSwitchField/ToggleSw
|
|
|
177
177
|
export { Tooltip } from './src/Tooltip/Tooltip.mjs';
|
|
178
178
|
export { TooltipTrigger } from './src/Tooltip/TooltipTrigger.mjs';
|
|
179
179
|
export { subtractOnePixel, useMediaQueries } from './src/utils/useMediaQueries.mjs';
|
|
180
|
+
export { useContainerQueries } from './src/utils/useContainerQueries.mjs';
|
|
180
181
|
export { assetUrl } from './src/utils/hostedAssets.mjs';
|
|
181
182
|
export { ReversedColors, useReversedColors } from './src/utils/ReversedColors/ReversedColors.mjs';
|
|
182
183
|
export { VisuallyHidden } from './src/VisuallyHidden/VisuallyHidden.mjs';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __rest, __assign } from 'tslib';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { Button as Button$1 } from 'react-aria-components';
|
|
4
|
+
import 'use-debounce';
|
|
4
5
|
import { useReversedColors } from '../utils/ReversedColors/ReversedColors.mjs';
|
|
5
6
|
import { mergeClassNames } from '../utils/mergeClassNames.mjs';
|
|
6
7
|
import { PendingContent } from './subcomponents/PendingContent/PendingContent.mjs';
|
|
@@ -53,13 +53,15 @@ const CalendarRange = /*#__PURE__*/function () {
|
|
|
53
53
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
54
54
|
name: "arrow_back",
|
|
55
55
|
isPresentational: true,
|
|
56
|
-
shouldMirrorInRTL: true
|
|
56
|
+
shouldMirrorInRTL: true,
|
|
57
|
+
className: styles.chevronIcon
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
60
61
|
name: "arrow_forward",
|
|
61
62
|
isPresentational: true,
|
|
62
|
-
shouldMirrorInRTL: true
|
|
63
|
+
shouldMirrorInRTL: true,
|
|
64
|
+
className: styles.chevronIcon
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
67
|
},
|
|
@@ -5,6 +5,7 @@ var styles = {
|
|
|
5
5
|
"dayRangeStart": "CalendarRange-module_dayRangeStart__TwdDT",
|
|
6
6
|
"dayRangeEnd": "CalendarRange-module_dayRangeEnd__y6dEB",
|
|
7
7
|
"dayRangeMiddle": "CalendarRange-module_dayRangeMiddle__SybKY",
|
|
8
|
-
"hidden": "CalendarRange-module_hidden__D47kb"
|
|
8
|
+
"hidden": "CalendarRange-module_hidden__D47kb",
|
|
9
|
+
"chevronIcon": "CalendarRange-module_chevronIcon__ULJzd"
|
|
9
10
|
};
|
|
10
11
|
export { styles as default };
|
|
@@ -18,7 +18,9 @@ const CalendarSingle = /*#__PURE__*/function () {
|
|
|
18
18
|
weekStartsOn = _a.weekStartsOn,
|
|
19
19
|
_b = _a.locale,
|
|
20
20
|
locale = _b === void 0 ? enAU : _b,
|
|
21
|
-
|
|
21
|
+
_c = _a.components,
|
|
22
|
+
components = _c === void 0 ? {} : _c,
|
|
23
|
+
restProps = __rest(_a, ["id", "onMount", "classNameOverride", "selected", "defaultMonth", "weekStartsOn", "locale", "components"]);
|
|
22
24
|
var calendarRef = useRef(null);
|
|
23
25
|
useEffect(function () {
|
|
24
26
|
if (calendarRef.current) onMount === null || onMount === void 0 ? void 0 : onMount(calendarRef.current);
|
|
@@ -41,22 +43,24 @@ const CalendarSingle = /*#__PURE__*/function () {
|
|
|
41
43
|
defaultMonth: selectedMonth,
|
|
42
44
|
weekStartsOn: isValidWeekStartsOn(weekStartsOn) ? weekStartsOn : undefined,
|
|
43
45
|
classNames: classNames,
|
|
44
|
-
components: {
|
|
46
|
+
components: __assign({
|
|
45
47
|
Chevron: function (props) {
|
|
46
48
|
if (props.orientation === 'left') {
|
|
47
49
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
48
50
|
name: "arrow_back",
|
|
49
51
|
isPresentational: true,
|
|
50
|
-
shouldMirrorInRTL: true
|
|
52
|
+
shouldMirrorInRTL: true,
|
|
53
|
+
className: styles.chevronIcon
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
54
57
|
name: "arrow_forward",
|
|
55
58
|
isPresentational: true,
|
|
56
|
-
shouldMirrorInRTL: true
|
|
59
|
+
shouldMirrorInRTL: true,
|
|
60
|
+
className: styles.chevronIcon
|
|
57
61
|
});
|
|
58
62
|
}
|
|
59
|
-
},
|
|
63
|
+
}, components),
|
|
60
64
|
locale: locale
|
|
61
65
|
}, restProps)));
|
|
62
66
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var styles = {
|
|
2
2
|
"nav": "CalendarSingle-module_nav__wSVua",
|
|
3
|
-
"navButtonNext": "CalendarSingle-module_navButtonNext__-GrZx"
|
|
3
|
+
"navButtonNext": "CalendarSingle-module_navButtonNext__-GrZx",
|
|
4
|
+
"chevronIcon": "CalendarSingle-module_chevronIcon__0PRnR"
|
|
4
5
|
};
|
|
5
6
|
export { styles as default };
|
|
@@ -45,13 +45,15 @@ const LegacyCalendarRange = /*#__PURE__*/function () {
|
|
|
45
45
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
46
46
|
name: "arrow_back",
|
|
47
47
|
isPresentational: true,
|
|
48
|
-
shouldMirrorInRTL: true
|
|
48
|
+
shouldMirrorInRTL: true,
|
|
49
|
+
className: styles.chevronIcon
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
return /*#__PURE__*/React.createElement(Icon, {
|
|
52
53
|
name: "arrow_forward",
|
|
53
54
|
isPresentational: true,
|
|
54
|
-
shouldMirrorInRTL: true
|
|
55
|
+
shouldMirrorInRTL: true,
|
|
56
|
+
className: styles.chevronIcon
|
|
55
57
|
});
|
|
56
58
|
}
|
|
57
59
|
},
|
|
@@ -2,6 +2,7 @@ var styles = {
|
|
|
2
2
|
"nav": "LegacyCalendarRange-module_nav__DsZpy",
|
|
3
3
|
"dayRangeStart": "LegacyCalendarRange-module_dayRangeStart__vRr5P",
|
|
4
4
|
"dayRangeEnd": "LegacyCalendarRange-module_dayRangeEnd__PfuWy",
|
|
5
|
-
"dayRangeMiddle": "LegacyCalendarRange-module_dayRangeMiddle__M27gR"
|
|
5
|
+
"dayRangeMiddle": "LegacyCalendarRange-module_dayRangeMiddle__M27gR",
|
|
6
|
+
"chevronIcon": "LegacyCalendarRange-module_chevronIcon__Q6pOJ"
|
|
6
7
|
};
|
|
7
8
|
export { styles as default };
|
|
@@ -9,6 +9,7 @@ import '../Loading/LoadingParagraph/LoadingParagraph.mjs';
|
|
|
9
9
|
import '../Loading/LoadingSpinner/LoadingSpinner.mjs';
|
|
10
10
|
import '../VisuallyHidden/VisuallyHidden.mjs';
|
|
11
11
|
import { ButtonContent } from '../Button/subcomponents/ButtonContent/ButtonContent.mjs';
|
|
12
|
+
import 'use-debounce';
|
|
12
13
|
import { useReversedColors } from '../utils/ReversedColors/ReversedColors.mjs';
|
|
13
14
|
import { mergeClassNames } from '../utils/mergeClassNames.mjs';
|
|
14
15
|
import buttonStyles from '../Button/Button.module.css.mjs';
|
|
@@ -2,6 +2,7 @@ import { __rest, __assign } from 'tslib';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { useMediaQueries } from '../utils/useMediaQueries.mjs';
|
|
5
|
+
import 'use-debounce';
|
|
5
6
|
import '../utils/ReversedColors/ReversedColors.mjs';
|
|
6
7
|
import { DirectionalLink } from './subcomponents/DirectionalLink/DirectionalLink.mjs';
|
|
7
8
|
import { PaginationLink } from './subcomponents/PaginationLink/PaginationLink.mjs';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var styles = {
|
|
2
2
|
"titleBlock": "TitleBlock-module_titleBlock__7jxn3",
|
|
3
|
+
"lightVariant": "TitleBlock-module_lightVariant__1EeLV",
|
|
3
4
|
"educationVariant": "TitleBlock-module_educationVariant__YvpWa",
|
|
4
5
|
"adminVariant": "TitleBlock-module_adminVariant__s95nS",
|
|
5
6
|
"titleRow": "TitleBlock-module_titleRow__Ifqiu",
|
|
@@ -2,7 +2,7 @@ import { __spreadArray, __assign } from 'tslib';
|
|
|
2
2
|
var isMenuGroupNotButton = function (value) {
|
|
3
3
|
return 'menuItems' in value;
|
|
4
4
|
};
|
|
5
|
-
var NON_REVERSED_VARIANTS = ['education', 'admin'];
|
|
5
|
+
var NON_REVERSED_VARIANTS = ['light', 'education', 'admin'];
|
|
6
6
|
var isReversed = function (variant) {
|
|
7
7
|
// The default variant (no variant prop) is reversed (dark background)
|
|
8
8
|
if (variant === undefined) return true;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __assign } from 'tslib';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { OverlayArrow as OverlayArrow$1 } from 'react-aria-components';
|
|
4
|
+
import 'use-debounce';
|
|
4
5
|
import { useReversedColors } from '../utils/ReversedColors/ReversedColors.mjs';
|
|
5
6
|
import { mergeClassNames } from '../utils/mergeClassNames.mjs';
|
|
6
7
|
import styles from './OverlayArrow.module.scss.mjs';
|
|
@@ -3,6 +3,7 @@ import React, { forwardRef, useContext, useState, useLayoutEffect } from 'react'
|
|
|
3
3
|
import { useContextProps, TooltipContext, TooltipTriggerStateContext, Tooltip as Tooltip$1 } from 'react-aria-components';
|
|
4
4
|
export { TooltipContext } from 'react-aria-components';
|
|
5
5
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.mjs';
|
|
6
|
+
import 'use-debounce';
|
|
6
7
|
import { useReversedColors } from '../utils/ReversedColors/ReversedColors.mjs';
|
|
7
8
|
import { mergeClassNames } from '../utils/mergeClassNames.mjs';
|
|
8
9
|
import { OverlayArrow } from './OverlayArrow.mjs';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
2
|
+
import { useDebouncedCallback } from 'use-debounce';
|
|
3
|
+
var DEFAULT_DEBOUNCE_MS = 1000;
|
|
4
|
+
/**
|
|
5
|
+
* Tailwind CSS default container query breakpoints in pixels
|
|
6
|
+
* These match the default ranges from Tailwind CSS documentation
|
|
7
|
+
* https://tailwindcss.com/docs/responsive-design#container-size-reference
|
|
8
|
+
*/
|
|
9
|
+
var DEFAULT_BREAKPOINTS = {
|
|
10
|
+
'3xs': 256,
|
|
11
|
+
'2xs': 288,
|
|
12
|
+
'xs': 320,
|
|
13
|
+
'sm': 384,
|
|
14
|
+
'md': 448,
|
|
15
|
+
'lg': 512,
|
|
16
|
+
'xl': 576,
|
|
17
|
+
'2xl': 672,
|
|
18
|
+
'3xl': 768,
|
|
19
|
+
'4xl': 896,
|
|
20
|
+
'5xl': 1024,
|
|
21
|
+
'6xl': 1152,
|
|
22
|
+
'7xl': 1280
|
|
23
|
+
};
|
|
24
|
+
var useContainerQueries = function () {
|
|
25
|
+
var isClient = typeof window !== 'undefined';
|
|
26
|
+
var _a = useState(0),
|
|
27
|
+
containerWidth = _a[0],
|
|
28
|
+
setContainerWidth = _a[1];
|
|
29
|
+
var resizeObserverRef = useRef(null);
|
|
30
|
+
var debouncedSetContainerWidth = useDebouncedCallback(function (width) {
|
|
31
|
+
setContainerWidth(width);
|
|
32
|
+
}, DEFAULT_DEBOUNCE_MS);
|
|
33
|
+
var containerRef = useCallback(function (node) {
|
|
34
|
+
// Skip if SSR
|
|
35
|
+
if (!isClient) return;
|
|
36
|
+
// Cleanup previous observer
|
|
37
|
+
if (resizeObserverRef.current) {
|
|
38
|
+
resizeObserverRef.current.disconnect();
|
|
39
|
+
resizeObserverRef.current = null;
|
|
40
|
+
}
|
|
41
|
+
if (node) {
|
|
42
|
+
// Create new ResizeObserver
|
|
43
|
+
resizeObserverRef.current = new ResizeObserver(function (entries) {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
46
|
+
var entry = entries_1[_i];
|
|
47
|
+
// Use borderBoxSize for more accurate measurements
|
|
48
|
+
var width_1 = (_c = (_b = (_a = entry.borderBoxSize) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.inlineSize) !== null && _c !== void 0 ? _c : entry.contentRect.width;
|
|
49
|
+
debouncedSetContainerWidth(width_1);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
resizeObserverRef.current.observe(node);
|
|
53
|
+
// Set initial width immediately (no debounce for initial render)
|
|
54
|
+
var width = node.getBoundingClientRect().width;
|
|
55
|
+
setContainerWidth(width);
|
|
56
|
+
}
|
|
57
|
+
}, [debouncedSetContainerWidth, isClient]);
|
|
58
|
+
useEffect(function () {
|
|
59
|
+
return function () {
|
|
60
|
+
if (resizeObserverRef.current) {
|
|
61
|
+
resizeObserverRef.current.disconnect();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}, []);
|
|
65
|
+
var queries = useMemo(function () {
|
|
66
|
+
return {
|
|
67
|
+
is3xsOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['3xs'],
|
|
68
|
+
is2xsOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['2xs'],
|
|
69
|
+
isXsOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.xs,
|
|
70
|
+
isSmOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.sm,
|
|
71
|
+
isMdOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.md,
|
|
72
|
+
isLgOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.lg,
|
|
73
|
+
isXlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS.xl,
|
|
74
|
+
is2xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['2xl'],
|
|
75
|
+
is3xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['3xl'],
|
|
76
|
+
is4xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['4xl'],
|
|
77
|
+
is5xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['5xl'],
|
|
78
|
+
is6xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['6xl'],
|
|
79
|
+
is7xlOrLarger: containerWidth >= DEFAULT_BREAKPOINTS['7xl']
|
|
80
|
+
};
|
|
81
|
+
}, [containerWidth]);
|
|
82
|
+
return {
|
|
83
|
+
containerRef: containerRef,
|
|
84
|
+
queries: queries
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export { useContainerQueries };
|