@elliemae/ds-pagination 3.80.0-next.50 → 3.80.0-next.53

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 (202) hide show
  1. package/dist/cjs/parts/DSPaginator/DSPaginator.js +10 -166
  2. package/dist/cjs/parts/DSPaginator/DSPaginator.js.map +2 -2
  3. package/dist/cjs/parts/DSPaginator/{config/usePaginationSearch.js → DSPaginatorCTX.js} +7 -32
  4. package/dist/cjs/parts/DSPaginator/DSPaginatorCTX.js.map +7 -0
  5. package/dist/cjs/parts/DSPaginator/config/{createPaginatorHeader.js → getAmountOfPages.js} +8 -23
  6. package/dist/cjs/parts/DSPaginator/config/getAmountOfPages.js.map +7 -0
  7. package/dist/cjs/parts/DSPaginator/config/getInstanceIds.js +40 -0
  8. package/dist/cjs/parts/DSPaginator/config/getInstanceIds.js.map +7 -0
  9. package/dist/cjs/parts/DSPaginator/config/navigationKeys.js +44 -0
  10. package/dist/cjs/parts/DSPaginator/config/navigationKeys.js.map +7 -0
  11. package/dist/cjs/parts/DSPaginator/config/useFocusTracker.js +77 -0
  12. package/dist/cjs/parts/DSPaginator/config/useFocusTracker.js.map +7 -0
  13. package/dist/cjs/parts/DSPaginator/config/usePaginator.js +73 -49
  14. package/dist/cjs/parts/DSPaginator/config/usePaginator.js.map +2 -2
  15. package/dist/cjs/parts/DSPaginator/config/usePaginatorFloatingContext.js +86 -0
  16. package/dist/cjs/parts/DSPaginator/config/usePaginatorFloatingContext.js.map +7 -0
  17. package/dist/cjs/parts/DSPaginator/config/usePaginatorInteractions.js +170 -0
  18. package/dist/cjs/parts/DSPaginator/config/usePaginatorInteractions.js.map +7 -0
  19. package/dist/cjs/parts/DSPaginator/config/usePaginatorSizing.js +80 -0
  20. package/dist/cjs/parts/DSPaginator/config/usePaginatorSizing.js.map +7 -0
  21. package/dist/cjs/parts/DSPaginator/config/useValidateProps.js.map +2 -2
  22. package/dist/cjs/parts/DSPaginator/constants/index.js +49 -3
  23. package/dist/cjs/parts/DSPaginator/constants/index.js.map +2 -2
  24. package/dist/cjs/parts/DSPaginator/parts/OptionRenderer.js +98 -0
  25. package/dist/cjs/parts/DSPaginator/parts/OptionRenderer.js.map +7 -0
  26. package/dist/cjs/parts/DSPaginator/parts/Panel.js +131 -0
  27. package/dist/cjs/parts/DSPaginator/parts/Panel.js.map +7 -0
  28. package/dist/cjs/parts/DSPaginator/parts/Trigger.js +124 -0
  29. package/dist/cjs/parts/DSPaginator/parts/Trigger.js.map +7 -0
  30. package/dist/cjs/parts/DSPaginator/react-desc-prop-types.js +6 -1
  31. package/dist/cjs/parts/DSPaginator/react-desc-prop-types.js.map +2 -2
  32. package/dist/cjs/parts/DSPaginator/styled.js +113 -38
  33. package/dist/cjs/parts/DSPaginator/styled.js.map +3 -3
  34. package/dist/cjs/parts/DSPaginator/typescript-testing/slot-props.js +12 -1
  35. package/dist/cjs/parts/DSPaginator/typescript-testing/slot-props.js.map +2 -2
  36. package/dist/cjs/parts/DSPaginator/typescript-testing/typescript-testing.js +2 -1
  37. package/dist/cjs/parts/DSPaginator/typescript-testing/typescript-testing.js.map +2 -2
  38. package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelector.js +10 -79
  39. package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelector.js.map +3 -3
  40. package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelectorCTX.js +38 -0
  41. package/dist/cjs/parts/DSPerPageSelector/DSPerPageSelectorCTX.js.map +7 -0
  42. package/dist/cjs/parts/DSPerPageSelector/config/getInstanceIds.js +40 -0
  43. package/dist/cjs/parts/DSPerPageSelector/config/getInstanceIds.js.map +7 -0
  44. package/dist/cjs/parts/DSPerPageSelector/config/getOptions.js.map +2 -2
  45. package/dist/cjs/parts/DSPerPageSelector/config/getSelectedOptionIndex.js +36 -0
  46. package/dist/cjs/parts/DSPerPageSelector/config/getSelectedOptionIndex.js.map +7 -0
  47. package/dist/cjs/parts/DSPerPageSelector/config/navigationKeys.js +44 -0
  48. package/dist/cjs/parts/DSPerPageSelector/config/navigationKeys.js.map +7 -0
  49. package/dist/cjs/parts/DSPerPageSelector/config/useFocusTracker.js +83 -0
  50. package/dist/cjs/parts/DSPerPageSelector/config/useFocusTracker.js.map +7 -0
  51. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelector.js +68 -20
  52. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelector.js.map +2 -2
  53. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.js +82 -0
  54. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.js.map +7 -0
  55. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.js +175 -0
  56. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.js.map +7 -0
  57. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorSizing.js +66 -0
  58. package/dist/cjs/parts/DSPerPageSelector/config/usePerPageSelectorSizing.js.map +7 -0
  59. package/dist/cjs/parts/DSPerPageSelector/constants/index.js +47 -8
  60. package/dist/cjs/parts/DSPerPageSelector/constants/index.js.map +2 -2
  61. package/dist/cjs/parts/DSPerPageSelector/parts/OptionRenderer.js +94 -0
  62. package/dist/cjs/parts/DSPerPageSelector/parts/OptionRenderer.js.map +7 -0
  63. package/dist/cjs/parts/DSPerPageSelector/parts/Panel.js +120 -0
  64. package/dist/cjs/parts/DSPerPageSelector/parts/Panel.js.map +7 -0
  65. package/dist/cjs/parts/DSPerPageSelector/parts/Trigger.js +95 -0
  66. package/dist/cjs/parts/DSPerPageSelector/parts/Trigger.js.map +7 -0
  67. package/dist/cjs/parts/DSPerPageSelector/react-desc-prop-types.js +19 -2
  68. package/dist/cjs/parts/DSPerPageSelector/react-desc-prop-types.js.map +2 -2
  69. package/dist/cjs/parts/DSPerPageSelector/styled.js +104 -32
  70. package/dist/cjs/parts/DSPerPageSelector/styled.js.map +2 -2
  71. package/dist/cjs/parts/DSPerPageSelector/typescript-testing/slots-props.js +10 -1
  72. package/dist/cjs/parts/DSPerPageSelector/typescript-testing/slots-props.js.map +2 -2
  73. package/dist/cjs/parts/DSPerPageSelector/typescript-testing/typescript-testing.js +60 -1
  74. package/dist/cjs/parts/DSPerPageSelector/typescript-testing/typescript-testing.js.map +2 -2
  75. package/dist/cjs/react-desc-prop-types.js.map +1 -1
  76. package/dist/esm/parts/DSPaginator/DSPaginator.js +12 -168
  77. package/dist/esm/parts/DSPaginator/DSPaginator.js.map +2 -2
  78. package/dist/esm/parts/DSPaginator/DSPaginatorCTX.js +8 -0
  79. package/dist/esm/parts/DSPaginator/DSPaginatorCTX.js.map +7 -0
  80. package/dist/esm/parts/DSPaginator/config/getAmountOfPages.js +9 -0
  81. package/dist/esm/parts/DSPaginator/config/getAmountOfPages.js.map +7 -0
  82. package/dist/esm/parts/DSPaginator/config/getInstanceIds.js +10 -0
  83. package/dist/esm/parts/DSPaginator/config/getInstanceIds.js.map +7 -0
  84. package/dist/esm/parts/DSPaginator/config/navigationKeys.js +14 -0
  85. package/dist/esm/parts/DSPaginator/config/navigationKeys.js.map +7 -0
  86. package/dist/esm/parts/DSPaginator/config/useFocusTracker.js +47 -0
  87. package/dist/esm/parts/DSPaginator/config/useFocusTracker.js.map +7 -0
  88. package/dist/esm/parts/DSPaginator/config/usePaginator.js +74 -50
  89. package/dist/esm/parts/DSPaginator/config/usePaginator.js.map +2 -2
  90. package/dist/esm/parts/DSPaginator/config/usePaginatorFloatingContext.js +56 -0
  91. package/dist/esm/parts/DSPaginator/config/usePaginatorFloatingContext.js.map +7 -0
  92. package/dist/esm/parts/DSPaginator/config/usePaginatorInteractions.js +140 -0
  93. package/dist/esm/parts/DSPaginator/config/usePaginatorInteractions.js.map +7 -0
  94. package/dist/esm/parts/DSPaginator/config/usePaginatorSizing.js +56 -0
  95. package/dist/esm/parts/DSPaginator/config/usePaginatorSizing.js.map +7 -0
  96. package/dist/esm/parts/DSPaginator/config/useValidateProps.js.map +2 -2
  97. package/dist/esm/parts/DSPaginator/constants/index.js +49 -3
  98. package/dist/esm/parts/DSPaginator/constants/index.js.map +2 -2
  99. package/dist/esm/parts/DSPaginator/parts/OptionRenderer.js +68 -0
  100. package/dist/esm/parts/DSPaginator/parts/OptionRenderer.js.map +7 -0
  101. package/dist/esm/parts/DSPaginator/parts/Panel.js +101 -0
  102. package/dist/esm/parts/DSPaginator/parts/Panel.js.map +7 -0
  103. package/dist/esm/parts/DSPaginator/parts/Trigger.js +94 -0
  104. package/dist/esm/parts/DSPaginator/parts/Trigger.js.map +7 -0
  105. package/dist/esm/parts/DSPaginator/react-desc-prop-types.js +6 -1
  106. package/dist/esm/parts/DSPaginator/react-desc-prop-types.js.map +2 -2
  107. package/dist/esm/parts/DSPaginator/styled.js +120 -39
  108. package/dist/esm/parts/DSPaginator/styled.js.map +2 -2
  109. package/dist/esm/parts/DSPaginator/typescript-testing/slot-props.js +12 -1
  110. package/dist/esm/parts/DSPaginator/typescript-testing/slot-props.js.map +2 -2
  111. package/dist/esm/parts/DSPaginator/typescript-testing/typescript-testing.js +2 -1
  112. package/dist/esm/parts/DSPaginator/typescript-testing/typescript-testing.js.map +2 -2
  113. package/dist/esm/parts/DSPerPageSelector/DSPerPageSelector.js +11 -80
  114. package/dist/esm/parts/DSPerPageSelector/DSPerPageSelector.js.map +3 -3
  115. package/dist/esm/parts/DSPerPageSelector/DSPerPageSelectorCTX.js +8 -0
  116. package/dist/esm/parts/DSPerPageSelector/DSPerPageSelectorCTX.js.map +7 -0
  117. package/dist/esm/parts/DSPerPageSelector/config/getInstanceIds.js +10 -0
  118. package/dist/esm/parts/DSPerPageSelector/config/getInstanceIds.js.map +7 -0
  119. package/dist/esm/parts/DSPerPageSelector/config/getOptions.js.map +2 -2
  120. package/dist/esm/parts/DSPerPageSelector/config/getSelectedOptionIndex.js +6 -0
  121. package/dist/esm/parts/DSPerPageSelector/config/getSelectedOptionIndex.js.map +7 -0
  122. package/dist/esm/parts/DSPerPageSelector/config/navigationKeys.js +14 -0
  123. package/dist/esm/parts/DSPerPageSelector/config/navigationKeys.js.map +7 -0
  124. package/dist/esm/parts/DSPerPageSelector/config/useFocusTracker.js +53 -0
  125. package/dist/esm/parts/DSPerPageSelector/config/useFocusTracker.js.map +7 -0
  126. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelector.js +69 -21
  127. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelector.js.map +2 -2
  128. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.js +52 -0
  129. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.js.map +7 -0
  130. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.js +145 -0
  131. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.js.map +7 -0
  132. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorSizing.js +42 -0
  133. package/dist/esm/parts/DSPerPageSelector/config/usePerPageSelectorSizing.js.map +7 -0
  134. package/dist/esm/parts/DSPerPageSelector/constants/index.js +47 -8
  135. package/dist/esm/parts/DSPerPageSelector/constants/index.js.map +2 -2
  136. package/dist/esm/parts/DSPerPageSelector/parts/OptionRenderer.js +64 -0
  137. package/dist/esm/parts/DSPerPageSelector/parts/OptionRenderer.js.map +7 -0
  138. package/dist/esm/parts/DSPerPageSelector/parts/Panel.js +90 -0
  139. package/dist/esm/parts/DSPerPageSelector/parts/Panel.js.map +7 -0
  140. package/dist/esm/parts/DSPerPageSelector/parts/Trigger.js +65 -0
  141. package/dist/esm/parts/DSPerPageSelector/parts/Trigger.js.map +7 -0
  142. package/dist/esm/parts/DSPerPageSelector/react-desc-prop-types.js +19 -2
  143. package/dist/esm/parts/DSPerPageSelector/react-desc-prop-types.js.map +2 -2
  144. package/dist/esm/parts/DSPerPageSelector/styled.js +111 -33
  145. package/dist/esm/parts/DSPerPageSelector/styled.js.map +2 -2
  146. package/dist/esm/parts/DSPerPageSelector/typescript-testing/slots-props.js +10 -1
  147. package/dist/esm/parts/DSPerPageSelector/typescript-testing/slots-props.js.map +2 -2
  148. package/dist/esm/parts/DSPerPageSelector/typescript-testing/typescript-testing.js +60 -1
  149. package/dist/esm/parts/DSPerPageSelector/typescript-testing/typescript-testing.js.map +2 -2
  150. package/dist/esm/react-desc-prop-types.js.map +1 -1
  151. package/dist/types/parts/DSPageNextButton/config/usePageNextButton.d.ts +4 -4
  152. package/dist/types/parts/DSPagePrevButton/config/usePagePrevButton.d.ts +4 -4
  153. package/dist/types/parts/DSPaginationContainer/config/usePaginationContainer.d.ts +4 -4
  154. package/dist/types/parts/DSPaginationSeparator/config/usePaginationSeparator.d.ts +4 -4
  155. package/dist/types/parts/DSPaginator/DSPaginator.d.ts +5 -0
  156. package/dist/types/parts/DSPaginator/DSPaginatorCTX.d.ts +5 -0
  157. package/dist/types/parts/DSPaginator/config/getAmountOfPages.d.ts +1 -0
  158. package/dist/types/parts/DSPaginator/config/getInstanceIds.d.ts +3 -0
  159. package/dist/types/parts/DSPaginator/config/navigationKeys.d.ts +3 -0
  160. package/dist/types/parts/DSPaginator/config/useFocusTracker.d.ts +20 -0
  161. package/dist/types/parts/DSPaginator/config/usePaginator.d.ts +52 -18
  162. package/dist/types/parts/DSPaginator/config/usePaginatorFloatingContext.d.ts +31 -0
  163. package/dist/types/parts/DSPaginator/config/usePaginatorInteractions.d.ts +37 -0
  164. package/dist/types/parts/DSPaginator/config/usePaginatorSizing.d.ts +37 -0
  165. package/dist/types/parts/DSPaginator/constants/index.d.ts +36 -1
  166. package/dist/types/parts/DSPaginator/parts/OptionRenderer.d.ts +11 -0
  167. package/dist/types/parts/DSPaginator/parts/Panel.d.ts +5 -0
  168. package/dist/types/parts/DSPaginator/parts/Trigger.d.ts +5 -0
  169. package/dist/types/parts/DSPaginator/react-desc-prop-types.d.ts +17 -0
  170. package/dist/types/parts/DSPaginator/styled.d.ts +17 -4
  171. package/dist/types/parts/DSPerPageSelector/DSPerPageSelector.d.ts +5 -0
  172. package/dist/types/parts/DSPerPageSelector/DSPerPageSelectorCTX.d.ts +5 -0
  173. package/dist/types/parts/DSPerPageSelector/config/getInstanceIds.d.ts +3 -0
  174. package/dist/types/parts/DSPerPageSelector/config/getOptions.d.ts +3 -3
  175. package/dist/types/parts/DSPerPageSelector/config/getSelectedOptionIndex.d.ts +2 -0
  176. package/dist/types/parts/DSPerPageSelector/config/navigationKeys.d.ts +3 -0
  177. package/dist/types/parts/DSPerPageSelector/config/useFocusTracker.d.ts +22 -0
  178. package/dist/types/parts/DSPerPageSelector/config/usePerPageSelector.d.ts +43 -10
  179. package/dist/types/parts/DSPerPageSelector/config/usePerPageSelectorFloatingContext.d.ts +31 -0
  180. package/dist/types/parts/DSPerPageSelector/config/usePerPageSelectorInteractions.d.ts +38 -0
  181. package/dist/types/parts/DSPerPageSelector/config/usePerPageSelectorSizing.d.ts +25 -0
  182. package/dist/types/parts/DSPerPageSelector/constants/index.d.ts +32 -5
  183. package/dist/types/parts/DSPerPageSelector/parts/OptionRenderer.d.ts +11 -0
  184. package/dist/types/parts/DSPerPageSelector/parts/Panel.d.ts +5 -0
  185. package/dist/types/parts/DSPerPageSelector/parts/Trigger.d.ts +5 -0
  186. package/dist/types/parts/DSPerPageSelector/react-desc-prop-types.d.ts +27 -2
  187. package/dist/types/parts/DSPerPageSelector/styled.d.ts +15 -2
  188. package/dist/types/react-desc-prop-types.d.ts +2 -2
  189. package/package.json +15 -13
  190. package/dist/cjs/parts/DSPaginator/config/createPaginatorHeader.js.map +0 -7
  191. package/dist/cjs/parts/DSPaginator/config/getOptions.js +0 -76
  192. package/dist/cjs/parts/DSPaginator/config/getOptions.js.map +0 -7
  193. package/dist/cjs/parts/DSPaginator/config/usePaginationSearch.js.map +0 -7
  194. package/dist/esm/parts/DSPaginator/config/createPaginatorHeader.js +0 -24
  195. package/dist/esm/parts/DSPaginator/config/createPaginatorHeader.js.map +0 -7
  196. package/dist/esm/parts/DSPaginator/config/getOptions.js +0 -46
  197. package/dist/esm/parts/DSPaginator/config/getOptions.js.map +0 -7
  198. package/dist/esm/parts/DSPaginator/config/usePaginationSearch.js +0 -33
  199. package/dist/esm/parts/DSPaginator/config/usePaginationSearch.js.map +0 -7
  200. package/dist/types/parts/DSPaginator/config/createPaginatorHeader.d.ts +0 -9
  201. package/dist/types/parts/DSPaginator/config/getOptions.d.ts +0 -8
  202. package/dist/types/parts/DSPaginator/config/usePaginationSearch.d.ts +0 -1
@@ -28,13 +28,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var styled_exports = {};
30
30
  __export(styled_exports, {
31
- InvisibleDiv: () => InvisibleDiv,
32
- PaginationDropdownButtonPerPageSelector: () => PaginationDropdownButtonPerPageSelector,
33
- StyledHeader: () => StyledHeader
31
+ StyledFloatingWrapper: () => StyledFloatingWrapper,
32
+ StyledHeader: () => StyledHeader,
33
+ StyledList: () => StyledList,
34
+ StyledListWrapper: () => StyledListWrapper,
35
+ StyledOption: () => StyledOption,
36
+ StyledOptionCheckmark: () => StyledOptionCheckmark,
37
+ StyledOptionLabel: () => StyledOptionLabel,
38
+ StyledPanel: () => StyledPanel,
39
+ StyledTrigger: () => StyledTrigger,
40
+ StyledTriggerWrapper: () => StyledTriggerWrapper
34
41
  });
35
42
  module.exports = __toCommonJS(styled_exports);
36
43
  var React = __toESM(require("react"));
37
44
  var import_ds_button_v2 = require("@elliemae/ds-button-v2");
45
+ var import_ds_floating_context = require("@elliemae/ds-floating-context");
46
+ var import_ds_fast_list = require("@elliemae/ds-fast-list");
38
47
  var import_ds_system = require("@elliemae/ds-system");
39
48
  var import_constants = require("./constants/index.js");
40
49
  const fontSize13Base13 = 13 / 13;
@@ -55,14 +64,17 @@ const styledFocusCss = import_ds_system.css`
55
64
  z-index: 7;
56
65
  }
57
66
  `;
58
- const InvisibleDiv = import_ds_system.styled.div`
59
- opacity: 0;
60
- white-space: nowrap;
61
- overflow: hidden;
62
- text-overflow: ellipsis;
63
- position: absolute;
67
+ const optionFontSizeCss = import_ds_system.css`
68
+ font-size: ${fontSize13Base16}rem;
69
+ @media (min-width: ${({ theme }) => theme.breakpoints.small}) {
70
+ font-size: ${fontSize13Base13}rem;
71
+ }
64
72
  `;
65
- const paginationDropdownButtonCommonStyles = import_ds_system.css`
73
+ const StyledTrigger = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV3, {
74
+ name: import_constants.DSPaginationName,
75
+ slot: import_constants.PER_PAGE_SELECTOR_SLOTS.PER_PAGE_SELECTOR,
76
+ preserveLegacyDataTestId: true
77
+ })`
66
78
  min-height: 42px;
67
79
  display: grid;
68
80
  grid-auto-flow: column;
@@ -73,7 +85,9 @@ const paginationDropdownButtonCommonStyles = import_ds_system.css`
73
85
  padding-right: 16px;
74
86
  grid-gap: 8px;
75
87
  font-size: 13px;
76
- color: neutral-700;
88
+ /* the previous DSPerPageSelector declares color: neutral-700 here, but inside its css helper the token is never
89
+ resolved, so the declaration is dropped and the text renders with the browser's button color (black, greyed when
90
+ disabled). Not copied: the selector keeps what is rendered today (see dimsum_compliance_status_report.md) */
77
91
  cursor: pointer;
78
92
  border-radius: 0;
79
93
  font-weight: ${(props) => props.theme.fontWeights.regular};
@@ -84,34 +98,92 @@ const paginationDropdownButtonCommonStyles = import_ds_system.css`
84
98
  cursor: not-allowed;
85
99
  }
86
100
  white-space: nowrap;
101
+
102
+ /* the typography variants own their font-size, so we target the rendered element by className instead of wrapping
103
+ DSTypography in styled() (same approach as the previous implementation) */
104
+ .typography-per-page-selector {
105
+ ${optionFontSizeCss}
106
+ }
87
107
  `;
88
- const PaginationDropdownButtonPerPageSelector = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV3, {
108
+ const StyledTriggerWrapper = (0, import_ds_system.styled)("div", {
89
109
  name: import_constants.DSPaginationName,
90
- slot: import_constants.PER_PAGE_SELECTOR_SLOTS.PER_PAGE_SELECTOR,
91
- preserveLegacyDataTestId: true
110
+ slot: import_constants.PER_PAGE_SELECTOR_SLOTS.TRIGGER_WRAPPER
92
111
  })`
93
- ${paginationDropdownButtonCommonStyles}
94
- /**
95
- * Pagination uses DSTypography internally, but each typography variant defines
96
- * its own font-size. When these components are placed inside a styled() wrapper,
97
- * trying to style them via styled(DSTypography) triggers TypeScript errors
98
- * because DSTypography exposes "as" props and variant-specific overrides.
99
- *
100
- * Instead of wrapping DSTypography directly in styled(), we target the
101
- * underlying rendered elements via className/id. This avoids the TS conflicts
102
- * while still allowing us to override their font-size reliably.
103
- */
104
- .typography-per-page-selector {
105
- font-size: ${fontSize13Base16}rem;
106
- @media (min-width: ${({ theme }) => theme.breakpoints.small}) {
107
- font-size: ${fontSize13Base13}rem;
108
- }
109
- }
112
+ display: contents;
110
113
  `;
111
- const StyledHeader = import_ds_system.styled.div`
114
+ const StyledFloatingWrapper = (0, import_ds_system.styled)(import_ds_floating_context.FloatingWrapper, {
115
+ name: import_constants.DSPaginationName,
116
+ slot: import_constants.PER_PAGE_SELECTOR_SLOTS.FLOATING_WRAPPER
117
+ })``;
118
+ const StyledPanel = (0, import_ds_system.styled)("div", { name: import_constants.DSPaginationName, slot: import_constants.PER_PAGE_SELECTOR_SLOTS.PANEL })`
119
+ display: grid;
120
+ grid-template-rows: auto 1fr;
121
+ /* same as the previous DSDropdownMenuV2 wrapper: 4px of padding below the list */
122
+ padding-bottom: ${import_constants.PER_PAGE_SELECTOR_PANEL_PADDING_BOTTOM}px;
123
+ background-color: ${({ theme }) => theme.colors.neutral["000"]};
124
+ `;
125
+ const StyledHeader = (0, import_ds_system.styled)("div", { name: import_constants.DSPaginationName, slot: import_constants.PER_PAGE_SELECTOR_SLOTS.HEADER })`
126
+ display: grid;
127
+ align-items: center;
128
+ box-sizing: border-box;
129
+ min-height: ${import_constants.PER_PAGE_SELECTOR_HEADER_HEIGHT}px;
130
+ padding: 0 0 0 4px;
131
+ border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[300]};
112
132
  font-size: ${fontSize12Base16}rem;
133
+ color: ${({ theme }) => theme.colors.neutral[500]};
113
134
  @media (min-width: ${({ theme }) => theme.breakpoints.small}) {
114
135
  font-size: ${fontSize12Base13}rem;
115
136
  }
116
137
  `;
138
+ const StyledListWrapper = (0, import_ds_system.styled)("div", {
139
+ name: import_constants.DSPaginationName,
140
+ slot: import_constants.PER_PAGE_SELECTOR_SLOTS.LIST_WRAPPER
141
+ })``;
142
+ const StyledList = (0, import_ds_system.styled)(import_ds_fast_list.DSFastList, { name: import_constants.DSPaginationName, slot: import_constants.PER_PAGE_SELECTOR_SLOTS.LIST })``;
143
+ const StyledOption = (0, import_ds_system.styled)("div", { name: import_constants.DSPaginationName, slot: import_constants.PER_PAGE_SELECTOR_SLOTS.OPTION })`
144
+ position: relative;
145
+ display: grid;
146
+ align-items: center;
147
+ column-gap: 8px;
148
+ min-height: ${import_constants.PER_PAGE_SELECTOR_OPTION_HEIGHT}px;
149
+ padding: 4px 16px;
150
+ cursor: pointer;
151
+ list-style: none;
152
+ ${optionFontSizeCss}
153
+ background-color: ${({ theme }) => theme.colors.neutral["000"]};
154
+ &:hover {
155
+ background-color: ${({ theme }) => theme.colors.brand[200]};
156
+ }
157
+ &:focus {
158
+ outline: none;
159
+ background-color: ${({ theme }) => theme.colors.brand[200]};
160
+ &:after {
161
+ display: block;
162
+ content: ' ';
163
+ position: absolute;
164
+ top: 0;
165
+ left: 0;
166
+ right: 0;
167
+ bottom: 0;
168
+ border: 1px solid ${({ theme }) => theme.colors.brand[500]};
169
+ pointer-events: none;
170
+ z-index: 7;
171
+ }
172
+ }
173
+ `;
174
+ const StyledOptionCheckmark = (0, import_ds_system.styled)("span", {
175
+ name: import_constants.DSPaginationName,
176
+ slot: import_constants.PER_PAGE_SELECTOR_SLOTS.OPTION_CHECKMARK
177
+ })`
178
+ display: grid;
179
+ place-items: center;
180
+ `;
181
+ const StyledOptionLabel = (0, import_ds_system.styled)("span", {
182
+ name: import_constants.DSPaginationName,
183
+ slot: import_constants.PER_PAGE_SELECTOR_SLOTS.OPTION_LABEL
184
+ })`
185
+ /* labels wrap, they are never truncated (see stories/docs/principles/a11y/TextTruncationCriticalities.md) */
186
+ white-space: normal;
187
+ overflow-wrap: anywhere;
188
+ `;
117
189
  //# sourceMappingURL=styled.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/DSPerPageSelector/styled.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { DSButtonV3 } from '@elliemae/ds-button-v2';\n\nimport { css, styled } from '@elliemae/ds-system';\nimport type {} from '@xstyled/system';\nimport { DSPaginationName, PER_PAGE_SELECTOR_SLOTS } from './constants/index.js';\nconst fontSize13Base13 = 13 / 13;\nconst fontSize13Base16 = 13 / 16;\n\nconst fontSize12Base13 = 12 / 13;\nconst fontSize12Base16 = 12 / 16;\n\nconst styledFocusCss = css`\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n pointer-events: none;\n z-index: 7;\n }\n`;\n\nexport const InvisibleDiv = styled.div`\n opacity: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n position: absolute;\n`;\n\nconst paginationDropdownButtonCommonStyles = css`\n min-height: 42px;\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n position: relative;\n padding-left: 16px;\n padding-right: 16px;\n grid-gap: 8px;\n font-size: 13px;\n color: neutral-700;\n cursor: pointer;\n border-radius: 0;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n :focus {\n ${styledFocusCss}\n }\n &:disabled {\n cursor: not-allowed;\n }\n white-space: nowrap;\n`;\nexport const PaginationDropdownButtonPerPageSelector = styled(DSButtonV3, {\n name: DSPaginationName,\n slot: PER_PAGE_SELECTOR_SLOTS.PER_PAGE_SELECTOR,\n preserveLegacyDataTestId: true,\n})`\n ${paginationDropdownButtonCommonStyles}\n /**\n * Pagination uses DSTypography internally, but each typography variant defines\n * its own font-size. When these components are placed inside a styled() wrapper,\n * trying to style them via styled(DSTypography) triggers TypeScript errors\n * because DSTypography exposes \"as\" props and variant-specific overrides.\n *\n * Instead of wrapping DSTypography directly in styled(), we target the\n * underlying rendered elements via className/id. This avoids the TS conflicts\n * while still allowing us to override their font-size reliably.\n */\n .typography-per-page-selector {\n font-size: ${fontSize13Base16}rem;\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${fontSize13Base13}rem;\n }\n }\n`;\n\nexport const StyledHeader = styled.div`\n font-size: ${fontSize12Base16}rem;\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${fontSize12Base13}rem;\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA2B;AAE3B,uBAA4B;AAE5B,uBAA0D;AAC1D,MAAM,mBAAmB,KAAK;AAC9B,MAAM,mBAAmB,KAAK;AAE9B,MAAM,mBAAmB,KAAK;AAC9B,MAAM,mBAAmB,KAAK;AAE9B,MAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASC,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAMvD,MAAM,eAAe,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQnC,MAAM,uCAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAc5B,CAAC,UAAU,MAAM,MAAM,YAAY,OAAO;AAAA;AAAA,MAErD,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOb,MAAM,8CAA0C,yBAAO,gCAAY;AAAA,EACxE,MAAM;AAAA,EACN,MAAM,yCAAwB;AAAA,EAC9B,0BAA0B;AAC5B,CAAC;AAAA,IACG,oCAAoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAYvB,gBAAgB;AAAA,yBACR,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,KAAK;AAAA,mBAC5C,gBAAgB;AAAA;AAAA;AAAA;AAK5B,MAAM,eAAe,wBAAO;AAAA,eACpB,gBAAgB;AAAA,uBACR,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,KAAK;AAAA,iBAC5C,gBAAgB;AAAA;AAAA;",
4
+ "sourcesContent": ["import { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { DSFastList } from '@elliemae/ds-fast-list';\nimport { css, styled } from '@elliemae/ds-system';\nimport type {} from '@xstyled/system';\nimport {\n DSPaginationName,\n PER_PAGE_SELECTOR_HEADER_HEIGHT,\n PER_PAGE_SELECTOR_OPTION_HEIGHT,\n PER_PAGE_SELECTOR_PANEL_PADDING_BOTTOM,\n PER_PAGE_SELECTOR_SLOTS,\n} from './constants/index.js';\n\n// the font sizes are the ones of the previous DSPerPageSelector (same rem/px dance between the 13px and 16px base)\nconst fontSize13Base13 = 13 / 13;\nconst fontSize13Base16 = 13 / 16;\nconst fontSize12Base13 = 12 / 13;\nconst fontSize12Base16 = 12 / 16;\n\nconst styledFocusCss = css`\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n pointer-events: none;\n z-index: 7;\n }\n`;\n\nconst optionFontSizeCss = css`\n font-size: ${fontSize13Base16}rem;\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${fontSize13Base13}rem;\n }\n`;\n\nexport const StyledTrigger = styled(DSButtonV3, {\n name: DSPaginationName,\n slot: PER_PAGE_SELECTOR_SLOTS.PER_PAGE_SELECTOR,\n preserveLegacyDataTestId: true,\n})`\n min-height: 42px;\n display: grid;\n grid-auto-flow: column;\n justify-content: center;\n align-items: center;\n position: relative;\n padding-left: 16px;\n padding-right: 16px;\n grid-gap: 8px;\n font-size: 13px;\n /* the previous DSPerPageSelector declares color: neutral-700 here, but inside its css helper the token is never\n resolved, so the declaration is dropped and the text renders with the browser's button color (black, greyed when\n disabled). Not copied: the selector keeps what is rendered today (see dimsum_compliance_status_report.md) */\n cursor: pointer;\n border-radius: 0;\n font-weight: ${(props) => props.theme.fontWeights.regular};\n :focus {\n ${styledFocusCss}\n }\n &:disabled {\n cursor: not-allowed;\n }\n white-space: nowrap;\n\n /* the typography variants own their font-size, so we target the rendered element by className instead of wrapping\n DSTypography in styled() (same approach as the previous implementation) */\n .typography-per-page-selector {\n ${optionFontSizeCss}\n }\n`;\n\nexport const StyledTriggerWrapper = styled('div', {\n name: DSPaginationName,\n slot: PER_PAGE_SELECTOR_SLOTS.TRIGGER_WRAPPER,\n})`\n display: contents;\n`;\n\nexport const StyledFloatingWrapper = styled(FloatingWrapper, {\n name: DSPaginationName,\n slot: PER_PAGE_SELECTOR_SLOTS.FLOATING_WRAPPER,\n})``;\n\nexport const StyledPanel = styled('div', { name: DSPaginationName, slot: PER_PAGE_SELECTOR_SLOTS.PANEL })`\n display: grid;\n grid-template-rows: auto 1fr;\n /* same as the previous DSDropdownMenuV2 wrapper: 4px of padding below the list */\n padding-bottom: ${PER_PAGE_SELECTOR_PANEL_PADDING_BOTTOM}px;\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n`;\n\nexport const StyledHeader = styled('div', { name: DSPaginationName, slot: PER_PAGE_SELECTOR_SLOTS.HEADER })`\n display: grid;\n align-items: center;\n box-sizing: border-box;\n min-height: ${PER_PAGE_SELECTOR_HEADER_HEIGHT}px;\n padding: 0 0 0 4px;\n border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[300]};\n font-size: ${fontSize12Base16}rem;\n color: ${({ theme }) => theme.colors.neutral[500]};\n @media (min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${fontSize12Base13}rem;\n }\n`;\n\n// explicit height: the virtual list needs a constrained box to scroll (its own container is height: 100%)\nexport const StyledListWrapper = styled('div', {\n name: DSPaginationName,\n slot: PER_PAGE_SELECTOR_SLOTS.LIST_WRAPPER,\n})``;\n\nexport const StyledList = styled(DSFastList, { name: DSPaginationName, slot: PER_PAGE_SELECTOR_SLOTS.LIST })``;\n\nexport const StyledOption = styled('div', { name: DSPaginationName, slot: PER_PAGE_SELECTOR_SLOTS.OPTION })`\n position: relative;\n display: grid;\n align-items: center;\n column-gap: 8px;\n min-height: ${PER_PAGE_SELECTOR_OPTION_HEIGHT}px;\n padding: 4px 16px;\n cursor: pointer;\n list-style: none;\n ${optionFontSizeCss}\n background-color: ${({ theme }) => theme.colors.neutral['000']};\n &:hover {\n background-color: ${({ theme }) => theme.colors.brand[200]};\n }\n &:focus {\n outline: none;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 1px solid ${({ theme }) => theme.colors.brand[500]};\n pointer-events: none;\n z-index: 7;\n }\n }\n`;\n\nexport const StyledOptionCheckmark = styled('span', {\n name: DSPaginationName,\n slot: PER_PAGE_SELECTOR_SLOTS.OPTION_CHECKMARK,\n})`\n display: grid;\n place-items: center;\n`;\n\nexport const StyledOptionLabel = styled('span', {\n name: DSPaginationName,\n slot: PER_PAGE_SELECTOR_SLOTS.OPTION_LABEL,\n})`\n /* labels wrap, they are never truncated (see stories/docs/principles/a11y/TextTruncationCriticalities.md) */\n white-space: normal;\n overflow-wrap: anywhere;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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A;AAAA;AAAA;AAKM,MAAM,wBAAoB,yBAAO,QAAQ;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM,yCAAwB;AAChC,CAAC;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -26,7 +26,16 @@ const SlotPropsAsObj = {
26
26
  dsPaginationPerPageSelector: { "aria-label": "just a typescript test" }
27
27
  };
28
28
  const SlotPropsAsFunctions = {
29
- dsPaginationPerPageSelector: () => ({ "aria-label": "just a typescript test" })
29
+ dsPaginationPerPageSelector: () => ({ "aria-label": "just a typescript test" }),
30
+ dsPaginationPerPageSelectorTriggerWrapper: () => ({ "aria-label": "just a typescript test" }),
31
+ dsPaginationPerPageSelectorFloatingWrapper: () => ({ "aria-label": "just a typescript test" }),
32
+ dsPaginationPerPageSelectorPanel: () => ({ "aria-label": "just a typescript test" }),
33
+ dsPaginationPerPageSelectorHeader: () => ({ "aria-label": "just a typescript test" }),
34
+ dsPaginationPerPageSelectorListWrapper: () => ({ "aria-label": "just a typescript test" }),
35
+ dsPaginationPerPageSelectorList: () => ({ "aria-label": "just a typescript test" }),
36
+ dsPaginationPerPageSelectorOption: () => ({ "aria-label": "just a typescript test" }),
37
+ dsPaginationPerPageSelectorOptionCheckmark: () => ({ "aria-label": "just a typescript test" }),
38
+ dsPaginationPerPageSelectorOptionLabel: () => ({ "aria-label": "just a typescript test" })
30
39
  };
31
40
  const EnsureAllSlotsExistInSlotFunctionArguments = SlotPropsAsFunctions;
32
41
  //# sourceMappingURL=slots-props.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPerPageSelector/typescript-testing/slots-props.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSPaginationName, PER_PAGE_SELECTOR_SLOTS } from '../constants/index.js';\nimport type { DSPerPageSelectorT } from '../react-desc-prop-types.js';\n\nconst SlotPropsAsObj: Partial<DSPerPageSelectorT.Props> = {\n dsPaginationPerPageSelector: { 'aria-label': 'just a typescript test' },\n};\nconst SlotPropsAsFunctions: DSPerPageSelectorT.SlotFunctionArguments = {\n dsPaginationPerPageSelector: () => ({ 'aria-label': 'just a typescript test' }),\n};\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSPaginationName, typeof PER_PAGE_SELECTOR_SLOTS>\n> = SlotPropsAsFunctions;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACMvB,MAAM,iBAAoD;AAAA,EACxD,6BAA6B,EAAE,cAAc,yBAAyB;AACxE;AACA,MAAM,uBAAiE;AAAA,EACrE,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAC/E;AACA,MAAM,6CAEF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\n\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { DSPaginationName, PER_PAGE_SELECTOR_SLOTS } from '../constants/index.js';\nimport type { DSPerPageSelectorT } from '../react-desc-prop-types.js';\n\nconst SlotPropsAsObj: Partial<DSPerPageSelectorT.Props> = {\n dsPaginationPerPageSelector: { 'aria-label': 'just a typescript test' },\n};\nconst SlotPropsAsFunctions: DSPerPageSelectorT.SlotFunctionArguments = {\n dsPaginationPerPageSelector: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorTriggerWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorFloatingWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorPanel: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorHeader: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorListWrapper: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorList: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorOption: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorOptionCheckmark: () => ({ 'aria-label': 'just a typescript test' }),\n dsPaginationPerPageSelectorOptionLabel: () => ({ 'aria-label': 'just a typescript test' }),\n};\nconst EnsureAllSlotsExistInSlotFunctionArguments: Required<\n TypescriptHelpersT.PropsForSlots<typeof DSPaginationName, typeof PER_PAGE_SELECTOR_SLOTS>\n> = SlotPropsAsFunctions;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACMvB,MAAM,iBAAoD;AAAA,EACxD,6BAA6B,EAAE,cAAc,yBAAyB;AACxE;AACA,MAAM,uBAAiE;AAAA,EACrE,6BAA6B,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC7E,2CAA2C,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC3F,4CAA4C,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC5F,kCAAkC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAClF,mCAAmC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnF,wCAAwC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACxF,iCAAiC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACjF,mCAAmC,OAAO,EAAE,cAAc,yBAAyB;AAAA,EACnF,4CAA4C,OAAO,EAAE,cAAc,yBAAyB;AAAA,EAC5F,wCAAwC,OAAO,EAAE,cAAc,yBAAyB;AAC1F;AACA,MAAM,6CAEF;",
6
6
  "names": []
7
7
  }
@@ -26,8 +26,10 @@ var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import__ = require("../index.js");
27
27
  const testRequiredProps = {};
28
28
  const testOptionalProps = {
29
- perPageOptions: [5, 10, 20]
29
+ perPageOptions: [5, 10, 20],
30
+ listWidth: 120
30
31
  };
32
+ const testOptionalPropsCssLength = { listWidth: "10rem" };
31
33
  const testPartialDefaults = {
32
34
  onPageSizeChange: () => null,
33
35
  perPageStep: 5
@@ -86,4 +88,61 @@ const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)
86
88
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSPerPageSelector, { ...testDefinitionAsConst }),
87
89
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.DSPerPageSelector, { pageSize: 10, onPageSizeChange: () => null, perPageStep: 5, minPerPage: 0, maxPerPage: 100 })
88
90
  ] });
91
+ const testOptionObject = { type: "single", dsId: "all", label: "All", value: 1e3 };
92
+ const testOptionObjectWithoutType = { dsId: "all", label: "All", value: 1e3 };
93
+ const testPerPageOptions = [
94
+ 10,
95
+ 20,
96
+ testOptionObject,
97
+ testOptionObjectWithoutType
98
+ ];
99
+ const testNoRender = {
100
+ dsId: "a",
101
+ label: "A",
102
+ value: 1,
103
+ // @ts-expect-error `render` is not part of the contract (it only worked because the dropdown got the options unchanged)
104
+ render: () => null
105
+ };
106
+ const testNoDisabled = {
107
+ dsId: "a",
108
+ label: "A",
109
+ value: 1,
110
+ // @ts-expect-error `disabled` is not part of the contract
111
+ disabled: true
112
+ };
113
+ const testNoApplyAriaDisabled = {
114
+ dsId: "a",
115
+ label: "A",
116
+ value: 1,
117
+ // @ts-expect-error `applyAriaDisabled` is not part of the contract
118
+ applyAriaDisabled: true
119
+ };
120
+ const testNoOnClick = {
121
+ dsId: "a",
122
+ label: "A",
123
+ value: 1,
124
+ // @ts-expect-error `onClick` is not part of the contract
125
+ onClick: () => null
126
+ };
127
+ const testNoGlobalAttributes = {
128
+ dsId: "a",
129
+ label: "A",
130
+ value: 1,
131
+ // @ts-expect-error global attributes are not part of the contract
132
+ "aria-label": "x"
133
+ };
134
+ const testNoXstyled = {
135
+ dsId: "a",
136
+ label: "A",
137
+ value: 1,
138
+ // @ts-expect-error xstyled props are not part of the contract
139
+ mt: "xs"
140
+ };
141
+ const testValueIsANumber = {
142
+ dsId: "a",
143
+ label: "A",
144
+ // @ts-expect-error the value is the number of rows
145
+ value: "many"
146
+ };
147
+ const testDsIdIsRequired = { label: "A", value: 1 };
89
148
  //# sourceMappingURL=typescript-testing.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/DSPerPageSelector/typescript-testing/typescript-testing.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSPerPageSelector } from '../index.js';\nimport type { DSPerPageSelectorT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSPerPageSelectorT.Props;\ntype ComponentPropsInternals = DSPerPageSelectorT.InternalProps;\ntype ComponentPropsDefaultProps = DSPerPageSelectorT.DefaultProps;\ntype ComponentPropsOptionalProps = DSPerPageSelectorT.OptionalProps;\ntype ComponentPropsRequiredProps = DSPerPageSelectorT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n perPageOptions: [5, 10, 20],\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n onPageSizeChange: () => null,\n perPageStep: 5,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n pageSize: 10,\n onPageSizeChange: () => null,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n pageSize: 10,\n onPageSizeChange: () => null,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n pageSize: 10,\n onPageSizeChange: () => null,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n pageSize: 10,\n onPageSizeChange: () => null,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSPerPageSelector {...testExplicitDefinition} />\n <DSPerPageSelector {...testInferedTypeCompatibility} />\n <DSPerPageSelector {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSPerPageSelector pageSize={10} onPageSizeChange={() => null} perPageStep={5} minPerPage={0} maxPerPage={100} />\n </>\n);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACoFrB;AAnFF,eAAkC;AAUlC,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,gBAAgB,CAAC,GAAG,IAAI,EAAE;AAC5B;AAIA,MAAM,sBAA2D;AAAA,EAC/D,kBAAkB,MAAM;AAAA,EACxB,aAAa;AACf;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AAAA,EACV,kBAAkB,MAAM;AAAA,EACxB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AACd;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,kBAAkB,MAAM;AAAA,EACxB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AACd;AAGA,MAAM,+BAA+B;AAAA,EACnC,UAAU;AAAA,EACV,kBAAkB,MAAM;AAAA,EACxB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AACd;AAEA,MAAM,wBAAwB;AAAA,EAC5B,UAAU;AAAA,EACV,kBAAkB,MAAM;AAAA,EACxB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AACd;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,8BAAmB,GAAG,wBAAwB;AAAA,EAC/C,4CAAC,8BAAmB,GAAG,8BAA8B;AAAA,EACrD,4CAAC,8BAAmB,GAAG,uBAAuB;AAAA,EAE9C,4CAAC,8BAAkB,UAAU,IAAI,kBAAkB,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,YAAY,KAAK;AAAA,GACjH;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { DSPerPageSelector } from '../index.js';\nimport type { DSPerPageSelectorT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSPerPageSelectorT.Props;\ntype ComponentPropsInternals = DSPerPageSelectorT.InternalProps;\ntype ComponentPropsDefaultProps = DSPerPageSelectorT.DefaultProps;\ntype ComponentPropsOptionalProps = DSPerPageSelectorT.OptionalProps;\ntype ComponentPropsRequiredProps = DSPerPageSelectorT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n perPageOptions: [5, 10, 20],\n listWidth: 120,\n};\nconst testOptionalPropsCssLength: ComponentPropsOptionalProps = { listWidth: '10rem' };\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n onPageSizeChange: () => null,\n perPageStep: 5,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n pageSize: 10,\n onPageSizeChange: () => null,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n pageSize: 10,\n onPageSizeChange: () => null,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n pageSize: 10,\n onPageSizeChange: () => null,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n pageSize: 10,\n onPageSizeChange: () => null,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <DSPerPageSelector {...testExplicitDefinition} />\n <DSPerPageSelector {...testInferedTypeCompatibility} />\n <DSPerPageSelector {...testDefinitionAsConst} />\n {/* works with inline values */}\n <DSPerPageSelector pageSize={10} onPageSizeChange={() => null} perPageStep={5} minPerPage={0} maxPerPage={100} />\n </>\n);\n\n// the contract of an option is closed: a number, or { type?: 'single', dsId, label, value } and nothing else.\n// What it inherited from the DSDropdownMenuV2 single item (render, disabled, applyAriaDisabled, onClick, onKeyDown,\n// global attributes, xstyled props) was never meant for consumers nor shown in the examples, and is not accepted.\n// Each @ts-expect-error sits right above the property it is about, so formatting can not detach it from its line.\nconst testOptionObject: DSPerPageSelectorT.PerPageOption = { type: 'single', dsId: 'all', label: 'All', value: 1000 };\nconst testOptionObjectWithoutType: DSPerPageSelectorT.PerPageOption = { dsId: 'all', label: 'All', value: 1000 };\nconst testPerPageOptions: ComponentPropsForApp['perPageOptions'] = [\n 10,\n 20,\n testOptionObject,\n testOptionObjectWithoutType,\n];\n\nconst testNoRender: DSPerPageSelectorT.PerPageOption = {\n dsId: 'a',\n label: 'A',\n value: 1,\n // @ts-expect-error `render` is not part of the contract (it only worked because the dropdown got the options unchanged)\n render: () => null,\n};\nconst testNoDisabled: DSPerPageSelectorT.PerPageOption = {\n dsId: 'a',\n label: 'A',\n value: 1,\n // @ts-expect-error `disabled` is not part of the contract\n disabled: true,\n};\nconst testNoApplyAriaDisabled: DSPerPageSelectorT.PerPageOption = {\n dsId: 'a',\n label: 'A',\n value: 1,\n // @ts-expect-error `applyAriaDisabled` is not part of the contract\n applyAriaDisabled: true,\n};\nconst testNoOnClick: DSPerPageSelectorT.PerPageOption = {\n dsId: 'a',\n label: 'A',\n value: 1,\n // @ts-expect-error `onClick` is not part of the contract\n onClick: () => null,\n};\nconst testNoGlobalAttributes: DSPerPageSelectorT.PerPageOption = {\n dsId: 'a',\n label: 'A',\n value: 1,\n // @ts-expect-error global attributes are not part of the contract\n 'aria-label': 'x',\n};\nconst testNoXstyled: DSPerPageSelectorT.PerPageOption = {\n dsId: 'a',\n label: 'A',\n value: 1,\n // @ts-expect-error xstyled props are not part of the contract\n mt: 'xs',\n};\nconst testValueIsANumber: DSPerPageSelectorT.PerPageOption = {\n dsId: 'a',\n label: 'A',\n // @ts-expect-error the value is the number of rows\n value: 'many',\n};\n// @ts-expect-error a `dsId` is required: it is the identity of the option\nconst testDsIdIsRequired: DSPerPageSelectorT.PerPageOption = { label: 'A', value: 1 };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACsFrB;AArFF,eAAkC;AAUlC,MAAM,oBAAiD,CAAC;AAExD,MAAM,oBAAiD;AAAA,EACrD,gBAAgB,CAAC,GAAG,IAAI,EAAE;AAAA,EAC1B,WAAW;AACb;AACA,MAAM,6BAA0D,EAAE,WAAW,QAAQ;AAIrF,MAAM,sBAA2D;AAAA,EAC/D,kBAAkB,MAAM;AAAA,EACxB,aAAa;AACf;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,UAAU;AAAA,EACV,kBAAkB,MAAM;AAAA,EACxB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AACd;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,UAAU;AAAA,EACV,kBAAkB,MAAM;AAAA,EACxB,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AACd;AAGA,MAAM,+BAA+B;AAAA,EACnC,UAAU;AAAA,EACV,kBAAkB,MAAM;A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AA,EACP,OAAO;AAAA;AAAA,EAEP,IAAI;AACN;AACA,MAAM,qBAAuD;AAAA,EAC3D,MAAM;AAAA,EACN,OAAO;AAAA;AAAA,EAEP,OAAO;AACT;AAEA,MAAM,qBAAuD,EAAE,OAAO,KAAK,OAAO,EAAE;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport type { DSDropdownMenuT } from '@elliemae/ds-dropdownmenu-v2';\n\nexport namespace DSPaginationT {\n // LEGACY WAY OF USING THE PAGINATION COMPONENT\n export interface DefaultProps {\n pageCount: number | string;\n isLoadingPageCount: boolean;\n pageIndex: number;\n canPreviousPage: boolean;\n canNextPage: boolean;\n pageSize: number;\n showPerPageSelector: boolean;\n perPageStep: number;\n minPerPage: number;\n maxPerPage: number;\n onPageSizeChange: (pageSize: number) => void;\n onPreviousPage: () => void;\n onNextPage: () => void;\n onPageChange: (page: number) => void;\n pageDetails: string[] | readonly string[];\n pageDetailsTitle: string;\n width: string | number;\n }\n export interface OptionalProps {\n perPageOptions?: (number | DSDropdownMenuT.ItemSingleOptions)[];\n }\n export interface RequiredProps {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSPaginationT.DefaultProps = {\n pageCount: 0,\n pageIndex: 1,\n isLoadingPageCount: false,\n canPreviousPage: true,\n canNextPage: true,\n pageSize: 10,\n showPerPageSelector: true,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n onPageSizeChange: () => null,\n onPreviousPage: () => null,\n onNextPage: () => null,\n onPageChange: () => null,\n pageDetails: [],\n pageDetailsTitle: '',\n width: '100%',\n};\n\nexport const DSPaginationPropTypes: DSPropTypesSchema<DSPaginationT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),\n pageCount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('How many pages are there'),\n pageSize: PropTypes.number.description('The current page size').defaultValue(10),\n canPreviousPage: PropTypes.bool.description('Whether the previous button is disabled or not').defaultValue(true),\n canNextPage: PropTypes.bool.description('Whether the next button is disabled or not').defaultValue(true),\n onPreviousPage: PropTypes.func\n .description('Function invoked when the previous button is pressed')\n .defaultValue(() => null),\n onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),\n onNextPage: PropTypes.func.description('Function invoked when next button is pressed').defaultValue(() => null),\n showPerPageSelector: PropTypes.bool.description('Whether to show the page selector').defaultValue(true),\n perPageOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.object]))\n .description('The available options for page size')\n .defaultValue([10]),\n minPerPage: PropTypes.number.description('Min for the per page options').defaultValue(0),\n maxPerPage: PropTypes.number.description('Max for the per page options').defaultValue(100),\n perPageStep: PropTypes.number.description('Step for the per page options').defaultValue(5),\n onPageSizeChange: PropTypes.func.description('Function invoked when the page size changes').defaultValue(() => null),\n pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),\n pageDetailsTitle: PropTypes.string\n .description('The title of the details (usually a column of your dataset)')\n .defaultValue(''),\n width: PropTypes.any.description('Width for the container of the pagination').defaultValue('100%'),\n isLoadingPageCount: PropTypes.bool.description('Whether the page count is loading or not').defaultValue(false),\n};\n\nexport const DSPaginationPropTypesSchema = DSPaginationPropTypes as unknown as ValidationMap<DSPaginationT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["import { globalAttributesPropTypes, PropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema, ValidationMap } from '@elliemae/ds-props-helpers';\nimport type { DSPerPageSelectorT } from './parts/DSPerPageSelector/react-desc-prop-types.js';\n\nexport namespace DSPaginationT {\n // LEGACY WAY OF USING THE PAGINATION COMPONENT\n export interface DefaultProps {\n pageCount: number | string;\n isLoadingPageCount: boolean;\n pageIndex: number;\n canPreviousPage: boolean;\n canNextPage: boolean;\n pageSize: number;\n showPerPageSelector: boolean;\n perPageStep: number;\n minPerPage: number;\n maxPerPage: number;\n onPageSizeChange: (pageSize: number) => void;\n onPreviousPage: () => void;\n onNextPage: () => void;\n onPageChange: (page: number) => void;\n pageDetails: string[] | readonly string[];\n pageDetailsTitle: string;\n width: string | number;\n }\n export interface OptionalProps {\n perPageOptions?: (number | DSPerPageSelectorT.PerPageOption)[];\n }\n export interface RequiredProps {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const defaultProps: DSPaginationT.DefaultProps = {\n pageCount: 0,\n pageIndex: 1,\n isLoadingPageCount: false,\n canPreviousPage: true,\n canNextPage: true,\n pageSize: 10,\n showPerPageSelector: true,\n perPageStep: 5,\n minPerPage: 0,\n maxPerPage: 100,\n onPageSizeChange: () => null,\n onPreviousPage: () => null,\n onNextPage: () => null,\n onPageChange: () => null,\n pageDetails: [],\n pageDetailsTitle: '',\n width: '100%',\n};\n\nexport const DSPaginationPropTypes: DSPropTypesSchema<DSPaginationT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n pageIndex: PropTypes.number.description('Index of the current page, starting from 1').defaultValue(1),\n pageCount: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('How many pages are there'),\n pageSize: PropTypes.number.description('The current page size').defaultValue(10),\n canPreviousPage: PropTypes.bool.description('Whether the previous button is disabled or not').defaultValue(true),\n canNextPage: PropTypes.bool.description('Whether the next button is disabled or not').defaultValue(true),\n onPreviousPage: PropTypes.func\n .description('Function invoked when the previous button is pressed')\n .defaultValue(() => null),\n onPageChange: PropTypes.func.description('Function invoked when the page changes').defaultValue(() => null),\n onNextPage: PropTypes.func.description('Function invoked when next button is pressed').defaultValue(() => null),\n showPerPageSelector: PropTypes.bool.description('Whether to show the page selector').defaultValue(true),\n perPageOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.object]))\n .description('The available options for page size')\n .defaultValue([10]),\n minPerPage: PropTypes.number.description('Min for the per page options').defaultValue(0),\n maxPerPage: PropTypes.number.description('Max for the per page options').defaultValue(100),\n perPageStep: PropTypes.number.description('Step for the per page options').defaultValue(5),\n onPageSizeChange: PropTypes.func.description('Function invoked when the page size changes').defaultValue(() => null),\n pageDetails: PropTypes.arrayOf(PropTypes.string).description('Details to provide for each page').defaultValue([]),\n pageDetailsTitle: PropTypes.string\n .description('The title of the details (usually a column of your dataset)')\n .defaultValue(''),\n width: PropTypes.any.description('Width for the container of the pagination').defaultValue('100%'),\n isLoadingPageCount: PropTypes.bool.description('Whether the page count is loading or not').defaultValue(false),\n};\n\nexport const DSPaginationPropTypesSchema = DSPaginationPropTypes as unknown as ValidationMap<DSPaginationT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAuE;AA+ChE,MAAM,eAA2C;AA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aAAa,CAAC;AAAA,EACvF,YAAY,kCAAU,OAAO,YAAY,8BAA8B,EAAE,aAAa,GAAG;AAAA,EACzF,aAAa,kCAAU,OAAO,YAAY,+BAA+B,EAAE,aAAa,CAAC;AAAA,EACzF,kBAAkB,kCAAU,KAAK,YAAY,6CAA6C,EAAE,aAAa,MAAM,IAAI;AAAA,EACnH,aAAa,kCAAU,QAAQ,kCAAU,MAAM,EAAE,YAAY,kCAAkC,EAAE,aAAa,CAAC,CAAC;AAAA,EAChH,kBAAkB,kCAAU,OACzB,YAAY,6DAA6D,EACzE,aAAa,EAAE;AAAA,EAClB,OAAO,kCAAU,IAAI,YAAY,2CAA2C,EAAE,aAAa,MAAM;AAAA,EACjG,oBAAoB,kCAAU,KAAK,YAAY,0CAA0C,EAAE,aAAa,KAAK;AAC/G;AAEO,MAAM,8BAA8B;",
6
6
  "names": []
7
7
  }
@@ -1,176 +1,20 @@
1
1
  import * as React from "react";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import React2, { useMemo } from "react";
4
- import { DSCircularIndeterminateIndicator } from "@elliemae/ds-circular-progress-indicator";
5
- import { Grid } from "@elliemae/ds-grid";
6
- import { ChevronDown } from "@elliemae/ds-icons";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
7
3
  import { describe } from "@elliemae/ds-props-helpers";
8
- import { DSTypography } from "@elliemae/ds-typography";
9
- import { DSPaginationSeparator } from "../DSPaginationSeparator/index.js";
10
- import { createPaginatorHeader } from "./config/createPaginatorHeader.js";
4
+ import React2 from "react";
11
5
  import { usePaginator } from "./config/usePaginator.js";
12
- import { DSPaginatorName, PAGINATOR_DATA_TESTID } from "./constants/index.js";
6
+ import { DSPaginatorName } from "./constants/index.js";
7
+ import { DSPaginatorContext } from "./DSPaginatorCTX.js";
8
+ import { Panel } from "./parts/Panel.js";
9
+ import { Trigger } from "./parts/Trigger.js";
13
10
  import { DSPaginatorPropTypesSchema } from "./react-desc-prop-types.js";
14
- import { InvisibleDiv, PaginationDropdownButtonPaginator, StyledDropdown, StyledPageInfo } from "./styled.js";
15
11
  const DSPaginator = (props) => {
16
- const {
17
- propsWithDefault: { pageIndex, pageCount, isLoadingPageCount, onPageChange, pageDetails, pageDetailsTitle },
18
- xstyledProps,
19
- globalAttributes,
20
- ownerPropsConfig,
21
- btnRef,
22
- btnWidth,
23
- pageInfoWidth,
24
- options,
25
- isOpened,
26
- actionRef,
27
- widestChildRef,
28
- pageInfoRef,
29
- checkMarkRef,
30
- checkMarkWidth,
31
- onKeyDown,
32
- setIsOpened
33
- } = usePaginator(props);
34
- const widestTypographyRef = React2.useRef(null);
35
- const Header = useMemo(
36
- () => createPaginatorHeader({ pageDetailsTitle, pageInfoWidth, ownerPropsConfig, checkMarkWidth }),
37
- [pageDetailsTitle, pageInfoWidth, ownerPropsConfig, checkMarkWidth]
38
- );
39
- const buttonOnClick = useMemo(() => {
40
- if (globalAttributes.onClick) return globalAttributes.onClick;
41
- return () => setIsOpened((prev) => !prev);
42
- }, [globalAttributes.onClick, setIsOpened]);
43
- return /* @__PURE__ */ jsxs(
44
- StyledDropdown,
45
- {
46
- isOpened,
47
- options,
48
- selectedOptions: { [pageIndex.toString()]: true },
49
- onOptionClick: (_, clickedOption) => {
50
- onPageChange(clickedOption.value);
51
- setIsOpened(false);
52
- btnRef.current?.focus();
53
- },
54
- onClickOutside: () => {
55
- setIsOpened(false);
56
- btnRef.current?.focus();
57
- },
58
- customOffset: [-(checkMarkWidth + 7), 2],
59
- startPlacementPreference: "top-start",
60
- actionRef,
61
- onKeyDown,
62
- minWidth: pageDetails.length !== 0 ? btnWidth + checkMarkWidth + 7 : (
63
- /**
64
- * Structure of the width:
65
- * 16px (left padding)
66
- * + chevronWidth (size of the chevron icon)
67
- * + 8px (spacing between chevron and text)
68
- * + pageCount length in ch
69
- * + 16px (right padding)
70
- * + a small scrollbar placeholder (to avoid text wrapping when scrollbars appear)
71
- * By using `calc()` + `ch` units, the component stays responsive to font-size changes
72
- * without requiring an extra ref to measure the page count text width.
73
- */
74
- `calc(${checkMarkWidth + 60}px + ${pageCount.toString().length}ch)`
75
- ),
76
- maxHeight: 300,
77
- HeaderComp: Header,
78
- children: [
79
- /* @__PURE__ */ jsx(
80
- PaginationDropdownButtonPaginator,
81
- {
82
- buttonType: "raw",
83
- disabled: isLoadingPageCount,
84
- innerRef: btnRef,
85
- "aria-pressed": isOpened,
86
- "aria-label": `Page ${pageIndex} out of ${pageCount}, ${pageDetails.length !== 0 ? pageDetails[pageIndex - 1] : "\b\b"}. Press to change the current page`,
87
- "data-testid": PAGINATOR_DATA_TESTID.PAGINATOR,
88
- ...globalAttributes,
89
- ...xstyledProps,
90
- ...ownerPropsConfig,
91
- onClick: buttonOnClick,
92
- children: /* @__PURE__ */ jsxs(Grid, { gutter: "xxxs", alignItems: "center", style: { gridAutoFlow: "column" }, children: [
93
- /* @__PURE__ */ jsxs(StyledPageInfo, { innerRef: pageInfoRef, children: [
94
- /* @__PURE__ */ jsx(
95
- DSTypography,
96
- {
97
- id: "typography-page-index",
98
- variant: "b1",
99
- as: "span",
100
- fontWeight: "semibold",
101
- textAlign: "start",
102
- children: pageIndex
103
- }
104
- ),
105
- /* @__PURE__ */ jsxs(
106
- DSTypography,
107
- {
108
- variant: "b1",
109
- as: "span",
110
- className: "typography-page-info-and-detail",
111
- children: [
112
- "/ ",
113
- pageCount
114
- ]
115
- }
116
- )
117
- ] }),
118
- isLoadingPageCount && /* @__PURE__ */ jsx(DSCircularIndeterminateIndicator, { ml: "xxxs", mr: "xxxs", size: "xs" }),
119
- pageDetails.length !== 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
120
- /* @__PURE__ */ jsx(DSPaginationSeparator, { height: "12px", ml: "12px", mr: "xxxs", ...ownerPropsConfig }),
121
- /* @__PURE__ */ jsx(
122
- DSTypography,
123
- {
124
- className: "typography-page-info-and-detail",
125
- innerRef: widestTypographyRef,
126
- mr: "xxs",
127
- variant: "b1",
128
- as: "span",
129
- fontWeight: "semibold",
130
- textAlign: "start",
131
- children: pageDetails[pageIndex - 1]
132
- }
133
- )
134
- ] }),
135
- /* @__PURE__ */ jsx(ChevronDown, { ml: "xxxs", color: ["brand-primary", "700"], innerRef: checkMarkRef })
136
- ] })
137
- }
138
- ),
139
- /* @__PURE__ */ jsx(Grid, { style: { position: "relative" }, children: pageDetails.map((pageDetail, index) => /* @__PURE__ */ jsx(
140
- InvisibleDiv,
141
- {
142
- innerRef: (el) => {
143
- if (!el) return;
144
- if (!widestChildRef.current) {
145
- widestChildRef.current = el;
146
- return;
147
- }
148
- if (el.offsetWidth > widestChildRef.current.offsetWidth) {
149
- widestChildRef.current = el;
150
- }
151
- if (index === pageDetails.length - 1) {
152
- widestTypographyRef.current?.style.setProperty("min-width", `${widestChildRef.current?.offsetWidth}px`);
153
- }
154
- },
155
- "data-testid": "ds-pagination-invisible-detail-for-width-calc",
156
- children: /* @__PURE__ */ jsx(
157
- DSTypography,
158
- {
159
- className: "typography-page-info-and-detail",
160
- mr: "xxs",
161
- variant: "b1",
162
- as: "span",
163
- fontWeight: "semibold",
164
- textAlign: "start",
165
- children: pageDetail
166
- }
167
- )
168
- },
169
- pageDetail
170
- )) })
171
- ]
172
- }
173
- );
12
+ const config = usePaginator(props);
13
+ const ctx = React2.useMemo(() => ({ ...config }), [config]);
14
+ return /* @__PURE__ */ jsxs(DSPaginatorContext.Provider, { value: ctx, children: [
15
+ /* @__PURE__ */ jsx(Trigger, {}),
16
+ /* @__PURE__ */ jsx(Panel, {})
17
+ ] });
174
18
  };
175
19
  DSPaginator.displayName = DSPaginatorName;
176
20
  const DSPaginatorWithSchema = describe(DSPaginator);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DSPaginator/DSPaginator.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport type { DSButtonT } from '@elliemae/ds-button-v2';\nimport { DSCircularIndeterminateIndicator } from '@elliemae/ds-circular-progress-indicator';\nimport { type DSDropdownMenuT } from '@elliemae/ds-dropdownmenu-v2';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ChevronDown } from '@elliemae/ds-icons';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { DSPaginationSeparator } from '../DSPaginationSeparator/index.js';\nimport { createPaginatorHeader } from './config/createPaginatorHeader.js';\nimport { usePaginator } from './config/usePaginator.js';\nimport { DSPaginatorName, PAGINATOR_DATA_TESTID } from './constants/index.js';\nimport { DSPaginatorPropTypesSchema, type DSPaginatorT } from './react-desc-prop-types.js';\nimport { InvisibleDiv, PaginationDropdownButtonPaginator, StyledDropdown, StyledPageInfo } from './styled.js';\n\nconst DSPaginator: React.ComponentType<DSPaginatorT.Props> = (props) => {\n const {\n propsWithDefault: { pageIndex, pageCount, isLoadingPageCount, onPageChange, pageDetails, pageDetailsTitle },\n xstyledProps,\n globalAttributes,\n ownerPropsConfig,\n btnRef,\n btnWidth,\n pageInfoWidth,\n options,\n isOpened,\n actionRef,\n widestChildRef,\n pageInfoRef,\n checkMarkRef,\n checkMarkWidth,\n onKeyDown,\n setIsOpened,\n } = usePaginator(props);\n\n const widestTypographyRef = React.useRef<HTMLDivElement>(null);\n\n const Header = useMemo(\n () => createPaginatorHeader({ pageDetailsTitle, pageInfoWidth, ownerPropsConfig, checkMarkWidth }),\n [pageDetailsTitle, pageInfoWidth, ownerPropsConfig, checkMarkWidth],\n );\n\n const buttonOnClick: DSButtonT.Props['onClick'] = useMemo(() => {\n if (globalAttributes.onClick) return globalAttributes.onClick as DSButtonT.Props['onClick'];\n return () => setIsOpened((prev) => !prev);\n }, [globalAttributes.onClick, setIsOpened]);\n\n return (\n <StyledDropdown\n isOpened={isOpened}\n options={options}\n selectedOptions={{ [pageIndex.toString()]: true }}\n onOptionClick={(_, clickedOption) => {\n onPageChange((clickedOption as DSDropdownMenuT.ItemSingleOptions).value as number);\n setIsOpened(false);\n btnRef.current?.focus();\n }}\n onClickOutside={() => {\n setIsOpened(false);\n btnRef.current?.focus();\n }}\n customOffset={[-(checkMarkWidth + 7), 2]}\n startPlacementPreference=\"top-start\"\n actionRef={actionRef}\n onKeyDown={onKeyDown}\n minWidth={\n pageDetails.length !== 0\n ? btnWidth + checkMarkWidth + 7\n : /**\n * Structure of the width:\n * 16px (left padding)\n * + chevronWidth (size of the chevron icon)\n * + 8px (spacing between chevron and text)\n * + pageCount length in ch\n * + 16px (right padding)\n * + a small scrollbar placeholder (to avoid text wrapping when scrollbars appear)\n * By using `calc()` + `ch` units, the component stays responsive to font-size changes\n * without requiring an extra ref to measure the page count text width.\n */\n\n `calc(${checkMarkWidth + 60}px + ${pageCount.toString().length}ch)`\n }\n maxHeight={300}\n HeaderComp={Header}\n >\n <PaginationDropdownButtonPaginator\n buttonType=\"raw\"\n disabled={isLoadingPageCount}\n innerRef={btnRef}\n aria-pressed={isOpened}\n aria-label={`Page ${pageIndex} out of ${pageCount}, ${\n pageDetails.length !== 0 ? pageDetails[pageIndex - 1] : '\\b\\b'\n }. Press to change the current page`}\n data-testid={PAGINATOR_DATA_TESTID.PAGINATOR}\n {...globalAttributes}\n {...xstyledProps}\n {...ownerPropsConfig}\n onClick={buttonOnClick}\n >\n <Grid gutter=\"xxxs\" alignItems=\"center\" style={{ gridAutoFlow: 'column' }}>\n <StyledPageInfo innerRef={pageInfoRef}>\n <DSTypography\n /**\n * Pagination uses DSTypography internally, but each typography variant defines\n * its own font-size. When these components are placed inside a styled() wrapper,\n * trying to style them via styled(DSTypography) triggers TypeScript errors\n * because DSTypography exposes \"as\" props and variant-specific overrides.\n *\n * Instead of wrapping DSTypography directly in styled(), we target the\n * underlying rendered elements via className/id. This avoids the TS conflicts\n * while still allowing us to override their font-size reliably.\n */\n id=\"typography-page-index\"\n variant=\"b1\"\n as=\"span\"\n fontWeight=\"semibold\"\n textAlign=\"start\"\n >\n {pageIndex}\n </DSTypography>\n <DSTypography\n variant=\"b1\"\n as=\"span\"\n /**\n * Pagination uses DSTypography internally, but each typography variant defines\n * its own font-size. When these components are placed inside a styled() wrapper,\n * trying to style them via styled(DSTypography) triggers TypeScript errors\n * because DSTypography exposes \"as\" props and variant-specific overrides.\n *\n * Instead of wrapping DSTypography directly in styled(), we target the\n * underlying rendered elements via className/id. This avoids the TS conflicts\n * while still allowing us to override their font-size reliably.\n */ className=\"typography-page-info-and-detail\"\n >\n / {pageCount}\n </DSTypography>\n </StyledPageInfo>\n {isLoadingPageCount && <DSCircularIndeterminateIndicator ml=\"xxxs\" mr=\"xxxs\" size=\"xs\" />}\n {pageDetails.length !== 0 && (\n <>\n <DSPaginationSeparator height=\"12px\" ml=\"12px\" mr=\"xxxs\" {...ownerPropsConfig} />\n <DSTypography\n className=\"typography-page-info-and-detail\"\n innerRef={widestTypographyRef}\n mr=\"xxs\"\n variant=\"b1\"\n as=\"span\"\n fontWeight=\"semibold\"\n textAlign=\"start\"\n >\n {pageDetails[pageIndex - 1]}\n </DSTypography>\n </>\n )}\n <ChevronDown ml=\"xxxs\" color={['brand-primary', '700']} innerRef={checkMarkRef} />\n </Grid>\n </PaginationDropdownButtonPaginator>\n {/* We calculate the length of the longest detail here (this is as per specs) */}\n <Grid style={{ position: 'relative' }}>\n {pageDetails.map((pageDetail, index) => (\n <InvisibleDiv\n innerRef={(el) => {\n if (!el) return;\n if (!widestChildRef.current) {\n widestChildRef.current = el;\n return;\n }\n if (el.offsetWidth > widestChildRef.current.offsetWidth) {\n widestChildRef.current = el;\n }\n if (index === pageDetails.length - 1) {\n widestTypographyRef.current?.style.setProperty('min-width', `${widestChildRef.current?.offsetWidth}px`);\n }\n }}\n data-testid=\"ds-pagination-invisible-detail-for-width-calc\"\n key={pageDetail}\n >\n <DSTypography\n className=\"typography-page-info-and-detail\"\n mr=\"xxs\"\n variant=\"b1\"\n as=\"span\"\n fontWeight=\"semibold\"\n textAlign=\"start\"\n >\n {pageDetail}\n </DSTypography>\n </InvisibleDiv>\n ))}\n </Grid>\n </StyledDropdown>\n );\n};\n\nDSPaginator.displayName = DSPaginatorName;\nconst DSPaginatorWithSchema = describe(DSPaginator);\nDSPaginatorWithSchema.propTypes = DSPaginatorPropTypesSchema;\n\nexport { DSPaginator, DSPaginatorWithSchema };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACqGX,SAsCA,UAtCA,KAmBA,YAnBA;AArGZ,OAAOA,UAAS,eAAe;AAE/B,SAAS,wCAAwC;AAEjD,SAAS,YAAY;AACrB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB,6BAA6B;AACvD,SAAS,kCAAqD;AAC9D,SAAS,cAAc,mCAAmC,gBAAgB,sBAAsB;AAEhG,MAAM,cAAuD,CAAC,UAAU;AACtE,QAAM;AAAA,IACJ,kBAAkB,EAAE,WAAW,WAAW,oBAAoB,cAAc,aAAa,iBAAiB;AAAA,IAC1G;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,aAAa,KAAK;AAEtB,QAAM,sBAAsBA,OAAM,OAAuB,IAAI;AAE7D,QAAM,SAAS;AAAA,IACb,MAAM,sBAAsB,EAAE,kBAAkB,eAAe,kBAAkB,eAAe,CAAC;AAAA,IACjG,CAAC,kBAAkB,eAAe,kBAAkB,cAAc;AAAA,EACpE;AAEA,QAAM,gBAA4C,QAAQ,MAAM;AAC9D,QAAI,iBAAiB,QAAS,QAAO,iBAAiB;AACtD,WAAO,MAAM,YAAY,CAAC,SAAS,CAAC,IAAI;AAAA,EAC1C,GAAG,CAAC,iBAAiB,SAAS,WAAW,CAAC;AAE1C,SACE;AAAA,IAAC;AAAA;A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AA,QAYP,CACD,GACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { describe } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { usePaginator } from './config/usePaginator.js';\nimport { DSPaginatorName } from './constants/index.js';\nimport { DSPaginatorContext, type DSPaginatorCTX } from './DSPaginatorCTX.js';\nimport { Panel } from './parts/Panel.js';\nimport { Trigger } from './parts/Trigger.js';\nimport { DSPaginatorPropTypesSchema, type DSPaginatorT } from './react-desc-prop-types.js';\n\n/**\n * A trigger (aria-haspopup=\"dialog\") that owns a non-modal dialog, positioned by the floating context, whose content is\n * a listbox of pages (virtualized with DSFastList). It replaced a DSDropdownMenuV2 based implementation keeping its\n * public contract; see KNOWN_INTENTIONAL_DEVIATIONS.md (package root) for the accepted deviations and the release notes for the behavior changes.\n */\nconst DSPaginator: React.ComponentType<DSPaginatorT.Props> = (props) => {\n const config = usePaginator(props);\n const ctx: DSPaginatorCTX = React.useMemo(() => ({ ...config }), [config]);\n\n return (\n <DSPaginatorContext.Provider value={ctx}>\n <Trigger />\n <Panel />\n </DSPaginatorContext.Provider>\n );\n};\n\nDSPaginator.displayName = DSPaginatorName;\nconst DSPaginatorWithSchema = describe(DSPaginator);\nDSPaginatorWithSchema.propTypes = DSPaginatorPropTypesSchema;\n\nexport { DSPaginator, DSPaginatorWithSchema };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACmBnB,SACE,KADF;AAnBJ,SAAS,gBAAgB;AACzB,OAAOA,YAAW;AAClB,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,0BAA+C;AACxD,SAAS,aAAa;AACtB,SAAS,eAAe;AACxB,SAAS,kCAAqD;AAO9D,MAAM,cAAuD,CAAC,UAAU;AACtE,QAAM,SAAS,aAAa,KAAK;AACjC,QAAM,MAAsBA,OAAM,QAAQ,OAAO,EAAE,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC;AAEzE,SACE,qBAAC,mBAAmB,UAAnB,EAA4B,OAAO,KAClC;AAAA,wBAAC,WAAQ;AAAA,IACT,oBAAC,SAAM;AAAA,KACT;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,wBAAwB,SAAS,WAAW;AAClD,sBAAsB,YAAY;",
6
6
  "names": ["React"]
7
7
  }