@talelk/newui-tailwind 0.0.0-stage → 1.0.2

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,177 @@
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
+ /* The padded-row outline: the row (Checkbox/Switch `padded`) draws the ring
34
+ * around itself while its hidden control holds keyboard focus. Same outline
35
+ * mechanism as `focus-ring` — never a `ring-*` box-shadow, which would
36
+ * collide with `shadow-*` and vanish in forced-colors mode. */
37
+ @utility focus-ring-within {
38
+ &:has(:focus-visible) {
39
+ outline: var(--focus-outline-default);
40
+ outline-offset: 0px;
41
+ }
42
+ }
43
+
44
+ /* Stacking and motion scales. The numbers live in `@theme` (`--z-*`,
45
+ * `--duration-*`, generated from `@talelk/newui-tokens`); these utilities are the
46
+ * named vocabulary components use, so a layer change is a token edit and the
47
+ * merge config can treat the names as one axis. */
48
+ @utility z-raised {
49
+ z-index: var(--z-raised);
50
+ }
51
+ @utility z-floating {
52
+ z-index: var(--z-floating);
53
+ }
54
+ @utility z-overlay {
55
+ z-index: var(--z-overlay);
56
+ }
57
+ @utility z-top {
58
+ z-index: var(--z-top);
59
+ }
60
+ @utility duration-instant {
61
+ transition-duration: var(--duration-instant);
62
+ }
63
+ @utility duration-fast {
64
+ transition-duration: var(--duration-fast);
65
+ }
66
+ @utility duration-base {
67
+ transition-duration: var(--duration-base);
68
+ }
69
+ @utility duration-moderate {
70
+ transition-duration: var(--duration-moderate);
71
+ }
72
+ @utility duration-slow {
73
+ transition-duration: var(--duration-slow);
74
+ }
75
+ @utility duration-progress {
76
+ transition-duration: var(--duration-progress);
77
+ }
78
+
79
+ /* A disclosure panel — the body of an `Accordion` item or a `Collapsible`.
80
+ *
81
+ * The panel animates its own height, which a `height: auto` element cannot do.
82
+ * `grid-template-rows: 0fr → 1fr` is the one height animation that needs no
83
+ * measurement: the wrapper clips, the inner box holds the padding, and the row
84
+ * collapses to exactly zero. `visibility` is the accessibility half — a
85
+ * collapsed panel leaves the tab order and the accessibility tree — and it is
86
+ * delayed by the transition's duration so the close is still visible before the
87
+ * panel disappears. (Zag marks the panel `hidden`, which would win over all of
88
+ * this and snap; the components drop that one prop for this reason.)
89
+ *
90
+ * Reduced motion collapses the transition rather than the panel: the panel must
91
+ * still reach its end states. */
92
+ @utility disclosure-panel {
93
+ display: grid;
94
+ grid-template-rows: 1fr;
95
+ visibility: visible;
96
+ transition:
97
+ grid-template-rows var(--duration-moderate) var(--ease-out),
98
+ visibility 0s 0s;
99
+
100
+ &[data-state="closed"] {
101
+ grid-template-rows: 0fr;
102
+ visibility: hidden;
103
+ transition:
104
+ grid-template-rows var(--duration-moderate) var(--ease-out),
105
+ visibility 0s var(--duration-moderate);
106
+ }
107
+
108
+ @media (prefers-reduced-motion: reduce) {
109
+ transition: none;
110
+
111
+ &[data-state="closed"] {
112
+ transition: none;
113
+ }
114
+ }
115
+ }
116
+
117
+ /* Indeterminate progress: the bar slides across the track. Referenced by
118
+ * `animate-[progress_1.4s_ease-in-out_infinite]` in the Progress component. */
119
+ @keyframes progress {
120
+ 0% {
121
+ transform: translateX(-110%);
122
+ }
123
+ 100% {
124
+ transform: translateX(410%);
125
+ }
126
+ }
127
+
128
+ /* Overlay entrances (speeds are the `--animate-*` tokens in `@theme`; the
129
+ * global reduced-motion block below collapses every one of them). Popups and
130
+ * modals fade in over a 2px settle — no scale, no slide theatrics. */
131
+ @keyframes overlay-in {
132
+ from {
133
+ opacity: 0;
134
+ transform: translateY(2px);
135
+ }
136
+ to {
137
+ opacity: 1;
138
+ transform: translateY(0);
139
+ }
140
+ }
141
+
142
+ /* Bottom-anchored sheets rise the last few pixels into place. */
143
+ @keyframes drawer-in {
144
+ from {
145
+ opacity: 0;
146
+ transform: translateY(8px);
147
+ }
148
+ to {
149
+ opacity: 1;
150
+ transform: translateY(0);
151
+ }
152
+ }
153
+
154
+ /* Skeleton sheen: sweeps a wide background gradient across the block. The
155
+ * consumer supplies the gradient and `background-size: 200% 100%`. */
156
+ @keyframes shimmer {
157
+ from {
158
+ background-position: 200% 0;
159
+ }
160
+ to {
161
+ background-position: -200% 0;
162
+ }
163
+ }
164
+
165
+ /* Respect the OS "reduce motion" setting everywhere, once. Animations collapse
166
+ * to a single near-instant frame instead of being removed, so nothing that
167
+ * depends on an `animationend` (Zag's presence, our exit transitions) stalls. */
168
+ @media (prefers-reduced-motion: reduce) {
169
+ *,
170
+ ::before,
171
+ ::after {
172
+ animation-duration: 0.01ms !important;
173
+ animation-iteration-count: 1 !important;
174
+ transition-duration: 0.01ms !important;
175
+ scroll-behavior: auto !important;
176
+ }
177
+ }