@filipgutica/design-system 1.0.44 → 1.0.45

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.
@@ -45,7 +45,6 @@ html { scroll-padding-top: var(--space-4); }
45
45
  .rail-summary { list-style: none; width: max-content; max-width: 100%; border-radius: var(--radius-field); }
46
46
  .rail-summary::-webkit-details-marker { display: none; }
47
47
  .rail-summary::after { content: ""; width: 6px; height: 6px; margin-left: var(--space-1); border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
48
- details.rail-details[open] > .navlist { margin-top: var(--space-2); }
49
48
  /* Drawer: components.html#drawer, unchanged. A closed dialog stays hidden under the recipe's display. */
50
49
  dialog:not([open]) { display: none; }
51
50
  .drawer { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(calc(var(--sidebar-width) + var(--space-12)), 100%); height: 260px; overflow: hidden; padding: 0; border: 1px solid transparent; background: var(--color-surface-raised); color: var(--color-text); box-shadow: var(--shadow-dialog); }
@@ -91,7 +90,8 @@ main { grid-area: main; min-width: 0; display: grid; gap: var(--space-12); paddi
91
90
  .contents .navlist { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.125rem; }
92
91
  /* The heading sits outside the scrolling rows, so it stays put while they scroll. */
93
92
  .contents-list > .group-label { flex: none; margin: 0; padding: 0 var(--space-3) var(--space-1); color: var(--color-muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
94
- /* Beside the column every list shows, so the summaries hide and each list stays open without the script. */
93
+ /* Beside the column every list shows, so the summaries hide and each list stays open without the script,
94
+ except in WebKit, which shows no closed disclosure's rows; there the script opens them. */
95
95
  :is(.pages, .contents) .rail-summary { display: none; }
96
96
  :is(.pages, .contents) > details::details-content { content-visibility: visible; }
97
97
  .pages > details:not([open]) > .navlist { display: grid; }
@@ -124,6 +124,7 @@ footer { padding-block: var(--space-6); border-top: 1px solid var(--color-border
124
124
  .pages .rail-summary { display: inline-flex; }
125
125
  .pages > details::details-content { content-visibility: revert; }
126
126
  .pages > details:not([open]) > .navlist { display: none; }
127
+ .pages > details[open] > .navlist { margin-top: var(--space-2); }
127
128
  .contents { padding-block: var(--space-3) 0; }
128
129
  .docs > main { padding-top: var(--space-6); }
129
130
  [data-enhanced] .pages, [data-enhanced] .contents { display: none; }
@@ -249,6 +250,16 @@ const place = () => {
249
250
  root.dataset.enhanced = '';
250
251
  phone.addEventListener('change', place);
251
252
  place();
253
+ // Beside the column a list is open. CSS decides where: there it hides the list's summary. WebKit shows no
254
+ // closed disclosure's rows whatever the CSS, so the script opens the list, and closes it again when the
255
+ // frame narrows. It changes a list only when that changes, so a reader's own choice stays until then.
256
+ // Opening or closing a list resizes the observed frame, so it waits a frame to avoid a resize loop.
257
+ const besideColumn = new Map();
258
+ new ResizeObserver(() => requestAnimationFrame(() => document.querySelectorAll('.rail-details').forEach((details) => {
259
+ const beside = getComputedStyle(details.querySelector('summary')).display === 'none';
260
+ if (besideColumn.get(details) !== beside) details.open = beside;
261
+ besideColumn.set(details, beside);
262
+ }))).observe(document.querySelector('.layout'));
252
263
  // The drawer opens with the current section in view. A tap puts focus on its body, so no ring shows; a keyboard
253
264
  // open focuses the current section, where the ring shows the reader's place.
254
265
  trigger.addEventListener('click', (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filipgutica/design-system",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "Filip's design language, tokens, and component catalogue for any framework",
5
5
  "type": "module",
6
6
  "sideEffects": [