@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.
@@ -1,13 +1,21 @@
1
1
  /* src/segmented-control.css */
2
+ :root {
3
+ --pimolu-segmented-indicator-duration: 240ms;
4
+ --pimolu-segmented-indicator-easing: cubic-bezier(0.22, 1, 0.36, 1);
5
+ }
2
6
  .pimolu-segmented-control {
3
7
  --pimolu-segmented-height: 32px;
4
8
  --pimolu-segmented-padding-x: 12px;
5
9
  --pimolu-segmented-font-size: 0.875rem;
6
10
  display: inline-flex;
11
+ position: relative;
12
+ isolation: isolate;
13
+ flex-wrap: nowrap;
7
14
  align-items: center;
8
15
  gap: 0;
9
16
  box-sizing: border-box;
10
17
  max-width: 100%;
18
+ min-width: 0;
11
19
  padding: 4px;
12
20
  border: var(--pimolu-control-border-width, 1px) solid var(--pimolu-border);
13
21
  border-radius: 999px;
@@ -22,13 +30,16 @@
22
30
  flex-direction: column;
23
31
  align-items: stretch;
24
32
  width: fit-content;
25
- min-width: 12rem;
33
+ min-width: min(12rem, 100%);
26
34
  border-radius: var(--pimolu-radius-lg, 12px);
27
35
  }
28
36
  .pimolu-segmented-control--full-width.pimolu-segmented-control--vertical {
29
37
  width: 100%;
30
38
  }
31
39
  .pimolu-segmented-control__item {
40
+ position: relative;
41
+ z-index: 1;
42
+ flex-shrink: 0;
32
43
  display: inline-flex;
33
44
  align-items: center;
34
45
  justify-content: center;
@@ -54,7 +65,7 @@
54
65
  }
55
66
  .pimolu-segmented-control--full-width .pimolu-segmented-control__item {
56
67
  flex: 1 1 0;
57
- min-width: 0;
68
+ min-width: max-content;
58
69
  }
59
70
  .pimolu-segmented-control--vertical .pimolu-segmented-control__item {
60
71
  flex: 0 0 auto;
@@ -93,12 +104,68 @@
93
104
  --pimolu-segmented-padding-x: 16px;
94
105
  --pimolu-segmented-font-size: 1rem;
95
106
  }
107
+ .pimolu-segmented-control__indicator {
108
+ position: absolute;
109
+ left: 0;
110
+ top: 0;
111
+ z-index: 0;
112
+ border-radius: 999px;
113
+ pointer-events: none;
114
+ background: color-mix(in srgb, var(--pimolu-foreground) 10%, var(--pimolu-muted));
115
+ box-shadow: var(--pimolu-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.12));
116
+ }
117
+ .pimolu-segmented-control__indicator[hidden] {
118
+ display: none;
119
+ }
120
+ .pimolu-segmented-control__indicator[data-ready=true] {
121
+ transition-property:
122
+ transform,
123
+ width,
124
+ height;
125
+ transition-duration: var(--pimolu-segmented-indicator-duration, 240ms);
126
+ transition-timing-function: var(--pimolu-segmented-indicator-easing, cubic-bezier(0.22, 1, 0.36, 1));
127
+ }
128
+ .pimolu-segmented-control[data-indicator=true] > .pimolu-segmented-control__item[data-state=active] {
129
+ background: transparent;
130
+ box-shadow: none;
131
+ }
132
+ .pimolu-segmented-control[data-animated=false] > :is(.pimolu-segmented-control__indicator, .pimolu-segmented-control__item) {
133
+ transition: none;
134
+ }
135
+ .pimolu-segmented-control {
136
+ flex-wrap: nowrap;
137
+ overflow-x: auto;
138
+ overflow-y: hidden;
139
+ overscroll-behavior: contain;
140
+ }
141
+ .pimolu-segmented-control--vertical {
142
+ overflow-x: hidden;
143
+ overflow-y: auto;
144
+ }
145
+ .pimolu-segmented-control:not([data-show-scrollbar=true]) {
146
+ scrollbar-width: none;
147
+ }
148
+ .pimolu-segmented-control:not([data-show-scrollbar=true])::-webkit-scrollbar {
149
+ display: none;
150
+ }
151
+ .pimolu-segmented-control[data-show-scrollbar=true] {
152
+ scrollbar-width: thin;
153
+ }
154
+ .pimolu-segmented-control[data-show-scrollbar=true]::-webkit-scrollbar {
155
+ display: block;
156
+ width: 8px;
157
+ height: 8px;
158
+ }
96
159
  @media (prefers-reduced-motion: reduce) {
97
- .pimolu-segmented-control__item {
160
+ .pimolu-segmented-control__item,
161
+ .pimolu-segmented-control__indicator[data-ready=true] {
98
162
  transition: none;
99
163
  }
100
164
  }
101
165
  @media (forced-colors: active) {
166
+ .pimolu-segmented-control__indicator {
167
+ display: none;
168
+ }
102
169
  .pimolu-segmented-control__item[data-state=active] {
103
170
  border: 1px solid Highlight;
104
171
  color: Highlight;
package/dist/sidebar.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/sidebar.css */
2
37
  .pimolu-sidebar {
3
38
  position: relative;
@@ -261,3 +296,11 @@
261
296
  color: Highlight;
262
297
  }
263
298
  }
299
+ .pimolu-sidebar {
300
+ transition: width 220ms cubic-bezier(0.16, 1, 0.3, 1), padding 220ms ease-out;
301
+ }
302
+ @media (prefers-reduced-motion: reduce) {
303
+ .pimolu-sidebar {
304
+ transition: none;
305
+ }
306
+ }
package/dist/slider.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/slider.css */
2
37
  .pimolu-slider {
3
38
  --pimolu-slider-direction: var(--pimolu-slider-inherited-direction, to right);
@@ -168,3 +203,29 @@
168
203
  background: ButtonFace;
169
204
  }
170
205
  }
206
+ .pimolu-slider__control::-webkit-slider-thumb {
207
+ transition: box-shadow 150ms ease-out;
208
+ }
209
+ .pimolu-slider__control::-moz-range-thumb {
210
+ transition: box-shadow 150ms ease-out;
211
+ }
212
+ .pimolu-slider__control:not(:disabled):is(:hover, :focus-visible)::-webkit-slider-thumb {
213
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--pimolu-slider-tone) 18%, transparent);
214
+ }
215
+ .pimolu-slider__control:not(:disabled):is(:hover, :focus-visible)::-moz-range-thumb {
216
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--pimolu-slider-tone) 18%, transparent);
217
+ }
218
+ @media (prefers-reduced-motion: reduce) {
219
+ .pimolu-slider__control::-webkit-slider-thumb {
220
+ transition: none;
221
+ }
222
+ .pimolu-slider__control::-moz-range-thumb {
223
+ transition: none;
224
+ }
225
+ }
226
+ [data-pimolu-motion=off] .pimolu-slider__control::-webkit-slider-thumb {
227
+ transition: none;
228
+ }
229
+ [data-pimolu-motion=off] .pimolu-slider__control::-moz-range-thumb {
230
+ transition: none;
231
+ }
package/dist/table.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/table.css */
2
37
  .pimolu-table__wrapper {
3
38
  box-sizing: border-box;
package/dist/tabs.css CHANGED
@@ -1,4 +1,8 @@
1
1
  /* src/tabs.css */
2
+ :root {
3
+ --pimolu-tabs-indicator-duration: 240ms;
4
+ --pimolu-tabs-indicator-easing: cubic-bezier(0.22, 1, 0.36, 1);
5
+ }
2
6
  .pimolu-tabs {
3
7
  --pimolu-tabs-height: 40px;
4
8
  --pimolu-tabs-padding-x: 14px;
@@ -64,18 +68,26 @@
64
68
  flex: 1 1 auto;
65
69
  flex-wrap: nowrap;
66
70
  overflow-x: auto;
71
+ overflow-y: hidden;
67
72
  overscroll-behavior-inline: contain;
68
73
  }
69
74
  .pimolu-tabs__list[data-scrollable=true] .pimolu-tabs__trigger {
70
75
  flex: 0 0 auto;
71
76
  }
72
- .pimolu-tabs__list[data-scrollable=true] {
77
+ .pimolu-tabs__list[data-scrollable=true]:not([data-show-scrollbar=true]) {
73
78
  scrollbar-width: none;
74
79
  -ms-overflow-style: none;
75
80
  }
76
- .pimolu-tabs__list[data-scrollable=true]::-webkit-scrollbar {
81
+ .pimolu-tabs__list[data-scrollable=true]:not([data-show-scrollbar=true])::-webkit-scrollbar {
77
82
  display: none;
78
83
  }
84
+ .pimolu-tabs__list[data-scrollable=true][data-show-scrollbar=true] {
85
+ scrollbar-width: thin;
86
+ }
87
+ .pimolu-tabs__list[data-scrollable=true][data-show-scrollbar=true]::-webkit-scrollbar {
88
+ display: block;
89
+ height: 8px;
90
+ }
79
91
  .pimolu-tabs__scroll {
80
92
  display: inline-grid;
81
93
  flex: none;
@@ -224,7 +236,7 @@
224
236
  .pimolu-tabs--segmented .pimolu-tabs__trigger {
225
237
  position: relative;
226
238
  flex: 1 1 0;
227
- min-width: 0;
239
+ min-width: max-content;
228
240
  padding-inline: var(--pimolu-spacing-3, 12px);
229
241
  border-radius: 999px;
230
242
  color: var(--pimolu-muted-foreground);
@@ -315,8 +327,82 @@
315
327
  box-shadow: inset 2px 0 0 var(--pimolu-primary);
316
328
  }
317
329
  }
330
+ .pimolu-tabs__list {
331
+ position: relative;
332
+ isolation: isolate;
333
+ }
334
+ .pimolu-tabs__list > .pimolu-tabs__trigger {
335
+ position: relative;
336
+ z-index: 1;
337
+ }
338
+ .pimolu-tabs__indicator {
339
+ position: absolute;
340
+ top: 0;
341
+ left: 0;
342
+ z-index: 0;
343
+ pointer-events: none;
344
+ border-radius: var(--pimolu-radius-sm, 4px);
345
+ }
346
+ .pimolu-tabs__indicator[hidden] {
347
+ display: none;
348
+ }
349
+ .pimolu-tabs__indicator[data-ready=true] {
350
+ transition-property:
351
+ transform,
352
+ width,
353
+ height;
354
+ transition-duration: var(--pimolu-tabs-indicator-duration, 240ms);
355
+ transition-timing-function: var(--pimolu-tabs-indicator-easing, cubic-bezier(0.22, 1, 0.36, 1));
356
+ }
357
+ .pimolu-tabs__indicator::before {
358
+ content: "";
359
+ position: absolute;
360
+ inset: 0;
361
+ border-radius: inherit;
362
+ }
363
+ .pimolu-tabs--line > .pimolu-tabs__list-wrap > .pimolu-tabs__list > .pimolu-tabs__indicator::before {
364
+ inset-block-start: auto;
365
+ height: 2px;
366
+ background: var(--pimolu-primary);
367
+ }
368
+ .pimolu-tabs--vertical.pimolu-tabs--line > .pimolu-tabs__list-wrap > .pimolu-tabs__list > .pimolu-tabs__indicator::before {
369
+ inset-block: 0;
370
+ inset-inline-start: auto;
371
+ width: 2px;
372
+ height: auto;
373
+ }
374
+ .pimolu-tabs--solid > .pimolu-tabs__list-wrap > .pimolu-tabs__list > .pimolu-tabs__indicator::before {
375
+ background: var(--pimolu-primary);
376
+ }
377
+ .pimolu-tabs--soft > .pimolu-tabs__list-wrap > .pimolu-tabs__list > .pimolu-tabs__indicator::before {
378
+ background: color-mix(in srgb, var(--pimolu-primary) 12%, transparent);
379
+ }
380
+ .pimolu-tabs--segmented > .pimolu-tabs__list-wrap > .pimolu-tabs__list > .pimolu-tabs__indicator {
381
+ border-radius: 999px;
382
+ }
383
+ .pimolu-tabs--segmented > .pimolu-tabs__list-wrap > .pimolu-tabs__list > .pimolu-tabs__indicator::before {
384
+ background: color-mix(in srgb, var(--pimolu-foreground) 10%, var(--pimolu-muted));
385
+ box-shadow: var(--pimolu-shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.12));
386
+ }
387
+ .pimolu-tabs__list[data-indicator=true] > .pimolu-tabs__trigger[data-state=active] {
388
+ background: transparent;
389
+ box-shadow: none;
390
+ }
391
+ @media (max-width: 600px) {
392
+ .pimolu-tabs--vertical.pimolu-tabs--line > .pimolu-tabs__list-wrap > .pimolu-tabs__list > .pimolu-tabs__indicator::before {
393
+ inset-inline-start: 0;
394
+ inset-inline-end: auto;
395
+ }
396
+ }
397
+ .pimolu-tabs[data-animated=false] > .pimolu-tabs__list-wrap > .pimolu-tabs__list > :is(.pimolu-tabs__indicator, .pimolu-tabs__trigger) {
398
+ transition: none;
399
+ }
400
+ .pimolu-tabs[data-animated=false] > .pimolu-tabs__panel {
401
+ animation: none;
402
+ }
318
403
  @media (prefers-reduced-motion: reduce) {
319
- .pimolu-tabs__trigger {
404
+ .pimolu-tabs__trigger,
405
+ .pimolu-tabs__indicator[data-ready=true] {
320
406
  transition: none;
321
407
  }
322
408
  .pimolu-tabs__panel[data-state=active] {
@@ -324,6 +410,9 @@
324
410
  }
325
411
  }
326
412
  @media (forced-colors: active) {
413
+ .pimolu-tabs__indicator {
414
+ display: none;
415
+ }
327
416
  .pimolu-tabs__trigger[data-state=active] {
328
417
  border: 1px solid Highlight;
329
418
  color: Highlight;