rsuite 6.0.0-canary-20250622 → 6.0.0-canary-20250702

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 (298) hide show
  1. package/AutoComplete/styles/index.css +156 -161
  2. package/AvatarGroup/styles/index.css +1 -10
  3. package/Badge/styles/index.css +21 -21
  4. package/Button/styles/index.css +78 -63
  5. package/ButtonGroup/styles/index.css +15 -12
  6. package/ButtonToolbar/styles/index.css +1 -10
  7. package/CHANGELOG.md +9 -0
  8. package/Calendar/styles/index.css +92 -67
  9. package/Card/styles/index.css +7 -7
  10. package/CascadeTree/styles/index.css +8 -9
  11. package/Cascader/styles/index.css +160 -164
  12. package/CheckPicker/styles/index.css +173 -178
  13. package/CheckTree/styles/index.css +175 -180
  14. package/CheckTreePicker/styles/index.css +175 -180
  15. package/Checkbox/styles/index.css +21 -28
  16. package/CheckboxGroup/styles/index.css +1 -1
  17. package/DateInput/styles/index.css +8 -18
  18. package/DatePicker/styles/index.css +173 -168
  19. package/DateRangeInput/styles/index.css +8 -18
  20. package/DateRangePicker/styles/index.css +173 -168
  21. package/Dropdown/styles/index.css +110 -94
  22. package/IconButton/styles/index.css +95 -79
  23. package/InlineEdit/styles/index.css +12 -19
  24. package/Input/styles/index.css +8 -18
  25. package/InputGroup/styles/index.css +31 -38
  26. package/InputNumber/styles/index.css +115 -100
  27. package/InputPicker/styles/index.css +156 -161
  28. package/List/styles/index.css +10 -10
  29. package/Loader/styles/index.css +16 -16
  30. package/Menu/styles/index.css +2 -2
  31. package/Message/styles/index.css +2 -2
  32. package/MultiCascadeTree/styles/index.css +178 -191
  33. package/MultiCascader/styles/index.css +178 -200
  34. package/Nav/styles/index.css +162 -146
  35. package/Navbar/styles/index.css +140 -124
  36. package/NumberInput/styles/index.css +115 -100
  37. package/Pagination/styles/index.css +177 -200
  38. package/PasswordInput/styles/index.css +36 -43
  39. package/PinInput/styles/index.css +12 -22
  40. package/Radio/styles/index.css +22 -29
  41. package/RadioGroup/styles/index.css +11 -11
  42. package/SelectPicker/styles/index.css +156 -161
  43. package/Sidenav/styles/index.css +122 -129
  44. package/Stack/styles/index.css +1 -10
  45. package/Stat/styles/index.css +95 -79
  46. package/Steps/styles/index.css +26 -25
  47. package/Table/styles/index.css +11 -0
  48. package/Tabs/styles/index.css +162 -146
  49. package/Tag/styles/index.css +112 -96
  50. package/TagInput/styles/index.css +174 -179
  51. package/TagPicker/styles/index.css +174 -179
  52. package/TimePicker/styles/index.css +173 -168
  53. package/TimeRangePicker/styles/index.css +173 -168
  54. package/Toggle/styles/index.css +27 -30
  55. package/Tree/styles/index.css +157 -162
  56. package/TreePicker/styles/index.css +157 -162
  57. package/Uploader/styles/index.css +94 -65
  58. package/cjs/AutoComplete/AutoComplete.d.ts +1 -1
  59. package/cjs/AutoComplete/AutoComplete.js +1 -0
  60. package/cjs/Badge/Badge.js +16 -11
  61. package/cjs/Breadcrumb/Breadcrumb.d.ts +2 -2
  62. package/cjs/Button/Button.js +9 -7
  63. package/cjs/ButtonGroup/ButtonGroup.js +7 -7
  64. package/cjs/Card/Card.js +6 -6
  65. package/cjs/Checkbox/Checkbox.js +6 -7
  66. package/cjs/CheckboxGroup/CheckboxGroup.js +3 -4
  67. package/cjs/Dropdown/Dropdown.js +3 -4
  68. package/cjs/Dropdown/DropdownItem.js +4 -4
  69. package/cjs/Dropdown/DropdownMenu.js +9 -10
  70. package/cjs/FormControl/FormControl.d.ts +1 -1
  71. package/cjs/FormControlLabel/FormControlLabel.d.ts +1 -1
  72. package/cjs/FormHelpText/FormHelpText.d.ts +1 -1
  73. package/cjs/FormStack/FormStack.d.ts +0 -5
  74. package/cjs/FormStack/FormStack.js +1 -6
  75. package/cjs/IconButton/IconButton.d.ts +1 -1
  76. package/cjs/IconButton/IconButton.js +9 -9
  77. package/cjs/Image/Image.d.ts +1 -1
  78. package/cjs/InlineEdit/InlineEdit.js +3 -2
  79. package/cjs/InputGroup/InputGroup.js +12 -14
  80. package/cjs/InputGroup/InputGroupAddon.d.ts +2 -2
  81. package/cjs/InputPicker/InputAutosize.js +4 -6
  82. package/cjs/List/List.d.ts +1 -1
  83. package/cjs/List/List.js +7 -8
  84. package/cjs/List/ListItem.d.ts +2 -2
  85. package/cjs/List/ListItem.js +4 -4
  86. package/cjs/Loader/Loader.js +8 -7
  87. package/cjs/Menu/MenuSeparator.d.ts +2 -2
  88. package/cjs/Nav/Nav.d.ts +2 -2
  89. package/cjs/Nav/Nav.js +12 -13
  90. package/cjs/Nav/NavDropdownItem.js +4 -4
  91. package/cjs/Nav/NavDropdownMenu.js +10 -13
  92. package/cjs/Nav/NavItem.d.ts +2 -2
  93. package/cjs/Nav/NavItem.js +6 -8
  94. package/cjs/Navbar/Navbar.js +6 -6
  95. package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
  96. package/cjs/Navbar/NavbarDropdown.js +3 -4
  97. package/cjs/Navbar/NavbarDropdownItem.js +4 -4
  98. package/cjs/Navbar/NavbarDropdownMenu.js +8 -11
  99. package/cjs/NumberInput/NumberInput.d.ts +1 -1
  100. package/cjs/Pagination/Pagination.js +3 -2
  101. package/cjs/Pagination/PaginationButton.d.ts +3 -3
  102. package/cjs/Pagination/PaginationButton.js +9 -17
  103. package/cjs/Pagination/PaginationGroup.js +2 -1
  104. package/cjs/Panel/PanelHeader.d.ts +1 -1
  105. package/cjs/Progress/index.d.ts +1 -2
  106. package/cjs/Progress/index.js +0 -2
  107. package/cjs/Radio/Radio.js +6 -6
  108. package/cjs/RadioGroup/RadioGroup.js +4 -4
  109. package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
  110. package/cjs/Sidenav/Sidenav.js +3 -2
  111. package/cjs/Sidenav/SidenavDropdown.js +3 -5
  112. package/cjs/Sidenav/SidenavDropdownItem.js +4 -4
  113. package/cjs/Sidenav/SidenavDropdownMenu.js +10 -13
  114. package/cjs/Sidenav/SidenavItem.d.ts +2 -2
  115. package/cjs/Sidenav/SidenavItem.js +4 -5
  116. package/cjs/Slider/Handle.d.ts +1 -1
  117. package/cjs/Stack/Stack.d.ts +3 -21
  118. package/cjs/Stack/Stack.js +3 -28
  119. package/cjs/Stack/StackItem.d.ts +4 -5
  120. package/cjs/Stack/StackItem.js +4 -10
  121. package/cjs/Steps/StepItem.js +7 -8
  122. package/cjs/Steps/Steps.d.ts +2 -1
  123. package/cjs/Steps/Steps.js +32 -34
  124. package/cjs/Tabs/Tabs.js +1 -1
  125. package/cjs/Tag/Tag.js +5 -2
  126. package/cjs/Toggle/Toggle.d.ts +1 -1
  127. package/cjs/Toggle/Toggle.js +7 -6
  128. package/cjs/Tree/types.d.ts +2 -2
  129. package/cjs/Uploader/Uploader.d.ts +2 -2
  130. package/cjs/internals/Box/Box.d.ts +4 -38
  131. package/cjs/internals/Box/Box.js +3 -3
  132. package/cjs/internals/Box/index.d.ts +1 -1
  133. package/cjs/internals/Box/utils.d.ts +0 -9
  134. package/cjs/internals/Box/utils.js +22 -226
  135. package/cjs/internals/InputBase/InputBase.d.ts +1 -1
  136. package/cjs/internals/InputBase/InputBase.js +3 -2
  137. package/cjs/internals/Menu/MenuItem.js +1 -1
  138. package/cjs/internals/Overlay/Modal.d.ts +1 -1
  139. package/cjs/internals/Picker/PickerToggle.js +2 -4
  140. package/cjs/internals/SafeAnchor/SafeAnchor.d.ts +2 -2
  141. package/cjs/internals/Tree/TreeView.d.ts +2 -2
  142. package/cjs/internals/hooks/useCustom.js +24 -7
  143. package/cjs/internals/styled-system/css-alias.d.ts +7 -0
  144. package/cjs/internals/styled-system/css-alias.js +391 -0
  145. package/cjs/internals/styled-system/css-properties.d.ts +6 -0
  146. package/cjs/internals/styled-system/css-properties.js +30 -0
  147. package/cjs/internals/styled-system/index.d.ts +5 -0
  148. package/cjs/internals/styled-system/index.js +34 -0
  149. package/cjs/internals/styled-system/responsive.d.ts +26 -0
  150. package/cjs/internals/styled-system/responsive.js +118 -0
  151. package/cjs/internals/styled-system/types.d.ts +208 -0
  152. package/cjs/internals/styled-system/types.js +4 -0
  153. package/cjs/internals/{hooks → styled-system}/useStyled.d.ts +2 -6
  154. package/cjs/internals/{hooks → styled-system}/useStyled.js +24 -84
  155. package/cjs/internals/types/html.d.ts +6 -6
  156. package/cjs/internals/types/picker.d.ts +2 -2
  157. package/cjs/internals/types/sizes.d.ts +2 -1
  158. package/cjs/internals/utils/colours.d.ts +1 -1
  159. package/cjs/internals/utils/colours.js +4 -4
  160. package/cjs/internals/utils/sizes.d.ts +1 -0
  161. package/cjs/internals/utils/sizes.js +8 -1
  162. package/cjs/internals/utils/style-sheet/css.d.ts +6 -0
  163. package/cjs/internals/utils/style-sheet/css.js +35 -0
  164. package/cjs/internals/utils/style-sheet/index.d.ts +0 -1
  165. package/cjs/internals/utils/style-sheet/index.js +0 -6
  166. package/cjs/internals/utils/style-sheet/responsive.d.ts +15 -0
  167. package/cjs/internals/utils/style-sheet/responsive.js +19 -0
  168. package/cjs/useMediaQuery/breakpoints.d.ts +6 -6
  169. package/cjs/useMediaQuery/breakpoints.js +27 -31
  170. package/cjs/useMediaQuery/types.d.ts +2 -2
  171. package/cjs/useMediaQuery/useMediaQuery.js +3 -13
  172. package/dist/rsuite-no-reset.css +641 -655
  173. package/dist/rsuite-no-reset.min.css +1 -1
  174. package/dist/rsuite.css +641 -655
  175. package/dist/rsuite.js +128 -95
  176. package/dist/rsuite.js.map +1 -1
  177. package/dist/rsuite.min.css +1 -1
  178. package/dist/rsuite.min.js +1 -1
  179. package/dist/rsuite.min.js.map +1 -1
  180. package/esm/AutoComplete/AutoComplete.d.ts +1 -1
  181. package/esm/AutoComplete/AutoComplete.js +1 -0
  182. package/esm/Badge/Badge.js +16 -11
  183. package/esm/Breadcrumb/Breadcrumb.d.ts +2 -2
  184. package/esm/Button/Button.js +9 -7
  185. package/esm/ButtonGroup/ButtonGroup.js +7 -7
  186. package/esm/Card/Card.js +6 -6
  187. package/esm/Checkbox/Checkbox.js +6 -7
  188. package/esm/CheckboxGroup/CheckboxGroup.js +3 -4
  189. package/esm/Dropdown/Dropdown.js +3 -4
  190. package/esm/Dropdown/DropdownItem.js +4 -4
  191. package/esm/Dropdown/DropdownMenu.js +9 -10
  192. package/esm/FormControl/FormControl.d.ts +1 -1
  193. package/esm/FormControlLabel/FormControlLabel.d.ts +1 -1
  194. package/esm/FormHelpText/FormHelpText.d.ts +1 -1
  195. package/esm/FormStack/FormStack.d.ts +0 -5
  196. package/esm/FormStack/FormStack.js +2 -7
  197. package/esm/IconButton/IconButton.d.ts +1 -1
  198. package/esm/IconButton/IconButton.js +9 -9
  199. package/esm/Image/Image.d.ts +1 -1
  200. package/esm/InlineEdit/InlineEdit.js +3 -2
  201. package/esm/InputGroup/InputGroup.js +12 -14
  202. package/esm/InputGroup/InputGroupAddon.d.ts +2 -2
  203. package/esm/InputPicker/InputAutosize.js +4 -6
  204. package/esm/List/List.d.ts +1 -1
  205. package/esm/List/List.js +7 -8
  206. package/esm/List/ListItem.d.ts +2 -2
  207. package/esm/List/ListItem.js +4 -4
  208. package/esm/Loader/Loader.js +8 -7
  209. package/esm/Menu/MenuSeparator.d.ts +2 -2
  210. package/esm/Nav/Nav.d.ts +2 -2
  211. package/esm/Nav/Nav.js +12 -13
  212. package/esm/Nav/NavDropdownItem.js +4 -4
  213. package/esm/Nav/NavDropdownMenu.js +10 -13
  214. package/esm/Nav/NavItem.d.ts +2 -2
  215. package/esm/Nav/NavItem.js +6 -8
  216. package/esm/Navbar/Navbar.js +7 -7
  217. package/esm/Navbar/NavbarDropdown.d.ts +1 -1
  218. package/esm/Navbar/NavbarDropdown.js +3 -4
  219. package/esm/Navbar/NavbarDropdownItem.js +4 -4
  220. package/esm/Navbar/NavbarDropdownMenu.js +8 -11
  221. package/esm/NumberInput/NumberInput.d.ts +1 -1
  222. package/esm/Pagination/Pagination.js +3 -2
  223. package/esm/Pagination/PaginationButton.d.ts +3 -3
  224. package/esm/Pagination/PaginationButton.js +9 -16
  225. package/esm/Pagination/PaginationGroup.js +2 -1
  226. package/esm/Panel/PanelHeader.d.ts +1 -1
  227. package/esm/Progress/index.d.ts +1 -2
  228. package/esm/Progress/index.js +1 -2
  229. package/esm/Radio/Radio.js +6 -6
  230. package/esm/RadioGroup/RadioGroup.js +4 -4
  231. package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
  232. package/esm/Sidenav/Sidenav.js +3 -2
  233. package/esm/Sidenav/SidenavDropdown.js +3 -5
  234. package/esm/Sidenav/SidenavDropdownItem.js +4 -4
  235. package/esm/Sidenav/SidenavDropdownMenu.js +10 -13
  236. package/esm/Sidenav/SidenavItem.d.ts +2 -2
  237. package/esm/Sidenav/SidenavItem.js +4 -5
  238. package/esm/Slider/Handle.d.ts +1 -1
  239. package/esm/Stack/Stack.d.ts +3 -21
  240. package/esm/Stack/Stack.js +3 -28
  241. package/esm/Stack/StackItem.d.ts +4 -5
  242. package/esm/Stack/StackItem.js +5 -11
  243. package/esm/Steps/StepItem.js +7 -8
  244. package/esm/Steps/Steps.d.ts +2 -1
  245. package/esm/Steps/Steps.js +31 -34
  246. package/esm/Tabs/Tabs.js +1 -1
  247. package/esm/Tag/Tag.js +5 -2
  248. package/esm/Toggle/Toggle.d.ts +1 -1
  249. package/esm/Toggle/Toggle.js +7 -6
  250. package/esm/Tree/types.d.ts +2 -2
  251. package/esm/Uploader/Uploader.d.ts +2 -2
  252. package/esm/internals/Box/Box.d.ts +4 -38
  253. package/esm/internals/Box/Box.js +3 -3
  254. package/esm/internals/Box/index.d.ts +1 -1
  255. package/esm/internals/Box/utils.d.ts +0 -9
  256. package/esm/internals/Box/utils.js +20 -224
  257. package/esm/internals/InputBase/InputBase.d.ts +1 -1
  258. package/esm/internals/InputBase/InputBase.js +3 -2
  259. package/esm/internals/Menu/MenuItem.js +1 -1
  260. package/esm/internals/Overlay/Modal.d.ts +1 -1
  261. package/esm/internals/Picker/PickerToggle.js +2 -4
  262. package/esm/internals/SafeAnchor/SafeAnchor.d.ts +2 -2
  263. package/esm/internals/Tree/TreeView.d.ts +2 -2
  264. package/esm/internals/hooks/useCustom.js +24 -7
  265. package/esm/internals/styled-system/css-alias.d.ts +7 -0
  266. package/esm/internals/styled-system/css-alias.js +387 -0
  267. package/esm/internals/styled-system/css-properties.d.ts +6 -0
  268. package/esm/internals/styled-system/css-properties.js +26 -0
  269. package/esm/internals/styled-system/index.d.ts +5 -0
  270. package/esm/internals/styled-system/index.js +6 -0
  271. package/esm/internals/styled-system/responsive.d.ts +26 -0
  272. package/esm/internals/styled-system/responsive.js +110 -0
  273. package/esm/internals/styled-system/types.d.ts +208 -0
  274. package/esm/internals/styled-system/types.js +2 -0
  275. package/esm/internals/{hooks → styled-system}/useStyled.d.ts +2 -6
  276. package/esm/internals/{hooks → styled-system}/useStyled.js +20 -79
  277. package/esm/internals/types/html.d.ts +6 -6
  278. package/esm/internals/types/picker.d.ts +2 -2
  279. package/esm/internals/types/sizes.d.ts +2 -1
  280. package/esm/internals/utils/colours.d.ts +1 -1
  281. package/esm/internals/utils/colours.js +2 -2
  282. package/esm/internals/utils/sizes.d.ts +1 -0
  283. package/esm/internals/utils/sizes.js +6 -0
  284. package/esm/internals/utils/style-sheet/css.d.ts +6 -0
  285. package/esm/internals/utils/style-sheet/css.js +34 -0
  286. package/esm/internals/utils/style-sheet/index.d.ts +0 -1
  287. package/esm/internals/utils/style-sheet/index.js +1 -2
  288. package/esm/internals/utils/style-sheet/responsive.d.ts +15 -0
  289. package/esm/internals/utils/style-sheet/responsive.js +19 -0
  290. package/esm/useMediaQuery/breakpoints.d.ts +6 -6
  291. package/esm/useMediaQuery/breakpoints.js +27 -31
  292. package/esm/useMediaQuery/types.d.ts +2 -2
  293. package/esm/useMediaQuery/useMediaQuery.js +2 -12
  294. package/package.json +1 -1
  295. /package/cjs/internals/{utils/style-sheet → styled-system}/style-manager.d.ts +0 -0
  296. /package/cjs/internals/{utils/style-sheet → styled-system}/style-manager.js +0 -0
  297. /package/esm/internals/{utils/style-sheet → styled-system}/style-manager.d.ts +0 -0
  298. /package/esm/internals/{utils/style-sheet → styled-system}/style-manager.js +0 -0
@@ -0,0 +1,387 @@
1
+ 'use client';
2
+ import { getSizeValue, getColorValue } from "../utils/index.js";
3
+ const transformRadiusValue = value => getSizeValue('radius', value);
4
+ const transformShadowValue = value => getSizeValue('shadow', value);
5
+
6
+ /**
7
+ * CSS Property Alias
8
+ * This type maps all the CSS properties defined in cssSystemPropAlias to their corresponding React CSS types
9
+ */
10
+ export const cssSystemPropAlias = {
11
+ // — Spacing ————————————————————
12
+ p: {
13
+ type: 'any',
14
+ property: 'padding'
15
+ },
16
+ pt: {
17
+ type: 'any',
18
+ property: 'padding-top'
19
+ },
20
+ pr: {
21
+ type: 'any',
22
+ property: 'padding-right'
23
+ },
24
+ pb: {
25
+ type: 'any',
26
+ property: 'padding-bottom'
27
+ },
28
+ pl: {
29
+ type: 'any',
30
+ property: 'padding-left'
31
+ },
32
+ px: {
33
+ type: 'any',
34
+ property: 'padding-inline'
35
+ },
36
+ py: {
37
+ type: 'any',
38
+ property: 'padding-block'
39
+ },
40
+ ps: {
41
+ type: 'any',
42
+ property: 'padding-inline-start'
43
+ },
44
+ pe: {
45
+ type: 'any',
46
+ property: 'padding-inline-end'
47
+ },
48
+ m: {
49
+ type: 'any',
50
+ property: 'margin'
51
+ },
52
+ mt: {
53
+ type: 'any',
54
+ property: 'margin-top'
55
+ },
56
+ mr: {
57
+ type: 'any',
58
+ property: 'margin-right'
59
+ },
60
+ mb: {
61
+ type: 'any',
62
+ property: 'margin-bottom'
63
+ },
64
+ ml: {
65
+ type: 'any',
66
+ property: 'margin-left'
67
+ },
68
+ mx: {
69
+ type: 'any',
70
+ property: 'margin-inline'
71
+ },
72
+ my: {
73
+ type: 'any',
74
+ property: 'margin-block'
75
+ },
76
+ ms: {
77
+ type: 'any',
78
+ property: 'margin-inline-start'
79
+ },
80
+ me: {
81
+ type: 'any',
82
+ property: 'margin-inline-end'
83
+ },
84
+ // — Sizing ————————————————————
85
+ w: {
86
+ type: 'any',
87
+ property: 'width'
88
+ },
89
+ h: {
90
+ type: 'any',
91
+ property: 'height'
92
+ },
93
+ minw: {
94
+ type: 'any',
95
+ property: 'min-width'
96
+ },
97
+ maxw: {
98
+ type: 'any',
99
+ property: 'max-width'
100
+ },
101
+ minh: {
102
+ type: 'any',
103
+ property: 'min-height'
104
+ },
105
+ maxh: {
106
+ type: 'any',
107
+ property: 'max-height'
108
+ },
109
+ // — Layout & Position ————————————————————
110
+ display: {
111
+ type: 'any',
112
+ property: 'display'
113
+ },
114
+ pos: {
115
+ type: 'any',
116
+ property: 'position'
117
+ },
118
+ left: {
119
+ type: 'any',
120
+ property: 'left'
121
+ },
122
+ top: {
123
+ type: 'any',
124
+ property: 'top'
125
+ },
126
+ right: {
127
+ type: 'any',
128
+ property: 'right'
129
+ },
130
+ bottom: {
131
+ type: 'any',
132
+ property: 'bottom'
133
+ },
134
+ inset: {
135
+ type: 'any',
136
+ property: 'inset'
137
+ },
138
+ insetx: {
139
+ type: 'any',
140
+ property: 'inset-inline'
141
+ },
142
+ insety: {
143
+ type: 'any',
144
+ property: 'inset-block'
145
+ },
146
+ bsz: {
147
+ type: 'string',
148
+ property: 'box-sizing'
149
+ },
150
+ z: {
151
+ type: 'number',
152
+ property: 'z-index'
153
+ },
154
+ // — Background ————————————————————
155
+ bg: {
156
+ type: 'string',
157
+ property: 'background',
158
+ transformer: getColorValue
159
+ },
160
+ bgc: {
161
+ type: 'string',
162
+ property: 'background-color',
163
+ transformer: getColorValue
164
+ },
165
+ bgi: {
166
+ type: 'string',
167
+ property: 'background-image'
168
+ },
169
+ bga: {
170
+ type: 'string',
171
+ property: 'background-attachment'
172
+ },
173
+ bgp: {
174
+ type: 'string',
175
+ property: 'background-position'
176
+ },
177
+ bgsz: {
178
+ type: 'string',
179
+ property: 'background-size'
180
+ },
181
+ bgr: {
182
+ type: 'string',
183
+ property: 'background-repeat'
184
+ },
185
+ // — Typography ————————————————————
186
+ c: {
187
+ type: 'string',
188
+ property: 'color',
189
+ transformer: getColorValue
190
+ },
191
+ ff: {
192
+ type: 'string',
193
+ property: 'font-family'
194
+ },
195
+ fs: {
196
+ type: 'string',
197
+ property: 'font-size'
198
+ },
199
+ fw: {
200
+ type: 'string',
201
+ property: 'font-weight'
202
+ },
203
+ ta: {
204
+ type: 'string',
205
+ property: 'text-align'
206
+ },
207
+ tt: {
208
+ type: 'string',
209
+ property: 'text-transform'
210
+ },
211
+ td: {
212
+ type: 'string',
213
+ property: 'text-decoration'
214
+ },
215
+ tds: {
216
+ type: 'string',
217
+ property: 'text-decoration-style'
218
+ },
219
+ tdc: {
220
+ type: 'string',
221
+ property: 'text-decoration-color',
222
+ transformer: getColorValue
223
+ },
224
+ lts: {
225
+ type: 'string',
226
+ property: 'letter-spacing'
227
+ },
228
+ lh: {
229
+ type: 'any',
230
+ property: 'line-height'
231
+ },
232
+ // — Border ————————————————————
233
+ bd: {
234
+ type: 'string',
235
+ property: 'border'
236
+ },
237
+ bs: {
238
+ type: 'string',
239
+ property: 'border-style'
240
+ },
241
+ bc: {
242
+ type: 'string',
243
+ property: 'border-color',
244
+ transformer: getColorValue
245
+ },
246
+ bw: {
247
+ type: 'any',
248
+ property: 'border-width'
249
+ },
250
+ bdt: {
251
+ type: 'string',
252
+ property: 'border-top'
253
+ },
254
+ bdb: {
255
+ type: 'string',
256
+ property: 'border-bottom'
257
+ },
258
+ bdl: {
259
+ type: 'string',
260
+ property: 'border-left'
261
+ },
262
+ bdr: {
263
+ type: 'string',
264
+ property: 'border-right'
265
+ },
266
+ bdts: {
267
+ type: 'string',
268
+ property: 'border-top-style'
269
+ },
270
+ bdbs: {
271
+ type: 'string',
272
+ property: 'border-bottom-style'
273
+ },
274
+ bdls: {
275
+ type: 'string',
276
+ property: 'border-left-style'
277
+ },
278
+ bdrs: {
279
+ type: 'string',
280
+ property: 'border-right-style'
281
+ },
282
+ bdtc: {
283
+ type: 'string',
284
+ property: 'border-top-color',
285
+ transformer: getColorValue
286
+ },
287
+ bdbc: {
288
+ type: 'string',
289
+ property: 'border-bottom-color',
290
+ transformer: getColorValue
291
+ },
292
+ bdlc: {
293
+ type: 'string',
294
+ property: 'border-left-color',
295
+ transformer: getColorValue
296
+ },
297
+ bdrc: {
298
+ type: 'string',
299
+ property: 'border-right-color',
300
+ transformer: getColorValue
301
+ },
302
+ bdtw: {
303
+ type: 'any',
304
+ property: 'border-top-width'
305
+ },
306
+ bdbw: {
307
+ type: 'any',
308
+ property: 'border-bottom-width'
309
+ },
310
+ bdlw: {
311
+ type: 'any',
312
+ property: 'border-left-width'
313
+ },
314
+ bdrw: {
315
+ type: 'any',
316
+ property: 'border-right-width'
317
+ },
318
+ rounded: {
319
+ type: 'any',
320
+ property: 'border-radius',
321
+ transformer: transformRadiusValue
322
+ },
323
+ // — Shadow & Effects ————————————————————
324
+ shadow: {
325
+ type: 'any',
326
+ property: 'box-shadow',
327
+ transformer: transformShadowValue
328
+ },
329
+ opacity: {
330
+ type: 'any',
331
+ property: 'opacity'
332
+ },
333
+ // — Flex ————————————————————
334
+ gap: {
335
+ type: 'any',
336
+ property: 'gap'
337
+ },
338
+ spacing: {
339
+ type: 'any',
340
+ property: 'gap'
341
+ },
342
+ // alias for gap
343
+ rowgap: {
344
+ type: 'any',
345
+ property: 'row-gap'
346
+ },
347
+ colgap: {
348
+ type: 'any',
349
+ property: 'column-gap'
350
+ },
351
+ align: {
352
+ type: 'string',
353
+ property: 'align-items'
354
+ },
355
+ justify: {
356
+ type: 'string',
357
+ property: 'justify-content'
358
+ },
359
+ self: {
360
+ type: 'string',
361
+ property: 'align-self'
362
+ },
363
+ basis: {
364
+ type: 'any',
365
+ property: 'flex-basis'
366
+ },
367
+ flex: {
368
+ type: 'string',
369
+ property: 'flex'
370
+ },
371
+ grow: {
372
+ type: 'number',
373
+ property: 'flex-grow'
374
+ },
375
+ order: {
376
+ type: 'number',
377
+ property: 'order'
378
+ },
379
+ shrink: {
380
+ type: 'number',
381
+ property: 'flex-shrink'
382
+ },
383
+ direction: {
384
+ type: 'string',
385
+ property: 'flex-direction'
386
+ }
387
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * List of commonly used CSS properties in React components
3
+ * Focused on layout, spacing, typography, and common UI patterns
4
+ */
5
+ export declare const supportedCSSProperties: readonly ["display", "position", "top", "right", "bottom", "left", "zIndex", "boxSizing", "width", "height", "minWidth", "maxWidth", "minHeight", "maxHeight", "overflow", "overflowX", "overflowY", "aspectRatio", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "flex", "flexGrow", "flexShrink", "flexBasis", "flexDirection", "flexWrap", "justifyContent", "alignItems", "alignSelf", "alignContent", "gap", "rowGap", "columnGap", "order", "grid", "gridTemplate", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows", "gridArea", "gridColumn", "gridRow", "gridAutoFlow", "gridAutoColumns", "gridAutoRows", "color", "fontFamily", "fontSize", "fontWeight", "fontStyle", "lineHeight", "textAlign", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "wordWrap", "textOverflow", "letterSpacing", "background", "backgroundColor", "backgroundImage", "backgroundPosition", "backgroundSize", "backgroundRepeat", "border", "borderColor", "borderStyle", "borderWidth", "borderRadius", "borderTop", "borderRight", "borderBottom", "borderLeft", "boxShadow", "opacity", "transform", "transformOrigin", "transition", "transitionProperty", "transitionDuration", "transitionTimingFunction", "transitionDelay", "cursor", "pointerEvents", "userSelect", "visibility", "scrollBehavior", "scrollbarWidth", "scrollbarColor", "overscrollBehavior", "clipPath", "filter", "objectFit", "objectPosition", "resize"];
6
+ export type SupportedCSSProperty = (typeof supportedCSSProperties)[number];
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+ /**
3
+ * List of commonly used CSS properties in React components
4
+ * Focused on layout, spacing, typography, and common UI patterns
5
+ */
6
+ export const supportedCSSProperties = [
7
+ // Layout & Box Model
8
+ 'display', 'position', 'top', 'right', 'bottom', 'left', 'zIndex', 'boxSizing', 'width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight', 'overflow', 'overflowX', 'overflowY', 'aspectRatio',
9
+ // Spacing
10
+ 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft',
11
+ // Flexbox
12
+ 'flex', 'flexGrow', 'flexShrink', 'flexBasis', 'flexDirection', 'flexWrap', 'justifyContent', 'alignItems', 'alignSelf', 'alignContent', 'gap', 'rowGap', 'columnGap', 'order',
13
+ // Grid
14
+ 'grid', 'gridTemplate', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows', 'gridArea', 'gridColumn', 'gridRow', 'gridAutoFlow', 'gridAutoColumns', 'gridAutoRows',
15
+ // Typography
16
+ 'color', 'fontFamily', 'fontSize', 'fontWeight', 'fontStyle', 'lineHeight', 'textAlign', 'textDecoration', 'textTransform', 'whiteSpace', 'wordBreak', 'wordWrap', 'textOverflow', 'letterSpacing',
17
+ // Background & Borders
18
+ 'background', 'backgroundColor', 'backgroundImage', 'backgroundPosition', 'backgroundSize', 'backgroundRepeat', 'border', 'borderColor', 'borderStyle', 'borderWidth', 'borderRadius', 'borderTop', 'borderRight', 'borderBottom', 'borderLeft', 'boxShadow', 'opacity',
19
+ // Transforms & Transitions
20
+ 'transform', 'transformOrigin', 'transition', 'transitionProperty', 'transitionDuration', 'transitionTimingFunction', 'transitionDelay',
21
+ // Interactivity
22
+ 'cursor', 'pointerEvents', 'userSelect', 'visibility',
23
+ // Scroll
24
+ 'scrollBehavior', 'scrollbarWidth', 'scrollbarColor', 'overscrollBehavior',
25
+ // Other
26
+ 'clipPath', 'filter', 'objectFit', 'objectPosition', 'resize'];
@@ -0,0 +1,5 @@
1
+ export * from './responsive';
2
+ export * from './useStyled';
3
+ export * from './style-manager';
4
+ export * from './css-alias';
5
+ export * from './types';
@@ -0,0 +1,6 @@
1
+ 'use client';
2
+ export * from "./responsive.js";
3
+ export * from "./useStyled.js";
4
+ export * from "./style-manager.js";
5
+ export * from "./css-alias.js";
6
+ export * from "./types.js";
@@ -0,0 +1,26 @@
1
+ import type { Breakpoints, ResponsiveValue, WithResponsive } from '../types';
2
+ /**
3
+ * Breakpoint values in pixels - matching SCSS variables
4
+ * These values are used for responsive design across the application.
5
+ * They follow a mobile-first approach where 'xs' is the base breakpoint.
6
+ */
7
+ export declare const breakpointValues: Record<Breakpoints, number>;
8
+ /**
9
+ * Checks if a value is a responsive value object
10
+ * @param value - Value to check
11
+ * @returns True if the value is a responsive value object
12
+ */
13
+ export declare function isResponsiveValue(value: any): value is ResponsiveValue<any>;
14
+ /**
15
+ * Process a value that might be a responsive value
16
+ * @param value - Value to process
17
+ * @param processor - Function to process non-responsive values
18
+ * @returns Processed value or responsive object with processed values
19
+ */
20
+ export declare function processResponsiveValue<T, R extends string | number | undefined>(value: T | ResponsiveValue<T> | undefined, processor: (val: T) => R): R | ResponsiveValue<R> | undefined;
21
+ type CSSVarValue = WithResponsive<string | number | undefined>;
22
+ /**
23
+ * Converts layout properties to CSS variables with abbreviated names
24
+ */
25
+ export declare const getCSSVariables: (props: Record<string, any>, prefix?: string) => Record<string, CSSVarValue>;
26
+ export {};
@@ -0,0 +1,110 @@
1
+ 'use client';
2
+ import camelCase from 'lodash/camelCase';
3
+ import kebabCase from 'lodash/kebabCase';
4
+ import { getCssValue, isCSSProperty } from "../utils/index.js";
5
+ import { BREAKPOINTS } from "../constants/index.js";
6
+ import { cssSystemPropAlias } from "./css-alias.js";
7
+ /**
8
+ * Breakpoint values in pixels - matching SCSS variables
9
+ * These values are used for responsive design across the application.
10
+ * They follow a mobile-first approach where 'xs' is the base breakpoint.
11
+ */
12
+ export const breakpointValues = {
13
+ xs: 0,
14
+ // Base mobile first
15
+ sm: 576,
16
+ // $screen-sm
17
+ md: 768,
18
+ // $screen-md
19
+ lg: 992,
20
+ // $screen-lg
21
+ xl: 1200,
22
+ // $screen-xl
23
+ xxl: 1400,
24
+ // $screen-xxl
25
+ '2xl': 1400 // Alias for xxl for compatibility
26
+ };
27
+
28
+ /**
29
+ * Checks if a value is a responsive value object
30
+ * @param value - Value to check
31
+ * @returns True if the value is a responsive value object
32
+ */
33
+ export function isResponsiveValue(value) {
34
+ return value !== null && typeof value === 'object' && !Array.isArray(value) && Object.keys(value).some(key => BREAKPOINTS.includes(key));
35
+ }
36
+
37
+ /**
38
+ * Process a value that might be a responsive value
39
+ * @param value - Value to process
40
+ * @param processor - Function to process non-responsive values
41
+ * @returns Processed value or responsive object with processed values
42
+ */
43
+ export function processResponsiveValue(value, processor) {
44
+ if (value === undefined) {
45
+ return undefined;
46
+ }
47
+ if (isResponsiveValue(value)) {
48
+ const result = {};
49
+ Object.entries(value).forEach(([breakpoint, val]) => {
50
+ if (val !== undefined) {
51
+ const processed = processor(val);
52
+ if (processed !== undefined) {
53
+ result[breakpoint] = processed;
54
+ }
55
+ }
56
+ });
57
+ return Object.keys(result).length > 0 ? result : undefined;
58
+ }
59
+ return processor(value);
60
+ }
61
+
62
+ // Type for CSS variable values that can be string, number, or responsive values
63
+
64
+ const transformCSSValue = (value, type) => {
65
+ if (type === 'number') {
66
+ return value;
67
+ }
68
+ return getCssValue(value);
69
+ };
70
+
71
+ /**
72
+ * Converts layout properties to CSS variables with abbreviated names
73
+ */
74
+ export const getCSSVariables = (props, prefix = `--rs-`) => {
75
+ const cssVars = {};
76
+ const cssVar = name => `${prefix}${kebabCase(name)}`;
77
+ const getCSSProperty = name => {
78
+ let cssName = name;
79
+ let cssProp = cssSystemPropAlias[name];
80
+ if (!cssProp) {
81
+ Object.entries(cssSystemPropAlias).forEach(([key, prop]) => {
82
+ if (camelCase(prop.property) === name) {
83
+ cssProp = prop;
84
+ cssName = key;
85
+ }
86
+ });
87
+ }
88
+ return [cssName, cssProp];
89
+ };
90
+ Object.entries(props).forEach(([name, value]) => {
91
+ if (typeof value === 'undefined') {
92
+ return;
93
+ }
94
+ const [cssName, cssProp] = getCSSProperty(name);
95
+ const varName = cssVar(cssName);
96
+ if (cssProp) {
97
+ const {
98
+ transformer,
99
+ type
100
+ } = cssProp;
101
+ cssVars[varName] = processResponsiveValue(value, val => {
102
+ return transformer ? transformer(val) : transformCSSValue(val, type);
103
+ });
104
+ } else if (isCSSProperty(cssName)) {
105
+ // For non-predefined CSS properties, directly process with getCssValue
106
+ cssVars[varName] = processResponsiveValue(value, val => getCssValue(val));
107
+ }
108
+ });
109
+ return cssVars;
110
+ };