@hyvor/design 0.0.67 → 0.0.68

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.
Files changed (123) hide show
  1. package/dist/components/ActionList/ActionList.svelte +2 -7
  2. package/dist/components/ActionList/ActionListGroup.svelte +24 -29
  3. package/dist/components/ActionList/ActionListItem.svelte +86 -88
  4. package/dist/components/ActionList/Selected.svelte +17 -20
  5. package/dist/components/Avatar/Avatar.svelte +7 -11
  6. package/dist/components/Avatar/AvatarStack.svelte +16 -20
  7. package/dist/components/Base/Base.svelte +3 -3
  8. package/dist/components/Box/Box.svelte +8 -8
  9. package/dist/components/Button/Button.svelte +33 -42
  10. package/dist/components/Button/ButtonGroup.svelte +6 -6
  11. package/dist/components/Callout/Callout.svelte +88 -86
  12. package/dist/components/Callout/Callout.svelte.d.ts +1 -0
  13. package/dist/components/Checkbox/Checkbox.svelte +113 -121
  14. package/dist/components/CodeBlock/CodeBlock.svelte +26 -23
  15. package/dist/components/CodeBlock/getCode.js +6 -6
  16. package/dist/components/CodeBlock/hljs.scss +189 -191
  17. package/dist/components/CodeBlock/prism.scss +370 -7
  18. package/dist/components/ColorPicker/ColorPicker.svelte +42 -42
  19. package/dist/components/Dark/DarkProvider.svelte +9 -9
  20. package/dist/components/Dark/DarkToggle.svelte +7 -10
  21. package/dist/components/Divider/Divider.svelte +6 -7
  22. package/dist/components/Dropdown/Dropdown.svelte +33 -108
  23. package/dist/components/Dropdown/DropdownContent.svelte +120 -0
  24. package/dist/components/Dropdown/DropdownContent.svelte.d.ts +24 -0
  25. package/dist/components/FormControl/Caption.svelte +9 -9
  26. package/dist/components/FormControl/FormControl.svelte +18 -18
  27. package/dist/components/FormControl/InputGroup.svelte +7 -8
  28. package/dist/components/FormControl/Label.svelte +5 -5
  29. package/dist/components/FormControl/Validation.svelte +18 -16
  30. package/dist/components/FormControl/Validation.svelte.d.ts +1 -1
  31. package/dist/components/HyvorBar/BarProducts.svelte +52 -0
  32. package/dist/components/HyvorBar/BarProducts.svelte.d.ts +39 -0
  33. package/dist/components/HyvorBar/BarSupport.svelte +119 -0
  34. package/dist/components/HyvorBar/BarSupport.svelte.d.ts +19 -0
  35. package/dist/components/HyvorBar/BarUpdates.svelte +58 -0
  36. package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +18 -0
  37. package/dist/components/HyvorBar/BarUpdatesList.svelte +134 -0
  38. package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +18 -0
  39. package/dist/components/HyvorBar/BarUser.svelte +60 -0
  40. package/dist/components/HyvorBar/BarUser.svelte.d.ts +16 -0
  41. package/dist/components/HyvorBar/BarUserPreview.svelte +42 -0
  42. package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +14 -0
  43. package/dist/components/HyvorBar/HyvorBar.svelte +150 -0
  44. package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +19 -0
  45. package/dist/components/HyvorBar/bar.d.ts +33 -0
  46. package/dist/components/HyvorBar/bar.js +74 -0
  47. package/dist/components/HyvorBar/img/G2.svelte +9 -0
  48. package/dist/components/HyvorBar/img/G2.svelte.d.ts +23 -0
  49. package/dist/components/HyvorBar/img/Trustpilot.svelte +11 -0
  50. package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +23 -0
  51. package/dist/components/IconButton/IconButton.svelte +19 -23
  52. package/dist/components/IconMessage/IconMessage.svelte +89 -38
  53. package/dist/components/IconMessage/IconMessage.svelte.d.ts +9 -1
  54. package/dist/components/Internationalization/InternationalizationProvider.svelte +2 -2
  55. package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +1 -1
  56. package/dist/components/Internationalization/LanguageToggle.svelte +33 -36
  57. package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +2 -2
  58. package/dist/components/Internationalization/T.svelte.d.ts +3 -3
  59. package/dist/components/Internationalization/i18n.d.ts +4 -4
  60. package/dist/components/Internationalization/i18n.js +13 -11
  61. package/dist/components/Internationalization/t.d.ts +3 -3
  62. package/dist/components/Internationalization/t.js +4 -4
  63. package/dist/components/Internationalization/types.d.ts +1 -1
  64. package/dist/components/Link/Link.svelte +53 -58
  65. package/dist/components/Loader/LoadButton.svelte +15 -29
  66. package/dist/components/Loader/Loader.svelte +56 -69
  67. package/dist/components/Modal/ConfirmModalProvider.svelte +18 -36
  68. package/dist/components/Modal/Modal.svelte +134 -164
  69. package/dist/components/Modal/ModalFooter.svelte +23 -26
  70. package/dist/components/Modal/confirm.d.ts +1 -1
  71. package/dist/components/Modal/confirm.js +4 -4
  72. package/dist/components/Modal/modal-types.d.ts +2 -2
  73. package/dist/components/NavLink/NavLink.svelte +78 -86
  74. package/dist/components/Radio/Radio.svelte +23 -31
  75. package/dist/components/Slider/Slider.svelte +71 -79
  76. package/dist/components/SplitControl/SplitControl.svelte +28 -42
  77. package/dist/components/Switch/Switch.svelte +60 -65
  78. package/dist/components/TabNav/TabNav.svelte +6 -10
  79. package/dist/components/TabNav/TabNavItem.svelte +36 -43
  80. package/dist/components/Table/Table.svelte +7 -4
  81. package/dist/components/Table/TableRow.svelte +23 -23
  82. package/dist/components/Tag/Tag.svelte +28 -36
  83. package/dist/components/Text/Text.svelte +15 -22
  84. package/dist/components/TextInput/TextInput.svelte +26 -26
  85. package/dist/components/Textarea/Textarea.svelte +38 -38
  86. package/dist/components/Toast/ToastIcon.svelte +29 -31
  87. package/dist/components/Toast/ToastMessage.svelte +33 -39
  88. package/dist/components/Toast/ToastProvider.svelte +16 -16
  89. package/dist/components/Toast/cleaner.js +5 -5
  90. package/dist/components/Toast/toast.d.ts +2 -2
  91. package/dist/components/Toast/toast.js +10 -10
  92. package/dist/components/Tooltip/Tooltip.svelte +82 -83
  93. package/dist/components/directives/clickOutside.js +4 -4
  94. package/dist/components/directives/debounce.d.ts +1 -0
  95. package/dist/components/directives/debounce.js +8 -0
  96. package/dist/components/index.d.ts +1 -0
  97. package/dist/components/index.js +1 -0
  98. package/dist/index.css +31 -33
  99. package/dist/marketing/Container/Container.svelte +8 -8
  100. package/dist/marketing/Docs/Content/Content.svelte +8 -7
  101. package/dist/marketing/Docs/Content/DocsImage.svelte +52 -62
  102. package/dist/marketing/Docs/Docs.svelte +21 -24
  103. package/dist/marketing/Docs/Nav/Nav.svelte +21 -22
  104. package/dist/marketing/Docs/Nav/NavCategory.svelte +28 -28
  105. package/dist/marketing/Docs/Nav/NavItem.svelte +21 -24
  106. package/dist/marketing/Docs/Sidebar/Sidebar.svelte +22 -25
  107. package/dist/marketing/Docs/Toc.svelte +17 -19
  108. package/dist/marketing/Document/Document.svelte +5 -5
  109. package/dist/marketing/Document/DocumentTitle.svelte +49 -49
  110. package/dist/marketing/Footer/Footer.svelte +111 -119
  111. package/dist/marketing/Footer/FooterLinkList.svelte +24 -26
  112. package/dist/marketing/Header/Header.svelte +7 -15
  113. package/dist/marketing/Logo/LogoBlogs.svelte +41 -0
  114. package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +16 -0
  115. package/dist/marketing/Logo/LogoCore.svelte +41 -0
  116. package/dist/marketing/Logo/LogoCore.svelte.d.ts +16 -0
  117. package/dist/marketing/Logo/LogoFortguard.svelte +49 -0
  118. package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +16 -0
  119. package/dist/marketing/Logo/LogoTalk.svelte +27 -0
  120. package/dist/marketing/Logo/LogoTalk.svelte.d.ts +16 -0
  121. package/dist/stores/dark.js +8 -8
  122. package/dist/variables.scss +41 -48
  123. package/package.json +59 -58
@@ -10,35 +10,21 @@ export let buttonProps = {};
10
10
  </script>
11
11
 
12
12
  {#if show}
13
-
14
- <div
15
- class="load-button"
16
- style:height="{height}px"
17
- {...divProps}
18
- >
19
-
20
- {#if loading}
21
- <Loader {...loaderProps} />
22
- {:else}
23
-
24
- <Button
25
- size="small"
26
- on:click
27
- {...buttonProps}
28
- >
29
- {text}
30
- </Button>
31
-
32
- {/if}
33
-
34
- </div>
35
-
13
+ <div class="load-button" style:height="{height}px" {...divProps}>
14
+ {#if loading}
15
+ <Loader {...loaderProps} />
16
+ {:else}
17
+ <Button size="small" on:click {...buttonProps}>
18
+ {text}
19
+ </Button>
20
+ {/if}
21
+ </div>
36
22
  {/if}
37
23
 
38
24
  <style>
39
- .load-button {
40
- display: flex;
41
- align-items: center;
42
- justify-content: center;
43
- }
44
- </style>
25
+ .load-button {
26
+ display: flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+ }
30
+ </style>
@@ -1,7 +1,4 @@
1
- <script>import {
2
- IconCheckCircleFill,
3
- IconXCircleFill
4
- } from "@hyvor/icons";
1
+ <script>import { IconCheckCircleFill, IconXCircleFill } from "@hyvor/icons";
5
2
  export let block = false;
6
3
  export let full = false;
7
4
  export let padding = "medium";
@@ -42,72 +39,61 @@ const paddings = {
42
39
  padding = typeof padding === "number" ? padding : paddings[padding];
43
40
  </script>
44
41
 
45
- <div
46
- class="loader"
47
- class:block
48
- class:full
49
- class:success={state === 'success'}
50
- class:error={state === 'error'}
51
-
52
-
53
- style:--local-size={size + "px"}
54
- style:padding={block ? padding + "px" : undefined}
55
- {...$$restProps}
42
+ <div
43
+ class="loader"
44
+ class:block
45
+ class:full
46
+ class:success={state === 'success'}
47
+ class:error={state === 'error'}
48
+ style:--local-size={size + 'px'}
49
+ style:padding={block ? padding + 'px' : undefined}
50
+ {...$$restProps}
56
51
  >
57
-
58
-
59
- {#if state !== 'none'}
60
- <span class="loader-wrap">
61
-
62
- {#if state === 'loading'}
63
- <svg>
64
- <circle
65
- class="track"
66
- cx="50%"
67
- cy="50%"
68
- r={r + "px"}
69
- fill="none"
70
- stroke-width={strokeWidth}
71
- stroke={colorTrack}
72
- ></circle>
73
- <circle
74
- class="progress"
75
- cx="50%"
76
- cy="50%"
77
- r={r + "px"}
78
- fill="none"
79
- stroke-width={strokeWidth}
80
- stroke={color}
81
- stroke-linecap="round"
82
- stroke-dasharray={strokeDashArray}
83
- stroke-dashoffset={strokeDashOffset}
84
- ></circle>
85
- </svg>
86
- {:else if state === 'success'}
87
- <span class="success-icon">
88
- <IconCheckCircleFill color="var(--green)" width={size} height={size} />
89
- </span>
90
- {:else if state === 'error'}
91
- <span class="error-icon">
92
- <IconXCircleFill color="var(--red)" width={size} height={size} />
93
- </span>
94
- {/if}
95
-
96
- </span>
97
-
98
- {/if}
99
-
100
-
101
- {#if $$slots.default}
102
- <div class="message">
103
- <slot></slot>
104
- </div>
105
- {/if}
106
-
52
+ {#if state !== 'none'}
53
+ <span class="loader-wrap">
54
+ {#if state === 'loading'}
55
+ <svg>
56
+ <circle
57
+ class="track"
58
+ cx="50%"
59
+ cy="50%"
60
+ r={r + 'px'}
61
+ fill="none"
62
+ stroke-width={strokeWidth}
63
+ stroke={colorTrack}
64
+ ></circle>
65
+ <circle
66
+ class="progress"
67
+ cx="50%"
68
+ cy="50%"
69
+ r={r + 'px'}
70
+ fill="none"
71
+ stroke-width={strokeWidth}
72
+ stroke={color}
73
+ stroke-linecap="round"
74
+ stroke-dasharray={strokeDashArray}
75
+ stroke-dashoffset={strokeDashOffset}
76
+ ></circle>
77
+ </svg>
78
+ {:else if state === 'success'}
79
+ <span class="success-icon">
80
+ <IconCheckCircleFill color="var(--green)" width={size} height={size} />
81
+ </span>
82
+ {:else if state === 'error'}
83
+ <span class="error-icon">
84
+ <IconXCircleFill color="var(--red)" width={size} height={size} />
85
+ </span>
86
+ {/if}
87
+ </span>
88
+ {/if}
89
+
90
+ {#if $$slots.default}
91
+ <div class="message">
92
+ <slot></slot>
93
+ </div>
94
+ {/if}
107
95
  </div>
108
96
 
109
-
110
-
111
97
  <style>.loader {
112
98
  display: inline-flex;
113
99
  align-items: center;
@@ -147,7 +133,8 @@ padding = typeof padding === "number" ? padding : paddings[padding];
147
133
  position: relative;
148
134
  }
149
135
 
150
- .success-icon, .error-icon {
136
+ .success-icon,
137
+ .error-icon {
151
138
  animation: scale 0.2s ease-in-out;
152
139
  }
153
140
 
@@ -184,4 +171,4 @@ circle.progress {
184
171
  transform: scale(1);
185
172
  opacity: 1;
186
173
  }
187
- }</style>
174
+ }</style>
@@ -18,40 +18,22 @@ $: {
18
18
  </script>
19
19
 
20
20
  {#if $confirmStore}
21
+ <Modal title={$confirmStore.title} bind:show size="small" loading={$confirmStore.loading}>
22
+ {#if typeof $confirmStore.content === 'string'}
23
+ {$confirmStore.content}
24
+ {:else}
25
+ <svelte:component this={$confirmStore.content} {...$confirmStore.contentProps || {}} />
26
+ {/if}
21
27
 
22
- <Modal
23
- title={$confirmStore.title}
24
- bind:show={show}
25
- size="small"
26
- loading={$confirmStore.loading}
27
- >
28
-
29
- {#if typeof $confirmStore.content === "string"}
30
- {$confirmStore.content}
31
- {:else}
32
- <svelte:component
33
- this={$confirmStore.content}
34
- {...$confirmStore.contentProps || {}}
35
- />
36
- {/if}
37
-
38
- <svelte:fragment slot="footer">
39
- <ButtonGroup>
40
- <Button
41
- variant="invisible"
42
- on:click={handleCancel}
43
- >
44
- {$confirmStore.cancelText || "Cancel"}
45
- </Button>
46
- <Button
47
- color={$confirmStore.danger ? "red" : "accent"}
48
- on:click={handleConfirm}
49
- >
50
- {$confirmStore.confirmText || "Confirm"}
51
- </Button>
52
- </ButtonGroup>
53
- </svelte:fragment>
54
-
55
- </Modal>
56
-
57
- {/if}
28
+ <svelte:fragment slot="footer">
29
+ <ButtonGroup>
30
+ <Button variant="invisible" on:click={handleCancel}>
31
+ {$confirmStore.cancelText || 'Cancel'}
32
+ </Button>
33
+ <Button color={$confirmStore.danger ? 'red' : 'accent'} on:click={handleConfirm}>
34
+ {$confirmStore.confirmText || 'Confirm'}
35
+ </Button>
36
+ </ButtonGroup>
37
+ </svelte:fragment>
38
+ </Modal>
39
+ {/if}
@@ -39,172 +39,142 @@ $:
39
39
  show, setFlex();
40
40
  </script>
41
41
 
42
- <svelte:window on:keyup={e => {
43
- if (e.key === 'Escape' && closeOnEscape && !loading) {
44
- show = false;
45
- }
46
- }} />
47
-
42
+ <svelte:window
43
+ on:keyup={(e) => {
44
+ if (e.key === 'Escape' && closeOnEscape && !loading) {
45
+ show = false;
46
+ }
47
+ }}
48
+ />
48
49
 
49
50
  {#if show}
50
- <div
51
- class="wrap"
52
- bind:this={wrapEl}
53
- in:fade={{duration: 100}}
54
- out:fade={{duration: 100}}
55
- >
56
-
57
- <div
58
- class="inner {size}"
59
- use:clickOutside={{
60
- enabled: closeOnOutsideClick,
61
- callback: () => !loading ? show = false : null
62
- }}
63
- in:scale={{duration: 100, start: 0.9, opacity: 0.9}}
64
- out:scale={{duration: 100, start: 0.9, opacity: 0.9}}
65
- bind:this={innerEl}
66
-
67
- role={role}
68
- aria-modal="true"
69
- aria-labelledby={titleId}
70
- aria-describedby={descId}
71
- >
72
-
73
- <div class="header">
74
-
75
- <div
76
- class="title"
77
- id={titleId}
78
- >
79
- {#if $$slots.title}
80
- <slot name="title" />
81
- {:else}
82
- <span>{title}</span>
83
- {/if}
84
- </div>
85
-
86
- <div class="close-wrap">
87
- <IconButton
88
- variant="invisible"
89
- on:click={handleCancel}
90
- >
91
- <IconX size={25} />
92
- </IconButton>
93
- </div>
94
-
95
- </div>
96
-
97
- <div
98
- class="content"
99
- id={descId}
100
- >
101
- <slot />
102
- </div>
103
-
104
- {#if $$slots.footer || footer}
105
- <div class="footer">
106
- {#if $$slots.footer}
107
- <slot name="footer" />
108
- {:else if footer}
109
- <ModalFooter
110
- {footer}
111
- bind:show={show}
112
- on:cancel
113
- on:confirm
114
- />
115
- {/if}
116
- </div>
117
- {/if}
118
-
119
- {#if loading}
120
- <div
121
- class="loading"
122
- in:fade={{duration: 100}}
123
- >
124
- <Loader full>
125
- {#if typeof loading === "string"}
126
- {loading}
127
- {/if}
128
- </Loader>
129
- </div>
130
- {/if}
131
-
132
- </div>
133
-
134
- </div>
51
+ <div class="wrap" bind:this={wrapEl} in:fade={{ duration: 100 }} out:fade={{ duration: 100 }}>
52
+ <div
53
+ class="inner {size}"
54
+ use:clickOutside={{
55
+ enabled: closeOnOutsideClick,
56
+ callback: () => (!loading ? (show = false) : null)
57
+ }}
58
+ in:scale={{ duration: 100, start: 0.9, opacity: 0.9 }}
59
+ out:scale={{ duration: 100, start: 0.9, opacity: 0.9 }}
60
+ bind:this={innerEl}
61
+ {role}
62
+ aria-modal="true"
63
+ aria-labelledby={titleId}
64
+ aria-describedby={descId}
65
+ >
66
+ <div class="header">
67
+ <div class="title" id={titleId}>
68
+ {#if $$slots.title}
69
+ <slot name="title" />
70
+ {:else}
71
+ <span>{title}</span>
72
+ {/if}
73
+ </div>
74
+
75
+ <div class="close-wrap">
76
+ <IconButton variant="invisible" on:click={handleCancel}>
77
+ <IconX size={25} />
78
+ </IconButton>
79
+ </div>
80
+ </div>
81
+
82
+ <div class="content" id={descId}>
83
+ <slot />
84
+ </div>
85
+
86
+ {#if $$slots.footer || footer}
87
+ <div class="footer">
88
+ {#if $$slots.footer}
89
+ <slot name="footer" />
90
+ {:else if footer}
91
+ <ModalFooter {footer} bind:show on:cancel on:confirm />
92
+ {/if}
93
+ </div>
94
+ {/if}
95
+
96
+ {#if loading}
97
+ <div class="loading" in:fade={{ duration: 100 }}>
98
+ <Loader full>
99
+ {#if typeof loading === 'string'}
100
+ {loading}
101
+ {/if}
102
+ </Loader>
103
+ </div>
104
+ {/if}
105
+ </div>
106
+ </div>
135
107
  {/if}
136
108
 
137
109
  <style>
138
-
139
- .loading {
140
- position: absolute;
141
- top: 0;
142
- left: 0;
143
- z-index: 1;
144
- width: 100%;
145
- height: 100%;
146
- background-color: var(--box-background);
147
- border-radius: var(--box-radius);
148
- box-shadow: var(--box-shadow);
149
- }
150
-
151
- .wrap {
152
- position: fixed;
153
- top: 0;
154
- left: 0;
155
- z-index: 10000000;
156
- width: 100%;
157
- height: 100%;
158
- background: rgba(0,0,0,0.5);
159
- display: flex;
160
- align-items: center;
161
- justify-content: center;
162
- padding: 30px;
163
- overflow: auto;
164
- }
165
-
166
- .inner {
167
- background: var(--box-background);
168
- border-radius: var(--box-radius);
169
- box-shadow: var(--box-shadow);
170
- width: 650px;
171
- max-width: 100%;
172
- position: relative;
173
- }
174
-
175
- .inner.small {
176
- width: 425px;
177
- }
178
- .inner.large {
179
- width: 800px;
180
- }
181
-
182
- .header {
183
- padding: 20px 25px;
184
- display: flex;
185
- align-items: center;
186
- }
187
-
188
- .title {
189
- flex: 1;
190
- }
191
- .title span {
192
- font-size: 1.2em;
193
- font-weight: 600;
194
- }
195
-
196
- .content {
197
- padding: 20px 25px;
198
- }
199
-
200
- .footer {
201
- padding: 20px 25px;
202
- display: flex;
203
- align-items: center;
204
- justify-content: flex-end;
205
- }
206
- .footer :global(button:not(:last-child)) {
207
- margin-right: 2px;
208
- }
209
-
210
- </style>
110
+ .loading {
111
+ position: absolute;
112
+ top: 0;
113
+ left: 0;
114
+ z-index: 1;
115
+ width: 100%;
116
+ height: 100%;
117
+ background-color: var(--box-background);
118
+ border-radius: var(--box-radius);
119
+ box-shadow: var(--box-shadow);
120
+ }
121
+
122
+ .wrap {
123
+ position: fixed;
124
+ top: 0;
125
+ left: 0;
126
+ z-index: 10000000;
127
+ width: 100%;
128
+ height: 100%;
129
+ background: rgba(0, 0, 0, 0.5);
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ padding: 30px;
134
+ overflow: auto;
135
+ }
136
+
137
+ .inner {
138
+ background: var(--box-background);
139
+ border-radius: var(--box-radius);
140
+ box-shadow: var(--box-shadow);
141
+ width: 650px;
142
+ max-width: 100%;
143
+ position: relative;
144
+ }
145
+
146
+ .inner.small {
147
+ width: 425px;
148
+ }
149
+ .inner.large {
150
+ width: 800px;
151
+ }
152
+
153
+ .header {
154
+ padding: 20px 25px;
155
+ display: flex;
156
+ align-items: center;
157
+ }
158
+
159
+ .title {
160
+ flex: 1;
161
+ }
162
+ .title span {
163
+ font-size: 1.2em;
164
+ font-weight: 600;
165
+ }
166
+
167
+ .content {
168
+ padding: 20px 25px;
169
+ }
170
+
171
+ .footer {
172
+ padding: 20px 25px;
173
+ display: flex;
174
+ align-items: center;
175
+ justify-content: flex-end;
176
+ }
177
+ .footer :global(button:not(:last-child)) {
178
+ margin-right: 2px;
179
+ }
180
+ </style>
@@ -6,31 +6,28 @@ export let footer;
6
6
  const dispatch = createEventDispatcher();
7
7
  </script>
8
8
 
9
-
10
9
  <ButtonGroup>
10
+ {#if footer.cancel !== false}
11
+ <Button
12
+ variant="invisible"
13
+ on:click={() => {
14
+ show = false;
15
+ dispatch('cancel');
16
+ }}
17
+ {...footer.cancel?.props}
18
+ >
19
+ {footer.cancel?.text || 'Cancel'}
20
+ </Button>
21
+ {/if}
11
22
 
12
- {#if footer.cancel !== false}
13
- <Button
14
- variant="invisible"
15
- on:click={() => {
16
- show = false;
17
- dispatch("cancel");
18
- }}
19
- {...footer.cancel?.props}
20
- >
21
- {footer.cancel?.text || "Cancel"}
22
- </Button>
23
- {/if}
24
-
25
- {#if footer.confirm !== false}
26
- <Button
27
- variant="fill"
28
- color={footer.confirm?.danger ? "red" : "accent"}
29
- on:click={() => dispatch("confirm")}
30
- {...footer.confirm?.props}
31
- >
32
- {footer.confirm?.text || "Confirm"}
33
- </Button>
34
- {/if}
35
-
36
- </ButtonGroup>
23
+ {#if footer.confirm !== false}
24
+ <Button
25
+ variant="fill"
26
+ color={footer.confirm?.danger ? 'red' : 'accent'}
27
+ on:click={() => dispatch('confirm')}
28
+ {...footer.confirm?.props}
29
+ >
30
+ {footer.confirm?.text || 'Confirm'}
31
+ </Button>
32
+ {/if}
33
+ </ButtonGroup>
@@ -1,4 +1,4 @@
1
- import { type ComponentType } from "svelte";
1
+ import { type ComponentType } from 'svelte';
2
2
  interface ConfirmConfig {
3
3
  title: string;
4
4
  content: string | ComponentType;
@@ -1,5 +1,5 @@
1
- import {} from "svelte";
2
- import { writable } from "svelte/store";
1
+ import {} from 'svelte';
2
+ import { writable } from 'svelte/store';
3
3
  export const confirmStore = writable(null);
4
4
  export function confirm(config) {
5
5
  function getOptions() {
@@ -12,7 +12,7 @@ export function confirm(config) {
12
12
  return store;
13
13
  });
14
14
  },
15
- close: () => confirmStore.set(null),
15
+ close: () => confirmStore.set(null)
16
16
  };
17
17
  }
18
18
  return new Promise((resolve, reject) => {
@@ -27,7 +27,7 @@ export function confirm(config) {
27
27
  onCancel: () => {
28
28
  resolve(false);
29
29
  confirmStore.set(null);
30
- },
30
+ }
31
31
  });
32
32
  });
33
33
  }
@@ -1,5 +1,5 @@
1
- import type { ComponentProps } from "svelte";
2
- import type Button from "../Button/Button.svelte";
1
+ import type { ComponentProps } from 'svelte';
2
+ import type Button from '../Button/Button.svelte';
3
3
  export interface Footer {
4
4
  /**
5
5
  * undefined: default cancel button