@hyvor/design 2.1.8 → 2.1.9

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.
@@ -12,7 +12,7 @@
12
12
  text="You have an unpaid invoice. Please settle to avoid service interruption."
13
13
  position="bottom"
14
14
  >
15
- <a href={instance + '/account/billing?pay-failed'}>
15
+ <a href={instance + '/account/org/billing?pay-failed'}>
16
16
  <Tag color="orange">
17
17
  {#snippet start()}
18
18
  <IconExclamationCircle size={14} />
@@ -0,0 +1,82 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ column?: boolean;
4
+ children?: import('svelte').Snippet;
5
+ }
6
+
7
+ let { column = false, children }: Props = $props();
8
+ </script>
9
+
10
+ <div class="button-group" class:column>
11
+ {@render children?.()}
12
+ </div>
13
+
14
+ <style>.button-group {
15
+ display: inline-flex;
16
+ }
17
+
18
+ .button-group.column {
19
+ flex-direction: column;
20
+ align-items: stretch;
21
+ }
22
+
23
+ .button-group :global(> .button) {
24
+ position: relative;
25
+ }
26
+
27
+ .button-group :global(> .button:hover),
28
+ .button-group :global(> .button:focus-visible) {
29
+ z-index: 1;
30
+ }
31
+
32
+ .button-group:not(.column) :global(> .button:not(:first-child)) {
33
+ border-top-left-radius: 0;
34
+ border-bottom-left-radius: 0;
35
+ }
36
+
37
+ .button-group:not(.column) :global(> .button:not(:last-child)) {
38
+ border-top-right-radius: 0;
39
+ border-bottom-right-radius: 0;
40
+ }
41
+
42
+ .button-group.column :global(> .button:not(:first-child)) {
43
+ border-top-left-radius: 0;
44
+ border-top-right-radius: 0;
45
+ }
46
+
47
+ .button-group.column :global(> .button:not(:last-child)) {
48
+ border-bottom-left-radius: 0;
49
+ border-bottom-right-radius: 0;
50
+ }
51
+
52
+ .button-group:not(.column) :global(> .button:not(:first-child)) {
53
+ margin-left: -1px;
54
+ }
55
+
56
+ .button-group.column :global(> .button:not(:first-child)) {
57
+ margin-top: -1px;
58
+ }
59
+
60
+ .button-group:not(.column) :global(> .button:not(.outline):not(.outline-fill):not(:first-child))::before {
61
+ content: "";
62
+ position: absolute;
63
+ top: 22%;
64
+ bottom: 22%;
65
+ left: 0;
66
+ width: 1px;
67
+ background-color: currentColor;
68
+ opacity: 0.25;
69
+ pointer-events: none;
70
+ }
71
+
72
+ .button-group.column :global(> .button:not(.outline):not(.outline-fill):not(:first-child))::before {
73
+ content: "";
74
+ position: absolute;
75
+ left: 22%;
76
+ right: 22%;
77
+ top: 0;
78
+ height: 1px;
79
+ background-color: currentColor;
80
+ opacity: 0.25;
81
+ pointer-events: none;
82
+ }</style>
@@ -1,4 +1,5 @@
1
1
  interface Props {
2
+ column?: boolean;
2
3
  children?: import('svelte').Snippet;
3
4
  }
4
5
  declare const ButtonGroup: import("svelte").Component<Props, {}, "">;
@@ -2,7 +2,6 @@
2
2
  import Modal from './Modal.svelte';
3
3
  import { confirmStore } from './confirm.js';
4
4
  import Button from './../Button/Button.svelte';
5
- import ButtonGroup from './../Button/ButtonGroup.svelte';
6
5
 
7
6
  let show = $state(true);
8
7
 
@@ -32,14 +31,12 @@
32
31
  {/if}
33
32
 
34
33
  {#snippet footer()}
35
- <ButtonGroup>
36
- <Button variant="invisible" on:click={handleCancel}>
37
- {$confirmStore.cancelText || 'Cancel'}
38
- </Button>
39
- <Button color={$confirmStore.danger ? 'red' : 'accent'} on:click={handleConfirm}>
40
- {$confirmStore.confirmText || 'Confirm'}
41
- </Button>
42
- </ButtonGroup>
34
+ <Button variant="invisible" on:click={handleCancel}>
35
+ {$confirmStore.cancelText || 'Cancel'}
36
+ </Button>
37
+ <Button color={$confirmStore.danger ? 'red' : 'accent'} on:click={handleConfirm}>
38
+ {$confirmStore.confirmText || 'Confirm'}
39
+ </Button>
43
40
  {/snippet}
44
41
  </Modal>
45
42
  {/if}
@@ -1,7 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { createEventDispatcher } from 'svelte';
3
3
  import Button from '../Button/Button.svelte';
4
- import ButtonGroup from '../Button/ButtonGroup.svelte';
5
4
  import type { Footer } from './modal-types.ts';
6
5
 
7
6
  interface Props {
@@ -14,30 +13,28 @@
14
13
  const dispatch = createEventDispatcher();
15
14
  </script>
16
15
 
17
- <ButtonGroup>
18
- {#if footer.cancel !== false}
19
- <Button
20
- variant="invisible"
21
- on:click={() => {
22
- show = false;
23
- dispatch('cancel');
24
- }}
25
- {...footer.cancel?.props}
26
- disabled={footer.cancel?.disabled}
27
- >
28
- {footer.cancel?.text || 'Cancel'}
29
- </Button>
30
- {/if}
16
+ {#if footer.cancel !== false}
17
+ <Button
18
+ variant="invisible"
19
+ on:click={() => {
20
+ show = false;
21
+ dispatch('cancel');
22
+ }}
23
+ {...footer.cancel?.props}
24
+ disabled={footer.cancel?.disabled}
25
+ >
26
+ {footer.cancel?.text || 'Cancel'}
27
+ </Button>
28
+ {/if}
31
29
 
32
- {#if footer.confirm !== false}
33
- <Button
34
- variant="fill"
35
- color={footer.confirm?.danger ? 'red' : 'accent'}
36
- on:click={() => dispatch('confirm')}
37
- {...footer.confirm?.props}
38
- disabled={footer.confirm?.disabled}
39
- >
40
- {footer.confirm?.text || 'Confirm'}
41
- </Button>
42
- {/if}
43
- </ButtonGroup>
30
+ {#if footer.confirm !== false}
31
+ <Button
32
+ variant="fill"
33
+ color={footer.confirm?.danger ? 'red' : 'accent'}
34
+ on:click={() => dispatch('confirm')}
35
+ {...footer.confirm?.props}
36
+ disabled={footer.confirm?.disabled}
37
+ >
38
+ {footer.confirm?.text || 'Confirm'}
39
+ </Button>
40
+ {/if}
@@ -1,7 +1,8 @@
1
1
  <script lang="ts">
2
2
  import ToastIcon from './ToastIcon.svelte';
3
3
  import type { Toast } from './toast.ts';
4
- import { fade } from 'svelte/transition';
4
+ import { fade, fly } from 'svelte/transition';
5
+ import { cubicOut } from 'svelte/easing';
5
6
 
6
7
  interface Props {
7
8
  toast: Toast;
@@ -10,7 +11,7 @@
10
11
  let { toast }: Props = $props();
11
12
  </script>
12
13
 
13
- <div class="toast" out:fade={{ duration: 200 }} in:fade={{ duration: 50 }}>
14
+ <div class="toast" in:fly={{ y: 20, duration: 250, easing: cubicOut }} out:fade={{ duration: 150 }}>
14
15
  {#if toast.type !== 'blank'}
15
16
  <div class="icon-wrap">
16
17
  <ToastIcon {toast} />
@@ -28,7 +29,6 @@
28
29
 
29
30
  <style>
30
31
  .toast {
31
- margin-bottom: 10px;
32
32
  box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);
33
33
  border-radius: var(--box-radius);
34
34
  background-color: var(--box-background);
@@ -38,9 +38,6 @@
38
38
  max-width: 350px;
39
39
  pointer-events: initial;
40
40
  }
41
- .toast:first-child {
42
- margin-top: 10px;
43
- }
44
41
  .icon-wrap {
45
42
  margin-right: 8px;
46
43
  display: inline-flex;
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import { flip } from 'svelte/animate';
2
3
  import ToastMessage from './ToastMessage.svelte';
3
4
  import { toastStore } from './toast.js';
4
5
  import { useCleaner } from './cleaner.js';
@@ -8,21 +9,24 @@
8
9
 
9
10
  <div id="toasts-wrap">
10
11
  {#each $toastStore as toast (toast.id)}
11
- <ToastMessage {toast} />
12
+ <div class="toast-item" animate:flip={{ duration: 200 }}>
13
+ <ToastMessage {toast} />
14
+ </div>
12
15
  {/each}
13
16
  </div>
14
17
 
15
18
  <style>
16
19
  #toasts-wrap {
17
20
  position: fixed;
18
- top: 0;
21
+ bottom: 0;
19
22
  left: 0;
20
23
  width: 100%;
21
24
  z-index: 20000000;
22
25
  display: flex;
23
- flex-direction: column;
26
+ flex-direction: column-reverse;
24
27
  align-items: center;
25
- justify-content: center;
28
+ gap: 10px;
29
+ padding: 10px 0 24px;
26
30
  pointer-events: none;
27
31
  }
28
32
  </style>
@@ -7,7 +7,7 @@ export { default as AvatarStack } from './Avatar/AvatarStack.svelte';
7
7
  export { default as Base } from './Base/Base.svelte';
8
8
  export { default as Box } from './Box/Box.svelte';
9
9
  export { default as Button } from './Button/Button.svelte';
10
- export { default as ButtonGroup } from './Button/ButtonGroup.svelte';
10
+ export { default as ButtonGroup } from './ButtonGroup/ButtonGroup.svelte';
11
11
  export { default as BoxShadowPicker } from './BoxShadowPicker/BoxShadowPicker.svelte';
12
12
  export { default as Callout } from './Callout/Callout.svelte';
13
13
  export { default as Checkbox } from './Checkbox/Checkbox.svelte';
@@ -7,7 +7,7 @@ export { default as AvatarStack } from './Avatar/AvatarStack.svelte';
7
7
  export { default as Base } from './Base/Base.svelte';
8
8
  export { default as Box } from './Box/Box.svelte';
9
9
  export { default as Button } from './Button/Button.svelte';
10
- export { default as ButtonGroup } from './Button/ButtonGroup.svelte';
10
+ export { default as ButtonGroup } from './ButtonGroup/ButtonGroup.svelte';
11
11
  export { default as BoxShadowPicker } from './BoxShadowPicker/BoxShadowPicker.svelte';
12
12
  export { default as Callout } from './Callout/Callout.svelte';
13
13
  export { default as Checkbox } from './Checkbox/Checkbox.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyvor/design",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "repository": {
@@ -1,18 +0,0 @@
1
- <script lang="ts">
2
- interface Props {
3
- children?: import('svelte').Snippet;
4
- }
5
-
6
- let { children }: Props = $props();
7
- </script>
8
-
9
- <div class="button-group">
10
- {@render children?.()}
11
- </div>
12
-
13
- <style>
14
- .button-group {
15
- display: inline-flex;
16
- gap: 6px;
17
- }
18
- </style>