@marianmeres/stuic 2.57.0 → 2.59.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/AppShell/AppShell.svelte +2 -2
- package/dist/components/AppShell/AppShell.svelte.d.ts +1 -1
- package/dist/components/AppShell/AppShellSimple.svelte +8 -3
- package/dist/components/AppShell/AppShellSimple.svelte.d.ts +2 -1
- package/dist/components/AppShell/index.d.ts +2 -2
- package/dist/components/AppShell/index.js +2 -2
- package/dist/components/ButtonGroupRadio/ButtonGroupRadio.svelte +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.svelte +11 -11
- package/dist/components/DropdownMenu/DropdownMenu.svelte.d.ts +1 -1
- package/dist/components/KbdShortcut/KbdShortcut.svelte +1 -1
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
elFooter?: HTMLElement;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export const
|
|
41
|
+
export const APP_SHELL_MAIN_WIDTH = Symbol("APP_SHELL_MAIN_WIDTH");
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Helper utility function which sets document.body height to 100vh, and overflow: hidden.
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
// pragmatic use case...
|
|
105
105
|
let mainWidth: number = $state(0);
|
|
106
|
-
setContext(
|
|
106
|
+
setContext(APP_SHELL_MAIN_WIDTH, {
|
|
107
107
|
get current() {
|
|
108
108
|
return mainWidth;
|
|
109
109
|
},
|
|
@@ -33,7 +33,7 @@ export interface Props {
|
|
|
33
33
|
elSidebarRight?: HTMLElement;
|
|
34
34
|
elFooter?: HTMLElement;
|
|
35
35
|
}
|
|
36
|
-
export declare const
|
|
36
|
+
export declare const APP_SHELL_MAIN_WIDTH: unique symbol;
|
|
37
37
|
/**
|
|
38
38
|
* Helper utility function which sets document.body height to 100vh, and overflow: hidden.
|
|
39
39
|
* It also returns a function which unsets the full height. So we can write:
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
railClass?: string;
|
|
10
10
|
asideClass?: string;
|
|
11
11
|
mainClass?: string;
|
|
12
|
+
// header support style as well (for iOS theming, seem to be better supported)
|
|
13
|
+
headerStyle?: string;
|
|
12
14
|
//
|
|
13
15
|
rail?: Snippet;
|
|
14
16
|
header?: Snippet;
|
|
@@ -21,7 +23,7 @@
|
|
|
21
23
|
elMain?: HTMLElement;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
export const
|
|
26
|
+
export const APP_SHELL_SIMPLE_MAIN_WIDTH = Symbol("APP_SHELL_SIMPLE_MAIN_WIDTH");
|
|
25
27
|
</script>
|
|
26
28
|
|
|
27
29
|
<script lang="ts">
|
|
@@ -33,6 +35,8 @@
|
|
|
33
35
|
asideClass,
|
|
34
36
|
mainClass,
|
|
35
37
|
//
|
|
38
|
+
headerStyle = "",
|
|
39
|
+
//
|
|
36
40
|
rail,
|
|
37
41
|
header,
|
|
38
42
|
aside,
|
|
@@ -48,7 +52,7 @@
|
|
|
48
52
|
|
|
49
53
|
// pragmatic use case...
|
|
50
54
|
let mainWidth: number = $state(0);
|
|
51
|
-
setContext(
|
|
55
|
+
setContext(APP_SHELL_SIMPLE_MAIN_WIDTH, {
|
|
52
56
|
get current() {
|
|
53
57
|
return mainWidth;
|
|
54
58
|
},
|
|
@@ -61,6 +65,7 @@
|
|
|
61
65
|
bind:clientHeight={headerHeight}
|
|
62
66
|
data-shell="header"
|
|
63
67
|
class={twMerge("sticky top-0 z-10", headerClass)}
|
|
68
|
+
style={headerStyle}
|
|
64
69
|
>
|
|
65
70
|
{@render header()}
|
|
66
71
|
</header>
|
|
@@ -106,7 +111,7 @@
|
|
|
106
111
|
<main
|
|
107
112
|
bind:this={elMain}
|
|
108
113
|
data-shell="main"
|
|
109
|
-
class={twMerge("flex-1", mainClass)}
|
|
114
|
+
class={twMerge("flex-1 max-w-full", mainClass)}
|
|
110
115
|
bind:offsetWidth={mainWidth}
|
|
111
116
|
>
|
|
112
117
|
{@render children?.()}
|
|
@@ -5,6 +5,7 @@ export interface Props {
|
|
|
5
5
|
railClass?: string;
|
|
6
6
|
asideClass?: string;
|
|
7
7
|
mainClass?: string;
|
|
8
|
+
headerStyle?: string;
|
|
8
9
|
rail?: Snippet;
|
|
9
10
|
header?: Snippet;
|
|
10
11
|
aside?: Snippet;
|
|
@@ -14,7 +15,7 @@ export interface Props {
|
|
|
14
15
|
elAside?: HTMLElement;
|
|
15
16
|
elMain?: HTMLElement;
|
|
16
17
|
}
|
|
17
|
-
export declare const
|
|
18
|
+
export declare const APP_SHELL_SIMPLE_MAIN_WIDTH: unique symbol;
|
|
18
19
|
declare const AppShellSimple: import("svelte").Component<Props, {}, "elRail" | "elHeader" | "elAside" | "elMain">;
|
|
19
20
|
type AppShellSimple = ReturnType<typeof AppShellSimple>;
|
|
20
21
|
export default AppShellSimple;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as AppShell, type Props as AppShellProps, appShellSetHtmlBodyHeight,
|
|
2
|
-
export { default as AppShellSimple, type Props as AppShellSimpleProps,
|
|
1
|
+
export { default as AppShell, type Props as AppShellProps, appShellSetHtmlBodyHeight, APP_SHELL_MAIN_WIDTH, } from "./AppShell.svelte";
|
|
2
|
+
export { default as AppShellSimple, type Props as AppShellSimpleProps, APP_SHELL_SIMPLE_MAIN_WIDTH, } from "./AppShellSimple.svelte";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as AppShell, appShellSetHtmlBodyHeight,
|
|
2
|
-
export { default as AppShellSimple,
|
|
1
|
+
export { default as AppShell, appShellSetHtmlBodyHeight, APP_SHELL_MAIN_WIDTH, } from "./AppShell.svelte";
|
|
2
|
+
export { default as AppShellSimple, APP_SHELL_SIMPLE_MAIN_WIDTH, } from "./AppShellSimple.svelte";
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
border-button-group-border dark:border-button-group-border-dark
|
|
102
102
|
flex justify-between
|
|
103
103
|
|
|
104
|
-
focus-within:border-button-group-accent
|
|
104
|
+
focus-within:border-button-group-accent focus-within:dark:border-button-group-accent-dark
|
|
105
105
|
focus-within:ring-button-group-accent/20 focus-within:dark:ring-button-group-accent-dark/20
|
|
106
106
|
focus-within:ring-4
|
|
107
107
|
`;
|
|
@@ -210,9 +210,9 @@
|
|
|
210
210
|
text-neutral-900 dark:text-neutral-100
|
|
211
211
|
border-neutral-200 dark:border-neutral-700
|
|
212
212
|
hover:brightness-95 dark:hover:brightness-110
|
|
213
|
-
focus-visible:outline-2 focus-visible:outline-offset-2
|
|
214
213
|
cursor-pointer
|
|
215
|
-
|
|
214
|
+
`;
|
|
215
|
+
// focus-visible:outline-2 focus-visible:outline-offset-2
|
|
216
216
|
|
|
217
217
|
export const DROPDOWN_MENU_DROPDOWN_CLASSES = `
|
|
218
218
|
stuic-dropdown-menu-dropdown
|
|
@@ -703,12 +703,12 @@
|
|
|
703
703
|
role="menuitem"
|
|
704
704
|
class={twMerge(
|
|
705
705
|
DROPDOWN_MENU_ITEM_CLASSES,
|
|
706
|
+
classItem,
|
|
707
|
+
item.class,
|
|
706
708
|
isActive && "bg-neutral-200 dark:bg-neutral-600",
|
|
707
709
|
isActive && classItemActive,
|
|
708
710
|
item.disabled && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
709
|
-
item.disabled && classItemDisabled
|
|
710
|
-
classItem,
|
|
711
|
-
item.class
|
|
711
|
+
item.disabled && classItemDisabled
|
|
712
712
|
)}
|
|
713
713
|
onclick={() => selectItem(item)}
|
|
714
714
|
onmouseenter={() => navItems.setActive(item)}
|
|
@@ -761,12 +761,12 @@
|
|
|
761
761
|
class={twMerge(
|
|
762
762
|
DROPDOWN_MENU_ITEM_CLASSES,
|
|
763
763
|
"font-medium",
|
|
764
|
+
classExpandable,
|
|
765
|
+
item.class,
|
|
764
766
|
isExpandableActive && "bg-neutral-200 dark:bg-neutral-600",
|
|
765
767
|
isExpandableActive && classItemActive,
|
|
766
768
|
item.disabled && "opacity-50 cursor-not-allowed pointer-events-none",
|
|
767
|
-
item.disabled && classItemDisabled
|
|
768
|
-
classExpandable,
|
|
769
|
-
item.class
|
|
769
|
+
item.disabled && classItemDisabled
|
|
770
770
|
)}
|
|
771
771
|
onclick={() => toggleExpanded(item.id)}
|
|
772
772
|
onmouseenter={() =>
|
|
@@ -815,13 +815,13 @@
|
|
|
815
815
|
role="menuitem"
|
|
816
816
|
class={twMerge(
|
|
817
817
|
DROPDOWN_MENU_ITEM_CLASSES,
|
|
818
|
+
classItem,
|
|
819
|
+
childItem.class,
|
|
818
820
|
isChildActive && "bg-neutral-200 dark:bg-neutral-600",
|
|
819
821
|
isChildActive && classItemActive,
|
|
820
822
|
childItem.disabled &&
|
|
821
823
|
"opacity-50 cursor-not-allowed pointer-events-none",
|
|
822
|
-
childItem.disabled && classItemDisabled
|
|
823
|
-
classItem,
|
|
824
|
-
childItem.class
|
|
824
|
+
childItem.disabled && classItemDisabled
|
|
825
825
|
)}
|
|
826
826
|
onclick={() => selectItem(childItem)}
|
|
827
827
|
onmouseenter={() => navItems.setActive(childItem)}
|
|
@@ -143,7 +143,7 @@ export interface Props extends Omit<HTMLButtonAttributes, "children"> {
|
|
|
143
143
|
noScrollLock?: boolean;
|
|
144
144
|
}
|
|
145
145
|
export declare const DROPDOWN_MENU_BASE_CLASSES = "stuic-dropdown-menu relative inline-block";
|
|
146
|
-
export declare const DROPDOWN_MENU_TRIGGER_CLASSES = "\n\t\tinline-flex items-center justify-center gap-2\n\t\tpx-3 py-2\n\t\trounded-md border\n\t\tbg-white dark:bg-neutral-800\n\t\ttext-neutral-900 dark:text-neutral-100\n\t\tborder-neutral-200 dark:border-neutral-700\n\t\thover:brightness-95 dark:hover:brightness-110\n\t\
|
|
146
|
+
export declare const DROPDOWN_MENU_TRIGGER_CLASSES = "\n\t\tinline-flex items-center justify-center gap-2\n\t\tpx-3 py-2\n\t\trounded-md border\n\t\tbg-white dark:bg-neutral-800\n\t\ttext-neutral-900 dark:text-neutral-100\n\t\tborder-neutral-200 dark:border-neutral-700\n\t\thover:brightness-95 dark:hover:brightness-110\n\t\tcursor-pointer\n\t\t";
|
|
147
147
|
export declare const DROPDOWN_MENU_DROPDOWN_CLASSES = "\n\t\tstuic-dropdown-menu-dropdown\n\t\tbg-white dark:bg-neutral-800\n\t\ttext-neutral-900 dark:text-neutral-100\n\t\tborder border-neutral-200 dark:border-neutral-700\n\t\trounded-md shadow-sm\n\t\tp-1\n\t\toverflow-y-auto\n\t\tz-50\n\t\tmin-w-48\n\t";
|
|
148
148
|
export declare const DROPDOWN_MENU_ITEM_CLASSES = "\n\t\tw-full\n\t\tflex items-center gap-2\n\t\tpx-3 py-1.5\n\t\tmin-h-[44px]\n\t\ttext-left \n\t\trounded-md\n\t\tcursor-pointer\n\t\ttouch-action-manipulation\n\t\thover:bg-neutral-100 dark:hover:bg-neutral-700\n\t\tfocus:outline-none\n\t\tfocus-visible:bg-neutral-200 dark:focus-visible:bg-neutral-600\n\t";
|
|
149
149
|
export declare const DROPDOWN_MENU_DIVIDER_CLASSES = "\n\t\th-px my-1\n\t\tbg-neutral-200 dark:bg-neutral-700\n\t";
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -35,3 +35,4 @@ export { iconLucideCircle as iconCircle } from "@marianmeres/icons-fns/lucide/ic
|
|
|
35
35
|
export { iconLucideSquare as iconSquare } from "@marianmeres/icons-fns/lucide/iconLucideSquare.js";
|
|
36
36
|
export { iconLucideMenu as iconMenu } from "@marianmeres/icons-fns/lucide/iconLucideMenu.js";
|
|
37
37
|
export { iconLucideUser as iconUser } from "@marianmeres/icons-fns/lucide/iconLucideUser.js";
|
|
38
|
+
export { iconLucideEllipsisVertical as iconEllipsisVertical } from "@marianmeres/icons-fns/lucide/iconLucideEllipsisVertical.js";
|
package/dist/icons/index.js
CHANGED
|
@@ -39,3 +39,4 @@ export { iconLucideCircle as iconCircle } from "@marianmeres/icons-fns/lucide/ic
|
|
|
39
39
|
export { iconLucideSquare as iconSquare } from "@marianmeres/icons-fns/lucide/iconLucideSquare.js";
|
|
40
40
|
export { iconLucideMenu as iconMenu } from "@marianmeres/icons-fns/lucide/iconLucideMenu.js";
|
|
41
41
|
export { iconLucideUser as iconUser } from "@marianmeres/icons-fns/lucide/iconLucideUser.js";
|
|
42
|
+
export { iconLucideEllipsisVertical as iconEllipsisVertical } from "@marianmeres/icons-fns/lucide/iconLucideEllipsisVertical.js";
|