@dolanske/vui 0.5.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 (152) hide show
  1. package/README.md +5 -4
  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/Grid/Grid.vue.d.ts +4 -1
  13. package/dist/components/Input/Dropzone.vue.d.ts +1 -1
  14. package/dist/components/Input/Input.vue.d.ts +2 -2
  15. package/dist/components/Kbd/KbdGroup.vue.d.ts +3 -11
  16. package/dist/components/Modal/Confirm.vue.d.ts +1 -1
  17. package/dist/components/Modal/Modal.vue.d.ts +1 -1
  18. package/dist/components/Pagination/Pagination.vue.d.ts +3 -0
  19. package/dist/components/Popout/Popout.vue.d.ts +8 -1
  20. package/dist/components/Progress/Progress.vue.d.ts +2 -0
  21. package/dist/components/Radio/Radio.vue.d.ts +1 -0
  22. package/dist/components/Select/Select.vue.d.ts +2 -0
  23. package/dist/components/Sheet/Sheet.vue.d.ts +3 -0
  24. package/dist/components/Switch/Switch.vue.d.ts +1 -0
  25. package/dist/components/Table/index.d.ts +6 -0
  26. package/dist/components/Table/table.d.ts +1 -1
  27. package/dist/components/Tabs/Tab.vue.d.ts +16 -3
  28. package/dist/components/Toast/toast.d.ts +245 -0
  29. package/dist/index.d.ts +2 -7
  30. package/dist/shared/helpers.d.ts +9 -0
  31. package/dist/shared/theme.d.ts +3 -0
  32. package/dist/style.css +1 -1
  33. package/dist/vui.js +6418 -6049
  34. package/package.json +7 -3
  35. package/src/App.vue +90 -171
  36. package/src/components/Accordion/accordion.scss +1 -0
  37. package/src/components/Alert/Alert.vue +11 -5
  38. package/src/components/Alert/alert.scss +104 -23
  39. package/src/components/Avatar/Avatar.vue +4 -1
  40. package/src/components/Avatar/avatar.scss +1 -1
  41. package/src/components/Badge/Badge.vue +1 -1
  42. package/src/components/Badge/badge.scss +134 -17
  43. package/src/components/Breadcrumbs/BreadcrumbItem.vue +2 -2
  44. package/src/components/Breadcrumbs/Breadcrumbs.vue +1 -2
  45. package/src/components/Breadcrumbs/breadcrumbs.scss +2 -1
  46. package/src/components/Button/Button.vue +15 -20
  47. package/src/components/Button/button.scss +156 -55
  48. package/src/components/ButtonGroup/ButtonGroup.vue +4 -1
  49. package/src/components/ButtonGroup/button-group.scss +2 -2
  50. package/src/components/Calendar/Calendar.vue +4 -1
  51. package/src/components/Calendar/calendar.scss +25 -2
  52. package/src/components/Card/Card.vue +2 -2
  53. package/src/components/Card/card.scss +4 -4
  54. package/src/components/Checkbox/Checkbox.vue +4 -1
  55. package/src/components/Checkbox/checkbox.scss +17 -12
  56. package/src/components/CopyClipboard/CopyClipboard.vue +15 -6
  57. package/src/components/CopyClipboard/copy-clipboard.scss +10 -2
  58. package/src/components/Drawer/Drawer.vue +4 -4
  59. package/src/components/Drawer/drawer.scss +1 -0
  60. package/src/components/Dropdown/Dropdown.vue +44 -20
  61. package/src/components/Dropdown/DropdownItem.vue +4 -4
  62. package/src/components/Dropdown/DropdownTitle.vue +7 -1
  63. package/src/components/Dropdown/dropdown-item.scss +9 -2
  64. package/src/components/Dropdown/dropdown.scss +21 -7
  65. package/src/components/Grid/Grid.vue +21 -1
  66. package/src/components/Input/Color.vue +26 -0
  67. package/src/components/Input/Counter.vue +12 -16
  68. package/src/components/Input/Dropzone.vue +1 -1
  69. package/src/components/Input/File.vue +1 -1
  70. package/src/components/Input/Input.vue +8 -6
  71. package/src/components/Input/Password.vue +1 -13
  72. package/src/components/Input/Textarea.vue +4 -2
  73. package/src/components/Input/input.scss +110 -16
  74. package/src/components/Kbd/KbdGroup.vue +2 -6
  75. package/src/components/Kbd/kbd.scss +6 -5
  76. package/src/components/Modal/Confirm.vue +1 -1
  77. package/src/components/Modal/Modal.vue +23 -15
  78. package/src/components/Modal/modal.scss +11 -6
  79. package/src/components/OTP/otp.scss +8 -7
  80. package/src/components/Pagination/Pagination.vue +6 -3
  81. package/src/components/Popout/Popout.vue +15 -5
  82. package/src/components/Popout/popout.scss +8 -1
  83. package/src/components/Progress/Progress.vue +18 -5
  84. package/src/components/Progress/progress.scss +7 -1
  85. package/src/components/Radio/Radio.vue +4 -2
  86. package/src/components/Radio/radio.scss +18 -8
  87. package/src/components/Select/Select.vue +49 -18
  88. package/src/components/Select/select.scss +35 -2
  89. package/src/components/Sheet/Sheet.vue +8 -2
  90. package/src/components/Sheet/sheet.scss +9 -0
  91. package/src/components/Sidebar/Sidebar.vue +24 -11
  92. package/src/components/Sidebar/sidebar.scss +6 -5
  93. package/src/components/Spinner/spinner.scss +2 -1
  94. package/src/components/Switch/Switch.vue +4 -3
  95. package/src/components/Switch/switch.scss +39 -6
  96. package/src/components/Table/{Header.vue → Head.vue} +5 -5
  97. package/src/components/Table/{Table.vue → Root.vue} +2 -2
  98. package/src/components/Table/SelectRow.vue +2 -1
  99. package/src/components/Table/index.ts +7 -0
  100. package/src/components/Table/table.scss +25 -5
  101. package/src/components/Table/table.ts +7 -3
  102. package/src/components/Tabs/Tab.vue +7 -9
  103. package/src/components/Tabs/Tabs.vue +2 -2
  104. package/src/components/Tabs/tabs.scss +10 -3
  105. package/src/components/Toast/Toasts.vue +5 -0
  106. package/src/components/Toast/toast.scss +6 -2
  107. package/src/components/Toast/toast.ts +7 -0
  108. package/src/components/Tooltip/Tooltip.vue +9 -9
  109. package/src/components/Tooltip/tooltip.scss +4 -0
  110. package/src/examples/ExampleAccordions.vue +58 -0
  111. package/src/examples/ExampleAlerts.vue +78 -0
  112. package/src/examples/ExampleAvatars.vue +44 -0
  113. package/src/examples/ExampleBadges.vue +48 -0
  114. package/src/examples/ExampleBreadcrumbs.vue +46 -0
  115. package/src/examples/ExampleButtons.vue +140 -0
  116. package/src/examples/ExampleCalendars.vue +40 -0
  117. package/src/examples/ExampleCards.vue +94 -0
  118. package/src/examples/ExampleCheckboxes.vue +123 -0
  119. package/src/examples/ExampleCopyClipboard.vue +47 -0
  120. package/src/examples/ExampleDividers.vue +39 -0
  121. package/src/examples/ExampleDrawers.vue +67 -0
  122. package/src/examples/ExampleDropdowns.vue +114 -0
  123. package/src/examples/ExampleFlexGrid.vue +122 -0
  124. package/src/examples/ExampleInputs.vue +234 -0
  125. package/src/examples/ExampleKBD.vue +65 -0
  126. package/src/examples/ExampleModals.vue +143 -0
  127. package/src/examples/ExamplePalette.vue +159 -0
  128. package/src/examples/ExamplePopouts.vue +41 -0
  129. package/src/examples/ExampleSheets.vue +77 -0
  130. package/src/examples/ExampleSidebars.vue +270 -0
  131. package/src/examples/ExampleSkeletons.vue +26 -0
  132. package/src/examples/ExampleSpinners.vue +78 -0
  133. package/src/examples/ExampleTables.vue +195 -0
  134. package/src/examples/ExampleTabs.vue +119 -0
  135. package/src/examples/ExampleToasts.vue +96 -0
  136. package/src/examples/ExampleTooltips.vue +70 -0
  137. package/src/examples/shared/ExampleColor.vue +28 -0
  138. package/src/index.ts +4 -11
  139. package/src/internal/Backdrop/backdrop.scss +7 -1
  140. package/src/shared/helpers.ts +43 -0
  141. package/src/shared/theme.ts +22 -0
  142. package/src/style/animation.scss +1 -0
  143. package/src/style/core.scss +30 -55
  144. package/src/style/layout.scss +74 -9
  145. package/src/style/text.scss +18 -0
  146. package/src/style/theme.scss +195 -0
  147. package/src/style/tooltip.scss +22 -4
  148. package/src/style/typography.scss +95 -18
  149. package/dist/components/Table/Row.vue.d.ts +0 -16
  150. package/src/components/Table/Row.vue +0 -9
  151. /package/dist/components/Table/{Header.vue.d.ts → Head.vue.d.ts} +0 -0
  152. /package/dist/components/Table/{Table.vue.d.ts → Root.vue.d.ts} +0 -0
@@ -3,6 +3,7 @@ import type { VueDatePickerProps } from '@vuepic/vue-datepicker'
3
3
  import { Icon } from '@iconify/vue'
4
4
  import VueDatePicker from '@vuepic/vue-datepicker'
5
5
  import { useAttrs } from 'vue'
6
+ import { theme } from '../../shared/theme'
6
7
  import '@vuepic/vue-datepicker/dist/main.css'
7
8
  import './calendar.scss'
8
9
 
@@ -11,8 +12,8 @@ const props = withDefaults(defineProps<VueDatePickerProps & {
11
12
  }>(), {
12
13
  autoApply: true,
13
14
  autoPosition: true,
14
- dark: true,
15
15
  format: 'dd/MM/yyyy HH:mm',
16
+ monthNameFormat: 'long',
16
17
  expand: false,
17
18
  })
18
19
 
@@ -24,10 +25,12 @@ const attrs = useAttrs()
24
25
  <VueDatePicker
25
26
  v-bind="{ ...props, ...attrs }"
26
27
  class="vui-calendar"
28
+ :class="{ 'vui-calendar-inline': props.inline }"
27
29
  :style="props.expand ?? !$slots.trigger
28
30
  ? undefined
29
31
  : { display: 'inline-block', width: 'auto' }
30
32
  "
33
+ :dark="theme === 'dark'"
31
34
  >
32
35
  <!-- Icon slots -->
33
36
  <template #input-icon>
@@ -1,3 +1,4 @@
1
+ .dp__theme_light,
1
2
  .dp__theme_dark {
2
3
  --dp-background-color: var(--color-bg);
3
4
  --dp-text-color: var(--color-text);
@@ -28,19 +29,41 @@
28
29
  --dp-range-between-border-color: var(--dp-hover-color, #fff);
29
30
  }
30
31
 
32
+ // TODO: dp theme light
33
+
34
+ .dp__theme_light {
35
+ --dp-primary-text-color: var(--color-text);
36
+ }
37
+
31
38
  :root {
32
39
  --dp-font-family: var(--global-font);
33
40
  --dp-border-radius: var(--border-radius-s);
34
41
  --dp-cell-border-radius: var(--border-radius-s);
35
42
  --dp-common-transition: var(--transition);
36
43
 
37
- --dp-font-size: var(--font-size-ms);
44
+ --dp-font-size: var(--font-size-m);
38
45
  --dp-preview-font-size: var(--font-size-s);
39
46
  --dp-time-font-size: var(--font-size-s);
40
47
  }
41
48
 
49
+ .vui-calendar-inline {
50
+ .dp__outer_menu_wrap {
51
+ box-shadow: none;
52
+ }
53
+
54
+ .dp__menu {
55
+ border: none;
56
+ }
57
+ }
58
+
59
+ .dp__overlay_cell_pad {
60
+ font-size: var(--font-size-m);
61
+ text-transform: capitalize;
62
+ font-weight: var(--font-weight-medium);
63
+ }
64
+
42
65
  .dp__main {
43
- font-size: var(--n-font-size-m);
66
+ font-size: var(--font-size-m);
44
67
  }
45
68
 
46
69
  .dp__outer_menu_wrap {
@@ -33,13 +33,13 @@ const {
33
33
  <slot name="header-end" />
34
34
  </div>
35
35
 
36
- <Divider v-if="(separators || headerSeparator) && ($slots.header || $slots['header-end'])" :space="1" />
36
+ <Divider v-if="(separators || headerSeparator) && ($slots.header || $slots['header-end'])" :size="1" />
37
37
 
38
38
  <div v-if="$slots.default" class="vui-card-content">
39
39
  <slot />
40
40
  </div>
41
41
 
42
- <Divider v-if="(separators || footerSeparator) && $slots.footer" :space="1" />
42
+ <Divider v-if="(separators || footerSeparator) && $slots.footer" :size="1" />
43
43
 
44
44
  <div v-if="$slots.footer" class="vui-card-footer">
45
45
  <slot name="footer" />
@@ -12,9 +12,9 @@
12
12
  }
13
13
 
14
14
  &:not(.separators) {
15
- .vui-card-content:not(:first-child) {
16
- padding-block: var(--space-xs);
17
- }
15
+ // &:not(.header-separator) .vui-card-content:first-child {
16
+ // padding-bottom: var(--space-xs);
17
+ // }
18
18
 
19
19
  &.header-separator {
20
20
  .vui-card-content:not(:first-child) {
@@ -32,7 +32,7 @@
32
32
 
33
33
  .vui-card-header {
34
34
  display: flex;
35
- align-items: flex-start;
35
+ align-items: center;
36
36
  justify-content: space-between;
37
37
  padding: var(--space-s) var(--space-m);
38
38
  background-color: var(--color-bg);
@@ -9,14 +9,17 @@ interface Props {
9
9
  iconOff?: string
10
10
  disabled?: boolean
11
11
  checked?: boolean
12
+ accent?: boolean
12
13
  }
13
14
 
14
15
  const {
15
16
  label,
17
+ // iconOn = theme.value === 'light' ? 'ph:check-square-fill' : 'ph:check-square',
16
18
  iconOn = 'ph:check-square-fill',
17
19
  iconOff = 'ph:square',
18
20
  disabled,
19
21
  checked: checkedProp,
22
+ accent,
20
23
  } = defineProps<Props>()
21
24
  const emit = defineEmits<{
22
25
  change: [checked: boolean]
@@ -27,7 +30,7 @@ const id = useId()
27
30
  </script>
28
31
 
29
32
  <template>
30
- <div class="vui-checkbox" :class="{ disabled: !!disabled, checked }">
33
+ <div class="vui-checkbox" :class="{ disabled: !!disabled, checked, accent }">
31
34
  <input
32
35
  :id
33
36
  v-model="checked"
@@ -5,24 +5,21 @@
5
5
  .vui-checkbox-icon svg {
6
6
  color: var(--color-text);
7
7
  }
8
+
9
+ &.accent .vui-checkbox-icon svg {
10
+ color: var(--color-accent);
11
+ }
8
12
  }
9
13
 
10
14
  &.disabled {
11
- cursor: not-allowed;
12
-
13
15
  .vui-checkbox-icon {
14
- pointer-events: none;
15
- svg path {
16
- color: var(--color-text-lighter);
17
- }
16
+ opacity: 0.25;
17
+ cursor: not-allowed;
18
18
  }
19
19
 
20
- input + label {
20
+ input + label .vui-checkbox-content {
21
+ opacity: 0.4;
21
22
  cursor: not-allowed;
22
-
23
- p {
24
- color: var(--color-text-lighter);
25
- }
26
23
  }
27
24
  }
28
25
 
@@ -43,10 +40,12 @@
43
40
  position: absolute;
44
41
  overflow: hidden;
45
42
  outline: none !important;
43
+ opacity: 0;
46
44
 
47
45
  &:focus-visible + label .vui-checkbox-icon {
48
46
  outline: 2px solid var(--color-text);
49
47
  border-radius: var(--border-radius-s);
48
+ cursor: default;
50
49
  }
51
50
 
52
51
  & + label {
@@ -65,7 +64,7 @@
65
64
  display: flex;
66
65
  align-items: center;
67
66
  min-height: var(--checkbox-size);
68
- font-size: var(--font-size-ms);
67
+ font-size: var(--font-size-m);
69
68
  align-self: flex-start;
70
69
  // line-height: var(--checkbox-size);
71
70
  }
@@ -73,3 +72,9 @@
73
72
  }
74
73
  }
75
74
  }
75
+
76
+ :root.light {
77
+ .vui-checkbox.checked.accent .vui-checkbox-icon svg {
78
+ color: var(--color-accent);
79
+ }
80
+ }
@@ -2,7 +2,8 @@
2
2
  import { autoUpdate, flip, offset, shift, useFloating } from '@floating-ui/vue'
3
3
  import { Icon } from '@iconify/vue'
4
4
  import { useClipboard } from '@vueuse/core'
5
- import { onMounted, useSlots, useTemplateRef } from 'vue'
5
+ import { computed, onMounted, useSlots, useTemplateRef } from 'vue'
6
+ import { isNil } from '../../shared/helpers'
6
7
  import Flex from '../Flex/Flex.vue'
7
8
  import './copy-clipboard.scss'
8
9
 
@@ -36,13 +37,21 @@ const {
36
37
  })
37
38
  const slots = useSlots()
38
39
 
40
+ const parsedConfirm = computed(() => {
41
+ if (isNil(confirm))
42
+ return false
43
+ if (confirm === '')
44
+ return true
45
+ else return confirm
46
+ })
47
+
39
48
  onMounted(() => {
40
49
  if (!isSupported.value) {
41
50
  console.error('Clipboard API is not supported. This component will not work')
42
51
  }
43
52
 
44
- if (confirm && slots.confirm) {
45
- console.warn('You are using the \'confirm\' prop and slot. The slot will take precedence.')
53
+ if (typeof parsedConfirm.value === 'string' && slots.confirm) {
54
+ console.warn('[ClipBoard] You are using the \'confirm\' prop and slot. The slot will take precedence.')
46
55
  }
47
56
  })
48
57
 
@@ -67,10 +76,10 @@ const { floatingStyles } = useFloating(anchorRef, tooltipRef, {
67
76
  </div>
68
77
 
69
78
  <Transition name="fade-up" mode="in-out">
70
- <div v-if="copied && (confirm || $slots.confirm)" ref="tooltip" class="vui-clipboard-tooltip" :style="floatingStyles">
79
+ <div v-if="copied && (!!parsedConfirm || $slots.confirm)" ref="tooltip" class="vui-clipboard-tooltip" :style="floatingStyles">
71
80
  <slot name="confirm">
72
- <template v-if="confirm">
73
- {{ confirm }}
81
+ <template v-if="typeof parsedConfirm === 'string'">
82
+ {{ parsedConfirm }}
74
83
  </template>
75
84
  <Flex v-else align-center justify-center>
76
85
  <Icon width="16" height="16" icon="ph:check-bold" />
@@ -7,11 +7,19 @@
7
7
  padding: 6px 8px;
8
8
  border-radius: var(--border-radius-s);
9
9
  background-color: var(--color-bg-raised);
10
- font-size: var(--font-size-s);
11
- color: var(--color-text-light);
10
+ font-size: var(--font-size-m);
11
+ color: var(--color-text);
12
12
  box-shadow: var(--box-shadow);
13
+ z-index: 1000;
13
14
 
14
15
  svg path {
15
16
  color: var(--color-text);
16
17
  }
17
18
  }
19
+
20
+ :root.light {
21
+ .vui-clipboard-tooltip {
22
+ background-color: var(--color-bg);
23
+ box-shadow: var(--box-shadow-strong);
24
+ }
25
+ }
@@ -45,7 +45,7 @@ const open = defineModel<boolean>()
45
45
 
46
46
  const mW = computed(() => {
47
47
  if (typeof containerSize === 'string') {
48
- if (containerClass === 'full') {
48
+ if (containerSize === 'full') {
49
49
  return '100%'
50
50
  }
51
51
  else {
@@ -61,7 +61,7 @@ const mW = computed(() => {
61
61
  const id = useId()
62
62
 
63
63
  onMounted(() => {
64
- if (!document.querySelector('vaul-drawer-wrapper')) {
64
+ if (!document.querySelector('[vaul-drawer-wrapper]')) {
65
65
  console.error('Your root component is missing \'vaul-drawer-wrapper\' attribute. \n Without it the <Drawer /> component will not be functional.')
66
66
  }
67
67
  })
@@ -70,14 +70,14 @@ onMounted(() => {
70
70
  <template>
71
71
  <DrawerRoot
72
72
  :open
73
- should-scale-background
74
73
  v-bind="rootProps"
74
+ :aria-describedby="id"
75
75
  @close="open = false"
76
76
  @update:open="(state) => open = state"
77
77
  >
78
78
  <DrawerPortal v-bind="portalProps">
79
79
  <DrawerOverlay class="vui-drawer-overlay" />
80
- <DrawerContent class="vui-drawer-content" :class="{ 'hide-handle': handle === false }" :aria-describedby="id">
80
+ <DrawerContent class="vui-drawer-content" :class="{ 'hide-handle': handle === false }">
81
81
  <div :key="mW" class="vui-drawer-container container" :class="containerClass" :style="{ 'max-width': mW }">
82
82
  <DrawerTitle class="visually-hidden" :name="id">
83
83
  {{ title }}
@@ -10,6 +10,7 @@
10
10
  bottom: 0;
11
11
  left: 0;
12
12
  right: 0;
13
+ box-shadow: var(--box-shadow);
13
14
 
14
15
  &.hide-handle:before {
15
16
  display: none;
@@ -1,8 +1,8 @@
1
1
  <script setup lang='ts'>
2
2
  import type { MaybeElement } from '@vueuse/core'
3
3
  import type { Placement } from '../../shared/types'
4
- import { onClickOutside } from '@vueuse/core'
5
- import { computed, ref, useTemplateRef } from 'vue'
4
+ import { onClickOutside, useMagicKeys, whenever } from '@vueuse/core'
5
+ import { computed, onMounted, ref, useTemplateRef, watch } from 'vue'
6
6
  import { formatUnitValue } from '../../shared/helpers'
7
7
  import Popout from '../Popout/Popout.vue'
8
8
  import './dropdown.scss'
@@ -20,14 +20,24 @@ export interface Props {
20
20
  * Sets the width of the dropdown to the width of its anchor
21
21
  */
22
22
  expand?: boolean
23
+
24
+ /**
25
+ * Set he max height of the dropdown element before it starts scrolling
26
+ */
27
+ maxHeight?: number | string
23
28
  }
24
29
 
25
30
  const {
26
31
  placement = 'bottom-start',
32
+ maxHeight = 356,
27
33
  expand,
28
34
  minWidth = 156,
29
35
  } = defineProps<Props>()
30
36
 
37
+ const emit = defineEmits<{
38
+ close: []
39
+ }>()
40
+
31
41
  const anchorRef = useTemplateRef<HTMLDivElement>('anchor')
32
42
  const dropdownRef = useTemplateRef<MaybeElement>('dropdown')
33
43
 
@@ -67,6 +77,19 @@ defineExpose({
67
77
 
68
78
  const mW = computed(() => formatUnitValue(minWidth))
69
79
  const w = computed(() => expand ? `${anchorWidth.value}px` : 'initial')
80
+
81
+ const { escape } = useMagicKeys()
82
+ whenever(escape, close)
83
+
84
+ watch(showMenu, (v) => {
85
+ if (!v)
86
+ emit('close')
87
+ })
88
+
89
+ onMounted(() => {
90
+ if (expand && minWidth !== 156)
91
+ console.warn('[Dropdown] Dropdown: minWidth prop is ignored when expand is set to true')
92
+ })
70
93
  </script>
71
94
 
72
95
  <template>
@@ -81,31 +104,32 @@ const w = computed(() => expand ? `${anchorWidth.value}px` : 'initial')
81
104
  <slot name="trigger" :open :is-open="showMenu" :close :toggle />
82
105
  </div>
83
106
 
84
- <Transition appear name="dropdown">
85
- <Popout
86
- v-if="showMenu"
87
- ref="dropdown"
88
- :anchor="anchorRef"
89
- class="vui-dropdown"
90
- :placement
91
- :style="{
92
- minWidth: mW,
93
- width: w,
94
- }"
95
- >
96
- <slot :open :close :toggle :is-open="showMenu" />
97
- </Popout>
98
- </Transition>
107
+ <!-- <Transition name="dropdown" mode="out-in"> -->
108
+ <Popout
109
+ v-if="showMenu"
110
+ ref="dropdown"
111
+ :anchor="anchorRef"
112
+ class="vui-dropdown"
113
+ :placement
114
+ :style="{
115
+ minWidth: expand ? w : mW,
116
+ width: w,
117
+ maxHeight: formatUnitValue(maxHeight),
118
+ }"
119
+ >
120
+ <slot :open :close :toggle :is-open="showMenu" />
121
+ </Popout>
122
+ <!-- </Transition> -->
99
123
  </template>
100
124
 
101
- <style scoped lang="scss">
125
+ <!-- <style scoped lang="scss">
102
126
  .dropdown-enter-active,
103
127
  .dropdown-leave-active {
104
- transition: 0.1s opacity ease-in-out;
128
+ transition: var(--transition-fast);
105
129
  }
106
130
 
107
131
  .dropdown-enter-from,
108
132
  .dropdown-leave-to {
109
133
  opacity: 0;
110
134
  }
111
- </style>
135
+ </style> -->
@@ -12,17 +12,17 @@ const props = defineProps<Props>()
12
12
  </script>
13
13
 
14
14
  <template>
15
- <button class="vui-dropdown-item" :class="{ disabled }">
15
+ <button class="vui-dropdown-item" :class="{ disabled }" :disabled>
16
16
  <!-- This should always be here to offset items which dont have icons -->
17
- <div class="vui-dropdown-item-icon">
18
- <Icon v-if="props.icon" :icon="props.icon" />
17
+ <div v-if="props.icon" class="vui-dropdown-item-icon">
18
+ <Icon :icon="props.icon" />
19
19
  </div>
20
20
 
21
21
  <div class="vui-dropdown-item-slot">
22
22
  <slot />
23
23
  </div>
24
24
 
25
- <div class="vui-dropdown-item-hint">
25
+ <div v-if="$slots.hint" class="vui-dropdown-item-hint">
26
26
  <slot name="hint" />
27
27
  </div>
28
28
 
@@ -1,5 +1,11 @@
1
+ <script lang="ts" setup>
2
+ const { sticky } = defineProps<{
3
+ sticky?: boolean
4
+ }>()
5
+ </script>
6
+
1
7
  <template>
2
- <div class="vui-dropdown-title">
8
+ <div class="vui-dropdown-title" :class="{ sticky }">
3
9
  <slot />
4
10
  <div v-if="$slots.end" class="vui-dropdown-title-end">
5
11
  <slot name="end" />
@@ -7,9 +7,9 @@
7
7
  width: 100%;
8
8
  height: var(--interactive-el-height);
9
9
  border-radius: var(--border-radius-m);
10
- font-size: var(--font-size-s);
10
+ font-size: var(--font-size-m);
11
11
  cursor: default;
12
- transition: var(--transition);
12
+ transition: var(--transition-fast);
13
13
  padding-inline: var(--space-s);
14
14
  white-space: nowrap;
15
15
  margin-bottom: 4px;
@@ -55,10 +55,17 @@
55
55
  }
56
56
 
57
57
  .vui-dropdown-item-hint {
58
+ display: flex;
59
+ align-items: center;
60
+ gap: 2px;
58
61
  margin-left: 8px;
59
62
  font-size: 0.9rem;
60
63
  // white-space: nowrap;
61
64
  color: var(--color-text-lighter);
65
+
66
+ svg {
67
+ color: var(--color-text-lighter);
68
+ }
62
69
  }
63
70
 
64
71
  .vui-dropdown-item-slot {
@@ -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,6 +8,7 @@
8
8
  border-radius: var(--border-radius-m);
9
9
  border: 1px solid var(--color-border);
10
10
  padding: 4px;
11
+ overflow-y: auto;
11
12
  }
12
13
 
13
14
  .vui-dropdown-title {
@@ -15,19 +16,26 @@
15
16
  display: flex;
16
17
  align-items: center;
17
18
  justify-content: flex-start;
18
- padding-block: var(--space-s);
19
- padding-inline: calc(var(--space-s) + 4px);
20
- 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);
21
22
  border-bottom: 1px solid var(--color-border);
22
- font-weight: 500;
23
- // margin-block: 4px;
23
+ font-weight: var(--font-weight-semibold);
24
24
  margin-inline: -4px;
25
25
  margin-top: -4px;
26
26
  margin-bottom: 4px;
27
27
  gap: var(--space-m);
28
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
+ }
29
36
 
30
37
  &:not(:first-child) {
38
+ margin-top: 4px;
31
39
  border-top: 1px solid var(--color-border);
32
40
  }
33
41
 
@@ -37,3 +45,9 @@
37
45
  color: var(--color-text-lighter);
38
46
  }
39
47
  }
48
+
49
+ :root.light {
50
+ .vui-dropdown-title {
51
+ background-color: var(--color-bg);
52
+ }
53
+ }
@@ -12,7 +12,13 @@ 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
24
  const props = withDefaults(defineProps<Props>(), {
@@ -43,6 +49,18 @@ const aTR = computed(() => {
43
49
  return props.rows ?? 'none'
44
50
  })
45
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
+
46
64
  const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
47
65
  </script>
48
66
 
@@ -53,6 +71,8 @@ const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
53
71
  gap: ag,
54
72
  gridTemplateColumns: aTC,
55
73
  gridTemplateRows: aTR,
74
+ alignItems: aA,
75
+
56
76
  }"
57
77
  >
58
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;