@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { FollowBanner } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { FollowBanner } from '../chunk-34C7NYIQ.js';
|
|
2
|
+
import '../chunk-BPCY7ZID.js';
|
|
3
3
|
import '../chunk-OMV5W53A.js';
|
|
4
4
|
import '../chunk-OG6CL3EB.js';
|
|
5
5
|
import '../chunk-H5XTJ7GJ.js';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { INLINE_EDITOR_LABELS, InlineEditor } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { INLINE_EDITOR_LABELS, InlineEditor } from '../chunk-6RMZH7P7.js';
|
|
2
|
+
import '../chunk-EJWPYEG4.js';
|
|
3
|
+
import '../chunk-3CZ7XAVY.js';
|
|
4
|
+
import '../chunk-EUCC37WY.js';
|
|
3
5
|
import '../chunk-SMBKXWML.js';
|
|
4
6
|
import '../chunk-OMV5W53A.js';
|
|
5
7
|
import '../chunk-OG6CL3EB.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { LinkInterstitial, openExternal } from '../chunk-
|
|
1
|
+
export { LinkInterstitial, openExternal } from '../chunk-U3LNU4B2.js';
|
|
2
2
|
import '../chunk-YCC2S7DF.js';
|
|
3
3
|
import '../chunk-5CLW2CXT.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-BPCY7ZID.js';
|
|
5
5
|
import '../chunk-PQADV6P6.js';
|
|
6
6
|
import '../chunk-OMV5W53A.js';
|
|
7
7
|
import '../chunk-OG6CL3EB.js';
|
|
@@ -109,8 +109,10 @@ export interface ListInputProps {
|
|
|
109
109
|
itemError?: ((index: number, value: string) => ReactNode) | undefined;
|
|
110
110
|
/** What the list says in place of the new-item box once it is full. */
|
|
111
111
|
fullMessage?: ((max: number) => string) | undefined;
|
|
112
|
-
/** The name of the
|
|
112
|
+
/** The name of the button at the end of the box's row that appends what the box holds: "Add policy". */
|
|
113
113
|
addLabel?: ((itemName: string) => string) | undefined;
|
|
114
|
+
/** The word that button shows, which its name begins with: "Add". */
|
|
115
|
+
addText?: string | undefined;
|
|
114
116
|
itemLabel?: ((name: string, position: string) => string) | undefined;
|
|
115
117
|
newItemLabel?: ((itemName: string) => string) | undefined;
|
|
116
118
|
moveUpLabel?: ((itemName: string, position: string) => string) | undefined;
|
package/dist/ListInput/index.js
CHANGED
|
@@ -257,7 +257,7 @@
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
/*
|
|
260
|
+
/* The Add button ends the box's row: the field and its Add read as one control. */
|
|
261
261
|
.crewlet-list-input__add-control {
|
|
262
262
|
display: inline-flex;
|
|
263
263
|
flex: none;
|
package/dist/LogoSlot/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { LogoSlot } from '../chunk-
|
|
1
|
+
export { LogoSlot } from '../chunk-2UFUP2ZH.js';
|
|
2
2
|
import '../chunk-THDGBD6Y.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-WW7TU6HE.js';
|
|
4
4
|
import '../chunk-KYIAFNU7.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-7W3LYIOC.js';
|
|
6
6
|
import '../chunk-WIATRXEJ.js';
|
|
7
7
|
import '../chunk-OG6CL3EB.js';
|
|
8
8
|
import '../chunk-BZFWDIV6.js';
|
package/dist/RichEditor/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { RichEditor, preloadRichEditor } from '../chunk-
|
|
1
|
+
export { RichEditor, preloadRichEditor } from '../chunk-KHP7TJF7.js';
|
|
2
2
|
export { RICH_EDITOR_LABELS, richEditorLabels } from '../chunk-CSQTDGTS.js';
|
|
3
3
|
import '../chunk-BAKPMH3S.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-BPCY7ZID.js';
|
|
5
5
|
import '../chunk-TEUQWOWZ.js';
|
|
6
6
|
import '../chunk-OG6CL3EB.js';
|
|
7
7
|
import '../chunk-BZFWDIV6.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { FRAME_HELLO_TIMEOUT_MS, FRAME_LOAD_GRACE_MS, SandboxedFrame, SandboxedFrameNotice, SandboxedFramePlaceholder } from '../chunk-
|
|
1
|
+
export { FRAME_HELLO_TIMEOUT_MS, FRAME_LOAD_GRACE_MS, SandboxedFrame, SandboxedFrameNotice, SandboxedFramePlaceholder } from '../chunk-WQQ5T5SA.js';
|
|
2
2
|
import '../chunk-F6V2PTN6.js';
|
|
3
3
|
import '../chunk-ZXXDZJQN.js';
|
|
4
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-BPCY7ZID.js';
|
|
5
5
|
import '../chunk-TEUQWOWZ.js';
|
|
6
6
|
import '../chunk-OG6CL3EB.js';
|
|
7
7
|
import '../chunk-BZFWDIV6.js';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { type StepperStep } from '../Stepper/index.js';
|
|
3
|
+
import { type HeadingLevel } from '../utils/headingLevel.js';
|
|
4
|
+
export interface SetupWizardLabels {
|
|
5
|
+
/** Where the reader is, above the steps on a phone, before the step's name: "Step 3 of 6". */
|
|
6
|
+
progress: (position: number, total: number) => string;
|
|
7
|
+
/** The disclosure the aside folds into on a phone: "Preview". */
|
|
8
|
+
asideToggle: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SetupWizardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'onSelect'> {
|
|
11
|
+
/** What is being set up: "Set up your brand". The page's heading. */
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* The title's heading level. It follows the surrounding level by default,
|
|
15
|
+
* as `PageHeader` does; the step's heading is one level under it, and the
|
|
16
|
+
* step's own content and the aside start one level under that.
|
|
17
|
+
*/
|
|
18
|
+
headingLevel?: HeadingLevel | undefined;
|
|
19
|
+
/** Where the page sits, above the title: a `Breadcrumb` "Company › Brand › Set up". */
|
|
20
|
+
trail?: ReactNode;
|
|
21
|
+
/** The draft's state, beside the actions: an `EditingStatus` "Draft saved 2 min ago". */
|
|
22
|
+
status?: ReactNode;
|
|
23
|
+
/** What leaves the wizard: Exit. */
|
|
24
|
+
actions?: ReactNode;
|
|
25
|
+
/** Every step, in order, as `Stepper` takes them (with a status and a description each where it has one). */
|
|
26
|
+
steps: readonly StepperStep[];
|
|
27
|
+
/** The step shown, by its id. */
|
|
28
|
+
current: string;
|
|
29
|
+
/** The furthest step visited, by its id, so the steps up to it stay buttons after walking back. `current` by default. */
|
|
30
|
+
reached?: string | undefined;
|
|
31
|
+
/** Called with a visited step's id when the reader picks it in the rail. Left out, the rail is words only. */
|
|
32
|
+
onSelect?: ((id: string) => void) | undefined;
|
|
33
|
+
/** What the steps are, for the navigation landmark and the list: "Setup steps". */
|
|
34
|
+
stepsLabel: string;
|
|
35
|
+
/** The step's heading: "Colours". */
|
|
36
|
+
heading: ReactNode;
|
|
37
|
+
/** One sentence under the heading saying why the step matters. */
|
|
38
|
+
lead?: ReactNode;
|
|
39
|
+
/** The step's content: its fields. */
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
/** Beside the content on a wide page, under it on a narrower one, folded into a disclosure on a phone: a live preview. */
|
|
42
|
+
aside?: ReactNode;
|
|
43
|
+
/** What the aside is, for its complementary landmark: "Preview of your draft". Required with `aside`. */
|
|
44
|
+
asideLabel?: string | undefined;
|
|
45
|
+
/** The step's actions, at the end of the footer row and held at the bottom of the view: Back, Skip for now, Continue. */
|
|
46
|
+
footer: ReactNode;
|
|
47
|
+
/** What stands at the start of the footer row, apart from the step's actions: Exit. */
|
|
48
|
+
footerStart?: ReactNode;
|
|
49
|
+
/**
|
|
50
|
+
* The content takes the whole width beside the rail rather than one 640px
|
|
51
|
+
* column, for a step that lays out columns of its own (a review of every
|
|
52
|
+
* step beside a preview). Meant for a step with no `aside`.
|
|
53
|
+
*/
|
|
54
|
+
wide?: boolean | undefined;
|
|
55
|
+
labels?: Partial<SetupWizardLabels> | undefined;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A setup a person walks step by step on a page of its own: a brand, an
|
|
59
|
+
* integration, a company.
|
|
60
|
+
*
|
|
61
|
+
* FIVE PARTS, EACH A LANDMARK OR A HEADING. The header is the page's title
|
|
62
|
+
* (a `PageHeader`) with the trail above it and the draft's status and the way
|
|
63
|
+
* out beside it. The rail is a `nav` holding a vertical `Stepper`, with every
|
|
64
|
+
* visited step a button. The content is a `section` named by the step's
|
|
65
|
+
* heading, with a lead sentence and the step's fields in one column of at
|
|
66
|
+
* most 640px. The aside is a complementary landmark named by `asideLabel`,
|
|
67
|
+
* held in view beside the content. The footer holds the step's actions at the
|
|
68
|
+
* end of its row (and `footerStart`, the way out, at its start) at the bottom
|
|
69
|
+
* of the view, above the device's safe area. A step that lays out columns of
|
|
70
|
+
* its own takes the whole width beside the rail with `wide`.
|
|
71
|
+
*
|
|
72
|
+
* THREE SHAPES. On a wide page the rail, the content and the aside stand side
|
|
73
|
+
* by side (240px, the content, 320px). Where the wizard has under 70rem of its
|
|
74
|
+
* own width, which is a 1024px window beside the application's rail, the aside
|
|
75
|
+
* moves under the content and the rail stays: a container query, because the
|
|
76
|
+
* room is the page's and not the window's, as in `AsideLayout`. Under the
|
|
77
|
+
* phone breakpoint the rail becomes a row of steps above the content, under a
|
|
78
|
+
* line that says "Step 3 of 6 · Colours", and the aside folds into a
|
|
79
|
+
* disclosure, so the fields come first. Which element a phone draws is decided
|
|
80
|
+
* in `useMediaMatch`, the one subscription for that question; how it is laid
|
|
81
|
+
* out is decided in the stylesheet, at the same breakpoint token.
|
|
82
|
+
*
|
|
83
|
+
* FOCUS FOLLOWS THE STEP. When the step changes, focus moves to its heading,
|
|
84
|
+
* so a keyboard or screen reader user starts on the new step rather than on a
|
|
85
|
+
* Continue button that now belongs to it; the first render takes no focus.
|
|
86
|
+
*/
|
|
87
|
+
export declare function SetupWizard({ title, headingLevel, trail, status, actions, steps, current, reached, onSelect, stepsLabel, heading, lead, children, aside, asideLabel, footer, footerStart, wide, labels, className, ...rest }: SetupWizardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { SetupWizard } from '../chunk-DTSZUH6H.js';
|
|
2
|
+
import '../chunk-LDGQIDIZ.js';
|
|
3
|
+
import '../chunk-DKB73KZI.js';
|
|
4
|
+
import '../chunk-WIATRXEJ.js';
|
|
5
|
+
import '../chunk-OGXHZHRX.js';
|
|
6
|
+
import '../chunk-FZVJDJFN.js';
|
|
7
|
+
import '../chunk-BHHIIK3M.js';
|
|
8
|
+
import '../chunk-PQADV6P6.js';
|
|
9
|
+
import '../chunk-RTPQDNW3.js';
|
|
10
|
+
import '../chunk-BZFWDIV6.js';
|
|
11
|
+
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* SetupWizard: a setup walked step by step on a page of its own
|
|
3
|
+
* (SetupWizard.tsx).
|
|
4
|
+
*
|
|
5
|
+
* THE GRID. The header across the top, the footer across the bottom, and
|
|
6
|
+
* between them the rail (240px), the content (one column, at most 640px) and,
|
|
7
|
+
* from 70rem of the wizard's own width, the aside (320px). Under 70rem the
|
|
8
|
+
* aside takes the row under the content and the rail runs down beside both.
|
|
9
|
+
* Under the phone breakpoint every part is one column, in reading order.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
.crewlet-setup-wizard {
|
|
13
|
+
container-type: inline-size;
|
|
14
|
+
min-width: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.crewlet-setup-wizard__frame {
|
|
18
|
+
display: grid;
|
|
19
|
+
grid-template-columns: 240px minmax(0, 1fr);
|
|
20
|
+
grid-template-areas:
|
|
21
|
+
'head head'
|
|
22
|
+
'rail content'
|
|
23
|
+
'rail aside'
|
|
24
|
+
'foot foot';
|
|
25
|
+
grid-template-rows: auto auto 1fr auto;
|
|
26
|
+
column-gap: var(--spacing-8);
|
|
27
|
+
row-gap: var(--spacing-6);
|
|
28
|
+
min-width: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.crewlet-setup-wizard__head {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
gap: var(--spacing-2);
|
|
35
|
+
grid-area: head;
|
|
36
|
+
min-width: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.crewlet-setup-wizard__status {
|
|
40
|
+
display: inline-flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* THE RAIL stays in view while the content scrolls past it, as a column of
|
|
46
|
+
* the steps a reader can go back to.
|
|
47
|
+
*/
|
|
48
|
+
.crewlet-setup-wizard__rail {
|
|
49
|
+
position: sticky;
|
|
50
|
+
top: var(--spacing-5);
|
|
51
|
+
align-self: start;
|
|
52
|
+
grid-area: rail;
|
|
53
|
+
min-width: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.crewlet-setup-wizard__content {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
grid-area: content;
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
width: 100%;
|
|
62
|
+
max-width: 640px;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.crewlet-setup-wizard__heading {
|
|
67
|
+
margin: 0;
|
|
68
|
+
color: var(--color-text-primary);
|
|
69
|
+
font-family: var(--font-family-sans);
|
|
70
|
+
font-size: var(--font-size-lg);
|
|
71
|
+
font-weight: var(--font-weight-semibold);
|
|
72
|
+
line-height: var(--font-line-height-tight);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* The heading takes focus when the step changes. It keeps the browser's own
|
|
77
|
+
* focus treatment: after a press nothing is drawn, and after a key the ring
|
|
78
|
+
* shows where the reader now is.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
.crewlet-setup-wizard__lead {
|
|
82
|
+
margin: var(--spacing-2) 0 0;
|
|
83
|
+
max-width: var(--size-measure);
|
|
84
|
+
color: var(--color-text-secondary);
|
|
85
|
+
font-family: var(--font-family-sans);
|
|
86
|
+
font-size: var(--font-size-sm);
|
|
87
|
+
line-height: var(--font-line-height-body);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.crewlet-setup-wizard__body {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
gap: var(--spacing-6);
|
|
94
|
+
margin-top: var(--spacing-6);
|
|
95
|
+
min-width: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* UNDER THE CONTENT, the aside is set off by one hairline, as AsideLayout's is. */
|
|
99
|
+
.crewlet-setup-wizard__aside {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
gap: var(--spacing-4);
|
|
103
|
+
grid-area: aside;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
max-width: 640px;
|
|
106
|
+
min-width: 0;
|
|
107
|
+
padding-top: var(--spacing-6);
|
|
108
|
+
border-top: 1px solid var(--color-border-default);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/*
|
|
112
|
+
* THE FOOTER holds the step's actions at the bottom of the view while the
|
|
113
|
+
* content scrolls under it, on the sheet's own ground with a hairline above,
|
|
114
|
+
* and clears the device's safe area where it has one.
|
|
115
|
+
*/
|
|
116
|
+
.crewlet-setup-wizard__footer {
|
|
117
|
+
position: sticky;
|
|
118
|
+
bottom: 0;
|
|
119
|
+
z-index: var(--z-index-sticky);
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-wrap: wrap;
|
|
122
|
+
align-items: center;
|
|
123
|
+
gap: var(--spacing-2);
|
|
124
|
+
grid-area: foot;
|
|
125
|
+
padding: var(--spacing-3) 0 calc(var(--spacing-3) + env(safe-area-inset-bottom, var(--spacing-0)));
|
|
126
|
+
border-top: 1px solid var(--color-border-default);
|
|
127
|
+
background: var(--color-surface-background);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* The way out at the start of the row, the step's actions at its end. */
|
|
131
|
+
.crewlet-setup-wizard__footer-start,
|
|
132
|
+
.crewlet-setup-wizard__footer-end {
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-wrap: wrap;
|
|
135
|
+
align-items: center;
|
|
136
|
+
gap: var(--spacing-2);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.crewlet-setup-wizard__footer-end {
|
|
140
|
+
margin-inline-start: auto;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* A WIDE STEP lays out columns of its own across the whole width beside the rail. */
|
|
144
|
+
.crewlet-setup-wizard--wide .crewlet-setup-wizard__content {
|
|
145
|
+
max-width: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* BESIDE THE CONTENT, from 70rem of the wizard's own width: the aside holds in view. */
|
|
149
|
+
@container (min-width: 70rem) {
|
|
150
|
+
.crewlet-setup-wizard__frame {
|
|
151
|
+
grid-template-columns: 240px minmax(0, 1fr) 320px;
|
|
152
|
+
grid-template-areas:
|
|
153
|
+
'head head head'
|
|
154
|
+
'rail content aside'
|
|
155
|
+
'foot foot foot';
|
|
156
|
+
grid-template-rows: auto 1fr auto;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* With no aside, nothing is held for one: the content takes its column too. */
|
|
160
|
+
.crewlet-setup-wizard--no-aside .crewlet-setup-wizard__frame {
|
|
161
|
+
grid-template-columns: 240px minmax(0, 1fr);
|
|
162
|
+
grid-template-areas:
|
|
163
|
+
'head head'
|
|
164
|
+
'rail content'
|
|
165
|
+
'foot foot';
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.crewlet-setup-wizard__aside {
|
|
169
|
+
position: sticky;
|
|
170
|
+
top: var(--spacing-5);
|
|
171
|
+
align-self: start;
|
|
172
|
+
padding-top: 0;
|
|
173
|
+
border-top: 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/*
|
|
178
|
+
* ON A PHONE, one column in reading order: where the reader is, the step, the
|
|
179
|
+
* folded preview, and the actions. The rail is a row of steps under the
|
|
180
|
+
* position line, and scrolls away with the page rather than covering it.
|
|
181
|
+
*/
|
|
182
|
+
@media (width < 640px) {
|
|
183
|
+
.crewlet-setup-wizard__frame {
|
|
184
|
+
grid-template-columns: minmax(0, 1fr);
|
|
185
|
+
grid-template-areas:
|
|
186
|
+
'head'
|
|
187
|
+
'rail'
|
|
188
|
+
'content'
|
|
189
|
+
'aside'
|
|
190
|
+
'foot';
|
|
191
|
+
grid-template-rows: auto;
|
|
192
|
+
row-gap: var(--spacing-5);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.crewlet-setup-wizard__rail {
|
|
196
|
+
position: static;
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
gap: var(--spacing-2);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.crewlet-setup-wizard__preview {
|
|
203
|
+
grid-area: aside;
|
|
204
|
+
min-width: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.crewlet-setup-wizard__preview .crewlet-setup-wizard__aside {
|
|
208
|
+
padding-top: 0;
|
|
209
|
+
border-top: 0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.crewlet-setup-wizard__position {
|
|
214
|
+
margin: 0;
|
|
215
|
+
color: var(--color-text-secondary);
|
|
216
|
+
font-family: var(--font-family-sans);
|
|
217
|
+
font-size: var(--font-size-xs);
|
|
218
|
+
font-weight: var(--font-weight-medium);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.crewlet-setup-wizard__position-step {
|
|
222
|
+
color: var(--color-text-primary);
|
|
223
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { ARTIFACT_ROLES, SHAREABLE_ROLES, ShareDialog, roleAtLeast } from '../chunk-
|
|
1
|
+
export { ARTIFACT_ROLES, SHAREABLE_ROLES, ShareDialog, roleAtLeast } from '../chunk-PGYIDNGG.js';
|
|
2
2
|
import '../chunk-XQZ6EWOE.js';
|
|
3
3
|
import '../chunk-YCC2S7DF.js';
|
|
4
4
|
import '../chunk-7KHM2FZH.js';
|
|
5
5
|
import '../chunk-7SHAFLEX.js';
|
|
6
6
|
import '../chunk-STJ7QBC3.js';
|
|
7
7
|
import '../chunk-DTIW4CHZ.js';
|
|
8
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-BPCY7ZID.js';
|
|
9
9
|
import '../chunk-CI3VPIJN.js';
|
|
10
10
|
import '../chunk-5AQBPHZD.js';
|
|
11
11
|
import '../chunk-PZKHBB7D.js';
|
|
@@ -12,6 +12,16 @@ import type { Tone } from '../utils/tone.js';
|
|
|
12
12
|
* but `aria-current`, which nobody sees.
|
|
13
13
|
*/
|
|
14
14
|
export type StepperTone = Exclude<Tone, 'neutral'>;
|
|
15
|
+
/**
|
|
16
|
+
* Where one step stands. `done`, `current` and `upcoming` are what a step's
|
|
17
|
+
* position against `current` already says; `optional` is a step that may be
|
|
18
|
+
* skipped and has not been completed, drawn quietly with the word "Optional";
|
|
19
|
+
* `attention` is a step with something to look at again (a low-contrast pair,
|
|
20
|
+
* a refused file), drawn with a warning glyph and the words "Needs attention".
|
|
21
|
+
*/
|
|
22
|
+
export type StepperStatus = 'done' | 'current' | 'upcoming' | 'optional' | 'attention';
|
|
23
|
+
/** How the steps are laid out: a row of pills, or a column of rows with a mark each. */
|
|
24
|
+
export type StepperOrientation = 'horizontal' | 'vertical';
|
|
15
25
|
/** One step of the sequence. */
|
|
16
26
|
export interface StepperStep {
|
|
17
27
|
/** What tells two steps apart, unique within the stepper: `execute`, `review`. */
|
|
@@ -21,15 +31,26 @@ export interface StepperStep {
|
|
|
21
31
|
* round 7 of 25", "Context 0.8s".
|
|
22
32
|
*/
|
|
23
33
|
label: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Where the step stands, when its position does not say it all. Left out,
|
|
36
|
+
* a step before `current` is `done` and one after it is `upcoming`. The
|
|
37
|
+
* current step is always drawn current: `attention` or `optional` on it adds
|
|
38
|
+
* the warning glyph or the word "Optional" to it, and `current` on any other
|
|
39
|
+
* step is refused, since only `current` names the step under way.
|
|
40
|
+
*/
|
|
41
|
+
status?: StepperStatus | undefined;
|
|
42
|
+
/** A line under the label, in the vertical orientation only: "Name and tagline". */
|
|
43
|
+
description?: ReactNode;
|
|
24
44
|
}
|
|
25
|
-
export interface StepperProps extends Omit<HTMLAttributes<HTMLOListElement>, 'children'> {
|
|
45
|
+
export interface StepperProps extends Omit<HTMLAttributes<HTMLOListElement>, 'children' | 'onSelect'> {
|
|
26
46
|
/** Every step, in order. */
|
|
27
47
|
steps: readonly StepperStep[];
|
|
28
48
|
/**
|
|
29
49
|
* The step under way, by its id. Every step before it is done and every
|
|
30
|
-
* step after it is still to come
|
|
31
|
-
* how a finished run is drawn: a
|
|
32
|
-
* "Execute
|
|
50
|
+
* step after it is still to come, unless a step's `status` says otherwise.
|
|
51
|
+
* `null` once EVERY step is done, which is how a finished run is drawn: a
|
|
52
|
+
* turn's history in a task's timeline reads "Execute ✓, Review ✓" with
|
|
53
|
+
* nothing current.
|
|
33
54
|
*/
|
|
34
55
|
current: string | null;
|
|
35
56
|
/**
|
|
@@ -47,32 +68,60 @@ export interface StepperProps extends Omit<HTMLAttributes<HTMLOListElement>, 'ch
|
|
|
47
68
|
* motion preference.
|
|
48
69
|
*/
|
|
49
70
|
pulse?: boolean | undefined;
|
|
71
|
+
/** A row of pills (the default), or a column of rows, as a setup wizard's rail draws it. */
|
|
72
|
+
orientation?: StepperOrientation | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Called with a step's id when a reader picks it. Given, every VISITED step
|
|
75
|
+
* (the current one, every step before it, and every step up to `reached`)
|
|
76
|
+
* is a button; a step not visited yet stays words, reachable only by
|
|
77
|
+
* whatever moves the sequence on, never a disabled button that is a tab stop
|
|
78
|
+
* with nothing behind it.
|
|
79
|
+
*/
|
|
80
|
+
onSelect?: ((id: string) => void) | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* The furthest step a reader has visited, by its id, for a sequence they
|
|
83
|
+
* can walk back through and forward again: on step 2 after reaching step 5,
|
|
84
|
+
* steps 3 to 5 are still buttons. `current` by default.
|
|
85
|
+
*/
|
|
86
|
+
reached?: string | undefined;
|
|
50
87
|
/**
|
|
51
88
|
* Said before a finished step's words, where the check glyph stands for a
|
|
52
89
|
* reader who sees it: "Done Context".
|
|
53
90
|
*/
|
|
54
91
|
doneLabel?: string | undefined;
|
|
92
|
+
/** Said after an optional step's words, and shown under them in the vertical orientation. "Optional" by default. */
|
|
93
|
+
optionalLabel?: string | undefined;
|
|
94
|
+
/** Said after the words of a step that needs attention, and shown under them vertically. "Needs attention" by default. */
|
|
95
|
+
attentionLabel?: string | undefined;
|
|
55
96
|
}
|
|
56
97
|
/**
|
|
57
|
-
* Where a sequence has got to: the phases of a turn, the stages of a run
|
|
98
|
+
* Where a sequence has got to: the phases of a turn, the stages of a run, the
|
|
99
|
+
* steps of a setup a person walks themselves.
|
|
58
100
|
*
|
|
59
101
|
* AN ORDERED LIST, because the order IS the information: a step's position
|
|
60
102
|
* says whether it is behind the current one or ahead of it, and a list says
|
|
61
103
|
* how many there are before a reader has heard any of them. The step under
|
|
62
104
|
* way carries `aria-current="step"`, the one value ARIA gives this exact
|
|
63
105
|
* meaning, and it is on exactly one step while the sequence is running and on
|
|
64
|
-
* none once it has finished.
|
|
106
|
+
* none once it has finished. When the steps are buttons it is on the button,
|
|
107
|
+
* which is what a reader focuses and so what tells them.
|
|
65
108
|
*
|
|
66
|
-
*
|
|
109
|
+
* EVERY STATE IS DRAWN TWO WAYS, so colour is never the only carrier. A
|
|
67
110
|
* finished step is the secondary ink with a check, and says "Done" before its
|
|
68
111
|
* words to a screen reader, where the check stands for a reader who sees it.
|
|
69
112
|
* The current step is its tone's soft tint under the tone's ink with the
|
|
70
|
-
* tone's dot
|
|
71
|
-
*
|
|
72
|
-
*
|
|
113
|
+
* tone's dot. A step still to come is the tertiary ink and nothing else; an
|
|
114
|
+
* optional one says "Optional", and one that needs attention carries the
|
|
115
|
+
* warning glyph on the warning tint and says "Needs attention".
|
|
116
|
+
*
|
|
117
|
+
* TWO ORIENTATIONS. The row is the approved design's pills joined by a short
|
|
118
|
+
* rule. The column is a setup wizard's rail: a 20px mark per step (the check,
|
|
119
|
+
* the dot, the warning glyph or the step's number) on a hairline that joins
|
|
120
|
+
* them, the label beside it, and a description and the status words under
|
|
121
|
+
* the label.
|
|
73
122
|
*
|
|
74
123
|
* THE TONE IS DRAWN, NEVER SPOKEN: a reader hears which step is current, not
|
|
75
124
|
* that it is in the warning hue. A current step whose state is anything but
|
|
76
125
|
* ordinary work says so in its own words ("Review · sent back").
|
|
77
126
|
*/
|
|
78
|
-
export declare function Stepper({ steps, current, label, tone, pulse, doneLabel, className, ...rest }: StepperProps): import("react").JSX.Element | null;
|
|
127
|
+
export declare function Stepper({ steps, current, label, tone, pulse, orientation, onSelect, reached, doneLabel, optionalLabel, attentionLabel, className, ...rest }: StepperProps): import("react").JSX.Element | null;
|
package/dist/Stepper/index.d.ts
CHANGED
package/dist/Stepper/index.js
CHANGED