@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.
- package/CHANGELOG.md +214 -123
- 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/AccountMenu/AccountMenu.d.ts +42 -32
- package/dist/components/AccountMenu/AccountMenu.js +66 -48
- package/dist/components/AccountMenu/AccountMenu.js.map +1 -1
- package/dist/components/AccountMenu/AccountMenu.module.css.js +44 -38
- package/dist/components/AccountMenu/AccountMenu.module.css.js.map +1 -1
- package/dist/components/AccountMenu/StandardAccountMenu.d.ts +87 -0
- package/dist/components/AccountMenu/StandardAccountMenu.js +86 -0
- package/dist/components/AccountMenu/StandardAccountMenu.js.map +1 -0
- package/dist/components/AccountMenu/icons.d.ts +2 -2
- package/dist/components/AccountMenu/icons.js +21 -8
- package/dist/components/AccountMenu/icons.js.map +1 -1
- package/dist/components/AccountMenu/initials.d.ts +11 -0
- package/dist/components/AccountMenu/initials.js +8 -0
- package/dist/components/AccountMenu/initials.js.map +1 -0
- package/dist/components/AccountMenu/labels.d.ts +64 -3
- package/dist/components/AccountMenu/labels.js +33 -5
- package/dist/components/AccountMenu/labels.js.map +1 -1
- package/dist/components/AccountMenu/use-menu.d.ts +34 -0
- package/dist/components/AccountMenu/use-menu.js +102 -0
- package/dist/components/AccountMenu/use-menu.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/dist/components/TopBar/TopBar.d.ts +8 -1
- package/dist/components/TopBar/TopBar.js +19 -16
- package/dist/components/TopBar/TopBar.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +40 -36
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +23 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackdropChrome.js","sources":["../../../src/components/Backdrop/BackdropChrome.tsx"],"sourcesContent":["'use client'\n\nimport { createContext, useCallback, useContext, useMemo, useState, type Dispatch, type ReactNode, type SetStateAction } from 'react'\n\n/*\n * Which one chrome panel is open (Batch 7, ADR-0009 addendum, 12 Nov 2026).\n *\n * The strip's popovers, the rail's All apps panel and the search dialog are\n * separate client islands in a host that streams its page, so none can hold\n * another's state. Each overlay's own dismissal (Escape, an outside press,\n * focus leaving) is enough while a person only opens panels by pressing them,\n * and not otherwise: ⌘K is a keystroke, so an open popover hears no outside\n * press and stays up behind the search dialog; and a control in the page (the\n * Hub's \"All apps\" card) can open a panel the chrome draws.\n *\n * So one key for the whole chrome, held here. Wrapping server-rendered\n * children costs them nothing: they stay Server Components. An overlay joins\n * by naming its key (`panel`); one that names none keeps its own state exactly\n * as before, which is why no approved story moves.\n */\n\ninterface ChromeState {\n openKey: string | null\n setOpenKey: Dispatch<SetStateAction<string | null>>\n}\n\nconst ChromeContext = createContext<ChromeState | null>(null)\n\n/** The chrome's one open panel. Put it around the frame; its children may be Server Components. */\nexport function BackdropChrome({ children }: { children: ReactNode }) {\n const [openKey, setOpenKey] = useState<string | null>(null)\n const value = useMemo(() => ({ openKey, setOpenKey }), [openKey])\n return <ChromeContext.Provider value={value}>{children}</ChromeContext.Provider>\n}\n\nexport interface BackdropPanelControl {\n /** True while this key is the chrome's open panel. */\n open: boolean\n /** Opening closes whatever else was open, in the same update. Closing closes only this key. */\n setOpen: (open: boolean) => void\n}\n\n/*\n * Both rules are applied to the current key, not the one this render saw: a\n * close from a panel that is already shut must not shut the panel that\n * replaced it, and an open must not wait for an effect, or two panels paint\n * together for a frame.\n */\nfunction usePanelSetter(setOpenKey: Dispatch<SetStateAction<string | null>> | undefined, key: string | undefined) {\n return useCallback(\n (next: boolean) => {\n if (!setOpenKey || key === undefined) return\n setOpenKey((current) => (next ? key : current === key ? null : current))\n },\n [setOpenKey, key],\n )\n}\n\n/**\n * A control that opens a chrome panel it does not draw: the Hub's \"All apps\"\n * card, a ⌘K shortcut. Throws outside a BackdropChrome, because an opener that\n * silently does nothing survives every screenshot review.\n */\nexport function useBackdropPanel(key: string): BackdropPanelControl {\n const chrome = useContext(ChromeContext)\n const setOpen = usePanelSetter(chrome?.setOpenKey, key)\n if (!chrome) throw new Error(`useBackdropPanel('${key}') is outside a BackdropChrome`)\n return { open: chrome.openKey === key, setOpen }\n}\n\n/** For the overlays themselves: null outside a BackdropChrome, or with no key, so they keep their own state. */\nexport function useChromePanel(key: string | undefined): BackdropPanelControl | null {\n const chrome = useContext(ChromeContext)\n const setOpen = usePanelSetter(chrome?.setOpenKey, key)\n if (!chrome || key === undefined) return null\n return { open: chrome.openKey === key, setOpen }\n}\n\n/** For a modal dialog, which claims the chrome while it is mounted (see BackdropDialog). */\nexport function useChromeState(): ChromeState | null {\n return useContext(ChromeContext)\n}\n"],"names":["ChromeContext","createContext","BackdropChrome","children","openKey","setOpenKey","useState","value","useMemo","jsx","usePanelSetter","key","useCallback","next","current","useBackdropPanel","chrome","useContext","setOpen","useChromePanel","useChromeState"],"mappings":";;;AA0BA,MAAMA,IAAgBC,EAAkC,IAAI;AAGrD,SAASC,EAAe,EAAE,UAAAC,KAAqC;AACpE,QAAM,CAACC,GAASC,CAAU,IAAIC,EAAwB,IAAI,GACpDC,IAAQC,EAAQ,OAAO,EAAE,SAAAJ,GAAS,YAAAC,MAAe,CAACD,CAAO,CAAC;AAChE,SAAO,gBAAAK,EAACT,EAAc,UAAd,EAAuB,OAAAO,GAAe,UAAAJ,EAAA,CAAS;AACzD;AAeA,SAASO,EAAeL,GAAiEM,GAAyB;AAChH,SAAOC;AAAA,IACL,CAACC,MAAkB;AACjB,MAAI,CAACR,KAAcM,MAAQ,UAC3BN,EAAW,CAACS,MAAaD,IAAOF,IAAMG,MAAYH,IAAM,OAAOG,CAAQ;AAAA,IACzE;AAAA,IACA,CAACT,GAAYM,CAAG;AAAA,EAAA;AAEpB;AAOO,SAASI,EAAiBJ,GAAmC;AAClE,QAAMK,IAASC,EAAWjB,CAAa,GACjCkB,IAAUR,EAAeM,KAAA,gBAAAA,EAAQ,YAAYL,CAAG;AACtD,MAAI,CAACK,EAAQ,OAAM,IAAI,MAAM,qBAAqBL,CAAG,gCAAgC;AACrF,SAAO,EAAE,MAAMK,EAAO,YAAYL,GAAK,SAAAO,EAAA;AACzC;AAGO,SAASC,EAAeR,GAAsD;AACnF,QAAMK,IAASC,EAAWjB,CAAa,GACjCkB,IAAUR,EAAeM,KAAA,gBAAAA,EAAQ,YAAYL,CAAG;AACtD,SAAI,CAACK,KAAUL,MAAQ,SAAkB,OAClC,EAAE,MAAMK,EAAO,YAAYL,GAAK,SAAAO,EAAA;AACzC;AAGO,SAASE,IAAqC;AACnD,SAAOH,EAAWjB,CAAa;AACjC;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { HTMLAttributes, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export interface BackdropThreadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role'> {
|
|
3
|
+
/** The log's accessible name, translated by the caller: "Conversation with Julien Morel". */
|
|
4
|
+
label: string;
|
|
5
|
+
/** BackdropMessage and BackdropDaySeparator elements, oldest first. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function BackdropThread({ label, children, className, tabIndex, ...rest }: BackdropThreadProps): import("react").JSX.Element;
|
|
9
|
+
/** `incoming`: from the other side, hairline ring, left. `outgoing`: from this person, panel grey, right. */
|
|
10
|
+
export type BackdropMessageDirection = 'incoming' | 'outgoing';
|
|
11
|
+
export interface BackdropMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
12
|
+
direction?: BackdropMessageDirection;
|
|
13
|
+
/** The message: text, or text and a nested block (a next-step card). */
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/** Under the bubble, muted: "Julien · 16:20", "You · 9:40". Names the sender for everyone. */
|
|
16
|
+
caption?: ReactNode;
|
|
17
|
+
/** A mark beside the bubble on the sender's side (an assistant's logo, a person's avatar). Decorative. */
|
|
18
|
+
leading?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/** One message. Bubble 340 wide at most, 14/21 text, the 4px tail corner on the sender's side. */
|
|
21
|
+
export declare function BackdropMessage({ direction, children, caption, leading, className, ...rest }: BackdropMessageProps): import("react").JSX.Element;
|
|
22
|
+
export interface BackdropDaySeparatorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
23
|
+
/** "Monday", "Today", "Monday · Invitation accepted". */
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** A day's label, centred between messages: 13/18 500 muted. Read as plain text in the log. */
|
|
27
|
+
export declare function BackdropDaySeparator({ children, className, ...rest }: BackdropDaySeparatorProps): import("react").JSX.Element;
|
|
28
|
+
/** `reply` (default): the thread's reply box. `ask`: the one-line question bar. */
|
|
29
|
+
export type BackdropComposerLook = 'reply' | 'ask';
|
|
30
|
+
interface BackdropComposerBase {
|
|
31
|
+
/** The field's accessible name, translated by the caller: "Reply to Julien Morel", "Ask a question". */
|
|
32
|
+
label: string;
|
|
33
|
+
/** The send button's words (`reply`) or accessible name (`ask`): "Send". */
|
|
34
|
+
sendLabel: string;
|
|
35
|
+
/** The send icon (`send` in src/backdrop-icons.ts), 18px in `reply`, 16px in `ask`. */
|
|
36
|
+
sendIcon: ReactNode;
|
|
37
|
+
/**
|
|
38
|
+
* One-press chips: `reply` shows them under the field (quick inserts),
|
|
39
|
+
* `ask` above it (suggested questions). BackdropChip `kind="action"`.
|
|
40
|
+
*/
|
|
41
|
+
suggestions?: ReactNode;
|
|
42
|
+
/** The chips' group name, translated by the caller: "Quick inserts", "Suggested questions". */
|
|
43
|
+
suggestionsLabel?: string;
|
|
44
|
+
/** On the composer's outer box. Every other prop reaches the native field. */
|
|
45
|
+
className?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface BackdropComposerReplyProps extends BackdropComposerBase, Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className'> {
|
|
48
|
+
look?: 'reply';
|
|
49
|
+
/** A line above the field, 13/18 500: "Draft ready". It describes the field. */
|
|
50
|
+
heading?: ReactNode;
|
|
51
|
+
/** A 16px icon before the heading. Decorative. */
|
|
52
|
+
headingIcon?: ReactNode;
|
|
53
|
+
/** The footer's start: a ghost BackdropButton ("Rewrite · 21 tokens"). */
|
|
54
|
+
secondaryAction?: ReactNode;
|
|
55
|
+
/** Muted, before Send: a cost or a channel note ("Uses 9 tokens"). It describes the send button. */
|
|
56
|
+
note?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export interface BackdropComposerAskProps extends BackdropComposerBase, Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type' | 'size'> {
|
|
59
|
+
look: 'ask';
|
|
60
|
+
heading?: never;
|
|
61
|
+
headingIcon?: never;
|
|
62
|
+
secondaryAction?: never;
|
|
63
|
+
note?: never;
|
|
64
|
+
}
|
|
65
|
+
export type BackdropComposerProps = BackdropComposerReplyProps | BackdropComposerAskProps;
|
|
66
|
+
export declare function BackdropComposer(props: BackdropComposerProps): import("react").JSX.Element;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useId as A } from "react";
|
|
3
|
+
import e from "./BackdropConversation.module.css.js";
|
|
4
|
+
import { cx as c } from "./cx.js";
|
|
5
|
+
import { BackdropIconButton as C, BackdropButton as D } from "./BackdropButton.js";
|
|
6
|
+
import { BackdropTextarea as H } from "./BackdropFields.js";
|
|
7
|
+
function K({ label: n, children: s, className: o, tabIndex: l = 0, ...r }) {
|
|
8
|
+
return /* @__PURE__ */ a("div", { role: "log", "aria-label": n, tabIndex: l, className: c(e.thread, o), ...r, children: /* @__PURE__ */ a("div", { className: e.threadInner, children: s }) });
|
|
9
|
+
}
|
|
10
|
+
function O({ direction: n = "incoming", children: s, caption: o, leading: l, className: r, ...d }) {
|
|
11
|
+
return /* @__PURE__ */ i("div", { className: c(e.message, n === "outgoing" ? e.outgoing : e.incoming, r), ...d, children: [
|
|
12
|
+
l != null && /* @__PURE__ */ a("span", { className: e.messageLeading, "aria-hidden": "true", children: l }),
|
|
13
|
+
/* @__PURE__ */ i("div", { className: e.messageBody, children: [
|
|
14
|
+
/* @__PURE__ */ a("div", { className: e.bubble, children: s }),
|
|
15
|
+
o != null && /* @__PURE__ */ a("p", { className: e.caption, children: o })
|
|
16
|
+
] })
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
function P({ children: n, className: s, ...o }) {
|
|
20
|
+
return /* @__PURE__ */ a("div", { className: c(e.day, s), ...o, children: /* @__PURE__ */ a("span", { children: n }) });
|
|
21
|
+
}
|
|
22
|
+
function M(...n) {
|
|
23
|
+
const s = n.filter(Boolean).join(" ");
|
|
24
|
+
return s === "" ? void 0 : s;
|
|
25
|
+
}
|
|
26
|
+
function f({ children: n, label: s }) {
|
|
27
|
+
return /* @__PURE__ */ a("div", { role: s !== void 0 ? "group" : void 0, "aria-label": s, className: e.suggestions, children: n });
|
|
28
|
+
}
|
|
29
|
+
function Q(n) {
|
|
30
|
+
const s = A();
|
|
31
|
+
if (n.look === "ask") {
|
|
32
|
+
const { look: x, label: L, sendLabel: j, sendIcon: S, suggestions: v, suggestionsLabel: T, className: $, ...z } = n;
|
|
33
|
+
return /* @__PURE__ */ i("div", { "data-look": x, className: c(e.composer, $), children: [
|
|
34
|
+
v != null && /* @__PURE__ */ a(f, { label: T, children: v }),
|
|
35
|
+
/* @__PURE__ */ i("div", { className: e.askBox, children: [
|
|
36
|
+
/* @__PURE__ */ a("input", { type: "text", "aria-label": L, ...z, className: e.askInput }),
|
|
37
|
+
/* @__PURE__ */ a(C, { type: "submit", variant: "ink", size: "sm", label: j, icon: S })
|
|
38
|
+
] })
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
const {
|
|
42
|
+
look: o = "reply",
|
|
43
|
+
label: l,
|
|
44
|
+
sendLabel: r,
|
|
45
|
+
sendIcon: d,
|
|
46
|
+
suggestions: t,
|
|
47
|
+
suggestionsLabel: y,
|
|
48
|
+
heading: m,
|
|
49
|
+
headingIcon: u,
|
|
50
|
+
secondaryAction: B,
|
|
51
|
+
note: g,
|
|
52
|
+
className: I,
|
|
53
|
+
...p
|
|
54
|
+
} = n, h = `${s}-heading`, b = `${s}-note`, N = m != null, k = g != null;
|
|
55
|
+
return /* @__PURE__ */ i("div", { "data-look": o, className: c(e.composer, I), children: [
|
|
56
|
+
N && /* @__PURE__ */ i("p", { id: h, className: e.heading, children: [
|
|
57
|
+
u != null && /* @__PURE__ */ a("span", { className: e.headingIcon, "aria-hidden": "true", children: u }),
|
|
58
|
+
/* @__PURE__ */ a("span", { children: m })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ a(H, { "aria-label": l, ...p, "aria-describedby": M(N && h, p["aria-describedby"]) }),
|
|
61
|
+
t != null && /* @__PURE__ */ a(f, { label: y, children: t }),
|
|
62
|
+
/* @__PURE__ */ i("div", { className: e.footer, children: [
|
|
63
|
+
B,
|
|
64
|
+
/* @__PURE__ */ a("span", { className: e.spacer }),
|
|
65
|
+
k && /* @__PURE__ */ a("span", { id: b, className: e.note, children: g }),
|
|
66
|
+
/* @__PURE__ */ a(D, { type: "submit", variant: "primary", icon: d, "aria-describedby": k ? b : void 0, children: r })
|
|
67
|
+
] })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
Q as BackdropComposer,
|
|
72
|
+
P as BackdropDaySeparator,
|
|
73
|
+
O as BackdropMessage,
|
|
74
|
+
K as BackdropThread
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=BackdropConversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackdropConversation.js","sources":["../../../src/components/Backdrop/BackdropConversation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport type { HTMLAttributes, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react'\nimport styles from './BackdropConversation.module.css'\nimport { cx } from './cx'\nimport { BackdropButton, BackdropIconButton } from './BackdropButton'\nimport { BackdropTextarea } from './BackdropFields'\n\n/*\n * Batch 4 · Conversation (N27–N28). Stage A: static and presentational. No\n * component here holds state, sends, scrolls or inserts anything; a real\n * <form> is Stage B's, so the send button is already `type=\"submit\"` and the\n * field already the native element with the rest of its attributes spread on\n * it (value, onChange, placeholder, name), the way BackdropInput takes them.\n *\n * Thread a bottom-anchored log of messages and day separators.\n * Message one bubble: incoming (hairline ring) or outgoing (panel\n * grey), a 4px corner on the sender's side, a caption under\n * it (\"Julien · 16:20\"), any content inside (a nested card).\n * DaySeparator \"Monday\", \"Today\", centred.\n * Composer the box a person writes a message in. `reply` (default) is\n * the thread's reply box: a heading, the textarea, quick\n * inserts, a footer with a secondary action, a note and Send.\n * `ask` is the one-line question bar with an ink send button.\n *\n * The large writing box on a create page is not a composer: it is\n * BackdropTextarea `size=\"lg\"` with a `footer`, one textarea drawn once.\n * A conversation's row in a list is BackdropListRow (leading avatar with a\n * channel badge, `meta` time, `unreadLabel`); this module draws no row.\n *\n * Measurements are in backdrop-tokens.css under \"Batch 4 · Conversation\".\n * No product nouns: who is speaking, the channel and any cost are content the\n * product passes in.\n */\n\n/* ── N28 · Thread ──────────────────────────────────────────────────────── */\n\nexport interface BackdropThreadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role'> {\n /** The log's accessible name, translated by the caller: \"Conversation with Julien Morel\". */\n label: string\n /** BackdropMessage and BackdropDaySeparator elements, oldest first. */\n children: ReactNode\n}\n\n/*\n * role=\"log\", not a list. A log is the ARIA role for a region where new\n * entries arrive at the end and older ones matter less: it is a polite live\n * region, so when Stage B appends a message a screen reader announces it\n * without moving focus, which a <ul> would not do. The messages are read in\n * order with their captions, and the day separators read as plain text\n * between them.\n *\n * Bottom-anchored the way a chat is: the inner column's top margin is auto,\n * so a short thread sits at the bottom and a long one scrolls from the top\n * with nothing cut off (justify-content: flex-end would clip the overflow).\n * The region is focusable so it can be scrolled from the keyboard.\n */\nexport function BackdropThread({ label, children, className, tabIndex = 0, ...rest }: BackdropThreadProps) {\n return (\n <div role=\"log\" aria-label={label} tabIndex={tabIndex} className={cx(styles.thread, className)} {...rest}>\n <div className={styles.threadInner}>{children}</div>\n </div>\n )\n}\n\n/* ── N28 · Message ─────────────────────────────────────────────────────── */\n\n/** `incoming`: from the other side, hairline ring, left. `outgoing`: from this person, panel grey, right. */\nexport type BackdropMessageDirection = 'incoming' | 'outgoing'\n\nexport interface BackdropMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n direction?: BackdropMessageDirection\n /** The message: text, or text and a nested block (a next-step card). */\n children: ReactNode\n /** Under the bubble, muted: \"Julien · 16:20\", \"You · 9:40\". Names the sender for everyone. */\n caption?: ReactNode\n /** A mark beside the bubble on the sender's side (an assistant's logo, a person's avatar). Decorative. */\n leading?: ReactNode\n}\n\n/** One message. Bubble 340 wide at most, 14/21 text, the 4px tail corner on the sender's side. */\nexport function BackdropMessage({ direction = 'incoming', children, caption, leading, className, ...rest }: BackdropMessageProps) {\n return (\n <div className={cx(styles.message, direction === 'outgoing' ? styles.outgoing : styles.incoming, className)} {...rest}>\n {leading != null && (\n <span className={styles.messageLeading} aria-hidden=\"true\">\n {leading}\n </span>\n )}\n <div className={styles.messageBody}>\n <div className={styles.bubble}>{children}</div>\n {caption != null && <p className={styles.caption}>{caption}</p>}\n </div>\n </div>\n )\n}\n\n/* ── N28 · Day separator ───────────────────────────────────────────────── */\n\nexport interface BackdropDaySeparatorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n /** \"Monday\", \"Today\", \"Monday · Invitation accepted\". */\n children: ReactNode\n}\n\n/** A day's label, centred between messages: 13/18 500 muted. Read as plain text in the log. */\nexport function BackdropDaySeparator({ children, className, ...rest }: BackdropDaySeparatorProps) {\n return (\n <div className={cx(styles.day, className)} {...rest}>\n <span>{children}</span>\n </div>\n )\n}\n\n/* ── N27 · Composer ────────────────────────────────────────────────────── */\n\n/** `reply` (default): the thread's reply box. `ask`: the one-line question bar. */\nexport type BackdropComposerLook = 'reply' | 'ask'\n\ninterface BackdropComposerBase {\n /** The field's accessible name, translated by the caller: \"Reply to Julien Morel\", \"Ask a question\". */\n label: string\n /** The send button's words (`reply`) or accessible name (`ask`): \"Send\". */\n sendLabel: string\n /** The send icon (`send` in src/backdrop-icons.ts), 18px in `reply`, 16px in `ask`. */\n sendIcon: ReactNode\n /**\n * One-press chips: `reply` shows them under the field (quick inserts),\n * `ask` above it (suggested questions). BackdropChip `kind=\"action\"`.\n */\n suggestions?: ReactNode\n /** The chips' group name, translated by the caller: \"Quick inserts\", \"Suggested questions\". */\n suggestionsLabel?: string\n /** On the composer's outer box. Every other prop reaches the native field. */\n className?: string\n}\n\nexport interface BackdropComposerReplyProps extends BackdropComposerBase, Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'className'> {\n look?: 'reply'\n /** A line above the field, 13/18 500: \"Draft ready\". It describes the field. */\n heading?: ReactNode\n /** A 16px icon before the heading. Decorative. */\n headingIcon?: ReactNode\n /** The footer's start: a ghost BackdropButton (\"Rewrite · 21 tokens\"). */\n secondaryAction?: ReactNode\n /** Muted, before Send: a cost or a channel note (\"Uses 9 tokens\"). It describes the send button. */\n note?: ReactNode\n}\n\nexport interface BackdropComposerAskProps extends BackdropComposerBase, Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type' | 'size'> {\n look: 'ask'\n heading?: never\n headingIcon?: never\n secondaryAction?: never\n note?: never\n}\n\nexport type BackdropComposerProps = BackdropComposerReplyProps | BackdropComposerAskProps\n\n/** Joins the ids that describe an element, dropping the empty ones. */\nfunction joinIds(...ids: Array<string | undefined | false>): string | undefined {\n const joined = ids.filter(Boolean).join(' ')\n return joined === '' ? undefined : joined\n}\n\nfunction Suggestions({ children, label }: { children: ReactNode; label?: string }) {\n return (\n <div role={label !== undefined ? 'group' : undefined} aria-label={label} className={styles.suggestions}>\n {children}\n </div>\n )\n}\n\n/*\n * `reply`: heading, the batch 2 BackdropTextarea (not a second textarea),\n * the quick inserts, then a footer: secondary action, a spacer, the note and\n * the orange Send, the panel's one primary. `ask`: suggestions above a 40px\n * box (D9) holding a native input and the 32px ink send button.\n */\nexport function BackdropComposer(props: BackdropComposerProps) {\n const generated = useId()\n if (props.look === 'ask') {\n const { look, label, sendLabel, sendIcon, suggestions, suggestionsLabel, className, ...rest } = props\n return (\n <div data-look={look} className={cx(styles.composer, className)}>\n {suggestions != null && <Suggestions label={suggestionsLabel}>{suggestions}</Suggestions>}\n <div className={styles.askBox}>\n <input type=\"text\" aria-label={label} {...rest} className={styles.askInput} />\n <BackdropIconButton type=\"submit\" variant=\"ink\" size=\"sm\" label={sendLabel} icon={sendIcon} />\n </div>\n </div>\n )\n }\n const {\n look = 'reply',\n label,\n sendLabel,\n sendIcon,\n suggestions,\n suggestionsLabel,\n heading,\n headingIcon,\n secondaryAction,\n note,\n className,\n ...rest\n } = props\n const headingId = `${generated}-heading`\n const noteId = `${generated}-note`\n const hasHeading = heading != null\n const hasNote = note != null\n return (\n <div data-look={look} className={cx(styles.composer, className)}>\n {hasHeading && (\n <p id={headingId} className={styles.heading}>\n {headingIcon != null && (\n <span className={styles.headingIcon} aria-hidden=\"true\">\n {headingIcon}\n </span>\n )}\n <span>{heading}</span>\n </p>\n )}\n <BackdropTextarea aria-label={label} {...rest} aria-describedby={joinIds(hasHeading && headingId, rest['aria-describedby'])} />\n {suggestions != null && <Suggestions label={suggestionsLabel}>{suggestions}</Suggestions>}\n <div className={styles.footer}>\n {secondaryAction}\n <span className={styles.spacer} />\n {hasNote && (\n <span id={noteId} className={styles.note}>\n {note}\n </span>\n )}\n <BackdropButton type=\"submit\" variant=\"primary\" icon={sendIcon} aria-describedby={hasNote ? noteId : undefined}>\n {sendLabel}\n </BackdropButton>\n </div>\n </div>\n )\n}\n"],"names":["BackdropThread","label","children","className","tabIndex","rest","jsx","cx","styles","BackdropMessage","direction","caption","leading","jsxs","BackdropDaySeparator","joinIds","ids","joined","Suggestions","BackdropComposer","props","generated","useId","look","sendLabel","sendIcon","suggestions","suggestionsLabel","BackdropIconButton","heading","headingIcon","secondaryAction","note","headingId","noteId","hasHeading","hasNote","BackdropTextarea","BackdropButton"],"mappings":"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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const s = "_thread_96crm_11", o = "_threadInner_96crm_28", n = "_day_96crm_37", e = "_message_96crm_51", _ = "_outgoing_96crm_58", c = "_messageLeading_96crm_62", t = "_messageBody_96crm_67", a = "_incoming_96crm_74", r = "_bubble_96crm_84", m = "_caption_96crm_108", g = "_composer_96crm_117", i = "_suggestions_96crm_129", d = "_heading_96crm_136", p = "_headingIcon_96crm_146", u = "_footer_96crm_156", h = "_spacer_96crm_163", b = "_note_96crm_167", I = "_askBox_96crm_176", y = "_askInput_96crm_189", k = {
|
|
2
|
+
thread: s,
|
|
3
|
+
threadInner: o,
|
|
4
|
+
day: n,
|
|
5
|
+
message: e,
|
|
6
|
+
outgoing: _,
|
|
7
|
+
messageLeading: c,
|
|
8
|
+
messageBody: t,
|
|
9
|
+
incoming: a,
|
|
10
|
+
bubble: r,
|
|
11
|
+
caption: m,
|
|
12
|
+
composer: g,
|
|
13
|
+
suggestions: i,
|
|
14
|
+
heading: d,
|
|
15
|
+
headingIcon: p,
|
|
16
|
+
footer: u,
|
|
17
|
+
spacer: h,
|
|
18
|
+
note: b,
|
|
19
|
+
askBox: I,
|
|
20
|
+
askInput: y
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
I as askBox,
|
|
24
|
+
y as askInput,
|
|
25
|
+
r as bubble,
|
|
26
|
+
m as caption,
|
|
27
|
+
g as composer,
|
|
28
|
+
n as day,
|
|
29
|
+
k as default,
|
|
30
|
+
u as footer,
|
|
31
|
+
d as heading,
|
|
32
|
+
p as headingIcon,
|
|
33
|
+
a as incoming,
|
|
34
|
+
e as message,
|
|
35
|
+
t as messageBody,
|
|
36
|
+
c as messageLeading,
|
|
37
|
+
b as note,
|
|
38
|
+
_ as outgoing,
|
|
39
|
+
h as spacer,
|
|
40
|
+
i as suggestions,
|
|
41
|
+
s as thread,
|
|
42
|
+
o as threadInner
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=BackdropConversation.module.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackdropConversation.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
import { BackdropButtonVariantName } from './BackdropButton';
|
|
3
|
+
import { BackdropStep } from './BackdropGlobalPanels';
|
|
4
|
+
import { BackdropPageAction } from './BackdropPage';
|
|
5
|
+
/**
|
|
6
|
+
* What the mark says, so one meaning has one drawing.
|
|
7
|
+
*
|
|
8
|
+
* - `dot` (default): a state that is simply so ("Connected", "Running").
|
|
9
|
+
* - `check`: a state that was checked and passed ("Verified"). The `done`
|
|
10
|
+
* icon, circle-check (ADR-0017, Batch 2 gate).
|
|
11
|
+
* - `ring`: a state not yet reached or not yet live ("Draft", "Invited").
|
|
12
|
+
*/
|
|
13
|
+
export type BackdropStatusMarkKind = 'dot' | 'check' | 'ring';
|
|
14
|
+
/** The status pill's tones (ADR-0017, D7), drawn in the pill's dot colour. */
|
|
15
|
+
export type BackdropStatusMarkTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
16
|
+
/** `md` (default) 14/20 beside a field or in an aside; `sm` 12/16 inside a board card. */
|
|
17
|
+
export type BackdropStatusMarkSize = 'md' | 'sm';
|
|
18
|
+
export interface BackdropStatusMarkProps {
|
|
19
|
+
/** The state, in words: "Connected", "Verified", "Draft", "Failed". It carries the meaning. */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
kind?: BackdropStatusMarkKind;
|
|
22
|
+
tone?: BackdropStatusMarkTone;
|
|
23
|
+
size?: BackdropStatusMarkSize;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function BackdropStatusMark({ children, kind, tone, size, className }: BackdropStatusMarkProps): import("react").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* - `bar` (default): the 56px bar and the number after it ("Fit ▬▬ 91"),
|
|
29
|
+
* drawn with BackdropProgress's `mini` track.
|
|
30
|
+
* - `ring`: a 44px ring with the number in its middle.
|
|
31
|
+
* - `signal`: three to five rising bars and a word ("Strong").
|
|
32
|
+
*/
|
|
33
|
+
export type BackdropMeterLook = 'bar' | 'ring' | 'signal';
|
|
34
|
+
/** `ink` (default). `success` only where a high reading is itself good news. Never orange. */
|
|
35
|
+
export type BackdropMeterTone = 'ink' | 'success';
|
|
36
|
+
export interface BackdropMeterProps {
|
|
37
|
+
value: number;
|
|
38
|
+
/** Default 100. */
|
|
39
|
+
max?: number;
|
|
40
|
+
/** Default 0. */
|
|
41
|
+
min?: number;
|
|
42
|
+
/** The meter's accessible name: "Fit", "Match", "Signal strength". */
|
|
43
|
+
label: string;
|
|
44
|
+
/**
|
|
45
|
+
* The reading as shown and spoken: "91", "Strong". Defaults to the value.
|
|
46
|
+
* A `signal` meter should always pass a word, since its bars are not a number.
|
|
47
|
+
*/
|
|
48
|
+
valueText?: string;
|
|
49
|
+
/** A visible caption before the meter: "Fit". Leave it out when a column header names it. */
|
|
50
|
+
caption?: ReactNode;
|
|
51
|
+
look?: BackdropMeterLook;
|
|
52
|
+
/** `signal` only: how many bars, 3 (default) to 5. */
|
|
53
|
+
steps?: 3 | 4 | 5;
|
|
54
|
+
tone?: BackdropMeterTone;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
export declare function BackdropMeter({ value, max, min, label, valueText, caption, look, steps, tone, className }: BackdropMeterProps): import("react").JSX.Element;
|
|
58
|
+
/**
|
|
59
|
+
* `raised` (default): the white card with a ring and one shadow, at the right
|
|
60
|
+
* of a detail page (Off-market introduction). `aside`: the panel grey with no
|
|
61
|
+
* edge (Brokers offer, Financing application).
|
|
62
|
+
*/
|
|
63
|
+
export type BackdropSummaryCardSurface = 'raised' | 'aside';
|
|
64
|
+
export interface BackdropSummaryCardProps {
|
|
65
|
+
/** "Your commission 8% · about €1,440 per deal", "Ready". */
|
|
66
|
+
title: ReactNode;
|
|
67
|
+
/** One or two muted lines under the title. */
|
|
68
|
+
description?: ReactNode;
|
|
69
|
+
/** A state above the title: a BackdropStatusMark, or a BackdropPill. */
|
|
70
|
+
status?: ReactNode;
|
|
71
|
+
/** The figures: a BackdropStat, key/value rows, a meter. Laid out by the caller. */
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
/** The card's one action, full width at its foot. */
|
|
74
|
+
action?: BackdropPageAction;
|
|
75
|
+
/**
|
|
76
|
+
* `primary` (default) when this is the page's main action, the one orange
|
|
77
|
+
* button on the screen. `ink` inside an aside that is not, `outline` for a
|
|
78
|
+
* quiet one.
|
|
79
|
+
*/
|
|
80
|
+
actionVariant?: Extract<BackdropButtonVariantName, 'primary' | 'ink' | 'outline'>;
|
|
81
|
+
/** A second, quieter action under the first: an outline button. */
|
|
82
|
+
secondaryAction?: BackdropPageAction;
|
|
83
|
+
surface?: BackdropSummaryCardSurface;
|
|
84
|
+
/** 2 (default): the card is a region under the page's h1. */
|
|
85
|
+
headingLevel?: 2 | 3;
|
|
86
|
+
linkComponent?: ElementType;
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
export declare function BackdropSummaryCard({ title, description, status, children, action, actionVariant, secondaryAction, surface, headingLevel, linkComponent, className, }: BackdropSummaryCardProps): import("react").JSX.Element;
|
|
90
|
+
export interface BackdropChecklistProps {
|
|
91
|
+
/** "Get set up", "Profile". */
|
|
92
|
+
title: ReactNode;
|
|
93
|
+
/** "3 of 5". */
|
|
94
|
+
progressText?: ReactNode;
|
|
95
|
+
/** 0–1. With it, a BackdropProgress bar runs under the head. */
|
|
96
|
+
progress?: number;
|
|
97
|
+
/** The bar's accessible name: "Setup, 3 of 5 done". Required with `progress`. */
|
|
98
|
+
progressLabel?: string;
|
|
99
|
+
/**
|
|
100
|
+
* The rows: BackdropStepList's steps. `done` draws the filled circle-check,
|
|
101
|
+
* `todo` the empty circle, `next` is the current row (highlighted, with its
|
|
102
|
+
* one action). A link on any other row goes in its `trailing` slot.
|
|
103
|
+
*/
|
|
104
|
+
steps: BackdropStep[];
|
|
105
|
+
/** The list's name: "Setup steps". */
|
|
106
|
+
stepsLabel: string;
|
|
107
|
+
/** `icon` (default) circles, or `number` for an ordered setup. */
|
|
108
|
+
marker?: 'icon' | 'number';
|
|
109
|
+
/** 2 (default). */
|
|
110
|
+
headingLevel?: 2 | 3;
|
|
111
|
+
linkComponent?: ElementType;
|
|
112
|
+
className?: string;
|
|
113
|
+
}
|
|
114
|
+
export declare function BackdropChecklist({ title, progressText, progress, progressLabel, steps, stepsLabel, marker, headingLevel, linkComponent, className, }: BackdropChecklistProps): import("react").JSX.Element;
|
|
115
|
+
/** `row` (default): body left, actions right (a queue of several). `stacked`: actions under the body (one item at a time). */
|
|
116
|
+
export type BackdropReviewCardLayout = 'row' | 'stacked';
|
|
117
|
+
export interface BackdropReviewCardProps {
|
|
118
|
+
/** Who or where it came from: "Imprimerie Bellecour", "Sophie Garnier". */
|
|
119
|
+
name: ReactNode;
|
|
120
|
+
/** A leading BackdropAvatar or BackdropIconTile. Decorative: `name` says who. */
|
|
121
|
+
avatar?: ReactNode;
|
|
122
|
+
/** After the name on the same line: a date, a source, a meter. */
|
|
123
|
+
meta?: ReactNode;
|
|
124
|
+
/** A one-line heading for the item: "Cut delivery costs". */
|
|
125
|
+
title?: ReactNode;
|
|
126
|
+
/** The words under review, quoted. Clamped to three lines. */
|
|
127
|
+
quote: ReactNode;
|
|
128
|
+
/** Context chips under the quote (BackdropChip kind="tag"). */
|
|
129
|
+
chips?: ReactNode;
|
|
130
|
+
/** Accept: "Approve", "Keep". */
|
|
131
|
+
primaryAction: BackdropPageAction;
|
|
132
|
+
/** Turn down: "Reject", "Dismiss". A ghost button, before the primary one. */
|
|
133
|
+
secondaryAction?: BackdropPageAction;
|
|
134
|
+
/**
|
|
135
|
+
* How loud the accept button is. `outline` (default) for a queue, where
|
|
136
|
+
* every row has one. `primary` (orange) only when the card is the one item
|
|
137
|
+
* on the screen, since a page has at most one orange button.
|
|
138
|
+
*/
|
|
139
|
+
emphasis?: 'outline' | 'primary';
|
|
140
|
+
/** Leading 16px icon on the accept button (the `done` check). Decorative. */
|
|
141
|
+
primaryIcon?: ReactNode;
|
|
142
|
+
layout?: BackdropReviewCardLayout;
|
|
143
|
+
linkComponent?: ElementType;
|
|
144
|
+
className?: string;
|
|
145
|
+
}
|
|
146
|
+
export declare function BackdropReviewCard({ name, avatar, meta, title, quote, chips, primaryAction, secondaryAction, emphasis, primaryIcon, layout, linkComponent, className, }: BackdropReviewCardProps): import("react").JSX.Element;
|
|
147
|
+
export interface BackdropBoardCardProps {
|
|
148
|
+
/** "Sophie Arnaud", "Clinique des Monts d'Or". */
|
|
149
|
+
title: ReactNode;
|
|
150
|
+
/** One muted line under the title: "Office manager · Lumen Assurances". */
|
|
151
|
+
subtitle?: ReactNode;
|
|
152
|
+
/** Above the title, left: a BackdropStatusMark (size="sm"). */
|
|
153
|
+
status?: ReactNode;
|
|
154
|
+
/** Above the title, right: "Today", "Won on 6 Nov". */
|
|
155
|
+
meta?: ReactNode;
|
|
156
|
+
/** Beside the title: a 24 or 32 BackdropAvatar. Decorative. */
|
|
157
|
+
avatar?: ReactNode;
|
|
158
|
+
/** A short body: one or two sentences. */
|
|
159
|
+
body?: ReactNode;
|
|
160
|
+
/** Under a hairline at the foot: a source line, or figures. */
|
|
161
|
+
footer?: ReactNode;
|
|
162
|
+
/** The card opens a page: rendered as a link. */
|
|
163
|
+
href?: string;
|
|
164
|
+
/**
|
|
165
|
+
* The card opens something in place (a side panel): rendered as a
|
|
166
|
+
* <button type="button">. Stage A draws the markup only; the handler is
|
|
167
|
+
* Stage B's. Ignored when `href` is given.
|
|
168
|
+
*/
|
|
169
|
+
interactive?: boolean;
|
|
170
|
+
linkComponent?: ElementType;
|
|
171
|
+
className?: string;
|
|
172
|
+
}
|
|
173
|
+
export declare function BackdropBoardCard({ title, subtitle, status, meta, avatar, body, footer, href, interactive, linkComponent: Link, className }: BackdropBoardCardProps): import("react").JSX.Element;
|
|
174
|
+
export interface BackdropBoardColumn {
|
|
175
|
+
key: string;
|
|
176
|
+
/** "New", "Contacted", "Won". */
|
|
177
|
+
label: ReactNode;
|
|
178
|
+
/** How many cards: "2". Formatted by the caller. */
|
|
179
|
+
count?: ReactNode;
|
|
180
|
+
/** A right-hand figure for the column: "€1,440". */
|
|
181
|
+
summary?: ReactNode;
|
|
182
|
+
/** BackdropBoardCard elements, in order. */
|
|
183
|
+
cards: ReactNode[];
|
|
184
|
+
/** Shown in place of cards when there are none: "None". */
|
|
185
|
+
emptyText?: ReactNode;
|
|
186
|
+
}
|
|
187
|
+
export interface BackdropBoardProps {
|
|
188
|
+
columns: BackdropBoardColumn[];
|
|
189
|
+
/** The board's accessible name: "Introductions by stage". */
|
|
190
|
+
label: string;
|
|
191
|
+
/** The level of each column's heading. 3 (default) under the page's h1 and a section h2. */
|
|
192
|
+
headingLevel?: 2 | 3 | 4;
|
|
193
|
+
className?: string;
|
|
194
|
+
}
|
|
195
|
+
export declare function BackdropBoard({ columns, label, headingLevel, className }: BackdropBoardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import { useId as C } from "react";
|
|
3
|
+
import a from "./BackdropData.module.css.js";
|
|
4
|
+
import f from "./BackdropGlobalPanels.module.css.js";
|
|
5
|
+
import { cx as N } from "./cx.js";
|
|
6
|
+
import { BackdropButton as g } from "./BackdropButton.js";
|
|
7
|
+
import { BackdropProgress as S, BackdropStepList as I } from "./BackdropGlobalPanels.js";
|
|
8
|
+
import { BackdropCard as y } from "./BackdropPage.js";
|
|
9
|
+
function D({ children: o, kind: d = "dot", tone: i = "neutral", size: c = "md", className: l }) {
|
|
10
|
+
return /* @__PURE__ */ s("span", { className: N(a.status, a[`status-${i}`], c === "sm" && a.statusSm, l), "data-kind": d, "data-tone": i, children: [
|
|
11
|
+
d === "check" ? /* @__PURE__ */ e("span", { "aria-hidden": "true", className: a.statusIcon, children: /* @__PURE__ */ e(x, {}) }) : /* @__PURE__ */ e("span", { "aria-hidden": "true", className: N(a.statusDot, d === "ring" && a.statusRing) }),
|
|
12
|
+
/* @__PURE__ */ e("span", { className: a.statusLabel, children: o })
|
|
13
|
+
] });
|
|
14
|
+
}
|
|
15
|
+
function x() {
|
|
16
|
+
return /* @__PURE__ */ s("svg", { "aria-hidden": "true", focusable: "false", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", className: a.statusSvg, children: [
|
|
17
|
+
/* @__PURE__ */ e("path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" }),
|
|
18
|
+
/* @__PURE__ */ e("path", { d: "M9 12l2 2l4 -4" })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
function F({ value: o, max: d = 100, min: i = 0, label: c, valueText: l, caption: n, look: r = "bar", steps: t = 3, tone: h = "ink", className: u }) {
|
|
22
|
+
const p = d - i, m = p > 0 ? Math.max(0, Math.min(1, (o - i) / p)) : 0, v = l ?? String(o), b = {
|
|
23
|
+
role: "meter",
|
|
24
|
+
"aria-label": c,
|
|
25
|
+
"aria-valuemin": i,
|
|
26
|
+
"aria-valuemax": d,
|
|
27
|
+
"aria-valuenow": Math.max(i, Math.min(d, o)),
|
|
28
|
+
"aria-valuetext": l
|
|
29
|
+
};
|
|
30
|
+
if (r === "ring")
|
|
31
|
+
return /* @__PURE__ */ s("span", { ...b, className: N(a.meter, h === "success" && a.meterSuccess, u), "data-look": "ring", children: [
|
|
32
|
+
n !== void 0 && /* @__PURE__ */ e("span", { className: a.meterCaption, "aria-hidden": "true", children: n }),
|
|
33
|
+
/* @__PURE__ */ s("span", { className: a.ring, style: { "--backdrop-meter-share": `${Math.round(m * 100)}%` }, children: [
|
|
34
|
+
/* @__PURE__ */ e("span", { className: a.ringBand, "aria-hidden": "true" }),
|
|
35
|
+
/* @__PURE__ */ e("span", { className: a.ringValue, "aria-hidden": "true", children: v })
|
|
36
|
+
] })
|
|
37
|
+
] });
|
|
38
|
+
if (r === "signal") {
|
|
39
|
+
const k = Math.max(3, Math.min(5, t)), w = Math.round(m * k);
|
|
40
|
+
return /* @__PURE__ */ s("span", { ...b, className: N(a.meter, a.meterSignal, h === "success" && a.meterSuccess, u), "data-look": "signal", children: [
|
|
41
|
+
n !== void 0 && /* @__PURE__ */ e("span", { className: a.meterCaption, "aria-hidden": "true", children: n }),
|
|
42
|
+
/* @__PURE__ */ e("span", { className: a.signal, "aria-hidden": "true", children: Array.from({ length: k }, (T, B) => (
|
|
43
|
+
// Bars rise evenly from half the mark's height to all of it: 6, 9, 12 for three.
|
|
44
|
+
/* @__PURE__ */ e("span", { className: N(a.signalBar, B < w && a.signalBarOn), style: { height: `${50 + 50 * B / (k - 1)}%` } }, B)
|
|
45
|
+
)) }),
|
|
46
|
+
/* @__PURE__ */ e("span", { className: a.signalValue, "aria-hidden": "true", children: v })
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ s("span", { ...b, className: N(a.meter, h === "success" && a.meterSuccess, u), "data-look": "bar", children: [
|
|
50
|
+
n !== void 0 && /* @__PURE__ */ e("span", { className: a.meterCaption, "aria-hidden": "true", children: n }),
|
|
51
|
+
/* @__PURE__ */ e("span", { className: N(f.track, f["track-mini"], h === "success" && f["tone-success"]), "aria-hidden": "true", children: /* @__PURE__ */ e("span", { className: f.fillBar, style: { width: `${Math.round(m * 100)}%` } }) }),
|
|
52
|
+
/* @__PURE__ */ e("span", { className: a.meterValue, "aria-hidden": "true", children: v })
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
function q({
|
|
56
|
+
title: o,
|
|
57
|
+
description: d,
|
|
58
|
+
status: i,
|
|
59
|
+
children: c,
|
|
60
|
+
action: l,
|
|
61
|
+
actionVariant: n = "primary",
|
|
62
|
+
secondaryAction: r,
|
|
63
|
+
surface: t = "raised",
|
|
64
|
+
headingLevel: h = 2,
|
|
65
|
+
linkComponent: u,
|
|
66
|
+
className: p
|
|
67
|
+
}) {
|
|
68
|
+
const m = C(), v = h === 3 ? "h3" : "h2";
|
|
69
|
+
return /* @__PURE__ */ s(
|
|
70
|
+
y,
|
|
71
|
+
{
|
|
72
|
+
as: "section",
|
|
73
|
+
surface: t === "aside" ? "panel" : "raised",
|
|
74
|
+
padding: "lg",
|
|
75
|
+
"aria-labelledby": m,
|
|
76
|
+
className: N(a.summary, p),
|
|
77
|
+
"data-surface": t,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ s("div", { className: a.summaryHead, children: [
|
|
80
|
+
i !== void 0 && /* @__PURE__ */ e("div", { className: a.summaryStatus, children: i }),
|
|
81
|
+
/* @__PURE__ */ e(v, { id: m, className: a.summaryTitle, children: o }),
|
|
82
|
+
d !== void 0 && /* @__PURE__ */ e("p", { className: a.summaryDescription, children: d })
|
|
83
|
+
] }),
|
|
84
|
+
c !== void 0 && /* @__PURE__ */ e("div", { className: a.summaryBody, children: c }),
|
|
85
|
+
(l || r) && /* @__PURE__ */ s("div", { className: a.summaryActions, children: [
|
|
86
|
+
l && /* @__PURE__ */ e(g, { variant: n, size: "lg", fullWidth: !0, href: l.href, linkComponent: u, onClick: l.onClick, children: l.label }),
|
|
87
|
+
r && /* @__PURE__ */ e(g, { variant: "outline", size: "lg", fullWidth: !0, href: r.href, linkComponent: u, onClick: r.onClick, children: r.label })
|
|
88
|
+
] })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function E({
|
|
94
|
+
title: o,
|
|
95
|
+
progressText: d,
|
|
96
|
+
progress: i,
|
|
97
|
+
progressLabel: c,
|
|
98
|
+
steps: l,
|
|
99
|
+
stepsLabel: n,
|
|
100
|
+
marker: r = "icon",
|
|
101
|
+
headingLevel: t = 2,
|
|
102
|
+
linkComponent: h,
|
|
103
|
+
className: u
|
|
104
|
+
}) {
|
|
105
|
+
const p = C(), m = t === 3 ? "h3" : "h2";
|
|
106
|
+
return /* @__PURE__ */ s("section", { "aria-labelledby": p, className: N(a.checklist, u), children: [
|
|
107
|
+
/* @__PURE__ */ s("div", { className: a.checklistHead, children: [
|
|
108
|
+
/* @__PURE__ */ s("div", { className: a.checklistTitleRow, children: [
|
|
109
|
+
/* @__PURE__ */ e(m, { id: p, className: a.checklistTitle, children: o }),
|
|
110
|
+
d !== void 0 && /* @__PURE__ */ e("span", { className: a.checklistCount, children: d })
|
|
111
|
+
] }),
|
|
112
|
+
i !== void 0 && /* @__PURE__ */ e(S, { value: i, label: c ?? n })
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ e(I, { steps: l, label: n, marker: r, todoTone: "choice", linkComponent: h })
|
|
115
|
+
] });
|
|
116
|
+
}
|
|
117
|
+
function O({
|
|
118
|
+
name: o,
|
|
119
|
+
avatar: d,
|
|
120
|
+
meta: i,
|
|
121
|
+
title: c,
|
|
122
|
+
quote: l,
|
|
123
|
+
chips: n,
|
|
124
|
+
primaryAction: r,
|
|
125
|
+
secondaryAction: t,
|
|
126
|
+
emphasis: h = "outline",
|
|
127
|
+
primaryIcon: u,
|
|
128
|
+
layout: p = "row",
|
|
129
|
+
linkComponent: m,
|
|
130
|
+
className: v
|
|
131
|
+
}) {
|
|
132
|
+
const b = C(), k = C();
|
|
133
|
+
return /* @__PURE__ */ s(
|
|
134
|
+
y,
|
|
135
|
+
{
|
|
136
|
+
as: "article",
|
|
137
|
+
surface: "flat",
|
|
138
|
+
padding: "md",
|
|
139
|
+
"aria-labelledby": c !== void 0 ? k : b,
|
|
140
|
+
className: N(a.review, p === "stacked" ? a.reviewStacked : a.reviewRow, v),
|
|
141
|
+
"data-layout": p,
|
|
142
|
+
children: [
|
|
143
|
+
/* @__PURE__ */ s("div", { className: a.reviewBody, children: [
|
|
144
|
+
/* @__PURE__ */ s("div", { className: a.reviewWho, children: [
|
|
145
|
+
d !== void 0 && /* @__PURE__ */ e("span", { className: a.reviewAvatar, children: d }),
|
|
146
|
+
/* @__PURE__ */ e("span", { id: b, className: a.reviewName, children: o }),
|
|
147
|
+
i !== void 0 && /* @__PURE__ */ e("span", { className: a.reviewMeta, children: i })
|
|
148
|
+
] }),
|
|
149
|
+
c !== void 0 && /* @__PURE__ */ e("h3", { id: k, className: a.reviewTitle, children: c }),
|
|
150
|
+
/* @__PURE__ */ e("blockquote", { className: a.reviewQuote, children: l }),
|
|
151
|
+
n !== void 0 && /* @__PURE__ */ e("div", { className: a.reviewChips, children: n })
|
|
152
|
+
] }),
|
|
153
|
+
/* @__PURE__ */ s("div", { className: a.reviewActions, children: [
|
|
154
|
+
t && /* @__PURE__ */ e(g, { variant: "ghost", size: "lg", href: t.href, linkComponent: m, onClick: t.onClick, children: t.label }),
|
|
155
|
+
/* @__PURE__ */ e(g, { variant: h, size: "lg", icon: u, href: r.href, linkComponent: m, onClick: r.onClick, children: r.label })
|
|
156
|
+
] })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
function P({ title: o, subtitle: d, status: i, meta: c, avatar: l, body: n, footer: r, href: t, interactive: h = !1, linkComponent: u = "a", className: p }) {
|
|
162
|
+
const m = /* @__PURE__ */ s(M, { children: [
|
|
163
|
+
(i !== void 0 || c !== void 0) && /* @__PURE__ */ s("span", { className: a.boardCardTop, children: [
|
|
164
|
+
/* @__PURE__ */ e("span", { children: i }),
|
|
165
|
+
c !== void 0 && /* @__PURE__ */ e("span", { className: a.boardCardMeta, children: c })
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ s("span", { className: a.boardCardHead, children: [
|
|
168
|
+
l !== void 0 && /* @__PURE__ */ e("span", { className: a.boardCardAvatar, children: l }),
|
|
169
|
+
/* @__PURE__ */ s("span", { className: a.boardCardTitles, children: [
|
|
170
|
+
/* @__PURE__ */ e("span", { className: a.boardCardTitle, children: o }),
|
|
171
|
+
d !== void 0 && /* @__PURE__ */ e("span", { className: a.boardCardSubtitle, children: d })
|
|
172
|
+
] })
|
|
173
|
+
] }),
|
|
174
|
+
n !== void 0 && /* @__PURE__ */ e("span", { className: a.boardCardBody, children: n }),
|
|
175
|
+
r !== void 0 && /* @__PURE__ */ e("span", { className: a.boardCardFooter, children: r })
|
|
176
|
+
] }), v = N(a.boardCard, (t !== void 0 || h) && a.boardCardAction, p);
|
|
177
|
+
return t !== void 0 ? /* @__PURE__ */ e(u, { href: t, className: v, children: m }) : h ? /* @__PURE__ */ e("button", { type: "button", className: v, children: m }) : /* @__PURE__ */ e("div", { className: v, children: m });
|
|
178
|
+
}
|
|
179
|
+
function Q({ columns: o, label: d, headingLevel: i = 3, className: c }) {
|
|
180
|
+
const l = C(), n = i === 2 ? "h2" : i === 4 ? "h4" : "h3";
|
|
181
|
+
return /* @__PURE__ */ e("div", { role: "region", "aria-label": d, tabIndex: 0, className: N(a.board, c), children: o.map((r) => {
|
|
182
|
+
const t = `${l}-${r.key}`;
|
|
183
|
+
return /* @__PURE__ */ s("section", { "aria-labelledby": t, className: a.boardColumn, children: [
|
|
184
|
+
/* @__PURE__ */ s("div", { className: a.boardColumnHead, children: [
|
|
185
|
+
/* @__PURE__ */ s(n, { id: t, className: a.boardColumnTitle, children: [
|
|
186
|
+
/* @__PURE__ */ e("span", { children: r.label }),
|
|
187
|
+
r.count !== void 0 && /* @__PURE__ */ e("span", { className: a.boardColumnCount, children: r.count })
|
|
188
|
+
] }),
|
|
189
|
+
r.summary !== void 0 && /* @__PURE__ */ e("span", { className: a.boardColumnSummary, children: r.summary })
|
|
190
|
+
] }),
|
|
191
|
+
r.cards.length > 0 ? /* @__PURE__ */ e("ul", { className: a.boardList, children: r.cards.map((h, u) => /* @__PURE__ */ e("li", { className: a.boardItem, children: h }, u)) }) : r.emptyText !== void 0 && /* @__PURE__ */ e("p", { className: a.boardEmpty, children: r.emptyText })
|
|
192
|
+
] }, r.key);
|
|
193
|
+
}) });
|
|
194
|
+
}
|
|
195
|
+
export {
|
|
196
|
+
Q as BackdropBoard,
|
|
197
|
+
P as BackdropBoardCard,
|
|
198
|
+
E as BackdropChecklist,
|
|
199
|
+
F as BackdropMeter,
|
|
200
|
+
O as BackdropReviewCard,
|
|
201
|
+
D as BackdropStatusMark,
|
|
202
|
+
q as BackdropSummaryCard
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=BackdropData.js.map
|