@gridui/tag-input 1.1.4 → 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 +22 -8
- package/dist/index.js +5 -2
- package/dist/index.js.map +2 -2
- package/dist/styled.js +6 -0
- package/dist/styles.css +1265 -0
- package/dist/styles.local.css +125 -0
- package/dist/tag-input/tag-input.d.ts +4 -2
- package/docs/catalog.json +7 -6
- package/docs/reference/tag-input.md +12 -6
- package/package.json +22 -10
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties;
|
|
3
|
+
@layer theme, base, components, utilities;
|
|
4
|
+
@layer theme {
|
|
5
|
+
:root, :host {
|
|
6
|
+
--spacing: 0.25rem;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
@layer utilities {
|
|
10
|
+
.gridui-u-tag-input--contents {
|
|
11
|
+
display: contents;
|
|
12
|
+
}
|
|
13
|
+
.gridui-u-tag-input--flex {
|
|
14
|
+
display: flex;
|
|
15
|
+
}
|
|
16
|
+
.gridui-u-tag-input--inline-flex {
|
|
17
|
+
display: inline-flex;
|
|
18
|
+
}
|
|
19
|
+
.gridui-u-tag-input--min-h-0 {
|
|
20
|
+
min-height: 0px;
|
|
21
|
+
}
|
|
22
|
+
.gridui-u-tag-input--w-0 {
|
|
23
|
+
width: 0px;
|
|
24
|
+
}
|
|
25
|
+
.gridui-u-tag-input--w-full {
|
|
26
|
+
width: 100%;
|
|
27
|
+
}
|
|
28
|
+
.gridui-u-tag-input--max-w-full {
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
}
|
|
31
|
+
.gridui-u-tag-input--min-w-0 {
|
|
32
|
+
min-width: 0px;
|
|
33
|
+
}
|
|
34
|
+
.gridui-u-tag-input--min-w-24 {
|
|
35
|
+
min-width: calc(var(--spacing) * 24);
|
|
36
|
+
}
|
|
37
|
+
.gridui-u-tag-input--flex-1 {
|
|
38
|
+
flex: 1;
|
|
39
|
+
}
|
|
40
|
+
.gridui-u-tag-input--list-none {
|
|
41
|
+
list-style-type: none;
|
|
42
|
+
}
|
|
43
|
+
.gridui-u-tag-input--flex-wrap {
|
|
44
|
+
flex-wrap: wrap;
|
|
45
|
+
}
|
|
46
|
+
.gridui-u-tag-input--items-center {
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
.gridui-u-tag-input--gap-gridui-4 {
|
|
50
|
+
gap: var(--gridui-space-4);
|
|
51
|
+
}
|
|
52
|
+
.gridui-u-tag-input--border {
|
|
53
|
+
border-style: var(--tw-border-style);
|
|
54
|
+
border-width: 1px;
|
|
55
|
+
}
|
|
56
|
+
.gridui-u-tag-input--border-0 {
|
|
57
|
+
border-style: var(--tw-border-style);
|
|
58
|
+
border-width: 0px;
|
|
59
|
+
}
|
|
60
|
+
.gridui-u-tag-input--border-border {
|
|
61
|
+
border-color: var(--gridui-border);
|
|
62
|
+
}
|
|
63
|
+
.gridui-u-tag-input--bg-surface {
|
|
64
|
+
background-color: var(--gridui-surface);
|
|
65
|
+
}
|
|
66
|
+
.gridui-u-tag-input--bg-transparent {
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
.gridui-u-tag-input--p-0 {
|
|
70
|
+
padding: 0px;
|
|
71
|
+
}
|
|
72
|
+
.gridui-u-tag-input--ps-gridui-8 {
|
|
73
|
+
padding-inline-start: var(--gridui-space-8);
|
|
74
|
+
}
|
|
75
|
+
.gridui-u-tag-input--type-input {
|
|
76
|
+
font: var(--gridui-type-input);
|
|
77
|
+
font-family: var(--gridui-font-body);
|
|
78
|
+
letter-spacing: normal;
|
|
79
|
+
}
|
|
80
|
+
.gridui-u-tag-input--wrap-anywhere {
|
|
81
|
+
overflow-wrap: anywhere;
|
|
82
|
+
}
|
|
83
|
+
.gridui-u-tag-input--text-foreground {
|
|
84
|
+
color: var(--gridui-foreground);
|
|
85
|
+
}
|
|
86
|
+
.gridui-u-tag-input--outline-none {
|
|
87
|
+
--tw-outline-style: none;
|
|
88
|
+
outline-style: none;
|
|
89
|
+
}
|
|
90
|
+
.gridui-u-tag-input--has-\[input\:disabled\]\:opacity-50:has(:is(input:disabled)) {
|
|
91
|
+
opacity: 50%;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
@layer components {
|
|
95
|
+
.gridui-tag-input {
|
|
96
|
+
position: relative;
|
|
97
|
+
&:has(input:focus-visible) {
|
|
98
|
+
z-index: var(--gridui-z-interaction);
|
|
99
|
+
outline: var(--gridui-focus-width) solid var(--gridui-focus-color);
|
|
100
|
+
outline-offset: var(--gridui-focus-offset);
|
|
101
|
+
}
|
|
102
|
+
@media (hover: hover) and (pointer: fine) {
|
|
103
|
+
&:has(input:hover:not(:disabled, [readonly])):not(:has(:focus-visible)) {
|
|
104
|
+
z-index: var(--gridui-z-boundary);
|
|
105
|
+
outline: var(--gridui-hover-width) solid var(--gridui-focus-color);
|
|
106
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
107
|
+
outline: var(--gridui-hover-width) solid color-mix(in srgb, var(--gridui-focus-color) var(--gridui-hover-opacity), transparent);
|
|
108
|
+
}
|
|
109
|
+
outline-offset: var(--gridui-hover-offset);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
@property --tw-border-style {
|
|
115
|
+
syntax: "*";
|
|
116
|
+
inherits: false;
|
|
117
|
+
initial-value: solid;
|
|
118
|
+
}
|
|
119
|
+
@layer properties {
|
|
120
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
121
|
+
*, ::before, ::after, ::backdrop {
|
|
122
|
+
--tw-border-style: solid;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -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": [
|
|
@@ -41,10 +41,11 @@
|
|
|
41
41
|
"@gridui/select/styles.css",
|
|
42
42
|
"@gridui/tag-input/styles.css"
|
|
43
43
|
],
|
|
44
|
+
"styledImport": "@gridui/tag-input/styled",
|
|
44
45
|
"examples": [
|
|
45
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
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-
|
|
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"
|
|
49
50
|
]
|
|
50
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",
|
|
@@ -10,14 +10,19 @@
|
|
|
10
10
|
"docs"
|
|
11
11
|
],
|
|
12
12
|
"sideEffects": [
|
|
13
|
-
"**/*.css"
|
|
13
|
+
"**/*.css",
|
|
14
|
+
"./dist/styled.js"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
17
18
|
"types": "./dist/index.d.ts",
|
|
18
19
|
"import": "./dist/index.js"
|
|
19
20
|
},
|
|
20
|
-
"./styles.css": "./dist/styles.css"
|
|
21
|
+
"./styles.css": "./dist/styles.css",
|
|
22
|
+
"./styled": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/styled.js"
|
|
25
|
+
}
|
|
21
26
|
},
|
|
22
27
|
"publishConfig": {
|
|
23
28
|
"access": "public"
|
|
@@ -27,14 +32,14 @@
|
|
|
27
32
|
"react-dom": "^19.2.0"
|
|
28
33
|
},
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@gridui/button": "^
|
|
31
|
-
"@gridui/form": "^4.1
|
|
32
|
-
"@gridui/input": "^
|
|
35
|
+
"@gridui/button": "^6.0.0",
|
|
36
|
+
"@gridui/form": "^4.2.1",
|
|
37
|
+
"@gridui/input": "^5.0.0",
|
|
33
38
|
"@gridui/interaction": "^1.3.0",
|
|
34
|
-
"@gridui/select": "^
|
|
35
|
-
"@gridui/style-utils": "^4.
|
|
36
|
-
"@gridui/theme": "^
|
|
37
|
-
"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"
|
|
38
43
|
},
|
|
39
44
|
"devDependencies": {
|
|
40
45
|
"@gridui-internal/configuration": "0.0.0-internal",
|
|
@@ -49,6 +54,13 @@
|
|
|
49
54
|
"react-dom": "19.3.1",
|
|
50
55
|
"typescript": "6.0.3"
|
|
51
56
|
},
|
|
57
|
+
"gridui": {
|
|
58
|
+
"styleOrder": [
|
|
59
|
+
"@gridui/button",
|
|
60
|
+
"@gridui/input",
|
|
61
|
+
"@gridui/form"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
52
64
|
"scripts": {
|
|
53
65
|
"build": "node ../../scripts/compilation/package.ts",
|
|
54
66
|
"compile": "tsc --project tsconfig.json",
|