webcoreui 0.7.0 → 0.8.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 (53) hide show
  1. package/README.md +17 -7
  2. package/astro.d.ts +6 -0
  3. package/astro.js +4 -0
  4. package/components/AspectRatio/aspect-ratio.module.scss +10 -10
  5. package/components/Banner/banner.module.scss +57 -57
  6. package/components/Breadcrumb/breadcrumb.module.scss +26 -26
  7. package/components/Button/button.module.scss +4 -0
  8. package/components/Carousel/carousel.module.scss +1 -1
  9. package/components/Collapsible/collapsible.module.scss +29 -29
  10. package/components/ConditionalWrapper/conditionalwrapper.ts +1 -0
  11. package/components/DataTable/datatable.module.scss +102 -102
  12. package/components/Footer/footer.module.scss +61 -61
  13. package/components/Group/group.module.scss +43 -43
  14. package/components/Kbd/kbd.module.scss +8 -8
  15. package/components/List/list.module.scss +91 -91
  16. package/components/Masonry/masonry.module.scss +1 -1
  17. package/components/Modal/modal.module.scss +110 -110
  18. package/components/Pagination/pagination.module.scss +1 -1
  19. package/components/Popover/popover.module.scss +52 -52
  20. package/components/Ribbon/Ribbon.astro +28 -0
  21. package/components/Ribbon/Ribbon.svelte +26 -0
  22. package/components/Ribbon/Ribbon.tsx +33 -0
  23. package/components/Ribbon/ribbon.module.scss +84 -0
  24. package/components/Ribbon/ribbon.ts +16 -0
  25. package/components/Select/select.module.scss +25 -25
  26. package/components/Sheet/sheet.module.scss +68 -68
  27. package/components/Sidebar/sidebar.module.scss +43 -43
  28. package/components/Skeleton/Skeleton.astro +35 -0
  29. package/components/Skeleton/Skeleton.svelte +31 -0
  30. package/components/Skeleton/Skeleton.tsx +34 -0
  31. package/components/Skeleton/skeleton.module.scss +68 -0
  32. package/components/Skeleton/skeleton.ts +9 -0
  33. package/components/Slider/slider.module.scss +68 -68
  34. package/components/Spoiler/spoiler.module.scss +40 -40
  35. package/components/Stepper/stepper.module.scss +102 -102
  36. package/components/Table/Table.tsx +1 -1
  37. package/components/Textarea/textarea.module.scss +36 -36
  38. package/package.json +2 -2
  39. package/react.d.ts +6 -0
  40. package/react.js +4 -0
  41. package/scss/config/color-palette.scss +2 -0
  42. package/scss/config/css-values.scss +2 -0
  43. package/scss/config/layout.scss +2 -0
  44. package/scss/config/mixins.scss +7 -0
  45. package/scss/config/typography.scss +2 -0
  46. package/scss/config/variables.scss +2 -0
  47. package/scss/config.scss +7 -7
  48. package/scss/global.scss +4 -4
  49. package/scss/index.scss +3 -3
  50. package/scss/resets.scss +5 -5
  51. package/scss/setup.scss +7 -1
  52. package/svelte.d.ts +6 -0
  53. package/svelte.js +4 -0
package/README.md CHANGED
@@ -52,18 +52,18 @@ Webcore can be used as a standalone project, or it can be integrated into your e
52
52
 
53
53
  Webcore components use Sass for styling. To use the component library, you must have the following packages installed:
54
54
 
55
- - [Sass](https://www.npmjs.com/package/sass) - `v1.77` and above
56
- - [TypeScript](https://www.npmjs.com/package/typescript) - `v5.4` and above
55
+ - [Sass](https://www.npmjs.com/package/sass) - `v1.80`
56
+ - [TypeScript](https://www.npmjs.com/package/typescript) - `v5.4`
57
57
 
58
58
  Depending on your project setup, you'll also need the following packages:
59
59
 
60
60
  - **For Astro projects**
61
- - [Astro](https://www.npmjs.com/package/astro) - `v4.16` and above
61
+ - [Astro](https://www.npmjs.com/package/astro) - `v4.16`
62
62
  - **For Svelte projects**
63
- - [Svelte](https://www.npmjs.com/package/svelte) - `v4.2` and above
63
+ - [Svelte](https://www.npmjs.com/package/svelte) - `v4.2`
64
64
  - **For React projects**
65
- - [React](https://www.npmjs.com/package/react) - `v18.3` and above
66
- - [React DOM](https://www.npmjs.com/package/react-dom) -`v18.3` and above
65
+ - [React](https://www.npmjs.com/package/react) - `v18.3`
66
+ - [React DOM](https://www.npmjs.com/package/react-dom) -`v18.3`
67
67
 
68
68
  ### Installation
69
69
 
@@ -82,7 +82,7 @@ yarn add webcoreui
82
82
  Create an empty [`webcore.config.scss`](https://webcoreui.dev/docs/css-configuration#webcoreconfigscss) file at the root of your project to setup CSS configurations. Setup default styles and fonts by calling the following in your global SCSS file:
83
83
 
84
84
  ```scss
85
- @import 'webcoreui/styles';
85
+ @use 'webcoreui/styles' as *;
86
86
  @include setup((
87
87
  // Define paths for your fonts
88
88
  fontRegular: '/fonts/Inter-Regular.woff2',
@@ -138,10 +138,18 @@ html body {
138
138
  --w-rating-empty-background: var(--w-color-primary-70);
139
139
  --w-rating-size: 18px;
140
140
 
141
+ // Ribbon component
142
+ --w-ribbon-offset: 20px;
143
+ --w-ribbon-folded-offset: 10px;
144
+
141
145
  // Scrollbars
142
146
  --w-scrollbar-bg: var(--w-color-primary-60);
143
147
  --w-scrollbar-fg: var(--w-color-primary-50);
144
148
 
149
+ // Skeleton component
150
+ --w-skeleton-color: var(--w-color-primary-60);
151
+ --w-skeleton-wave-color: var(--w-color-primary-50);
152
+
145
153
  // Slider component
146
154
  --w-slider-background: var(--w-color-primary-50);
147
155
  --w-slider-color: var(--w-color-primary);
@@ -236,9 +244,11 @@ import { Accordion } from 'webcoreui/react'
236
244
  - [Progress](https://github.com/Frontendland/webcoreui/tree/main/src/components/Progress)
237
245
  - [Radio](https://github.com/Frontendland/webcoreui/tree/main/src/components/Radio)
238
246
  - [Rating](https://github.com/Frontendland/webcoreui/tree/main/src/components/Rating)
247
+ - [Ribbon](https://github.com/Frontendland/webcoreui/tree/main/src/components/Ribbon)
239
248
  - [Select](https://github.com/Frontendland/webcoreui/tree/main/src/components/Select)
240
249
  - [Sheet](https://github.com/Frontendland/webcoreui/tree/main/src/components/Sheet)
241
250
  - [Sidebar](https://github.com/Frontendland/webcoreui/tree/main/src/components/Sidebar)
251
+ - [Skeleton](https://github.com/Frontendland/webcoreui/tree/main/src/components/Skeleton)
242
252
  - [Slider](https://github.com/Frontendland/webcoreui/tree/main/src/components/Slider)
243
253
  - [Spinner](https://github.com/Frontendland/webcoreui/tree/main/src/components/Spinner)
244
254
  - [Spoiler](https://github.com/Frontendland/webcoreui/tree/main/src/components/Spoiler)
package/astro.d.ts CHANGED
@@ -26,9 +26,11 @@ import type { PopoverProps as WPopoverProps } from './components/Popover/popover
26
26
  import type { ProgressProps as WProgressProps } from './components/Progress/progress'
27
27
  import type { RadioProps as WRadioProps } from './components/Radio/radio'
28
28
  import type { RatingProps as WRatingProps } from './components/Rating/rating'
29
+ import type { RibbonProps as WRibbonProps } from './components/Ribbon/ribbon'
29
30
  import type { SelectProps as WSelectProps } from './components/Select/select'
30
31
  import type { SheetProps as WSheetProps } from './components/Sheet/sheet'
31
32
  import type { SidebarProps as WSidebarProps } from './components/Sidebar/sidebar'
33
+ import type { SkeletonProps as WSkeletonProps } from './components/Skeleton/skeleton'
32
34
  import type { SliderProps as WSliderProps } from './components/Slider/slider'
33
35
  import type { SpinnerProps as WSpinnerProps } from './components/Spinner/spinner'
34
36
  import type { SpoilerProps as WSpoilerProps } from './components/Spoiler/spoiler'
@@ -71,9 +73,11 @@ declare module 'webcoreui/astro' {
71
73
  export function Progress(_props: WProgressProps): any
72
74
  export function Radio(_props: WRadioProps): any
73
75
  export function Rating(_props: WRatingProps): any
76
+ export function Ribbon(_props: WRibbonProps): any
74
77
  export function Select(_props: WSelectProps): any
75
78
  export function Sheet(_props: WSheetProps): any
76
79
  export function Sidebar(_props: WSidebarProps): any
80
+ export function Skeleton(_props: WSkeletonProps): any
77
81
  export function Slider(_props: WSliderProps): any
78
82
  export function Spinner(_props: WSpinnerProps): any
79
83
  export function Spoiler(_props: WSpoilerProps): any
@@ -115,9 +119,11 @@ declare module 'webcoreui/astro' {
115
119
  export type ProgressProps = WProgressProps
116
120
  export type RadioProps = WRadioProps
117
121
  export type RatingProps = WRatingProps
122
+ export type RibbonProps = WRibbonProps
118
123
  export type SelectProps = WSelectProps
119
124
  export type SheetProps = WSheetProps
120
125
  export type SidebarProps = WSidebarProps
126
+ export type SkeletonProps = WSkeletonProps
121
127
  export type SliderProps = WSliderProps
122
128
  export type SpinnerProps = WSpinnerProps
123
129
  export type SpoilerProps = WSpoilerProps
package/astro.js CHANGED
@@ -26,9 +26,11 @@ import PopoverComponent from './components/Popover/Popover.astro'
26
26
  import ProgressComponent from './components/Progress/Progress.astro'
27
27
  import RadioComponent from './components/Radio/Radio.astro'
28
28
  import RatingComponent from './components/Rating/Rating.astro'
29
+ import RibbonComponent from './components/Ribbon/Ribbon.astro'
29
30
  import SelectComponent from './components/Select/Select.astro'
30
31
  import SheetComponent from './components/Sheet/Sheet.astro'
31
32
  import SidebarComponent from './components/Sidebar/Sidebar.astro'
33
+ import SkeletonComponent from './components/Skeleton/Skeleton.astro'
32
34
  import SliderComponent from './components/Slider/Slider.astro'
33
35
  import SpinnerComponent from './components/Spinner/Spinner.astro'
34
36
  import SpoilerComponent from './components/Spoiler/Spoiler.astro'
@@ -70,9 +72,11 @@ export const Popover = PopoverComponent
70
72
  export const Progress = ProgressComponent
71
73
  export const Radio = RadioComponent
72
74
  export const Rating = RatingComponent
75
+ export const Ribbon = RibbonComponent
73
76
  export const Select = SelectComponent
74
77
  export const Sheet = SheetComponent
75
78
  export const Sidebar = SidebarComponent
79
+ export const Skeleton = SkeletonComponent
76
80
  export const Slider = SliderComponent
77
81
  export const Spinner = SpinnerComponent
78
82
  export const Spoiler = SpoilerComponent
@@ -1,10 +1,10 @@
1
- @import '../../scss/config.scss';
2
-
3
- div.ratio[style] {
4
- @include layout(flex);
5
- @include size('w100%');
6
-
7
- * {
8
- @include size(100%);
9
- }
10
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ div.ratio[style] {
4
+ @include layout(flex);
5
+ @include size('w100%');
6
+
7
+ * {
8
+ @include size(100%);
9
+ }
10
+ }
@@ -1,57 +1,57 @@
1
- @import '../../scss/config.scss';
2
-
3
- body {
4
- --w-banner-top: 0;
5
- }
6
-
7
- .banner {
8
- @include background(primary-60);
9
- @include spacing(p-default);
10
- @include position(sticky);
11
- @include layer(top);
12
- @include typography(center);
13
-
14
- top: var(--w-banner-top);
15
-
16
- &.padded {
17
- @include border-radius();
18
- @include position(l20px);
19
-
20
- width: calc(100% - 40px);
21
- top: calc(var(--w-banner-top) + 20px);
22
-
23
- &.bottom {
24
- @include position(l20px, b20px);
25
- }
26
- }
27
-
28
- &.relative {
29
- @include position(relative);
30
- top: auto;
31
- }
32
-
33
- &.bottom {
34
- @include position(fixed, b0, l0, r0);
35
-
36
- top: auto;
37
- }
38
-
39
- &.closeable {
40
- @include spacing(pl-default, pt-default, pb-default, pr-3xl);
41
- }
42
-
43
- .close {
44
- @include position(absolute, v-center, r10px);
45
- @include spacing(p-xs);
46
-
47
- svg {
48
- @include size(10px);
49
- }
50
- }
51
- }
52
-
53
- @include media(xs) {
54
- .banner.closeable {
55
- @include spacing(p-default);
56
- }
57
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-banner-top: 0;
5
+ }
6
+
7
+ .banner {
8
+ @include background(primary-60);
9
+ @include spacing(p-default);
10
+ @include position(sticky);
11
+ @include layer(top);
12
+ @include typography(center);
13
+
14
+ top: var(--w-banner-top);
15
+
16
+ &.padded {
17
+ @include border-radius();
18
+ @include position(l20px);
19
+
20
+ width: calc(100% - 40px);
21
+ top: calc(var(--w-banner-top) + 20px);
22
+
23
+ &.bottom {
24
+ @include position(l20px, b20px);
25
+ }
26
+ }
27
+
28
+ &.relative {
29
+ @include position(relative);
30
+ top: auto;
31
+ }
32
+
33
+ &.bottom {
34
+ @include position(fixed, b0, l0, r0);
35
+
36
+ top: auto;
37
+ }
38
+
39
+ &.closeable {
40
+ @include spacing(pl-default, pt-default, pb-default, pr-3xl);
41
+ }
42
+
43
+ .close {
44
+ @include position(absolute, v-center, r10px);
45
+ @include spacing(p-xs);
46
+
47
+ svg {
48
+ @include size(10px);
49
+ }
50
+ }
51
+ }
52
+
53
+ @include media(xs) {
54
+ .banner.closeable {
55
+ @include spacing(p-default);
56
+ }
57
+ }
@@ -1,26 +1,26 @@
1
- @import '../../scss/config.scss';
2
-
3
- .breadcrumb {
4
- @include layout(flex, v-center, sm, wrap);
5
- @include spacing(0);
6
-
7
- list-style-type: none;
8
-
9
- li {
10
- @include layout(flex, v-center, xs);
11
- @include spacing(m0);
12
-
13
- a {
14
- @include layout(flex, v-center, xs);
15
- @include typography(none, primary-20);
16
-
17
- &:hover {
18
- @include typography(primary);
19
- }
20
- }
21
- }
22
-
23
- svg {
24
- @include size(14px);
25
- }
26
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .breadcrumb {
4
+ @include layout(flex, v-center, sm, wrap);
5
+ @include spacing(0);
6
+
7
+ list-style-type: none;
8
+
9
+ li {
10
+ @include layout(flex, v-center, xs);
11
+ @include spacing(m0);
12
+
13
+ a {
14
+ @include layout(flex, v-center, xs);
15
+ @include typography(none, primary-20);
16
+
17
+ &:hover {
18
+ @include typography(primary);
19
+ }
20
+ }
21
+ }
22
+
23
+ svg {
24
+ @include size(14px);
25
+ }
26
+ }
@@ -89,4 +89,8 @@
89
89
  @include background(alert-accent);
90
90
  }
91
91
  }
92
+
93
+ svg {
94
+ pointer-events: none;
95
+ }
92
96
  }
@@ -1,4 +1,4 @@
1
- @import '../../scss/config.scss';
1
+ @use '../../scss/config.scss' as *;
2
2
 
3
3
  body {
4
4
  --w-slide-width: 100%;
@@ -1,29 +1,29 @@
1
- @import '../../scss/config.scss';
2
-
3
- body {
4
- --w-collapsible-initial-height: 0;
5
- --w-collapsible-max-height: 100%;
6
- }
7
-
8
- .collapsible {
9
- @include layout(flex, column, xs);
10
-
11
- &:not([data-toggled="true"]) [data-toggle-off],
12
- &[data-toggled="true"] [data-toggle-on] {
13
- @include visibility(none);
14
- }
15
-
16
- &[data-toggled="true"] .wrapper {
17
- max-height: var(--w-collapsible-max-height);
18
- }
19
-
20
- &.animated .wrapper {
21
- @include transition(max-height, .5s);
22
- }
23
-
24
- .wrapper {
25
- @include visibility(hidden);
26
-
27
- max-height: var(--w-collapsible-initial-height);
28
- }
29
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-collapsible-initial-height: 0;
5
+ --w-collapsible-max-height: 100%;
6
+ }
7
+
8
+ .collapsible {
9
+ @include layout(flex, column, xs);
10
+
11
+ &:not([data-toggled="true"]) [data-toggle-off],
12
+ &[data-toggled="true"] [data-toggle-on] {
13
+ @include visibility(none);
14
+ }
15
+
16
+ &[data-toggled="true"] .wrapper {
17
+ max-height: var(--w-collapsible-max-height);
18
+ }
19
+
20
+ &.animated .wrapper {
21
+ @include transition(max-height, .5s);
22
+ }
23
+
24
+ .wrapper {
25
+ @include visibility(hidden);
26
+
27
+ max-height: var(--w-collapsible-initial-height);
28
+ }
29
+ }
@@ -1,5 +1,6 @@
1
1
  export type ConditionalWrapperProps = {
2
2
  condition: boolean
3
+ [key: string]: any
3
4
  }
4
5
 
5
6
  export type ReactConditionalWrapperProps = {
@@ -1,102 +1,102 @@
1
- @import '../../scss/config.scss';
2
-
3
- .filters {
4
- @include layout(flex, xs);
5
- @include spacing(mb-sm);
6
- }
7
-
8
- .table {
9
- @include visibility(auto);
10
-
11
- table {
12
- @include size('w100%');
13
- @include typography(left);
14
-
15
- border-collapse: collapse;
16
- }
17
-
18
- thead,
19
- thead button {
20
- @include typography(bold);
21
- }
22
-
23
- thead button {
24
- @include spacing(p-xxs);
25
-
26
- svg {
27
- @include size(15px);
28
- pointer-events: none;
29
- }
30
- }
31
-
32
- th,
33
- td {
34
- @include spacing(py-xs, px-sm);
35
-
36
- &.no-results {
37
- @include typography(center);
38
- }
39
- }
40
-
41
- thead,
42
- tr {
43
- @include border(bottom, primary-50);
44
-
45
- &:last-child {
46
- @include border(bottom, 0);
47
- }
48
- }
49
-
50
- [data-hidden] {
51
- @include visibility(none);
52
- }
53
-
54
- &.hover tr:hover,
55
- &.striped-rows tbody tr:nth-child(odd),
56
- &.striped-rows.offset tbody tr:nth-child(even),
57
- &.striped-columns td:nth-child(odd),
58
- &.striped-columns.offset td:nth-child(even),
59
- &.hover.striped-rows.offset tbody tr:nth-child(odd):hover {
60
- @include background(primary-60);
61
- }
62
-
63
- &.striped-rows tr,
64
- &.striped-columns tr,
65
- &.striped-columns thead {
66
- @include border(bottom, 0);
67
- }
68
-
69
- &.striped-rows.offset tbody tr:nth-child(odd),
70
- &.striped-columns.offset td:nth-child(odd) {
71
- @include background(transparent);
72
- }
73
-
74
- &.compact {
75
- th, td {
76
- @include spacing(py-xxs, px-sm);
77
- }
78
- }
79
-
80
- &.scroll {
81
- @include spacing(pr-sm);
82
-
83
- thead {
84
- @include position(sticky, t0);
85
- @include background(primary-70);
86
- box-shadow: 0 .5px 0 var(--w-color-primary-50);
87
- }
88
- }
89
- }
90
-
91
- .footer {
92
- @include layout(flex, h-end, v-center, xs);
93
- @include spacing(mt-sm);
94
-
95
- &.between {
96
- @include layout(h-between);
97
- }
98
-
99
- .subtext {
100
- @include typography(md, primary-20);
101
- }
102
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .filters {
4
+ @include layout(flex, xs);
5
+ @include spacing(mb-sm);
6
+ }
7
+
8
+ .table {
9
+ @include visibility(auto);
10
+
11
+ table {
12
+ @include size('w100%');
13
+ @include typography(left);
14
+
15
+ border-collapse: collapse;
16
+ }
17
+
18
+ thead,
19
+ thead button {
20
+ @include typography(bold);
21
+ }
22
+
23
+ thead button {
24
+ @include spacing(p-xxs);
25
+
26
+ svg {
27
+ @include size(15px);
28
+ pointer-events: none;
29
+ }
30
+ }
31
+
32
+ th,
33
+ td {
34
+ @include spacing(py-xs, px-sm);
35
+
36
+ &.no-results {
37
+ @include typography(center);
38
+ }
39
+ }
40
+
41
+ thead,
42
+ tr {
43
+ @include border(bottom, primary-50);
44
+
45
+ &:last-child {
46
+ @include border(bottom, 0);
47
+ }
48
+ }
49
+
50
+ [data-hidden] {
51
+ @include visibility(none);
52
+ }
53
+
54
+ &.hover tr:hover,
55
+ &.striped-rows tbody tr:nth-child(odd),
56
+ &.striped-rows.offset tbody tr:nth-child(even),
57
+ &.striped-columns td:nth-child(odd),
58
+ &.striped-columns.offset td:nth-child(even),
59
+ &.hover.striped-rows.offset tbody tr:nth-child(odd):hover {
60
+ @include background(primary-60);
61
+ }
62
+
63
+ &.striped-rows tr,
64
+ &.striped-columns tr,
65
+ &.striped-columns thead {
66
+ @include border(bottom, 0);
67
+ }
68
+
69
+ &.striped-rows.offset tbody tr:nth-child(odd),
70
+ &.striped-columns.offset td:nth-child(odd) {
71
+ @include background(transparent);
72
+ }
73
+
74
+ &.compact {
75
+ th, td {
76
+ @include spacing(py-xxs, px-sm);
77
+ }
78
+ }
79
+
80
+ &.scroll {
81
+ @include spacing(pr-sm);
82
+
83
+ thead {
84
+ @include position(sticky, t0);
85
+ @include background(primary-70);
86
+ box-shadow: 0 .5px 0 var(--w-color-primary-50);
87
+ }
88
+ }
89
+ }
90
+
91
+ .footer {
92
+ @include layout(flex, h-end, v-center, xs);
93
+ @include spacing(mt-sm);
94
+
95
+ &.between {
96
+ @include layout(h-between);
97
+ }
98
+
99
+ .subtext {
100
+ @include typography(md, primary-20);
101
+ }
102
+ }