@hyvor/design 2.0.0-beta.1 → 2.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/README.md +9 -0
- package/dist/cloud/HyvorBar/BarProducts/BarProducts.svelte +1 -4
- package/dist/cloud/HyvorBar/BarUpdatesList.svelte +1 -3
- package/dist/cloud/HyvorBar/HyvorBar.svelte +0 -2
- package/dist/cloud/HyvorBar/bar.d.ts +1 -1
- package/dist/cloud/OrganizationMembers/OrganizationMembersSearch.svelte +1 -4
- package/dist/cloud/ResourceCreator/Accordian.svelte +2 -4
- package/dist/components/Accordion/Accordion.svelte +134 -134
- package/dist/components/Button/Button.svelte +2 -12
- package/dist/components/CodeBlock/CodeBlock.svelte +45 -28
- package/dist/components/CodeBlock/CodeBlock.svelte.d.ts +2 -3
- package/dist/components/CodeBlock/TabbedCodeBlock.svelte +60 -64
- package/dist/components/CodeBlock/TabbedCodeBlock.svelte.d.ts +1 -1
- package/dist/components/CodeBlock/getCode.d.ts +3 -1
- package/dist/components/CodeBlock/getCode.js +33 -50
- package/dist/components/ColorPicker/ColorPicker.svelte +1 -1
- package/dist/components/Dark/DarkProvider.svelte +1 -1
- package/dist/components/DetailCard/DetailCard.svelte +43 -46
- package/dist/components/DetailCard/DetailCard.svelte.d.ts +1 -1
- package/dist/components/DetailCard/DetailCards.svelte +13 -16
- package/dist/components/DetailCard/DetailCards.svelte.d.ts +1 -1
- package/dist/components/Dropdown/DropdownContent.svelte +1 -2
- package/dist/components/EmojiPicker/EmojiSelector.svelte +3 -14
- package/dist/components/EmojiPicker/emojidata.js +3 -3
- package/dist/components/FileUploader/Preview/Preview.svelte +1 -1
- package/dist/components/FileUploader/TabUpload/TabUpload.svelte +2 -4
- package/dist/components/FileUploader/file-uploader.js +5 -10
- package/dist/components/FileUploader/helpers.js +1 -1
- package/dist/components/IconButton/IconButton.svelte +2 -10
- package/dist/components/Internationalization/LanguageToggle.svelte +2 -2
- package/dist/components/Internationalization/T.svelte +2 -9
- package/dist/components/Internationalization/i18n.js +3 -1
- package/dist/components/Modal/Modal.svelte +16 -12
- package/dist/components/TextInput/TextInput.svelte +29 -52
- package/dist/components/TextInput/TextInput.svelte.d.ts +5 -3
- package/dist/components/Textarea/Textarea.svelte +84 -98
- package/dist/index.css +4 -4
- package/dist/legacy.js +2 -2
- package/dist/marketing/Affiliate/Affiliate.svelte +53 -51
- package/dist/marketing/Container/Container.svelte +4 -5
- package/dist/marketing/Docs/Nav/Nav.svelte +1 -2
- package/dist/marketing/Footer/Footer.svelte +2 -2
- package/dist/marketing/Header/Header.svelte +131 -140
- package/dist/marketing/Header/Header.svelte.d.ts +3 -1
- package/dist/marketing/Header/HeaderNotification.svelte +64 -0
- package/dist/marketing/Header/HeaderNotification.svelte.d.ts +7 -0
- package/dist/marketing/cloud.d.ts +1 -0
- package/dist/marketing/cloud.js +15 -0
- package/dist/marketing/track/track.d.ts +0 -1
- package/dist/marketing/track/track.js +3 -6
- package/dist/variables.scss +1 -1
- package/package.json +24 -22
- package/dist/components/CodeBlock/hljs.scss +0 -228
- package/dist/components/CodeBlock/prism.scss +0 -375
|
@@ -4,35 +4,46 @@
|
|
|
4
4
|
import IconButton from '../../components/IconButton/IconButton.svelte';
|
|
5
5
|
import Dropdown from '../../components/Dropdown/Dropdown.svelte';
|
|
6
6
|
import IconList from '@hyvor/icons/IconList';
|
|
7
|
+
import HeaderNotification from './HeaderNotification.svelte';
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
|
-
|
|
10
|
+
product: string;
|
|
11
|
+
instance?: string;
|
|
12
|
+
logo?: string;
|
|
10
13
|
name?: string;
|
|
11
14
|
href?: string;
|
|
12
15
|
subName?: undefined | string;
|
|
13
16
|
darkToggle?: boolean;
|
|
14
17
|
center?: import('svelte').Snippet;
|
|
15
18
|
end?: import('svelte').Snippet;
|
|
16
|
-
|
|
19
|
+
max?: boolean;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
let {
|
|
23
|
+
product,
|
|
20
24
|
logo,
|
|
25
|
+
instance = 'https://hyvor.com',
|
|
21
26
|
name = 'HYVOR',
|
|
22
27
|
href = '/',
|
|
23
28
|
subName = undefined,
|
|
24
29
|
darkToggle = true,
|
|
25
30
|
center,
|
|
26
31
|
end,
|
|
27
|
-
|
|
32
|
+
max = false
|
|
28
33
|
}: Props = $props();
|
|
29
34
|
</script>
|
|
30
35
|
|
|
31
36
|
<header>
|
|
37
|
+
<HeaderNotification {instance} {product} />
|
|
32
38
|
<Container as="nav" {max}>
|
|
33
39
|
<div class="nav-start">
|
|
34
40
|
<a class="nav-brand" {href}>
|
|
35
|
-
<img
|
|
41
|
+
<img
|
|
42
|
+
src={logo || `${instance}/api/public/logo/${product}.svg`}
|
|
43
|
+
alt="{name + (subName ? ' ' + subName : '')} Logo"
|
|
44
|
+
width="30"
|
|
45
|
+
height="30"
|
|
46
|
+
/>
|
|
36
47
|
<span class="brand-product">
|
|
37
48
|
<span class="brand">{name}</span>
|
|
38
49
|
{#if subName}
|
|
@@ -56,25 +67,6 @@
|
|
|
56
67
|
<DarkToggle />
|
|
57
68
|
</span>
|
|
58
69
|
{/if}
|
|
59
|
-
|
|
60
|
-
<!-- <span class="mobile-nav-wrap">
|
|
61
|
-
<Dropdown align="end" width={300}>
|
|
62
|
-
<IconButton
|
|
63
|
-
color="invisible"
|
|
64
|
-
slot="trigger"
|
|
65
|
-
>
|
|
66
|
-
<IconList size={18} />
|
|
67
|
-
</IconButton>
|
|
68
|
-
<div slot="content" class="mobile-content">
|
|
69
|
-
<div class="mobile-inner center">
|
|
70
|
-
<slot name="center" />
|
|
71
|
-
</div>
|
|
72
|
-
<div class="mobile-inner end">
|
|
73
|
-
<slot name="end" />
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</Dropdown>
|
|
77
|
-
</span> -->
|
|
78
70
|
</div>
|
|
79
71
|
|
|
80
72
|
<span class="mobile-nav-wrap">
|
|
@@ -101,120 +93,119 @@
|
|
|
101
93
|
|
|
102
94
|
<div class="header-space"></div>
|
|
103
95
|
|
|
104
|
-
<style
|
|
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
|
-
.nav-brand img {
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.brand-product {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
.mobile-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}</style>
|
|
96
|
+
<style>
|
|
97
|
+
.header-space {
|
|
98
|
+
height: var(--header-height);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
header {
|
|
102
|
+
position: fixed;
|
|
103
|
+
top: 0;
|
|
104
|
+
left: 0;
|
|
105
|
+
width: 100%;
|
|
106
|
+
z-index: 100;
|
|
107
|
+
background-color: var(--background, var(--accent-lightest));
|
|
108
|
+
border-bottom: 1px solid var(--border);
|
|
109
|
+
height: var(--header-height);
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
header :global(> nav) {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
flex: 1;
|
|
118
|
+
}
|
|
119
|
+
.nav-brand {
|
|
120
|
+
display: inline-block;
|
|
121
|
+
line-height: inherit;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
color: inherit;
|
|
124
|
+
text-decoration: none;
|
|
125
|
+
font-weight: 600;
|
|
126
|
+
}
|
|
127
|
+
.nav-brand img {
|
|
128
|
+
vertical-align: middle;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.brand-product {
|
|
132
|
+
vertical-align: middle;
|
|
133
|
+
display: inline-flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
justify-content: center;
|
|
136
|
+
line-height: 14px;
|
|
137
|
+
}
|
|
138
|
+
.brand-product .brand {
|
|
139
|
+
font-size: 14px;
|
|
140
|
+
}
|
|
141
|
+
.brand-product .product {
|
|
142
|
+
font-size: 12px;
|
|
143
|
+
font-weight: normal;
|
|
144
|
+
color: var(--text-light);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.nav-center {
|
|
148
|
+
flex: 1;
|
|
149
|
+
display: flex;
|
|
150
|
+
align-items: center;
|
|
151
|
+
gap: 6px;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.nav-end {
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
gap: 6px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.mobile-nav-wrap {
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.dark-mobile {
|
|
166
|
+
display: inline-flex;
|
|
167
|
+
align-items: center;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.dark-toggle-wrap {
|
|
171
|
+
margin-left: 8px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@media screen and (max-width: 992px) {
|
|
175
|
+
.nav-center {
|
|
176
|
+
display: none;
|
|
177
|
+
}
|
|
178
|
+
.nav-end {
|
|
179
|
+
display: none;
|
|
180
|
+
}
|
|
181
|
+
.mobile-nav-wrap {
|
|
182
|
+
display: inline-block;
|
|
183
|
+
}
|
|
184
|
+
.dark-mobile {
|
|
185
|
+
flex: 1;
|
|
186
|
+
text-align: right;
|
|
187
|
+
display: inline-block;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.mobile-content,
|
|
192
|
+
.mobile-inner {
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
}
|
|
196
|
+
.mobile-content {
|
|
197
|
+
gap: 10px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.mobile-content :global(.button) {
|
|
201
|
+
display: flex;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/*
|
|
205
|
+
Scroll padding top is used to prevent the content from being hidden behind the header
|
|
206
|
+
https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-padding-top
|
|
207
|
+
*/
|
|
208
|
+
:global(html) {
|
|
209
|
+
scroll-padding-top: calc(var(--header-height) + 20px);
|
|
210
|
+
}
|
|
211
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import { slide } from 'svelte/transition';
|
|
4
|
+
import { isCloud } from '../cloud.js';
|
|
5
|
+
import IconMegaphone from '@hyvor/icons/IconMegaphone';
|
|
6
|
+
import type { BarUpdate } from '../../cloud/HyvorBar/bar.js';
|
|
7
|
+
|
|
8
|
+
let notificationUpdate: BarUpdate | null = $state(null);
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
instance: string;
|
|
12
|
+
product: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let { instance, product }: Props = $props();
|
|
16
|
+
|
|
17
|
+
function set(u: BarUpdate) {
|
|
18
|
+
notificationUpdate = u;
|
|
19
|
+
document.documentElement.style.setProperty('--header-height', '85px');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
onMount(() => {
|
|
23
|
+
if (!isCloud(false)) return;
|
|
24
|
+
|
|
25
|
+
fetch(instance + '/api/public/updates/notification?type=' + product)
|
|
26
|
+
.then((response) => response.json())
|
|
27
|
+
.then((data) => {
|
|
28
|
+
if (data.update) {
|
|
29
|
+
set(data.update);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
{#if notificationUpdate}
|
|
36
|
+
<a
|
|
37
|
+
class="header-notification"
|
|
38
|
+
href={notificationUpdate.url}
|
|
39
|
+
target="_blank"
|
|
40
|
+
transition:slide={{ duration: 300 }}
|
|
41
|
+
>
|
|
42
|
+
<IconMegaphone size={12} />
|
|
43
|
+
{notificationUpdate.title} →
|
|
44
|
+
</a>
|
|
45
|
+
{/if}
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.header-notification {
|
|
49
|
+
display: block;
|
|
50
|
+
background-color: var(--accent);
|
|
51
|
+
color: var(--accent-text);
|
|
52
|
+
height: 30px;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
font-weight: 600;
|
|
59
|
+
transition: opacity 0.2s;
|
|
60
|
+
}
|
|
61
|
+
.header-notification:hover {
|
|
62
|
+
opacity: 0.8;
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isCloud(forceProd?: boolean): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function isCloud(forceProd = true) {
|
|
2
|
+
if (typeof window === 'undefined') {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
const hostname = window.location.hostname;
|
|
6
|
+
function isDomain(domain) {
|
|
7
|
+
return hostname === domain || hostname.endsWith(`.${domain}`);
|
|
8
|
+
}
|
|
9
|
+
let domains = ['hyvor.com'];
|
|
10
|
+
if (forceProd === false) {
|
|
11
|
+
domains.push('hyvor.localhost');
|
|
12
|
+
domains.push('hyvorstaging.com');
|
|
13
|
+
}
|
|
14
|
+
return domains.some(isDomain);
|
|
15
|
+
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { OpenPanel } from '@openpanel/web';
|
|
2
|
+
import { isCloud } from '../cloud.js';
|
|
2
3
|
class Track {
|
|
3
4
|
op;
|
|
4
|
-
isProductionDomain() {
|
|
5
|
-
const hostname = window.location.hostname;
|
|
6
|
-
return hostname === 'hyvor.com' || hostname.endsWith('.hyvor.com');
|
|
7
|
-
}
|
|
8
5
|
init({ forceTrack = false, openPanelApiUrl = 'https://op.hyvor.com/api', openPanelClientId = 'b11f6143-a6b0-4fa4-a86c-3969c01dbb1d', context = {} } = {}) {
|
|
9
|
-
if (!forceTrack && !
|
|
6
|
+
if (!forceTrack && !isCloud()) {
|
|
10
7
|
console.log('Tracking is disabled in non-production domains.');
|
|
11
8
|
return;
|
|
12
9
|
}
|
|
@@ -15,7 +12,7 @@ class Track {
|
|
|
15
12
|
clientId: openPanelClientId,
|
|
16
13
|
trackScreenViews: true,
|
|
17
14
|
trackOutgoingLinks: true,
|
|
18
|
-
trackAttributes: true
|
|
15
|
+
trackAttributes: true
|
|
19
16
|
});
|
|
20
17
|
if (Object.keys(context).length > 0) {
|
|
21
18
|
this.op.setGlobalProperties(context);
|
package/dist/variables.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyvor/design",
|
|
3
|
+
"version": "2.0.0",
|
|
3
4
|
"license": "MIT",
|
|
4
5
|
"private": false,
|
|
5
6
|
"repository": {
|
|
@@ -16,7 +17,8 @@
|
|
|
16
17
|
"prepublishOnly": "npm run package",
|
|
17
18
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
18
19
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
19
|
-
"check:prettier": "prettier --check ."
|
|
20
|
+
"check:prettier": "prettier --check .",
|
|
21
|
+
"format": "prettier --write ."
|
|
20
22
|
},
|
|
21
23
|
"exports": {
|
|
22
24
|
"./components": {
|
|
@@ -43,32 +45,32 @@
|
|
|
43
45
|
"svelte": "^5.0.0"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
|
-
"@sveltejs/adapter-static": "^3.0.
|
|
47
|
-
"@sveltejs/package": "^2.
|
|
48
|
-
"@sveltejs/vite-plugin-svelte": "^6.2.
|
|
49
|
-
"prettier": "3.
|
|
50
|
-
"prettier-plugin-svelte": "3.
|
|
51
|
-
"publint": "^0.
|
|
52
|
-
"svelte": "^5.
|
|
53
|
-
"svelte-check": "^4.
|
|
54
|
-
"tslib": "^2.
|
|
55
|
-
"typescript": "^5.
|
|
56
|
-
"vite": "^7.
|
|
48
|
+
"@sveltejs/adapter-static": "^3.0.10",
|
|
49
|
+
"@sveltejs/package": "^2.5.7",
|
|
50
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
51
|
+
"prettier": "3.8.1",
|
|
52
|
+
"prettier-plugin-svelte": "3.4.1",
|
|
53
|
+
"publint": "^0.3.17",
|
|
54
|
+
"svelte": "^5.49.1",
|
|
55
|
+
"svelte-check": "^4.3.6",
|
|
56
|
+
"tslib": "^2.8.1",
|
|
57
|
+
"typescript": "^5.9.3",
|
|
58
|
+
"vite": "^7.3"
|
|
57
59
|
},
|
|
58
60
|
"dependencies": {
|
|
59
|
-
"@fontsource/readex-pro": "^5.
|
|
61
|
+
"@fontsource/readex-pro": "^5.2.11",
|
|
60
62
|
"@hyvor/icons": "^1.1.1",
|
|
61
|
-
"@openpanel/sdk": "^1.0.
|
|
62
|
-
"@openpanel/web": "^1.0.
|
|
63
|
-
"deepmerge-ts": "^
|
|
64
|
-
"emojibase-data": "^
|
|
65
|
-
"intl-messageformat": "^
|
|
66
|
-
"
|
|
67
|
-
"
|
|
63
|
+
"@openpanel/sdk": "^1.0.4",
|
|
64
|
+
"@openpanel/web": "^1.0.7",
|
|
65
|
+
"deepmerge-ts": "^7.1.5",
|
|
66
|
+
"emojibase-data": "^17.0.0",
|
|
67
|
+
"intl-messageformat": "^11.1.2",
|
|
68
|
+
"shiki": "^3.22.0",
|
|
69
|
+
"svelte-awesome-color-picker": "^4.1.1",
|
|
70
|
+
"tocbot": "^4.36.4"
|
|
68
71
|
},
|
|
69
72
|
"type": "module",
|
|
70
73
|
"publishConfig": {
|
|
71
74
|
"access": "public"
|
|
72
|
-
}
|
|
73
|
-
"version": "2.0.0-beta.1"
|
|
75
|
+
}
|
|
74
76
|
}
|