basecoat-css 1.1.0 → 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.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/dist/base/base.css +1 -0
  3. package/dist/base/scroll-fade.css +41 -0
  4. package/dist/base/transition-details.css +12 -0
  5. package/dist/basecoat-base.bundle.css +767 -119
  6. package/dist/basecoat-base.cdn.css +1924 -673
  7. package/dist/basecoat-base.cdn.min.css +1 -1
  8. package/dist/basecoat-compat.cdn.css +250 -75
  9. package/dist/basecoat-compat.cdn.min.css +1 -1
  10. package/dist/basecoat-components.css +10 -0
  11. package/dist/basecoat-luma.bundle.css +1115 -125
  12. package/dist/basecoat-luma.cdn.css +4649 -2558
  13. package/dist/basecoat-luma.cdn.min.css +1 -1
  14. package/dist/basecoat-lyra.bundle.css +1110 -125
  15. package/dist/basecoat-lyra.cdn.css +5118 -3079
  16. package/dist/basecoat-lyra.cdn.min.css +1 -1
  17. package/dist/basecoat-maia.bundle.css +1113 -125
  18. package/dist/basecoat-maia.cdn.css +5244 -3202
  19. package/dist/basecoat-maia.cdn.min.css +1 -1
  20. package/dist/basecoat-mira.bundle.css +1113 -125
  21. package/dist/basecoat-mira.cdn.css +3623 -1583
  22. package/dist/basecoat-mira.cdn.min.css +1 -1
  23. package/dist/basecoat-nova.bundle.css +1115 -129
  24. package/dist/basecoat-nova.cdn.css +5271 -3229
  25. package/dist/basecoat-nova.cdn.min.css +1 -1
  26. package/dist/basecoat-rhea.bundle.css +1117 -127
  27. package/dist/basecoat-rhea.cdn.css +5286 -3192
  28. package/dist/basecoat-rhea.cdn.min.css +1 -1
  29. package/dist/basecoat-sera.bundle.css +1111 -128
  30. package/dist/basecoat-sera.cdn.css +3280 -1254
  31. package/dist/basecoat-sera.cdn.min.css +1 -1
  32. package/dist/basecoat-vega.bundle.css +1113 -125
  33. package/dist/basecoat-vega.cdn.css +5225 -3180
  34. package/dist/basecoat-vega.cdn.min.css +1 -1
  35. package/dist/basecoat.bundle.css +1113 -125
  36. package/dist/basecoat.cdn.css +5225 -3180
  37. package/dist/basecoat.cdn.min.css +1 -1
  38. package/dist/compat/legacy.css +3 -18
  39. package/dist/components/accordion.css +15 -1
  40. package/dist/components/alert.css +4 -0
  41. package/dist/components/attachment.css +66 -0
  42. package/dist/components/bubble.css +28 -0
  43. package/dist/components/button-group.css +2 -1
  44. package/dist/components/button.css +23 -0
  45. package/dist/components/carousel.css +30 -0
  46. package/dist/components/checkbox.css +5 -1
  47. package/dist/components/code-block.css +80 -0
  48. package/dist/components/collapsible.css +0 -9
  49. package/dist/components/command.css +13 -0
  50. package/dist/components/dialog.css +2 -4
  51. package/dist/components/drawer.css +48 -14
  52. package/dist/components/input-otp.css +49 -0
  53. package/dist/components/item.css +6 -0
  54. package/dist/components/marker.css +20 -0
  55. package/dist/components/message.css +24 -0
  56. package/dist/components/range.css +7 -0
  57. package/dist/components/scrollbar.css +20 -42
  58. package/dist/components/sheet.css +123 -0
  59. package/dist/components/shimmer.css +49 -0
  60. package/dist/components/sidebar.css +9 -1
  61. package/dist/components/toast.css +59 -44
  62. package/dist/components/trace.css +34 -0
  63. package/dist/js/all.js +488 -112
  64. package/dist/js/all.min.js +1 -1
  65. package/dist/js/carousel.js +105 -0
  66. package/dist/js/carousel.min.js +1 -0
  67. package/dist/js/code-block.js +47 -0
  68. package/dist/js/code-block.min.js +1 -0
  69. package/dist/js/drawer.js +6 -2
  70. package/dist/js/drawer.min.js +1 -1
  71. package/dist/js/input-otp.js +76 -0
  72. package/dist/js/input-otp.min.js +1 -0
  73. package/dist/js/tabs.js +31 -58
  74. package/dist/js/tabs.min.js +1 -1
  75. package/dist/js/toast.js +221 -53
  76. package/dist/js/toast.min.js +1 -1
  77. package/dist/styles/luma.css +348 -6
  78. package/dist/styles/lyra.css +343 -6
  79. package/dist/styles/maia.css +346 -6
  80. package/dist/styles/mira.css +346 -6
  81. package/dist/styles/nova.css +348 -10
  82. package/dist/styles/rhea.css +350 -8
  83. package/dist/styles/sera.css +344 -9
  84. package/dist/styles/vega.css +346 -6
  85. package/dist/typeset.cdn.css +381 -0
  86. package/dist/typeset.cdn.min.css +1 -0
  87. package/dist/typeset.css +435 -0
  88. package/package.json +16 -7
  89. package/templates/jinja/tabs.html.jinja +0 -1
  90. package/templates/jinja/toast.html.jinja +29 -26
  91. package/templates/nunjucks/tabs.njk +1 -1
  92. package/templates/nunjucks/toast.njk +30 -27
@@ -1,46 +1,24 @@
1
- /* Scrollbar */
2
- @layer components {
3
- .scrollbar {
4
- scrollbar-width: auto;
5
- scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
1
+ @source inline("scrollbar scrollbar-thin");
6
2
 
7
- &::-webkit-scrollbar {
8
- width: var(--scrollbar-width);
9
- height: var(--scrollbar-width);
10
- }
11
- &::-webkit-scrollbar-track {
12
- background: var(--scrollbar-track);
13
- }
14
- &::-webkit-scrollbar-thumb {
15
- background: var(--scrollbar-thumb);
16
- border-radius: var(--scrollbar-radius);
17
- border: 1px solid transparent;
18
- background-clip: padding-box;
19
- }
20
- &::-webkit-scrollbar-corner {
21
- background: var(--scrollbar-track);
22
- }
23
- }
24
-
25
- .scrollbar-sm {
26
- scrollbar-width: thin;
27
- scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
3
+ @utility scrollbar {
4
+ scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
28
5
 
29
- &::-webkit-scrollbar {
30
- width: var(--scrollbar-sm-width);
31
- height: var(--scrollbar-sm-width);
32
- }
33
- &::-webkit-scrollbar-track {
34
- background: var(--scrollbar-track);
35
- }
36
- &::-webkit-scrollbar-thumb {
37
- background: var(--scrollbar-thumb);
38
- border-radius: var(--scrollbar-radius);
39
- border: 1px solid transparent;
40
- background-clip: padding-box;
41
- }
42
- &::-webkit-scrollbar-corner {
43
- background: var(--scrollbar-track);
44
- }
6
+ &::-webkit-scrollbar {
7
+ width: var(--scrollbar-width);
8
+ height: var(--scrollbar-width);
9
+ }
10
+ &.scrollbar-thin::-webkit-scrollbar {
11
+ width: var(--scrollbar-sm-width);
12
+ height: var(--scrollbar-sm-width);
13
+ }
14
+ &::-webkit-scrollbar-track,
15
+ &::-webkit-scrollbar-corner {
16
+ background: var(--scrollbar-track);
17
+ }
18
+ &::-webkit-scrollbar-thumb {
19
+ background: var(--scrollbar-thumb);
20
+ border-radius: var(--scrollbar-radius);
21
+ border: 1px solid transparent;
22
+ background-clip: padding-box;
45
23
  }
46
24
  }
@@ -0,0 +1,123 @@
1
+ @keyframes sheet-scroll-lock {
2
+ from, to {
3
+ scrollbar-gutter: stable;
4
+ }
5
+ }
6
+
7
+ /* Sheet */
8
+ @layer components {
9
+ /* Reserve the scrollbar gutter only when the page can scroll. */
10
+ html:has(.sheet:modal) {
11
+ overflow: hidden;
12
+ animation: sheet-scroll-lock linear both;
13
+ animation-timeline: scroll(self);
14
+ }
15
+
16
+ .sheet {
17
+ --_sheet-duration: 200ms;
18
+ --_sheet-ease: ease-in-out;
19
+ --_sheet-travel: 2.5rem;
20
+ @apply fixed inset-0 m-0 size-auto max-h-none max-w-none overflow-visible bg-transparent p-0 text-inherit opacity-0 transition-all transition-discrete duration-(--_sheet-duration) ease-(--_sheet-ease) backdrop:opacity-0 backdrop:transition-all backdrop:transition-discrete backdrop:duration-200 backdrop:ease-in-out;
21
+
22
+ > * {
23
+ @apply fixed z-50 flex h-auto flex-col transition-transform duration-(--_sheet-duration) ease-(--_sheet-ease) will-change-transform outline-hidden;
24
+ }
25
+
26
+ &[data-side='bottom'] > * {
27
+ @apply inset-x-0 bottom-0 translate-y-(--_sheet-travel);
28
+ }
29
+
30
+ &[data-side='top'] > * {
31
+ @apply inset-x-0 top-0 -translate-y-(--_sheet-travel);
32
+ }
33
+
34
+ &[data-side='left'] > * {
35
+ @apply inset-y-0 left-0 w-3/4 -translate-x-(--_sheet-travel);
36
+ }
37
+
38
+ &:not([data-side]) > *,
39
+ &[data-side='right'] > * {
40
+ @apply inset-y-0 right-0 w-3/4 translate-x-(--_sheet-travel);
41
+ }
42
+
43
+ &[data-closing] {
44
+ @apply opacity-0 backdrop:opacity-0;
45
+ }
46
+
47
+ &[data-closing][data-side='bottom'] > * {
48
+ @apply translate-y-(--_sheet-travel);
49
+ }
50
+
51
+ &[data-closing][data-side='top'] > * {
52
+ @apply -translate-y-(--_sheet-travel);
53
+ }
54
+
55
+ &[data-closing][data-side='left'] > * {
56
+ @apply -translate-x-(--_sheet-travel);
57
+ }
58
+
59
+ &[data-closing]:not([data-side]) > *,
60
+ &[data-closing][data-side='right'] > * {
61
+ @apply translate-x-(--_sheet-travel);
62
+ }
63
+
64
+ &:is([open], :popover-open):not([data-closing]) {
65
+ @apply opacity-100 backdrop:opacity-100;
66
+
67
+ > * {
68
+ @apply translate-x-0 translate-y-0;
69
+ }
70
+
71
+ @starting-style {
72
+ @apply opacity-0 backdrop:opacity-0;
73
+
74
+ &[data-side='bottom'] > * {
75
+ @apply translate-y-(--_sheet-travel);
76
+ }
77
+
78
+ &[data-side='top'] > * {
79
+ @apply -translate-y-(--_sheet-travel);
80
+ }
81
+
82
+ &[data-side='left'] > * {
83
+ @apply -translate-x-(--_sheet-travel);
84
+ }
85
+
86
+ &:not([data-side]) > *,
87
+ &[data-side='right'] > * {
88
+ @apply translate-x-(--_sheet-travel);
89
+ }
90
+ }
91
+ }
92
+
93
+ > * > header {
94
+ @apply flex flex-col;
95
+ }
96
+
97
+ > * > section {
98
+ @apply min-h-0 flex-1 overflow-y-auto;
99
+ }
100
+
101
+ > * > footer {
102
+ @apply mt-auto flex flex-col;
103
+ }
104
+ }
105
+
106
+ .sheet:not([data-side]) > *,
107
+ .sheet:is([data-side='left'], [data-side='right']) > * {
108
+ @apply h-full sm:max-w-sm;
109
+ }
110
+ .sheet > * {
111
+ @apply max-h-dvh;
112
+ }
113
+ .sheet > * > button:last-child {
114
+ @apply absolute;
115
+ }
116
+ @media (prefers-reduced-motion: reduce) {
117
+ .sheet,
118
+ .sheet::backdrop,
119
+ .sheet > * {
120
+ transition: none;
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,49 @@
1
+ /* Shimmer */
2
+ @keyframes basecoat-shimmer {
3
+ from { background-position: 100% 0; }
4
+ to { background-position: 0 0; }
5
+ }
6
+
7
+ @source inline("shimmer");
8
+
9
+ @utility shimmer {
10
+ -webkit-text-fill-color: currentColor;
11
+
12
+ /* Keep text readable where the relative-color gradient is unsupported. */
13
+ @supports (color: oklch(from currentColor l c h)) {
14
+ --_shimmer-spread: var(--shimmer-spread, calc(3ch + 40px));
15
+ --_shimmer-highlight: var(--shimmer-color, oklch(from currentColor l c h / calc(alpha * 0.2)));
16
+ background-image: linear-gradient(
17
+ calc(90deg + var(--shimmer-angle, 20deg)),
18
+ currentColor calc(50% - var(--_shimmer-spread)),
19
+ color-mix(in oklch, var(--_shimmer-highlight), currentColor 50%) calc(50% - var(--_shimmer-spread) * 0.5),
20
+ var(--_shimmer-highlight) 50%,
21
+ color-mix(in oklch, var(--_shimmer-highlight), currentColor 50%) calc(50% + var(--_shimmer-spread) * 0.5),
22
+ currentColor calc(50% + var(--_shimmer-spread))
23
+ );
24
+ background-repeat: no-repeat;
25
+ background-size: calc(200% + var(--_shimmer-spread) * 2) 100%;
26
+ background-clip: text;
27
+ -webkit-background-clip: text;
28
+ -webkit-text-fill-color: transparent;
29
+ animation: basecoat-shimmer var(--shimmer-duration, 2s) linear infinite;
30
+
31
+ html.dark & {
32
+ --_shimmer-highlight: var(--shimmer-color, oklch(from currentColor max(0.8, calc(l + 0.4)) c h / calc(alpha + 0.4)));
33
+ }
34
+ &:dir(rtl) { animation-direction: reverse; }
35
+ }
36
+
37
+ @media (prefers-reduced-motion: reduce), (forced-colors: active) {
38
+ animation: none;
39
+ background-image: none;
40
+ -webkit-text-fill-color: currentColor;
41
+ }
42
+ @media (forced-colors: active) { -webkit-text-fill-color: CanvasText; }
43
+ }
44
+
45
+ @layer utilities {
46
+ :where(.attachment:is([data-state='uploading'], [data-state='processing']) > section > :first-child) {
47
+ @apply shimmer;
48
+ }
49
+ }
@@ -1,5 +1,13 @@
1
+ @import "../base/transition-details.css";
2
+
1
3
  /* Sidebar */
2
4
  @layer components {
5
+ .sidebar > nav li > details {
6
+ @apply transition-details;
7
+ &::details-content { @apply opacity-0; }
8
+ &[open]::details-content { @apply opacity-100; }
9
+ }
10
+
3
11
  .sidebar {
4
12
  &:not([data-sidebar-initialized]) {
5
13
  @apply max-md:hidden;
@@ -88,7 +96,7 @@
88
96
  }
89
97
  > summary {
90
98
  &::after {
91
- @apply ms-auto block size-3.5 bg-current content-[''] transition-transform ease-linear;
99
+ @apply ms-auto block size-3.5 bg-current content-[''] transition-transform ease-linear motion-reduce:transition-none;
92
100
  @apply mask-[image:var(--chevron-down-icon)] mask-size-[1rem] mask-no-repeat mask-center;
93
101
  }
94
102
  }
@@ -1,57 +1,72 @@
1
- /* Toasts */
1
+ /* Toasts: measured native content, CSS stacking and transitions. */
2
2
  @layer components {
3
3
  .toaster {
4
- @apply pointer-events-none fixed bottom-0 z-50 flex w-full flex-col-reverse gap-4 p-4 sm:max-w-90;
4
+ @apply pointer-events-none fixed inset-x-4 bottom-4 z-50 m-0 mx-auto h-0 w-auto max-w-sm list-none p-0 outline-none sm:mx-0 sm:w-full;
5
5
 
6
6
  &:not([data-align]),
7
- &[data-align='end'] {
8
- @apply right-0;
9
- }
10
- &[data-align='start'] {
11
- @apply left-0;
12
- }
13
- &[data-align='center'] {
14
- @apply left-1/2 -translate-x-1/2;
15
- }
16
- .toast {
17
- @apply pointer-events-auto grid w-full grid-rows-[1fr] animate-[toast-up_0.3s_ease-in-out] transition-[grid-template-rows,opacity] duration-300 ease-in-out;
18
-
19
- .toast-content {
20
- @apply flex items-center gap-2.5 overflow-hidden p-3 text-[13px];
7
+ &[data-align='end'] { @apply sm:start-auto sm:end-4; }
8
+ &[data-align='start'] { @apply sm:start-4 sm:end-auto; }
9
+ &[data-align='center'] { @apply sm:start-1/2 sm:end-auto sm:-translate-x-1/2 sm:rtl:translate-x-1/2; }
21
10
 
22
- svg {
23
- @apply size-4 shrink-0;
24
- }
25
- section {
26
- h2 {
27
- @apply font-medium tracking-tight;
28
- }
29
- p {
30
- @apply text-muted-foreground break-all;
31
- }
32
- }
33
- footer {
34
- @apply ms-auto flex flex-col gap-2;
11
+ .toast {
12
+ --toast-scale: max(0, calc(1 - var(--toast-index, 0) * 0.1));
13
+ --toast-lift: calc(var(--toast-index, 0) * -12px - (1 - var(--toast-scale)) * var(--toast-front-height, 0px));
14
+ --toast-swipe-x: 0px;
15
+ --toast-swipe-y: 0px;
16
+ @apply pointer-events-auto absolute inset-x-0 bottom-0 w-full list-none select-none outline-none;
17
+ height: var(--toast-front-height, auto);
18
+ z-index: calc(1000 - var(--toast-index, 0));
19
+ transform-origin: bottom center;
20
+ transform: translateX(var(--toast-swipe-x)) translateY(calc(var(--toast-lift) + var(--toast-swipe-y))) scale(var(--toast-scale));
21
+ transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1), opacity 500ms, height 150ms;
22
+ touch-action: none;
35
23
 
36
- [data-toast-action],
37
- [data-toast-cancel] {
38
- @apply h-6 px-2.5 text-xs;
39
- }
40
- }
24
+ &::after {
25
+ content: '';
26
+ @apply absolute inset-x-0 top-full h-[13px];
41
27
  }
42
- &[aria-hidden='true'] {
43
- @apply grid-rows-[0fr] overflow-hidden border-0 p-0 opacity-0;
44
28
 
45
- .toast-content {
46
- @apply border-0;
29
+ > .toast-content {
30
+ @apply flex items-center overflow-hidden;
31
+ transition: opacity 250ms cubic-bezier(0.22, 1, 0.36, 1);
32
+ > svg { @apply pointer-events-none shrink-0; }
33
+ > section { @apply flex min-w-0 flex-1 flex-col wrap-break-word; }
34
+ > footer { @apply ms-auto flex shrink-0 items-center; }
35
+ > footer > .btn[data-size='icon-sm'] {
36
+ @apply relative after:absolute after:-inset-2 after:content-[''];
47
37
  }
48
38
  }
39
+
40
+ &:where(:has(~ .toast:not([aria-hidden='true']))) > .toast-content { @apply opacity-0; }
41
+ &[data-toast-stack-overflow] { @apply pointer-events-none opacity-0; }
42
+ &[aria-hidden='true'] { @apply pointer-events-none; }
43
+ }
44
+
45
+ &:where(:hover, :focus-within, :has([data-toast-swiping])) .toast:not([aria-hidden='true']) {
46
+ height: var(--toast-height);
47
+ transform: translateX(var(--toast-swipe-x)) translateY(calc(var(--toast-offset, 0px) * -1 + var(--toast-swipe-y)));
48
+ > .toast-content { @apply opacity-100; }
49
+ }
50
+
51
+ .toast[data-toast-expanded][aria-hidden='true'] {
52
+ height: var(--toast-height);
53
+ > .toast-content { opacity: 1; }
54
+ }
55
+ .toast > .toast-content > footer > :is([data-toast-action], [data-toast-cancel]):not([data-size]) { @apply h-6 px-2.5 text-xs; }
56
+
57
+ .toast:not([data-toast-initialized]),
58
+ .toast[aria-hidden='true']:not([data-toast-stack-overflow]) {
59
+ transform: translateY(calc(var(--toast-swipe-y) + 150%));
60
+ }
61
+ .toast[aria-hidden='true'][data-toast-swipe='x'] {
62
+ transform: translateX(calc(var(--toast-swipe-x) + var(--toast-swipe-end))) translateY(calc(var(--toast-offset, 0px) * -1));
63
+ }
64
+ .toast[data-toast-swiping] { transition: none; }
65
+ .toast[data-category='loading'] > .toast-content > svg { @apply animate-spin; }
66
+
67
+ @media (prefers-reduced-motion: reduce) {
68
+ .toast, .toast > .toast-content { transition: none; }
69
+ .toast[data-category='loading'] > .toast-content > svg { animation: none; }
49
70
  }
50
- }
51
- }
52
- @keyframes toast-up {
53
- from {
54
- opacity: 0;
55
- transform: translateY(100%);
56
71
  }
57
72
  }
@@ -0,0 +1,34 @@
1
+ @import "../base/transition-details.css";
2
+
3
+ /* Trace */
4
+ @layer components {
5
+ .trace {
6
+ @apply flex w-full min-w-0 flex-col;
7
+ }
8
+ .trace-line {
9
+ @apply flex w-fit max-w-full min-w-0 items-center text-start;
10
+ }
11
+ .trace-line > span {
12
+ @apply min-w-0 truncate;
13
+ }
14
+ .trace-line > :is(svg, small) {
15
+ @apply shrink-0;
16
+ }
17
+ :is(a, button, summary).trace-line {
18
+ @apply cursor-pointer;
19
+ }
20
+ details:has(> summary.trace-line) { @apply transition-details; }
21
+ summary.trace-line::-webkit-details-marker { display: none; }
22
+ summary.trace-line::after {
23
+ content: '';
24
+ @apply size-1.5 shrink-0 rotate-45 border-e border-t transition-transform motion-reduce:transition-none;
25
+ }
26
+ details[open] > summary.trace-line::after {
27
+ @apply rotate-[135deg];
28
+ }
29
+ summary.trace-line:dir(rtl)::after { rotate: -45deg; }
30
+ details[open] > summary.trace-line:dir(rtl)::after { rotate: -135deg; }
31
+ summary.trace-line + div {
32
+ @apply min-w-0 wrap-break-word;
33
+ }
34
+ }