@react-cupertino-ui/dialog 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 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,190 @@
1
+ .react-cupertino-ui-dialog__overlay {
2
+ position: fixed;
3
+ inset: 0;
4
+ z-index: 40;
5
+ background: radial-gradient(circle at 20% 20%, rgba(90, 200, 250, 0.25), transparent 55%), rgba(4, 6, 12, var(--dialog-overlay-opacity, 0.65));
6
+ backdrop-filter: blur(var(--dialog-overlay-blur, 48px)) saturate(180%);
7
+ -webkit-backdrop-filter: blur(var(--dialog-overlay-blur, 48px)) saturate(180%);
8
+ animation: dialog-overlay-in 420ms ease forwards;
9
+ }
10
+ .react-cupertino-ui-dialog__overlay[data-state=closed] {
11
+ animation: dialog-overlay-out 260ms ease forwards;
12
+ }
13
+ @media (prefers-reduced-motion: reduce) {
14
+ .react-cupertino-ui-dialog__overlay {
15
+ animation-duration: 0.01ms;
16
+ }
17
+ }
18
+
19
+ .react-cupertino-ui-dialog__content {
20
+ --dialog-width: 28rem;
21
+ --dialog-radius: 28px;
22
+ --dialog-glass-blur: var(--glass-blur, 40px);
23
+ --dialog-glass-opacity: var(--glass-opacity, 0.72);
24
+ --dialog-accent: var(--color-blue, #0a84ff);
25
+ position: fixed;
26
+ top: 50%;
27
+ left: 50%;
28
+ transform: translate(-50%, -50%);
29
+ width: min(var(--dialog-width), 100vw - 2.5rem);
30
+ max-height: calc(100vh - 3rem);
31
+ padding: clamp(1.8rem, 3vw, 2.6rem);
32
+ border-radius: var(--dialog-radius);
33
+ color: var(--foreground, #050505);
34
+ z-index: 50;
35
+ display: flex;
36
+ flex-direction: column;
37
+ gap: 1.5rem;
38
+ border: 1px solid rgba(255, 255, 255, 0.18);
39
+ background: rgba(250, 250, 252, 0.95);
40
+ box-shadow: 0 20px 55px rgba(9, 9, 11, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 35px color-mix(in srgb, var(--dialog-accent), transparent 60%);
41
+ backdrop-filter: blur(18px);
42
+ -webkit-backdrop-filter: blur(18px);
43
+ animation: dialog-content-in 480ms cubic-bezier(0.19, 0.82, 0.22, 1.2) forwards;
44
+ transition-property: all;
45
+ transition-duration: 360ms;
46
+ transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
47
+ }
48
+ .react-cupertino-ui-dialog__content::after {
49
+ content: "";
50
+ position: absolute;
51
+ inset: 0;
52
+ border-radius: inherit;
53
+ pointer-events: none;
54
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
55
+ }
56
+ .react-cupertino-ui-dialog__content:focus {
57
+ outline: none;
58
+ }
59
+ .react-cupertino-ui-dialog__content:focus-visible {
60
+ box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3), 0 20px 55px rgba(9, 9, 11, 0.25);
61
+ }
62
+ .react-cupertino-ui-dialog__content[data-state=closed] {
63
+ animation: dialog-content-out 280ms cubic-bezier(0.5, 0.15, 0.25, 1) forwards;
64
+ }
65
+ @media (max-width: 640px) {
66
+ .react-cupertino-ui-dialog__content {
67
+ padding: 1.6rem;
68
+ border-radius: 24px;
69
+ }
70
+ }
71
+ .react-cupertino-ui-dialog__content--glass {
72
+ background: rgba(255, 255, 255, var(--dialog-glass-opacity, 0.72));
73
+ backdrop-filter: blur(var(--dialog-glass-blur, 40px)) saturate(var(--glass-saturation, 180%));
74
+ -webkit-backdrop-filter: blur(var(--dialog-glass-blur, 40px)) saturate(var(--glass-saturation, 180%));
75
+ border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.18));
76
+ box-shadow: var(--glass-shadow, 0 8px 32px rgba(0, 0, 0, 0.12));
77
+ position: relative;
78
+ overflow: hidden;
79
+ }
80
+ .react-cupertino-ui-dialog__content--glass::before {
81
+ content: "";
82
+ position: absolute;
83
+ inset: 0;
84
+ background: var(--glass-highlight, linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 55%));
85
+ border-radius: inherit;
86
+ opacity: var(--glass-highlight-opacity, 0.95);
87
+ pointer-events: none;
88
+ mix-blend-mode: screen;
89
+ }
90
+ @supports not (backdrop-filter: blur(2px)) {
91
+ .react-cupertino-ui-dialog__content {
92
+ background: rgba(255, 255, 255, 0.95);
93
+ }
94
+ }
95
+ .react-cupertino-ui-dialog__content--sm {
96
+ --dialog-width: 22rem;
97
+ }
98
+ .react-cupertino-ui-dialog__content--md {
99
+ --dialog-width: 28rem;
100
+ }
101
+ .react-cupertino-ui-dialog__content--lg {
102
+ --dialog-width: 34rem;
103
+ }
104
+ .react-cupertino-ui-dialog__content[data-tone=destructive] {
105
+ --dialog-accent: var(--color-red, #ff3b30);
106
+ }
107
+ .react-cupertino-ui-dialog__content[data-tone=success] {
108
+ --dialog-accent: var(--color-green, #34c759);
109
+ }
110
+ .react-cupertino-ui-dialog__content[data-tone=default] {
111
+ --dialog-accent: var(--color-blue, #0a84ff);
112
+ }
113
+
114
+ .react-cupertino-ui-dialog__header {
115
+ display: flex;
116
+ flex-direction: column;
117
+ text-align: center;
118
+ gap: 0.5rem;
119
+ }
120
+
121
+ .react-cupertino-ui-dialog__title {
122
+ font-size: clamp(1.25rem, 1.3rem + 0.5vw, 1.65rem);
123
+ font-weight: 650;
124
+ letter-spacing: -0.01em;
125
+ color: var(--foreground, #050505);
126
+ }
127
+
128
+ .react-cupertino-ui-dialog__description {
129
+ font-size: 1rem;
130
+ line-height: 1.6;
131
+ color: color-mix(in srgb, var(--foreground, #050505), transparent 35%);
132
+ }
133
+
134
+ .react-cupertino-ui-dialog__footer {
135
+ display: flex;
136
+ flex-direction: column;
137
+ gap: 0.75rem;
138
+ width: 100%;
139
+ }
140
+ @media (min-width: 480px) {
141
+ .react-cupertino-ui-dialog__footer {
142
+ flex-direction: row-reverse;
143
+ }
144
+ }
145
+
146
+ .react-cupertino-ui-dialog__button {
147
+ flex: 1;
148
+ }
149
+
150
+ @keyframes dialog-overlay-in {
151
+ from {
152
+ opacity: 0;
153
+ backdrop-filter: blur(0) saturate(120%);
154
+ }
155
+ to {
156
+ opacity: 1;
157
+ backdrop-filter: blur(var(--dialog-overlay-blur, 48px)) saturate(180%);
158
+ }
159
+ }
160
+ @keyframes dialog-overlay-out {
161
+ from {
162
+ opacity: 1;
163
+ }
164
+ to {
165
+ opacity: 0;
166
+ }
167
+ }
168
+ @keyframes dialog-content-in {
169
+ 0% {
170
+ opacity: 0;
171
+ transform: translate(-50%, -46%) scale(0.96);
172
+ }
173
+ 60% {
174
+ opacity: 1;
175
+ transform: translate(-50%, -50.5%) scale(1.01);
176
+ }
177
+ 100% {
178
+ transform: translate(-50%, -50%) scale(1);
179
+ }
180
+ }
181
+ @keyframes dialog-content-out {
182
+ from {
183
+ opacity: 1;
184
+ transform: translate(-50%, -50%) scale(1);
185
+ }
186
+ to {
187
+ opacity: 0;
188
+ transform: translate(-50%, -46%) scale(0.96);
189
+ }
190
+ }
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
3
+ import "./index.scss";
4
+ import glassTokens from "@react-cupertino-ui/shared/lib/constants/tokens/glass";
5
+ import { type ButtonProps } from "@react-cupertino-ui/button";
6
+ declare const AlertDialog: React.FC<AlertDialogPrimitive.AlertDialogProps>;
7
+ declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
8
+ declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
9
+ type GlassBlur = keyof typeof glassTokens.blur;
10
+ type DialogSize = "sm" | "md" | "lg";
11
+ type DialogTone = "default" | "destructive" | "success";
12
+ interface AlertDialogOverlayProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay> {
13
+ blur?: GlassBlur;
14
+ overlayOpacity?: number;
15
+ }
16
+ declare const AlertDialogOverlay: React.ForwardRefExoticComponent<AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
17
+ export interface AlertDialogContentProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> {
18
+ glass?: boolean;
19
+ blur?: GlassBlur;
20
+ intensity?: number;
21
+ size?: DialogSize;
22
+ tone?: DialogTone;
23
+ }
24
+ declare const AlertDialogContent: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
25
+ declare const AlertDialogHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
26
+ declare const AlertDialogFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
27
+ declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
28
+ declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
29
+ type DialogButtonOptions = Partial<Pick<ButtonProps, "size" | "fullWidth" | "loading" | "icon">> & {
30
+ buttonVariant?: ButtonProps["variant"];
31
+ buttonClassName?: string;
32
+ };
33
+ interface AlertDialogActionProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>, DialogButtonOptions {
34
+ }
35
+ interface AlertDialogCancelProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>, DialogButtonOptions {
36
+ }
37
+ declare const AlertDialogAction: React.ForwardRefExoticComponent<AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>>;
38
+ declare const AlertDialogCancel: React.ForwardRefExoticComponent<AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>>;
39
+ export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
package/dist/index.js ADDED
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
5
+ import "./index.scss";
6
+ import { cn } from "@react-cupertino-ui/shared/lib/utils";
7
+ import glassTokens from "@react-cupertino-ui/shared/lib/constants/tokens/glass";
8
+ import { Button } from "@react-cupertino-ui/button";
9
+ const AlertDialog = AlertDialogPrimitive.Root;
10
+ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
11
+ const AlertDialogPortal = AlertDialogPrimitive.Portal;
12
+ const AlertDialogOverlay = React.forwardRef(({ className, blur = "lg", overlayOpacity = 0.65, style, ...props }, ref) => {
13
+ const clampedOpacity = Math.min(Math.max(overlayOpacity, 0), 1);
14
+ const overlayStyle = {
15
+ ...style,
16
+ "--dialog-overlay-blur": glassTokens.blur[blur],
17
+ "--dialog-overlay-opacity": clampedOpacity.toString(),
18
+ };
19
+ return (_jsx(AlertDialogPrimitive.Overlay, { ref: ref, className: cn("react-cupertino-ui-dialog__overlay", className), style: overlayStyle, ...props }));
20
+ });
21
+ AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
22
+ const AlertDialogContent = React.forwardRef(({ className, children, glass = true, blur = "lg", intensity, size = "md", tone = "default", style, ...props }, ref) => {
23
+ const cssVars = {
24
+ ...style,
25
+ };
26
+ if (glass) {
27
+ cssVars["--dialog-glass-blur"] = glassTokens.blur[blur];
28
+ }
29
+ if (typeof intensity === "number") {
30
+ const clamped = Math.min(Math.max(intensity, 0), 1);
31
+ cssVars["--dialog-glass-opacity"] = clamped.toString();
32
+ }
33
+ return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, { ref: ref, className: cn("react-cupertino-ui-dialog__content", glass && "react-cupertino-ui-dialog__content--glass", `react-cupertino-ui-dialog__content--${size}`, className), "data-tone": tone, "data-glass": glass ? "true" : undefined, style: cssVars, ...props, children: children })] }));
34
+ });
35
+ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
36
+ const AlertDialogHeader = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("react-cupertino-ui-dialog__header", className), ...props })));
37
+ AlertDialogHeader.displayName = "AlertDialogHeader";
38
+ const AlertDialogFooter = React.forwardRef(({ className, ...props }, ref) => (_jsx("div", { ref: ref, className: cn("react-cupertino-ui-dialog__footer", className), ...props })));
39
+ AlertDialogFooter.displayName = "AlertDialogFooter";
40
+ const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Title, { ref: ref, className: cn("react-cupertino-ui-dialog__title", className), ...props })));
41
+ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
42
+ const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => (_jsx(AlertDialogPrimitive.Description, { ref: ref, className: cn("react-cupertino-ui-dialog__description", className), ...props })));
43
+ AlertDialogDescription.displayName =
44
+ AlertDialogPrimitive.Description.displayName;
45
+ const AlertDialogAction = React.forwardRef(({ className, children, size = "default", fullWidth = true, loading = false, icon, buttonVariant = "glass", buttonClassName, ...props }, ref) => (_jsx(AlertDialogPrimitive.Action, { ref: ref, asChild: true, ...props, children: _jsx(Button, { variant: buttonVariant, size: size, fullWidth: fullWidth, loading: loading, icon: icon, className: cn("react-cupertino-ui-dialog__button", buttonClassName, className), children: children }) })));
46
+ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
47
+ const AlertDialogCancel = React.forwardRef(({ className, children, size = "default", fullWidth = true, loading = false, icon, buttonVariant = "outline", buttonClassName, ...props }, ref) => (_jsx(AlertDialogPrimitive.Cancel, { ref: ref, asChild: true, ...props, children: _jsx(Button, { variant: buttonVariant, size: size, fullWidth: fullWidth, loading: loading, icon: icon, className: cn("react-cupertino-ui-dialog__button", buttonClassName, className), children: children }) })));
48
+ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
49
+ export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
@@ -0,0 +1,204 @@
1
+ @use "@/styles/mixins/glass" as glass;
2
+ @use "@/styles/mixins/animations" as motion;
3
+
4
+ .react-cupertino-ui-dialog__overlay {
5
+ position: fixed;
6
+ inset: 0;
7
+ z-index: 40;
8
+ background:
9
+ radial-gradient(circle at 20% 20%, rgba(90, 200, 250, 0.25), transparent 55%),
10
+ rgba(4, 6, 12, var(--dialog-overlay-opacity, 0.65));
11
+ backdrop-filter: blur(var(--dialog-overlay-blur, 48px)) saturate(180%);
12
+ -webkit-backdrop-filter: blur(var(--dialog-overlay-blur, 48px)) saturate(180%);
13
+ animation: dialog-overlay-in 420ms ease forwards;
14
+
15
+ &[data-state="closed"] {
16
+ animation: dialog-overlay-out 260ms ease forwards;
17
+ }
18
+
19
+ @media (prefers-reduced-motion: reduce) {
20
+ animation-duration: 0.01ms;
21
+ }
22
+ }
23
+
24
+ .react-cupertino-ui-dialog__content {
25
+ --dialog-width: 28rem;
26
+ --dialog-radius: 28px;
27
+ --dialog-glass-blur: var(--glass-blur, 40px);
28
+ --dialog-glass-opacity: var(--glass-opacity, 0.72);
29
+ --dialog-accent: var(--color-blue, #0a84ff);
30
+ position: fixed;
31
+ top: 50%;
32
+ left: 50%;
33
+ transform: translate(-50%, -50%);
34
+ width: min(var(--dialog-width), calc(100vw - 2.5rem));
35
+ max-height: calc(100vh - 3rem);
36
+ padding: clamp(1.8rem, 3vw, 2.6rem);
37
+ border-radius: var(--dialog-radius);
38
+ color: var(--foreground, #050505);
39
+ z-index: 50;
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 1.5rem;
43
+ border: 1px solid rgba(255, 255, 255, 0.18);
44
+ background: rgba(250, 250, 252, 0.95);
45
+ box-shadow:
46
+ 0 20px 55px rgba(9, 9, 11, 0.25),
47
+ inset 0 1px 0 rgba(255, 255, 255, 0.35),
48
+ 0 0 35px color-mix(in srgb, var(--dialog-accent), transparent 60%);
49
+ backdrop-filter: blur(18px);
50
+ -webkit-backdrop-filter: blur(18px);
51
+ animation: dialog-content-in 480ms cubic-bezier(0.19, 0.82, 0.22, 1.2)
52
+ forwards;
53
+ @include motion.spring-transition(all, 360ms);
54
+
55
+ &::after {
56
+ content: "";
57
+ position: absolute;
58
+ inset: 0;
59
+ border-radius: inherit;
60
+ pointer-events: none;
61
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
62
+ }
63
+
64
+ &:focus {
65
+ outline: none;
66
+ }
67
+
68
+ &:focus-visible {
69
+ box-shadow:
70
+ 0 0 0 3px rgba(0, 122, 255, 0.3),
71
+ 0 20px 55px rgba(9, 9, 11, 0.25);
72
+ }
73
+
74
+ &[data-state="closed"] {
75
+ animation: dialog-content-out 280ms cubic-bezier(0.5, 0.15, 0.25, 1)
76
+ forwards;
77
+ }
78
+
79
+ @media (max-width: 640px) {
80
+ padding: 1.6rem;
81
+ border-radius: 24px;
82
+ }
83
+
84
+ &--glass {
85
+ @include glass.glass-panel(
86
+ light,
87
+ var(--dialog-glass-blur, 40px),
88
+ var(--dialog-glass-opacity, 0.72)
89
+ );
90
+ }
91
+
92
+ @supports not ((backdrop-filter: blur(2px))) {
93
+ background: rgba(255, 255, 255, 0.95);
94
+ }
95
+
96
+ &--sm {
97
+ --dialog-width: 22rem;
98
+ }
99
+
100
+ &--md {
101
+ --dialog-width: 28rem;
102
+ }
103
+
104
+ &--lg {
105
+ --dialog-width: 34rem;
106
+ }
107
+
108
+ &[data-tone="destructive"] {
109
+ --dialog-accent: var(--color-red, #ff3b30);
110
+ }
111
+
112
+ &[data-tone="success"] {
113
+ --dialog-accent: var(--color-green, #34c759);
114
+ }
115
+
116
+ &[data-tone="default"] {
117
+ --dialog-accent: var(--color-blue, #0a84ff);
118
+ }
119
+ }
120
+
121
+ .react-cupertino-ui-dialog__header {
122
+ display: flex;
123
+ flex-direction: column;
124
+ text-align: center;
125
+ gap: 0.5rem;
126
+ }
127
+
128
+ .react-cupertino-ui-dialog__title {
129
+ font-size: clamp(1.25rem, 1.3rem + 0.5vw, 1.65rem);
130
+ font-weight: 650;
131
+ letter-spacing: -0.01em;
132
+ color: var(--foreground, #050505);
133
+ }
134
+
135
+ .react-cupertino-ui-dialog__description {
136
+ font-size: 1rem;
137
+ line-height: 1.6;
138
+ color: color-mix(in srgb, var(--foreground, #050505), transparent 35%);
139
+ }
140
+
141
+ .react-cupertino-ui-dialog__footer {
142
+ display: flex;
143
+ flex-direction: column;
144
+ gap: 0.75rem;
145
+ width: 100%;
146
+
147
+ @media (min-width: 480px) {
148
+ flex-direction: row-reverse;
149
+ }
150
+ }
151
+
152
+ .react-cupertino-ui-dialog__button {
153
+ flex: 1;
154
+ }
155
+
156
+ @keyframes dialog-overlay-in {
157
+ from {
158
+ opacity: 0;
159
+ backdrop-filter: blur(0) saturate(120%);
160
+ }
161
+
162
+ to {
163
+ opacity: 1;
164
+ backdrop-filter: blur(var(--dialog-overlay-blur, 48px)) saturate(180%);
165
+ }
166
+ }
167
+
168
+ @keyframes dialog-overlay-out {
169
+ from {
170
+ opacity: 1;
171
+ }
172
+
173
+ to {
174
+ opacity: 0;
175
+ }
176
+ }
177
+
178
+ @keyframes dialog-content-in {
179
+ 0% {
180
+ opacity: 0;
181
+ transform: translate(-50%, -46%) scale(0.96);
182
+ }
183
+
184
+ 60% {
185
+ opacity: 1;
186
+ transform: translate(-50%, -50.5%) scale(1.01);
187
+ }
188
+
189
+ 100% {
190
+ transform: translate(-50%, -50%) scale(1);
191
+ }
192
+ }
193
+
194
+ @keyframes dialog-content-out {
195
+ from {
196
+ opacity: 1;
197
+ transform: translate(-50%, -50%) scale(1);
198
+ }
199
+
200
+ to {
201
+ opacity: 0;
202
+ transform: translate(-50%, -46%) scale(0.96);
203
+ }
204
+ }
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@react-cupertino-ui/dialog",
3
+ "version": "1.0.0",
4
+ "description": "Dialog 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
+ "@radix-ui/react-alert-dialog": "^1.1.1",
26
+ "@react-cupertino-ui/button": "workspace:*",
27
+ "@react-cupertino-ui/shared": "workspace:*"
28
+ },
29
+ "devDependencies": {
30
+ "typescript": "^5.2.2"
31
+ },
32
+ "gitHead": "3f53987bdb936a331665691b517c2ba9984777f8",
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
36
+ }