@talelk/newui-tailwind 0.0.0-stage → 1.0.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,120 @@
1
+ /* Focus rings are drawn with `outline`, not `box-shadow`, so they never
2
+ * collide with a `shadow-*` utility and survive forced-colors mode. The ring
3
+ * color comes from the `--focus-outline-*` runtime token, which flips theme. */
4
+ @utility focus-ring {
5
+ outline: var(--focus-outline-default);
6
+ outline-offset: 0px;
7
+ }
8
+ @utility focus-ring-gray {
9
+ outline: var(--focus-outline-default);
10
+ outline-offset: 0px;
11
+ }
12
+ @utility focus-ring-blue {
13
+ outline: var(--focus-outline-blue);
14
+ outline-offset: 0px;
15
+ }
16
+ @utility focus-ring-green {
17
+ outline: var(--focus-outline-green);
18
+ outline-offset: 0px;
19
+ }
20
+ @utility focus-ring-amber {
21
+ outline: var(--focus-outline-amber);
22
+ outline-offset: 0px;
23
+ }
24
+ @utility focus-ring-red {
25
+ outline: var(--focus-outline-red);
26
+ outline-offset: 0px;
27
+ }
28
+ @utility focus-ring-violet {
29
+ outline: var(--focus-outline-violet);
30
+ outline-offset: 0px;
31
+ }
32
+
33
+ /* Stacking and motion scales. The numbers live in `@theme` (`--z-*`,
34
+ * `--duration-*`, generated from `@talelk/newui-tokens`); these utilities are the
35
+ * named vocabulary components use, so a layer change is a token edit and the
36
+ * merge config can treat the names as one axis. */
37
+ @utility z-raised {
38
+ z-index: var(--z-raised);
39
+ }
40
+ @utility z-floating {
41
+ z-index: var(--z-floating);
42
+ }
43
+ @utility z-overlay {
44
+ z-index: var(--z-overlay);
45
+ }
46
+ @utility z-top {
47
+ z-index: var(--z-top);
48
+ }
49
+ @utility duration-fast {
50
+ transition-duration: var(--duration-fast);
51
+ }
52
+ @utility duration-base {
53
+ transition-duration: var(--duration-base);
54
+ }
55
+ @utility duration-slow {
56
+ transition-duration: var(--duration-slow);
57
+ }
58
+
59
+ /* A disclosure panel — the body of an `Accordion` item or a `Collapsible`.
60
+ *
61
+ * The panel animates its own height, which a `height: auto` element cannot do.
62
+ * `grid-template-rows: 0fr → 1fr` is the one height animation that needs no
63
+ * measurement: the wrapper clips, the inner box holds the padding, and the row
64
+ * collapses to exactly zero. `visibility` is the accessibility half — a
65
+ * collapsed panel leaves the tab order and the accessibility tree — and it is
66
+ * delayed by the transition's duration so the close is still visible before the
67
+ * panel disappears. (Zag marks the panel `hidden`, which would win over all of
68
+ * this and snap; the components drop that one prop for this reason.)
69
+ *
70
+ * Reduced motion collapses the transition rather than the panel: the panel must
71
+ * still reach its end states. */
72
+ @utility disclosure-panel {
73
+ display: grid;
74
+ grid-template-rows: 1fr;
75
+ visibility: visible;
76
+ transition:
77
+ grid-template-rows 200ms cubic-bezier(0.23, 1, 0.32, 1),
78
+ visibility 0s 0s;
79
+
80
+ &[data-state="closed"] {
81
+ grid-template-rows: 0fr;
82
+ visibility: hidden;
83
+ transition:
84
+ grid-template-rows 200ms cubic-bezier(0.23, 1, 0.32, 1),
85
+ visibility 0s 200ms;
86
+ }
87
+
88
+ @media (prefers-reduced-motion: reduce) {
89
+ transition: none;
90
+
91
+ &[data-state="closed"] {
92
+ transition: none;
93
+ }
94
+ }
95
+ }
96
+
97
+ /* Indeterminate progress: the bar slides across the track. Referenced by
98
+ * `animate-[progress_1.4s_ease-in-out_infinite]` in the Progress component. */
99
+ @keyframes progress {
100
+ 0% {
101
+ transform: translateX(-110%);
102
+ }
103
+ 100% {
104
+ transform: translateX(410%);
105
+ }
106
+ }
107
+
108
+ /* Respect the OS "reduce motion" setting everywhere, once. Animations collapse
109
+ * to a single near-instant frame instead of being removed, so nothing that
110
+ * depends on an `animationend` (Zag's presence, our exit transitions) stalls. */
111
+ @media (prefers-reduced-motion: reduce) {
112
+ *,
113
+ ::before,
114
+ ::after {
115
+ animation-duration: 0.01ms !important;
116
+ animation-iteration-count: 1 !important;
117
+ transition-duration: 0.01ms !important;
118
+ scroll-behavior: auto !important;
119
+ }
120
+ }