@godxjp/ui 9.2.0 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -29
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +4 -4
- package/dist/{app.prop-UTc4j4nj.d.ts → app.prop-Cy6dJnU8.d.ts} +18 -40
- package/dist/{checkbox-ChRsR7Nk.d.ts → checkbox-em-oFM5D.d.ts} +1 -1
- package/dist/{chunk-LJLGABFV.js → chunk-2HXZT2WJ.js} +17 -9
- package/dist/{chunk-QLMXEJSY.js → chunk-3Q4A4U2P.js} +24 -1
- package/dist/{chunk-26CPAKUP.js → chunk-44YRPSZ7.js} +1 -2
- package/dist/{chunk-HB2OHB5X.js → chunk-5NCFLCM7.js} +27 -16
- package/dist/{chunk-FXFJF4YA.js → chunk-6CSBMMZS.js} +262 -31
- package/dist/{chunk-E7HBHUJY.js → chunk-6HHSU6RG.js} +8 -6
- package/dist/{chunk-457KVJTX.js → chunk-7Q45MBFW.js} +7 -5
- package/dist/{chunk-O24Z3ULJ.js → chunk-BE6GJGKJ.js} +1 -1
- package/dist/{chunk-FVPCVZL3.js → chunk-BG5RNXTH.js} +1 -1
- package/dist/{chunk-AINW5WYN.js → chunk-COD66MFF.js} +1 -2
- package/dist/{chunk-IOGU3ZWF.js → chunk-DNGJHWJZ.js} +3 -3
- package/dist/{chunk-3TS3G4U3.js → chunk-EE5DKOHX.js} +3 -1
- package/dist/{chunk-G6Q32VHO.js → chunk-EQZP53KI.js} +33 -8
- package/dist/{chunk-BHV2FUOA.js → chunk-EZHHJQWQ.js} +1 -1
- package/dist/{chunk-N3JPLJ3B.js → chunk-GDDCSKCB.js} +12 -5
- package/dist/{chunk-RLGHEV4A.js → chunk-HTG5VHU7.js} +10 -1
- package/dist/{chunk-R2W2FX5Q.js → chunk-I7NQ2LIL.js} +1 -9
- package/dist/{chunk-XQMPK4GM.js → chunk-IHRMOJXD.js} +86 -39
- package/dist/{chunk-TILFZBTE.js → chunk-INIIF7F7.js} +1 -4
- package/dist/{chunk-UIYEAUWA.js → chunk-IY347EQA.js} +2 -2
- package/dist/{chunk-HCM4JAC2.js → chunk-JWGLJXQU.js} +39 -11
- package/dist/{chunk-TO33OY4L.js → chunk-LMKUKCTN.js} +1 -1
- package/dist/chunk-NXVCI6YB.js +453 -0
- package/dist/{chunk-S6TBIL7J.js → chunk-O6DQZYNI.js} +63 -44
- package/dist/{chunk-O2OUNXV4.js → chunk-P5KPCT6R.js} +3 -3
- package/dist/{chunk-6HQMUUQW.js → chunk-PDXFQS7M.js} +14 -30
- package/dist/{chunk-F7PG4OEV.js → chunk-QSGW3ZWK.js} +12 -4
- package/dist/{chunk-25RYBC5T.js → chunk-S2IJKT3D.js} +1 -1
- package/dist/{chunk-OJZ6C2HM.js → chunk-SARQRCKO.js} +54 -48
- package/dist/chunk-T2QO2S65.js +126 -0
- package/dist/{chunk-26WDEDWL.js → chunk-TGNBXS7H.js} +32 -23
- package/dist/{chunk-6J7GRCDA.js → chunk-UNVRNJCB.js} +71 -11
- package/dist/{chunk-6YBYAEXD.js → chunk-VSM44AYE.js} +94 -24
- package/dist/{chunk-QWLXN6CT.js → chunk-VSUYVT2Q.js} +3 -2
- package/dist/{chunk-4R7QL3MW.js → chunk-X2VY4MOW.js} +14 -29
- package/dist/{chunk-ETLAI3QU.js → chunk-Z46J47FY.js} +73 -77
- package/dist/components/admin/index.d.ts +22 -12
- package/dist/components/admin/index.js +23 -24
- package/dist/components/data-display/badge.js +3 -3
- package/dist/components/data-display/card.d.ts +3 -3
- package/dist/components/data-display/card.js +1 -1
- package/dist/components/data-display/carousel.js +3 -1
- package/dist/components/data-display/index.js +54 -32
- package/dist/components/data-entry/calendar.d.ts +1 -1
- package/dist/components/data-entry/calendar.js +1 -1
- package/dist/components/data-entry/cascader.d.ts +1 -1
- package/dist/components/data-entry/cascader.js +5 -5
- package/dist/components/data-entry/checkbox.d.ts +2 -2
- package/dist/components/data-entry/checkbox.js +2 -2
- package/dist/components/data-entry/color-picker.d.ts +1 -1
- package/dist/components/data-entry/color-picker.js +3 -3
- package/dist/components/data-entry/date-picker.d.ts +2 -2
- package/dist/components/data-entry/date-picker.js +4 -4
- package/dist/components/data-entry/date-range-picker.d.ts +2 -2
- package/dist/components/data-entry/date-range-picker.js +4 -4
- package/dist/components/data-entry/index.d.ts +9 -25
- package/dist/components/data-entry/index.js +22 -26
- package/dist/components/data-entry/radio.d.ts +1 -1
- package/dist/components/data-entry/radio.js +2 -2
- package/dist/components/data-entry/select.d.ts +2 -2
- package/dist/components/data-entry/select.js +3 -4
- package/dist/components/data-entry/slider.d.ts +1 -1
- package/dist/components/data-entry/switch.d.ts +2 -2
- package/dist/components/data-entry/switch.js +1 -1
- package/dist/components/data-entry/time-input.js +2 -2
- package/dist/components/data-entry/time-picker.d.ts +3 -1
- package/dist/components/data-entry/time-picker.js +3 -3
- package/dist/components/data-entry/transfer.d.ts +2 -2
- package/dist/components/data-entry/transfer.js +5 -5
- package/dist/components/data-entry/tree-select.d.ts +1 -1
- package/dist/components/data-entry/tree-select.js +5 -5
- package/dist/components/data-entry/upload.d.ts +2 -2
- package/dist/components/data-entry/upload.js +5 -5
- package/dist/components/feedback/alert.js +5 -5
- package/dist/components/feedback/dialog.js +3 -3
- package/dist/components/feedback/index.d.ts +1 -1
- package/dist/components/feedback/index.js +8 -8
- package/dist/components/feedback/sheet.js +1 -1
- package/dist/components/layout/index.d.ts +6 -9
- package/dist/components/layout/index.js +5 -3
- package/dist/components/navigation/dropdown-menu.js +1 -1
- package/dist/components/navigation/index.d.ts +14 -16
- package/dist/components/navigation/index.js +7 -8
- package/dist/components/navigation/pagination.d.ts +11 -8
- package/dist/components/navigation/pagination.js +4 -5
- package/dist/components/navigation/steps.d.ts +3 -3
- package/dist/components/navigation/steps.js +3 -1
- package/dist/components/query/index.d.ts +1 -5
- package/dist/components/query/index.js +6 -8
- package/dist/components/ui/index.d.ts +5 -7
- package/dist/components/ui/index.js +26 -29
- package/dist/{data-entry.prop-CDkOajPj.d.ts → data-entry.prop-BR4vNA1j.d.ts} +7 -35
- package/dist/filter-bar-BxjSJJnQ.d.ts +7 -0
- package/dist/{inline-CDSVAN54.d.ts → flex-D_EXRFSW.d.ts} +2 -8
- package/dist/form/index.js +1 -1
- package/dist/i18n/index.d.ts +82 -10
- package/dist/i18n/index.js +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +34 -37
- package/dist/lib/datetime/index.js +1 -1
- package/dist/{navigation.prop-8DgElO0c.d.ts → navigation.prop-DMcXkR-J.d.ts} +9 -11
- package/dist/{password-strength-kQkloEeo.d.ts → password-strength-DVRvXEOK.d.ts} +2 -2
- package/dist/props/components/index.d.ts +3 -3
- package/dist/props/index.d.ts +3 -3
- package/dist/props/index.js +1 -1
- package/dist/props/registry.d.ts +84 -39
- package/dist/props/registry.js +1 -1
- package/dist/{search-input-cezAxpgb.d.ts → search-input-DpqDMXcn.d.ts} +2 -4
- package/dist/{skeleton-uWAjSacg.d.ts → skeleton-cj9kh5wo.d.ts} +1 -3
- package/dist/styles/control.css +176 -41
- package/dist/styles/data-display-layout.css +41 -15
- package/dist/styles/feedback-layout.css +44 -12
- package/dist/styles/index.css +45 -1
- package/dist/styles/layout.css +18 -17
- package/dist/styles/navigation-layout.css +3 -1
- package/dist/styles/shell-layout.css +3 -3
- package/dist/styles/table-layout.css +13 -0
- package/dist/tokens/foundation.css +12 -1
- package/dist/tokens/semantic/layout.css +2 -2
- package/package.json +6 -7
- package/scripts/ui-audit.mjs +31 -2
- package/dist/chunk-6MCI7W5G.js +0 -201
- package/dist/chunk-CAEL2ZD2.js +0 -222
- package/dist/chunk-GKXPALFT.js +0 -32
- package/dist/chunk-JKHWLPM5.js +0 -101
- package/dist/chunk-KDBGFJJI.js +0 -220
- package/dist/components/data-entry/autocomplete.d.ts +0 -24
- package/dist/components/data-entry/autocomplete.js +0 -10
- package/dist/components/data-entry/combobox.d.ts +0 -22
- package/dist/components/data-entry/combobox.js +0 -6
- package/dist/filter-bar-B5TPUqEO.d.ts +0 -14
- /package/dist/{chunk-LDSLS6HE.js → chunk-7CFO5FFE.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-
|
|
1
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-NXVCI6YB.js';
|
|
2
2
|
import { Button } from './chunk-M4PZNAMV.js';
|
|
3
|
-
import { useTranslation } from './chunk-
|
|
3
|
+
import { useTranslation } from './chunk-HTG5VHU7.js';
|
|
4
4
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { MoreHorizontal, ChevronLeft, ChevronRight } from 'lucide-react';
|
|
@@ -38,13 +38,14 @@ var PaginationItem = React.forwardRef(
|
|
|
38
38
|
);
|
|
39
39
|
PaginationItem.displayName = "PaginationItem";
|
|
40
40
|
var PaginationLink = React.forwardRef(
|
|
41
|
-
({ className, isActive, disabled, children, onClick, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
42
|
-
"
|
|
41
|
+
({ className, isActive, disabled, children, onClick, href: _href, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
42
|
+
"button",
|
|
43
43
|
{
|
|
44
44
|
ref,
|
|
45
|
+
type: "button",
|
|
45
46
|
"data-active": isActive || void 0,
|
|
46
47
|
"aria-current": isActive ? "page" : void 0,
|
|
47
|
-
|
|
48
|
+
disabled: disabled || void 0,
|
|
48
49
|
"data-state": disabled ? "disabled" : void 0,
|
|
49
50
|
className: cn(
|
|
50
51
|
"ui-pagination-link ui-button--compact-icon ui-pagination-page",
|
|
@@ -52,14 +53,7 @@ var PaginationLink = React.forwardRef(
|
|
|
52
53
|
disabled ? "ui-pagination-link-disabled" : void 0,
|
|
53
54
|
className
|
|
54
55
|
),
|
|
55
|
-
|
|
56
|
-
onClick: (event) => {
|
|
57
|
-
if (disabled) {
|
|
58
|
-
event.preventDefault();
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
onClick?.(event);
|
|
62
|
-
},
|
|
56
|
+
onClick,
|
|
63
57
|
...props,
|
|
64
58
|
children
|
|
65
59
|
}
|
|
@@ -104,7 +98,7 @@ var PaginationNext = React.forwardRef(
|
|
|
104
98
|
);
|
|
105
99
|
PaginationNext.displayName = "PaginationNext";
|
|
106
100
|
function Pagination({
|
|
107
|
-
|
|
101
|
+
value = 1,
|
|
108
102
|
total = 0,
|
|
109
103
|
pageSize = 10,
|
|
110
104
|
pageSizeOptions = [10, 20, 50, 100],
|
|
@@ -113,16 +107,16 @@ function Pagination({
|
|
|
113
107
|
simple,
|
|
114
108
|
disabled,
|
|
115
109
|
className,
|
|
116
|
-
|
|
110
|
+
onValueChange
|
|
117
111
|
}) {
|
|
118
112
|
const { t } = useTranslation();
|
|
119
113
|
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
120
|
-
const safeCurrent = Math.min(Math.max(1,
|
|
114
|
+
const safeCurrent = Math.min(Math.max(1, value), totalPages);
|
|
121
115
|
const pages = buildPageRange(safeCurrent, totalPages);
|
|
122
116
|
const go = (page, size = pageSize) => {
|
|
123
117
|
if (disabled) return;
|
|
124
118
|
const nextPage = Math.min(Math.max(1, page), Math.max(1, Math.ceil(total / size)));
|
|
125
|
-
|
|
119
|
+
onValueChange?.(nextPage, size);
|
|
126
120
|
};
|
|
127
121
|
const totalLabel = typeof showTotal === "function" ? showTotal(total, [
|
|
128
122
|
(safeCurrent - 1) * pageSize + 1,
|
|
@@ -200,12 +194,8 @@ function Pagination({
|
|
|
200
194
|
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
201
195
|
PaginationPrevious,
|
|
202
196
|
{
|
|
203
|
-
href: "#",
|
|
204
197
|
"aria-label": t("navigation.pagination.prev"),
|
|
205
|
-
onClick: (
|
|
206
|
-
event.preventDefault();
|
|
207
|
-
go(safeCurrent - 1);
|
|
208
|
-
},
|
|
198
|
+
onClick: () => go(safeCurrent - 1),
|
|
209
199
|
className: "ui-button--compact-icon",
|
|
210
200
|
disabled: Boolean(disabled) || safeCurrent <= 1,
|
|
211
201
|
children: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" })
|
|
@@ -217,11 +207,9 @@ function Pagination({
|
|
|
217
207
|
{
|
|
218
208
|
isActive: page === safeCurrent,
|
|
219
209
|
"aria-label": t("navigation.pagination.page", { page }),
|
|
220
|
-
onClick: (
|
|
221
|
-
event.preventDefault();
|
|
210
|
+
onClick: () => {
|
|
222
211
|
if (!disabled) go(page);
|
|
223
212
|
},
|
|
224
|
-
href: "#",
|
|
225
213
|
disabled,
|
|
226
214
|
children: page
|
|
227
215
|
}
|
|
@@ -230,12 +218,8 @@ function Pagination({
|
|
|
230
218
|
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
|
|
231
219
|
PaginationNext,
|
|
232
220
|
{
|
|
233
|
-
href: "#",
|
|
234
221
|
"aria-label": t("navigation.pagination.next"),
|
|
235
|
-
onClick: (
|
|
236
|
-
event.preventDefault();
|
|
237
|
-
go(safeCurrent + 1);
|
|
238
|
-
},
|
|
222
|
+
onClick: () => go(safeCurrent + 1),
|
|
239
223
|
className: "ui-button--compact-icon",
|
|
240
224
|
disabled: Boolean(disabled) || safeCurrent >= totalPages,
|
|
241
225
|
children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
|
|
@@ -13,11 +13,18 @@ function FormField({
|
|
|
13
13
|
className,
|
|
14
14
|
children
|
|
15
15
|
}) {
|
|
16
|
-
const helperId = helper
|
|
16
|
+
const helperId = helper ? `${id}-helper` : void 0;
|
|
17
17
|
const errorId = error ? `${id}-error` : void 0;
|
|
18
|
-
|
|
18
|
+
if (typeof process !== "undefined" && process.env?.NODE_ENV !== "production" && !React.isValidElement(children)) {
|
|
19
|
+
console.warn(
|
|
20
|
+
"FormField expects a single React element child to receive aria-describedby/aria-errormessage; the helper text and error message will not be associated with the control."
|
|
21
|
+
);
|
|
22
|
+
}
|
|
19
23
|
const childWithA11y = React.isValidElement(children) ? React.cloneElement(children, {
|
|
20
|
-
|
|
24
|
+
// Helper and error can coexist: helper stays on aria-describedby, the error on
|
|
25
|
+
// aria-errormessage (surfaced when aria-invalid is true).
|
|
26
|
+
"aria-describedby": helperId,
|
|
27
|
+
"aria-errormessage": errorId,
|
|
21
28
|
"aria-required": required ? true : void 0,
|
|
22
29
|
"aria-invalid": !!error || void 0
|
|
23
30
|
}) : children;
|
|
@@ -30,7 +37,8 @@ function FormField({
|
|
|
30
37
|
labelAddon
|
|
31
38
|
] }),
|
|
32
39
|
childWithA11y,
|
|
33
|
-
|
|
40
|
+
helper ? /* @__PURE__ */ jsx("p", { id: helperId, className: "text-muted-foreground text-xs", children: helper }) : null,
|
|
41
|
+
error ? /* @__PURE__ */ jsx("p", { id: errorId, role: "alert", className: "text-destructive text-xs", children: error }) : null
|
|
34
42
|
] });
|
|
35
43
|
}
|
|
36
44
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Field, choiceGroupClassName } from './chunk-
|
|
1
|
+
import { Field, choiceGroupClassName } from './chunk-44YRPSZ7.js';
|
|
2
2
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { controlIconClass } from './chunk-IBK5D2Q6.js';
|
|
2
|
+
import { useTranslation } from './chunk-HTG5VHU7.js';
|
|
2
3
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
4
|
import { Check, Loader2, X, Circle } from 'lucide-react';
|
|
4
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
6
|
|
|
6
7
|
function resolveStepStatus(index, current, itemStatus, currentStatus) {
|
|
7
8
|
if (itemStatus) return itemStatus;
|
|
@@ -53,17 +54,18 @@ function StepIcon({
|
|
|
53
54
|
}
|
|
54
55
|
function Steps({
|
|
55
56
|
items = [],
|
|
56
|
-
current = 0,
|
|
57
|
-
|
|
57
|
+
value: current = 0,
|
|
58
|
+
defaultValue = 0,
|
|
58
59
|
status: currentStatus = "process",
|
|
59
60
|
orientation = "horizontal",
|
|
60
61
|
type = "default",
|
|
61
|
-
size = "
|
|
62
|
+
size = "md",
|
|
62
63
|
titlePlacement = "horizontal",
|
|
63
|
-
|
|
64
|
+
onValueChange,
|
|
64
65
|
className
|
|
65
66
|
}) {
|
|
66
|
-
const
|
|
67
|
+
const { t } = useTranslation();
|
|
68
|
+
const base = defaultValue;
|
|
67
69
|
const isVertical = orientation === "vertical";
|
|
68
70
|
const compact = size === "sm";
|
|
69
71
|
return /* @__PURE__ */ jsx(
|
|
@@ -74,65 +76,69 @@ function Steps({
|
|
|
74
76
|
isVertical ? "flex-col gap-0" : "flex-row items-start",
|
|
75
77
|
className
|
|
76
78
|
),
|
|
77
|
-
"aria-label": "
|
|
79
|
+
"aria-label": t("navigation.steps.ariaLabel"),
|
|
78
80
|
children: items.map((item, index) => {
|
|
79
81
|
const absoluteIndex = base + index;
|
|
80
82
|
const stepStatus = resolveStepStatus(absoluteIndex, current, item.status, currentStatus);
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
+
const interactive = Boolean(onValueChange);
|
|
84
|
+
const clickable = interactive && !item.disabled;
|
|
85
|
+
const description = item.description;
|
|
86
|
+
const isCurrent = absoluteIndex === current;
|
|
87
|
+
const stepClassName = cn(
|
|
88
|
+
"group flex min-w-0",
|
|
89
|
+
isVertical ? "flex-row items-start gap-3" : "flex-col items-center",
|
|
90
|
+
clickable ? "cursor-pointer" : "cursor-default"
|
|
91
|
+
);
|
|
92
|
+
const stepInner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
93
|
+
/* @__PURE__ */ jsx(StepIcon, { status: stepStatus, icon: item.icon, type }),
|
|
94
|
+
/* @__PURE__ */ jsxs(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: cn(
|
|
98
|
+
"min-w-0",
|
|
99
|
+
isVertical ? "pt-1 text-left" : "mt-2 px-2",
|
|
100
|
+
titlePlacement === "vertical" && !isVertical && "mt-1"
|
|
101
|
+
),
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: cn(
|
|
107
|
+
"font-medium",
|
|
108
|
+
compact ? "text-xs" : "text-sm",
|
|
109
|
+
stepStatus === "process" && "text-foreground",
|
|
110
|
+
stepStatus === "wait" && "text-muted-foreground",
|
|
111
|
+
stepStatus === "error" && "text-destructive"
|
|
112
|
+
),
|
|
113
|
+
children: item.title
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
item.subtitle && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-xs", children: item.subtitle }),
|
|
117
|
+
description && /* @__PURE__ */ jsx("div", { className: cn("text-muted-foreground", compact ? "text-xs" : "text-sm"), children: description })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] });
|
|
83
122
|
return /* @__PURE__ */ jsx(
|
|
84
123
|
"li",
|
|
85
124
|
{
|
|
125
|
+
"aria-current": isCurrent ? "step" : void 0,
|
|
86
126
|
className: cn(
|
|
87
127
|
"relative flex min-w-0 flex-1",
|
|
88
128
|
isVertical ? "flex-row gap-3 pb-8 last:pb-0" : "flex-col items-center text-center",
|
|
89
129
|
!isVertical && index < items.length - 1 && "after:bg-border after:absolute after:top-4 after:h-px",
|
|
90
130
|
!isVertical && index < items.length - 1 && "after:left-[calc(50%+1.25rem)] after:w-[calc(100%-2.5rem)]"
|
|
91
131
|
),
|
|
92
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: interactive ? /* @__PURE__ */ jsx(
|
|
93
133
|
"button",
|
|
94
134
|
{
|
|
95
135
|
type: "button",
|
|
96
136
|
disabled: !clickable,
|
|
97
|
-
onClick: clickable ? () =>
|
|
98
|
-
className:
|
|
99
|
-
|
|
100
|
-
isVertical ? "flex-row items-start gap-3" : "flex-col items-center",
|
|
101
|
-
clickable && "cursor-pointer",
|
|
102
|
-
!clickable && "cursor-default"
|
|
103
|
-
),
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ jsx(StepIcon, { status: stepStatus, icon: item.icon, type }),
|
|
106
|
-
/* @__PURE__ */ jsxs(
|
|
107
|
-
"div",
|
|
108
|
-
{
|
|
109
|
-
className: cn(
|
|
110
|
-
"min-w-0",
|
|
111
|
-
isVertical ? "pt-1 text-left" : "mt-2 px-2",
|
|
112
|
-
titlePlacement === "vertical" && !isVertical && "mt-1"
|
|
113
|
-
),
|
|
114
|
-
children: [
|
|
115
|
-
/* @__PURE__ */ jsx(
|
|
116
|
-
"div",
|
|
117
|
-
{
|
|
118
|
-
className: cn(
|
|
119
|
-
"font-medium",
|
|
120
|
-
compact ? "text-xs" : "text-sm",
|
|
121
|
-
stepStatus === "process" && "text-foreground",
|
|
122
|
-
stepStatus === "wait" && "text-muted-foreground",
|
|
123
|
-
stepStatus === "error" && "text-destructive"
|
|
124
|
-
),
|
|
125
|
-
children: item.title
|
|
126
|
-
}
|
|
127
|
-
),
|
|
128
|
-
item.subTitle && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground text-xs", children: item.subTitle }),
|
|
129
|
-
description && /* @__PURE__ */ jsx("div", { className: cn("text-muted-foreground", compact ? "text-xs" : "text-sm"), children: description })
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
)
|
|
133
|
-
]
|
|
137
|
+
onClick: clickable ? () => onValueChange?.(absoluteIndex) : void 0,
|
|
138
|
+
className: stepClassName,
|
|
139
|
+
children: stepInner
|
|
134
140
|
}
|
|
135
|
-
)
|
|
141
|
+
) : /* @__PURE__ */ jsx("span", { className: stepClassName, children: stepInner })
|
|
136
142
|
},
|
|
137
143
|
index
|
|
138
144
|
);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-NXVCI6YB.js';
|
|
2
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
3
|
+
import { useOptionalAppContext, useTranslation, APP_TIME_FORMAT_OPTIONS, getTimeFormatLabel, resolveTimezonePickerOptions, getTimezoneLabel, APP_LOCALES } from './chunk-HTG5VHU7.js';
|
|
4
|
+
import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from './chunk-6CSBMMZS.js';
|
|
5
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { useId } from 'react';
|
|
8
|
+
import { Clock, CalendarDays, Globe, Languages, X } from 'lucide-react';
|
|
9
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
function Toolbar({ onClear, hasActiveFilters = true, className, children }) {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
role: "toolbar",
|
|
17
|
+
"aria-label": t("navigation.toolbar.ariaLabel"),
|
|
18
|
+
className: cn("ui-toolbar", className),
|
|
19
|
+
children: [
|
|
20
|
+
children,
|
|
21
|
+
onClear && hasActiveFilters && /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onClear, className: "ui-toolbar-clear", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(X, { "aria-hidden": "true" }),
|
|
23
|
+
t("common.clearFilters")
|
|
24
|
+
] })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function ToolbarGroup({ label, className, children }) {
|
|
30
|
+
const labelId = useId();
|
|
31
|
+
return /* @__PURE__ */ jsxs(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
role: "group",
|
|
35
|
+
"aria-labelledby": label ? labelId : void 0,
|
|
36
|
+
className: cn("ui-stack-xs ui-toolbar-group", className),
|
|
37
|
+
children: [
|
|
38
|
+
label ? /* @__PURE__ */ jsx("div", { id: labelId, className: "ui-toolbar-label", children: label }) : null,
|
|
39
|
+
children
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
var ICON = {
|
|
45
|
+
locale: Languages,
|
|
46
|
+
timezone: Globe,
|
|
47
|
+
dateFormat: CalendarDays,
|
|
48
|
+
timeFormat: Clock
|
|
49
|
+
};
|
|
50
|
+
var TRIGGER_WIDTH = {
|
|
51
|
+
locale: "sm:w-40",
|
|
52
|
+
timezone: "sm:w-56",
|
|
53
|
+
dateFormat: "sm:w-44",
|
|
54
|
+
timeFormat: "sm:w-44"
|
|
55
|
+
};
|
|
56
|
+
var ARIA_KEY = {
|
|
57
|
+
locale: "navigation.localePicker.ariaLabel",
|
|
58
|
+
timezone: "navigation.timezonePicker.ariaLabel",
|
|
59
|
+
dateFormat: "navigation.dateFormatPicker.ariaLabel",
|
|
60
|
+
timeFormat: "navigation.timeFormatPicker.ariaLabel"
|
|
61
|
+
};
|
|
62
|
+
var AppSettingPicker = React.forwardRef(
|
|
63
|
+
function AppSettingPicker2({ kind, className, disabled, id, name, value, onValueChange }, ref) {
|
|
64
|
+
const ctx = useOptionalAppContext();
|
|
65
|
+
const { t, locale, fallbackLocale } = useTranslation();
|
|
66
|
+
const current = value ?? ctx?.[kind];
|
|
67
|
+
const setter = ctx ? {
|
|
68
|
+
locale: ctx.setLocale,
|
|
69
|
+
timezone: ctx.setTimezone,
|
|
70
|
+
dateFormat: ctx.setDateFormat,
|
|
71
|
+
timeFormat: ctx.setTimeFormat
|
|
72
|
+
}[kind] : void 0;
|
|
73
|
+
const handleChange = onValueChange ?? setter;
|
|
74
|
+
const items = React.useMemo(() => {
|
|
75
|
+
switch (kind) {
|
|
76
|
+
case "locale":
|
|
77
|
+
return APP_LOCALES.map((code) => ({ value: code, label: t(`locale.${code}`) }));
|
|
78
|
+
case "timezone":
|
|
79
|
+
return resolveTimezonePickerOptions(ctx?.timezoneOptions, current ?? "").map((tz) => ({
|
|
80
|
+
value: tz,
|
|
81
|
+
label: getTimezoneLabel(tz, locale, fallbackLocale)
|
|
82
|
+
}));
|
|
83
|
+
case "dateFormat":
|
|
84
|
+
return APP_DATE_FORMAT_OPTIONS.map((option) => ({
|
|
85
|
+
value: option.value,
|
|
86
|
+
label: getDateFormatLabel(option.value, locale, fallbackLocale)
|
|
87
|
+
}));
|
|
88
|
+
case "timeFormat":
|
|
89
|
+
return APP_TIME_FORMAT_OPTIONS.map((option) => ({
|
|
90
|
+
value: option.value,
|
|
91
|
+
label: getTimeFormatLabel(option.value, locale, fallbackLocale)
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
}, [kind, ctx?.timezoneOptions, current, t, locale, fallbackLocale]);
|
|
95
|
+
const unbound = current === void 0 || !handleChange;
|
|
96
|
+
const Icon = ICON[kind];
|
|
97
|
+
return /* @__PURE__ */ jsxs(
|
|
98
|
+
Select,
|
|
99
|
+
{
|
|
100
|
+
value: current ?? "",
|
|
101
|
+
onValueChange: handleChange ?? (() => {
|
|
102
|
+
}),
|
|
103
|
+
disabled: disabled || unbound,
|
|
104
|
+
name,
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsxs(
|
|
107
|
+
SelectTrigger,
|
|
108
|
+
{
|
|
109
|
+
ref,
|
|
110
|
+
id,
|
|
111
|
+
className: cn("w-full", TRIGGER_WIDTH[kind], className),
|
|
112
|
+
"aria-label": t(ARIA_KEY[kind]),
|
|
113
|
+
children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Icon, { className: "me-2 size-4 shrink-0 opacity-70", "aria-hidden": "true" }),
|
|
115
|
+
/* @__PURE__ */ jsx(SelectValue, {})
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ jsx(SelectContent, { children: items.map((item) => /* @__PURE__ */ jsx(SelectItem, { value: item.value, children: item.label }, item.value)) })
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
export { AppSettingPicker, Toolbar, ToolbarGroup };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DropdownMenu, DropdownMenuTrigger } from './chunk-
|
|
1
|
+
import { DropdownMenu, DropdownMenuTrigger } from './chunk-LMKUKCTN.js';
|
|
2
2
|
import { Tooltip, TooltipTrigger, TooltipContent } from './chunk-32WO3YLB.js';
|
|
3
3
|
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from './chunk-DV52WNXO.js';
|
|
4
|
-
import { densityClass, pageContainerVariantClass
|
|
4
|
+
import { densityClass, pageContainerVariantClass } from './chunk-INIIF7F7.js';
|
|
5
5
|
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
6
|
+
import { useTranslation } from './chunk-HTG5VHU7.js';
|
|
6
7
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
7
8
|
import { ChevronRight, ChevronDown, PanelLeftOpen, PanelLeftClose, Search, Bell, SlidersHorizontal } from 'lucide-react';
|
|
8
9
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -75,12 +76,6 @@ function PageContainerRoot({
|
|
|
75
76
|
var PageContainer = Object.assign(PageContainerRoot, {
|
|
76
77
|
Inset: PageContainerInset
|
|
77
78
|
});
|
|
78
|
-
function PageInset(props) {
|
|
79
|
-
return /* @__PURE__ */ jsx(PageContainerInset, { ...props });
|
|
80
|
-
}
|
|
81
|
-
function Stack(props) {
|
|
82
|
-
return /* @__PURE__ */ jsx(Flex, { direction: "col", ...props });
|
|
83
|
-
}
|
|
84
79
|
function AppShell({
|
|
85
80
|
sidebar,
|
|
86
81
|
topbar,
|
|
@@ -92,6 +87,7 @@ function AppShell({
|
|
|
92
87
|
children,
|
|
93
88
|
sidebarCollapsed = false
|
|
94
89
|
}) {
|
|
90
|
+
const { t } = useTranslation();
|
|
95
91
|
const resolvedTopbar = topbar !== void 0 ? topbar : /* @__PURE__ */ jsxs("div", { className: "app-topbar-rail", children: [
|
|
96
92
|
logo !== void 0 && /* @__PURE__ */ jsx("div", { className: "app-topbar-logo", children: logo }),
|
|
97
93
|
topbarLeft !== void 0 && /* @__PURE__ */ jsx("div", { className: "app-topbar-left", children: topbarLeft }),
|
|
@@ -99,17 +95,18 @@ function AppShell({
|
|
|
99
95
|
topbarRight !== void 0 && /* @__PURE__ */ jsx("div", { className: "app-topbar-right", children: topbarRight })
|
|
100
96
|
] });
|
|
101
97
|
return /* @__PURE__ */ jsxs("div", { className: "app-root", "data-collapsed": sidebarCollapsed ? "true" : void 0, children: [
|
|
102
|
-
/* @__PURE__ */ jsx("aside", { className: "app-sidebar", children: sidebar }),
|
|
103
|
-
/* @__PURE__ */ jsx("header", { className: "app-topbar", children: resolvedTopbar }),
|
|
104
|
-
/* @__PURE__ */ jsxs("main", { className: "app-main", children: [
|
|
98
|
+
/* @__PURE__ */ jsx("aside", { className: "app-sidebar", "aria-label": t("layout.appShell.sidebarLabel"), children: sidebar }),
|
|
99
|
+
/* @__PURE__ */ jsx("header", { className: "app-topbar", "aria-label": t("layout.appShell.headerLabel"), children: resolvedTopbar }),
|
|
100
|
+
/* @__PURE__ */ jsxs("main", { className: "app-main", "aria-label": t("layout.appShell.mainLabel"), children: [
|
|
105
101
|
breadcrumb !== void 0 && /* @__PURE__ */ jsx("div", { className: "app-breadcrumb", children: breadcrumb }),
|
|
106
102
|
children
|
|
107
103
|
] }),
|
|
108
|
-
footer !== void 0 && /* @__PURE__ */ jsx("footer", { className: "app-footer", children: footer })
|
|
104
|
+
footer !== void 0 && /* @__PURE__ */ jsx("footer", { className: "app-footer", "aria-label": t("layout.appShell.footerLabel"), children: footer })
|
|
109
105
|
] });
|
|
110
106
|
}
|
|
111
107
|
function Breadcrumb({ items, linkComponent: LinkComponent = "a" }) {
|
|
112
|
-
|
|
108
|
+
const { t } = useTranslation();
|
|
109
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": t("navigation.breadcrumb.ariaLabel"), className: "ui-breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: "ui-breadcrumb-list", children: items.map((item, index) => {
|
|
113
110
|
const isLast = index === items.length - 1;
|
|
114
111
|
return /* @__PURE__ */ jsxs("li", { className: "ui-breadcrumb-item", children: [
|
|
115
112
|
item.to && !isLast ? /* @__PURE__ */ jsx(LinkComponent, { href: item.to, to: item.to, className: "ui-breadcrumb-link", children: item.label }) : /* @__PURE__ */ jsx("span", { className: "ui-breadcrumb-current", "aria-current": isLast ? "page" : void 0, children: item.label }),
|
|
@@ -298,6 +295,7 @@ function Sidebar({
|
|
|
298
295
|
renderItem,
|
|
299
296
|
footer
|
|
300
297
|
}) {
|
|
298
|
+
const { t } = useTranslation();
|
|
301
299
|
const resolvedSections = sections ?? [];
|
|
302
300
|
return /* @__PURE__ */ jsxs("div", { className: "sb-root", "data-collapsed": collapsed ? "true" : void 0, children: [
|
|
303
301
|
brand !== void 0 ? /* @__PURE__ */ jsx(SidebarHeader, { children: brand }) : product ? /* @__PURE__ */ jsxs(
|
|
@@ -324,7 +322,7 @@ function Sidebar({
|
|
|
324
322
|
]
|
|
325
323
|
}
|
|
326
324
|
) : null,
|
|
327
|
-
/* @__PURE__ */ jsx("
|
|
325
|
+
/* @__PURE__ */ jsx("nav", { className: "sb-nav-scroll", "aria-label": t("layout.sidebar.ariaLabel"), children: children ?? resolvedSections.map((section, sectionIndex) => /* @__PURE__ */ jsx(
|
|
328
326
|
SidebarSection,
|
|
329
327
|
{
|
|
330
328
|
label: section.label,
|
|
@@ -373,6 +371,7 @@ function Topbar({
|
|
|
373
371
|
onNotificationsOpen,
|
|
374
372
|
user
|
|
375
373
|
}) {
|
|
374
|
+
const { t } = useTranslation();
|
|
376
375
|
const productChip = /* @__PURE__ */ jsxs(
|
|
377
376
|
"button",
|
|
378
377
|
{
|
|
@@ -414,7 +413,7 @@ function Topbar({
|
|
|
414
413
|
{
|
|
415
414
|
type: "button",
|
|
416
415
|
className: "tb-icon-btn",
|
|
417
|
-
"aria-label": "
|
|
416
|
+
"aria-label": t("layout.topbar.toggleSidebar"),
|
|
418
417
|
"aria-pressed": collapsed,
|
|
419
418
|
onClick: onToggleCollapsed,
|
|
420
419
|
children: collapsed ? /* @__PURE__ */ jsx(PanelLeftOpen, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(PanelLeftClose, { "aria-hidden": "true" })
|
|
@@ -431,18 +430,28 @@ function Topbar({
|
|
|
431
430
|
projectMenu
|
|
432
431
|
] }) : projectChip : null
|
|
433
432
|
] }),
|
|
434
|
-
/* @__PURE__ */ jsxs(
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
433
|
+
/* @__PURE__ */ jsxs(
|
|
434
|
+
"button",
|
|
435
|
+
{
|
|
436
|
+
type: "button",
|
|
437
|
+
className: "tb-search",
|
|
438
|
+
"aria-label": t("layout.topbar.search"),
|
|
439
|
+
"aria-keyshortcuts": "Meta+K",
|
|
440
|
+
onClick: onSearchOpen,
|
|
441
|
+
children: [
|
|
442
|
+
/* @__PURE__ */ jsx(Search, { "aria-hidden": "true" }),
|
|
443
|
+
/* @__PURE__ */ jsx("span", { children: t("layout.topbar.searchPlaceholder") }),
|
|
444
|
+
/* @__PURE__ */ jsx("kbd", { className: "kbd", children: "\u2318K" })
|
|
445
|
+
]
|
|
446
|
+
}
|
|
447
|
+
),
|
|
439
448
|
rightSlot,
|
|
440
449
|
onNotificationsOpen ? /* @__PURE__ */ jsxs(
|
|
441
450
|
"button",
|
|
442
451
|
{
|
|
443
452
|
type: "button",
|
|
444
453
|
className: "tb-icon-btn tb-bell",
|
|
445
|
-
"aria-label": "
|
|
454
|
+
"aria-label": t("layout.topbar.notifications"),
|
|
446
455
|
onClick: onNotificationsOpen,
|
|
447
456
|
children: [
|
|
448
457
|
/* @__PURE__ */ jsx(Bell, { "aria-hidden": "true" }),
|
|
@@ -456,7 +465,7 @@ function Topbar({
|
|
|
456
465
|
{
|
|
457
466
|
type: "button",
|
|
458
467
|
className: "tb-icon-btn",
|
|
459
|
-
"aria-label": "
|
|
468
|
+
"aria-label": t("layout.topbar.tweaks"),
|
|
460
469
|
onClick: onTweaksOpen,
|
|
461
470
|
children: /* @__PURE__ */ jsx(SlidersHorizontal, { "aria-hidden": "true" })
|
|
462
471
|
}
|
|
@@ -487,4 +496,4 @@ function SplitPane({ children, aside, asideWidth = "md" }) {
|
|
|
487
496
|
] });
|
|
488
497
|
}
|
|
489
498
|
|
|
490
|
-
export { AppShell, Breadcrumb, PageContainer,
|
|
499
|
+
export { AppShell, Breadcrumb, PageContainer, ResponsiveGrid, Sidebar, SidebarHeader, SidebarItem, SidebarSection, SplitPane, Topbar };
|