webcoreui 0.3.0 → 0.4.1
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 +5 -2
- package/astro.d.ts +7 -1
- package/astro.js +6 -0
- package/components/Accordion/Accordion.astro +2 -0
- package/components/Accordion/Accordion.svelte +2 -0
- package/components/Accordion/Accordion.tsx +2 -0
- package/components/Alert/Alert.astro +3 -2
- package/components/Alert/Alert.svelte +4 -3
- package/components/Alert/Alert.tsx +3 -2
- package/components/Avatar/Avatar.astro +2 -1
- package/components/Avatar/Avatar.svelte +2 -1
- package/components/Avatar/Avatar.tsx +3 -3
- package/components/Badge/Badge.astro +1 -0
- package/components/Badge/Badge.svelte +3 -2
- package/components/Badge/Badge.tsx +2 -1
- package/components/Button/Button.astro +4 -5
- package/components/Button/Button.svelte +2 -1
- package/components/Button/Button.tsx +2 -1
- package/components/Button/button.ts +1 -1
- package/components/Card/Card.astro +11 -3
- package/components/Card/Card.svelte +5 -2
- package/components/Card/Card.tsx +5 -2
- package/components/Card/card.ts +1 -0
- package/components/Checkbox/Checkbox.astro +1 -0
- package/components/Checkbox/Checkbox.svelte +7 -5
- package/components/Checkbox/Checkbox.tsx +4 -2
- package/components/Collapsible/Collapsible.astro +2 -1
- package/components/Collapsible/Collapsible.svelte +2 -1
- package/components/Collapsible/Collapsible.tsx +55 -54
- package/components/ConditionalWrapper/ConditionalWrapper.astro +2 -1
- package/components/ConditionalWrapper/ConditionalWrapper.tsx +1 -2
- package/components/Group/Group.astro +22 -0
- package/components/Group/Group.svelte +20 -0
- package/components/Group/Group.tsx +22 -0
- package/components/Group/group.module.scss +43 -0
- package/components/Group/group.ts +8 -0
- package/components/Icon/map.ts +2 -0
- package/components/Input/Input.astro +8 -1
- package/components/Input/Input.svelte +15 -3
- package/components/Input/Input.tsx +10 -3
- package/components/Input/input.module.scss +4 -1
- package/components/Input/input.ts +9 -4
- package/components/List/List.astro +169 -0
- package/components/List/List.svelte +147 -0
- package/components/List/List.tsx +168 -0
- package/components/List/list.module.scss +91 -0
- package/components/List/list.ts +37 -0
- package/components/Menu/Menu.astro +2 -1
- package/components/Menu/Menu.svelte +7 -5
- package/components/Menu/Menu.tsx +116 -113
- package/components/Modal/Modal.astro +6 -4
- package/components/Modal/Modal.svelte +8 -6
- package/components/Modal/Modal.tsx +79 -76
- package/components/Modal/modal.ts +1 -0
- package/components/Popover/Popover.astro +4 -1
- package/components/Popover/Popover.svelte +4 -2
- package/components/Popover/Popover.tsx +55 -27
- package/components/Popover/popover.module.scss +1 -0
- package/components/Popover/popover.ts +2 -0
- package/components/Progress/Progress.astro +2 -1
- package/components/Progress/Progress.svelte +2 -1
- package/components/Progress/Progress.tsx +3 -2
- package/components/Radio/Radio.astro +1 -0
- package/components/Radio/Radio.svelte +4 -2
- package/components/Radio/Radio.tsx +3 -2
- package/components/Rating/Rating.astro +3 -1
- package/components/Rating/Rating.svelte +9 -7
- package/components/Rating/Rating.tsx +4 -2
- package/components/Select/Select.astro +135 -0
- package/components/Select/Select.svelte +122 -0
- package/components/Select/Select.tsx +142 -0
- package/components/Select/select.module.scss +25 -0
- package/components/Select/select.ts +21 -0
- package/components/Sheet/Sheet.astro +2 -1
- package/components/Sheet/Sheet.svelte +2 -1
- package/components/Sheet/Sheet.tsx +33 -32
- package/components/Slider/Slider.astro +2 -1
- package/components/Slider/Slider.svelte +2 -1
- package/components/Slider/Slider.tsx +49 -48
- package/components/Spinner/Spinner.astro +4 -3
- package/components/Spinner/Spinner.svelte +3 -2
- package/components/Spinner/Spinner.tsx +4 -3
- package/components/Switch/Switch.astro +2 -1
- package/components/Switch/Switch.svelte +5 -4
- package/components/Switch/Switch.tsx +2 -2
- package/components/Switch/switch.module.scss +1 -1
- package/components/Table/Table.astro +1 -0
- package/components/Table/Table.svelte +2 -1
- package/components/Table/Table.tsx +2 -1
- package/components/Tabs/Tabs.astro +2 -1
- package/components/Tabs/Tabs.svelte +2 -1
- package/components/Tabs/Tabs.tsx +4 -3
- package/components/Textarea/Textarea.astro +1 -0
- package/components/Textarea/Textarea.svelte +3 -1
- package/components/Textarea/Textarea.tsx +52 -50
- package/components/ThemeSwitcher/ThemeSwitcher.astro +108 -107
- package/components/ThemeSwitcher/ThemeSwitcher.svelte +5 -4
- package/components/ThemeSwitcher/ThemeSwitcher.tsx +91 -90
- package/components/Timeline/Timeline.astro +3 -2
- package/components/Timeline/Timeline.svelte +3 -2
- package/components/Timeline/Timeline.tsx +3 -2
- package/components/TimelineItem/TimelineItem.svelte +2 -1
- package/components/TimelineItem/TimelineItem.tsx +2 -1
- package/components/Toast/Toast.astro +3 -1
- package/components/Toast/Toast.svelte +3 -1
- package/components/Toast/Toast.tsx +3 -1
- package/icons/moon.svg +1 -1
- package/icons/search.svg +3 -0
- package/icons.d.ts +1 -0
- package/icons.js +1 -0
- package/index.d.ts +55 -25
- package/package.json +22 -2
- package/react.d.ts +6 -0
- package/react.js +6 -0
- package/scss/config/mixins.scss +12 -10
- package/scss/config/variables.scss +1 -0
- package/scss/config.scss +1 -0
- package/scss/global/utility.scss +2 -0
- package/svelte.d.ts +7 -1
- package/svelte.js +6 -0
- package/utils/cookies.ts +4 -4
- package/utils/debounce.ts +1 -1
- package/utils/event.ts +2 -2
- package/utils/interpolate.ts +5 -5
- package/utils/modal.ts +90 -27
- package/utils/popover.ts +30 -8
- package/utils/toast.ts +6 -2
|
@@ -1,107 +1,108 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { ThemeSwitcherProps } from './themeswitcher'
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
data-
|
|
35
|
-
data-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{index
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
import {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|| (
|
|
59
|
-
||
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
---
|
|
2
|
+
import type { ThemeSwitcherProps } from './themeswitcher'
|
|
3
|
+
|
|
4
|
+
import styles from './themeswitcher.module.scss'
|
|
5
|
+
|
|
6
|
+
interface Props extends ThemeSwitcherProps {}
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
themes,
|
|
10
|
+
toggle,
|
|
11
|
+
size,
|
|
12
|
+
className
|
|
13
|
+
} = Astro.props
|
|
14
|
+
|
|
15
|
+
const classes = [
|
|
16
|
+
styles.switcher,
|
|
17
|
+
toggle && styles.toggle,
|
|
18
|
+
className
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
const primaryTheme = themes[Object.keys(themes)[0]]
|
|
22
|
+
const secondaryTheme = themes[Object.keys(themes)[1]]
|
|
23
|
+
const useIcons = Astro.slots.has('primaryIcon') && Astro.slots.has('secondaryIcon')
|
|
24
|
+
|
|
25
|
+
const buttonClasses = [
|
|
26
|
+
styles.switch,
|
|
27
|
+
useIcons && styles.icons
|
|
28
|
+
]
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
class:list={classes}
|
|
33
|
+
style={size ? `--w-theme-switcher-size: ${size}px;` : null}
|
|
34
|
+
data-id="w-theme-switcher"
|
|
35
|
+
data-primary-theme={primaryTheme}
|
|
36
|
+
data-secondary-theme={toggle ? secondaryTheme : undefined}
|
|
37
|
+
>
|
|
38
|
+
{Object.keys(themes).map((theme, index) => (
|
|
39
|
+
<button
|
|
40
|
+
style={!useIcons ? `background:${theme};` : undefined}
|
|
41
|
+
data-theme={themes[theme]}
|
|
42
|
+
aria-label={themes[theme]}
|
|
43
|
+
class:list={buttonClasses}
|
|
44
|
+
>
|
|
45
|
+
{index === 0 && <slot name="primaryIcon" />}
|
|
46
|
+
{index !== 0 && <slot name="secondaryIcon" />}
|
|
47
|
+
</button>
|
|
48
|
+
))}
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import { getCookie, setCookie } from '../../utils/cookies'
|
|
53
|
+
import { dispatch, listen } from '../../utils/event'
|
|
54
|
+
|
|
55
|
+
const switchers = document.querySelectorAll('[data-id="w-theme-switcher"]')
|
|
56
|
+
|
|
57
|
+
let currentTheme = localStorage.getItem('w-theme')
|
|
58
|
+
|| getCookie('w-theme')
|
|
59
|
+
|| (switchers[0] as HTMLDivElement).dataset.primaryTheme
|
|
60
|
+
|| ''
|
|
61
|
+
|
|
62
|
+
const setActiveButton = (buttons: HTMLButtonElement[]) => {
|
|
63
|
+
buttons.forEach(button => button.dataset.active = 'false')
|
|
64
|
+
|
|
65
|
+
buttons.forEach(button => {
|
|
66
|
+
if (button.dataset.theme === currentTheme) {
|
|
67
|
+
button.dataset.active = 'true'
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Array.from(switchers).forEach(switcher => {
|
|
73
|
+
const buttons = Array.from(switcher.querySelectorAll('button'))
|
|
74
|
+
|
|
75
|
+
setActiveButton(buttons)
|
|
76
|
+
|
|
77
|
+
listen('theme-switched', theme => {
|
|
78
|
+
currentTheme = theme
|
|
79
|
+
|
|
80
|
+
setActiveButton(buttons)
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
switcher.addEventListener('click', event => {
|
|
84
|
+
const target = event.target as HTMLButtonElement
|
|
85
|
+
|
|
86
|
+
if (target.nodeName === 'BUTTON') {
|
|
87
|
+
const toggleTheme = (switcher as HTMLDivElement).dataset.secondaryTheme
|
|
88
|
+
|
|
89
|
+
const theme = toggleTheme
|
|
90
|
+
? toggleTheme === target.dataset.theme
|
|
91
|
+
? (target.previousElementSibling as HTMLButtonElement).dataset.theme as string
|
|
92
|
+
: (target.nextElementSibling as HTMLButtonElement).dataset.theme as string
|
|
93
|
+
: target.dataset.theme as string
|
|
94
|
+
|
|
95
|
+
document.body.classList.replace(currentTheme, theme)
|
|
96
|
+
|
|
97
|
+
currentTheme = theme
|
|
98
|
+
|
|
99
|
+
setActiveButton(buttons)
|
|
100
|
+
setCookie('w-theme', currentTheme, 30)
|
|
101
|
+
localStorage.setItem('w-theme', currentTheme)
|
|
102
|
+
|
|
103
|
+
dispatch('theme-switched', currentTheme)
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
</script>
|
|
108
|
+
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte'
|
|
3
3
|
import type { ThemeSwitcherProps } from './themeswitcher'
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
import { classNames } from '../../utils/classNames'
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { getCookie, setCookie } from '../../utils/cookies'
|
|
7
|
+
import { dispatch, listen } from '../../utils/event'
|
|
8
8
|
|
|
9
9
|
import styles from './themeswitcher.module.scss'
|
|
10
10
|
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
|
|
25
25
|
const primaryTheme = themes[Object.keys(themes)[0]]
|
|
26
26
|
const secondaryTheme = themes[Object.keys(themes)[1]]
|
|
27
|
-
const useIcons = $$slots.primaryIcon && $$slots.secondaryIcon
|
|
27
|
+
const useIcons = $$slots.primaryIcon && $$slots.secondaryIcon
|
|
28
28
|
|
|
29
29
|
const setTheme = (theme: string | number) => {
|
|
30
30
|
if (typeof theme === 'number') {
|
|
31
|
+
// eslint-disable-next-line no-param-reassign
|
|
31
32
|
theme = toggled ? primaryTheme : secondaryTheme
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -1,90 +1,91 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import type { ReactThemeSwitcherProps } from './themeswitcher'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import styles from './themeswitcher.module.scss'
|
|
9
|
-
|
|
10
|
-
const ThemeSwitcher = ({
|
|
11
|
-
themes,
|
|
12
|
-
toggle,
|
|
13
|
-
size,
|
|
14
|
-
primaryIcon,
|
|
15
|
-
secondaryIcon,
|
|
16
|
-
className
|
|
17
|
-
}: ReactThemeSwitcherProps) => {
|
|
18
|
-
const [currentTheme, setCurrentTheme] = useState('')
|
|
19
|
-
const [toggled, setToggled] = useState(false)
|
|
20
|
-
|
|
21
|
-
const classes = classNames([
|
|
22
|
-
styles.switcher,
|
|
23
|
-
toggle && styles.toggle,
|
|
24
|
-
className
|
|
25
|
-
])
|
|
26
|
-
|
|
27
|
-
const sizeStyles = size
|
|
28
|
-
? { '--w-theme-switcher-size': `${size}px` } as React.CSSProperties
|
|
29
|
-
: undefined
|
|
30
|
-
|
|
31
|
-
const primaryTheme = themes[Object.keys(themes)[0]]
|
|
32
|
-
const secondaryTheme = themes[Object.keys(themes)[1]]
|
|
33
|
-
const useIcons = primaryIcon && secondaryIcon
|
|
34
|
-
|
|
35
|
-
const setTheme = (theme: string | number) => {
|
|
36
|
-
if (typeof theme === 'number') {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
||
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{index
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import type { ReactThemeSwitcherProps } from './themeswitcher'
|
|
3
|
+
|
|
4
|
+
import { classNames } from '../../utils/classNames'
|
|
5
|
+
import { getCookie, setCookie } from '../../utils/cookies'
|
|
6
|
+
import { dispatch, listen } from '../../utils/event'
|
|
7
|
+
|
|
8
|
+
import styles from './themeswitcher.module.scss'
|
|
9
|
+
|
|
10
|
+
const ThemeSwitcher = ({
|
|
11
|
+
themes,
|
|
12
|
+
toggle,
|
|
13
|
+
size,
|
|
14
|
+
primaryIcon,
|
|
15
|
+
secondaryIcon,
|
|
16
|
+
className
|
|
17
|
+
}: ReactThemeSwitcherProps) => {
|
|
18
|
+
const [currentTheme, setCurrentTheme] = useState('')
|
|
19
|
+
const [toggled, setToggled] = useState(false)
|
|
20
|
+
|
|
21
|
+
const classes = classNames([
|
|
22
|
+
styles.switcher,
|
|
23
|
+
toggle && styles.toggle,
|
|
24
|
+
className
|
|
25
|
+
])
|
|
26
|
+
|
|
27
|
+
const sizeStyles = size
|
|
28
|
+
? { '--w-theme-switcher-size': `${size}px` } as React.CSSProperties
|
|
29
|
+
: undefined
|
|
30
|
+
|
|
31
|
+
const primaryTheme = themes[Object.keys(themes)[0]]
|
|
32
|
+
const secondaryTheme = themes[Object.keys(themes)[1]]
|
|
33
|
+
const useIcons = primaryIcon && secondaryIcon
|
|
34
|
+
|
|
35
|
+
const setTheme = (theme: string | number) => {
|
|
36
|
+
if (typeof theme === 'number') {
|
|
37
|
+
// eslint-disable-next-line no-param-reassign
|
|
38
|
+
theme = toggled ? primaryTheme : secondaryTheme
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
document.body.classList.replace(currentTheme, theme)
|
|
42
|
+
|
|
43
|
+
setCookie('w-theme', theme, 30)
|
|
44
|
+
localStorage.setItem('w-theme', theme)
|
|
45
|
+
|
|
46
|
+
dispatch('theme-switched', theme)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
setCurrentTheme(
|
|
51
|
+
localStorage.getItem('w-theme')
|
|
52
|
+
|| getCookie('w-theme')
|
|
53
|
+
|| themes[Object.keys(themes)[0]]
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
if (toggle && currentTheme === secondaryTheme) {
|
|
57
|
+
setToggled(true)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
listen('theme-switched', theme => {
|
|
61
|
+
setCurrentTheme(theme)
|
|
62
|
+
setToggled(theme === secondaryTheme)
|
|
63
|
+
})
|
|
64
|
+
}, [])
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div
|
|
68
|
+
className={classes}
|
|
69
|
+
style={sizeStyles}
|
|
70
|
+
>
|
|
71
|
+
{Object.keys(themes).map((theme, index) => (
|
|
72
|
+
<button
|
|
73
|
+
key={index}
|
|
74
|
+
onClick={() => setTheme(toggle ? index : themes[theme])}
|
|
75
|
+
data-active={currentTheme === themes[theme]}
|
|
76
|
+
aria-label={themes[theme]}
|
|
77
|
+
style={!useIcons ? { background: theme } : undefined}
|
|
78
|
+
className={classNames([
|
|
79
|
+
styles.switch,
|
|
80
|
+
useIcons && styles.icons
|
|
81
|
+
])}
|
|
82
|
+
>
|
|
83
|
+
{index === 0 && primaryIcon}
|
|
84
|
+
{index !== 0 && secondaryIcon}
|
|
85
|
+
</button>
|
|
86
|
+
))}
|
|
87
|
+
</div>
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default ThemeSwitcher
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { TimelineProps } from './timeline'
|
|
3
3
|
|
|
4
|
-
import styles from './timeline.module.scss'
|
|
5
4
|
import { classNames } from '../../utils/classNames'
|
|
6
5
|
|
|
6
|
+
import styles from './timeline.module.scss'
|
|
7
|
+
|
|
7
8
|
interface Props extends TimelineProps {}
|
|
8
9
|
|
|
9
10
|
const {
|
|
@@ -27,7 +28,7 @@ const classes = [
|
|
|
27
28
|
const styleVariables = classNames([
|
|
28
29
|
color && `--w-timeline-color: ${color};`,
|
|
29
30
|
textColor && `--w-timeline-text-color: ${textColor};`,
|
|
30
|
-
counter && `--w-timeline-counter: ${counter}
|
|
31
|
+
counter && `--w-timeline-counter: ${counter};`
|
|
31
32
|
])
|
|
32
33
|
---
|
|
33
34
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { TimelineProps } from './timeline'
|
|
3
3
|
|
|
4
|
-
import styles from './timeline.module.scss'
|
|
5
4
|
import { classNames } from '../../utils/classNames'
|
|
6
5
|
|
|
6
|
+
import styles from './timeline.module.scss'
|
|
7
|
+
|
|
7
8
|
export let theme: TimelineProps['theme'] = null
|
|
8
9
|
export let counter: TimelineProps['counter'] = null
|
|
9
10
|
export let alternate: TimelineProps['alternate'] = false
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
const styleVariables = classNames([
|
|
24
25
|
color && `--w-timeline-color: ${color};`,
|
|
25
26
|
textColor && `--w-timeline-text-color: ${textColor};`,
|
|
26
|
-
counter && `--w-timeline-counter: ${counter}
|
|
27
|
+
counter && `--w-timeline-counter: ${counter};`
|
|
27
28
|
])
|
|
28
29
|
</script>
|
|
29
30
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import type { ReactTimelineProps } from './timeline'
|
|
3
3
|
|
|
4
|
-
import styles from './timeline.module.scss'
|
|
5
4
|
import { classNames } from '../../utils/classNames'
|
|
6
5
|
|
|
6
|
+
import styles from './timeline.module.scss'
|
|
7
|
+
|
|
7
8
|
const Timeline = ({
|
|
8
9
|
theme,
|
|
9
10
|
counter,
|
|
@@ -25,7 +26,7 @@ const Timeline = ({
|
|
|
25
26
|
const styleVariables = {
|
|
26
27
|
...(color && { '--w-timeline-color': color }),
|
|
27
28
|
...(textColor && { '--w-timeline-text-color': textColor }),
|
|
28
|
-
...(counter && { '--w-timeline-counter': counter })
|
|
29
|
+
...(counter && { '--w-timeline-counter': counter })
|
|
29
30
|
} as React.CSSProperties
|
|
30
31
|
|
|
31
32
|
return (
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { TimelineItemProps } from './timelineitem'
|
|
3
3
|
|
|
4
|
-
import styles from './timelineitem.module.scss'
|
|
5
4
|
import { classNames } from '../../utils/classNames'
|
|
6
5
|
|
|
6
|
+
import styles from './timelineitem.module.scss'
|
|
7
|
+
|
|
7
8
|
export let title: TimelineItemProps['title'] = ''
|
|
8
9
|
export let titleTag: TimelineItemProps['titleTag'] = 'span'
|
|
9
10
|
export let className: TimelineItemProps['className'] = ''
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import type { ReactTimelineItemProps } from './timelineitem'
|
|
3
3
|
|
|
4
|
-
import styles from './timelineitem.module.scss'
|
|
5
4
|
import { classNames } from '../../utils/classNames'
|
|
6
5
|
|
|
6
|
+
import styles from './timelineitem.module.scss'
|
|
7
|
+
|
|
7
8
|
const TimelineItem = ({
|
|
8
9
|
title,
|
|
9
10
|
TitleTag = 'span',
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { ToastProps } from './toast'
|
|
3
|
+
|
|
3
4
|
import Alert from '../Alert/Alert.astro'
|
|
4
5
|
|
|
5
|
-
import styles from './toast.module.scss'
|
|
6
6
|
import { classNames } from '../../utils/classNames'
|
|
7
7
|
|
|
8
|
+
import styles from './toast.module.scss'
|
|
9
|
+
|
|
8
10
|
interface Props extends ToastProps {}
|
|
9
11
|
|
|
10
12
|
const {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ToastProps } from './toast'
|
|
3
|
+
|
|
3
4
|
import Alert from '../Alert/Alert.svelte'
|
|
4
5
|
|
|
5
|
-
import styles from './toast.module.scss'
|
|
6
6
|
import { classNames } from '../../utils/classNames'
|
|
7
7
|
|
|
8
|
+
import styles from './toast.module.scss'
|
|
9
|
+
|
|
8
10
|
export let position: ToastProps['position'] = null
|
|
9
11
|
export let className: ToastProps['className'] = ''
|
|
10
12
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import type { ReactToastProps } from './toast'
|
|
3
|
+
|
|
3
4
|
import Alert from '../Alert/Alert.tsx'
|
|
4
5
|
|
|
5
|
-
import styles from './toast.module.scss'
|
|
6
6
|
import { classNames } from '../../utils/classNames'
|
|
7
7
|
|
|
8
|
+
import styles from './toast.module.scss'
|
|
9
|
+
|
|
8
10
|
const Toast = ({
|
|
9
11
|
icon,
|
|
10
12
|
position,
|
package/icons/moon.svg
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M23 12.9878C22.3889 19.5232 15.8512 24.1592 9.42483 22.745C-2.76068 20.0671 -1.26102 2.11102 10.9147 1C5.14829 8.69528 15.1998 18.6762 23 12.9878Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
3
|
</svg>
|
package/icons/search.svg
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M18.765 18.765L23 23M21.7776 11.4239C21.7776 17.181 17.126 21.8478 11.3895 21.8478C5.65163 21.8478 1 17.181 1 11.4252C1 5.66537 5.65162 1 11.3881 1C17.126 1 21.7776 5.66675 21.7776 11.4239Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
</svg>
|
package/icons.d.ts
CHANGED
package/icons.js
CHANGED
|
@@ -6,5 +6,6 @@ export { default as close } from './icons/close.svg?raw'
|
|
|
6
6
|
export { default as github } from './icons/github.svg?raw'
|
|
7
7
|
export { default as info } from './icons/info.svg?raw'
|
|
8
8
|
export { default as moon } from './icons/moon.svg?raw'
|
|
9
|
+
export { default as search } from './icons/search.svg?raw'
|
|
9
10
|
export { default as sun } from './icons/sun.svg?raw'
|
|
10
11
|
export { default as warning } from './icons/warning.svg?raw'
|