@jonmilner/ui 0.11.10 → 0.11.11

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.
@@ -20,8 +20,9 @@ var t = "_1ixfil10", n = e({
20
20
  false: "_1ixfil19"
21
21
  },
22
22
  size: {
23
- sm: "_1ixfil1a",
24
- med: "_1ixfil1b"
23
+ xs: "_1ixfil1a",
24
+ sm: "_1ixfil1b",
25
+ med: "_1ixfil1c"
25
26
  }
26
27
  },
27
28
  defaultVariants: {},
@@ -3,7 +3,7 @@ import { StyleProps } from "../Box/base.mjs";
3
3
  import { Tone } from "../styles/subtle-fills.mjs";
4
4
  import { ComponentPropsWithRef } from "react";
5
5
  export type BadgeOwnProps = {
6
- size?: "sm" | "med";
6
+ size?: "xs" | "sm" | "med";
7
7
  subtle?: boolean;
8
8
  variant?: Tone;
9
9
  };
@@ -31,6 +31,10 @@ var s = {
31
31
  color: "doneFg"
32
32
  }
33
33
  }, c = {
34
+ xs: {
35
+ paddingInline: "4",
36
+ paddingBlock: "2"
37
+ },
34
38
  sm: {
35
39
  paddingInline: "6",
36
40
  paddingBlock: "4"
@@ -23,7 +23,7 @@ A static label that states the status of, or a short fact about, the thing besid
23
23
 
24
24
  - `variant`: `neutral` (default, `fgMuted` on `bgMuted`) for most statuses and facts; `accent` (`accentFg` on `accent`) to draw the eye; `success` (`successFg` on `success`) for a passing or healthy state; `warning` (`warningFg` on `warning`) for one that needs attention soon; `danger` (`dangerFg` on `danger`) for a failure or a blocked state; `done` (`doneFg` on `done`, violet) for finished work, such as a merged PR or a closed issue.
25
25
  - `subtle`: `false` (default) is the solid fill above; `true` swaps it for the variant's tint, `<variant>SubtleFg` on `<variant>Subtle` (`neutralSubtleFg` on `neutralSubtle` and so on). Use subtle where many badges sit together, such as a list or a board, so each one stays calm and the color still means one thing; keep solid for the one status that should stand out.
26
- - `size`: `sm` or `med` (default), the label's `fontSize` step.
26
+ - `size`: `xs`, `sm` or `med` (default), the label's `fontSize` step. Use `xs` (a 12px label, 4px by 2px padding) in dense rows and narrow table cells, such as a board column of status pills; keep `sm` or `med` elsewhere, since `xs` is the smallest readable label. An icon in a badge takes the badge's step as its icon `size` (ADR 0044): `xs` in an `xs` badge.
27
27
  - The label states the state. Color is never the only cue (WCAG 1.4.1): under forced colors every variant, `success` and `warning` included, is the same outlined box, and some readers cannot tell the fills apart (green from red above all). Write "Failed" or "Passed", not a red or green badge reading "3".
28
28
  - Keep it to one or two words; it never wraps. With no children it renders nothing.
29
29
  - Fill, text color, padding, radius and `display` (`inline-block`) are default style props on the outer `span`; a consumer's win. `className`, `style` and `ref` go to it, `className` last. The box holds inside a `Text` or `Heading` too.
@@ -52,6 +52,13 @@ A static label that states the status of, or a short fact about, the thing besid
52
52
  </Badge>
53
53
  ```
54
54
 
55
+ ```tsx
56
+ // A narrow board column or table cell: xs is the narrowest pill that still reads.
57
+ <Badge size="xs" subtle variant="warning">
58
+ Changes requested
59
+ </Badge>
60
+ ```
61
+
55
62
  ## Don't
56
63
 
57
64
  ```tsx
@@ -79,7 +86,7 @@ Generated from the TypeScript types.
79
86
 
80
87
  | Prop | Type | Required | Description |
81
88
  | --- | --- | --- | --- |
82
- | `size` | `"med" \| "sm"` | no | |
89
+ | `size` | `"med" \| "sm" \| "xs"` | no | |
83
90
  | `subtle` | `boolean` | no | |
84
91
  | `variant` | `"accent" \| "danger" \| "done" \| "neutral" \| "success" \| "warning"` | no | |
85
92
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./manifest.schema.json",
3
3
  "package": "@jonmilner/ui",
4
- "version": "0.11.10",
4
+ "version": "0.11.11",
5
5
  "components": [
6
6
  {
7
7
  "name": "AlertDialog",
@@ -168,11 +168,12 @@
168
168
  "props": [
169
169
  {
170
170
  "name": "size",
171
- "type": "\"med\" | \"sm\"",
171
+ "type": "\"med\" | \"sm\" | \"xs\"",
172
172
  "required": false,
173
173
  "values": [
174
174
  "med",
175
- "sm"
175
+ "sm",
176
+ "xs"
176
177
  ]
177
178
  },
178
179
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jonmilner/ui",
3
- "version": "0.11.10",
3
+ "version": "0.11.11",
4
4
  "files": [
5
5
  "dist",
6
6
  "THIRD_PARTY_NOTICES.md"