@frontify/fondue-components 29.1.0 → 30.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/fondue-components.js +72 -70
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +181 -33
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components100.js +8 -23
- package/dist/fondue-components100.js.map +1 -1
- package/dist/fondue-components101.js +11 -34
- package/dist/fondue-components101.js.map +1 -1
- package/dist/fondue-components102.js +10 -10
- package/dist/fondue-components103.js +6 -67
- package/dist/fondue-components103.js.map +1 -1
- package/dist/fondue-components104.js +12 -14
- package/dist/fondue-components104.js.map +1 -1
- package/dist/fondue-components105.js +22 -25
- package/dist/fondue-components105.js.map +1 -1
- package/dist/fondue-components106.js +34 -19
- package/dist/fondue-components106.js.map +1 -1
- package/dist/fondue-components107.js +10 -24
- package/dist/fondue-components107.js.map +1 -1
- package/dist/fondue-components108.js +67 -8
- package/dist/fondue-components108.js.map +1 -1
- package/dist/fondue-components109.js +14 -30
- package/dist/fondue-components109.js.map +1 -1
- package/dist/fondue-components11.js +35 -185
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components110.js +23 -4
- package/dist/fondue-components110.js.map +1 -1
- package/dist/fondue-components111.js +18 -4
- package/dist/fondue-components111.js.map +1 -1
- package/dist/fondue-components112.js +24 -4
- package/dist/fondue-components112.js.map +1 -1
- package/dist/fondue-components113.js +9 -14
- package/dist/fondue-components113.js.map +1 -1
- package/dist/fondue-components114.js +32 -16
- package/dist/fondue-components114.js.map +1 -1
- package/dist/fondue-components115.js +7 -111
- package/dist/fondue-components115.js.map +1 -1
- package/dist/fondue-components116.js +4 -12
- package/dist/fondue-components116.js.map +1 -1
- package/dist/fondue-components117.js +5 -17
- package/dist/fondue-components117.js.map +1 -1
- package/dist/fondue-components118.js +214 -10
- package/dist/fondue-components118.js.map +1 -1
- package/dist/fondue-components119.js +18 -16
- package/dist/fondue-components119.js.map +1 -1
- package/dist/fondue-components12.js +185 -7
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components120.js +15 -125
- package/dist/fondue-components120.js.map +1 -1
- package/dist/fondue-components121.js +151 -11
- package/dist/fondue-components121.js.map +1 -1
- package/dist/fondue-components122.js +45 -36
- package/dist/fondue-components122.js.map +1 -1
- package/dist/fondue-components123.js +16 -216
- package/dist/fondue-components123.js.map +1 -1
- package/dist/fondue-components124.js +14 -19
- package/dist/fondue-components124.js.map +1 -1
- package/dist/fondue-components125.js +16 -16
- package/dist/fondue-components125.js.map +1 -1
- package/dist/fondue-components126.js +107 -147
- package/dist/fondue-components126.js.map +1 -1
- package/dist/fondue-components127.js +12 -44
- package/dist/fondue-components127.js.map +1 -1
- package/dist/fondue-components128.js +17 -42
- package/dist/fondue-components128.js.map +1 -1
- package/dist/fondue-components129.js +16 -0
- package/dist/fondue-components129.js.map +1 -0
- package/dist/fondue-components13.js +8 -63
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components130.js +127 -41
- package/dist/fondue-components130.js.map +1 -1
- package/dist/fondue-components131.js +11 -170
- package/dist/fondue-components131.js.map +1 -1
- package/dist/fondue-components132.js +34 -58
- package/dist/fondue-components132.js.map +1 -1
- package/dist/fondue-components133.js +33 -9
- package/dist/fondue-components133.js.map +1 -1
- package/dist/fondue-components134.js +6 -256
- package/dist/fondue-components134.js.map +1 -1
- package/dist/fondue-components137.js +4 -4
- package/dist/fondue-components138.js +1 -1
- package/dist/fondue-components139.js +1 -1
- package/dist/fondue-components14.js +61 -35
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components140.js +2 -2
- package/dist/fondue-components141.js +3 -3
- package/dist/fondue-components142.js +2 -2
- package/dist/fondue-components143.js +168 -17
- package/dist/fondue-components143.js.map +1 -1
- package/dist/fondue-components144.js +60 -70
- package/dist/fondue-components144.js.map +1 -1
- package/dist/fondue-components145.js +7 -1350
- package/dist/fondue-components145.js.map +1 -1
- package/dist/fondue-components146.js +217 -902
- package/dist/fondue-components146.js.map +1 -1
- package/dist/fondue-components147.js +17 -196
- package/dist/fondue-components147.js.map +1 -1
- package/dist/fondue-components149.js +41 -39
- package/dist/fondue-components149.js.map +1 -1
- package/dist/fondue-components15.js +36 -121
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components150.js +40 -67
- package/dist/fondue-components150.js.map +1 -1
- package/dist/fondue-components151.js +20 -30
- package/dist/fondue-components151.js.map +1 -1
- package/dist/fondue-components152.js +40 -9
- package/dist/fondue-components152.js.map +1 -1
- package/dist/fondue-components153.js +67 -150
- package/dist/fondue-components153.js.map +1 -1
- package/dist/fondue-components154.js +1351 -107
- package/dist/fondue-components154.js.map +1 -1
- package/dist/fondue-components155.js +943 -18
- package/dist/fondue-components155.js.map +1 -1
- package/dist/fondue-components156.js +197 -15
- package/dist/fondue-components156.js.map +1 -1
- package/dist/fondue-components157.js +68 -29
- package/dist/fondue-components157.js.map +1 -1
- package/dist/fondue-components158.js +31 -13
- package/dist/fondue-components158.js.map +1 -1
- package/dist/fondue-components159.js +9 -7
- package/dist/fondue-components159.js.map +1 -1
- package/dist/fondue-components16.js +121 -36
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components160.js +156 -0
- package/dist/fondue-components160.js.map +1 -0
- package/dist/fondue-components161.js +111 -0
- package/dist/fondue-components161.js.map +1 -0
- package/dist/fondue-components162.js +19 -0
- package/dist/fondue-components162.js.map +1 -0
- package/dist/fondue-components163.js +32 -0
- package/dist/fondue-components163.js.map +1 -0
- package/dist/fondue-components164.js +16 -0
- package/dist/fondue-components164.js.map +1 -0
- package/dist/fondue-components165.js +19 -0
- package/dist/fondue-components165.js.map +1 -0
- package/dist/fondue-components166.js +10 -0
- package/dist/fondue-components166.js.map +1 -0
- package/dist/fondue-components17.js +30 -39
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +44 -41
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +42 -57
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +55 -41
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +39 -16
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +17 -43
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +46 -68
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +67 -71
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +72 -16
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +18 -77
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +75 -34
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +34 -53
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +55 -23
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +23 -55
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +52 -97
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +98 -31
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +31 -194
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +184 -134
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +143 -130
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +131 -30
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +29 -79
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +68 -110
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +121 -34
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +21 -19
- package/dist/fondue-components4.js.map +1 -1
- package/dist/fondue-components40.js +36 -56
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +56 -20
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +20 -25
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +25 -7
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +7 -8
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +9 -41
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +41 -5
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +1 -1
- package/dist/fondue-components48.js +3 -11
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +25 -29
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +33 -54
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +20 -130
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +85 -20
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +13 -53
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +32 -8
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +54 -13
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +130 -16
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +20 -4
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +52 -17
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +7 -18
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +1 -1
- package/dist/fondue-components60.js +13 -44
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +16 -24
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +4 -22
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +18 -7
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +18 -4
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +43 -12
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +24 -4
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +22 -17
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +4 -8
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +4 -36
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +32 -65
- package/dist/fondue-components7.js.map +1 -1
- package/dist/fondue-components70.js +12 -6
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +1 -1
- package/dist/fondue-components72.js +17 -12
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +10 -51
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +37 -44
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +7 -6
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +5 -6
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +13 -13
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +51 -27
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +42 -11
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +65 -51
- package/dist/fondue-components8.js.map +1 -1
- package/dist/fondue-components80.js +6 -5
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +6 -13
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +13 -48
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +27 -22
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +13 -629
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +4 -8
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +12 -12
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +47 -4
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +22 -24
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +628 -16
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +46 -173
- package/dist/fondue-components9.js.map +1 -1
- package/dist/fondue-components90.js +9 -20
- package/dist/fondue-components90.js.map +1 -1
- package/dist/fondue-components91.js +13 -20
- package/dist/fondue-components91.js.map +1 -1
- package/dist/fondue-components92.js +5 -20
- package/dist/fondue-components92.js.map +1 -1
- package/dist/fondue-components93.js +24 -19
- package/dist/fondue-components93.js.map +1 -1
- package/dist/fondue-components94.js +17 -19
- package/dist/fondue-components94.js.map +1 -1
- package/dist/fondue-components95.js +20 -8
- package/dist/fondue-components95.js.map +1 -1
- package/dist/fondue-components96.js +20 -11
- package/dist/fondue-components96.js.map +1 -1
- package/dist/fondue-components97.js +20 -11
- package/dist/fondue-components97.js.map +1 -1
- package/dist/fondue-components98.js +20 -7
- package/dist/fondue-components98.js.map +1 -1
- package/dist/fondue-components99.js +19 -13
- package/dist/fondue-components99.js.map +1 -1
- package/dist/index.d.ts +187 -15
- package/dist/style.css +1 -1
- package/package.json +9 -5
- package/dist/fondue-components148.js +0 -24
- package/dist/fondue-components148.js.map +0 -1
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
const i = (r) => {
|
|
2
|
+
if (r)
|
|
3
|
+
return {
|
|
4
|
+
year: r.getFullYear(),
|
|
5
|
+
// Month is 0-indexed in JavaScript, so we add 1 to get the correct month
|
|
6
|
+
month: r.getMonth() + 1,
|
|
7
|
+
day: r.getDate()
|
|
8
|
+
};
|
|
9
|
+
}, t = (r) => {
|
|
10
|
+
if (r)
|
|
11
|
+
return new Date(r.year, r.month - 1, r.day);
|
|
12
|
+
}, m = (r) => {
|
|
13
|
+
const n = i(r == null ? void 0 : r.from), o = i(r == null ? void 0 : r.to);
|
|
14
|
+
if (!(!n || !o))
|
|
15
|
+
return {
|
|
16
|
+
from: n,
|
|
17
|
+
to: o
|
|
18
|
+
};
|
|
19
|
+
}, u = (r) => {
|
|
20
|
+
if (r)
|
|
21
|
+
return {
|
|
22
|
+
from: t(r.from),
|
|
23
|
+
to: t(r.to)
|
|
24
|
+
};
|
|
25
|
+
}, c = (r) => {
|
|
26
|
+
if (!r)
|
|
27
|
+
return;
|
|
28
|
+
const o = (Array.isArray(r) ? r : [r]).flatMap((f) => {
|
|
29
|
+
if ("before" in f) {
|
|
30
|
+
const s = t(f.before);
|
|
31
|
+
return s ? [{ before: s }] : [];
|
|
32
|
+
}
|
|
33
|
+
const e = t(f.after);
|
|
34
|
+
return e ? [{ after: e }] : [];
|
|
35
|
+
});
|
|
36
|
+
return o.length > 0 ? o : void 0;
|
|
37
37
|
};
|
|
38
38
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
t as transformDatePickerDateToDate,
|
|
40
|
+
u as transformDateRangeToPickerDateRange,
|
|
41
|
+
i as transformDateToDatePickerDate,
|
|
42
|
+
c as transformDisabledDates,
|
|
43
|
+
m as transformPickerDateRangeToDateRange
|
|
42
44
|
};
|
|
43
45
|
//# sourceMappingURL=fondue-components149.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components149.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components149.js","sources":["../src/components/DatePicker/helpers/dateTransformer.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DateRange as InternalDayPickerDateRange } from 'react-day-picker';\n\nimport { type DisabledDatePickerDates, type DatePickerDate, type DatePickerDateRange } from '../types';\n\nexport const transformDateToDatePickerDate = (date?: Date): DatePickerDate | undefined => {\n if (!date) {\n return undefined;\n }\n return {\n year: date.getFullYear(),\n // Month is 0-indexed in JavaScript, so we add 1 to get the correct month\n month: date.getMonth() + 1,\n day: date.getDate(),\n };\n};\n\nexport const transformDatePickerDateToDate = (datePickerDate?: DatePickerDate): Date | undefined => {\n if (!datePickerDate) {\n return undefined;\n }\n // Month is 0-indexed in JavaScript, so we subtract 1 to get the correct month\n return new Date(datePickerDate.year, datePickerDate.month - 1, datePickerDate.day);\n};\n\nexport const transformPickerDateRangeToDateRange = (dateRange?: InternalDayPickerDateRange): DatePickerDateRange => {\n const fromDate = transformDateToDatePickerDate(dateRange?.from);\n const toDate = transformDateToDatePickerDate(dateRange?.to);\n if (!fromDate || !toDate) {\n return undefined;\n }\n\n return {\n from: fromDate,\n to: toDate,\n };\n};\n\nexport const transformDateRangeToPickerDateRange = (\n dateRange?: DatePickerDateRange,\n): InternalDayPickerDateRange | undefined => {\n if (!dateRange) {\n return undefined;\n }\n\n return {\n from: transformDatePickerDateToDate(dateRange.from),\n to: transformDatePickerDateToDate(dateRange.to),\n };\n};\n\ntype DisabledDate = { before: Date } | { after: Date };\n\nexport const transformDisabledDates = (\n disabledDates?: DisabledDatePickerDates | DisabledDatePickerDates[],\n): DisabledDate[] | undefined => {\n if (!disabledDates) {\n return undefined;\n }\n\n const entries = Array.isArray(disabledDates) ? disabledDates : [disabledDates];\n\n const transformedDisabledDates = entries.flatMap((entry): DisabledDate[] => {\n if ('before' in entry) {\n const date = transformDatePickerDateToDate(entry.before);\n return date ? [{ before: date }] : [];\n }\n const date = transformDatePickerDateToDate(entry.after);\n return date ? [{ after: date }] : [];\n });\n\n return transformedDisabledDates.length > 0 ? transformedDisabledDates : undefined;\n};\n"],"names":["transformDateToDatePickerDate","date","transformDatePickerDateToDate","datePickerDate","transformPickerDateRangeToDateRange","dateRange","fromDate","toDate","transformDateRangeToPickerDateRange","transformDisabledDates","disabledDates","transformedDisabledDates","entry"],"mappings":"AAMO,MAAMA,IAAgC,CAACC,MAA4C;AACtF,MAAKA;AAGL,WAAO;AAAA,MACH,MAAMA,EAAK,YAAA;AAAA;AAAA,MAEX,OAAOA,EAAK,SAAA,IAAa;AAAA,MACzB,KAAKA,EAAK,QAAA;AAAA,IAAQ;AAE1B,GAEaC,IAAgC,CAACC,MAAsD;AAChG,MAAKA;AAIL,WAAO,IAAI,KAAKA,EAAe,MAAMA,EAAe,QAAQ,GAAGA,EAAe,GAAG;AACrF,GAEaC,IAAsC,CAACC,MAAgE;AAChH,QAAMC,IAAWN,EAA8BK,KAAA,gBAAAA,EAAW,IAAI,GACxDE,IAASP,EAA8BK,KAAA,gBAAAA,EAAW,EAAE;AAC1D,MAAI,GAACC,KAAY,CAACC;AAIlB,WAAO;AAAA,MACH,MAAMD;AAAA,MACN,IAAIC;AAAA,IAAA;AAEZ,GAEaC,IAAsC,CAC/CH,MACyC;AACzC,MAAKA;AAIL,WAAO;AAAA,MACH,MAAMH,EAA8BG,EAAU,IAAI;AAAA,MAClD,IAAIH,EAA8BG,EAAU,EAAE;AAAA,IAAA;AAEtD,GAIaI,IAAyB,CAClCC,MAC6B;AAC7B,MAAI,CAACA;AACD;AAKJ,QAAMC,KAFU,MAAM,QAAQD,CAAa,IAAIA,IAAgB,CAACA,CAAa,GAEpC,QAAQ,CAACE,MAA0B;AACxE,QAAI,YAAYA,GAAO;AACnB,YAAMX,IAAOC,EAA8BU,EAAM,MAAM;AACvD,aAAOX,IAAO,CAAC,EAAE,QAAQA,EAAAA,CAAM,IAAI,CAAA;AAAA,IACvC;AACA,UAAMA,IAAOC,EAA8BU,EAAM,KAAK;AACtD,WAAOX,IAAO,CAAC,EAAE,OAAOA,EAAA,CAAM,IAAI,CAAA;AAAA,EACtC,CAAC;AAED,SAAOU,EAAyB,SAAS,IAAIA,IAA2B;AAC5E;"}
|
|
@@ -1,125 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { propsToCssVariables as y } from "./fondue-components46.js";
|
|
4
|
+
import x from "./fondue-components69.js";
|
|
5
|
+
const u = n(
|
|
6
|
+
({
|
|
7
|
+
as: a = "div",
|
|
8
|
+
"data-test-id": e = "fondue-flex",
|
|
9
|
+
children: r,
|
|
10
|
+
role: i,
|
|
11
|
+
"aria-label": d,
|
|
12
|
+
"aria-hidden": s,
|
|
13
|
+
"aria-describedby": t,
|
|
14
|
+
"aria-labelledby": o,
|
|
15
|
+
"aria-expanded": l,
|
|
16
|
+
"aria-haspopup": p,
|
|
17
|
+
...b
|
|
18
|
+
}, f) => /* @__PURE__ */ m(
|
|
19
|
+
a,
|
|
20
|
+
{
|
|
21
|
+
className: x.root,
|
|
22
|
+
"data-test-id": e,
|
|
23
|
+
style: y(b, { justify: "justify-content" }),
|
|
24
|
+
role: i,
|
|
25
|
+
"aria-label": d,
|
|
26
|
+
"aria-hidden": s,
|
|
27
|
+
"aria-describedby": t,
|
|
28
|
+
"aria-labelledby": o,
|
|
29
|
+
"aria-expanded": l,
|
|
30
|
+
"aria-haspopup": p,
|
|
31
|
+
ref: f,
|
|
32
|
+
children: r
|
|
33
|
+
}
|
|
34
|
+
)
|
|
24
35
|
);
|
|
25
|
-
|
|
26
|
-
const D = {
|
|
27
|
-
compact: 8,
|
|
28
|
-
comfortable: 12,
|
|
29
|
-
spacious: 16
|
|
30
|
-
}, H = {
|
|
31
|
-
compact: 8,
|
|
32
|
-
spacious: 24
|
|
33
|
-
}, p = ({
|
|
34
|
-
align: t = "start",
|
|
35
|
-
maxWidth: o = "360px",
|
|
36
|
-
padding: a = "compact",
|
|
37
|
-
rounded: r = "medium",
|
|
38
|
-
width: d = "fit-content",
|
|
39
|
-
shadow: n = "medium",
|
|
40
|
-
side: N,
|
|
41
|
-
triggerOffset: v = "compact",
|
|
42
|
-
viewportCollisionPadding: C = "compact",
|
|
43
|
-
"data-test-id": P = "fondue-flyout-content",
|
|
44
|
-
children: R,
|
|
45
|
-
...b
|
|
46
|
-
}, w) => {
|
|
47
|
-
const { theme: A, dir: c } = S(), T = (s) => !s || c === "ltr" ? s : s === "left" ? "right" : s === "right" ? "left" : s;
|
|
48
|
-
return /* @__PURE__ */ e(l.Portal, { children: /* @__PURE__ */ m(j, { theme: A, dir: c, children: [
|
|
49
|
-
/* @__PURE__ */ e("div", { "data-test-id": "fondue-flyout-overlay", className: u.overlay }),
|
|
50
|
-
/* @__PURE__ */ e(
|
|
51
|
-
l.Content,
|
|
52
|
-
{
|
|
53
|
-
dir: c,
|
|
54
|
-
style: {
|
|
55
|
-
"--flyout-max-width": o,
|
|
56
|
-
"--flyout-width": d
|
|
57
|
-
},
|
|
58
|
-
ref: w,
|
|
59
|
-
align: t,
|
|
60
|
-
collisionPadding: H[C],
|
|
61
|
-
sideOffset: D[v],
|
|
62
|
-
side: T(N),
|
|
63
|
-
className: u.root,
|
|
64
|
-
"data-flyout-spacing": a,
|
|
65
|
-
"data-rounded": r,
|
|
66
|
-
"data-shadow": n,
|
|
67
|
-
"data-test-id": P,
|
|
68
|
-
onFocus: B,
|
|
69
|
-
...b,
|
|
70
|
-
children: R
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
] }) });
|
|
74
|
-
};
|
|
75
|
-
p.displayName = "Flyout.Content";
|
|
76
|
-
const F = ({ showCloseButton: t, children: o, "data-test-id": a = "fondue-flyout-header", closeProps: r }, d) => {
|
|
77
|
-
const { t: n } = I();
|
|
78
|
-
return /* @__PURE__ */ m("div", { "data-test-id": a, ref: d, className: u.header, children: [
|
|
79
|
-
/* @__PURE__ */ e("div", { children: o }),
|
|
80
|
-
t && /* @__PURE__ */ e(l.Close, { asChild: !0, ...r, children: /* @__PURE__ */ e(
|
|
81
|
-
O,
|
|
82
|
-
{
|
|
83
|
-
size: "small",
|
|
84
|
-
aspect: "square",
|
|
85
|
-
emphasis: "weak",
|
|
86
|
-
"aria-label": n("Flyout_close"),
|
|
87
|
-
"data-test-id": `${a}-close`,
|
|
88
|
-
children: /* @__PURE__ */ e(x, { size: 20 })
|
|
89
|
-
}
|
|
90
|
-
) })
|
|
91
|
-
] });
|
|
92
|
-
};
|
|
93
|
-
F.displayName = "Flyout.Header";
|
|
94
|
-
const g = ({ children: t, "data-test-id": o = "fondue-flyout-footer" }, a) => /* @__PURE__ */ e("div", { "data-test-id": o, ref: a, className: u.footer, children: t });
|
|
95
|
-
g.displayName = "Flyout.Footer";
|
|
96
|
-
const h = ({ children: t, "data-test-id": o = "fondue-flyout-body", scrollable: a = !1 }, r) => /* @__PURE__ */ e(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
"data-test-id": o,
|
|
100
|
-
ref: r,
|
|
101
|
-
"data-flyout-spacing": "compact",
|
|
102
|
-
"data-scrollable": a,
|
|
103
|
-
className: u.body,
|
|
104
|
-
children: t
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
h.displayName = "Flyout.Body";
|
|
108
|
-
const W = {
|
|
109
|
-
Root: f,
|
|
110
|
-
Trigger: i(y),
|
|
111
|
-
Content: i(p),
|
|
112
|
-
Header: i(F),
|
|
113
|
-
Footer: i(g),
|
|
114
|
-
Body: i(h)
|
|
115
|
-
};
|
|
36
|
+
u.displayName = "Flex";
|
|
116
37
|
export {
|
|
117
|
-
|
|
118
|
-
h as FlyoutBody,
|
|
119
|
-
p as FlyoutContent,
|
|
120
|
-
g as FlyoutFooter,
|
|
121
|
-
F as FlyoutHeader,
|
|
122
|
-
f as FlyoutRoot,
|
|
123
|
-
y as FlyoutTrigger
|
|
38
|
+
u as Flex
|
|
124
39
|
};
|
|
125
40
|
//# sourceMappingURL=fondue-components15.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components15.js","sources":["../src/components/Flyout/Flyout.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { forwardRef, type CSSProperties, type ForwardedRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { useTranslation } from '#/hooks/useTranslation';\nimport { addAutoFocusAttribute, addShowFocusRing } from '#/utilities/domUtilities';\n\nimport { Button } from '../Button/Button';\nimport { ThemeProvider, useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport styles from './styles/flyout.module.scss';\n\nexport type FlyoutRootProps = {\n /**\n * Disable interaction with the rest of the page\n * @default false\n */\n modal?: boolean;\n /**\n * The controlled `open` state of the flyout\n * @default false\n */\n open?: boolean;\n /**\n * Event handler called when the `open` state changes\n */\n onOpenChange?: (open: boolean) => void;\n children?: ReactNode;\n};\n\nexport const FlyoutRoot = ({ children, ...props }: FlyoutRootProps) => {\n return <RadixPopover.Root {...props}>{children}</RadixPopover.Root>;\n};\nFlyoutRoot.displayName = 'Flyout.Root';\n\nexport type FlyoutTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const FlyoutTrigger = (\n { asChild = true, children, 'data-test-id': dataTestId = 'fondue-flyout-trigger', ...props }: FlyoutTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixPopover.Trigger\n onMouseDown={addAutoFocusAttribute}\n data-auto-focus-visible=\"true\"\n data-auto-focus-trigger\n data-test-id={dataTestId}\n asChild={asChild}\n ref={ref}\n {...props}\n >\n {children}\n </RadixPopover.Trigger>\n );\n};\nFlyoutTrigger.displayName = 'Flyout.Trigger';\n\ntype FlyoutSpacing = 'compact' | 'comfortable' | 'spacious';\ntype FlyoutViewportCollisionPadding = 'compact' | 'spacious';\nexport type FlyoutContentProps = {\n /**\n * Add a shadow to the flyout\n * @default \"medium\"\n */\n shadow?: 'none' | 'medium' | 'large';\n /**\n * Add rounded corners to the flyout\n * @default \"medium\"\n */\n rounded?: 'none' | 'medium' | 'large';\n /**\n * Define the prefered side of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Define the prefered alignment of the flyout. Can be overriden by viewport collisions viewport.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Define the padding of the flyout\n * @default \"compact\"\n */\n padding?: 'none' | 'tight' | 'compact' | 'comfortable' | 'spacious';\n /**\n * Define the fixed width of the flyout\n * @default \"fit-content\"\n */\n width?: string;\n /**\n * Defines the spacing between the dropdown and its trigger.\n * @default 'compact'\n */\n triggerOffset?: FlyoutSpacing;\n /**\n * Define the maximum width of the flyout\n * @default \"360px\"\n */\n maxWidth?: string;\n /**\n * Define the minimum distance between the flyout and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: FlyoutViewportCollisionPadding;\n /**\n * Event handler called when auto-focusing on open\n */\n onOpenAutoFocus?: (event: Event) => void;\n /**\n * Event handler called when the escape key is pressed.\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nconst SPACING_MAP: Record<FlyoutSpacing, number> = {\n compact: 8,\n comfortable: 12,\n spacious: 16,\n};\n\nconst VIEWPORT_COLLISION_PADDING_MAP: Record<FlyoutViewportCollisionPadding, number> = {\n compact: 8,\n spacious: 24,\n};\n\nexport const FlyoutContent = (\n {\n align = 'start',\n maxWidth = '360px',\n padding = 'compact',\n rounded = 'medium',\n width = 'fit-content',\n shadow = 'medium',\n side,\n triggerOffset = 'compact',\n viewportCollisionPadding = 'compact',\n 'data-test-id': dataTestId = 'fondue-flyout-content',\n children,\n ...props\n }: FlyoutContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { theme, dir } = useFondueTheme();\n\n const getAdjustedSide = (side?: 'top' | 'right' | 'bottom' | 'left') => {\n if (!side || dir === 'ltr') {\n return side;\n }\n\n if (side === 'left') {\n return 'right';\n }\n if (side === 'right') {\n return 'left';\n }\n\n return side;\n };\n\n return (\n <RadixPopover.Portal>\n <ThemeProvider theme={theme} dir={dir}>\n <div data-test-id=\"fondue-flyout-overlay\" className={styles.overlay} />\n <RadixPopover.Content\n dir={dir}\n style={\n {\n '--flyout-max-width': maxWidth,\n '--flyout-width': width,\n } as CSSProperties\n }\n ref={ref}\n align={align}\n collisionPadding={VIEWPORT_COLLISION_PADDING_MAP[viewportCollisionPadding]}\n sideOffset={SPACING_MAP[triggerOffset]}\n side={getAdjustedSide(side)}\n className={styles.root}\n data-flyout-spacing={padding}\n data-rounded={rounded}\n data-shadow={shadow}\n data-test-id={dataTestId}\n onFocus={addShowFocusRing}\n {...props}\n >\n {children}\n </RadixPopover.Content>\n </ThemeProvider>\n </RadixPopover.Portal>\n );\n};\nFlyoutContent.displayName = 'Flyout.Content';\n\nexport type FlyoutHeaderProps = {\n /**\n * Show a close button in the header\n * @default false\n */\n showCloseButton?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n closeProps?: CommonAriaProps;\n};\n\nexport const FlyoutHeader = (\n { showCloseButton, children, 'data-test-id': dataTestId = 'fondue-flyout-header', closeProps }: FlyoutHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { t } = useTranslation();\n\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.header}>\n <div>{children}</div>\n {showCloseButton && (\n <RadixPopover.Close asChild {...closeProps}>\n <Button\n size=\"small\"\n aspect=\"square\"\n emphasis=\"weak\"\n aria-label={t('Flyout_close')}\n data-test-id={`${dataTestId}-close`}\n >\n <IconCross size={20} />\n </Button>\n </RadixPopover.Close>\n )}\n </div>\n );\n};\nFlyoutHeader.displayName = 'Flyout.Header';\n\nexport type FlyoutFooterProps = { children?: ReactNode; 'data-test-id'?: string };\n\nexport const FlyoutFooter = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-footer' }: FlyoutFooterProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-test-id={dataTestId} ref={ref} className={styles.footer}>\n {children}\n </div>\n );\n};\nFlyoutFooter.displayName = 'Flyout.Footer';\n\nexport type FlyoutBodyProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * Allow the body to scroll if the max height of the flyout is reached\n * @default false\n */\n scrollable?: boolean;\n};\n\nexport const FlyoutBody = (\n { children, 'data-test-id': dataTestId = 'fondue-flyout-body', scrollable = false }: FlyoutBodyProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-test-id={dataTestId}\n ref={ref}\n data-flyout-spacing=\"compact\"\n data-scrollable={scrollable}\n className={styles.body}\n >\n {children}\n </div>\n );\n};\nFlyoutBody.displayName = 'Flyout.Body';\n\nexport const Flyout = {\n Root: FlyoutRoot,\n Trigger: forwardRef<HTMLButtonElement, FlyoutTriggerProps>(FlyoutTrigger),\n Content: forwardRef<HTMLDivElement, FlyoutContentProps>(FlyoutContent),\n Header: forwardRef<HTMLDivElement, FlyoutHeaderProps>(FlyoutHeader),\n Footer: forwardRef<HTMLDivElement, FlyoutFooterProps>(FlyoutFooter),\n Body: forwardRef<HTMLDivElement, FlyoutBodyProps>(FlyoutBody),\n};\n"],"names":["FlyoutRoot","children","props","RadixPopover","FlyoutTrigger","asChild","dataTestId","ref","jsx","addAutoFocusAttribute","SPACING_MAP","VIEWPORT_COLLISION_PADDING_MAP","FlyoutContent","align","maxWidth","padding","rounded","width","shadow","side","triggerOffset","viewportCollisionPadding","theme","dir","useFondueTheme","getAdjustedSide","jsxs","ThemeProvider","styles","addShowFocusRing","FlyoutHeader","showCloseButton","closeProps","t","useTranslation","Button","IconCross","FlyoutFooter","FlyoutBody","scrollable","Flyout","forwardRef"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"fondue-components15.js","sources":["../src/components/Flex/Flex.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\nimport { type Responsive, type SizeValue, type LayoutComponentProps } from '#/helpers/layout';\nimport { propsToCssVariables } from '#/helpers/propsToCssVariables';\n\nimport styles from './styles/flex.module.scss';\n\nexport type FlexProps = LayoutComponentProps & {\n /**\n * The element to render the Flex component as.\n * @default 'div'\n */\n as?: 'div' | 'span';\n /**\n * The display property.\n * @default 'flex'\n */\n display?: Responsive<'none' | 'flex' | 'inline-flex'>;\n /**\n * The direction of the children.\n * @default 'row'\n */\n direction?: Responsive<'row' | 'row-reverse' | 'column' | 'column-reverse'>;\n /**\n * The alignment of the children.\n */\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n /**\n * The justification of the children.\n */\n justify?: Responsive<'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'>;\n /**\n * The wrap property.\n */\n wrap?: Responsive<'nowrap' | 'wrap' | 'wrap-reverse'>;\n /**\n * The gap between the children.\n */\n gap?: Responsive<SizeValue>;\n /**\n * The horizontal gap between the children.\n */\n gapX?: Responsive<SizeValue>;\n /**\n * The vertical gap between the children.\n */\n gapY?: Responsive<SizeValue>;\n\n children?: ReactNode;\n 'data-test-id'?: string;\n} & CommonAriaProps;\n\nexport const Flex = forwardRef<HTMLDivElement, FlexProps>(\n (\n {\n as: Component = 'div',\n 'data-test-id': dataTestId = 'fondue-flex',\n children,\n role,\n 'aria-label': ariaLabel,\n 'aria-hidden': ariaHidden,\n 'aria-describedby': ariaDescribedBy,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-expanded': ariaExpanded,\n 'aria-haspopup': ariaHasPopup,\n ...props\n },\n ref,\n ) => {\n return (\n <Component\n className={styles.root}\n data-test-id={dataTestId}\n style={propsToCssVariables(props, { justify: 'justify-content' })}\n role={role}\n aria-label={ariaLabel}\n aria-hidden={ariaHidden}\n aria-describedby={ariaDescribedBy}\n aria-labelledby={ariaLabelledBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n ref={ref}\n >\n {children}\n </Component>\n );\n },\n);\nFlex.displayName = 'Flex';\n"],"names":["Flex","forwardRef","Component","dataTestId","children","role","ariaLabel","ariaHidden","ariaDescribedBy","ariaLabelledBy","ariaExpanded","ariaHasPopup","props","ref","jsx","styles","propsToCssVariables"],"mappings":";;;;AAuDO,MAAMA,IAAOC;AAAA,EAChB,CACI;AAAA,IACI,IAAIC,IAAY;AAAA,IAChB,gBAAgBC,IAAa;AAAA,IAC7B,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAcC;AAAA,IACd,eAAeC;AAAA,IACf,oBAAoBC;AAAA,IACpB,mBAAmBC;AAAA,IACnB,iBAAiBC;AAAA,IACjB,iBAAiBC;AAAA,IACjB,GAAGC;AAAA,EAAA,GAEPC,MAGI,gBAAAC;AAAA,IAACZ;AAAA,IAAA;AAAA,MACG,WAAWa,EAAO;AAAA,MAClB,gBAAcZ;AAAA,MACd,OAAOa,EAAoBJ,GAAO,EAAE,SAAS,mBAAmB;AAAA,MAChE,MAAAP;AAAA,MACA,cAAYC;AAAA,MACZ,eAAaC;AAAA,MACb,oBAAkBC;AAAA,MAClB,mBAAiBC;AAAA,MACjB,iBAAeC;AAAA,MACf,iBAAeC;AAAA,MACf,KAAAE;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA;AAIjB;AACAJ,EAAK,cAAc;"}
|
|
@@ -1,71 +1,44 @@
|
|
|
1
|
-
const a = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
other: "about {{count}} hours"
|
|
22
|
-
},
|
|
23
|
-
xHours: {
|
|
24
|
-
one: "1 hour",
|
|
25
|
-
other: "{{count}} hours"
|
|
26
|
-
},
|
|
27
|
-
xDays: {
|
|
28
|
-
one: "1 day",
|
|
29
|
-
other: "{{count}} days"
|
|
30
|
-
},
|
|
31
|
-
aboutXWeeks: {
|
|
32
|
-
one: "about 1 week",
|
|
33
|
-
other: "about {{count}} weeks"
|
|
34
|
-
},
|
|
35
|
-
xWeeks: {
|
|
36
|
-
one: "1 week",
|
|
37
|
-
other: "{{count}} weeks"
|
|
38
|
-
},
|
|
39
|
-
aboutXMonths: {
|
|
40
|
-
one: "about 1 month",
|
|
41
|
-
other: "about {{count}} months"
|
|
42
|
-
},
|
|
43
|
-
xMonths: {
|
|
44
|
-
one: "1 month",
|
|
45
|
-
other: "{{count}} months"
|
|
46
|
-
},
|
|
47
|
-
aboutXYears: {
|
|
48
|
-
one: "about 1 year",
|
|
49
|
-
other: "about {{count}} years"
|
|
50
|
-
},
|
|
51
|
-
xYears: {
|
|
52
|
-
one: "1 year",
|
|
53
|
-
other: "{{count}} years"
|
|
54
|
-
},
|
|
55
|
-
overXYears: {
|
|
56
|
-
one: "over 1 year",
|
|
57
|
-
other: "over {{count}} years"
|
|
58
|
-
},
|
|
59
|
-
almostXYears: {
|
|
60
|
-
one: "almost 1 year",
|
|
61
|
-
other: "almost {{count}} years"
|
|
62
|
-
}
|
|
63
|
-
}, r = (s, n, o) => {
|
|
64
|
-
let e;
|
|
65
|
-
const t = a[s];
|
|
66
|
-
return typeof t == "string" ? e = t : n === 1 ? e = t.one : e = t.other.replace("{{count}}", n.toString()), o != null && o.addSuffix ? o.comparison && o.comparison > 0 ? "in " + e : e + " ago" : e;
|
|
1
|
+
const e = "_wrapper_1iuqu_4", t = "_root_1iuqu_8", o = "_toggleMonthButtonContainer_1iuqu_8", n = "_nextMonthButtonContainer_1iuqu_22", _ = "_weekday_1iuqu_27", u = "_weekdays_1iuqu_39", d = "_week_1iuqu_27", s = "_day_1iuqu_49", c = "_disabled_1iuqu_70", i = "_dayContent_1iuqu_73", r = "_outside_1iuqu_77", a = "_dayButton_1iuqu_90", l = "_selected_1iuqu_124", q = "_selectedMiddle_1iuqu_134", y = "_selectedStart_1iuqu_147", h = "_selectedEnd_1iuqu_147", w = "_hoverAfter_1iuqu_180", B = "_hoverSelected_1iuqu_193", k = "_hoverBefore_1iuqu_254", v = {
|
|
2
|
+
wrapper: e,
|
|
3
|
+
root: t,
|
|
4
|
+
toggleMonthButtonContainer: o,
|
|
5
|
+
nextMonthButtonContainer: n,
|
|
6
|
+
weekday: _,
|
|
7
|
+
weekdays: u,
|
|
8
|
+
week: d,
|
|
9
|
+
day: s,
|
|
10
|
+
disabled: c,
|
|
11
|
+
dayContent: i,
|
|
12
|
+
outside: r,
|
|
13
|
+
dayButton: a,
|
|
14
|
+
selected: l,
|
|
15
|
+
selectedMiddle: q,
|
|
16
|
+
selectedStart: y,
|
|
17
|
+
selectedEnd: h,
|
|
18
|
+
hoverAfter: w,
|
|
19
|
+
hoverSelected: B,
|
|
20
|
+
hoverBefore: k
|
|
67
21
|
};
|
|
68
22
|
export {
|
|
69
|
-
|
|
23
|
+
s as day,
|
|
24
|
+
a as dayButton,
|
|
25
|
+
i as dayContent,
|
|
26
|
+
v as default,
|
|
27
|
+
c as disabled,
|
|
28
|
+
w as hoverAfter,
|
|
29
|
+
k as hoverBefore,
|
|
30
|
+
B as hoverSelected,
|
|
31
|
+
n as nextMonthButtonContainer,
|
|
32
|
+
r as outside,
|
|
33
|
+
t as root,
|
|
34
|
+
l as selected,
|
|
35
|
+
h as selectedEnd,
|
|
36
|
+
q as selectedMiddle,
|
|
37
|
+
y as selectedStart,
|
|
38
|
+
o as toggleMonthButtonContainer,
|
|
39
|
+
d as week,
|
|
40
|
+
_ as weekday,
|
|
41
|
+
u as weekdays,
|
|
42
|
+
e as wrapper
|
|
70
43
|
};
|
|
71
44
|
//# sourceMappingURL=fondue-components150.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components150.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components150.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,34 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
defaultWidth: "full"
|
|
21
|
-
}),
|
|
22
|
-
time: t({
|
|
23
|
-
formats: a,
|
|
24
|
-
defaultWidth: "full"
|
|
25
|
-
}),
|
|
26
|
-
dateTime: t({
|
|
27
|
-
formats: o,
|
|
28
|
-
defaultWidth: "full"
|
|
29
|
-
})
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { IconCross as s } from "@frontify/fondue-icons";
|
|
3
|
+
import { Button as t } from "./fondue-components6.js";
|
|
4
|
+
import { useTranslation as a } from "./fondue-components43.js";
|
|
5
|
+
import l from "./fondue-components122.js";
|
|
6
|
+
const f = ({ onClear: r }) => {
|
|
7
|
+
const { t: o } = a();
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
|
+
t,
|
|
10
|
+
{
|
|
11
|
+
"aria-label": o("Select_clear"),
|
|
12
|
+
type: "button",
|
|
13
|
+
size: "small",
|
|
14
|
+
emphasis: "weak",
|
|
15
|
+
aspect: "square",
|
|
16
|
+
onPress: r,
|
|
17
|
+
children: /* @__PURE__ */ e(s, { className: l.clearIcon, size: 16 })
|
|
18
|
+
}
|
|
19
|
+
);
|
|
30
20
|
};
|
|
31
21
|
export {
|
|
32
|
-
|
|
22
|
+
f as SelectClear
|
|
33
23
|
};
|
|
34
24
|
//# sourceMappingURL=fondue-components151.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components151.js","sources":["
|
|
1
|
+
{"version":3,"file":"fondue-components151.js","sources":["../src/components/Select/components/SelectClear.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCross } from '@frontify/fondue-icons';\n\nimport { Button } from '#/components/Button/Button';\nimport { useTranslation } from '#/hooks/useTranslation';\n\nimport styles from '../styles/select.module.scss';\n\nexport const SelectClear = ({ onClear }: { onClear?: () => void }) => {\n const { t } = useTranslation();\n\n return (\n <Button\n aria-label={t('Select_clear')}\n type=\"button\"\n size=\"small\"\n emphasis=\"weak\"\n aspect=\"square\"\n onPress={onClear}\n >\n <IconCross className={styles.clearIcon} size={16} />\n </Button>\n );\n};\n"],"names":["SelectClear","onClear","t","useTranslation","jsx","Button","IconCross","styles"],"mappings":";;;;;AASO,MAAMA,IAAc,CAAC,EAAE,SAAAC,QAAwC;AAClE,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAA;AAEd,SACI,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,cAAYH,EAAE,cAAc;AAAA,MAC5B,MAAK;AAAA,MACL,MAAK;AAAA,MACL,UAAS;AAAA,MACT,QAAO;AAAA,MACP,SAASD;AAAA,MAET,4BAACK,GAAA,EAAU,WAAWC,EAAO,WAAW,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA;AAG9D;"}
|
|
@@ -1,12 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Children as a, isValidElement as u, cloneElement as f } from "react";
|
|
2
|
+
import { ForwardedRefSelectItem as E } from "./fondue-components99.js";
|
|
3
|
+
const g = ({
|
|
4
|
+
children: o,
|
|
5
|
+
value: r,
|
|
6
|
+
label: s
|
|
7
|
+
}) => o && typeof o == "string" ? {
|
|
8
|
+
value: r !== void 0 ? r : o,
|
|
9
|
+
label: s !== void 0 ? s : o
|
|
10
|
+
} : {
|
|
11
|
+
value: r ?? "",
|
|
12
|
+
label: s !== void 0 ? s : r ?? "",
|
|
13
|
+
...o ? { children: o } : null
|
|
14
|
+
}, v = (o, r) => u(o) && o.type === r, w = (o, r, s, p = 0) => {
|
|
15
|
+
const n = [];
|
|
16
|
+
let t = 0;
|
|
17
|
+
return a.forEach(o, (e) => {
|
|
18
|
+
if (v(e, E) && u(e))
|
|
19
|
+
g(e.props).label.toLowerCase().includes((s == null ? void 0 : s.toLowerCase()) || "") && (n.push(r(e, p + t)), t++);
|
|
20
|
+
else if (u(e) && (e != null && e.props.children)) {
|
|
21
|
+
const { parsedChildren: m, subElementCount: C } = w(
|
|
22
|
+
e.props.children,
|
|
23
|
+
r,
|
|
24
|
+
"",
|
|
25
|
+
p + t
|
|
26
|
+
);
|
|
27
|
+
e = f(e, {
|
|
28
|
+
children: m,
|
|
29
|
+
key: `group-${p + t}`
|
|
30
|
+
}), n.push(e), t += C;
|
|
31
|
+
} else
|
|
32
|
+
n.push(e);
|
|
33
|
+
}), {
|
|
34
|
+
parsedChildren: n,
|
|
35
|
+
subElementCount: t
|
|
36
|
+
};
|
|
37
|
+
};
|
|
9
38
|
export {
|
|
10
|
-
|
|
39
|
+
g as getSelectOptionValue,
|
|
40
|
+
v as isReactLeaf,
|
|
41
|
+
w as recursiveMap
|
|
11
42
|
};
|
|
12
43
|
//# sourceMappingURL=fondue-components152.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components152.js","sources":["
|
|
1
|
+
{"version":3,"file":"fondue-components152.js","sources":["../src/components/Select/utils.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Children,\n cloneElement,\n isValidElement,\n type JSXElementConstructor,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport { ForwardedRefSelectItem, type SelectItemProps } from './components/SelectItem';\n\n/**\n * Extracts and returns an object containing `value` and `label` from a given SelectItemProps object.\n * It prioritizes explicit `value` and `label` properties but will fall back to using `children` as the value or label if necessary.\n *\n * @param {SelectItemProps} props - The properties of a select item, which include potential children, value, and label.\n * @returns {{ value: string; label: string, children?: ReactNode }} An object containing `value` and `label` as strings.\n *\n * @example\n * // Returns { value: 'option1', label: 'Option 1' }\n * getSelectOptionValue({ value: 'option1', label: 'Option 1' });\n *\n * @example\n * // Uses children as the value and label when they are not explicitly provided\n * // Returns { value: 'Default', label: 'Default' }\n * getSelectOptionValue({ children: 'Default' });\n */\nexport const getSelectOptionValue = ({\n children,\n value,\n label,\n}: SelectItemProps): {\n value: string;\n label: string;\n children?: ReactNode;\n} => {\n if (children && typeof children === 'string') {\n return {\n value: value !== undefined ? value : children,\n label: label !== undefined ? label : children,\n };\n }\n\n return {\n value: value ?? '',\n label: label !== undefined ? label : (value ?? ''),\n ...(children ? { children } : null),\n };\n};\n/**\n * Determines if the child is a leaf node of React, meaning it has one final child of a native type;\n *\n * @param {ReactNode} child - The React child node to check.\n * @param {JSXElementConstructor<never>} Component - The React component constructor used for comparison.\n * @returns {boolean} Returns true if the `child` is a valid React element of the specified `Component` type.\n *\n * @example\n * // Assuming ForwardedRefSelectItem is a component that renders an <input> element\n * // Returns true\n * isReactLeaf(<ForwardedRefSelectItem />, ForwardedRefSelectItem);\n *\n * @example\n * // Returns false for non-matching types or non-leaf components\n * isReactLeaf(<div><ForwardedRefSelectItem /></div>, ForwardedRefSelectItem);\n */\nexport const isReactLeaf = (child: ReactNode, Component: JSXElementConstructor<never>): child is ReactElement =>\n isValidElement(child) && child.type === Component;\n\n/**\n * Recursively maps through React children, applying a callback to each child that meets the specified conditions.\n * This function is useful for deeply nested structures where modifications or checks are needed at multiple levels.\n *\n * @param {ReactNode} children - The children to be recursively processed.\n * @param {function(ReactNode, number): ReactNode} callback - A function that is called for each child that meets the condition. It receives the child and its index, and returns a React node.\n * @param {string} [filterText=''] - Optional text used to filter children based on their properties.\n * @param {number} [nextIndex=0] - The starting index for numbering children, defaults to 0.\n * @returns {{ parsedChildren: ReactNode[], subElementCount: number }} An object containing the transformed children array and the count of all processed sub-elements.\n *\n * @example\n * // Example usage in a select component where only items containing a certain text are modified\n * recursiveMap(children, (child, index) => React.cloneElement(child, { extraProp: 'value' }), 'specific text');\n *\n * @example\n * // Nested structure transformation, adding class names based on index\n * recursiveMap(children, (child, index) => React.cloneElement(child, { className: `item-${index}` }));\n */\nexport const recursiveMap = (\n children: ReactNode,\n callback: (child: ReactNode, nextIndex: number) => ReactNode,\n filterText?: string,\n nextIndex: number = 0,\n): {\n parsedChildren: ReactNode[];\n subElementCount: number;\n} => {\n const resultingChildren: ReactNode[] = [];\n let itemCounter = 0;\n Children.forEach(children, (child) => {\n if (isReactLeaf(child, ForwardedRefSelectItem) && isValidElement<SelectItemProps>(child)) {\n if (\n getSelectOptionValue(child.props)\n .label.toLowerCase()\n .includes(filterText?.toLowerCase() || '')\n ) {\n resultingChildren.push(callback(child, nextIndex + itemCounter));\n itemCounter++;\n }\n } else if (isValidElement<{ children: ReactNode }>(child) && child?.props.children) {\n const { parsedChildren, subElementCount } = recursiveMap(\n child.props.children,\n callback,\n '',\n nextIndex + itemCounter,\n );\n child = cloneElement(child, {\n children: parsedChildren,\n key: `group-${nextIndex + itemCounter}`,\n });\n resultingChildren.push(child);\n itemCounter += subElementCount;\n } else {\n resultingChildren.push(child);\n }\n });\n return {\n parsedChildren: resultingChildren,\n subElementCount: itemCounter,\n };\n};\n"],"names":["getSelectOptionValue","children","value","label","isReactLeaf","child","Component","isValidElement","recursiveMap","callback","filterText","nextIndex","resultingChildren","itemCounter","Children","ForwardedRefSelectItem","parsedChildren","subElementCount","cloneElement"],"mappings":";;AA6BO,MAAMA,IAAuB,CAAC;AAAA,EACjC,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AACJ,MAKQF,KAAY,OAAOA,KAAa,WACzB;AAAA,EACH,OAAOC,MAAU,SAAYA,IAAQD;AAAA,EACrC,OAAOE,MAAU,SAAYA,IAAQF;AAAA,IAItC;AAAA,EACH,OAAOC,KAAS;AAAA,EAChB,OAAOC,MAAU,SAAYA,IAASD,KAAS;AAAA,EAC/C,GAAID,IAAW,EAAE,UAAAA,MAAa;AAAA,GAmBzBG,IAAc,CAACC,GAAkBC,MAC1CC,EAAeF,CAAK,KAAKA,EAAM,SAASC,GAoB/BE,IAAe,CACxBP,GACAQ,GACAC,GACAC,IAAoB,MAInB;AACD,QAAMC,IAAiC,CAAA;AACvC,MAAIC,IAAc;AAClB,SAAAC,EAAS,QAAQb,GAAU,CAACI,MAAU;AAClC,QAAID,EAAYC,GAAOU,CAAsB,KAAKR,EAAgCF,CAAK;AACnF,MACIL,EAAqBK,EAAM,KAAK,EAC3B,MAAM,cACN,UAASK,KAAA,gBAAAA,EAAY,kBAAiB,EAAE,MAE7CE,EAAkB,KAAKH,EAASJ,GAAOM,IAAYE,CAAW,CAAC,GAC/DA;AAAA,aAEGN,EAAwCF,CAAK,MAAKA,KAAA,QAAAA,EAAO,MAAM,WAAU;AAChF,YAAM,EAAE,gBAAAW,GAAgB,iBAAAC,EAAA,IAAoBT;AAAA,QACxCH,EAAM,MAAM;AAAA,QACZI;AAAA,QACA;AAAA,QACAE,IAAYE;AAAA,MAAA;AAEhB,MAAAR,IAAQa,EAAab,GAAO;AAAA,QACxB,UAAUW;AAAA,QACV,KAAK,SAASL,IAAYE,CAAW;AAAA,MAAA,CACxC,GACDD,EAAkB,KAAKP,CAAK,GAC5BQ,KAAeI;AAAA,IACnB;AACI,MAAAL,EAAkB,KAAKP,CAAK;AAAA,EAEpC,CAAC,GACM;AAAA,IACH,gBAAgBO;AAAA,IAChB,iBAAiBC;AAAA,EAAA;AAEzB;"}
|