@frontify/fondue-components 29.2.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-components10.js +89 -84
- package/dist/fondue-components10.js.map +1 -1
- package/dist/fondue-components100.js +1 -1
- package/dist/fondue-components112.js +14 -14
- package/dist/fondue-components114.js +1 -1
- package/dist/fondue-components118.js +216 -16
- package/dist/fondue-components118.js.map +1 -1
- package/dist/fondue-components119.js +19 -14
- package/dist/fondue-components119.js.map +1 -1
- package/dist/fondue-components120.js +16 -16
- package/dist/fondue-components120.js.map +1 -1
- package/dist/fondue-components121.js +147 -107
- package/dist/fondue-components121.js.map +1 -1
- package/dist/fondue-components122.js +44 -12
- package/dist/fondue-components122.js.map +1 -1
- package/dist/fondue-components123.js +17 -17
- package/dist/fondue-components123.js.map +1 -1
- package/dist/fondue-components124.js +14 -13
- package/dist/fondue-components124.js.map +1 -1
- package/dist/fondue-components125.js +16 -32
- package/dist/fondue-components125.js.map +1 -1
- package/dist/fondue-components126.js +111 -6
- package/dist/fondue-components126.js.map +1 -1
- package/dist/fondue-components127.js +12 -126
- package/dist/fondue-components127.js.map +1 -1
- package/dist/fondue-components128.js +16 -10
- package/dist/fondue-components128.js.map +1 -1
- package/dist/fondue-components129.js +12 -35
- package/dist/fondue-components129.js.map +1 -1
- package/dist/fondue-components130.js +122 -212
- package/dist/fondue-components130.js.map +1 -1
- package/dist/fondue-components131.js +11 -19
- package/dist/fondue-components131.js.map +1 -1
- package/dist/fondue-components132.js +35 -16
- package/dist/fondue-components132.js.map +1 -1
- package/dist/fondue-components133.js +32 -150
- package/dist/fondue-components133.js.map +1 -1
- package/dist/fondue-components134.js +6 -45
- package/dist/fondue-components134.js.map +1 -1
- package/dist/fondue-components135.js +6 -170
- package/dist/fondue-components135.js.map +1 -1
- package/dist/fondue-components136.js +12 -60
- package/dist/fondue-components136.js.map +1 -1
- package/dist/fondue-components137.js +71 -9
- package/dist/fondue-components137.js.map +1 -1
- package/dist/fondue-components138.js +14 -255
- package/dist/fondue-components138.js.map +1 -1
- package/dist/fondue-components139.js +10 -0
- package/dist/fondue-components139.js.map +1 -0
- package/dist/fondue-components140.js +87 -40
- package/dist/fondue-components140.js.map +1 -1
- package/dist/fondue-components141.js +80 -40
- package/dist/fondue-components141.js.map +1 -1
- package/dist/fondue-components142.js +31 -6
- package/dist/fondue-components142.js.map +1 -1
- package/dist/fondue-components143.js +169 -11
- package/dist/fondue-components143.js.map +1 -1
- package/dist/fondue-components144.js +59 -70
- package/dist/fondue-components144.js.map +1 -1
- package/dist/fondue-components145.js +9 -15
- package/dist/fondue-components145.js.map +1 -1
- package/dist/fondue-components146.js +256 -7
- package/dist/fondue-components146.js.map +1 -1
- package/dist/fondue-components147.js +17 -87
- package/dist/fondue-components147.js.map +1 -1
- package/dist/fondue-components149.js +41 -30
- package/dist/fondue-components149.js.map +1 -1
- package/dist/fondue-components150.js +40 -18
- package/dist/fondue-components150.js.map +1 -1
- package/dist/fondue-components151.js +20 -69
- package/dist/fondue-components151.js.map +1 -1
- package/dist/fondue-components152.js +37 -1349
- package/dist/fondue-components152.js.map +1 -1
- package/dist/fondue-components153.js +59 -930
- package/dist/fondue-components153.js.map +1 -1
- package/dist/fondue-components154.js +1322 -168
- package/dist/fondue-components154.js.map +1 -1
- package/dist/fondue-components155.js +937 -17
- package/dist/fondue-components155.js.map +1 -1
- package/dist/fondue-components156.js +197 -39
- package/dist/fondue-components156.js.map +1 -1
- package/dist/fondue-components158.js +1 -1
- package/dist/fondue-components165.js +17 -8
- package/dist/fondue-components165.js.map +1 -1
- package/dist/fondue-components166.js +8 -17
- package/dist/fondue-components166.js.map +1 -1
- package/dist/fondue-components48.js +1 -1
- package/dist/fondue-components49.js +1 -1
- package/dist/fondue-components50.js +1 -1
- package/dist/fondue-components51.js +2 -2
- package/dist/fondue-components52.js +2 -2
- package/dist/fondue-components55.js +1 -1
- package/dist/fondue-components65.js +2 -2
- package/dist/fondue-components66.js +3 -3
- package/dist/fondue-components67.js +2 -2
- package/dist/fondue-components79.js +2 -2
- package/dist/fondue-components82.js +1 -1
- package/dist/fondue-components83.js +1 -1
- package/dist/fondue-components84.js +1 -1
- package/dist/fondue-components87.js +1 -1
- package/dist/fondue-components89.js +6 -6
- package/dist/fondue-components95.js +2 -2
- package/dist/fondue-components96.js +2 -2
- package/dist/fondue-components97.js +2 -2
- package/dist/fondue-components98.js +2 -2
- package/dist/fondue-components99.js +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/fondue-components148.js +0 -84
- package/dist/fondue-components148.js.map +0 -1
|
@@ -1,114 +1,154 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretDown as V } from "@frontify/fondue-icons";
|
|
3
|
+
import * as I from "@radix-ui/react-popover";
|
|
4
|
+
import { useSelect as s } from "downshift";
|
|
5
|
+
import { forwardRef as ee, useRef as te, useCallback as N, useState as ne, useMemo as oe } from "react";
|
|
6
|
+
import { useBadgeItems as re } from "./fondue-components135.js";
|
|
7
|
+
import { useFocusRing as ae } from "./fondue-components136.js";
|
|
8
|
+
import { useSelectData as se } from "./fondue-components137.js";
|
|
9
|
+
import { useSelectionDescription as ie } from "./fondue-components138.js";
|
|
10
|
+
import r from "./fondue-components122.js";
|
|
11
|
+
import { ClearButton as le } from "./fondue-components139.js";
|
|
12
|
+
import { CollapsibleBadges as ce } from "./fondue-components140.js";
|
|
13
|
+
import { SelectMenu as ue } from "./fondue-components141.js";
|
|
14
|
+
import { StatusIcons as ge } from "./fondue-components142.js";
|
|
15
|
+
const O = ({
|
|
16
|
+
children: M,
|
|
17
|
+
selectedItemValues: o,
|
|
18
|
+
onItemSelect: p,
|
|
19
|
+
onClear: P,
|
|
20
|
+
placeholder: c = "",
|
|
21
|
+
status: u = "neutral",
|
|
22
|
+
disabled: f,
|
|
23
|
+
alignMenu: R = "start",
|
|
24
|
+
side: j = "bottom",
|
|
25
|
+
id: k,
|
|
26
|
+
showStringValue: y = !0,
|
|
27
|
+
"data-test-id": b = "fondue-select",
|
|
28
|
+
viewportCollisionPadding: E = "compact",
|
|
29
|
+
onEscapeKeyDown: F,
|
|
30
|
+
multiple: g,
|
|
31
|
+
...i
|
|
32
|
+
}, a) => {
|
|
33
|
+
const C = te(null), B = N(
|
|
34
|
+
(e) => {
|
|
35
|
+
C.current = e, typeof a == "function" ? a(e) : a && (a.current = e);
|
|
36
|
+
},
|
|
37
|
+
[a]
|
|
38
|
+
), { inputSlots: H, menuSlots: K, items: w, clearButton: S, getItemByValue: l } = se(M), { onMouseDown: z, onFocus: A, onBlur: q } = ae(), { selectionDescriptionId: D, selectionDescription: m } = ie(
|
|
39
|
+
g,
|
|
40
|
+
o,
|
|
41
|
+
l
|
|
42
|
+
), G = re(o, l), [J, v] = ne(!1), x = N(
|
|
43
|
+
(e) => {
|
|
44
|
+
const t = l(e);
|
|
45
|
+
if (t)
|
|
46
|
+
return !y && (t != null && t.children) ? t.children : t == null ? void 0 : t.label;
|
|
47
|
+
},
|
|
48
|
+
[l, y]
|
|
49
|
+
), { getToggleButtonProps: L, getMenuProps: Q, getItemProps: U, reset: W, isOpen: X, highlightedIndex: Y } = s({
|
|
50
|
+
items: w,
|
|
51
|
+
selectedItem: null,
|
|
52
|
+
toggleButtonId: k,
|
|
53
|
+
labelId: "aria-labelledby" in i ? i["aria-labelledby"] : void 0,
|
|
54
|
+
onIsOpenChange: () => {
|
|
55
|
+
v(!1);
|
|
56
|
+
},
|
|
57
|
+
onHighlightedIndexChange: () => {
|
|
58
|
+
v(!0);
|
|
59
|
+
},
|
|
60
|
+
onSelectedItemChange: ({ selectedItem: e }) => {
|
|
61
|
+
p(e == null ? void 0 : e.value);
|
|
62
|
+
},
|
|
63
|
+
itemToString: (e) => e ? e.label : "",
|
|
64
|
+
...g ? {
|
|
65
|
+
stateReducer: (e, t) => {
|
|
66
|
+
const { changes: h, type: $ } = t;
|
|
67
|
+
switch ($) {
|
|
68
|
+
case s.stateChangeTypes.ToggleButtonKeyDownEnter:
|
|
69
|
+
case s.stateChangeTypes.ToggleButtonKeyDownSpaceButton:
|
|
70
|
+
case s.stateChangeTypes.ItemClick:
|
|
71
|
+
return {
|
|
72
|
+
...h,
|
|
73
|
+
isOpen: !0,
|
|
74
|
+
highlightedIndex: e.highlightedIndex
|
|
75
|
+
};
|
|
76
|
+
case s.stateChangeTypes.ToggleButtonBlur:
|
|
77
|
+
return {
|
|
78
|
+
...h,
|
|
79
|
+
selectedItem: e.selectedItem
|
|
80
|
+
};
|
|
48
81
|
}
|
|
82
|
+
return h;
|
|
83
|
+
}
|
|
84
|
+
} : {}
|
|
85
|
+
}), T = u === "error", Z = () => {
|
|
86
|
+
P(), W();
|
|
87
|
+
}, _ = oe(
|
|
88
|
+
() => x(o[0]) || c,
|
|
89
|
+
[x, o, c]
|
|
90
|
+
);
|
|
91
|
+
return /* @__PURE__ */ d(I.Root, { open: X, children: [
|
|
92
|
+
/* @__PURE__ */ n(I.Anchor, { asChild: !0, onMouseDown: z, onFocus: A, onBlur: q, children: /* @__PURE__ */ d(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
ref: B,
|
|
96
|
+
className: r.root,
|
|
97
|
+
"data-status": T ? "error" : u,
|
|
98
|
+
"data-disabled": f,
|
|
99
|
+
"data-empty": o.length === 0,
|
|
100
|
+
"data-test-id": b,
|
|
101
|
+
...f ? {} : (
|
|
102
|
+
// eslint-disable-next-line react-hooks/refs
|
|
103
|
+
L({
|
|
104
|
+
"aria-label": "aria-label" in i ? i["aria-label"] : void 0,
|
|
105
|
+
"aria-describedby": m ? D : void 0,
|
|
106
|
+
ref: B
|
|
107
|
+
})
|
|
108
|
+
),
|
|
109
|
+
children: [
|
|
110
|
+
m ? /* @__PURE__ */ n("span", { id: D, className: r.srOnly, children: m }) : null,
|
|
111
|
+
g ? /* @__PURE__ */ n("div", { className: r.selectedValue, children: /* @__PURE__ */ n(
|
|
112
|
+
ce,
|
|
113
|
+
{
|
|
114
|
+
items: G,
|
|
115
|
+
placeholder: c,
|
|
116
|
+
onDismiss: (e) => {
|
|
117
|
+
var t;
|
|
118
|
+
p(e), (t = C.current) == null || t.focus();
|
|
119
|
+
},
|
|
120
|
+
selectedCount: o.length
|
|
121
|
+
}
|
|
122
|
+
) }) : /* @__PURE__ */ n("span", { className: r.selectedValue, children: _ }),
|
|
123
|
+
H,
|
|
124
|
+
S ? /* @__PURE__ */ n(le, { onClear: Z, children: S }) : null,
|
|
125
|
+
/* @__PURE__ */ d("div", { className: r.icons, children: [
|
|
126
|
+
/* @__PURE__ */ n(V, { size: 16, className: r.caret }),
|
|
127
|
+
/* @__PURE__ */ n(ge, { status: u, hasError: T, dataTestId: b })
|
|
128
|
+
] })
|
|
129
|
+
]
|
|
49
130
|
}
|
|
50
|
-
) })
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
B.displayName = "DatePickerCalendar";
|
|
54
|
-
const D = () => ({
|
|
55
|
-
DayButton: ({ day: t, modifiers: s, onClick: a, onMouseEnter: o, onMouseLeave: d, ...l }) => {
|
|
56
|
-
const n = b(null);
|
|
57
|
-
return y(() => {
|
|
58
|
-
var i;
|
|
59
|
-
s.focused && ((i = n.current) == null || i.focus());
|
|
60
|
-
}, [s.focused]), /* @__PURE__ */ r(
|
|
61
|
-
"button",
|
|
131
|
+
) }),
|
|
132
|
+
/* @__PURE__ */ n(
|
|
133
|
+
ue,
|
|
62
134
|
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
135
|
+
align: R,
|
|
136
|
+
side: j,
|
|
137
|
+
highlightedIndex: Y,
|
|
138
|
+
getMenuProps: Q,
|
|
139
|
+
getItemProps: U,
|
|
140
|
+
selectedItemValues: o,
|
|
141
|
+
hasInteractedSinceOpening: J,
|
|
142
|
+
viewportCollisionPadding: E,
|
|
143
|
+
onEscapeKeyDown: F,
|
|
144
|
+
children: K
|
|
71
145
|
}
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"aria-disabled": a
|
|
78
|
-
}) => /* @__PURE__ */ r("div", { className: `${e.toggleMonthButtonContainer} `, children: /* @__PURE__ */ r(
|
|
79
|
-
m,
|
|
80
|
-
{
|
|
81
|
-
emphasis: "weak",
|
|
82
|
-
size: "small",
|
|
83
|
-
aspect: "square",
|
|
84
|
-
"aria-label": s,
|
|
85
|
-
"aria-disabled": a,
|
|
86
|
-
onPress: (o) => {
|
|
87
|
-
o && (t == null || t(o));
|
|
88
|
-
},
|
|
89
|
-
children: /* @__PURE__ */ r($, { size: 16 })
|
|
90
|
-
}
|
|
91
|
-
) }),
|
|
92
|
-
NextMonthButton: ({
|
|
93
|
-
onClick: t,
|
|
94
|
-
"aria-label": s,
|
|
95
|
-
"aria-disabled": a
|
|
96
|
-
}) => /* @__PURE__ */ r("div", { className: `${e.toggleMonthButtonContainer} ${e.nextMonthButtonContainer}`, children: /* @__PURE__ */ r(
|
|
97
|
-
m,
|
|
98
|
-
{
|
|
99
|
-
emphasis: "weak",
|
|
100
|
-
size: "small",
|
|
101
|
-
aspect: "square",
|
|
102
|
-
"aria-label": s,
|
|
103
|
-
"aria-disabled": a,
|
|
104
|
-
onPress: (o) => {
|
|
105
|
-
o && (t == null || t(o));
|
|
106
|
-
},
|
|
107
|
-
children: /* @__PURE__ */ r(h, { size: 16 })
|
|
108
|
-
}
|
|
109
|
-
) })
|
|
110
|
-
});
|
|
146
|
+
)
|
|
147
|
+
] });
|
|
148
|
+
};
|
|
149
|
+
O.displayName = "Select";
|
|
150
|
+
const Te = ee(O);
|
|
111
151
|
export {
|
|
112
|
-
|
|
152
|
+
Te as SelectBase
|
|
113
153
|
};
|
|
114
154
|
//# sourceMappingURL=fondue-components121.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components121.js","sources":["../src/components/DatePicker/DatePickerCalendar.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconArrowLeft, IconArrowRight } from '@frontify/fondue-icons';\nimport { forwardRef, useEffect, useMemo, useRef } from 'react';\nimport {\n getDefaultClassNames,\n DayPicker,\n type PreviousMonthButtonProps,\n type NextMonthButtonProps,\n type OnSelectHandler,\n type DateRange as InternalDayPickerDateRange,\n type CustomComponents,\n type Matcher,\n type DayButtonProps,\n} from 'react-day-picker';\nimport 'react-day-picker/style.css';\n\nimport { Button } from '../Button/Button';\nimport { useFondueTheme } from '../ThemeProvider/ThemeProvider';\n\nimport { transformDisabledDates } from './helpers/dateTransformer';\nimport styles from './styles/datePickerCalendar.module.scss';\nimport { type DisabledDatePickerDates } from './types';\n\ntype DatePickerCalendarSingleModeProps = {\n mode: 'single';\n required: true;\n selected: Date | undefined;\n onSelect: OnSelectHandler<Date>;\n};\ntype DatePickerCalendarRangeModeProps = {\n mode: 'range';\n required: true;\n selected: InternalDayPickerDateRange | undefined;\n onSelect: OnSelectHandler<InternalDayPickerDateRange>;\n modifiers?: Record<string, Matcher>;\n onDayMouseEnter?: (day: Date) => void;\n onDayMouseLeave?: (day: Date) => void;\n};\n\ntype DatePickerCalendarModeProps = DatePickerCalendarSingleModeProps | DatePickerCalendarRangeModeProps;\n\nexport type DatePickerBaseProps = {\n /** The days to be disabled. */\n disabledDates?: DisabledDatePickerDates | DisabledDatePickerDates[];\n /** The test id applied to the wrapper and forwarded to DayPicker. */\n 'data-test-id'?: string;\n};\n\ntype DatePickerCalendarProps = DatePickerBaseProps & DatePickerCalendarModeProps;\n\nexport const DatePickerCalendar = forwardRef<HTMLDivElement, DatePickerCalendarProps>(\n ({ 'data-test-id': dataTestId = 'fondue-date-picker-calendar', disabledDates, ...modeProps }, ref): JSX.Element => {\n const defaultClassNames = getDefaultClassNames();\n const {\n dir,\n translations: { dateLocale },\n } = useFondueTheme();\n\n const transformedDisabledDates = useMemo(() => transformDisabledDates(disabledDates), [disabledDates]);\n\n const defaultMonth = useMemo(() => {\n if (modeProps.mode === 'single') {\n return modeProps.selected;\n }\n return modeProps.selected?.from;\n }, [modeProps]);\n\n return (\n <div ref={ref} data-test-id={dataTestId} className={styles.wrapper}>\n <DayPicker\n navLayout=\"around\"\n data-test-id={dataTestId}\n locale={dateLocale}\n components={getCustomComponents()}\n showOutsideDays\n disabled={transformedDisabledDates}\n defaultMonth={defaultMonth}\n dir={dir}\n classNames={{\n root: `${defaultClassNames.root} ${styles.root}`,\n day: `${styles.day}`,\n selected: `${styles.selected}`,\n week: `${defaultClassNames.week} ${styles.week}`,\n weekday: `${styles.weekday}`,\n weekdays: `${defaultClassNames.weekdays} ${styles.weekdays}`,\n range_start: `${styles.selectedStart}`,\n range_end: `${styles.selectedEnd}`,\n range_middle: `${styles.selectedMiddle}`,\n disabled: `${styles.disabled}`,\n outside: `${styles.outside}`,\n }}\n {...modeProps}\n modifiersClassNames={{\n hoverAfter: `${styles.hoverAfter}`,\n hoverBefore: `${styles.hoverBefore}`,\n hoverSelected: `${styles.hoverSelected}`,\n }}\n />\n </div>\n );\n },\n);\nDatePickerCalendar.displayName = 'DatePickerCalendar';\n\nconst getCustomComponents = (): Partial<CustomComponents> => ({\n DayButton: ({ day, modifiers, onClick, onMouseEnter, onMouseLeave, ...props }: DayButtonProps): JSX.Element => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) {\n buttonRef.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <button\n {...props}\n ref={buttonRef}\n className={styles.dayButton}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n type=\"button\"\n >\n <div className={`${styles.dayContent} ${styles.button}`}>{day.date.getDate()}</div>\n </button>\n );\n },\n PreviousMonthButton: ({\n onClick,\n 'aria-label': ariaLabel,\n 'aria-disabled': ariaDisabled,\n }: PreviousMonthButtonProps): JSX.Element => {\n return (\n <div className={`${styles.toggleMonthButtonContainer} `}>\n <Button\n emphasis=\"weak\"\n size=\"small\"\n aspect=\"square\"\n aria-label={ariaLabel}\n aria-disabled={ariaDisabled}\n onPress={(event) => {\n if (event) {\n onClick?.(event);\n }\n }}\n >\n <IconArrowLeft size={16} />\n </Button>\n </div>\n );\n },\n NextMonthButton: ({\n onClick,\n 'aria-label': ariaLabel,\n 'aria-disabled': ariaDisabled,\n }: NextMonthButtonProps): JSX.Element => {\n return (\n <div className={`${styles.toggleMonthButtonContainer} ${styles.nextMonthButtonContainer}`}>\n <Button\n emphasis=\"weak\"\n size=\"small\"\n aspect=\"square\"\n aria-label={ariaLabel}\n aria-disabled={ariaDisabled}\n onPress={(event) => {\n if (event) {\n onClick?.(event);\n }\n }}\n >\n <IconArrowRight size={16} />\n </Button>\n </div>\n );\n },\n});\n"],"names":["DatePickerCalendar","forwardRef","dataTestId","disabledDates","modeProps","ref","defaultClassNames","getDefaultClassNames","dir","dateLocale","useFondueTheme","transformedDisabledDates","useMemo","transformDisabledDates","defaultMonth","_a","styles","jsx","DayPicker","getCustomComponents","day","modifiers","onClick","onMouseEnter","onMouseLeave","props","buttonRef","useRef","useEffect","ariaLabel","ariaDisabled","Button","event","IconArrowLeft","IconArrowRight"],"mappings":";;;;;;;;;AAmDO,MAAMA,IAAqBC;AAAA,EAC9B,CAAC,EAAE,gBAAgBC,IAAa,+BAA+B,eAAAC,GAAe,GAAGC,EAAA,GAAaC,MAAqB;AAC/G,UAAMC,IAAoBC,EAAA,GACpB;AAAA,MACF,KAAAC;AAAA,MACA,cAAc,EAAE,YAAAC,EAAA;AAAA,IAAW,IAC3BC,EAAA,GAEEC,IAA2BC,EAAQ,MAAMC,EAAuBV,CAAa,GAAG,CAACA,CAAa,CAAC,GAE/FW,IAAeF,EAAQ,MAAM;;AAC/B,aAAIR,EAAU,SAAS,WACZA,EAAU,YAEdW,IAAAX,EAAU,aAAV,gBAAAW,EAAoB;AAAA,IAC/B,GAAG,CAACX,CAAS,CAAC;AAEd,6BACK,OAAA,EAAI,KAAAC,GAAU,gBAAcH,GAAY,WAAWc,EAAO,SACvD,UAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACG,WAAU;AAAA,QACV,gBAAchB;AAAA,QACd,QAAQO;AAAA,QACR,YAAYU,EAAA;AAAA,QACZ,iBAAe;AAAA,QACf,UAAUR;AAAA,QACV,cAAAG;AAAA,QACA,KAAAN;AAAA,QACA,YAAY;AAAA,UACR,MAAM,GAAGF,EAAkB,IAAI,IAAIU,EAAO,IAAI;AAAA,UAC9C,KAAK,GAAGA,EAAO,GAAG;AAAA,UAClB,UAAU,GAAGA,EAAO,QAAQ;AAAA,UAC5B,MAAM,GAAGV,EAAkB,IAAI,IAAIU,EAAO,IAAI;AAAA,UAC9C,SAAS,GAAGA,EAAO,OAAO;AAAA,UAC1B,UAAU,GAAGV,EAAkB,QAAQ,IAAIU,EAAO,QAAQ;AAAA,UAC1D,aAAa,GAAGA,EAAO,aAAa;AAAA,UACpC,WAA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;AAAA,MACT,MAAK;AAAA,MACL,QAAO;AAAA,MACP,cAAYF;AAAA,MACZ,iBAAeC;AAAA,MACf,SAAS,CAACE,MAAU;AAChB,QAAIA,MACAV,KAAA,QAAAA,EAAUU;AAAA,MAElB;AAAA,MAEA,UAAA,gBAAAf,EAACgB,GAAA,EAAc,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA,GAEjC;AAAA,EAGR,iBAAiB,CAAC;AAAA,IACd,SAAAX;AAAA,IACA,cAAcO;AAAA,IACd,iBAAiBC;AAAA,EAAA,MAGb,gBAAAb,EAAC,SAAI,WAAW,GAAGD,EAAO,0BAA0B,IAAIA,EAAO,wBAAwB,IACnF,UAAA,gBAAAC;AAAA,IAACc;AAAA,IAAA;AAAA,MACG,UAAS;AAAA,MACT,MAAK;AAAA,MACL,QAAO;AAAA,MACP,cAAYF;AAAA,MACZ,iBAAeC;AAAA,MACf,SAAS,CAACE,MAAU;AAChB,QAAIA,MACAV,KAAA,QAAAA,EAAUU;AAAA,MAElB;AAAA,MAEA,UAAA,gBAAAf,EAACiB,GAAA,EAAe,MAAM,GAAA,CAAI;AAAA,IAAA;AAAA,EAAA,GAElC;AAGZ;"}
|
|
1
|
+
{"version":3,"file":"fondue-components121.js","sources":["../src/components/Select/components/SelectBase.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretDown } from '@frontify/fondue-icons';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { useSelect } from 'downshift';\nimport { forwardRef, useCallback, useMemo, useRef, useState, type ForwardedRef, type ReactNode } from 'react';\n\nimport { type CommonAriaProps } from '#/helpers/aria';\n\nimport { useBadgeItems } from '../hooks/useBadgeItems';\nimport { useFocusRing } from '../hooks/useFocusRing';\nimport { useSelectData } from '../hooks/useSelectData';\nimport { useSelectionDescription } from '../hooks/useSelectionDescription';\nimport styles from '../styles/select.module.scss';\n\nimport { ClearButton } from './ClearButton';\nimport { CollapsibleBadges } from './CollapsibleBadges';\nimport { SelectMenu, type SelectMenuViewportCollisionPadding } from './SelectMenu';\nimport { StatusIcons } from './StatusIcons';\n\nexport type SelectSharedProps = {\n /**\n * Children of the Select component. This can contain the `Select.Slot` components for the label, decorators, clear action and menu\n */\n children?: ReactNode;\n /**\n * The placeholder in the select component\n */\n placeholder?: string;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error';\n /**\n * Disables the select component\n */\n disabled?: boolean;\n /**\n * The alignment of the menu\n * @default \"start\"\n */\n alignMenu?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the select. It will not be respected if there are collisions with the viewport\n * @default \"bottom\"\n */\n side?: 'left' | 'right' | 'bottom' | 'top';\n /**\n * The data test id of the select component\n */\n 'data-test-id'?: string;\n /**\n * Id of the select component\n */\n id?: string;\n /**\n * The value of the select is shown as plain text (from the label prop) when set to true\n * Items child components are used if set to false\n * @default true\n */\n showStringValue?: boolean;\n /**\n * Define the minimum distance between the select menu and the viewport edge\n * @default 'compact'\n */\n viewportCollisionPadding?: SelectMenuViewportCollisionPadding;\n /**\n * Event handler called when the escape key is pressed\n */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n} & CommonAriaProps;\n\ntype SelectBaseProps = SelectSharedProps & {\n /**\n * The currently selected item values\n */\n selectedItemValues: string[];\n /**\n * Callback fired when an item is selected or deselected\n */\n onItemSelect: (value?: string) => void;\n /**\n * Callback fired when the selection is cleared\n */\n onClear: () => void;\n /**\n * Whether the select allows multiple selections\n */\n multiple: boolean;\n};\n\nconst SelectBaseInput = (\n {\n children,\n selectedItemValues,\n onItemSelect,\n onClear,\n placeholder = '',\n status = 'neutral',\n disabled,\n alignMenu = 'start',\n side = 'bottom',\n id,\n showStringValue = true,\n 'data-test-id': dataTestId = 'fondue-select',\n viewportCollisionPadding = 'compact',\n onEscapeKeyDown,\n multiple,\n ...props\n }: SelectBaseProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n): ReactNode => {\n const internalRef = useRef<HTMLDivElement | null>(null);\n const triggerRef = useCallback(\n (node: HTMLDivElement | null): void => {\n internalRef.current = node;\n if (typeof forwardedRef === 'function') {\n forwardedRef(node);\n } else if (forwardedRef) {\n forwardedRef.current = node;\n }\n },\n [forwardedRef],\n );\n const { inputSlots, menuSlots, items, clearButton, getItemByValue } = useSelectData(children);\n const { onMouseDown, onFocus, onBlur } = useFocusRing();\n const { selectionDescriptionId, selectionDescription } = useSelectionDescription(\n multiple,\n selectedItemValues,\n getItemByValue,\n );\n const badgeItems = useBadgeItems(selectedItemValues, getItemByValue);\n\n const [hasInteractedSinceOpening, setHasInteractedSinceOpening] = useState(false);\n\n const getDisplayedValue = useCallback(\n (itemValue?: string): ReactNode => {\n const selectedItem = getItemByValue(itemValue);\n if (selectedItem) {\n return !showStringValue && selectedItem?.children ? selectedItem.children : selectedItem?.label;\n }\n return undefined;\n },\n [getItemByValue, showStringValue],\n );\n\n const { getToggleButtonProps, getMenuProps, getItemProps, reset, isOpen, highlightedIndex } = useSelect<{\n value: string;\n label: string;\n children?: ReactNode;\n }>({\n items,\n selectedItem: null,\n toggleButtonId: id,\n labelId: 'aria-labelledby' in props ? props['aria-labelledby'] : undefined,\n onIsOpenChange: () => {\n setHasInteractedSinceOpening(false);\n },\n onHighlightedIndexChange: () => {\n setHasInteractedSinceOpening(true);\n },\n onSelectedItemChange: ({ selectedItem }) => {\n onItemSelect(selectedItem?.value);\n },\n itemToString: (item) => (item ? item.label : ''),\n ...(multiple\n ? {\n stateReducer: (state, actionAndChanges) => {\n const { changes, type } = actionAndChanges;\n switch (type) {\n case useSelect.stateChangeTypes.ToggleButtonKeyDownEnter:\n case useSelect.stateChangeTypes.ToggleButtonKeyDownSpaceButton:\n case useSelect.stateChangeTypes.ItemClick:\n return {\n ...changes,\n isOpen: true,\n highlightedIndex: state.highlightedIndex,\n };\n case useSelect.stateChangeTypes.ToggleButtonBlur:\n return {\n ...changes,\n selectedItem: state.selectedItem,\n };\n }\n return changes;\n },\n }\n : {}),\n });\n\n const hasError = status === 'error';\n\n const handleClear = (): void => {\n onClear();\n reset();\n };\n\n const singleSelectValue = useMemo(\n (): ReactNode => getDisplayedValue(selectedItemValues[0]) || placeholder,\n [getDisplayedValue, selectedItemValues, placeholder],\n );\n\n return (\n <RadixPopover.Root open={isOpen}>\n <RadixPopover.Anchor asChild onMouseDown={onMouseDown} onFocus={onFocus} onBlur={onBlur}>\n <div\n ref={triggerRef}\n className={styles.root}\n data-status={hasError ? 'error' : status}\n data-disabled={disabled}\n data-empty={selectedItemValues.length === 0}\n data-test-id={dataTestId}\n {...(disabled\n ? {}\n : // eslint-disable-next-line react-hooks/refs\n getToggleButtonProps({\n 'aria-label': 'aria-label' in props ? props['aria-label'] : undefined,\n 'aria-describedby': selectionDescription ? selectionDescriptionId : undefined,\n ref: triggerRef,\n }))}\n >\n {selectionDescription ? (\n <span id={selectionDescriptionId} className={styles.srOnly}>\n {selectionDescription}\n </span>\n ) : null}\n {multiple ? (\n <div className={styles.selectedValue}>\n <CollapsibleBadges\n items={badgeItems}\n placeholder={placeholder}\n onDismiss={(value) => {\n onItemSelect(value);\n internalRef.current?.focus();\n }}\n selectedCount={selectedItemValues.length}\n />\n </div>\n ) : (\n <span className={styles.selectedValue}>{singleSelectValue}</span>\n )}\n {inputSlots}\n {clearButton ? <ClearButton onClear={handleClear}>{clearButton}</ClearButton> : null}\n <div className={styles.icons}>\n <IconCaretDown size={16} className={styles.caret} />\n <StatusIcons status={status} hasError={hasError} dataTestId={dataTestId} />\n </div>\n </div>\n </RadixPopover.Anchor>\n\n <SelectMenu\n align={alignMenu}\n side={side}\n highlightedIndex={highlightedIndex}\n getMenuProps={getMenuProps}\n getItemProps={getItemProps}\n selectedItemValues={selectedItemValues}\n hasInteractedSinceOpening={hasInteractedSinceOpening}\n viewportCollisionPadding={viewportCollisionPadding}\n onEscapeKeyDown={onEscapeKeyDown}\n >\n {menuSlots}\n </SelectMenu>\n </RadixPopover.Root>\n );\n};\nSelectBaseInput.displayName = 'Select';\n\nexport const SelectBase = forwardRef<HTMLDivElement, SelectBaseProps>(SelectBaseInput);\n"],"names":["SelectBaseInput","children","selectedItemValues","onItemSelect","onClear","placeholder","status","disabled","alignMenu","side","id","showStringValue","dataTestId","viewportCollisionPadding","onEscapeKeyDown","multiple","props","forwardedRef","internalRef","useRef","triggerRef","useCallback","node","inputSlots","menuSlots","items","clearButton","getItemByValue","useSelectData","onMouseDown","onFocus","onBlur","useFocusRing","selectionDescriptionId","selectionDescription","useSelectionDescription","badgeItems","useBadgeItems","hasInteractedSinceOpening","setHasInteractedSinceOpening","useState","getDisplayedValue","itemValue","selectedItem","getToggleButtonProps","getMenuProps","getItemProps","reset","isOpen","highlightedIndex","useSelect","item","state","actionAndChanges","changes","type","hasError","handleClear","singleSelectValue","useMemo","jsxs","RadixPopover","jsx","styles","CollapsibleBadges","value","_a","ClearButton","IconCaretDown","StatusIcons","SelectMenu","SelectBase","forwardRef"],"mappings":";;;;;;;;;;;;;;AA4FA,MAAMA,IAAkB,CACpB;AAAA,EACI,UAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,MAAAC,IAAO;AAAA,EACP,IAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,gBAAgBC,IAAa;AAAA,EAC7B,0BAAAC,IAA2B;AAAA,EAC3B,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACP,GACAC,MACY;AACZ,QAAMC,IAAcC,GAA8B,IAAI,GAChDC,IAAaC;AAAA,IACf,CAACC,MAAsC;AACnC,MAAAJ,EAAY,UAAUI,GAClB,OAAOL,KAAiB,aACxBA,EAAaK,CAAI,IACVL,MACPA,EAAa,UAAUK;AAAA,IAE/B;AAAA,IACA,CAACL,CAAY;AAAA,EAAA,GAEX,EAAE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|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
const c = "_root_1cjzn_7", n = "_selectedValue_1cjzn_67", e = "_input_1cjzn_84", _ = "_slot_1cjzn_114", o = "_clear_1cjzn_164", t = "_clearIcon_1cjzn_171", r = "_icons_1cjzn_175", s = "_caret_1cjzn_181", a = "_iconSuccess_1cjzn_209", l = "_iconError_1cjzn_215", u = "_menu_1cjzn_221", i = "_portal_1cjzn_244", p = "_item_1cjzn_260", j = "_checkmarkIcon_1cjzn_289", z = "_itemValue_1cjzn_295", g = "_group_1cjzn_309", m = "_groupHeading_1cjzn_320", d = "_badgesContainer_1cjzn_332", I = "_badgeWrapper_1cjzn_344", b = "_srOnly_1cjzn_353", k = "_multiSelectInput_1cjzn_365", S = {
|
|
2
|
+
root: c,
|
|
3
|
+
selectedValue: n,
|
|
4
|
+
input: e,
|
|
5
|
+
slot: _,
|
|
6
|
+
clear: o,
|
|
7
|
+
clearIcon: t,
|
|
8
|
+
icons: r,
|
|
9
|
+
caret: s,
|
|
10
|
+
iconSuccess: a,
|
|
11
|
+
iconError: l,
|
|
12
|
+
menu: u,
|
|
13
|
+
portal: i,
|
|
14
|
+
item: p,
|
|
15
|
+
checkmarkIcon: j,
|
|
16
|
+
itemValue: z,
|
|
17
|
+
group: g,
|
|
18
|
+
groupHeading: m,
|
|
19
|
+
badgesContainer: d,
|
|
20
|
+
badgeWrapper: I,
|
|
21
|
+
srOnly: b,
|
|
22
|
+
multiSelectInput: k
|
|
12
23
|
};
|
|
13
24
|
export {
|
|
14
|
-
|
|
25
|
+
I as badgeWrapper,
|
|
26
|
+
d as badgesContainer,
|
|
27
|
+
s as caret,
|
|
28
|
+
j as checkmarkIcon,
|
|
29
|
+
o as clear,
|
|
30
|
+
t as clearIcon,
|
|
31
|
+
S as default,
|
|
32
|
+
g as group,
|
|
33
|
+
m as groupHeading,
|
|
34
|
+
l as iconError,
|
|
35
|
+
a as iconSuccess,
|
|
36
|
+
r as icons,
|
|
37
|
+
e as input,
|
|
38
|
+
p as item,
|
|
39
|
+
z as itemValue,
|
|
40
|
+
u as menu,
|
|
41
|
+
k as multiSelectInput,
|
|
42
|
+
i as portal,
|
|
43
|
+
c as root,
|
|
44
|
+
n as selectedValue,
|
|
45
|
+
_ as slot,
|
|
46
|
+
b as srOnly
|
|
15
47
|
};
|
|
16
48
|
//# sourceMappingURL=fondue-components122.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components122.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components122.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
hoverAfter: {
|
|
12
|
-
after: r == null ? void 0 : r.to
|
|
13
|
-
},
|
|
14
|
-
hoverSelected: r == null ? void 0 : r.from
|
|
15
|
-
}, [r])
|
|
16
|
-
});
|
|
1
|
+
const o = "_root_18649_5", c = "_caret_18649_43", t = "_colorName_18649_58", _ = "_colorIndicator_18649_61", n = "_button_18649_82", r = "_actions_18649_113", a = "_clearIcon_18649_122", s = {
|
|
2
|
+
root: o,
|
|
3
|
+
caret: c,
|
|
4
|
+
colorName: t,
|
|
5
|
+
colorIndicator: _,
|
|
6
|
+
button: n,
|
|
7
|
+
actions: r,
|
|
8
|
+
clearIcon: a
|
|
9
|
+
};
|
|
17
10
|
export {
|
|
18
|
-
|
|
11
|
+
r as actions,
|
|
12
|
+
n as button,
|
|
13
|
+
c as caret,
|
|
14
|
+
a as clearIcon,
|
|
15
|
+
_ as colorIndicator,
|
|
16
|
+
t as colorName,
|
|
17
|
+
s as default,
|
|
18
|
+
o as root
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=fondue-components123.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components123.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components123.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
1
|
+
import { format as o } from "date-fns";
|
|
2
|
+
import { transformDateRangeToPickerDateRange as i, transformDatePickerDateToDate as e } from "./fondue-components149.js";
|
|
3
|
+
const y = (r) => !!(r && "from" in r && "to" in r), M = (r) => {
|
|
4
|
+
const t = e(r);
|
|
5
|
+
if (t)
|
|
6
|
+
return o(t, "MMMM d, yyyy");
|
|
7
|
+
}, a = (r) => {
|
|
8
|
+
const t = i(r);
|
|
9
|
+
if (!(t != null && t.from) || !(t != null && t.to))
|
|
10
|
+
return;
|
|
11
|
+
const n = t.from.getFullYear() === t.to.getFullYear();
|
|
12
|
+
return n && t.from.getMonth() === t.to.getMonth() ? `${o(t.from, "MMM d")}–${o(t.to, "d, yyyy")}` : n ? `${o(t.from, "MMM d")}–${o(t.to, "MMM d, yyyy")}` : `${o(t.from, "MMM d, yyyy")}–${o(t.to, "MMM d, yyyy")}`;
|
|
13
|
+
}, g = (r) => y(r) ? a(r) : M(r);
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
g as getDateDisplayString
|
|
15
16
|
};
|
|
16
17
|
//# sourceMappingURL=fondue-components124.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components124.js","sources":["../src/components/DatePicker/
|
|
1
|
+
{"version":3,"file":"fondue-components124.js","sources":["../src/components/DatePicker/helpers/dateDisplayFormatter.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { format } from 'date-fns';\n\nimport { type DatePickerDate, type DatePickerDateRange } from '../types';\n\nimport { transformDateRangeToPickerDateRange, transformDatePickerDateToDate } from './dateTransformer';\n\nconst isDateRange = (selected?: DatePickerDateRange | DatePickerDate): selected is DatePickerDateRange => {\n return Boolean(selected && 'from' in selected && 'to' in selected);\n};\n\nconst getSingleDateDisplayString = (selected?: DatePickerDate): string | undefined => {\n const singleDate = transformDatePickerDateToDate(selected);\n if (!singleDate) {\n return undefined;\n }\n return format(singleDate, 'MMMM d, yyyy');\n};\n\nconst getDateRangeDisplayString = (selected?: DatePickerDateRange): string | undefined => {\n const dateRange = transformDateRangeToPickerDateRange(selected);\n if (!dateRange?.from || !dateRange?.to) {\n return undefined;\n }\n\n const isSameYear = dateRange.from.getFullYear() === dateRange.to.getFullYear();\n\n const isSameMonth = isSameYear && dateRange.from.getMonth() === dateRange.to.getMonth();\n\n if (isSameMonth) {\n return `${format(dateRange.from, 'MMM d')}\\u2013${format(dateRange.to, 'd, yyyy')}`;\n }\n\n if (isSameYear) {\n return `${format(dateRange.from, 'MMM d')}\\u2013${format(dateRange.to, 'MMM d, yyyy')}`;\n }\n\n return `${format(dateRange.from, 'MMM d, yyyy')}\\u2013${format(dateRange.to, 'MMM d, yyyy')}`;\n};\n\nexport const getDateDisplayString = (selected?: DatePickerDateRange | DatePickerDate): string | undefined => {\n if (isDateRange(selected)) {\n return getDateRangeDisplayString(selected);\n }\n return getSingleDateDisplayString(selected);\n};\n"],"names":["isDateRange","selected","getSingleDateDisplayString","singleDate","transformDatePickerDateToDate","format","getDateRangeDisplayString","dateRange","transformDateRangeToPickerDateRange","isSameYear","getDateDisplayString"],"mappings":";;AAQA,MAAMA,IAAc,CAACC,MACV,GAAQA,KAAY,UAAUA,KAAY,QAAQA,IAGvDC,IAA6B,CAACD,MAAkD;AAClF,QAAME,IAAaC,EAA8BH,CAAQ;AACzD,MAAKE;AAGL,WAAOE,EAAOF,GAAY,cAAc;AAC5C,GAEMG,IAA4B,CAACL,MAAuD;AACtF,QAAMM,IAAYC,EAAoCP,CAAQ;AAC9D,MAAI,EAACM,KAAA,QAAAA,EAAW,SAAQ,EAACA,KAAA,QAAAA,EAAW;AAChC;AAGJ,QAAME,IAAaF,EAAU,KAAK,kBAAkBA,EAAU,GAAG,YAAA;AAIjE,SAFoBE,KAAcF,EAAU,KAAK,eAAeA,EAAU,GAAG,SAAA,IAGlE,GAAGF,EAAOE,EAAU,MAAM,OAAO,CAAC,IAASF,EAAOE,EAAU,IAAI,SAAS,CAAC,KAGjFE,IACO,GAAGJ,EAAOE,EAAU,MAAM,OAAO,CAAC,IAASF,EAAOE,EAAU,IAAI,aAAa,CAAC,KAGlF,GAAGF,EAAOE,EAAU,MAAM,aAAa,CAAC,IAASF,EAAOE,EAAU,IAAI,aAAa,CAAC;AAC/F,GAEaG,IAAuB,CAACT,MAC7BD,EAAYC,CAAQ,IACbK,EAA0BL,CAAQ,IAEtCC,EAA2BD,CAAQ;"}
|
|
@@ -1,36 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
badges: l,
|
|
10
|
-
thumbnailImage: s,
|
|
11
|
-
thumbnailIcon: i,
|
|
12
|
-
title: r,
|
|
13
|
-
description: b,
|
|
14
|
-
actions: x,
|
|
15
|
-
action: I,
|
|
16
|
-
actionButton: m
|
|
1
|
+
const c = "_root_13ac0_5", t = "_caret_13ac0_44", o = "_dateName_13ac0_59", a = "_icon_13ac0_76", _ = "_button_13ac0_88", n = "_actions_13ac0_101", e = "_clearIcon_13ac0_109", s = {
|
|
2
|
+
root: c,
|
|
3
|
+
caret: t,
|
|
4
|
+
dateName: o,
|
|
5
|
+
icon: a,
|
|
6
|
+
button: _,
|
|
7
|
+
actions: n,
|
|
8
|
+
clearIcon: e
|
|
17
9
|
};
|
|
18
10
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
c as
|
|
27
|
-
d as default,
|
|
28
|
-
b as description,
|
|
29
|
-
o as overlay,
|
|
30
|
-
t as root,
|
|
31
|
-
_ as selectionIndicator,
|
|
32
|
-
i as thumbnailIcon,
|
|
33
|
-
s as thumbnailImage,
|
|
34
|
-
r as title
|
|
11
|
+
n as actions,
|
|
12
|
+
_ as button,
|
|
13
|
+
t as caret,
|
|
14
|
+
e as clearIcon,
|
|
15
|
+
o as dateName,
|
|
16
|
+
s as default,
|
|
17
|
+
a as icon,
|
|
18
|
+
c as root
|
|
35
19
|
};
|
|
36
20
|
//# sourceMappingURL=fondue-components125.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components125.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components125.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|