@wwtdev/bsds-css 1.0.2 → 1.2.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.
@@ -0,0 +1,200 @@
1
+ /* Base Toast Styles */
2
+ .bs-toast {
3
+ background-color: var(--bs-white);
4
+ border-top: 4px solid var(--bs-blue-400);
5
+ bottom: 1.5rem;
6
+ box-shadow: var(--bs-shadow-contentMedium);
7
+ left: 0;
8
+ margin-left: 1.5rem;
9
+ margin-right: 1.5rem;
10
+ opacity: 0;
11
+ position: fixed;
12
+ right: 0;
13
+ transform: translateY(calc(100% + 1.5rem));
14
+ /* Clamp width for mobile -> full screen */
15
+ width: clamp(17rem, calc(100vw - 3rem), 25rem);
16
+ z-index: 999;
17
+ }
18
+
19
+ .bs-toast[data-stacked] {
20
+ bottom: auto;
21
+ left: auto;
22
+ position: static;
23
+ right: auto;
24
+ z-index: auto;
25
+ }
26
+
27
+ /* Mobile - Toast comes up from bottom */
28
+ @keyframes slideDown {
29
+ 0% {
30
+ opacity: 1;
31
+ transform: translateY(0);
32
+ }
33
+ 100% {
34
+ opacity: 0;
35
+ transform: translateY(calc(100% + 1.5rem));
36
+ }
37
+ }
38
+
39
+ @keyframes slideUp {
40
+ 0% {
41
+ opacity: 0;
42
+ transform: translateY(calc(100% + 1.5rem));
43
+ }
44
+ 100% {
45
+ opacity: 1;
46
+ transform: translateY(0);
47
+ }
48
+ }
49
+
50
+ /* Dark mode toast */
51
+ :where(.dark) .bs-toast {
52
+ background-color: var(--bs-navy-400);
53
+ }
54
+
55
+ .bs-toast:where([data-shown]) {
56
+ /* Small delay on load to alow for HTML element to exist */
57
+ animation-delay: 10ms;
58
+ animation-duration: 200ms;
59
+ animation-fill-mode: forwards;
60
+ animation-name: slideUp;
61
+ animation-timing-function: ease;
62
+ }
63
+
64
+ .bs-toast:where([data-dismissed]) {
65
+ animation-duration: 200ms;
66
+ animation-fill-mode: forwards;
67
+ animation-name: slideDown;
68
+ animation-timing-function: ease;
69
+ }
70
+
71
+ .bs-toast :where(.bs-toast-header) {
72
+ align-items: center;
73
+ color: var(--bs-ink-base);
74
+ display: flex;
75
+ gap: 0.5rem;
76
+ padding-left: 1rem;
77
+ padding-right: 1rem;
78
+ padding-top: 1rem;
79
+ }
80
+
81
+ .bs-toast :where(.bs-toast-header .bs-toast-header-icon) {
82
+ color: var(--bs-blue-400);
83
+ }
84
+
85
+ .bs-toast :where(h5) {
86
+ font-weight: 400;
87
+ }
88
+
89
+ .bs-toast :where(.bs-toast-content) {
90
+ border-bottom: 1px solid var(--bs-border);
91
+ color: var(--bs-ink-light);
92
+ padding-bottom: 1rem;
93
+ padding-left: 1rem;
94
+ padding-right: 1rem;
95
+ padding-top: 0.25rem;
96
+ }
97
+
98
+ .bs-toast :where(.bs-toast-actions) {
99
+ /* Mobile - Buttons will be stacked */
100
+ display: flex;
101
+ flex-direction: column-reverse;
102
+ gap: 1rem;
103
+ padding-bottom: 0.5rem;
104
+ padding-left: 1rem;
105
+ padding-right: 1rem;
106
+ padding-top: 0.5rem;
107
+ }
108
+
109
+ /* Warning Toast Styles */
110
+ .bs-toast:where([data-variant^='warning']) {
111
+ border-top: 4px solid var(--bs-orange-warning);
112
+ }
113
+
114
+ .bs-toast:where([data-variant^='warning']) :where(.bs-toast-header .bs-toast-header-icon) {
115
+ color: var(--bs-orange-warning);
116
+ }
117
+
118
+ /* Positive Toast Styles */
119
+ .bs-toast:where([data-variant^='positive']) {
120
+ border-top: 4px solid var(--bs-purple-400);
121
+ }
122
+
123
+ .bs-toast:where([data-variant^='positive']) :where(.bs-toast-header .bs-toast-header-icon) {
124
+ color: var(--bs-purple-400);
125
+ }
126
+
127
+ :where(.dark) .bs-toast:where([data-variant^='positive']) {
128
+ border-top: 4px solid var(--bs-purple-200);
129
+ }
130
+
131
+ :where(.dark) .bs-toast:where([data-variant^='positive']) :where(.bs-toast-header .bs-toast-header-icon) {
132
+ color: var(--bs-purple-200);
133
+ }
134
+
135
+ /* Negative Toast Styles */
136
+ .bs-toast:where([data-variant^='negative']) {
137
+ border-top: 4px solid var(--bs-red-400);
138
+ }
139
+
140
+ .bs-toast:where([data-variant^='negative']) :where(.bs-toast-header .bs-toast-header-icon) {
141
+ color: var(--bs-red-400);
142
+ }
143
+
144
+ @media (min-width: 440px) {
145
+
146
+ .bs-toast {
147
+ left: auto;
148
+ margin-left: 0;
149
+ margin-right: 0;
150
+ opacity: 0;
151
+ right: 1.5rem;
152
+ transform: translateX(calc(100% + 1.5rem));
153
+ }
154
+
155
+ .bs-toast:where([data-shown]) {
156
+ /* Small delay on load to alow for HTML element to exist */
157
+ animation-delay: 10ms;
158
+ animation-duration: 200ms;
159
+ animation-fill-mode: forwards;
160
+ animation-name: slideLeft;
161
+ animation-timing-function: ease;
162
+ }
163
+
164
+ .bs-toast:where([data-dismissed]) {
165
+ animation-duration: 200ms;
166
+ animation-fill-mode: forwards;
167
+ animation-name: slideRight;
168
+ animation-timing-function: ease;
169
+ }
170
+
171
+ /* Non-mobile toasts come in from the right */
172
+ @keyframes slideRight {
173
+ 0% {
174
+ opacity: 1;
175
+ transform: translateX(0);
176
+ }
177
+ 100% {
178
+ opacity: 0;
179
+ transform: translateX(calc(100% + 1.5rem));
180
+ }
181
+ }
182
+
183
+ @keyframes slideLeft {
184
+ 0% {
185
+ opacity: 0;
186
+ transform: translateX(calc(100% + 1.5rem));
187
+ }
188
+ 100% {
189
+ opacity: 1;
190
+ transform: translateX(0);
191
+ }
192
+ }
193
+
194
+ .bs-toast :where(.bs-toast-actions) {
195
+ /* Non-mobile - Buttons will be side-by-side */
196
+ flex-direction: row;
197
+ justify-content: flex-end;
198
+ }
199
+
200
+ }
@@ -0,0 +1,23 @@
1
+ /* Container for holding all toasts that will be visible */
2
+ .bs-toaster {
3
+ /* Mobile - Center the toasts on the screen */
4
+ align-items: center;
5
+ bottom: 1.5rem;
6
+ display: flex;
7
+ flex-direction: column-reverse;
8
+ gap: 0.5rem;
9
+ left: 0;
10
+ position: fixed;
11
+ right: 0;
12
+ z-index: 999;
13
+ }
14
+
15
+ @media (min-width: 440px) {
16
+
17
+ .bs-toaster {
18
+ /* Non-mobile - Toasts will live on right side of the screen */
19
+ left: auto;
20
+ right: 1.5rem;
21
+ }
22
+
23
+ }
@@ -0,0 +1,154 @@
1
+ /* -------------------- BASE STYLES -------------------- */
2
+ .bs-tooltip {
3
+ display: inline-block;
4
+ position: relative;
5
+ }
6
+
7
+ .bs-tooltip :where(.bs-tooltip-text) {
8
+ align-items: center;
9
+ background-color: var(--bs-bg-base);
10
+ border-radius: 4px;
11
+ box-shadow: var(--bs-shadow-contentLowCenter);
12
+ color: var(--bs-violet-400);
13
+ display: flex;
14
+ font-size: var(--bs-text-sm);
15
+ justify-content: center;
16
+ max-width: 16rem;
17
+ min-width: 4rem;
18
+ opacity: 0;
19
+ padding-bottom: 0.25rem;
20
+ padding-left: 0.5rem;
21
+ padding-right: 0.5rem;
22
+ padding-top: 0.25rem;
23
+ position: absolute;
24
+ transform: scale(0);
25
+ transition-duration: 75ms;
26
+ transition-property: opacity, transform;
27
+ transition-timing-function: ease-in-out;
28
+ width: max-content;
29
+ z-index: 999;
30
+ }
31
+
32
+ /* -------------------- POSITION: UNDEFINED / TOP -------------------- */
33
+ .bs-tooltip:where(:not([data-position])) :where(.bs-tooltip-text),
34
+ .bs-tooltip:where([data-position="top"]) :where(.bs-tooltip-text) {
35
+ bottom: calc(100% + 0.5rem);
36
+ left: 50%;
37
+ transform-origin: bottom center;
38
+ transform: translateX(-50%) scale(0);
39
+ }
40
+
41
+ /* Active States */
42
+ :where(.bs-tooltip:not([data-position])):hover :where(.bs-tooltip-text),
43
+ :where(.bs-tooltip[data-position="top"]):hover :where(.bs-tooltip-text),
44
+ :where(.bs-tooltip:not([data-position])):focus-within :where(.bs-tooltip-text),
45
+ :where(.bs-tooltip[data-position="top"]):focus-within :where(.bs-tooltip-text),
46
+ :where(.bs-tooltip:not([data-position]))[data-shown] :where(.bs-tooltip-text),
47
+ :where(.bs-tooltip[data-position="top"])[data-shown] :where(.bs-tooltip-text) {
48
+ opacity: 1;
49
+ transform: translateX(-50%) scale(1);
50
+ }
51
+
52
+ /* -------------------- POSITION: BOTTOM -------------------- */
53
+ .bs-tooltip:where([data-position="bottom"]) :where(.bs-tooltip-text) {
54
+ left: 50%;
55
+ top: calc(100% + 0.5rem);
56
+ transform-origin: top center;
57
+ transform: translateX(-50%) scale(0);
58
+ }
59
+
60
+ /* Active States */
61
+ :where(.bs-tooltip[data-position="bottom"]):hover :where(.bs-tooltip-text),
62
+ :where(.bs-tooltip[data-position="bottom"]):focus-within :where(.bs-tooltip-text),
63
+ :where(.bs-tooltip[data-position="bottom"])[data-shown] :where(.bs-tooltip-text) {
64
+ opacity: 1;
65
+ transform: translateX(-50%) scale(1);
66
+ }
67
+
68
+ /* -------------------- POSITION: LEFT -------------------- */
69
+ .bs-tooltip:where([data-position="left"]) :where(.bs-tooltip-text) {
70
+ right: calc(100% + 0.5rem);
71
+ top: 50%;
72
+ transform-origin: center right;
73
+ transform: translateY(-50%) scale(0);
74
+ }
75
+
76
+ /* Active States */
77
+ :where(.bs-tooltip[data-position="left"]):hover :where(.bs-tooltip-text),
78
+ :where(.bs-tooltip[data-position="left"]):focus-within :where(.bs-tooltip-text),
79
+ :where(.bs-tooltip[data-position="left"])[data-shown] :where(.bs-tooltip-text) {
80
+ opacity: 1;
81
+ transform: translateY(-50%) scale(1);
82
+ }
83
+
84
+ /* -------------------- POSITION: RIGHT -------------------- */
85
+ .bs-tooltip:where([data-position="right"]) :where(.bs-tooltip-text) {
86
+ left: calc(100% + 0.5rem);
87
+ top: 50%;
88
+ transform-origin: center left;
89
+ transform: translateY(-50%) scale(0);
90
+ }
91
+
92
+ :where(.bs-tooltip[data-position="right"]):hover :where(.bs-tooltip-text),
93
+ :where(.bs-tooltip[data-position="right"]):focus-within :where(.bs-tooltip-text),
94
+ :where(.bs-tooltip[data-position="right"])[data-shown] :where(.bs-tooltip-text) {
95
+ opacity: 1;
96
+ transform: translateY(-50%) scale(1);
97
+ }
98
+
99
+ /* -------------------- POSITION: CORNERS -------------------- */
100
+ /* top-left */
101
+ .bs-tooltip:where([data-position="top-left"]) :where(.bs-tooltip-text) {
102
+ bottom: calc(100% + 0.5rem);
103
+ right: calc(100% + 0.5rem);
104
+ transform-origin: bottom right;
105
+ }
106
+
107
+ /* top-right */
108
+ .bs-tooltip:where([data-position="top-right"]) :where(.bs-tooltip-text) {
109
+ bottom: calc(100% + 0.5rem);
110
+ left: calc(100% + 0.5rem);
111
+ transform-origin: bottom left;
112
+ }
113
+
114
+ /* bottom-left */
115
+ .bs-tooltip:where([data-position="bottom-left"]) :where(.bs-tooltip-text) {
116
+ right: calc(100% + 0.5rem);
117
+ top: calc(100% + 0.5rem);
118
+ transform-origin: top right;
119
+ }
120
+
121
+ /* bottom-right */
122
+ .bs-tooltip:where([data-position="bottom-right"]) :where(.bs-tooltip-text) {
123
+ left: calc(100% + 0.5rem);
124
+ top: calc(100% + 0.5rem);
125
+ transform-origin: top left;
126
+ }
127
+
128
+ /* Active States */
129
+ :where(.bs-tooltip[data-position="top-left"]):hover :where(.bs-tooltip-text),
130
+ :where(.bs-tooltip[data-position="top-right"]):hover :where(.bs-tooltip-text),
131
+ :where(.bs-tooltip[data-position="bottom-left"]):hover :where(.bs-tooltip-text),
132
+ :where(.bs-tooltip[data-position="bottom-right"]):hover :where(.bs-tooltip-text),
133
+ :where(.bs-tooltip[data-position="top-left"]):focus-within :where(.bs-tooltip-text),
134
+ :where(.bs-tooltip[data-position="top-right"]):focus-within :where(.bs-tooltip-text),
135
+ :where(.bs-tooltip[data-position="bottom-left"]):focus-within :where(.bs-tooltip-text),
136
+ :where(.bs-tooltip[data-position="bottom-right"]):focus-within :where(.bs-tooltip-text),
137
+ :where(.bs-tooltip[data-position="top-left"])[data-shown] :where(.bs-tooltip-text),
138
+ :where(.bs-tooltip[data-position="top-right"])[data-shown] :where(.bs-tooltip-text),
139
+ :where(.bs-tooltip[data-position="bottom-left"])[data-shown] :where(.bs-tooltip-text),
140
+ :where(.bs-tooltip[data-position="bottom-right"])[data-shown] :where(.bs-tooltip-text) {
141
+ opacity: 1;
142
+ transform: scale(1);
143
+ }
144
+
145
+ /* -------------------- DISABLED -------------------- */
146
+ /*
147
+ Don't display unless data-shown is present
148
+ This must go last to properly override the other classes
149
+ */
150
+ :where(.bs-tooltip[data-disabled]:not([data-shown])):hover :where(.bs-tooltip-text),
151
+ :where(.bs-tooltip[data-disabled]:not([data-shown])):focus-within :where(.bs-tooltip-text) {
152
+ opacity: 0;
153
+ transform: scale(0);
154
+ }