@youcan/celeste 0.6.21 → 0.6.23

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 (38) hide show
  1. package/dist/celeste.css +396 -419
  2. package/dist/cjs/color-picker.js +1 -2
  3. package/dist/cjs/combobox-input.js +4 -8
  4. package/dist/cjs/combobox-list.js +3 -2
  5. package/dist/cjs/combobox-trigger.js +2 -1
  6. package/dist/cjs/combobox.js +29 -23
  7. package/dist/cjs/index.js +0 -3
  8. package/dist/cjs/text-input-affix.js +1 -2
  9. package/dist/cjs/text-input-button.js +2 -3
  10. package/dist/cjs/text-input.js +81 -4
  11. package/dist/components/combobox/combobox.d.ts +1 -0
  12. package/dist/components/dropdown/dropdown.d.ts +1 -1
  13. package/dist/components/text-input/index.d.ts +0 -2
  14. package/dist/components/text-input/text-input-affix.d.ts +1 -4
  15. package/dist/components/text-input/text-input.d.ts +6 -1
  16. package/dist/es/color-picker.js +1 -2
  17. package/dist/es/combobox-input.js +5 -9
  18. package/dist/es/combobox-list.js +3 -2
  19. package/dist/es/combobox-trigger.js +2 -1
  20. package/dist/es/combobox.js +30 -24
  21. package/dist/es/index.js +3 -6
  22. package/dist/es/text-input-affix.js +1 -2
  23. package/dist/es/text-input-button.js +2 -3
  24. package/dist/es/text-input.js +82 -5
  25. package/package.json +3 -3
  26. package/src/components/combobox/combobox-input.vue +3 -2
  27. package/src/components/combobox/combobox-list.vue +15 -35
  28. package/src/components/combobox/combobox-trigger.vue +1 -0
  29. package/src/components/combobox/combobox.vue +9 -4
  30. package/src/components/text-input/index.ts +0 -3
  31. package/src/components/text-input/stories/text-input.stories.ts +142 -45
  32. package/src/components/text-input/text-input-affix.vue +5 -12
  33. package/src/components/text-input/text-input-button.vue +8 -3
  34. package/src/components/text-input/text-input.vue +129 -64
  35. package/dist/cjs/text-input-icon.js +0 -29
  36. package/dist/components/text-input/text-input-icon.d.ts +0 -10
  37. package/dist/es/text-input-icon.js +0 -30
  38. package/src/components/text-input/text-input-icon.vue +0 -37
@@ -1,7 +1,9 @@
1
1
  import type { Meta, StoryObj } from '@storybook/vue3-vite';
2
+ import Button from '@/components/button/button.vue';
3
+ import Combobox from '@/components/combobox/combobox.vue';
4
+ import { ref } from 'vue';
2
5
  import TextInputAffix from '../text-input-affix.vue';
3
6
  import TextInputButton from '../text-input-button.vue';
4
- import TextInputIcon from '../text-input-icon.vue';
5
7
  import TextInput from '../text-input.vue';
6
8
 
7
9
  const meta: Meta<typeof TextInput> = {
@@ -18,7 +20,7 @@ export const Default: Story = {
18
20
  },
19
21
 
20
22
  render: args => ({
21
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
23
+ components: { TextInput, TextInputAffix, TextInputButton },
22
24
  setup() {
23
25
  return { args };
24
26
  },
@@ -36,17 +38,22 @@ export const Icon: Story = {
36
38
  },
37
39
 
38
40
  render: args => ({
39
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
41
+ components: { TextInput, TextInputAffix, TextInputButton },
40
42
  setup() {
41
43
  return { args };
42
44
  },
43
45
  template: `
44
46
  <div style="display: grid; gap: 20px; justify-content: center;">
45
47
  <TextInput v-bind="args" style="width: 300px">
46
- <TextInputIcon icon="i-celeste-user-6-line" />
48
+ <template #leadingIcon>
49
+ <i class="i-celeste-user-6-line" />
50
+ </template>
47
51
  </TextInput>
52
+
48
53
  <TextInput v-bind="args" style="width: 300px">
49
- <TextInputIcon icon="i-celeste-search-2-line" position="end" />
54
+ <template #trailingIcon>
55
+ <i class="i-celeste-user-6-line" />
56
+ </template>
50
57
  </TextInput>
51
58
  </div>
52
59
  `,
@@ -59,20 +66,22 @@ export const Size: Story = {
59
66
  },
60
67
 
61
68
  render: args => ({
62
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
69
+ components: { TextInput, TextInputAffix, TextInputButton },
63
70
  setup() {
64
71
  return { args };
65
72
  },
66
73
  template: `
67
74
  <div style="display: grid; gap: 20px; justify-content: center;">
68
75
  <TextInput v-bind="args" style="width: 300px" size="md">
69
- <TextInputIcon icon="i-celeste-user-6-line" />
76
+ <i class="i-celeste-user-6-line" />
70
77
  </TextInput>
71
- <TextInput v-bind="args" style="width: 300px">
72
- <TextInputIcon icon="i-celeste-user-6-line" />
78
+
79
+ <TextInput v-bind="args" style="width: 300px" size="sm">
80
+ <i class="i-celeste-user-6-line" />
73
81
  </TextInput>
82
+
74
83
  <TextInput v-bind="args" style="width: 300px" size="xs">
75
- <TextInputIcon icon="i-celeste-user-6-line" />
84
+ <i class="i-celeste-user-6-line" />
76
85
  </TextInput>
77
86
  </div>
78
87
  `,
@@ -84,21 +93,22 @@ export const Affix: Story = {
84
93
  },
85
94
 
86
95
  render: args => ({
87
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
96
+ components: { TextInput, TextInputAffix, TextInputButton },
88
97
  setup() {
89
98
  return { args };
90
99
  },
91
100
  template: `
92
101
  <div style="display: grid; gap: 20px; justify-content: center;">
93
- <TextInput v-bind="args" style="width: 300px" placeholder="www.example.com">
94
- <TextInputAffix>
95
- https://
96
- </TextInputAffix>
102
+ <TextInput v-bind="args" placeholder="www.example.com">
103
+ <template #leadingNode>
104
+ <TextInputAffix>https://</TextInputAffix>
105
+ </template>
97
106
  </TextInput>
98
- <TextInput v-bind="args" style="width: 300px" placeholder="example">
99
- <TextInputAffix variant="suffix">
100
- @gmail.com
101
- </TextInputAffix>
107
+
108
+ <TextInput v-bind="args" placeholder="example">
109
+ <template #trailingNode>
110
+ <TextInputAffix>@gmail.com</TextInputAffix>
111
+ </template>
102
112
  </TextInput>
103
113
  </div>
104
114
  `,
@@ -110,21 +120,25 @@ export const InlineAffix: Story = {
110
120
  },
111
121
 
112
122
  render: args => ({
113
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
123
+ components: { TextInput, TextInputAffix, TextInputButton },
114
124
  setup() {
115
125
  return { args };
116
126
  },
117
127
  template: `
118
128
  <div style="display: grid; gap: 20px; justify-content: center;">
119
129
  <TextInput v-bind="args" style="width: 300px" placeholder="0.00">
120
- <TextInputAffix inline>
121
- €
122
- </TextInputAffix>
130
+ <template #leadingInlineNode>
131
+ <TextInputAffix inline>
132
+ €
133
+ </TextInputAffix>
134
+ </template>
123
135
  </TextInput>
124
136
  <TextInput v-bind="args" style="width: 300px" placeholder="0.00">
125
- <TextInputAffix variant="suffix" inline>
126
- MAD
127
- </TextInputAffix>
137
+ <template #trailingInlineNode>
138
+ <TextInputAffix inline>
139
+ €
140
+ </TextInputAffix>
141
+ </template>
128
142
  </TextInput>
129
143
  </div>
130
144
  `,
@@ -137,17 +151,22 @@ export const WithKbd: Story = {
137
151
  },
138
152
 
139
153
  render: args => ({
140
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
154
+ components: { TextInput, TextInputAffix, TextInputButton },
141
155
  setup() {
142
156
  return { args };
143
157
  },
144
158
  template: `
145
159
  <div style="display: grid; gap: 20px; justify-content: center;">
146
160
  <TextInput v-bind="args" style="width: 300px">
147
- <TextInputIcon icon="i-celeste-search-2-line" />
148
- <TextInputAffix variant="suffix" asKbd>
149
- ⌘1
150
- </TextInputAffix>
161
+ <template #leadingIcon>
162
+ <i class="i-celeste-search-2-line"/>
163
+ </template>
164
+
165
+ <template #trailingInlineNode>
166
+ <TextInputAffix asKbd>
167
+ ⌘1
168
+ </TextInputAffix>
169
+ </template>
151
170
  </TextInput>
152
171
  </div>
153
172
  `,
@@ -161,14 +180,16 @@ export const Disabled: Story = {
161
180
  },
162
181
 
163
182
  render: args => ({
164
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
183
+ components: { TextInput, TextInputAffix, TextInputButton },
165
184
  setup() {
166
185
  return { args };
167
186
  },
168
187
  template: `
169
188
  <div style="display: grid; gap: 20px; justify-content: center;">
170
189
  <TextInput v-bind="args" style="width: 300px">
171
- <TextInputIcon icon="i-celeste-user-6-line" />
190
+ <template #leadingIcon>
191
+ <i class="i-celeste-user-6-line" />
192
+ </template>
172
193
  </TextInput>
173
194
  </div>
174
195
  `,
@@ -182,14 +203,16 @@ export const HasError: Story = {
182
203
  },
183
204
 
184
205
  render: args => ({
185
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
206
+ components: { TextInput, TextInputAffix, TextInputButton },
186
207
  setup() {
187
208
  return { args };
188
209
  },
189
210
  template: `
190
211
  <div style="display: grid; gap: 20px; justify-content: center;">
191
212
  <TextInput v-bind="args" style="width: 300px">
192
- <TextInputIcon icon="i-celeste-user-6-line" />
213
+ <template #leadingIcon>
214
+ <i class="i-celeste-user-6-line" />
215
+ </template>
193
216
  </TextInput>
194
217
  </div>
195
218
  `,
@@ -202,17 +225,22 @@ export const WithButton: Story = {
202
225
  },
203
226
 
204
227
  render: args => ({
205
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
228
+ components: { TextInput, TextInputAffix, TextInputButton, Button },
206
229
  setup() {
207
230
  return { args };
208
231
  },
209
232
  template: `
210
233
  <div style="display: grid; gap: 20px; justify-content: center;">
211
234
  <TextInput v-bind="args" style="width: 300px">
212
- <TextInputIcon icon="i-celeste-links-line" />
213
- <TextInputButton>
214
- <i class="i-celeste-file-copy-line" />
215
- </TextInputButton>
235
+ <template #leadingIcon>
236
+ <i class="i-celeste-links-line" />
237
+ </template>
238
+
239
+ <template #trailingNode>
240
+ <TextInputButton>
241
+ <i class="i-celeste-file-copy-line" />
242
+ </TextInputButton>
243
+ </template>
216
244
  </TextInput>
217
245
  </div>
218
246
  `,
@@ -226,17 +254,86 @@ export const WithInlineButton: Story = {
226
254
  },
227
255
 
228
256
  render: args => ({
229
- components: { TextInput, TextInputAffix, TextInputIcon, TextInputButton },
257
+ components: { TextInput, TextInputAffix, TextInputButton },
230
258
  setup() {
231
259
  return { args };
232
260
  },
233
261
  template: `
234
262
  <div style="display: grid; gap: 20px; justify-content: center;">
235
263
  <TextInput v-bind="args" style="width: 300px">
236
- <TextInputIcon icon="i-celeste-lock-2-line" />
237
- <TextInputButton inline>
238
- <i class="i-celeste-eye-line" />
239
- </TextInputButton>
264
+ <template #leadingIcon>
265
+ <i class="i-celeste-lock-2-line" />
266
+ </template>
267
+
268
+ <template #trailingInlineNode>
269
+ <TextInputButton>
270
+ <i class="i-celeste-eye-line" />
271
+ </TextInputButton>
272
+ </template>
273
+ </TextInput>
274
+ </div>
275
+ `,
276
+ }),
277
+ };
278
+
279
+ const OPTIONS = [
280
+ { value: { id: 1 }, label: 'MAD', icon: 'i-celeste-bank-card-2-line' },
281
+ { value: { id: 2 }, label: 'EUR', icon: 'i-celeste-bank-card-2-line' },
282
+ { value: { id: 3 }, label: 'USD', icon: 'i-celeste-bank-card-2-line' },
283
+ ];
284
+
285
+ export const WithLeadingCombobox: Story = {
286
+ args: {
287
+ placeholder: 'Search...',
288
+ },
289
+
290
+ render: args => ({
291
+ components: { TextInput, TextInputAffix, TextInputButton, Combobox },
292
+ setup() {
293
+ const model = ref();
294
+
295
+ return { args, OPTIONS, model };
296
+ },
297
+ template: `
298
+ <div style="display: grid; gap: 20px; justify-content: center;">
299
+ <TextInput v-bind="args">
300
+ <template #trailingNode>
301
+ <Combobox
302
+ v-model="model"
303
+ type="compact-input"
304
+ :options="OPTIONS"
305
+ value-by="id"
306
+ />
307
+ </template>
308
+ </TextInput>
309
+ </div>
310
+ `,
311
+ }),
312
+ };
313
+
314
+ export const WithTrailingCombobox: Story = {
315
+ args: {
316
+ placeholder: 'Search...',
317
+ },
318
+
319
+ render: args => ({
320
+ components: { TextInput, TextInputAffix, TextInputButton, Combobox },
321
+ setup() {
322
+ const model = ref();
323
+
324
+ return { args, OPTIONS, model };
325
+ },
326
+ template: `
327
+ <div style="display: grid; gap: 20px; justify-content: center;">
328
+ <TextInput v-bind="args">
329
+ <template #leadingNode>
330
+ <Combobox
331
+ v-model="model"
332
+ type="compact-input"
333
+ :options="OPTIONS"
334
+ value-by="id"
335
+ />
336
+ </template>
240
337
  </TextInput>
241
338
  </div>
242
339
  `,
@@ -3,14 +3,12 @@ import type { HTMLAttributes } from 'vue';
3
3
  import { useDelegatedProps } from '@/composables/use-delegated-props';
4
4
  import clsx from 'clsx';
5
5
 
6
- const props = withDefaults(defineProps<{
6
+ const props = defineProps<{
7
7
  class?: HTMLAttributes['class'];
8
- variant?: 'prefix' | 'suffix';
9
8
  inline?: boolean;
10
9
  asKbd?: boolean;
11
- }>(), {
12
- variant: 'prefix',
13
- });
10
+ }>();
11
+
14
12
  const delegatedProps = useDelegatedProps(props, 'class');
15
13
  </script>
16
14
 
@@ -27,16 +25,11 @@ const delegatedProps = useDelegatedProps(props, 'class');
27
25
  .celeste-text-input-affix {
28
26
  display: flex;
29
27
  align-items: center;
30
- height: calc(var(--input-height) - var(--spacing-2));
31
- color: var(--color-text-sub-600);
32
-
33
- &[variant='prefix'] {
34
- order: -1;
35
- }
28
+ color: var(--celeste-text-input-affix-color);
36
29
 
37
30
  &[inline='false'] {
38
31
  padding-inline: var(--spacing-10);
39
- background-color: transparent;
32
+ background-color: var(--celeste-text-input-affix-background-color);
40
33
  }
41
34
 
42
35
  &[askbd='true'] {
@@ -26,11 +26,16 @@ const delegatedProps = useDelegatedProps(props, 'class');
26
26
 
27
27
  <style scoped lang="scss">
28
28
  .celeste-text-input-button {
29
- height: calc(var(--input-height) - var(--spacing-2));
30
29
  border: none;
31
30
 
31
+ &:focus,
32
+ &:hover,
33
+ &:active {
34
+ box-shadow: none !important;
35
+ }
36
+
32
37
  &[inline='false'] {
33
- padding: var(--spacing-8);
38
+ padding: var(--spacing-10);
34
39
  border-end-start-radius: 0;
35
40
  border-start-start-radius: 0;
36
41
 
@@ -46,7 +51,7 @@ const delegatedProps = useDelegatedProps(props, 'class');
46
51
  &[inline='true'] {
47
52
  width: 20px;
48
53
  height: 20px;
49
- margin-inline-end: var(--input-padding);
54
+ color: var(--celeste-text-input-icon-color) !important;
50
55
 
51
56
  &:hover {
52
57
  background-color: transparent !important;
@@ -1,6 +1,9 @@
1
1
  <script setup lang="ts">
2
- import type { InputHTMLAttributes } from 'vue';
2
+ import { uid } from '@/utils/crypto';
3
3
  import clsx from 'clsx';
4
+ import { Primitive } from 'radix-vue';
5
+ import { computed, type InputHTMLAttributes } from 'vue';
6
+ import TextInputButton from './text-input-button.vue';
4
7
 
5
8
  const props = withDefaults(defineProps<TextInputProps>(), {
6
9
  type: 'text',
@@ -8,7 +11,17 @@ const props = withDefaults(defineProps<TextInputProps>(), {
8
11
  hasError: false,
9
12
  });
10
13
 
14
+ const id = computed(() => props.id || uid());
15
+
11
16
  const modelValue = defineModel<string | number>();
17
+
18
+ const showClearButton = computed(() => {
19
+ return props.type === 'search' && modelValue.value && String(modelValue.value).length > 0;
20
+ });
21
+
22
+ function clearInput() {
23
+ modelValue.value = '';
24
+ }
12
25
  </script>
13
26
 
14
27
  <script lang="ts">
@@ -21,24 +34,73 @@ export interface TextInputProps extends /* @vue-ignore */ InputHTMLAttributes {
21
34
 
22
35
  <template>
23
36
  <label
37
+ :for="id"
24
38
  :size="size"
25
39
  role="presentation"
26
40
  :has-error="hasError"
27
41
  :class="clsx('celeste-text-input-wrapper', props.class)"
28
42
  >
43
+ <Primitive as-child class="celeste-text-input-icon celeste-text-input-leading-icon">
44
+ <slot name="leadingIcon" />
45
+ </Primitive>
46
+
47
+ <Primitive as-child class="celeste-text-input-node celeste-text-input-leading-node">
48
+ <slot name="leadingNode" />
49
+ </Primitive>
50
+
51
+ <Primitive
52
+ inline
53
+ as-child
54
+ class="celeste-text-input-inline-node celeste-text-input-leading-inline-node"
55
+ >
56
+ <slot name="leadingInlineNode" />
57
+ </Primitive>
58
+
29
59
  <input
60
+ :id="id"
30
61
  v-model="modelValue"
31
62
  v-bind="$attrs"
32
63
  :type="type"
33
64
  class="celeste-text-input"
34
65
  >
35
- <slot />
66
+
67
+ <Primitive as-child class="celeste-text-input-icon celeste-text-input-trailing-icon">
68
+ <slot name="trailingIcon" />
69
+ </Primitive>
70
+
71
+ <Primitive as-child class="celeste-text-input-node celeste-text-input-trailing-node">
72
+
73
+ <slot name="trailingNode" />
74
+ </Primitive>
75
+
76
+ <Primitive
77
+ inline
78
+ as-child
79
+ class="celeste-text-input-inline-node celeste-text-input-trailing-inline-node"
80
+ >
81
+ <TextInputButton
82
+ v-if="showClearButton"
83
+ type="button"
84
+ aria-label="Clear search"
85
+ @click="clearInput"
86
+ >
87
+ <i class="i-celeste-close-line" />
88
+ </TextInputButton>
89
+ <slot v-else name="trailingInlineNode" />
90
+ </Primitive>
36
91
  </label>
37
92
  </template>
38
93
 
39
94
  <style scoped lang="scss">
95
+ /* stylelint-disable no-descending-specificity */
96
+
40
97
  .celeste-text-input-wrapper {
41
- --celeste-input-wrapper-border-color: var(--color-stroke-soft-200);
98
+ --celeste-text-input-border-color: var(--color-stroke-soft-200);
99
+ --celeste-text-input-drop-shadow: var(--shadow-regular-xs);
100
+ --celeste-text-input-icon-color: var(--color-text-soft-400);
101
+ --celeste-text-input-affix-color: var(--color-text-soft-400);
102
+ --celeste-text-input-placeholder-color: var(--color-text-soft-400);
103
+ --celeste-text-input-affix-background-color: var(--color-bg-white-0);
42
104
 
43
105
  display: flex;
44
106
  box-sizing: border-box;
@@ -46,13 +108,12 @@ export interface TextInputProps extends /* @vue-ignore */ InputHTMLAttributes {
46
108
  height: var(--input-height);
47
109
  padding-inline: calc(var(--input-padding) + var(--spacing-2)) var(--input-padding);
48
110
  transition: all var(--animation-fast) ease-out;
111
+ border: 1px solid var(--celeste-text-input-border-color);
49
112
  border-radius: var(--input-radius);
50
113
  outline: 2px solid transparent;
51
114
  outline-offset: 2px;
52
115
  background-color: var(--color-bg-white-0);
53
- box-shadow:
54
- inset 0 0 0 1px var(--celeste-input-wrapper-border-color),
55
- var(--shadow-regular-xs);
116
+ box-shadow: var(--celeste-text-input-drop-shadow);
56
117
  color: var(--color-text-strong-950);
57
118
  font: var(--paragraph-sm);
58
119
  gap: var(--input-gap);
@@ -79,7 +140,7 @@ export interface TextInputProps extends /* @vue-ignore */ InputHTMLAttributes {
79
140
  }
80
141
 
81
142
  &[has-error='true'] {
82
- --celeste-input-wrapper-border-color: var(--color-state-error-base);
143
+ --celeste-text-input-border-color: var(--color-state-error-base);
83
144
  }
84
145
 
85
146
  .celeste-text-input {
@@ -94,24 +155,53 @@ export interface TextInputProps extends /* @vue-ignore */ InputHTMLAttributes {
94
155
 
95
156
  &::placeholder {
96
157
  transition: color var(--animation-fast) ease-out;
97
- color: var(--color-text-soft-400);
158
+ color: var(--celeste-text-input-placeholder-color);
159
+ }
160
+
161
+ // Hide default webkit search cancel button
162
+ &[type='search'] {
163
+ &::-webkit-search-cancel-button {
164
+ display: none;
165
+ appearance: none;
166
+ }
167
+
168
+ &::-webkit-search-decoration {
169
+ display: none;
170
+ appearance: none;
171
+ }
98
172
  }
99
173
  }
100
174
 
175
+ &:has(.celeste-text-input-leading-node) {
176
+ padding-inline-start: 0;
177
+ }
178
+
179
+ &:has(.celeste-text-input-trailing-node) {
180
+ padding-inline-end: 0;
181
+ }
182
+
101
183
  &:has(.celeste-text-input:focus) {
102
- --celeste-input-wrapper-border-color: var(--color-stroke-strong-950);
184
+ --celeste-text-input-border-color: var(--color-stroke-strong-950);
185
+ --celeste-text-input-placeholder-color: var(--color-text-sub-600);
186
+ --celeste-text-input-icon-color: var(--color-text-sub-600);
187
+ --celeste-text-input-affix-color: var(--color-text-sub-600);
103
188
 
104
189
  outline-color: var(--color-stroke-soft-200);
105
190
 
106
191
  &[has-error='true'] {
107
- --celeste-input-wrapper-border-color: var(--color-state-error-base);
192
+ --celeste-text-input-border-color: var(--color-state-error-base);
108
193
 
109
194
  outline-color: var(--color-state-error-lighter);
110
195
  }
111
196
  }
112
197
 
113
198
  &:has(.celeste-text-input:disabled) {
114
- --celeste-input-wrapper-border-color: transparent;
199
+ --celeste-text-input-border-color: transparent;
200
+ --celeste-text-input-drop-shadow: none;
201
+ --celeste-text-input-affix-background-color: var(--color-bg-weak-50);
202
+ --celeste-text-input-affix-color: var(--color-text-disabled-300);
203
+ --celeste-text-input-placeholder-color: var(--color-text-disabled-300);
204
+ --celeste-text-input-icon-color: var(--color-text-disabled-300);
115
205
 
116
206
  background-color: var(--color-bg-weak-50);
117
207
  box-shadow: none;
@@ -122,73 +212,48 @@ export interface TextInputProps extends /* @vue-ignore */ InputHTMLAttributes {
122
212
  color: currentcolor;
123
213
  }
124
214
 
125
- &:deep(.celeste-text-input-icon) {
126
- color: var(--color-icon-disabled-300);
127
- }
128
-
129
- &:deep(.celeste-text-input-affix),
130
- &:deep(.celeste-text-input-button) {
131
- background-color: var(--color-bg-weak-50) !important;
215
+ .celeste-text-input-clear-button {
132
216
  color: var(--color-text-disabled-300);
217
+ pointer-events: none;
133
218
  }
134
219
  }
135
220
 
136
- &:has(.celeste-text-input-button, .celeste-text-input-affix[inline='false'][askbd='false']) {
137
- gap: var(--spacing-0);
138
- padding-inline-end: var(--spacing-0);
139
-
140
- &:has(.celeste-text-input-button[inline='false'], .celeste-text-input-affix[variant='suffix']) {
141
- .celeste-text-input {
142
- padding-inline-end: var(--input-padding);
143
- border-inline-end: 1px solid var(--celeste-input-wrapper-border-color);
144
- }
145
- }
146
-
147
- &:has(.celeste-text-input-affix[variant='prefix']) {
148
- padding-inline: var(--spacing-0) var(--input-padding);
149
-
150
- .celeste-text-input {
151
- padding-inline-start: var(--input-padding);
152
- border-inline-start: 1px solid var(--celeste-input-wrapper-border-color);
153
- }
221
+ &:has(.celeste-text-input:hover:not(:focus, :disabled)) {
222
+ &:not(:has(.celeste-text-input-node)) {
223
+ --celeste-text-input-border-color: transparent;
154
224
  }
155
225
 
156
- &:deep(.celeste-text-input-icon) {
157
- &[position='start'] {
158
- margin-inline-end: var(--input-gap);
159
- }
226
+ &:not(:has(.celeste-text-input-node:hover)) {
227
+ --celeste-text-input-icon-color: var(--color-text-sub-600);
228
+ --celeste-text-input-placeholder-color: var(--color-text-sub-600);
160
229
 
161
- &[position='end'] {
162
- margin-inline-start: var(--input-gap);
163
- }
230
+ background-color: var(--color-bg-weak-50);
164
231
  }
165
232
  }
166
233
 
167
- &:has(.celeste-text-input:hover:not(:focus, :disabled)) {
168
- /* stylelint-disable-next-line no-descending-specificity */
169
- &:not(:has(.celeste-text-input-button, .celeste-text-input-affix)) {
170
- --celeste-input-wrapper-border-color: transparent;
171
-
172
- background-color: var(--color-bg-weak-50);
173
- }
234
+ .celeste-text-input-icon {
235
+ flex-shrink: 0;
236
+ width: 20px;
237
+ height: 20px;
238
+ transition: all var(--animation-fast) ease-out;
239
+ color: var(--celeste-text-input-icon-color);
240
+ }
174
241
 
175
- &:has(.celeste-text-input-button:not(:hover), .celeste-text-input-affix:not(:hover)) {
176
- background-color: var(--color-bg-weak-50);
177
- }
242
+ :deep(.celeste-text-input-node) {
243
+ height: calc(var(--input-height) - var(--spacing-2));
244
+ border-radius: var(--input-radius) !important;
245
+ }
178
246
 
179
- &:not(:has(.celeste-text-input-button:hover)) {
180
- .celeste-text-input::placeholder {
181
- color: var(--color-text-sub-600);
182
- }
183
- }
247
+ :deep(.celeste-text-input-leading-node) {
248
+ border-end-end-radius: 0 !important;
249
+ border-start-end-radius: 0 !important;
250
+ border-inline-end: 1px solid var(--color-stroke-soft-200) !important;
184
251
  }
185
252
 
186
- &:has(.celeste-text-input:placeholder-shown:not(:disabled)) {
187
- /* stylelint-disable-next-line no-descending-specificity */
188
- &:deep(.celeste-text-input-icon),
189
- &:deep(.celeste-text-input-affix) {
190
- color: var(--color-text-soft-400);
191
- }
253
+ :deep(.celeste-text-input-trailing-node) {
254
+ border-inline-start: 1px solid var(--color-stroke-soft-200) !important;
255
+ border-end-start-radius: 0 !important;
256
+ border-start-start-radius: 0 !important;
192
257
  }
193
258
  }
194
259
  </style>