@recursica/mui-adapter 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/mui-adapter.cjs +74 -1
  3. package/dist/mui-adapter.cjs.map +1 -1
  4. package/dist/mui-adapter.css +1 -1
  5. package/dist/mui-adapter.js +6651 -201
  6. package/dist/mui-adapter.js.map +1 -1
  7. package/dist/src/components/Accordion/Accordion.d.ts +63 -2
  8. package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +9 -2
  9. package/dist/src/components/Autocomplete/Autocomplete.d.ts +17 -0
  10. package/dist/src/components/Autocomplete/index.d.ts +1 -0
  11. package/dist/src/components/Avatar/Avatar.d.ts +14 -2
  12. package/dist/src/components/Badge/Badge.d.ts +13 -3
  13. package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +10 -3
  14. package/dist/src/components/Button/Button.d.ts +1 -1
  15. package/dist/src/components/Card/Card.d.ts +40 -3
  16. package/dist/src/components/Checkbox/Checkbox.d.ts +15 -2
  17. package/dist/src/components/Checkbox/CheckboxGroup.d.ts +16 -0
  18. package/dist/src/components/Checkbox/index.d.ts +5 -1
  19. package/dist/src/components/Chip/Chip.d.ts +18 -2
  20. package/dist/src/components/Dropdown/Dropdown.d.ts +23 -3
  21. package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +10 -2
  22. package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +24 -2
  23. package/dist/src/components/HoverCard/HoverCard.d.ts +55 -3
  24. package/dist/src/components/Label/Label.d.ts +13 -2
  25. package/dist/src/components/Link/Link.d.ts +1 -1
  26. package/dist/src/components/Menu/Menu.d.ts +99 -3
  27. package/dist/src/components/Modal/Modal.d.ts +36 -2
  28. package/dist/src/components/NumberInput/NumberInput.d.ts +14 -2
  29. package/dist/src/components/Pagination/Pagination.d.ts +44 -2
  30. package/dist/src/components/Pagination/Pagination.icons.d.ts +8 -0
  31. package/dist/src/components/Panel/Panel.d.ts +65 -3
  32. package/dist/src/components/Radio/Radio.d.ts +13 -3
  33. package/dist/src/components/Radio/RadioGroup.d.ts +13 -0
  34. package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
  35. package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +7 -2
  36. package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +5 -0
  37. package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
  38. package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +28 -0
  39. package/dist/src/components/ReadOnlyField/index.d.ts +1 -0
  40. package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +31 -3
  41. package/dist/src/components/Slider/Slider.d.ts +28 -2
  42. package/dist/src/components/Stepper/Stepper.d.ts +21 -2
  43. package/dist/src/components/Switch/Switch.d.ts +10 -3
  44. package/dist/src/components/Switch/SwitchGroup.d.ts +13 -0
  45. package/dist/src/components/Tabs/Tabs.d.ts +35 -3
  46. package/dist/src/components/Text/Text.d.ts +1 -1
  47. package/dist/src/components/TextArea/TextArea.d.ts +18 -2
  48. package/dist/src/components/TextField/TextField.d.ts +16 -2
  49. package/dist/src/components/Timeline/Timeline.d.ts +14 -2
  50. package/dist/src/components/Timeline/TimelineItem.d.ts +29 -0
  51. package/dist/src/components/Title/Title.d.ts +1 -1
  52. package/dist/src/components/Toast/Toast.d.ts +25 -2
  53. package/dist/src/components/Tooltip/Tooltip.d.ts +42 -3
  54. package/dist/src/components/Typography/Typography.d.ts +1 -1
  55. package/dist/src/components/index.d.ts +1 -0
  56. package/package.json +12 -2
  57. package/src/GlobalExemptions.modules.css +13 -0
  58. package/src/components/Accordion/Accordion.module.css +295 -0
  59. package/src/components/Accordion/Accordion.stories.tsx +149 -21
  60. package/src/components/Accordion/Accordion.tsx +264 -4
  61. package/src/components/AssistiveElement/AssistiveElement.module.css +111 -0
  62. package/src/components/AssistiveElement/AssistiveElement.stories.tsx +76 -19
  63. package/src/components/AssistiveElement/AssistiveElement.tsx +85 -4
  64. package/src/components/Autocomplete/Autocomplete.module.css +325 -0
  65. package/src/components/Autocomplete/Autocomplete.stories.tsx +196 -0
  66. package/src/components/Autocomplete/Autocomplete.tsx +201 -0
  67. package/src/components/Autocomplete/index.ts +1 -0
  68. package/src/components/Avatar/Avatar.module.css +344 -0
  69. package/src/components/Avatar/Avatar.stories.tsx +94 -22
  70. package/src/components/Avatar/Avatar.tsx +110 -5
  71. package/src/components/Badge/Badge.module.css +127 -0
  72. package/src/components/Badge/Badge.stories.tsx +65 -22
  73. package/src/components/Badge/Badge.tsx +70 -5
  74. package/src/components/Breadcrumb/Breadcrumb.module.css +26 -0
  75. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +57 -22
  76. package/src/components/Breadcrumb/Breadcrumb.tsx +62 -5
  77. package/src/components/Button/Button.module.css +113 -20
  78. package/src/components/Button/Button.stories.tsx +3 -0
  79. package/src/components/Button/Button.tsx +10 -3
  80. package/src/components/Card/Card.module.css +118 -0
  81. package/src/components/Card/Card.stories.tsx +117 -19
  82. package/src/components/Card/Card.tsx +179 -4
  83. package/src/components/Checkbox/Checkbox.module.css +232 -0
  84. package/src/components/Checkbox/Checkbox.stories.tsx +81 -19
  85. package/src/components/Checkbox/Checkbox.tsx +146 -4
  86. package/src/components/Checkbox/CheckboxGroup.tsx +117 -0
  87. package/src/components/Checkbox/index.ts +6 -1
  88. package/src/components/Chip/Chip.module.css +236 -0
  89. package/src/components/Chip/Chip.stories.tsx +101 -21
  90. package/src/components/Chip/Chip.tsx +138 -5
  91. package/src/components/DatePicker/DatePicker.module.css +42 -0
  92. package/src/components/DatePicker/DatePicker.tsx +1 -0
  93. package/src/components/Dropdown/Dropdown.module.css +296 -0
  94. package/src/components/Dropdown/Dropdown.stories.tsx +80 -21
  95. package/src/components/Dropdown/Dropdown.tsx +182 -5
  96. package/src/components/FileInput/FileInput.module.css +47 -0
  97. package/src/components/FileInput/FileInput.tsx +1 -0
  98. package/src/components/FileUpload/FileUpload.module.css +40 -0
  99. package/src/components/FileUpload/FileUpload.tsx +1 -0
  100. package/src/components/FormControlLayout/FormControlLayout.module.css +92 -0
  101. package/src/components/FormControlLayout/FormControlLayout.stories.tsx +74 -19
  102. package/src/components/FormControlLayout/FormControlLayout.tsx +58 -4
  103. package/src/components/FormControlWrapper/FormControlWrapper.module.css +96 -0
  104. package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +122 -19
  105. package/src/components/FormControlWrapper/FormControlWrapper.tsx +145 -6
  106. package/src/components/HoverCard/HoverCard.module.css +91 -0
  107. package/src/components/HoverCard/HoverCard.stories.tsx +158 -21
  108. package/src/components/HoverCard/HoverCard.tsx +150 -4
  109. package/src/components/Label/Label.module.css +136 -0
  110. package/src/components/Label/Label.stories.tsx +98 -17
  111. package/src/components/Label/Label.tsx +88 -4
  112. package/src/components/Link/Link.module.css +8 -0
  113. package/src/components/Menu/Menu.module.css +287 -0
  114. package/src/components/Menu/Menu.stories.tsx +307 -21
  115. package/src/components/Menu/Menu.tsx +318 -4
  116. package/src/components/Modal/Modal.module.css +172 -0
  117. package/src/components/Modal/Modal.stories.tsx +66 -22
  118. package/src/components/Modal/Modal.tsx +216 -3
  119. package/src/components/NumberInput/NumberInput.module.css +281 -0
  120. package/src/components/NumberInput/NumberInput.stories.tsx +83 -20
  121. package/src/components/NumberInput/NumberInput.tsx +148 -5
  122. package/src/components/Pagination/Pagination.icons.tsx +66 -0
  123. package/src/components/Pagination/Pagination.module.css +307 -0
  124. package/src/components/Pagination/Pagination.stories.tsx +42 -21
  125. package/src/components/Pagination/Pagination.tsx +193 -4
  126. package/src/components/Panel/Panel.module.css +206 -0
  127. package/src/components/Panel/Panel.stories.tsx +214 -22
  128. package/src/components/Panel/Panel.tsx +153 -4
  129. package/src/components/Radio/Radio.module.css +220 -0
  130. package/src/components/Radio/Radio.stories.tsx +77 -19
  131. package/src/components/Radio/Radio.tsx +178 -4
  132. package/src/components/Radio/RadioGroup.tsx +111 -0
  133. package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
  134. package/src/components/ReadOnlyField/ReadOnlyField.module.css +54 -0
  135. package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +175 -16
  136. package/src/components/ReadOnlyField/ReadOnlyField.tsx +109 -4
  137. package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
  138. package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
  139. package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
  140. package/src/components/ReadOnlyField/index.ts +1 -0
  141. package/src/components/SegmentedControl/SegmentedControl.module.css +203 -0
  142. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +102 -20
  143. package/src/components/SegmentedControl/SegmentedControl.tsx +110 -5
  144. package/src/components/Slider/Slider.module.css +542 -0
  145. package/src/components/Slider/Slider.stories.tsx +157 -19
  146. package/src/components/Slider/Slider.tsx +282 -4
  147. package/src/components/Stepper/Stepper.module.css +410 -0
  148. package/src/components/Stepper/Stepper.stories.tsx +132 -19
  149. package/src/components/Stepper/Stepper.tsx +145 -5
  150. package/src/components/Switch/Switch.module.css +238 -0
  151. package/src/components/Switch/Switch.stories.tsx +98 -19
  152. package/src/components/Switch/Switch.tsx +153 -5
  153. package/src/components/Switch/SwitchGroup.tsx +111 -0
  154. package/src/components/Tabs/Tabs.module.css +422 -0
  155. package/src/components/Tabs/Tabs.stories.tsx +138 -19
  156. package/src/components/Tabs/Tabs.tsx +103 -5
  157. package/src/components/TextArea/TextArea.module.css +160 -0
  158. package/src/components/TextArea/TextArea.stories.tsx +80 -21
  159. package/src/components/TextArea/TextArea.tsx +156 -5
  160. package/src/components/TextField/TextField.module.css +266 -0
  161. package/src/components/TextField/TextField.stories.tsx +168 -15
  162. package/src/components/TextField/TextField.tsx +171 -5
  163. package/src/components/TimePicker/TimePicker.module.css +41 -0
  164. package/src/components/TimePicker/TimePicker.tsx +1 -0
  165. package/src/components/Timeline/Timeline.module.css +367 -0
  166. package/src/components/Timeline/Timeline.stories.tsx +114 -21
  167. package/src/components/Timeline/Timeline.tsx +80 -4
  168. package/src/components/Timeline/TimelineItem.tsx +101 -0
  169. package/src/components/Toast/Toast.module.css +170 -0
  170. package/src/components/Toast/Toast.stories.tsx +54 -22
  171. package/src/components/Toast/Toast.tsx +90 -4
  172. package/src/components/Tooltip/Tooltip.module.css +90 -0
  173. package/src/components/Tooltip/Tooltip.stories.tsx +152 -22
  174. package/src/components/Tooltip/Tooltip.tsx +114 -4
  175. package/src/components/TransferList/TransferList.module.css +38 -0
  176. package/src/components/TransferList/TransferList.tsx +1 -0
  177. package/src/components/index.ts +1 -0
@@ -0,0 +1,307 @@
1
+ /* EXEMPTIONS:
2
+ - All pagination subcomponent properties (active-pages, inactive-pages, navigation-controls) are ignored
3
+ because we are not implementing custom subcomponent styling for pagination. Instead, pagination items
4
+ directly inherit the unified, standard brand button components for complete UI/UX consistency, rendering
5
+ these generated subcomponent tokens redundant. */
6
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_border-size */
7
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_disabled-opacity */
8
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_elevation */
9
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_height */
10
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_horizontal-padding */
11
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_hover-color */
12
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_hover-elevation */
13
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_hover-opacity */
14
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_icon */
15
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_icon-text-gap */
16
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_max-label-width */
17
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_min-width */
18
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_text_font-family */
19
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_text_font-size */
20
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_text_font-style */
21
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_text_font-weight */
22
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_text_letter-spacing */
23
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_text_line-height */
24
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_text_text-decoration */
25
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_text_text-transform */
26
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_colors_background */
27
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_colors_border-color */
28
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_colors_icon-color */
29
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_colors_text */
30
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_active-pages_subcomponent_colors_text-hover */
31
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_border-size */
32
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_disabled-opacity */
33
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_elevation */
34
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_height */
35
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_horizontal-padding */
36
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_hover-color */
37
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_hover-elevation */
38
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_hover-opacity */
39
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_icon */
40
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_icon-text-gap */
41
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_max-label-width */
42
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_min-width */
43
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_text_font-family */
44
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_text_font-size */
45
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_text_font-style */
46
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_text_font-weight */
47
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_text_letter-spacing */
48
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_text_line-height */
49
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_text_text-decoration */
50
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_text_text-transform */
51
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_colors_background */
52
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_colors_border-color */
53
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_colors_icon-color */
54
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_colors_text */
55
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_inactive-pages_subcomponent_colors_text-hover */
56
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_border-size */
57
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_disabled-opacity */
58
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_elevation */
59
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_height */
60
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_horizontal-padding */
61
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_hover-color */
62
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_hover-elevation */
63
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_hover-opacity */
64
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_icon */
65
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_icon-text-gap */
66
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_max-label-width */
67
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_min-width */
68
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_text_font-family */
69
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_text_font-size */
70
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_text_font-style */
71
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_text_font-weight */
72
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_text_letter-spacing */
73
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_text_line-height */
74
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_text_text-decoration */
75
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_text_text-transform */
76
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_colors_background */
77
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_colors_border-color */
78
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_colors_icon-color */
79
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_colors_text */
80
+ /* recursica-ignore: --recursica_ui-kit_components_pagination_properties_navigation-controls_subcomponent_colors_text-hover */
81
+
82
+ .root {
83
+ display: flex;
84
+ align-items: center;
85
+ gap: var(--recursica_ui-kit_components_pagination_properties_item-gap);
86
+ }
87
+
88
+ .control {
89
+ box-sizing: border-box;
90
+ margin: 0;
91
+ border-style: solid;
92
+ position: relative;
93
+ transition: all 0.2s ease;
94
+ overflow: hidden;
95
+ display: inline-flex;
96
+ align-items: center;
97
+ justify-content: center;
98
+
99
+ /* Typography */
100
+ font-family: var(
101
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-family,
102
+ var(--recursica_brand_fonts_primary)
103
+ );
104
+ font-size: var(
105
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-size,
106
+ var(--recursica_brand_dimensions_text-size_default)
107
+ );
108
+ font-style: var(
109
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-style,
110
+ normal
111
+ );
112
+ font-weight: var(
113
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_text_font-weight,
114
+ 500
115
+ );
116
+ letter-spacing: var(
117
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_text_letter-spacing,
118
+ 0
119
+ );
120
+ line-height: var(
121
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_text_line-height,
122
+ 1.5
123
+ );
124
+ text-decoration: var(
125
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-decoration,
126
+ none
127
+ );
128
+ text-transform: var(
129
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_text_text-transform,
130
+ none
131
+ );
132
+
133
+ /* Dimensions */
134
+ border-radius: var(
135
+ --recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_default_properties_border-radius,
136
+ 4px
137
+ );
138
+ height: var(
139
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_height
140
+ );
141
+ min-width: var(
142
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_min-width
143
+ );
144
+ padding: 0
145
+ var(
146
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_horizontal-padding
147
+ );
148
+
149
+ /* Base Inactive Style: Outline */
150
+ border-width: var(
151
+ --recursica_ui-kit_components_button_variants_styles_outline_properties_border-size
152
+ );
153
+ box-shadow: var(
154
+ --recursica_ui-kit_components_button_variants_styles_outline_properties_elevation
155
+ );
156
+ background-color: var(
157
+ --recursica_ui-kit_components_button_variants_styles_outline_properties_colors_background
158
+ );
159
+ border-color: var(
160
+ --recursica_ui-kit_components_button_variants_styles_outline_properties_colors_border-color
161
+ );
162
+ color: var(
163
+ --recursica_ui-kit_components_button_variants_styles_outline_properties_colors_text
164
+ );
165
+ }
166
+
167
+ .control:disabled {
168
+ opacity: var(--recursica_brand_states_disabled);
169
+ cursor: not-allowed;
170
+ }
171
+
172
+ .control:hover:not(:disabled) {
173
+ color: var(
174
+ --recursica_ui-kit_components_button_variants_styles_outline_properties_colors_text-hover
175
+ );
176
+ }
177
+
178
+ /* Hover Overlay */
179
+ .control::after {
180
+ content: "";
181
+ position: absolute;
182
+ inset: 0;
183
+ border-radius: inherit;
184
+ z-index: 0;
185
+ pointer-events: none;
186
+ transition: opacity 150ms ease;
187
+ opacity: 0;
188
+ background-color: var(
189
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_hover-color
190
+ );
191
+ }
192
+
193
+ .control:hover:not(:disabled)::after {
194
+ opacity: var(
195
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_hover-opacity,
196
+ 0.1
197
+ );
198
+ }
199
+
200
+ /* Active Style: Solid */
201
+ .control[data-active] {
202
+ border-width: var(
203
+ --recursica_ui-kit_components_button_variants_styles_solid_properties_border-size
204
+ );
205
+ box-shadow: var(
206
+ --recursica_ui-kit_components_button_variants_styles_solid_properties_elevation
207
+ );
208
+ background-color: var(
209
+ --recursica_ui-kit_components_button_variants_styles_solid_properties_colors_background
210
+ );
211
+ border-color: var(
212
+ --recursica_ui-kit_components_button_variants_styles_solid_properties_colors_border-color
213
+ );
214
+ color: var(
215
+ --recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text
216
+ );
217
+ }
218
+
219
+ .control[data-active]:hover:not(:disabled) {
220
+ color: var(
221
+ --recursica_ui-kit_components_button_variants_styles_solid_properties_colors_text-hover
222
+ );
223
+ }
224
+
225
+ /* Navigation Style: Text */
226
+ .control[data-variant="text"] {
227
+ border-width: var(
228
+ --recursica_ui-kit_components_button_variants_styles_text_properties_border-size
229
+ );
230
+ box-shadow: var(
231
+ --recursica_ui-kit_components_button_variants_styles_text_properties_elevation
232
+ );
233
+ background-color: var(
234
+ --recursica_ui-kit_components_button_variants_styles_text_properties_colors_background
235
+ );
236
+ border-color: var(
237
+ --recursica_ui-kit_components_button_variants_styles_text_properties_colors_border-color
238
+ );
239
+ color: var(
240
+ --recursica_ui-kit_components_button_variants_styles_text_properties_colors_text
241
+ );
242
+
243
+ /* Also explicitly inherit navigation sizes incase they differ from pages */
244
+ border-radius: var(
245
+ --recursica_ui-kit_components_button_variants_content_icon-only_variants_sizes_default_properties_border-radius
246
+ );
247
+ height: var(
248
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_height
249
+ );
250
+ min-width: var(
251
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_min-width
252
+ );
253
+ padding: 0
254
+ var(
255
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_horizontal-padding
256
+ );
257
+ }
258
+
259
+ .control[data-variant="text"]:hover:not(:disabled) {
260
+ color: var(
261
+ --recursica_ui-kit_components_button_variants_styles_text_properties_colors_text-hover
262
+ );
263
+ }
264
+
265
+ /* Hover Overlay for Navigation */
266
+ .control[data-variant="text"]::after {
267
+ background-color: var(
268
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_hover-color
269
+ );
270
+ }
271
+ .control[data-variant="text"]:hover:not(:disabled)::after {
272
+ opacity: var(
273
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_hover-opacity,
274
+ 0.1
275
+ );
276
+ }
277
+
278
+ /* Dots */
279
+ .dots {
280
+ display: inline-flex;
281
+ align-items: center;
282
+ justify-content: center;
283
+ height: var(
284
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_height
285
+ );
286
+ min-width: var(
287
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_min-width
288
+ );
289
+ color: var(
290
+ --recursica_ui-kit_components_pagination_properties_colors_dots-color
291
+ );
292
+ }
293
+
294
+ /* Icon Styles */
295
+ .iconWithLabel {
296
+ display: flex;
297
+ align-items: center;
298
+ gap: var(
299
+ --recursica_ui-kit_components_button_variants_sizes_default_properties_icon-text-gap,
300
+ 4px
301
+ );
302
+ }
303
+
304
+ .baseIcon {
305
+ width: calc(var(--pagination-control-size) / 1.8);
306
+ height: calc(var(--pagination-control-size) / 1.8);
307
+ }
@@ -1,35 +1,56 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Pagination } from "./Pagination";
3
- import { ComingSoon } from "@recursica/storybook-template";
4
3
 
5
4
  const meta: Meta<typeof Pagination> = {
6
- title: "UI-Kit/🚧 Pagination",
5
+ title: "UI-Kit/Pagination",
7
6
  component: Pagination,
8
7
  tags: ["autodocs"],
9
- parameters: {
10
- controls: {
11
- include: [
12
- "layer",
13
- "withLayer",
14
- "children",
15
- "component",
16
- "variant",
17
- "size",
18
- "icon",
19
- "disabled",
20
- "href",
21
- "onClick",
22
- "onChange",
23
- "value",
24
- "checked",
25
- ],
8
+ argTypes: {
9
+ total: { control: "number" },
10
+ withEdges: { control: "boolean" },
11
+ withControls: { control: "boolean" },
12
+ disabled: { control: "boolean" },
13
+ withLabels: {
14
+ control: "boolean",
15
+ description: "Toggle text labels alongside icons",
26
16
  },
17
+ defaultChecked: { table: { disable: true } },
18
+ },
19
+ args: {
20
+ total: 10,
21
+ withEdges: false,
22
+ withControls: true,
23
+ withLabels: false,
24
+ },
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
26
+ render: ({ withLayer, layer, ...args }: any) => {
27
+ return <Pagination {...args} />;
27
28
  },
28
29
  };
29
30
 
30
31
  export default meta;
32
+
31
33
  type Story = StoryObj<typeof Pagination>;
32
34
 
33
- export const Default: Story = {
34
- render: () => <ComingSoon componentName="Pagination" />,
35
+ export const Default: Story = {};
36
+
37
+ export const WithEdges: Story = {
38
+ args: {
39
+ withEdges: true,
40
+ },
41
+ };
42
+
43
+ export const Compositional: Story = {
44
+ render: () => (
45
+ <Pagination.Root total={10}>
46
+ <Pagination.Items />
47
+ </Pagination.Root>
48
+ ),
49
+ };
50
+
51
+ export const WithTextLabels: Story = {
52
+ args: {
53
+ withEdges: true,
54
+ withLabels: true,
55
+ },
35
56
  };
@@ -1,7 +1,196 @@
1
- import React from "react";
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import React, { forwardRef } from "react";
3
+ import {
4
+ Pagination as MuiPagination,
5
+ type PaginationProps as MuiPaginationProps,
6
+ type PaginationRootProps as MuiPaginationRootProps,
7
+ } from "@mui/material";
8
+ import {
9
+ filterStylingProps,
10
+ type RecursicaOverStyled,
11
+ } from "../../utils/filterStylingProps";
12
+ import styles from "./Pagination.module.css";
13
+ import {
14
+ NextWithLabel,
15
+ PrevWithLabel,
16
+ FirstWithLabel,
17
+ LastWithLabel,
18
+ PaginationIcon,
19
+ } from "./Pagination.icons";
2
20
 
3
- export type PaginationProps = React.HTMLAttributes<HTMLDivElement>;
21
+ export type PaginationProps = RecursicaOverStyled<MuiPaginationProps> & {
22
+ /** If set to true, displays text labels alongside the icons for next/previous/first/last edges. */
23
+ withLabels?: boolean;
24
+ };
25
+
26
+ export type PaginationRootProps = RecursicaOverStyled<MuiPaginationRootProps>;
27
+
28
+ export type PaginationEdgeProps<T extends React.ElementType> =
29
+ React.ComponentProps<T> & {
30
+ /** If set to true, displays text labels alongside the icon. */
31
+ withLabel?: boolean;
32
+ icon?: any;
33
+ };
34
+
35
+ function usePaginationClassNames(restRecord: Record<string, unknown>): {
36
+ className: string;
37
+ classNames: Partial<Record<string, string>>;
38
+ } {
39
+ const mergedClassNames: Partial<Record<string, string>> = {
40
+ root: styles.root,
41
+ control: styles.control,
42
+ dots: styles.dots,
43
+ };
44
+
45
+ const classNamesProp = restRecord.classNames;
46
+ if (
47
+ classNamesProp &&
48
+ typeof classNamesProp === "object" &&
49
+ !Array.isArray(classNamesProp)
50
+ ) {
51
+ const o = classNamesProp as Partial<Record<string, string>>;
52
+ mergedClassNames.root = o.root ? `${styles.root} ${o.root}` : styles.root;
53
+ mergedClassNames.control = o.control
54
+ ? `${styles.control} ${o.control}`
55
+ : styles.control;
56
+ mergedClassNames.dots = o.dots ? `${styles.dots} ${o.dots}` : styles.dots;
57
+ }
58
+
59
+ const classNameProp = restRecord.className as string | undefined;
60
+ const finalClass = classNameProp
61
+ ? `${styles.root} ${classNameProp}`
62
+ : styles.root;
63
+
64
+ return { className: finalClass, classNames: mergedClassNames };
65
+ }
66
+
67
+ const _PaginationRoot = forwardRef<HTMLDivElement, PaginationRootProps>(
68
+ function PaginationRoot({ overStyled = false, ...rest }, ref) {
69
+ const sanitizedProps = filterStylingProps(rest, overStyled);
70
+ const stylingParams = usePaginationClassNames(
71
+ sanitizedProps as Record<string, unknown>,
72
+ );
73
+
74
+ return (
75
+ <div
76
+ ref={ref}
77
+ className={stylingParams.className}
78
+ classes={stylingParams.classNames}
79
+ {...(sanitizedProps as MuiPaginationRootProps)}
80
+ />
81
+ );
82
+ },
83
+ );
84
+ _PaginationRoot.displayName = "Pagination.Root";
4
85
 
5
- export const Pagination: React.FC<PaginationProps> = (props) => {
6
- return <div {...props}>Pagination</div>;
86
+ const _PaginationNext = forwardRef<
87
+ HTMLButtonElement,
88
+ PaginationEdgeProps<typeof MuiPagination.Next>
89
+ >(function PaginationNext({ withLabel, icon, ...props }, ref) {
90
+ const renderIcon = icon || (withLabel ? NextWithLabel : undefined);
91
+ return (
92
+ <div ref={ref} data-variant="text" icon={renderIcon as any} {...props} />
93
+ );
94
+ });
95
+ _PaginationNext.displayName = "Pagination.Next";
96
+
97
+ const _PaginationPrevious = forwardRef<
98
+ HTMLButtonElement,
99
+ PaginationEdgeProps<typeof MuiPagination.Previous>
100
+ >(function PaginationPrevious({ withLabel, icon, ...props }, ref) {
101
+ const renderIcon = icon || (withLabel ? PrevWithLabel : undefined);
102
+ return (
103
+ <div ref={ref} data-variant="text" icon={renderIcon as any} {...props} />
104
+ );
105
+ });
106
+ _PaginationPrevious.displayName = "Pagination.Previous";
107
+
108
+ const _PaginationFirst = forwardRef<
109
+ HTMLButtonElement,
110
+ PaginationEdgeProps<typeof MuiPagination.First>
111
+ >(function PaginationFirst({ withLabel, icon, ...props }, ref) {
112
+ const renderIcon = icon || (withLabel ? FirstWithLabel : undefined);
113
+ return (
114
+ <div ref={ref} data-variant="text" icon={renderIcon as any} {...props} />
115
+ );
116
+ });
117
+ _PaginationFirst.displayName = "Pagination.First";
118
+
119
+ const _PaginationLast = forwardRef<
120
+ HTMLButtonElement,
121
+ PaginationEdgeProps<typeof MuiPagination.Last>
122
+ >(function PaginationLast({ withLabel, icon, ...props }, ref) {
123
+ const renderIcon = icon || (withLabel ? LastWithLabel : undefined);
124
+ return (
125
+ <div ref={ref} data-variant="text" icon={renderIcon as any} {...props} />
126
+ );
127
+ });
128
+ _PaginationLast.displayName = "Pagination.Last";
129
+
130
+ const _Pagination = forwardRef<HTMLDivElement, PaginationProps>(
131
+ function Pagination(
132
+ { overStyled = false, getControlProps, withLabels, ...rest },
133
+ ref,
134
+ ) {
135
+ const sanitizedProps = filterStylingProps(rest, overStyled);
136
+ const stylingParams = usePaginationClassNames(
137
+ sanitizedProps as Record<string, unknown>,
138
+ );
139
+
140
+ const mergedGetControlProps = (
141
+ control: "first" | "previous" | "last" | "next",
142
+ ) => {
143
+ const baseProps = { "data-variant": "text" };
144
+ if (getControlProps) {
145
+ return { ...baseProps, ...getControlProps(control) };
146
+ }
147
+ return baseProps;
148
+ };
149
+
150
+ const labelsIcons = withLabels
151
+ ? {
152
+ nextIcon: NextWithLabel,
153
+ previousIcon: PrevWithLabel,
154
+ firstIcon: FirstWithLabel,
155
+ lastIcon: LastWithLabel,
156
+ }
157
+ : {};
158
+
159
+ return (
160
+ <MuiPagination
161
+ ref={ref}
162
+ className={stylingParams.className}
163
+ classes={stylingParams.classNames}
164
+ getControlProps={mergedGetControlProps}
165
+ {...labelsIcons}
166
+ {...(sanitizedProps as MuiPaginationProps)}
167
+ />
168
+ );
169
+ },
170
+ );
171
+ _Pagination.displayName = "Pagination";
172
+
173
+ /**
174
+ * Recursica Pagination component wrapping Mui's Pagination.
175
+ */
176
+ export const Pagination = _Pagination as typeof _Pagination & {
177
+ Root: typeof _PaginationRoot;
178
+ Items: typeof MuiPagination.Items;
179
+ Control: typeof MuiPagination.Control;
180
+ Dots: typeof MuiPagination.Dots;
181
+ Next: typeof _PaginationNext;
182
+ Previous: typeof _PaginationPrevious;
183
+ First: typeof _PaginationFirst;
184
+ Last: typeof _PaginationLast;
185
+ Icon: typeof PaginationIcon;
7
186
  };
187
+
188
+ Pagination.Root = _PaginationRoot;
189
+ Pagination.Items = MuiPagination.Items;
190
+ Pagination.Control = MuiPagination.Control;
191
+ Pagination.Dots = MuiPagination.Dots;
192
+ Pagination.Next = _PaginationNext;
193
+ Pagination.Previous = _PaginationPrevious;
194
+ Pagination.First = _PaginationFirst;
195
+ Pagination.Last = _PaginationLast;
196
+ Pagination.Icon = PaginationIcon;