webcoreui 0.8.1 → 0.10.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 +36 -6
- package/astro.d.ts +23 -0
- package/astro.js +8 -0
- package/components/Accordion/Accordion.astro +15 -10
- package/components/Accordion/Accordion.svelte +14 -12
- package/components/Accordion/Accordion.tsx +2 -2
- package/components/Accordion/accordion.module.scss +1 -0
- package/components/Alert/Alert.svelte +17 -12
- package/components/Alert/Alert.tsx +1 -1
- package/components/Alert/alert.ts +10 -3
- package/components/AspectRatio/AspectRatio.svelte +7 -4
- package/components/AspectRatio/aspectratio.ts +6 -0
- package/components/Avatar/Avatar.svelte +11 -9
- package/components/Badge/Badge.svelte +14 -10
- package/components/Badge/badge.ts +3 -2
- package/components/Banner/Banner.astro +10 -4
- package/components/Banner/Banner.svelte +14 -10
- package/components/Banner/Banner.tsx +1 -0
- package/components/Banner/banner.ts +6 -0
- package/components/BottomNavigation/BottomNavigation.astro +51 -0
- package/components/BottomNavigation/BottomNavigation.svelte +47 -0
- package/components/BottomNavigation/BottomNavigation.tsx +63 -0
- package/components/BottomNavigation/bottomnavigation.module.scss +70 -0
- package/components/BottomNavigation/bottomnavigation.ts +16 -0
- package/components/Breadcrumb/Breadcrumb.astro +1 -1
- package/components/Breadcrumb/Breadcrumb.svelte +8 -6
- package/components/Breadcrumb/Breadcrumb.tsx +2 -2
- package/components/Button/Button.svelte +12 -8
- package/components/Button/Button.tsx +2 -2
- package/components/Button/button.ts +2 -3
- package/components/Card/Card.svelte +14 -10
- package/components/Card/card.module.scss +1 -0
- package/components/Card/card.ts +6 -0
- package/components/Carousel/Carousel.astro +46 -41
- package/components/Carousel/carousel.ts +3 -0
- package/components/Checkbox/Checkbox.astro +8 -2
- package/components/Checkbox/Checkbox.svelte +12 -8
- package/components/Checkbox/Checkbox.tsx +3 -1
- package/components/Checkbox/checkbox.module.scss +4 -0
- package/components/Checkbox/checkbox.ts +1 -0
- package/components/Collapsible/Collapsible.astro +8 -5
- package/components/Collapsible/Collapsible.svelte +54 -49
- package/components/Collapsible/collapsible.ts +8 -0
- package/components/ConditionalWrapper/ConditionalWrapper.svelte +10 -6
- package/components/ConditionalWrapper/conditionalwrapper.ts +6 -0
- package/components/Copy/Copy.astro +80 -0
- package/components/Copy/Copy.svelte +68 -0
- package/components/Copy/Copy.tsx +74 -0
- package/components/Copy/copy.module.scss +37 -0
- package/components/Copy/copy.ts +20 -0
- package/components/DataTable/DataTable.astro +103 -93
- package/components/DataTable/DataTable.svelte +276 -272
- package/components/DataTable/datatable.ts +5 -2
- package/components/Flex/Flex.astro +34 -0
- package/components/Flex/Flex.svelte +31 -0
- package/components/Flex/Flex.tsx +30 -0
- package/components/Flex/flex.ts +28 -0
- package/components/Footer/Footer.svelte +12 -9
- package/components/Footer/footer.ts +6 -0
- package/components/Grid/Grid.astro +32 -0
- package/components/Grid/Grid.svelte +29 -0
- package/components/Grid/Grid.tsx +28 -0
- package/components/Grid/grid.ts +24 -0
- package/components/Group/Group.svelte +7 -4
- package/components/Group/group.ts +6 -0
- package/components/Icon/Icon.astro +19 -5
- package/components/Icon/Icon.svelte +23 -7
- package/components/Icon/Icon.tsx +19 -5
- package/components/Icon/icon.ts +10 -3
- package/components/Icon/map.ts +10 -10
- package/components/Input/Input.astro +1 -1
- package/components/Input/Input.svelte +26 -20
- package/components/Input/Input.tsx +4 -1
- package/components/Input/input.ts +10 -3
- package/components/Kbd/Kbd.svelte +7 -4
- package/components/Kbd/kbd.ts +6 -0
- package/components/List/List.astro +65 -60
- package/components/List/List.svelte +149 -147
- package/components/List/List.tsx +1 -1
- package/components/List/list.module.scss +3 -0
- package/components/Masonry/Masonry.svelte +12 -10
- package/components/Menu/Menu.astro +8 -3
- package/components/Menu/Menu.svelte +19 -10
- package/components/Menu/Menu.tsx +3 -1
- package/components/Menu/menu.ts +6 -0
- package/components/Modal/Modal.astro +1 -0
- package/components/Modal/Modal.svelte +18 -13
- package/components/Modal/Modal.tsx +2 -1
- package/components/Modal/modal.ts +6 -1
- package/components/Pagination/Pagination.astro +75 -69
- package/components/Pagination/Pagination.svelte +30 -26
- package/components/Pagination/Pagination.tsx +5 -4
- package/components/Pagination/pagination.module.scss +4 -0
- package/components/Popover/Popover.svelte +10 -6
- package/components/Popover/popover.ts +6 -0
- package/components/Progress/Progress.svelte +12 -10
- package/components/Progress/progress.ts +1 -1
- package/components/Radio/Radio.astro +3 -1
- package/components/Radio/Radio.svelte +14 -10
- package/components/Radio/Radio.tsx +5 -3
- package/components/Radio/radio.ts +5 -2
- package/components/Rating/Rating.svelte +16 -14
- package/components/Ribbon/Ribbon.svelte +9 -6
- package/components/Ribbon/ribbon.ts +6 -0
- package/components/Select/Select.astro +85 -42
- package/components/Select/Select.svelte +62 -21
- package/components/Select/Select.tsx +41 -7
- package/components/Select/select.ts +4 -1
- package/components/Sheet/Sheet.svelte +9 -5
- package/components/Sheet/sheet.ts +6 -2
- package/components/Sidebar/Sidebar.svelte +7 -4
- package/components/Sidebar/sidebar.ts +6 -0
- package/components/Skeleton/Skeleton.astro +2 -2
- package/components/Skeleton/Skeleton.svelte +11 -9
- package/components/Skeleton/Skeleton.tsx +2 -2
- package/components/Slider/Slider.svelte +15 -13
- package/components/Slider/slider.module.scss +4 -0
- package/components/Slider/slider.ts +4 -2
- package/components/Spinner/Spinner.svelte +7 -5
- package/components/Spoiler/Spoiler.astro +13 -8
- package/components/Spoiler/Spoiler.svelte +13 -10
- package/components/Spoiler/spoiler.ts +6 -0
- package/components/Stepper/Stepper.svelte +9 -7
- package/components/Switch/Switch.astro +3 -2
- package/components/Switch/Switch.svelte +15 -11
- package/components/Switch/Switch.tsx +3 -1
- package/components/Switch/switch.ts +1 -0
- package/components/Table/Table.svelte +11 -9
- package/components/Table/table.ts +1 -1
- package/components/Tabs/Tabs.astro +8 -5
- package/components/Tabs/Tabs.svelte +14 -11
- package/components/Tabs/tabs.ts +7 -1
- package/components/Textarea/Textarea.astro +3 -1
- package/components/Textarea/Textarea.svelte +51 -47
- package/components/Textarea/textarea.ts +24 -18
- package/components/ThemeSwitcher/ThemeSwitcher.astro +43 -37
- package/components/ThemeSwitcher/ThemeSwitcher.svelte +14 -10
- package/components/ThemeSwitcher/themeswitcher.ts +7 -0
- package/components/Timeline/Timeline.svelte +12 -9
- package/components/Timeline/timeline.ts +7 -2
- package/components/TimelineItem/TimelineItem.svelte +8 -5
- package/components/TimelineItem/timelineitem.ts +6 -0
- package/components/Toast/Toast.svelte +18 -10
- package/components/Toast/toast.ts +6 -1
- package/icons/alert.svg +2 -2
- package/icons/check.svg +2 -2
- package/icons/chevron-down.svg +3 -0
- package/icons/chevron-left.svg +3 -0
- package/icons/chevron-right.svg +3 -0
- package/icons/chevron-up.svg +3 -0
- package/icons/circle-check.svg +3 -3
- package/icons/copy.svg +3 -0
- package/icons/info.svg +3 -3
- package/icons.d.ts +5 -5
- package/icons.js +5 -5
- package/index.d.ts +75 -2
- package/index.js +2 -0
- package/package.json +31 -22
- package/react.d.ts +23 -0
- package/react.js +8 -0
- package/scss/global/utility.scss +48 -3
- package/svelte.d.ts +111 -88
- package/svelte.js +8 -0
- package/utils/DOMUtils.ts +2 -2
- package/utils/bodyFreeze.ts +13 -0
- package/utils/classNames.ts +1 -1
- package/utils/getLayoutClasses.ts +141 -0
- package/utils/modal.ts +16 -4
- package/utils/popover.ts +30 -4
- package/icons/arrow-down.svg +0 -3
- package/icons/arrow-left.svg +0 -3
- package/icons/arrow-right.svg +0 -3
- package/icons/components.svg +0 -3
- package/icons/file.svg +0 -3
- package/scss/webcore.config.scss +0 -0
package/README.md
CHANGED
|
@@ -20,6 +20,18 @@
|
|
|
20
20
|
alt="License"
|
|
21
21
|
/>
|
|
22
22
|
</a>
|
|
23
|
+
<a href="https://github.com/Frontendland/webcoreui/actions">
|
|
24
|
+
<img
|
|
25
|
+
src="https://img.shields.io/github/actions/workflow/status/Frontendland/webcoreui/checks.yml"
|
|
26
|
+
alt="Build"
|
|
27
|
+
/>
|
|
28
|
+
</a>
|
|
29
|
+
<a href="https://www.npmjs.com/package/webcoreui">
|
|
30
|
+
<img
|
|
31
|
+
src="https://img.shields.io/npm/d18m/webcoreui.svg?color=black"
|
|
32
|
+
alt="NPM"
|
|
33
|
+
/>
|
|
34
|
+
</a>
|
|
23
35
|
</p>
|
|
24
36
|
|
|
25
37
|
> [!IMPORTANT]
|
|
@@ -52,18 +64,18 @@ Webcore can be used as a standalone project, or it can be integrated into your e
|
|
|
52
64
|
|
|
53
65
|
Webcore components use Sass for styling. To use the component library, you must have the following packages installed:
|
|
54
66
|
|
|
55
|
-
- [Sass](https://www.npmjs.com/package/sass) - `v1.
|
|
56
|
-
- [TypeScript](https://www.npmjs.com/package/typescript) - `v5.
|
|
67
|
+
- [Sass](https://www.npmjs.com/package/sass) - `v1.83`
|
|
68
|
+
- [TypeScript](https://www.npmjs.com/package/typescript) - `v5.7`
|
|
57
69
|
|
|
58
70
|
Depending on your project setup, you'll also need the following packages:
|
|
59
71
|
|
|
60
72
|
- **For Astro projects**
|
|
61
|
-
- [Astro](https://www.npmjs.com/package/astro) - `
|
|
73
|
+
- [Astro](https://www.npmjs.com/package/astro) - `v5.1`
|
|
62
74
|
- **For Svelte projects**
|
|
63
|
-
- [Svelte](https://www.npmjs.com/package/svelte) - `
|
|
75
|
+
- [Svelte](https://www.npmjs.com/package/svelte) - `v5.19`
|
|
64
76
|
- **For React projects**
|
|
65
|
-
- [React](https://www.npmjs.com/package/react) - `
|
|
66
|
-
- [React DOM](https://www.npmjs.com/package/react-dom) -`
|
|
77
|
+
- [React](https://www.npmjs.com/package/react) - `v19.0`
|
|
78
|
+
- [React DOM](https://www.npmjs.com/package/react-dom) -`v19.0`
|
|
67
79
|
|
|
68
80
|
### Installation
|
|
69
81
|
|
|
@@ -113,6 +125,9 @@ html body {
|
|
|
113
125
|
// Banner component
|
|
114
126
|
--w-banner-top: 0;
|
|
115
127
|
|
|
128
|
+
// BottomNavigation component
|
|
129
|
+
--w-bottom-navigation-max-width: auto;
|
|
130
|
+
|
|
116
131
|
// Checkbox component
|
|
117
132
|
--w-checkbox-color: var(--w-color-primary);
|
|
118
133
|
|
|
@@ -222,6 +237,7 @@ import { Accordion } from 'webcoreui/react'
|
|
|
222
237
|
- [Avatar](https://github.com/Frontendland/webcoreui/tree/main/src/components/Avatar)
|
|
223
238
|
- [Badge](https://github.com/Frontendland/webcoreui/tree/main/src/components/Badge)
|
|
224
239
|
- [Banner](https://github.com/Frontendland/webcoreui/tree/main/src/components/Banner)
|
|
240
|
+
- [BottomNavigation](https://github.com/Frontendland/webcoreui/tree/main/src/components/BottomNavigation)
|
|
225
241
|
- [Breadcrumb](https://github.com/Frontendland/webcoreui/tree/main/src/components/Breadcrumb)
|
|
226
242
|
- [Button](https://github.com/Frontendland/webcoreui/tree/main/src/components/Button)
|
|
227
243
|
- [Card](https://github.com/Frontendland/webcoreui/tree/main/src/components/Card)
|
|
@@ -229,8 +245,11 @@ import { Accordion } from 'webcoreui/react'
|
|
|
229
245
|
- [Checkbox](https://github.com/Frontendland/webcoreui/tree/main/src/components/Checkbox)
|
|
230
246
|
- [Collapsible](https://github.com/Frontendland/webcoreui/tree/main/src/components/Collapsible)
|
|
231
247
|
- [ConditionalWrapper](https://github.com/Frontendland/webcoreui/tree/main/src/components/ConditionalWrapper)
|
|
248
|
+
- [Copy](https://github.com/Frontendland/webcoreui/tree/main/src/components/Copy)
|
|
232
249
|
- [DataTable](https://github.com/Frontendland/webcoreui/tree/main/src/components/DataTable)
|
|
250
|
+
- [Flex](https://github.com/Frontendland/webcoreui/tree/main/src/components/Flex)
|
|
233
251
|
- [Footer](https://github.com/Frontendland/webcoreui/tree/main/src/components/Footer)
|
|
252
|
+
- [Grid](https://github.com/Frontendland/webcoreui/tree/main/src/components/Grid)
|
|
234
253
|
- [Group](https://github.com/Frontendland/webcoreui/tree/main/src/components/Group)
|
|
235
254
|
- [Icon](https://github.com/Frontendland/webcoreui/tree/main/src/components/Icon)
|
|
236
255
|
- [Input](https://github.com/Frontendland/webcoreui/tree/main/src/components/Input)
|
|
@@ -265,12 +284,23 @@ import { Accordion } from 'webcoreui/react'
|
|
|
265
284
|
## Blocks
|
|
266
285
|
|
|
267
286
|
- [BlogCard](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/BlogCard)
|
|
287
|
+
- [ComponentMap](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/ComponentMap)
|
|
288
|
+
- [DeviceMockup](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/DeviceMockup)
|
|
268
289
|
- [ErrorPage](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/ErrorPage)
|
|
269
290
|
- [FAQ](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/FAQ)
|
|
291
|
+
- [GridWithIcons](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/GridWithIcons)
|
|
270
292
|
- [Hero](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/Hero)
|
|
293
|
+
- [Icon](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/Icon)
|
|
271
294
|
- [IconList](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/IconList)
|
|
295
|
+
- [Layout](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/Layout)
|
|
296
|
+
- [SEO](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/SEO)
|
|
272
297
|
- [SettingCard](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/SettingCard)
|
|
273
298
|
- [SignUp](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/SignUp)
|
|
274
299
|
- [SocialProof](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/SocialProof)
|
|
275
300
|
- [Tiles](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/Tiles)
|
|
276
301
|
- [User](https://github.com/Frontendland/webcoreui/tree/main/src/blocks/User)
|
|
302
|
+
|
|
303
|
+
## Templates
|
|
304
|
+
|
|
305
|
+
- [Portfolio](https://github.com/Frontendland/webcoreui/tree/main/src/templates/Portfolio)
|
|
306
|
+
- [ProductPage](https://github.com/Frontendland/webcoreui/tree/main/src/templates/ProductPage)
|
package/astro.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { AspectRatioProps as WAspectRatioProps } from './components/AspectR
|
|
|
4
4
|
import type { AvatarProps as WAvatarProps } from './components/Avatar/avatar'
|
|
5
5
|
import type { BadgeProps as WBadgeProps } from './components/Badge/badge'
|
|
6
6
|
import type { BannerProps as WBannerProps } from './components/Banner/banner'
|
|
7
|
+
import type { BottomNavigationProps as WBottomNavigationProps } from './components/BottomNavigation/bottomnavigation'
|
|
7
8
|
import type { BreadcrumbProps as WBreadcrumbProps } from './components/Breadcrumb/breadcrumb'
|
|
8
9
|
import type { ButtonProps as WButtonProps } from './components/Button/button'
|
|
9
10
|
import type { CardProps as WCardProps } from './components/Card/card'
|
|
@@ -11,8 +12,11 @@ import type { CarouselProps as WCarouselProps } from './components/Carousel/caro
|
|
|
11
12
|
import type { CheckboxProps as WCheckboxProps } from './components/Checkbox/checkbox'
|
|
12
13
|
import type { CollapsibleProps as WCollapsibleProps } from './components/Collapsible/collapsible'
|
|
13
14
|
import type { ConditionalWrapperProps as WConditionalWrapperProps } from './components/ConditionalWrapper/conditionalwrapper'
|
|
15
|
+
import type { CopyProps as WCopyProps } from './components/Copy/copy'
|
|
14
16
|
import type { DataTableProps as WDataTableProps } from './components/DataTable/datatable'
|
|
17
|
+
import type { FlexProps as WFlexProps } from './components/Flex/flex'
|
|
15
18
|
import type { FooterProps as WFooterProps } from './components/Footer/footer'
|
|
19
|
+
import type { GridProps as WGridProps } from './components/Grid/grid'
|
|
16
20
|
import type { GroupProps as WGroupProps } from './components/Group/group'
|
|
17
21
|
import type { IconProps as WIconProps } from './components/Icon/icon'
|
|
18
22
|
import type { InputProps as WInputProps } from './components/Input/input'
|
|
@@ -44,6 +48,11 @@ import type { TimelineProps as WTimelineProps } from './components/Timeline/time
|
|
|
44
48
|
import type { TimelineItemProps as WTimelineItemProps } from './components/TimelineItem/timelineitem'
|
|
45
49
|
import type { ToastProps as WToastProps } from './components/Toast/toast'
|
|
46
50
|
|
|
51
|
+
import type { DataTableEventType as WDataTableEventType, HeadingObject as WHeadingObject } from './components/DataTable/datatable.ts'
|
|
52
|
+
import type { ListEventType as WListEventType } from './components/List/list.ts'
|
|
53
|
+
import type { PaginationEventType as WPaginationEventType } from './components/Pagination/pagination.ts'
|
|
54
|
+
import type { SelectEventType as WSelectEventType } from './components/Select/select.ts'
|
|
55
|
+
|
|
47
56
|
declare module 'webcoreui/astro' {
|
|
48
57
|
export function Accordion(_props: WAccordionProps): any
|
|
49
58
|
export function Alert(_props: WAlertProps): any
|
|
@@ -51,6 +60,7 @@ declare module 'webcoreui/astro' {
|
|
|
51
60
|
export function Avatar(_props: WAvatarProps): any
|
|
52
61
|
export function Badge(_props: WBadgeProps): any
|
|
53
62
|
export function Banner(_props: WBannerProps): any
|
|
63
|
+
export function BottomNavigation(_props: WBottomNavigationProps): any
|
|
54
64
|
export function Breadcrumb(_props: WBreadcrumbProps): any
|
|
55
65
|
export function Button(_props: WButtonProps): any
|
|
56
66
|
export function Card(_props: WCardProps): any
|
|
@@ -58,8 +68,11 @@ declare module 'webcoreui/astro' {
|
|
|
58
68
|
export function Checkbox(_props: WCheckboxProps): any
|
|
59
69
|
export function Collapsible(_props: WCollapsibleProps): any
|
|
60
70
|
export function ConditionalWrapper(_props: WConditionalWrapperProps): any
|
|
71
|
+
export function Copy(_props: WCopyProps): any
|
|
61
72
|
export function DataTable(_props: WDataTableProps): any
|
|
73
|
+
export function Flex(_props: WFlexProps): any
|
|
62
74
|
export function Footer(_props: WFooterProps): any
|
|
75
|
+
export function Grid(_props: WGridProps): any
|
|
63
76
|
export function Group(_props: WGroupProps): any
|
|
64
77
|
export function Icon(_props: WIconProps): any
|
|
65
78
|
export function Input(_props: WInputProps): any
|
|
@@ -97,6 +110,7 @@ declare module 'webcoreui/astro' {
|
|
|
97
110
|
export type AvatarProps = WAvatarProps
|
|
98
111
|
export type BadgeProps = WBadgeProps
|
|
99
112
|
export type BannerProps = WBannerProps
|
|
113
|
+
export type BottomNavigationProps = WBottomNavigationProps
|
|
100
114
|
export type BreadcrumbProps = WBreadcrumbProps
|
|
101
115
|
export type ButtonProps = WButtonProps
|
|
102
116
|
export type CardProps = WCardProps
|
|
@@ -104,8 +118,11 @@ declare module 'webcoreui/astro' {
|
|
|
104
118
|
export type CheckboxProps = WCheckboxProps
|
|
105
119
|
export type CollapsibleProps = WCollapsibleProps
|
|
106
120
|
export type ConditionalWrapperProps = WConditionalWrapperProps
|
|
121
|
+
export type CopyProps = WCopyProps
|
|
107
122
|
export type DataTableProps = WDataTableProps
|
|
123
|
+
export type FlexProps = WFlexProps
|
|
108
124
|
export type FooterProps = WFooterProps
|
|
125
|
+
export type GridProps = WGridProps
|
|
109
126
|
export type GroupProps = WGroupProps
|
|
110
127
|
export type IconProps = WIconProps
|
|
111
128
|
export type InputProps = WInputProps
|
|
@@ -136,4 +153,10 @@ declare module 'webcoreui/astro' {
|
|
|
136
153
|
export type TimelineProps = WTimelineProps
|
|
137
154
|
export type TimelineItemProps = WTimelineItemProps
|
|
138
155
|
export type ToastProps = WToastProps
|
|
156
|
+
|
|
157
|
+
export type DataTableEventType = WDataTableEventType
|
|
158
|
+
export type HeadingObject = WHeadingObject
|
|
159
|
+
export type ListEventType = WListEventType
|
|
160
|
+
export type PaginationEventType = WPaginationEventType
|
|
161
|
+
export type SelectEventType = WSelectEventType
|
|
139
162
|
}
|
package/astro.js
CHANGED
|
@@ -4,6 +4,7 @@ import AspectRatioComponent from './components/AspectRatio/AspectRatio.astro'
|
|
|
4
4
|
import AvatarComponent from './components/Avatar/Avatar.astro'
|
|
5
5
|
import BadgeComponent from './components/Badge/Badge.astro'
|
|
6
6
|
import BannerComponent from './components/Banner/Banner.astro'
|
|
7
|
+
import BottomNavigationComponent from './components/BottomNavigation/BottomNavigation.astro'
|
|
7
8
|
import BreadcrumbComponent from './components/Breadcrumb/Breadcrumb.astro'
|
|
8
9
|
import ButtonComponent from './components/Button/Button.astro'
|
|
9
10
|
import CardComponent from './components/Card/Card.astro'
|
|
@@ -11,8 +12,11 @@ import CarouselComponent from './components/Carousel/Carousel.astro'
|
|
|
11
12
|
import CheckboxComponent from './components/Checkbox/Checkbox.astro'
|
|
12
13
|
import CollapsibleComponent from './components/Collapsible/Collapsible.astro'
|
|
13
14
|
import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.astro'
|
|
15
|
+
import CopyComponent from './components/Copy/Copy.astro'
|
|
14
16
|
import DataTableComponent from './components/DataTable/DataTable.astro'
|
|
17
|
+
import FlexComponent from './components/Flex/Flex.astro'
|
|
15
18
|
import FooterComponent from './components/Footer/Footer.astro'
|
|
19
|
+
import GridComponent from './components/Grid/Grid.astro'
|
|
16
20
|
import GroupComponent from './components/Group/Group.astro'
|
|
17
21
|
import IconComponent from './components/Icon/Icon.astro'
|
|
18
22
|
import InputComponent from './components/Input/Input.astro'
|
|
@@ -50,6 +54,7 @@ export const AspectRatio = AspectRatioComponent
|
|
|
50
54
|
export const Avatar = AvatarComponent
|
|
51
55
|
export const Badge = BadgeComponent
|
|
52
56
|
export const Banner = BannerComponent
|
|
57
|
+
export const BottomNavigation = BottomNavigationComponent
|
|
53
58
|
export const Breadcrumb = BreadcrumbComponent
|
|
54
59
|
export const Button = ButtonComponent
|
|
55
60
|
export const Card = CardComponent
|
|
@@ -57,8 +62,11 @@ export const Carousel = CarouselComponent
|
|
|
57
62
|
export const Checkbox = CheckboxComponent
|
|
58
63
|
export const Collapsible = CollapsibleComponent
|
|
59
64
|
export const ConditionalWrapper = ConditionalWrapperComponent
|
|
65
|
+
export const Copy = CopyComponent
|
|
60
66
|
export const DataTable = DataTableComponent
|
|
67
|
+
export const Flex = FlexComponent
|
|
61
68
|
export const Footer = FooterComponent
|
|
69
|
+
export const Grid = GridComponent
|
|
62
70
|
export const Group = GroupComponent
|
|
63
71
|
export const Icon = IconComponent
|
|
64
72
|
export const Input = InputComponent
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { AccordionProps } from './accordion'
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import ChevronDown from '../../icons/chevron-down.svg?raw'
|
|
5
5
|
import Plus from '../../icons/plus.svg?raw'
|
|
6
6
|
|
|
7
7
|
import styles from './accordion.module.scss'
|
|
@@ -32,7 +32,7 @@ const classes = [
|
|
|
32
32
|
>
|
|
33
33
|
{item.title}
|
|
34
34
|
{icon !== 'none' && (
|
|
35
|
-
<Fragment set:html={icon === 'plus' ? Plus :
|
|
35
|
+
<Fragment set:html={icon === 'plus' ? Plus : ChevronDown} />
|
|
36
36
|
)}
|
|
37
37
|
</button>
|
|
38
38
|
<div class={styles.wrapper}>
|
|
@@ -45,13 +45,18 @@ const classes = [
|
|
|
45
45
|
<script>
|
|
46
46
|
import { on } from '../../utils/DOMUtils'
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const addEventListeners = () => {
|
|
49
|
+
on('[data-id="w-accordion"]', 'click', (event: Event) => {
|
|
50
|
+
const target = event.target as HTMLDivElement
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
if (target.dataset.toggle) {
|
|
53
|
+
target.dataset.open = target.dataset.open === 'true'
|
|
54
|
+
? 'false'
|
|
55
|
+
: 'true'
|
|
56
|
+
}
|
|
57
|
+
}, true)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
on(document, 'astro:after-swap', addEventListeners)
|
|
61
|
+
addEventListeners()
|
|
57
62
|
</script>
|
|
@@ -3,22 +3,24 @@
|
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import ChevronDown from '../../icons/chevron-down.svg?raw'
|
|
7
7
|
import Plus from '../../icons/plus.svg?raw'
|
|
8
8
|
|
|
9
9
|
import styles from './accordion.module.scss'
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const {
|
|
12
|
+
items,
|
|
13
|
+
icon,
|
|
14
|
+
reverse,
|
|
15
|
+
className
|
|
16
|
+
}: AccordionProps = $props()
|
|
15
17
|
|
|
16
|
-
let
|
|
18
|
+
let toggleState = $state(Array(items.length).fill(false))
|
|
17
19
|
|
|
18
20
|
const toggle = (index: number) => {
|
|
19
|
-
|
|
20
|
-
? !
|
|
21
|
-
:
|
|
21
|
+
toggleState = toggleState.map((_, i) => index === i
|
|
22
|
+
? !toggleState[i]
|
|
23
|
+
: toggleState[i]
|
|
22
24
|
)
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -38,12 +40,12 @@
|
|
|
38
40
|
styles.title,
|
|
39
41
|
item.reverse && styles.reverse
|
|
40
42
|
])}
|
|
41
|
-
data-open={
|
|
42
|
-
|
|
43
|
+
data-open={toggleState[index]}
|
|
44
|
+
onclick={() => toggle(index)}
|
|
43
45
|
>
|
|
44
46
|
{item.title}
|
|
45
47
|
{#if icon !== 'none'}
|
|
46
|
-
{@html icon === 'plus' ? Plus :
|
|
48
|
+
{@html icon === 'plus' ? Plus : ChevronDown}
|
|
47
49
|
{/if}
|
|
48
50
|
</button>
|
|
49
51
|
<div class={styles.wrapper}>
|
|
@@ -3,7 +3,7 @@ import type { AccordionProps } from './accordion'
|
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import ChevronDown from '../../icons/chevron-down.svg?raw'
|
|
7
7
|
import Plus from '../../icons/plus.svg?raw'
|
|
8
8
|
|
|
9
9
|
import styles from './accordion.module.scss'
|
|
@@ -43,7 +43,7 @@ const Accordion = ({
|
|
|
43
43
|
])}
|
|
44
44
|
dangerouslySetInnerHTML={{ __html: icon === 'none'
|
|
45
45
|
? item.title
|
|
46
|
-
: `${item.title} ${icon === 'plus' ? Plus :
|
|
46
|
+
: `${item.title} ${icon === 'plus' ? Plus : ChevronDown}`
|
|
47
47
|
}}
|
|
48
48
|
/>
|
|
49
49
|
<div className={styles.wrapper}>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { SvelteAlertProps } from './alert'
|
|
3
3
|
|
|
4
4
|
import ConditionalWrapper from '../ConditionalWrapper/ConditionalWrapper.svelte'
|
|
5
5
|
|
|
@@ -10,13 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
import styles from './alert.module.scss'
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
const {
|
|
14
|
+
element = 'section',
|
|
15
|
+
title,
|
|
16
|
+
titleTag = 'strong',
|
|
17
|
+
titleProps,
|
|
18
|
+
bodyProps,
|
|
19
|
+
className,
|
|
20
|
+
theme,
|
|
21
|
+
icon,
|
|
22
|
+
children,
|
|
23
|
+
...rest
|
|
24
|
+
}: SvelteAlertProps = $props()
|
|
20
25
|
|
|
21
26
|
const iconMap = {
|
|
22
27
|
info,
|
|
@@ -25,7 +30,7 @@
|
|
|
25
30
|
alert
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
const hasCustomIcon =
|
|
33
|
+
const hasCustomIcon = icon
|
|
29
34
|
|
|
30
35
|
const classes = [
|
|
31
36
|
styles['w-alert'],
|
|
@@ -35,8 +40,8 @@
|
|
|
35
40
|
].filter(Boolean).join(' ')
|
|
36
41
|
</script>
|
|
37
42
|
|
|
38
|
-
<svelte:element this={element} class={classes} {
|
|
39
|
-
|
|
43
|
+
<svelte:element this={element} class={classes} {...rest}>
|
|
44
|
+
{@render icon?.()}
|
|
40
45
|
|
|
41
46
|
{#if !hasCustomIcon && theme}
|
|
42
47
|
{@html iconMap[theme]}
|
|
@@ -53,7 +58,7 @@
|
|
|
53
58
|
</svelte:element>
|
|
54
59
|
{/if}
|
|
55
60
|
<div class={styles.body} {...bodyProps}>
|
|
56
|
-
|
|
61
|
+
{@render children?.()}
|
|
57
62
|
</div>
|
|
58
63
|
</ConditionalWrapper>
|
|
59
64
|
</svelte:element>
|
|
@@ -40,7 +40,7 @@ const Alert = ({
|
|
|
40
40
|
<Element className={classes} {...rest}>
|
|
41
41
|
{icon && icon}
|
|
42
42
|
{!icon && theme && <div
|
|
43
|
-
dangerouslySetInnerHTML={{ __html: iconMap[theme] }}
|
|
43
|
+
dangerouslySetInnerHTML={{ __html: iconMap[theme as keyof typeof iconMap] }}
|
|
44
44
|
style={{ height: '20px' }}
|
|
45
45
|
/>}
|
|
46
46
|
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte'
|
|
2
|
+
|
|
1
3
|
export type AlertProps = {
|
|
2
4
|
element?: string
|
|
3
|
-
title?: string
|
|
5
|
+
title?: string
|
|
4
6
|
titleTag?: string
|
|
5
7
|
titleProps?: any
|
|
6
8
|
bodyProps?: any
|
|
7
|
-
className?: string
|
|
9
|
+
className?: string
|
|
8
10
|
theme?: 'info'
|
|
9
11
|
| 'success'
|
|
10
12
|
| 'warning'
|
|
11
13
|
| 'alert'
|
|
12
|
-
|
|
14
|
+
[key: string]: any
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
export type SvelteAlertProps = {
|
|
18
|
+
icon?: Snippet
|
|
19
|
+
children: Snippet
|
|
20
|
+
} & AlertProps
|
|
21
|
+
|
|
15
22
|
export type ReactAlertProps = {
|
|
16
23
|
Element?: keyof JSX.IntrinsicElements
|
|
17
24
|
TitleTag?: keyof JSX.IntrinsicElements
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { SvelteAspectRatioProps } from './aspectratio'
|
|
3
3
|
|
|
4
4
|
import { classNames } from '../../utils/classNames'
|
|
5
5
|
|
|
6
6
|
import styles from './aspect-ratio.module.scss'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const {
|
|
9
|
+
ratio,
|
|
10
|
+
className,
|
|
11
|
+
children
|
|
12
|
+
}: SvelteAspectRatioProps = $props()
|
|
10
13
|
|
|
11
14
|
const classes = classNames([
|
|
12
15
|
styles.ratio,
|
|
@@ -15,5 +18,5 @@
|
|
|
15
18
|
</script>
|
|
16
19
|
|
|
17
20
|
<div class={classes} style={`aspect-ratio: ${ratio.replace(':', '/')};`}>
|
|
18
|
-
|
|
21
|
+
{@render children?.()}
|
|
19
22
|
</div>
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte'
|
|
2
|
+
|
|
1
3
|
export type AspectRatioProps = {
|
|
2
4
|
ratio: string
|
|
3
5
|
className?: string
|
|
4
6
|
}
|
|
5
7
|
|
|
8
|
+
export type SvelteAspectRatioProps = {
|
|
9
|
+
children: Snippet
|
|
10
|
+
} & AspectRatioProps
|
|
11
|
+
|
|
6
12
|
export type ReactAspectRatioProps = {
|
|
7
13
|
children: React.ReactNode
|
|
8
14
|
} & AspectRatioProps
|
|
@@ -5,15 +5,17 @@
|
|
|
5
5
|
|
|
6
6
|
import styles from './avatar.module.scss'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const {
|
|
9
|
+
img,
|
|
10
|
+
alt = 'Avatar',
|
|
11
|
+
size = 40,
|
|
12
|
+
lazy = true,
|
|
13
|
+
borderColor,
|
|
14
|
+
borderless,
|
|
15
|
+
reverse,
|
|
16
|
+
className,
|
|
17
|
+
groupClassName
|
|
18
|
+
}: AvatarProps = $props()
|
|
17
19
|
|
|
18
20
|
const classes = classNames([
|
|
19
21
|
styles.avatar,
|
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
import styles from './badge.module.scss'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const {
|
|
9
|
+
theme,
|
|
10
|
+
hover,
|
|
11
|
+
small,
|
|
12
|
+
rounded,
|
|
13
|
+
className,
|
|
14
|
+
onClick,
|
|
15
|
+
children,
|
|
16
|
+
...rest
|
|
17
|
+
}: SvelteBadgeProps = $props()
|
|
14
18
|
|
|
15
19
|
const classes = classNames([
|
|
16
20
|
styles.badge,
|
|
@@ -23,12 +27,12 @@
|
|
|
23
27
|
</script>
|
|
24
28
|
|
|
25
29
|
{#if onClick}
|
|
26
|
-
<button class={classes}
|
|
27
|
-
|
|
30
|
+
<button class={classes} onclick={onClick} {...rest}>
|
|
31
|
+
{@render children?.()}
|
|
28
32
|
</button>
|
|
29
33
|
{:else}
|
|
30
|
-
<span class={classes} {
|
|
31
|
-
|
|
34
|
+
<span class={classes} {...rest}>
|
|
35
|
+
{@render children?.()}
|
|
32
36
|
</span>
|
|
33
37
|
{/if}
|
|
34
38
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte'
|
|
1
2
|
import type { MouseEventHandler } from 'svelte/elements'
|
|
2
3
|
|
|
3
4
|
export type BadgeProps = {
|
|
@@ -8,7 +9,6 @@ export type BadgeProps = {
|
|
|
8
9
|
| 'success'
|
|
9
10
|
| 'warning'
|
|
10
11
|
| 'alert'
|
|
11
|
-
| null
|
|
12
12
|
hover?: boolean
|
|
13
13
|
small?: boolean
|
|
14
14
|
rounded?: boolean
|
|
@@ -17,7 +17,8 @@ export type BadgeProps = {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export type SvelteBadgeProps = {
|
|
20
|
-
onClick?: MouseEventHandler<HTMLButtonElement>
|
|
20
|
+
onClick?: MouseEventHandler<HTMLButtonElement> | null
|
|
21
|
+
children?: Snippet
|
|
21
22
|
} & BadgeProps
|
|
22
23
|
|
|
23
24
|
export type ReactBadgeProps = {
|
|
@@ -39,6 +39,7 @@ const style = top
|
|
|
39
39
|
theme="flat"
|
|
40
40
|
className={styles.close}
|
|
41
41
|
data-id="w-banner-close"
|
|
42
|
+
aria-label="close"
|
|
42
43
|
>
|
|
43
44
|
<Fragment set:html={closeIcon} />
|
|
44
45
|
</Button>
|
|
@@ -48,9 +49,14 @@ const style = top
|
|
|
48
49
|
<script>
|
|
49
50
|
import { on } from '../../utils/DOMUtils'
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
const addEventListeners = () => {
|
|
53
|
+
on('[data-id="w-banner-close"]', 'click', (event: Event) => {
|
|
54
|
+
const target = event.currentTarget as HTMLDivElement
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
target.parentElement?.remove()
|
|
57
|
+
}, true)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
on(document, 'astro:after-swap', addEventListeners)
|
|
61
|
+
addEventListeners()
|
|
56
62
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { SvelteBannerProps } from './banner'
|
|
3
3
|
|
|
4
4
|
import Button from '../Button/Button.svelte'
|
|
5
5
|
|
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
import styles from './banner.module.scss'
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
const {
|
|
13
|
+
top,
|
|
14
|
+
bottom,
|
|
15
|
+
closeable,
|
|
16
|
+
padded,
|
|
17
|
+
sticky = true,
|
|
18
|
+
className,
|
|
19
|
+
children
|
|
20
|
+
}: SvelteBannerProps = $props()
|
|
20
21
|
|
|
21
22
|
const classes = classNames([
|
|
22
23
|
styles.banner,
|
|
@@ -29,16 +30,19 @@
|
|
|
29
30
|
const style = top
|
|
30
31
|
? `--w-banner-top: ${top}px;`
|
|
31
32
|
: null
|
|
33
|
+
|
|
34
|
+
let visible = $state(true)
|
|
32
35
|
</script>
|
|
33
36
|
|
|
34
37
|
{#if visible}
|
|
35
38
|
<div class={classes} style={style}>
|
|
36
|
-
|
|
39
|
+
{@render children?.()}
|
|
37
40
|
{#if closeable}
|
|
38
41
|
<Button
|
|
39
42
|
theme="flat"
|
|
40
43
|
className={styles.close}
|
|
41
44
|
onClick={() => visible = false}
|
|
45
|
+
aria-label="close"
|
|
42
46
|
>
|
|
43
47
|
{@html closeIcon}
|
|
44
48
|
</Button>
|