@oardi/css-utils 0.61.0 → 0.62.1
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/package.json +1 -1
- package/scss/components/modal.scss +137 -0
- package/scss/components/overlay.scss +1 -1
- package/scss/index.scss +2 -1
- package/scss/variables.scss +2 -2
package/package.json
CHANGED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.modal {
|
|
3
|
+
--modal-width: min(32rem, calc(100vw - var(--spacer-4)));
|
|
4
|
+
--modal-max-height: calc(100dvh - var(--spacer-4));
|
|
5
|
+
|
|
6
|
+
--modal-bg-color: var(--bg-surface);
|
|
7
|
+
--modal-color: var(--text-color);
|
|
8
|
+
|
|
9
|
+
--modal-border-width: var(--border-width);
|
|
10
|
+
--modal-border-color: var(--border-color);
|
|
11
|
+
--modal-border-radius: var(--border-radius);
|
|
12
|
+
|
|
13
|
+
--modal-box-shadow: var(--shadow-lg);
|
|
14
|
+
|
|
15
|
+
--modal-header-padding: var(--spacer-3);
|
|
16
|
+
--modal-body-padding: var(--spacer-3);
|
|
17
|
+
--modal-footer-padding: var(--spacer-3);
|
|
18
|
+
|
|
19
|
+
--modal-backdrop-bg-color: rgba(var(--gray-800-rgb), 0.7);
|
|
20
|
+
|
|
21
|
+
position: fixed;
|
|
22
|
+
inset: 0;
|
|
23
|
+
margin: auto;
|
|
24
|
+
|
|
25
|
+
width: var(--modal-width);
|
|
26
|
+
max-width: calc(100vw - var(--spacer-4));
|
|
27
|
+
height: fit-content;
|
|
28
|
+
max-height: var(--modal-max-height);
|
|
29
|
+
|
|
30
|
+
padding: 0;
|
|
31
|
+
color: var(--modal-color);
|
|
32
|
+
background-color: transparent;
|
|
33
|
+
border: 0;
|
|
34
|
+
overflow: visible;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.modal-content {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
max-height: var(--modal-max-height);
|
|
41
|
+
color: var(--modal-color);
|
|
42
|
+
background-color: var(--modal-bg-color);
|
|
43
|
+
border: var(--modal-border-width) solid var(--modal-border-color);
|
|
44
|
+
border-radius: var(--modal-border-radius);
|
|
45
|
+
box-shadow: var(--modal-box-shadow);
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
|
|
48
|
+
opacity: 0;
|
|
49
|
+
transform: translateY(-1rem) scale(0.98);
|
|
50
|
+
|
|
51
|
+
transition:
|
|
52
|
+
opacity var(--transition-duration) var(--transition-easing),
|
|
53
|
+
transform var(--transition-duration) var(--transition-easing);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.modal[open] .modal-content {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
transform: translateY(0) scale(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.modal-header {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: var(--spacer-2);
|
|
65
|
+
padding: var(--modal-header-padding);
|
|
66
|
+
border-bottom: var(--modal-border-width) solid var(--modal-header-border-color);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.modal-title {
|
|
70
|
+
flex: 1;
|
|
71
|
+
margin: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.modal-body {
|
|
75
|
+
padding: var(--modal-body-padding);
|
|
76
|
+
overflow: auto;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.modal-footer {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
justify-content: flex-end;
|
|
83
|
+
gap: var(--spacer-2);
|
|
84
|
+
padding: var(--modal-footer-padding);
|
|
85
|
+
border-top: var(--modal-border-width) solid var(--modal-footer-border-color);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.modal-close.icon-btn {
|
|
89
|
+
--icon-button-color: currentColor;
|
|
90
|
+
--icon-button-color-hover: currentColor;
|
|
91
|
+
--icon-button-color-active: currentColor;
|
|
92
|
+
--icon-button-on-color: currentColor;
|
|
93
|
+
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.modal-sm {
|
|
98
|
+
--modal-width: min(24rem, calc(100vw - var(--spacer-4)));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.modal-lg {
|
|
102
|
+
--modal-width: min(48rem, calc(100vw - var(--spacer-4)));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.modal-xl {
|
|
106
|
+
--modal-width: min(64rem, calc(100vw - var(--spacer-4)));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.modal::backdrop {
|
|
110
|
+
background-color: var(--modal-backdrop-bg-color);
|
|
111
|
+
transition: background-color var(--transition-duration) var(--transition-easing);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.modal[open]::backdrop {
|
|
115
|
+
background-color: var(--modal-backdrop-bg-color);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.modal.is-closing .modal-content {
|
|
119
|
+
opacity: 0;
|
|
120
|
+
transform: translateY(-1rem) scale(0.98);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.modal.is-closing::backdrop {
|
|
124
|
+
background-color: rgb(0 0 0 / 0);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@starting-style {
|
|
128
|
+
.modal[open] .modal-content {
|
|
129
|
+
opacity: 0;
|
|
130
|
+
transform: translateY(-1rem) scale(0.98);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.modal[open]::backdrop {
|
|
134
|
+
background-color: rgb(0 0 0 / 0);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
package/scss/index.scss
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
@forward './theme.scss';
|
|
3
3
|
@forward './variables.scss';
|
|
4
4
|
@forward './typography.scss';
|
|
5
|
-
@forward './text.scss';
|
|
6
5
|
|
|
7
6
|
@forward './utilities.scss';
|
|
7
|
+
@forward './text.scss';
|
|
8
8
|
|
|
9
9
|
@forward './spacings.scss';
|
|
10
10
|
@forward './spacings-responsive.scss';
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
@forward './components/form.scss';
|
|
35
35
|
@forward './components/icon-button.scss';
|
|
36
36
|
@forward './components/list.scss';
|
|
37
|
+
@forward './components/modal.scss';
|
|
37
38
|
@forward './components/navbar.scss';
|
|
38
39
|
@forward './components/overlay.scss';
|
|
39
40
|
@forward './components/pagination.scss';
|
package/scss/variables.scss
CHANGED
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
--disabled-bg-color: var(--gray-300);
|
|
66
66
|
--disabled-border-color: var(--gray-50);
|
|
67
67
|
|
|
68
|
-
--shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.
|
|
68
|
+
--shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
|
|
69
69
|
--shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.15);
|
|
70
|
-
--shadow-lg: 0 1rem 2rem rgba(0, 0, 0, 0.
|
|
70
|
+
--shadow-lg: 0 1rem 2rem rgba(0, 0, 0, 0.2);
|
|
71
71
|
|
|
72
72
|
--focus-outline-color: rgba(var(--primary-rgb), 0.5);
|
|
73
73
|
--focus-outline-style: solid;
|