@adea-ai/ui 0.129.0 → 0.130.1
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/dist/components/composites/settings/settings.js +1 -1
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts +3 -2
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -1
- package/dist/components/ui/textarea/textarea.js +4 -2
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/r/src/components/composites/settings/settings.tsx +1 -1
- package/dist/r/src/components/ui/textarea/textarea.tsx +3 -1
- package/package.json +1 -1
- package/src/components/composites/settings/settings.tsx +1 -1
- package/src/components/ui/textarea/textarea.tsx +3 -1
|
@@ -66,7 +66,7 @@ function SettingsSection(props) {
|
|
|
66
66
|
}
|
|
67
67
|
}), null);
|
|
68
68
|
insert(_el$6, () => local.children);
|
|
69
|
-
effect(() => className(_el$6, cn(local.bodyLayout === "content" ? "flex flex-col gap-4" : "divide-y divide-border rounded-xl border border-border")));
|
|
69
|
+
effect(() => className(_el$6, cn(local.bodyLayout === "content" ? "flex flex-col gap-4" : "divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4")));
|
|
70
70
|
return _el$;
|
|
71
71
|
})();
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","names":["ComponentProps","JSX","createUniqueId","Show","splitProps","createFormFieldContext","FormFieldContext","cn","Heading","SettingsSection","props","title","description","action","Element","bodyLayout","local","rest","_el$","_tmpl$3","_el$2","firstChild","_el$3","_el$6","nextSibling","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","children","when","_el$4","_tmpl$","_el$5","_tmpl$2","_$effect","_$className","SettingsRow","label","orientation","bare","rowId","labelId","descriptionId","field","defaultControlId","hint","error","undefined","group","Provider","value","_el$7","_tmpl$4","_el$8","_el$9","_el$1","_$setAttribute","_el$0","SettingsField","htmlFor","_el$10","_tmpl$5","_el$11","_el$12","_el$14","_el$13","SettingsPage","_el$15","_tmpl$6","_$mergeProps","_$createComponent","_$className","_$setAttribute"],"sources":["../../../../src/components/composites/settings/settings.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { Heading } from '../../ui/typography'\n\n/**\n * SettingsSection and SettingsRow.\n *\n * A settings page is the most repetitive surface in any application, and the\n * one where drift is most visible: label sizes, control widths and description\n * placement all wander unless something fixes them.\n *\n * The row puts the label and description at the start and the control at the\n * end (stacked on a narrow window), so controls line up down the page's end\n * edge regardless of how long the labels are. `SettingsRow` also\n * exposes its label and description through the shared form-field context to\n * the first control inside it. `SettingsField` is the visual stacked layout;\n * use `FormField` when the control needs label, help, or validation wiring.\n */\nexport function SettingsSection(\n props: ComponentProps<'section'> & {\n title: string\n description?: string\n /** A control for the section as a whole, e.g. a master toggle. */\n action?: JSX.Element\n /** Use a spaced content stack for fields, alerts, and cards instead of divided rows. */\n bodyLayout?: 'rows' | 'content'\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'title',\n 'description',\n 'action',\n 'bodyLayout',\n 'children',\n ])\n\n return (\n <section\n data-slot=\"settings-section\"\n class={cn('flex flex-col gap-4 px-5 py-5', local.class)}\n {...rest}\n >\n <div class=\"flex items-start justify-between gap-4\">\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n {local.title}\n </Heading>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <Show when={local.action}>\n <div class=\"flex shrink-0 items-center gap-2\">{local.action}</div>\n </Show>\n </div>\n <div\n data-slot=\"settings-section-body\"\n class={cn(\n local.bodyLayout === 'content'\n ? 'flex flex-col gap-4'\n : 'divide-y divide-border rounded-xl border border-border'\n )}\n >\n {local.children}\n </div>\n </section>\n )\n}\n\n/**\n * One setting: a label and description on the leading side, a control on the\n * trailing side.\n *\n * The label and description are linked to a shared control through field\n * context. An explicit `aria-label` or `aria-labelledby` on the control keeps\n * precedence; otherwise the visible row label names it.\n */\nexport function SettingsRow(\n props: ComponentProps<'div'> & {\n label: string\n description?: string\n /** Render a vertical stack when the control needs the full width. */\n orientation?: 'horizontal' | 'vertical'\n /** Hide the divider this row would otherwise contribute. */\n bare?: boolean\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'description',\n 'orientation',\n 'bare',\n 'children',\n ])\n const rowId = createUniqueId()\n const labelId = `${rowId}-label`\n const descriptionId = `${rowId}-description`\n const field = createFormFieldContext({\n defaultControlId: rowId,\n labelId,\n descriptionId,\n hint: () => local.description,\n error: () => undefined,\n group: () => false,\n })\n\n return (\n <FormFieldContext.Provider value={field}>\n <div\n data-slot=\"settings-row\"\n class={cn(\n 'flex gap-4 p-4',\n local.orientation === 'vertical'\n ? 'flex-col'\n : 'flex-col sm:flex-row sm:items-center sm:justify-between',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div id={labelId} data-slot=\"settings-row-label\" class=\"text-sm font-medium\">\n {local.label}\n </div>\n <Show when={local.description}>\n <p id={descriptionId} class=\"max-w-prose text-sm text-muted-foreground text-pretty\">\n {local.description}\n </p>\n </Show>\n </div>\n <div\n data-slot=\"settings-row-control\"\n class={cn('shrink-0', local.orientation === 'vertical' && 'w-full')}\n >\n {local.children}\n </div>\n </div>\n </FormFieldContext.Provider>\n )\n}\n\n/** A stacked label-and-control pair, for a control too wide for a row. */\nexport function SettingsField(\n props: ComponentProps<'div'> & { label: string; description?: string; htmlFor?: string }\n) {\n const [local, rest] = splitProps(props, ['class', 'label', 'description', 'htmlFor', 'children'])\n\n return (\n <div data-slot=\"settings-field\" class={cn('flex flex-col gap-2 p-4', local.class)} {...rest}>\n <div class=\"flex flex-col gap-0.5\">\n <label for={local.htmlFor} class=\"text-sm font-medium\">\n {local.label}\n </label>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <div>{local.children}</div>\n </div>\n )\n}\n\n/** A settings page's scrolling body, with the header sticky at the top. */\nexport function SettingsPage(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"settings-page\"\n class={cn('flex min-h-0 flex-1 flex-col overflow-y-auto', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBS,gBACdC,OAQA;CACA,MAAM,CAACM,OAAOC,QAAQb,WAAWM,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAQ,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC,YAAAE,QAAAH,MAAAI;EAAAC,OAAAP,MAAAQ,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWnB,GAAG,iCAAiCS,MAAMW,KAAK;EAAC,EAAA,GACnDV,IAAI,GAAA,OAAA,IAAA;EAAAW,OAAAN,OAAAO,gBAIHrB,SAAO;GAACsB,IAAE;GAAMC,MAAI;GAAA,IAAAC,WAAA;IAAA,OAClBhB,MAAML;GAAK;EAAA,CAAA,GAAA,IAAA;EAAAiB,OAAAN,OAAAO,gBAEb1B,MAAI;GAAA,IAAC8B,OAAI;IAAA,OAAEjB,MAAMJ;GAAW;GAAA,IAAAoB,WAAA;IAAA,IAAAE,QAAAC,OAAA;IAAAP,OAAAM,aACuClB,MAAMJ,WAAW;IAAA,OAAAsB;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAN,OAAAR,OAAAS,gBAGtF1B,MAAI;GAAA,IAAC8B,OAAI;IAAA,OAAEjB,MAAMH;GAAM;GAAA,IAAAmB,WAAA;IAAA,IAAAI,QAAAC,QAAA;IAAAT,OAAAQ,aACyBpB,MAAMH,MAAM;IAAA,OAAAuB;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAR,OAAAL,aAW5DP,MAAMgB,QAAQ;EAAAM,aAAAC,UAAAhB,OANRhB,GACLS,MAAMD,eAAe,YACjB,wBACA,
|
|
1
|
+
{"version":3,"file":"settings.js","names":["ComponentProps","JSX","createUniqueId","Show","splitProps","createFormFieldContext","FormFieldContext","cn","Heading","SettingsSection","props","title","description","action","Element","bodyLayout","local","rest","_el$","_tmpl$3","_el$2","firstChild","_el$3","_el$6","nextSibling","_$spread","_$mergeProps","class","_$insert","_$createComponent","as","size","children","when","_el$4","_tmpl$","_el$5","_tmpl$2","_$effect","_$className","SettingsRow","label","orientation","bare","rowId","labelId","descriptionId","field","defaultControlId","hint","error","undefined","group","Provider","value","_el$7","_tmpl$4","_el$8","_el$9","_el$1","_$setAttribute","_el$0","SettingsField","htmlFor","_el$10","_tmpl$5","_el$11","_el$12","_el$14","_el$13","SettingsPage","_el$15","_tmpl$6","_$mergeProps","_$createComponent","_$className","_$setAttribute"],"sources":["../../../../src/components/composites/settings/settings.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { Heading } from '../../ui/typography'\n\n/**\n * SettingsSection and SettingsRow.\n *\n * A settings page is the most repetitive surface in any application, and the\n * one where drift is most visible: label sizes, control widths and description\n * placement all wander unless something fixes them.\n *\n * The row puts the label and description at the start and the control at the\n * end (stacked on a narrow window), so controls line up down the page's end\n * edge regardless of how long the labels are. `SettingsRow` also\n * exposes its label and description through the shared form-field context to\n * the first control inside it. `SettingsField` is the visual stacked layout;\n * use `FormField` when the control needs label, help, or validation wiring.\n */\nexport function SettingsSection(\n props: ComponentProps<'section'> & {\n title: string\n description?: string\n /** A control for the section as a whole, e.g. a master toggle. */\n action?: JSX.Element\n /** Use a spaced content stack for fields, alerts, and cards instead of divided rows. */\n bodyLayout?: 'rows' | 'content'\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'title',\n 'description',\n 'action',\n 'bodyLayout',\n 'children',\n ])\n\n return (\n <section\n data-slot=\"settings-section\"\n class={cn('flex flex-col gap-4 px-5 py-5', local.class)}\n {...rest}\n >\n <div class=\"flex items-start justify-between gap-4\">\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <Heading as=\"h2\" size=\"card\">\n {local.title}\n </Heading>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <Show when={local.action}>\n <div class=\"flex shrink-0 items-center gap-2\">{local.action}</div>\n </Show>\n </div>\n <div\n data-slot=\"settings-section-body\"\n class={cn(\n local.bodyLayout === 'content'\n ? 'flex flex-col gap-4'\n : 'divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4'\n )}\n >\n {local.children}\n </div>\n </section>\n )\n}\n\n/**\n * One setting: a label and description on the leading side, a control on the\n * trailing side.\n *\n * The label and description are linked to a shared control through field\n * context. An explicit `aria-label` or `aria-labelledby` on the control keeps\n * precedence; otherwise the visible row label names it.\n */\nexport function SettingsRow(\n props: ComponentProps<'div'> & {\n label: string\n description?: string\n /** Render a vertical stack when the control needs the full width. */\n orientation?: 'horizontal' | 'vertical'\n /** Hide the divider this row would otherwise contribute. */\n bare?: boolean\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'description',\n 'orientation',\n 'bare',\n 'children',\n ])\n const rowId = createUniqueId()\n const labelId = `${rowId}-label`\n const descriptionId = `${rowId}-description`\n const field = createFormFieldContext({\n defaultControlId: rowId,\n labelId,\n descriptionId,\n hint: () => local.description,\n error: () => undefined,\n group: () => false,\n })\n\n return (\n <FormFieldContext.Provider value={field}>\n <div\n data-slot=\"settings-row\"\n class={cn(\n 'flex gap-4 p-4',\n local.orientation === 'vertical'\n ? 'flex-col'\n : 'flex-col sm:flex-row sm:items-center sm:justify-between',\n local.class\n )}\n {...rest}\n >\n <div class=\"flex min-w-0 flex-col gap-0.5\">\n <div id={labelId} data-slot=\"settings-row-label\" class=\"text-sm font-medium\">\n {local.label}\n </div>\n <Show when={local.description}>\n <p id={descriptionId} class=\"max-w-prose text-sm text-muted-foreground text-pretty\">\n {local.description}\n </p>\n </Show>\n </div>\n <div\n data-slot=\"settings-row-control\"\n class={cn('shrink-0', local.orientation === 'vertical' && 'w-full')}\n >\n {local.children}\n </div>\n </div>\n </FormFieldContext.Provider>\n )\n}\n\n/** A stacked label-and-control pair, for a control too wide for a row. */\nexport function SettingsField(\n props: ComponentProps<'div'> & { label: string; description?: string; htmlFor?: string }\n) {\n const [local, rest] = splitProps(props, ['class', 'label', 'description', 'htmlFor', 'children'])\n\n return (\n <div data-slot=\"settings-field\" class={cn('flex flex-col gap-2 p-4', local.class)} {...rest}>\n <div class=\"flex flex-col gap-0.5\">\n <label for={local.htmlFor} class=\"text-sm font-medium\">\n {local.label}\n </label>\n <Show when={local.description}>\n <p class=\"max-w-prose text-sm text-muted-foreground text-pretty\">{local.description}</p>\n </Show>\n </div>\n <div>{local.children}</div>\n </div>\n )\n}\n\n/** A settings page's scrolling body, with the header sticky at the top. */\nexport function SettingsPage(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"settings-page\"\n class={cn('flex min-h-0 flex-1 flex-col overflow-y-auto', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,SAAgBS,gBACdC,OAQA;CACA,MAAM,CAACM,OAAOC,QAAQb,WAAWM,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,cAAA;EAAA,IAAAQ,OAAAC,QAAA,GAAAC,QAAAF,KAAAG,YAAAC,QAAAF,MAAAC,YAAAE,QAAAH,MAAAI;EAAAC,OAAAP,MAAAQ,WAAA,EAAA,KAAA,WAAA;GAAA,OAGW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J;GAAW;GAAA,IAAAoB,WAAA;IAAA,IAAAqC,SAAAlC,OAAA;IAAAP,OAAAyC,cACuCrD,MAAMJ,WAAW;IAAA,OAAAyD;GAAA;EAAA,CAAA,GAAA,IAAA;EAAAzC,OAAAwC,cAGjFpD,MAAMgB,QAAQ;EAAAM,aAAAsB,aAAAO,QAAA,OAPNnD,MAAM+C,OAAO,CAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAUjC;;AAGA,SAAgBM,aAAa5D,OAA8B;CACzD,MAAM,CAACM,OAAOC,QAAQb,WAAWM,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAA6D,SAAAC,QAAA;EAAA/C,OAAA8C,QAAA7C,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWnB,GAAG,gDAAgDS,MAAMW,KAAK;EAAC,EAAA,GAClEV,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAsD;CAAA,EAAA,CAAA;AAGd"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentProps, Ref } from 'solid-js';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
export declare const textareaVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "composer" | null | undefined;
|
|
4
|
+
variant?: "code" | "default" | "composer" | null | undefined;
|
|
5
5
|
size?: "default" | "comfortable" | null | undefined;
|
|
6
6
|
resize?: "none" | "both" | "vertical" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -20,7 +20,8 @@ export type TextareaProps = Omit<ComponentProps<'textarea'>, 'size'> & VariantPr
|
|
|
20
20
|
* engine supports it, which is the behaviour a chat composer wants; `rows`
|
|
21
21
|
* remains the fallback so an unsupported engine still gets a usable height.
|
|
22
22
|
* `variant="composer"` removes the standalone field surface when nested in a
|
|
23
|
-
* composer shell. `
|
|
23
|
+
* composer shell. `variant="code"` keeps the field surface and sets the
|
|
24
|
+
* monospace face, for commands, snippets and other literal text. `size="comfortable"` caps growth at the shared 12rem rung, and
|
|
24
25
|
* the finite `resize` variants keep browser resize behavior explicit.
|
|
25
26
|
*/
|
|
26
27
|
export declare function Textarea(props: TextareaProps): import("solid-js").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/textarea/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,eAAO,MAAM,gBAAgB;;;;
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/textarea/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAEnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,eAAO,MAAM,gBAAgB;;;;8EAiC5B,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,GAClE,YAAY,CAAC,OAAO,gBAAgB,CAAC,GAAG;IACtC,qFAAqF;IACrF,GAAG,CAAC,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAA;CAC/B,CAAA;AAEH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,kCAwC5C"}
|
|
@@ -17,7 +17,8 @@ var textareaVariants = cva([
|
|
|
17
17
|
variants: {
|
|
18
18
|
variant: {
|
|
19
19
|
default: "",
|
|
20
|
-
composer: "border-0 bg-transparent p-0 shadow-none focus-visible:ring-0"
|
|
20
|
+
composer: "border-0 bg-transparent p-0 shadow-none focus-visible:ring-0",
|
|
21
|
+
code: "font-mono"
|
|
21
22
|
},
|
|
22
23
|
size: {
|
|
23
24
|
default: "min-h-16",
|
|
@@ -46,7 +47,8 @@ var textareaVariants = cva([
|
|
|
46
47
|
* engine supports it, which is the behaviour a chat composer wants; `rows`
|
|
47
48
|
* remains the fallback so an unsupported engine still gets a usable height.
|
|
48
49
|
* `variant="composer"` removes the standalone field surface when nested in a
|
|
49
|
-
* composer shell. `
|
|
50
|
+
* composer shell. `variant="code"` keeps the field surface and sets the
|
|
51
|
+
* monospace face, for commands, snippets and other literal text. `size="comfortable"` caps growth at the shared 12rem rung, and
|
|
50
52
|
* the finite `resize` variants keep browser resize behavior explicit.
|
|
51
53
|
*/
|
|
52
54
|
function Textarea(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","names":["ComponentProps","Ref","splitProps","cva","VariantProps","useFormFieldControl","cn","textareaVariants","variants","variant","default","composer","size","comfortable","resize","vertical","none","both","defaultVariants","TextareaProps","Omit","ref","HTMLTextAreaElement","Textarea","props","local","rest","field","id","_el$","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","class","_$use","_$mergeProps"],"sources":["../../../../src/components/ui/textarea/textarea.tsx"],"sourcesContent":["import type { ComponentProps, Ref } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\nexport const textareaVariants = cva(\n [\n 'flex field-sizing-content w-full rounded-md border border-input bg-transparent px-control-md py-2 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground',\n 'selection:bg-primary selection:text-primary-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n ],\n {\n variants: {\n variant: {\n default: '',\n composer: 'border-0 bg-transparent p-0 shadow-none focus-visible:ring-0',\n },\n size: {\n default: 'min-h-16',\n comfortable: 'min-h-16 max-h-48',\n },\n resize: {\n vertical: 'resize-y',\n none: 'resize-none',\n both: 'resize',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n resize: 'vertical',\n },\n }\n)\n\nexport type TextareaProps = Omit<ComponentProps<'textarea'>, 'size'> &\n VariantProps<typeof textareaVariants> & {\n /** Solid's actual textarea element, rather than its containing component or form. */\n ref?: Ref<HTMLTextAreaElement>\n }\n\n/**\n * Textarea.\n *\n * Shares the Input's border, focus and invalid treatment exactly — the two are\n * the same control at different aspect ratios, and a form that mixes them must\n * not show a seam between them.\n *\n * `field-sizing: content` lets the element grow with its content where the\n * engine supports it, which is the behaviour a chat composer wants; `rows`\n * remains the fallback so an unsupported engine still gets a usable height.\n * `variant=\"composer\"` removes the standalone field surface when nested in a\n * composer shell. `size=\"comfortable\"` caps growth at the shared 12rem rung, and\n * the finite `resize` variants keep browser resize behavior explicit.\n */\nexport function Textarea(props: TextareaProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'size',\n 'resize',\n 'ref',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <textarea\n data-slot=\"textarea\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n ref={local.ref}\n class={cn(\n textareaVariants({ variant: local.variant, size: local.size, resize: local.resize }),\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;AAMA,IAAaO,mBAAmBJ,IAC9B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;AAA8E,GAEhF;CACEK,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,UAAU;
|
|
1
|
+
{"version":3,"file":"textarea.js","names":["ComponentProps","Ref","splitProps","cva","VariantProps","useFormFieldControl","cn","textareaVariants","variants","variant","default","composer","code","size","comfortable","resize","vertical","none","both","defaultVariants","TextareaProps","Omit","ref","HTMLTextAreaElement","Textarea","props","local","rest","field","id","_el$","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","class","_$use","_$mergeProps"],"sources":["../../../../src/components/ui/textarea/textarea.tsx"],"sourcesContent":["import type { ComponentProps, Ref } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\nexport const textareaVariants = cva(\n [\n 'flex field-sizing-content w-full rounded-md border border-input bg-transparent px-control-md py-2 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground',\n 'selection:bg-primary selection:text-primary-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n ],\n {\n variants: {\n variant: {\n default: '',\n composer: 'border-0 bg-transparent p-0 shadow-none focus-visible:ring-0',\n code: 'font-mono',\n },\n size: {\n default: 'min-h-16',\n comfortable: 'min-h-16 max-h-48',\n },\n resize: {\n vertical: 'resize-y',\n none: 'resize-none',\n both: 'resize',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n resize: 'vertical',\n },\n }\n)\n\nexport type TextareaProps = Omit<ComponentProps<'textarea'>, 'size'> &\n VariantProps<typeof textareaVariants> & {\n /** Solid's actual textarea element, rather than its containing component or form. */\n ref?: Ref<HTMLTextAreaElement>\n }\n\n/**\n * Textarea.\n *\n * Shares the Input's border, focus and invalid treatment exactly — the two are\n * the same control at different aspect ratios, and a form that mixes them must\n * not show a seam between them.\n *\n * `field-sizing: content` lets the element grow with its content where the\n * engine supports it, which is the behaviour a chat composer wants; `rows`\n * remains the fallback so an unsupported engine still gets a usable height.\n * `variant=\"composer\"` removes the standalone field surface when nested in a\n * composer shell. `variant=\"code\"` keeps the field surface and sets the\n * monospace face, for commands, snippets and other literal text. `size=\"comfortable\"` caps growth at the shared 12rem rung, and\n * the finite `resize` variants keep browser resize behavior explicit.\n */\nexport function Textarea(props: TextareaProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'size',\n 'resize',\n 'ref',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <textarea\n data-slot=\"textarea\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n ref={local.ref}\n class={cn(\n textareaVariants({ variant: local.variant, size: local.size, resize: local.resize }),\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;AAMA,IAAaO,mBAAmBJ,IAC9B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;AAA8E,GAEhF;CACEK,UAAU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,GACGd,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAG;CAAA,EAAA,CAAA;AAGd"}
|
|
@@ -61,7 +61,7 @@ export function SettingsSection(
|
|
|
61
61
|
class={cn(
|
|
62
62
|
local.bodyLayout === 'content'
|
|
63
63
|
? 'flex flex-col gap-4'
|
|
64
|
-
: 'divide-y divide-border rounded-xl border border-border'
|
|
64
|
+
: 'divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4'
|
|
65
65
|
)}
|
|
66
66
|
>
|
|
67
67
|
{local.children}
|
|
@@ -19,6 +19,7 @@ export const textareaVariants = cva(
|
|
|
19
19
|
variant: {
|
|
20
20
|
default: '',
|
|
21
21
|
composer: 'border-0 bg-transparent p-0 shadow-none focus-visible:ring-0',
|
|
22
|
+
code: 'font-mono',
|
|
22
23
|
},
|
|
23
24
|
size: {
|
|
24
25
|
default: 'min-h-16',
|
|
@@ -55,7 +56,8 @@ export type TextareaProps = Omit<ComponentProps<'textarea'>, 'size'> &
|
|
|
55
56
|
* engine supports it, which is the behaviour a chat composer wants; `rows`
|
|
56
57
|
* remains the fallback so an unsupported engine still gets a usable height.
|
|
57
58
|
* `variant="composer"` removes the standalone field surface when nested in a
|
|
58
|
-
* composer shell. `
|
|
59
|
+
* composer shell. `variant="code"` keeps the field surface and sets the
|
|
60
|
+
* monospace face, for commands, snippets and other literal text. `size="comfortable"` caps growth at the shared 12rem rung, and
|
|
59
61
|
* the finite `resize` variants keep browser resize behavior explicit.
|
|
60
62
|
*/
|
|
61
63
|
export function Textarea(props: TextareaProps) {
|
package/package.json
CHANGED
|
@@ -61,7 +61,7 @@ export function SettingsSection(
|
|
|
61
61
|
class={cn(
|
|
62
62
|
local.bodyLayout === 'content'
|
|
63
63
|
? 'flex flex-col gap-4'
|
|
64
|
-
: 'divide-y divide-border rounded-xl border border-border'
|
|
64
|
+
: 'divide-y divide-border rounded-xl border border-border [&>[data-slot=empty-description]]:p-4'
|
|
65
65
|
)}
|
|
66
66
|
>
|
|
67
67
|
{local.children}
|
|
@@ -19,6 +19,7 @@ export const textareaVariants = cva(
|
|
|
19
19
|
variant: {
|
|
20
20
|
default: '',
|
|
21
21
|
composer: 'border-0 bg-transparent p-0 shadow-none focus-visible:ring-0',
|
|
22
|
+
code: 'font-mono',
|
|
22
23
|
},
|
|
23
24
|
size: {
|
|
24
25
|
default: 'min-h-16',
|
|
@@ -55,7 +56,8 @@ export type TextareaProps = Omit<ComponentProps<'textarea'>, 'size'> &
|
|
|
55
56
|
* engine supports it, which is the behaviour a chat composer wants; `rows`
|
|
56
57
|
* remains the fallback so an unsupported engine still gets a usable height.
|
|
57
58
|
* `variant="composer"` removes the standalone field surface when nested in a
|
|
58
|
-
* composer shell. `
|
|
59
|
+
* composer shell. `variant="code"` keeps the field surface and sets the
|
|
60
|
+
* monospace face, for commands, snippets and other literal text. `size="comfortable"` caps growth at the shared 12rem rung, and
|
|
59
61
|
* the finite `resize` variants keep browser resize behavior explicit.
|
|
60
62
|
*/
|
|
61
63
|
export function Textarea(props: TextareaProps) {
|