@dolanske/vui 0.3.4 → 0.4.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 (110) hide show
  1. package/LICENSE +673 -673
  2. package/README.md +49 -40
  3. package/dist/components/Dropdown/DropdownItem.vue.d.ts +1 -0
  4. package/dist/style.css +1 -1
  5. package/dist/vui.js +864 -859
  6. package/package.json +68 -68
  7. package/src/App.vue +198 -175
  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 -50
  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 -111
  37. package/src/components/Dropdown/DropdownItem.vue +32 -29
  38. package/src/components/Dropdown/DropdownTitle.vue +8 -8
  39. package/src/components/Dropdown/dropdown.scss +118 -117
  40. package/src/components/Flex/Flex.vue +110 -106
  41. package/src/components/Grid/Grid.vue +57 -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 -42
  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/Sidebar/Sidebar.vue +85 -0
  72. package/src/components/Sidebar/sidebar.scss +123 -0
  73. package/src/components/Skeleton/Skeleton.vue +43 -43
  74. package/src/components/Skeleton/skeleton.scss +14 -14
  75. package/src/components/Spinner/Spinner.vue +42 -42
  76. package/src/components/Spinner/spinner.scss +46 -46
  77. package/src/components/Switch/Switch.vue +30 -30
  78. package/src/components/Switch/switch.scss +52 -52
  79. package/src/components/Table/Cell.vue +23 -23
  80. package/src/components/Table/Header.vue +59 -59
  81. package/src/components/Table/Row.vue +9 -9
  82. package/src/components/Table/SelectAll.vue +23 -23
  83. package/src/components/Table/SelectRow.vue +29 -29
  84. package/src/components/Table/Table.vue +66 -66
  85. package/src/components/Table/table.scss +134 -134
  86. package/src/components/Table/table.ts +244 -244
  87. package/src/components/Tabs/Tab.vue +27 -27
  88. package/src/components/Tabs/Tabs.vue +82 -82
  89. package/src/components/Tabs/tabs.scss +79 -79
  90. package/src/components/Toast/Toasts.vue +47 -47
  91. package/src/components/Toast/toast.scss +41 -41
  92. package/src/components/Toast/toast.ts +68 -68
  93. package/src/components/Tooltip/Tooltip.vue +86 -86
  94. package/src/components/Tooltip/tooltip.scss +4 -4
  95. package/src/index.scss +1 -1
  96. package/src/index.ts +119 -119
  97. package/src/internal/Backdrop/Backdrop.vue +22 -22
  98. package/src/internal/Backdrop/backdrop.scss +28 -28
  99. package/src/main.ts +5 -5
  100. package/src/shared/helpers.ts +74 -74
  101. package/src/shared/types.ts +29 -29
  102. package/src/style/animation.scss +21 -21
  103. package/src/style/core.scss +148 -148
  104. package/src/style/fonts.scss +53 -53
  105. package/src/style/layout.scss +136 -136
  106. package/src/style/media-query.scss +29 -29
  107. package/src/style/reset.scss +135 -135
  108. package/src/style/tooltip.scss +128 -128
  109. package/src/style/typography.scss +338 -338
  110. package/src/style/utils.scss +36 -36
@@ -1,31 +1,31 @@
1
- <script setup lang='ts'>
2
- import type { VNode } from 'vue'
3
- import { useMagicKeys, whenever } from '@vueuse/core'
4
-
5
- /**
6
- * Can be used to wrap multiple <Kbd /> elements and triggers the callback when
7
- * all of them are active
8
- */
9
-
10
- const emits = defineEmits<{
11
- trigger: []
12
- }>()
13
-
14
- const slots = defineSlots<{
15
- default: () => Array<VNode & {
16
- props: {
17
- keys: string
18
- }
19
- }>
20
- }>()
21
- const keys = useMagicKeys()
22
-
23
- whenever(
24
- keys[slots.default().map(vnode => vnode.props.keys).join('+')],
25
- () => emits('trigger'),
26
- )
27
- </script>
28
-
29
- <template>
30
- <slot />
31
- </template>
1
+ <script setup lang='ts'>
2
+ import type { VNode } from 'vue'
3
+ import { useMagicKeys, whenever } from '@vueuse/core'
4
+
5
+ /**
6
+ * Can be used to wrap multiple <Kbd /> elements and triggers the callback when
7
+ * all of them are active
8
+ */
9
+
10
+ const emits = defineEmits<{
11
+ trigger: []
12
+ }>()
13
+
14
+ const slots = defineSlots<{
15
+ default: () => Array<VNode & {
16
+ props: {
17
+ keys: string
18
+ }
19
+ }>
20
+ }>()
21
+ const keys = useMagicKeys()
22
+
23
+ whenever(
24
+ keys[slots.default().map(vnode => vnode.props.keys).join('+')],
25
+ () => emits('trigger'),
26
+ )
27
+ </script>
28
+
29
+ <template>
30
+ <slot />
31
+ </template>
@@ -1,18 +1,18 @@
1
- .vui-kbd {
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- height: 24px;
6
- border-radius: var(--border-radius-xs);
7
- // border: 1px solid var(--color-border-strong);
8
- font-size: var(--font-size-s);
9
- padding: 0 4px;
10
- transition: var(--transition);
11
- font-weight: 600;
12
- background-color: var(--color-text);
13
- color: var(--color-text-invert);
14
-
15
- &.active {
16
- background-color: var(--color-text-yellow);
17
- }
18
- }
1
+ .vui-kbd {
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ height: 24px;
6
+ border-radius: var(--border-radius-xs);
7
+ // border: 1px solid var(--color-border-strong);
8
+ font-size: var(--font-size-s);
9
+ padding: 0 4px;
10
+ transition: var(--transition);
11
+ font-weight: 600;
12
+ background-color: var(--color-text);
13
+ color: var(--color-text-invert);
14
+
15
+ &.active {
16
+ background-color: var(--color-text-yellow);
17
+ }
18
+ }
@@ -1,56 +1,56 @@
1
- <script setup lang='ts'>
2
- import type { Variants } from '../Button/Button.vue'
3
- import type { ModalProps } from './Modal.vue'
4
- import Button from '../Button/Button.vue'
5
- import Flex from '../Flex/Flex.vue'
6
- import Modal from './Modal.vue'
7
-
8
- type Props = {
9
- title?: string
10
- content?: string
11
- confirmText?: string
12
- confirmVariant?: Variants
13
- cancelText?: string
14
- showCancel?: boolean
15
- } & Partial<ModalProps>
16
-
17
- const props = withDefaults(defineProps<Props>(), {
18
- cancelText: 'Cancel',
19
- confirmText: 'Ok',
20
- size: 's',
21
- canDismiss: true,
22
- showCancel: true,
23
- confirmVariant: 'default',
24
- })
25
-
26
- const emits = defineEmits<{
27
- cancel: []
28
- confirm: []
29
- }>()
30
-
31
- const open = defineModel<boolean>()
32
- </script>
33
-
34
- <template>
35
- <pre>{{ $props }}</pre>
36
- <Modal
37
- v-bind="props"
38
- v-model="open"
39
- >
40
- <template #default>
41
- <div class="typeset">
42
- <slot />
43
- </div>
44
- </template>
45
- <template #footer>
46
- <Flex justify-end>
47
- <Button v-if="props.showCancel" plain @click="emits('cancel'), open = false">
48
- {{ props.cancelText }}
49
- </Button>
50
- <Button :variant="props.confirmVariant" @click="emits('confirm'), open = false">
51
- {{ props.confirmText }}
52
- </Button>
53
- </Flex>
54
- </template>
55
- </Modal>
56
- </template>
1
+ <script setup lang='ts'>
2
+ import type { Variants } from '../Button/Button.vue'
3
+ import type { ModalProps } from './Modal.vue'
4
+ import Button from '../Button/Button.vue'
5
+ import Flex from '../Flex/Flex.vue'
6
+ import Modal from './Modal.vue'
7
+
8
+ type Props = {
9
+ title?: string
10
+ content?: string
11
+ confirmText?: string
12
+ confirmVariant?: Variants
13
+ cancelText?: string
14
+ showCancel?: boolean
15
+ } & Partial<ModalProps>
16
+
17
+ const props = withDefaults(defineProps<Props>(), {
18
+ cancelText: 'Cancel',
19
+ confirmText: 'Ok',
20
+ size: 's',
21
+ canDismiss: true,
22
+ showCancel: true,
23
+ confirmVariant: 'default',
24
+ })
25
+
26
+ const emits = defineEmits<{
27
+ cancel: []
28
+ confirm: []
29
+ }>()
30
+
31
+ const open = defineModel<boolean>()
32
+ </script>
33
+
34
+ <template>
35
+ <pre>{{ $props }}</pre>
36
+ <Modal
37
+ v-bind="props"
38
+ v-model="open"
39
+ >
40
+ <template #default>
41
+ <div class="typeset">
42
+ <slot />
43
+ </div>
44
+ </template>
45
+ <template #footer>
46
+ <Flex justify-end>
47
+ <Button v-if="props.showCancel" plain @click="emits('cancel'), open = false">
48
+ {{ props.cancelText }}
49
+ </Button>
50
+ <Button :variant="props.confirmVariant" @click="emits('confirm'), open = false">
51
+ {{ props.confirmText }}
52
+ </Button>
53
+ </Flex>
54
+ </template>
55
+ </Modal>
56
+ </template>
@@ -1,91 +1,91 @@
1
- <script setup lang='ts'>
2
- import type { Sizes } from '../../shared/types'
3
- import type { Props as CardProps } from '../Card/Card.vue'
4
- import { useAttrs } from 'vue'
5
- import Backdrop from '../../internal/Backdrop/Backdrop.vue'
6
- import Button from '../Button/Button.vue'
7
- import Card from '../Card/Card.vue'
8
- import './modal.scss'
9
-
10
- export interface ModalProps {
11
- size?: Sizes | 'full'
12
- /**
13
- * Modal wraps a floating card. You can optinally pass in any props you'd pass
14
- * into the <Card /> component.
15
- */
16
- card?: CardProps
17
- /**
18
- * Modal will not overflow the screen, but its card's content will be scrollable instead.
19
- */
20
- scrollable?: boolean
21
- /**
22
- * Modal appears in the center of the screen
23
- */
24
- centered?: boolean
25
- /**
26
- * Wether modal can be closed by clicking the X button
27
- */
28
- canDismiss?: boolean
29
- }
30
-
31
- const {
32
- size = 'm',
33
- card = {},
34
- scrollable,
35
- centered,
36
- canDismiss = true,
37
- } = defineProps<ModalProps>()
38
-
39
- const open = defineModel<boolean>()
40
-
41
- function close() {
42
- open.value = false
43
- }
44
-
45
- const attrs = useAttrs()
46
- </script>
47
-
48
- <template>
49
- <Teleport to="body">
50
- <Transition appear name="modal">
51
- <Backdrop v-if="open" @close="close">
52
- <div class="vui-modal" :class="[`vui-modal-size-${size}`, { scrollable, centered }]" v-bind="attrs">
53
- <Button
54
- v-if="canDismiss"
55
- class="vui-modal-close"
56
- plain
57
- square
58
- icon="ph:x"
59
- @click="open = false"
60
- />
61
- <Card v-bind="card">
62
- <template v-if="$slots.header" #header>
63
- <slot name="header" :close />
64
- </template>
65
- <template v-if="$slots.default" #default>
66
- <div>
67
- <slot name="default" :close />
68
- </div>
69
- </template>
70
- <template v-if="$slots.footer" #footer>
71
- <slot name="footer" :close />
72
- </template>
73
- </Card>
74
- </div>
75
- </Backdrop>
76
- </Transition>
77
- </Teleport>
78
- </template>
79
-
80
- <style scoped>
81
- .modal-enter-active,
82
- .modal-leave-active {
83
- transition: var(--transition);
84
- }
85
-
86
- .modal-enter-from,
87
- .modal-leave-to {
88
- opacity: 0;
89
- transform: scale(0.95);
90
- }
91
- </style>
1
+ <script setup lang='ts'>
2
+ import type { Sizes } from '../../shared/types'
3
+ import type { Props as CardProps } from '../Card/Card.vue'
4
+ import { useAttrs } from 'vue'
5
+ import Backdrop from '../../internal/Backdrop/Backdrop.vue'
6
+ import Button from '../Button/Button.vue'
7
+ import Card from '../Card/Card.vue'
8
+ import './modal.scss'
9
+
10
+ export interface ModalProps {
11
+ size?: Sizes | 'full'
12
+ /**
13
+ * Modal wraps a floating card. You can optinally pass in any props you'd pass
14
+ * into the <Card /> component.
15
+ */
16
+ card?: CardProps
17
+ /**
18
+ * Modal will not overflow the screen, but its card's content will be scrollable instead.
19
+ */
20
+ scrollable?: boolean
21
+ /**
22
+ * Modal appears in the center of the screen
23
+ */
24
+ centered?: boolean
25
+ /**
26
+ * Wether modal can be closed by clicking the X button
27
+ */
28
+ canDismiss?: boolean
29
+ }
30
+
31
+ const {
32
+ size = 'm',
33
+ card = {},
34
+ scrollable,
35
+ centered,
36
+ canDismiss = true,
37
+ } = defineProps<ModalProps>()
38
+
39
+ const open = defineModel<boolean>()
40
+
41
+ function close() {
42
+ open.value = false
43
+ }
44
+
45
+ const attrs = useAttrs()
46
+ </script>
47
+
48
+ <template>
49
+ <Teleport to="body">
50
+ <Transition appear name="modal">
51
+ <Backdrop v-if="open" @close="close">
52
+ <div class="vui-modal" :class="[`vui-modal-size-${size}`, { scrollable, centered }]" v-bind="attrs">
53
+ <Button
54
+ v-if="canDismiss"
55
+ class="vui-modal-close"
56
+ plain
57
+ square
58
+ icon="ph:x"
59
+ @click="open = false"
60
+ />
61
+ <Card v-bind="card">
62
+ <template v-if="$slots.header" #header>
63
+ <slot name="header" :close />
64
+ </template>
65
+ <template v-if="$slots.default" #default>
66
+ <div>
67
+ <slot name="default" :close />
68
+ </div>
69
+ </template>
70
+ <template v-if="$slots.footer" #footer>
71
+ <slot name="footer" :close />
72
+ </template>
73
+ </Card>
74
+ </div>
75
+ </Backdrop>
76
+ </Transition>
77
+ </Teleport>
78
+ </template>
79
+
80
+ <style scoped>
81
+ .modal-enter-active,
82
+ .modal-leave-active {
83
+ transition: var(--transition);
84
+ }
85
+
86
+ .modal-enter-from,
87
+ .modal-leave-to {
88
+ opacity: 0;
89
+ transform: scale(0.95);
90
+ }
91
+ </style>
@@ -1,49 +1,49 @@
1
- .vui-modal {
2
- width: 100%;
3
- margin-inline: auto;
4
- height: 100%;
5
- position: relative;
6
-
7
- .vui-modal-close {
8
- position: absolute;
9
- top: 16px;
10
- right: 16px;
11
- }
12
-
13
- &.centered {
14
- display: flex;
15
- align-items: center;
16
- }
17
-
18
- &.vui-modal-size-s {
19
- max-width: 440px;
20
- }
21
-
22
- &.vui-modal-size-m {
23
- max-width: 620px;
24
- }
25
-
26
- &.vui-modal-size-l {
27
- max-width: 728px;
28
- }
29
-
30
- &.scrollable {
31
- & > .vui-card {
32
- display: flex;
33
- flex-direction: column;
34
- inline-size: 100%;
35
- max-height: 100%;
36
-
37
- .vui-card-content {
38
- flex: 1 1 0%;
39
- overflow-y: auto;
40
- }
41
- }
42
- }
43
-
44
- & > .vui-card {
45
- width: 100%;
46
- margin-bottom: var(--backdrop-offset);
47
- box-shadow: var(--box-shadow-strong);
48
- }
49
- }
1
+ .vui-modal {
2
+ width: 100%;
3
+ margin-inline: auto;
4
+ height: 100%;
5
+ position: relative;
6
+
7
+ .vui-modal-close {
8
+ position: absolute;
9
+ top: 16px;
10
+ right: 16px;
11
+ }
12
+
13
+ &.centered {
14
+ display: flex;
15
+ align-items: center;
16
+ }
17
+
18
+ &.vui-modal-size-s {
19
+ max-width: 440px;
20
+ }
21
+
22
+ &.vui-modal-size-m {
23
+ max-width: 620px;
24
+ }
25
+
26
+ &.vui-modal-size-l {
27
+ max-width: 728px;
28
+ }
29
+
30
+ &.scrollable {
31
+ & > .vui-card {
32
+ display: flex;
33
+ flex-direction: column;
34
+ inline-size: 100%;
35
+ max-height: 100%;
36
+
37
+ .vui-card-content {
38
+ flex: 1 1 0%;
39
+ overflow-y: auto;
40
+ }
41
+ }
42
+ }
43
+
44
+ & > .vui-card {
45
+ width: 100%;
46
+ margin-bottom: var(--backdrop-offset);
47
+ box-shadow: var(--box-shadow-strong);
48
+ }
49
+ }