@nucleux/md3-modes 0.0.0-stage → 0.8.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/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/index.cjs +520 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +55 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +493 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.tsx"],"names":["React","modes","useModesRoving","jsx","Md3SegmentedButton","cn","Md3SegmentedButtonItem","modeSupportingText","jsxs","Info","Check","ChevronDown","Md3Chip","SlidersHorizontal","modesLabels","Md3IconButton","X","Md3Menu","Md3Button","RefreshCw","useModes","useModesDismiss","Md3RequestSettings","mergeRequestSettingsItems","modesSettingsItem","Md3AgentComposer","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,IAAM,UAAA,GACJ,8QAAA;AAOK,IAAM,iBAAA,GAA0BA,gBAAA,CAAA,UAAA;AAAA,EACrC,CAAC,SAAEC,OAAA,EAAO,KAAA,EAAO,QAAA,EAAU,KAAA,GAAQ,MAAA,EAAQ,SAAA,EAAW,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACxE,IAAA,MAAM,MAAA,GAASC,oBAAA,CAAeD,OAAA,EAAO,KAAK,CAAA;AAC1C,IAAA,uBACEE,cAAA;AAAA,MAACC,qCAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,IAAA,EAAK,YAAA;AAAA,QACL,YAAA,EAAY,KAAA;AAAA,QACZ,OAAO,KAAA,IAAS,EAAA;AAAA,QAChB,SAAA,EAAWC,QAAA,CAAG,qDAAA,EAAuD,SAAS,CAAA;AAAA,QAC7E,GAAG,KAAA;AAAA,QAEH,QAAA,EAAAJ,OAAA,CAAM,GAAA,CAAI,CAAC,CAAA,EAAG,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aAAA,EAAe,QAAA;AAAA,UACf,QAAA,EAAU,CAAC,IAAA,KAAS;AAClB,YAAA,QAAA,GAAW,IAAA,EAAM,EAAE,IAAA,EAAM,CAAA,CAAE,MAAM,CAAA;AACjC,YAAA,CAAA,CAAE,aAAA,EAAc;AAChB,YAAA,IAAI,SAAA,KAAc,MAAA,EAAW,gBAAA,CAAiB,EAAE,CAAA;AAAA,UAClD,CAAA;AAAA,UACA,WAAA;AAAA,UACA,WAAA,EACE,OAAA,KAAY,UAAA,mBACVjB,eAAA,CAAAkB,mBAAA,EAAA,EACG,QAAA,EAAA;AAAA,YAAA,eAAA;AAAA,YACA;AAAA,WAAA,EACH,CAAA,GAEA,eAAA;AAAA,UAGJ,8BACElB,eAAA,CAAAkB,mBAAA,EAAA,EACG,QAAA,EAAA;AAAA,YAAA,OAAA,KAAY,MAAA,IAAU,IAAA;AAAA,YACtB;AAAA,WAAA,EACH,CAAA;AAAA,UAEF,SAAA,EAAWrB,QAAA;AAAA,YACT;AAAA;AACF;AAAA,OACF;AAAA,MACC;AAAA,KAAA,EACH,CAAA;AAAA,EAEJ;AACF;AACA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\nimport { Check, ChevronDown, Info, RefreshCw, SlidersHorizontal, X } from \"lucide-react\";\nimport { cn } from \"@nucleux/utils\";\nimport {\n modeSupportingText,\n modesLabels,\n modesSettingsItem,\n useModes,\n useModesDismiss,\n useModesRoving,\n type ModeOption,\n type ModesChipProps,\n type ModesListProps,\n type ModesNoteProps,\n type ModesNotice,\n type ModesPickerProps,\n type ModesProps,\n type ModesSegmentedProps,\n type ModesSubmitDetails,\n type ModesTrigger,\n type ModesVariant,\n} from \"@nucleux/modes\";\nimport { Md3RequestSettings, mergeRequestSettingsItems } from \"@nucleux/md3-open-input\";\nimport { Md3AgentComposer } from \"@nucleux/md3-agent-composer\";\nimport { Md3Button } from \"@nucleux/md3-button\";\nimport { Md3Chip } from \"@nucleux/md3-chip\";\nimport { Md3IconButton } from \"@nucleux/md3-icon-button\";\nimport { Md3Menu } from \"@nucleux/md3-menu\";\nimport { Md3SegmentedButton, Md3SegmentedButtonItem } from \"@nucleux/md3-segmented-button\";\n\nexport type Md3ModeOption = ModeOption;\nexport type Md3ModesNotice = ModesNotice;\nexport type Md3ModesVariant = ModesVariant;\nexport type Md3ModesTrigger = ModesTrigger;\nexport type Md3ModesSubmitDetails = ModesSubmitDetails;\nexport type Md3ModesProps = ModesProps;\nexport type Md3ModesSegmentedProps = ModesSegmentedProps;\nexport type Md3ModesListProps = ModesListProps;\nexport type Md3ModesChipProps = ModesChipProps;\nexport type Md3ModesPickerProps = ModesPickerProps;\nexport type Md3ModesNoteProps = ModesNoteProps;\n\nconst stateLayer =\n \"before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:content-[''] hover:before:opacity-[0.08] focus-visible:before:opacity-[0.12] active:before:opacity-[0.12] motion-reduce:before:transition-none\";\n\n/**\n * Material 3 segmented control for Modes: an outlined track of segments, the\n * active one in secondary-container with a check. Same radio group and keyboard\n * model as the shadcn `ModesSegmented` (Arrow keys move, Space/Enter choose).\n */\nexport const Md3ModesSegmented = React.forwardRef<HTMLDivElement, Md3ModesSegmentedProps>(\n ({ modes, value, onSelect, label = \"Mode\", className, ...props }, ref) => {\n const roving = useModesRoving(modes, value);\n return (\n <Md3SegmentedButton\n ref={ref}\n role=\"radiogroup\"\n aria-label={label}\n value={value ?? \"\"}\n className={cn(\"divide-md-outline-variant border-md-outline-variant\", className)}\n {...props}\n >\n {modes.map((m, i) => (\n <Md3SegmentedButtonItem\n key={m.id}\n value={m.id}\n icon={m.icon}\n role=\"radio\"\n aria-checked={m.id === value}\n aria-pressed={undefined}\n aria-disabled={m.unavailable ? true : undefined}\n title={m.unavailable}\n {...roving.getItemProps(i)}\n onClick={() => onSelect(m.id)}\n className={cn(\"min-w-[5.5rem] motion-reduce:transition-none\", m.unavailable && \"cursor-not-allowed opacity-[0.38]\")}\n >\n {m.shortName ?? m.name}\n </Md3SegmentedButtonItem>\n ))}\n </Md3SegmentedButton>\n );\n },\n);\nMd3ModesSegmented.displayName = \"Md3ModesSegmented\";\n\n/**\n * Material 3 mode rows: a 40dp icon tile, the name and one line on what\n * changes; the active row in secondary-container with a primary tile and a\n * trailing check; an unavailable row dimmed with its reason. Same radio group\n * and keyboard model as the shadcn `ModesList`.\n */\nexport const Md3ModesList = React.forwardRef<HTMLDivElement, Md3ModesListProps>(\n (\n { modes, value, onSelect, label = \"Mode\", showDescriptions = true, framed = true, className, ...props },\n ref,\n ) => {\n const roving = useModesRoving(modes, value);\n const baseId = React.useId();\n return (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-label={label}\n className={cn(\n \"flex flex-col gap-0.5\",\n framed && \"rounded-md-lg border border-md-outline-variant bg-md-surface p-2\",\n className,\n )}\n {...props}\n >\n {modes.map((m, i) => {\n const on = m.id === value;\n const support = modeSupportingText(m, showDescriptions);\n const descId = `${baseId}-${i}`;\n return (\n <button\n key={m.id}\n type=\"button\"\n role=\"radio\"\n aria-checked={on}\n aria-disabled={m.unavailable ? true : undefined}\n aria-labelledby={`${descId}-n`}\n aria-describedby={support || m.unavailable ? descId : undefined}\n {...roving.getItemProps(i)}\n onClick={() => onSelect(m.id)}\n className={cn(\n \"relative flex min-h-14 w-full items-center gap-3 overflow-hidden rounded-md-md px-3 py-2.5 text-left transition-colors motion-reduce:transition-none\",\n stateLayer,\n \"outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-md-primary\",\n on ? \"bg-md-secondary-container text-md-on-secondary-container\" : \"text-md-on-surface\",\n m.unavailable && \"cursor-not-allowed\",\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n \"relative grid size-10 shrink-0 place-items-center rounded-md-md text-base [&_svg]:size-[22px]\",\n on ? \"bg-md-primary text-md-on-primary\" : \"bg-md-surface-container-high text-md-on-surface-variant\",\n m.unavailable && \"opacity-[0.55]\",\n )}\n >\n {m.icon}\n </span>\n <span className=\"relative flex min-w-0 flex-1 flex-col gap-0.5\">\n <span id={`${descId}-n`} className={cn(\"text-sm font-medium leading-5\", m.unavailable && \"opacity-[0.55]\")}>\n {m.name}\n </span>\n {(support || m.unavailable) && (\n <span id={descId} className=\"flex flex-col gap-0.5 text-xs leading-[18px]\">\n {support && (\n <span className={cn(on ? \"text-current\" : \"text-md-on-surface-variant\", m.unavailable && \"opacity-[0.55]\")}>\n {support}\n </span>\n )}\n {m.unavailable && (\n <span className=\"inline-flex items-center gap-1 text-md-on-surface\">\n <Info aria-hidden=\"true\" className=\"size-3.5 shrink-0\" />\n {m.unavailable}\n </span>\n )}\n </span>\n )}\n </span>\n {on && <Check aria-hidden=\"true\" className=\"relative size-[22px] shrink-0 text-md-on-secondary-container\" />}\n </button>\n );\n })}\n </div>\n );\n },\n);\nMd3ModesList.displayName = \"Md3ModesList\";\n\n/**\n * The Material 3 Mode chip in the composer's settings row. Unset it is an\n * outlined assist chip (\"Mode ▾\"); set it becomes a tonal chip reading\n * \"Mode **Plan**\" with the mode's icon, a chevron that turns when open, and a\n * × that clears it. Same accessible names as the shadcn `ModesChip`.\n */\nexport const Md3ModesChip = React.forwardRef<HTMLButtonElement, Md3ModesChipProps>(\n ({ mode, label = \"Mode\", open = false, onRemove, className, ...props }, ref) => {\n const chevron = (\n <ChevronDown\n aria-hidden=\"true\"\n className={cn(\"relative -mr-1 size-[18px] transition-transform motion-reduce:transition-none\", open && \"rotate-180\")}\n />\n );\n if (!mode) {\n return (\n <Md3Chip\n ref={ref}\n variant=\"assist\"\n icon={<SlidersHorizontal aria-hidden=\"true\" />}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-label={modesLabels.chip(label, null)}\n className={cn(\"shrink-0 border-md-outline-variant font-normal [&_svg]:size-4\", open && \"border-md-primary\", className)}\n {...props}\n >\n <span className=\"inline-flex items-center gap-1.5\">\n {label}\n {chevron}\n </span>\n </Md3Chip>\n );\n }\n return (\n <span\n className={cn(\n \"inline-flex h-8 shrink-0 items-center rounded-md-sm bg-md-secondary-container text-md-on-secondary-container animate-nx-fade-in motion-reduce:animate-none\",\n className,\n )}\n >\n <Md3Chip\n ref={ref}\n variant=\"assist\"\n selected\n icon={mode.icon}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n aria-label={modesLabels.chip(label, mode)}\n className={cn(\"bg-transparent pl-2 font-normal [&_svg]:size-4\", onRemove ? \"rounded-r-none pr-1.5\" : \"pr-2.5\")}\n {...props}\n >\n <span className=\"inline-flex items-center gap-1.5\">\n <span>{label}</span>\n <span className=\"max-w-[18ch] truncate font-semibold\">{mode.shortName ?? mode.name}</span>\n {chevron}\n </span>\n </Md3Chip>\n {onRemove && (\n <Md3IconButton\n aria-label={modesLabels.remove(label, mode)}\n onClick={onRemove}\n className=\"h-8 w-7 rounded-none rounded-r-md-sm pr-1 text-current focus-visible:ring-offset-0 [&_svg]:size-3.5\"\n >\n <X aria-hidden=\"true\" />\n </Md3IconButton>\n )}\n </span>\n );\n },\n);\nMd3ModesChip.displayName = \"Md3ModesChip\";\n\n/**\n * The Material 3 Mode picker: a menu surface with \"Mode\" and one line on what\n * a mode is, the mode rows, an error-container alert when an unavailable mode\n * was chosen, and a \"No mode\" text button. A dialog; Escape closes it.\n */\nexport const Md3ModesPicker = React.forwardRef<HTMLDivElement, Md3ModesPickerProps>(\n (\n {\n modes,\n value,\n onSelect,\n onClear,\n onClose,\n label = \"Mode\",\n description = \"How the agent approaches this request. Model and effort stay as they are.\",\n rejected,\n showDescriptions = true,\n autoFocus = false,\n showClose = false,\n className,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const listRef = React.useRef<HTMLDivElement>(null);\n React.useEffect(() => {\n if (!autoFocus) return;\n const el =\n listRef.current?.querySelector<HTMLElement>('[role=\"radio\"][aria-checked=\"true\"]') ??\n listRef.current?.querySelector<HTMLElement>('[role=\"radio\"]');\n el?.focus();\n }, [autoFocus]);\n return (\n <Md3Menu\n ref={ref}\n role=\"dialog\"\n aria-label={modesLabels.picker(label)}\n className={cn(\n \"min-w-[18rem] rounded-md-lg border border-md-outline-variant bg-md-surface p-2 shadow-md-2 animate-nx-fade-in motion-reduce:animate-none\",\n className,\n )}\n onKeyDown={(e) => {\n onKeyDown?.(e);\n if (e.key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n onClose?.();\n }\n }}\n {...props}\n >\n <div className={cn(\"relative flex flex-col gap-0.5 px-3 pb-2 pt-2.5\", showClose && \"pr-12\")}>\n <p className=\"text-base font-medium leading-6 text-md-on-surface\">{label}</p>\n {description != null && <p className=\"text-xs leading-[18px] text-md-on-surface-variant\">{description}</p>}\n {showClose && (\n <Md3IconButton aria-label={modesLabels.close} onClick={onClose} className=\"absolute right-0 top-0\">\n <X aria-hidden=\"true\" />\n </Md3IconButton>\n )}\n </div>\n <Md3ModesList\n ref={listRef}\n modes={modes}\n value={value}\n onSelect={onSelect}\n label={label}\n framed={false}\n showDescriptions={showDescriptions}\n />\n {rejected && (\n <p\n role=\"alert\"\n className=\"mx-2 mb-1 mt-2 flex items-center gap-2 rounded-md-md bg-md-error-container px-3 py-2 text-[13px] leading-5 text-md-on-error-container\"\n >\n <Info aria-hidden=\"true\" className=\"size-[18px] shrink-0\" />\n {modesLabels.unavailable(rejected)}\n </p>\n )}\n {onClear && value != null && (\n <div className=\"mx-1 mt-1.5\">\n <Md3Button variant=\"text\" onClick={onClear}>\n {modesLabels.clear}\n </Md3Button>\n </div>\n )}\n </Md3Menu>\n );\n },\n);\nMd3ModesPicker.displayName = \"Md3ModesPicker\";\n\n/** The one quiet line after a change, with a primary sync icon and an Undo text button. */\nexport const Md3ModesNote = React.forwardRef<HTMLDivElement, Md3ModesNoteProps>(\n ({ onUndo, className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"flex items-center gap-2 px-2 text-[13px] leading-5 text-md-on-surface-variant animate-nx-fade-in motion-reduce:animate-none\",\n className,\n )}\n {...props}\n >\n <RefreshCw aria-hidden=\"true\" className=\"size-[18px] shrink-0 text-md-primary\" />\n <span className=\"min-w-0 flex-1\">{children}</span>\n {onUndo && (\n <Md3Button variant=\"text\" onClick={onUndo} className=\"h-8 px-2\">\n {modesLabels.undo}\n </Md3Button>\n )}\n </div>\n ),\n);\nMd3ModesNote.displayName = \"Md3ModesNote\";\n\n/**\n * Material 3 Modes: choose how the agent approaches a request — Brainstorm,\n * Draft, Review, Plan — separate from which model answers. A Mode chip in the\n * composer's settings row opens a short list where each mode says what changes\n * and an unavailable one says why; the chip then reads \"Mode Plan\" with a way\n * to change or clear it, and a change adds one quiet line with Undo. Same API,\n * states, keyboard model and accessible names as `Modes` from\n * `@nucleux/modes`; choosing a mode never touches the text, and nothing is\n * sent until the person sends.\n */\nexport const Md3Modes = React.forwardRef<HTMLDivElement, Md3ModesProps>(\n (\n {\n modes,\n value,\n defaultValue,\n onValueChange,\n variant = \"composer\",\n open,\n defaultOpen,\n onOpenChange,\n clearable = true,\n showDescriptions = true,\n label = \"Mode\",\n pickerDescription,\n defaultNotice,\n onUnavailable,\n draft: draftProp,\n defaultDraft = \"\",\n onDraftChange,\n onSubmit,\n placeholder = \"Ask Aria…\",\n composerLeading,\n composerActions,\n sendLabel: _sendLabel,\n trigger = \"chip\",\n settingsItems,\n onSettingsSelect,\n className,\n ...props\n },\n ref,\n ) => {\n void _sendLabel; // Md3AgentComposer names its send button \"Send\".\n const s = useModes({\n modes,\n value,\n defaultValue,\n onValueChange,\n open,\n defaultOpen,\n onOpenChange,\n defaultNotice,\n onUnavailable,\n });\n const [internalDraft, setInternalDraft] = React.useState(defaultDraft);\n const draft = draftProp ?? internalDraft;\n const setDraft = (t: string) => {\n if (draftProp === undefined) setInternalDraft(t);\n onDraftChange?.(t);\n };\n\n const chipRef = React.useRef<HTMLButtonElement>(null);\n const chipBoxRef = React.useRef<HTMLDivElement>(null);\n const pickerRef = React.useRef<HTMLDivElement>(null);\n const [userOpened, setUserOpened] = React.useState(false);\n useModesDismiss([chipBoxRef, pickerRef], s.open, () => s.setOpen(false));\n\n // Return focus to the chip after it re-renders (its element can change when a mode is set or cleared).\n const [refocus, setRefocus] = React.useState(0);\n React.useEffect(() => {\n if (refocus) chipRef.current?.focus();\n }, [refocus]);\n const choose = (id: string) => {\n const m = modes.find((x) => x.id === id);\n const wasOpen = s.open;\n s.select(id);\n if (wasOpen && m && !m.unavailable) setRefocus((n) => n + 1);\n };\n const clearMode = () => {\n s.clear();\n setRefocus((n) => n + 1);\n };\n const undoChange = () => {\n s.undo();\n setRefocus((n) => n + 1);\n };\n const closePicker = () => {\n s.setOpen(false);\n setRefocus((n) => n + 1);\n };\n const notice = s.notice;\n const rejected = notice?.type === \"unavailable\" ? (modes.find((m) => m.id === notice.id) ?? null) : null;\n const changedTo = notice?.type === \"changed\" ? s.mode : null;\n\n const note = changedTo ? <Md3ModesNote onUndo={undoChange}>{modesLabels.changed(changedTo)}</Md3ModesNote> : null;\n const inlineAlert =\n rejected && !s.open ? (\n <p\n role=\"alert\"\n className=\"flex items-center gap-2 rounded-md-md bg-md-error-container px-3 py-2 text-[13px] leading-5 text-md-on-error-container\"\n >\n <Info aria-hidden=\"true\" className=\"size-[18px] shrink-0\" />\n {modesLabels.unavailable(rejected)}\n </p>\n ) : null;\n\n const chip = (\n <div ref={chipBoxRef} className=\"inline-flex\">\n <Md3ModesChip\n ref={chipRef}\n mode={s.mode}\n label={label}\n open={s.open}\n onClick={() => {\n setUserOpened(!s.open);\n s.setOpen(!s.open);\n }}\n onRemove={clearable ? clearMode : undefined}\n />\n </div>\n );\n const settings = (\n <div ref={chipBoxRef} className=\"inline-flex\">\n <Md3RequestSettings\n ref={chipRef}\n items={mergeRequestSettingsItems(modesSettingsItem(label, s.mode, <SlidersHorizontal />), settingsItems)}\n onSelect={(id) => {\n if (id !== \"mode\") return onSettingsSelect?.(id);\n setUserOpened(true);\n s.setOpen(true);\n }}\n onOpenChange={(o) => {\n if (o && s.open) s.setOpen(false);\n }}\n className={variant === \"composer\" ? \"static [&>[role=menu]]:left-10\" : undefined}\n />\n </div>\n );\n const control = trigger === \"settings\" ? settings : chip;\n\n const picker = s.open ? (\n <Md3ModesPicker\n ref={pickerRef}\n modes={modes}\n value={s.value}\n onSelect={choose}\n onClear={clearable ? clearMode : undefined}\n onClose={closePicker}\n label={label}\n description={pickerDescription}\n rejected={rejected}\n showDescriptions={showDescriptions}\n autoFocus={userOpened}\n showClose={trigger === \"settings\"}\n className={cn(\n \"absolute z-50\",\n variant === \"chip\" ? \"bottom-full left-0 mb-2 w-[22rem]\" : \"inset-x-0 bottom-full mb-2\",\n )}\n />\n ) : null;\n\n const live = (\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {s.announcement}\n </span>\n );\n\n if (variant === \"segmented\" || variant === \"list\") {\n return (\n <div ref={ref} className={cn(\"flex flex-col gap-2\", variant === \"segmented\" && \"items-start\", className)} {...props}>\n {variant === \"segmented\" ? (\n <Md3ModesSegmented modes={modes} value={s.value} onSelect={s.select} label={label} />\n ) : (\n <Md3ModesList\n modes={modes}\n value={s.value}\n onSelect={s.select}\n label={label}\n showDescriptions={showDescriptions}\n className=\"w-full max-w-[30rem]\"\n />\n )}\n {inlineAlert}\n {note}\n {live}\n </div>\n );\n }\n\n if (variant === \"chip\") {\n return (\n <div ref={ref} className={cn(\"relative inline-flex flex-col items-start gap-2\", className)} {...props}>\n {control}\n {picker}\n {note}\n {live}\n </div>\n );\n }\n\n return (\n <div ref={ref} className={cn(\"relative flex w-full max-w-[38rem] flex-col gap-2\", className)} {...props}>\n {picker}\n {note}\n <Md3AgentComposer\n value={draft}\n onValueChange={setDraft}\n onSubmit={(text) => {\n onSubmit?.(text, { mode: s.mode });\n s.dismissNotice();\n if (draftProp === undefined) setInternalDraft(\"\");\n }}\n placeholder={placeholder}\n leftActions={\n trigger === \"settings\" ? (\n <>\n {composerLeading}\n {settings}\n </>\n ) : (\n composerLeading\n )\n }\n rightActions={\n <>\n {trigger === \"chip\" && chip}\n {composerActions}\n </>\n }\n className={cn(\n \"relative gap-2 rounded-md-xl border border-md-outline-variant bg-md-surface px-4 pb-2.5 pt-4 shadow-md-1\",\n )}\n />\n {live}\n </div>\n );\n },\n);\nMd3Modes.displayName = \"Md3Modes\";\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ModeOption, ModesProps, ModesChipProps, ModesListProps, ModesNoteProps, ModesNotice, ModesPickerProps, ModesSegmentedProps, ModesSubmitDetails, ModesTrigger, ModesVariant } from '@nucleux/modes';
|
|
3
|
+
|
|
4
|
+
type Md3ModeOption = ModeOption;
|
|
5
|
+
type Md3ModesNotice = ModesNotice;
|
|
6
|
+
type Md3ModesVariant = ModesVariant;
|
|
7
|
+
type Md3ModesTrigger = ModesTrigger;
|
|
8
|
+
type Md3ModesSubmitDetails = ModesSubmitDetails;
|
|
9
|
+
type Md3ModesProps = ModesProps;
|
|
10
|
+
type Md3ModesSegmentedProps = ModesSegmentedProps;
|
|
11
|
+
type Md3ModesListProps = ModesListProps;
|
|
12
|
+
type Md3ModesChipProps = ModesChipProps;
|
|
13
|
+
type Md3ModesPickerProps = ModesPickerProps;
|
|
14
|
+
type Md3ModesNoteProps = ModesNoteProps;
|
|
15
|
+
/**
|
|
16
|
+
* Material 3 segmented control for Modes: an outlined track of segments, the
|
|
17
|
+
* active one in secondary-container with a check. Same radio group and keyboard
|
|
18
|
+
* model as the shadcn `ModesSegmented` (Arrow keys move, Space/Enter choose).
|
|
19
|
+
*/
|
|
20
|
+
declare const Md3ModesSegmented: React.ForwardRefExoticComponent<ModesSegmentedProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
/**
|
|
22
|
+
* Material 3 mode rows: a 40dp icon tile, the name and one line on what
|
|
23
|
+
* changes; the active row in secondary-container with a primary tile and a
|
|
24
|
+
* trailing check; an unavailable row dimmed with its reason. Same radio group
|
|
25
|
+
* and keyboard model as the shadcn `ModesList`.
|
|
26
|
+
*/
|
|
27
|
+
declare const Md3ModesList: React.ForwardRefExoticComponent<ModesListProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* The Material 3 Mode chip in the composer's settings row. Unset it is an
|
|
30
|
+
* outlined assist chip ("Mode ▾"); set it becomes a tonal chip reading
|
|
31
|
+
* "Mode **Plan**" with the mode's icon, a chevron that turns when open, and a
|
|
32
|
+
* × that clears it. Same accessible names as the shadcn `ModesChip`.
|
|
33
|
+
*/
|
|
34
|
+
declare const Md3ModesChip: React.ForwardRefExoticComponent<ModesChipProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
/**
|
|
36
|
+
* The Material 3 Mode picker: a menu surface with "Mode" and one line on what
|
|
37
|
+
* a mode is, the mode rows, an error-container alert when an unavailable mode
|
|
38
|
+
* was chosen, and a "No mode" text button. A dialog; Escape closes it.
|
|
39
|
+
*/
|
|
40
|
+
declare const Md3ModesPicker: React.ForwardRefExoticComponent<ModesPickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
/** The one quiet line after a change, with a primary sync icon and an Undo text button. */
|
|
42
|
+
declare const Md3ModesNote: React.ForwardRefExoticComponent<ModesNoteProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
/**
|
|
44
|
+
* Material 3 Modes: choose how the agent approaches a request — Brainstorm,
|
|
45
|
+
* Draft, Review, Plan — separate from which model answers. A Mode chip in the
|
|
46
|
+
* composer's settings row opens a short list where each mode says what changes
|
|
47
|
+
* and an unavailable one says why; the chip then reads "Mode Plan" with a way
|
|
48
|
+
* to change or clear it, and a change adds one quiet line with Undo. Same API,
|
|
49
|
+
* states, keyboard model and accessible names as `Modes` from
|
|
50
|
+
* `@nucleux/modes`; choosing a mode never touches the text, and nothing is
|
|
51
|
+
* sent until the person sends.
|
|
52
|
+
*/
|
|
53
|
+
declare const Md3Modes: React.ForwardRefExoticComponent<ModesProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
|
|
55
|
+
export { type Md3ModeOption, Md3Modes, Md3ModesChip, type Md3ModesChipProps, Md3ModesList, type Md3ModesListProps, Md3ModesNote, type Md3ModesNoteProps, type Md3ModesNotice, Md3ModesPicker, type Md3ModesPickerProps, type Md3ModesProps, Md3ModesSegmented, type Md3ModesSegmentedProps, type Md3ModesSubmitDetails, type Md3ModesTrigger, type Md3ModesVariant };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ModeOption, ModesProps, ModesChipProps, ModesListProps, ModesNoteProps, ModesNotice, ModesPickerProps, ModesSegmentedProps, ModesSubmitDetails, ModesTrigger, ModesVariant } from '@nucleux/modes';
|
|
3
|
+
|
|
4
|
+
type Md3ModeOption = ModeOption;
|
|
5
|
+
type Md3ModesNotice = ModesNotice;
|
|
6
|
+
type Md3ModesVariant = ModesVariant;
|
|
7
|
+
type Md3ModesTrigger = ModesTrigger;
|
|
8
|
+
type Md3ModesSubmitDetails = ModesSubmitDetails;
|
|
9
|
+
type Md3ModesProps = ModesProps;
|
|
10
|
+
type Md3ModesSegmentedProps = ModesSegmentedProps;
|
|
11
|
+
type Md3ModesListProps = ModesListProps;
|
|
12
|
+
type Md3ModesChipProps = ModesChipProps;
|
|
13
|
+
type Md3ModesPickerProps = ModesPickerProps;
|
|
14
|
+
type Md3ModesNoteProps = ModesNoteProps;
|
|
15
|
+
/**
|
|
16
|
+
* Material 3 segmented control for Modes: an outlined track of segments, the
|
|
17
|
+
* active one in secondary-container with a check. Same radio group and keyboard
|
|
18
|
+
* model as the shadcn `ModesSegmented` (Arrow keys move, Space/Enter choose).
|
|
19
|
+
*/
|
|
20
|
+
declare const Md3ModesSegmented: React.ForwardRefExoticComponent<ModesSegmentedProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
/**
|
|
22
|
+
* Material 3 mode rows: a 40dp icon tile, the name and one line on what
|
|
23
|
+
* changes; the active row in secondary-container with a primary tile and a
|
|
24
|
+
* trailing check; an unavailable row dimmed with its reason. Same radio group
|
|
25
|
+
* and keyboard model as the shadcn `ModesList`.
|
|
26
|
+
*/
|
|
27
|
+
declare const Md3ModesList: React.ForwardRefExoticComponent<ModesListProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* The Material 3 Mode chip in the composer's settings row. Unset it is an
|
|
30
|
+
* outlined assist chip ("Mode ▾"); set it becomes a tonal chip reading
|
|
31
|
+
* "Mode **Plan**" with the mode's icon, a chevron that turns when open, and a
|
|
32
|
+
* × that clears it. Same accessible names as the shadcn `ModesChip`.
|
|
33
|
+
*/
|
|
34
|
+
declare const Md3ModesChip: React.ForwardRefExoticComponent<ModesChipProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
/**
|
|
36
|
+
* The Material 3 Mode picker: a menu surface with "Mode" and one line on what
|
|
37
|
+
* a mode is, the mode rows, an error-container alert when an unavailable mode
|
|
38
|
+
* was chosen, and a "No mode" text button. A dialog; Escape closes it.
|
|
39
|
+
*/
|
|
40
|
+
declare const Md3ModesPicker: React.ForwardRefExoticComponent<ModesPickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
/** The one quiet line after a change, with a primary sync icon and an Undo text button. */
|
|
42
|
+
declare const Md3ModesNote: React.ForwardRefExoticComponent<ModesNoteProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
/**
|
|
44
|
+
* Material 3 Modes: choose how the agent approaches a request — Brainstorm,
|
|
45
|
+
* Draft, Review, Plan — separate from which model answers. A Mode chip in the
|
|
46
|
+
* composer's settings row opens a short list where each mode says what changes
|
|
47
|
+
* and an unavailable one says why; the chip then reads "Mode Plan" with a way
|
|
48
|
+
* to change or clear it, and a change adds one quiet line with Undo. Same API,
|
|
49
|
+
* states, keyboard model and accessible names as `Modes` from
|
|
50
|
+
* `@nucleux/modes`; choosing a mode never touches the text, and nothing is
|
|
51
|
+
* sent until the person sends.
|
|
52
|
+
*/
|
|
53
|
+
declare const Md3Modes: React.ForwardRefExoticComponent<ModesProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
|
|
55
|
+
export { type Md3ModeOption, Md3Modes, Md3ModesChip, type Md3ModesChipProps, Md3ModesList, type Md3ModesListProps, Md3ModesNote, type Md3ModesNoteProps, type Md3ModesNotice, Md3ModesPicker, type Md3ModesPickerProps, type Md3ModesProps, Md3ModesSegmented, type Md3ModesSegmentedProps, type Md3ModesSubmitDetails, type Md3ModesTrigger, type Md3ModesVariant };
|