@dolanske/vui 1.1.4 → 1.1.5

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dolanske/vui",
3
3
  "type": "module",
4
- "version": "1.1.4",
4
+ "version": "1.1.5",
5
5
  "private": false,
6
6
  "description": "Brother in Christ there's a new UI library",
7
7
  "author": "dolanske",
@@ -95,6 +95,7 @@
95
95
  opacity: 0;
96
96
  position: absolute;
97
97
  pointer-events: none;
98
+ --spinner-color: var(--color-text);
98
99
  }
99
100
 
100
101
  // Variants
@@ -166,6 +167,10 @@
166
167
  color: var(--color-text-invert);
167
168
  background-color: var(--color-button-fill);
168
169
 
170
+ .vui-spinner {
171
+ --spinner-color: var(--color-text-invert);
172
+ }
173
+
169
174
  svg,
170
175
  path {
171
176
  color: var(--color-text-invert);
@@ -30,7 +30,7 @@
30
30
  left: 50%;
31
31
  transform: translate(-50%, -50%);
32
32
 
33
- & > *:first-child {
33
+ & > *:first-child {
34
34
  outline: 3px solid var(--color-bg);
35
35
  }
36
36
  }
@@ -48,7 +48,7 @@ const {
48
48
  } = defineProps<Props>()
49
49
 
50
50
  const selected = defineModel<SelectOption[] | undefined>()
51
- const trigger = useTemplateRef('trigger')
51
+ const triggerRef = useTemplateRef('trigger')
52
52
 
53
53
  //
54
54
  function setValue(option: SelectOption) {
@@ -128,7 +128,7 @@ const id = useId()
128
128
 
129
129
  <template>
130
130
  <div class="vui-input-container vui-select" :class="{ expand, required, readonly, disabled, 'has-errors': errors.length > 0 }">
131
- <Dropdown ref="dropdown" :expand @close="trigger?.focus({ preventScroll: true })">
131
+ <Dropdown ref="dropdown" :expand min-width="192px" @close="triggerRef?.focus({ preventScroll: true })">
132
132
  <template #trigger="{ toggle, isOpen }">
133
133
  <div class="vui-input vui-select-trigger-content">
134
134
  <label v-if="label" :for="id">{{ label }}</label>
@@ -1,6 +1,7 @@
1
1
  .vui-input-container {
2
2
  &.vui-select {
3
3
  width: auto;
4
+ min-width: 96px;
4
5
 
5
6
  &.expand {
6
7
  .vui-dropdown-trigger-wrap,
@@ -1,6 +1,6 @@
1
1
  <script setup lang='ts'>
2
2
  import { useCssVar, useMouseInElement, useTimeoutFn, watchThrottled } from '@vueuse/core'
3
- import { computed, onMounted, useSlots, useTemplateRef } from 'vue'
3
+ import { computed, onBeforeMount, useSlots, useTemplateRef } from 'vue'
4
4
  import { isNil } from '../../shared/helpers'
5
5
  import './sidebar.scss'
6
6
 
@@ -26,12 +26,12 @@ interface Props {
26
26
  floaty?: boolean
27
27
  }
28
28
 
29
- const sidebar = useTemplateRef('sidebar')
29
+ const sidebarRef = useTemplateRef('sidebar')
30
30
  const open = defineModel<boolean>({
31
31
  default: true,
32
32
  })
33
33
  const slots = useSlots()
34
- const offset = useCssVar('--vui-sidebar-float-offset', sidebar, {
34
+ const offset = useCssVar('--vui-sidebar-float-offset', sidebarRef, {
35
35
  initialValue: '8px',
36
36
  })
37
37
 
@@ -61,10 +61,10 @@ const { start, stop, isPending } = useTimeoutFn(() => {
61
61
 
62
62
  const APPEAR_OFFSET = 32
63
63
 
64
- const wrap = useTemplateRef('wrap')
65
- const { elementX } = useMouseInElement(wrap)
64
+ const wrapEl = useTemplateRef('wrap')
65
+ const { elementX } = useMouseInElement(wrapEl)
66
66
 
67
- onMounted(() => {
67
+ onBeforeMount(() => {
68
68
  if (props.appear && open.value) {
69
69
  open.value = false
70
70
  }
@@ -92,6 +92,7 @@ watchThrottled(elementX, (pos) => {
92
92
  }
93
93
  }, {
94
94
  throttle: 100,
95
+ immediate: true,
95
96
  })
96
97
  </script>
97
98
 
@@ -75,7 +75,7 @@ const variants = ['gray', 'fill', 'danger', 'success', 'link', 'accent'] as cons
75
75
  </td>
76
76
  </tr>
77
77
  <tr>
78
- <th>Squar + icon</th>
78
+ <th>Square + icon</th>
79
79
  <td>
80
80
  <Flex gap="s">
81
81
  <Button v-for="btn in variants" :key="btn" :variant="btn" square icon="ph:info" />
@@ -83,7 +83,7 @@ const variants = ['gray', 'fill', 'danger', 'success', 'link', 'accent'] as cons
83
83
  </td>
84
84
  </tr>
85
85
  <tr>
86
- <th>Squar + icon + small</th>
86
+ <th>Square + icon + small</th>
87
87
  <td>
88
88
  <Flex gap="s">
89
89
  <Button v-for="btn in variants" :key="btn" :variant="btn" square icon="ph:info" size="s" />
@@ -91,13 +91,21 @@ const variants = ['gray', 'fill', 'danger', 'success', 'link', 'accent'] as cons
91
91
  </td>
92
92
  </tr>
93
93
  <tr>
94
- <th>Squar + icon + large</th>
94
+ <th>Square + icon + large</th>
95
95
  <td>
96
96
  <Flex gap="s">
97
97
  <Button v-for="btn in variants" :key="btn" :variant="btn" square icon="ph:info" size="l" />
98
98
  </Flex>
99
99
  </td>
100
100
  </tr>
101
+ <tr>
102
+ <th>Loading</th>
103
+ <td>
104
+ <Flex gap="s">
105
+ <Button v-for="btn in variants" :key="btn" :variant="btn" loading size="l" />
106
+ </Flex>
107
+ </td>
108
+ </tr>
101
109
  <tr>
102
110
  <th>Icon + text</th>
103
111
  <td>
@@ -184,8 +184,10 @@ const selected2 = ref([])
184
184
  </option>
185
185
  </select>
186
186
  </Grid>
187
+ <div class="inline-block">
188
+ <Select :options="longOptions" label="Short" show-clear />
189
+ </div>
187
190
  <Divider :size="48" />
188
-
189
191
  <h6 class="mb-l">
190
192
  OTP
191
193
  </h6>
@@ -4,7 +4,7 @@ import Button from '../components/Button/Button.vue'
4
4
  import Flex from '../components/Flex/Flex.vue'
5
5
  import Popout from '../components/Popout/Popout.vue'
6
6
 
7
- const anch = useTemplateRef('anch')
7
+ const anchRef = useTemplateRef('anch')
8
8
  const open = ref(false)
9
9
  </script>
10
10
 
@@ -26,7 +26,7 @@ const open = ref(false)
26
26
  This popout has offset of <code>32</code> and its placement is <code>bottom-start</code>. It also has an attached event to <code>clickOutside</code> which is fired when user clicks outside of the popout. In that case, we manually close it.
27
27
  </p>
28
28
  </Flex>
29
- <Popout v-if="open" :anchor="anch" class="test-popout" :offset="32" placement="bottom-start" @click-outside="open = false">
29
+ <Popout v-if="open" :anchor="anchRef" class="test-popout" :offset="32" placement="bottom-start" @click-outside="open = false">
30
30
  <h3>Popout content</h3>
31
31
  <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Dolorem facere eligendi ex, alias itaque molestiae, vero animi, vitae vel fuga corporis aut consectetur temporibus ipsum placeat dolores perferendis. Deleniti, et!</p>
32
32
  </Popout>