@dolanske/vui 0.4.0 → 1.0.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 (155) hide show
  1. package/README.md +6 -13
  2. package/dist/components/Alert/Alert.vue.d.ts +7 -1
  3. package/dist/components/Avatar/Avatar.vue.d.ts +15 -1
  4. package/dist/components/Badge/Badge.vue.d.ts +1 -1
  5. package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +1 -1
  6. package/dist/components/Button/Button.vue.d.ts +5 -15
  7. package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +2 -0
  8. package/dist/components/Calendar/Calendar.vue.d.ts +1 -1
  9. package/dist/components/Checkbox/Checkbox.vue.d.ts +1 -0
  10. package/dist/components/Dropdown/Dropdown.vue.d.ts +19 -4
  11. package/dist/components/Dropdown/DropdownTitle.vue.d.ts +5 -1
  12. package/dist/components/Flex/Flex.vue.d.ts +3 -1
  13. package/dist/components/Grid/Grid.vue.d.ts +7 -2
  14. package/dist/components/Input/Dropzone.vue.d.ts +1 -1
  15. package/dist/components/Input/Input.vue.d.ts +2 -2
  16. package/dist/components/Kbd/KbdGroup.vue.d.ts +3 -11
  17. package/dist/components/Modal/Confirm.vue.d.ts +1 -1
  18. package/dist/components/Modal/Modal.vue.d.ts +1 -1
  19. package/dist/components/Pagination/Pagination.vue.d.ts +3 -0
  20. package/dist/components/Popout/Popout.vue.d.ts +8 -1
  21. package/dist/components/Progress/Progress.vue.d.ts +2 -0
  22. package/dist/components/Radio/Radio.vue.d.ts +1 -0
  23. package/dist/components/Select/Select.vue.d.ts +2 -0
  24. package/dist/components/Sheet/Sheet.vue.d.ts +3 -0
  25. package/dist/components/Switch/Switch.vue.d.ts +1 -0
  26. package/dist/components/Table/index.d.ts +6 -0
  27. package/dist/components/Table/table.d.ts +1 -1
  28. package/dist/components/Tabs/Tab.vue.d.ts +16 -3
  29. package/dist/components/Tabs/Tabs.vue.d.ts +4 -0
  30. package/dist/components/Toast/toast.d.ts +245 -0
  31. package/dist/index.d.ts +2 -7
  32. package/dist/shared/helpers.d.ts +9 -0
  33. package/dist/shared/theme.d.ts +3 -0
  34. package/dist/style.css +1 -1
  35. package/dist/vui.js +6423 -6046
  36. package/package.json +8 -4
  37. package/src/App.vue +89 -192
  38. package/src/components/Accordion/accordion.scss +2 -0
  39. package/src/components/Alert/Alert.vue +11 -5
  40. package/src/components/Alert/alert.scss +104 -23
  41. package/src/components/Avatar/Avatar.vue +4 -1
  42. package/src/components/Avatar/avatar.scss +1 -1
  43. package/src/components/Badge/Badge.vue +1 -1
  44. package/src/components/Badge/badge.scss +134 -17
  45. package/src/components/Breadcrumbs/BreadcrumbItem.vue +2 -2
  46. package/src/components/Breadcrumbs/Breadcrumbs.vue +1 -2
  47. package/src/components/Breadcrumbs/breadcrumbs.scss +2 -1
  48. package/src/components/Button/Button.vue +16 -21
  49. package/src/components/Button/button.scss +159 -56
  50. package/src/components/ButtonGroup/ButtonGroup.vue +4 -1
  51. package/src/components/ButtonGroup/button-group.scss +2 -2
  52. package/src/components/Calendar/Calendar.vue +9 -3
  53. package/src/components/Calendar/calendar.scss +29 -2
  54. package/src/components/Card/Card.vue +2 -2
  55. package/src/components/Card/card.scss +4 -4
  56. package/src/components/Checkbox/Checkbox.vue +7 -5
  57. package/src/components/Checkbox/checkbox.scss +27 -13
  58. package/src/components/CopyClipboard/CopyClipboard.vue +15 -6
  59. package/src/components/CopyClipboard/copy-clipboard.scss +10 -2
  60. package/src/components/Drawer/Drawer.vue +4 -4
  61. package/src/components/Drawer/drawer.scss +1 -0
  62. package/src/components/Dropdown/Dropdown.vue +44 -20
  63. package/src/components/Dropdown/DropdownItem.vue +5 -4
  64. package/src/components/Dropdown/DropdownTitle.vue +7 -1
  65. package/src/components/Dropdown/dropdown-item.scss +84 -0
  66. package/src/components/Dropdown/dropdown.scss +21 -86
  67. package/src/components/Flex/Flex.vue +4 -1
  68. package/src/components/Grid/Grid.vue +25 -2
  69. package/src/components/Input/Color.vue +26 -0
  70. package/src/components/Input/Counter.vue +12 -16
  71. package/src/components/Input/Dropzone.vue +1 -1
  72. package/src/components/Input/File.vue +1 -1
  73. package/src/components/Input/Input.vue +8 -6
  74. package/src/components/Input/Password.vue +1 -13
  75. package/src/components/Input/Textarea.vue +4 -2
  76. package/src/components/Input/input.scss +113 -19
  77. package/src/components/Kbd/KbdGroup.vue +2 -6
  78. package/src/components/Kbd/kbd.scss +7 -6
  79. package/src/components/Modal/Confirm.vue +1 -1
  80. package/src/components/Modal/Modal.vue +23 -15
  81. package/src/components/Modal/modal.scss +11 -6
  82. package/src/components/OTP/otp.scss +8 -7
  83. package/src/components/Pagination/Pagination.vue +6 -3
  84. package/src/components/Popout/Popout.vue +15 -5
  85. package/src/components/Popout/popout.scss +8 -1
  86. package/src/components/Progress/Progress.vue +18 -5
  87. package/src/components/Progress/progress.scss +7 -1
  88. package/src/components/Radio/Radio.vue +4 -2
  89. package/src/components/Radio/radio.scss +28 -9
  90. package/src/components/Select/Select.vue +49 -18
  91. package/src/components/Select/select.scss +35 -2
  92. package/src/components/Sheet/Sheet.vue +8 -2
  93. package/src/components/Sheet/sheet.scss +9 -0
  94. package/src/components/Sidebar/Sidebar.vue +46 -16
  95. package/src/components/Sidebar/sidebar.scss +6 -5
  96. package/src/components/Spinner/spinner.scss +2 -1
  97. package/src/components/Switch/Switch.vue +4 -3
  98. package/src/components/Switch/switch.scss +48 -7
  99. package/src/components/Table/{Header.vue → Head.vue} +5 -5
  100. package/src/components/Table/{Table.vue → Root.vue} +2 -2
  101. package/src/components/Table/SelectRow.vue +2 -1
  102. package/src/components/Table/index.ts +7 -0
  103. package/src/components/Table/table.scss +25 -5
  104. package/src/components/Table/table.ts +7 -3
  105. package/src/components/Tabs/Tab.vue +7 -9
  106. package/src/components/Tabs/Tabs.vue +9 -2
  107. package/src/components/Tabs/tabs.scss +11 -3
  108. package/src/components/Toast/Toasts.vue +5 -0
  109. package/src/components/Toast/toast.scss +6 -2
  110. package/src/components/Toast/toast.ts +7 -0
  111. package/src/components/Tooltip/Tooltip.vue +9 -9
  112. package/src/components/Tooltip/tooltip.scss +4 -0
  113. package/src/examples/ExampleAccordions.vue +58 -0
  114. package/src/examples/ExampleAlerts.vue +78 -0
  115. package/src/examples/ExampleAvatars.vue +44 -0
  116. package/src/examples/ExampleBadges.vue +48 -0
  117. package/src/examples/ExampleBreadcrumbs.vue +46 -0
  118. package/src/examples/ExampleButtons.vue +140 -0
  119. package/src/examples/ExampleCalendars.vue +40 -0
  120. package/src/examples/ExampleCards.vue +94 -0
  121. package/src/examples/ExampleCheckboxes.vue +123 -0
  122. package/src/examples/ExampleCopyClipboard.vue +47 -0
  123. package/src/examples/ExampleDividers.vue +39 -0
  124. package/src/examples/ExampleDrawers.vue +67 -0
  125. package/src/examples/ExampleDropdowns.vue +114 -0
  126. package/src/examples/ExampleFlexGrid.vue +122 -0
  127. package/src/examples/ExampleInputs.vue +234 -0
  128. package/src/examples/ExampleKBD.vue +65 -0
  129. package/src/examples/ExampleModals.vue +143 -0
  130. package/src/examples/ExamplePalette.vue +159 -0
  131. package/src/examples/ExamplePopouts.vue +41 -0
  132. package/src/examples/ExampleSheets.vue +77 -0
  133. package/src/examples/ExampleSidebars.vue +270 -0
  134. package/src/examples/ExampleSkeletons.vue +26 -0
  135. package/src/examples/ExampleSpinners.vue +78 -0
  136. package/src/examples/ExampleTables.vue +195 -0
  137. package/src/examples/ExampleTabs.vue +119 -0
  138. package/src/examples/ExampleToasts.vue +96 -0
  139. package/src/examples/ExampleTooltips.vue +70 -0
  140. package/src/examples/shared/ExampleColor.vue +28 -0
  141. package/src/index.ts +4 -11
  142. package/src/internal/Backdrop/backdrop.scss +7 -1
  143. package/src/shared/helpers.ts +43 -0
  144. package/src/shared/theme.ts +22 -0
  145. package/src/style/animation.scss +1 -0
  146. package/src/style/core.scss +34 -57
  147. package/src/style/layout.scss +102 -5
  148. package/src/style/{fonts.scss → text.scss} +39 -0
  149. package/src/style/theme.scss +195 -0
  150. package/src/style/tooltip.scss +22 -4
  151. package/src/style/typography.scss +95 -18
  152. package/dist/components/Table/Row.vue.d.ts +0 -16
  153. package/src/components/Table/Row.vue +0 -9
  154. /package/dist/components/Table/{Header.vue.d.ts → Head.vue.d.ts} +0 -0
  155. /package/dist/components/Table/{Table.vue.d.ts → Root.vue.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  .vui-dropdown-trigger-wrap {
2
- // display: inline-block;
3
- width: fit-content;
2
+ // width: fit-content;
3
+ position: relative;
4
4
  }
5
5
 
6
6
  .vui-dropdown {
@@ -8,85 +8,7 @@
8
8
  border-radius: var(--border-radius-m);
9
9
  border: 1px solid var(--color-border);
10
10
  padding: 4px;
11
- }
12
-
13
- .vui-dropdown-item {
14
- display: flex;
15
- align-items: center;
16
- justify-content: flex-start;
17
- width: fit-content;
18
- gap: var(--space-xs);
19
- width: 100%;
20
- // TODO: make button-height variable global and use it here and everywhere else
21
- height: 34px;
22
- border-radius: var(--border-radius-m);
23
- font-size: var(--font-size-s);
24
- cursor: default;
25
- transition: var(--transition);
26
- padding-inline: var(--space-s);
27
- white-space: nowrap;
28
- margin-bottom: 4px;
29
-
30
- &:last-child {
31
- margin-bottom: 0;
32
- }
33
-
34
- &.disabled {
35
- pointer-events: none;
36
-
37
- &:hover {
38
- background-color: transparent;
39
- }
40
-
41
- .vui-dropdown-item-slot,
42
- .vui-dropdown-item-icon svg path {
43
- color: var(--color-text-lighter);
44
- }
45
-
46
- .vui-dropdown-item-hint {
47
- visibility: hidden;
48
- opacity: 0;
49
- z-index: -1;
50
- }
51
- }
52
-
53
- .vui-dropdown-item-icon {
54
- width: 16px;
55
- height: 16px;
56
- display: flex;
57
- align-items: center;
58
- justify-content: center;
59
-
60
- svg {
61
- width: 16px;
62
- height: 16px;
63
-
64
- path {
65
- color: var(--color-text-light);
66
- }
67
- }
68
- }
69
-
70
- .vui-dropdown-item-hint {
71
- margin-left: 8px;
72
- font-size: 0.9rem;
73
- // white-space: nowrap;
74
- color: var(--color-text-lighter);
75
- }
76
-
77
- .vui-dropdown-item-slot {
78
- flex: 1;
79
- display: flex;
80
- align-items: center;
81
- justify-content: flex-start;
82
- color: var(--color-text);
83
- flex-wrap: nowrap;
84
- }
85
-
86
- &.selected,
87
- &:hover {
88
- background-color: var(--color-button-gray-hover);
89
- }
11
+ overflow-y: auto;
90
12
  }
91
13
 
92
14
  .vui-dropdown-title {
@@ -94,19 +16,26 @@
94
16
  display: flex;
95
17
  align-items: center;
96
18
  justify-content: flex-start;
97
- padding-block: var(--space-s);
98
- padding-inline: calc(var(--space-s) + 4px);
99
- font-size: var(--font-size-ms);
19
+ padding-block: var(--space-xs);
20
+ padding-inline: calc(var(--space-xs) + 8px);
21
+ font-size: var(--font-size-m);
100
22
  border-bottom: 1px solid var(--color-border);
101
- font-weight: 500;
102
- // margin-block: 4px;
23
+ font-weight: var(--font-weight-semibold);
103
24
  margin-inline: -4px;
104
25
  margin-top: -4px;
105
26
  margin-bottom: 4px;
106
27
  gap: var(--space-m);
107
28
  justify-content: space-between;
29
+ background-color: var(--color-bg-medium);
30
+ z-index: 50;
31
+
32
+ &.sticky {
33
+ position: sticky;
34
+ top: -4px;
35
+ }
108
36
 
109
37
  &:not(:first-child) {
38
+ margin-top: 4px;
110
39
  border-top: 1px solid var(--color-border);
111
40
  }
112
41
 
@@ -116,3 +45,9 @@
116
45
  color: var(--color-text-lighter);
117
46
  }
118
47
  }
48
+
49
+ :root.light {
50
+ .vui-dropdown-title {
51
+ background-color: var(--color-bg);
52
+ }
53
+ }
@@ -32,7 +32,10 @@ export interface FlexProps {
32
32
  expand?: boolean
33
33
  }
34
34
 
35
- const props = defineProps<FlexProps>()
35
+ const props = withDefaults(defineProps<FlexProps>(), {
36
+ // eslint-disable-next-line vue/require-valid-default-prop
37
+ gap: 's',
38
+ })
36
39
 
37
40
  // Flex gap
38
41
  const ag = computed(() => typeof props.gap === 'number'
@@ -12,10 +12,19 @@ interface Props {
12
12
  gap?: Space | number
13
13
  rows?: number | string
14
14
  columns?: number | string
15
- areas?: string[]
15
+ // areas?: string[]
16
+
17
+ // NOTE: Add more if needed
18
+ alignCenter?: boolean
19
+ alignStart?: boolean
20
+ alignEnd?: boolean
21
+ alignBaseline?: boolean
16
22
  }
17
23
 
18
- const props = defineProps<Props>()
24
+ const props = withDefaults(defineProps<Props>(), {
25
+ // eslint-disable-next-line vue/require-valid-default-prop
26
+ gap: 's',
27
+ })
19
28
 
20
29
  const ag = computed(() => typeof props.gap === 'number'
21
30
  ? formatUnitValue(props.gap)
@@ -40,6 +49,18 @@ const aTR = computed(() => {
40
49
  return props.rows ?? 'none'
41
50
  })
42
51
 
52
+ const aA = computed(() => {
53
+ if (props.alignStart)
54
+ return 'flex-start'
55
+ else if (props.alignEnd)
56
+ return 'flex-end'
57
+ else if (props.alignCenter)
58
+ return 'center'
59
+ else if (props.alignBaseline)
60
+ return 'baseline'
61
+ return 'flex-start'
62
+ })
63
+
43
64
  const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
44
65
  </script>
45
66
 
@@ -50,6 +71,8 @@ const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
50
71
  gap: ag,
51
72
  gridTemplateColumns: aTC,
52
73
  gridTemplateRows: aTR,
74
+ alignItems: aA,
75
+
53
76
  }"
54
77
  >
55
78
  <slot />
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ import type { InputProps } from './Input.vue'
3
+ import { Icon } from '@iconify/vue'
4
+ import { useAttrs, useId } from 'vue'
5
+ import Input from './Input.vue'
6
+
7
+ const props = defineProps<InputProps>()
8
+
9
+ const attrs = useAttrs()
10
+ const color = defineModel<string>()
11
+ const id = useId()
12
+ </script>
13
+
14
+ <template>
15
+ <Input v-bind="{ ...attrs, ...props }" type="color" class="vui-input-color">
16
+ <template #__internal_replace_input>
17
+ <input :id v-model="color" type="color" tabindex="0">
18
+ <label :for="id">
19
+ <div class="vui-input-color-indicator" :style="{ backgroundColor: color }">
20
+ <Icon v-if="!color" icon="ph:palette" />
21
+ </div>
22
+ <input v-model="color" type="text" :placeholder="props.placeholder">
23
+ </label>
24
+ </template>
25
+ </Input>
26
+ </template>
@@ -2,6 +2,7 @@
2
2
  import type { InputProps } from './Input.vue'
3
3
  import { Icon } from '@iconify/vue'
4
4
  import Button from '../Button/Button.vue'
5
+ import ButtonGroup from '../ButtonGroup/ButtonGroup.vue'
5
6
  import Input from './Input.vue'
6
7
 
7
8
  type Props = Omit<InputProps, 'type'> & {
@@ -30,33 +31,28 @@ const count = defineModel<number>({
30
31
 
31
32
  <template>
32
33
  <Input v-bind="inputProps" v-model.number="count" type="number">
33
- <template v-if="!hideDecrement" #start>
34
- <Button key="decrease" :disabled="!decrementEnabled" size="s" @click="count -= decrementBy">
35
- <Icon icon="ph:minus" /> {{ decrementBy > 1 ? decrementBy : '' }}
36
- </Button>
37
- </template>
34
+ <!-- <template v-if="!hideDecrement" #start>
35
+ </template> -->
38
36
 
39
- <template v-if="!hideIncrement" #end>
40
- <Button key="increase" :disabled="!incrementEnabled" size="s" @click="count += incrementBy">
41
- <Icon icon="ph:plus" /> {{ incrementBy > 1 ? incrementBy : '' }}
42
- </Button>
37
+ <template #end>
38
+ <ButtonGroup>
39
+ <Button v-if="!hideDecrement" key="decrease" :disabled="!decrementEnabled" :style="{ 'border-top-left-radius': 0, 'border-bottom-left-radius': 0 }" @click="count -= decrementBy">
40
+ <Icon icon="ph:minus" /> {{ decrementBy > 1 ? decrementBy : '' }}
41
+ </Button>
42
+ <Button v-if="!hideIncrement" key="increase" :disabled="!incrementEnabled" @click="count += incrementBy">
43
+ <Icon icon="ph:plus" /> {{ incrementBy > 1 ? incrementBy : '' }}
44
+ </Button>
45
+ </ButtonGroup>
43
46
  </template>
44
47
  </Input>
45
48
  </template>
46
49
 
47
50
  <style scoped lang="scss">
48
- :deep(.vui-input-style) {
49
- padding-inline: 4px !important;
50
- gap: 8px !important;
51
- }
52
-
53
51
  :deep(.vui-button) {
54
52
  padding-inline: 2px !important;
55
53
  }
56
54
 
57
55
  :deep(input) {
58
- text-align: center;
59
-
60
56
  ::-webkit-outer-spin-button,
61
57
  ::-webkit-inner-spin-button {
62
58
  -webkit-appearance: none;
@@ -48,7 +48,7 @@ onMounted(() => {
48
48
  <input :id="inputId" type="file">
49
49
  <label :for="inputId">
50
50
  <slot :dragging>
51
- <Flex justify-center gap="s" align-baseline>
51
+ <Flex justify-center gap="xs" align-center>
52
52
  <template v-if="dragging">
53
53
  <Icon icon="ph:target" />
54
54
  Drop it
@@ -9,7 +9,7 @@ const emits = defineEmits<{ files: [FileList] }>()
9
9
  <template>
10
10
  <Input
11
11
  type="file"
12
- v-bind="{ ...props }"
12
+ v-bind="props"
13
13
  @input="emits('files', $event.target.files)"
14
14
  />
15
15
  </template>
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { computed, type InputTypeHTMLAttribute, useId, useTemplateRef, watchEffect } from 'vue'
2
+ import { computed, useId, useTemplateRef, watchEffect } from 'vue'
3
3
  import { getMaybeRefLength } from '../../shared/helpers'
4
4
  import Flex from '../Flex/Flex.vue'
5
5
  import '../../style/core.scss'
@@ -7,8 +7,10 @@ import './input.scss'
7
7
 
8
8
  // FIXME: sometimes spamming inputs when limit is set, it will _just_ let me write one more letter
9
9
 
10
+ export type InputType = 'text' | 'password' | 'color' | 'date' | 'email' | 'number' | 'range' | 'search' | 'tel' | 'time' | 'url' | 'file'
11
+
10
12
  export interface InputProps {
11
- type?: InputTypeHTMLAttribute
13
+ type?: InputType
12
14
  label?: string
13
15
  hint?: string
14
16
  limit?: number | string
@@ -63,12 +65,12 @@ const inputRef = useTemplateRef('input')
63
65
 
64
66
  watchEffect(() => {
65
67
  if (focus)
66
- inputRef.value?.focus()
68
+ inputRef.value?.focus({ preventScroll: true })
67
69
  })
68
70
 
69
71
  defineExpose({
70
72
  focus: () => {
71
- inputRef.value?.focus()
73
+ inputRef.value?.focus({ preventScroll: true })
72
74
  },
73
75
  })
74
76
 
@@ -81,11 +83,11 @@ const renderLimit = computed(() => {
81
83
  <div class="vui-input-container" :class="{ expand, disabled, required, readonly, 'has-errors': errors.length > 0 }">
82
84
  <slot name="before" />
83
85
  <div class="vui-input">
84
- <label v-if="label" for="id">{{ label }}</label>
86
+ <label v-if="label" :for="id">{{ label }}</label>
85
87
  <p v-if="hint" class="vui-input-hint">
86
88
  {{ hint }}
87
89
  </p>
88
- <Flex class="vui-input-style" :gap="3" align-center>
90
+ <Flex class="vui-input-style" :gap="5" align-center>
89
91
  <slot name="start" />
90
92
  <slot name="__internal_replace_input" :input-id="id" />
91
93
  <input
@@ -25,8 +25,7 @@ const show = ref(showPassword)
25
25
  <template #end>
26
26
  <Button
27
27
  square
28
- size="s"
29
- :data-title-top="show ? 'Hide password' : 'Show password'"
28
+ :data-title-top="show ? 'Hide' : 'Reveal'"
30
29
  @click="show = !show"
31
30
  >
32
31
  <Icon :width="18" :height="18" :icon="show ? 'ph:eye-slash' : 'ph:eye'" />
@@ -34,14 +33,3 @@ const show = ref(showPassword)
34
33
  </template>
35
34
  </Input>
36
35
  </template>
37
-
38
- <style scoped lang="scss">
39
- :deep(.vui-input-style) {
40
- padding-right: 4px !important;
41
- gap: 8px !important;
42
- }
43
-
44
- [data-title-top]:before {
45
- min-width: 104px;
46
- }
47
- </style>
@@ -20,6 +20,7 @@ const {
20
20
  resize = 'vertical',
21
21
  autoResize,
22
22
  errors = [] as string[],
23
+ disabled,
23
24
  } = defineProps<Props>()
24
25
 
25
26
  const model = defineModel<string>({
@@ -41,10 +42,10 @@ const fS = computed(() => autoResize ? 'content' : 'auto')
41
42
  </script>
42
43
 
43
44
  <template>
44
- <div class="vui-input-container" :class="{ expand, required, readonly, 'has-errors': errors.length > 0 }">
45
+ <div class="vui-input-container" :class="{ expand, required, readonly, 'has-errors': errors.length > 0, disabled }">
45
46
  <slot name="before" />
46
47
  <div class="vui-input">
47
- <label v-if="label" for="id">{{ label }}</label>
48
+ <label v-if="label" :for="id">{{ label }}</label>
48
49
  <p v-if="hint" class="vui-input-hint">
49
50
  {{ hint }}
50
51
  </p>
@@ -55,6 +56,7 @@ const fS = computed(() => autoResize ? 'content' : 'auto')
55
56
  name="id"
56
57
  :placeholder
57
58
  :required
59
+ :disabled
58
60
  :max="limit"
59
61
  :style="{
60
62
  resize: r,
@@ -9,7 +9,7 @@
9
9
  --input-color-border-strong: var(--color-border-strong);
10
10
  --input-color-border-weak: var(--color-border-weak);
11
11
 
12
- --input-height: 34px;
12
+ --input-height: var(--interactive-el-height);
13
13
  --input-padding: 8px;
14
14
  --textarea-padding: 8px;
15
15
 
@@ -17,9 +17,16 @@
17
17
 
18
18
  width: 224px;
19
19
 
20
- &.disabled input,
21
- &.disabled textarea {
22
- cursor: not-allowed;
20
+ &.disabled {
21
+ .vui-input label {
22
+ color: var(--input-color-text-lighter);
23
+ }
24
+
25
+ input,
26
+ textarea {
27
+ cursor: not-allowed;
28
+ resize: none !important;
29
+ }
23
30
  }
24
31
 
25
32
  &.expand {
@@ -28,7 +35,9 @@
28
35
 
29
36
  &.required .vui-input > label:after {
30
37
  content: '*';
38
+ padding-left: 2px;
31
39
  color: var(--input-color-text-red);
40
+ font-size: var(--font-size-l);
32
41
  }
33
42
 
34
43
  &.readonly .vui-input {
@@ -38,6 +47,7 @@
38
47
  pointer-events: none;
39
48
  color: var(--input-color-text-light);
40
49
  border-color: var(--input-color-border-weak);
50
+ resize: none !important;
41
51
  }
42
52
  }
43
53
 
@@ -45,20 +55,33 @@
45
55
  .vui-input {
46
56
  .vui-input-style,
47
57
  textarea {
48
- border-color: var(--color-text-red) !important;
58
+ outline: 1px solid var(--color-text-red) !important;
49
59
  }
50
60
  }
51
61
  }
52
62
 
63
+ &.vui-input-color {
64
+ .vui-input-style {
65
+ padding-left: 0 !important;
66
+ outline: none !important;
67
+ }
68
+ }
69
+
53
70
  .vui-input {
54
71
  label {
55
72
  display: block;
56
73
  text-align: left;
57
74
  margin-bottom: 8px;
58
- font-size: var(--font-size-ms);
75
+ font-size: var(--font-size-m);
59
76
  color: var(--input-color-text);
60
77
  }
61
78
 
79
+ svg {
80
+ min-width: 16px;
81
+ min-height: 16px;
82
+ // font-size: var(--font-size-l);
83
+ }
84
+
62
85
  .vui-input-hint {
63
86
  margin-bottom: 8px;
64
87
  margin-top: -4px;
@@ -82,22 +105,42 @@
82
105
  background: transparent;
83
106
  height: var(--input-height);
84
107
  line-height: var(--input-height);
85
- color: var(--color-text);
86
- outline: none !important;
87
- padding-inline: var(--input-padding);
88
- font-size: var(--font-size-ms);
108
+ color: var(--color-text-lighter);
109
+ outline: none;
110
+ font-size: var(--font-size-m);
89
111
  width: 100%;
90
- transition: var(--transition);
112
+ transition: var(--transition-fast);
113
+ padding-inline: var(--input-padding);
114
+ z-index: 1;
91
115
 
92
- &:has(input:focus-visible),
93
- &:focus-visible {
94
- border-color: var(--input-color-border-strong);
116
+ &:has(input:focus),
117
+ &:focus {
118
+ // Override error outline
119
+ outline: 2px solid var(--color-text) !important;
120
+ }
121
+
122
+ .vui-button {
123
+ border: 1px solid var(--color-border);
124
+
125
+ &:first-child {
126
+ border-top-right-radius: 0;
127
+ border-bottom-right-radius: 0;
128
+ margin-left: calc(calc(var(--input-padding) + 1px) * -1);
129
+ }
130
+
131
+ &:last-child {
132
+ border-top-left-radius: 0;
133
+ border-bottom-left-radius: 0;
134
+ margin-right: calc(calc(var(--input-padding) + 1px) * -1);
135
+ }
95
136
  }
96
137
  }
97
138
 
98
139
  input,
99
140
  textarea {
141
+ color: var(--color-text);
100
142
  font-family: var(--global-font);
143
+ // padding-inline: 3px;
101
144
  }
102
145
 
103
146
  input[type='file']::file-selector-button {
@@ -114,6 +157,51 @@
114
157
  background-color: var(--color-border);
115
158
  }
116
159
 
160
+ input[type='color'] {
161
+ width: 1px;
162
+ height: 1px;
163
+ position: absolute;
164
+ overflow: hidden;
165
+ outline: none !important;
166
+ opacity: 0;
167
+
168
+ &:focus + label .vui-input-color-indicator {
169
+ outline: 2px solid var(--color-text);
170
+ }
171
+
172
+ & + label {
173
+ position: relative;
174
+ margin: 0;
175
+ padding-left: var(--input-height);
176
+
177
+ input {
178
+ padding-inline: var(--space-xs);
179
+ border-radius: var(--border-radius-s);
180
+
181
+ &:focus {
182
+ outline: 2px solid var(--color-text);
183
+ }
184
+ }
185
+
186
+ .vui-input-color-indicator {
187
+ position: absolute;
188
+ inset: 4px;
189
+ right: unset;
190
+ width: calc(var(--input-height) - 8px);
191
+ background-color: var(--color-border);
192
+ border-radius: var(--border-radius-s);
193
+ font-size: var(--font-size-l);
194
+ display: flex;
195
+ align-items: center;
196
+ justify-content: center;
197
+
198
+ &:hover {
199
+ opacity: 0.8;
200
+ }
201
+ }
202
+ }
203
+ }
204
+
117
205
  ::-moz-range-thumb,
118
206
  ::-webkit-slider-thumb {
119
207
  width: 16px;
@@ -130,7 +218,7 @@
130
218
  line-height: calc(var(--input-height) - 1px);
131
219
  background: transparent;
132
220
  outline: none;
133
- font-size: var(--font-size-ms);
221
+ font-size: var(--font-size-m);
134
222
  color: var(--color-text);
135
223
 
136
224
  &:-webkit-autofill {
@@ -142,7 +230,7 @@
142
230
  textarea {
143
231
  line-height: 1.3em;
144
232
  height: auto;
145
- min-height: 4lh;
233
+ min-height: 5lh;
146
234
  field-sizing: content;
147
235
  padding: var(--textarea-padding);
148
236
  transition: none;
@@ -172,12 +260,13 @@
172
260
 
173
261
  &.vui-dropzone {
174
262
  &.dragging .vui-input .vui-input-style {
175
- border-color: var(--color-border-accent);
263
+ border-color: var(--color-accent);
176
264
 
177
265
  &:hover {
178
266
  border-color: var(--color-border);
179
267
  }
180
268
  }
269
+
181
270
  .vui-input {
182
271
  .vui-input-style {
183
272
  height: unset;
@@ -187,11 +276,15 @@
187
276
  line-height: 1.2em;
188
277
 
189
278
  &:hover {
190
- border-color: var(--color-border-strong);
279
+ border-color: var(--color-accent);
191
280
  }
192
281
 
193
282
  input {
194
- display: none;
283
+ width: 1px;
284
+ height: 1px;
285
+ position: absolute;
286
+ outline: 0 !important;
287
+ opacity: 0 !important;
195
288
 
196
289
  & + label {
197
290
  display: flex;
@@ -199,6 +292,7 @@
199
292
  justify-content: center;
200
293
  width: 100%;
201
294
  min-height: 96px;
295
+ margin: 0;
202
296
  color: var(--color-text-light);
203
297
  }
204
298
  }
@@ -1,5 +1,5 @@
1
1
  <script setup lang='ts'>
2
- import type { VNode } from 'vue'
2
+ import type Kbd from './Kbd.vue'
3
3
  import { useMagicKeys, whenever } from '@vueuse/core'
4
4
 
5
5
  /**
@@ -12,11 +12,7 @@ const emits = defineEmits<{
12
12
  }>()
13
13
 
14
14
  const slots = defineSlots<{
15
- default: () => Array<VNode & {
16
- props: {
17
- keys: string
18
- }
19
- }>
15
+ default: () => Array<typeof Kbd>
20
16
  }>()
21
17
  const keys = useMagicKeys()
22
18
 
@@ -1,18 +1,19 @@
1
1
  .vui-kbd {
2
- display: flex;
2
+ display: inline-flex;
3
3
  align-items: center;
4
4
  justify-content: center;
5
5
  height: 24px;
6
6
  border-radius: var(--border-radius-xs);
7
- // border: 1px solid var(--color-border-strong);
8
7
  font-size: var(--font-size-s);
9
8
  padding: 0 4px;
10
- transition: var(--transition);
9
+ transition: var(--transition-fast);
11
10
  font-weight: 600;
12
- background-color: var(--color-text);
13
- color: var(--color-text-invert);
11
+ background-color: var(--color-button-gray);
12
+ color: var(--color-text-accent);
14
13
 
15
14
  &.active {
16
- background-color: var(--color-text-yellow);
15
+ transform: translateY(2px);
16
+ color: var(--color-text-invert);
17
+ background-color: var(--color-button-fill);
17
18
  }
18
19
  }