@boost33/ui 0.8.0 → 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.
Files changed (150) hide show
  1. package/CHANGELOG.md +214 -123
  2. package/dist/backdrop-icons.d.ts +53 -0
  3. package/dist/backdrop-icons.js +62 -0
  4. package/dist/backdrop-icons.js.map +1 -0
  5. package/dist/backdrop.css +1 -0
  6. package/dist/backdrop.d.ts +46 -0
  7. package/dist/backdrop.js +127 -0
  8. package/dist/backdrop.js.map +1 -0
  9. package/dist/components/AccountMenu/AccountMenu.d.ts +42 -32
  10. package/dist/components/AccountMenu/AccountMenu.js +66 -48
  11. package/dist/components/AccountMenu/AccountMenu.js.map +1 -1
  12. package/dist/components/AccountMenu/AccountMenu.module.css.js +44 -38
  13. package/dist/components/AccountMenu/AccountMenu.module.css.js.map +1 -1
  14. package/dist/components/AccountMenu/StandardAccountMenu.d.ts +87 -0
  15. package/dist/components/AccountMenu/StandardAccountMenu.js +86 -0
  16. package/dist/components/AccountMenu/StandardAccountMenu.js.map +1 -0
  17. package/dist/components/AccountMenu/icons.d.ts +2 -2
  18. package/dist/components/AccountMenu/icons.js +21 -8
  19. package/dist/components/AccountMenu/icons.js.map +1 -1
  20. package/dist/components/AccountMenu/initials.d.ts +11 -0
  21. package/dist/components/AccountMenu/initials.js +8 -0
  22. package/dist/components/AccountMenu/initials.js.map +1 -0
  23. package/dist/components/AccountMenu/labels.d.ts +64 -3
  24. package/dist/components/AccountMenu/labels.js +33 -5
  25. package/dist/components/AccountMenu/labels.js.map +1 -1
  26. package/dist/components/AccountMenu/use-menu.d.ts +34 -0
  27. package/dist/components/AccountMenu/use-menu.js +102 -0
  28. package/dist/components/AccountMenu/use-menu.js.map +1 -0
  29. package/dist/components/Backdrop/BackdropAppMenu.d.ts +55 -0
  30. package/dist/components/Backdrop/BackdropAppMenu.js +79 -0
  31. package/dist/components/Backdrop/BackdropAppMenu.js.map +1 -0
  32. package/dist/components/Backdrop/BackdropAppMenu.module.css.js +48 -0
  33. package/dist/components/Backdrop/BackdropAppMenu.module.css.js.map +1 -0
  34. package/dist/components/Backdrop/BackdropBasics.d.ts +129 -0
  35. package/dist/components/Backdrop/BackdropBasics.js +130 -0
  36. package/dist/components/Backdrop/BackdropBasics.js.map +1 -0
  37. package/dist/components/Backdrop/BackdropBasics.module.css.js +71 -0
  38. package/dist/components/Backdrop/BackdropBasics.module.css.js.map +1 -0
  39. package/dist/components/Backdrop/BackdropButton.d.ts +63 -0
  40. package/dist/components/Backdrop/BackdropButton.js +59 -0
  41. package/dist/components/Backdrop/BackdropButton.js.map +1 -0
  42. package/dist/components/Backdrop/BackdropButton.module.css.js +41 -0
  43. package/dist/components/Backdrop/BackdropButton.module.css.js.map +1 -0
  44. package/dist/components/Backdrop/BackdropCharts.d.ts +158 -0
  45. package/dist/components/Backdrop/BackdropCharts.js +222 -0
  46. package/dist/components/Backdrop/BackdropCharts.js.map +1 -0
  47. package/dist/components/Backdrop/BackdropCharts.module.css.js +109 -0
  48. package/dist/components/Backdrop/BackdropCharts.module.css.js.map +1 -0
  49. package/dist/components/Backdrop/BackdropChrome.d.ts +26 -0
  50. package/dist/components/Backdrop/BackdropChrome.js +35 -0
  51. package/dist/components/Backdrop/BackdropChrome.js.map +1 -0
  52. package/dist/components/Backdrop/BackdropConversation.d.ts +67 -0
  53. package/dist/components/Backdrop/BackdropConversation.js +76 -0
  54. package/dist/components/Backdrop/BackdropConversation.js.map +1 -0
  55. package/dist/components/Backdrop/BackdropConversation.module.css.js +44 -0
  56. package/dist/components/Backdrop/BackdropConversation.module.css.js.map +1 -0
  57. package/dist/components/Backdrop/BackdropData.d.ts +195 -0
  58. package/dist/components/Backdrop/BackdropData.js +204 -0
  59. package/dist/components/Backdrop/BackdropData.js.map +1 -0
  60. package/dist/components/Backdrop/BackdropData.module.css.js +135 -0
  61. package/dist/components/Backdrop/BackdropData.module.css.js.map +1 -0
  62. package/dist/components/Backdrop/BackdropDisplay.d.ts +122 -0
  63. package/dist/components/Backdrop/BackdropDisplay.js +80 -0
  64. package/dist/components/Backdrop/BackdropDisplay.js.map +1 -0
  65. package/dist/components/Backdrop/BackdropDisplay.module.css.js +80 -0
  66. package/dist/components/Backdrop/BackdropDisplay.module.css.js.map +1 -0
  67. package/dist/components/Backdrop/BackdropFields.d.ts +122 -0
  68. package/dist/components/Backdrop/BackdropFields.js +196 -0
  69. package/dist/components/Backdrop/BackdropFields.js.map +1 -0
  70. package/dist/components/Backdrop/BackdropFields.module.css.js +104 -0
  71. package/dist/components/Backdrop/BackdropFields.module.css.js.map +1 -0
  72. package/dist/components/Backdrop/BackdropFlows.d.ts +128 -0
  73. package/dist/components/Backdrop/BackdropFlows.js +156 -0
  74. package/dist/components/Backdrop/BackdropFlows.js.map +1 -0
  75. package/dist/components/Backdrop/BackdropFlows.module.css.js +80 -0
  76. package/dist/components/Backdrop/BackdropFlows.module.css.js.map +1 -0
  77. package/dist/components/Backdrop/BackdropFrame.d.ts +36 -0
  78. package/dist/components/Backdrop/BackdropFrame.js +15 -0
  79. package/dist/components/Backdrop/BackdropFrame.js.map +1 -0
  80. package/dist/components/Backdrop/BackdropFrame.module.css.js +14 -0
  81. package/dist/components/Backdrop/BackdropFrame.module.css.js.map +1 -0
  82. package/dist/components/Backdrop/BackdropGlobalPanels.d.ts +272 -0
  83. package/dist/components/Backdrop/BackdropGlobalPanels.js +264 -0
  84. package/dist/components/Backdrop/BackdropGlobalPanels.js.map +1 -0
  85. package/dist/components/Backdrop/BackdropGlobalPanels.module.css.js +201 -0
  86. package/dist/components/Backdrop/BackdropGlobalPanels.module.css.js.map +1 -0
  87. package/dist/components/Backdrop/BackdropHub.d.ts +80 -0
  88. package/dist/components/Backdrop/BackdropHub.js +92 -0
  89. package/dist/components/Backdrop/BackdropHub.js.map +1 -0
  90. package/dist/components/Backdrop/BackdropHub.module.css.js +40 -0
  91. package/dist/components/Backdrop/BackdropHub.module.css.js.map +1 -0
  92. package/dist/components/Backdrop/BackdropLists.d.ts +165 -0
  93. package/dist/components/Backdrop/BackdropLists.js +162 -0
  94. package/dist/components/Backdrop/BackdropLists.js.map +1 -0
  95. package/dist/components/Backdrop/BackdropLists.module.css.js +114 -0
  96. package/dist/components/Backdrop/BackdropLists.module.css.js.map +1 -0
  97. package/dist/components/Backdrop/BackdropOverlays.d.ts +175 -0
  98. package/dist/components/Backdrop/BackdropOverlays.js +252 -0
  99. package/dist/components/Backdrop/BackdropOverlays.js.map +1 -0
  100. package/dist/components/Backdrop/BackdropOverlays.module.css.js +104 -0
  101. package/dist/components/Backdrop/BackdropOverlays.module.css.js.map +1 -0
  102. package/dist/components/Backdrop/BackdropPage.d.ts +73 -0
  103. package/dist/components/Backdrop/BackdropPage.js +65 -0
  104. package/dist/components/Backdrop/BackdropPage.js.map +1 -0
  105. package/dist/components/Backdrop/BackdropPage.module.css.js +46 -0
  106. package/dist/components/Backdrop/BackdropPage.module.css.js.map +1 -0
  107. package/dist/components/Backdrop/BackdropPatterns.d.ts +224 -0
  108. package/dist/components/Backdrop/BackdropPatterns.js +202 -0
  109. package/dist/components/Backdrop/BackdropPatterns.js.map +1 -0
  110. package/dist/components/Backdrop/BackdropPatterns.module.css.js +114 -0
  111. package/dist/components/Backdrop/BackdropPatterns.module.css.js.map +1 -0
  112. package/dist/components/Backdrop/BackdropRail.d.ts +63 -0
  113. package/dist/components/Backdrop/BackdropRail.js +98 -0
  114. package/dist/components/Backdrop/BackdropRail.js.map +1 -0
  115. package/dist/components/Backdrop/BackdropRail.module.css.js +42 -0
  116. package/dist/components/Backdrop/BackdropRail.module.css.js.map +1 -0
  117. package/dist/components/Backdrop/BackdropSheets.d.ts +68 -0
  118. package/dist/components/Backdrop/BackdropSheets.js +75 -0
  119. package/dist/components/Backdrop/BackdropSheets.js.map +1 -0
  120. package/dist/components/Backdrop/BackdropSheets.module.css.js +42 -0
  121. package/dist/components/Backdrop/BackdropSheets.module.css.js.map +1 -0
  122. package/dist/components/Backdrop/BackdropTabs.d.ts +20 -0
  123. package/dist/components/Backdrop/BackdropTabs.js +31 -0
  124. package/dist/components/Backdrop/BackdropTabs.js.map +1 -0
  125. package/dist/components/Backdrop/BackdropTabs.module.css.js +16 -0
  126. package/dist/components/Backdrop/BackdropTabs.module.css.js.map +1 -0
  127. package/dist/components/Backdrop/BackdropTooltip.d.ts +21 -0
  128. package/dist/components/Backdrop/BackdropTooltip.js +15 -0
  129. package/dist/components/Backdrop/BackdropTooltip.js.map +1 -0
  130. package/dist/components/Backdrop/BackdropTooltip.module.css.js +18 -0
  131. package/dist/components/Backdrop/BackdropTooltip.module.css.js.map +1 -0
  132. package/dist/components/Backdrop/BackdropTopStrip.d.ts +65 -0
  133. package/dist/components/Backdrop/BackdropTopStrip.js +46 -0
  134. package/dist/components/Backdrop/BackdropTopStrip.js.map +1 -0
  135. package/dist/components/Backdrop/BackdropTopStrip.module.css.js +40 -0
  136. package/dist/components/Backdrop/BackdropTopStrip.module.css.js.map +1 -0
  137. package/dist/components/Backdrop/cx.d.ts +2 -0
  138. package/dist/components/Backdrop/cx.js +7 -0
  139. package/dist/components/Backdrop/cx.js.map +1 -0
  140. package/dist/components/Backdrop/icons.d.ts +70 -0
  141. package/dist/components/Backdrop/icons.js +103 -0
  142. package/dist/components/Backdrop/icons.js.map +1 -0
  143. package/dist/components/TopBar/TopBar.d.ts +8 -1
  144. package/dist/components/TopBar/TopBar.js +19 -16
  145. package/dist/components/TopBar/TopBar.js.map +1 -1
  146. package/dist/index.d.ts +4 -2
  147. package/dist/index.js +40 -36
  148. package/dist/index.js.map +1 -1
  149. package/dist/style.css +1 -1
  150. package/package.json +23 -4
@@ -0,0 +1,48 @@
1
+ const e = "_menu_1m4z2_3", o = "_list_1m4z2_11", t = "_fill_1m4z2_19", _ = "_open_1m4z2_25", d = "_header_1m4z2_35", m = "_mark_1m4z2_43", l = "_appName_1m4z2_54", n = "_action_1m4z2_66", c = "_groupLabel_1m4z2_93", i = "_item_1m4z2_102", s = "_itemIcon_1m4z2_124", a = "_itemLabel_1m4z2_129", f = "_foldedItem_1m4z2_137", z = "_foldedAction_1m4z2_168", r = "_getStarted_1m4z2_173", p = "_folded_1m4z2_137", L = "_foldedMark_1m4z2_190", u = "_foldedList_1m4z2_220", b = "_foldedSection_1m4z2_229", g = "_foldedDivider_1m4z2_254", k = "_foldedDot_1m4z2_263", D = {
2
+ menu: e,
3
+ list: o,
4
+ fill: t,
5
+ open: _,
6
+ header: d,
7
+ mark: m,
8
+ appName: l,
9
+ action: n,
10
+ groupLabel: c,
11
+ item: i,
12
+ itemIcon: s,
13
+ itemLabel: a,
14
+ foldedItem: f,
15
+ foldedAction: z,
16
+ getStarted: r,
17
+ folded: p,
18
+ foldedMark: L,
19
+ foldedList: u,
20
+ foldedSection: b,
21
+ foldedDivider: g,
22
+ foldedDot: k
23
+ };
24
+ export {
25
+ n as action,
26
+ l as appName,
27
+ D as default,
28
+ t as fill,
29
+ p as folded,
30
+ z as foldedAction,
31
+ g as foldedDivider,
32
+ k as foldedDot,
33
+ f as foldedItem,
34
+ u as foldedList,
35
+ L as foldedMark,
36
+ b as foldedSection,
37
+ r as getStarted,
38
+ c as groupLabel,
39
+ d as header,
40
+ i as item,
41
+ s as itemIcon,
42
+ a as itemLabel,
43
+ o as list,
44
+ m as mark,
45
+ e as menu,
46
+ _ as open
47
+ };
48
+ //# sourceMappingURL=BackdropAppMenu.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackdropAppMenu.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,129 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ export interface BackdropBadgeProps {
3
+ /** A count, or a one-word tag such as "New". */
4
+ children: ReactNode;
5
+ /**
6
+ * `ink` (default): white on ink, the app menu's counts and Help's "New".
7
+ * `muted`: grey on the panel, a count that should not pull the eye.
8
+ */
9
+ tone?: 'ink' | 'muted';
10
+ /** Screen-reader text when the visible badge is a bare number. */
11
+ label?: string;
12
+ className?: string;
13
+ }
14
+ export declare function BackdropBadge({ children, tone, label, className }: BackdropBadgeProps): import("react").JSX.Element;
15
+ /**
16
+ * What a chip is for. Every kind is 34px, fully round, 14px medium.
17
+ *
18
+ * - `filter` (default): a toggle in a filter row, ink-filled when on.
19
+ * - `choice`: one answer among several (a setup question). Ink-filled with a
20
+ * leading check when chosen, so the state never rests on colour alone.
21
+ * - `tag`: a value already picked, on the panel grey. With `removeLabel` it
22
+ * carries a × button; the chip itself is not a control.
23
+ * - `add`: the action at the end of a tag row, a leading plus on the hairline.
24
+ * - `action` (Batch 4): a one-press action drawn as a resting chip, with the
25
+ * caller's leading icon if any: a composer's quick insert ("Video link") or
26
+ * a suggested question ("What are tokens?"). A plain button, never pressed.
27
+ */
28
+ export type BackdropChipKind = 'filter' | 'choice' | 'tag' | 'add' | 'action';
29
+ export interface BackdropChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
30
+ children: ReactNode;
31
+ /** The filter this chip stands for is on, or this choice is chosen. Drawn ink-filled. */
32
+ selected?: boolean;
33
+ /** A count after the label ("Running 5"). */
34
+ count?: ReactNode;
35
+ /** Leading icon, 16px (a channel glyph, say). A chosen `choice` shows its check here instead. */
36
+ icon?: ReactNode;
37
+ kind?: BackdropChipKind;
38
+ /**
39
+ * `choice` only. `multiple` (default): each chip is a toggle, `aria-pressed`.
40
+ * `single`: the chips are a radio group, `role="radio"` with `aria-checked`;
41
+ * the caller wraps them in an element with `role="radiogroup"` and a name.
42
+ */
43
+ selectionMode?: 'single' | 'multiple';
44
+ /**
45
+ * `tag` only. The × button's accessible name, translated by the caller:
46
+ * "Remove LinkedIn". Without it the tag renders with no × at all.
47
+ * Stage A: the button is markup only; removing is Stage B's handler.
48
+ */
49
+ removeLabel?: string;
50
+ }
51
+ /** A filter chip: a toggle (aria-pressed), so a row of them is a filter group. */
52
+ export declare function BackdropChip({ children, selected, count, icon, kind, selectionMode, removeLabel, className, type, ...rest }: BackdropChipProps): import("react").JSX.Element;
53
+ export type BackdropPillTone = 'success' | 'neutral' | 'warning' | 'danger' | 'info' | 'ink';
54
+ /** `soft` (default): a tinted ground. `outline`: no ground, a 1px edge in the tone. */
55
+ export type BackdropPillAppearance = 'soft' | 'outline';
56
+ export interface BackdropPillProps {
57
+ /** The status word: "Running", "Paused", "Needs approval". */
58
+ children: ReactNode;
59
+ tone?: BackdropPillTone;
60
+ /** The leading status dot. Off for a plain tag such as a title's "Draft". */
61
+ dot?: boolean;
62
+ /**
63
+ * A leading 16px icon in place of the dot, drawn in the tone's dot colour.
64
+ * Decorative: the word carries the meaning.
65
+ */
66
+ icon?: ReactNode;
67
+ appearance?: BackdropPillAppearance;
68
+ className?: string;
69
+ }
70
+ /** A status pill. Not interactive; the word carries the meaning, the colour repeats it. */
71
+ export declare function BackdropPill({ children, tone, dot, icon, appearance, className }: BackdropPillProps): import("react").JSX.Element;
72
+ export interface BackdropSoonTagProps {
73
+ /** The word, translated: "Soon". */
74
+ children: ReactNode;
75
+ className?: string;
76
+ }
77
+ /** The small tag beside an app that is not built yet, in menus and the All apps popover. */
78
+ export declare function BackdropSoonTag({ children, className }: BackdropSoonTagProps): import("react").JSX.Element;
79
+ export type BackdropAvatarTone = 'ink' | 'sand' | 'slate' | 'sage' | 'stone';
80
+ export type BackdropAvatarSize = 24 | 32 | 36 | 40 | 44 | 48 | 56 | 64;
81
+ export interface BackdropAvatarProps {
82
+ /** A person's name or email; the two letters are derived the Hub's way. */
83
+ name: string;
84
+ /** Override the derived letters. */
85
+ initials?: string;
86
+ /** 24–40 in lists and menus; 44–64 for a profile head or a focus flow. */
87
+ size?: BackdropAvatarSize;
88
+ tone?: BackdropAvatarTone;
89
+ /** Square with rounded corners, for a company rather than a person. */
90
+ square?: boolean;
91
+ /** Hidden from assistive tech when the name is already printed beside it. */
92
+ decorative?: boolean;
93
+ /**
94
+ * A small badge on the bottom-right corner (a channel glyph). Pass a 16px
95
+ * icon; it sits on a white disc ringed off from the avatar. Decorative: name
96
+ * the channel in text beside the avatar if it matters.
97
+ */
98
+ badge?: ReactNode;
99
+ className?: string;
100
+ }
101
+ export declare function BackdropAvatar({ name, initials, size, tone, square, decorative, badge, className }: BackdropAvatarProps): import("react").JSX.Element;
102
+ export interface BackdropAvatarStackPerson {
103
+ name: string;
104
+ initials?: string;
105
+ tone?: BackdropAvatarTone;
106
+ }
107
+ export interface BackdropAvatarStackProps {
108
+ people: BackdropAvatarStackPerson[];
109
+ /** How many avatars show before the rest fold into "+N". Default 3. */
110
+ max?: number;
111
+ size?: BackdropAvatarSize;
112
+ /** The group's accessible name, translated by the caller: "People on this team". */
113
+ label: string;
114
+ /**
115
+ * Screen-reader text for the "+N" bubble, translated by the caller:
116
+ * "and 4 more". Without it the bubble announces as "+4".
117
+ */
118
+ overflowLabel?: string;
119
+ className?: string;
120
+ }
121
+ /**
122
+ * Overlapping avatars, each ringed in white so the edges stay legible, with
123
+ * the rest folded into a "+N" bubble. Each person is named to assistive tech;
124
+ * the stack is a labelled group.
125
+ */
126
+ export declare function BackdropAvatarStack({ people, max, size, label, overflowLabel, className }: BackdropAvatarStackProps): import("react").JSX.Element;
127
+ export declare function BackdropVisuallyHidden({ children }: {
128
+ children: ReactNode;
129
+ }): import("react").JSX.Element;
@@ -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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A,EAAK,WAAWD,EAAO,QAAS,UAAAiC,EAAA,CAAc;AAAA,IAAA,EAAA,CACnE;AAAA,EAAA,GAEJ;AAEJ;AAIO,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,GACH,IAKF,gBAAAG,EAAC,UAAA,EAAO,MAAAR,GAAY,WAAWE,GAAS,aAAWP,KAAW,QAAY,GAAGM,GAC1E,UAAAI,E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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":";;;;;;;;;;;;;;;;;;;;"}