basecoat-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.
Files changed (107) hide show
  1. package/README.md +1 -1
  2. package/dist/base/base.css +11 -1
  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 +2532 -0
  6. package/dist/basecoat-base.cdn.css +1948 -677
  7. package/dist/basecoat-base.cdn.min.css +1 -2
  8. package/dist/basecoat-compat.cdn.css +251 -76
  9. package/dist/basecoat-compat.cdn.min.css +1 -2
  10. package/dist/basecoat-components.css +10 -0
  11. package/dist/basecoat-luma.bundle.css +4309 -0
  12. package/dist/basecoat-luma.cdn.css +5309 -3216
  13. package/dist/basecoat-luma.cdn.min.css +1 -2
  14. package/dist/basecoat-lyra.bundle.css +4287 -0
  15. package/dist/basecoat-lyra.cdn.css +5130 -3099
  16. package/dist/basecoat-lyra.cdn.min.css +1 -2
  17. package/dist/basecoat-maia.bundle.css +4275 -0
  18. package/dist/basecoat-maia.cdn.css +5220 -3158
  19. package/dist/basecoat-maia.cdn.min.css +1 -2
  20. package/dist/basecoat-mira.bundle.css +4284 -0
  21. package/dist/basecoat-mira.cdn.css +3530 -1494
  22. package/dist/basecoat-mira.cdn.min.css +1 -2
  23. package/dist/basecoat-nova.bundle.css +4300 -0
  24. package/dist/basecoat-nova.cdn.css +3685 -1623
  25. package/dist/basecoat-nova.cdn.min.css +1 -2
  26. package/dist/basecoat-rhea.bundle.css +4314 -0
  27. package/dist/basecoat-rhea.cdn.css +5315 -3219
  28. package/dist/basecoat-rhea.cdn.min.css +1 -2
  29. package/dist/basecoat-sera.bundle.css +4295 -0
  30. package/dist/basecoat-sera.cdn.css +3219 -1191
  31. package/dist/basecoat-sera.cdn.min.css +1 -2
  32. package/dist/basecoat-vega.bundle.css +4289 -0
  33. package/dist/basecoat-vega.cdn.css +3681 -1616
  34. package/dist/basecoat-vega.cdn.min.css +1 -2
  35. package/dist/basecoat.bundle.css +4289 -0
  36. package/dist/basecoat.cdn.css +3681 -1616
  37. package/dist/basecoat.cdn.min.css +1 -2
  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 +13 -1
  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 +19 -8
  61. package/dist/components/toast.css +59 -44
  62. package/dist/components/tooltip.css +1 -1
  63. package/dist/components/trace.css +34 -0
  64. package/dist/js/all.js +513 -122
  65. package/dist/js/all.min.js +1 -1
  66. package/dist/js/carousel.js +105 -0
  67. package/dist/js/carousel.min.js +1 -0
  68. package/dist/js/code-block.js +47 -0
  69. package/dist/js/code-block.min.js +1 -0
  70. package/dist/js/combobox.js +6 -2
  71. package/dist/js/combobox.min.js +1 -1
  72. package/dist/js/drawer.js +6 -2
  73. package/dist/js/drawer.min.js +1 -1
  74. package/dist/js/dropdown-menu.js +1 -1
  75. package/dist/js/dropdown-menu.min.js +1 -1
  76. package/dist/js/input-otp.js +76 -0
  77. package/dist/js/input-otp.min.js +1 -0
  78. package/dist/js/popover.js +1 -1
  79. package/dist/js/popover.min.js +1 -1
  80. package/dist/js/select.js +1 -1
  81. package/dist/js/select.min.js +1 -1
  82. package/dist/js/sidebar.js +1 -1
  83. package/dist/js/sidebar.min.js +1 -1
  84. package/dist/js/tabs.js +31 -58
  85. package/dist/js/tabs.min.js +1 -1
  86. package/dist/js/toast.js +236 -57
  87. package/dist/js/toast.min.js +1 -1
  88. package/dist/styles/luma.css +451 -50
  89. package/dist/styles/lyra.css +418 -42
  90. package/dist/styles/maia.css +427 -48
  91. package/dist/styles/mira.css +422 -43
  92. package/dist/styles/nova.css +432 -51
  93. package/dist/styles/rhea.css +453 -52
  94. package/dist/styles/sera.css +416 -50
  95. package/dist/styles/vega.css +418 -47
  96. package/dist/typeset.cdn.css +381 -0
  97. package/dist/typeset.cdn.min.css +1 -0
  98. package/dist/typeset.css +435 -0
  99. package/package.json +18 -6
  100. package/templates/jinja/command.html.jinja +1 -1
  101. package/templates/jinja/dialog.html.jinja +1 -1
  102. package/templates/jinja/tabs.html.jinja +0 -1
  103. package/templates/jinja/toast.html.jinja +29 -26
  104. package/templates/nunjucks/command.njk +1 -1
  105. package/templates/nunjucks/dialog.njk +1 -1
  106. package/templates/nunjucks/tabs.njk +1 -1
  107. package/templates/nunjucks/toast.njk +30 -27
@@ -1,27 +1,12 @@
1
1
  /* Legacy Basecoat class API compatibility.
2
2
  This layer preserves pre-1.0 visual classes for the default Basecoat style only. */
3
3
 
4
+ @reference "../components/scrollbar.css";
5
+
4
6
  @layer components {
5
7
  .scrollbar-thin {
8
+ @apply scrollbar;
6
9
  scrollbar-width: thin;
7
- scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
8
-
9
- &::-webkit-scrollbar {
10
- width: var(--scrollbar-sm-width);
11
- height: var(--scrollbar-sm-width);
12
- }
13
- &::-webkit-scrollbar-track {
14
- background: var(--scrollbar-track);
15
- }
16
- &::-webkit-scrollbar-thumb {
17
- background: var(--scrollbar-thumb);
18
- border-radius: var(--scrollbar-radius);
19
- border: 1px solid transparent;
20
- background-clip: padding-box;
21
- }
22
- &::-webkit-scrollbar-corner {
23
- background: var(--scrollbar-track);
24
- }
25
10
  }
26
11
  }
27
12
 
@@ -1,5 +1,13 @@
1
+ @import "../base/transition-details.css";
2
+
1
3
  /* Accordion */
2
4
  @layer components {
5
+ .accordion > details {
6
+ @apply transition-details;
7
+ &::details-content { @apply opacity-0; }
8
+ &[open]::details-content { @apply opacity-100; }
9
+ }
10
+
3
11
  .accordion {
4
12
  @apply flex w-full flex-col;
5
13
  }
@@ -9,7 +17,7 @@
9
17
  }
10
18
 
11
19
  .accordion > details > summary > svg:last-child {
12
- @apply pointer-events-none shrink-0 transition-transform;
20
+ @apply pointer-events-none shrink-0 transition-transform motion-reduce:transition-none;
13
21
  }
14
22
 
15
23
  .accordion > details[open] > summary > svg:last-child {
@@ -24,4 +32,10 @@
24
32
  .accordion > details > :not(summary) {
25
33
  @apply overflow-hidden;
26
34
  }
35
+ @media (forced-colors: active) {
36
+ .accordion > details > summary:focus-visible {
37
+ outline: 2px solid Highlight;
38
+ outline-offset: 2px;
39
+ }
40
+ }
27
41
  }
@@ -12,6 +12,10 @@
12
12
  @apply min-h-4;
13
13
  }
14
14
 
15
+ .alert > :is(h2, h3, h4, h5, h6, strong, [data-title], section) :where(a[href]:not(.btn)) {
16
+ @apply underline decoration-dotted decoration-current/50 underline-offset-3 hover:text-foreground hover:decoration-current focus-visible:decoration-current;
17
+ }
18
+
15
19
  .alert > section {
16
20
  @apply grid justify-items-start gap-1;
17
21
 
@@ -0,0 +1,66 @@
1
+ @import "../base/scroll-fade.css";
2
+
3
+ /* Attachment */
4
+ @layer components {
5
+ .attachment {
6
+ @apply relative flex max-w-full min-w-0 shrink-0 flex-wrap transition-colors;
7
+ }
8
+ .attachment:not([data-orientation='vertical']) {
9
+ @apply items-center;
10
+ }
11
+ .attachment[data-orientation='vertical'] {
12
+ @apply flex-col;
13
+ }
14
+ .attachment > figure {
15
+ @apply relative flex aspect-square shrink-0 items-center justify-center overflow-hidden;
16
+ }
17
+ .attachment > figure > svg {
18
+ @apply pointer-events-none;
19
+ }
20
+ .attachment > figure > img {
21
+ @apply aspect-square w-full object-cover;
22
+ }
23
+ .attachment > section {
24
+ @apply max-w-full min-w-0 flex-1;
25
+ }
26
+ .attachment > section > * {
27
+ @apply block max-w-full min-w-0 truncate;
28
+ }
29
+
30
+ .attachment > div {
31
+ @apply relative z-20 flex shrink-0 items-center;
32
+ }
33
+
34
+ .attachment[data-orientation='vertical'] > div {
35
+ @apply absolute;
36
+ }
37
+ .attachment > :is(a, button) {
38
+ @apply absolute inset-0 z-10 outline-none;
39
+ }
40
+ /* An inset focus indicator stays visible at the clipped edges of a file row. */
41
+ .attachment:has(> :is(a, button):focus-visible) {
42
+ outline: 2px solid currentColor;
43
+ outline-offset: -2px;
44
+ }
45
+ .attachment > button:disabled {
46
+ @apply cursor-not-allowed;
47
+ }
48
+ .attachment-group {
49
+ @apply flex min-w-0 snap-x snap-mandatory overflow-x-auto overscroll-x-contain;
50
+ @apply scroll-fade-x;
51
+ scrollbar-width: none;
52
+ }
53
+ .attachment-group:focus-within { mask-image: none; }
54
+ .attachment-group::-webkit-scrollbar { display: none; }
55
+ .attachment-group > .attachment {
56
+ @apply flex-none snap-start;
57
+ }
58
+ @media (forced-colors: active) {
59
+ .attachment:has(> :is(a, button):focus-visible),
60
+ .attachment-group:focus-visible {
61
+ outline: 2px solid Highlight;
62
+ outline-offset: -2px;
63
+ }
64
+ .attachment-group { mask-image: none; }
65
+ }
66
+ }
@@ -0,0 +1,28 @@
1
+ /* Bubble */
2
+ @layer components {
3
+ .bubble-group {
4
+ @apply flex min-w-0 flex-col;
5
+ }
6
+ .bubble {
7
+ @apply relative flex w-fit min-w-0 flex-col;
8
+ }
9
+ .bubble > :first-child {
10
+ @apply w-fit max-w-full min-w-0 overflow-hidden wrap-break-word;
11
+ }
12
+ .bubble > :is(a, button):first-child {
13
+ @apply text-start transition-colors outline-none;
14
+ }
15
+ .bubble > button:disabled {
16
+ @apply pointer-events-none opacity-50;
17
+ }
18
+
19
+ .bubble > div:not(:first-child) {
20
+ @apply absolute z-10 flex w-fit shrink-0 items-center justify-center;
21
+ }
22
+ @media (forced-colors: active) {
23
+ .bubble > :is(a, button):first-child:focus-visible {
24
+ outline: 2px solid Highlight;
25
+ outline-offset: 2px;
26
+ }
27
+ }
28
+ }
@@ -12,6 +12,7 @@
12
12
  }
13
13
 
14
14
  > *:focus-visible,
15
+ > .btn:has(> input:focus-visible),
15
16
  > :is(.dropdown-menu, .popover, .select) > button:focus-visible {
16
17
  @apply relative z-10;
17
18
  }
@@ -48,7 +49,7 @@
48
49
  }
49
50
  }
50
51
 
51
- .button-group > :is(span, label, output) {
52
+ .button-group > :is(span, label, output):not(.btn) {
52
53
  @apply flex items-center [&_svg]:pointer-events-none;
53
54
  }
54
55
  }
@@ -3,4 +3,27 @@
3
3
  .btn {
4
4
  @apply inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0;
5
5
  }
6
+ .btn:has(> input:is([type='checkbox'], [type='radio'])) {
7
+ @apply relative;
8
+ }
9
+ .btn > input:is([type='checkbox'], [type='radio']) {
10
+ @apply sr-only;
11
+ }
12
+ @media (forced-colors: active) {
13
+ .btn:has(> input:checked)::after {
14
+ content: '';
15
+ position: absolute;
16
+ inset: 4px;
17
+ border: 2px solid Highlight;
18
+ pointer-events: none;
19
+ }
20
+ .btn:focus-visible,
21
+ .btn:has(> input:focus-visible) {
22
+ outline: 2px solid Highlight;
23
+ outline-offset: 2px;
24
+ }
25
+ }
26
+ .btn:has(> input:disabled) {
27
+ @apply pointer-events-none opacity-50;
28
+ }
6
29
  }
@@ -0,0 +1,30 @@
1
+ /* Carousel */
2
+ @layer components {
3
+ .carousel {
4
+ @apply relative min-w-0;
5
+
6
+ > ul {
7
+ @apply flex overflow-x-auto overscroll-x-contain snap-x snap-mandatory scroll-smooth motion-reduce:scroll-auto;
8
+ }
9
+ > button {
10
+ @apply touch-manipulation;
11
+ }
12
+ > ul > li {
13
+ @apply min-w-0 shrink-0 basis-full snap-start;
14
+ }
15
+ &[data-orientation='vertical'] > ul {
16
+ @apply flex-col overflow-x-hidden overflow-y-auto snap-y;
17
+ }
18
+ &[data-orientation='vertical'] > ul > li {
19
+ @apply min-h-0;
20
+ }
21
+ }
22
+ }
23
+
24
+ /* Initialized controls replace the optional scrollbar utility. */
25
+ @layer utilities {
26
+ .carousel[data-carousel-initialized] > ul {
27
+ scrollbar-width: none;
28
+ &::-webkit-scrollbar { display: none; }
29
+ }
30
+ }
@@ -4,7 +4,11 @@
4
4
  .input[type='checkbox']:not([role='switch']) {
5
5
  @apply relative shrink-0 appearance-none outline-none disabled:cursor-not-allowed disabled:opacity-50;
6
6
 
7
- &:checked:after {
7
+ &:indeterminate::after {
8
+ @apply block h-0.5 w-2.5 bg-current content-[''];
9
+ }
10
+
11
+ &:checked:not(:indeterminate):after {
8
12
  @apply content-[''] block bg-current;
9
13
  @apply mask-[image:var(--check-icon)] mask-size-[0.875rem] mask-no-repeat mask-center;
10
14
  }
@@ -0,0 +1,80 @@
1
+ @import "../base/scroll-fade.css";
2
+
3
+ /* Code Block */
4
+ @layer components {
5
+ .code-block {
6
+ @apply relative m-0 flex w-full min-w-0 flex-col overflow-hidden;
7
+ }
8
+ .code-block > output { @apply sr-only; }
9
+ .code-block > header,
10
+ .code-block > footer {
11
+ @apply flex min-w-0 shrink-0 items-center;
12
+ }
13
+ .code-block > header > :first-child:not(div) {
14
+ @apply min-w-0 truncate [&_svg]:inline-block [&_svg]:align-middle;
15
+ }
16
+ .code-block > div,
17
+ .code-block > header > div {
18
+ @apply ms-auto flex shrink-0 items-center;
19
+ }
20
+ .code-block > div {
21
+ @apply absolute z-10 opacity-0 transition-opacity;
22
+ }
23
+ .code-block:is(:hover, :focus-within) > div {
24
+ @apply opacity-100;
25
+ }
26
+ @media (pointer: coarse) {
27
+ .code-block > div { opacity: 1; }
28
+ }
29
+ .code-block > pre {
30
+ @apply scroll-fade m-0 min-h-0 min-w-0 overflow-auto text-start font-mono outline-none;
31
+ direction: ltr;
32
+ color-scheme: light;
33
+ tab-size: 2;
34
+ }
35
+ html.dark .code-block > pre { color-scheme: dark; }
36
+ .code-block > pre > code {
37
+ @apply block w-auto min-h-lh min-w-max p-0;
38
+ font-size: inherit;
39
+ font-family: inherit;
40
+ counter-reset: line;
41
+ }
42
+ .code-block > pre > code > span {
43
+ /* Keep real newline text in the inline flow for native selection and copying. */
44
+ @apply relative inline-block min-h-lh align-top;
45
+ width: calc(100% + 2 * var(--_code-padding));
46
+ counter-increment: line;
47
+ }
48
+ .code-block > pre[data-line-numbers] > code > span {
49
+ padding-inline-start: calc(var(--_code-padding) + 4ch);
50
+ }
51
+ .code-block > pre[data-line-numbers] > code > span::before {
52
+ content: counter(line);
53
+ @apply absolute select-none;
54
+ inset-inline-start: var(--_code-padding);
55
+ width: 3ch;
56
+ }
57
+ @supports (content: counter(line) / '') {
58
+ .code-block > pre[data-line-numbers] > code > span::before { content: counter(line) / ''; }
59
+ }
60
+ .code-block > pre[data-wrap] {
61
+ @apply whitespace-pre-wrap break-words;
62
+ }
63
+ .code-block > pre[data-wrap] > code {
64
+ @apply min-w-0;
65
+ }
66
+ .code-block button[data-copy] > svg:last-child:not(:first-child) { display: none; }
67
+ .code-block button[data-copy][data-copied] > svg:first-child { display: none; }
68
+ .code-block button[data-copy][data-copied] > svg:last-child { display: block; }
69
+ .code-block > pre:not([data-wrap]) {
70
+ /* Source code always reads left to right, including in RTL documents. */
71
+ --_fade-axis: x;
72
+ --_fade-direction: to right;
73
+ }
74
+ @media (forced-colors: active) {
75
+ .code-block:has(> pre:focus-visible) { outline: 2px solid Highlight; outline-offset: 2px; }
76
+ }
77
+ @media (prefers-reduced-motion: reduce) {
78
+ .code-block > div { transition: none; }
79
+ }
80
+ }
@@ -1,15 +1,6 @@
1
1
  /* Collapsible */
2
2
  @layer components {
3
3
  details {
4
- &::details-content {
5
- block-size: 0;
6
- @apply block opacity-0 transition-discrete transition-all;
7
- }
8
- &[open]::details-content {
9
- block-size: auto;
10
- block-size: calc-size(auto, size);
11
- @apply opacity-100;
12
- }
13
4
  summary {
14
5
  @apply inline-flex items-center cursor-pointer;
15
6
  }
@@ -1,5 +1,18 @@
1
+ @keyframes command-scroll-lock {
2
+ from, to {
3
+ scrollbar-gutter: stable;
4
+ }
5
+ }
6
+
1
7
  /* Command */
2
8
  @layer components {
9
+ /* Reserve the scrollbar gutter only when the page can scroll. */
10
+ html:has(.command-dialog:modal) {
11
+ overflow: hidden;
12
+ animation: command-scroll-lock linear both;
13
+ animation-timeline: scroll(self);
14
+ }
15
+
3
16
  .command-dialog {
4
17
  @apply inset-y-0 bg-transparent p-0 text-inherit opacity-0 transition-all transition-discrete;
5
18
  max-width: none;
@@ -1,5 +1,17 @@
1
- /* Dialog */
1
+ @keyframes dialog-scroll-lock {
2
+ from, to {
3
+ scrollbar-gutter: stable;
4
+ }
5
+ }
6
+
2
7
  @layer components {
8
+ /* Reserve the scrollbar gutter only when the page can scroll. */
9
+ html:has(:is(.dialog, .alert-dialog):modal) {
10
+ overflow: hidden;
11
+ animation: dialog-scroll-lock linear both;
12
+ animation-timeline: scroll(self);
13
+ }
14
+
3
15
  .dialog,
4
16
  .alert-dialog {
5
17
  @apply bg-transparent p-0 text-inherit opacity-0 transition-all transition-discrete backdrop:opacity-0 backdrop:transition-all backdrop:transition-discrete;
@@ -1,27 +1,43 @@
1
+ @keyframes drawer-scroll-lock {
2
+ from, to {
3
+ scrollbar-gutter: stable;
4
+ }
5
+ }
6
+
1
7
  /* Drawer */
2
8
  @layer components {
9
+ /* Reserve the scrollbar gutter only when the page can scroll. */
10
+ html:has(.drawer:modal) {
11
+ overflow: hidden;
12
+ animation: drawer-scroll-lock linear both;
13
+ animation-timeline: scroll(self);
14
+ }
15
+
3
16
  .drawer {
4
- @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-500 ease-[cubic-bezier(0.32,0.72,0,1)] backdrop:opacity-0 backdrop:transition-all backdrop:transition-discrete backdrop:duration-500 backdrop:ease-[cubic-bezier(0.32,0.72,0,1)];
17
+ --_drawer-duration: 500ms;
18
+ --_drawer-ease: cubic-bezier(0.32, 0.72, 0, 1);
19
+ --_drawer-travel: 100%;
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-(--_drawer-duration) ease-(--_drawer-ease) backdrop:opacity-0 backdrop:transition-all backdrop:transition-discrete backdrop:duration-500 backdrop:ease-[cubic-bezier(0.32,0.72,0,1)];
5
21
 
6
22
  > * {
7
- @apply fixed z-50 flex h-auto flex-col transition-transform duration-500 ease-[cubic-bezier(0.32,0.72,0,1)] will-change-transform outline-hidden;
23
+ @apply fixed z-50 flex h-auto flex-col transition-transform duration-(--_drawer-duration) ease-(--_drawer-ease) will-change-transform outline-hidden;
8
24
  }
9
25
 
10
26
  &:not([data-side]) > *,
11
27
  &[data-side='bottom'] > * {
12
- @apply inset-x-0 bottom-0 mt-24 max-h-[80vh] translate-y-full;
28
+ @apply inset-x-0 bottom-0 translate-y-(--_drawer-travel);
13
29
  }
14
30
 
15
31
  &[data-side='top'] > * {
16
- @apply inset-x-0 top-0 mb-24 max-h-[80vh] -translate-y-full;
32
+ @apply inset-x-0 top-0 -translate-y-(--_drawer-travel);
17
33
  }
18
34
 
19
35
  &[data-side='left'] > * {
20
- @apply inset-y-0 left-0 w-3/4 max-w-sm -translate-x-full;
36
+ @apply inset-y-0 left-0 w-3/4 -translate-x-(--_drawer-travel);
21
37
  }
22
38
 
23
39
  &[data-side='right'] > * {
24
- @apply inset-y-0 right-0 w-3/4 max-w-sm translate-x-full;
40
+ @apply inset-y-0 right-0 w-3/4 translate-x-(--_drawer-travel);
25
41
  }
26
42
 
27
43
  &[data-closing] {
@@ -30,19 +46,19 @@
30
46
 
31
47
  &[data-closing]:not([data-side]) > *,
32
48
  &[data-closing][data-side='bottom'] > * {
33
- @apply translate-y-full;
49
+ @apply translate-y-(--_drawer-travel);
34
50
  }
35
51
 
36
52
  &[data-closing][data-side='top'] > * {
37
- @apply -translate-y-full;
53
+ @apply -translate-y-(--_drawer-travel);
38
54
  }
39
55
 
40
56
  &[data-closing][data-side='left'] > * {
41
- @apply -translate-x-full;
57
+ @apply -translate-x-(--_drawer-travel);
42
58
  }
43
59
 
44
60
  &[data-closing][data-side='right'] > * {
45
- @apply translate-x-full;
61
+ @apply translate-x-(--_drawer-travel);
46
62
  }
47
63
 
48
64
  &:is([open], :popover-open):not([data-closing]) {
@@ -57,19 +73,19 @@
57
73
 
58
74
  &:not([data-side]) > *,
59
75
  &[data-side='bottom'] > * {
60
- @apply translate-y-full;
76
+ @apply translate-y-(--_drawer-travel);
61
77
  }
62
78
 
63
79
  &[data-side='top'] > * {
64
- @apply -translate-y-full;
80
+ @apply -translate-y-(--_drawer-travel);
65
81
  }
66
82
 
67
83
  &[data-side='left'] > * {
68
- @apply -translate-x-full;
84
+ @apply -translate-x-(--_drawer-travel);
69
85
  }
70
86
 
71
87
  &[data-side='right'] > * {
72
- @apply translate-x-full;
88
+ @apply translate-x-(--_drawer-travel);
73
89
  }
74
90
  }
75
91
  }
@@ -86,4 +102,22 @@
86
102
  @apply mt-auto flex flex-col;
87
103
  }
88
104
  }
105
+
106
+ .drawer:not([data-side]) > *,
107
+ .drawer[data-side='bottom'] > * {
108
+ @apply mt-24 max-h-[80vh];
109
+ }
110
+ .drawer[data-side='top'] > * {
111
+ @apply mb-24 max-h-[80vh];
112
+ }
113
+ .drawer:is([data-side='left'], [data-side='right']) > * {
114
+ @apply max-w-sm;
115
+ }
116
+ @media (prefers-reduced-motion: reduce) {
117
+ .drawer,
118
+ .drawer::backdrop,
119
+ .drawer > * {
120
+ transition: none;
121
+ }
122
+ }
89
123
  }
@@ -0,0 +1,49 @@
1
+ /* Input OTP: the input remains the only form control and keyboard target. */
2
+ @keyframes otp-caret {
3
+ 0%, 70%, 100% { opacity: 1; }
4
+ 20%, 50% { opacity: 0; }
5
+ }
6
+ @layer components {
7
+ .input-otp {
8
+ @apply relative inline-flex max-w-full items-center has-disabled:opacity-50;
9
+ }
10
+ .input-otp > div { display: none; }
11
+ .input-otp[data-input-otp-initialized] > input {
12
+ @apply absolute inset-0 z-20 h-full w-full cursor-text opacity-0;
13
+ font: 16px/1 monospace;
14
+ letter-spacing: -.5em;
15
+ text-align: left;
16
+ }
17
+ .input-otp[data-input-otp-initialized] > input:disabled { cursor: not-allowed; }
18
+ .input-otp[data-input-otp-initialized] > div {
19
+ @apply pointer-events-none flex items-center;
20
+ }
21
+ /* Keep the native long-press paste menu available on iOS. */
22
+ @supports (-webkit-touch-callout: none) {
23
+ .input-otp[data-input-otp-initialized] > input[type='text'] {
24
+ @apply opacity-100 border-transparent bg-transparent text-transparent caret-transparent outline-none;
25
+ box-shadow: none;
26
+ }
27
+ .input-otp[data-input-otp-initialized] > input::selection { background: transparent; }
28
+ .input-otp[data-input-otp-initialized] > input[type='text']:autofill { opacity: 0; }
29
+ }
30
+ .input-otp > div > div { @apply flex items-center; }
31
+ .input-otp > div > div > span {
32
+ @apply relative flex shrink-0 items-center justify-center;
33
+ }
34
+ .input-otp > div > div > span[data-active] { @apply z-10; }
35
+ .input-otp > div > div > span[data-caret]::after {
36
+ content: '';
37
+ @apply pointer-events-none absolute;
38
+ animation: otp-caret 1s infinite;
39
+ }
40
+ @media (prefers-reduced-motion: reduce) {
41
+ .input-otp > div > div > span { transition: none; }
42
+ .input-otp > div > div > span[data-caret]::after { animation: none; }
43
+ }
44
+ @media (forced-colors: active) {
45
+ .input-otp:focus-within > div { outline: 2px solid Highlight; outline-offset: 3px; }
46
+ .input-otp > div > div > span[data-active] { outline: 2px solid Highlight; outline-offset: -2px; }
47
+ .input-otp > div > div > span[data-caret]::after { background: CanvasText; }
48
+ }
49
+ }
@@ -47,4 +47,10 @@
47
47
  .item p {
48
48
  @apply text-muted-foreground line-clamp-2 text-start font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary;
49
49
  }
50
+ @media (forced-colors: active) {
51
+ a.item:focus-visible {
52
+ outline: 2px solid Highlight;
53
+ outline-offset: 2px;
54
+ }
55
+ }
50
56
  }
@@ -0,0 +1,20 @@
1
+ /* Marker */
2
+ @layer components {
3
+ .marker {
4
+ @apply relative flex w-full min-w-0 items-center;
5
+ }
6
+ .marker > svg {
7
+ @apply shrink-0;
8
+ }
9
+ .marker > span {
10
+ @apply min-w-0 wrap-break-word;
11
+ }
12
+ .marker[data-variant='separator']::before,
13
+ .marker[data-variant='separator']::after {
14
+ content: '';
15
+ @apply min-w-0 flex-1 border-t;
16
+ }
17
+ .marker[data-variant='separator'] > span {
18
+ @apply flex-none text-center;
19
+ }
20
+ }
@@ -0,0 +1,24 @@
1
+ /* Message */
2
+ @layer components {
3
+ .message-group {
4
+ @apply flex min-w-0 flex-col;
5
+ }
6
+ .message {
7
+ @apply flex w-full min-w-0;
8
+ }
9
+ .message > .avatar {
10
+ @apply shrink-0 self-end;
11
+ }
12
+ .message > div:last-child {
13
+ @apply flex min-w-0 flex-1 flex-col wrap-break-word;
14
+ }
15
+ .message > div:last-child > :is(header, footer) {
16
+ @apply flex max-w-full min-w-0 items-center;
17
+ }
18
+ .message[data-align='end'] {
19
+ @apply flex-row-reverse;
20
+ }
21
+ .message[data-align='end'] > div:last-child {
22
+ @apply items-end;
23
+ }
24
+ }
@@ -47,4 +47,11 @@
47
47
  @apply bg-muted;
48
48
  }
49
49
  }
50
+ @media (forced-colors: active) {
51
+ .field > input[type='range']:focus-visible,
52
+ .input[type='range']:focus-visible {
53
+ outline: 2px solid Highlight;
54
+ outline-offset: 2px;
55
+ }
56
+ }
50
57
  }