@v1nt1248/3nclient-lib 0.3.51 → 0.4.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 (54) hide show
  1. package/README.md +2 -0
  2. package/dist/chunks/{ui3n-notification-o0tuhTpO.js → ui3n-notification-CTYQV3nR.js} +38 -37
  3. package/dist/src/components/ui3n-chip/ui3n-chip.d.ts +0 -5
  4. package/dist/src/components/ui3n-icon/ui3n-icon.d.ts +0 -1
  5. package/dist/src/components/ui3n-progress/ui3n-progress-circular.d.ts +0 -2
  6. package/dist/src/components/ui3n-progress/ui3n-progress-linear.d.ts +0 -2
  7. package/dist/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.d.ts +0 -7
  8. package/dist/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.d.ts +0 -7
  9. package/dist/src/components/ui3n-slider/ui3n-slider.d.ts +0 -5
  10. package/dist/src/components/ui3n-tabs/ui3n-tabs.d.ts +0 -4
  11. package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +0 -3
  12. package/dist/style.css +1 -1
  13. package/dist/ui3n-components.js +1697 -1748
  14. package/dist/ui3n-plugins.js +2 -1
  15. package/package.json +11 -4
  16. package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +28 -25
  17. package/src/components/ui3n-badge/ui3n-badge-simple.vue +18 -17
  18. package/src/components/ui3n-badge/ui3n-badge.vue +3 -2
  19. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +11 -10
  20. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +4 -1
  21. package/src/components/ui3n-button/ui3n-button.vue +244 -158
  22. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +22 -21
  23. package/src/components/ui3n-chip/ui3n-chip.vue +56 -40
  24. package/src/components/ui3n-dialog/ui3n-dialog-provider.vue +1 -0
  25. package/src/components/ui3n-dialog/ui3n-dialog.vue +19 -18
  26. package/src/components/ui3n-drop-files/ui3n-drop-files.vue +8 -7
  27. package/src/components/ui3n-editable/ui3n-content-editable.vue +11 -10
  28. package/src/components/ui3n-editable/ui3n-editable.vue +26 -25
  29. package/src/components/ui3n-emoji/ui3n-emoji.vue +7 -6
  30. package/src/components/ui3n-icon/ui3n-icon.vue +26 -16
  31. package/src/components/ui3n-input/ui3n-input.vue +36 -32
  32. package/src/components/ui3n-input-file/ui3n-input-file.vue +8 -5
  33. package/src/components/ui3n-list/ui3n-list.vue +8 -7
  34. package/src/components/ui3n-menu/ui3n-menu.vue +6 -5
  35. package/src/components/ui3n-mobile-menu/ui3n-mobile-menu.vue +4 -3
  36. package/src/components/ui3n-mobile-menu-item/ui3n-mobile-menu-item.vue +7 -6
  37. package/src/components/ui3n-notification/ui3n-notification-container.vue +1 -0
  38. package/src/components/ui3n-notification/ui3n-notification.vue +28 -26
  39. package/src/components/ui3n-progress/ui3n-progress-circular.vue +32 -19
  40. package/src/components/ui3n-progress/ui3n-progress-linear.vue +31 -18
  41. package/src/components/ui3n-radio-group/ui3n-radio-group.vue +4 -1
  42. package/src/components/ui3n-radio-group/ui3n-radio.vue +6 -5
  43. package/src/components/ui3n-scrollbar/ui3n-scrollbar.vue +94 -83
  44. package/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.vue +51 -39
  45. package/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.vue +51 -39
  46. package/src/components/ui3n-selector/ui3n-selector.vue +33 -28
  47. package/src/components/ui3n-slider/ui3n-slider.vue +53 -34
  48. package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +10 -6
  49. package/src/components/ui3n-switch/ui3n-switch.vue +23 -22
  50. package/src/components/ui3n-table/ui3n-table.vue +50 -48
  51. package/src/components/ui3n-tabs/ui3n-tabs.vue +38 -20
  52. package/src/components/ui3n-text/ui3n-text.vue +15 -14
  53. package/src/components/ui3n-tooltip/ui3n-tooltip-old.vue +14 -11
  54. package/src/components/ui3n-tooltip/ui3n-tooltip.vue +38 -27
@@ -136,6 +136,7 @@
136
136
  <div
137
137
  ref="checkboxEl"
138
138
  :id="id"
139
+ data-ui3n="checkbox"
139
140
  :class="mainCssClasses"
140
141
  :style="inlineStyles"
141
142
  >
@@ -207,18 +208,18 @@
207
208
 
208
209
  <style lang="scss" module>
209
210
  .ui3nCheckbox {
210
- --ui3n-checkbox-size: 16px;
211
- --ui3n-checkbox-gap: 4px;
212
- --ui3n-checkbox-color: var(--color-icon-control-accent-default);
213
- --ui3n-checkbox-text-size: 12px;
214
- --ui3n-checkbox-text-color: var(--color-text-control-primary-default);
215
- --ui3n-checkbox-text-weight: 500;
211
+ --_checkbox-size: var(--ui3n-checkbox-size, 16px);
212
+ --_checkbox-gap: var(--ui3n-checkbox-gap, 4px);
213
+ --_checkbox-color: var(--ui3n-checkbox-color, var(--color-icon-control-accent-default));
214
+ --_checkbox-text-size: var(--ui3n-checkbox-text-size, 12px);
215
+ --_checkbox-text-color: var(--ui3n-checkbox-text-color, var(--color-text-control-primary-default));
216
+ --_checkbox-text-weight: var(--ui3n-checkbox-text-weight, 500);
216
217
 
217
218
  position: relative;
218
219
  display: flex;
219
220
  justify-content: flex-start;
220
221
  align-items: center;
221
- gap: var(--ui3n-checkbox-gap);
222
+ gap: var(--_checkbox-gap);
222
223
  }
223
224
 
224
225
  .noLabel {
@@ -228,14 +229,14 @@
228
229
  .ui3nCheckboxBody {
229
230
  position: relative;
230
231
  display: flex;
231
- width: var(--ui3n-checkbox-size);
232
- min-width: var(--ui3n-checkbox-size);
233
- height: var(--ui3n-checkbox-size);
234
- min-height: var(--ui3n-checkbox-size);
232
+ width: var(--_checkbox-size);
233
+ min-width: var(--_checkbox-size);
234
+ height: var(--_checkbox-size);
235
+ min-height: var(--_checkbox-size);
235
236
  justify-content: center;
236
237
  align-items: center;
237
- border-radius: calc(var(--ui3n-checkbox-size) / 6);
238
- border: calc(var(--ui3n-checkbox-size) / 10) solid var(--ui3n-checkbox-color);
238
+ border-radius: calc(var(--_checkbox-size) / 6);
239
+ border: calc(var(--_checkbox-size) / 10) solid var(--_checkbox-color);
239
240
  cursor: pointer;
240
241
  overflow: hidden;
241
242
  transition:
@@ -244,18 +245,18 @@
244
245
  }
245
246
 
246
247
  .filled {
247
- background-color: var(--ui3n-checkbox-color);
248
+ background-color: var(--_checkbox-color);
248
249
 
249
250
  &:hover {
250
- border-color: color-mix(in oklch, var(--ui3n-checkbox-color), black 12%);
251
- background-color: color-mix(in oklch, var(--ui3n-checkbox-color), black 12%);
251
+ border-color: color-mix(in oklch, var(--_checkbox-color), black 12%);
252
+ background-color: color-mix(in oklch, var(--_checkbox-color), black 12%);
252
253
  }
253
254
  }
254
255
 
255
256
  .unfilled {
256
257
  &:hover {
257
- border-color: color-mix(in oklch, var(--ui3n-checkbox-color) 84%, black);
258
- background-color: color-mix(in oklch, var(--ui3n-checkbox-color) 16%, transparent);
258
+ border-color: color-mix(in oklch, var(--_checkbox-color) 84%, black);
259
+ background-color: color-mix(in oklch, var(--_checkbox-color) 16%, transparent);
259
260
  }
260
261
  }
261
262
 
@@ -264,9 +265,9 @@
264
265
  }
265
266
 
266
267
  .ui3nCheckboxLabel {
267
- font-size: var(--ui3n-checkbox-text-size);
268
- font-weight: var(--ui3n-checkbox-text-weight);
269
- color: var(--ui3n-checkbox-text-color);
268
+ font-size: var(--_checkbox-text-size);
269
+ font-weight: var(--_checkbox-text-weight);
270
+ color: var(--_checkbox-text-color);
270
271
  user-select: none;
271
272
  cursor: pointer;
272
273
  }
@@ -1,17 +1,21 @@
1
1
  <script lang="ts" setup>
2
2
  import { computed, useSlots } from 'vue';
3
3
  import Ui3nButton from '../ui3n-button/ui3n-button.vue';
4
+ import { toCssLength } from '../../utils/ui/to-css-length';
4
5
  import type { Ui3nChipEmits, Ui3nChipProps, Ui3nChipSlots } from './types';
5
6
 
7
+ /*
8
+ * Sizes and colours have their defaults in CSS, not here, so that an
9
+ * application can override them from a stylesheet. A prop, when given,
10
+ * arrives as an inline variable and wins over any of that.
11
+ */
12
+ const DEFAULT_HEIGHT = 24;
13
+ const DEFAULT_TEXT_COLOR = 'var(--color-text-control-primary-default)';
14
+
6
15
  const props = withDefaults(defineProps<Ui3nChipProps>(), {
7
- height: 24,
8
- maxWidth: 200,
9
16
  plain: false,
10
17
  round: true,
11
18
  closeable: false,
12
- color: 'var(--color-bg-control-secondary-default)',
13
- textSize: 10,
14
- textColor: 'var(--color-text-control-primary-default)',
15
19
  });
16
20
 
17
21
  const emits = defineEmits<Ui3nChipEmits>();
@@ -19,38 +23,47 @@
19
23
 
20
24
  const slots = useSlots();
21
25
 
26
+ const hasLeftSlot = computed(() => !!slots.left);
27
+
28
+ /* the icon of the left slot is sized in JS, so it needs a number to work with */
22
29
  const chipHeight = computed(() => {
23
30
  const num = Number(props.height);
24
- return isNaN(num) ? 24 : num;
31
+ return Number.isNaN(num) || !props.height ? DEFAULT_HEIGHT : num;
25
32
  });
26
- const heightCss = computed(() => `${chipHeight.value}px`);
27
33
  const iconSize = computed(() => chipHeight.value - 4);
34
+ const textColor = computed(() => props.textColor ?? DEFAULT_TEXT_COLOR);
28
35
 
29
- const paddingCss = computed(() => {
30
- const padValue = Math.round(chipHeight.value / 3);
31
- return hasLeftSlot.value ? `0 ${padValue}px 0 4px` : `0 ${padValue}px`;
32
- });
36
+ const inlineStyles = computed(() => {
37
+ const styles: Record<string, string> = {};
33
38
 
34
- const maxWidthCss = computed(() => {
35
- const num = Number(props.maxWidth);
36
- return isNaN(num) ? String(props.maxWidth) : `${num}px`;
37
- });
39
+ if (props.height !== undefined) {
40
+ styles['--ui3n-chip-height'] = toCssLength(props.height);
41
+ }
38
42
 
39
- const bgColor = computed(() => props.color);
43
+ if (props.maxWidth !== undefined) {
44
+ styles['--ui3n-chip-max-width'] = toCssLength(props.maxWidth);
45
+ }
40
46
 
41
- const textSize = computed(() => {
42
- const num = Number(props.textSize);
43
- return isNaN(num) ? String(props.textSize) : `${num}px`;
44
- });
47
+ if (props.color) {
48
+ styles['--ui3n-chip-bg-color'] = props.color;
49
+ }
45
50
 
46
- const textColor = computed(() => props.textColor);
51
+ if (props.textSize !== undefined) {
52
+ styles['--ui3n-chip-font-size'] = toCssLength(props.textSize);
53
+ }
47
54
 
48
- const hasLeftSlot = computed(() => !!slots.left);
55
+ if (props.textColor) {
56
+ styles['--ui3n-chip-font-color'] = props.textColor;
57
+ }
58
+
59
+ return styles;
60
+ });
49
61
  </script>
50
62
 
51
63
  <template>
52
64
  <div
53
65
  :id="id"
66
+ data-ui3n="chip"
54
67
  :class="[
55
68
  $style.ui3nChip,
56
69
  round && $style.round,
@@ -58,14 +71,7 @@
58
71
  closeable && $style.closeable,
59
72
  hasLeftSlot && $style.withIcon,
60
73
  ]"
61
- :style="{
62
- '--ui3n-chip-height': heightCss,
63
- '--ui3n-chip-max-width': maxWidthCss,
64
- '--ui3n-chip-padding': paddingCss,
65
- '--ui3n-chip-bg-color': bgColor,
66
- '--ui3n-chip-font-size': textSize,
67
- '--ui3n-chip-font-color': textColor,
68
- }"
74
+ :style="inlineStyles"
69
75
  @click="emits('click', $event)"
70
76
  >
71
77
  <div :class="$style.ui3nChipIcon">
@@ -95,17 +101,27 @@
95
101
 
96
102
  <style lang="scss" module>
97
103
  .ui3nChip {
104
+ --_chip-height: var(--ui3n-chip-height, 24px);
105
+ --_chip-font-color: var(--ui3n-chip-font-color, var(--color-text-control-primary-default));
106
+
107
+ /* the side padding follows the height, as it did when JS computed it */
108
+ --_chip-padding: var(--ui3n-chip-padding, 0 calc(var(--_chip-height) / 3));
109
+
98
110
  position: relative;
99
111
  display: flex;
100
- height: var(--ui3n-chip-height);
101
- padding: var(--ui3n-chip-padding);
112
+ height: var(--_chip-height);
113
+ padding: var(--_chip-padding);
102
114
  width: max-content;
103
- max-width: var(--ui3n-chip-max-width);
104
- background-color: var(--ui3n-chip-bg-color);
115
+ max-width: var(--ui3n-chip-max-width, 200px);
116
+ background-color: var(--ui3n-chip-bg-color, var(--color-bg-control-secondary-default));
105
117
  justify-content: flex-start;
106
118
  align-items: center;
107
119
  column-gap: 4px;
108
120
 
121
+ &.withIcon {
122
+ padding-left: 4px;
123
+ }
124
+
109
125
  &.closeable:not(.withIcon) {
110
126
  .body {
111
127
  max-width: calc(100% - 24px);
@@ -114,22 +130,22 @@
114
130
 
115
131
  &.withIcon:not(.closeable) {
116
132
  .body {
117
- max-width: calc(100% - var(--ui3n-chip-height) - 4px);
133
+ max-width: calc(100% - var(--_chip-height) - 4px);
118
134
  }
119
135
  }
120
136
 
121
137
  &.closable.withIcon {
122
138
  .body {
123
- max-width: calc(100% - var(--ui3n-chip-height) - 28px);
139
+ max-width: calc(100% - var(--_chip-height) - 28px);
124
140
  }
125
141
  }
126
142
  }
127
143
 
128
144
  .ui3nChipBody {
129
- font-size: var(--ui3n-chip-font-size);
145
+ font-size: var(--ui3n-chip-font-size, 10px);
130
146
  line-height: 1;
131
147
  font-weight: 400;
132
- color: var(--ui3n-chip-font-color);
148
+ color: var(--_chip-font-color);
133
149
  overflow: hidden;
134
150
  white-space: nowrap;
135
151
  text-overflow: ellipsis;
@@ -146,7 +162,7 @@
146
162
  }
147
163
 
148
164
  .round {
149
- border-radius: calc(var(--ui3n-chip-height) / 2);
165
+ border-radius: calc(var(--_chip-height) / 2);
150
166
  }
151
167
 
152
168
  .closeable {
@@ -155,6 +171,6 @@
155
171
  }
156
172
 
157
173
  .plain {
158
- border: 1px solid var(--ui3n-chip-font-color);
174
+ border: 1px solid var(--_chip-font-color);
159
175
  }
160
176
  </style>
@@ -28,6 +28,7 @@
28
28
  v-for="dialog in dialogs.dialogStack.value"
29
29
  :id="`dialog-wrapper-${dialog.id}`"
30
30
  :key="dialog.id"
31
+ data-ui3n="dialog-overlay"
31
32
  :class="$style['dialog-provider-overlay']"
32
33
  @click.self.prevent="clickOverlay(dialog.id, dialog.props)"
33
34
  >
@@ -130,6 +130,7 @@
130
130
  <div
131
131
  :id="id"
132
132
  ref="dialog-el"
133
+ data-ui3n="dialog"
133
134
  tabindex="1"
134
135
  :class="[$style.dialog, draggable && isMousedown && $style.draggable, ...cssClass]"
135
136
  :style="cssStyle"
@@ -233,16 +234,16 @@
233
234
  @use '../../assets/styles/mixins' as mixins;
234
235
 
235
236
  .dialog {
236
- --ui3n-dialog-border-radius: 12px;
237
- --ui3n-dialog-title-height: 48px;
238
- --ui3n-dialog-title-padding: 0 32px 0 16px;
239
- --ui3n-dialog-title-font-size: 14px;
240
- --ui3n-dialog-actions-height: 64px;
241
- --ui3n-dialog-actions-padding: 16px;
242
- --ui3n-dialog-confirm-button-color: var(--color-text-button-primary-default);
243
- --ui3n-dialog-cancel-button-color: var(--color-text-button-secondary-default);
244
- --ui3n-dialog-confirm-background-color: var(--color-bg-button-primary-default);
245
- --ui3n-dialog-cancel-background-color: var(--color-bg-button-secondary-default);
237
+ --_dialog-border-radius: var(--ui3n-dialog-border-radius, 12px);
238
+ --_dialog-title-height: var(--ui3n-dialog-title-height, 48px);
239
+ --_dialog-title-padding: var(--ui3n-dialog-title-padding, 0 32px 0 16px);
240
+ --_dialog-title-font-size: var(--ui3n-dialog-title-font-size, 14px);
241
+ --_dialog-actions-height: var(--ui3n-dialog-actions-height, 64px);
242
+ --_dialog-actions-padding: var(--ui3n-dialog-actions-padding, 16px);
243
+ --_dialog-confirm-button-color: var(--ui3n-dialog-confirm-button-color, var(--color-text-button-primary-default));
244
+ --_dialog-cancel-button-color: var(--ui3n-dialog-cancel-button-color, var(--color-text-button-secondary-default));
245
+ --_dialog-confirm-background-color: var(--ui3n-dialog-confirm-background-color, var(--color-bg-button-primary-default));
246
+ --_dialog-cancel-background-color: var(--ui3n-dialog-cancel-background-color, var(--color-bg-button-secondary-default));
246
247
 
247
248
  position: relative;
248
249
  display: flex;
@@ -252,7 +253,7 @@
252
253
  max-height: 95%;
253
254
  background-color: var(--color-bg-block-primary-default);
254
255
  border: 1px solid var(--color-border-block-primary-default);
255
- border-radius: var(--ui3n-dialog-border-radius);
256
+ border-radius: var(--_dialog-border-radius);
256
257
  outline: none;
257
258
  box-shadow:
258
259
  0 5px 15px -3px var(--shadow-key-2),
@@ -273,8 +274,8 @@
273
274
  .title {
274
275
  position: relative;
275
276
  width: 100%;
276
- min-height: var(--ui3n-dialog-title-height);
277
- height: var(--ui3n-dialog-title-height);
277
+ min-height: var(--_dialog-title-height);
278
+ height: var(--_dialog-title-height);
278
279
  }
279
280
 
280
281
  .titleDefault {
@@ -282,14 +283,14 @@
282
283
  justify-content: flex-start;
283
284
  align-items: center;
284
285
  column-gap: 8px;
285
- padding: var(--ui3n-dialog-title-padding);
286
+ padding: var(--_dialog-title-padding);
286
287
  border-bottom: 1px solid var(--color-border-block-primary-default);
287
288
 
288
289
  span {
289
290
  display: block;
290
291
  position: relative;
291
292
  flex-grow: 1;
292
- font-size: var(--ui3n-dialog-title-font-size);
293
+ font-size: var(--_dialog-title-font-size);
293
294
  font-weight: 600;
294
295
  line-height: 1;
295
296
  color: var(--color-text-control-primary-default);
@@ -309,12 +310,12 @@
309
310
  .actions {
310
311
  position: relative;
311
312
  width: 100%;
312
- min-height: var(--ui3n-dialog-actions-height);
313
- height: var(--ui3n-dialog-actions-height);
313
+ min-height: var(--_dialog-actions-height);
314
+ height: var(--_dialog-actions-height);
314
315
  }
315
316
 
316
317
  .actionsDefault {
317
- padding: var(--ui3n-dialog-actions-padding);
318
+ padding: var(--_dialog-actions-padding);
318
319
  display: flex;
319
320
  justify-content: flex-end;
320
321
  align-items: center;
@@ -113,6 +113,7 @@
113
113
  <div
114
114
  ref="wrapperElement"
115
115
  v-ui3n-resize="() => calcElementsSizes()"
116
+ data-ui3n="drop-files"
116
117
  :class="[
117
118
  $style.ui3nDropFiles,
118
119
  permanentDisplay && $style.ui3nDropFilesWithBorder,
@@ -173,15 +174,15 @@
173
174
 
174
175
  <style lang="scss" module>
175
176
  .ui3nDropFiles {
176
- --ui3n-dropzone-height: 0;
177
- --ui3n-dropzone-title-font: 0;
178
- --ui3n-dropzone-border-radius: 4px;
177
+ --_dropzone-height: var(--ui3n-dropzone-height, 0);
178
+ --_dropzone-title-font: var(--ui3n-dropzone-title-font, 0);
179
+ --_dropzone-border-radius: var(--ui3n-dropzone-border-radius, 4px);
179
180
 
180
181
  position: relative;
181
182
  box-sizing: border-box;
182
183
  width: 100%;
183
184
  height: 100%;
184
- border-radius: var(--ui3n-dropzone-border-radius);
185
+ border-radius: var(--_dropzone-border-radius);
185
186
  }
186
187
 
187
188
  .ui3nDropFilesWithBorder {
@@ -206,7 +207,7 @@
206
207
  }
207
208
 
208
209
  .ui3nDropFilesDropzoneTitle {
209
- font-size: var(--ui3n-dropzone-title-font);
210
+ font-size: var(--_dropzone-title-font);
210
211
  font-weight: 500;
211
212
  color: var(--color-text-table-secondary-default);
212
213
  margin: 0;
@@ -215,8 +216,8 @@
215
216
 
216
217
  .ui3nDropFilesDropzoneIcon {
217
218
  position: relative;
218
- width: calc(var(--ui3n-dropzone-height) * 0.4);
219
- height: calc(var(--ui3n-dropzone-height) * 0.4);
219
+ width: calc(var(--_dropzone-height) * 0.4);
220
+ height: calc(var(--_dropzone-height) * 0.4);
220
221
  border-radius: 50%;
221
222
  background-color: var(--color-bg-button-tritery-default);
222
223
  display: flex;
@@ -22,6 +22,7 @@
22
22
  <template>
23
23
  <span
24
24
  ref="el"
25
+ data-ui3n="content-editable"
25
26
  :class="[
26
27
  $style.ui3nContentEditable,
27
28
  !modelValue && !!placeholder && $style.placeholder,
@@ -40,29 +41,29 @@
40
41
 
41
42
  <style lang="scss" module>
42
43
  .ui3nContentEditable {
43
- --ui3n-content-editable-color: var(--color-text-control-primary-default);
44
- --ui3n-content-editable-placeholder-color: var(--color-text-control-secondary-default);
45
- --ui3n-content-editable-border-color-focused: var(--color-border-table-accent-default);
44
+ --_content-editable-color: var(--ui3n-content-editable-color, var(--color-text-control-primary-default));
45
+ --_content-editable-placeholder-color: var(--ui3n-content-editable-placeholder-color, var(--color-text-control-secondary-default));
46
+ --_content-editable-border-color-focused: var(--ui3n-content-editable-border-color-focused, var(--color-border-table-accent-default));
46
47
 
47
48
  position: relative;
48
49
  display: inline-block;
49
50
  width: fit-content;
50
- font-size: var(--font-12);
51
+ font-size: var(--ui3n-content-editable-font-size, 12px);
51
52
  font-weight: 400;
52
- line-height: var(--font-16);
53
+ line-height: var(--ui3n-content-editable-line-height, 16px);
53
54
  overflow-wrap: break-word;
54
- color: var(--ui3n-content-editable-color);
55
- padding: var(--spacing-xs) var(--spacing-s);
55
+ color: var(--_content-editable-color);
56
+ padding: var(--ui3n-content-editable-padding, 4px 8px);
56
57
  background-color: transparent;
57
- border-radius: var(--spacing-xs);
58
+ border-radius: var(--ui3n-content-editable-border-radius, 4px);
58
59
  }
59
60
 
60
61
  .placeholder {
61
- color: var(--ui3n-content-editable-placeholder-color);
62
+ color: var(--_content-editable-placeholder-color);
62
63
  }
63
64
 
64
65
  .isFocused {
65
- border: 1px solid var(--ui3n-content-editable-border-color-focused);
66
+ border: 1px solid var(--_content-editable-border-color-focused);
66
67
  }
67
68
 
68
69
  .isDisabled {
@@ -168,6 +168,7 @@
168
168
  <div
169
169
  :id="id"
170
170
  v-ui3n-click-outside="onClickOutside"
171
+ data-ui3n="editable"
171
172
  :class="[
172
173
  $style.ui3nEditable,
173
174
  disabled && $style.ui3nEditableDisabled,
@@ -257,25 +258,25 @@
257
258
  @use '../../assets/styles/mixins' as mixins;
258
259
 
259
260
  .ui3nEditable {
260
- --ui3n-editable-min-width: 60px;
261
- --ui3n-editable-max-width: 100%;
262
- --ui3n-editable-height: 24px;
263
- --ui3n-editable-font-size: 12px;
264
- --ui3n-editable-border-radius: 4px;
261
+ --_editable-min-width: var(--ui3n-editable-min-width, 60px);
262
+ --_editable-max-width: var(--ui3n-editable-max-width, 100%);
263
+ --_editable-height: var(--ui3n-editable-height, 24px);
264
+ --_editable-font-size: var(--ui3n-editable-font-size, 12px);
265
+ --_editable-border-radius: var(--ui3n-editable-border-radius, 4px);
265
266
  //--ui3n-editable-padding-base: 4px;
266
267
  //--ui3n-editable-padding: 0 4px;
267
268
  //--ui3n-editable-padding: 4px 44px 4px 4px;
268
- --ui3n-editable-button-size: 16px;
269
+ --_editable-button-size: var(--ui3n-editable-button-size, 16px);
269
270
 
270
271
  position: relative;
271
272
  box-sizing: border-box;
272
273
  width: max-content;
273
- max-width: var(--ui3n-editable-max-width);
274
- height: var(--ui3n-editable-height);
275
- border-radius: var(--ui3n-editable-border-radius);
276
- font-size: var(--ui3n-editable-font-size);
274
+ max-width: var(--_editable-max-width);
275
+ height: var(--_editable-height);
276
+ border-radius: var(--_editable-border-radius);
277
+ font-size: var(--_editable-font-size);
277
278
  font-weight: 400;
278
- line-height: var(--ui3n-editable-height);
279
+ line-height: var(--_editable-height);
279
280
  color: var(--color-text-table-primary-default);
280
281
  overflow: hidden;
281
282
  border: 1px solid transparent;
@@ -301,11 +302,11 @@
301
302
  .content {
302
303
  position: relative;
303
304
  box-sizing: border-box;
304
- height: var(--ui3n-editable-height);
305
- min-width: var(--ui3n-editable-min-width);
306
- max-width: var(--ui3n-editable-max-width);
305
+ height: var(--_editable-height);
306
+ min-width: var(--_editable-min-width);
307
+ max-width: var(--_editable-max-width);
307
308
  padding: 0 24px 0 4px;
308
- border-radius: var(--ui3n-editable-border-radius);
309
+ border-radius: var(--_editable-border-radius);
309
310
  display: flex;
310
311
  justify-content: flex-start;
311
312
  align-items: center;
@@ -335,14 +336,14 @@
335
336
  position: relative;
336
337
  height: 100%;
337
338
  box-sizing: border-box;
338
- min-width: var(--ui3n-editable-min-width);
339
+ min-width: var(--_editable-min-width);
339
340
  max-width: 100%;
340
341
  padding: 0 44px 0 4px;
341
342
  font-family: inherit;
342
- font-size: var(--ui3n-editable-font-size);
343
+ font-size: var(--_editable-font-size);
343
344
  font-weight: 400;
344
- line-height: var(--ui3n-editable-height);
345
- border-radius: var(--ui3n-editable-border-radius);
345
+ line-height: var(--_editable-height);
346
+ border-radius: var(--_editable-border-radius);
346
347
  background-color: transparent;
347
348
  border: none;
348
349
 
@@ -360,18 +361,18 @@
360
361
  visibility: hidden;
361
362
  padding: 0;
362
363
  font-family: inherit;
363
- font-size: var(--ui3n-editable-font-size);
364
+ font-size: var(--_editable-font-size);
364
365
  font-weight: 400;
365
- line-height: var(--ui3n-editable-height);
366
+ line-height: var(--_editable-height);
366
367
  white-space: pre;
367
368
  }
368
369
 
369
370
  .btn {
370
371
  position: absolute;
371
- width: var(--ui3n-editable-button-size);
372
- min-width: var(--ui3n-editable-button-size);
373
- height: var(--ui3n-editable-button-size);
374
- min-height: var(--ui3n-editable-button-size);
372
+ width: var(--_editable-button-size);
373
+ min-width: var(--_editable-button-size);
374
+ height: var(--_editable-button-size);
375
+ min-height: var(--_editable-button-size);
375
376
  border-radius: 50%;
376
377
  background-color: transparent;
377
378
  cursor: pointer;
@@ -41,6 +41,7 @@
41
41
  <template>
42
42
  <div
43
43
  ref="emojiElement"
44
+ data-ui3n="emoji"
44
45
  :class="[$style.ui3nEmoji, readonly && $style.readonly]"
45
46
  :style="inlineStyles"
46
47
  v-on="readonly ? {} : { click: onClick }"
@@ -51,14 +52,14 @@
51
52
 
52
53
  <style lang="scss" module>
53
54
  .ui3nEmoji {
54
- --ui3n-emoji-size: 16px;
55
+ --_emoji-size: var(--ui3n-emoji-size, 16px);
55
56
 
56
57
  display: flex;
57
- min-width: var(--ui3n-emoji-size);
58
- width: var(--ui3n-emoji-size);
59
- min-height: var(--ui3n-emoji-size);
60
- height: var(--ui3n-emoji-size);
61
- font-size: var(--ui3n-emoji-size);
58
+ min-width: var(--_emoji-size);
59
+ width: var(--_emoji-size);
60
+ min-height: var(--_emoji-size);
61
+ height: var(--_emoji-size);
62
+ font-size: var(--_emoji-size);
62
63
  justify-content: center;
63
64
  align-items: center;
64
65
  cursor: pointer;
@@ -2,22 +2,30 @@
2
2
  import { computed } from 'vue';
3
3
  import type { Ui3nIconEmits, Ui3nIconProps } from './types';
4
4
 
5
+ /* sizes and colour keep their defaults in CSS, so a stylesheet can change them */
5
6
  const props = withDefaults(defineProps<Ui3nIconProps>(), {
6
7
  title: '',
7
8
  rotate: 0,
8
- color: 'var(--color-icon-control-primary-default)',
9
9
  });
10
10
  const emits = defineEmits<Ui3nIconEmits>();
11
11
 
12
- const rawWidth = computed(() => props.size || props.width || 16);
13
- const rawHeight = computed(() => props.size || props.height || 16);
12
+ const rawWidth = computed(() => props.size || props.width);
13
+ const rawHeight = computed(() => props.size || props.height);
14
14
 
15
15
  const iconStyle = computed(() => {
16
- const value: Record<string, string> = {
17
- '--ui3n-icon-width': formatUnit(rawWidth.value),
18
- '--ui3n-icon-height': formatUnit(rawHeight.value),
19
- '--ui3n-icon-color': props.color,
20
- };
16
+ const value: Record<string, string> = {};
17
+
18
+ if (rawWidth.value !== undefined) {
19
+ value['--ui3n-icon-width'] = formatUnit(rawWidth.value);
20
+ }
21
+
22
+ if (rawHeight.value !== undefined) {
23
+ value['--ui3n-icon-height'] = formatUnit(rawHeight.value);
24
+ }
25
+
26
+ if (props.color) {
27
+ value['--ui3n-icon-color'] = props.color;
28
+ }
21
29
 
22
30
  const transformData = [];
23
31
  props.horizontalFlip && transformData.push('rotateY(180deg)');
@@ -40,6 +48,7 @@
40
48
  <template>
41
49
  <div
42
50
  :id="id"
51
+ data-ui3n="icon"
43
52
  :class="$style.ui3nIcon"
44
53
  :title="title"
45
54
  :style="iconStyle"
@@ -50,19 +59,20 @@
50
59
 
51
60
  <style lang="scss" module>
52
61
  .ui3nIcon {
62
+ --_icon-width: var(--ui3n-icon-width, 16px);
63
+ --_icon-height: var(--ui3n-icon-height, 16px);
64
+
53
65
  display: inline-block;
54
66
  vertical-align: middle;
55
- min-width: var(--ui3n-icon-width);
56
- width: var(--ui3n-icon-width);
57
-
58
- min-height: var(--ui3n-icon-height);
59
- height: var(--ui3n-icon-height);
60
- max-height: var(--ui3n-icon-height);
61
-
67
+ min-width: var(--_icon-width);
68
+ width: var(--_icon-width);
69
+ min-height: var(--_icon-height);
70
+ height: var(--_icon-height);
71
+ max-height: var(--_icon-height);
62
72
  flex-grow: 0;
63
73
  flex-shrink: 0;
64
74
  background-color: currentcolor;
65
- color: var(--ui3n-icon-color);
75
+ color: var(--ui3n-icon-color, var(--color-icon-control-primary-default));
66
76
  mask-image: var(--svg);
67
77
  mask-repeat: no-repeat;
68
78
  mask-size: 100% 100%;