@placeholderco/placeholder-ui 1.0.11 → 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 +270 -137
- package/dist/form/Autocomplete.svelte.d.ts +58 -10
- package/dist/form/AutocompleteMulti.svelte +385 -227
- package/dist/form/AutocompleteMulti.svelte.d.ts +59 -10
- package/dist/form/Checkbox.svelte +124 -43
- package/dist/form/Checkbox.svelte.d.ts +26 -2
- package/dist/form/Chips.svelte +47 -17
- package/dist/form/Chips.svelte.d.ts +24 -3
- 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 +177 -191
- package/dist/form/DatePicker.svelte.d.ts +17 -2
- package/dist/form/DateRangePicker.svelte +775 -0
- package/dist/form/DateRangePicker.svelte.d.ts +23 -0
- package/dist/form/DateTimePicker.svelte +168 -209
- 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 +71 -29
- package/dist/form/Number.svelte.d.ts +39 -6
- package/dist/form/Radio.svelte +174 -0
- package/dist/form/Radio.svelte.d.ts +21 -0
- package/dist/form/RadioGroup.svelte +52 -138
- package/dist/form/RadioGroup.svelte.d.ts +19 -2
- package/dist/form/SegmentedControl.svelte +103 -57
- package/dist/form/SegmentedControl.svelte.d.ts +12 -2
- package/dist/form/Select.svelte +160 -229
- package/dist/form/Select.svelte.d.ts +35 -6
- package/dist/form/SelectMulti.svelte +166 -277
- package/dist/form/SelectMulti.svelte.d.ts +37 -6
- package/dist/form/Slider.svelte +185 -268
- package/dist/form/Slider.svelte.d.ts +33 -16
- 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 +80 -45
- package/dist/form/TextArea.svelte.d.ts +35 -10
- package/dist/form/Textbox.svelte +80 -47
- package/dist/form/Textbox.svelte.d.ts +41 -8
- 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/cube-send.svg +1 -0
- 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 -145
- package/dist/icon/index.js +166 -146
- package/dist/icon/layout-sidebar-left-collapse.svg +1 -0
- package/dist/icon/layout-sidebar-left-expand.svg +1 -0
- package/dist/icon/logo-placeholder.svg +6 -0
- package/dist/icon/paperclip.svg +1 -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/icon/thumb-down.svg +1 -0
- package/dist/icon/thumb-up.svg +1 -0
- package/dist/index.d.ts +93 -22
- package/dist/index.js +28 -27
- 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 +158 -110
- package/dist/layout/Navbar.svelte.d.ts +26 -12
- 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 +170 -161
- package/dist/ui/Badge.svelte.d.ts +16 -4
- 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 -104
- package/dist/ui/Dialog.svelte.d.ts +21 -2
- 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 +12 -6
- 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 +169 -0
- package/dist/ui/ProgressBar.svelte.d.ts +30 -0
- package/dist/ui/ProgressBarVariant.d.ts +7 -0
- package/dist/ui/ProgressBarVariant.js +1 -0
- 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 +497 -56
- package/dist/ui/Table.svelte.d.ts +64 -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/dist/util/interceptLinkClick.d.ts +13 -0
- package/dist/util/interceptLinkClick.js +33 -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 -252
- package/dist/form/PasswordInput.svelte.d.ts +0 -33
- 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
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import type { ButtonVariant } from '../ui/ButtonVariant.js';
|
|
2
|
+
export interface SidenavItemAction {
|
|
3
|
+
/** SVG icon to display in the action button */
|
|
4
|
+
iconSvg: string;
|
|
5
|
+
/** Accessible label, also shown as a tooltip on hover */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Visual style variant for the action button */
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
/** Click handler; receives the item the action belongs to and the event */
|
|
10
|
+
onclick?: (item: SidenavItem, event: MouseEvent) => void;
|
|
11
|
+
}
|
|
1
12
|
export interface SidenavItem {
|
|
2
13
|
label: string;
|
|
3
14
|
href?: string;
|
|
@@ -5,30 +16,51 @@ export interface SidenavItem {
|
|
|
5
16
|
active?: boolean;
|
|
6
17
|
items?: SidenavItem[];
|
|
7
18
|
onclick?: () => void;
|
|
19
|
+
/** Action buttons shown on the right of the item (e.g. edit, delete) */
|
|
20
|
+
actions?: SidenavItemAction[];
|
|
8
21
|
}
|
|
9
22
|
export interface SidenavSection {
|
|
10
23
|
title?: string;
|
|
11
24
|
items: SidenavItem[];
|
|
12
25
|
}
|
|
13
|
-
import type { Snippet } from
|
|
14
|
-
interface
|
|
26
|
+
import type { Snippet } from 'svelte';
|
|
27
|
+
export interface SidenavProps {
|
|
28
|
+
/** Navigation sections to display */
|
|
15
29
|
sections?: SidenavSection[];
|
|
30
|
+
/** Sections pinned to the bottom of the sidenav */
|
|
16
31
|
bottomSections?: SidenavSection[];
|
|
32
|
+
/** Whether the sidenav is in collapsed (icon-only) mode */
|
|
17
33
|
collapsed?: boolean;
|
|
34
|
+
/** Width of the expanded sidenav */
|
|
18
35
|
width?: string;
|
|
36
|
+
/** Width when collapsed */
|
|
19
37
|
collapsedWidth?: string;
|
|
38
|
+
/** Additional CSS classes */
|
|
20
39
|
class?: string;
|
|
40
|
+
/** Custom header content */
|
|
21
41
|
header?: Snippet;
|
|
42
|
+
/** Custom footer content */
|
|
22
43
|
footer?: Snippet;
|
|
44
|
+
/** Enable search/filter for navigation items */
|
|
23
45
|
searchable?: boolean;
|
|
46
|
+
/** Placeholder text for search input */
|
|
24
47
|
searchPlaceholder?: string;
|
|
48
|
+
/** Callback when a navigation item is clicked */
|
|
25
49
|
onItemClick?: (item: SidenavItem) => void;
|
|
50
|
+
/** When item action buttons are shown: on hover/focus or always visible.
|
|
51
|
+
* Note: in the mobile drawer they are always visible (touch has no hover). */
|
|
52
|
+
actionsVisible?: 'hover' | 'always';
|
|
53
|
+
/** Enable responsive behavior (drawer on mobile) */
|
|
26
54
|
responsive?: boolean;
|
|
55
|
+
/** Breakpoint (px) below which mobile mode activates */
|
|
27
56
|
mobileBreakpoint?: number;
|
|
57
|
+
/** Whether the mobile drawer is open (bindable) */
|
|
28
58
|
mobileOpen?: boolean;
|
|
59
|
+
/** Title shown in mobile drawer header */
|
|
29
60
|
mobileTitle?: string;
|
|
30
|
-
|
|
61
|
+
/** Position of the mobile drawer */
|
|
62
|
+
mobileDrawerPosition?: 'left' | 'right';
|
|
31
63
|
}
|
|
32
|
-
declare const Sidenav: import("svelte").Component<
|
|
64
|
+
declare const Sidenav: import("svelte").Component<SidenavProps, {}, "mobileOpen">;
|
|
33
65
|
type Sidenav = ReturnType<typeof Sidenav>;
|
|
34
66
|
export default Sidenav;
|
|
@@ -17,6 +17,8 @@ export interface ComboBoxItem {
|
|
|
17
17
|
groupName?: string;
|
|
18
18
|
imageSrc?: string;
|
|
19
19
|
description?: string;
|
|
20
|
+
/** Marks a synthetic "add new value" suggestion (see Autocomplete) */
|
|
21
|
+
isAddNew?: boolean;
|
|
20
22
|
}
|
|
21
23
|
export type FetchFunctionType = (() => Promise<NotifyModel<ComboBoxItem[]>>);
|
|
22
24
|
export type SearchFunctionType = ((query: string) => Promise<NotifyModel<ComboBoxItem[]>>);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface Employee {
|
|
2
|
+
upn: string;
|
|
3
|
+
email: string;
|
|
4
|
+
emplid: string;
|
|
5
|
+
username: string;
|
|
6
|
+
firstName: string;
|
|
7
|
+
lastName: string;
|
|
8
|
+
jobTitle: string;
|
|
9
|
+
jobTitleAlt: string;
|
|
10
|
+
group: string;
|
|
11
|
+
departmentCode: string;
|
|
12
|
+
department: string;
|
|
13
|
+
jobCode: number;
|
|
14
|
+
extension: string;
|
|
15
|
+
office: string;
|
|
16
|
+
deskLocation: string;
|
|
17
|
+
phone: string;
|
|
18
|
+
mobile: string;
|
|
19
|
+
supervisorUpn: string;
|
|
20
|
+
secretaryUpns: string[];
|
|
21
|
+
updateAction: string;
|
|
22
|
+
lastUpdated: Date;
|
|
23
|
+
fullName: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const DefaultEmployee: {
|
|
26
|
+
upn: string;
|
|
27
|
+
email: string;
|
|
28
|
+
emplid: string;
|
|
29
|
+
username: string;
|
|
30
|
+
firstName: string;
|
|
31
|
+
lastName: string;
|
|
32
|
+
jobTitle: string;
|
|
33
|
+
jobTitleAlt: string;
|
|
34
|
+
departmentCode: string;
|
|
35
|
+
department: string;
|
|
36
|
+
jobCode: string;
|
|
37
|
+
extension: string;
|
|
38
|
+
office: string;
|
|
39
|
+
deskLocation: string;
|
|
40
|
+
phone: string;
|
|
41
|
+
mobile: string;
|
|
42
|
+
supervisorId: string;
|
|
43
|
+
secretariesCsv: string;
|
|
44
|
+
updateAction: string;
|
|
45
|
+
lastUpdated: Date;
|
|
46
|
+
fullName: string;
|
|
47
|
+
};
|
|
48
|
+
export interface GitEmployee {
|
|
49
|
+
fullName: string;
|
|
50
|
+
emplid: string;
|
|
51
|
+
upn: string;
|
|
52
|
+
jobTitle: string;
|
|
53
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const DefaultEmployee = {
|
|
2
|
+
upn: '',
|
|
3
|
+
email: '',
|
|
4
|
+
emplid: '',
|
|
5
|
+
username: '',
|
|
6
|
+
firstName: '',
|
|
7
|
+
lastName: '',
|
|
8
|
+
jobTitle: '',
|
|
9
|
+
jobTitleAlt: '',
|
|
10
|
+
departmentCode: '',
|
|
11
|
+
department: '',
|
|
12
|
+
jobCode: '',
|
|
13
|
+
extension: '',
|
|
14
|
+
office: '',
|
|
15
|
+
deskLocation: '',
|
|
16
|
+
phone: '',
|
|
17
|
+
mobile: '',
|
|
18
|
+
supervisorId: '',
|
|
19
|
+
secretariesCsv: '',
|
|
20
|
+
updateAction: '',
|
|
21
|
+
lastUpdated: new Date(),
|
|
22
|
+
fullName: ''
|
|
23
|
+
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export interface LinkCollectionItem {
|
|
2
|
-
href
|
|
2
|
+
href?: string;
|
|
3
3
|
leftContent: string;
|
|
4
4
|
rightContent?: string;
|
|
5
5
|
newTab?: boolean;
|
|
6
6
|
leftSvg?: string;
|
|
7
7
|
rightSvg?: string;
|
|
8
|
+
/** Custom click handler. Call event.preventDefault() to override the default href navigation. */
|
|
9
|
+
onclick?: (event: MouseEvent) => void;
|
|
8
10
|
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import type { Component } from
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
2
|
type BaseNavbarItem = {
|
|
3
3
|
alwaysShow?: boolean;
|
|
4
|
-
showInOnly?: undefined |
|
|
4
|
+
showInOnly?: undefined | 'Navbar' | 'Drawer';
|
|
5
5
|
class?: string;
|
|
6
|
+
/** Custom click handler. For link items, call event.preventDefault() to override the default href navigation. */
|
|
7
|
+
onclick?: (event: MouseEvent) => void;
|
|
6
8
|
};
|
|
7
9
|
export type ParentNavbarItem = BaseNavbarItem & {
|
|
8
10
|
label: string;
|
|
9
11
|
iconSvg?: string;
|
|
10
12
|
subItems?: NavbarItem[];
|
|
13
|
+
/** Custom width for the sub-item dropdown panel (any CSS length, e.g. '20rem' or '300px'). Defaults to 12rem. */
|
|
14
|
+
submenuWidth?: string;
|
|
11
15
|
};
|
|
12
16
|
export type LinkNavbarItem = BaseNavbarItem & {
|
|
13
17
|
label: string;
|
package/dist/theme.svelte.d.ts
CHANGED
package/dist/theme.svelte.js
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
|
+
/** True in the browser, false during SSR / prerendering. */
|
|
2
|
+
const browser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1
3
|
// ============================================
|
|
2
4
|
// Theme State
|
|
3
5
|
// ============================================
|
|
4
6
|
// Svelte 5 runes for reactive state
|
|
5
7
|
let theme = $state("system");
|
|
8
|
+
let systemDarkMode = $state(browser && isSystemDarkMode());
|
|
6
9
|
let isDarkMode = $derived.by(() => {
|
|
7
10
|
if (theme === "system")
|
|
8
|
-
return
|
|
11
|
+
return systemDarkMode;
|
|
9
12
|
return theme === "dark";
|
|
10
13
|
});
|
|
11
|
-
// Initialize theme on module load
|
|
12
|
-
if (
|
|
14
|
+
// Initialize theme on module load (browser only - SSR has no localStorage/document)
|
|
15
|
+
if (browser)
|
|
13
16
|
loadTheme();
|
|
17
|
+
// Track OS theme changes so "system" stays in sync (runs once on module load)
|
|
18
|
+
if (browser && window.matchMedia) {
|
|
19
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
|
20
|
+
systemDarkMode = e.matches;
|
|
21
|
+
if (theme === "system")
|
|
22
|
+
applyThemeClass(e.matches ? "dark" : "light");
|
|
23
|
+
});
|
|
14
24
|
}
|
|
15
25
|
// ============================================
|
|
16
26
|
// Viewport / Responsive State
|
|
@@ -45,44 +55,20 @@ if (typeof window !== 'undefined') {
|
|
|
45
55
|
}
|
|
46
56
|
// Export reactive viewport state object
|
|
47
57
|
export const viewportState = {
|
|
48
|
-
get width() {
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
get height() {
|
|
52
|
-
return windowHeight;
|
|
53
|
-
},
|
|
58
|
+
get width() { return windowWidth; },
|
|
59
|
+
get height() { return windowHeight; },
|
|
54
60
|
// Boolean helpers
|
|
55
|
-
get isMobile() {
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
get
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
get
|
|
62
|
-
|
|
63
|
-
},
|
|
64
|
-
get isSmall() {
|
|
65
|
-
return isSmall;
|
|
66
|
-
},
|
|
67
|
-
get isMedium() {
|
|
68
|
-
return isMedium;
|
|
69
|
-
},
|
|
70
|
-
get isLarge() {
|
|
71
|
-
return isLarge;
|
|
72
|
-
},
|
|
73
|
-
get isExtraLarge() {
|
|
74
|
-
return isExtraLarge;
|
|
75
|
-
},
|
|
76
|
-
get isUltrawide() {
|
|
77
|
-
return isUltrawide;
|
|
78
|
-
},
|
|
61
|
+
get isMobile() { return isMobile; },
|
|
62
|
+
get isTablet() { return isTablet; },
|
|
63
|
+
get isDesktop() { return isDesktop; },
|
|
64
|
+
get isSmall() { return isSmall; },
|
|
65
|
+
get isMedium() { return isMedium; },
|
|
66
|
+
get isLarge() { return isLarge; },
|
|
67
|
+
get isExtraLarge() { return isExtraLarge; },
|
|
68
|
+
get isUltrawide() { return isUltrawide; },
|
|
79
69
|
// Utility function for custom breakpoints
|
|
80
|
-
isBelow(breakpoint) {
|
|
81
|
-
|
|
82
|
-
},
|
|
83
|
-
isAbove(breakpoint) {
|
|
84
|
-
return windowWidth >= breakpoint;
|
|
85
|
-
}
|
|
70
|
+
isBelow(breakpoint) { return windowWidth < breakpoint; },
|
|
71
|
+
isAbove(breakpoint) { return windowWidth >= breakpoint; }
|
|
86
72
|
};
|
|
87
73
|
// Export getter for the theme state
|
|
88
74
|
export function getTheme() {
|
|
@@ -93,17 +79,14 @@ export const themeState = {
|
|
|
93
79
|
get theme() {
|
|
94
80
|
return theme;
|
|
95
81
|
},
|
|
96
|
-
get current() {
|
|
97
|
-
return theme;
|
|
98
|
-
},
|
|
99
82
|
get isDarkMode() {
|
|
100
83
|
return isDarkMode;
|
|
101
84
|
}
|
|
102
85
|
};
|
|
103
86
|
export function loadTheme() {
|
|
104
|
-
if (
|
|
87
|
+
if (!browser)
|
|
105
88
|
return;
|
|
106
|
-
const themeString = localStorage.getItem(
|
|
89
|
+
const themeString = localStorage.getItem("theme") || "system";
|
|
107
90
|
if (themeString == 'light')
|
|
108
91
|
setTheme('light');
|
|
109
92
|
else if (themeString == 'dark')
|
|
@@ -112,25 +95,30 @@ export function loadTheme() {
|
|
|
112
95
|
setTheme('system');
|
|
113
96
|
}
|
|
114
97
|
export function setTheme(newTheme) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
let appliedTheme = newTheme;
|
|
120
|
-
if (newTheme === 'system') {
|
|
121
|
-
appliedTheme = isSystemDarkMode() ? 'dark' : 'light';
|
|
122
|
-
}
|
|
123
|
-
if (appliedTheme === 'dark') {
|
|
124
|
-
classList.add('dark');
|
|
98
|
+
let appliedTheme;
|
|
99
|
+
if (newTheme === "system") {
|
|
100
|
+
systemDarkMode = isSystemDarkMode();
|
|
101
|
+
appliedTheme = systemDarkMode ? "dark" : "light";
|
|
125
102
|
}
|
|
126
103
|
else {
|
|
127
|
-
|
|
104
|
+
appliedTheme = newTheme;
|
|
128
105
|
}
|
|
129
106
|
theme = newTheme;
|
|
130
|
-
|
|
107
|
+
// State is updated on the server too, but the DOM and storage only exist in the browser
|
|
108
|
+
if (!browser)
|
|
109
|
+
return;
|
|
110
|
+
applyThemeClass(appliedTheme);
|
|
111
|
+
localStorage.setItem("theme", newTheme);
|
|
112
|
+
}
|
|
113
|
+
function applyThemeClass(appliedTheme) {
|
|
114
|
+
if (!browser)
|
|
115
|
+
return;
|
|
116
|
+
const classList = document.documentElement.classList;
|
|
117
|
+
classList.remove("light", "dark");
|
|
118
|
+
classList.add(appliedTheme);
|
|
131
119
|
}
|
|
132
120
|
function isSystemDarkMode() {
|
|
133
|
-
if (
|
|
121
|
+
if (!browser || !window.matchMedia)
|
|
134
122
|
return false;
|
|
135
|
-
return
|
|
123
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
136
124
|
}
|