@godxjp/ui 9.1.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.
Files changed (145) hide show
  1. package/README.md +58 -29
  2. package/dist/app/index.d.ts +1 -1
  3. package/dist/app/index.js +4 -4
  4. package/dist/{app.prop-DnIXFzLi.d.ts → app.prop-Cy6dJnU8.d.ts} +18 -35
  5. package/dist/aspect-ratio-CZZJd9Km.d.ts +9 -0
  6. package/dist/{checkbox-ChRsR7Nk.d.ts → checkbox-em-oFM5D.d.ts} +1 -1
  7. package/dist/{chunk-LJLGABFV.js → chunk-2HXZT2WJ.js} +17 -9
  8. package/dist/{chunk-QLMXEJSY.js → chunk-3Q4A4U2P.js} +24 -1
  9. package/dist/{chunk-26CPAKUP.js → chunk-44YRPSZ7.js} +1 -2
  10. package/dist/{chunk-HB2OHB5X.js → chunk-5NCFLCM7.js} +27 -16
  11. package/dist/{chunk-FXFJF4YA.js → chunk-6CSBMMZS.js} +262 -31
  12. package/dist/{chunk-ZRRLOOBX.js → chunk-6HHSU6RG.js} +8 -6
  13. package/dist/{chunk-INSF6K3Y.js → chunk-7Q45MBFW.js} +7 -5
  14. package/dist/{chunk-O24Z3ULJ.js → chunk-BE6GJGKJ.js} +1 -1
  15. package/dist/{chunk-5D42MFB4.js → chunk-BG5RNXTH.js} +71 -2
  16. package/dist/{chunk-AINW5WYN.js → chunk-COD66MFF.js} +1 -2
  17. package/dist/{chunk-IOGU3ZWF.js → chunk-DNGJHWJZ.js} +3 -3
  18. package/dist/{chunk-3TS3G4U3.js → chunk-EE5DKOHX.js} +3 -1
  19. package/dist/{chunk-KXOAZGPA.js → chunk-EQZP53KI.js} +33 -8
  20. package/dist/{chunk-BHV2FUOA.js → chunk-EZHHJQWQ.js} +1 -1
  21. package/dist/{chunk-N3JPLJ3B.js → chunk-GDDCSKCB.js} +12 -5
  22. package/dist/{chunk-RLGHEV4A.js → chunk-HTG5VHU7.js} +10 -1
  23. package/dist/{chunk-R2W2FX5Q.js → chunk-I7NQ2LIL.js} +1 -9
  24. package/dist/{chunk-XQMPK4GM.js → chunk-IHRMOJXD.js} +86 -39
  25. package/dist/{chunk-TILFZBTE.js → chunk-INIIF7F7.js} +1 -4
  26. package/dist/{chunk-UIYEAUWA.js → chunk-IY347EQA.js} +2 -2
  27. package/dist/{chunk-HCM4JAC2.js → chunk-JWGLJXQU.js} +39 -11
  28. package/dist/{chunk-TO33OY4L.js → chunk-LMKUKCTN.js} +1 -1
  29. package/dist/chunk-NXVCI6YB.js +453 -0
  30. package/dist/{chunk-JBHXILI4.js → chunk-O6DQZYNI.js} +63 -44
  31. package/dist/{chunk-O2OUNXV4.js → chunk-P5KPCT6R.js} +3 -3
  32. package/dist/{chunk-56NYZNVY.js → chunk-PDXFQS7M.js} +112 -49
  33. package/dist/{chunk-F7PG4OEV.js → chunk-QSGW3ZWK.js} +12 -4
  34. package/dist/{chunk-25RYBC5T.js → chunk-S2IJKT3D.js} +1 -1
  35. package/dist/{chunk-OJZ6C2HM.js → chunk-SARQRCKO.js} +54 -48
  36. package/dist/chunk-T2QO2S65.js +126 -0
  37. package/dist/{chunk-442ULAA6.js → chunk-TGNBXS7H.js} +142 -62
  38. package/dist/{chunk-6J7GRCDA.js → chunk-UNVRNJCB.js} +71 -11
  39. package/dist/{chunk-6YBYAEXD.js → chunk-VSM44AYE.js} +94 -24
  40. package/dist/chunk-VSUYVT2Q.js +163 -0
  41. package/dist/{chunk-4R7QL3MW.js → chunk-X2VY4MOW.js} +14 -29
  42. package/dist/{chunk-FRU44GA2.js → chunk-XK3M3VRR.js} +16 -2
  43. package/dist/{chunk-6YK3IJXW.js → chunk-Z46J47FY.js} +73 -77
  44. package/dist/components/admin/index.d.ts +23 -13
  45. package/dist/components/admin/index.js +29 -30
  46. package/dist/components/data-display/badge.js +3 -3
  47. package/dist/components/data-display/card.d.ts +3 -3
  48. package/dist/components/data-display/card.js +1 -1
  49. package/dist/components/data-display/carousel.js +3 -1
  50. package/dist/components/data-display/index.js +55 -33
  51. package/dist/components/data-entry/calendar.d.ts +1 -1
  52. package/dist/components/data-entry/calendar.js +1 -1
  53. package/dist/components/data-entry/cascader.d.ts +1 -1
  54. package/dist/components/data-entry/cascader.js +5 -5
  55. package/dist/components/data-entry/checkbox.d.ts +2 -2
  56. package/dist/components/data-entry/checkbox.js +2 -2
  57. package/dist/components/data-entry/color-picker.d.ts +1 -1
  58. package/dist/components/data-entry/color-picker.js +3 -3
  59. package/dist/components/data-entry/date-picker.d.ts +2 -2
  60. package/dist/components/data-entry/date-picker.js +4 -4
  61. package/dist/components/data-entry/date-range-picker.d.ts +2 -2
  62. package/dist/components/data-entry/date-range-picker.js +4 -4
  63. package/dist/components/data-entry/index.d.ts +9 -25
  64. package/dist/components/data-entry/index.js +22 -26
  65. package/dist/components/data-entry/radio.d.ts +1 -1
  66. package/dist/components/data-entry/radio.js +2 -2
  67. package/dist/components/data-entry/select.d.ts +2 -2
  68. package/dist/components/data-entry/select.js +3 -4
  69. package/dist/components/data-entry/slider.d.ts +1 -1
  70. package/dist/components/data-entry/switch.d.ts +2 -2
  71. package/dist/components/data-entry/switch.js +1 -1
  72. package/dist/components/data-entry/time-input.js +2 -2
  73. package/dist/components/data-entry/time-picker.d.ts +3 -1
  74. package/dist/components/data-entry/time-picker.js +3 -3
  75. package/dist/components/data-entry/transfer.d.ts +2 -2
  76. package/dist/components/data-entry/transfer.js +5 -5
  77. package/dist/components/data-entry/tree-select.d.ts +1 -1
  78. package/dist/components/data-entry/tree-select.js +5 -5
  79. package/dist/components/data-entry/upload.d.ts +2 -2
  80. package/dist/components/data-entry/upload.js +5 -5
  81. package/dist/components/feedback/alert.js +5 -5
  82. package/dist/components/feedback/dialog.d.ts +20 -1
  83. package/dist/components/feedback/dialog.js +3 -3
  84. package/dist/components/feedback/index.d.ts +10 -18
  85. package/dist/components/feedback/index.js +9 -9
  86. package/dist/components/feedback/sheet.js +1 -1
  87. package/dist/components/layout/index.d.ts +27 -15
  88. package/dist/components/layout/index.js +7 -5
  89. package/dist/components/navigation/dropdown-menu.js +1 -1
  90. package/dist/components/navigation/index.d.ts +15 -17
  91. package/dist/components/navigation/index.js +7 -8
  92. package/dist/components/navigation/pagination.d.ts +25 -4
  93. package/dist/components/navigation/pagination.js +4 -5
  94. package/dist/components/navigation/steps.d.ts +3 -3
  95. package/dist/components/navigation/steps.js +3 -1
  96. package/dist/components/query/index.d.ts +1 -5
  97. package/dist/components/query/index.js +6 -8
  98. package/dist/components/ui/index.d.ts +13 -12
  99. package/dist/components/ui/index.js +30 -32
  100. package/dist/{data-entry.prop-CDkOajPj.d.ts → data-entry.prop-BR4vNA1j.d.ts} +7 -35
  101. package/dist/filter-bar-BxjSJJnQ.d.ts +7 -0
  102. package/dist/{inline-DCqn4O29.d.ts → flex-D_EXRFSW.d.ts} +2 -8
  103. package/dist/form/index.js +1 -1
  104. package/dist/i18n/index.d.ts +82 -10
  105. package/dist/i18n/index.js +2 -2
  106. package/dist/index.d.ts +7 -7
  107. package/dist/index.js +41 -44
  108. package/dist/{layout.prop-DwJKI6ka.d.ts → layout.prop-JE2TcRyL.d.ts} +8 -2
  109. package/dist/lib/datetime/index.js +1 -1
  110. package/dist/{navigation.prop-8DgElO0c.d.ts → navigation.prop-DMcXkR-J.d.ts} +9 -11
  111. package/dist/{toggle-group-BulJgKh3.d.ts → password-strength-DVRvXEOK.d.ts} +24 -3
  112. package/dist/props/components/index.d.ts +4 -4
  113. package/dist/props/index.d.ts +4 -4
  114. package/dist/props/index.js +1 -1
  115. package/dist/props/registry.d.ts +84 -39
  116. package/dist/props/registry.js +1 -1
  117. package/dist/{search-input-cezAxpgb.d.ts → search-input-DpqDMXcn.d.ts} +2 -4
  118. package/dist/{skeleton-uWAjSacg.d.ts → skeleton-cj9kh5wo.d.ts} +1 -3
  119. package/dist/styles/control.css +176 -41
  120. package/dist/styles/data-display-layout.css +41 -15
  121. package/dist/styles/data-entry-layout.css +71 -0
  122. package/dist/styles/feedback-layout.css +44 -12
  123. package/dist/styles/index.css +45 -1
  124. package/dist/styles/layout.css +66 -17
  125. package/dist/styles/navigation-layout.css +3 -1
  126. package/dist/styles/shell-layout.css +3 -3
  127. package/dist/styles/table-layout.css +13 -0
  128. package/dist/tokens/foundation.css +12 -1
  129. package/dist/tokens/semantic/layout.css +2 -2
  130. package/dist/tooltip-Bf2KjRy8.d.ts +14 -0
  131. package/package.json +7 -7
  132. package/scripts/ui-audit.mjs +31 -2
  133. package/dist/aspect-ratio-DGoYrOry.d.ts +0 -6
  134. package/dist/chunk-CAEL2ZD2.js +0 -222
  135. package/dist/chunk-FYM3MJSK.js +0 -59
  136. package/dist/chunk-GKXPALFT.js +0 -32
  137. package/dist/chunk-JKHWLPM5.js +0 -101
  138. package/dist/chunk-KDBGFJJI.js +0 -220
  139. package/dist/chunk-VN72SWHX.js +0 -189
  140. package/dist/components/data-entry/autocomplete.d.ts +0 -24
  141. package/dist/components/data-entry/autocomplete.js +0 -10
  142. package/dist/components/data-entry/combobox.d.ts +0 -22
  143. package/dist/components/data-entry/combobox.js +0 -6
  144. package/dist/filter-bar-BycYH10i.d.ts +0 -14
  145. /package/dist/{chunk-LDSLS6HE.js → chunk-7CFO5FFE.js} +0 -0
@@ -1,32 +0,0 @@
1
- import { SearchSelect } from './chunk-KDBGFJJI.js';
2
- import { jsx } from 'react/jsx-runtime';
3
-
4
- function Autocomplete({
5
- options,
6
- value,
7
- onValueChange,
8
- placeholder,
9
- searchPlaceholder,
10
- emptyMessage,
11
- disabled,
12
- className,
13
- id
14
- }) {
15
- return /* @__PURE__ */ jsx(
16
- SearchSelect,
17
- {
18
- id,
19
- value,
20
- onValueChange: (next) => onValueChange?.(next),
21
- options,
22
- clearable: false,
23
- placeholder,
24
- searchPlaceholder,
25
- emptyMessage,
26
- disabled,
27
- className
28
- }
29
- );
30
- }
31
-
32
- export { Autocomplete };
@@ -1,101 +0,0 @@
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 };
@@ -1,220 +0,0 @@
1
- import { Command, CommandList, CommandItem, CommandGroup } from './chunk-HTEL5DQI.js';
2
- import { Input } from './chunk-VOHTRR5X.js';
3
- import { Button } from './chunk-M4PZNAMV.js';
4
- import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
5
- import { useTranslation } from './chunk-RLGHEV4A.js';
6
- import { cn } from './chunk-U7N2A7A3.js';
7
- import * as React from 'react';
8
- import { ChevronsUpDown, Check, Loader2 } from 'lucide-react';
9
- import { jsxs, jsx } from 'react/jsx-runtime';
10
-
11
- var DEBOUNCE_MS = 250;
12
- function SearchSelect({
13
- value = "",
14
- onValueChange,
15
- options: staticOptions,
16
- loadOptions,
17
- renderOption,
18
- selectedLabel,
19
- placeholder,
20
- searchPlaceholder,
21
- emptyMessage,
22
- loadingMessage,
23
- clearLabel,
24
- clearable = true,
25
- disabled = false,
26
- name,
27
- id,
28
- className,
29
- "data-testid": dataTestId
30
- }) {
31
- const { t } = useTranslation();
32
- const [open, setOpen] = React.useState(false);
33
- const [query, setQuery] = React.useState("");
34
- const [debouncedQuery, setDebouncedQuery] = React.useState("");
35
- const [loaded, setLoaded] = React.useState([]);
36
- const [page, setPage] = React.useState(1);
37
- const [hasMore, setHasMore] = React.useState(false);
38
- const [loading, setLoading] = React.useState(false);
39
- const [activeIndex, setActiveIndex] = React.useState(0);
40
- const [picked, setPicked] = React.useState(null);
41
- const reqId = React.useRef(0);
42
- const resolvedLoad = React.useMemo(
43
- () => loadOptions ?? (async ({ query: search }) => {
44
- const needle = search.trim().toLowerCase();
45
- const list = staticOptions ?? [];
46
- return {
47
- options: needle ? list.filter(
48
- (option) => option.label.toLowerCase().includes(needle) || option.value.toLowerCase().includes(needle)
49
- ) : list,
50
- hasMore: false
51
- };
52
- }),
53
- [loadOptions, staticOptions]
54
- );
55
- React.useEffect(() => {
56
- const handle = window.setTimeout(() => setDebouncedQuery(query.trim()), DEBOUNCE_MS);
57
- return () => window.clearTimeout(handle);
58
- }, [query]);
59
- const fetchPage = React.useCallback(
60
- async (nextPage, search, append) => {
61
- const ticket = ++reqId.current;
62
- setLoading(true);
63
- try {
64
- const result = await resolvedLoad({ query: search, page: nextPage });
65
- if (ticket !== reqId.current) return;
66
- setLoaded((prev) => append ? [...prev, ...result.options] : result.options);
67
- setHasMore(Boolean(result.hasMore));
68
- setPage(nextPage);
69
- } finally {
70
- if (ticket === reqId.current) setLoading(false);
71
- }
72
- },
73
- [resolvedLoad]
74
- );
75
- React.useEffect(() => {
76
- if (!open) return;
77
- setActiveIndex(0);
78
- void fetchPage(1, debouncedQuery, false);
79
- }, [open, debouncedQuery, fetchPage]);
80
- const grouped = React.useMemo(() => {
81
- const order = [];
82
- const buckets = /* @__PURE__ */ new Map();
83
- for (const option of loaded) {
84
- const key = option.group ?? "";
85
- if (!buckets.has(key)) {
86
- buckets.set(key, []);
87
- order.push(key);
88
- }
89
- buckets.get(key).push(option);
90
- }
91
- let flatIndex = 0;
92
- return order.map((key) => ({
93
- heading: key || void 0,
94
- items: (buckets.get(key) ?? []).map((option) => ({ option, index: flatIndex++ }))
95
- }));
96
- }, [loaded]);
97
- const flatOrdered = React.useMemo(
98
- () => grouped.flatMap((group) => group.items.map((entry) => entry.option)),
99
- [grouped]
100
- );
101
- const resolvedPlaceholder = placeholder ?? t("dataEntry.searchSelect.placeholder");
102
- const currentLabel = value ? picked?.label ?? selectedLabel ?? resolvedPlaceholder : resolvedPlaceholder;
103
- const select = (option) => {
104
- if (option.disabled) return;
105
- setPicked(option);
106
- onValueChange?.(option.value, option);
107
- setOpen(false);
108
- };
109
- const clear = () => {
110
- setPicked(null);
111
- onValueChange?.("", void 0);
112
- setOpen(false);
113
- };
114
- const onScroll = (event) => {
115
- const el = event.currentTarget;
116
- if (el.scrollHeight - el.scrollTop - el.clientHeight < 48 && hasMore && !loading) {
117
- void fetchPage(page + 1, debouncedQuery, true);
118
- }
119
- };
120
- const onKeyDown = (event) => {
121
- if (event.key === "ArrowDown") {
122
- event.preventDefault();
123
- setActiveIndex((i) => Math.min(i + 1, Math.max(flatOrdered.length - 1, 0)));
124
- } else if (event.key === "ArrowUp") {
125
- event.preventDefault();
126
- setActiveIndex((i) => Math.max(i - 1, 0));
127
- } else if (event.key === "Enter" && flatOrdered[activeIndex]) {
128
- event.preventDefault();
129
- select(flatOrdered[activeIndex]);
130
- } else if (event.key === "Escape") {
131
- event.preventDefault();
132
- setOpen(false);
133
- }
134
- };
135
- const optionTestId = (optionValue) => dataTestId ? `${dataTestId}-option-${optionValue}` : void 0;
136
- return /* @__PURE__ */ jsxs(
137
- Popover,
138
- {
139
- open,
140
- onOpenChange: (next) => {
141
- setOpen(next);
142
- if (!next) setQuery("");
143
- },
144
- children: [
145
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
146
- Button,
147
- {
148
- id,
149
- type: "button",
150
- variant: "outline",
151
- role: "combobox",
152
- "aria-expanded": open,
153
- disabled,
154
- "data-testid": dataTestId,
155
- className: cn("w-full justify-between font-normal", className),
156
- children: [
157
- /* @__PURE__ */ jsx("span", { className: cn("truncate text-left", !value && "text-muted-foreground"), children: currentLabel }),
158
- /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 size-4 shrink-0 opacity-50", "aria-hidden": "true" })
159
- ]
160
- }
161
- ) }),
162
- name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value }) : null,
163
- /* @__PURE__ */ jsx(
164
- PopoverContent,
165
- {
166
- align: "start",
167
- sideOffset: 4,
168
- collisionPadding: 12,
169
- className: "flex max-h-[min(24rem,var(--radix-popover-content-available-height))] w-max max-w-[min(32rem,calc(100vw-1.5rem))] min-w-[var(--radix-popover-trigger-width)] flex-col p-0",
170
- children: /* @__PURE__ */ jsxs(Command, { shouldFilter: false, className: "flex min-h-0 flex-col", children: [
171
- /* @__PURE__ */ jsx("div", { className: "border-border shrink-0 border-b p-2", children: /* @__PURE__ */ jsx(
172
- Input,
173
- {
174
- autoFocus: true,
175
- value: query,
176
- onChange: (event) => setQuery(event.target.value),
177
- onKeyDown,
178
- placeholder: searchPlaceholder ?? t("dataEntry.searchSelect.search")
179
- }
180
- ) }),
181
- /* @__PURE__ */ jsxs(CommandList, { className: "min-h-0 flex-1 overflow-y-auto p-1", onScroll, children: [
182
- clearable && value ? /* @__PURE__ */ jsx(CommandItem, { value: "", "data-testid": optionTestId("none"), onSelect: clear, children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: clearLabel ?? t("dataEntry.searchSelect.clear") }) }) : null,
183
- grouped.map((group) => {
184
- const rows = group.items.map(({ option, index }) => /* @__PURE__ */ jsxs(
185
- CommandItem,
186
- {
187
- value: option.value,
188
- "data-testid": optionTestId(option.value),
189
- "aria-selected": activeIndex === index,
190
- disabled: option.disabled,
191
- className: activeIndex === index ? "bg-accent text-accent-foreground" : void 0,
192
- onMouseEnter: () => setActiveIndex(index),
193
- onSelect: () => select(option),
194
- children: [
195
- renderOption ? /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: renderOption(option) }) : /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
196
- /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: option.label }),
197
- option.sublabel ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground truncate text-xs", children: option.sublabel }) : null
198
- ] }),
199
- value === option.value ? /* @__PURE__ */ jsx(Check, { className: "text-primary size-4 shrink-0", "aria-hidden": "true" }) : null
200
- ]
201
- },
202
- option.value
203
- ));
204
- return group.heading ? /* @__PURE__ */ jsx(CommandGroup, { heading: group.heading, children: rows }, group.heading) : /* @__PURE__ */ jsx(React.Fragment, { children: rows }, "__ungrouped");
205
- }),
206
- loading ? /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-center gap-2 px-2 py-3 text-sm", children: [
207
- /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }),
208
- loadingMessage ?? t("dataEntry.searchSelect.loading")
209
- ] }) : null,
210
- !loading && loaded.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground px-2 py-6 text-center text-sm", children: emptyMessage ?? t("dataEntry.searchSelect.empty") }) : null
211
- ] })
212
- ] })
213
- }
214
- )
215
- ]
216
- }
217
- );
218
- }
219
-
220
- export { SearchSelect };
@@ -1,189 +0,0 @@
1
- import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-CAEL2ZD2.js';
2
- import { Button } from './chunk-M4PZNAMV.js';
3
- import { useTranslation, useOptionalAppContext, APP_LOCALES, resolveTimezonePickerOptions, getTimezoneLabel, APP_TIME_FORMAT_OPTIONS, getTimeFormatLabel } from './chunk-RLGHEV4A.js';
4
- import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from './chunk-FXFJF4YA.js';
5
- import { cn } from './chunk-U7N2A7A3.js';
6
- import { X, ChevronRight, Languages, Globe, Clock, CalendarDays } from 'lucide-react';
7
- import { jsxs, jsx } from 'react/jsx-runtime';
8
- import * as React from 'react';
9
-
10
- function Toolbar({ onClear, hasActiveFilters = true, className, children }) {
11
- const { t } = useTranslation();
12
- return /* @__PURE__ */ jsxs("div", { className: cn("ui-toolbar", className), children: [
13
- children,
14
- onClear && hasActiveFilters && /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: onClear, className: "ui-toolbar-clear", children: [
15
- /* @__PURE__ */ jsx(X, { "aria-hidden": "true" }),
16
- t("common.clearFilters")
17
- ] })
18
- ] });
19
- }
20
- function ToolbarGroup({ label, className, children }) {
21
- return /* @__PURE__ */ jsxs("div", { className: cn("ui-stack-xs ui-toolbar-group", className), children: [
22
- /* @__PURE__ */ jsx("div", { className: "ui-toolbar-label", children: label }),
23
- children
24
- ] });
25
- }
26
- var FilterBar = Toolbar;
27
- var FilterGroup = ToolbarGroup;
28
- function PageHeader({
29
- title,
30
- description,
31
- breadcrumb,
32
- actions,
33
- linkComponent: LinkComponent = "a",
34
- className
35
- }) {
36
- return /* @__PURE__ */ jsxs("header", { className: cn("ui-page-header", className), children: [
37
- breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("nav", { "aria-label": "Breadcrumb", className: "ui-breadcrumb", children: /* @__PURE__ */ jsx("ol", { className: "ui-breadcrumb-list", children: breadcrumb.map((item, i) => {
38
- const isLast = i === breadcrumb.length - 1;
39
- return /* @__PURE__ */ jsxs("li", { className: "ui-inline-xs", children: [
40
- item.to && !isLast ? /* @__PURE__ */ jsx(
41
- LinkComponent,
42
- {
43
- href: item.to,
44
- to: item.to,
45
- className: "hover:text-foreground hover:underline",
46
- children: item.label
47
- }
48
- ) : /* @__PURE__ */ jsx(
49
- "span",
50
- {
51
- className: isLast ? "text-foreground" : "",
52
- "aria-current": isLast ? "page" : void 0,
53
- children: item.label
54
- }
55
- ),
56
- !isLast && /* @__PURE__ */ jsx(ChevronRight, { className: "size-3", "aria-hidden": "true" })
57
- ] }, i);
58
- }) }) }),
59
- /* @__PURE__ */ jsxs("div", { className: "ui-page-header-row", children: [
60
- /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
61
- /* @__PURE__ */ jsx("h1", { className: "ui-page-title", children: title }),
62
- description && /* @__PURE__ */ jsx("p", { className: "ui-page-subtitle", children: description })
63
- ] }),
64
- actions && /* @__PURE__ */ jsx("div", { className: "ui-inline-sm shrink-0", children: actions })
65
- ] })
66
- ] });
67
- }
68
- function LocalePicker({ className, disabled, id, value, onValueChange }) {
69
- const ctx = useOptionalAppContext();
70
- const { t } = useTranslation();
71
- const current = value ?? ctx?.locale;
72
- const handleChange = onValueChange ?? ctx?.setLocale;
73
- if (current === void 0 || !handleChange) {
74
- throw new Error("LocalePicker requires <AppProvider> or controlled value + onValueChange");
75
- }
76
- return /* @__PURE__ */ jsxs(Select, { value: current, onValueChange: handleChange, disabled, children: [
77
- /* @__PURE__ */ jsxs(
78
- SelectTrigger,
79
- {
80
- id,
81
- className: cn("w-full sm:w-40", className),
82
- "aria-label": t("navigation.localePicker.ariaLabel"),
83
- children: [
84
- /* @__PURE__ */ jsx(Languages, { className: "mr-2 size-4 shrink-0 opacity-70", "aria-hidden": "true" }),
85
- /* @__PURE__ */ jsx(SelectValue, {})
86
- ]
87
- }
88
- ),
89
- /* @__PURE__ */ jsx(SelectContent, { children: APP_LOCALES.map((code) => /* @__PURE__ */ jsx(SelectItem, { value: code, children: t(`locale.${code}`) }, code)) })
90
- ] });
91
- }
92
- function TimezonePicker({
93
- className,
94
- disabled,
95
- id,
96
- value,
97
- onValueChange,
98
- options: optionsProp
99
- }) {
100
- const ctx = useOptionalAppContext();
101
- const { t, locale, fallbackLocale } = useTranslation();
102
- const current = value ?? ctx?.timezone;
103
- const handleChange = onValueChange ?? ctx?.setTimezone;
104
- const configured = optionsProp ?? ctx?.timezoneOptions;
105
- if (current === void 0 || !handleChange) {
106
- throw new Error("TimezonePicker requires <AppProvider> or controlled value + onValueChange");
107
- }
108
- const options = React.useMemo(
109
- () => resolveTimezonePickerOptions(configured, current),
110
- [configured, current]
111
- );
112
- return /* @__PURE__ */ jsxs(Select, { value: current, onValueChange: handleChange, disabled, children: [
113
- /* @__PURE__ */ jsxs(
114
- SelectTrigger,
115
- {
116
- id,
117
- className: cn("w-full sm:w-56", className),
118
- "aria-label": t("navigation.timezonePicker.ariaLabel"),
119
- children: [
120
- /* @__PURE__ */ jsx(Globe, { className: "mr-2 size-4 shrink-0 opacity-70", "aria-hidden": "true" }),
121
- /* @__PURE__ */ jsx(SelectValue, {})
122
- ]
123
- }
124
- ),
125
- /* @__PURE__ */ jsx(SelectContent, { children: options.map((tz) => /* @__PURE__ */ jsx(SelectItem, { value: tz, children: getTimezoneLabel(tz, locale, fallbackLocale) }, tz)) })
126
- ] });
127
- }
128
- function TimeFormatPicker({
129
- className,
130
- disabled,
131
- id,
132
- value,
133
- onValueChange
134
- }) {
135
- const ctx = useOptionalAppContext();
136
- const { t, locale, fallbackLocale } = useTranslation();
137
- const current = value ?? ctx?.timeFormat;
138
- const handleChange = onValueChange ?? ctx?.setTimeFormat;
139
- if (current === void 0 || !handleChange) {
140
- throw new Error("TimeFormatPicker requires <AppProvider> or controlled value + onValueChange");
141
- }
142
- return /* @__PURE__ */ jsxs(Select, { value: current, onValueChange: handleChange, disabled, children: [
143
- /* @__PURE__ */ jsxs(
144
- SelectTrigger,
145
- {
146
- id,
147
- className: cn("w-full sm:w-44", className),
148
- "aria-label": t("navigation.timeFormatPicker.ariaLabel"),
149
- children: [
150
- /* @__PURE__ */ jsx(Clock, { className: "mr-2 size-4 shrink-0 opacity-70", "aria-hidden": "true" }),
151
- /* @__PURE__ */ jsx(SelectValue, {})
152
- ]
153
- }
154
- ),
155
- /* @__PURE__ */ jsx(SelectContent, { children: APP_TIME_FORMAT_OPTIONS.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: getTimeFormatLabel(option.value, locale, fallbackLocale) }, option.value)) })
156
- ] });
157
- }
158
- function DateFormatPicker({
159
- className,
160
- disabled,
161
- id,
162
- value,
163
- onValueChange
164
- }) {
165
- const ctx = useOptionalAppContext();
166
- const { t, locale, fallbackLocale } = useTranslation();
167
- const current = value ?? ctx?.dateFormat;
168
- const handleChange = onValueChange ?? ctx?.setDateFormat;
169
- if (current === void 0 || !handleChange) {
170
- throw new Error("DateFormatPicker requires <AppProvider> or controlled value + onValueChange");
171
- }
172
- return /* @__PURE__ */ jsxs(Select, { value: current, onValueChange: handleChange, disabled, children: [
173
- /* @__PURE__ */ jsxs(
174
- SelectTrigger,
175
- {
176
- id,
177
- className: cn("w-full sm:w-44", className),
178
- "aria-label": t("navigation.dateFormatPicker.ariaLabel"),
179
- children: [
180
- /* @__PURE__ */ jsx(CalendarDays, { className: "mr-2 size-4 shrink-0 opacity-70", "aria-hidden": "true" }),
181
- /* @__PURE__ */ jsx(SelectValue, {})
182
- ]
183
- }
184
- ),
185
- /* @__PURE__ */ jsx(SelectContent, { children: APP_DATE_FORMAT_OPTIONS.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: getDateFormatLabel(option.value, locale, fallbackLocale) }, option.value)) })
186
- ] });
187
- }
188
-
189
- export { DateFormatPicker, FilterBar, FilterGroup, LocalePicker, PageHeader, TimeFormatPicker, TimezonePicker, Toolbar, ToolbarGroup };
@@ -1,24 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as AutocompleteProp } from '../../data-entry.prop-CDkOajPj.js';
3
- import '@radix-ui/react-checkbox';
4
- import '@radix-ui/react-radio-group';
5
- import '@radix-ui/react-slider';
6
- import '@radix-ui/react-switch';
7
- import 'react-day-picker';
8
- import 'react';
9
- import '../../shared.prop-BsNSXeqD.js';
10
- import '../../content.prop-DrV_zDy-.js';
11
- import '../../data.prop-DMYMNl6L.js';
12
- import '../../interaction.prop-DSFizzP6.js';
13
- import '../../layout.prop-CXvl2rVR.js';
14
-
15
- /**
16
- * Searchable combobox over a static list.
17
- *
18
- * @deprecated Prefer {@link SearchSelect} with a static `options` array — it is a strict superset
19
- * (optgroup grouping, sublabels, async `loadOptions`, custom `renderOption`). `Autocomplete` is
20
- * now a thin wrapper kept for backward compatibility.
21
- */
22
- declare function Autocomplete({ options, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, disabled, className, id, }: AutocompleteProp): react_jsx_runtime.JSX.Element;
23
-
24
- export { Autocomplete, AutocompleteProp, AutocompleteProp as AutocompleteProps };
@@ -1,10 +0,0 @@
1
- export { Autocomplete } from '../../chunk-GKXPALFT.js';
2
- import '../../chunk-KDBGFJJI.js';
3
- import '../../chunk-HTEL5DQI.js';
4
- import '../../chunk-VOHTRR5X.js';
5
- import '../../chunk-M4PZNAMV.js';
6
- import '../../chunk-DY5C44UP.js';
7
- import '../../chunk-IBK5D2Q6.js';
8
- import '../../chunk-RLGHEV4A.js';
9
- import '../../chunk-FXFJF4YA.js';
10
- import '../../chunk-U7N2A7A3.js';
@@ -1,22 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- type ComboboxOption = {
4
- value: string;
5
- label: string;
6
- };
7
- type ComboboxProps = {
8
- options: ComboboxOption[];
9
- value?: string;
10
- defaultValue?: string;
11
- onValueChange?: (value: string) => void;
12
- placeholder?: string;
13
- searchPlaceholder?: string;
14
- emptyText?: string;
15
- disabled?: boolean;
16
- name?: string;
17
- id?: string;
18
- className?: string;
19
- };
20
- declare const Combobox: ({ options, value: controlledValue, defaultValue, onValueChange, placeholder, searchPlaceholder, emptyText, disabled, name, id, className, }: ComboboxProps) => react_jsx_runtime.JSX.Element;
21
-
22
- export { Combobox, type ComboboxOption, type ComboboxProps };
@@ -1,6 +0,0 @@
1
- export { Combobox } from '../../chunk-JKHWLPM5.js';
2
- import '../../chunk-HTEL5DQI.js';
3
- import '../../chunk-M4PZNAMV.js';
4
- import '../../chunk-DY5C44UP.js';
5
- import '../../chunk-IBK5D2Q6.js';
6
- import '../../chunk-U7N2A7A3.js';
@@ -1,14 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { d as PageHeaderProp } from './layout.prop-DwJKI6ka.js';
3
- import { f as ToolbarProp, e as ToolbarGroupProp } from './navigation.prop-8DgElO0c.js';
4
-
5
- declare function PageHeader({ title, description, breadcrumb, actions, linkComponent: LinkComponent, className, }: PageHeaderProp): react_jsx_runtime.JSX.Element;
6
-
7
- declare function Toolbar({ onClear, hasActiveFilters, className, children }: ToolbarProp): react_jsx_runtime.JSX.Element;
8
- declare function ToolbarGroup({ label, className, children }: ToolbarGroupProp): react_jsx_runtime.JSX.Element;
9
- /** @deprecated Use Toolbar. */
10
- declare const FilterBar: typeof Toolbar;
11
- /** @deprecated Use ToolbarGroup. */
12
- declare const FilterGroup: typeof ToolbarGroup;
13
-
14
- export { FilterBar as F, PageHeader as P, Toolbar as T, FilterGroup as a, ToolbarGroup as b };
File without changes