@hyvor/design 1.1.25-beta-org-4 → 1.1.25-beta-org-7
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/ResourceCreator/ResourceCreator.svelte +192 -0
- package/dist/cloud/ResourceCreator/ResourceCreator.svelte.d.ts +10 -0
- package/dist/cloud/ResourceCreator/ResourceCreatorLoader.svelte +32 -0
- package/dist/cloud/ResourceCreator/ResourceCreatorLoader.svelte.d.ts +7 -0
- package/dist/cloud/ResourceCreator/Step.svelte +47 -0
- package/dist/cloud/ResourceCreator/Step.svelte.d.ts +9 -0
- package/dist/cloud/ResourceCreator/steps.svelte.d.ts +16 -0
- package/dist/cloud/ResourceCreator/steps.svelte.js +35 -0
- package/dist/cloud/index.d.ts +1 -0
- package/dist/cloud/index.js +1 -0
- package/dist/components/Button/Button.svelte +3 -1
- package/dist/components/Checkbox/Checkbox.svelte.d.ts +1 -1
- package/dist/components/HyvorBar/Organization/CreateOrganization.svelte +16 -3
- package/dist/components/HyvorBar/Organization/OrganizationButton.svelte +13 -3
- package/dist/components/HyvorBar/Organization/OrganizationButton.svelte.d.ts +1 -0
- package/dist/components/HyvorBar/Organization/OrganizationButtonOrCreator.svelte +7 -0
- package/dist/components/HyvorBar/Organization/OrganizationButtonOrCreator.svelte.d.ts +18 -0
- package/dist/components/HyvorBar/Organization/OrgsList.svelte +44 -26
- package/dist/components/HyvorBar/Organization/OrgsList.svelte.d.ts +1 -0
- package/dist/components/HyvorBar/bar.d.ts +3 -1
- package/dist/components/HyvorBar/bar.js +1 -0
- package/dist/components/Internationalization/T.svelte.d.ts +12 -5
- package/dist/components/Radio/Radio.svelte.d.ts +1 -1
- package/dist/components/SplitControl/SplitControl.svelte +12 -0
- package/dist/components/SplitControl/SplitControl.svelte.d.ts +1 -0
- package/dist/components/Switch/Switch.svelte.d.ts +1 -1
- package/dist/components/TextInput/TextInput.svelte +23 -28
- package/dist/components/TextInput/TextInput.svelte.d.ts +2 -2
- package/dist/components/Textarea/Textarea.svelte +6 -2
- package/package.json +8 -4
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { barUser } from '../../components/HyvorBar/bar.js';
|
|
3
|
+
import OrganizationButton from '../../components/HyvorBar/Organization/OrganizationButton.svelte';
|
|
4
|
+
import IconButton from '../../components/IconButton/IconButton.svelte';
|
|
5
|
+
import SplitControl from '../../components/SplitControl/SplitControl.svelte';
|
|
6
|
+
import IconX from '@hyvor/icons/IconX';
|
|
7
|
+
import TextInput from '../../components/TextInput/TextInput.svelte';
|
|
8
|
+
import Caption from '../../components/FormControl/Caption.svelte';
|
|
9
|
+
import Tooltip from '../../components/Tooltip/Tooltip.svelte';
|
|
10
|
+
import IconInfoCircle from '@hyvor/icons/IconInfoCircle';
|
|
11
|
+
import Button from '../../components/Button/Button.svelte';
|
|
12
|
+
import Validation from '../../components/FormControl/Validation.svelte';
|
|
13
|
+
import FormControl from '../../components/FormControl/FormControl.svelte';
|
|
14
|
+
import Label from '../../components/FormControl/Label.svelte';
|
|
15
|
+
import ResourceCreatorLoader from './ResourceCreatorLoader.svelte';
|
|
16
|
+
import { Steps, type Step } from './steps.svelte.js';
|
|
17
|
+
|
|
18
|
+
interface Props {
|
|
19
|
+
children?: import('svelte').Snippet;
|
|
20
|
+
onback: () => void;
|
|
21
|
+
organizationCaption?: string;
|
|
22
|
+
cta?: string;
|
|
23
|
+
steps?: string[]; // steps from the product. ex: creating the blog, copying the theme
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let {
|
|
27
|
+
children,
|
|
28
|
+
onback,
|
|
29
|
+
organizationCaption = 'Choose the organization this resource belongs to',
|
|
30
|
+
cta = 'Create resource',
|
|
31
|
+
steps: productSteps
|
|
32
|
+
}: Props = $props();
|
|
33
|
+
|
|
34
|
+
const hasOrg = $derived(Boolean($barUser?.current_organization));
|
|
35
|
+
let loading = $state(false);
|
|
36
|
+
let steps: Steps = $state(new Steps([]));
|
|
37
|
+
let orgName = $state('');
|
|
38
|
+
let orgNameError = $state('');
|
|
39
|
+
|
|
40
|
+
function setLoading() {
|
|
41
|
+
let stps: Step[] = [];
|
|
42
|
+
|
|
43
|
+
if (!hasOrg) {
|
|
44
|
+
stps.push({
|
|
45
|
+
text: 'Creating the organization',
|
|
46
|
+
auto: false
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
productSteps?.forEach((s) => {
|
|
51
|
+
stps.push({
|
|
52
|
+
text: s,
|
|
53
|
+
auto: true
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
loading = true;
|
|
58
|
+
steps = new Steps(stps);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function createOrganization() {
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function handleCta() {
|
|
68
|
+
orgNameError = '';
|
|
69
|
+
|
|
70
|
+
if (hasOrg === false) {
|
|
71
|
+
if (orgName.trim() === '') {
|
|
72
|
+
orgNameError = 'Organization name cannot be empty';
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
setLoading();
|
|
77
|
+
await createOrganization();
|
|
78
|
+
steps.toNext();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<div class="wrap">
|
|
84
|
+
<div class="inner hds-box" class:loading>
|
|
85
|
+
{#if loading}
|
|
86
|
+
<ResourceCreatorLoader {steps} />
|
|
87
|
+
{:else}
|
|
88
|
+
<div class="title">
|
|
89
|
+
Start a new blog
|
|
90
|
+
|
|
91
|
+
<span class="close">
|
|
92
|
+
<IconButton color="input" variant="invisible" on:click={onback}>
|
|
93
|
+
<IconX size={22} />
|
|
94
|
+
</IconButton>
|
|
95
|
+
</span>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div class="content">
|
|
99
|
+
{#if hasOrg}
|
|
100
|
+
<SplitControl
|
|
101
|
+
label="Organization"
|
|
102
|
+
caption={organizationCaption}
|
|
103
|
+
noHorizonalPadding
|
|
104
|
+
>
|
|
105
|
+
<OrganizationButton />
|
|
106
|
+
</SplitControl>
|
|
107
|
+
{:else}
|
|
108
|
+
<SplitControl noHorizonalPadding>
|
|
109
|
+
{#snippet label()}
|
|
110
|
+
<Label>Organization</Label>
|
|
111
|
+
{/snippet}
|
|
112
|
+
{#snippet caption()}
|
|
113
|
+
<Caption>
|
|
114
|
+
A new organization will be created for you
|
|
115
|
+
|
|
116
|
+
<span class="org-tooltip">
|
|
117
|
+
<Tooltip
|
|
118
|
+
text="An organization helps you manage multiple projects and team members across HYVOR products."
|
|
119
|
+
>
|
|
120
|
+
<IconInfoCircle size={12} />
|
|
121
|
+
</Tooltip>
|
|
122
|
+
</span>
|
|
123
|
+
</Caption>
|
|
124
|
+
{/snippet}
|
|
125
|
+
|
|
126
|
+
<FormControl>
|
|
127
|
+
<TextInput
|
|
128
|
+
bind:value={orgName}
|
|
129
|
+
block
|
|
130
|
+
state={orgNameError ? 'error' : undefined}
|
|
131
|
+
/>
|
|
132
|
+
{#if orgNameError}
|
|
133
|
+
<Validation state="error">{orgNameError}</Validation>
|
|
134
|
+
{/if}
|
|
135
|
+
</FormControl>
|
|
136
|
+
</SplitControl>
|
|
137
|
+
{/if}
|
|
138
|
+
|
|
139
|
+
{@render children?.()}
|
|
140
|
+
|
|
141
|
+
<div class="cta">
|
|
142
|
+
<Button onclick={handleCta}>{cta}</Button>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
{/if}
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<style>
|
|
150
|
+
.wrap {
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
justify-content: center;
|
|
154
|
+
width: 100%;
|
|
155
|
+
/* reduce bar height */
|
|
156
|
+
height: calc(100vh - 50px);
|
|
157
|
+
}
|
|
158
|
+
.inner {
|
|
159
|
+
width: 750px;
|
|
160
|
+
max-width: 100%;
|
|
161
|
+
transition: 0.3s width;
|
|
162
|
+
}
|
|
163
|
+
.inner.loading {
|
|
164
|
+
width: 450px;
|
|
165
|
+
}
|
|
166
|
+
.title {
|
|
167
|
+
padding: 25px 35px;
|
|
168
|
+
font-weight: 600;
|
|
169
|
+
font-size: 20px;
|
|
170
|
+
position: relative;
|
|
171
|
+
}
|
|
172
|
+
.close {
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: 50%;
|
|
175
|
+
right: 35px;
|
|
176
|
+
transform: translateY(-50%);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.content {
|
|
180
|
+
padding: 0 35px 35px 35px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.org-tooltip {
|
|
184
|
+
vertical-align: middle;
|
|
185
|
+
cursor: pointer;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.cta {
|
|
189
|
+
padding-top: 20px;
|
|
190
|
+
text-align: center;
|
|
191
|
+
}
|
|
192
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
children?: import('svelte').Snippet;
|
|
3
|
+
onback: () => void;
|
|
4
|
+
organizationCaption?: string;
|
|
5
|
+
cta?: string;
|
|
6
|
+
steps?: string[];
|
|
7
|
+
}
|
|
8
|
+
declare const ResourceCreator: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type ResourceCreator = ReturnType<typeof ResourceCreator>;
|
|
10
|
+
export default ResourceCreator;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onMount } from 'svelte';
|
|
3
|
+
import Step from './Step.svelte';
|
|
4
|
+
import type { Steps } from './steps.svelte.js';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
steps: Steps;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { steps }: Props = $props();
|
|
11
|
+
|
|
12
|
+
onMount(() => {
|
|
13
|
+
steps.init();
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="loader">
|
|
18
|
+
{#each steps.steps as step, i}
|
|
19
|
+
<Step status={steps.statusOf(i)}>{step.text}</Step>
|
|
20
|
+
{/each}
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<style>
|
|
24
|
+
.loader {
|
|
25
|
+
padding: 40px;
|
|
26
|
+
width: 350px;
|
|
27
|
+
margin: auto;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 10px;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Steps } from './steps.svelte.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
steps: Steps;
|
|
4
|
+
}
|
|
5
|
+
declare const ResourceCreatorLoader: import("svelte").Component<Props, {}, "">;
|
|
6
|
+
type ResourceCreatorLoader = ReturnType<typeof ResourceCreatorLoader>;
|
|
7
|
+
export default ResourceCreatorLoader;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Loader from '../../components/Loader/Loader.svelte';
|
|
3
|
+
import IconCheckCircleFill from '@hyvor/icons/IconCheckCircleFill';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
import type { StepStatus } from './steps.svelte.js';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
children: Snippet;
|
|
9
|
+
status: StepStatus;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let { children, status }: Props = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div class="step">
|
|
16
|
+
<div class="loader">
|
|
17
|
+
{#if status === 'current'}
|
|
18
|
+
<Loader size={12} />
|
|
19
|
+
{:else if status === 'done'}
|
|
20
|
+
<IconCheckCircleFill size={12} style="color:var(--green)" />
|
|
21
|
+
{:else}
|
|
22
|
+
<span class="dot"></span>
|
|
23
|
+
{/if}
|
|
24
|
+
</div>
|
|
25
|
+
<div class="content">
|
|
26
|
+
{@render children()}
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<style>
|
|
31
|
+
.step {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
35
|
+
.dot {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
width: 6px;
|
|
38
|
+
height: 6px;
|
|
39
|
+
border-radius: 50%;
|
|
40
|
+
background-color: #ddd;
|
|
41
|
+
}
|
|
42
|
+
.loader {
|
|
43
|
+
width: 35px;
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { StepStatus } from './steps.svelte.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
status: StepStatus;
|
|
6
|
+
}
|
|
7
|
+
declare const Step: import("svelte").Component<Props, {}, "">;
|
|
8
|
+
type Step = ReturnType<typeof Step>;
|
|
9
|
+
export default Step;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Step {
|
|
2
|
+
text: string;
|
|
3
|
+
auto: boolean;
|
|
4
|
+
}
|
|
5
|
+
export type StepStatus = 'pending' | 'current' | 'done';
|
|
6
|
+
export declare class Steps {
|
|
7
|
+
steps: Step[];
|
|
8
|
+
private currentIndex;
|
|
9
|
+
private autoTimeoutMs;
|
|
10
|
+
constructor(steps: Step[]);
|
|
11
|
+
private currentStep;
|
|
12
|
+
private setTimeoutIfNeeded;
|
|
13
|
+
init(): void;
|
|
14
|
+
toNext(): void;
|
|
15
|
+
statusOf(i: number): StepStatus;
|
|
16
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class Steps {
|
|
2
|
+
steps;
|
|
3
|
+
currentIndex = $state(0);
|
|
4
|
+
autoTimeoutMs;
|
|
5
|
+
constructor(steps) {
|
|
6
|
+
this.steps = steps;
|
|
7
|
+
// divide 2s into auto steps
|
|
8
|
+
// we might need to make 2s configurable later
|
|
9
|
+
this.autoTimeoutMs = 2000 / this.steps.filter((s) => s.auto === true).length;
|
|
10
|
+
}
|
|
11
|
+
currentStep() {
|
|
12
|
+
return this.steps[this.currentIndex];
|
|
13
|
+
}
|
|
14
|
+
setTimeoutIfNeeded() {
|
|
15
|
+
if (this.currentStep().auto) {
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
this.toNext();
|
|
18
|
+
}, this.autoTimeoutMs);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
init() {
|
|
22
|
+
this.setTimeoutIfNeeded();
|
|
23
|
+
}
|
|
24
|
+
toNext() {
|
|
25
|
+
this.currentIndex = Math.min(this.currentIndex + 1, this.steps.length - 1);
|
|
26
|
+
this.setTimeoutIfNeeded();
|
|
27
|
+
}
|
|
28
|
+
statusOf(i) {
|
|
29
|
+
if (i < this.currentIndex)
|
|
30
|
+
return 'done';
|
|
31
|
+
if (i === this.currentIndex)
|
|
32
|
+
return 'current';
|
|
33
|
+
return 'pending';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ResourceCreator } from './ResourceCreator/ResourceCreator.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ResourceCreator } from './ResourceCreator/ResourceCreator.svelte';
|
|
@@ -429,12 +429,14 @@
|
|
|
429
429
|
background-color: transparent;
|
|
430
430
|
color: var(--text);
|
|
431
431
|
transition: 0.2s background-color;
|
|
432
|
-
/*styles for disabled state*/
|
|
433
432
|
}
|
|
434
433
|
.button.invisible:hover {
|
|
435
434
|
background-color: var(--accent-light);
|
|
436
435
|
box-shadow: none !important;
|
|
437
436
|
}
|
|
437
|
+
.button.invisible {
|
|
438
|
+
/*styles for disabled state*/
|
|
439
|
+
}
|
|
438
440
|
.button.invisible[disabled] {
|
|
439
441
|
background-color: transparent;
|
|
440
442
|
color: var(--text);
|
|
@@ -7,6 +7,6 @@ interface Props {
|
|
|
7
7
|
children?: import('svelte').Snippet;
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
}
|
|
10
|
-
declare const Checkbox: import("svelte").Component<Props, {}, "
|
|
10
|
+
declare const Checkbox: import("svelte").Component<Props, {}, "input" | "checked" | "group">;
|
|
11
11
|
type Checkbox = ReturnType<typeof Checkbox>;
|
|
12
12
|
export default Checkbox;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import Callout from '../../Callout/Callout.svelte';
|
|
2
3
|
import Modal from '../../Modal/Modal.svelte';
|
|
3
4
|
import SplitControl from '../../SplitControl/SplitControl.svelte';
|
|
4
5
|
import TextInput from '../../TextInput/TextInput.svelte';
|
|
5
|
-
import toast from '../../Toast/toast.
|
|
6
|
+
import toast from '../../Toast/toast.js';
|
|
6
7
|
import {
|
|
7
8
|
barOnOrganizationSwitch,
|
|
9
|
+
barOrganizations,
|
|
8
10
|
createOrganization,
|
|
9
11
|
switchOrganization,
|
|
10
12
|
type BarOrganization
|
|
11
|
-
} from '../bar.
|
|
13
|
+
} from '../bar.js';
|
|
12
14
|
|
|
13
15
|
interface Props {
|
|
14
16
|
show?: boolean;
|
|
@@ -41,6 +43,8 @@
|
|
|
41
43
|
show = false;
|
|
42
44
|
name = '';
|
|
43
45
|
|
|
46
|
+
barOrganizations.update((orgs) => [org, ...orgs]);
|
|
47
|
+
|
|
44
48
|
try {
|
|
45
49
|
await switchOrganization(org.id);
|
|
46
50
|
$barOnOrganizationSwitch?.(org);
|
|
@@ -67,7 +71,9 @@
|
|
|
67
71
|
on:confirm={handleCreate}
|
|
68
72
|
loading={creating}
|
|
69
73
|
>
|
|
70
|
-
<
|
|
74
|
+
<div class="note">Organizations can be used across HYVOR products.</div>
|
|
75
|
+
|
|
76
|
+
<SplitControl label="Name" column noHorizonalPadding>
|
|
71
77
|
<TextInput
|
|
72
78
|
name="organizationName"
|
|
73
79
|
bind:value={name}
|
|
@@ -82,3 +88,10 @@
|
|
|
82
88
|
/>
|
|
83
89
|
</SplitControl>
|
|
84
90
|
</Modal>
|
|
91
|
+
|
|
92
|
+
<style>
|
|
93
|
+
.note {
|
|
94
|
+
color: var(--text-light);
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -21,9 +21,15 @@
|
|
|
21
21
|
show?: boolean;
|
|
22
22
|
style?: 'bordered' | 'plain';
|
|
23
23
|
dropdownAlign?: DropdownAlign;
|
|
24
|
+
manageButton?: boolean;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
let {
|
|
27
|
+
let {
|
|
28
|
+
show = $bindable(false),
|
|
29
|
+
style = 'plain',
|
|
30
|
+
dropdownAlign = 'center',
|
|
31
|
+
manageButton = true
|
|
32
|
+
}: Props = $props();
|
|
27
33
|
let switching = $state(false);
|
|
28
34
|
|
|
29
35
|
async function handleSwitch(org: BarOrganization) {
|
|
@@ -54,13 +60,15 @@
|
|
|
54
60
|
{#if switching}
|
|
55
61
|
<span class="switching">Switching...</span>
|
|
56
62
|
{:else}
|
|
57
|
-
{$barUser.
|
|
63
|
+
{$barUser.current_organization
|
|
64
|
+
? $barUser.current_organization.name
|
|
65
|
+
: 'Organization'}
|
|
58
66
|
{/if}
|
|
59
67
|
<IconChevronExpand size={12} />
|
|
60
68
|
</button>
|
|
61
69
|
{/snippet}
|
|
62
70
|
{#snippet content()}
|
|
63
|
-
<OrgsList onSwitch={handleSwitch} onCreateStart={handleCreateOrgStart} />
|
|
71
|
+
<OrgsList onSwitch={handleSwitch} onCreateStart={handleCreateOrgStart} {manageButton} />
|
|
64
72
|
{/snippet}
|
|
65
73
|
</Dropdown>
|
|
66
74
|
{/if}
|
|
@@ -73,11 +81,13 @@
|
|
|
73
81
|
font-weight: 600;
|
|
74
82
|
transition: 0.2s background-color;
|
|
75
83
|
padding: 0 15px;
|
|
84
|
+
border-radius: 20px;
|
|
76
85
|
}
|
|
77
86
|
button.bordered {
|
|
78
87
|
border: 1px solid var(--border);
|
|
79
88
|
border-top: none;
|
|
80
89
|
border-bottom: none;
|
|
90
|
+
border-radius: 0;
|
|
81
91
|
}
|
|
82
92
|
button:hover {
|
|
83
93
|
background-color: var(--hover);
|
|
@@ -8,6 +8,7 @@ interface Props {
|
|
|
8
8
|
show?: boolean;
|
|
9
9
|
style?: 'bordered' | 'plain';
|
|
10
10
|
dropdownAlign?: DropdownAlign;
|
|
11
|
+
manageButton?: boolean;
|
|
11
12
|
}
|
|
12
13
|
declare const OrganizationButton: import("svelte").Component<Props, {}, "show">;
|
|
13
14
|
type OrganizationButton = ReturnType<typeof OrganizationButton>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const OrganizationButtonOrCreator: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type OrganizationButtonOrCreator = InstanceType<typeof OrganizationButtonOrCreator>;
|
|
18
|
+
export default OrganizationButtonOrCreator;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import {
|
|
6
6
|
barOrganizationCreating,
|
|
7
7
|
barOrganizations,
|
|
8
|
+
barUser,
|
|
8
9
|
getMyOrganizations,
|
|
9
10
|
instance,
|
|
10
11
|
type BarOrganization
|
|
@@ -20,10 +21,12 @@
|
|
|
20
21
|
|
|
21
22
|
let {
|
|
22
23
|
onSwitch,
|
|
23
|
-
onCreateStart
|
|
24
|
+
onCreateStart,
|
|
25
|
+
manageButton = true
|
|
24
26
|
}: {
|
|
25
27
|
onSwitch: (org: BarOrganization) => void;
|
|
26
28
|
onCreateStart: () => void;
|
|
29
|
+
manageButton?: boolean;
|
|
27
30
|
} = $props();
|
|
28
31
|
|
|
29
32
|
onMount(() => {
|
|
@@ -58,18 +61,24 @@
|
|
|
58
61
|
</IconMessage>
|
|
59
62
|
{:else}
|
|
60
63
|
<div class="list-wrap">
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{org
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
{#if $barOrganizations.length}
|
|
65
|
+
<ActionList>
|
|
66
|
+
{#each $barOrganizations as org}
|
|
67
|
+
<ActionListItem on:select={() => onSwitch(org)}>
|
|
68
|
+
{org.name}
|
|
69
|
+
{#snippet end()}
|
|
70
|
+
<span class="role">
|
|
71
|
+
{org.role.toUpperCase()}
|
|
72
|
+
</span>
|
|
73
|
+
{/snippet}
|
|
74
|
+
</ActionListItem>
|
|
75
|
+
{/each}
|
|
76
|
+
</ActionList>
|
|
77
|
+
{:else}
|
|
78
|
+
<div class="no-orgs">
|
|
79
|
+
You are not a member of any organizations. You can create one to use HYVOR products.
|
|
80
|
+
</div>
|
|
81
|
+
{/if}
|
|
73
82
|
</div>
|
|
74
83
|
|
|
75
84
|
<div class="manage-create">
|
|
@@ -79,19 +88,22 @@
|
|
|
79
88
|
<IconPlus />
|
|
80
89
|
{/snippet}
|
|
81
90
|
</Button>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
|
|
92
|
+
{#if manageButton && $barUser?.current_organization_name}
|
|
93
|
+
<Button
|
|
94
|
+
size="small"
|
|
95
|
+
as="a"
|
|
96
|
+
href={$instance + '/account/org'}
|
|
97
|
+
color="input"
|
|
98
|
+
target="_blank"
|
|
99
|
+
rel="noopener noreferrer"
|
|
100
|
+
>
|
|
101
|
+
Manage
|
|
102
|
+
{#snippet end()}
|
|
103
|
+
<IconBoxArrowUpRight size={12} />
|
|
104
|
+
{/snippet}
|
|
105
|
+
</Button>
|
|
106
|
+
{/if}
|
|
95
107
|
</div>
|
|
96
108
|
{/if}
|
|
97
109
|
|
|
@@ -117,4 +129,10 @@
|
|
|
117
129
|
.manage-create :global(a) {
|
|
118
130
|
text-decoration: none !important;
|
|
119
131
|
}
|
|
132
|
+
|
|
133
|
+
.no-orgs {
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
color: var(--text-light);
|
|
136
|
+
padding: 15px;
|
|
137
|
+
}
|
|
120
138
|
</style>
|
|
@@ -2,6 +2,7 @@ import { type BarOrganization } from '../bar.js';
|
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
onSwitch: (org: BarOrganization) => void;
|
|
4
4
|
onCreateStart: () => void;
|
|
5
|
+
manageButton?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const OrgsList: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
8
|
type OrgsList = ReturnType<typeof OrgsList>;
|
|
@@ -10,7 +10,9 @@ export interface BarUser {
|
|
|
10
10
|
username?: string | null;
|
|
11
11
|
email: string;
|
|
12
12
|
picture_url: string | null;
|
|
13
|
-
|
|
13
|
+
current_organization: null | {
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
14
16
|
}
|
|
15
17
|
export interface BarOrganization {
|
|
16
18
|
id: number;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { type ToDotPaths, type I18nStrings, type PrimitiveType } from './types.js';
|
|
2
2
|
import { type Component } from 'svelte';
|
|
3
|
-
declare
|
|
4
|
-
props
|
|
3
|
+
declare function $$render<StringsT extends I18nStrings>(): {
|
|
4
|
+
props: {
|
|
5
5
|
key: ToDotPaths<StringsT>;
|
|
6
6
|
params?: Record<string, PrimitiveType | {
|
|
7
7
|
element?: string;
|
|
8
8
|
component?: Component<any>;
|
|
9
9
|
props?: Record<string, any>;
|
|
10
|
-
}
|
|
10
|
+
}>;
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
exports: {};
|
|
13
|
+
bindings: "";
|
|
14
|
+
slots: {};
|
|
15
|
+
events: {};
|
|
16
|
+
};
|
|
17
|
+
declare class __sveltets_Render<StringsT extends I18nStrings> {
|
|
18
|
+
props(): ReturnType<typeof $$render<StringsT>>['props'];
|
|
19
|
+
events(): ReturnType<typeof $$render<StringsT>>['events'];
|
|
20
|
+
slots(): ReturnType<typeof $$render<StringsT>>['slots'];
|
|
14
21
|
bindings(): "";
|
|
15
22
|
exports(): {};
|
|
16
23
|
}
|
|
@@ -6,6 +6,6 @@ interface Props {
|
|
|
6
6
|
children?: import('svelte').Snippet;
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
}
|
|
9
|
-
declare const Radio: import("svelte").Component<Props, {}, "
|
|
9
|
+
declare const Radio: import("svelte").Component<Props, {}, "input" | "group">;
|
|
10
10
|
type Radio = ReturnType<typeof Radio>;
|
|
11
11
|
export default Radio;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
flex?: number[];
|
|
11
11
|
children?: Snippet;
|
|
12
12
|
nested?: Snippet;
|
|
13
|
+
noHorizonalPadding?: boolean;
|
|
13
14
|
[key: string]: any;
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
flex = [1, 2],
|
|
21
22
|
children,
|
|
22
23
|
nested,
|
|
24
|
+
noHorizonalPadding = false,
|
|
23
25
|
...rest
|
|
24
26
|
}: Props = $props();
|
|
25
27
|
</script>
|
|
@@ -28,6 +30,7 @@
|
|
|
28
30
|
class="split-control"
|
|
29
31
|
class:has-nested={!!nested}
|
|
30
32
|
class:column
|
|
33
|
+
class:no-hpadding={noHorizonalPadding}
|
|
31
34
|
aria-label={typeof label === 'string' ? label : undefined}
|
|
32
35
|
{...rest}
|
|
33
36
|
>
|
|
@@ -76,6 +79,9 @@
|
|
|
76
79
|
.split-control.column {
|
|
77
80
|
flex-direction: column;
|
|
78
81
|
}
|
|
82
|
+
.split-control.column .left {
|
|
83
|
+
padding-bottom: 10px;
|
|
84
|
+
}
|
|
79
85
|
.split-control.column .right {
|
|
80
86
|
padding-top: 0;
|
|
81
87
|
}
|
|
@@ -97,6 +103,12 @@
|
|
|
97
103
|
min-width: 0;
|
|
98
104
|
}
|
|
99
105
|
|
|
106
|
+
.no-hpadding .left,
|
|
107
|
+
.no-hpadding .right {
|
|
108
|
+
padding-left: 0;
|
|
109
|
+
padding-right: 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
100
112
|
.caption-wrap {
|
|
101
113
|
margin-top: 4px;
|
|
102
114
|
}</style>
|
|
@@ -4,6 +4,6 @@ interface Props {
|
|
|
4
4
|
children?: import('svelte').Snippet;
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
}
|
|
7
|
-
declare const Switch: import("svelte").Component<Props, {}, "
|
|
7
|
+
declare const Switch: import("svelte").Component<Props, {}, "input" | "checked">;
|
|
8
8
|
type Switch = ReturnType<typeof Switch>;
|
|
9
9
|
export default Switch;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { legacyHandlers } from '../../legacy.js';
|
|
3
|
-
import { createBubbler } from 'svelte/legacy';
|
|
4
|
-
|
|
5
|
-
const bubble = createBubbler();
|
|
6
|
-
|
|
7
2
|
interface Props {
|
|
8
3
|
state?: 'default' | 'error' | 'success' | 'warning';
|
|
9
4
|
size?: 'small' | 'medium' | 'large' | 'x-small';
|
|
@@ -26,7 +21,7 @@
|
|
|
26
21
|
onmouseenter?: (event: MouseEvent) => void;
|
|
27
22
|
onmouseleave?: (event: MouseEvent) => void;
|
|
28
23
|
onchange?: (event: Event) => void;
|
|
29
|
-
oninput?: (event:
|
|
24
|
+
oninput?: (event: Event) => void;
|
|
30
25
|
}
|
|
31
26
|
|
|
32
27
|
let {
|
|
@@ -68,17 +63,17 @@
|
|
|
68
63
|
{...rest}
|
|
69
64
|
bind:value
|
|
70
65
|
bind:this={selectInput}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
{onkeyup}
|
|
67
|
+
{onkeydown}
|
|
68
|
+
{onkeypress}
|
|
69
|
+
{onfocus}
|
|
70
|
+
{onblur}
|
|
71
|
+
{onclick}
|
|
72
|
+
{onmouseover}
|
|
73
|
+
{onmouseenter}
|
|
74
|
+
{onmouseleave}
|
|
75
|
+
{onchange}
|
|
76
|
+
{oninput}
|
|
82
77
|
>
|
|
83
78
|
{@render rest?.children()}
|
|
84
79
|
</select>
|
|
@@ -87,17 +82,17 @@
|
|
|
87
82
|
{...rest}
|
|
88
83
|
bind:value
|
|
89
84
|
bind:this={input}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
85
|
+
{onkeyup}
|
|
86
|
+
{onkeydown}
|
|
87
|
+
{onkeypress}
|
|
88
|
+
{onfocus}
|
|
89
|
+
{onblur}
|
|
90
|
+
{onclick}
|
|
91
|
+
{onmouseover}
|
|
92
|
+
{onmouseenter}
|
|
93
|
+
{onmouseleave}
|
|
94
|
+
{onchange}
|
|
95
|
+
{oninput}
|
|
101
96
|
/>
|
|
102
97
|
{/if}
|
|
103
98
|
|
|
@@ -19,8 +19,8 @@ interface Props {
|
|
|
19
19
|
onmouseenter?: (event: MouseEvent) => void;
|
|
20
20
|
onmouseleave?: (event: MouseEvent) => void;
|
|
21
21
|
onchange?: (event: Event) => void;
|
|
22
|
-
oninput?: (event:
|
|
22
|
+
oninput?: (event: Event) => void;
|
|
23
23
|
}
|
|
24
|
-
declare const TextInput: import("svelte").Component<Props, {}, "
|
|
24
|
+
declare const TextInput: import("svelte").Component<Props, {}, "input" | "value" | "selectInput">;
|
|
25
25
|
type TextInput = ReturnType<typeof TextInput>;
|
|
26
26
|
export default TextInput;
|
|
@@ -88,12 +88,14 @@
|
|
|
88
88
|
overflow: auto;
|
|
89
89
|
align-items: flex-start;
|
|
90
90
|
justify-content: center;
|
|
91
|
-
--local-shadow-size: 2px;
|
|
92
91
|
}
|
|
93
92
|
.input-wrap:focus-within {
|
|
94
93
|
outline: 0;
|
|
95
94
|
box-shadow: 0 0 0 var(--local-shadow-size) var(--accent-light);
|
|
96
95
|
}
|
|
96
|
+
.input-wrap {
|
|
97
|
+
--local-shadow-size: 2px;
|
|
98
|
+
}
|
|
97
99
|
|
|
98
100
|
.input-wrap.block {
|
|
99
101
|
display: block;
|
|
@@ -147,8 +149,10 @@
|
|
|
147
149
|
background: transparent;
|
|
148
150
|
padding: 0;
|
|
149
151
|
margin: 0;
|
|
150
|
-
resize: none;
|
|
151
152
|
}
|
|
152
153
|
.input-wrap textarea:focus {
|
|
153
154
|
outline: none;
|
|
155
|
+
}
|
|
156
|
+
.input-wrap textarea {
|
|
157
|
+
resize: none;
|
|
154
158
|
}</style>
|
package/package.json
CHANGED
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"./marketing": {
|
|
22
22
|
"types": "./dist/marketing/index.d.ts",
|
|
23
23
|
"svelte": "./dist/marketing/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./cloud": {
|
|
26
|
+
"types": "./dist/cloud/index.d.ts",
|
|
27
|
+
"svelte": "./dist/cloud/index.js"
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
"files": [
|
|
@@ -29,14 +33,14 @@
|
|
|
29
33
|
"!dist/**/*.spec.*"
|
|
30
34
|
],
|
|
31
35
|
"peerDependencies": {
|
|
32
|
-
"@sveltejs/kit": "^2.
|
|
36
|
+
"@sveltejs/kit": "^2.49.0",
|
|
33
37
|
"sass": "^1.68.0",
|
|
34
38
|
"svelte": "^5.0.0"
|
|
35
39
|
},
|
|
36
40
|
"devDependencies": {
|
|
37
41
|
"@sveltejs/adapter-static": "^3.0.0",
|
|
38
42
|
"@sveltejs/package": "^2.3.7",
|
|
39
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
43
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
40
44
|
"prettier": "3.4.2",
|
|
41
45
|
"prettier-plugin-svelte": "3.3.3",
|
|
42
46
|
"publint": "^0.1.9",
|
|
@@ -44,7 +48,7 @@
|
|
|
44
48
|
"svelte-check": "^4.0.0",
|
|
45
49
|
"tslib": "^2.4.1",
|
|
46
50
|
"typescript": "^5.5.0",
|
|
47
|
-
"vite": "^
|
|
51
|
+
"vite": "^7.2"
|
|
48
52
|
},
|
|
49
53
|
"dependencies": {
|
|
50
54
|
"@fontsource/readex-pro": "^5.0.8",
|
|
@@ -62,5 +66,5 @@
|
|
|
62
66
|
"publishConfig": {
|
|
63
67
|
"access": "public"
|
|
64
68
|
},
|
|
65
|
-
"version": "1.1.25-beta-org-
|
|
69
|
+
"version": "1.1.25-beta-org-7"
|
|
66
70
|
}
|