webcoreui 0.0.12 → 0.1.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.
- package/README.md +10 -5
- package/components/Accordion/accordion.module.scss +21 -27
- package/components/Alert/alert.module.scss +18 -21
- package/components/Avatar/avatar.module.scss +9 -6
- package/components/Badge/badge.module.scss +31 -34
- package/components/Button/Button.astro +0 -2
- package/components/Button/Button.svelte +0 -2
- package/components/Button/Button.tsx +0 -2
- package/components/Button/button.module.scss +32 -39
- package/components/Button/button.ts +0 -1
- package/components/Card/card.module.scss +20 -15
- package/components/Checkbox/checkbox.module.scss +27 -41
- package/components/Icon/Icon.astro +2 -2
- package/components/Input/input.module.scss +28 -36
- package/components/Menu/menu.module.scss +141 -144
- package/components/Progress/progress.module.scss +26 -22
- package/components/Radio/radio.module.scss +33 -41
- package/components/Rating/rating.module.scss +15 -8
- package/components/Spinner/spinner.module.scss +11 -2
- package/components/Switch/switch.module.scss +28 -30
- package/components/Table/table.module.scss +13 -17
- package/components/Tabs/Tabs.astro +0 -1
- package/components/Tabs/tabs.module.scss +40 -48
- package/components/ThemeSwitcher/themeswitcher.module.scss +28 -26
- package/components/Timeline/timeline.module.scss +24 -19
- package/components/TimelineItem/timelineitem.module.scss +15 -17
- package/components/Toast/toast.module.scss +10 -14
- package/components/Toast/toast.ts +6 -1
- package/icons.d.ts +11 -0
- package/icons.js +9 -0
- package/package.json +3 -1
- package/scss/config/color-palette.scss +23 -0
- package/scss/config/css-values.scss +44 -0
- package/scss/config/layout.scss +41 -0
- package/scss/config/mixins.scss +395 -9
- package/scss/config/typography.scss +66 -0
- package/scss/config.scss +6 -1
- package/scss/global/elements.scss +21 -1
- package/scss/global/scrollbar.scss +12 -9
- package/scss/global/theme.scss +2 -2
- package/scss/global/tooltip.scss +40 -35
- package/scss/global/utility.scss +4 -4
- package/scss/global.scss +0 -1
- package/scss/resets.scss +62 -9
- package/scss/setup.scss +12 -39
- package/utils/toast.ts +3 -2
package/scss/global/utility.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use '../config' as *;
|
|
2
2
|
|
|
3
|
-
@mixin
|
|
3
|
+
@mixin utility() {
|
|
4
4
|
.container {
|
|
5
5
|
margin: 0 auto;
|
|
6
6
|
max-width: 1200px;
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
margin: 20px auto;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
@include
|
|
61
|
+
@include media('md') {
|
|
62
62
|
.grid.md-2 {
|
|
63
63
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
64
64
|
}
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
@include
|
|
75
|
+
@include media('lg') {
|
|
76
76
|
.grid.lg-2 {
|
|
77
77
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
78
78
|
}
|
package/scss/global.scss
CHANGED
package/scss/resets.scss
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use './config.scss' as *;
|
|
2
|
+
|
|
3
|
+
@mixin resets() {
|
|
2
4
|
@if (config('fontRegular')) {
|
|
3
5
|
@font-face {
|
|
4
6
|
font-family: Regular;
|
|
@@ -18,12 +20,12 @@
|
|
|
18
20
|
* {
|
|
19
21
|
box-sizing: border-box;
|
|
20
22
|
}
|
|
21
|
-
|
|
23
|
+
|
|
22
24
|
body {
|
|
23
|
-
background
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
@include background(primary-70);
|
|
26
|
+
@include typography(primary, default);
|
|
27
|
+
@include spacing(m0);
|
|
28
|
+
|
|
27
29
|
font-family: Regular, 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
|
|
28
30
|
}
|
|
29
31
|
|
|
@@ -33,16 +35,67 @@
|
|
|
33
35
|
h4,
|
|
34
36
|
h5,
|
|
35
37
|
h6,
|
|
36
|
-
strong
|
|
38
|
+
strong,
|
|
39
|
+
b {
|
|
37
40
|
font-family: Bold, 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
a {
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
@include transition(color);
|
|
45
|
+
@include typography(primary);
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
button {
|
|
46
49
|
font-family: Regular;
|
|
47
50
|
}
|
|
51
|
+
|
|
52
|
+
code,
|
|
53
|
+
pre {
|
|
54
|
+
@include border(primary-50);
|
|
55
|
+
@include border-radius(md);
|
|
56
|
+
@include typography(sm);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
code {
|
|
60
|
+
@include spacing(py-xxs, px-sm, my-xxs);
|
|
61
|
+
display: inline-block;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
pre {
|
|
65
|
+
@include background(primary-60);
|
|
66
|
+
@include spacing(p-sm, my-default);
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
figure {
|
|
71
|
+
@include spacing(my-default);
|
|
72
|
+
@include layout(inline-flex, column, v-center, xs);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
figcaption {
|
|
76
|
+
@include typography(sm, primary-20);
|
|
77
|
+
|
|
78
|
+
a {
|
|
79
|
+
@include typography(primary-20);
|
|
80
|
+
|
|
81
|
+
&:hover {
|
|
82
|
+
@include typography(primary);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
p, ul, ol {
|
|
88
|
+
@include typography(md, hlg);
|
|
89
|
+
@include spacing(my-default);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
li {
|
|
93
|
+
@include spacing(mb-sm);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
blockquote {
|
|
97
|
+
@include typography(md);
|
|
98
|
+
@include spacing(my-default, mx-none, pl-default);
|
|
99
|
+
@include border(2px, left, primary-30);
|
|
100
|
+
}
|
|
48
101
|
}
|
package/scss/setup.scss
CHANGED
|
@@ -3,76 +3,49 @@
|
|
|
3
3
|
$config: (
|
|
4
4
|
includeResets: true,
|
|
5
5
|
includeHelperClasses: true,
|
|
6
|
-
includeElementStyles: true,
|
|
7
6
|
includeTooltip: true,
|
|
8
7
|
includeScrollbarStyles: true
|
|
9
8
|
);
|
|
10
9
|
|
|
11
10
|
body {
|
|
12
|
-
--w-
|
|
13
|
-
--w-
|
|
14
|
-
--w-
|
|
15
|
-
--w-
|
|
16
|
-
--w-progress-stripe-light: var(--w-color-primary);
|
|
17
|
-
--w-progress-stripe-dark: var(--w-color-primary-10);
|
|
18
|
-
--w-radio-color: var(--w-color-primary);
|
|
19
|
-
--w-rating-color: var(--w-color-primary);
|
|
20
|
-
--w-rating-empty-color: var(--w-color-primary);
|
|
21
|
-
--w-rating-empty-background: var(--w-color-primary-70);
|
|
22
|
-
--w-rating-size: 18px;
|
|
23
|
-
--w-scrollbar-bg: var(--w-color-primary-60);
|
|
24
|
-
--w-scrollbar-fg: var(--w-color-primary-50);
|
|
25
|
-
--w-spinner-color: var(--w-color-primary);
|
|
26
|
-
--w-spinner-width: 2px;
|
|
27
|
-
--w-spinner-speed: 2s;
|
|
28
|
-
--w-spinner-size: 30px;
|
|
29
|
-
--w-spinner-dash: 8;
|
|
30
|
-
--w-switch-off-color: var(--w-color-primary-50);
|
|
31
|
-
--w-switch-on-color: var(--w-color-primary);
|
|
32
|
-
--w-theme-switcher-size: 20px;
|
|
33
|
-
--w-timeline-color: var(--w-color-primary-50);
|
|
34
|
-
--w-timeline-text-color: var(--w-color-primary);
|
|
35
|
-
--w-timeline-counter: decimal;
|
|
36
|
-
--w-tooltip-background: var(--w-color-primary);
|
|
37
|
-
--w-tooltip-color: var(--w-color-primary-70);
|
|
11
|
+
--w-sm-radius: 2px;
|
|
12
|
+
--w-md-radius: 5px;
|
|
13
|
+
--w-lg-radius: 10px;
|
|
14
|
+
--w-xl-radius: 15px;
|
|
38
15
|
}
|
|
39
16
|
|
|
40
17
|
@function config($key) {
|
|
41
18
|
@return map.get($config, $key);
|
|
42
19
|
}
|
|
43
20
|
|
|
44
|
-
@mixin
|
|
21
|
+
@mixin setup($customConfig: ()) {
|
|
45
22
|
$config: map.merge($config, $customConfig) !global;
|
|
46
23
|
|
|
47
24
|
@if (config('includeResets')) {
|
|
48
|
-
@include
|
|
25
|
+
@include resets();
|
|
49
26
|
}
|
|
50
27
|
|
|
51
28
|
@if (config('includeHelperClasses')) {
|
|
52
|
-
@include
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@if (config('includeElementStyles')) {
|
|
56
|
-
@include Elements();
|
|
29
|
+
@include utility();
|
|
57
30
|
}
|
|
58
31
|
|
|
59
32
|
@if (config('includeScrollbarStyles')) {
|
|
60
|
-
@include
|
|
33
|
+
@include scrollbar();
|
|
61
34
|
}
|
|
62
35
|
|
|
63
36
|
@if (config('includeTooltip')) {
|
|
64
|
-
@include
|
|
37
|
+
@include tooltip();
|
|
65
38
|
}
|
|
66
39
|
|
|
67
40
|
@if (config('theme')) {
|
|
68
|
-
@include
|
|
41
|
+
@include theme(config('theme'));
|
|
69
42
|
}
|
|
70
43
|
|
|
71
44
|
@if (config('themes')) {
|
|
72
45
|
@each $theme, $selector in config('themes') {
|
|
73
|
-
@include
|
|
46
|
+
@include theme($theme, $selector);
|
|
74
47
|
}
|
|
75
48
|
} @else if (not config('theme')) {
|
|
76
|
-
@include
|
|
49
|
+
@include theme('dark');
|
|
77
50
|
}
|
|
78
51
|
}
|
package/utils/toast.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AlertProps } from '../components/Alert/alert'
|
|
2
|
+
import type { ToastProps } from '../components/Toast/toast'
|
|
2
3
|
|
|
3
4
|
type Toast = {
|
|
4
5
|
element: string
|
|
@@ -6,12 +7,12 @@ type Toast = {
|
|
|
6
7
|
title?: AlertProps['title']
|
|
7
8
|
content?: string
|
|
8
9
|
theme?: AlertProps['theme']
|
|
9
|
-
position?:
|
|
10
|
+
position?: ToastProps['position']
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
let defaultTimeout = 5000
|
|
13
14
|
|
|
14
|
-
export
|
|
15
|
+
export const setDefaultTimeout = (time: number) => defaultTimeout = time
|
|
15
16
|
|
|
16
17
|
export const toast = (config: Toast | string) => {
|
|
17
18
|
const element = typeof config === 'string'
|