@dolanske/vui 0.3.3 → 0.3.4

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 (108) hide show
  1. package/LICENSE +673 -673
  2. package/README.md +40 -40
  3. package/dist/components/Avatar/Avatar.vue.d.ts +1 -0
  4. package/dist/style.css +1 -1
  5. package/dist/vui.js +710 -702
  6. package/package.json +68 -68
  7. package/src/App.vue +175 -165
  8. package/src/components/Accordion/Accordion.vue +91 -91
  9. package/src/components/Accordion/AccordionGroup.vue +43 -43
  10. package/src/components/Accordion/accordion.scss +80 -80
  11. package/src/components/Alert/Alert.vue +53 -53
  12. package/src/components/Alert/alert.scss +80 -80
  13. package/src/components/Avatar/Avatar.vue +50 -43
  14. package/src/components/Avatar/avatar.scss +52 -52
  15. package/src/components/Badge/Badge.vue +21 -21
  16. package/src/components/Badge/badge.scss +89 -89
  17. package/src/components/Breadcrumbs/BreadcrumbItem.vue +26 -26
  18. package/src/components/Breadcrumbs/Breadcrumbs.vue +33 -33
  19. package/src/components/Breadcrumbs/breadcrumbs.scss +30 -30
  20. package/src/components/Button/Button.vue +90 -90
  21. package/src/components/Button/button.scss +176 -176
  22. package/src/components/ButtonGroup/ButtonGroup.vue +25 -25
  23. package/src/components/ButtonGroup/button-group.scss +51 -51
  24. package/src/components/Calendar/Calendar.vue +60 -60
  25. package/src/components/Calendar/calendar.scss +56 -56
  26. package/src/components/Card/Card.vue +48 -48
  27. package/src/components/Card/card.scss +53 -53
  28. package/src/components/Checkbox/Checkbox.vue +52 -52
  29. package/src/components/Checkbox/checkbox.scss +66 -66
  30. package/src/components/CopyClipboard/CopyClipboard.vue +82 -82
  31. package/src/components/CopyClipboard/copy-clipboard.scss +17 -17
  32. package/src/components/Divider/Divider.vue +44 -44
  33. package/src/components/Divider/divider.scss +35 -35
  34. package/src/components/Drawer/Drawer.vue +97 -97
  35. package/src/components/Drawer/drawer.scss +36 -36
  36. package/src/components/Dropdown/Dropdown.vue +111 -110
  37. package/src/components/Dropdown/DropdownItem.vue +29 -29
  38. package/src/components/Dropdown/DropdownTitle.vue +8 -8
  39. package/src/components/Dropdown/dropdown.scss +117 -116
  40. package/src/components/Flex/Flex.vue +106 -106
  41. package/src/components/Grid/Grid.vue +54 -54
  42. package/src/components/Input/Counter.vue +70 -70
  43. package/src/components/Input/Dropzone.vue +65 -65
  44. package/src/components/Input/File.vue +15 -15
  45. package/src/components/Input/Input.vue +121 -121
  46. package/src/components/Input/Password.vue +47 -47
  47. package/src/components/Input/Textarea.vue +76 -76
  48. package/src/components/Input/input.scss +208 -208
  49. package/src/components/Kbd/Kbd.vue +48 -48
  50. package/src/components/Kbd/KbdGroup.vue +31 -31
  51. package/src/components/Kbd/kbd.scss +18 -18
  52. package/src/components/Modal/Confirm.vue +56 -56
  53. package/src/components/Modal/Modal.vue +91 -91
  54. package/src/components/Modal/modal.scss +49 -49
  55. package/src/components/OTP/OTP.vue +133 -133
  56. package/src/components/OTP/OTPItem.vue +37 -37
  57. package/src/components/OTP/otp.scss +83 -83
  58. package/src/components/Pagination/Pagination.vue +74 -74
  59. package/src/components/Pagination/pagination.ts +78 -78
  60. package/src/components/Popout/Popout.vue +42 -39
  61. package/src/components/Popout/popout.scss +8 -8
  62. package/src/components/Progress/Progress.vue +90 -90
  63. package/src/components/Progress/progress.scss +41 -41
  64. package/src/components/Radio/Radio.vue +36 -36
  65. package/src/components/Radio/RadioGroup.vue +40 -40
  66. package/src/components/Radio/radio.scss +59 -59
  67. package/src/components/Select/Select.vue +180 -180
  68. package/src/components/Select/select.scss +44 -44
  69. package/src/components/Sheet/Sheet.vue +92 -92
  70. package/src/components/Sheet/sheet.scss +60 -60
  71. package/src/components/Skeleton/Skeleton.vue +43 -43
  72. package/src/components/Skeleton/skeleton.scss +14 -14
  73. package/src/components/Spinner/Spinner.vue +42 -42
  74. package/src/components/Spinner/spinner.scss +46 -46
  75. package/src/components/Switch/Switch.vue +30 -30
  76. package/src/components/Switch/switch.scss +52 -52
  77. package/src/components/Table/Cell.vue +23 -23
  78. package/src/components/Table/Header.vue +59 -59
  79. package/src/components/Table/Row.vue +9 -9
  80. package/src/components/Table/SelectAll.vue +23 -23
  81. package/src/components/Table/SelectRow.vue +29 -29
  82. package/src/components/Table/Table.vue +66 -66
  83. package/src/components/Table/table.scss +134 -134
  84. package/src/components/Table/table.ts +244 -244
  85. package/src/components/Tabs/Tab.vue +27 -27
  86. package/src/components/Tabs/Tabs.vue +82 -82
  87. package/src/components/Tabs/tabs.scss +79 -79
  88. package/src/components/Toast/Toasts.vue +47 -47
  89. package/src/components/Toast/toast.scss +41 -41
  90. package/src/components/Toast/toast.ts +68 -68
  91. package/src/components/Tooltip/Tooltip.vue +86 -84
  92. package/src/components/Tooltip/tooltip.scss +4 -4
  93. package/src/index.scss +1 -1
  94. package/src/index.ts +119 -119
  95. package/src/internal/Backdrop/Backdrop.vue +22 -22
  96. package/src/internal/Backdrop/backdrop.scss +28 -28
  97. package/src/main.ts +5 -5
  98. package/src/shared/helpers.ts +74 -74
  99. package/src/shared/types.ts +29 -29
  100. package/src/style/animation.scss +21 -21
  101. package/src/style/core.scss +148 -146
  102. package/src/style/fonts.scss +53 -53
  103. package/src/style/layout.scss +136 -136
  104. package/src/style/media-query.scss +29 -29
  105. package/src/style/reset.scss +135 -135
  106. package/src/style/tooltip.scss +128 -128
  107. package/src/style/typography.scss +338 -338
  108. package/src/style/utils.scss +36 -36
@@ -1,92 +1,92 @@
1
- <script setup lang='ts'>
2
- import { computed } from 'vue'
3
- import Backdrop from '../../internal/Backdrop/Backdrop.vue'
4
- import { formatUnitValue } from '../../shared/helpers'
5
- import Button from '../Button/Button.vue'
6
- import Divider from '../Divider/Divider.vue'
7
- import './sheet.scss'
8
-
9
- interface Props {
10
- position?: 'left' | 'right' | 'top' | 'bottom'
11
- size?: number | string
12
- separator?: boolean
13
- }
14
-
15
- const {
16
- position = 'right',
17
- size = 398,
18
- separator,
19
- } = defineProps<Props>()
20
-
21
- const TRANSITION_OFFSET = 16
22
-
23
- const open = defineModel<boolean>()
24
-
25
- function close() {
26
- open.value = false
27
- }
28
-
29
- const style = computed(() => {
30
- if (position === 'left' || position === 'right') {
31
- return { width: formatUnitValue(size) }
32
- }
33
-
34
- return undefined
35
- })
36
-
37
- // Used to compute base location so that sheet appears to animate form the edge of the screen
38
- const baseTransform = computed(() => {
39
- switch (position) {
40
- case 'left': return `translate(-${TRANSITION_OFFSET}px, 0)`
41
- case 'top': return `translate(0, -${TRANSITION_OFFSET}px)`
42
- case 'bottom': return `translate(0, ${TRANSITION_OFFSET}px)`
43
- case 'right':
44
- default: return `translate(${TRANSITION_OFFSET}px, 0)`
45
- }
46
- })
47
- </script>
48
-
49
- <template>
50
- <Teleport to="body">
51
- <Transition appear name="sheet">
52
- <Backdrop v-if="open" @close="open = false">
53
- <div v-if="open" class="vui-sheet" :class="[`vui-sheet-position-${position}`]" :style>
54
- <div class="vui-sheet-header">
55
- <div class="flex-1">
56
- <slot name="header" :close />
57
- </div>
58
- <Button square icon="ph:x" @click="open = false" />
59
- </div>
60
-
61
- <Divider v-if="separator && $slots.header" :space="1" />
62
-
63
- <div v-if="$slots.default" class="vui-sheet-content">
64
- <slot :close />
65
- </div>
66
- </div>
67
- </Backdrop>
68
- </Transition>
69
- </Teleport>
70
- </template>
71
-
72
- <style scoped lang="scss">
73
- .vui-backdrop {
74
- padding: 0;
75
- }
76
-
77
- .sheet-enter-active,
78
- .sheet-leave-active {
79
- transition: var(--transition);
80
- }
81
-
82
- .sheet-enter-to,
83
- .sheet-leave-from {
84
- transform: translate(0, 0);
85
- }
86
-
87
- .sheet-enter-from,
88
- .sheet-leave-to {
89
- opacity: 0;
90
- transform: v-bind(baseTransform);
91
- }
92
- </style>
1
+ <script setup lang='ts'>
2
+ import { computed } from 'vue'
3
+ import Backdrop from '../../internal/Backdrop/Backdrop.vue'
4
+ import { formatUnitValue } from '../../shared/helpers'
5
+ import Button from '../Button/Button.vue'
6
+ import Divider from '../Divider/Divider.vue'
7
+ import './sheet.scss'
8
+
9
+ interface Props {
10
+ position?: 'left' | 'right' | 'top' | 'bottom'
11
+ size?: number | string
12
+ separator?: boolean
13
+ }
14
+
15
+ const {
16
+ position = 'right',
17
+ size = 398,
18
+ separator,
19
+ } = defineProps<Props>()
20
+
21
+ const TRANSITION_OFFSET = 16
22
+
23
+ const open = defineModel<boolean>()
24
+
25
+ function close() {
26
+ open.value = false
27
+ }
28
+
29
+ const style = computed(() => {
30
+ if (position === 'left' || position === 'right') {
31
+ return { width: formatUnitValue(size) }
32
+ }
33
+
34
+ return undefined
35
+ })
36
+
37
+ // Used to compute base location so that sheet appears to animate form the edge of the screen
38
+ const baseTransform = computed(() => {
39
+ switch (position) {
40
+ case 'left': return `translate(-${TRANSITION_OFFSET}px, 0)`
41
+ case 'top': return `translate(0, -${TRANSITION_OFFSET}px)`
42
+ case 'bottom': return `translate(0, ${TRANSITION_OFFSET}px)`
43
+ case 'right':
44
+ default: return `translate(${TRANSITION_OFFSET}px, 0)`
45
+ }
46
+ })
47
+ </script>
48
+
49
+ <template>
50
+ <Teleport to="body">
51
+ <Transition appear name="sheet">
52
+ <Backdrop v-if="open" @close="open = false">
53
+ <div v-if="open" class="vui-sheet" :class="[`vui-sheet-position-${position}`]" :style>
54
+ <div class="vui-sheet-header">
55
+ <div class="flex-1">
56
+ <slot name="header" :close />
57
+ </div>
58
+ <Button square icon="ph:x" @click="open = false" />
59
+ </div>
60
+
61
+ <Divider v-if="separator && $slots.header" :space="1" />
62
+
63
+ <div v-if="$slots.default" class="vui-sheet-content">
64
+ <slot :close />
65
+ </div>
66
+ </div>
67
+ </Backdrop>
68
+ </Transition>
69
+ </Teleport>
70
+ </template>
71
+
72
+ <style scoped lang="scss">
73
+ .vui-backdrop {
74
+ padding: 0;
75
+ }
76
+
77
+ .sheet-enter-active,
78
+ .sheet-leave-active {
79
+ transition: var(--transition);
80
+ }
81
+
82
+ .sheet-enter-to,
83
+ .sheet-leave-from {
84
+ transform: translate(0, 0);
85
+ }
86
+
87
+ .sheet-enter-from,
88
+ .sheet-leave-to {
89
+ opacity: 0;
90
+ transform: v-bind(baseTransform);
91
+ }
92
+ </style>
@@ -1,60 +1,60 @@
1
- .vui-sheet {
2
- display: flex;
3
- flex-direction: column;
4
- position: absolute;
5
- background-color: var(--color-bg);
6
- border-color: var(--color-border);
7
- height: 100dvh;
8
-
9
- &.vui-sheet-position-top {
10
- top: 0;
11
- border-bottom: 1px solid var(--color-border);
12
- height: auto;
13
- }
14
-
15
- &.vui-sheet-position-bottom {
16
- bottom: 0;
17
- border-top: 1px solid var(--color-border);
18
- height: auto;
19
- }
20
-
21
- &.vui-sheet-position-right {
22
- right: 0;
23
- top: 0;
24
- border-left: 1px solid var(--color-border);
25
- }
26
-
27
- &.vui-sheet-position-left {
28
- left: 0;
29
- top: 0;
30
- border-right: 1px solid var(--color-border);
31
- }
32
-
33
- &.vui-sheet-position-top,
34
- &.vui-sheet-position-bottom {
35
- max-height: 35dvh;
36
- width: 100%;
37
- }
38
-
39
- .vui-sheet-header,
40
- .vui-sheet-content {
41
- width: 100%;
42
- padding: var(--space-m);
43
- }
44
-
45
- .vui-sheet-content {
46
- flex: 1 1 0%;
47
- overflow-y: auto;
48
- height: 100%;
49
- }
50
-
51
- .vui-sheet-header {
52
- display: flex;
53
- gap: var(--space-m);
54
- align-self: flex-start;
55
-
56
- & + .vui-sheet-content {
57
- padding-top: var(--space-s);
58
- }
59
- }
60
- }
1
+ .vui-sheet {
2
+ display: flex;
3
+ flex-direction: column;
4
+ position: absolute;
5
+ background-color: var(--color-bg);
6
+ border-color: var(--color-border);
7
+ height: 100dvh;
8
+
9
+ &.vui-sheet-position-top {
10
+ top: 0;
11
+ border-bottom: 1px solid var(--color-border);
12
+ height: auto;
13
+ }
14
+
15
+ &.vui-sheet-position-bottom {
16
+ bottom: 0;
17
+ border-top: 1px solid var(--color-border);
18
+ height: auto;
19
+ }
20
+
21
+ &.vui-sheet-position-right {
22
+ right: 0;
23
+ top: 0;
24
+ border-left: 1px solid var(--color-border);
25
+ }
26
+
27
+ &.vui-sheet-position-left {
28
+ left: 0;
29
+ top: 0;
30
+ border-right: 1px solid var(--color-border);
31
+ }
32
+
33
+ &.vui-sheet-position-top,
34
+ &.vui-sheet-position-bottom {
35
+ max-height: 35dvh;
36
+ width: 100%;
37
+ }
38
+
39
+ .vui-sheet-header,
40
+ .vui-sheet-content {
41
+ width: 100%;
42
+ padding: var(--space-m);
43
+ }
44
+
45
+ .vui-sheet-content {
46
+ flex: 1 1 0%;
47
+ overflow-y: auto;
48
+ height: 100%;
49
+ }
50
+
51
+ .vui-sheet-header {
52
+ display: flex;
53
+ gap: var(--space-m);
54
+ align-self: flex-start;
55
+
56
+ & + .vui-sheet-content {
57
+ padding-top: var(--space-s);
58
+ }
59
+ }
60
+ }
@@ -1,43 +1,43 @@
1
- <!-- eslint-disable ts/no-use-before-define -->
2
- <script setup lang='ts'>
3
- import { computed } from 'vue'
4
- import { formatUnitValue } from '../../shared/helpers'
5
- import './skeleton.scss'
6
-
7
- interface Props {
8
- radius?: string | number
9
- width?: string | number
10
- height?: string | number
11
- circle?: boolean
12
- }
13
-
14
- const {
15
- // @ts-expect-error I can't get ESLint to STOP moving DEFAULT_RADIUS below
16
- // this props declaration wtf
17
- radius = DEFAULT_RADIUS,
18
- width = '100%',
19
- height = '32px',
20
- circle,
21
- } = defineProps<Props>()
22
-
23
- const DEFAULT_RADIUS = 'var(--border-radius-s)'
24
-
25
- // Give priority to radius, if it is NOT set to default
26
- const bR = computed(() => formatUnitValue(circle && radius === DEFAULT_RADIUS ? 9999 : radius))
27
-
28
- // When using `circle` prop, we want to use the same
29
- // value for both height and width, but we can't
30
- // know which one will be defined
31
- const w = computed(() => formatUnitValue(circle ? (width || height) : width))
32
- const h = computed(() => formatUnitValue(circle ? (width || height) : height))
33
- </script>
34
-
35
- <template>
36
- <div
37
- class="vui-skeleton" :style="{
38
- borderRadius: bR,
39
- width: w,
40
- height: h,
41
- }"
42
- />
43
- </template>
1
+ <!-- eslint-disable ts/no-use-before-define -->
2
+ <script setup lang='ts'>
3
+ import { computed } from 'vue'
4
+ import { formatUnitValue } from '../../shared/helpers'
5
+ import './skeleton.scss'
6
+
7
+ interface Props {
8
+ radius?: string | number
9
+ width?: string | number
10
+ height?: string | number
11
+ circle?: boolean
12
+ }
13
+
14
+ const {
15
+ // @ts-expect-error I can't get ESLint to STOP moving DEFAULT_RADIUS below
16
+ // this props declaration wtf
17
+ radius = DEFAULT_RADIUS,
18
+ width = '100%',
19
+ height = '32px',
20
+ circle,
21
+ } = defineProps<Props>()
22
+
23
+ const DEFAULT_RADIUS = 'var(--border-radius-s)'
24
+
25
+ // Give priority to radius, if it is NOT set to default
26
+ const bR = computed(() => formatUnitValue(circle && radius === DEFAULT_RADIUS ? 9999 : radius))
27
+
28
+ // When using `circle` prop, we want to use the same
29
+ // value for both height and width, but we can't
30
+ // know which one will be defined
31
+ const w = computed(() => formatUnitValue(circle ? (width || height) : width))
32
+ const h = computed(() => formatUnitValue(circle ? (width || height) : height))
33
+ </script>
34
+
35
+ <template>
36
+ <div
37
+ class="vui-skeleton" :style="{
38
+ borderRadius: bR,
39
+ width: w,
40
+ height: h,
41
+ }"
42
+ />
43
+ </template>
@@ -1,14 +1,14 @@
1
- .vui-skeleton {
2
- animation: pulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
3
- background-color: var(--color-border);
4
-
5
- @keyframes pulse {
6
- 0%,
7
- 100% {
8
- opacity: 1;
9
- }
10
- 50% {
11
- opacity: 0.5;
12
- }
13
- }
14
- }
1
+ .vui-skeleton {
2
+ animation: pulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
3
+ background-color: var(--color-border);
4
+
5
+ @keyframes pulse {
6
+ 0%,
7
+ 100% {
8
+ opacity: 1;
9
+ }
10
+ 50% {
11
+ opacity: 0.5;
12
+ }
13
+ }
14
+ }
@@ -1,42 +1,42 @@
1
- <script setup lang="ts">
2
- import type { Sizes } from '../../shared/types'
3
- import { computed } from 'vue'
4
- import { Size } from '../../shared/types'
5
- import './spinner.scss'
6
-
7
- interface Props {
8
- size?: Sizes
9
- }
10
-
11
- const {
12
- size = 's',
13
- } = defineProps<Props>()
14
-
15
- const w = computed(() => {
16
- switch (size) {
17
- case Size.s: return '16px'
18
- case Size.l: return '38px'
19
- case Size.m:
20
- default: return '26px'
21
- }
22
- })
23
-
24
- const bW = computed(() => {
25
- switch (size) {
26
- case Size.s: return '3px'
27
- case Size.l: return '5px'
28
- case Size.m:
29
- default: return '4px'
30
- }
31
- })
32
- </script>
33
-
34
- <template>
35
- <div
36
- :class="{ size }" class="vui-spinner" :style="{
37
- width: w,
38
- height: w,
39
- borderWidth: bW,
40
- }"
41
- />
42
- </template>
1
+ <script setup lang="ts">
2
+ import type { Sizes } from '../../shared/types'
3
+ import { computed } from 'vue'
4
+ import { Size } from '../../shared/types'
5
+ import './spinner.scss'
6
+
7
+ interface Props {
8
+ size?: Sizes
9
+ }
10
+
11
+ const {
12
+ size = 's',
13
+ } = defineProps<Props>()
14
+
15
+ const w = computed(() => {
16
+ switch (size) {
17
+ case Size.s: return '16px'
18
+ case Size.l: return '38px'
19
+ case Size.m:
20
+ default: return '26px'
21
+ }
22
+ })
23
+
24
+ const bW = computed(() => {
25
+ switch (size) {
26
+ case Size.s: return '3px'
27
+ case Size.l: return '5px'
28
+ case Size.m:
29
+ default: return '4px'
30
+ }
31
+ })
32
+ </script>
33
+
34
+ <template>
35
+ <div
36
+ :class="{ size }" class="vui-spinner" :style="{
37
+ width: w,
38
+ height: w,
39
+ borderWidth: bW,
40
+ }"
41
+ />
42
+ </template>
@@ -1,46 +1,46 @@
1
- .vui-spinner {
2
- --spinner-color: var(--color-text);
3
- aspect-ratio: 1;
4
- border-radius: 50%;
5
- border: 3px solid var(--spinner-color);
6
- animation:
7
- l20-1 0.8s infinite linear alternate,
8
- l20-2 1.6s infinite linear;
9
- }
10
- @keyframes l20-1 {
11
- 0% {
12
- clip-path: polygon(50% 50%, 0 0, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
13
- }
14
- 12.5% {
15
- clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%);
16
- }
17
- 25% {
18
- clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%);
19
- }
20
- 50% {
21
- clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
22
- }
23
- 62.5% {
24
- clip-path: polygon(50% 50%, 100% 0, 100% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
25
- }
26
- 75% {
27
- clip-path: polygon(50% 50%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 50% 100%, 0% 100%);
28
- }
29
- 100% {
30
- clip-path: polygon(50% 50%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 0% 100%);
31
- }
32
- }
33
- @keyframes l20-2 {
34
- 0% {
35
- transform: scaleY(1) rotate(0deg);
36
- }
37
- 49.99% {
38
- transform: scaleY(1) rotate(135deg);
39
- }
40
- 50% {
41
- transform: scaleY(-1) rotate(0deg);
42
- }
43
- 100% {
44
- transform: scaleY(-1) rotate(-135deg);
45
- }
46
- }
1
+ .vui-spinner {
2
+ --spinner-color: var(--color-text);
3
+ aspect-ratio: 1;
4
+ border-radius: 50%;
5
+ border: 3px solid var(--spinner-color);
6
+ animation:
7
+ l20-1 0.8s infinite linear alternate,
8
+ l20-2 1.6s infinite linear;
9
+ }
10
+ @keyframes l20-1 {
11
+ 0% {
12
+ clip-path: polygon(50% 50%, 0 0, 50% 0%, 50% 0%, 50% 0%, 50% 0%, 50% 0%);
13
+ }
14
+ 12.5% {
15
+ clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 0%, 100% 0%, 100% 0%);
16
+ }
17
+ 25% {
18
+ clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 100% 100%, 100% 100%);
19
+ }
20
+ 50% {
21
+ clip-path: polygon(50% 50%, 0 0, 50% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
22
+ }
23
+ 62.5% {
24
+ clip-path: polygon(50% 50%, 100% 0, 100% 0%, 100% 0%, 100% 100%, 50% 100%, 0% 100%);
25
+ }
26
+ 75% {
27
+ clip-path: polygon(50% 50%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 50% 100%, 0% 100%);
28
+ }
29
+ 100% {
30
+ clip-path: polygon(50% 50%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 50% 100%, 0% 100%);
31
+ }
32
+ }
33
+ @keyframes l20-2 {
34
+ 0% {
35
+ transform: scaleY(1) rotate(0deg);
36
+ }
37
+ 49.99% {
38
+ transform: scaleY(1) rotate(135deg);
39
+ }
40
+ 50% {
41
+ transform: scaleY(-1) rotate(0deg);
42
+ }
43
+ 100% {
44
+ transform: scaleY(-1) rotate(-135deg);
45
+ }
46
+ }
@@ -1,30 +1,30 @@
1
- <script setup lang="ts">
2
- import { useId } from 'vue'
3
- import './switch.scss'
4
-
5
- interface Props {
6
- label?: string
7
- disabled?: boolean
8
- }
9
-
10
- const { label, disabled } = defineProps<Props>()
11
- const slots = defineSlots()
12
- const checked = defineModel<boolean>()
13
- const id = useId()
14
- </script>
15
-
16
- <template>
17
- <div class="vui-switch" :class="{ disabled, checked }">
18
- <input :id v-model="checked" type="checkbox">
19
- <label :for="id">
20
- <div class="vui-switch-icon">
21
- <span class="vui-switch-indicator" />
22
- </div>
23
-
24
- <p v-if="!slots.default" class="vui-switch-content">{{ label }}</p>
25
- <div v-else class="vui-switch-content">
26
- <slot />
27
- </div>
28
- </label>
29
- </div>
30
- </template>
1
+ <script setup lang="ts">
2
+ import { useId } from 'vue'
3
+ import './switch.scss'
4
+
5
+ interface Props {
6
+ label?: string
7
+ disabled?: boolean
8
+ }
9
+
10
+ const { label, disabled } = defineProps<Props>()
11
+ const slots = defineSlots()
12
+ const checked = defineModel<boolean>()
13
+ const id = useId()
14
+ </script>
15
+
16
+ <template>
17
+ <div class="vui-switch" :class="{ disabled, checked }">
18
+ <input :id v-model="checked" type="checkbox">
19
+ <label :for="id">
20
+ <div class="vui-switch-icon">
21
+ <span class="vui-switch-indicator" />
22
+ </div>
23
+
24
+ <p v-if="!slots.default" class="vui-switch-content">{{ label }}</p>
25
+ <div v-else class="vui-switch-content">
26
+ <slot />
27
+ </div>
28
+ </label>
29
+ </div>
30
+ </template>