@crewlethq/ui 0.48.2 → 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 +60 -0
- package/dist/AgentHandoffPanel/index.js +4 -4
- package/dist/AppShell/index.js +4 -4
- package/dist/{AppShell-5P575KYA.css → AppShell-BIUFNT3J.css} +30 -11
- package/dist/ArrangeList/index.js +4 -4
- package/dist/ArtifactBar/index.js +9 -9
- package/dist/{ArtifactBar-6PGWGKN2.css → ArtifactBar-UMZCTARR.css} +9 -0
- package/dist/ArtifactCard/ArtifactCard.d.ts +30 -1
- package/dist/ArtifactCard/index.js +12 -5
- 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/AvatarPicker/index.js +7 -7
- 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/Canvas/index.js +2 -2
- package/dist/CanvasBoard/index.js +4 -4
- package/dist/CanvasToolbar/index.js +3 -3
- package/dist/Checkbox/Checkbox.d.ts +8 -0
- package/dist/Checkbox/index.js +3 -3
- 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 +3 -3
- package/dist/Combobox-GBCWXWEB.css +163 -0
- package/dist/CommandPalette/index.js +5 -5
- package/dist/CommentThread/index.js +5 -5
- package/dist/Composer/index.js +3 -3
- package/dist/ConfirmField/index.js +3 -3
- 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 +6 -6
- package/dist/DataView/index.js +10 -10
- package/dist/DateTimePicker/index.js +3 -3
- package/dist/DocTabsEditor/index.js +4 -4
- package/dist/{Editor-6U4BJ25W.js → Editor-MLGK3KOG.js} +3 -3
- 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/HuePicker/index.js +6 -6
- package/dist/Input/index.js +2 -2
- package/dist/LinkInterstitial/index.js +3 -3
- package/dist/ListInput/index.js +3 -3
- 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/MarkdownEditor/index.js +6 -6
- package/dist/Menu/index.js +2 -2
- package/dist/MergeConflicts/index.js +6 -6
- package/dist/Modal/Modal.d.ts +13 -0
- package/dist/Modal/index.js +2 -2
- package/dist/{Modal-TOEWHDCQ.css → Modal-3HMP7WAZ.css} +30 -0
- package/dist/OrgTable/index.js +1 -1
- package/dist/PresenterView/index.js +3 -3
- package/dist/PrincipalPicker/index.js +4 -4
- package/dist/RichEditor/index.js +1 -1
- package/dist/SegmentedControl/index.js +5 -5
- package/dist/Select/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 +6 -6
- package/dist/SheetColumnEditor/index.js +10 -10
- package/dist/SheetGrid/index.js +4 -4
- package/dist/SlideFilmstrip/index.js +3 -3
- package/dist/Switcher/index.js +4 -4
- package/dist/Tabs/index.js +4 -4
- package/dist/TagsInput/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/ThemeSwitcher/index.js +6 -6
- package/dist/TimeWindowPicker/index.js +6 -6
- package/dist/TreeCanvas/index.js +3 -3
- package/dist/TreeGrid/index.js +1 -1
- 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/VersionCompare/index.js +6 -6
- package/dist/{chunk-RBUA7ZNK.js → chunk-34RMTXDZ.js} +1 -1
- package/dist/{chunk-YFUG6ARA.js → chunk-3QSKDZR5.js} +1 -1
- package/dist/chunk-5SGHW42B.js +23 -0
- package/dist/{chunk-R2EOET5Q.js → chunk-627KFRON.js} +2 -2
- package/dist/{chunk-SMVWDO72.js → chunk-6FVGSWLS.js} +1 -1
- package/dist/{chunk-ILDNJHRU.js → chunk-AVL52EME.js} +1 -1
- package/dist/chunk-B235ANDO.js +66 -0
- package/dist/{chunk-MZ3QFQDL.js → chunk-CAVWDJF4.js} +1 -1
- package/dist/{chunk-BLQRC7QR.js → chunk-D6MTBXAJ.js} +2 -2
- package/dist/{chunk-2MYSESZF.js → chunk-FB5CFQTG.js} +82 -12
- package/dist/{chunk-KNMQS3JY.js → chunk-GHY63X4C.js} +1 -1
- package/dist/{chunk-DY4DQ7EB.js → chunk-GP4YWZFO.js} +1 -1
- package/dist/{chunk-NRWJUGNA.js → chunk-H55D66IK.js} +1 -1
- package/dist/{chunk-JNFTFAPN.js → chunk-H7NMJ5AI.js} +2 -2
- package/dist/{chunk-GKRPPSWY.js → chunk-ILFEWRLG.js} +1 -1
- package/dist/chunk-ITI2Z44C.js +139 -0
- package/dist/{chunk-P5VGSVWG.js → chunk-J24Q4HTD.js} +17 -8
- package/dist/{chunk-2FDTSARB.js → chunk-JFDIMO3A.js} +2 -2
- package/dist/chunk-JKAFEFFC.js +44 -0
- package/dist/{chunk-6HYPQ5PY.js → chunk-JWNYI7UD.js} +1 -1
- package/dist/{chunk-WT5UPL6P.js → chunk-KHZYAEGZ.js} +1 -1
- package/dist/chunk-M4QM477B.js +80 -0
- package/dist/{chunk-YUDUYMZB.js → chunk-MIEBOO7Y.js} +2 -2
- package/dist/{chunk-IVA7ZWDS.js → chunk-NAWUXCBC.js} +5 -5
- package/dist/{chunk-YUAQSWNW.js → chunk-NCHKKYPQ.js} +6 -3
- 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-WQJSOTEO.js → chunk-PGR2PKH6.js} +1 -1
- package/dist/{chunk-U2XAJONO.js → chunk-Q44X36QC.js} +80 -36
- package/dist/{chunk-R2IBCEU6.js → chunk-R3BA3C4Y.js} +2 -2
- package/dist/{chunk-HDMLHJFI.js → chunk-R6R2UHVG.js} +4 -4
- package/dist/{chunk-VBEMIZIJ.js → chunk-RFPCHMSX.js} +1 -1
- package/dist/{chunk-CE2THTQR.js → chunk-RSKW25Y5.js} +4 -3
- package/dist/{chunk-UBZDYOCA.js → chunk-RV6XB5UV.js} +12 -1
- package/dist/{chunk-LXCRHVMZ.js → chunk-SEPSXOGJ.js} +1 -1
- package/dist/{chunk-K2FNW3MK.js → chunk-SQ4JFHO7.js} +1 -1
- package/dist/{chunk-F45VSK2M.js → chunk-SS4XCUUJ.js} +2 -2
- package/dist/{chunk-E4BOVKNJ.js → chunk-UTESMBPL.js} +5 -3
- package/dist/chunk-UZMNR366.js +9 -0
- package/dist/{chunk-GQXVLFQB.js → chunk-V7GOOXPK.js} +1 -1
- package/dist/{chunk-KMNY3KEB.js → chunk-VBIM6HFC.js} +2 -2
- package/dist/{chunk-Z5RZXVQ7.js → chunk-VN47PYUF.js} +7 -7
- package/dist/{chunk-CNTBUK24.js → chunk-VP2ODUCC.js} +2 -2
- package/dist/{chunk-VIAQW6RK.js → chunk-VTSJMDGP.js} +5 -5
- package/dist/chunk-W6FOEBIL.js +119 -0
- package/dist/chunk-WLSEAIVC.js +48 -0
- package/dist/{chunk-DETVVKAH.js → chunk-WQ7S7CKZ.js} +3 -3
- package/dist/{chunk-OKUULQ22.js → chunk-WXOYHVWG.js} +2 -2
- package/dist/{chunk-NILOJV62.js → chunk-X4NIE7CI.js} +1 -1
- package/dist/{chunk-PZZHO6OS.js → chunk-XS2FJVMT.js} +1 -1
- package/dist/{chunk-6AKG2VLR.js → chunk-YCC2S7DF.js} +4 -1
- package/dist/{chunk-5CLWBPB5.js → chunk-ZCIL5IHU.js} +1 -1
- package/dist/chunk-ZH77BXMA.js +14 -0
- package/dist/generated/index.d.ts +10 -0
- package/dist/generated/index.js +101 -89
- package/dist/index.js +101 -89
- package/dist/styles.css +1370 -22
- 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-LOBV4QON.js +0 -137
- package/dist/{chunk-245IXG5P.js → chunk-3WMOEGEL.js} +0 -0
- package/dist/{chunk-ICPQIAD6.js → chunk-D7Q5MQRF.js} +1 -1
- package/dist/{chunk-ISDEXIXH.js → chunk-E6HXFFWO.js} +1 -1
- package/dist/{chunk-D4EOPIFL.js → chunk-EXRRTKWT.js} +1 -1
- package/dist/{chunk-S6J3EWDP.js → chunk-SXBJMBSV.js} +1 -1
- package/dist/{chunk-3JIZ2A6K.js → chunk-TMM32U7D.js} +1 -1
- package/dist/{chunk-LD3GEVQU.js → chunk-XQZ6EWOE.js} +1 -1
- package/dist/{chunk-K77LKW3X.js → chunk-ZFM5L7M4.js} +2 -2
|
@@ -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';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* One colour of a brand: a chip of it over its role and its value. The chip's
|
|
3
|
+
* fill is the one value that is not a token, and it arrives through
|
|
4
|
+
* `--crewlet-color-swatch-value` only after it has passed `#rrggbb`. Every
|
|
5
|
+
* other colour here is a token.
|
|
6
|
+
*/
|
|
7
|
+
.crewlet-color-swatch {
|
|
8
|
+
/* The hatch of no colour, as one value: the same lines an arranged page's
|
|
9
|
+
ground draws, so "nothing here" reads one way across the package. */
|
|
10
|
+
--crewlet-color-swatch-hatch: repeating-linear-gradient(
|
|
11
|
+
-45deg,
|
|
12
|
+
var(--color-border-hatch) 0 1px,
|
|
13
|
+
transparent 1px var(--spacing-2)
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--spacing-2);
|
|
19
|
+
min-width: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* THE CHIP HAS AN EDGE OF ITS OWN, so a colour that matches the page is
|
|
23
|
+
still a chip rather than a gap. */
|
|
24
|
+
.crewlet-color-swatch__chip {
|
|
25
|
+
display: block;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: var(--size-row-lg);
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
border-radius: var(--radius-md);
|
|
30
|
+
background: var(--crewlet-color-swatch-value, var(--color-surface-inset));
|
|
31
|
+
box-shadow: inset 0 0 0 1px var(--color-border-hover);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.crewlet-color-swatch__chip.is-empty {
|
|
35
|
+
background: var(--crewlet-color-swatch-hatch);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.crewlet-color-swatch__words {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 2px;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.crewlet-color-swatch__name {
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
color: var(--color-text-primary);
|
|
48
|
+
font-size: var(--font-size-sm);
|
|
49
|
+
font-weight: var(--font-weight-medium);
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.crewlet-color-swatch__description {
|
|
55
|
+
color: var(--color-text-tertiary);
|
|
56
|
+
font-size: var(--font-size-xs);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.crewlet-color-swatch__value--plain {
|
|
60
|
+
color: var(--color-text-secondary);
|
|
61
|
+
font-family: var(--font-family-mono);
|
|
62
|
+
font-size: var(--font-size-xs);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.crewlet-color-swatch__empty {
|
|
66
|
+
color: var(--color-text-tertiary);
|
|
67
|
+
font-size: var(--font-size-xs);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ---- sm: a chip beside the words, for a dense list ---- */
|
|
71
|
+
|
|
72
|
+
.crewlet-color-swatch--sm {
|
|
73
|
+
flex-direction: row;
|
|
74
|
+
align-items: center;
|
|
75
|
+
gap: var(--spacing-2);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.crewlet-color-swatch--sm .crewlet-color-swatch__chip {
|
|
79
|
+
flex: none;
|
|
80
|
+
width: var(--size-control-sm);
|
|
81
|
+
height: var(--size-control-sm);
|
|
82
|
+
border-radius: var(--radius-sm);
|
|
83
|
+
}
|
|
@@ -20,7 +20,8 @@ export interface ComboboxListRender {
|
|
|
20
20
|
/** Mouse wiring for the row at `index`. */
|
|
21
21
|
optionHandlers: (index: number) => Record<string, unknown>;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
/** What every combobox takes, whether its list is a popup or always on screen. */
|
|
24
|
+
export interface ComboboxBaseProps extends Omit<InputProps, 'value' | 'onChange' | 'role' | 'onKeyDown' | 'list'> {
|
|
24
25
|
/** What the field holds. The caller owns it: a completion is an edit to it. */
|
|
25
26
|
value: string;
|
|
26
27
|
onValueChange: (next: string) => void;
|
|
@@ -45,9 +46,6 @@ export interface ComboboxProps extends Omit<InputProps, 'value' | 'onChange' | '
|
|
|
45
46
|
* `${NAME}` inside a longer value) does it itself.
|
|
46
47
|
*/
|
|
47
48
|
onCommit?: ((option: ComboboxOption, index: number) => void) | undefined;
|
|
48
|
-
/** Whether the list is on screen. Controlled: only the caller knows when it has something to offer. */
|
|
49
|
-
open: boolean;
|
|
50
|
-
onOpenChange: (open: boolean) => void;
|
|
51
49
|
/** Names the list. A listbox with no name is announced as "list box" and nothing else. */
|
|
52
50
|
label: string;
|
|
53
51
|
/**
|
|
@@ -67,6 +65,35 @@ export interface ComboboxProps extends Omit<InputProps, 'value' | 'onChange' | '
|
|
|
67
65
|
/** The line shown while the list is open with nothing to offer. Nothing is drawn without one. */
|
|
68
66
|
emptyMessage?: ReactNode;
|
|
69
67
|
}
|
|
68
|
+
/** A field that offers completions in a list that opens under it. */
|
|
69
|
+
export interface ComboboxPopupProps extends ComboboxBaseProps {
|
|
70
|
+
inline?: false | undefined;
|
|
71
|
+
/** Whether the list is on screen. Controlled: only the caller knows when it has something to offer. */
|
|
72
|
+
open: boolean;
|
|
73
|
+
onOpenChange: (open: boolean) => void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A field over a list that is always on screen: a picker whose list IS the
|
|
77
|
+
* surface's body (a folder picker in a dialog), filtered by the field.
|
|
78
|
+
*/
|
|
79
|
+
export interface ComboboxInlineProps extends ComboboxBaseProps {
|
|
80
|
+
/**
|
|
81
|
+
* The list is part of the surface rather than a popup: always on screen,
|
|
82
|
+
* in the flow under the field, at a stable height, filtered by what the
|
|
83
|
+
* field holds. See the component's notes.
|
|
84
|
+
*/
|
|
85
|
+
inline: true;
|
|
86
|
+
/** How many rows the list shows before it scrolls, and so how tall it stands. Six by default. */
|
|
87
|
+
rows?: number | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* The value of the option chosen so far: drawn chosen, announced as
|
|
90
|
+
* selected, and where the highlight starts.
|
|
91
|
+
*/
|
|
92
|
+
chosen?: string | undefined;
|
|
93
|
+
open?: undefined;
|
|
94
|
+
onOpenChange?: undefined;
|
|
95
|
+
}
|
|
96
|
+
export type ComboboxProps = ComboboxPopupProps | ComboboxInlineProps;
|
|
70
97
|
/**
|
|
71
98
|
* A text field that offers completions.
|
|
72
99
|
*
|
|
@@ -81,6 +108,20 @@ export interface ComboboxProps extends Omit<InputProps, 'value' | 'onChange' | '
|
|
|
81
108
|
* field stays open; a second Escape reaches it. Without that, somebody
|
|
82
109
|
* dismissing a completion they did not want lost the whole editor with it.
|
|
83
110
|
*
|
|
111
|
+
* INLINE (`inline`), THE LIST IS THE SURFACE'S BODY. For a picker whose list
|
|
112
|
+
* is the point of the dialog it sits in (Move to…), the list is always on
|
|
113
|
+
* screen, in the flow under the field, filtered by it: no popup, no portal,
|
|
114
|
+
* nothing that opens or closes. A list that closed when the field lost focus
|
|
115
|
+
* made the dialog shrink under the pointer between the press on Cancel and
|
|
116
|
+
* its release, so the click landed on the veil. Its box keeps one height
|
|
117
|
+
* (`rows`) whatever the filter leaves in it, so nothing under it moves as
|
|
118
|
+
* somebody types, and says so in its own row when nothing matches. The keys
|
|
119
|
+
* are the popup's (the arrows step over a disabled row, Enter takes the
|
|
120
|
+
* highlighted one, the letters filter), Home and End reach the first and the
|
|
121
|
+
* last row while the field is empty and are the caret's once it holds text,
|
|
122
|
+
* and Escape is never its own: there is nothing to dismiss, so it reaches the
|
|
123
|
+
* dialog. `chosen` marks the option picked so far as selected.
|
|
124
|
+
*
|
|
84
125
|
* WHAT IT DOES NOT DECIDE is what matches. The caller filters and hands over
|
|
85
126
|
* what is offered, because a completion's question belongs to the value: the
|
|
86
127
|
* engine's secret references complete on the name under the caret, not on the
|
package/dist/Combobox/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '../HitArea/HitArea.css';
|
|
2
2
|
import './Combobox.css';
|
|
3
3
|
export { Combobox } from './Combobox.js';
|
|
4
|
-
export type { ComboboxListRender, ComboboxOption, ComboboxProps } from './Combobox.js';
|
|
4
|
+
export type { ComboboxBaseProps, ComboboxInlineProps, ComboboxListRender, ComboboxOption, ComboboxPopupProps, ComboboxProps, } from './Combobox.js';
|
package/dist/Combobox/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { Combobox } from '../chunk-
|
|
1
|
+
export { Combobox } from '../chunk-P5JBDHWC.js';
|
|
2
2
|
import '../chunk-7KHM2FZH.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-EXRRTKWT.js';
|
|
4
4
|
import '../chunk-XCUUI7E7.js';
|
|
5
5
|
import '../chunk-PQADV6P6.js';
|
|
6
6
|
import '../chunk-RSAQOKH3.js';
|
|
7
7
|
import '../chunk-2YTOOH3A.js';
|
|
8
8
|
import '../chunk-H5XTJ7GJ.js';
|
|
9
|
-
import '../chunk-NUZHC6MM.js';
|
|
10
9
|
import '../chunk-LACA4JGC.js';
|
|
10
|
+
import '../chunk-NUZHC6MM.js';
|
|
11
11
|
import '../chunk-BZFWDIV6.js';
|
|
12
12
|
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Combobox: a field that offers completions.
|
|
3
|
+
*
|
|
4
|
+
* The panel is anchored inside the field's own box rather than portalled or
|
|
5
|
+
* laid out in the flow. In the flow it pushed every field under it down the
|
|
6
|
+
* form as somebody typed; portalled, it would have to be placed, followed and
|
|
7
|
+
* given a layer of its own for a list that never leaves its field's side.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.crewlet-combobox {
|
|
11
|
+
position: relative;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.crewlet-combobox__panel {
|
|
16
|
+
/* Six rows and a scroll, as every list this package offers from a field. */
|
|
17
|
+
--crewlet-combobox-panel-max-height: 12rem;
|
|
18
|
+
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: calc(100% + var(--spacing-1));
|
|
21
|
+
left: 0;
|
|
22
|
+
right: 0;
|
|
23
|
+
max-height: var(--crewlet-combobox-panel-max-height);
|
|
24
|
+
overflow-y: auto;
|
|
25
|
+
overscroll-behavior: contain;
|
|
26
|
+
padding: var(--spacing-1);
|
|
27
|
+
--crewlet-listbox-gap: 1px;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: var(--crewlet-listbox-gap);
|
|
31
|
+
/*
|
|
32
|
+
* OPAQUE, and the product's own panel surface: a translucent list over a
|
|
33
|
+
* form puts two sets of words in the same place, and the words underneath
|
|
34
|
+
* are a label and a value somebody is in the middle of typing.
|
|
35
|
+
*/
|
|
36
|
+
background: var(--color-surface-subtle);
|
|
37
|
+
border: 1px solid var(--color-border-default);
|
|
38
|
+
border-radius: var(--radius-md);
|
|
39
|
+
box-shadow: var(--shadow-md);
|
|
40
|
+
/* Above the fields below it, and nothing more: it never leaves its form. */
|
|
41
|
+
z-index: var(--z-index-dropdown);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Names read exactly rather than for sense: a secret reference, a path, a key. */
|
|
45
|
+
.crewlet-combobox__panel.is-mono .crewlet-combobox__label {
|
|
46
|
+
font-family: var(--font-family-mono);
|
|
47
|
+
font-size: var(--font-size-compact);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.crewlet-combobox__label {
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* The row the arrows or the pointer are on, in the hover tint. The accent is
|
|
58
|
+
* what "here, this is the current one" means elsewhere in the product; a
|
|
59
|
+
* completion list has no current one, only the row about to be taken.
|
|
60
|
+
*
|
|
61
|
+
* Scoped to the panel rather than written on the row class, because the
|
|
62
|
+
* shared listbox register paints [aria-selected] itself and the stylesheets
|
|
63
|
+
* are bundled in hash order: a rule of equal weight would win or lose by the
|
|
64
|
+
* name of a build artefact.
|
|
65
|
+
*/
|
|
66
|
+
.crewlet-combobox__panel .crewlet-listbox__option {
|
|
67
|
+
border-radius: var(--radius-xs);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.crewlet-combobox__panel .crewlet-listbox__option[aria-selected='true'],
|
|
71
|
+
.crewlet-combobox__panel .crewlet-listbox__option.is-highlight,
|
|
72
|
+
.crewlet-combobox__panel .crewlet-listbox__option:hover {
|
|
73
|
+
background: var(--color-surface-hover);
|
|
74
|
+
color: var(--color-text-primary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.crewlet-combobox__panel .crewlet-listbox__option.is-disabled {
|
|
78
|
+
background: transparent;
|
|
79
|
+
color: var(--color-text-tertiary);
|
|
80
|
+
cursor: not-allowed;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* ---- inline (`inline`): the list is the surface's body ------------------
|
|
84
|
+
Always on screen, in the flow under the field, at ONE HEIGHT: the box is
|
|
85
|
+
`rows` one-line rows tall (`--crewlet-combobox-rows`, set by the component)
|
|
86
|
+
whatever the filter leaves in it, so nothing under it moves as somebody
|
|
87
|
+
types, and it scrolls past that. It sits on the surface's own ground inside
|
|
88
|
+
a hairline, because it is part of the surface rather than a panel over it. */
|
|
89
|
+
.crewlet-combobox--inline {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: var(--spacing-2);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.crewlet-combobox__list {
|
|
96
|
+
/* ONE ROW IS ONE ROW STEP, exactly: a row's own height is held to it
|
|
97
|
+
below, so a label that draws a glyph beside its words is no taller than
|
|
98
|
+
one that does not, and `rows` rows fill the box to the pixel. */
|
|
99
|
+
--crewlet-combobox-row: var(--size-row-md);
|
|
100
|
+
--crewlet-listbox-gap: 1px;
|
|
101
|
+
|
|
102
|
+
height: calc(
|
|
103
|
+
var(--crewlet-combobox-rows) * var(--crewlet-combobox-row) + (var(--crewlet-combobox-rows) - 1) * var(--crewlet-listbox-gap) +
|
|
104
|
+
var(--spacing-1) * 2 + 2px
|
|
105
|
+
);
|
|
106
|
+
box-sizing: border-box;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
border: 1px solid var(--color-border-default);
|
|
109
|
+
border-radius: var(--radius-md);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.crewlet-combobox__options {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: column;
|
|
115
|
+
gap: var(--crewlet-listbox-gap);
|
|
116
|
+
height: 100%;
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
padding: var(--spacing-1);
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
overscroll-behavior: contain;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.crewlet-combobox__list.is-mono .crewlet-combobox__label {
|
|
124
|
+
font-family: var(--font-family-mono);
|
|
125
|
+
font-size: var(--font-size-compact);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.crewlet-combobox__options .crewlet-listbox__option {
|
|
129
|
+
height: var(--crewlet-combobox-row);
|
|
130
|
+
min-height: 0;
|
|
131
|
+
padding-block: 0;
|
|
132
|
+
border-radius: var(--radius-xs);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* The row the arrows or the pointer are on, in the hover tint, as the popup
|
|
136
|
+
draws it. Scoped to the list for the same reason as the panel's. */
|
|
137
|
+
.crewlet-combobox__options .crewlet-listbox__option.is-highlight,
|
|
138
|
+
.crewlet-combobox__options .crewlet-listbox__option:hover {
|
|
139
|
+
background: var(--color-surface-hover);
|
|
140
|
+
color: var(--color-text-primary);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/*
|
|
144
|
+
* THE CHOSEN ROW (`chosen`), as every chosen option in the package is drawn:
|
|
145
|
+
* the selected fill, never the accent, with a tick in the accent's ink so the
|
|
146
|
+
* choice never rests on the tint. It keeps its fill under the arrows too.
|
|
147
|
+
*/
|
|
148
|
+
.crewlet-combobox__options .crewlet-listbox__option[aria-selected='true'] {
|
|
149
|
+
background: var(--color-surface-selected);
|
|
150
|
+
color: var(--color-text-primary);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.crewlet-combobox__check {
|
|
154
|
+
display: inline-flex;
|
|
155
|
+
flex: none;
|
|
156
|
+
color: var(--color-brand-accent-ink);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.crewlet-combobox__options .crewlet-listbox__option.is-disabled {
|
|
160
|
+
background: transparent;
|
|
161
|
+
color: var(--color-text-tertiary);
|
|
162
|
+
cursor: not-allowed;
|
|
163
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { CommandPalette } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { CommandPalette } from '../chunk-MIEBOO7Y.js';
|
|
2
|
+
import '../chunk-YCC2S7DF.js';
|
|
3
3
|
import '../chunk-7KHM2FZH.js';
|
|
4
4
|
import '../chunk-SMBKXWML.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-EXRRTKWT.js';
|
|
6
6
|
import '../chunk-XCUUI7E7.js';
|
|
7
7
|
import '../chunk-BHHIIK3M.js';
|
|
8
8
|
import '../chunk-PQADV6P6.js';
|
|
9
9
|
import '../chunk-RSAQOKH3.js';
|
|
10
|
-
import '../chunk-2YTOOH3A.js';
|
|
11
10
|
import '../chunk-OMV5W53A.js';
|
|
11
|
+
import '../chunk-2YTOOH3A.js';
|
|
12
12
|
import '../chunk-OG6CL3EB.js';
|
|
13
13
|
import '../chunk-H5XTJ7GJ.js';
|
|
14
|
-
import '../chunk-NUZHC6MM.js';
|
|
15
14
|
import '../chunk-LACA4JGC.js';
|
|
15
|
+
import '../chunk-NUZHC6MM.js';
|
|
16
16
|
import '../chunk-BZFWDIV6.js';
|
|
17
17
|
import '../chunk-ODEQTPFM.js';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { COMMENT_THREAD_LABELS, CommentThread } from '../chunk-
|
|
2
|
-
import '../chunk-PWG3VHRQ.js';
|
|
1
|
+
export { COMMENT_THREAD_LABELS, CommentThread } from '../chunk-H7NMJ5AI.js';
|
|
3
2
|
import '../chunk-CI3VPIJN.js';
|
|
4
3
|
import '../chunk-3CZ7XAVY.js';
|
|
5
4
|
import '../chunk-EUCC37WY.js';
|
|
6
5
|
import '../chunk-5AQBPHZD.js';
|
|
7
6
|
import '../chunk-PZKHBB7D.js';
|
|
8
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-PWG3VHRQ.js';
|
|
8
|
+
import '../chunk-GHY63X4C.js';
|
|
9
9
|
import '../chunk-SMBKXWML.js';
|
|
10
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-EXRRTKWT.js';
|
|
11
11
|
import '../chunk-XCUUI7E7.js';
|
|
12
12
|
import '../chunk-BHHIIK3M.js';
|
|
13
13
|
import '../chunk-PQADV6P6.js';
|
|
14
14
|
import '../chunk-RSAQOKH3.js';
|
|
15
15
|
import '../chunk-OG6CL3EB.js';
|
|
16
16
|
import '../chunk-H5XTJ7GJ.js';
|
|
17
|
-
import '../chunk-NUZHC6MM.js';
|
|
18
17
|
import '../chunk-LACA4JGC.js';
|
|
18
|
+
import '../chunk-NUZHC6MM.js';
|
|
19
19
|
import '../chunk-BZFWDIV6.js';
|
|
20
20
|
import '../chunk-ODEQTPFM.js';
|
package/dist/Composer/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { COMPOSER_COUNTER_AT, Composer } from '../chunk-
|
|
1
|
+
export { COMPOSER_COUNTER_AT, Composer } from '../chunk-GHY63X4C.js';
|
|
2
2
|
import '../chunk-SMBKXWML.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-EXRRTKWT.js';
|
|
4
4
|
import '../chunk-XCUUI7E7.js';
|
|
5
5
|
import '../chunk-PQADV6P6.js';
|
|
6
6
|
import '../chunk-RSAQOKH3.js';
|
|
7
7
|
import '../chunk-H5XTJ7GJ.js';
|
|
8
|
-
import '../chunk-NUZHC6MM.js';
|
|
9
8
|
import '../chunk-LACA4JGC.js';
|
|
9
|
+
import '../chunk-NUZHC6MM.js';
|
|
10
10
|
import '../chunk-BZFWDIV6.js';
|
|
11
11
|
import '../chunk-ODEQTPFM.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { ConfirmField, confirmMatches } from '../chunk-
|
|
1
|
+
export { ConfirmField, confirmMatches } from '../chunk-ZCIL5IHU.js';
|
|
2
2
|
import '../chunk-5CLW2CXT.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-EXRRTKWT.js';
|
|
4
4
|
import '../chunk-XCUUI7E7.js';
|
|
5
5
|
import '../chunk-PQADV6P6.js';
|
|
6
6
|
import '../chunk-RSAQOKH3.js';
|
|
7
7
|
import '../chunk-H5XTJ7GJ.js';
|
|
8
|
-
import '../chunk-NUZHC6MM.js';
|
|
9
8
|
import '../chunk-LACA4JGC.js';
|
|
9
|
+
import '../chunk-NUZHC6MM.js';
|
|
10
10
|
import '../chunk-BZFWDIV6.js';
|
|
11
11
|
import '../chunk-ODEQTPFM.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a pair is read as. `body` is text at the body's size, held to 4.5:1
|
|
3
|
+
* for AA and 7:1 for AAA. `large` is large text and every graphical mark (a
|
|
4
|
+
* logo, an accent on a ground), held to 3:1 for AA and 4.5:1 for AAA.
|
|
5
|
+
*/
|
|
6
|
+
export type ContrastScale = 'body' | 'large';
|
|
7
|
+
/**
|
|
8
|
+
* Where a pair stands: AAA, AA, AA for large text only (body text that clears
|
|
9
|
+
* 3:1 but not 4.5:1), or under every floor its scale has.
|
|
10
|
+
*/
|
|
11
|
+
export type ContrastLevel = 'aaa' | 'aa' | 'aa-large' | 'fail';
|
|
12
|
+
/**
|
|
13
|
+
* The level a measured ratio reaches, on the floors `@crewlethq/tokens`
|
|
14
|
+
* exports. The ratio is compared UNROUNDED: a pair that passes only once
|
|
15
|
+
* rounded does not pass.
|
|
16
|
+
*/
|
|
17
|
+
export declare function contrastLevel(ratio: number, scale?: ContrastScale): ContrastLevel;
|
|
18
|
+
/**
|
|
19
|
+
* The ratio between two `#rrggbb` colours, or null when either is not one.
|
|
20
|
+
* The one measurement every brand part takes, from `@crewlethq/tokens`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function contrastRatio(foreground: string, background: string): number | null;
|
|
23
|
+
/**
|
|
24
|
+
* A ratio as printed, cut DOWN to two places and never rounded up, so the
|
|
25
|
+
* number shown never claims a floor the pair misses: 4.497 is "4.49", not
|
|
26
|
+
* "4.5".
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatContrastRatio(ratio: number): string;
|
|
29
|
+
export interface ContrastBadgeLabels {
|
|
30
|
+
levels: Record<ContrastLevel, string>;
|
|
31
|
+
/** Said for a pair that cannot be measured (a colour not set yet). */
|
|
32
|
+
unmeasured: string;
|
|
33
|
+
/** The ratio, said in words: "4.49 to 1". */
|
|
34
|
+
ratio: (ratio: string) => string;
|
|
35
|
+
/** The letters the sample draws the pair with. */
|
|
36
|
+
sample: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ContrastBadgeProps {
|
|
39
|
+
/** The colour read: text, a logo, an accent. `#rrggbb`. */
|
|
40
|
+
foreground: string;
|
|
41
|
+
/** The colour it is read on. `#rrggbb`. */
|
|
42
|
+
background: string;
|
|
43
|
+
/** What the pair is: "Text on light ground". */
|
|
44
|
+
label?: string | undefined;
|
|
45
|
+
/** What it is read as: body text (the default), or large text and marks. */
|
|
46
|
+
scale?: ContrastScale | undefined;
|
|
47
|
+
className?: string | undefined;
|
|
48
|
+
labels?: Partial<ContrastBadgeLabels> | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Whether one colour reads on another: a sample of the pair, the measured
|
|
52
|
+
* ratio, and the level it reaches.
|
|
53
|
+
*
|
|
54
|
+
* THE MEASUREMENT IS THE TOKENS PACKAGE'S. The ratio comes from
|
|
55
|
+
* `@crewlethq/tokens`' `contrast()`, the same maths the palette suite holds
|
|
56
|
+
* every theme to, and the floors from its `WCAG_CONTRAST`, so the badge an
|
|
57
|
+
* administrator reads and the gate a theme passes never disagree.
|
|
58
|
+
*
|
|
59
|
+
* THE LEVEL IS A WORD AND A GLYPH, never the tint alone, and the ratio is
|
|
60
|
+
* said as "4.49 to 1" rather than read out as punctuation. The sample is
|
|
61
|
+
* decoration: it shows the pair, and the words say how it measures.
|
|
62
|
+
*/
|
|
63
|
+
export declare function ContrastBadge({ foreground, background, label, scale, className, labels }: ContrastBadgeProps): import("react").JSX.Element;
|