@placeholderco/placeholder-ui 1.0.12 → 2.0.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/LICENSE +1 -1
- package/README.md +134 -130
- package/dist/app.css +178 -0
- package/dist/bootstrap.min.css +3600 -0
- package/dist/cards/GitCard.svelte +115 -0
- package/dist/cards/GitCard.svelte.d.ts +22 -0
- package/dist/display/Avatar.svelte +29 -17
- package/dist/display/Avatar.svelte.d.ts +12 -2
- package/dist/display/LinkCollection.svelte +40 -18
- package/dist/display/LinkCollection.svelte.d.ts +9 -2
- package/dist/display/Paper.svelte +31 -19
- package/dist/display/Paper.svelte.d.ts +12 -3
- package/dist/display/alert/Alert.svelte +129 -0
- package/dist/display/alert/Alert.svelte.d.ts +15 -0
- package/dist/display/alert/AlertVariant.d.ts +1 -0
- package/dist/display/alert/AlertVariant.js +1 -0
- package/dist/display/filetree/FileTree.svelte +259 -0
- package/dist/display/filetree/FileTree.svelte.d.ts +76 -0
- package/dist/display/filetree/FileTreeItem.svelte +396 -0
- package/dist/display/filetree/FileTreeItem.svelte.d.ts +40 -0
- package/dist/display/filetree/FileTreeNode.d.ts +46 -0
- package/dist/display/filetree/FileTreeNode.js +115 -0
- package/dist/display/filetree/index.d.ts +5 -0
- package/dist/display/filetree/index.js +3 -0
- package/dist/editors/CodeMirror.svelte +306 -0
- package/dist/editors/CodeMirror.svelte.d.ts +31 -0
- package/dist/editors/tiptap/LinkActionMenu.svelte +307 -0
- package/dist/editors/tiptap/LinkActionMenu.svelte.d.ts +8 -0
- package/dist/editors/tiptap/TipTap.svelte +856 -0
- package/dist/editors/tiptap/TipTap.svelte.d.ts +54 -0
- package/dist/editors/tiptap/TipTapBubble.svelte +790 -0
- package/dist/editors/tiptap/TipTapBubble.svelte.d.ts +44 -0
- package/dist/editors/tiptap/collaboration.d.ts +55 -0
- package/dist/editors/tiptap/collaboration.js +1 -0
- package/dist/editors/tiptap/extensions/Alert.d.ts +18 -0
- package/dist/editors/tiptap/extensions/Alert.js +72 -0
- package/dist/editors/tiptap/extensions/CodeBlockEditor.d.ts +21 -0
- package/dist/editors/tiptap/extensions/CodeBlockEditor.js +326 -0
- package/dist/editors/tiptap/extensions/Div.d.ts +19 -0
- package/dist/editors/tiptap/extensions/Div.js +89 -0
- package/dist/editors/tiptap/extensions/Span.d.ts +5 -0
- package/dist/editors/tiptap/extensions/Span.js +56 -0
- package/dist/editors/tiptap/extensions/codeBlockEditor.css +236 -0
- package/dist/editors/tiptap/extensions/codeBlockLanguages.d.ts +17 -0
- package/dist/editors/tiptap/extensions/codeBlockLanguages.js +124 -0
- package/dist/editors/tiptap/extensions/index.d.ts +7 -0
- package/dist/editors/tiptap/extensions/index.js +5 -0
- package/dist/editors/tiptap/toolbar/AlertButton.svelte +261 -0
- package/dist/editors/tiptap/toolbar/AlertButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/BoldButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/BoldButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/CodeButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/CodeButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ColorButton.svelte +299 -0
- package/dist/editors/tiptap/toolbar/ColorButton.svelte.d.ts +20 -0
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte +58 -0
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte.d.ts +9 -0
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte +30 -0
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte.d.ts +8 -0
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte +68 -0
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ImageButton.svelte +54 -0
- package/dist/editors/tiptap/toolbar/ImageButton.svelte.d.ts +8 -0
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/LinkButton.svelte +257 -0
- package/dist/editors/tiptap/toolbar/LinkButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/RedoButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/RedoButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/TableButton.svelte +258 -0
- package/dist/editors/tiptap/toolbar/TableButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +84 -0
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte.d.ts +10 -0
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/UndoButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/UndoButton.svelte.d.ts +7 -0
- package/dist/form/Autocomplete.svelte +86 -135
- package/dist/form/Autocomplete.svelte.d.ts +6 -8
- package/dist/form/AutocompleteMulti.svelte +385 -227
- package/dist/form/AutocompleteMulti.svelte.d.ts +59 -10
- package/dist/form/Checkbox.svelte +59 -54
- package/dist/form/Checkbox.svelte.d.ts +14 -5
- package/dist/form/Chips.svelte +29 -13
- package/dist/form/Chips.svelte.d.ts +16 -2
- package/dist/form/ComboBox.svelte +30 -20
- package/dist/form/ComboBox.svelte.d.ts +1 -1
- package/dist/form/ComboBoxItemBuilder.svelte +161 -188
- package/dist/form/ComboBoxItemBuilder.svelte.d.ts +19 -2
- package/dist/form/ComboBoxMulti.svelte +38 -24
- package/dist/form/ComboBoxMulti.svelte.d.ts +1 -1
- package/dist/form/CronBuilder.svelte +84 -67
- package/dist/form/CronBuilder.svelte.d.ts +16 -3
- package/dist/form/DatePicker.svelte +148 -195
- package/dist/form/DateRangePicker.svelte +101 -98
- package/dist/form/DateTimePicker.svelte +167 -208
- package/dist/form/DateTimePicker.svelte.d.ts +10 -2
- package/dist/form/FormGroup.svelte +33 -10
- package/dist/form/FormGroup.svelte.d.ts +12 -2
- package/dist/form/Number.svelte +70 -47
- package/dist/form/Number.svelte.d.ts +36 -6
- package/dist/form/Radio.svelte +18 -18
- package/dist/form/RadioGroup.svelte +23 -12
- package/dist/form/RadioGroup.svelte.d.ts +13 -2
- package/dist/form/SegmentedControl.svelte +76 -56
- package/dist/form/SegmentedControl.svelte.d.ts +9 -4
- package/dist/form/Select.svelte +150 -233
- package/dist/form/Select.svelte.d.ts +29 -5
- package/dist/form/SelectMulti.svelte +163 -277
- package/dist/form/SelectMulti.svelte.d.ts +36 -7
- package/dist/form/Slider.svelte +183 -269
- package/dist/form/Slider.svelte.d.ts +32 -17
- package/dist/form/StringArrayBuilder.svelte +249 -0
- package/dist/form/StringArrayBuilder.svelte.d.ts +15 -0
- package/dist/form/Switch.svelte +164 -106
- package/dist/form/Switch.svelte.d.ts +22 -3
- package/dist/form/TextArea.svelte +49 -29
- package/dist/form/TextArea.svelte.d.ts +23 -3
- package/dist/form/Textbox.svelte +69 -68
- package/dist/form/Textbox.svelte.d.ts +32 -4
- package/dist/form/TimePicker.svelte +42 -47
- package/dist/form/TimePicker.svelte.d.ts +12 -2
- package/dist/form/comboBoxCore.svelte.d.ts +99 -0
- package/dist/form/comboBoxCore.svelte.js +243 -0
- package/dist/icon/Icon.svelte +8 -3
- package/dist/icon/Icon.svelte.d.ts +8 -3
- package/dist/icon/file-type-bmp.svg +1 -0
- package/dist/icon/file-type-csv.svg +1 -0
- package/dist/icon/file-type-doc.svg +1 -0
- package/dist/icon/file-type-docx.svg +1 -0
- package/dist/icon/file-type-jpg.svg +1 -0
- package/dist/icon/file-type-pdf.svg +1 -0
- package/dist/icon/file-type-png.svg +1 -0
- package/dist/icon/file-type-ppt.svg +1 -0
- package/dist/icon/file-type-svg.svg +1 -0
- package/dist/icon/file-type-txt.svg +1 -0
- package/dist/icon/file-type-xls.svg +1 -0
- package/dist/icon/file-type-zip.svg +1 -0
- package/dist/icon/index.d.ts +166 -151
- package/dist/icon/index.js +166 -152
- package/dist/icon/logo-placeholder.svg +6 -0
- package/dist/icon/source-code.svg +1 -0
- package/dist/icon/sun-moon.svg +1 -0
- package/dist/icon/table.svg +6 -0
- package/dist/index.d.ts +87 -26
- package/dist/index.js +25 -28
- package/dist/layout/AppShell.svelte +12 -162
- package/dist/layout/AppShell.svelte.d.ts +6 -27
- package/dist/layout/CustomNavbar.svelte +9 -7
- package/dist/layout/CustomNavbar.svelte.d.ts +4 -2
- package/dist/layout/Navbar.svelte +161 -129
- package/dist/layout/Navbar.svelte.d.ts +29 -15
- package/dist/layout/NavbarItemDisplay.svelte +2 -2
- package/dist/layout/NavbarItemView.svelte +182 -0
- package/dist/layout/NavbarItemView.svelte.d.ts +10 -0
- package/dist/layout/Sidenav.svelte +280 -341
- package/dist/layout/Sidenav.svelte.d.ts +36 -4
- package/dist/models/ComboBoxItem.d.ts +2 -0
- package/dist/models/Employee.d.ts +53 -0
- package/dist/models/Employee.js +23 -0
- package/dist/models/Hyperlink.d.ts +3 -1
- package/dist/models/LinkCollectionItem.d.ts +3 -1
- package/dist/models/NavbarItem.d.ts +6 -2
- package/dist/theme.svelte.d.ts +0 -1
- package/dist/theme.svelte.js +46 -58
- package/dist/ui/Accordion.svelte +81 -242
- package/dist/ui/Accordion.svelte.d.ts +37 -14
- package/dist/ui/AccordionItem.svelte +303 -0
- package/dist/ui/AccordionItem.svelte.d.ts +21 -0
- package/dist/ui/ActionIcon.svelte +25 -21
- package/dist/ui/ActionIcon.svelte.d.ts +15 -2
- package/dist/ui/Badge.svelte +163 -171
- package/dist/ui/Badge.svelte.d.ts +13 -5
- package/dist/ui/Button.svelte +178 -205
- package/dist/ui/Button.svelte.d.ts +19 -2
- package/dist/ui/ButtonVariant.d.ts +15 -1
- package/dist/ui/ContextMenu.svelte +146 -0
- package/dist/ui/ContextMenu.svelte.d.ts +37 -0
- package/dist/ui/ContextMenuList.svelte +188 -0
- package/dist/ui/ContextMenuList.svelte.d.ts +12 -0
- package/dist/ui/Dialog.svelte +183 -111
- package/dist/ui/Dialog.svelte.d.ts +21 -4
- package/dist/ui/Drawer.svelte +237 -184
- package/dist/ui/Drawer.svelte.d.ts +20 -2
- package/dist/ui/Dropdown.svelte +24 -14
- package/dist/ui/Dropdown.svelte.d.ts +11 -2
- package/dist/ui/Dropzone.svelte +159 -57
- package/dist/ui/Dropzone.svelte.d.ts +29 -2
- package/dist/ui/Link.svelte +12 -4
- package/dist/ui/Link.svelte.d.ts +8 -2
- package/dist/ui/Loader.svelte +23 -18
- package/dist/ui/Loader.svelte.d.ts +5 -2
- package/dist/ui/Logo.svelte +37 -0
- package/dist/ui/Logo.svelte.d.ts +16 -0
- package/dist/ui/MultiSortable.svelte +287 -0
- package/dist/ui/MultiSortable.svelte.d.ts +50 -0
- package/dist/ui/Pagination.svelte +15 -9
- package/dist/ui/Pagination.svelte.d.ts +6 -2
- package/dist/ui/Popover.svelte +43 -65
- package/dist/ui/Popover.svelte.d.ts +14 -5
- package/dist/ui/ProgressBar.svelte +28 -30
- package/dist/ui/ProgressBarVariant.d.ts +7 -1
- package/dist/ui/SegmentedControl.svelte +0 -0
- package/dist/ui/SegmentedControl.svelte.d.ts +26 -0
- package/dist/ui/Sortable.svelte +163 -0
- package/dist/ui/Sortable.svelte.d.ts +47 -0
- package/dist/ui/Table.svelte +383 -80
- package/dist/ui/Table.svelte.d.ts +43 -2
- package/dist/ui/Tabs.svelte +22 -18
- package/dist/ui/Tabs.svelte.d.ts +6 -2
- package/dist/ui/ThemeSwitcher.svelte +26 -7
- package/dist/ui/ThemeSwitcher.svelte.d.ts +4 -2
- package/dist/ui/Tooltip.svelte +312 -180
- package/dist/ui/Tooltip.svelte.d.ts +4 -3
- package/dist/uiTheme.svelte.d.ts +86 -0
- package/dist/uiTheme.svelte.js +214 -0
- package/dist/util/DateFunctions.js +1 -1
- package/dist/util/DragDrop.d.ts +50 -0
- package/dist/util/DragDrop.js +154 -0
- package/dist/util/NavigateTo.js +2 -2
- package/dist/util/dayjs.d.ts +4 -0
- package/dist/util/dayjs.js +15 -0
- package/package.json +66 -26
- package/dist/display/Alert.svelte +0 -179
- package/dist/display/Alert.svelte.d.ts +0 -13
- package/dist/form/FileInput.svelte +0 -235
- package/dist/form/FileInput.svelte.d.ts +0 -23
- package/dist/form/PasswordInput.svelte +0 -253
- package/dist/form/PasswordInput.svelte.d.ts +0 -34
- package/dist/form/Rating.svelte +0 -235
- package/dist/form/Rating.svelte.d.ts +0 -21
- package/dist/styles/components.css +0 -199
- package/dist/styles/dark.css +0 -146
- package/dist/styles/index.css +0 -116
- package/dist/styles/reset.css +0 -110
- package/dist/styles/semantic.css +0 -86
- package/dist/styles/tokens.css +0 -203
- package/dist/styles/utilities.css +0 -523
- package/dist/ui/Breadcrumbs.svelte +0 -131
- package/dist/ui/Breadcrumbs.svelte.d.ts +0 -16
- package/dist/ui/LoadingOverlay.svelte +0 -53
- package/dist/ui/LoadingOverlay.svelte.d.ts +0 -11
- package/dist/ui/Progress.svelte +0 -191
- package/dist/ui/Progress.svelte.d.ts +0 -15
- package/dist/ui/RingProgress.svelte +0 -141
- package/dist/ui/RingProgress.svelte.d.ts +0 -18
- package/dist/ui/Skeleton.svelte +0 -85
- package/dist/ui/Skeleton.svelte.d.ts +0 -12
- package/dist/ui/Stepper.svelte +0 -355
- package/dist/ui/Stepper.svelte.d.ts +0 -24
- package/dist/ui/Timeline.svelte +0 -225
- package/dist/ui/Timeline.svelte.d.ts +0 -23
- /package/dist/{actions → util}/ClickOutside.d.ts +0 -0
- /package/dist/{actions → util}/ClickOutside.js +0 -0
- /package/dist/{transitions → util}/Transitions.d.ts +0 -0
- /package/dist/{transitions → util}/Transitions.js +0 -0
|
@@ -5,9 +5,17 @@ export interface Column<T = any> {
|
|
|
5
5
|
sortable?: boolean;
|
|
6
6
|
width?: string;
|
|
7
7
|
align?: 'left' | 'center' | 'right';
|
|
8
|
+
/** Snippet rendered as the cell content. Takes precedence over `render`. */
|
|
9
|
+
cell?: Snippet<[{
|
|
10
|
+
value: any;
|
|
11
|
+
row: T;
|
|
12
|
+
index: number;
|
|
13
|
+
}]>;
|
|
14
|
+
/** @deprecated Returns raw HTML injected via {@html} — unsafe for untrusted
|
|
15
|
+
* data and cannot render components. Use `cell` instead. */
|
|
8
16
|
render?: (value: any, row: T) => any;
|
|
9
17
|
}
|
|
10
|
-
interface
|
|
18
|
+
export interface TableProps<T = any> {
|
|
11
19
|
/** Column definitions for the table */
|
|
12
20
|
columns: Column<T>[];
|
|
13
21
|
/** Data rows to display */
|
|
@@ -34,6 +42,10 @@ interface Props<T = any> {
|
|
|
34
42
|
buttons?: Snippet<[T, number]>;
|
|
35
43
|
/** Callback when a row is clicked */
|
|
36
44
|
onrowclick?: (row: T, index: number) => void;
|
|
45
|
+
/** Returns a URL for a row. When provided, rows act as links: a plain click
|
|
46
|
+
* navigates client-side, while middle-click or ctrl/cmd/shift-click opens the
|
|
47
|
+
* URL in a new tab. Return a falsy value to make a row non-navigable. */
|
|
48
|
+
rowHref?: (row: T, index: number) => string | undefined | null;
|
|
37
49
|
/** Enable checkbox selection */
|
|
38
50
|
selectable?: boolean;
|
|
39
51
|
/** Field name used to uniquely identify rows (required when selectable is true) */
|
|
@@ -42,7 +54,36 @@ interface Props<T = any> {
|
|
|
42
54
|
selectedRows?: T[];
|
|
43
55
|
/** Callback when selection changes */
|
|
44
56
|
onselect?: (selectedRows: T[]) => void;
|
|
57
|
+
/** Detail content rendered in a full-width row beneath an expanded row.
|
|
58
|
+
* Providing this enables row expansion: expandable rows toggle on row click
|
|
59
|
+
* or via their chevron button. Requires rowKey. */
|
|
60
|
+
expandedContent?: Snippet<[T, number]>;
|
|
61
|
+
/** Limits which rows can expand (e.g. only group rows). Default: all rows. */
|
|
62
|
+
canExpand?: (row: T, index: number) => boolean;
|
|
63
|
+
/** Keys (via rowKey) of currently expanded rows (bindable) */
|
|
64
|
+
expandedKeys?: any[];
|
|
65
|
+
/** Callback when a row is expanded or collapsed — trigger on-demand fetches here */
|
|
66
|
+
onexpand?: (row: T, index: number, expanded: boolean) => void;
|
|
67
|
+
/** Rows per page. Setting this enables built-in client-side pagination,
|
|
68
|
+
* applied after search filtering and sorting. */
|
|
69
|
+
pageSize?: number;
|
|
70
|
+
/** Current page number, 1-based (bindable) */
|
|
71
|
+
page?: number;
|
|
72
|
+
/** Callback when the current page changes */
|
|
73
|
+
onpagechange?: (page: number) => void;
|
|
74
|
+
/** Key of the column currently sorted by, or null for unsorted (bindable).
|
|
75
|
+
* Set it to render the sort indicator for a server-supplied sort order. */
|
|
76
|
+
sortKey?: string | null;
|
|
77
|
+
/** Current sort direction (bindable) */
|
|
78
|
+
sortDirection?: 'asc' | 'desc';
|
|
79
|
+
/** Callback when the user clicks a sortable header, after `sortKey` and
|
|
80
|
+
* `sortDirection` have been updated. Use it to request sorted data from a
|
|
81
|
+
* server. Paginated tables also reset to page 1 before this fires. */
|
|
82
|
+
onsort?: (key: string, direction: 'asc' | 'desc') => void;
|
|
83
|
+
/** Skip the built-in client-side sort and render `rows` in the order given.
|
|
84
|
+
* Use with `onsort` when the server returns pre-sorted rows. */
|
|
85
|
+
manualSort?: boolean;
|
|
45
86
|
}
|
|
46
|
-
declare const Table: import("svelte").Component<
|
|
87
|
+
declare const Table: import("svelte").Component<TableProps<any>, {}, "selectedRows" | "expandedKeys" | "page" | "sortKey" | "sortDirection">;
|
|
47
88
|
type Table = ReturnType<typeof Table>;
|
|
48
89
|
export default Table;
|
package/dist/ui/Tabs.svelte
CHANGED
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
import type { ComboBoxItem } from '../models/ComboBoxItem.js';
|
|
3
3
|
import { onMount } from 'svelte';
|
|
4
4
|
|
|
5
|
-
interface
|
|
5
|
+
export interface TabsProps {
|
|
6
|
+
/** Available tab options */
|
|
6
7
|
tabOptions: ComboBoxItem[];
|
|
8
|
+
/** Currently active tab value (bindable) */
|
|
7
9
|
activeTab?: string;
|
|
10
|
+
/** Use solid background instead of transparent */
|
|
8
11
|
solidBg?: boolean;
|
|
12
|
+
/** Callback when active tab changes */
|
|
9
13
|
onchange?: (newValue: string) => void;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
let { tabOptions, activeTab = $bindable(''), solidBg = false, onchange }:
|
|
16
|
+
let { tabOptions, activeTab = $bindable(''), solidBg = false, onchange }: TabsProps = $props();
|
|
13
17
|
let containerRef: HTMLDivElement;
|
|
14
18
|
let buttonElements = $state<HTMLButtonElement[]>([]);
|
|
15
19
|
let underlineStyle = $state('');
|
|
@@ -80,7 +84,7 @@
|
|
|
80
84
|
.tabs {
|
|
81
85
|
position: relative;
|
|
82
86
|
display: inline-flex;
|
|
83
|
-
border-bottom: 1px solid
|
|
87
|
+
border-bottom: 1px solid #e5e7eb;
|
|
84
88
|
user-select: none;
|
|
85
89
|
}
|
|
86
90
|
|
|
@@ -89,58 +93,58 @@
|
|
|
89
93
|
display: flex;
|
|
90
94
|
align-items: center;
|
|
91
95
|
justify-content: center;
|
|
92
|
-
padding:
|
|
96
|
+
padding: 0.75rem 1.5rem;
|
|
93
97
|
cursor: pointer;
|
|
94
98
|
user-select: none;
|
|
95
99
|
border: none;
|
|
96
100
|
background: transparent;
|
|
97
|
-
font-size:
|
|
98
|
-
font-weight:
|
|
99
|
-
color:
|
|
100
|
-
transition: color
|
|
101
|
+
font-size: 0.875rem;
|
|
102
|
+
font-weight: 500;
|
|
103
|
+
color: #6b7280;
|
|
104
|
+
transition: color 0.2s ease-in-out;
|
|
101
105
|
z-index: 1;
|
|
102
106
|
border-bottom: 2px solid transparent;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
.tab-item:hover {
|
|
106
|
-
color:
|
|
110
|
+
color: #374151;
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
.tab-item.selected {
|
|
110
|
-
color: var(--
|
|
114
|
+
color: var(--ui-primary);
|
|
111
115
|
}
|
|
112
116
|
|
|
113
117
|
.tab-underline {
|
|
114
118
|
position: absolute;
|
|
115
119
|
bottom: -1px;
|
|
116
120
|
height: 2px;
|
|
117
|
-
background-color: var(--
|
|
118
|
-
transition: all
|
|
121
|
+
background-color: var(--ui-primary);
|
|
122
|
+
transition: all 0.2s ease-in-out;
|
|
119
123
|
z-index: 2;
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
.solid {
|
|
123
|
-
background: var(--
|
|
127
|
+
background: var(--paper-body-bg);
|
|
124
128
|
}
|
|
125
129
|
|
|
126
130
|
/* Dark mode styles */
|
|
127
131
|
:global(.dark) .tabs {
|
|
128
|
-
border-bottom-color:
|
|
132
|
+
border-bottom-color: #374151;
|
|
129
133
|
}
|
|
130
134
|
|
|
131
135
|
:global(.dark) .tab-item {
|
|
132
|
-
color:
|
|
136
|
+
color: #9ca3af;
|
|
133
137
|
}
|
|
134
138
|
|
|
135
139
|
:global(.dark) .tab-item:hover {
|
|
136
|
-
color:
|
|
140
|
+
color: #d1d5db;
|
|
137
141
|
}
|
|
138
142
|
|
|
139
143
|
:global(.dark) .tab-item.selected {
|
|
140
|
-
color: var(--
|
|
144
|
+
color: var(--ui-accent);
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
:global(.dark) .tab-underline {
|
|
144
|
-
background-color: var(--
|
|
148
|
+
background-color: var(--ui-accent);
|
|
145
149
|
}
|
|
146
150
|
</style>
|
package/dist/ui/Tabs.svelte.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { ComboBoxItem } from '../models/ComboBoxItem.js';
|
|
2
|
-
interface
|
|
2
|
+
export interface TabsProps {
|
|
3
|
+
/** Available tab options */
|
|
3
4
|
tabOptions: ComboBoxItem[];
|
|
5
|
+
/** Currently active tab value (bindable) */
|
|
4
6
|
activeTab?: string;
|
|
7
|
+
/** Use solid background instead of transparent */
|
|
5
8
|
solidBg?: boolean;
|
|
9
|
+
/** Callback when active tab changes */
|
|
6
10
|
onchange?: (newValue: string) => void;
|
|
7
11
|
}
|
|
8
|
-
declare const Tabs: import("svelte").Component<
|
|
12
|
+
declare const Tabs: import("svelte").Component<TabsProps, {}, "activeTab">;
|
|
9
13
|
type Tabs = ReturnType<typeof Tabs>;
|
|
10
14
|
export default Tabs;
|
|
@@ -3,29 +3,48 @@
|
|
|
3
3
|
|
|
4
4
|
import sunSvg from '../icon/sun.svg?raw';
|
|
5
5
|
import moonSvg from '../icon/moon.svg?raw';
|
|
6
|
+
import sunMoonSvg from '../icon/sun-moon.svg?raw';
|
|
6
7
|
import ActionIcon from './ActionIcon.svelte';
|
|
7
8
|
import type { ButtonVariant } from './ButtonVariant.js';
|
|
8
9
|
|
|
9
|
-
interface
|
|
10
|
+
export interface ThemeSwitcherProps {
|
|
11
|
+
/** Button variant to use in light mode */
|
|
10
12
|
lightVariant?: ButtonVariant;
|
|
13
|
+
/** Button variant to use in dark mode */
|
|
11
14
|
darkVariant?: ButtonVariant;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
|
-
let { lightVariant = 'primary-subtle', darkVariant = '
|
|
17
|
+
let { lightVariant = 'primary-subtle', darkVariant = 'accent-subtle' }: ThemeSwitcherProps = $props();
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const themeCycle = ['light', 'dark', 'system'] as const;
|
|
20
|
+
|
|
21
|
+
const icons = {
|
|
22
|
+
light: sunSvg,
|
|
23
|
+
dark: moonSvg,
|
|
24
|
+
system: sunMoonSvg
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const tooltips = {
|
|
28
|
+
light: 'Light theme',
|
|
29
|
+
dark: 'Dark theme',
|
|
30
|
+
system: 'System theme'
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function cycleTheme() {
|
|
34
|
+
const index = themeCycle.indexOf(themeState.theme);
|
|
35
|
+
setTheme(themeCycle[(index + 1) % themeCycle.length]);
|
|
18
36
|
}
|
|
19
37
|
</script>
|
|
20
38
|
|
|
21
39
|
<div class="theme-switcher">
|
|
22
|
-
{#key themeState.
|
|
40
|
+
{#key themeState.theme}
|
|
23
41
|
<ActionIcon
|
|
24
42
|
variant={themeState.isDarkMode ? darkVariant : lightVariant}
|
|
25
|
-
svg={themeState.
|
|
43
|
+
svg={icons[themeState.theme]}
|
|
26
44
|
class="action-icon"
|
|
27
45
|
size="1.6em"
|
|
28
|
-
onclick={
|
|
46
|
+
onclick={cycleTheme}
|
|
47
|
+
tooltip={tooltips[themeState.theme]}
|
|
29
48
|
/>
|
|
30
49
|
{/key}
|
|
31
50
|
</div>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ButtonVariant } from './ButtonVariant.js';
|
|
2
|
-
interface
|
|
2
|
+
export interface ThemeSwitcherProps {
|
|
3
|
+
/** Button variant to use in light mode */
|
|
3
4
|
lightVariant?: ButtonVariant;
|
|
5
|
+
/** Button variant to use in dark mode */
|
|
4
6
|
darkVariant?: ButtonVariant;
|
|
5
7
|
}
|
|
6
|
-
declare const ThemeSwitcher: import("svelte").Component<
|
|
8
|
+
declare const ThemeSwitcher: import("svelte").Component<ThemeSwitcherProps, {}, "">;
|
|
7
9
|
type ThemeSwitcher = ReturnType<typeof ThemeSwitcher>;
|
|
8
10
|
export default ThemeSwitcher;
|