@astryxdesign/core 0.1.9-canary.5eec8d9 → 0.1.9-canary.75d2d03
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.
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +11 -3
- package/dist/astryx.umd.js +42 -42
- package/dist/astryx.umd.js.map +4 -4
- package/dist/i18n/InternationalizationContext.d.ts +1 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -0
- package/dist/i18n/InternationalizationProvider.d.ts +8 -1
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +5 -1
- package/dist/i18n/getLocaleDirection.d.ts +18 -0
- package/dist/i18n/getLocaleDirection.d.ts.map +1 -0
- package/dist/i18n/getLocaleDirection.js +29 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +7 -1
- package/dist/i18n/useDirection.d.ts +2 -0
- package/dist/i18n/useDirection.d.ts.map +1 -0
- package/dist/i18n/useDirection.js +27 -0
- package/package.json +1 -1
- package/src/Pagination/Pagination.tsx +11 -3
- package/src/i18n/InternationalizationContext.ts +4 -0
- package/src/i18n/InternationalizationProvider.tsx +12 -2
- package/src/i18n/__tests__/getLocaleDirection.test.ts +40 -0
- package/src/i18n/__tests__/useDirection.test.tsx +66 -0
- package/src/i18n/getLocaleDirection.ts +29 -0
- package/src/i18n/index.ts +6 -0
- package/src/i18n/useDirection.ts +29 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/Pagination/Pagination.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/Pagination/Pagination.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,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AC,EAAE,cAAc,CAAC;IAGtB,wDAAwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAC;IAGrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAiGD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,CA6CpB;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EAAE,cAAc,EAC1B,OAAO,EACP,QAAQ,EAAE,YAAiB,EAC3B,eAAe,EACf,gBAAgB,EAChB,OAAiB,EACjB,YAAgB,EAChB,IAAW,EACX,UAAkB,EAClB,KAAK,EAAE,cAAc,EACrB,aAAa,EAAE,MAAM,EACrB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,sCAiVjB;yBAtWe,UAAU"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Pagination.tsx
|
|
7
|
-
* @input Uses React, StyleX, Button, Icon, Selector, Text; page number buttons delegate to Button
|
|
7
|
+
* @input Uses React, StyleX, Button, Icon, Selector, Text; page number buttons delegate to Button.
|
|
8
|
+
* Reads i18n direction via useDirection() to flip the prev/next chevrons under RTL.
|
|
8
9
|
* @output Exports Pagination component, PaginationProps, PaginationVariant, PaginationSize types
|
|
9
10
|
* @position Core implementation; consumed by index.ts, tested by Pagination.test.tsx
|
|
10
11
|
*
|
|
@@ -31,6 +32,7 @@ import { useListFocus } from "../hooks/useListFocus.js";
|
|
|
31
32
|
import { mergeProps } from "../utils/index.js";
|
|
32
33
|
import { themeProps } from "../utils/themeProps.js";
|
|
33
34
|
import { useTranslator } from "../i18n/useTranslator.js";
|
|
35
|
+
import { useDirection } from "../i18n/useDirection.js";
|
|
34
36
|
|
|
35
37
|
// =============================================================================
|
|
36
38
|
// Types
|
|
@@ -184,6 +186,12 @@ export function Pagination({
|
|
|
184
186
|
const label = labelFromProps ?? t('@astryx.pagination.label');
|
|
185
187
|
const previousLabel = t('@astryx.pagination.previous');
|
|
186
188
|
const nextLabel = t('@astryx.pagination.next');
|
|
189
|
+
|
|
190
|
+
// Directional icons: under RTL, the "previous" control points right and the
|
|
191
|
+
// "next" control points left. aria-labels stay semantic (unchanged).
|
|
192
|
+
const direction = useDirection();
|
|
193
|
+
const previousIcon = direction === 'rtl' ? 'chevronRight' : 'chevronLeft';
|
|
194
|
+
const nextIcon = direction === 'rtl' ? 'chevronLeft' : 'chevronRight';
|
|
187
195
|
const pageIndicatorsLabel = t('@astryx.pagination.pageIndicators');
|
|
188
196
|
const itemsPerPageLabel = t('@astryx.pagination.itemsPerPage');
|
|
189
197
|
|
|
@@ -489,7 +497,7 @@ export function Pagination({
|
|
|
489
497
|
variant: "ghost",
|
|
490
498
|
size: buttonSize,
|
|
491
499
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
492
|
-
icon:
|
|
500
|
+
icon: previousIcon,
|
|
493
501
|
size: isSm ? 'sm' : 'md'
|
|
494
502
|
}),
|
|
495
503
|
onClick: handlePrevious,
|
|
@@ -500,7 +508,7 @@ export function Pagination({
|
|
|
500
508
|
variant: "ghost",
|
|
501
509
|
size: buttonSize,
|
|
502
510
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
503
|
-
icon:
|
|
511
|
+
icon: nextIcon,
|
|
504
512
|
size: isSm ? 'sm' : 'md'
|
|
505
513
|
}),
|
|
506
514
|
onClick: handleNext,
|