@crewlethq/ui 0.48.3 → 0.49.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 +56 -0
- package/dist/AgentHandoffPanel/index.js +3 -3
- package/dist/ArrangeList/index.js +2 -2
- package/dist/ArtifactBar/index.js +4 -4
- package/dist/{ArtifactBar-6PGWGKN2.css → ArtifactBar-UMZCTARR.css} +9 -0
- package/dist/ArtifactCard/ArtifactCard.d.ts +30 -1
- package/dist/ArtifactCard/index.js +10 -3
- package/dist/{ArtifactCard-OGTMO2KI.css → ArtifactCard-SOB63NV5.css} +72 -1
- package/dist/ArtifactCover/index.js +2 -2
- package/dist/ArtifactIcon/index.js +2 -2
- package/dist/ArtifactKindGlyph/ArtifactKindGlyph.d.ts +7 -3
- package/dist/ArtifactKindGlyph/index.js +1 -1
- package/dist/ArtifactKindIllustration/ArtifactKindIllustration.d.ts +4 -3
- package/dist/ArtifactKindIllustration/index.js +1 -1
- package/dist/{ArtifactKinds-CVD3FCYO.css → ArtifactKinds-O3CALPVX.css} +1 -0
- package/dist/ArtifactMakeRow/index.js +2 -2
- package/dist/ArtifactNameCell/ArtifactNameCell.d.ts +14 -1
- package/dist/ArtifactNameCell/index.d.ts +1 -1
- package/dist/ArtifactNameCell/index.js +2 -2
- package/dist/{ArtifactNameCell-RTVP4LO4.css → ArtifactNameCell-3AHLUSE5.css} +12 -0
- package/dist/BrandChip/BrandChip.d.ts +26 -0
- package/dist/BrandChip/index.d.ts +3 -0
- package/dist/BrandChip/index.js +2 -0
- package/dist/BrandChip-SQWBC2WU.css +81 -0
- package/dist/BrandSample/BrandSample.d.ts +75 -0
- package/dist/BrandSample/index.d.ts +3 -0
- package/dist/BrandSample/index.js +5 -0
- package/dist/BrandSample-G5V7GKR2.css +185 -0
- package/dist/BrandScope/BrandScope.d.ts +61 -0
- package/dist/BrandScope/index.d.ts +4 -0
- package/dist/BrandScope/index.js +4 -0
- package/dist/BrandScope-H2KZHGT7.css +29 -0
- package/dist/Checkbox/Checkbox.d.ts +8 -0
- package/dist/Checkbox/index.js +1 -1
- package/dist/{Checkbox-ALWG3WV2.css → Checkbox-MB22OW6P.css} +18 -0
- package/dist/ColorField/ColorField.d.ts +63 -0
- package/dist/ColorField/index.d.ts +3 -0
- package/dist/ColorField/index.js +11 -0
- package/dist/ColorField-2OIOWT3Z.css +68 -0
- package/dist/ColorSwatch/ColorSwatch.d.ts +43 -0
- package/dist/ColorSwatch/index.d.ts +3 -0
- package/dist/ColorSwatch/index.js +9 -0
- package/dist/ColorSwatch-DNMUFHNS.css +83 -0
- package/dist/Combobox/Combobox.d.ts +45 -4
- package/dist/Combobox/index.d.ts +1 -1
- package/dist/Combobox/index.js +1 -1
- package/dist/Combobox-GBCWXWEB.css +163 -0
- package/dist/CommandPalette/index.js +3 -3
- package/dist/CommentThread/index.js +3 -3
- package/dist/Composer/index.js +2 -2
- package/dist/ContrastBadge/ContrastBadge.d.ts +63 -0
- package/dist/ContrastBadge/index.d.ts +3 -0
- package/dist/ContrastBadge/index.js +6 -0
- package/dist/ContrastBadge-CBZPGG3G.css +47 -0
- package/dist/DataGrid/DataGrid.d.ts +28 -1
- package/dist/DataGrid/index.js +8 -1
- package/dist/{DataGrid-AQKPJD7W.css → DataGrid-VNGQESJA.css} +15 -0
- package/dist/DataTable/index.js +3 -3
- package/dist/DataView/index.js +8 -8
- package/dist/DateTimePicker/index.js +2 -2
- package/dist/FolderTile/FolderTile.d.ts +91 -0
- package/dist/FolderTile/index.d.ts +3 -0
- package/dist/FolderTile/index.js +7 -0
- package/dist/FolderTile-FDT5Y63Z.css +231 -0
- package/dist/LinkInterstitial/index.js +2 -2
- package/dist/ListInput/index.js +2 -2
- package/dist/LogoSlot/LogoSlot.d.ts +84 -0
- package/dist/LogoSlot/index.d.ts +3 -0
- package/dist/LogoSlot/index.js +9 -0
- package/dist/LogoSlot-T2UFOJXU.css +159 -0
- package/dist/Modal/Modal.d.ts +13 -0
- package/dist/Modal/index.js +1 -1
- package/dist/{Modal-TOEWHDCQ.css → Modal-3HMP7WAZ.css} +30 -0
- package/dist/PresenterView/index.js +2 -2
- package/dist/PrincipalPicker/index.js +2 -2
- package/dist/SelectionBar/SelectionBar.d.ts +50 -0
- package/dist/SelectionBar/index.d.ts +3 -0
- package/dist/SelectionBar/index.js +9 -0
- package/dist/SelectionBar-XPWKUOSC.css +61 -0
- package/dist/ShareDialog/index.js +3 -3
- package/dist/SheetColumnEditor/index.js +3 -3
- package/dist/SheetGrid/index.js +2 -2
- package/dist/Switcher/index.js +2 -2
- package/dist/ThemeGallery/ThemeGallery.d.ts +13 -2
- package/dist/ThemeGallery/index.js +3 -1
- package/dist/{ThemeGallery-X35Y25EX.css → ThemeGallery-UEFZRT6W.css} +21 -0
- package/dist/TimeWindowPicker/index.js +2 -2
- package/dist/TypeSpecimen/TypeSpecimen.d.ts +49 -0
- package/dist/TypeSpecimen/index.d.ts +3 -0
- package/dist/TypeSpecimen/index.js +3 -0
- package/dist/TypeSpecimen-WK6YNHL7.css +96 -0
- package/dist/chunk-5SGHW42B.js +23 -0
- package/dist/{chunk-ILDNJHRU.js → chunk-AVL52EME.js} +1 -1
- package/dist/chunk-B235ANDO.js +66 -0
- package/dist/{chunk-2MYSESZF.js → chunk-FB5CFQTG.js} +82 -12
- package/dist/{chunk-DY4DQ7EB.js → chunk-GP4YWZFO.js} +1 -1
- package/dist/{chunk-LIJQT74Y.js → chunk-H55D66IK.js} +1 -1
- package/dist/{chunk-6EBGPCAW.js → chunk-H7NMJ5AI.js} +1 -1
- package/dist/chunk-ITI2Z44C.js +139 -0
- package/dist/{chunk-P5VGSVWG.js → chunk-J24Q4HTD.js} +17 -8
- package/dist/{chunk-5EBDOE3C.js → chunk-JFDIMO3A.js} +1 -1
- package/dist/chunk-JKAFEFFC.js +44 -0
- package/dist/{chunk-32TGEMQQ.js → chunk-KHZYAEGZ.js} +1 -1
- package/dist/chunk-M4QM477B.js +80 -0
- package/dist/{chunk-TWZEWXNW.js → chunk-MIEBOO7Y.js} +2 -2
- package/dist/{chunk-SMOFYZJ5.js → chunk-NAWUXCBC.js} +3 -3
- package/dist/{chunk-F57N6ZJG.js → chunk-NCHKKYPQ.js} +5 -2
- package/dist/chunk-OCRVY42T.js +50 -0
- package/dist/chunk-OEEYL2CM.js +73 -0
- package/dist/chunk-P3OIM6OC.js +38 -0
- package/dist/{chunk-FWBKMPNR.js → chunk-P3QWT5VR.js} +1 -1
- package/dist/chunk-P5JBDHWC.js +206 -0
- package/dist/{chunk-OKE5YSLD.js → chunk-Q44X36QC.js} +79 -35
- package/dist/{chunk-R2IBCEU6.js → chunk-R3BA3C4Y.js} +2 -2
- package/dist/{chunk-CE2THTQR.js → chunk-RSKW25Y5.js} +4 -3
- package/dist/{chunk-UBZDYOCA.js → chunk-RV6XB5UV.js} +12 -1
- package/dist/{chunk-E4BOVKNJ.js → chunk-UTESMBPL.js} +5 -3
- package/dist/chunk-UZMNR366.js +9 -0
- package/dist/{chunk-CWKWMIIJ.js → chunk-V7GOOXPK.js} +1 -1
- package/dist/{chunk-7JED2NYP.js → chunk-VBIM6HFC.js} +1 -1
- package/dist/{chunk-U4HOKU6P.js → chunk-VN47PYUF.js} +5 -5
- package/dist/{chunk-MUQJCH2Y.js → chunk-VTSJMDGP.js} +2 -2
- package/dist/chunk-W6FOEBIL.js +119 -0
- package/dist/chunk-WLSEAIVC.js +48 -0
- package/dist/{chunk-AS2BMY3E.js → chunk-WQ7S7CKZ.js} +2 -2
- package/dist/{chunk-6AKG2VLR.js → chunk-YCC2S7DF.js} +4 -1
- package/dist/chunk-ZH77BXMA.js +14 -0
- package/dist/generated/index.d.ts +10 -0
- package/dist/generated/index.js +80 -68
- package/dist/index.js +80 -68
- package/dist/styles.css +1414 -85
- package/dist/utils/fontFamily.d.ts +29 -0
- package/dist/utils/hexColour.d.ts +12 -0
- package/package.json +3 -3
- package/scripts/check-css-variables.mjs +18 -2
- package/dist/Combobox-YDONYDTM.css +0 -81
- package/dist/chunk-OOJTPR7N.js +0 -137
- package/dist/{chunk-245IXG5P.js → chunk-3WMOEGEL.js} +0 -0
- package/dist/{chunk-ISDEXIXH.js → chunk-E6HXFFWO.js} +1 -1
- package/dist/{chunk-6R5BSA36.js → chunk-GHY63X4C.js} +1 -1
- package/dist/{chunk-ICVS3U4S.js → chunk-PGR2PKH6.js} +1 -1
- package/dist/{chunk-VKFG4FLE.js → chunk-R6R2UHVG.js} +1 -1
- package/dist/{chunk-OO7QJCJQ.js → chunk-WXOYHVWG.js} +1 -1
- package/dist/{chunk-UFXLNC2N.js → chunk-ZFM5L7M4.js} +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type BrandColors } from '../BrandScope/index.js';
|
|
2
|
+
/** What the sample draws: the opening of a doc, or a title slide. */
|
|
3
|
+
export type BrandSampleKind = 'doc' | 'slide';
|
|
4
|
+
/** The mode the sample is drawn in, whatever mode the page around it is in. */
|
|
5
|
+
export type BrandSampleMode = 'light' | 'dark';
|
|
6
|
+
/**
|
|
7
|
+
* A brand's colours by role, as the engine stores them: BrandScope's own. Each
|
|
8
|
+
* is `#rrggbb`; one that is absent, or is not one, takes the product's value
|
|
9
|
+
* for the sample's mode.
|
|
10
|
+
*/
|
|
11
|
+
export type BrandSampleColors = BrandColors;
|
|
12
|
+
export interface BrandSampleLabels {
|
|
13
|
+
/** The doc's heading. */
|
|
14
|
+
heading: string;
|
|
15
|
+
/** The doc's sentence, which the link follows. */
|
|
16
|
+
body: string;
|
|
17
|
+
/** The link at the end of the doc's sentence, drawn in the accent. */
|
|
18
|
+
link: string;
|
|
19
|
+
/** The quiet line under the doc's sentence. */
|
|
20
|
+
byline: string;
|
|
21
|
+
/** The slide's heading. */
|
|
22
|
+
slideHeading: string;
|
|
23
|
+
/** The slide's footer, after the company's name. */
|
|
24
|
+
slideFooter: string;
|
|
25
|
+
/** What the drawing is, said as its name. */
|
|
26
|
+
label: (name: string, kind: BrandSampleKind, mode: BrandSampleMode) => string;
|
|
27
|
+
}
|
|
28
|
+
export interface BrandSampleProps {
|
|
29
|
+
kind: BrandSampleKind;
|
|
30
|
+
/** The mode it is drawn in. It follows this, not the page, so a preview can show both. */
|
|
31
|
+
mode: BrandSampleMode;
|
|
32
|
+
/** The company's name: the slide's footer, and the doc's wordmark where there is no logo. */
|
|
33
|
+
name: string;
|
|
34
|
+
colors: BrandSampleColors;
|
|
35
|
+
/**
|
|
36
|
+
* The logo for a light ground, as an address the host has already
|
|
37
|
+
* validated (the engine's file route, through the dashboard's checked blob
|
|
38
|
+
* path).
|
|
39
|
+
*/
|
|
40
|
+
logo?: string | null | undefined;
|
|
41
|
+
/** The logo for a dark ground. In dark mode it stands in for `logo`, which it falls back to. */
|
|
42
|
+
logoOnDark?: string | null | undefined;
|
|
43
|
+
/** The square mark the slide carries. Without one, the mode's logo stands in. */
|
|
44
|
+
mark?: string | null | undefined;
|
|
45
|
+
/** The family list for headings. Not a list of family names, it is the package's display face. */
|
|
46
|
+
headingFamily?: string | undefined;
|
|
47
|
+
/** The family list for everything else. Not a list of family names, it is the package's sans. */
|
|
48
|
+
bodyFamily?: string | undefined;
|
|
49
|
+
className?: string | undefined;
|
|
50
|
+
labels?: Partial<BrandSampleLabels> | undefined;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A company's brand, drawn: the opening of a doc or a title slide in its
|
|
54
|
+
* colours, its type and its logo. The preview beside Company › Brand, a brand
|
|
55
|
+
* kit's own view and its gallery cover.
|
|
56
|
+
*
|
|
57
|
+
* A PICTURE, NAMED. It is an image to assistive technology, named by what it
|
|
58
|
+
* shows ("A doc in the Acme brand, light mode"); the words inside are sample
|
|
59
|
+
* copy, and its link is drawn, never followed.
|
|
60
|
+
*
|
|
61
|
+
* DRAWN THROUGH THE BRAND MAPPING ITSELF. The sample is a BrandScope pinned to
|
|
62
|
+
* its `mode`: its ground, text, accent and faces are the public tokens as the
|
|
63
|
+
* mapping the artifact kit draws every page with sets them, so the preview
|
|
64
|
+
* shows what an artifact will look like rather than a second reading of the
|
|
65
|
+
* rules. The sample is its mode whatever mode the page is in (a role the
|
|
66
|
+
* brand lacks, and every token that is not a brand role, takes the default
|
|
67
|
+
* theme's value for the mode), so two samples in two modes sit side by side.
|
|
68
|
+
* A colour reaches a style only once it has passed `#rrggbb`, and a family
|
|
69
|
+
* list only once it reads as family names; anything else is the product's.
|
|
70
|
+
*
|
|
71
|
+
* ONE SHAPE AT ANY SIZE. The sample keeps a 16:9 frame and sets every length
|
|
72
|
+
* against its own width (a container query unit), so the same drawing reads
|
|
73
|
+
* as a gallery cover and as a preview beside a form.
|
|
74
|
+
*/
|
|
75
|
+
export declare function BrandSample({ kind, mode, name, colors, logo, logoOnDark, mark, headingFamily, bodyFamily, className, labels, }: BrandSampleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A company's brand, drawn: a doc's opening or a title slide, in a 16:9 frame
|
|
3
|
+
* that sets every length against its own width, so one drawing reads at a
|
|
4
|
+
* gallery cover's size and at a preview's.
|
|
5
|
+
*
|
|
6
|
+
* It paints with the public tokens, which the sample's BrandScope (pinned to
|
|
7
|
+
* the sample's mode) sets from the brand through the artifact kit's own
|
|
8
|
+
* mapping: the ground, the text, the accent, the highlight and the two faces,
|
|
9
|
+
* and the quiet line in the tertiary text of the sample's pinned mode.
|
|
10
|
+
*/
|
|
11
|
+
.crewlet-brand-sample {
|
|
12
|
+
/* The frame's corner. A host drawing the sample edge to edge in a cover
|
|
13
|
+
that clips its own corners sets it to its own. */
|
|
14
|
+
--crewlet-brand-sample-radius: var(--radius-lg);
|
|
15
|
+
|
|
16
|
+
/* THE SAMPLE IS ITS OWN CONTAINER, so `cqi` inside it is its own width. */
|
|
17
|
+
container-type: inline-size;
|
|
18
|
+
position: relative;
|
|
19
|
+
display: block;
|
|
20
|
+
width: 100%;
|
|
21
|
+
aspect-ratio: 16 / 9;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
border-radius: var(--crewlet-brand-sample-radius);
|
|
24
|
+
background: var(--color-surface-background);
|
|
25
|
+
/* AN EDGE OF ITS OWN, inside the frame, so a ground that matches the page
|
|
26
|
+
is still a frame. */
|
|
27
|
+
box-shadow: inset 0 0 0 1px var(--color-border-hover);
|
|
28
|
+
color: var(--color-text-primary);
|
|
29
|
+
font-family: var(--font-family-sans);
|
|
30
|
+
line-height: var(--font-line-height-snug);
|
|
31
|
+
user-select: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.crewlet-brand-sample__page,
|
|
35
|
+
.crewlet-brand-sample__slide {
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ---- the doc's opening ---- */
|
|
45
|
+
|
|
46
|
+
.crewlet-brand-sample__page {
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
gap: 2.4cqi;
|
|
49
|
+
padding: 6cqi 7cqi;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.crewlet-brand-sample__brand {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
height: 6cqi;
|
|
56
|
+
max-width: 40%;
|
|
57
|
+
margin-bottom: 1.6cqi;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.crewlet-brand-sample__logo {
|
|
61
|
+
display: block;
|
|
62
|
+
max-width: 100%;
|
|
63
|
+
max-height: 100%;
|
|
64
|
+
object-fit: contain;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* WHERE THERE IS NO LOGO, the company's name in the heading face. */
|
|
68
|
+
.crewlet-brand-sample__wordmark {
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
font-family: var(--font-family-display);
|
|
71
|
+
font-size: 3.4cqi;
|
|
72
|
+
font-weight: var(--font-weight-semibold);
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.crewlet-brand-sample__heading {
|
|
78
|
+
max-width: 100%;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
font-family: var(--font-family-display);
|
|
81
|
+
font-size: 6cqi;
|
|
82
|
+
font-weight: var(--font-weight-semibold);
|
|
83
|
+
letter-spacing: var(--font-letter-spacing-tight);
|
|
84
|
+
line-height: 1.1;
|
|
85
|
+
text-overflow: ellipsis;
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* THE ACCENT RULE under the heading, in the brand's main colour for the mode. */
|
|
90
|
+
.crewlet-brand-sample__rule {
|
|
91
|
+
display: block;
|
|
92
|
+
width: 12cqi;
|
|
93
|
+
height: 0.8cqi;
|
|
94
|
+
border-radius: var(--radius-pill);
|
|
95
|
+
background: var(--color-brand-accent);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.crewlet-brand-sample__body {
|
|
99
|
+
max-width: 82%;
|
|
100
|
+
font-size: 2.8cqi;
|
|
101
|
+
line-height: var(--font-line-height-normal);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* A LINK, DRAWN: the accent ink and its underline, and nothing to follow. */
|
|
105
|
+
.crewlet-brand-sample__link {
|
|
106
|
+
color: var(--color-brand-accent);
|
|
107
|
+
text-decoration: underline;
|
|
108
|
+
text-decoration-thickness: 0.2cqi;
|
|
109
|
+
text-underline-offset: 0.5cqi;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.crewlet-brand-sample__byline {
|
|
113
|
+
margin-top: auto;
|
|
114
|
+
color: var(--color-text-tertiary);
|
|
115
|
+
font-size: 2.2cqi;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ---- the title slide ---- */
|
|
119
|
+
|
|
120
|
+
.crewlet-brand-sample__slide {
|
|
121
|
+
justify-content: flex-end;
|
|
122
|
+
gap: 2.4cqi;
|
|
123
|
+
padding: 6.5cqi 7cqi;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* The mark in the slide's top corner, square, at the slide's own scale. */
|
|
127
|
+
.crewlet-brand-sample__slide .crewlet-brand-sample__brand {
|
|
128
|
+
position: absolute;
|
|
129
|
+
top: 6.5cqi;
|
|
130
|
+
left: 7cqi;
|
|
131
|
+
height: 7cqi;
|
|
132
|
+
max-width: 30%;
|
|
133
|
+
margin: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.crewlet-brand-sample__logo--mark {
|
|
137
|
+
width: 7cqi;
|
|
138
|
+
height: 7cqi;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* THE ACCENT BAR: the brand's main colour, then its second where it has one. */
|
|
142
|
+
.crewlet-brand-sample__bar {
|
|
143
|
+
display: flex;
|
|
144
|
+
gap: 0.8cqi;
|
|
145
|
+
height: 1cqi;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.crewlet-brand-sample__bar-primary,
|
|
149
|
+
.crewlet-brand-sample__bar-secondary {
|
|
150
|
+
display: block;
|
|
151
|
+
height: 100%;
|
|
152
|
+
border-radius: var(--radius-pill);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.crewlet-brand-sample__bar-primary {
|
|
156
|
+
width: 12cqi;
|
|
157
|
+
background: var(--color-brand-accent);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.crewlet-brand-sample__bar-secondary {
|
|
161
|
+
width: 4cqi;
|
|
162
|
+
background: var(--color-brand-highlight);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* TWO LINES AT MOST, set large: a title slide's heading. */
|
|
166
|
+
.crewlet-brand-sample__heading--slide {
|
|
167
|
+
display: -webkit-box;
|
|
168
|
+
max-width: 48%;
|
|
169
|
+
font-size: 7.5cqi;
|
|
170
|
+
line-height: 1.05;
|
|
171
|
+
white-space: normal;
|
|
172
|
+
-webkit-box-orient: vertical;
|
|
173
|
+
-webkit-line-clamp: 2;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.crewlet-brand-sample__footer {
|
|
177
|
+
margin-top: 3cqi;
|
|
178
|
+
overflow: hidden;
|
|
179
|
+
color: var(--color-text-tertiary);
|
|
180
|
+
font-size: 2cqi;
|
|
181
|
+
letter-spacing: var(--font-letter-spacing-wide);
|
|
182
|
+
text-overflow: ellipsis;
|
|
183
|
+
text-transform: uppercase;
|
|
184
|
+
white-space: nowrap;
|
|
185
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A brand's colours by role, as the engine stores them. Each is `#rrggbb`;
|
|
4
|
+
* one that is absent, or is not one, sets nothing, and the token it would
|
|
5
|
+
* have driven keeps the page's value.
|
|
6
|
+
*/
|
|
7
|
+
export interface BrandColors {
|
|
8
|
+
primary?: string | undefined;
|
|
9
|
+
primary_on_dark?: string | undefined;
|
|
10
|
+
secondary?: string | undefined;
|
|
11
|
+
text?: string | undefined;
|
|
12
|
+
light_ground?: string | undefined;
|
|
13
|
+
dark_ground?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
/** A mode a scope can be pinned to, for a preview that shows a brand in one mode whatever the page is in. */
|
|
16
|
+
export type BrandScopeMode = 'light' | 'dark';
|
|
17
|
+
export interface BrandScopeProps extends HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
colors: BrandColors;
|
|
19
|
+
/** The family list for headings. Set only when it reads as family names. */
|
|
20
|
+
headingFamily?: string | undefined;
|
|
21
|
+
/** The family list for everything else. Set only when it reads as family names. */
|
|
22
|
+
bodyFamily?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Pins the mode. Left out, the scope follows the page's light or dark, as
|
|
25
|
+
* every surface in it does; pinned, it is that mode whatever the page is in:
|
|
26
|
+
* the default theme's palette for the mode, with the brand's steps for it.
|
|
27
|
+
*/
|
|
28
|
+
mode?: BrandScopeMode | undefined;
|
|
29
|
+
/** The region the brand applies to. */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The inputs a brand sets, each only once it has passed its gate: a colour as
|
|
34
|
+
* `#rrggbb`, a family list as family names, which then ends in the page's own
|
|
35
|
+
* face, so a face still loading draws as the page's type.
|
|
36
|
+
*/
|
|
37
|
+
export declare function brandScopeInputs(colors: BrandColors, headingFamily?: string, bodyFamily?: string): Record<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* A region of the page in a company's brand: a doc, a board, a preview. The
|
|
40
|
+
* public tokens inside it (the accent and its family, the grounds, the body
|
|
41
|
+
* text, the faces) take the brand's values, and the page's chrome around it
|
|
42
|
+
* keeps its own.
|
|
43
|
+
*
|
|
44
|
+
* THE MAPPING IS THE ARTIFACT KIT'S. The rules that derive the accent's hover,
|
|
45
|
+
* press, ink, soft fills and the label on it from one colour, per mode, are
|
|
46
|
+
* one stylesheet in @crewlethq/tokens (`css/brand`), and this component's
|
|
47
|
+
* stylesheet (`css/brand-scope`) is built from it with its selectors moved
|
|
48
|
+
* onto the scope. A page in the kit and a region of the dashboard in the same
|
|
49
|
+
* brand are drawn by the same rules. The focus ring stays the theme's.
|
|
50
|
+
*
|
|
51
|
+
* TWO ELEMENTS, ONE BOX. The outer element carries the inputs and captures
|
|
52
|
+
* the page's value of every token the brand drives, which an input left out
|
|
53
|
+
* falls back to; it draws no box (`display: contents`). The inner element is
|
|
54
|
+
* the box, with `className` and every other attribute on it, and sets the
|
|
55
|
+
* body text and face so plain text inside follows the brand. It paints no
|
|
56
|
+
* ground: a surface inside paints its own with the tokens.
|
|
57
|
+
*
|
|
58
|
+
* Nothing a person typed reaches a style unchecked: a colour only as
|
|
59
|
+
* `#rrggbb`, a family list only when it reads as family names.
|
|
60
|
+
*/
|
|
61
|
+
export declare function BrandScope({ colors, headingFamily, bodyFamily, mode, className, children, ...rest }: BrandScopeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A region in a company's brand. The mapping itself (the captured page values
|
|
3
|
+
* on `.crewlet-brand-scope`, the brand's steps and public tokens on
|
|
4
|
+
* `.crewlet-brand-scope__layer`) is @crewlethq/tokens' css/brand-scope,
|
|
5
|
+
* imported beside this file and built from the one source the artifact kit's
|
|
6
|
+
* brand layer is built from. This file is only the two elements' own shape.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* The outer element carries the inputs and the capture, and draws no box. */
|
|
10
|
+
.crewlet-brand-scope {
|
|
11
|
+
display: contents;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* THE BOX, with the body text and face of the brand, so plain text inside it
|
|
15
|
+
follows the brand without a rule of its own. It paints no ground. */
|
|
16
|
+
.crewlet-brand-scope__layer {
|
|
17
|
+
color: var(--color-text-primary);
|
|
18
|
+
font-family: var(--font-family-sans);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* A PINNED MODE is that mode for the platform's own drawing too: a native
|
|
22
|
+
control or a scrollbar inside a light preview on a dark page is light. */
|
|
23
|
+
.crewlet-brand-scope[data-mode='light'] > .crewlet-brand-scope__layer {
|
|
24
|
+
color-scheme: light;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.crewlet-brand-scope[data-mode='dark'] > .crewlet-brand-scope__layer {
|
|
28
|
+
color-scheme: dark;
|
|
29
|
+
}
|
|
@@ -24,6 +24,14 @@ export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement
|
|
|
24
24
|
* which is why it is a prop here rather than something a caller can spell.
|
|
25
25
|
*/
|
|
26
26
|
indeterminate?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The label is SAID AND NOT DRAWN: the box alone, on a target the pointer
|
|
29
|
+
* floor allows. For a box whose surroundings already show what it picks (a
|
|
30
|
+
* card's title, a row of a list), where printing "Select Q3 plan" beside it
|
|
31
|
+
* would only repeat the row. The label is still the box's name, so it still
|
|
32
|
+
* says what the box picks.
|
|
33
|
+
*/
|
|
34
|
+
hideLabel?: boolean | undefined;
|
|
27
35
|
/** The new state, for a caller that does not want to read it off an event. */
|
|
28
36
|
onCheckedChange?: (checked: boolean) => void;
|
|
29
37
|
}
|
package/dist/Checkbox/index.js
CHANGED
|
@@ -126,6 +126,24 @@
|
|
|
126
126
|
font-size: var(--font-size-compact);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
+
/*
|
|
130
|
+
* THE BARE BOX (`hideLabel`): no words beside it, so the row's floor and its
|
|
131
|
+
* gap go, and the box is centred on a square the pointer floor allows. The
|
|
132
|
+
* label is still its name, said rather than printed.
|
|
133
|
+
*/
|
|
134
|
+
.crewlet-checkbox--bare {
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
gap: 0;
|
|
139
|
+
min-width: var(--size-target-min);
|
|
140
|
+
min-height: var(--size-target-min);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.crewlet-checkbox--bare .crewlet-checkbox__control {
|
|
144
|
+
margin: 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
129
147
|
.crewlet-checkbox.is-disabled,
|
|
130
148
|
.crewlet-checkbox.is-disabled .crewlet-checkbox__control {
|
|
131
149
|
cursor: not-allowed;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface ColorFieldLabels {
|
|
3
|
+
/** Why a typed value was refused, with what right looks like. */
|
|
4
|
+
invalid: string;
|
|
5
|
+
/** Why an emptied required field was refused. */
|
|
6
|
+
missing: string;
|
|
7
|
+
/** Names the colour picker beside the field: "Pick the Primary colour". */
|
|
8
|
+
picker: (label: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* What the empty field shows: the shape a value takes, never a colour, which
|
|
11
|
+
* an empty field would seem to hold.
|
|
12
|
+
*/
|
|
13
|
+
placeholder: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ColorFieldProps {
|
|
16
|
+
/** The colour's role, which is the field's name: "Primary". */
|
|
17
|
+
label: string;
|
|
18
|
+
/**
|
|
19
|
+
* The colour as it stands, `#rrggbb`, or `''` for none. Controlled: the
|
|
20
|
+
* field reports a new value only once it is one.
|
|
21
|
+
*/
|
|
22
|
+
value: string;
|
|
23
|
+
/**
|
|
24
|
+
* A new colour: lowercase `#rrggbb`, or `''` when an optional field is
|
|
25
|
+
* emptied. Never called with a value that is not one, so a host never
|
|
26
|
+
* stores half a hex code.
|
|
27
|
+
*/
|
|
28
|
+
onChange: (value: string) => void;
|
|
29
|
+
/** An answer is required: emptying the field is refused rather than reported. */
|
|
30
|
+
required?: boolean | undefined;
|
|
31
|
+
/** Says "(optional)" beside the label. */
|
|
32
|
+
optional?: boolean | undefined;
|
|
33
|
+
/** Where the colour is used: "Links, buttons and accents". */
|
|
34
|
+
helper?: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* A refusal from elsewhere (the engine's), drawn as the field's error. The
|
|
37
|
+
* field's own refusal of a value it cannot read is drawn without it.
|
|
38
|
+
*/
|
|
39
|
+
error?: ReactNode;
|
|
40
|
+
disabled?: boolean | undefined;
|
|
41
|
+
/** The text field's name, for a form that posts. */
|
|
42
|
+
name?: string | undefined;
|
|
43
|
+
id?: string | undefined;
|
|
44
|
+
className?: string | undefined;
|
|
45
|
+
labels?: Partial<ColorFieldLabels> | undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A colour a person chooses: a hex field, a swatch that opens the platform's
|
|
49
|
+
* colour picker, and the reason a value was refused.
|
|
50
|
+
*
|
|
51
|
+
* THE VALUE IS `#` AND SIX HEX DIGITS, and nothing else is ever reported: the
|
|
52
|
+
* field holds what is being typed, and a value reaches `onChange` only once it
|
|
53
|
+
* reads as a colour, lowercased, the one spelling the engine stores. A value
|
|
54
|
+
* that does not read is refused when the reader leaves the field (Enter or
|
|
55
|
+
* Tab), never while they are still typing it, with a sentence saying what
|
|
56
|
+
* right looks like.
|
|
57
|
+
*
|
|
58
|
+
* THE SWATCH IS THE PICKER. It is the platform's own colour input, drawn as
|
|
59
|
+
* the chip of the colour the field holds and named for it, so it is a real,
|
|
60
|
+
* labelled control a keyboard reaches; picking a colour there writes it into
|
|
61
|
+
* the field. With no colour yet, the swatch is the hatch of none.
|
|
62
|
+
*/
|
|
63
|
+
export declare function ColorField({ label, value, onChange, required, optional, helper, error, disabled, name, id, className, labels, }: ColorFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { ColorField } from '../chunk-W6FOEBIL.js';
|
|
2
|
+
import '../chunk-UZMNR366.js';
|
|
3
|
+
import '../chunk-EXRRTKWT.js';
|
|
4
|
+
import '../chunk-XCUUI7E7.js';
|
|
5
|
+
import '../chunk-PQADV6P6.js';
|
|
6
|
+
import '../chunk-RSAQOKH3.js';
|
|
7
|
+
import '../chunk-H5XTJ7GJ.js';
|
|
8
|
+
import '../chunk-LACA4JGC.js';
|
|
9
|
+
import '../chunk-NUZHC6MM.js';
|
|
10
|
+
import '../chunk-BZFWDIV6.js';
|
|
11
|
+
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A colour a person chooses: the swatch that opens the platform's picker,
|
|
3
|
+
* beside the hex field. The swatch's fill is the one value that is not a
|
|
4
|
+
* token, and it arrives through `--crewlet-color-field-value` only after it
|
|
5
|
+
* has passed `#rrggbb`.
|
|
6
|
+
*/
|
|
7
|
+
.crewlet-color-field__row {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--spacing-2);
|
|
11
|
+
min-width: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* THE SWATCH IS THE PICKER: the platform's colour input lies over the chip,
|
|
16
|
+
* transparent, so a press anywhere on the chip opens it and the chip is what
|
|
17
|
+
* the reader sees, the same in every browser. Its edge is its own, so a
|
|
18
|
+
* colour that matches the page is still a chip.
|
|
19
|
+
*/
|
|
20
|
+
.crewlet-color-field__swatch {
|
|
21
|
+
/* The hatch of no colour, as a colour swatch draws it. */
|
|
22
|
+
--crewlet-color-field-hatch: repeating-linear-gradient(
|
|
23
|
+
-45deg,
|
|
24
|
+
var(--color-border-hatch) 0 1px,
|
|
25
|
+
transparent 1px var(--spacing-2)
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
position: relative;
|
|
29
|
+
display: inline-flex;
|
|
30
|
+
flex: none;
|
|
31
|
+
width: var(--size-control-md);
|
|
32
|
+
height: var(--size-control-md);
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
border-radius: var(--radius-md);
|
|
35
|
+
background: var(--crewlet-color-field-value, var(--color-surface-inset));
|
|
36
|
+
box-shadow: inset 0 0 0 1px var(--color-border-field);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.crewlet-color-field__swatch.is-empty {
|
|
40
|
+
background: var(--crewlet-color-field-hatch);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.crewlet-color-field__swatch.is-disabled {
|
|
44
|
+
opacity: 0.6;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.crewlet-color-field__picker {
|
|
48
|
+
position: absolute;
|
|
49
|
+
inset: 0;
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: 100%;
|
|
52
|
+
margin: 0;
|
|
53
|
+
padding: 0;
|
|
54
|
+
border: 0;
|
|
55
|
+
opacity: 0;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.crewlet-color-field__picker:disabled {
|
|
60
|
+
cursor: not-allowed;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* THE RING IS THE CHIP'S: the input under it is transparent, so the ring a
|
|
64
|
+
keyboard needs is drawn on what the reader sees. */
|
|
65
|
+
.crewlet-color-field__swatch:has(.crewlet-color-field__picker:focus-visible) {
|
|
66
|
+
outline: 2px solid var(--color-focus);
|
|
67
|
+
outline-offset: 0;
|
|
68
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ColorSwatchLabels {
|
|
3
|
+
/** Names the copy control: "Copy the Primary colour". */
|
|
4
|
+
copy: (name: string) => string;
|
|
5
|
+
/** Read out once the value is on the clipboard: "#5b3df5 copied to the clipboard". */
|
|
6
|
+
copied: (hex: string) => string;
|
|
7
|
+
/** Read out when the browser refused the clipboard. */
|
|
8
|
+
failed: string;
|
|
9
|
+
/** Printed in the value's place for a role with no colour. */
|
|
10
|
+
empty: string;
|
|
11
|
+
}
|
|
12
|
+
export type ColorSwatchSize = 'md' | 'sm';
|
|
13
|
+
export interface ColorSwatchProps {
|
|
14
|
+
/** The colour's role: "Primary", "Dark ground". */
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* The colour, as `#rrggbb`. Anything else (an empty role, a value that is
|
|
18
|
+
* not one) draws the hatch of no colour and says `empty`, and is never put
|
|
19
|
+
* into a style.
|
|
20
|
+
*/
|
|
21
|
+
value: string | null | undefined;
|
|
22
|
+
/** What the role is used for: "Links, buttons and accents". */
|
|
23
|
+
description?: ReactNode;
|
|
24
|
+
/** A copy control beside the value. On by default: a reader takes the value to use elsewhere. */
|
|
25
|
+
copyable?: boolean | undefined;
|
|
26
|
+
/** `sm` is a row of chips beside a name, for a dense list. */
|
|
27
|
+
size?: ColorSwatchSize | undefined;
|
|
28
|
+
className?: string | undefined;
|
|
29
|
+
labels?: Partial<ColorSwatchLabels> | undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One colour of a brand: a chip of it, its role, its value, and a control that
|
|
33
|
+
* copies the value and says whether it landed.
|
|
34
|
+
*
|
|
35
|
+
* THE VALUE IS PRINTED, so the chip is decoration: a reader who cannot tell
|
|
36
|
+
* two chips apart still reads two values. The value is drawn through one
|
|
37
|
+
* custom property, and only after it has passed `#rrggbb`, so a colour typed
|
|
38
|
+
* by a person never reaches a stylesheet as anything but a colour.
|
|
39
|
+
*
|
|
40
|
+
* THE CHIP HAS AN EDGE OF ITS OWN, so a colour that matches the page (white on
|
|
41
|
+
* a light theme, near black on a dark one) is still a chip.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ColorSwatch({ name, value, description, copyable, size, className, labels, }: ColorSwatchProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { ColorSwatch } from '../chunk-WLSEAIVC.js';
|
|
2
|
+
import '../chunk-7SHAFLEX.js';
|
|
3
|
+
import '../chunk-STJ7QBC3.js';
|
|
4
|
+
import '../chunk-DTIW4CHZ.js';
|
|
5
|
+
import '../chunk-UZMNR366.js';
|
|
6
|
+
import '../chunk-OG6CL3EB.js';
|
|
7
|
+
import '../chunk-LACA4JGC.js';
|
|
8
|
+
import '../chunk-BZFWDIV6.js';
|
|
9
|
+
import '../chunk-ODEQTPFM.js';
|