actual-css 0.4.0 → 0.4.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +84 -35
  2. package/dist/actual.css +1 -20
  3. package/dist/actual.full.css +692 -221
  4. package/dist/actual.full.js +1 -1
  5. package/dist/actual.full.min.css +1 -1
  6. package/dist/actual.min.css +1 -1
  7. package/docs/design-notes/app-ui.md +33 -0
  8. package/docs/design-notes/enhancement-contract.md +25 -0
  9. package/docs/design-notes/grid.md +177 -4
  10. package/docs/design-notes/references.md +1 -1
  11. package/docs/navigation.json +7 -1
  12. package/docs/pages/components/alert.md +5 -0
  13. package/docs/pages/components/app-navigation.md +34 -0
  14. package/docs/pages/components/avatar.md +10 -0
  15. package/docs/pages/components/badge.md +2 -0
  16. package/docs/pages/components/button.md +30 -0
  17. package/docs/pages/components/card.md +5 -1
  18. package/docs/pages/components/fab.md +2 -0
  19. package/docs/pages/components/indicator.md +52 -0
  20. package/docs/pages/components/list.md +62 -0
  21. package/docs/pages/components/navbar.md +6 -0
  22. package/docs/pages/components/rating.md +68 -0
  23. package/docs/pages/components/steps.md +57 -0
  24. package/docs/pages/enhancements/flyout.md +2 -2
  25. package/docs/pages/enhancements/tabs.md +1 -2
  26. package/docs/pages/examples/overview.md +8 -0
  27. package/docs/pages/forms/otp.md +32 -0
  28. package/docs/pages/forms/states-and-sizes.md +3 -3
  29. package/docs/pages/guides/integrating-actual-css.md +6 -0
  30. package/docs/pages/layout/app-layout.md +57 -0
  31. package/docs/pages/layout/app-shell.md +28 -7
  32. package/docs/pages/layout/center.md +12 -1
  33. package/docs/pages/layout/choosing.md +15 -0
  34. package/docs/pages/layout/grid.md +41 -8
  35. package/docs/pages/layout/sidebar-layout.md +19 -0
  36. package/docs/pages/layout/stack.md +17 -0
  37. package/docs/pages/patterns/icon-slot.md +61 -0
  38. package/docs/pages/patterns/structured-lists.md +38 -40
  39. package/package.json +3 -2
  40. package/scripts/reserved-classes.json +17 -0
  41. package/src/css/components/actions.css +1 -0
  42. package/src/css/components/app-nav.css +76 -0
  43. package/src/css/components/avatar.css +4 -0
  44. package/src/css/components/badge.css +1 -13
  45. package/src/css/components/breadcrumb.css +1 -0
  46. package/src/css/components/button.css +8 -38
  47. package/src/css/components/card.css +11 -11
  48. package/src/css/components/chat.css +0 -6
  49. package/src/css/components/drawer.css +0 -6
  50. package/src/css/components/fab.css +1 -7
  51. package/src/css/components/index.css +5 -0
  52. package/src/css/components/indicator.css +47 -0
  53. package/src/css/components/list.css +83 -0
  54. package/src/css/components/menu.css +0 -7
  55. package/src/css/components/modal.css +0 -17
  56. package/src/css/components/navbar.css +8 -15
  57. package/src/css/components/pagination.css +1 -0
  58. package/src/css/components/rating.css +101 -0
  59. package/src/css/components/steps.css +123 -0
  60. package/src/css/components/tab.css +21 -22
  61. package/src/css/components/tooltip.css +1 -10
  62. package/src/css/core/focus.css +0 -8
  63. package/src/css/core/theme.css +0 -10
  64. package/src/css/core/tokens.css +1 -2
  65. package/src/css/effects/aura.css +1 -10
  66. package/src/css/forms/choice-card.css +6 -15
  67. package/src/css/forms/form-actions.css +1 -0
  68. package/src/css/forms/otp.css +7 -2
  69. package/src/css/forms/range.css +14 -4
  70. package/src/css/layout/app-layout.css +102 -0
  71. package/src/css/layout/app-shell.css +1 -1
  72. package/src/css/layout/center.css +1 -0
  73. package/src/css/layout/cluster.css +1 -0
  74. package/src/css/layout/container-query.css +6 -4
  75. package/src/css/layout/grid.css +25 -11
  76. package/src/css/layout/index.css +4 -2
  77. package/src/css/layout/scroll-snap.css +1 -0
  78. package/src/css/layout/sidebar-layout.css +23 -1
  79. package/src/css/layout/switcher.css +1 -0
  80. package/src/css/layout/topbar.css +1 -0
  81. package/src/css/typography/prose.css +4 -0
  82. package/src/js/tooltip.js +2 -1
  83. package/docs/pages/layout/list.md +0 -41
@@ -1,7 +1,9 @@
1
- /* Local container-query opt-in: establishes an inline-size query context for
1
+ /* Convenience helper: establishes a query container named actual-grid for
2
2
  descendants. Use it for a component that changes representation according
3
- to its allocated inline size, and to opt .grid-N into balanced subdivision
4
- (see grid.css). Layout primitives are responsive without it — this adds
3
+ to its allocated inline size, and to give .grid-N the named context it needs
4
+ for balanced subdivision (see grid.css). The name matters: grids only respond
5
+ to an explicitly actual-grid-named container, never to an incidental
6
+ query container. Layout primitives are responsive without it; this adds
5
7
  precision, it is never a prerequisite.
6
8
 
7
9
  The element takes inline-size containment, so put it on a normal
@@ -9,5 +11,5 @@
9
11
  float, an inline-block): its contents would stop contributing to its own
10
12
  inline size and it would collapse. */
11
13
  .container-query {
12
- container-type: inline-size;
14
+ container: actual-grid / inline-size;
13
15
  }
@@ -24,7 +24,8 @@
24
24
  /* Recipe:
25
25
  - collection whose item width is the contract -> .grid, tune --grid-min
26
26
  - collection whose column density is the contract -> .grid-2/3/4/6
27
- - balanced subdivision of that density -> wrap it in .container-query
27
+ - balanced subdivision of that density -> place it inside any size query
28
+ container (.container-query is the convenience helper for that context)
28
29
  - peer regions that switch as a group -> .switcher
29
30
  - content + aside -> .sidebar-layout
30
31
  - exact custom track templates -> --grid-columns with an explicit collapse
@@ -85,7 +86,13 @@
85
86
  min-inline-size: 0;
86
87
  }
87
88
 
88
- /* Balanced subdivision, opted into by an ancestor query container.
89
+ /* Balanced subdivision, activated by an ancestor container named actual-grid.
90
+ * A .grid-N inside such a container enters only divisor states of N. The name
91
+ * is deliberate: a grid must not key off the nearest anonymous query container,
92
+ * or a region that sets container-type: inline-size for an unrelated reason
93
+ * would silently change the grid. The author opts the grid in by naming the
94
+ * context — .container-query is the official helper, or declare
95
+ * container: actual-grid / inline-size on your own region.
89
96
  *
90
97
  * .grid-2 2 -> 1
91
98
  * .grid-3 3 -> 1
@@ -102,6 +109,11 @@
102
109
  * inline contribution and collapses it inside .cluster, .topbar, floats, and
103
110
  * any shrink-to-fit box. See docs/design-notes/grid.md.
104
111
  *
112
+ * Without an actual-grid ancestor none of these @container rules resolve, so
113
+ * the auto-fill baseline above stays. The min-width: 0 rule is the lowest
114
+ * step: it pins the grid to one column inside a container before any larger
115
+ * threshold fires (a bare grid would otherwise show a 2 + 1 orphan at 28-48rem).
116
+ *
105
117
  * Three shared thresholds, not one calibrated per preset: 28rem opens the
106
118
  * first horizontal density, 48rem opens three columns, 64rem opens the dense
107
119
  * 4 and 6. N already carries the author's statement about item size, so
@@ -113,28 +125,30 @@
113
125
  * Ascending min-width only: the last matching step wins by cascade order.
114
126
  */
115
127
  @supports (container-type: inline-size) {
116
- .container-query :where(.grid-2, .grid-3, .grid-4, .grid-6) {
117
- grid-template-columns: 1fr;
128
+ @container actual-grid (min-width: 0px) {
129
+ :where(.grid-2, .grid-3, .grid-4, .grid-6) {
130
+ grid-template-columns: 1fr;
131
+ }
118
132
  }
119
133
 
120
- @container (min-width: 28rem) {
121
- .container-query :where(.grid-2, .grid-4, .grid-6) {
134
+ @container actual-grid (min-width: 28rem) {
135
+ :where(.grid-2, .grid-4, .grid-6) {
122
136
  grid-template-columns: repeat(2, minmax(0, 1fr));
123
137
  }
124
138
  }
125
139
 
126
- @container (min-width: 48rem) {
127
- .container-query :where(.grid-3, .grid-6) {
140
+ @container actual-grid (min-width: 48rem) {
141
+ :where(.grid-3, .grid-6) {
128
142
  grid-template-columns: repeat(3, minmax(0, 1fr));
129
143
  }
130
144
  }
131
145
 
132
- @container (min-width: 64rem) {
133
- .container-query :where(.grid-4) {
146
+ @container actual-grid (min-width: 64rem) {
147
+ :where(.grid-4) {
134
148
  grid-template-columns: repeat(4, minmax(0, 1fr));
135
149
  }
136
150
 
137
- .container-query :where(.grid-6) {
151
+ :where(.grid-6) {
138
152
  grid-template-columns: repeat(6, minmax(0, 1fr));
139
153
  }
140
154
  }
@@ -8,12 +8,13 @@
8
8
  * .center centered content column
9
9
  * .frame fixed-ratio media frame
10
10
  * .app-shell full-height application shell
11
+ * .app-layout topbar + scrolling main + bottom/side app navigation
11
12
  * .media fixed media + flexible content
12
13
  * .switcher peer regions: all horizontal or all stacked
13
14
  * .sidebar-layout main content + secondary aside
14
15
  * .grid responsive collection; item width is the contract
15
- * .grid-N structural density of N; wrap in .container-query for
16
- * balanced subdivision (in grid.css)
16
+ * .grid-N structural density of N; balanced inside a container named
17
+ * actual-grid (in grid.css)
17
18
  * .column-layout explicit 12-column region composition; the author owns
18
19
  * narrow-container recomposition
19
20
  * .scroller theme-aware scrollbar density and colour
@@ -30,6 +31,7 @@
30
31
  @import "./center.css";
31
32
  @import "./frame.css";
32
33
  @import "./app-shell.css";
34
+ @import "./app-layout.css";
33
35
  @import "./media.css";
34
36
  @import "./switcher.css";
35
37
  @import "./sidebar-layout.css";
@@ -18,6 +18,7 @@
18
18
  --scroll-snap-item-size: auto;
19
19
 
20
20
  display: flex;
21
+ flex-direction: row;
21
22
  gap: var(--scroll-snap-gap);
22
23
  overflow-x: auto;
23
24
  }
@@ -10,22 +10,44 @@
10
10
  * --sidebar-content-min
11
11
  * --sidebar-layout-size
12
12
  *
13
- * Child contract: the first and last direct children carry the sizing roles.
13
+ * Child contract: the main region is first and the aside second by default
14
+ * (aside on the inline end). .reverse expects the aside first in the DOM, so
15
+ * visual, reading and keyboard order all agree — the role rules swap so the
16
+ * aside still takes its preferred width and the main still reclaims the row.
14
17
  */
15
18
  .sidebar-layout {
16
19
  display: flex;
20
+ flex-direction: row;
17
21
  flex-wrap: wrap;
18
22
  gap: var(--gap);
19
23
  align-items: flex-start;
20
24
  }
21
25
 
26
+ /* Main region — flexible, reclaims the full row when the aside wraps. */
22
27
  .sidebar-layout > :first-child {
23
28
  flex-basis: 0;
24
29
  flex-grow: 999;
25
30
  min-inline-size: min(100%, var(--sidebar-content-min, 30rem));
26
31
  }
27
32
 
33
+ /* Aside region — preferred width, never forces content min-width. */
28
34
  .sidebar-layout > :last-child {
29
35
  flex-basis: var(--sidebar-layout-size, 18rem);
30
36
  flex-grow: 1;
37
+ min-inline-size: 0;
38
+ }
39
+
40
+ /* .reverse: the aside is first in the DOM and the main last, so each role
41
+ rule above would hit the wrong element. Swap the sizing per child; the
42
+ higher-specificity reverse rules outrank the positional defaults. */
43
+ .sidebar-layout.reverse > :last-child {
44
+ flex-basis: 0;
45
+ flex-grow: 999;
46
+ min-inline-size: min(100%, var(--sidebar-content-min, 30rem));
47
+ }
48
+
49
+ .sidebar-layout.reverse > :first-child {
50
+ flex-basis: var(--sidebar-layout-size, 18rem);
51
+ flex-grow: 1;
52
+ min-inline-size: 0;
31
53
  }
@@ -12,6 +12,7 @@
12
12
  */
13
13
  .switcher {
14
14
  display: flex;
15
+ flex-direction: row;
15
16
  flex-wrap: wrap;
16
17
  gap: var(--gap);
17
18
  }
@@ -15,6 +15,7 @@
15
15
  z-index: var(--z-sticky);
16
16
  isolation: isolate;
17
17
  display: flex;
18
+ flex-direction: row;
18
19
  align-items: center;
19
20
  gap: var(--gap);
20
21
  padding-block: var(--space-30);
@@ -38,6 +38,10 @@
38
38
  /* Vertical rhythm belongs to the direct block that participates in the
39
39
  document, so it must not be injected into the internals of a nested
40
40
  component (e.g. a .table-wrap around a .table would trap the margin). */
41
+ .prose > * {
42
+ margin-block-end: 0;
43
+ }
44
+
41
45
  .prose > * + * {
42
46
  margin-block-start: var(--prose-flow);
43
47
  }
package/src/js/tooltip.js CHANGED
@@ -358,7 +358,8 @@ function ensureTip(trigger) {
358
358
  }
359
359
 
360
360
  function cleanupTrigger(trigger) {
361
- if (trigger.isConnected) return;
361
+ // The enhancement runtime owns the root-membership decision; a trigger may
362
+ // still be connected after moving beyond that lifecycle boundary.
362
363
  triggerStates.get(trigger)?.cleanup?.();
363
364
  }
364
365
 
@@ -1,41 +0,0 @@
1
- # List
2
-
3
- Lists stay native by default. Compose visual list rows from existing primitives.
4
-
5
- Use `.list-reset` only when markers are not part of the content. Combine `.stack`, `.media`, `.cluster`, spacing helpers, and local styles for application-style rows.
6
-
7
- ```html demo
8
- <figure class="stack">
9
- <figcaption><strong>Most played songs this week</strong></figcaption>
10
-
11
- <ul class="list-reset stack gap-none">
12
- <li class="media items-center py" style="border-block-end: var(--border-width) solid var(--border)">
13
- <div class="avatar">
14
- <img src="https://i.pravatar.cc/48?img=5" alt="Dio Lupa" />
15
- </div>
16
- <div class="cluster">
17
- <div class="stack grow" style="--gap: var(--space-10)">
18
- <strong>Dio Lupa</strong>
19
- <span class="muted">Remaining Reason</span>
20
- </div>
21
- <span class="muted">3:45</span>
22
- </div>
23
- </li>
24
-
25
- <li class="media items-center py" style="border-block-end: var(--border-width) solid var(--border)">
26
- <div class="avatar">
27
- <img src="https://i.pravatar.cc/48?img=10" alt="Astral Planes" />
28
- </div>
29
- <div class="cluster">
30
- <div class="stack grow" style="--gap: var(--space-10)">
31
- <strong>Astral Planes</strong>
32
- <span class="muted">Neon Drift</span>
33
- </div>
34
- <span class="muted">4:12</span>
35
- </div>
36
- </li>
37
- </ul>
38
- </figure>
39
- ```
40
-
41
- Keep semantic lists unstyled when the markers carry meaning.