@react-cupertino-ui/alert 1.0.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/LICENSE +24 -0
- package/dist/index.css +155 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +46 -0
- package/dist/index.scss +162 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Anderson Lima
|
|
4
|
+
|
|
5
|
+
This project is inspired by Apple's design principles but is not affiliated with, endorsed, or sponsored by Apple Inc.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
in the Software without restriction, including without limitation the rights
|
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
furnished to do so, subject to the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
SOFTWARE.
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
.react-cupertino-ui-alert {
|
|
2
|
+
--alert-accent: var(--color-blue, #0a84ff);
|
|
3
|
+
--alert-foreground: color-mix(in srgb, #050505, var(--color-foreground, #0b0b0f) 60%);
|
|
4
|
+
--alert-muted: color-mix(in srgb, var(--alert-foreground), rgba(255, 255, 255, 0.1) 65%);
|
|
5
|
+
--alert-border: color-mix(in srgb, var(--alert-accent), transparent 70%);
|
|
6
|
+
--alert-glass-opacity: 0.75;
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
gap: 0.85rem;
|
|
11
|
+
width: 100%;
|
|
12
|
+
padding: 1rem 1.25rem;
|
|
13
|
+
padding-right: 2.75rem;
|
|
14
|
+
border-radius: 24px;
|
|
15
|
+
border: 1px solid var(--alert-border);
|
|
16
|
+
color: var(--alert-foreground);
|
|
17
|
+
background: rgba(255, 255, 255, 0.85);
|
|
18
|
+
box-shadow: 0 18px 38px rgba(11, 11, 11, 0.12);
|
|
19
|
+
isolation: isolate;
|
|
20
|
+
transition-property: background-color;
|
|
21
|
+
transition-duration: var(--spring-duration, 450ms);
|
|
22
|
+
transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
23
|
+
}
|
|
24
|
+
.react-cupertino-ui-alert.is-glass {
|
|
25
|
+
background: rgba(255, 255, 255, var(--alert-glass-opacity));
|
|
26
|
+
backdrop-filter: blur(var(--glass-blur, 40px)) saturate(var(--glass-saturation, 180%));
|
|
27
|
+
-webkit-backdrop-filter: blur(var(--glass-blur, 40px)) saturate(var(--glass-saturation, 180%));
|
|
28
|
+
border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.18));
|
|
29
|
+
box-shadow: var(--glass-shadow, 0 8px 32px rgba(0, 0, 0, 0.12));
|
|
30
|
+
position: relative;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
.react-cupertino-ui-alert.is-glass::before {
|
|
34
|
+
content: "";
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
background: var(--glass-highlight, linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 55%));
|
|
38
|
+
border-radius: inherit;
|
|
39
|
+
opacity: var(--glass-highlight-opacity, 0.95);
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
mix-blend-mode: screen;
|
|
42
|
+
}
|
|
43
|
+
@supports not (backdrop-filter: blur(2px)) {
|
|
44
|
+
.react-cupertino-ui-alert.is-glass {
|
|
45
|
+
background: color-mix(in srgb, var(--alert-accent), white 95%);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.react-cupertino-ui-alert:not(.is-glass) {
|
|
49
|
+
background: color-mix(in srgb, var(--alert-accent), white 92%);
|
|
50
|
+
box-shadow: 0 25px 60px rgba(10, 10, 10, 0.12);
|
|
51
|
+
}
|
|
52
|
+
.react-cupertino-ui-alert__icon {
|
|
53
|
+
position: relative;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
width: 2.25rem;
|
|
56
|
+
height: 2.25rem;
|
|
57
|
+
border-radius: 999px;
|
|
58
|
+
display: inline-flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
justify-content: center;
|
|
61
|
+
color: var(--alert-accent);
|
|
62
|
+
background: color-mix(in srgb, var(--alert-accent), transparent 80%);
|
|
63
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 25px rgba(0, 0, 0, 0.12);
|
|
64
|
+
}
|
|
65
|
+
.react-cupertino-ui-alert__body {
|
|
66
|
+
flex: 1;
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
gap: 0.35rem;
|
|
70
|
+
min-width: 0;
|
|
71
|
+
}
|
|
72
|
+
.react-cupertino-ui-alert__title {
|
|
73
|
+
margin: 0;
|
|
74
|
+
font-size: 1rem;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
letter-spacing: 0.01em;
|
|
77
|
+
color: var(--alert-foreground);
|
|
78
|
+
}
|
|
79
|
+
.react-cupertino-ui-alert__description {
|
|
80
|
+
margin: 0;
|
|
81
|
+
font-size: 0.95rem;
|
|
82
|
+
line-height: 1.45;
|
|
83
|
+
color: var(--alert-muted);
|
|
84
|
+
}
|
|
85
|
+
.react-cupertino-ui-alert__actions {
|
|
86
|
+
display: flex;
|
|
87
|
+
gap: 0.5rem;
|
|
88
|
+
flex-wrap: wrap;
|
|
89
|
+
margin-top: 0.75rem;
|
|
90
|
+
}
|
|
91
|
+
.react-cupertino-ui-alert__actions.layout-inline {
|
|
92
|
+
justify-content: flex-start;
|
|
93
|
+
}
|
|
94
|
+
.react-cupertino-ui-alert__actions.layout-stacked {
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
width: 100%;
|
|
97
|
+
}
|
|
98
|
+
.react-cupertino-ui-alert__action {
|
|
99
|
+
--button-height: 2.3rem;
|
|
100
|
+
font-size: 0.9rem;
|
|
101
|
+
width: fit-content;
|
|
102
|
+
}
|
|
103
|
+
.react-cupertino-ui-alert__action:only-child {
|
|
104
|
+
margin-inline-end: 0;
|
|
105
|
+
}
|
|
106
|
+
.react-cupertino-ui-alert__action .react-cupertino-ui-button__label {
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
}
|
|
109
|
+
.react-cupertino-ui-alert__dismiss {
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: 0.6rem;
|
|
112
|
+
right: 0.6rem;
|
|
113
|
+
width: 2rem;
|
|
114
|
+
height: 2rem;
|
|
115
|
+
border: none;
|
|
116
|
+
border-radius: 999px;
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
color: var(--alert-accent);
|
|
121
|
+
background: color-mix(in srgb, var(--alert-accent), white 85%);
|
|
122
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
-webkit-tap-highlight-color: transparent;
|
|
125
|
+
transition-property: transform;
|
|
126
|
+
transition-duration: var(--spring-duration, 500ms);
|
|
127
|
+
transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
128
|
+
}
|
|
129
|
+
.react-cupertino-ui-alert__dismiss:hover {
|
|
130
|
+
transform: scale(1.05);
|
|
131
|
+
}
|
|
132
|
+
.react-cupertino-ui-alert__dismiss:active {
|
|
133
|
+
transform: scale(0.95);
|
|
134
|
+
}
|
|
135
|
+
.react-cupertino-ui-alert.tone-neutral {
|
|
136
|
+
--alert-accent: #8e8e93;
|
|
137
|
+
--alert-foreground: #1c1c1e;
|
|
138
|
+
--alert-muted: color-mix(in srgb, var(--alert-foreground), white 35%);
|
|
139
|
+
}
|
|
140
|
+
.react-cupertino-ui-alert.tone-info {
|
|
141
|
+
--alert-accent: var(--color-blue, #0a84ff);
|
|
142
|
+
}
|
|
143
|
+
.react-cupertino-ui-alert.tone-success {
|
|
144
|
+
--alert-accent: #34c759;
|
|
145
|
+
--alert-foreground: #033c1f;
|
|
146
|
+
--alert-muted: color-mix(in srgb, #033c1f, white 35%);
|
|
147
|
+
}
|
|
148
|
+
.react-cupertino-ui-alert.tone-warning {
|
|
149
|
+
--alert-accent: #ff9f0a;
|
|
150
|
+
--alert-foreground: #3d2100;
|
|
151
|
+
}
|
|
152
|
+
.react-cupertino-ui-alert.tone-destructive {
|
|
153
|
+
--alert-accent: #ff453a;
|
|
154
|
+
--alert-foreground: #400805;
|
|
155
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { BaseProps } from "@react-cupertino-ui/shared/lib/interfaces/BaseProps";
|
|
3
|
+
import { type ButtonProps } from "@react-cupertino-ui/button";
|
|
4
|
+
import "./index.scss";
|
|
5
|
+
export type AlertTone = "neutral" | "info" | "success" | "warning" | "destructive";
|
|
6
|
+
export interface AlertActionItem extends Partial<Pick<ButtonProps, "variant" | "loading" | "fullWidth" | "disabled" | "icon" | "onClick" | "className" | "type">> {
|
|
7
|
+
key?: React.Key;
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface AlertProps extends Omit<BaseProps<HTMLDivElement>, "variant" | "size" | "asChild">, Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
11
|
+
tone?: AlertTone;
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
description?: React.ReactNode;
|
|
14
|
+
icon?: React.ReactNode | null;
|
|
15
|
+
glass?: boolean;
|
|
16
|
+
dismissible?: boolean;
|
|
17
|
+
onDismiss?: () => void;
|
|
18
|
+
actions?: AlertActionItem[];
|
|
19
|
+
actionsLayout?: "inline" | "stacked";
|
|
20
|
+
}
|
|
21
|
+
declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export { Alert };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { AlertTriangle, CheckCircle2, Info, ShieldAlert, MinusCircle, X, } from "lucide-react";
|
|
4
|
+
import { cn } from "@react-cupertino-ui/shared/lib/utils";
|
|
5
|
+
import { Button } from "@react-cupertino-ui/button";
|
|
6
|
+
import "./index.scss";
|
|
7
|
+
const toneIcons = {
|
|
8
|
+
neutral: MinusCircle,
|
|
9
|
+
info: Info,
|
|
10
|
+
success: CheckCircle2,
|
|
11
|
+
warning: AlertTriangle,
|
|
12
|
+
destructive: ShieldAlert,
|
|
13
|
+
};
|
|
14
|
+
const toneLiveRegion = {
|
|
15
|
+
neutral: "polite",
|
|
16
|
+
info: "polite",
|
|
17
|
+
success: "polite",
|
|
18
|
+
warning: "assertive",
|
|
19
|
+
destructive: "assertive",
|
|
20
|
+
};
|
|
21
|
+
const Alert = React.forwardRef((props, ref) => {
|
|
22
|
+
const { className, tone = "info", title, description, icon, glass = true, dismissible = false, onDismiss, actions, actionsLayout = "inline", children, role, ["aria-live"]: ariaLiveProp, ["aria-atomic"]: ariaAtomicProp, ...rest } = props;
|
|
23
|
+
const [isVisible, setIsVisible] = React.useState(true);
|
|
24
|
+
const IconComponent = toneIcons[tone];
|
|
25
|
+
const resolvedIcon = icon === null ? null : icon ?? (IconComponent ? _jsx(IconComponent, { "aria-hidden": "true" }) : null);
|
|
26
|
+
const resolvedRole = role ?? "alert";
|
|
27
|
+
const ariaLive = ariaLiveProp ?? toneLiveRegion[tone];
|
|
28
|
+
const ariaAtomic = ariaAtomicProp ?? true;
|
|
29
|
+
const classes = cn("react-cupertino-ui-alert", `tone-${tone}`, glass && "is-glass", actions?.length && "has-actions", className);
|
|
30
|
+
const handleDismiss = () => {
|
|
31
|
+
if (!dismissible) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
setIsVisible(false);
|
|
35
|
+
onDismiss?.();
|
|
36
|
+
};
|
|
37
|
+
if (!isVisible) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return (_jsxs("div", { ref: ref, role: resolvedRole, "aria-live": ariaLive, "aria-atomic": ariaAtomic, "data-tone": tone, "data-glass": glass ? "true" : undefined, "data-actions": actions?.length ? "true" : undefined, className: classes, ...rest, children: [resolvedIcon && _jsx("span", { className: "react-cupertino-ui-alert__icon", children: resolvedIcon }), _jsxs("div", { className: "react-cupertino-ui-alert__body", children: [title && _jsx("p", { className: "react-cupertino-ui-alert__title", children: title }), description && (_jsx("div", { className: "react-cupertino-ui-alert__description", children: description })), children, actions?.length ? (_jsx("div", { className: cn("react-cupertino-ui-alert__actions", `layout-${actionsLayout}`), "data-layout": actionsLayout, children: actions.map((action, index) => {
|
|
41
|
+
const { key, label, className: actionClassName, fullWidth, ...buttonProps } = action;
|
|
42
|
+
return (_jsx(Button, { size: "sm", fullWidth: typeof fullWidth === "boolean" ? fullWidth : actionsLayout === "stacked", className: cn("react-cupertino-ui-alert__action", actionClassName), ...buttonProps, children: label }, key ?? index));
|
|
43
|
+
}) })) : null] }), dismissible && (_jsx("button", { type: "button", className: "react-cupertino-ui-alert__dismiss", "aria-label": "Dismiss alert", onClick: handleDismiss, children: _jsx(X, { "aria-hidden": "true" }) }))] }));
|
|
44
|
+
});
|
|
45
|
+
Alert.displayName = "Alert";
|
|
46
|
+
export { Alert };
|
package/dist/index.scss
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
@use "@/styles/mixins/glass" as glass;
|
|
2
|
+
@use "@/styles/mixins/animations" as motion;
|
|
3
|
+
|
|
4
|
+
.react-cupertino-ui-alert {
|
|
5
|
+
--alert-accent: var(--color-blue, #0a84ff);
|
|
6
|
+
--alert-foreground: color-mix(in srgb, #050505, var(--color-foreground, #0b0b0f) 60%);
|
|
7
|
+
--alert-muted: color-mix(in srgb, var(--alert-foreground), rgba(255, 255, 255, 0.1) 65%);
|
|
8
|
+
--alert-border: color-mix(in srgb, var(--alert-accent), transparent 70%);
|
|
9
|
+
--alert-glass-opacity: 0.75;
|
|
10
|
+
|
|
11
|
+
position: relative;
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
gap: 0.85rem;
|
|
15
|
+
width: 100%;
|
|
16
|
+
padding: 1rem 1.25rem;
|
|
17
|
+
padding-right: 2.75rem;
|
|
18
|
+
border-radius: 24px;
|
|
19
|
+
border: 1px solid var(--alert-border);
|
|
20
|
+
color: var(--alert-foreground);
|
|
21
|
+
background: rgba(255, 255, 255, 0.85);
|
|
22
|
+
box-shadow: 0 18px 38px rgba(11, 11, 11, 0.12);
|
|
23
|
+
isolation: isolate;
|
|
24
|
+
@include motion.spring-transition(
|
|
25
|
+
background-color, var(--spring-duration, 450ms)
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
&.is-glass {
|
|
29
|
+
@include glass.glass-panel(light, var(--glass-blur, 40px), var(--alert-glass-opacity));
|
|
30
|
+
|
|
31
|
+
@supports not ((backdrop-filter: blur(2px))) {
|
|
32
|
+
background: color-mix(in srgb, var(--alert-accent), white 95%);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:not(.is-glass) {
|
|
37
|
+
background: color-mix(in srgb, var(--alert-accent), white 92%);
|
|
38
|
+
box-shadow: 0 25px 60px rgba(10, 10, 10, 0.12);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&__icon {
|
|
42
|
+
position: relative;
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
width: 2.25rem;
|
|
45
|
+
height: 2.25rem;
|
|
46
|
+
border-radius: 999px;
|
|
47
|
+
display: inline-flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
color: var(--alert-accent);
|
|
51
|
+
background: color-mix(in srgb, var(--alert-accent), transparent 80%);
|
|
52
|
+
box-shadow:
|
|
53
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.9),
|
|
54
|
+
0 10px 25px rgba(0, 0, 0, 0.12);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__body {
|
|
58
|
+
flex: 1;
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
gap: 0.35rem;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__title {
|
|
66
|
+
margin: 0;
|
|
67
|
+
font-size: 1rem;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
letter-spacing: 0.01em;
|
|
70
|
+
color: var(--alert-foreground);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&__description {
|
|
74
|
+
margin: 0;
|
|
75
|
+
font-size: 0.95rem;
|
|
76
|
+
line-height: 1.45;
|
|
77
|
+
color: var(--alert-muted);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__actions {
|
|
81
|
+
display: flex;
|
|
82
|
+
gap: 0.5rem;
|
|
83
|
+
flex-wrap: wrap;
|
|
84
|
+
margin-top: 0.75rem;
|
|
85
|
+
|
|
86
|
+
&.layout-inline {
|
|
87
|
+
justify-content: flex-start;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&.layout-stacked {
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&__action {
|
|
97
|
+
--button-height: 2.3rem;
|
|
98
|
+
font-size: 0.9rem;
|
|
99
|
+
width: fit-content;
|
|
100
|
+
|
|
101
|
+
&:only-child {
|
|
102
|
+
margin-inline-end: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.react-cupertino-ui-button__label {
|
|
106
|
+
font-weight: 600;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&__dismiss {
|
|
111
|
+
position: absolute;
|
|
112
|
+
top: 0.6rem;
|
|
113
|
+
right: 0.6rem;
|
|
114
|
+
width: 2rem;
|
|
115
|
+
height: 2rem;
|
|
116
|
+
border: none;
|
|
117
|
+
border-radius: 999px;
|
|
118
|
+
display: inline-flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
121
|
+
color: var(--alert-accent);
|
|
122
|
+
background: color-mix(in srgb, var(--alert-accent), white 85%);
|
|
123
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
-webkit-tap-highlight-color: transparent;
|
|
126
|
+
@include motion.spring-transition(transform);
|
|
127
|
+
|
|
128
|
+
&:hover {
|
|
129
|
+
transform: scale(1.05);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&:active {
|
|
133
|
+
transform: scale(0.95);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&.tone-neutral {
|
|
138
|
+
--alert-accent: #8e8e93;
|
|
139
|
+
--alert-foreground: #1c1c1e;
|
|
140
|
+
--alert-muted: color-mix(in srgb, var(--alert-foreground), white 35%);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&.tone-info {
|
|
144
|
+
--alert-accent: var(--color-blue, #0a84ff);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&.tone-success {
|
|
148
|
+
--alert-accent: #34c759;
|
|
149
|
+
--alert-foreground: #033c1f;
|
|
150
|
+
--alert-muted: color-mix(in srgb, #033c1f, white 35%);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&.tone-warning {
|
|
154
|
+
--alert-accent: #ff9f0a;
|
|
155
|
+
--alert-foreground: #3d2100;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&.tone-destructive {
|
|
159
|
+
--alert-accent: #ff453a;
|
|
160
|
+
--alert-foreground: #400805;
|
|
161
|
+
}
|
|
162
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@react-cupertino-ui/alert",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Alert component from React Cupertino UI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"./dist/**/*.css",
|
|
14
|
+
"./dist/**/*.scss"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc -p tsconfig.build.json && npm run build:styles",
|
|
18
|
+
"build:styles": "node ../../../scripts/build-styles.mjs"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"react": "^18.3.1",
|
|
22
|
+
"react-dom": "^18.3.1"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@react-cupertino-ui/button": "workspace:*",
|
|
26
|
+
"@react-cupertino-ui/shared": "workspace:*",
|
|
27
|
+
"lucide-react": "^0.417.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript": "^5.2.2"
|
|
31
|
+
},
|
|
32
|
+
"gitHead": "3f53987bdb936a331665691b517c2ba9984777f8",
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
}
|
|
36
|
+
}
|