@dolanske/vui 0.1.0 → 0.1.1

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 (161) hide show
  1. package/README.md +7 -0
  2. package/dist/components/Accordion/Accordion.vue.d.ts +45 -0
  3. package/dist/components/Accordion/AccordionGroup.vue.d.ts +32 -0
  4. package/dist/components/Alert/Alert.vue.d.ts +29 -0
  5. package/dist/components/Avatar/Avatar.vue.d.ts +9 -0
  6. package/dist/components/Badge/Badge.vue.d.ts +21 -0
  7. package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +21 -0
  8. package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +27 -0
  9. package/dist/components/Button/Button.vue.d.ts +41 -0
  10. package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +19 -0
  11. package/dist/components/Calendar/Calendar.vue.d.ts +27 -0
  12. package/dist/components/Card/Card.vue.d.ts +25 -0
  13. package/dist/components/Checkbox/Checkbox.vue.d.ts +31 -0
  14. package/dist/components/CopyClipboard/CopyClipboard.vue.d.ts +40 -0
  15. package/dist/components/Divider/Divider.vue.d.ts +24 -0
  16. package/dist/components/Drawer/Drawer.vue.d.ts +52 -0
  17. package/dist/components/Dropdown/DropdownItem.vue.d.ts +21 -0
  18. package/dist/components/Dropdown/DropdownTitle.vue.d.ts +17 -0
  19. package/dist/components/Flex/Flex.vue.d.ts +38 -0
  20. package/dist/components/Grid/Grid.vue.d.ts +27 -0
  21. package/dist/components/Input/Counter.vue.d.ts +19 -0
  22. package/dist/components/Input/Dropzone.vue.d.ts +107 -0
  23. package/dist/components/Input/File.vue.d.ts +7 -0
  24. package/dist/components/Input/Input.vue.d.ts +54 -0
  25. package/dist/components/Input/Password.vue.d.ts +6 -0
  26. package/dist/components/Input/Textarea.vue.d.ts +30 -0
  27. package/dist/components/Kbd/Kbd.vue.d.ts +23 -0
  28. package/dist/components/Kbd/KbdGroup.vue.d.ts +31 -0
  29. package/dist/components/Modal/Confirm.vue.d.ts +45 -0
  30. package/dist/components/Modal/Modal.vue.d.ts +55 -0
  31. package/dist/components/Pagination/Pagination.vue.d.ts +42 -0
  32. package/dist/components/Pagination/pagination.d.ts +12 -0
  33. package/dist/components/Popout/Popout.vue.d.ts +34 -0
  34. package/dist/components/Progress/Progress.vue.d.ts +31 -0
  35. package/dist/components/Radio/Radio.vue.d.ts +27 -0
  36. package/dist/components/Radio/RadioGroup.vue.d.ts +40 -0
  37. package/dist/components/Select/Select.vue.d.ts +37 -0
  38. package/dist/components/Sheet/Sheet.vue.d.ts +35 -0
  39. package/dist/components/Skeleton/Skeleton.vue.d.ts +8 -0
  40. package/dist/components/Spinner/Spinner.vue.d.ts +6 -0
  41. package/dist/components/Switch/Switch.vue.d.ts +26 -0
  42. package/dist/components/Table/Cell.vue.d.ts +19 -0
  43. package/dist/components/Table/Header.vue.d.ts +29 -0
  44. package/dist/components/Table/Row.vue.d.ts +16 -0
  45. package/dist/components/Table/SelectAll.vue.d.ts +2 -0
  46. package/dist/components/Table/SelectRow.vue.d.ts +6 -0
  47. package/dist/components/Table/Table.vue.d.ts +40 -0
  48. package/dist/components/Table/table.d.ts +68 -0
  49. package/dist/components/Tabs/Tab.vue.d.ts +8 -0
  50. package/dist/components/Tabs/Tabs.vue.d.ts +43 -0
  51. package/dist/components/Toast/Toasts.vue.d.ts +2 -0
  52. package/dist/components/Toast/toast.d.ts +42 -0
  53. package/dist/components/Tooltip/Tooltip.vue.d.ts +32 -0
  54. package/dist/index.d.ts +54 -1
  55. package/dist/internal/Backdrop/Backdrop.vue.d.ts +20 -0
  56. package/dist/shared/composables.d.ts +3 -0
  57. package/dist/shared/helpers.d.ts +16 -0
  58. package/dist/shared/types.d.ts +10 -0
  59. package/dist/style.css +1 -1
  60. package/package.json +11 -9
  61. package/src/App.vue +158 -0
  62. package/src/components/Accordion/Accordion.vue +75 -0
  63. package/src/components/Accordion/AccordionGroup.vue +43 -0
  64. package/src/components/Accordion/accordion.scss +44 -0
  65. package/src/components/Alert/Alert.vue +53 -0
  66. package/src/components/Alert/alert.scss +80 -0
  67. package/src/components/Avatar/Avatar.vue +36 -0
  68. package/src/components/Avatar/avatar.scss +46 -0
  69. package/src/components/Badge/Badge.vue +21 -0
  70. package/src/components/Badge/badge.scss +89 -0
  71. package/src/components/Breadcrumbs/BreadcrumbItem.vue +26 -0
  72. package/src/components/Breadcrumbs/Breadcrumbs.vue +33 -0
  73. package/src/components/Breadcrumbs/breadcrumbs.scss +30 -0
  74. package/src/components/Button/Button.vue +90 -0
  75. package/src/components/Button/button.scss +176 -0
  76. package/src/components/ButtonGroup/ButtonGroup.vue +25 -0
  77. package/src/components/ButtonGroup/button-group.scss +51 -0
  78. package/src/components/Calendar/Calendar.vue +58 -0
  79. package/src/components/Calendar/calendar.scss +56 -0
  80. package/src/components/Card/Card.vue +48 -0
  81. package/src/components/Card/card.scss +53 -0
  82. package/src/components/Checkbox/Checkbox.vue +49 -0
  83. package/src/components/Checkbox/checkbox.scss +60 -0
  84. package/src/components/CopyClipboard/CopyClipboard.vue +82 -0
  85. package/src/components/CopyClipboard/copy-clipboard.scss +17 -0
  86. package/src/components/Divider/Divider.vue +34 -0
  87. package/src/components/Divider/divider.scss +35 -0
  88. package/src/components/Drawer/Drawer.vue +93 -0
  89. package/src/components/Drawer/drawer.scss +49 -0
  90. package/src/components/Dropdown/Dropdown.vue +100 -0
  91. package/src/components/Dropdown/DropdownItem.vue +29 -0
  92. package/src/components/Dropdown/DropdownTitle.vue +8 -0
  93. package/src/components/Dropdown/dropdown.scss +112 -0
  94. package/src/components/Flex/Flex.vue +109 -0
  95. package/src/components/Grid/Grid.vue +59 -0
  96. package/src/components/Input/Counter.vue +70 -0
  97. package/src/components/Input/Dropzone.vue +63 -0
  98. package/src/components/Input/File.vue +15 -0
  99. package/src/components/Input/Input.vue +118 -0
  100. package/src/components/Input/Password.vue +47 -0
  101. package/src/components/Input/Textarea.vue +73 -0
  102. package/src/components/Input/input.scss +199 -0
  103. package/src/components/Kbd/Kbd.vue +48 -0
  104. package/src/components/Kbd/KbdGroup.vue +31 -0
  105. package/src/components/Kbd/kbd.scss +18 -0
  106. package/src/components/Modal/Confirm.vue +56 -0
  107. package/src/components/Modal/Modal.vue +91 -0
  108. package/src/components/Modal/modal.scss +49 -0
  109. package/src/components/Pagination/Pagination.vue +74 -0
  110. package/src/components/Pagination/pagination.ts +78 -0
  111. package/src/components/Popout/Popout.vue +39 -0
  112. package/src/components/Popout/popout.scss +7 -0
  113. package/src/components/Progress/Progress.vue +84 -0
  114. package/src/components/Progress/progress.scss +41 -0
  115. package/src/components/Radio/Radio.vue +36 -0
  116. package/src/components/Radio/RadioGroup.vue +35 -0
  117. package/src/components/Radio/radio.scss +59 -0
  118. package/src/components/Select/Select.vue +180 -0
  119. package/src/components/Select/select.scss +43 -0
  120. package/src/components/Sheet/Sheet.vue +91 -0
  121. package/src/components/Sheet/sheet.scss +56 -0
  122. package/src/components/Skeleton/Skeleton.vue +46 -0
  123. package/src/components/Skeleton/skeleton.scss +14 -0
  124. package/src/components/Spinner/Spinner.vue +44 -0
  125. package/src/components/Spinner/spinner.scss +46 -0
  126. package/src/components/Switch/Switch.vue +30 -0
  127. package/src/components/Switch/switch.scss +52 -0
  128. package/src/components/Table/Cell.vue +23 -0
  129. package/src/components/Table/Header.vue +59 -0
  130. package/src/components/Table/Row.vue +9 -0
  131. package/src/components/Table/SelectAll.vue +23 -0
  132. package/src/components/Table/SelectRow.vue +29 -0
  133. package/src/components/Table/Table.vue +66 -0
  134. package/src/components/Table/table.scss +134 -0
  135. package/src/components/Table/table.ts +243 -0
  136. package/src/components/Tabs/Tab.vue +21 -0
  137. package/src/components/Tabs/Tabs.vue +76 -0
  138. package/src/components/Tabs/tabs.scss +78 -0
  139. package/src/components/Toast/Toasts.vue +47 -0
  140. package/src/components/Toast/toast.scss +41 -0
  141. package/src/components/Toast/toast.ts +92 -0
  142. package/src/components/Tooltip/Tooltip.vue +80 -0
  143. package/src/components/Tooltip/tooltip.scss +4 -0
  144. package/src/index.scss +1 -0
  145. package/src/index.ts +111 -0
  146. package/src/internal/Backdrop/Backdrop.vue +22 -0
  147. package/src/internal/Backdrop/backdrop.scss +28 -0
  148. package/src/main.ts +5 -0
  149. package/src/shared/composables.ts +18 -0
  150. package/src/shared/helpers.ts +53 -0
  151. package/src/shared/types.ts +11 -0
  152. package/src/style/animation.scss +21 -0
  153. package/src/style/core.scss +128 -0
  154. package/src/style/fonts.scss +0 -0
  155. package/src/style/layout.scss +9 -0
  156. package/src/style/media-query.scss +29 -0
  157. package/src/style/reset.scss +135 -0
  158. package/src/style/tooltip.scss +128 -0
  159. package/src/style/typography.scss +339 -0
  160. package/src/style/utils.scss +22 -0
  161. package/src/vite-env.d.ts +1 -0
@@ -0,0 +1,176 @@
1
+ .vui-button {
2
+ --button-height: 32px;
3
+ --button-padding: 8px;
4
+
5
+ &.disabled {
6
+ pointer-events: none;
7
+ color: var(--color-text-lighter) !important;
8
+ cursor: not-allowed !important;
9
+ filter: saturate(50%) opacity(0.65);
10
+
11
+ svg path {
12
+ color: var(--color-text-lighter) !important;
13
+ }
14
+ }
15
+
16
+ &.expand {
17
+ width: 100%;
18
+ }
19
+
20
+ &.loading {
21
+ .vui-spinner {
22
+ opacity: 1;
23
+ }
24
+
25
+ .vui-button-slot {
26
+ opacity: 0;
27
+ }
28
+ }
29
+
30
+ &.icon {
31
+ width: var(--button-height);
32
+ padding: 0;
33
+
34
+ .vui-button-slot {
35
+ svg {
36
+ width: 18px;
37
+ height: 18px;
38
+ }
39
+ }
40
+ }
41
+
42
+ &.square {
43
+ width: var(--button-height);
44
+ padding: 0;
45
+ }
46
+
47
+ &.dashed {
48
+ border-style: dashed;
49
+ }
50
+
51
+ height: var(--button-height);
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ border-radius: var(--border-radius-s);
56
+ background: transparent;
57
+ padding-inline: var(--button-padding);
58
+ font-size: var(--font-size-s);
59
+ position: relative;
60
+ transition: var(--transition);
61
+ border: 1px solid transparent;
62
+ background-color: transparent;
63
+ color: var(--color-text);
64
+
65
+ // Default gray
66
+
67
+ .vui-button-slot {
68
+ display: flex;
69
+ place-items: center;
70
+ transition: var(--transition);
71
+ opacity: 1;
72
+ }
73
+
74
+ .vui-button-slot-start,
75
+ .vui-button-slot-end {
76
+ display: flex;
77
+ place-items: center;
78
+ }
79
+
80
+ .vui-button-slot-start {
81
+ margin-right: 6px;
82
+ }
83
+
84
+ .vui-button-slot-end {
85
+ margin-left: 6px;
86
+ }
87
+
88
+ .vui-spinner {
89
+ transition: var(--transition);
90
+ opacity: 0;
91
+ position: absolute;
92
+ pointer-events: none;
93
+ }
94
+
95
+ // Variants
96
+ &.vui-button-variant-default {
97
+ &:not(.plain) {
98
+ color: var(--color-text);
99
+ background-color: var(--color-button-gray);
100
+ border: 1px solid var(--color-border);
101
+ }
102
+
103
+ &.active,
104
+ &:hover {
105
+ background-color: var(--color-button-gray-hover);
106
+ }
107
+ }
108
+
109
+ &.vui-button-variant-danger {
110
+ &:not(.plain) {
111
+ color: var(--color-text);
112
+ background-color: var(--color-bg-red-lowered);
113
+ border: 1px solid var(--color-border-red);
114
+ }
115
+
116
+ &.active,
117
+ &:hover {
118
+ border: 1px solid var(--color-bg-red-raised);
119
+ background-color: var(--color-bg-red-raised);
120
+ }
121
+ }
122
+
123
+ &.vui-button-variant-success {
124
+ &:not(.plain) {
125
+ color: var(--color-text);
126
+ background-color: var(--color-bg-green-lowered);
127
+ border: 1px solid var(--color-border-green);
128
+ }
129
+
130
+ &.active,
131
+ &:hover {
132
+ border: 1px solid var(--color-bg-green-raised);
133
+ background-color: var(--color-bg-green-raised);
134
+ }
135
+ }
136
+
137
+ &.vui-button-variant-blue {
138
+ &:not(.plain) {
139
+ color: var(--color-text);
140
+ background-color: var(--color-bg-blue-lowered);
141
+ border: 1px solid var(--color-border-blue);
142
+ }
143
+
144
+ &.active,
145
+ &:hover {
146
+ border: 1px solid var(--color-bg-blue-raised);
147
+ background-color: var(--color-bg-blue-raised);
148
+ }
149
+ }
150
+
151
+ &.vui-button-variant-accent {
152
+ &:not(.plain) {
153
+ color: var(--color-text);
154
+ background-color: var(--color-bg-accent-lowered);
155
+ border: 1px solid var(--color-border-accent);
156
+ }
157
+
158
+ &.active,
159
+ &:hover {
160
+ border: 1px solid var(--color-bg-accent-raised);
161
+ background-color: var(--color-bg-accent-raised);
162
+ }
163
+ }
164
+
165
+ &.vui-button-variant-link {
166
+ color: var(--color-text);
167
+ background: transparent;
168
+ text-underline-offset: 4px;
169
+ cursor: pointer;
170
+
171
+ &.active,
172
+ &:hover {
173
+ text-decoration: underline;
174
+ }
175
+ }
176
+ }
@@ -0,0 +1,25 @@
1
+ <script setup lang='ts'>
2
+ import Flex from '../Flex/Flex.vue'
3
+ import './button-group.scss'
4
+
5
+ interface Props {
6
+ vertical?: boolean
7
+ }
8
+
9
+ const {
10
+ vertical,
11
+ } = defineProps<Props>()
12
+ </script>
13
+
14
+ <template>
15
+ <Flex
16
+ :row="!vertical"
17
+ :column="vertical"
18
+ class="vui-button-group"
19
+ :class="{ vertical }"
20
+ :gap="0"
21
+ inline
22
+ >
23
+ <slot />
24
+ </Flex>
25
+ </template>
@@ -0,0 +1,51 @@
1
+ .vui-button-group {
2
+ .vui-button {
3
+ z-index: 1;
4
+
5
+ &:hover {
6
+ z-index: 2;
7
+ }
8
+
9
+ &:not(:first-child, :last-child) {
10
+ border-radius: 0;
11
+ }
12
+
13
+ &:first-child {
14
+ border-top-right-radius: 0;
15
+ border-bottom-right-radius: 0;
16
+ }
17
+
18
+ &:last-child {
19
+ border-top-left-radius: 0;
20
+ border-bottom-left-radius: 0;
21
+ }
22
+
23
+ &:not(:last-child) {
24
+ margin-right: -1px;
25
+ }
26
+ }
27
+
28
+ &.vertical {
29
+ .vui-button {
30
+ width: 100%;
31
+
32
+ &:not(:first-child, :last-child) {
33
+ border-radius: 0;
34
+ }
35
+
36
+ &:first-child {
37
+ border-bottom-left-radius: 0;
38
+ border-bottom-right-radius: 0;
39
+ }
40
+
41
+ &:last-child {
42
+ border-top-left-radius: 0;
43
+ border-top-right-radius: 0;
44
+ }
45
+
46
+ &:not(:last-child) {
47
+ margin-bottom: -1px;
48
+ }
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,58 @@
1
+ <script setup lang='ts'>
2
+ import type { VueDatePickerProps } from '@vuepic/vue-datepicker'
3
+ import { Icon } from '@iconify/vue'
4
+ import VueDatePicker from '@vuepic/vue-datepicker'
5
+ import '@vuepic/vue-datepicker/dist/main.css'
6
+ import './calendar.scss'
7
+
8
+ const props = withDefaults(defineProps<VueDatePickerProps & {
9
+ expand?: boolean
10
+ }>(), {
11
+ autoApply: true,
12
+ autoPosition: true,
13
+ dark: true,
14
+ format: 'dd/MM/yyyy HH:mm',
15
+ expand: false,
16
+ })
17
+ </script>
18
+
19
+ <template>
20
+ <VueDatePicker
21
+ v-bind="props"
22
+ :style="props.expand || !$slots.trigger
23
+ ? undefined
24
+ : { display: 'inline-block', width: 'auto' }
25
+ "
26
+ >
27
+ <!-- Icon slots -->
28
+ <template #input-icon>
29
+ <Icon :width="18" :height="18" icon="ph:calendar-blank" />
30
+ </template>
31
+ <template #calendar-icon>
32
+ <Icon :width="18" :height="18" icon="ph:calendar-blank" />
33
+ </template>
34
+ <template #clear-icon>
35
+ <Icon :width="18" :height="18" icon="ph:x" />
36
+ </template>
37
+ <template #clock-icon>
38
+ <Icon :width="18" :height="18" icon="ph:clock" />
39
+ </template>
40
+ <template #arrow-left>
41
+ <Icon :width="18" :height="18" icon="ph:caret-left" />
42
+ </template>
43
+ <template #arrow-right>
44
+ <Icon :width="18" :height="18" icon="ph:caret-right" />
45
+ </template>
46
+ <template #arrow-up>
47
+ <Icon :width="18" :height="18" icon="ph:caret-up" />
48
+ </template>
49
+ <template #arrow-down>
50
+ <Icon :width="18" :height="18" icon="ph:caret-down" />
51
+ </template>
52
+
53
+ <!-- Content slots -->
54
+ <template v-if="$slots.trigger" #trigger>
55
+ <slot name="trigger" />
56
+ </template>
57
+ </VueDatePicker>
58
+ </template>
@@ -0,0 +1,56 @@
1
+ .dp__theme_dark {
2
+ --dp-background-color: var(--color-bg);
3
+ --dp-text-color: var(--color-text);
4
+ --dp-hover-color: var(--color-button-gray-hover);
5
+ --dp-hover-text-color: var(--color-text);
6
+ --dp-hover-icon-color: var(--color-text-lighter);
7
+ --dp-primary-color: var(--color-accent);
8
+ --dp-primary-disabled-color: var(--color-accent-disabled);
9
+ --dp-primary-text-color: var(--color-text-invert);
10
+ --dp-secondary-color: var(--color-border);
11
+ --dp-border-color: var(--color-border);
12
+ --dp-menu-border-color: var(--color-border);
13
+ --dp-border-color-hover: var(--color-border-strong);
14
+ --dp-border-color-focus: var(--color-border-strong);
15
+ --dp-disabled-color: var(--color-bg-raised);
16
+ --dp-disabled-color-text: var(--color-text-light);
17
+ --dp-scroll-bar-background: var(--color-bg-lowered);
18
+ --dp-scroll-bar-color: var(--color-border);
19
+ --dp-success-color: var(--color-green);
20
+ --dp-success-color-disabled: var(--color-green-disabled);
21
+ --dp-icon-color: var(--color-text-light);
22
+ --dp-danger-color: var(--color-red);
23
+ --dp-marker-color: var(--color-red);
24
+ --dp-tooltip-color: var(--color-bg-raised);
25
+ --dp-highlight-color: var(--color-bg-raised);
26
+ --dp-range-between-dates-background-color: var(--dp-hover-color, #484848);
27
+ --dp-range-between-dates-text-color: var(--dp-hover-text-color, #fff);
28
+ --dp-range-between-border-color: var(--dp-hover-color, #fff);
29
+ }
30
+
31
+ :root {
32
+ --dp-font-family: var(--global-font);
33
+ --dp-border-radius: var(--border-radius-s);
34
+ --dp-cell-border-radius: var(--border-radius-s);
35
+ --dp-common-transition: var(--transition);
36
+
37
+ --dp-font-size: var(--font-size-ms);
38
+ --dp-preview-font-size: var(--font-size-s);
39
+ --dp-time-font-size: var(--font-size-s);
40
+ }
41
+
42
+ .dp__main {
43
+ font-size: var(--n-font-size-m);
44
+ }
45
+
46
+ .dp__outer_menu_wrap {
47
+ box-shadow: var(--box-shadow-strong);
48
+ }
49
+
50
+ .dp__input_icon {
51
+ inset-inline-start: 8px;
52
+ }
53
+
54
+ .dp--clear-btn {
55
+ inset-inline-end: 8px;
56
+ }
@@ -0,0 +1,48 @@
1
+ <script setup lang="ts">
2
+ import Divider from '../Divider/Divider.vue'
3
+ import './card.scss'
4
+
5
+ export interface Props {
6
+ separators?: boolean
7
+ headerSeparator?: boolean
8
+ footerSeparator?: boolean
9
+ padding?: boolean
10
+ }
11
+
12
+ const {
13
+ padding = true,
14
+ separators,
15
+ headerSeparator,
16
+ footerSeparator,
17
+ } = defineProps<Props>()
18
+ </script>
19
+
20
+ <template>
21
+ <div
22
+ class="vui-card" :class="{
23
+ separators,
24
+ 'header-separator': headerSeparator,
25
+ 'footer-separator': footerSeparator,
26
+ 'no-padding': !padding,
27
+ }"
28
+ >
29
+ <div v-if="$slots.header || $slots['header-end']" class="vui-card-header">
30
+ <div>
31
+ <slot name="header" />
32
+ </div>
33
+ <slot name="header-end" />
34
+ </div>
35
+
36
+ <Divider v-if="(separators || headerSeparator) && ($slots.header || $slots['header-end'])" :size="1" />
37
+
38
+ <div v-if="$slots.default" class="vui-card-content">
39
+ <slot />
40
+ </div>
41
+
42
+ <Divider v-if="(separators || footerSeparator) && $slots.footer" :size="1" />
43
+
44
+ <div v-if="$slots.footer" class="vui-card-footer">
45
+ <slot name="footer" />
46
+ </div>
47
+ </div>
48
+ </template>
@@ -0,0 +1,53 @@
1
+ .vui-card {
2
+ background-color: var(--color-bg);
3
+ border-radius: var(--border-radius-m);
4
+ border: 1px solid var(--color-border);
5
+
6
+ &.no-padding {
7
+ .vui-card-header,
8
+ .vui-card-content,
9
+ .vui-card-footer {
10
+ padding: 0;
11
+ }
12
+ }
13
+
14
+ &:not(.separators) {
15
+ .vui-card-content:not(:first-child) {
16
+ padding-block: var(--space-xs);
17
+ }
18
+
19
+ &.header-separator {
20
+ .vui-card-content:not(:first-child) {
21
+ padding-top: var(--space-m);
22
+ // padding-block: var(--space-m);
23
+ }
24
+ }
25
+
26
+ &.footer-separator {
27
+ .vui-card-content {
28
+ padding-bottom: var(--space-m);
29
+ }
30
+ }
31
+ }
32
+
33
+ .vui-card-header {
34
+ display: flex;
35
+ align-items: flex-start;
36
+ justify-content: space-between;
37
+ padding: var(--space-s) var(--space-m);
38
+ background-color: var(--color-bg);
39
+ border-top-left-radius: var(--border-radius-m);
40
+ border-top-right-radius: var(--border-radius-m);
41
+ }
42
+
43
+ .vui-card-content {
44
+ padding: var(--space-m);
45
+ }
46
+
47
+ .vui-card-footer {
48
+ padding: var(--space-s) var(--space-m);
49
+ background-color: var(--color-bg);
50
+ border-bottom-left-radius: var(--border-radius-m);
51
+ border-bottom-right-radius: var(--border-radius-m);
52
+ }
53
+ }
@@ -0,0 +1,49 @@
1
+ <script setup lang="ts">
2
+ import { Icon } from '@iconify/vue'
3
+ import { useId } from 'vue'
4
+ import './checkbox.scss'
5
+
6
+ interface Props {
7
+ label?: string
8
+ iconOn?: string
9
+ iconOff?: string
10
+ disabled?: boolean
11
+ checked?: boolean
12
+ }
13
+
14
+ const {
15
+ label,
16
+ iconOn = 'ph:check-square-fill',
17
+ iconOff = 'ph:square',
18
+ disabled,
19
+ checked: checkedProp,
20
+ } = defineProps<Props>()
21
+ const emit = defineEmits<{
22
+ change: [checked: boolean]
23
+ }>()
24
+ const slots = defineSlots()
25
+ const checked = defineModel<boolean>()
26
+ const id = useId()
27
+ </script>
28
+
29
+ <template>
30
+ <div class="vui-checkbox" :class="{ disabled: !!disabled, checked }">
31
+ <input
32
+ :id
33
+ v-model="checked"
34
+ type="checkbox"
35
+ :disabled
36
+ :checked="checkedProp"
37
+ @change="emit('change', ($event.target as HTMLInputElement).checked)"
38
+ >
39
+ <label :for="id">
40
+ <span class="vui-checkbox-icon">
41
+ <Icon :icon="checked ? iconOn : iconOff" />
42
+ </span>
43
+ <p v-if="label" class="vui-checkbox-content">{{ label }}</p>
44
+ <div v-else-if="slots.default" class="vui-checkbox-content">
45
+ <slot />
46
+ </div>
47
+ </label>
48
+ </div>
49
+ </template>
@@ -0,0 +1,60 @@
1
+ .vui-checkbox {
2
+ --checkbox-size: 24px;
3
+
4
+ &.checked {
5
+ .vui-checkbox-icon svg {
6
+ color: var(--color-text);
7
+ }
8
+ }
9
+
10
+ &.disabled {
11
+ cursor: not-allowed;
12
+ pointer-events: none;
13
+
14
+ .vui-checkbox-icon svg path {
15
+ color: var(--color-text-lighter);
16
+ }
17
+
18
+ input + label p {
19
+ color: var(--color-text-lighter);
20
+ }
21
+ }
22
+
23
+ .vui-checkbox-icon {
24
+ cursor: pointer;
25
+ width: var(--checkbox-size);
26
+ height: var(--checkbox-size);
27
+
28
+ svg {
29
+ width: 100%;
30
+ height: 100%;
31
+ color: var(--color-text);
32
+ }
33
+ }
34
+
35
+ input {
36
+ display: none;
37
+
38
+ & + label {
39
+ display: grid;
40
+ grid-template-columns: 20px 1fr;
41
+ gap: 10px;
42
+ font-size: var(--font-size-m);
43
+ color: var(--color-text);
44
+ user-select: none;
45
+ align-items: baseline;
46
+
47
+ .vui-checkbox-content {
48
+ display: block;
49
+
50
+ &:is(p) {
51
+ display: flex;
52
+ align-items: center;
53
+ min-height: var(--checkbox-size);
54
+ font-size: var(--font-size-ms);
55
+ // line-height: var(--checkbox-size);
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,82 @@
1
+ <script setup lang='ts'>
2
+ import { autoUpdate, flip, offset, shift, useFloating } from '@floating-ui/vue'
3
+ import { Icon } from '@iconify/vue'
4
+ import { useClipboard } from '@vueuse/core'
5
+ import { onBeforeMount, useSlots, useTemplateRef } from 'vue'
6
+ import Flex from '../Flex/Flex.vue'
7
+ import './copy-clipboard.scss'
8
+
9
+ interface Props {
10
+ /**
11
+ * Text to copy
12
+ */
13
+ text: string
14
+ /**
15
+ * Wether to show a tooltip after successful copy
16
+ */
17
+ confirm?: string | boolean
18
+ /**
19
+ * How long will the copy confirmation tooltip be visible in milliseconds.
20
+ */
21
+ confirmTime?: number
22
+ }
23
+
24
+ const {
25
+ text,
26
+ confirm,
27
+ confirmTime,
28
+ } = defineProps<Props>()
29
+
30
+ const {
31
+ copy,
32
+ copied,
33
+ isSupported,
34
+ } = useClipboard({
35
+ copiedDuring: confirmTime,
36
+ })
37
+ const slots = useSlots()
38
+
39
+ onBeforeMount(() => {
40
+ if (!isSupported.value) {
41
+ console.error('Clipboard API is not supported. This component will not work')
42
+ }
43
+
44
+ if (confirm && slots.confirm) {
45
+ console.warn('You are using the \'confirm\' prop and slot. The slot will take precedence.')
46
+ }
47
+ })
48
+
49
+ const anchorRef = useTemplateRef('anchorRef')
50
+ const tooltipRef = useTemplateRef('tooltipRef')
51
+
52
+ const { floatingStyles } = useFloating(anchorRef, tooltipRef, {
53
+ whileElementsMounted: autoUpdate,
54
+ transform: false,
55
+ placement: 'top',
56
+ middleware: [
57
+ offset(8),
58
+ shift(),
59
+ flip(),
60
+ ],
61
+ })
62
+ </script>
63
+
64
+ <template>
65
+ <div ref="anchorRef" class="vui-clipboard-copy-wrap" role="button" @click="copy(text)">
66
+ <slot :copy :copied />
67
+ </div>
68
+
69
+ <Transition name="fade-up" mode="in-out">
70
+ <div v-if="copied && (confirm || $slots.confirm)" ref="tooltipRef" class="vui-clipboard-tooltip" :style="floatingStyles">
71
+ <slot name="confirm">
72
+ <template v-if="confirm">
73
+ {{ confirm }}
74
+ </template>
75
+ <Flex v-else align-center justify-center>
76
+ <Icon width="16" height="16" icon="ph:check-bold" />
77
+ Copied to clipboard
78
+ </Flex>
79
+ </slot>
80
+ </div>
81
+ </Transition>
82
+ </template>
@@ -0,0 +1,17 @@
1
+ .vui-clipboard-copy-wrap {
2
+ display: inline-block;
3
+ position: relative;
4
+ }
5
+
6
+ .vui-clipboard-tooltip {
7
+ padding: 6px 8px;
8
+ border-radius: var(--border-radius-s);
9
+ background-color: var(--color-bg-raised);
10
+ font-size: var(--font-size-s);
11
+ color: var(--color-text-light);
12
+ box-shadow: var(--box-shadow);
13
+
14
+ svg path {
15
+ color: var(--color-text);
16
+ }
17
+ }