@godxjp/ui 8.1.0 → 8.3.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/dist/{chunk-SKIRU7GC.js → chunk-56NYZNVY.js} +1 -1
- package/dist/{chunk-C5H655GK.js → chunk-6PA2YHRE.js} +129 -30
- package/dist/{chunk-KKMQLQ7F.js → chunk-6YK3IJXW.js} +128 -4
- package/dist/chunk-B73NA66T.js +122 -0
- package/dist/{chunk-G2WYOCDL.js → chunk-CAEL2ZD2.js} +1 -1
- package/dist/{chunk-XDUZ7JJL.js → chunk-GKXPALFT.js} +1 -1
- package/dist/{chunk-N43OKOFT.js → chunk-GLEEJYGQ.js} +1 -1
- package/dist/chunk-HCM4JAC2.js +134 -0
- package/dist/chunk-HL3G4SVG.js +131 -0
- package/dist/{chunk-NG23LVTM.js → chunk-INSF6K3Y.js} +3 -39
- package/dist/chunk-JKHWLPM5.js +101 -0
- package/dist/chunk-LFW37FGG.js +68 -0
- package/dist/chunk-QLMXEJSY.js +114 -0
- package/dist/{chunk-SEG2YBXF.js → chunk-QTUJSRDH.js} +9 -1
- package/dist/chunk-W4REF4TD.js +42 -0
- package/dist/chunk-WGWI7EGL.js +83 -0
- package/dist/{chunk-TMDGV4CN.js → chunk-ZRRLOOBX.js} +1 -10
- package/dist/{chunk-4R7RQDXI.js → chunk-ZY5NUG4B.js} +2 -7
- package/dist/components/admin/index.d.ts +3 -16
- package/dist/components/admin/index.js +28 -23
- package/dist/components/data-display/card.d.ts +2 -2
- package/dist/components/data-display/carousel.d.ts +25 -0
- package/dist/components/data-display/carousel.js +2 -0
- package/dist/components/data-display/index.d.ts +2 -0
- package/dist/components/data-display/index.js +5 -4
- package/dist/components/data-entry/autocomplete.js +3 -3
- package/dist/components/data-entry/cascader.js +3 -3
- package/dist/components/data-entry/combobox.d.ts +22 -0
- package/dist/components/data-entry/combobox.js +6 -0
- package/dist/components/data-entry/date-picker.js +2 -2
- package/dist/components/data-entry/date-range-picker.js +2 -2
- package/dist/components/data-entry/index.d.ts +27 -1
- package/dist/components/data-entry/index.js +19 -16
- package/dist/components/data-entry/select.js +3 -3
- package/dist/components/data-entry/time-input.d.ts +12 -0
- package/dist/components/data-entry/time-input.js +3 -0
- package/dist/components/data-entry/time-picker.js +2 -2
- package/dist/components/data-entry/transfer.js +3 -2
- package/dist/components/data-entry/tree-select.js +3 -3
- package/dist/components/data-entry/upload.js +3 -3
- package/dist/components/feedback/alert.js +1 -1
- package/dist/components/feedback/index.js +4 -4
- package/dist/components/layout/index.d.ts +2 -0
- package/dist/components/layout/index.js +3 -2
- package/dist/components/layout/resizable.d.ts +18 -0
- package/dist/components/layout/resizable.js +2 -0
- package/dist/components/navigation/context-menu.d.ts +25 -0
- package/dist/components/navigation/context-menu.js +2 -0
- package/dist/components/navigation/index.d.ts +8 -1
- package/dist/components/navigation/index.js +8 -5
- package/dist/components/navigation/menubar.d.ts +29 -0
- package/dist/components/navigation/menubar.js +2 -0
- package/dist/components/navigation/navigation-menu.d.ts +13 -0
- package/dist/components/navigation/navigation-menu.js +2 -0
- package/dist/components/navigation/pagination.js +4 -4
- package/dist/components/query/index.js +2 -2
- package/dist/components/ui/index.d.ts +13 -0
- package/dist/components/ui/index.js +27 -20
- package/dist/{filter-bar-DvVXm_d1.d.ts → filter-bar-WjnQOs2C.d.ts} +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +38 -31
- package/dist/lib/hooks.d.ts +17 -0
- package/dist/lib/hooks.js +1 -0
- package/dist/props/index.js +1 -1
- package/dist/props/registry.js +1 -1
- package/dist/styles/control.css +27 -0
- package/dist/styles/data-display-layout.css +55 -0
- package/dist/styles/data-entry-layout.css +93 -0
- package/dist/styles/index.css +2 -0
- package/dist/styles/layout.css +35 -3
- package/dist/styles/navigation-layout.css +271 -0
- package/package.json +38 -1
- package/dist/{chunk-A22MCA3X.js → chunk-6J7GRCDA.js} +2 -2
- package/dist/{chunk-RGPF3HU6.js → chunk-6YBYAEXD.js} +1 -1
- package/dist/{chunk-WTVLZVBA.js → chunk-CLU46QR2.js} +1 -1
- package/dist/{chunk-XZM2GNAY.js → chunk-HB2OHB5X.js} +2 -2
- package/dist/{chunk-A7PKMT7Y.js → chunk-JBHXILI4.js} +1 -1
- package/dist/{chunk-6QXQQAOQ.js → chunk-KDBGFJJI.js} +1 -1
- package/dist/{chunk-RGIYKJPW.js → chunk-LJLGABFV.js} +1 -1
- package/dist/{chunk-WN52SCGE.js → chunk-N3JPLJ3B.js} +1 -1
- package/dist/{chunk-SMWKD2HG.js → chunk-PIQXAOWS.js} +2 -2
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
4
|
+
import { Check, Circle, ChevronRight } from 'lucide-react';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var ContextMenu = ContextMenuPrimitive.Root;
|
|
8
|
+
function ContextMenuTrigger(props) {
|
|
9
|
+
return /* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props });
|
|
10
|
+
}
|
|
11
|
+
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
12
|
+
var ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
13
|
+
ContextMenuPrimitive.Content,
|
|
14
|
+
{
|
|
15
|
+
ref,
|
|
16
|
+
"data-slot": "context-menu-content",
|
|
17
|
+
className: cn("ui-context-menu-content", className),
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
) }));
|
|
21
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
22
|
+
var ContextMenuItem = React.forwardRef(({ className, inset, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
23
|
+
ContextMenuPrimitive.Item,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
"data-slot": "context-menu-item",
|
|
27
|
+
"data-inset": inset,
|
|
28
|
+
"data-variant": variant,
|
|
29
|
+
className: cn("ui-context-menu-item", className),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
));
|
|
33
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
34
|
+
var ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
35
|
+
ContextMenuPrimitive.CheckboxItem,
|
|
36
|
+
{
|
|
37
|
+
ref,
|
|
38
|
+
"data-slot": "context-menu-checkbox-item",
|
|
39
|
+
className: cn("ui-context-menu-checkbox-item", className),
|
|
40
|
+
checked,
|
|
41
|
+
...props,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsx("span", { className: "ui-context-menu-item-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "ui-context-menu-check" }) }) }),
|
|
44
|
+
children
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
));
|
|
48
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
49
|
+
var ContextMenuRadioGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
50
|
+
ContextMenuPrimitive.RadioGroup,
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
"data-slot": "context-menu-radio-group",
|
|
54
|
+
className: cn("ui-context-menu-radio-group", className),
|
|
55
|
+
...props
|
|
56
|
+
}
|
|
57
|
+
));
|
|
58
|
+
ContextMenuRadioGroup.displayName = ContextMenuPrimitive.RadioGroup.displayName;
|
|
59
|
+
var ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
60
|
+
ContextMenuPrimitive.RadioItem,
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
"data-slot": "context-menu-radio-item",
|
|
64
|
+
className: cn("ui-context-menu-radio-item", className),
|
|
65
|
+
...props,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx("span", { className: "ui-context-menu-item-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "ui-context-menu-dot" }) }) }),
|
|
68
|
+
children
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
73
|
+
var ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
74
|
+
ContextMenuPrimitive.Label,
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
"data-slot": "context-menu-label",
|
|
78
|
+
"data-inset": inset,
|
|
79
|
+
className: cn("ui-context-menu-label", className),
|
|
80
|
+
...props
|
|
81
|
+
}
|
|
82
|
+
));
|
|
83
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
84
|
+
var ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
85
|
+
ContextMenuPrimitive.Separator,
|
|
86
|
+
{
|
|
87
|
+
ref,
|
|
88
|
+
"data-slot": "context-menu-separator",
|
|
89
|
+
className: cn("ui-context-menu-separator", className),
|
|
90
|
+
...props
|
|
91
|
+
}
|
|
92
|
+
));
|
|
93
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
94
|
+
var ContextMenuShortcut = ({
|
|
95
|
+
className,
|
|
96
|
+
...props
|
|
97
|
+
}) => /* @__PURE__ */ jsx(
|
|
98
|
+
"span",
|
|
99
|
+
{
|
|
100
|
+
"data-slot": "context-menu-shortcut",
|
|
101
|
+
className: cn("ui-context-menu-shortcut", className),
|
|
102
|
+
...props
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
106
|
+
var ContextMenuSubTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
107
|
+
ContextMenuPrimitive.SubTrigger,
|
|
108
|
+
{
|
|
109
|
+
ref,
|
|
110
|
+
"data-slot": "context-menu-sub-trigger",
|
|
111
|
+
className: cn("ui-context-menu-sub-trigger", className),
|
|
112
|
+
...props,
|
|
113
|
+
children: [
|
|
114
|
+
children,
|
|
115
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "ui-context-menu-sub-trigger-icon", "aria-hidden": "true" })
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
));
|
|
119
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
120
|
+
var ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
121
|
+
ContextMenuPrimitive.SubContent,
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
"data-slot": "context-menu-sub-content",
|
|
125
|
+
className: cn("ui-context-menu-sub-content", className),
|
|
126
|
+
...props
|
|
127
|
+
}
|
|
128
|
+
));
|
|
129
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
130
|
+
|
|
131
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger };
|
|
@@ -1,52 +1,16 @@
|
|
|
1
1
|
import { reactNodeText } from './chunk-SMLKNECP.js';
|
|
2
2
|
import { Checkbox } from './chunk-O24Z3ULJ.js';
|
|
3
|
-
import { ScrollArea } from './chunk-3KPEZ5CF.js';
|
|
4
3
|
import { Input } from './chunk-VOHTRR5X.js';
|
|
5
4
|
import { Button } from './chunk-M4PZNAMV.js';
|
|
5
|
+
import { ScrollArea } from './chunk-3KPEZ5CF.js';
|
|
6
6
|
import { Label } from './chunk-7PWBC4BY.js';
|
|
7
7
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
8
|
+
import { useDebouncedValue } from './chunk-LFW37FGG.js';
|
|
8
9
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
9
10
|
import * as React from 'react';
|
|
10
|
-
import { useState, useEffect } from 'react';
|
|
11
11
|
import { Search, X, ChevronRight, ChevronLeft } from 'lucide-react';
|
|
12
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
13
13
|
|
|
14
|
-
function useDebouncedValue(value, delay = 250) {
|
|
15
|
-
const [debounced, setDebounced] = useState(value);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const t = setTimeout(() => {
|
|
18
|
-
setDebounced(value);
|
|
19
|
-
}, delay);
|
|
20
|
-
return () => {
|
|
21
|
-
clearTimeout(t);
|
|
22
|
-
};
|
|
23
|
-
}, [value, delay]);
|
|
24
|
-
return debounced;
|
|
25
|
-
}
|
|
26
|
-
function useTimeoutFlag(signal, ms = 2e3) {
|
|
27
|
-
const [active, setActive] = useState(false);
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (!signal) {
|
|
30
|
-
const id = window.setTimeout(() => {
|
|
31
|
-
setActive(false);
|
|
32
|
-
}, 0);
|
|
33
|
-
return () => {
|
|
34
|
-
clearTimeout(id);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
const showId = window.setTimeout(() => {
|
|
38
|
-
setActive(true);
|
|
39
|
-
}, 0);
|
|
40
|
-
const hideId = window.setTimeout(() => {
|
|
41
|
-
setActive(false);
|
|
42
|
-
}, ms);
|
|
43
|
-
return () => {
|
|
44
|
-
clearTimeout(showId);
|
|
45
|
-
clearTimeout(hideId);
|
|
46
|
-
};
|
|
47
|
-
}, [signal, ms]);
|
|
48
|
-
return Boolean(signal) && active;
|
|
49
|
-
}
|
|
50
14
|
function SearchInput({
|
|
51
15
|
value: controlledValue,
|
|
52
16
|
defaultValue = "",
|
|
@@ -296,4 +260,4 @@ function Transfer({
|
|
|
296
260
|
] });
|
|
297
261
|
}
|
|
298
262
|
|
|
299
|
-
export { SearchInput, Transfer
|
|
263
|
+
export { SearchInput, Transfer };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Command, CommandInput, CommandList, CommandEmpty, CommandItem } from './chunk-HTEL5DQI.js';
|
|
2
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
3
|
+
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var Combobox = ({
|
|
8
|
+
options,
|
|
9
|
+
value: controlledValue,
|
|
10
|
+
defaultValue = "",
|
|
11
|
+
onValueChange,
|
|
12
|
+
placeholder,
|
|
13
|
+
searchPlaceholder,
|
|
14
|
+
emptyText = "No result",
|
|
15
|
+
disabled = false,
|
|
16
|
+
name,
|
|
17
|
+
id,
|
|
18
|
+
className
|
|
19
|
+
}) => {
|
|
20
|
+
const [open, setOpen] = React.useState(false);
|
|
21
|
+
const [search, setSearch] = React.useState("");
|
|
22
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
23
|
+
const isControlled = controlledValue !== void 0;
|
|
24
|
+
const value = isControlled ? controlledValue : internalValue;
|
|
25
|
+
const selectedLabel = options.find((option) => option.value === value)?.label ?? placeholder ?? "Select";
|
|
26
|
+
const resolvedSearch = search.trim().toLowerCase();
|
|
27
|
+
const filtered = resolvedSearch ? options.filter((option) => {
|
|
28
|
+
const haystack = `${option.label} ${option.value}`.toLowerCase();
|
|
29
|
+
return haystack.includes(resolvedSearch);
|
|
30
|
+
}) : options;
|
|
31
|
+
const setValue = (next) => {
|
|
32
|
+
if (!isControlled) setInternalValue(next);
|
|
33
|
+
onValueChange?.(next);
|
|
34
|
+
setOpen(false);
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
Popover,
|
|
38
|
+
{
|
|
39
|
+
open,
|
|
40
|
+
onOpenChange: (next) => {
|
|
41
|
+
setOpen(next);
|
|
42
|
+
if (!next) setSearch("");
|
|
43
|
+
},
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
46
|
+
Button,
|
|
47
|
+
{
|
|
48
|
+
id,
|
|
49
|
+
type: "button",
|
|
50
|
+
"data-slot": "combobox-trigger",
|
|
51
|
+
variant: "outline",
|
|
52
|
+
role: "combobox",
|
|
53
|
+
"aria-expanded": open,
|
|
54
|
+
disabled,
|
|
55
|
+
className,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: value ? void 0 : "text-muted-foreground", children: value ? selectedLabel : placeholder ?? "Select" }),
|
|
58
|
+
/* @__PURE__ */ jsx("span", { className: "ui-combobox-caret", "aria-hidden": "true" })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
) }),
|
|
62
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value }) : null,
|
|
63
|
+
/* @__PURE__ */ jsx(
|
|
64
|
+
PopoverContent,
|
|
65
|
+
{
|
|
66
|
+
className: "ui-combobox-content",
|
|
67
|
+
align: "start",
|
|
68
|
+
sideOffset: 4,
|
|
69
|
+
collisionPadding: 12,
|
|
70
|
+
children: /* @__PURE__ */ jsxs(Command, { shouldFilter: false, className: "ui-combobox-command", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
CommandInput,
|
|
73
|
+
{
|
|
74
|
+
className: "ui-combobox-search",
|
|
75
|
+
value: search,
|
|
76
|
+
onValueChange: setSearch,
|
|
77
|
+
placeholder: searchPlaceholder ?? "Search..."
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(CommandList, { className: "ui-combobox-list", children: filtered.length === 0 ? /* @__PURE__ */ jsx(CommandEmpty, { children: /* @__PURE__ */ jsx("span", { className: "ui-combobox-empty", children: emptyText }) }) : filtered.map((option) => /* @__PURE__ */ jsx(
|
|
81
|
+
CommandItem,
|
|
82
|
+
{
|
|
83
|
+
value: option.value,
|
|
84
|
+
className: "ui-combobox-item",
|
|
85
|
+
"data-selected": value === option.value || void 0,
|
|
86
|
+
onSelect: () => {
|
|
87
|
+
setValue(option.value);
|
|
88
|
+
},
|
|
89
|
+
children: option.label
|
|
90
|
+
},
|
|
91
|
+
option.value
|
|
92
|
+
)) })
|
|
93
|
+
] })
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export { Combobox };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
// src/lib/hooks.ts
|
|
4
|
+
function useDebouncedValue(value, delay = 250) {
|
|
5
|
+
const [debounced, setDebounced] = useState(value);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const t = setTimeout(() => {
|
|
8
|
+
setDebounced(value);
|
|
9
|
+
}, delay);
|
|
10
|
+
return () => {
|
|
11
|
+
clearTimeout(t);
|
|
12
|
+
};
|
|
13
|
+
}, [value, delay]);
|
|
14
|
+
return debounced;
|
|
15
|
+
}
|
|
16
|
+
function useTimeoutFlag(signal, ms = 2e3) {
|
|
17
|
+
const [active, setActive] = useState(false);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!signal) {
|
|
20
|
+
const id = window.setTimeout(() => {
|
|
21
|
+
setActive(false);
|
|
22
|
+
}, 0);
|
|
23
|
+
return () => {
|
|
24
|
+
clearTimeout(id);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const showId = window.setTimeout(() => {
|
|
28
|
+
setActive(true);
|
|
29
|
+
}, 0);
|
|
30
|
+
const hideId = window.setTimeout(() => {
|
|
31
|
+
setActive(false);
|
|
32
|
+
}, ms);
|
|
33
|
+
return () => {
|
|
34
|
+
clearTimeout(showId);
|
|
35
|
+
clearTimeout(hideId);
|
|
36
|
+
};
|
|
37
|
+
}, [signal, ms]);
|
|
38
|
+
return Boolean(signal) && active;
|
|
39
|
+
}
|
|
40
|
+
function useMediaQuery(query) {
|
|
41
|
+
const isBrowser = typeof window !== "undefined";
|
|
42
|
+
const getMatch = () => isBrowser ? window.matchMedia(query).matches : false;
|
|
43
|
+
const [matches, setMatches] = useState(getMatch());
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (!isBrowser) return void 0;
|
|
46
|
+
const mediaQuery = window.matchMedia(query);
|
|
47
|
+
const updateMatch = () => {
|
|
48
|
+
setMatches(mediaQuery.matches);
|
|
49
|
+
};
|
|
50
|
+
updateMatch();
|
|
51
|
+
if (typeof mediaQuery.addEventListener === "function") {
|
|
52
|
+
mediaQuery.addEventListener("change", updateMatch);
|
|
53
|
+
return () => {
|
|
54
|
+
mediaQuery.removeEventListener("change", updateMatch);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
mediaQuery.addListener(updateMatch);
|
|
58
|
+
return () => {
|
|
59
|
+
mediaQuery.removeListener(updateMatch);
|
|
60
|
+
};
|
|
61
|
+
}, [isBrowser, query]);
|
|
62
|
+
return matches;
|
|
63
|
+
}
|
|
64
|
+
function useIsMobile() {
|
|
65
|
+
return useMediaQuery("(max-width: 767px)");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { useDebouncedValue, useIsMobile, useMediaQuery, useTimeoutFlag };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { normalizeHhmm, isValidHhmm } from './chunk-FXFJF4YA.js';
|
|
2
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function clampStep(step) {
|
|
7
|
+
if (!step || Number.isNaN(step)) return 1;
|
|
8
|
+
const parsed = Math.max(1, Math.floor(step));
|
|
9
|
+
if (!Number.isFinite(parsed)) return 1;
|
|
10
|
+
return Math.min(59, parsed);
|
|
11
|
+
}
|
|
12
|
+
function applyStep(value, step) {
|
|
13
|
+
const normalized = normalizeHhmm(value);
|
|
14
|
+
if (!normalized) return value;
|
|
15
|
+
const [hourText, minuteText] = normalized.split(":");
|
|
16
|
+
const hour = Number(hourText);
|
|
17
|
+
const minute = Number(minuteText);
|
|
18
|
+
const floored = Math.floor(minute / step) * step;
|
|
19
|
+
const safeMinute = Math.min(59, Math.max(0, floored));
|
|
20
|
+
return `${String(hour).padStart(2, "0")}:${String(safeMinute).padStart(2, "0")}`;
|
|
21
|
+
}
|
|
22
|
+
function maskTime(raw) {
|
|
23
|
+
const digits = raw.replace(/\D/g, "").slice(0, 4);
|
|
24
|
+
if (digits.length <= 2) return digits;
|
|
25
|
+
return `${digits.slice(0, 2)}:${digits.slice(2)}`;
|
|
26
|
+
}
|
|
27
|
+
function TimeInput({
|
|
28
|
+
value: controlledValue,
|
|
29
|
+
defaultValue = "",
|
|
30
|
+
onValueChange,
|
|
31
|
+
placeholder,
|
|
32
|
+
step = 1,
|
|
33
|
+
className,
|
|
34
|
+
name,
|
|
35
|
+
id,
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
const safeStep = clampStep(step);
|
|
39
|
+
const [internal, setInternal] = React.useState(defaultValue);
|
|
40
|
+
const [displayValue, setDisplayValue] = React.useState(controlledValue ?? defaultValue);
|
|
41
|
+
const isControlled = controlledValue !== void 0;
|
|
42
|
+
const value = isControlled ? controlledValue ?? "" : internal;
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
if (!isControlled) return;
|
|
45
|
+
setDisplayValue(controlledValue ?? "");
|
|
46
|
+
}, [controlledValue, isControlled]);
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
if (isControlled) return;
|
|
49
|
+
setDisplayValue(internal);
|
|
50
|
+
}, [internal, isControlled]);
|
|
51
|
+
const commit = React.useCallback(
|
|
52
|
+
(next, fromBlur = false) => {
|
|
53
|
+
const normalized = normalizeHhmm(next);
|
|
54
|
+
if (!normalized) return;
|
|
55
|
+
const snapped = applyStep(normalized, safeStep);
|
|
56
|
+
if (!isControlled) {
|
|
57
|
+
setInternal(snapped);
|
|
58
|
+
}
|
|
59
|
+
if (isValidHhmm(snapped)) {
|
|
60
|
+
onValueChange?.(snapped);
|
|
61
|
+
setDisplayValue(snapped);
|
|
62
|
+
}
|
|
63
|
+
if (fromBlur && value !== snapped) {
|
|
64
|
+
onValueChange?.(snapped);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
[isControlled, onValueChange, safeStep, value]
|
|
68
|
+
);
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
"input",
|
|
71
|
+
{
|
|
72
|
+
id,
|
|
73
|
+
name,
|
|
74
|
+
value: displayValue,
|
|
75
|
+
"data-slot": "time-input",
|
|
76
|
+
className: cn("ui-time-input", className),
|
|
77
|
+
"aria-invalid": displayValue !== "" && !isValidHhmm(displayValue) ? "true" : void 0,
|
|
78
|
+
placeholder: placeholder ?? "HH:mm",
|
|
79
|
+
inputMode: "numeric",
|
|
80
|
+
autoComplete: "off",
|
|
81
|
+
...props,
|
|
82
|
+
onChange: (event) => {
|
|
83
|
+
const masked = maskTime(event.target.value);
|
|
84
|
+
setDisplayValue(masked);
|
|
85
|
+
const normalized = normalizeHhmm(masked);
|
|
86
|
+
if (normalized) {
|
|
87
|
+
const snapped = applyStep(normalized, safeStep);
|
|
88
|
+
if (!isControlled) {
|
|
89
|
+
setInternal(snapped);
|
|
90
|
+
}
|
|
91
|
+
onValueChange?.(snapped);
|
|
92
|
+
setDisplayValue(snapped);
|
|
93
|
+
}
|
|
94
|
+
props.onChange?.(event);
|
|
95
|
+
},
|
|
96
|
+
onBlur: (event) => {
|
|
97
|
+
commit(event.target.value, true);
|
|
98
|
+
const normalized = normalizeHhmm(event.target.value);
|
|
99
|
+
if (!normalized) {
|
|
100
|
+
setDisplayValue(value);
|
|
101
|
+
}
|
|
102
|
+
props.onBlur?.(event);
|
|
103
|
+
},
|
|
104
|
+
onKeyDown: (event) => {
|
|
105
|
+
if (event.key === "Enter") {
|
|
106
|
+
commit(event.currentTarget.value, true);
|
|
107
|
+
}
|
|
108
|
+
props.onKeyDown?.(event);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { TimeInput };
|
|
@@ -3,7 +3,15 @@ import * as React from 'react';
|
|
|
3
3
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
-
var Avatar = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6
|
+
var Avatar = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
|
+
AvatarPrimitive.Root,
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
"data-slot": "avatar",
|
|
11
|
+
className: cn("ui-avatar", className),
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
));
|
|
7
15
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
8
16
|
var AvatarImage = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9
17
|
AvatarPrimitive.Image,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
2
|
+
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var ResizablePanelGroup = ({
|
|
6
|
+
className,
|
|
7
|
+
...props
|
|
8
|
+
}) => /* @__PURE__ */ jsx(
|
|
9
|
+
ResizablePrimitive.Group,
|
|
10
|
+
{
|
|
11
|
+
"data-slot": "resizable-panel-group",
|
|
12
|
+
className: cn("ui-resizable-panel-group", className),
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
ResizablePanelGroup.displayName = "ResizablePanelGroup";
|
|
17
|
+
var ResizablePanel = ({
|
|
18
|
+
className,
|
|
19
|
+
...props
|
|
20
|
+
}) => /* @__PURE__ */ jsx(
|
|
21
|
+
ResizablePrimitive.Panel,
|
|
22
|
+
{
|
|
23
|
+
"data-slot": "resizable-panel",
|
|
24
|
+
className: cn("ui-resizable-panel", className),
|
|
25
|
+
...props
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
ResizablePanel.displayName = "ResizablePanel";
|
|
29
|
+
var ResizableHandle = ({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}) => /* @__PURE__ */ jsx(
|
|
33
|
+
ResizablePrimitive.Separator,
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "resizable-handle",
|
|
36
|
+
className: cn("ui-resizable-handle", className),
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
ResizableHandle.displayName = "ResizableHandle";
|
|
41
|
+
|
|
42
|
+
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
4
|
+
import { ChevronDown } from 'lucide-react';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var NavigationMenu = NavigationMenuPrimitive.Root;
|
|
8
|
+
var NavigationMenuList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
9
|
+
NavigationMenuPrimitive.List,
|
|
10
|
+
{
|
|
11
|
+
ref,
|
|
12
|
+
"data-slot": "navigation-menu-list",
|
|
13
|
+
className: cn("ui-navigation-menu-list", className),
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
));
|
|
17
|
+
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
18
|
+
var NavigationMenuItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
19
|
+
NavigationMenuPrimitive.Item,
|
|
20
|
+
{
|
|
21
|
+
ref,
|
|
22
|
+
"data-slot": "navigation-menu-item",
|
|
23
|
+
className: cn("ui-navigation-menu-item", className),
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
));
|
|
27
|
+
NavigationMenuItem.displayName = NavigationMenuPrimitive.Item.displayName;
|
|
28
|
+
var NavigationMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
29
|
+
NavigationMenuPrimitive.Trigger,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
"data-slot": "navigation-menu-trigger",
|
|
33
|
+
className: cn("ui-navigation-menu-trigger", className),
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
children,
|
|
37
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "ui-navigation-menu-trigger-icon", "aria-hidden": "true" })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
));
|
|
41
|
+
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;
|
|
42
|
+
var NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
43
|
+
NavigationMenuPrimitive.Content,
|
|
44
|
+
{
|
|
45
|
+
ref,
|
|
46
|
+
"data-slot": "navigation-menu-content",
|
|
47
|
+
className: cn("ui-navigation-menu-content", className),
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
));
|
|
51
|
+
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;
|
|
52
|
+
var NavigationMenuLink = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
53
|
+
NavigationMenuPrimitive.Link,
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
"data-slot": "navigation-menu-link",
|
|
57
|
+
className: cn("ui-navigation-menu-link", className),
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
));
|
|
61
|
+
NavigationMenuLink.displayName = NavigationMenuPrimitive.Link.displayName;
|
|
62
|
+
var NavigationMenuIndicator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
63
|
+
NavigationMenuPrimitive.Indicator,
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
"data-slot": "navigation-menu-indicator",
|
|
67
|
+
className: cn("ui-navigation-menu-indicator", className),
|
|
68
|
+
...props
|
|
69
|
+
}
|
|
70
|
+
));
|
|
71
|
+
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
72
|
+
var NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
73
|
+
NavigationMenuPrimitive.Viewport,
|
|
74
|
+
{
|
|
75
|
+
ref,
|
|
76
|
+
"data-slot": "navigation-menu-viewport",
|
|
77
|
+
className: cn("ui-navigation-menu-viewport", className),
|
|
78
|
+
...props
|
|
79
|
+
}
|
|
80
|
+
));
|
|
81
|
+
NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;
|
|
82
|
+
|
|
83
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport };
|
|
@@ -56,16 +56,7 @@ AlertBase.displayName = "Alert";
|
|
|
56
56
|
var AlertTitle = React.forwardRef(
|
|
57
57
|
({ className, ...props }, ref) => {
|
|
58
58
|
const tone = React.useContext(AlertContext);
|
|
59
|
-
return /* @__PURE__ */ jsx(
|
|
60
|
-
"p",
|
|
61
|
-
{
|
|
62
|
-
ref,
|
|
63
|
-
"data-slot": "alert-title",
|
|
64
|
-
"data-tone": tone,
|
|
65
|
-
className,
|
|
66
|
-
...props
|
|
67
|
-
}
|
|
68
|
-
);
|
|
59
|
+
return /* @__PURE__ */ jsx("p", { ref, "data-slot": "alert-title", "data-tone": tone, className, ...props });
|
|
69
60
|
}
|
|
70
61
|
);
|
|
71
62
|
AlertTitle.displayName = "AlertTitle";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-
|
|
1
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-CAEL2ZD2.js';
|
|
2
2
|
import { Button } from './chunk-M4PZNAMV.js';
|
|
3
3
|
import { useTranslation, useOptionalAppContext, APP_LOCALES, resolveTimezonePickerOptions, getTimezoneLabel, APP_TIME_FORMAT_OPTIONS, getTimeFormatLabel } from './chunk-RLGHEV4A.js';
|
|
4
4
|
import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from './chunk-FXFJF4YA.js';
|
|
@@ -8,12 +8,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
8
8
|
import { Link } from 'react-router-dom';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
|
|
11
|
-
function Toolbar({
|
|
12
|
-
onClear,
|
|
13
|
-
hasActiveFilters = true,
|
|
14
|
-
className,
|
|
15
|
-
children
|
|
16
|
-
}) {
|
|
11
|
+
function Toolbar({ onClear, hasActiveFilters = true, className, children }) {
|
|
17
12
|
const { t } = useTranslation();
|
|
18
13
|
return /* @__PURE__ */ jsxs("div", { className: cn("ui-toolbar", className), children: [
|
|
19
14
|
children,
|