@cloudscape-design/components 3.0.1282 → 3.0.1284

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 (88) hide show
  1. package/button-dropdown/category-elements/styles.css.js +18 -18
  2. package/button-dropdown/category-elements/styles.scoped.css +30 -30
  3. package/button-dropdown/category-elements/styles.selectors.js +18 -18
  4. package/button-dropdown/interfaces.d.ts +0 -2
  5. package/button-dropdown/interfaces.d.ts.map +1 -1
  6. package/button-dropdown/interfaces.js.map +1 -1
  7. package/button-dropdown/item-element/styles.css.js +21 -21
  8. package/button-dropdown/item-element/styles.scoped.css +38 -38
  9. package/button-dropdown/item-element/styles.selectors.js +21 -21
  10. package/file-token-group/styles.css.js +23 -23
  11. package/file-token-group/styles.scoped.css +35 -35
  12. package/file-token-group/styles.selectors.js +23 -23
  13. package/flashbar/styles.css.js +50 -50
  14. package/flashbar/styles.scoped.css +165 -165
  15. package/flashbar/styles.selectors.js +50 -50
  16. package/input/internal.d.ts +2 -0
  17. package/input/internal.d.ts.map +1 -1
  18. package/input/internal.js +5 -2
  19. package/input/internal.js.map +1 -1
  20. package/input/styles.css.js +18 -13
  21. package/input/styles.scoped.css +67 -31
  22. package/input/styles.selectors.js +18 -13
  23. package/internal/base-component/styles.scoped.css +8 -1
  24. package/internal/components/button-trigger/styles.css.js +14 -14
  25. package/internal/components/button-trigger/styles.scoped.css +29 -29
  26. package/internal/components/button-trigger/styles.selectors.js +14 -14
  27. package/internal/components/dropdown-status/styles.css.js +2 -2
  28. package/internal/components/dropdown-status/styles.scoped.css +4 -4
  29. package/internal/components/dropdown-status/styles.selectors.js +2 -2
  30. package/internal/components/selectable-item/styles.css.js +22 -22
  31. package/internal/components/selectable-item/styles.scoped.css +51 -51
  32. package/internal/components/selectable-item/styles.selectors.js +22 -22
  33. package/internal/environment.js +2 -2
  34. package/internal/environment.json +2 -2
  35. package/internal/generated/styles/tokens.d.ts +4 -0
  36. package/internal/generated/styles/tokens.js +4 -0
  37. package/internal/generated/theming/index.cjs +52 -0
  38. package/internal/generated/theming/index.cjs.d.ts +27 -0
  39. package/internal/generated/theming/index.d.ts +27 -0
  40. package/internal/generated/theming/index.js +52 -0
  41. package/internal/manifest.json +1 -1
  42. package/package.json +1 -1
  43. package/pagination/index.d.ts +3 -1
  44. package/pagination/index.d.ts.map +1 -1
  45. package/pagination/index.js +4 -3
  46. package/pagination/index.js.map +1 -1
  47. package/pagination/interfaces.d.ts +31 -2
  48. package/pagination/interfaces.d.ts.map +1 -1
  49. package/pagination/interfaces.js.map +1 -1
  50. package/pagination/internal.d.ts +3 -14
  51. package/pagination/internal.d.ts.map +1 -1
  52. package/pagination/internal.js +78 -19
  53. package/pagination/internal.js.map +1 -1
  54. package/pagination/styles.css.js +11 -9
  55. package/pagination/styles.scoped.css +39 -24
  56. package/pagination/styles.selectors.js +11 -9
  57. package/popover/internal.d.ts +4 -0
  58. package/popover/internal.d.ts.map +1 -1
  59. package/popover/internal.js +23 -13
  60. package/popover/internal.js.map +1 -1
  61. package/prompt-input/internal.js +1 -1
  62. package/prompt-input/internal.js.map +1 -1
  63. package/prompt-input/styles.css.js +26 -26
  64. package/prompt-input/styles.scoped.css +55 -55
  65. package/prompt-input/styles.selectors.js +26 -26
  66. package/property-filter/filtering-token/styles.css.js +18 -18
  67. package/property-filter/filtering-token/styles.scoped.css +42 -42
  68. package/property-filter/filtering-token/styles.selectors.js +18 -18
  69. package/property-filter/styles.css.js +39 -39
  70. package/property-filter/styles.scoped.css +43 -43
  71. package/property-filter/styles.selectors.js +39 -39
  72. package/segmented-control/styles.css.js +16 -16
  73. package/segmented-control/styles.scoped.css +33 -33
  74. package/segmented-control/styles.selectors.js +16 -16
  75. package/select/parts/filter.d.ts +1 -1
  76. package/select/parts/filter.d.ts.map +1 -1
  77. package/test-utils/dom/pagination/index.d.ts +15 -0
  78. package/test-utils/dom/pagination/index.js +22 -0
  79. package/test-utils/dom/pagination/index.js.map +1 -1
  80. package/test-utils/selectors/pagination/index.d.ts +15 -0
  81. package/test-utils/selectors/pagination/index.js +22 -0
  82. package/test-utils/selectors/pagination/index.js.map +1 -1
  83. package/textarea/styles.css.js +5 -5
  84. package/textarea/styles.scoped.css +14 -14
  85. package/textarea/styles.selectors.js +5 -5
  86. package/token/styles.css.js +14 -14
  87. package/token/styles.scoped.css +30 -30
  88. package/token/styles.selectors.js +14 -14
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "a988c83dad92b2ff8352ce4256df1fe423414e84"
2
+ "commit": "84c3be4690035de46011b39032ecbe58e5a9d945"
3
3
  }
package/package.json CHANGED
@@ -164,7 +164,7 @@
164
164
  "./internal/base-component/index.js",
165
165
  "./internal/base-component/styles.css.js"
166
166
  ],
167
- "version": "3.0.1282",
167
+ "version": "3.0.1284",
168
168
  "repository": {
169
169
  "type": "git",
170
170
  "url": "https://github.com/cloudscape-design/components.git"
@@ -1,3 +1,5 @@
1
+ import React from 'react';
1
2
  import { PaginationProps } from './interfaces';
2
3
  export { PaginationProps };
3
- export default function Pagination(props: PaginationProps): JSX.Element;
4
+ declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<PaginationProps.Ref>>;
5
+ export default Pagination;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pagination/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAK,EAAE,eAAe,eAmBxD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pagination/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FAoBd,CAAC;AAIH,eAAe,UAAU,CAAC"}
@@ -6,9 +6,9 @@ import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-tool
6
6
  import useBaseComponent from '../internal/hooks/use-base-component';
7
7
  import { applyDisplayName } from '../internal/utils/apply-display-name';
8
8
  import InternalPagination from './internal';
9
- export default function Pagination(props) {
9
+ const Pagination = React.forwardRef((props, ref) => {
10
10
  const baseComponentProps = useBaseComponent('Pagination', { props: { openEnd: props.openEnd } });
11
- return (React.createElement(InternalPagination, { ...props, ...baseComponentProps, ...getAnalyticsMetadataAttribute({
11
+ return (React.createElement(InternalPagination, { ...props, ...baseComponentProps, ref: ref, ...getAnalyticsMetadataAttribute({
12
12
  component: {
13
13
  name: 'awsui.Pagination',
14
14
  label: { root: 'self' },
@@ -19,6 +19,7 @@ export default function Pagination(props) {
19
19
  },
20
20
  },
21
21
  }) }));
22
- }
22
+ });
23
23
  applyDisplayName(Pagination, 'Pagination');
24
+ export default Pagination;
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pagination/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAI5C,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,KAAsB;IACvD,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACjG,OAAO,CACL,oBAAC,kBAAkB,OACb,KAAK,KACL,kBAAkB,KAClB,6BAA6B,CAAC;YAChC,SAAS,EAAE;gBACT,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACvB,UAAU,EAAE;oBACV,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE;oBAC7B,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE;oBACvC,gBAAgB,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE;iBAC9C;aAC+C;SACnD,CAAC,GACF,CACH,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataPaginationComponent } from './analytics-metadata/interfaces';\nimport { PaginationProps } from './interfaces';\nimport InternalPagination from './internal';\n\nexport { PaginationProps };\n\nexport default function Pagination(props: PaginationProps) {\n const baseComponentProps = useBaseComponent('Pagination', { props: { openEnd: props.openEnd } });\n return (\n <InternalPagination\n {...props}\n {...baseComponentProps}\n {...getAnalyticsMetadataAttribute({\n component: {\n name: 'awsui.Pagination',\n label: { root: 'self' },\n properties: {\n openEnd: `${!!props.openEnd}`,\n pagesCount: `${props.pagesCount || ''}`,\n currentPageIndex: `${props.currentPageIndex}`,\n },\n } as GeneratedAnalyticsMetadataPaginationComponent,\n })}\n />\n );\n}\n\napplyDisplayName(Pagination, 'Pagination');\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/pagination/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,kBAAkB,MAAM,YAAY,CAAC;AAI5C,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAuC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACvF,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IACjG,OAAO,CACL,oBAAC,kBAAkB,OACb,KAAK,KACL,kBAAkB,EACtB,GAAG,EAAE,GAAG,KACJ,6BAA6B,CAAC;YAChC,SAAS,EAAE;gBACT,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;gBACvB,UAAU,EAAE;oBACV,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE;oBAC7B,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE;oBACvC,gBAAgB,EAAE,GAAG,KAAK,CAAC,gBAAgB,EAAE;iBAC9C;aAC+C;SACnD,CAAC,GACF,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAE3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataPaginationComponent } from './analytics-metadata/interfaces';\nimport { PaginationProps } from './interfaces';\nimport InternalPagination from './internal';\n\nexport { PaginationProps };\n\nconst Pagination = React.forwardRef<PaginationProps.Ref, PaginationProps>((props, ref) => {\n const baseComponentProps = useBaseComponent('Pagination', { props: { openEnd: props.openEnd } });\n return (\n <InternalPagination\n {...props}\n {...baseComponentProps}\n ref={ref}\n {...getAnalyticsMetadataAttribute({\n component: {\n name: 'awsui.Pagination',\n label: { root: 'self' },\n properties: {\n openEnd: `${!!props.openEnd}`,\n pagesCount: `${props.pagesCount || ''}`,\n currentPageIndex: `${props.currentPageIndex}`,\n },\n } as GeneratedAnalyticsMetadataPaginationComponent,\n })}\n />\n );\n});\n\napplyDisplayName(Pagination, 'Pagination');\n\nexport default Pagination;\n"]}
@@ -41,6 +41,10 @@ export interface PaginationProps {
41
41
  * @i18n
42
42
  */
43
43
  ariaLabels?: PaginationProps.Labels;
44
+ /**
45
+ * @i18n
46
+ */
47
+ i18nStrings?: PaginationProps.I18nStrings;
44
48
  /**
45
49
  * Called when a user interaction causes a pagination change. The event `detail` contains the new `currentPageIndex`.
46
50
  */
@@ -58,6 +62,10 @@ export interface PaginationProps {
58
62
  * * `requestedPageIndex` (integer) - The index of the requested page.
59
63
  */
60
64
  onNextPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;
65
+ /**
66
+ * Jump to page configuration
67
+ */
68
+ jumpToPage?: PaginationProps.JumpToPageProps;
61
69
  }
62
70
  export declare namespace PaginationProps {
63
71
  interface Labels {
@@ -65,12 +73,33 @@ export declare namespace PaginationProps {
65
73
  paginationLabel?: string;
66
74
  previousPageLabel?: string;
67
75
  pageLabel?: (pageNumber: number) => string;
76
+ jumpToPageButton?: string;
77
+ }
78
+ interface I18nStrings {
79
+ /** @i18n */
80
+ jumpToPageInputLabel?: string;
81
+ /** @i18n */
82
+ jumpToPageError?: string;
83
+ /** @i18n */
84
+ jumpToPageLoadingText?: string;
85
+ }
86
+ interface ChangeDetail {
87
+ currentPageIndex: number;
68
88
  }
69
89
  interface PageClickDetail {
70
90
  requestedPageAvailable: boolean;
71
91
  requestedPageIndex: number;
72
92
  }
73
- interface ChangeDetail {
74
- currentPageIndex: number;
93
+ interface JumpToPageProps {
94
+ /**
95
+ * User controlled loading state when jump to page callback is executing
96
+ */
97
+ loading?: boolean;
98
+ }
99
+ interface Ref {
100
+ /**
101
+ * Set error state for jump to page. Component will auto-clear when user types or navigates.
102
+ */
103
+ setError: (hasError: boolean) => void;
75
104
  }
76
105
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/pagination/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;;;;;;;;;;;;OAkBG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAEnE;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;IAEjF;;;;;OAKG;IACH,eAAe,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC;CAC9E;AAED,yBAAiB,eAAe,CAAC;IAC/B,UAAiB,MAAM;QACrB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;KAC5C;IAED,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;KAC3B;IAED,UAAiB,WAAW;QAC1B,YAAY;QACZ,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,YAAY;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,YAAY;QACZ,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC;IAED,UAAiB,YAAY;QAC3B,gBAAgB,EAAE,MAAM,CAAC;KAC1B;IAED,UAAiB,eAAe;QAC9B,sBAAsB,EAAE,OAAO,CAAC;QAChC,kBAAkB,EAAE,MAAM,CAAC;KAC5B;IAED,UAAiB,eAAe;QAC9B;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,QAAQ,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;KACvC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/pagination/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface PaginationProps {\n /**\n * Index of the current page. The first page has an index of 1.\n */\n currentPageIndex: number;\n\n /**\n * Sets the total number of pages. Only positive integers are allowed.\n */\n pagesCount: number;\n\n /**\n * Sets the pagination variant. It can be either default (when setting it to `false`) or open ended (when setting it\n * to `true`). Default pagination navigates you through the items list. The open-end variant enables you\n * to lazy-load your items because it always displays three dots before the next page icon. The next page button is\n * never disabled. When the user clicks on it but there are no more items to show, the\n * `onNextPageClick` handler is called with `requestedPageAvailable: false` in the event detail.\n */\n openEnd?: boolean;\n\n /**\n * If set to `true`, the pagination links will be disabled. Use it, for example, if you want to prevent the user\n * from changing page before items are loaded.\n */\n disabled?: boolean;\n\n /**\n * Adds aria-labels to the pagination buttons:\n * * `paginationLabel` (string) - Label for the entire pagination group. It allows users to distinguish context\n * * in cases of multiple pagination components in a page.\n * * `previousPageLabel` (string) - Previous page button.\n * * `pageLabel` (number => string) - Individual page button, this function is called for every page number that's rendered.\n * * `nextPageLabel` (string) - Next page button\n *\n * Example:\n * ```\n * {\n * nextPageLabel: 'Next page',\n * paginationLabel: 'Table pagination',\n * previousPageLabel: 'Previous page',\n * pageLabel: pageNumber => `Page ${pageNumber}`\n * }\n * ```\n * @i18n\n */\n ariaLabels?: PaginationProps.Labels;\n\n /**\n * Called when a user interaction causes a pagination change. The event `detail` contains the new `currentPageIndex`.\n */\n onChange?: NonCancelableEventHandler<PaginationProps.ChangeDetail>;\n\n /**\n * Called when the previous page arrow is clicked. The event `detail` contains the following:\n * * `requestedPageAvailable` (boolean) - Always set to `true`.\n * * `requestedPageIndex` (integer) - The index of the requested page.\n */\n onPreviousPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;\n\n /**\n * Called when the next page arrow is clicked. The event `detail` contains the following:\n * * `requestedPageAvailable` (boolean) - Indicates whether the requested page is available for display.\n * The value can be `false` when the `openEnd` property is set to `true`.\n * * `requestedPageIndex` (integer) - The index of the requested page.\n */\n onNextPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;\n}\n\nexport namespace PaginationProps {\n export interface Labels {\n nextPageLabel?: string;\n paginationLabel?: string;\n previousPageLabel?: string;\n pageLabel?: (pageNumber: number) => string;\n }\n\n export interface PageClickDetail {\n requestedPageAvailable: boolean;\n requestedPageIndex: number;\n }\n\n export interface ChangeDetail {\n currentPageIndex: number;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/pagination/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface PaginationProps {\n /**\n * Index of the current page. The first page has an index of 1.\n */\n currentPageIndex: number;\n\n /**\n * Sets the total number of pages. Only positive integers are allowed.\n */\n pagesCount: number;\n\n /**\n * Sets the pagination variant. It can be either default (when setting it to `false`) or open ended (when setting it\n * to `true`). Default pagination navigates you through the items list. The open-end variant enables you\n * to lazy-load your items because it always displays three dots before the next page icon. The next page button is\n * never disabled. When the user clicks on it but there are no more items to show, the\n * `onNextPageClick` handler is called with `requestedPageAvailable: false` in the event detail.\n */\n openEnd?: boolean;\n\n /**\n * If set to `true`, the pagination links will be disabled. Use it, for example, if you want to prevent the user\n * from changing page before items are loaded.\n */\n disabled?: boolean;\n\n /**\n * Adds aria-labels to the pagination buttons:\n * * `paginationLabel` (string) - Label for the entire pagination group. It allows users to distinguish context\n * * in cases of multiple pagination components in a page.\n * * `previousPageLabel` (string) - Previous page button.\n * * `pageLabel` (number => string) - Individual page button, this function is called for every page number that's rendered.\n * * `nextPageLabel` (string) - Next page button\n *\n * Example:\n * ```\n * {\n * nextPageLabel: 'Next page',\n * paginationLabel: 'Table pagination',\n * previousPageLabel: 'Previous page',\n * pageLabel: pageNumber => `Page ${pageNumber}`\n * }\n * ```\n * @i18n\n */\n ariaLabels?: PaginationProps.Labels;\n /**\n * @i18n\n */\n i18nStrings?: PaginationProps.I18nStrings;\n\n /**\n * Called when a user interaction causes a pagination change. The event `detail` contains the new `currentPageIndex`.\n */\n onChange?: NonCancelableEventHandler<PaginationProps.ChangeDetail>;\n\n /**\n * Called when the previous page arrow is clicked. The event `detail` contains the following:\n * * `requestedPageAvailable` (boolean) - Always set to `true`.\n * * `requestedPageIndex` (integer) - The index of the requested page.\n */\n onPreviousPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;\n\n /**\n * Called when the next page arrow is clicked. The event `detail` contains the following:\n * * `requestedPageAvailable` (boolean) - Indicates whether the requested page is available for display.\n * The value can be `false` when the `openEnd` property is set to `true`.\n * * `requestedPageIndex` (integer) - The index of the requested page.\n */\n onNextPageClick?: NonCancelableEventHandler<PaginationProps.PageClickDetail>;\n /**\n * Jump to page configuration\n */\n jumpToPage?: PaginationProps.JumpToPageProps;\n}\n\nexport namespace PaginationProps {\n export interface Labels {\n nextPageLabel?: string;\n paginationLabel?: string;\n previousPageLabel?: string;\n pageLabel?: (pageNumber: number) => string;\n jumpToPageButton?: string;\n }\n\n export interface I18nStrings {\n /** @i18n */\n jumpToPageInputLabel?: string;\n /** @i18n */\n jumpToPageError?: string;\n /** @i18n */\n jumpToPageLoadingText?: string;\n }\n\n export interface ChangeDetail {\n currentPageIndex: number;\n }\n\n export interface PageClickDetail {\n requestedPageAvailable: boolean;\n requestedPageIndex: number;\n }\n\n export interface JumpToPageProps {\n /**\n * User controlled loading state when jump to page callback is executing\n */\n loading?: boolean;\n }\n\n export interface Ref {\n /**\n * Set error state for jump to page. Component will auto-clear when user types or navigates.\n */\n setError: (hasError: boolean) => void;\n }\n}\n"]}
@@ -1,16 +1,5 @@
1
+ import React from 'react';
1
2
  import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
2
3
  import { PaginationProps } from './interfaces';
3
- type InternalPaginationProps = PaginationProps & InternalBaseComponentProps;
4
- export default function InternalPagination({
5
- openEnd,
6
- currentPageIndex,
7
- ariaLabels,
8
- pagesCount,
9
- disabled,
10
- onChange,
11
- onNextPageClick,
12
- onPreviousPageClick,
13
- __internalRootRef,
14
- ...rest
15
- }: InternalPaginationProps): JSX.Element;
16
- export {};
4
+ declare const InternalPagination: React.ForwardRefExoticComponent<PaginationProps & InternalBaseComponentProps & React.RefAttributes<PaginationProps.Ref>>;
5
+ export default InternalPagination;
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/pagination/internal.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAoF/C,KAAK,uBAAuB,GAAG,eAAe,GAAG,0BAA0B,CAAC;AAC5E,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,GAAG,IAAI,EACR,EAAE,uBAAuB,eA+GzB"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/pagination/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAgBhD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAKlF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA+E/C,QAAA,MAAM,kBAAkB,0HAwOvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,21 +1,20 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- import React from 'react';
3
+ import React, { useRef, useState } from 'react';
4
4
  import clsx from 'clsx';
5
5
  import { copyAnalyticsMetadataAttribute, getAnalyticsMetadataAttribute, } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';
6
+ import InternalButton from '../button/internal';
6
7
  import { useInternalI18n } from '../i18n/context';
7
8
  import InternalIcon from '../icon/internal';
9
+ import InternalInput from '../input/internal';
8
10
  import { getBaseProps } from '../internal/base-component';
9
11
  import { useTableComponentsContext } from '../internal/context/table-component-context';
10
12
  import { fireNonCancelableEvent } from '../internal/events';
13
+ import { usePrevious } from '../internal/hooks/use-previous';
14
+ import InternalPopover from '../popover/internal';
15
+ import InternalSpaceBetween from '../space-between/internal';
11
16
  import { getPaginationState, range } from './utils';
12
17
  import styles from './styles.css.js';
13
- const defaultAriaLabels = {
14
- nextPageLabel: '',
15
- paginationLabel: '',
16
- previousPageLabel: '',
17
- pageLabel: pageNumber => `${pageNumber}`,
18
- };
19
18
  function PageButton({ className, ariaLabel, disabled, pageIndex, isCurrent = false, children, onClick, ...rest }) {
20
19
  function handleClick(event) {
21
20
  event.preventDefault();
@@ -40,15 +39,33 @@ function PageNumber({ pageIndex, ...rest }) {
40
39
  },
41
40
  })) }, pageIndex));
42
41
  }
43
- export default function InternalPagination({ openEnd, currentPageIndex, ariaLabels, pagesCount, disabled, onChange, onNextPageClick, onPreviousPageClick, __internalRootRef, ...rest }) {
44
- var _a, _b, _c, _d;
42
+ const InternalPagination = React.forwardRef(({ openEnd, currentPageIndex, ariaLabels, i18nStrings, pagesCount, disabled, onChange, onNextPageClick, onPreviousPageClick, __internalRootRef, jumpToPage, ...rest }, ref) => {
43
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
45
44
  const baseProps = getBaseProps(rest);
46
45
  const { leftDots, leftIndex, rightIndex, rightDots } = getPaginationState(currentPageIndex, pagesCount, openEnd);
46
+ const [jumpToPageValue, setJumpToPageValue] = useState(currentPageIndex === null || currentPageIndex === void 0 ? void 0 : currentPageIndex.toString());
47
+ const previousLoading = usePrevious(jumpToPage === null || jumpToPage === void 0 ? void 0 : jumpToPage.loading);
48
+ const jumpToPageInputRef = useRef(null);
49
+ const [hasError, setHasError] = useState(false);
47
50
  const i18n = useInternalI18n('pagination');
48
- const paginationLabel = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.paginationLabel;
49
- const nextPageLabel = (_a = i18n('ariaLabels.nextPageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.nextPageLabel)) !== null && _a !== void 0 ? _a : defaultAriaLabels.nextPageLabel;
50
- const previousPageLabel = (_b = i18n('ariaLabels.previousPageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.previousPageLabel)) !== null && _b !== void 0 ? _b : defaultAriaLabels.previousPageLabel;
51
- const pageNumberLabelFn = (_c = i18n('ariaLabels.pageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.pageLabel, format => pageNumber => format({ pageNumber }))) !== null && _c !== void 0 ? _c : defaultAriaLabels.pageLabel;
51
+ // Expose setError function via ref
52
+ React.useImperativeHandle(ref, () => ({
53
+ setError: (error) => setHasError(error),
54
+ }));
55
+ // Sync input with currentPageIndex after loading completes
56
+ React.useEffect(() => {
57
+ if (previousLoading && !(jumpToPage === null || jumpToPage === void 0 ? void 0 : jumpToPage.loading)) {
58
+ setJumpToPageValue(String(currentPageIndex));
59
+ }
60
+ }, [previousLoading, jumpToPage === null || jumpToPage === void 0 ? void 0 : jumpToPage.loading, currentPageIndex]);
61
+ const paginationLabel = (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.paginationLabel) !== null && _a !== void 0 ? _a : '';
62
+ const nextPageLabel = (_b = i18n('ariaLabels.nextPageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.nextPageLabel)) !== null && _b !== void 0 ? _b : '';
63
+ const previousPageLabel = (_c = i18n('ariaLabels.previousPageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.previousPageLabel)) !== null && _c !== void 0 ? _c : '';
64
+ const pageNumberLabelFn = (_d = i18n('ariaLabels.pageLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.pageLabel, format => pageNumber => format({ pageNumber }))) !== null && _d !== void 0 ? _d : ((pageNumber) => `${pageNumber}`);
65
+ const jumpToPageLabel = (_e = i18n('i18nStrings.jumpToPageInputLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.jumpToPageInputLabel)) !== null && _e !== void 0 ? _e : '';
66
+ const jumpToPageButtonLabel = (_f = i18n('ariaLabels.jumpToPageButtonLabel', ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.jumpToPageButton)) !== null && _f !== void 0 ? _f : '';
67
+ const jumpToPageError = (_g = i18n('i18nStrings.jumpToPageError', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.jumpToPageError)) !== null && _g !== void 0 ? _g : '';
68
+ const jumpToPageLoadingText = (_h = i18n('i18nStrings.jumpToPageLoadingText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.jumpToPageLoadingText)) !== null && _h !== void 0 ? _h : '';
52
69
  function handlePrevPageClick(requestedPageIndex) {
53
70
  handlePageClick(requestedPageIndex);
54
71
  fireNonCancelableEvent(onPreviousPageClick, {
@@ -63,19 +80,48 @@ export default function InternalPagination({ openEnd, currentPageIndex, ariaLabe
63
80
  requestedPageIndex: requestedPageIndex,
64
81
  });
65
82
  }
66
- function handlePageClick(requestedPageIndex) {
83
+ function handlePageClick(requestedPageIndex, errorState) {
84
+ setJumpToPageValue(String(requestedPageIndex));
85
+ setHasError(!!errorState); // Clear error on successful navigation
67
86
  fireNonCancelableEvent(onChange, { currentPageIndex: requestedPageIndex });
68
87
  }
88
+ function handleJumpToPageClick(requestedPageIndex) {
89
+ var _a;
90
+ const adjustedIndex = Math.max(1, Math.floor(requestedPageIndex));
91
+ if (openEnd) {
92
+ // Open-end: always navigate, parent will handle async loading
93
+ handlePageClick(adjustedIndex);
94
+ }
95
+ else {
96
+ // Closed-end: validate range
97
+ if (adjustedIndex >= 1 && adjustedIndex <= pagesCount) {
98
+ handlePageClick(adjustedIndex);
99
+ }
100
+ else {
101
+ // Out of range - set error and navigate to last page
102
+ handlePageClick(pagesCount, true);
103
+ }
104
+ }
105
+ (_a = jumpToPageInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
106
+ }
107
+ // Auto-clear error when user types in the input
108
+ const handleInputChange = (e) => {
109
+ setJumpToPageValue(e.detail.value);
110
+ if (hasError) {
111
+ setHasError(false);
112
+ }
113
+ };
69
114
  const previousButtonDisabled = disabled || currentPageIndex === 1;
70
115
  const nextButtonDisabled = disabled || (!openEnd && (pagesCount === 0 || currentPageIndex === pagesCount));
71
116
  const tableComponentContext = useTableComponentsContext();
72
- if ((_d = tableComponentContext === null || tableComponentContext === void 0 ? void 0 : tableComponentContext.paginationRef) === null || _d === void 0 ? void 0 : _d.current) {
117
+ if ((_j = tableComponentContext === null || tableComponentContext === void 0 ? void 0 : tableComponentContext.paginationRef) === null || _j === void 0 ? void 0 : _j.current) {
73
118
  tableComponentContext.paginationRef.current.currentPageIndex = currentPageIndex;
74
119
  tableComponentContext.paginationRef.current.totalPageCount = pagesCount;
75
120
  tableComponentContext.paginationRef.current.openEnd = openEnd;
76
121
  }
122
+ const jumpToPageButton = (React.createElement(InternalButton, { iconName: "arrow-right", variant: "icon", loading: jumpToPage === null || jumpToPage === void 0 ? void 0 : jumpToPage.loading, loadingText: jumpToPageLoadingText, ariaLabel: (jumpToPage === null || jumpToPage === void 0 ? void 0 : jumpToPage.loading) ? jumpToPageLoadingText : jumpToPageButtonLabel, onClick: () => handleJumpToPageClick(Number(jumpToPageValue)), disabled: !jumpToPageValue || Number(jumpToPageValue) === currentPageIndex }));
77
123
  return (React.createElement("ul", { "aria-label": paginationLabel, ...baseProps, className: clsx(baseProps.className, styles.root, disabled && styles['root-disabled']), ref: __internalRootRef },
78
- React.createElement(PageButton, { className: styles.arrow, pageIndex: currentPageIndex - 1, ariaLabel: previousPageLabel !== null && previousPageLabel !== void 0 ? previousPageLabel : defaultAriaLabels.nextPageLabel, disabled: previousButtonDisabled, onClick: handlePrevPageClick, ...(previousButtonDisabled
124
+ React.createElement(PageButton, { className: styles.arrow, pageIndex: currentPageIndex - 1, ariaLabel: previousPageLabel, disabled: previousButtonDisabled, onClick: handlePrevPageClick, ...(previousButtonDisabled
79
125
  ? {}
80
126
  : getAnalyticsMetadataAttribute({
81
127
  detail: {
@@ -88,13 +134,26 @@ export default function InternalPagination({ openEnd, currentPageIndex, ariaLabe
88
134
  range(leftIndex, rightIndex).map(pageIndex => (React.createElement(PageNumber, { key: pageIndex, isCurrent: currentPageIndex === pageIndex, pageIndex: pageIndex, disabled: disabled, ariaLabel: pageNumberLabelFn(pageIndex), onClick: handlePageClick }))),
89
135
  rightDots && React.createElement("li", { className: styles.dots }, "..."),
90
136
  !openEnd && pagesCount > 1 && (React.createElement(PageNumber, { isCurrent: currentPageIndex === pagesCount, pageIndex: pagesCount, disabled: disabled, ariaLabel: pageNumberLabelFn(pagesCount), onClick: handlePageClick })),
91
- React.createElement(PageButton, { className: styles.arrow, pageIndex: currentPageIndex + 1, ariaLabel: nextPageLabel !== null && nextPageLabel !== void 0 ? nextPageLabel : defaultAriaLabels.nextPageLabel, disabled: nextButtonDisabled, onClick: handleNextPageClick, ...(nextButtonDisabled
137
+ React.createElement(PageButton, { className: styles.arrow, pageIndex: currentPageIndex + 1, ariaLabel: nextPageLabel, disabled: nextButtonDisabled, onClick: handleNextPageClick, ...(nextButtonDisabled
92
138
  ? {}
93
139
  : getAnalyticsMetadataAttribute({
94
140
  detail: {
95
141
  position: 'next',
96
142
  },
97
143
  })) },
98
- React.createElement(InternalIcon, { name: "angle-right", variant: disabled ? 'disabled' : 'normal' }))));
99
- }
144
+ React.createElement(InternalIcon, { name: "angle-right", variant: disabled ? 'disabled' : 'normal' })),
145
+ jumpToPage && (React.createElement("li", { className: styles['jump-to-page'] },
146
+ React.createElement(InternalSpaceBetween, { size: "xxs", direction: "horizontal", alignItems: "end" },
147
+ React.createElement("div", { className: styles['jump-to-page-input'] },
148
+ React.createElement(InternalInput, { ref: jumpToPageInputRef, type: "number", value: jumpToPageValue, __inlineLabelText: jumpToPageLabel || undefined, __fullWidth: true, ariaLabel: jumpToPageLabel || undefined, nativeInputAttributes: {
149
+ min: 1,
150
+ max: !openEnd ? pagesCount : undefined,
151
+ }, onChange: handleInputChange, onBlur: () => setHasError(false), onKeyDown: e => {
152
+ if (e.detail.keyCode === 13 && jumpToPageValue && Number(jumpToPageValue) !== currentPageIndex) {
153
+ handleJumpToPageClick(Number(jumpToPageValue));
154
+ }
155
+ } })),
156
+ hasError && !(jumpToPage === null || jumpToPage === void 0 ? void 0 : jumpToPage.loading) ? (React.createElement(InternalPopover, { size: "medium", dismissButton: false, __visible: true, content: jumpToPageError, position: "bottom", triggerType: "custom", __onVisibleChange: ({ detail }) => !detail.visible && setHasError(false) }, jumpToPageButton)) : (jumpToPageButton))))));
157
+ });
158
+ export default InternalPagination;
100
159
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":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CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport {\n copyAnalyticsMetadataAttribute,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useTableComponentsContext } from '../internal/context/table-component-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataPaginationClick } from './analytics-metadata/interfaces';\nimport { PaginationProps } from './interfaces';\nimport { getPaginationState, range } from './utils';\n\nimport styles from './styles.css.js';\n\nconst defaultAriaLabels: Required<PaginationProps.Labels> = {\n nextPageLabel: '',\n paginationLabel: '',\n previousPageLabel: '',\n pageLabel: pageNumber => `${pageNumber}`,\n};\n\ninterface PageButtonProps {\n className?: string;\n ariaLabel: string;\n disabled?: boolean;\n pageIndex: number;\n isCurrent?: boolean;\n children?: React.ReactNode;\n onClick: (requestedIndex: number) => void;\n}\n\nfunction PageButton({\n className,\n ariaLabel,\n disabled,\n pageIndex,\n isCurrent = false,\n children,\n onClick,\n ...rest\n}: PageButtonProps) {\n function handleClick(event: React.MouseEvent) {\n event.preventDefault();\n onClick(pageIndex);\n }\n return (\n <li className={styles['page-item']} {...copyAnalyticsMetadataAttribute(rest)}>\n <button\n className={clsx(\n className,\n styles.button,\n disabled && styles['button-disabled'],\n isCurrent && styles['button-current']\n )}\n type=\"button\"\n aria-label={ariaLabel}\n disabled={disabled}\n onClick={handleClick}\n aria-current={isCurrent}\n {...(disabled\n ? {}\n : getAnalyticsMetadataAttribute({\n action: 'click',\n detail: {\n label: { root: 'self' },\n },\n } as GeneratedAnalyticsMetadataPaginationClick))}\n >\n {children}\n </button>\n </li>\n );\n}\n\nfunction PageNumber({ pageIndex, ...rest }: PageButtonProps) {\n return (\n <PageButton\n className={styles['page-number']}\n pageIndex={pageIndex}\n {...rest}\n {...(rest.disabled\n ? {}\n : getAnalyticsMetadataAttribute({\n detail: {\n position: `${pageIndex}`,\n },\n }))}\n >\n {pageIndex}\n </PageButton>\n );\n}\n\ntype InternalPaginationProps = PaginationProps & InternalBaseComponentProps;\nexport default function InternalPagination({\n openEnd,\n currentPageIndex,\n ariaLabels,\n pagesCount,\n disabled,\n onChange,\n onNextPageClick,\n onPreviousPageClick,\n __internalRootRef,\n ...rest\n}: InternalPaginationProps) {\n const baseProps = getBaseProps(rest);\n const { leftDots, leftIndex, rightIndex, rightDots } = getPaginationState(currentPageIndex, pagesCount, openEnd);\n\n const i18n = useInternalI18n('pagination');\n\n const paginationLabel = ariaLabels?.paginationLabel;\n const nextPageLabel = i18n('ariaLabels.nextPageLabel', ariaLabels?.nextPageLabel) ?? defaultAriaLabels.nextPageLabel;\n const previousPageLabel =\n i18n('ariaLabels.previousPageLabel', ariaLabels?.previousPageLabel) ?? defaultAriaLabels.previousPageLabel;\n const pageNumberLabelFn =\n i18n('ariaLabels.pageLabel', ariaLabels?.pageLabel, format => pageNumber => format({ pageNumber })) ??\n defaultAriaLabels.pageLabel;\n\n function handlePrevPageClick(requestedPageIndex: number) {\n handlePageClick(requestedPageIndex);\n fireNonCancelableEvent(onPreviousPageClick, {\n requestedPageAvailable: true,\n requestedPageIndex: requestedPageIndex,\n });\n }\n\n function handleNextPageClick(requestedPageIndex: number) {\n handlePageClick(requestedPageIndex);\n fireNonCancelableEvent(onNextPageClick, {\n requestedPageAvailable: currentPageIndex < pagesCount,\n requestedPageIndex: requestedPageIndex,\n });\n }\n\n function handlePageClick(requestedPageIndex: number) {\n fireNonCancelableEvent(onChange, { currentPageIndex: requestedPageIndex });\n }\n\n const previousButtonDisabled = disabled || currentPageIndex === 1;\n const nextButtonDisabled = disabled || (!openEnd && (pagesCount === 0 || currentPageIndex === pagesCount));\n const tableComponentContext = useTableComponentsContext();\n if (tableComponentContext?.paginationRef?.current) {\n tableComponentContext.paginationRef.current.currentPageIndex = currentPageIndex;\n tableComponentContext.paginationRef.current.totalPageCount = pagesCount;\n tableComponentContext.paginationRef.current.openEnd = openEnd;\n }\n return (\n <ul\n aria-label={paginationLabel}\n {...baseProps}\n className={clsx(baseProps.className, styles.root, disabled && styles['root-disabled'])}\n ref={__internalRootRef}\n >\n <PageButton\n className={styles.arrow}\n pageIndex={currentPageIndex - 1}\n ariaLabel={previousPageLabel ?? defaultAriaLabels.nextPageLabel}\n disabled={previousButtonDisabled}\n onClick={handlePrevPageClick}\n {...(previousButtonDisabled\n ? {}\n : getAnalyticsMetadataAttribute({\n detail: {\n position: 'prev',\n },\n }))}\n >\n <InternalIcon name=\"angle-left\" variant={disabled ? 'disabled' : 'normal'} />\n </PageButton>\n <PageNumber\n pageIndex={1}\n isCurrent={currentPageIndex === 1}\n disabled={disabled}\n ariaLabel={pageNumberLabelFn(1)}\n onClick={handlePageClick}\n />\n {leftDots && <li className={styles.dots}>...</li>}\n {range(leftIndex, rightIndex).map(pageIndex => (\n <PageNumber\n key={pageIndex}\n isCurrent={currentPageIndex === pageIndex}\n pageIndex={pageIndex}\n disabled={disabled}\n ariaLabel={pageNumberLabelFn(pageIndex)}\n onClick={handlePageClick}\n />\n ))}\n {rightDots && <li className={styles.dots}>...</li>}\n {!openEnd && pagesCount > 1 && (\n <PageNumber\n isCurrent={currentPageIndex === pagesCount}\n pageIndex={pagesCount}\n disabled={disabled}\n ariaLabel={pageNumberLabelFn(pagesCount)}\n onClick={handlePageClick}\n />\n )}\n <PageButton\n className={styles.arrow}\n pageIndex={currentPageIndex + 1}\n ariaLabel={nextPageLabel ?? defaultAriaLabels.nextPageLabel}\n disabled={nextButtonDisabled}\n onClick={handleNextPageClick}\n {...(nextButtonDisabled\n ? {}\n : getAnalyticsMetadataAttribute({\n detail: {\n position: 'next',\n },\n }))}\n >\n <InternalIcon name=\"angle-right\" variant={disabled ? 'disabled' : 'normal'} />\n </PageButton>\n </ul>\n );\n}\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/pagination/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,kEAAkE,CAAC;AAE1E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAE5C,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAA4B,MAAM,oBAAoB,CAAC;AAEtF,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAClD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAYrC,SAAS,UAAU,CAAC,EAClB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,SAAS,EACT,SAAS,GAAG,KAAK,EACjB,QAAQ,EACR,OAAO,EACP,GAAG,IAAI,EACS;IAChB,SAAS,WAAW,CAAC,KAAuB;QAC1C,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,OAAO,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,CACL,4BAAI,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,KAAM,8BAA8B,CAAC,IAAI,CAAC;QA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CAAC,CAAC,CAAC;4BACjD,CAAC;wBACH,CAAC,GACD,CACE;gBACL,QAAQ,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,CAAA,CAAC,CAAC,CAAC,CAClC,oBAAC,eAAe,IACd,IAAI,EAAC,QAAQ,EACb,aAAa,EAAE,KAAK,EACpB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAC,QAAQ,EACjB,WAAW,EAAC,QAAQ,EACpB,iBAAiB,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,IAEvE,gBAAgB,CACD,CACnB,CAAC,CAAC,CAAC,CACF,gBAAgB,CACjB,CACoB,CACpB,CACN,CACE,CACN,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport {\n copyAnalyticsMetadataAttribute,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalButton from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport InternalIcon from '../icon/internal';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport InternalInput from '../input/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useTableComponentsContext } from '../internal/context/table-component-context';\nimport { fireNonCancelableEvent, NonCancelableCustomEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport InternalPopover from '../popover/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { GeneratedAnalyticsMetadataPaginationClick } from './analytics-metadata/interfaces';\nimport { PaginationProps } from './interfaces';\nimport { getPaginationState, range } from './utils';\n\nimport styles from './styles.css.js';\n\ninterface PageButtonProps {\n className?: string;\n ariaLabel: string;\n disabled?: boolean;\n pageIndex: number;\n isCurrent?: boolean;\n children?: React.ReactNode;\n onClick: (requestedIndex: number) => void;\n}\n\nfunction PageButton({\n className,\n ariaLabel,\n disabled,\n pageIndex,\n isCurrent = false,\n children,\n onClick,\n ...rest\n}: PageButtonProps) {\n function handleClick(event: React.MouseEvent) {\n event.preventDefault();\n onClick(pageIndex);\n }\n return (\n <li className={styles['page-item']} {...copyAnalyticsMetadataAttribute(rest)}>\n <button\n className={clsx(\n className,\n styles.button,\n disabled && styles['button-disabled'],\n isCurrent && styles['button-current']\n )}\n type=\"button\"\n aria-label={ariaLabel}\n disabled={disabled}\n onClick={handleClick}\n aria-current={isCurrent}\n {...(disabled\n ? {}\n : getAnalyticsMetadataAttribute({\n action: 'click',\n detail: {\n label: { root: 'self' },\n },\n } as GeneratedAnalyticsMetadataPaginationClick))}\n >\n {children}\n </button>\n </li>\n );\n}\n\nfunction PageNumber({ pageIndex, ...rest }: PageButtonProps) {\n return (\n <PageButton\n className={styles['page-number']}\n pageIndex={pageIndex}\n {...rest}\n {...(rest.disabled\n ? {}\n : getAnalyticsMetadataAttribute({\n detail: {\n position: `${pageIndex}`,\n },\n }))}\n >\n {pageIndex}\n </PageButton>\n );\n}\n\ntype InternalPaginationProps = PaginationProps & InternalBaseComponentProps;\n\nconst InternalPagination = React.forwardRef(\n (\n {\n openEnd,\n currentPageIndex,\n ariaLabels,\n i18nStrings,\n pagesCount,\n disabled,\n onChange,\n onNextPageClick,\n onPreviousPageClick,\n __internalRootRef,\n jumpToPage,\n ...rest\n }: InternalPaginationProps,\n ref: React.Ref<PaginationProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n const { leftDots, leftIndex, rightIndex, rightDots } = getPaginationState(currentPageIndex, pagesCount, openEnd);\n const [jumpToPageValue, setJumpToPageValue] = useState(currentPageIndex?.toString());\n const previousLoading = usePrevious(jumpToPage?.loading);\n const jumpToPageInputRef = useRef<HTMLInputElement>(null);\n const [hasError, setHasError] = useState(false);\n\n const i18n = useInternalI18n('pagination');\n\n // Expose setError function via ref\n React.useImperativeHandle(ref, () => ({\n setError: (error: boolean) => setHasError(error),\n }));\n\n // Sync input with currentPageIndex after loading completes\n React.useEffect(() => {\n if (previousLoading && !jumpToPage?.loading) {\n setJumpToPageValue(String(currentPageIndex));\n }\n }, [previousLoading, jumpToPage?.loading, currentPageIndex]);\n\n const paginationLabel = ariaLabels?.paginationLabel ?? '';\n const nextPageLabel = i18n('ariaLabels.nextPageLabel', ariaLabels?.nextPageLabel) ?? '';\n const previousPageLabel = i18n('ariaLabels.previousPageLabel', ariaLabels?.previousPageLabel) ?? '';\n const pageNumberLabelFn =\n i18n('ariaLabels.pageLabel', ariaLabels?.pageLabel, format => pageNumber => format({ pageNumber })) ??\n ((pageNumber: number) => `${pageNumber}`);\n\n const jumpToPageLabel = i18n('i18nStrings.jumpToPageInputLabel', i18nStrings?.jumpToPageInputLabel) ?? '';\n const jumpToPageButtonLabel = i18n('ariaLabels.jumpToPageButtonLabel', ariaLabels?.jumpToPageButton) ?? '';\n const jumpToPageError = i18n('i18nStrings.jumpToPageError', i18nStrings?.jumpToPageError) ?? '';\n const jumpToPageLoadingText = i18n('i18nStrings.jumpToPageLoadingText', i18nStrings?.jumpToPageLoadingText) ?? '';\n\n function handlePrevPageClick(requestedPageIndex: number) {\n handlePageClick(requestedPageIndex);\n fireNonCancelableEvent(onPreviousPageClick, {\n requestedPageAvailable: true,\n requestedPageIndex: requestedPageIndex,\n });\n }\n\n function handleNextPageClick(requestedPageIndex: number) {\n handlePageClick(requestedPageIndex);\n fireNonCancelableEvent(onNextPageClick, {\n requestedPageAvailable: currentPageIndex < pagesCount,\n requestedPageIndex: requestedPageIndex,\n });\n }\n\n function handlePageClick(requestedPageIndex: number, errorState?: boolean) {\n setJumpToPageValue(String(requestedPageIndex));\n setHasError(!!errorState); // Clear error on successful navigation\n fireNonCancelableEvent(onChange, { currentPageIndex: requestedPageIndex });\n }\n\n function handleJumpToPageClick(requestedPageIndex: number) {\n const adjustedIndex = Math.max(1, Math.floor(requestedPageIndex));\n\n if (openEnd) {\n // Open-end: always navigate, parent will handle async loading\n handlePageClick(adjustedIndex);\n } else {\n // Closed-end: validate range\n if (adjustedIndex >= 1 && adjustedIndex <= pagesCount) {\n handlePageClick(adjustedIndex);\n } else {\n // Out of range - set error and navigate to last page\n handlePageClick(pagesCount, true);\n }\n }\n jumpToPageInputRef.current?.focus();\n }\n\n // Auto-clear error when user types in the input\n const handleInputChange = (e: NonCancelableCustomEvent<BaseChangeDetail>) => {\n setJumpToPageValue(e.detail.value);\n if (hasError) {\n setHasError(false);\n }\n };\n\n const previousButtonDisabled = disabled || currentPageIndex === 1;\n const nextButtonDisabled = disabled || (!openEnd && (pagesCount === 0 || currentPageIndex === pagesCount));\n const tableComponentContext = useTableComponentsContext();\n if (tableComponentContext?.paginationRef?.current) {\n tableComponentContext.paginationRef.current.currentPageIndex = currentPageIndex;\n tableComponentContext.paginationRef.current.totalPageCount = pagesCount;\n tableComponentContext.paginationRef.current.openEnd = openEnd;\n }\n\n const jumpToPageButton = (\n <InternalButton\n iconName=\"arrow-right\"\n variant=\"icon\"\n loading={jumpToPage?.loading}\n loadingText={jumpToPageLoadingText}\n ariaLabel={jumpToPage?.loading ? jumpToPageLoadingText : jumpToPageButtonLabel}\n onClick={() => handleJumpToPageClick(Number(jumpToPageValue))}\n disabled={!jumpToPageValue || Number(jumpToPageValue) === currentPageIndex}\n />\n );\n\n return (\n <ul\n aria-label={paginationLabel}\n {...baseProps}\n className={clsx(baseProps.className, styles.root, disabled && styles['root-disabled'])}\n ref={__internalRootRef}\n >\n <PageButton\n className={styles.arrow}\n pageIndex={currentPageIndex - 1}\n ariaLabel={previousPageLabel}\n disabled={previousButtonDisabled}\n onClick={handlePrevPageClick}\n {...(previousButtonDisabled\n ? {}\n : getAnalyticsMetadataAttribute({\n detail: {\n position: 'prev',\n },\n }))}\n >\n <InternalIcon name=\"angle-left\" variant={disabled ? 'disabled' : 'normal'} />\n </PageButton>\n <PageNumber\n pageIndex={1}\n isCurrent={currentPageIndex === 1}\n disabled={disabled}\n ariaLabel={pageNumberLabelFn(1)}\n onClick={handlePageClick}\n />\n {leftDots && <li className={styles.dots}>...</li>}\n {range(leftIndex, rightIndex).map(pageIndex => (\n <PageNumber\n key={pageIndex}\n isCurrent={currentPageIndex === pageIndex}\n pageIndex={pageIndex}\n disabled={disabled}\n ariaLabel={pageNumberLabelFn(pageIndex)}\n onClick={handlePageClick}\n />\n ))}\n {rightDots && <li className={styles.dots}>...</li>}\n {!openEnd && pagesCount > 1 && (\n <PageNumber\n isCurrent={currentPageIndex === pagesCount}\n pageIndex={pagesCount}\n disabled={disabled}\n ariaLabel={pageNumberLabelFn(pagesCount)}\n onClick={handlePageClick}\n />\n )}\n <PageButton\n className={styles.arrow}\n pageIndex={currentPageIndex + 1}\n ariaLabel={nextPageLabel}\n disabled={nextButtonDisabled}\n onClick={handleNextPageClick}\n {...(nextButtonDisabled\n ? {}\n : getAnalyticsMetadataAttribute({\n detail: {\n position: 'next',\n },\n }))}\n >\n <InternalIcon name=\"angle-right\" variant={disabled ? 'disabled' : 'normal'} />\n </PageButton>\n {jumpToPage && (\n <li className={styles['jump-to-page']}>\n <InternalSpaceBetween size=\"xxs\" direction=\"horizontal\" alignItems=\"end\">\n <div className={styles['jump-to-page-input']}>\n <InternalInput\n ref={jumpToPageInputRef}\n type=\"number\"\n value={jumpToPageValue}\n __inlineLabelText={jumpToPageLabel || undefined}\n __fullWidth={true}\n ariaLabel={jumpToPageLabel || undefined}\n nativeInputAttributes={{\n min: 1,\n max: !openEnd ? pagesCount : undefined,\n }}\n onChange={handleInputChange}\n onBlur={() => setHasError(false)}\n onKeyDown={e => {\n if (e.detail.keyCode === 13 && jumpToPageValue && Number(jumpToPageValue) !== currentPageIndex) {\n handleJumpToPageClick(Number(jumpToPageValue));\n }\n }}\n />\n </div>\n {hasError && !jumpToPage?.loading ? (\n <InternalPopover\n size=\"medium\"\n dismissButton={false}\n __visible={true}\n content={jumpToPageError}\n position=\"bottom\"\n triggerType=\"custom\"\n __onVisibleChange={({ detail }) => !detail.visible && setHasError(false)}\n >\n {jumpToPageButton}\n </InternalPopover>\n ) : (\n jumpToPageButton\n )}\n </InternalSpaceBetween>\n </li>\n )}\n </ul>\n );\n }\n);\n\nexport default InternalPagination;\n"]}
@@ -1,14 +1,16 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_fvjdu_1toqn_145",
5
- "button": "awsui_button_fvjdu_1toqn_185",
6
- "dots": "awsui_dots_fvjdu_1toqn_186",
7
- "button-disabled": "awsui_button-disabled_fvjdu_1toqn_214",
8
- "arrow": "awsui_arrow_fvjdu_1toqn_219",
9
- "page-number": "awsui_page-number_fvjdu_1toqn_229",
10
- "button-current": "awsui_button-current_fvjdu_1toqn_235",
11
- "page-item": "awsui_page-item_fvjdu_1toqn_252",
12
- "root-disabled": "awsui_root-disabled_fvjdu_1toqn_270"
4
+ "root": "awsui_root_fvjdu_12i9f_145",
5
+ "button": "awsui_button_fvjdu_12i9f_186",
6
+ "dots": "awsui_dots_fvjdu_12i9f_187",
7
+ "button-disabled": "awsui_button-disabled_fvjdu_12i9f_215",
8
+ "arrow": "awsui_arrow_fvjdu_12i9f_220",
9
+ "page-number": "awsui_page-number_fvjdu_12i9f_230",
10
+ "button-current": "awsui_button-current_fvjdu_12i9f_236",
11
+ "jump-to-page": "awsui_jump-to-page_fvjdu_12i9f_249",
12
+ "jump-to-page-input": "awsui_jump-to-page-input_fvjdu_12i9f_257",
13
+ "page-item": "awsui_page-item_fvjdu_12i9f_267",
14
+ "root-disabled": "awsui_root-disabled_fvjdu_12i9f_285"
13
15
  };
14
16
 
@@ -142,7 +142,7 @@
142
142
  */
143
143
  /* Style used for links in slots/components that are text heavy, to help links stand out among
144
144
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_root_fvjdu_1toqn_145:not(#\9) {
145
+ .awsui_root_fvjdu_12i9f_145:not(#\9) {
146
146
  border-collapse: separate;
147
147
  border-spacing: 0;
148
148
  box-sizing: border-box;
@@ -176,20 +176,21 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
176
176
  flex-direction: row;
177
177
  flex-wrap: wrap;
178
178
  box-sizing: border-box;
179
+ align-items: center;
179
180
  padding-inline-start: 0;
180
181
  margin-block: 0;
181
182
  margin-inline: 0;
182
183
  list-style: none;
183
184
  }
184
185
 
185
- .awsui_button_fvjdu_1toqn_185:not(#\9),
186
- .awsui_dots_fvjdu_1toqn_186:not(#\9) {
186
+ .awsui_button_fvjdu_12i9f_186:not(#\9),
187
+ .awsui_dots_fvjdu_12i9f_187:not(#\9) {
187
188
  min-inline-size: var(--space-l-2ud1p3, 20px);
188
189
  border-block: var(--border-width-button-jm0qg7, 2px) solid transparent;
189
190
  border-inline: var(--border-width-button-jm0qg7, 2px) solid transparent;
190
191
  }
191
192
 
192
- .awsui_button_fvjdu_1toqn_185:not(#\9) {
193
+ .awsui_button_fvjdu_12i9f_186:not(#\9) {
193
194
  cursor: pointer;
194
195
  text-align: center;
195
196
  box-sizing: border-box;
@@ -198,10 +199,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
198
199
  padding-block: 0;
199
200
  padding-inline: 0;
200
201
  }
201
- .awsui_button_fvjdu_1toqn_185:not(#\9):focus {
202
+ .awsui_button_fvjdu_12i9f_186:not(#\9):focus {
202
203
  outline: none;
203
204
  }
204
- body[data-awsui-focus-visible=true] .awsui_button_fvjdu_1toqn_185:not(#\9):focus {
205
+ body[data-awsui-focus-visible=true] .awsui_button_fvjdu_12i9f_186:not(#\9):focus {
205
206
  outline: 2px dotted transparent;
206
207
  border-block: var(--border-width-button-jm0qg7, 2px) solid var(--color-border-item-focused-uk47pl, #006ce0);
207
208
  border-inline: var(--border-width-button-jm0qg7, 2px) solid var(--color-border-item-focused-uk47pl, #006ce0);
@@ -211,62 +212,76 @@ body[data-awsui-focus-visible=true] .awsui_button_fvjdu_1toqn_185:not(#\9):focus
211
212
  border-end-end-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
212
213
  box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-9mjajk, 1px) var(--color-border-item-focused-uk47pl, #006ce0);
213
214
  }
214
- .awsui_button-disabled_fvjdu_1toqn_214:not(#\9) {
215
+ .awsui_button-disabled_fvjdu_12i9f_215:not(#\9) {
215
216
  cursor: default;
216
217
  color: var(--color-text-interactive-disabled-1bqmrl, #b4b4bb);
217
218
  }
218
219
 
219
- .awsui_arrow_fvjdu_1toqn_219:not(#\9) {
220
+ .awsui_arrow_fvjdu_12i9f_220:not(#\9) {
220
221
  color: var(--color-text-interactive-default-ugh9wp, #424650);
221
222
  }
222
- .awsui_arrow_fvjdu_1toqn_219:not(#\9):not(.awsui_button-disabled_fvjdu_1toqn_214):hover {
223
+ .awsui_arrow_fvjdu_12i9f_220:not(#\9):not(.awsui_button-disabled_fvjdu_12i9f_215):hover {
223
224
  color: var(--color-text-interactive-hover-6naf7i, #0f141a);
224
225
  }
225
- .awsui_arrow_fvjdu_1toqn_219.awsui_button-disabled_fvjdu_1toqn_214:not(#\9) {
226
+ .awsui_arrow_fvjdu_12i9f_220.awsui_button-disabled_fvjdu_12i9f_215:not(#\9) {
226
227
  color: var(--color-text-interactive-disabled-1bqmrl, #b4b4bb);
227
228
  }
228
229
 
229
- .awsui_page-number_fvjdu_1toqn_229:not(#\9) {
230
+ .awsui_page-number_fvjdu_12i9f_230:not(#\9) {
230
231
  color: var(--color-text-pagination-page-number-default-74j15c, #424650);
231
232
  }
232
- .awsui_page-number_fvjdu_1toqn_229:not(#\9):not(.awsui_button-disabled_fvjdu_1toqn_214):hover {
233
+ .awsui_page-number_fvjdu_12i9f_230:not(#\9):not(.awsui_button-disabled_fvjdu_12i9f_215):hover {
233
234
  color: var(--color-text-interactive-hover-6naf7i, #0f141a);
234
235
  }
235
- .awsui_page-number_fvjdu_1toqn_229.awsui_button-current_fvjdu_1toqn_235:not(#\9) {
236
+ .awsui_page-number_fvjdu_12i9f_230.awsui_button-current_fvjdu_12i9f_236:not(#\9) {
236
237
  font-weight: var(--font-wayfinding-link-active-weight-ny4hup, 700);
237
238
  -webkit-font-smoothing: var(--font-smoothing-webkit-oemolo, antialiased);
238
239
  -moz-osx-font-smoothing: var(--font-smoothing-moz-osx-hbm0aq, grayscale);
239
240
  color: var(--color-text-interactive-active-uoe6zi, #0f141a);
240
241
  }
241
- .awsui_page-number_fvjdu_1toqn_229.awsui_button-current_fvjdu_1toqn_235.awsui_button-disabled_fvjdu_1toqn_214:not(#\9) {
242
+ .awsui_page-number_fvjdu_12i9f_230.awsui_button-current_fvjdu_12i9f_236.awsui_button-disabled_fvjdu_12i9f_215:not(#\9) {
242
243
  color: var(--color-text-pagination-page-number-active-disabled-gfl43p, #b4b4bb);
243
244
  }
244
- .awsui_page-number_fvjdu_1toqn_229.awsui_button-disabled_fvjdu_1toqn_214:not(#\9) {
245
+ .awsui_page-number_fvjdu_12i9f_230.awsui_button-disabled_fvjdu_12i9f_215:not(#\9) {
245
246
  color: var(--color-text-interactive-disabled-1bqmrl, #b4b4bb);
246
247
  }
247
248
 
248
- .awsui_dots_fvjdu_1toqn_186:not(#\9) {
249
+ .awsui_jump-to-page_fvjdu_12i9f_249:not(#\9) {
250
+ border-inline-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-divider-default-nr68jt, #c6c6cd);
251
+ box-sizing: border-box;
252
+ margin-inline-start: var(--space-xs-ymlm0b, 8px);
253
+ padding-inline-start: var(--space-xs-ymlm0b, 8px);
254
+ padding-inline-start: 15px;
255
+ list-style: none;
256
+ }
257
+ .awsui_jump-to-page-input_fvjdu_12i9f_257:not(#\9) {
258
+ inline-size: 87px;
259
+ margin-block-start: -0.6em;
260
+ overflow: visible;
261
+ }
262
+
263
+ .awsui_dots_fvjdu_12i9f_187:not(#\9) {
249
264
  color: var(--color-text-interactive-default-ugh9wp, #424650);
250
265
  }
251
266
 
252
- .awsui_page-item_fvjdu_1toqn_252:not(#\9),
253
- .awsui_dots_fvjdu_1toqn_186:not(#\9) {
254
- margin-block: var(--space-scaled-xxs-pfm1nx, 4px);
267
+ .awsui_page-item_fvjdu_12i9f_267:not(#\9),
268
+ .awsui_dots_fvjdu_12i9f_187:not(#\9) {
269
+ margin-block: var(--space-field-vertical-vm99qz, 5px);
255
270
  margin-inline: var(--space-xxs-hwfkai, 4px);
256
271
  text-align: center;
257
272
  box-sizing: border-box;
258
273
  padding-block: 0;
259
274
  padding-inline: 0;
260
275
  }
261
- .awsui_page-item_fvjdu_1toqn_252:not(#\9):first-child,
262
- .awsui_dots_fvjdu_1toqn_186:not(#\9):first-child {
276
+ .awsui_page-item_fvjdu_12i9f_267:not(#\9):first-child,
277
+ .awsui_dots_fvjdu_12i9f_187:not(#\9):first-child {
263
278
  margin-inline-start: 0;
264
279
  }
265
- .awsui_page-item_fvjdu_1toqn_252:not(#\9):last-child,
266
- .awsui_dots_fvjdu_1toqn_186:not(#\9):last-child {
280
+ .awsui_page-item_fvjdu_12i9f_267:not(#\9):last-child,
281
+ .awsui_dots_fvjdu_12i9f_187:not(#\9):last-child {
267
282
  margin-inline-end: 0;
268
283
  }
269
284
 
270
- .awsui_root-disabled_fvjdu_1toqn_270 > .awsui_dots_fvjdu_1toqn_186:not(#\9) {
285
+ .awsui_root-disabled_fvjdu_12i9f_285 > .awsui_dots_fvjdu_12i9f_187:not(#\9) {
271
286
  color: var(--color-text-interactive-disabled-1bqmrl, #b4b4bb);
272
287
  }
@@ -2,14 +2,16 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_fvjdu_1toqn_145",
6
- "button": "awsui_button_fvjdu_1toqn_185",
7
- "dots": "awsui_dots_fvjdu_1toqn_186",
8
- "button-disabled": "awsui_button-disabled_fvjdu_1toqn_214",
9
- "arrow": "awsui_arrow_fvjdu_1toqn_219",
10
- "page-number": "awsui_page-number_fvjdu_1toqn_229",
11
- "button-current": "awsui_button-current_fvjdu_1toqn_235",
12
- "page-item": "awsui_page-item_fvjdu_1toqn_252",
13
- "root-disabled": "awsui_root-disabled_fvjdu_1toqn_270"
5
+ "root": "awsui_root_fvjdu_12i9f_145",
6
+ "button": "awsui_button_fvjdu_12i9f_186",
7
+ "dots": "awsui_dots_fvjdu_12i9f_187",
8
+ "button-disabled": "awsui_button-disabled_fvjdu_12i9f_215",
9
+ "arrow": "awsui_arrow_fvjdu_12i9f_220",
10
+ "page-number": "awsui_page-number_fvjdu_12i9f_230",
11
+ "button-current": "awsui_button-current_fvjdu_12i9f_236",
12
+ "jump-to-page": "awsui_jump-to-page_fvjdu_12i9f_249",
13
+ "jump-to-page-input": "awsui_jump-to-page-input_fvjdu_12i9f_257",
14
+ "page-item": "awsui_page-item_fvjdu_12i9f_267",
15
+ "root-disabled": "awsui_root-disabled_fvjdu_12i9f_285"
14
16
  };
15
17