@gridui/composer 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,3 +22,12 @@ validated. Applications continue to own request errors and persistence.
22
22
 
23
23
  Attachment removal restores focus only while focus still belongs to that removal.
24
24
  A delayed update preserves focus when the user has already moved to another control.
25
+
26
+ [Component reference](docs/reference/README.md) contains focused API pages for each public component.
27
+
28
+ Composer uses InputGroup for its functional outline. ComposerInput keeps its
29
+ native textarea ref and uses the shared borderless group treatment. Existing
30
+ stacked/inline arrangements, attachment state, submission validation and keyboard
31
+ shortcuts remain Composer-owned. Load Input styles, including its group styles,
32
+ before Composer styles. Automatic height follows Textarea's Baseline 2026 browser
33
+ requirement and supports its maxRows or maxHeight constraints.
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // src/attachment-list/style.ts
2
2
  import { cva } from "class-variance-authority";
3
- var attachmentListStyles = cva("gridui-u-m-0 gridui-u-flex gridui-u-min-w-0 gridui-u-list-none gridui-u-flex-col gridui-u-p-0 gridui-u-focus:min-h-11");
4
- var attachmentStyles = cva("gridui-u-flex gridui-u-min-w-0 gridui-u-flex-wrap gridui-u-items-center gridui-u-gap-gridui-8 gridui-u-border-b gridui-u-border-border gridui-u-py-gridui-8 gridui-u-data-[state=error]:text-danger-foreground");
5
- var attachmentCopyStyles = cva("gridui-u-flex gridui-u-min-w-0 gridui-u-flex-1 gridui-u-flex-col gridui-u-wrap-anywhere");
6
- var attachmentMetaStyles = cva("gridui-u-text-muted gridui-u-type-caption");
3
+ var attachmentListStyles = cva("gridui-u-composer--m-0 gridui-u-composer--flex gridui-u-composer--min-w-0 gridui-u-composer--list-none gridui-u-composer--flex-col gridui-u-composer--p-0 gridui-u-composer--focus:min-h-11");
4
+ var attachmentStyles = cva("gridui-u-composer--flex gridui-u-composer--min-w-0 gridui-u-composer--flex-wrap gridui-u-composer--items-center gridui-u-composer--gap-gridui-8 gridui-u-composer--border-b gridui-u-composer--border-border gridui-u-composer--py-gridui-8 gridui-u-composer--data-[state=error]:text-danger-foreground");
5
+ var attachmentCopyStyles = cva("gridui-u-composer--flex gridui-u-composer--min-w-0 gridui-u-composer--flex-1 gridui-u-composer--flex-col gridui-u-composer--wrap-anywhere");
6
+ var attachmentMetaStyles = cva("gridui-u-composer--text-muted gridui-u-composer--type-caption");
7
7
 
8
8
  // src/attachment-list/attachment-list.tsx
9
9
  import { Button } from "@gridui/button";
@@ -143,11 +143,11 @@ var useComposer = () => {
143
143
 
144
144
  // src/composer/style.ts
145
145
  import { cva as cva2 } from "class-variance-authority";
146
- var composerStyles = cva2("gridui-u-min-w-0 gridui-u-gap-gridui-8 gridui-u-border gridui-u-border-border gridui-u-bg-background gridui-u-p-gridui-16 gridui-u-text-foreground", {
146
+ var composerStyles = cva2("gridui-u-composer--min-w-0 gridui-u-composer--gap-gridui-8 gridui-u-composer--p-gridui-8 gridui-u-composer--text-foreground", {
147
147
  variants: {
148
148
  layout: {
149
- stacked: "gridui-u-flex gridui-u-flex-col",
150
- inline: "gridui-u-grid gridui-u-grid-cols-[minmax(0,1fr)_auto] gridui-u-items-end"
149
+ stacked: "gridui-u-composer--flex gridui-u-composer--flex-col gridui-u-composer--items-stretch",
150
+ inline: "gridui-u-composer--grid gridui-u-composer--grid-cols-[minmax(0,1fr)_auto] gridui-u-composer--items-end"
151
151
  }
152
152
  },
153
153
  defaultVariants: {
@@ -156,6 +156,7 @@ var composerStyles = cva2("gridui-u-min-w-0 gridui-u-gap-gridui-8 gridui-u-borde
156
156
  });
157
157
 
158
158
  // src/composer/composer.tsx
159
+ import { InputGroup } from "@gridui/input";
159
160
  import { cn as cn2 } from "@gridui/style-utils";
160
161
  import { useRef as useRef2 } from "react";
161
162
  import { jsx as jsx2 } from "react/jsx-runtime";
@@ -216,7 +217,7 @@ var Composer = (props) => {
216
217
  submit
217
218
  },
218
219
  children: /* @__PURE__ */ jsx2(
219
- "div",
220
+ InputGroup,
220
221
  {
221
222
  ...restProps,
222
223
  className: cn2(composerStyles({ layout }), className),
@@ -229,7 +230,7 @@ var Composer = (props) => {
229
230
 
230
231
  // src/composer-actions/style.ts
231
232
  import { cva as cva3 } from "class-variance-authority";
232
- var composerActionsStyles = cva3("gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-end gridui-u-gap-gridui-8");
233
+ var composerActionsStyles = cva3("gridui-u-composer--flex gridui-u-composer--flex-wrap gridui-u-composer--items-center gridui-u-composer--justify-end gridui-u-composer--gap-gridui-8");
233
234
 
234
235
  // src/composer-actions/composer-actions.tsx
235
236
  import { cn as cn3 } from "@gridui/style-utils";
@@ -257,8 +258,8 @@ var ComposerAttachments = (props) => {
257
258
  ...restProps,
258
259
  ...onRemove ? { onRemove } : {},
259
260
  className: cn4(
260
- layout === "inline" && "gridui-u-col-span-full",
261
- layout === "inline" && attachments.length === 0 && !onRemove && "gridui-u-hidden",
261
+ layout === "inline" && "gridui-u-composer--col-span-full",
262
+ layout === "inline" && attachments.length === 0 && !onRemove && "gridui-u-composer--hidden",
262
263
  className
263
264
  ),
264
265
  items: attachments,
@@ -291,7 +292,7 @@ import { isComposingKeyEvent } from "@gridui/interaction";
291
292
  import { useRef as useRef3 } from "react";
292
293
  import { jsx as jsx6 } from "react/jsx-runtime";
293
294
  var ComposerInput = (props) => {
294
- const { ref, onKeyDown, onCompositionStart, onCompositionEnd, ...restProps } = props;
295
+ const { ref, onKeyDown, onCompositionStart, onCompositionEnd, maxRows, maxHeight, ...restProps } = props;
295
296
  const { input, value, onValueChange, inputDisabled, readOnly, submit, submitShortcut } = useComposer();
296
297
  const isComposing = useRef3(false);
297
298
  const handleKeyDown = (event) => {
@@ -314,7 +315,10 @@ var ComposerInput = (props) => {
314
315
  Textarea,
315
316
  {
316
317
  autoSize: true,
317
- maxHeight: 240,
318
+ ...maxRows === void 0 ? { maxHeight: maxHeight ?? 240 } : {
319
+ maxRows,
320
+ ...maxHeight === void 0 ? {} : { maxHeight }
321
+ },
318
322
  ...restProps,
319
323
  ref: (element) => {
320
324
  input.current = element;
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/attachment-list/style.ts", "../src/attachment-list/attachment-list.tsx", "../src/shared/composer-context.ts", "../src/composer/style.ts", "../src/composer/composer.tsx", "../src/composer-actions/style.ts", "../src/composer-actions/composer-actions.tsx", "../src/composer-attachments/composer-attachments.tsx", "../src/composer-file-picker/composer-file-picker.tsx", "../src/composer-input/composer-input.tsx", "../src/composer-stop/composer-stop.tsx", "../src/composer-submit/composer-submit.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Composer\n * @namespace AttachmentList\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const attachmentListStyles = cva(\"gridui-u-m-0 gridui-u-flex gridui-u-min-w-0 gridui-u-list-none gridui-u-flex-col gridui-u-p-0 gridui-u-focus:min-h-11\");\n\nexport const attachmentStyles = cva(\"gridui-u-flex gridui-u-min-w-0 gridui-u-flex-wrap gridui-u-items-center gridui-u-gap-gridui-8 gridui-u-border-b gridui-u-border-border gridui-u-py-gridui-8 gridui-u-data-[state=error]:text-danger-foreground\");\n\nexport const attachmentCopyStyles = cva(\"gridui-u-flex gridui-u-min-w-0 gridui-u-flex-1 gridui-u-flex-col gridui-u-wrap-anywhere\");\n\nexport const attachmentMetaStyles = cva(\"gridui-u-text-muted gridui-u-type-caption\");\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace AttachmentList\n * @description Attachment List\n */\n\nimport type { AttachmentListOptions } from \"../shared/types\";\nimport { attachmentCopyStyles, attachmentListStyles, attachmentMetaStyles, attachmentStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type FC, useLayoutEffect, useRef } from \"react\";\n\nexport type AttachmentListProps = AttachmentListOptions;\n\nexport const AttachmentList: FC<AttachmentListProps> = (props: AttachmentListProps) => {\n const {\n items,\n label,\n removeLabel,\n onRemove,\n disabled = false,\n className,\n ref,\n ...restProps\n } = props;\n const buttons = useRef(new Map<string, HTMLButtonElement>());\n const pending = useRef<{\n id: string;\n index: number;\n element: HTMLButtonElement;\n } | null>(null);\n const list = useRef<HTMLUListElement | null>(null);\n useLayoutEffect(() => {\n const removed = pending.current;\n if (removed && !items.some(item => {\n return item.id === removed.id;\n })) {\n const document = removed.element.ownerDocument;\n const active = document.activeElement;\n if (active === removed.element || active === document.body) {\n const next = items[Math.min(removed.index, items.length - 1)];\n (next ? buttons.current.get(next.id) : list.current)?.focus();\n }\n pending.current = null;\n }\n }, [items]);\n return (<ul\n {...restProps}\n ref={element => {\n list.current = element;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n }}\n aria-label={label}\n tabIndex={-1}\n className={cn(attachmentListStyles(), className)}\n >\n {items.map((item, index) => {\n return (<li\n key={item.id}\n className={attachmentStyles()}\n data-state={item.state}\n >\n <div\n className={attachmentCopyStyles()}\n >\n <span>\n {item.name}\n </span>\n <span\n className={attachmentMetaStyles()}\n >\n {item.description}\n </span>\n <span\n className={attachmentMetaStyles()}\n >\n {item.stateLabel}\n </span>\n </div>\n {onRemove && (<Button\n ref={element => {\n if (element) {\n buttons.current.set(item.id, element);\n } else {\n buttons.current.delete(item.id);\n }\n }}\n variant=\"quiet\"\n layout=\"icon\"\n aria-label={removeLabel(item)}\n title={removeLabel(item)}\n disabled={disabled}\n onBlur={event => {\n if (event.relatedTarget && pending.current?.element === event.currentTarget) {\n pending.current = null;\n }\n }}\n onClick={event => {\n pending.current = {\n id: item.id,\n index,\n element: event.currentTarget,\n };\n onRemove(item.id);\n }}\n >\n <span\n aria-hidden=\"true\"\n >\n \u00D7\n </span>\n </Button>)}\n </li>);\n })}\n </ul>);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace Shared\n * @description Composer Context\n */\n\nimport type { AttachmentItem } from \"./types\";\nimport { createContext, type RefObject, useContext } from \"react\";\n\nexport type ComposerContext = {\n readonly attachments: readonly AttachmentItem[];\n readonly layout: \"stacked\" | \"inline\";\n readonly value: string;\n readonly onValueChange: (value: string) => void;\n readonly readOnly: boolean;\n readonly inputDisabled: boolean;\n readonly editingDisabled: boolean;\n readonly disabled: boolean;\n readonly submitShortcut: \"modifier-enter\" | \"enter\";\n readonly canSubmit: boolean;\n readonly showStop: boolean;\n readonly onStop: (() => void) | undefined;\n readonly input: RefObject<HTMLTextAreaElement | null>;\n readonly submitButton: RefObject<HTMLButtonElement | null>;\n readonly submit: () => void;\n};\n\nexport const composerContext = createContext<ComposerContext | null>(null);\n\nexport const useComposer = (): ComposerContext => {\n const composer = useContext(composerContext);\n if (!composer) {\n throw new Error(\"Composer parts require a Composer.\");\n }\n return composer;\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace Composer\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const composerStyles = cva(\"gridui-u-min-w-0 gridui-u-gap-gridui-8 gridui-u-border gridui-u-border-border gridui-u-bg-background gridui-u-p-gridui-16 gridui-u-text-foreground\", {\n variants: {\n layout: {\n stacked: \"gridui-u-flex gridui-u-flex-col\",\n inline: \"gridui-u-grid gridui-u-grid-cols-[minmax(0,1fr)_auto] gridui-u-items-end\",\n },\n },\n defaultVariants: {\n layout: \"stacked\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace Composer\n * @description Composer\n */\n\nimport { composerContext } from \"../shared/composer-context\";\nimport type { AttachmentItem } from \"../shared/types\";\nimport { composerStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, useRef } from \"react\";\n\nexport type ComposerProps = Omit<ComponentPropsWithRef<\"div\">, \"onSubmit\"> & {\n readonly value: string;\n readonly onValueChange: (value: string) => void;\n readonly onSubmit: (value: string) => void;\n readonly onStop?: () => void;\n readonly busy?: boolean;\n readonly editableWhileBusy?: boolean;\n readonly submitWhileBusy?: boolean;\n readonly submitShortcut?: \"modifier-enter\" | \"enter\";\n readonly layout?: \"stacked\" | \"inline\";\n readonly disabled?: boolean;\n readonly readOnly?: boolean;\n readonly attachments?: readonly AttachmentItem[];\n};\n\nexport const Composer: FC<ComposerProps> = (props: ComposerProps) => {\n const { value, onValueChange, onSubmit, onStop, busy = false, editableWhileBusy = false,\n submitWhileBusy = false, submitShortcut = \"modifier-enter\", layout = \"stacked\",\n disabled = false, readOnly = false, attachments = [], children, className, ...restProps } = props;\n const input = useRef<HTMLTextAreaElement>(null);\n const submitButton = useRef<HTMLButtonElement>(null);\n const inputDisabled = disabled || (busy && !editableWhileBusy);\n const editingDisabled = inputDisabled || readOnly;\n const hasContent = value.trim().length > 0 || attachments.length > 0;\n const attachmentsReady = attachments.every(item => {\n return item.state === \"ready\";\n });\n const canSubmit = !disabled && !readOnly && (!busy || submitWhileBusy) && hasContent && attachmentsReady;\n const submit = () => {\n const element = input.current;\n if (!canSubmit || !element || !submitButton.current || submitButton.current.matches(\":disabled\")) {\n return;\n }\n if (element.reportValidity()) {\n onSubmit(value);\n }\n };\n\n return (<composerContext.Provider\n value={{\n attachments,\n layout,\n value,\n onValueChange,\n readOnly,\n inputDisabled,\n editingDisabled,\n disabled,\n submitShortcut,\n canSubmit,\n showStop: busy && !submitWhileBusy,\n onStop,\n input,\n submitButton,\n submit,\n }}\n >\n <div\n {...restProps}\n className={cn(composerStyles({ layout }), className)}\n >\n {children}\n </div>\n </composerContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerActions\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const composerActionsStyles = cva(\"gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-end gridui-u-gap-gridui-8\");\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerActions\n * @description Composer Actions\n */\n\nimport { composerActionsStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ComposerActionsProps = ComponentPropsWithRef<\"div\">;\n\nexport const ComposerActions: FC<ComposerActionsProps> = (props: ComposerActionsProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(composerActionsStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerAttachments\n * @description Composer Attachments\n */\n\nimport { AttachmentList } from \"../attachment-list/attachment-list\";\nimport { useComposer } from \"../shared/composer-context\";\nimport type { AttachmentListOptions } from \"../shared/types\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type ComposerAttachmentsProps = Omit<AttachmentListOptions, \"items\" | \"disabled\">;\n\nexport const ComposerAttachments: FC<ComposerAttachmentsProps> = (props: ComposerAttachmentsProps) => {\n const { attachments, editingDisabled, layout } = useComposer();\n const { className, onRemove, ...restProps } = props;\n return (<AttachmentList\n {...restProps}\n {...(onRemove ? { onRemove } : {})}\n className={cn(\n layout === \"inline\" && \"gridui-u-col-span-full\",\n layout === \"inline\" && attachments.length === 0 && !onRemove && \"gridui-u-hidden\",\n className,\n )}\n items={attachments}\n disabled={editingDisabled}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerFilePicker\n * @description Composer File Picker\n */\n\nimport { useComposer } from \"../shared/composer-context\";\nimport { FilePicker, type FilePickerProps } from \"@gridui/file-picker\";\nimport { type FC, useId } from \"react\";\n\nexport type ComposerFilePickerProps = Omit<Extract<FilePickerProps, {\n multiple: true;\n}>, \"inputId\" | \"multiple\" | \"disabled\">;\n\nexport const ComposerFilePicker: FC<ComposerFilePickerProps> = (props: ComposerFilePickerProps) => {\n const { editingDisabled } = useComposer();\n const inputId = useId();\n return (<FilePicker\n {...props}\n inputId={inputId}\n multiple\n disabled={editingDisabled}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerInput\n * @description Composer Input\n */\n\nimport { useComposer } from \"../shared/composer-context\";\nimport { Textarea, type TextareaProps } from \"@gridui/input\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { type FC, type KeyboardEvent, useRef } from \"react\";\n\nexport type ComposerInputProps = Omit<TextareaProps, \"value\" | \"defaultValue\" | \"onValueChange\" | \"disabled\" | \"readOnly\">;\n\nexport const ComposerInput: FC<ComposerInputProps> = (props: ComposerInputProps) => {\n const { ref, onKeyDown, onCompositionStart, onCompositionEnd, ...restProps } = props;\n const { input, value, onValueChange, inputDisabled, readOnly, submit, submitShortcut } = useComposer();\n const isComposing = useRef(false);\n const handleKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || isComposingKeyEvent(event.nativeEvent) || isComposing.current) {\n return;\n }\n let isSubmitShortcut = false;\n if (submitShortcut === \"enter\") {\n isSubmitShortcut = event.key === \"Enter\" && !event.shiftKey;\n } else {\n isSubmitShortcut = event.key === \"Enter\" && (event.ctrlKey || event.metaKey);\n }\n if (isSubmitShortcut) {\n event.preventDefault();\n submit();\n }\n };\n\n return (<Textarea\n autoSize\n maxHeight={240}\n {...restProps}\n ref={element => {\n input.current = element;\n const cleanup = typeof ref === \"function\" ? ref(element) : undefined;\n if (ref && typeof ref !== \"function\") {\n ref.current = element;\n }\n if (!element) {\n return;\n }\n return () => {\n input.current = null;\n if (typeof cleanup === \"function\") {\n cleanup();\n } else if (typeof ref === \"function\") {\n ref(null);\n } else if (ref) {\n ref.current = null;\n }\n };\n }}\n value={value}\n onValueChange={onValueChange}\n disabled={inputDisabled}\n readOnly={readOnly}\n onCompositionStart={event => {\n isComposing.current = true;\n onCompositionStart?.(event);\n }}\n onCompositionEnd={event => {\n isComposing.current = false;\n onCompositionEnd?.(event);\n }}\n onKeyDown={handleKeyDown}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerStop\n * @description Composer Stop\n */\n\nimport type { ComposerActionOptions } from \"../shared/composer-action-options\";\nimport { useComposer } from \"../shared/composer-context\";\nimport { Button } from \"@gridui/button\";\nimport type { FC } from \"react\";\n\nexport type ComposerStopProps = ComposerActionOptions;\n\nexport const ComposerStop: FC<ComposerStopProps> = (props: ComposerStopProps) => {\n const { disabled, onStop, showStop } = useComposer();\n if (!showStop) {\n return null;\n }\n const appearance = props.variant === undefined || props.variant === null ? {\n ...props,\n variant: \"secondary\" as const,\n } : props;\n return (<Button\n {...appearance}\n type=\"button\"\n disabled={disabled || !onStop}\n onClick={onStop}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerSubmit\n * @description Composer Submit\n */\n\nimport type { ComposerActionOptions } from \"../shared/composer-action-options\";\nimport { useComposer } from \"../shared/composer-context\";\nimport { Button } from \"@gridui/button\";\nimport { type FC, useImperativeHandle } from \"react\";\n\nexport type ComposerSubmitProps = ComposerActionOptions;\n\nexport const ComposerSubmit: FC<ComposerSubmitProps> = (props: ComposerSubmitProps) => {\n const { ref, ...restProps } = props;\n const { canSubmit, showStop, submit, submitButton } = useComposer();\n useImperativeHandle(ref, () => {\n return submitButton.current!;\n });\n if (showStop) {\n return null;\n }\n return (<Button\n {...restProps}\n ref={submitButton}\n type=\"button\"\n disabled={!canSubmit}\n onClick={submit}\n />);\n};\n"],
5
- "mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,uBAAuB,IAAI,uHAAuH;AAExJ,IAAM,mBAAmB,IAAI,gNAAgN;AAE7O,IAAM,uBAAuB,IAAI,yFAAyF;AAE1H,IAAM,uBAAuB,IAAI,2CAA2C;;;ACNnF,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAkB,iBAAiB,cAAc;AAyDjC,SAGI,KAHJ;AArDT,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,QAAM,UAAU,OAAO,oBAAI,IAA+B,C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AA,QACJ;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV;AAAA,MACA,oBAAoB,WAAS;AACzB,oBAAY,UAAU;AACtB,6BAAqB,KAAK;AAAA,MAC9B;AAAA,MACA,kBAAkB,WAAS;AACvB,oBAAY,UAAU;AACtB,2BAAmB,KAAK;AAAA,MAC5B;AAAA,MACA,WAAW;AAAA;AAAA,EACf;AACJ;;;AChEA,SAAS,UAAAC,eAAc;AAcX,gBAAAC,YAAA;AATL,IAAM,eAAsC,CAAC,UAA6B;AAC7E,QAAM,EAAE,UAAU,QAAQ,SAAS,IAAI,YAAY;AACnD,MAAI,CAAC,UAAU;AACX,WAAO;AAAA,EACX;AACA,QAAM,aAAa,MAAM,YAAY,UAAa,MAAM,YAAY,OAAO;AAAA,IACvE,GAAG;AAAA,IACH,SAAS;AAAA,EACb,IAAI;AACJ,SAAQ,gBAAAA;AAAA,IAACD;AAAA,IAAA;AAAA,MACJ,GAAG;AAAA,MACJ,MAAK;AAAA,MACL,UAAU,YAAY,CAAC;AAAA,MACvB,SAAS;AAAA;AAAA,EACb;AACJ;;;ACpBA,SAAS,UAAAE,eAAc;AACvB,SAAkB,2BAA2B;AAajC,gBAAAC,YAAA;AATL,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM,EAAE,KAAK,GAAG,UAAU,IAAI;AAC9B,QAAM,EAAE,WAAW,UAAU,QAAQ,aAAa,IAAI,YAAY;AAClE,sBAAoB,KAAK,MAAM;AAC3B,WAAO,aAAa;AAAA,EACxB,CAAC;AACD,MAAI,UAAU;AACV,WAAO;AAAA,EACX;AACA,SAAQ,gBAAAA;AAAA,IAACD;AAAA,IAAA;AAAA,MACJ,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,MAAK;AAAA,MACL,UAAU,CAAC;AAAA,MACX,SAAS;AAAA;AAAA,EACb;AACJ;",
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Composer\n * @namespace AttachmentList\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const attachmentListStyles = cva(\"gridui-u-composer--m-0 gridui-u-composer--flex gridui-u-composer--min-w-0 gridui-u-composer--list-none gridui-u-composer--flex-col gridui-u-composer--p-0 gridui-u-composer--focus:min-h-11\");\n\nexport const attachmentStyles = cva(\"gridui-u-composer--flex gridui-u-composer--min-w-0 gridui-u-composer--flex-wrap gridui-u-composer--items-center gridui-u-composer--gap-gridui-8 gridui-u-composer--border-b gridui-u-composer--border-border gridui-u-composer--py-gridui-8 gridui-u-composer--data-[state=error]:text-danger-foreground\");\n\nexport const attachmentCopyStyles = cva(\"gridui-u-composer--flex gridui-u-composer--min-w-0 gridui-u-composer--flex-1 gridui-u-composer--flex-col gridui-u-composer--wrap-anywhere\");\n\nexport const attachmentMetaStyles = cva(\"gridui-u-composer--text-muted gridui-u-composer--type-caption\");\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace AttachmentList\n * @description Attachment List\n */\n\nimport type { AttachmentListOptions } from \"../shared/types\";\nimport { attachmentCopyStyles, attachmentListStyles, attachmentMetaStyles, attachmentStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type FC, useLayoutEffect, useRef } from \"react\";\n\nexport type AttachmentListProps = AttachmentListOptions;\n\nexport const AttachmentList: FC<AttachmentListProps> = (props: AttachmentListProps) => {\n const {\n items,\n label,\n removeLabel,\n onRemove,\n disabled = false,\n className,\n ref,\n ...restProps\n } = props;\n const buttons = useRef(new Map<string, HTMLButtonElement>());\n const pending = useRef<{\n id: string;\n index: number;\n element: HTMLButtonElement;\n } | null>(null);\n const list = useRef<HTMLUListElement | null>(null);\n useLayoutEffect(() => {\n const removed = pending.current;\n if (removed && !items.some(item => {\n return item.id === removed.id;\n })) {\n const document = removed.element.ownerDocument;\n const active = document.activeElement;\n if (active === removed.element || active === document.body) {\n const next = items[Math.min(removed.index, items.length - 1)];\n (next ? buttons.current.get(next.id) : list.current)?.focus();\n }\n pending.current = null;\n }\n }, [items]);\n return (<ul\n {...restProps}\n ref={element => {\n list.current = element;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n }}\n aria-label={label}\n tabIndex={-1}\n className={cn(attachmentListStyles(), className)}\n >\n {items.map((item, index) => {\n return (<li\n key={item.id}\n className={attachmentStyles()}\n data-state={item.state}\n >\n <div\n className={attachmentCopyStyles()}\n >\n <span>\n {item.name}\n </span>\n <span\n className={attachmentMetaStyles()}\n >\n {item.description}\n </span>\n <span\n className={attachmentMetaStyles()}\n >\n {item.stateLabel}\n </span>\n </div>\n {onRemove && (<Button\n ref={element => {\n if (element) {\n buttons.current.set(item.id, element);\n } else {\n buttons.current.delete(item.id);\n }\n }}\n variant=\"quiet\"\n layout=\"icon\"\n aria-label={removeLabel(item)}\n title={removeLabel(item)}\n disabled={disabled}\n onBlur={event => {\n if (event.relatedTarget && pending.current?.element === event.currentTarget) {\n pending.current = null;\n }\n }}\n onClick={event => {\n pending.current = {\n id: item.id,\n index,\n element: event.currentTarget,\n };\n onRemove(item.id);\n }}\n >\n <span\n aria-hidden=\"true\"\n >\n \u00D7\n </span>\n </Button>)}\n </li>);\n })}\n </ul>);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace Shared\n * @description Composer Context\n */\n\nimport type { AttachmentItem } from \"./types\";\nimport { createContext, type RefObject, useContext } from \"react\";\n\nexport type ComposerContext = {\n readonly attachments: readonly AttachmentItem[];\n readonly layout: \"stacked\" | \"inline\";\n readonly value: string;\n readonly onValueChange: (value: string) => void;\n readonly readOnly: boolean;\n readonly inputDisabled: boolean;\n readonly editingDisabled: boolean;\n readonly disabled: boolean;\n readonly submitShortcut: \"modifier-enter\" | \"enter\";\n readonly canSubmit: boolean;\n readonly showStop: boolean;\n readonly onStop: (() => void) | undefined;\n readonly input: RefObject<HTMLTextAreaElement | null>;\n readonly submitButton: RefObject<HTMLButtonElement | null>;\n readonly submit: () => void;\n};\n\nexport const composerContext = createContext<ComposerContext | null>(null);\n\nexport const useComposer = (): ComposerContext => {\n const composer = useContext(composerContext);\n if (!composer) {\n throw new Error(\"Composer parts require a Composer.\");\n }\n return composer;\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace Composer\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const composerStyles = cva(\"gridui-u-composer--min-w-0 gridui-u-composer--gap-gridui-8 gridui-u-composer--p-gridui-8 gridui-u-composer--text-foreground\", {\n variants: {\n layout: {\n stacked: \"gridui-u-composer--flex gridui-u-composer--flex-col gridui-u-composer--items-stretch\",\n inline: \"gridui-u-composer--grid gridui-u-composer--grid-cols-[minmax(0,1fr)_auto] gridui-u-composer--items-end\",\n },\n },\n defaultVariants: {\n layout: \"stacked\",\n },\n});\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace Composer\n * @description Composer\n */\n\nimport { composerContext } from \"../shared/composer-context\";\nimport type { AttachmentItem } from \"../shared/types\";\nimport { composerStyles } from \"./style\";\nimport { InputGroup } from \"@gridui/input\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, useRef } from \"react\";\n\nexport type ComposerProps = Omit<ComponentPropsWithRef<\"div\">, \"onSubmit\"> & {\n readonly value: string;\n readonly onValueChange: (value: string) => void;\n readonly onSubmit: (value: string) => void;\n readonly onStop?: () => void;\n readonly busy?: boolean;\n readonly editableWhileBusy?: boolean;\n readonly submitWhileBusy?: boolean;\n readonly submitShortcut?: \"modifier-enter\" | \"enter\";\n readonly layout?: \"stacked\" | \"inline\";\n readonly disabled?: boolean;\n readonly readOnly?: boolean;\n readonly attachments?: readonly AttachmentItem[];\n};\n\nexport const Composer: FC<ComposerProps> = (props: ComposerProps) => {\n const { value, onValueChange, onSubmit, onStop, busy = false, editableWhileBusy = false,\n submitWhileBusy = false, submitShortcut = \"modifier-enter\", layout = \"stacked\",\n disabled = false, readOnly = false, attachments = [], children, className, ...restProps } = props;\n const input = useRef<HTMLTextAreaElement>(null);\n const submitButton = useRef<HTMLButtonElement>(null);\n const inputDisabled = disabled || (busy && !editableWhileBusy);\n const editingDisabled = inputDisabled || readOnly;\n const hasContent = value.trim().length > 0 || attachments.length > 0;\n const attachmentsReady = attachments.every(item => {\n return item.state === \"ready\";\n });\n const canSubmit = !disabled && !readOnly && (!busy || submitWhileBusy) && hasContent && attachmentsReady;\n const submit = () => {\n const element = input.current;\n if (!canSubmit || !element || !submitButton.current || submitButton.current.matches(\":disabled\")) {\n return;\n }\n if (element.reportValidity()) {\n onSubmit(value);\n }\n };\n\n return (<composerContext.Provider\n value={{\n attachments,\n layout,\n value,\n onValueChange,\n readOnly,\n inputDisabled,\n editingDisabled,\n disabled,\n submitShortcut,\n canSubmit,\n showStop: busy && !submitWhileBusy,\n onStop,\n input,\n submitButton,\n submit,\n }}\n >\n <InputGroup\n {...restProps}\n className={cn(composerStyles({ layout }), className)}\n >\n {children}\n </InputGroup>\n </composerContext.Provider>);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerActions\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const composerActionsStyles = cva(\"gridui-u-composer--flex gridui-u-composer--flex-wrap gridui-u-composer--items-center gridui-u-composer--justify-end gridui-u-composer--gap-gridui-8\");\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerActions\n * @description Composer Actions\n */\n\nimport { composerActionsStyles } from \"./style\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ComposerActionsProps = ComponentPropsWithRef<\"div\">;\n\nexport const ComposerActions: FC<ComposerActionsProps> = (props: ComposerActionsProps) => {\n const { className, ...restProps } = props;\n return (<div\n {...restProps}\n className={cn(composerActionsStyles(), className)}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerAttachments\n * @description Composer Attachments\n */\n\nimport { AttachmentList } from \"../attachment-list/attachment-list\";\nimport { useComposer } from \"../shared/composer-context\";\nimport type { AttachmentListOptions } from \"../shared/types\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { FC } from \"react\";\n\nexport type ComposerAttachmentsProps = Omit<AttachmentListOptions, \"items\" | \"disabled\">;\n\nexport const ComposerAttachments: FC<ComposerAttachmentsProps> = (props: ComposerAttachmentsProps) => {\n const { attachments, editingDisabled, layout } = useComposer();\n const { className, onRemove, ...restProps } = props;\n return (<AttachmentList\n {...restProps}\n {...(onRemove ? { onRemove } : {})}\n className={cn(\n layout === \"inline\" && \"gridui-u-composer--col-span-full\",\n layout === \"inline\" && attachments.length === 0 && !onRemove && \"gridui-u-composer--hidden\",\n className,\n )}\n items={attachments}\n disabled={editingDisabled}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerFilePicker\n * @description Composer File Picker\n */\n\nimport { useComposer } from \"../shared/composer-context\";\nimport { FilePicker, type FilePickerProps } from \"@gridui/file-picker\";\nimport { type FC, useId } from \"react\";\n\nexport type ComposerFilePickerProps = Omit<Extract<FilePickerProps, {\n multiple: true;\n}>, \"inputId\" | \"multiple\" | \"disabled\">;\n\nexport const ComposerFilePicker: FC<ComposerFilePickerProps> = (props: ComposerFilePickerProps) => {\n const { editingDisabled } = useComposer();\n const inputId = useId();\n return (<FilePicker\n {...props}\n inputId={inputId}\n multiple\n disabled={editingDisabled}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerInput\n * @description Composer Input\n */\n\nimport { useComposer } from \"../shared/composer-context\";\nimport { Textarea, type TextareaProps } from \"@gridui/input\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { type FC, type KeyboardEvent, useRef } from \"react\";\n\nexport type ComposerInputProps = Omit<TextareaProps, \"value\" | \"defaultValue\" | \"onValueChange\" | \"disabled\" | \"readOnly\">;\n\nexport const ComposerInput: FC<ComposerInputProps> = (props: ComposerInputProps) => {\n const { ref, onKeyDown, onCompositionStart, onCompositionEnd, maxRows, maxHeight, ...restProps } = props;\n const { input, value, onValueChange, inputDisabled, readOnly, submit, submitShortcut } = useComposer();\n const isComposing = useRef(false);\n const handleKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || isComposingKeyEvent(event.nativeEvent) || isComposing.current) {\n return;\n }\n let isSubmitShortcut = false;\n if (submitShortcut === \"enter\") {\n isSubmitShortcut = event.key === \"Enter\" && !event.shiftKey;\n } else {\n isSubmitShortcut = event.key === \"Enter\" && (event.ctrlKey || event.metaKey);\n }\n if (isSubmitShortcut) {\n event.preventDefault();\n submit();\n }\n };\n\n return (<Textarea\n autoSize\n {...(maxRows === undefined ? { maxHeight: maxHeight ?? 240 } : {\n maxRows,\n ...(maxHeight === undefined ? {} : { maxHeight }),\n })}\n {...restProps}\n ref={element => {\n input.current = element;\n const cleanup = typeof ref === \"function\" ? ref(element) : undefined;\n if (ref && typeof ref !== \"function\") {\n ref.current = element;\n }\n if (!element) {\n return;\n }\n return () => {\n input.current = null;\n if (typeof cleanup === \"function\") {\n cleanup();\n } else if (typeof ref === \"function\") {\n ref(null);\n } else if (ref) {\n ref.current = null;\n }\n };\n }}\n value={value}\n onValueChange={onValueChange}\n disabled={inputDisabled}\n readOnly={readOnly}\n onCompositionStart={event => {\n isComposing.current = true;\n onCompositionStart?.(event);\n }}\n onCompositionEnd={event => {\n isComposing.current = false;\n onCompositionEnd?.(event);\n }}\n onKeyDown={handleKeyDown}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerStop\n * @description Composer Stop\n */\n\nimport type { ComposerActionOptions } from \"../shared/composer-action-options\";\nimport { useComposer } from \"../shared/composer-context\";\nimport { Button } from \"@gridui/button\";\nimport type { FC } from \"react\";\n\nexport type ComposerStopProps = ComposerActionOptions;\n\nexport const ComposerStop: FC<ComposerStopProps> = (props: ComposerStopProps) => {\n const { disabled, onStop, showStop } = useComposer();\n if (!showStop) {\n return null;\n }\n const appearance = props.variant === undefined || props.variant === null ? {\n ...props,\n variant: \"secondary\" as const,\n } : props;\n return (<Button\n {...appearance}\n type=\"button\"\n disabled={disabled || !onStop}\n onClick={onStop}\n />);\n};\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace ComposerSubmit\n * @description Composer Submit\n */\n\nimport type { ComposerActionOptions } from \"../shared/composer-action-options\";\nimport { useComposer } from \"../shared/composer-context\";\nimport { Button } from \"@gridui/button\";\nimport { type FC, useImperativeHandle } from \"react\";\n\nexport type ComposerSubmitProps = ComposerActionOptions;\n\nexport const ComposerSubmit: FC<ComposerSubmitProps> = (props: ComposerSubmitProps) => {\n const { ref, ...restProps } = props;\n const { canSubmit, showStop, submit, submitButton } = useComposer();\n useImperativeHandle(ref, () => {\n return submitButton.current!;\n });\n if (showStop) {\n return null;\n }\n return (<Button\n {...restProps}\n ref={submitButton}\n type=\"button\"\n disabled={!canSubmit}\n onClick={submit}\n />);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,uBAAuB,IAAI,6LAA6L;AAE9N,IAAM,mBAAmB,IAAI,0SAA0S;AAEvU,IAAM,uBAAuB,IAAI,2IAA2I;AAE5K,IAAM,uBAAuB,IAAI,+DAA+D;;;ACNvG,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAkB,iBAAiB,cAAc;AAyDjC,SAGI,KAHJ;AArDT,IAAM,iBAA0C,CAAC,UAA+B;AACnF,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,QAAM,UAAU,OAAO,oBAAI,IAA+B,CAAC;AAC3D,QAAM,UAAU,OAIN,IAAI;AACd,QAAM,OAAO,OAAgC,IAAI;AACjD,kBAAgB,MAAM;AAClB,UAAM,UAAU,QAAQ;AACxB,QAAI,WAAW,CAAC,MAAM,KAAK,UAAQ;AAC/B,aAAO,KAAK,OAAO,QAAQ;AAAA,IAC/B,CAAC,G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css CHANGED
@@ -7,91 +7,87 @@
7
7
  }
8
8
  }
9
9
  @layer utilities {
10
- .gridui-u-col-span-full {
10
+ .gridui-u-composer--col-span-full {
11
11
  grid-column: 1 / -1;
12
12
  }
13
- .gridui-u-m-0 {
13
+ .gridui-u-composer--m-0 {
14
14
  margin: 0px;
15
15
  }
16
- .gridui-u-flex {
16
+ .gridui-u-composer--flex {
17
17
  display: flex;
18
18
  }
19
- .gridui-u-grid {
19
+ .gridui-u-composer--grid {
20
20
  display: grid;
21
21
  }
22
- .gridui-u-hidden {
22
+ .gridui-u-composer--hidden {
23
23
  display: none;
24
24
  }
25
- .gridui-u-min-w-0 {
25
+ .gridui-u-composer--min-w-0 {
26
26
  min-width: 0px;
27
27
  }
28
- .gridui-u-flex-1 {
28
+ .gridui-u-composer--flex-1 {
29
29
  flex: 1;
30
30
  }
31
- .gridui-u-list-none {
31
+ .gridui-u-composer--list-none {
32
32
  list-style-type: none;
33
33
  }
34
- .gridui-u-grid-cols-\[minmax\(0\,1fr\)_auto\] {
34
+ .gridui-u-composer--grid-cols-\[minmax\(0\,1fr\)_auto\] {
35
35
  grid-template-columns: minmax(0,1fr) auto;
36
36
  }
37
- .gridui-u-flex-col {
37
+ .gridui-u-composer--flex-col {
38
38
  flex-direction: column;
39
39
  }
40
- .gridui-u-flex-wrap {
40
+ .gridui-u-composer--flex-wrap {
41
41
  flex-wrap: wrap;
42
42
  }
43
- .gridui-u-items-center {
43
+ .gridui-u-composer--items-center {
44
44
  align-items: center;
45
45
  }
46
- .gridui-u-items-end {
46
+ .gridui-u-composer--items-end {
47
47
  align-items: flex-end;
48
48
  }
49
- .gridui-u-justify-end {
49
+ .gridui-u-composer--items-stretch {
50
+ align-items: stretch;
51
+ }
52
+ .gridui-u-composer--justify-end {
50
53
  justify-content: flex-end;
51
54
  }
52
- .gridui-u-gap-gridui-8 {
55
+ .gridui-u-composer--gap-gridui-8 {
53
56
  gap: var(--gridui-space-8);
54
57
  }
55
- .gridui-u-border {
56
- border-style: var(--tw-border-style);
57
- border-width: 1px;
58
- }
59
- .gridui-u-border-b {
58
+ .gridui-u-composer--border-b {
60
59
  border-bottom-style: var(--tw-border-style);
61
60
  border-bottom-width: 1px;
62
61
  }
63
- .gridui-u-border-border {
62
+ .gridui-u-composer--border-border {
64
63
  border-color: var(--gridui-border);
65
64
  }
66
- .gridui-u-bg-background {
67
- background-color: var(--gridui-background);
68
- }
69
- .gridui-u-p-0 {
65
+ .gridui-u-composer--p-0 {
70
66
  padding: 0px;
71
67
  }
72
- .gridui-u-p-gridui-16 {
73
- padding: var(--gridui-space-16);
68
+ .gridui-u-composer--p-gridui-8 {
69
+ padding: var(--gridui-space-8);
74
70
  }
75
- .gridui-u-py-gridui-8 {
71
+ .gridui-u-composer--py-gridui-8 {
76
72
  padding-block: var(--gridui-space-8);
77
73
  }
78
- .gridui-u-type-caption {
74
+ .gridui-u-composer--type-caption {
79
75
  font: var(--gridui-type-caption);
80
76
  letter-spacing: normal;
81
77
  }
82
- .gridui-u-wrap-anywhere {
78
+ .gridui-u-composer--wrap-anywhere {
83
79
  overflow-wrap: anywhere;
84
80
  }
85
- .gridui-u-text-foreground {
81
+ .gridui-u-composer--text-foreground {
86
82
  color: var(--gridui-foreground);
87
83
  }
88
- .gridui-u-text-muted {
84
+ .gridui-u-composer--text-muted {
89
85
  color: var(--gridui-muted);
90
86
  }
91
- .gridui-u-focus\:min-h-11:focus {
87
+ .gridui-u-composer--focus\:min-h-11:focus {
92
88
  min-height: calc(var(--spacing) * 11);
93
89
  }
94
- .gridui-u-data-\[state\=error\]\:text-danger-foreground[data-state="error"] {
90
+ .gridui-u-composer--data-\[state\=error\]\:text-danger-foreground[data-state="error"] {
95
91
  color: var(--gridui-danger-foreground);
96
92
  }
97
93
  }
package/docs/catalog.json CHANGED
@@ -1,12 +1,21 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/composer",
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "category": "dashboard",
6
6
  "description": "GridUI React composer",
7
7
  "usage": "Button and keyboard submission share the textarea's native constraint validation, including `required`, `minLength`, and custom validity. Invalid enabled inputs report their validation message and retain focus. Textarea and submit button refs are forwarded through their respective props. A disabled fieldset blocks both submission paths.",
8
8
  "documentation": [
9
- "README.md"
9
+ "README.md",
10
+ "docs/reference/README.md",
11
+ "docs/reference/attachment-list.md",
12
+ "docs/reference/composer-actions.md",
13
+ "docs/reference/composer-attachments.md",
14
+ "docs/reference/composer-file-picker.md",
15
+ "docs/reference/composer-input.md",
16
+ "docs/reference/composer-stop.md",
17
+ "docs/reference/composer-submit.md",
18
+ "docs/reference/composer.md"
10
19
  ],
11
20
  "exports": [
12
21
  {
@@ -0,0 +1,11 @@
1
+ <!-- Generated by pnpm docs:storybook. -->
2
+ # Component reference
3
+
4
+ - [AttachmentList](attachment-list.md)
5
+ - [Composer](composer.md)
6
+ - [ComposerActions](composer-actions.md)
7
+ - [ComposerAttachments](composer-attachments.md)
8
+ - [ComposerFilePicker](composer-file-picker.md)
9
+ - [ComposerInput](composer-input.md)
10
+ - [ComposerStop](composer-stop.md)
11
+ - [ComposerSubmit](composer-submit.md)
@@ -0,0 +1,75 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # AttachmentList
3
+
4
+ Public AttachmentList component from @gridui/composer. See the package guide for its composition contract.
5
+
6
+ Import from ``@gridui/composer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { AttachmentList } from "@gridui/composer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/composer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ ## API
17
+
18
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
19
+
20
+ ### onFocus
21
+
22
+ ``(event: FocusEvent<HTMLUListElement, Element>): void`` · Optional
23
+
24
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
25
+
26
+ ### onBlur
27
+
28
+ ``(event: FocusEvent<HTMLUListElement, Element>): void`` · Optional
29
+
30
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
31
+
32
+ ### onChange
33
+
34
+ ``(event: ChangeEvent<HTMLUListElement, Element>): void`` · Optional
35
+
36
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
37
+
38
+ ### onSubmit
39
+
40
+ ``(event: SubmitEvent<HTMLUListElement>): void`` · Optional
41
+
42
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
43
+
44
+ ### onClick
45
+
46
+ ``(event: MouseEvent<HTMLUListElement, MouseEvent>): void`` · Optional
47
+
48
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
49
+
50
+ ### items
51
+
52
+ ``readonly AttachmentItem[]`` · Required
53
+
54
+ ### label
55
+
56
+ ``string`` · Required
57
+
58
+ ### removeLabel
59
+
60
+ ``(item: AttachmentItem) => string`` · Required
61
+
62
+ ### onRemove
63
+
64
+ ``(id: string): void`` · Optional
65
+
66
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
67
+
68
+ ### disabled
69
+
70
+ ``boolean | undefined`` · Optional
71
+
72
+ Default: ``false``
73
+
74
+ Prevents interaction when enabled.
75
+
@@ -0,0 +1,57 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ComposerActions
3
+
4
+ Compose ComposerActions with Composer inside the same @gridui/composer component family.
5
+
6
+ Import from ``@gridui/composer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ComposerActions } from "@gridui/composer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/composer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/stories/composer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
@@ -0,0 +1,65 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ComposerAttachments
3
+
4
+ Compose ComposerAttachments with Composer inside the same @gridui/composer component family.
5
+
6
+ Import from ``@gridui/composer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ComposerAttachments } from "@gridui/composer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/composer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/stories/composer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### label
23
+
24
+ ``string`` · Required
25
+
26
+ ### onFocus
27
+
28
+ ``(event: FocusEvent<HTMLUListElement, Element>): void`` · Optional
29
+
30
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
31
+
32
+ ### onBlur
33
+
34
+ ``(event: FocusEvent<HTMLUListElement, Element>): void`` · Optional
35
+
36
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
37
+
38
+ ### onChange
39
+
40
+ ``(event: ChangeEvent<HTMLUListElement, Element>): void`` · Optional
41
+
42
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
43
+
44
+ ### onSubmit
45
+
46
+ ``(event: SubmitEvent<HTMLUListElement>): void`` · Optional
47
+
48
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
49
+
50
+ ### onClick
51
+
52
+ ``(event: MouseEvent<HTMLUListElement, MouseEvent>): void`` · Optional
53
+
54
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
55
+
56
+ ### removeLabel
57
+
58
+ ``(item: AttachmentItem) => string`` · Required
59
+
60
+ ### onRemove
61
+
62
+ ``(id: string): void`` · Optional
63
+
64
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
65
+
@@ -0,0 +1,101 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ComposerFilePicker
3
+
4
+ Compose ComposerFilePicker with Composer inside the same @gridui/composer component family.
5
+
6
+ Import from ``@gridui/composer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ComposerFilePicker } from "@gridui/composer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/composer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/stories/composer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### label
23
+
24
+ ``ReactNode`` · Required
25
+
26
+ ### icon
27
+
28
+ ``ReactNode`` · Optional
29
+
30
+ ### hint
31
+
32
+ ``ReactNode`` · Optional
33
+
34
+ ### onFocus
35
+
36
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onBlur
41
+
42
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### appearance
59
+
60
+ ``"standard" | "panel" | undefined`` · Optional
61
+
62
+ ### droppingLabel
63
+
64
+ ``ReactNode`` · Optional
65
+
66
+ ### accept
67
+
68
+ ``string`` · Required
69
+
70
+ ### confirmSelection
71
+
72
+ ``string | undefined`` · Optional
73
+
74
+ ### onFileError
75
+
76
+ ``(error: unknown): void`` · Optional
77
+
78
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
79
+
80
+ ### action
81
+
82
+ ``ReactNode`` · Optional
83
+
84
+ ### hintId
85
+
86
+ ``string | undefined`` · Optional
87
+
88
+ ### drop
89
+
90
+ ``boolean | undefined`` · Optional
91
+
92
+ ### onFiles
93
+
94
+ ``(files: readonly File[]): void | Promise<void>`` · Required
95
+
96
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
97
+
98
+ ### onFile
99
+
100
+ ``undefined`` · Optional
101
+
@@ -0,0 +1,73 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ComposerInput
3
+
4
+ Compose ComposerInput with Composer inside the same @gridui/composer component family.
5
+
6
+ Import from ``@gridui/composer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ComposerInput } from "@gridui/composer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/composer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/stories/composer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLTextAreaElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLTextAreaElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLTextAreaElement, HTMLTextAreaElement>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLTextAreaElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLTextAreaElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
58
+ ### controlSize
59
+
60
+ ``"small" | "standard" | undefined`` · Optional
61
+
62
+ ### autoSize
63
+
64
+ ``boolean | undefined`` · Optional
65
+
66
+ ### maxHeight
67
+
68
+ ``number | undefined`` · Optional
69
+
70
+ ### maxRows
71
+
72
+ ``number | undefined`` · Optional
73
+
@@ -0,0 +1,89 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ComposerStop
3
+
4
+ Compose ComposerStop with Composer inside the same @gridui/composer component family.
5
+
6
+ Import from ``@gridui/composer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ComposerStop } from "@gridui/composer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/composer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/stories/composer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### variant
29
+
30
+ ``"text" | "primary" | "secondary" | "quiet" | "highlight" | "underlined" | null | undefined`` · Optional
31
+
32
+ Visual variant.
33
+
34
+ ### size
35
+
36
+ ``"small" | "standard" | "large" | "extra-large" | null | undefined`` · Optional
37
+
38
+ Component size preset.
39
+
40
+ ### layout
41
+
42
+ ``"cell" | "standard" | "icon" | "entry" | "rail" | "divided" | null | undefined`` · Optional
43
+
44
+ Layout within the containing region.
45
+
46
+ ### iconMotion
47
+
48
+ ``"none" | "outward" | null | undefined`` · Optional
49
+
50
+ ### onFocus
51
+
52
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
53
+
54
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
55
+
56
+ ### onBlur
57
+
58
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
59
+
60
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
61
+
62
+ ### onChange
63
+
64
+ ``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
65
+
66
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
67
+
68
+ ### onSubmit
69
+
70
+ ``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
71
+
72
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
73
+
74
+ ### startIcon
75
+
76
+ ``ReactNode`` · Optional
77
+
78
+ ### startIconLayout
79
+
80
+ ``"divided" | "inline" | undefined`` · Optional
81
+
82
+ ### startIconSize
83
+
84
+ ``"standard" | "large" | "extra-large" | undefined`` · Optional
85
+
86
+ ### endIcon
87
+
88
+ ``ReactNode`` · Optional
89
+
@@ -0,0 +1,89 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ComposerSubmit
3
+
4
+ Compose ComposerSubmit with Composer inside the same @gridui/composer component family.
5
+
6
+ Import from ``@gridui/composer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ComposerSubmit } from "@gridui/composer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/composer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/stories/composer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### variant
29
+
30
+ ``"text" | "primary" | "secondary" | "quiet" | "highlight" | "underlined" | null | undefined`` · Optional
31
+
32
+ Visual variant.
33
+
34
+ ### size
35
+
36
+ ``"small" | "standard" | "large" | "extra-large" | null | undefined`` · Optional
37
+
38
+ Component size preset.
39
+
40
+ ### layout
41
+
42
+ ``"cell" | "standard" | "icon" | "entry" | "rail" | "divided" | null | undefined`` · Optional
43
+
44
+ Layout within the containing region.
45
+
46
+ ### iconMotion
47
+
48
+ ``"none" | "outward" | null | undefined`` · Optional
49
+
50
+ ### onFocus
51
+
52
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
53
+
54
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
55
+
56
+ ### onBlur
57
+
58
+ ``(event: FocusEvent<HTMLButtonElement, Element>): void`` · Optional
59
+
60
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
61
+
62
+ ### onChange
63
+
64
+ ``(event: ChangeEvent<HTMLButtonElement, Element>): void`` · Optional
65
+
66
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
67
+
68
+ ### onSubmit
69
+
70
+ ``(event: SubmitEvent<HTMLButtonElement>): void`` · Optional
71
+
72
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
73
+
74
+ ### startIcon
75
+
76
+ ``ReactNode`` · Optional
77
+
78
+ ### startIconLayout
79
+
80
+ ``"divided" | "inline" | undefined`` · Optional
81
+
82
+ ### startIconSize
83
+
84
+ ``"standard" | "large" | "extra-large" | undefined`` · Optional
85
+
86
+ ### endIcon
87
+
88
+ ``ReactNode`` · Optional
89
+
@@ -0,0 +1,129 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # Composer
3
+
4
+ Combines message entry, attachments, and submission controls. Use it for chat, comments, or other composed messages.
5
+
6
+ Import from ``@gridui/composer`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { Composer } from "@gridui/composer";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/composer/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/composer/stories/composer.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onClick
47
+
48
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### value
53
+
54
+ ``string`` · Required
55
+
56
+ Controlled value. Pair with the corresponding change callback.
57
+
58
+ ### onValueChange
59
+
60
+ ``(value: string): void`` · Required
61
+
62
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
63
+
64
+ ### onSubmit
65
+
66
+ ``(value: string): void`` · Required
67
+
68
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
69
+
70
+ ### onStop
71
+
72
+ ``(): void`` · Optional
73
+
74
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
75
+
76
+ ### busy
77
+
78
+ ``boolean | undefined`` · Optional
79
+
80
+ Default: ``false``
81
+
82
+ ### editableWhileBusy
83
+
84
+ ``boolean | undefined`` · Optional
85
+
86
+ Default: ``false``
87
+
88
+ ### submitWhileBusy
89
+
90
+ ``boolean | undefined`` · Optional
91
+
92
+ Default: ``false``
93
+
94
+ ### submitShortcut
95
+
96
+ ``"enter" | "modifier-enter" | undefined`` · Optional
97
+
98
+ Default: ``"modifier-enter"``
99
+
100
+ ### layout
101
+
102
+ ``"inline" | "stacked" | undefined`` · Optional
103
+
104
+ Default: ``"stacked"``
105
+
106
+ Layout within the containing region.
107
+
108
+ ### disabled
109
+
110
+ ``boolean | undefined`` · Optional
111
+
112
+ Default: ``false``
113
+
114
+ Prevents interaction when enabled.
115
+
116
+ ### readOnly
117
+
118
+ ``boolean | undefined`` · Optional
119
+
120
+ Default: ``false``
121
+
122
+ Allows reading without changing the value.
123
+
124
+ ### attachments
125
+
126
+ ``readonly AttachmentItem[] | undefined`` · Optional
127
+
128
+ Default: ``[]``
129
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/composer",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "GridUI React composer",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,11 +27,11 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/button": "^3.1.2",
31
- "@gridui/file-picker": "^1.0.7",
32
- "@gridui/input": "^1.1.6",
30
+ "@gridui/button": "^4.0.0",
31
+ "@gridui/file-picker": "^1.0.9",
32
+ "@gridui/input": "^3.0.0",
33
33
  "@gridui/interaction": "^1.2.1",
34
- "@gridui/style-utils": "^2.2.2",
34
+ "@gridui/style-utils": "^3.0.0",
35
35
  "@gridui/theme": "^2.5.3",
36
36
  "class-variance-authority": "0.7.1"
37
37
  },