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,6 +1,6 @@
1
- @import '../config';
1
+ @use '../config' as *;
2
2
 
3
- @mixin Utility() {
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 Media('md') {
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 Media('lg') {
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
@@ -1,4 +1,3 @@
1
- @import './global/elements.scss';
2
1
  @import './global/scrollbar.scss';
3
2
  @import './global/theme.scss';
4
3
  @import './global/tooltip.scss';
package/scss/resets.scss CHANGED
@@ -1,4 +1,6 @@
1
- @mixin Resets() {
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: var(--w-color-primary-70);
24
- color: var(--w-color-primary);
25
- margin: 0;
26
- font-size: 18px;
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
- color: var(--w-color-primary);
42
- text-decoration: none;
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-avatar-border: var(--w-color-primary-70);
13
- --w-checkbox-color: var(--w-color-primary);
14
- --w-progress-color: var(--w-color-primary);
15
- --w-progress-background: var(--w-color-primary-50);
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 Setup($customConfig: ()) {
21
+ @mixin setup($customConfig: ()) {
45
22
  $config: map.merge($config, $customConfig) !global;
46
23
 
47
24
  @if (config('includeResets')) {
48
- @include Resets();
25
+ @include resets();
49
26
  }
50
27
 
51
28
  @if (config('includeHelperClasses')) {
52
- @include Utility();
53
- }
54
-
55
- @if (config('includeElementStyles')) {
56
- @include Elements();
29
+ @include utility();
57
30
  }
58
31
 
59
32
  @if (config('includeScrollbarStyles')) {
60
- @include Scrollbar();
33
+ @include scrollbar();
61
34
  }
62
35
 
63
36
  @if (config('includeTooltip')) {
64
- @include Tooltip();
37
+ @include tooltip();
65
38
  }
66
39
 
67
40
  @if (config('theme')) {
68
- @include Theme(config('theme'));
41
+ @include theme(config('theme'));
69
42
  }
70
43
 
71
44
  @if (config('themes')) {
72
45
  @each $theme, $selector in config('themes') {
73
- @include Theme($theme, $selector);
46
+ @include theme($theme, $selector);
74
47
  }
75
48
  } @else if (not config('theme')) {
76
- @include Theme('dark');
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?: string
10
+ position?: ToastProps['position']
10
11
  }
11
12
 
12
13
  let defaultTimeout = 5000
13
14
 
14
- export let setDefaultTimeout = (time: number) => defaultTimeout = time
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'