webcoreui 0.0.7 → 0.0.9
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 +18 -1
- package/astro.d.ts +10 -0
- package/astro.js +11 -1
- package/components/Accordion/Accordion.astro +1 -4
- package/components/Accordion/Accordion.svelte +1 -4
- package/components/Alert/Alert.astro +3 -5
- package/components/Alert/Alert.svelte +3 -5
- package/components/Alert/Alert.tsx +9 -2
- package/components/Alert/alert.ts +0 -1
- package/components/Avatar/Avatar.astro +51 -0
- package/components/Avatar/Avatar.svelte +48 -0
- package/components/Avatar/Avatar.tsx +63 -0
- package/components/Avatar/avatar.scss +35 -0
- package/components/Avatar/avatar.ts +10 -0
- package/components/Badge/Badge.astro +1 -5
- package/components/Badge/Badge.svelte +1 -4
- package/components/Badge/Badge.tsx +5 -1
- package/components/Badge/badge.ts +0 -1
- package/components/Button/Button.astro +1 -4
- package/components/Button/Button.svelte +1 -4
- package/components/Button/Button.tsx +5 -1
- package/components/Button/button.ts +1 -1
- package/components/Card/Card.astro +2 -5
- package/components/Card/Card.svelte +1 -4
- package/components/Card/Card.tsx +7 -1
- package/components/Card/card.ts +1 -0
- package/components/Checkbox/Checkbox.astro +51 -0
- package/components/Checkbox/Checkbox.svelte +52 -0
- package/components/Checkbox/Checkbox.tsx +69 -0
- package/components/Checkbox/checkbox.scss +85 -0
- package/components/Checkbox/checkbox.ts +8 -0
- package/components/Radio/Radio.astro +57 -0
- package/components/Radio/Radio.svelte +56 -0
- package/components/Radio/Radio.tsx +72 -0
- package/components/Radio/radio.scss +92 -0
- package/components/Radio/radio.ts +13 -0
- package/components/Rating/Rating.astro +66 -0
- package/components/Rating/Rating.svelte +70 -0
- package/components/Rating/Rating.tsx +67 -0
- package/components/Rating/rating.scss +37 -0
- package/components/Rating/rating.ts +16 -0
- package/components/Switch/Switch.astro +38 -0
- package/components/Switch/Switch.svelte +42 -0
- package/components/Switch/Switch.tsx +50 -0
- package/components/Switch/switch.scss +84 -0
- package/components/Switch/switch.ts +11 -0
- package/icons/check.svg +1 -2
- package/icons/circle-check.svg +4 -0
- package/package.json +3 -2
- package/react.d.ts +10 -0
- package/react.js +11 -1
- package/scss/setup.scss +11 -0
- package/svelte.d.ts +10 -0
- package/svelte.js +11 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { RatingProps } from './rating'
|
|
3
|
+
import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.tsx'
|
|
4
|
+
import './rating.scss'
|
|
5
|
+
|
|
6
|
+
const Rating = ({
|
|
7
|
+
score,
|
|
8
|
+
total = 5,
|
|
9
|
+
showText,
|
|
10
|
+
text = '{0} out of {1}',
|
|
11
|
+
showEmpty = true,
|
|
12
|
+
outline = true,
|
|
13
|
+
reviewCount,
|
|
14
|
+
reviewText = '{0} reviews',
|
|
15
|
+
reviewLink,
|
|
16
|
+
reviewTarget,
|
|
17
|
+
color,
|
|
18
|
+
emptyColor,
|
|
19
|
+
size,
|
|
20
|
+
className
|
|
21
|
+
}: RatingProps) => {
|
|
22
|
+
const classes = [
|
|
23
|
+
'w-rating',
|
|
24
|
+
outline && 'outline',
|
|
25
|
+
className
|
|
26
|
+
].filter(Boolean).join(' ')
|
|
27
|
+
|
|
28
|
+
const styles = {
|
|
29
|
+
...(color && { '--w-rating-color': color }),
|
|
30
|
+
...(size && { '--w-rating-size': `${size}px` }),
|
|
31
|
+
...(emptyColor && { '--w-rating-empty-color': emptyColor })
|
|
32
|
+
} as React.CSSProperties
|
|
33
|
+
|
|
34
|
+
const translatedText = text
|
|
35
|
+
.replace('{0}', `${score}`)
|
|
36
|
+
.replace('{1}', `${total}`)
|
|
37
|
+
|
|
38
|
+
const translatedReviewText = reviewText.replace('{0}', `${reviewCount}`)
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<span className={classes} style={styles}>
|
|
42
|
+
<span className="score">{Array(score).fill('★').join('')}</span>
|
|
43
|
+
{showEmpty && (
|
|
44
|
+
<span className={total === 10 ? 'empty ten-star' : 'empty'}>
|
|
45
|
+
{Array(total - score).fill('★').join('')}
|
|
46
|
+
</span>
|
|
47
|
+
)}
|
|
48
|
+
{showText && (
|
|
49
|
+
<span className={reviewCount ? 'text m' : 'text'}>
|
|
50
|
+
{translatedText}
|
|
51
|
+
</span>
|
|
52
|
+
)}
|
|
53
|
+
{reviewCount && '•'}
|
|
54
|
+
{reviewCount && (
|
|
55
|
+
<ConditionalWrapper condition={!!reviewLink} wrapper={children => (
|
|
56
|
+
<a href={reviewLink} target={reviewTarget}>
|
|
57
|
+
{children}
|
|
58
|
+
</a>
|
|
59
|
+
)}>
|
|
60
|
+
<span className="text">{translatedReviewText}</span>
|
|
61
|
+
</ConditionalWrapper>
|
|
62
|
+
)}
|
|
63
|
+
</span>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export default Rating
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@import '../../scss/config.scss';
|
|
2
|
+
|
|
3
|
+
.w-rating {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
color: var(--w-rating-color);
|
|
7
|
+
font-size: var(--w-rating-size);
|
|
8
|
+
|
|
9
|
+
&.outline .empty {
|
|
10
|
+
transform: scale(.88);
|
|
11
|
+
color: black;
|
|
12
|
+
text-shadow: -1px 0 var(--w-rating-color), 0 1px var(--w-rating-color), 1px 0 var(--w-rating-color), 0 -1px var(--w-rating-color);
|
|
13
|
+
letter-spacing: 2px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.empty {
|
|
17
|
+
color: var(--w-rating-empty-color);
|
|
18
|
+
|
|
19
|
+
&.ten-star {
|
|
20
|
+
margin-left: -3px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
a {
|
|
25
|
+
text-decoration: underline;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.text {
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
color: #BBB;
|
|
31
|
+
margin-left: 5px;
|
|
32
|
+
|
|
33
|
+
&.m {
|
|
34
|
+
margin-right: 5px;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type RatingProps = {
|
|
2
|
+
score: number
|
|
3
|
+
total?: number
|
|
4
|
+
showText?: boolean
|
|
5
|
+
text?: string
|
|
6
|
+
showEmpty?: boolean
|
|
7
|
+
outline?: boolean
|
|
8
|
+
reviewCount?: number
|
|
9
|
+
reviewText?: string
|
|
10
|
+
reviewLink?: string
|
|
11
|
+
reviewTarget?: string
|
|
12
|
+
color?: string
|
|
13
|
+
emptyColor?: string
|
|
14
|
+
size?: number
|
|
15
|
+
className?: string
|
|
16
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SwitchProps } from './switch'
|
|
3
|
+
import './switch.scss'
|
|
4
|
+
|
|
5
|
+
interface Props extends SwitchProps {}
|
|
6
|
+
|
|
7
|
+
const {
|
|
8
|
+
label,
|
|
9
|
+
toggled,
|
|
10
|
+
offColor,
|
|
11
|
+
onColor,
|
|
12
|
+
reverse,
|
|
13
|
+
small,
|
|
14
|
+
square,
|
|
15
|
+
disabled,
|
|
16
|
+
className
|
|
17
|
+
} = Astro.props
|
|
18
|
+
|
|
19
|
+
const classes = [
|
|
20
|
+
'w-switch',
|
|
21
|
+
reverse && 'reverse',
|
|
22
|
+
small && 'small',
|
|
23
|
+
square && 'square',
|
|
24
|
+
disabled && 'disabled',
|
|
25
|
+
className
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
const styles = [
|
|
29
|
+
offColor && `--w-switch-off-color: ${offColor};`,
|
|
30
|
+
onColor && `--w-switch-on-color: ${onColor};`
|
|
31
|
+
].filter(Boolean).join(' ')
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<label class:list={classes} style={styles || null}>
|
|
35
|
+
<input type="checkbox" checked={toggled} disabled={disabled} />
|
|
36
|
+
<span class="toggle"></span>
|
|
37
|
+
{label && <span class="label">{label}</span>}
|
|
38
|
+
</label>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SwitchProps } from './switch'
|
|
3
|
+
import './switch.scss'
|
|
4
|
+
|
|
5
|
+
export let label: SwitchProps['label'] = ''
|
|
6
|
+
export let toggled: SwitchProps['toggled'] = false
|
|
7
|
+
export let offColor: SwitchProps['offColor'] = ''
|
|
8
|
+
export let onColor: SwitchProps['onColor'] = ''
|
|
9
|
+
export let reverse: SwitchProps['reverse'] = false
|
|
10
|
+
export let small: SwitchProps['small'] = false
|
|
11
|
+
export let square: SwitchProps['square'] = false
|
|
12
|
+
export let disabled: SwitchProps['disabled'] = false
|
|
13
|
+
export let className: SwitchProps['className'] = ''
|
|
14
|
+
export let onClick: () => any = () => {}
|
|
15
|
+
|
|
16
|
+
const classes = [
|
|
17
|
+
'w-switch',
|
|
18
|
+
reverse && 'reverse',
|
|
19
|
+
small && 'small',
|
|
20
|
+
square && 'square',
|
|
21
|
+
disabled && 'disabled',
|
|
22
|
+
className
|
|
23
|
+
].filter(Boolean).join(' ')
|
|
24
|
+
|
|
25
|
+
const styles = [
|
|
26
|
+
offColor && `--w-switch-off-color: ${offColor};`,
|
|
27
|
+
onColor && `--w-switch-on-color: ${onColor};`
|
|
28
|
+
].filter(Boolean).join(' ')
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<label class={classes} style={styles || null}>
|
|
32
|
+
<input
|
|
33
|
+
type="checkbox"
|
|
34
|
+
checked={toggled}
|
|
35
|
+
disabled={disabled}
|
|
36
|
+
on:click={onClick}
|
|
37
|
+
/>
|
|
38
|
+
<span class="toggle"></span>
|
|
39
|
+
{#if label}
|
|
40
|
+
<span class="label">{label}</span>
|
|
41
|
+
{/if}
|
|
42
|
+
</label>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { SwitchProps } from './switch'
|
|
3
|
+
import './switch.scss'
|
|
4
|
+
|
|
5
|
+
type ReactSwitchProps = {
|
|
6
|
+
onClick?: () => any
|
|
7
|
+
} & SwitchProps
|
|
8
|
+
|
|
9
|
+
const Switch = ({
|
|
10
|
+
label,
|
|
11
|
+
toggled,
|
|
12
|
+
offColor,
|
|
13
|
+
onColor,
|
|
14
|
+
reverse,
|
|
15
|
+
small,
|
|
16
|
+
square,
|
|
17
|
+
disabled,
|
|
18
|
+
className,
|
|
19
|
+
onClick
|
|
20
|
+
}: ReactSwitchProps) => {
|
|
21
|
+
const classes = [
|
|
22
|
+
'w-switch',
|
|
23
|
+
reverse && 'reverse',
|
|
24
|
+
small && 'small',
|
|
25
|
+
square && 'square',
|
|
26
|
+
disabled && 'disabled',
|
|
27
|
+
className
|
|
28
|
+
].filter(Boolean).join(' ')
|
|
29
|
+
|
|
30
|
+
const styles = {
|
|
31
|
+
...(offColor && { '--w-switch-off-color': offColor }),
|
|
32
|
+
...(onColor && { '--w-switch-on-color': onColor })
|
|
33
|
+
} as React.CSSProperties
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<label className={classes} style={styles || null}>
|
|
37
|
+
<input
|
|
38
|
+
type="checkbox"
|
|
39
|
+
checked={toggled}
|
|
40
|
+
disabled={disabled}
|
|
41
|
+
onClick={onClick}
|
|
42
|
+
/>
|
|
43
|
+
<span className="toggle"></span>
|
|
44
|
+
{label && <span className="label">{label}</span>}
|
|
45
|
+
</label>
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default Switch
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@import '../../scss/config.scss';
|
|
2
|
+
|
|
3
|
+
.w-switch {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 10px;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
|
|
9
|
+
&.reverse {
|
|
10
|
+
flex-direction: row-reverse;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.disabled .toggle {
|
|
14
|
+
cursor: no-drop;
|
|
15
|
+
background: #333;
|
|
16
|
+
|
|
17
|
+
&::before {
|
|
18
|
+
background: #252525;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.small {
|
|
23
|
+
input:checked + span::before {
|
|
24
|
+
transform: translateX(20px);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.toggle {
|
|
28
|
+
width: 40px;
|
|
29
|
+
height: 20px;
|
|
30
|
+
|
|
31
|
+
&::before {
|
|
32
|
+
height: 14px;
|
|
33
|
+
width: 14px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.label {
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.square .toggle {
|
|
43
|
+
border-radius: 5px;
|
|
44
|
+
|
|
45
|
+
&::before {
|
|
46
|
+
border-radius: 5px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
input {
|
|
51
|
+
display: none;
|
|
52
|
+
|
|
53
|
+
&:checked + span {
|
|
54
|
+
background-color: var(--w-switch-on-color);
|
|
55
|
+
|
|
56
|
+
&::before {
|
|
57
|
+
transform: translateX(30px);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.toggle {
|
|
63
|
+
@include Transition(background);
|
|
64
|
+
position: relative;
|
|
65
|
+
width: 60px;
|
|
66
|
+
height: 30px;
|
|
67
|
+
background: var(--w-switch-off-color);
|
|
68
|
+
border-radius: 30px;
|
|
69
|
+
|
|
70
|
+
&::before {
|
|
71
|
+
content: "";
|
|
72
|
+
position: absolute;
|
|
73
|
+
height: 24px;
|
|
74
|
+
width: 24px;
|
|
75
|
+
left: 3px;
|
|
76
|
+
bottom: 3px;
|
|
77
|
+
background: #000;
|
|
78
|
+
border-radius: 50%;
|
|
79
|
+
transition: 0.3s;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
package/icons/check.svg
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 1.84615C6.39219 1.84615 1.84615 6.39219 1.84615 12C1.84615 17.6078 6.39219 22.1538 12 22.1538C17.6078 22.1538 22.1538 17.6078 22.1538 12C22.1538 6.39219 17.6078 1.84615 12 1.84615ZM0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12Z" fill="currentColor"/>
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M23.086 2.4174C24.073 3.13011 24.2953 4.50795 23.5827 5.49488L13.0118 20.1331C13.012 20.1328 13.0116 20.1333 13.0118 20.1331C12.559 20.7606 11.9697 21.2786 11.2894 21.647C10.6088 22.0155 9.85351 22.2256 9.0803 22.2619C8.30708 22.298 7.53554 22.159 6.82355 21.8555C6.11169 21.552 5.4775 21.0918 4.9682 20.5092C4.96837 20.5094 4.96803 20.5089 4.9682 20.5092L0.544999 15.451C-0.256393 14.5348 -0.163144 13.1422 0.753251 12.3408C1.66965 11.5394 3.06219 11.6327 3.86356 12.549L8.28678 17.6071C8.35962 17.6905 8.4506 17.7566 8.55232 17.8001C8.65405 17.8435 8.76437 17.8633 8.8747 17.8581C8.98526 17.8528 9.09319 17.823 9.19038 17.7702C9.28757 17.7177 9.37163 17.6437 9.43634 17.5541L20.0087 2.91393C20.7212 1.92699 22.0991 1.7047 23.086 2.4174Z" fill="currentColor"/>
|
|
4
3
|
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.6425 7.92858C17.0558 8.22704 17.1489 8.80404 16.8505 9.21734L12.4237 15.3474C12.4236 15.3475 12.4238 15.3473 12.4237 15.3474C12.2341 15.6102 11.9873 15.8271 11.7024 15.9814C11.4174 16.1357 11.1011 16.2237 10.7773 16.2389C10.4535 16.254 10.1304 16.1958 9.83224 16.0687C9.53413 15.9416 9.26855 15.7489 9.05527 15.5049C9.0552 15.5048 9.05534 15.505 9.05527 15.5049L7.20296 13.3867C6.86736 13.003 6.90641 12.4198 7.29017 12.0842C7.67393 11.7486 8.25709 11.7877 8.59268 12.1714L10.445 14.2896C10.4755 14.3245 10.5136 14.3522 10.5562 14.3704C10.5988 14.3886 10.645 14.3969 10.6912 14.3947C10.7375 14.3925 10.7827 14.38 10.8234 14.3579C10.8641 14.3359 10.8993 14.3049 10.9264 14.2674L15.3538 8.13651C15.6522 7.72321 16.2292 7.63012 16.6425 7.92858Z" fill="currentColor"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 1.84615C6.39219 1.84615 1.84615 6.39219 1.84615 12C1.84615 17.6078 6.39219 22.1538 12 22.1538C17.6078 22.1538 22.1538 17.6078 22.1538 12C22.1538 6.39219 17.6078 1.84615 12 1.84615ZM0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12Z" fill="currentColor"/>
|
|
4
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcoreui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "astro dev",
|
|
7
7
|
"build": "astro check && astro build",
|
|
8
8
|
"build:package": "node scripts/build.js",
|
|
9
|
-
"test": "echo \"Error: no test specified\""
|
|
9
|
+
"test": "echo \"Error: no test specified\"",
|
|
10
|
+
"create-component": "node scripts/createComponent.js"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"@astrojs/check": "0.7.0",
|
package/react.d.ts
CHANGED
|
@@ -2,18 +2,28 @@
|
|
|
2
2
|
declare module 'webcoreui/react' {
|
|
3
3
|
import type { AccordionProps } from './components/Accordion/accordion'
|
|
4
4
|
import type { AlertProps } from './components/Alert/alert'
|
|
5
|
+
import type { AvatarProps } from './components/Avatar/avatar'
|
|
5
6
|
import type { BadgeProps } from './components/Badge/badge'
|
|
6
7
|
import type { ButtonProps } from './components/Button/button'
|
|
7
8
|
import type { CardProps } from './components/Card/card'
|
|
9
|
+
import type { CheckboxProps } from './components/Checkbox/checkbox'
|
|
8
10
|
import type { ConditionalWrapperProps } from './components/ConditionalWrapper/conditionalwrapper'
|
|
9
11
|
import type { IconProps } from './components/Icon/icon'
|
|
12
|
+
import type { RadioProps } from './components/Radio/radio'
|
|
13
|
+
import type { RatingProps } from './components/Rating/rating'
|
|
14
|
+
import type { SwitchProps } from './components/Switch/switch'
|
|
10
15
|
|
|
11
16
|
export function Accordion(_props: AccordionProps): any
|
|
12
17
|
export function Alert(_props: AlertProps): any
|
|
18
|
+
export function Avatar(_props: AvatarProps): any
|
|
13
19
|
export function Badge(_props: BadgeProps): any
|
|
14
20
|
export function Button(_props: ButtonProps): any
|
|
15
21
|
export function Card(_props: CardProps): any
|
|
22
|
+
export function Checkbox(_props: CheckboxProps): any
|
|
16
23
|
export function ConditionalWrapper(_props: ConditionalWrapperProps): any
|
|
17
24
|
export function Icon(_props: IconProps): any
|
|
25
|
+
export function Radio(_props: RadioProps): any
|
|
26
|
+
export function Rating(_props: RatingProps): any
|
|
27
|
+
export function Switch(_props: SwitchProps): any
|
|
18
28
|
}
|
|
19
29
|
|
package/react.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import AccordionComponent from './components/Accordion/Accordion.tsx'
|
|
2
2
|
import AlertComponent from './components/Alert/Alert.tsx'
|
|
3
|
+
import AvatarComponent from './components/Avatar/Avatar.tsx'
|
|
3
4
|
import BadgeComponent from './components/Badge/Badge.tsx'
|
|
4
5
|
import ButtonComponent from './components/Button/Button.tsx'
|
|
5
6
|
import CardComponent from './components/Card/Card.tsx'
|
|
7
|
+
import CheckboxComponent from './components/Checkbox/Checkbox.tsx'
|
|
6
8
|
import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.tsx'
|
|
7
9
|
import IconComponent from './components/Icon/Icon.tsx'
|
|
10
|
+
import RadioComponent from './components/Radio/Radio.tsx'
|
|
11
|
+
import RatingComponent from './components/Rating/Rating.tsx'
|
|
12
|
+
import SwitchComponent from './components/Switch/Switch.tsx'
|
|
8
13
|
|
|
9
14
|
export const Accordion = AccordionComponent
|
|
10
15
|
export const Alert = AlertComponent
|
|
16
|
+
export const Avatar = AvatarComponent
|
|
11
17
|
export const Badge = BadgeComponent
|
|
12
18
|
export const Button = ButtonComponent
|
|
13
19
|
export const Card = CardComponent
|
|
20
|
+
export const Checkbox = CheckboxComponent
|
|
14
21
|
export const ConditionalWrapper = ConditionalWrapperComponent
|
|
15
|
-
export const Icon = IconComponent
|
|
22
|
+
export const Icon = IconComponent
|
|
23
|
+
export const Radio = RadioComponent
|
|
24
|
+
export const Rating = RatingComponent
|
|
25
|
+
export const Switch = SwitchComponent
|
package/scss/setup.scss
CHANGED
|
@@ -6,6 +6,17 @@ $config: (
|
|
|
6
6
|
includeElementStyles: true
|
|
7
7
|
);
|
|
8
8
|
|
|
9
|
+
:root {
|
|
10
|
+
--w-avatar-border: #000;
|
|
11
|
+
--w-rating-color: #FFF;
|
|
12
|
+
--w-rating-empty-color: #BBB;
|
|
13
|
+
--w-rating-size: 18px;
|
|
14
|
+
--w-switch-off-color: #252525;
|
|
15
|
+
--w-switch-on-color: #FFF;
|
|
16
|
+
--w-checkbox-color: #FFF;
|
|
17
|
+
--w-radio-color: #FFF;
|
|
18
|
+
}
|
|
19
|
+
|
|
9
20
|
@function config($key) {
|
|
10
21
|
@return map.get($config, $key);
|
|
11
22
|
}
|
package/svelte.d.ts
CHANGED
|
@@ -2,18 +2,28 @@
|
|
|
2
2
|
declare module 'webcoreui/svelte' {
|
|
3
3
|
import type { AccordionProps } from './components/Accordion/accordion'
|
|
4
4
|
import type { AlertProps } from './components/Alert/alert'
|
|
5
|
+
import type { AvatarProps } from './components/Avatar/avatar'
|
|
5
6
|
import type { BadgeProps } from './components/Badge/badge'
|
|
6
7
|
import type { ButtonProps } from './components/Button/button'
|
|
7
8
|
import type { CardProps } from './components/Card/card'
|
|
9
|
+
import type { CheckboxProps } from './components/Checkbox/checkbox'
|
|
8
10
|
import type { ConditionalWrapperProps } from './components/ConditionalWrapper/conditionalwrapper'
|
|
9
11
|
import type { IconProps } from './components/Icon/icon'
|
|
12
|
+
import type { RadioProps } from './components/Radio/radio'
|
|
13
|
+
import type { RatingProps } from './components/Rating/rating'
|
|
14
|
+
import type { SwitchProps } from './components/Switch/switch'
|
|
10
15
|
|
|
11
16
|
export function Accordion(_props: AccordionProps): any
|
|
12
17
|
export function Alert(_props: AlertProps): any
|
|
18
|
+
export function Avatar(_props: AvatarProps): any
|
|
13
19
|
export function Badge(_props: BadgeProps): any
|
|
14
20
|
export function Button(_props: ButtonProps): any
|
|
15
21
|
export function Card(_props: CardProps): any
|
|
22
|
+
export function Checkbox(_props: CheckboxProps): any
|
|
16
23
|
export function ConditionalWrapper(_props: ConditionalWrapperProps): any
|
|
17
24
|
export function Icon(_props: IconProps): any
|
|
25
|
+
export function Radio(_props: RadioProps): any
|
|
26
|
+
export function Rating(_props: RatingProps): any
|
|
27
|
+
export function Switch(_props: SwitchProps): any
|
|
18
28
|
}
|
|
19
29
|
|
package/svelte.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import AccordionComponent from './components/Accordion/Accordion.svelte'
|
|
2
2
|
import AlertComponent from './components/Alert/Alert.svelte'
|
|
3
|
+
import AvatarComponent from './components/Avatar/Avatar.svelte'
|
|
3
4
|
import BadgeComponent from './components/Badge/Badge.svelte'
|
|
4
5
|
import ButtonComponent from './components/Button/Button.svelte'
|
|
5
6
|
import CardComponent from './components/Card/Card.svelte'
|
|
7
|
+
import CheckboxComponent from './components/Checkbox/Checkbox.svelte'
|
|
6
8
|
import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.svelte'
|
|
7
9
|
import IconComponent from './components/Icon/Icon.svelte'
|
|
10
|
+
import RadioComponent from './components/Radio/Radio.svelte'
|
|
11
|
+
import RatingComponent from './components/Rating/Rating.svelte'
|
|
12
|
+
import SwitchComponent from './components/Switch/Switch.svelte'
|
|
8
13
|
|
|
9
14
|
export const Accordion = AccordionComponent
|
|
10
15
|
export const Alert = AlertComponent
|
|
16
|
+
export const Avatar = AvatarComponent
|
|
11
17
|
export const Badge = BadgeComponent
|
|
12
18
|
export const Button = ButtonComponent
|
|
13
19
|
export const Card = CardComponent
|
|
20
|
+
export const Checkbox = CheckboxComponent
|
|
14
21
|
export const ConditionalWrapper = ConditionalWrapperComponent
|
|
15
|
-
export const Icon = IconComponent
|
|
22
|
+
export const Icon = IconComponent
|
|
23
|
+
export const Radio = RadioComponent
|
|
24
|
+
export const Rating = RatingComponent
|
|
25
|
+
export const Switch = SwitchComponent
|