webcoreui 0.1.0 → 0.3.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 +37 -1
- package/astro.d.ts +12 -0
- package/astro.js +12 -0
- package/components/Accordion/accordion.module.scss +1 -2
- package/components/Alert/Alert.tsx +4 -1
- package/components/Alert/alert.module.scss +3 -3
- package/components/Avatar/avatar.module.scss +2 -0
- package/components/Badge/badge.module.scss +1 -1
- package/components/Button/button.module.scss +2 -2
- package/components/Button/button.ts +1 -1
- package/components/Card/card.module.scss +0 -1
- package/components/Checkbox/checkbox.module.scss +4 -4
- package/components/Collapsible/Collapsible.astro +63 -0
- package/components/Collapsible/Collapsible.svelte +48 -0
- package/components/Collapsible/Collapsible.tsx +54 -0
- package/components/Collapsible/collapsible.module.scss +29 -0
- package/components/Collapsible/collapsible.ts +14 -0
- package/components/Icon/map.ts +2 -0
- package/components/Input/input.module.scss +2 -2
- package/components/Menu/Menu.astro +7 -3
- package/components/Menu/Menu.svelte +11 -3
- package/components/Menu/Menu.tsx +7 -1
- package/components/Menu/menu.module.scss +4 -1
- package/components/Menu/menu.ts +1 -0
- package/components/Modal/Modal.astro +70 -0
- package/components/Modal/Modal.svelte +71 -0
- package/components/Modal/Modal.tsx +76 -0
- package/components/Modal/modal.module.scss +103 -0
- package/components/Modal/modal.ts +18 -0
- package/components/Popover/Popover.astro +23 -0
- package/components/Popover/Popover.svelte +21 -0
- package/components/Popover/Popover.tsx +27 -0
- package/components/Popover/popover.module.scss +51 -0
- package/components/Popover/popover.ts +8 -0
- package/components/Progress/progress.module.scss +3 -3
- package/components/Radio/radio.module.scss +1 -2
- package/components/Rating/Rating.astro +2 -2
- package/components/Rating/Rating.svelte +2 -2
- package/components/Rating/Rating.tsx +2 -2
- package/components/Rating/rating.module.scss +1 -1
- package/components/Sheet/Sheet.astro +29 -0
- package/components/Sheet/Sheet.svelte +24 -0
- package/components/Sheet/Sheet.tsx +32 -0
- package/components/Sheet/sheet.module.scss +68 -0
- package/components/Sheet/sheet.ts +10 -0
- package/components/Slider/Slider.astro +44 -0
- package/components/Slider/Slider.svelte +42 -0
- package/components/Slider/Slider.tsx +48 -0
- package/components/Slider/slider.module.scss +68 -0
- package/components/Slider/slider.ts +20 -0
- package/components/Switch/switch.module.scss +1 -1
- package/components/Table/Table.astro +6 -1
- package/components/Table/Table.svelte +3 -1
- package/components/Table/Table.tsx +7 -1
- package/components/Table/table.module.scss +11 -1
- package/components/Table/table.ts +1 -0
- package/components/Tabs/tabs.module.scss +6 -1
- package/components/Textarea/Textarea.astro +44 -0
- package/components/Textarea/Textarea.svelte +45 -0
- package/components/Textarea/Textarea.tsx +50 -0
- package/components/Textarea/textarea.module.scss +36 -0
- package/components/Textarea/textarea.ts +18 -0
- package/components/ThemeSwitcher/ThemeSwitcher.astro +1 -0
- package/components/ThemeSwitcher/ThemeSwitcher.svelte +2 -1
- package/components/ThemeSwitcher/ThemeSwitcher.tsx +2 -1
- package/components/Timeline/timeline.module.scss +4 -4
- package/components/TimelineItem/TimelineItem.tsx +1 -6
- package/components/TimelineItem/timelineitem.module.scss +2 -3
- package/components/TimelineItem/timelineitem.ts +5 -0
- package/components/Toast/Toast.svelte +11 -6
- package/icons/close.svg +3 -0
- package/icons.d.ts +1 -0
- package/icons.js +1 -0
- package/index.d.ts +69 -0
- package/index.js +4 -0
- package/package.json +2 -1
- package/react.d.ts +14 -2
- package/react.js +12 -0
- package/scss/config/color-palette.scss +1 -0
- package/scss/config/mixins.scss +152 -155
- package/scss/config/typography.scss +8 -9
- package/scss/global/theme.scss +71 -38
- package/scss/global/tooltip.scss +5 -3
- package/scss/global/utility.scss +76 -58
- package/scss/resets.scss +10 -5
- package/scss/setup.scss +2 -2
- package/svelte.d.ts +12 -0
- package/svelte.js +12 -0
- package/utils/debounce.ts +24 -0
- package/utils/interpolate.ts +23 -0
- package/utils/modal.ts +59 -0
- package/utils/popover.ts +201 -0
- package/utils/toast.ts +0 -6
|
@@ -28,11 +28,11 @@ body {
|
|
|
28
28
|
left: $leftOffset
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
&.fill li::before {
|
|
31
|
+
&.fill > li::before {
|
|
32
32
|
content: '';
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
&.stroke li::before {
|
|
35
|
+
&.stroke > li::before {
|
|
36
36
|
@include background(primary-70);
|
|
37
37
|
border: 2px solid var(--w-timeline-color);
|
|
38
38
|
}
|
|
@@ -47,7 +47,7 @@ body {
|
|
|
47
47
|
left: calc(50% - 1px);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
li {
|
|
50
|
+
> li {
|
|
51
51
|
@include size('w50%');
|
|
52
52
|
|
|
53
53
|
&:nth-child(odd) {
|
|
@@ -69,7 +69,7 @@ body {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
&.centered li:nth-child(odd) {
|
|
72
|
+
&.centered > li:nth-child(odd) {
|
|
73
73
|
@include typography(right);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type {
|
|
2
|
+
import type { ReactTimelineItemProps } from './timelineitem'
|
|
3
3
|
|
|
4
4
|
import styles from './timelineitem.module.scss'
|
|
5
5
|
import { classNames } from '../../utils/classNames'
|
|
6
6
|
|
|
7
|
-
type ReactTimelineItemProps = {
|
|
8
|
-
TitleTag?: keyof JSX.IntrinsicElements
|
|
9
|
-
children: React.ReactNode
|
|
10
|
-
} & Omit<TimelineItemProps, 'titleTag'>
|
|
11
|
-
|
|
12
7
|
const TimelineItem = ({
|
|
13
8
|
title,
|
|
14
9
|
TitleTag = 'span',
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
.item {
|
|
4
4
|
@include position(relative);
|
|
5
|
-
@include typography(md);
|
|
6
5
|
@include spacing(m0);
|
|
7
6
|
|
|
8
7
|
&::before {
|
|
@@ -10,7 +9,7 @@
|
|
|
10
9
|
@include size(25px);
|
|
11
10
|
@include border-radius(max);
|
|
12
11
|
@include background(var(--w-timeline-color));
|
|
13
|
-
@include typography(
|
|
12
|
+
@include typography(md);
|
|
14
13
|
@include layout(inline-flex, center);
|
|
15
14
|
@include border(2px, primary-70);
|
|
16
15
|
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
.title {
|
|
24
|
-
@include typography(bold,
|
|
23
|
+
@include typography(bold, lg);
|
|
25
24
|
@include spacing(mb-sm);
|
|
26
25
|
|
|
27
26
|
display: block;
|
|
@@ -24,9 +24,14 @@
|
|
|
24
24
|
}
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
<slot name="icon" />
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
{#if $$slots.icon}
|
|
28
|
+
<Alert {...$$restProps} className={classes} {...additionalProps}>
|
|
29
|
+
<slot slot="icon" name="icon" />
|
|
30
|
+
<slot />
|
|
31
|
+
</Alert>
|
|
32
|
+
{:else}
|
|
33
|
+
<Alert {...$$restProps} className={classes} {...additionalProps}>
|
|
34
|
+
<slot />
|
|
35
|
+
</Alert>
|
|
36
|
+
{/if}
|
|
37
|
+
|
package/icons/close.svg
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
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="M0.390524 0.390524C0.911223 -0.130175 1.75544 -0.130175 2.27614 0.390524L12 10.1144L21.7239 0.390524C22.2446 -0.130175 23.0888 -0.130175 23.6095 0.390524C24.1302 0.911223 24.1302 1.75544 23.6095 2.27614L13.8856 12L23.6095 21.7239C24.1302 22.2446 24.1302 23.0888 23.6095 23.6095C23.0888 24.1302 22.2446 24.1302 21.7239 23.6095L12 13.8856L2.27614 23.6095C1.75544 24.1302 0.911223 24.1302 0.390524 23.6095C-0.130175 23.0888 -0.130175 22.2446 0.390524 21.7239L10.1144 12L0.390524 2.27614C-0.130175 1.75544 -0.130175 0.911223 0.390524 0.390524Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
package/icons.d.ts
CHANGED
package/icons.js
CHANGED
|
@@ -2,6 +2,7 @@ export { default as alert } from './icons/alert.svg?raw'
|
|
|
2
2
|
export { default as arrowDown } from './icons/arrow-down.svg?raw'
|
|
3
3
|
export { default as check } from './icons/check.svg?raw'
|
|
4
4
|
export { default as circleCheck } from './icons/circle-check.svg?raw'
|
|
5
|
+
export { default as close } from './icons/close.svg?raw'
|
|
5
6
|
export { default as github } from './icons/github.svg?raw'
|
|
6
7
|
export { default as info } from './icons/info.svg?raw'
|
|
7
8
|
export { default as moon } from './icons/moon.svg?raw'
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
type PopoverPosition = 'top'
|
|
2
|
+
| 'top-start'
|
|
3
|
+
| 'top-end'
|
|
4
|
+
| 'left'
|
|
5
|
+
| 'left-start'
|
|
6
|
+
| 'left-end'
|
|
7
|
+
| 'right'
|
|
8
|
+
| 'right-start'
|
|
9
|
+
| 'right-end'
|
|
10
|
+
| 'bottom'
|
|
11
|
+
| 'bottom-start'
|
|
12
|
+
| 'bottom-end'
|
|
13
|
+
|
|
14
|
+
type Popover = {
|
|
15
|
+
trigger: string
|
|
16
|
+
popover: string
|
|
17
|
+
position?: PopoverPosition
|
|
18
|
+
offset?: number
|
|
19
|
+
closeOnBlur?: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Toast = {
|
|
23
|
+
element: string
|
|
24
|
+
timeout?: number
|
|
25
|
+
title?: string
|
|
26
|
+
content?: string
|
|
27
|
+
theme?: 'info' | 'success' | 'warning' | 'alert' | null
|
|
28
|
+
position?: 'bottom-left'
|
|
29
|
+
| 'top-left'
|
|
30
|
+
| 'top-right'
|
|
31
|
+
| 'bottom-full'
|
|
32
|
+
| 'top-full'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare module 'webcoreui' {
|
|
36
|
+
export const classNames = (classes: any[]) => string
|
|
37
|
+
|
|
38
|
+
export const setCookie = (name: string, value: string, days: number) => {}
|
|
39
|
+
export const getCookie = (name: string) => string | null
|
|
40
|
+
export const removeCookie = (name: string) => {}
|
|
41
|
+
|
|
42
|
+
export const debounce = (fn: any, waitFor: number) => any
|
|
43
|
+
|
|
44
|
+
export const dispatch = (event: string, detail: any) => {}
|
|
45
|
+
export const listen = (event: string, callback: (e: any) => any) => {
|
|
46
|
+
remove()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const clamp = (num: number, min: number, max: number) => number
|
|
50
|
+
export const lerp = (start: number, end: number, value: number) => number
|
|
51
|
+
export const invlerp = (start: number, end: number, value: number) => number
|
|
52
|
+
export const interpolate = (
|
|
53
|
+
value: number,
|
|
54
|
+
input: [start: number, end: number],
|
|
55
|
+
output: [start: number, end: number],
|
|
56
|
+
) => number
|
|
57
|
+
|
|
58
|
+
export const modal = (selector: string) => {}
|
|
59
|
+
export const closeModal = (selector: string) => {}
|
|
60
|
+
|
|
61
|
+
export const popover = (config: Popover) => {
|
|
62
|
+
remove()
|
|
63
|
+
}
|
|
64
|
+
export const closePopover = (selector: string) => {}
|
|
65
|
+
|
|
66
|
+
export const setDefaultTimeout = (time: number) => number
|
|
67
|
+
export const toast = (config: Toast | string) => {}
|
|
68
|
+
export const hideToast = (element: string) => {}
|
|
69
|
+
}
|
package/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export * from './utils/classNames.ts'
|
|
2
2
|
export * from './utils/cookies.ts'
|
|
3
|
+
export * from './utils/debounce.ts'
|
|
3
4
|
export * from './utils/event.ts'
|
|
5
|
+
export * from './utils/interpolate.ts'
|
|
6
|
+
export * from './utils/modal.ts'
|
|
7
|
+
export * from './utils/popover.ts'
|
|
4
8
|
export * from './utils/toast.ts'
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcoreui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "astro dev",
|
|
7
7
|
"build": "astro check && astro build",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"react.d.ts",
|
|
44
44
|
"react.js",
|
|
45
45
|
"index.js",
|
|
46
|
+
"index.d.ts",
|
|
46
47
|
"README.md",
|
|
47
48
|
"LICENSE"
|
|
48
49
|
],
|
package/react.d.ts
CHANGED
|
@@ -6,20 +6,26 @@ import type { ReactBadgeProps } from './components/Badge/badge'
|
|
|
6
6
|
import type { ReactButtonProps } from './components/Button/button'
|
|
7
7
|
import type { ReactCardProps } from './components/Card/card'
|
|
8
8
|
import type { ReactCheckboxProps } from './components/Checkbox/checkbox'
|
|
9
|
+
import type { ReactCollapsibleProps } from './components/Collapsible/collapsible'
|
|
9
10
|
import type { ReactConditionalWrapperProps } from './components/ConditionalWrapper/conditionalwrapper'
|
|
10
11
|
import type { IconProps } from './components/Icon/icon'
|
|
11
12
|
import type { ReactInputProps } from './components/Input/input'
|
|
12
13
|
import type { ReactMenuProps } from './components/Menu/menu'
|
|
14
|
+
import type { ReactModalProps } from './components/Modal/modal'
|
|
15
|
+
import type { ReactPopoverProps } from './components/Popover/popover'
|
|
13
16
|
import type { ProgressProps } from './components/Progress/progress'
|
|
14
17
|
import type { ReactRadioProps } from './components/Radio/radio'
|
|
15
18
|
import type { RatingProps } from './components/Rating/rating'
|
|
19
|
+
import type { ReactSheetProps } from './components/Sheet/sheet'
|
|
20
|
+
import type { ReactSliderProps } from './components/Slider/slider'
|
|
16
21
|
import type { SpinnerProps } from './components/Spinner/spinner'
|
|
17
22
|
import type { ReactSwitchProps } from './components/Switch/switch'
|
|
18
23
|
import type { TableProps } from './components/Table/table'
|
|
19
24
|
import type { ReactTabsProps } from './components/Tabs/tabs'
|
|
25
|
+
import type { ReactTextareaProps } from './components/Textarea/textarea'
|
|
20
26
|
import type { ReactThemeSwitcherProps } from './components/ThemeSwitcher/themeswitcher'
|
|
21
27
|
import type { ReactTimelineProps } from './components/Timeline/timeline'
|
|
22
|
-
import type {
|
|
28
|
+
import type { ReactTimelineItemProps } from './components/TimelineItem/timelineitem'
|
|
23
29
|
import type { ReactToastProps } from './components/Toast/toast'
|
|
24
30
|
|
|
25
31
|
declare module 'webcoreui/react' {
|
|
@@ -30,19 +36,25 @@ declare module 'webcoreui/react' {
|
|
|
30
36
|
export const Button: FC<ReactButtonProps>
|
|
31
37
|
export const Card: FC<ReactCardProps>
|
|
32
38
|
export const Checkbox: FC<ReactCheckboxProps>
|
|
39
|
+
export const Collapsible: FC<ReactCollapsibleProps>
|
|
33
40
|
export const ConditionalWrapper: FC<ReactConditionalWrapperProps>
|
|
34
41
|
export const Icon: FC<IconProps>
|
|
35
42
|
export const Input: FC<ReactInputProps>
|
|
36
43
|
export const Menu: FC<ReactMenuProps>
|
|
44
|
+
export const Modal: FC<ReactModalProps>
|
|
45
|
+
export const Popover: FC<ReactPopoverProps>
|
|
37
46
|
export const Progress: FC<ProgressProps>
|
|
38
47
|
export const Radio: FC<ReactRadioProps>
|
|
39
48
|
export const Rating: FC<RatingProps>
|
|
49
|
+
export const Sheet: FC<ReactSheetProps>
|
|
50
|
+
export const Slider: FC<ReactSliderProps>
|
|
40
51
|
export const Spinner: FC<SpinnerProps>
|
|
41
52
|
export const Switch: FC<ReactSwitchProps>
|
|
42
53
|
export const Table: FC<TableProps>
|
|
43
54
|
export const Tabs: FC<ReactTabsProps>
|
|
55
|
+
export const Textarea: FC<ReactTextareaProps>
|
|
44
56
|
export const ThemeSwitcher: FC<ReactThemeSwitcherProps>
|
|
45
57
|
export const Timeline: FC<ReactTimelineProps>
|
|
46
|
-
export const TimelineItem: FC<
|
|
58
|
+
export const TimelineItem: FC<ReactTimelineItemProps>
|
|
47
59
|
export const Toast: FC<ReactToastProps>
|
|
48
60
|
}
|
package/react.js
CHANGED
|
@@ -5,17 +5,23 @@ import BadgeComponent from './components/Badge/Badge.tsx'
|
|
|
5
5
|
import ButtonComponent from './components/Button/Button.tsx'
|
|
6
6
|
import CardComponent from './components/Card/Card.tsx'
|
|
7
7
|
import CheckboxComponent from './components/Checkbox/Checkbox.tsx'
|
|
8
|
+
import CollapsibleComponent from './components/Collapsible/Collapsible.tsx'
|
|
8
9
|
import ConditionalWrapperComponent from './components/ConditionalWrapper/ConditionalWrapper.tsx'
|
|
9
10
|
import IconComponent from './components/Icon/Icon.tsx'
|
|
10
11
|
import InputComponent from './components/Input/Input.tsx'
|
|
11
12
|
import MenuComponent from './components/Menu/Menu.tsx'
|
|
13
|
+
import ModalComponent from './components/Modal/Modal.tsx'
|
|
14
|
+
import PopoverComponent from './components/Popover/Popover.tsx'
|
|
12
15
|
import ProgressComponent from './components/Progress/Progress.tsx'
|
|
13
16
|
import RadioComponent from './components/Radio/Radio.tsx'
|
|
14
17
|
import RatingComponent from './components/Rating/Rating.tsx'
|
|
18
|
+
import SheetComponent from './components/Sheet/Sheet.tsx'
|
|
19
|
+
import SliderComponent from './components/Slider/Slider.tsx'
|
|
15
20
|
import SpinnerComponent from './components/Spinner/Spinner.tsx'
|
|
16
21
|
import SwitchComponent from './components/Switch/Switch.tsx'
|
|
17
22
|
import TableComponent from './components/Table/Table.tsx'
|
|
18
23
|
import TabsComponent from './components/Tabs/Tabs.tsx'
|
|
24
|
+
import TextareaComponent from './components/Textarea/Textarea.tsx'
|
|
19
25
|
import ThemeSwitcherComponent from './components/ThemeSwitcher/ThemeSwitcher.tsx'
|
|
20
26
|
import TimelineComponent from './components/Timeline/Timeline.tsx'
|
|
21
27
|
import TimelineItemComponent from './components/TimelineItem/TimelineItem.tsx'
|
|
@@ -28,17 +34,23 @@ export const Badge = BadgeComponent
|
|
|
28
34
|
export const Button = ButtonComponent
|
|
29
35
|
export const Card = CardComponent
|
|
30
36
|
export const Checkbox = CheckboxComponent
|
|
37
|
+
export const Collapsible = CollapsibleComponent
|
|
31
38
|
export const ConditionalWrapper = ConditionalWrapperComponent
|
|
32
39
|
export const Icon = IconComponent
|
|
33
40
|
export const Input = InputComponent
|
|
34
41
|
export const Menu = MenuComponent
|
|
42
|
+
export const Modal = ModalComponent
|
|
43
|
+
export const Popover = PopoverComponent
|
|
35
44
|
export const Progress = ProgressComponent
|
|
36
45
|
export const Radio = RadioComponent
|
|
37
46
|
export const Rating = RatingComponent
|
|
47
|
+
export const Sheet = SheetComponent
|
|
48
|
+
export const Slider = SliderComponent
|
|
38
49
|
export const Spinner = SpinnerComponent
|
|
39
50
|
export const Switch = SwitchComponent
|
|
40
51
|
export const Table = TableComponent
|
|
41
52
|
export const Tabs = TabsComponent
|
|
53
|
+
export const Textarea = TextareaComponent
|
|
42
54
|
export const ThemeSwitcher = ThemeSwitcherComponent
|
|
43
55
|
export const Timeline = TimelineComponent
|
|
44
56
|
export const TimelineItem = TimelineItemComponent
|