@dolanske/vui 0.3.4 → 0.5.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 (114) hide show
  1. package/LICENSE +673 -673
  2. package/README.md +41 -40
  3. package/dist/components/Dropdown/DropdownItem.vue.d.ts +1 -0
  4. package/dist/components/Flex/Flex.vue.d.ts +3 -1
  5. package/dist/components/Grid/Grid.vue.d.ts +3 -1
  6. package/dist/components/Tabs/Tabs.vue.d.ts +4 -0
  7. package/dist/style.css +1 -1
  8. package/dist/vui.js +1547 -1534
  9. package/package.json +68 -68
  10. package/src/App.vue +176 -175
  11. package/src/components/Accordion/Accordion.vue +91 -91
  12. package/src/components/Accordion/AccordionGroup.vue +43 -43
  13. package/src/components/Accordion/accordion.scss +81 -80
  14. package/src/components/Alert/Alert.vue +53 -53
  15. package/src/components/Alert/alert.scss +80 -80
  16. package/src/components/Avatar/Avatar.vue +50 -50
  17. package/src/components/Avatar/avatar.scss +52 -52
  18. package/src/components/Badge/Badge.vue +21 -21
  19. package/src/components/Badge/badge.scss +89 -89
  20. package/src/components/Breadcrumbs/BreadcrumbItem.vue +26 -26
  21. package/src/components/Breadcrumbs/Breadcrumbs.vue +33 -33
  22. package/src/components/Breadcrumbs/breadcrumbs.scss +30 -30
  23. package/src/components/Button/Button.vue +90 -90
  24. package/src/components/Button/button.scss +178 -176
  25. package/src/components/ButtonGroup/ButtonGroup.vue +25 -25
  26. package/src/components/ButtonGroup/button-group.scss +51 -51
  27. package/src/components/Calendar/Calendar.vue +63 -60
  28. package/src/components/Calendar/calendar.scss +60 -56
  29. package/src/components/Card/Card.vue +48 -48
  30. package/src/components/Card/card.scss +53 -53
  31. package/src/components/Checkbox/Checkbox.vue +51 -52
  32. package/src/components/Checkbox/checkbox.scss +75 -66
  33. package/src/components/CopyClipboard/CopyClipboard.vue +82 -82
  34. package/src/components/CopyClipboard/copy-clipboard.scss +17 -17
  35. package/src/components/Divider/Divider.vue +44 -44
  36. package/src/components/Divider/divider.scss +35 -35
  37. package/src/components/Drawer/Drawer.vue +97 -97
  38. package/src/components/Drawer/drawer.scss +36 -36
  39. package/src/components/Dropdown/Dropdown.vue +111 -111
  40. package/src/components/Dropdown/DropdownItem.vue +33 -29
  41. package/src/components/Dropdown/DropdownTitle.vue +8 -8
  42. package/src/components/Dropdown/dropdown-item.scss +77 -0
  43. package/src/components/Dropdown/dropdown.scss +39 -117
  44. package/src/components/Flex/Flex.vue +113 -106
  45. package/src/components/Grid/Grid.vue +60 -54
  46. package/src/components/Input/Counter.vue +70 -70
  47. package/src/components/Input/Dropzone.vue +65 -65
  48. package/src/components/Input/File.vue +15 -15
  49. package/src/components/Input/Input.vue +121 -121
  50. package/src/components/Input/Password.vue +47 -47
  51. package/src/components/Input/Textarea.vue +76 -76
  52. package/src/components/Input/input.scss +208 -208
  53. package/src/components/Kbd/Kbd.vue +48 -48
  54. package/src/components/Kbd/KbdGroup.vue +31 -31
  55. package/src/components/Kbd/kbd.scss +18 -18
  56. package/src/components/Modal/Confirm.vue +56 -56
  57. package/src/components/Modal/Modal.vue +91 -91
  58. package/src/components/Modal/modal.scss +49 -49
  59. package/src/components/OTP/OTP.vue +133 -133
  60. package/src/components/OTP/OTPItem.vue +37 -37
  61. package/src/components/OTP/otp.scss +83 -83
  62. package/src/components/Pagination/Pagination.vue +74 -74
  63. package/src/components/Pagination/pagination.ts +78 -78
  64. package/src/components/Popout/Popout.vue +42 -42
  65. package/src/components/Popout/popout.scss +8 -8
  66. package/src/components/Progress/Progress.vue +90 -90
  67. package/src/components/Progress/progress.scss +41 -41
  68. package/src/components/Radio/Radio.vue +36 -36
  69. package/src/components/Radio/RadioGroup.vue +40 -40
  70. package/src/components/Radio/radio.scss +68 -59
  71. package/src/components/Select/Select.vue +180 -180
  72. package/src/components/Select/select.scss +44 -44
  73. package/src/components/Sheet/Sheet.vue +92 -92
  74. package/src/components/Sheet/sheet.scss +60 -60
  75. package/src/components/Sidebar/Sidebar.vue +102 -0
  76. package/src/components/Sidebar/sidebar.scss +123 -0
  77. package/src/components/Skeleton/Skeleton.vue +43 -43
  78. package/src/components/Skeleton/skeleton.scss +14 -14
  79. package/src/components/Spinner/Spinner.vue +42 -42
  80. package/src/components/Spinner/spinner.scss +46 -46
  81. package/src/components/Switch/Switch.vue +30 -30
  82. package/src/components/Switch/switch.scss +60 -52
  83. package/src/components/Table/Cell.vue +23 -23
  84. package/src/components/Table/Header.vue +59 -59
  85. package/src/components/Table/Row.vue +9 -9
  86. package/src/components/Table/SelectAll.vue +23 -23
  87. package/src/components/Table/SelectRow.vue +29 -29
  88. package/src/components/Table/Table.vue +66 -66
  89. package/src/components/Table/table.scss +134 -134
  90. package/src/components/Table/table.ts +244 -244
  91. package/src/components/Tabs/Tab.vue +27 -27
  92. package/src/components/Tabs/Tabs.vue +89 -82
  93. package/src/components/Tabs/tabs.scss +80 -79
  94. package/src/components/Toast/Toasts.vue +47 -47
  95. package/src/components/Toast/toast.scss +41 -41
  96. package/src/components/Toast/toast.ts +68 -68
  97. package/src/components/Tooltip/Tooltip.vue +86 -86
  98. package/src/components/Tooltip/tooltip.scss +4 -4
  99. package/src/index.scss +1 -1
  100. package/src/index.ts +119 -119
  101. package/src/internal/Backdrop/Backdrop.vue +22 -22
  102. package/src/internal/Backdrop/backdrop.scss +28 -28
  103. package/src/main.ts +5 -5
  104. package/src/shared/helpers.ts +74 -74
  105. package/src/shared/types.ts +29 -29
  106. package/src/style/animation.scss +21 -21
  107. package/src/style/core.scss +150 -148
  108. package/src/style/layout.scss +168 -136
  109. package/src/style/media-query.scss +29 -29
  110. package/src/style/reset.scss +135 -135
  111. package/src/style/{fonts.scss → text.scss} +74 -53
  112. package/src/style/tooltip.scss +128 -128
  113. package/src/style/typography.scss +338 -338
  114. package/src/style/utils.scss +36 -36
@@ -1,208 +1,208 @@
1
- .vui-input-container {
2
- // Each component should have its own specification as it allows more granual
3
- // modification via CSS variables if needed
4
- --input-color-text-red: var(--color-text-red);
5
- --input-color-text: var(--color-text);
6
- --input-color-text-light: var(--color-text-light);
7
- --input-color-text-lighter: var(--color-text-lighter);
8
- --input-color-border: var(--color-border);
9
- --input-color-border-strong: var(--color-border-strong);
10
- --input-color-border-weak: var(--color-border-weak);
11
-
12
- --input-height: 34px;
13
- --input-padding: 8px;
14
- --textarea-padding: 8px;
15
-
16
- //
17
-
18
- width: 224px;
19
-
20
- &.disabled input,
21
- &.disabled textarea {
22
- cursor: not-allowed;
23
- }
24
-
25
- &.expand {
26
- width: 100%;
27
- }
28
-
29
- &.required .vui-input > label:after {
30
- content: '*';
31
- color: var(--input-color-text-red);
32
- }
33
-
34
- &.readonly .vui-input {
35
- input,
36
- textarea,
37
- .vui-input-style {
38
- pointer-events: none;
39
- color: var(--input-color-text-light);
40
- border-color: var(--input-color-border-weak);
41
- }
42
- }
43
-
44
- &.has-errors {
45
- .vui-input {
46
- .vui-input-style,
47
- textarea {
48
- border-color: var(--color-text-red) !important;
49
- }
50
- }
51
- }
52
-
53
- .vui-input {
54
- label {
55
- display: block;
56
- text-align: left;
57
- margin-bottom: 8px;
58
- font-size: var(--font-size-ms);
59
- color: var(--input-color-text);
60
- }
61
-
62
- .vui-input-hint {
63
- margin-bottom: 8px;
64
- margin-top: -4px;
65
- color: var(--input-color-text-lighter);
66
- font-size: var(--font-size-s);
67
- display: block;
68
- text-align: left;
69
- }
70
-
71
- ::placeholder {
72
- font-weight: 400;
73
- color: var(--color-text-lighter);
74
- font-family: var(--global-font);
75
- }
76
-
77
- .vui-input-style,
78
- textarea {
79
- display: block;
80
- border-radius: var(--border-radius-s);
81
- border: 1px solid var(--input-color-border);
82
- background: transparent;
83
- height: var(--input-height);
84
- line-height: var(--input-height);
85
- color: var(--color-text);
86
- outline: none !important;
87
- padding-inline: var(--input-padding);
88
- font-size: var(--font-size-ms);
89
- width: 100%;
90
- transition: var(--transition);
91
-
92
- &:has(input:focus-visible),
93
- &:focus-visible {
94
- border-color: var(--input-color-border-strong);
95
- }
96
- }
97
-
98
- input,
99
- textarea {
100
- font-family: var(--global-font);
101
- }
102
-
103
- input[type='file']::file-selector-button {
104
- background-color: var(--color-bg);
105
- color: var(--color-text);
106
- border: none;
107
- }
108
-
109
- input[type='range'] {
110
- -webkit-appearance: none; /* Override default CSS styles */
111
- appearance: none;
112
- height: 4px;
113
- border-radius: 2px;
114
- background-color: var(--color-border);
115
- }
116
-
117
- ::-moz-range-thumb,
118
- ::-webkit-slider-thumb {
119
- width: 16px;
120
- height: 16px;
121
- background-color: var(--color-text-light);
122
- border: none;
123
- }
124
-
125
- input {
126
- display: block;
127
- width: 100%;
128
- border: none;
129
- height: calc(var(--input-height) - 1px);
130
- line-height: calc(var(--input-height) - 1px);
131
- background: transparent;
132
- outline: none;
133
- font-size: var(--font-size-ms);
134
- color: var(--color-text);
135
-
136
- &:-webkit-autofill {
137
- box-shadow: 0 0 0px 1000px var(--color-bg) inset;
138
- -webkit-text-fill-color: var(--color-text);
139
- }
140
- }
141
-
142
- textarea {
143
- line-height: 1.3em;
144
- height: auto;
145
- min-height: 4lh;
146
- field-sizing: content;
147
- padding: var(--textarea-padding);
148
- transition: none;
149
- }
150
- }
151
-
152
- .vui-input-limit {
153
- display: block;
154
- margin-top: 6px;
155
- text-align: left;
156
- font-size: var(--font-size-xs);
157
- color: var(--input-color-text-lighter);
158
- }
159
-
160
- .vui-input-errors {
161
- display: flex;
162
- flex-direction: column;
163
- gap: 6px;
164
- padding-top: 6px;
165
-
166
- li {
167
- display: block;
168
- font-size: var(--font-size-s);
169
- color: var(--color-text-red);
170
- }
171
- }
172
-
173
- &.vui-dropzone {
174
- &.dragging .vui-input .vui-input-style {
175
- border-color: var(--color-border-accent);
176
-
177
- &:hover {
178
- border-color: var(--color-border);
179
- }
180
- }
181
- .vui-input {
182
- .vui-input-style {
183
- height: unset;
184
- border-width: 2px;
185
- border-style: dashed;
186
- border-radius: var(--border-radius-m);
187
- line-height: 1.2em;
188
-
189
- &:hover {
190
- border-color: var(--color-border-strong);
191
- }
192
-
193
- input {
194
- display: none;
195
-
196
- & + label {
197
- display: flex;
198
- align-items: center;
199
- justify-content: center;
200
- width: 100%;
201
- min-height: 96px;
202
- color: var(--color-text-light);
203
- }
204
- }
205
- }
206
- }
207
- }
208
- }
1
+ .vui-input-container {
2
+ // Each component should have its own specification as it allows more granual
3
+ // modification via CSS variables if needed
4
+ --input-color-text-red: var(--color-text-red);
5
+ --input-color-text: var(--color-text);
6
+ --input-color-text-light: var(--color-text-light);
7
+ --input-color-text-lighter: var(--color-text-lighter);
8
+ --input-color-border: var(--color-border);
9
+ --input-color-border-strong: var(--color-border-strong);
10
+ --input-color-border-weak: var(--color-border-weak);
11
+
12
+ --input-height: var(--interactive-el-height);
13
+ --input-padding: 8px;
14
+ --textarea-padding: 8px;
15
+
16
+ //
17
+
18
+ width: 224px;
19
+
20
+ &.disabled input,
21
+ &.disabled textarea {
22
+ cursor: not-allowed;
23
+ }
24
+
25
+ &.expand {
26
+ width: 100%;
27
+ }
28
+
29
+ &.required .vui-input > label:after {
30
+ content: '*';
31
+ color: var(--input-color-text-red);
32
+ }
33
+
34
+ &.readonly .vui-input {
35
+ input,
36
+ textarea,
37
+ .vui-input-style {
38
+ pointer-events: none;
39
+ color: var(--input-color-text-light);
40
+ border-color: var(--input-color-border-weak);
41
+ }
42
+ }
43
+
44
+ &.has-errors {
45
+ .vui-input {
46
+ .vui-input-style,
47
+ textarea {
48
+ border-color: var(--color-text-red) !important;
49
+ }
50
+ }
51
+ }
52
+
53
+ .vui-input {
54
+ label {
55
+ display: block;
56
+ text-align: left;
57
+ margin-bottom: 8px;
58
+ font-size: var(--font-size-ms);
59
+ color: var(--input-color-text);
60
+ }
61
+
62
+ .vui-input-hint {
63
+ margin-bottom: 8px;
64
+ margin-top: -4px;
65
+ color: var(--input-color-text-lighter);
66
+ font-size: var(--font-size-s);
67
+ display: block;
68
+ text-align: left;
69
+ }
70
+
71
+ ::placeholder {
72
+ font-weight: 400;
73
+ color: var(--color-text-lighter);
74
+ font-family: var(--global-font);
75
+ }
76
+
77
+ .vui-input-style,
78
+ textarea {
79
+ display: block;
80
+ border-radius: var(--border-radius-s);
81
+ border: 1px solid var(--input-color-border);
82
+ background: transparent;
83
+ height: var(--input-height);
84
+ line-height: var(--input-height);
85
+ color: var(--color-text);
86
+ outline: none;
87
+ padding-inline: var(--input-padding);
88
+ font-size: var(--font-size-ms);
89
+ width: 100%;
90
+ transition: var(--transition);
91
+
92
+ &:has(input:focus-visible),
93
+ &:focus-visible {
94
+ outline: 2px solid var(--color-text);
95
+ }
96
+ }
97
+
98
+ input,
99
+ textarea {
100
+ font-family: var(--global-font);
101
+ }
102
+
103
+ input[type='file']::file-selector-button {
104
+ background-color: var(--color-bg);
105
+ color: var(--color-text);
106
+ border: none;
107
+ }
108
+
109
+ input[type='range'] {
110
+ -webkit-appearance: none; /* Override default CSS styles */
111
+ appearance: none;
112
+ height: 4px;
113
+ border-radius: 2px;
114
+ background-color: var(--color-border);
115
+ }
116
+
117
+ ::-moz-range-thumb,
118
+ ::-webkit-slider-thumb {
119
+ width: 16px;
120
+ height: 16px;
121
+ background-color: var(--color-text-light);
122
+ border: none;
123
+ }
124
+
125
+ input {
126
+ display: block;
127
+ width: 100%;
128
+ border: none;
129
+ height: calc(var(--input-height) - 1px);
130
+ line-height: calc(var(--input-height) - 1px);
131
+ background: transparent;
132
+ outline: none;
133
+ font-size: var(--font-size-ms);
134
+ color: var(--color-text);
135
+
136
+ &:-webkit-autofill {
137
+ box-shadow: 0 0 0px 1000px var(--color-bg) inset;
138
+ -webkit-text-fill-color: var(--color-text);
139
+ }
140
+ }
141
+
142
+ textarea {
143
+ line-height: 1.3em;
144
+ height: auto;
145
+ min-height: 5lh;
146
+ field-sizing: content;
147
+ padding: var(--textarea-padding);
148
+ transition: none;
149
+ }
150
+ }
151
+
152
+ .vui-input-limit {
153
+ display: block;
154
+ margin-top: 6px;
155
+ text-align: left;
156
+ font-size: var(--font-size-xs);
157
+ color: var(--input-color-text-lighter);
158
+ }
159
+
160
+ .vui-input-errors {
161
+ display: flex;
162
+ flex-direction: column;
163
+ gap: 6px;
164
+ padding-top: 6px;
165
+
166
+ li {
167
+ display: block;
168
+ font-size: var(--font-size-s);
169
+ color: var(--color-text-red);
170
+ }
171
+ }
172
+
173
+ &.vui-dropzone {
174
+ &.dragging .vui-input .vui-input-style {
175
+ border-color: var(--color-border-accent);
176
+
177
+ &:hover {
178
+ border-color: var(--color-border);
179
+ }
180
+ }
181
+ .vui-input {
182
+ .vui-input-style {
183
+ height: unset;
184
+ border-width: 2px;
185
+ border-style: dashed;
186
+ border-radius: var(--border-radius-m);
187
+ line-height: 1.2em;
188
+
189
+ &:hover {
190
+ border-color: var(--color-border-strong);
191
+ }
192
+
193
+ input {
194
+ display: none;
195
+
196
+ & + label {
197
+ display: flex;
198
+ align-items: center;
199
+ justify-content: center;
200
+ width: 100%;
201
+ min-height: 96px;
202
+ color: var(--color-text-light);
203
+ }
204
+ }
205
+ }
206
+ }
207
+ }
208
+ }
@@ -1,48 +1,48 @@
1
- <script setup lang='ts'>
2
- import { useMagicKeys, whenever } from '@vueuse/core'
3
- import { computed } from 'vue'
4
- import './kbd.scss'
5
-
6
- interface Props {
7
- /**
8
- * Specify the key or the combination of keys connected with "+". Make sure
9
- * there are no white spaces between letters.
10
- *
11
- * keys="Escape" keys="Ctrl+A"
12
- */
13
- keys: string
14
- /**
15
- * Display custom label instead of the automatically formatted keys.
16
- */
17
- label?: string
18
- /**
19
- * Show active state when this combination of keys is pressed.
20
- */
21
- highlight?: boolean
22
- }
23
-
24
- const props = defineProps<Props>()
25
- const emits = defineEmits<{
26
- trigger: []
27
- }>()
28
- const keyHandler = useMagicKeys()
29
-
30
- whenever(keyHandler[props.keys], () => {
31
- emits('trigger')
32
- })
33
-
34
- const isActive = computed(() => {
35
- if (!props.highlight)
36
- return false
37
-
38
- return props.keys.split('+').every((key) => {
39
- return keyHandler.current.has(key.toLowerCase())
40
- })
41
- })
42
- </script>
43
-
44
- <template>
45
- <kbd class="vui-kbd" :class="{ active: isActive }">
46
- {{ props.label ?? props.keys.replaceAll("+", " + ") }}
47
- </kbd>
48
- </template>
1
+ <script setup lang='ts'>
2
+ import { useMagicKeys, whenever } from '@vueuse/core'
3
+ import { computed } from 'vue'
4
+ import './kbd.scss'
5
+
6
+ interface Props {
7
+ /**
8
+ * Specify the key or the combination of keys connected with "+". Make sure
9
+ * there are no white spaces between letters.
10
+ *
11
+ * keys="Escape" keys="Ctrl+A"
12
+ */
13
+ keys: string
14
+ /**
15
+ * Display custom label instead of the automatically formatted keys.
16
+ */
17
+ label?: string
18
+ /**
19
+ * Show active state when this combination of keys is pressed.
20
+ */
21
+ highlight?: boolean
22
+ }
23
+
24
+ const props = defineProps<Props>()
25
+ const emits = defineEmits<{
26
+ trigger: []
27
+ }>()
28
+ const keyHandler = useMagicKeys()
29
+
30
+ whenever(keyHandler[props.keys], () => {
31
+ emits('trigger')
32
+ })
33
+
34
+ const isActive = computed(() => {
35
+ if (!props.highlight)
36
+ return false
37
+
38
+ return props.keys.split('+').every((key) => {
39
+ return keyHandler.current.has(key.toLowerCase())
40
+ })
41
+ })
42
+ </script>
43
+
44
+ <template>
45
+ <kbd class="vui-kbd" :class="{ active: isActive }">
46
+ {{ props.label ?? props.keys.replaceAll("+", " + ") }}
47
+ </kbd>
48
+ </template>
@@ -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: inline-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
+ }