@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.
Files changed (150) hide show
  1. package/dist/.js +196 -191
  2. package/dist/Accordion.d.ts +13 -15
  3. package/dist/Accordion.js +172 -165
  4. package/dist/Alert/AlertBase.d.ts +7 -7
  5. package/dist/Alert/AlertBase.js +23 -21
  6. package/dist/Alert.d.ts +2 -2
  7. package/dist/Alert.js +32 -30
  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 +31 -30
  20. package/dist/Checkbox/CheckboxBase.d.ts +2 -2
  21. package/dist/Checkbox/CheckboxBase.js +50 -57
  22. package/dist/Checkbox.js +16 -18
  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 +4 -2
  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 +96 -74
  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/LineToolIcon.js +37 -10
  43. package/dist/Icons/MeasureIcon.d.ts +5 -0
  44. package/dist/Icons/MeasureIcon.js +26 -0
  45. package/dist/Icons/SearchIcon.d.ts +5 -0
  46. package/dist/Icons/SearchIcon.js +10 -0
  47. package/dist/Icons/index.d.ts +2 -0
  48. package/dist/Icons.js +76 -72
  49. package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
  50. package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
  51. package/dist/Input/InputUtils.d.ts +2 -2
  52. package/dist/Input/InputUtils.js +4 -4
  53. package/dist/Input.d.ts +1 -1
  54. package/dist/Input.js +31 -29
  55. package/dist/InputOTP.d.ts +10 -10
  56. package/dist/InputOTP.js +125 -123
  57. package/dist/Kbd.d.ts +8 -5
  58. package/dist/Kbd.js +85 -20
  59. package/dist/Label.d.ts +4 -2
  60. package/dist/Label.js +3 -3
  61. package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
  62. package/dist/MultiSelect/MultiSelectBase.js +278 -200
  63. package/dist/MultiSelect.d.ts +6 -6
  64. package/dist/MultiSelect.js +9 -9
  65. package/dist/Popover.js +22 -237
  66. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
  67. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
  68. package/dist/RadioButtonGroup.d.ts +1 -1
  69. package/dist/RadioGroup.d.ts +15 -15
  70. package/dist/RadioGroup.js +253 -236
  71. package/dist/Select.d.ts +3 -1
  72. package/dist/Select.js +92 -87
  73. package/dist/Separator.js +4 -4
  74. package/dist/Skeleton.d.ts +1 -2
  75. package/dist/Skeleton.js +2 -4
  76. package/dist/Slider.d.ts +6 -6
  77. package/dist/Slider.js +78 -78
  78. package/dist/Switch/SwitchBase.d.ts +4 -4
  79. package/dist/Switch/SwitchBase.js +68 -68
  80. package/dist/Switch.d.ts +3 -3
  81. package/dist/Switch.js +9 -9
  82. package/dist/Tabs/TabsBase.js +39 -38
  83. package/dist/Tabs/tabsUtils.js +7 -7
  84. package/dist/Tabs.d.ts +0 -4
  85. package/dist/Tabs.js +62 -66
  86. package/dist/Textarea/TextareaUtils.d.ts +7 -7
  87. package/dist/Textarea/TextareaUtils.js +13 -13
  88. package/dist/Textarea.js +34 -22
  89. package/dist/Toast.d.ts +43 -0
  90. package/dist/Toast.js +883 -0
  91. package/dist/Toggle/ToggleBase.d.ts +4 -4
  92. package/dist/Toggle/ToggleBase.js +32 -33
  93. package/dist/Toggle.d.ts +1 -1
  94. package/dist/Toggle.js +7 -12
  95. package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
  96. package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
  97. package/dist/ToggleGroup.d.ts +1 -1
  98. package/dist/ToggleGroup.js +27 -30
  99. package/dist/Tooltip.d.ts +1 -1
  100. package/dist/Tooltip.js +97 -97
  101. package/dist/Tray.d.ts +9 -9
  102. package/dist/Tray.js +77 -74
  103. package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
  104. package/dist/hooks/useAccordionAutoScroll.js +42 -39
  105. package/dist/hooks/useControllableState.d.ts +2 -2
  106. package/dist/hooks/useControllableState.d.ts.map +1 -1
  107. package/dist/hooks/useControllableState.js +2 -2
  108. package/dist/index-C12FUuIW.js +13 -0
  109. package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
  110. package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
  111. package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
  112. package/dist/index-DEYs15GP.js +66 -0
  113. package/dist/index-DdFoGvON.js +146 -0
  114. package/dist/index-Q3N6lgwg.js +225 -0
  115. package/dist/index.d.ts +3 -3
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/primitives/button.d.ts +1 -1
  118. package/dist/primitives/button.js +4 -4
  119. package/dist/primitives/input.d.ts.map +1 -1
  120. package/dist/primitives/input.js +8 -5
  121. package/dist/primitives/select.d.ts +12 -13
  122. package/dist/primitives/select.d.ts.map +1 -1
  123. package/dist/primitives/select.js +68 -95
  124. package/dist/primitives/slot.d.ts +5 -5
  125. package/dist/primitives/slot.d.ts.map +1 -1
  126. package/dist/primitives/slot.js +24 -33
  127. package/dist/primitives/textarea.d.ts.map +1 -1
  128. package/dist/primitives/textarea.js +4 -3
  129. package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
  130. package/dist/styles/base-colors.css +30 -30
  131. package/dist/styles/horizon/base-colors.css +30 -30
  132. package/dist/styles/horizon/colors.css +40 -11
  133. package/dist/styles/horizon/utilities.css +26 -3
  134. package/dist/styles/main.css +1 -1
  135. package/dist/styles/spectral.css +1 -1
  136. package/dist/styles/theme.css +96 -44
  137. package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
  138. package/dist/utils/formFieldUtils.d.ts +2 -2
  139. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  140. package/dist/utils/formFieldUtils.js +14 -11
  141. package/dist/utils/sharedUtils.d.ts +3 -3
  142. package/dist/utils/sharedUtils.d.ts.map +1 -1
  143. package/dist/utils/sharedUtils.js +1 -4
  144. package/dist/utils/twUtils.d.ts +1 -1
  145. package/dist/utils/twUtils.d.ts.map +1 -1
  146. package/dist/utils/twUtils.js +1 -4
  147. package/package.json +5 -1
  148. package/dist/createLucideIcon-D4r5Phnh.js +0 -70
  149. package/dist/index-CeP1E2kK.js +0 -209
  150. 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 lr, DateTimeConfigSchema as sr, HourFormatSchema as dr, PICKER_TYPES as cr, PeriodSchema as ur, TIME_BOUNDS as gr, TimePickerTypeSchema as fr, TimeValueSchema as hr, convert12HourTo24Hour as Tr, display12HourValue as vr, formatSelectPeriodLabel as xr, formatTimeNumber as Hr, getAriaLabel as yr, getAriaValueMinMax as Vr, getAriaValueNow as Sr, getArrowByType as Cr, getDateByType as Nr, getLocalizedPeriodLabel as Pr, getLocalizedPeriodLabels as Ar, getPeriodFromHours as Dr, getValid12Hour as br, getValidArrow12Hour as wr, getValidArrowHour as Ir, getValidArrowMinute as Lr, getValidArrowNumber as Mr, getValidHour as kr, getValidMinute as Fr, getValidNumber as Er, isValid12Hour as Br, isValidHour as Or, isValidMinute as jr, set12Hours as Rr, setDateByType as _r, setHours as zr, setMinutes as Ur } 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";
@@ -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 Yr } from "./DateTimePicker/DateTimeInput.js";
79
- import { TimePeriodSelect as Gr } from "./DateTimePicker/TimePeriodSelect.js";
80
- 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 }) {
81
- const [r, m] = O({
82
- 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({
83
101
  defaultValue: T,
84
- onChange: y
85
- }), 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) => {
86
105
  if (!t) {
87
- m(void 0);
106
+ i(void 0);
88
107
  return;
89
108
  }
90
- r && t.setHours(r.getHours(), r.getMinutes(), 0, 0), m(t);
91
- }, P = (t) => {
92
- m(t);
93
- }, 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) => {
94
116
  }, D = (t) => {
95
- m(t);
117
+ i(t);
96
118
  };
97
- return /* @__PURE__ */ l(F, { children: [
98
- /* @__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: [
99
121
  /* @__PURE__ */ e(
100
- w,
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: i,
105
- endIcon: /* @__PURE__ */ e(E, { asChild: !0, disabled: i, children: /* @__PURE__ */ e(
106
- k,
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", 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"),
110
132
  "data-testid": "spectral-datetime-picker-trigger",
111
- disabled: i
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__ */ l(
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(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 }) })
134
156
  ]
135
157
  }
136
158
  )
137
159
  ] });
138
- }
139
- R.displayName = "DateTimePicker";
160
+ };
161
+ _.displayName = "DateTimePicker";
140
162
  export {
141
163
  b as Calendar,
142
- lr as DEFAULT_TRANSLATIONS,
143
- sr as DateTimeConfigSchema,
144
- w as DateTimeDisplayInput,
145
- Yr as DateTimeInput,
146
- R as DateTimePicker,
147
- dr as HourFormatSchema,
148
- cr as PICKER_TYPES,
149
- ur as PeriodSchema,
150
- gr as TIME_BOUNDS,
151
- Gr as TimePeriodSelect,
152
- M as TimePicker,
153
- fr as TimePickerTypeSchema,
154
- hr as TimeValueSchema,
155
- Tr as convert12HourTo24Hour,
156
- L as detectHourFormat,
157
- vr as display12HourValue,
158
- xr as formatSelectPeriodLabel,
159
- Hr as formatTimeNumber,
160
- yr as getAriaLabel,
161
- Vr as getAriaValueMinMax,
162
- Sr as getAriaValueNow,
163
- Cr as getArrowByType,
164
- Nr as getDateByType,
165
- Pr as getLocalizedPeriodLabel,
166
- Ar as getLocalizedPeriodLabels,
167
- Dr as getPeriodFromHours,
168
- I as getResolvedLocale,
169
- br as getValid12Hour,
170
- wr as getValidArrow12Hour,
171
- Ir as getValidArrowHour,
172
- Lr as getValidArrowMinute,
173
- Mr as getValidArrowNumber,
174
- kr as getValidHour,
175
- Fr as getValidMinute,
176
- Er as getValidNumber,
177
- Br as isValid12Hour,
178
- Or as isValidHour,
179
- jr as isValidMinute,
180
- Rr as set12Hours,
181
- _r as setDateByType,
182
- zr as setHours,
183
- Ur as setMinutes
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 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: {