@spear-ai/spectral 1.6.16 → 1.7.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/.js +196 -191
- package/dist/Accordion.d.ts +13 -15
- package/dist/Accordion.js +172 -165
- package/dist/Alert/AlertBase.d.ts +7 -7
- package/dist/Alert/AlertBase.js +23 -21
- package/dist/Alert.d.ts +2 -2
- package/dist/Alert.js +32 -30
- package/dist/Avatar.d.ts +2 -2
- package/dist/Avatar.js +30 -22
- package/dist/Badge.d.ts +1 -1
- package/dist/Badge.js +3 -2
- package/dist/Button.d.ts +3 -3
- package/dist/Button.js +108 -46
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
- package/dist/ButtonGroup.d.ts +5 -5
- package/dist/ButtonGroup.js +21 -21
- package/dist/ButtonIcon.d.ts +2 -2
- package/dist/ButtonIcon.js +31 -30
- package/dist/Checkbox/CheckboxBase.d.ts +2 -2
- package/dist/Checkbox/CheckboxBase.js +50 -57
- package/dist/Checkbox.js +16 -18
- package/dist/DataCard/Card.d.ts +1 -1
- package/dist/DataCard/Card.js +1 -1
- package/dist/DataCard.js +1 -1
- package/dist/DateTimePicker/Calendar.d.ts +4 -4
- package/dist/DateTimePicker/Calendar.js +4 -2
- package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
- package/dist/DateTimePicker/DateTimeInput.js +4 -4
- package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
- package/dist/DateTimePicker/DateTimeUtils.js +139 -197
- package/dist/DateTimePicker/TimePicker.d.ts +4 -4
- package/dist/DateTimePicker/TimePicker.js +3 -3
- package/dist/DateTimePicker.d.ts +5 -5
- package/dist/DateTimePicker.js +96 -74
- package/dist/Dialog.d.ts +13 -13
- package/dist/Dialog.js +57 -84
- package/dist/Drawer.d.ts +2 -2
- package/dist/Drawer.js +8 -8
- package/dist/HoverCard.d.ts +6 -5
- package/dist/HoverCard.js +64 -64
- package/dist/Icons/LineToolIcon.js +37 -10
- package/dist/Icons/MeasureIcon.d.ts +5 -0
- package/dist/Icons/MeasureIcon.js +26 -0
- package/dist/Icons/SearchIcon.d.ts +5 -0
- package/dist/Icons/SearchIcon.js +10 -0
- package/dist/Icons/index.d.ts +2 -0
- package/dist/Icons.js +76 -72
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
- package/dist/Input/InputUtils.d.ts +2 -2
- package/dist/Input/InputUtils.js +4 -4
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +31 -29
- package/dist/InputOTP.d.ts +10 -10
- package/dist/InputOTP.js +125 -123
- package/dist/Kbd.d.ts +8 -5
- package/dist/Kbd.js +85 -20
- package/dist/Label.d.ts +4 -2
- package/dist/Label.js +3 -3
- package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
- package/dist/MultiSelect/MultiSelectBase.js +278 -200
- package/dist/MultiSelect.d.ts +6 -6
- package/dist/MultiSelect.js +9 -9
- package/dist/Popover.js +22 -237
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioGroup.d.ts +15 -15
- package/dist/RadioGroup.js +253 -236
- package/dist/Select.d.ts +3 -1
- package/dist/Select.js +92 -87
- package/dist/Separator.js +4 -4
- package/dist/Skeleton.d.ts +1 -2
- package/dist/Skeleton.js +2 -4
- package/dist/Slider.d.ts +6 -6
- package/dist/Slider.js +78 -78
- package/dist/Switch/SwitchBase.d.ts +4 -4
- package/dist/Switch/SwitchBase.js +68 -68
- package/dist/Switch.d.ts +3 -3
- package/dist/Switch.js +9 -9
- package/dist/Tabs/TabsBase.js +39 -38
- package/dist/Tabs/tabsUtils.js +7 -7
- package/dist/Tabs.d.ts +0 -4
- package/dist/Tabs.js +62 -66
- package/dist/Textarea/TextareaUtils.d.ts +7 -7
- package/dist/Textarea/TextareaUtils.js +13 -13
- package/dist/Textarea.js +34 -22
- package/dist/Toast.d.ts +43 -0
- package/dist/Toast.js +883 -0
- package/dist/Toggle/ToggleBase.d.ts +4 -4
- package/dist/Toggle/ToggleBase.js +32 -33
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +7 -12
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
- package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleGroup.js +27 -30
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +97 -97
- package/dist/Tray.d.ts +9 -9
- package/dist/Tray.js +77 -74
- package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
- package/dist/hooks/useAccordionAutoScroll.js +42 -39
- package/dist/hooks/useControllableState.d.ts +2 -2
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/hooks/useControllableState.js +2 -2
- package/dist/index-C12FUuIW.js +13 -0
- package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
- package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
- package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
- package/dist/index-DEYs15GP.js +66 -0
- package/dist/index-DdFoGvON.js +146 -0
- package/dist/index-Q3N6lgwg.js +225 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/primitives/button.d.ts +1 -1
- package/dist/primitives/button.js +4 -4
- package/dist/primitives/input.d.ts.map +1 -1
- package/dist/primitives/input.js +8 -5
- package/dist/primitives/select.d.ts +12 -13
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +68 -95
- package/dist/primitives/slot.d.ts +5 -5
- package/dist/primitives/slot.d.ts.map +1 -1
- package/dist/primitives/slot.js +24 -33
- package/dist/primitives/textarea.d.ts.map +1 -1
- package/dist/primitives/textarea.js +4 -3
- package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
- package/dist/styles/base-colors.css +30 -30
- package/dist/styles/horizon/base-colors.css +30 -30
- package/dist/styles/horizon/colors.css +40 -11
- package/dist/styles/horizon/utilities.css +26 -3
- package/dist/styles/main.css +1 -1
- package/dist/styles/spectral.css +1 -1
- package/dist/styles/theme.css +96 -44
- package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
- package/dist/utils/formFieldUtils.d.ts +2 -2
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +14 -11
- package/dist/utils/sharedUtils.d.ts +3 -3
- package/dist/utils/sharedUtils.d.ts.map +1 -1
- package/dist/utils/sharedUtils.js +1 -4
- package/dist/utils/twUtils.d.ts +1 -1
- package/dist/utils/twUtils.d.ts.map +1 -1
- package/dist/utils/twUtils.js +1 -4
- package/package.json +5 -1
- package/dist/createLucideIcon-D4r5Phnh.js +0 -70
- package/dist/index-CeP1E2kK.js +0 -209
- package/dist/index-Dy-Hzr7y.js +0 -13
|
@@ -9,8 +9,8 @@ export interface TimePickerProps extends Omit<ComponentProps<'div'>, 'onChange'>
|
|
|
9
9
|
/** Override translation strings for ARIA labels */
|
|
10
10
|
translations?: Partial<TimePickerTranslations>;
|
|
11
11
|
}
|
|
12
|
-
export declare
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
12
|
+
export declare const TimePicker: {
|
|
13
|
+
({ className, date, hourFormat, locale, onChange, onPeriodChange, translations, ...props }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
16
|
//# sourceMappingURL=TimePicker.d.ts.map
|
|
@@ -6,8 +6,8 @@ import { getResolvedLocale as x, DEFAULT_TRANSLATIONS as S, detectHourFormat as
|
|
|
6
6
|
import { TimePeriodSelect as w } from "./TimePeriodSelect.js";
|
|
7
7
|
import { cn as y } from "../utils/twUtils.js";
|
|
8
8
|
import { useRef as d, useMemo as s } from "react";
|
|
9
|
-
|
|
10
|
-
const l = d(null), h = d(null), k = d(null), o = s(() => x(f), [f]), e = s(() => ({ ...S, ...P }), [P]), v = s(() => p ?? j(o), [p, o]), n = s(() => M(o), [o]), F = s(() => I(e.selectPeriodTemplate
|
|
9
|
+
const z = ({ className: g, date: t, hourFormat: p, locale: f, onChange: a, onPeriodChange: L, translations: P, ...R }) => {
|
|
10
|
+
const l = d(null), h = d(null), k = d(null), o = s(() => x(f), [f]), e = s(() => ({ ...S, ...P }), [P]), v = s(() => p ?? j(o), [p, o]), n = s(() => M(o), [o]), F = s(() => I(n, e.selectPeriodTemplate), [e.selectPeriodTemplate, n]), r = v === "24", u = t ? b(t.getHours()) : "AM", N = (i) => {
|
|
11
11
|
if (!t) {
|
|
12
12
|
L?.(i);
|
|
13
13
|
return;
|
|
@@ -56,7 +56,7 @@ function z({ className: g, date: t, hourFormat: p, locale: f, onChange: a, onPer
|
|
|
56
56
|
),
|
|
57
57
|
!r && /* @__PURE__ */ c(w, { ariaLabel: F, labels: n, onLeftFocus: () => l.current?.focus(), onPeriodChange: N, period: u, ref: k })
|
|
58
58
|
] });
|
|
59
|
-
}
|
|
59
|
+
};
|
|
60
60
|
z.displayName = "TimePicker";
|
|
61
61
|
export {
|
|
62
62
|
z as TimePicker
|
package/dist/DateTimePicker.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface DateTimePickerProps extends Omit<ComponentProps<'div'>, 'onChan
|
|
|
7
7
|
defaultValue?: Date;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
disablePastDates?: boolean;
|
|
10
|
-
errorMessage?: string | string[] | Record<string,
|
|
10
|
+
errorMessage?: string | string[] | Record<string, unknown> | null;
|
|
11
11
|
hourFormat?: HourFormat;
|
|
12
12
|
label?: string;
|
|
13
13
|
locale?: Partial<Locale>;
|
|
@@ -19,10 +19,10 @@ export interface DateTimePickerProps extends Omit<ComponentProps<'div'>, 'onChan
|
|
|
19
19
|
timeTranslations?: Partial<TimePickerTranslations>;
|
|
20
20
|
value?: Date;
|
|
21
21
|
}
|
|
22
|
-
export declare
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
22
|
+
export declare const DateTimePicker: {
|
|
23
|
+
({ calendarProps, className, defaultValue, disabled, disablePastDates, errorMessage, hourFormat, label, locale, onChange, showTimePicker, state, timeLocale, timeTranslations, value, ...props }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
26
|
export { Calendar } from './Calendar';
|
|
27
27
|
export { DateTimeDisplayInput } from './DateTimeDisplayInput';
|
|
28
28
|
export { DateTimeInput } from './DateTimeInput';
|
package/dist/DateTimePicker.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsxs as
|
|
3
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
4
4
|
import { Calendar as b } from "./DateTimePicker/Calendar.js";
|
|
5
|
-
import { DateTimeDisplayInput as
|
|
6
|
-
import { getResolvedLocale as
|
|
7
|
-
import { DEFAULT_TRANSLATIONS as
|
|
8
|
-
import { TimePicker as
|
|
5
|
+
import { DateTimeDisplayInput as k } from "./DateTimePicker/DateTimeDisplayInput.js";
|
|
6
|
+
import { getResolvedLocale as w, detectHourFormat as I } from "./DateTimePicker/DateTimeUtils.js";
|
|
7
|
+
import { DEFAULT_TRANSLATIONS as cr, DateTimeConfigSchema as ur, HourFormatSchema as gr, PICKER_TYPES as fr, PeriodSchema as hr, TIME_BOUNDS as Tr, TimePickerTypeSchema as vr, TimeValueSchema as xr, convert12HourTo24Hour as Hr, display12HourValue as yr, formatSelectPeriodLabel as Vr, formatTimeNumber as Cr, getAriaLabel as Sr, getAriaValueMinMax as Nr, getAriaValueNow as Pr, getArrowByType as Ar, getDateByType as Dr, getLocalizedPeriodLabel as br, getLocalizedPeriodLabels as kr, getPeriodFromHours as wr, getValid12Hour as Ir, getValidArrow12Hour as Lr, getValidArrowHour as Mr, getValidArrowMinute as Fr, getValidArrowNumber as Er, getValidHour as Br, getValidMinute as Or, getValidNumber as jr, isValid12Hour as Rr, isValidHour as _r, isValidMinute as zr, set12Hours as Ur, setDateByType as Kr, setHours as Yr, setMinutes as qr } from "./DateTimePicker/DateTimeUtils.js";
|
|
8
|
+
import { TimePicker as L } from "./DateTimePicker/TimePicker.js";
|
|
9
9
|
import "./Icons/AnalyzeIcon.js";
|
|
10
10
|
import "./Icons/AnnotationsIcon.js";
|
|
11
11
|
import "./Icons/ApprovedIcon.js";
|
|
12
12
|
import "./Icons/ArrowDownIcon.js";
|
|
13
13
|
import "./Icons/ArrowUpIcon.js";
|
|
14
|
-
import { CalendarIcon as
|
|
14
|
+
import { CalendarIcon as M } from "./Icons/CalendarIcon.js";
|
|
15
15
|
import "./Icons/CheckCircleIcon.js";
|
|
16
16
|
import "./Icons/CheckSquareIcon.js";
|
|
17
17
|
import "./Icons/CheckmarkIcon.js";
|
|
@@ -44,6 +44,7 @@ import "./Icons/LiveViewIcon.js";
|
|
|
44
44
|
import "./Icons/LoaderIcon.js";
|
|
45
45
|
import "./Icons/LocationIcon.js";
|
|
46
46
|
import "./Icons/LogoutIcon.js";
|
|
47
|
+
import "./Icons/MeasureIcon.js";
|
|
47
48
|
import "./Icons/MessagesIcon.js";
|
|
48
49
|
import "./Icons/MetadataIcon.js";
|
|
49
50
|
import "./Icons/MinusIcon.js";
|
|
@@ -55,6 +56,7 @@ import "./Icons/PlusIcon.js";
|
|
|
55
56
|
import "./Icons/ResetIcon.js";
|
|
56
57
|
import "./Icons/ReviewedIcon.js";
|
|
57
58
|
import "./Icons/ScissorsIcon.js";
|
|
59
|
+
import "./Icons/SearchIcon.js";
|
|
58
60
|
import "./Icons/SettingsIcon.js";
|
|
59
61
|
import "./Icons/SortAscendingIcon.js";
|
|
60
62
|
import "./Icons/SortAtoZIcon.js";
|
|
@@ -74,41 +76,61 @@ import { Popover as F, PopoverTrigger as E, PopoverContent as B } from "./Popove
|
|
|
74
76
|
import { useControllableState as O } from "./hooks/useControllableState.js";
|
|
75
77
|
import { ErrorMessage as j } from "./utils/formFieldUtils.js";
|
|
76
78
|
import { cn as a } from "./utils/twUtils.js";
|
|
77
|
-
import { useMemo as g } from "react";
|
|
78
|
-
import { DateTimeInput as
|
|
79
|
-
import { TimePeriodSelect as
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
import { useMemo as g, useCallback as R } from "react";
|
|
80
|
+
import { DateTimeInput as Jr } from "./DateTimePicker/DateTimeInput.js";
|
|
81
|
+
import { TimePeriodSelect as Wr } from "./DateTimePicker/TimePeriodSelect.js";
|
|
82
|
+
const _ = ({
|
|
83
|
+
calendarProps: f,
|
|
84
|
+
className: h,
|
|
85
|
+
defaultValue: T,
|
|
86
|
+
disabled: m = !1,
|
|
87
|
+
disablePastDates: v = !0,
|
|
88
|
+
errorMessage: s,
|
|
89
|
+
hourFormat: d,
|
|
90
|
+
label: x,
|
|
91
|
+
locale: H,
|
|
92
|
+
onChange: y,
|
|
93
|
+
showTimePicker: o = !0,
|
|
94
|
+
state: c = "default",
|
|
95
|
+
timeLocale: u,
|
|
96
|
+
timeTranslations: V,
|
|
97
|
+
value: C,
|
|
98
|
+
...S
|
|
99
|
+
}) => {
|
|
100
|
+
const [r, i] = O({
|
|
83
101
|
defaultValue: T,
|
|
84
|
-
onChange: y
|
|
85
|
-
|
|
102
|
+
onChange: y,
|
|
103
|
+
value: C
|
|
104
|
+
}), l = g(() => w(u), [u]), p = g(() => d ?? I(l), [d, l]), N = (t) => {
|
|
86
105
|
if (!t) {
|
|
87
|
-
|
|
106
|
+
i(void 0);
|
|
88
107
|
return;
|
|
89
108
|
}
|
|
90
|
-
r && t.setHours(r.getHours(), r.getMinutes(), 0, 0),
|
|
91
|
-
}, P = (
|
|
92
|
-
|
|
93
|
-
|
|
109
|
+
r && t.setHours(r.getHours(), r.getMinutes(), 0, 0), i(t);
|
|
110
|
+
}, P = R(
|
|
111
|
+
(t) => {
|
|
112
|
+
i(t);
|
|
113
|
+
},
|
|
114
|
+
[i]
|
|
115
|
+
), A = (t) => {
|
|
94
116
|
}, D = (t) => {
|
|
95
|
-
|
|
117
|
+
i(t);
|
|
96
118
|
};
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ n(F, { children: [
|
|
120
|
+
/* @__PURE__ */ n("div", { className: a("w-full", h), "data-slot": "datetime-picker", "data-testid": "spectral-datetime-picker", ...S, children: [
|
|
99
121
|
/* @__PURE__ */ e(
|
|
100
|
-
|
|
122
|
+
k,
|
|
101
123
|
{
|
|
102
124
|
className: a("flex w-full justify-start gap-4 pr-12", !r && "text-text-secondary"),
|
|
103
125
|
"data-testid": "spectral-datetime-picker-input",
|
|
104
|
-
disabled:
|
|
105
|
-
endIcon: /* @__PURE__ */ e(E, { asChild: !0, disabled:
|
|
106
|
-
|
|
126
|
+
disabled: m,
|
|
127
|
+
endIcon: /* @__PURE__ */ e(E, { asChild: !0, disabled: m, children: /* @__PURE__ */ e(
|
|
128
|
+
M,
|
|
107
129
|
{
|
|
108
130
|
"aria-label": "Open date picker",
|
|
109
|
-
className: a("text-input-icon hover:text-input-icon--hover absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer focus:outline-none",
|
|
131
|
+
className: a("text-input-icon hover:text-input-icon--hover absolute top-1/2 right-4 -translate-y-1/2 cursor-pointer focus:outline-none", m ? "pointer-events-none cursor-not-allowed opacity-50" : "hover:text-input-icon--hover cursor-pointer"),
|
|
110
132
|
"data-testid": "spectral-datetime-picker-trigger",
|
|
111
|
-
disabled:
|
|
133
|
+
disabled: m
|
|
112
134
|
}
|
|
113
135
|
) }),
|
|
114
136
|
hourFormat: p,
|
|
@@ -121,7 +143,7 @@ function R({ calendarProps: f, className: h, defaultValue: T, disabled: i = !1,
|
|
|
121
143
|
),
|
|
122
144
|
c === "error" && s && /* @__PURE__ */ e(j, { message: s, dataTestId: "spectral-datetime-picker-error-message", id: "datetime-picker-error" })
|
|
123
145
|
] }),
|
|
124
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ n(
|
|
125
147
|
B,
|
|
126
148
|
{
|
|
127
149
|
align: "start",
|
|
@@ -130,55 +152,55 @@ function R({ calendarProps: f, className: h, defaultValue: T, disabled: i = !1,
|
|
|
130
152
|
onOpenAutoFocus: (t) => t.preventDefault(),
|
|
131
153
|
children: [
|
|
132
154
|
/* @__PURE__ */ e(b, { ...f, disablePastDates: v, locale: H, mode: "single", onSelect: N, selected: r }),
|
|
133
|
-
o && /* @__PURE__ */ e("div", { className: "border-border-secondary border-l pl-6", children: /* @__PURE__ */ e(
|
|
155
|
+
o && /* @__PURE__ */ e("div", { className: "border-border-secondary border-l pl-6", children: /* @__PURE__ */ e(L, { date: r, hourFormat: p, locale: l, onChange: P, onPeriodChange: A, translations: V }) })
|
|
134
156
|
]
|
|
135
157
|
}
|
|
136
158
|
)
|
|
137
159
|
] });
|
|
138
|
-
}
|
|
139
|
-
|
|
160
|
+
};
|
|
161
|
+
_.displayName = "DateTimePicker";
|
|
140
162
|
export {
|
|
141
163
|
b as Calendar,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
164
|
+
cr as DEFAULT_TRANSLATIONS,
|
|
165
|
+
ur as DateTimeConfigSchema,
|
|
166
|
+
k as DateTimeDisplayInput,
|
|
167
|
+
Jr as DateTimeInput,
|
|
168
|
+
_ as DateTimePicker,
|
|
169
|
+
gr as HourFormatSchema,
|
|
170
|
+
fr as PICKER_TYPES,
|
|
171
|
+
hr as PeriodSchema,
|
|
172
|
+
Tr as TIME_BOUNDS,
|
|
173
|
+
Wr as TimePeriodSelect,
|
|
174
|
+
L as TimePicker,
|
|
175
|
+
vr as TimePickerTypeSchema,
|
|
176
|
+
xr as TimeValueSchema,
|
|
177
|
+
Hr as convert12HourTo24Hour,
|
|
178
|
+
I as detectHourFormat,
|
|
179
|
+
yr as display12HourValue,
|
|
180
|
+
Vr as formatSelectPeriodLabel,
|
|
181
|
+
Cr as formatTimeNumber,
|
|
182
|
+
Sr as getAriaLabel,
|
|
183
|
+
Nr as getAriaValueMinMax,
|
|
184
|
+
Pr as getAriaValueNow,
|
|
185
|
+
Ar as getArrowByType,
|
|
186
|
+
Dr as getDateByType,
|
|
187
|
+
br as getLocalizedPeriodLabel,
|
|
188
|
+
kr as getLocalizedPeriodLabels,
|
|
189
|
+
wr as getPeriodFromHours,
|
|
190
|
+
w as getResolvedLocale,
|
|
191
|
+
Ir as getValid12Hour,
|
|
192
|
+
Lr as getValidArrow12Hour,
|
|
193
|
+
Mr as getValidArrowHour,
|
|
194
|
+
Fr as getValidArrowMinute,
|
|
195
|
+
Er as getValidArrowNumber,
|
|
196
|
+
Br as getValidHour,
|
|
197
|
+
Or as getValidMinute,
|
|
198
|
+
jr as getValidNumber,
|
|
199
|
+
Rr as isValid12Hour,
|
|
200
|
+
_r as isValidHour,
|
|
201
|
+
zr as isValidMinute,
|
|
202
|
+
Ur as set12Hours,
|
|
203
|
+
Kr as setDateByType,
|
|
204
|
+
Yr as setHours,
|
|
205
|
+
qr as setMinutes
|
|
184
206
|
};
|
package/dist/Dialog.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
declare
|
|
3
|
+
declare const Dialog: ({ isOpen, modal, ...props }: Omit<ComponentProps<typeof DialogPrimitive.Root>, "open"> & {
|
|
4
4
|
isOpen?: boolean;
|
|
5
5
|
dialogOverlay?: boolean;
|
|
6
|
-
})
|
|
7
|
-
declare
|
|
8
|
-
declare
|
|
9
|
-
declare
|
|
10
|
-
declare
|
|
11
|
-
declare
|
|
6
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const DialogTrigger: ({ ...props }: ComponentProps<typeof DialogPrimitive.Trigger>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const DialogPortal: ({ ...props }: ComponentProps<typeof DialogPrimitive.Portal>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const DialogClose: ({ ...props }: ComponentProps<typeof DialogPrimitive.Close>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const DialogOverlay: ({ className, ...props }: ComponentProps<typeof DialogPrimitive.Overlay>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const DialogContent: ({ children, className, dialogOverlay, onEscapeKeyDown, onInteractOutside, onPointerDownOutside, showCloseButton, ...props }: ComponentProps<typeof DialogPrimitive.Content> & {
|
|
12
12
|
dialogOverlay?: boolean;
|
|
13
|
-
showCloseButton?: boolean;
|
|
14
13
|
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
15
14
|
onInteractOutside?: (event: PointerEvent | FocusEvent) => void;
|
|
16
15
|
onPointerDownOutside?: (event: PointerEvent) => void;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
declare
|
|
20
|
-
declare
|
|
21
|
-
declare
|
|
16
|
+
showCloseButton?: boolean;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const DialogHeader: ({ className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare const DialogFooter: ({ className, ...props }: ComponentProps<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare const DialogTitle: ({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const DialogDescription: ({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
23
23
|
//# sourceMappingURL=Dialog.d.ts.map
|
package/dist/Dialog.js
CHANGED
|
@@ -1,94 +1,67 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { R as
|
|
5
|
-
import { cn as
|
|
2
|
+
import { jsx as o, jsxs as l } from "react/jsx-runtime";
|
|
3
|
+
import { CloseIcon as m } from "./Icons/CloseIcon.js";
|
|
4
|
+
import { R as p, C as i, a as f, D as u, O as x, P as b, T as h, b as v } from "./index-CqbPiOid.js";
|
|
5
|
+
import { cn as e } from "./utils/twUtils.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import { R as y } from "./Combination-CK_g12Qb.js";
|
|
8
|
-
|
|
8
|
+
const j = ({
|
|
9
9
|
isOpen: t,
|
|
10
10
|
modal: a = !1,
|
|
11
|
-
...
|
|
12
|
-
}) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
...s
|
|
12
|
+
}) => /* @__PURE__ */ o(p, { open: t, modal: a, "data-slot": "dialog", "data-testid": "spectral-dialog", ...s }), O = ({ ...t }) => /* @__PURE__ */ o(v, { asChild: !0, "data-testid": "spectral-dialog-trigger", ...t }), D = ({ ...t }) => /* @__PURE__ */ o(b, { "data-slot": "dialog-portal", "data-testid": "dialog-portal", ...t }), P = ({ ...t }) => /* @__PURE__ */ o(i, { asChild: !0, "data-slot": "dialog-close", "data-testid": "spectral-dialog-close", ...t }), C = ({ className: t, ...a }) => /* @__PURE__ */ o(
|
|
13
|
+
x,
|
|
14
|
+
{
|
|
15
|
+
className: e("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm", "motion-safe:data-[state=open]:animate-in motion-safe:data-[state=open]:fade-in-0", "motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0", t),
|
|
16
|
+
"data-slot": "dialog-overlay",
|
|
17
|
+
"data-testid": "spectral-dialog-overlay",
|
|
18
|
+
...a
|
|
19
|
+
}
|
|
20
|
+
), _ = ({
|
|
21
|
+
children: t,
|
|
22
|
+
className: a,
|
|
23
|
+
dialogOverlay: s = !0,
|
|
24
|
+
onEscapeKeyDown: d,
|
|
25
|
+
onInteractOutside: r,
|
|
26
|
+
onPointerDownOutside: n,
|
|
27
|
+
showCloseButton: c = !0,
|
|
28
|
+
...g
|
|
29
|
+
}) => /* @__PURE__ */ l(D, { "data-slot": "dialog-portal", "data-testid": "spectral-dialog-portal", children: [
|
|
30
|
+
s && /* @__PURE__ */ o(C, {}),
|
|
31
|
+
/* @__PURE__ */ l(
|
|
32
|
+
f,
|
|
27
33
|
{
|
|
28
|
-
className:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
className: e(
|
|
35
|
+
"bg-dialog-bg fixed top-[50%] left-[50%] z-50 flex max-h-[90vh] w-full max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto overscroll-contain rounded-lg p-6 shadow-lg has-[[data-slot=dialog-footer]]:pb-0",
|
|
36
|
+
"motion-safe:data-[state=open]:animate-in motion-safe:data-[state=open]:zoom-in-100! motion-safe:data-[state=open]:slide-in-from-bottom-20 motion-safe:data-[state=open]:duration-600",
|
|
37
|
+
"motion-safe:data-[state=closed]:animate-out motion-safe:data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95",
|
|
38
|
+
y.classNames.fullWidth,
|
|
39
|
+
a
|
|
40
|
+
),
|
|
41
|
+
"data-slot": "dialog-content",
|
|
42
|
+
"data-testid": "spectral-dialog-content",
|
|
43
|
+
onEscapeKeyDown: d,
|
|
44
|
+
onInteractOutside: r,
|
|
45
|
+
onPointerDownOutside: n,
|
|
46
|
+
...g,
|
|
47
|
+
children: [
|
|
48
|
+
t,
|
|
49
|
+
c && /* @__PURE__ */ l(
|
|
50
|
+
i,
|
|
51
|
+
{
|
|
52
|
+
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
53
|
+
"data-slot": "dialog-close",
|
|
54
|
+
"data-testid": "spectral-dialog-close",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ o(m, { size: 16 }),
|
|
57
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close dialog" })
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
]
|
|
32
62
|
}
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
function _({
|
|
36
|
-
className: t,
|
|
37
|
-
children: a,
|
|
38
|
-
dialogOverlay: l = !0,
|
|
39
|
-
showCloseButton: d = !0,
|
|
40
|
-
onEscapeKeyDown: r,
|
|
41
|
-
onInteractOutside: n,
|
|
42
|
-
onPointerDownOutside: c,
|
|
43
|
-
...g
|
|
44
|
-
}) {
|
|
45
|
-
return /* @__PURE__ */ s(D, { "data-slot": "dialog-portal", "data-testid": "spectral-dialog-portal", children: [
|
|
46
|
-
l && /* @__PURE__ */ e(C, {}),
|
|
47
|
-
/* @__PURE__ */ s(
|
|
48
|
-
u,
|
|
49
|
-
{
|
|
50
|
-
className: o(
|
|
51
|
-
"bg-dialog-bg fixed top-[50%] left-[50%] z-50 flex max-h-[90vh] w-full max-w-xl translate-x-[-50%] translate-y-[-50%] flex-col gap-4 overflow-y-auto rounded-lg px-6 pt-6 pb-6 shadow-lg duration-200 has-[[data-slot=dialog-footer]]:pb-0",
|
|
52
|
-
y.classNames.fullWidth,
|
|
53
|
-
t
|
|
54
|
-
),
|
|
55
|
-
"data-slot": "dialog-content",
|
|
56
|
-
"data-testid": "spectral-dialog-content",
|
|
57
|
-
onEscapeKeyDown: r,
|
|
58
|
-
onInteractOutside: n,
|
|
59
|
-
onPointerDownOutside: c,
|
|
60
|
-
...g,
|
|
61
|
-
children: [
|
|
62
|
-
a,
|
|
63
|
-
d && /* @__PURE__ */ s(
|
|
64
|
-
i,
|
|
65
|
-
{
|
|
66
|
-
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
67
|
-
"data-slot": "dialog-close",
|
|
68
|
-
"data-testid": "spectral-dialog-close",
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ e(p, { size: 16 }),
|
|
71
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close dialog" })
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
-
] });
|
|
79
|
-
}
|
|
80
|
-
function F({ className: t, ...a }) {
|
|
81
|
-
return /* @__PURE__ */ e("div", { className: o("flex flex-col gap-2 text-center sm:text-left", t), "data-slot": "dialog-header", "data-testid": "spectral-dialog-header", ...a });
|
|
82
|
-
}
|
|
83
|
-
function H({ className: t, ...a }) {
|
|
84
|
-
return /* @__PURE__ */ e("div", { className: o("bg-dialog-bg/85 sticky bottom-0 z-10 -mx-6 flex flex-col-reverse gap-2 px-6 py-4 sm:flex-row sm:justify-end", t), "data-slot": "dialog-footer", "data-testid": "spectral-dialog-footer", ...a });
|
|
85
|
-
}
|
|
86
|
-
function I({ className: t, ...a }) {
|
|
87
|
-
return /* @__PURE__ */ e(h, { className: o("text-2xl leading-none font-semibold", t), "data-slot": "dialog-title", "data-testid": "spectral-dialog-title", ...a });
|
|
88
|
-
}
|
|
89
|
-
function S({ className: t, ...a }) {
|
|
90
|
-
return /* @__PURE__ */ e(m, { className: o("text-muted-foreground text-sm", t), "data-slot": "dialog-description", "data-testid": "spectral-dialog-description", ...a });
|
|
91
|
-
}
|
|
63
|
+
)
|
|
64
|
+
] }), F = ({ className: t, ...a }) => /* @__PURE__ */ o("div", { className: e("flex flex-col gap-2 text-center sm:text-left", t), "data-slot": "dialog-header", "data-testid": "spectral-dialog-header", ...a }), H = ({ className: t, ...a }) => /* @__PURE__ */ o("div", { className: e("bg-dialog-bg/85 sticky bottom-0 z-10 -mx-6 flex flex-col-reverse gap-2 px-6 py-4 sm:flex-row sm:justify-end", t), "data-slot": "dialog-footer", "data-testid": "spectral-dialog-footer", ...a }), I = ({ className: t, ...a }) => /* @__PURE__ */ o(h, { className: e("text-2xl leading-none font-semibold", t), "data-slot": "dialog-title", "data-testid": "spectral-dialog-title", ...a }), S = ({ className: t, ...a }) => /* @__PURE__ */ o(u, { className: e("text-muted-foreground text-sm", t), "data-slot": "dialog-description", "data-testid": "spectral-dialog-description", ...a });
|
|
92
65
|
export {
|
|
93
66
|
j as Dialog,
|
|
94
67
|
P as DialogClose,
|
package/dist/Drawer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export interface DrawerProps {
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
defaultOpen?: boolean;
|
|
5
5
|
description?: string;
|
|
@@ -11,6 +11,6 @@ export type DrawerProps = {
|
|
|
11
11
|
size?: string;
|
|
12
12
|
title?: string;
|
|
13
13
|
trigger: ReactNode;
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
export declare const Drawer: ({ children, defaultOpen, description, direction, dismissible, modal, onOpenChange, open, size, title, trigger }: DrawerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
//# sourceMappingURL=Drawer.d.ts.map
|
package/dist/Drawer.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
2
|
import { jsx as t, jsxs as s } from "react/jsx-runtime";
|
|
3
3
|
import { SpectralProvider as f } from "./SpectralProvider.js";
|
|
4
|
-
import { D as e } from "./index-
|
|
5
|
-
const u = ({ children:
|
|
4
|
+
import { D as e } from "./index-CrjD9cAD.js";
|
|
5
|
+
const u = ({ children: l, defaultOpen: d = !1, description: i, direction: o = "right", dismissible: c = !0, modal: n = !0, onOpenChange: p, open: x, size: r = "380px", title: h, trigger: m }) => {
|
|
6
6
|
const a = "font-sans! fixed", w = {
|
|
7
7
|
left: {
|
|
8
8
|
className: `${a} top-0 bottom-0 left-0 shadow-[20px_0_20px_rgba(0,0,0,0.4)]`,
|
|
@@ -20,16 +20,16 @@ const u = ({ children: d, defaultOpen: o = !1, description: i, direction: l = "r
|
|
|
20
20
|
className: `${a} bottom-0 left-0 right-0 shadow-[0_-20px_20px_rgba(0,0,0,0.4)]`,
|
|
21
21
|
style: { height: r }
|
|
22
22
|
}
|
|
23
|
-
}, { className: g, style: b } = w[
|
|
24
|
-
return /* @__PURE__ */ t(f, { children: /* @__PURE__ */ s(e.Root, {
|
|
25
|
-
/* @__PURE__ */ t(e.Trigger, { asChild: !0, "data-testid": "spectral-drawer-trigger", children:
|
|
23
|
+
}, { className: g, style: b } = w[o];
|
|
24
|
+
return /* @__PURE__ */ t(f, { children: /* @__PURE__ */ s(e.Root, { "data-testid": "spectral-drawer", defaultOpen: d, direction: o, dismissible: c, modal: n, onOpenChange: p, open: x, children: [
|
|
25
|
+
/* @__PURE__ */ t(e.Trigger, { asChild: !0, "data-testid": "spectral-drawer-trigger", children: m }),
|
|
26
26
|
/* @__PURE__ */ s(e.Portal, { children: [
|
|
27
27
|
/* @__PURE__ */ t(e.Overlay, { className: "fixed inset-0 bg-transparent", "data-testid": "spectral-drawer-overlay" }),
|
|
28
|
-
/* @__PURE__ */ t(e.Content, { asChild: !0, className: `bg-drawer-bg z-10 flex flex-col outline-none
|
|
28
|
+
/* @__PURE__ */ t(e.Content, { asChild: !0, className: `bg-drawer-bg z-10 flex flex-col overscroll-contain outline-none **:box-border ${g}`, style: b, "data-testid": "spectral-drawer-content", children: /* @__PURE__ */ s("div", { children: [
|
|
29
29
|
/* @__PURE__ */ t(e.Close, {}),
|
|
30
|
-
/* @__PURE__ */ t(e.Title, { className: "text-text-primary px-3 pt-4 text-lg font-medium", "data-testid": "spectral-drawer-title", children:
|
|
30
|
+
/* @__PURE__ */ t(e.Title, { className: "text-text-primary px-3 pt-4 text-lg font-medium", "data-testid": "spectral-drawer-title", children: h }),
|
|
31
31
|
/* @__PURE__ */ t(e.Description, { className: "text-text-secondary! mb-2 px-3 text-xs! uppercase", "data-testid": "spectral-drawer-description", children: i }),
|
|
32
|
-
/* @__PURE__ */ t("div", { className: "w-auto min-w-0 overflow-hidden px-3 py-2
|
|
32
|
+
/* @__PURE__ */ t("div", { className: "w-auto min-w-0 overflow-hidden overscroll-contain px-3 py-2 *:box-border *:min-w-0", "data-testid": "spectral-drawer-body", children: l })
|
|
33
33
|
] }) })
|
|
34
34
|
] })
|
|
35
35
|
] }) });
|
package/dist/HoverCard.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
3
|
-
type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
4
3
|
type Align = 'start' | 'center' | 'end';
|
|
5
|
-
type
|
|
4
|
+
type Side = 'top' | 'right' | 'bottom' | 'left';
|
|
5
|
+
interface HoverCardContentProps {
|
|
6
6
|
align?: Align;
|
|
7
7
|
alignOffset?: number;
|
|
8
8
|
collisionBoundary?: Element | null | Array<Element | null>;
|
|
@@ -10,14 +10,15 @@ type HoverCardContentProps = {
|
|
|
10
10
|
side?: Side;
|
|
11
11
|
sideOffset?: number;
|
|
12
12
|
width?: number | 'w-fit' | 'trigger-width';
|
|
13
|
-
}
|
|
14
|
-
export
|
|
13
|
+
}
|
|
14
|
+
export interface HoverCardProps extends ComponentProps<typeof HoverCardPrimitive.Root>, HoverCardContentProps {
|
|
15
|
+
}
|
|
15
16
|
export declare const HoverCard: {
|
|
16
17
|
({ align, alignOffset, collisionBoundary, collisionPadding, side, sideOffset, width, ...props }: HoverCardProps): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
displayName: string;
|
|
18
19
|
};
|
|
19
20
|
export declare const HoverCardTrigger: {
|
|
20
|
-
({ ...props }: ComponentProps<typeof HoverCardPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
({ className, ...props }: ComponentProps<typeof HoverCardPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
displayName: string;
|
|
22
23
|
};
|
|
23
24
|
export declare const HoverCardContent: {
|