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,208 @@
1
+ import { CSSProperties as CSS } from 'react';
2
+ import { supportedCSSProperties } from './css-properties';
3
+ import type { WithResponsive, ColorScheme, Size } from '../types';
4
+ export type CSSPropertyValueType = 'string' | 'number' | 'any';
5
+ export type CSSProperty = {
6
+ /**
7
+ * CSS Property Type
8
+ */
9
+ type: CSSPropertyValueType;
10
+ /**
11
+ * CSS Property
12
+ */
13
+ property: string;
14
+ /**
15
+ * Value Transformer
16
+ */
17
+ transformer?: (value: any) => any;
18
+ };
19
+ export type SupportedCSSProperty = (typeof supportedCSSProperties)[number];
20
+ type MakeResponsive<T> = {
21
+ [K in keyof T]?: T[K] | WithResponsive<T[K]>;
22
+ };
23
+ export type StandardCSSProps = MakeResponsive<Pick<CSS, SupportedCSSProperty>>;
24
+ /**
25
+ * CSS Properties type for Box component
26
+ * This type maps all the CSS properties defined in cssSystemPropAlias to their corresponding React CSS types
27
+ */
28
+ export interface CSSSystemProps extends StandardCSSProps {
29
+ /** Shorthand for CSS property `padding` */
30
+ p?: WithResponsive<CSS['padding']>;
31
+ /** Shorthand for CSS property `paddingTop` */
32
+ pt?: WithResponsive<CSS['paddingTop']>;
33
+ /** Shorthand for CSS property `paddingRight` */
34
+ pr?: WithResponsive<CSS['paddingRight']>;
35
+ /** Shorthand for CSS property `paddingBottom` */
36
+ pb?: WithResponsive<CSS['paddingBottom']>;
37
+ /** Shorthand for CSS property `paddingLeft` */
38
+ pl?: WithResponsive<CSS['paddingLeft']>;
39
+ /** Shorthand for CSS property `paddingInline` */
40
+ px?: WithResponsive<CSS['paddingInline']>;
41
+ /** Shorthand for CSS property `paddingBlock` */
42
+ py?: WithResponsive<CSS['paddingBlock']>;
43
+ /** Shorthand for CSS property `paddingInlineStart` */
44
+ ps?: WithResponsive<CSS['paddingInlineStart']>;
45
+ /** Shorthand for CSS property `paddingInlineEnd` */
46
+ pe?: WithResponsive<CSS['paddingInlineEnd']>;
47
+ /** Shorthand for CSS property `margin` */
48
+ m?: WithResponsive<CSS['margin']>;
49
+ /** Shorthand for CSS property `marginTop` */
50
+ mt?: WithResponsive<CSS['marginTop']>;
51
+ /** Shorthand for CSS property `marginRight` */
52
+ mr?: WithResponsive<CSS['marginRight']>;
53
+ /** Shorthand for CSS property `marginBottom` */
54
+ mb?: WithResponsive<CSS['marginBottom']>;
55
+ /** Shorthand for CSS property `marginLeft` */
56
+ ml?: WithResponsive<CSS['marginLeft']>;
57
+ /** Shorthand for CSS property `marginInline` */
58
+ mx?: WithResponsive<CSS['marginInline']>;
59
+ /** Shorthand for CSS property `marginBlock` */
60
+ my?: WithResponsive<CSS['marginBlock']>;
61
+ /** Shorthand for CSS property `marginInlineStart` */
62
+ ms?: WithResponsive<CSS['marginInlineStart']>;
63
+ /** Shorthand for CSS property `marginInlineEnd` */
64
+ me?: WithResponsive<CSS['marginInlineEnd']>;
65
+ /** Shorthand for CSS property `width` */
66
+ w?: WithResponsive<CSS['width']>;
67
+ /** Shorthand for CSS property `height` */
68
+ h?: WithResponsive<CSS['height']>;
69
+ /** Shorthand for CSS property `minWidth` */
70
+ minw?: WithResponsive<CSS['minWidth']>;
71
+ /** Shorthand for CSS property `maxWidth` */
72
+ maxw?: WithResponsive<CSS['maxWidth']>;
73
+ /** Shorthand for CSS property `minHeight` */
74
+ minh?: WithResponsive<CSS['minHeight']>;
75
+ /** Shorthand for CSS property `maxHeight` */
76
+ maxh?: WithResponsive<CSS['maxHeight']>;
77
+ /** Shorthand for CSS property `display` */
78
+ display?: WithResponsive<CSS['display']>;
79
+ /** Shorthand for CSS property `position` */
80
+ pos?: WithResponsive<CSS['position']>;
81
+ /** Shorthand for CSS property `left` */
82
+ left?: WithResponsive<CSS['left']>;
83
+ /** Shorthand for CSS property `top` */
84
+ top?: WithResponsive<CSS['top']>;
85
+ /** Shorthand for CSS property `right` */
86
+ right?: WithResponsive<CSS['right']>;
87
+ /** Shorthand for CSS property `bottom` */
88
+ bottom?: WithResponsive<CSS['bottom']>;
89
+ /** Shorthand for CSS property `inset` */
90
+ inset?: WithResponsive<CSS['inset']>;
91
+ /** Shorthand for CSS property `insetInline` */
92
+ insetx?: WithResponsive<CSS['insetInline']>;
93
+ /** Shorthand for CSS property `insetBlock` */
94
+ insety?: WithResponsive<CSS['insetBlock']>;
95
+ /** Shorthand for CSS property `boxSizing` */
96
+ bsz?: WithResponsive<CSS['boxSizing']>;
97
+ /** Shorthand for CSS property `zIndex` */
98
+ z?: WithResponsive<CSS['zIndex']>;
99
+ /** Shorthand for CSS property `background` */
100
+ bg?: WithResponsive<ColorScheme | CSS['background']>;
101
+ /** Shorthand for CSS property `backgroundColor` */
102
+ bgc?: WithResponsive<ColorScheme | CSS['backgroundColor']>;
103
+ /** Shorthand for CSS property `backgroundImage` */
104
+ bgi?: WithResponsive<CSS['backgroundImage']>;
105
+ /** Shorthand for CSS property `backgroundAttachment` */
106
+ bga?: WithResponsive<CSS['backgroundAttachment']>;
107
+ /** Shorthand for CSS property `backgroundPosition` */
108
+ bgp?: WithResponsive<CSS['backgroundPosition']>;
109
+ /** Shorthand for CSS property `backgroundSize` */
110
+ bgsz?: WithResponsive<CSS['backgroundSize']>;
111
+ /** Shorthand for CSS property `backgroundRepeat` */
112
+ bgr?: WithResponsive<CSS['backgroundRepeat']>;
113
+ /** Shorthand for CSS property `color` */
114
+ c?: WithResponsive<ColorScheme | CSS['color']>;
115
+ /** Shorthand for CSS property `fontFamily` */
116
+ ff?: WithResponsive<CSS['fontFamily']>;
117
+ /** Shorthand for CSS property `fontSize` */
118
+ fs?: WithResponsive<CSS['fontSize']>;
119
+ /** Shorthand for CSS property `fontWeight` */
120
+ fw?: WithResponsive<CSS['fontWeight']>;
121
+ /** Shorthand for CSS property `textAlign` */
122
+ ta?: WithResponsive<CSS['textAlign']>;
123
+ /** Shorthand for CSS property `textTransform` */
124
+ tt?: WithResponsive<CSS['textTransform']>;
125
+ /** Shorthand for CSS property `textDecoration` */
126
+ td?: WithResponsive<CSS['textDecoration']>;
127
+ /** Shorthand for CSS property `textDecorationStyle` */
128
+ tds?: WithResponsive<CSS['textDecorationStyle']>;
129
+ /** Shorthand for CSS property `textDecorationColor` */
130
+ tdc?: WithResponsive<ColorScheme | CSS['textDecorationColor']>;
131
+ /** Shorthand for CSS property `letterSpacing` */
132
+ lts?: WithResponsive<CSS['letterSpacing']>;
133
+ /** Shorthand for CSS property `lineHeight` */
134
+ lh?: WithResponsive<CSS['lineHeight']>;
135
+ /** Shorthand for CSS property `border` */
136
+ bd?: WithResponsive<CSS['border']>;
137
+ /** Shorthand for CSS property `borderStyle` */
138
+ bs?: WithResponsive<CSS['borderStyle']>;
139
+ /** Shorthand for CSS property `borderColor` */
140
+ bc?: WithResponsive<ColorScheme | CSS['borderColor']>;
141
+ /** Shorthand for CSS property `borderWidth` */
142
+ bw?: WithResponsive<CSS['borderWidth']>;
143
+ /** Shorthand for CSS property `borderTop` */
144
+ bdt?: WithResponsive<CSS['borderTop']>;
145
+ /** Shorthand for CSS property `borderBottom` */
146
+ bdb?: WithResponsive<CSS['borderBottom']>;
147
+ /** Shorthand for CSS property `borderLeft` */
148
+ bdl?: WithResponsive<CSS['borderLeft']>;
149
+ /** Shorthand for CSS property `borderRight` */
150
+ bdr?: WithResponsive<CSS['borderRight']>;
151
+ /** Shorthand for CSS property `borderTopStyle` */
152
+ bdts?: WithResponsive<CSS['borderTopStyle']>;
153
+ /** Shorthand for CSS property `borderBottomStyle` */
154
+ bdbs?: WithResponsive<CSS['borderBottomStyle']>;
155
+ /** Shorthand for CSS property `borderLeftStyle` */
156
+ bdls?: WithResponsive<CSS['borderLeftStyle']>;
157
+ /** Shorthand for CSS property `borderRightStyle` */
158
+ bdrs?: WithResponsive<CSS['borderRightStyle']>;
159
+ /** Shorthand for CSS property `borderTopColor` */
160
+ bdtc?: WithResponsive<ColorScheme | CSS['borderTopColor']>;
161
+ /** Shorthand for CSS property `borderBottomColor` */
162
+ bdbc?: WithResponsive<ColorScheme | CSS['borderBottomColor']>;
163
+ /** Shorthand for CSS property `borderLeftColor` */
164
+ bdlc?: WithResponsive<ColorScheme | CSS['borderLeftColor']>;
165
+ /** Shorthand for CSS property `borderRightColor` */
166
+ bdrc?: WithResponsive<ColorScheme | CSS['borderRightColor']>;
167
+ /** Shorthand for CSS property `borderTopWidth` */
168
+ bdtw?: WithResponsive<CSS['borderTopWidth']>;
169
+ /** Shorthand for CSS property `borderBottomWidth` */
170
+ bdbw?: WithResponsive<CSS['borderBottomWidth']>;
171
+ /** Shorthand for CSS property `borderLeftWidth` */
172
+ bdlw?: WithResponsive<CSS['borderLeftWidth']>;
173
+ /** Shorthand for CSS property `borderRightWidth` */
174
+ bdrw?: WithResponsive<CSS['borderRightWidth']>;
175
+ /** Shorthand for CSS property `borderRadius` */
176
+ rounded?: WithResponsive<Size | CSS['borderRadius'] | 'full'>;
177
+ /** Shorthand for CSS property `boxShadow` */
178
+ shadow?: WithResponsive<Size | CSS['boxShadow']>;
179
+ /** CSS property `opacity` */
180
+ opacity?: WithResponsive<CSS['opacity']>;
181
+ /** Shorthand for CSS property `gap` */
182
+ spacing?: WithResponsive<CSS['gap']>;
183
+ /** CSS property `gap` */
184
+ gap?: WithResponsive<CSS['gap']>;
185
+ /** CSS property `rowGap` */
186
+ rowgap?: WithResponsive<CSS['rowGap']>;
187
+ /** CSS property `columnGap` */
188
+ colgap?: WithResponsive<CSS['columnGap']>;
189
+ /** Shorthand for CSS property `alignItems` */
190
+ align?: WithResponsive<CSS['alignItems']>;
191
+ /** Shorthand for CSS property `justifyContent` */
192
+ justify?: WithResponsive<CSS['justifyContent']>;
193
+ /** Shorthand for CSS property `alignSelf` */
194
+ self?: WithResponsive<CSS['alignSelf']>;
195
+ /** Shorthand for CSS property `flexBasis` */
196
+ basis?: WithResponsive<CSS['flexBasis']>;
197
+ /** Shorthand for CSS property `flex` */
198
+ flex?: WithResponsive<CSS['flex']>;
199
+ /** Shorthand for CSS property `flexGrow` */
200
+ grow?: WithResponsive<CSS['flexGrow']>;
201
+ /** Shorthand for CSS property `order` */
202
+ order?: WithResponsive<CSS['order']>;
203
+ /** Shorthand for CSS property `flexShrink` */
204
+ shrink?: WithResponsive<CSS['flexShrink']>;
205
+ /** Shorthand for CSS property `flexDirection` */
206
+ direction?: WithResponsive<CSS['flexDirection']>;
207
+ }
208
+ export {};
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export {};
@@ -1,13 +1,10 @@
1
1
  import { CSSProperties } from 'react';
2
- import type { Breakpoints, ResponsiveValue } from '../types';
3
- /**
4
- * Options for the useStyled hook
5
- */
2
+ import type { Breakpoints, WithResponsive } from '../types';
6
3
  interface UseStyledOptions {
7
4
  /**
8
5
  * CSS variables to apply
9
6
  */
10
- cssVars?: Record<string, string | number | undefined | ResponsiveValue<string | number>>;
7
+ cssVars?: Record<string, WithResponsive<string | number | undefined>>;
11
8
  /**
12
9
  * Base class name to include
13
10
  */
@@ -23,7 +20,6 @@ interface UseStyledOptions {
23
20
  enabled?: boolean | Breakpoints;
24
21
  /**
25
22
  * Prefix for the generated class name
26
- * @default 'rs'
27
23
  */
28
24
  prefix?: string;
29
25
  }
@@ -1,82 +1,17 @@
1
1
  'use client';
2
- import { useId, useLayoutEffect, useContext } from 'react';
3
2
  import isEmpty from 'lodash/isEmpty';
4
- import { StyleManager } from "../utils/style-sheet/style-manager.js";
5
- import { BREAKPOINTS } from "../constants/index.js";
3
+ import { useId, useContext } from 'react';
4
+ import { useIsomorphicLayoutEffect } from "../hooks/index.js";
5
+ import { isCSSProperty } from "../utils/index.js";
6
6
  import { CustomContext } from "../Provider/CustomContext.js";
7
- // CSS Property Map
8
- const propertyMap = {
9
- // Padding
10
- p: 'padding',
11
- pt: 'padding-top',
12
- pr: 'padding-right',
13
- pb: 'padding-bottom',
14
- pl: 'padding-left',
15
- px: 'padding-inline',
16
- py: 'padding-block',
17
- // Margin
18
- m: 'margin',
19
- mt: 'margin-top',
20
- mr: 'margin-right',
21
- mb: 'margin-bottom',
22
- ml: 'margin-left',
23
- mx: 'margin-inline',
24
- my: 'margin-block',
25
- // Size
26
- w: 'width',
27
- h: 'height',
28
- minw: 'min-width',
29
- maxw: 'max-width',
30
- minh: 'min-height',
31
- maxh: 'max-height',
32
- // Display
33
- display: 'display',
34
- // Color and Background
35
- c: 'color',
36
- bg: 'background',
37
- // Border
38
- bd: 'border',
39
- rounded: 'border-radius',
40
- // Shadow
41
- shadow: 'box-shadow',
42
- // Stack
43
- spacing: 'gap',
44
- align: 'align-items',
45
- justify: 'justify-content'
46
- };
47
-
48
- // Breakpoint values in pixels - matching SCSS variables
49
- const breakpointValues = {
50
- xs: 0,
51
- // Base mobile first
52
- sm: 576,
53
- // $screen-sm
54
- md: 768,
55
- // $screen-md
56
- lg: 992,
57
- // $screen-lg
58
- xl: 1200,
59
- // $screen-xl
60
- xxl: 1400 // $screen-xxl
61
- };
62
-
63
- /**
64
- * Options for the useStyled hook
65
- */
7
+ import { breakpointValues, isResponsiveValue } from "./responsive.js";
8
+ import { cssSystemPropAlias } from "./css-alias.js";
9
+ import { StyleManager } from "./style-manager.js";
66
10
 
67
11
  /**
68
12
  * Result of the useStyled hook
69
13
  */
70
14
 
71
- /**
72
- * Checks if a value is a responsive value object
73
- * @param value - Value to check
74
- * @returns True if the value is a responsive value object
75
- */
76
- function isResponsiveValue(value) {
77
- return value !== null && typeof value === 'object' && !Array.isArray(value) && Object.keys(value).some(key => BREAKPOINTS.includes(key));
78
- }
79
-
80
15
  /**
81
16
  * Custom hook for managing component styling with scoped CSS variables
82
17
  *
@@ -112,7 +47,7 @@ export function useStyled(options) {
112
47
  const shouldApplyStyles = enabled && !isEmpty(cssVars);
113
48
 
114
49
  // Apply CSS variables through StyleManager
115
- useLayoutEffect(() => {
50
+ useIsomorphicLayoutEffect(() => {
116
51
  if (!shouldApplyStyles) return;
117
52
 
118
53
  // Create base CSS rules for the variables
@@ -150,9 +85,11 @@ export function useStyled(options) {
150
85
  const propName = varName.startsWith(cssVarPrefix) ? varName.substring(cssVarPrefix.length) : varName;
151
86
 
152
87
  // Check if the property has a corresponding CSS property mapping
153
- const cssProperty = propertyMap[propName];
88
+ const cssProperty = cssSystemPropAlias[propName];
154
89
  if (cssProperty) {
155
- basePropRules += `${cssProperty}: var(${varName}); `;
90
+ basePropRules += `${cssProperty.property}: var(${varName}); `;
91
+ } else if (isCSSProperty(propName)) {
92
+ basePropRules += `${propName}: var(${varName}); `;
156
93
  }
157
94
  });
158
95
 
@@ -174,7 +111,8 @@ export function useStyled(options) {
174
111
  md: '',
175
112
  lg: '',
176
113
  xl: '',
177
- xxl: ''
114
+ xxl: '',
115
+ '2xl': ''
178
116
  };
179
117
  const breakpointPropRules = {
180
118
  xs: '',
@@ -182,7 +120,8 @@ export function useStyled(options) {
182
120
  md: '',
183
121
  lg: '',
184
122
  xl: '',
185
- xxl: ''
123
+ xxl: '',
124
+ '2xl': ''
186
125
  };
187
126
 
188
127
  // Group styles by breakpoint
@@ -190,7 +129,6 @@ export function useStyled(options) {
190
129
  Object.entries(responsiveValue).forEach(([breakpoint, value]) => {
191
130
  const bp = breakpoint;
192
131
  if (value !== undefined && bp !== 'xs') {
193
- // Skip xs as it's already in base styles
194
132
  // Add the CSS variable definition for this breakpoint
195
133
  breakpointVarRules[bp] += `${varName}: ${value}; `;
196
134
 
@@ -198,9 +136,11 @@ export function useStyled(options) {
198
136
  const propName = varName.startsWith(cssVarPrefix) ? varName.substring(cssVarPrefix.length) : varName;
199
137
 
200
138
  // Check if the property has a corresponding CSS property mapping
201
- const cssProperty = propertyMap[propName];
139
+ const cssProperty = cssSystemPropAlias[propName];
202
140
  if (cssProperty) {
203
141
  breakpointPropRules[bp] += `${cssProperty}: var(${varName}); `;
142
+ } else if (isCSSProperty(propName)) {
143
+ breakpointPropRules[bp] += `${propName}: var(${varName}); `;
204
144
  }
205
145
  }
206
146
  });
@@ -213,7 +153,8 @@ export function useStyled(options) {
213
153
  md: breakpointVarRules.md + breakpointPropRules.md,
214
154
  lg: breakpointVarRules.lg + breakpointPropRules.lg,
215
155
  xl: breakpointVarRules.xl + breakpointPropRules.xl,
216
- xxl: breakpointVarRules.xxl + breakpointPropRules.xxl
156
+ xxl: breakpointVarRules.xxl + breakpointPropRules.xxl,
157
+ '2xl': breakpointVarRules['2xl'] + breakpointPropRules['2xl']
217
158
  };
218
159
 
219
160
  // Add media queries for each breakpoint with rules (skip xs)
@@ -2,20 +2,20 @@ import React from 'react';
2
2
  /** React element with optional props and HTML attributes. */
3
3
  export type ReactElement<P = any> = React.ReactElement<P & React.HTMLAttributes<any>>;
4
4
  /** Removes 'onSelect' property from the given type. */
5
- export type PropsWithoutSelect<T> = Omit<T, 'onSelect'>;
5
+ export type PropsWithoutSelect<T> = Omit<T, 'onSelect' | 'color'>;
6
6
  /** Removes 'onChange' property from the given type. */
7
- export type PropsWithoutChange<T> = Omit<T, 'onChange'>;
7
+ export type PropsWithoutChange<T> = Omit<T, 'onChange' | 'color'>;
8
8
  export type PropsWithout<T, K extends keyof T> = Omit<T, K>;
9
9
  /** HTML props excluding 'onSelect' attribute. */
10
10
  export type HTMLPropsWithoutSelect<T extends HTMLElement = HTMLElement, P extends Record<string, any> = React.HTMLAttributes<T>> = PropsWithoutSelect<P>;
11
11
  /** HTML props excluding 'onChange' attribute. */
12
12
  export type HTMLPropsWithoutChange<T extends HTMLElement = HTMLElement, P extends Record<string, any> = React.HTMLAttributes<T>> = PropsWithoutChange<P>;
13
13
  /** Input props with 'onChange' and 'size' attributes removed. */
14
- export type SanitizedInputProps = PropsWithout<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'>;
14
+ export type SanitizedInputProps = PropsWithout<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size' | 'color'>;
15
15
  /** Textarea props with 'onChange' attribute removed. */
16
- export type SanitizedTextareaProps = PropsWithout<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'>;
16
+ export type SanitizedTextareaProps = PropsWithout<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'color'>;
17
17
  /** HTML props excluding 'title', 'onToggle', and 'onSelect' attributes. */
18
- export type SanitizedHTMListProps<T extends HTMLElement = HTMLElement, P extends Record<string, any> = React.HTMLAttributes<T>> = PropsWithout<P, 'title' | 'onToggle' | 'onSelect'>;
19
- export type WithoutChildren<T> = Omit<T, 'children'>;
18
+ export type SanitizedHTMListProps<T extends HTMLElement = HTMLElement, P extends Record<string, any> = React.HTMLAttributes<T>> = PropsWithout<P, 'title' | 'onToggle' | 'onSelect' | 'color'>;
19
+ export type WithoutChildren<T> = Omit<T, 'children' | 'color'>;
20
20
  export type CSSVariables = Partial<Record<`--${string}`, string | number | undefined>>;
21
21
  export type StyleProperties = React.CSSProperties | CSSVariables;
@@ -90,7 +90,7 @@ export interface DataProps<TData> {
90
90
  */
91
91
  childrenKey?: string;
92
92
  }
93
- export interface PickerBaseProps<L = any> extends PopupProps, BoxProps, AnimationEventProps {
93
+ export interface PickerBaseProps<L = any> extends PopupProps, Omit<BoxProps, 'height'>, AnimationEventProps {
94
94
  id?: string;
95
95
  /**
96
96
  * Custom Ref for the picker
@@ -139,7 +139,7 @@ export interface PickerBaseProps<L = any> extends PopupProps, BoxProps, Animatio
139
139
  /** Custom render extra footer */
140
140
  renderExtraFooter?: () => ReactNode;
141
141
  }
142
- export interface FormControlPickerProps<T = any, L = any, D = Record<string, any>, I = T> extends PickerBaseProps<L>, FormControlBaseProps<T>, DataProps<D> {
142
+ export interface FormControlPickerProps<T = any, L = any, D = Record<string, any>, I = T> extends DataProps<D>, PickerBaseProps<L>, FormControlBaseProps<T> {
143
143
  /**
144
144
  * Disabled items
145
145
  */
@@ -21,7 +21,8 @@ export type Size = `${SizeEnum}`;
21
21
  /** Basic size type (xs, sm, md, lg) */
22
22
  export type BasicSize = Exclude<Size, 'xl'>;
23
23
  export type TextSize = `${TypographySizeEnum}`;
24
- export type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
24
+ export type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | '2xl';
25
25
  export type ResponsiveValue<T> = {
26
26
  [key in Breakpoints]?: T;
27
27
  };
28
+ export type WithResponsive<T> = T | ResponsiveValue<T>;
@@ -5,7 +5,7 @@ import { Color } from '../types/colours';
5
5
  * @param color The color value to check
6
6
  * @returns The CSS variable if it's a valid color type, or the original value
7
7
  */
8
- export declare const getColorVar: (color: Color | string | undefined) => string | undefined;
8
+ export declare const getColorValue: (color: Color | string | undefined) => string | undefined;
9
9
  export declare const isPresetColor: (color?: Color | React.CSSProperties['color']) => boolean;
10
10
  export declare const getColorStyle: (value?: import("csstype").Property.Color | undefined, name?: string | undefined, prop?: string) => {
11
11
  [x: string]: string | (string & {}) | undefined;
@@ -8,7 +8,7 @@ import { createStyleGetter } from "./style-sheet/index.js";
8
8
  * @param color The color value to check
9
9
  * @returns The CSS variable if it's a valid color type, or the original value
10
10
  */
11
- export const getColorVar = color => {
11
+ export const getColorValue = color => {
12
12
  if (!color) return undefined;
13
13
 
14
14
  // Check if color is a base color (e.g., 'red', 'blue')
@@ -41,7 +41,7 @@ const colorConfig = {
41
41
  prop: 'color',
42
42
  useGlobalVar: true,
43
43
  presetChecker: isPresetColor,
44
- valueTransformer: getColorVar
44
+ valueTransformer: getColorValue
45
45
  };
46
46
  export const getColorStyle = createStyleGetter(colorConfig);
47
47
 
@@ -1,5 +1,6 @@
1
1
  import { SizeEnum } from '../types';
2
2
  export declare const isPresetSize: (size?: SizeEnum | number | string | null) => boolean;
3
+ export declare const getSizeValue: (type: string, size: SizeEnum | number | string | null) => string | undefined;
3
4
  export declare const getSizeStyle: (value?: string | number | undefined, name?: string | undefined, prop?: string) => {
4
5
  [x: string]: string | number | undefined;
5
6
  } | undefined;
@@ -13,6 +13,12 @@ const sizeConfig = {
13
13
  presetChecker: isPresetSize,
14
14
  valueTransformer: getCssValue
15
15
  };
16
+ export const getSizeValue = (type, size) => {
17
+ if (isPresetSize(size)) {
18
+ return `var(--rs-${type}-${size})`;
19
+ }
20
+ return getCssValue(size);
21
+ };
16
22
  export const getSizeStyle = createStyleGetter(sizeConfig);
17
23
  const lineHeightConfig = {
18
24
  prop: 'line-height',
@@ -12,3 +12,9 @@ export declare function mergeStyles(...styles: (StyleProperties | undefined | nu
12
12
  * Create CSS variables for offset positioning
13
13
  */
14
14
  export declare function createOffsetStyles(offset?: [number | string, number | string], prefix?: string): React.CSSProperties | undefined;
15
+ /**
16
+ * Check if a string is a valid CSS property name
17
+ * @param prop - The property name to check
18
+ * @returns True if the property is a valid CSS property
19
+ */
20
+ export declare function isCSSProperty(prop: string): prop is Extract<keyof CSSStyleDeclaration, string>;
@@ -1,5 +1,7 @@
1
1
  'use client';
2
2
  import isEmpty from 'lodash/isEmpty';
3
+ import camelCase from 'lodash/camelCase';
4
+ import canUseDOM from 'dom-lib/canUseDOM';
3
5
  /**
4
6
  * Processes and returns a value suitable for CSS (with a unit).
5
7
  */
@@ -46,4 +48,36 @@ export function createOffsetStyles(offset, prefix = '--rs-offset') {
46
48
  [`${prefix}-x`]: getCssValue(x),
47
49
  [`${prefix}-y`]: getCssValue(y)
48
50
  };
51
+ }
52
+
53
+ /**
54
+ * Check if a string is a valid CSS property name
55
+ * @param prop - The property name to check
56
+ * @returns True if the property is a valid CSS property
57
+ */
58
+ export function isCSSProperty(prop) {
59
+ if (!canUseDOM || typeof prop !== 'string' || !prop) {
60
+ return false;
61
+ }
62
+ try {
63
+ // Handle standard properties
64
+ const style = document.documentElement.style;
65
+
66
+ // Check standard property
67
+ if (prop in style) {
68
+ return true;
69
+ } else if (camelCase(prop) in style) {
70
+ return true;
71
+ }
72
+
73
+ // Handle vendor-prefixed properties (e.g., Webkit, Moz, ms, O)
74
+ const prefixes = ['Webkit', 'Moz', 'ms', 'O'];
75
+ const propName = prop.charAt(0).toUpperCase() + prop.slice(1);
76
+ return prefixes.some(prefix => `${prefix}${propName}` in style);
77
+ } catch (e) {
78
+ if (process.env.NODE_ENV !== 'production') {
79
+ console.warn(`Failed to check CSS property: ${prop}`, e);
80
+ }
81
+ return false;
82
+ }
49
83
  }
@@ -2,4 +2,3 @@ export * from './styles';
2
2
  export * from './css';
3
3
  export * from './prefix';
4
4
  export * from './responsive';
5
- export * from './style-manager';
@@ -2,5 +2,4 @@
2
2
  export * from "./styles.js";
3
3
  export * from "./css.js";
4
4
  export * from "./prefix.js";
5
- export * from "./responsive.js";
6
- export * from "./style-manager.js";
5
+ export * from "./responsive.js";
@@ -1,2 +1,17 @@
1
1
  import type { ResponsiveValue } from '../../types';
2
+ /**
3
+ * Generates responsive CSS class names based on the provided value and prefix function.
4
+ * Handles both static and responsive values.
5
+ *
6
+ * @example
7
+ * // With a single value
8
+ * // getResponsiveClasses('rs-row', 'top');
9
+ * // Returns: ['rs-row-top']
10
+ *
11
+ * @example
12
+ * // With responsive values
13
+ * // getResponsiveClasses('rs-row', { xs: 'top', md: 'bottom' });
14
+ * // Returns: ['rs-row-xs-top', 'rs-row-md-bottom']
15
+ *
16
+ */
2
17
  export declare const getResponsiveClasses: <T = string>(prefix: (...classes: any[]) => string, value?: T | ResponsiveValue<T> | undefined) => string[];
@@ -1,12 +1,31 @@
1
1
  'use client';
2
2
  import { BREAKPOINTS } from "../../constants/index.js";
3
+ /**
4
+ * Generates responsive CSS class names based on the provided value and prefix function.
5
+ * Handles both static and responsive values.
6
+ *
7
+ * @example
8
+ * // With a single value
9
+ * // getResponsiveClasses('rs-row', 'top');
10
+ * // Returns: ['rs-row-top']
11
+ *
12
+ * @example
13
+ * // With responsive values
14
+ * // getResponsiveClasses('rs-row', { xs: 'top', md: 'bottom' });
15
+ * // Returns: ['rs-row-xs-top', 'rs-row-md-bottom']
16
+ *
17
+ */
3
18
  export const getResponsiveClasses = (prefix, value) => {
4
19
  if (!value) {
5
20
  return [];
6
21
  }
22
+
23
+ // Handle non-object (static) values
7
24
  if (typeof value !== 'object') {
8
25
  return [prefix(value)];
9
26
  }
27
+
28
+ // Process responsive values for each breakpoint
10
29
  return BREAKPOINTS.reduce((classes, breakpoint) => {
11
30
  const breakpointValue = value[breakpoint];
12
31
  if (!breakpointValue) return classes;
@@ -2,17 +2,17 @@ import type { BreakpointMap, BreakpointSystem } from './types';
2
2
  /**
3
3
  * Create breakpoint system
4
4
  *
5
- * This function takes a breakpoint map and returns an enhanced breakpoint system
5
+ * This function takes a breakpoint map with numeric values and returns an enhanced breakpoint system
6
6
  * that provides various media queries for responsive design.
7
7
  *
8
8
  * @example
9
9
  * ```ts
10
10
  * const breakpoints = createBreakpoints({
11
- * xs: '0px',
12
- * sm: '576px',
13
- * md: '768px',
14
- * lg: '992px',
15
- * xl: '1200px'
11
+ * xs: 0,
12
+ * sm: 576,
13
+ * md: 768,
14
+ * lg: 992,
15
+ * xl: 1200
16
16
  * });
17
17
  *
18
18
  * // Using breakpoints