svelte-mobile-ui 1.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/LICENSE +21 -0
- package/README.md +173 -0
- package/components/ActionBar/ActionBar.svelte +31 -0
- package/components/ActionBar/ActionBarButton.svelte +105 -0
- package/components/ActionBar/ActionBarIcon.svelte +100 -0
- package/components/ActionBar/index.ts +3 -0
- package/components/ActionSheet/ActionSheet.svelte +134 -0
- package/components/ActionSheet/index.ts +1 -0
- package/components/AddressEdit/AddressEdit.svelte +23 -0
- package/components/AddressEdit/index.ts +1 -0
- package/components/AddressList/AddressList.svelte +23 -0
- package/components/AddressList/index.ts +1 -0
- package/components/Area/Area.svelte +23 -0
- package/components/Area/index.ts +1 -0
- package/components/BackTop/BackTop.svelte +23 -0
- package/components/BackTop/index.ts +1 -0
- package/components/Badge/Badge.svelte +90 -0
- package/components/Badge/index.ts +1 -0
- package/components/Barrage/Barrage.svelte +23 -0
- package/components/Barrage/index.ts +1 -0
- package/components/Button/Button.svelte +297 -0
- package/components/Button/index.ts +1 -0
- package/components/Calendar/Calendar.svelte +23 -0
- package/components/Calendar/index.ts +1 -0
- package/components/Card/Card.svelte +23 -0
- package/components/Card/index.ts +1 -0
- package/components/Cascader/Cascader.svelte +23 -0
- package/components/Cascader/index.ts +1 -0
- package/components/Cell/Cell.svelte +155 -0
- package/components/Cell/index.ts +1 -0
- package/components/CellGroup/CellGroup.svelte +47 -0
- package/components/CellGroup/index.ts +1 -0
- package/components/Checkbox/Checkbox.svelte +128 -0
- package/components/Checkbox/index.ts +1 -0
- package/components/CheckboxGroup/CheckboxGroup.svelte +36 -0
- package/components/CheckboxGroup/index.ts +1 -0
- package/components/Circle/Circle.svelte +23 -0
- package/components/Circle/index.ts +1 -0
- package/components/Col/Col.svelte +23 -0
- package/components/Col/index.ts +1 -0
- package/components/Collapse/Collapse.svelte +25 -0
- package/components/Collapse/CollapseItem.svelte +102 -0
- package/components/Collapse/index.ts +2 -0
- package/components/ConfigProvider/ConfigProvider.svelte +23 -0
- package/components/ConfigProvider/index.ts +1 -0
- package/components/ContactCard/ContactCard.svelte +23 -0
- package/components/ContactCard/index.ts +1 -0
- package/components/ContactEdit/ContactEdit.svelte +207 -0
- package/components/ContactEdit/index.ts +1 -0
- package/components/ContactList/ContactList.svelte +143 -0
- package/components/ContactList/index.ts +1 -0
- package/components/CountDown/CountDown.svelte +23 -0
- package/components/CountDown/index.ts +1 -0
- package/components/Coupon/Coupon.svelte +23 -0
- package/components/Coupon/CouponCell.svelte +130 -0
- package/components/Coupon/CouponList.svelte +225 -0
- package/components/Coupon/index.ts +3 -0
- package/components/DatePicker/DatePicker.svelte +23 -0
- package/components/DatePicker/index.ts +1 -0
- package/components/Dialog/Dialog.svelte +141 -0
- package/components/Dialog/index.ts +1 -0
- package/components/Divider/Divider.svelte +61 -0
- package/components/Divider/index.ts +1 -0
- package/components/DropdownMenu/DropdownItem.svelte +131 -0
- package/components/DropdownMenu/DropdownMenu.svelte +23 -0
- package/components/DropdownMenu/index.ts +2 -0
- package/components/Empty/Empty.svelte +73 -0
- package/components/Empty/index.ts +1 -0
- package/components/Field/Field.svelte +270 -0
- package/components/Field/index.ts +1 -0
- package/components/FloatingBubble/FloatingBubble.svelte +23 -0
- package/components/FloatingBubble/index.ts +1 -0
- package/components/FloatingPanel/FloatingPanel.svelte +139 -0
- package/components/FloatingPanel/index.ts +1 -0
- package/components/Form/Form.svelte +23 -0
- package/components/Form/index.ts +1 -0
- package/components/Grid/Grid.svelte +47 -0
- package/components/Grid/GridItem.svelte +150 -0
- package/components/Grid/index.ts +2 -0
- package/components/Highlight/Highlight.svelte +23 -0
- package/components/Highlight/index.ts +1 -0
- package/components/Icon/Icon.svelte +111 -0
- package/components/Icon/index.ts +1 -0
- package/components/ImageComp/ImageComp.svelte +104 -0
- package/components/ImageComp/index.ts +1 -0
- package/components/ImagePreview/ImagePreview.svelte +23 -0
- package/components/ImagePreview/index.ts +1 -0
- package/components/IndexBar/IndexAnchor.svelte +33 -0
- package/components/IndexBar/IndexBar.svelte +23 -0
- package/components/IndexBar/index.ts +2 -0
- package/components/List/List.svelte +23 -0
- package/components/List/index.ts +1 -0
- package/components/Loading/Loading.svelte +149 -0
- package/components/Loading/index.ts +1 -0
- package/components/NavBar/NavBar.svelte +109 -0
- package/components/NavBar/index.ts +1 -0
- package/components/NoticeBar/NoticeBar.svelte +120 -0
- package/components/NoticeBar/index.ts +1 -0
- package/components/Notify/Notify.svelte +23 -0
- package/components/Notify/index.ts +1 -0
- package/components/NumberKeyboard/NumberKeyboard.svelte +23 -0
- package/components/NumberKeyboard/index.ts +1 -0
- package/components/Overlay/Overlay.svelte +46 -0
- package/components/Overlay/index.ts +1 -0
- package/components/Pagination/Pagination.svelte +23 -0
- package/components/Pagination/index.ts +1 -0
- package/components/PasswordInput/PasswordInput.svelte +23 -0
- package/components/PasswordInput/index.ts +1 -0
- package/components/Picker/Picker.svelte +23 -0
- package/components/Picker/index.ts +1 -0
- package/components/PickerGroup/PickerGroup.svelte +99 -0
- package/components/PickerGroup/index.ts +1 -0
- package/components/Popover/Popover.svelte +23 -0
- package/components/Popover/index.ts +1 -0
- package/components/Popup/Popup.svelte +154 -0
- package/components/Popup/index.ts +1 -0
- package/components/Progress/Progress.svelte +89 -0
- package/components/Progress/index.ts +1 -0
- package/components/PullRefresh/PullRefresh.svelte +23 -0
- package/components/PullRefresh/index.ts +1 -0
- package/components/Radio/Radio.svelte +106 -0
- package/components/Radio/index.ts +1 -0
- package/components/RadioGroup/RadioGroup.svelte +34 -0
- package/components/RadioGroup/index.ts +1 -0
- package/components/Rate/Rate.svelte +87 -0
- package/components/Rate/index.ts +1 -0
- package/components/RollingText/RollingText.svelte +104 -0
- package/components/RollingText/index.ts +1 -0
- package/components/Row/Row.svelte +23 -0
- package/components/Row/index.ts +1 -0
- package/components/Search/Search.svelte +124 -0
- package/components/Search/index.ts +1 -0
- package/components/ShareSheet/ShareSheet.svelte +23 -0
- package/components/ShareSheet/index.ts +1 -0
- package/components/Sidebar/Sidebar.svelte +23 -0
- package/components/Sidebar/SidebarItem.svelte +110 -0
- package/components/Sidebar/index.ts +2 -0
- package/components/Signature/Signature.svelte +198 -0
- package/components/Signature/index.ts +1 -0
- package/components/Skeleton/Skeleton.svelte +23 -0
- package/components/Skeleton/SkeletonAvatar.svelte +26 -0
- package/components/Skeleton/SkeletonImage.svelte +44 -0
- package/components/Skeleton/SkeletonParagraph.svelte +60 -0
- package/components/Skeleton/SkeletonTitle.svelte +38 -0
- package/components/Skeleton/index.ts +5 -0
- package/components/Slider/Slider.svelte +112 -0
- package/components/Slider/index.ts +1 -0
- package/components/Space/Space.svelte +52 -0
- package/components/Space/index.ts +1 -0
- package/components/Stepper/Stepper.svelte +197 -0
- package/components/Stepper/index.ts +1 -0
- package/components/Steps/Step.svelte +126 -0
- package/components/Steps/Steps.svelte +23 -0
- package/components/Steps/index.ts +2 -0
- package/components/Sticky/Sticky.svelte +88 -0
- package/components/Sticky/index.ts +1 -0
- package/components/SubmitBar/SubmitBar.svelte +23 -0
- package/components/SubmitBar/index.ts +1 -0
- package/components/Swipe/Swipe.svelte +23 -0
- package/components/Swipe/SwipeItem.svelte +25 -0
- package/components/Swipe/index.ts +2 -0
- package/components/SwipeCell/SwipeCell.svelte +23 -0
- package/components/SwipeCell/index.ts +1 -0
- package/components/Switch/Switch.svelte +97 -0
- package/components/Switch/index.ts +1 -0
- package/components/Tabbar/Tabbar.svelte +62 -0
- package/components/Tabbar/index.ts +1 -0
- package/components/TabbarItem/TabbarItem.svelte +72 -0
- package/components/TabbarItem/index.ts +1 -0
- package/components/Tabs/Tab.svelte +37 -0
- package/components/Tabs/Tabs.svelte +161 -0
- package/components/Tabs/index.ts +2 -0
- package/components/Tag/Tag.svelte +144 -0
- package/components/Tag/index.ts +1 -0
- package/components/TextEllipsis/TextEllipsis.svelte +23 -0
- package/components/TextEllipsis/index.ts +1 -0
- package/components/TimePicker/TimePicker.svelte +23 -0
- package/components/TimePicker/index.ts +1 -0
- package/components/Toast/Toast.svelte +129 -0
- package/components/Toast/index.ts +1 -0
- package/components/TreeSelect/TreeSelect.svelte +23 -0
- package/components/TreeSelect/index.ts +1 -0
- package/components/Uploader/Uploader.svelte +23 -0
- package/components/Uploader/index.ts +1 -0
- package/components/Watermark/Watermark.svelte +23 -0
- package/components/Watermark/index.ts +1 -0
- package/components/index.ts +100 -0
- package/dist/styles.css +1 -0
- package/dist/svelte-mobile-ui.cjs +158 -0
- package/dist/svelte-mobile-ui.iife.js +209 -0
- package/dist/svelte-mobile-ui.mjs +158 -0
- package/dist/types/icons.ts +106 -0
- package/dist/types/index.ts +82 -0
- package/index.ts +8 -0
- package/package.json +63 -0
- package/styles/index.scss +153 -0
- package/styles/var.scss +83 -0
- package/utils/icons.ts +106 -0
- package/utils/index.ts +82 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Icon from '../Icon/Icon.svelte'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
text = '',
|
|
7
|
+
mode = '',
|
|
8
|
+
color = '',
|
|
9
|
+
background = '',
|
|
10
|
+
leftIcon = '',
|
|
11
|
+
wrapable = false,
|
|
12
|
+
scrollable = true,
|
|
13
|
+
delay = 1,
|
|
14
|
+
speed = 60,
|
|
15
|
+
children,
|
|
16
|
+
onclick,
|
|
17
|
+
onclose,
|
|
18
|
+
class: className = '',
|
|
19
|
+
}: {
|
|
20
|
+
text?: string
|
|
21
|
+
mode?: '' | 'closeable' | 'link'
|
|
22
|
+
color?: string
|
|
23
|
+
background?: string
|
|
24
|
+
leftIcon?: string
|
|
25
|
+
wrapable?: boolean
|
|
26
|
+
scrollable?: boolean
|
|
27
|
+
delay?: number
|
|
28
|
+
speed?: number
|
|
29
|
+
children?: Snippet
|
|
30
|
+
onclick?: (e: MouseEvent) => void
|
|
31
|
+
onclose?: () => void
|
|
32
|
+
class?: string
|
|
33
|
+
} = $props()
|
|
34
|
+
|
|
35
|
+
let show = $state(true)
|
|
36
|
+
|
|
37
|
+
function handleClose(e: MouseEvent) {
|
|
38
|
+
e.stopPropagation()
|
|
39
|
+
show = false
|
|
40
|
+
onclose?.()
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
{#if show}
|
|
45
|
+
<div
|
|
46
|
+
class="smu-notice-bar {wrapable ? 'smu-notice-bar--wrapable' : ''} {className}"
|
|
47
|
+
style="{color ? `color: ${color}` : ''}; {background ? `background: ${background}` : ''}"
|
|
48
|
+
onclick={onclick}
|
|
49
|
+
role={mode === 'link' ? 'link' : undefined}
|
|
50
|
+
>
|
|
51
|
+
{#if leftIcon}
|
|
52
|
+
<Icon name={leftIcon} class="smu-notice-bar__left-icon" />
|
|
53
|
+
{/if}
|
|
54
|
+
<div class="smu-notice-bar__wrap">
|
|
55
|
+
<div class="smu-notice-bar__content {scrollable && !wrapable ? 'smu-notice-bar__content--scrollable' : ''}" style={scrollable && !wrapable ? `animation-delay: ${delay}s; animation-duration: ${text.length / speed * 10}s` : ''}>
|
|
56
|
+
{#if children}{@render children()}{:else}{text}{/if}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
{#if mode === 'closeable'}
|
|
60
|
+
<Icon name="cross" class="smu-notice-bar__right-icon" onclick={handleClose} />
|
|
61
|
+
{:else if mode === 'link'}
|
|
62
|
+
<Icon name="arrow" class="smu-notice-bar__right-icon" />
|
|
63
|
+
{/if}
|
|
64
|
+
</div>
|
|
65
|
+
{/if}
|
|
66
|
+
|
|
67
|
+
<style lang="scss">
|
|
68
|
+
.smu-notice-bar {
|
|
69
|
+
position: relative;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
height: 40px;
|
|
73
|
+
padding: 0 var(--smu-padding-md);
|
|
74
|
+
color: #ed6a0c;
|
|
75
|
+
font-size: var(--smu-font-size-md);
|
|
76
|
+
line-height: 24px;
|
|
77
|
+
background: #fffbe8;
|
|
78
|
+
|
|
79
|
+
&--wrapable {
|
|
80
|
+
height: auto;
|
|
81
|
+
padding: var(--smu-padding-xs) var(--smu-padding-md);
|
|
82
|
+
|
|
83
|
+
.smu-notice-bar__wrap { height: auto; }
|
|
84
|
+
.smu-notice-bar__content { position: relative; white-space: normal; word-wrap: break-word; }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__left-icon {
|
|
88
|
+
min-width: 24px;
|
|
89
|
+
font-size: 16px;
|
|
90
|
+
margin-right: 4px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&__right-icon {
|
|
94
|
+
min-width: 24px;
|
|
95
|
+
font-size: 16px;
|
|
96
|
+
margin-left: 4px;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&__wrap {
|
|
101
|
+
position: relative;
|
|
102
|
+
flex: 1;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__content {
|
|
107
|
+
position: absolute;
|
|
108
|
+
white-space: nowrap;
|
|
109
|
+
|
|
110
|
+
&--scrollable {
|
|
111
|
+
animation: smu-notice-scroll linear infinite;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@keyframes smu-notice-scroll {
|
|
117
|
+
0% { transform: translateX(100%); }
|
|
118
|
+
100% { transform: translateX(-100%); }
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NoticeBar } from './NoticeBar.svelte'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
class: className = '',
|
|
7
|
+
...restProps
|
|
8
|
+
}: {
|
|
9
|
+
children?: Snippet
|
|
10
|
+
class?: string
|
|
11
|
+
[key: string]: any
|
|
12
|
+
} = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class="smu-notify {className}">
|
|
16
|
+
{#if children}{@render children()}{/if}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style lang="scss">
|
|
20
|
+
.smu-notify {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Notify } from './Notify.svelte'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
class: className = '',
|
|
7
|
+
...restProps
|
|
8
|
+
}: {
|
|
9
|
+
children?: Snippet
|
|
10
|
+
class?: string
|
|
11
|
+
[key: string]: any
|
|
12
|
+
} = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class="smu-numberkeyboard {className}">
|
|
16
|
+
{#if children}{@render children()}{/if}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style lang="scss">
|
|
20
|
+
.smu-numberkeyboard {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NumberKeyboard } from './NumberKeyboard.svelte'
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let {
|
|
3
|
+
show = false,
|
|
4
|
+
zIndex = 1,
|
|
5
|
+
duration = 0.3,
|
|
6
|
+
lockScroll = true,
|
|
7
|
+
customStyle = '',
|
|
8
|
+
onclick,
|
|
9
|
+
class: className = '',
|
|
10
|
+
}: {
|
|
11
|
+
show?: boolean
|
|
12
|
+
zIndex?: number
|
|
13
|
+
duration?: number
|
|
14
|
+
lockScroll?: boolean
|
|
15
|
+
customStyle?: string
|
|
16
|
+
onclick?: (e: MouseEvent) => void
|
|
17
|
+
class?: string
|
|
18
|
+
} = $props()
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#if show}
|
|
22
|
+
<div
|
|
23
|
+
class="smu-overlay {className}"
|
|
24
|
+
style="z-index: {zIndex}; animation-duration: {duration}s; {customStyle}"
|
|
25
|
+
onclick={onclick}
|
|
26
|
+
role="presentation"
|
|
27
|
+
></div>
|
|
28
|
+
{/if}
|
|
29
|
+
|
|
30
|
+
<style lang="scss">
|
|
31
|
+
.smu-overlay {
|
|
32
|
+
position: fixed;
|
|
33
|
+
top: 0;
|
|
34
|
+
left: 0;
|
|
35
|
+
z-index: 1;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
background: rgba(0, 0, 0, 0.7);
|
|
39
|
+
animation: smu-fade-in var(--smu-duration-base);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@keyframes smu-fade-in {
|
|
43
|
+
from { opacity: 0; }
|
|
44
|
+
to { opacity: 1; }
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Overlay } from './Overlay.svelte'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
class: className = '',
|
|
7
|
+
...restProps
|
|
8
|
+
}: {
|
|
9
|
+
children?: Snippet
|
|
10
|
+
class?: string
|
|
11
|
+
[key: string]: any
|
|
12
|
+
} = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class="smu-pagination {className}">
|
|
16
|
+
{#if children}{@render children()}{/if}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style lang="scss">
|
|
20
|
+
.smu-pagination {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Pagination } from './Pagination.svelte'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
class: className = '',
|
|
7
|
+
...restProps
|
|
8
|
+
}: {
|
|
9
|
+
children?: Snippet
|
|
10
|
+
class?: string
|
|
11
|
+
[key: string]: any
|
|
12
|
+
} = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class="smu-passwordinput {className}">
|
|
16
|
+
{#if children}{@render children()}{/if}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style lang="scss">
|
|
20
|
+
.smu-passwordinput {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PasswordInput } from './PasswordInput.svelte'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
class: className = '',
|
|
7
|
+
...restProps
|
|
8
|
+
}: {
|
|
9
|
+
children?: Snippet
|
|
10
|
+
class?: string
|
|
11
|
+
[key: string]: any
|
|
12
|
+
} = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class="smu-picker {className}">
|
|
16
|
+
{#if children}{@render children()}{/if}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style lang="scss">
|
|
20
|
+
.smu-picker {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Picker } from './Picker.svelte'
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
title = "",
|
|
6
|
+
nextStepText = "下一步",
|
|
7
|
+
tabs = [],
|
|
8
|
+
activeTab = $bindable(0),
|
|
9
|
+
children,
|
|
10
|
+
class: className = "",
|
|
11
|
+
}: {
|
|
12
|
+
title?: string;
|
|
13
|
+
nextStepText?: string;
|
|
14
|
+
tabs?: string[];
|
|
15
|
+
activeTab?: number;
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
class?: string;
|
|
18
|
+
} = $props();
|
|
19
|
+
|
|
20
|
+
function handleNext() {
|
|
21
|
+
if (activeTab < tabs.length - 1) {
|
|
22
|
+
activeTab++;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function handlePrev() {
|
|
27
|
+
if (activeTab > 0) {
|
|
28
|
+
activeTab--;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div class="smu-picker-group {className}">
|
|
34
|
+
{#if title || tabs.length > 0}
|
|
35
|
+
<div class="smu-picker-group__header">
|
|
36
|
+
{#if title}
|
|
37
|
+
<div class="smu-picker-group__title">{title}</div>
|
|
38
|
+
{/if}
|
|
39
|
+
{#if tabs.length > 0}
|
|
40
|
+
<div class="smu-picker-group__tabs">
|
|
41
|
+
{#each tabs as tab, i}
|
|
42
|
+
<div
|
|
43
|
+
class="smu-picker-group__tab {i === activeTab
|
|
44
|
+
? 'smu-picker-group__tab--active'
|
|
45
|
+
: ''}"
|
|
46
|
+
onclick={() => (activeTab = i)}
|
|
47
|
+
>
|
|
48
|
+
{tab}
|
|
49
|
+
</div>
|
|
50
|
+
{/each}
|
|
51
|
+
</div>
|
|
52
|
+
{/if}
|
|
53
|
+
</div>
|
|
54
|
+
{/if}
|
|
55
|
+
<div class="smu-picker-group__content">
|
|
56
|
+
{#if children}{@render children()}{/if}
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<style lang="scss">
|
|
61
|
+
.smu-picker-group {
|
|
62
|
+
background: var(--smu-background-2);
|
|
63
|
+
|
|
64
|
+
&__header {
|
|
65
|
+
padding: var(--smu-padding-md);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__title {
|
|
69
|
+
text-align: center;
|
|
70
|
+
font-size: var(--smu-font-size-lg);
|
|
71
|
+
font-weight: var(--smu-font-bold);
|
|
72
|
+
line-height: 44px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&__tabs {
|
|
76
|
+
display: flex;
|
|
77
|
+
border-bottom: 1px solid var(--smu-border-color);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__tab {
|
|
81
|
+
flex: 1;
|
|
82
|
+
padding: 8px 0;
|
|
83
|
+
text-align: center;
|
|
84
|
+
font-size: var(--smu-font-size-md);
|
|
85
|
+
color: var(--smu-gray-6);
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
|
|
88
|
+
&--active {
|
|
89
|
+
color: var(--smu-text-color);
|
|
90
|
+
font-weight: var(--smu-font-bold);
|
|
91
|
+
border-bottom: 2px solid var(--smu-primary-color);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&__content {
|
|
96
|
+
position: relative;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PickerGroup } from './PickerGroup.svelte'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
class: className = '',
|
|
7
|
+
...restProps
|
|
8
|
+
}: {
|
|
9
|
+
children?: Snippet
|
|
10
|
+
class?: string
|
|
11
|
+
[key: string]: any
|
|
12
|
+
} = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class="smu-popover {className}">
|
|
16
|
+
{#if children}{@render children()}{/if}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style lang="scss">
|
|
20
|
+
.smu-popover {
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Popover } from './Popover.svelte'
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Overlay from '../Overlay/Overlay.svelte'
|
|
3
|
+
import Icon from '../Icon/Icon.svelte'
|
|
4
|
+
import type { Snippet } from 'svelte'
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
show = $bindable(false),
|
|
8
|
+
position = 'center',
|
|
9
|
+
round = false,
|
|
10
|
+
closeable = false,
|
|
11
|
+
closeIcon = 'cross',
|
|
12
|
+
closeIconPosition = 'top-right',
|
|
13
|
+
overlay = true,
|
|
14
|
+
lockScroll = true,
|
|
15
|
+
duration = 0.3,
|
|
16
|
+
safeAreaInsetBottom = false,
|
|
17
|
+
safeAreaInsetTop = false,
|
|
18
|
+
zIndex = 2000,
|
|
19
|
+
onclose,
|
|
20
|
+
children,
|
|
21
|
+
class: className = '',
|
|
22
|
+
}: {
|
|
23
|
+
show?: boolean
|
|
24
|
+
position?: 'top' | 'bottom' | 'left' | 'right' | 'center'
|
|
25
|
+
round?: boolean
|
|
26
|
+
closeable?: boolean
|
|
27
|
+
closeIcon?: string
|
|
28
|
+
closeIconPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
29
|
+
overlay?: boolean
|
|
30
|
+
lockScroll?: boolean
|
|
31
|
+
duration?: number
|
|
32
|
+
safeAreaInsetBottom?: boolean
|
|
33
|
+
safeAreaInsetTop?: boolean
|
|
34
|
+
zIndex?: number
|
|
35
|
+
onclose?: () => void
|
|
36
|
+
children?: Snippet
|
|
37
|
+
class?: string
|
|
38
|
+
} = $props()
|
|
39
|
+
|
|
40
|
+
function close() {
|
|
41
|
+
show = false
|
|
42
|
+
onclose?.()
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
{#if show}
|
|
47
|
+
{#if overlay}
|
|
48
|
+
<Overlay {show} zIndex={zIndex} onclick={close} />
|
|
49
|
+
{/if}
|
|
50
|
+
<div
|
|
51
|
+
class="smu-popup smu-popup--{position} {round ? 'smu-popup--round' : ''} {safeAreaInsetBottom ? 'smu-safe-area-bottom' : ''} {safeAreaInsetTop ? 'smu-safe-area-top' : ''} {className}"
|
|
52
|
+
style="z-index: {zIndex}; animation-duration: {duration}s"
|
|
53
|
+
role="dialog"
|
|
54
|
+
>
|
|
55
|
+
{#if children}{@render children()}{/if}
|
|
56
|
+
{#if closeable}
|
|
57
|
+
<div class="smu-popup__close-icon smu-popup__close-icon--{closeIconPosition}" onclick={close} role="button" tabindex="0">
|
|
58
|
+
<Icon name={closeIcon} />
|
|
59
|
+
</div>
|
|
60
|
+
{/if}
|
|
61
|
+
</div>
|
|
62
|
+
{/if}
|
|
63
|
+
|
|
64
|
+
<style lang="scss">
|
|
65
|
+
.smu-popup {
|
|
66
|
+
position: fixed;
|
|
67
|
+
max-height: 100%;
|
|
68
|
+
overflow-y: auto;
|
|
69
|
+
background: var(--smu-background-2);
|
|
70
|
+
transition: transform var(--smu-duration-base);
|
|
71
|
+
-webkit-overflow-scrolling: touch;
|
|
72
|
+
|
|
73
|
+
&--center {
|
|
74
|
+
top: 50%;
|
|
75
|
+
left: 0;
|
|
76
|
+
right: 0;
|
|
77
|
+
width: fit-content;
|
|
78
|
+
max-width: calc(100vw - var(--smu-padding-md) * 2);
|
|
79
|
+
margin: 0 auto;
|
|
80
|
+
transform: translateY(-50%);
|
|
81
|
+
animation: smu-fade-in var(--smu-duration-base);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&--top {
|
|
85
|
+
top: 0;
|
|
86
|
+
left: 0;
|
|
87
|
+
width: 100%;
|
|
88
|
+
animation: smu-slide-top-in var(--smu-duration-base);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&--bottom {
|
|
92
|
+
bottom: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
animation: smu-slide-bottom-in var(--smu-duration-base);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--left {
|
|
99
|
+
top: 0;
|
|
100
|
+
left: 0;
|
|
101
|
+
height: 100%;
|
|
102
|
+
animation: smu-slide-left-in var(--smu-duration-base);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&--right {
|
|
106
|
+
top: 0;
|
|
107
|
+
right: 0;
|
|
108
|
+
height: 100%;
|
|
109
|
+
animation: smu-slide-right-in var(--smu-duration-base);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&--round {
|
|
113
|
+
&.smu-popup--top { border-radius: 0 0 16px 16px; }
|
|
114
|
+
&.smu-popup--bottom { border-radius: 16px 16px 0 0; }
|
|
115
|
+
&.smu-popup--left { border-radius: 0 16px 16px 0; }
|
|
116
|
+
&.smu-popup--right { border-radius: 16px 0 0 16px; }
|
|
117
|
+
&.smu-popup--center { border-radius: 16px; }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__close-icon {
|
|
121
|
+
position: absolute;
|
|
122
|
+
z-index: 1;
|
|
123
|
+
color: var(--smu-gray-5);
|
|
124
|
+
font-size: 22px;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
|
|
127
|
+
&--top-right { top: 16px; right: 16px; }
|
|
128
|
+
&--top-left { top: 16px; left: 16px; }
|
|
129
|
+
&--bottom-right { bottom: 16px; right: 16px; }
|
|
130
|
+
&--bottom-left { bottom: 16px; left: 16px; }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@keyframes smu-fade-in {
|
|
135
|
+
from { opacity: 0; }
|
|
136
|
+
to { opacity: 1; }
|
|
137
|
+
}
|
|
138
|
+
@keyframes smu-slide-top-in {
|
|
139
|
+
from { transform: translateY(-100%); }
|
|
140
|
+
to { transform: translateY(0); }
|
|
141
|
+
}
|
|
142
|
+
@keyframes smu-slide-bottom-in {
|
|
143
|
+
from { transform: translateY(100%); }
|
|
144
|
+
to { transform: translateY(0); }
|
|
145
|
+
}
|
|
146
|
+
@keyframes smu-slide-left-in {
|
|
147
|
+
from { transform: translateX(-100%); }
|
|
148
|
+
to { transform: translateX(0); }
|
|
149
|
+
}
|
|
150
|
+
@keyframes smu-slide-right-in {
|
|
151
|
+
from { transform: translateX(100%); }
|
|
152
|
+
to { transform: translateX(0); }
|
|
153
|
+
}
|
|
154
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Popup } from './Popup.svelte'
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let {
|
|
3
|
+
percentage = 0,
|
|
4
|
+
strokeWidth = 4,
|
|
5
|
+
color = '',
|
|
6
|
+
trackColor = '',
|
|
7
|
+
pivotText = '',
|
|
8
|
+
pivotColor = '',
|
|
9
|
+
textColor = '',
|
|
10
|
+
inactive = false,
|
|
11
|
+
showPivot = true,
|
|
12
|
+
class: className = '',
|
|
13
|
+
}: {
|
|
14
|
+
percentage?: number
|
|
15
|
+
strokeWidth?: number | string
|
|
16
|
+
color?: string
|
|
17
|
+
trackColor?: string
|
|
18
|
+
pivotText?: string
|
|
19
|
+
pivotColor?: string
|
|
20
|
+
textColor?: string
|
|
21
|
+
inactive?: boolean
|
|
22
|
+
showPivot?: boolean
|
|
23
|
+
class?: string
|
|
24
|
+
} = $props()
|
|
25
|
+
|
|
26
|
+
const bg = $derived(inactive ? 'var(--smu-gray-5)' : (color || 'var(--smu-primary-color)'))
|
|
27
|
+
const text = $derived(pivotText || `${percentage}%`)
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<div class="smu-progress {className}">
|
|
31
|
+
<span
|
|
32
|
+
class="smu-progress__track"
|
|
33
|
+
style="height: {typeof strokeWidth === 'number' ? strokeWidth + 'px' : strokeWidth}; {trackColor ? `background: ${trackColor}` : ''}"
|
|
34
|
+
>
|
|
35
|
+
<span
|
|
36
|
+
class="smu-progress__portion"
|
|
37
|
+
style="width: {percentage}%; background: {bg}"
|
|
38
|
+
>
|
|
39
|
+
{#if showPivot}
|
|
40
|
+
<span
|
|
41
|
+
class="smu-progress__pivot"
|
|
42
|
+
style="color: {textColor || 'var(--smu-white)'}; background: {pivotColor || bg}"
|
|
43
|
+
>{text}</span>
|
|
44
|
+
{/if}
|
|
45
|
+
</span>
|
|
46
|
+
</span>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<style lang="scss">
|
|
50
|
+
.smu-progress {
|
|
51
|
+
position: relative;
|
|
52
|
+
height: 4px;
|
|
53
|
+
border-radius: var(--smu-radius-max);
|
|
54
|
+
|
|
55
|
+
&__track {
|
|
56
|
+
position: relative;
|
|
57
|
+
display: block;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
background: var(--smu-gray-3);
|
|
61
|
+
border-radius: inherit;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__portion {
|
|
65
|
+
position: absolute;
|
|
66
|
+
left: 0;
|
|
67
|
+
height: 100%;
|
|
68
|
+
background: var(--smu-primary-color);
|
|
69
|
+
border-radius: inherit;
|
|
70
|
+
transition: width var(--smu-duration-base);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&__pivot {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 50%;
|
|
76
|
+
right: 0;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
min-width: 3.6em;
|
|
79
|
+
padding: 0 5px;
|
|
80
|
+
font-size: var(--smu-font-size-xs);
|
|
81
|
+
line-height: 1.6;
|
|
82
|
+
text-align: center;
|
|
83
|
+
word-break: keep-all;
|
|
84
|
+
background: var(--smu-primary-color);
|
|
85
|
+
border-radius: 1em;
|
|
86
|
+
transform: translate(50%, -50%);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Progress } from './Progress.svelte'
|