banhaten 0.1.3 → 0.2.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 (258) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/CONTRIBUTING.md +44 -0
  3. package/README.md +65 -13
  4. package/SECURITY.md +15 -0
  5. package/banhaten.config.example.json +0 -2
  6. package/docs/design-system/README.md +9 -0
  7. package/docs/design-system/adoption-quality-remediation.md +87 -0
  8. package/docs/design-system/agent-usage.md +13 -0
  9. package/docs/design-system/appearance-presets.md +6 -1
  10. package/docs/design-system/component-docs-pattern.md +81 -0
  11. package/docs/design-system/component-token-consistency-audit.md +13 -3
  12. package/docs/design-system/components/README.md +3 -2
  13. package/docs/design-system/components/accordion.md +16 -0
  14. package/docs/design-system/components/activity-feed.md +15 -1
  15. package/docs/design-system/components/alert-dialog.md +17 -0
  16. package/docs/design-system/components/alert.md +46 -14
  17. package/docs/design-system/components/aspect-ratio.md +15 -0
  18. package/docs/design-system/components/attribute.md +16 -0
  19. package/docs/design-system/components/autocomplete.md +19 -0
  20. package/docs/design-system/components/avatar.md +18 -0
  21. package/docs/design-system/components/badge.md +19 -0
  22. package/docs/design-system/components/banner.md +15 -1
  23. package/docs/design-system/components/breadcrumbs.md +14 -0
  24. package/docs/design-system/components/button-group.md +34 -0
  25. package/docs/design-system/components/button.md +18 -0
  26. package/docs/design-system/components/card.md +18 -1
  27. package/docs/design-system/components/carousel.md +20 -3
  28. package/docs/design-system/components/catalog-components.md +15 -1
  29. package/docs/design-system/components/chart.md +15 -0
  30. package/docs/design-system/components/checkbox.md +16 -0
  31. package/docs/design-system/components/collapsible.md +15 -0
  32. package/docs/design-system/components/command.md +15 -0
  33. package/docs/design-system/components/context-menu.md +15 -0
  34. package/docs/design-system/components/date-picker.md +21 -1
  35. package/docs/design-system/components/divider.md +16 -0
  36. package/docs/design-system/components/empty-state.md +17 -0
  37. package/docs/design-system/components/field.md +17 -0
  38. package/docs/design-system/components/file-upload.md +14 -0
  39. package/docs/design-system/components/hover-card.md +15 -0
  40. package/docs/design-system/components/input-group.md +17 -0
  41. package/docs/design-system/components/input-otp.md +18 -0
  42. package/docs/design-system/components/input.md +43 -7
  43. package/docs/design-system/components/item.md +72 -0
  44. package/docs/design-system/components/kbd.md +18 -0
  45. package/docs/design-system/components/label.md +16 -0
  46. package/docs/design-system/components/menu.md +17 -0
  47. package/docs/design-system/components/menubar.md +15 -0
  48. package/docs/design-system/components/modal.md +25 -4
  49. package/docs/design-system/components/native-select.md +18 -0
  50. package/docs/design-system/components/navigation-menu.md +15 -0
  51. package/docs/design-system/components/onboarding-step-list-item.md +15 -1
  52. package/docs/design-system/components/page-header.md +15 -1
  53. package/docs/design-system/components/pagination.md +30 -8
  54. package/docs/design-system/components/popover.md +19 -0
  55. package/docs/design-system/components/progress-slider.md +18 -0
  56. package/docs/design-system/components/progress.md +17 -0
  57. package/docs/design-system/components/radio-card.md +16 -0
  58. package/docs/design-system/components/radio-group.md +17 -0
  59. package/docs/design-system/components/resizable.md +15 -0
  60. package/docs/design-system/components/scroll-area.md +15 -0
  61. package/docs/design-system/components/segmented-control.md +71 -0
  62. package/docs/design-system/components/select.md +44 -7
  63. package/docs/design-system/components/sheet.md +17 -0
  64. package/docs/design-system/components/sidebar.md +15 -0
  65. package/docs/design-system/components/skeleton.md +18 -0
  66. package/docs/design-system/components/slideout.md +14 -0
  67. package/docs/design-system/components/slider.md +20 -0
  68. package/docs/design-system/components/social-button.md +21 -3
  69. package/docs/design-system/components/spinner.md +16 -0
  70. package/docs/design-system/components/steps.md +14 -0
  71. package/docs/design-system/components/table.md +15 -1
  72. package/docs/design-system/components/tabs.md +17 -0
  73. package/docs/design-system/components/tag.md +17 -0
  74. package/docs/design-system/components/textarea.md +16 -0
  75. package/docs/design-system/components/timeline.md +14 -0
  76. package/docs/design-system/components/toast.md +17 -0
  77. package/docs/design-system/components/toggle.md +17 -0
  78. package/docs/design-system/components/toolbar.md +21 -1
  79. package/docs/design-system/components/tooltip.md +18 -1
  80. package/docs/design-system/density-and-elevation.md +44 -0
  81. package/docs/design-system/direction-and-localization.md +23 -0
  82. package/docs/design-system/form-recipes.md +73 -0
  83. package/docs/design-system/gap-promotion-policy.md +21 -0
  84. package/docs/design-system/gap-promotion-report.md +166 -0
  85. package/docs/design-system/installation.md +68 -0
  86. package/docs/design-system/launch-comparison-shadcn.md +98 -0
  87. package/docs/design-system/registry-and-cli.md +30 -7
  88. package/docs/design-system/release-policy.md +30 -0
  89. package/docs/design-system/roadmap.md +14 -0
  90. package/docs/design-system/support-matrix.md +23 -0
  91. package/docs/design-system/tabs.md +1 -1
  92. package/docs/design-system/token-governance.md +23 -1
  93. package/package.json +29 -15
  94. package/registry/component-contract.json +40 -0
  95. package/registry/components/alert-dialog.tsx +1 -1
  96. package/registry/components/alert.tsx +86 -65
  97. package/registry/components/autocomplete.tsx +23 -9
  98. package/registry/components/avatar.tsx +7 -7
  99. package/registry/components/badge.tsx +1 -1
  100. package/registry/components/button-group.tsx +321 -4
  101. package/registry/components/button.tsx +38 -17
  102. package/registry/components/card.tsx +68 -59
  103. package/registry/components/carousel.tsx +53 -5
  104. package/registry/components/chart.tsx +36 -3
  105. package/registry/components/checkbox.tsx +3 -3
  106. package/registry/components/collapsible.tsx +1 -1
  107. package/registry/components/command.tsx +1 -1
  108. package/registry/components/context-menu.tsx +1 -1
  109. package/registry/components/date-picker.tsx +245 -104
  110. package/registry/components/expanded/ActivityFeed.tsx +6 -15
  111. package/registry/components/expanded/Banner.tsx +3 -3
  112. package/registry/components/expanded/Breadcrumbs.tsx +5 -5
  113. package/registry/components/expanded/CatalogComponentsShowcase.tsx +13 -13
  114. package/registry/components/expanded/CatalogDivider.tsx +1 -1
  115. package/registry/components/expanded/EmptyState.tsx +1 -1
  116. package/registry/components/expanded/FileUpload.tsx +9 -2
  117. package/registry/components/expanded/OnboardingStepListItem.tsx +2 -4
  118. package/registry/components/expanded/PageHeader.tsx +13 -13
  119. package/registry/components/expanded/Slideout.tsx +15 -415
  120. package/registry/components/expanded/Steps.tsx +4 -4
  121. package/registry/components/expanded/Table.tsx +116 -69
  122. package/registry/components/expanded/Timeline.tsx +3 -3
  123. package/registry/components/expanded/activityFeed.css +1 -1
  124. package/registry/components/expanded/breadcrumbs.css +1 -1
  125. package/registry/components/expanded/divider.css +1 -1
  126. package/registry/components/expanded/emptyState.css +1 -1
  127. package/registry/components/expanded/fileUpload.css +6 -6
  128. package/registry/components/expanded/slideout.css +9 -685
  129. package/registry/components/expanded/steps.css +3 -3
  130. package/registry/components/expanded/table.css +2 -2
  131. package/registry/components/expanded/timeline.css +2 -2
  132. package/registry/components/input-content.ts +1 -0
  133. package/registry/components/input-otp.tsx +13 -3
  134. package/registry/components/input.tsx +68 -43
  135. package/registry/components/item.tsx +189 -0
  136. package/registry/components/kbd.tsx +111 -4
  137. package/registry/components/menu.tsx +31 -245
  138. package/registry/components/menubar.tsx +1 -1
  139. package/registry/components/modal.tsx +142 -102
  140. package/registry/components/native-select.tsx +2 -2
  141. package/registry/components/pagination.tsx +80 -58
  142. package/registry/components/popover.tsx +162 -664
  143. package/registry/components/radio-card.tsx +116 -87
  144. package/registry/components/segmented-control.tsx +87 -0
  145. package/registry/components/select-content.tsx +2 -2
  146. package/registry/components/select.tsx +52 -16
  147. package/registry/components/sheet.tsx +1 -1
  148. package/registry/components/sidebar.tsx +1 -1
  149. package/registry/components/skeleton.css +0 -3
  150. package/registry/components/social-button.tsx +47 -25
  151. package/registry/components/spinner.tsx +18 -55
  152. package/registry/components/tabs.css +1 -1
  153. package/registry/components/tabs.tsx +8 -4
  154. package/registry/components/tag.tsx +2 -2
  155. package/registry/components/textarea.tsx +3 -3
  156. package/registry/components/toast.tsx +16 -11
  157. package/registry/components/toggle.tsx +2 -2
  158. package/registry/components/toolbar.tsx +89 -17
  159. package/registry/components/tooltip.tsx +1 -1
  160. package/registry/examples/alert-demo.tsx +25 -5
  161. package/registry/examples/attribute-demo.tsx +1 -1
  162. package/registry/examples/autocomplete-demo.tsx +3 -3
  163. package/registry/examples/avatar-demo.tsx +7 -7
  164. package/registry/examples/badge-demo.tsx +1 -1
  165. package/registry/examples/button-demo.tsx +6 -6
  166. package/registry/examples/button-group-demo.tsx +23 -2
  167. package/registry/examples/card-demo.tsx +46 -8
  168. package/registry/examples/carousel-demo.tsx +20 -2
  169. package/registry/examples/chart-demo.tsx +1 -1
  170. package/registry/examples/checkbox-demo.tsx +5 -5
  171. package/registry/examples/collection-filter-bar-demo.tsx +135 -0
  172. package/registry/examples/command-demo.tsx +3 -3
  173. package/registry/examples/{expanded/command-bar-demo.tsx → command-palette-demo.tsx} +5 -15
  174. package/registry/examples/context-menu-demo.tsx +1 -1
  175. package/registry/examples/control-density-contract-demo.tsx +61 -0
  176. package/registry/examples/date-picker-demo.tsx +12 -12
  177. package/registry/examples/divider-demo.tsx +3 -3
  178. package/registry/examples/expanded/banner-demo.tsx +1 -1
  179. package/registry/examples/expanded/breadcrumbs-demo.tsx +1 -1
  180. package/registry/examples/expanded/empty-state-demo.tsx +1 -1
  181. package/registry/examples/expanded/file-upload-demo.tsx +1 -1
  182. package/registry/examples/expanded/onboarding-step-demo.tsx +1 -1
  183. package/registry/examples/expanded/slideout-demo.tsx +2 -2
  184. package/registry/examples/expanded/steps-demo.tsx +1 -1
  185. package/registry/examples/expanded/tabs-demo.tsx +1 -1
  186. package/registry/examples/expanded/timeline-demo.tsx +1 -1
  187. package/registry/examples/hover-card-demo.tsx +2 -2
  188. package/registry/examples/input-demo.tsx +6 -6
  189. package/registry/examples/input-otp-demo.tsx +4 -4
  190. package/registry/examples/item-demo.tsx +46 -0
  191. package/registry/examples/kbd-demo.tsx +1 -1
  192. package/registry/examples/label-demo.tsx +1 -1
  193. package/registry/examples/menu-demo.tsx +1 -1
  194. package/registry/examples/modal-demo.tsx +67 -9
  195. package/registry/examples/navigation-menu-demo.tsx +1 -1
  196. package/registry/examples/pagination-demo.tsx +6 -3
  197. package/registry/examples/popover-demo.tsx +19 -19
  198. package/registry/examples/progress-demo.tsx +1 -1
  199. package/registry/examples/progress-slider-demo.tsx +1 -1
  200. package/registry/examples/radio-card-demo.tsx +4 -4
  201. package/registry/examples/radio-group-demo.tsx +2 -2
  202. package/registry/examples/resizable-demo.tsx +1 -1
  203. package/registry/examples/results-toolbar-demo.tsx +44 -0
  204. package/registry/examples/scroll-area-demo.tsx +3 -3
  205. package/registry/examples/segmented-control-demo.tsx +39 -0
  206. package/registry/examples/select-demo.tsx +1 -1
  207. package/registry/examples/sidebar-demo.tsx +1 -1
  208. package/registry/examples/slider-demo.tsx +3 -3
  209. package/registry/examples/social-button-demo.tsx +18 -8
  210. package/registry/examples/spinner-demo.tsx +13 -13
  211. package/registry/examples/tabs-demo.tsx +1 -1
  212. package/registry/examples/tag-demo.tsx +1 -1
  213. package/registry/examples/textarea-demo.tsx +4 -4
  214. package/registry/examples/toast-demo.tsx +1 -1
  215. package/registry/examples/toggle-demo.tsx +6 -6
  216. package/registry/examples/tooltip-demo.tsx +4 -4
  217. package/registry/guidance/USAGE.md +27 -0
  218. package/registry/hooks/use-direction.ts +193 -13
  219. package/registry/index.json +5311 -377
  220. package/registry/styles/globals.css +2440 -4061
  221. package/registry.json +119 -149
  222. package/schema/config.schema.json +11 -8
  223. package/schema/registry.schema.json +150 -45
  224. package/schema/tokens.schema.json +134 -34
  225. package/src/cli/command-line.js +194 -0
  226. package/src/cli/config-editors.js +9 -0
  227. package/src/cli/doctor.js +399 -0
  228. package/src/cli/file-transaction.js +295 -0
  229. package/src/cli/global-css.js +153 -0
  230. package/src/cli/index.js +567 -1613
  231. package/src/cli/install-plan.js +592 -0
  232. package/src/cli/install-receipt.js +171 -0
  233. package/src/cli/jsonc.js +203 -0
  234. package/src/cli/package-install-state.js +254 -0
  235. package/src/cli/package-manager.js +238 -0
  236. package/src/cli/package-plan.js +185 -0
  237. package/src/cli/package-version.js +97 -0
  238. package/src/cli/registry-query.js +207 -0
  239. package/src/cli/reporting.js +55 -0
  240. package/src/cli/schema-validation.js +19 -0
  241. package/src/cli/source-scanner.js +686 -0
  242. package/src/cli/vite-config.js +478 -0
  243. package/tokens/banhaten.tokens.json +4312 -309
  244. package/docs/design-system/components/command-bar.md +0 -57
  245. package/registry/components/expanded/BannerBoard.tsx +0 -225
  246. package/registry/components/expanded/CatalogTag.tsx +0 -85
  247. package/registry/components/expanded/CommandBar.tsx +0 -386
  248. package/registry/components/expanded/IconExplorer.tsx +0 -612
  249. package/registry/components/expanded/TimelineShowcase.tsx +0 -158
  250. package/registry/components/expanded/commandBar.css +0 -470
  251. package/registry/components/expanded/iconExplorer.css +0 -764
  252. package/registry/components/expanded/iconPacks.ts +0 -866
  253. package/registry/components/expanded/tag.css +0 -148
  254. package/registry/examples/expanded/icons-demo.tsx +0 -5
  255. package/tokens/Color mode.zip +0 -0
  256. package/tokens/Numbers.zip +0 -0
  257. package/tokens/Radius.zip +0 -0
  258. package/tokens/Theme.zip +0 -0
@@ -3,6 +3,7 @@ import { cva, type VariantProps } from "class-variance-authority"
3
3
  import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"
4
4
 
5
5
  import { cn } from "@/lib/utils"
6
+ import { useResolvedDirection } from "@/hooks/use-direction"
6
7
 
7
8
  type PaginationType = "numeric" | "simple" | "summary"
8
9
  type PaginationVariant = "soft" | "ghost"
@@ -21,10 +22,47 @@ type PaginationPage =
21
22
  ariaLabel?: string
22
23
  }
23
24
 
24
- type PaginationDirection = "ltr" | "rtl"
25
+ type PaginationMessages = {
26
+ caption: React.ReactNode
27
+ morePagesAriaLabel: string
28
+ navigation: string
29
+ next: React.ReactNode
30
+ nextAriaLabel: string
31
+ pageAriaLabel: (page: number) => string
32
+ previous: React.ReactNode
33
+ previousAriaLabel: string
34
+ summary: React.ReactNode
35
+ }
25
36
 
26
37
  const defaultPaginationPages: PaginationPage[] = [1, 2, 3, 4, "ellipsis", 10]
27
38
 
39
+ const defaultPaginationMessages: PaginationMessages = {
40
+ caption: "Showing 1 to 10 of 20 results",
41
+ morePagesAriaLabel: "More pages",
42
+ navigation: "Pagination",
43
+ next: "Next",
44
+ nextAriaLabel: "Next page",
45
+ pageAriaLabel: (page) => `Page ${page}`,
46
+ previous: "Previous",
47
+ previousAriaLabel: "Previous page",
48
+ summary: "Page 1 of 10",
49
+ }
50
+
51
+ const arabicPaginationMessages: PaginationMessages = {
52
+ caption:
53
+ "\u0639\u0631\u0636 1 \u0625\u0644\u0649 10 \u0645\u0646 20 \u0646\u062a\u064a\u062c\u0629",
54
+ morePagesAriaLabel: "\u0635\u0641\u062d\u0627\u062a \u0625\u0636\u0627\u0641\u064a\u0629",
55
+ navigation: "\u0627\u0644\u062a\u0631\u0642\u064a\u0645",
56
+ next: "\u0627\u0644\u062a\u0627\u0644\u064a",
57
+ nextAriaLabel:
58
+ "\u0627\u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u062a\u0627\u0644\u064a\u0629",
59
+ pageAriaLabel: (page) => `\u0627\u0644\u0635\u0641\u062d\u0629 ${page}`,
60
+ previous: "\u0627\u0644\u0633\u0627\u0628\u0642",
61
+ previousAriaLabel:
62
+ "\u0627\u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",
63
+ summary: "\u0627\u0644\u0635\u0641\u062d\u0629 1 \u0645\u0646 10",
64
+ }
65
+
28
66
  const paginationVariants = cva(
29
67
  [
30
68
  "flex max-w-full items-center",
@@ -141,6 +179,7 @@ type PaginationProps = Omit<React.ComponentProps<"nav">, "children"> &
141
179
  variant?: PaginationVariant
142
180
  page?: number
143
181
  pages?: PaginationPage[]
182
+ messages?: Partial<PaginationMessages>
144
183
  showCaption?: boolean
145
184
  caption?: React.ReactNode
146
185
  summary?: React.ReactNode
@@ -159,6 +198,7 @@ const Pagination = React.forwardRef<HTMLElement, PaginationProps>(function Pagin
159
198
  variant = "soft",
160
199
  page = 2,
161
200
  pages = defaultPaginationPages,
201
+ messages: messageOverrides,
162
202
  showCaption = true,
163
203
  caption,
164
204
  summary,
@@ -173,24 +213,36 @@ const Pagination = React.forwardRef<HTMLElement, PaginationProps>(function Pagin
173
213
  dir,
174
214
  ...props
175
215
  }, ref) {
216
+ const rootRef = React.useRef<HTMLElement | null>(null)
217
+ const selectedDirection = useResolvedDirection(
218
+ dir === "ltr" || dir === "rtl" ? dir : undefined,
219
+ rootRef
220
+ )
221
+ const setRootRef = React.useCallback(
222
+ (node: HTMLElement | null) => {
223
+ rootRef.current = node
224
+ if (typeof ref === "function") ref(node)
225
+ else if (ref) ref.current = node
226
+ },
227
+ [ref]
228
+ )
176
229
  const selectedType = type || "numeric"
177
230
  const selectedVariant = variant || "soft"
178
- const selectedDirection = getPaginationDirection(dir)
179
- const labels = getDefaultPaginationLabels(selectedDirection)
180
- const captionContent = caption ?? labels.caption
181
- const summaryContent = summary ?? labels.summary
182
- const previousContent = previousLabel ?? labels.previous
183
- const nextContent = nextLabel ?? labels.next
231
+ const messages = { ...defaultPaginationMessages, ...messageOverrides }
232
+ const captionContent = caption ?? messages.caption
233
+ const summaryContent = summary ?? messages.summary
234
+ const previousContent = previousLabel ?? messages.previous
235
+ const nextContent = nextLabel ?? messages.next
184
236
 
185
237
  return (
186
238
  <nav
187
- aria-label={ariaLabel || labels.navigation}
239
+ aria-label={ariaLabel ?? messages.navigation}
188
240
  data-show-caption={showCaption ? "true" : "false"}
189
241
  data-slot="pagination"
190
242
  data-type={selectedType}
191
243
  data-variant={selectedVariant}
192
- dir={dir}
193
- ref={ref}
244
+ dir={selectedDirection}
245
+ ref={setRootRef}
194
246
  className={cn(
195
247
  paginationVariants({
196
248
  type: selectedType,
@@ -207,7 +259,7 @@ const Pagination = React.forwardRef<HTMLElement, PaginationProps>(function Pagin
207
259
  ) : null}
208
260
  <PaginationControls type="actions">
209
261
  <PaginationTextButton
210
- ariaLabel={previousAriaLabel || labels.previousAriaLabel}
262
+ ariaLabel={previousAriaLabel ?? messages.previousAriaLabel}
211
263
  disabled={previousDisabled}
212
264
  label={previousContent}
213
265
  onClick={() => onPageChange?.(Math.max(1, page - 1))}
@@ -215,7 +267,7 @@ const Pagination = React.forwardRef<HTMLElement, PaginationProps>(function Pagin
215
267
  variant={selectedVariant}
216
268
  />
217
269
  <PaginationTextButton
218
- ariaLabel={nextAriaLabel || labels.nextAriaLabel}
270
+ ariaLabel={nextAriaLabel ?? messages.nextAriaLabel}
219
271
  disabled={nextDisabled}
220
272
  label={nextContent}
221
273
  onClick={() => onPageChange?.(page + 1)}
@@ -229,7 +281,7 @@ const Pagination = React.forwardRef<HTMLElement, PaginationProps>(function Pagin
229
281
  {selectedType === "summary" ? (
230
282
  <>
231
283
  <PaginationTextButton
232
- ariaLabel={previousAriaLabel || labels.previousAriaLabel}
284
+ ariaLabel={previousAriaLabel ?? messages.previousAriaLabel}
233
285
  disabled={previousDisabled}
234
286
  label={previousContent}
235
287
  onClick={() => onPageChange?.(Math.max(1, page - 1))}
@@ -244,7 +296,7 @@ const Pagination = React.forwardRef<HTMLElement, PaginationProps>(function Pagin
244
296
  {summaryContent}
245
297
  </span>
246
298
  <PaginationTextButton
247
- ariaLabel={nextAriaLabel || labels.nextAriaLabel}
299
+ ariaLabel={nextAriaLabel ?? messages.nextAriaLabel}
248
300
  disabled={nextDisabled}
249
301
  label={nextContent}
250
302
  onClick={() => onPageChange?.(page + 1)}
@@ -261,7 +313,7 @@ const Pagination = React.forwardRef<HTMLElement, PaginationProps>(function Pagin
261
313
  ) : null}
262
314
  <PaginationControls type="numeric">
263
315
  <PaginationIconButton
264
- ariaLabel={previousAriaLabel || labels.previousAriaLabel}
316
+ ariaLabel={previousAriaLabel ?? messages.previousAriaLabel}
265
317
  disabled={previousDisabled}
266
318
  onClick={() => onPageChange?.(Math.max(1, page - 1))}
267
319
  type="previous"
@@ -275,13 +327,14 @@ const Pagination = React.forwardRef<HTMLElement, PaginationProps>(function Pagin
275
327
  <PaginationPageItem
276
328
  key={getPaginationPageKey(item, index)}
277
329
  item={item}
330
+ messages={messages}
278
331
  page={page}
279
332
  onPageChange={onPageChange}
280
333
  />
281
334
  ))}
282
335
  </div>
283
336
  <PaginationIconButton
284
- ariaLabel={nextAriaLabel || labels.nextAriaLabel}
337
+ ariaLabel={nextAriaLabel ?? messages.nextAriaLabel}
285
338
  disabled={nextDisabled}
286
339
  onClick={() => onPageChange?.(page + 1)}
287
340
  type="next"
@@ -405,10 +458,12 @@ function PaginationTextButton({
405
458
 
406
459
  function PaginationPageItem({
407
460
  item,
461
+ messages,
408
462
  page,
409
463
  onPageChange,
410
464
  }: {
411
465
  item: PaginationPage
466
+ messages: PaginationMessages
412
467
  page: number
413
468
  onPageChange?: (page: number) => void
414
469
  }) {
@@ -417,12 +472,12 @@ function PaginationPageItem({
417
472
  if (normalizedItem.type === "ellipsis") {
418
473
  return (
419
474
  <span
420
- aria-label={normalizedItem.ariaLabel || "More pages"}
475
+ aria-label={normalizedItem.ariaLabel ?? messages.morePagesAriaLabel}
421
476
  data-slot="pagination-ellipsis"
422
477
  role="separator"
423
478
  className={cn(paginationItemVariants({ active: false }))}
424
479
  >
425
- {normalizedItem.label || "..."}
480
+ {normalizedItem.label ?? "..."}
426
481
  </span>
427
482
  )
428
483
  }
@@ -432,14 +487,16 @@ function PaginationPageItem({
432
487
  return (
433
488
  <button
434
489
  aria-current={isActive ? "page" : undefined}
435
- aria-label={normalizedItem.ariaLabel || `Page ${normalizedItem.value}`}
490
+ aria-label={
491
+ normalizedItem.ariaLabel ?? messages.pageAriaLabel(normalizedItem.value)
492
+ }
436
493
  data-page={normalizedItem.value}
437
494
  data-slot="pagination-page"
438
495
  type="button"
439
496
  className={cn(paginationItemVariants({ active: isActive }))}
440
497
  onClick={() => onPageChange?.(normalizedItem.value)}
441
498
  >
442
- {normalizedItem.label || normalizedItem.value}
499
+ {normalizedItem.label ?? normalizedItem.value}
443
500
  </button>
444
501
  )
445
502
  }
@@ -453,7 +510,7 @@ function PaginationArrowIcon({ type }: { type: "previous" | "next" }) {
453
510
  data-rtl-flip="true"
454
511
  data-slot="pagination-icon"
455
512
  focusable="false"
456
- strokeWidth={2.25}
513
+ strokeWidth="var(--bh-icon-stroke-225)"
457
514
  />
458
515
  )
459
516
  }
@@ -480,44 +537,8 @@ function getPaginationPageKey(item: PaginationPage, index: number) {
480
537
  return `ellipsis-${index}`
481
538
  }
482
539
 
483
- function getPaginationDirection(
484
- dir: React.HTMLAttributes<HTMLElement>["dir"]
485
- ): PaginationDirection {
486
- if (dir === "rtl" || dir === "ltr") {
487
- return dir
488
- }
489
-
490
- return "ltr"
491
- }
492
-
493
- function getDefaultPaginationLabels(direction: PaginationDirection) {
494
- if (direction === "rtl") {
495
- return {
496
- navigation: "\u0627\u0644\u062a\u0631\u0642\u064a\u0645",
497
- caption:
498
- "\u0639\u0631\u0636 1 \u0625\u0644\u0649 10 \u0645\u0646 20 \u0646\u062a\u064a\u062c\u0629",
499
- summary: "\u0627\u0644\u0635\u0641\u062d\u0629 1 \u0645\u0646 10",
500
- previous: "\u0645\u0639\u0627\u064a\u0646\u0629",
501
- next: "\u0627\u0644\u062a\u0627\u0644\u064a",
502
- previousAriaLabel:
503
- "\u0627\u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",
504
- nextAriaLabel:
505
- "\u0627\u0644\u0635\u0641\u062d\u0629 \u0627\u0644\u062a\u0627\u0644\u064a\u0629",
506
- }
507
- }
508
-
509
- return {
510
- navigation: "Pagination",
511
- caption: "Showing 1 to 10 of 20 results",
512
- summary: "Page 1 of 10",
513
- previous: "Previous",
514
- next: "Next",
515
- previousAriaLabel: "Previous page",
516
- nextAriaLabel: "Next page",
517
- }
518
- }
519
-
520
540
  export {
541
+ arabicPaginationMessages,
521
542
  Pagination,
522
543
  paginationControlVariants,
523
544
  paginationItemVariants,
@@ -525,6 +546,7 @@ export {
525
546
  }
526
547
  export type {
527
548
  PaginationPage,
549
+ PaginationMessages,
528
550
  PaginationProps,
529
551
  PaginationType,
530
552
  PaginationVariant,