@gcforms/tag-input 1.0.0 → 1.0.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.2] - 2025-06-23
9
+
10
+ ### Changed
11
+
12
+ - Update Yarn to version 4.9.2
13
+
14
+ ## [1.0.1] - 2025-06-12
15
+
16
+ ### Added
17
+
18
+ - Add allowSpacesInTags prop. When false, enable space to close tags.
19
+
20
+ ### Fixed
21
+
22
+ - Improved styling on tag input element
23
+
8
24
  ## [1.0.0] - 2025-05-14
9
25
 
10
26
  ### Added
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@gcforms/tag-input",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "author": "Canadian Digital Service",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
- "packageManager": "yarn@4.6.0",
9
+ "packageManager": "yarn@4.9.2",
10
10
  "peerDependencies": {
11
11
  "react": "^19.1.0",
12
12
  "react-dom": "^19.1.0"
package/src/TagInput.tsx CHANGED
@@ -26,6 +26,7 @@ export const TagInput = ({
26
26
  placeholder,
27
27
  description,
28
28
  restrictDuplicates = true,
29
+ allowSpacesInTags = true,
29
30
  maxTags,
30
31
  onTagAdd,
31
32
  onTagRemove,
@@ -39,6 +40,7 @@ export const TagInput = ({
39
40
  placeholder?: string;
40
41
  description?: string;
41
42
  restrictDuplicates?: boolean;
43
+ allowSpacesInTags?: boolean;
42
44
  maxTags?: number;
43
45
  onTagAdd?: (tag: string) => void;
44
46
  onTagRemove?: (tag: string) => void;
@@ -136,7 +138,12 @@ export const TagInput = ({
136
138
  resetMessages();
137
139
 
138
140
  const { key } = event;
139
- const acceptKeys = [keys.ENTER, keys.TAB, keys.COMMA];
141
+ const acceptKeys = [
142
+ keys.ENTER,
143
+ keys.TAB,
144
+ keys.COMMA,
145
+ ...(allowSpacesInTags ? [] : [keys.SPACE]),
146
+ ];
140
147
  const navigateKeys = [keys.ARROW_LEFT, keys.ARROW_RIGHT];
141
148
 
142
149
  // Clear selection when entering text input
package/src/styles.css CHANGED
@@ -55,7 +55,9 @@
55
55
  }
56
56
 
57
57
  input {
58
- display: inline-block;
58
+ display: flex;
59
+ flex: 1 1 0%;
60
+ min-width: 120px;
59
61
  padding-top: 0.25rem;
60
62
  padding-bottom: 0.25rem;
61
63
  padding-left: 0.5rem;