@sonamu-kit/react-components 0.4.10 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/~icons/lucide/arrow-left.js +13 -10
- package/dist/_virtual/~icons/lucide/arrow-left.js.map +1 -1
- package/dist/_virtual/~icons/lucide/arrow-right.js +13 -10
- package/dist/_virtual/~icons/lucide/arrow-right.js.map +1 -1
- package/dist/_virtual/~icons/lucide/calendar.js +17 -14
- package/dist/_virtual/~icons/lucide/calendar.js.map +1 -1
- package/dist/_virtual/~icons/lucide/check.js +13 -10
- package/dist/_virtual/~icons/lucide/check.js.map +1 -1
- package/dist/_virtual/~icons/lucide/chevron-down.js +13 -10
- package/dist/_virtual/~icons/lucide/chevron-down.js.map +1 -1
- package/dist/_virtual/~icons/lucide/chevron-left.js +13 -10
- package/dist/_virtual/~icons/lucide/chevron-left.js.map +1 -1
- package/dist/_virtual/~icons/lucide/chevron-right.js +13 -10
- package/dist/_virtual/~icons/lucide/chevron-right.js.map +1 -1
- package/dist/_virtual/~icons/lucide/chevrons-up-down.js +13 -10
- package/dist/_virtual/~icons/lucide/chevrons-up-down.js.map +1 -1
- package/dist/_virtual/~icons/lucide/circle.js +13 -10
- package/dist/_virtual/~icons/lucide/circle.js.map +1 -1
- package/dist/_virtual/~icons/lucide/dot.js +15 -12
- package/dist/_virtual/~icons/lucide/dot.js.map +1 -1
- package/dist/_virtual/~icons/lucide/grip-vertical.js +19 -16
- package/dist/_virtual/~icons/lucide/grip-vertical.js.map +1 -1
- package/dist/_virtual/~icons/lucide/image.js +16 -13
- package/dist/_virtual/~icons/lucide/image.js.map +1 -1
- package/dist/_virtual/~icons/lucide/loader-2.js +13 -10
- package/dist/_virtual/~icons/lucide/loader-2.js.map +1 -1
- package/dist/_virtual/~icons/lucide/loader2.js +13 -10
- package/dist/_virtual/~icons/lucide/loader2.js.map +1 -1
- package/dist/_virtual/~icons/lucide/more-horizontal.js +16 -13
- package/dist/_virtual/~icons/lucide/more-horizontal.js.map +1 -1
- package/dist/_virtual/~icons/lucide/panel-left.js +15 -12
- package/dist/_virtual/~icons/lucide/panel-left.js.map +1 -1
- package/dist/_virtual/~icons/lucide/plus.js +13 -10
- package/dist/_virtual/~icons/lucide/plus.js.map +1 -1
- package/dist/_virtual/~icons/lucide/search.js +14 -11
- package/dist/_virtual/~icons/lucide/search.js.map +1 -1
- package/dist/_virtual/~icons/lucide/trash-2.js +13 -10
- package/dist/_virtual/~icons/lucide/trash-2.js.map +1 -1
- package/dist/_virtual/~icons/lucide/upload.js +13 -10
- package/dist/_virtual/~icons/lucide/upload.js.map +1 -1
- package/dist/_virtual/~icons/lucide/x-circle.js +15 -12
- package/dist/_virtual/~icons/lucide/x-circle.js.map +1 -1
- package/dist/_virtual/~icons/lucide/x.js +13 -10
- package/dist/_virtual/~icons/lucide/x.js.map +1 -1
- package/dist/components/ui/accordion.js +1 -2
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +2 -2
- package/dist/components/ui/alert-dialog.js +1 -2
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.js +15 -15
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.js +1 -2
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/avatar.js +1 -2
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.js +11 -11
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +2 -2
- package/dist/components/ui/breadcrumb.js +1 -2
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button.js +33 -33
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts +1 -1
- package/dist/components/ui/calendar.js +41 -43
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.d.ts +7 -7
- package/dist/components/ui/card.js +1 -2
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.js +2 -3
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/checkbox.js +2 -3
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.js +1 -2
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/combobox.js +1 -2
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts +2 -2
- package/dist/components/ui/command.js +1 -2
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/common-modal.d.ts +1 -1
- package/dist/components/ui/common-modal.js +1 -2
- package/dist/components/ui/common-modal.js.map +1 -1
- package/dist/components/ui/context-menu.d.ts +1 -1
- package/dist/components/ui/context-menu.js +1 -2
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/date-input.d.ts +1 -1
- package/dist/components/ui/date-input.js +3 -3
- package/dist/components/ui/date-input.js.map +1 -1
- package/dist/components/ui/date-picker.d.ts +3 -3
- package/dist/components/ui/date-picker.js +3 -4
- package/dist/components/ui/date-picker.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +2 -2
- package/dist/components/ui/dialog.js +1 -2
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.d.ts +3 -3
- package/dist/components/ui/drawer.js +1 -2
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -2
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/file-input.d.ts +1 -1
- package/dist/components/ui/file-input.js +20 -12
- package/dist/components/ui/file-input.js.map +1 -1
- package/dist/components/ui/form.d.ts +6 -4
- package/dist/components/ui/form.js +1 -2
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/hover-card.js +1 -2
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-otp.d.ts +4 -2
- package/dist/components/ui/input-otp.js +1 -2
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.js +1 -2
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js +1 -2
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.d.ts +6 -6
- package/dist/components/ui/menubar.js +1 -2
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/month-picker-multiple.d.ts +1 -1
- package/dist/components/ui/month-picker-multiple.js +80 -79
- package/dist/components/ui/month-picker-multiple.js.map +1 -1
- package/dist/components/ui/navigation-menu.js +1 -2
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.js +3 -4
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/popover.js +1 -2
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.js +1 -2
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +1 -2
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/range-number-input.d.ts +1 -1
- package/dist/components/ui/range-number-input.js +1 -2
- package/dist/components/ui/range-number-input.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +4 -20
- package/dist/components/ui/resizable.js +5 -6
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.js +1 -2
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select/enum-select.d.ts +2 -1
- package/dist/components/ui/select/enum-select.js +1 -2
- package/dist/components/ui/select/enum-select.js.map +1 -1
- package/dist/components/ui/select/id-async-select.js +60 -60
- package/dist/components/ui/select/id-async-select.js.map +1 -1
- package/dist/components/ui/select/select.js +11 -9
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/separator.js +1 -2
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.d.ts +2 -2
- package/dist/components/ui/sheet.js +20 -21
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +23 -23
- package/dist/components/ui/sidebar.js +1 -2
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton.js +1 -2
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.js +1 -2
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonamu-filter/constants.js +1 -2
- package/dist/components/ui/sonamu-filter/constants.js.map +1 -1
- package/dist/components/ui/sonamu-filter/rule-row-input.d.ts +1 -1
- package/dist/components/ui/sonamu-filter/rule-row-input.js +1 -2
- package/dist/components/ui/sonamu-filter/rule-row-input.js.map +1 -1
- package/dist/components/ui/sonamu-filter/sonamu-filter-modal.d.ts +1 -1
- package/dist/components/ui/sonamu-filter/sonamu-filter-modal.js +2 -3
- package/dist/components/ui/sonamu-filter/sonamu-filter-modal.js.map +1 -1
- package/dist/components/ui/sonamu-filter/sonamu-filter-popover.d.ts +1 -1
- package/dist/components/ui/sonamu-filter/sonamu-filter-popover.js +1 -2
- package/dist/components/ui/sonamu-filter/sonamu-filter-popover.js.map +1 -1
- package/dist/components/ui/sonamu-filter/utils.js +2 -3
- package/dist/components/ui/sonamu-filter/utils.js.map +1 -1
- package/dist/components/ui/sonamu-filter/value-input.d.ts +1 -1
- package/dist/components/ui/sonamu-filter/value-input.js +1 -2
- package/dist/components/ui/sonamu-filter/value-input.js.map +1 -1
- package/dist/components/ui/sonner.d.ts +1 -1
- package/dist/components/ui/switch.js +1 -2
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts +8 -8
- package/dist/components/ui/table.js +1 -2
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +1 -2
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/tag-input.d.ts +1 -1
- package/dist/components/ui/tag-input.js +3 -12
- package/dist/components/ui/tag-input.js.map +1 -1
- package/dist/components/ui/textarea.js +1 -2
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toast.js +18 -19
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/components/ui/toaster.d.ts +1 -1
- package/dist/components/ui/toaster.js +1 -2
- package/dist/components/ui/toaster.js.map +1 -1
- package/dist/components/ui/toggle-group.js +1 -2
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.js +17 -17
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.js +1 -2
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/contexts/index.js +1 -2
- package/dist/contexts/sonamu-context.d.ts +1 -1
- package/dist/contexts/sonamu-context.js +1 -2
- package/dist/contexts/sonamu-context.js.map +1 -1
- package/dist/demo/App.d.ts +1 -1
- package/dist/demo/Layout.d.ts +1 -1
- package/dist/demo/components/FormDebugPanel.d.ts +1 -1
- package/dist/demo/routeTree.gen.d.ts +37 -37
- package/dist/demo/schemas/form-demo.schema.d.ts +8 -8
- package/dist/hooks/index.js +1 -2
- package/dist/hooks/use-toast.js +2 -3
- package/dist/hooks/use-toast.js.map +1 -1
- package/dist/i18n/rc-keys.js +1 -2
- package/dist/i18n/rc-keys.js.map +1 -1
- package/dist/lib/base-helpers.js +3 -3
- package/dist/lib/base-helpers.js.map +1 -1
- package/dist/lib/caster.d.ts +1 -1
- package/dist/lib/caster.js +1 -2
- package/dist/lib/caster.js.map +1 -1
- package/dist/lib/form-helpers.js +1 -2
- package/dist/lib/form-helpers.js.map +1 -1
- package/dist/lib/list-helpers.js +1 -2
- package/dist/lib/list-helpers.js.map +1 -1
- package/dist/lib/modal-helpers.js +1 -2
- package/dist/lib/modal-helpers.js.map +1 -1
- package/dist/lib/types.js +1 -2
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/use-mobile.js +7 -9
- package/dist/lib/use-mobile.js.map +1 -1
- package/dist/lib/utils.js +1 -2
- package/dist/lib/utils.js.map +1 -1
- package/dist/styles/globals.css +1 -7
- package/package.json +69 -67
|
@@ -3,23 +3,24 @@ import * as t from "react";
|
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
import { cva as r } from "class-variance-authority";
|
|
5
5
|
import * as i from "@radix-ui/react-toggle";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
size: {
|
|
13
|
-
default: "h-10 px-3 min-w-10",
|
|
14
|
-
sm: "h-9 px-2.5 min-w-9",
|
|
15
|
-
lg: "h-11 px-5 min-w-11"
|
|
16
|
-
}
|
|
6
|
+
// src/components/ui/toggle.tsx
|
|
7
|
+
var a = {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-transparent",
|
|
10
|
+
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
|
|
17
11
|
},
|
|
12
|
+
size: {
|
|
13
|
+
default: "h-10 px-3 min-w-10",
|
|
14
|
+
sm: "h-9 px-2.5 min-w-9",
|
|
15
|
+
lg: "h-11 px-5 min-w-11"
|
|
16
|
+
}
|
|
17
|
+
}, o = r("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2", {
|
|
18
|
+
variants: a,
|
|
18
19
|
defaultVariants: {
|
|
19
20
|
variant: "default",
|
|
20
21
|
size: "default"
|
|
21
22
|
}
|
|
22
|
-
}),
|
|
23
|
+
}), s = t.forwardRef(({ className: t, variant: r, size: a, value: s, pressed: c, onValueChange: l, onPressedChange: u, ...d }, f) => {
|
|
23
24
|
let p = s === void 0 ? c : s;
|
|
24
25
|
return /* @__PURE__ */ n(i.Root, {
|
|
25
26
|
ref: f,
|
|
@@ -27,16 +28,15 @@ var a = r("inline-flex items-center justify-center rounded-md text-sm font-mediu
|
|
|
27
28
|
onPressedChange: (e) => {
|
|
28
29
|
l?.(e), u?.(e);
|
|
29
30
|
},
|
|
30
|
-
className: e(
|
|
31
|
+
className: e(o({
|
|
31
32
|
variant: r,
|
|
32
|
-
size:
|
|
33
|
+
size: a,
|
|
33
34
|
className: t
|
|
34
35
|
})),
|
|
35
36
|
...d
|
|
36
37
|
});
|
|
37
38
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export { o as Toggle, a as toggleVariants };
|
|
39
|
+
s.displayName = i.Root.displayName;
|
|
40
|
+
export { s as Toggle, o as toggleVariants, a as toggleVariantsConfig };
|
|
41
41
|
|
|
42
42
|
//# sourceMappingURL=toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.js","names":[],"sources":["../../../src/components/ui/toggle.tsx"],"sourcesContent":["import * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\nconst toggleVariantsConfig = {\n variant: {\n default: \"bg-transparent\",\n outline: \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-10 px-3 min-w-10\",\n sm: \"h-9 px-2.5 min-w-9\",\n lg: \"h-11 px-5 min-w-11\",\n },\n} as const;\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2\",\n {\n variants: toggleVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ntype ToggleProps = Override<\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>,\n { value?: boolean; onValueChange?: (pressed: boolean) => void }\n>;\n\nconst Toggle = React.forwardRef<React.ComponentRef<typeof TogglePrimitive.Root>, ToggleProps>(\n ({ className, variant, size, value, pressed, onValueChange, onPressedChange, ...props }, ref) => {\n const effectivePressed = value !== undefined ? value : pressed;\n\n const handlePressedChange = (newPressed: boolean) => {\n onValueChange?.(newPressed);\n onPressedChange?.(newPressed);\n };\n\n return (\n <TogglePrimitive.Root\n ref={ref}\n pressed={effectivePressed}\n onPressedChange={handlePressedChange}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n );\n },\n);\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants, toggleVariantsConfig };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"toggle.js","names":["React","React$1","TogglePrimitive","toggleVariantsConfig","toggleVariants","cva","Toggle","props","effectivePressed","value","pressed","onValueChange","newPressed","onPressedChange","cn"],"sources":["../../../src/components/ui/toggle.tsx"],"sourcesContent":["import * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva } from \"class-variance-authority\";\nimport { type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { type Override } from \"../../lib/types\";\nimport { cn } from \"../../lib/utils\";\n\nconst toggleVariantsConfig = {\n variant: {\n default: \"bg-transparent\",\n outline: \"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground\",\n },\n size: {\n default: \"h-10 px-3 min-w-10\",\n sm: \"h-9 px-2.5 min-w-9\",\n lg: \"h-11 px-5 min-w-11\",\n },\n} as const;\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2\",\n {\n variants: toggleVariantsConfig,\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ntype ToggleProps = Override<\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>,\n { value?: boolean; onValueChange?: (pressed: boolean) => void }\n>;\n\nconst Toggle = React.forwardRef<React.ComponentRef<typeof TogglePrimitive.Root>, ToggleProps>(\n ({ className, variant, size, value, pressed, onValueChange, onPressedChange, ...props }, ref) => {\n const effectivePressed = value !== undefined ? value : pressed;\n\n const handlePressedChange = (newPressed: boolean) => {\n onValueChange?.(newPressed);\n onPressedChange?.(newPressed);\n };\n\n return (\n <TogglePrimitive.Root\n ref={ref}\n pressed={effectivePressed}\n onPressedChange={handlePressedChange}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n );\n },\n);\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants, toggleVariantsConfig };\n"],"mappings":";;;;;;AAQA,IAAMG,IAAuB;CAC3B,SAAS;EACP,SAAS;EACT,SAAS;CACX;CACA,MAAM;EACJ,SAAS;EACT,IAAI;EACJ,IAAI;CACN;AACF,GAEMC,IAAiBC,EACrB,sbACA;CACE,UAAUF;CACV,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF,GAOMG,IAASN,EAAM,YAClB,EAAE,cAAW,YAAS,SAAM,UAAO,YAAS,kBAAe,oBAAiB,GAAGO,KAAS,MAAQ;CAC/F,IAAMC,IAAmBC,MAAU,KAAA,IAAoBC,IAARD;CAO/C,OACE,kBAACP,EAAgB,MAAjB;EACO;EACL,SAASM;EACT,kBATyB,MAAwB;GAEnD,AADAG,IAAgBC,CAAU,GAC1BC,IAAkBD,CAAU;EAC9B;EAOI,WAAWE,EAAGV,EAAe;GAAE;GAAS;GAAM;EAAU,CAAC,CAAC;EAC1D,GAAIG;CACL,CAAA;AAEL,CACF;AAEA,EAAO,cAAcL,EAAgB,KAAK"}
|
|
@@ -2,7 +2,7 @@ import { cn as e } from "../../lib/utils.js";
|
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
import * as r from "@radix-ui/react-tooltip";
|
|
5
|
-
|
|
5
|
+
// src/components/ui/tooltip.tsx
|
|
6
6
|
var i = r.Provider, a = r.Root, o = r.Trigger, s = t.forwardRef(({ className: t, sideOffset: i = 4, ...a }, o) => /* @__PURE__ */ n(r.Content, {
|
|
7
7
|
ref: o,
|
|
8
8
|
sideOffset: i,
|
|
@@ -10,7 +10,6 @@ var i = r.Provider, a = r.Root, o = r.Trigger, s = t.forwardRef(({ className: t,
|
|
|
10
10
|
...a
|
|
11
11
|
}));
|
|
12
12
|
s.displayName = r.Content.displayName;
|
|
13
|
-
//#endregion
|
|
14
13
|
export { a as Tooltip, s as TooltipContent, i as TooltipProvider, o as TooltipTrigger };
|
|
15
14
|
|
|
16
15
|
//# sourceMappingURL=tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../../../src/components/ui/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-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 origin-[--radix-tooltip-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"mappings":";;;;;AAKA,
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":["React","React$1","TooltipPrimitive","TooltipProvider","Tooltip","TooltipTrigger","TooltipContent","props","cn","className"],"sources":["../../../src/components/ui/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-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 origin-[--radix-tooltip-content-transform-origin]\",\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"mappings":";;;;;AAKA,IAAMG,IAAkBD,EAAiB,UAEnCE,IAAUF,EAAiB,MAE3BG,IAAiBH,EAAiB,SAElCI,IAAiBN,EAAM,YAG1B,EAAE,cAAW,gBAAa,GAAG,GAAGO,KAAS,MAC1C,kBAACL,EAAiB,SAAlB;CACO;CACO;CACZ,WAAWM,EACT,wbACAC,CACF;CACA,GAAIF;AACL,CAAA,CACF;AACD,EAAe,cAAcL,EAAiB,QAAQ"}
|
package/dist/contexts/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as SonamuProvider, t as useSonamuBaseContext };
|
|
1
|
+
export { SonamuProvider, useSonamuBaseContext } from "./sonamu-context.js";
|
|
@@ -13,7 +13,7 @@ export interface SonamuProviderProps<D extends Dictionary = Dictionary, O extend
|
|
|
13
13
|
children: ReactNode;
|
|
14
14
|
authOptions?: O;
|
|
15
15
|
}
|
|
16
|
-
export declare function SonamuProvider<D extends Dictionary = Dictionary, O extends BetterAuthClientOptions = BetterAuthClientOptions>({ children, authOptions, ...value }: SonamuProviderProps<D, O>): import(
|
|
16
|
+
export declare function SonamuProvider<D extends Dictionary = Dictionary, O extends BetterAuthClientOptions = BetterAuthClientOptions>({ children, authOptions, ...value }: SonamuProviderProps<D, O>): import('react').JSX.Element;
|
|
17
17
|
/**
|
|
18
18
|
* 타입이 지정된 useSonamuContext를 만들기 위한 베이스 훅
|
|
19
19
|
*
|
|
@@ -2,7 +2,7 @@ import { rcKeysEn as e } from "../i18n/rc-keys.js";
|
|
|
2
2
|
import { createContext as t, useContext as n, useState as r } from "react";
|
|
3
3
|
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
import { createAuthClient as a } from "better-auth/react";
|
|
5
|
-
|
|
5
|
+
// src/contexts/sonamu-context.tsx
|
|
6
6
|
var o = (e) => `[SonamuProvider] ${e} is not configured. Please provide ${e} configuration to SonamuProvider.`, s = () => () => {
|
|
7
7
|
throw Error(o("uploader"));
|
|
8
8
|
};
|
|
@@ -46,7 +46,6 @@ function f({ children: e, authOptions: t, ...n }) {
|
|
|
46
46
|
function p() {
|
|
47
47
|
return n(l);
|
|
48
48
|
}
|
|
49
|
-
//#endregion
|
|
50
49
|
export { f as SonamuProvider, p as useSonamuBaseContext };
|
|
51
50
|
|
|
52
51
|
//# sourceMappingURL=sonamu-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonamu-context.js","names":[],"sources":["../../src/contexts/sonamu-context.tsx"],"sourcesContent":["import { type BetterAuthClientOptions } from \"better-auth/client\";\nimport { createAuthClient } from \"better-auth/react\";\nimport { createContext, useContext, useState } from \"react\";\nimport { type ReactNode } from \"react\";\n\nimport { rcKeysEn } from \"../i18n/rc-keys\";\nimport { type RCKeys } from \"../i18n/rc-keys\";\nimport { type Dictionary, type SDReturnType, type SonamuFile, type UploadParams } from \"./types\";\n\n/** createAuthClient의 반환 타입을 옵션으로부터 추론하는 유틸리티 타입 */\nexport type SonamuAuthClient<O extends BetterAuthClientOptions> = ReturnType<\n typeof createAuthClient<O>\n>;\n\nexport interface SonamuContextValue<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n> {\n uploader?: (files: File[], params?: UploadParams) => Promise<SonamuFile[]>;\n auth?: SonamuAuthClient<O>;\n SD?: <K extends keyof D>(key: K) => SDReturnType<D, K>;\n}\n\nexport interface SonamuProviderProps<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n> extends SonamuContextValue<D, O> {\n children: ReactNode;\n authOptions?: O;\n}\n\nconst SONAMU_CONTEXT_ERROR_MESSAGE = (key: string) =>\n `[SonamuProvider] ${key} is not configured. Please provide ${key} configuration to SonamuProvider.`;\n\nconst createUploaderFallback = () => {\n return () => {\n throw new Error(SONAMU_CONTEXT_ERROR_MESSAGE(\"uploader\"));\n };\n};\n\nfunction createSDFallback<D extends Dictionary = RCKeys>(): <K extends keyof D>(\n key: K,\n) => SDReturnType<D, K>;\nfunction createSDFallback() {\n const translations = new Map(Object.entries(rcKeysEn));\n return (key: string) => translations.get(key) ?? key;\n}\n\ntype SonamuContextRuntimeValue = {\n uploader?: SonamuContextValue[\"uploader\"];\n auth?: object;\n SD?: (key: never) => string | ((...args: never[]) => string);\n};\n\nconst SonamuContext = createContext<SonamuContextValue>({\n uploader: createUploaderFallback(),\n SD: createSDFallback<Dictionary>(),\n});\n\nfunction SonamuContextProvider<D extends Dictionary, O extends BetterAuthClientOptions>({\n children,\n auth,\n ...value\n}: SonamuContextValue<D, O> & { children: ReactNode }) {\n const normalizedValue: SonamuContextValue<D, O> = {\n uploader: value.uploader ?? createUploaderFallback(),\n auth,\n SD: value.SD ?? createSDFallback<D>(),\n };\n\n return <SonamuContext.Provider value={normalizedValue}>{children}</SonamuContext.Provider>;\n}\n\nfunction SonamuAuthProvider<D extends Dictionary, O extends BetterAuthClientOptions>({\n children,\n authOptions,\n ...value\n}: SonamuProviderProps<D, O> & { authOptions: O }) {\n const [auth] = useState(() => createAuthClient(authOptions));\n\n return (\n <SonamuContextProvider {...value} auth={value.auth ?? auth}>\n {children}\n </SonamuContextProvider>\n );\n}\n\nexport function SonamuProvider<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n>({ children, authOptions, ...value }: SonamuProviderProps<D, O>) {\n return authOptions === undefined ? (\n <SonamuContextProvider {...value}>{children}</SonamuContextProvider>\n ) : (\n <SonamuAuthProvider {...value} authOptions={authOptions}>\n {children}\n </SonamuAuthProvider>\n );\n}\n\n/**\n * 타입이 지정된 useSonamuContext를 만들기 위한 베이스 훅\n *\n * @example\n * // contexts/sonamu-provider.tsx\n * export function useSonamuContext() {\n * return useSonamuBaseContext<MergedDictionary>();\n * }\n */\nexport function useSonamuBaseContext<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n>(): Required<SonamuContextValue<D, O>>;\nexport function useSonamuBaseContext(): SonamuContextRuntimeValue {\n return useContext(SonamuContext);\n}\n"],"mappings":";;;;;AA+BA,
|
|
1
|
+
{"version":3,"file":"sonamu-context.js","names":["SONAMU_CONTEXT_ERROR_MESSAGE","key","createUploaderFallback","createSDFallback","translations","rcKeysEn","SonamuContext","createContext","SonamuContextProvider","value","normalizedValue","SonamuAuthProvider","auth","useState","createAuthClient","authOptions","SonamuProvider","useSonamuBaseContext","useContext"],"sources":["../../src/contexts/sonamu-context.tsx"],"sourcesContent":["import { type BetterAuthClientOptions } from \"better-auth/client\";\nimport { createAuthClient } from \"better-auth/react\";\nimport { createContext, useContext, useState } from \"react\";\nimport { type ReactNode } from \"react\";\n\nimport { rcKeysEn } from \"../i18n/rc-keys\";\nimport { type RCKeys } from \"../i18n/rc-keys\";\nimport { type Dictionary, type SDReturnType, type SonamuFile, type UploadParams } from \"./types\";\n\n/** createAuthClient의 반환 타입을 옵션으로부터 추론하는 유틸리티 타입 */\nexport type SonamuAuthClient<O extends BetterAuthClientOptions> = ReturnType<\n typeof createAuthClient<O>\n>;\n\nexport interface SonamuContextValue<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n> {\n uploader?: (files: File[], params?: UploadParams) => Promise<SonamuFile[]>;\n auth?: SonamuAuthClient<O>;\n SD?: <K extends keyof D>(key: K) => SDReturnType<D, K>;\n}\n\nexport interface SonamuProviderProps<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n> extends SonamuContextValue<D, O> {\n children: ReactNode;\n authOptions?: O;\n}\n\nconst SONAMU_CONTEXT_ERROR_MESSAGE = (key: string) =>\n `[SonamuProvider] ${key} is not configured. Please provide ${key} configuration to SonamuProvider.`;\n\nconst createUploaderFallback = () => {\n return () => {\n throw new Error(SONAMU_CONTEXT_ERROR_MESSAGE(\"uploader\"));\n };\n};\n\nfunction createSDFallback<D extends Dictionary = RCKeys>(): <K extends keyof D>(\n key: K,\n) => SDReturnType<D, K>;\nfunction createSDFallback() {\n const translations = new Map(Object.entries(rcKeysEn));\n return (key: string) => translations.get(key) ?? key;\n}\n\ntype SonamuContextRuntimeValue = {\n uploader?: SonamuContextValue[\"uploader\"];\n auth?: object;\n SD?: (key: never) => string | ((...args: never[]) => string);\n};\n\nconst SonamuContext = createContext<SonamuContextValue>({\n uploader: createUploaderFallback(),\n SD: createSDFallback<Dictionary>(),\n});\n\nfunction SonamuContextProvider<D extends Dictionary, O extends BetterAuthClientOptions>({\n children,\n auth,\n ...value\n}: SonamuContextValue<D, O> & { children: ReactNode }) {\n const normalizedValue: SonamuContextValue<D, O> = {\n uploader: value.uploader ?? createUploaderFallback(),\n auth,\n SD: value.SD ?? createSDFallback<D>(),\n };\n\n return <SonamuContext.Provider value={normalizedValue}>{children}</SonamuContext.Provider>;\n}\n\nfunction SonamuAuthProvider<D extends Dictionary, O extends BetterAuthClientOptions>({\n children,\n authOptions,\n ...value\n}: SonamuProviderProps<D, O> & { authOptions: O }) {\n const [auth] = useState(() => createAuthClient(authOptions));\n\n return (\n <SonamuContextProvider {...value} auth={value.auth ?? auth}>\n {children}\n </SonamuContextProvider>\n );\n}\n\nexport function SonamuProvider<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n>({ children, authOptions, ...value }: SonamuProviderProps<D, O>) {\n return authOptions === undefined ? (\n <SonamuContextProvider {...value}>{children}</SonamuContextProvider>\n ) : (\n <SonamuAuthProvider {...value} authOptions={authOptions}>\n {children}\n </SonamuAuthProvider>\n );\n}\n\n/**\n * 타입이 지정된 useSonamuContext를 만들기 위한 베이스 훅\n *\n * @example\n * // contexts/sonamu-provider.tsx\n * export function useSonamuContext() {\n * return useSonamuBaseContext<MergedDictionary>();\n * }\n */\nexport function useSonamuBaseContext<\n D extends Dictionary = Dictionary,\n O extends BetterAuthClientOptions = BetterAuthClientOptions,\n>(): Required<SonamuContextValue<D, O>>;\nexport function useSonamuBaseContext(): SonamuContextRuntimeValue {\n return useContext(SonamuContext);\n}\n"],"mappings":";;;;;AA+BA,IAAMA,KAAgC,MACpC,oBAAoBC,EAAI,qCAAqCA,EAAI,oCAE7DC,gBACS;CACX,MAAU,MAAMF,EAA6B,UAAU,CAAC;AAC1D;AAMF,SAASG,IAAmB;CAC1B,IAAMC,IAAe,IAAI,IAAI,OAAO,QAAQC,CAAQ,CAAC;CACrD,QAAQ,MAAgBD,EAAa,IAAIH,CAAG,KAAKA;AACnD;AAQA,IAAMK,IAAgBC,EAAkC;CACtD,UAAUL,EAAuB;CACjC,IAAIC,EAA6B;AACnC,CAAC;AAED,SAASK,EAA+E,EACtF,aACA,SACA,GAAGC,KACkD;CACrD,IAAMC,IAA4C;EAChD,UAAUD,EAAM,YAAYP,EAAuB;EACnD;EACA,IAAIO,EAAM,MAAMN,EAAoB;CACtC;CAEA,OAAO,kBAACG,EAAc,UAAf;EAAwB,OAAOI;EAAkB;CAAiC,CAAA;AAC3F;AAEA,SAASC,EAA4E,EACnF,aACA,gBACA,GAAGF,KAC8C;CACjD,IAAM,CAACG,KAAQC,QAAeC,EAAiBC,CAAW,CAAC;CAE3D,OACE,kBAACP,GAAD;EAAuB,GAAIC;EAAO,MAAMA,EAAM,QAAQG;EACnD;CACoB,CAAA;AAE3B;AAEA,SAAgBI,EAGd,EAAE,aAAU,gBAAa,GAAGP,KAAoC;CAChE,OAAOM,MAAgB,KAAA,IACrB,kBAACP,GAAD;EAAuB,GAAIC;EAAQ;CAAgC,CAAA,IAEnE,kBAACE,GAAD;EAAoB,GAAIF;EAAoB;EACzC;CACiB,CAAA;AAExB;AAeA,SAAgBQ,IAAkD;CAChE,OAAOC,EAAWZ,CAAa;AACjC"}
|
package/dist/demo/App.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function App(): import(
|
|
1
|
+
declare function App(): import('react').JSX.Element;
|
|
2
2
|
export default App;
|
package/dist/demo/Layout.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare function Layout(): import(
|
|
1
|
+
declare function Layout(): import('react').JSX.Element;
|
|
2
2
|
export default Layout;
|
|
@@ -7,5 +7,5 @@ interface FormDebugPanelProps {
|
|
|
7
7
|
title?: string;
|
|
8
8
|
sections?: Section[];
|
|
9
9
|
}
|
|
10
|
-
export declare function FormDebugPanel({ formData, title, sections }: FormDebugPanelProps): import(
|
|
10
|
+
export declare function FormDebugPanel({ formData, title, sections }: FormDebugPanelProps): import('react').JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Route as rootRouteImport } from './routes/__root';
|
|
2
|
-
import { Route as NavigationRouteImport } from './routes/navigation';
|
|
3
|
-
import { Route as LayoutRouteImport } from './routes/layout';
|
|
4
|
-
import { Route as FormRouteImport } from './routes/form';
|
|
5
|
-
import { Route as DialogsAlertsRouteImport } from './routes/dialogs-alerts';
|
|
6
|
-
import { Route as DataDisplayRouteImport } from './routes/data-display';
|
|
7
2
|
import { Route as IndexRouteImport } from './routes/index';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
import { Route as DataDisplayRouteImport } from './routes/data-display';
|
|
4
|
+
import { Route as DialogsAlertsRouteImport } from './routes/dialogs-alerts';
|
|
5
|
+
import { Route as FormRouteImport } from './routes/form';
|
|
6
|
+
import { Route as LayoutRouteImport } from './routes/layout';
|
|
7
|
+
import { Route as NavigationRouteImport } from './routes/navigation';
|
|
13
8
|
declare const IndexRoute: import('@tanstack/router-core').Route<import('@tanstack/router-core').Register, import('@tanstack/react-router').RootRoute<import('@tanstack/router-core').Register, undefined, {}, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/", "/", "/", "/", undefined, import('@tanstack/router-core').ResolveParams<"/">, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
|
|
9
|
+
declare const DataDisplayRoute: import('@tanstack/router-core').Route<import('@tanstack/router-core').Register, import('@tanstack/react-router').RootRoute<import('@tanstack/router-core').Register, undefined, {}, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/data-display", "/data-display", "/data-display", "/data-display", undefined, import('@tanstack/router-core').ResolveParams<"/data-display">, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
|
|
10
|
+
declare const DialogsAlertsRoute: import('@tanstack/router-core').Route<import('@tanstack/router-core').Register, import('@tanstack/react-router').RootRoute<import('@tanstack/router-core').Register, undefined, {}, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/dialogs-alerts", "/dialogs-alerts", "/dialogs-alerts", "/dialogs-alerts", undefined, import('@tanstack/router-core').ResolveParams<"/dialogs-alerts">, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
|
|
11
|
+
declare const FormRoute: import('@tanstack/router-core').Route<import('@tanstack/router-core').Register, import('@tanstack/react-router').RootRoute<import('@tanstack/router-core').Register, undefined, {}, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/form", "/form", "/form", "/form", undefined, import('@tanstack/router-core').ResolveParams<"/form">, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
|
|
12
|
+
declare const LayoutRoute: import('@tanstack/router-core').Route<import('@tanstack/router-core').Register, import('@tanstack/react-router').RootRoute<import('@tanstack/router-core').Register, undefined, {}, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/layout", "/layout", "/layout", "/layout", undefined, import('@tanstack/router-core').ResolveParams<"/layout">, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
|
|
13
|
+
declare const NavigationRoute: import('@tanstack/router-core').Route<import('@tanstack/router-core').Register, import('@tanstack/react-router').RootRoute<import('@tanstack/router-core').Register, undefined, {}, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/navigation", "/navigation", "/navigation", "/navigation", undefined, import('@tanstack/router-core').ResolveParams<"/navigation">, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, import('@tanstack/router-core').AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>;
|
|
14
14
|
export interface FileRoutesByFullPath {
|
|
15
15
|
'/': typeof IndexRoute;
|
|
16
16
|
'/data-display': typeof DataDisplayRoute;
|
|
@@ -54,25 +54,18 @@ export interface RootRouteChildren {
|
|
|
54
54
|
}
|
|
55
55
|
declare module '@tanstack/react-router' {
|
|
56
56
|
interface FileRoutesByPath {
|
|
57
|
-
'/
|
|
58
|
-
id: '/
|
|
59
|
-
path: '/
|
|
60
|
-
fullPath: '/
|
|
61
|
-
preLoaderRoute: typeof
|
|
62
|
-
parentRoute: typeof rootRouteImport;
|
|
63
|
-
};
|
|
64
|
-
'/layout': {
|
|
65
|
-
id: '/layout';
|
|
66
|
-
path: '/layout';
|
|
67
|
-
fullPath: '/layout';
|
|
68
|
-
preLoaderRoute: typeof LayoutRouteImport;
|
|
57
|
+
'/': {
|
|
58
|
+
id: '/';
|
|
59
|
+
path: '/';
|
|
60
|
+
fullPath: '/';
|
|
61
|
+
preLoaderRoute: typeof IndexRouteImport;
|
|
69
62
|
parentRoute: typeof rootRouteImport;
|
|
70
63
|
};
|
|
71
|
-
'/
|
|
72
|
-
id: '/
|
|
73
|
-
path: '/
|
|
74
|
-
fullPath: '/
|
|
75
|
-
preLoaderRoute: typeof
|
|
64
|
+
'/data-display': {
|
|
65
|
+
id: '/data-display';
|
|
66
|
+
path: '/data-display';
|
|
67
|
+
fullPath: '/data-display';
|
|
68
|
+
preLoaderRoute: typeof DataDisplayRouteImport;
|
|
76
69
|
parentRoute: typeof rootRouteImport;
|
|
77
70
|
};
|
|
78
71
|
'/dialogs-alerts': {
|
|
@@ -82,18 +75,25 @@ declare module '@tanstack/react-router' {
|
|
|
82
75
|
preLoaderRoute: typeof DialogsAlertsRouteImport;
|
|
83
76
|
parentRoute: typeof rootRouteImport;
|
|
84
77
|
};
|
|
85
|
-
'/
|
|
86
|
-
id: '/
|
|
87
|
-
path: '/
|
|
88
|
-
fullPath: '/
|
|
89
|
-
preLoaderRoute: typeof
|
|
78
|
+
'/form': {
|
|
79
|
+
id: '/form';
|
|
80
|
+
path: '/form';
|
|
81
|
+
fullPath: '/form';
|
|
82
|
+
preLoaderRoute: typeof FormRouteImport;
|
|
90
83
|
parentRoute: typeof rootRouteImport;
|
|
91
84
|
};
|
|
92
|
-
'/': {
|
|
93
|
-
id: '/';
|
|
94
|
-
path: '/';
|
|
95
|
-
fullPath: '/';
|
|
96
|
-
preLoaderRoute: typeof
|
|
85
|
+
'/layout': {
|
|
86
|
+
id: '/layout';
|
|
87
|
+
path: '/layout';
|
|
88
|
+
fullPath: '/layout';
|
|
89
|
+
preLoaderRoute: typeof LayoutRouteImport;
|
|
90
|
+
parentRoute: typeof rootRouteImport;
|
|
91
|
+
};
|
|
92
|
+
'/navigation': {
|
|
93
|
+
id: '/navigation';
|
|
94
|
+
path: '/navigation';
|
|
95
|
+
fullPath: '/navigation';
|
|
96
|
+
preLoaderRoute: typeof NavigationRouteImport;
|
|
97
97
|
parentRoute: typeof rootRouteImport;
|
|
98
98
|
};
|
|
99
99
|
}
|
|
@@ -18,14 +18,14 @@ export declare const FormDemoSchema: z.ZodObject<{
|
|
|
18
18
|
textarea: z.ZodString;
|
|
19
19
|
slider: z.ZodNumber;
|
|
20
20
|
combobox: z.ZodOptional<z.ZodString>;
|
|
21
|
-
singleEagerImage: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.
|
|
22
|
-
singleLazyImage: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.
|
|
23
|
-
singleEagerFile: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.
|
|
24
|
-
singleLazyFile: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.
|
|
25
|
-
multipleEagerImage: z.ZodArray<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.
|
|
26
|
-
multipleLazyImage: z.ZodArray<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.
|
|
27
|
-
multipleEagerFile: z.ZodArray<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.
|
|
28
|
-
multipleLazyFile: z.ZodArray<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.
|
|
21
|
+
singleEagerImage: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.ZodInstanceOf<File>, z.ZodNull]>>;
|
|
22
|
+
singleLazyImage: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.ZodInstanceOf<File>, z.ZodNull]>>;
|
|
23
|
+
singleEagerFile: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.ZodInstanceOf<File>, z.ZodNull]>>;
|
|
24
|
+
singleLazyFile: z.ZodOptional<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.ZodInstanceOf<File>, z.ZodNull]>>;
|
|
25
|
+
multipleEagerImage: z.ZodArray<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.ZodInstanceOf<File>]>>;
|
|
26
|
+
multipleLazyImage: z.ZodArray<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.ZodInstanceOf<File>]>>;
|
|
27
|
+
multipleEagerFile: z.ZodArray<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.ZodInstanceOf<File>]>>;
|
|
28
|
+
multipleLazyFile: z.ZodArray<z.ZodUnion<readonly [z.ZodCustom<SonamuFile, SonamuFile>, z.ZodInstanceOf<File>]>>;
|
|
29
29
|
otp: z.ZodString;
|
|
30
30
|
toggleBold: z.ZodBoolean;
|
|
31
31
|
toggleGroup: z.ZodString;
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as toast, t as useToast };
|
|
1
|
+
export { toast, useToast } from "./use-toast.js";
|
package/dist/hooks/use-toast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as e from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/use-toast.ts
|
|
4
4
|
var t = 1, n = 1e6, r = 0;
|
|
5
5
|
function i() {
|
|
6
6
|
return r = (r + 1) % (2 ** 53 - 1), r.toString();
|
|
@@ -106,7 +106,6 @@ function f() {
|
|
|
106
106
|
})
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
export { d as toast, f as useToast };
|
|
109
|
+
export { s as reducer, d as toast, f as useToast };
|
|
111
110
|
|
|
112
111
|
//# sourceMappingURL=use-toast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.js","names":[],"sources":["../../src/hooks/use-toast.ts"],"sourcesContent":["\"use client\";\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\";\n\nimport { type ToastActionElement, type ToastProps } from \"../components/ui/toast\";\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"];\n toast: ToasterToast;\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\": {\n const next = [action.toast, ...state.toasts].slice(0, TOAST_LIMIT);\n const nextIds = new Set(next.map((t) => t.id));\n for (const prev of state.toasts) {\n if (!nextIds.has(prev.id)) {\n const timeout = toastTimeouts.get(prev.id);\n if (timeout) {\n clearTimeout(timeout);\n toastTimeouts.delete(prev.id);\n }\n }\n }\n return {\n ...state,\n toasts: next,\n };\n }\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),\n };\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((currentToast) => {\n addToRemoveQueue(currentToast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t,\n ),\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n for (const [id, timeout] of toastTimeouts) {\n clearTimeout(timeout);\n toastTimeouts.delete(id);\n }\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, \"id\">;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (nextProps: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...nextProps, id },\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, []);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n };\n}\n\nexport { useToast, toast };\n"],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"use-toast.js","names":["React","React$1","TOAST_LIMIT","TOAST_REMOVE_DELAY","count","genId","toastTimeouts","addToRemoveQueue","toastId","timeout","dispatch","reducer","action","next","state","nextIds","t","prev","currentToast","id","listeners","memoryState","toast","props","update","nextProps","dismiss","open","useToast","setState","index"],"sources":["../../src/hooks/use-toast.ts"],"sourcesContent":["\"use client\";\n\n// Inspired by react-hot-toast library\nimport * as React from \"react\";\n\nimport { type ToastActionElement, type ToastProps } from \"../components/ui/toast\";\n\nconst TOAST_LIMIT = 1;\nconst TOAST_REMOVE_DELAY = 1000000;\n\ntype ToasterToast = ToastProps & {\n id: string;\n title?: React.ReactNode;\n description?: React.ReactNode;\n action?: ToastActionElement;\n};\n\nconst actionTypes = {\n ADD_TOAST: \"ADD_TOAST\",\n UPDATE_TOAST: \"UPDATE_TOAST\",\n DISMISS_TOAST: \"DISMISS_TOAST\",\n REMOVE_TOAST: \"REMOVE_TOAST\",\n} as const;\n\nlet count = 0;\n\nfunction genId() {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n}\n\ntype ActionType = typeof actionTypes;\n\ntype Action =\n | {\n type: ActionType[\"ADD_TOAST\"];\n toast: ToasterToast;\n }\n | {\n type: ActionType[\"UPDATE_TOAST\"];\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionType[\"DISMISS_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n }\n | {\n type: ActionType[\"REMOVE_TOAST\"];\n toastId?: ToasterToast[\"id\"];\n };\n\ninterface State {\n toasts: ToasterToast[];\n}\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: \"REMOVE_TOAST\",\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case \"ADD_TOAST\": {\n const next = [action.toast, ...state.toasts].slice(0, TOAST_LIMIT);\n const nextIds = new Set(next.map((t) => t.id));\n for (const prev of state.toasts) {\n if (!nextIds.has(prev.id)) {\n const timeout = toastTimeouts.get(prev.id);\n if (timeout) {\n clearTimeout(timeout);\n toastTimeouts.delete(prev.id);\n }\n }\n }\n return {\n ...state,\n toasts: next,\n };\n }\n\n case \"UPDATE_TOAST\":\n return {\n ...state,\n toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),\n };\n\n case \"DISMISS_TOAST\": {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((currentToast) => {\n addToRemoveQueue(currentToast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t,\n ),\n };\n }\n case \"REMOVE_TOAST\":\n if (action.toastId === undefined) {\n for (const [id, timeout] of toastTimeouts) {\n clearTimeout(timeout);\n toastTimeouts.delete(id);\n }\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: Array<(state: State) => void> = [];\n\nlet memoryState: State = { toasts: [] };\n\nfunction dispatch(action: Action) {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n}\n\ntype Toast = Omit<ToasterToast, \"id\">;\n\nfunction toast({ ...props }: Toast) {\n const id = genId();\n\n const update = (nextProps: ToasterToast) =>\n dispatch({\n type: \"UPDATE_TOAST\",\n toast: { ...nextProps, id },\n });\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id });\n\n dispatch({\n type: \"ADD_TOAST\",\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n}\n\nfunction useToast() {\n const [state, setState] = React.useState(memoryState);\n\n React.useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, []);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\n };\n}\n\nexport { useToast, toast };\n"],"mappings":";;;AAOA,IAAME,IAAc,GACdC,IAAqB,KAgBvBC,IAAQ;AAEZ,SAASC,IAAQ;CAEf,OADA,KAASD,IAAQ,oBACVA,EAAM,SAAS;AACxB;AA0BA,IAAME,oBAAgB,IAAI,IAA2C,GAE/DC,KAAoB,MAAoB;CAC5C,IAAID,EAAc,IAAIE,CAAO,GAC3B;CAGF,IAAMC,IAAU,iBAAiB;EAE/B,AADAH,EAAc,OAAOE,CAAO,GAC5BE,EAAS;GACP,MAAM;GACG;EACX,CAAC;CACH,GAAGP,CAAkB;CAErB,EAAc,IAAIK,GAASC,CAAO;AACpC,GAEaE,KAAW,GAAc,MAA0B;CAC9D,QAAQC,EAAO,MAAf;EACE,KAAK,aAAa;GAChB,IAAMC,IAAO,CAACD,EAAO,OAAO,GAAGE,EAAM,MAAM,CAAC,CAAC,MAAM,GAAGZ,CAAW,GAC3Da,IAAU,IAAI,IAAIF,EAAK,KAAK,MAAMG,EAAE,EAAE,CAAC;GAC7C,KAAK,IAAMC,KAAQH,EAAM,QACvB,IAAI,CAACC,EAAQ,IAAIE,EAAK,EAAE,GAAG;IACzB,IAAMR,IAAUH,EAAc,IAAIW,EAAK,EAAE;IACzC,AAAIR,MACF,aAAaA,CAAO,GACpBH,EAAc,OAAOW,EAAK,EAAE;GAEhC;GAEF,OAAO;IACL,GAAGH;IACH,QAAQD;GACV;EACF;EAEA,KAAK,gBACH,OAAO;GACL,GAAGC;GACH,QAAQA,EAAM,OAAO,KAAK,MAAOE,EAAE,OAAOJ,EAAO,MAAM,KAAK;IAAE,GAAGI;IAAG,GAAGJ,EAAO;GAAM,IAAII,CAAE;EAC5F;EAEF,KAAK,iBAAiB;GACpB,IAAM,EAAE,eAAYJ;GAYpB,OARIJ,IACFD,EAAiBC,CAAO,IAExBM,EAAM,OAAO,SAAS,MAAiB;IACrC,EAAiBI,EAAa,EAAE;GAClC,CAAC,GAGI;IACL,GAAGJ;IACH,QAAQA,EAAM,OAAO,KAAK,MACxBE,EAAE,OAAOR,KAAWA,MAAY,KAAA,IAC5B;KACE,GAAGQ;KACH,MAAM;IACR,IACAA,CACN;GACF;EACF;EACA,KAAK;GACH,IAAIJ,EAAO,YAAY,KAAA,GAAW;IAChC,KAAK,IAAM,CAACO,GAAIV,MAAYH,GAE1B,AADA,aAAaG,CAAO,GACpBH,EAAc,OAAOa,CAAE;IAEzB,OAAO;KACL,GAAGL;KACH,QAAQ,CAAC;IACX;GACF;GACA,OAAO;IACL,GAAGA;IACH,QAAQA,EAAM,OAAO,QAAQ,MAAME,EAAE,OAAOJ,EAAO,OAAO;GAC5D;CACJ;AACF,GAEMQ,IAA2C,CAAC,GAE9CC,IAAqB,EAAE,QAAQ,CAAC,EAAE;AAEtC,SAASX,EAAS,GAAgB;CAEhC,AADA,IAAcC,EAAQU,GAAaT,CAAM,GACzCQ,EAAU,SAAS,MAAa;EAC9B,EAASC,CAAW;CACtB,CAAC;AACH;AAIA,SAASC,EAAM,EAAE,GAAGC,KAAgB;CAClC,IAAMJ,IAAKd,EAAM,GAEXmB,KAAU,MACdd,EAAS;EACP,MAAM;EACN,OAAO;GAAE,GAAGe;GAAW;EAAG;CAC5B,CAAC,GACGC,UAAgBhB,EAAS;EAAE,MAAM;EAAiB,SAASS;CAAG,CAAC;CAcrE,OAZAT,EAAS;EACP,MAAM;EACN,OAAO;GACL,GAAGa;GACH;GACA,MAAM;GACN,eAAe,MAAS;IACtB,AAAKI,KAAMD,EAAQ;GACrB;EACF;CACF,CAAC,GAEM;EACD;EACJ;EACA;CACF;AACF;AAEA,SAASE,IAAW;CAClB,IAAM,CAACd,GAAOe,KAAY7B,EAAM,SAASqB,CAAW;CAYpD,OAVApB,EAAM,iBACJmB,EAAU,KAAKS,CAAQ,SACV;EACX,IAAMC,IAAQV,EAAU,QAAQS,CAAQ;EACxC,AAAIC,IAAQ,MACVV,EAAU,OAAOU,GAAO,CAAC;CAE7B,IACC,CAAC,CAAC,GAEE;EACL,GAAGhB;EACH;EACA,UAAU,MAAqBJ,EAAS;GAAE,MAAM;GAAiB;EAAQ,CAAC;CAC5E;AACF"}
|
package/dist/i18n/rc-keys.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/i18n/rc-keys.ts
|
|
2
2
|
var e = {
|
|
3
3
|
"rc.asyncSelect.loading": "Loading...",
|
|
4
4
|
"rc.asyncSelect.noOptions": "No options",
|
|
@@ -69,7 +69,6 @@ var e = {
|
|
|
69
69
|
"rc.common.cancel": "Cancel",
|
|
70
70
|
"rc.common.save": "Save"
|
|
71
71
|
};
|
|
72
|
-
//#endregion
|
|
73
72
|
export { e as rcKeysEn };
|
|
74
73
|
|
|
75
74
|
//# sourceMappingURL=rc-keys.js.map
|
package/dist/i18n/rc-keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rc-keys.js","names":[],"sources":["../../src/i18n/rc-keys.ts"],"sourcesContent":["/**\n * React Components i18n Keys\n *\n * react-components의 i18n 키를 관리하는 Single Source of Truth\n *\n */\nexport const rcKeysKo = {\n // AsyncSelect Component\n \"rc.asyncSelect.loading\": \"로딩 중...\",\n \"rc.asyncSelect.noOptions\": \"옵션이 없습니다\",\n \"rc.asyncSelect.noResults\": \"검색 결과가 없습니다\",\n \"rc.asyncSelect.selectPlaceholder\": \"선택하세요...\",\n\n // Combobox Component\n \"rc.combobox.noResults\": \"검색 결과가 없습니다\",\n \"rc.combobox.selectPlaceholder\": \"선택하세요...\",\n\n // DatePicker Component\n \"rc.datePicker.pickDate\": \"날짜 선택\",\n \"rc.datePicker.placeholder\": \"날짜 선택\",\n \"rc.datePicker.selectDate\": \"날짜 선택\",\n\n // DateSelectorMultiple Component\n \"rc.dateSelectorMultiple.addDate\": \"날짜 추가\",\n \"rc.dateSelectorMultiple.dateRange\": \"기간\",\n \"rc.dateSelectorMultiple.placeholder\": \"날짜 선택\",\n \"rc.dateSelectorMultiple.singleDate\": \"단일\",\n\n // FileInput Component\n \"rc.fileInput.browseFiles\": \"파일 찾기\",\n \"rc.fileInput.dropZone\": \"파일을 드래그하거나 클릭하여 업로드\",\n \"rc.fileInput.filePlaceholder\": \"파일\",\n \"rc.fileInput.imagePlaceholder\": \"이미지\",\n \"rc.fileInput.maxFilesExceeded\": (maxFiles: number) =>\n `최대 ${maxFiles}개 파일만 업로드 가능합니다`,\n \"rc.fileInput.pending\": \"대기 중\",\n \"rc.fileInput.remove\": \"제거\",\n \"rc.fileInput.uploadFailed\": \"업로드 실패\",\n \"rc.fileInput.uploading\": \"업로드 중...\",\n\n // MonthPickerMultiple Component\n \"rc.monthPickerMultiple.addMonth\": \"월 추가\",\n \"rc.monthPickerMultiple.dateRange\": \"기간\",\n \"rc.monthPickerMultiple.endDate\": \"종료일\",\n \"rc.monthPickerMultiple.placeholder\": \"월 선택\",\n \"rc.monthPickerMultiple.singleDate\": \"단일\",\n \"rc.monthPickerMultiple.startDate\": \"시작일\",\n\n // MultiSelect Component\n \"rc.multiSelect.clear\": \"전체 해제\",\n \"rc.multiSelect.close\": \"닫기\",\n \"rc.multiSelect.moreItems\": (count: number) => `+${count}개 더보기`,\n \"rc.multiSelect.noOptions\": \"옵션이 없습니다\",\n \"rc.multiSelect.noOptionsSelected\": \"선택된 옵션이 없습니다\",\n \"rc.multiSelect.noResults\": \"검색 결과가 없습니다\",\n \"rc.multiSelect.optionsCount\": (count: number) => `${count}개 옵션`,\n \"rc.multiSelect.selectAll\": \"전체 선택\",\n \"rc.multiSelect.selectPlaceholder\": \"선택하세요...\",\n\n // Pagination Component\n \"rc.pagination.next\": \"다음\",\n \"rc.pagination.previous\": \"이전\",\n \"rc.pagination.showing\": (start: number, end: number, total: number) =>\n `${total}개 중 ${start}-${end}`,\n\n // Calendar Component\n \"rc.calendar.month.0\": \"1월\",\n \"rc.calendar.month.1\": \"2월\",\n \"rc.calendar.month.2\": \"3월\",\n \"rc.calendar.month.3\": \"4월\",\n \"rc.calendar.month.4\": \"5월\",\n \"rc.calendar.month.5\": \"6월\",\n \"rc.calendar.month.6\": \"7월\",\n \"rc.calendar.month.7\": \"8월\",\n \"rc.calendar.month.8\": \"9월\",\n \"rc.calendar.month.9\": \"10월\",\n \"rc.calendar.month.10\": \"11월\",\n \"rc.calendar.month.11\": \"12월\",\n\n // Sonamu Filter Component\n \"rc.sonamuFilter.title\": \"소나무 필터\",\n \"rc.sonamuFilter.apply\": \"적용\",\n \"rc.sonamuFilter.reset\": \"초기화\",\n \"rc.sonamuFilter.addRule\": \"규칙 추가\",\n \"rc.sonamuFilter.noRulesYet\": '아직 규칙이 없습니다. \"+ 규칙 추가\"를 클릭하여 시작하세요.',\n \"rc.sonamuFilter.selectField\": \"필드 선택\",\n \"rc.sonamuFilter.selectOperator\": \"연산자 선택\",\n \"rc.sonamuFilter.selectOperatorFirst\": \"먼저 연산자를 선택하세요\",\n \"rc.sonamuFilter.enterValue\": \"값 입력\",\n \"rc.sonamuFilter.enterNumber\": \"숫자 입력\",\n \"rc.sonamuFilter.notSupported\": \"지원하지 않음\",\n \"rc.sonamuFilter.startDate\": \"시작일\",\n \"rc.sonamuFilter.endDate\": \"종료일\",\n \"rc.sonamuFilter.appliedFilters\": \"🌲 적용된 소나무 필터\",\n\n // Common\n \"rc.common.cancel\": \"취소\",\n \"rc.common.save\": \"저장\",\n};\n\nexport type RCKeys = typeof rcKeysKo;\nexport type RCKeyName = keyof RCKeys;\n\nexport const rcKeysEn = {\n // AsyncSelect Component\n \"rc.asyncSelect.loading\": \"Loading...\",\n \"rc.asyncSelect.noOptions\": \"No options\",\n \"rc.asyncSelect.noResults\": \"No results\",\n \"rc.asyncSelect.selectPlaceholder\": \"Select...\",\n\n // Combobox Component\n \"rc.combobox.noResults\": \"No results\",\n \"rc.combobox.selectPlaceholder\": \"Select...\",\n\n // DatePicker Component\n \"rc.datePicker.pickDate\": \"Pick date\",\n \"rc.datePicker.placeholder\": \"Pick date\",\n \"rc.datePicker.selectDate\": \"Select date\",\n\n // DateSelectorMultiple Component\n \"rc.dateSelectorMultiple.addDate\": \"Add date\",\n \"rc.dateSelectorMultiple.dateRange\": \"Range\",\n \"rc.dateSelectorMultiple.placeholder\": \"Pick date\",\n \"rc.dateSelectorMultiple.singleDate\": \"Single\",\n\n // FileInput Component\n \"rc.fileInput.browseFiles\": \"Browse files\",\n \"rc.fileInput.dropZone\": \"Drag files here or click to upload\",\n \"rc.fileInput.filePlaceholder\": \"File\",\n \"rc.fileInput.imagePlaceholder\": \"Image\",\n \"rc.fileInput.maxFilesExceeded\": (maxFiles: number) => `Maximum ${maxFiles} files allowed`,\n \"rc.fileInput.pending\": \"Pending\",\n \"rc.fileInput.remove\": \"Remove\",\n \"rc.fileInput.uploadFailed\": \"Upload failed\",\n \"rc.fileInput.uploading\": \"Uploading...\",\n\n // MonthPickerMultiple Component\n \"rc.monthPickerMultiple.addMonth\": \"Add month\",\n \"rc.monthPickerMultiple.dateRange\": \"Range\",\n \"rc.monthPickerMultiple.endDate\": \"End date\",\n \"rc.monthPickerMultiple.placeholder\": \"Pick month\",\n \"rc.monthPickerMultiple.singleDate\": \"Single\",\n \"rc.monthPickerMultiple.startDate\": \"Start date\",\n\n // MultiSelect Component\n \"rc.multiSelect.clear\": \"Clear all\",\n \"rc.multiSelect.close\": \"Close\",\n \"rc.multiSelect.moreItems\": (count: number) => `+${count} more`,\n \"rc.multiSelect.noOptions\": \"No options\",\n \"rc.multiSelect.noOptionsSelected\": \"No options selected\",\n \"rc.multiSelect.noResults\": \"No results\",\n \"rc.multiSelect.optionsCount\": (count: number) => `${count} options`,\n \"rc.multiSelect.selectAll\": \"Select all\",\n \"rc.multiSelect.selectPlaceholder\": \"Select...\",\n\n // Pagination Component\n \"rc.pagination.next\": \"Next\",\n \"rc.pagination.previous\": \"Previous\",\n \"rc.pagination.showing\": (start: number, end: number, total: number) =>\n `Showing ${start}-${end} of ${total}`,\n\n // Calendar Component\n \"rc.calendar.month.0\": \"January\",\n \"rc.calendar.month.1\": \"February\",\n \"rc.calendar.month.2\": \"March\",\n \"rc.calendar.month.3\": \"April\",\n \"rc.calendar.month.4\": \"May\",\n \"rc.calendar.month.5\": \"June\",\n \"rc.calendar.month.6\": \"July\",\n \"rc.calendar.month.7\": \"August\",\n \"rc.calendar.month.8\": \"September\",\n \"rc.calendar.month.9\": \"October\",\n \"rc.calendar.month.10\": \"November\",\n \"rc.calendar.month.11\": \"December\",\n\n // Sonamu Filter Component\n \"rc.sonamuFilter.title\": \"Sonamu Filter\",\n \"rc.sonamuFilter.apply\": \"Apply\",\n \"rc.sonamuFilter.reset\": \"Reset\",\n \"rc.sonamuFilter.addRule\": \"Add Rule\",\n \"rc.sonamuFilter.noRulesYet\": 'No rules yet. Click \"+ Add Rule\" to start.',\n \"rc.sonamuFilter.selectField\": \"Select field\",\n \"rc.sonamuFilter.selectOperator\": \"Operator\",\n \"rc.sonamuFilter.selectOperatorFirst\": \"Select operator first\",\n \"rc.sonamuFilter.enterValue\": \"Enter value\",\n \"rc.sonamuFilter.enterNumber\": \"Enter number\",\n \"rc.sonamuFilter.notSupported\": \"Not supported\",\n \"rc.sonamuFilter.startDate\": \"Start date\",\n \"rc.sonamuFilter.endDate\": \"End date\",\n \"rc.sonamuFilter.appliedFilters\": \"🌲 Applied SonamuFilters\",\n\n // Common\n \"rc.common.cancel\": \"Cancel\",\n \"rc.common.save\": \"Save\",\n} satisfies RCKeys;\n"],"mappings":";AAuGA,
|
|
1
|
+
{"version":3,"file":"rc-keys.js","names":["rcKeysEn","maxFiles","count","start","end","total"],"sources":["../../src/i18n/rc-keys.ts"],"sourcesContent":["/**\n * React Components i18n Keys\n *\n * react-components의 i18n 키를 관리하는 Single Source of Truth\n *\n */\nexport const rcKeysKo = {\n // AsyncSelect Component\n \"rc.asyncSelect.loading\": \"로딩 중...\",\n \"rc.asyncSelect.noOptions\": \"옵션이 없습니다\",\n \"rc.asyncSelect.noResults\": \"검색 결과가 없습니다\",\n \"rc.asyncSelect.selectPlaceholder\": \"선택하세요...\",\n\n // Combobox Component\n \"rc.combobox.noResults\": \"검색 결과가 없습니다\",\n \"rc.combobox.selectPlaceholder\": \"선택하세요...\",\n\n // DatePicker Component\n \"rc.datePicker.pickDate\": \"날짜 선택\",\n \"rc.datePicker.placeholder\": \"날짜 선택\",\n \"rc.datePicker.selectDate\": \"날짜 선택\",\n\n // DateSelectorMultiple Component\n \"rc.dateSelectorMultiple.addDate\": \"날짜 추가\",\n \"rc.dateSelectorMultiple.dateRange\": \"기간\",\n \"rc.dateSelectorMultiple.placeholder\": \"날짜 선택\",\n \"rc.dateSelectorMultiple.singleDate\": \"단일\",\n\n // FileInput Component\n \"rc.fileInput.browseFiles\": \"파일 찾기\",\n \"rc.fileInput.dropZone\": \"파일을 드래그하거나 클릭하여 업로드\",\n \"rc.fileInput.filePlaceholder\": \"파일\",\n \"rc.fileInput.imagePlaceholder\": \"이미지\",\n \"rc.fileInput.maxFilesExceeded\": (maxFiles: number) =>\n `최대 ${maxFiles}개 파일만 업로드 가능합니다`,\n \"rc.fileInput.pending\": \"대기 중\",\n \"rc.fileInput.remove\": \"제거\",\n \"rc.fileInput.uploadFailed\": \"업로드 실패\",\n \"rc.fileInput.uploading\": \"업로드 중...\",\n\n // MonthPickerMultiple Component\n \"rc.monthPickerMultiple.addMonth\": \"월 추가\",\n \"rc.monthPickerMultiple.dateRange\": \"기간\",\n \"rc.monthPickerMultiple.endDate\": \"종료일\",\n \"rc.monthPickerMultiple.placeholder\": \"월 선택\",\n \"rc.monthPickerMultiple.singleDate\": \"단일\",\n \"rc.monthPickerMultiple.startDate\": \"시작일\",\n\n // MultiSelect Component\n \"rc.multiSelect.clear\": \"전체 해제\",\n \"rc.multiSelect.close\": \"닫기\",\n \"rc.multiSelect.moreItems\": (count: number) => `+${count}개 더보기`,\n \"rc.multiSelect.noOptions\": \"옵션이 없습니다\",\n \"rc.multiSelect.noOptionsSelected\": \"선택된 옵션이 없습니다\",\n \"rc.multiSelect.noResults\": \"검색 결과가 없습니다\",\n \"rc.multiSelect.optionsCount\": (count: number) => `${count}개 옵션`,\n \"rc.multiSelect.selectAll\": \"전체 선택\",\n \"rc.multiSelect.selectPlaceholder\": \"선택하세요...\",\n\n // Pagination Component\n \"rc.pagination.next\": \"다음\",\n \"rc.pagination.previous\": \"이전\",\n \"rc.pagination.showing\": (start: number, end: number, total: number) =>\n `${total}개 중 ${start}-${end}`,\n\n // Calendar Component\n \"rc.calendar.month.0\": \"1월\",\n \"rc.calendar.month.1\": \"2월\",\n \"rc.calendar.month.2\": \"3월\",\n \"rc.calendar.month.3\": \"4월\",\n \"rc.calendar.month.4\": \"5월\",\n \"rc.calendar.month.5\": \"6월\",\n \"rc.calendar.month.6\": \"7월\",\n \"rc.calendar.month.7\": \"8월\",\n \"rc.calendar.month.8\": \"9월\",\n \"rc.calendar.month.9\": \"10월\",\n \"rc.calendar.month.10\": \"11월\",\n \"rc.calendar.month.11\": \"12월\",\n\n // Sonamu Filter Component\n \"rc.sonamuFilter.title\": \"소나무 필터\",\n \"rc.sonamuFilter.apply\": \"적용\",\n \"rc.sonamuFilter.reset\": \"초기화\",\n \"rc.sonamuFilter.addRule\": \"규칙 추가\",\n \"rc.sonamuFilter.noRulesYet\": '아직 규칙이 없습니다. \"+ 규칙 추가\"를 클릭하여 시작하세요.',\n \"rc.sonamuFilter.selectField\": \"필드 선택\",\n \"rc.sonamuFilter.selectOperator\": \"연산자 선택\",\n \"rc.sonamuFilter.selectOperatorFirst\": \"먼저 연산자를 선택하세요\",\n \"rc.sonamuFilter.enterValue\": \"값 입력\",\n \"rc.sonamuFilter.enterNumber\": \"숫자 입력\",\n \"rc.sonamuFilter.notSupported\": \"지원하지 않음\",\n \"rc.sonamuFilter.startDate\": \"시작일\",\n \"rc.sonamuFilter.endDate\": \"종료일\",\n \"rc.sonamuFilter.appliedFilters\": \"🌲 적용된 소나무 필터\",\n\n // Common\n \"rc.common.cancel\": \"취소\",\n \"rc.common.save\": \"저장\",\n};\n\nexport type RCKeys = typeof rcKeysKo;\nexport type RCKeyName = keyof RCKeys;\n\nexport const rcKeysEn = {\n // AsyncSelect Component\n \"rc.asyncSelect.loading\": \"Loading...\",\n \"rc.asyncSelect.noOptions\": \"No options\",\n \"rc.asyncSelect.noResults\": \"No results\",\n \"rc.asyncSelect.selectPlaceholder\": \"Select...\",\n\n // Combobox Component\n \"rc.combobox.noResults\": \"No results\",\n \"rc.combobox.selectPlaceholder\": \"Select...\",\n\n // DatePicker Component\n \"rc.datePicker.pickDate\": \"Pick date\",\n \"rc.datePicker.placeholder\": \"Pick date\",\n \"rc.datePicker.selectDate\": \"Select date\",\n\n // DateSelectorMultiple Component\n \"rc.dateSelectorMultiple.addDate\": \"Add date\",\n \"rc.dateSelectorMultiple.dateRange\": \"Range\",\n \"rc.dateSelectorMultiple.placeholder\": \"Pick date\",\n \"rc.dateSelectorMultiple.singleDate\": \"Single\",\n\n // FileInput Component\n \"rc.fileInput.browseFiles\": \"Browse files\",\n \"rc.fileInput.dropZone\": \"Drag files here or click to upload\",\n \"rc.fileInput.filePlaceholder\": \"File\",\n \"rc.fileInput.imagePlaceholder\": \"Image\",\n \"rc.fileInput.maxFilesExceeded\": (maxFiles: number) => `Maximum ${maxFiles} files allowed`,\n \"rc.fileInput.pending\": \"Pending\",\n \"rc.fileInput.remove\": \"Remove\",\n \"rc.fileInput.uploadFailed\": \"Upload failed\",\n \"rc.fileInput.uploading\": \"Uploading...\",\n\n // MonthPickerMultiple Component\n \"rc.monthPickerMultiple.addMonth\": \"Add month\",\n \"rc.monthPickerMultiple.dateRange\": \"Range\",\n \"rc.monthPickerMultiple.endDate\": \"End date\",\n \"rc.monthPickerMultiple.placeholder\": \"Pick month\",\n \"rc.monthPickerMultiple.singleDate\": \"Single\",\n \"rc.monthPickerMultiple.startDate\": \"Start date\",\n\n // MultiSelect Component\n \"rc.multiSelect.clear\": \"Clear all\",\n \"rc.multiSelect.close\": \"Close\",\n \"rc.multiSelect.moreItems\": (count: number) => `+${count} more`,\n \"rc.multiSelect.noOptions\": \"No options\",\n \"rc.multiSelect.noOptionsSelected\": \"No options selected\",\n \"rc.multiSelect.noResults\": \"No results\",\n \"rc.multiSelect.optionsCount\": (count: number) => `${count} options`,\n \"rc.multiSelect.selectAll\": \"Select all\",\n \"rc.multiSelect.selectPlaceholder\": \"Select...\",\n\n // Pagination Component\n \"rc.pagination.next\": \"Next\",\n \"rc.pagination.previous\": \"Previous\",\n \"rc.pagination.showing\": (start: number, end: number, total: number) =>\n `Showing ${start}-${end} of ${total}`,\n\n // Calendar Component\n \"rc.calendar.month.0\": \"January\",\n \"rc.calendar.month.1\": \"February\",\n \"rc.calendar.month.2\": \"March\",\n \"rc.calendar.month.3\": \"April\",\n \"rc.calendar.month.4\": \"May\",\n \"rc.calendar.month.5\": \"June\",\n \"rc.calendar.month.6\": \"July\",\n \"rc.calendar.month.7\": \"August\",\n \"rc.calendar.month.8\": \"September\",\n \"rc.calendar.month.9\": \"October\",\n \"rc.calendar.month.10\": \"November\",\n \"rc.calendar.month.11\": \"December\",\n\n // Sonamu Filter Component\n \"rc.sonamuFilter.title\": \"Sonamu Filter\",\n \"rc.sonamuFilter.apply\": \"Apply\",\n \"rc.sonamuFilter.reset\": \"Reset\",\n \"rc.sonamuFilter.addRule\": \"Add Rule\",\n \"rc.sonamuFilter.noRulesYet\": 'No rules yet. Click \"+ Add Rule\" to start.',\n \"rc.sonamuFilter.selectField\": \"Select field\",\n \"rc.sonamuFilter.selectOperator\": \"Operator\",\n \"rc.sonamuFilter.selectOperatorFirst\": \"Select operator first\",\n \"rc.sonamuFilter.enterValue\": \"Enter value\",\n \"rc.sonamuFilter.enterNumber\": \"Enter number\",\n \"rc.sonamuFilter.notSupported\": \"Not supported\",\n \"rc.sonamuFilter.startDate\": \"Start date\",\n \"rc.sonamuFilter.endDate\": \"End date\",\n \"rc.sonamuFilter.appliedFilters\": \"🌲 Applied SonamuFilters\",\n\n // Common\n \"rc.common.cancel\": \"Cancel\",\n \"rc.common.save\": \"Save\",\n} satisfies RCKeys;\n"],"mappings":";AAuGA,IAAaA,IAAW;CAEtB,0BAA0B;CAC1B,4BAA4B;CAC5B,4BAA4B;CAC5B,oCAAoC;CAGpC,yBAAyB;CACzB,iCAAiC;CAGjC,0BAA0B;CAC1B,6BAA6B;CAC7B,4BAA4B;CAG5B,mCAAmC;CACnC,qCAAqC;CACrC,uCAAuC;CACvC,sCAAsC;CAGtC,4BAA4B;CAC5B,yBAAyB;CACzB,gCAAgC;CAChC,iCAAiC;CACjC,kCAAkC,MAAqB,WAAWC,EAAS;CAC3E,wBAAwB;CACxB,uBAAuB;CACvB,6BAA6B;CAC7B,0BAA0B;CAG1B,mCAAmC;CACnC,oCAAoC;CACpC,kCAAkC;CAClC,sCAAsC;CACtC,qCAAqC;CACrC,oCAAoC;CAGpC,wBAAwB;CACxB,wBAAwB;CACxB,6BAA6B,MAAkB,IAAIC,EAAM;CACzD,4BAA4B;CAC5B,oCAAoC;CACpC,4BAA4B;CAC5B,gCAAgC,MAAkB,GAAGA,EAAM;CAC3D,4BAA4B;CAC5B,oCAAoC;CAGpC,sBAAsB;CACtB,0BAA0B;CAC1B,0BAA0B,GAAe,GAAa,MACpD,WAAWC,EAAM,GAAGC,EAAI,MAAMC;CAGhC,uBAAuB;CACvB,uBAAuB;CACvB,uBAAuB;CACvB,uBAAuB;CACvB,uBAAuB;CACvB,uBAAuB;CACvB,uBAAuB;CACvB,uBAAuB;CACvB,uBAAuB;CACvB,uBAAuB;CACvB,wBAAwB;CACxB,wBAAwB;CAGxB,yBAAyB;CACzB,yBAAyB;CACzB,yBAAyB;CACzB,2BAA2B;CAC3B,8BAA8B;CAC9B,+BAA+B;CAC/B,kCAAkC;CAClC,uCAAuC;CACvC,8BAA8B;CAC9B,+BAA+B;CAC/B,gCAAgC;CAChC,6BAA6B;CAC7B,2BAA2B;CAC3B,kCAAkC;CAGlC,oBAAoB;CACpB,kBAAkB;AACpB"}
|
package/dist/lib/base-helpers.js
CHANGED
|
@@ -2,12 +2,13 @@ import { caster as e } from "./caster.js";
|
|
|
2
2
|
import { format as t } from "date-fns";
|
|
3
3
|
import { isObject as n } from "radashi";
|
|
4
4
|
import r from "qs";
|
|
5
|
-
|
|
5
|
+
// src/lib/base-helpers.ts
|
|
6
6
|
function i(e) {
|
|
7
7
|
return e === !0 ? "hidden" : "";
|
|
8
8
|
}
|
|
9
9
|
function a(t, n) {
|
|
10
|
-
|
|
10
|
+
let i = r.parse(t.toString());
|
|
11
|
+
return e(n, i);
|
|
11
12
|
}
|
|
12
13
|
function o(e) {
|
|
13
14
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0).map(([e, t]) => Array.isArray(t) ? [[`${e}[]`, t]] : n(t) ? Object.entries(t).map(([t, n]) => [`${e}[${t}]`, String(n)]) : [[e, String(t)]]).flat());
|
|
@@ -38,7 +39,6 @@ function f() {
|
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
//#endregion
|
|
42
42
|
export { d as arrayableToArray, f as caller, l as dateF, u as datetimeF, i as hidden, c as numF, o as paramsToSearchParams, a as searchParamsToParams, s as sqlDateToDateString };
|
|
43
43
|
|
|
44
44
|
//# sourceMappingURL=base-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-helpers.js","names":[],"sources":["../../src/lib/base-helpers.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-explicit-any */ // 파싱 결과이므로 any 허용\n\nimport { format } from \"date-fns\";\nimport qs from \"qs\";\nimport { isObject } from \"radashi\";\nimport { type z } from \"zod\";\n\nimport { caster } from \"./caster\";\n\n// ============================================================================\n// UI Utilities\n// ============================================================================\n\nexport function hidden(condition: boolean | undefined): string {\n return condition === true ? \"hidden\" : \"\";\n}\n\n// ============================================================================\n// URL / Search Params Conversion\n// ============================================================================\n\nexport function searchParamsToParams<T extends z.ZodType<any>>(\n searchParams: URLSearchParams,\n paramsSchema: T,\n): z.infer<T> {\n const obj = qs.parse(searchParams.toString());\n return caster(paramsSchema, obj);\n}\n\nexport function paramsToSearchParams<T extends object>(\n params: T,\n): {\n [key in string]: string | string[];\n} {\n return Object.fromEntries(\n // oxlint-disable-next-line unicorn/prefer-array-flat-map -- 여기는 flatMap 사용하면 깨짐\n Object.entries(params)\n .filter(([, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n if (Array.isArray(value)) {\n return [[`${key}[]`, value]];\n } else if (isObject(value)) {\n return Object.entries(value).map(([subKey, subValue]) => {\n return [`${key}[${subKey}]`, String(subValue)];\n });\n } else {\n return [[key, String(value)]];\n }\n })\n .flat(),\n );\n}\n\n// ============================================================================\n// Formatting Utilities\n// ============================================================================\n\nexport function sqlDateToDateString(sqlDateString: string | null) {\n if (sqlDateString === null) {\n return null;\n } else {\n return sqlDateString.slice(0, 10);\n }\n}\n\nexport function numF(num: number | null | undefined): string | number | undefined | null {\n return num && new Intl.NumberFormat().format(num);\n}\n\nexport function dateF(dateValue: string | Date | null | undefined): string | null {\n if (dateValue === null || dateValue === undefined) {\n return null;\n } else if (dateValue instanceof Date) {\n // toISOString은 UTC로 고정되어 로컬 시간대와 어긋난다. 로컬 기준으로 포맷한다.\n return format(dateValue, \"yyyy-MM-dd\");\n } else {\n return dateValue.slice(0, 10);\n }\n}\n\nexport function datetimeF(dateValue: string | Date | null | undefined): string | null {\n if (dateValue === null || dateValue === undefined) {\n return null;\n } else if (dateValue instanceof Date) {\n // toISOString은 UTC로 고정되어 로컬 시간대와 어긋난다. 로컬 기준으로 포맷한다.\n return format(dateValue, \"yyyy-MM-dd HH:mm:ss\");\n } else {\n return dateValue.slice(0, 19);\n }\n}\n\n// ============================================================================\n// Array Utilities\n// ============================================================================\n\nexport function arrayableToArray<T extends number | string | boolean>(\n val: T | T[] | undefined,\n): T[] {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}\n\n// ============================================================================\n// Function Reference Utilities\n// ============================================================================\n\nexport function caller<T extends Function>(): { set: (func: T) => void; call: T };\nexport function caller() {\n let savedFunc: Function | null = null;\n return {\n set: (func: Function) => {\n savedFunc = func;\n },\n call: (...args: unknown[]) => {\n if (savedFunc) {\n savedFunc.call(args);\n }\n },\n };\n}\n"],"mappings":";;;;;AAaA,
|
|
1
|
+
{"version":3,"file":"base-helpers.js","names":["qs","hidden","condition","searchParamsToParams","obj","searchParams","caster","paramsSchema","paramsToSearchParams","params","value","key","isObject","subKey","subValue","sqlDateToDateString","sqlDateString","numF","num","dateF","dateValue","format","datetimeF","arrayableToArray","val","caller","savedFunc","func","args"],"sources":["../../src/lib/base-helpers.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-explicit-any */ // 파싱 결과이므로 any 허용\n\nimport { format } from \"date-fns\";\nimport qs from \"qs\";\nimport { isObject } from \"radashi\";\nimport { type z } from \"zod\";\n\nimport { caster } from \"./caster\";\n\n// ============================================================================\n// UI Utilities\n// ============================================================================\n\nexport function hidden(condition: boolean | undefined): string {\n return condition === true ? \"hidden\" : \"\";\n}\n\n// ============================================================================\n// URL / Search Params Conversion\n// ============================================================================\n\nexport function searchParamsToParams<T extends z.ZodType<any>>(\n searchParams: URLSearchParams,\n paramsSchema: T,\n): z.infer<T> {\n const obj = qs.parse(searchParams.toString());\n return caster(paramsSchema, obj);\n}\n\nexport function paramsToSearchParams<T extends object>(\n params: T,\n): {\n [key in string]: string | string[];\n} {\n return Object.fromEntries(\n // oxlint-disable-next-line unicorn/prefer-array-flat-map -- 여기는 flatMap 사용하면 깨짐\n Object.entries(params)\n .filter(([, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n if (Array.isArray(value)) {\n return [[`${key}[]`, value]];\n } else if (isObject(value)) {\n return Object.entries(value).map(([subKey, subValue]) => {\n return [`${key}[${subKey}]`, String(subValue)];\n });\n } else {\n return [[key, String(value)]];\n }\n })\n .flat(),\n );\n}\n\n// ============================================================================\n// Formatting Utilities\n// ============================================================================\n\nexport function sqlDateToDateString(sqlDateString: string | null) {\n if (sqlDateString === null) {\n return null;\n } else {\n return sqlDateString.slice(0, 10);\n }\n}\n\nexport function numF(num: number | null | undefined): string | number | undefined | null {\n return num && new Intl.NumberFormat().format(num);\n}\n\nexport function dateF(dateValue: string | Date | null | undefined): string | null {\n if (dateValue === null || dateValue === undefined) {\n return null;\n } else if (dateValue instanceof Date) {\n // toISOString은 UTC로 고정되어 로컬 시간대와 어긋난다. 로컬 기준으로 포맷한다.\n return format(dateValue, \"yyyy-MM-dd\");\n } else {\n return dateValue.slice(0, 10);\n }\n}\n\nexport function datetimeF(dateValue: string | Date | null | undefined): string | null {\n if (dateValue === null || dateValue === undefined) {\n return null;\n } else if (dateValue instanceof Date) {\n // toISOString은 UTC로 고정되어 로컬 시간대와 어긋난다. 로컬 기준으로 포맷한다.\n return format(dateValue, \"yyyy-MM-dd HH:mm:ss\");\n } else {\n return dateValue.slice(0, 19);\n }\n}\n\n// ============================================================================\n// Array Utilities\n// ============================================================================\n\nexport function arrayableToArray<T extends number | string | boolean>(\n val: T | T[] | undefined,\n): T[] {\n return val ? (Array.isArray(val) ? val : [val]) : [];\n}\n\n// ============================================================================\n// Function Reference Utilities\n// ============================================================================\n\nexport function caller<T extends Function>(): { set: (func: T) => void; call: T };\nexport function caller() {\n let savedFunc: Function | null = null;\n return {\n set: (func: Function) => {\n savedFunc = func;\n },\n call: (...args: unknown[]) => {\n if (savedFunc) {\n savedFunc.call(args);\n }\n },\n };\n}\n"],"mappings":";;;;;AAaA,SAAgBC,EAAO,GAAwC;CAC7D,OAAOC,MAAc,KAAO,WAAW;AACzC;AAMA,SAAgBC,EACd,GACA,GACY;CACZ,IAAMC,IAAMJ,EAAG,MAAMK,EAAa,SAAS,CAAC;CAC5C,OAAOC,EAAOC,GAAcH,CAAG;AACjC;AAEA,SAAgBI,EACd,GAGA;CACA,OAAO,OAAO,YAEZ,OAAO,QAAQC,CAAM,CAAC,CACnB,QAAQ,GAAGC,OACHA,MAAU,KAAA,CAClB,CAAC,CACD,KAAK,CAACC,GAAKD,OACN,MAAM,QAAQA,CAAK,IACd,CAAC,CAAC,GAAGC,EAAI,KAAKD,CAAK,CAAC,IAClBE,EAASF,CAAK,IAChB,OAAO,QAAQA,CAAK,CAAC,CAAC,KAAK,CAACG,GAAQC,OAClC,CAAC,GAAGH,EAAI,GAAGE,EAAO,IAAI,OAAOC,CAAQ,CAAC,CAC9C,IAEM,CAAC,CAACH,GAAK,OAAOD,CAAK,CAAC,CAAC,CAE/B,CAAC,CACD,KAAK,CACV;AACF;AAMA,SAAgBK,EAAoB,GAA8B;CAI9D,OAHEC,MAAkB,OACb,OAEAA,EAAc,MAAM,GAAG,EAAE;AAEpC;AAEA,SAAgBC,EAAK,GAAoE;CACvF,OAAOC,KAAO,IAAI,KAAK,aAAa,CAAC,CAAC,OAAOA,CAAG;AAClD;AAEA,SAAgBC,EAAM,GAA4D;CAO9E,OANEC,KAAc,OACT,OACEA,aAAqB,OAEvBC,EAAOD,GAAW,YAAY,IAE9BA,EAAU,MAAM,GAAG,EAAE;AAEhC;AAEA,SAAgBE,EAAU,GAA4D;CAOlF,OANEF,KAAc,OACT,OACEA,aAAqB,OAEvBC,EAAOD,GAAW,qBAAqB,IAEvCA,EAAU,MAAM,GAAG,EAAE;AAEhC;AAMA,SAAgBG,EACd,GACK;CACL,OAAOC,IAAO,MAAM,QAAQA,CAAG,IAAIA,IAAM,CAACA,CAAG,IAAK,CAAC;AACrD;AAOA,SAAgBC,IAAS;CACvB,IAAIC,IAA6B;CACjC,OAAO;EACL,MAAM,MAAmB;GACvB,IAAYC;EACd;EACA,OAAO,GAAGC,MAAoB;GAC5B,AAAIF,KACFA,EAAU,KAAKE,CAAI;EAEvB;CACF;AACF"}
|
package/dist/lib/caster.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare function getZodObjectFields(zodObject: z.ZodObject): Record<string, z.ZodType>;
|
|
3
3
|
export declare function caster<T extends z.ZodType<any>>(zodType: T, raw: any): z.infer<T>;
|
|
4
|
-
export declare function fastifyCaster<T extends Record<string, z.ZodType>>(schema: z.ZodObject<T>): z.
|
|
4
|
+
export declare function fastifyCaster<T extends Record<string, z.ZodType>>(schema: z.ZodObject<T>): z.ZodPreprocess<z.ZodObject<T, z.core.$strip>, unknown>;
|
package/dist/lib/caster.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
|
-
|
|
2
|
+
// src/lib/caster.ts
|
|
3
3
|
function t(n) {
|
|
4
4
|
return n instanceof e.ZodNumber ? !0 : n instanceof e.ZodNullable || n instanceof e.ZodOptional ? t(n.unwrap()) : !1;
|
|
5
5
|
}
|
|
@@ -39,7 +39,6 @@ function c(e, t) {
|
|
|
39
39
|
function l(t) {
|
|
40
40
|
return e.preprocess((e) => s(t, e), t);
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { c as caster, l as fastifyCaster, o as getZodObjectFields };
|
|
44
43
|
|
|
45
44
|
//# sourceMappingURL=caster.js.map
|
package/dist/lib/caster.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"caster.js","names":[],"sources":["../../src/lib/caster.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-explicit-any */ // caster 함수에는 any가 필요함\nimport { z } from \"zod\";\n\n// optional, nullable 무관하게 ZodNumber 체크\nfunction isZodNumberAnyway(zodType: any): boolean {\n if (zodType instanceof z.ZodNumber) {\n return true;\n }\n if (zodType instanceof z.ZodNullable || zodType instanceof z.ZodOptional) {\n return isZodNumberAnyway(zodType.unwrap());\n }\n return false;\n}\n\nconst stringValue = z.string();\nconst objectValue = z.record(z.string(), z.unknown());\nconst zodTypeValue = z.custom<z.ZodType>((value) => value instanceof z.ZodType);\nconst zodFieldsValue = z.record(z.string(), zodTypeValue);\n\nexport function getZodObjectFields(zodObject: z.ZodObject): Record<string, z.ZodType> {\n const fieldsEntry = Object.entries(zodObject.def).find(([property]) => property === \"shape\");\n return zodFieldsValue.parse(fieldsEntry?.[1]);\n}\n\n// ZodType을 이용해 입력값을 타입에 맞게 변환합니다.\nfunction coerceInput(zodType: any, raw: any): any {\n if (isZodNumberAnyway(zodType) && stringValue.safeParse(raw).success) {\n return Number(raw);\n }\n\n if (zodType instanceof z.ZodUnion) {\n if (zodType.options.some((option: any) => isZodNumberAnyway(option))) {\n if (Array.isArray(raw)) {\n const numberType = zodType.options.find((option: any) => isZodNumberAnyway(option));\n if (numberType === undefined) {\n throw new Error(\"Expected to find a number type in union\");\n }\n return raw.map((element) => coerceInput(numberType, element));\n }\n return Number(raw);\n }\n } else if (zodType instanceof z.ZodBoolean && (raw === \"true\" || raw === \"false\")) {\n return raw === \"true\";\n } else if (zodType instanceof z.ZodArray && Array.isArray(raw)) {\n return raw.map((element) => coerceInput(zodType.element, element));\n } else if (zodType instanceof z.ZodObject) {\n const parsedObject = objectValue.safeParse(raw);\n if (parsedObject.success) {\n const fields = getZodObjectFields(zodType);\n return Object.fromEntries(\n Object.entries(parsedObject.data).map(([key, value]) => {\n const fieldType = fields[key];\n return [key, fieldType === undefined ? value : coerceInput(fieldType, value)];\n }),\n );\n }\n } else if (zodType instanceof z.ZodOptional || zodType instanceof z.ZodNullable) {\n return coerceInput(zodType.unwrap(), raw);\n }\n\n return raw;\n}\n\nexport function caster<T extends z.ZodType<any>>(zodType: T, raw: any): z.infer<T>;\nexport function caster(zodType: any, raw: any): any {\n return coerceInput(zodType, raw);\n}\n\nexport function fastifyCaster<T extends Record<string, z.ZodType>>(schema: z.ZodObject<T>) {\n return z.preprocess((raw) => coerceInput(schema, raw), schema);\n}\n"],"mappings":";;AAIA,
|
|
1
|
+
{"version":3,"file":"caster.js","names":["isZodNumberAnyway","zodType","z","stringValue","objectValue","zodTypeValue","value","zodFieldsValue","getZodObjectFields","fieldsEntry","zodObject","property","coerceInput","raw","option","numberType","element","parsedObject","fields","key","fieldType","caster","fastifyCaster","schema"],"sources":["../../src/lib/caster.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-explicit-any */ // caster 함수에는 any가 필요함\nimport { z } from \"zod\";\n\n// optional, nullable 무관하게 ZodNumber 체크\nfunction isZodNumberAnyway(zodType: any): boolean {\n if (zodType instanceof z.ZodNumber) {\n return true;\n }\n if (zodType instanceof z.ZodNullable || zodType instanceof z.ZodOptional) {\n return isZodNumberAnyway(zodType.unwrap());\n }\n return false;\n}\n\nconst stringValue = z.string();\nconst objectValue = z.record(z.string(), z.unknown());\nconst zodTypeValue = z.custom<z.ZodType>((value) => value instanceof z.ZodType);\nconst zodFieldsValue = z.record(z.string(), zodTypeValue);\n\nexport function getZodObjectFields(zodObject: z.ZodObject): Record<string, z.ZodType> {\n const fieldsEntry = Object.entries(zodObject.def).find(([property]) => property === \"shape\");\n return zodFieldsValue.parse(fieldsEntry?.[1]);\n}\n\n// ZodType을 이용해 입력값을 타입에 맞게 변환합니다.\nfunction coerceInput(zodType: any, raw: any): any {\n if (isZodNumberAnyway(zodType) && stringValue.safeParse(raw).success) {\n return Number(raw);\n }\n\n if (zodType instanceof z.ZodUnion) {\n if (zodType.options.some((option: any) => isZodNumberAnyway(option))) {\n if (Array.isArray(raw)) {\n const numberType = zodType.options.find((option: any) => isZodNumberAnyway(option));\n if (numberType === undefined) {\n throw new Error(\"Expected to find a number type in union\");\n }\n return raw.map((element) => coerceInput(numberType, element));\n }\n return Number(raw);\n }\n } else if (zodType instanceof z.ZodBoolean && (raw === \"true\" || raw === \"false\")) {\n return raw === \"true\";\n } else if (zodType instanceof z.ZodArray && Array.isArray(raw)) {\n return raw.map((element) => coerceInput(zodType.element, element));\n } else if (zodType instanceof z.ZodObject) {\n const parsedObject = objectValue.safeParse(raw);\n if (parsedObject.success) {\n const fields = getZodObjectFields(zodType);\n return Object.fromEntries(\n Object.entries(parsedObject.data).map(([key, value]) => {\n const fieldType = fields[key];\n return [key, fieldType === undefined ? value : coerceInput(fieldType, value)];\n }),\n );\n }\n } else if (zodType instanceof z.ZodOptional || zodType instanceof z.ZodNullable) {\n return coerceInput(zodType.unwrap(), raw);\n }\n\n return raw;\n}\n\nexport function caster<T extends z.ZodType<any>>(zodType: T, raw: any): z.infer<T>;\nexport function caster(zodType: any, raw: any): any {\n return coerceInput(zodType, raw);\n}\n\nexport function fastifyCaster<T extends Record<string, z.ZodType>>(schema: z.ZodObject<T>) {\n return z.preprocess((raw) => coerceInput(schema, raw), schema);\n}\n"],"mappings":";;AAIA,SAASA,EAAkB,GAAuB;CAOhD,OANIC,aAAmBC,EAAE,YAChB,KAELD,aAAmBC,EAAE,eAAeD,aAAmBC,EAAE,cACpDF,EAAkBC,EAAQ,OAAO,CAAC,IAEpC;AACT;AAEA,IAAME,IAAcD,EAAE,OAAO,GACvBE,IAAcF,EAAE,OAAOA,EAAE,OAAO,GAAGA,EAAE,QAAQ,CAAC,GAC9CG,IAAeH,EAAE,QAAmB,MAAUI,aAAiBJ,EAAE,OAAO,GACxEK,IAAiBL,EAAE,OAAOA,EAAE,OAAO,GAAGG,CAAY;AAExD,SAAgBG,EAAmB,GAAmD;CACpF,IAAMC,IAAc,OAAO,QAAQC,EAAU,GAAG,CAAC,CAAC,MAAM,CAACC,OAAcA,MAAa,OAAO;CAC3F,OAAOJ,EAAe,MAAME,IAAc,EAAE;AAC9C;AAGA,SAASG,EAAY,GAAc,GAAe;CAChD,IAAIZ,EAAkBC,CAAO,KAAKE,EAAY,UAAUU,CAAG,CAAC,CAAC,SAC3D,OAAO,OAAOA,CAAG;CAGnB,IAAIZ,aAAmBC,EAAE,UACnB;MAAAD,EAAQ,QAAQ,MAAM,MAAgBD,EAAkBc,CAAM,CAAC,GAAG;GACpE,IAAI,MAAM,QAAQD,CAAG,GAAG;IACtB,IAAME,IAAad,EAAQ,QAAQ,MAAM,MAAgBD,EAAkBc,CAAM,CAAC;IAClF,IAAIC,MAAe,KAAA,GACjB,MAAU,MAAM,yCAAyC;IAE3D,OAAOF,EAAI,KAAK,MAAYD,EAAYG,GAAYC,CAAO,CAAC;GAC9D;GACA,OAAO,OAAOH,CAAG;EACnB;QACK,IAAIZ,aAAmBC,EAAE,eAAeW,MAAQ,UAAUA,MAAQ,UACvE,OAAOA,MAAQ;MACV,IAAIZ,aAAmBC,EAAE,YAAY,MAAM,QAAQW,CAAG,GAC3D,OAAOA,EAAI,KAAK,MAAYD,EAAYX,EAAQ,SAASe,CAAO,CAAC;MAC5D,IAAIf,aAAmBC,EAAE,WAAW;EACzC,IAAMe,IAAeb,EAAY,UAAUS,CAAG;EAC9C,IAAII,EAAa,SAAS;GACxB,IAAMC,IAASV,EAAmBP,CAAO;GACzC,OAAO,OAAO,YACZ,OAAO,QAAQgB,EAAa,IAAI,CAAC,CAAC,KAAK,CAACE,GAAKb,OAAW;IACtD,IAAMc,IAAYF,EAAOC;IACzB,OAAO,CAACA,GAAKC,MAAc,KAAA,IAAYd,IAAQM,EAAYQ,GAAWd,CAAK,CAAC;GAC9E,CAAC,CACH;EACF;CACF,OAAO,IAAIL,aAAmBC,EAAE,eAAeD,aAAmBC,EAAE,aAClE,OAAOU,EAAYX,EAAQ,OAAO,GAAGY,CAAG;CAG1C,OAAOA;AACT;AAGA,SAAgBQ,EAAO,GAAc,GAAe;CAClD,OAAOT,EAAYX,GAASY,CAAG;AACjC;AAEA,SAAgBS,EAAmD,GAAwB;CACzF,OAAOpB,EAAE,YAAY,MAAQU,EAAYW,GAAQV,CAAG,GAAGU,CAAM;AAC/D"}
|