@vodafone_de/brix-components 9.0.4 → 10.0.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/{BorderRadius-ClUShVLu.js → BorderRadius-2LdggXbQ.js} +2 -2
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/AccordionGroup/index.js +1 -1
- package/dist/components/ArtDirectedImage/index.d.ts +5 -0
- package/dist/components/ArtDirectedImage/index.js +75 -0
- package/dist/components/ArtDirectedImage/props.d.ts +24 -0
- package/dist/components/ArtDirectedImage/styled.d.ts +2 -0
- package/dist/components/ArtDirectedImage/validate.d.ts +3 -0
- package/dist/components/Badge/index.js +2 -3
- package/dist/components/Body/index.js +4 -5
- package/dist/components/BottomBar/index.js +4 -4
- package/dist/components/BottomBar/props.d.ts +1 -1
- package/dist/components/Button/index.js +4 -5
- package/dist/components/ButtonAsLink/index.js +2 -3
- package/dist/components/ButtonGroup/index.js +6 -6
- package/dist/components/ButtonGroup/props.d.ts +2 -2
- package/dist/components/ButtonGroup/validate.d.ts +2 -2
- package/dist/components/Calendar/index.js +305 -72
- package/dist/components/Card/index.js +3 -3
- package/dist/components/Carousel/index.js +6 -7
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/CheckboxGroup/index.js +2 -2
- package/dist/components/Collapsible/index.js +19 -5
- package/dist/components/Collapsible/props.d.ts +5 -0
- package/dist/components/Collapsible/styled.d.ts +1 -1
- package/dist/components/ColorSwatch/index.js +1 -1
- package/dist/components/ColorSwatchGroup/index.js +2 -2
- package/dist/components/ConsentMessage/index.js +2 -2
- package/dist/components/Container/index.d.ts +1 -0
- package/dist/components/Container/index.js +10 -105
- package/dist/components/Container/styled.d.ts +2 -0
- package/dist/components/DateInput/index.js +1 -1
- package/dist/components/DemoBox/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/DiscoveryCard/index.js +14 -11
- package/dist/components/DiscoveryCard/styled.d.ts +1 -1
- package/dist/components/DiscoveryCardGroup/index.js +12 -10
- package/dist/components/Divider/index.js +1 -1
- package/dist/components/EnergySnippet/index.js +2 -2
- package/dist/components/Fieldset/index.js +1 -1
- package/dist/components/FilterGroup/index.js +3 -3
- 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/FlexItem/index.js +1 -1
- package/dist/components/FootnoteContent/index.js +1 -1
- package/dist/components/FootnoteLink/index.js +2 -2
- package/dist/components/Form/index.js +2 -2
- package/dist/components/FormElement/index.js +1 -1
- package/dist/components/GoogleMap/index.js +2 -2
- package/dist/components/Grid/index.d.ts +3 -1
- package/dist/components/Grid/index.js +16 -91
- package/dist/components/GridItem/index.d.ts +7 -0
- package/dist/components/GridItem/index.js +11 -54
- package/dist/components/Heading/index.js +4 -5
- package/dist/components/HifiIcon/index.js +1 -1
- package/dist/components/IconButton/index.js +3 -3
- package/dist/components/IconSnippet/index.js +3 -3
- package/dist/components/IconSnippetList/index.js +2 -3
- package/dist/components/Image/index.js +111 -52
- package/dist/components/Image/props.d.ts +21 -35
- package/dist/components/Image/styled.d.ts +1 -1
- package/dist/components/Image/validate.d.ts +1 -4
- package/dist/components/ImageHeader/index.js +18 -25
- package/dist/components/ImageHeader/props.d.ts +2 -2
- package/dist/components/ImageHeader/styled.d.ts +1 -1
- package/dist/components/InfoBanner/index.js +1 -1
- package/dist/components/InlineIcon/index.js +1 -1
- package/dist/components/InlineLink/index.js +1 -1
- package/dist/components/Input/index.js +2 -3
- package/dist/components/Label/index.js +2 -3
- package/dist/components/Legend/index.js +1 -1
- package/dist/components/Link/index.js +4 -5
- package/dist/components/LinkAsButton/index.js +1 -2
- package/dist/components/LinkList/index.js +2 -3
- package/dist/components/LinkListItem/index.js +5 -5
- package/dist/components/LoadingSpinner/index.js +2 -2
- package/dist/components/LocalStyle/index.js +2 -2
- package/dist/components/MediaText/index.js +5 -6
- package/dist/components/Notification/index.js +3 -3
- package/dist/components/OpenTextFootnoteAdapter/index.js +3 -3
- package/dist/components/Overlay/index.js +1 -1
- package/dist/components/PickerGroup/index.js +8 -11
- package/dist/components/Price/index.d.ts +1 -1
- package/dist/components/Price/index.js +2 -3
- package/dist/components/ProductCard/index.js +29 -22
- package/dist/components/ProductCard/props.d.ts +11 -14
- package/dist/components/ProductCard/styled.d.ts +1 -0
- package/dist/components/QuickLinkList/index.js +3 -5
- package/dist/components/RadioGroup/index.js +2 -2
- package/dist/components/Rating/index.js +2 -2
- package/dist/components/RichText/index.js +1 -1
- package/dist/components/RichtTextContentful/index.js +2 -2
- package/dist/components/ScreenreaderOnly/index.js +1 -1
- package/dist/components/SearchInput/index.js +4 -5
- package/dist/components/SelectInput/index.js +3 -4
- package/dist/components/Stepper/index.js +3 -4
- package/dist/components/SuggestInput/index.js +4 -5
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/TabGroup/index.js +2 -2
- package/dist/components/TabularPrice/index.js +2 -3
- package/dist/components/TextList/index.js +2 -3
- package/dist/components/Textarea/index.js +3 -4
- package/dist/components/TimeInput/index.js +1 -1
- package/dist/components/Tray/index.js +1 -1
- package/dist/components/UtilityLink/index.js +20 -2
- package/dist/components/UtilityLink/styled.d.ts +1 -0
- package/dist/components/YoutubeVideo/index.js +2 -2
- package/dist/contentful/components.d.ts +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/map/artDirectedImage.d.ts +4 -0
- package/dist/contentful/renderer/index.js +1 -1
- package/dist/{cssVars-ZsZIfkeD.js → cssVars-TmhA1NpG.js} +1 -1
- package/dist/filterProps-CxkibNnG.js +18 -0
- package/dist/foundations/GlobalStyle/index.js +1 -1
- package/dist/getSizesFromGridConfig-DKOLupyb.js +48 -0
- package/dist/hooks/useImageComponent/index.d.ts +37 -0
- package/dist/hooks/useImageComponent/index.js +23 -0
- package/dist/hooks/usePictureComponent/index.d.ts +49 -0
- package/dist/hooks/usePictureComponent/index.js +38 -0
- package/dist/hooks/useViewport/index.js +5 -20
- package/dist/{index-ClAH0TNC.js → index-72IFVw5W.js} +14 -12
- package/dist/{index-BJHhIBYl.js → index-BsykXBqC.js} +1 -1
- package/dist/index-Bu-7sSif.js +201 -0
- package/dist/{index-DCE5HNIR.js → index-C2E3JrhF.js} +1 -1
- package/dist/{index-TL0X3rXH.js → index-DCXRnuHz.js} +7 -8
- package/dist/index-DKCzYjXw.js +25 -0
- package/dist/{index-C4eCcl02.js → index-DP6Nlg-a.js} +4 -5
- package/dist/index-DbG0QL9D.js +113 -0
- package/dist/{index-CEotMXpL.js → index-Dd-A7i9Y.js} +3 -4
- package/dist/{index-j22agtAk.js → index-DwGcrvTh.js} +4 -5
- package/dist/index.d.ts +4 -2
- package/dist/index.js +213 -212
- package/dist/{mapContentToComponents-C_O2rRrX.js → mapContentToComponents-DcPjYAXH.js} +155 -140
- package/dist/{styled-Dw5c-xwf.js → styled-BIcsESkS.js} +1 -1
- package/dist/{styled-7vJ7mrAA.js → styled-BKH3egch.js} +2 -2
- package/dist/{styled-BxkvYuWW.js → styled-CUp4EbPh.js} +23 -2
- package/dist/{styled-BBXC0aka.js → styled-D-fzMZNS.js} +1 -1
- package/dist/{styled-0KSRG-Fv.js → styled-DdeOXNN9.js} +26 -4
- package/dist/{styled-xKyZg4q9.js → styled-DmMk0W0J.js} +2 -2
- package/dist/{styled-Dq0NuP5r.js → styled-rsUoUFyl.js} +2 -2
- package/dist/{tags-D7CRQqc1.js → tags-Cwgg3Gx2.js} +7 -7
- package/dist/{validate-Dlzxlfzp.js → validate-CLBUbscx.js} +4 -6
- package/package.json +1 -1
- package/dist/Viewport-C35jx6QE.js +0 -8
- package/dist/components/ResponsiveImage/index.d.ts +0 -6
- package/dist/components/ResponsiveImage/index.js +0 -124
- package/dist/components/ResponsiveImage/props.d.ts +0 -16
- package/dist/components/ResponsiveImage/styled.d.ts +0 -4
- package/dist/components/ResponsiveImage/validate.d.ts +0 -3
- package/dist/components/ResponsiveImage/validate.test.d.ts +0 -1
- package/dist/contentful/map/responsiveImage.d.ts +0 -4
- package/dist/filterProps-BJ5SpbnA.js +0 -17
- package/dist/renderInlineRichTextFromOpenText-RvOG3QbI.js +0 -13
- package/dist/styled-BiCOjvNq.js +0 -29
- package/dist/validate-DYmFz2FF.js +0 -85
|
@@ -22,7 +22,7 @@ import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
|
22
22
|
import { getTextColor } from "../../foundations/token/getTextColor/index.js";
|
|
23
23
|
import { a as colorBackgroundSubtle, c as colorBackgroundNeutral } from "../../BackgroundColor-e0N9tdDR.js";
|
|
24
24
|
import { c as colorBorderFocus, a as colorBorderNeutral } from "../../BorderColor-BummoQ1-.js";
|
|
25
|
-
import {
|
|
25
|
+
import { a as borderRadiusFull, d as borderRadiusSm } from "../../BorderRadius-2LdggXbQ.js";
|
|
26
26
|
import { a as borderWidthFocus } from "../../BorderWidth-BjXpOdM5.js";
|
|
27
27
|
import { a as fontWeightRegular, f as fontWeightBold } from "../../FontWeight-DEBGHbtO.js";
|
|
28
28
|
import { b as colorIconBrand } from "../../IconColor-CtC9WUgr.js";
|
|
@@ -30,7 +30,7 @@ import { d as colorObjectSelected } from "../../ObjectColor-DxgEnOBM.js";
|
|
|
30
30
|
import { a as opacityDisabled, o as opacityOverlay } from "../../Opacity-smkGiwsf.js";
|
|
31
31
|
import { s as spacingMd, b as spacingSm, g as spacingLg, f as spacing2Xs, a as spacingXs } from "../../Spacing-8v6hcO2x.js";
|
|
32
32
|
import { a as colorTextNeutral, e as colorTextInverse } from "../../TextColor-BXVMXUVE.js";
|
|
33
|
-
import { a as filterProps } from "../../filterProps-
|
|
33
|
+
import { a as filterProps } from "../../filterProps-CxkibNnG.js";
|
|
34
34
|
const millisecondsInWeek = 6048e5;
|
|
35
35
|
const millisecondsInDay = 864e5;
|
|
36
36
|
const constructFromSymbol = Symbol.for("constructDateFrom");
|
|
@@ -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,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { d as divTagName, s as sectionTagName,
|
|
4
|
-
import { a as CardStyled } from "../../styled-
|
|
5
|
-
import { C } from "../../styled-
|
|
3
|
+
import { d as divTagName, s as sectionTagName, a as articleTagName, b as asideTagName, c as spanTagName } from "../../tags-Cwgg3Gx2.js";
|
|
4
|
+
import { a as CardStyled } from "../../styled-rsUoUFyl.js";
|
|
5
|
+
import { C } from "../../styled-rsUoUFyl.js";
|
|
6
6
|
const cardAppearances = ["primary", "secondary"];
|
|
7
7
|
const cardTags = [divTagName, sectionTagName, articleTagName, asideTagName, spanTagName];
|
|
8
8
|
const validateCardProps = (props) => {
|
|
@@ -3,12 +3,11 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import "@af-utils/scrollend-polyfill";
|
|
4
4
|
import { createContext, useRef, useState, useEffect, useContext, createElement } from "react";
|
|
5
5
|
import { useFocusWithin } from "../../hooks/useFocusWithin/index.js";
|
|
6
|
-
import { l as liTagName, u as ulTagName } from "../../tags-
|
|
6
|
+
import { l as liTagName, u as ulTagName } from "../../tags-Cwgg3Gx2.js";
|
|
7
7
|
import { s as spacingMd } from "../../Spacing-8v6hcO2x.js";
|
|
8
8
|
import styled from "styled-components";
|
|
9
|
-
import { a as CardStyled } from "../../styled-
|
|
10
|
-
import {
|
|
11
|
-
import { G as GridItemStyled } from "../../styled-0KSRG-Fv.js";
|
|
9
|
+
import { a as CardStyled } from "../../styled-rsUoUFyl.js";
|
|
10
|
+
import { a as GridStyled, G as GridItemStyled } from "../../styled-DdeOXNN9.js";
|
|
12
11
|
import forcedColors from "../../foundations/media-query/forcedColors/index.js";
|
|
13
12
|
import viewport from "../../foundations/media-query/viewport/index.js";
|
|
14
13
|
import { getBorderRadius } from "../../foundations/token/getBorderRadius/index.js";
|
|
@@ -16,12 +15,12 @@ import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js"
|
|
|
16
15
|
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
17
16
|
import { getObjectColor } from "../../foundations/token/getObjectColor/index.js";
|
|
18
17
|
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
19
|
-
import {
|
|
18
|
+
import { a as borderRadiusFull } from "../../BorderRadius-2LdggXbQ.js";
|
|
20
19
|
import { d as borderWidthSm } from "../../BorderWidth-BjXpOdM5.js";
|
|
21
20
|
import { a as colorObjectBrand, e as colorObjectUnselected } from "../../ObjectColor-DxgEnOBM.js";
|
|
22
|
-
import { a as filterProps } from "../../filterProps-
|
|
21
|
+
import { a as filterProps } from "../../filterProps-CxkibNnG.js";
|
|
23
22
|
import IconButton from "../IconButton/index.js";
|
|
24
|
-
import { S as ScreenreaderOnly } from "../../index-
|
|
23
|
+
import { S as ScreenreaderOnly } from "../../index-C2E3JrhF.js";
|
|
25
24
|
const getItems = (items, loop) => {
|
|
26
25
|
const normalizedItems = [...items].map((item, index) => ({
|
|
27
26
|
...item,
|
|
@@ -18,11 +18,11 @@ import { getObjectColor } from "../../foundations/token/getObjectColor/index.js"
|
|
|
18
18
|
import { getOpacity } from "../../foundations/token/getOpacity/index.js";
|
|
19
19
|
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
20
20
|
import { c as colorBorderFocus } from "../../BorderColor-BummoQ1-.js";
|
|
21
|
-
import { d as borderRadiusSm } from "../../BorderRadius-
|
|
21
|
+
import { d as borderRadiusSm } from "../../BorderRadius-2LdggXbQ.js";
|
|
22
22
|
import { a as borderWidthFocus } from "../../BorderWidth-BjXpOdM5.js";
|
|
23
23
|
import { a as opacityDisabled } from "../../Opacity-smkGiwsf.js";
|
|
24
24
|
import { s as spacingMd } from "../../Spacing-8v6hcO2x.js";
|
|
25
|
-
import { a as filterProps } from "../../filterProps-
|
|
25
|
+
import { a as filterProps } from "../../filterProps-CxkibNnG.js";
|
|
26
26
|
import { g as getCssVar } from "../../getCssVar-BP6T9pFM.js";
|
|
27
27
|
const CheckboxLabelStyled = styled(Label).withConfig({
|
|
28
28
|
shouldForwardProp: filterProps(),
|
|
@@ -5,10 +5,10 @@ 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-CUp4EbPh.js";
|
|
9
9
|
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
10
10
|
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
11
|
-
import { a as filterProps } from "../../filterProps-
|
|
11
|
+
import { a as filterProps } from "../../filterProps-CxkibNnG.js";
|
|
12
12
|
const CheckboxGroupStyled = styled(FlexStyled).withConfig({
|
|
13
13
|
shouldForwardProp: filterProps(),
|
|
14
14
|
displayName: "CheckboxGroupStyled",
|
|
@@ -8,7 +8,7 @@ import { getBorderWidth } from "../../foundations/token/getBorderWidth/index.js"
|
|
|
8
8
|
import { getSpacing } from "../../foundations/token/getSpacing/index.js";
|
|
9
9
|
import { a as borderWidthFocus } from "../../BorderWidth-BjXpOdM5.js";
|
|
10
10
|
import { c as spacingNone } from "../../Spacing-8v6hcO2x.js";
|
|
11
|
-
import { a as filterProps } from "../../filterProps-
|
|
11
|
+
import { a as filterProps } from "../../filterProps-CxkibNnG.js";
|
|
12
12
|
const CollapsibleStyled = styled.div.withConfig({
|
|
13
13
|
shouldForwardProp: filterProps(),
|
|
14
14
|
displayName: "CollapsibleStyled",
|
|
@@ -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;
|
|
@@ -9,7 +9,7 @@ import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index
|
|
|
9
9
|
import { a as colorBorderNeutral } from "../../BorderColor-BummoQ1-.js";
|
|
10
10
|
import { c as iconSizeMd } from "../../IconSize-AJp7xdJi.js";
|
|
11
11
|
import { c as spacingNone } from "../../Spacing-8v6hcO2x.js";
|
|
12
|
-
import { a as filterProps } from "../../filterProps-
|
|
12
|
+
import { a as filterProps } from "../../filterProps-CxkibNnG.js";
|
|
13
13
|
import { g as getCssVar } from "../../getCssVar-BP6T9pFM.js";
|
|
14
14
|
import { i as isObject, h as hasMatchingComponentName } from "../../isObject-BYBrvoVW.js";
|
|
15
15
|
const colorSwatchSizeSmall = "sm";
|
|
@@ -3,10 +3,10 @@ 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-CUp4EbPh.js";
|
|
7
7
|
import { getBottomSpacing } from "../../foundations/token/getBottomSpacing/index.js";
|
|
8
8
|
import { c as iconSizeMd } from "../../IconSize-AJp7xdJi.js";
|
|
9
|
-
import { a as filterProps } from "../../filterProps-
|
|
9
|
+
import { a as filterProps } from "../../filterProps-CxkibNnG.js";
|
|
10
10
|
import { g as getCssVar } from "../../getCssVar-BP6T9pFM.js";
|
|
11
11
|
import "react";
|
|
12
12
|
import { i as isObject, h as hasMatchingComponentName } from "../../isObject-BYBrvoVW.js";
|