@godxjp/ui 21.0.0 → 23.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 (154) hide show
  1. package/README.md +4 -4
  2. package/dist/app/app-provider.js +2 -1
  3. package/dist/components/data-display/badge.d.ts +28 -1
  4. package/dist/components/data-display/badge.js +2 -0
  5. package/dist/components/data-display/data-table.d.ts +18 -2
  6. package/dist/components/data-display/data-table.js +4 -0
  7. package/dist/components/data-display/index.d.ts +1 -1
  8. package/dist/components/data-display/popover.d.ts +19 -1
  9. package/dist/components/data-display/popover.js +9 -1
  10. package/dist/components/data-display/progress.d.ts +37 -0
  11. package/dist/components/data-display/progress.js +57 -5
  12. package/dist/components/data-display/scroll-area.d.ts +24 -4
  13. package/dist/components/data-display/scroll-area.js +34 -72
  14. package/dist/components/data-entry/cascader.js +8 -6
  15. package/dist/components/data-entry/checkbox.js +2 -0
  16. package/dist/components/data-entry/choice-hit-target.d.ts +24 -0
  17. package/dist/components/data-entry/choice-hit-target.js +12 -0
  18. package/dist/components/data-entry/control-surface.d.ts +8 -0
  19. package/dist/components/data-entry/control-surface.js +10 -1
  20. package/dist/components/data-entry/date-picker.d.ts +10 -3
  21. package/dist/components/data-entry/date-picker.js +503 -238
  22. package/dist/components/data-entry/form-field.d.ts +1 -1
  23. package/dist/components/data-entry/form-field.js +7 -3
  24. package/dist/components/data-entry/form.js +10 -1
  25. package/dist/components/data-entry/index.d.ts +0 -6
  26. package/dist/components/data-entry/index.js +0 -6
  27. package/dist/components/data-entry/label.d.ts +14 -1
  28. package/dist/components/data-entry/label.js +6 -1
  29. package/dist/components/data-entry/radio.d.ts +27 -6
  30. package/dist/components/data-entry/radio.js +89 -43
  31. package/dist/components/data-entry/search-select.js +226 -89
  32. package/dist/components/data-entry/select.d.ts +76 -14
  33. package/dist/components/data-entry/select.js +497 -163
  34. package/dist/components/data-entry/slider.d.ts +3 -11
  35. package/dist/components/data-entry/slider.js +582 -93
  36. package/dist/components/data-entry/switch.d.ts +6 -3
  37. package/dist/components/data-entry/switch.js +36 -11
  38. package/dist/components/layout/mobile-shell.d.ts +1 -1
  39. package/dist/components/layout/mobile-shell.js +2 -0
  40. package/dist/components/navigation/dropdown-menu.d.ts +11 -3
  41. package/dist/components/navigation/dropdown-menu.js +190 -15
  42. package/dist/components/navigation/index.d.ts +0 -3
  43. package/dist/components/navigation/index.js +0 -78
  44. package/dist/components/navigation/steps.d.ts +1 -1
  45. package/dist/components/navigation/steps.js +3 -1
  46. package/dist/components/navigation/tabs-scroll.d.ts +27 -0
  47. package/dist/components/navigation/tabs-scroll.js +52 -1
  48. package/dist/components/navigation/tabs.d.ts +2 -2
  49. package/dist/components/navigation/tabs.js +88 -23
  50. package/dist/components/ui/index.d.ts +0 -4
  51. package/dist/components/ui/index.js +0 -4
  52. package/dist/components/ui/input-otp.d.ts +1 -1
  53. package/dist/components/ui/segmented.d.ts +15 -1
  54. package/dist/components/ui/segmented.js +15 -6
  55. package/dist/components/ui/tag-input.js +3 -5
  56. package/dist/i18n/messages/en.json +3 -2
  57. package/dist/i18n/messages/ja.json +3 -2
  58. package/dist/i18n/messages/vi.json +3 -2
  59. package/dist/lib/datetime/picker-format.d.ts +18 -0
  60. package/dist/lib/datetime/picker-format.js +35 -1
  61. package/dist/lib/field-a11y.d.ts +12 -0
  62. package/dist/lib/field-a11y.js +14 -1
  63. package/dist/lib/select-options.d.ts +21 -0
  64. package/dist/lib/select-options.js +46 -0
  65. package/dist/props/components/data-display.prop.d.ts +16 -6
  66. package/dist/props/components/data-entry.prop.d.ts +503 -129
  67. package/dist/props/components/index.d.ts +2 -2
  68. package/dist/props/components/layout.prop.d.ts +12 -1
  69. package/dist/props/components/navigation.prop.d.ts +93 -1
  70. package/dist/props/registry.d.ts +79 -16
  71. package/dist/props/registry.js +85 -15
  72. package/dist/props/vocabulary/data.prop.d.ts +12 -0
  73. package/dist/props/vocabulary/index.d.ts +2 -2
  74. package/dist/props/vocabulary/layout.prop.d.ts +11 -0
  75. package/dist/styles/badge-layout.css +4 -0
  76. package/dist/styles/card-layout.css +6 -6
  77. package/dist/styles/control.css +220 -29
  78. package/dist/styles/data-display-layout.css +94 -23
  79. package/dist/styles/focus-ring.css +6 -4
  80. package/dist/styles/fonts.css +88 -4
  81. package/dist/styles/navigation-layout.css +36 -236
  82. package/dist/styles/shell-layout.css +149 -139
  83. package/dist/styles/table-layout.css +41 -3
  84. package/dist/tokens/components/control.css +4 -0
  85. package/dist/tokens/components/data-display.css +9 -5
  86. package/dist/tokens/components/navigation.css +9 -5
  87. package/dist/tokens/components/scroll-area.css +7 -0
  88. package/dist/tokens/components/segmented.css +0 -2
  89. package/dist/tokens/components/shell.css +2 -0
  90. package/dist/tokens/components/table.css +3 -0
  91. package/dist/tokens/foundation.css +7 -0
  92. package/docs/COMPONENTS.md +14 -14
  93. package/docs/CONSUMER-RULES.md +24 -1
  94. package/docs/CUSTOMER-THEMING.md +7 -1
  95. package/docs/FRAME-COVERAGE-REPORT.md +5 -11
  96. package/docs/TOKENS.md +65 -0
  97. package/docs/data-display/badge.tsx +37 -0
  98. package/docs/data-display/data-table/index.tsx +45 -1
  99. package/docs/data-display/popover.tsx +43 -5
  100. package/docs/data-display/progress.tsx +28 -0
  101. package/docs/data-display/scroll-area.tsx +51 -45
  102. package/docs/data-entry/calendar.tsx +2 -2
  103. package/docs/data-entry/date-picker.tsx +144 -5
  104. package/docs/data-entry/form/examples/invoice-form.tsx +2 -2
  105. package/docs/data-entry/form-field/examples/a11y-contract.tsx +3 -5
  106. package/docs/data-entry/form.tsx +4 -4
  107. package/docs/data-entry/input-otp.tsx +5 -2
  108. package/docs/data-entry/number-input.tsx +31 -0
  109. package/docs/data-entry/segmented.tsx +143 -2
  110. package/docs/data-entry/select-matrix.tsx +1 -2
  111. package/docs/data-entry/select.tsx +108 -3
  112. package/docs/data-entry/slider.tsx +125 -47
  113. package/docs/feedback/dialog.tsx +1 -2
  114. package/docs/feedback/sheet.tsx +1 -2
  115. package/docs/layout/app-shell-states.tsx +143 -0
  116. package/docs/layout/mobile-shell.tsx +5 -0
  117. package/docs/navigation/dropdown-menu.tsx +75 -4
  118. package/docs/navigation/tabs.tsx +149 -0
  119. package/docs/roadmap/antd-parity.md +35 -34
  120. package/docs/roadmap/parity-audit-data-entry.md +196 -172
  121. package/docs/roadmap/parity-audit-layout-navigation-general.md +304 -310
  122. package/docs/roadmap/parity-backlog.md +8 -10
  123. package/docs/showcase/acme-portal.tsx +7 -0
  124. package/package.json +28 -64
  125. package/scripts/ui-audit.mjs +18 -5
  126. package/scripts/visual-audit-rules.mjs +0 -7
  127. package/scripts/visual-audit.mjs +6 -27
  128. package/dist/components/data-entry/date-range-picker.d.ts +0 -11
  129. package/dist/components/data-entry/date-range-picker.js +0 -349
  130. package/dist/components/data-entry/month-picker.d.ts +0 -10
  131. package/dist/components/data-entry/month-picker.js +0 -241
  132. package/dist/components/data-entry/month-range-picker.d.ts +0 -10
  133. package/dist/components/data-entry/month-range-picker.js +0 -301
  134. package/dist/components/navigation/context-menu.d.ts +0 -21
  135. package/dist/components/navigation/context-menu.js +0 -149
  136. package/dist/components/navigation/menubar.d.ts +0 -21
  137. package/dist/components/navigation/menubar.js +0 -136
  138. package/dist/components/navigation/navigation-menu.d.ts +0 -10
  139. package/dist/components/navigation/navigation-menu.js +0 -91
  140. package/dist/components/ui/context-menu.d.ts +0 -1
  141. package/dist/components/ui/context-menu.js +0 -2
  142. package/dist/components/ui/date-range-picker.d.ts +0 -1
  143. package/dist/components/ui/date-range-picker.js +0 -2
  144. package/dist/components/ui/menubar.d.ts +0 -1
  145. package/dist/components/ui/menubar.js +0 -2
  146. package/dist/components/ui/navigation-menu.d.ts +0 -1
  147. package/dist/components/ui/navigation-menu.js +0 -2
  148. package/docs/FRAME-A11Y-CI.md +0 -349
  149. package/docs/data-entry/date-range-picker.tsx +0 -175
  150. package/docs/data-entry/month-picker.tsx +0 -101
  151. package/docs/data-entry/month-range-picker.tsx +0 -115
  152. package/docs/navigation/context-menu.tsx +0 -128
  153. package/docs/navigation/menubar.tsx +0 -141
  154. package/docs/navigation/navigation-menu.tsx +0 -158
@@ -1,301 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { ArrowRight, CalendarIcon, ChevronLeft, ChevronRight, X } from "lucide-react";
5
- import { usePickerLocales, useTranslation } from "../../i18n/use-translation.js";
6
- import { useControlledLatch } from "../../lib/hooks.js";
7
- import { pickGroupFieldA11y, useFieldIdentity } from "../../lib/field-a11y.js";
8
- import { cn } from "../../lib/utils.js";
9
- import { resolveAllowClear } from "./control-surface.js";
10
- import { CONTROL_STATUS_CHROME_CLASS, CONTROL_VARIANT_CHROME_CLASS } from "./control-appearance.js";
11
- import { Button } from "../general/button.js";
12
- import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../data-display/popover.js";
13
- const YM_HINT = "yyyy/mm";
14
- const toYmText = (d) => d ? `${d.getFullYear()}/${String(d.getMonth() + 1).padStart(2, "0")}` : "";
15
- const parseYm = (raw) => {
16
- const m = /^(\d{4})[/-](\d{1,2})$/.exec(raw.trim());
17
- if (!m) return void 0;
18
- const month = Number(m[2]);
19
- if (month < 1 || month > 12) return void 0;
20
- return new Date(Number(m[1]), month - 1, 1);
21
- };
22
- const ymIndex = (d) => d.getFullYear() * 12 + d.getMonth();
23
- function MonthRangePicker({
24
- value: valueProp,
25
- defaultValue,
26
- onValueChange,
27
- placeholder,
28
- disabled,
29
- className,
30
- id,
31
- name,
32
- fromYear,
33
- toYear,
34
- allowClear,
35
- open: openProp,
36
- defaultOpen = false,
37
- onOpenChange,
38
- status,
39
- variant,
40
- size,
41
- inputReadOnly,
42
- preserveInvalidOnBlur,
43
- placement = "bottom-start",
44
- renderExtraFooter,
45
- ref,
46
- ...ariaProps
47
- }) {
48
- const { t } = useTranslation();
49
- const { locale } = usePickerLocales();
50
- const [internalOpen, setInternalOpen] = React.useState(defaultOpen);
51
- const isOpenControlled = openProp !== void 0;
52
- const open = isOpenControlled ? openProp : internalOpen;
53
- const setOpen = React.useCallback(
54
- (next) => {
55
- if (next && inputReadOnly) return;
56
- if (!isOpenControlled) setInternalOpen(next);
57
- onOpenChange?.(next);
58
- },
59
- [isOpenControlled, onOpenChange, inputReadOnly]
60
- );
61
- const groupA11y = pickGroupFieldA11y(ariaProps);
62
- const autoId = React.useId();
63
- const groupId = id ?? autoId;
64
- const fromId = `${groupId}-from`;
65
- const toId = `${groupId}-to`;
66
- const identity = useFieldIdentity({ id: groupId, name, "data-field": groupA11y["data-field"] });
67
- const rangeField = groupA11y["data-field"] ?? identity["data-field"];
68
- const rangeName = name ?? identity.name;
69
- const isControlled = useControlledLatch(valueProp !== void 0);
70
- const [internalValue, setInternalValue] = React.useState(defaultValue);
71
- const value = isControlled ? valueProp : internalValue;
72
- const [fromText, setFromText] = React.useState(() => toYmText(value?.from));
73
- const [toText, setToText] = React.useState(() => toYmText(value?.to));
74
- const [viewYear, setViewYear] = React.useState(() => (value?.from ?? /* @__PURE__ */ new Date()).getFullYear());
75
- React.useEffect(() => {
76
- setFromText(toYmText(value?.from));
77
- setToText(toYmText(value?.to));
78
- if (value?.from) setViewYear(value.from.getFullYear());
79
- }, [value?.from, value?.to]);
80
- const monthLabels = React.useMemo(() => {
81
- const fmt = new Intl.DateTimeFormat(locale, { month: "short" });
82
- return Array.from({ length: 12 }, (_, i) => fmt.format(new Date(2026, i, 1)));
83
- }, [locale]);
84
- const emit = (next) => {
85
- if (!isControlled) setInternalValue(next);
86
- onValueChange?.(next);
87
- };
88
- const clearControl = resolveAllowClear(allowClear, true, t("common.clear") ?? "Clear");
89
- const showClear = clearControl.enabled && Boolean(value?.from || value?.to) && !disabled && !inputReadOnly;
90
- const prevDisabled = fromYear !== void 0 && viewYear <= fromYear;
91
- const nextDisabled = toYear !== void 0 && viewYear >= toYear;
92
- const clear = () => {
93
- emit(void 0);
94
- setFromText("");
95
- setToText("");
96
- };
97
- const commitEdge = (edge, raw) => {
98
- const trimmed = raw.trim();
99
- const parsed = trimmed === "" ? void 0 : parseYm(trimmed);
100
- if (trimmed !== "" && !parsed) return;
101
- const next = { from: value?.from, to: value?.to, [edge]: parsed };
102
- if (next.from && next.to && ymIndex(next.from) > ymIndex(next.to)) {
103
- const swapped = { from: next.to, to: next.from };
104
- emit(swapped);
105
- return;
106
- }
107
- emit(next.from || next.to ? next : void 0);
108
- };
109
- const pickMonth = (picked) => {
110
- const pendingFrom = value?.from && !value?.to ? value.from : void 0;
111
- if (!pendingFrom) {
112
- emit({ from: picked, to: void 0 });
113
- return;
114
- }
115
- const [from, to] = ymIndex(picked) < ymIndex(pendingFrom) ? [picked, pendingFrom] : [pendingFrom, picked];
116
- emit({ from, to });
117
- setOpen(false);
118
- };
119
- const sharedKeyHandlers = {
120
- onKeyDown: (event) => {
121
- if (event.key === "ArrowDown") {
122
- event.preventDefault();
123
- setOpen(true);
124
- } else if (event.key === "Escape" && open) {
125
- setOpen(false);
126
- }
127
- }
128
- };
129
- const innerInputClass = "ui-month-picker-input";
130
- const resolvedPlaceholder = placeholder ?? t("dataEntry.monthPicker.placeholder") ?? YM_HINT;
131
- return /* @__PURE__ */ jsx(Popover, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsxs(
132
- "div",
133
- {
134
- role: "group",
135
- id: groupId,
136
- ...groupA11y,
137
- "data-field": rangeField,
138
- "aria-disabled": disabled ? true : void 0,
139
- "data-disabled": disabled ? "" : void 0,
140
- "data-state": open ? "open" : "closed",
141
- "data-size": size,
142
- "data-status": status,
143
- "data-variant": variant,
144
- className: cn(
145
- "ui-control ui-control-composite-field",
146
- "aria-invalid:border-destructive",
147
- CONTROL_VARIANT_CHROME_CLASS[variant ?? "outlined"],
148
- CONTROL_STATUS_CHROME_CLASS,
149
- className
150
- ),
151
- onClick: () => {
152
- if (!disabled) setOpen(true);
153
- },
154
- children: [
155
- /* @__PURE__ */ jsx(
156
- "input",
157
- {
158
- ref,
159
- id: fromId,
160
- "data-field": rangeField ? `${rangeField}_from` : void 0,
161
- name: rangeName ? `${rangeName}_from` : void 0,
162
- value: fromText,
163
- disabled,
164
- readOnly: inputReadOnly,
165
- "aria-readonly": inputReadOnly || void 0,
166
- placeholder: resolvedPlaceholder,
167
- inputMode: "numeric",
168
- autoComplete: "off",
169
- "aria-label": t("dataEntry.dateRangePicker.from") ?? "From",
170
- className: innerInputClass,
171
- ...sharedKeyHandlers,
172
- onChange: (event) => {
173
- setFromText(event.target.value);
174
- commitEdge("from", event.target.value);
175
- },
176
- onBlur: () => {
177
- if (!preserveInvalidOnBlur) setFromText(toYmText(value?.from));
178
- }
179
- }
180
- ),
181
- /* @__PURE__ */ jsx(ArrowRight, { className: "ui-month-picker-separator-icon", "aria-hidden": "true" }),
182
- /* @__PURE__ */ jsx(
183
- "input",
184
- {
185
- id: toId,
186
- "data-field": rangeField ? `${rangeField}_to` : void 0,
187
- name: rangeName ? `${rangeName}_to` : void 0,
188
- value: toText,
189
- disabled,
190
- readOnly: inputReadOnly,
191
- "aria-readonly": inputReadOnly || void 0,
192
- placeholder: resolvedPlaceholder,
193
- inputMode: "numeric",
194
- autoComplete: "off",
195
- "aria-label": t("dataEntry.dateRangePicker.to") ?? "To",
196
- className: innerInputClass,
197
- ...sharedKeyHandlers,
198
- onChange: (event) => {
199
- setToText(event.target.value);
200
- commitEdge("to", event.target.value);
201
- },
202
- onBlur: () => {
203
- if (!preserveInvalidOnBlur) setToText(toYmText(value?.to));
204
- }
205
- }
206
- ),
207
- showClear ? /* @__PURE__ */ jsx(
208
- "button",
209
- {
210
- type: "button",
211
- tabIndex: -1,
212
- "aria-label": clearControl.label,
213
- className: "text-muted-foreground hover:text-foreground shrink-0",
214
- onClick: (event) => {
215
- event.stopPropagation();
216
- event.currentTarget.closest("div")?.querySelector("input:not([type=hidden])")?.focus();
217
- clear();
218
- },
219
- children: clearControl.clearIcon ?? /* @__PURE__ */ jsx(X, { className: "ui-month-picker-icon", "aria-hidden": "true" })
220
- }
221
- ) : /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
222
- "button",
223
- {
224
- type: "button",
225
- disabled,
226
- tabIndex: -1,
227
- "aria-label": t("dataEntry.monthPicker.openGrid") ?? "Open month grid",
228
- className: "text-muted-foreground hover:text-foreground shrink-0",
229
- children: /* @__PURE__ */ jsx(CalendarIcon, { className: "ui-month-picker-icon", "aria-hidden": "true" })
230
- }
231
- ) }),
232
- /* @__PURE__ */ jsxs(
233
- PopoverContent,
234
- {
235
- className: "ui-month-picker-panel",
236
- side: placement.startsWith("top") ? "top" : "bottom",
237
- align: placement.endsWith("end") ? "end" : "start",
238
- onOpenAutoFocus: (event) => event.preventDefault(),
239
- onClick: (event) => event.stopPropagation(),
240
- children: [
241
- /* @__PURE__ */ jsxs("div", { className: "ui-month-picker-nav", children: [
242
- /* @__PURE__ */ jsx(
243
- Button,
244
- {
245
- type: "button",
246
- variant: "outline",
247
- size: "icon-sm",
248
- disabled: prevDisabled,
249
- "aria-label": t("dataEntry.monthPicker.previousYear") ?? "Previous year",
250
- className: "ui-month-picker-nav-button",
251
- onClick: () => setViewYear((y) => y - 1),
252
- children: /* @__PURE__ */ jsx(ChevronLeft, { className: "ui-month-picker-icon", "aria-hidden": "true" })
253
- }
254
- ),
255
- /* @__PURE__ */ jsx("span", { className: "ui-month-picker-nav-label", "aria-live": "polite", children: viewYear }),
256
- /* @__PURE__ */ jsx(
257
- Button,
258
- {
259
- type: "button",
260
- variant: "outline",
261
- size: "icon-sm",
262
- disabled: nextDisabled,
263
- "aria-label": t("dataEntry.monthPicker.nextYear") ?? "Next year",
264
- className: "ui-month-picker-nav-button",
265
- onClick: () => setViewYear((y) => y + 1),
266
- children: /* @__PURE__ */ jsx(ChevronRight, { className: "ui-month-picker-icon", "aria-hidden": "true" })
267
- }
268
- )
269
- ] }),
270
- /* @__PURE__ */ jsx("div", { role: "grid", "aria-label": String(viewYear), className: "ui-month-picker-grid", children: monthLabels.map((label, i) => {
271
- const cell = new Date(viewYear, i, 1);
272
- const cellIdx = ymIndex(cell);
273
- const fromIdx = value?.from ? ymIndex(value.from) : void 0;
274
- const toIdx = value?.to ? ymIndex(value.to) : void 0;
275
- const isEdge = cellIdx === fromIdx || cellIdx === toIdx;
276
- const inRange = fromIdx !== void 0 && toIdx !== void 0 && cellIdx > fromIdx && cellIdx < toIdx;
277
- return /* @__PURE__ */ jsx(
278
- Button,
279
- {
280
- type: "button",
281
- variant: isEdge ? "default" : inRange ? "secondary" : "ghost",
282
- size: "sm",
283
- "aria-pressed": isEdge,
284
- className: "ui-month-picker-cell",
285
- onClick: () => pickMonth(cell),
286
- children: label
287
- },
288
- label
289
- );
290
- }) }),
291
- renderExtraFooter?.()
292
- ]
293
- }
294
- )
295
- ]
296
- }
297
- ) }) });
298
- }
299
- export {
300
- MonthRangePicker
301
- };
@@ -1,21 +0,0 @@
1
- import * as React from "react";
2
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
3
- export declare const ContextMenu: React.FC<ContextMenuPrimitive.ContextMenuProps>;
4
- export declare function ContextMenuTrigger(props: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): React.JSX.Element;
5
- export declare const ContextMenuPortal: React.FC<ContextMenuPrimitive.ContextMenuPortalProps>;
6
- export declare const ContextMenuContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
- export declare const ContextMenuItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
8
- inset?: boolean;
9
- variant?: "default" | "destructive";
10
- } & React.RefAttributes<HTMLDivElement>>;
11
- export declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
- export declare const ContextMenuRadioGroup: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
- export declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- export declare const ContextMenuLabel: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
- inset?: boolean;
16
- } & React.RefAttributes<HTMLDivElement>>;
17
- export declare const ContextMenuSeparator: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
- export declare const ContextMenuShortcut: ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => React.JSX.Element;
19
- export declare const ContextMenuSub: React.FC<ContextMenuPrimitive.ContextMenuSubProps>;
20
- export declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
21
- export declare const ContextMenuSubContent: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,149 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
5
- import { Check, ChevronRight, Circle } from "lucide-react";
6
- import { cn } from "../../lib/utils.js";
7
- import { useInertHiddenBackground } from "../general/inert-background.js";
8
- const ContextMenu = ContextMenuPrimitive.Root;
9
- function ContextMenuTrigger(props) {
10
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props });
11
- }
12
- const ContextMenuPortal = ContextMenuPrimitive.Portal;
13
- const ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => {
14
- const contentRef = useInertHiddenBackground(ref);
15
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
16
- ContextMenuPrimitive.Content,
17
- {
18
- ref: contentRef,
19
- "data-slot": "context-menu-content",
20
- className: cn("ui-context-menu-content", className),
21
- ...props
22
- }
23
- ) });
24
- });
25
- ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
26
- const ContextMenuItem = React.forwardRef(({ className, inset, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(
27
- ContextMenuPrimitive.Item,
28
- {
29
- ref,
30
- "data-slot": "context-menu-item",
31
- "data-inset": inset,
32
- "data-variant": variant,
33
- className: cn("ui-context-menu-item", className),
34
- ...props
35
- }
36
- ));
37
- ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
38
- const ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
39
- ContextMenuPrimitive.CheckboxItem,
40
- {
41
- ref,
42
- "data-slot": "context-menu-checkbox-item",
43
- className: cn("ui-context-menu-checkbox-item", className),
44
- checked,
45
- ...props,
46
- children: [
47
- /* @__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" }) }) }),
48
- children
49
- ]
50
- }
51
- ));
52
- ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
53
- const ContextMenuRadioGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
54
- ContextMenuPrimitive.RadioGroup,
55
- {
56
- ref,
57
- "data-slot": "context-menu-radio-group",
58
- className: cn("ui-context-menu-radio-group", className),
59
- ...props
60
- }
61
- ));
62
- ContextMenuRadioGroup.displayName = ContextMenuPrimitive.RadioGroup.displayName;
63
- const ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
64
- ContextMenuPrimitive.RadioItem,
65
- {
66
- ref,
67
- "data-slot": "context-menu-radio-item",
68
- className: cn("ui-context-menu-radio-item", className),
69
- ...props,
70
- children: [
71
- /* @__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" }) }) }),
72
- children
73
- ]
74
- }
75
- ));
76
- ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
77
- const ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
78
- ContextMenuPrimitive.Label,
79
- {
80
- ref,
81
- "data-slot": "context-menu-label",
82
- "data-inset": inset,
83
- className: cn("ui-context-menu-label", className),
84
- ...props
85
- }
86
- ));
87
- ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
88
- const ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
89
- ContextMenuPrimitive.Separator,
90
- {
91
- ref,
92
- "data-slot": "context-menu-separator",
93
- className: cn("ui-context-menu-separator", className),
94
- ...props
95
- }
96
- ));
97
- ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
98
- const ContextMenuShortcut = ({
99
- className,
100
- ...props
101
- }) => /* @__PURE__ */ jsx(
102
- "span",
103
- {
104
- "data-slot": "context-menu-shortcut",
105
- className: cn("ui-context-menu-shortcut", className),
106
- ...props
107
- }
108
- );
109
- const ContextMenuSub = ContextMenuPrimitive.Sub;
110
- const ContextMenuSubTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
111
- ContextMenuPrimitive.SubTrigger,
112
- {
113
- ref,
114
- "data-slot": "context-menu-sub-trigger",
115
- className: cn("ui-context-menu-sub-trigger", className),
116
- ...props,
117
- children: [
118
- children,
119
- /* @__PURE__ */ jsx(ChevronRight, { className: "ui-context-menu-sub-trigger-icon", "aria-hidden": "true" })
120
- ]
121
- }
122
- ));
123
- ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
124
- const ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
125
- ContextMenuPrimitive.SubContent,
126
- {
127
- ref,
128
- "data-slot": "context-menu-sub-content",
129
- className: cn("ui-context-menu-sub-content", className),
130
- ...props
131
- }
132
- ));
133
- ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
134
- export {
135
- ContextMenu,
136
- ContextMenuCheckboxItem,
137
- ContextMenuContent,
138
- ContextMenuItem,
139
- ContextMenuLabel,
140
- ContextMenuPortal,
141
- ContextMenuRadioGroup,
142
- ContextMenuRadioItem,
143
- ContextMenuSeparator,
144
- ContextMenuShortcut,
145
- ContextMenuSub,
146
- ContextMenuSubContent,
147
- ContextMenuSubTrigger,
148
- ContextMenuTrigger
149
- };
@@ -1,21 +0,0 @@
1
- import * as React from "react";
2
- import * as MenubarPrimitive from "@radix-ui/react-menubar";
3
- export declare const Menubar: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarProps & React.RefAttributes<HTMLDivElement>>;
4
- export declare const MenubarMenu: (props: MenubarPrimitive.MenubarMenuProps & {
5
- __scopeMenubar?: import("@radix-ui/react-context").Scope;
6
- }) => React.JSX.Element;
7
- export declare function MenubarTrigger(props: React.ComponentProps<typeof MenubarPrimitive.Trigger>): React.JSX.Element;
8
- export declare const MenubarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
- export declare const MenubarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
- inset?: boolean;
11
- variant?: "default" | "destructive";
12
- } & React.RefAttributes<HTMLDivElement>>;
13
- export declare const MenubarCheckboxItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- export declare const MenubarRadioGroup: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
- export declare const MenubarRadioItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
- export declare const MenubarLabel: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
17
- export declare const MenubarSeparator: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
- export declare const MenubarShortcut: ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => React.JSX.Element;
19
- export declare const MenubarSub: React.FC<MenubarPrimitive.MenubarSubProps>;
20
- export declare const MenubarSubTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
21
- export declare const MenubarSubContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,136 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import * as MenubarPrimitive from "@radix-ui/react-menubar";
5
- import { Check, ChevronRight, Circle } from "lucide-react";
6
- import { cn } from "../../lib/utils.js";
7
- const Menubar = MenubarPrimitive.Root;
8
- const MenubarMenu = MenubarPrimitive.Menu;
9
- function MenubarTrigger(props) {
10
- return /* @__PURE__ */ jsx(MenubarPrimitive.Trigger, { "data-slot": "menubar-trigger", ...props });
11
- }
12
- const MenubarContent = React.forwardRef(({ className, align = "start", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { children: /* @__PURE__ */ jsx(
13
- MenubarPrimitive.Content,
14
- {
15
- ref,
16
- "data-slot": "menubar-content",
17
- align,
18
- sideOffset,
19
- className: cn("ui-menubar-content", className),
20
- ...props
21
- }
22
- ) }));
23
- MenubarContent.displayName = MenubarPrimitive.Content.displayName;
24
- const MenubarItem = React.forwardRef(({ className, inset, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(
25
- MenubarPrimitive.Item,
26
- {
27
- ref,
28
- "data-slot": "menubar-item",
29
- "data-inset": inset,
30
- "data-variant": variant,
31
- className: cn("ui-menubar-item", className),
32
- ...props
33
- }
34
- ));
35
- MenubarItem.displayName = MenubarPrimitive.Item.displayName;
36
- const MenubarCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
37
- MenubarPrimitive.CheckboxItem,
38
- {
39
- ref,
40
- "data-slot": "menubar-checkbox-item",
41
- className: cn("ui-menubar-checkbox-item", className),
42
- checked,
43
- ...props,
44
- children: [
45
- /* @__PURE__ */ jsx("span", { className: "ui-menubar-item-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "ui-menubar-check" }) }) }),
46
- children
47
- ]
48
- }
49
- ));
50
- MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
51
- const MenubarRadioGroup = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
52
- MenubarPrimitive.RadioGroup,
53
- {
54
- ref,
55
- "data-slot": "menubar-radio-group",
56
- className: cn("ui-menubar-radio-group", className),
57
- ...props
58
- }
59
- ));
60
- MenubarRadioGroup.displayName = MenubarPrimitive.RadioGroup.displayName;
61
- const MenubarRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
62
- MenubarPrimitive.RadioItem,
63
- {
64
- ref,
65
- "data-slot": "menubar-radio-item",
66
- className: cn("ui-menubar-radio-item", className),
67
- ...props,
68
- children: [
69
- /* @__PURE__ */ jsx("span", { className: "ui-menubar-item-indicator", "aria-hidden": "true", children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Circle, { className: "ui-menubar-dot" }) }) }),
70
- children
71
- ]
72
- }
73
- ));
74
- MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
75
- const MenubarLabel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
76
- MenubarPrimitive.Label,
77
- {
78
- ref,
79
- "data-slot": "menubar-label",
80
- className: cn("ui-menubar-label", className),
81
- ...props
82
- }
83
- ));
84
- MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
85
- const MenubarSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
86
- MenubarPrimitive.Separator,
87
- {
88
- ref,
89
- "data-slot": "menubar-separator",
90
- className: cn("ui-menubar-separator", className),
91
- ...props
92
- }
93
- ));
94
- MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
95
- const MenubarShortcut = ({ className, ...props }) => /* @__PURE__ */ jsx("span", { "data-slot": "menubar-shortcut", className: cn("ui-menubar-shortcut", className), ...props });
96
- const MenubarSub = MenubarPrimitive.Sub;
97
- const MenubarSubTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
98
- MenubarPrimitive.SubTrigger,
99
- {
100
- ref,
101
- "data-slot": "menubar-sub-trigger",
102
- className: cn("ui-menubar-sub-trigger", className),
103
- ...props,
104
- children: [
105
- children,
106
- /* @__PURE__ */ jsx(ChevronRight, { className: "ui-menubar-sub-trigger-icon", "aria-hidden": "true" })
107
- ]
108
- }
109
- ));
110
- MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
111
- const MenubarSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
112
- MenubarPrimitive.SubContent,
113
- {
114
- ref,
115
- "data-slot": "menubar-sub-content",
116
- className: cn("ui-menubar-sub-content", className),
117
- ...props
118
- }
119
- ));
120
- MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
121
- export {
122
- Menubar,
123
- MenubarCheckboxItem,
124
- MenubarContent,
125
- MenubarItem,
126
- MenubarLabel,
127
- MenubarMenu,
128
- MenubarRadioGroup,
129
- MenubarRadioItem,
130
- MenubarSeparator,
131
- MenubarShortcut,
132
- MenubarSub,
133
- MenubarSubContent,
134
- MenubarSubTrigger,
135
- MenubarTrigger
136
- };
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
3
- export declare const NavigationMenu: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuProps & React.RefAttributes<HTMLElement>>;
4
- export declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuListProps & React.RefAttributes<HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
5
- export declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
6
- export declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
- export declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
- export declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
9
- export declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
- export declare const NavigationMenuViewport: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;