@krak-stack/registry 0.8.3 → 0.9.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 (42) hide show
  1. package/CHANGELOG.md +10 -5
  2. package/dist/components/ui/animated-list.js +5 -0
  3. package/dist/components/ui/app-switcher.d.ts +2 -1
  4. package/dist/components/ui/app-switcher.js +5 -1
  5. package/dist/components/ui/async-action-button.d.ts +2 -1
  6. package/dist/components/ui/async-action-button.js +3 -1
  7. package/dist/components/ui/bulk-list-input.d.ts +2 -1
  8. package/dist/components/ui/bulk-list-input.js +6 -1
  9. package/dist/components/ui/calendar.d.ts +10 -0
  10. package/dist/components/ui/choice-cards.d.ts +1 -0
  11. package/dist/components/ui/choice-cards.js +7 -1
  12. package/dist/components/ui/color-picker.d.ts +2 -1
  13. package/dist/components/ui/color-picker.js +4 -1
  14. package/dist/components/ui/cron-expression-editor.d.ts +3 -1
  15. package/dist/components/ui/cron-expression-editor.js +13 -3
  16. package/dist/components/ui/danger-confirmation.d.ts +1 -0
  17. package/dist/components/ui/danger-confirmation.js +5 -1
  18. package/dist/components/ui/date-picker.d.ts +33 -0
  19. package/dist/components/ui/date-picker.js +470 -0
  20. package/dist/components/ui/date-picker.schema.d.ts +9 -0
  21. package/dist/components/ui/editable-text.js +8 -1
  22. package/dist/components/ui/form.d.ts +5 -5
  23. package/dist/components/ui/image-crop-editor.js +10 -1
  24. package/dist/components/ui/phone-number-input.d.ts +3 -1
  25. package/dist/components/ui/phone-number-input.js +53 -13
  26. package/dist/components/ui/phone-number-input.schema.d.ts +7 -0
  27. package/dist/components/ui/{copy-value.d.ts → secret-value.d.ts} +4 -6
  28. package/dist/components/ui/secret-value.js +222 -0
  29. package/dist/components/ui/select-with-custom-input.d.ts +36 -0
  30. package/dist/components/ui/select-with-custom-input.js +275 -0
  31. package/dist/components/ui/sidebar-layout.js +1 -0
  32. package/dist/components/ui/stepper.js +8 -0
  33. package/dist/components/ui/timezone-select.d.ts +2 -1
  34. package/dist/components/ui/timezone-select.js +5 -1
  35. package/dist/components/ui/toast.d.ts +18 -0
  36. package/dist/components/ui/toast.js +121 -0
  37. package/dist/components/ui/unsaved-changes-guard.d.ts +2 -1
  38. package/dist/components/ui/unsaved-changes-guard.js +4 -1
  39. package/dist/components/ui/upload-attachment.js +3 -0
  40. package/dist/lib/docs.js +1 -0
  41. package/package.json +19 -5
  42. package/dist/components/ui/copy-value.js +0 -319
@@ -0,0 +1,275 @@
1
+ // ../../src/components/ui/select-with-custom-input.tsx
2
+ import { useId, useRef } from "react";
3
+
4
+ // ../../src/components/ui/input.tsx
5
+ import { Input as InputPrimitive } from "@base-ui/react/input";
6
+
7
+ // ../../src/lib/utils.ts
8
+ import { cn } from "cn";
9
+
10
+ // ../../src/components/ui/input.tsx
11
+ import { jsx } from "react/jsx-runtime";
12
+ function Input({ className, type, ...props }) {
13
+ return /* @__PURE__ */ jsx(InputPrimitive, {
14
+ type,
15
+ "data-slot": "input",
16
+ className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
17
+ ...props
18
+ });
19
+ }
20
+
21
+ // ../../src/components/ui/select.tsx
22
+ import { Select as SelectPrimitive } from "@base-ui/react/select";
23
+ import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react";
24
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
25
+ "use client";
26
+ var Select = SelectPrimitive.Root;
27
+ function SelectValue({ className, ...props }) {
28
+ return /* @__PURE__ */ jsx2(SelectPrimitive.Value, {
29
+ "data-slot": "select-value",
30
+ className: cn("flex flex-1 text-left", className),
31
+ ...props
32
+ });
33
+ }
34
+ function SelectTrigger({
35
+ className,
36
+ size = "default",
37
+ children,
38
+ ...props
39
+ }) {
40
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
41
+ "data-slot": "select-trigger",
42
+ "data-size": size,
43
+ className: cn("flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
44
+ ...props,
45
+ children: [
46
+ children,
47
+ /* @__PURE__ */ jsx2(SelectPrimitive.Icon, {
48
+ render: /* @__PURE__ */ jsx2(ChevronDownIcon, {
49
+ className: "text-muted-foreground pointer-events-none size-4"
50
+ })
51
+ })
52
+ ]
53
+ });
54
+ }
55
+ function SelectContent({
56
+ className,
57
+ children,
58
+ side = "bottom",
59
+ sideOffset = 4,
60
+ align = "center",
61
+ alignOffset = 0,
62
+ alignItemWithTrigger = true,
63
+ ...props
64
+ }) {
65
+ return /* @__PURE__ */ jsx2(SelectPrimitive.Portal, {
66
+ children: /* @__PURE__ */ jsx2(SelectPrimitive.Positioner, {
67
+ side,
68
+ sideOffset,
69
+ align,
70
+ alignOffset,
71
+ alignItemWithTrigger,
72
+ className: "isolate z-50",
73
+ children: /* @__PURE__ */ jsxs(SelectPrimitive.Popup, {
74
+ "data-slot": "select-content",
75
+ "data-align-trigger": alignItemWithTrigger,
76
+ className: cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
77
+ ...props,
78
+ children: [
79
+ /* @__PURE__ */ jsx2(SelectScrollUpButton, {}),
80
+ /* @__PURE__ */ jsx2(SelectPrimitive.List, {
81
+ children
82
+ }),
83
+ /* @__PURE__ */ jsx2(SelectScrollDownButton, {})
84
+ ]
85
+ })
86
+ })
87
+ });
88
+ }
89
+ function SelectItem({
90
+ className,
91
+ children,
92
+ ...props
93
+ }) {
94
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
95
+ "data-slot": "select-item",
96
+ className: cn("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
97
+ ...props,
98
+ children: [
99
+ /* @__PURE__ */ jsx2(SelectPrimitive.ItemText, {
100
+ className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap",
101
+ children
102
+ }),
103
+ /* @__PURE__ */ jsx2(SelectPrimitive.ItemIndicator, {
104
+ render: /* @__PURE__ */ jsx2("span", {
105
+ className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center"
106
+ }),
107
+ children: /* @__PURE__ */ jsx2(CheckIcon, {
108
+ className: "pointer-events-none"
109
+ })
110
+ })
111
+ ]
112
+ });
113
+ }
114
+ function SelectScrollUpButton({
115
+ className,
116
+ ...props
117
+ }) {
118
+ return /* @__PURE__ */ jsx2(SelectPrimitive.ScrollUpArrow, {
119
+ "data-slot": "select-scroll-up-button",
120
+ className: cn("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
121
+ ...props,
122
+ children: /* @__PURE__ */ jsx2(ChevronUpIcon, {})
123
+ });
124
+ }
125
+ function SelectScrollDownButton({
126
+ className,
127
+ ...props
128
+ }) {
129
+ return /* @__PURE__ */ jsx2(SelectPrimitive.ScrollDownArrow, {
130
+ "data-slot": "select-scroll-down-button",
131
+ className: cn("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
132
+ ...props,
133
+ children: /* @__PURE__ */ jsx2(ChevronDownIcon, {})
134
+ });
135
+ }
136
+
137
+ // ../../src/components/ui/select-with-custom-input.tsx
138
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
139
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
140
+ "use client";
141
+ var SelectWithCustomInput = ({
142
+ label,
143
+ options,
144
+ value,
145
+ onValueChange,
146
+ name,
147
+ customName,
148
+ required,
149
+ disabled,
150
+ readOnly,
151
+ placeholder,
152
+ description,
153
+ error,
154
+ locale,
155
+ className,
156
+ triggerClassName,
157
+ contentClassName,
158
+ inputClassName
159
+ }) => {
160
+ const id = useId();
161
+ const language = useKrakstackLocale(locale);
162
+ const selected = options.find((option) => option.value === value?.option);
163
+ const input = useRef(null);
164
+ const focusInput = useRef(false);
165
+ const describedBy = [description && `${id}-description`, error && `${id}-error`].filter(Boolean).join(" ") || undefined;
166
+ return /* @__PURE__ */ jsxs2("div", {
167
+ "data-slot": "select-with-custom-input",
168
+ "data-state": selected?.input ? "custom" : "preset",
169
+ className: cn("grid min-w-0 gap-2", className),
170
+ children: [
171
+ /* @__PURE__ */ jsx3("label", {
172
+ htmlFor: id,
173
+ "data-slot": "select-with-custom-input-label",
174
+ className: "text-sm font-medium",
175
+ children: label
176
+ }),
177
+ /* @__PURE__ */ jsxs2(Select, {
178
+ items: options,
179
+ value: value?.option ?? null,
180
+ name,
181
+ required,
182
+ disabled,
183
+ readOnly,
184
+ onValueChange: (next) => {
185
+ const option = options.find((option) => option.value === next);
186
+ if (disabled || readOnly || option?.disabled)
187
+ return;
188
+ if (!option) {
189
+ onValueChange(null);
190
+ return;
191
+ }
192
+ if (option.value === value?.option)
193
+ return;
194
+ focusInput.current = Boolean(option.input);
195
+ onValueChange(option.input ? { option: option.value, customValue: "" } : { option: option.value });
196
+ },
197
+ children: [
198
+ /* @__PURE__ */ jsx3(SelectTrigger, {
199
+ id,
200
+ "data-component": "select-with-custom-input-trigger",
201
+ "aria-invalid": Boolean(error),
202
+ "aria-describedby": describedBy,
203
+ className: cn("w-full min-w-0", triggerClassName),
204
+ children: /* @__PURE__ */ jsx3(SelectValue, {
205
+ placeholder: placeholder ?? (language.startsWith("fr") ? "Sélectionner une option" : "Select an option")
206
+ })
207
+ }),
208
+ /* @__PURE__ */ jsx3(SelectContent, {
209
+ "data-component": "select-with-custom-input-content",
210
+ className: contentClassName,
211
+ finalFocus: () => {
212
+ const target = focusInput.current ? input.current : null;
213
+ focusInput.current = false;
214
+ return target ?? true;
215
+ },
216
+ children: options.map((option) => /* @__PURE__ */ jsx3(SelectItem, {
217
+ value: option.value,
218
+ disabled: option.disabled,
219
+ children: option.label
220
+ }, option.value))
221
+ })
222
+ ]
223
+ }),
224
+ selected?.input ? /* @__PURE__ */ jsxs2("div", {
225
+ "data-slot": "select-with-custom-input-field",
226
+ className: "grid gap-2",
227
+ children: [
228
+ /* @__PURE__ */ jsx3("label", {
229
+ htmlFor: `${id}-custom`,
230
+ className: "text-sm font-medium",
231
+ children: selected.input.label
232
+ }),
233
+ /* @__PURE__ */ jsx3(Input, {
234
+ ref: input,
235
+ id: `${id}-custom`,
236
+ "data-component": "select-with-custom-input-text",
237
+ name: customName ?? (name ? `${name}Custom` : undefined),
238
+ value: value?.customValue ?? "",
239
+ disabled,
240
+ readOnly,
241
+ required: selected.input.required,
242
+ maxLength: selected.input.maxLength,
243
+ placeholder: selected.input.placeholder,
244
+ "aria-invalid": Boolean(error),
245
+ "aria-describedby": describedBy,
246
+ className: inputClassName,
247
+ onChange: (event) => {
248
+ if (!disabled && !readOnly)
249
+ onValueChange({
250
+ option: selected.value,
251
+ customValue: event.target.value
252
+ });
253
+ }
254
+ })
255
+ ]
256
+ }) : null,
257
+ description ? /* @__PURE__ */ jsx3("p", {
258
+ id: `${id}-description`,
259
+ "data-slot": "select-with-custom-input-description",
260
+ className: "text-muted-foreground text-xs",
261
+ children: description
262
+ }) : null,
263
+ error ? /* @__PURE__ */ jsx3("p", {
264
+ id: `${id}-error`,
265
+ "data-slot": "select-with-custom-input-error",
266
+ role: "alert",
267
+ className: "text-destructive text-sm",
268
+ children: error
269
+ }) : null
270
+ ]
271
+ });
272
+ };
273
+ export {
274
+ SelectWithCustomInput
275
+ };
@@ -638,6 +638,7 @@ function AppSidebar({ collapsible, footer, groups, header }) {
638
638
  });
639
639
  return /* @__PURE__ */ jsx5(SidebarMenuItem, {
640
640
  children: /* @__PURE__ */ jsxs4(SidebarMenuButton, {
641
+ className: "h-auto min-h-8",
641
642
  onClick: closeMobileSidebar,
642
643
  render,
643
644
  tooltip: item.label(),
@@ -63,6 +63,7 @@ var Stepper = ({
63
63
  children: labels.progress(currentIndex + 1, steps.length)
64
64
  }),
65
65
  /* @__PURE__ */ jsx("ol", {
66
+ "data-slot": "stepper-list",
66
67
  className: cn("flex gap-2", variant === "underline" && "flex-wrap gap-x-6 gap-y-1", variant === "underline" && orientation === "horizontal" && "justify-center", orientation === "vertical" && "flex-col", orientation === "responsive" && "lg:flex-col"),
67
68
  children: steps.map((step, index) => {
68
69
  const active = step.id === currentStep;
@@ -70,9 +71,11 @@ var Stepper = ({
70
71
  const content = /* @__PURE__ */ jsxs(Fragment, {
71
72
  children: [
72
73
  variant === "segmented" ? /* @__PURE__ */ jsx("span", {
74
+ "data-slot": "stepper-indicator",
73
75
  "aria-hidden": "true",
74
76
  className: cn("bg-muted block h-1.5 w-full rounded-full motion-safe:transition-colors motion-safe:duration-150", state === "completed" && "bg-primary/50", active && "bg-primary", state === "error" && "bg-destructive")
75
77
  }) : variant === "labelled" ? /* @__PURE__ */ jsx("span", {
78
+ "data-slot": "stepper-indicator",
76
79
  "aria-hidden": "true",
77
80
  className: cn("flex size-8 shrink-0 items-center justify-center rounded-full border text-xs font-medium motion-safe:transition-colors motion-safe:duration-150 [&_svg]:size-4", state === "completed" && "border-primary/30 bg-primary/10 text-primary", active && "border-primary bg-primary text-primary-foreground", state === "error" && "border-destructive text-destructive"),
78
81
  children: state === "error" ? /* @__PURE__ */ jsx(CircleAlert, {}) : state === "completed" && !active ? /* @__PURE__ */ jsx(Check, {}) : step.icon ?? index + 1
@@ -81,10 +84,12 @@ var Stepper = ({
81
84
  className: cn("min-w-0 break-words", variant === "segmented" && "sr-only", orientation === "responsive" && variant === "labelled" && "sr-only lg:not-sr-only"),
82
85
  children: [
83
86
  /* @__PURE__ */ jsx("span", {
87
+ "data-slot": "stepper-label",
84
88
  className: "block",
85
89
  children: step.label
86
90
  }),
87
91
  step.description ? /* @__PURE__ */ jsx("span", {
92
+ "data-slot": "stepper-description",
88
93
  className: "text-muted-foreground block text-xs font-normal",
89
94
  children: step.description
90
95
  }) : null,
@@ -105,9 +110,11 @@ var Stepper = ({
105
110
  });
106
111
  const itemClassName = cn("text-muted-foreground flex min-h-11 w-full min-w-0 items-center rounded-md text-sm", variant === "labelled" && orientation === "horizontal" ? "flex-col gap-2 text-center sm:flex-row sm:gap-3 sm:text-left" : "gap-3 text-left", variant === "labelled" && "px-2 py-2", orientation === "responsive" && "justify-center lg:justify-start", variant === "underline" && "w-auto justify-start rounded-none border-b-2 border-transparent py-3 text-left motion-safe:transition-colors motion-safe:duration-150", variant === "underline" && active && "border-foreground", active && "text-foreground font-medium", state === "error" && "text-destructive");
107
112
  return /* @__PURE__ */ jsx("li", {
113
+ "data-slot": "stepper-item",
108
114
  "data-state": state,
109
115
  className: cn("min-w-0", variant !== "underline" && "flex-1"),
110
116
  children: onStepSelect ? /* @__PURE__ */ jsx("button", {
117
+ "data-slot": "stepper-trigger",
111
118
  type: "button",
112
119
  "aria-current": active ? "step" : undefined,
113
120
  "aria-disabled": step.disabled || undefined,
@@ -119,6 +126,7 @@ var Stepper = ({
119
126
  },
120
127
  children: content
121
128
  }) : /* @__PURE__ */ jsx("div", {
129
+ "data-slot": "stepper-trigger",
122
130
  "aria-current": active ? "step" : undefined,
123
131
  className: itemClassName,
124
132
  children: content
@@ -39,6 +39,7 @@ export type TimezoneSelectProps = {
39
39
  name?: string;
40
40
  disabled?: boolean;
41
41
  className?: string;
42
+ contentClassName?: string;
42
43
  locale?: string;
43
44
  messages?: Partial<Record<string, Partial<TimezoneSelectMessages>>>;
44
45
  };
@@ -53,4 +54,4 @@ export declare const getTimeZoneDetails: ({ timeZone, at, locale, }: {
53
54
  locale?: string;
54
55
  }) => TimeZoneDetails | undefined;
55
56
  /** Adds time-zone semantics to the existing combobox; owns no generic picker behavior. */
56
- export declare const TimezoneSelect: ({ value, onValueChange, label, continent, comparisonTimeZone, referenceTime, name, disabled, className, locale: override, messages, }: TimezoneSelectProps) => import("react").JSX.Element;
57
+ export declare const TimezoneSelect: ({ value, onValueChange, label, continent, comparisonTimeZone, referenceTime, name, disabled, className, contentClassName, locale: override, messages, }: TimezoneSelectProps) => import("react").JSX.Element;
@@ -705,6 +705,7 @@ var TimezoneSelect = ({
705
705
  name,
706
706
  disabled,
707
707
  className,
708
+ contentClassName,
708
709
  locale: override,
709
710
  messages
710
711
  }) => {
@@ -759,6 +760,7 @@ var TimezoneSelect = ({
759
760
  return minutes > 0 ? copy.ahead(duration) : copy.behind(duration);
760
761
  };
761
762
  return /* @__PURE__ */ jsx5("div", {
763
+ "data-slot": "timezone-select",
762
764
  className,
763
765
  children: /* @__PURE__ */ jsxs2("div", {
764
766
  className: "grid min-w-0 grid-cols-1 gap-3",
@@ -772,7 +774,7 @@ var TimezoneSelect = ({
772
774
  ariaLabel: label ?? copy.label,
773
775
  ariaInvalid: invalid,
774
776
  triggerId: id,
775
- contentClassName: "[&_[role=option]]:h-auto!",
777
+ contentClassName: cn("[&_[role=option]]:h-auto!", contentClassName),
776
778
  disabled,
777
779
  locale,
778
780
  value: selected,
@@ -831,6 +833,7 @@ var TimezoneSelect = ({
831
833
  children: copy.invalidReference
832
834
  }),
833
835
  selected?.data && /* @__PURE__ */ jsxs2("dl", {
836
+ "data-slot": "timezone-details",
834
837
  className: "grid gap-1 rounded-lg border p-3 text-sm",
835
838
  children: [
836
839
  /* @__PURE__ */ jsx5("dt", {
@@ -852,6 +855,7 @@ var TimezoneSelect = ({
852
855
  ]
853
856
  }),
854
857
  comparisonTimeZone !== null && /* @__PURE__ */ jsx5("div", {
858
+ "data-slot": "timezone-comparison",
855
859
  className: "grid gap-2 text-sm",
856
860
  children: baseline ? /* @__PURE__ */ jsxs2("p", {
857
861
  className: "text-muted-foreground wrap-anywhere",
@@ -0,0 +1,18 @@
1
+ import { Toast as ToastPrimitive } from "@base-ui/react/toast";
2
+ import type { ComponentProps } from "react";
3
+ export declare const useToast: typeof ToastPrimitive.useToastManager;
4
+ export declare const createToastManager: typeof ToastPrimitive.createToastManager;
5
+ export type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
6
+ export type ToastMessages = {
7
+ notifications: string;
8
+ dismiss: string;
9
+ };
10
+ export type ToastClassNames = Partial<Record<"viewport" | "toast" | "content" | "icon" | "body" | "title" | "description" | "action" | "close", string>>;
11
+ export type ToastProviderProps = ComponentProps<typeof ToastPrimitive.Provider> & {
12
+ position?: ToastPosition;
13
+ locale?: string;
14
+ messages?: Partial<Record<string, Partial<ToastMessages>>>;
15
+ classNames?: ToastClassNames;
16
+ };
17
+ /** Mount once around a client application or a deliberately isolated subtree. */
18
+ export declare const ToastProvider: ({ children, position, locale, messages, classNames, ...props }: ToastProviderProps) => import("react").JSX.Element;
@@ -0,0 +1,121 @@
1
+ // ../../src/components/ui/toast.tsx
2
+ import { Toast as ToastPrimitive } from "@base-ui/react/toast";
3
+ import {
4
+ CircleCheck,
5
+ CircleAlert,
6
+ Info,
7
+ TriangleAlert,
8
+ LoaderCircle,
9
+ X
10
+ } from "lucide-react";
11
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
12
+
13
+ // ../../src/lib/utils.ts
14
+ import { cn } from "cn";
15
+
16
+ // ../../src/components/ui/toast.tsx
17
+ import { jsx, jsxs } from "react/jsx-runtime";
18
+ "use client";
19
+ var useToast = ToastPrimitive.useToastManager;
20
+ var createToastManager = ToastPrimitive.createToastManager;
21
+ var positions = {
22
+ "top-left": "top-4 left-4",
23
+ "top-center": "top-4 left-1/2 -translate-x-1/2",
24
+ "top-right": "top-4 right-4",
25
+ "bottom-left": "bottom-4 left-4",
26
+ "bottom-center": "bottom-4 left-1/2 -translate-x-1/2",
27
+ "bottom-right": "bottom-4 right-4"
28
+ };
29
+ var ToastViewport = ({
30
+ position,
31
+ locale,
32
+ messages,
33
+ classNames
34
+ }) => {
35
+ const language = useKrakstackLocale(locale);
36
+ const copy = {
37
+ ...language.startsWith("fr") ? { notifications: "Notifications", dismiss: "Fermer la notification" } : { notifications: "Notifications", dismiss: "Dismiss notification" },
38
+ ...messages?.[language.split("-")[0] ?? language],
39
+ ...messages?.[language]
40
+ };
41
+ const { toasts } = useToast();
42
+ return /* @__PURE__ */ jsx(ToastPrimitive.Portal, {
43
+ children: /* @__PURE__ */ jsx(ToastPrimitive.Viewport, {
44
+ "data-slot": "toast-viewport",
45
+ "data-position": position,
46
+ "aria-label": copy.notifications,
47
+ className: cn("pointer-events-none fixed z-[100] flex max-h-[calc(100dvh-2rem)] w-96 max-w-[calc(100vw-2rem)] [scrollbar-width:none] flex-col gap-3 overflow-y-auto overscroll-contain outline-none [&::-webkit-scrollbar]:hidden", positions[position], classNames?.viewport),
48
+ children: toasts.map((toast) => {
49
+ const Icon = toast.type === "success" ? CircleCheck : toast.type === "error" ? CircleAlert : toast.type === "warning" ? TriangleAlert : toast.type === "loading" ? LoaderCircle : Info;
50
+ return /* @__PURE__ */ jsx(ToastPrimitive.Root, {
51
+ "data-slot": "toast",
52
+ toast,
53
+ swipeDirection: position.endsWith("left") ? ["left"] : position.endsWith("right") ? ["right"] : [position.startsWith("top") ? "up" : "down"],
54
+ className: cn("bg-popover text-popover-foreground focus-visible:ring-ring pointer-events-auto relative shrink-0 touch-pan-y rounded-lg border p-4 shadow-lg transition-[opacity,transform] duration-150 outline-none focus-visible:ring-2 data-ending-style:translate-y-2 data-ending-style:opacity-0 data-limited:hidden data-starting-style:translate-y-2 data-starting-style:opacity-0 motion-reduce:transition-none", classNames?.toast),
55
+ children: /* @__PURE__ */ jsxs(ToastPrimitive.Content, {
56
+ "data-slot": "toast-content",
57
+ className: cn("flex min-w-0 items-start gap-3", classNames?.content),
58
+ children: [
59
+ /* @__PURE__ */ jsx(Icon, {
60
+ "data-slot": "toast-icon",
61
+ "aria-hidden": "true",
62
+ className: cn("mt-0.5 size-4 shrink-0", toast.type === "success" && "text-emerald-600 dark:text-emerald-400", toast.type === "error" && "text-destructive", toast.type === "warning" && "text-amber-600 dark:text-amber-400", toast.type === "loading" && "motion-safe:animate-spin", classNames?.icon)
63
+ }),
64
+ /* @__PURE__ */ jsxs("div", {
65
+ "data-slot": "toast-body",
66
+ className: cn("grid min-w-0 flex-1 gap-1 [overflow-wrap:anywhere]", classNames?.body),
67
+ children: [
68
+ /* @__PURE__ */ jsx(ToastPrimitive.Title, {
69
+ "data-slot": "toast-title",
70
+ className: cn("text-sm leading-5 font-medium", classNames?.title)
71
+ }),
72
+ /* @__PURE__ */ jsx(ToastPrimitive.Description, {
73
+ "data-slot": "toast-description",
74
+ className: cn("text-muted-foreground text-sm leading-5", classNames?.description)
75
+ }),
76
+ /* @__PURE__ */ jsx(ToastPrimitive.Action, {
77
+ "data-slot": "toast-action",
78
+ className: cn("text-foreground mt-2 w-fit rounded-sm text-sm font-medium underline underline-offset-4 outline-offset-4 disabled:opacity-50", classNames?.action)
79
+ })
80
+ ]
81
+ }),
82
+ /* @__PURE__ */ jsx(ToastPrimitive.Close, {
83
+ "data-slot": "toast-close",
84
+ "aria-label": copy.dismiss,
85
+ className: cn("text-muted-foreground hover:bg-muted hover:text-foreground -mt-1 -mr-1 inline-flex size-7 shrink-0 items-center justify-center rounded-md outline-offset-2", classNames?.close),
86
+ children: /* @__PURE__ */ jsx(X, {
87
+ "aria-hidden": "true",
88
+ className: "size-4"
89
+ })
90
+ })
91
+ ]
92
+ })
93
+ }, toast.id);
94
+ })
95
+ })
96
+ });
97
+ };
98
+ var ToastProvider = ({
99
+ children,
100
+ position = "bottom-right",
101
+ locale,
102
+ messages,
103
+ classNames,
104
+ ...props
105
+ }) => /* @__PURE__ */ jsxs(ToastPrimitive.Provider, {
106
+ ...props,
107
+ children: [
108
+ children,
109
+ /* @__PURE__ */ jsx(ToastViewport, {
110
+ position,
111
+ locale,
112
+ messages,
113
+ classNames
114
+ })
115
+ ]
116
+ });
117
+ export {
118
+ ToastProvider,
119
+ createToastManager,
120
+ useToast
121
+ };
@@ -10,6 +10,7 @@ export type UnsavedChangesGuardProps = {
10
10
  protectBeforeUnload?: boolean;
11
11
  locale?: string;
12
12
  messages?: Partial<Record<string, Partial<UnsavedChangesGuardMessages>>>;
13
+ className?: string;
13
14
  };
14
15
  /** Mount once per editing route, inside a TanStack Router provider. */
15
- export declare const UnsavedChangesGuard: ({ dirty, enabled, protectBeforeUnload, locale: override, messages, }: UnsavedChangesGuardProps) => import("react").JSX.Element;
16
+ export declare const UnsavedChangesGuard: ({ dirty, enabled, protectBeforeUnload, locale: override, messages, className, }: UnsavedChangesGuardProps) => import("react").JSX.Element;
@@ -181,7 +181,8 @@ var UnsavedChangesGuard = ({
181
181
  enabled = true,
182
182
  protectBeforeUnload = true,
183
183
  locale: override,
184
- messages
184
+ messages,
185
+ className
185
186
  }) => {
186
187
  const locale = useKrakstackLocale(override);
187
188
  const copy = {
@@ -201,6 +202,8 @@ var UnsavedChangesGuard = ({
201
202
  blocker.reset?.();
202
203
  },
203
204
  children: /* @__PURE__ */ jsxs2(AlertDialogContent, {
205
+ "data-component": "unsaved-changes-guard",
206
+ className,
204
207
  children: [
205
208
  /* @__PURE__ */ jsxs2(AlertDialogHeader, {
206
209
  children: [
@@ -203,6 +203,7 @@ var UploadAttachment = ({
203
203
  const progress = state.status === "uploading" && state.progress !== undefined && Number.isFinite(state.progress) ? Math.min(100, Math.max(0, state.progress)) : undefined;
204
204
  const status = state.status === "error" ? state.message : copy[state.status];
205
205
  return /* @__PURE__ */ jsxs(Attachment, {
206
+ "data-component": "upload-attachment",
206
207
  state: state.status === "cancelled" ? "idle" : state.status,
207
208
  className,
208
209
  "aria-labelledby": `${id}-name`,
@@ -229,11 +230,13 @@ var UploadAttachment = ({
229
230
  children: description
230
231
  }) : null,
231
232
  /* @__PURE__ */ jsx3("p", {
233
+ "data-slot": "upload-attachment-status",
232
234
  role: state.status === "error" ? "alert" : "status",
233
235
  className: "text-muted-foreground mt-1 text-xs",
234
236
  children: status
235
237
  }),
236
238
  state.status === "uploading" ? /* @__PURE__ */ jsx3("progress", {
239
+ "data-slot": "upload-attachment-progress",
237
240
  className: "accent-primary mt-2 h-1.5 w-full",
238
241
  "aria-label": `${copy.uploading}: ${name}`,
239
242
  max: 100,
package/dist/lib/docs.js CHANGED
@@ -1348,6 +1348,7 @@ function AppSidebar({ collapsible, footer, groups, header }) {
1348
1348
  });
1349
1349
  return /* @__PURE__ */ jsx13(SidebarMenuItem, {
1350
1350
  children: /* @__PURE__ */ jsxs10(SidebarMenuButton, {
1351
+ className: "h-auto min-h-8",
1351
1352
  onClick: closeMobileSidebar,
1352
1353
  render,
1353
1354
  tooltip: item.label(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krak-stack/registry",
3
- "version": "0.8.3",
3
+ "version": "0.9.0",
4
4
  "description": "Tree-shakable KrakStack components and Effect services.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,6 +17,18 @@
17
17
  "type": "module",
18
18
  "sideEffects": false,
19
19
  "exports": {
20
+ "./date-picker": {
21
+ "types": "./dist/components/ui/date-picker.d.ts",
22
+ "import": "./dist/components/ui/date-picker.js"
23
+ },
24
+ "./select-with-custom-input": {
25
+ "types": "./dist/components/ui/select-with-custom-input.d.ts",
26
+ "import": "./dist/components/ui/select-with-custom-input.js"
27
+ },
28
+ "./toast": {
29
+ "types": "./dist/components/ui/toast.d.ts",
30
+ "import": "./dist/components/ui/toast.js"
31
+ },
20
32
  "./cron-expression-editor": {
21
33
  "types": "./dist/components/ui/cron-expression-editor.d.ts",
22
34
  "import": "./dist/components/ui/cron-expression-editor.js"
@@ -69,9 +81,9 @@
69
81
  "types": "./dist/components/ui/app-switcher.d.ts",
70
82
  "import": "./dist/components/ui/app-switcher.js"
71
83
  },
72
- "./copy-value": {
73
- "types": "./dist/components/ui/copy-value.d.ts",
74
- "import": "./dist/components/ui/copy-value.js"
84
+ "./secret-value": {
85
+ "types": "./dist/components/ui/secret-value.d.ts",
86
+ "import": "./dist/components/ui/secret-value.js"
75
87
  },
76
88
  "./bulk-list-input": {
77
89
  "types": "./dist/components/ui/bulk-list-input.d.ts",
@@ -379,7 +391,9 @@
379
391
  "@oxlint/plugins": "1.78.0",
380
392
  "bowser": "^2.14.1",
381
393
  "cron-parser": "^5.10.4",
394
+ "date-fns": "^4.4.0",
382
395
  "react-colorful": "^5.8.1",
396
+ "react-day-picker": "^10.0.2",
383
397
  "web-vitals": "^5.1.0"
384
398
  },
385
399
  "peerDependencies": {
@@ -402,8 +416,8 @@
402
416
  "cn": "^0.3.0",
403
417
  "drizzle-orm": "^1.0.0-rc.4-5d5b77c",
404
418
  "effect": "^4.1.0",
405
- "libphonenumber-js": "^1.13.16",
406
419
  "lucide-react": "^1.18.0",
420
+ "libphonenumber-js": "^1.13.16",
407
421
  "motion": "^14.12.0",
408
422
  "react": "^19.2.0",
409
423
  "react-dom": "^19.2.0"