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.
Files changed (46) hide show
  1. package/README.md +10 -5
  2. package/components/Accordion/accordion.module.scss +21 -27
  3. package/components/Alert/alert.module.scss +18 -21
  4. package/components/Avatar/avatar.module.scss +9 -6
  5. package/components/Badge/badge.module.scss +31 -34
  6. package/components/Button/Button.astro +0 -2
  7. package/components/Button/Button.svelte +0 -2
  8. package/components/Button/Button.tsx +0 -2
  9. package/components/Button/button.module.scss +32 -39
  10. package/components/Button/button.ts +0 -1
  11. package/components/Card/card.module.scss +20 -15
  12. package/components/Checkbox/checkbox.module.scss +27 -41
  13. package/components/Icon/Icon.astro +2 -2
  14. package/components/Input/input.module.scss +28 -36
  15. package/components/Menu/menu.module.scss +141 -144
  16. package/components/Progress/progress.module.scss +26 -22
  17. package/components/Radio/radio.module.scss +33 -41
  18. package/components/Rating/rating.module.scss +15 -8
  19. package/components/Spinner/spinner.module.scss +11 -2
  20. package/components/Switch/switch.module.scss +28 -30
  21. package/components/Table/table.module.scss +13 -17
  22. package/components/Tabs/Tabs.astro +0 -1
  23. package/components/Tabs/tabs.module.scss +40 -48
  24. package/components/ThemeSwitcher/themeswitcher.module.scss +28 -26
  25. package/components/Timeline/timeline.module.scss +24 -19
  26. package/components/TimelineItem/timelineitem.module.scss +15 -17
  27. package/components/Toast/toast.module.scss +10 -14
  28. package/components/Toast/toast.ts +6 -1
  29. package/icons.d.ts +11 -0
  30. package/icons.js +9 -0
  31. package/package.json +3 -1
  32. package/scss/config/color-palette.scss +23 -0
  33. package/scss/config/css-values.scss +44 -0
  34. package/scss/config/layout.scss +41 -0
  35. package/scss/config/mixins.scss +395 -9
  36. package/scss/config/typography.scss +66 -0
  37. package/scss/config.scss +6 -1
  38. package/scss/global/elements.scss +21 -1
  39. package/scss/global/scrollbar.scss +12 -9
  40. package/scss/global/theme.scss +2 -2
  41. package/scss/global/tooltip.scss +40 -35
  42. package/scss/global/utility.scss +4 -4
  43. package/scss/global.scss +0 -1
  44. package/scss/resets.scss +62 -9
  45. package/scss/setup.scss +12 -39
  46. package/utils/toast.ts +3 -2
@@ -1,26 +1,20 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-checkbox-color: var(--w-color-primary);
5
+ }
2
6
 
3
7
  .checkbox {
8
+ @include layout(inline-flex, sm);
9
+ @include typography(md, hmd);
10
+
4
11
  cursor: pointer;
5
- display: inline-flex;
6
- align-items: center;
7
- gap: 10px;
8
- font-size: 16px;
9
- line-height: 1.5;
10
12
 
11
13
  &.col {
12
- flex-direction: column;
13
- align-items: flex-start;
14
- justify-content: flex-start;
15
- gap: 0;
14
+ @include layout(column, h-start, v-start, none);
16
15
 
17
16
  .wrapper {
18
- display: flex;
19
- gap: 10px;
20
-
21
- .check {
22
- margin-top: 5px;
23
- }
17
+ @include layout(flex, sm);
24
18
  }
25
19
  }
26
20
 
@@ -28,56 +22,48 @@
28
22
  display: none;
29
23
 
30
24
  &:checked + span {
31
- background-color: var(--w-checkbox-color);
25
+ @include background(var(--w-checkbox-color));
32
26
 
33
27
  svg {
34
- position: absolute;
35
- top: 50%;
36
- left: 50%;
37
- transform: translate(-50%, -50%);
28
+ @include position(absolute, center);
29
+ @include typography(primary-50);
30
+ @include size(10px);
31
+
38
32
  display: block;
39
- color: var(--w-color-primary-50);
40
- width: 10px;
41
- height: 10px;
42
33
  }
43
34
  }
44
35
 
45
36
  &:disabled + span {
46
- background-color: var(--w-color-primary-40);
47
- border-color: var(--w-color-primary-40);
37
+ @include background(primary-40);
38
+ @include border(primary-40);
48
39
  cursor: no-drop;
49
40
  }
50
41
  }
51
42
 
52
- a {
53
- text-decoration: underline;
54
- }
55
-
56
43
  .check {
44
+ @include size(15px);
45
+ @include position(relative);
46
+ @include border-radius(sm);
47
+ @include spacing(mt-xs);
48
+
57
49
  display: inline-block;
58
- width: 15px;
59
- height: 15px;
60
50
  min-width: 15px;
61
51
  border: 1px solid var(--w-checkbox-color);
62
- border-radius: 2px;
63
- position: relative;
64
52
 
65
53
  svg {
66
- display: none;
54
+ @include visibility(none);
67
55
  }
68
56
  }
69
57
 
70
58
  .text {
71
- margin-left: 25px;
72
- font-size: 14px;
73
- color: var(--w-color-primary-20);
59
+ @include spacing(ml-lg);
60
+ @include typography(sm, primary-20);
74
61
 
75
62
  a {
76
- @include Transition(color);
77
- color: var(--w-color-primary-20);
63
+ @include typography(primary-20);
78
64
 
79
65
  &:hover {
80
- color: var(--w-color-primary);
66
+ @include typography(primary);
81
67
  }
82
68
  }
83
69
  }
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  import type { IconProps } from './icon'
3
+ import iconMap from './map'
3
4
 
4
5
  interface Props extends IconProps {}
5
6
 
@@ -9,8 +10,7 @@ const {
9
10
  color
10
11
  } = Astro.props
11
12
 
12
- const { default: markup } = await import(`../../icons/${type}.svg?raw`)
13
- const icon = markup
13
+ const icon = iconMap[type as keyof typeof iconMap]
14
14
  .replace('width="24"', `width=${size}`)
15
15
  .replace('height="24"', color
16
16
  ? `height=${size} color=${color}`
@@ -1,87 +1,79 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
2
 
3
3
  .input {
4
- border-radius: 2px;
5
- padding: 5px 10px;
6
- border: 1px solid var(--w-color-primary-50);
7
- background: transparent;
8
- font-family: Regular;
9
- color: var(--w-color-primary);
10
- line-height: 20px;
11
- width: 100%;
4
+ @include border-radius(sm);
5
+ @include spacing(py-xs, px-sm);
6
+ @include border(primary-50);
7
+ @include background(transparent);
8
+ @include typography(regular, primary, hlg);
9
+ @include size('w100%');
10
+
12
11
  color-scheme: var(--w-color-scheme);
13
12
 
14
13
  &[disabled] {
14
+ @include typography(primary-30);
15
15
  cursor: no-drop;
16
- color: var(--w-color-primary-30);
17
16
  }
18
17
 
19
18
  &::file-selector-button {
20
- background: transparent;
21
- border: 0;
22
- color: var(--w-color-primary);
19
+ @include background(transparent);
20
+ @include border(0);
21
+ @include typography(primary);
23
22
  }
24
23
 
25
24
  &::placeholder {
26
- color: var(--w-color-primary-30);
25
+ @include typography(primary-30);
27
26
  }
28
27
 
29
28
  &[type="color"] {
30
- padding: 0;
29
+ @include spacing(p0);
31
30
  }
32
31
 
33
32
  &.info {
34
- border-color: #48dbfb;
33
+ @include border(info);
35
34
  }
36
35
 
37
36
  &.success {
38
- border-color: #1dd1a1;
37
+ @include border(success);
39
38
  }
40
39
 
41
40
  &.warning {
42
- border-color: #f7aa61;
41
+ @include border(warning);
43
42
  }
44
43
 
45
44
  &.alert {
46
- border-color: #ee5253;
45
+ @include border(alert);
47
46
  }
48
47
 
49
48
  &.fill {
50
- background: var(--w-color-primary-50);
49
+ @include background(primary-50);
51
50
  }
52
51
  }
53
52
 
54
53
  .input-label {
55
- display: flex;
56
- flex-direction: column;
54
+ @include layout(flex, column);
57
55
 
58
56
  .label {
59
- font-size: 16px;
60
- color: var(--w-color-primary-20);
61
- margin-bottom: 5px;
57
+ @include typography(md, primary-20);
58
+ @include spacing(mb-xs);
62
59
  }
63
60
 
64
61
  .wrapper {
65
- display: flex;
66
- gap: 10px;
67
- align-items: center;
68
- position: relative;
62
+ @include layout(flex, v-center, sm);
63
+ @include position(relative);
69
64
 
70
65
  input {
71
66
  padding-left: 40px;
72
67
  }
73
68
 
74
69
  svg {
75
- position: absolute;
76
- left: 10px;
77
- width: 20px;
78
- height: 20px;
70
+ @include position(absolute, l10px);
71
+ @include size(20px);
79
72
  }
80
73
  }
81
74
 
82
75
  .subtext {
83
- font-size: 14px;
84
- color: var(--w-color-primary-30);
85
- margin-top: 5px;
76
+ @include typography(sm, primary-30);
77
+ @include spacing(mt-xs);
86
78
  }
87
79
  }
@@ -1,144 +1,141 @@
1
- @import '../../scss/config.scss';
2
-
3
- .menu {
4
- background: var(--w-color-primary-70);
5
- padding: 15px;
6
- font-size: 16px;
7
- border-bottom: 1px solid var(--w-color-primary-50);
8
- position: sticky;
9
- top: 0;
10
- z-index: 99;
11
-
12
- &[data-active="true"] {
13
- .hamburger {
14
- box-shadow: 0 0 0 1000px var(--w-color-primary-70);
15
-
16
- .meat:first-child,
17
- .meat:last-child {
18
- opacity: 0;
19
- }
20
-
21
- .meat:first-child {
22
- transform: translateY(20px) scale(0);
23
- }
24
-
25
- .meat:last-child {
26
- transform: translateY(-20px) scale(0);
27
- }
28
-
29
- .meat:nth-child(2) {
30
- transform: rotate(45deg);
31
- }
32
-
33
- .meat:nth-child(3) {
34
- transform: rotate(-45deg);
35
- }
36
- }
37
-
38
- ul {
39
- @include Transition(opacity);
40
- opacity: 1;
41
- z-index: 99;
42
- pointer-events: all;
43
- }
44
- }
45
-
46
- .wrapper {
47
- display: flex;
48
- align-items: center;
49
- gap: 20px;
50
- }
51
-
52
- img,
53
- svg {
54
- display: block;
55
- }
56
-
57
- ul {
58
- margin: 0;
59
- padding: 0;
60
- list-style-type: none;
61
- display: flex;
62
- gap: 20px;
63
- position: fixed;
64
- top: 20px;
65
- left: 20px;
66
- flex-direction: column;
67
- opacity: 0;
68
- pointer-events: none;
69
-
70
- a {
71
- @include Transition(color);
72
- color: var(--w-color-primary-20);
73
-
74
- &:hover {
75
- color: var(--w-color-primary);
76
- }
77
- }
78
- }
79
-
80
- .hamburger {
81
- @include Transition(box-shadow);
82
- position: relative;
83
- width: 30px;
84
- height: 20px;
85
- box-shadow: 0 0 0 0 var(--w-color-primary-70);
86
- border-radius: 50%;
87
- padding: 0;
88
- border: 0;
89
- background: transparent;
90
- z-index: 98;
91
- cursor: pointer;
92
-
93
- .meat {
94
- @include Transition();
95
- width: 100%;
96
- position: absolute;
97
- height: 2px;
98
- background: var(--w-color-primary);
99
- display: block;
100
- border-radius: 5px;
101
-
102
- &:first-child {
103
- top: 0;
104
- }
105
-
106
- &:nth-child(2),
107
- &:nth-child(3) {
108
- top: 50%;
109
- transform: translateY(-50%);
110
- }
111
-
112
- &:last-child {
113
- bottom: 0;
114
- }
115
- }
116
- }
117
- }
118
-
119
- .container {
120
- display: flex;
121
- align-items: center;
122
- gap: 20px;
123
- justify-content: space-between;
124
- flex-wrap: wrap;
125
- max-width: 1200px;
126
- margin: 0 auto;
127
- padding: 0 20px;
128
- }
129
-
130
- @include Media('sm') {
131
- .menu {
132
- .hamburger {
133
- display: none;
134
- }
135
-
136
- ul {
137
- position: static;
138
- opacity: 1;
139
- flex-direction: row;
140
- pointer-events: all;
141
- transform: none;
142
- }
143
- }
144
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .menu {
4
+ @include background(primary-70);
5
+ @include spacing(p-md);
6
+ @include typography(md);
7
+ @include border(bottom, primary-50);
8
+ @include position(sticky, t0);
9
+ @include layer(header);
10
+
11
+ &[data-active="true"] {
12
+ .hamburger {
13
+ box-shadow: 0 0 0 1000px var(--w-color-primary-70);
14
+
15
+ .meat:first-child,
16
+ .meat:last-child {
17
+ @include visibility(0);
18
+ }
19
+
20
+ .meat:first-child {
21
+ transform: translateY(20px) scale(0);
22
+ }
23
+
24
+ .meat:last-child {
25
+ transform: translateY(-20px) scale(0);
26
+ }
27
+
28
+ .meat:nth-child(2) {
29
+ transform: rotate(45deg);
30
+ }
31
+
32
+ .meat:nth-child(3) {
33
+ transform: rotate(-45deg);
34
+ }
35
+ }
36
+
37
+ ul {
38
+ @include transition(opacity);
39
+ @include visibility(1);
40
+ @include layer(header);
41
+ pointer-events: all;
42
+ }
43
+ }
44
+
45
+ .wrapper {
46
+ @include layout(flex, v-center, default);
47
+ }
48
+
49
+ a {
50
+ @include typography(none);
51
+ }
52
+
53
+ img,
54
+ svg {
55
+ display: block;
56
+ }
57
+
58
+ ul {
59
+ @include spacing(0);
60
+ @include layout(flex, default, column);
61
+ @include position(fixed, t20px, l20px);
62
+ @include visibility(0);
63
+ @include typography(normal);
64
+
65
+ list-style-type: none;
66
+ pointer-events: none;
67
+
68
+ li {
69
+ @include spacing(m0);
70
+ }
71
+
72
+ a {
73
+ @include typography(primary-20);
74
+
75
+ &:hover {
76
+ @include typography(primary);
77
+ }
78
+ }
79
+ }
80
+
81
+ .hamburger {
82
+ @include transition(box-shadow);
83
+ @include position(relative);
84
+ @include size(w30px, h20px);
85
+ @include border-radius(max);
86
+ @include spacing(p0);
87
+ @include border(0);
88
+ @include background(transparent);
89
+ @include layer(top);
90
+
91
+ box-shadow: 0 0 0 0 var(--w-color-primary-70);
92
+ cursor: pointer;
93
+
94
+ .meat {
95
+ @include transition();
96
+ @include size('w100%', h2px);
97
+ @include position(absolute);
98
+ @include background(primary);
99
+ @include border-radius(md);
100
+
101
+ display: block;
102
+
103
+ &:first-child {
104
+ @include position(t0);
105
+ }
106
+
107
+ &:nth-child(2),
108
+ &:nth-child(3) {
109
+ @include position(v-center);
110
+ }
111
+
112
+ &:last-child {
113
+ @include position(b0);
114
+ }
115
+ }
116
+ }
117
+ }
118
+
119
+ .container {
120
+ @include layout(flex, v-center, default, h-between, wrap);
121
+ @include spacing(auto-none, px-default);
122
+
123
+ max-width: 1200px;
124
+ }
125
+
126
+ @include media('sm') {
127
+ .menu {
128
+ .hamburger {
129
+ @include visibility(none);
130
+ }
131
+
132
+ ul {
133
+ @include position(static);
134
+ @include visibility(1);
135
+ @include layout(row);
136
+
137
+ pointer-events: all;
138
+ transform: none;
139
+ }
140
+ }
141
+ }
@@ -1,35 +1,40 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-progress-color: var(--w-color-primary);
5
+ --w-progress-background: var(--w-color-primary-50);
6
+ --w-progress-stripe-light: var(--w-color-primary);
7
+ --w-progress-stripe-dark: var(--w-color-primary-10);
8
+ }
2
9
 
3
10
  .w-progress {
4
- width: 100%;
5
- height: 10px;
6
- background: var(--w-progress-background);
7
- border-radius: 20px;
8
- overflow: hidden;
11
+ @include size('w100%', h10px);
12
+ @include border-radius(xl);
13
+ @include visibility(hidden);
14
+ @include typography(bold, xxs);
15
+ @include background(var(--w-progress-background));
16
+
9
17
  color: var(--w-progress-background);
10
- font-family: Bold;
11
- font-size: 10px;
12
18
 
13
19
  &.medium {
14
- height: 15px;
15
- font-size: 12px;
20
+ @include size(h15px);
21
+ @include typography(xs);
16
22
  }
17
23
 
18
24
  &.large {
19
- height: 20px;
20
- font-size: 14px;
25
+ @include size(h20px);
26
+ @include typography(sm);
21
27
  }
22
28
 
23
29
  &.square {
24
- border-radius: 2px;
30
+ @include border-radius(sm);
25
31
 
26
32
  .progress {
27
- border-radius: 2px;
33
+ @include border-radius(sm);
28
34
  }
29
35
  }
30
36
 
31
37
  &.striped {
32
-
33
38
  .progress {
34
39
  background-size: 10px 10px;
35
40
  background-image: linear-gradient(
@@ -54,13 +59,12 @@
54
59
  }
55
60
 
56
61
  .progress {
57
- @include Transition(width);
62
+ @include transition(width);
63
+ @include size('h100%');
64
+ @include border-radius(xl);
65
+ @include layout(flex, center);
66
+ @include background(var(--w-progress-color));
67
+
58
68
  width: var(--w-progress-width);
59
- height: 100%;
60
- background: var(--w-progress-color);
61
- border-radius: 20px;
62
- display: flex;
63
- align-items: center;
64
- justify-content: center;
65
69
  }
66
70
  }