webcoreui 1.3.0 → 1.5.0-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.
- package/README.md +21 -4
- package/astro.d.ts +6 -0
- package/astro.js +4 -0
- package/components/Accordion/Accordion.astro +1 -0
- package/components/Accordion/Accordion.svelte +3 -3
- package/components/Accordion/Accordion.tsx +1 -1
- package/components/Accordion/accordion.ts +1 -0
- package/components/Alert/Alert.svelte +3 -3
- package/components/AspectRatio/AspectRatio.svelte +22 -22
- package/components/Avatar/Avatar.astro +4 -2
- package/components/Avatar/Avatar.svelte +10 -8
- package/components/Avatar/Avatar.tsx +4 -2
- package/components/Avatar/avatar.module.scss +3 -5
- package/components/Badge/Badge.svelte +2 -2
- package/components/Badge/badge.module.scss +5 -6
- package/components/Banner/Banner.svelte +4 -3
- package/components/Banner/banner.module.scss +4 -6
- package/components/BottomNavigation/BottomNavigation.svelte +4 -3
- package/components/BottomNavigation/bottomnavigation.module.scss +68 -70
- package/components/Breadcrumb/Breadcrumb.svelte +2 -2
- package/components/Button/Button.svelte +2 -2
- package/components/Button/button.module.scss +9 -12
- package/components/Card/Card.svelte +4 -4
- package/components/Card/card.module.scss +3 -7
- package/components/Carousel/Carousel.astro +2 -2
- package/components/Carousel/Carousel.svelte +16 -16
- package/components/Carousel/Carousel.tsx +2 -2
- package/components/Carousel/carousel.module.scss +3 -5
- package/components/Checkbox/Checkbox.svelte +6 -3
- package/components/Checkbox/Checkbox.tsx +0 -2
- package/components/Checkbox/checkbox.module.scss +4 -6
- package/components/Checkbox/checkbox.ts +3 -1
- package/components/Collapsible/Collapsible.svelte +4 -4
- package/components/Collapsible/collapsible.module.scss +5 -5
- package/components/Collapsible/collapsible.ts +1 -1
- package/components/ContextMenu/ContextMenu.svelte +8 -6
- package/components/Copy/Copy.svelte +2 -2
- package/components/Counter/Counter.svelte +6 -5
- package/components/Counter/counter.module.scss +3 -5
- package/components/DataTable/DataTable.astro +4 -4
- package/components/DataTable/DataTable.svelte +16 -14
- package/components/DataTable/DataTable.tsx +1 -1
- package/components/Flex/Flex.svelte +4 -4
- package/components/Footer/Footer.svelte +6 -6
- package/components/Grid/Grid.svelte +4 -4
- package/components/Group/Group.svelte +2 -2
- package/components/Icon/Icon.svelte +13 -8
- package/components/Image/Image.astro +45 -0
- package/components/Image/Image.svelte +51 -0
- package/components/Image/Image.tsx +52 -0
- package/components/Image/image.module.scss +47 -0
- package/components/Image/image.ts +13 -0
- package/components/ImageLoader/ImageLoader.astro +82 -0
- package/components/ImageLoader/ImageLoader.svelte +72 -0
- package/components/ImageLoader/ImageLoader.tsx +82 -0
- package/components/ImageLoader/imageloader.module.scss +13 -0
- package/components/ImageLoader/imageloader.ts +6 -0
- package/components/Input/Input.svelte +5 -5
- package/components/Input/input.ts +2 -2
- package/components/Kbd/Kbd.svelte +2 -2
- package/components/List/List.svelte +7 -7
- package/components/List/List.tsx +2 -2
- package/components/Masonry/Masonry.svelte +7 -7
- package/components/Masonry/masonry.module.scss +4 -6
- package/components/Menu/Menu.svelte +6 -5
- package/components/Modal/Modal.svelte +4 -4
- package/components/Modal/modal.module.scss +5 -5
- package/components/OTPInput/OTPInput.svelte +4 -4
- package/components/OTPInput/otpinput.module.scss +0 -12
- package/components/Pagination/Pagination.svelte +2 -2
- package/components/Popover/Popover.svelte +2 -2
- package/components/Popover/popover.module.scss +4 -2
- package/components/Progress/Progress.svelte +5 -5
- package/components/Progress/progress.module.scss +15 -17
- package/components/Radio/Radio.astro +1 -0
- package/components/Radio/Radio.svelte +5 -3
- package/components/Radio/Radio.tsx +1 -0
- package/components/Radio/radio.module.scss +4 -6
- package/components/Radio/radio.ts +1 -0
- package/components/RangeSlider/RangeSlider.astro +4 -1
- package/components/RangeSlider/RangeSlider.svelte +17 -36
- package/components/RangeSlider/RangeSlider.tsx +5 -2
- package/components/RangeSlider/rangeslider.module.scss +14 -16
- package/components/RangeSlider/rangeslider.ts +1 -0
- package/components/Rating/Rating.svelte +7 -6
- package/components/Rating/rating.module.scss +13 -15
- package/components/Ribbon/Ribbon.svelte +2 -2
- package/components/Ribbon/ribbon.module.scss +9 -11
- package/components/Select/Select.astro +2 -0
- package/components/Select/Select.svelte +175 -172
- package/components/Select/Select.tsx +2 -0
- package/components/Select/select.ts +1 -0
- package/components/Sheet/Sheet.svelte +2 -2
- package/components/Sidebar/Sidebar.svelte +2 -2
- package/components/Skeleton/Skeleton.svelte +4 -4
- package/components/Skeleton/skeleton.module.scss +6 -9
- package/components/Slider/Slider.astro +6 -4
- package/components/Slider/Slider.svelte +10 -8
- package/components/Slider/Slider.tsx +6 -4
- package/components/Slider/slider.module.scss +12 -14
- package/components/Slider/slider.ts +3 -2
- package/components/SpeedDial/SpeedDial.svelte +3 -3
- package/components/SpeedDial/SpeedDial.tsx +1 -1
- package/components/SpeedDial/speeddial.module.scss +4 -6
- package/components/Spinner/Spinner.svelte +4 -4
- package/components/Spinner/spinner.module.scss +13 -14
- package/components/Spoiler/Spoiler.svelte +4 -3
- package/components/Spoiler/spoiler.module.scss +3 -5
- package/components/Stepper/Stepper.svelte +4 -4
- package/components/Stepper/stepper.defaults.scss +5 -0
- package/components/Stepper/stepper.module.scss +11 -13
- package/components/Switch/Switch.svelte +6 -4
- package/components/Switch/Switch.tsx +0 -2
- package/components/Switch/switch.module.scss +6 -7
- package/components/Switch/switch.ts +3 -1
- package/components/Table/Table.svelte +2 -2
- package/components/Tabs/Tabs.svelte +2 -2
- package/components/Textarea/Textarea.svelte +5 -3
- package/components/Textarea/textarea.ts +7 -6
- package/components/ThemeSwitcher/ThemeSwitcher.svelte +5 -5
- package/components/ThemeSwitcher/themeswitcher.module.scss +11 -12
- package/components/ThemeSwitcher/themeswitcher.ts +1 -0
- package/components/Timeline/Timeline.svelte +4 -4
- package/components/Timeline/timeline.module.scss +6 -8
- package/components/TimelineItem/TimelineItem.svelte +2 -2
- package/components/TimelineItem/timelineitem.module.scss +4 -4
- package/components/Toast/Toast.svelte +4 -4
- package/index.d.ts +12 -5
- package/package.json +22 -22
- package/react.d.ts +6 -0
- package/react.js +4 -0
- package/scss/config/functions.scss +41 -0
- package/scss/config/mixins.scss +65 -0
- package/scss/config.scss +1 -0
- package/scss/global/theme.scss +209 -194
- package/scss/resets.scss +2 -0
- package/scss/setup.scss +6 -3
- package/svelte.d.ts +6 -0
- package/svelte.js +4 -0
- package/utils/DOMUtils.ts +3 -3
- package/utils/modal.ts +2 -2
- package/utils/popover.ts +87 -46
package/README.md
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
- Full documentation available on [webcoreui.dev](https://webcoreui.dev).
|
|
54
54
|
- For installation steps, visit our [setup docs](https://webcoreui.dev/docs/setup).
|
|
55
|
+
- To build and test components visually, visit our [builder](https://webcoreui.dev/build).
|
|
55
56
|
|
|
56
57
|
## Getting Started
|
|
57
58
|
|
|
@@ -64,15 +65,15 @@ Webcore can be used as a standalone project, or it can be integrated into your e
|
|
|
64
65
|
|
|
65
66
|
Webcore components use Sass for styling. To use the component library, you must have the following packages installed:
|
|
66
67
|
|
|
67
|
-
- [Sass](https://www.npmjs.com/package/sass) - `v1.
|
|
68
|
+
- [Sass](https://www.npmjs.com/package/sass) - `v1.97`
|
|
68
69
|
- [TypeScript](https://www.npmjs.com/package/typescript) - `v5.9`
|
|
69
70
|
|
|
70
71
|
Depending on your project setup, you'll also need the following packages:
|
|
71
72
|
|
|
72
73
|
- **For Astro projects**
|
|
73
|
-
- [Astro](https://www.npmjs.com/package/astro) - `v5.
|
|
74
|
+
- [Astro](https://www.npmjs.com/package/astro) - `v5.17`
|
|
74
75
|
- **For Svelte projects**
|
|
75
|
-
- [Svelte](https://www.npmjs.com/package/svelte) - `v5.
|
|
76
|
+
- [Svelte](https://www.npmjs.com/package/svelte) - `v5.53`
|
|
76
77
|
- **For React projects**
|
|
77
78
|
- [React](https://www.npmjs.com/package/react) - `v19.2`
|
|
78
79
|
- [React DOM](https://www.npmjs.com/package/react-dom) -`v19.2`
|
|
@@ -122,6 +123,9 @@ export default defineConfig({
|
|
|
122
123
|
})
|
|
123
124
|
```
|
|
124
125
|
|
|
126
|
+
> [!TIP]
|
|
127
|
+
> We also recommend adding [`astro-purgecss`](https://www.npmjs.com/package/astro-purgecss) to improve your CSS bundle size.
|
|
128
|
+
|
|
125
129
|
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:
|
|
126
130
|
|
|
127
131
|
```scss
|
|
@@ -145,7 +149,9 @@ The `setup` mixin can also accept the following options:
|
|
|
145
149
|
| `includeUtilities` | `true` | Adds utility classes for CSS. Read more about the available utility classes [here](https://webcoreui.dev/docs/layout). |
|
|
146
150
|
| `includeTooltip` | `true` | Adds styles for using tooltips.
|
|
147
151
|
| `includeScrollbarStyles` | `true` | Adds styles for scrollbars.
|
|
148
|
-
| `includeBreakpoints` | `true` | Exposes breakpoint variables in CSS for JS. Used by components for responsiveness.
|
|
152
|
+
| `includeBreakpoints` | `true` | Exposes breakpoint variables in CSS for JS. Used by components for responsiveness. |
|
|
153
|
+
| `theme` | `dark` | Sets the default theme. Read more about available themes [here](https://webcoreui.dev/docs/themes). |
|
|
154
|
+
| `themes` | `()` | Pass a map to enable multiple themes. Values can be arbitrary CSS selectors that actives the theme. |
|
|
149
155
|
|
|
150
156
|
Default component styles can be changed by overriding the following CSS variables:
|
|
151
157
|
|
|
@@ -252,6 +258,15 @@ html body {
|
|
|
252
258
|
}
|
|
253
259
|
```
|
|
254
260
|
|
|
261
|
+
Depending on your installed blocks, you can also use the following variables to override default block styles:
|
|
262
|
+
|
|
263
|
+
```scss
|
|
264
|
+
html body {
|
|
265
|
+
// Error page
|
|
266
|
+
--w-error-page-type-color: var(--w-color-info);
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
255
270
|
### Using Components
|
|
256
271
|
|
|
257
272
|
Start using Webcore components in your code by importing them:
|
|
@@ -297,6 +312,8 @@ import { Accordion } from 'webcoreui/react'
|
|
|
297
312
|
- [Grid](https://github.com/Frontendland/webcoreui/tree/main/src/components/Grid)
|
|
298
313
|
- [Group](https://github.com/Frontendland/webcoreui/tree/main/src/components/Group)
|
|
299
314
|
- [Icon](https://github.com/Frontendland/webcoreui/tree/main/src/components/Icon)
|
|
315
|
+
- [Image](https://github.com/Frontendland/webcoreui/tree/main/src/components/Image)
|
|
316
|
+
- [ImageLoader](https://github.com/Frontendland/webcoreui/tree/main/src/components/ImageLoader)
|
|
300
317
|
- [Input](https://github.com/Frontendland/webcoreui/tree/main/src/components/Input)
|
|
301
318
|
- [Kbd](https://github.com/Frontendland/webcoreui/tree/main/src/components/Kbd)
|
|
302
319
|
- [List](https://github.com/Frontendland/webcoreui/tree/main/src/components/List)
|
package/astro.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ import type { FooterProps as WFooterProps } from './components/Footer/footer'
|
|
|
21
21
|
import type { GridProps as WGridProps } from './components/Grid/grid'
|
|
22
22
|
import type { GroupProps as WGroupProps } from './components/Group/group'
|
|
23
23
|
import type { IconProps as WIconProps } from './components/Icon/icon'
|
|
24
|
+
import type { ImageProps as WImageProps } from './components/Image/image'
|
|
25
|
+
import type { ImageLoaderProps as WImageLoaderProps } from './components/ImageLoader/imageloader'
|
|
24
26
|
import type { InputProps as WInputProps } from './components/Input/input'
|
|
25
27
|
import type { KbdProps as WKbdProps } from './components/Kbd/kbd'
|
|
26
28
|
import type { ListProps as WListProps } from './components/List/list'
|
|
@@ -83,6 +85,8 @@ declare module 'webcoreui/astro' {
|
|
|
83
85
|
export function Grid(_props: WGridProps): any
|
|
84
86
|
export function Group(_props: WGroupProps): any
|
|
85
87
|
export function Icon(_props: WIconProps): any
|
|
88
|
+
export function Image(_props: WImageProps): any
|
|
89
|
+
export function ImageLoader(_props: WImageLoaderProps): any
|
|
86
90
|
export function Input(_props: WInputProps): any
|
|
87
91
|
export function Kbd(_props: WKbdProps): any
|
|
88
92
|
export function List(_props: WListProps): any
|
|
@@ -138,6 +142,8 @@ declare module 'webcoreui/astro' {
|
|
|
138
142
|
export type GridProps = WGridProps
|
|
139
143
|
export type GroupProps = WGroupProps
|
|
140
144
|
export type IconProps = WIconProps
|
|
145
|
+
export type ImageProps = WImageProps
|
|
146
|
+
export type ImageLoaderProps = WImageLoaderProps
|
|
141
147
|
export type InputProps = WInputProps
|
|
142
148
|
export type KbdProps = WKbdProps
|
|
143
149
|
export type ListProps = WListProps
|
package/astro.js
CHANGED
|
@@ -21,6 +21,8 @@ import FooterComponent from './components/Footer/Footer.astro'
|
|
|
21
21
|
import GridComponent from './components/Grid/Grid.astro'
|
|
22
22
|
import GroupComponent from './components/Group/Group.astro'
|
|
23
23
|
import IconComponent from './components/Icon/Icon.astro'
|
|
24
|
+
import ImageComponent from './components/Image/Image.astro'
|
|
25
|
+
import ImageLoaderComponent from './components/ImageLoader/ImageLoader.astro'
|
|
24
26
|
import InputComponent from './components/Input/Input.astro'
|
|
25
27
|
import KbdComponent from './components/Kbd/Kbd.astro'
|
|
26
28
|
import ListComponent from './components/List/List.astro'
|
|
@@ -76,6 +78,8 @@ export const Footer = FooterComponent
|
|
|
76
78
|
export const Grid = GridComponent
|
|
77
79
|
export const Group = GroupComponent
|
|
78
80
|
export const Icon = IconComponent
|
|
81
|
+
export const Image = ImageComponent
|
|
82
|
+
export const ImageLoader = ImageLoaderComponent
|
|
79
83
|
export const Input = InputComponent
|
|
80
84
|
export const Kbd = KbdComponent
|
|
81
85
|
export const List = ListComponent
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
className
|
|
16
16
|
}: AccordionProps = $props()
|
|
17
17
|
|
|
18
|
-
let toggleState = $
|
|
18
|
+
let toggleState = $derived(items.map(item => item.expanded ?? false))
|
|
19
19
|
|
|
20
20
|
const toggle = (index: number) => {
|
|
21
21
|
toggleState = toggleState.map((_, i) => index === i
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const classes = classNames([
|
|
27
|
+
const classes = $derived(classNames([
|
|
28
28
|
styles.accordion,
|
|
29
29
|
reverse && styles.reverse,
|
|
30
30
|
icon === 'plus' && styles.plus,
|
|
31
31
|
className
|
|
32
|
-
])
|
|
32
|
+
]))
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<ul class={classes}>
|
|
@@ -14,7 +14,7 @@ const Accordion = ({
|
|
|
14
14
|
reverse,
|
|
15
15
|
className
|
|
16
16
|
}: AccordionProps) => {
|
|
17
|
-
const [state, setState] = useState(
|
|
17
|
+
const [state, setState] = useState(items.map(item => item.expanded ?? false))
|
|
18
18
|
|
|
19
19
|
const toggle = (index: number) => {
|
|
20
20
|
setState(state.map((_, i) => index === i
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
alert
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const hasCustomIcon = icon
|
|
33
|
+
const hasCustomIcon = $derived(icon)
|
|
34
34
|
|
|
35
|
-
const classes = [
|
|
35
|
+
const classes = $derived([
|
|
36
36
|
styles['w-alert'],
|
|
37
37
|
(!hasCustomIcon && !theme) && styles.col,
|
|
38
38
|
theme && styles[theme],
|
|
39
39
|
className
|
|
40
|
-
].filter(Boolean).join(' ')
|
|
40
|
+
].filter(Boolean).join(' '))
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<svelte:element this={element} class={classes} {...rest}>
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { SvelteAspectRatioProps } from './aspectratio'
|
|
3
|
-
|
|
4
|
-
import { classNames } from '../../utils/classNames'
|
|
5
|
-
|
|
6
|
-
import styles from './aspect-ratio.module.scss'
|
|
7
|
-
|
|
8
|
-
const {
|
|
9
|
-
ratio,
|
|
10
|
-
className,
|
|
11
|
-
children
|
|
12
|
-
}: SvelteAspectRatioProps = $props()
|
|
13
|
-
|
|
14
|
-
const classes = classNames([
|
|
15
|
-
styles.ratio,
|
|
16
|
-
className
|
|
17
|
-
])
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<div class={classes} style={`aspect-ratio: ${ratio.replace(':', '/')};`}>
|
|
21
|
-
{@render children?.()}
|
|
22
|
-
</div>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteAspectRatioProps } from './aspectratio'
|
|
3
|
+
|
|
4
|
+
import { classNames } from '../../utils/classNames'
|
|
5
|
+
|
|
6
|
+
import styles from './aspect-ratio.module.scss'
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
ratio,
|
|
10
|
+
className,
|
|
11
|
+
children
|
|
12
|
+
}: SvelteAspectRatioProps = $props()
|
|
13
|
+
|
|
14
|
+
const classes = $derived(classNames([
|
|
15
|
+
styles.ratio,
|
|
16
|
+
className
|
|
17
|
+
]))
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div class={classes} style={`aspect-ratio: ${ratio.replace(':', '/')};`}>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</div>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { AvatarProps } from './avatar'
|
|
3
3
|
|
|
4
|
+
import Image from '../Image/Image.astro'
|
|
5
|
+
|
|
4
6
|
import styles from './avatar.module.scss'
|
|
5
7
|
|
|
6
8
|
interface Props extends AvatarProps {}
|
|
@@ -35,7 +37,7 @@ const groupClasses = [
|
|
|
35
37
|
style={borderColor ? `--w-avatar-border: ${borderColor};` : null}
|
|
36
38
|
>
|
|
37
39
|
{img.map((img, index) => (
|
|
38
|
-
<
|
|
40
|
+
<Image
|
|
39
41
|
src={img}
|
|
40
42
|
alt={Array.isArray(alt) ? alt[index] : alt}
|
|
41
43
|
width={Array.isArray(size) ? size[index] : size}
|
|
@@ -47,7 +49,7 @@ const groupClasses = [
|
|
|
47
49
|
))}
|
|
48
50
|
</div>
|
|
49
51
|
) : (
|
|
50
|
-
<
|
|
52
|
+
<Image
|
|
51
53
|
src={img}
|
|
52
54
|
alt={Array.isArray(alt) ? alt[0] : alt}
|
|
53
55
|
width={Array.isArray(size) ? size[0] : size}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { AvatarProps } from './avatar'
|
|
3
3
|
|
|
4
|
+
import Image from '../Image/Image.svelte'
|
|
5
|
+
|
|
4
6
|
import { classNames } from '../../utils/classNames'
|
|
5
7
|
|
|
6
8
|
import styles from './avatar.module.scss'
|
|
@@ -17,17 +19,17 @@
|
|
|
17
19
|
groupClassName
|
|
18
20
|
}: AvatarProps = $props()
|
|
19
21
|
|
|
20
|
-
const classes = classNames([
|
|
22
|
+
const classes = $derived(classNames([
|
|
21
23
|
styles.avatar,
|
|
22
24
|
borderless && styles.borderless,
|
|
23
25
|
className
|
|
24
|
-
])
|
|
26
|
+
]))
|
|
25
27
|
|
|
26
|
-
const groupStyles = classNames([
|
|
28
|
+
const groupStyles = $derived(classNames([
|
|
27
29
|
styles.group,
|
|
28
30
|
reverse && styles.reverse,
|
|
29
31
|
groupClassName
|
|
30
|
-
])
|
|
32
|
+
]))
|
|
31
33
|
</script>
|
|
32
34
|
|
|
33
35
|
{#if Array.isArray(img)}
|
|
@@ -35,24 +37,24 @@
|
|
|
35
37
|
style={borderColor ? `--w-avatar-border: ${borderColor};` : null}
|
|
36
38
|
>
|
|
37
39
|
{#each img as img, index}
|
|
38
|
-
<
|
|
40
|
+
<Image
|
|
39
41
|
src={img}
|
|
40
42
|
alt={Array.isArray(alt) ? alt[index] : alt}
|
|
41
43
|
width={Array.isArray(size) ? size[index] : size}
|
|
42
44
|
height={Array.isArray(size) ? size[index] : size}
|
|
43
45
|
loading={lazy ? 'lazy' : null}
|
|
44
|
-
|
|
46
|
+
className={classes}
|
|
45
47
|
style={Array.isArray(size) ? `--w-avatar-index: ${size[index]}` : null}
|
|
46
48
|
/>
|
|
47
49
|
{/each}
|
|
48
50
|
</div>
|
|
49
51
|
{:else}
|
|
50
|
-
<
|
|
52
|
+
<Image
|
|
51
53
|
src={img}
|
|
52
54
|
alt={Array.isArray(alt) ? alt[0] : alt}
|
|
53
55
|
width={Array.isArray(size) ? size[0] : size}
|
|
54
56
|
height={Array.isArray(size) ? size[0] : size}
|
|
55
|
-
|
|
57
|
+
className={classes}
|
|
56
58
|
loading={lazy ? 'lazy' : null}
|
|
57
59
|
style={borderColor ? `--w-avatar-border: ${borderColor};` : null}
|
|
58
60
|
/>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import type { AvatarProps } from './avatar'
|
|
3
3
|
|
|
4
|
+
import Image from '../Image/Image.tsx'
|
|
5
|
+
|
|
4
6
|
import { classNames } from '../../utils/classNames'
|
|
5
7
|
|
|
6
8
|
import styles from './avatar.module.scss'
|
|
@@ -37,7 +39,7 @@ const Avatar = ({
|
|
|
37
39
|
style={borderColorStyle}
|
|
38
40
|
>
|
|
39
41
|
{img.map((img, index) => (
|
|
40
|
-
<
|
|
42
|
+
<Image
|
|
41
43
|
key={index}
|
|
42
44
|
src={img}
|
|
43
45
|
alt={Array.isArray(alt) ? alt[index] : alt}
|
|
@@ -53,7 +55,7 @@ const Avatar = ({
|
|
|
53
55
|
))}
|
|
54
56
|
</div>
|
|
55
57
|
) : (
|
|
56
|
-
<
|
|
58
|
+
<Image
|
|
57
59
|
src={img}
|
|
58
60
|
alt={Array.isArray(alt) ? alt[0] : alt}
|
|
59
61
|
width={Array.isArray(size) ? size[0] : size}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-avatar-border: var(--w-color-primary-70);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
.avatar {
|
|
4
|
+
--border: var(--w-avatar-border, var(--w-color-primary-70));
|
|
5
|
+
|
|
8
6
|
@include border-radius(max);
|
|
9
7
|
|
|
10
8
|
object-fit: cover;
|
|
11
9
|
|
|
12
10
|
&:not(.borderless) {
|
|
13
|
-
border: 3px solid var(--
|
|
11
|
+
border: 3px solid var(--border);
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
14
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
...rest
|
|
18
18
|
}: SvelteBadgeProps = $props()
|
|
19
19
|
|
|
20
|
-
const classes = classNames([
|
|
20
|
+
const classes = $derived(classNames([
|
|
21
21
|
styles.badge,
|
|
22
22
|
theme && styles[theme],
|
|
23
23
|
(onClick || hover) && styles.hover,
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
rounded && styles.round,
|
|
26
26
|
transparent && styles.transparent,
|
|
27
27
|
className
|
|
28
|
-
])
|
|
28
|
+
]))
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
{#if onClick}
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
&.outline:hover {
|
|
24
|
-
@include
|
|
25
|
-
@include background(transparent);
|
|
24
|
+
@include background(primary-60);
|
|
26
25
|
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary);
|
|
27
26
|
}
|
|
28
27
|
|
|
@@ -54,14 +53,14 @@
|
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
&.outline {
|
|
57
|
-
@include typography(primary
|
|
58
|
-
@include background(
|
|
59
|
-
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-
|
|
56
|
+
@include typography(primary);
|
|
57
|
+
@include background(transparent);
|
|
58
|
+
box-shadow: inset 0px 0px 0px 1px var(--w-color-primary-40);
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
&.flat {
|
|
63
62
|
@include typography(primary);
|
|
64
|
-
@include background(
|
|
63
|
+
@include background(transparent);
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
&.info {
|
|
@@ -19,17 +19,18 @@
|
|
|
19
19
|
children
|
|
20
20
|
}: SvelteBannerProps = $props()
|
|
21
21
|
|
|
22
|
-
const classes = classNames([
|
|
22
|
+
const classes = $derived(classNames([
|
|
23
23
|
styles.banner,
|
|
24
24
|
bottom && styles.bottom,
|
|
25
25
|
padded && styles.padded,
|
|
26
26
|
!sticky && styles.relative,
|
|
27
27
|
className
|
|
28
|
-
])
|
|
28
|
+
]))
|
|
29
29
|
|
|
30
|
-
const style = top
|
|
30
|
+
const style = $derived(top
|
|
31
31
|
? `--w-banner-top: ${top}px;`
|
|
32
32
|
: null
|
|
33
|
+
)
|
|
33
34
|
|
|
34
35
|
let visible = $state(true)
|
|
35
36
|
</script>
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
@use '../../scss/config.scss' as *;
|
|
2
2
|
|
|
3
|
-
body {
|
|
4
|
-
--w-banner-top: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
3
|
.banner {
|
|
4
|
+
--top: var(--w-banner-top, 0);
|
|
5
|
+
|
|
8
6
|
@include background(primary-60);
|
|
9
7
|
@include spacing(p-default);
|
|
10
8
|
@include position(sticky);
|
|
11
9
|
@include layer(top);
|
|
12
10
|
@include typography(center);
|
|
13
11
|
|
|
14
|
-
top: var(--
|
|
12
|
+
top: var(--top);
|
|
15
13
|
|
|
16
14
|
&.padded {
|
|
17
15
|
@include border-radius();
|
|
18
16
|
@include position(l20px);
|
|
19
17
|
|
|
20
18
|
width: calc(100% - 40px);
|
|
21
|
-
top: calc(var(--
|
|
19
|
+
top: calc(var(--top) + 20px);
|
|
22
20
|
|
|
23
21
|
&.bottom {
|
|
24
22
|
@include position(l20px, b20px);
|
|
@@ -13,17 +13,18 @@
|
|
|
13
13
|
className
|
|
14
14
|
}: BottomNavigationProps = $props()
|
|
15
15
|
|
|
16
|
-
const classes = classNames([
|
|
16
|
+
const classes = $derived(classNames([
|
|
17
17
|
styles.nav,
|
|
18
18
|
separated && styles.separated,
|
|
19
19
|
maxWidth && styles.bordered,
|
|
20
20
|
floating && styles.floating,
|
|
21
21
|
className
|
|
22
|
-
])
|
|
22
|
+
]))
|
|
23
23
|
|
|
24
|
-
const styleVariable = maxWidth
|
|
24
|
+
const styleVariable = $derived(maxWidth
|
|
25
25
|
? `--w-bottom-navigation-max-width: ${maxWidth};`
|
|
26
26
|
: null
|
|
27
|
+
)
|
|
27
28
|
</script>
|
|
28
29
|
|
|
29
30
|
<nav class={classes} style={styleVariable}>
|
|
@@ -1,70 +1,68 @@
|
|
|
1
|
-
@use '../../scss/config.scss' as *;
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
--w-bottom-navigation-max-width
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
@include
|
|
9
|
-
@include
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
@include
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
@include
|
|
56
|
-
@include
|
|
57
|
-
@include
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
@use '../../scss/config.scss' as *;
|
|
2
|
+
|
|
3
|
+
.nav {
|
|
4
|
+
--width: var(--w-bottom-navigation-max-width, auto);
|
|
5
|
+
|
|
6
|
+
@include background(primary-60);
|
|
7
|
+
@include position(fixed, b0, l0, r0);
|
|
8
|
+
@include layer(header);
|
|
9
|
+
@include border(top, primary-50);
|
|
10
|
+
|
|
11
|
+
&.separated ul li:not(:last-child) {
|
|
12
|
+
@include border(right, primary-50);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.separated.bordered ul {
|
|
16
|
+
@include border(left, primary-50);
|
|
17
|
+
@include border(right, primary-50);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.floating {
|
|
21
|
+
@include position(l20px, r20px, b20px);
|
|
22
|
+
@include border-radius(xl);
|
|
23
|
+
@include border(0);
|
|
24
|
+
|
|
25
|
+
&:not(.bordered) {
|
|
26
|
+
li:first-child .item {
|
|
27
|
+
@include border-radius(xl, left);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
li:last-child .item {
|
|
31
|
+
@include border-radius(xl, right);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
ul {
|
|
37
|
+
@include spacing(none-auto, p0);
|
|
38
|
+
@include layout(flex, h-center);
|
|
39
|
+
|
|
40
|
+
max-width: var(--width);
|
|
41
|
+
list-style-type: none;
|
|
42
|
+
|
|
43
|
+
li {
|
|
44
|
+
@include spacing(mb-0);
|
|
45
|
+
|
|
46
|
+
flex: 1;
|
|
47
|
+
|
|
48
|
+
&.with-icon .item {
|
|
49
|
+
@include spacing(pt-sm, pb-xs);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.item {
|
|
53
|
+
@include layout(flex, column, center, xs);
|
|
54
|
+
@include spacing(py-sm);
|
|
55
|
+
@include size('h100%');
|
|
56
|
+
@include transition(background);
|
|
57
|
+
@include typography(md, primary-10, none);
|
|
58
|
+
|
|
59
|
+
user-select: none;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
@include background(primary-50);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|