@gridui/tag-input 1.2.0 → 2.0.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 +10 -3
- package/dist/index.js +5 -2
- package/dist/index.js.map +2 -2
- package/dist/styles.css +108 -84
- package/dist/tag-input/tag-input.d.ts +4 -2
- package/docs/catalog.json +6 -6
- package/docs/reference/tag-input.md +12 -6
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @gridui/tag-input
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Controls family. Public API: `TagInput`, `TagInputProps`, `TagRejection`, `TagRejectionReason`.
|
|
4
4
|
|
|
5
5
|
Import components from `@gridui/tag-input` and load these styles in order.
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ Import components from `@gridui/tag-input` and load these styles in order.
|
|
|
12
12
|
Input supplies the control surface, Button supplies tag actions, and Form hides the native multiple-value bridge.
|
|
13
13
|
Applications own routes, labels, state persistence, and branding.
|
|
14
14
|
|
|
15
|
-
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-
|
|
15
|
+
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-controls/tag-input/.changeset/history).
|
|
16
16
|
|
|
17
17
|
[Component reference](docs/reference/README.md) contains focused API pages for each public component.
|
|
18
18
|
|
|
@@ -40,7 +40,7 @@ suggestion commits its value through normal tag validation, deduplication and
|
|
|
40
40
|
limits. Unknown text still commits with Enter/comma. Highlighting a suggestion
|
|
41
41
|
with arrows makes Enter choose it; IME confirmation never commits. onReject keeps
|
|
42
42
|
invalid or limited candidates editable. Use onDraftChange to drive remote options.
|
|
43
|
-
`
|
|
43
|
+
`size` selects small, medium or large control geometry. Native props/ref target the draft
|
|
44
44
|
input; className continues to target the encompassing tag surface.
|
|
45
45
|
|
|
46
46
|
TagInput owns the draft even when suggestions are enabled. It composes a native
|
|
@@ -49,3 +49,10 @@ identifier and then updates the draft through the tag validation result. It does
|
|
|
49
49
|
not transiently write the suggestion's display label. Suggestion navigation claims
|
|
50
50
|
Enter explicitly before the free-text handler, without reading rendered ARIA
|
|
51
51
|
attributes to infer another component's state.
|
|
52
|
+
|
|
53
|
+
## Sizing and density
|
|
54
|
+
|
|
55
|
+
size small, medium (default) or large selects the field minimum and chip geometry; wrapped tags can grow the field. htmlSize forwards native character width to the draft input. suggestions.density independently controls compact/comfortable option rows. Removal controls remain independently usable.
|
|
56
|
+
|
|
57
|
+
See the [shared sizing contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/sizing.md)
|
|
58
|
+
for native attributes, scope precedence, tokens and target behavior.
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,8 @@ var TagInput = (props) => {
|
|
|
59
59
|
readOnly,
|
|
60
60
|
onKeyDown,
|
|
61
61
|
onPaste,
|
|
62
|
-
|
|
62
|
+
size = "medium",
|
|
63
|
+
htmlSize,
|
|
63
64
|
draft: controlledDraft,
|
|
64
65
|
defaultDraft = "",
|
|
65
66
|
onDraftChange,
|
|
@@ -117,6 +118,7 @@ var TagInput = (props) => {
|
|
|
117
118
|
};
|
|
118
119
|
const inputProps = {
|
|
119
120
|
...restProps,
|
|
121
|
+
size: htmlSize,
|
|
120
122
|
form,
|
|
121
123
|
disabled,
|
|
122
124
|
readOnly,
|
|
@@ -166,9 +168,10 @@ var TagInput = (props) => {
|
|
|
166
168
|
"div",
|
|
167
169
|
{
|
|
168
170
|
dir: restProps.dir,
|
|
171
|
+
"data-size": size,
|
|
169
172
|
"data-gridui-outline-target": "",
|
|
170
173
|
"aria-invalid": restProps["aria-invalid"],
|
|
171
|
-
className: cn(controlVariants({ size
|
|
174
|
+
className: cn(controlVariants({ size }), "gridui-tag-input gridui-u-tag-input--flex gridui-u-tag-input--flex-wrap gridui-u-tag-input--items-center gridui-u-tag-input--gap-gridui-4 gridui-u-tag-input--has-[input:disabled]:opacity-50", className),
|
|
172
175
|
children: [
|
|
173
176
|
/* @__PURE__ */ jsx(
|
|
174
177
|
"ul",
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/tag-input/model.ts", "../src/tag-input/tag-input.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package Tag Input\n * @namespace TagInput\n * @description Model\n */\n\nexport type TagRejectionReason = \"duplicate\" | \"limit\" | \"invalid\";\n\nexport type TagRejection = {\n readonly value: string;\n readonly reason: TagRejectionReason;\n};\n\nexport const appendTags = (\n current: readonly string[], candidates: readonly string[], maxTags: number,\n validate?: (value: string) => boolean,\n): {\n values: string[];\n rejected: TagRejection[];\n} => {\n const values = [...current];\n const rejected: TagRejection[] = [];\n for (const candidate of candidates) {\n const value = candidate.trim();\n if (!value) {\n continue;\n }\n let reason: TagRejectionReason | undefined;\n if (values.includes(value)) {\n reason = \"duplicate\";\n }\n else if (validate && !validate(value)) {\n reason = \"invalid\";\n }\n else if (values.length >= maxTags) {\n reason = \"limit\";\n }\n if (reason) {\n rejected.push({\n value,\n reason,\n });\n } else {\n values.push(value);\n }\n }\n return {\n values,\n rejected,\n };\n};\n", "/**\n * @author WMXPY\n * @package Tag Input\n * @namespace TagInput\n * @description Tag Input\n */\n\nimport { appendTags, type TagRejection } from \"./model\";\nimport { Button } from \"@gridui/button\";\nimport { ListFieldControl, type ListFieldProps, useListField } from \"@gridui/form\";\nimport { controlVariants } from \"@gridui/input\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { AutocompleteSuggestions, type AutocompleteProps } from \"@gridui/select\";\nimport { cn } from \"@gridui/style-utils\";\nimport { X } from \"lucide-react\";\nimport { type ComponentPropsWithRef, type FC, useRef, useState } from \"react\";\n\nexport type TagInputProps = Omit<ComponentPropsWithRef<\"input\">, \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"size\"> & ListFieldProps & {\n readonly listLabel: string;\n readonly removeLabel: (tag: string) => string;\n readonly maxTags?: number;\n readonly controlSize?: \"standard\" | \"small\";\n readonly draft?: string;\n readonly defaultDraft?: string;\n readonly onDraftChange?: (value: string) => void;\n readonly suggestions?: Pick<AutocompleteProps, \"options\" | \"searchLabel\" | \"emptyLabel\" | \"loading\" | \"loadingLabel\" | \"errorLabel\" | \"resultCountLabel\" | \"filterOptions\" | \"portalContainer\">;\n readonly validateTag?: (tag: string) => boolean;\n readonly onReject?: (rejection: TagRejection) => void;\n};\n\nexport const TagInput: FC<TagInputProps> = (props: TagInputProps) => {\n const { value, defaultValue, onValueChange, listLabel, removeLabel, maxTags = Infinity, validateTag, onReject,\n className, ref, name, required, form, disabled, readOnly, onKeyDown, onPaste, controlSize = \"standard\",\n draft: controlledDraft, defaultDraft = \"\", onDraftChange, suggestions, ...restProps } = props;\n if (maxTags !== Infinity && (!Number.isSafeInteger(maxTags) || maxTags < 1)) {\n throw new RangeError(\"TagInput maxTags must be a positive integer.\");\n }\n const [\n localDraft,\n setLocalDraft,\n ] = useState(defaultDraft);\n const initialDraft = useRef(defaultDraft);\n const draft = controlledDraft ?? localDraft;\n const setDraft = (next: string) => {\n if (controlledDraft === undefined) {\n setLocalDraft(next);\n }\n onDraftChange?.(next);\n };\n const { selected, native, control, change, available } = useListField({\n value,\n defaultValue,\n onValueChange,\n disabled,\n readOnly,\n form,\n }, () => {\n setDraft(initialDraft.current);\n });\n const add = (candidates: string[]) => {\n if (!available()) {\n return;\n }\n const result = appendTags(selected, candidates, maxTags, validateTag);\n change(result.values);\n result.rejected.forEach(rejection => {\n onReject?.(rejection);\n });\n setDraft(result.rejected.filter(rejection => {\n return rejection.reason !== \"duplicate\";\n }).map(rejection => {\n return rejection.value;\n })\n .join(\", \"));\n };\n const remove = (tag: string) => {\n if (!available()) {\n return;\n }\n change(selected.filter(entry => {\n return entry !== tag;\n }));\n control.current?.focus();\n };\n const inputProps: Omit<ComponentPropsWithRef<\"input\">, \"value\" | \"defaultValue\" | \"type\"> & {\n value: string;\n } = {\n ...restProps,\n form,\n disabled,\n readOnly,\n value: draft,\n \"aria-required\": required,\n ref: (element) => {\n control.current = element;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n },\n className: cn(\"gridui-tag-input-editor gridui-u-tag-input--min-w-24 gridui-u-tag-input--w-full gridui-u-tag-input--min-h-0 gridui-u-tag-input--flex-1 gridui-u-tag-input--border-0 gridui-u-tag-input--bg-transparent gridui-u-tag-input--p-0 gridui-u-tag-input--text-foreground gridui-u-tag-input--type-input gridui-u-tag-input--outline-none\"),\n onChange: (event) => {\n setDraft(event.currentTarget.value);\n },\n onKeyDown: (event) => {\n if (event.defaultPrevented || isComposingKeyEvent(event.nativeEvent) || !available()) {\n return;\n }\n if ((event.key === \"Enter\" || event.key === \",\") && draft.trim()) {\n event.preventDefault(); add([draft]);\n }\n if (event.key === \"Backspace\" && !draft && selected.length) {\n event.preventDefault();\n const buttons = event.currentTarget.closest(\".gridui-tag-input\")?.querySelectorAll<HTMLButtonElement>(\"[data-tag-remove]\");\n buttons?.item(buttons.length - 1).focus();\n }\n },\n onPaste: (event) => {\n onPaste?.(event);\n if (event.defaultPrevented || !available()) {\n return;\n }\n const text = event.clipboardData.getData(\"text\");\n if (/[\\n,]/.test(text)) {\n event.preventDefault();\n const input = event.currentTarget;\n add(`${draft.slice(0, input.selectionStart ?? draft.length)}${text}${draft.slice(input.selectionEnd ?? draft.length)}`.split(/[\\n,]/));\n }\n },\n };\n return (<div\n dir={restProps.dir}\n data-gridui-outline-target=\"\"\n aria-invalid={restProps[\"aria-invalid\"]}\n className={cn(controlVariants({ size: controlSize }), \"gridui-tag-input gridui-u-tag-input--flex gridui-u-tag-input--flex-wrap gridui-u-tag-input--items-center gridui-u-tag-input--gap-gridui-4 gridui-u-tag-input--has-[input:disabled]:opacity-50\", className)}\n >\n <ul\n aria-label={listLabel}\n className=\"gridui-u-tag-input--contents gridui-u-tag-input--list-none\"\n >\n {selected.map(tag => {\n return (<li\n key={tag}\n className=\"gridui-u-tag-input--inline-flex gridui-u-tag-input--max-w-full gridui-u-tag-input--items-center gridui-u-tag-input--gap-gridui-4 gridui-u-tag-input--border gridui-u-tag-input--border-border gridui-u-tag-input--bg-surface gridui-u-tag-input--ps-gridui-8\"\n >\n <span\n className=\"gridui-u-tag-input--min-w-0 gridui-u-tag-input--wrap-anywhere\"\n >\n {tag}\n </span>\n <Button\n variant=\"quiet\"\n layout=\"icon\"\n size=\"small\"\n aria-label={removeLabel(tag)}\n disabled={disabled || readOnly}\n data-tag-remove=\"\"\n onClick={() => {\n remove(tag);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Backspace\" || event.key === \"Delete\") {\n event.preventDefault(); remove(tag);\n }\n }}\n >\n <X\n aria-hidden=\"true\"\n />\n </Button>\n </li>);\n })}\n </ul>\n {suggestions ? (<AutocompleteSuggestions\n {...suggestions}\n value={draft}\n disabled={disabled}\n readOnly={readOnly}\n dir={restProps.dir}\n form={form}\n onKeyDown={onKeyDown}\n rootClassName={cn(\"gridui-tag-input-suggestions gridui-u-tag-input--min-w-24 gridui-u-tag-input--w-0 gridui-u-tag-input--flex-1\")}\n onOptionSelect={(option) => {\n add([option.value]);\n }}\n >\n {getInputProps => (<input {...getInputProps(inputProps)} type=\"text\" />)}\n </AutocompleteSuggestions>)\n : (<input\n {...inputProps}\n type=\"text\"\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) {\n inputProps.onKeyDown?.(event);\n }\n }}\n />)}\n <ListFieldControl\n ref={native}\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n value={selected}\n onInvalidFocus={() => {\n control.current?.focus();\n }}\n >\n {selected.map(tag => {\n return (<option\n key={tag}\n value={tag}\n >\n {tag}\n </option>);\n })}\n </ListFieldControl>\n </div>);\n};\n"],
|
|
5
|
-
"mappings": ";AAcO,IAAM,aAAa,CACtB,SAA4B,YAA+B,SAC3D,aAIC;AACD,QAAM,SAAS,CAAC,GAAG,OAAO;AAC1B,QAAM,WAA2B,CAAC;AAClC,aAAW,aAAa,YAAY;AAChC,UAAM,QAAQ,UAAU,KAAK;AAC7B,QAAI,CAAC,OAAO;AACR;AAAA,IACJ;AACA,QAAI;AACJ,QAAI,OAAO,SAAS,KAAK,GAAG;AACxB,eAAS;AAAA,IACb,WACS,YAAY,CAAC,SAAS,KAAK,GAAG;AACnC,eAAS;AAAA,IACb,WACS,OAAO,UAAU,SAAS;AAC/B,eAAS;AAAA,IACb;AACA,QAAI,QAAQ;AACR,eAAS,KAAK;AAAA,QACV;AAAA,QACA;AAAA,MACJ,CAAC;AAAA,IACL,OAAO;AACH,aAAO,KAAK,KAAK;AAAA,IACrB;AAAA,EACJ;AACA,SAAO;AAAA,IACH;AAAA,IACA;AAAA,EACJ;AACJ;;;
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package Tag Input\n * @namespace TagInput\n * @description Model\n */\n\nexport type TagRejectionReason = \"duplicate\" | \"limit\" | \"invalid\";\n\nexport type TagRejection = {\n readonly value: string;\n readonly reason: TagRejectionReason;\n};\n\nexport const appendTags = (\n current: readonly string[], candidates: readonly string[], maxTags: number,\n validate?: (value: string) => boolean,\n): {\n values: string[];\n rejected: TagRejection[];\n} => {\n const values = [...current];\n const rejected: TagRejection[] = [];\n for (const candidate of candidates) {\n const value = candidate.trim();\n if (!value) {\n continue;\n }\n let reason: TagRejectionReason | undefined;\n if (values.includes(value)) {\n reason = \"duplicate\";\n }\n else if (validate && !validate(value)) {\n reason = \"invalid\";\n }\n else if (values.length >= maxTags) {\n reason = \"limit\";\n }\n if (reason) {\n rejected.push({\n value,\n reason,\n });\n } else {\n values.push(value);\n }\n }\n return {\n values,\n rejected,\n };\n};\n", "/**\n * @author WMXPY\n * @package Tag Input\n * @namespace TagInput\n * @description Tag Input\n */\n\nimport type { Size } from \"@gridui/theme\";\nimport { appendTags, type TagRejection } from \"./model\";\nimport { Button } from \"@gridui/button\";\nimport { ListFieldControl, type ListFieldProps, useListField } from \"@gridui/form\";\nimport { controlVariants } from \"@gridui/input\";\nimport { isComposingKeyEvent } from \"@gridui/interaction\";\nimport { AutocompleteSuggestions, type AutocompleteProps } from \"@gridui/select\";\nimport { cn } from \"@gridui/style-utils\";\nimport { X } from \"lucide-react\";\nimport { type ComponentPropsWithRef, type FC, useRef, useState } from \"react\";\n\nexport type TagInputProps = Omit<ComponentPropsWithRef<\"input\">, \"value\" | \"defaultValue\" | \"onChange\" | \"type\" | \"size\"> & ListFieldProps & {\n readonly listLabel: string;\n readonly removeLabel: (tag: string) => string;\n readonly maxTags?: number;\n readonly size?: Size;\n readonly htmlSize?: number | undefined;\n readonly draft?: string;\n readonly defaultDraft?: string;\n readonly onDraftChange?: (value: string) => void;\n readonly suggestions?: Pick<AutocompleteProps, \"options\" | \"searchLabel\" | \"emptyLabel\" | \"loading\" | \"loadingLabel\" | \"errorLabel\" | \"resultCountLabel\" | \"filterOptions\" | \"portalContainer\" | \"density\">;\n readonly validateTag?: (tag: string) => boolean;\n readonly onReject?: (rejection: TagRejection) => void;\n};\n\nexport const TagInput: FC<TagInputProps> = (props: TagInputProps) => {\n const { value, defaultValue, onValueChange, listLabel, removeLabel, maxTags = Infinity, validateTag, onReject,\n className, ref, name, required, form, disabled, readOnly, onKeyDown, onPaste, size = \"medium\", htmlSize,\n draft: controlledDraft, defaultDraft = \"\", onDraftChange, suggestions, ...restProps } = props;\n if (maxTags !== Infinity && (!Number.isSafeInteger(maxTags) || maxTags < 1)) {\n throw new RangeError(\"TagInput maxTags must be a positive integer.\");\n }\n const [\n localDraft,\n setLocalDraft,\n ] = useState(defaultDraft);\n const initialDraft = useRef(defaultDraft);\n const draft = controlledDraft ?? localDraft;\n const setDraft = (next: string) => {\n if (controlledDraft === undefined) {\n setLocalDraft(next);\n }\n onDraftChange?.(next);\n };\n const { selected, native, control, change, available } = useListField({\n value,\n defaultValue,\n onValueChange,\n disabled,\n readOnly,\n form,\n }, () => {\n setDraft(initialDraft.current);\n });\n const add = (candidates: string[]) => {\n if (!available()) {\n return;\n }\n const result = appendTags(selected, candidates, maxTags, validateTag);\n change(result.values);\n result.rejected.forEach(rejection => {\n onReject?.(rejection);\n });\n setDraft(result.rejected.filter(rejection => {\n return rejection.reason !== \"duplicate\";\n }).map(rejection => {\n return rejection.value;\n })\n .join(\", \"));\n };\n const remove = (tag: string) => {\n if (!available()) {\n return;\n }\n change(selected.filter(entry => {\n return entry !== tag;\n }));\n control.current?.focus();\n };\n const inputProps: Omit<ComponentPropsWithRef<\"input\">, \"value\" | \"defaultValue\" | \"type\"> & {\n value: string;\n } = {\n ...restProps,\n size: htmlSize,\n form,\n disabled,\n readOnly,\n value: draft,\n \"aria-required\": required,\n ref: (element) => {\n control.current = element;\n if (typeof ref === \"function\") {\n return ref(element);\n }\n if (ref) {\n ref.current = element;\n }\n },\n className: cn(\"gridui-tag-input-editor gridui-u-tag-input--min-w-24 gridui-u-tag-input--w-full gridui-u-tag-input--min-h-0 gridui-u-tag-input--flex-1 gridui-u-tag-input--border-0 gridui-u-tag-input--bg-transparent gridui-u-tag-input--p-0 gridui-u-tag-input--text-foreground gridui-u-tag-input--type-input gridui-u-tag-input--outline-none\"),\n onChange: (event) => {\n setDraft(event.currentTarget.value);\n },\n onKeyDown: (event) => {\n if (event.defaultPrevented || isComposingKeyEvent(event.nativeEvent) || !available()) {\n return;\n }\n if ((event.key === \"Enter\" || event.key === \",\") && draft.trim()) {\n event.preventDefault(); add([draft]);\n }\n if (event.key === \"Backspace\" && !draft && selected.length) {\n event.preventDefault();\n const buttons = event.currentTarget.closest(\".gridui-tag-input\")?.querySelectorAll<HTMLButtonElement>(\"[data-tag-remove]\");\n buttons?.item(buttons.length - 1).focus();\n }\n },\n onPaste: (event) => {\n onPaste?.(event);\n if (event.defaultPrevented || !available()) {\n return;\n }\n const text = event.clipboardData.getData(\"text\");\n if (/[\\n,]/.test(text)) {\n event.preventDefault();\n const input = event.currentTarget;\n add(`${draft.slice(0, input.selectionStart ?? draft.length)}${text}${draft.slice(input.selectionEnd ?? draft.length)}`.split(/[\\n,]/));\n }\n },\n };\n return (<div\n dir={restProps.dir}\n data-size={size}\n data-gridui-outline-target=\"\"\n aria-invalid={restProps[\"aria-invalid\"]}\n className={cn(controlVariants({ size }), \"gridui-tag-input gridui-u-tag-input--flex gridui-u-tag-input--flex-wrap gridui-u-tag-input--items-center gridui-u-tag-input--gap-gridui-4 gridui-u-tag-input--has-[input:disabled]:opacity-50\", className)}\n >\n <ul\n aria-label={listLabel}\n className=\"gridui-u-tag-input--contents gridui-u-tag-input--list-none\"\n >\n {selected.map(tag => {\n return (<li\n key={tag}\n className=\"gridui-u-tag-input--inline-flex gridui-u-tag-input--max-w-full gridui-u-tag-input--items-center gridui-u-tag-input--gap-gridui-4 gridui-u-tag-input--border gridui-u-tag-input--border-border gridui-u-tag-input--bg-surface gridui-u-tag-input--ps-gridui-8\"\n >\n <span\n className=\"gridui-u-tag-input--min-w-0 gridui-u-tag-input--wrap-anywhere\"\n >\n {tag}\n </span>\n <Button\n variant=\"quiet\"\n layout=\"icon\"\n size=\"small\"\n aria-label={removeLabel(tag)}\n disabled={disabled || readOnly}\n data-tag-remove=\"\"\n onClick={() => {\n remove(tag);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Backspace\" || event.key === \"Delete\") {\n event.preventDefault(); remove(tag);\n }\n }}\n >\n <X\n aria-hidden=\"true\"\n />\n </Button>\n </li>);\n })}\n </ul>\n {suggestions ? (<AutocompleteSuggestions\n {...suggestions}\n value={draft}\n disabled={disabled}\n readOnly={readOnly}\n dir={restProps.dir}\n form={form}\n onKeyDown={onKeyDown}\n rootClassName={cn(\"gridui-tag-input-suggestions gridui-u-tag-input--min-w-24 gridui-u-tag-input--w-0 gridui-u-tag-input--flex-1\")}\n onOptionSelect={(option) => {\n add([option.value]);\n }}\n >\n {getInputProps => (<input {...getInputProps(inputProps)} type=\"text\" />)}\n </AutocompleteSuggestions>)\n : (<input\n {...inputProps}\n type=\"text\"\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) {\n inputProps.onKeyDown?.(event);\n }\n }}\n />)}\n <ListFieldControl\n ref={native}\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n value={selected}\n onInvalidFocus={() => {\n control.current?.focus();\n }}\n >\n {selected.map(tag => {\n return (<option\n key={tag}\n value={tag}\n >\n {tag}\n </option>);\n })}\n </ListFieldControl>\n </div>);\n};\n"],
|
|
5
|
+
"mappings": ";AAcO,IAAM,aAAa,CACtB,SAA4B,YAA+B,SAC3D,aAIC;AACD,QAAM,SAAS,CAAC,GAAG,OAAO;AAC1B,QAAM,WAA2B,CAAC;AAClC,aAAW,aAAa,YAAY;AAChC,UAAM,QAAQ,UAAU,KAAK;AAC7B,QAAI,CAAC,OAAO;AACR;AAAA,IACJ;AACA,QAAI;AACJ,QAAI,OAAO,SAAS,KAAK,GAAG;AACxB,eAAS;AAAA,IACb,WACS,YAAY,CAAC,SAAS,KAAK,GAAG;AACnC,eAAS;AAAA,IACb,WACS,OAAO,UAAU,SAAS;AAC/B,eAAS;AAAA,IACb;AACA,QAAI,QAAQ;AACR,eAAS,KAAK;AAAA,QACV;AAAA,QACA;AAAA,MACJ,CAAC;AAAA,IACL,OAAO;AACH,aAAO,KAAK,KAAK;AAAA,IACrB;AAAA,EACJ;AACA,SAAO;AAAA,IACH;AAAA,IACA;AAAA,EACJ;AACJ;;;AC1CA,SAAS,cAAc;AACvB,SAAS,kBAAuC,oBAAoB;AACpE,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AACpC,SAAS,+BAAuD;AAChE,SAAS,UAAU;AACnB,SAAS,SAAS;AAClB,SAA8C,QAAQ,gBAAgB;AAmI9C,SAIJ,KAJI;AAnHjB,IAAM,WAA8B,CAAC,UAAyB;AACjE,QAAM;A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;AAAA,QACL;AAAA,QACC,cAAe;AAAA,UAAC;AAAA;AAAA,YACZ,GAAG;AAAA,YACJ,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA,KAAK,UAAU;AAAA,YACf;AAAA,YACA;AAAA,YACA,eAAe,GAAG,8GAA8G;AAAA,YAChI,gBAAgB,CAAC,WAAW;AACxB,kBAAI,CAAC,OAAO,KAAK,CAAC;AAAA,YACtB;AAAA,YAEC,6BAAkB,oBAAC,WAAO,GAAG,cAAc,UAAU,GAAG,MAAK,QAAO;AAAA;AAAA,QACzE,IACO;AAAA,UAAC;AAAA;AAAA,YACC,GAAG;AAAA,YACJ,MAAK;AAAA,YACL,WAAW,CAAC,UAAU;AAClB,0BAAY,KAAK;AACjB,kBAAI,CAAC,MAAM,kBAAkB;AACzB,2BAAW,YAAY,KAAK;AAAA,cAChC;AAAA,YACJ;AAAA;AAAA,QACJ;AAAA,QACJ;AAAA,UAAC;AAAA;AAAA,YACG,KAAK;AAAA,YACL;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP,gBAAgB,MAAM;AAClB,sBAAQ,SAAS,MAAM;AAAA,YAC3B;AAAA,YAEC,mBAAS,IAAI,SAAO;AACjB,qBAAQ;AAAA,gBAAC;AAAA;AAAA,kBAEL,OAAO;AAAA,kBAEN;AAAA;AAAA,gBAHI;AAAA,cAIT;AAAA,YACJ,CAAC;AAAA;AAAA,QACL;AAAA;AAAA;AAAA,EACJ;AACJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/styles.css
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
|
-
@layer theme {
|
|
5
|
-
:root, :host {
|
|
6
|
-
--spacing: 0.25rem;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
4
|
@layer utilities {
|
|
10
5
|
.gridui-u-button--pointer-events-none {
|
|
11
6
|
pointer-events: none;
|
|
@@ -13,24 +8,13 @@
|
|
|
13
8
|
.gridui-u-button--inline-flex {
|
|
14
9
|
display: inline-flex;
|
|
15
10
|
}
|
|
11
|
+
.gridui-u-button--size-\(--_gridui-button-min\) {
|
|
12
|
+
width: var(--_gridui-button-min);
|
|
13
|
+
height: var(--_gridui-button-min);
|
|
14
|
+
}
|
|
16
15
|
.gridui-u-button--h-full {
|
|
17
16
|
height: 100%;
|
|
18
17
|
}
|
|
19
|
-
.gridui-u-button--h-gridui-control {
|
|
20
|
-
height: var(--gridui-control-min-height);
|
|
21
|
-
}
|
|
22
|
-
.gridui-u-button--min-h-18 {
|
|
23
|
-
min-height: calc(var(--spacing) * 18);
|
|
24
|
-
}
|
|
25
|
-
.gridui-u-button--min-h-gridui-control {
|
|
26
|
-
min-height: var(--gridui-control-min-height);
|
|
27
|
-
}
|
|
28
|
-
.gridui-u-button--min-h-gridui-control-large {
|
|
29
|
-
min-height: var(--gridui-control-min-height-large);
|
|
30
|
-
}
|
|
31
|
-
.gridui-u-button--min-h-gridui-control-small {
|
|
32
|
-
min-height: var(--gridui-control-min-height-small);
|
|
33
|
-
}
|
|
34
18
|
.gridui-u-button--w-fit {
|
|
35
19
|
width: fit-content;
|
|
36
20
|
}
|
|
@@ -40,14 +24,14 @@
|
|
|
40
24
|
.gridui-u-button--w-gridui-64 {
|
|
41
25
|
width: var(--gridui-space-64);
|
|
42
26
|
}
|
|
43
|
-
.gridui-u-button--w-gridui-control {
|
|
44
|
-
width: var(--gridui-control-min-height);
|
|
45
|
-
}
|
|
46
27
|
.gridui-u-button--w-gridui-control-large {
|
|
47
|
-
width: var(--gridui-control-min-height-large);
|
|
28
|
+
width: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
29
|
+
}
|
|
30
|
+
.gridui-u-button--w-gridui-control-medium {
|
|
31
|
+
width: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
48
32
|
}
|
|
49
33
|
.gridui-u-button--w-gridui-control-small {
|
|
50
|
-
width: var(--gridui-control-min-height-small);
|
|
34
|
+
width: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
51
35
|
}
|
|
52
36
|
.gridui-u-button--max-w-full {
|
|
53
37
|
max-width: 100%;
|
|
@@ -253,35 +237,10 @@
|
|
|
253
237
|
.gridui-u-button--\[\&_svg\]\:shrink-0 svg {
|
|
254
238
|
flex-shrink: 0;
|
|
255
239
|
}
|
|
256
|
-
.gridui-u-button--\[\&\.gridui-button-extra-large\]\:h-18.gridui-button-extra-large {
|
|
257
|
-
height: calc(var(--spacing) * 18);
|
|
258
|
-
}
|
|
259
|
-
.gridui-u-button--\[\&\.gridui-button-extra-large\]\:w-18.gridui-button-extra-large {
|
|
260
|
-
width: calc(var(--spacing) * 18);
|
|
261
|
-
}
|
|
262
|
-
.gridui-u-button--\[\&\.gridui-button-large\]\:h-gridui-control-large.gridui-button-large {
|
|
263
|
-
height: var(--gridui-control-min-height-large);
|
|
264
|
-
}
|
|
265
|
-
.gridui-u-button--\[\&\.gridui-button-large\]\:w-gridui-control-large.gridui-button-large {
|
|
266
|
-
width: var(--gridui-control-min-height-large);
|
|
267
|
-
}
|
|
268
|
-
.gridui-u-button--\[\&\.gridui-button-small\]\:h-gridui-control-small.gridui-button-small {
|
|
269
|
-
height: var(--gridui-control-min-height-small);
|
|
270
|
-
}
|
|
271
|
-
.gridui-u-button--\[\&\.gridui-button-small\]\:w-gridui-control-small.gridui-button-small {
|
|
272
|
-
width: var(--gridui-control-min-height-small);
|
|
273
|
-
}
|
|
274
|
-
@media (pointer: coarse) {
|
|
275
|
-
.gridui-u-button--pointer-coarse\:\[\&\.gridui-button-small\]\:h-gridui-control.gridui-button-small {
|
|
276
|
-
height: var(--gridui-control-min-height);
|
|
277
|
-
}
|
|
278
|
-
.gridui-u-button--pointer-coarse\:\[\&\.gridui-button-small\]\:w-gridui-control.gridui-button-small {
|
|
279
|
-
width: var(--gridui-control-min-height);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
240
|
}
|
|
283
241
|
@layer components {
|
|
284
242
|
.gridui-button {
|
|
243
|
+
min-height: var(--_gridui-button-min);
|
|
285
244
|
border: 1px solid transparent;
|
|
286
245
|
}
|
|
287
246
|
.gridui-button-cell {
|
|
@@ -327,8 +286,27 @@
|
|
|
327
286
|
transform: var(--gridui-motion-transform, translate(calc(-1 * var(--gridui-space-4)), calc(-1 * var(--gridui-space-4))));
|
|
328
287
|
}
|
|
329
288
|
}
|
|
289
|
+
.gridui-button-medium {
|
|
290
|
+
--_gridui-button-min: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
291
|
+
padding-block: var(--gridui-space-8);
|
|
292
|
+
padding-inline: var(--gridui-space-16);
|
|
293
|
+
}
|
|
294
|
+
.gridui-button-small {
|
|
295
|
+
--_gridui-button-min: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
296
|
+
padding-block: var(--gridui-space-4);
|
|
297
|
+
padding-inline: var(--gridui-space-8);
|
|
298
|
+
}
|
|
299
|
+
.gridui-button-large {
|
|
300
|
+
--_gridui-button-min: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
301
|
+
padding-block: var(--gridui-space-8);
|
|
302
|
+
padding-inline: var(--gridui-space-24);
|
|
303
|
+
}
|
|
304
|
+
.gridui-button-extra-large {
|
|
305
|
+
--_gridui-button-min: max(var(--gridui-control-min-height-extra-large), var(--gridui-target-min-size));
|
|
306
|
+
padding-block: var(--gridui-space-16);
|
|
307
|
+
padding-inline: var(--gridui-space-24);
|
|
308
|
+
}
|
|
330
309
|
.gridui-button-group {
|
|
331
|
-
--gridui-button-group-padding-block: var(--gridui-space-24);
|
|
332
310
|
container: gridui-button-group / inline-size;
|
|
333
311
|
min-width: 0;
|
|
334
312
|
}
|
|
@@ -371,12 +349,19 @@
|
|
|
371
349
|
min-width: 0;
|
|
372
350
|
}
|
|
373
351
|
.gridui-button-group-items[data-layout="cells"] > [data-gridui-button-group-item] {
|
|
374
|
-
|
|
375
|
-
padding: var(--gridui-button-group-padding-block) var(--gridui-space-24);
|
|
352
|
+
padding-block: var(--gridui-button-group-padding-block, var(--_gridui-button-group-block, var(--gridui-space-8)));
|
|
376
353
|
border: 0;
|
|
377
354
|
border-radius: 0;
|
|
378
355
|
}
|
|
379
356
|
}
|
|
357
|
+
@layer components {
|
|
358
|
+
.gridui-button-group-items > [data-size="small"] {
|
|
359
|
+
--_gridui-button-group-block: var(--gridui-space-4);
|
|
360
|
+
}
|
|
361
|
+
.gridui-button-group-items > [data-size="extra-large"] {
|
|
362
|
+
--_gridui-button-group-block: var(--gridui-space-16);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
380
365
|
@property --tw-border-style {
|
|
381
366
|
syntax: "*";
|
|
382
367
|
inherits: false;
|
|
@@ -505,11 +490,6 @@
|
|
|
505
490
|
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
506
491
|
@layer properties;
|
|
507
492
|
@layer theme, base, components, utilities;
|
|
508
|
-
@layer theme {
|
|
509
|
-
:root, :host {
|
|
510
|
-
--spacing: 0.25rem;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
493
|
@layer utilities {
|
|
514
494
|
.gridui-u-overlay--z-\(--gridui-z-popover\) {
|
|
515
495
|
z-index: var(--gridui-z-popover);
|
|
@@ -524,9 +504,6 @@
|
|
|
524
504
|
width: var(--gridui-space-16);
|
|
525
505
|
height: var(--gridui-space-16);
|
|
526
506
|
}
|
|
527
|
-
.gridui-u-overlay--min-h-10 {
|
|
528
|
-
min-height: calc(var(--spacing) * 10);
|
|
529
|
-
}
|
|
530
507
|
.gridui-u-overlay--min-w-0 {
|
|
531
508
|
min-width: 0px;
|
|
532
509
|
}
|
|
@@ -565,15 +542,9 @@
|
|
|
565
542
|
.gridui-u-overlay--p-0 {
|
|
566
543
|
padding: 0px;
|
|
567
544
|
}
|
|
568
|
-
.gridui-u-overlay--p-gridui-8 {
|
|
569
|
-
padding: var(--gridui-space-8);
|
|
570
|
-
}
|
|
571
545
|
.gridui-u-overlay--px-gridui-8 {
|
|
572
546
|
padding-inline: var(--gridui-space-8);
|
|
573
547
|
}
|
|
574
|
-
.gridui-u-overlay--py-gridui-8 {
|
|
575
|
-
padding-block: var(--gridui-space-8);
|
|
576
|
-
}
|
|
577
548
|
.gridui-u-overlay--type-data {
|
|
578
549
|
font: var(--gridui-type-data);
|
|
579
550
|
font-family: var(--gridui-font-body);
|
|
@@ -680,6 +651,25 @@
|
|
|
680
651
|
animation: none;
|
|
681
652
|
}
|
|
682
653
|
}
|
|
654
|
+
.gridui-overlay-list {
|
|
655
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
656
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
657
|
+
}
|
|
658
|
+
.gridui-overlay-density-compact {
|
|
659
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-small);
|
|
660
|
+
--gridui-overlay-row-padding: var(--gridui-space-4);
|
|
661
|
+
}
|
|
662
|
+
.gridui-overlay-density-comfortable {
|
|
663
|
+
--gridui-overlay-row-min: var(--gridui-control-min-height-medium);
|
|
664
|
+
--gridui-overlay-row-padding: var(--gridui-space-8);
|
|
665
|
+
}
|
|
666
|
+
.gridui-overlay-list-item {
|
|
667
|
+
min-block-size: max(var(--gridui-overlay-row-min, var(--gridui-control-min-height-medium)), var(--gridui-target-min-size));
|
|
668
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
669
|
+
}
|
|
670
|
+
.gridui-overlay-list-label {
|
|
671
|
+
padding-block: var(--gridui-overlay-row-padding, var(--gridui-space-8));
|
|
672
|
+
}
|
|
683
673
|
}
|
|
684
674
|
@property --tw-border-style {
|
|
685
675
|
syntax: "*";
|
|
@@ -704,11 +694,14 @@
|
|
|
704
694
|
.gridui-u-input--inline-flex {
|
|
705
695
|
display: inline-flex;
|
|
706
696
|
}
|
|
707
|
-
.gridui-u-input--min-h-gridui-control {
|
|
708
|
-
min-height: var(--gridui-control-min-height);
|
|
697
|
+
.gridui-u-input--min-h-gridui-control-large {
|
|
698
|
+
min-height: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
699
|
+
}
|
|
700
|
+
.gridui-u-input--min-h-gridui-control-medium {
|
|
701
|
+
min-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
709
702
|
}
|
|
710
703
|
.gridui-u-input--min-h-gridui-control-small {
|
|
711
|
-
min-height: var(--gridui-control-min-height-small);
|
|
704
|
+
min-height: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
712
705
|
}
|
|
713
706
|
.gridui-u-input--w-0 {
|
|
714
707
|
width: 0px;
|
|
@@ -767,9 +760,15 @@
|
|
|
767
760
|
.gridui-u-input--px-gridui-8 {
|
|
768
761
|
padding-inline: var(--gridui-space-8);
|
|
769
762
|
}
|
|
763
|
+
.gridui-u-input--px-gridui-16 {
|
|
764
|
+
padding-inline: var(--gridui-space-16);
|
|
765
|
+
}
|
|
770
766
|
.gridui-u-input--py-gridui-4 {
|
|
771
767
|
padding-block: var(--gridui-space-4);
|
|
772
768
|
}
|
|
769
|
+
.gridui-u-input--py-gridui-8 {
|
|
770
|
+
padding-block: var(--gridui-space-8);
|
|
771
|
+
}
|
|
773
772
|
.gridui-u-input--type-input {
|
|
774
773
|
font: var(--gridui-type-input);
|
|
775
774
|
font-family: var(--gridui-font-body);
|
|
@@ -783,6 +782,21 @@
|
|
|
783
782
|
.gridui-u-input--text-foreground {
|
|
784
783
|
color: var(--gridui-foreground);
|
|
785
784
|
}
|
|
785
|
+
.gridui-u-input--\[--gridui-control-icon\:var\(--gridui-icon-size\)\] {
|
|
786
|
+
--gridui-control-icon: var(--gridui-icon-size);
|
|
787
|
+
}
|
|
788
|
+
.gridui-u-input--\[--gridui-control-icon\:var\(--gridui-icon-size-large\)\] {
|
|
789
|
+
--gridui-control-icon: var(--gridui-icon-size-large);
|
|
790
|
+
}
|
|
791
|
+
.gridui-u-input--\[--gridui-control-size\:max\(var\(--gridui-control-min-height-large\)\,var\(--gridui-target-min-size\)\)\] {
|
|
792
|
+
--gridui-control-size: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
793
|
+
}
|
|
794
|
+
.gridui-u-input--\[--gridui-control-size\:max\(var\(--gridui-control-min-height-medium\)\,var\(--gridui-target-min-size\)\)\] {
|
|
795
|
+
--gridui-control-size: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
796
|
+
}
|
|
797
|
+
.gridui-u-input--\[--gridui-control-size\:max\(var\(--gridui-control-min-height-small\)\,var\(--gridui-target-min-size\)\)\] {
|
|
798
|
+
--gridui-control-size: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
799
|
+
}
|
|
786
800
|
.gridui-u-input--disabled\:cursor-not-allowed:disabled {
|
|
787
801
|
cursor: not-allowed;
|
|
788
802
|
}
|
|
@@ -792,6 +806,10 @@
|
|
|
792
806
|
.gridui-u-input--aria-invalid\:border-status-danger-border[aria-invalid="true"] {
|
|
793
807
|
border-color: var(--gridui-status-danger-border);
|
|
794
808
|
}
|
|
809
|
+
.gridui-u-input--\[\&_svg\]\:size-\(--gridui-control-icon\) svg {
|
|
810
|
+
width: var(--gridui-control-icon);
|
|
811
|
+
height: var(--gridui-control-icon);
|
|
812
|
+
}
|
|
795
813
|
.gridui-u-input--\[\&\>svg\]\:size-gridui-16 > svg {
|
|
796
814
|
width: var(--gridui-space-16);
|
|
797
815
|
height: var(--gridui-space-16);
|
|
@@ -799,7 +817,7 @@
|
|
|
799
817
|
}
|
|
800
818
|
@layer components {
|
|
801
819
|
.gridui-input-group {
|
|
802
|
-
--_gridui-input-height: var(--gridui-control-min-height);
|
|
820
|
+
--_gridui-input-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
803
821
|
position: relative;
|
|
804
822
|
display: flex;
|
|
805
823
|
flex-wrap: wrap;
|
|
@@ -812,8 +830,8 @@
|
|
|
812
830
|
border-radius: var(--gridui-control-radius);
|
|
813
831
|
color: var(--gridui-foreground);
|
|
814
832
|
background: var(--gridui-background);
|
|
815
|
-
&[data-
|
|
816
|
-
--_gridui-input-height: var(--gridui-control-min-height-small);
|
|
833
|
+
&[data-size="small"] {
|
|
834
|
+
--_gridui-input-height: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
817
835
|
}
|
|
818
836
|
> .gridui-control {
|
|
819
837
|
flex: 1;
|
|
@@ -869,9 +887,12 @@
|
|
|
869
887
|
.gridui-input-group-button {
|
|
870
888
|
flex: none;
|
|
871
889
|
}
|
|
890
|
+
.gridui-input-group[data-size="large"] {
|
|
891
|
+
--_gridui-input-height: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
892
|
+
}
|
|
872
893
|
.gridui-textarea-frame {
|
|
873
894
|
--_gridui-textarea-padding: var(--gridui-space-8);
|
|
874
|
-
--_gridui-textarea-control-minimum: var(--gridui-control-min-height);
|
|
895
|
+
--_gridui-textarea-control-minimum: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
875
896
|
--_gridui-textarea-resize-height: 0px;
|
|
876
897
|
--_gridui-textarea-footer-height: 0px;
|
|
877
898
|
--_gridui-textarea-border: 2px;
|
|
@@ -882,9 +903,9 @@
|
|
|
882
903
|
flex-direction: column;
|
|
883
904
|
min-height: calc(var(--_gridui-textarea-min-body) + var(--_gridui-textarea-chrome));
|
|
884
905
|
padding: 0;
|
|
885
|
-
&[data-
|
|
906
|
+
&[data-size="small"] {
|
|
886
907
|
--_gridui-textarea-padding: var(--gridui-space-4);
|
|
887
|
-
--_gridui-textarea-control-minimum: var(--gridui-control-min-height-small);
|
|
908
|
+
--_gridui-textarea-control-minimum: max(var(--gridui-control-min-height-small), var(--gridui-target-min-size));
|
|
888
909
|
}
|
|
889
910
|
&[data-grouped] {
|
|
890
911
|
--_gridui-textarea-border: 0px;
|
|
@@ -896,7 +917,7 @@
|
|
|
896
917
|
--_gridui-textarea-resize-height: var(--gridui-space-32);
|
|
897
918
|
}
|
|
898
919
|
&:is([data-resize-handle="footer"], [data-footer]) {
|
|
899
|
-
--_gridui-textarea-footer-height: var(--gridui-control-min-height);
|
|
920
|
+
--_gridui-textarea-footer-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
900
921
|
}
|
|
901
922
|
&[data-max-rows] {
|
|
902
923
|
max-height: calc(var(--_gridui-textarea-max-rows) * 1lh + 2 * var(--_gridui-textarea-padding) + var(--_gridui-textarea-chrome));
|
|
@@ -952,7 +973,7 @@
|
|
|
952
973
|
display: flex;
|
|
953
974
|
flex: none;
|
|
954
975
|
align-items: stretch;
|
|
955
|
-
min-height: var(--gridui-control-min-height);
|
|
976
|
+
min-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
956
977
|
border-top: 1px solid;
|
|
957
978
|
border-color: inherit;
|
|
958
979
|
background: var(--gridui-surface);
|
|
@@ -972,7 +993,7 @@
|
|
|
972
993
|
flex: none;
|
|
973
994
|
align-items: center;
|
|
974
995
|
justify-content: center;
|
|
975
|
-
width: var(--gridui-control-min-height);
|
|
996
|
+
width: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
976
997
|
margin: 0;
|
|
977
998
|
padding: 0;
|
|
978
999
|
border: 0;
|
|
@@ -1011,9 +1032,12 @@
|
|
|
1011
1032
|
}
|
|
1012
1033
|
@media (pointer: coarse) {
|
|
1013
1034
|
.gridui-textarea-frame:is([data-resize-handle="corner"], [data-resize-handle="edge"]) {
|
|
1014
|
-
--_gridui-textarea-resize-height: var(--gridui-control-min-height);
|
|
1035
|
+
--_gridui-textarea-resize-height: max(var(--gridui-control-min-height-medium), var(--gridui-target-min-size));
|
|
1015
1036
|
}
|
|
1016
1037
|
}
|
|
1038
|
+
.gridui-textarea-frame[data-size="large"] {
|
|
1039
|
+
--_gridui-textarea-control-minimum: max(var(--gridui-control-min-height-large), var(--gridui-target-min-size));
|
|
1040
|
+
}
|
|
1017
1041
|
.gridui-input-group > input[type="search"]::-webkit-search-cancel-button {
|
|
1018
1042
|
appearance: none;
|
|
1019
1043
|
}
|
|
@@ -1117,12 +1141,12 @@
|
|
|
1117
1141
|
.gridui-u-select--max-w-\(--available-width\) {
|
|
1118
1142
|
max-width: var(--available-width);
|
|
1119
1143
|
}
|
|
1144
|
+
.gridui-u-select--min-w-\(--gridui-control-size\) {
|
|
1145
|
+
min-width: var(--gridui-control-size);
|
|
1146
|
+
}
|
|
1120
1147
|
.gridui-u-select--min-w-0 {
|
|
1121
1148
|
min-width: 0px;
|
|
1122
1149
|
}
|
|
1123
|
-
.gridui-u-select--min-w-11 {
|
|
1124
|
-
min-width: calc(var(--spacing) * 11);
|
|
1125
|
-
}
|
|
1126
1150
|
.gridui-u-select--flex-1 {
|
|
1127
1151
|
flex: 1;
|
|
1128
1152
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @namespace TagInput
|
|
5
5
|
* @description Tag Input
|
|
6
6
|
*/
|
|
7
|
+
import type { Size } from "@gridui/theme";
|
|
7
8
|
import { type TagRejection } from "./model";
|
|
8
9
|
import { type ListFieldProps } from "@gridui/form";
|
|
9
10
|
import { type AutocompleteProps } from "@gridui/select";
|
|
@@ -12,11 +13,12 @@ export type TagInputProps = Omit<ComponentPropsWithRef<"input">, "value" | "defa
|
|
|
12
13
|
readonly listLabel: string;
|
|
13
14
|
readonly removeLabel: (tag: string) => string;
|
|
14
15
|
readonly maxTags?: number;
|
|
15
|
-
readonly
|
|
16
|
+
readonly size?: Size;
|
|
17
|
+
readonly htmlSize?: number | undefined;
|
|
16
18
|
readonly draft?: string;
|
|
17
19
|
readonly defaultDraft?: string;
|
|
18
20
|
readonly onDraftChange?: (value: string) => void;
|
|
19
|
-
readonly suggestions?: Pick<AutocompleteProps, "options" | "searchLabel" | "emptyLabel" | "loading" | "loadingLabel" | "errorLabel" | "resultCountLabel" | "filterOptions" | "portalContainer">;
|
|
21
|
+
readonly suggestions?: Pick<AutocompleteProps, "options" | "searchLabel" | "emptyLabel" | "loading" | "loadingLabel" | "errorLabel" | "resultCountLabel" | "filterOptions" | "portalContainer" | "density">;
|
|
20
22
|
readonly validateTag?: (tag: string) => boolean;
|
|
21
23
|
readonly onReject?: (rejection: TagRejection) => void;
|
|
22
24
|
};
|
package/docs/catalog.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/tag-input",
|
|
4
|
-
"version": "
|
|
5
|
-
"category": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"category": "controls",
|
|
6
6
|
"description": "GridUI React tag input",
|
|
7
7
|
"usage": "Input supplies the control surface, Button supplies tag actions, and Form hides the native multiple-value bridge. Applications own routes, labels, state persistence, and branding.",
|
|
8
8
|
"documentation": [
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
],
|
|
44
44
|
"styledImport": "@gridui/tag-input/styled",
|
|
45
45
|
"examples": [
|
|
46
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
47
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
48
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
49
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
46
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/tag-input/stories/editing-tags.mdx",
|
|
47
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/tag-input/stories/getting-started.mdx",
|
|
48
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/tag-input/stories/suggestions.mdx",
|
|
49
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/tag-input/stories/tag-input.stories.tsx"
|
|
50
50
|
]
|
|
51
51
|
}
|
|
@@ -11,9 +11,9 @@ import "@gridui/theme/styles.css";
|
|
|
11
11
|
import "@gridui/tag-input/styles.css";
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
14
|
+
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/tag-input/README.md) for shared behavior and stylesheet dependencies.
|
|
15
15
|
|
|
16
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
16
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-controls/tag-input/stories/tag-input.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
17
17
|
|
|
18
18
|
## API
|
|
19
19
|
|
|
@@ -97,11 +97,17 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
97
97
|
|
|
98
98
|
Default: ``Infinity``
|
|
99
99
|
|
|
100
|
-
###
|
|
100
|
+
### size
|
|
101
101
|
|
|
102
|
-
``
|
|
102
|
+
``Size | undefined`` · Optional
|
|
103
103
|
|
|
104
|
-
Default: ``"
|
|
104
|
+
Default: ``"medium"``
|
|
105
|
+
|
|
106
|
+
Component size preset.
|
|
107
|
+
|
|
108
|
+
### htmlSize
|
|
109
|
+
|
|
110
|
+
``number | undefined`` · Optional
|
|
105
111
|
|
|
106
112
|
### draft
|
|
107
113
|
|
|
@@ -121,7 +127,7 @@ Called when the corresponding interaction occurs; inspect the arguments in Actio
|
|
|
121
127
|
|
|
122
128
|
### suggestions
|
|
123
129
|
|
|
124
|
-
``Pick<AutocompleteProps, "loading" | "filterOptions" | "loadingLabel" | "errorLabel" | "resultCountLabel" | "options" | "searchLabel" | "emptyLabel" | "portalContainer"> | undefined`` · Optional
|
|
130
|
+
``Pick<AutocompleteProps, "loading" | "density" | "filterOptions" | "loadingLabel" | "errorLabel" | "resultCountLabel" | "options" | "searchLabel" | "emptyLabel" | "portalContainer"> | undefined`` · Optional
|
|
125
131
|
|
|
126
132
|
### validateTag
|
|
127
133
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/tag-input",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "GridUI React tag input",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"react-dom": "^19.2.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@gridui/button": "^
|
|
36
|
-
"@gridui/form": "^4.2.
|
|
37
|
-
"@gridui/input": "^
|
|
35
|
+
"@gridui/button": "^6.0.0",
|
|
36
|
+
"@gridui/form": "^4.2.1",
|
|
37
|
+
"@gridui/input": "^5.0.0",
|
|
38
38
|
"@gridui/interaction": "^1.3.0",
|
|
39
|
-
"@gridui/select": "^
|
|
40
|
-
"@gridui/style-utils": "^4.
|
|
41
|
-
"@gridui/theme": "^
|
|
42
|
-
"lucide-react": "1.
|
|
39
|
+
"@gridui/select": "^2.0.0",
|
|
40
|
+
"@gridui/style-utils": "^4.1.0",
|
|
41
|
+
"@gridui/theme": "^5.0.0",
|
|
42
|
+
"lucide-react": "1.73.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@gridui-internal/configuration": "0.0.0-internal",
|