@boost33/ui 0.8.1 → 0.9.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/CHANGELOG.md +131 -3
- package/dist/backdrop-icons.d.ts +53 -0
- package/dist/backdrop-icons.js +62 -0
- package/dist/backdrop-icons.js.map +1 -0
- package/dist/backdrop.css +1 -0
- package/dist/backdrop.d.ts +46 -0
- package/dist/backdrop.js +127 -0
- package/dist/backdrop.js.map +1 -0
- package/dist/components/Backdrop/BackdropAppMenu.d.ts +55 -0
- package/dist/components/Backdrop/BackdropAppMenu.js +79 -0
- package/dist/components/Backdrop/BackdropAppMenu.js.map +1 -0
- package/dist/components/Backdrop/BackdropAppMenu.module.css.js +48 -0
- package/dist/components/Backdrop/BackdropAppMenu.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropBasics.d.ts +129 -0
- package/dist/components/Backdrop/BackdropBasics.js +130 -0
- package/dist/components/Backdrop/BackdropBasics.js.map +1 -0
- package/dist/components/Backdrop/BackdropBasics.module.css.js +71 -0
- package/dist/components/Backdrop/BackdropBasics.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropButton.d.ts +63 -0
- package/dist/components/Backdrop/BackdropButton.js +59 -0
- package/dist/components/Backdrop/BackdropButton.js.map +1 -0
- package/dist/components/Backdrop/BackdropButton.module.css.js +41 -0
- package/dist/components/Backdrop/BackdropButton.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropCharts.d.ts +158 -0
- package/dist/components/Backdrop/BackdropCharts.js +222 -0
- package/dist/components/Backdrop/BackdropCharts.js.map +1 -0
- package/dist/components/Backdrop/BackdropCharts.module.css.js +109 -0
- package/dist/components/Backdrop/BackdropCharts.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropChrome.d.ts +26 -0
- package/dist/components/Backdrop/BackdropChrome.js +35 -0
- package/dist/components/Backdrop/BackdropChrome.js.map +1 -0
- package/dist/components/Backdrop/BackdropConversation.d.ts +67 -0
- package/dist/components/Backdrop/BackdropConversation.js +76 -0
- package/dist/components/Backdrop/BackdropConversation.js.map +1 -0
- package/dist/components/Backdrop/BackdropConversation.module.css.js +44 -0
- package/dist/components/Backdrop/BackdropConversation.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropData.d.ts +195 -0
- package/dist/components/Backdrop/BackdropData.js +204 -0
- package/dist/components/Backdrop/BackdropData.js.map +1 -0
- package/dist/components/Backdrop/BackdropData.module.css.js +135 -0
- package/dist/components/Backdrop/BackdropData.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropDisplay.d.ts +122 -0
- package/dist/components/Backdrop/BackdropDisplay.js +80 -0
- package/dist/components/Backdrop/BackdropDisplay.js.map +1 -0
- package/dist/components/Backdrop/BackdropDisplay.module.css.js +80 -0
- package/dist/components/Backdrop/BackdropDisplay.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropFields.d.ts +122 -0
- package/dist/components/Backdrop/BackdropFields.js +196 -0
- package/dist/components/Backdrop/BackdropFields.js.map +1 -0
- package/dist/components/Backdrop/BackdropFields.module.css.js +104 -0
- package/dist/components/Backdrop/BackdropFields.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropFlows.d.ts +128 -0
- package/dist/components/Backdrop/BackdropFlows.js +156 -0
- package/dist/components/Backdrop/BackdropFlows.js.map +1 -0
- package/dist/components/Backdrop/BackdropFlows.module.css.js +80 -0
- package/dist/components/Backdrop/BackdropFlows.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropFrame.d.ts +36 -0
- package/dist/components/Backdrop/BackdropFrame.js +15 -0
- package/dist/components/Backdrop/BackdropFrame.js.map +1 -0
- package/dist/components/Backdrop/BackdropFrame.module.css.js +14 -0
- package/dist/components/Backdrop/BackdropFrame.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropGlobalPanels.d.ts +272 -0
- package/dist/components/Backdrop/BackdropGlobalPanels.js +264 -0
- package/dist/components/Backdrop/BackdropGlobalPanels.js.map +1 -0
- package/dist/components/Backdrop/BackdropGlobalPanels.module.css.js +201 -0
- package/dist/components/Backdrop/BackdropGlobalPanels.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropHub.d.ts +80 -0
- package/dist/components/Backdrop/BackdropHub.js +92 -0
- package/dist/components/Backdrop/BackdropHub.js.map +1 -0
- package/dist/components/Backdrop/BackdropHub.module.css.js +40 -0
- package/dist/components/Backdrop/BackdropHub.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropLists.d.ts +165 -0
- package/dist/components/Backdrop/BackdropLists.js +162 -0
- package/dist/components/Backdrop/BackdropLists.js.map +1 -0
- package/dist/components/Backdrop/BackdropLists.module.css.js +114 -0
- package/dist/components/Backdrop/BackdropLists.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropOverlays.d.ts +175 -0
- package/dist/components/Backdrop/BackdropOverlays.js +252 -0
- package/dist/components/Backdrop/BackdropOverlays.js.map +1 -0
- package/dist/components/Backdrop/BackdropOverlays.module.css.js +104 -0
- package/dist/components/Backdrop/BackdropOverlays.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropPage.d.ts +73 -0
- package/dist/components/Backdrop/BackdropPage.js +65 -0
- package/dist/components/Backdrop/BackdropPage.js.map +1 -0
- package/dist/components/Backdrop/BackdropPage.module.css.js +46 -0
- package/dist/components/Backdrop/BackdropPage.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropPatterns.d.ts +224 -0
- package/dist/components/Backdrop/BackdropPatterns.js +202 -0
- package/dist/components/Backdrop/BackdropPatterns.js.map +1 -0
- package/dist/components/Backdrop/BackdropPatterns.module.css.js +114 -0
- package/dist/components/Backdrop/BackdropPatterns.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropRail.d.ts +63 -0
- package/dist/components/Backdrop/BackdropRail.js +98 -0
- package/dist/components/Backdrop/BackdropRail.js.map +1 -0
- package/dist/components/Backdrop/BackdropRail.module.css.js +42 -0
- package/dist/components/Backdrop/BackdropRail.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropSheets.d.ts +68 -0
- package/dist/components/Backdrop/BackdropSheets.js +75 -0
- package/dist/components/Backdrop/BackdropSheets.js.map +1 -0
- package/dist/components/Backdrop/BackdropSheets.module.css.js +42 -0
- package/dist/components/Backdrop/BackdropSheets.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropTabs.d.ts +20 -0
- package/dist/components/Backdrop/BackdropTabs.js +31 -0
- package/dist/components/Backdrop/BackdropTabs.js.map +1 -0
- package/dist/components/Backdrop/BackdropTabs.module.css.js +16 -0
- package/dist/components/Backdrop/BackdropTabs.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropTooltip.d.ts +21 -0
- package/dist/components/Backdrop/BackdropTooltip.js +15 -0
- package/dist/components/Backdrop/BackdropTooltip.js.map +1 -0
- package/dist/components/Backdrop/BackdropTooltip.module.css.js +18 -0
- package/dist/components/Backdrop/BackdropTooltip.module.css.js.map +1 -0
- package/dist/components/Backdrop/BackdropTopStrip.d.ts +65 -0
- package/dist/components/Backdrop/BackdropTopStrip.js +46 -0
- package/dist/components/Backdrop/BackdropTopStrip.js.map +1 -0
- package/dist/components/Backdrop/BackdropTopStrip.module.css.js +40 -0
- package/dist/components/Backdrop/BackdropTopStrip.module.css.js.map +1 -0
- package/dist/components/Backdrop/cx.d.ts +2 -0
- package/dist/components/Backdrop/cx.js +7 -0
- package/dist/components/Backdrop/cx.js.map +1 -0
- package/dist/components/Backdrop/icons.d.ts +70 -0
- package/dist/components/Backdrop/icons.js +103 -0
- package/dist/components/Backdrop/icons.js.map +1 -0
- package/package.json +23 -4
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsxs as t, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import a from "./BackdropBasics.module.css.js";
|
|
3
|
+
import { cx as p } from "./cx.js";
|
|
4
|
+
import { initials as v } from "../AccountMenu/initials.js";
|
|
5
|
+
import { Close as g, Plus as k, Check as B } from "./icons.js";
|
|
6
|
+
function O({ children: i, tone: r = "ink", label: c, className: s }) {
|
|
7
|
+
return /* @__PURE__ */ t("span", { className: p(a.badge, a[`badge-${r}`], s), children: [
|
|
8
|
+
/* @__PURE__ */ n("span", { "aria-hidden": c ? !0 : void 0, children: i }),
|
|
9
|
+
c && /* @__PURE__ */ n("span", { className: a.srOnly, children: c })
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
function A({
|
|
13
|
+
children: i,
|
|
14
|
+
selected: r = !1,
|
|
15
|
+
count: c,
|
|
16
|
+
icon: s,
|
|
17
|
+
kind: l = "filter",
|
|
18
|
+
selectionMode: h = "multiple",
|
|
19
|
+
removeLabel: e,
|
|
20
|
+
className: o,
|
|
21
|
+
type: d = "button",
|
|
22
|
+
...u
|
|
23
|
+
}) {
|
|
24
|
+
const m = c !== void 0 && /* @__PURE__ */ n("span", { className: a.chipCount, children: c });
|
|
25
|
+
if (l === "tag")
|
|
26
|
+
return /* @__PURE__ */ t("span", { className: p(a.chip, a.chipTag, e !== void 0 && a.chipTagRemovable, o), children: [
|
|
27
|
+
s && /* @__PURE__ */ n("span", { className: a.chipIcon, children: s }),
|
|
28
|
+
/* @__PURE__ */ n("span", { children: i }),
|
|
29
|
+
m,
|
|
30
|
+
e !== void 0 && /* @__PURE__ */ n("button", { type: d, "aria-label": e, className: a.chipRemove, ...u, children: /* @__PURE__ */ n(g, { size: 16 }) })
|
|
31
|
+
] });
|
|
32
|
+
if (l === "add")
|
|
33
|
+
return /* @__PURE__ */ t("button", { type: d, className: p(a.chip, a.chipAdd, o), ...u, children: [
|
|
34
|
+
/* @__PURE__ */ n("span", { className: a.chipIcon, children: /* @__PURE__ */ n(k, { size: 16 }) }),
|
|
35
|
+
/* @__PURE__ */ n("span", { children: i })
|
|
36
|
+
] });
|
|
37
|
+
if (l === "action")
|
|
38
|
+
return /* @__PURE__ */ t("button", { type: d, className: p(a.chip, o), ...u, children: [
|
|
39
|
+
s && /* @__PURE__ */ n("span", { className: a.chipIcon, children: s }),
|
|
40
|
+
/* @__PURE__ */ n("span", { children: i }),
|
|
41
|
+
m
|
|
42
|
+
] });
|
|
43
|
+
if (l === "choice") {
|
|
44
|
+
const f = h === "single" ? { role: "radio", "aria-checked": r } : { "aria-pressed": r }, N = r ? /* @__PURE__ */ n(B, { size: 16 }) : s;
|
|
45
|
+
return /* @__PURE__ */ t("button", { type: d, ...f, className: p(a.chip, a.chipChoice, o), ...u, children: [
|
|
46
|
+
N && /* @__PURE__ */ n("span", { className: a.chipIcon, children: N }),
|
|
47
|
+
/* @__PURE__ */ n("span", { children: i }),
|
|
48
|
+
m
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
return /* @__PURE__ */ t("button", { type: d, "aria-pressed": r, className: p(a.chip, o), ...u, children: [
|
|
52
|
+
s && /* @__PURE__ */ n("span", { className: a.chipIcon, children: s }),
|
|
53
|
+
/* @__PURE__ */ n("span", { children: i }),
|
|
54
|
+
m
|
|
55
|
+
] });
|
|
56
|
+
}
|
|
57
|
+
function P({ children: i, tone: r = "neutral", dot: c = !0, icon: s, appearance: l = "soft", className: h }) {
|
|
58
|
+
const e = s != null;
|
|
59
|
+
return /* @__PURE__ */ t(
|
|
60
|
+
"span",
|
|
61
|
+
{
|
|
62
|
+
className: p(
|
|
63
|
+
a.pill,
|
|
64
|
+
a[`pill-${r}`],
|
|
65
|
+
!c && !e && a.pillPlain,
|
|
66
|
+
l === "outline" && a.pillOutline,
|
|
67
|
+
h
|
|
68
|
+
),
|
|
69
|
+
children: [
|
|
70
|
+
e ? /* @__PURE__ */ n("span", { "aria-hidden": "true", className: a.pillIcon, children: s }) : c && /* @__PURE__ */ n("span", { "aria-hidden": "true", className: a.pillDot }),
|
|
71
|
+
i
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function T({ children: i, className: r }) {
|
|
77
|
+
return /* @__PURE__ */ n("span", { className: p(a.soon, r), children: i });
|
|
78
|
+
}
|
|
79
|
+
function I({ name: i, initials: r, size: c = 36, tone: s = "sand", square: l = !1, decorative: h = !0, badge: e, className: o }) {
|
|
80
|
+
return /* @__PURE__ */ t(
|
|
81
|
+
"span",
|
|
82
|
+
{
|
|
83
|
+
className: p(a.avatar, a[`avatar-${s}`], a[`avatar-${c}`], l && a.avatarSquare, o),
|
|
84
|
+
role: h ? void 0 : "img",
|
|
85
|
+
"aria-label": h ? void 0 : i,
|
|
86
|
+
"aria-hidden": h || void 0,
|
|
87
|
+
children: [
|
|
88
|
+
r ?? v(i),
|
|
89
|
+
e && /* @__PURE__ */ n("span", { className: a.avatarBadge, children: e })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function j({ people: i, max: r = 3, size: c = 32, label: s, overflowLabel: l, className: h }) {
|
|
95
|
+
const e = i.slice(0, Math.max(0, r)), o = i.length - e.length;
|
|
96
|
+
return /* @__PURE__ */ t("span", { role: "group", "aria-label": s, className: p(a.avatarStack, h), children: [
|
|
97
|
+
e.map((d, u) => /* @__PURE__ */ n(
|
|
98
|
+
I,
|
|
99
|
+
{
|
|
100
|
+
name: d.name,
|
|
101
|
+
initials: d.initials,
|
|
102
|
+
tone: d.tone,
|
|
103
|
+
size: c,
|
|
104
|
+
decorative: !1,
|
|
105
|
+
className: a.avatarStackItem
|
|
106
|
+
},
|
|
107
|
+
`${d.name}-${u}`
|
|
108
|
+
)),
|
|
109
|
+
o > 0 && /* @__PURE__ */ t("span", { className: p(a.avatar, a[`avatar-${c}`], a.avatarStackItem, a.avatarOverflow), children: [
|
|
110
|
+
/* @__PURE__ */ t("span", { "aria-hidden": l ? !0 : void 0, children: [
|
|
111
|
+
"+",
|
|
112
|
+
o
|
|
113
|
+
] }),
|
|
114
|
+
l && /* @__PURE__ */ n("span", { className: a.srOnly, children: l })
|
|
115
|
+
] })
|
|
116
|
+
] });
|
|
117
|
+
}
|
|
118
|
+
function z({ children: i }) {
|
|
119
|
+
return /* @__PURE__ */ n("span", { className: a.srOnly, children: i });
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
I as BackdropAvatar,
|
|
123
|
+
j as BackdropAvatarStack,
|
|
124
|
+
O as BackdropBadge,
|
|
125
|
+
A as BackdropChip,
|
|
126
|
+
P as BackdropPill,
|
|
127
|
+
T as BackdropSoonTag,
|
|
128
|
+
z as BackdropVisuallyHidden
|
|
129
|
+
};
|
|
130
|
+
//# sourceMappingURL=BackdropBasics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackdropBasics.js","sources":["../../../src/components/Backdrop/BackdropBasics.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, ReactNode } from 'react'\nimport styles from './BackdropBasics.module.css'\nimport { cx } from './cx'\nimport { initials as initialsOf } from '../AccountMenu/initials'\nimport { Check, Close, Plus } from './icons'\n\n/* ── Badge ─────────────────────────────────────────────────────────────── */\n\nexport interface BackdropBadgeProps {\n /** A count, or a one-word tag such as \"New\". */\n children: ReactNode\n /**\n * `ink` (default): white on ink, the app menu's counts and Help's \"New\".\n * `muted`: grey on the panel, a count that should not pull the eye.\n */\n tone?: 'ink' | 'muted'\n /** Screen-reader text when the visible badge is a bare number. */\n label?: string\n className?: string\n}\n\nexport function BackdropBadge({ children, tone = 'ink', label, className }: BackdropBadgeProps) {\n return (\n <span className={cx(styles.badge, styles[`badge-${tone}`], className)}>\n <span aria-hidden={label ? true : undefined}>{children}</span>\n {label && <span className={styles.srOnly}>{label}</span>}\n </span>\n )\n}\n\n/* ── Chip ──────────────────────────────────────────────────────────────── */\n\n/**\n * What a chip is for. Every kind is 34px, fully round, 14px medium.\n *\n * - `filter` (default): a toggle in a filter row, ink-filled when on.\n * - `choice`: one answer among several (a setup question). Ink-filled with a\n * leading check when chosen, so the state never rests on colour alone.\n * - `tag`: a value already picked, on the panel grey. With `removeLabel` it\n * carries a × button; the chip itself is not a control.\n * - `add`: the action at the end of a tag row, a leading plus on the hairline.\n * - `action` (Batch 4): a one-press action drawn as a resting chip, with the\n * caller's leading icon if any: a composer's quick insert (\"Video link\") or\n * a suggested question (\"What are tokens?\"). A plain button, never pressed.\n */\nexport type BackdropChipKind = 'filter' | 'choice' | 'tag' | 'add' | 'action'\n\nexport interface BackdropChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n children: ReactNode\n /** The filter this chip stands for is on, or this choice is chosen. Drawn ink-filled. */\n selected?: boolean\n /** A count after the label (\"Running 5\"). */\n count?: ReactNode\n /** Leading icon, 16px (a channel glyph, say). A chosen `choice` shows its check here instead. */\n icon?: ReactNode\n kind?: BackdropChipKind\n /**\n * `choice` only. `multiple` (default): each chip is a toggle, `aria-pressed`.\n * `single`: the chips are a radio group, `role=\"radio\"` with `aria-checked`;\n * the caller wraps them in an element with `role=\"radiogroup\"` and a name.\n */\n selectionMode?: 'single' | 'multiple'\n /**\n * `tag` only. The × button's accessible name, translated by the caller:\n * \"Remove LinkedIn\". Without it the tag renders with no × at all.\n * Stage A: the button is markup only; removing is Stage B's handler.\n */\n removeLabel?: string\n}\n\n/** A filter chip: a toggle (aria-pressed), so a row of them is a filter group. */\nexport function BackdropChip({\n children,\n selected = false,\n count,\n icon,\n kind = 'filter',\n selectionMode = 'multiple',\n removeLabel,\n className,\n type = 'button',\n ...rest\n}: BackdropChipProps) {\n const countNode = count !== undefined && <span className={styles.chipCount}>{count}</span>\n\n if (kind === 'tag') {\n // The tag is a value, not a control. Button attributes (disabled, a Stage B\n // onClick) belong to its × button, the one thing in it a person can press.\n return (\n <span className={cx(styles.chip, styles.chipTag, removeLabel !== undefined && styles.chipTagRemovable, className)}>\n {icon && <span className={styles.chipIcon}>{icon}</span>}\n <span>{children}</span>\n {countNode}\n {removeLabel !== undefined && (\n <button type={type} aria-label={removeLabel} className={styles.chipRemove} {...rest}>\n <Close size={16} />\n </button>\n )}\n </span>\n )\n }\n\n if (kind === 'add') {\n return (\n <button type={type} className={cx(styles.chip, styles.chipAdd, className)} {...rest}>\n <span className={styles.chipIcon}>\n <Plus size={16} />\n </span>\n <span>{children}</span>\n </button>\n )\n }\n\n if (kind === 'action') {\n return (\n <button type={type} className={cx(styles.chip, className)} {...rest}>\n {icon && <span className={styles.chipIcon}>{icon}</span>}\n <span>{children}</span>\n {countNode}\n </button>\n )\n }\n\n if (kind === 'choice') {\n const state = selectionMode === 'single' ? { role: 'radio', 'aria-checked': selected } : { 'aria-pressed': selected }\n const leading = selected ? <Check size={16} /> : icon\n return (\n <button type={type} {...state} className={cx(styles.chip, styles.chipChoice, className)} {...rest}>\n {leading && <span className={styles.chipIcon}>{leading}</span>}\n <span>{children}</span>\n {countNode}\n </button>\n )\n }\n\n return (\n <button type={type} aria-pressed={selected} className={cx(styles.chip, className)} {...rest}>\n {icon && <span className={styles.chipIcon}>{icon}</span>}\n <span>{children}</span>\n {countNode}\n </button>\n )\n}\n\n/* ── Pill ──────────────────────────────────────────────────────────────── */\n\nexport type BackdropPillTone = 'success' | 'neutral' | 'warning' | 'danger' | 'info' | 'ink'\n\n/** `soft` (default): a tinted ground. `outline`: no ground, a 1px edge in the tone. */\nexport type BackdropPillAppearance = 'soft' | 'outline'\n\nexport interface BackdropPillProps {\n /** The status word: \"Running\", \"Paused\", \"Needs approval\". */\n children: ReactNode\n tone?: BackdropPillTone\n /** The leading status dot. Off for a plain tag such as a title's \"Draft\". */\n dot?: boolean\n /**\n * A leading 16px icon in place of the dot, drawn in the tone's dot colour.\n * Decorative: the word carries the meaning.\n */\n icon?: ReactNode\n appearance?: BackdropPillAppearance\n className?: string\n}\n\n/** A status pill. Not interactive; the word carries the meaning, the colour repeats it. */\nexport function BackdropPill({ children, tone = 'neutral', dot = true, icon, appearance = 'soft', className }: BackdropPillProps) {\n const hasIcon = icon !== undefined && icon !== null\n return (\n <span\n className={cx(\n styles.pill,\n styles[`pill-${tone}`],\n !dot && !hasIcon && styles.pillPlain,\n appearance === 'outline' && styles.pillOutline,\n className,\n )}\n >\n {hasIcon ? (\n <span aria-hidden=\"true\" className={styles.pillIcon}>\n {icon}\n </span>\n ) : (\n dot && <span aria-hidden=\"true\" className={styles.pillDot} />\n )}\n {children}\n </span>\n )\n}\n\n/* ── Soon tag ──────────────────────────────────────────────────────────── */\n\nexport interface BackdropSoonTagProps {\n /** The word, translated: \"Soon\". */\n children: ReactNode\n className?: string\n}\n\n/** The small tag beside an app that is not built yet, in menus and the All apps popover. */\nexport function BackdropSoonTag({ children, className }: BackdropSoonTagProps) {\n return <span className={cx(styles.soon, className)}>{children}</span>\n}\n\n/* ── Avatar ────────────────────────────────────────────────────────────── */\n\nexport type BackdropAvatarTone = 'ink' | 'sand' | 'slate' | 'sage' | 'stone'\nexport type BackdropAvatarSize = 24 | 32 | 36 | 40 | 44 | 48 | 56 | 64\n\nexport interface BackdropAvatarProps {\n /** A person's name or email; the two letters are derived the Hub's way. */\n name: string\n /** Override the derived letters. */\n initials?: string\n /** 24–40 in lists and menus; 44–64 for a profile head or a focus flow. */\n size?: BackdropAvatarSize\n tone?: BackdropAvatarTone\n /** Square with rounded corners, for a company rather than a person. */\n square?: boolean\n /** Hidden from assistive tech when the name is already printed beside it. */\n decorative?: boolean\n /**\n * A small badge on the bottom-right corner (a channel glyph). Pass a 16px\n * icon; it sits on a white disc ringed off from the avatar. Decorative: name\n * the channel in text beside the avatar if it matters.\n */\n badge?: ReactNode\n className?: string\n}\n\nexport function BackdropAvatar({ name, initials, size = 36, tone = 'sand', square = false, decorative = true, badge, className }: BackdropAvatarProps) {\n return (\n <span\n className={cx(styles.avatar, styles[`avatar-${tone}`], styles[`avatar-${size}`], square && styles.avatarSquare, className)}\n role={decorative ? undefined : 'img'}\n aria-label={decorative ? undefined : name}\n aria-hidden={decorative || undefined}\n >\n {initials ?? initialsOf(name)}\n {badge && <span className={styles.avatarBadge}>{badge}</span>}\n </span>\n )\n}\n\n/* ── Avatar stack ──────────────────────────────────────────────────────── */\n\nexport interface BackdropAvatarStackPerson {\n name: string\n initials?: string\n tone?: BackdropAvatarTone\n}\n\nexport interface BackdropAvatarStackProps {\n people: BackdropAvatarStackPerson[]\n /** How many avatars show before the rest fold into \"+N\". Default 3. */\n max?: number\n size?: BackdropAvatarSize\n /** The group's accessible name, translated by the caller: \"People on this team\". */\n label: string\n /**\n * Screen-reader text for the \"+N\" bubble, translated by the caller:\n * \"and 4 more\". Without it the bubble announces as \"+4\".\n */\n overflowLabel?: string\n className?: string\n}\n\n/**\n * Overlapping avatars, each ringed in white so the edges stay legible, with\n * the rest folded into a \"+N\" bubble. Each person is named to assistive tech;\n * the stack is a labelled group.\n */\nexport function BackdropAvatarStack({ people, max = 3, size = 32, label, overflowLabel, className }: BackdropAvatarStackProps) {\n const shown = people.slice(0, Math.max(0, max))\n const hidden = people.length - shown.length\n return (\n <span role=\"group\" aria-label={label} className={cx(styles.avatarStack, className)}>\n {shown.map((person, i) => (\n <BackdropAvatar\n key={`${person.name}-${i}`}\n name={person.name}\n initials={person.initials}\n tone={person.tone}\n size={size}\n decorative={false}\n className={styles.avatarStackItem}\n />\n ))}\n {hidden > 0 && (\n <span className={cx(styles.avatar, styles[`avatar-${size}`], styles.avatarStackItem, styles.avatarOverflow)}>\n <span aria-hidden={overflowLabel ? true : undefined}>+{hidden}</span>\n {overflowLabel && <span className={styles.srOnly}>{overflowLabel}</span>}\n </span>\n )}\n </span>\n )\n}\n\n/* ── Visually hidden ───────────────────────────────────────────────────── */\n\nexport function BackdropVisuallyHidden({ children }: { children: ReactNode }) {\n return <span className={styles.srOnly}>{children}</span>\n}\n"],"names":["BackdropBadge","children","tone","label","className","jsxs","cx","styles","jsx","BackdropChip","selected","count","icon","kind","selectionMode","removeLabel","type","rest","countNode","Close","Plus","state","leading","Check","BackdropPill","dot","appearance","hasIcon","BackdropSoonTag","BackdropAvatar","name","initials","size","square","decorative","badge","initialsOf","BackdropAvatarStack","people","max","overflowLabel","shown","hidden","person","i","BackdropVisuallyHidden"],"mappings":";;;;;AAqBO,SAASA,EAAc,EAAE,UAAAC,GAAU,MAAAC,IAAO,OAAO,OAAAC,GAAO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O,SAASK,EAAuB,EAAE,UAAA5C,KAAqC;AAC5E,SAAO,gBAAAO,EAAC,QAAA,EAAK,WAAWD,EAAO,QAAS,UAAAN,GAAS;AACnD;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const a = "_srOnly_130ko_3", _ = "_badge_130ko_14", o = "_chip_130ko_43", t = "_chipIcon_130ko_90", l = "_chipCount_130ko_94", i = "_chipChoice_130ko_108", c = "_chipTag_130ko_124", n = "_chipTagRemovable_130ko_134", r = "_chipRemove_130ko_138", k = "_chipAdd_130ko_173", e = "_pill_130ko_179", v = "_pillDot_130ko_194", p = "_pillPlain_130ko_202", s = "_pillIcon_130ko_221", h = "_pillOutline_130ko_241", d = "_soon_130ko_253", g = "_avatar_130ko_271", u = "_avatarSquare_130ko_283", m = "_avatarBadge_130ko_303", b = "_avatarStack_130ko_327", I = "_avatarStackItem_130ko_332", O = "_avatarOverflow_130ko_340", S = {
|
|
2
|
+
srOnly: a,
|
|
3
|
+
badge: _,
|
|
4
|
+
"badge-ink": "_badge-ink_130ko_31",
|
|
5
|
+
"badge-muted": "_badge-muted_130ko_36",
|
|
6
|
+
chip: o,
|
|
7
|
+
chipIcon: t,
|
|
8
|
+
chipCount: l,
|
|
9
|
+
chipChoice: i,
|
|
10
|
+
chipTag: c,
|
|
11
|
+
chipTagRemovable: n,
|
|
12
|
+
chipRemove: r,
|
|
13
|
+
chipAdd: k,
|
|
14
|
+
pill: e,
|
|
15
|
+
pillDot: v,
|
|
16
|
+
pillPlain: p,
|
|
17
|
+
"pill-success": "_pill-success_130ko_207",
|
|
18
|
+
"pill-neutral": "_pill-neutral_130ko_209",
|
|
19
|
+
"pill-warning": "_pill-warning_130ko_211",
|
|
20
|
+
"pill-danger": "_pill-danger_130ko_213",
|
|
21
|
+
"pill-info": "_pill-info_130ko_215",
|
|
22
|
+
"pill-ink": "_pill-ink_130ko_217",
|
|
23
|
+
pillIcon: s,
|
|
24
|
+
pillOutline: h,
|
|
25
|
+
soon: d,
|
|
26
|
+
avatar: g,
|
|
27
|
+
avatarSquare: u,
|
|
28
|
+
"avatar-24": "_avatar-24_130ko_288",
|
|
29
|
+
"avatar-32": "_avatar-32_130ko_289",
|
|
30
|
+
"avatar-36": "_avatar-36_130ko_290",
|
|
31
|
+
"avatar-40": "_avatar-40_130ko_291",
|
|
32
|
+
"avatar-44": "_avatar-44_130ko_292",
|
|
33
|
+
"avatar-48": "_avatar-48_130ko_293",
|
|
34
|
+
"avatar-56": "_avatar-56_130ko_294",
|
|
35
|
+
"avatar-64": "_avatar-64_130ko_295",
|
|
36
|
+
"avatar-ink": "_avatar-ink_130ko_297",
|
|
37
|
+
"avatar-sand": "_avatar-sand_130ko_298",
|
|
38
|
+
"avatar-slate": "_avatar-slate_130ko_299",
|
|
39
|
+
"avatar-sage": "_avatar-sage_130ko_300",
|
|
40
|
+
"avatar-stone": "_avatar-stone_130ko_301",
|
|
41
|
+
avatarBadge: m,
|
|
42
|
+
avatarStack: b,
|
|
43
|
+
avatarStackItem: I,
|
|
44
|
+
avatarOverflow: O
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
g as avatar,
|
|
48
|
+
m as avatarBadge,
|
|
49
|
+
O as avatarOverflow,
|
|
50
|
+
u as avatarSquare,
|
|
51
|
+
b as avatarStack,
|
|
52
|
+
I as avatarStackItem,
|
|
53
|
+
_ as badge,
|
|
54
|
+
o as chip,
|
|
55
|
+
k as chipAdd,
|
|
56
|
+
i as chipChoice,
|
|
57
|
+
l as chipCount,
|
|
58
|
+
t as chipIcon,
|
|
59
|
+
r as chipRemove,
|
|
60
|
+
c as chipTag,
|
|
61
|
+
n as chipTagRemovable,
|
|
62
|
+
S as default,
|
|
63
|
+
e as pill,
|
|
64
|
+
v as pillDot,
|
|
65
|
+
s as pillIcon,
|
|
66
|
+
h as pillOutline,
|
|
67
|
+
p as pillPlain,
|
|
68
|
+
d as soon,
|
|
69
|
+
a as srOnly
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=BackdropBasics.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackdropBasics.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ElementType, ReactNode } from 'react';
|
|
2
|
+
import { BackdropTooltipSide } from './BackdropTooltip';
|
|
3
|
+
/**
|
|
4
|
+
* The four variants Backdrop shipped with. Kept at four on purpose: callers key
|
|
5
|
+
* records by it (Buttons.stories.tsx's labels), and widening it would break
|
|
6
|
+
* them. `BackdropButtonVariantName` is every variant the button draws.
|
|
7
|
+
*/
|
|
8
|
+
export type BackdropButtonVariant = 'primary' | 'outline' | 'ghost' | 'ink';
|
|
9
|
+
/** Every variant, including `soft` (ADR-0017, D4). */
|
|
10
|
+
export type BackdropButtonVariantName = BackdropButtonVariant | 'soft';
|
|
11
|
+
/** `xl` (44px) is for focus flows only: setup and multi-step forms (ADR-0017, D4). */
|
|
12
|
+
export type BackdropButtonSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
13
|
+
export interface BackdropButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
14
|
+
/**
|
|
15
|
+
* `primary` is the page's one orange action; there is at most one on a screen
|
|
16
|
+
* (round 6 global rules). `ink` is the primary inside a popover or dialog.
|
|
17
|
+
* `soft` is grey-filled with ink text: quieter than outline, but unlike
|
|
18
|
+
* `ghost` it keeps its box at rest (ADR-0017, D4).
|
|
19
|
+
*/
|
|
20
|
+
variant?: BackdropButtonVariantName;
|
|
21
|
+
size?: BackdropButtonSize;
|
|
22
|
+
/** The visible label. 1–3 words, verb first (copy guide). */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
/** Leading icon, 18px. Decorative: the label names the button. */
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
/** Trailing icon, e.g. a chevron on a menu button. */
|
|
27
|
+
trailingIcon?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Busy: the label and icons hide (keeping the button's width) and a spinner
|
|
30
|
+
* shows. The button stays focusable and announces `aria-busy`; clicks are
|
|
31
|
+
* the caller's to ignore.
|
|
32
|
+
*/
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
fullWidth?: boolean;
|
|
35
|
+
/** Renders the button as a link. Pass `linkComponent` for a router's link. */
|
|
36
|
+
href?: string;
|
|
37
|
+
/** The element a linked button renders through (ADR-0011's escape hatch). */
|
|
38
|
+
linkComponent?: ElementType;
|
|
39
|
+
}
|
|
40
|
+
export declare function BackdropButton({ variant, size, children, icon, trailingIcon, loading, fullWidth, href, linkComponent: Link, className, type, ...rest }: BackdropButtonProps): import("react").JSX.Element;
|
|
41
|
+
export interface BackdropIconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> {
|
|
42
|
+
/** Required: an icon-only button is named by this, and the tooltip shows it. */
|
|
43
|
+
label: string;
|
|
44
|
+
icon: ReactNode;
|
|
45
|
+
variant?: Exclude<BackdropButtonVariantName, 'primary'>;
|
|
46
|
+
size?: BackdropButtonSize;
|
|
47
|
+
/** Show `label` in a tooltip on hover and keyboard focus. On by default. */
|
|
48
|
+
tooltip?: boolean;
|
|
49
|
+
/** Hold the tooltip hidden while it stays mounted, e.g. while this button's menu is open. */
|
|
50
|
+
tooltipSuppressed?: boolean;
|
|
51
|
+
tooltipSide?: BackdropTooltipSide;
|
|
52
|
+
}
|
|
53
|
+
export declare function BackdropIconButton({ label, icon, variant, size, tooltip, tooltipSuppressed, tooltipSide, className, type, ...rest }: BackdropIconButtonProps): import("react").JSX.Element;
|
|
54
|
+
export interface BackdropTextLinkProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
/** Leading icon, e.g. a plus on "Add a note". Decorative: the words name the action. */
|
|
57
|
+
icon?: ReactNode;
|
|
58
|
+
trailingIcon?: ReactNode;
|
|
59
|
+
href?: string;
|
|
60
|
+
linkComponent?: ElementType;
|
|
61
|
+
}
|
|
62
|
+
/** "View all", "Open wallet", "More options": an action that is a word in a line. */
|
|
63
|
+
export declare function BackdropTextLink({ children, icon, trailingIcon, href, linkComponent: Link, className, type, ...rest }: BackdropTextLinkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as t, jsxs as k, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import n from "./BackdropButton.module.css.js";
|
|
3
|
+
import { cx as d } from "./cx.js";
|
|
4
|
+
import { Spinner as B } from "./icons.js";
|
|
5
|
+
import { BackdropTooltip as C } from "./BackdropTooltip.js";
|
|
6
|
+
function g({
|
|
7
|
+
variant: s = "outline",
|
|
8
|
+
size: a = "lg",
|
|
9
|
+
children: r,
|
|
10
|
+
icon: e,
|
|
11
|
+
trailingIcon: l,
|
|
12
|
+
loading: o = !1,
|
|
13
|
+
fullWidth: c = !1,
|
|
14
|
+
href: i,
|
|
15
|
+
linkComponent: m = "a",
|
|
16
|
+
className: p,
|
|
17
|
+
type: u = "button",
|
|
18
|
+
...b
|
|
19
|
+
}) {
|
|
20
|
+
const f = d(n.button, n[s], n[a], c && n.fullWidth, o && n.loading, p), h = /* @__PURE__ */ k(N, { children: [
|
|
21
|
+
e && /* @__PURE__ */ t("span", { className: n.icon, children: e }),
|
|
22
|
+
/* @__PURE__ */ t("span", { className: n.label, children: r }),
|
|
23
|
+
l && /* @__PURE__ */ t("span", { className: n.icon, children: l }),
|
|
24
|
+
o && /* @__PURE__ */ t("span", { className: n.spinner, children: /* @__PURE__ */ t(B, {}) })
|
|
25
|
+
] });
|
|
26
|
+
return i !== void 0 ? /* @__PURE__ */ t(m, { href: i, className: f, "aria-busy": o || void 0, "aria-disabled": b.disabled || void 0, onClick: b.onClick, children: h }) : /* @__PURE__ */ t("button", { type: u, className: f, "aria-busy": o || void 0, ...b, children: h });
|
|
27
|
+
}
|
|
28
|
+
function F({
|
|
29
|
+
label: s,
|
|
30
|
+
icon: a,
|
|
31
|
+
variant: r = "ghost",
|
|
32
|
+
size: e = "sm",
|
|
33
|
+
tooltip: l = !0,
|
|
34
|
+
tooltipSuppressed: o = !1,
|
|
35
|
+
tooltipSide: c = "bottom",
|
|
36
|
+
className: i,
|
|
37
|
+
type: m = "button",
|
|
38
|
+
...p
|
|
39
|
+
}) {
|
|
40
|
+
const u = /* @__PURE__ */ t("button", { type: m, "aria-label": s, className: d(n.button, n.iconOnly, n[r], n[e], i), ...p, children: a });
|
|
41
|
+
return l ? /* @__PURE__ */ t(C, { content: s, side: c, labelsTrigger: !0, suppressed: o, children: u }) : u;
|
|
42
|
+
}
|
|
43
|
+
function L({ children: s, icon: a, trailingIcon: r, href: e, linkComponent: l = "a", className: o, type: c = "button", ...i }) {
|
|
44
|
+
return e !== void 0 ? /* @__PURE__ */ k(l, { href: e, className: d(n.link, o), onClick: i.onClick, children: [
|
|
45
|
+
a,
|
|
46
|
+
s,
|
|
47
|
+
r
|
|
48
|
+
] }) : /* @__PURE__ */ k("button", { type: c, className: d(n.link, o), ...i, children: [
|
|
49
|
+
a,
|
|
50
|
+
s,
|
|
51
|
+
r
|
|
52
|
+
] });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
g as BackdropButton,
|
|
56
|
+
F as BackdropIconButton,
|
|
57
|
+
L as BackdropTextLink
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=BackdropButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackdropButton.js","sources":["../../../src/components/Backdrop/BackdropButton.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes, ElementType, ReactNode } from 'react'\nimport styles from './BackdropButton.module.css'\nimport { cx } from './cx'\nimport { Spinner } from './icons'\nimport { BackdropTooltip, type BackdropTooltipSide } from './BackdropTooltip'\n\n/**\n * The four variants Backdrop shipped with. Kept at four on purpose: callers key\n * records by it (Buttons.stories.tsx's labels), and widening it would break\n * them. `BackdropButtonVariantName` is every variant the button draws.\n */\nexport type BackdropButtonVariant = 'primary' | 'outline' | 'ghost' | 'ink'\n/** Every variant, including `soft` (ADR-0017, D4). */\nexport type BackdropButtonVariantName = BackdropButtonVariant | 'soft'\n/** `xl` (44px) is for focus flows only: setup and multi-step forms (ADR-0017, D4). */\nexport type BackdropButtonSize = 'sm' | 'md' | 'lg' | 'xl'\n\nexport interface BackdropButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n /**\n * `primary` is the page's one orange action; there is at most one on a screen\n * (round 6 global rules). `ink` is the primary inside a popover or dialog.\n * `soft` is grey-filled with ink text: quieter than outline, but unlike\n * `ghost` it keeps its box at rest (ADR-0017, D4).\n */\n variant?: BackdropButtonVariantName\n size?: BackdropButtonSize\n /** The visible label. 1–3 words, verb first (copy guide). */\n children: ReactNode\n /** Leading icon, 18px. Decorative: the label names the button. */\n icon?: ReactNode\n /** Trailing icon, e.g. a chevron on a menu button. */\n trailingIcon?: ReactNode\n /**\n * Busy: the label and icons hide (keeping the button's width) and a spinner\n * shows. The button stays focusable and announces `aria-busy`; clicks are\n * the caller's to ignore.\n */\n loading?: boolean\n fullWidth?: boolean\n /** Renders the button as a link. Pass `linkComponent` for a router's link. */\n href?: string\n /** The element a linked button renders through (ADR-0011's escape hatch). */\n linkComponent?: ElementType\n}\n\nexport function BackdropButton({\n variant = 'outline',\n size = 'lg',\n children,\n icon,\n trailingIcon,\n loading = false,\n fullWidth = false,\n href,\n linkComponent: Link = 'a',\n className,\n type = 'button',\n ...rest\n}: BackdropButtonProps) {\n const classes = cx(styles.button, styles[variant], styles[size], fullWidth && styles.fullWidth, loading && styles.loading, className)\n const body = (\n <>\n {icon && <span className={styles.icon}>{icon}</span>}\n <span className={styles.label}>{children}</span>\n {trailingIcon && <span className={styles.icon}>{trailingIcon}</span>}\n {loading && (\n <span className={styles.spinner}>\n <Spinner />\n </span>\n )}\n </>\n )\n\n if (href !== undefined) {\n return (\n <Link href={href} className={classes} aria-busy={loading || undefined} aria-disabled={rest.disabled || undefined} onClick={rest.onClick}>\n {body}\n </Link>\n )\n }\n\n return (\n <button type={type} className={classes} aria-busy={loading || undefined} {...rest}>\n {body}\n </button>\n )\n}\n\nexport interface BackdropIconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> {\n /** Required: an icon-only button is named by this, and the tooltip shows it. */\n label: string\n icon: ReactNode\n variant?: Exclude<BackdropButtonVariantName, 'primary'>\n size?: BackdropButtonSize\n /** Show `label` in a tooltip on hover and keyboard focus. On by default. */\n tooltip?: boolean\n /** Hold the tooltip hidden while it stays mounted, e.g. while this button's menu is open. */\n tooltipSuppressed?: boolean\n tooltipSide?: BackdropTooltipSide\n}\n\nexport function BackdropIconButton({\n label,\n icon,\n variant = 'ghost',\n size = 'sm',\n tooltip = true,\n tooltipSuppressed = false,\n tooltipSide = 'bottom',\n className,\n type = 'button',\n ...rest\n}: BackdropIconButtonProps) {\n const button = (\n <button type={type} aria-label={label} className={cx(styles.button, styles.iconOnly, styles[variant], styles[size], className)} {...rest}>\n {icon}\n </button>\n )\n return tooltip ? (\n <BackdropTooltip content={label} side={tooltipSide} labelsTrigger suppressed={tooltipSuppressed}>\n {button}\n </BackdropTooltip>\n ) : (\n button\n )\n}\n\nexport interface BackdropTextLinkProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {\n children: ReactNode\n /** Leading icon, e.g. a plus on \"Add a note\". Decorative: the words name the action. */\n icon?: ReactNode\n trailingIcon?: ReactNode\n href?: string\n linkComponent?: ElementType\n}\n\n/** \"View all\", \"Open wallet\", \"More options\": an action that is a word in a line. */\nexport function BackdropTextLink({ children, icon, trailingIcon, href, linkComponent: Link = 'a', className, type = 'button', ...rest }: BackdropTextLinkProps) {\n if (href !== undefined) {\n return (\n <Link href={href} className={cx(styles.link, className)} onClick={rest.onClick}>\n {icon}\n {children}\n {trailingIcon}\n </Link>\n )\n }\n return (\n <button type={type} className={cx(styles.link, className)} {...rest}>\n {icon}\n {children}\n {trailingIcon}\n </button>\n )\n}\n"],"names":["BackdropButton","variant","size","children","icon","trailingIcon","loading","fullWidth","href","Link","className","type","rest","classes","cx","styles","body","jsxs","Fragment","jsx","Spinner","BackdropIconButton","label","tooltip","tooltipSuppressed","tooltipSide","button","BackdropTooltip","BackdropTextLink"],"mappings":";;;;;AA6CO,SAASA,EAAe;AAAA,EAC7B,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,WAAAC,IAAY;AAAA,EACZ,MAAAC;AAAA,EACA,eAAeC,IAAO;AAAA,EACtB,WAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,GAAwB;AACtB,QAAMC,IAAUC,EAAGC,EAAO,QAAQA,EAAOd,CAAO,GAAGc,EAAOb,CAAI,GAAGK,KAAaQ,EAAO,WAAWT,KAAWS,EAAO,SAASL,CAAS,GAC9HM,IACJ,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAd,KAAQ,gBAAAe,EAAC,QAAA,EAAK,WAAWJ,EAAO,MAAO,UAAAX,GAAK;AAAA,IAC7C,gBAAAe,EAAC,QAAA,EAAK,WAAWJ,EAAO,OAAQ,UAAAZ,GAAS;AAAA,IACxCE,KAAgB,gBAAAc,EAAC,QAAA,EAAK,WAAWJ,EAAO,MAAO,UAAAV,GAAa;AAAA,IAC5DC,uBACE,QAAA,EAAK,WAAWS,EAAO,SACtB,UAAA,gBAAAI,EAACC,KAAQ,EAAA,CACX;AAAA,EAAA,GAEJ;AAGF,SAAIZ,MAAS,SAET,gBAAAW,EAACV,GAAA,EAAK,MAAAD,GAAY,WAAWK,GAAS,aAAWP,KAAW,QAAW,iBAAeM,EAAK,YAAY,QAAW,SAASA,EAAK,SAC7H,UAAAI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+
const _ = "_button_12wkz_27", n = "_fullWidth_12wkz_62", o = "_sm_12wkz_68", t = "_md_12wkz_75", s = "_lg_12wkz_83", l = "_xl_12wkz_92", i = "_primary_12wkz_102", c = "_ink_12wkz_111", k = "_outline_12wkz_120", w = "_ghost_12wkz_130", z = "_soft_12wkz_139", a = "_loading_12wkz_179", d = "_label_12wkz_183", e = "_icon_12wkz_184", r = "_spinner_12wkz_188", p = "_iconOnly_12wkz_216", b = "_link_12wkz_247", u = {
|
|
2
|
+
button: _,
|
|
3
|
+
fullWidth: n,
|
|
4
|
+
sm: o,
|
|
5
|
+
md: t,
|
|
6
|
+
lg: s,
|
|
7
|
+
xl: l,
|
|
8
|
+
primary: i,
|
|
9
|
+
ink: c,
|
|
10
|
+
outline: k,
|
|
11
|
+
ghost: w,
|
|
12
|
+
soft: z,
|
|
13
|
+
loading: a,
|
|
14
|
+
label: d,
|
|
15
|
+
icon: e,
|
|
16
|
+
spinner: r,
|
|
17
|
+
"boost33-backdrop-spin": "_boost33-backdrop-spin_12wkz_1",
|
|
18
|
+
iconOnly: p,
|
|
19
|
+
link: b
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
_ as button,
|
|
23
|
+
u as default,
|
|
24
|
+
n as fullWidth,
|
|
25
|
+
w as ghost,
|
|
26
|
+
e as icon,
|
|
27
|
+
p as iconOnly,
|
|
28
|
+
c as ink,
|
|
29
|
+
d as label,
|
|
30
|
+
s as lg,
|
|
31
|
+
b as link,
|
|
32
|
+
a as loading,
|
|
33
|
+
t as md,
|
|
34
|
+
k as outline,
|
|
35
|
+
i as primary,
|
|
36
|
+
o as sm,
|
|
37
|
+
z as soft,
|
|
38
|
+
r as spinner,
|
|
39
|
+
l as xl
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=BackdropButton.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackdropButton.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
import { BackdropPageAction } from './BackdropPage';
|
|
3
|
+
/** `ink` (default) or `success`, where the figure itself is good news. Never orange. */
|
|
4
|
+
export type BackdropChartTone = 'ink' | 'success';
|
|
5
|
+
/** The caption action's button. Outline by default; `primary` only when it is the screen's one orange action. */
|
|
6
|
+
export type BackdropChartActionEmphasis = 'outline' | 'primary';
|
|
7
|
+
/** A y-axis tick: where it sits, and its words ("3,000", "€2,000"). */
|
|
8
|
+
export interface BackdropChartTick {
|
|
9
|
+
value: number;
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
export interface BackdropBarChartDatum {
|
|
13
|
+
/** The x label's first line, and the table's row header: "Nov", "2 Nov". */
|
|
14
|
+
label: string;
|
|
15
|
+
/** An optional second line under the x label: "43 reached", "2 posts". */
|
|
16
|
+
detail?: string;
|
|
17
|
+
value: number;
|
|
18
|
+
/** The value as written in the table: "2,280". Defaults to the number. */
|
|
19
|
+
valueText?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BackdropBarChartProps {
|
|
22
|
+
/** The chart's accessible name, and the hidden table's caption: "Views by week". */
|
|
23
|
+
label: string;
|
|
24
|
+
data: BackdropBarChartDatum[];
|
|
25
|
+
/** The hidden table's column headers: the category ("Week") and the figure ("Views"). */
|
|
26
|
+
categoryHeader: string;
|
|
27
|
+
valueHeader: string;
|
|
28
|
+
/**
|
|
29
|
+
* The bar drawn in the strong colour with a bold x label (usually the
|
|
30
|
+
* current period). The others are the tone's pale partner. Leave it out and
|
|
31
|
+
* every bar is the strong colour.
|
|
32
|
+
*/
|
|
33
|
+
highlightIndex?: number;
|
|
34
|
+
tone?: BackdropChartTone;
|
|
35
|
+
/** Y-axis ticks, labelled in a 48 column at the left. Leave out for no axis. */
|
|
36
|
+
yTicks?: BackdropChartTick[];
|
|
37
|
+
/** A gridline at each tick above zero. Default true; needs `yTicks`. */
|
|
38
|
+
gridlines?: boolean;
|
|
39
|
+
/** The value at the top of the plot. Defaults to the highest tick or value. */
|
|
40
|
+
max?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Words beside the plot, level with the top of the highlighted bar: a figure
|
|
43
|
+
* and a line under it ("2 meetings" / "this month"). Pass a node; use
|
|
44
|
+
* `directLabelValue` and `directLabelNote` for the drawn two-line look.
|
|
45
|
+
*/
|
|
46
|
+
directLabel?: ReactNode;
|
|
47
|
+
/** The direct label's figure, 15/20 semibold, in the tone's text colour. */
|
|
48
|
+
directLabelValue?: ReactNode;
|
|
49
|
+
/** The direct label's second line, 13/18 muted. */
|
|
50
|
+
directLabelNote?: ReactNode;
|
|
51
|
+
/** A sentence under the chart, after a hairline. */
|
|
52
|
+
caption?: ReactNode;
|
|
53
|
+
/** One action at the caption's end. */
|
|
54
|
+
action?: BackdropPageAction;
|
|
55
|
+
/** The action's button: `outline` (default) or `primary` when it is the screen's one orange action. */
|
|
56
|
+
actionEmphasis?: BackdropChartActionEmphasis;
|
|
57
|
+
linkComponent?: ElementType;
|
|
58
|
+
className?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Single-series vertical bars over time. Fluid width; the plot height is fixed
|
|
62
|
+
* (`--backdrop-chart-bar-plot-height`). Bars grow up from a baseline in equal
|
|
63
|
+
* slots, at most 56 wide.
|
|
64
|
+
*/
|
|
65
|
+
export declare function BackdropBarChart({ label, data, categoryHeader, valueHeader, highlightIndex, tone, yTicks, gridlines, max, directLabel, directLabelValue, directLabelNote, caption, action, actionEmphasis, linkComponent, className, }: BackdropBarChartProps): import("react").JSX.Element;
|
|
66
|
+
export interface BackdropBarListItem {
|
|
67
|
+
key: string;
|
|
68
|
+
/** The row's name: "Outbound", "Needs found". */
|
|
69
|
+
label: ReactNode;
|
|
70
|
+
value: number;
|
|
71
|
+
/** The figure at the row's end: "1,429". Defaults to the number. */
|
|
72
|
+
valueText?: ReactNode;
|
|
73
|
+
/** A 24px mark or icon before the label. Decorative: the label names the row. */
|
|
74
|
+
leading?: ReactNode;
|
|
75
|
+
/** The fill's tone. `success` for stages that are themselves the good outcome. */
|
|
76
|
+
tone?: BackdropChartTone;
|
|
77
|
+
/**
|
|
78
|
+
* Words in place of the bar, for a row with nothing to draw ("Free"). The
|
|
79
|
+
* row's figure turns muted with it.
|
|
80
|
+
*/
|
|
81
|
+
note?: ReactNode;
|
|
82
|
+
}
|
|
83
|
+
export interface BackdropBarListProps {
|
|
84
|
+
/** The list's accessible name: "Where it goes", "From need to paid". */
|
|
85
|
+
label: string;
|
|
86
|
+
items: BackdropBarListItem[];
|
|
87
|
+
/** The value a full bar stands for. Defaults to the largest item. */
|
|
88
|
+
max?: number;
|
|
89
|
+
className?: string;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Rows of label · bar · figure, the bar proportional to the figure. The
|
|
93
|
+
* label and figure columns size to their widest row so every bar starts and
|
|
94
|
+
* ends on one line. The bar is BackdropProgress's track and fill (the same
|
|
95
|
+
* drawing as BackdropMeter `look="bar"`), at the list's 8px height. Each row
|
|
96
|
+
* reads as its label and figure; the bar is decorative.
|
|
97
|
+
*/
|
|
98
|
+
export declare function BackdropBarList({ label, items, max, className }: BackdropBarListProps): import("react").JSX.Element;
|
|
99
|
+
/** `filled` ink dot, `hollow` ringed dot (a projected or expected end), or `none`. */
|
|
100
|
+
export type BackdropLineChartEnd = 'filled' | 'hollow' | 'none';
|
|
101
|
+
export interface BackdropLineChartPoint {
|
|
102
|
+
/** The table's row header: "25 Aug", "14 Nov". */
|
|
103
|
+
label: string;
|
|
104
|
+
/** The main series. `null` leaves a gap. */
|
|
105
|
+
value: number | null;
|
|
106
|
+
/** The value as written in the table. Defaults to the number. */
|
|
107
|
+
valueText?: string;
|
|
108
|
+
/** The muted comparison series at this point. `null` or absent leaves a gap. */
|
|
109
|
+
comparison?: number | null;
|
|
110
|
+
comparisonText?: string;
|
|
111
|
+
/** A label under the x axis at this point. Points without one show none. */
|
|
112
|
+
axisLabel?: ReactNode;
|
|
113
|
+
/** Sets this point's axis label in ink and semibold. */
|
|
114
|
+
axisLabelStrong?: boolean;
|
|
115
|
+
}
|
|
116
|
+
export interface BackdropLineChartMarker {
|
|
117
|
+
/** The point the vertical rule stands on. A filled dot marks the value there. */
|
|
118
|
+
index: number;
|
|
119
|
+
/** Words at the top of the rule, to its right: "Today · 1,240". */
|
|
120
|
+
label?: ReactNode;
|
|
121
|
+
}
|
|
122
|
+
export interface BackdropLineChartProps {
|
|
123
|
+
/** The chart's accessible name and the hidden table's caption. */
|
|
124
|
+
label: string;
|
|
125
|
+
data: BackdropLineChartPoint[];
|
|
126
|
+
/** The hidden table's headers: the category ("Week") and each series' name. */
|
|
127
|
+
categoryHeader: string;
|
|
128
|
+
seriesName: string;
|
|
129
|
+
/** Name of the comparison series. Required for it to appear in the table. */
|
|
130
|
+
comparisonName?: string;
|
|
131
|
+
/** Y-axis ticks in a 48 column at the left. Leave out for no axis. */
|
|
132
|
+
yTicks?: BackdropChartTick[];
|
|
133
|
+
/** A gridline at each tick above zero. Default true; needs `yTicks`. */
|
|
134
|
+
gridlines?: boolean;
|
|
135
|
+
max?: number;
|
|
136
|
+
/** From this index on, the main line is dashed (a projection). */
|
|
137
|
+
dashedFrom?: number;
|
|
138
|
+
/** Fill the area under the solid part of the main line. */
|
|
139
|
+
area?: boolean;
|
|
140
|
+
marker?: BackdropLineChartMarker;
|
|
141
|
+
/** The main series' last point. Default `none`. */
|
|
142
|
+
end?: BackdropLineChartEnd;
|
|
143
|
+
/** The comparison series' last point. Default `none`. */
|
|
144
|
+
comparisonEnd?: BackdropLineChartEnd;
|
|
145
|
+
caption?: ReactNode;
|
|
146
|
+
action?: BackdropPageAction;
|
|
147
|
+
/** The action's button: `outline` (default) or `primary` when it is the screen's one orange action. */
|
|
148
|
+
actionEmphasis?: BackdropChartActionEmphasis;
|
|
149
|
+
linkComponent?: ElementType;
|
|
150
|
+
className?: string;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* A line over time, with up to one muted comparison line. Generic parts only:
|
|
154
|
+
* a dashed segment from an index on, an area under the line, a vertical
|
|
155
|
+
* marker with a label slot, and filled or hollow end points. What the line
|
|
156
|
+
* means, and any zone or event drawn on it, is the product's.
|
|
157
|
+
*/
|
|
158
|
+
export declare function BackdropLineChart({ label, data, categoryHeader, seriesName, comparisonName, yTicks, gridlines, max, dashedFrom, area, marker, end, comparisonEnd, caption, action, actionEmphasis, linkComponent, className, }: BackdropLineChartProps): import("react").JSX.Element;
|