rsuite 6.0.0-canary-20250620 → 6.0.0-canary-20250622

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 (193) hide show
  1. package/Accordion/styles/index.css +0 -78
  2. package/AutoComplete/styles/index.css +1 -79
  3. package/Avatar/styles/index.css +0 -78
  4. package/AvatarGroup/styles/index.css +0 -78
  5. package/Badge/styles/index.css +0 -78
  6. package/Box/styles/index.css +0 -78
  7. package/Breadcrumb/styles/index.css +0 -78
  8. package/Button/styles/index.css +0 -78
  9. package/ButtonGroup/styles/index.css +0 -78
  10. package/ButtonToolbar/styles/index.css +0 -82
  11. package/Calendar/styles/index.css +0 -78
  12. package/Card/styles/index.css +0 -78
  13. package/CardGroup/styles/index.css +0 -78
  14. package/Carousel/styles/index.css +0 -78
  15. package/CascadeTree/styles/index.css +0 -78
  16. package/Cascader/styles/index.css +1 -79
  17. package/Center/styles/index.css +0 -78
  18. package/CheckPicker/styles/index.css +1 -79
  19. package/CheckTree/styles/index.css +1 -79
  20. package/CheckTreePicker/styles/index.css +1 -79
  21. package/Checkbox/styles/index.css +0 -78
  22. package/CheckboxGroup/styles/index.css +0 -78
  23. package/Container/styles/index.css +0 -78
  24. package/Content/styles/index.css +0 -78
  25. package/DateInput/styles/index.css +0 -78
  26. package/DatePicker/styles/index.css +1 -79
  27. package/DateRangeInput/styles/index.css +0 -78
  28. package/DateRangePicker/styles/index.css +1 -79
  29. package/Divider/styles/index.css +0 -78
  30. package/Drawer/styles/index.css +0 -78
  31. package/Dropdown/styles/index.css +0 -78
  32. package/FlexboxGrid/styles/index.css +0 -78
  33. package/Footer/styles/index.css +0 -78
  34. package/Form/styles/index.css +0 -78
  35. package/FormControl/styles/index.css +0 -78
  36. package/FormControlLabel/styles/index.css +0 -78
  37. package/FormErrorMessage/styles/index.css +0 -78
  38. package/FormGroup/styles/index.css +0 -78
  39. package/FormHelpText/styles/index.css +0 -78
  40. package/FormStack/styles/index.css +0 -78
  41. package/Grid/styles/index.css +0 -78
  42. package/Header/styles/index.css +0 -78
  43. package/Heading/styles/index.css +0 -78
  44. package/HeadingGroup/styles/index.css +0 -78
  45. package/Highlight/styles/index.css +0 -78
  46. package/IconButton/styles/index.css +0 -78
  47. package/Image/styles/index.css +0 -78
  48. package/InlineEdit/styles/index.css +0 -78
  49. package/Input/styles/index.css +0 -78
  50. package/InputGroup/styles/index.css +1 -79
  51. package/InputNumber/styles/index.css +1 -79
  52. package/InputPicker/styles/index.css +1 -79
  53. package/Kbd/styles/index.css +0 -78
  54. package/Link/styles/index.css +0 -78
  55. package/List/styles/index.css +0 -78
  56. package/Loader/styles/index.css +0 -78
  57. package/Menu/styles/index.css +0 -78
  58. package/Message/styles/index.css +0 -78
  59. package/Modal/styles/index.css +0 -78
  60. package/MultiCascadeTree/styles/index.css +1 -79
  61. package/MultiCascader/styles/index.css +1 -79
  62. package/Nav/styles/index.css +0 -78
  63. package/Navbar/styles/index.css +0 -78
  64. package/Notification/styles/index.css +0 -78
  65. package/NumberInput/styles/index.css +1 -79
  66. package/Pagination/styles/index.css +1 -79
  67. package/Panel/styles/index.css +0 -78
  68. package/PanelGroup/styles/index.css +0 -78
  69. package/PasswordInput/styles/index.css +1 -79
  70. package/PasswordStrengthMeter/styles/index.css +0 -78
  71. package/PinInput/styles/index.css +0 -78
  72. package/Placeholder/styles/index.css +0 -78
  73. package/Popover/styles/index.css +0 -78
  74. package/Progress/styles/index.css +0 -78
  75. package/ProgressCircle/styles/index.css +0 -78
  76. package/Radio/styles/index.css +0 -78
  77. package/RadioGroup/styles/index.css +0 -78
  78. package/RadioTile/styles/index.css +0 -78
  79. package/RangeSlider/styles/index.css +0 -78
  80. package/Rate/styles/index.css +0 -78
  81. package/SegmentedControl/package.json +7 -0
  82. package/SegmentedControl/styles/index.css +159 -0
  83. package/SelectPicker/styles/index.css +1 -79
  84. package/Sidebar/styles/index.css +0 -78
  85. package/Sidenav/styles/index.css +0 -78
  86. package/Slider/styles/index.css +0 -78
  87. package/Stack/styles/index.css +0 -78
  88. package/Stat/styles/index.css +0 -78
  89. package/StatGroup/styles/index.css +0 -78
  90. package/Steps/styles/index.css +0 -78
  91. package/Table/styles/index.css +0 -78
  92. package/Tabs/styles/index.css +0 -78
  93. package/Tag/styles/index.css +0 -78
  94. package/TagGroup/styles/index.css +0 -78
  95. package/TagInput/styles/index.css +1 -79
  96. package/TagPicker/styles/index.css +1 -79
  97. package/Text/styles/index.css +0 -78
  98. package/Textarea/styles/index.css +0 -78
  99. package/TimePicker/styles/index.css +1 -79
  100. package/TimeRangePicker/styles/index.css +1 -79
  101. package/Timeline/styles/index.css +0 -78
  102. package/Toggle/styles/index.css +0 -78
  103. package/Tooltip/styles/index.css +0 -78
  104. package/Tree/styles/index.css +1 -79
  105. package/TreePicker/styles/index.css +1 -79
  106. package/Uploader/styles/index.css +0 -78
  107. package/cjs/ButtonToolbar/ButtonToolbar.js +2 -0
  108. package/cjs/Grid/utils/styles.d.ts +1 -1
  109. package/cjs/InputPicker/utils.d.ts +1 -1
  110. package/cjs/Nav/Nav.d.ts +2 -3
  111. package/cjs/RadioGroup/RadioGroup.d.ts +4 -1
  112. package/cjs/SegmentedControl/Indicator.d.ts +10 -0
  113. package/cjs/SegmentedControl/Indicator.js +22 -0
  114. package/cjs/SegmentedControl/SegmentedControl.d.ts +27 -0
  115. package/cjs/SegmentedControl/SegmentedControl.js +87 -0
  116. package/cjs/SegmentedControl/SegmentedItem.d.ts +16 -0
  117. package/cjs/SegmentedControl/SegmentedItem.js +44 -0
  118. package/cjs/SegmentedControl/hooks/useIndicatorPosition.d.ts +17 -0
  119. package/cjs/SegmentedControl/hooks/useIndicatorPosition.js +55 -0
  120. package/cjs/SegmentedControl/index.d.ts +4 -0
  121. package/cjs/SegmentedControl/index.js +11 -0
  122. package/cjs/Slider/ProgressBar.js +1 -1
  123. package/cjs/Stack/Stack.js +20 -5
  124. package/cjs/Stack/utils.d.ts +9 -0
  125. package/cjs/Stack/utils.js +38 -0
  126. package/cjs/Tabs/Tabs.d.ts +4 -2
  127. package/cjs/index.d.ts +1 -0
  128. package/cjs/index.js +6 -0
  129. package/cjs/internals/Box/Box.d.ts +27 -27
  130. package/cjs/internals/Box/Box.js +13 -8
  131. package/cjs/internals/Box/utils.d.ts +4 -1
  132. package/cjs/internals/Box/utils.js +154 -13
  133. package/cjs/internals/Provider/types.d.ts +2 -0
  134. package/cjs/internals/constants/index.js +2 -2
  135. package/cjs/internals/hooks/useElementResize.d.ts +2 -1
  136. package/cjs/internals/hooks/useElementResize.js +50 -7
  137. package/cjs/internals/hooks/useStyled.d.ts +60 -0
  138. package/cjs/internals/hooks/useStyled.js +257 -0
  139. package/cjs/internals/utils/colours.js +1 -1
  140. package/cjs/internals/utils/style-sheet/css.d.ts +1 -1
  141. package/cjs/internals/utils/style-sheet/css.js +1 -1
  142. package/cjs/internals/utils/style-sheet/index.d.ts +1 -0
  143. package/cjs/internals/utils/style-sheet/index.js +6 -0
  144. package/cjs/internals/utils/style-sheet/style-manager.d.ts +50 -0
  145. package/cjs/internals/utils/style-sheet/style-manager.js +97 -0
  146. package/dist/rsuite-no-reset.css +200 -101
  147. package/dist/rsuite-no-reset.min.css +1 -1
  148. package/dist/rsuite.css +200 -101
  149. package/dist/rsuite.js +172 -14
  150. package/dist/rsuite.js.map +1 -1
  151. package/dist/rsuite.min.css +1 -1
  152. package/dist/rsuite.min.js +1 -1
  153. package/dist/rsuite.min.js.map +1 -1
  154. package/esm/ButtonToolbar/ButtonToolbar.js +2 -0
  155. package/esm/Grid/utils/styles.d.ts +1 -1
  156. package/esm/InputPicker/utils.d.ts +1 -1
  157. package/esm/Nav/Nav.d.ts +2 -3
  158. package/esm/RadioGroup/RadioGroup.d.ts +4 -1
  159. package/esm/SegmentedControl/Indicator.d.ts +10 -0
  160. package/esm/SegmentedControl/Indicator.js +17 -0
  161. package/esm/SegmentedControl/SegmentedControl.d.ts +27 -0
  162. package/esm/SegmentedControl/SegmentedControl.js +81 -0
  163. package/esm/SegmentedControl/SegmentedItem.d.ts +16 -0
  164. package/esm/SegmentedControl/SegmentedItem.js +39 -0
  165. package/esm/SegmentedControl/hooks/useIndicatorPosition.d.ts +17 -0
  166. package/esm/SegmentedControl/hooks/useIndicatorPosition.js +50 -0
  167. package/esm/SegmentedControl/index.d.ts +4 -0
  168. package/esm/SegmentedControl/index.js +8 -0
  169. package/esm/Slider/ProgressBar.js +1 -1
  170. package/esm/Stack/Stack.js +21 -6
  171. package/esm/Stack/utils.d.ts +9 -0
  172. package/esm/Stack/utils.js +35 -0
  173. package/esm/Tabs/Tabs.d.ts +4 -2
  174. package/esm/index.d.ts +1 -0
  175. package/esm/index.js +1 -0
  176. package/esm/internals/Box/Box.d.ts +27 -27
  177. package/esm/internals/Box/Box.js +9 -4
  178. package/esm/internals/Box/utils.d.ts +4 -1
  179. package/esm/internals/Box/utils.js +153 -13
  180. package/esm/internals/Provider/types.d.ts +2 -0
  181. package/esm/internals/constants/index.js +2 -2
  182. package/esm/internals/hooks/useElementResize.d.ts +2 -1
  183. package/esm/internals/hooks/useElementResize.js +50 -7
  184. package/esm/internals/hooks/useStyled.d.ts +60 -0
  185. package/esm/internals/hooks/useStyled.js +251 -0
  186. package/esm/internals/utils/colours.js +1 -1
  187. package/esm/internals/utils/style-sheet/css.d.ts +1 -1
  188. package/esm/internals/utils/style-sheet/css.js +1 -1
  189. package/esm/internals/utils/style-sheet/index.d.ts +1 -0
  190. package/esm/internals/utils/style-sheet/index.js +2 -1
  191. package/esm/internals/utils/style-sheet/style-manager.d.ts +50 -0
  192. package/esm/internals/utils/style-sheet/style-manager.js +93 -0
  193. package/package.json +1 -1
@@ -0,0 +1,50 @@
1
+ /**
2
+ * StyleManager - A utility for managing CSS styles dynamically
3
+ *
4
+ * This manager creates and maintains a single style element in the document head
5
+ * and provides methods to add, update, and remove CSS rules.
6
+ * Supports CSP nonce for Content Security Policy compliance.
7
+ */
8
+ export declare const StyleManager: {
9
+ styleElement: HTMLStyleElement | null;
10
+ styleMap: Map<string, string>;
11
+ nonce: string | undefined;
12
+ /**
13
+ * Initialize the style element if it doesn't exist
14
+ * @param options - Optional configuration options
15
+ * @param options.nonce - CSP nonce to apply to the style element
16
+ * @returns The style element
17
+ */
18
+ init(options?: {
19
+ nonce?: string;
20
+ }): HTMLStyleElement | null;
21
+ /**
22
+ * Set the CSP nonce for the style element
23
+ * @param nonce - CSP nonce value
24
+ */
25
+ setNonce(nonce?: string): void;
26
+ /**
27
+ * Add a CSS rule to the style sheet
28
+ * @param selector - CSS selector
29
+ * @param cssText - CSS properties and values
30
+ * @param options - Optional configuration options
31
+ * @param options.nonce - CSP nonce to apply to the style element
32
+ */
33
+ addRule(selector: string, cssText: string, options?: {
34
+ nonce?: string;
35
+ }): void;
36
+ /**
37
+ * Remove a CSS rule from the style sheet
38
+ * @param selector - CSS selector to remove
39
+ */
40
+ removeRule(selector: string): void;
41
+ /**
42
+ * Update the style element with all current rules
43
+ */
44
+ updateStyles(): void;
45
+ /**
46
+ * Clear all rules from the style sheet
47
+ */
48
+ clearRules(): void;
49
+ };
50
+ export default StyleManager;
@@ -0,0 +1,93 @@
1
+ 'use client';
2
+ /**
3
+ * StyleManager - A utility for managing CSS styles dynamically
4
+ *
5
+ * This manager creates and maintains a single style element in the document head
6
+ * and provides methods to add, update, and remove CSS rules.
7
+ * Supports CSP nonce for Content Security Policy compliance.
8
+ */
9
+
10
+ // Global style sheet manager
11
+ export const StyleManager = {
12
+ styleElement: null,
13
+ styleMap: new Map(),
14
+ nonce: undefined,
15
+ /**
16
+ * Initialize the style element if it doesn't exist
17
+ * @param options - Optional configuration options
18
+ * @param options.nonce - CSP nonce to apply to the style element
19
+ * @returns The style element
20
+ */
21
+ init(options) {
22
+ if (!this.styleElement && typeof document !== 'undefined') {
23
+ this.styleElement = document.createElement('style');
24
+ this.styleElement.setAttribute('data-rs-style-manager', '');
25
+
26
+ // Apply CSP nonce if provided
27
+ const nonce = (options === null || options === void 0 ? void 0 : options.nonce) || this.nonce;
28
+ if (nonce) {
29
+ this.styleElement.setAttribute('nonce', nonce);
30
+ this.nonce = nonce; // Store for future use
31
+ }
32
+ document.head.appendChild(this.styleElement);
33
+ }
34
+ return this.styleElement;
35
+ },
36
+ /**
37
+ * Set the CSP nonce for the style element
38
+ * @param nonce - CSP nonce value
39
+ */
40
+ setNonce(nonce) {
41
+ this.nonce = nonce;
42
+
43
+ // Apply to existing style element if it exists
44
+ if (this.styleElement && nonce) {
45
+ this.styleElement.setAttribute('nonce', nonce);
46
+ }
47
+ },
48
+ /**
49
+ * Add a CSS rule to the style sheet
50
+ * @param selector - CSS selector
51
+ * @param cssText - CSS properties and values
52
+ * @param options - Optional configuration options
53
+ * @param options.nonce - CSP nonce to apply to the style element
54
+ */
55
+ addRule(selector, cssText, options) {
56
+ this.init(options);
57
+ if (!this.styleMap.has(selector) || this.styleMap.get(selector) !== cssText) {
58
+ this.styleMap.set(selector, cssText);
59
+ this.updateStyles();
60
+ }
61
+ },
62
+ /**
63
+ * Remove a CSS rule from the style sheet
64
+ * @param selector - CSS selector to remove
65
+ */
66
+ removeRule(selector) {
67
+ if (this.styleMap.has(selector)) {
68
+ this.styleMap.delete(selector);
69
+ this.updateStyles();
70
+ }
71
+ },
72
+ /**
73
+ * Update the style element with all current rules
74
+ */
75
+ updateStyles() {
76
+ if (!this.styleElement) return;
77
+ let cssText = '';
78
+ this.styleMap.forEach((rules, selector) => {
79
+ cssText += `${selector} { ${rules} }\n`;
80
+ });
81
+ this.styleElement.textContent = cssText;
82
+ },
83
+ /**
84
+ * Clear all rules from the style sheet
85
+ */
86
+ clearRules() {
87
+ this.styleMap.clear();
88
+ if (this.styleElement) {
89
+ this.styleElement.textContent = '';
90
+ }
91
+ }
92
+ };
93
+ export default StyleManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "6.0.0-canary-20250620",
3
+ "version": "6.0.0-canary-20250622",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",