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
@@ -1,52 +1,52 @@
1
- @import '../../scss/config.scss';
2
-
3
- .popover {
4
- @include spacing(m0, p-default);
5
- @include layer(modal);
6
- @include visibility(block, 0);
7
- @include border(primary-50);
8
- @include background(primary-70);
9
- @include typography(primary);
10
- @include border-radius(md);
11
- @include size(w300px);
12
- @include position('t-100%');
13
-
14
- transform: translateY(-5px);
15
- pointer-events: none;
16
-
17
- &[data-show] {
18
- @include transition();
19
- }
20
-
21
- &[data-show="true"] {
22
- @include visibility(1);
23
-
24
- transform: translateY(0);
25
- pointer-events: all;
26
- }
27
-
28
- &[data-position="top"] {
29
- transform: translateY(5px);
30
-
31
- &[data-show="true"] {
32
- transform: translate(0);
33
- }
34
- }
35
-
36
- &[data-position="left"] {
37
- transform: translateY(0) translateX(5px);
38
-
39
- &[data-show="true"] {
40
- transform: translate(0);
41
- }
42
- }
43
-
44
-
45
- &[data-position="right"] {
46
- transform: translateY(0) translateX(-5px);
47
-
48
- &[data-show="true"] {
49
- transform: translate(0);
50
- }
51
- }
52
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .popover {
4
+ @include spacing(m0, p-default);
5
+ @include layer(modal);
6
+ @include visibility(block, 0);
7
+ @include border(primary-50);
8
+ @include background(primary-70);
9
+ @include typography(primary);
10
+ @include border-radius(md);
11
+ @include size(w300px);
12
+ @include position('t-100%');
13
+
14
+ transform: translateY(-5px);
15
+ pointer-events: none;
16
+
17
+ &[data-show] {
18
+ @include transition();
19
+ }
20
+
21
+ &[data-show="true"] {
22
+ @include visibility(1);
23
+
24
+ transform: translateY(0);
25
+ pointer-events: all;
26
+ }
27
+
28
+ &[data-position="top"] {
29
+ transform: translateY(5px);
30
+
31
+ &[data-show="true"] {
32
+ transform: translate(0);
33
+ }
34
+ }
35
+
36
+ &[data-position="left"] {
37
+ transform: translateY(0) translateX(5px);
38
+
39
+ &[data-show="true"] {
40
+ transform: translate(0);
41
+ }
42
+ }
43
+
44
+
45
+ &[data-position="right"] {
46
+ transform: translateY(0) translateX(-5px);
47
+
48
+ &[data-show="true"] {
49
+ transform: translate(0);
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,28 @@
1
+ ---
2
+ import type { RibbonProps } from './ribbon'
3
+
4
+ import styles from './ribbon.module.scss'
5
+
6
+ interface Props extends RibbonProps {}
7
+
8
+ const {
9
+ offset,
10
+ type,
11
+ theme,
12
+ className
13
+ } = Astro.props
14
+
15
+ const classes = [
16
+ styles.ribbon,
17
+ theme && styles[theme],
18
+ type && styles[type],
19
+ className
20
+ ]
21
+ ---
22
+
23
+ <span
24
+ class:list={classes}
25
+ style={offset ? `top:${offset}px;left:${offset}px` : null}
26
+ >
27
+ <slot />
28
+ </span>
@@ -0,0 +1,26 @@
1
+ <script lang="ts">
2
+ import type { RibbonProps } from './ribbon'
3
+
4
+ import { classNames } from '../../utils/classNames'
5
+
6
+ import styles from './ribbon.module.scss'
7
+
8
+ export let offset: RibbonProps['offset'] = 0
9
+ export let type: RibbonProps['type'] = null
10
+ export let theme: RibbonProps['theme'] = null
11
+ export let className: RibbonProps['className'] = ''
12
+
13
+ const classes = classNames([
14
+ styles.ribbon,
15
+ theme && styles[theme],
16
+ type && styles[type],
17
+ className
18
+ ])
19
+ </script>
20
+
21
+ <span
22
+ class={classes}
23
+ style={offset ? `top:${offset}px;left:${offset}px` : null}
24
+ >
25
+ <slot />
26
+ </span>
@@ -0,0 +1,33 @@
1
+ import React from 'react'
2
+ import type { ReactRibbonProps } from './ribbon'
3
+
4
+ import { classNames } from '../../utils/classNames'
5
+
6
+ import styles from './ribbon.module.scss'
7
+
8
+ const Ribbon = ({
9
+ offset,
10
+ type,
11
+ theme,
12
+ className,
13
+ children
14
+ }: ReactRibbonProps) => {
15
+ const classes = classNames([
16
+ styles.ribbon,
17
+ theme && styles[theme],
18
+ type && styles[type],
19
+ className
20
+ ])
21
+
22
+ const styleVariable = offset
23
+ ? { top: offset, left: offset } as React.CSSProperties
24
+ : undefined
25
+
26
+ return (
27
+ <span className={classes} style={styleVariable}>
28
+ {children}
29
+ </span>
30
+ )
31
+ }
32
+
33
+ export default Ribbon
@@ -0,0 +1,84 @@
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ body {
4
+ --w-ribbon-offset: 20px;
5
+ --w-ribbon-folded-offset: 10px;
6
+ }
7
+
8
+ .ribbon {
9
+ @include position(absolute);
10
+ @include typography(sm, primary-70);
11
+ @include background(primary);
12
+ @include spacing('px-5xl');
13
+
14
+ top: var(--w-ribbon-offset);
15
+ left: var(--w-ribbon-offset);
16
+
17
+ transform: rotate(-45deg) translate(-50%, -50%);
18
+ transform-origin: top left;
19
+ pointer-events: none;
20
+
21
+ &.folded {
22
+ @include position(t10px);
23
+ @include spacing(px-sm);
24
+
25
+ transform: none;
26
+ left: calc(var(--w-ribbon-folded-offset) * -1);
27
+
28
+ &::before {
29
+ @include position(absolute, t15px, l0);
30
+ @include layer(bg);
31
+
32
+ content: '';
33
+ transform: translateY(-50%);
34
+ border-right: var(--w-ribbon-folded-offset) solid var(--w-color-primary-20);
35
+ border-top: var(--w-ribbon-folded-offset) solid transparent;
36
+ border-bottom: var(--w-ribbon-folded-offset) solid transparent;
37
+ }
38
+ }
39
+
40
+ &.secondary {
41
+ @include typography(primary);
42
+ @include background(primary-50);
43
+
44
+ &.folded::before {
45
+ border-right-color: var(--w-color-primary-30);
46
+ }
47
+ }
48
+
49
+ &.info {
50
+ @include typography(info-fg);
51
+ @include background(info);
52
+
53
+ &.folded::before {
54
+ border-right-color: var(--w-color-info-accent);
55
+ }
56
+ }
57
+
58
+ &.success {
59
+ @include typography(success-fg);
60
+ @include background(success);
61
+
62
+ &.folded::before {
63
+ border-right-color: var(--w-color-success-accent);
64
+ }
65
+ }
66
+
67
+ &.warning {
68
+ @include typography(warning-fg);
69
+ @include background(warning);
70
+
71
+ &.folded::before {
72
+ border-right-color: var(--w-color-warning-accent);
73
+ }
74
+ }
75
+
76
+ &.alert {
77
+ @include typography(alert-fg);
78
+ @include background(alert);
79
+
80
+ &.folded::before {
81
+ border-right-color: var(--w-color-alert-accent);
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,16 @@
1
+ export type RibbonProps = {
2
+ offset?: number
3
+ type?: 'folded' | null
4
+ theme?: 'secondary'
5
+ | 'info'
6
+ | 'success'
7
+ | 'warning'
8
+ | 'alert'
9
+ | null
10
+ | undefined
11
+ className?: string
12
+ }
13
+
14
+ export type ReactRibbonProps = {
15
+ children: React.ReactNode
16
+ } & RibbonProps
@@ -1,25 +1,25 @@
1
- @import '../../scss/config.scss';
2
-
3
- .select {
4
- svg {
5
- @include position(r10px);
6
-
7
- left: auto !important;
8
- cursor: pointer;
9
- }
10
-
11
- input {
12
- cursor: pointer;
13
- padding-left: 10px !important;
14
- padding-right: 40px;
15
- }
16
-
17
- &.disabled svg {
18
- cursor: no-drop;
19
- }
20
- }
21
-
22
- .popover {
23
- padding: 0 !important;
24
- border: 0 !important;
25
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .select {
4
+ svg {
5
+ @include position(r10px);
6
+
7
+ left: auto !important;
8
+ cursor: pointer;
9
+ }
10
+
11
+ input {
12
+ cursor: pointer;
13
+ padding-left: 10px !important;
14
+ padding-right: 40px;
15
+ }
16
+
17
+ &.disabled svg {
18
+ cursor: no-drop;
19
+ }
20
+ }
21
+
22
+ .popover {
23
+ padding: 0 !important;
24
+ border: 0 !important;
25
+ }
@@ -1,68 +1,68 @@
1
- @import '../../scss/config.scss';
2
-
3
- .sheet {
4
- @include position(t0, 'r-100%', lauto);
5
- @include visibility(1);
6
- @include border-radius(none);
7
- @include size(100%);
8
- @include border(0);
9
- @include border(left, primary-50);
10
-
11
- transform: none;
12
-
13
- &[data-show="true"] {
14
- @include position(r0);
15
-
16
- transform: none;
17
- }
18
-
19
- &.left {
20
- @include position('l-100%', rauto);
21
- @include border(0);
22
- @include border(right, primary-50);
23
-
24
- &[data-show="true"] {
25
- @include position(l0);
26
- }
27
- }
28
-
29
- &.top {
30
- @include position(t0, l0);
31
- @include size(hauto);
32
- @include border(0);
33
- @include border(bottom, primary-50);
34
-
35
- transform: translateY(-100%);
36
- min-width: 100%;
37
-
38
- &[data-show="true"] {
39
- transform: translateY(0);
40
- }
41
- }
42
-
43
- &.bottom {
44
- @include position(b0, l0);
45
- @include size(hauto);
46
- @include border(0);
47
- @include border(top, primary-50);
48
-
49
- transform: translateY(100%);
50
- top: auto;
51
- min-width: 100%;
52
-
53
- &[data-show="true"] {
54
- transform: translateY(0);
55
- }
56
- }
57
- }
58
-
59
- @include media(xs) {
60
- .sheet {
61
- @include position(r-500px);
62
- @include size(w500px);
63
-
64
- &.left {
65
- @include position(l-500px);
66
- }
67
- }
68
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .sheet {
4
+ @include position(t0, 'r-100%', lauto);
5
+ @include visibility(1);
6
+ @include border-radius(none);
7
+ @include size(100%);
8
+ @include border(0);
9
+ @include border(left, primary-50);
10
+
11
+ transform: none;
12
+
13
+ &[data-show="true"] {
14
+ @include position(r0);
15
+
16
+ transform: none;
17
+ }
18
+
19
+ &.left {
20
+ @include position('l-100%', rauto);
21
+ @include border(0);
22
+ @include border(right, primary-50);
23
+
24
+ &[data-show="true"] {
25
+ @include position(l0);
26
+ }
27
+ }
28
+
29
+ &.top {
30
+ @include position(t0, l0);
31
+ @include size(hauto);
32
+ @include border(0);
33
+ @include border(bottom, primary-50);
34
+
35
+ transform: translateY(-100%);
36
+ min-width: 100%;
37
+
38
+ &[data-show="true"] {
39
+ transform: translateY(0);
40
+ }
41
+ }
42
+
43
+ &.bottom {
44
+ @include position(b0, l0);
45
+ @include size(hauto);
46
+ @include border(0);
47
+ @include border(top, primary-50);
48
+
49
+ transform: translateY(100%);
50
+ top: auto;
51
+ min-width: 100%;
52
+
53
+ &[data-show="true"] {
54
+ transform: translateY(0);
55
+ }
56
+ }
57
+ }
58
+
59
+ @include media(xs) {
60
+ .sheet {
61
+ @include position(r-500px);
62
+ @include size(w500px);
63
+
64
+ &.left {
65
+ @include position(l-500px);
66
+ }
67
+ }
68
+ }
@@ -1,43 +1,43 @@
1
- @import '../../scss/config.scss';
2
-
3
- .sidebar {
4
-
5
- strong {
6
- @include spacing(mb-sm);
7
-
8
- display: block;
9
- }
10
-
11
- ul {
12
- @include layout(flex, column, sm);
13
- @include typography(normal);
14
- @include spacing(0);
15
-
16
- list-style-type: none;
17
-
18
- &:not(:last-child) {
19
- @include spacing('mb-3xl');
20
- }
21
-
22
- li {
23
- @include spacing(m0);
24
- }
25
-
26
- a {
27
- @include typography(primary-20, none);
28
- @include layout(flex, v-center, sm);
29
-
30
- &:hover {
31
- @include typography(primary);
32
- }
33
-
34
- &.active {
35
- @include typography(primary);
36
- }
37
-
38
- svg {
39
- @include size(18px);
40
- }
41
- }
42
- }
43
- }
1
+ @use '../../scss/config.scss' as *;
2
+
3
+ .sidebar {
4
+
5
+ strong {
6
+ @include spacing(mb-sm);
7
+
8
+ display: block;
9
+ }
10
+
11
+ ul {
12
+ @include layout(flex, column, sm);
13
+ @include typography(normal);
14
+ @include spacing(0);
15
+
16
+ list-style-type: none;
17
+
18
+ &:not(:last-child) {
19
+ @include spacing('mb-3xl');
20
+ }
21
+
22
+ li {
23
+ @include spacing(m0);
24
+ }
25
+
26
+ a {
27
+ @include typography(primary-20, none);
28
+ @include layout(flex, v-center, sm);
29
+
30
+ &:hover {
31
+ @include typography(primary);
32
+ }
33
+
34
+ &.active {
35
+ @include typography(primary);
36
+ }
37
+
38
+ svg {
39
+ @include size(18px);
40
+ }
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,35 @@
1
+ ---
2
+ import type { SkeletonProps } from './skeleton'
3
+
4
+ import { classNames } from '../../utils/classNames'
5
+
6
+ import styles from './skeleton.module.scss'
7
+
8
+ interface Props extends SkeletonProps {}
9
+
10
+ const {
11
+ animate = 'wave',
12
+ type = 'rounded',
13
+ width,
14
+ height,
15
+ color,
16
+ waveColor,
17
+ className
18
+ } = Astro.props
19
+
20
+ const classes = [
21
+ animate && styles[animate],
22
+ styles[type],
23
+ styles.skeleton,
24
+ className
25
+ ]
26
+
27
+ const styleVariables = classNames([
28
+ width && `width: ${width}px;`,
29
+ height && `height: ${height}px;`,
30
+ color && `--w-skeleton-color: ${color};`,
31
+ waveColor && `--w-skeleton-wave-color: ${waveColor};`
32
+ ])
33
+ ---
34
+
35
+ <div class:list={classes} style={styleVariables}>&nbsp;</div>
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import type { SkeletonProps } from './skeleton'
3
+
4
+ import { classNames } from '../../utils/classNames'
5
+
6
+ import styles from './skeleton.module.scss'
7
+
8
+ export let animate: SkeletonProps['animate'] = 'wave'
9
+ export let type: SkeletonProps['type'] = 'rounded'
10
+ export let width: SkeletonProps['width'] = 0
11
+ export let height: SkeletonProps['height'] = 0
12
+ export let color: SkeletonProps['color'] = ''
13
+ export let waveColor: SkeletonProps['waveColor'] = ''
14
+ export let className: SkeletonProps['className'] = ''
15
+
16
+ const classes = classNames([
17
+ animate && styles[animate],
18
+ styles[type!],
19
+ styles.skeleton,
20
+ className
21
+ ])
22
+
23
+ const styleVariables = classNames([
24
+ width && `width: ${width}px;`,
25
+ height && `height: ${height}px;`,
26
+ color && `--w-skeleton-color: ${color};`,
27
+ waveColor && `--w-skeleton-wave-color: ${waveColor};`
28
+ ])
29
+ </script>
30
+
31
+ <div class={classes} style={styleVariables}>&nbsp;</div>
@@ -0,0 +1,34 @@
1
+ import React from 'react'
2
+ import type { SkeletonProps } from './skeleton'
3
+
4
+ import { classNames } from '../../utils/classNames'
5
+
6
+ import styles from './skeleton.module.scss'
7
+
8
+ const Skeleton = ({
9
+ animate = 'wave',
10
+ type = 'rounded',
11
+ width,
12
+ height,
13
+ color,
14
+ waveColor,
15
+ className
16
+ }: SkeletonProps) => {
17
+ const classes = classNames([
18
+ animate && styles[animate],
19
+ styles[type],
20
+ styles.skeleton,
21
+ className
22
+ ])
23
+
24
+ const styleVariables = {
25
+ ...(width && { width: `${width}px` }),
26
+ ...(height && { height: `${height}px` }),
27
+ ...(color && { '--w-skeleton-color': color }),
28
+ ...(waveColor && { '--w-skeleton-wave-color': waveColor })
29
+ } as React.CSSProperties
30
+
31
+ return <div className={classes} style={styleVariables}>&nbsp;</div>
32
+ }
33
+
34
+ export default Skeleton