@godxjp/ui 19.6.0 → 20.1.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 (326) hide show
  1. package/README.md +8 -2
  2. package/dist/app/theme-axes.d.ts +2 -0
  3. package/dist/app/theme-axes.js +45 -0
  4. package/dist/components/charts/chart-cartesian.d.ts +2 -1
  5. package/dist/components/charts/chart-cartesian.js +52 -3
  6. package/dist/components/charts/chart-category-axis.d.ts +55 -0
  7. package/dist/components/charts/chart-category-axis.js +93 -0
  8. package/dist/components/charts/chart-frame.d.ts +10 -1
  9. package/dist/components/charts/chart-frame.js +19 -3
  10. package/dist/components/charts/compact-bar-trend.d.ts +1 -1
  11. package/dist/components/charts/compact-bar-trend.js +2 -0
  12. package/dist/components/charts/pie-chart.d.ts +1 -1
  13. package/dist/components/charts/pie-chart.js +12 -1
  14. package/dist/components/charts/recharts-peer.d.ts +49 -0
  15. package/dist/components/charts/recharts-peer.js +45 -0
  16. package/dist/components/data-display/card.d.ts +14 -3
  17. package/dist/components/data-display/card.js +22 -4
  18. package/dist/components/data-display/code-block.js +6 -2
  19. package/dist/components/data-display/collapsible.d.ts +23 -4
  20. package/dist/components/data-display/collapsible.js +119 -4
  21. package/dist/components/data-display/data-table.d.ts +39 -4
  22. package/dist/components/data-display/data-table.js +802 -270
  23. package/dist/components/data-display/descriptions.d.ts +27 -6
  24. package/dist/components/data-display/descriptions.js +58 -17
  25. package/dist/components/data-display/index.d.ts +5 -1
  26. package/dist/components/data-display/index.js +4 -0
  27. package/dist/components/data-display/legend.d.ts +15 -0
  28. package/dist/components/data-display/legend.js +11 -0
  29. package/dist/components/data-display/list-row.d.ts +10 -1
  30. package/dist/components/data-display/list-row.js +8 -2
  31. package/dist/components/data-display/popover.d.ts +60 -7
  32. package/dist/components/data-display/popover.js +268 -39
  33. package/dist/components/data-display/progress.d.ts +50 -2
  34. package/dist/components/data-display/progress.js +57 -9
  35. package/dist/components/data-display/range-timeline.d.ts +38 -0
  36. package/dist/components/data-display/range-timeline.js +161 -0
  37. package/dist/components/data-display/scroll-area.js +13 -2
  38. package/dist/components/data-display/service-launcher-card.js +10 -10
  39. package/dist/components/data-display/table.d.ts +11 -3
  40. package/dist/components/data-display/table.js +48 -18
  41. package/dist/components/data-display/tree-list.js +4 -9
  42. package/dist/components/data-entry/calendar.d.ts +2 -2
  43. package/dist/components/data-entry/calendar.js +79 -33
  44. package/dist/components/data-entry/cascader.d.ts +1 -1
  45. package/dist/components/data-entry/cascader.js +188 -24
  46. package/dist/components/data-entry/checkbox.d.ts +19 -6
  47. package/dist/components/data-entry/checkbox.js +55 -16
  48. package/dist/components/data-entry/choice-option.d.ts +1 -1
  49. package/dist/components/data-entry/color-picker.d.ts +1 -1
  50. package/dist/components/data-entry/color-picker.js +17 -5
  51. package/dist/components/data-entry/control-appearance.d.ts +64 -0
  52. package/dist/components/data-entry/control-appearance.js +39 -0
  53. package/dist/components/data-entry/control-surface.d.ts +61 -0
  54. package/dist/components/data-entry/control-surface.js +39 -0
  55. package/dist/components/data-entry/date-picker.d.ts +1 -1
  56. package/dist/components/data-entry/date-picker.js +344 -113
  57. package/dist/components/data-entry/date-range-picker.d.ts +2 -2
  58. package/dist/components/data-entry/date-range-picker.js +278 -140
  59. package/dist/components/data-entry/field.js +0 -1
  60. package/dist/components/data-entry/form-field.d.ts +1 -1
  61. package/dist/components/data-entry/form-field.js +39 -4
  62. package/dist/components/data-entry/form.d.ts +4 -0
  63. package/dist/components/data-entry/form.js +5 -3
  64. package/dist/components/data-entry/index.d.ts +7 -3
  65. package/dist/components/data-entry/index.js +10 -1
  66. package/dist/components/data-entry/input-otp.d.ts +1 -1
  67. package/dist/components/data-entry/input.d.ts +12 -34
  68. package/dist/components/data-entry/input.js +92 -24
  69. package/dist/components/data-entry/label.d.ts +3 -2
  70. package/dist/components/data-entry/label.js +23 -10
  71. package/dist/components/data-entry/month-picker.d.ts +2 -2
  72. package/dist/components/data-entry/month-picker.js +47 -10
  73. package/dist/components/data-entry/month-range-picker.d.ts +2 -2
  74. package/dist/components/data-entry/month-range-picker.js +51 -11
  75. package/dist/components/data-entry/number-input.d.ts +7 -0
  76. package/dist/components/data-entry/number-input.js +147 -98
  77. package/dist/components/data-entry/password-input.d.ts +1 -1
  78. package/dist/components/data-entry/radio.d.ts +1 -1
  79. package/dist/components/data-entry/radio.js +61 -13
  80. package/dist/components/data-entry/search-input.d.ts +1 -1
  81. package/dist/components/data-entry/search-input.js +16 -2
  82. package/dist/components/data-entry/search-select.d.ts +2 -2
  83. package/dist/components/data-entry/search-select.js +209 -78
  84. package/dist/components/data-entry/select.d.ts +22 -4
  85. package/dist/components/data-entry/select.js +215 -163
  86. package/dist/components/data-entry/slider.d.ts +9 -1
  87. package/dist/components/data-entry/slider.js +87 -9
  88. package/dist/components/data-entry/switch.d.ts +3 -0
  89. package/dist/components/data-entry/switch.js +29 -3
  90. package/dist/components/data-entry/textarea.d.ts +14 -56
  91. package/dist/components/data-entry/textarea.js +80 -33
  92. package/dist/components/data-entry/time-picker.d.ts +2 -2
  93. package/dist/components/data-entry/time-picker.js +333 -109
  94. package/dist/components/data-entry/time-range-picker.d.ts +5 -0
  95. package/dist/components/data-entry/time-range-picker.js +89 -0
  96. package/dist/components/data-entry/transfer.d.ts +1 -1
  97. package/dist/components/data-entry/transfer.js +99 -31
  98. package/dist/components/data-entry/tree-select-strategy.d.ts +1 -1
  99. package/dist/components/data-entry/tree-select.d.ts +1 -1
  100. package/dist/components/data-entry/tree-select.js +197 -92
  101. package/dist/components/data-entry/tree-utils.d.ts +1 -1
  102. package/dist/components/data-entry/tree-utils.js +7 -14
  103. package/dist/components/data-entry/upload-files.d.ts +2 -0
  104. package/dist/components/data-entry/upload-files.js +31 -0
  105. package/dist/components/data-entry/upload-request.d.ts +4 -0
  106. package/dist/components/data-entry/upload-request.js +53 -0
  107. package/dist/components/data-entry/upload-types.d.ts +28 -0
  108. package/dist/components/data-entry/upload-types.js +2 -0
  109. package/dist/components/data-entry/upload.d.ts +2 -2
  110. package/dist/components/data-entry/upload.js +482 -117
  111. package/dist/components/feedback/dialog.d.ts +105 -38
  112. package/dist/components/feedback/dialog.js +268 -193
  113. package/dist/components/feedback/overlay-close-focus.d.ts +31 -0
  114. package/dist/components/feedback/overlay-close-focus.js +31 -0
  115. package/dist/components/feedback/overlay-header-tone.d.ts +1 -1
  116. package/dist/components/feedback/sheet.d.ts +53 -11
  117. package/dist/components/feedback/sheet.js +150 -81
  118. package/dist/components/feedback/tooltip.d.ts +51 -7
  119. package/dist/components/feedback/tooltip.js +107 -25
  120. package/dist/components/general/button.d.ts +1 -1
  121. package/dist/components/general/button.js +7 -3
  122. package/dist/components/general/index.d.ts +1 -0
  123. package/dist/components/general/index.js +2 -0
  124. package/dist/components/general/logo.d.ts +17 -0
  125. package/dist/components/general/logo.js +22 -16
  126. package/dist/components/general/typography.d.ts +3 -0
  127. package/dist/components/general/typography.js +15 -1
  128. package/dist/components/general/visually-hidden.d.ts +3 -0
  129. package/dist/components/general/visually-hidden.js +9 -0
  130. package/dist/components/layout/app-launcher.d.ts +34 -0
  131. package/dist/components/layout/app-launcher.js +228 -0
  132. package/dist/components/layout/app-shell.d.ts +3 -1
  133. package/dist/components/layout/app-shell.js +69 -12
  134. package/dist/components/layout/aspect-ratio.js +0 -1
  135. package/dist/components/layout/auth-divider.js +0 -1
  136. package/dist/components/layout/breadcrumb.d.ts +14 -2
  137. package/dist/components/layout/breadcrumb.js +46 -4
  138. package/dist/components/layout/flex.d.ts +1 -1
  139. package/dist/components/layout/flex.js +41 -3
  140. package/dist/components/layout/index.d.ts +3 -0
  141. package/dist/components/layout/index.js +5 -1
  142. package/dist/components/layout/nav-surface.d.ts +26 -0
  143. package/dist/components/layout/nav-surface.js +17 -0
  144. package/dist/components/layout/org-switcher.d.ts +5 -1
  145. package/dist/components/layout/org-switcher.js +25 -4
  146. package/dist/components/layout/page-container.d.ts +1 -1
  147. package/dist/components/layout/page-container.js +5 -3
  148. package/dist/components/layout/responsive-grid.d.ts +16 -2
  149. package/dist/components/layout/responsive-grid.js +29 -2
  150. package/dist/components/layout/separator.js +0 -1
  151. package/dist/components/layout/sidebar.js +4 -1
  152. package/dist/components/layout/split-pane.d.ts +14 -1
  153. package/dist/components/layout/split-pane.js +26 -13
  154. package/dist/components/layout/topbar-item.d.ts +3 -0
  155. package/dist/components/layout/topbar-item.js +19 -5
  156. package/dist/components/layout/topbar.d.ts +1 -1
  157. package/dist/components/layout/topbar.js +27 -6
  158. package/dist/components/navigation/app-setting-picker.js +21 -2
  159. package/dist/components/navigation/app-setting-toggle.d.ts +16 -0
  160. package/dist/components/navigation/app-setting-toggle.js +96 -0
  161. package/dist/components/navigation/dropdown-menu.d.ts +227 -18
  162. package/dist/components/navigation/dropdown-menu.js +402 -118
  163. package/dist/components/navigation/index.d.ts +2 -0
  164. package/dist/components/navigation/index.js +2 -0
  165. package/dist/components/navigation/pagination-utils.d.ts +2 -1
  166. package/dist/components/navigation/pagination.d.ts +2 -2
  167. package/dist/components/navigation/pagination.js +155 -83
  168. package/dist/components/navigation/steps.d.ts +2 -2
  169. package/dist/components/navigation/steps.js +29 -4
  170. package/dist/components/navigation/tabs.d.ts +29 -16
  171. package/dist/components/navigation/tabs.js +374 -144
  172. package/dist/components/ui/accordion.d.ts +50 -5
  173. package/dist/components/ui/accordion.js +239 -33
  174. package/dist/components/ui/aspect-ratio.d.ts +23 -2
  175. package/dist/components/ui/aspect-ratio.js +15 -13
  176. package/dist/components/ui/avatar.d.ts +29 -4
  177. package/dist/components/ui/avatar.js +111 -25
  178. package/dist/components/ui/hover-card.d.ts +42 -4
  179. package/dist/components/ui/hover-card.js +183 -27
  180. package/dist/components/ui/input-otp.d.ts +26 -28
  181. package/dist/components/ui/input-otp.js +50 -7
  182. package/dist/components/ui/label.js +0 -1
  183. package/dist/components/ui/password-input.d.ts +36 -2
  184. package/dist/components/ui/password-input.js +27 -7
  185. package/dist/components/ui/rating.d.ts +25 -0
  186. package/dist/components/ui/rating.js +67 -27
  187. package/dist/components/ui/segmented.d.ts +12 -3
  188. package/dist/components/ui/segmented.js +17 -2
  189. package/dist/components/ui/separator.d.ts +12 -2
  190. package/dist/components/ui/separator.js +30 -9
  191. package/dist/components/ui/tag-input.d.ts +45 -0
  192. package/dist/components/ui/tag-input.js +109 -27
  193. package/dist/components/ui/toggle-group.d.ts +50 -5
  194. package/dist/components/ui/toggle-group.js +79 -20
  195. package/dist/components/ui/toggle.d.ts +31 -5
  196. package/dist/components/ui/toggle.js +42 -3
  197. package/dist/form/form-context.d.ts +29 -0
  198. package/dist/form/form-context.js +44 -4
  199. package/dist/form/form-field-array.d.ts +22 -0
  200. package/dist/form/form-field-array.js +50 -0
  201. package/dist/form/form-field-control.d.ts +2 -1
  202. package/dist/form/form-field-control.js +116 -40
  203. package/dist/form/form-root.d.ts +2 -1
  204. package/dist/form/form-root.js +142 -23
  205. package/dist/form/index.d.ts +3 -1
  206. package/dist/form/index.js +12 -1
  207. package/dist/i18n/messages/en.json +64 -5
  208. package/dist/i18n/messages/ja.json +64 -5
  209. package/dist/i18n/messages/vi.json +64 -5
  210. package/dist/inertia/index.d.ts +20 -0
  211. package/dist/inertia/index.js +60 -1
  212. package/dist/lib/control-styles.d.ts +25 -3
  213. package/dist/lib/control-styles.js +9 -3
  214. package/dist/lib/datetime/picker-format.d.ts +8 -0
  215. package/dist/lib/datetime/picker-format.js +54 -0
  216. package/dist/lib/slot.d.ts +32 -0
  217. package/dist/lib/slot.js +22 -0
  218. package/dist/lib/variants.d.ts +22 -3
  219. package/dist/lib/variants.js +56 -1
  220. package/dist/props/components/app.prop.d.ts +25 -1
  221. package/dist/props/components/charts.prop.d.ts +21 -0
  222. package/dist/props/components/data-display.prop.d.ts +72 -4
  223. package/dist/props/components/data-entry.prop.d.ts +718 -46
  224. package/dist/props/components/form.prop.d.ts +142 -4
  225. package/dist/props/components/general.prop.d.ts +17 -1
  226. package/dist/props/components/index.d.ts +3 -3
  227. package/dist/props/components/layout.prop.d.ts +281 -11
  228. package/dist/props/components/navigation.prop.d.ts +114 -4
  229. package/dist/props/registry.d.ts +397 -11
  230. package/dist/props/registry.js +526 -11
  231. package/dist/props/vocabulary/content.prop.d.ts +1 -1
  232. package/dist/props/vocabulary/data.prop.d.ts +179 -1
  233. package/dist/props/vocabulary/index.d.ts +5 -5
  234. package/dist/props/vocabulary/interaction.prop.d.ts +68 -3
  235. package/dist/props/vocabulary/layout.prop.d.ts +57 -1
  236. package/dist/props/vocabulary/navigation.prop.d.ts +40 -0
  237. package/dist/props/vocabulary/shared.prop.d.ts +33 -0
  238. package/dist/styles/badge-layout.css +2 -1
  239. package/dist/styles/card-layout.css +26 -4
  240. package/dist/styles/chart-layout.css +15 -0
  241. package/dist/styles/control.css +657 -15
  242. package/dist/styles/core.css +5 -2
  243. package/dist/styles/data-display-layout.css +313 -6
  244. package/dist/styles/data-entry-layout.css +13 -0
  245. package/dist/styles/focus-ring.css +4 -0
  246. package/dist/styles/index.css +5 -2
  247. package/dist/styles/layout.css +327 -4
  248. package/dist/styles/navigation-layout.css +227 -0
  249. package/dist/styles/shell-layout.css +369 -13
  250. package/dist/styles/table-layout.css +95 -6
  251. package/dist/styles/text-layout.css +10 -4
  252. package/dist/tokens/base.css +2 -1
  253. package/dist/tokens/components/badge.css +1 -0
  254. package/dist/tokens/components/chart.css +6 -0
  255. package/dist/tokens/components/control.css +79 -2
  256. package/dist/tokens/components/data-display.css +20 -0
  257. package/dist/tokens/components/descriptions.css +11 -0
  258. package/dist/tokens/components/flex.css +8 -0
  259. package/dist/tokens/components/navigation.css +55 -0
  260. package/dist/tokens/components/shell.css +53 -3
  261. package/dist/tokens/components/table.css +14 -0
  262. package/dist/tokens/foundation.css +2 -0
  263. package/dist/tokens/semantic/layout.css +9 -0
  264. package/docs/COMPONENTS.md +9 -3
  265. package/docs/CONSUMER-RULES.md +13 -0
  266. package/docs/DESIGN-AUTHORITY.md +145 -83
  267. package/docs/DEVELOPMENT.md +4 -3
  268. package/docs/FORMS.md +151 -6
  269. package/docs/FRAME-COVERAGE-REPORT.md +32 -17
  270. package/docs/README.md +15 -15
  271. package/docs/STANDARDS-vocabulary-tokens.md +1 -1
  272. package/docs/TESTING.md +15 -6
  273. package/docs/WHAT-BELONGS-HERE.md +179 -0
  274. package/docs/charts/cjk-category-axis.tsx +81 -0
  275. package/docs/data-display/card/index.tsx +22 -0
  276. package/docs/data-display/data-table/examples/antd-parity.tsx +257 -0
  277. package/docs/data-display/data-table/index.tsx +23 -0
  278. package/docs/data-display/descriptions.tsx +41 -0
  279. package/docs/data-display/legend.tsx +145 -0
  280. package/docs/data-display/progress.tsx +32 -0
  281. package/docs/data-display/scroll-area.tsx +31 -25
  282. package/docs/data-display/table.tsx +104 -45
  283. package/docs/data-display/timeline.tsx +41 -0
  284. package/docs/data-entry/date-picker.tsx +85 -0
  285. package/docs/data-entry/date-range-picker.tsx +26 -0
  286. package/docs/data-entry/form-dynamic-fields.tsx +199 -0
  287. package/docs/data-entry/form.tsx +74 -4
  288. package/docs/data-entry/input-otp.tsx +24 -0
  289. package/docs/data-entry/input.tsx +46 -1
  290. package/docs/data-entry/month-range-picker.tsx +1 -1
  291. package/docs/data-entry/segmented.tsx +1 -1
  292. package/docs/data-entry/select.tsx +29 -2
  293. package/docs/data-entry/switch.tsx +41 -0
  294. package/docs/data-entry/textarea.tsx +38 -0
  295. package/docs/data-entry/time-picker.tsx +85 -1
  296. package/docs/data-entry/time-range-picker.tsx +55 -0
  297. package/docs/data-entry/transfer.tsx +17 -0
  298. package/docs/data-entry/upload.tsx +56 -12
  299. package/docs/feedback/sheet.tsx +1 -1
  300. package/docs/feedback/tooltip.tsx +1 -1
  301. package/docs/general/activity.tsx +2 -2
  302. package/docs/general/button/index.tsx +14 -1
  303. package/docs/general/typography.tsx +14 -1
  304. package/docs/layout/app-launcher.tsx +151 -0
  305. package/docs/layout/app-shell-arrangements.tsx +225 -0
  306. package/docs/layout/app-shell.tsx +11 -0
  307. package/docs/layout/aspect-ratio.tsx +1 -1
  308. package/docs/layout/flex.tsx +50 -0
  309. package/docs/layout/responsive-grid.tsx +21 -1
  310. package/docs/layout/topbar.tsx +5 -9
  311. package/docs/navigation/app-setting-picker.tsx +37 -1
  312. package/docs/navigation/app-setting-toggle.tsx +111 -0
  313. package/docs/navigation/breadcrumb.tsx +48 -0
  314. package/docs/navigation/dropdown-menu.tsx +21 -0
  315. package/docs/navigation/pagination.tsx +52 -0
  316. package/docs/navigation/steps.tsx +37 -0
  317. package/docs/navigation/tabs.tsx +97 -1
  318. package/docs/query/button-refetch.tsx +1 -0
  319. package/package.json +28 -8
  320. package/scripts/_agent-setup.mjs +182 -3
  321. package/scripts/consumer-rule.md +98 -0
  322. package/scripts/guinea-pig-skill.md +322 -0
  323. package/scripts/init-guinea-pig.mjs +84 -0
  324. package/scripts/postinstall.mjs +13 -2
  325. package/scripts/ui-audit.mjs +351 -37
  326. /package/dist/tokens/{antd.generated.css → derived.css} +0 -0
@@ -1,138 +1,418 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
+ import {
5
+ Header,
6
+ Button as AriaButton,
7
+ Menu,
8
+ MenuItem,
9
+ MenuSection,
10
+ MenuTrigger,
11
+ OverlayTriggerStateContext,
12
+ Popover,
13
+ Pressable,
14
+ Separator,
15
+ OverlayArrow,
16
+ SubmenuTrigger
17
+ } from "react-aria-components";
5
18
  import { Check, ChevronRight } from "lucide-react";
6
19
  import { cn } from "../../lib/utils.js";
7
- import { useInertHiddenBackground } from "../general/inert-background.js";
8
- function DropdownMenu(props) {
9
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
20
+ import { Slot } from "../../lib/slot.js";
21
+ const DROPDOWN_MENU_PLACEMENT = {
22
+ top: { side: "top", align: "center" },
23
+ topStart: { side: "top", align: "start" },
24
+ topEnd: { side: "top", align: "end" },
25
+ bottom: { side: "bottom", align: "center" },
26
+ bottomStart: { side: "bottom", align: "start" },
27
+ bottomEnd: { side: "bottom", align: "end" }
28
+ };
29
+ function borrowedTag(children, asChild) {
30
+ return asChild ? React.Children.only(children) : null;
31
+ }
32
+ function renderItemTag(tag, domProps, content) {
33
+ if (!tag) {
34
+ return /* @__PURE__ */ jsx("div", { ...domProps, children: content });
35
+ }
36
+ return /* @__PURE__ */ jsx(Slot, { ...domProps, children: React.cloneElement(tag, void 0, content) });
10
37
  }
11
- function DropdownMenuTrigger(props) {
12
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
38
+ function radixItemState(state) {
39
+ return {
40
+ "data-highlighted": state.isFocused ? "" : void 0,
41
+ "data-disabled": state.isDisabled ? "" : void 0,
42
+ "data-state": state.hasSubmenu ? state.isOpen ? "open" : "closed" : state.selectionMode === "none" ? void 0 : state.isSelected ? "checked" : "unchecked"
43
+ };
13
44
  }
14
- function DropdownMenuPortal(props) {
15
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
45
+ function radixSurfaceState(state) {
46
+ return {
47
+ "data-state": state.isExiting ? "closed" : "open",
48
+ "data-side": state.placement && state.placement !== "center" ? state.placement : void 0
49
+ };
16
50
  }
17
- function DropdownMenuGroup(props) {
18
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
51
+ function toPlacement(side, align) {
52
+ const resolvedSide = side ?? "bottom";
53
+ if (!align || align === "center") return resolvedSide;
54
+ return `${resolvedSide} ${align}`;
19
55
  }
20
- function DropdownMenuRadioGroup(props) {
21
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.RadioGroup, { "data-slot": "dropdown-menu-radio-group", ...props });
56
+ function selectEvent(name) {
57
+ return typeof CustomEvent === "function" ? new CustomEvent(name, { bubbles: false, cancelable: true }) : { defaultPrevented: false, preventDefault() {
58
+ } };
22
59
  }
23
- function DropdownMenuSub(props) {
24
- return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
60
+ const DropdownMenuModalContext = React.createContext({ modal: true });
61
+ function DropdownMenu({
62
+ children,
63
+ open,
64
+ defaultOpen,
65
+ onOpenChange,
66
+ modal = true,
67
+ dir
68
+ }) {
69
+ void dir;
70
+ const options = React.useMemo(() => ({ modal }), [modal]);
71
+ return /* @__PURE__ */ jsx(DropdownMenuModalContext.Provider, { value: options, children: /* @__PURE__ */ jsx(MenuTrigger, { isOpen: open, defaultOpen, onOpenChange, children }) });
25
72
  }
26
- const DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => {
27
- const contentRef = useInertHiddenBackground(ref);
28
- return /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsx(
29
- DropdownMenuPrimitive.Content,
73
+ function DropdownMenuTrigger({ asChild, children, ...props }) {
74
+ const state = React.useContext(OverlayTriggerStateContext);
75
+ const dataState = state?.isOpen ? "open" : "closed";
76
+ if (asChild && React.isValidElement(children)) {
77
+ return /* @__PURE__ */ jsx(Pressable, { children: React.cloneElement(children, {
78
+ "data-slot": "dropdown-menu-trigger",
79
+ "data-state": dataState
80
+ }) });
81
+ }
82
+ return /* @__PURE__ */ jsx(
83
+ AriaButton,
84
+ {
85
+ ...props,
86
+ isDisabled: props.disabled,
87
+ "data-slot": "dropdown-menu-trigger",
88
+ "data-state": dataState,
89
+ children
90
+ }
91
+ );
92
+ }
93
+ function DropdownMenuPortal({ children }) {
94
+ return /* @__PURE__ */ jsx(Fragment, { children });
95
+ }
96
+ function DropdownMenuGroup({ children, className }) {
97
+ return /* @__PURE__ */ jsx(MenuSection, { "data-slot": "dropdown-menu-group", className, children });
98
+ }
99
+ function DropdownMenuRadioGroup({
100
+ children,
101
+ className,
102
+ value,
103
+ onValueChange
104
+ }) {
105
+ return /* @__PURE__ */ jsx(
106
+ MenuSection,
107
+ {
108
+ "data-slot": "dropdown-menu-radio-group",
109
+ className,
110
+ selectionMode: "single",
111
+ disallowEmptySelection: true,
112
+ selectedKeys: value == null ? [] : [value],
113
+ onSelectionChange: (keys) => {
114
+ if (keys === "all") return;
115
+ const [first] = [...keys];
116
+ if (first != null) onValueChange?.(String(first));
117
+ },
118
+ children
119
+ }
120
+ );
121
+ }
122
+ function DropdownMenuSub({ children }) {
123
+ const parts = React.Children.toArray(children).filter(React.isValidElement);
124
+ return /* @__PURE__ */ jsx(SubmenuTrigger, { children: parts });
125
+ }
126
+ function DropdownMenuContent({
127
+ children,
128
+ className,
129
+ side,
130
+ align,
131
+ sideOffset = 4,
132
+ placement,
133
+ arrow,
134
+ width,
135
+ alignOffset,
136
+ avoidCollisions,
137
+ collisionPadding,
138
+ loop,
139
+ hideWhenDetached,
140
+ sticky,
141
+ forceMount
142
+ }) {
143
+ void hideWhenDetached;
144
+ void sticky;
145
+ void forceMount;
146
+ const { modal } = React.useContext(DropdownMenuModalContext);
147
+ const anchor = placement ? DROPDOWN_MENU_PLACEMENT[placement] : void 0;
148
+ return /* @__PURE__ */ jsx(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs(
149
+ Popover,
30
150
  {
31
- ref: contentRef,
32
151
  "data-slot": "dropdown-menu-content",
33
- sideOffset,
152
+ isNonModal: !modal,
153
+ placement: toPlacement(side ?? anchor?.side, align ?? anchor?.align),
154
+ offset: sideOffset,
155
+ crossOffset: alignOffset,
156
+ shouldFlip: avoidCollisions,
157
+ containerPadding: collisionPadding,
34
158
  className: cn(
35
- "ui-dropdown-menu-content data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 origin-[var(--radix-dropdown-menu-content-transform-origin)]",
159
+ "ui-dropdown-menu-content data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 origin-[var(--trigger-anchor-point)]",
36
160
  className
37
161
  ),
38
- ...props
162
+ render: (props, state) => (
163
+ // `role={undefined}`: một menu không phải một dialog — xem radixSurfaceState.
164
+ /* @__PURE__ */ jsx(
165
+ "div",
166
+ {
167
+ ...props,
168
+ role: void 0,
169
+ ...radixSurfaceState(state),
170
+ "data-align": align ?? anchor?.align ?? "center",
171
+ "data-width": width
172
+ }
173
+ )
174
+ ),
175
+ children: [
176
+ /* @__PURE__ */ jsx(Menu, { shouldFocusWrap: loop, children }),
177
+ arrow ? /* @__PURE__ */ jsx(OverlayArrow, { children: /* @__PURE__ */ jsx(
178
+ "svg",
179
+ {
180
+ "data-slot": "dropdown-menu-arrow",
181
+ className: "ui-dropdown-menu-arrow",
182
+ viewBox: "0 0 10 5",
183
+ "aria-hidden": "true",
184
+ children: /* @__PURE__ */ jsx("path", { d: "M0 0 L5 5 L10 0 Z" })
185
+ }
186
+ ) }) : null
187
+ ]
39
188
  }
40
189
  ) });
41
- });
42
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
43
- const DropdownMenuItem = React.forwardRef(({ className, inset, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx(
44
- DropdownMenuPrimitive.Item,
45
- {
46
- ref,
47
- "data-slot": "dropdown-menu-item",
48
- "data-inset": inset,
49
- "data-variant": variant,
50
- className: cn(
51
- "ui-dropdown-menu-item [&_svg:not([class*='text-'])]:text-muted-foreground",
52
- className
53
- ),
54
- ...props
55
- }
56
- ));
57
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
58
- const DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
59
- DropdownMenuPrimitive.Label,
60
- {
61
- ref,
62
- "data-slot": "dropdown-menu-label",
63
- "data-inset": inset,
64
- className: cn("ui-dropdown-menu-label", className),
65
- ...props
66
- }
67
- ));
68
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
69
- const DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
70
- DropdownMenuPrimitive.Separator,
71
- {
72
- ref,
73
- "data-slot": "dropdown-menu-separator",
74
- className: cn("ui-dropdown-menu-separator", className),
75
- ...props
76
- }
77
- ));
78
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
79
- const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
80
- DropdownMenuPrimitive.CheckboxItem,
81
- {
82
- ref,
83
- "data-slot": "dropdown-menu-checkbox-item",
84
- className: cn("ui-dropdown-menu-checkbox-item", className),
85
- checked,
86
- ...props,
87
- children: [
88
- /* @__PURE__ */ jsx("span", { className: "ui-dropdown-menu-indicator-slot", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { className: "ui-dropdown-menu-check", "aria-hidden": "true" }) }) }),
190
+ }
191
+ function DropdownMenuItem({
192
+ children,
193
+ className,
194
+ inset,
195
+ variant = "default",
196
+ disabled,
197
+ onSelect,
198
+ textValue,
199
+ asChild
200
+ }) {
201
+ const tag = borrowedTag(children, asChild);
202
+ return /* @__PURE__ */ jsx(
203
+ MenuItem,
204
+ {
205
+ isDisabled: disabled,
206
+ textValue,
207
+ onAction: onSelect ? () => onSelect(selectEvent("dropdownmenu.itemSelect")) : void 0,
208
+ className: cn(
209
+ "ui-dropdown-menu-item [&_svg:not([class*='text-'])]:text-muted-foreground",
210
+ className
211
+ ),
212
+ render: (props, state) => {
213
+ const { children: content, ...rest } = props;
214
+ return renderItemTag(
215
+ tag,
216
+ {
217
+ ...rest,
218
+ "data-slot": "dropdown-menu-item",
219
+ "data-inset": inset,
220
+ "data-variant": variant,
221
+ ...radixItemState(state)
222
+ },
223
+ content
224
+ );
225
+ },
226
+ children: tag ? tag.props.children : children
227
+ }
228
+ );
229
+ }
230
+ function DropdownMenuLabel({ children, className, inset, asChild }) {
231
+ return /* @__PURE__ */ jsx(
232
+ Header,
233
+ {
234
+ "data-slot": "dropdown-menu-label",
235
+ "data-inset": inset,
236
+ className: cn("ui-dropdown-menu-label", className),
237
+ render: asChild ? (props) => /* @__PURE__ */ jsx(
238
+ Slot,
239
+ {
240
+ ...props
241
+ }
242
+ ) : (props) => /* @__PURE__ */ jsx(
243
+ "div",
244
+ {
245
+ ...props
246
+ }
247
+ ),
89
248
  children
90
- ]
91
- }
92
- ));
93
- DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
94
- const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
95
- DropdownMenuPrimitive.RadioItem,
96
- {
97
- ref,
98
- "data-slot": "dropdown-menu-radio-item",
99
- className: cn("ui-dropdown-menu-radio-item", className),
100
- ...props,
101
- children
102
- }
103
- ));
104
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
105
- const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
106
- DropdownMenuPrimitive.SubTrigger,
107
- {
108
- ref,
109
- "data-slot": "dropdown-menu-sub-trigger",
110
- "data-inset": inset,
111
- className: cn(
112
- "ui-dropdown-menu-sub-trigger [&_svg:not([class*='text-'])]:text-muted-foreground",
113
- className
114
- ),
115
- ...props,
116
- children: [
117
- children,
118
- /* @__PURE__ */ jsx(ChevronRight, { className: "ui-dropdown-menu-sub-trigger-icon", "aria-hidden": "true" })
119
- ]
120
- }
121
- ));
122
- DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
123
- const DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
124
- DropdownMenuPrimitive.SubContent,
125
- {
126
- ref,
127
- "data-slot": "dropdown-menu-sub-content",
128
- className: cn(
129
- "ui-dropdown-menu-sub-content data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 origin-[var(--radix-dropdown-menu-content-transform-origin)]",
130
- className
131
- ),
132
- ...props
133
- }
134
- ));
135
- DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
249
+ }
250
+ );
251
+ }
252
+ function DropdownMenuSeparator({ className }) {
253
+ return /* @__PURE__ */ jsx(
254
+ Separator,
255
+ {
256
+ "data-slot": "dropdown-menu-separator",
257
+ className: cn("ui-dropdown-menu-separator", className)
258
+ }
259
+ );
260
+ }
261
+ function DropdownMenuCheckboxItem({
262
+ children,
263
+ className,
264
+ checked,
265
+ onCheckedChange,
266
+ disabled,
267
+ textValue,
268
+ asChild
269
+ }) {
270
+ const checkboxKey = React.useId();
271
+ const tag = borrowedTag(children, asChild);
272
+ return /* @__PURE__ */ jsx(
273
+ MenuSection,
274
+ {
275
+ selectionMode: "multiple",
276
+ shouldCloseOnSelect: true,
277
+ selectedKeys: checked ? [checkboxKey] : [],
278
+ onSelectionChange: (keys) => {
279
+ onCheckedChange?.(keys === "all" ? true : keys.has(checkboxKey));
280
+ },
281
+ children: /* @__PURE__ */ jsx(
282
+ MenuItem,
283
+ {
284
+ id: checkboxKey,
285
+ isDisabled: disabled,
286
+ textValue,
287
+ className: cn("ui-dropdown-menu-checkbox-item", className),
288
+ render: (props, state) => {
289
+ const { children: content, ...rest } = props;
290
+ return renderItemTag(
291
+ tag,
292
+ { ...rest, "data-slot": "dropdown-menu-checkbox-item", ...radixItemState(state) },
293
+ /* @__PURE__ */ jsxs(Fragment, { children: [
294
+ /* @__PURE__ */ jsx("span", { className: "ui-dropdown-menu-indicator-slot", children: state.isSelected ? /* @__PURE__ */ jsx(Check, { className: "ui-dropdown-menu-check", "aria-hidden": "true" }) : null }),
295
+ content
296
+ ] })
297
+ );
298
+ },
299
+ children: tag ? tag.props.children : children
300
+ }
301
+ )
302
+ }
303
+ );
304
+ }
305
+ function DropdownMenuRadioItem({
306
+ children,
307
+ className,
308
+ value,
309
+ disabled,
310
+ textValue,
311
+ asChild
312
+ }) {
313
+ const tag = borrowedTag(children, asChild);
314
+ return /* @__PURE__ */ jsx(
315
+ MenuItem,
316
+ {
317
+ id: value,
318
+ isDisabled: disabled,
319
+ textValue,
320
+ className: cn("ui-dropdown-menu-radio-item", className),
321
+ render: (props, state) => {
322
+ const { children: content, ...rest } = props;
323
+ return renderItemTag(
324
+ tag,
325
+ { ...rest, "data-slot": "dropdown-menu-radio-item", ...radixItemState(state) },
326
+ content
327
+ );
328
+ },
329
+ children: tag ? tag.props.children : children
330
+ }
331
+ );
332
+ }
333
+ function DropdownMenuSubTrigger({
334
+ children,
335
+ className,
336
+ inset,
337
+ disabled,
338
+ textValue,
339
+ asChild
340
+ }) {
341
+ const tag = borrowedTag(children, asChild);
342
+ return /* @__PURE__ */ jsx(
343
+ MenuItem,
344
+ {
345
+ isDisabled: disabled,
346
+ textValue,
347
+ className: cn(
348
+ "ui-dropdown-menu-sub-trigger [&_svg:not([class*='text-'])]:text-muted-foreground",
349
+ className
350
+ ),
351
+ render: (props, state) => {
352
+ const { children: content, ...rest } = props;
353
+ return renderItemTag(
354
+ tag,
355
+ {
356
+ ...rest,
357
+ "data-slot": "dropdown-menu-sub-trigger",
358
+ "data-inset": inset,
359
+ ...radixItemState(state)
360
+ },
361
+ /* @__PURE__ */ jsxs(Fragment, { children: [
362
+ content,
363
+ /* @__PURE__ */ jsx(ChevronRight, { className: "ui-dropdown-menu-sub-trigger-icon", "aria-hidden": "true" })
364
+ ] })
365
+ );
366
+ },
367
+ children: tag ? tag.props.children : children
368
+ }
369
+ );
370
+ }
371
+ function DropdownMenuSubContent({
372
+ children,
373
+ className,
374
+ align,
375
+ alignOffset,
376
+ sideOffset,
377
+ avoidCollisions,
378
+ collisionPadding,
379
+ loop,
380
+ forceMount,
381
+ hideWhenDetached,
382
+ sticky
383
+ }) {
384
+ void forceMount;
385
+ void hideWhenDetached;
386
+ void sticky;
387
+ return /* @__PURE__ */ jsx(
388
+ Popover,
389
+ {
390
+ "data-slot": "dropdown-menu-sub-content",
391
+ placement: align ? toPlacement("right", align) : void 0,
392
+ offset: sideOffset,
393
+ crossOffset: alignOffset,
394
+ shouldFlip: avoidCollisions,
395
+ containerPadding: collisionPadding,
396
+ className: cn(
397
+ "ui-dropdown-menu-sub-content data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 origin-[var(--trigger-anchor-point)]",
398
+ className
399
+ ),
400
+ render: (props, state) => (
401
+ // `role={undefined}`: một menu không phải một dialog — xem radixSurfaceState.
402
+ /* @__PURE__ */ jsx(
403
+ "div",
404
+ {
405
+ ...props,
406
+ role: void 0,
407
+ ...radixSurfaceState(state),
408
+ "data-align": align ?? "center"
409
+ }
410
+ )
411
+ ),
412
+ children: /* @__PURE__ */ jsx(Menu, { shouldFocusWrap: loop, children })
413
+ }
414
+ );
415
+ }
136
416
  const DropdownMenuShortcut = ({
137
417
  className,
138
418
  ...props
@@ -159,5 +439,9 @@ export {
159
439
  DropdownMenuSub,
160
440
  DropdownMenuSubContent,
161
441
  DropdownMenuSubTrigger,
162
- DropdownMenuTrigger
442
+ DropdownMenuTrigger,
443
+ radixItemState,
444
+ radixSurfaceState,
445
+ selectEvent,
446
+ toPlacement
163
447
  };
@@ -8,5 +8,7 @@ export { FilterBar, FilterBarGroup, Toolbar, ToolbarGroup } from "./filter-bar.j
8
8
  export type { FilterBarChipProp, FilterBarChipProps, FilterBarFilterProp, FilterBarFilterProps, FilterBarGroupProp, FilterBarGroupProps, FilterBarOverflowProp, FilterBarProp, FilterBarProps, FilterBarSearchProp, FilterBarSearchProps, ToolbarGroupProps, ToolbarProps, } from "./filter-bar.js";
9
9
  export { AppSettingPicker } from "./app-setting-picker.js";
10
10
  export type { AppSettingPickerProp, AppSettingPickerProps, AppSettingKind, } from "./app-setting-picker.js";
11
+ export { AppSettingToggle } from "./app-setting-toggle.js";
12
+ export type { AppSettingToggleProp, AppSettingToggleProps, AppSettingToggleKind, } from "./app-setting-toggle.js";
11
13
  export type { BreadcrumbItemProp as BreadcrumbItem } from "../../props/vocabulary/navigation.prop.js";
12
14
  export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "./dropdown-menu.js";
@@ -53,6 +53,7 @@ import {
53
53
  import { Steps } from "./steps.js";
54
54
  import { FilterBar, FilterBarGroup, Toolbar, ToolbarGroup } from "./filter-bar.js";
55
55
  import { AppSettingPicker } from "./app-setting-picker.js";
56
+ import { AppSettingToggle } from "./app-setting-toggle.js";
56
57
  import {
57
58
  DropdownMenu,
58
59
  DropdownMenuCheckboxItem,
@@ -72,6 +73,7 @@ import {
72
73
  } from "./dropdown-menu.js";
73
74
  export {
74
75
  AppSettingPicker,
76
+ AppSettingToggle,
75
77
  ContextMenu,
76
78
  ContextMenuCheckboxItem,
77
79
  ContextMenuContent,
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Build visible page numbers with ellipsis — Ant Design / MUI pagination style. The item count is
2
+ * Build visible page numbers with ellipsis — the conventional enterprise / MUI pagination style.
3
+ * The item count is
3
4
  * CONSTANT wherever the current page sits.
4
5
  */
5
6
  export declare function buildPageRange(current: number, totalPages: number, siblingCount?: number, boundaryCount?: number): (number | "ellipsis")[];
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import type { PaginationProp } from "../../props/components/navigation.prop.js";
3
- export type { PaginationProp, PaginationProp as PaginationProps, } from "../../props/components/navigation.prop.js";
3
+ export type { PaginationProp, PaginationProp as PaginationProps, PaginationSizeProp, PaginationAlignProp, } from "../../props/components/navigation.prop.js";
4
4
  declare const PaginationContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & React.RefAttributes<HTMLUListElement>>;
5
5
  declare const PaginationItem: React.ForwardRefExoticComponent<React.LiHTMLAttributes<HTMLLIElement> & React.RefAttributes<HTMLLIElement>>;
6
6
  declare const PaginationLink: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "type"> & {
@@ -22,5 +22,5 @@ declare const PaginationNext: React.ForwardRefExoticComponent<Omit<Omit<React.De
22
22
  disabled?: boolean;
23
23
  href?: string;
24
24
  } & React.RefAttributes<HTMLButtonElement>>;
25
- export declare function Pagination({ ariaLabel, value, total, pageSize, pageSizeOptions, showSizeChanger, showTotal, hideOnSinglePage, simple, disabled, className, onValueChange, }: PaginationProp): React.JSX.Element | null;
25
+ export declare function Pagination({ ariaLabel, value, total, pageSize, pageSizeOptions, showSizeChanger, showTotal, hideOnSinglePage, simple, showQuickJumper, size, align, responsive, disabled, className, onValueChange, }: PaginationProp): React.JSX.Element | null;
26
26
  export { PaginationContent, PaginationItem, PaginationLink, PaginationEllipsis, PaginationPrevious, PaginationNext, };