contain-css-svelte 1.3.0 → 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 (46) hide show
  1. package/dist/Card.svelte +204 -288
  2. package/dist/controls/Button.svelte +27 -1
  3. package/dist/controls/ButtonLink.svelte +27 -1
  4. package/dist/controls/Checkbox.svelte +26 -0
  5. package/dist/controls/CircleButton.svelte +27 -1
  6. package/dist/controls/Input.svelte +27 -1
  7. package/dist/controls/RadioButton.svelte +26 -0
  8. package/dist/controls/Select.svelte +26 -0
  9. package/dist/controls/Slider.svelte +27 -1
  10. package/dist/controls/TabItem.svelte +27 -1
  11. package/dist/controls/Toggle.svelte +27 -1
  12. package/dist/dropdowns/DropdownMenu.svelte +27 -1
  13. package/dist/layout/Accordion.svelte +27 -1
  14. package/dist/layout/Bar.svelte +37 -1
  15. package/dist/layout/ColumnContainer.svelte +27 -1
  16. package/dist/layout/Columns.svelte +27 -1
  17. package/dist/layout/Container.svelte +205 -292
  18. package/dist/layout/DataList.svelte +27 -1
  19. package/dist/layout/DataListItem.svelte +205 -292
  20. package/dist/layout/Fieldset.svelte +27 -1
  21. package/dist/layout/Form.svelte +205 -292
  22. package/dist/layout/FormItem.svelte +27 -1
  23. package/dist/layout/GridLayout.svelte +26 -0
  24. package/dist/layout/Hero.svelte +205 -292
  25. package/dist/layout/Inline.svelte +33 -1
  26. package/dist/layout/MenuList.svelte +27 -1
  27. package/dist/layout/Page.svelte +27 -1
  28. package/dist/layout/RowContainer.svelte +27 -1
  29. package/dist/layout/Sidebar.svelte +266 -33
  30. package/dist/layout/Sidebar.svelte.d.ts +34 -0
  31. package/dist/layout/SidebarContainer.svelte +27 -1
  32. package/dist/layout/SplitPane.svelte +27 -1
  33. package/dist/layout/Stack.svelte +33 -1
  34. package/dist/layout/TabBar.svelte +27 -1
  35. package/dist/layout/Table.svelte +238 -294
  36. package/dist/layout/Tile.svelte +204 -291
  37. package/dist/misc/CodeInner.svelte +27 -1
  38. package/dist/misc/Progress.svelte +205 -292
  39. package/dist/misc/Tag.svelte +27 -1
  40. package/dist/overlays/Dialog.svelte +205 -292
  41. package/dist/overlays/Tooltip.svelte +255 -349
  42. package/dist/sass/_typography.scss +203 -191
  43. package/dist/typography/TextLayout.svelte +482 -292
  44. package/dist/vars/defaults.css +258 -0
  45. package/dist/vars/typography-context.css +271 -0
  46. package/package.json +1 -1
@@ -116,7 +116,33 @@ onMount(() => {
116
116
  </div>
117
117
  </div>
118
118
 
119
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
119
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
120
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
121
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
122
+ an actual heading element anymore -- see typography-context.css (vars/), which
123
+ is the single, global, :where()-scoped rule that actually reads these vars
124
+ and applies them to real elements. That split is what lets a component
125
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
126
+ nearest ancestor's heading styling: these are ordinary inherited custom
127
+ properties, so DOM proximity decides which component's values apply, not
128
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
129
+ /* All six heading levels' context vars in one call -- what every
130
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
131
+ includes on itself once, alongside the shared --_heading-* vars below. */
132
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
133
+ their own vars -- they're never wider than their ul/ol/dl parent's own
134
+ max-width box, so they're already bounded for free by ordinary block
135
+ layout, not by anything selector-based reaching them individually. */
136
+ /* p specifically also gets the fuller typography-props-bare treatment
137
+ (paragraph-prefixed), which -- same as in the original selector-based
138
+ version -- is declared/consumed AFTER the shared prose vars above, so it
139
+ wins for whichever properties both groups set. */
140
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
141
+ after a heading) gets its own, slightly different treatment -- larger lede
142
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
143
+ has to happen where the real element is, in the global consumer rule; only
144
+ the VALUES move to context vars here. */
145
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
120
146
  one value (both sides equal) or two (start end), so there is no separate
121
147
  "which side" prop to remember and no 4-value shorthand order to get wrong.
122
148
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -32,7 +32,33 @@ const el = $derived(elementProps({ justify, align: resolvedAlign, gap, ...restPr
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
@@ -72,6 +98,12 @@ const el = $derived(elementProps({ justify, align: resolvedAlign, gap, ...restPr
72
98
  border-bottom: var(--stack-border-bottom, var(--border-bottom, var(--stack-border, var(--border, none))));
73
99
  border-left: var(--stack-border-left, var(--border-left, var(--stack-border, var(--border, none))));
74
100
  border-radius: var(--stack-border-radius, var(--border-radius, none));
101
+ /* A layout helper, not a surface: padding comes only from
102
+ --stack-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 Stack picked up the page's padding -- or
105
+ whatever padding an enclosing Card set. */
106
+ --_padding: var(--stack-padding, 0);
75
107
  --_margin-block: var(--stack-margin-block, var(--margin-block, 0));
76
108
  --_margin-inline: var(--stack-margin-inline, var(--margin-inline, 0));
77
109
  margin-block: var(--_margin-block);
@@ -46,7 +46,33 @@ let lastActive = $state(active);
46
46
  </Bar>
47
47
  </div>
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