@hyvor/design 0.0.67 → 1.0.3
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 +21 -13
- package/dist/components/ActionList/ActionList.svelte.d.ts +8 -20
- package/dist/components/ActionList/ActionListGroup.svelte +40 -35
- package/dist/components/ActionList/ActionListGroup.svelte.d.ts +8 -20
- package/dist/components/ActionList/ActionListItem.svelte +129 -107
- package/dist/components/ActionList/ActionListItem.svelte.d.ts +27 -25
- package/dist/components/ActionList/Selected.svelte +27 -24
- package/dist/components/ActionList/Selected.svelte.d.ts +6 -17
- package/dist/components/Avatar/Avatar.svelte +22 -19
- package/dist/components/Avatar/Avatar.svelte.d.ts +7 -18
- package/dist/components/Avatar/AvatarStack.svelte +29 -27
- package/dist/components/Avatar/AvatarStack.svelte.d.ts +6 -18
- package/dist/components/Base/Base.svelte +16 -8
- package/dist/components/Base/Base.svelte.d.ts +6 -18
- package/dist/components/Box/Box.svelte +16 -9
- package/dist/components/Box/Box.svelte.d.ts +7 -19
- package/dist/components/Button/Button.svelte +65 -47
- package/dist/components/Button/Button.svelte.d.ts +16 -39
- package/dist/components/Button/ButtonGroup.svelte +14 -6
- package/dist/components/Button/ButtonGroup.svelte.d.ts +5 -27
- package/dist/components/Callout/Callout.svelte +110 -87
- package/dist/components/Callout/Callout.svelte.d.ts +11 -22
- package/dist/components/Checkbox/Checkbox.svelte +156 -144
- package/dist/components/Checkbox/Checkbox.svelte.d.ts +11 -34
- package/dist/components/CodeBlock/CodeBlock.svelte +45 -32
- package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +6 -17
- package/dist/components/CodeBlock/getCode.js +8 -6
- package/dist/components/CodeBlock/hljs.scss +189 -191
- package/dist/components/CodeBlock/prism.scss +370 -7
- package/dist/components/ColorPicker/ColorPicker.svelte +75 -56
- package/dist/components/ColorPicker/ColorPicker.svelte.d.ts +25 -19
- package/dist/components/Dark/DarkProvider.svelte +16 -14
- package/dist/components/Dark/DarkProvider.svelte.d.ts +16 -12
- package/dist/components/Dark/DarkToggle.svelte +15 -16
- package/dist/components/Dark/DarkToggle.svelte.d.ts +16 -12
- package/dist/components/Divider/Divider.svelte +23 -13
- package/dist/components/Divider/Divider.svelte.d.ts +9 -20
- package/dist/components/Dropdown/Dropdown.svelte +58 -114
- package/dist/components/Dropdown/Dropdown.svelte.d.ts +13 -24
- package/dist/components/Dropdown/DropdownContent.svelte +152 -0
- package/dist/components/Dropdown/DropdownContent.svelte.d.ts +12 -0
- package/dist/components/FormControl/Caption.svelte +18 -11
- package/dist/components/FormControl/Caption.svelte.d.ts +7 -19
- package/dist/components/FormControl/FormControl.svelte +28 -19
- package/dist/components/FormControl/FormControl.svelte.d.ts +6 -27
- package/dist/components/FormControl/InputGroup.svelte +22 -15
- package/dist/components/FormControl/InputGroup.svelte.d.ts +7 -19
- package/dist/components/FormControl/Label.svelte +15 -6
- package/dist/components/FormControl/Label.svelte.d.ts +6 -27
- package/dist/components/FormControl/Validation.svelte +30 -19
- package/dist/components/FormControl/Validation.svelte.d.ts +9 -21
- package/dist/components/HyvorBar/BarProducts.svelte +71 -0
- package/dist/components/HyvorBar/BarProducts.svelte.d.ts +32 -0
- package/dist/components/HyvorBar/BarSupport.svelte +183 -0
- package/dist/components/HyvorBar/BarSupport.svelte.d.ts +8 -0
- package/dist/components/HyvorBar/BarUpdates.svelte +68 -0
- package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +7 -0
- package/dist/components/HyvorBar/BarUpdatesList.svelte +159 -0
- package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +7 -0
- package/dist/components/HyvorBar/BarUser.svelte +72 -0
- package/dist/components/HyvorBar/BarUser.svelte.d.ts +5 -0
- package/dist/components/HyvorBar/BarUserPreview.svelte +43 -0
- package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +18 -0
- package/dist/components/HyvorBar/HyvorBar.svelte +183 -0
- package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +8 -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 +26 -0
- package/dist/components/HyvorBar/img/Trustpilot.svelte +11 -0
- package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +26 -0
- package/dist/components/IconButton/IconButton.svelte +49 -32
- package/dist/components/IconButton/IconButton.svelte.d.ts +10 -33
- package/dist/components/IconMessage/IconMessage.svelte +157 -51
- package/dist/components/IconMessage/IconMessage.svelte.d.ts +19 -27
- package/dist/components/Internationalization/InternationalizationProvider.svelte +15 -8
- package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +7 -19
- package/dist/components/Internationalization/LanguageToggle.svelte +80 -57
- package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +11 -22
- package/dist/components/Internationalization/T.svelte +158 -114
- package/dist/components/Internationalization/T.svelte.d.ts +17 -15
- package/dist/components/Internationalization/i18n.d.ts +3 -5
- package/dist/components/Internationalization/i18n.js +13 -11
- package/dist/components/Internationalization/t.d.ts +2 -3
- package/dist/components/Internationalization/t.js +4 -4
- package/dist/components/Internationalization/types.d.ts +2 -1
- package/dist/components/Link/Link.svelte +68 -61
- package/dist/components/Link/Link.svelte.d.ts +11 -34
- package/dist/components/Loader/LoadButton.svelte +39 -38
- package/dist/components/Loader/LoadButton.svelte.d.ts +29 -42
- package/dist/components/Loader/Loader.svelte +121 -107
- package/dist/components/Loader/Loader.svelte.d.ts +15 -27
- package/dist/components/Modal/ConfirmModalProvider.svelte +41 -51
- package/dist/components/Modal/ConfirmModalProvider.svelte.d.ts +3 -14
- package/dist/components/Modal/Modal.svelte +202 -203
- package/dist/components/Modal/Modal.svelte.d.ts +31 -29
- package/dist/components/Modal/ModalFooter.svelte +36 -31
- package/dist/components/Modal/ModalFooter.svelte.d.ts +22 -18
- package/dist/components/Modal/confirm.d.ts +2 -2
- package/dist/components/Modal/confirm.js +4 -4
- package/dist/components/Modal/modal-types.d.ts +4 -4
- package/dist/components/NavLink/NavLink.svelte +94 -89
- package/dist/components/NavLink/NavLink.svelte.d.ts +11 -33
- package/dist/components/Radio/Radio.svelte +46 -35
- package/dist/components/Radio/Radio.svelte.d.ts +10 -33
- package/dist/components/Slider/Slider.svelte +129 -120
- package/dist/components/Slider/Slider.svelte.d.ts +24 -20
- package/dist/components/SplitControl/SplitControl.svelte +43 -48
- package/dist/components/SplitControl/SplitControl.svelte.d.ts +11 -24
- package/dist/components/Switch/Switch.svelte +77 -67
- package/dist/components/Switch/Switch.svelte.d.ts +8 -31
- package/dist/components/TabNav/TabNav.svelte +33 -23
- package/dist/components/TabNav/TabNav.svelte.d.ts +7 -19
- package/dist/components/TabNav/TabNavItem.svelte +65 -51
- package/dist/components/TabNav/TabNavItem.svelte.d.ts +10 -24
- package/dist/components/Table/Table.svelte +17 -7
- package/dist/components/Table/Table.svelte.d.ts +7 -19
- package/dist/components/Table/TableRow.svelte +32 -24
- package/dist/components/Table/TableRow.svelte.d.ts +7 -19
- package/dist/components/Tag/Tag.svelte +75 -49
- package/dist/components/Tag/Tag.svelte.d.ts +16 -39
- package/dist/components/Text/Text.svelte +33 -26
- package/dist/components/Text/Text.svelte.d.ts +10 -22
- package/dist/components/TextInput/TextInput.svelte +54 -33
- package/dist/components/TextInput/TextInput.svelte.d.ts +12 -36
- package/dist/components/Textarea/Textarea.svelte +68 -46
- package/dist/components/Textarea/Textarea.svelte.d.ts +13 -37
- package/dist/components/Toast/ToastIcon.svelte +55 -46
- package/dist/components/Toast/ToastIcon.svelte.d.ts +5 -16
- package/dist/components/Toast/ToastMessage.svelte +42 -41
- package/dist/components/Toast/ToastMessage.svelte.d.ts +5 -16
- package/dist/components/Toast/ToastProvider.svelte +22 -20
- package/dist/components/Toast/ToastProvider.svelte.d.ts +16 -12
- package/dist/components/Toast/cleaner.js +5 -5
- package/dist/components/Toast/toast.d.ts +3 -3
- package/dist/components/Toast/toast.js +10 -10
- package/dist/components/Tooltip/Tooltip.svelte +163 -148
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +35 -23
- 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 +15 -9
- package/dist/marketing/Container/Container.svelte.d.ts +6 -18
- package/dist/marketing/Docs/Content/Content.svelte +48 -35
- package/dist/marketing/Docs/Content/Content.svelte.d.ts +5 -16
- package/dist/marketing/Docs/Content/DocsImage.svelte +67 -69
- package/dist/marketing/Docs/Content/DocsImage.svelte.d.ts +9 -20
- package/dist/marketing/Docs/Docs.svelte +28 -25
- package/dist/marketing/Docs/Docs.svelte.d.ts +6 -29
- package/dist/marketing/Docs/Nav/Nav.svelte +96 -70
- package/dist/marketing/Docs/Nav/Nav.svelte.d.ts +5 -16
- package/dist/marketing/Docs/Nav/NavCategory.svelte +39 -29
- package/dist/marketing/Docs/Nav/NavCategory.svelte.d.ts +8 -20
- package/dist/marketing/Docs/Nav/NavItem.svelte +30 -26
- package/dist/marketing/Docs/Nav/NavItem.svelte.d.ts +6 -18
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte +22 -25
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte.d.ts +22 -19
- package/dist/marketing/Docs/Toc.svelte +64 -56
- package/dist/marketing/Docs/Toc.svelte.d.ts +3 -14
- package/dist/marketing/Document/Document.svelte +15 -8
- package/dist/marketing/Document/Document.svelte.d.ts +7 -19
- package/dist/marketing/Document/DocumentTitle.svelte +65 -54
- package/dist/marketing/Document/DocumentTitle.svelte.d.ts +9 -20
- package/dist/marketing/Footer/Footer.svelte +154 -145
- package/dist/marketing/Footer/Footer.svelte.d.ts +8 -20
- package/dist/marketing/Footer/FooterLinkList.svelte +31 -27
- package/dist/marketing/Footer/FooterLinkList.svelte.d.ts +6 -18
- package/dist/marketing/Header/Header.svelte +47 -37
- package/dist/marketing/Header/Header.svelte.d.ts +10 -22
- package/dist/marketing/Logo/LogoBlogs.svelte +46 -0
- package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +5 -0
- package/dist/marketing/Logo/LogoCore.svelte +46 -0
- package/dist/marketing/Logo/LogoCore.svelte.d.ts +5 -0
- package/dist/marketing/Logo/LogoFortguard.svelte +54 -0
- package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +5 -0
- package/dist/marketing/Logo/LogoTalk.svelte +32 -0
- package/dist/marketing/Logo/LogoTalk.svelte.d.ts +5 -0
- package/dist/stores/dark.d.ts +0 -1
- package/dist/stores/dark.js +8 -8
- package/dist/variables.scss +41 -48
- package/package.json +59 -58
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
title: {};
|
|
13
|
-
default: {};
|
|
14
|
-
text: {};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export type CalloutProps = typeof __propDef.props;
|
|
18
|
-
export type CalloutEvents = typeof __propDef.events;
|
|
19
|
-
export type CalloutSlots = typeof __propDef.slots;
|
|
20
|
-
export default class Callout extends SvelteComponent<CalloutProps, CalloutEvents, CalloutSlots> {
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
declare const Callout: import("svelte").Component<{
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
type?: "info" | "success" | "warning" | "danger" | "soft";
|
|
5
|
+
title?: string | Snippet;
|
|
6
|
+
icon?: Snippet;
|
|
7
|
+
text?: string | Snippet;
|
|
8
|
+
children?: Snippet;
|
|
9
|
+
}, {}, "">;
|
|
10
|
+
type Callout = ReturnType<typeof Callout>;
|
|
11
|
+
export default Callout;
|
|
@@ -1,149 +1,161 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createBubbler, handlers } from 'svelte/legacy';
|
|
3
|
+
|
|
4
|
+
const bubble = createBubbler();
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
checked?: boolean | undefined;
|
|
8
|
+
group?: (number | string)[];
|
|
9
|
+
value?: string | number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
input?: HTMLInputElement;
|
|
12
|
+
children?: import('svelte').Snippet;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
checked = $bindable(undefined),
|
|
18
|
+
group = $bindable([]),
|
|
19
|
+
value = 'on',
|
|
20
|
+
disabled = false,
|
|
21
|
+
input = $bindable({} as HTMLInputElement),
|
|
22
|
+
children,
|
|
23
|
+
...rest
|
|
24
|
+
}: Props = $props();
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* From https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/forms/Checkbox.svelte
|
|
28
|
+
*/
|
|
29
|
+
function handleChange() {
|
|
30
|
+
if (disabled) return;
|
|
31
|
+
const index = group.indexOf(value);
|
|
32
|
+
if (checked === undefined) checked = index >= 0;
|
|
33
|
+
if (checked) {
|
|
34
|
+
if (index < 0) {
|
|
35
|
+
group.push(value);
|
|
36
|
+
group = group;
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
if (index >= 0) {
|
|
40
|
+
group.splice(index, 1);
|
|
41
|
+
group = group;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
24
45
|
</script>
|
|
25
46
|
|
|
26
|
-
<span
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<span class="placeholder" />
|
|
53
|
-
{#if $$slots.default}
|
|
54
|
-
<span class="label">
|
|
55
|
-
<slot />
|
|
56
|
-
</span>
|
|
57
|
-
{/if}
|
|
58
|
-
</label>
|
|
47
|
+
<span class="checkbox-wrap">
|
|
48
|
+
<label>
|
|
49
|
+
<input
|
|
50
|
+
type="checkbox"
|
|
51
|
+
bind:checked
|
|
52
|
+
bind:this={input}
|
|
53
|
+
{disabled}
|
|
54
|
+
onkeyup={bubble('keyup')}
|
|
55
|
+
onkeydown={bubble('keydown')}
|
|
56
|
+
onkeypress={bubble('keypress')}
|
|
57
|
+
onfocus={bubble('focus')}
|
|
58
|
+
onblur={bubble('blur')}
|
|
59
|
+
onclick={bubble('click')}
|
|
60
|
+
onmouseover={bubble('mouseover')}
|
|
61
|
+
onmouseenter={bubble('mouseenter')}
|
|
62
|
+
onmouseleave={bubble('mouseleave')}
|
|
63
|
+
onchange={handlers(bubble('change'), handleChange)}
|
|
64
|
+
{...rest}
|
|
65
|
+
/>
|
|
66
|
+
<span class="placeholder"></span>
|
|
67
|
+
{#if children}
|
|
68
|
+
<span class="label">
|
|
69
|
+
{@render children?.()}
|
|
70
|
+
</span>
|
|
71
|
+
{/if}
|
|
72
|
+
</label>
|
|
59
73
|
</span>
|
|
60
74
|
|
|
61
75
|
<style>
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
</style>
|
|
76
|
+
.label {
|
|
77
|
+
margin-left: 8px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.checkbox-wrap {
|
|
81
|
+
position: relative;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
vertical-align: middle;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.checkbox-wrap label {
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
input {
|
|
95
|
+
position: absolute;
|
|
96
|
+
opacity: 0;
|
|
97
|
+
width: 0;
|
|
98
|
+
height: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
span.placeholder {
|
|
102
|
+
display: inline-block;
|
|
103
|
+
width: 16px;
|
|
104
|
+
height: 16px;
|
|
105
|
+
background-color: var(--input);
|
|
106
|
+
border-radius: 2px;
|
|
107
|
+
outline: 1px solid var(--accent);
|
|
108
|
+
position: relative;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
span.placeholder:focus-visible {
|
|
112
|
+
box-shadow: 0 0 0 4px var(--accent-light);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* the check icon */
|
|
116
|
+
span.placeholder:after {
|
|
117
|
+
content: '';
|
|
118
|
+
position: absolute;
|
|
119
|
+
display: none;
|
|
120
|
+
|
|
121
|
+
/* check icon */
|
|
122
|
+
left: 4.5px;
|
|
123
|
+
top: 1px;
|
|
124
|
+
width: 4px;
|
|
125
|
+
height: 9px;
|
|
126
|
+
border: solid var(--accent-text);
|
|
127
|
+
border-width: 0 3px 3px 0;
|
|
128
|
+
transform: rotate(45deg);
|
|
129
|
+
transition: 0.2s box-shadow;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.checkbox-wrap:hover span.placeholder {
|
|
133
|
+
box-shadow: 0 0 0 3px var(--accent-light);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
input:checked ~ span.placeholder {
|
|
137
|
+
background-color: var(--accent) !important;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
input:focus ~ span.placeholder {
|
|
141
|
+
box-shadow: 0 0 0 4px var(--accent-light);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
input:checked ~ span.placeholder:after {
|
|
145
|
+
display: block;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* disabled styles */
|
|
149
|
+
input:disabled ~ span.placeholder {
|
|
150
|
+
background-color: var(--accent-light);
|
|
151
|
+
border: none !important;
|
|
152
|
+
opacity: 0.2;
|
|
153
|
+
cursor: not-allowed;
|
|
154
|
+
box-shadow: none !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
input:disabled:checked ~ span.placeholder:after {
|
|
158
|
+
display: none;
|
|
159
|
+
pointer-events: none;
|
|
160
|
+
}
|
|
161
|
+
</style>
|
|
@@ -1,34 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
keyup: KeyboardEvent;
|
|
13
|
-
keydown: KeyboardEvent;
|
|
14
|
-
keypress: KeyboardEvent;
|
|
15
|
-
focus: FocusEvent;
|
|
16
|
-
blur: FocusEvent;
|
|
17
|
-
click: MouseEvent;
|
|
18
|
-
mouseover: MouseEvent;
|
|
19
|
-
mouseenter: MouseEvent;
|
|
20
|
-
mouseleave: MouseEvent;
|
|
21
|
-
change: Event;
|
|
22
|
-
} & {
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
default: {};
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type CheckboxProps = typeof __propDef.props;
|
|
30
|
-
export type CheckboxEvents = typeof __propDef.events;
|
|
31
|
-
export type CheckboxSlots = typeof __propDef.slots;
|
|
32
|
-
export default class Checkbox extends SvelteComponent<CheckboxProps, CheckboxEvents, CheckboxSlots> {
|
|
33
|
-
}
|
|
34
|
-
export {};
|
|
1
|
+
declare const Checkbox: import("svelte").Component<{
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
checked?: boolean | undefined;
|
|
4
|
+
group?: (number | string)[];
|
|
5
|
+
value?: string | number;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
input?: HTMLInputElement;
|
|
8
|
+
children?: import("svelte").Snippet;
|
|
9
|
+
}, {}, "checked" | "group" | "input">;
|
|
10
|
+
type Checkbox = ReturnType<typeof Checkbox>;
|
|
11
|
+
export default Checkbox;
|
|
@@ -1,37 +1,50 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
//import './prism.scss';
|
|
3
|
+
import './hljs.scss';
|
|
4
|
+
|
|
5
|
+
type InputLanguage = 'html' | 'css' | 'js' | 'ts' | 'yaml' | 'json' | 'svelte' | 'jsx' | 'php';
|
|
6
|
+
|
|
7
|
+
const languagesMap: Partial<Record<InputLanguage, Language>> = {
|
|
8
|
+
svelte: 'html',
|
|
9
|
+
jsx: 'js'
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
import getCode, { type Language } from './getCode.js';
|
|
13
|
+
interface Props {
|
|
14
|
+
code: string;
|
|
15
|
+
language?: InputLanguage;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let { code, language = 'html' }: Props = $props();
|
|
19
|
+
const languageCode = (languagesMap[language] || language) as Language;
|
|
10
20
|
</script>
|
|
11
21
|
|
|
12
22
|
<pre class="language-{languageCode} hljs"><code>{@html getCode(code, languageCode)}</code></pre>
|
|
13
23
|
|
|
14
24
|
<style>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
/*styles for CodeBlock component */
|
|
26
|
+
pre {
|
|
27
|
+
text-align: left;
|
|
28
|
+
white-space: pre;
|
|
29
|
+
word-spacing: normal;
|
|
30
|
+
word-break: normal;
|
|
31
|
+
word-wrap: normal;
|
|
32
|
+
overflow: auto;
|
|
33
|
+
border-radius: 20px;
|
|
34
|
+
padding: 20px;
|
|
35
|
+
line-height: 1.2;
|
|
36
|
+
}
|
|
37
|
+
pre code {
|
|
38
|
+
all: unset;
|
|
39
|
+
font-family:
|
|
40
|
+
Consolas,
|
|
41
|
+
Monaco,
|
|
42
|
+
Andale Mono,
|
|
43
|
+
Ubuntu Mono,
|
|
44
|
+
monospace;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
line-height: 1.5 !important;
|
|
47
|
+
tab-size: 4;
|
|
48
|
+
hyphens: none;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import './hljs.scss';
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
12
|
-
};
|
|
13
|
-
export type CodeBlockProps = typeof __propDef.props;
|
|
14
|
-
export type CodeBlockEvents = typeof __propDef.events;
|
|
15
|
-
export type CodeBlockSlots = typeof __propDef.slots;
|
|
16
|
-
export default class CodeBlock extends SvelteComponent<CodeBlockProps, CodeBlockEvents, CodeBlockSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
2
|
+
declare const CodeBlock: import("svelte").Component<{
|
|
3
|
+
code: string;
|
|
4
|
+
language?: "css" | "ts" | "yaml" | "json" | "php" | "html" | "js" | "svelte" | "jsx";
|
|
5
|
+
}, {}, "">;
|
|
6
|
+
type CodeBlock = ReturnType<typeof CodeBlock>;
|
|
7
|
+
export default CodeBlock;
|
|
@@ -5,33 +5,35 @@ import css from 'highlight.js/lib/languages/css';
|
|
|
5
5
|
import ts from 'highlight.js/lib/languages/typescript';
|
|
6
6
|
import yaml from 'highlight.js/lib/languages/yaml';
|
|
7
7
|
import json from 'highlight.js/lib/languages/json';
|
|
8
|
+
import php from 'highlight.js/lib/languages/php';
|
|
8
9
|
hljs.registerLanguage('javascript', javascript);
|
|
9
10
|
hljs.registerLanguage('xml', xml);
|
|
10
11
|
hljs.registerLanguage('css', css);
|
|
11
12
|
hljs.registerLanguage('ts', ts);
|
|
12
13
|
hljs.registerLanguage('yaml', yaml);
|
|
13
14
|
hljs.registerLanguage('json', json);
|
|
15
|
+
hljs.registerLanguage('php', php);
|
|
14
16
|
export default function getCode(code, language) {
|
|
15
17
|
let ret = code;
|
|
16
18
|
// remove the first empty line
|
|
17
|
-
ret = ret.replace(/^[^\S\r\n]*\n/,
|
|
19
|
+
ret = ret.replace(/^[^\S\r\n]*\n/, '');
|
|
18
20
|
// remove the last empty line
|
|
19
|
-
ret = ret.replace(/\n[^\S\r\n]*$/,
|
|
20
|
-
let lines = ret.split(
|
|
21
|
+
ret = ret.replace(/\n[^\S\r\n]*$/, '');
|
|
22
|
+
let lines = ret.split('\n');
|
|
21
23
|
let indent = null; // number of spaces to remove from each line
|
|
22
|
-
lines = lines.map(line => {
|
|
24
|
+
lines = lines.map((line) => {
|
|
23
25
|
if (indent === null) {
|
|
24
26
|
// find the indent
|
|
25
27
|
const match = line.match(/^(\s*)/);
|
|
26
28
|
indent = match ? match[1].length : 0;
|
|
27
29
|
}
|
|
28
|
-
if (line.substring(0, indent).trim() !==
|
|
30
|
+
if (line.substring(0, indent).trim() !== '') {
|
|
29
31
|
return line;
|
|
30
32
|
}
|
|
31
33
|
// remove the indent
|
|
32
34
|
line = line.substring(indent);
|
|
33
35
|
return line;
|
|
34
36
|
});
|
|
35
|
-
ret = lines.join(
|
|
37
|
+
ret = lines.join('\n');
|
|
36
38
|
return hljs.highlight(ret, { language }).value;
|
|
37
39
|
}
|