@godxjp/ui 20.0.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 (250) 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 +12 -1
  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/data-table.d.ts +39 -4
  20. package/dist/components/data-display/data-table.js +802 -270
  21. package/dist/components/data-display/descriptions.d.ts +27 -6
  22. package/dist/components/data-display/descriptions.js +58 -17
  23. package/dist/components/data-display/index.d.ts +2 -0
  24. package/dist/components/data-display/index.js +2 -0
  25. package/dist/components/data-display/list-row.d.ts +10 -1
  26. package/dist/components/data-display/list-row.js +7 -1
  27. package/dist/components/data-display/popover.d.ts +2 -2
  28. package/dist/components/data-display/popover.js +61 -11
  29. package/dist/components/data-display/range-timeline.d.ts +38 -0
  30. package/dist/components/data-display/range-timeline.js +161 -0
  31. package/dist/components/data-display/scroll-area.js +13 -2
  32. package/dist/components/data-display/service-launcher-card.js +10 -10
  33. package/dist/components/data-display/table.d.ts +11 -3
  34. package/dist/components/data-display/table.js +48 -18
  35. package/dist/components/data-display/tree-list.js +4 -9
  36. package/dist/components/data-entry/calendar.d.ts +2 -2
  37. package/dist/components/data-entry/calendar.js +12 -1
  38. package/dist/components/data-entry/cascader.d.ts +1 -1
  39. package/dist/components/data-entry/cascader.js +188 -24
  40. package/dist/components/data-entry/color-picker.d.ts +1 -1
  41. package/dist/components/data-entry/color-picker.js +17 -5
  42. package/dist/components/data-entry/control-appearance.d.ts +64 -0
  43. package/dist/components/data-entry/control-appearance.js +39 -0
  44. package/dist/components/data-entry/control-surface.d.ts +61 -0
  45. package/dist/components/data-entry/control-surface.js +39 -0
  46. package/dist/components/data-entry/date-picker.d.ts +1 -1
  47. package/dist/components/data-entry/date-picker.js +344 -113
  48. package/dist/components/data-entry/date-range-picker.d.ts +1 -1
  49. package/dist/components/data-entry/date-range-picker.js +278 -140
  50. package/dist/components/data-entry/form-field.d.ts +1 -1
  51. package/dist/components/data-entry/form-field.js +39 -4
  52. package/dist/components/data-entry/form.d.ts +4 -0
  53. package/dist/components/data-entry/form.js +4 -2
  54. package/dist/components/data-entry/index.d.ts +7 -3
  55. package/dist/components/data-entry/index.js +10 -1
  56. package/dist/components/data-entry/input-otp.d.ts +1 -1
  57. package/dist/components/data-entry/input.d.ts +12 -34
  58. package/dist/components/data-entry/input.js +92 -24
  59. package/dist/components/data-entry/month-picker.d.ts +1 -1
  60. package/dist/components/data-entry/month-picker.js +47 -10
  61. package/dist/components/data-entry/month-range-picker.d.ts +1 -1
  62. package/dist/components/data-entry/month-range-picker.js +51 -11
  63. package/dist/components/data-entry/number-input.d.ts +7 -0
  64. package/dist/components/data-entry/number-input.js +147 -98
  65. package/dist/components/data-entry/password-input.d.ts +1 -1
  66. package/dist/components/data-entry/radio.d.ts +1 -1
  67. package/dist/components/data-entry/radio.js +61 -13
  68. package/dist/components/data-entry/search-input.d.ts +1 -1
  69. package/dist/components/data-entry/search-input.js +16 -2
  70. package/dist/components/data-entry/search-select.d.ts +2 -2
  71. package/dist/components/data-entry/search-select.js +209 -78
  72. package/dist/components/data-entry/select.d.ts +22 -4
  73. package/dist/components/data-entry/select.js +215 -163
  74. package/dist/components/data-entry/slider.d.ts +9 -1
  75. package/dist/components/data-entry/slider.js +87 -9
  76. package/dist/components/data-entry/switch.d.ts +3 -0
  77. package/dist/components/data-entry/switch.js +29 -3
  78. package/dist/components/data-entry/textarea.d.ts +14 -56
  79. package/dist/components/data-entry/textarea.js +80 -33
  80. package/dist/components/data-entry/time-picker.d.ts +2 -2
  81. package/dist/components/data-entry/time-picker.js +333 -109
  82. package/dist/components/data-entry/time-range-picker.d.ts +5 -0
  83. package/dist/components/data-entry/time-range-picker.js +89 -0
  84. package/dist/components/data-entry/transfer.d.ts +1 -1
  85. package/dist/components/data-entry/transfer.js +86 -28
  86. package/dist/components/data-entry/tree-select.d.ts +1 -1
  87. package/dist/components/data-entry/tree-select.js +201 -113
  88. package/dist/components/data-entry/tree-utils.js +7 -14
  89. package/dist/components/data-entry/upload-files.d.ts +2 -0
  90. package/dist/components/data-entry/upload-files.js +31 -0
  91. package/dist/components/data-entry/upload-request.d.ts +4 -0
  92. package/dist/components/data-entry/upload-request.js +53 -0
  93. package/dist/components/data-entry/upload-types.d.ts +28 -0
  94. package/dist/components/data-entry/upload-types.js +2 -0
  95. package/dist/components/data-entry/upload.d.ts +2 -2
  96. package/dist/components/data-entry/upload.js +475 -115
  97. package/dist/components/feedback/dialog.js +16 -19
  98. package/dist/components/general/button.d.ts +1 -1
  99. package/dist/components/general/button.js +5 -1
  100. package/dist/components/general/index.d.ts +1 -0
  101. package/dist/components/general/index.js +2 -0
  102. package/dist/components/general/typography.d.ts +3 -0
  103. package/dist/components/general/typography.js +15 -1
  104. package/dist/components/general/visually-hidden.d.ts +3 -0
  105. package/dist/components/general/visually-hidden.js +9 -0
  106. package/dist/components/layout/app-launcher.d.ts +34 -0
  107. package/dist/components/layout/app-launcher.js +228 -0
  108. package/dist/components/layout/app-shell.d.ts +2 -0
  109. package/dist/components/layout/app-shell.js +20 -7
  110. package/dist/components/layout/breadcrumb.d.ts +14 -2
  111. package/dist/components/layout/breadcrumb.js +46 -4
  112. package/dist/components/layout/flex.d.ts +1 -1
  113. package/dist/components/layout/flex.js +23 -2
  114. package/dist/components/layout/index.d.ts +3 -0
  115. package/dist/components/layout/index.js +5 -1
  116. package/dist/components/layout/org-switcher.js +20 -1
  117. package/dist/components/layout/page-container.d.ts +1 -1
  118. package/dist/components/layout/page-container.js +5 -3
  119. package/dist/components/layout/responsive-grid.d.ts +16 -2
  120. package/dist/components/layout/responsive-grid.js +29 -2
  121. package/dist/components/layout/topbar-item.d.ts +3 -0
  122. package/dist/components/layout/topbar-item.js +18 -3
  123. package/dist/components/layout/topbar.d.ts +1 -1
  124. package/dist/components/layout/topbar.js +27 -6
  125. package/dist/components/navigation/dropdown-menu.d.ts +30 -2
  126. package/dist/components/navigation/dropdown-menu.js +68 -11
  127. package/dist/components/navigation/pagination.d.ts +2 -2
  128. package/dist/components/navigation/pagination.js +155 -83
  129. package/dist/components/navigation/steps.d.ts +2 -2
  130. package/dist/components/navigation/steps.js +29 -4
  131. package/dist/components/navigation/tabs.d.ts +5 -33
  132. package/dist/components/navigation/tabs.js +232 -64
  133. package/dist/components/ui/input-otp.d.ts +26 -28
  134. package/dist/components/ui/input-otp.js +50 -7
  135. package/dist/components/ui/password-input.d.ts +36 -2
  136. package/dist/components/ui/password-input.js +27 -7
  137. package/dist/components/ui/rating.d.ts +25 -0
  138. package/dist/components/ui/rating.js +67 -27
  139. package/dist/components/ui/segmented.d.ts +9 -0
  140. package/dist/components/ui/segmented.js +17 -2
  141. package/dist/components/ui/separator.d.ts +4 -0
  142. package/dist/components/ui/separator.js +13 -0
  143. package/dist/components/ui/tag-input.d.ts +45 -0
  144. package/dist/components/ui/tag-input.js +109 -27
  145. package/dist/form/form-context.d.ts +29 -0
  146. package/dist/form/form-context.js +44 -4
  147. package/dist/form/form-field-array.d.ts +22 -0
  148. package/dist/form/form-field-array.js +50 -0
  149. package/dist/form/form-field-control.d.ts +2 -1
  150. package/dist/form/form-field-control.js +116 -40
  151. package/dist/form/form-root.d.ts +2 -1
  152. package/dist/form/form-root.js +142 -23
  153. package/dist/form/index.d.ts +3 -1
  154. package/dist/form/index.js +12 -1
  155. package/dist/i18n/messages/en.json +56 -5
  156. package/dist/i18n/messages/ja.json +56 -5
  157. package/dist/i18n/messages/vi.json +56 -5
  158. package/dist/inertia/index.d.ts +20 -0
  159. package/dist/inertia/index.js +60 -1
  160. package/dist/lib/control-styles.d.ts +25 -3
  161. package/dist/lib/control-styles.js +9 -3
  162. package/dist/lib/datetime/picker-format.d.ts +8 -0
  163. package/dist/lib/datetime/picker-format.js +54 -0
  164. package/dist/props/components/charts.prop.d.ts +21 -0
  165. package/dist/props/components/data-display.prop.d.ts +55 -4
  166. package/dist/props/components/data-entry.prop.d.ts +687 -43
  167. package/dist/props/components/form.prop.d.ts +142 -4
  168. package/dist/props/components/general.prop.d.ts +17 -1
  169. package/dist/props/components/index.d.ts +2 -2
  170. package/dist/props/components/layout.prop.d.ts +163 -6
  171. package/dist/props/components/navigation.prop.d.ts +113 -3
  172. package/dist/props/registry.d.ts +376 -10
  173. package/dist/props/registry.js +493 -9
  174. package/dist/props/vocabulary/data.prop.d.ts +179 -1
  175. package/dist/props/vocabulary/index.d.ts +4 -4
  176. package/dist/props/vocabulary/interaction.prop.d.ts +51 -2
  177. package/dist/props/vocabulary/navigation.prop.d.ts +40 -0
  178. package/dist/props/vocabulary/shared.prop.d.ts +33 -0
  179. package/dist/styles/badge-layout.css +2 -1
  180. package/dist/styles/card-layout.css +26 -4
  181. package/dist/styles/chart-layout.css +15 -0
  182. package/dist/styles/control.css +515 -14
  183. package/dist/styles/data-display-layout.css +241 -6
  184. package/dist/styles/data-entry-layout.css +13 -0
  185. package/dist/styles/layout.css +221 -4
  186. package/dist/styles/navigation-layout.css +227 -0
  187. package/dist/styles/shell-layout.css +229 -5
  188. package/dist/styles/table-layout.css +95 -6
  189. package/dist/styles/text-layout.css +5 -0
  190. package/dist/tokens/base.css +1 -0
  191. package/dist/tokens/components/badge.css +1 -0
  192. package/dist/tokens/components/chart.css +6 -0
  193. package/dist/tokens/components/control.css +79 -2
  194. package/dist/tokens/components/data-display.css +9 -0
  195. package/dist/tokens/components/descriptions.css +11 -0
  196. package/dist/tokens/components/flex.css +8 -0
  197. package/dist/tokens/components/navigation.css +55 -0
  198. package/dist/tokens/components/shell.css +50 -2
  199. package/dist/tokens/components/table.css +14 -0
  200. package/dist/tokens/semantic/layout.css +9 -0
  201. package/docs/CONSUMER-RULES.md +13 -0
  202. package/docs/DESIGN-AUTHORITY.md +43 -6
  203. package/docs/DEVELOPMENT.md +4 -3
  204. package/docs/FORMS.md +151 -6
  205. package/docs/FRAME-COVERAGE-REPORT.md +29 -16
  206. package/docs/README.md +1 -1
  207. package/docs/STANDARDS-vocabulary-tokens.md +1 -1
  208. package/docs/TESTING.md +15 -6
  209. package/docs/charts/cjk-category-axis.tsx +81 -0
  210. package/docs/data-display/card/index.tsx +22 -0
  211. package/docs/data-display/data-table/examples/antd-parity.tsx +257 -0
  212. package/docs/data-display/data-table/index.tsx +23 -0
  213. package/docs/data-display/descriptions.tsx +41 -0
  214. package/docs/data-display/scroll-area.tsx +31 -25
  215. package/docs/data-display/table.tsx +104 -45
  216. package/docs/data-display/timeline.tsx +41 -0
  217. package/docs/data-entry/date-picker.tsx +85 -0
  218. package/docs/data-entry/date-range-picker.tsx +26 -0
  219. package/docs/data-entry/form-dynamic-fields.tsx +199 -0
  220. package/docs/data-entry/form.tsx +74 -4
  221. package/docs/data-entry/input-otp.tsx +24 -0
  222. package/docs/data-entry/input.tsx +46 -1
  223. package/docs/data-entry/month-range-picker.tsx +1 -1
  224. package/docs/data-entry/select.tsx +27 -0
  225. package/docs/data-entry/switch.tsx +41 -0
  226. package/docs/data-entry/textarea.tsx +38 -0
  227. package/docs/data-entry/time-picker.tsx +85 -1
  228. package/docs/data-entry/time-range-picker.tsx +55 -0
  229. package/docs/data-entry/transfer.tsx +17 -0
  230. package/docs/data-entry/upload.tsx +56 -12
  231. package/docs/feedback/tooltip.tsx +1 -1
  232. package/docs/general/activity.tsx +2 -2
  233. package/docs/general/button/index.tsx +14 -1
  234. package/docs/general/typography.tsx +14 -1
  235. package/docs/layout/app-launcher.tsx +151 -0
  236. package/docs/layout/app-shell.tsx +11 -0
  237. package/docs/layout/flex.tsx +50 -0
  238. package/docs/layout/responsive-grid.tsx +21 -1
  239. package/docs/layout/topbar.tsx +5 -9
  240. package/docs/navigation/app-setting-picker.tsx +11 -0
  241. package/docs/navigation/breadcrumb.tsx +48 -0
  242. package/docs/navigation/dropdown-menu.tsx +21 -0
  243. package/docs/navigation/pagination.tsx +52 -0
  244. package/docs/navigation/steps.tsx +37 -0
  245. package/docs/navigation/tabs.tsx +97 -1
  246. package/docs/query/button-refetch.tsx +1 -0
  247. package/package.json +19 -2
  248. package/scripts/_agent-setup.mjs +19 -2
  249. package/scripts/init-guinea-pig.mjs +26 -4
  250. package/scripts/ui-audit.mjs +243 -30
@@ -3,9 +3,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
5
5
  import { useTranslation } from "../../i18n/use-translation.js";
6
- import { useScrollableRegionTabIndex } from "../../lib/hooks.js";
6
+ import { useIsMobile, useScrollableRegionTabIndex } from "../../lib/hooks.js";
7
7
  import { cn } from "../../lib/utils.js";
8
8
  import { Button } from "../general/button.js";
9
+ import { Form } from "../data-entry/form.js";
10
+ import { FormField } from "../data-entry/form-field.js";
11
+ import { Input } from "../data-entry/input.js";
9
12
  import {
10
13
  Select,
11
14
  SelectContent,
@@ -110,19 +113,33 @@ function Pagination({
110
113
  showTotal,
111
114
  hideOnSinglePage = true,
112
115
  simple,
116
+ showQuickJumper,
117
+ size = "md",
118
+ align = "end",
119
+ responsive = true,
113
120
  disabled,
114
121
  className,
115
122
  onValueChange
116
123
  }) {
117
124
  const { t } = useTranslation();
125
+ const jumperId = React.useId();
126
+ const [jumperDraft, setJumperDraft] = React.useState("");
127
+ const isNarrowViewport = useIsMobile();
118
128
  const navLabel = ariaLabel ?? t("navigation.pagination.ariaLabel");
119
129
  const totalPages = Math.max(1, Math.ceil(total / pageSize));
120
130
  const safeCurrent = Math.min(Math.max(1, value), totalPages);
121
131
  const pages = buildPageRange(safeCurrent, totalPages);
122
- const go = (page, size = pageSize) => {
132
+ const compact = Boolean(simple) || responsive && isNarrowViewport;
133
+ const go = (page, size2 = pageSize) => {
123
134
  if (disabled) return;
124
- const nextPage = Math.min(Math.max(1, page), Math.max(1, Math.ceil(total / size)));
125
- onValueChange?.(nextPage, size);
135
+ const nextPage = Math.min(Math.max(1, page), Math.max(1, Math.ceil(total / size2)));
136
+ onValueChange?.(nextPage, size2);
137
+ };
138
+ const commitJump = () => {
139
+ const parsed = Number.parseInt(jumperDraft, 10);
140
+ setJumperDraft("");
141
+ if (!Number.isFinite(parsed)) return;
142
+ go(parsed);
126
143
  };
127
144
  const totalLabel = typeof showTotal === "function" ? showTotal(total, [
128
145
  total === 0 ? 0 : (safeCurrent - 1) * pageSize + 1,
@@ -130,96 +147,151 @@ function Pagination({
130
147
  ]) : showTotal ? t("navigation.pagination.total", { total }) : null;
131
148
  if (total <= 0) return null;
132
149
  if (hideOnSinglePage && totalPages <= 1) return null;
133
- if (simple) {
134
- return /* @__PURE__ */ jsxs("nav", { "aria-label": navLabel, "data-simple": "true", className: cn("ui-pagination", className), children: [
135
- totalLabel && /* @__PURE__ */ jsx("span", { className: "ui-pagination-total", children: totalLabel }),
136
- /* @__PURE__ */ jsx(
137
- Button,
138
- {
139
- type: "button",
140
- variant: "outline",
141
- size: "sm",
142
- disabled: Boolean(disabled) || safeCurrent <= 1,
143
- "aria-label": t("navigation.pagination.prev"),
144
- onClick: () => go(safeCurrent - 1),
145
- children: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" })
146
- }
147
- ),
148
- /* @__PURE__ */ jsxs("span", { className: "ui-pagination-count", children: [
149
- safeCurrent,
150
- " / ",
151
- totalPages
152
- ] }),
153
- /* @__PURE__ */ jsx(
154
- Button,
155
- {
156
- type: "button",
157
- variant: "outline",
158
- size: "sm",
159
- disabled: Boolean(disabled) || safeCurrent >= totalPages,
160
- "aria-label": t("navigation.pagination.next"),
161
- onClick: () => go(safeCurrent + 1),
162
- children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
163
- }
164
- )
165
- ] });
166
- }
167
- return /* @__PURE__ */ jsxs("nav", { "aria-label": navLabel, className: cn("ui-pagination", className), children: [
168
- totalLabel && /* @__PURE__ */ jsx("span", { className: "ui-pagination-total", children: totalLabel }),
169
- showSizeChanger && /* @__PURE__ */ jsxs(
170
- Select,
150
+ const goButton = showQuickJumper && typeof showQuickJumper === "object" ? showQuickJumper.goButton : void 0;
151
+ const quickJumper = showQuickJumper ? /* @__PURE__ */ jsxs("div", { className: "ui-pagination-jumper", "data-slot": "pagination-jumper", children: [
152
+ /* @__PURE__ */ jsx(Form, { asChild: true, layout: "horizontal", collapseBelow: false, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
153
+ FormField,
154
+ {
155
+ id: jumperId,
156
+ label: t("navigation.pagination.jumpTo"),
157
+ layout: "horizontal",
158
+ labelWidth: "auto",
159
+ controlWidth: "auto",
160
+ children: /* @__PURE__ */ jsx(
161
+ Input,
162
+ {
163
+ id: jumperId,
164
+ size,
165
+ type: "number",
166
+ inputMode: "numeric",
167
+ min: 1,
168
+ max: totalPages,
169
+ disabled,
170
+ className: "ui-pagination-jumper-input w-[var(--pagination-jumper-width)]",
171
+ value: jumperDraft,
172
+ onChange: (event) => setJumperDraft(event.target.value),
173
+ onKeyDown: (event) => {
174
+ if (event.key !== "Enter") return;
175
+ event.preventDefault();
176
+ commitJump();
177
+ }
178
+ }
179
+ )
180
+ }
181
+ ) }) }),
182
+ goButton ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", disabled, onClick: commitJump, children: goButton }) : null
183
+ ] }) : null;
184
+ if (compact) {
185
+ return /* @__PURE__ */ jsxs(
186
+ "nav",
171
187
  {
172
- value: String(pageSize),
173
- onValueChange: (v) => go(1, Number(v)),
174
- disabled,
188
+ "aria-label": navLabel,
189
+ "data-simple": "true",
190
+ "data-size": size,
191
+ "data-align": align,
192
+ className: cn("ui-pagination", className),
175
193
  children: [
194
+ totalLabel && /* @__PURE__ */ jsx("span", { className: "ui-pagination-total", children: totalLabel }),
176
195
  /* @__PURE__ */ jsx(
177
- SelectTrigger,
196
+ Button,
178
197
  {
179
- className: "ui-pagination-size-trigger w-max min-w-[var(--pagination-size-width)]",
180
- "aria-label": t("navigation.pagination.pageSize"),
181
- children: /* @__PURE__ */ jsx(SelectValue, { children: t("navigation.pagination.pageSizeTrigger", { size: pageSize }) })
198
+ type: "button",
199
+ variant: "outline",
200
+ size: "sm",
201
+ disabled: Boolean(disabled) || safeCurrent <= 1,
202
+ "aria-label": t("navigation.pagination.prev"),
203
+ onClick: () => go(safeCurrent - 1),
204
+ children: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" })
182
205
  }
183
206
  ),
184
- /* @__PURE__ */ jsx(SelectContent, { children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx(SelectItem, { value: String(size), children: size }, size)) })
207
+ /* @__PURE__ */ jsxs("span", { className: "ui-pagination-count", children: [
208
+ safeCurrent,
209
+ " / ",
210
+ totalPages
211
+ ] }),
212
+ /* @__PURE__ */ jsx(
213
+ Button,
214
+ {
215
+ type: "button",
216
+ variant: "outline",
217
+ size: "sm",
218
+ disabled: Boolean(disabled) || safeCurrent >= totalPages,
219
+ "aria-label": t("navigation.pagination.next"),
220
+ onClick: () => go(safeCurrent + 1),
221
+ children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
222
+ }
223
+ ),
224
+ quickJumper
185
225
  ]
186
226
  }
187
- ),
188
- /* @__PURE__ */ jsxs(PaginationContent, { children: [
189
- /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
190
- PaginationPrevious,
191
- {
192
- "aria-label": t("navigation.pagination.prev"),
193
- onClick: () => go(safeCurrent - 1),
194
- disabled: Boolean(disabled) || safeCurrent <= 1,
195
- children: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" })
196
- }
197
- ) }),
198
- pages.map(
199
- (page, index) => page === "ellipsis" ? /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }, `e-${index}`) : /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
200
- PaginationLink,
227
+ );
228
+ }
229
+ return /* @__PURE__ */ jsxs(
230
+ "nav",
231
+ {
232
+ "aria-label": navLabel,
233
+ "data-size": size,
234
+ "data-align": align,
235
+ className: cn("ui-pagination", className),
236
+ children: [
237
+ totalLabel && /* @__PURE__ */ jsx("span", { className: "ui-pagination-total", children: totalLabel }),
238
+ showSizeChanger && /* @__PURE__ */ jsxs(
239
+ Select,
201
240
  {
202
- isActive: page === safeCurrent,
203
- "aria-label": t("navigation.pagination.page", { page }),
204
- onClick: () => {
205
- if (!disabled) go(page);
206
- },
241
+ value: String(pageSize),
242
+ onValueChange: (v) => go(1, Number(v)),
207
243
  disabled,
208
- children: page
244
+ children: [
245
+ /* @__PURE__ */ jsx(
246
+ SelectTrigger,
247
+ {
248
+ className: "ui-pagination-size-trigger w-max min-w-[var(--pagination-size-width)]",
249
+ "aria-label": t("navigation.pagination.pageSize"),
250
+ children: /* @__PURE__ */ jsx(SelectValue, { children: t("navigation.pagination.pageSizeTrigger", { size: pageSize }) })
251
+ }
252
+ ),
253
+ /* @__PURE__ */ jsx(SelectContent, { children: pageSizeOptions.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: String(option), children: option }, option)) })
254
+ ]
209
255
  }
210
- ) }, page)
211
- ),
212
- /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
213
- PaginationNext,
214
- {
215
- "aria-label": t("navigation.pagination.next"),
216
- onClick: () => go(safeCurrent + 1),
217
- disabled: Boolean(disabled) || safeCurrent >= totalPages,
218
- children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
219
- }
220
- ) })
221
- ] })
222
- ] });
256
+ ),
257
+ /* @__PURE__ */ jsxs(PaginationContent, { children: [
258
+ /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
259
+ PaginationPrevious,
260
+ {
261
+ "aria-label": t("navigation.pagination.prev"),
262
+ onClick: () => go(safeCurrent - 1),
263
+ disabled: Boolean(disabled) || safeCurrent <= 1,
264
+ children: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true" })
265
+ }
266
+ ) }),
267
+ pages.map(
268
+ (page, index) => page === "ellipsis" ? /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationEllipsis, {}) }, `e-${index}`) : /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
269
+ PaginationLink,
270
+ {
271
+ isActive: page === safeCurrent,
272
+ "aria-label": t("navigation.pagination.page", { page }),
273
+ onClick: () => {
274
+ if (!disabled) go(page);
275
+ },
276
+ disabled,
277
+ children: page
278
+ }
279
+ ) }, page)
280
+ ),
281
+ /* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(
282
+ PaginationNext,
283
+ {
284
+ "aria-label": t("navigation.pagination.next"),
285
+ onClick: () => go(safeCurrent + 1),
286
+ disabled: Boolean(disabled) || safeCurrent >= totalPages,
287
+ children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true" })
288
+ }
289
+ ) })
290
+ ] }),
291
+ quickJumper
292
+ ]
293
+ }
294
+ );
223
295
  }
224
296
  export {
225
297
  Pagination,
@@ -1,4 +1,4 @@
1
1
  import * as React from "react";
2
2
  import type { StepsProp } from "../../props/components/navigation.prop.js";
3
- export type { StepsProp, StepsProp as StepsProps, StepItemProp, StepStatusProp, StepsSeparatorProp, } from "../../props/components/navigation.prop.js";
4
- export declare function Steps({ items, value: current, defaultValue, status: currentStatus, orientation, type, size, titlePlacement, separator, onValueChange, className, }: StepsProp): React.JSX.Element;
3
+ export type { StepsProp, StepsProp as StepsProps, StepItemProp, StepStatusProp, StepsSeparatorProp, StepsTypeProp, } from "../../props/components/navigation.prop.js";
4
+ export declare function Steps({ items, value: current, defaultValue, status: currentStatus, orientation, type, size, titlePlacement, separator, percent, onValueChange, className, }: StepsProp): React.JSX.Element;
@@ -4,6 +4,10 @@ import { ArrowRight, Check, ChevronRight, Circle, Loader2, X } from "lucide-reac
4
4
  import { useTranslation } from "../../i18n/use-translation.js";
5
5
  import { cn } from "../../lib/utils.js";
6
6
  import { controlIconClass } from "../../lib/control-styles.js";
7
+ function boundStepPercent(percent) {
8
+ if (!Number.isFinite(percent)) return 0;
9
+ return Math.min(100, Math.max(0, percent));
10
+ }
7
11
  function resolveStepStatus(index, current, itemStatus, currentStatus) {
8
12
  if (itemStatus) return itemStatus;
9
13
  if (index < current) return "finish";
@@ -44,6 +48,7 @@ function Steps({
44
48
  size = "md",
45
49
  titlePlacement = "horizontal",
46
50
  separator = "chevron",
51
+ percent,
47
52
  onValueChange,
48
53
  className
49
54
  }) {
@@ -52,11 +57,16 @@ function Steps({
52
57
  const isVertical = orientation === "vertical";
53
58
  const compact = size === "sm";
54
59
  const inline = type === "inline";
60
+ const navigation = type === "navigation";
55
61
  const SeparatorIcon = separator === "arrow" ? ArrowRight : ChevronRight;
62
+ const showPercent = percent !== void 0 && !inline;
63
+ const boundedPercent = boundStepPercent(percent ?? 0);
64
+ const progressRatio = boundedPercent / 100;
56
65
  return /* @__PURE__ */ jsx(
57
66
  "ol",
58
67
  {
59
68
  "data-direction": inline ? void 0 : isVertical ? "vertical" : "horizontal",
69
+ "data-type": type,
60
70
  className: cn("flex w-full", inline ? "ui-steps-inline" : "ui-steps-list", className),
61
71
  "aria-label": t("navigation.steps.ariaLabel"),
62
72
  children: items.map((item, index) => {
@@ -80,7 +90,19 @@ function Steps({
80
90
  /* @__PURE__ */ jsx("span", { className: "ui-steps-inline-title", children: item.title }),
81
91
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: statusLabel })
82
92
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
83
- /* @__PURE__ */ jsx(StepIcon, { status: stepStatus, icon: item.icon, type }),
93
+ showPercent && absoluteIndex === current ? /* @__PURE__ */ jsx(
94
+ "span",
95
+ {
96
+ className: "ui-steps-progress",
97
+ role: "progressbar",
98
+ "aria-valuenow": boundedPercent,
99
+ "aria-valuemin": 0,
100
+ "aria-valuemax": 100,
101
+ "aria-label": t("navigation.steps.percentLabel"),
102
+ style: { "--steps-progress-ratio": progressRatio },
103
+ children: /* @__PURE__ */ jsx(StepIcon, { status: stepStatus, icon: item.icon, type })
104
+ }
105
+ ) : /* @__PURE__ */ jsx(StepIcon, { status: stepStatus, icon: item.icon, type }),
84
106
  /* @__PURE__ */ jsxs("div", { className: "ui-steps-text", children: [
85
107
  /* @__PURE__ */ jsx(
86
108
  "div",
@@ -101,7 +123,7 @@ function Steps({
101
123
  "aria-current": isCurrent ? "step" : void 0,
102
124
  "data-direction": inline ? void 0 : isVertical ? "vertical" : "horizontal",
103
125
  "data-title-placement": titlePlacement,
104
- "data-connector": !isVertical && !inline && index < items.length - 1 ? "" : void 0,
126
+ "data-connector": !isVertical && !inline && !navigation && index < items.length - 1 ? "" : void 0,
105
127
  className: cn(!inline && "flex-1", inline ? "ui-steps-inline-item" : "ui-steps-item"),
106
128
  "data-status": stepStatus,
107
129
  children: [
@@ -116,10 +138,13 @@ function Steps({
116
138
  children: stepInner
117
139
  }
118
140
  ) : /* @__PURE__ */ jsx("span", { "data-direction": stepDirection, className: stepClassName, children: stepInner }),
119
- inline && index < items.length - 1 ? /* @__PURE__ */ jsx(
141
+ (inline || navigation && !isVertical) && index < items.length - 1 ? /* @__PURE__ */ jsx(
120
142
  SeparatorIcon,
121
143
  {
122
- className: "ui-steps-inline-separator rtl:rotate-180",
144
+ className: cn(
145
+ inline ? "ui-steps-inline-separator" : "ui-steps-nav-separator",
146
+ "rtl:rotate-180"
147
+ ),
123
148
  "aria-hidden": "true"
124
149
  }
125
150
  ) : null
@@ -1,42 +1,14 @@
1
1
  import * as React from "react";
2
- export type TabsItem = {
3
- value: string;
4
- label: React.ReactNode;
5
- content: React.ReactNode;
6
- disabled?: boolean;
7
- };
2
+ import type { TabItemProp, TabsProp } from "../../props/components/navigation.prop.js";
3
+ export type { TabItemProp, TabsProp, TabsVariantProp, TabsPlacementProp, TabsExtraProp, } from "../../props/components/navigation.prop.js";
8
4
  export type TabsOrientation = "vertical" | "horizontal";
9
- /**
10
- * The repo's Radix-era vocabulary, kept VERBATIM. React Aria spells the same four things
11
- * `selectedKey` / `defaultSelectedKey` / `onSelectionChange` / `keyboardActivation`; the
12
- * translation lives inside this file so no consumer ever has to learn RAC's names.
13
- *
14
- * `activationMode` is the one that MUST NOT be dropped. `.ai/rules/settings.md` in the consumer
15
- * requires `orientation="vertical"` + `activationMode="manual"` for the settings rail, because
16
- * every item there is a URL — automatic activation would load four pages while the reader is only
17
- * arrowing past them.
18
- */
19
- export type TabsProps = Omit<React.ComponentPropsWithoutRef<"div">, "defaultValue" | "dir"> & {
20
- /** Controlled selected tab — RAC `selectedKey`. */
21
- value?: string;
22
- /** Uncontrolled initial selection — RAC `defaultSelectedKey`. */
23
- defaultValue?: string;
24
- /** Fired with the NEW selected value — RAC `onSelectionChange`. */
25
- onValueChange?: (value: string) => void;
5
+ export type TabsItem = TabItemProp;
6
+ export type TabsProps = Omit<React.ComponentPropsWithoutRef<"div">, "defaultValue" | "dir"> & TabsProp & {
26
7
  orientation?: TabsOrientation;
27
- /**
28
- * DOM attribute only. Under Radix this also steered RTL arrow keys; React Aria reads the
29
- * direction from the locale, so an RTL app must set it through `I18nProvider`.
30
- */
31
8
  dir?: "ltr" | "rtl";
32
- /** `"manual"` = arrow keys move focus without selecting — RAC `keyboardActivation`. */
33
9
  activationMode?: "manual" | "automatic";
34
- items?: TabsItem[];
35
- variant?: "default" | "line" | "card";
36
- listClassName?: string;
37
- contentClassName?: string;
38
10
  };
39
- export declare function Tabs({ className, orientation, items, value, defaultValue, onValueChange, activationMode, dir, variant, listClassName, contentClassName, children, ...props }: TabsProps): React.JSX.Element;
11
+ export declare function Tabs({ className, orientation, items, value, defaultValue, onValueChange, activationMode, dir, variant, tabPlacement, size, centered, extra, destroyOnHidden, onEdit, addIcon, hideAdd, listClassName, contentClassName, children, ...props }: TabsProps): React.JSX.Element;
40
12
  export declare const TabsList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
41
13
  variant?: "default" | "line";
42
14
  /**