@dolanske/vui 1.4.1 → 1.4.3

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 (140) hide show
  1. package/package.json +1 -2
  2. package/src/App.vue +0 -103
  3. package/src/components/Accordion/Accordion.vue +0 -98
  4. package/src/components/Accordion/AccordionGroup.vue +0 -49
  5. package/src/components/Accordion/accordion.scss +0 -97
  6. package/src/components/Alert/Alert.vue +0 -59
  7. package/src/components/Alert/alert.scss +0 -162
  8. package/src/components/Avatar/Avatar.vue +0 -53
  9. package/src/components/Avatar/avatar.scss +0 -52
  10. package/src/components/Badge/Badge.vue +0 -21
  11. package/src/components/Badge/badge.scss +0 -210
  12. package/src/components/Breadcrumbs/BreadcrumbItem.vue +0 -26
  13. package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -29
  14. package/src/components/Breadcrumbs/breadcrumbs.scss +0 -31
  15. package/src/components/Button/Button.vue +0 -86
  16. package/src/components/Button/button.scss +0 -292
  17. package/src/components/ButtonGroup/ButtonGroup.vue +0 -28
  18. package/src/components/ButtonGroup/button-group.scss +0 -51
  19. package/src/components/Calendar/Calendar.vue +0 -66
  20. package/src/components/Calendar/calendar.scss +0 -88
  21. package/src/components/Card/Card.vue +0 -48
  22. package/src/components/Card/card.scss +0 -55
  23. package/src/components/Checkbox/Checkbox.vue +0 -54
  24. package/src/components/Checkbox/checkbox.scss +0 -80
  25. package/src/components/CopyClipboard/CopyClipboard.vue +0 -98
  26. package/src/components/CopyClipboard/copy-clipboard.scss +0 -25
  27. package/src/components/Divider/Divider.vue +0 -38
  28. package/src/components/Divider/divider.scss +0 -37
  29. package/src/components/Drawer/Drawer.vue +0 -102
  30. package/src/components/Drawer/drawer.scss +0 -37
  31. package/src/components/Dropdown/Dropdown.vue +0 -120
  32. package/src/components/Dropdown/DropdownItem.vue +0 -33
  33. package/src/components/Dropdown/DropdownTitle.vue +0 -14
  34. package/src/components/Dropdown/dropdown-item.scss +0 -84
  35. package/src/components/Dropdown/dropdown.scss +0 -53
  36. package/src/components/Flex/Flex.vue +0 -113
  37. package/src/components/Grid/Grid.vue +0 -87
  38. package/src/components/Input/Color.vue +0 -26
  39. package/src/components/Input/Counter.vue +0 -66
  40. package/src/components/Input/Dropzone.vue +0 -65
  41. package/src/components/Input/File.vue +0 -15
  42. package/src/components/Input/Input.vue +0 -123
  43. package/src/components/Input/Password.vue +0 -35
  44. package/src/components/Input/Textarea.vue +0 -78
  45. package/src/components/Input/input.scss +0 -302
  46. package/src/components/Kbd/Kbd.vue +0 -48
  47. package/src/components/Kbd/KbdGroup.vue +0 -28
  48. package/src/components/Kbd/kbd.scss +0 -19
  49. package/src/components/Modal/Confirm.vue +0 -56
  50. package/src/components/Modal/Modal.vue +0 -103
  51. package/src/components/Modal/modal.scss +0 -54
  52. package/src/components/OTP/OTP.vue +0 -133
  53. package/src/components/OTP/OTPItem.vue +0 -37
  54. package/src/components/OTP/otp.scss +0 -84
  55. package/src/components/Pagination/Pagination.vue +0 -92
  56. package/src/components/Pagination/pagination.ts +0 -78
  57. package/src/components/Popout/Popout.vue +0 -73
  58. package/src/components/Popout/popout.scss +0 -16
  59. package/src/components/Progress/Progress.vue +0 -103
  60. package/src/components/Progress/progress.scss +0 -47
  61. package/src/components/Radio/Radio.vue +0 -38
  62. package/src/components/Radio/RadioGroup.vue +0 -34
  63. package/src/components/Radio/radio.scss +0 -78
  64. package/src/components/Select/Select.vue +0 -212
  65. package/src/components/Select/select.scss +0 -82
  66. package/src/components/Sheet/Sheet.vue +0 -106
  67. package/src/components/Sheet/sheet.scss +0 -71
  68. package/src/components/Sidebar/Sidebar.vue +0 -116
  69. package/src/components/Sidebar/sidebar.scss +0 -124
  70. package/src/components/Skeleton/Skeleton.vue +0 -43
  71. package/src/components/Skeleton/skeleton.scss +0 -14
  72. package/src/components/Spinner/Spinner.vue +0 -42
  73. package/src/components/Spinner/spinner.scss +0 -47
  74. package/src/components/Switch/Switch.vue +0 -31
  75. package/src/components/Switch/switch.scss +0 -93
  76. package/src/components/Table/Cell.vue +0 -23
  77. package/src/components/Table/Head.vue +0 -66
  78. package/src/components/Table/Root.vue +0 -66
  79. package/src/components/Table/SelectAll.vue +0 -23
  80. package/src/components/Table/SelectRow.vue +0 -30
  81. package/src/components/Table/index.ts +0 -7
  82. package/src/components/Table/table.scss +0 -155
  83. package/src/components/Table/table.ts +0 -248
  84. package/src/components/Tabs/Tab.vue +0 -25
  85. package/src/components/Tabs/Tabs.vue +0 -90
  86. package/src/components/Tabs/tabs.scss +0 -87
  87. package/src/components/Toast/Toasts.vue +0 -52
  88. package/src/components/Toast/toast.scss +0 -45
  89. package/src/components/Toast/toast.ts +0 -75
  90. package/src/components/Tooltip/Tooltip.vue +0 -78
  91. package/src/components/Tooltip/tooltip.scss +0 -5
  92. package/src/examples/ExampleAccordions.vue +0 -69
  93. package/src/examples/ExampleAlerts.vue +0 -78
  94. package/src/examples/ExampleAvatars.vue +0 -44
  95. package/src/examples/ExampleBadges.vue +0 -48
  96. package/src/examples/ExampleBreadcrumbs.vue +0 -46
  97. package/src/examples/ExampleButtons.vue +0 -148
  98. package/src/examples/ExampleCalendars.vue +0 -40
  99. package/src/examples/ExampleCards.vue +0 -94
  100. package/src/examples/ExampleCheckboxes.vue +0 -123
  101. package/src/examples/ExampleCopyClipboard.vue +0 -47
  102. package/src/examples/ExampleDividers.vue +0 -39
  103. package/src/examples/ExampleDrawers.vue +0 -67
  104. package/src/examples/ExampleDropdowns.vue +0 -114
  105. package/src/examples/ExampleFlexGrid.vue +0 -124
  106. package/src/examples/ExampleInputs.vue +0 -236
  107. package/src/examples/ExampleKBD.vue +0 -65
  108. package/src/examples/ExampleModals.vue +0 -143
  109. package/src/examples/ExamplePalette.vue +0 -165
  110. package/src/examples/ExamplePopouts.vue +0 -41
  111. package/src/examples/ExampleSheets.vue +0 -77
  112. package/src/examples/ExampleSidebars.vue +0 -276
  113. package/src/examples/ExampleSkeletons.vue +0 -26
  114. package/src/examples/ExampleSpinners.vue +0 -80
  115. package/src/examples/ExampleTables.vue +0 -359
  116. package/src/examples/ExampleTabs.vue +0 -142
  117. package/src/examples/ExampleToasts.vue +0 -96
  118. package/src/examples/ExampleTooltips.vue +0 -70
  119. package/src/examples/shared/ExampleColor.vue +0 -28
  120. package/src/index.ts +0 -116
  121. package/src/internal/Backdrop/Backdrop.vue +0 -22
  122. package/src/internal/Backdrop/backdrop.scss +0 -34
  123. package/src/main.ts +0 -5
  124. package/src/shared/helpers.ts +0 -124
  125. package/src/shared/slots.ts +0 -61
  126. package/src/shared/theme.ts +0 -22
  127. package/src/shared/types.ts +0 -29
  128. package/src/style/animation.scss +0 -50
  129. package/src/style/core.scss +0 -133
  130. package/src/style/fonts.scss +0 -73
  131. package/src/style/layout.scss +0 -179
  132. package/src/style/media-query.scss +0 -29
  133. package/src/style/reset.scss +0 -135
  134. package/src/style/text.scss +0 -137
  135. package/src/style/theme.scss +0 -195
  136. package/src/style/tooltip.scss +0 -146
  137. package/src/style/typography.scss +0 -435
  138. package/src/style/utils.scss +0 -36
  139. package/src/style.scss +0 -1
  140. package/src/vite-env.d.ts +0 -1
@@ -1,102 +0,0 @@
1
- <script setup lang="ts">
2
- import type { DrawerPortalProps, DrawerRootProps } from 'vaul-vue'
3
- import type { Sizes, VueClass } from '../../shared/types'
4
- import { DrawerContent, DrawerOverlay, DrawerPortal, DrawerRoot, DrawerTitle } from 'vaul-vue'
5
- import { computed, onMounted, useId } from 'vue'
6
- import './drawer.scss'
7
-
8
- interface Props {
9
- /**
10
- * Controls the visibility of the drawer
11
- */
12
- open?: boolean
13
- /**
14
- * Title for accessibility.
15
- */
16
- title?: string
17
- /**
18
- * CSS class applied to the container of the drawer content. Accepts Vue's
19
- * class conditional declaration, string, object or an array.
20
- */
21
- containerClass?: VueClass
22
- /**
23
- * Size of the container. Either use a preset size or number to specify
24
- * max-width of the container.
25
- */
26
- containerSize?: Sizes | 'xl' | 'full' | number
27
- /**
28
- * Wether to display the handle symbol. It doesn't actually do anything, it's
29
- * just for the visuals.
30
- */
31
- handle?: boolean
32
- /**
33
- * Control the underlying Vaul root component
34
- */
35
- rootProps?: DrawerRootProps
36
- portalProps?: DrawerPortalProps
37
- }
38
-
39
- const {
40
- title,
41
- containerClass,
42
- containerSize = 'm',
43
- rootProps,
44
- portalProps,
45
- handle = true,
46
- open = false,
47
- } = defineProps<Props>()
48
-
49
- const emit = defineEmits<{ close: [] }>()
50
-
51
- const mW = computed(() => {
52
- if (typeof containerSize === 'string') {
53
- if (containerSize === 'full') {
54
- return '100%'
55
- }
56
- else {
57
- return getComputedStyle(document.documentElement)
58
- .getPropertyValue(`--container-${containerSize}`)
59
- }
60
- }
61
- else {
62
- return `${containerSize}px`
63
- }
64
- })
65
-
66
- const id = useId()
67
-
68
- onMounted(() => {
69
- if (!document.querySelector('[vaul-drawer-wrapper]')) {
70
- console.error('Your root component is missing \'vaul-drawer-wrapper\' attribute. \n Without it the <Drawer /> component will not be functional.')
71
- }
72
- })
73
- </script>
74
-
75
- <template>
76
- <DrawerRoot
77
- :open
78
- v-bind="rootProps"
79
- :aria-describedby="id"
80
- @close=" emit('close')"
81
- @update:open="(state) => state === false && emit('close')"
82
- >
83
- <DrawerPortal v-bind="portalProps">
84
- <DrawerOverlay class="vui-drawer-overlay" />
85
- <DrawerContent class="vui-drawer-content" :class="{ 'hide-handle': handle === false }">
86
- <div :key="mW" class="vui-drawer-container container" :class="containerClass" :style="{ 'max-width': mW }">
87
- <DrawerTitle class="visually-hidden" :name="id">
88
- {{ title }}
89
- </DrawerTitle>
90
- <slot />
91
- </div>
92
- </DrawerContent>
93
- </DrawerPortal>
94
- </DrawerRoot>
95
- </template>
96
-
97
- <style lang="scss" scoped>
98
- :global(body) {
99
- transition: var(--transition-fast);
100
- background-color: var(--color-bg);
101
- }
102
- </style>
@@ -1,37 +0,0 @@
1
- .vui-drawer-content {
2
- background-color: var(--color-bg-raised);
3
- padding-inline: var(--space-l);
4
- border-top: 1px solid var(--color-border);
5
- border-top-left-radius: var(--border-radius-l);
6
- border-top-right-radius: var(--border-radius-l);
7
- padding-top: 30px;
8
- padding-bottom: 64px;
9
- position: fixed;
10
- bottom: 0;
11
- left: 0;
12
- right: 0;
13
- box-shadow: var(--box-shadow);
14
-
15
- &.hide-handle:before {
16
- display: none;
17
- }
18
-
19
- &.vaul-dragging {
20
- &:before {
21
- background-color: var(--color-text-lighter);
22
- }
23
- }
24
-
25
- &:before {
26
- content: '';
27
- position: absolute;
28
- left: 50%;
29
- transform: translateX(-50%);
30
- width: 56px;
31
- height: 6px;
32
- top: 12px;
33
- border-radius: 3px;
34
- background-color: var(--color-border-strong);
35
- transition: var(--transition-fast);
36
- }
37
- }
@@ -1,120 +0,0 @@
1
- <script setup lang='ts'>
2
- import type { MaybeElement } from '@vueuse/core'
3
- import type { Placement } from '../../shared/types'
4
- import { onClickOutside, useMagicKeys, whenever } from '@vueuse/core'
5
- import { computed, onMounted, ref, useTemplateRef, watch } from 'vue'
6
- import { formatUnitValue } from '../../shared/helpers'
7
- import Popout from '../Popout/Popout.vue'
8
- import './dropdown.scss'
9
-
10
- export interface Props {
11
- /**
12
- * Tooltip placement related to the anchor
13
- */
14
- placement?: Placement
15
- /**
16
- * Set the minimum width of the dropdown element
17
- */
18
- minWidth?: number | string
19
- /**
20
- * Sets the width of the dropdown to the width of its anchor
21
- */
22
- expand?: boolean
23
-
24
- /**
25
- * Set he max height of the dropdown element before it starts scrolling
26
- */
27
- maxHeight?: number | string
28
- }
29
-
30
- const {
31
- placement = 'bottom-start',
32
- maxHeight = 356,
33
- expand,
34
- minWidth = 156,
35
- } = defineProps<Props>()
36
-
37
- const emit = defineEmits<{
38
- close: []
39
- }>()
40
-
41
- const anchorRef = useTemplateRef<HTMLDivElement>('anchor')
42
- const dropdownRef = useTemplateRef<MaybeElement>('dropdown')
43
-
44
- const showMenu = ref(false)
45
-
46
- function open() {
47
- showMenu.value = true
48
- }
49
-
50
- function close() {
51
- showMenu.value = false
52
- }
53
-
54
- function toggle() {
55
- showMenu.value = !showMenu.value
56
- }
57
-
58
- onClickOutside(dropdownRef, (event) => {
59
- // Hide dropdown when it is clicked outside EXCEPT when we click the trigger,
60
- // as that is either by the slot itself
61
- if (!anchorRef.value?.contains(event.target as Node | null))
62
- showMenu.value = false
63
- })
64
-
65
- const anchorWidth = computed(() => {
66
- if (!expand || !window)
67
- return 0
68
- return anchorRef.value?.getBoundingClientRect().width
69
- })
70
-
71
- defineExpose({
72
- open,
73
- close,
74
- toggle,
75
- isOpen: showMenu,
76
- })
77
-
78
- const mW = computed(() => formatUnitValue(minWidth))
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
- })
93
- </script>
94
-
95
- <template>
96
- <div
97
- ref="anchor"
98
- class="vui-dropdown-trigger-wrap"
99
- role="button"
100
- :aria-expanded="showMenu"
101
- :aria-haspopup="true"
102
- name="Dropdown menu"
103
- >
104
- <slot name="trigger" :open :is-open="showMenu" :close :toggle />
105
- </div>
106
-
107
- <Popout
108
- ref="dropdown"
109
- :visible="showMenu"
110
- :anchor="anchorRef"
111
- class="vui-dropdown"
112
- :placement
113
- :style="{
114
- minWidth: expand ? w : mW,
115
- maxHeight: formatUnitValue(maxHeight),
116
- }"
117
- >
118
- <slot :open :close :toggle :is-open="showMenu" />
119
- </Popout>
120
- </template>
@@ -1,33 +0,0 @@
1
- <script setup lang='ts'>
2
- import { Icon } from '@iconify/vue'
3
- import './dropdown-item.scss'
4
-
5
- interface Props {
6
- disabled?: boolean
7
- icon?: string
8
- iconEnd?: string
9
- }
10
-
11
- const props = defineProps<Props>()
12
- </script>
13
-
14
- <template>
15
- <button class="vui-dropdown-item" :class="{ disabled }" :disabled>
16
- <!-- This should always be here to offset items which dont have icons -->
17
- <div v-if="props.icon" class="vui-dropdown-item-icon">
18
- <Icon :icon="props.icon" />
19
- </div>
20
-
21
- <div class="vui-dropdown-item-slot">
22
- <slot />
23
- </div>
24
-
25
- <div v-if="$slots.hint" class="vui-dropdown-item-hint">
26
- <slot name="hint" />
27
- </div>
28
-
29
- <div v-if="props.iconEnd" class="vui-dropdown-item-icon">
30
- <Icon :icon="props.iconEnd" />
31
- </div>
32
- </button>
33
- </template>
@@ -1,14 +0,0 @@
1
- <script lang="ts" setup>
2
- const { sticky } = defineProps<{
3
- sticky?: boolean
4
- }>()
5
- </script>
6
-
7
- <template>
8
- <div class="vui-dropdown-title" :class="{ sticky }">
9
- <slot />
10
- <div v-if="$slots.end" class="vui-dropdown-title-end">
11
- <slot name="end" />
12
- </div>
13
- </div>
14
- </template>
@@ -1,84 +0,0 @@
1
- .vui-dropdown-item {
2
- display: flex;
3
- align-items: center;
4
- justify-content: flex-start;
5
- width: fit-content;
6
- gap: var(--space-xs);
7
- width: 100%;
8
- height: var(--interactive-el-height);
9
- border-radius: var(--border-radius-m);
10
- font-size: var(--font-size-m);
11
- cursor: default;
12
- transition: var(--transition-fast);
13
- padding-inline: var(--space-s);
14
- white-space: nowrap;
15
- margin-bottom: 4px;
16
-
17
- &:last-child {
18
- margin-bottom: 0;
19
- }
20
-
21
- &.disabled {
22
- pointer-events: none;
23
-
24
- &:hover {
25
- background-color: transparent;
26
- }
27
-
28
- .vui-dropdown-item-slot,
29
- .vui-dropdown-item-icon svg path {
30
- color: var(--color-text-lighter);
31
- }
32
-
33
- .vui-dropdown-item-hint {
34
- visibility: hidden;
35
- opacity: 0;
36
- z-index: var(--z-behind);
37
- }
38
- }
39
-
40
- .vui-dropdown-item-icon {
41
- width: 16px;
42
- height: 16px;
43
- display: flex;
44
- align-items: center;
45
- justify-content: center;
46
-
47
- svg {
48
- width: 16px;
49
- height: 16px;
50
-
51
- path {
52
- color: var(--color-text-light);
53
- }
54
- }
55
- }
56
-
57
- .vui-dropdown-item-hint {
58
- display: flex;
59
- align-items: center;
60
- gap: 2px;
61
- margin-left: 8px;
62
- font-size: 0.9rem;
63
- // white-space: nowrap;
64
- color: var(--color-text-lighter);
65
-
66
- svg {
67
- color: var(--color-text-lighter);
68
- }
69
- }
70
-
71
- .vui-dropdown-item-slot {
72
- flex: 1;
73
- display: flex;
74
- align-items: center;
75
- justify-content: flex-start;
76
- color: var(--color-text);
77
- flex-wrap: nowrap;
78
- }
79
-
80
- &.selected,
81
- &:hover {
82
- background-color: var(--color-button-gray-hover);
83
- }
84
- }
@@ -1,53 +0,0 @@
1
- .vui-dropdown-trigger-wrap {
2
- // width: fit-content;
3
- position: relative;
4
- }
5
-
6
- .vui-dropdown {
7
- min-width: 156px;
8
- border-radius: var(--border-radius-m);
9
- border: 1px solid var(--color-border);
10
- padding: 4px;
11
- overflow-y: auto;
12
- }
13
-
14
- .vui-dropdown-title {
15
- position: relative;
16
- display: flex;
17
- align-items: center;
18
- justify-content: flex-start;
19
- padding-block: var(--space-xs);
20
- padding-inline: calc(var(--space-xs) + 8px);
21
- font-size: var(--font-size-m);
22
- border-bottom: 1px solid var(--color-border);
23
- font-weight: var(--font-weight-semibold);
24
- margin-inline: -4px;
25
- margin-top: -4px;
26
- margin-bottom: 4px;
27
- gap: var(--space-m);
28
- justify-content: space-between;
29
- background-color: var(--color-bg-medium);
30
- z-index: var(--z-popout);
31
-
32
- &.sticky {
33
- position: sticky;
34
- top: -4px;
35
- }
36
-
37
- &:not(:first-child) {
38
- margin-top: 4px;
39
- border-top: 1px solid var(--color-border);
40
- }
41
-
42
- .vui-dropdown-title-end {
43
- font-size: var(--font-size-s);
44
- font-weight: var(--font-weight);
45
- color: var(--color-text-lighter);
46
- }
47
- }
48
-
49
- :root.light {
50
- .vui-dropdown-title {
51
- background-color: var(--color-bg);
52
- }
53
- }
@@ -1,113 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Space } from '../../shared/types'
3
- import { computed } from 'vue'
4
- import { formatUnitValue } from '../../shared/helpers'
5
-
6
- export interface FlexProps {
7
- inline?: boolean
8
- wrap?: boolean
9
- wrapReverse?: boolean
10
-
11
- row?: boolean
12
- column?: boolean
13
- rowReverse?: boolean
14
- columnReverse?: boolean
15
-
16
- gap?: Space | number
17
-
18
- // NOTE: Add more if needed
19
- xStart?: boolean
20
- xEnd?: boolean
21
- xCenter?: boolean
22
- xBetween?: boolean
23
- xAround?: boolean
24
- xEvenly?: boolean
25
-
26
- // NOTE: Add more if needed
27
- yCenter?: boolean
28
- yStart?: boolean
29
- yEnd?: boolean
30
- yBaseline?: boolean
31
-
32
- expand?: boolean
33
- }
34
-
35
- const props = withDefaults(defineProps<FlexProps>(), {
36
- // eslint-disable-next-line vue/require-valid-default-prop
37
- gap: 's',
38
- })
39
-
40
- // Flex gap
41
- const ag = computed(() => typeof props.gap === 'number'
42
- ? formatUnitValue(props.gap)
43
- : `var(--space-${props.gap})`,
44
- )
45
-
46
- // Flex direction
47
- const ad = computed(() => {
48
- if (props.row)
49
- return 'row'
50
- else if (props.column)
51
- return 'column'
52
- else if (props.rowReverse)
53
- return 'row-reverse'
54
- else if (props.columnReverse)
55
- return 'column-reverse'
56
- else return 'row'
57
- })
58
-
59
- // Justify content
60
- const aj = computed(() => {
61
- if (props.xStart)
62
- return 'flex-start'
63
- else if (props.xEnd)
64
- return 'flex-end'
65
- else if (props.xCenter)
66
- return 'center'
67
- else if (props.xBetween)
68
- return 'space-between'
69
- else if (props.xEvenly)
70
- return 'space-evenly'
71
- else if (props.xAround)
72
- return 'space-around'
73
- else return 'flex-start'
74
- })
75
-
76
- // Align items
77
- const aA = computed(() => {
78
- if (props.yStart)
79
- return 'flex-start'
80
- else if (props.yEnd)
81
- return 'flex-end'
82
- else if (props.yCenter)
83
- return 'center'
84
- else if (props.yBaseline)
85
- return 'baseline'
86
- return 'flex-start'
87
- })
88
-
89
- const aY = computed(() => props.inline ? 'inline-flex' : 'flex')
90
- const aW = computed(() => props.wrap
91
- ? 'wrap'
92
- : props.wrapReverse
93
- ? 'wrap-reverse'
94
- : 'nowrap')
95
-
96
- const aH = computed(() => props.expand ? '100%' : 'auto')
97
- </script>
98
-
99
- <template>
100
- <div
101
- class="vui-flex" :style="{
102
- display: aY,
103
- flexWrap: aW,
104
- flexDirection: ad,
105
- justifyContent: aj,
106
- gap: ag,
107
- alignItems: aA,
108
- width: aH,
109
- }"
110
- >
111
- <slot />
112
- </div>
113
- </template>
@@ -1,87 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Space } from '../../shared/types'
3
- import { computed } from 'vue'
4
- import { createArray, formatUnitValue } from '../../shared/helpers'
5
-
6
- /**
7
- * This component is not meant for complex grids
8
- */
9
-
10
- interface Props {
11
- inline?: boolean
12
- gap?: Space | number
13
- rows?: number | string
14
- columns?: number | string
15
- // areas?: string[]
16
-
17
- // NOTE: Add more if needed
18
- yCenter?: boolean
19
- yStart?: boolean
20
- yEnd?: boolean
21
- yBaseline?: boolean
22
- yStretch?: boolean
23
-
24
- expand?: boolean
25
- }
26
-
27
- const props = withDefaults(defineProps<Props>(), {
28
- // eslint-disable-next-line vue/require-valid-default-prop
29
- gap: 's',
30
- })
31
-
32
- const ag = computed(() => typeof props.gap === 'number'
33
- ? formatUnitValue(props.gap)
34
- : `var(--space-${props.gap})`,
35
- )
36
-
37
- const aTC = computed(() => {
38
- if (typeof props.columns === 'number') {
39
- return createArray(props.columns)
40
- .map(() => '1fr')
41
- .join(' ')
42
- }
43
- return props.columns ?? 'none'
44
- })
45
-
46
- const aTR = computed(() => {
47
- if (typeof props.rows === 'number') {
48
- return createArray(props.rows || 1)
49
- .map(() => '')
50
- .join('1fr')
51
- }
52
- return props.rows ?? 'none'
53
- })
54
-
55
- const aA = computed(() => {
56
- if (props.yStart)
57
- return 'flex-start'
58
- else if (props.yEnd)
59
- return 'flex-end'
60
- else if (props.yCenter)
61
- return 'center'
62
- else if (props.yBaseline)
63
- return 'baseline'
64
- else if (props.yStretch)
65
- return 'stretch'
66
- return 'flex-start'
67
- })
68
-
69
- const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
70
-
71
- const aH = computed(() => props.expand ? '100%' : 'auto')
72
- </script>
73
-
74
- <template>
75
- <div
76
- class="vui-grid" :style="{
77
- display: aD,
78
- gap: ag,
79
- gridTemplateColumns: aTC,
80
- gridTemplateRows: aTR,
81
- alignItems: aA,
82
- width: aH,
83
- }"
84
- >
85
- <slot />
86
- </div>
87
- </template>
@@ -1,26 +0,0 @@
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>