@crewlethq/ui 0.49.1 → 0.51.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.
- package/README.md +34 -0
- package/dist/ArtifactCard/index.js +1 -1
- package/dist/{ArtifactCard-SOB63NV5.css → ArtifactCard-F7IVRL3A.css} +3 -0
- package/dist/AvatarPicker/index.js +2 -2
- package/dist/BrandSample/index.js +3 -3
- package/dist/BrandScope/index.js +2 -2
- package/dist/Callout/index.js +1 -1
- package/dist/{Callout-ZAVG3P66.css → Callout-G3N3IE6M.css} +9 -0
- package/dist/ColorChip/ColorChip.d.ts +26 -0
- package/dist/ColorChip/index.d.ts +3 -0
- package/dist/ColorChip/index.js +3 -0
- package/dist/ColorChip-A5XHTH3J.css +46 -0
- package/dist/ColorField/ColorField.d.ts +16 -8
- package/dist/ColorField/index.js +2 -2
- package/dist/ColorSwatch/index.js +2 -2
- package/dist/ContrastBadge/ContrastBadge.d.ts +38 -3
- package/dist/ContrastBadge/index.d.ts +2 -2
- package/dist/ContrastBadge/index.js +2 -2
- package/dist/ContrastHelp/ContrastHelp.d.ts +40 -0
- package/dist/ContrastHelp/index.d.ts +3 -0
- package/dist/ContrastHelp/index.js +12 -0
- package/dist/ContrastHelp-MZCAW5WQ.css +43 -0
- package/dist/DataView/index.js +2 -2
- package/dist/EditingStatus/EditingStatus.d.ts +13 -1
- package/dist/EditingStatus/index.js +3 -1
- package/dist/{EditingStatus-NNA2CKIL.css → EditingStatus-YU7EGM6Y.css} +22 -7
- package/dist/FolderTile/index.js +1 -1
- package/dist/{FolderTile-FDT5Y63Z.css → FolderTile-MIUEB7SO.css} +12 -5
- package/dist/FollowBanner/index.js +2 -2
- package/dist/InlineEditor/index.js +4 -2
- package/dist/LinkInterstitial/index.js +2 -2
- package/dist/ListInput/ListInput.d.ts +3 -1
- package/dist/ListInput/index.js +1 -1
- package/dist/{ListInput-WUP2YITQ.css → ListInput-P2ECUQJ2.css} +1 -1
- package/dist/LogoSlot/index.js +3 -3
- package/dist/RichEditor/index.js +2 -2
- package/dist/SandboxedFrame/index.js +2 -2
- package/dist/SetupWizard/SetupWizard.d.ts +87 -0
- package/dist/SetupWizard/index.d.ts +3 -0
- package/dist/SetupWizard/index.js +11 -0
- package/dist/SetupWizard-GZK5UDKC.css +223 -0
- package/dist/ShareDialog/index.js +2 -2
- package/dist/Stepper/Stepper.d.ts +60 -11
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/Stepper-QEJI5RGX.css +355 -0
- package/dist/{chunk-ITI2Z44C.js → chunk-2UFUP2ZH.js} +2 -2
- package/dist/{chunk-4A4QG6UC.js → chunk-34C7NYIQ.js} +1 -1
- package/dist/chunk-6GTTRJWJ.js +24 -0
- package/dist/{chunk-7P336RA5.js → chunk-6RMZH7P7.js} +1 -1
- package/dist/{chunk-W6FOEBIL.js → chunk-73WHPLWQ.js} +24 -15
- package/dist/chunk-7W3LYIOC.js +27 -0
- package/dist/{chunk-OEEYL2CM.js → chunk-AVMQMY66.js} +2 -2
- package/dist/{chunk-SZZRIHGT.js → chunk-BPCY7ZID.js} +1 -1
- package/dist/chunk-DTSZUH6H.js +124 -0
- package/dist/chunk-EJWPYEG4.js +38 -0
- package/dist/{chunk-M4QM477B.js → chunk-FXHWOXGD.js} +1 -1
- package/dist/{chunk-7PCDKRNB.js → chunk-KHP7TJF7.js} +2 -2
- package/dist/chunk-KIRQZG3G.js +53 -0
- package/dist/chunk-LDGQIDIZ.js +129 -0
- package/dist/{chunk-JFDIMO3A.js → chunk-PGYIDNGG.js} +1 -1
- package/dist/{chunk-WLSEAIVC.js → chunk-RHPBTE3F.js} +1 -1
- package/dist/{chunk-Q44X36QC.js → chunk-S63QOMXC.js} +1 -1
- package/dist/{chunk-GP4YWZFO.js → chunk-U3LNU4B2.js} +1 -1
- package/dist/{chunk-PGR2PKH6.js → chunk-UUTEWGO6.js} +10 -10
- package/dist/{chunk-356JNSER.js → chunk-WQQ5T5SA.js} +1 -1
- package/dist/{chunk-B235ANDO.js → chunk-WW7TU6HE.js} +34 -16
- package/dist/{chunk-P3OIM6OC.js → chunk-X7WEE3EK.js} +1 -1
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.js +76 -73
- package/dist/index.js +76 -73
- package/dist/styles.css +564 -30
- package/dist/utils/hexColour.d.ts +13 -0
- package/package.json +3 -3
- package/dist/Stepper-HW4JM3YH.css +0 -176
- package/dist/chunk-5QWIJSQM.js +0 -73
- package/dist/chunk-MULOZYHL.js +0 -30
- package/dist/chunk-UZMNR366.js +0 -9
- package/dist/{Editor-ZYDXHGJE.js → Editor-MLGK3KOG.js} +1 -1
- package/dist/{chunk-3QSKDZR5.js → chunk-EW2N4FOD.js} +1 -1
- package/dist/{chunk-3WMOEGEL.js → chunk-P432I5DQ.js} +0 -0
- package/dist/{chunk-NAWUXCBC.js → chunk-WX6IJJ4U.js} +1 -1
package/README.md
CHANGED
|
@@ -204,6 +204,40 @@ places:
|
|
|
204
204
|
- A surface that pans or zooms dispatches `LAYER_REPOSITION_EVENT` on its host
|
|
205
205
|
when the content beneath it moves, and every panel anchored inside follows.
|
|
206
206
|
|
|
207
|
+
## Changes in 0.51.0
|
|
208
|
+
|
|
209
|
+
Polish of the setup wizard pieces, and the parts the brand setup asked for.
|
|
210
|
+
|
|
211
|
+
**`ColorField` draws its `#` and reads more than six digits.** The `#` is drawn at the start of the field, so a person types the six hex digits alone, and a pasted `#rrggbb` loses its own `#` to it. When the reader leaves the field (Enter or Tab), `rrggbb`, the three digit shorthand and `rgb(r, g, b)` or `rgb(r g b)` are normalised to lowercase `#rrggbb`; anything else is refused with one sentence. Six digits are still reported as they are typed, and `onChange` still receives only a colour, or `''` for an emptied optional field. What to change: a test that reads the text field's value reads the six digits without the `#`. The default `labels.invalid` and `labels.placeholder` changed, and `labels.prefix` is new.
|
|
212
|
+
|
|
213
|
+
**`ContrastHelp` is new**: a small info button beside a contrast heading that opens a short panel saying what AA, AAA and Low or Fails mean, each drawn as `ContrastBadge` draws it. It is a `Popover` the button toggles, so it opens by touch and from the keyboard, and closes on Escape with focus handed back. Place it beside the heading, not inside it. `ContrastLevelTag` is the one drawing of a level, shared by the badge and the panel.
|
|
214
|
+
|
|
215
|
+
**`ColorChip` is new**: a colour as a small decorative chip (12px `xs` or 16px `sm`, round or square) with an edge of its own and the hatch of no colour, for the mark on a button that applies a suggested colour.
|
|
216
|
+
|
|
217
|
+
**`SetupWizard` takes `footerStart` and `wide`.** `footerStart` stands at the start of the footer row (the way out), with `footer`, the step's actions, held at its end. `wide` lets a step that lays out columns of its own take the whole width beside the rail. A wizard with no `aside` no longer holds an empty 320px column from 70rem.
|
|
218
|
+
|
|
219
|
+
**`Callout`'s actions stand one step apart.** The action slot is a wrapping row with the kit's step between, so two actions never draw touching.
|
|
220
|
+
|
|
221
|
+
**`EditingStatus` reads cleanly.** Its text is "Draft Saved 24s ago", drawn "Draft · Saved 24s ago": no hidden comma and no second "Saved". The live region holds only the label and the state, and the time follows it in a `time` element outside the region, so it is shown and never announced. What to change: `labels.saved` is now the word alone (`'Saved'`), and `labels.savedSpoken` is gone. A test that reads `getByRole('status')` reads the label and the state only.
|
|
222
|
+
|
|
223
|
+
**`ListInput` ends its new-item row with an Add button.** The add control no longer floats beside the legend as a `+` square: it is a text button at the end of the box's own row, with or without a shown legend, beside Enter. It shows `addText` ("Add") and is named by `addLabel` ("Add policy").
|
|
224
|
+
|
|
225
|
+
**Folder tiles are set on the artifact card's type scale.** A `FolderTile`'s name and facts take a gallery card's title and facts steps at every width, on one 1.35 line height with the card's step between; a row, and a tile on a phone, no longer drop to smaller steps beside cards that keep theirs. `ArtifactCard`'s gallery facts take the title's line height. `ArtifactNameCell` is unchanged: a folder's row in the list is set as every artifact's row there.
|
|
226
|
+
|
|
227
|
+
## Changes in 0.50.0
|
|
228
|
+
|
|
229
|
+
The pieces of a setup a person walks step by step, first used by the brand setup.
|
|
230
|
+
|
|
231
|
+
**`SetupWizard` is new**: a page of its own for a setup walked step by step. The header is a `PageHeader` title with the trail above it (`trail`) and the draft's status (`status`) and the way out (`actions`) beside it. The rail is a `nav` named by `stepsLabel`, holding a vertical `Stepper` of `steps` with `current`, `reached` and `onSelect`. The content is a `section` named by the step's `heading`, with a `lead` sentence and the step's fields (`children`) in one column of at most 640px. The optional `aside` is a complementary landmark named by `asideLabel` (required with it), held in view beside the content. The `footer` holds the step's actions at the bottom of the view, above the device's safe area. From 70rem of the wizard's own width the rail, the content and the aside stand side by side (240px, the content, 320px); under that, as in a 1024px window beside the application's rail, the aside moves under the content. Under the phone breakpoint the rail becomes a row of steps under "Step 3 of 6 · Colours" (`labels.progress`) and the aside folds into a disclosure (`labels.asideToggle`, "Preview"). Focus moves to the step's heading when the step changes, and the step's content and the aside start one heading level under it.
|
|
232
|
+
|
|
233
|
+
**`Stepper` takes `orientation`, a per-step `status` and `description`, and `onSelect`.** `orientation="vertical"` draws a column of rows: a 20px mark per step (the check, the dot, the warning glyph, or the step's number) on a hairline that joins them, the label beside it, and the description and the status words under it, with the current row lifted as the sidebar's is. A step's `status` (`done`, `current`, `upcoming`, `optional` or `attention`) draws it where its position does not say it all: an optional step says "Optional" (`optionalLabel`), and one that needs attention carries the warning glyph on the warning tint and says "Needs attention" (`attentionLabel`); in a row the words are said rather than shown. The current step is always drawn current, and `status: 'current'` on any other step is refused. With `onSelect`, every visited step (the current one, every step before it, and every step up to `reached`) is a button, the current one carrying `aria-current="step"`, and a step not reached yet stays words rather than a disabled button. The horizontal row draws exactly as before; its step-still-to-come class is now `crewlet-stepper__step--upcoming` (it was `--later`).
|
|
234
|
+
|
|
235
|
+
**`ContrastBadge` takes `advisory`**: under its scale's AA floor the badge reads "Low" in the warning tone with the warning glyph (`crewlet-contrast-badge--low`), rather than "AA large text" or "Fails" in the danger tone, for a pair a person is told about and may keep. A pair that blocks leaves it off and keeps today's behaviour. `labels.levels` now takes any of the level words on its own (`ContrastBadgeLabelsInput`), and the drawn level is typed `ContrastBadgeLevel`.
|
|
236
|
+
|
|
237
|
+
**`EditingStatus` takes `savedAt`**: with nothing unsaved and no save in flight, the status says how long ago the last save landed (`labels.saved`, "Saved 2m ago"; "Draft · Saved 2m ago" with `labels.editing` "Draft"). The time follows the shared clock and is hidden from the live region, which says "Saved" (`labels.savedSpoken`) once rather than every minute.
|
|
238
|
+
|
|
239
|
+
**`@crewlethq/tokens` exports `nearestContrastShade(hex, ground, min)`**: the colour nearest `hex` that clears `min` against `ground`, keeping its hue and moving only its OKLab lightness, or `null` when no shade can. `#00baba` on `#f6f7fb` gives `#007f7f` at 4.5:1. It is the one implementation a "Use #007f7f (4.51:1)" suggestion is computed with; see the tokens README.
|
|
240
|
+
|
|
207
241
|
## Changes in 0.49.1
|
|
208
242
|
|
|
209
243
|
**`@crewlethq/tokens` keeps its palettes and its theme registry in modules of their own.** The `themes` object (both palettes, every value) was generated into the same module as `themeRegistry`, `themeGroups`, `DEFAULT_THEME_ID` and `isThemeId`, and a bundler keeps a module whole in the chunk that first needs it: an application that reads the registry at boot (a theme preference) carried every palette value in its entry as soon as any later screen imported `themes` (since 0.47.0, `LogoSlot`), about 8 KB raw and 2 KB gzipped on every first paint of the engine dashboard. `themes` now comes from a module of its own (`dist/palettes.js`), so a consumer of the registry never carries it and the palettes land in the chunk that uses them. The package's exports are unchanged: `import { themes, themeRegistry } from '@crewlethq/tokens'` works as before.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ArtifactCard, ArtifactCardSkeleton, ArtifactPreviewGlyph } from '../chunk-
|
|
1
|
+
export { ArtifactCard, ArtifactCardSkeleton, ArtifactPreviewGlyph } from '../chunk-S63QOMXC.js';
|
|
2
2
|
import '../chunk-TEUQWOWZ.js';
|
|
3
3
|
import '../chunk-CI3VPIJN.js';
|
|
4
4
|
import '../chunk-3CZ7XAVY.js';
|
|
@@ -215,6 +215,9 @@
|
|
|
215
215
|
|
|
216
216
|
.crewlet-artifact-card--card .crewlet-artifact-card__facts {
|
|
217
217
|
font-size: var(--font-size-sm);
|
|
218
|
+
/* The title's line height, so a card's words and a folder tile's beside it
|
|
219
|
+
keep one rhythm. */
|
|
220
|
+
line-height: 1.35;
|
|
218
221
|
}
|
|
219
222
|
|
|
220
223
|
.crewlet-artifact-card__meta {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { AvatarPicker } from '../chunk-
|
|
1
|
+
export { AvatarPicker } from '../chunk-EW2N4FOD.js';
|
|
2
2
|
import '../chunk-34RMTXDZ.js';
|
|
3
3
|
import '../chunk-KHJIEPZV.js';
|
|
4
|
-
import '../chunk-AYKXMIOR.js';
|
|
5
4
|
import '../chunk-SNQRGH4A.js';
|
|
5
|
+
import '../chunk-AYKXMIOR.js';
|
|
6
6
|
import '../chunk-6FVGSWLS.js';
|
|
7
7
|
import '../chunk-ILFEWRLG.js';
|
|
8
8
|
import '../chunk-WIATRXEJ.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { BrandSample } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { BrandSample } from '../chunk-AVMQMY66.js';
|
|
2
|
+
import '../chunk-X7WEE3EK.js';
|
|
3
3
|
import '../chunk-5SGHW42B.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-7W3LYIOC.js';
|
|
5
5
|
import '../chunk-ODEQTPFM.js';
|
package/dist/BrandScope/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BrandScope, brandScopeInputs } from '../chunk-
|
|
1
|
+
export { BrandScope, brandScopeInputs } from '../chunk-X7WEE3EK.js';
|
|
2
2
|
import '../chunk-5SGHW42B.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-7W3LYIOC.js';
|
|
4
4
|
import '../chunk-ODEQTPFM.js';
|
package/dist/Callout/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Callout } from '../chunk-
|
|
1
|
+
export { Callout } from '../chunk-BPCY7ZID.js';
|
|
2
2
|
import '../chunk-ODEQTPFM.js';
|
|
@@ -77,7 +77,16 @@
|
|
|
77
77
|
font-weight: var(--font-weight-semibold);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/*
|
|
81
|
+
* THE ACTIONS ARE A ROW one step apart, wrapping when there is no room, so a
|
|
82
|
+
* callout with two (Continue setting up, Review and adopt) never draws them
|
|
83
|
+
* touching, whatever the host wraps them in.
|
|
84
|
+
*/
|
|
80
85
|
.crewlet-callout__action {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-wrap: wrap;
|
|
88
|
+
align-items: center;
|
|
89
|
+
gap: var(--spacing-2);
|
|
81
90
|
grid-column: 3;
|
|
82
91
|
grid-row: 1;
|
|
83
92
|
align-self: center;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** `xs` is 12px, a mark inside a small button; `sm` is 16px, beside a word in a row. */
|
|
2
|
+
export type ColorChipSize = 'xs' | 'sm';
|
|
3
|
+
export type ColorChipShape = 'round' | 'square';
|
|
4
|
+
export interface ColorChipProps {
|
|
5
|
+
/**
|
|
6
|
+
* The colour, as `#rrggbb`. Anything else draws the hatch of no colour and
|
|
7
|
+
* is never put into a style.
|
|
8
|
+
*/
|
|
9
|
+
value: string | null | undefined;
|
|
10
|
+
size?: ColorChipSize | undefined;
|
|
11
|
+
shape?: ColorChipShape | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A colour as a small chip and nothing else: the mark on a button that
|
|
16
|
+
* applies it ("Use #007f7f"), or beside a value in a row.
|
|
17
|
+
*
|
|
18
|
+
* DECORATION, hidden from a screen reader: the words beside it say what the
|
|
19
|
+
* colour is. Where a colour has to be named, read and copied, that is
|
|
20
|
+
* `ColorSwatch`.
|
|
21
|
+
*
|
|
22
|
+
* THE VALUE PASSES THE SAME GATE AS EVERY BRAND PART (`#rrggbb`, lowercased)
|
|
23
|
+
* before it reaches a style, and the chip draws an edge of its own, so a
|
|
24
|
+
* colour that matches the ground it sits on is still a chip.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ColorChip({ value, size, shape, className }: ColorChipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A colour as a small chip (ColorChip.tsx). Its fill is the one value that is
|
|
3
|
+
* not a token, and it arrives through `--crewlet-color-chip-value` only after
|
|
4
|
+
* it has passed `#rrggbb`.
|
|
5
|
+
*/
|
|
6
|
+
.crewlet-color-chip {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
flex: none;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
width: var(--spacing-3);
|
|
11
|
+
height: var(--spacing-3);
|
|
12
|
+
background: var(--crewlet-color-chip-value, var(--color-surface-inset));
|
|
13
|
+
/* An edge of its own, so a colour that matches its ground is still a chip. */
|
|
14
|
+
box-shadow: inset 0 0 0 1px var(--color-border-hover);
|
|
15
|
+
vertical-align: middle;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.crewlet-color-chip--sm {
|
|
19
|
+
width: var(--spacing-4);
|
|
20
|
+
height: var(--spacing-4);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.crewlet-color-chip--round {
|
|
24
|
+
border-radius: var(--radius-circle);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.crewlet-color-chip--square {
|
|
28
|
+
border-radius: var(--radius-xs);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* The hatch of no colour, as every swatch in the package draws it. */
|
|
32
|
+
.crewlet-color-chip.is-empty {
|
|
33
|
+
background: repeating-linear-gradient(-45deg, var(--color-border-hatch) 0 1px, transparent 1px var(--spacing-1));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* FORCED COLORS drops backgrounds, which is all a chip is, so the mode keeps
|
|
38
|
+
* this one: the colour is the information, and the edge is drawn in the
|
|
39
|
+
* system's text colour so the chip still has a boundary.
|
|
40
|
+
*/
|
|
41
|
+
@media (forced-colors: active) {
|
|
42
|
+
.crewlet-color-chip {
|
|
43
|
+
forced-color-adjust: none;
|
|
44
|
+
box-shadow: inset 0 0 0 1px CanvasText;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -7,10 +7,12 @@ export interface ColorFieldLabels {
|
|
|
7
7
|
/** Names the colour picker beside the field: "Pick the Primary colour". */
|
|
8
8
|
picker: (label: string) => string;
|
|
9
9
|
/**
|
|
10
|
-
* What the empty field shows
|
|
11
|
-
* an empty field would seem to hold.
|
|
10
|
+
* What the empty field shows after its `#`: the shape a value takes, never
|
|
11
|
+
* a colour, which an empty field would seem to hold.
|
|
12
12
|
*/
|
|
13
13
|
placeholder: string;
|
|
14
|
+
/** Said for the `#` drawn at the start of the field, which is not part of what is typed. */
|
|
15
|
+
prefix: string;
|
|
14
16
|
}
|
|
15
17
|
export interface ColorFieldProps {
|
|
16
18
|
/** The colour's role, which is the field's name: "Primary". */
|
|
@@ -48,12 +50,18 @@ export interface ColorFieldProps {
|
|
|
48
50
|
* A colour a person chooses: a hex field, a swatch that opens the platform's
|
|
49
51
|
* colour picker, and the reason a value was refused.
|
|
50
52
|
*
|
|
51
|
-
* THE
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
53
|
+
* THE `#` IS THE FIELD'S, drawn at its start, so a person types the six hex
|
|
54
|
+
* digits alone; a pasted `#rrggbb` loses its own `#` to it. When the reader
|
|
55
|
+
* leaves the field (Enter or Tab) what they wrote is read as a colour:
|
|
56
|
+
* `rrggbb`, the three digit shorthand, or `rgb(r, g, b)` (commas or spaces),
|
|
57
|
+
* each normalised to the one spelling the engine stores, lowercase
|
|
58
|
+
* `#rrggbb`. Anything else is refused then, never while they are still
|
|
59
|
+
* typing, with a sentence saying what right looks like.
|
|
60
|
+
*
|
|
61
|
+
* ONLY A COLOUR IS EVER REPORTED. Six hex digits reach `onChange` as they are
|
|
62
|
+
* typed, so a preview follows the field; the shorthand and `rgb()` reach it
|
|
63
|
+
* when the reader leaves, since `abc` on its way to `abcdef` is not the colour
|
|
64
|
+
* they mean. An optional field emptied reports `''`.
|
|
57
65
|
*
|
|
58
66
|
* THE SWATCH IS THE PICKER. It is the platform's own colour input, drawn as
|
|
59
67
|
* the chip of the colour the field holds and named for it, so it is a real,
|
package/dist/ColorField/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ColorField } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { ColorField } from '../chunk-73WHPLWQ.js';
|
|
2
|
+
import '../chunk-7W3LYIOC.js';
|
|
3
3
|
import '../chunk-EXRRTKWT.js';
|
|
4
4
|
import '../chunk-XCUUI7E7.js';
|
|
5
5
|
import '../chunk-PQADV6P6.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { ColorSwatch } from '../chunk-
|
|
1
|
+
export { ColorSwatch } from '../chunk-RHPBTE3F.js';
|
|
2
2
|
import '../chunk-7SHAFLEX.js';
|
|
3
3
|
import '../chunk-STJ7QBC3.js';
|
|
4
4
|
import '../chunk-DTIW4CHZ.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-7W3LYIOC.js';
|
|
6
6
|
import '../chunk-OG6CL3EB.js';
|
|
7
7
|
import '../chunk-LACA4JGC.js';
|
|
8
8
|
import '../chunk-BZFWDIV6.js';
|
|
@@ -9,6 +9,11 @@ export type ContrastScale = 'body' | 'large';
|
|
|
9
9
|
* 3:1 but not 4.5:1), or under every floor its scale has.
|
|
10
10
|
*/
|
|
11
11
|
export type ContrastLevel = 'aaa' | 'aa' | 'aa-large' | 'fail';
|
|
12
|
+
/**
|
|
13
|
+
* What the badge draws: a level, or `low`, which an ADVISORY badge draws for
|
|
14
|
+
* a pair under its scale's AA floor in place of `aa-large` or `fail`.
|
|
15
|
+
*/
|
|
16
|
+
export type ContrastBadgeLevel = ContrastLevel | 'low';
|
|
12
17
|
/**
|
|
13
18
|
* The level a measured ratio reaches, on the floors `@crewlethq/tokens`
|
|
14
19
|
* exports. The ratio is compared UNROUNDED: a pair that passes only once
|
|
@@ -27,7 +32,7 @@ export declare function contrastRatio(foreground: string, background: string): n
|
|
|
27
32
|
*/
|
|
28
33
|
export declare function formatContrastRatio(ratio: number): string;
|
|
29
34
|
export interface ContrastBadgeLabels {
|
|
30
|
-
levels: Record<
|
|
35
|
+
levels: Record<ContrastBadgeLevel, string>;
|
|
31
36
|
/** Said for a pair that cannot be measured (a colour not set yet). */
|
|
32
37
|
unmeasured: string;
|
|
33
38
|
/** The ratio, said in words: "4.49 to 1". */
|
|
@@ -35,6 +40,23 @@ export interface ContrastBadgeLabels {
|
|
|
35
40
|
/** The letters the sample draws the pair with. */
|
|
36
41
|
sample: string;
|
|
37
42
|
}
|
|
43
|
+
/** The words a caller may replace: any of them, and any of the level words. */
|
|
44
|
+
export type ContrastBadgeLabelsInput = Partial<Omit<ContrastBadgeLabels, 'levels'>> & {
|
|
45
|
+
levels?: Partial<Record<ContrastBadgeLevel, string>> | undefined;
|
|
46
|
+
};
|
|
47
|
+
export interface ContrastLevelTagProps {
|
|
48
|
+
/** The level drawn. */
|
|
49
|
+
level: ContrastBadgeLevel;
|
|
50
|
+
/** Its word: "AA", "Low". */
|
|
51
|
+
children: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A contrast level as the badge draws it: its word in its tone with its
|
|
55
|
+
* glyph (a check for AA and AAA, the warning triangle for large text only and
|
|
56
|
+
* Low, the alert circle for Fails). The one drawing of a level, so the badge
|
|
57
|
+
* and the explanation of the levels (`ContrastHelp`) never disagree.
|
|
58
|
+
*/
|
|
59
|
+
export declare function ContrastLevelTag({ level, children }: ContrastLevelTagProps): import("react").JSX.Element;
|
|
38
60
|
export interface ContrastBadgeProps {
|
|
39
61
|
/** The colour read: text, a logo, an accent. `#rrggbb`. */
|
|
40
62
|
foreground: string;
|
|
@@ -44,8 +66,16 @@ export interface ContrastBadgeProps {
|
|
|
44
66
|
label?: string | undefined;
|
|
45
67
|
/** What it is read as: body text (the default), or large text and marks. */
|
|
46
68
|
scale?: ContrastScale | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The pair is a warning and never a block: under its scale's AA floor it
|
|
71
|
+
* reads "Low" in the warning tone, rather than "AA large text" or "Fails"
|
|
72
|
+
* in the danger tone. For a pair a person is told about and allowed to
|
|
73
|
+
* keep, such as a brand's primary on its light ground; a pair that blocks
|
|
74
|
+
* (a brand's text on its light ground) leaves it off and keeps "Fails".
|
|
75
|
+
*/
|
|
76
|
+
advisory?: boolean | undefined;
|
|
47
77
|
className?: string | undefined;
|
|
48
|
-
labels?:
|
|
78
|
+
labels?: ContrastBadgeLabelsInput | undefined;
|
|
49
79
|
}
|
|
50
80
|
/**
|
|
51
81
|
* Whether one colour reads on another: a sample of the pair, the measured
|
|
@@ -56,8 +86,13 @@ export interface ContrastBadgeProps {
|
|
|
56
86
|
* every theme to, and the floors from its `WCAG_CONTRAST`, so the badge an
|
|
57
87
|
* administrator reads and the gate a theme passes never disagree.
|
|
58
88
|
*
|
|
89
|
+
* BLOCKING OR ADVISORY. By default a pair under every floor "Fails" in the
|
|
90
|
+
* danger tone. An `advisory` pair is one a person may keep: under its AA
|
|
91
|
+
* floor it reads "Low" in the warning tone with the warning glyph, so a
|
|
92
|
+
* screen of pairs tells the one that blocks from the ones that only warn.
|
|
93
|
+
*
|
|
59
94
|
* THE LEVEL IS A WORD AND A GLYPH, never the tint alone, and the ratio is
|
|
60
95
|
* said as "4.49 to 1" rather than read out as punctuation. The sample is
|
|
61
96
|
* decoration: it shows the pair, and the words say how it measures.
|
|
62
97
|
*/
|
|
63
|
-
export declare function ContrastBadge({ foreground, background, label, scale, className, labels }: ContrastBadgeProps): import("react").JSX.Element;
|
|
98
|
+
export declare function ContrastBadge({ foreground, background, label, scale, advisory, className, labels, }: ContrastBadgeProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './ContrastBadge.css';
|
|
2
|
-
export { ContrastBadge, contrastLevel, contrastRatio, formatContrastRatio } from './ContrastBadge.js';
|
|
3
|
-
export type { ContrastBadgeLabels, ContrastBadgeProps, ContrastLevel, ContrastScale } from './ContrastBadge.js';
|
|
2
|
+
export { ContrastBadge, ContrastLevelTag, contrastLevel, contrastRatio, formatContrastRatio } from './ContrastBadge.js';
|
|
3
|
+
export type { ContrastBadgeLabels, ContrastBadgeLabelsInput, ContrastBadgeLevel, ContrastBadgeProps, ContrastLevelTagProps, ContrastLevel, ContrastScale, } from './ContrastBadge.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ContrastBadge, contrastLevel, contrastRatio, formatContrastRatio } from '../chunk-
|
|
1
|
+
export { ContrastBadge, ContrastLevelTag, contrastLevel, contrastRatio, formatContrastRatio } from '../chunk-WW7TU6HE.js';
|
|
2
2
|
import '../chunk-KYIAFNU7.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-7W3LYIOC.js';
|
|
4
4
|
import '../chunk-WIATRXEJ.js';
|
|
5
5
|
import '../chunk-BZFWDIV6.js';
|
|
6
6
|
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type PopoverAlign } from '../Popover/index.js';
|
|
2
|
+
export interface ContrastHelpLabels {
|
|
3
|
+
/** The button's name: "About contrast levels". */
|
|
4
|
+
trigger: string;
|
|
5
|
+
/** The panel's name: "Contrast levels". */
|
|
6
|
+
title: string;
|
|
7
|
+
/** What contrast is. */
|
|
8
|
+
intro: string;
|
|
9
|
+
/** The levels, each its word as the badge draws it and what it means. */
|
|
10
|
+
aa: {
|
|
11
|
+
term: string;
|
|
12
|
+
meaning: string;
|
|
13
|
+
};
|
|
14
|
+
aaa: {
|
|
15
|
+
term: string;
|
|
16
|
+
meaning: string;
|
|
17
|
+
};
|
|
18
|
+
low: {
|
|
19
|
+
term: string;
|
|
20
|
+
meaning: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface ContrastHelpProps {
|
|
24
|
+
/** Which edge of the button the panel lines up with. `start` by default. */
|
|
25
|
+
align?: PopoverAlign | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
labels?: Partial<ContrastHelpLabels> | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* What the contrast levels mean, a press away: a small info button beside a
|
|
31
|
+
* contrast heading that opens a short panel with AA, AAA and Low or Fails,
|
|
32
|
+
* each drawn as `ContrastBadge` draws it.
|
|
33
|
+
*
|
|
34
|
+
* A PRESS, NOT A HOVER. The panel is a `Popover` the button toggles, so it
|
|
35
|
+
* opens on a phone, where there is no hover, and from the keyboard (Enter or
|
|
36
|
+
* Space), and closes on Escape or a press outside, handing focus back to the
|
|
37
|
+
* button. A tooltip would hold this on hover alone and drop it the moment the
|
|
38
|
+
* pointer moved to read it. The panel is a dialog named by its title.
|
|
39
|
+
*/
|
|
40
|
+
export declare function ContrastHelp({ align, className, labels }: ContrastHelpProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ContrastHelp } from '../chunk-KIRQZG3G.js';
|
|
2
|
+
import '../chunk-WW7TU6HE.js';
|
|
3
|
+
import '../chunk-KYIAFNU7.js';
|
|
4
|
+
import '../chunk-KHJIEPZV.js';
|
|
5
|
+
import '../chunk-7W3LYIOC.js';
|
|
6
|
+
import '../chunk-WIATRXEJ.js';
|
|
7
|
+
import '../chunk-OMV5W53A.js';
|
|
8
|
+
import '../chunk-H5XTJ7GJ.js';
|
|
9
|
+
import '../chunk-LACA4JGC.js';
|
|
10
|
+
import '../chunk-NUZHC6MM.js';
|
|
11
|
+
import '../chunk-BZFWDIV6.js';
|
|
12
|
+
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ContrastHelp: what the contrast levels mean, in a short panel opened from an
|
|
3
|
+
* info button (ContrastHelp.tsx).
|
|
4
|
+
*/
|
|
5
|
+
.crewlet-contrast-help {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: var(--spacing-2);
|
|
9
|
+
padding: var(--spacing-3);
|
|
10
|
+
font-family: var(--font-family-sans);
|
|
11
|
+
font-size: var(--font-size-xs);
|
|
12
|
+
line-height: var(--font-line-height-snug);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.crewlet-contrast-help__title {
|
|
16
|
+
margin: 0;
|
|
17
|
+
color: var(--color-text-primary);
|
|
18
|
+
font-size: var(--font-size-sm);
|
|
19
|
+
font-weight: var(--font-weight-semibold);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.crewlet-contrast-help__intro {
|
|
23
|
+
margin: 0;
|
|
24
|
+
color: var(--color-text-secondary);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Each level's word as the badge draws it, beside what it means. */
|
|
28
|
+
.crewlet-contrast-help__levels {
|
|
29
|
+
display: grid;
|
|
30
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
31
|
+
align-items: baseline;
|
|
32
|
+
gap: var(--spacing-2) var(--spacing-3);
|
|
33
|
+
margin: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.crewlet-contrast-help__levels dt,
|
|
37
|
+
.crewlet-contrast-help__levels dd {
|
|
38
|
+
margin: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.crewlet-contrast-help__levels dd {
|
|
42
|
+
color: var(--color-text-secondary);
|
|
43
|
+
}
|
package/dist/DataView/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-
|
|
1
|
+
export { DATA_VIEW_TOOLBAR_LABELS, DataView, DataViewToolbar, FILTER_AXIS_LABELS, FilterAxisBar, FilterAxisChip, applyColumnFilters, applyFilters, blankFilterValue, defaultOperator, filterDefsFromColumns, filterHasValue, filterPredicate, formatFilterValue, operatorOf, tableColumns } from '../chunk-WX6IJJ4U.js';
|
|
2
2
|
import '../chunk-DKB73KZI.js';
|
|
3
|
-
import '../chunk-ZFM5L7M4.js';
|
|
4
3
|
import '../chunk-WQ7S7CKZ.js';
|
|
4
|
+
import '../chunk-ZFM5L7M4.js';
|
|
5
5
|
import '../chunk-YCC2S7DF.js';
|
|
6
6
|
import '../chunk-7KHM2FZH.js';
|
|
7
7
|
import '../chunk-STJ7QBC3.js';
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
+
import { type TimeValue } from '../RelativeTime/index.js';
|
|
1
2
|
/** Every string the status draws. */
|
|
2
3
|
export interface EditingStatusLabels {
|
|
3
4
|
editing: string;
|
|
4
5
|
unsaved: string;
|
|
5
6
|
saving: string;
|
|
7
|
+
/**
|
|
8
|
+
* The state once the last save landed, followed by how long ago: "Saved",
|
|
9
|
+
* drawn "Saved 2m ago". The word is announced; the time is not.
|
|
10
|
+
*/
|
|
11
|
+
saved: string;
|
|
6
12
|
}
|
|
7
13
|
export interface EditingStatusProps {
|
|
8
14
|
/** Whether anything differs from what was opened. */
|
|
9
15
|
dirty: boolean;
|
|
10
16
|
/** Whether a save is in flight. */
|
|
11
17
|
saving?: boolean | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* When the last save landed. Given, a status with nothing unsaved and no
|
|
20
|
+
* save in flight says how long ago: a draft that keeps itself, as a setup
|
|
21
|
+
* wizard's does ("Draft · Saved 2 min ago" with `labels.editing` "Draft").
|
|
22
|
+
*/
|
|
23
|
+
savedAt?: TimeValue;
|
|
12
24
|
labels?: Partial<EditingStatusLabels> | undefined;
|
|
13
25
|
className?: string | undefined;
|
|
14
26
|
}
|
|
@@ -22,4 +34,4 @@ export interface EditingStatusProps {
|
|
|
22
34
|
* from saved to unsaved without being interrupted. On a narrow bar the words
|
|
23
35
|
* fold away and the dot stays, named by the same words.
|
|
24
36
|
*/
|
|
25
|
-
export declare function EditingStatus({ dirty, saving, labels, className }: EditingStatusProps): import("react").JSX.Element;
|
|
37
|
+
export declare function EditingStatus({ dirty, saving, savedAt, labels, className }: EditingStatusProps): import("react").JSX.Element;
|
|
@@ -26,20 +26,32 @@
|
|
|
26
26
|
background: var(--color-brand-accent);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/*
|
|
30
|
+
* THE WORDS RUN AS TEXT, not as flex items, so the space between the label
|
|
31
|
+
* and the state (which the ear needs) and the space before the time are real
|
|
32
|
+
* spaces, and the row is cut with an ellipsis rather than squeezed.
|
|
33
|
+
*/
|
|
34
|
+
.crewlet-editing-status__text {
|
|
35
|
+
min-width: 0;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
}
|
|
39
|
+
|
|
29
40
|
.crewlet-editing-status__label {
|
|
30
41
|
color: var(--color-text-primary);
|
|
31
42
|
font-weight: var(--font-weight-medium);
|
|
32
43
|
}
|
|
33
44
|
|
|
34
|
-
.crewlet-editing-status__state
|
|
35
|
-
|
|
45
|
+
.crewlet-editing-status__state,
|
|
46
|
+
.crewlet-editing-status__ago {
|
|
36
47
|
color: var(--color-text-tertiary);
|
|
37
|
-
text-overflow: ellipsis;
|
|
38
48
|
}
|
|
39
49
|
|
|
50
|
+
/* The dot between the label and the state: drawn, never read. The space
|
|
51
|
+
before it in the text gives it the step on its left. */
|
|
40
52
|
.crewlet-editing-status__state::before {
|
|
41
53
|
content: '\00b7';
|
|
42
|
-
margin-
|
|
54
|
+
margin-inline: var(--spacing-1) var(--spacing-2);
|
|
43
55
|
}
|
|
44
56
|
|
|
45
57
|
/*
|
|
@@ -53,7 +65,8 @@
|
|
|
53
65
|
* "Editing" folds too, and Cancel and Save beside the dot say an edit is open.
|
|
54
66
|
*/
|
|
55
67
|
@media (width < 480px) {
|
|
56
|
-
.crewlet-editing-status__state
|
|
68
|
+
.crewlet-editing-status__state,
|
|
69
|
+
.crewlet-editing-status__ago {
|
|
57
70
|
position: absolute;
|
|
58
71
|
width: 1px;
|
|
59
72
|
height: 1px;
|
|
@@ -64,7 +77,8 @@
|
|
|
64
77
|
}
|
|
65
78
|
|
|
66
79
|
@container crewlet-artifact-bar (width < 900px) {
|
|
67
|
-
.crewlet-editing-status__state
|
|
80
|
+
.crewlet-editing-status__state,
|
|
81
|
+
.crewlet-editing-status__ago {
|
|
68
82
|
position: absolute;
|
|
69
83
|
width: 1px;
|
|
70
84
|
height: 1px;
|
|
@@ -76,7 +90,8 @@
|
|
|
76
90
|
|
|
77
91
|
@container crewlet-artifact-bar (width < 640px) {
|
|
78
92
|
.crewlet-editing-status__label,
|
|
79
|
-
.crewlet-editing-status__state
|
|
93
|
+
.crewlet-editing-status__state,
|
|
94
|
+
.crewlet-editing-status__ago {
|
|
80
95
|
position: absolute;
|
|
81
96
|
width: 1px;
|
|
82
97
|
height: 1px;
|
package/dist/FolderTile/index.js
CHANGED
|
@@ -27,8 +27,17 @@
|
|
|
27
27
|
--crewlet-folder-tile-floor: auto;
|
|
28
28
|
--crewlet-folder-tile-glyph: 40px;
|
|
29
29
|
--crewlet-folder-tile-glyph-radius: var(--radius-md);
|
|
30
|
+
/*
|
|
31
|
+
* THE WORDS ARE SET AS THE CARDS BESIDE THEM: a tile's name at a gallery
|
|
32
|
+
* card's title step and weight, its facts at the card's facts step, one
|
|
33
|
+
* line height for both and the card's step between them. The row (and a
|
|
34
|
+
* tile on a phone, which is the row) keeps the same two steps, since the
|
|
35
|
+
* cards it stands above keep theirs there too, with a tighter step between
|
|
36
|
+
* the lines so it stays one compact row.
|
|
37
|
+
*/
|
|
30
38
|
--crewlet-folder-tile-name: var(--font-size-md);
|
|
31
39
|
--crewlet-folder-tile-facts: var(--font-size-sm);
|
|
40
|
+
--crewlet-folder-tile-words-gap: var(--spacing-1);
|
|
32
41
|
--crewlet-folder-tile-actions-inset: var(--spacing-3);
|
|
33
42
|
/*
|
|
34
43
|
* A TILE STACKS: the glyph on top with the More menu level with it in the
|
|
@@ -61,8 +70,7 @@
|
|
|
61
70
|
--crewlet-folder-tile-floor: var(--size-control-lg);
|
|
62
71
|
--crewlet-folder-tile-glyph: 28px;
|
|
63
72
|
--crewlet-folder-tile-glyph-radius: var(--radius-sm);
|
|
64
|
-
--crewlet-folder-tile-
|
|
65
|
-
--crewlet-folder-tile-facts: var(--font-size-xs);
|
|
73
|
+
--crewlet-folder-tile-words-gap: 2px;
|
|
66
74
|
--crewlet-folder-tile-actions-inset: var(--spacing-2);
|
|
67
75
|
--crewlet-folder-tile-direction: row;
|
|
68
76
|
--crewlet-folder-tile-align: center;
|
|
@@ -82,8 +90,7 @@
|
|
|
82
90
|
--crewlet-folder-tile-floor: var(--size-control-lg);
|
|
83
91
|
--crewlet-folder-tile-glyph: 28px;
|
|
84
92
|
--crewlet-folder-tile-glyph-radius: var(--radius-sm);
|
|
85
|
-
--crewlet-folder-tile-
|
|
86
|
-
--crewlet-folder-tile-facts: var(--font-size-xs);
|
|
93
|
+
--crewlet-folder-tile-words-gap: 2px;
|
|
87
94
|
--crewlet-folder-tile-actions-inset: var(--spacing-2);
|
|
88
95
|
--crewlet-folder-tile-direction: row;
|
|
89
96
|
--crewlet-folder-tile-align: center;
|
|
@@ -151,7 +158,7 @@
|
|
|
151
158
|
.crewlet-folder-tile__body {
|
|
152
159
|
display: flex;
|
|
153
160
|
flex-direction: column;
|
|
154
|
-
gap:
|
|
161
|
+
gap: var(--crewlet-folder-tile-words-gap);
|
|
155
162
|
min-width: 0;
|
|
156
163
|
max-width: 100%;
|
|
157
164
|
}
|