@getvitops/generator 6.0.0 → 7.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.
@@ -44,10 +44,16 @@ wc-tree {
44
44
  position: relative;
45
45
  }
46
46
 
47
- /* Nested list indent. Two shapes are supported: the item may BE the
48
- `<details>`, or be an `<li>` wrapping one — the latter is what `<Tree />`
49
- emits, because `<ul>`/`<li>` is what gives assistive tech list position and
50
- depth. Keep both; the flat shape is the pattern's original contract.
47
+ /* Nested list indent. Two shapes are supported IN THE NO-JS FALLBACK: the
48
+ item may BE the `<details>`, or be an `<li>` wrapping one — the latter is
49
+ what `<Tree />` emits, because `<ul>`/`<li>` is what gives assistive tech
50
+ list position and depth. `<wc-tree>` unwraps both shapes to one structure
51
+ on upgrade (`.tree__item` > `.tree__summary`/`.tree__content` + optional
52
+ nested `.tree`), which is why the first selector below already matches
53
+ the ENHANCED state for both former shapes with no changes — only the
54
+ second (`.tree__item > details > .tree`) is fallback-only now, kept for
55
+ the no-JS list shape. Same split applies to every other
56
+ `details`/`summary`-keyed selector in this file below.
51
57
 
52
58
  Indent is ONE `--tree-indent` per level, not two. This used to set both
53
59
  `margin-inline-start` and `padding-inline-start` to it, putting the guide
@@ -85,6 +91,7 @@ wc-tree {
85
91
  }
86
92
 
87
93
  .tree__content,
94
+ .tree__summary,
88
95
  details.tree__item > summary,
89
96
  .tree__item > details > summary {
90
97
  display: flex;
@@ -100,6 +107,26 @@ wc-tree {
100
107
  padding-inline-start: var(--_leaf-indent);
101
108
  }
102
109
 
110
+ /* `.tree__summary` — the enhanced-state row `<wc-tree>` builds on upgrade,
111
+ replacing `<summary>`. Not `.tree__content`: that class's
112
+ `padding-inline-start: var(--_leaf-indent)` exists specifically to make a
113
+ TOGGLE-LESS row line up with one that has a toggle — applying it to a row
114
+ that DOES have a toggle would double-indent every branch, the mirror
115
+ image of the 24px-misalignment bug the comment above this block
116
+ documents fixing. */
117
+ .tree__summary {
118
+ cursor: pointer;
119
+ /* Only source of this in the enhanced state — `<summary>`'s own
120
+ `user-select: none` came from `details.css`'s bare `details` selector,
121
+ which no longer matches once `<details>` is gone. Without it, a
122
+ drag-select across a label also fires a `click` and toggles the row. */
123
+ user-select: none;
124
+ }
125
+
126
+ /* Fallback-only from here: no-JS renders `<details>`/`<summary>`, which
127
+ `<wc-tree>` unwraps on upgrade (see the class docblock in `WCTree.ts`).
128
+ Kept for the two SSR'd shapes; nothing in the enhanced state matches
129
+ these. */
103
130
  details.tree__item > summary,
104
131
  .tree__item > details > summary {
105
132
  cursor: pointer;
@@ -127,6 +154,13 @@ wc-tree {
127
154
  transition: transform 0.2s ease;
128
155
  }
129
156
 
157
+ /* Enhanced state: `aria-expanded` is the mirror `#setExpanded` writes
158
+ alongside the group's `hidden`, kept in sync with it — see WCTree.ts. */
159
+ .tree__item[aria-expanded='true'] > .tree__summary .tree__toggle {
160
+ transform: rotate(90deg);
161
+ }
162
+
163
+ /* Fallback-only — see the note above `details.tree__item > summary`. */
130
164
  details.tree__item[open] > summary .tree__toggle,
131
165
  .tree__item > details[open] > summary .tree__toggle {
132
166
  transform: rotate(90deg);
@@ -165,8 +199,12 @@ wc-tree {
165
199
  transition: opacity 0.15s ease;
166
200
  }
167
201
 
168
- .tree__item:hover .tree__actions,
169
- .tree__item:focus-within .tree__actions {
202
+ /* `>`, not a descendant selector: `.tree__item` now carries the roving
203
+ tabindex directly, so arrow-keying to a deep item would otherwise light
204
+ up every ANCESTOR branch's own actions row too, not just the row hovered
205
+ or focused. */
206
+ .tree__item:hover > .tree__actions,
207
+ .tree__item:focus-within > .tree__actions {
170
208
  opacity: 1;
171
209
  }
172
210
 
@@ -174,6 +212,65 @@ wc-tree {
174
212
  opacity: 0.5;
175
213
  }
176
214
 
215
+ /* Focus now lands on `.tree__item` itself (the roving tabindex target), a
216
+ block box that — for an expanded branch — wraps its entire subtree. An
217
+ outline on it would ring every descendant, so it's suppressed there and
218
+ drawn on the ROW instead. */
219
+ .tree__item:focus {
220
+ outline: none;
221
+ }
222
+
223
+ /* `:focus-visible` alone under-covers a real case: script-moved focus only
224
+ matches `:focus-visible` if the PREVIOUSLY focused element did, so a
225
+ mouse click (which doesn't match) followed immediately by an arrow key
226
+ shows no ring at all in Chrome/Safari until the visitor tabs fully out
227
+ and back in. `[data-tree-keyboard]` is `<wc-tree>`'s own signal — set on
228
+ any handled navigation keydown, cleared on `pointerdown` — and covers
229
+ exactly that gap; `happy-dom` implements neither `:focus-visible` nor
230
+ layout, so this needs a manual browser check, not a unit test. */
231
+ .tree__item:focus-visible > .tree__summary,
232
+ .tree__item:focus-visible > .tree__content,
233
+ &[data-tree-keyboard] .tree__item:focus > .tree__summary,
234
+ &[data-tree-keyboard] .tree__item:focus > .tree__content {
235
+ outline: 2px solid var(--tree-focus-color, currentColor);
236
+ /* Inset, not the pattern's usual positive offset: the nested group below
237
+ clips its content (`overflow: clip`, next rule), so a positive offset
238
+ on the first or last row of an expanded subtree would be cut off by
239
+ its own ancestor. */
240
+ outline-offset: -2px;
241
+ }
242
+
243
+ /* Animated collapse — the enhanced-state replacement for `details.css`'s
244
+ `::details-content` transition, which no longer applies once `<details>`
245
+ is gone. Keyed on `[hidden]` itself, NOT on `[aria-expanded]`: the
246
+ browser's own find-in-page / fragment-navigation reveal removes `hidden`
247
+ directly or CSS anchored to a JS-set `aria-expanded` mirror would leave a
248
+ UA-revealed branch visually still collapsed until a `beforematch` handler
249
+ caught up (see WCTree.ts). Same idiom `details.css` verified working, and
250
+ the same warning applies: the tell of a regression is a branch that
251
+ doesn't open on the FIRST click, not a syntax error — check a real
252
+ interaction. */
253
+ .tree__item > .tree {
254
+ /* `clip` + a small margin, not `hidden`: an `overflow: hidden` group
255
+ would clip the focus ring (`outline-offset: -2px` above still needs a
256
+ few px of headroom) of its own first/last child row. */
257
+ overflow: clip;
258
+ overflow-clip-margin: 3px;
259
+
260
+ @media (prefers-reduced-motion: no-preference) {
261
+ block-size: auto;
262
+ transition:
263
+ block-size var(--animation-duration) var(--custom-ease-out),
264
+ content-visibility var(--animation-duration) allow-discrete;
265
+ }
266
+ }
267
+
268
+ @media (prefers-reduced-motion: no-preference) {
269
+ .tree__item > .tree[hidden] {
270
+ block-size: 0;
271
+ }
272
+ }
273
+
177
274
  &.tree--lines .tree__item {
178
275
  position: relative;
179
276
 
@@ -195,10 +292,16 @@ wc-tree {
195
292
 
196
293
  /* A node's own prose. `.tree__label` is `nowrap` + ellipsis for file-tree-style
197
294
  single-line names, so a description can't live in it — it sits below the
198
- summary row and wraps. Indented to the label, past the toggle. */
295
+ summary row and wraps. Indented to the label, past the toggle.
296
+
297
+ `margin-inline-end` is set here rather than left to come from an
298
+ ancestor: a BRANCH description used to get it incidentally from
299
+ `details.css`'s `<details>` margins (now gone — see the class docblock in
300
+ `WCTree.ts`), while a LEAF description, never inside a `<details>`, never
301
+ got one at all. Self-contained now, and consistent between the two. */
199
302
  .tree__desc {
200
303
  margin-block: 0.125rem 0.25rem;
201
- margin-inline-start: var(--_leaf-indent);
304
+ margin-inline: var(--_leaf-indent) 0.25rem;
202
305
  color: var(--color-text-surface-muted);
203
306
  text-wrap: pretty;
204
307
  }
@@ -284,3 +284,20 @@
284
284
  .relative {
285
285
  position: relative;
286
286
  }
287
+
288
+ /* ── Shape — the two geometric absolutes, Tailwind-named ──
289
+ Everything between "square" and "fully round" stays owned by the token
290
+ cascade (`patterns.radii`, group `br`, per-pattern `--br-<name>`) — these two
291
+ are the only radii with no design-token meaning of their own, which is why
292
+ they're utilities and not tokens. No responsive (`md-rounded-full`) variants:
293
+ a responsive radius is rare enough that Tailwind's own `@md:rounded-full`
294
+ covers it on that side.
295
+
296
+ Names + values are Tailwind-exact; Tailwind ships them natively, so they are
297
+ in TW_CLASH and the tailwind format drops these copies. */
298
+ .rounded-none {
299
+ border-radius: 0;
300
+ }
301
+ .rounded-full {
302
+ border-radius: 999px;
303
+ }