contain-css-svelte 1.2.3 → 1.4.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.
Files changed (50) hide show
  1. package/dist/Card.svelte +216 -288
  2. package/dist/controls/Button.svelte +39 -1
  3. package/dist/controls/ButtonLink.svelte +39 -1
  4. package/dist/controls/Checkbox.svelte +38 -0
  5. package/dist/controls/CircleButton.svelte +39 -1
  6. package/dist/controls/Input.svelte +39 -1
  7. package/dist/controls/RadioButton.svelte +38 -0
  8. package/dist/controls/Select.svelte +38 -0
  9. package/dist/controls/Slider.svelte +39 -1
  10. package/dist/controls/TabItem.svelte +39 -1
  11. package/dist/controls/Toggle.svelte +39 -1
  12. package/dist/dropdowns/DropdownMenu.svelte +39 -1
  13. package/dist/index.d.ts +2 -1
  14. package/dist/index.js +2 -1
  15. package/dist/layout/Accordion.svelte +39 -1
  16. package/dist/layout/Bar.svelte +49 -1
  17. package/dist/layout/ColumnContainer.svelte +39 -1
  18. package/dist/layout/Columns.svelte +39 -1
  19. package/dist/layout/Container.svelte +217 -292
  20. package/dist/layout/DataList.svelte +39 -1
  21. package/dist/layout/DataListItem.svelte +217 -292
  22. package/dist/layout/Fieldset.svelte +39 -1
  23. package/dist/layout/Form.svelte +217 -292
  24. package/dist/layout/FormItem.svelte +39 -1
  25. package/dist/layout/GridLayout.svelte +38 -0
  26. package/dist/layout/Hero.svelte +217 -292
  27. package/dist/layout/Inline.svelte +45 -1
  28. package/dist/layout/MenuList.svelte +39 -1
  29. package/dist/layout/Page.svelte +44 -2
  30. package/dist/layout/RowContainer.svelte +39 -1
  31. package/dist/layout/Sidebar.svelte +757 -65
  32. package/dist/layout/Sidebar.svelte.d.ts +58 -1
  33. package/dist/layout/SidebarContainer.svelte +198 -0
  34. package/dist/layout/SidebarContainer.svelte.d.ts +20 -0
  35. package/dist/layout/SplitPane.svelte +39 -1
  36. package/dist/layout/Stack.svelte +45 -1
  37. package/dist/layout/TabBar.svelte +39 -1
  38. package/dist/layout/Table.svelte +469 -443
  39. package/dist/layout/Tile.svelte +216 -291
  40. package/dist/misc/CodeInner.svelte +39 -1
  41. package/dist/misc/Progress.svelte +217 -292
  42. package/dist/misc/Tag.svelte +39 -1
  43. package/dist/overlays/Dialog.svelte +217 -292
  44. package/dist/overlays/Tooltip.svelte +267 -349
  45. package/dist/sass/_responsive.scss +15 -0
  46. package/dist/sass/_typography.scss +203 -191
  47. package/dist/typography/TextLayout.svelte +494 -292
  48. package/dist/vars/defaults.css +258 -0
  49. package/dist/vars/typography-context.css +271 -0
  50. package/package.json +1 -1
@@ -36,7 +36,33 @@ const el = $derived(elementProps(restProps, "button", [
36
36
  {/if}
37
37
  </button>
38
38
 
39
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
39
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
40
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
41
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
42
+ an actual heading element anymore -- see typography-context.css (vars/), which
43
+ is the single, global, :where()-scoped rule that actually reads these vars
44
+ and applies them to real elements. That split is what lets a component
45
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
46
+ nearest ancestor's heading styling: these are ordinary inherited custom
47
+ properties, so DOM proximity decides which component's values apply, not
48
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
49
+ /* All six heading levels' context vars in one call -- what every
50
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
51
+ includes on itself once, alongside the shared --_heading-* vars below. */
52
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
53
+ their own vars -- they're never wider than their ul/ol/dl parent's own
54
+ max-width box, so they're already bounded for free by ordinary block
55
+ layout, not by anything selector-based reaching them individually. */
56
+ /* p specifically also gets the fuller typography-props-bare treatment
57
+ (paragraph-prefixed), which -- same as in the original selector-based
58
+ version -- is declared/consumed AFTER the shared prose vars above, so it
59
+ wins for whichever properties both groups set. */
60
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
61
+ after a heading) gets its own, slightly different treatment -- larger lede
62
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
63
+ has to happen where the real element is, in the global consumer rule; only
64
+ the VALUES move to context vars here. */
65
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
40
66
  one value (both sides equal) or two (start end), so there is no separate
41
67
  "which side" prop to remember and no 4-value shorthand order to get wrong.
42
68
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -44,6 +70,18 @@ const el = $derived(elementProps(restProps, "button", [
44
70
  day this mixin got added to a new component. Callers opt in with an actual
45
71
  value. (Container does not use this mixin: it wants --gap/auto as its
46
72
  defaults, which do not fit the "0 unless asked" contract here.) */
73
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
74
+ affordance -- a floating button that opens a panel over the content.
75
+
76
+ Page has to agree with Sidebar about this, because Page is what floats the
77
+ aside out of flow and reserves the strip of padding the sheet button sits
78
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
79
+ which left a band between 513 and 600 where Page had already lifted the
80
+ aside out of the layout while the Sidebar inside it was still showing a
81
+ rail -- a grab bar floating on top of the content, which is the affordance
82
+ we deliberately avoid everywhere else.
83
+
84
+ One definition, used by both, so they cannot drift again. */
47
85
  /* Warning: because we define a fallback
48
86
  media query, the media query can override the container
49
87
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -38,7 +38,33 @@ const iconSlotted = $derived(Boolean(icon));
38
38
  </span>
39
39
  </a>
40
40
 
41
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
41
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
42
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
43
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
44
+ an actual heading element anymore -- see typography-context.css (vars/), which
45
+ is the single, global, :where()-scoped rule that actually reads these vars
46
+ and applies them to real elements. That split is what lets a component
47
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
48
+ nearest ancestor's heading styling: these are ordinary inherited custom
49
+ properties, so DOM proximity decides which component's values apply, not
50
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
51
+ /* All six heading levels' context vars in one call -- what every
52
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
53
+ includes on itself once, alongside the shared --_heading-* vars below. */
54
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
55
+ their own vars -- they're never wider than their ul/ol/dl parent's own
56
+ max-width box, so they're already bounded for free by ordinary block
57
+ layout, not by anything selector-based reaching them individually. */
58
+ /* p specifically also gets the fuller typography-props-bare treatment
59
+ (paragraph-prefixed), which -- same as in the original selector-based
60
+ version -- is declared/consumed AFTER the shared prose vars above, so it
61
+ wins for whichever properties both groups set. */
62
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
63
+ after a heading) gets its own, slightly different treatment -- larger lede
64
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
65
+ has to happen where the real element is, in the global consumer rule; only
66
+ the VALUES move to context vars here. */
67
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
42
68
  one value (both sides equal) or two (start end), so there is no separate
43
69
  "which side" prop to remember and no 4-value shorthand order to get wrong.
44
70
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -46,6 +72,18 @@ const iconSlotted = $derived(Boolean(icon));
46
72
  day this mixin got added to a new component. Callers opt in with an actual
47
73
  value. (Container does not use this mixin: it wants --gap/auto as its
48
74
  defaults, which do not fit the "0 unless asked" contract here.) */
75
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
76
+ affordance -- a floating button that opens a panel over the content.
77
+
78
+ Page has to agree with Sidebar about this, because Page is what floats the
79
+ aside out of flow and reserves the strip of padding the sheet button sits
80
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
81
+ which left a band between 513 and 600 where Page had already lifted the
82
+ aside out of the layout while the Sidebar inside it was still showing a
83
+ rail -- a grab bar floating on top of the content, which is the affordance
84
+ we deliberately avoid everywhere else.
85
+
86
+ One definition, used by both, so they cannot drift again. */
49
87
  /* Warning: because we define a fallback
50
88
  media query, the media query can override the container
51
89
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -64,6 +64,32 @@ let ref = $state(null);
64
64
  </div>
65
65
 
66
66
  <style>@charset "UTF-8";
67
+ /* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
68
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
69
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
70
+ an actual heading element anymore -- see typography-context.css (vars/), which
71
+ is the single, global, :where()-scoped rule that actually reads these vars
72
+ and applies them to real elements. That split is what lets a component
73
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
74
+ nearest ancestor's heading styling: these are ordinary inherited custom
75
+ properties, so DOM proximity decides which component's values apply, not
76
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
77
+ /* All six heading levels' context vars in one call -- what every
78
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
79
+ includes on itself once, alongside the shared --_heading-* vars below. */
80
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
81
+ their own vars -- they're never wider than their ul/ol/dl parent's own
82
+ max-width box, so they're already bounded for free by ordinary block
83
+ layout, not by anything selector-based reaching them individually. */
84
+ /* p specifically also gets the fuller typography-props-bare treatment
85
+ (paragraph-prefixed), which -- same as in the original selector-based
86
+ version -- is declared/consumed AFTER the shared prose vars above, so it
87
+ wins for whichever properties both groups set. */
88
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
89
+ after a heading) gets its own, slightly different treatment -- larger lede
90
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
91
+ has to happen where the real element is, in the global consumer rule; only
92
+ the VALUES move to context vars here. */
67
93
  /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
68
94
  one value (both sides equal) or two (start end), so there is no separate
69
95
  "which side" prop to remember and no 4-value shorthand order to get wrong.
@@ -72,6 +98,18 @@ let ref = $state(null);
72
98
  day this mixin got added to a new component. Callers opt in with an actual
73
99
  value. (Container does not use this mixin: it wants --gap/auto as its
74
100
  defaults, which do not fit the "0 unless asked" contract here.) */
101
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
102
+ affordance -- a floating button that opens a panel over the content.
103
+
104
+ Page has to agree with Sidebar about this, because Page is what floats the
105
+ aside out of flow and reserves the strip of padding the sheet button sits
106
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
107
+ which left a band between 513 and 600 where Page had already lifted the
108
+ aside out of the layout while the Sidebar inside it was still showing a
109
+ rail -- a grab bar floating on top of the content, which is the affordance
110
+ we deliberately avoid everywhere else.
111
+
112
+ One definition, used by both, so they cannot drift again. */
75
113
  /* Warning: because we define a fallback
76
114
  media query, the media query can override the container
77
115
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -29,7 +29,33 @@ const el = $derived(elementProps(restProps, "circle-button", [
29
29
  {@render children?.()}
30
30
  </button>
31
31
 
32
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
32
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
33
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
34
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
35
+ an actual heading element anymore -- see typography-context.css (vars/), which
36
+ is the single, global, :where()-scoped rule that actually reads these vars
37
+ and applies them to real elements. That split is what lets a component
38
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
39
+ nearest ancestor's heading styling: these are ordinary inherited custom
40
+ properties, so DOM proximity decides which component's values apply, not
41
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
42
+ /* All six heading levels' context vars in one call -- what every
43
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
44
+ includes on itself once, alongside the shared --_heading-* vars below. */
45
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
46
+ their own vars -- they're never wider than their ul/ol/dl parent's own
47
+ max-width box, so they're already bounded for free by ordinary block
48
+ layout, not by anything selector-based reaching them individually. */
49
+ /* p specifically also gets the fuller typography-props-bare treatment
50
+ (paragraph-prefixed), which -- same as in the original selector-based
51
+ version -- is declared/consumed AFTER the shared prose vars above, so it
52
+ wins for whichever properties both groups set. */
53
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
54
+ after a heading) gets its own, slightly different treatment -- larger lede
55
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
56
+ has to happen where the real element is, in the global consumer rule; only
57
+ the VALUES move to context vars here. */
58
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
33
59
  one value (both sides equal) or two (start end), so there is no separate
34
60
  "which side" prop to remember and no 4-value shorthand order to get wrong.
35
61
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -37,6 +63,18 @@ const el = $derived(elementProps(restProps, "circle-button", [
37
63
  day this mixin got added to a new component. Callers opt in with an actual
38
64
  value. (Container does not use this mixin: it wants --gap/auto as its
39
65
  defaults, which do not fit the "0 unless asked" contract here.) */
66
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
67
+ affordance -- a floating button that opens a panel over the content.
68
+
69
+ Page has to agree with Sidebar about this, because Page is what floats the
70
+ aside out of flow and reserves the strip of padding the sheet button sits
71
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
72
+ which left a band between 513 and 600 where Page had already lifted the
73
+ aside out of the layout while the Sidebar inside it was still showing a
74
+ rail -- a grab bar floating on top of the content, which is the affordance
75
+ we deliberately avoid everywhere else.
76
+
77
+ One definition, used by both, so they cannot drift again. */
40
78
  /* Warning: because we define a fallback
41
79
  media query, the media query can override the container
42
80
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -15,7 +15,33 @@ const el = $derived(elementProps(restProps, "input", INPUT_VARS));
15
15
 
16
16
  <input bind:value {placeholder} class={className} {...el} />
17
17
 
18
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
18
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
19
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
20
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
21
+ an actual heading element anymore -- see typography-context.css (vars/), which
22
+ is the single, global, :where()-scoped rule that actually reads these vars
23
+ and applies them to real elements. That split is what lets a component
24
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
25
+ nearest ancestor's heading styling: these are ordinary inherited custom
26
+ properties, so DOM proximity decides which component's values apply, not
27
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
28
+ /* All six heading levels' context vars in one call -- what every
29
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
30
+ includes on itself once, alongside the shared --_heading-* vars below. */
31
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
32
+ their own vars -- they're never wider than their ul/ol/dl parent's own
33
+ max-width box, so they're already bounded for free by ordinary block
34
+ layout, not by anything selector-based reaching them individually. */
35
+ /* p specifically also gets the fuller typography-props-bare treatment
36
+ (paragraph-prefixed), which -- same as in the original selector-based
37
+ version -- is declared/consumed AFTER the shared prose vars above, so it
38
+ wins for whichever properties both groups set. */
39
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
40
+ after a heading) gets its own, slightly different treatment -- larger lede
41
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
42
+ has to happen where the real element is, in the global consumer rule; only
43
+ the VALUES move to context vars here. */
44
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
19
45
  one value (both sides equal) or two (start end), so there is no separate
20
46
  "which side" prop to remember and no 4-value shorthand order to get wrong.
21
47
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -23,6 +49,18 @@ const el = $derived(elementProps(restProps, "input", INPUT_VARS));
23
49
  day this mixin got added to a new component. Callers opt in with an actual
24
50
  value. (Container does not use this mixin: it wants --gap/auto as its
25
51
  defaults, which do not fit the "0 unless asked" contract here.) */
52
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
53
+ affordance -- a floating button that opens a panel over the content.
54
+
55
+ Page has to agree with Sidebar about this, because Page is what floats the
56
+ aside out of flow and reserves the strip of padding the sheet button sits
57
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
58
+ which left a band between 513 and 600 where Page had already lifted the
59
+ aside out of the layout while the Sidebar inside it was still showing a
60
+ rail -- a grab bar floating on top of the content, which is the affordance
61
+ we deliberately avoid everywhere else.
62
+
63
+ One definition, used by both, so they cannot drift again. */
26
64
  /* Warning: because we define a fallback
27
65
  media query, the media query can override the container
28
66
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -42,6 +42,32 @@ function handleChange() {
42
42
  </div>
43
43
 
44
44
  <style>@charset "UTF-8";
45
+ /* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
46
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
47
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
48
+ an actual heading element anymore -- see typography-context.css (vars/), which
49
+ is the single, global, :where()-scoped rule that actually reads these vars
50
+ and applies them to real elements. That split is what lets a component
51
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
52
+ nearest ancestor's heading styling: these are ordinary inherited custom
53
+ properties, so DOM proximity decides which component's values apply, not
54
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
55
+ /* All six heading levels' context vars in one call -- what every
56
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
57
+ includes on itself once, alongside the shared --_heading-* vars below. */
58
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
59
+ their own vars -- they're never wider than their ul/ol/dl parent's own
60
+ max-width box, so they're already bounded for free by ordinary block
61
+ layout, not by anything selector-based reaching them individually. */
62
+ /* p specifically also gets the fuller typography-props-bare treatment
63
+ (paragraph-prefixed), which -- same as in the original selector-based
64
+ version -- is declared/consumed AFTER the shared prose vars above, so it
65
+ wins for whichever properties both groups set. */
66
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
67
+ after a heading) gets its own, slightly different treatment -- larger lede
68
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
69
+ has to happen where the real element is, in the global consumer rule; only
70
+ the VALUES move to context vars here. */
45
71
  /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
46
72
  one value (both sides equal) or two (start end), so there is no separate
47
73
  "which side" prop to remember and no 4-value shorthand order to get wrong.
@@ -50,6 +76,18 @@ function handleChange() {
50
76
  day this mixin got added to a new component. Callers opt in with an actual
51
77
  value. (Container does not use this mixin: it wants --gap/auto as its
52
78
  defaults, which do not fit the "0 unless asked" contract here.) */
79
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
80
+ affordance -- a floating button that opens a panel over the content.
81
+
82
+ Page has to agree with Sidebar about this, because Page is what floats the
83
+ aside out of flow and reserves the strip of padding the sheet button sits
84
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
85
+ which left a band between 513 and 600 where Page had already lifted the
86
+ aside out of the layout while the Sidebar inside it was still showing a
87
+ rail -- a grab bar floating on top of the content, which is the affordance
88
+ we deliberately avoid everywhere else.
89
+
90
+ One definition, used by both, so they cannot drift again. */
53
91
  /* Warning: because we define a fallback
54
92
  media query, the media query can override the container
55
93
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -141,6 +141,32 @@ $effect(() => {
141
141
  </div>
142
142
 
143
143
  <style>@charset "UTF-8";
144
+ /* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
145
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
146
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
147
+ an actual heading element anymore -- see typography-context.css (vars/), which
148
+ is the single, global, :where()-scoped rule that actually reads these vars
149
+ and applies them to real elements. That split is what lets a component
150
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
151
+ nearest ancestor's heading styling: these are ordinary inherited custom
152
+ properties, so DOM proximity decides which component's values apply, not
153
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
154
+ /* All six heading levels' context vars in one call -- what every
155
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
156
+ includes on itself once, alongside the shared --_heading-* vars below. */
157
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
158
+ their own vars -- they're never wider than their ul/ol/dl parent's own
159
+ max-width box, so they're already bounded for free by ordinary block
160
+ layout, not by anything selector-based reaching them individually. */
161
+ /* p specifically also gets the fuller typography-props-bare treatment
162
+ (paragraph-prefixed), which -- same as in the original selector-based
163
+ version -- is declared/consumed AFTER the shared prose vars above, so it
164
+ wins for whichever properties both groups set. */
165
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
166
+ after a heading) gets its own, slightly different treatment -- larger lede
167
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
168
+ has to happen where the real element is, in the global consumer rule; only
169
+ the VALUES move to context vars here. */
144
170
  /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
145
171
  one value (both sides equal) or two (start end), so there is no separate
146
172
  "which side" prop to remember and no 4-value shorthand order to get wrong.
@@ -149,6 +175,18 @@ $effect(() => {
149
175
  day this mixin got added to a new component. Callers opt in with an actual
150
176
  value. (Container does not use this mixin: it wants --gap/auto as its
151
177
  defaults, which do not fit the "0 unless asked" contract here.) */
178
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
179
+ affordance -- a floating button that opens a panel over the content.
180
+
181
+ Page has to agree with Sidebar about this, because Page is what floats the
182
+ aside out of flow and reserves the strip of padding the sheet button sits
183
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
184
+ which left a band between 513 and 600 where Page had already lifted the
185
+ aside out of the layout while the Sidebar inside it was still showing a
186
+ rail -- a grab bar floating on top of the content, which is the affordance
187
+ we deliberately avoid everywhere else.
188
+
189
+ One definition, used by both, so they cannot drift again. */
152
190
  /* Warning: because we define a fallback
153
191
  media query, the media query can override the container
154
192
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -17,7 +17,33 @@ const el = $derived(elementProps(restProps, "slider", ["bg", "fg", "padding", "w
17
17
  {...el}
18
18
  />
19
19
 
20
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
20
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
21
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
22
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
23
+ an actual heading element anymore -- see typography-context.css (vars/), which
24
+ is the single, global, :where()-scoped rule that actually reads these vars
25
+ and applies them to real elements. That split is what lets a component
26
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
27
+ nearest ancestor's heading styling: these are ordinary inherited custom
28
+ properties, so DOM proximity decides which component's values apply, not
29
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
30
+ /* All six heading levels' context vars in one call -- what every
31
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
32
+ includes on itself once, alongside the shared --_heading-* vars below. */
33
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
34
+ their own vars -- they're never wider than their ul/ol/dl parent's own
35
+ max-width box, so they're already bounded for free by ordinary block
36
+ layout, not by anything selector-based reaching them individually. */
37
+ /* p specifically also gets the fuller typography-props-bare treatment
38
+ (paragraph-prefixed), which -- same as in the original selector-based
39
+ version -- is declared/consumed AFTER the shared prose vars above, so it
40
+ wins for whichever properties both groups set. */
41
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
42
+ after a heading) gets its own, slightly different treatment -- larger lede
43
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
44
+ has to happen where the real element is, in the global consumer rule; only
45
+ the VALUES move to context vars here. */
46
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
21
47
  one value (both sides equal) or two (start end), so there is no separate
22
48
  "which side" prop to remember and no 4-value shorthand order to get wrong.
23
49
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -25,6 +51,18 @@ const el = $derived(elementProps(restProps, "slider", ["bg", "fg", "padding", "w
25
51
  day this mixin got added to a new component. Callers opt in with an actual
26
52
  value. (Container does not use this mixin: it wants --gap/auto as its
27
53
  defaults, which do not fit the "0 unless asked" contract here.) */
54
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
55
+ affordance -- a floating button that opens a panel over the content.
56
+
57
+ Page has to agree with Sidebar about this, because Page is what floats the
58
+ aside out of flow and reserves the strip of padding the sheet button sits
59
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
60
+ which left a band between 513 and 600 where Page had already lifted the
61
+ aside out of the layout while the Sidebar inside it was still showing a
62
+ rail -- a grab bar floating on top of the content, which is the affordance
63
+ we deliberately avoid everywhere else.
64
+
65
+ One definition, used by both, so they cannot drift again. */
28
66
  /* Warning: because we define a fallback
29
67
  media query, the media query can override the container
30
68
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -29,7 +29,33 @@ const el = $derived(elementProps(restProps, "tab", [
29
29
  </Button>
30
30
  </div>
31
31
 
32
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
32
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
33
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
34
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
35
+ an actual heading element anymore -- see typography-context.css (vars/), which
36
+ is the single, global, :where()-scoped rule that actually reads these vars
37
+ and applies them to real elements. That split is what lets a component
38
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
39
+ nearest ancestor's heading styling: these are ordinary inherited custom
40
+ properties, so DOM proximity decides which component's values apply, not
41
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
42
+ /* All six heading levels' context vars in one call -- what every
43
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
44
+ includes on itself once, alongside the shared --_heading-* vars below. */
45
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
46
+ their own vars -- they're never wider than their ul/ol/dl parent's own
47
+ max-width box, so they're already bounded for free by ordinary block
48
+ layout, not by anything selector-based reaching them individually. */
49
+ /* p specifically also gets the fuller typography-props-bare treatment
50
+ (paragraph-prefixed), which -- same as in the original selector-based
51
+ version -- is declared/consumed AFTER the shared prose vars above, so it
52
+ wins for whichever properties both groups set. */
53
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
54
+ after a heading) gets its own, slightly different treatment -- larger lede
55
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
56
+ has to happen where the real element is, in the global consumer rule; only
57
+ the VALUES move to context vars here. */
58
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
33
59
  one value (both sides equal) or two (start end), so there is no separate
34
60
  "which side" prop to remember and no 4-value shorthand order to get wrong.
35
61
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -37,6 +63,18 @@ const el = $derived(elementProps(restProps, "tab", [
37
63
  day this mixin got added to a new component. Callers opt in with an actual
38
64
  value. (Container does not use this mixin: it wants --gap/auto as its
39
65
  defaults, which do not fit the "0 unless asked" contract here.) */
66
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
67
+ affordance -- a floating button that opens a panel over the content.
68
+
69
+ Page has to agree with Sidebar about this, because Page is what floats the
70
+ aside out of flow and reserves the strip of padding the sheet button sits
71
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
72
+ which left a band between 513 and 600 where Page had already lifted the
73
+ aside out of the layout while the Sidebar inside it was still showing a
74
+ rail -- a grab bar floating on top of the content, which is the affordance
75
+ we deliberately avoid everywhere else.
76
+
77
+ One definition, used by both, so they cannot drift again. */
40
78
  /* Warning: because we define a fallback
41
79
  media query, the media query can override the container
42
80
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -46,7 +46,33 @@ const effectiveOnLabel = $derived(onLabel || children);
46
46
  {/if}
47
47
  </label>
48
48
 
49
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
49
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
50
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
51
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
52
+ an actual heading element anymore -- see typography-context.css (vars/), which
53
+ is the single, global, :where()-scoped rule that actually reads these vars
54
+ and applies them to real elements. That split is what lets a component
55
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
56
+ nearest ancestor's heading styling: these are ordinary inherited custom
57
+ properties, so DOM proximity decides which component's values apply, not
58
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
59
+ /* All six heading levels' context vars in one call -- what every
60
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
61
+ includes on itself once, alongside the shared --_heading-* vars below. */
62
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
63
+ their own vars -- they're never wider than their ul/ol/dl parent's own
64
+ max-width box, so they're already bounded for free by ordinary block
65
+ layout, not by anything selector-based reaching them individually. */
66
+ /* p specifically also gets the fuller typography-props-bare treatment
67
+ (paragraph-prefixed), which -- same as in the original selector-based
68
+ version -- is declared/consumed AFTER the shared prose vars above, so it
69
+ wins for whichever properties both groups set. */
70
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
71
+ after a heading) gets its own, slightly different treatment -- larger lede
72
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
73
+ has to happen where the real element is, in the global consumer rule; only
74
+ the VALUES move to context vars here. */
75
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
50
76
  one value (both sides equal) or two (start end), so there is no separate
51
77
  "which side" prop to remember and no 4-value shorthand order to get wrong.
52
78
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -54,6 +80,18 @@ const effectiveOnLabel = $derived(onLabel || children);
54
80
  day this mixin got added to a new component. Callers opt in with an actual
55
81
  value. (Container does not use this mixin: it wants --gap/auto as its
56
82
  defaults, which do not fit the "0 unless asked" contract here.) */
83
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
84
+ affordance -- a floating button that opens a panel over the content.
85
+
86
+ Page has to agree with Sidebar about this, because Page is what floats the
87
+ aside out of flow and reserves the strip of padding the sheet button sits
88
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
89
+ which left a band between 513 and 600 where Page had already lifted the
90
+ aside out of the layout while the Sidebar inside it was still showing a
91
+ rail -- a grab bar floating on top of the content, which is the affordance
92
+ we deliberately avoid everywhere else.
93
+
94
+ One definition, used by both, so they cannot drift again. */
57
95
  /* Warning: because we define a fallback
58
96
  media query, the media query can override the container
59
97
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -287,7 +287,33 @@ let popoverDiv = $state();
287
287
  </div>
288
288
  </nav>
289
289
 
290
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
290
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
291
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
292
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
293
+ an actual heading element anymore -- see typography-context.css (vars/), which
294
+ is the single, global, :where()-scoped rule that actually reads these vars
295
+ and applies them to real elements. That split is what lets a component
296
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
297
+ nearest ancestor's heading styling: these are ordinary inherited custom
298
+ properties, so DOM proximity decides which component's values apply, not
299
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
300
+ /* All six heading levels' context vars in one call -- what every
301
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
302
+ includes on itself once, alongside the shared --_heading-* vars below. */
303
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
304
+ their own vars -- they're never wider than their ul/ol/dl parent's own
305
+ max-width box, so they're already bounded for free by ordinary block
306
+ layout, not by anything selector-based reaching them individually. */
307
+ /* p specifically also gets the fuller typography-props-bare treatment
308
+ (paragraph-prefixed), which -- same as in the original selector-based
309
+ version -- is declared/consumed AFTER the shared prose vars above, so it
310
+ wins for whichever properties both groups set. */
311
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
312
+ after a heading) gets its own, slightly different treatment -- larger lede
313
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
314
+ has to happen where the real element is, in the global consumer rule; only
315
+ the VALUES move to context vars here. */
316
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
291
317
  one value (both sides equal) or two (start end), so there is no separate
292
318
  "which side" prop to remember and no 4-value shorthand order to get wrong.
293
319
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -295,6 +321,18 @@ let popoverDiv = $state();
295
321
  day this mixin got added to a new component. Callers opt in with an actual
296
322
  value. (Container does not use this mixin: it wants --gap/auto as its
297
323
  defaults, which do not fit the "0 unless asked" contract here.) */
324
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
325
+ affordance -- a floating button that opens a panel over the content.
326
+
327
+ Page has to agree with Sidebar about this, because Page is what floats the
328
+ aside out of flow and reserves the strip of padding the sheet button sits
329
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
330
+ which left a band between 513 and 600 where Page had already lifted the
331
+ aside out of the layout while the Sidebar inside it was still showing a
332
+ rail -- a grab bar floating on top of the content, which is the affordance
333
+ we deliberately avoid everywhere else.
334
+
335
+ One definition, used by both, so they cannot drift again. */
298
336
  /* Warning: because we define a fallback
299
337
  media query, the media query can override the container
300
338
  if we stack a bunch of these in a row and aren't thoughtful about the order.
package/dist/index.d.ts CHANGED
@@ -39,6 +39,7 @@ import Tile from "./layout/Tile.svelte";
39
39
  import Code from "./misc/Code.svelte";
40
40
  import TextLayout from "./typography/TextLayout.svelte";
41
41
  import Sidebar from "./layout/Sidebar.svelte";
42
+ import SidebarContainer from "./layout/SidebarContainer.svelte";
42
43
  import Dialog from "./overlays/Dialog.svelte";
43
44
  import Progress from "./misc/Progress.svelte";
44
45
  import Tooltip from "./overlays/Tooltip.svelte";
@@ -55,7 +56,7 @@ export { Bar, ColumnContainer, Container, GridLayout, GridRow, Inline, MenuList,
55
56
  export { TextLayout, Code, Accordion };
56
57
  export { Card, Tile, Form, FormItem, FormProvider, Fieldset };
57
58
  export { DataList, DataListItem };
58
- export { Row, Column, Columns, SplitPane, Sidebar };
59
+ export { Row, Column, Columns, SplitPane, Sidebar, SidebarContainer };
59
60
  export { Dialog };
60
61
  export { Progress, Tooltip };
61
62
  export { Table };
package/dist/index.js CHANGED
@@ -40,6 +40,7 @@ import Tile from "./layout/Tile.svelte";
40
40
  import Code from "./misc/Code.svelte";
41
41
  import TextLayout from "./typography/TextLayout.svelte";
42
42
  import Sidebar from "./layout/Sidebar.svelte";
43
+ import SidebarContainer from "./layout/SidebarContainer.svelte";
43
44
  import Dialog from "./overlays/Dialog.svelte";
44
45
  import Progress from "./misc/Progress.svelte";
45
46
  import Tooltip from "./overlays/Tooltip.svelte";
@@ -55,7 +56,7 @@ export { Bar, ColumnContainer, Container, GridLayout, GridRow, Inline, MenuList,
55
56
  export { TextLayout, Code, Accordion };
56
57
  export { Card, Tile, Form, FormItem, FormProvider, Fieldset };
57
58
  export { DataList, DataListItem };
58
- export { Row, Column, Columns, SplitPane, Sidebar };
59
+ export { Row, Column, Columns, SplitPane, Sidebar, SidebarContainer };
59
60
  export { Dialog };
60
61
  export { Progress, Tooltip };
61
62
  export { Table };