shelving 1.253.2 → 1.253.3

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 (92) hide show
  1. package/package.json +3 -3
  2. package/ui/README.md +4 -4
  3. package/ui/app/App.d.ts +0 -12
  4. package/ui/app/App.js +0 -14
  5. package/ui/app/App.tsx +0 -14
  6. package/ui/block/Address.module.css +2 -0
  7. package/ui/block/Block.d.ts +7 -3
  8. package/ui/block/Block.js +2 -2
  9. package/ui/block/Block.module.css +4 -0
  10. package/ui/block/Block.tsx +8 -4
  11. package/ui/block/Blockquote.module.css +1 -1
  12. package/ui/block/Caption.module.css +2 -2
  13. package/ui/block/Card.d.ts +9 -2
  14. package/ui/block/Card.js +4 -3
  15. package/ui/block/Card.tsx +13 -5
  16. package/ui/block/Definitions.module.css +3 -4
  17. package/ui/block/Divider.module.css +1 -1
  18. package/ui/block/Heading.module.css +2 -3
  19. package/ui/block/Label.module.css +2 -4
  20. package/ui/block/List.module.css +3 -1
  21. package/ui/block/List.tsx +0 -1
  22. package/ui/block/Panel.d.ts +7 -7
  23. package/ui/block/Panel.js +2 -2
  24. package/ui/block/Panel.module.css +4 -1
  25. package/ui/block/Panel.tsx +11 -11
  26. package/ui/block/Paragraph.module.css +2 -0
  27. package/ui/block/Preformatted.module.css +2 -4
  28. package/ui/block/Section.d.ts +20 -29
  29. package/ui/block/Section.js +21 -33
  30. package/ui/block/Section.md +2 -2
  31. package/ui/block/Section.module.css +2 -0
  32. package/ui/block/Section.tsx +32 -46
  33. package/ui/block/Subheading.module.css +2 -3
  34. package/ui/block/Title.module.css +2 -3
  35. package/ui/block/Video.js +3 -1
  36. package/ui/block/Video.tsx +10 -1
  37. package/ui/form/Button.module.css +1 -3
  38. package/ui/form/Field.module.css +1 -2
  39. package/ui/form/Input.module.css +1 -3
  40. package/ui/inline/Code.module.css +1 -3
  41. package/ui/inline/Deleted.module.css +1 -1
  42. package/ui/inline/Inserted.module.css +1 -1
  43. package/ui/inline/Link.module.css +1 -1
  44. package/ui/inline/Mark.module.css +1 -1
  45. package/ui/inline/Small.module.css +1 -1
  46. package/ui/inline/Strong.module.css +1 -1
  47. package/ui/menu/Menu.module.css +1 -4
  48. package/ui/misc/Loading.module.css +1 -1
  49. package/ui/misc/StatusIcon.module.css +1 -1
  50. package/ui/misc/Tag.module.css +1 -3
  51. package/ui/notice/Message.module.css +1 -1
  52. package/ui/notice/Notice.module.css +1 -2
  53. package/ui/style/Flex.js +2 -1
  54. package/ui/style/Flex.module.css +1 -1
  55. package/ui/style/Flex.tsx +4 -1
  56. package/ui/style/Padding.js +1 -1
  57. package/ui/style/Padding.module.css +18 -18
  58. package/ui/style/Padding.tsx +1 -1
  59. package/ui/style/Radius.module.css +7 -8
  60. package/ui/style/Space.js +1 -1
  61. package/ui/style/Space.module.css +25 -26
  62. package/ui/style/Space.tsx +1 -1
  63. package/ui/style/Tint.d.ts +6 -0
  64. package/ui/style/Tint.module.css +0 -6
  65. package/ui/style/Tint.tsx +28 -0
  66. package/ui/style/Typography.d.ts +37 -32
  67. package/ui/style/Typography.js +4 -8
  68. package/ui/style/Typography.module.css +163 -0
  69. package/ui/style/Typography.tsx +47 -59
  70. package/ui/style/getRadiusClass.md +8 -9
  71. package/ui/style/getSpaceClass.md +9 -10
  72. package/ui/style/getTypographyClass.md +64 -0
  73. package/ui/style/index.d.ts +0 -3
  74. package/ui/style/index.js +0 -3
  75. package/ui/style/index.tsx +0 -3
  76. package/ui/style/layers.css +2 -2
  77. package/ui/table/Table.module.css +1 -3
  78. package/ui/style/Font.d.ts +0 -24
  79. package/ui/style/Font.js +0 -13
  80. package/ui/style/Font.module.css +0 -50
  81. package/ui/style/Font.tsx +0 -31
  82. package/ui/style/Size.d.ts +0 -24
  83. package/ui/style/Size.js +0 -13
  84. package/ui/style/Size.module.css +0 -69
  85. package/ui/style/Size.tsx +0 -31
  86. package/ui/style/Weight.d.ts +0 -24
  87. package/ui/style/Weight.js +0 -13
  88. package/ui/style/Weight.module.css +0 -42
  89. package/ui/style/Weight.tsx +0 -31
  90. package/ui/style/getFontClass.md +0 -32
  91. package/ui/style/getSizeClass.md +0 -35
  92. package/ui/style/getWeightClass.md +0 -18
@@ -17,13 +17,11 @@ const SECTION_CLASS = getModuleClass(SECTION_CSS, "section");
17
17
  * @see https://dhoulb.github.io/shelving/ui/block/Section/getSectionClass
18
18
  */
19
19
  export function getSectionClass(variants) {
20
- return getClass(SECTION_CLASS, getColorClass(variants), getSpaceClass(variants), getTypographyClass(variants), getWidthClass(variants));
21
- }
22
- function renderSection(defaultComponent, { as: Component = defaultComponent, children, ...variants }) {
23
- return _jsx(Component, { className: getSectionClass(variants), children: children });
20
+ return getClass(SECTION_CLASS, //
21
+ getColorClass(variants), getSpaceClass(variants), getTypographyClass(variants), getWidthClass(variants));
24
22
  }
25
23
  /**
26
- * `<section>` block with block-level spacing.
24
+ * `<section>` block with section-level spacing.
27
25
  * - Pass `as` to render a different semantic element.
28
26
  *
29
27
  * @kind component
@@ -31,61 +29,51 @@ function renderSection(defaultComponent, { as: Component = defaultComponent, chi
31
29
  * @example <Section><Heading>About</Heading></Section>
32
30
  * @see https://dhoulb.github.io/shelving/ui/block/Section/Section
33
31
  */
34
- export function Section(props) {
35
- return renderSection("section", props);
32
+ export function Section({ as: Element = "section", children, ...variants }) {
33
+ return _jsx(Element, { className: getSectionClass(variants), children: children });
36
34
  }
37
35
  /**
38
- * `<header>` block with block-level spacing.
36
+ * `<header>` block with section-level spacing.
39
37
  *
40
38
  * @kind component
41
39
  * @returns Rendered `<header>` element.
42
40
  * @example <Header><Title>Welcome</Title></Header>
43
41
  * @see https://dhoulb.github.io/shelving/ui/block/Section/Header
44
42
  */
45
- export function Header(props) {
46
- return renderSection("header", props);
43
+ export function Header({ as: Element = "section", children, ...variants }) {
44
+ return _jsx(Element, { className: getSectionClass(variants), children: children });
47
45
  }
48
46
  /**
49
- * `<footer>` block with block-level spacing.
47
+ * `<footer>` block with section-level spacing.
50
48
  *
51
49
  * @kind component
52
50
  * @returns Rendered `<footer>` element.
53
51
  * @example <Footer><Small>© 2026</Small></Footer>
54
52
  * @see https://dhoulb.github.io/shelving/ui/block/Section/Footer
55
53
  */
56
- export function Footer(props) {
57
- return renderSection("footer", props);
58
- }
59
- /**
60
- * `<nav>` block with block-level spacing.
61
- *
62
- * @kind component
63
- * @returns Rendered `<nav>` element.
64
- * @example <Nav><Link href="/">Home</Link></Nav>
65
- * @see https://dhoulb.github.io/shelving/ui/block/Section/Nav
66
- */
67
- export function Nav(props) {
68
- return renderSection("nav", props);
54
+ export function Footer({ as: Element = "section", children, ...variants }) {
55
+ return _jsx(Element, { className: getSectionClass(variants), children: children });
69
56
  }
70
57
  /**
71
- * `<aside>` block with block-level spacing.
58
+ * `<article>` block with section-level spacing.
59
+ * - Use a `<Card>` instead to display boxed content.
72
60
  *
73
61
  * @kind component
74
- * @returns Rendered `<aside>` element.
75
- * @example <Aside width="narrow"><Paragraph>Sidebar</Paragraph></Aside>
76
- * @see https://dhoulb.github.io/shelving/ui/block/Section/Aside
62
+ * @returns Rendered `<article>` element.
63
+ * @see https://dhoulb.github.io/shelving/ui/block/Section/Article
77
64
  */
78
- export function Aside(props) {
79
- return renderSection("aside", props);
65
+ export function Article({ as: Element = "article", children, ...variants }) {
66
+ return _jsx(Element, { className: getSectionClass(variants), children: children });
80
67
  }
81
68
  /**
82
- * `<figure>` block with block-level spacing. Pair with `<Caption>` for `<figcaption>` content.
69
+ * `<figure>` block with section-level spacing.
70
+ * - Pair with `<Caption>` for `<figcaption>` content.
83
71
  *
84
72
  * @kind component
85
73
  * @returns Rendered `<figure>` element.
86
74
  * @example <Figure><Image src="/cat.jpg" /><Caption>A cat</Caption></Figure>
87
75
  * @see https://dhoulb.github.io/shelving/ui/block/Section/Figure
88
76
  */
89
- export function Figure(props) {
90
- return renderSection("figure", props);
77
+ export function Figure({ as: Element = "figure", children, ...variants }) {
78
+ return _jsx(Element, { className: getSectionClass(variants), children: children });
91
79
  }
@@ -1,10 +1,10 @@
1
1
  # Section
2
2
 
3
- A landmark content region — renders a `<section>` with block-level spacing and a constrained content width. `Section.tsx` exports the whole family of semantic landmarks (`Section`, `Header`, `Footer`, `Nav`, `Aside`, `Figure`) — they share `SectionProps` and differ only in the HTML element they render.
3
+ A landmark content region — renders a `<section>` with block-level spacing and a constrained content width. `Section.tsx` exports the whole family of semantic landmarks (`<Section>`, `<Header>`, `<Footer>`, `<Figure>`) — they share `SectionProps` and differ only in the HTML element they render.
4
4
 
5
5
  **Things to know:**
6
6
 
7
- - Pick the component whose HTML element matches the semantic meaning rather than reaching for a generic `<Block>`. `<Section>` is a `<section>`, `<Nav>` a `<nav>`, `<Figure>` a `<figure>`, and so on.
7
+ - Pick the component whose HTML element matches the semantic meaning rather than reaching for a generic `<Block>`. `<Section>` is a `<section>`, `<Figure>` a `<figure>`, and so on.
8
8
  - Every section centres its content and caps the line length so text never touches the viewport edges. Nested sections relax that cap so they can fill their parent.
9
9
  - Sections default to the `--width-normal` content width, so most of the time you set no width at all. Pass `width="narrow"` / `"wide"` / `"full"` (or `"fit"`) to change that, and the usual `color` / `space` / typography variants to retint and respace.
10
10
  - Pair `Figure` with `<Caption>` for a `<figure>` / `<figcaption>` pair.
@@ -1,4 +1,6 @@
1
1
  @import "../style/layers.css";
2
+ @import "../style/Color.module.css";
3
+ @import "../style/Typography.module.css";
2
4
  @import "../style/Space.module.css";
3
5
  @import "../style/Width.module.css";
4
6
 
@@ -5,24 +5,22 @@ import { getTypographyClass, type TypographyVariants } from "../style/Typography
5
5
  import { getWidthClass, type WidthVariants } from "../style/Width.js";
6
6
  import { getClass, getModuleClass } from "../util/css.js";
7
7
  import type { OptionalChildProps } from "../util/props.js";
8
+ import type { BlockElement } from "./Block.js";
8
9
  import SECTION_CSS from "./Section.module.css";
9
10
 
10
11
  const SECTION_CLASS = getModuleClass(SECTION_CSS, "section");
11
12
 
12
- /**
13
- * Semantic element names a `Section` may render as via its `as` prop.
14
- *
15
- * @see https://dhoulb.github.io/shelving/ui/block/Section/SectionElement
16
- */
17
- export type SectionElement = "section" | "header" | "footer" | "nav" | "aside" | "figure";
18
-
19
13
  /**
20
14
  * Props for `Section` and its semantic siblings — colour, space, typography, and width variants plus an optional `as` element override.
21
15
  *
22
16
  * @see https://dhoulb.github.io/shelving/ui/block/Section/SectionProps
23
17
  */
24
18
  export interface SectionProps extends ColorVariants, SpaceVariants, TypographyVariants, WidthVariants, OptionalChildProps {
25
- as?: SectionElement | undefined;
19
+ /**
20
+ * Element this `<Section>` renders as, e.g. "header" to output a "<header>"
21
+ * @default "section"
22
+ */
23
+ as?: BlockElement | undefined;
26
24
  }
27
25
 
28
26
  /**
@@ -36,18 +34,17 @@ export interface SectionProps extends ColorVariants, SpaceVariants, TypographyVa
36
34
  * @see https://dhoulb.github.io/shelving/ui/block/Section/getSectionClass
37
35
  */
38
36
  export function getSectionClass(variants: SectionProps): string {
39
- return getClass(SECTION_CLASS, getColorClass(variants), getSpaceClass(variants), getTypographyClass(variants), getWidthClass(variants));
40
- }
41
-
42
- function renderSection(
43
- defaultComponent: SectionElement,
44
- { as: Component = defaultComponent, children, ...variants }: SectionProps,
45
- ): ReactElement {
46
- return <Component className={getSectionClass(variants)}>{children}</Component>;
37
+ return getClass(
38
+ SECTION_CLASS, //
39
+ getColorClass(variants),
40
+ getSpaceClass(variants),
41
+ getTypographyClass(variants),
42
+ getWidthClass(variants),
43
+ );
47
44
  }
48
45
 
49
46
  /**
50
- * `<section>` block with block-level spacing.
47
+ * `<section>` block with section-level spacing.
51
48
  * - Pass `as` to render a different semantic element.
52
49
  *
53
50
  * @kind component
@@ -55,66 +52,55 @@ function renderSection(
55
52
  * @example <Section><Heading>About</Heading></Section>
56
53
  * @see https://dhoulb.github.io/shelving/ui/block/Section/Section
57
54
  */
58
- export function Section(props: SectionProps): ReactElement {
59
- return renderSection("section", props);
55
+ export function Section({ as: Element = "section", children, ...variants }: SectionProps): ReactElement {
56
+ return <Element className={getSectionClass(variants)}>{children}</Element>;
60
57
  }
61
58
 
62
59
  /**
63
- * `<header>` block with block-level spacing.
60
+ * `<header>` block with section-level spacing.
64
61
  *
65
62
  * @kind component
66
63
  * @returns Rendered `<header>` element.
67
64
  * @example <Header><Title>Welcome</Title></Header>
68
65
  * @see https://dhoulb.github.io/shelving/ui/block/Section/Header
69
66
  */
70
- export function Header(props: SectionProps): ReactElement {
71
- return renderSection("header", props);
67
+ export function Header({ as: Element = "section", children, ...variants }: SectionProps): ReactElement {
68
+ return <Element className={getSectionClass(variants)}>{children}</Element>;
72
69
  }
73
70
 
74
71
  /**
75
- * `<footer>` block with block-level spacing.
72
+ * `<footer>` block with section-level spacing.
76
73
  *
77
74
  * @kind component
78
75
  * @returns Rendered `<footer>` element.
79
76
  * @example <Footer><Small>© 2026</Small></Footer>
80
77
  * @see https://dhoulb.github.io/shelving/ui/block/Section/Footer
81
78
  */
82
- export function Footer(props: SectionProps): ReactElement {
83
- return renderSection("footer", props);
84
- }
85
-
86
- /**
87
- * `<nav>` block with block-level spacing.
88
- *
89
- * @kind component
90
- * @returns Rendered `<nav>` element.
91
- * @example <Nav><Link href="/">Home</Link></Nav>
92
- * @see https://dhoulb.github.io/shelving/ui/block/Section/Nav
93
- */
94
- export function Nav(props: SectionProps): ReactElement {
95
- return renderSection("nav", props);
79
+ export function Footer({ as: Element = "section", children, ...variants }: SectionProps): ReactElement {
80
+ return <Element className={getSectionClass(variants)}>{children}</Element>;
96
81
  }
97
82
 
98
83
  /**
99
- * `<aside>` block with block-level spacing.
84
+ * `<article>` block with section-level spacing.
85
+ * - Use a `<Card>` instead to display boxed content.
100
86
  *
101
87
  * @kind component
102
- * @returns Rendered `<aside>` element.
103
- * @example <Aside width="narrow"><Paragraph>Sidebar</Paragraph></Aside>
104
- * @see https://dhoulb.github.io/shelving/ui/block/Section/Aside
88
+ * @returns Rendered `<article>` element.
89
+ * @see https://dhoulb.github.io/shelving/ui/block/Section/Article
105
90
  */
106
- export function Aside(props: SectionProps): ReactElement {
107
- return renderSection("aside", props);
91
+ export function Article({ as: Element = "article", children, ...variants }: SectionProps): ReactElement {
92
+ return <Element className={getSectionClass(variants)}>{children}</Element>;
108
93
  }
109
94
 
110
95
  /**
111
- * `<figure>` block with block-level spacing. Pair with `<Caption>` for `<figcaption>` content.
96
+ * `<figure>` block with section-level spacing.
97
+ * - Pair with `<Caption>` for `<figcaption>` content.
112
98
  *
113
99
  * @kind component
114
100
  * @returns Rendered `<figure>` element.
115
101
  * @example <Figure><Image src="/cat.jpg" /><Caption>A cat</Caption></Figure>
116
102
  * @see https://dhoulb.github.io/shelving/ui/block/Section/Figure
117
103
  */
118
- export function Figure(props: SectionProps): ReactElement {
119
- return renderSection("figure", props);
104
+ export function Figure({ as: Element = "figure", children, ...variants }: SectionProps): ReactElement {
105
+ return <Element className={getSectionClass(variants)}>{children}</Element>;
120
106
  }
@@ -1,8 +1,7 @@
1
1
  @import "../style/layers.css";
2
- @import "../style/Font.module.css";
3
- @import "../style/Size.module.css";
4
2
  @import "../style/Space.module.css";
5
- @import "../style/Weight.module.css";
3
+ @import "../style/Color.module.css";
4
+ @import "../style/Typography.module.css";
6
5
 
7
6
  @layer components {
8
7
  .subheading,
@@ -1,8 +1,7 @@
1
1
  @import "../style/layers.css";
2
- @import "../style/Font.module.css";
3
- @import "../style/Size.module.css";
2
+ @import "../style/Color.module.css";
4
3
  @import "../style/Space.module.css";
5
- @import "../style/Weight.module.css";
4
+ @import "../style/Typography.module.css";
6
5
 
7
6
  @layer components {
8
7
  .title,
package/ui/block/Video.js CHANGED
@@ -5,6 +5,7 @@ import { getSpaceClass } from "../style/Space.js";
5
5
  import { getWidthClass } from "../style/Width.js";
6
6
  import { getClass, getModuleClass } from "../util/css.js";
7
7
  import styles from "./Video.module.css";
8
+ const VIDEO_CLASS = getModuleClass(styles, "video");
8
9
  /**
9
10
  * Video container element.
10
11
  * - Has a black background and a 16:9 aspect ratio.
@@ -17,7 +18,8 @@ import styles from "./Video.module.css";
17
18
  */
18
19
  export function Video({ children, ...variants }) {
19
20
  const ref = useRef(null);
20
- return (_jsx("figure", { ref: ref, className: getClass(getModuleClass(styles, "video"), getSpaceClass(variants), getWidthClass(variants)), children: children }));
21
+ return (_jsx("figure", { ref: ref, className: getClass(VIDEO_CLASS, //
22
+ getSpaceClass(variants), getWidthClass(variants)), children: children }));
21
23
  }
22
24
  /**
23
25
  * Set of video buttons floating over a video.
@@ -6,6 +6,8 @@ import { getClass, getModuleClass } from "../util/css.js";
6
6
  import type { ChildProps, OptionalChildProps } from "../util/props.js";
7
7
  import styles from "./Video.module.css";
8
8
 
9
+ const VIDEO_CLASS = getModuleClass(styles, "video");
10
+
9
11
  /**
10
12
  * Props for `Video` — space and width variants plus optional `children`.
11
13
  *
@@ -48,7 +50,14 @@ export function Video({ children, ...variants }: VideoProps): ReactElement {
48
50
  const ref = useRef<HTMLElement | null>(null);
49
51
 
50
52
  return (
51
- <figure ref={ref} className={getClass(getModuleClass(styles, "video"), getSpaceClass(variants), getWidthClass(variants))}>
53
+ <figure
54
+ ref={ref}
55
+ className={getClass(
56
+ VIDEO_CLASS, //
57
+ getSpaceClass(variants),
58
+ getWidthClass(variants),
59
+ )}
60
+ >
52
61
  {children}
53
62
  </figure>
54
63
  );
@@ -1,13 +1,11 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Color.module.css";
3
3
  @import "../style/Duration.module.css";
4
- @import "../style/Font.module.css";
5
4
  @import "../style/Radius.module.css";
6
- @import "../style/Size.module.css";
7
5
  @import "../style/Space.module.css";
8
6
  @import "../style/Stroke.module.css";
9
7
  @import "../style/Tint.module.css";
10
- @import "../style/Weight.module.css";
8
+ @import "../style/Typography.module.css";
11
9
 
12
10
  @layer components {
13
11
  .button {
@@ -1,9 +1,8 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Color.module.css";
3
- @import "../style/Size.module.css";
3
+ @import "../style/Typography.module.css";
4
4
  @import "../style/Space.module.css";
5
5
  @import "../style/Tint.module.css";
6
- @import "../style/Weight.module.css";
7
6
 
8
7
  @layer components {
9
8
  .field {
@@ -1,13 +1,11 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Color.module.css";
3
3
  @import "../style/Duration.module.css";
4
- @import "../style/Font.module.css";
5
4
  @import "../style/Radius.module.css";
6
- @import "../style/Size.module.css";
7
5
  @import "../style/Space.module.css";
8
6
  @import "../style/Stroke.module.css";
9
7
  @import "../style/Tint.module.css";
10
- @import "../style/Weight.module.css";
8
+ @import "../style/Typography.module.css";
11
9
 
12
10
  @layer components {
13
11
  .input {
@@ -1,10 +1,8 @@
1
1
  @import "../style/layers.css";
2
- @import "../style/Font.module.css";
3
2
  @import "../style/Radius.module.css";
4
- @import "../style/Size.module.css";
5
3
  @import "../style/Space.module.css";
6
4
  @import "../style/Tint.module.css";
7
- @import "../style/Weight.module.css";
5
+ @import "../style/Typography.module.css";
8
6
 
9
7
  @layer components {
10
8
  .code,
@@ -1,7 +1,7 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Color.module.css";
3
3
  @import "../style/Stroke.module.css";
4
- @import "../style/Weight.module.css";
4
+ @import "../style/Typography.module.css";
5
5
 
6
6
  @layer components {
7
7
  .deleted,
@@ -1,7 +1,7 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Color.module.css";
3
3
  @import "../style/Stroke.module.css";
4
- @import "../style/Weight.module.css";
4
+ @import "../style/Typography.module.css";
5
5
 
6
6
  @layer components {
7
7
  .inserted,
@@ -1,7 +1,7 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Color.module.css";
3
3
  @import "../style/Stroke.module.css";
4
- @import "../style/Weight.module.css";
4
+ @import "../style/Typography.module.css";
5
5
 
6
6
  @layer components {
7
7
  .link,
@@ -1,6 +1,6 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Radius.module.css";
3
- @import "../style/Weight.module.css";
3
+ @import "../style/Typography.module.css";
4
4
 
5
5
  @layer components {
6
6
  .mark,
@@ -1,5 +1,5 @@
1
1
  @import "../style/layers.css";
2
- @import "../style/Weight.module.css";
2
+ @import "../style/Typography.module.css";
3
3
 
4
4
  @layer components {
5
5
  .small,
@@ -1,5 +1,5 @@
1
1
  @import "../style/layers.css";
2
- @import "../style/Weight.module.css";
2
+ @import "../style/Typography.module.css";
3
3
 
4
4
  @layer components {
5
5
  .strong,
@@ -1,12 +1,9 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Color.module.css";
3
- @import "../style/Font.module.css";
4
3
  @import "../style/Radius.module.css";
5
- @import "../style/Size.module.css";
6
4
  @import "../style/Space.module.css";
7
5
  @import "../style/Stroke.module.css";
8
- @import "../style/Tint.module.css";
9
- @import "../style/Weight.module.css";
6
+ @import "../style/Typography.module.css";
10
7
 
11
8
  @layer components {
12
9
  .menu {
@@ -1,5 +1,5 @@
1
1
  @import "../style/layers.css";
2
- @import "../style/Size.module.css";
2
+ @import "../style/Typography.module.css";
3
3
  @import "../style/Tint.module.css";
4
4
 
5
5
  @layer components {
@@ -1,5 +1,5 @@
1
1
  @import "../style/layers.css";
2
- @import "../style/Size.module.css";
2
+ @import "../style/Typography.module.css";
3
3
  @import "../style/Tint.module.css";
4
4
 
5
5
  @layer components {
@@ -1,12 +1,10 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Color.module.css";
3
- @import "../style/Font.module.css";
4
3
  @import "../style/Radius.module.css";
5
- @import "../style/Size.module.css";
6
4
  @import "../style/Space.module.css";
7
5
  @import "../style/Stroke.module.css";
8
6
  @import "../style/Tint.module.css";
9
- @import "../style/Weight.module.css";
7
+ @import "../style/Typography.module.css";
10
8
 
11
9
  @layer components {
12
10
  .tag {
@@ -1,6 +1,6 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Tint.module.css";
3
- @import "../style/Weight.module.css";
3
+ @import "../style/Typography.module.css";
4
4
 
5
5
  @layer components {
6
6
  .message {
@@ -1,10 +1,9 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Radius.module.css";
3
- @import "../style/Size.module.css";
3
+ @import "../style/Typography.module.css";
4
4
  @import "../style/Space.module.css";
5
5
  @import "../style/Stroke.module.css";
6
6
  @import "../style/Tint.module.css";
7
- @import "../style/Weight.module.css";
8
7
 
9
8
  @layer components {
10
9
  .notice {
package/ui/style/Flex.js CHANGED
@@ -13,7 +13,8 @@ import { getGapClass } from "./Gap.js";
13
13
  * @see https://dhoulb.github.io/shelving/ui/style/Flex/getFlexClass
14
14
  */
15
15
  export function getFlexClass(variants) {
16
- return getClass(getModuleClass(FLEX_CSS, "flex", variants), getGapClass(variants));
16
+ return getClass(getModuleClass(FLEX_CSS, "flex", variants), //
17
+ getGapClass(variants));
17
18
  }
18
19
  /**
19
20
  * Flex container that arranges its children as a row by default.
@@ -1,5 +1,5 @@
1
1
  @import "layers.css";
2
- @import "Size.module.css";
2
+ @import "Typography.module.css";
3
3
  @import "Space.module.css";
4
4
 
5
5
  @layer defaults {
package/ui/style/Flex.tsx CHANGED
@@ -81,7 +81,10 @@ export interface FlexVariants extends GapVariants {
81
81
  * @see https://dhoulb.github.io/shelving/ui/style/Flex/getFlexClass
82
82
  */
83
83
  export function getFlexClass(variants: FlexVariants): string {
84
- return getClass(getModuleClass(FLEX_CSS, "flex", variants), getGapClass(variants));
84
+ return getClass(
85
+ getModuleClass(FLEX_CSS, "flex", variants), //
86
+ getGapClass(variants),
87
+ );
85
88
  }
86
89
 
87
90
  /**
@@ -9,5 +9,5 @@ import PADDING_CSS from "./Padding.module.css";
9
9
  * @see https://dhoulb.github.io/shelving/ui/style/Padding/getPaddingClass
10
10
  */
11
11
  export function getPaddingClass({ padding }) {
12
- return padding && getModuleClass(PADDING_CSS, padding);
12
+ return padding && getModuleClass(PADDING_CSS, `padding-${padding}`);
13
13
  }
@@ -3,60 +3,60 @@
3
3
 
4
4
  @layer variants {
5
5
  /* Block-padding variants. */
6
- .none {
6
+ .padding-none {
7
7
  padding-block: 0;
8
8
  }
9
- .xxsmall {
9
+ .padding-xxsmall {
10
10
  padding-block: var(--space-xxsmall);
11
11
  }
12
- .xsmall {
12
+ .padding-xsmall {
13
13
  padding-block: var(--space-xsmall);
14
14
  }
15
- .small {
15
+ .padding-small {
16
16
  padding-block: var(--space-small);
17
17
  }
18
- .normal {
18
+ .padding-normal {
19
19
  padding-block: var(--space-normal);
20
20
  }
21
- .large {
21
+ .padding-large {
22
22
  padding-block: var(--space-large);
23
23
  }
24
- .xlarge {
24
+ .padding-xlarge {
25
25
  padding-block: var(--space-xlarge);
26
26
  }
27
- .xxlarge {
27
+ .padding-xxlarge {
28
28
  padding-block: var(--space-xxlarge);
29
29
  }
30
30
 
31
31
  /* Numeric block-padding multiples of `--space-normal` (`1x` … `10x`). */
32
- .\31 x {
32
+ .padding-1x {
33
33
  padding-block: calc(var(--space-normal) * 1);
34
34
  }
35
- .\32 x {
35
+ .padding-2x {
36
36
  padding-block: calc(var(--space-normal) * 2);
37
37
  }
38
- .\33 x {
38
+ .padding-3x {
39
39
  padding-block: calc(var(--space-normal) * 3);
40
40
  }
41
- .\34 x {
41
+ .padding-4x {
42
42
  padding-block: calc(var(--space-normal) * 4);
43
43
  }
44
- .\35 x {
44
+ .padding-5x {
45
45
  padding-block: calc(var(--space-normal) * 5);
46
46
  }
47
- .\36 x {
47
+ .padding-6x {
48
48
  padding-block: calc(var(--space-normal) * 6);
49
49
  }
50
- .\37 x {
50
+ .padding-7x {
51
51
  padding-block: calc(var(--space-normal) * 7);
52
52
  }
53
- .\38 x {
53
+ .padding-8x {
54
54
  padding-block: calc(var(--space-normal) * 8);
55
55
  }
56
- .\39 x {
56
+ .padding-9x {
57
57
  padding-block: calc(var(--space-normal) * 9);
58
58
  }
59
- .\31 0x {
59
+ .padding-10x {
60
60
  padding-block: calc(var(--space-normal) * 10);
61
61
  }
62
62
  }
@@ -45,5 +45,5 @@ export interface PaddingVariants {
45
45
  * @see https://dhoulb.github.io/shelving/ui/style/Padding/getPaddingClass
46
46
  */
47
47
  export function getPaddingClass({ padding }: PaddingVariants): string | undefined {
48
- return padding && getModuleClass(PADDING_CSS, padding);
48
+ return padding && getModuleClass(PADDING_CSS, `padding-${padding}`);
49
49
  }