@spear-ai/spectral 1.6.17 → 1.8.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.
Files changed (149) hide show
  1. package/dist/.js +201 -200
  2. package/dist/Accordion.d.ts +13 -15
  3. package/dist/Accordion.js +184 -179
  4. package/dist/Alert/AlertBase.d.ts +7 -7
  5. package/dist/Alert/AlertBase.js +21 -21
  6. package/dist/Alert.d.ts +2 -2
  7. package/dist/Alert.js +31 -31
  8. package/dist/Avatar.d.ts +2 -2
  9. package/dist/Avatar.js +30 -22
  10. package/dist/Badge.d.ts +1 -1
  11. package/dist/Badge.js +3 -2
  12. package/dist/Button.d.ts +3 -3
  13. package/dist/Button.js +108 -46
  14. package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
  15. package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
  16. package/dist/ButtonGroup.d.ts +5 -5
  17. package/dist/ButtonGroup.js +21 -21
  18. package/dist/ButtonIcon.d.ts +2 -2
  19. package/dist/ButtonIcon.js +30 -31
  20. package/dist/Checkbox/CheckboxBase.d.ts +2 -2
  21. package/dist/Checkbox/CheckboxBase.js +50 -57
  22. package/dist/Checkbox.js +15 -19
  23. package/dist/DataCard/Card.d.ts +1 -1
  24. package/dist/DataCard/Card.js +1 -1
  25. package/dist/DataCard.js +1 -1
  26. package/dist/DateTimePicker/Calendar.d.ts +4 -4
  27. package/dist/DateTimePicker/Calendar.js +3 -3
  28. package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
  29. package/dist/DateTimePicker/DateTimeInput.js +4 -4
  30. package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
  31. package/dist/DateTimePicker/DateTimeUtils.js +139 -197
  32. package/dist/DateTimePicker/TimePicker.d.ts +4 -4
  33. package/dist/DateTimePicker/TimePicker.js +3 -3
  34. package/dist/DateTimePicker.d.ts +5 -5
  35. package/dist/DateTimePicker.js +90 -70
  36. package/dist/Dialog.d.ts +13 -13
  37. package/dist/Dialog.js +57 -84
  38. package/dist/Drawer.d.ts +2 -2
  39. package/dist/Drawer.js +8 -8
  40. package/dist/HoverCard.d.ts +6 -5
  41. package/dist/HoverCard.js +64 -64
  42. package/dist/Icons/PolygonIcon.d.ts +5 -0
  43. package/dist/Icons/PolygonIcon.js +40 -0
  44. package/dist/Icons/index.d.ts +1 -1
  45. package/dist/Icons.js +34 -34
  46. package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
  47. package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
  48. package/dist/Input/InputUtils.d.ts +2 -2
  49. package/dist/Input/InputUtils.js +4 -4
  50. package/dist/Input.d.ts +1 -1
  51. package/dist/Input.js +19 -19
  52. package/dist/InputOTP.d.ts +10 -10
  53. package/dist/InputOTP.js +114 -114
  54. package/dist/Kbd.d.ts +8 -5
  55. package/dist/Kbd.js +85 -20
  56. package/dist/Label.d.ts +4 -2
  57. package/dist/Label.js +3 -3
  58. package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
  59. package/dist/MultiSelect/MultiSelectBase.js +278 -202
  60. package/dist/MultiSelect.d.ts +6 -6
  61. package/dist/MultiSelect.js +9 -9
  62. package/dist/Popover.js +22 -237
  63. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
  64. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
  65. package/dist/RadioButtonGroup.d.ts +1 -1
  66. package/dist/RadioGroup.d.ts +15 -15
  67. package/dist/RadioGroup.js +253 -236
  68. package/dist/Select.d.ts +3 -1
  69. package/dist/Select.js +91 -88
  70. package/dist/Separator.js +4 -4
  71. package/dist/Skeleton.d.ts +1 -2
  72. package/dist/Skeleton.js +2 -4
  73. package/dist/Slider.d.ts +6 -6
  74. package/dist/Slider.js +78 -78
  75. package/dist/Switch/SwitchBase.d.ts +4 -4
  76. package/dist/Switch/SwitchBase.js +75 -111
  77. package/dist/Switch.d.ts +4 -4
  78. package/dist/Switch.js +122 -33
  79. package/dist/Tabs/TabsBase.js +39 -38
  80. package/dist/Tabs/tabsUtils.js +7 -7
  81. package/dist/Tabs.d.ts +0 -4
  82. package/dist/Tabs.js +62 -66
  83. package/dist/Textarea/TextareaUtils.d.ts +7 -7
  84. package/dist/Textarea/TextareaUtils.js +13 -13
  85. package/dist/Textarea.js +28 -18
  86. package/dist/Toast.d.ts +43 -0
  87. package/dist/Toast.js +883 -0
  88. package/dist/Toggle/ToggleBase.d.ts +4 -4
  89. package/dist/Toggle/ToggleBase.js +32 -33
  90. package/dist/Toggle.d.ts +1 -1
  91. package/dist/Toggle.js +7 -12
  92. package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
  93. package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
  94. package/dist/ToggleGroup.d.ts +1 -1
  95. package/dist/ToggleGroup.js +27 -30
  96. package/dist/Tooltip.d.ts +1 -1
  97. package/dist/Tooltip.js +97 -97
  98. package/dist/Tray.d.ts +9 -9
  99. package/dist/Tray.js +71 -70
  100. package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
  101. package/dist/hooks/useAccordionAutoScroll.js +42 -39
  102. package/dist/hooks/useControllableState.d.ts +2 -2
  103. package/dist/hooks/useControllableState.d.ts.map +1 -1
  104. package/dist/hooks/useControllableState.js +2 -2
  105. package/dist/index-C12FUuIW.js +13 -0
  106. package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
  107. package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
  108. package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
  109. package/dist/index-DEYs15GP.js +66 -0
  110. package/dist/index-DdFoGvON.js +146 -0
  111. package/dist/index-Q3N6lgwg.js +225 -0
  112. package/dist/index.d.ts +3 -3
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/primitives/button.d.ts +1 -1
  115. package/dist/primitives/button.js +4 -4
  116. package/dist/primitives/input.d.ts.map +1 -1
  117. package/dist/primitives/input.js +8 -5
  118. package/dist/primitives/select.d.ts +12 -13
  119. package/dist/primitives/select.d.ts.map +1 -1
  120. package/dist/primitives/select.js +59 -88
  121. package/dist/primitives/slot.d.ts +5 -5
  122. package/dist/primitives/slot.d.ts.map +1 -1
  123. package/dist/primitives/slot.js +24 -33
  124. package/dist/primitives/textarea.d.ts.map +1 -1
  125. package/dist/primitives/textarea.js +4 -3
  126. package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
  127. package/dist/styles/base-colors.css +30 -30
  128. package/dist/styles/horizon/base-colors.css +30 -30
  129. package/dist/styles/horizon/colors.css +43 -13
  130. package/dist/styles/horizon/utilities.css +26 -3
  131. package/dist/styles/main.css +1 -1
  132. package/dist/styles/spectral.css +2 -2
  133. package/dist/styles/theme.css +99 -46
  134. package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
  135. package/dist/utils/formFieldUtils.d.ts +2 -2
  136. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  137. package/dist/utils/formFieldUtils.js +14 -11
  138. package/dist/utils/sharedUtils.d.ts +3 -3
  139. package/dist/utils/sharedUtils.d.ts.map +1 -1
  140. package/dist/utils/sharedUtils.js +1 -4
  141. package/dist/utils/twUtils.d.ts +1 -1
  142. package/dist/utils/twUtils.d.ts.map +1 -1
  143. package/dist/utils/twUtils.js +1 -4
  144. package/package.json +6 -1
  145. package/dist/Icons/LineToolIcon2.d.ts +0 -5
  146. package/dist/Icons/LineToolIcon2.js +0 -49
  147. package/dist/createLucideIcon-D4r5Phnh.js +0 -70
  148. package/dist/index-CeP1E2kK.js +0 -209
  149. 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 function TimePicker({ className, date, hourFormat, locale, onChange, onPeriodChange, translations, ...props }: TimePickerProps): import("react/jsx-runtime").JSX.Element;
13
- export declare namespace TimePicker {
14
- var displayName: string;
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
- function 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(e.selectPeriodTemplate, n), [e.selectPeriodTemplate, n]), r = v === "24", u = t ? b(t.getHours()) : "AM", N = (i) => {
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
@@ -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, any> | null;
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 function DateTimePicker({ calendarProps, className, defaultValue, disabled, disablePastDates, errorMessage, hourFormat, label, locale, onChange, showTimePicker, state, timeLocale, timeTranslations, value, ...props }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
23
- export declare namespace DateTimePicker {
24
- var displayName: string;
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';
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
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 w } from "./DateTimePicker/DateTimeDisplayInput.js";
6
- import { getResolvedLocale as I, detectHourFormat as L } from "./DateTimePicker/DateTimeUtils.js";
7
- import { DEFAULT_TRANSLATIONS as dr, DateTimeConfigSchema as cr, HourFormatSchema as ur, PICKER_TYPES as gr, PeriodSchema as fr, TIME_BOUNDS as hr, TimePickerTypeSchema as Tr, TimeValueSchema as vr, convert12HourTo24Hour as xr, display12HourValue as Hr, formatSelectPeriodLabel as yr, formatTimeNumber as Vr, getAriaLabel as Sr, getAriaValueMinMax as Cr, getAriaValueNow as Nr, getArrowByType as Pr, getDateByType as Ar, getLocalizedPeriodLabel as Dr, getLocalizedPeriodLabels as br, getPeriodFromHours as wr, getValid12Hour as Ir, getValidArrow12Hour as Lr, getValidArrowHour as Mr, getValidArrowMinute as kr, getValidArrowNumber as Fr, getValidHour as Er, getValidMinute as Br, getValidNumber as Or, isValid12Hour as jr, isValidHour as Rr, isValidMinute as _r, set12Hours as zr, setDateByType as Ur, setHours as Kr, setMinutes as Yr } from "./DateTimePicker/DateTimeUtils.js";
8
- import { TimePicker as M } from "./DateTimePicker/TimePicker.js";
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 k } from "./Icons/CalendarIcon.js";
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";
@@ -39,7 +39,6 @@ import "./Icons/KeyboardIcon.js";
39
39
  import "./Icons/LabelIcon.js";
40
40
  import "./Icons/LassoIcon.js";
41
41
  import "./Icons/LineToolIcon.js";
42
- import "./Icons/LineToolIcon2.js";
43
42
  import "./Icons/LiveViewIcon.js";
44
43
  import "./Icons/LoaderIcon.js";
45
44
  import "./Icons/LocationIcon.js";
@@ -53,6 +52,7 @@ import "./Icons/PanelIconClose.js";
53
52
  import "./Icons/PanelIconOpen.js";
54
53
  import "./Icons/PlayIcon.js";
55
54
  import "./Icons/PlusIcon.js";
55
+ import "./Icons/PolygonIcon.js";
56
56
  import "./Icons/ResetIcon.js";
57
57
  import "./Icons/ReviewedIcon.js";
58
58
  import "./Icons/ScissorsIcon.js";
@@ -76,41 +76,61 @@ import { Popover as F, PopoverTrigger as E, PopoverContent as B } from "./Popove
76
76
  import { useControllableState as O } from "./hooks/useControllableState.js";
77
77
  import { ErrorMessage as j } from "./utils/formFieldUtils.js";
78
78
  import { cn as a } from "./utils/twUtils.js";
79
- import { useMemo as g } from "react";
80
- import { DateTimeInput as Gr } from "./DateTimePicker/DateTimeInput.js";
81
- import { TimePeriodSelect as Qr } from "./DateTimePicker/TimePeriodSelect.js";
82
- function R({ calendarProps: f, className: h, defaultValue: T, disabled: i = !1, disablePastDates: v = !0, errorMessage: s, hourFormat: d, label: x, locale: H, onChange: y, showTimePicker: o = !0, state: c = "default", timeLocale: u, timeTranslations: V, value: S, ...C }) {
83
- const [r, m] = O({
84
- value: S,
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({
85
101
  defaultValue: T,
86
- onChange: y
87
- }), n = g(() => I(u), [u]), p = g(() => d ?? L(n), [d, n]), N = (t) => {
102
+ onChange: y,
103
+ value: C
104
+ }), l = g(() => w(u), [u]), p = g(() => d ?? I(l), [d, l]), N = (t) => {
88
105
  if (!t) {
89
- m(void 0);
106
+ i(void 0);
90
107
  return;
91
108
  }
92
- r && t.setHours(r.getHours(), r.getMinutes(), 0, 0), m(t);
93
- }, P = (t) => {
94
- m(t);
95
- }, A = (t) => {
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) => {
96
116
  }, D = (t) => {
97
- m(t);
117
+ i(t);
98
118
  };
99
- return /* @__PURE__ */ l(F, { children: [
100
- /* @__PURE__ */ l("div", { className: a("w-full", h), "data-slot": "datetime-picker", "data-testid": "spectral-datetime-picker", ...C, children: [
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: [
101
121
  /* @__PURE__ */ e(
102
- w,
122
+ k,
103
123
  {
104
124
  className: a("flex w-full justify-start gap-4 pr-12", !r && "text-text-secondary"),
105
125
  "data-testid": "spectral-datetime-picker-input",
106
- disabled: i,
107
- endIcon: /* @__PURE__ */ e(E, { asChild: !0, disabled: i, children: /* @__PURE__ */ e(
108
- k,
126
+ disabled: m,
127
+ endIcon: /* @__PURE__ */ e(E, { asChild: !0, disabled: m, children: /* @__PURE__ */ e(
128
+ M,
109
129
  {
110
130
  "aria-label": "Open date picker",
111
- 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", i ? "pointer-events-none cursor-not-allowed opacity-50" : "hover:text-input-icon--hover cursor-pointer"),
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"),
112
132
  "data-testid": "spectral-datetime-picker-trigger",
113
- disabled: i
133
+ disabled: m
114
134
  }
115
135
  ) }),
116
136
  hourFormat: p,
@@ -123,7 +143,7 @@ function R({ calendarProps: f, className: h, defaultValue: T, disabled: i = !1,
123
143
  ),
124
144
  c === "error" && s && /* @__PURE__ */ e(j, { message: s, dataTestId: "spectral-datetime-picker-error-message", id: "datetime-picker-error" })
125
145
  ] }),
126
- /* @__PURE__ */ l(
146
+ /* @__PURE__ */ n(
127
147
  B,
128
148
  {
129
149
  align: "start",
@@ -132,55 +152,55 @@ function R({ calendarProps: f, className: h, defaultValue: T, disabled: i = !1,
132
152
  onOpenAutoFocus: (t) => t.preventDefault(),
133
153
  children: [
134
154
  /* @__PURE__ */ e(b, { ...f, disablePastDates: v, locale: H, mode: "single", onSelect: N, selected: r }),
135
- o && /* @__PURE__ */ e("div", { className: "border-border-secondary border-l pl-6", children: /* @__PURE__ */ e(M, { date: r, hourFormat: p, locale: n, onChange: P, onPeriodChange: A, translations: V }) })
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 }) })
136
156
  ]
137
157
  }
138
158
  )
139
159
  ] });
140
- }
141
- R.displayName = "DateTimePicker";
160
+ };
161
+ _.displayName = "DateTimePicker";
142
162
  export {
143
163
  b as Calendar,
144
- dr as DEFAULT_TRANSLATIONS,
145
- cr as DateTimeConfigSchema,
146
- w as DateTimeDisplayInput,
147
- Gr as DateTimeInput,
148
- R as DateTimePicker,
149
- ur as HourFormatSchema,
150
- gr as PICKER_TYPES,
151
- fr as PeriodSchema,
152
- hr as TIME_BOUNDS,
153
- Qr as TimePeriodSelect,
154
- M as TimePicker,
155
- Tr as TimePickerTypeSchema,
156
- vr as TimeValueSchema,
157
- xr as convert12HourTo24Hour,
158
- L as detectHourFormat,
159
- Hr as display12HourValue,
160
- yr as formatSelectPeriodLabel,
161
- Vr as formatTimeNumber,
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,
162
182
  Sr as getAriaLabel,
163
- Cr as getAriaValueMinMax,
164
- Nr as getAriaValueNow,
165
- Pr as getArrowByType,
166
- Ar as getDateByType,
167
- Dr as getLocalizedPeriodLabel,
168
- br as getLocalizedPeriodLabels,
183
+ Nr as getAriaValueMinMax,
184
+ Pr as getAriaValueNow,
185
+ Ar as getArrowByType,
186
+ Dr as getDateByType,
187
+ br as getLocalizedPeriodLabel,
188
+ kr as getLocalizedPeriodLabels,
169
189
  wr as getPeriodFromHours,
170
- I as getResolvedLocale,
190
+ w as getResolvedLocale,
171
191
  Ir as getValid12Hour,
172
192
  Lr as getValidArrow12Hour,
173
193
  Mr as getValidArrowHour,
174
- kr as getValidArrowMinute,
175
- Fr as getValidArrowNumber,
176
- Er as getValidHour,
177
- Br as getValidMinute,
178
- Or as getValidNumber,
179
- jr as isValid12Hour,
180
- Rr as isValidHour,
181
- _r as isValidMinute,
182
- zr as set12Hours,
183
- Ur as setDateByType,
184
- Kr as setHours,
185
- Yr as setMinutes
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
186
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 function Dialog({ isOpen, modal, ...props }: Omit<ComponentProps<typeof DialogPrimitive.Root>, 'open'> & {
3
+ declare const Dialog: ({ isOpen, modal, ...props }: Omit<ComponentProps<typeof DialogPrimitive.Root>, "open"> & {
4
4
  isOpen?: boolean;
5
5
  dialogOverlay?: boolean;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- declare function DialogTrigger({ ...props }: ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
8
- declare function DialogPortal({ ...props }: ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
9
- declare function DialogClose({ ...props }: ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
10
- declare function DialogOverlay({ className, ...props }: ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
11
- declare function DialogContent({ className, children, dialogOverlay, showCloseButton, onEscapeKeyDown, onInteractOutside, onPointerDownOutside, ...props }: ComponentProps<typeof DialogPrimitive.Content> & {
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
- }): import("react/jsx-runtime").JSX.Element;
18
- declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
19
- declare function DialogFooter({ className, ...props }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
20
- declare function DialogTitle({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
21
- declare function DialogDescription({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
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 e, jsxs as s } from "react/jsx-runtime";
3
- import { CloseIcon as p } from "./Icons/CloseIcon.js";
4
- import { R as f, C as i, a as u, D as m, O as x, P as b, T as h, b as v } from "./index-BdS7Ix8W.js";
5
- import { cn as o } from "./utils/twUtils.js";
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
- function j({
8
+ const j = ({
9
9
  isOpen: t,
10
10
  modal: a = !1,
11
- ...l
12
- }) {
13
- return /* @__PURE__ */ e(f, { open: t, modal: a, "data-slot": "dialog", "data-testid": "spectral-dialog", ...l });
14
- }
15
- function O({ ...t }) {
16
- return /* @__PURE__ */ e(v, { asChild: !0, "data-testid": "spectral-dialog-trigger", ...t });
17
- }
18
- function D({ ...t }) {
19
- return /* @__PURE__ */ e(b, { "data-slot": "dialog-portal", "data-testid": "dialog-portal", ...t });
20
- }
21
- function P({ ...t }) {
22
- return /* @__PURE__ */ e(i, { asChild: !0, "data-slot": "dialog-close", "data-testid": "spectral-dialog-close", ...t });
23
- }
24
- function C({ className: t, ...a }) {
25
- return /* @__PURE__ */ e(
26
- x,
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: o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-sm", t),
29
- "data-slot": "dialog-overlay",
30
- "data-testid": "spectral-dialog-overlay",
31
- ...a
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 type DrawerProps = {
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-B3UpsZ2x.js";
5
- const u = ({ children: d, defaultOpen: o = !1, description: i, direction: l = "right", dismissible: c = !0, modal: p = !0, onOpenChange: n, open: m, size: r = "380px", title: x, trigger: h }) => {
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[l];
24
- return /* @__PURE__ */ t(f, { children: /* @__PURE__ */ s(e.Root, { defaultOpen: o, dismissible: c, open: m, onOpenChange: n, direction: l, modal: p, "data-testid": "spectral-drawer", children: [
25
- /* @__PURE__ */ t(e.Trigger, { asChild: !0, "data-testid": "spectral-drawer-trigger", children: h }),
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 [&_*]:box-border ${g}`, style: b, "data-testid": "spectral-drawer-content", children: /* @__PURE__ */ s("div", { children: [
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: x }),
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 [&_*]:min-w-0 [&>*]:min-w-0", "data-testid": "spectral-drawer-body", children: d })
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
  ] }) });
@@ -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 HoverCardContentProps = {
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 type HoverCardProps = ComponentProps<typeof HoverCardPrimitive.Root> & HoverCardContentProps;
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: {