@vev/silke 1.1.6 → 1.1.8

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.
Files changed (164) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/index.js +34 -34
  3. package/dist/index.js.LEGAL.txt +12 -12
  4. package/dist/styles.css +4416 -4020
  5. package/dist/types/components/index.d.ts +3 -2
  6. package/dist/types/components/silke-button/silke-dropdown-button.d.ts +8 -13
  7. package/dist/types/components/silke-card/silke-card-grid.d.ts +33 -1
  8. package/dist/types/components/silke-command-text-field/image-utils.d.ts +20 -0
  9. package/dist/types/components/silke-command-text-field/index.d.ts +4 -0
  10. package/dist/types/components/silke-command-text-field/silke-command-parser.d.ts +3 -0
  11. package/dist/types/components/silke-command-text-field/silke-command-parser.spec.d.ts +1 -0
  12. package/dist/types/components/silke-command-text-field/silke-command-text-field.d.ts +46 -0
  13. package/dist/types/components/silke-command-text-field/utils.d.ts +61 -0
  14. package/dist/types/components/silke-command-text-field/utils.spec.d.ts +1 -0
  15. package/dist/types/components/silke-conditions-input/utils.d.ts +1 -1
  16. package/dist/types/components/silke-form-schema/fields/color-field.d.ts +3 -0
  17. package/dist/types/components/silke-form-schema/schema-utils.d.ts +6 -1
  18. package/dist/types/components/silke-form-schema/silke-schema-fields.d.ts +1 -0
  19. package/dist/types/components/silke-image/silke-image.d.ts +2 -1
  20. package/dist/types/components/silke-list/index.d.ts +1 -0
  21. package/dist/types/components/silke-list/silke-list-item.d.ts +24 -6
  22. package/dist/types/components/silke-list/silke-list.d.ts +9 -9
  23. package/dist/types/components/silke-list/types.d.ts +19 -0
  24. package/dist/types/components/silke-list/utils.d.ts +3 -0
  25. package/dist/types/components/silke-navigation-link/silke-navigation-link.d.ts +1 -0
  26. package/dist/types/components/silke-overflow-menu/silke-overflow-menu.d.ts +6 -1
  27. package/dist/types/components/silke-popover-native/silke-popover-native.d.ts +3 -1
  28. package/dist/types/components/silke-shortcut-button/index.d.ts +1 -0
  29. package/dist/types/components/silke-shortcut-button/silke-shortcut-button.d.ts +15 -0
  30. package/dist/types/components/silke-tag/silke-tag.d.ts +1 -1
  31. package/dist/types/icons.d.ts +32 -0
  32. package/jest.config.js +2 -3
  33. package/package.json +7 -2
  34. package/src/_variables.scss +125 -129
  35. package/src/components/index.ts +3 -2
  36. package/src/components/silke-action-box/silke-action-box.scss +2 -3
  37. package/src/components/silke-alert-banner/silke-alert-banner.scss +9 -10
  38. package/src/components/silke-autocomplete-field/autocomplete-item.tsx +2 -2
  39. package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +18 -12
  40. package/src/components/silke-autocomplete-field/silke-autocomplete-popup-native.tsx +3 -2
  41. package/src/components/silke-autocomplete-field/silke-autocomplete-popup.tsx +63 -44
  42. package/src/components/silke-box/silke-box.mdx +321 -21
  43. package/src/components/silke-box/silke-box.scss +5 -5
  44. package/src/components/silke-breadcrumbs/silke-breadcrumb.mdx +147 -9
  45. package/src/components/silke-breadcrumbs/silke-breadcrumb.scss +3 -3
  46. package/src/components/silke-button/silke-big-button.scss +1 -1
  47. package/src/components/silke-button/silke-button.scss +24 -15
  48. package/src/components/silke-button/silke-dropdown-button.mdx +67 -0
  49. package/src/components/silke-button/silke-dropdown-button.tsx +40 -122
  50. package/src/components/silke-card/silke-card-grid.tsx +5 -3
  51. package/src/components/silke-card/silke-card.scss +8 -7
  52. package/src/components/silke-card/silke-card.tsx +7 -1
  53. package/src/components/silke-checkbox/silke-checkbox.mdx +139 -14
  54. package/src/components/silke-checkbox/silke-checkbox.scss +11 -11
  55. package/src/components/silke-color-picker/color-picker.scss +8 -8
  56. package/src/components/silke-color-swatches/silke-color-swatches.mdx +130 -0
  57. package/src/components/silke-command-text-field/image-utils.ts +71 -0
  58. package/src/components/silke-command-text-field/index.ts +12 -0
  59. package/src/components/silke-command-text-field/silke-command-parser.spec.ts +89 -0
  60. package/src/components/silke-command-text-field/silke-command-parser.ts +47 -0
  61. package/src/components/silke-command-text-field/silke-command-text-field.mdx +301 -0
  62. package/src/components/silke-command-text-field/silke-command-text-field.module.scss +119 -0
  63. package/src/components/silke-command-text-field/silke-command-text-field.tsx +672 -0
  64. package/src/components/silke-command-text-field/utils.spec.ts +366 -0
  65. package/src/components/silke-command-text-field/utils.ts +287 -0
  66. package/src/components/silke-conditions-input/silke-conditions-input.scss +4 -4
  67. package/src/components/silke-content-column/silke-content-column.scss +1 -1
  68. package/src/components/silke-context-menu/silke-context-menu.scss +3 -4
  69. package/src/components/silke-context-menu/silke-context-menu.tsx +1 -1
  70. package/src/components/silke-css-number-field/silke-css-number-field.scss +14 -12
  71. package/src/components/silke-divider/silke-divider.mdx +154 -32
  72. package/src/components/silke-divider/silke-divider.scss +3 -2
  73. package/src/components/silke-drawer/silke-drawer.scss +6 -2
  74. package/src/components/silke-form/silke-form.mdx +254 -27
  75. package/src/components/silke-form-schema/fields/array-field-inline.tsx +1 -0
  76. package/src/components/silke-form-schema/fields/array-field-modal.tsx +9 -4
  77. package/src/components/silke-form-schema/fields/array-field.tsx +27 -3
  78. package/src/components/silke-form-schema/fields/color-field.tsx +36 -0
  79. package/src/components/silke-form-schema/fields/styles.scss +34 -35
  80. package/src/components/silke-form-schema/schema-utils.ts +27 -1
  81. package/src/components/silke-form-schema/silke-schema-field.tsx +2 -0
  82. package/src/components/silke-form-schema/silke-schema-fields.tsx +4 -3
  83. package/src/components/silke-gradient-picker/silke-gradient-picker.module.scss +2 -2
  84. package/src/components/silke-icon/silke-icon.mdx +212 -8
  85. package/src/components/silke-icon/silke-icon.scss +10 -2
  86. package/src/components/silke-icon/silke-icon.tsx +1 -0
  87. package/src/components/silke-icon/silke-stacked-icon.scss +42 -45
  88. package/src/components/silke-icon-browser/silke-icon-browser.mdx +143 -0
  89. package/src/components/silke-image/silke-image-color-backdrop.scss +6 -6
  90. package/src/components/silke-image/silke-image.mdx +189 -41
  91. package/src/components/silke-image/silke-image.scss +3 -3
  92. package/src/components/silke-image/silke-image.tsx +14 -1
  93. package/src/components/silke-link/silke-link.scss +3 -5
  94. package/src/components/silke-list/index.ts +1 -0
  95. package/src/components/silke-list/silke-list-item.mdx +83 -0
  96. package/src/components/silke-list/silke-list-item.scss +119 -0
  97. package/src/components/silke-list/silke-list-item.tsx +137 -12
  98. package/src/components/silke-list/silke-list.mdx +108 -13
  99. package/src/components/silke-list/silke-list.scss +8 -15
  100. package/src/components/silke-list/silke-list.tsx +63 -9
  101. package/src/components/silke-list/types.ts +22 -0
  102. package/src/components/silke-list/utils.ts +24 -0
  103. package/src/components/silke-loader/silke-loader.mdx +139 -5
  104. package/src/components/silke-loader/silke-loader.scss +1 -1
  105. package/src/components/silke-modal/silke-modal.scss +9 -9
  106. package/src/components/silke-navigation-link/silke-navigation-link.mdx +27 -2
  107. package/src/components/silke-navigation-link/silke-navigation-link.scss +34 -40
  108. package/src/components/silke-navigation-link/silke-navigation-link.tsx +7 -6
  109. package/src/components/silke-overflow-menu/silke-overflow-menu.mdx +228 -31
  110. package/src/components/silke-overflow-menu/silke-overflow-menu.scss +8 -8
  111. package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +14 -8
  112. package/src/components/silke-popover/silke-popover.scss +5 -5
  113. package/src/components/silke-popover-native/silke-popover-native.scss +93 -78
  114. package/src/components/silke-popover-native/silke-popover-native.tsx +4 -0
  115. package/src/components/silke-popover-native/use-popover-positioning.ts +1 -3
  116. package/src/components/silke-progress-indicator/silke-progress-indicator.scss +1 -1
  117. package/src/components/silke-radio-button/silke-radio-button.scss +18 -11
  118. package/src/components/silke-search-field/silke-search-field.mdx +161 -7
  119. package/src/components/silke-shortcut-button/index.ts +1 -0
  120. package/src/components/silke-shortcut-button/silke-shortcut-button.mdx +89 -0
  121. package/src/components/silke-shortcut-button/silke-shortcut-button.scss +145 -0
  122. package/src/components/silke-shortcut-button/silke-shortcut-button.tsx +55 -0
  123. package/src/components/silke-skeleton/silke-skeleton.mdx +109 -0
  124. package/src/components/silke-skeleton/silke-skeleton.scss +1 -1
  125. package/src/components/silke-slider/silke-slider.module.scss +19 -19
  126. package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +3 -3
  127. package/src/components/silke-sortable-list/silke-sortable-list.scss +4 -5
  128. package/src/components/silke-table/silke-table.scss +1 -1
  129. package/src/components/silke-tabs/silke-tabs.scss +3 -3
  130. package/src/components/silke-tag/silke-tag.mdx +179 -43
  131. package/src/components/silke-tag/silke-tag.scss +50 -13
  132. package/src/components/silke-tag/silke-tag.tsx +17 -7
  133. package/src/components/silke-text/silke-text.scss +6 -4
  134. package/src/components/silke-text/silke-title.scss +7 -14
  135. package/src/components/silke-text-field/silke-text-field.scss +9 -9
  136. package/src/components/silke-text-field/silke-text-field.tsx +1 -1
  137. package/src/components/silke-tile/silke-tile.scss +7 -3
  138. package/src/components/silke-toast-notification/silke-toast-notification.scss +4 -5
  139. package/src/components/silke-toggle/silke-toggle.mdx +163 -33
  140. package/src/components/silke-toggle/silke-toggle.scss +4 -4
  141. package/src/components/silke-toolbar/silke-toolbar.scss +1 -1
  142. package/src/components/silke-tooltip/silke-shortcuts.tsx +3 -3
  143. package/src/components/silke-tooltip/silke-tooltip.scss +11 -16
  144. package/src/components/silke-variables-wrapper/silke-variables-wrapper.scss +9 -7
  145. package/src/components/silke-virtual/silke-virtual.mdx +161 -0
  146. package/src/components/silke-virtual/silke-virtual.scss +8 -8
  147. package/src/icons.tsx +58 -1
  148. package/src/styles/core.scss +42 -45
  149. package/src/styles/math.scss +66 -66
  150. package/tsconfig.build.json +2 -6
  151. package/tsconfig.build.tsbuildinfo +1 -1
  152. package/tsconfig.json +3 -14
  153. package/dist/types/components/silke-action-list/index.d.ts +0 -1
  154. package/dist/types/components/silke-action-list/silke-action-list.d.ts +0 -11
  155. package/dist/types/components/silke-list-card/index.d.ts +0 -1
  156. package/dist/types/components/silke-list-card/silke-list-card.d.ts +0 -14
  157. package/src/components/silke-action-list/index.ts +0 -1
  158. package/src/components/silke-action-list/silke-action-list.mdx +0 -48
  159. package/src/components/silke-action-list/silke-action-list.scss +0 -21
  160. package/src/components/silke-action-list/silke-action-list.tsx +0 -85
  161. package/src/components/silke-list-card/index.ts +0 -1
  162. package/src/components/silke-list-card/silke-list-card.mdx +0 -46
  163. package/src/components/silke-list-card/silke-list-card.scss +0 -57
  164. package/src/components/silke-list-card/silke-list-card.tsx +0 -63
@@ -0,0 +1,301 @@
1
+ # SilkeCommandTextField
2
+
3
+ A rich text input component that supports inline commands (mentions and actions) with autocomplete suggestions. Perfect for chat interfaces, command palettes, or any input that needs to reference users, actions, or other entities.
4
+
5
+ ## Features
6
+
7
+ - **Mentions (`@`)**: Reference users, entities, or any mentionable items
8
+ - **Actions (`/`)**: Trigger commands or actions
9
+ - **Autocomplete**: Show suggestions as users type
10
+ - **Keyboard navigation**: Navigate and select suggestions with keyboard
11
+ - **Placeholder support**: Show placeholder text when empty
12
+ - **Disabled state**: Prevent editing when needed
13
+ - **XSS protection**: Safe HTML rendering of user input
14
+
15
+ ## Basic Usage
16
+
17
+ ```js
18
+ const [value, setValue] = React.useState([]);
19
+ const availableCommands = [
20
+ { type: SilkeCommandType.MENTION, value: 'john' },
21
+ { type: SilkeCommandType.MENTION, value: 'jane' },
22
+ { type: SilkeCommandType.ACTION, value: 'help' },
23
+ ];
24
+
25
+ <SilkeCommandTextField
26
+ availableCommands={availableCommands}
27
+ onChange={setValue}
28
+ placeholder="Type @ to mention someone or / for commands..."
29
+ value={value}
30
+ />;
31
+ ```
32
+
33
+ ## With Autocomplete Suggestions
34
+
35
+ ```js
36
+ const [value, setValue] = React.useState([]);
37
+ const ref = React.useRef(null);
38
+ const [suggestions, setSuggestions] = React.useState([]);
39
+
40
+ const availableCommands = [
41
+ { type: SilkeCommandType.MENTION, value: 'alice' },
42
+ { type: SilkeCommandType.MENTION, value: 'bob' },
43
+ { type: SilkeCommandType.MENTION, value: 'charlie' },
44
+ { type: SilkeCommandType.ACTION, value: 'help' },
45
+ { type: SilkeCommandType.ACTION, value: 'search' },
46
+ { type: SilkeCommandType.ACTION, value: 'settings' },
47
+ ];
48
+
49
+ <SilkeBox column gap="s">
50
+ <SilkeCommandTextField
51
+ autoFocus
52
+ availableCommands={availableCommands}
53
+ onChange={setValue}
54
+ onKeyDown={(e) => {
55
+ if (e.key === 'Enter' && suggestions.length > 0) {
56
+ e.preventDefault();
57
+ ref.current?.update(suggestions[0]);
58
+ }
59
+ }}
60
+ onSuggestions={setSuggestions}
61
+ placeholder="Type @ or / to see suggestions..."
62
+ ref={ref}
63
+ value={value}
64
+ />
65
+ {suggestions.length > 0 && (
66
+ <SilkeBox
67
+ column
68
+ gap="xs"
69
+ style={{ background: 'var(--color-neutral-10)', padding: 8, borderRadius: 4 }}
70
+ >
71
+ <SilkeText size="s" weight="medium">
72
+ Suggestions:
73
+ </SilkeText>
74
+ {suggestions.map((suggestion) => (
75
+ <SilkeBox
76
+ key={suggestion.type + suggestion.value}
77
+ onClick={() => ref.current?.update(suggestion)}
78
+ style={{ cursor: 'pointer', padding: '4px 8px' }}
79
+ >
80
+ <SilkeText>
81
+ {suggestion.type}
82
+ {suggestion.value}
83
+ </SilkeText>
84
+ </SilkeBox>
85
+ ))}
86
+ </SilkeBox>
87
+ )}
88
+ </SilkeBox>;
89
+ ```
90
+
91
+ ## With Command Focus Tracking
92
+
93
+ Track which command the user is currently editing:
94
+
95
+ ```js
96
+ const [value, setValue] = React.useState([]);
97
+ const [activeIndex, setActiveIndex] = React.useState(0);
98
+ const [activeCommand, setActiveCommand] = React.useState(null);
99
+
100
+ const availableCommands = [
101
+ { type: SilkeCommandType.MENTION, value: 'user' },
102
+ { type: SilkeCommandType.ACTION, value: 'run' },
103
+ ];
104
+
105
+ <SilkeBox column gap="s">
106
+ <SilkeCommandTextField
107
+ availableCommands={availableCommands}
108
+ onChange={setValue}
109
+ onCommandFocus={(index, command) => {
110
+ setActiveIndex(index);
111
+ setActiveCommand(command);
112
+ }}
113
+ placeholder="Type something with @mentions..."
114
+ value={value}
115
+ />
116
+ <SilkeBox gap="m">
117
+ <SilkeText size="s">Active index: {activeIndex}</SilkeText>
118
+ <SilkeText size="s">Active type: {activeCommand?.type || 'text'}</SilkeText>
119
+ </SilkeBox>
120
+ </SilkeBox>;
121
+ ```
122
+
123
+ ## Pre-populated Value
124
+
125
+ Start with existing commands:
126
+
127
+ ```js
128
+ const [value, setValue] = React.useState([
129
+ { type: 'text', value: 'Hello ' },
130
+ { type: SilkeCommandType.MENTION, value: 'alice', partial: false },
131
+ { type: 'text', value: ' please ' },
132
+ { type: SilkeCommandType.ACTION, value: 'review', partial: false },
133
+ { type: 'text', value: ' this PR' },
134
+ ]);
135
+
136
+ const availableCommands = [
137
+ { type: SilkeCommandType.MENTION, value: 'alice' },
138
+ { type: SilkeCommandType.ACTION, value: 'review' },
139
+ ];
140
+
141
+ <SilkeCommandTextField availableCommands={availableCommands} onChange={setValue} value={value} />;
142
+ ```
143
+
144
+ ## Disabled State
145
+
146
+ ```js
147
+ const [value, setValue] = React.useState([{ type: 'text', value: 'This field is disabled' }]);
148
+
149
+ <SilkeCommandTextField availableCommands={[]} disabled onChange={setValue} value={value} />;
150
+ ```
151
+
152
+ ## Using the Ref Handle
153
+
154
+ Access component methods via ref:
155
+
156
+ ```js
157
+ const ref = React.useRef(null);
158
+ const [value, setValue] = React.useState([]);
159
+
160
+ const availableCommands = [{ type: SilkeCommandType.MENTION, value: 'team' }];
161
+
162
+ <SilkeBox column gap="s">
163
+ <SilkeCommandTextField
164
+ availableCommands={availableCommands}
165
+ onChange={setValue}
166
+ placeholder="Use the buttons below..."
167
+ ref={ref}
168
+ value={value}
169
+ />
170
+ <SilkeBox gap="s">
171
+ <SilkeButton label="Focus" onClick={() => ref.current?.focus()} />
172
+ <SilkeButton label="Blur" onClick={() => ref.current?.blur()} />
173
+ <SilkeButton
174
+ label="Insert @team"
175
+ onClick={() =>
176
+ ref.current?.update({ type: SilkeCommandType.MENTION, value: 'team', partial: false })
177
+ }
178
+ />
179
+ <SilkeButton label="Get as String" onClick={() => alert(ref.current?.toString())} />
180
+ </SilkeBox>
181
+ </SilkeBox>;
182
+ ```
183
+
184
+ ## Full Interactive Example
185
+
186
+ ```js
187
+ const [value, setValue] = React.useState([]);
188
+ const ref = React.useRef(null);
189
+ const [activeIndex, setActiveIndex] = React.useState(0);
190
+ const [suggestions, setSuggestions] = React.useState([]);
191
+
192
+ const availableCommands = [
193
+ { type: SilkeCommandType.MENTION, value: 'alice' },
194
+ { type: SilkeCommandType.MENTION, value: 'bob' },
195
+ { type: SilkeCommandType.MENTION, value: 'charlie' },
196
+ { type: SilkeCommandType.ACTION, value: 'help' },
197
+ { type: SilkeCommandType.ACTION, value: 'search' },
198
+ { type: SilkeCommandType.ACTION, value: 'clear' },
199
+ ];
200
+
201
+ <SilkeBox column gap="s">
202
+ <SilkeText weight="medium">Active index: {activeIndex}</SilkeText>
203
+ <SilkeCommandTextField
204
+ autoFocus
205
+ availableCommands={availableCommands}
206
+ onChange={setValue}
207
+ onCommandFocus={setActiveIndex}
208
+ onKeyDown={(e) => {
209
+ if (e.key === 'Enter' && suggestions.length > 0) {
210
+ e.preventDefault();
211
+ ref.current?.update(suggestions[0]);
212
+ }
213
+ }}
214
+ onSuggestions={setSuggestions}
215
+ placeholder="Type @ to mention or / for actions..."
216
+ ref={ref}
217
+ value={value}
218
+ />
219
+ {suggestions.length > 0 && (
220
+ <SilkeBox column gap="xs">
221
+ <SilkeText size="s" weight="medium">
222
+ Suggestions (press Enter to select first):
223
+ </SilkeText>
224
+ {suggestions.map((suggestion) => (
225
+ <SilkeBox
226
+ key={suggestion.type + suggestion.value}
227
+ onClick={() => ref.current?.update(suggestion)}
228
+ style={{
229
+ cursor: 'pointer',
230
+ padding: '4px 8px',
231
+ background: 'var(--color-neutral-10)',
232
+ borderRadius: 4,
233
+ }}
234
+ >
235
+ <SilkeText>
236
+ {suggestion.type}
237
+ {suggestion.value}
238
+ </SilkeText>
239
+ </SilkeBox>
240
+ ))}
241
+ </SilkeBox>
242
+ )}
243
+ <SilkeBox column gap="xs">
244
+ <SilkeText size="s" weight="medium">
245
+ Output as string:
246
+ </SilkeText>
247
+ <SilkeCodeSnippet code={ref.current?.toString() || ''} />
248
+ </SilkeBox>
249
+ <SilkeBox column gap="xs">
250
+ <SilkeText size="s" weight="medium">
251
+ Value structure:
252
+ </SilkeText>
253
+ <SilkeCodeSnippet code={JSON.stringify(value, null, 2)} />
254
+ </SilkeBox>
255
+ </SilkeBox>;
256
+ ```
257
+
258
+ ## Props
259
+
260
+ | Prop | Type | Default | Description |
261
+ | ------------------- | --------------------------------------------------------------- | -------- | -------------------------------------------------------------- |
262
+ | `availableCommands` | `SilkeCommand[]` | Required | List of valid commands for autocomplete and validation |
263
+ | `value` | `SilkeCommandTextFieldValue[]` | Required | Current value of the field |
264
+ | `onChange` | `(value: SilkeCommandTextFieldValue[]) => void` | Required | Called when the value changes |
265
+ | `onSuggestions` | `(suggestions: SilkeCommand[]) => void` | - | Called with matching suggestions when typing a partial command |
266
+ | `onCommandFocus` | `(index: number, command?: SilkeCommandTextFieldValue) => void` | - | Called when the active command changes |
267
+ | `onKeyDown` | `(e: React.KeyboardEvent) => void` | - | Called on key down events |
268
+ | `placeholder` | `string` | - | Placeholder text shown when empty |
269
+ | `disabled` | `boolean` | `false` | Disable editing |
270
+ | `autoFocus` | `boolean` | `false` | Focus on mount |
271
+
272
+ ## Ref Methods
273
+
274
+ | Method | Type | Description |
275
+ | ------------------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------ |
276
+ | `focus()` | `() => void` | Focus the input |
277
+ | `blur()` | `() => void` | Remove focus from the input |
278
+ | `update(command, index?)` | `(command: SilkeCommand, index?: number) => void` | Insert or update a command at the given index (defaults to active index, use -1 to append) |
279
+ | `toString(value?)` | `(value?: SilkeCommandTextFieldValue[]) => string` | Convert value to plain string |
280
+
281
+ ## Types
282
+
283
+ ```typescript
284
+ enum SilkeCommandType {
285
+ ACTION = '/',
286
+ MENTION = '@',
287
+ }
288
+
289
+ type SilkeCommand = {
290
+ partial?: boolean;
291
+ type: SilkeCommandType;
292
+ value: string;
293
+ };
294
+
295
+ type SilkeTextValue = {
296
+ type: 'text';
297
+ value: string;
298
+ };
299
+
300
+ type SilkeCommandTextFieldValue = SilkeCommand | SilkeTextValue;
301
+ ```
@@ -0,0 +1,119 @@
1
+ .container {
2
+ flex: 1;
3
+ min-height: 32px;
4
+ overflow: hidden;
5
+ position: relative;
6
+ }
7
+
8
+ .imageList {
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ gap: 8px;
12
+ padding: 8px 4px;
13
+ }
14
+
15
+ .imageThumbnail {
16
+ position: relative;
17
+ width: 48px;
18
+ height: 48px;
19
+ border-radius: var(--border-radius-tiny);
20
+ overflow: hidden;
21
+ background-color: var(--color-neutral-20);
22
+ cursor: pointer;
23
+
24
+ img {
25
+ width: 100%;
26
+ height: 100%;
27
+ object-fit: cover;
28
+ }
29
+
30
+ &:hover {
31
+ opacity: 0.9;
32
+ }
33
+ }
34
+
35
+ .imageRemove {
36
+ opacity: 0;
37
+ transition: opacity 0.15s ease;
38
+
39
+ .imageThumbnail:hover & {
40
+ opacity: 1;
41
+ }
42
+ }
43
+
44
+ .imagePreviewOverlay {
45
+ position: fixed;
46
+ top: 0;
47
+ left: 0;
48
+ right: 0;
49
+ bottom: 0;
50
+ background-color: rgba(0, 0, 0, 0.7);
51
+ display: flex;
52
+ align-items: center;
53
+ justify-content: center;
54
+ z-index: 1000;
55
+ cursor: pointer;
56
+ }
57
+
58
+ .imagePreview {
59
+ position: relative;
60
+ max-width: 90vw;
61
+ max-height: 90vh;
62
+ cursor: default;
63
+
64
+ img {
65
+ max-width: 100%;
66
+ max-height: 90vh;
67
+ object-fit: contain;
68
+ border-radius: var(--border-radius-small);
69
+ box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
70
+ }
71
+ }
72
+
73
+ .placeholder {
74
+ color: var(--color-neutral-50);
75
+ left: 4px;
76
+ pointer-events: none;
77
+ position: absolute;
78
+ top: 4px;
79
+ user-select: none;
80
+ }
81
+
82
+ .textfield {
83
+ border: none;
84
+ height: 100%;
85
+ outline: none;
86
+ padding: 4px 4px;
87
+ white-space: pre-wrap;
88
+ width: 100%;
89
+ word-break: break-word;
90
+
91
+ &[aria-disabled='true'] {
92
+ cursor: not-allowed;
93
+ opacity: 0.5;
94
+ }
95
+ }
96
+ .tag {
97
+ display: inline-block;
98
+ line-height: 1;
99
+ padding: 2px 4px;
100
+ cursor: default !important;
101
+ border-radius: var(--border-radius-tiny);
102
+ color: var(--color-neutral-80);
103
+ background-color: rgba(var(--color-neutral-40-rgb), var(--opacity-level-medium));
104
+
105
+ &:active {
106
+ opacity: 0.8;
107
+ }
108
+ &:not(.partial) {
109
+ &.mention {
110
+ color: var(--color-accent-60);
111
+ background-color: rgba(var(--color-accent-30-rgb), var(--opacity-level-medium));
112
+ }
113
+
114
+ &.action {
115
+ color: var(--color-support-quaternary-60);
116
+ background-color: rgba(var(--color-support-quaternary-30-rgb), var(--opacity-level-light));
117
+ }
118
+ }
119
+ }