blue-react 8.4.0-beta1 → 8.4.0
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/dist/components/Switch.js +40 -15
- package/dist/style.css +1562 -2083
- package/dist/style.min.css +5 -5
- package/dist/style.scss +1 -1
- package/dist/styles/_bootstrap.scss +1 -2
- package/dist/styles/_variables.scss +4 -4
- package/dist/types/components/Switch.d.ts +15 -3
- package/package.json +5 -5
package/dist/style.scss
CHANGED
|
@@ -9,10 +9,9 @@
|
|
|
9
9
|
// Configuration
|
|
10
10
|
@import "node_modules/bootstrap/scss/functions";
|
|
11
11
|
@import "node_modules/bootstrap/scss/variables";
|
|
12
|
-
@import "node_modules/bootstrap/scss/maps";
|
|
13
12
|
@import "node_modules/bootstrap/scss/mixins";
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
@import "./_bootstrap-mixins_overwritten.scss";
|
|
16
15
|
|
|
17
16
|
@import "node_modules/bootstrap/scss/utilities";
|
|
18
17
|
|
|
@@ -21,10 +21,10 @@ $theme-colors: map-merge(
|
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
// Since Bootstrap 5.1 this needs to be set. Otherwise we couldn't use .bg-* and .text-* utils with our custom $theme
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
$theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value");
|
|
25
|
+
$utilities-colors: map-merge($utilities-colors, $theme-colors-rgb);
|
|
26
|
+
$utilities-text-colors: map-merge($utilities-text-colors, map-loop($utilities-colors, rgba-css-var, "$key", "text"));
|
|
27
|
+
$utilities-bg-colors: map-merge($utilities-bg-colors, map-loop($utilities-colors, rgba-css-var, "$key", "bg"));
|
|
28
28
|
|
|
29
29
|
// Alpha value (RGBA) e.g. for header background.
|
|
30
30
|
$shimmering: 0.7 !default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
export interface SwitchProps {
|
|
3
3
|
className?: string;
|
|
4
4
|
checked?: boolean;
|
|
@@ -12,10 +12,22 @@ export interface SwitchProps {
|
|
|
12
12
|
*/
|
|
13
13
|
elementType?: string;
|
|
14
14
|
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Set prop to use the older look and feel. Will disappear in future releases.
|
|
17
|
+
*/
|
|
18
|
+
legacy?: boolean;
|
|
19
|
+
label?: ReactNode | string;
|
|
15
20
|
}
|
|
16
21
|
/**
|
|
17
|
-
*
|
|
22
|
+
* @deprecated
|
|
23
|
+
* Use Bootstrap's `.form-check.form-switch` instead:
|
|
24
|
+
* https://getbootstrap.com/docs/5.2/forms/checks-radios/#switches
|
|
25
|
+
*
|
|
26
|
+
* For now, this component acts as proxy for Bootstrap's Switch.
|
|
27
|
+
* To place a label next to the switch, use the new `label` prop.
|
|
28
|
+
*
|
|
29
|
+
* Migrate to Blue React 8.4.0 and use legacy support: Set the `label` with a string. Or set the `legacy` prop to use the previous look and behaviour.
|
|
18
30
|
*/
|
|
19
|
-
export default function Switch({ className, checked, onChange, sliderLabel, disabled, elementType }: SwitchProps): React.ReactElement<{
|
|
31
|
+
export default function Switch({ className, checked, onChange, sliderLabel, disabled, elementType, legacy, label }: SwitchProps): React.ReactElement<{
|
|
20
32
|
className: string;
|
|
21
33
|
}, string | React.JSXElementConstructor<any>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blue-react",
|
|
3
|
-
"version": "8.4.0
|
|
3
|
+
"version": "8.4.0",
|
|
4
4
|
"description": "Blue React Components",
|
|
5
5
|
"license": "LGPL-3.0-or-later",
|
|
6
6
|
"main": "index.js",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"predeploy": "npm run build-docs",
|
|
27
27
|
"deploy": "gh-pages --dist build --dest v8",
|
|
28
28
|
"prepublishOnly": "npm i && npm run build-release",
|
|
29
|
-
"release": "npm publish
|
|
29
|
+
"release": "npm publish && npm run deploy",
|
|
30
30
|
"prettier": "npx prettier --write ."
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@popperjs/core": "^2.
|
|
34
|
-
"bootstrap": "^5.
|
|
33
|
+
"@popperjs/core": "^2.10.2",
|
|
34
|
+
"bootstrap": "^5.1.3",
|
|
35
35
|
"clsx": "^1.1.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"postcss-minify": "^1.1.0",
|
|
61
61
|
"prettier": "2.4.1",
|
|
62
62
|
"react": "^18.1.0",
|
|
63
|
-
"react-bootstrap-icons": "^1.8.
|
|
63
|
+
"react-bootstrap-icons": "^1.8.4",
|
|
64
64
|
"react-docgen": "^5.4.0",
|
|
65
65
|
"react-dom": "^18.1.0",
|
|
66
66
|
"react-markdown-github": "^3.3.1",
|