@vodafone_de/brix-components 9.0.3 → 9.0.5
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/components/BottomBar/props.d.ts +1 -1
- package/dist/components/ButtonGroup/index.js +4 -4
- package/dist/components/ButtonGroup/props.d.ts +2 -2
- package/dist/components/ButtonGroup/validate.d.ts +2 -2
- package/dist/components/Calendar/index.js +303 -70
- package/dist/components/CheckboxGroup/index.js +1 -1
- package/dist/components/Collapsible/index.js +18 -4
- package/dist/components/Collapsible/props.d.ts +5 -0
- package/dist/components/Collapsible/styled.d.ts +1 -1
- package/dist/components/ColorSwatchGroup/index.js +1 -1
- package/dist/components/EnergySnippet/index.js +1 -1
- package/dist/components/Flex/index.js +5 -2
- package/dist/components/Flex/props.d.ts +11 -3
- package/dist/components/Flex/stories/alignCenterArgs.d.ts +2 -0
- package/dist/components/Flex/stories/alignEndArgs.d.ts +2 -0
- package/dist/components/Flex/stories/alignStartArgs.d.ts +2 -0
- package/dist/components/Flex/styled.d.ts +3 -2
- package/dist/components/ImageHeader/index.js +1 -1
- package/dist/components/MediaText/index.js +2 -2
- package/dist/components/SuggestInput/index.js +5 -2
- package/dist/components/Tray/index.js +1 -1
- package/dist/contentful/live-preview-inspector/index.js +1 -1
- package/dist/contentful/live-preview-renderer/index.js +1 -1
- package/dist/contentful/renderer/index.js +1 -1
- package/dist/{index-ClAH0TNC.js → index-C0tryPFA.js} +1 -1
- package/dist/index.js +8 -5
- package/dist/{mapContentToComponents-C_O2rRrX.js → mapContentToComponents-CL3WF8Js.js} +2 -2
- package/dist/{styled-BxkvYuWW.js → styled-KWWOgO_h.js} +22 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { Theme } from 'storybook/
|
|
2
|
+
import { Theme } from 'storybook/theming';
|
|
3
3
|
import { PatternProps } from '../../foundations/PatternProps';
|
|
4
4
|
export interface BottomBarProps extends Omit<PatternProps, 'bottomSpacing'>, HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
/**
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import Button from "../Button/index.js";
|
|
4
4
|
import Flex from "../Flex/index.js";
|
|
5
|
-
import { b as flexJustifyStart, c as flexJustifyEnd, d as flexJustifyCenter, e as flexJustifyBetween, f as flexOrientationHorizontal, a as flexOrientationVertical } from "../../styled-
|
|
5
|
+
import { b as flexJustifyStart, c as flexJustifyEnd, d as flexJustifyCenter, e as flexJustifyBetween, f as flexOrientationHorizontal, a as flexOrientationVertical } from "../../styled-KWWOgO_h.js";
|
|
6
6
|
import FlexItem from "../FlexItem/index.js";
|
|
7
7
|
import { b as spacingSm, s as spacingMd } from "../../Spacing-8v6hcO2x.js";
|
|
8
8
|
import { useViewport } from "../../hooks/useViewport/index.js";
|
|
9
9
|
import { e as validateButtonProps, v as validateButtonAsLinkProps } from "../../validate-Dlzxlfzp.js";
|
|
10
10
|
import { i as isObject, h as hasMatchingComponentName } from "../../isObject-BYBrvoVW.js";
|
|
11
11
|
import { i as isBottomSpacing } from "../../isBottomSpacing-BxfreCZU.js";
|
|
12
|
-
const
|
|
12
|
+
const flexJustifyBehaviours = [flexJustifyStart, flexJustifyEnd, flexJustifyCenter, flexJustifyBetween];
|
|
13
13
|
const flexOrientations = [flexOrientationHorizontal, flexOrientationVertical];
|
|
14
14
|
const validateButtonGroupProps = (props) => {
|
|
15
15
|
if (!isObject(props)) {
|
|
@@ -29,7 +29,7 @@ const validateButtonGroupProps = (props) => {
|
|
|
29
29
|
return false;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
if (buttonGroupProps.justifyHorizontal !== void 0 && !
|
|
32
|
+
if (buttonGroupProps.justifyHorizontal !== void 0 && !flexJustifyBehaviours.includes(buttonGroupProps.justifyHorizontal)) {
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
35
|
if (buttonGroupProps.orientation !== void 0 && !flexOrientations.includes(buttonGroupProps.orientation)) {
|
|
@@ -71,7 +71,7 @@ const ButtonGroup = ({
|
|
|
71
71
|
};
|
|
72
72
|
export {
|
|
73
73
|
ButtonGroup as default,
|
|
74
|
-
|
|
74
|
+
flexJustifyBehaviours,
|
|
75
75
|
flexOrientations,
|
|
76
76
|
isButtonGroupProps,
|
|
77
77
|
validateButtonGroupProps
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { ButtonProps } from '../Button/props';
|
|
3
3
|
import { ButtonAsLinkProps } from '../ButtonAsLink/props';
|
|
4
|
-
import {
|
|
4
|
+
import { FlexJustifyBehaviour, FlexOrientation } from '../Flex/props';
|
|
5
5
|
import { PatternProps } from '../../foundations/PatternProps';
|
|
6
6
|
export interface ButtonGroupProps extends PatternProps, HTMLAttributes<HTMLDivElement> {
|
|
7
7
|
/**
|
|
@@ -13,7 +13,7 @@ export interface ButtonGroupProps extends PatternProps, HTMLAttributes<HTMLDivEl
|
|
|
13
13
|
* passed to flex as justify if viewport is tablet or larger
|
|
14
14
|
* mobile is always rendered with justify-start
|
|
15
15
|
*/
|
|
16
|
-
justifyHorizontal?:
|
|
16
|
+
justifyHorizontal?: FlexJustifyBehaviour;
|
|
17
17
|
/**
|
|
18
18
|
* Accepts Buttons and ButtonsAsLinks as children to render in the group
|
|
19
19
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FlexJustifyBehaviour, FlexOrientation } from '../Flex/props';
|
|
2
2
|
import { ButtonGroupProps } from './props';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const flexJustifyBehaviours: FlexJustifyBehaviour[];
|
|
4
4
|
export declare const flexOrientations: FlexOrientation[];
|
|
5
5
|
export declare const validateButtonGroupProps: (props: unknown) => props is ButtonGroupProps;
|
|
6
6
|
export declare const isButtonGroupProps: (props: unknown) => props is ButtonGroupProps;
|
|
@@ -759,7 +759,7 @@ const match$1 = {
|
|
|
759
759
|
defaultParseWidth: "any"
|
|
760
760
|
})
|
|
761
761
|
};
|
|
762
|
-
const enUS = {
|
|
762
|
+
const enUS$1 = {
|
|
763
763
|
code: "en-US",
|
|
764
764
|
formatDistance: formatDistance$1,
|
|
765
765
|
formatLong: formatLong$1,
|
|
@@ -1606,7 +1606,7 @@ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
|
1606
1606
|
function format(date, formatStr, options) {
|
|
1607
1607
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1608
1608
|
const defaultOptions2 = getDefaultOptions();
|
|
1609
|
-
const locale = (options == null ? void 0 : options.locale) ?? defaultOptions2.locale ?? enUS;
|
|
1609
|
+
const locale = (options == null ? void 0 : options.locale) ?? defaultOptions2.locale ?? enUS$1;
|
|
1610
1610
|
const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1;
|
|
1611
1611
|
const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_f = (_e = options == null ? void 0 : options.locale) == null ? void 0 : _e.options) == null ? void 0 : _f.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_h = (_g = defaultOptions2.locale) == null ? void 0 : _g.options) == null ? void 0 : _h.weekStartsOn) ?? 0;
|
|
1612
1612
|
const originalDate = toDate(date, options == null ? void 0 : options.in);
|
|
@@ -2477,6 +2477,63 @@ function endOfBroadcastWeek(date, dateLib) {
|
|
|
2477
2477
|
const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);
|
|
2478
2478
|
return endDate;
|
|
2479
2479
|
}
|
|
2480
|
+
const enUS = {
|
|
2481
|
+
...enUS$1,
|
|
2482
|
+
labels: {
|
|
2483
|
+
labelDayButton: (date, modifiers, options, dateLib) => {
|
|
2484
|
+
let formatDate;
|
|
2485
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
2486
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
2487
|
+
} else {
|
|
2488
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
2489
|
+
}
|
|
2490
|
+
let label = formatDate(date, "PPPP");
|
|
2491
|
+
if (modifiers.today)
|
|
2492
|
+
label = `Today, ${label}`;
|
|
2493
|
+
if (modifiers.selected)
|
|
2494
|
+
label = `${label}, selected`;
|
|
2495
|
+
return label;
|
|
2496
|
+
},
|
|
2497
|
+
labelMonthDropdown: "Choose the Month",
|
|
2498
|
+
labelNext: "Go to the Next Month",
|
|
2499
|
+
labelPrevious: "Go to the Previous Month",
|
|
2500
|
+
labelWeekNumber: (weekNumber) => `Week ${weekNumber}`,
|
|
2501
|
+
labelYearDropdown: "Choose the Year",
|
|
2502
|
+
labelGrid: (date, options, dateLib) => {
|
|
2503
|
+
let formatDate;
|
|
2504
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
2505
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
2506
|
+
} else {
|
|
2507
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
2508
|
+
}
|
|
2509
|
+
return formatDate(date, "LLLL yyyy");
|
|
2510
|
+
},
|
|
2511
|
+
labelGridcell: (date, modifiers, options, dateLib) => {
|
|
2512
|
+
let formatDate;
|
|
2513
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
2514
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
2515
|
+
} else {
|
|
2516
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
2517
|
+
}
|
|
2518
|
+
let label = formatDate(date, "PPPP");
|
|
2519
|
+
if (modifiers == null ? void 0 : modifiers.today) {
|
|
2520
|
+
label = `Today, ${label}`;
|
|
2521
|
+
}
|
|
2522
|
+
return label;
|
|
2523
|
+
},
|
|
2524
|
+
labelNav: "Navigation bar",
|
|
2525
|
+
labelWeekNumberHeader: "Week Number",
|
|
2526
|
+
labelWeekday: (date, options, dateLib) => {
|
|
2527
|
+
let formatDate;
|
|
2528
|
+
if (dateLib && typeof dateLib.format === "function") {
|
|
2529
|
+
formatDate = dateLib.format.bind(dateLib);
|
|
2530
|
+
} else {
|
|
2531
|
+
formatDate = (d, pattern) => format(d, pattern, { locale: enUS$1, ...options });
|
|
2532
|
+
}
|
|
2533
|
+
return formatDate(date, "cccc");
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
};
|
|
2480
2537
|
class DateLib {
|
|
2481
2538
|
/**
|
|
2482
2539
|
* Creates an instance of `DateLib`.
|
|
@@ -3073,7 +3130,7 @@ function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
|
3073
3130
|
return isSameDay2(date, matcher);
|
|
3074
3131
|
}
|
|
3075
3132
|
if (isDatesArray(matcher, dateLib)) {
|
|
3076
|
-
return matcher.
|
|
3133
|
+
return matcher.some((matcherDate) => isSameDay2(date, matcherDate));
|
|
3077
3134
|
}
|
|
3078
3135
|
if (isDateRange$1(matcher)) {
|
|
3079
3136
|
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
@@ -3277,60 +3334,6 @@ function getFormatters(customFormatters) {
|
|
|
3277
3334
|
...customFormatters
|
|
3278
3335
|
};
|
|
3279
3336
|
}
|
|
3280
|
-
function getMonthOptions(displayMonth, navStart, navEnd, formatters2, dateLib) {
|
|
3281
|
-
const { startOfMonth: startOfMonth2, startOfYear: startOfYear2, endOfYear: endOfYear2, eachMonthOfInterval: eachMonthOfInterval2, getMonth: getMonth2 } = dateLib;
|
|
3282
|
-
const months = eachMonthOfInterval2({
|
|
3283
|
-
start: startOfYear2(displayMonth),
|
|
3284
|
-
end: endOfYear2(displayMonth)
|
|
3285
|
-
});
|
|
3286
|
-
const options = months.map((month) => {
|
|
3287
|
-
const label = formatters2.formatMonthDropdown(month, dateLib);
|
|
3288
|
-
const value = getMonth2(month);
|
|
3289
|
-
const disabled = navStart && month < startOfMonth2(navStart) || navEnd && month > startOfMonth2(navEnd) || false;
|
|
3290
|
-
return { value, label, disabled };
|
|
3291
|
-
});
|
|
3292
|
-
return options;
|
|
3293
|
-
}
|
|
3294
|
-
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
3295
|
-
let style = { ...styles == null ? void 0 : styles[UI.Day] };
|
|
3296
|
-
Object.entries(dayModifiers).filter(([, active]) => active === true).forEach(([modifier]) => {
|
|
3297
|
-
style = {
|
|
3298
|
-
...style,
|
|
3299
|
-
...modifiersStyles == null ? void 0 : modifiersStyles[modifier]
|
|
3300
|
-
};
|
|
3301
|
-
});
|
|
3302
|
-
return style;
|
|
3303
|
-
}
|
|
3304
|
-
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
3305
|
-
const referenceToday = today ?? dateLib.today();
|
|
3306
|
-
const start = broadcastCalendar ? dateLib.startOfBroadcastWeek(referenceToday, dateLib) : ISOWeek ? dateLib.startOfISOWeek(referenceToday) : dateLib.startOfWeek(referenceToday);
|
|
3307
|
-
const days = [];
|
|
3308
|
-
for (let i = 0; i < 7; i++) {
|
|
3309
|
-
const day = dateLib.addDays(start, i);
|
|
3310
|
-
days.push(day);
|
|
3311
|
-
}
|
|
3312
|
-
return days;
|
|
3313
|
-
}
|
|
3314
|
-
function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false) {
|
|
3315
|
-
if (!navStart)
|
|
3316
|
-
return void 0;
|
|
3317
|
-
if (!navEnd)
|
|
3318
|
-
return void 0;
|
|
3319
|
-
const { startOfYear: startOfYear2, endOfYear: endOfYear2, eachYearOfInterval: eachYearOfInterval2, getYear: getYear2 } = dateLib;
|
|
3320
|
-
const firstNavYear = startOfYear2(navStart);
|
|
3321
|
-
const lastNavYear = endOfYear2(navEnd);
|
|
3322
|
-
const years = eachYearOfInterval2({ start: firstNavYear, end: lastNavYear });
|
|
3323
|
-
if (reverse)
|
|
3324
|
-
years.reverse();
|
|
3325
|
-
return years.map((year) => {
|
|
3326
|
-
const label = formatters2.formatYearDropdown(year, dateLib);
|
|
3327
|
-
return {
|
|
3328
|
-
value: getYear2(year),
|
|
3329
|
-
label,
|
|
3330
|
-
disabled: false
|
|
3331
|
-
};
|
|
3332
|
-
});
|
|
3333
|
-
}
|
|
3334
3337
|
function labelDayButton(date, modifiers, options, dateLib) {
|
|
3335
3338
|
let label = (dateLib ?? new DateLib(options)).format(date, "PPPP");
|
|
3336
3339
|
if (modifiers.today)
|
|
@@ -3358,8 +3361,9 @@ function labelMonthDropdown(_options) {
|
|
|
3358
3361
|
function labelNav() {
|
|
3359
3362
|
return "";
|
|
3360
3363
|
}
|
|
3361
|
-
|
|
3362
|
-
|
|
3364
|
+
const defaultLabel = "Go to the Next Month";
|
|
3365
|
+
function labelNext(_month, _options) {
|
|
3366
|
+
return defaultLabel;
|
|
3363
3367
|
}
|
|
3364
3368
|
function labelPrevious(_month) {
|
|
3365
3369
|
return "Go to the Previous Month";
|
|
@@ -3392,6 +3396,225 @@ const defaultLabels = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin
|
|
|
3392
3396
|
labelWeekday,
|
|
3393
3397
|
labelYearDropdown
|
|
3394
3398
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3399
|
+
const resolveLabel = (defaultLabel2, customLabel, localeLabel) => {
|
|
3400
|
+
if (customLabel)
|
|
3401
|
+
return customLabel;
|
|
3402
|
+
if (localeLabel) {
|
|
3403
|
+
return typeof localeLabel === "function" ? localeLabel : (..._args) => localeLabel;
|
|
3404
|
+
}
|
|
3405
|
+
return defaultLabel2;
|
|
3406
|
+
};
|
|
3407
|
+
function getLabels(customLabels, options) {
|
|
3408
|
+
var _a;
|
|
3409
|
+
const localeLabels = ((_a = options.locale) == null ? void 0 : _a.labels) ?? {};
|
|
3410
|
+
return {
|
|
3411
|
+
...defaultLabels,
|
|
3412
|
+
...customLabels ?? {},
|
|
3413
|
+
labelDayButton: resolveLabel(labelDayButton, customLabels == null ? void 0 : customLabels.labelDayButton, localeLabels.labelDayButton),
|
|
3414
|
+
labelMonthDropdown: resolveLabel(labelMonthDropdown, customLabels == null ? void 0 : customLabels.labelMonthDropdown, localeLabels.labelMonthDropdown),
|
|
3415
|
+
labelNext: resolveLabel(labelNext, customLabels == null ? void 0 : customLabels.labelNext, localeLabels.labelNext),
|
|
3416
|
+
labelPrevious: resolveLabel(labelPrevious, customLabels == null ? void 0 : customLabels.labelPrevious, localeLabels.labelPrevious),
|
|
3417
|
+
labelWeekNumber: resolveLabel(labelWeekNumber, customLabels == null ? void 0 : customLabels.labelWeekNumber, localeLabels.labelWeekNumber),
|
|
3418
|
+
labelYearDropdown: resolveLabel(labelYearDropdown, customLabels == null ? void 0 : customLabels.labelYearDropdown, localeLabels.labelYearDropdown),
|
|
3419
|
+
labelGrid: resolveLabel(labelGrid, customLabels == null ? void 0 : customLabels.labelGrid, localeLabels.labelGrid),
|
|
3420
|
+
labelGridcell: resolveLabel(labelGridcell, customLabels == null ? void 0 : customLabels.labelGridcell, localeLabels.labelGridcell),
|
|
3421
|
+
labelNav: resolveLabel(labelNav, customLabels == null ? void 0 : customLabels.labelNav, localeLabels.labelNav),
|
|
3422
|
+
labelWeekNumberHeader: resolveLabel(labelWeekNumberHeader, customLabels == null ? void 0 : customLabels.labelWeekNumberHeader, localeLabels.labelWeekNumberHeader),
|
|
3423
|
+
labelWeekday: resolveLabel(labelWeekday, customLabels == null ? void 0 : customLabels.labelWeekday, localeLabels.labelWeekday)
|
|
3424
|
+
};
|
|
3425
|
+
}
|
|
3426
|
+
function getMonthOptions(displayMonth, navStart, navEnd, formatters2, dateLib) {
|
|
3427
|
+
const { startOfMonth: startOfMonth2, startOfYear: startOfYear2, endOfYear: endOfYear2, eachMonthOfInterval: eachMonthOfInterval2, getMonth: getMonth2 } = dateLib;
|
|
3428
|
+
const months = eachMonthOfInterval2({
|
|
3429
|
+
start: startOfYear2(displayMonth),
|
|
3430
|
+
end: endOfYear2(displayMonth)
|
|
3431
|
+
});
|
|
3432
|
+
const options = months.map((month) => {
|
|
3433
|
+
const label = formatters2.formatMonthDropdown(month, dateLib);
|
|
3434
|
+
const value = getMonth2(month);
|
|
3435
|
+
const disabled = navStart && month < startOfMonth2(navStart) || navEnd && month > startOfMonth2(navEnd) || false;
|
|
3436
|
+
return { value, label, disabled };
|
|
3437
|
+
});
|
|
3438
|
+
return options;
|
|
3439
|
+
}
|
|
3440
|
+
function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {
|
|
3441
|
+
let style = { ...styles == null ? void 0 : styles[UI.Day] };
|
|
3442
|
+
Object.entries(dayModifiers).filter(([, active]) => active === true).forEach(([modifier]) => {
|
|
3443
|
+
style = {
|
|
3444
|
+
...style,
|
|
3445
|
+
...modifiersStyles == null ? void 0 : modifiersStyles[modifier]
|
|
3446
|
+
};
|
|
3447
|
+
});
|
|
3448
|
+
return style;
|
|
3449
|
+
}
|
|
3450
|
+
function getWeekdays(dateLib, ISOWeek, broadcastCalendar, today) {
|
|
3451
|
+
const referenceToday = today ?? dateLib.today();
|
|
3452
|
+
const start = broadcastCalendar ? dateLib.startOfBroadcastWeek(referenceToday, dateLib) : ISOWeek ? dateLib.startOfISOWeek(referenceToday) : dateLib.startOfWeek(referenceToday);
|
|
3453
|
+
const days = [];
|
|
3454
|
+
for (let i = 0; i < 7; i++) {
|
|
3455
|
+
const day = dateLib.addDays(start, i);
|
|
3456
|
+
days.push(day);
|
|
3457
|
+
}
|
|
3458
|
+
return days;
|
|
3459
|
+
}
|
|
3460
|
+
function getYearOptions(navStart, navEnd, formatters2, dateLib, reverse = false) {
|
|
3461
|
+
if (!navStart)
|
|
3462
|
+
return void 0;
|
|
3463
|
+
if (!navEnd)
|
|
3464
|
+
return void 0;
|
|
3465
|
+
const { startOfYear: startOfYear2, endOfYear: endOfYear2, eachYearOfInterval: eachYearOfInterval2, getYear: getYear2 } = dateLib;
|
|
3466
|
+
const firstNavYear = startOfYear2(navStart);
|
|
3467
|
+
const lastNavYear = endOfYear2(navEnd);
|
|
3468
|
+
const years = eachYearOfInterval2({ start: firstNavYear, end: lastNavYear });
|
|
3469
|
+
if (reverse)
|
|
3470
|
+
years.reverse();
|
|
3471
|
+
return years.map((year) => {
|
|
3472
|
+
const label = formatters2.formatYearDropdown(year, dateLib);
|
|
3473
|
+
return {
|
|
3474
|
+
value: getYear2(year),
|
|
3475
|
+
label,
|
|
3476
|
+
disabled: false
|
|
3477
|
+
};
|
|
3478
|
+
});
|
|
3479
|
+
}
|
|
3480
|
+
function createNoonOverrides(timeZone, options = {}) {
|
|
3481
|
+
var _a;
|
|
3482
|
+
const { weekStartsOn, locale } = options;
|
|
3483
|
+
const fallbackWeekStartsOn = weekStartsOn ?? ((_a = locale == null ? void 0 : locale.options) == null ? void 0 : _a.weekStartsOn) ?? 0;
|
|
3484
|
+
const toNoonTZDate = (date) => {
|
|
3485
|
+
const normalizedDate = typeof date === "number" || typeof date === "string" ? new Date(date) : date;
|
|
3486
|
+
return new TZDate(normalizedDate.getFullYear(), normalizedDate.getMonth(), normalizedDate.getDate(), 12, 0, 0, timeZone);
|
|
3487
|
+
};
|
|
3488
|
+
const toCalendarDate = (date) => {
|
|
3489
|
+
const zoned = toNoonTZDate(date);
|
|
3490
|
+
return new Date(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 0, 0, 0, 0);
|
|
3491
|
+
};
|
|
3492
|
+
return {
|
|
3493
|
+
today: () => {
|
|
3494
|
+
return toNoonTZDate(TZDate.tz(timeZone));
|
|
3495
|
+
},
|
|
3496
|
+
newDate: (year, monthIndex, date) => {
|
|
3497
|
+
return new TZDate(year, monthIndex, date, 12, 0, 0, timeZone);
|
|
3498
|
+
},
|
|
3499
|
+
startOfDay: (date) => {
|
|
3500
|
+
return toNoonTZDate(date);
|
|
3501
|
+
},
|
|
3502
|
+
startOfWeek: (date, options2) => {
|
|
3503
|
+
const base = toNoonTZDate(date);
|
|
3504
|
+
const weekStartsOnValue = (options2 == null ? void 0 : options2.weekStartsOn) ?? fallbackWeekStartsOn;
|
|
3505
|
+
const diff = (base.getDay() - weekStartsOnValue + 7) % 7;
|
|
3506
|
+
base.setDate(base.getDate() - diff);
|
|
3507
|
+
return base;
|
|
3508
|
+
},
|
|
3509
|
+
startOfISOWeek: (date) => {
|
|
3510
|
+
const base = toNoonTZDate(date);
|
|
3511
|
+
const diff = (base.getDay() - 1 + 7) % 7;
|
|
3512
|
+
base.setDate(base.getDate() - diff);
|
|
3513
|
+
return base;
|
|
3514
|
+
},
|
|
3515
|
+
startOfMonth: (date) => {
|
|
3516
|
+
const base = toNoonTZDate(date);
|
|
3517
|
+
base.setDate(1);
|
|
3518
|
+
return base;
|
|
3519
|
+
},
|
|
3520
|
+
startOfYear: (date) => {
|
|
3521
|
+
const base = toNoonTZDate(date);
|
|
3522
|
+
base.setMonth(0, 1);
|
|
3523
|
+
return base;
|
|
3524
|
+
},
|
|
3525
|
+
endOfWeek: (date, options2) => {
|
|
3526
|
+
const base = toNoonTZDate(date);
|
|
3527
|
+
const weekStartsOnValue = (options2 == null ? void 0 : options2.weekStartsOn) ?? fallbackWeekStartsOn;
|
|
3528
|
+
const endDow = (weekStartsOnValue + 6) % 7;
|
|
3529
|
+
const diff = (endDow - base.getDay() + 7) % 7;
|
|
3530
|
+
base.setDate(base.getDate() + diff);
|
|
3531
|
+
return base;
|
|
3532
|
+
},
|
|
3533
|
+
endOfISOWeek: (date) => {
|
|
3534
|
+
const base = toNoonTZDate(date);
|
|
3535
|
+
const diff = (7 - base.getDay()) % 7;
|
|
3536
|
+
base.setDate(base.getDate() + diff);
|
|
3537
|
+
return base;
|
|
3538
|
+
},
|
|
3539
|
+
endOfMonth: (date) => {
|
|
3540
|
+
const base = toNoonTZDate(date);
|
|
3541
|
+
base.setMonth(base.getMonth() + 1, 0);
|
|
3542
|
+
return base;
|
|
3543
|
+
},
|
|
3544
|
+
endOfYear: (date) => {
|
|
3545
|
+
const base = toNoonTZDate(date);
|
|
3546
|
+
base.setMonth(11, 31);
|
|
3547
|
+
return base;
|
|
3548
|
+
},
|
|
3549
|
+
eachMonthOfInterval: (interval) => {
|
|
3550
|
+
const start = toNoonTZDate(interval.start);
|
|
3551
|
+
const end = toNoonTZDate(interval.end);
|
|
3552
|
+
const result = [];
|
|
3553
|
+
const cursor = new TZDate(start.getFullYear(), start.getMonth(), 1, 12, 0, 0, timeZone);
|
|
3554
|
+
const endKey = end.getFullYear() * 12 + end.getMonth();
|
|
3555
|
+
while (cursor.getFullYear() * 12 + cursor.getMonth() <= endKey) {
|
|
3556
|
+
result.push(new TZDate(cursor, timeZone));
|
|
3557
|
+
cursor.setMonth(cursor.getMonth() + 1, 1);
|
|
3558
|
+
}
|
|
3559
|
+
return result;
|
|
3560
|
+
},
|
|
3561
|
+
// Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
|
|
3562
|
+
// mutate the same TZDate, and return it.
|
|
3563
|
+
addDays: (date, amount) => {
|
|
3564
|
+
const base = toNoonTZDate(date);
|
|
3565
|
+
base.setDate(base.getDate() + amount);
|
|
3566
|
+
return base;
|
|
3567
|
+
},
|
|
3568
|
+
addWeeks: (date, amount) => {
|
|
3569
|
+
const base = toNoonTZDate(date);
|
|
3570
|
+
base.setDate(base.getDate() + amount * 7);
|
|
3571
|
+
return base;
|
|
3572
|
+
},
|
|
3573
|
+
addMonths: (date, amount) => {
|
|
3574
|
+
const base = toNoonTZDate(date);
|
|
3575
|
+
base.setMonth(base.getMonth() + amount);
|
|
3576
|
+
return base;
|
|
3577
|
+
},
|
|
3578
|
+
addYears: (date, amount) => {
|
|
3579
|
+
const base = toNoonTZDate(date);
|
|
3580
|
+
base.setFullYear(base.getFullYear() + amount);
|
|
3581
|
+
return base;
|
|
3582
|
+
},
|
|
3583
|
+
eachYearOfInterval: (interval) => {
|
|
3584
|
+
const start = toNoonTZDate(interval.start);
|
|
3585
|
+
const end = toNoonTZDate(interval.end);
|
|
3586
|
+
const years = [];
|
|
3587
|
+
const cursor = new TZDate(start.getFullYear(), 0, 1, 12, 0, 0, timeZone);
|
|
3588
|
+
while (cursor.getFullYear() <= end.getFullYear()) {
|
|
3589
|
+
years.push(new TZDate(cursor, timeZone));
|
|
3590
|
+
cursor.setFullYear(cursor.getFullYear() + 1, 0, 1);
|
|
3591
|
+
}
|
|
3592
|
+
return years;
|
|
3593
|
+
},
|
|
3594
|
+
getWeek: (date, options2) => {
|
|
3595
|
+
var _a2;
|
|
3596
|
+
const base = toCalendarDate(date);
|
|
3597
|
+
return getWeek(base, {
|
|
3598
|
+
weekStartsOn: (options2 == null ? void 0 : options2.weekStartsOn) ?? fallbackWeekStartsOn,
|
|
3599
|
+
firstWeekContainsDate: (options2 == null ? void 0 : options2.firstWeekContainsDate) ?? ((_a2 = locale == null ? void 0 : locale.options) == null ? void 0 : _a2.firstWeekContainsDate) ?? 1
|
|
3600
|
+
});
|
|
3601
|
+
},
|
|
3602
|
+
getISOWeek: (date) => {
|
|
3603
|
+
const base = toCalendarDate(date);
|
|
3604
|
+
return getISOWeek(base);
|
|
3605
|
+
},
|
|
3606
|
+
differenceInCalendarDays: (dateLeft, dateRight) => {
|
|
3607
|
+
const left = toCalendarDate(dateLeft);
|
|
3608
|
+
const right = toCalendarDate(dateRight);
|
|
3609
|
+
return differenceInCalendarDays(left, right);
|
|
3610
|
+
},
|
|
3611
|
+
differenceInCalendarMonths: (dateLeft, dateRight) => {
|
|
3612
|
+
const left = toCalendarDate(dateLeft);
|
|
3613
|
+
const right = toCalendarDate(dateRight);
|
|
3614
|
+
return differenceInCalendarMonths(left, right);
|
|
3615
|
+
}
|
|
3616
|
+
};
|
|
3617
|
+
}
|
|
3395
3618
|
const asHtmlElement = (element) => {
|
|
3396
3619
|
if (element instanceof HTMLElement)
|
|
3397
3620
|
return element;
|
|
@@ -4119,15 +4342,18 @@ function toTimeZone(date, timeZone) {
|
|
|
4119
4342
|
}
|
|
4120
4343
|
return new TZDate(date, timeZone);
|
|
4121
4344
|
}
|
|
4122
|
-
function
|
|
4345
|
+
function toZoneNoon(date, timeZone, noonSafe) {
|
|
4346
|
+
return toTimeZone(date, timeZone);
|
|
4347
|
+
}
|
|
4348
|
+
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
4123
4349
|
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
4124
4350
|
return matcher;
|
|
4125
4351
|
}
|
|
4126
4352
|
if (matcher instanceof Date) {
|
|
4127
|
-
return
|
|
4353
|
+
return toZoneNoon(matcher, timeZone);
|
|
4128
4354
|
}
|
|
4129
4355
|
if (Array.isArray(matcher)) {
|
|
4130
|
-
return matcher.map((value) => value instanceof Date ?
|
|
4356
|
+
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone) : value);
|
|
4131
4357
|
}
|
|
4132
4358
|
if (isDateRange$1(matcher)) {
|
|
4133
4359
|
return {
|
|
@@ -4138,23 +4364,23 @@ function convertMatcher(matcher, timeZone) {
|
|
|
4138
4364
|
}
|
|
4139
4365
|
if (isDateInterval(matcher)) {
|
|
4140
4366
|
return {
|
|
4141
|
-
before:
|
|
4142
|
-
after:
|
|
4367
|
+
before: toZoneNoon(matcher.before, timeZone),
|
|
4368
|
+
after: toZoneNoon(matcher.after, timeZone)
|
|
4143
4369
|
};
|
|
4144
4370
|
}
|
|
4145
4371
|
if (isDateAfterType(matcher)) {
|
|
4146
4372
|
return {
|
|
4147
|
-
after:
|
|
4373
|
+
after: toZoneNoon(matcher.after, timeZone)
|
|
4148
4374
|
};
|
|
4149
4375
|
}
|
|
4150
4376
|
if (isDateBeforeType(matcher)) {
|
|
4151
4377
|
return {
|
|
4152
|
-
before:
|
|
4378
|
+
before: toZoneNoon(matcher.before, timeZone)
|
|
4153
4379
|
};
|
|
4154
4380
|
}
|
|
4155
4381
|
return matcher;
|
|
4156
4382
|
}
|
|
4157
|
-
function convertMatchersToTimeZone(matchers, timeZone) {
|
|
4383
|
+
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
4158
4384
|
if (!matchers) {
|
|
4159
4385
|
return matchers;
|
|
4160
4386
|
}
|
|
@@ -4214,20 +4440,26 @@ function DayPicker(initialProps) {
|
|
|
4214
4440
|
}
|
|
4215
4441
|
const { components: components2, formatters: formatters2, labels, dateLib, locale, classNames } = useMemo(() => {
|
|
4216
4442
|
const locale2 = { ...enUS, ...props.locale };
|
|
4443
|
+
const weekStartsOn = props.broadcastCalendar ? 1 : props.weekStartsOn;
|
|
4444
|
+
const noonOverrides = props.noonSafe && props.timeZone ? createNoonOverrides(props.timeZone, {
|
|
4445
|
+
weekStartsOn,
|
|
4446
|
+
locale: locale2
|
|
4447
|
+
}) : void 0;
|
|
4448
|
+
const overrides = props.dateLib && noonOverrides ? { ...noonOverrides, ...props.dateLib } : props.dateLib ?? noonOverrides;
|
|
4217
4449
|
const dateLib2 = new DateLib({
|
|
4218
4450
|
locale: locale2,
|
|
4219
|
-
weekStartsOn
|
|
4451
|
+
weekStartsOn,
|
|
4220
4452
|
firstWeekContainsDate: props.firstWeekContainsDate,
|
|
4221
4453
|
useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,
|
|
4222
4454
|
useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens,
|
|
4223
4455
|
timeZone: props.timeZone,
|
|
4224
4456
|
numerals: props.numerals
|
|
4225
|
-
},
|
|
4457
|
+
}, overrides);
|
|
4226
4458
|
return {
|
|
4227
4459
|
dateLib: dateLib2,
|
|
4228
4460
|
components: getComponents(props.components),
|
|
4229
4461
|
formatters: getFormatters(props.formatters),
|
|
4230
|
-
labels:
|
|
4462
|
+
labels: getLabels(props.labels, dateLib2.options),
|
|
4231
4463
|
locale: locale2,
|
|
4232
4464
|
classNames: { ...getDefaultClassNames(), ...props.classNames }
|
|
4233
4465
|
};
|
|
@@ -4241,6 +4473,7 @@ function DayPicker(initialProps) {
|
|
|
4241
4473
|
props.timeZone,
|
|
4242
4474
|
props.numerals,
|
|
4243
4475
|
props.dateLib,
|
|
4476
|
+
props.noonSafe,
|
|
4244
4477
|
props.components,
|
|
4245
4478
|
props.formatters,
|
|
4246
4479
|
props.labels,
|
|
@@ -5,7 +5,7 @@ import Checkbox from "../Checkbox/index.js";
|
|
|
5
5
|
import Fieldset from "../Fieldset/index.js";
|
|
6
6
|
import { g as spacingLg, s as spacingMd, c as spacingNone } from "../../Spacing-8v6hcO2x.js";
|
|
7
7
|
import styled from "styled-components";
|
|
8
|
-
import { F as FlexStyled } from "../../styled-
|
|
8
|
+
import { F as FlexStyled } from "../../styled-KWWOgO_h.js";
|
|
9
9
|
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
10
10
|
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
11
11
|
import { a as filterProps } from "../../filterProps-BJ5SpbnA.js";
|
|
@@ -47,9 +47,23 @@ const CollapsibleContentStyled = styled.div.withConfig({
|
|
|
47
47
|
displayName: "CollapsibleContentStyled",
|
|
48
48
|
componentId: "sc-12wf2lg-1"
|
|
49
49
|
})({
|
|
50
|
-
overflow: "hidden"
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
overflow: "hidden"
|
|
51
|
+
}, ({
|
|
52
|
+
innerTopSpacing = spacingNone
|
|
53
|
+
}) => {
|
|
54
|
+
return {
|
|
55
|
+
marginTop: getSpacing(innerTopSpacing)
|
|
56
|
+
};
|
|
57
|
+
}, ({
|
|
58
|
+
expanded,
|
|
59
|
+
innerTopSpacing = spacingNone
|
|
60
|
+
}) => {
|
|
61
|
+
return expanded ? {
|
|
62
|
+
padding: `${getBorderWidth(borderWidthFocus)}`,
|
|
63
|
+
marginLeft: `calc(${getBorderWidth(borderWidthFocus)} * -1)`,
|
|
64
|
+
marginBottom: `calc(${getBorderWidth(borderWidthFocus)} * -1)`,
|
|
65
|
+
marginTop: `calc(${getBorderWidth(borderWidthFocus)} * -1 + ${getSpacing(innerTopSpacing)})`
|
|
66
|
+
} : {};
|
|
53
67
|
});
|
|
54
68
|
const Collapsible = ({
|
|
55
69
|
expanded,
|
|
@@ -78,7 +92,7 @@ const Collapsible = ({
|
|
|
78
92
|
element.removeEventListener("transitionend", transitionEndHandler);
|
|
79
93
|
};
|
|
80
94
|
}, [ref]);
|
|
81
|
-
return /* @__PURE__ */ jsx(CollapsibleStyled, { ref, ...props, expanded, animated, children: /* @__PURE__ */ jsx(CollapsibleContentStyled, { children }) });
|
|
95
|
+
return /* @__PURE__ */ jsx(CollapsibleStyled, { ref, ...props, expanded, animated, children: /* @__PURE__ */ jsx(CollapsibleContentStyled, { expanded, innerTopSpacing: props.innerTopSpacing, children }) });
|
|
82
96
|
};
|
|
83
97
|
export {
|
|
84
98
|
Collapsible as default
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { PatternProps } from '../../foundations/PatternProps';
|
|
3
|
+
import { Spacing } from '../../foundations/types/Spacing';
|
|
3
4
|
export interface CollapsibleProps extends PatternProps, HTMLAttributes<HTMLDivElement> {
|
|
4
5
|
/**
|
|
5
6
|
* indicate if it's expaned or not
|
|
6
7
|
*/
|
|
7
8
|
expanded?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Defines a margin at the top of the content of the Collapsible
|
|
11
|
+
*/
|
|
12
|
+
innerTopSpacing?: Spacing;
|
|
8
13
|
/**
|
|
9
14
|
* set to false if no animation should be used
|
|
10
15
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CollapsibleProps } from './props';
|
|
2
2
|
export declare const CollapsibleStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, CollapsibleProps>> & string;
|
|
3
|
-
export declare const CollapsibleContentStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').
|
|
3
|
+
export declare const CollapsibleContentStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<CollapsibleProps, "expanded" | "innerTopSpacing">>> & string;
|
|
@@ -3,7 +3,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import ColorSwatch, { colorSwatchSizeSmall, colorSwatchSizes } from "../ColorSwatch/index.js";
|
|
4
4
|
import { s as spacingMd, f as spacing2Xs } from "../../Spacing-8v6hcO2x.js";
|
|
5
5
|
import styled from "styled-components";
|
|
6
|
-
import { F as FlexStyled } from "../../styled-
|
|
6
|
+
import { F as FlexStyled } from "../../styled-KWWOgO_h.js";
|
|
7
7
|
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
8
8
|
import { c as iconSizeMd } from "../../IconSize-AJp7xdJi.js";
|
|
9
9
|
import { a as filterProps } from "../../filterProps-BJ5SpbnA.js";
|
|
@@ -4,7 +4,7 @@ import Link from "../Link/index.js";
|
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import viewport from "../../foundations/media-query/viewport/index.js";
|
|
6
6
|
import { a as filterProps } from "../../filterProps-BJ5SpbnA.js";
|
|
7
|
-
import { F as FlexStyled } from "../../styled-
|
|
7
|
+
import { F as FlexStyled } from "../../styled-KWWOgO_h.js";
|
|
8
8
|
import UtilityLink from "../UtilityLink/index.js";
|
|
9
9
|
const letterPathMapping = {
|
|
10
10
|
A: "M46.99,29.398c0.118,0.365 0.186,0.649 0.22,0.86c0.025,0.211 -0.009,0.365 -0.118,0.47c-0.11,0.106 -0.296,0.171 -0.566,0.195c-0.269,0.024 -0.64,0.04 -1.113,0.04c-0.472,0 -0.877,0 -1.147,-0.024c-0.27,-0.024 -0.489,-0.049 -0.633,-0.089c-0.143,-0.049 -0.244,-0.106 -0.303,-0.187c-0.059,-0.081 -0.11,-0.186 -0.143,-0.316l-1.257,-3.916l-7.035,-0l-1.189,3.811c-0.042,0.138 -0.092,0.259 -0.151,0.357c-0.06,0.097 -0.161,0.17 -0.304,0.227c-0.143,0.056 -0.337,0.089 -0.591,0.113c-0.253,0.016 -0.59,0.033 -1.003,0.033c-0.447,-0 -0.793,-0.017 -1.046,-0.049c-0.253,-0.033 -0.422,-0.106 -0.523,-0.219c-0.093,-0.114 -0.126,-0.276 -0.101,-0.487c0.025,-0.21 0.101,-0.494 0.219,-0.843l5.778,-17.28c0.059,-0.17 0.126,-0.308 0.202,-0.413c0.076,-0.105 0.202,-0.186 0.371,-0.243c0.169,-0.057 0.405,-0.089 0.7,-0.106c0.295,-0.016 0.692,-0.024 1.189,-0.024c0.566,0 1.021,0 1.358,0.024c0.338,0.025 0.599,0.049 0.793,0.106c0.194,0.057 0.321,0.138 0.405,0.251c0.084,0.114 0.152,0.26 0.211,0.454l5.786,17.272l-0.009,-0.017Zm-8.594,-14.287l-0.017,-0l-2.648,8.279l5.313,-0l-2.648,-8.279Z",
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { F as FlexStyled } from "../../styled-
|
|
4
|
-
import { e, d, c, b, f, a } from "../../styled-
|
|
3
|
+
import { F as FlexStyled } from "../../styled-KWWOgO_h.js";
|
|
4
|
+
import { i, h, g, e, d, c, b, f, a } from "../../styled-KWWOgO_h.js";
|
|
5
5
|
const Flex = ({
|
|
6
6
|
children,
|
|
7
7
|
...props
|
|
8
8
|
}) => /* @__PURE__ */ jsx(FlexStyled, { ...props, children });
|
|
9
9
|
export {
|
|
10
10
|
Flex as default,
|
|
11
|
+
i as flexAlignCenter,
|
|
12
|
+
h as flexAlignEnd,
|
|
13
|
+
g as flexAlignStart,
|
|
11
14
|
e as flexJustifyBetween,
|
|
12
15
|
d as flexJustifyCenter,
|
|
13
16
|
c as flexJustifyEnd,
|
|
@@ -8,7 +8,11 @@ export declare const flexJustifyStart = "start";
|
|
|
8
8
|
export declare const flexJustifyEnd = "end";
|
|
9
9
|
export declare const flexJustifyCenter = "center";
|
|
10
10
|
export declare const flexJustifyBetween = "between";
|
|
11
|
-
export type
|
|
11
|
+
export type FlexJustifyBehaviour = typeof flexJustifyStart | typeof flexJustifyEnd | typeof flexJustifyCenter | typeof flexJustifyBetween;
|
|
12
|
+
export declare const flexAlignStart = "start";
|
|
13
|
+
export declare const flexAlignEnd = "end";
|
|
14
|
+
export declare const flexAlignCenter = "center";
|
|
15
|
+
export type FlexAlignBehaviour = typeof flexAlignStart | typeof flexAlignEnd | typeof flexAlignCenter;
|
|
12
16
|
export interface FlexProps extends PatternProps, HTMLAttributes<HTMLDivElement> {
|
|
13
17
|
children: ReactNode;
|
|
14
18
|
/**
|
|
@@ -16,9 +20,13 @@ export interface FlexProps extends PatternProps, HTMLAttributes<HTMLDivElement>
|
|
|
16
20
|
*/
|
|
17
21
|
orientation?: FlexOrientation;
|
|
18
22
|
/**
|
|
19
|
-
* Justify controls how the elements are distributed
|
|
23
|
+
* Justify controls how the elements are distributed along the primary axis (e.g. justify-content).
|
|
20
24
|
*/
|
|
21
|
-
justify?:
|
|
25
|
+
justify?: FlexJustifyBehaviour;
|
|
26
|
+
/**
|
|
27
|
+
* Controls how the elements are distributed along the secondary axis (e.g. align-items).
|
|
28
|
+
*/
|
|
29
|
+
alignItems?: FlexAlignBehaviour;
|
|
22
30
|
/**
|
|
23
31
|
* Spacing between items inside of the flex container.
|
|
24
32
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const translateToJustifyContent: (justify:
|
|
1
|
+
import { FlexAlignBehaviour, FlexJustifyBehaviour, FlexProps } from './props';
|
|
2
|
+
export declare const translateToJustifyContent: (justify: FlexJustifyBehaviour | undefined) => string | undefined;
|
|
3
|
+
export declare const translateToAlignItems: (alignItems: FlexAlignBehaviour | undefined) => string | undefined;
|
|
3
4
|
export declare const FlexStyled: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, FlexProps>> & string;
|
|
@@ -12,7 +12,7 @@ import { s as spacingMd, b as spacingSm, e as spacingXl, a as spacingXs, f as sp
|
|
|
12
12
|
import styled from "styled-components";
|
|
13
13
|
import { B as Badge } from "../../index-j22agtAk.js";
|
|
14
14
|
import ButtonGroup from "../ButtonGroup/index.js";
|
|
15
|
-
import { a as flexOrientationVertical } from "../../styled-
|
|
15
|
+
import { a as flexOrientationVertical } from "../../styled-KWWOgO_h.js";
|
|
16
16
|
import Grid from "../Grid/index.js";
|
|
17
17
|
import GridItem from "../GridItem/index.js";
|
|
18
18
|
import ResponsiveImage from "../ResponsiveImage/index.js";
|
|
@@ -14,8 +14,8 @@ import "../../FontWeight-DEBGHbtO.js";
|
|
|
14
14
|
import "../../HeadingSize-CfCRn3Lh.js";
|
|
15
15
|
import "../../Spacing-8v6hcO2x.js";
|
|
16
16
|
import "../../hooks/useViewport/index.js";
|
|
17
|
-
import { M, i, a, b, m, c, v } from "../../index-
|
|
18
|
-
import "../../styled-
|
|
17
|
+
import { M, i, a, b, m, c, v } from "../../index-C0tryPFA.js";
|
|
18
|
+
import "../../styled-KWWOgO_h.js";
|
|
19
19
|
import "../../validate-DYmFz2FF.js";
|
|
20
20
|
export {
|
|
21
21
|
M as default,
|
|
@@ -365,11 +365,14 @@ const SuggestInput = forwardRef(({
|
|
|
365
365
|
/* @__PURE__ */ jsx(InputStyled, { ...inputProps, ref: inputRef, onChange: (e) => handleChange(e.target.value), onClick: () => {
|
|
366
366
|
if (disabled) return;
|
|
367
367
|
setShowList(true);
|
|
368
|
-
}, onBlur: () =>
|
|
368
|
+
}, onBlur: (e) => {
|
|
369
|
+
var _a2;
|
|
370
|
+
(_a2 = props.onBlur) == null ? void 0 : _a2.call(props, e);
|
|
371
|
+
setShowList(false);
|
|
372
|
+
}, role: "combobox", value: ((_a = listItems == null ? void 0 : listItems.find((listItem) => listItem.value === value)) == null ? void 0 : _a.label) || value, ...{
|
|
369
373
|
"aria-expanded": showList,
|
|
370
374
|
"aria-controls": "listbox",
|
|
371
375
|
"aria-activedescendant": selectedOption > -1 ? `${uid}-item-${selectedOption}` : void 0,
|
|
372
|
-
"aria-live": isLoading !== void 0 ? "polite" : void 0,
|
|
373
376
|
"aria-busy": isLoading ? isLoading : void 0,
|
|
374
377
|
"aria-autocomplete": "list"
|
|
375
378
|
}, disabled, placeholder: renderInlineRichTextFromOpenText(placeholder), id: inputId }),
|
|
@@ -19,7 +19,7 @@ import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
|
19
19
|
import { d as colorBackgroundOverlayStatic } from "../../BackgroundColor-e0N9tdDR.js";
|
|
20
20
|
import { a as borderWidthFocus } from "../../BorderWidth-BjXpOdM5.js";
|
|
21
21
|
import { g as getCssVar } from "../../getCssVar-BP6T9pFM.js";
|
|
22
|
-
import { a as flexOrientationVertical } from "../../styled-
|
|
22
|
+
import { a as flexOrientationVertical } from "../../styled-KWWOgO_h.js";
|
|
23
23
|
const TrayOverlayStyled = styled("div").withConfig({
|
|
24
24
|
displayName: "TrayOverlayStyled",
|
|
25
25
|
componentId: "sc-os3mq3-0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useContentfulLiveUpdates, ContentfulLivePreviewProvider } from "@contentful/live-preview/react";
|
|
4
|
-
import { m as mapContentToComponents } from "../../mapContentToComponents-
|
|
4
|
+
import { m as mapContentToComponents } from "../../mapContentToComponents-CL3WF8Js.js";
|
|
5
5
|
const BrixLiveRendererComponents = ({
|
|
6
6
|
data
|
|
7
7
|
}) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import LivePreviewRenderer from "../live-preview-renderer/index.js";
|
|
4
|
-
import { m as mapContentToComponents } from "../../mapContentToComponents-
|
|
4
|
+
import { m as mapContentToComponents } from "../../mapContentToComponents-CL3WF8Js.js";
|
|
5
5
|
const Renderer = ({
|
|
6
6
|
content,
|
|
7
7
|
isDraftMode
|
|
@@ -27,7 +27,7 @@ import "./styled-7vJ7mrAA.js";
|
|
|
27
27
|
import "./index-CEotMXpL.js";
|
|
28
28
|
import { i as isObject, h as hasMatchingComponentName } from "./isObject-BYBrvoVW.js";
|
|
29
29
|
import { i as isBottomSpacing } from "./isBottomSpacing-BxfreCZU.js";
|
|
30
|
-
import { a as flexOrientationVertical, f as flexOrientationHorizontal, b as flexJustifyStart } from "./styled-
|
|
30
|
+
import { a as flexOrientationVertical, f as flexOrientationHorizontal, b as flexJustifyStart } from "./styled-KWWOgO_h.js";
|
|
31
31
|
const mediaTextPositionTop = "top";
|
|
32
32
|
const mediaTextPositionLeft = "left";
|
|
33
33
|
const mediaTextPositionRight = "right";
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import { default as default22 } from "./components/PickerGroup/index.js";
|
|
|
26
26
|
import { default as default23, overlayAppearancePrimary, overlayAppearanceSecondary } from "./components/Overlay/index.js";
|
|
27
27
|
import { default as default24 } from "./components/OpenTextFootnoteAdapter/index.js";
|
|
28
28
|
import { default as default25, notificationStatusError, notificationStatusInfo, notificationStatusSuccess, notificationStatusWarning } from "./components/Notification/index.js";
|
|
29
|
-
import { M, i as i2, a as a4, b as b3, m, c as c3, v as v2 } from "./index-
|
|
29
|
+
import { M, i as i2, a as a4, b as b3, m, c as c3, v as v2 } from "./index-C0tryPFA.js";
|
|
30
30
|
import { default as default26 } from "./components/LocalStyle/index.js";
|
|
31
31
|
import { default as default27 } from "./components/LoadingSpinner/index.js";
|
|
32
32
|
import { default as default28, linkListItemVariantHorizontal, linkListItemVariantVertical } from "./components/LinkListItem/index.js";
|
|
@@ -79,7 +79,7 @@ import { default as default71 } from "./components/Checkbox/index.js";
|
|
|
79
79
|
import { default as default72 } from "./components/Carousel/index.js";
|
|
80
80
|
import { default as default73, cardAppearances, cardTags, isCardProps, validateCardProps } from "./components/Card/index.js";
|
|
81
81
|
import { default as default74 } from "./components/Calendar/index.js";
|
|
82
|
-
import { default as default75,
|
|
82
|
+
import { default as default75, flexJustifyBehaviours, flexOrientations, isButtonGroupProps, validateButtonGroupProps } from "./components/ButtonGroup/index.js";
|
|
83
83
|
import { B, c as c4, a as a6, b as b4, d as d3, i as i5, f as f3, v as v5, e as e3 } from "./validate-Dlzxlfzp.js";
|
|
84
84
|
import { default as default76 } from "./components/Button/index.js";
|
|
85
85
|
import { default as default77 } from "./components/BottomBar/index.js";
|
|
@@ -116,10 +116,10 @@ import { useForcedColors } from "./hooks/useForcedColors/index.js";
|
|
|
116
116
|
import { useFocusWithin } from "./hooks/useFocusWithin/index.js";
|
|
117
117
|
import "react/jsx-runtime";
|
|
118
118
|
import "@contentful/live-preview/react";
|
|
119
|
-
import { L as L2 } from "./mapContentToComponents-
|
|
119
|
+
import { L as L2 } from "./mapContentToComponents-CL3WF8Js.js";
|
|
120
120
|
import { a as a8, i as i7 } from "./props-DDpgcryb.js";
|
|
121
121
|
import { p as p3, m as m2, q, r, s as s2, n, t as t2, x, d as d5, h as h2, c as c6, w, z, o, a as a9, b as b6, u, e as e4, i as i8, g as g2, f as f4, l, k as k2, j as j2, v as v7, y } from "./validate-DYmFz2FF.js";
|
|
122
|
-
import { e as e5, d as d6, c as c7, b as b7, f as f5, a as a10 } from "./styled-
|
|
122
|
+
import { i as i9, h as h3, g as g3, e as e5, d as d6, c as c7, b as b7, f as f5, a as a10 } from "./styled-KWWOgO_h.js";
|
|
123
123
|
import { C } from "./styled-Dq0NuP5r.js";
|
|
124
124
|
export {
|
|
125
125
|
default80 as Accordion,
|
|
@@ -284,9 +284,12 @@ export {
|
|
|
284
284
|
cssReset,
|
|
285
285
|
discoveryCardOrientationHorizontal,
|
|
286
286
|
discoveryCardOrientationVertical,
|
|
287
|
+
i9 as flexAlignCenter,
|
|
288
|
+
h3 as flexAlignEnd,
|
|
289
|
+
g3 as flexAlignStart,
|
|
287
290
|
flexItemAutoGrow,
|
|
288
291
|
flexItemFullGrow,
|
|
289
|
-
|
|
292
|
+
flexJustifyBehaviours,
|
|
290
293
|
e5 as flexJustifyBetween,
|
|
291
294
|
d6 as flexJustifyCenter,
|
|
292
295
|
c7 as flexJustifyEnd,
|
|
@@ -23,7 +23,7 @@ import ImageHeader, { isImageHeaderProps } from "./components/ImageHeader/index.
|
|
|
23
23
|
import Link, { isLinkProps } from "./components/Link/index.js";
|
|
24
24
|
import { i as isLinkAsButtonProps, L as LinkAsButton } from "./index-CEotMXpL.js";
|
|
25
25
|
import LinkList, { linkListVariantRow, linkListVariantColumn } from "./components/LinkList/index.js";
|
|
26
|
-
import { d as isConsentMessageProps, e as isRichTextContentfulProps, f as isYoutubeVideoProps, i as isMediaTextProps, M as MediaText } from "./index-
|
|
26
|
+
import { d as isConsentMessageProps, e as isRichTextContentfulProps, f as isYoutubeVideoProps, i as isMediaTextProps, M as MediaText } from "./index-C0tryPFA.js";
|
|
27
27
|
import { k as isPriceProps, P as Price } from "./index-TL0X3rXH.js";
|
|
28
28
|
import ResponsiveImage, { isResponsiveImageProps } from "./components/ResponsiveImage/index.js";
|
|
29
29
|
import RichTextContentful from "./components/RichtTextContentful/index.js";
|
|
@@ -42,7 +42,7 @@ import "./index-BJHhIBYl.js";
|
|
|
42
42
|
import "./NotificationErrorIcon-DMnAJgPN.js";
|
|
43
43
|
import "react";
|
|
44
44
|
import "./components/Collapsible/index.js";
|
|
45
|
-
import "./styled-
|
|
45
|
+
import "./styled-KWWOgO_h.js";
|
|
46
46
|
import "./components/FlexItem/index.js";
|
|
47
47
|
import "./styled-Dq0NuP5r.js";
|
|
48
48
|
import "./components/InlineLink/index.js";
|
|
@@ -9,6 +9,9 @@ const flexJustifyStart = "start";
|
|
|
9
9
|
const flexJustifyEnd = "end";
|
|
10
10
|
const flexJustifyCenter = "center";
|
|
11
11
|
const flexJustifyBetween = "between";
|
|
12
|
+
const flexAlignStart = "start";
|
|
13
|
+
const flexAlignEnd = "end";
|
|
14
|
+
const flexAlignCenter = "center";
|
|
12
15
|
const translateToJustifyContent = (justify) => {
|
|
13
16
|
if (!justify) {
|
|
14
17
|
return;
|
|
@@ -21,6 +24,17 @@ const translateToJustifyContent = (justify) => {
|
|
|
21
24
|
};
|
|
22
25
|
return justifyValues[justify];
|
|
23
26
|
};
|
|
27
|
+
const translateToAlignItems = (alignItems) => {
|
|
28
|
+
if (!alignItems) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const alignValues = {
|
|
32
|
+
[flexAlignEnd]: "flex-end",
|
|
33
|
+
[flexAlignCenter]: "center",
|
|
34
|
+
[flexAlignStart]: "flex-start"
|
|
35
|
+
};
|
|
36
|
+
return alignValues[alignItems];
|
|
37
|
+
};
|
|
24
38
|
const FlexStyled = styled.div.withConfig({
|
|
25
39
|
shouldForwardProp: filterProps(),
|
|
26
40
|
displayName: "FlexStyled",
|
|
@@ -47,6 +61,10 @@ const FlexStyled = styled.div.withConfig({
|
|
|
47
61
|
justify = flexJustifyStart
|
|
48
62
|
}) => ({
|
|
49
63
|
justifyContent: translateToJustifyContent(justify)
|
|
64
|
+
}), ({
|
|
65
|
+
alignItems = flexAlignStart
|
|
66
|
+
}) => ({
|
|
67
|
+
alignItems: translateToAlignItems(alignItems)
|
|
50
68
|
}), ({
|
|
51
69
|
gapSpacing = spacingMd
|
|
52
70
|
}) => {
|
|
@@ -67,5 +85,8 @@ export {
|
|
|
67
85
|
flexJustifyEnd as c,
|
|
68
86
|
flexJustifyCenter as d,
|
|
69
87
|
flexJustifyBetween as e,
|
|
70
|
-
flexOrientationHorizontal as f
|
|
88
|
+
flexOrientationHorizontal as f,
|
|
89
|
+
flexAlignStart as g,
|
|
90
|
+
flexAlignEnd as h,
|
|
91
|
+
flexAlignCenter as i
|
|
71
92
|
};
|