@dolanske/vui 0.2.0 → 0.3.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 (45) hide show
  1. package/README.md +1 -7
  2. package/dist/components/Avatar/Avatar.vue.d.ts +1 -3
  3. package/dist/components/Calendar/Calendar.vue.d.ts +1 -1
  4. package/dist/components/Flex/Flex.vue.d.ts +2 -2
  5. package/dist/components/Grid/Grid.vue.d.ts +2 -2
  6. package/dist/index.d.ts +3 -1
  7. package/dist/shared/types.d.ts +11 -0
  8. package/dist/style.css +1 -1
  9. package/dist/vui.js +4324 -4251
  10. package/package.json +6 -2
  11. package/src/App.vue +20 -4
  12. package/src/components/Accordion/accordion.scss +1 -1
  13. package/src/components/Alert/alert.scss +1 -1
  14. package/src/components/Avatar/Avatar.vue +7 -21
  15. package/src/components/Avatar/avatar.scss +6 -2
  16. package/src/components/Button/Button.vue +9 -9
  17. package/src/components/Divider/Divider.vue +9 -9
  18. package/src/components/Drawer/Drawer.vue +8 -2
  19. package/src/components/Drawer/drawer.scss +1 -1
  20. package/src/components/Dropdown/Dropdown.vue +11 -6
  21. package/src/components/Dropdown/dropdown.scss +4 -0
  22. package/src/components/Flex/Flex.vue +14 -17
  23. package/src/components/Grid/Grid.vue +9 -14
  24. package/src/components/Input/Textarea.vue +5 -7
  25. package/src/components/OTP/otp.scss +1 -2
  26. package/src/components/Popout/popout.scss +1 -0
  27. package/src/components/Progress/Progress.vue +6 -8
  28. package/src/components/Select/select.scss +1 -0
  29. package/src/components/Skeleton/Skeleton.vue +7 -9
  30. package/src/components/Spinner/Spinner.vue +7 -9
  31. package/src/components/Table/table.scss +1 -1
  32. package/src/components/Tabs/Tab.vue +7 -1
  33. package/src/components/Tabs/Tabs.vue +1 -0
  34. package/src/components/Tabs/tabs.scss +1 -0
  35. package/src/components/Toast/toast.ts +0 -24
  36. package/src/components/Tooltip/Tooltip.vue +6 -2
  37. package/src/index.ts +4 -0
  38. package/src/shared/types.ts +12 -0
  39. package/src/style/core.scss +29 -14
  40. package/src/style/fonts.scss +53 -0
  41. package/src/style/layout.scss +126 -3
  42. package/src/style/typography.scss +12 -13
  43. package/src/style/utils.scss +14 -0
  44. package/dist/shared/composables.d.ts +0 -3
  45. package/src/shared/composables.ts +0 -18
package/src/index.ts CHANGED
@@ -30,6 +30,7 @@ import Confirm from './components/Modal/Confirm.vue'
30
30
  import Modal from './components/Modal/Modal.vue'
31
31
  import OTP from './components/OTP/OTP.vue'
32
32
  import OTPItem from './components/OTP/OTPItem.vue'
33
+ import { paginate } from './components/Pagination/pagination'
33
34
  import Pagination from './components/Pagination/Pagination.vue'
34
35
  import Popout from './components/Popout/Popout.vue'
35
36
  import Progress from './components/Progress/Progress.vue'
@@ -45,6 +46,7 @@ import Header from './components/Table/Header.vue'
45
46
  import Row from './components/Table/Row.vue'
46
47
  import SelectAll from './components/Table/SelectAll.vue'
47
48
  import SelectRow from './components/Table/SelectRow.vue'
49
+ import { defineTable } from './components/Table/table'
48
50
  import Table from './components/Table/Table.vue'
49
51
  import Tab from './components/Tabs/Tab.vue'
50
52
  import Tabs from './components/Tabs/Tabs.vue'
@@ -73,6 +75,7 @@ export {
73
75
  Confirm,
74
76
  CopyClipboard,
75
77
  Counter,
78
+ defineTable,
76
79
  Divider,
77
80
  Drawer,
78
81
  Dropdown,
@@ -89,6 +92,7 @@ export {
89
92
  Modal,
90
93
  OTP,
91
94
  OTPItem,
95
+ paginate,
92
96
  Pagination,
93
97
  Password,
94
98
  Popout,
@@ -15,3 +15,15 @@ export type VueClass = string | Record<string, | boolean> | Array<string | Recor
15
15
  // FLoating UI imported types were ruining the build so here we go
16
16
  export type PopoutMaybeElement<T> = T | ComponentPublicInstance | null | undefined
17
17
  export type Placement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end'
18
+
19
+ export type Space = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl'
20
+ export enum SpaceSize {
21
+ xxs = 'xxs',
22
+ xs = 'xs',
23
+ s = 's',
24
+ m = 'm',
25
+ l = 'l',
26
+ xl = 'xl',
27
+ xxl = 'xxl',
28
+ xxxl = 'xxxl',
29
+ }
@@ -1,3 +1,4 @@
1
+ @use 'sass:meta';
1
2
  // Core of the UI library, it should only contain styles which are relevant to
2
3
  // the library and each component should import it
3
4
 
@@ -7,32 +8,39 @@
7
8
  @use './fonts.scss';
8
9
 
9
10
  :root {
11
+ --container-xs: 360px;
10
12
  --container-s: 498px;
11
13
  --container-m: 856px;
12
14
  --container-l: 1140px;
13
15
  --container-xl: 1540px;
16
+ --container-xxl: 1920px;
14
17
 
15
18
  --border-radius-xs: 2px;
16
19
  --border-radius-s: 4px;
17
20
  --border-radius-m: 8px;
18
21
  --border-radius-l: 12px;
19
22
 
23
+ --font-size-xxs: 1rem;
20
24
  --font-size-xs: 1.15rem;
21
25
  --font-size-s: 1.3rem;
22
26
  --font-size-ms: 1.45rem;
23
27
  --font-size-m: 1.6rem;
24
- --font-size-l: 1.65rem;
28
+ --font-size-l: 1.8rem;
29
+ --font-size-xl: 2rem;
30
+ --font-size-xxl: 2.6rem;
31
+ --font-size-xxxl: 3.4rem;
32
+ --font-size-xxxxl: 4.8rem;
25
33
 
26
34
  --space-xxs: 4px;
27
35
  --space-xs: 8px;
28
36
  --space-s: 12px;
29
37
  --space-m: 18px;
30
- --space-l: 26px;
31
- --space-xl: 40px;
32
- --space-xxl: 52px;
38
+ --space-l: 24px;
39
+ --space-xl: 34px;
40
+ --space-xxl: 48px;
33
41
  --space-xxxl: 64px;
34
42
 
35
- --transition-quick: 0.08s all ease-in-out;
43
+ --transition-fast: 0.08s all ease-in-out;
36
44
  --transition: 0.14s all ease-in-out;
37
45
  --transition-slow: 0.3s all ease-in-out;
38
46
 
@@ -43,6 +51,7 @@
43
51
  --color-text: rgb(231, 231, 231);
44
52
  --color-text-light: rgb(158, 158, 158);
45
53
  --color-text-lighter: rgb(100, 100, 100);
54
+ --color-text-lightest: rgb(65, 65, 65);
46
55
  --color-text-invert: rgb(17, 17, 17);
47
56
 
48
57
  --color-button-gray: rgb(28, 28, 28);
@@ -74,10 +83,10 @@
74
83
  --color-border-weak: rgb(36, 36, 36);
75
84
 
76
85
  --color-accent: rgb(56, 214, 219);
77
- --color-accent-disabled: hsl(from var(--color-accent) calc(h) calc(s * 0.5) calc(l));
86
+ --color-accent-disabled: hsl(from var(--color-accent) calc(h) calc(s * 0.4) calc(l));
78
87
  --color-bg-accent-lowered: hsl(from var(--color-accent) calc(h) s calc(l * 0.2));
79
- --color-bg-accent-raised: hsl(from var(--color-accent) calc(h) s calc(l * 0.6));
80
- --color-border-accent: hsl(from var(--color-accent) calc(h) s calc(l * 0.5));
88
+ --color-bg-accent-raised: hsl(from var(--color-accent) calc(h) s calc(l * 0.5));
89
+ --color-border-accent: hsl(from var(--color-accent) calc(h) s calc(l * 0.4));
81
90
 
82
91
  --box-shadow: 0 2px 12px rgba(8, 8, 8, 0.2);
83
92
  --box-shadow-strong: 0 4px 15px rgba(8, 8, 8, 0.4);
@@ -122,10 +131,16 @@ body {
122
131
  min-height: 100dvh;
123
132
  }
124
133
 
125
- @import './typography.scss';
126
- @import './layout.scss';
127
- @import './animation.scss';
128
- @import './tooltip.scss';
129
- @import './utils.scss';
134
+ // Set base icon color
135
+ .iconify {
136
+ color: var(--color-text-light);
137
+ }
138
+
139
+ @include meta.load-css('typography.scss');
140
+ @include meta.load-css('layout.scss');
141
+ @include meta.load-css('animation.scss');
142
+ @include meta.load-css('tooltip.scss');
143
+ @include meta.load-css('utils.scss');
144
+ @include meta.load-css('fonts.scss');
130
145
 
131
- @import './media-query.scss';
146
+ @include meta.load-css('media-query.scss');
@@ -0,0 +1,53 @@
1
+ $sizes: 'xxs', 'xs', 's', 'ms', 'm', 'l', 'xl', 'xxl', 'xxxl', 'xxxxl';
2
+
3
+ @each $size in $sizes {
4
+ .text-#{$size} {
5
+ font-size: var(--font-size-#{$size});
6
+ }
7
+ }
8
+
9
+ .text-color {
10
+ color: var(--color-text);
11
+ }
12
+
13
+ .text-color-accent {
14
+ color: var(--color-accent);
15
+ }
16
+
17
+ $colors: 'light', 'lighter', 'lightest', 'red', 'green', 'yellow', 'blue';
18
+
19
+ @each $color in $colors {
20
+ .text-color-#{$color} {
21
+ color: var(--color-text-#{$color});
22
+ }
23
+ }
24
+
25
+ // Font weights
26
+
27
+ .text-light {
28
+ font-weight: 300;
29
+ }
30
+
31
+ .text-regular {
32
+ font-weight: 400;
33
+ }
34
+
35
+ .text-medium {
36
+ font-weight: 500;
37
+ }
38
+
39
+ .text-semibold {
40
+ font-weight: 600;
41
+ }
42
+
43
+ .text-bold {
44
+ font-weight: 700;
45
+ }
46
+
47
+ .text-extra-bold {
48
+ font-weight: 800;
49
+ }
50
+
51
+ .text-black {
52
+ font-weight: 900;
53
+ }
@@ -1,4 +1,5 @@
1
- // Contains basic layout definitions and classes to compose basic layouts
1
+ // Container layout styling
2
+ $containers: 'xs', 's', 'm', 'l', 'xl', 'xxl';
2
3
 
3
4
  .container {
4
5
  display: block;
@@ -6,8 +7,130 @@
6
7
  width: 100%;
7
8
  padding-inline: var(--space-m);
8
9
  max-width: var(--container-l);
10
+
11
+ @each $container in $containers {
12
+ &.container-#{$container} {
13
+ max-width: var(--container-#{$container});
14
+ }
15
+ }
16
+
17
+ &.container-full {
18
+ max-width: 100%;
19
+ }
20
+ }
21
+
22
+ // Layout
23
+ .flex {
24
+ display: flex;
25
+ }
26
+
27
+ .inline-flex {
28
+ display: inline-flex;
29
+ }
30
+
31
+ .block {
32
+ display: block;
33
+ }
34
+
35
+ .inline-block {
36
+ display: inline-block;
37
+ }
38
+
39
+ // Sizes
40
+ // Paddings & margins
41
+ .mx-auto {
42
+ margin-inline: auto;
43
+ }
44
+
45
+ .my-auto {
46
+ margin-block: auto;
47
+ }
48
+
49
+ .m-auto {
50
+ margin: auto;
51
+ }
52
+
53
+ // Generate layout classes from size styles
54
+ $sizes: 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl';
55
+
56
+ @each $size in $sizes {
57
+ // Margin
58
+ .mb-#{$size} {
59
+ margin-bottom: var(--space-#{$size});
60
+ }
61
+
62
+ .mr-#{$size} {
63
+ margin-right: var(--space-#{$size});
64
+ }
65
+
66
+ .ml-#{$size} {
67
+ margin-left: var(--space-#{$size});
68
+ }
69
+
70
+ .mt-#{$size} {
71
+ margin-top: var(--space-#{$size});
72
+ }
73
+
74
+ .mx-#{$size} {
75
+ margin-inline: var(--space-#{$size});
76
+ }
77
+
78
+ .my-#{$size} {
79
+ margin-block: var(--space-#{$size});
80
+ }
81
+
82
+ .m-#{$size} {
83
+ margin: var(--space-#{$size});
84
+ }
85
+
86
+ // Padding
87
+ .pb-#{$size} {
88
+ padding-bottom: var(--space-#{$size});
89
+ }
90
+
91
+ .pr-#{$size} {
92
+ padding-right: var(--space-#{$size});
93
+ }
94
+
95
+ .pl-#{$size} {
96
+ padding-left: var(--space-#{$size});
97
+ }
98
+
99
+ .pt-#{$size} {
100
+ padding-top: var(--space-#{$size});
101
+ }
102
+
103
+ .px-#{$size} {
104
+ padding-inline: var(--space-#{$size});
105
+ }
106
+
107
+ .py-#{$size} {
108
+ padding-block: var(--space-#{$size});
109
+ }
110
+
111
+ .p-#{$size} {
112
+ padding: var(--space-#{$size});
113
+ }
114
+
115
+ // Gap
116
+ .g-#{$size} {
117
+ gap: var(--space-#{$size});
118
+ }
119
+
120
+ .g-y-#{$size} {
121
+ row-gap: var(--space-#{$size});
122
+ }
123
+
124
+ .g-x-#{$size} {
125
+ column-gap: var(--space-#{$size});
126
+ }
9
127
  }
10
128
 
11
- .flex-1 {
12
- flex: 1;
129
+ // Z-index
130
+ $zindexes: 0, 10, 20, 30, 40, 50, auto;
131
+
132
+ @each $zindex in $zindexes {
133
+ .z-#{$zindex} {
134
+ z-index: $zindex;
135
+ }
13
136
  }
@@ -15,27 +15,27 @@ h6 {
15
15
  }
16
16
 
17
17
  h1 {
18
- font-size: 5rem;
18
+ font-size: var(--font-size-xxxxl);
19
19
  }
20
20
 
21
21
  h2 {
22
- font-size: 3.5rem;
22
+ font-size: var(--font-size-xxxl);
23
23
  }
24
24
 
25
25
  h3 {
26
- font-size: 2.6rem;
26
+ font-size: var(--font-size-xxl);
27
27
  }
28
28
 
29
29
  h4 {
30
- font-size: 2rem;
30
+ font-size: var(--font-size-xl);
31
31
  }
32
32
 
33
33
  h5 {
34
- font-size: 1.8rem;
34
+ font-size: var(--font-size-l);
35
35
  }
36
36
 
37
37
  h6 {
38
- font-size: 1.6rem;
38
+ font-size: var(--font-size-m);
39
39
  }
40
40
 
41
41
  figcaption,
@@ -62,7 +62,7 @@ p {
62
62
  }
63
63
 
64
64
  code {
65
- border-radius: 2px;
65
+ border-radius: var(--border-radius-xs);
66
66
  background-color: var(--color-bg-raised);
67
67
  color: var(--color-text);
68
68
  border: 1px solid var(--color-border);
@@ -96,7 +96,7 @@ p {
96
96
  blockquote {
97
97
  display: block;
98
98
  padding-block: var(--space-s);
99
- padding-left: 24px;
99
+ padding-left: var(--space-l);
100
100
  border-left: 3px solid var(--color-border);
101
101
  }
102
102
 
@@ -223,7 +223,6 @@ dl {
223
223
  article,
224
224
  .typeset {
225
225
  width: 100%;
226
- // overflow: hidden;
227
226
 
228
227
  ol,
229
228
  ul {
@@ -236,7 +235,7 @@ article,
236
235
  margin-bottom: var(--space-m);
237
236
  font-size: var(--font-size-m);
238
237
  position: relative;
239
- padding-left: 32px;
238
+ padding-left: 28px;
240
239
 
241
240
  & > ul {
242
241
  margin-top: 0;
@@ -245,7 +244,7 @@ article,
245
244
  &:before {
246
245
  content: '';
247
246
  position: absolute;
248
- top: 3px;
247
+ top: 5px;
249
248
  left: 12px;
250
249
  }
251
250
 
@@ -261,7 +260,7 @@ article,
261
260
  width: 6px;
262
261
  height: 6px;
263
262
  border-radius: 100%;
264
- background-color: var(--color-text-light);
263
+ background-color: var(--color-text-lighter);
265
264
  }
266
265
  }
267
266
  }
@@ -327,7 +326,7 @@ article,
327
326
 
328
327
  figure {
329
328
  img {
330
- margin-bottom: 8px;
329
+ margin-bottom: var(--space-xs);
331
330
  }
332
331
 
333
332
  figcaption {
@@ -20,3 +20,17 @@ mark {
20
20
  padding: 1px;
21
21
  border-radius: 2px;
22
22
  }
23
+
24
+ .counter {
25
+ display: inline-flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ min-width: 20px;
29
+ height: 20px;
30
+ border-radius: 10px;
31
+ font-size: var(--font-size-xs);
32
+ color: var(--color-text);
33
+ background-color: var(--color-button-gray-hover);
34
+ font-weight: 400;
35
+ padding-inline: 4px;
36
+ }
@@ -1,3 +0,0 @@
1
- import { ComputedRef } from 'vue';
2
- import { Sizes } from './types';
3
- export declare function useActualGap(gap?: Sizes | number): ComputedRef<string>;
@@ -1,18 +0,0 @@
1
- import type { ComputedRef } from 'vue'
2
- import type { Sizes } from './types'
3
- import { computed } from 'vue'
4
- import { Size } from './types'
5
-
6
- // Some files may share the same properties
7
- export function useActualGap(gap?: Sizes | number): ComputedRef<string> {
8
- return computed(() => {
9
- if (typeof gap === 'number')
10
- return `${gap}px`
11
- switch (gap) {
12
- case Size.s: return '4px'
13
- case Size.l: return '16px'
14
- case Size.m:
15
- default: return '8px'
16
- }
17
- })
18
- }