@godxjp/ui 5.0.2 → 6.0.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/README.md +101 -142
- package/dist/app/index.d.ts +140 -0
- package/dist/app/index.js +38 -0
- package/dist/app.prop-IobwLwaM.d.ts +90 -0
- package/dist/checkbox-NkFkqsQ8.d.ts +13 -0
- package/dist/chunk-2XW7J3EI.js +226 -0
- package/dist/chunk-3F2AKYRD.js +416 -0
- package/dist/chunk-3KPEZ5CF.js +37 -0
- package/dist/chunk-3UGU5TYP.js +89 -0
- package/dist/chunk-6RA3KSVK.js +588 -0
- package/dist/chunk-7NZFVD24.js +122 -0
- package/dist/chunk-7PWBC4BY.js +25 -0
- package/dist/chunk-7S7MYFXE.js +61 -0
- package/dist/chunk-7WRZG2IG.js +71 -0
- package/dist/chunk-B775Y6BE.js +1 -0
- package/dist/chunk-BHV2FUOA.js +111 -0
- package/dist/chunk-BI3HERR7.js +70 -0
- package/dist/chunk-BPSKQUL2.js +68 -0
- package/dist/chunk-CDWPQ5RP.js +187 -0
- package/dist/chunk-CP2LET6N.js +244 -0
- package/dist/chunk-CQBADMFG.js +20 -0
- package/dist/chunk-CRERCLIZ.js +33 -0
- package/dist/chunk-DU6ZYZRP.js +238 -0
- package/dist/chunk-DY5C44UP.js +55 -0
- package/dist/chunk-E4HJNQ62.js +117 -0
- package/dist/chunk-E76QIYSY.js +93 -0
- package/dist/chunk-F7PG4OEV.js +37 -0
- package/dist/chunk-GDSVW62T.js +171 -0
- package/dist/chunk-H2FHJOLU.js +178 -0
- package/dist/chunk-HJEBRCXL.js +55 -0
- package/dist/chunk-ICM6XBST.js +16 -0
- package/dist/chunk-IK7I3ABN.js +88 -0
- package/dist/chunk-L6J44O74.js +144 -0
- package/dist/chunk-LDSLS6HE.js +1 -0
- package/dist/chunk-LVNUHUEZ.js +191 -0
- package/dist/chunk-M64MVRLS.js +92 -0
- package/dist/chunk-NGQW3KEM.js +402 -0
- package/dist/chunk-NZ4FOC5N.js +559 -0
- package/dist/chunk-PIIRNAXA.js +26 -0
- package/dist/chunk-S66TJXJU.js +33 -0
- package/dist/chunk-SMLKNECP.js +133 -0
- package/dist/chunk-TAHBM3F2.js +66 -0
- package/dist/chunk-TO33OY4L.js +150 -0
- package/dist/chunk-TO7URV7U.js +51 -0
- package/dist/chunk-TOO5AEKL.js +81 -0
- package/dist/chunk-U3GHAOIJ.js +299 -0
- package/dist/chunk-U7N2A7A3.js +9 -0
- package/dist/chunk-UX634MYF.js +123 -0
- package/dist/chunk-V6UWJKZF.js +28 -0
- package/dist/chunk-VOHTRR5X.js +28 -0
- package/dist/chunk-WRFKVUPW.js +332 -0
- package/dist/chunk-WXW43RK5.js +24 -0
- package/dist/chunk-XG7XDYIM.js +60 -0
- package/dist/chunk-YFCQKO3B.js +842 -0
- package/dist/chunk-ZDWXGWLY.js +73 -0
- package/dist/chunk-ZLK5SPT6.js +11 -0
- package/dist/chunk-ZS6DTAM2.js +31 -0
- package/dist/chunk-ZT5UEUBO.js +1 -0
- package/dist/components/admin/index.d.ts +80 -0
- package/dist/components/admin/index.js +38 -0
- package/dist/components/data-display/badge.d.ts +12 -0
- package/dist/components/data-display/badge.js +3 -0
- package/dist/components/data-display/card.d.ts +87 -0
- package/dist/components/data-display/card.js +2 -0
- package/dist/components/data-display/index.d.ts +72 -0
- package/dist/components/data-display/index.js +89 -0
- package/dist/components/data-display/popover.d.ts +13 -0
- package/dist/components/data-display/popover.js +2 -0
- package/dist/components/data-display/scroll-area.d.ts +7 -0
- package/dist/components/data-display/scroll-area.js +2 -0
- package/dist/components/data-display/table.d.ts +10 -0
- package/dist/components/data-display/table.js +3 -0
- package/dist/components/data-entry/autocomplete.d.ts +16 -0
- package/dist/components/data-entry/autocomplete.js +8 -0
- package/dist/components/data-entry/calendar.d.ts +16 -0
- package/dist/components/data-entry/calendar.js +4 -0
- package/dist/components/data-entry/cascader.d.ts +32 -0
- package/dist/components/data-entry/cascader.js +13 -0
- package/dist/components/data-entry/checkbox.d.ts +13 -0
- package/dist/components/data-entry/checkbox.js +4 -0
- package/dist/components/data-entry/color-picker.d.ts +16 -0
- package/dist/components/data-entry/color-picker.js +6 -0
- package/dist/components/data-entry/command.d.ts +69 -0
- package/dist/components/data-entry/command.js +3 -0
- package/dist/components/data-entry/date-picker.d.ts +16 -0
- package/dist/components/data-entry/date-picker.js +8 -0
- package/dist/components/data-entry/date-range-picker.d.ts +16 -0
- package/dist/components/data-entry/date-range-picker.js +8 -0
- package/dist/components/data-entry/index.d.ts +53 -0
- package/dist/components/data-entry/index.js +152 -0
- package/dist/components/data-entry/input.d.ts +6 -0
- package/dist/components/data-entry/input.js +2 -0
- package/dist/components/data-entry/label.d.ts +8 -0
- package/dist/components/data-entry/label.js +2 -0
- package/dist/components/data-entry/radio.d.ts +24 -0
- package/dist/components/data-entry/radio.js +4 -0
- package/dist/components/data-entry/select.d.ts +18 -0
- package/dist/components/data-entry/select.js +3 -0
- package/dist/components/data-entry/slider.d.ts +16 -0
- package/dist/components/data-entry/slider.js +2 -0
- package/dist/components/data-entry/switch.d.ts +17 -0
- package/dist/components/data-entry/switch.js +2 -0
- package/dist/components/data-entry/textarea.d.ts +6 -0
- package/dist/components/data-entry/textarea.js +3 -0
- package/dist/components/data-entry/time-picker.d.ts +16 -0
- package/dist/components/data-entry/time-picker.js +7 -0
- package/dist/components/data-entry/transfer.d.ts +17 -0
- package/dist/components/data-entry/transfer.js +11 -0
- package/dist/components/data-entry/tree-select.d.ts +26 -0
- package/dist/components/data-entry/tree-select.js +13 -0
- package/dist/components/data-entry/upload.d.ts +42 -0
- package/dist/components/data-entry/upload.js +11 -0
- package/dist/components/feedback/alert.d.ts +60 -0
- package/dist/components/feedback/alert.js +7 -0
- package/dist/components/feedback/dialog.d.ts +64 -0
- package/dist/components/feedback/dialog.js +7 -0
- package/dist/components/feedback/index.d.ts +16 -0
- package/dist/components/feedback/index.js +14 -0
- package/dist/components/feedback/sheet.d.ts +24 -0
- package/dist/components/feedback/sheet.js +2 -0
- package/dist/components/feedback/sonner.d.ts +6 -0
- package/dist/components/feedback/sonner.js +1 -0
- package/dist/components/general/button.d.ts +20 -0
- package/dist/components/general/button.js +2 -0
- package/dist/components/general/index.d.ts +6 -0
- package/dist/components/general/index.js +2 -0
- package/dist/components/layout/index.d.ts +71 -0
- package/dist/components/layout/index.js +5 -0
- package/dist/components/navigation/dropdown-menu.d.ts +28 -0
- package/dist/components/navigation/dropdown-menu.js +2 -0
- package/dist/components/navigation/index.d.ts +32 -0
- package/dist/components/navigation/index.js +12 -0
- package/dist/components/navigation/pagination.d.ts +11 -0
- package/dist/components/navigation/pagination.js +7 -0
- package/dist/components/navigation/steps.d.ts +12 -0
- package/dist/components/navigation/steps.js +3 -0
- package/dist/components/navigation/tabs-items.d.ts +12 -0
- package/dist/components/navigation/tabs-items.js +3 -0
- package/dist/components/navigation/tabs.d.ts +12 -0
- package/dist/components/navigation/tabs.js +2 -0
- package/dist/components/query/index.d.ts +43 -0
- package/dist/components/query/index.js +8 -0
- package/dist/components/ui/index.d.ts +57 -0
- package/dist/components/ui/index.js +37 -0
- package/dist/content.prop-D1Dd3TAc.d.ts +31 -0
- package/dist/data-display.prop-DNTAzmDy.d.ts +58 -0
- package/dist/data-entry.prop-BEGA1lTq.d.ts +323 -0
- package/dist/data-table-D1u_rKLK.d.ts +83 -0
- package/dist/data.prop-BVvfKC_g.d.ts +41 -0
- package/dist/feedback.prop-BmxUlpAW.d.ts +64 -0
- package/dist/filter-bar-B7OGFO9S.d.ts +10 -0
- package/dist/form/index.d.ts +21 -0
- package/dist/form/index.js +4 -0
- package/dist/form.prop-BHgpuFFm.d.ts +41 -0
- package/dist/format-date-ByyZoqI5.d.ts +51 -0
- package/dist/general.prop-D7brMPNL.d.ts +16 -0
- package/dist/i18n/index.d.ts +217 -0
- package/dist/i18n/index.js +2 -0
- package/dist/index.d.ts +46 -26
- package/dist/index.js +39 -13062
- package/dist/inline-C5u6ptJV.d.ts +10 -0
- package/dist/interaction.prop-Cdn7wOtq.d.ts +25 -0
- package/dist/layout.prop-4TCNvyQZ.d.ts +20 -0
- package/dist/layout.prop-C795F0qg.d.ts +112 -0
- package/dist/lib/datetime/index.d.ts +31 -0
- package/dist/lib/datetime/index.js +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +1 -0
- package/dist/navigation.prop-DpZqcXey.d.ts +78 -0
- package/dist/navigation.prop-DxBiClEH.d.ts +20 -0
- package/dist/props/components/index.d.ts +27 -0
- package/dist/props/components/index.js +1 -0
- package/dist/props/index.d.ts +28 -0
- package/dist/props/index.js +3 -0
- package/dist/props/registry.d.ts +649 -0
- package/dist/props/registry.js +1 -0
- package/dist/props/vocabulary/index.d.ts +7 -0
- package/dist/props/vocabulary/index.js +1 -0
- package/dist/query.prop-hIPrk2zI.d.ts +71 -0
- package/dist/search-input-uP01rY1L.d.ts +22 -0
- package/dist/shared.prop-BNRJc9K0.d.ts +45 -0
- package/dist/styles/alert-layout.css +191 -0
- package/dist/styles/badge-layout.css +22 -0
- package/dist/styles/card-layout.css +373 -0
- package/dist/styles/control.css +504 -0
- package/dist/styles/data-display-layout.css +246 -0
- package/dist/styles/density.css +43 -0
- package/dist/styles/dialog-layout.css +84 -0
- package/dist/styles/index.css +105 -0
- package/dist/styles/layout.css +479 -0
- package/dist/styles/shell-layout.css +604 -0
- package/dist/styles/table-layout.css +109 -0
- package/dist/theme/example.service.css +37 -0
- package/dist/tokens/base.css +13 -0
- package/dist/tokens/foundation.css +151 -0
- package/dist/tokens/primitives/badge.css +13 -0
- package/dist/tokens/primitives/card.css +29 -0
- package/dist/tokens/primitives/control.css +55 -0
- package/dist/tokens/primitives/feedback.css +17 -0
- package/dist/tokens/primitives/layout.css +20 -0
- package/dist/tokens/primitives/navigation.css +13 -0
- package/dist/tokens/primitives/table.css +10 -0
- package/dist/types-mvzYGrma.d.ts +37 -0
- package/dist/use-toast-Dol5bdY3.d.ts +34 -0
- package/package.json +279 -117
- package/scripts/ui-audit.mjs +179 -0
- package/BRAND.md +0 -296
- package/CHANGELOG.md +0 -668
- package/config/eslint.js +0 -54
- package/config/prettier.cjs +0 -20
- package/config/tsconfig.base.json +0 -22
- package/config/vitest.base.ts +0 -26
- package/dist/MiniMonth-YAmPGEpC.d.ts +0 -143
- package/dist/Table.types-BbsxoIYE.d.ts +0 -352
- package/dist/color-DO0qqUAb.d.ts +0 -38
- package/dist/components/composites.d.ts +0 -963
- package/dist/components/composites.js +0 -7343
- package/dist/components/composites.js.map +0 -1
- package/dist/components/primitives.d.ts +0 -2744
- package/dist/components/primitives.js +0 -7356
- package/dist/components/primitives.js.map +0 -1
- package/dist/components/shell.d.ts +0 -182
- package/dist/components/shell.js +0 -774
- package/dist/components/shell.js.map +0 -1
- package/dist/hooks.d.ts +0 -100
- package/dist/hooks.js +0 -558
- package/dist/hooks.js.map +0 -1
- package/dist/i18n.d.ts +0 -61
- package/dist/i18n.js +0 -860
- package/dist/i18n.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/padding-DY0JV5Ja.d.ts +0 -16
- package/dist/preferences.d.ts +0 -132
- package/dist/preferences.js +0 -262
- package/dist/preferences.js.map +0 -1
- package/dist/props.d.ts +0 -86
- package/dist/props.js +0 -16
- package/dist/props.js.map +0 -1
- package/dist/size-CQwNvOWd.d.ts +0 -19
- package/dist/types-LTj-2bl-.d.ts +0 -30
- package/dist/useTableViews-D5NIAJ7h.d.ts +0 -154
- package/src/tokens/tailwind.css +0 -158
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { Input } from './chunk-VOHTRR5X.js';
|
|
2
|
+
import { buttonVariants, Button } from './chunk-HJEBRCXL.js';
|
|
3
|
+
import { Label } from './chunk-7PWBC4BY.js';
|
|
4
|
+
import { useTranslation } from './chunk-3F2AKYRD.js';
|
|
5
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
8
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
9
|
+
import { X } from 'lucide-react';
|
|
10
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var DialogModeContext = React.createContext("form");
|
|
13
|
+
function useDialogMode() {
|
|
14
|
+
return React.useContext(DialogModeContext);
|
|
15
|
+
}
|
|
16
|
+
function DialogRoot({ mode = "form", ...props }) {
|
|
17
|
+
if (mode === "confirm") {
|
|
18
|
+
return /* @__PURE__ */ jsx(DialogModeContext.Provider, { value: "confirm", children: /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, { "data-slot": "dialog", ...props }) });
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx(DialogModeContext.Provider, { value: "form", children: /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props }) });
|
|
21
|
+
}
|
|
22
|
+
function DialogTrigger(props) {
|
|
23
|
+
const mode = useDialogMode();
|
|
24
|
+
if (mode === "confirm") {
|
|
25
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
|
|
28
|
+
}
|
|
29
|
+
function DialogPortal(props) {
|
|
30
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
31
|
+
}
|
|
32
|
+
function DialogClose(props) {
|
|
33
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
|
|
34
|
+
}
|
|
35
|
+
var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
36
|
+
DialogPrimitive.Overlay,
|
|
37
|
+
{
|
|
38
|
+
ref,
|
|
39
|
+
"data-slot": "dialog-overlay",
|
|
40
|
+
className: cn(
|
|
41
|
+
"ui-dialog-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
...props
|
|
45
|
+
}
|
|
46
|
+
));
|
|
47
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
48
|
+
var DialogContent = React.forwardRef(({ className, children, showClose, showCloseButton: showCloseButtonProp, ...props }, ref) => {
|
|
49
|
+
const mode = useDialogMode();
|
|
50
|
+
if (mode === "confirm") {
|
|
51
|
+
return /* @__PURE__ */ jsxs(AlertDialogPrimitive.Portal, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
AlertDialogPrimitive.Overlay,
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "dialog-overlay",
|
|
56
|
+
className: "ui-dialog-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ jsx(
|
|
60
|
+
AlertDialogPrimitive.Content,
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
"data-slot": "dialog-content",
|
|
64
|
+
className: cn(
|
|
65
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 duration-200 outline-none",
|
|
66
|
+
className
|
|
67
|
+
),
|
|
68
|
+
...props,
|
|
69
|
+
children
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] });
|
|
73
|
+
}
|
|
74
|
+
const showCloseButton = showCloseButtonProp ?? showClose ?? true;
|
|
75
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
76
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
77
|
+
/* @__PURE__ */ jsxs(
|
|
78
|
+
DialogPrimitive.Content,
|
|
79
|
+
{
|
|
80
|
+
ref,
|
|
81
|
+
"data-slot": "dialog-content",
|
|
82
|
+
className: cn(
|
|
83
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 duration-200 outline-none",
|
|
84
|
+
className
|
|
85
|
+
),
|
|
86
|
+
...props,
|
|
87
|
+
children: [
|
|
88
|
+
children,
|
|
89
|
+
showCloseButton ? /* @__PURE__ */ jsxs(
|
|
90
|
+
DialogPrimitive.Close,
|
|
91
|
+
{
|
|
92
|
+
"data-slot": "dialog-close",
|
|
93
|
+
className: "ring-offset-background focus:ring-ring transition-opacity focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" }),
|
|
96
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
) : null
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] });
|
|
104
|
+
});
|
|
105
|
+
DialogContent.displayName = "DialogContent";
|
|
106
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "dialog-header", className, ...props });
|
|
107
|
+
DialogHeader.displayName = "DialogHeader";
|
|
108
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "dialog-footer", className, ...props });
|
|
109
|
+
DialogFooter.displayName = "DialogFooter";
|
|
110
|
+
var DialogTitle = React.forwardRef(({ className, ...props }, ref) => {
|
|
111
|
+
const mode = useDialogMode();
|
|
112
|
+
const cls = cn(className);
|
|
113
|
+
if (mode === "confirm") {
|
|
114
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, { ref, "data-slot": "dialog-title", className: cls, ...props });
|
|
115
|
+
}
|
|
116
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ref, "data-slot": "dialog-title", className: cls, ...props });
|
|
117
|
+
});
|
|
118
|
+
DialogTitle.displayName = "DialogTitle";
|
|
119
|
+
var DialogDescription = React.forwardRef(({ className, ...props }, ref) => {
|
|
120
|
+
const mode = useDialogMode();
|
|
121
|
+
const cls = cn(className);
|
|
122
|
+
if (mode === "confirm") {
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
124
|
+
AlertDialogPrimitive.Description,
|
|
125
|
+
{
|
|
126
|
+
ref,
|
|
127
|
+
"data-slot": "dialog-description",
|
|
128
|
+
className: cls,
|
|
129
|
+
...props
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
DialogPrimitive.Description,
|
|
135
|
+
{
|
|
136
|
+
ref,
|
|
137
|
+
"data-slot": "dialog-description",
|
|
138
|
+
className: cls,
|
|
139
|
+
...props
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
DialogDescription.displayName = "DialogDescription";
|
|
144
|
+
var DialogAction = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, { ref, className: cn(buttonVariants(), className), ...props }));
|
|
145
|
+
DialogAction.displayName = "DialogAction";
|
|
146
|
+
var DialogCancel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
147
|
+
AlertDialogPrimitive.Cancel,
|
|
148
|
+
{
|
|
149
|
+
ref,
|
|
150
|
+
className: cn(buttonVariants({ variant: "outline" }), className),
|
|
151
|
+
...props
|
|
152
|
+
}
|
|
153
|
+
));
|
|
154
|
+
DialogCancel.displayName = "DialogCancel";
|
|
155
|
+
function DialogConfirm({
|
|
156
|
+
open,
|
|
157
|
+
onOpenChange,
|
|
158
|
+
title,
|
|
159
|
+
description,
|
|
160
|
+
confirmLabel,
|
|
161
|
+
cancelLabel,
|
|
162
|
+
variant = "default",
|
|
163
|
+
confirmPhrase,
|
|
164
|
+
onConfirm,
|
|
165
|
+
keepOpenOnConfirm = false,
|
|
166
|
+
pending = false
|
|
167
|
+
}) {
|
|
168
|
+
const { t } = useTranslation();
|
|
169
|
+
const [typed, setTyped] = React.useState("");
|
|
170
|
+
const inputId = React.useId();
|
|
171
|
+
const needsPhrase = confirmPhrase != null && confirmPhrase.length > 0;
|
|
172
|
+
const phraseMatches = !needsPhrase || typed === confirmPhrase;
|
|
173
|
+
const effectiveVariant = needsPhrase ? "destructive" : variant;
|
|
174
|
+
const resolvedConfirm = confirmLabel ?? (needsPhrase ? t("common.delete") : t("common.continue"));
|
|
175
|
+
const resolvedCancel = cancelLabel ?? t("common.cancel");
|
|
176
|
+
const handleOpenChange = (next) => {
|
|
177
|
+
setTyped("");
|
|
178
|
+
onOpenChange(next);
|
|
179
|
+
};
|
|
180
|
+
const handleConfirm = () => {
|
|
181
|
+
if (!phraseMatches) return;
|
|
182
|
+
void (async () => {
|
|
183
|
+
await onConfirm();
|
|
184
|
+
if (!keepOpenOnConfirm) onOpenChange(false);
|
|
185
|
+
})();
|
|
186
|
+
};
|
|
187
|
+
return /* @__PURE__ */ jsx(DialogRoot, { mode: "confirm", open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
188
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
189
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
190
|
+
description ? /* @__PURE__ */ jsx(DialogDescription, { children: description }) : null
|
|
191
|
+
] }),
|
|
192
|
+
needsPhrase && /* @__PURE__ */ jsxs("div", { className: "ui-stack-xs", children: [
|
|
193
|
+
/* @__PURE__ */ jsx(Label, { htmlFor: inputId, className: "text-sm", children: t("common.typeToConfirm", { phrase: confirmPhrase }) }),
|
|
194
|
+
/* @__PURE__ */ jsx(
|
|
195
|
+
Input,
|
|
196
|
+
{
|
|
197
|
+
id: inputId,
|
|
198
|
+
value: typed,
|
|
199
|
+
onChange: (e) => {
|
|
200
|
+
setTyped(e.target.value);
|
|
201
|
+
},
|
|
202
|
+
autoComplete: "off",
|
|
203
|
+
spellCheck: false,
|
|
204
|
+
placeholder: confirmPhrase,
|
|
205
|
+
"aria-required": "true"
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
] }),
|
|
209
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
210
|
+
/* @__PURE__ */ jsx(DialogCancel, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "ghost", disabled: pending, children: resolvedCancel }) }),
|
|
211
|
+
/* @__PURE__ */ jsx(
|
|
212
|
+
Button,
|
|
213
|
+
{
|
|
214
|
+
variant: effectiveVariant === "destructive" ? "destructive" : "default",
|
|
215
|
+
onClick: handleConfirm,
|
|
216
|
+
disabled: pending || !phraseMatches,
|
|
217
|
+
children: pending ? t("common.working") : resolvedConfirm
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] })
|
|
221
|
+
] }) });
|
|
222
|
+
}
|
|
223
|
+
var Dialog = Object.assign(DialogRoot, {
|
|
224
|
+
Trigger: DialogTrigger,
|
|
225
|
+
Portal: DialogPortal,
|
|
226
|
+
Overlay: DialogOverlay,
|
|
227
|
+
Content: DialogContent,
|
|
228
|
+
Header: DialogHeader,
|
|
229
|
+
Footer: DialogFooter,
|
|
230
|
+
Title: DialogTitle,
|
|
231
|
+
Description: DialogDescription,
|
|
232
|
+
Close: DialogClose,
|
|
233
|
+
Action: DialogAction,
|
|
234
|
+
Cancel: DialogCancel,
|
|
235
|
+
Confirm: DialogConfirm
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
export { Dialog, DialogAction, DialogCancel, DialogClose, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function Popover(props) {
|
|
7
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
8
|
+
}
|
|
9
|
+
function PopoverTrigger(props) {
|
|
10
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
11
|
+
}
|
|
12
|
+
function PopoverAnchor(props) {
|
|
13
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
14
|
+
}
|
|
15
|
+
var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
16
|
+
PopoverPrimitive.Content,
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
"data-slot": "popover-content",
|
|
20
|
+
align,
|
|
21
|
+
sideOffset,
|
|
22
|
+
className: cn(
|
|
23
|
+
"bg-popover text-popover-foreground z-50 w-72 origin-[var(--radix-popover-content-transform-origin)] rounded-md border p-4 shadow-md outline-none",
|
|
24
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
25
|
+
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
26
|
+
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",
|
|
27
|
+
"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
) }));
|
|
33
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
34
|
+
var PopoverHeader = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
"data-slot": "popover-header",
|
|
38
|
+
className: cn("flex flex-col gap-1 text-sm", className),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
var PopoverTitle = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "popover-title", className: cn("font-medium", className), ...props });
|
|
43
|
+
var PopoverDescription = ({
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}) => /* @__PURE__ */ jsx(
|
|
47
|
+
"p",
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "popover-description",
|
|
50
|
+
className: cn("text-muted-foreground", className),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { humanError } from './chunk-7S7MYFXE.js';
|
|
2
|
+
import { Inline } from './chunk-S66TJXJU.js';
|
|
3
|
+
import { Button } from './chunk-HJEBRCXL.js';
|
|
4
|
+
import { useTranslation } from './chunk-3F2AKYRD.js';
|
|
5
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { CheckCircle2, TriangleAlert, AlertCircle, Info, X, RefreshCw } from 'lucide-react';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
|
+
|
|
10
|
+
var AlertContext = React.createContext("default");
|
|
11
|
+
var DEFAULT_ICONS = {
|
|
12
|
+
default: Info,
|
|
13
|
+
destructive: AlertCircle,
|
|
14
|
+
warning: TriangleAlert,
|
|
15
|
+
success: CheckCircle2
|
|
16
|
+
};
|
|
17
|
+
var AlertBase = React.forwardRef(
|
|
18
|
+
({ variant = "default", icon, onDismiss, className, children, ...props }, ref) => {
|
|
19
|
+
const IconComponent = icon === false ? null : icon ?? DEFAULT_ICONS[variant];
|
|
20
|
+
return /* @__PURE__ */ jsx(AlertContext.Provider, { value: variant, children: /* @__PURE__ */ jsxs(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
role: "alert",
|
|
25
|
+
"data-slot": "alert",
|
|
26
|
+
"data-variant": variant,
|
|
27
|
+
"data-dismissible": onDismiss ? "" : void 0,
|
|
28
|
+
className,
|
|
29
|
+
...props,
|
|
30
|
+
children: [
|
|
31
|
+
IconComponent && /* @__PURE__ */ jsx(IconComponent, { "data-slot": "alert-icon", "data-variant": variant, "aria-hidden": "true" }),
|
|
32
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "alert-body", children }),
|
|
33
|
+
onDismiss && /* @__PURE__ */ jsx(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
onClick: () => {
|
|
38
|
+
void onDismiss();
|
|
39
|
+
},
|
|
40
|
+
"data-slot": "alert-dismiss",
|
|
41
|
+
className: "ring-offset-background focus-visible:ring-ring transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
|
|
42
|
+
"aria-label": "Dismiss",
|
|
43
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" })
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
) });
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
AlertBase.displayName = "Alert";
|
|
52
|
+
var AlertTitle = React.forwardRef(
|
|
53
|
+
({ className, ...props }, ref) => {
|
|
54
|
+
const variant = React.useContext(AlertContext);
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"p",
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
"data-slot": "alert-title",
|
|
60
|
+
"data-variant": variant,
|
|
61
|
+
className,
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
AlertTitle.displayName = "AlertTitle";
|
|
68
|
+
var AlertContent = React.forwardRef(
|
|
69
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
"data-slot": "alert-content",
|
|
74
|
+
className: cn("min-w-0 flex-1", className),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
AlertContent.displayName = "AlertContent";
|
|
80
|
+
var AlertDescription = React.forwardRef(
|
|
81
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, "data-slot": "alert-description", className, ...props })
|
|
82
|
+
);
|
|
83
|
+
AlertDescription.displayName = "AlertDescription";
|
|
84
|
+
var AlertActions = React.forwardRef(
|
|
85
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "data-slot": "alert-actions", className, ...props })
|
|
86
|
+
);
|
|
87
|
+
AlertActions.displayName = "AlertActions";
|
|
88
|
+
function AlertQueryError({ error, onRetry, className }) {
|
|
89
|
+
const { t } = useTranslation();
|
|
90
|
+
return /* @__PURE__ */ jsxs(Alert, { variant: "destructive", className, children: [
|
|
91
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: t("common.error") }),
|
|
92
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: humanError(error) }),
|
|
93
|
+
onRetry && /* @__PURE__ */ jsx(AlertActions, { children: /* @__PURE__ */ jsx(
|
|
94
|
+
Button,
|
|
95
|
+
{
|
|
96
|
+
variant: "outline",
|
|
97
|
+
size: "sm",
|
|
98
|
+
onClick: () => {
|
|
99
|
+
void onRetry();
|
|
100
|
+
},
|
|
101
|
+
children: /* @__PURE__ */ jsxs(Inline, { gap: "xs", children: [
|
|
102
|
+
/* @__PURE__ */ jsx(RefreshCw, { className: "size-4", "aria-hidden": "true" }),
|
|
103
|
+
t("common.retry")
|
|
104
|
+
] })
|
|
105
|
+
}
|
|
106
|
+
) })
|
|
107
|
+
] });
|
|
108
|
+
}
|
|
109
|
+
var Alert = Object.assign(AlertBase, {
|
|
110
|
+
Title: AlertTitle,
|
|
111
|
+
Content: AlertContent,
|
|
112
|
+
Description: AlertDescription,
|
|
113
|
+
Actions: AlertActions,
|
|
114
|
+
QueryError: AlertQueryError
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export { Alert, AlertActions, AlertBase, AlertContent, AlertDescription, AlertQueryError, AlertTitle };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ChoiceField, choiceGroupClassName } from './chunk-CQBADMFG.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
+
import { Check } from 'lucide-react';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function useControllableArray(controlled, defaultValue) {
|
|
9
|
+
const [internal, setInternal] = React.useState(defaultValue);
|
|
10
|
+
const value = controlled ?? internal;
|
|
11
|
+
const setValue = React.useCallback(
|
|
12
|
+
(next) => {
|
|
13
|
+
if (controlled === void 0) setInternal(next);
|
|
14
|
+
},
|
|
15
|
+
[controlled]
|
|
16
|
+
);
|
|
17
|
+
return [value, setValue];
|
|
18
|
+
}
|
|
19
|
+
function CheckboxGroup({
|
|
20
|
+
value: controlledValue,
|
|
21
|
+
defaultValue = [],
|
|
22
|
+
onChange,
|
|
23
|
+
options,
|
|
24
|
+
orientation = "vertical",
|
|
25
|
+
disabled,
|
|
26
|
+
name,
|
|
27
|
+
className,
|
|
28
|
+
children
|
|
29
|
+
}) {
|
|
30
|
+
const reactId = React.useId();
|
|
31
|
+
const [value, setValue] = useControllableArray(controlledValue, defaultValue);
|
|
32
|
+
const toggle = (optionValue) => {
|
|
33
|
+
const next = value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue];
|
|
34
|
+
setValue(next);
|
|
35
|
+
onChange?.(next);
|
|
36
|
+
};
|
|
37
|
+
if (options && options.length > 0) {
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
role: "group",
|
|
42
|
+
"aria-disabled": disabled ? true : void 0,
|
|
43
|
+
"data-orientation": orientation,
|
|
44
|
+
className: choiceGroupClassName(orientation, className),
|
|
45
|
+
children: options.map((opt, index) => {
|
|
46
|
+
const id = `${reactId}-${opt.value}-${index}`;
|
|
47
|
+
const checked = value.includes(opt.value);
|
|
48
|
+
return /* @__PURE__ */ jsx(ChoiceField, { id, label: opt.label, description: opt.description, children: /* @__PURE__ */ jsx(
|
|
49
|
+
Checkbox,
|
|
50
|
+
{
|
|
51
|
+
id,
|
|
52
|
+
name,
|
|
53
|
+
value: opt.value,
|
|
54
|
+
checked,
|
|
55
|
+
disabled: Boolean(disabled) || Boolean(opt.disabled),
|
|
56
|
+
onCheckedChange: () => {
|
|
57
|
+
toggle(opt.value);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
) }, opt.value);
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
role: "group",
|
|
69
|
+
"data-orientation": orientation,
|
|
70
|
+
className: cn(choiceGroupClassName(orientation), className),
|
|
71
|
+
children
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
var CheckboxRoot = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
76
|
+
CheckboxPrimitive.Root,
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
"data-slot": "checkbox",
|
|
80
|
+
className: cn(
|
|
81
|
+
"peer ui-checkbox focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground shrink-0 shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
82
|
+
className
|
|
83
|
+
),
|
|
84
|
+
...props,
|
|
85
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "ui-choice-indicator", children: /* @__PURE__ */ jsx(Check, { className: "ui-checkbox-icon", "aria-hidden": "true" }) })
|
|
86
|
+
}
|
|
87
|
+
));
|
|
88
|
+
CheckboxRoot.displayName = CheckboxPrimitive.Root.displayName;
|
|
89
|
+
var Checkbox = Object.assign(CheckboxRoot, {
|
|
90
|
+
Group: CheckboxGroup
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export { Checkbox, CheckboxGroup };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Label } from './chunk-7PWBC4BY.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function FormField({
|
|
7
|
+
id,
|
|
8
|
+
label,
|
|
9
|
+
required,
|
|
10
|
+
helper,
|
|
11
|
+
error,
|
|
12
|
+
labelAddon,
|
|
13
|
+
className,
|
|
14
|
+
children
|
|
15
|
+
}) {
|
|
16
|
+
const helperId = helper && !error ? `${id}-helper` : void 0;
|
|
17
|
+
const errorId = error ? `${id}-error` : void 0;
|
|
18
|
+
const describedBy = errorId ?? helperId;
|
|
19
|
+
const childWithA11y = React.isValidElement(children) ? React.cloneElement(children, {
|
|
20
|
+
"aria-describedby": describedBy,
|
|
21
|
+
"aria-required": required ? true : void 0,
|
|
22
|
+
"aria-invalid": !!error || void 0
|
|
23
|
+
}) : children;
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ui-stack-sm", className), children: [
|
|
25
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
26
|
+
/* @__PURE__ */ jsxs(Label, { htmlFor: id, className: "ui-inline-xs", children: [
|
|
27
|
+
/* @__PURE__ */ jsx("span", { children: label }),
|
|
28
|
+
required && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "text-destructive", children: "*" })
|
|
29
|
+
] }),
|
|
30
|
+
labelAddon
|
|
31
|
+
] }),
|
|
32
|
+
childWithA11y,
|
|
33
|
+
error ? /* @__PURE__ */ jsx("p", { id: errorId, role: "alert", className: "text-destructive text-xs", children: error }) : helper ? /* @__PURE__ */ jsx("p", { id: helperId, className: "text-muted-foreground text-xs", children: helper }) : null
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { FormField };
|