@hyvor/design 2.0.8-beta.3 → 2.0.8-beta.4

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.
@@ -8,7 +8,11 @@
8
8
  import { getCloudContext } from '../CloudContext/cloudContextState.svelte.js';
9
9
 
10
10
  const cloudContext = $derived(getCloudContext());
11
- const logoutUrl = `${cloudContext.instance}/account/logout`;
11
+ const logoutUrl = $derived(
12
+ cloudContext.deployment === 'cloud'
13
+ ? `${cloudContext.instance}/account/logout`
14
+ : '/api/oidc/logout'
15
+ );
12
16
  </script>
13
17
 
14
18
  <div class="wrap">
@@ -80,16 +80,21 @@
80
80
  {getName()}
81
81
  </span>
82
82
  </a>
83
- <BarProducts mobile={mobileShow} />
84
83
 
85
- {#if organization}
86
- <BarOrganization />
84
+ {#if deployment === 'cloud'}
85
+ <BarProducts mobile={mobileShow} />
86
+
87
+ {#if organization}
88
+ <BarOrganization />
89
+ {/if}
90
+ <BarLicense name={getName()} />
87
91
  {/if}
88
- <BarLicense name={getName()} />
89
92
  </div>
90
93
  <div class="center"></div>
91
94
  <div class="right">
92
- <BarNotice />
95
+ {#if deployment === 'cloud'}
96
+ <BarNotice />
97
+ {/if}
93
98
 
94
99
  <div class="hidden-on-mobile">
95
100
  {#if deployment === 'cloud'}
@@ -94,8 +94,10 @@
94
94
  {#if loading}
95
95
  <Loader size="small" />
96
96
  {/if}
97
- <Button size="large" onclick={onButtonClick} disabled={loading || buttonDisabled}
98
- >{buttonText}</Button
97
+ <Button
98
+ size="large"
99
+ onclick={onButtonClick}
100
+ disabled={loading || buttonDisabled}>{buttonText}</Button
99
101
  >
100
102
  </div>
101
103
  </div>
@@ -1,8 +1,6 @@
1
1
  <script lang="ts">
2
2
  import IconButton from '../../components/IconButton/IconButton.svelte';
3
3
  import IconX from '@hyvor/icons/IconX';
4
- import Button from '../../components/Button/Button.svelte';
5
- import { onMount, type ComponentProps } from 'svelte';
6
4
  import {
7
5
  getCloudContext,
8
6
  type CloudContextOrganization
@@ -56,7 +54,7 @@
56
54
  ondisplay
57
55
  }: Props = $props();
58
56
 
59
- const { callbacks, organization } = $derived(getCloudContext());
57
+ const { callbacks, organization, deployment } = $derived(getCloudContext());
60
58
 
61
59
  let orgName = $state('');
62
60
  let orgNameError = $state('');
@@ -130,62 +128,64 @@
130
128
  </div>
131
129
 
132
130
  <div class="content">
133
- <Accordian
134
- title="Organization"
135
- belowTitle={organization?.name}
136
- show={organizationAccordianOpen}
137
- footer={!organization}
138
- buttonText="Create Organization"
139
- onButtonClick={handleOrganizationCreation}
140
- onToggle={() => {
141
- organizationAccordianOpen = !organizationAccordianOpen;
131
+ {#if deployment === 'cloud'}
132
+ <Accordian
133
+ title="Organization"
134
+ belowTitle={organization?.name}
135
+ show={organizationAccordianOpen}
136
+ footer={!organization}
137
+ buttonText="Create Organization"
138
+ onButtonClick={handleOrganizationCreation}
139
+ onToggle={() => {
140
+ organizationAccordianOpen = !organizationAccordianOpen;
142
141
 
143
- if (organizationAccordianOpen && contentAccordianOpen) {
144
- contentAccordianOpen = false;
145
- }
146
- }}
147
- toggleLocked={creatingResource}
148
- loading={creatingOrganization}
149
- >
150
- {#if organization}
151
- <div class="org-switcher">
152
- <OrganizationSwitcher
153
- manageButton={false}
154
- createButtonText="Create new organization"
155
- createButtonProps={{
156
- size: 'medium',
157
- color: 'input'
158
- }}
159
- />
160
- </div>
161
- {:else}
162
- <div class="org-creator">
163
- <FormControl>
164
- <TextInput
165
- bind:value={orgName}
166
- bind:input={orgNameInput}
167
- block
168
- placeholder="Organization Name"
169
- disabled={creatingOrganization}
170
- onkeyup={(e) => {
171
- if (e.key === 'Enter') {
172
- handleOrganizationCreation();
173
- }
142
+ if (organizationAccordianOpen && contentAccordianOpen) {
143
+ contentAccordianOpen = false;
144
+ }
145
+ }}
146
+ toggleLocked={creatingResource}
147
+ loading={creatingOrganization}
148
+ >
149
+ {#if organization}
150
+ <div class="org-switcher">
151
+ <OrganizationSwitcher
152
+ manageButton={false}
153
+ createButtonText="Create new organization"
154
+ createButtonProps={{
155
+ size: 'medium',
156
+ color: 'input'
174
157
  }}
175
158
  />
159
+ </div>
160
+ {:else}
161
+ <div class="org-creator">
162
+ <FormControl>
163
+ <TextInput
164
+ bind:value={orgName}
165
+ bind:input={orgNameInput}
166
+ block
167
+ placeholder="Organization Name"
168
+ disabled={creatingOrganization}
169
+ onkeyup={(e) => {
170
+ if (e.key === 'Enter') {
171
+ handleOrganizationCreation();
172
+ }
173
+ }}
174
+ />
176
175
 
177
- {#if orgNameError}
178
- <Validation state="error">{orgNameError}</Validation>
179
- {/if}
180
- </FormControl>
176
+ {#if orgNameError}
177
+ <Validation state="error">{orgNameError}</Validation>
178
+ {/if}
179
+ </FormControl>
181
180
 
182
- <div class="org-note">
183
- <IconInfoCircle size={12} />
184
- Organizations can be used across HYVOR products.
181
+ <div class="org-note">
182
+ <IconInfoCircle size={12} />
183
+ Organizations can be used across HYVOR products.
184
+ </div>
185
185
  </div>
186
- </div>
187
- {/if}
188
- </Accordian>
186
+ {/if}
187
+ </Accordian>
188
+ {/if}
189
189
 
190
190
  <Accordian
191
191
  title={resourceTitle}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyvor/design",
3
- "version": "2.0.8-beta.3",
3
+ "version": "2.0.8-beta.4",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "repository": {