@pimolu/web-styles 0.1.0-beta.3.1 → 0.1.0-beta.5

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/toast.css CHANGED
@@ -1,19 +1,200 @@
1
+ /* src/spinner.css */
2
+ .pimolu-spinner {
3
+ --pimolu-spinner-size: 20px;
4
+ --pimolu-spinner-dot-size: calc(var(--pimolu-spinner-size) * 0.27);
5
+ --pimolu-spinner-color: currentColor;
6
+ display: inline-flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ flex: 0 0 auto;
10
+ box-sizing: border-box;
11
+ min-width: 0;
12
+ color: var(--pimolu-spinner-color);
13
+ line-height: 1;
14
+ vertical-align: middle;
15
+ user-select: none;
16
+ }
17
+ .pimolu-spinner--xs {
18
+ --pimolu-spinner-size: 12px;
19
+ }
20
+ .pimolu-spinner--sm {
21
+ --pimolu-spinner-size: 16px;
22
+ }
23
+ .pimolu-spinner--md {
24
+ --pimolu-spinner-size: 20px;
25
+ }
26
+ .pimolu-spinner--lg {
27
+ --pimolu-spinner-size: 24px;
28
+ }
29
+ .pimolu-spinner--xl {
30
+ --pimolu-spinner-size: 32px;
31
+ }
32
+ .pimolu-spinner--inherit {
33
+ --pimolu-spinner-color: currentColor;
34
+ }
35
+ .pimolu-spinner--neutral {
36
+ --pimolu-spinner-color: var(--pimolu-foreground, currentColor);
37
+ }
38
+ .pimolu-spinner--primary {
39
+ --pimolu-spinner-color: var(--pimolu-primary, currentColor);
40
+ }
41
+ .pimolu-spinner--secondary {
42
+ --pimolu-spinner-color: var(--pimolu-secondary, currentColor);
43
+ }
44
+ .pimolu-spinner--success {
45
+ --pimolu-spinner-color: var(--pimolu-success, currentColor);
46
+ }
47
+ .pimolu-spinner--warning {
48
+ --pimolu-spinner-color: var(--pimolu-warning, currentColor);
49
+ }
50
+ .pimolu-spinner--danger {
51
+ --pimolu-spinner-color: var(--pimolu-danger, currentColor);
52
+ }
53
+ .pimolu-spinner__visual {
54
+ display: inline-flex;
55
+ align-items: center;
56
+ justify-content: center;
57
+ flex: 0 0 auto;
58
+ width: var(--pimolu-spinner-size);
59
+ height: var(--pimolu-spinner-size);
60
+ }
61
+ .pimolu-spinner__svg {
62
+ display: block;
63
+ width: 100%;
64
+ height: 100%;
65
+ overflow: visible;
66
+ transform-origin: center;
67
+ animation: pimolu-spinner-rotate 1s linear infinite;
68
+ }
69
+ .pimolu-spinner__track,
70
+ .pimolu-spinner__indicator {
71
+ fill: none;
72
+ stroke: currentColor;
73
+ stroke-width: 2.5;
74
+ }
75
+ .pimolu-spinner__track {
76
+ opacity: 0.18;
77
+ }
78
+ .pimolu-spinner__indicator {
79
+ stroke-linecap: round;
80
+ }
81
+ .pimolu-spinner--circular .pimolu-spinner__indicator {
82
+ stroke-dasharray: 16 57;
83
+ }
84
+ .pimolu-spinner--arc .pimolu-spinner__indicator {
85
+ stroke-dasharray: 42 57;
86
+ }
87
+ .pimolu-spinner--arc .pimolu-spinner__track {
88
+ opacity: 0;
89
+ }
90
+ .pimolu-spinner--arc .pimolu-spinner__svg {
91
+ animation-duration: 1.3s;
92
+ }
93
+ @keyframes pimolu-spinner-rotate {
94
+ from {
95
+ transform: rotate(0deg);
96
+ }
97
+ to {
98
+ transform: rotate(360deg);
99
+ }
100
+ }
101
+ .pimolu-spinner--dots .pimolu-spinner__visual {
102
+ width: calc(var(--pimolu-spinner-size) * 1.5);
103
+ gap: calc(var(--pimolu-spinner-size) * 0.14);
104
+ }
105
+ .pimolu-spinner__dot {
106
+ display: block;
107
+ flex: 0 0 auto;
108
+ width: var(--pimolu-spinner-dot-size);
109
+ height: var(--pimolu-spinner-dot-size);
110
+ border-radius: 50%;
111
+ background: currentColor;
112
+ animation: pimolu-spinner-dot 1.1s ease-in-out infinite;
113
+ }
114
+ .pimolu-spinner__dot:nth-child(1) {
115
+ animation-delay: -0.32s;
116
+ }
117
+ .pimolu-spinner__dot:nth-child(2) {
118
+ animation-delay: -0.16s;
119
+ }
120
+ .pimolu-spinner__dot:nth-child(3) {
121
+ animation-delay: 0s;
122
+ }
123
+ @keyframes pimolu-spinner-dot {
124
+ 0%, 80%, 100% {
125
+ opacity: 0.35;
126
+ transform: translateY(0);
127
+ }
128
+ 40% {
129
+ opacity: 1;
130
+ transform: translateY(-25%);
131
+ }
132
+ }
133
+ .pimolu-spinner__label {
134
+ position: absolute;
135
+ width: 1px;
136
+ height: 1px;
137
+ padding: 0;
138
+ margin: -1px;
139
+ overflow: hidden;
140
+ clip: rect(0, 0, 0, 0);
141
+ clip-path: inset(50%);
142
+ white-space: nowrap;
143
+ border: 0;
144
+ }
145
+ @media (prefers-reduced-motion: reduce) {
146
+ .pimolu-spinner__svg,
147
+ .pimolu-spinner__dot {
148
+ animation: none;
149
+ }
150
+ .pimolu-spinner__dot {
151
+ opacity: 1;
152
+ transform: none;
153
+ }
154
+ }
155
+ @media (forced-colors: active) {
156
+ .pimolu-spinner {
157
+ color: CanvasText;
158
+ }
159
+ .pimolu-spinner__track {
160
+ opacity: 0.4;
161
+ }
162
+ .pimolu-spinner__dot {
163
+ background: currentColor;
164
+ }
165
+ }
166
+
1
167
  /* src/toast.css */
2
168
  .pimolu-toaster {
169
+ --pimolu-toast-width: 24rem;
170
+ --pimolu-toast-padding: 14px;
171
+ --pimolu-toast-duration: 180ms;
172
+ --pimolu-toast-easing: cubic-bezier(0.16, 1, 0.3, 1);
3
173
  position: fixed;
4
174
  z-index: 60;
5
175
  display: grid;
6
- gap: 8px;
7
- width: min(20rem, calc(100vw - 32px));
176
+ gap: var(--pimolu-spacing-3, 12px);
177
+ width: min(var(--pimolu-toast-width, 24rem), calc(100vw - 32px));
178
+ max-height: calc(100dvh - 32px);
179
+ overflow-y: auto;
180
+ overscroll-behavior: contain;
8
181
  pointer-events: none;
9
182
  }
183
+ .pimolu-toaster[data-position=top-left] {
184
+ inset-block-start: 16px;
185
+ inset-inline-start: 16px;
186
+ }
187
+ .pimolu-toaster[data-position=bottom-left] {
188
+ inset-block-end: 16px;
189
+ inset-inline-start: 16px;
190
+ }
10
191
  .pimolu-toaster[data-position=top-right] {
11
192
  inset-block-start: 16px;
12
193
  inset-inline-end: 16px;
13
194
  }
14
195
  .pimolu-toaster[data-position=top-center] {
15
196
  inset-block-start: 16px;
16
- inset-inline-start: 50%;
197
+ left: 50%;
17
198
  transform: translateX(-50%);
18
199
  }
19
200
  .pimolu-toaster[data-position=bottom-right] {
@@ -22,7 +203,7 @@
22
203
  }
23
204
  .pimolu-toaster[data-position=bottom-center] {
24
205
  inset-block-end: 16px;
25
- inset-inline-start: 50%;
206
+ left: 50%;
26
207
  transform: translateX(-50%);
27
208
  }
28
209
  .pimolu-toast {
@@ -32,7 +213,7 @@
32
213
  justify-content: space-between;
33
214
  gap: 12px;
34
215
  box-sizing: border-box;
35
- padding: 12px 12px 12px 14px;
216
+ padding: var(--pimolu-toast-padding, 14px);
36
217
  border: var(--pimolu-control-border-width, 1px) solid var(--pimolu-border);
37
218
  border-inline-start: 3px solid var(--pimolu-toast-tone);
38
219
  border-radius: var(--pimolu-radius-md, 8px);
@@ -41,7 +222,23 @@
41
222
  box-shadow: var( --pimolu-shadow-raised, none );
42
223
  font-family: var(--pimolu-font-body, inherit);
43
224
  pointer-events: auto;
44
- animation: pimolu-toast-in 160ms ease-out;
225
+ animation: pimolu-toast-in var(--pimolu-toast-duration, 180ms) var(--pimolu-toast-easing, cubic-bezier(0.16, 1, 0.3, 1));
226
+ }
227
+ .pimolu-toast--info,
228
+ .pimolu-toast--loading {
229
+ --pimolu-toast-tone: var(--pimolu-primary);
230
+ }
231
+ .pimolu-toast__icon {
232
+ display: inline-grid;
233
+ place-items: center;
234
+ flex: none;
235
+ width: 20px;
236
+ height: 20px;
237
+ margin-block-start: 1px;
238
+ color: var(--pimolu-toast-tone);
239
+ }
240
+ .pimolu-toast--default .pimolu-toast__icon {
241
+ color: var(--pimolu-muted-foreground);
45
242
  }
46
243
  .pimolu-toast--success {
47
244
  --pimolu-toast-tone: var(--pimolu-success, #15803d);
@@ -56,6 +253,7 @@
56
253
  display: grid;
57
254
  gap: 2px;
58
255
  min-width: 0;
256
+ flex: 1;
59
257
  }
60
258
  .pimolu-toast__title {
61
259
  margin: 0;
@@ -76,6 +274,9 @@
76
274
  align-items: center;
77
275
  gap: 4px;
78
276
  flex: none;
277
+ flex-wrap: wrap;
278
+ justify-content: flex-end;
279
+ max-width: 45%;
79
280
  }
80
281
  .pimolu-toast__action {
81
282
  padding: 2px 6px;
@@ -87,15 +288,21 @@
87
288
  font-size: 0.8125rem;
88
289
  font-weight: 600;
89
290
  cursor: pointer;
291
+ overflow-wrap: anywhere;
90
292
  }
91
293
  .pimolu-toast__action:hover {
92
294
  background: var(--pimolu-muted);
93
295
  }
296
+ .pimolu-toast__action:disabled {
297
+ opacity: 0.5;
298
+ cursor: not-allowed;
299
+ }
94
300
  .pimolu-toast__close {
95
301
  display: inline-grid;
96
302
  place-items: center;
97
- width: 24px;
98
- height: 24px;
303
+ width: 28px;
304
+ height: 28px;
305
+ flex: none;
99
306
  padding: 0;
100
307
  border: 0;
101
308
  border-radius: var(--pimolu-radius-sm, 4px);
@@ -104,6 +311,16 @@
104
311
  line-height: 0;
105
312
  cursor: pointer;
106
313
  }
314
+ @media (pointer: coarse) {
315
+ .pimolu-toast__action,
316
+ .pimolu-toast__close {
317
+ min-width: 44px;
318
+ min-height: 44px;
319
+ }
320
+ }
321
+ .pimolu-toaster:empty {
322
+ pointer-events: none;
323
+ }
107
324
  .pimolu-toast__close:hover {
108
325
  background: var(--pimolu-muted);
109
326
  color: var(--pimolu-foreground);
package/dist/toolbar.css CHANGED
@@ -1,3 +1,38 @@
1
+ /* src/motion.css */
2
+ :root {
3
+ --pimolu-interaction-duration: 150ms;
4
+ --pimolu-interaction-easing: ease-out;
5
+ }
6
+ :where(.pimolu-card, .pimolu-badge, .pimolu-avatar, .pimolu-table__row, .pimolu-command__item, .pimolu-toolbar__button, .pimolu-toolbar__link, .pimolu-navbar__item, .pimolu-navbar__toggle, .pimolu-accordion__trigger) {
7
+ transition:
8
+ background-color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
9
+ border-color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
10
+ color var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out),
11
+ box-shadow var(--pimolu-interaction-duration, 150ms) var(--pimolu-interaction-easing, ease-out);
12
+ }
13
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *),
14
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *)::before,
15
+ :where([data-pimolu-motion=off], [data-pimolu-motion=off] *)::after {
16
+ animation: none !important;
17
+ transition: none !important;
18
+ scroll-behavior: auto !important;
19
+ }
20
+ :where([data-pimolu-motion=off]) .pimolu-accordion__content[hidden] {
21
+ display: none !important;
22
+ }
23
+ @media (prefers-reduced-motion: reduce) {
24
+ :where([class^=pimolu-], [class*=" pimolu-"]),
25
+ :where([class^=pimolu-], [class*=" pimolu-"])::before,
26
+ :where([class^=pimolu-], [class*=" pimolu-"])::after {
27
+ animation: none !important;
28
+ transition: none !important;
29
+ scroll-behavior: auto !important;
30
+ }
31
+ .pimolu-accordion__content[hidden] {
32
+ display: none !important;
33
+ }
34
+ }
35
+
1
36
  /* src/toolbar.css */
2
37
  .pimolu-toolbar {
3
38
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pimolu/web-styles",
3
- "version": "0.1.0-beta.3.1",
3
+ "version": "0.1.0-beta.5",
4
4
  "description": "Pimolu UI component stylesheets and CSS bundles.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,6 +26,7 @@
26
26
  },
27
27
 
28
28
  "exports": {
29
+ "./motion.css": "./dist/motion.css",
29
30
  "./styles.css": "./dist/pimolu.css",
30
31
  "./layered.css": "./dist/layered.css",
31
32
  "./pimolu.min.css": "./dist/pimolu.min.css",
@@ -161,7 +162,7 @@
161
162
  },
162
163
 
163
164
  "dependencies": {
164
- "@pimolu/themes": "0.1.0-beta.3.1"
165
+ "@pimolu/themes": "0.1.0-beta.5"
165
166
  },
166
167
 
167
168
  "devDependencies": {