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
@@ -41,7 +41,33 @@ const effectiveLayout = $derived(above ? "above" : below ? "below" : effectiveLa
41
41
  <div class="after">{@render after?.()}</div>
42
42
  </div>
43
43
 
44
- <style>/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
44
+ <style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
45
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
46
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
47
+ an actual heading element anymore -- see typography-context.css (vars/), which
48
+ is the single, global, :where()-scoped rule that actually reads these vars
49
+ and applies them to real elements. That split is what lets a component
50
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
51
+ nearest ancestor's heading styling: these are ordinary inherited custom
52
+ properties, so DOM proximity decides which component's values apply, not
53
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
54
+ /* All six heading levels' context vars in one call -- what every
55
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
56
+ includes on itself once, alongside the shared --_heading-* vars below. */
57
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
58
+ their own vars -- they're never wider than their ul/ol/dl parent's own
59
+ max-width box, so they're already bounded for free by ordinary block
60
+ layout, not by anything selector-based reaching them individually. */
61
+ /* p specifically also gets the fuller typography-props-bare treatment
62
+ (paragraph-prefixed), which -- same as in the original selector-based
63
+ version -- is declared/consumed AFTER the shared prose vars above, so it
64
+ wins for whichever properties both groups set. */
65
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
66
+ after a heading) gets its own, slightly different treatment -- larger lede
67
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
68
+ has to happen where the real element is, in the global consumer rule; only
69
+ the VALUES move to context vars here. */
70
+ /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
45
71
  one value (both sides equal) or two (start end), so there is no separate
46
72
  "which side" prop to remember and no 4-value shorthand order to get wrong.
47
73
  Defaults to 0 on purpose -- unlike padding-props above, a margin that
@@ -49,6 +75,18 @@ const effectiveLayout = $derived(above ? "above" : below ? "below" : effectiveLa
49
75
  day this mixin got added to a new component. Callers opt in with an actual
50
76
  value. (Container does not use this mixin: it wants --gap/auto as its
51
77
  defaults, which do not fit the "0 unless asked" contract here.) */
78
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
79
+ affordance -- a floating button that opens a panel over the content.
80
+
81
+ Page has to agree with Sidebar about this, because Page is what floats the
82
+ aside out of flow and reserves the strip of padding the sheet button sits
83
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
84
+ which left a band between 513 and 600 where Page had already lifted the
85
+ aside out of the layout while the Sidebar inside it was still showing a
86
+ rail -- a grab bar floating on top of the content, which is the affordance
87
+ we deliberately avoid everywhere else.
88
+
89
+ One definition, used by both, so they cannot drift again. */
52
90
  /* Warning: because we define a fallback
53
91
  media query, the media query can override the container
54
92
  if we stack a bunch of these in a row and aren't thoughtful about the order.
@@ -22,6 +22,32 @@ const el = $derived(elementProps(restProps, "grid-layout", GRID_LAYOUT_VARS));
22
22
  </div>
23
23
 
24
24
  <style>@charset "UTF-8";
25
+ /* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
26
+ inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
27
+ assigned directly to a matched h1-h6 selector. Nothing in this file matches
28
+ an actual heading element anymore -- see typography-context.css (vars/), which
29
+ is the single, global, :where()-scoped rule that actually reads these vars
30
+ and applies them to real elements. That split is what lets a component
31
+ nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
32
+ nearest ancestor's heading styling: these are ordinary inherited custom
33
+ properties, so DOM proximity decides which component's values apply, not
34
+ selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
35
+ /* All six heading levels' context vars in one call -- what every
36
+ "typography container" component (Container, Card, Tile, TextLayout, ...)
37
+ includes on itself once, alongside the shared --_heading-* vars below. */
38
+ /* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
39
+ their own vars -- they're never wider than their ul/ol/dl parent's own
40
+ max-width box, so they're already bounded for free by ordinary block
41
+ layout, not by anything selector-based reaching them individually. */
42
+ /* p specifically also gets the fuller typography-props-bare treatment
43
+ (paragraph-prefixed), which -- same as in the original selector-based
44
+ version -- is declared/consumed AFTER the shared prose vars above, so it
45
+ wins for whichever properties both groups set. */
46
+ /* The first paragraph in a typography context (p:first-of-type, or a p right
47
+ after a heading) gets its own, slightly different treatment -- larger lede
48
+ text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
49
+ has to happen where the real element is, in the global consumer rule; only
50
+ the VALUES move to context vars here. */
25
51
  /* Logical, not top/bottom/left/right: margin-block/margin-inline already take
26
52
  one value (both sides equal) or two (start end), so there is no separate
27
53
  "which side" prop to remember and no 4-value shorthand order to get wrong.
@@ -30,6 +56,18 @@ const el = $derived(elementProps(restProps, "grid-layout", GRID_LAYOUT_VARS));
30
56
  day this mixin got added to a new component. Callers opt in with an actual
31
57
  value. (Container does not use this mixin: it wants --gap/auto as its
32
58
  defaults, which do not fit the "0 unless asked" contract here.) */
59
+ /* The width at or below which a Sidebar swaps its grab-bar rail for the sheet
60
+ affordance -- a floating button that opens a panel over the content.
61
+
62
+ Page has to agree with Sidebar about this, because Page is what floats the
63
+ aside out of flow and reserves the strip of padding the sheet button sits
64
+ in. They used to disagree: Sidebar switched at 512px and Page at 600px,
65
+ which left a band between 513 and 600 where Page had already lifted the
66
+ aside out of the layout while the Sidebar inside it was still showing a
67
+ rail -- a grab bar floating on top of the content, which is the affordance
68
+ we deliberately avoid everywhere else.
69
+
70
+ One definition, used by both, so they cannot drift again. */
33
71
  /* Warning: because we define a fallback
34
72
  media query, the media query can override the container
35
73
  if we stack a bunch of these in a row and aren't thoughtful about the order.