shelving 1.260.3 → 1.262.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 (70) hide show
  1. package/package.json +1 -1
  2. package/ui/README.md +1 -1
  3. package/ui/block/Definitions.d.ts +1 -2
  4. package/ui/block/Definitions.tsx +1 -2
  5. package/ui/form/Button.d.ts +1 -2
  6. package/ui/form/Button.js +1 -2
  7. package/ui/form/Button.tsx +1 -3
  8. package/ui/form/CheckboxInput.js +0 -1
  9. package/ui/form/CheckboxInput.tsx +0 -1
  10. package/ui/form/RadioInput.js +0 -1
  11. package/ui/form/RadioInput.tsx +0 -1
  12. package/ui/inline/Code.d.ts +1 -2
  13. package/ui/inline/Code.md +4 -2
  14. package/ui/inline/Code.module.css +2 -2
  15. package/ui/inline/Code.tsx +1 -2
  16. package/ui/inline/Deleted.d.ts +4 -3
  17. package/ui/inline/Deleted.js +6 -4
  18. package/ui/inline/Deleted.md +34 -0
  19. package/ui/inline/Deleted.module.css +5 -3
  20. package/ui/inline/Deleted.tsx +16 -6
  21. package/ui/inline/Emphasis.d.ts +3 -2
  22. package/ui/inline/Emphasis.js +5 -3
  23. package/ui/inline/Emphasis.md +29 -0
  24. package/ui/inline/Emphasis.module.css +1 -1
  25. package/ui/inline/Emphasis.tsx +14 -4
  26. package/ui/inline/Inserted.d.ts +4 -3
  27. package/ui/inline/Inserted.js +5 -3
  28. package/ui/inline/Inserted.md +34 -0
  29. package/ui/inline/Inserted.module.css +5 -3
  30. package/ui/inline/Inserted.tsx +15 -5
  31. package/ui/inline/Link.d.ts +3 -2
  32. package/ui/inline/Link.js +4 -2
  33. package/ui/inline/Link.md +4 -2
  34. package/ui/inline/Link.module.css +3 -1
  35. package/ui/inline/Link.tsx +13 -4
  36. package/ui/inline/Mark.d.ts +3 -2
  37. package/ui/inline/Mark.js +6 -3
  38. package/ui/inline/Mark.md +6 -5
  39. package/ui/inline/Mark.module.css +12 -4
  40. package/ui/inline/Mark.tsx +16 -4
  41. package/ui/inline/Small.d.ts +3 -2
  42. package/ui/inline/Small.js +5 -3
  43. package/ui/inline/Small.md +30 -0
  44. package/ui/inline/Small.module.css +2 -1
  45. package/ui/inline/Small.tsx +14 -4
  46. package/ui/inline/Span.d.ts +19 -0
  47. package/ui/inline/Span.js +13 -0
  48. package/ui/inline/Span.md +33 -0
  49. package/ui/inline/Span.tsx +22 -0
  50. package/ui/inline/Strong.d.ts +3 -2
  51. package/ui/inline/Strong.js +5 -3
  52. package/ui/inline/Strong.md +5 -1
  53. package/ui/inline/Strong.module.css +1 -1
  54. package/ui/inline/Strong.tsx +14 -4
  55. package/ui/inline/index.d.ts +1 -0
  56. package/ui/inline/index.js +1 -0
  57. package/ui/inline/index.ts +1 -0
  58. package/ui/misc/Icon.d.ts +1 -1
  59. package/ui/misc/Icon.js +1 -2
  60. package/ui/misc/Icon.tsx +2 -3
  61. package/ui/misc/Tag.d.ts +1 -2
  62. package/ui/misc/Tag.js +1 -2
  63. package/ui/misc/Tag.tsx +1 -3
  64. package/ui/style/Block.d.ts +1 -2
  65. package/ui/style/Block.js +1 -2
  66. package/ui/style/Block.tsx +1 -3
  67. package/ui/style/Typography.d.ts +9 -5
  68. package/ui/style/Typography.js +6 -4
  69. package/ui/style/Typography.tsx +21 -14
  70. package/ui/style/getTypographyClass.md +1 -1
package/ui/inline/Link.md CHANGED
@@ -31,10 +31,12 @@ import { Link } from "shelving/ui";
31
31
 
32
32
  ## Styling
33
33
 
34
- `Link` exposes a couple of inline hooks; the link colour comes from the global `--color-link` token.
34
+ `Link` drives its colour through the tint ladder, so the `color` variant (`color="purple"`, `color="red"`, …) recolours the link. By default the `50` tint resolves to the global `--color-link` token.
35
35
 
36
36
  | Variable | Styles | Default |
37
37
  |---|---|---|
38
- | `--link-weight` | Text colour and font weight | `var(--color-link)` colour / `var(--weight-strong)` weight |
38
+ | `--link-tint` | Base tint (`--tint-50`) the link colour derives from | `var(--color-link)` |
39
+ | `--link-color` | Text colour | `var(--tint-50)` |
40
+ | `--link-weight` | Font weight | `var(--weight-strong)` |
39
41
 
40
42
  **Global tokens it reads:** `--color-link`, `--weight-strong`, and `--stroke-normal` (the underline thickness).
@@ -6,8 +6,10 @@
6
6
  @layer components {
7
7
  .link,
8
8
  .prose a {
9
+ --tint-50: var(--link-tint, var(--color-link));
10
+
9
11
  /* Style */
10
- color: var(--link-weight, var(--color-link));
12
+ color: var(--link-color, var(--tint-50));
11
13
  text-decoration: none;
12
14
  cursor: inherit;
13
15
 
@@ -1,16 +1,17 @@
1
1
  import type { ReactElement } from "react";
2
2
  import { Clickable, type ClickableProps } from "../form/Clickable.js";
3
- import { getModuleClass } from "../util/css.js";
3
+ import { getTypographyClass, type TypographyVariants } from "../style/Typography.js";
4
+ import { getClass, getModuleClass } from "../util/css.js";
4
5
  import LINK_CSS from "./Link.module.css";
5
6
 
6
7
  const LINK_CLASS = getModuleClass(LINK_CSS, "link");
7
8
 
8
9
  /**
9
- * Props for `Link` — identical to `ClickableProps` (`href` for navigation or `onClick` for actions).
10
+ * Props for `Link` — `ClickableProps` (`href` for navigation or `onClick` for actions) plus colour and typography variants.
10
11
  *
11
12
  * @see https://shelving.cc/ui/LinkProps
12
13
  */
13
- export interface LinkProps extends ClickableProps {}
14
+ export interface LinkProps extends ClickableProps, TypographyVariants {}
14
15
 
15
16
  /**
16
17
  * Inline link — delegates to `<Clickable>`, rendering an `<a>` (when `href` is set) or `<button>` (when `onClick` is set).
@@ -19,5 +20,13 @@ export interface LinkProps extends ClickableProps {}
19
20
  * @see https://shelving.cc/ui/Link
20
21
  */
21
22
  export function Link(props: LinkProps): ReactElement {
22
- return <Clickable {...props} className={LINK_CLASS} />;
23
+ return (
24
+ <Clickable
25
+ {...props}
26
+ className={getClass(
27
+ LINK_CLASS, //
28
+ getTypographyClass(props),
29
+ )}
30
+ />
31
+ );
23
32
  }
@@ -1,11 +1,12 @@
1
1
  import type { ReactElement } from "react";
2
+ import { type TypographyVariants } from "../style/Typography.js";
2
3
  import type { OptionalChildProps } from "../util/props.js";
3
4
  /**
4
5
  * Props for `Mark` — optional `children`.
5
6
  *
6
7
  * @see https://shelving.cc/ui/MarkProps
7
8
  */
8
- export interface MarkProps extends OptionalChildProps {
9
+ export interface MarkProps extends OptionalChildProps, TypographyVariants {
9
10
  }
10
11
  /**
11
12
  * Highlighted text — renders a `<mark>` element to call attention to a run of text.
@@ -13,4 +14,4 @@ export interface MarkProps extends OptionalChildProps {
13
14
  * @kind component
14
15
  * @see https://shelving.cc/ui/Mark
15
16
  */
16
- export declare function Mark({ children }: MarkProps): ReactElement;
17
+ export declare function Mark({ children, ...props }: MarkProps): ReactElement;
package/ui/inline/Mark.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getModuleClass } from "../util/css.js";
2
+ import { TINT_CLASS } from "../style/Tint.js";
3
+ import { getTypographyClass } from "../style/Typography.js";
4
+ import { getClass, getModuleClass } from "../util/css.js";
3
5
  import MARK_CSS from "./Mark.module.css";
4
6
  const MARK_CLASS = getModuleClass(MARK_CSS, "mark");
5
7
  /**
@@ -8,6 +10,7 @@ const MARK_CLASS = getModuleClass(MARK_CSS, "mark");
8
10
  * @kind component
9
11
  * @see https://shelving.cc/ui/Mark
10
12
  */
11
- export function Mark({ children }) {
12
- return _jsx("mark", { className: MARK_CLASS, children: children });
13
+ export function Mark({ children, ...props }) {
14
+ return (_jsx("mark", { className: getClass(MARK_CLASS, //
15
+ TINT_CLASS, getTypographyClass(props)), children: children }));
13
16
  }
package/ui/inline/Mark.md CHANGED
@@ -20,14 +20,15 @@ import { Mark } from "shelving/ui";
20
20
 
21
21
  ## Styling
22
22
 
23
- `Mark` is a fixed-palette highlight: it paints from dedicated colour hooks rather than the tint ladder.
23
+ `Mark` paints from the [tint ladder](/ui/TINT_CLASS): the `50` tint sets the background and the `00` tint the text. By default the base tint resolves to `--color-yellow`; override `--mark-tint` to recolour the whole pill, or `--mark-background` / `--mark-color` to set the two faces independently.
24
24
 
25
25
  | Variable | Styles | Default |
26
26
  |---|---|---|
27
- | `--mark-color-bg` | Background fill | `var(--light-yellow)` |
28
- | `--mark-color-text` | Text colour | `var(--dark-yellow)` |
29
- | `--mark-padding` | Inline padding | `0.375em` |
27
+ | `--mark-tint` | Base tint (`--tint-50`) the pill derives from | `var(--color-yellow)` |
28
+ | `--mark-background` | Background fill | `var(--tint-50)` |
29
+ | `--mark-color` | Text colour | `var(--tint-00)` |
30
+ | `--mark-padding` | Inline padding | `var(--space-xxsmall)` |
30
31
  | `--mark-radius` | Corner radius | `var(--radius-xxsmall)` |
31
32
  | `--mark-weight` | Font weight | `var(--weight-strong)` |
32
33
 
33
- **Global tokens it reads:** `--light-yellow`, `--dark-yellow`, `--radius-xxsmall`, and `--weight-strong`.
34
+ **Global tokens it reads:** `--color-yellow`, `--space-xxsmall`, `--radius-xxsmall`, `--weight-strong`, and the tint-ladder steps `--tint-50` / `--tint-00`.
@@ -1,16 +1,24 @@
1
1
  @import "../style/layers.css";
2
2
  @import "../style/Radius.module.css";
3
3
  @import "../style/Typography.module.css";
4
+ @import "../style/Tint.module.css";
4
5
 
5
6
  @layer components {
6
7
  .mark,
7
8
  .prose mark {
9
+ --tint-50: var(--mark-tint, var(--color-yellow));
10
+
11
+ /* Box */
8
12
  display: inline-block;
9
- vertical-align: text-bottom;
10
- padding-inline: var(--mark-padding, 0.375em);
13
+ padding-inline: var(--mark-padding, var(--space-xxsmall));
11
14
  border-radius: var(--mark-radius, var(--radius-xxsmall));
12
- background-color: var(--mark-color-bg, var(--light-yellow));
13
- color: var(--mark-color-text, var(--dark-yellow));
15
+ vertical-align: text-bottom;
16
+
17
+ /* Style */
18
+ background-color: var(--mark-background, var(--tint-50));
19
+ color: var(--mark-color, var(--tint-00));
20
+
21
+ /* Text */
14
22
  font-weight: var(--mark-weight, var(--weight-strong));
15
23
  }
16
24
  }
@@ -1,5 +1,7 @@
1
1
  import type { ReactElement } from "react";
2
- import { getModuleClass } from "../util/css.js";
2
+ import { TINT_CLASS } from "../style/Tint.js";
3
+ import { getTypographyClass, type TypographyVariants } from "../style/Typography.js";
4
+ import { getClass, getModuleClass } from "../util/css.js";
3
5
  import type { OptionalChildProps } from "../util/props.js";
4
6
  import MARK_CSS from "./Mark.module.css";
5
7
 
@@ -10,7 +12,7 @@ const MARK_CLASS = getModuleClass(MARK_CSS, "mark");
10
12
  *
11
13
  * @see https://shelving.cc/ui/MarkProps
12
14
  */
13
- export interface MarkProps extends OptionalChildProps {}
15
+ export interface MarkProps extends OptionalChildProps, TypographyVariants {}
14
16
 
15
17
  /**
16
18
  * Highlighted text — renders a `<mark>` element to call attention to a run of text.
@@ -18,6 +20,16 @@ export interface MarkProps extends OptionalChildProps {}
18
20
  * @kind component
19
21
  * @see https://shelving.cc/ui/Mark
20
22
  */
21
- export function Mark({ children }: MarkProps): ReactElement {
22
- return <mark className={MARK_CLASS}>{children}</mark>;
23
+ export function Mark({ children, ...props }: MarkProps): ReactElement {
24
+ return (
25
+ <mark
26
+ className={getClass(
27
+ MARK_CLASS, //
28
+ TINT_CLASS,
29
+ getTypographyClass(props),
30
+ )}
31
+ >
32
+ {children}
33
+ </mark>
34
+ );
23
35
  }
@@ -1,11 +1,12 @@
1
1
  import type { ReactElement } from "react";
2
+ import { type TypographyVariants } from "../style/Typography.js";
2
3
  import type { OptionalChildProps } from "../util/props.js";
3
4
  /**
4
5
  * Props for `Small` — optional `children`.
5
6
  *
6
7
  * @see https://shelving.cc/ui/SmallProps
7
8
  */
8
- export interface SmallProps extends OptionalChildProps {
9
+ export interface SmallProps extends OptionalChildProps, TypographyVariants {
9
10
  }
10
11
  /**
11
12
  * Small print — renders a `<small>` element for side comments and fine print.
@@ -14,4 +15,4 @@ export interface SmallProps extends OptionalChildProps {
14
15
  * @example <Small>Terms apply.</Small>
15
16
  * @see https://shelving.cc/ui/Small
16
17
  */
17
- export declare function Small({ children }: SmallProps): ReactElement;
18
+ export declare function Small({ children, ...props }: SmallProps): ReactElement;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getModuleClass } from "../util/css.js";
2
+ import { getTypographyClass } from "../style/Typography.js";
3
+ import { getClass, getModuleClass } from "../util/css.js";
3
4
  import SMALL_CSS from "./Small.module.css";
4
5
  const SMALL_CLASS = getModuleClass(SMALL_CSS, "small");
5
6
  /**
@@ -9,6 +10,7 @@ const SMALL_CLASS = getModuleClass(SMALL_CSS, "small");
9
10
  * @example <Small>Terms apply.</Small>
10
11
  * @see https://shelving.cc/ui/Small
11
12
  */
12
- export function Small({ children }) {
13
- return _jsx("small", { className: SMALL_CLASS, children: children });
13
+ export function Small({ children, ...props }) {
14
+ return (_jsx("small", { className: getClass(SMALL_CLASS, //
15
+ getTypographyClass(props)), children: children }));
14
16
  }
@@ -0,0 +1,30 @@
1
+ # Small
2
+
3
+ Small print — renders a `<small>` element for side comments and fine print such as disclaimers, attributions, and legal notes. Prefer it over a raw `<small>` inside React components so the semantics and class names stay consistent.
4
+
5
+ **Things to know:**
6
+
7
+ - It signals fine print semantically; it keeps the surrounding font size and weight, only muting the colour to a lighter tint step (`--tint-70`). Reach for the `size` typography variant if you also want smaller text.
8
+ - Inside `<Prose>` a raw `<small>` picks up the same styling, so Markdown-rendered fine print matches component ones.
9
+
10
+ ## Usage
11
+
12
+ ### Fine print after a statement
13
+
14
+ ```tsx
15
+ import { Paragraph, Small } from "shelving/ui";
16
+
17
+ <Paragraph>
18
+ Upgrade any time. <Small>Terms apply.</Small>
19
+ </Paragraph>
20
+ ```
21
+
22
+ ## Styling
23
+
24
+ `Small` mutes its text colour to a lighter tint step and inherits size and weight from its surroundings.
25
+
26
+ | Variable | Styles | Default |
27
+ |---|---|---|
28
+ | `--small-color` | Text colour | `var(--tint-70)` |
29
+
30
+ **Global tokens it reads:** the tint-ladder step `--tint-70`.
@@ -4,7 +4,8 @@
4
4
  @layer components {
5
5
  .small,
6
6
  .prose small {
7
- font-weight: var(--weight-normal);
7
+ font-weight: inherit;
8
8
  font-size: inherit;
9
+ color: var(--small-color, var(--tint-70));
9
10
  }
10
11
  }
@@ -1,5 +1,6 @@
1
1
  import type { ReactElement } from "react";
2
- import { getModuleClass } from "../util/css.js";
2
+ import { getTypographyClass, type TypographyVariants } from "../style/Typography.js";
3
+ import { getClass, getModuleClass } from "../util/css.js";
3
4
  import type { OptionalChildProps } from "../util/props.js";
4
5
  import SMALL_CSS from "./Small.module.css";
5
6
 
@@ -10,7 +11,7 @@ const SMALL_CLASS = getModuleClass(SMALL_CSS, "small");
10
11
  *
11
12
  * @see https://shelving.cc/ui/SmallProps
12
13
  */
13
- export interface SmallProps extends OptionalChildProps {}
14
+ export interface SmallProps extends OptionalChildProps, TypographyVariants {}
14
15
 
15
16
  /**
16
17
  * Small print — renders a `<small>` element for side comments and fine print.
@@ -19,6 +20,15 @@ export interface SmallProps extends OptionalChildProps {}
19
20
  * @example <Small>Terms apply.</Small>
20
21
  * @see https://shelving.cc/ui/Small
21
22
  */
22
- export function Small({ children }: SmallProps): ReactElement {
23
- return <small className={SMALL_CLASS}>{children}</small>;
23
+ export function Small({ children, ...props }: SmallProps): ReactElement {
24
+ return (
25
+ <small
26
+ className={getClass(
27
+ SMALL_CLASS, //
28
+ getTypographyClass(props),
29
+ )}
30
+ >
31
+ {children}
32
+ </small>
33
+ );
24
34
  }
@@ -0,0 +1,19 @@
1
+ import type { ReactElement } from "react";
2
+ import { type TypographyVariants } from "../style/Typography.js";
3
+ import type { OptionalChildProps } from "../util/props.js";
4
+ /**
5
+ * Props for `Span` — colour and typography variants, plus optional `children`.
6
+ *
7
+ * @see https://shelving.cc/ui/SpanProps
8
+ */
9
+ export interface SpanProps extends OptionalChildProps, TypographyVariants {
10
+ }
11
+ /**
12
+ * Styled inline text — renders a `<span>` carrying only the colour and typography variant classes, with no styling of its own.
13
+ * - Reach for it to apply variants (`size`, `weight`, `tint`, `color`, …) to a run of text that has no semantic meaning of its own.
14
+ *
15
+ * @kind component
16
+ * @example <Span weight="strong" tint="30">label</Span>
17
+ * @see https://shelving.cc/ui/Span
18
+ */
19
+ export declare function Span({ children, ...props }: SpanProps): ReactElement;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getTypographyClass } from "../style/Typography.js";
3
+ /**
4
+ * Styled inline text — renders a `<span>` carrying only the colour and typography variant classes, with no styling of its own.
5
+ * - Reach for it to apply variants (`size`, `weight`, `tint`, `color`, …) to a run of text that has no semantic meaning of its own.
6
+ *
7
+ * @kind component
8
+ * @example <Span weight="strong" tint="30">label</Span>
9
+ * @see https://shelving.cc/ui/Span
10
+ */
11
+ export function Span({ children, ...props }) {
12
+ return _jsx("span", { className: getTypographyClass(props), children: children });
13
+ }
@@ -0,0 +1,33 @@
1
+ # Span
2
+
3
+ Styled inline text — renders a `<span>` element that carries only the colour and typography variant classes you pass it, with no styling of its own. Reach for it when you need to apply variants to a run of text that has no semantic meaning, the inline counterpart to a styled `<div>`.
4
+
5
+ **Things to know:**
6
+
7
+ - It is purely presentational: use `<Strong>` for importance, `<Emphasis>` for stress emphasis, `<Mark>` for highlighting, and `<Small>` for fine print — `Span` is for everything that is _only_ a visual tweak.
8
+ - With no props it is an inert wrapper — it renders a bare `<span>` and changes nothing.
9
+ - It accepts the full [typography variants](/ui/TypographyVariants) (`size`, `weight`, `font`, `case`, `tint`, `left` / `center` / `right`, `wrap` / `nowrap`) and the [colour variant](/ui/ColorVariants) (`color`).
10
+ - `color` sets the [tint ladder](/ui/TINT_CLASS) for the span and its descendants; pair it with `tint` to actually paint the span's own text from a ladder step (e.g. `color="purple" tint="40"`).
11
+
12
+ ## Usage
13
+
14
+ ### Applying typography variants
15
+
16
+ ```tsx
17
+ import { Span } from "shelving/ui";
18
+
19
+ <p>Total <Span weight="strong">$35.00</Span> due today.</p>
20
+ <p><Span case="upper" size="xsmall">New</Span></p>
21
+ ```
22
+
23
+ ### Colouring a run of text
24
+
25
+ ```tsx
26
+ import { Span } from "shelving/ui";
27
+
28
+ <Span color="purple" tint="40">on-brand accent</Span>
29
+ ```
30
+
31
+ ## Styling
32
+
33
+ `Span` declares no CSS of its own — there are no theming hooks. All appearance comes from the colour and typography variant props, which apply shared variant classes from the design system.
@@ -0,0 +1,22 @@
1
+ import type { ReactElement } from "react";
2
+ import { getTypographyClass, type TypographyVariants } from "../style/Typography.js";
3
+ import type { OptionalChildProps } from "../util/props.js";
4
+
5
+ /**
6
+ * Props for `Span` — colour and typography variants, plus optional `children`.
7
+ *
8
+ * @see https://shelving.cc/ui/SpanProps
9
+ */
10
+ export interface SpanProps extends OptionalChildProps, TypographyVariants {}
11
+
12
+ /**
13
+ * Styled inline text — renders a `<span>` carrying only the colour and typography variant classes, with no styling of its own.
14
+ * - Reach for it to apply variants (`size`, `weight`, `tint`, `color`, …) to a run of text that has no semantic meaning of its own.
15
+ *
16
+ * @kind component
17
+ * @example <Span weight="strong" tint="30">label</Span>
18
+ * @see https://shelving.cc/ui/Span
19
+ */
20
+ export function Span({ children, ...props }: SpanProps): ReactElement {
21
+ return <span className={getTypographyClass(props)}>{children}</span>;
22
+ }
@@ -1,11 +1,12 @@
1
1
  import type { ReactElement } from "react";
2
+ import { type TypographyVariants } from "../style/Typography.js";
2
3
  import type { OptionalChildProps } from "../util/props.js";
3
4
  /**
4
5
  * Props for `Strong` — optional `children`.
5
6
  *
6
7
  * @see https://shelving.cc/ui/StrongProps
7
8
  */
8
- export interface StrongProps extends OptionalChildProps {
9
+ export interface StrongProps extends OptionalChildProps, TypographyVariants {
9
10
  }
10
11
  /**
11
12
  * Strong importance — renders a `<strong>` element for text of strong importance (typically bold).
@@ -13,4 +14,4 @@ export interface StrongProps extends OptionalChildProps {
13
14
  * @kind component
14
15
  * @see https://shelving.cc/ui/Strong
15
16
  */
16
- export declare function Strong({ children }: StrongProps): ReactElement;
17
+ export declare function Strong({ children, ...props }: StrongProps): ReactElement;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { getModuleClass } from "../util/css.js";
2
+ import { getTypographyClass } from "../style/Typography.js";
3
+ import { getClass, getModuleClass } from "../util/css.js";
3
4
  import STRONG_CSS from "./Strong.module.css";
4
5
  const STRONG_CLASS = getModuleClass(STRONG_CSS, "strong");
5
6
  /**
@@ -8,6 +9,7 @@ const STRONG_CLASS = getModuleClass(STRONG_CSS, "strong");
8
9
  * @kind component
9
10
  * @see https://shelving.cc/ui/Strong
10
11
  */
11
- export function Strong({ children }) {
12
- return _jsx("strong", { className: STRONG_CLASS, children: children });
12
+ export function Strong({ children, ...props }) {
13
+ return (_jsx("strong", { className: getClass(STRONG_CLASS, //
14
+ getTypographyClass(props)), children: children }));
13
15
  }
@@ -22,6 +22,10 @@ import { Paragraph, Strong } from "shelving/ui";
22
22
 
23
23
  ## Styling
24
24
 
25
- `Strong` has no own theming hooks — it sets `font-weight: var(--weight-strong)` and inherits everything else from its surroundings.
25
+ `Strong` only sets its font weight and inherits colour and size from its surroundings.
26
+
27
+ | Variable | Styles | Default |
28
+ |---|---|---|
29
+ | `--strong-weight` | Font weight | `var(--weight-strong)` |
26
30
 
27
31
  **Global tokens it reads:** `--weight-strong`.
@@ -5,6 +5,6 @@
5
5
  .strong,
6
6
  .prose :is(strong, b) {
7
7
  /* Style */
8
- font-weight: var(--weight-strong);
8
+ font-weight: var(--strong-weight, var(--weight-strong));
9
9
  }
10
10
  }
@@ -1,5 +1,6 @@
1
1
  import type { ReactElement } from "react";
2
- import { getModuleClass } from "../util/css.js";
2
+ import { getTypographyClass, type TypographyVariants } from "../style/Typography.js";
3
+ import { getClass, getModuleClass } from "../util/css.js";
3
4
  import type { OptionalChildProps } from "../util/props.js";
4
5
  import STRONG_CSS from "./Strong.module.css";
5
6
 
@@ -10,7 +11,7 @@ const STRONG_CLASS = getModuleClass(STRONG_CSS, "strong");
10
11
  *
11
12
  * @see https://shelving.cc/ui/StrongProps
12
13
  */
13
- export interface StrongProps extends OptionalChildProps {}
14
+ export interface StrongProps extends OptionalChildProps, TypographyVariants {}
14
15
 
15
16
  /**
16
17
  * Strong importance — renders a `<strong>` element for text of strong importance (typically bold).
@@ -18,6 +19,15 @@ export interface StrongProps extends OptionalChildProps {}
18
19
  * @kind component
19
20
  * @see https://shelving.cc/ui/Strong
20
21
  */
21
- export function Strong({ children }: StrongProps): ReactElement {
22
- return <strong className={STRONG_CLASS}>{children}</strong>;
22
+ export function Strong({ children, ...props }: StrongProps): ReactElement {
23
+ return (
24
+ <strong
25
+ className={getClass(
26
+ STRONG_CLASS, //
27
+ getTypographyClass(props),
28
+ )}
29
+ >
30
+ {children}
31
+ </strong>
32
+ );
23
33
  }
@@ -5,6 +5,7 @@ export * from "./Inserted.js";
5
5
  export * from "./Link.js";
6
6
  export * from "./Mark.js";
7
7
  export * from "./Small.js";
8
+ export * from "./Span.js";
8
9
  export * from "./Strong.js";
9
10
  export * from "./Subscript.js";
10
11
  export * from "./Superscript.js";
@@ -5,6 +5,7 @@ export * from "./Inserted.js";
5
5
  export * from "./Link.js";
6
6
  export * from "./Mark.js";
7
7
  export * from "./Small.js";
8
+ export * from "./Span.js";
8
9
  export * from "./Strong.js";
9
10
  export * from "./Subscript.js";
10
11
  export * from "./Superscript.js";
@@ -5,6 +5,7 @@ export * from "./Inserted.js";
5
5
  export * from "./Link.js";
6
6
  export * from "./Mark.js";
7
7
  export * from "./Small.js";
8
+ export * from "./Span.js";
8
9
  export * from "./Strong.js";
9
10
  export * from "./Subscript.js";
10
11
  export * from "./Superscript.js";
package/ui/misc/Icon.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType, ReactElement } from "react";
2
- import { type ColorVariants } from "../style/Color.js";
2
+ import type { ColorVariants } from "../style/Color.js";
3
3
  import type { SpaceVariants } from "../style/Space.js";
4
4
  import { type StatusVariants } from "../style/Status.js";
5
5
  import type { TintVariant } from "../style/Tint.js";
package/ui/misc/Icon.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { CheckCircleIcon, ExclamationTriangleIcon, InformationCircleIcon, XCircleIcon } from "@heroicons/react/24/solid";
3
- import { getColorClass } from "../style/Color.js";
4
3
  import { getStatusClass } from "../style/Status.js";
5
4
  import { getTypographyClass } from "../style/Typography.js";
6
5
  import { getClass, getModuleClass } from "../util/css.js";
@@ -24,5 +23,5 @@ const STATUS_ICONS = {
24
23
  export function Icon(props) {
25
24
  const { status = "info", icon: Element = STATUS_ICONS[status] ?? InformationCircleIcon } = props;
26
25
  return (_jsx(Element, { className: getClass(getModuleClass(ICON_CSS, "icon"), //
27
- getColorClass(props), getStatusClass(props), getTypographyClass(props)) }));
26
+ getStatusClass(props), getTypographyClass(props)) }));
28
27
  }
package/ui/misc/Icon.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { CheckCircleIcon, ExclamationTriangleIcon, InformationCircleIcon, XCircleIcon } from "@heroicons/react/24/solid";
2
2
  import type { ComponentType, ReactElement } from "react";
3
- import { type ColorVariants, getColorClass } from "../style/Color.js";
3
+ import type { ColorVariants } from "../style/Color.js";
4
4
  import type { SpaceVariants } from "../style/Space.js";
5
5
  import { getStatusClass, type Status, type StatusVariants } from "../style/Status.js";
6
6
  import type { TintVariant } from "../style/Tint.js";
@@ -55,9 +55,8 @@ export function Icon(props: IconProps): ReactElement {
55
55
  <Element
56
56
  className={getClass(
57
57
  getModuleClass(ICON_CSS, "icon"), //
58
- getColorClass(props),
59
58
  getStatusClass(props),
60
- getTypographyClass(props), // Used for size and tint.
59
+ getTypographyClass(props), // Used for colour, size, and tint.
61
60
  )}
62
61
  />
63
62
  );
package/ui/misc/Tag.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { ReactElement } from "react";
2
2
  import { type ClickableProps } from "../form/Clickable.js";
3
- import { type ColorVariants } from "../style/Color.js";
4
3
  import { type StatusVariants } from "../style/Status.js";
5
4
  import { type TypographyVariants } from "../style/Typography.js";
6
5
  /**
@@ -8,7 +7,7 @@ import { type TypographyVariants } from "../style/Typography.js";
8
7
  *
9
8
  * @see https://shelving.cc/ui/TagVariants
10
9
  */
11
- export interface TagVariants extends StatusVariants, ColorVariants, TypographyVariants {
10
+ export interface TagVariants extends StatusVariants, TypographyVariants {
12
11
  }
13
12
  /**
14
13
  * Build the combined `className` string for a `<Tag>` from its styling variants.
package/ui/misc/Tag.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Clickable } from "../form/Clickable.js";
3
- import { getColorClass } from "../style/Color.js";
4
3
  import { getStatusClass } from "../style/Status.js";
5
4
  import { getTypographyClass } from "../style/Typography.js";
6
5
  import { getClass, getModuleClass } from "../util/css.js";
@@ -16,7 +15,7 @@ const TAG_CLASS = getModuleClass(TAG_CSS, "tag");
16
15
  */
17
16
  export function getTagClass(variants) {
18
17
  return getClass(TAG_CLASS, //
19
- getStatusClass(variants), getColorClass(variants), getTypographyClass(variants));
18
+ getStatusClass(variants), getTypographyClass(variants));
20
19
  }
21
20
  /**
22
21
  * Small inline label used to annotate other content.
package/ui/misc/Tag.tsx CHANGED
@@ -1,6 +1,5 @@
1
1
  import type { ReactElement } from "react";
2
2
  import { Clickable, type ClickableProps } from "../form/Clickable.js";
3
- import { type ColorVariants, getColorClass } from "../style/Color.js";
4
3
  import { getStatusClass, type StatusVariants } from "../style/Status.js";
5
4
  import { getTypographyClass, type TypographyVariants } from "../style/Typography.js";
6
5
  import { getClass, getModuleClass } from "../util/css.js";
@@ -13,7 +12,7 @@ const TAG_CLASS = getModuleClass(TAG_CSS, "tag");
13
12
  *
14
13
  * @see https://shelving.cc/ui/TagVariants
15
14
  */
16
- export interface TagVariants extends StatusVariants, ColorVariants, TypographyVariants {}
15
+ export interface TagVariants extends StatusVariants, TypographyVariants {}
17
16
 
18
17
  /**
19
18
  * Build the combined `className` string for a `<Tag>` from its styling variants.
@@ -27,7 +26,6 @@ export function getTagClass(variants: TagVariants) {
27
26
  return getClass(
28
27
  TAG_CLASS, //
29
28
  getStatusClass(variants),
30
- getColorClass(variants),
31
29
  getTypographyClass(variants),
32
30
  );
33
31
  }
@@ -1,4 +1,3 @@
1
- import { type ColorVariants } from "./Color.js";
2
1
  import { type IndentVariants } from "./Indent.js";
3
2
  import { type PaddingVariants } from "./Padding.js";
4
3
  import { type SpaceVariants } from "./Space.js";
@@ -9,7 +8,7 @@ import { type WidthVariants } from "./Width.js";
9
8
  *
10
9
  * @see https://shelving.cc/ui/BlockVariants
11
10
  */
12
- export interface BlockVariants extends ColorVariants, IndentVariants, SpaceVariants, PaddingVariants, TypographyVariants, WidthVariants {
11
+ export interface BlockVariants extends IndentVariants, SpaceVariants, PaddingVariants, TypographyVariants, WidthVariants {
13
12
  }
14
13
  /**
15
14
  * Get the combined `className` string for a block from its styling variants.