@molecule/app-tag-input-react 1.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/LICENSE ADDED
@@ -0,0 +1,115 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship.
43
+
44
+ "Contribution" shall mean any work of authorship, including the
45
+ original version of the Work and any modifications or additions
46
+ to that Work, that is intentionally submitted to the Licensor for
47
+ inclusion in the Work by the copyright owner or by an individual or
48
+ Legal Entity authorized to submit on behalf of the copyright owner.
49
+
50
+ "Contributor" shall mean Licensor and any individual or Legal Entity
51
+ on behalf of whom a Contribution has been received by the Licensor and
52
+ subsequently incorporated within the Work.
53
+
54
+ 2. Grant of Copyright License. Subject to the terms and conditions of
55
+ this License, each Contributor hereby grants to You a perpetual,
56
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
57
+ copyright license to reproduce, prepare Derivative Works of,
58
+ publicly display, publicly perform, sublicense, and distribute the
59
+ Work and such Derivative Works in Source or Object form.
60
+
61
+ 3. Grant of Patent License. Subject to the terms and conditions of
62
+ this License, each Contributor hereby grants to You a perpetual,
63
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
64
+ patent license to make, have made, use, offer to sell, sell, import,
65
+ and otherwise transfer the Work.
66
+
67
+ 4. Redistribution. You may reproduce and distribute copies of the
68
+ Work or Derivative Works thereof in any medium, with or without
69
+ modifications, and in Source or Object form, provided that You
70
+ meet the following conditions:
71
+
72
+ (a) You must give any other recipients of the Work or
73
+ Derivative Works a copy of this License; and
74
+
75
+ (b) You must cause any modified files to carry prominent notices
76
+ stating that You changed the files; and
77
+
78
+ (c) You must retain, in the Source form of any Derivative Works
79
+ that You distribute, all copyright, patent, trademark, and
80
+ attribution notices from the Source form of the Work,
81
+ excluding those notices that do not pertain to any part of
82
+ the Derivative Works; and
83
+
84
+ (d) If the Work includes a "NOTICE" text file as part of its
85
+ distribution, then any Derivative Works that You distribute must
86
+ include a readable copy of the attribution notices contained
87
+ within such NOTICE file.
88
+
89
+ 5. Submission of Contributions.
90
+
91
+ 6. Trademarks. This License does not grant permission to use the trade
92
+ names, trademarks, service marks, or product names of the Licensor.
93
+
94
+ 7. Disclaimer of Warranty. Unless required by applicable law or
95
+ agreed to in writing, Licensor provides the Work on an "AS IS" BASIS,
96
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
97
+
98
+ 8. Limitation of Liability. In no event and under no legal theory shall
99
+ any Contributor be liable to You for damages.
100
+
101
+ 9. Accepting Warranty or Additional Liability.
102
+
103
+ Copyright 2026 Molecule Dev, Inc.
104
+
105
+ Licensed under the Apache License, Version 2.0 (the "License");
106
+ you may not use this file except in compliance with the License.
107
+ You may obtain a copy of the License at
108
+
109
+ http://www.apache.org/licenses/LICENSE-2.0
110
+
111
+ Unless required by applicable law or agreed to in writing, software
112
+ distributed under the License is distributed on an "AS IS" BASIS,
113
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114
+ See the License for the specific language governing permissions and
115
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,164 @@
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-08-04T00:41:21.341Z
7
+ -->
8
+
9
+ # @molecule/app-tag-input-react
10
+
11
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
12
+ > It is written to be read by coding agents as much as by people, and is generated from this
13
+ > package's source — edit `src/index.ts` JSDoc, not this file.
14
+
15
+ React tag-token input and tag-chip display.
16
+
17
+ Exports:
18
+
19
+ - `<TagChip>` — standalone labeled chip with optional remove button.
20
+ - `<TagInput>` — controlled tokenizer: Enter, comma, or Tab adds the
21
+ draft; blur commits a non-empty draft; Backspace on an empty field
22
+ removes the last token.
23
+
24
+ ## Quick Start
25
+
26
+ ```tsx
27
+ import { useState } from 'react'
28
+
29
+ import { TagChip, TagInput } from '@molecule/app-tag-input-react'
30
+
31
+ function TagEditor() {
32
+ const [tags, setTags] = useState<string[]>(['react'])
33
+ return (
34
+ <>
35
+ <TagInput value={tags} onChange={setTags} placeholder="Add a tag…" maxTags={10} />
36
+ <TagChip onRemove={() => setTags(tags.filter((t) => t !== 'react'))}>react</TagChip>
37
+ </>
38
+ )
39
+ }
40
+ ```
41
+
42
+ ## Type
43
+
44
+ `feature`
45
+
46
+ ## Installation
47
+
48
+ ```bash
49
+ npm install @molecule/app-tag-input-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
50
+ npm install -D @types/react
51
+ ```
52
+
53
+ ## API
54
+
55
+ ### Interfaces
56
+
57
+ #### `TagChipProps`
58
+
59
+ Props for the {@link TagChip} component.
60
+
61
+ ```typescript
62
+ interface TagChipProps {
63
+ /** Visible tag text. */
64
+ children: ReactNode
65
+ /** Optional remove callback — renders an `×` button when provided. */
66
+ onRemove?: () => void
67
+ /** Optional click callback for the chip body. */
68
+ onClick?: () => void
69
+ /** Extra classes. */
70
+ className?: string
71
+ }
72
+ ```
73
+
74
+ #### `TagInputProps`
75
+
76
+ Props for the {@link TagInput} component.
77
+
78
+ ```typescript
79
+ interface TagInputProps {
80
+ /** Controlled list of tag values. */
81
+ value: string[]
82
+ /** Called whenever the tag list changes. */
83
+ onChange: (next: string[]) => void
84
+ /** Placeholder shown in the text input when no tokens exist yet. */
85
+ placeholder?: string
86
+ /**
87
+ * Validate/transform an input before adding. Return `null` to reject.
88
+ * Default trims whitespace and rejects empty + duplicate entries.
89
+ */
90
+ normalize?: (raw: string, current: string[]) => string | null
91
+ /** Max tags allowed. When reached, further input is ignored. */
92
+ maxTags?: number
93
+ /** Extra classes on the outer wrapper. */
94
+ className?: string
95
+ }
96
+ ```
97
+
98
+ ### Functions
99
+
100
+ #### `TagChip(props)`
101
+
102
+ Small labeled chip with an optional close button. Used inside
103
+ `<TagInput>` but also usable standalone as a label display element.
104
+
105
+ ```typescript
106
+ function TagChip({ children, onRemove, onClick, className }: TagChipProps): JSX.Element
107
+ ```
108
+
109
+ - `props` — Component props (see {@link TagChipProps}).
110
+
111
+ #### `TagInput(props)`
112
+
113
+ Tokenized tag-input with chip display. Commits the draft on Enter,
114
+ comma, or Tab AND on blur (clicking away with a non-empty draft adds
115
+ a tag); Backspace on an empty field removes the last token.
116
+
117
+ Controlled component — callers own the `value` array.
118
+
119
+ ```typescript
120
+ function TagInput({
121
+ value,
122
+ onChange,
123
+ placeholder,
124
+ normalize = defaultNormalize,
125
+ maxTags,
126
+ className,
127
+ }: TagInputProps): JSX.Element
128
+ ```
129
+
130
+ - `props` — Component props (see {@link TagInputProps}).
131
+
132
+ ## Injection Notes
133
+
134
+ ### Requirements
135
+
136
+ Peer dependencies:
137
+
138
+ - `@molecule/app-react` ^1.0.0
139
+ - `@molecule/app-ui` ^1.0.0
140
+ - `@molecule/app-ui-react` ^1.0.0
141
+ - `react` ^18.0.0 || ^19.0.0
142
+
143
+ ### Runtime Dependencies
144
+
145
+ - `@molecule/app-react`
146
+ - `@molecule/app-ui`
147
+ - `@molecule/app-ui-react`
148
+ - `react`
149
+
150
+ - Must render inside the app's i18n provider and with a ClassMap bond
151
+ wired (`useTranslation()` / `getClassMap()` throw otherwise).
152
+ - Committing happens on Enter/comma/Tab AND on blur — clicking away
153
+ with a non-empty draft adds a tag; keep that in mind in forms.
154
+ - Default `normalize` trims whitespace and rejects empties +
155
+ duplicates; pass your own to lowercase, validate, or map values
156
+ (return `null` to reject).
157
+ - When `maxTags` is reached further input is silently discarded (the
158
+ draft clears, no error UI).
159
+ - `<TagChip>` ships no background surface of its own — add one via
160
+ `className` if bare text chips are too subtle in your theme.
161
+
162
+ ## Translations
163
+
164
+ Translation strings are provided by `@molecule/app-locales-tag-input`.
@@ -0,0 +1,19 @@
1
+ import type { JSX, ReactNode } from 'react';
2
+ /** Props for the {@link TagChip} component. */
3
+ export interface TagChipProps {
4
+ /** Visible tag text. */
5
+ children: ReactNode;
6
+ /** Optional remove callback — renders an `×` button when provided. */
7
+ onRemove?: () => void;
8
+ /** Optional click callback for the chip body. */
9
+ onClick?: () => void;
10
+ /** Extra classes. */
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Small labeled chip with an optional close button. Used inside
15
+ * `<TagInput>` but also usable standalone as a label display element.
16
+ * @param props - Component props (see {@link TagChipProps}).
17
+ */
18
+ export declare function TagChip({ children, onRemove, onClick, className }: TagChipProps): JSX.Element;
19
+ //# sourceMappingURL=TagChip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagChip.d.ts","sourceRoot":"","sources":["../src/TagChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAK3C,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B,wBAAwB;IACxB,QAAQ,EAAE,SAAS,CAAA;IACnB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO,CAgC7F"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTranslation } from '@molecule/app-react';
3
+ import { getClassMap } from '@molecule/app-ui';
4
+ /**
5
+ * Small labeled chip with an optional close button. Used inside
6
+ * `<TagInput>` but also usable standalone as a label display element.
7
+ * @param props - Component props (see {@link TagChipProps}).
8
+ */
9
+ export function TagChip({ children, onRemove, onClick, className }) {
10
+ const cm = getClassMap();
11
+ const { t } = useTranslation();
12
+ return (_jsxs("span", { className: cm.cn(cm.flex({ align: 'center', gap: 'xs' }), cm.sp('px', 2), cm.sp('py', 1), cm.textSize('xs'), cm.fontWeight('medium'), cm.roundedFull, className), onClick: onClick, children: [_jsx("span", { children: children }), onRemove && (_jsx("button", { type: "button", onClick: (e) => {
13
+ e.stopPropagation();
14
+ onRemove();
15
+ }, "aria-label": t('tagChip.remove', {}, { defaultValue: 'Remove' }), className: cm.cn(cm.w(4), cm.h(4), cm.flex({ align: 'center', justify: 'center' })), children: "\u00D7" }))] }));
16
+ }
@@ -0,0 +1,29 @@
1
+ import type { JSX } from 'react';
2
+ /** Props for the {@link TagInput} component. */
3
+ export interface TagInputProps {
4
+ /** Controlled list of tag values. */
5
+ value: string[];
6
+ /** Called whenever the tag list changes. */
7
+ onChange: (next: string[]) => void;
8
+ /** Placeholder shown in the text input when no tokens exist yet. */
9
+ placeholder?: string;
10
+ /**
11
+ * Validate/transform an input before adding. Return `null` to reject.
12
+ * Default trims whitespace and rejects empty + duplicate entries.
13
+ */
14
+ normalize?: (raw: string, current: string[]) => string | null;
15
+ /** Max tags allowed. When reached, further input is ignored. */
16
+ maxTags?: number;
17
+ /** Extra classes on the outer wrapper. */
18
+ className?: string;
19
+ }
20
+ /**
21
+ * Tokenized tag-input with chip display. Commits the draft on Enter,
22
+ * comma, or Tab AND on blur (clicking away with a non-empty draft adds
23
+ * a tag); Backspace on an empty field removes the last token.
24
+ *
25
+ * Controlled component — callers own the `value` array.
26
+ * @param props - Component props (see {@link TagInputProps}).
27
+ */
28
+ export declare function TagInput({ value, onChange, placeholder, normalize, maxTags, className, }: TagInputProps): JSX.Element;
29
+ //# sourceMappingURL=TagInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagInput.d.ts","sourceRoot":"","sources":["../src/TagInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAA;AAQ/C,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,4CAA4C;IAC5C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAClC,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,GAAG,IAAI,CAAA;IAC7D,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAcD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,QAAQ,EACR,WAAW,EACX,SAA4B,EAC5B,OAAO,EACP,SAAS,GACV,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CA0D7B"}
@@ -0,0 +1,61 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { useTranslation } from '@molecule/app-react';
4
+ import { getClassMap } from '@molecule/app-ui';
5
+ import { TagChip } from './TagChip.js';
6
+ /**
7
+ * Default normalization: trims whitespace, rejects empty strings and duplicates.
8
+ * @param raw
9
+ * @param current
10
+ */
11
+ function defaultNormalize(raw, current) {
12
+ const v = raw.trim();
13
+ if (!v)
14
+ return null;
15
+ if (current.includes(v))
16
+ return null;
17
+ return v;
18
+ }
19
+ /**
20
+ * Tokenized tag-input with chip display. Commits the draft on Enter,
21
+ * comma, or Tab AND on blur (clicking away with a non-empty draft adds
22
+ * a tag); Backspace on an empty field removes the last token.
23
+ *
24
+ * Controlled component — callers own the `value` array.
25
+ * @param props - Component props (see {@link TagInputProps}).
26
+ */
27
+ export function TagInput({ value, onChange, placeholder, normalize = defaultNormalize, maxTags, className, }) {
28
+ const cm = getClassMap();
29
+ const { t } = useTranslation();
30
+ const [draft, setDraft] = useState('');
31
+ /**
32
+ * Validates and commits the current draft value as a new tag.
33
+ */
34
+ function commit() {
35
+ if (maxTags !== undefined && value.length >= maxTags) {
36
+ setDraft('');
37
+ return;
38
+ }
39
+ const next = normalize(draft, value);
40
+ if (next !== null)
41
+ onChange([...value, next]);
42
+ setDraft('');
43
+ }
44
+ /**
45
+ * Handles Enter/comma/Tab to commit a tag, and Backspace to remove the last tag.
46
+ * @param e
47
+ */
48
+ function onKeyDown(e) {
49
+ if (e.key === 'Enter' || e.key === ',' || e.key === 'Tab') {
50
+ if (draft.trim()) {
51
+ e.preventDefault();
52
+ commit();
53
+ }
54
+ }
55
+ else if (e.key === 'Backspace' && draft === '' && value.length > 0) {
56
+ e.preventDefault();
57
+ onChange(value.slice(0, -1));
58
+ }
59
+ }
60
+ return (_jsxs("div", { className: cm.cn(cm.flex({ align: 'center', gap: 'xs', wrap: 'wrap' }), cm.sp('p', 2), className), children: [value.map((tag, i) => (_jsx(TagChip, { onRemove: () => onChange(value.filter((_, j) => j !== i)), children: tag }, `${tag}-${i}`))), _jsx("input", { type: "text", value: draft, onChange: (e) => setDraft(e.target.value), onKeyDown: onKeyDown, onBlur: () => draft.trim() && commit(), placeholder: placeholder ?? t('tagInput.placeholder', {}, { defaultValue: 'Add a tag…' }), className: cm.cn(cm.flex1, cm.input()) })] }));
61
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * React tag-token input and tag-chip display.
3
+ *
4
+ * Exports:
5
+ * - `<TagChip>` — standalone labeled chip with optional remove button.
6
+ * - `<TagInput>` — controlled tokenizer: Enter, comma, or Tab adds the
7
+ * draft; blur commits a non-empty draft; Backspace on an empty field
8
+ * removes the last token.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { useState } from 'react'
13
+ *
14
+ * import { TagChip, TagInput } from '@molecule/app-tag-input-react'
15
+ *
16
+ * function TagEditor() {
17
+ * const [tags, setTags] = useState<string[]>(['react'])
18
+ * return (
19
+ * <>
20
+ * <TagInput value={tags} onChange={setTags} placeholder="Add a tag…" maxTags={10} />
21
+ * <TagChip onRemove={() => setTags(tags.filter((t) => t !== 'react'))}>react</TagChip>
22
+ * </>
23
+ * )
24
+ * }
25
+ * ```
26
+ *
27
+ * @remarks
28
+ * - Must render inside the app's i18n provider and with a ClassMap bond
29
+ * wired (`useTranslation()` / `getClassMap()` throw otherwise).
30
+ * - Committing happens on Enter/comma/Tab AND on blur — clicking away
31
+ * with a non-empty draft adds a tag; keep that in mind in forms.
32
+ * - Default `normalize` trims whitespace and rejects empties +
33
+ * duplicates; pass your own to lowercase, validate, or map values
34
+ * (return `null` to reject).
35
+ * - When `maxTags` is reached further input is silently discarded (the
36
+ * draft clears, no error UI).
37
+ * - `<TagChip>` ships no background surface of its own — add one via
38
+ * `className` if bare text chips are too subtle in your theme.
39
+ *
40
+ * @module
41
+ */
42
+ export * from './TagChip.js';
43
+ export * from './TagInput.js';
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ /**
2
+ * React tag-token input and tag-chip display.
3
+ *
4
+ * Exports:
5
+ * - `<TagChip>` — standalone labeled chip with optional remove button.
6
+ * - `<TagInput>` — controlled tokenizer: Enter, comma, or Tab adds the
7
+ * draft; blur commits a non-empty draft; Backspace on an empty field
8
+ * removes the last token.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { useState } from 'react'
13
+ *
14
+ * import { TagChip, TagInput } from '@molecule/app-tag-input-react'
15
+ *
16
+ * function TagEditor() {
17
+ * const [tags, setTags] = useState<string[]>(['react'])
18
+ * return (
19
+ * <>
20
+ * <TagInput value={tags} onChange={setTags} placeholder="Add a tag…" maxTags={10} />
21
+ * <TagChip onRemove={() => setTags(tags.filter((t) => t !== 'react'))}>react</TagChip>
22
+ * </>
23
+ * )
24
+ * }
25
+ * ```
26
+ *
27
+ * @remarks
28
+ * - Must render inside the app's i18n provider and with a ClassMap bond
29
+ * wired (`useTranslation()` / `getClassMap()` throw otherwise).
30
+ * - Committing happens on Enter/comma/Tab AND on blur — clicking away
31
+ * with a non-empty draft adds a tag; keep that in mind in forms.
32
+ * - Default `normalize` trims whitespace and rejects empties +
33
+ * duplicates; pass your own to lowercase, validate, or map values
34
+ * (return `null` to reject).
35
+ * - When `maxTags` is reached further input is silently discarded (the
36
+ * draft clears, no error UI).
37
+ * - `<TagChip>` ships no background surface of its own — add one via
38
+ * `className` if bare text chips are too subtle in your theme.
39
+ *
40
+ * @module
41
+ */
42
+ export * from './TagChip.js';
43
+ export * from './TagInput.js';
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@molecule/app-tag-input-react",
3
+ "version": "1.0.0",
4
+ "description": "React tag-token input and tag-chip display",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "test": "vitest run",
11
+ "test:watch": "vitest"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "README.md"
22
+ ],
23
+ "keywords": [
24
+ "molecule",
25
+ "tag-input",
26
+ "react"
27
+ ],
28
+ "license": "Apache-2.0",
29
+ "peerDependencies": {
30
+ "@molecule/app-react": "^1.0.0",
31
+ "@molecule/app-ui": "^1.0.0",
32
+ "@molecule/app-ui-react": "^1.0.0",
33
+ "react": "^18.0.0 || ^19.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "@molecule/app-react": "1.0.0",
37
+ "@molecule/app-ui": "1.0.0",
38
+ "@molecule/app-ui-react": "1.0.0",
39
+ "@types/node": "26.1.2",
40
+ "@types/react": "19.2.17",
41
+ "@types/react-dom": "19.2.3",
42
+ "react": "19.2.8",
43
+ "react-dom": "19.2.8",
44
+ "typescript": "6.0.3",
45
+ "vitest": "4.1.10"
46
+ }
47
+ }