@hyvor/design 2.0.7 → 2.0.8-beta.1
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/BarNotice/BarLicense.svelte +16 -7
- package/dist/cloud/HyvorBar/BarNotice/BarLicense.svelte.d.ts +10 -3
- package/dist/cloud/index.d.ts +1 -0
- package/dist/cloud/index.js +1 -0
- package/dist/components/Modal/modal-types.d.ts +2 -0
- package/dist/components/Tag/Tag.svelte +2 -1
- package/dist/components/Tag/Tag.svelte.d.ts +2 -1
- package/dist/components/Tag/tag.types.d.ts +1 -0
- package/dist/components/Tag/tag.types.js +1 -0
- package/package.json +1 -1
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getCloudContext } from '../../CloudContext/cloudContextState.svelte.js';
|
|
2
|
+
import { getCloudContext, type ResolvedLicense } from '../../CloudContext/cloudContextState.svelte.js';
|
|
3
3
|
import Tag from '../../../components/Tag/Tag.svelte';
|
|
4
|
+
import type { TagSize } from '../../../components/Tag/tag.types.js';
|
|
4
5
|
import Tooltip from '../../../components/Tooltip/Tooltip.svelte';
|
|
5
6
|
import IconBuilding from '@hyvor/icons/IconBuilding';
|
|
6
7
|
import type { Component } from 'svelte';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
interface Props {
|
|
10
|
+
name: string; // product name like Hyvor Talk
|
|
11
|
+
customLicense?: ResolvedLicense;
|
|
12
|
+
size?: TagSize;
|
|
13
|
+
tooltip?: boolean;
|
|
14
|
+
href?: string | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let { name, customLicense, size = 'medium', tooltip: showTooltip = true, href = "/console/billing" }: Props = $props();
|
|
9
18
|
|
|
10
|
-
const
|
|
19
|
+
const license = $derived(customLicense || getCloudContext().license);
|
|
11
20
|
|
|
12
21
|
function daysDiff(unix: number) {
|
|
13
22
|
const date = new Date(unix * 1000);
|
|
@@ -72,7 +81,7 @@
|
|
|
72
81
|
const s = trialDays === 1 ? '' : 's';
|
|
73
82
|
|
|
74
83
|
return {
|
|
75
|
-
name: `Trial
|
|
84
|
+
name: `Trial (${trialDays}d)`,
|
|
76
85
|
tooltip: `You organization is currently using a trial license for ${name}. It will expire in ${trialDays} day${s}.`,
|
|
77
86
|
tagColor: 'orange'
|
|
78
87
|
};
|
|
@@ -91,12 +100,12 @@
|
|
|
91
100
|
</script>
|
|
92
101
|
|
|
93
102
|
{#if config}
|
|
94
|
-
<a class="wrap" href=
|
|
95
|
-
<Tooltip position="bottom">
|
|
103
|
+
<a class="wrap" href={href}>
|
|
104
|
+
<Tooltip position="bottom" disabled={showTooltip === false}>
|
|
96
105
|
{#snippet tooltip()}
|
|
97
106
|
{config.tooltip}
|
|
98
107
|
{/snippet}
|
|
99
|
-
<Tag color={config.tagColor}>
|
|
108
|
+
<Tag color={config.tagColor} {size}>
|
|
100
109
|
{#snippet start()}
|
|
101
110
|
{#if config.tagIcon}
|
|
102
111
|
<config.tagIcon size={10} />
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { type ResolvedLicense } from '../../CloudContext/cloudContextState.svelte.js';
|
|
2
|
+
import type { TagSize } from '../../../components/Tag/tag.types.js';
|
|
1
3
|
import type { Component } from 'svelte';
|
|
2
|
-
|
|
3
|
-
name:
|
|
4
|
-
|
|
4
|
+
interface Props {
|
|
5
|
+
name: string;
|
|
6
|
+
customLicense?: ResolvedLicense;
|
|
7
|
+
size?: TagSize;
|
|
8
|
+
tooltip?: boolean;
|
|
9
|
+
href?: string | null;
|
|
10
|
+
}
|
|
11
|
+
declare const BarLicense: Component<Props, {}, "">;
|
|
5
12
|
type BarLicense = ReturnType<typeof BarLicense>;
|
|
6
13
|
export default BarLicense;
|
package/dist/cloud/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as CloudContext } from './CloudContext/CloudContext.svelte';
|
|
|
2
2
|
export { getCloudContext, setCloudContext, type CloudContext as CloudContextType, type CloudContextUser, type CloudContextOrganization, type OrganizationRole, type OrganizationMember, type ResolvedLicense } from './CloudContext/cloudContextState.svelte.js';
|
|
3
3
|
export { default as HyvorBar } from './HyvorBar/HyvorBar.svelte';
|
|
4
4
|
export { bar as hyvorBar } from './HyvorBar/bar.js';
|
|
5
|
+
export { default as BarLicense } from './HyvorBar/BarNotice/BarLicense.svelte';
|
|
5
6
|
export { default as ResourceCreator } from './ResourceCreator/ResourceCreator.svelte';
|
|
6
7
|
export { default as OrganizationMemberSearch } from './OrganizationMembers/OrganizationMembersSearch.svelte';
|
|
7
8
|
export { default as OrganizationCreator } from './OrganizationCreator/OrganizationCreator.svelte';
|
package/dist/cloud/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { default as CloudContext } from './CloudContext/CloudContext.svelte';
|
|
|
2
2
|
export { getCloudContext, setCloudContext } from './CloudContext/cloudContextState.svelte.js';
|
|
3
3
|
export { default as HyvorBar } from './HyvorBar/HyvorBar.svelte';
|
|
4
4
|
export { bar as hyvorBar } from './HyvorBar/bar.js';
|
|
5
|
+
export { default as BarLicense } from './HyvorBar/BarNotice/BarLicense.svelte';
|
|
5
6
|
export { default as ResourceCreator } from './ResourceCreator/ResourceCreator.svelte';
|
|
6
7
|
export { default as OrganizationMemberSearch } from './OrganizationMembers/OrganizationMembersSearch.svelte';
|
|
7
8
|
export { default as OrganizationCreator } from './OrganizationCreator/OrganizationCreator.svelte';
|
|
@@ -8,10 +8,12 @@ export interface Footer {
|
|
|
8
8
|
*/
|
|
9
9
|
cancel?: false | {
|
|
10
10
|
text?: string;
|
|
11
|
+
disabled?: boolean;
|
|
11
12
|
props?: ComponentProps<typeof Button>;
|
|
12
13
|
};
|
|
13
14
|
confirm?: false | {
|
|
14
15
|
danger?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
15
17
|
text?: string;
|
|
16
18
|
props?: ComponentProps<typeof Button>;
|
|
17
19
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createBubbler } from 'svelte/legacy';
|
|
3
|
+
import type { TagSize } from './tag.types.js';
|
|
3
4
|
|
|
4
5
|
const bubble = createBubbler();
|
|
5
6
|
|
|
6
7
|
interface Props {
|
|
7
8
|
as?: 'button' | 'a' | 'span';
|
|
8
|
-
size?:
|
|
9
|
+
size?: TagSize;
|
|
9
10
|
color?:
|
|
10
11
|
| 'default' // default tag (categories)
|
|
11
12
|
| 'accent'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { TagSize } from './tag.types.js';
|
|
1
2
|
interface Props {
|
|
2
3
|
as?: 'button' | 'a' | 'span';
|
|
3
|
-
size?:
|
|
4
|
+
size?: TagSize;
|
|
4
5
|
color?: 'default' | 'accent' | 'green' | 'red' | 'blue' | 'orange';
|
|
5
6
|
interactive?: boolean;
|
|
6
7
|
outline?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TagSize = 'x-small' | 'small' | 'medium' | 'large';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|