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
@@ -32,7 +32,33 @@ const el = $derived(elementProps({ justify, align, gap, wrap, ...restProps }, "i
32
32
  {@render children?.()}
33
33
  </div>
34
34
 
35
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
35
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
36
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
37
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
38
+ an actual heading element anymore -- see typography-context.css (vars/), which
39
+ is the single, global, :where()-scoped rule that actually reads these vars
40
+ and applies them to real elements. That split is what lets a component
41
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
42
+ nearest ancestor's heading styling: these are ordinary inherited custom
43
+ properties, so DOM proximity decides which component's values apply, not
44
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
45
+ /* All six heading levels' context vars in one call -- what every
46
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
47
+ includes on itself once, alongside the shared --_heading-* vars below. */
48
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
49
+ their own vars -- they're never wider than their ul/ol/dl parent's own
50
+ max-width box, so they're already bounded for free by ordinary block
51
+ layout, not by anything selector-based reaching them individually. */
52
+ /* p specifically also gets the fuller typography-props-bare treatment
53
+ (paragraph-prefixed), which -- same as in the original selector-based
54
+ version -- is declared/consumed AFTER the shared prose vars above, so it
55
+ wins for whichever properties both groups set. */
56
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
57
+ after a heading) gets its own, slightly different treatment -- larger lede
58
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
59
+ has to happen where the real element is, in the global consumer rule; only
60
+ the VALUES move to context vars here. */
61
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
36
62
  one value (both sides equal) or two (start end), so there is no separate
37
63
  "which side" prop to remember and no 4-value shorthand order to get wrong.
38
64
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -40,6 +66,18 @@ const el = $derived(elementProps({ justify, align, gap, wrap, ...restProps }, "i
40
66
  day this mixin got added to a new component. Callers opt in with an actual
41
67
  value. (Container does not use this mixin: it wants --gap/auto as its
42
68
  defaults, which do not fit the "0 unless asked" contract here.) */
69
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
70
+ affordance -- a floating button that opens a panel over the content.
71
+
72
+ Page has to agree with Sidebar about this, because Page is what floats the
73
+ aside out of flow and reserves the strip of padding the sheet button sits
74
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
75
+ which left a band between 513 and 600 where Page had already lifted the
76
+ aside out of the layout while the Sidebar inside it was still showing a
77
+ rail -- a grab bar floating on top of the content, which is the affordance
78
+ we deliberately avoid everywhere else.
79
+
80
+ One definition, used by both, so they cannot drift again. */
43
81
  /* Warning: because we define a fallback
44
82
  media query, the media query can override the container
45
83
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -60,6 +98,12 @@ const el = $derived(elementProps({ justify, align, gap, wrap, ...restProps }, "i
60
98
  border-bottom: var(--inline-border-bottom, var(--border-bottom, var(--inline-border, var(--border, none))));
61
99
  border-left: var(--inline-border-left, var(--border-left, var(--inline-border, var(--border, none))));
62
100
  border-radius: var(--inline-border-radius, var(--border-radius, none));
101
+ /* A layout helper, not a surface: padding comes only from
102
+ --inline-padding (or the `padding` prop), never from the theme's
103
+ --padding. box-props falls back to --padding, which is inherited, so
104
+ without this every Inline picked up the page's padding -- or
105
+ whatever padding an enclosing Card set. */
106
+ --_padding: var(--inline-padding, 0);
63
107
  --_margin-block: var(--inline-margin-block, var(--margin-block, 0));
64
108
  --_margin-inline: var(--inline-margin-inline, var(--margin-inline, 0));
65
109
  margin-block: var(--_margin-block);
@@ -26,7 +26,33 @@ const el = $derived(elementProps(restProps, "menu", [
26
26
  {@render children?.()}
27
27
  </ul>
28
28
 
29
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
29
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
30
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
31
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
32
+ an actual heading element anymore -- see typography-context.css (vars/), which
33
+ is the single, global, :where()-scoped rule that actually reads these vars
34
+ and applies them to real elements. That split is what lets a component
35
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
36
+ nearest ancestor's heading styling: these are ordinary inherited custom
37
+ properties, so DOM proximity decides which component's values apply, not
38
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
39
+ /* All six heading levels' context vars in one call -- what every
40
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
41
+ includes on itself once, alongside the shared --_heading-* vars below. */
42
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
43
+ their own vars -- they're never wider than their ul/ol/dl parent's own
44
+ max-width box, so they're already bounded for free by ordinary block
45
+ layout, not by anything selector-based reaching them individually. */
46
+ /* p specifically also gets the fuller typography-props-bare treatment
47
+ (paragraph-prefixed), which -- same as in the original selector-based
48
+ version -- is declared/consumed AFTER the shared prose vars above, so it
49
+ wins for whichever properties both groups set. */
50
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
51
+ after a heading) gets its own, slightly different treatment -- larger lede
52
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
53
+ has to happen where the real element is, in the global consumer rule; only
54
+ the VALUES move to context vars here. */
55
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
30
56
  one value (both sides equal) or two (start end), so there is no separate
31
57
  "which side" prop to remember and no 4-value shorthand order to get wrong.
32
58
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -34,6 +60,18 @@ const el = $derived(elementProps(restProps, "menu", [
34
60
  day this mixin got added to a new component. Callers opt in with an actual
35
61
  value. (Container does not use this mixin: it wants --gap/auto as its
36
62
  defaults, which do not fit the "0 unless asked" contract here.) */
63
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
64
+ affordance -- a floating button that opens a panel over the content.
65
+
66
+ Page has to agree with Sidebar about this, because Page is what floats the
67
+ aside out of flow and reserves the strip of padding the sheet button sits
68
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
69
+ which left a band between 513 and 600 where Page had already lifted the
70
+ aside out of the layout while the Sidebar inside it was still showing a
71
+ rail -- a grab bar floating on top of the content, which is the affordance
72
+ we deliberately avoid everywhere else.
73
+
74
+ One definition, used by both, so they cannot drift again. */
37
75
  /* Warning: because we define a fallback
38
76
  media query, the media query can override the container
39
77
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -89,7 +89,33 @@ onMount(() => {
89
89
  </footer>
90
90
  </section>
91
91
 
92
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
92
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
93
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
94
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
95
+ an actual heading element anymore -- see typography-context.css (vars/), which
96
+ is the single, global, :where()-scoped rule that actually reads these vars
97
+ and applies them to real elements. That split is what lets a component
98
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
99
+ nearest ancestor's heading styling: these are ordinary inherited custom
100
+ properties, so DOM proximity decides which component's values apply, not
101
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
102
+ /* All six heading levels' context vars in one call -- what every
103
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
104
+ includes on itself once, alongside the shared --_heading-* vars below. */
105
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
106
+ their own vars -- they're never wider than their ul/ol/dl parent's own
107
+ max-width box, so they're already bounded for free by ordinary block
108
+ layout, not by anything selector-based reaching them individually. */
109
+ /* p specifically also gets the fuller typography-props-bare treatment
110
+ (paragraph-prefixed), which -- same as in the original selector-based
111
+ version -- is declared/consumed AFTER the shared prose vars above, so it
112
+ wins for whichever properties both groups set. */
113
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
114
+ after a heading) gets its own, slightly different treatment -- larger lede
115
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
116
+ has to happen where the real element is, in the global consumer rule; only
117
+ the VALUES move to context vars here. */
118
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
93
119
  one value (both sides equal) or two (start end), so there is no separate
94
120
  "which side" prop to remember and no 4-value shorthand order to get wrong.
95
121
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -97,6 +123,18 @@ onMount(() => {
97
123
  day this mixin got added to a new component. Callers opt in with an actual
98
124
  value. (Container does not use this mixin: it wants --gap/auto as its
99
125
  defaults, which do not fit the "0 unless asked" contract here.) */
126
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
127
+ affordance -- a floating button that opens a panel over the content.
128
+
129
+ Page has to agree with Sidebar about this, because Page is what floats the
130
+ aside out of flow and reserves the strip of padding the sheet button sits
131
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
132
+ which left a band between 513 and 600 where Page had already lifted the
133
+ aside out of the layout while the Sidebar inside it was still showing a
134
+ rail -- a grab bar floating on top of the content, which is the affordance
135
+ we deliberately avoid everywhere else.
136
+
137
+ One definition, used by both, so they cannot drift again. */
100
138
  /* Warning: because we define a fallback
101
139
  media query, the media query can override the container
102
140
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -415,7 +453,11 @@ footer {
415
453
  overflow: hidden;
416
454
  }
417
455
 
418
- @container (max-width: 600px) {
456
+ /* Must match Sidebar's own compact breakpoint exactly -- everything in
457
+ this block exists to accommodate the sheet affordance, so switching at a
458
+ different width than the Sidebar does leaves a band where Page has
459
+ floated the aside but the Sidebar still shows a rail. */
460
+ @container (max-width: 512px) {
419
461
  .side-by-side {
420
462
  gap: 0;
421
463
  }
@@ -21,7 +21,33 @@ const el = $derived(elementProps(restProps, "row-container", ROW_CONTAINER_VARS)
21
21
  {@render children?.()}
22
22
  </section>
23
23
 
24
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
24
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
25
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
26
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
27
+ an actual heading element anymore -- see typography-context.css (vars/), which
28
+ is the single, global, :where()-scoped rule that actually reads these vars
29
+ and applies them to real elements. That split is what lets a component
30
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
31
+ nearest ancestor's heading styling: these are ordinary inherited custom
32
+ properties, so DOM proximity decides which component's values apply, not
33
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
34
+ /* All six heading levels' context vars in one call -- what every
35
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
36
+ includes on itself once, alongside the shared --_heading-* vars below. */
37
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
38
+ their own vars -- they're never wider than their ul/ol/dl parent's own
39
+ max-width box, so they're already bounded for free by ordinary block
40
+ layout, not by anything selector-based reaching them individually. */
41
+ /* p specifically also gets the fuller typography-props-bare treatment
42
+ (paragraph-prefixed), which -- same as in the original selector-based
43
+ version -- is declared/consumed AFTER the shared prose vars above, so it
44
+ wins for whichever properties both groups set. */
45
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
46
+ after a heading) gets its own, slightly different treatment -- larger lede
47
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
48
+ has to happen where the real element is, in the global consumer rule; only
49
+ the VALUES move to context vars here. */
50
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
25
51
  one value (both sides equal) or two (start end), so there is no separate
26
52
  "which side" prop to remember and no 4-value shorthand order to get wrong.
27
53
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -29,6 +55,18 @@ const el = $derived(elementProps(restProps, "row-container", ROW_CONTAINER_VARS)
29
55
  day this mixin got added to a new component. Callers opt in with an actual
30
56
  value. (Container does not use this mixin: it wants --gap/auto as its
31
57
  defaults, which do not fit the "0 unless asked" contract here.) */
58
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
59
+ affordance -- a floating button that opens a panel over the content.
60
+
61
+ Page has to agree with Sidebar about this, because Page is what floats the
62
+ aside out of flow and reserves the strip of padding the sheet button sits
63
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
64
+ which left a band between 513 and 600 where Page had already lifted the
65
+ aside out of the layout while the Sidebar inside it was still showing a
66
+ rail -- a grab bar floating on top of the content, which is the affordance
67
+ we deliberately avoid everywhere else.
68
+
69
+ One definition, used by both, so they cannot drift again. */
32
70
  /* Warning: because we define a fallback
33
71
  media query, the media query can override the container
34
72
  if we stack a bunch of these in a row and aren't thoughtful about the order.