@gridui/composer 1.0.1 → 1.0.3
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 +17 -1
- package/dist/index.js +52 -16
- package/dist/index.js.map +2 -2
- package/dist/styles.css +28 -31
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -5,4 +5,20 @@ Dashboard family. Public API: `AttachmentItem`, `AttachmentList`, `AttachmentLis
|
|
|
5
5
|
Import components from `@gridui/composer` and load `@gridui/composer/styles.css` after Theme.
|
|
6
6
|
Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
|
|
7
7
|
|
|
8
|
-
See [component ownership](
|
|
8
|
+
See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-dashboard/composer/.changeset/history).
|
|
9
|
+
|
|
10
|
+
## Submission and native constraints
|
|
11
|
+
|
|
12
|
+
Button and keyboard submission share the textarea's native constraint validation,
|
|
13
|
+
including `required`, `minLength`, and custom validity. Invalid enabled inputs
|
|
14
|
+
report their validation message and retain focus. Textarea and submit button refs
|
|
15
|
+
are forwarded through their respective props. A disabled fieldset blocks both
|
|
16
|
+
submission paths.
|
|
17
|
+
|
|
18
|
+
With `busy` and `submitWhileBusy`, a disabled textarea may submit its existing
|
|
19
|
+
draft. As with native disabled form controls, it does not participate in constraint
|
|
20
|
+
validation. Set `editableWhileBusy` when the draft should stay editable and
|
|
21
|
+
validated. Applications continue to own request errors and persistence.
|
|
22
|
+
|
|
23
|
+
Attachment removal restores focus only while focus still belongs to that removal.
|
|
24
|
+
A delayed update preserves focus when the user has already moved to another control.
|
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("m-0 flex min-w-0 list-none flex-col p-0 focus:min-h-11");
|
|
4
|
-
var attachmentStyles = cva("flex min-w-0 flex-wrap items-center gap-gridui-8 border-b border-border py-gridui-8 data-[state=error]:text-danger-foreground");
|
|
5
|
-
var attachmentCopyStyles = cva("flex min-w-0 flex-1 flex-col wrap-anywhere");
|
|
6
|
-
var attachmentMetaStyles = cva("text-muted type-caption");
|
|
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");
|
|
7
7
|
|
|
8
8
|
// src/attachment-list/attachment-list.tsx
|
|
9
9
|
import { Button } from "@gridui/button";
|
|
@@ -29,8 +29,12 @@ var AttachmentList = (props) => {
|
|
|
29
29
|
if (removed && !items.some((item) => {
|
|
30
30
|
return item.id === removed.id;
|
|
31
31
|
})) {
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const document = removed.element.ownerDocument;
|
|
33
|
+
const active = document.activeElement;
|
|
34
|
+
if (active === removed.element || active === document.body) {
|
|
35
|
+
const next = items[Math.min(removed.index, items.length - 1)];
|
|
36
|
+
(next ? buttons.current.get(next.id) : list.current)?.focus();
|
|
37
|
+
}
|
|
34
38
|
pending.current = null;
|
|
35
39
|
}
|
|
36
40
|
}, [items]);
|
|
@@ -95,10 +99,16 @@ var AttachmentList = (props) => {
|
|
|
95
99
|
"aria-label": removeLabel(item),
|
|
96
100
|
title: removeLabel(item),
|
|
97
101
|
disabled,
|
|
98
|
-
|
|
102
|
+
onBlur: (event) => {
|
|
103
|
+
if (event.relatedTarget && pending.current?.element === event.currentTarget) {
|
|
104
|
+
pending.current = null;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
onClick: (event) => {
|
|
99
108
|
pending.current = {
|
|
100
109
|
id: item.id,
|
|
101
|
-
index
|
|
110
|
+
index,
|
|
111
|
+
element: event.currentTarget
|
|
102
112
|
};
|
|
103
113
|
onRemove(item.id);
|
|
104
114
|
},
|
|
@@ -122,18 +132,18 @@ var AttachmentList = (props) => {
|
|
|
122
132
|
|
|
123
133
|
// src/composer/style.ts
|
|
124
134
|
import { cva as cva2 } from "class-variance-authority";
|
|
125
|
-
var composerStyles = cva2("min-w-0 gap-gridui-8 border border-border bg-background p-gridui-16 text-foreground", {
|
|
135
|
+
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", {
|
|
126
136
|
variants: {
|
|
127
137
|
layout: {
|
|
128
|
-
stacked: "flex flex-col",
|
|
129
|
-
inline: "grid grid-cols-[minmax(0,1fr)_auto] items-end"
|
|
138
|
+
stacked: "gridui-u-flex gridui-u-flex-col",
|
|
139
|
+
inline: "gridui-u-grid gridui-u-grid-cols-[minmax(0,1fr)_auto] gridui-u-items-end"
|
|
130
140
|
}
|
|
131
141
|
},
|
|
132
142
|
defaultVariants: {
|
|
133
143
|
layout: "stacked"
|
|
134
144
|
}
|
|
135
145
|
});
|
|
136
|
-
var composerActionsStyles = cva2("flex flex-wrap items-center justify-end gap-gridui-8");
|
|
146
|
+
var composerActionsStyles = cva2("gridui-u-flex gridui-u-flex-wrap gridui-u-items-center gridui-u-justify-end gridui-u-gap-gridui-8");
|
|
137
147
|
|
|
138
148
|
// src/composer/composer.tsx
|
|
139
149
|
import { Button as Button2 } from "@gridui/button";
|
|
@@ -171,6 +181,8 @@ var Composer = (props) => {
|
|
|
171
181
|
} = props;
|
|
172
182
|
const id = useId();
|
|
173
183
|
const isComposing = useRef2(false);
|
|
184
|
+
const input = useRef2(null);
|
|
185
|
+
const submitButton = useRef2(null);
|
|
174
186
|
const inputDisabled = disabled || busy && !editableWhileBusy;
|
|
175
187
|
const editingDisabled = inputDisabled || readOnly;
|
|
176
188
|
const hasContent = value.trim().length > 0 || attachments.length > 0;
|
|
@@ -179,7 +191,11 @@ var Composer = (props) => {
|
|
|
179
191
|
});
|
|
180
192
|
const canSubmit = !disabled && !readOnly && (!busy || submitWhileBusy) && hasContent && attachmentsReady;
|
|
181
193
|
const submit = () => {
|
|
182
|
-
|
|
194
|
+
const element = input.current;
|
|
195
|
+
if (!canSubmit || !element || !submitButton.current || submitButton.current.matches(":disabled")) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (element.reportValidity()) {
|
|
183
199
|
onSubmit(value);
|
|
184
200
|
}
|
|
185
201
|
};
|
|
@@ -209,8 +225,8 @@ var Composer = (props) => {
|
|
|
209
225
|
AttachmentList,
|
|
210
226
|
{
|
|
211
227
|
className: cn2(
|
|
212
|
-
layout === "inline" && "col-span-full",
|
|
213
|
-
layout === "inline" && attachments.length === 0 && !onRemoveAttachment && "hidden"
|
|
228
|
+
layout === "inline" && "gridui-u-col-span-full",
|
|
229
|
+
layout === "inline" && attachments.length === 0 && !onRemoveAttachment && "gridui-u-hidden"
|
|
214
230
|
),
|
|
215
231
|
items: attachments,
|
|
216
232
|
label: labels.attachments,
|
|
@@ -225,6 +241,16 @@ var Composer = (props) => {
|
|
|
225
241
|
autoSize: true,
|
|
226
242
|
maxHeight: 240,
|
|
227
243
|
...textareaProps,
|
|
244
|
+
ref: (element) => {
|
|
245
|
+
input.current = element;
|
|
246
|
+
const ref = textareaProps?.ref;
|
|
247
|
+
if (typeof ref === "function") {
|
|
248
|
+
return ref(element);
|
|
249
|
+
}
|
|
250
|
+
if (ref) {
|
|
251
|
+
ref.current = element;
|
|
252
|
+
}
|
|
253
|
+
},
|
|
228
254
|
"aria-label": labels.input,
|
|
229
255
|
value,
|
|
230
256
|
onValueChange,
|
|
@@ -272,6 +298,16 @@ var Composer = (props) => {
|
|
|
272
298
|
Button2,
|
|
273
299
|
{
|
|
274
300
|
...submitButtonProps,
|
|
301
|
+
ref: (element) => {
|
|
302
|
+
submitButton.current = element;
|
|
303
|
+
const ref = submitButtonProps?.ref;
|
|
304
|
+
if (typeof ref === "function") {
|
|
305
|
+
return ref(element);
|
|
306
|
+
}
|
|
307
|
+
if (ref) {
|
|
308
|
+
ref.current = element;
|
|
309
|
+
}
|
|
310
|
+
},
|
|
275
311
|
type: "button",
|
|
276
312
|
"aria-label": labels.submit,
|
|
277
313
|
onClick: submit,
|
|
@@ -285,7 +321,7 @@ var Composer = (props) => {
|
|
|
285
321
|
notice && /* @__PURE__ */ jsx2(
|
|
286
322
|
"div",
|
|
287
323
|
{
|
|
288
|
-
className: layout === "inline" ? "col-span-full" : void 0,
|
|
324
|
+
className: layout === "inline" ? "gridui-u-col-span-full" : void 0,
|
|
289
325
|
children: notice
|
|
290
326
|
}
|
|
291
327
|
)
|
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/composer/style.ts", "../src/composer/composer.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(\"m-0 flex min-w-0 list-none flex-col p-0 focus:min-h-11\");\n\nexport const attachmentStyles = cva(\"flex min-w-0 flex-wrap items-center gap-gridui-8 border-b border-border py-gridui-8 data-[state=error]:text-danger-foreground\");\n\nexport const attachmentCopyStyles = cva(\"flex min-w-0 flex-1 flex-col wrap-anywhere\");\n\nexport const attachmentMetaStyles = cva(\"text-muted type-caption\");\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace AttachmentList\n * @description Attachment List\n */\n\nimport type { AttachmentItem } from \"../shared/types\";\nimport { attachmentCopyStyles, attachmentListStyles, attachmentMetaStyles, attachmentStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, useLayoutEffect, useRef } from \"react\";\n\nexport type AttachmentListProps = Omit<ComponentPropsWithRef<\"ul\">, \"children\"> & {\n readonly items: readonly AttachmentItem[];\n readonly label: string;\n readonly removeLabel: (item: AttachmentItem) => string;\n readonly onRemove?: (id: string) => void;\n readonly disabled?: boolean;\n};\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 } | 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 next = items[Math.min(removed.index, items.length - 1)];\n (next ? buttons.current.get(next.id) : list.current)?.focus();\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 onClick={() => {\n pending.current = {\n id: item.id,\n index,\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 Composer\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const composerStyles = cva(\"min-w-0 gap-gridui-8 border border-border bg-background p-gridui-16 text-foreground\", {\n variants: {\n layout: {\n stacked: \"flex flex-col\",\n inline: \"grid grid-cols-[minmax(0,1fr)_auto] items-end\",\n },\n },\n defaultVariants: {\n layout: \"stacked\",\n },\n});\n\nexport const composerActionsStyles = cva(\"flex flex-wrap items-center justify-end gap-gridui-8\");\n", "/**\n * @author WMXPY\n * @package Composer\n * @namespace Composer\n * @description Composer\n */\n\nimport { AttachmentList } from \"../attachment-list/attachment-list\";\nimport type { AttachmentItem } from \"../shared/types\";\nimport { composerActionsStyles, composerStyles } from \"./style\";\nimport { Button, type ButtonProps, type ButtonVariants } from \"@gridui/button\";\nimport { FilePicker } from \"@gridui/file-picker\";\nimport { Textarea, type TextareaProps } from \"@gridui/input\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type KeyboardEvent, type ReactNode, useId, useRef } from \"react\";\n\nexport type ComposerProps = Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"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 textareaProps?: Omit<TextareaProps, \"value\" | \"defaultValue\" | \"onValueChange\" | \"disabled\" | \"readOnly\" | \"placeholder\">;\n readonly submitButtonProps?: Omit<ButtonProps, \"children\" | \"onClick\" | \"disabled\" | \"loading\" | \"type\" | \"aria-label\"> & ButtonVariants;\n readonly submitContent?: ReactNode;\n readonly disabled?: boolean;\n readonly readOnly?: boolean;\n readonly placeholder?: string;\n readonly attachments?: readonly AttachmentItem[];\n readonly onRemoveAttachment?: (id: string) => void;\n readonly onFiles?: (files: readonly File[]) => void;\n readonly accept?: string;\n readonly tools?: ReactNode;\n readonly notice?: ReactNode;\n readonly labels: {\n readonly input: string;\n readonly submit: string;\n readonly stop: string;\n readonly attach: string;\n readonly attachments: string;\n readonly removeAttachment: (item: AttachmentItem) => string;\n };\n};\n\nexport const Composer: FC<ComposerProps> = (props: ComposerProps) => {\n const {\n value,\n onValueChange,\n onSubmit,\n onStop,\n busy = false,\n editableWhileBusy = false,\n submitWhileBusy = false,\n submitShortcut = \"modifier-enter\",\n layout = \"stacked\",\n textareaProps,\n submitButtonProps,\n submitContent,\n disabled = false,\n readOnly = false,\n placeholder,\n attachments = [],\n onRemoveAttachment,\n onFiles,\n accept = \"\",\n tools,\n notice,\n labels,\n className,\n ...restProps\n } = props;\n const id = useId();\n const isComposing = useRef(false);\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 if (canSubmit) {\n onSubmit(value);\n }\n };\n const handleKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n textareaProps?.onKeyDown?.(event);\n if (event.defaultPrevented || event.nativeEvent.isComposing || 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 return (<div\n {...restProps}\n className={cn(composerStyles({ layout }), className)}\n >\n <AttachmentList\n className={cn(\n layout === \"inline\" && \"col-span-full\",\n layout === \"inline\" && attachments.length === 0 && !onRemoveAttachment && \"hidden\",\n )}\n items={attachments}\n label={labels.attachments}\n removeLabel={labels.removeAttachment}\n {...(onRemoveAttachment ? { onRemove: onRemoveAttachment } : {})}\n disabled={editingDisabled}\n />\n <Textarea\n autoSize\n maxHeight={240}\n {...textareaProps}\n aria-label={labels.input}\n value={value}\n onValueChange={onValueChange}\n placeholder={placeholder}\n disabled={inputDisabled}\n readOnly={readOnly}\n onCompositionStart={event => {\n isComposing.current = true;\n textareaProps?.onCompositionStart?.(event);\n }}\n onCompositionEnd={event => {\n isComposing.current = false;\n textareaProps?.onCompositionEnd?.(event);\n }}\n onKeyDown={handleKeyDown}\n />\n <div\n className={composerActionsStyles()}\n >\n {onFiles && (<FilePicker\n inputId={id}\n label={labels.attach}\n action={labels.attach}\n accept={accept}\n multiple\n onFiles={onFiles}\n disabled={editingDisabled}\n />)}\n {tools}\n {busy && !submitWhileBusy ? (<Button\n variant=\"secondary\"\n onClick={onStop}\n disabled={disabled || !onStop}\n >\n {labels.stop}\n </Button>)\n : (<Button\n {...submitButtonProps}\n type=\"button\"\n aria-label={labels.submit}\n onClick={submit}\n disabled={!canSubmit}\n >\n {submitContent ?? labels.submit}\n </Button>)}\n </div>\n {notice && (<div\n className={layout === \"inline\" ? \"col-span-full\" : undefined}\n >\n {notice}\n </div>)}\n </div>);\n};\n"],
|
|
5
|
-
"mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,uBAAuB,IAAI,
|
|
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 { AttachmentItem } from \"../shared/types\";\nimport { attachmentCopyStyles, attachmentListStyles, attachmentMetaStyles, attachmentStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, useLayoutEffect, useRef } from \"react\";\n\nexport type AttachmentListProps = Omit<ComponentPropsWithRef<\"ul\">, \"children\"> & {\n readonly items: readonly AttachmentItem[];\n readonly label: string;\n readonly removeLabel: (item: AttachmentItem) => string;\n readonly onRemove?: (id: string) => void;\n readonly disabled?: boolean;\n};\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 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\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 Composer\n * @description Composer\n */\n\nimport { AttachmentList } from \"../attachment-list/attachment-list\";\nimport type { AttachmentItem } from \"../shared/types\";\nimport { composerActionsStyles, composerStyles } from \"./style\";\nimport { Button, type ButtonProps, type ButtonVariants } from \"@gridui/button\";\nimport { FilePicker } from \"@gridui/file-picker\";\nimport { Textarea, type TextareaProps } from \"@gridui/input\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type KeyboardEvent, type ReactNode, useId, useRef } from \"react\";\n\nexport type ComposerProps = Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"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 textareaProps?: Omit<TextareaProps, \"value\" | \"defaultValue\" | \"onValueChange\" | \"disabled\" | \"readOnly\" | \"placeholder\">;\n readonly submitButtonProps?: Omit<ButtonProps, \"children\" | \"onClick\" | \"disabled\" | \"loading\" | \"type\" | \"aria-label\"> & ButtonVariants;\n readonly submitContent?: ReactNode;\n readonly disabled?: boolean;\n readonly readOnly?: boolean;\n readonly placeholder?: string;\n readonly attachments?: readonly AttachmentItem[];\n readonly onRemoveAttachment?: (id: string) => void;\n readonly onFiles?: (files: readonly File[]) => void;\n readonly accept?: string;\n readonly tools?: ReactNode;\n readonly notice?: ReactNode;\n readonly labels: {\n readonly input: string;\n readonly submit: string;\n readonly stop: string;\n readonly attach: string;\n readonly attachments: string;\n readonly removeAttachment: (item: AttachmentItem) => string;\n };\n};\n\nexport const Composer: FC<ComposerProps> = (props: ComposerProps) => {\n const {\n value,\n onValueChange,\n onSubmit,\n onStop,\n busy = false,\n editableWhileBusy = false,\n submitWhileBusy = false,\n submitShortcut = \"modifier-enter\",\n layout = \"stacked\",\n textareaProps,\n submitButtonProps,\n submitContent,\n disabled = false,\n readOnly = false,\n placeholder,\n attachments = [],\n onRemoveAttachment,\n onFiles,\n accept = \"\",\n tools,\n notice,\n labels,\n className,\n ...restProps\n } = props;\n const id = useId();\n const isComposing = useRef(false);\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 const handleKeyDown = (event: KeyboardEvent<HTMLTextAreaElement>) => {\n textareaProps?.onKeyDown?.(event);\n if (event.defaultPrevented || event.nativeEvent.isComposing || 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 return (<div\n {...restProps}\n className={cn(composerStyles({ layout }), className)}\n >\n <AttachmentList\n className={cn(\n layout === \"inline\" && \"gridui-u-col-span-full\",\n layout === \"inline\" && attachments.length === 0 && !onRemoveAttachment && \"gridui-u-hidden\",\n )}\n items={attachments}\n label={labels.attachments}\n removeLabel={labels.removeAttachment}\n {...(onRemoveAttachment ? { onRemove: onRemoveAttachment } : {})}\n disabled={editingDisabled}\n />\n <Textarea\n autoSize\n maxHeight={240}\n {...textareaProps}\n ref={element => {\n input.current = element;\n const ref = textareaProps?.ref;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n }}\n aria-label={labels.input}\n value={value}\n onValueChange={onValueChange}\n placeholder={placeholder}\n disabled={inputDisabled}\n readOnly={readOnly}\n onCompositionStart={event => {\n isComposing.current = true;\n textareaProps?.onCompositionStart?.(event);\n }}\n onCompositionEnd={event => {\n isComposing.current = false;\n textareaProps?.onCompositionEnd?.(event);\n }}\n onKeyDown={handleKeyDown}\n />\n <div\n className={composerActionsStyles()}\n >\n {onFiles && (<FilePicker\n inputId={id}\n label={labels.attach}\n action={labels.attach}\n accept={accept}\n multiple\n onFiles={onFiles}\n disabled={editingDisabled}\n />)}\n {tools}\n {busy && !submitWhileBusy ? (<Button\n variant=\"secondary\"\n onClick={onStop}\n disabled={disabled || !onStop}\n >\n {labels.stop}\n </Button>)\n : (<Button\n {...submitButtonProps}\n ref={element => {\n submitButton.current = element;\n const ref = submitButtonProps?.ref;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n }}\n type=\"button\"\n aria-label={labels.submit}\n onClick={submit}\n disabled={!canSubmit}\n >\n {submitContent ?? labels.submit}\n </Button>)}\n </div>\n {notice && (<div\n className={layout === \"inline\" ? \"gridui-u-col-span-full\" : undefined}\n >\n {notice}\n </div>)}\n </div>);\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,SAA8C,iBAAiB,cAAc;AA+D7D,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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AW,sBAAsB;AAAA,YAEhC;AAAA,yBAAY,gBAAAD;AAAA,gBAAC;AAAA;AAAA,kBACV,SAAS;AAAA,kBACT,OAAO,OAAO;AAAA,kBACd,QAAQ,OAAO;AAAA,kBACf;AAAA,kBACA,UAAQ;AAAA,kBACR;AAAA,kBACA,UAAU;AAAA;AAAA,cACd;AAAA,cACC;AAAA,cACA,QAAQ,CAAC,kBAAmB,gBAAAA;AAAA,gBAACH;AAAA,gBAAA;AAAA,kBAC1B,SAAQ;AAAA,kBACR,SAAS;AAAA,kBACT,UAAU,YAAY,CAAC;AAAA,kBAEtB,iBAAO;AAAA;AAAA,cACZ,IACO,gBAAAG;AAAA,gBAACH;AAAA,gBAAA;AAAA,kBACC,GAAG;AAAA,kBACJ,KAAK,aAAW;AACZ,iCAAa,UAAU;AACvB,0BAAM,MAAM,mBAAmB;AAC/B,wBAAI,OAAO,QAAQ,YAAY;AAC3B,6BAAO,IAAI,OAAO;AAAA,oBACtB;AACA,wBAAI,KAAK;AACL,0BAAI,UAAU;AAAA,oBAClB;AAAA,kBACJ;AAAA,kBACA,MAAK;AAAA,kBACL,cAAY,OAAO;AAAA,kBACnB,SAAS;AAAA,kBACT,UAAU,CAAC;AAAA,kBAEV,2BAAiB,OAAO;AAAA;AAAA,cAC7B;AAAA;AAAA;AAAA,QACR;AAAA,QACC,UAAW,gBAAAG;AAAA,UAAC;AAAA;AAAA,YACT,WAAW,WAAW,WAAW,2BAA2B;AAAA,YAE3D;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": ["cva", "Button", "cn", "useRef", "jsx", "jsxs"]
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -7,94 +7,91 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
@layer utilities {
|
|
10
|
-
.col-span-full {
|
|
10
|
+
.gridui-u-col-span-full {
|
|
11
11
|
grid-column: 1 / -1;
|
|
12
12
|
}
|
|
13
|
-
.m-0 {
|
|
13
|
+
.gridui-u-m-0 {
|
|
14
14
|
margin: 0px;
|
|
15
15
|
}
|
|
16
|
-
.flex {
|
|
16
|
+
.gridui-u-flex {
|
|
17
17
|
display: flex;
|
|
18
18
|
}
|
|
19
|
-
.grid {
|
|
19
|
+
.gridui-u-grid {
|
|
20
20
|
display: grid;
|
|
21
21
|
}
|
|
22
|
-
.hidden {
|
|
22
|
+
.gridui-u-hidden {
|
|
23
23
|
display: none;
|
|
24
24
|
}
|
|
25
|
-
.
|
|
26
|
-
display: inline;
|
|
27
|
-
}
|
|
28
|
-
.min-w-0 {
|
|
25
|
+
.gridui-u-min-w-0 {
|
|
29
26
|
min-width: 0px;
|
|
30
27
|
}
|
|
31
|
-
.flex-1 {
|
|
28
|
+
.gridui-u-flex-1 {
|
|
32
29
|
flex: 1;
|
|
33
30
|
}
|
|
34
|
-
.list-none {
|
|
31
|
+
.gridui-u-list-none {
|
|
35
32
|
list-style-type: none;
|
|
36
33
|
}
|
|
37
|
-
.grid-cols-\[minmax\(0\,1fr\)_auto\] {
|
|
34
|
+
.gridui-u-grid-cols-\[minmax\(0\,1fr\)_auto\] {
|
|
38
35
|
grid-template-columns: minmax(0,1fr) auto;
|
|
39
36
|
}
|
|
40
|
-
.flex-col {
|
|
37
|
+
.gridui-u-flex-col {
|
|
41
38
|
flex-direction: column;
|
|
42
39
|
}
|
|
43
|
-
.flex-wrap {
|
|
40
|
+
.gridui-u-flex-wrap {
|
|
44
41
|
flex-wrap: wrap;
|
|
45
42
|
}
|
|
46
|
-
.items-center {
|
|
43
|
+
.gridui-u-items-center {
|
|
47
44
|
align-items: center;
|
|
48
45
|
}
|
|
49
|
-
.items-end {
|
|
46
|
+
.gridui-u-items-end {
|
|
50
47
|
align-items: flex-end;
|
|
51
48
|
}
|
|
52
|
-
.justify-end {
|
|
49
|
+
.gridui-u-justify-end {
|
|
53
50
|
justify-content: flex-end;
|
|
54
51
|
}
|
|
55
|
-
.gap-gridui-8 {
|
|
52
|
+
.gridui-u-gap-gridui-8 {
|
|
56
53
|
gap: var(--gridui-space-8);
|
|
57
54
|
}
|
|
58
|
-
.border {
|
|
55
|
+
.gridui-u-border {
|
|
59
56
|
border-style: var(--tw-border-style);
|
|
60
57
|
border-width: 1px;
|
|
61
58
|
}
|
|
62
|
-
.border-b {
|
|
59
|
+
.gridui-u-border-b {
|
|
63
60
|
border-bottom-style: var(--tw-border-style);
|
|
64
61
|
border-bottom-width: 1px;
|
|
65
62
|
}
|
|
66
|
-
.border-border {
|
|
63
|
+
.gridui-u-border-border {
|
|
67
64
|
border-color: var(--gridui-border);
|
|
68
65
|
}
|
|
69
|
-
.bg-background {
|
|
66
|
+
.gridui-u-bg-background {
|
|
70
67
|
background-color: var(--gridui-background);
|
|
71
68
|
}
|
|
72
|
-
.p-0 {
|
|
69
|
+
.gridui-u-p-0 {
|
|
73
70
|
padding: 0px;
|
|
74
71
|
}
|
|
75
|
-
.p-gridui-16 {
|
|
72
|
+
.gridui-u-p-gridui-16 {
|
|
76
73
|
padding: var(--gridui-space-16);
|
|
77
74
|
}
|
|
78
|
-
.py-gridui-8 {
|
|
75
|
+
.gridui-u-py-gridui-8 {
|
|
79
76
|
padding-block: var(--gridui-space-8);
|
|
80
77
|
}
|
|
81
|
-
.type-caption {
|
|
78
|
+
.gridui-u-type-caption {
|
|
82
79
|
font: var(--gridui-type-caption);
|
|
83
80
|
letter-spacing: normal;
|
|
84
81
|
}
|
|
85
|
-
.wrap-anywhere {
|
|
82
|
+
.gridui-u-wrap-anywhere {
|
|
86
83
|
overflow-wrap: anywhere;
|
|
87
84
|
}
|
|
88
|
-
.text-foreground {
|
|
85
|
+
.gridui-u-text-foreground {
|
|
89
86
|
color: var(--gridui-foreground);
|
|
90
87
|
}
|
|
91
|
-
.text-muted {
|
|
88
|
+
.gridui-u-text-muted {
|
|
92
89
|
color: var(--gridui-muted);
|
|
93
90
|
}
|
|
94
|
-
.focus\:min-h-11:focus {
|
|
91
|
+
.gridui-u-focus\:min-h-11:focus {
|
|
95
92
|
min-height: calc(var(--spacing) * 11);
|
|
96
93
|
}
|
|
97
|
-
.data-\[state\=error\]\:text-danger-foreground[data-state="error"] {
|
|
94
|
+
.gridui-u-data-\[state\=error\]\:text-danger-foreground[data-state="error"] {
|
|
98
95
|
color: var(--gridui-danger-foreground);
|
|
99
96
|
}
|
|
100
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/composer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "GridUI React composer",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -26,16 +26,17 @@
|
|
|
26
26
|
"react-dom": "^19.2.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@gridui/button": "^
|
|
30
|
-
"@gridui/file-picker": "^1.0.
|
|
31
|
-
"@gridui/input": "^1.1.
|
|
32
|
-
"@gridui/style-utils": "^2.1.
|
|
33
|
-
"@gridui/theme": "^2.
|
|
29
|
+
"@gridui/button": "^3.0.0",
|
|
30
|
+
"@gridui/file-picker": "^1.0.4",
|
|
31
|
+
"@gridui/input": "^1.1.2",
|
|
32
|
+
"@gridui/style-utils": "^2.1.4",
|
|
33
|
+
"@gridui/theme": "^2.4.0",
|
|
34
34
|
"class-variance-authority": "0.7.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
38
38
|
"@jest/globals": "30.5.2",
|
|
39
|
+
"@storybook/react-vite": "10.6.5",
|
|
39
40
|
"@types/jest": "30.0.0",
|
|
40
41
|
"@types/node": "26.6.6",
|
|
41
42
|
"@types/react": "19.3.0",
|