@hyvor/design 0.0.66 → 0.0.68
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/dist/components/ActionList/ActionList.svelte +2 -7
- package/dist/components/ActionList/ActionListGroup.svelte +24 -29
- package/dist/components/ActionList/ActionListItem.svelte +86 -88
- package/dist/components/ActionList/Selected.svelte +17 -20
- package/dist/components/Avatar/Avatar.svelte +7 -11
- package/dist/components/Avatar/AvatarStack.svelte +16 -20
- package/dist/components/Base/Base.svelte +3 -3
- package/dist/components/Box/Box.svelte +8 -8
- package/dist/components/Button/Button.svelte +33 -42
- package/dist/components/Button/ButtonGroup.svelte +6 -6
- package/dist/components/Callout/Callout.svelte +88 -86
- package/dist/components/Callout/Callout.svelte.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.svelte +113 -121
- package/dist/components/CodeBlock/CodeBlock.svelte +26 -23
- package/dist/components/CodeBlock/getCode.js +6 -6
- package/dist/components/CodeBlock/hljs.scss +189 -191
- package/dist/components/CodeBlock/prism.scss +370 -7
- package/dist/components/ColorPicker/ColorPicker.svelte +42 -42
- package/dist/components/Dark/DarkProvider.svelte +9 -9
- package/dist/components/Dark/DarkToggle.svelte +7 -10
- package/dist/components/Divider/Divider.svelte +6 -7
- package/dist/components/Dropdown/Dropdown.svelte +33 -108
- package/dist/components/Dropdown/DropdownContent.svelte +120 -0
- package/dist/components/Dropdown/DropdownContent.svelte.d.ts +24 -0
- package/dist/components/FormControl/Caption.svelte +9 -9
- package/dist/components/FormControl/FormControl.svelte +18 -18
- package/dist/components/FormControl/InputGroup.svelte +7 -8
- package/dist/components/FormControl/Label.svelte +5 -5
- package/dist/components/FormControl/Validation.svelte +18 -16
- package/dist/components/FormControl/Validation.svelte.d.ts +1 -1
- package/dist/components/HyvorBar/BarProducts.svelte +52 -0
- package/dist/components/HyvorBar/BarProducts.svelte.d.ts +39 -0
- package/dist/components/HyvorBar/BarSupport.svelte +119 -0
- package/dist/components/HyvorBar/BarSupport.svelte.d.ts +19 -0
- package/dist/components/HyvorBar/BarUpdates.svelte +58 -0
- package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +18 -0
- package/dist/components/HyvorBar/BarUpdatesList.svelte +134 -0
- package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +18 -0
- package/dist/components/HyvorBar/BarUser.svelte +60 -0
- package/dist/components/HyvorBar/BarUser.svelte.d.ts +16 -0
- package/dist/components/HyvorBar/BarUserPreview.svelte +42 -0
- package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +14 -0
- package/dist/components/HyvorBar/HyvorBar.svelte +150 -0
- package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +19 -0
- package/dist/components/HyvorBar/bar.d.ts +33 -0
- package/dist/components/HyvorBar/bar.js +74 -0
- package/dist/components/HyvorBar/img/G2.svelte +9 -0
- package/dist/components/HyvorBar/img/G2.svelte.d.ts +23 -0
- package/dist/components/HyvorBar/img/Trustpilot.svelte +11 -0
- package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +23 -0
- package/dist/components/IconButton/IconButton.svelte +19 -23
- package/dist/components/IconMessage/IconMessage.svelte +84 -47
- package/dist/components/IconMessage/IconMessage.svelte.d.ts +9 -1
- package/dist/components/Internationalization/InternationalizationProvider.svelte +2 -2
- package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +1 -1
- package/dist/components/Internationalization/LanguageToggle.svelte +33 -36
- package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +2 -2
- package/dist/components/Internationalization/T.svelte.d.ts +3 -3
- package/dist/components/Internationalization/i18n.d.ts +4 -4
- package/dist/components/Internationalization/i18n.js +13 -11
- package/dist/components/Internationalization/t.d.ts +3 -3
- package/dist/components/Internationalization/t.js +4 -4
- package/dist/components/Internationalization/types.d.ts +1 -1
- package/dist/components/Link/Link.svelte +53 -58
- package/dist/components/Loader/LoadButton.svelte +15 -29
- package/dist/components/Loader/Loader.svelte +56 -69
- package/dist/components/Modal/ConfirmModalProvider.svelte +18 -36
- package/dist/components/Modal/Modal.svelte +134 -164
- package/dist/components/Modal/ModalFooter.svelte +23 -26
- package/dist/components/Modal/confirm.d.ts +1 -1
- package/dist/components/Modal/confirm.js +4 -4
- package/dist/components/Modal/modal-types.d.ts +2 -2
- package/dist/components/NavLink/NavLink.svelte +78 -86
- package/dist/components/Radio/Radio.svelte +23 -31
- package/dist/components/Slider/Slider.svelte +71 -80
- package/dist/components/Slider/Slider.svelte.d.ts +0 -1
- package/dist/components/SplitControl/SplitControl.svelte +28 -42
- package/dist/components/Switch/Switch.svelte +60 -65
- package/dist/components/TabNav/TabNav.svelte +6 -10
- package/dist/components/TabNav/TabNavItem.svelte +36 -43
- package/dist/components/Table/Table.svelte +7 -4
- package/dist/components/Table/TableRow.svelte +23 -23
- package/dist/components/Tag/Tag.svelte +28 -36
- package/dist/components/Text/Text.svelte +15 -22
- package/dist/components/TextInput/TextInput.svelte +26 -26
- package/dist/components/Textarea/Textarea.svelte +42 -50
- package/dist/components/Textarea/Textarea.svelte.d.ts +1 -1
- package/dist/components/Toast/ToastIcon.svelte +29 -31
- package/dist/components/Toast/ToastMessage.svelte +33 -39
- package/dist/components/Toast/ToastProvider.svelte +16 -16
- package/dist/components/Toast/cleaner.js +5 -5
- package/dist/components/Toast/toast.d.ts +2 -2
- package/dist/components/Toast/toast.js +10 -10
- package/dist/components/Tooltip/Tooltip.svelte +82 -83
- package/dist/components/directives/clickOutside.js +4 -4
- package/dist/components/directives/debounce.d.ts +1 -0
- package/dist/components/directives/debounce.js +8 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/index.css +31 -33
- package/dist/marketing/Container/Container.svelte +8 -8
- package/dist/marketing/Docs/Content/Content.svelte +8 -7
- package/dist/marketing/Docs/Content/DocsImage.svelte +52 -62
- package/dist/marketing/Docs/Docs.svelte +21 -24
- package/dist/marketing/Docs/Nav/Nav.svelte +21 -22
- package/dist/marketing/Docs/Nav/NavCategory.svelte +28 -28
- package/dist/marketing/Docs/Nav/NavItem.svelte +21 -24
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte +22 -25
- package/dist/marketing/Docs/Toc.svelte +17 -19
- package/dist/marketing/Document/Document.svelte +59 -0
- package/dist/marketing/Document/Document.svelte.d.ts +19 -0
- package/dist/marketing/Document/DocumentTitle.svelte +63 -0
- package/dist/marketing/Document/DocumentTitle.svelte.d.ts +20 -0
- package/dist/marketing/Footer/Footer.svelte +111 -119
- package/dist/marketing/Footer/FooterLinkList.svelte +24 -26
- package/dist/marketing/Header/Header.svelte +7 -15
- package/dist/marketing/Logo/LogoBlogs.svelte +41 -0
- package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +16 -0
- package/dist/marketing/Logo/LogoCore.svelte +41 -0
- package/dist/marketing/Logo/LogoCore.svelte.d.ts +16 -0
- package/dist/marketing/Logo/LogoFortguard.svelte +49 -0
- package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +16 -0
- package/dist/marketing/Logo/LogoTalk.svelte +27 -0
- package/dist/marketing/Logo/LogoTalk.svelte.d.ts +16 -0
- package/dist/marketing/index.d.ts +1 -0
- package/dist/marketing/index.js +1 -0
- package/dist/stores/dark.js +8 -8
- package/dist/variables.scss +41 -48
- package/package.json +59 -58
|
@@ -3,93 +3,85 @@ export let active = false;
|
|
|
3
3
|
export let disabled = false;
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<a
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
<a
|
|
7
|
+
{href}
|
|
8
|
+
class:active
|
|
9
|
+
class:disabled
|
|
10
|
+
on:keyup
|
|
11
|
+
on:keydown
|
|
12
|
+
on:keypress
|
|
13
|
+
on:focus
|
|
14
|
+
on:blur
|
|
15
|
+
on:click
|
|
16
|
+
on:mouseover
|
|
17
|
+
on:mouseenter
|
|
18
|
+
on:mouseleave
|
|
19
|
+
on:change
|
|
20
20
|
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<slot name="end" />
|
|
37
|
-
</span>
|
|
38
|
-
{/if}
|
|
21
|
+
{#if $$slots.start}
|
|
22
|
+
<span class="start">
|
|
23
|
+
<slot name="start" />
|
|
24
|
+
</span>
|
|
25
|
+
{/if}
|
|
26
|
+
|
|
27
|
+
<span class="middle">
|
|
28
|
+
<slot />
|
|
29
|
+
</span>
|
|
30
|
+
|
|
31
|
+
{#if $$slots.end}
|
|
32
|
+
<span class="end">
|
|
33
|
+
<slot name="end" />
|
|
34
|
+
</span>
|
|
35
|
+
{/if}
|
|
39
36
|
</a>
|
|
40
37
|
|
|
41
|
-
|
|
42
38
|
<style>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
</style>
|
|
39
|
+
a {
|
|
40
|
+
display: flex;
|
|
41
|
+
padding: 12px 29px;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
letter-spacing: 0.3px;
|
|
44
|
+
border-left: 3px solid transparent;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
align-items: center;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
a:hover {
|
|
50
|
+
background-color: var(--hover);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
a.active {
|
|
54
|
+
background-color: var(--accent-lightest);
|
|
55
|
+
border-left: 3px solid var(--accent);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
a.disabled {
|
|
59
|
+
cursor: not-allowed;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
opacity: 0.5;
|
|
62
|
+
/* hover */
|
|
63
|
+
background-color: transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.start,
|
|
67
|
+
.middle,
|
|
68
|
+
.end {
|
|
69
|
+
display: inline-flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.middle {
|
|
74
|
+
flex: 1;
|
|
75
|
+
/* display: flex; */
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.start {
|
|
81
|
+
margin-right: 8px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.end {
|
|
85
|
+
margin-left: 8px;
|
|
86
|
+
}
|
|
87
|
+
</style>
|
|
@@ -4,39 +4,31 @@ export let disabled = false;
|
|
|
4
4
|
export let input = {};
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
<label
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{...$$restProps}
|
|
31
|
-
/>
|
|
32
|
-
|
|
33
|
-
<span class="checkmark"></span>
|
|
34
|
-
|
|
35
|
-
<slot />
|
|
36
|
-
|
|
7
|
+
<label class:disabled>
|
|
8
|
+
<input
|
|
9
|
+
type="radio"
|
|
10
|
+
{disabled}
|
|
11
|
+
bind:group
|
|
12
|
+
bind:this={input}
|
|
13
|
+
{value}
|
|
14
|
+
on:keyup
|
|
15
|
+
on:keydown
|
|
16
|
+
on:keypress
|
|
17
|
+
on:focus
|
|
18
|
+
on:blur
|
|
19
|
+
on:click
|
|
20
|
+
on:mouseover
|
|
21
|
+
on:mouseenter
|
|
22
|
+
on:mouseleave
|
|
23
|
+
on:change
|
|
24
|
+
{...$$restProps}
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<span class="checkmark"></span>
|
|
28
|
+
|
|
29
|
+
<slot />
|
|
37
30
|
</label>
|
|
38
31
|
|
|
39
|
-
|
|
40
32
|
<style>label {
|
|
41
33
|
position: relative;
|
|
42
34
|
padding-left: 30px;
|
|
@@ -3,7 +3,6 @@ export let min;
|
|
|
3
3
|
export let max;
|
|
4
4
|
export let value;
|
|
5
5
|
export let step = 1;
|
|
6
|
-
export let disabled = false;
|
|
7
6
|
export let dots = false;
|
|
8
7
|
const dispatch = createEventDispatcher();
|
|
9
8
|
function toStep(value2) {
|
|
@@ -36,93 +35,85 @@ function handleMousemove(event) {
|
|
|
36
35
|
</script>
|
|
37
36
|
|
|
38
37
|
<div class="slider">
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<button class="handle" style="left: {progress}%">
|
|
48
|
-
<span class="tip">
|
|
49
|
-
{value}
|
|
50
|
-
</span>
|
|
51
|
-
</button>
|
|
38
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
39
|
+
<div class="track" bind:this={trackEl} class:dragging on:mousedown={handleMousedown}>
|
|
40
|
+
<div class="progress" style="width: {progress}%"></div>
|
|
41
|
+
<button class="handle" style="left: {progress}%">
|
|
42
|
+
<span class="tip">
|
|
43
|
+
{value}
|
|
44
|
+
</span>
|
|
45
|
+
</button>
|
|
52
46
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{/each}
|
|
60
|
-
{/if}
|
|
61
|
-
</div>
|
|
47
|
+
{#if dots}
|
|
48
|
+
{#each Array.from({ length: (max - min) / step + 1 }, (_, i) => i) as i}
|
|
49
|
+
<div class="dot" style="left: {(i * 100) / ((max - min) / step)}%"></div>
|
|
50
|
+
{/each}
|
|
51
|
+
{/if}
|
|
52
|
+
</div>
|
|
62
53
|
</div>
|
|
63
54
|
|
|
64
55
|
<style>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
56
|
+
.track {
|
|
57
|
+
background-color: var(--input);
|
|
58
|
+
height: 10px;
|
|
59
|
+
border-radius: 20px;
|
|
60
|
+
position: relative;
|
|
61
|
+
}
|
|
62
|
+
.handle {
|
|
63
|
+
background-color: var(--accent);
|
|
64
|
+
width: 20px;
|
|
65
|
+
height: 20px;
|
|
66
|
+
border-radius: 50%;
|
|
67
|
+
position: absolute;
|
|
68
|
+
top: 50%;
|
|
69
|
+
transform: translate(-50%, -50%);
|
|
70
|
+
cursor: grab;
|
|
71
|
+
z-index: 1;
|
|
72
|
+
transition: 0.2s box-shadow;
|
|
73
|
+
}
|
|
74
|
+
.handle:hover {
|
|
75
|
+
box-shadow: 0 0 0 2px var(--accent-light);
|
|
76
|
+
}
|
|
77
|
+
.tip {
|
|
78
|
+
position: absolute;
|
|
79
|
+
bottom: 100%;
|
|
80
|
+
margin-bottom: 3px;
|
|
81
|
+
left: 50%;
|
|
82
|
+
transform: translateX(-50%);
|
|
83
|
+
padding: 3px 6px;
|
|
84
|
+
border-radius: 5px;
|
|
94
85
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
86
|
+
/* from Tooltip */
|
|
87
|
+
--local-bg: #24292f;
|
|
88
|
+
--local-color: #fff;
|
|
98
89
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
background-color: var(--local-bg);
|
|
91
|
+
color: var(--local-color);
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
103
94
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
95
|
+
.dot {
|
|
96
|
+
background-color: var(--accent-light);
|
|
97
|
+
z-index: 0;
|
|
98
|
+
width: 8px;
|
|
99
|
+
height: 8px;
|
|
100
|
+
border-radius: 50%;
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: 50%;
|
|
103
|
+
transform: translate(-50%, -50%);
|
|
104
|
+
}
|
|
114
105
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
.handle:hover .tip,
|
|
107
|
+
.track.dragging .tip {
|
|
108
|
+
display: block;
|
|
109
|
+
}
|
|
119
110
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
111
|
+
.track.dragging,
|
|
112
|
+
.track.dragging .handle {
|
|
113
|
+
cursor: grabbing;
|
|
114
|
+
}
|
|
124
115
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
116
|
+
.track.dragging .handle {
|
|
117
|
+
box-shadow: 0 0 0 3px var(--accent-light);
|
|
118
|
+
}
|
|
128
119
|
</style>
|
|
@@ -6,52 +6,38 @@ export let column = false;
|
|
|
6
6
|
export let flex = [1, 2];
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
+
<div class="split-control" class:has-nested={$$slots.nested} class:column>
|
|
10
|
+
<div class="left" style:flex={flex[0]}>
|
|
11
|
+
<div class="label-wrap">
|
|
12
|
+
{#if $$slots.label}
|
|
13
|
+
<slot name="label" />
|
|
14
|
+
{:else}
|
|
15
|
+
<Label>{label}</Label>
|
|
16
|
+
{/if}
|
|
17
|
+
</div>
|
|
9
18
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<div class="label-wrap">
|
|
22
|
-
{#if $$slots.label}
|
|
23
|
-
<slot name="label" />
|
|
24
|
-
{:else}
|
|
25
|
-
<Label>{label}</Label>
|
|
26
|
-
{/if}
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
{#if $$slots.caption || caption}
|
|
30
|
-
<div class="caption-wrap">
|
|
31
|
-
{#if $$slots.caption}
|
|
32
|
-
<slot name="caption" />
|
|
33
|
-
{:else if caption}
|
|
34
|
-
<Caption>{caption}</Caption>
|
|
35
|
-
{/if}
|
|
36
|
-
</div>
|
|
37
|
-
{/if}
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
{#if $$slots.default}
|
|
41
|
-
<div
|
|
42
|
-
class="right"
|
|
43
|
-
style:flex={flex[1]}
|
|
44
|
-
>
|
|
45
|
-
<slot></slot>
|
|
46
|
-
</div>
|
|
47
|
-
{/if}
|
|
19
|
+
{#if $$slots.caption || caption}
|
|
20
|
+
<div class="caption-wrap">
|
|
21
|
+
{#if $$slots.caption}
|
|
22
|
+
<slot name="caption" />
|
|
23
|
+
{:else if caption}
|
|
24
|
+
<Caption>{caption}</Caption>
|
|
25
|
+
{/if}
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
|
28
|
+
</div>
|
|
48
29
|
|
|
30
|
+
{#if $$slots.default}
|
|
31
|
+
<div class="right" style:flex={flex[1]}>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
</div>
|
|
34
|
+
{/if}
|
|
49
35
|
</div>
|
|
50
36
|
|
|
51
37
|
{#if $$slots.nested}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
38
|
+
<div class="nested">
|
|
39
|
+
<slot name="nested"></slot>
|
|
40
|
+
</div>
|
|
55
41
|
{/if}
|
|
56
42
|
|
|
57
43
|
<style>.split-control {
|
|
@@ -89,4 +75,4 @@ export let flex = [1, 2];
|
|
|
89
75
|
|
|
90
76
|
.caption-wrap {
|
|
91
77
|
margin-top: 4px;
|
|
92
|
-
}</style>
|
|
78
|
+
}</style>
|
|
@@ -3,60 +3,55 @@ export let input = {};
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<label class="switch-wrap">
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<slot />
|
|
31
|
-
</span>
|
|
32
|
-
{/if}
|
|
6
|
+
<span class="switch">
|
|
7
|
+
<input
|
|
8
|
+
type="checkbox"
|
|
9
|
+
bind:checked
|
|
10
|
+
bind:this={input}
|
|
11
|
+
{...$$restProps}
|
|
12
|
+
on:keyup
|
|
13
|
+
on:keydown
|
|
14
|
+
on:keypress
|
|
15
|
+
on:focus
|
|
16
|
+
on:blur
|
|
17
|
+
on:click
|
|
18
|
+
on:mouseover
|
|
19
|
+
on:mouseenter
|
|
20
|
+
on:mouseleave
|
|
21
|
+
on:change
|
|
22
|
+
/>
|
|
23
|
+
<span class="slider"></span>
|
|
24
|
+
</span>
|
|
25
|
+
{#if $$slots.default}
|
|
26
|
+
<span class="message">
|
|
27
|
+
<slot />
|
|
28
|
+
</span>
|
|
29
|
+
{/if}
|
|
33
30
|
</label>
|
|
34
31
|
|
|
35
32
|
<style>
|
|
33
|
+
.switch-wrap {
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
}
|
|
36
38
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
}
|
|
39
|
+
.message {
|
|
40
|
+
margin-left: 8px;
|
|
41
|
+
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
.switch {
|
|
44
|
+
position: relative;
|
|
45
|
+
display: inline-block;
|
|
46
|
+
width: 40px;
|
|
47
|
+
height: 24px;
|
|
48
|
+
vertical-align: middle;
|
|
49
|
+
}
|
|
46
50
|
|
|
47
|
-
.switch {
|
|
48
|
-
position: relative;
|
|
49
|
-
display: inline-block;
|
|
50
|
-
width:40px;
|
|
51
|
-
height:24px;
|
|
52
|
-
vertical-align: middle;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
51
|
input {
|
|
56
|
-
|
|
52
|
+
opacity: 0;
|
|
57
53
|
}
|
|
58
54
|
|
|
59
|
-
|
|
60
55
|
.slider {
|
|
61
56
|
position: absolute;
|
|
62
57
|
cursor: pointer;
|
|
@@ -65,41 +60,41 @@ export let input = {};
|
|
|
65
60
|
right: 0;
|
|
66
61
|
bottom: 0;
|
|
67
62
|
background-color: var(--input);
|
|
68
|
-
transition: .2s;
|
|
63
|
+
transition: 0.2s;
|
|
69
64
|
border-radius: 30px;
|
|
70
65
|
}
|
|
71
66
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
.slider:hover {
|
|
68
|
+
box-shadow: 0 0 0 2px var(--accent-light);
|
|
69
|
+
}
|
|
70
|
+
|
|
76
71
|
.slider:before {
|
|
77
72
|
position: absolute;
|
|
78
|
-
content:
|
|
73
|
+
content: '';
|
|
79
74
|
border-radius: 50%;
|
|
80
75
|
background-color: var(--accent-text);
|
|
81
|
-
transition: .1s;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
76
|
+
transition: 0.1s;
|
|
77
|
+
width: 18px;
|
|
78
|
+
height: 18px;
|
|
79
|
+
left: 3px;
|
|
80
|
+
top: 3px;
|
|
81
|
+
bottom: 3px;
|
|
87
82
|
}
|
|
88
|
-
|
|
83
|
+
|
|
89
84
|
input:checked + .slider {
|
|
90
85
|
background-color: var(--accent);
|
|
91
86
|
}
|
|
92
|
-
|
|
87
|
+
|
|
93
88
|
input:focus-visible + .slider {
|
|
94
89
|
box-shadow: 0 0 0 3px var(--accent-light);
|
|
95
90
|
}
|
|
96
91
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
.switch:active .slider,
|
|
93
|
+
input:active + .slider {
|
|
94
|
+
box-shadow: 0 0 0 3px var(--accent-light);
|
|
95
|
+
}
|
|
96
|
+
|
|
101
97
|
input:checked + .slider:before {
|
|
102
98
|
transform: translateX(16px);
|
|
103
99
|
}
|
|
104
|
-
|
|
105
|
-
</style>
|
|
100
|
+
</style>
|