@v1nt1248/3nclient-lib 0.0.41 → 0.1.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.
Files changed (78) hide show
  1. package/README.md +4 -4
  2. package/dist/components/index.d.ts +22 -38
  3. package/dist/components/ui3n-badge-simple.vue.d.ts +3 -3
  4. package/dist/components/ui3n-badge.vue.d.ts +2 -2
  5. package/dist/components/ui3n-breadcrumb.vue.d.ts +7 -7
  6. package/dist/components/ui3n-breadcrumbs.vue.d.ts +3 -3
  7. package/dist/components/ui3n-button.vue.d.ts +29 -4
  8. package/dist/components/ui3n-checkbox.vue.d.ts +3 -3
  9. package/dist/components/ui3n-chip.vue.d.ts +3 -3
  10. package/dist/components/ui3n-dialog.vue.d.ts +6 -5
  11. package/dist/components/ui3n-drop-files.vue.d.ts +23 -3
  12. package/dist/components/ui3n-emoji.vue.d.ts +3 -3
  13. package/dist/components/ui3n-icon.vue.d.ts +29 -3
  14. package/dist/components/ui3n-input.vue.d.ts +9 -9
  15. package/dist/components/ui3n-list.vue.d.ts +4 -4
  16. package/dist/components/ui3n-menu.vue.d.ts +3 -3
  17. package/dist/components/ui3n-notification.vue.d.ts +32 -2
  18. package/dist/components/ui3n-switch.vue.d.ts +55 -0
  19. package/dist/components/ui3n-table-sort-icon.vue.d.ts +1 -1
  20. package/dist/components/ui3n-table.vue.d.ts +4 -3
  21. package/dist/components/ui3n-tabs.vue.d.ts +3 -3
  22. package/dist/components/ui3n-text.vue.d.ts +29 -3
  23. package/dist/components/ui3n-virtual-scroll.vue.d.ts +12 -9
  24. package/dist/constants/types.d.ts +2 -4
  25. package/dist/directives/index.d.ts +3 -2
  26. package/dist/directives/ui3n-click-outside.d.ts +2 -1
  27. package/dist/directives/ui3n-html.d.ts +1 -0
  28. package/dist/index.d.ts +27 -29
  29. package/dist/plugins/dialogs.d.ts +3 -3
  30. package/dist/plugins/i18n.d.ts +2 -2
  31. package/dist/plugins/icons.d.ts +1 -0
  32. package/dist/plugins/index.d.ts +5 -8
  33. package/dist/plugins/notifications.d.ts +2 -2
  34. package/dist/plugins/store-dialogs.d.ts +2 -1
  35. package/dist/plugins/store-notifications.d.ts +2 -1
  36. package/dist/plugins/store-vue-bus.d.ts +2 -1
  37. package/dist/plugins/vue-bus.d.ts +3 -3
  38. package/dist/style.css +1 -1
  39. package/dist/tools/sqlite-on-3nstorage/index.d.ts +3 -2
  40. package/dist/tools/ui.helpers.d.ts +1 -0
  41. package/dist/ui-3n-lib.js +6953 -6615
  42. package/package.json +57 -58
  43. package/src/components/index.ts +47 -41
  44. package/src/components/ui3n-badge-simple.vue +35 -38
  45. package/src/components/ui3n-badge.vue +25 -25
  46. package/src/components/ui3n-breadcrumb.vue +44 -44
  47. package/src/components/ui3n-breadcrumbs.vue +19 -19
  48. package/src/components/ui3n-button.vue +240 -150
  49. package/src/components/ui3n-checkbox.vue +199 -158
  50. package/src/components/ui3n-chip.vue +96 -98
  51. package/src/components/ui3n-dialog.vue +225 -235
  52. package/src/components/ui3n-drop-files.vue +146 -154
  53. package/src/components/ui3n-emoji.vue +62 -64
  54. package/src/components/ui3n-icon.vue +32 -13
  55. package/src/components/ui3n-input.vue +239 -221
  56. package/src/components/ui3n-list.vue +92 -111
  57. package/src/components/ui3n-menu.vue +101 -100
  58. package/src/components/ui3n-notification.vue +182 -113
  59. package/src/components/ui3n-switch.vue +146 -0
  60. package/src/components/ui3n-table-sort-icon.vue +1 -2
  61. package/src/components/ui3n-table.vue +229 -223
  62. package/src/components/ui3n-tabs.vue +141 -148
  63. package/src/components/ui3n-text.vue +235 -146
  64. package/src/components/ui3n-virtual-scroll.vue +68 -68
  65. package/dist/stories/Ui3nBadge.stories.d.ts +0 -124
  66. package/dist/stories/Ui3nBreadcrumbs.stories.d.ts +0 -252
  67. package/dist/stories/Ui3nButton.stories.d.ts +0 -152
  68. package/dist/stories/Ui3nCheckbox.stories.d.ts +0 -186
  69. package/dist/stories/Ui3nChip.stories.d.ts +0 -562
  70. package/dist/stories/Ui3nDialog.stories.d.ts +0 -41
  71. package/dist/stories/Ui3nDropFiles.stories.d.ts +0 -73
  72. package/dist/stories/Ui3nEmoji.stories.d.ts +0 -39
  73. package/dist/stories/Ui3nIcon.stories.d.ts +0 -80
  74. package/dist/stories/Ui3nInput.stories.d.ts +0 -456
  75. package/dist/stories/Ui3nList.stories.d.ts +0 -54
  76. package/dist/stories/Ui3nTabs.stories.d.ts +0 -177
  77. package/dist/stories/data/data-to-list.d.ts +0 -8
  78. package/dist/stories/data/icons.d.ts +0 -1
@@ -1,146 +1,158 @@
1
1
  <script lang="ts" setup>
2
- import { computed, onMounted, watch, onBeforeMount, ref, useSlots } from 'vue'
3
- import Ui3nIcon from './ui3n-icon.vue'
4
-
5
- type Ui3nCheckboxValue = boolean | string | number;
6
-
7
- export interface Ui3nCheckboxProps {
8
- modelValue: Ui3nCheckboxValue;
9
- checkedValue?: Ui3nCheckboxValue;
10
- uncheckedValue?: Ui3nCheckboxValue;
11
- size?: number|string;
12
- color?: string;
13
- indeterminate?: boolean;
14
- disabled?: boolean;
2
+ import { computed, onMounted, watch, onBeforeMount, ref, useSlots } from 'vue';
3
+
4
+ type Ui3nCheckboxValue = boolean | string | number;
5
+
6
+ export interface Ui3nCheckboxProps {
7
+ modelValue: Ui3nCheckboxValue;
8
+ checkedValue?: Ui3nCheckboxValue;
9
+ uncheckedValue?: Ui3nCheckboxValue;
10
+ size?: number | string;
11
+ color?: string;
12
+ indeterminate?: boolean;
13
+ disabled?: boolean;
14
+ }
15
+
16
+ export interface Ui3nCheckboxEmits {
17
+ (ev: 'change', value: Ui3nCheckboxValue): void;
18
+ (ev: 'update:modelValue', value: Ui3nCheckboxValue): void;
19
+ }
20
+
21
+ export interface Ui3nCheckboxSlots {
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ default: () => any;
24
+ }
25
+
26
+ const props = withDefaults(
27
+ defineProps<Ui3nCheckboxProps>(),
28
+ {
29
+ modelValue: false,
30
+ checkedValue: true,
31
+ uncheckedValue: false,
32
+ size: '16',
33
+ color: 'var(--color-icon-control-accent-default)',
34
+ indeterminate: false,
35
+ disabled: false,
36
+ },
37
+ );
38
+ const emits = defineEmits<Ui3nCheckboxEmits>();
39
+ defineSlots<Ui3nCheckboxSlots>();
40
+
41
+ const slots = useSlots();
42
+ const checkboxEl = ref<HTMLDivElement | null>(null);
43
+ const val = ref<Ui3nCheckboxValue>(props.uncheckedValue || false);
44
+ const uncertain = ref(false);
45
+
46
+ onBeforeMount(() => {
47
+ const checkedValueType = typeof props.checkedValue;
48
+ const uncheckedValueType = typeof props.uncheckedValue;
49
+ const valueType = typeof props.modelValue;
50
+ if (
51
+ checkedValueType !== uncheckedValueType
52
+ || checkedValueType !== valueType
53
+ || uncheckedValueType !== valueType
54
+ ) {
55
+ throw Error('[Ui3nCheckbox] types of "value", "checkedValue" and "uncheckedValue" are different');
15
56
  }
57
+ });
16
58
 
17
- export interface Ui3nCheckboxEmits {
18
- (ev: 'change', value: Ui3nCheckboxValue): void;
19
- (ev: 'update:modelValue', value: Ui3nCheckboxValue): void;
59
+ onMounted(() => {
60
+ if (checkboxEl.value) {
61
+ checkboxEl.value.style.setProperty('--ui3n-checkbox-size', `${props.size}px`);
20
62
  }
21
-
22
- export interface Ui3nCheckboxSlots {
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- default: () => any;
25
- }
26
-
27
- const iconMap = {
28
- checked: 'check-box-checked',
29
- unchecked: 'check-box',
30
- indeterminate: 'check-box-inderterminate',
31
- }
32
-
33
- const props = withDefaults(
34
- defineProps<Ui3nCheckboxProps>(),
35
- {
36
- modelValue: false,
37
- checkedValue: true,
38
- uncheckedValue: false,
39
- size: '16',
40
- color: '#0090ec',
41
- indeterminate: false,
42
- disabled: false,
43
- },
44
- )
45
- const emits = defineEmits<Ui3nCheckboxEmits>()
46
- defineSlots<Ui3nCheckboxSlots>()
47
-
48
- const slots = useSlots()
49
-
50
- const checkboxEl = ref<HTMLDivElement|null>(null)
51
- const val = ref<Ui3nCheckboxValue>(props.uncheckedValue || false)
52
- const uncertain = ref(false)
53
-
54
- onBeforeMount(() => {
55
- const checkedValueType = typeof props.checkedValue
56
- const uncheckedValueType = typeof props.uncheckedValue
57
- const valueType = typeof props.modelValue
58
- if (
59
- checkedValueType !== uncheckedValueType
60
- || checkedValueType !== valueType
61
- || uncheckedValueType !== valueType
62
- ) {
63
- throw Error('[Ui3nCheckbox] types of "value", "checkedValue" and "unchecktdValue" are different')
64
- }
65
- })
66
-
67
- onMounted(() => {
63
+ });
64
+
65
+ watch(
66
+ () => props.modelValue,
67
+ newValue => val.value = newValue,
68
+ { immediate: true },
69
+ );
70
+
71
+ watch(
72
+ () => props.indeterminate,
73
+ newValue => uncertain.value = newValue,
74
+ { immediate: true },
75
+ );
76
+
77
+ watch(
78
+ () => props.size,
79
+ newValue => {
68
80
  if (checkboxEl.value) {
69
- checkboxEl.value.style.setProperty('--ui3n-checkbox-size', `${props.size}px`)
70
- }
71
- })
72
-
73
- watch(
74
- () => props.modelValue,
75
- newValue => val.value = newValue,
76
- { immediate: true },
77
- )
78
-
79
- watch(
80
- () => props.indeterminate,
81
- newValue => uncertain.value = newValue,
82
- { immediate: true},
83
- )
84
-
85
- watch(
86
- () => props.size,
87
- newValue => {
88
- if (checkboxEl.value) {
89
- checkboxEl.value.style.setProperty('--ui3n-checkbox-size', `${newValue}px`)
90
- }
91
- },
92
- )
93
-
94
- const checkBoxValue = computed(() => {
95
- if (uncertain.value) {
96
- return 'indeterminate'
81
+ checkboxEl.value.style.setProperty('--ui3n-checkbox-size', `${newValue}px`);
97
82
  }
83
+ },
84
+ );
98
85
 
99
- return val.value === props.checkedValue
100
- ? 'checked'
101
- : 'unchecked'
102
- } )
86
+ const checkBoxValue = computed(() => {
87
+ if (uncertain.value) {
88
+ return 'indeterminate';
89
+ }
103
90
 
104
- const change = () => {
105
- val.value = checkBoxValue.value !== 'unchecked'
106
- ? props.uncheckedValue
107
- : props.checkedValue
91
+ return val.value === props.checkedValue
92
+ ? 'checked'
93
+ : 'unchecked';
94
+ });
108
95
 
109
- if (uncertain.value) {
110
- uncertain.value = false
111
- }
96
+ const change = () => {
97
+ val.value = checkBoxValue.value !== 'unchecked'
98
+ ? props.uncheckedValue
99
+ : props.checkedValue;
112
100
 
113
- emits('change', val.value)
114
- emits('update:modelValue', val.value)
101
+ if (uncertain.value) {
102
+ uncertain.value = false;
115
103
  }
104
+
105
+ emits('change', val.value);
106
+ emits('update:modelValue', val.value);
107
+ };
116
108
  </script>
117
109
 
118
110
  <template>
119
111
  <div
120
112
  ref="checkboxEl"
121
- :class="[
122
- 'ui3n-checkbox',
123
- {
124
- 'ui3n-checkbox--disabled': props.disabled,
125
- 'ui3n-checkbox--with-label': slots.default,
126
- },
127
- ]"
113
+ :class="[$style.checkbox, disabled && $style.disabled, !slots.default && $style.noLabel]"
128
114
  >
129
115
  <div
130
- class="ui3n-checkbox__wrapper"
116
+ :class="[$style.body, checkBoxValue === 'unchecked' ? $style.unfilled : $style.filled]"
131
117
  @click="change"
132
118
  >
133
- <ui3n-icon
134
- class="ui3n-checkbox__icon"
135
- :icon="iconMap[checkBoxValue]"
136
- :width="props.size"
137
- :height="props.size"
138
- :color="props.color"
139
- />
119
+ <svg
120
+ v-if="checkBoxValue === 'checked'"
121
+ :width="Number(size) - 4"
122
+ :height="Number(size) - 4"
123
+ viewBox="0 0 24 24"
124
+ fill="none"
125
+ xmlns="http://www.w3.org/2000/svg"
126
+ :class="$style.icon"
127
+ >
128
+ <g id="SVGRepo_bgCarrier" stroke-width="0" />
129
+ <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" />
130
+ <g id="SVGRepo_iconCarrier">
131
+ <path d="M20.0001 7L9.0001 18L4 13" stroke="#fff" stroke-width="3" stroke-linecap="round"
132
+ stroke-linejoin="round"
133
+ />
134
+ </g>
135
+ </svg>
136
+
137
+ <svg
138
+ v-if="checkBoxValue === 'indeterminate'"
139
+ :width="Number(size) - 4"
140
+ :height="Number(size) - 4"
141
+ viewBox="0 0 24 24"
142
+ fill="none"
143
+ xmlns="http://www.w3.org/2000/svg"
144
+ :class="$style.icon"
145
+ >
146
+ <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
147
+ <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
148
+ <g id="SVGRepo_iconCarrier">
149
+ <path d="M7 12L17 12" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
150
+ </g>
151
+ </svg>
140
152
  </div>
141
153
 
142
154
  <div
143
- class="ui3n-checkbox__label"
155
+ :class="$style.label"
144
156
  @click="change"
145
157
  >
146
158
  <slot />
@@ -148,44 +160,73 @@
148
160
  </div>
149
161
  </template>
150
162
 
151
- <style lang="scss" scoped>
152
- @import "../assets/styles/mixins";
153
-
154
- .ui3n-checkbox {
155
- --ui3n-checkbox-size: 16px;
156
- --ui3n-checkbox-text-size: 12px;
157
- --ui3n-checkbox-text-color: var(--black-90, #212121);
158
- --ui3n-checkbox-text-weight: 500;
159
-
160
- position: relative;
161
- display: flex;
162
- justify-content: flex-start;
163
- align-items: center;
164
-
165
- &__wrapper {
166
- position: relative;
167
- display: flex;
168
- width: calc(var(--ui3n-checkbox-size) * 1.5);
169
- height: calc(var(--ui3n-checkbox-size) * 1.5);
170
- justify-content: center;
171
- align-items: center;
172
- border-radius: 50%;
173
- cursor: pointer;
174
-
175
- @include ripple(transparent);
176
- }
177
-
178
- &__label {
179
- font-size: var(--ui3n-checkbox-text-size);
180
- font-weight: var(--ui3n-checkbox-text-weight);
181
- color: var(--ui3n-checkbox-text-color);
182
- user-select: none;
183
- cursor: pointer;
184
- }
163
+ <style lang="scss" module>
164
+ @import "../assets/styles/mixins";
165
+
166
+ .checkbox {
167
+ --ui3n-checkbox-size: 16px;
168
+ --ui3n-checkbox-color: var(--color-icon-control-accent-default);
169
+ --ui3n-checkbox-text-size: 12px;
170
+ --ui3n-checkbox-text-color: var(--color-text-control-primary-default);
171
+ --ui3n-checkbox-text-weight: 500;
172
+
173
+ position: relative;
174
+ display: flex;
175
+ justify-content: flex-start;
176
+ align-items: center;
177
+ min-height: var(--spacing-vl);
178
+ gap: var(--spacing-s);
179
+ }
180
+
181
+ .noLabel {
182
+ gap: 0;
183
+ }
184
+
185
+ .body {
186
+ position: relative;
187
+ display: flex;
188
+ width: var(--ui3n-checkbox-size);
189
+ height: var(--ui3n-checkbox-size);
190
+ justify-content: center;
191
+ align-items: center;
192
+ border-radius: calc(var(--ui3n-checkbox-size) / 10);
193
+ border: calc(var(--ui3n-checkbox-size) / 10) solid var(--ui3n-checkbox-color);
194
+ cursor: pointer;
195
+ }
196
+
197
+ .filled {
198
+ background-color: var(--ui3n-checkbox-color);
199
+
200
+ &:hover {
201
+ border-color: hsl(from var(--ui3n-checkbox-color) h s calc(l - 10));
202
+ background-color: hsl(from var(--ui3n-checkbox-color) h s calc(l - 10));
203
+ @include ripple(hsl(from var(--ui3n-checkbox-color) h s calc(l - 10)));
204
+ }
205
+ }
185
206
 
186
- &--disabled {
187
- pointer-events: none;
188
- opacity: 0.5;
189
- }
207
+ .unfilled {
208
+ &:hover {
209
+ border-color: hsl(from var(--ui3n-checkbox-color) h s calc(l - 10));
210
+ background-color: hsl(from transparent h s calc(l - 10));
211
+ @include ripple(hsl(from transparent h s calc(l - 10)));
190
212
  }
213
+ }
214
+
215
+ .icon {
216
+ min-height: calc(var(--ui3n-checkbox-size) - 4px);
217
+ min-width: calc(var(--ui3n-checkbox-size) - 4px);
218
+ }
219
+
220
+ .label {
221
+ font-size: var(--ui3n-checkbox-text-size);
222
+ font-weight: var(--ui3n-checkbox-text-weight);
223
+ color: var(--ui3n-checkbox-text-color);
224
+ user-select: none;
225
+ cursor: pointer;
226
+ }
227
+
228
+ .disabled {
229
+ opacity: 0.7;
230
+ pointer-events: none;
231
+ }
191
232
  </style>
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
- import { computed, useSlots } from 'vue'
3
- import Ui3nButton from './ui3n-button.vue'
2
+ import { computed, useSlots } from 'vue';
3
+ import Ui3nButton from './ui3n-button.vue';
4
4
 
5
5
  /* eslint-disable @typescript-eslint/no-explicit-any */
6
6
  export interface Ui3nChipProps {
@@ -29,128 +29,126 @@
29
29
  plain: false,
30
30
  round: true,
31
31
  closeable: false,
32
- color: '#f2f2f2',
32
+ color: 'var(--color-bg-control-secondary-default)',
33
33
  textSize: 10,
34
- textColor: '#212121',
34
+ textColor: 'var(--color-text-control-primary-default)',
35
35
  },
36
- )
37
- const emits = defineEmits<Ui3nChipEmits>()
38
- defineSlots<Ui3nChipSlots>()
39
-
40
- const slots = useSlots()
41
-
42
- const height = computed(() => `${props.height}px`)
43
- const iconHeight = computed(() => props.height ? Number(props.height) - 2 : Number(props.height))
44
- const padding = computed(() => `${Math.round(Number(props.height) / 3)}px`)
45
- const maxWidth = computed(() => `${props.maxWidth}px`)
46
- const bgColor = computed(() => props.color)
47
- const textSize = computed(() => `${props.textSize}px`)
48
- const textColor = computed(() => props.textColor)
49
- const hasLeftSlot = computed(() => !!slots.left)
36
+ );
37
+
38
+ const emits = defineEmits<Ui3nChipEmits>();
39
+ defineSlots<Ui3nChipSlots>();
40
+
41
+ const slots = useSlots();
42
+
43
+ const height = computed(() => `${props.height}px`);
44
+ const iconHeight = computed(() => props.height ? Number(props.height) - 2 : Number(props.height));
45
+ const padding = computed(() => `${Math.round(Number(props.height) / 3)}px`);
46
+ const maxWidth = computed(() => `${props.maxWidth}px`);
47
+ const bgColor = computed(() => props.color);
48
+ const textSize = computed(() => `${props.textSize}px`);
49
+ const textColor = computed(() => props.textColor);
50
+ const hasLeftSlot = computed(() => !!slots.left);
50
51
  </script>
51
52
 
52
53
  <template>
53
54
  <div
54
55
  :class="[
55
- 'ui3n-chip',
56
- {
57
- 'ui3n-chip--round': props.round,
58
- 'ui3n-chip--plain': props.plain,
59
- 'ui3n-chip--closeble': props.closeable,
60
- 'ui3n-chip--with-icon': hasLeftSlot,
61
- },
56
+ $style.chip,
57
+ round && $style.round,
58
+ plain && $style.plain,
59
+ closeable && $style.closable,
60
+ hasLeftSlot && $style.withIcon,
62
61
  ]"
63
62
  >
64
- <div class="ui3n-chip__icon">
65
- <slot
66
- name="left"
67
- :size="iconHeight"
68
- :color="props.textColor"
69
- />
63
+ <div :class="$style.icon">
64
+ <slot name="left" :size="iconHeight" :color="props.textColor" />
70
65
  </div>
71
-
72
- <div class="ui3n-chip__body">
66
+
67
+ <div :class="$style.body">
73
68
  <slot />
74
69
  </div>
75
-
70
+
76
71
  <ui3n-button
77
- v-if="props.closeable"
78
- class="ui3n-chip__close"
79
- round
72
+ v-if="closeable"
73
+ :class="$style.closeBtn"
74
+ type="icon"
75
+ size="small"
80
76
  color="transparent"
81
77
  icon="close"
82
- icon-size="12"
83
- icon-color="#212121"
78
+ icon-color="var(--color-icon-control-primary-default)"
84
79
  @click="emits('close')"
85
80
  />
86
81
  </div>
87
82
  </template>
88
83
 
89
- <style lang="scss" scoped>
90
- @import "../assets/styles/mixins";
91
-
92
- .ui3n-chip {
93
- position: relative;
94
- display: flex;
95
- height: v-bind('height');
96
- padding: 0 v-bind('padding');
97
- width: max-content;
98
- max-width: v-bind('maxWidth');
99
- background-color: v-bind('bgColor');
100
- display: flex;
101
- justify-content: flex-start;
102
- align-items: center;
103
-
104
- &__body {
105
- font-size: v-bind('textSize');
106
- line-height: 1;
107
- font-weight: 400;
108
- color: v-bind('textColor');
109
- overflow: hidden;
110
- white-space: nowrap;
111
- text-overflow: ellipsis;
112
- }
113
-
114
- &__close {
115
- margin-left: var(--half-size, 4px);
116
- }
117
-
118
- &--with-icon {
119
- .ui3n-chip__icon {
120
- display: flex;
121
- margin-right: 5px;
122
- }
123
- }
124
-
125
- &--round {
126
- border-radius: calc(v-bind('height') / 2);
84
+ <style lang="scss" module>
85
+ @import "../assets/styles/mixins";
86
+
87
+ .chip {
88
+ position: relative;
89
+ display: flex;
90
+ height: v-bind('height');
91
+ padding: 0 v-bind('padding');
92
+ width: max-content;
93
+ max-width: v-bind('maxWidth');
94
+ background-color: v-bind('bgColor');
95
+ justify-content: flex-start;
96
+ align-items: center;
97
+
98
+ &.closeable:not(.withIcon) {
99
+ .body {
100
+ max-width: calc(100% - 24px);
127
101
  }
102
+ }
128
103
 
129
- &--closeble {
130
- min-width: 24px;
131
- padding-right: 0;
104
+ &.withIcon:not(.closeable) {
105
+ .body {
106
+ max-width: calc(100% - v-bind(height) - 4px);
132
107
  }
108
+ }
133
109
 
134
- &--plain {
135
- border: 1px solid v-bind('textColor');
110
+ &.closable.withIcon {
111
+ .body {
112
+ max-width: calc(100% - v-bind(height) - 28px);
136
113
  }
114
+ }
115
+ }
116
+
117
+ .body {
118
+ font-size: v-bind('textSize');
119
+ line-height: 1;
120
+ font-weight: 400;
121
+ color: v-bind('textColor');
122
+ overflow: hidden;
123
+ white-space: nowrap;
124
+ text-overflow: ellipsis;
125
+ }
126
+
127
+ .closeBtn {
128
+ margin-left: var(--spacing-xs);
129
+ }
130
+
131
+ .withIcon {
132
+ .icon {
133
+ display: flex;
134
+ flex-grow: 0;
135
+ flex-shrink: 0;
136
+ border-radius: 50%;
137
+ overflow: hidden;
138
+ margin-right: var(--spacing-xs);
139
+ }
140
+ }
137
141
 
138
- &.ui3n-chip--closable:not(.ui3n-chip--with-icon) {
139
- .ui3n-chip__body {
140
- max-width: calc(100% - 24px);
141
- }
142
- }
142
+ .round {
143
+ border-radius: calc(v-bind('height') / 2);
144
+ }
143
145
 
144
- &.ui3n-chip--with-icon:not(.ui3n-chip--closable) {
145
- .ui3n-chip__body {
146
- max-width: calc(100% - v-bind(height) - 5px);
147
- }
148
- }
146
+ .closeable {
147
+ min-width: var(--spacing-ml);
148
+ padding-right: 0;
149
+ }
149
150
 
150
- &.ui3n-chip--closable.ui3n-chip--with-icon {
151
- .ui3n-chip__body {
152
- max-width: calc(100% - v-bind(height) - 29px);
153
- }
154
- }
155
- }
151
+ .plain {
152
+ border: 1px solid v-bind('textColor');
153
+ }
156
154
  </style>