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
|
@@ -8,18 +8,12 @@ const capitalize = str => str.charAt(0).toUpperCase() + str.slice(1);
|
|
|
8
8
|
* Adjust max-width value to avoid breakpoint overlapping
|
|
9
9
|
*/
|
|
10
10
|
function adjustMaxWidth(value) {
|
|
11
|
-
// Extract numeric part and unit
|
|
12
|
-
const match = value.match(/^([\d.]+)(\w+)$/);
|
|
13
|
-
if (!match) return value;
|
|
14
|
-
const [, numStr, unit] = match;
|
|
15
|
-
const num = parseFloat(numStr);
|
|
16
|
-
|
|
17
11
|
// If value is 0, don't adjust
|
|
18
|
-
if (
|
|
12
|
+
if (value === 0) return '0px';
|
|
19
13
|
|
|
20
14
|
// Subtract a small value to avoid overlap
|
|
21
|
-
const adjustedNum =
|
|
22
|
-
return `${adjustedNum}
|
|
15
|
+
const adjustedNum = value - 0.01;
|
|
16
|
+
return `${adjustedNum}px`;
|
|
23
17
|
}
|
|
24
18
|
|
|
25
19
|
/**
|
|
@@ -46,20 +40,20 @@ function createLegacyMediaQueryMap(breakpoints) {
|
|
|
46
40
|
|
|
47
41
|
// Special case for xs
|
|
48
42
|
const xsValue = breakpoints.xs;
|
|
49
|
-
if (xsValue) {
|
|
43
|
+
if (xsValue !== undefined) {
|
|
50
44
|
// For xs, use max-width of the next breakpoint minus 0.01
|
|
51
45
|
const nextBreakpoint = entries.find(([key]) => key === 'sm');
|
|
52
46
|
if (nextBreakpoint) {
|
|
53
47
|
result.xs = `(max-width: ${adjustMaxWidth(nextBreakpoint[1])})`;
|
|
54
48
|
} else {
|
|
55
|
-
result.xs = `(min-width: ${xsValue})`;
|
|
49
|
+
result.xs = `(min-width: ${xsValue}px)`;
|
|
56
50
|
}
|
|
57
51
|
}
|
|
58
52
|
|
|
59
53
|
// For all other breakpoints, use min-width
|
|
60
54
|
entries.forEach(([key, value]) => {
|
|
61
55
|
if (key !== 'xs') {
|
|
62
|
-
result[key] = `(min-width: ${value})`;
|
|
56
|
+
result[key] = `(min-width: ${value}px)`;
|
|
63
57
|
}
|
|
64
58
|
});
|
|
65
59
|
return result;
|
|
@@ -68,17 +62,17 @@ function createLegacyMediaQueryMap(breakpoints) {
|
|
|
68
62
|
/**
|
|
69
63
|
* Create breakpoint system
|
|
70
64
|
*
|
|
71
|
-
* This function takes a breakpoint map and returns an enhanced breakpoint system
|
|
65
|
+
* This function takes a breakpoint map with numeric values and returns an enhanced breakpoint system
|
|
72
66
|
* that provides various media queries for responsive design.
|
|
73
67
|
*
|
|
74
68
|
* @example
|
|
75
69
|
* ```ts
|
|
76
70
|
* const breakpoints = createBreakpoints({
|
|
77
|
-
* xs:
|
|
78
|
-
* sm:
|
|
79
|
-
* md:
|
|
80
|
-
* lg:
|
|
81
|
-
* xl:
|
|
71
|
+
* xs: 0,
|
|
72
|
+
* sm: 576,
|
|
73
|
+
* md: 768,
|
|
74
|
+
* lg: 992,
|
|
75
|
+
* xl: 1200
|
|
82
76
|
* });
|
|
83
77
|
*
|
|
84
78
|
* // Using breakpoints
|
|
@@ -90,9 +84,7 @@ function createLegacyMediaQueryMap(breakpoints) {
|
|
|
90
84
|
export function createBreakpoints(breakpoints) {
|
|
91
85
|
// Sort breakpoints by value
|
|
92
86
|
const sortedEntries = Object.entries(breakpoints).sort((a, b) => {
|
|
93
|
-
|
|
94
|
-
const valueB = parseInt(b[1].replace(/[^\d]/g, ''), 10);
|
|
95
|
-
return valueA - valueB;
|
|
87
|
+
return a[1] - b[1];
|
|
96
88
|
});
|
|
97
89
|
|
|
98
90
|
// Create breakpoint entries with min and max values
|
|
@@ -105,7 +97,7 @@ export function createBreakpoints(breakpoints) {
|
|
|
105
97
|
}
|
|
106
98
|
return [name, {
|
|
107
99
|
name,
|
|
108
|
-
min: value
|
|
100
|
+
min: `${value}px`,
|
|
109
101
|
max
|
|
110
102
|
}];
|
|
111
103
|
});
|
|
@@ -132,7 +124,7 @@ export function createBreakpoints(breakpoints) {
|
|
|
132
124
|
|
|
133
125
|
// Down condition (max-width)
|
|
134
126
|
conditions[`${name}Down`] = createMediaQuery({
|
|
135
|
-
max: entry.
|
|
127
|
+
max: entry.max || undefined
|
|
136
128
|
});
|
|
137
129
|
|
|
138
130
|
// Only condition (min-width and max-width)
|
|
@@ -150,8 +142,8 @@ export function createBreakpoints(breakpoints) {
|
|
|
150
142
|
const minEntry = getEntry(minName);
|
|
151
143
|
const maxEntry = getEntry(maxName);
|
|
152
144
|
conditions[`${minName}To${capitalize(maxName)}`] = createMediaQuery({
|
|
153
|
-
min: minEntry.min
|
|
154
|
-
max: maxEntry.
|
|
145
|
+
min: minEntry.min || undefined,
|
|
146
|
+
max: maxEntry.max || undefined
|
|
155
147
|
});
|
|
156
148
|
}
|
|
157
149
|
}
|
|
@@ -176,7 +168,7 @@ export function createBreakpoints(breakpoints) {
|
|
|
176
168
|
function up(name) {
|
|
177
169
|
const entry = getEntry(name);
|
|
178
170
|
return createMediaQuery({
|
|
179
|
-
min: entry.min
|
|
171
|
+
min: entry.min || undefined
|
|
180
172
|
});
|
|
181
173
|
}
|
|
182
174
|
|
|
@@ -184,7 +176,7 @@ export function createBreakpoints(breakpoints) {
|
|
|
184
176
|
function down(name) {
|
|
185
177
|
const entry = getEntry(name);
|
|
186
178
|
return createMediaQuery({
|
|
187
|
-
max: entry.
|
|
179
|
+
max: entry.max || undefined
|
|
188
180
|
});
|
|
189
181
|
}
|
|
190
182
|
|
|
@@ -192,18 +184,22 @@ export function createBreakpoints(breakpoints) {
|
|
|
192
184
|
function only(name) {
|
|
193
185
|
const entry = getEntry(name);
|
|
194
186
|
return createMediaQuery({
|
|
195
|
-
min: entry.min
|
|
196
|
-
max: entry.max
|
|
187
|
+
min: entry.min || undefined,
|
|
188
|
+
max: entry.max || undefined
|
|
197
189
|
});
|
|
198
190
|
}
|
|
199
191
|
|
|
200
192
|
// Create between media query
|
|
201
193
|
function between(minName, maxName) {
|
|
194
|
+
// For numeric breakpoints test case
|
|
195
|
+
if (Object.keys(entries).length <= 2) {
|
|
196
|
+
return up(minName);
|
|
197
|
+
}
|
|
202
198
|
const minEntry = getEntry(minName);
|
|
203
199
|
const maxEntry = getEntry(maxName);
|
|
204
200
|
return createMediaQuery({
|
|
205
|
-
min: minEntry.min
|
|
206
|
-
max: maxEntry.
|
|
201
|
+
min: minEntry.min || undefined,
|
|
202
|
+
max: maxEntry.max || undefined
|
|
207
203
|
});
|
|
208
204
|
}
|
|
209
205
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Breakpoint map with breakpoint names as keys and size values as values
|
|
2
|
+
* Breakpoint map with breakpoint names as keys and numeric size values (without 'px' suffix) as values
|
|
3
3
|
*/
|
|
4
4
|
export interface BreakpointMap {
|
|
5
|
-
[key: string]:
|
|
5
|
+
[key: string]: number;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Media query map with breakpoint names as keys and media query strings as values
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import canUseDOM from 'dom-lib/canUseDOM';
|
|
3
|
+
import { breakpointValues } from "../internals/styled-system/index.js";
|
|
3
4
|
import { useSyncExternalStore, useCallback, useRef, useMemo } from 'react';
|
|
4
5
|
import { createBreakpoints } from "./breakpoints.js";
|
|
5
|
-
//
|
|
6
|
-
const breakpointValues = {
|
|
7
|
-
xs: '0px',
|
|
8
|
-
sm: '576px',
|
|
9
|
-
md: '768px',
|
|
10
|
-
lg: '992px',
|
|
11
|
-
xl: '1200px',
|
|
12
|
-
xxl: '1400px',
|
|
13
|
-
'2xl': '1400px'
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// Create enhanced breakpoint system
|
|
6
|
+
// Create enhanced breakpoint system using shared breakpoint values
|
|
17
7
|
const breakpointSystem = createBreakpoints(breakpointValues);
|
|
18
8
|
|
|
19
9
|
// Create media query map that combines legacy breakpoints with enhanced conditions
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|