@softwareone/spi-sv5-library 1.14.3 → 1.15.0
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/components/accordion/Accordion.svelte +14 -23
- package/dist/components/announcement/Announcement.svelte +53 -61
- package/dist/components/avatar/Avatar.svelte +30 -12
- package/dist/components/avatar/Avatar.svelte.d.ts +2 -2
- package/dist/components/button/Button.svelte +41 -44
- package/dist/components/card/Card.svelte +4 -6
- package/dist/components/chips/Chips.svelte +37 -36
- package/dist/components/chips/Chips.svelte.d.ts +1 -1
- package/dist/components/confirmation/Confirmation.svelte +6 -6
- package/dist/components/confirmation/Confirmation.svelte.d.ts +2 -2
- package/dist/components/controls/attach-file/AttachFile.svelte +18 -41
- package/dist/components/controls/attach-file/FileManager.svelte +16 -30
- package/dist/components/controls/attach-file/Warnings.svelte +13 -15
- package/dist/components/controls/input/Input.svelte +46 -72
- package/dist/components/controls/input/InputIcon.svelte +13 -13
- package/dist/components/controls/label/Label.svelte +5 -9
- package/dist/components/controls/radio-group/RadioGroup.svelte +25 -39
- package/dist/components/controls/select/Select.svelte +49 -71
- package/dist/components/controls/textarea/TextArea.svelte +36 -45
- package/dist/components/controls/toggle/Toggle.svelte +35 -37
- package/dist/components/delete-confirmation/DeleteConfirmation.svelte +3 -5
- package/dist/components/error-page/ErrorPage.svelte +9 -18
- package/dist/components/footer/Footer.svelte +9 -14
- package/dist/components/footer/Footer.svelte.d.ts +0 -1
- package/dist/components/footer/FooterLogo.svelte +16 -0
- package/dist/components/footer/FooterLogo.svelte.d.ts +26 -0
- package/dist/components/form/Form.svelte +1 -1
- package/dist/components/header/Header.svelte +39 -45
- package/dist/components/header/HeaderAccount.svelte +21 -33
- package/dist/components/header/HeaderLoader.svelte +13 -8
- package/dist/components/highlight-panel/HighlightPanel.svelte +29 -34
- package/dist/components/home/Home.svelte +18 -36
- package/dist/components/link/Link.svelte +1 -1
- package/dist/components/menu/Menu.svelte +16 -21
- package/dist/components/menu/MenuItem.svelte +25 -29
- package/dist/components/menu/Sidebar.svelte +32 -40
- package/dist/components/menu/utils.d.ts +1 -1
- package/dist/components/menu/utils.js +6 -7
- package/dist/components/modal/Modal.svelte +8 -11
- package/dist/components/modal/ModalContent.svelte +3 -3
- package/dist/components/modal/ModalFooter.svelte +5 -5
- package/dist/components/modal/ModalHeader.svelte +6 -11
- package/dist/components/notification/Notification.svelte +20 -27
- package/dist/components/processing/Processing.svelte +9 -16
- package/dist/components/progress-page/ProgressPage.svelte +13 -18
- package/dist/components/progress-wizard/ProgressWizard.svelte +43 -54
- package/dist/components/search/Search.svelte +24 -29
- package/dist/components/spinner/Spinner.svelte +1 -1
- package/dist/components/switcher/Switcher.svelte +14 -23
- package/dist/components/table/ActionsColumn.svelte +13 -33
- package/dist/components/table/AdvancedFilter.svelte +39 -74
- package/dist/components/table/Body.svelte +9 -18
- package/dist/components/table/ColumnVisibilityDropdown.svelte +24 -55
- package/dist/components/table/Footer.svelte +2 -4
- package/dist/components/table/Header.svelte +23 -44
- package/dist/components/table/PageSize.svelte +24 -36
- package/dist/components/table/Pagination.svelte +49 -35
- package/dist/components/table/RowCheckBox.svelte +5 -12
- package/dist/components/table/Skeleton.svelte +16 -25
- package/dist/components/table/Table.svelte +50 -38
- package/dist/components/table/Table.svelte.d.ts +5 -1
- package/dist/components/table/types.d.ts +9 -1
- package/dist/components/table/utils.d.ts +5 -1
- package/dist/components/table/utils.js +8 -8
- package/dist/components/tabs/Tabs.svelte +16 -20
- package/dist/components/toast/Toast.svelte +27 -30
- package/dist/components/tooltip/Tooltip.svelte +15 -19
- package/dist/components/waffle/Waffle.svelte +9 -13
- package/dist/components/waffle/WaffleItems.svelte +10 -13
- package/dist/styles/index.css +3 -0
- package/dist/styles/reset.css +19 -0
- package/dist/styles/tokens/index.css +2 -0
- package/dist/styles/tokens/primitives/borders.css +17 -0
- package/dist/styles/tokens/primitives/colors.css +41 -0
- package/dist/styles/tokens/primitives/index.css +7 -0
- package/dist/styles/tokens/primitives/motion.css +11 -0
- package/dist/styles/tokens/primitives/opacity.css +6 -0
- package/dist/styles/tokens/primitives/shadows.css +11 -0
- package/dist/styles/tokens/primitives/sizing.css +19 -0
- package/dist/styles/tokens/primitives/typography.css +13 -0
- package/dist/styles/tokens/semantic/colors.css +78 -0
- package/dist/styles/tokens/semantic/index.css +2 -0
- package/dist/styles/tokens/semantic/shadows.css +9 -0
- package/dist/styles/utilities.css +73 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/url.d.ts +3 -0
- package/dist/utils/url.js +15 -0
- package/package.json +3 -2
|
@@ -23,7 +23,12 @@
|
|
|
23
23
|
import AdvancedFilter from './AdvancedFilter.svelte';
|
|
24
24
|
import Body from './Body.svelte';
|
|
25
25
|
import ColumnVisibilityDropdown from './ColumnVisibilityDropdown.svelte';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
DEFAULT_MIN_PAGE_LIMIT,
|
|
28
|
+
DEFAULT_PAGE,
|
|
29
|
+
DEFAULT_PAGE_LIMIT,
|
|
30
|
+
Operator
|
|
31
|
+
} from './consts.js';
|
|
27
32
|
import { setPaginationTableContext } from './context.js';
|
|
28
33
|
import type { ExcelSetting } from './excel-setting.js';
|
|
29
34
|
import exportExcel from './excel.js';
|
|
@@ -31,7 +36,12 @@
|
|
|
31
36
|
import Header from './Header.svelte';
|
|
32
37
|
import Skeleton from './Skeleton.svelte';
|
|
33
38
|
import { type Filter, type Pagination } from './types.js';
|
|
34
|
-
import {
|
|
39
|
+
import {
|
|
40
|
+
createCheckedColumn,
|
|
41
|
+
isCursorPagination,
|
|
42
|
+
isValidPage,
|
|
43
|
+
isValidPageSize
|
|
44
|
+
} from './utils.js';
|
|
35
45
|
|
|
36
46
|
interface Props {
|
|
37
47
|
columns: ColumnDef<T, any>[];
|
|
@@ -45,13 +55,17 @@
|
|
|
45
55
|
enableColumnSearch?: boolean;
|
|
46
56
|
enableColumnVisibility?: boolean;
|
|
47
57
|
enableAdvancedFilter?: boolean;
|
|
48
|
-
|
|
58
|
+
serverSide?: boolean;
|
|
49
59
|
pagination?: Pagination;
|
|
60
|
+
initialPage?: number;
|
|
61
|
+
initialPageSize?: number;
|
|
50
62
|
excelSetting?: ExcelSetting;
|
|
51
63
|
header?: Snippet;
|
|
52
64
|
bulkActions?: Snippet<[selectedRows: T[], clearSelection: VoidFunction]>;
|
|
53
65
|
onpagechange?: (pageSize: number, pageNumber: number) => void;
|
|
54
66
|
onpagesizechange?: (pageSize: number) => void;
|
|
67
|
+
onnextpage?: (pageSize: number, pageNumber: number) => void;
|
|
68
|
+
onprevpage?: (pageSize: number, pageNumber: number) => void;
|
|
55
69
|
}
|
|
56
70
|
|
|
57
71
|
let {
|
|
@@ -66,14 +80,18 @@
|
|
|
66
80
|
enableColumnSearch = false,
|
|
67
81
|
enableColumnVisibility = true,
|
|
68
82
|
enableAdvancedFilter = false,
|
|
69
|
-
|
|
83
|
+
serverSide = false,
|
|
70
84
|
pagination,
|
|
85
|
+
initialPage,
|
|
86
|
+
initialPageSize,
|
|
71
87
|
excelSetting = {
|
|
72
88
|
fileName: 'Table',
|
|
73
89
|
exportAllColumns: false
|
|
74
90
|
},
|
|
75
91
|
onpagechange,
|
|
76
92
|
onpagesizechange,
|
|
93
|
+
onnextpage,
|
|
94
|
+
onprevpage,
|
|
77
95
|
header,
|
|
78
96
|
bulkActions
|
|
79
97
|
}: Props = $props();
|
|
@@ -86,7 +104,7 @@
|
|
|
86
104
|
let columnVisibility = $state<VisibilityState>(getInitialColumnVisibility());
|
|
87
105
|
let paginationState = $state<PaginationState>(getInitialPaginationState());
|
|
88
106
|
let tableData = $derived(data);
|
|
89
|
-
const tableManualPagination =
|
|
107
|
+
const tableManualPagination = serverSide ? setPaginationTableContext() : undefined;
|
|
90
108
|
const hasData = $derived(data.length > 0);
|
|
91
109
|
|
|
92
110
|
const tableColumns = $derived.by(() => {
|
|
@@ -160,7 +178,7 @@
|
|
|
160
178
|
getSortedRowModel: getSortedRowModel(),
|
|
161
179
|
getExpandedRowModel: getExpandedRowModel(),
|
|
162
180
|
getSubRows: (row) => ('children' in row ? (row.children as T[]) : undefined),
|
|
163
|
-
manualPagination,
|
|
181
|
+
manualPagination: serverSide,
|
|
164
182
|
paginateExpandedRows: false,
|
|
165
183
|
enableColumnFilters: true,
|
|
166
184
|
sortDescFirst: false
|
|
@@ -182,28 +200,34 @@
|
|
|
182
200
|
}
|
|
183
201
|
|
|
184
202
|
function getInitialPaginationState(): PaginationState {
|
|
185
|
-
if (!
|
|
203
|
+
if (!serverSide) {
|
|
186
204
|
return {
|
|
187
205
|
pageIndex: 0,
|
|
188
206
|
pageSize: minPageSize ? DEFAULT_MIN_PAGE_LIMIT : DEFAULT_PAGE_LIMIT
|
|
189
207
|
};
|
|
190
208
|
}
|
|
191
209
|
|
|
192
|
-
const currentPage =
|
|
193
|
-
const pageSize =
|
|
210
|
+
const currentPage = isValidPage(initialPage) ? initialPage : DEFAULT_PAGE;
|
|
211
|
+
const pageSize = isValidPageSize(initialPageSize) ? initialPageSize : undefined;
|
|
212
|
+
|
|
194
213
|
const pageIndex = Math.max(0, currentPage - 1);
|
|
195
214
|
|
|
196
|
-
return { pageIndex, pageSize };
|
|
215
|
+
return { pageIndex, pageSize: pageSize ?? DEFAULT_PAGE_LIMIT };
|
|
197
216
|
}
|
|
198
217
|
|
|
199
218
|
function changeManualPagination(updatedPaginationState: PaginationState) {
|
|
200
219
|
const pageSizeChanged = updatedPaginationState.pageSize !== paginationState.pageSize;
|
|
220
|
+
const currentPageNumber = updatedPaginationState.pageIndex + 1;
|
|
201
221
|
|
|
202
222
|
if (pageSizeChanged) {
|
|
203
223
|
updatedPaginationState.pageIndex = 0;
|
|
204
224
|
onpagesizechange?.(updatedPaginationState.pageSize);
|
|
225
|
+
} else if (pagination && isCursorPagination(pagination)) {
|
|
226
|
+
const isNext = updatedPaginationState.pageIndex > paginationState.pageIndex;
|
|
227
|
+
const handler = isNext ? onnextpage : onprevpage;
|
|
228
|
+
|
|
229
|
+
handler?.(updatedPaginationState.pageSize, currentPageNumber);
|
|
205
230
|
} else {
|
|
206
|
-
const currentPageNumber = updatedPaginationState.pageIndex + 1;
|
|
207
231
|
onpagechange?.(updatedPaginationState.pageSize, currentPageNumber);
|
|
208
232
|
}
|
|
209
233
|
}
|
|
@@ -236,7 +260,7 @@
|
|
|
236
260
|
};
|
|
237
261
|
|
|
238
262
|
$effect(() => {
|
|
239
|
-
if (
|
|
263
|
+
if (serverSide && pagination) {
|
|
240
264
|
$tableManualPagination = { ...pagination };
|
|
241
265
|
}
|
|
242
266
|
});
|
|
@@ -292,7 +316,7 @@
|
|
|
292
316
|
</header>
|
|
293
317
|
|
|
294
318
|
{#if enableChecked && (keepVisibleBulkActions || selectedRows.length > 0)}
|
|
295
|
-
<div class="table-bulk-actions">
|
|
319
|
+
<div class="table-bulk-actions spi-text-regular-2">
|
|
296
320
|
<p>
|
|
297
321
|
{selectedRows.length} of {table.getCoreRowModel().rows.length} items are selected
|
|
298
322
|
</p>
|
|
@@ -316,9 +340,9 @@
|
|
|
316
340
|
</article>
|
|
317
341
|
|
|
318
342
|
{#if !hasData}
|
|
319
|
-
<p class="table-message table-message--error">No data available</p>
|
|
343
|
+
<p class="table-message table-message--error spi-text-regular-5">No data available</p>
|
|
320
344
|
{:else if !hasFilteredRows}
|
|
321
|
-
<p class="table-message table-message--error">No items found</p>
|
|
345
|
+
<p class="table-message table-message--error spi-text-regular-5">No items found</p>
|
|
322
346
|
{/if}
|
|
323
347
|
|
|
324
348
|
{#if hasData}
|
|
@@ -329,16 +353,6 @@
|
|
|
329
353
|
|
|
330
354
|
<style>
|
|
331
355
|
.table-container {
|
|
332
|
-
--color-red-600: #dc2626;
|
|
333
|
-
--color-gray-300: #d1d5db;
|
|
334
|
-
--color-gray: #6b7180;
|
|
335
|
-
--font-size-sm: 14px;
|
|
336
|
-
--spacing-md: 16px;
|
|
337
|
-
--spacing-lg: 24px;
|
|
338
|
-
--spacing-xl: 40px;
|
|
339
|
-
--font-size-xl: 20px;
|
|
340
|
-
--search-width: 491px;
|
|
341
|
-
|
|
342
356
|
width: 100%;
|
|
343
357
|
}
|
|
344
358
|
|
|
@@ -356,44 +370,43 @@
|
|
|
356
370
|
}
|
|
357
371
|
|
|
358
372
|
.table-search {
|
|
359
|
-
width:
|
|
373
|
+
width: 491px;
|
|
360
374
|
}
|
|
361
375
|
|
|
362
376
|
.table-search-container {
|
|
363
377
|
display: flex;
|
|
364
378
|
align-items: center;
|
|
365
|
-
gap: var(--
|
|
379
|
+
gap: var(--spi-size-4);
|
|
366
380
|
}
|
|
367
381
|
|
|
368
382
|
.table-actions {
|
|
369
383
|
display: flex;
|
|
370
|
-
gap: var(--
|
|
384
|
+
gap: var(--spi-size-4);
|
|
371
385
|
}
|
|
372
386
|
|
|
373
387
|
.table-bulk-actions {
|
|
374
388
|
display: flex;
|
|
375
389
|
align-items: center;
|
|
376
|
-
gap:
|
|
377
|
-
|
|
378
|
-
margin-top: var(--spacing-md);
|
|
390
|
+
gap: var(--spi-size-2);
|
|
391
|
+
margin-top: var(--spi-size-4);
|
|
379
392
|
}
|
|
380
393
|
|
|
381
394
|
.action-divider {
|
|
382
395
|
border: none;
|
|
383
|
-
border-left:
|
|
396
|
+
border-left: var(--spi-border-1) solid var(--spi-color-border-strong);
|
|
384
397
|
margin: 0;
|
|
385
398
|
height: 15px;
|
|
386
399
|
}
|
|
387
400
|
|
|
388
401
|
.table-article {
|
|
389
|
-
margin: var(--
|
|
390
|
-
padding-right:
|
|
402
|
+
margin: var(--spi-size-4) 0;
|
|
403
|
+
padding-right: var(--spi-size-3);
|
|
391
404
|
overflow-x: auto;
|
|
392
405
|
overflow-y: hidden;
|
|
393
406
|
}
|
|
394
407
|
|
|
395
408
|
.table-article--padding {
|
|
396
|
-
padding-bottom: var(--
|
|
409
|
+
padding-bottom: var(--spi-size-4);
|
|
397
410
|
}
|
|
398
411
|
|
|
399
412
|
.table-main {
|
|
@@ -402,12 +415,11 @@
|
|
|
402
415
|
}
|
|
403
416
|
|
|
404
417
|
.table-message {
|
|
405
|
-
margin-top: var(--
|
|
418
|
+
margin-top: var(--spi-size-10);
|
|
406
419
|
text-align: center;
|
|
407
|
-
font-size: var(--font-size-xl);
|
|
408
420
|
}
|
|
409
421
|
|
|
410
422
|
.table-message--error {
|
|
411
|
-
color: var(--color-
|
|
423
|
+
color: var(--spi-color-text-danger);
|
|
412
424
|
}
|
|
413
425
|
</style>
|
|
@@ -15,13 +15,17 @@ declare function $$render<T extends object>(): {
|
|
|
15
15
|
enableColumnSearch?: boolean;
|
|
16
16
|
enableColumnVisibility?: boolean;
|
|
17
17
|
enableAdvancedFilter?: boolean;
|
|
18
|
-
|
|
18
|
+
serverSide?: boolean;
|
|
19
19
|
pagination?: Pagination;
|
|
20
|
+
initialPage?: number;
|
|
21
|
+
initialPageSize?: number;
|
|
20
22
|
excelSetting?: ExcelSetting;
|
|
21
23
|
header?: Snippet;
|
|
22
24
|
bulkActions?: Snippet<[selectedRows: T[], clearSelection: VoidFunction]>;
|
|
23
25
|
onpagechange?: (pageSize: number, pageNumber: number) => void;
|
|
24
26
|
onpagesizechange?: (pageSize: number) => void;
|
|
27
|
+
onnextpage?: (pageSize: number, pageNumber: number) => void;
|
|
28
|
+
onprevpage?: (pageSize: number, pageNumber: number) => void;
|
|
25
29
|
};
|
|
26
30
|
exports: {};
|
|
27
31
|
bindings: "";
|
|
@@ -6,13 +6,21 @@ export interface Action {
|
|
|
6
6
|
isMainAction?: boolean;
|
|
7
7
|
onClick: VoidFunction;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
interface BasePagination {
|
|
10
10
|
totalItems: number;
|
|
11
11
|
totalPages: number;
|
|
12
|
+
}
|
|
13
|
+
export interface PagePagination extends BasePagination {
|
|
12
14
|
currentPage: number;
|
|
13
15
|
}
|
|
16
|
+
export interface CursorPagination extends BasePagination {
|
|
17
|
+
nextCursor?: string | null;
|
|
18
|
+
prevCursor?: string | null;
|
|
19
|
+
}
|
|
20
|
+
export type Pagination = PagePagination | CursorPagination;
|
|
14
21
|
export interface Filter {
|
|
15
22
|
column: string;
|
|
16
23
|
value: string;
|
|
17
24
|
operation?: Operation;
|
|
18
25
|
}
|
|
26
|
+
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type ColumnDef, type Row } from './adapter/index.js';
|
|
2
|
-
import type { Action, Filter } from './types.js';
|
|
2
|
+
import type { Action, CursorPagination, Filter, PagePagination, Pagination } from './types.js';
|
|
3
3
|
export declare const createCheckedColumn: <T>() => import("./adapter/index.js").DisplayColumnDef<T, unknown>;
|
|
4
4
|
export declare const createActionsColumn: <T>(getActions: (row: Row<T>) => Action[]) => import("./adapter/index.js").DisplayColumnDef<T, unknown>;
|
|
5
5
|
export declare const createStaticTable: <TData>(columns: ColumnDef<TData, any>[], data: TData[]) => import("./adapter/index.js").Table<TData>;
|
|
6
|
+
export declare const isValidPage: (value: number | undefined) => value is number;
|
|
7
|
+
export declare const isValidPageSize: (value: number | undefined) => value is number;
|
|
6
8
|
export declare const getPageLimit: (urlSearchParams: URLSearchParams) => number;
|
|
7
9
|
export declare const getPage: (urlSearchParams: URLSearchParams) => number;
|
|
8
10
|
export declare const sanitizeFilters: (filterParams: string[]) => Filter[];
|
|
11
|
+
export declare const isPagePagination: (pagination: Pagination) => pagination is PagePagination;
|
|
12
|
+
export declare const isCursorPagination: (pagination: Pagination) => pagination is CursorPagination;
|
|
@@ -58,17 +58,15 @@ export const createStaticTable = (columns, data) => {
|
|
|
58
58
|
renderFallbackValue: null
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
|
+
export const isValidPage = (value) => value !== undefined && Number.isInteger(value) && value > 0;
|
|
62
|
+
export const isValidPageSize = (value) => value !== undefined && DEFAULT_ITEMS_PER_PAGE_OPTIONS.includes(value);
|
|
61
63
|
export const getPageLimit = (urlSearchParams) => {
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
const isLimitValid = !Number.isNaN(limit) && DEFAULT_ITEMS_PER_PAGE_OPTIONS.includes(limit);
|
|
65
|
-
return isLimitValid ? limit : DEFAULT_PAGE_LIMIT;
|
|
64
|
+
const limit = Number(urlSearchParams.get('limit'));
|
|
65
|
+
return isValidPageSize(limit) ? limit : DEFAULT_PAGE_LIMIT;
|
|
66
66
|
};
|
|
67
67
|
export const getPage = (urlSearchParams) => {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
const isPageValid = pageParam && !Number.isNaN(page) && page > 0;
|
|
71
|
-
return isPageValid ? page : DEFAULT_PAGE;
|
|
68
|
+
const page = Number(urlSearchParams.get('page'));
|
|
69
|
+
return isValidPage(page) ? page : DEFAULT_PAGE;
|
|
72
70
|
};
|
|
73
71
|
export const sanitizeFilters = (filterParams) => {
|
|
74
72
|
return filterParams
|
|
@@ -100,3 +98,5 @@ const isValidFilter = (column, operator, value) => {
|
|
|
100
98
|
const isValidOperation = (operation) => {
|
|
101
99
|
return Object.values(Operation).includes(operation);
|
|
102
100
|
};
|
|
101
|
+
export const isPagePagination = (pagination) => 'currentPage' in pagination;
|
|
102
|
+
export const isCursorPagination = (pagination) => 'nextCursor' in pagination || 'prevCursor' in pagination;
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
aria-controls="panel-{tab.index}"
|
|
31
31
|
tabindex={isActiveTab ? 0 : -1}
|
|
32
32
|
type="button"
|
|
33
|
-
class
|
|
33
|
+
class={isActiveTab ? 'active spi-text-semibold-3' : 'spi-text-medium-3'}
|
|
34
34
|
onclick={handleClick(tab.index)}
|
|
35
35
|
>
|
|
36
36
|
{tab.label}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
{#each tabs as tab, index (index)}
|
|
43
43
|
{#if activeTab === tab.index}
|
|
44
44
|
<div
|
|
45
|
-
class={['tabs-content', !tab.disablePadding && 'padding']}
|
|
45
|
+
class={['tabs-content', 'spi-text-regular-4', !tab.disablePadding && 'padding']}
|
|
46
46
|
id="panel-{tab.index}"
|
|
47
47
|
role="tabpanel"
|
|
48
48
|
aria-labelledby="tab-{tab.index}"
|
|
@@ -67,40 +67,37 @@
|
|
|
67
67
|
|
|
68
68
|
.tabs-list {
|
|
69
69
|
display: flex;
|
|
70
|
-
gap:
|
|
71
|
-
border-bottom:
|
|
72
|
-
padding: 0
|
|
70
|
+
gap: var(--spi-size-4);
|
|
71
|
+
border-bottom: var(--spi-border-1) solid var(--spi-color-border-default);
|
|
72
|
+
padding: 0 var(--spi-size-6);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.tabs-list button {
|
|
76
|
-
border-radius:
|
|
77
|
-
background-color:
|
|
78
|
-
padding:
|
|
76
|
+
border-radius: var(--spi-rounded-lg);
|
|
77
|
+
background-color: var(--spi-color-surface-default);
|
|
78
|
+
padding: var(--spi-size-5) var(--spi-size-4);
|
|
79
79
|
position: relative;
|
|
80
80
|
border: none;
|
|
81
|
-
font-size: 16px;
|
|
82
|
-
font-weight: 500;
|
|
83
81
|
}
|
|
84
82
|
|
|
85
83
|
.tabs-list button:hover {
|
|
86
|
-
background-color:
|
|
84
|
+
background-color: var(--spi-color-surface-subtle);
|
|
87
85
|
cursor: pointer;
|
|
88
86
|
}
|
|
89
87
|
|
|
90
88
|
.tabs-list button.active {
|
|
91
|
-
color:
|
|
92
|
-
font-weight: 600;
|
|
89
|
+
color: var(--spi-color-primary-base);
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
.tabs-list button::after {
|
|
96
93
|
content: '';
|
|
97
94
|
position: absolute;
|
|
98
95
|
left: 50%;
|
|
99
|
-
bottom: -
|
|
96
|
+
bottom: calc(-1 * var(--spi-border-2));
|
|
100
97
|
width: 0;
|
|
101
|
-
height:
|
|
102
|
-
background-color:
|
|
103
|
-
border-radius:
|
|
98
|
+
height: var(--spi-size-1);
|
|
99
|
+
background-color: var(--spi-color-primary-base);
|
|
100
|
+
border-radius: var(--spi-rounded-lg);
|
|
104
101
|
transform: translateX(-50%);
|
|
105
102
|
}
|
|
106
103
|
|
|
@@ -113,15 +110,14 @@
|
|
|
113
110
|
width: 100%;
|
|
114
111
|
height: 100%;
|
|
115
112
|
position: relative;
|
|
116
|
-
border-radius:
|
|
113
|
+
border-radius: 0 0 var(--spi-rounded-2xl) var(--spi-rounded-2xl);
|
|
117
114
|
overflow-wrap: break-word;
|
|
118
115
|
box-sizing: border-box;
|
|
119
116
|
min-height: 300px;
|
|
120
117
|
text-align: left;
|
|
121
|
-
font-size: 18px;
|
|
122
118
|
}
|
|
123
119
|
|
|
124
120
|
.padding {
|
|
125
|
-
padding:
|
|
121
|
+
padding: var(--spi-size-6);
|
|
126
122
|
}
|
|
127
123
|
</style>
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<div class="toast" in:fly={transitionConfig} out:fly={transitionConfig}>
|
|
29
29
|
<span class="status-indicator {toast.type}"></span>
|
|
30
30
|
<div class="toast-content-container">
|
|
31
|
-
<div class="toast-content">
|
|
31
|
+
<div class="toast-content spi-text-regular-2">
|
|
32
32
|
<span>{toast.message}</span>
|
|
33
33
|
{#if toast.link}
|
|
34
34
|
<a class="toast-content-link" href={toast.link} title="View details"
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
<style>
|
|
54
54
|
.toast-container {
|
|
55
55
|
position: fixed;
|
|
56
|
-
top:
|
|
57
|
-
right:
|
|
56
|
+
top: var(--spi-size-24);
|
|
57
|
+
right: var(--spi-size-4);
|
|
58
58
|
z-index: 9999;
|
|
59
59
|
display: flex;
|
|
60
60
|
flex-direction: column;
|
|
61
|
-
gap:
|
|
61
|
+
gap: var(--spi-size-4);
|
|
62
62
|
align-items: flex-end;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -66,17 +66,14 @@
|
|
|
66
66
|
min-width: 400px;
|
|
67
67
|
max-width: 600px;
|
|
68
68
|
width: fit-content;
|
|
69
|
-
min-height:
|
|
69
|
+
min-height: var(--spi-size-14);
|
|
70
70
|
display: inline-flex;
|
|
71
|
-
padding:
|
|
72
|
-
gap:
|
|
73
|
-
border-radius:
|
|
74
|
-
border:
|
|
75
|
-
background:
|
|
76
|
-
box-shadow:
|
|
77
|
-
0px 4px 5px 0px rgba(51, 56, 64, 0.15),
|
|
78
|
-
0px 1px 3px 0px rgba(51, 56, 64, 0.2),
|
|
79
|
-
0px 1px 16px 0px rgba(51, 56, 64, 0.1);
|
|
71
|
+
padding: var(--spi-size-2);
|
|
72
|
+
gap: var(--spi-size-4);
|
|
73
|
+
border-radius: var(--spi-rounded-lg);
|
|
74
|
+
border: var(--spi-border-1) solid var(--spi-color-border-default);
|
|
75
|
+
background: var(--spi-color-surface-default);
|
|
76
|
+
box-shadow: var(--spi-shadow-card);
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
.toast-content {
|
|
@@ -84,55 +81,55 @@
|
|
|
84
81
|
justify-content: space-between;
|
|
85
82
|
flex-direction: row;
|
|
86
83
|
flex-wrap: wrap;
|
|
87
|
-
gap:
|
|
88
|
-
padding:
|
|
89
|
-
font-size: 14px;
|
|
90
|
-
font-weight: 400;
|
|
91
|
-
line-height: 20px;
|
|
84
|
+
gap: var(--spi-size-2);
|
|
85
|
+
padding: var(--spi-size-2) 0;
|
|
92
86
|
align-items: center;
|
|
93
87
|
}
|
|
94
88
|
|
|
95
89
|
.toast-content-container {
|
|
96
90
|
display: flex;
|
|
97
91
|
align-items: center;
|
|
98
|
-
gap:
|
|
92
|
+
gap: var(--spi-size-4);
|
|
99
93
|
flex-grow: 1;
|
|
100
94
|
}
|
|
101
95
|
|
|
102
96
|
.status-indicator {
|
|
103
|
-
width:
|
|
97
|
+
width: var(--spi-size-2);
|
|
104
98
|
align-self: stretch;
|
|
105
99
|
flex-shrink: 0;
|
|
106
|
-
border-radius:
|
|
100
|
+
border-radius: var(--spi-rounded-sm);
|
|
107
101
|
background-color: var(--toast-bg);
|
|
108
102
|
}
|
|
109
103
|
|
|
110
104
|
.toast-content-link {
|
|
111
105
|
display: flex;
|
|
112
106
|
align-items: center;
|
|
113
|
-
color:
|
|
107
|
+
color: var(--spi-color-primary-darker);
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
.toast-content-link:hover {
|
|
117
|
-
color:
|
|
111
|
+
color: var(--spi-color-primary-base);
|
|
118
112
|
text-decoration: underline;
|
|
119
113
|
}
|
|
120
114
|
|
|
121
115
|
.status-indicator.info {
|
|
122
|
-
--toast-bg:
|
|
116
|
+
--toast-bg: var(--spi-color-primary-base);
|
|
123
117
|
}
|
|
124
118
|
|
|
125
119
|
.status-indicator.warning {
|
|
126
|
-
--toast-bg:
|
|
120
|
+
--toast-bg: var(--spi-color-warning-base);
|
|
127
121
|
}
|
|
122
|
+
|
|
128
123
|
.status-indicator.danger {
|
|
129
|
-
--toast-bg:
|
|
124
|
+
--toast-bg: var(--spi-color-danger-base);
|
|
130
125
|
}
|
|
126
|
+
|
|
131
127
|
.status-indicator.neutral {
|
|
132
|
-
--toast-bg:
|
|
128
|
+
--toast-bg: var(--spi-color-neutral-base);
|
|
133
129
|
}
|
|
130
|
+
|
|
134
131
|
.status-indicator.success {
|
|
135
|
-
--toast-bg:
|
|
132
|
+
--toast-bg: var(--spi-color-success-base);
|
|
136
133
|
}
|
|
137
134
|
|
|
138
135
|
.toast-close-container {
|
|
@@ -147,7 +144,7 @@
|
|
|
147
144
|
|
|
148
145
|
.toast-close-button:hover {
|
|
149
146
|
cursor: pointer;
|
|
150
|
-
color:
|
|
147
|
+
color: var(--spi-color-text-secondary);
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
.toast-close-button:focus {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
|
|
52
52
|
{#if isVisible && content}
|
|
53
53
|
<div
|
|
54
|
-
class="tooltip tooltip-{position} tooltip-{width} {customClass}"
|
|
54
|
+
class="tooltip tooltip-{position} tooltip-{width} {customClass} spi-text-regular-2"
|
|
55
55
|
in:fly={transitionConfig}
|
|
56
56
|
out:fly={transitionConfig}
|
|
57
57
|
role="tooltip"
|
|
@@ -76,15 +76,12 @@
|
|
|
76
76
|
.tooltip {
|
|
77
77
|
position: absolute;
|
|
78
78
|
z-index: 1000;
|
|
79
|
-
padding:
|
|
80
|
-
border-radius:
|
|
81
|
-
font-size: 14px;
|
|
82
|
-
font-weight: 400;
|
|
83
|
-
line-height: 20px;
|
|
79
|
+
padding: var(--spi-size-2) var(--spi-size-3);
|
|
80
|
+
border-radius: var(--spi-rounded-md);
|
|
84
81
|
text-align: center;
|
|
85
82
|
pointer-events: none;
|
|
86
|
-
background-color:
|
|
87
|
-
color:
|
|
83
|
+
background-color: var(--spi-color-neutral-darkest);
|
|
84
|
+
color: var(--spi-color-text-inverse);
|
|
88
85
|
white-space: normal;
|
|
89
86
|
}
|
|
90
87
|
|
|
@@ -101,66 +98,65 @@
|
|
|
101
98
|
}
|
|
102
99
|
|
|
103
100
|
.tooltip-top {
|
|
104
|
-
bottom: calc(100% +
|
|
101
|
+
bottom: calc(100% + var(--spi-size-3));
|
|
105
102
|
left: 50%;
|
|
106
103
|
transform: translateX(-50%);
|
|
107
104
|
}
|
|
108
105
|
|
|
109
106
|
.tooltip-bottom {
|
|
110
|
-
top: calc(100% +
|
|
107
|
+
top: calc(100% + var(--spi-size-3));
|
|
111
108
|
left: 50%;
|
|
112
109
|
transform: translateX(-50%);
|
|
113
110
|
}
|
|
114
111
|
|
|
115
112
|
.tooltip-left {
|
|
116
113
|
top: 50%;
|
|
117
|
-
right: calc(100% +
|
|
114
|
+
right: calc(100% + var(--spi-size-3));
|
|
118
115
|
transform: translateY(-50%);
|
|
119
116
|
}
|
|
120
117
|
|
|
121
118
|
.tooltip-right {
|
|
122
119
|
top: 50%;
|
|
123
|
-
left: calc(100% +
|
|
120
|
+
left: calc(100% + var(--spi-size-3));
|
|
124
121
|
transform: translateY(-50%);
|
|
125
122
|
}
|
|
126
123
|
|
|
127
124
|
.tooltip-arrow {
|
|
128
125
|
position: absolute;
|
|
129
|
-
border:
|
|
126
|
+
border: var(--spi-border-5) solid transparent;
|
|
130
127
|
}
|
|
131
128
|
|
|
132
129
|
.tooltip-arrow-top {
|
|
133
130
|
top: 100%;
|
|
134
131
|
left: 50%;
|
|
135
132
|
transform: translateX(-50%);
|
|
136
|
-
border-top-color:
|
|
133
|
+
border-top-color: var(--spi-color-neutral-darkest);
|
|
137
134
|
}
|
|
138
135
|
|
|
139
136
|
.tooltip-arrow-bottom {
|
|
140
137
|
bottom: 100%;
|
|
141
138
|
left: 50%;
|
|
142
139
|
transform: translateX(-50%);
|
|
143
|
-
border-bottom-color:
|
|
140
|
+
border-bottom-color: var(--spi-color-neutral-darkest);
|
|
144
141
|
}
|
|
145
142
|
|
|
146
143
|
.tooltip-arrow-left {
|
|
147
144
|
top: 50%;
|
|
148
145
|
left: 100%;
|
|
149
146
|
transform: translateY(-50%);
|
|
150
|
-
border-left-color:
|
|
147
|
+
border-left-color: var(--spi-color-neutral-darkest);
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
.tooltip-arrow-right {
|
|
154
151
|
top: 50%;
|
|
155
152
|
right: 100%;
|
|
156
153
|
transform: translateY(-50%);
|
|
157
|
-
border-right-color:
|
|
154
|
+
border-right-color: var(--spi-color-neutral-darkest);
|
|
158
155
|
}
|
|
159
156
|
|
|
160
157
|
@media (max-width: 768px) {
|
|
161
158
|
.tooltip {
|
|
162
|
-
|
|
163
|
-
padding: 6px 10px;
|
|
159
|
+
padding: var(--spi-size-1) var(--spi-size-2);
|
|
164
160
|
}
|
|
165
161
|
}
|
|
166
162
|
</style>
|