@crewlethq/ui 0.4.4 → 0.5.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 +888 -24
- package/dist/Accordion/index.js +2 -2
- package/dist/AddPill/index.js +1 -1
- package/dist/{AddPill-DFWXYLIQ.css → AddPill-IJQYCY6C.css} +9 -0
- package/dist/AppShell/AppShell.d.ts +26 -5
- package/dist/AppShell/index.js +3 -3
- package/dist/{AppShell-NVE6LHNI.css → AppShell-XARELGIH.css} +178 -25
- package/dist/Avatar/Avatar.d.ts +85 -40
- package/dist/Avatar/AvatarStack.d.ts +76 -0
- package/dist/Avatar/index.d.ts +5 -2
- package/dist/Avatar/index.js +1 -1
- package/dist/Avatar-XID7Z74C.css +200 -0
- package/dist/AvatarStack-GEJBNV7E.css +72 -0
- package/dist/BrandLockup/index.js +1 -1
- package/dist/{BrandLockup-6ISDEHPJ.css → BrandLockup-JKGXFCZF.css} +25 -19
- package/dist/Button/Button.d.ts +7 -2
- package/dist/Button/index.js +1 -1
- package/dist/{Button-D4J6B4MA.css → Button-X4B2TJAQ.css} +50 -19
- package/dist/Callout/index.js +1 -1
- package/dist/Canvas/index.js +4 -4
- package/dist/Card/Card.d.ts +9 -5
- package/dist/Card/index.js +1 -1
- package/dist/{Card-RLR254LD.css → Card-GLP7SUV6.css} +25 -18
- package/dist/Charts/BarList.d.ts +18 -1
- package/dist/Charts/ChartTooltip.d.ts +68 -0
- package/dist/Charts/StackedBar.d.ts +25 -7
- package/dist/Charts/StackedColumns.d.ts +112 -0
- package/dist/Charts/TimeSeries.d.ts +33 -2
- package/dist/Charts/dataColor.d.ts +22 -14
- package/dist/Charts/index.d.ts +6 -0
- package/dist/Charts/index.js +1 -1
- package/dist/Charts/useChartHover.d.ts +56 -0
- package/dist/Charts-B3YEF7R4.css +742 -0
- package/dist/Checkbox/index.js +1 -1
- package/dist/{Checkbox-VGW26YLQ.css → Checkbox-BOXQ747I.css} +2 -2
- package/dist/CodeBlock/index.js +4 -4
- package/dist/Combobox/index.js +5 -5
- package/dist/CommandPalette/CommandPalette.d.ts +97 -6
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +9 -7
- package/dist/CommandPalette-C5AMKGN2.css +259 -0
- package/dist/Copyable/index.js +3 -3
- package/dist/DataTable/index.js +7 -7
- package/dist/{DataTable-37UWTRN6.css → DataTable-OLHPF7D4.css} +35 -38
- package/dist/DataView/index.js +15 -15
- package/dist/{DataView-256YF32J.css → DataView-N6JX464S.css} +5 -4
- package/dist/DateTimePicker/index.js +5 -5
- package/dist/DiffList/index.js +1 -1
- package/dist/Disclosure/index.js +2 -2
- package/dist/EntityChip/EntityChip.d.ts +9 -12
- package/dist/EntityChip/index.d.ts +1 -1
- package/dist/EntityChip/index.js +2 -2
- package/dist/ErrorBoundary/index.js +2 -2
- package/dist/{ErrorBoundary-ME36CQTA.css → ErrorBoundary-U2PA3LY2.css} +4 -4
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-VQGNMJDI.css → IconButton-TVEUWK6L.css} +2 -2
- package/dist/ImageUpload/ImageUpload.d.ts +10 -7
- package/dist/ImageUpload/index.js +2 -2
- package/dist/{ImageUpload-HKFIZR6D.css → ImageUpload-YCHJMUGX.css} +24 -10
- package/dist/Input/index.js +2 -2
- package/dist/Kbd/Kbd.d.ts +14 -4
- package/dist/Kbd/index.js +1 -1
- package/dist/Kbd-JPLDVJIP.css +71 -0
- package/dist/Layer/index.js +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/List/index.js +1 -1
- package/dist/{List-XTHESXLR.css → List-MYJIV6MP.css} +12 -2
- package/dist/ListInput/index.js +6 -6
- package/dist/Listbox/index.js +2 -2
- package/dist/Listbox/useListbox.d.ts +2 -0
- package/dist/{Listbox-ZXYYNN6U.css → Listbox-6WJNJQVQ.css} +32 -7
- package/dist/Menu/index.js +4 -4
- package/dist/Meter/Meter.d.ts +103 -16
- package/dist/Meter/index.d.ts +2 -2
- package/dist/Meter/index.js +1 -1
- package/dist/{Meter-SKOOXQBC.css → Meter-5VCSFMZW.css} +46 -7
- package/dist/Modal/index.js +4 -4
- package/dist/{Modal-XYQJ4BL6.css → Modal-JAYBS2KS.css} +13 -4
- package/dist/OrgLabel/OrgLabel.d.ts +60 -24
- package/dist/OrgLabel/index.d.ts +1 -1
- package/dist/OrgLabel/index.js +2 -1
- package/dist/{OrgLabel-D7U6QJZD.css → OrgLabel-CR233G34.css} +9 -18
- package/dist/OrgNode/index.js +3 -2
- package/dist/OrgTable/OrgTable.d.ts +2 -2
- package/dist/OrgTable/index.js +8 -7
- package/dist/Popover/index.js +2 -2
- package/dist/PricingCard/index.js +3 -3
- package/dist/{PricingCard-JFI7RYXP.css → PricingCard-7EFXRSD2.css} +4 -5
- package/dist/SearchTrigger/SearchTrigger.d.ts +23 -4
- package/dist/SearchTrigger/index.d.ts +1 -1
- package/dist/SearchTrigger/index.js +1 -1
- package/dist/SearchTrigger-Z5D4AAY7.css +112 -0
- package/dist/SegmentedControl/index.js +2 -2
- package/dist/SegmentedMeter/SegmentedMeter.d.ts +107 -0
- package/dist/SegmentedMeter/index.d.ts +3 -0
- package/dist/SegmentedMeter/index.js +2 -0
- package/dist/SegmentedMeter-KQNML2TW.css +109 -0
- package/dist/Select/index.js +3 -3
- package/dist/Shortcut/index.js +2 -2
- package/dist/SidebarNav/SidebarNav.d.ts +85 -25
- package/dist/SidebarNav/index.d.ts +1 -1
- package/dist/SidebarNav/index.js +1 -1
- package/dist/SidebarNav-X5NLZNWA.css +424 -0
- package/dist/StatCard/StatCard.d.ts +59 -12
- package/dist/StatCard/index.d.ts +1 -1
- package/dist/StatCard/index.js +1 -1
- package/dist/StatCard-KPAFD4E2.css +204 -0
- package/dist/StatGroup/index.js +1 -1
- package/dist/{StatGroup-TGB6AEKM.css → StatGroup-HVG6O62W.css} +8 -9
- package/dist/StatusDot/StatusDot.d.ts +24 -6
- package/dist/StatusDot/index.js +1 -1
- package/dist/StatusDot-7OMCQCZF.css +186 -0
- package/dist/Stepper/Stepper.d.ts +78 -0
- package/dist/Stepper/index.d.ts +3 -0
- package/dist/Stepper/index.js +4 -0
- package/dist/Stepper-HW4JM3YH.css +176 -0
- package/dist/Tabs/index.js +1 -1
- package/dist/{Tabs-MJ2E3VPK.css → Tabs-XCNPHA7B.css} +46 -26
- package/dist/Tag/Tag.d.ts +29 -22
- package/dist/Tag/index.js +2 -2
- package/dist/{Tag-VNZEYLB6.css → Tag-GBE7LQJP.css} +82 -83
- package/dist/TagsInput/index.js +7 -7
- package/dist/ThemeSwitcher/ThemeSwitcher.d.ts +53 -21
- package/dist/ThemeSwitcher/index.d.ts +3 -3
- package/dist/ThemeSwitcher/index.js +4 -3
- package/dist/ThemeSwitcher/preferences.d.ts +19 -5
- package/dist/ThemeToggle/ThemeToggle.d.ts +40 -0
- package/dist/ThemeToggle/index.d.ts +2 -0
- package/dist/ThemeToggle/index.js +5 -0
- package/dist/TimeWindowPicker/index.js +8 -8
- package/dist/Toaster/index.js +2 -2
- package/dist/Toolbar/index.js +2 -2
- package/dist/{Toolbar-IP6LXN45.css → Toolbar-HUOSMNTH.css} +3 -1
- package/dist/Tooltip/index.js +2 -2
- package/dist/Tree/index.d.ts +2 -2
- package/dist/Tree/index.js +1 -1
- package/dist/Tree/layout.d.ts +103 -28
- package/dist/TreeCanvas/TreeCanvas.d.ts +60 -14
- package/dist/TreeCanvas/index.d.ts +1 -1
- package/dist/TreeCanvas/index.js +6 -6
- package/dist/TreeCanvas/motion.d.ts +3 -2
- package/dist/{TreeCanvas-WBNQPHC7.css → TreeCanvas-HVOV4SQN.css} +154 -30
- package/dist/TreeGrid/index.js +4 -4
- package/dist/{chunk-F6OE5FH3.js → chunk-2FPENTCF.js} +1 -1
- package/dist/chunk-4AK52VHB.js +88 -0
- package/dist/{chunk-7EM5T4ME.js → chunk-4IQD3HUQ.js} +2 -2
- package/dist/{chunk-YODNNSZL.js → chunk-4PZ6FJKW.js} +43 -13
- package/dist/{chunk-F27EPQ7D.js → chunk-4UQ7SMPK.js} +1 -1
- package/dist/chunk-5QWIJSQM.js +73 -0
- package/dist/{chunk-KIC7BZYJ.js → chunk-6MU7HNB4.js} +6 -5
- package/dist/{chunk-S2XHHEW4.js → chunk-74KMX7YH.js} +4 -4
- package/dist/{chunk-WNI2WSJF.js → chunk-7KBNFFM3.js} +1 -1
- package/dist/{chunk-EFSG7HNU.js → chunk-AUS5FNQE.js} +1 -1
- package/dist/{chunk-CMEE37QJ.js → chunk-BMYPGGPV.js} +4 -4
- package/dist/{chunk-H4FBTAYS.js → chunk-BNCCEER3.js} +8 -8
- package/dist/chunk-C5WJUZVR.js +56 -0
- package/dist/{chunk-5WS6L6FA.js → chunk-CAIHUYXV.js} +9 -9
- package/dist/{chunk-5KSRXHOW.js → chunk-CQY5NTRS.js} +1 -1
- package/dist/{chunk-MW356IVK.js → chunk-D6EVJUGU.js} +2 -2
- package/dist/{chunk-7PEFUMQJ.js → chunk-DHPUMOTX.js} +2 -2
- package/dist/{chunk-HZ5XZNPS.js → chunk-DS2C73RJ.js} +3 -3
- package/dist/{chunk-GKHAKGOF.js → chunk-DSUY5F4E.js} +3 -3
- package/dist/{chunk-Q4ZPPART.js → chunk-EFYPAJT3.js} +3 -3
- package/dist/{chunk-PATXSJGR.js → chunk-ERVO6OUF.js} +17 -17
- package/dist/{chunk-BZYDZBAN.js → chunk-ETYEBKR4.js} +3 -3
- package/dist/{chunk-CC67MUUO.js → chunk-FD5UEN6X.js} +30 -30
- package/dist/{chunk-5SDBMKUO.js → chunk-FIFNP6PL.js} +3 -3
- package/dist/{chunk-7HPRF5XN.js → chunk-FUF52K7E.js} +98 -16
- package/dist/{chunk-5KPQ6D7N.js → chunk-FZVJDJFN.js} +2 -2
- package/dist/chunk-IA232OTU.js +156 -0
- package/dist/{chunk-2EOKFKHX.js → chunk-IG27QX7Q.js} +7 -7
- package/dist/chunk-IKB6HFGK.js +55 -0
- package/dist/{chunk-T43A26SD.js → chunk-IPVQKAHO.js} +6 -6
- package/dist/{chunk-3EYF6HKB.js → chunk-IVFJD7WY.js} +28 -9
- package/dist/{chunk-XJWXPRSK.js → chunk-JGRNTBF2.js} +11 -11
- package/dist/chunk-K3OWD7BJ.js +121 -0
- package/dist/{chunk-6KCO2D5C.js → chunk-KD4H66L6.js} +7 -20
- package/dist/{chunk-SFZOKW2G.js → chunk-KJ34ZBBI.js} +8 -3
- package/dist/{chunk-AQTBF4EB.js → chunk-LFHCXZO5.js} +5 -5
- package/dist/{chunk-LWKJQTOM.js → chunk-MICH6QSJ.js} +1 -1
- package/dist/chunk-N3DPO6HG.js +226 -0
- package/dist/{chunk-S4GZWSKR.js → chunk-OM5E3TTK.js} +1 -1
- package/dist/{chunk-3QRYCPXQ.js → chunk-OPKIKM35.js} +6 -6
- package/dist/{chunk-5EKIWVOR.js → chunk-PGRPNDWM.js} +2 -2
- package/dist/{chunk-FSOW3ARP.js → chunk-PQNILU27.js} +9 -9
- package/dist/{chunk-QNCVHRZL.js → chunk-QVAFL2LE.js} +1 -1
- package/dist/{chunk-Q3B66TJM.js → chunk-QY7UU5ZB.js} +1 -1
- package/dist/{chunk-ITHXJHBB.js → chunk-R25RGPUB.js} +1 -0
- package/dist/{chunk-KLJCCMF3.js → chunk-R6735B37.js} +2 -2
- package/dist/{chunk-3ZP55QZE.js → chunk-R6FBDTP3.js} +4 -4
- package/dist/{chunk-7FZ53WDJ.js → chunk-RIAZM6L3.js} +1 -1
- package/dist/chunk-RJM4QCGG.js +550 -0
- package/dist/{chunk-NTRZGNEX.js → chunk-S3BCVWTU.js} +215 -46
- package/dist/chunk-S7KW47IQ.js +121 -0
- package/dist/{chunk-KNYYCWMK.js → chunk-SJQ546ID.js} +4 -4
- package/dist/{chunk-D35VTV2Z.js → chunk-SV7QAONL.js} +1 -1
- package/dist/{chunk-IAJLHVUA.js → chunk-TIWAHZZ6.js} +1 -1
- package/dist/{chunk-2PRH365R.js → chunk-UA7O3KKJ.js} +1 -1
- package/dist/{chunk-NPZY6YYL.js → chunk-UG5ZMAXW.js} +6 -6
- package/dist/{chunk-NDCATSW7.js → chunk-V34H2YCY.js} +1 -1
- package/dist/chunk-WIATRXEJ.js +22 -0
- package/dist/{chunk-5C5YMZQU.js → chunk-WOFOMTGB.js} +16 -10
- package/dist/{chunk-QYOFACSP.js → chunk-WSOFKOLP.js} +3 -3
- package/dist/{chunk-MNAXYY3R.js → chunk-WUVZDFHS.js} +31 -11
- package/dist/{chunk-DB2VDLVR.js → chunk-YIMOT5OO.js} +10 -10
- package/dist/{chunk-2ZQMA2WB.js → chunk-ZPSOF6VL.js} +2 -2
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.js +69 -65
- package/dist/index.js +69 -65
- package/dist/styles.css +2538 -741
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/tone.d.ts +7 -12
- package/package.json +4 -4
- package/scripts/check-css-literals.mjs +159 -23
- package/scripts/check-css-variables.mjs +5 -3
- package/scripts/css-source.mjs +97 -5
- package/dist/Avatar-P2KRQM2B.css +0 -156
- package/dist/Charts-D7G2BSXH.css +0 -277
- package/dist/CommandPalette-CSJDUCQA.css +0 -115
- package/dist/Kbd-W66MXQI5.css +0 -61
- package/dist/SearchTrigger-QXOYAUUY.css +0 -79
- package/dist/SidebarNav-QGSFKZYA.css +0 -319
- package/dist/StatCard-KYPKZUWX.css +0 -111
- package/dist/StatusDot-HA2L2FSX.css +0 -84
- package/dist/chunk-22O7LAW2.js +0 -41
- package/dist/chunk-AJNCATWZ.js +0 -144
- package/dist/chunk-F4PJZ4ED.js +0 -245
- package/dist/chunk-PNFASD6F.js +0 -98
- package/dist/chunk-PZSWF74H.js +0 -15
- package/dist/chunk-R66KLW7S.js +0 -143
- /package/dist/{chunk-ZCR6YGQ4.js → chunk-PKIN4IMB.js} +0 -0
package/dist/Accordion/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Accordion, AccordionItem } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { Accordion, AccordionItem } from '../chunk-RIAZM6L3.js';
|
|
2
|
+
import '../chunk-FZVJDJFN.js';
|
|
3
3
|
import '../chunk-BHHIIK3M.js';
|
|
4
4
|
import '../chunk-PQADV6P6.js';
|
|
5
5
|
import '../chunk-BZFWDIV6.js';
|
package/dist/AddPill/index.js
CHANGED
|
@@ -402,6 +402,15 @@
|
|
|
402
402
|
`currentcolor` under that root then resolves to THAT: the fill was
|
|
403
403
|
overridden and landed on the same purple it started from. */
|
|
404
404
|
color: inherit;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* THE FILL IS FOR A FILLED DRAWING, and a glyph is a stroke. Painting the
|
|
408
|
+
inside of a Lucide glyph turns every closed shape in it solid and every
|
|
409
|
+
open one into a smear, so a `.crewlet-glyph` keeps the fill its own frame
|
|
410
|
+
decides and takes the ink through its stroke, which is `currentColor`. */
|
|
411
|
+
.crewlet-add-pill__section svg:not(.crewlet-glyph),
|
|
412
|
+
.crewlet-add-pill__section svg:not(.crewlet-glyph) g,
|
|
413
|
+
.crewlet-add-pill__section svg:not(.crewlet-glyph) path {
|
|
405
414
|
fill: currentcolor;
|
|
406
415
|
}
|
|
407
416
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The application frame: a rail
|
|
2
|
+
* The application frame: a rail on the frame, and beside it a floating sheet
|
|
3
|
+
* holding a top bar and ONE scroll container.
|
|
3
4
|
*
|
|
4
5
|
* WHY THE SHELL OWNS THE GRID NOW. It used to be passive: the slots positioned
|
|
5
6
|
* themselves with `position: fixed` and the shell only reserved a matching
|
|
@@ -9,6 +10,14 @@
|
|
|
9
10
|
* grid is sized from `--size-shell-rail` and `--size-shell-topbar` here, and
|
|
10
11
|
* the slots simply fill their cells.
|
|
11
12
|
*
|
|
13
|
+
* THE SCREEN FLOATS ON A SHEET. The rail stands on the frame, the lowest rung,
|
|
14
|
+
* and everything the reader reads (the bar, a banner, the screen, a footer) is
|
|
15
|
+
* one sheet a rung above it, held off the frame's edges by `--size-shell-inset`
|
|
16
|
+
* and rounded at `--radius-sheet`. It is one element rather than a background
|
|
17
|
+
* the bar and the scroller each paint, because the corner has to clip both and
|
|
18
|
+
* the hairline has to run round both: two surfaces that each drew half of it
|
|
19
|
+
* would meet in a seam under the bar.
|
|
20
|
+
*
|
|
12
21
|
* THE DOCUMENT DOES NOT SCROLL. `100dvh` with `overflow: hidden` on the root,
|
|
13
22
|
* and one scroller inside it, which is what lets a router restore a scroll
|
|
14
23
|
* position per history entry: a page with three independent scrollers has
|
|
@@ -21,7 +30,8 @@
|
|
|
21
30
|
* and `main` is a focusable target for the skip link that precedes everything.
|
|
22
31
|
*
|
|
23
32
|
* NARROW IS A DIFFERENT SHAPE, NOT A SMALLER ONE. Below the shell breakpoint
|
|
24
|
-
* the
|
|
33
|
+
* the sheet is the whole window, its inset, corner and hairline collapsed to
|
|
34
|
+
* nothing, and the rail is a modal drawer on the shared layer stack: it takes Escape, traps
|
|
25
35
|
* Tab, hands focus back to the toggle, and closes on a navigation and when the
|
|
26
36
|
* layout it belongs to ends. Hidden rather than merely moved off screen, too,
|
|
27
37
|
* because a rail translated out of view keeps every link in the tab order and
|
|
@@ -64,7 +74,7 @@ export interface AppShellProps extends Omit<HTMLAttributes<HTMLDivElement>, 'tit
|
|
|
64
74
|
* while the screen scrolls under it.
|
|
65
75
|
*/
|
|
66
76
|
banner?: ReactNode;
|
|
67
|
-
/** A strip under the screen,
|
|
77
|
+
/** A strip under the screen, on the sheet and outside `main`. */
|
|
68
78
|
footer?: ReactNode;
|
|
69
79
|
/** The id of the `main` element, which the skip link points at. */
|
|
70
80
|
mainId?: string | undefined;
|
|
@@ -117,8 +127,19 @@ interface RailRowContent {
|
|
|
117
127
|
* vertical line as every nav glyph above it.
|
|
118
128
|
*/
|
|
119
129
|
icon?: ReactNode;
|
|
120
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* A value at the end of the row: a count, a tag, a time. It stands beside
|
|
132
|
+
* the words while both fit on the rail, and drops under them when they do
|
|
133
|
+
* not, so it never takes the room the words need.
|
|
134
|
+
*/
|
|
121
135
|
trailing?: ReactNode;
|
|
136
|
+
/**
|
|
137
|
+
* A second line under the row's words: "3 nodes · config epoch 42" under
|
|
138
|
+
* "Engine healthy". Given one, the row is the design's STATUS BLOCK, drawn
|
|
139
|
+
* on the card rung inside a hairline, its words in the primary ink over this
|
|
140
|
+
* line in the quiet one.
|
|
141
|
+
*/
|
|
142
|
+
detail?: ReactNode;
|
|
122
143
|
className?: string | undefined;
|
|
123
144
|
/** What the row says. */
|
|
124
145
|
children?: ReactNode;
|
|
@@ -163,7 +184,7 @@ export type AppShellRailRowProps = StaticRailRowProps | ActionRailRowProps;
|
|
|
163
184
|
* toolbar's inset. This is still the one to reach for, because it is also the
|
|
164
185
|
* thing that decides whether the row is a control at all.
|
|
165
186
|
*/
|
|
166
|
-
export declare function AppShellRailRow({ icon, trailing, onClick, label, className, children }: AppShellRailRowProps): import("react").JSX.Element;
|
|
187
|
+
export declare function AppShellRailRow({ icon, trailing, detail, onClick, label, className, children }: AppShellRailRowProps): import("react").JSX.Element;
|
|
167
188
|
export interface AppShellToggleProps {
|
|
168
189
|
className?: string | undefined;
|
|
169
190
|
}
|
package/dist/AppShell/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AppShell, AppShellRail, AppShellRailRow, AppShellToggle, AppShellTopbar, useAppShell } from '../chunk-
|
|
1
|
+
export { AppShell, AppShellRail, AppShellRailRow, AppShellToggle, AppShellTopbar, useAppShell } from '../chunk-WUVZDFHS.js';
|
|
2
2
|
import '../chunk-7RPGY3JE.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-R25RGPUB.js';
|
|
4
|
+
import '../chunk-4UQ7SMPK.js';
|
|
5
5
|
import '../chunk-BZFWDIV6.js';
|
|
6
6
|
import '../chunk-ODEQTPFM.js';
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* The application frame
|
|
2
|
+
* The application frame: a rail on the FRAME, and the screen on a SHEET that
|
|
3
|
+
* floats beside it.
|
|
3
4
|
*
|
|
4
5
|
* The rail's width and the bar's height are read from the token layer through
|
|
5
6
|
* two component variables, so an application with a narrower rail sets ONE
|
|
6
7
|
* value rather than repeating a number in its own stylesheet, which is what
|
|
7
8
|
* every consumer of the passive shell had to do.
|
|
8
9
|
*
|
|
10
|
+
* THE SHEET IS INSET FROM THE FRAME, rounded, and drawn round with the plain
|
|
11
|
+
* hairline, which is the approved design's frame: the rail stands on the
|
|
12
|
+
* lowest rung and the screen a rung above it, so where the navigation ends
|
|
13
|
+
* and the page begins is a difference of ground, a line and a corner rather
|
|
14
|
+
* than a divider the rail draws. The inset is --size-shell-inset on the
|
|
15
|
+
* sheet's top, right and bottom; the rail is the gap on its left. The sheet clips what it holds to its corner, and the ONE scroller is
|
|
16
|
+
* inside it, so a screen scrolls under the bar and never past the corner.
|
|
17
|
+
*
|
|
9
18
|
* The breakpoint is written out because a media query cannot read a custom
|
|
10
19
|
* property. It is the shell step from @crewlethq/tokens, and the CSS check
|
|
11
|
-
* compares the literal against the token.
|
|
20
|
+
* compares the literal against the token. The query is STRICTLY UNDER it,
|
|
21
|
+
* (width < 1024px): the step is the rail, the inset and the sheet's floor
|
|
22
|
+
* added up, so at exactly that width the rail still fits, and the component's
|
|
23
|
+
* own matchMedia asks the same question.
|
|
12
24
|
*/
|
|
13
25
|
|
|
14
26
|
.crewlet-app-shell {
|
|
@@ -20,15 +32,34 @@
|
|
|
20
32
|
--crewlet-app-shell-drawer-z: var(--z-index-overlay);
|
|
21
33
|
display: grid;
|
|
22
34
|
grid-template-columns: var(--crewlet-app-shell-rail) minmax(0, 1fr);
|
|
35
|
+
/* One row, the viewport's height less nothing: the sheet's own margin is
|
|
36
|
+
what holds it off the frame's edges, and a row sized by its content would
|
|
37
|
+
let a tall screen push the sheet's bottom edge off the window. */
|
|
38
|
+
grid-template-rows: minmax(0, 1fr);
|
|
23
39
|
/* THE DOCUMENT DOES NOT SCROLL: exactly the viewport, and nothing may grow
|
|
24
40
|
past it. A page that can also scroll as a whole carries the rail off the
|
|
25
41
|
top of the window. */
|
|
26
42
|
height: 100dvh;
|
|
27
43
|
overflow: hidden;
|
|
28
|
-
|
|
44
|
+
/* The FRAME, the lowest rung: what the rail stands on and what shows round
|
|
45
|
+
the sheet's inset. */
|
|
46
|
+
background: var(--color-surface-frame);
|
|
29
47
|
color: var(--color-text-primary);
|
|
30
48
|
}
|
|
31
49
|
|
|
50
|
+
/*
|
|
51
|
+
* A shell with no rail is one column, and the sheet is inset on its left as
|
|
52
|
+
* well, from the frame's edge rather than from a rail. The inset is
|
|
53
|
+
* the ROOT's padding rather than a second margin rule on the sheet, so the
|
|
54
|
+
* narrow block below takes it back with a rule of the same weight declared
|
|
55
|
+
* after this one; a margin here would have needed two classes, and would have
|
|
56
|
+
* beaten the narrow block's one.
|
|
57
|
+
*/
|
|
58
|
+
.crewlet-app-shell--no-rail {
|
|
59
|
+
grid-template-columns: minmax(0, 1fr);
|
|
60
|
+
padding-left: var(--size-shell-inset);
|
|
61
|
+
}
|
|
62
|
+
|
|
32
63
|
/* The skip link, drawn only while it holds focus, over everything. */
|
|
33
64
|
.crewlet-app-shell__skip {
|
|
34
65
|
position: fixed;
|
|
@@ -53,13 +84,22 @@
|
|
|
53
84
|
outline-offset: 2px;
|
|
54
85
|
}
|
|
55
86
|
|
|
87
|
+
/*
|
|
88
|
+
* The rail stands on the FRAME, the application ground, and the screen beside
|
|
89
|
+
* it on the sheet: the two lowest rungs, which are what separate the chrome a
|
|
90
|
+
* reader navigates with from the page they are reading.
|
|
91
|
+
*
|
|
92
|
+
* AND IT DRAWS NO EDGE OF ITS OWN in the wide layout. It carried a right
|
|
93
|
+
* border when the screen beside it was flush against it; the sheet draws its
|
|
94
|
+
* own hairline now, an inset away, and a second line at the rail's edge would
|
|
95
|
+
* run the height of the window parallel to it, eight pixels off.
|
|
96
|
+
*/
|
|
56
97
|
.crewlet-app-shell__rail {
|
|
57
98
|
display: flex;
|
|
58
99
|
flex-direction: column;
|
|
59
100
|
min-height: 0;
|
|
60
101
|
min-width: 0;
|
|
61
|
-
background: var(--color-surface-
|
|
62
|
-
border-right: 1px solid var(--color-border-default);
|
|
102
|
+
background: var(--color-surface-frame);
|
|
63
103
|
}
|
|
64
104
|
|
|
65
105
|
.crewlet-app-shell__rail-inner {
|
|
@@ -70,8 +110,13 @@
|
|
|
70
110
|
}
|
|
71
111
|
|
|
72
112
|
/*
|
|
73
|
-
* The head
|
|
74
|
-
*
|
|
113
|
+
* The head stands BESIDE the top bar: the inset the sheet is held off the
|
|
114
|
+
* frame by, then the bar's own height, so what the head holds (the lockup) is
|
|
115
|
+
* centred on the same line as the screen's title in the bar beside it, and the
|
|
116
|
+
* first nav row starts level with the top of the screen under the bar. The
|
|
117
|
+
* box is sized as a border box whatever the document says, because the height
|
|
118
|
+
* is written as the inset plus the bar and the padding is the inset: counted
|
|
119
|
+
* outside the height, the head would stand an inset taller than the bar.
|
|
75
120
|
*
|
|
76
121
|
* AND IT DRAWS NO LINE OF ITS OWN. It carried a bottom border, which put a
|
|
77
122
|
* divider across the rail at the same height as the bar's, and the two read as
|
|
@@ -84,7 +129,9 @@
|
|
|
84
129
|
display: flex;
|
|
85
130
|
align-items: center;
|
|
86
131
|
flex: none;
|
|
87
|
-
|
|
132
|
+
box-sizing: border-box;
|
|
133
|
+
min-height: calc(var(--size-shell-inset) + var(--crewlet-app-shell-topbar));
|
|
134
|
+
padding-top: var(--size-shell-inset);
|
|
88
135
|
}
|
|
89
136
|
|
|
90
137
|
.crewlet-app-shell__rail-body {
|
|
@@ -118,7 +165,7 @@
|
|
|
118
165
|
* AND SO DOES WHATEVER ELSE LANDS THERE. `AppShell.RailRow` is the row this
|
|
119
166
|
* package draws, but the slot takes a control from anywhere and an application
|
|
120
167
|
* that already has a status button reaches for that one: the engine drops a
|
|
121
|
-
*
|
|
168
|
+
* ghost Button into the foot, which arrived centred in a 263px rail on a
|
|
122
169
|
* toolbar's inset. The foot claims a direct child instead, which is the same
|
|
123
170
|
* move the nav's badge slot makes on whatever a caller puts in it, and there
|
|
124
171
|
* is no second idea of what a row in this rail is.
|
|
@@ -171,17 +218,17 @@
|
|
|
171
218
|
color: var(--color-text-primary);
|
|
172
219
|
}
|
|
173
220
|
|
|
174
|
-
/* A row in the foot fills the rail, so its label takes whatever the glyph
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
221
|
+
/* A row in the foot fills the rail, so its label takes whatever the glyph
|
|
222
|
+
leaves it and WRAPS rather than ending in an ellipsis: a status line says
|
|
223
|
+
what a node is doing, and what it says is as long as the sentence the
|
|
224
|
+
application wrote. Cut, it kept the half that said nothing ("engine
|
|
225
|
+
conn…"). */
|
|
178
226
|
.crewlet-app-shell__rail-foot > .crewlet-btn > .crewlet-btn__label {
|
|
179
227
|
display: block;
|
|
180
228
|
flex: 1 1 auto;
|
|
181
229
|
min-width: 0;
|
|
182
|
-
overflow:
|
|
183
|
-
|
|
184
|
-
white-space: nowrap;
|
|
230
|
+
overflow-wrap: anywhere;
|
|
231
|
+
white-space: normal;
|
|
185
232
|
}
|
|
186
233
|
|
|
187
234
|
/*
|
|
@@ -202,27 +249,102 @@
|
|
|
202
249
|
flex: none;
|
|
203
250
|
}
|
|
204
251
|
|
|
205
|
-
|
|
252
|
+
/*
|
|
253
|
+
* THE WORDS AND THE TRAILING VALUE SHARE ONE WRAPPING LINE, and the words are
|
|
254
|
+
* never cut.
|
|
255
|
+
*
|
|
256
|
+
* The words take their own width up to the whole line (`flex-basis: auto`
|
|
257
|
+
* with `max-width: 100%`), so the line breaks BEFORE the value exactly when
|
|
258
|
+
* the words and the value together are wider than the rail: the value stands
|
|
259
|
+
* at the end of the words' line while both fit, and at the start of a line
|
|
260
|
+
* of its own under them when they do not. The words grow into what is left
|
|
261
|
+
* on their line, which is what puts a value that fits at the row's end
|
|
262
|
+
* without a margin that would also push a wrapped one to the far side. And
|
|
263
|
+
* words wider than the rail wrap, at any character if they must, rather than
|
|
264
|
+
* end in an ellipsis: they are the part of the row that was the point.
|
|
265
|
+
*/
|
|
266
|
+
.crewlet-app-shell__rail-row-body {
|
|
267
|
+
display: flex;
|
|
206
268
|
flex: 1 1 auto;
|
|
269
|
+
flex-wrap: wrap;
|
|
270
|
+
align-items: center;
|
|
271
|
+
gap: var(--spacing-1) var(--spacing-2);
|
|
207
272
|
min-width: 0;
|
|
208
|
-
overflow: hidden;
|
|
209
|
-
text-overflow: ellipsis;
|
|
210
|
-
white-space: nowrap;
|
|
211
273
|
}
|
|
212
274
|
|
|
213
|
-
|
|
275
|
+
.crewlet-app-shell__rail-row-text {
|
|
276
|
+
display: flex;
|
|
277
|
+
flex: 1 0 auto;
|
|
278
|
+
flex-direction: column;
|
|
279
|
+
max-width: 100%;
|
|
280
|
+
min-width: 0;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.crewlet-app-shell__rail-row-label,
|
|
284
|
+
.crewlet-app-shell__rail-row-detail {
|
|
285
|
+
overflow-wrap: anywhere;
|
|
286
|
+
}
|
|
287
|
+
|
|
214
288
|
.crewlet-app-shell__rail-row-trailing {
|
|
215
289
|
display: inline-flex;
|
|
216
290
|
align-items: center;
|
|
217
291
|
flex: none;
|
|
218
|
-
margin-left: auto;
|
|
219
292
|
}
|
|
220
293
|
|
|
221
|
-
|
|
294
|
+
/*
|
|
295
|
+
* THE STATUS BLOCK: a row given a `detail` is the approved design's engine
|
|
296
|
+
* status, its words over a second line, on the card rung inside the plain
|
|
297
|
+
* hairline, so the one row in the foot that reports on the fleet stands off
|
|
298
|
+
* the rows that only go somewhere. The words step up to the primary ink at the
|
|
299
|
+
* medium weight, since they are the state, and the detail keeps the row's
|
|
300
|
+
* quiet ink a step smaller. Both are set on the snug leading, where the
|
|
301
|
+
* design's two lines sit as one block rather than as two rows.
|
|
302
|
+
*
|
|
303
|
+
* It keeps the row's own inline pad and its transparent-border arithmetic, so
|
|
304
|
+
* its mark still lands on the line every nav glyph above it sits on; the block
|
|
305
|
+
* inset grows by a pixel for the second line, the design's 10px around the
|
|
306
|
+
* words with the border counted in.
|
|
307
|
+
*/
|
|
308
|
+
.crewlet-app-shell__rail-row--block {
|
|
309
|
+
padding-block: calc(var(--spacing-2) + 1px);
|
|
310
|
+
border-color: var(--color-border-default);
|
|
311
|
+
border-radius: var(--radius-lg);
|
|
312
|
+
background: var(--color-surface-subtle);
|
|
313
|
+
line-height: var(--font-line-height-snug);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.crewlet-app-shell__rail-row--block .crewlet-app-shell__rail-row-label {
|
|
317
|
+
color: var(--color-text-primary);
|
|
318
|
+
font-weight: var(--font-weight-medium);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.crewlet-app-shell__rail-row-detail {
|
|
322
|
+
color: var(--color-text-tertiary);
|
|
323
|
+
font-size: var(--font-size-2xs);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/*
|
|
327
|
+
* THE SHEET: the bar, a banner, the one scroller and a footer, floated on the
|
|
328
|
+
* frame. It stands on --color-surface-background, the sheet rung, inside the
|
|
329
|
+
* plain hairline and at the sheet's own corner, a step rounder than every
|
|
330
|
+
* card drawn inside it. It clips to that corner, which is what lets the bar
|
|
331
|
+
* and the scroller run square to its edges and still be rounded by it.
|
|
332
|
+
*
|
|
333
|
+
* Physical margins, as every other edge in this file is physical: the drawer
|
|
334
|
+
* slides in from the left and the rail's column is the grid's first, so the
|
|
335
|
+
* shell is drawn left to right throughout, and one logical margin in it would
|
|
336
|
+
* be a promise about a direction nothing else here keeps.
|
|
337
|
+
*/
|
|
338
|
+
.crewlet-app-shell__sheet {
|
|
222
339
|
display: flex;
|
|
223
340
|
flex-direction: column;
|
|
224
341
|
min-width: 0;
|
|
225
342
|
min-height: 0;
|
|
343
|
+
margin: var(--size-shell-inset) var(--size-shell-inset) var(--size-shell-inset) 0;
|
|
344
|
+
border: 1px solid var(--color-border-default);
|
|
345
|
+
border-radius: var(--radius-sheet);
|
|
346
|
+
background: var(--color-surface-background);
|
|
347
|
+
overflow: hidden;
|
|
226
348
|
}
|
|
227
349
|
|
|
228
350
|
.crewlet-app-shell__topbar {
|
|
@@ -233,7 +355,7 @@
|
|
|
233
355
|
height: var(--crewlet-app-shell-topbar);
|
|
234
356
|
padding: 0 var(--spacing-4);
|
|
235
357
|
border-bottom: 1px solid var(--color-border-default);
|
|
236
|
-
background: var(--color-surface-
|
|
358
|
+
background: var(--color-surface-background);
|
|
237
359
|
}
|
|
238
360
|
|
|
239
361
|
.crewlet-app-shell__title {
|
|
@@ -339,17 +461,48 @@
|
|
|
339
461
|
background: var(--color-surface-scrim);
|
|
340
462
|
}
|
|
341
463
|
|
|
342
|
-
@media (
|
|
464
|
+
@media (width < 1024px) {
|
|
343
465
|
.crewlet-app-shell {
|
|
344
466
|
grid-template-columns: minmax(0, 1fr);
|
|
345
467
|
}
|
|
346
468
|
|
|
469
|
+
.crewlet-app-shell--no-rail {
|
|
470
|
+
padding-left: 0;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/*
|
|
474
|
+
* FULL BLEED. Under the step the rail is not beside the sheet, so there is
|
|
475
|
+
* nothing for the sheet to be held off: the inset, the corner and the
|
|
476
|
+
* hairline all collapse to nothing, and the sheet is the window. A corner
|
|
477
|
+
* kept here would round the screen into the viewport's own corners, and a
|
|
478
|
+
* hairline would draw a line round the window's edge.
|
|
479
|
+
*/
|
|
480
|
+
.crewlet-app-shell__sheet {
|
|
481
|
+
margin: 0;
|
|
482
|
+
border-width: 0;
|
|
483
|
+
border-radius: 0;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/* Beside a full-bleed sheet the bar starts at the window's top, and so does
|
|
487
|
+
the drawer's head. */
|
|
488
|
+
.crewlet-app-shell__rail-head {
|
|
489
|
+
min-height: var(--crewlet-app-shell-topbar);
|
|
490
|
+
padding-top: 0;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/*
|
|
494
|
+
* The drawer draws the edge the wide rail does not: it slides over the
|
|
495
|
+
* screen rather than standing beside a sheet that draws its own, and in
|
|
496
|
+
* light the frame and the sheet it covers are close enough that the shadow
|
|
497
|
+
* alone does not say where the drawer ends.
|
|
498
|
+
*/
|
|
347
499
|
.crewlet-app-shell__rail {
|
|
348
500
|
position: fixed;
|
|
349
501
|
inset: 0 auto 0 0;
|
|
350
502
|
width: var(--crewlet-app-shell-rail);
|
|
351
503
|
max-width: 100%;
|
|
352
504
|
transform: translateX(-100%);
|
|
505
|
+
border-right: 1px solid var(--color-border-default);
|
|
353
506
|
box-shadow: var(--shadow-xl);
|
|
354
507
|
/*
|
|
355
508
|
* HIDDEN, not only moved. A rail translated off screen keeps every link
|
package/dist/Avatar/Avatar.d.ts
CHANGED
|
@@ -1,38 +1,50 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { Tone } from '../utils/tone.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* WHAT THE BADGE STANDS FOR, drawn as its outline.
|
|
4
5
|
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* `agent` is the default: a SQUIRCLE with the initials in the mono face, which
|
|
7
|
+
* is what the engine runs and what nearly every badge on that product is.
|
|
8
|
+
* `human` is a CIRCLE with the initials in the sans face: a person.
|
|
9
|
+
*
|
|
10
|
+
* ONE STRUCTURAL CUE, where there used to be two. The badge took a `shape`
|
|
11
|
+
* (square or circle) and a `variant` (solid, or `dashed` for a human seat), and
|
|
12
|
+
* the two could disagree: a dashed square and a solid circle were both
|
|
13
|
+
* reachable and meant nothing. The approved design draws a person as a circle
|
|
14
|
+
* and an agent as a squircle, and that outline is the whole of the difference,
|
|
15
|
+
* so it is the one prop. It is a SHAPE rather than a hue, which leaves every
|
|
16
|
+
* hue meaning only a state, and it reads to somebody who cannot separate hues
|
|
17
|
+
* at all.
|
|
10
18
|
*/
|
|
11
|
-
export type
|
|
19
|
+
export type AvatarKind = 'agent' | 'human';
|
|
12
20
|
/**
|
|
13
21
|
* How much colour a badge spends on WHO something is.
|
|
14
22
|
*
|
|
15
|
-
* `neutral` is the default
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
23
|
+
* `neutral` is the default. A hash of a name carries no information: rename
|
|
24
|
+
* the seat and its colour changes, which is the proof it never meant anything.
|
|
25
|
+
* Identity is the outline, the monogram and the name beside it.
|
|
26
|
+
*
|
|
27
|
+
* `seeded` is for a roster where a stable per-identity tint genuinely helps a
|
|
28
|
+
* reader scan, a member list being the case it was built for. Each seeded
|
|
29
|
+
* ground is a token measured at 4.5:1 under white initials.
|
|
21
30
|
*
|
|
22
|
-
* `brand`
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
31
|
+
* THERE IS NO `brand` TONE ANY MORE. The accent means "here", "the primary
|
|
32
|
+
* action" and "focus"; a badge filled with it was identity drawn in the
|
|
33
|
+
* reader's-position colour. A badge that is SELECTED says so with
|
|
34
|
+
* `ring="brand"`, which is the design's own selected badge.
|
|
26
35
|
*/
|
|
27
|
-
export type AvatarTone = 'neutral' | '
|
|
36
|
+
export type AvatarTone = 'neutral' | 'seeded';
|
|
28
37
|
/**
|
|
29
|
-
*
|
|
38
|
+
* The STATE ring: a 1.5px line 2px outside the badge, in one of the state
|
|
39
|
+
* fills or the accent.
|
|
30
40
|
*
|
|
31
|
-
* `
|
|
32
|
-
*
|
|
33
|
-
*
|
|
41
|
+
* `info`, `warning`, `danger` and `success` are what the thing is DOING, and
|
|
42
|
+
* `brand` is SELECTED. Which state each one means is the consumer's to decide,
|
|
43
|
+
* and to SAY in words beside the badge: the ring is never the only carrier of
|
|
44
|
+
* a state, because in forced-colors mode every ring is the same system colour.
|
|
45
|
+
* No ring at all is the resting state.
|
|
34
46
|
*/
|
|
35
|
-
export type
|
|
47
|
+
export type AvatarRing = Exclude<Tone, 'neutral'>;
|
|
36
48
|
/** The four steps, in px. A number is accepted for anything outside them. */
|
|
37
49
|
export declare const AVATAR_SIZES: {
|
|
38
50
|
readonly xs: 20;
|
|
@@ -42,6 +54,21 @@ export declare const AVATAR_SIZES: {
|
|
|
42
54
|
};
|
|
43
55
|
export type AvatarSizeStep = keyof typeof AVATAR_SIZES;
|
|
44
56
|
export type AvatarSize = AvatarSizeStep | number;
|
|
57
|
+
/**
|
|
58
|
+
* An agent's corner, as a share of its box.
|
|
59
|
+
*
|
|
60
|
+
* The approved design draws 7px at 24 and 9px at 30 (and 5 at 18, 6 at 20, 8
|
|
61
|
+
* at 26 and 28, 13 at 44): a corner that moves WITH the box rather than
|
|
62
|
+
* sitting on one radius step, which would read as a pill at the smallest badge
|
|
63
|
+
* and as a plain box at the largest. 0.29 is that ladder as one number, and
|
|
64
|
+
* every size the design draws lands within 0.62px of it.
|
|
65
|
+
*
|
|
66
|
+
* THE STYLESHEET COMPUTES IT, from `--crewlet-avatar-size`, for a step and for
|
|
67
|
+
* a numeric size alike, so there is one ladder and nothing to keep in step
|
|
68
|
+
* with it. The number is restated in `Avatar.css`, which cannot import it, and
|
|
69
|
+
* the suite holds the two equal.
|
|
70
|
+
*/
|
|
71
|
+
export declare const AVATAR_CORNER_RATIO = 0.29;
|
|
45
72
|
export interface AvatarProps extends HTMLAttributes<HTMLElement> {
|
|
46
73
|
/** Image source. With one set the badge renders the image; otherwise the initials. */
|
|
47
74
|
src?: string | undefined;
|
|
@@ -49,9 +76,11 @@ export interface AvatarProps extends HTMLAttributes<HTMLElement> {
|
|
|
49
76
|
name?: string | undefined;
|
|
50
77
|
/** A step, or a number of px. */
|
|
51
78
|
size?: AvatarSize | undefined;
|
|
52
|
-
|
|
79
|
+
/** An agent (the default) is a squircle; a human is a circle. */
|
|
80
|
+
kind?: AvatarKind | undefined;
|
|
53
81
|
tone?: AvatarTone | undefined;
|
|
54
|
-
|
|
82
|
+
/** A state ring, or none. `brand` is selected. */
|
|
83
|
+
ring?: AvatarRing | undefined;
|
|
55
84
|
/**
|
|
56
85
|
* The name is already printed beside this badge, so the badge itself says
|
|
57
86
|
* nothing. Without it a row reads "Carlos Diaz avatar, Carlos Diaz".
|
|
@@ -64,12 +93,26 @@ export interface AvatarProps extends HTMLAttributes<HTMLElement> {
|
|
|
64
93
|
colorSeed?: string | undefined;
|
|
65
94
|
}
|
|
66
95
|
/**
|
|
67
|
-
*
|
|
96
|
+
* Two uppercase initials, or one where the name has only one letter to give.
|
|
68
97
|
*
|
|
69
98
|
* SPLIT ON WHITESPACE, HYPHEN, UNDERSCORE AND DOT, because half the names this
|
|
70
99
|
* draws are handles rather than names: `backend-engineer` gives BE,
|
|
71
100
|
* `sre_lead` gives SL and `carlos.diaz` gives CD, where splitting on spaces
|
|
72
101
|
* alone gives B, S and C and a roster of identical badges.
|
|
102
|
+
*
|
|
103
|
+
* A SINGLE WORD STILL GIVES TWO LETTERS, because the seats an org chart names
|
|
104
|
+
* in one word are the ones it draws most (CEO, SWE, PM, DevRel), and a badge
|
|
105
|
+
* of one letter each made the CEO and the CTO the same `C`. The word is read
|
|
106
|
+
* in two ways, in order:
|
|
107
|
+
*
|
|
108
|
+
* 1. Where its case says it is two words run together (a lower-case letter
|
|
109
|
+
* followed by a capital, as in `DevRel` or `McCall`), the first letter of
|
|
110
|
+
* each of the first two: DR, MC.
|
|
111
|
+
* 2. Otherwise its first two characters: `CEO` gives CE, `SWE` SW, `PM` PM
|
|
112
|
+
* and `Acme` AC. An acronym is not split at its capitals, since every
|
|
113
|
+
* letter of it is one and the first two are its start.
|
|
114
|
+
*
|
|
115
|
+
* A one-character word is its one character.
|
|
73
116
|
*/
|
|
74
117
|
export declare const getInitials: (name?: string) => string;
|
|
75
118
|
/**
|
|
@@ -80,25 +123,27 @@ export declare const avatarTint: (seed: string) => number;
|
|
|
80
123
|
/** The px a size prop means. */
|
|
81
124
|
export declare function avatarPixels(size: AvatarSize): number;
|
|
82
125
|
/**
|
|
83
|
-
* The corner
|
|
126
|
+
* The corner an agent's badge of this many pixels is drawn with, in px, where
|
|
127
|
+
* the browser draws a circular corner (`Avatar.css` has the squircle).
|
|
84
128
|
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* width renders 12px, a bigger badge drawn squarer than a smaller one. The
|
|
90
|
-
* bands are the steps' own midpoints, so a number lands on the corner of the
|
|
91
|
-
* step nearest it and the ladder is one ladder rather than two.
|
|
129
|
+
* The same arithmetic the stylesheet does, for a caller that has to round
|
|
130
|
+
* something ELSE to match a badge: `ImageUpload`'s trigger and overlay sit
|
|
131
|
+
* over the picture, and a corner of their own would show the badge's corners
|
|
132
|
+
* through them at every size but one.
|
|
92
133
|
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
134
|
+
* NOT ROUNDED, because the stylesheet cannot round: a whole-pixel corner there
|
|
135
|
+
* would take `round()` with a literal length, which the package's literal
|
|
136
|
+
* check refuses in a radius, and a rounded number here would then disagree
|
|
137
|
+
* with the badge under it by up to half a pixel. A fractional corner is
|
|
138
|
+
* anti-aliased like any other curve.
|
|
96
139
|
*/
|
|
97
|
-
export declare function
|
|
140
|
+
export declare function avatarCorner(pixels: number): number;
|
|
98
141
|
/**
|
|
99
142
|
* An identity badge: an image, or the initials behind it.
|
|
100
143
|
*
|
|
101
144
|
* If the image fails to load (a stale CDN URL, an expired signature) it
|
|
102
|
-
* degrades to the initials rather than to a broken-image glyph.
|
|
145
|
+
* degrades to the initials rather than to a broken-image glyph. Either way it
|
|
146
|
+
* keeps its kind's outline and its ring: whether somebody has uploaded a photo
|
|
147
|
+
* says nothing about what they are or what they are doing.
|
|
103
148
|
*/
|
|
104
|
-
export declare const Avatar: ({ src, name, size,
|
|
149
|
+
export declare const Avatar: ({ src, name, size, kind, tone, ring, decorative, colorSeed, className, style, ...rest }: AvatarProps) => import("react").JSX.Element;
|