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.
- package/AutoComplete/styles/index.css +156 -161
- package/AvatarGroup/styles/index.css +1 -10
- package/Badge/styles/index.css +21 -21
- package/Button/styles/index.css +78 -63
- package/ButtonGroup/styles/index.css +15 -12
- package/ButtonToolbar/styles/index.css +1 -10
- package/CHANGELOG.md +9 -0
- package/Calendar/styles/index.css +92 -67
- package/Card/styles/index.css +7 -7
- package/CascadeTree/styles/index.css +8 -9
- package/Cascader/styles/index.css +160 -164
- package/CheckPicker/styles/index.css +173 -178
- package/CheckTree/styles/index.css +175 -180
- package/CheckTreePicker/styles/index.css +175 -180
- package/Checkbox/styles/index.css +21 -28
- package/CheckboxGroup/styles/index.css +1 -1
- package/DateInput/styles/index.css +8 -18
- package/DatePicker/styles/index.css +173 -168
- package/DateRangeInput/styles/index.css +8 -18
- package/DateRangePicker/styles/index.css +173 -168
- package/Dropdown/styles/index.css +110 -94
- package/IconButton/styles/index.css +95 -79
- package/InlineEdit/styles/index.css +12 -19
- package/Input/styles/index.css +8 -18
- package/InputGroup/styles/index.css +31 -38
- package/InputNumber/styles/index.css +115 -100
- package/InputPicker/styles/index.css +156 -161
- package/List/styles/index.css +10 -10
- package/Loader/styles/index.css +16 -16
- package/Menu/styles/index.css +2 -2
- package/Message/styles/index.css +2 -2
- package/MultiCascadeTree/styles/index.css +178 -191
- package/MultiCascader/styles/index.css +178 -200
- package/Nav/styles/index.css +162 -146
- package/Navbar/styles/index.css +140 -124
- package/NumberInput/styles/index.css +115 -100
- package/Pagination/styles/index.css +177 -200
- package/PasswordInput/styles/index.css +36 -43
- package/PinInput/styles/index.css +12 -22
- package/Radio/styles/index.css +22 -29
- package/RadioGroup/styles/index.css +11 -11
- package/SelectPicker/styles/index.css +156 -161
- package/Sidenav/styles/index.css +122 -129
- package/Stack/styles/index.css +1 -10
- package/Stat/styles/index.css +95 -79
- package/Steps/styles/index.css +26 -25
- package/Table/styles/index.css +11 -0
- package/Tabs/styles/index.css +162 -146
- package/Tag/styles/index.css +112 -96
- package/TagInput/styles/index.css +174 -179
- package/TagPicker/styles/index.css +174 -179
- package/TimePicker/styles/index.css +173 -168
- package/TimeRangePicker/styles/index.css +173 -168
- package/Toggle/styles/index.css +27 -30
- package/Tree/styles/index.css +157 -162
- package/TreePicker/styles/index.css +157 -162
- package/Uploader/styles/index.css +94 -65
- package/cjs/AutoComplete/AutoComplete.d.ts +1 -1
- package/cjs/AutoComplete/AutoComplete.js +1 -0
- package/cjs/Badge/Badge.js +16 -11
- package/cjs/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/cjs/Button/Button.js +9 -7
- package/cjs/ButtonGroup/ButtonGroup.js +7 -7
- package/cjs/Card/Card.js +6 -6
- package/cjs/Checkbox/Checkbox.js +6 -7
- package/cjs/CheckboxGroup/CheckboxGroup.js +3 -4
- package/cjs/Dropdown/Dropdown.js +3 -4
- package/cjs/Dropdown/DropdownItem.js +4 -4
- package/cjs/Dropdown/DropdownMenu.js +9 -10
- package/cjs/FormControl/FormControl.d.ts +1 -1
- package/cjs/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/cjs/FormHelpText/FormHelpText.d.ts +1 -1
- package/cjs/FormStack/FormStack.d.ts +0 -5
- package/cjs/FormStack/FormStack.js +1 -6
- package/cjs/IconButton/IconButton.d.ts +1 -1
- package/cjs/IconButton/IconButton.js +9 -9
- package/cjs/Image/Image.d.ts +1 -1
- package/cjs/InlineEdit/InlineEdit.js +3 -2
- package/cjs/InputGroup/InputGroup.js +12 -14
- package/cjs/InputGroup/InputGroupAddon.d.ts +2 -2
- package/cjs/InputPicker/InputAutosize.js +4 -6
- package/cjs/List/List.d.ts +1 -1
- package/cjs/List/List.js +7 -8
- package/cjs/List/ListItem.d.ts +2 -2
- package/cjs/List/ListItem.js +4 -4
- package/cjs/Loader/Loader.js +8 -7
- package/cjs/Menu/MenuSeparator.d.ts +2 -2
- package/cjs/Nav/Nav.d.ts +2 -2
- package/cjs/Nav/Nav.js +12 -13
- package/cjs/Nav/NavDropdownItem.js +4 -4
- package/cjs/Nav/NavDropdownMenu.js +10 -13
- package/cjs/Nav/NavItem.d.ts +2 -2
- package/cjs/Nav/NavItem.js +6 -8
- package/cjs/Navbar/Navbar.js +6 -6
- package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdown.js +3 -4
- package/cjs/Navbar/NavbarDropdownItem.js +4 -4
- package/cjs/Navbar/NavbarDropdownMenu.js +8 -11
- package/cjs/NumberInput/NumberInput.d.ts +1 -1
- package/cjs/Pagination/Pagination.js +3 -2
- package/cjs/Pagination/PaginationButton.d.ts +3 -3
- package/cjs/Pagination/PaginationButton.js +9 -17
- package/cjs/Pagination/PaginationGroup.js +2 -1
- package/cjs/Panel/PanelHeader.d.ts +1 -1
- package/cjs/Progress/index.d.ts +1 -2
- package/cjs/Progress/index.js +0 -2
- package/cjs/Radio/Radio.js +6 -6
- package/cjs/RadioGroup/RadioGroup.js +4 -4
- package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
- package/cjs/Sidenav/Sidenav.js +3 -2
- package/cjs/Sidenav/SidenavDropdown.js +3 -5
- package/cjs/Sidenav/SidenavDropdownItem.js +4 -4
- package/cjs/Sidenav/SidenavDropdownMenu.js +10 -13
- package/cjs/Sidenav/SidenavItem.d.ts +2 -2
- package/cjs/Sidenav/SidenavItem.js +4 -5
- package/cjs/Slider/Handle.d.ts +1 -1
- package/cjs/Stack/Stack.d.ts +3 -21
- package/cjs/Stack/Stack.js +3 -28
- package/cjs/Stack/StackItem.d.ts +4 -5
- package/cjs/Stack/StackItem.js +4 -10
- package/cjs/Steps/StepItem.js +7 -8
- package/cjs/Steps/Steps.d.ts +2 -1
- package/cjs/Steps/Steps.js +32 -34
- package/cjs/Tabs/Tabs.js +1 -1
- package/cjs/Tag/Tag.js +5 -2
- package/cjs/Toggle/Toggle.d.ts +1 -1
- package/cjs/Toggle/Toggle.js +7 -6
- package/cjs/Tree/types.d.ts +2 -2
- package/cjs/Uploader/Uploader.d.ts +2 -2
- package/cjs/internals/Box/Box.d.ts +4 -38
- package/cjs/internals/Box/Box.js +3 -3
- package/cjs/internals/Box/index.d.ts +1 -1
- package/cjs/internals/Box/utils.d.ts +0 -9
- package/cjs/internals/Box/utils.js +22 -226
- package/cjs/internals/InputBase/InputBase.d.ts +1 -1
- package/cjs/internals/InputBase/InputBase.js +3 -2
- package/cjs/internals/Menu/MenuItem.js +1 -1
- package/cjs/internals/Overlay/Modal.d.ts +1 -1
- package/cjs/internals/Picker/PickerToggle.js +2 -4
- package/cjs/internals/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/cjs/internals/Tree/TreeView.d.ts +2 -2
- package/cjs/internals/hooks/useCustom.js +24 -7
- package/cjs/internals/styled-system/css-alias.d.ts +7 -0
- package/cjs/internals/styled-system/css-alias.js +391 -0
- package/cjs/internals/styled-system/css-properties.d.ts +6 -0
- package/cjs/internals/styled-system/css-properties.js +30 -0
- package/cjs/internals/styled-system/index.d.ts +5 -0
- package/cjs/internals/styled-system/index.js +34 -0
- package/cjs/internals/styled-system/responsive.d.ts +26 -0
- package/cjs/internals/styled-system/responsive.js +118 -0
- package/cjs/internals/styled-system/types.d.ts +208 -0
- package/cjs/internals/styled-system/types.js +4 -0
- package/cjs/internals/{hooks → styled-system}/useStyled.d.ts +2 -6
- package/cjs/internals/{hooks → styled-system}/useStyled.js +24 -84
- package/cjs/internals/types/html.d.ts +6 -6
- package/cjs/internals/types/picker.d.ts +2 -2
- package/cjs/internals/types/sizes.d.ts +2 -1
- package/cjs/internals/utils/colours.d.ts +1 -1
- package/cjs/internals/utils/colours.js +4 -4
- package/cjs/internals/utils/sizes.d.ts +1 -0
- package/cjs/internals/utils/sizes.js +8 -1
- package/cjs/internals/utils/style-sheet/css.d.ts +6 -0
- package/cjs/internals/utils/style-sheet/css.js +35 -0
- package/cjs/internals/utils/style-sheet/index.d.ts +0 -1
- package/cjs/internals/utils/style-sheet/index.js +0 -6
- package/cjs/internals/utils/style-sheet/responsive.d.ts +15 -0
- package/cjs/internals/utils/style-sheet/responsive.js +19 -0
- package/cjs/useMediaQuery/breakpoints.d.ts +6 -6
- package/cjs/useMediaQuery/breakpoints.js +27 -31
- package/cjs/useMediaQuery/types.d.ts +2 -2
- package/cjs/useMediaQuery/useMediaQuery.js +3 -13
- package/dist/rsuite-no-reset.css +641 -655
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite.css +641 -655
- package/dist/rsuite.js +128 -95
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/AutoComplete/AutoComplete.d.ts +1 -1
- package/esm/AutoComplete/AutoComplete.js +1 -0
- package/esm/Badge/Badge.js +16 -11
- package/esm/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/esm/Button/Button.js +9 -7
- package/esm/ButtonGroup/ButtonGroup.js +7 -7
- package/esm/Card/Card.js +6 -6
- package/esm/Checkbox/Checkbox.js +6 -7
- package/esm/CheckboxGroup/CheckboxGroup.js +3 -4
- package/esm/Dropdown/Dropdown.js +3 -4
- package/esm/Dropdown/DropdownItem.js +4 -4
- package/esm/Dropdown/DropdownMenu.js +9 -10
- package/esm/FormControl/FormControl.d.ts +1 -1
- package/esm/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/esm/FormHelpText/FormHelpText.d.ts +1 -1
- package/esm/FormStack/FormStack.d.ts +0 -5
- package/esm/FormStack/FormStack.js +2 -7
- package/esm/IconButton/IconButton.d.ts +1 -1
- package/esm/IconButton/IconButton.js +9 -9
- package/esm/Image/Image.d.ts +1 -1
- package/esm/InlineEdit/InlineEdit.js +3 -2
- package/esm/InputGroup/InputGroup.js +12 -14
- package/esm/InputGroup/InputGroupAddon.d.ts +2 -2
- package/esm/InputPicker/InputAutosize.js +4 -6
- package/esm/List/List.d.ts +1 -1
- package/esm/List/List.js +7 -8
- package/esm/List/ListItem.d.ts +2 -2
- package/esm/List/ListItem.js +4 -4
- package/esm/Loader/Loader.js +8 -7
- package/esm/Menu/MenuSeparator.d.ts +2 -2
- package/esm/Nav/Nav.d.ts +2 -2
- package/esm/Nav/Nav.js +12 -13
- package/esm/Nav/NavDropdownItem.js +4 -4
- package/esm/Nav/NavDropdownMenu.js +10 -13
- package/esm/Nav/NavItem.d.ts +2 -2
- package/esm/Nav/NavItem.js +6 -8
- package/esm/Navbar/Navbar.js +7 -7
- package/esm/Navbar/NavbarDropdown.d.ts +1 -1
- package/esm/Navbar/NavbarDropdown.js +3 -4
- package/esm/Navbar/NavbarDropdownItem.js +4 -4
- package/esm/Navbar/NavbarDropdownMenu.js +8 -11
- package/esm/NumberInput/NumberInput.d.ts +1 -1
- package/esm/Pagination/Pagination.js +3 -2
- package/esm/Pagination/PaginationButton.d.ts +3 -3
- package/esm/Pagination/PaginationButton.js +9 -16
- package/esm/Pagination/PaginationGroup.js +2 -1
- package/esm/Panel/PanelHeader.d.ts +1 -1
- package/esm/Progress/index.d.ts +1 -2
- package/esm/Progress/index.js +1 -2
- package/esm/Radio/Radio.js +6 -6
- package/esm/RadioGroup/RadioGroup.js +4 -4
- package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
- package/esm/Sidenav/Sidenav.js +3 -2
- package/esm/Sidenav/SidenavDropdown.js +3 -5
- package/esm/Sidenav/SidenavDropdownItem.js +4 -4
- package/esm/Sidenav/SidenavDropdownMenu.js +10 -13
- package/esm/Sidenav/SidenavItem.d.ts +2 -2
- package/esm/Sidenav/SidenavItem.js +4 -5
- package/esm/Slider/Handle.d.ts +1 -1
- package/esm/Stack/Stack.d.ts +3 -21
- package/esm/Stack/Stack.js +3 -28
- package/esm/Stack/StackItem.d.ts +4 -5
- package/esm/Stack/StackItem.js +5 -11
- package/esm/Steps/StepItem.js +7 -8
- package/esm/Steps/Steps.d.ts +2 -1
- package/esm/Steps/Steps.js +31 -34
- package/esm/Tabs/Tabs.js +1 -1
- package/esm/Tag/Tag.js +5 -2
- package/esm/Toggle/Toggle.d.ts +1 -1
- package/esm/Toggle/Toggle.js +7 -6
- package/esm/Tree/types.d.ts +2 -2
- package/esm/Uploader/Uploader.d.ts +2 -2
- package/esm/internals/Box/Box.d.ts +4 -38
- package/esm/internals/Box/Box.js +3 -3
- package/esm/internals/Box/index.d.ts +1 -1
- package/esm/internals/Box/utils.d.ts +0 -9
- package/esm/internals/Box/utils.js +20 -224
- package/esm/internals/InputBase/InputBase.d.ts +1 -1
- package/esm/internals/InputBase/InputBase.js +3 -2
- package/esm/internals/Menu/MenuItem.js +1 -1
- package/esm/internals/Overlay/Modal.d.ts +1 -1
- package/esm/internals/Picker/PickerToggle.js +2 -4
- package/esm/internals/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/esm/internals/Tree/TreeView.d.ts +2 -2
- package/esm/internals/hooks/useCustom.js +24 -7
- package/esm/internals/styled-system/css-alias.d.ts +7 -0
- package/esm/internals/styled-system/css-alias.js +387 -0
- package/esm/internals/styled-system/css-properties.d.ts +6 -0
- package/esm/internals/styled-system/css-properties.js +26 -0
- package/esm/internals/styled-system/index.d.ts +5 -0
- package/esm/internals/styled-system/index.js +6 -0
- package/esm/internals/styled-system/responsive.d.ts +26 -0
- package/esm/internals/styled-system/responsive.js +110 -0
- package/esm/internals/styled-system/types.d.ts +208 -0
- package/esm/internals/styled-system/types.js +2 -0
- package/esm/internals/{hooks → styled-system}/useStyled.d.ts +2 -6
- package/esm/internals/{hooks → styled-system}/useStyled.js +20 -79
- package/esm/internals/types/html.d.ts +6 -6
- package/esm/internals/types/picker.d.ts +2 -2
- package/esm/internals/types/sizes.d.ts +2 -1
- package/esm/internals/utils/colours.d.ts +1 -1
- package/esm/internals/utils/colours.js +2 -2
- package/esm/internals/utils/sizes.d.ts +1 -0
- package/esm/internals/utils/sizes.js +6 -0
- package/esm/internals/utils/style-sheet/css.d.ts +6 -0
- package/esm/internals/utils/style-sheet/css.js +34 -0
- package/esm/internals/utils/style-sheet/index.d.ts +0 -1
- package/esm/internals/utils/style-sheet/index.js +1 -2
- package/esm/internals/utils/style-sheet/responsive.d.ts +15 -0
- package/esm/internals/utils/style-sheet/responsive.js +19 -0
- package/esm/useMediaQuery/breakpoints.d.ts +6 -6
- package/esm/useMediaQuery/breakpoints.js +27 -31
- package/esm/useMediaQuery/types.d.ts +2 -2
- package/esm/useMediaQuery/useMediaQuery.js +2 -12
- package/package.json +1 -1
- /package/cjs/internals/{utils/style-sheet → styled-system}/style-manager.d.ts +0 -0
- /package/cjs/internals/{utils/style-sheet → styled-system}/style-manager.js +0 -0
- /package/esm/internals/{utils/style-sheet → styled-system}/style-manager.d.ts +0 -0
- /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,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
|
+
};
|