@hyvor/design 2.0.15 → 2.0.16
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/cloud/HyvorBar/BarSupport.svelte +0 -22
- package/dist/components/ConsoleLoader/ConsoleLoader.svelte +1 -1
- package/dist/components/TernaryStatus/TernaryStatus.svelte +70 -0
- package/dist/components/TernaryStatus/TernaryStatus.svelte.d.ts +12 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/variables.scss +3 -3
- package/package.json +1 -1
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
import IconDiscord from '@hyvor/icons/IconDiscord';
|
|
13
13
|
import IconInfoCircle from '@hyvor/icons/IconInfoCircle';
|
|
14
14
|
import IconFileEarmark from '@hyvor/icons/IconFileEarmark';
|
|
15
|
-
import IconChatDots from '@hyvor/icons/IconChatDots';
|
|
16
15
|
import IconBluesky from '@hyvor/icons/IconBluesky';
|
|
17
16
|
import IconLinkedin from '@hyvor/icons/IconLinkedin';
|
|
18
17
|
import type { BarConfig } from './bar.js';
|
|
@@ -34,14 +33,6 @@
|
|
|
34
33
|
|
|
35
34
|
const cloudContext = $derived(getCloudContext());
|
|
36
35
|
|
|
37
|
-
function openLiveChat(e: any) {
|
|
38
|
-
e.preventDefault();
|
|
39
|
-
if ((window as any).$crisp) {
|
|
40
|
-
(window as any).$crisp.push(['do', 'chat:open']);
|
|
41
|
-
}
|
|
42
|
-
supportDropdown = false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
36
|
function getName() {
|
|
46
37
|
if (config.name) {
|
|
47
38
|
return config.name;
|
|
@@ -107,19 +98,6 @@
|
|
|
107
98
|
</ActionListItem>
|
|
108
99
|
</a>
|
|
109
100
|
{/if}
|
|
110
|
-
{#if config.chat}
|
|
111
|
-
<a href="/chat" onclick={openLiveChat}>
|
|
112
|
-
<ActionListItem>
|
|
113
|
-
Live Chat
|
|
114
|
-
{#snippet description()}
|
|
115
|
-
<div>Chat with our team</div>
|
|
116
|
-
{/snippet}
|
|
117
|
-
{#snippet start()}
|
|
118
|
-
<IconChatDots />
|
|
119
|
-
{/snippet}
|
|
120
|
-
</ActionListItem>
|
|
121
|
-
</a>
|
|
122
|
-
{/if}
|
|
123
101
|
|
|
124
102
|
<ActionListGroup title="Social">
|
|
125
103
|
<a href={SOCIAL_LINKS.discord} target="_blank">
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import IconCheckCircleFill from '@hyvor/icons/IconCheckCircleFill';
|
|
4
|
+
import IconXCircleFill from '@hyvor/icons/IconXCircleFill';
|
|
5
|
+
import IconDashCircleFill from '@hyvor/icons/IconDashCircleFill';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
status: 'positive' | 'negative' | 'neutral';
|
|
9
|
+
text?: string;
|
|
10
|
+
iconSize?: number;
|
|
11
|
+
fontSize?: string;
|
|
12
|
+
color?: string;
|
|
13
|
+
icon?: Snippet | false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let {
|
|
17
|
+
status,
|
|
18
|
+
text = undefined,
|
|
19
|
+
iconSize = 20,
|
|
20
|
+
fontSize = undefined,
|
|
21
|
+
color = undefined,
|
|
22
|
+
icon = undefined
|
|
23
|
+
}: Props = $props();
|
|
24
|
+
|
|
25
|
+
let resolvedText = $derived(
|
|
26
|
+
text ?? (status === 'positive' ? 'Yes' : status === 'negative' ? 'No' : '')
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
let resolvedColor = $derived(
|
|
30
|
+
color ??
|
|
31
|
+
(status === 'positive'
|
|
32
|
+
? 'var(--green)'
|
|
33
|
+
: status === 'negative'
|
|
34
|
+
? 'var(--red)'
|
|
35
|
+
: 'var(--text-light)')
|
|
36
|
+
);
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<span class="ternary-status" style:color={resolvedColor} style:font-size={fontSize}>
|
|
40
|
+
{#if icon !== false}
|
|
41
|
+
<span class="icon">
|
|
42
|
+
{#if icon}
|
|
43
|
+
{@render icon()}
|
|
44
|
+
{:else if status === 'positive'}
|
|
45
|
+
<IconCheckCircleFill size={iconSize} />
|
|
46
|
+
{:else if status === 'negative'}
|
|
47
|
+
<IconXCircleFill size={iconSize} />
|
|
48
|
+
{:else}
|
|
49
|
+
<IconDashCircleFill size={iconSize} />
|
|
50
|
+
{/if}
|
|
51
|
+
</span>
|
|
52
|
+
{/if}
|
|
53
|
+
{#if resolvedText}
|
|
54
|
+
<span class="text">{resolvedText}</span>
|
|
55
|
+
{/if}
|
|
56
|
+
</span>
|
|
57
|
+
|
|
58
|
+
<style>
|
|
59
|
+
.ternary-status {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: 8px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.icon {
|
|
66
|
+
display: inline-flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
status: 'positive' | 'negative' | 'neutral';
|
|
4
|
+
text?: string;
|
|
5
|
+
iconSize?: number;
|
|
6
|
+
fontSize?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
icon?: Snippet | false;
|
|
9
|
+
}
|
|
10
|
+
declare const TernaryStatus: import("svelte").Component<Props, {}, "">;
|
|
11
|
+
type TernaryStatus = ReturnType<typeof TernaryStatus>;
|
|
12
|
+
export default TernaryStatus;
|
|
@@ -49,6 +49,7 @@ export { default as TableCell } from './Table/TableCell.svelte';
|
|
|
49
49
|
export { default as TabNav } from './TabNav/TabNav.svelte';
|
|
50
50
|
export { default as TabNavItem } from './TabNav/TabNavItem.svelte';
|
|
51
51
|
export { default as Tag } from './Tag/Tag.svelte';
|
|
52
|
+
export { default as TernaryStatus } from './TernaryStatus/TernaryStatus.svelte';
|
|
52
53
|
export { default as Textarea } from './Textarea/Textarea.svelte';
|
|
53
54
|
export { default as Text } from './Text/Text.svelte';
|
|
54
55
|
export { default as TextInput } from './TextInput/TextInput.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -49,6 +49,7 @@ export { default as TableCell } from './Table/TableCell.svelte';
|
|
|
49
49
|
export { default as TabNav } from './TabNav/TabNav.svelte';
|
|
50
50
|
export { default as TabNavItem } from './TabNav/TabNavItem.svelte';
|
|
51
51
|
export { default as Tag } from './Tag/Tag.svelte';
|
|
52
|
+
export { default as TernaryStatus } from './TernaryStatus/TernaryStatus.svelte';
|
|
52
53
|
export { default as Textarea } from './Textarea/Textarea.svelte';
|
|
53
54
|
export { default as Text } from './Text/Text.svelte';
|
|
54
55
|
export { default as TextInput } from './TextInput/TextInput.svelte';
|
package/dist/variables.scss
CHANGED
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
* In most cases, no need to extend these colors
|
|
23
23
|
*/
|
|
24
24
|
--green-light: #cadfca;
|
|
25
|
-
--green: #
|
|
25
|
+
--green: #4b874b;
|
|
26
26
|
--green-dark: #335c33;
|
|
27
27
|
|
|
28
28
|
--red-dark: #ab2525;
|
|
29
|
-
--red: #
|
|
29
|
+
--red: #c05959;
|
|
30
30
|
--red-light: #ffdfdf;
|
|
31
31
|
|
|
32
32
|
--blue-dark: #334b81;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
--blue-light: #dae5ff;
|
|
35
35
|
|
|
36
36
|
--orange-dark: #8b5b04;
|
|
37
|
-
--orange: #
|
|
37
|
+
--orange: #a98526;
|
|
38
38
|
--orange-light: #efe3b4;
|
|
39
39
|
|
|
40
40
|
--gray-light: #ddd;
|