blue-react 9.1.8 → 9.3.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/ToastProvider.js +137 -0
- package/dist/components/shared.js +4 -1
- package/dist/style.css +706 -2
- package/dist/style.min.css +3 -3
- package/dist/style.scss +2 -1
- package/dist/styles/_buttons.scss +110 -0
- package/dist/types/components/ToastProvider.d.ts +23 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/package.json +1 -1
package/dist/style.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Blue React v9.
|
|
2
|
+
* Blue React v9.3.0-alpha2 (https://bruegmann.github.io/blue-react)
|
|
3
3
|
* Licensed under GNU General Public License v3.0 (https://github.com/bruegmann/blue-react/blob/master/LICENSE).
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -24,3 +24,4 @@
|
|
|
24
24
|
@import "./styles/_caret";
|
|
25
25
|
@import "./styles/_tooltips";
|
|
26
26
|
@import "./styles/_hover";
|
|
27
|
+
@import "./styles/buttons";
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Inspired by Bootstrap's button system but extended with more variants
|
|
2
|
+
|
|
3
|
+
// Soft buttons
|
|
4
|
+
|
|
5
|
+
// scss-docs-start btn-variant-loops
|
|
6
|
+
@each $color, $value in $theme-colors {
|
|
7
|
+
$bg: tint-color($value, 80%);
|
|
8
|
+
$text-color: shade-color($value, 60%);
|
|
9
|
+
|
|
10
|
+
.blue-btn-soft-#{$color} {
|
|
11
|
+
@if $color == "light" {
|
|
12
|
+
$text-color: color-contrast($value);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include button-variant(
|
|
16
|
+
$bg,
|
|
17
|
+
$bg,
|
|
18
|
+
$text-color,
|
|
19
|
+
$hover-background: shade-color($bg, $btn-hover-bg-shade-amount),
|
|
20
|
+
$hover-border: shade-color($bg, $btn-hover-border-shade-amount),
|
|
21
|
+
$active-background: shade-color($bg, $btn-active-bg-shade-amount),
|
|
22
|
+
$active-border: shade-color($bg, $btn-active-border-shade-amount)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@include color-mode(dark) {
|
|
28
|
+
@each $color, $value in $theme-colors {
|
|
29
|
+
$bg: shade-color($value, 80%);
|
|
30
|
+
$text-color: tint-color($value, 60%);
|
|
31
|
+
|
|
32
|
+
.blue-btn-soft-#{$color} {
|
|
33
|
+
@if $color == "dark" {
|
|
34
|
+
$text-color: color-contrast($value);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@include button-variant(
|
|
38
|
+
$bg,
|
|
39
|
+
$bg,
|
|
40
|
+
$text-color,
|
|
41
|
+
$hover-background: tint-color($bg, $btn-hover-bg-tint-amount),
|
|
42
|
+
$hover-border: tint-color($bg, $btn-hover-border-tint-amount),
|
|
43
|
+
$active-background: tint-color($bg, $btn-active-bg-tint-amount),
|
|
44
|
+
$active-border: tint-color($bg, $btn-active-border-tint-amount)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Plain buttons
|
|
51
|
+
|
|
52
|
+
// scss-docs-start btn-variant-loops
|
|
53
|
+
@each $color, $value in $theme-colors {
|
|
54
|
+
$bg: tint-color($value, 80%);
|
|
55
|
+
$text-color: $value;
|
|
56
|
+
|
|
57
|
+
$active-background: if(
|
|
58
|
+
$color == $color-contrast-light,
|
|
59
|
+
shade-color($value, $btn-active-bg-shade-amount),
|
|
60
|
+
tint-color($value, $btn-active-bg-tint-amount)
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
.blue-btn-plain-#{$color} {
|
|
64
|
+
@if $color == "light" {
|
|
65
|
+
$text-color: color-contrast($value);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@include button-variant(
|
|
69
|
+
transparent,
|
|
70
|
+
transparent,
|
|
71
|
+
$text-color,
|
|
72
|
+
$hover-background: shade-color($bg, $btn-hover-bg-shade-amount),
|
|
73
|
+
$hover-border: shade-color($bg, $btn-hover-border-shade-amount),
|
|
74
|
+
$active-background: $active-background,
|
|
75
|
+
$active-border:
|
|
76
|
+
if(
|
|
77
|
+
$color == $color-contrast-light,
|
|
78
|
+
shade-color($value, $btn-active-border-shade-amount),
|
|
79
|
+
tint-color($value, $btn-active-border-tint-amount)
|
|
80
|
+
),
|
|
81
|
+
$active-color: color-contrast($active-background),
|
|
82
|
+
$disabled-background: $value,
|
|
83
|
+
$disabled-border: $value,
|
|
84
|
+
$disabled-color: color-contrast($value)
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
@include color-mode(dark) {
|
|
90
|
+
@each $color, $value in $theme-colors {
|
|
91
|
+
$bg: shade-color($value, 80%);
|
|
92
|
+
$text-color: $value;
|
|
93
|
+
|
|
94
|
+
.blue-btn-plain-#{$color} {
|
|
95
|
+
@if $color == "dark" {
|
|
96
|
+
$text-color: color-contrast($value);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include button-variant(
|
|
100
|
+
transparent,
|
|
101
|
+
transparent,
|
|
102
|
+
$text-color,
|
|
103
|
+
$hover-background: tint-color($bg, $btn-hover-bg-tint-amount),
|
|
104
|
+
$hover-border: tint-color($bg, $btn-hover-border-tint-amount),
|
|
105
|
+
$active-background: tint-color($bg, $btn-active-bg-tint-amount),
|
|
106
|
+
$active-border: tint-color($bg, $btn-active-border-tint-amount)
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface ToastProviderProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
successIcon?: ReactNode;
|
|
5
|
+
infoIcon?: ReactNode;
|
|
6
|
+
warningIcon?: ReactNode;
|
|
7
|
+
dangerIcon?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare type ToastItemType = "success" | "danger" | "info" | "warning";
|
|
10
|
+
export interface ToastItem {
|
|
11
|
+
type: ToastItemType;
|
|
12
|
+
title?: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Push notifications to your visitors using Bootstrap's toast component.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ToastProvider({ children, successIcon, infoIcon, warningIcon, dangerIcon }: ToastProviderProps): JSX.Element;
|
|
19
|
+
export declare const useToast: () => {
|
|
20
|
+
addToast: (toastItem: ToastItem) => void;
|
|
21
|
+
clearToasts: () => void;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -67,4 +67,6 @@ export { StatusProvider, useStatus } from "./dist/types/components/StatusProvide
|
|
|
67
67
|
export { default as Switch } from "./dist/types/components/Switch"
|
|
68
68
|
export { SwitchProps } from "./dist/types/components/Switch"
|
|
69
69
|
|
|
70
|
+
export { ToastProvider, useToast } from "./dist/types/components/ToastProvider"
|
|
71
|
+
|
|
70
72
|
export { default as Utilities } from "./dist/types/components/Utilities"
|
package/index.js
CHANGED
|
@@ -21,4 +21,6 @@ exports.Status = require("./dist/components/Status.js")["default"]
|
|
|
21
21
|
exports.StatusProvider = require("./dist/components/StatusProvider.js")["StatusProvider"]
|
|
22
22
|
exports.useStatus = require("./dist/components/StatusProvider.js")["useStatus"]
|
|
23
23
|
exports.Switch = require("./dist/components/Switch.js")["default"]
|
|
24
|
+
exports.ToastProvider = require("./dist/components/ToastProvider.js")["ToastProvider"]
|
|
25
|
+
exports.useToast = require("./dist/components/ToastProvider.js")["useToast"]
|
|
24
26
|
exports.Utilities = require("./dist/components/Utilities.js")["default"]
|