@hyvor/design 2.0.17 → 2.0.19
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/CloudContext/cloudContextState.svelte.d.ts +13 -0
- package/dist/cloud/HyvorBar/BarNotice/BarLicense.svelte +78 -19
- package/dist/cloud/index.d.ts +1 -1
- package/dist/components/Callout/Callout.svelte +3 -2
- package/dist/marketing/Docs/Content/Content.svelte +4 -0
- package/package.json +1 -1
|
@@ -70,10 +70,23 @@ export interface ResolvedLicense {
|
|
|
70
70
|
type: 'enterprise_contract' | 'subscription' | 'trial' | 'expired' | 'none';
|
|
71
71
|
license: Record<string, number | boolean> | null;
|
|
72
72
|
subscription: null | {
|
|
73
|
+
id: number;
|
|
74
|
+
status: string;
|
|
75
|
+
monthly_price: number;
|
|
76
|
+
is_annual: boolean;
|
|
77
|
+
plan: string;
|
|
78
|
+
plan_version: number;
|
|
73
79
|
plan_readable_name: string;
|
|
74
80
|
cancel_at: null | number;
|
|
81
|
+
is_legacy_paddle: boolean;
|
|
75
82
|
};
|
|
76
83
|
trial_ends_at: null | number;
|
|
84
|
+
complimentary_licenses: ResolvedComplimentaryLicense[];
|
|
85
|
+
}
|
|
86
|
+
export interface ResolvedComplimentaryLicense {
|
|
87
|
+
provider: string;
|
|
88
|
+
type: 'trial' | 'subscription';
|
|
89
|
+
license: Record<string, number | boolean>;
|
|
77
90
|
}
|
|
78
91
|
export interface OrganizationMember {
|
|
79
92
|
id: number;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import Tooltip from '../../../components/Tooltip/Tooltip.svelte';
|
|
5
5
|
import IconBuilding from '@hyvor/icons/IconBuilding';
|
|
6
6
|
import type { Component } from 'svelte';
|
|
7
|
+
import { PRODUCTS } from '../BarProducts/products.js';
|
|
7
8
|
|
|
8
9
|
let { name } = $props();
|
|
9
10
|
|
|
@@ -36,11 +37,11 @@
|
|
|
36
37
|
interface Config {
|
|
37
38
|
name: string;
|
|
38
39
|
tooltip: string;
|
|
39
|
-
tagColor: 'green' | 'blue' | 'red' | 'orange';
|
|
40
|
+
tagColor: 'green' | 'blue' | 'red' | 'orange' | 'default';
|
|
40
41
|
tagIcon?: Component;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
let
|
|
44
|
+
let mainConfig: Config | null = $derived.by(() => {
|
|
44
45
|
if (!license) {
|
|
45
46
|
return null;
|
|
46
47
|
}
|
|
@@ -79,6 +80,11 @@
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
if (license.type === 'expired') {
|
|
83
|
+
if (license.complimentary_licenses.length > 0) {
|
|
84
|
+
// if the org has a complimentary license, we do not show the "Expired" tag to prevent confusing the user
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
82
88
|
return {
|
|
83
89
|
name: `License Expired`,
|
|
84
90
|
tooltip: `Your organization's license for ${name} has expired. Please renew or upgrade to continue using the service.`,
|
|
@@ -88,30 +94,83 @@
|
|
|
88
94
|
|
|
89
95
|
return null;
|
|
90
96
|
});
|
|
97
|
+
|
|
98
|
+
let complimentaryConfig: Config | null = $derived.by(() => {
|
|
99
|
+
if (!license) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (!license.complimentary_licenses.length) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// for now, we only care about the 1st one
|
|
108
|
+
// we may later add other licenses
|
|
109
|
+
const complimentaryLicense = license.complimentary_licenses[0];
|
|
110
|
+
const providerName = PRODUCTS[complimentaryLicense.provider].name;
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
name: 'Complimentary',
|
|
114
|
+
tooltip: `Your organization has a complimentary license for ${name} thanks to your ${providerName} ${complimentaryLicense.type}.`,
|
|
115
|
+
tagColor: 'default'
|
|
116
|
+
};
|
|
117
|
+
});
|
|
91
118
|
</script>
|
|
92
119
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
{#
|
|
102
|
-
|
|
103
|
-
|
|
120
|
+
<div class="outer">
|
|
121
|
+
{#if mainConfig}
|
|
122
|
+
<a class="wrap" href="/console/billing">
|
|
123
|
+
<Tooltip position="bottom">
|
|
124
|
+
{#snippet tooltip()}
|
|
125
|
+
{mainConfig.tooltip}
|
|
126
|
+
{/snippet}
|
|
127
|
+
<Tag color={mainConfig.tagColor}>
|
|
128
|
+
{#snippet start()}
|
|
129
|
+
{#if mainConfig.tagIcon}
|
|
130
|
+
<mainConfig.tagIcon size={10} />
|
|
131
|
+
{/if}
|
|
132
|
+
{/snippet}
|
|
133
|
+
{mainConfig.name}
|
|
134
|
+
</Tag>
|
|
135
|
+
</Tooltip>
|
|
136
|
+
</a>
|
|
137
|
+
{/if}
|
|
138
|
+
|
|
139
|
+
{#if mainConfig && complimentaryConfig}
|
|
140
|
+
<span class="pls">+</span>
|
|
141
|
+
{/if}
|
|
142
|
+
|
|
143
|
+
{#if complimentaryConfig}
|
|
144
|
+
<a class="wrap complimentary" href="/console/billing">
|
|
145
|
+
<Tooltip position="bottom">
|
|
146
|
+
{#snippet tooltip()}
|
|
147
|
+
{complimentaryConfig.tooltip}
|
|
104
148
|
{/snippet}
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
149
|
+
<Tag color={complimentaryConfig.tagColor}>
|
|
150
|
+
{complimentaryConfig.name}
|
|
151
|
+
</Tag>
|
|
152
|
+
</Tooltip>
|
|
153
|
+
</a>
|
|
154
|
+
{/if}
|
|
155
|
+
</div>
|
|
110
156
|
|
|
111
157
|
<style>
|
|
158
|
+
.outer {
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
padding: 0 20px;
|
|
162
|
+
}
|
|
163
|
+
|
|
112
164
|
.wrap {
|
|
113
165
|
display: inline-flex;
|
|
114
166
|
align-items: center;
|
|
115
|
-
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.pls {
|
|
170
|
+
display: inline-flex;
|
|
171
|
+
margin: 0 6px;
|
|
172
|
+
color: var(--text-light);
|
|
173
|
+
font-size: 12px;
|
|
174
|
+
font-weight: normal;
|
|
116
175
|
}
|
|
117
176
|
</style>
|
package/dist/cloud/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as CloudContext } from './CloudContext/CloudContext.svelte';
|
|
2
|
-
export { getCloudContext, setCloudContext, type CloudContext as CloudContextType, type CloudContextUser, type CloudContextOrganization, type OrganizationRole, type OrganizationMember, type ResolvedLicense } from './CloudContext/cloudContextState.svelte.js';
|
|
2
|
+
export { getCloudContext, setCloudContext, type CloudContext as CloudContextType, type CloudContextUser, type CloudContextOrganization, type OrganizationRole, type OrganizationMember, type ResolvedLicense, type ResolvedComplimentaryLicense } 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
5
|
export { default as ResourceCreator } from './ResourceCreator/ResourceCreator.svelte';
|
|
@@ -63,11 +63,12 @@
|
|
|
63
63
|
.callout {
|
|
64
64
|
padding: 15px 25px;
|
|
65
65
|
border-radius: var(--box-radius);
|
|
66
|
-
|
|
66
|
+
line-height: var(--line-height-content);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.callout.soft {
|
|
70
|
-
background-color: var(--
|
|
70
|
+
background-color: var(--gray-light);
|
|
71
|
+
color: var(--gray-dark);
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
.callout.info {
|