@danielito1996/compose-svelted 0.2.3 → 0.2.6
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/AppRoot.svelte +15 -0
- package/dist/components/AppRoot.svelte.d.ts +30 -0
- package/dist/components/ContentScale.d.ts +10 -0
- package/dist/components/ContentScale.js +9 -0
- package/dist/components/Icon.svelte +47 -0
- package/dist/components/Icon.svelte.d.ts +24 -0
- package/dist/components/Image.svelte +31 -0
- package/dist/components/Image.svelte.d.ts +25 -0
- package/dist/components/Spacer.svelte +11 -0
- package/dist/components/Spacer.svelte.d.ts +24 -0
- package/dist/components/Surface.svelte +19 -0
- package/dist/components/Surface.svelte.d.ts +32 -0
- package/dist/components/Text.svelte +23 -0
- package/dist/components/Text.svelte.d.ts +34 -0
- package/dist/components/TonalButton.svelte +34 -0
- package/dist/components/TonalButton.svelte.d.ts +36 -0
- package/dist/components/buttons/Button.svelte +34 -0
- package/dist/components/buttons/Button.svelte.d.ts +36 -0
- package/dist/components/buttons/ButtonWithIcon.svelte +0 -0
- package/dist/components/buttons/ButtonWithIcon.svelte.d.ts +26 -0
- package/dist/components/buttons/CheckButton.svelte +77 -0
- package/dist/components/buttons/CheckButton.svelte.d.ts +35 -0
- package/dist/components/buttons/IconButton.svelte +0 -0
- package/dist/components/buttons/IconButton.svelte.d.ts +26 -0
- package/dist/components/buttons/OutlinedButton.svelte +0 -0
- package/dist/components/buttons/OutlinedButton.svelte.d.ts +26 -0
- package/dist/components/buttons/OutlinedButtonWithIcon.svelte +0 -0
- package/dist/components/buttons/OutlinedButtonWithIcon.svelte.d.ts +26 -0
- package/dist/components/buttons/OutlinedIconButton.svelte +0 -0
- package/dist/components/buttons/OutlinedIconButton.svelte.d.ts +26 -0
- package/dist/components/buttons/TextButton.svelte +0 -0
- package/dist/components/buttons/TextButton.svelte.d.ts +26 -0
- package/dist/components/cards/Card.svelte +26 -0
- package/dist/components/cards/Card.svelte.d.ts +33 -0
- package/dist/components/cards/OutlinedCard.svelte +0 -0
- package/dist/components/cards/OutlinedCard.svelte.d.ts +26 -0
- package/dist/components/custom/CodeBlock.svelte +41 -0
- package/dist/components/custom/CodeBlock.svelte.d.ts +32 -0
- package/dist/components/layouts/Alignment.d.ts +20 -0
- package/dist/components/layouts/Alignment.js +20 -0
- package/dist/components/layouts/Arrangement.d.ts +23 -0
- package/dist/components/layouts/Arrangement.js +46 -0
- package/dist/components/layouts/Box.svelte +25 -0
- package/dist/components/layouts/Box.svelte.d.ts +32 -0
- package/dist/components/layouts/Column.svelte +23 -0
- package/dist/components/layouts/Column.svelte.d.ts +34 -0
- package/dist/components/layouts/LazyColumn.svelte +107 -0
- package/dist/components/layouts/LazyColumn.svelte.d.ts +39 -0
- package/dist/components/layouts/LazyRow.svelte +71 -0
- package/dist/components/layouts/LazyRow.svelte.d.ts +42 -0
- package/dist/components/layouts/Row.svelte +23 -0
- package/dist/components/layouts/Row.svelte.d.ts +34 -0
- package/dist/components/layouts/Scaffold.svelte +73 -0
- package/dist/components/layouts/Scaffold.svelte.d.ts +38 -0
- package/dist/components/menus/DropdownMenu.svelte +0 -0
- package/dist/components/menus/DropdownMenu.svelte.d.ts +26 -0
- package/dist/components/menus/DropdownMenuItem.svelte +0 -0
- package/dist/components/menus/DropdownMenuItem.svelte.d.ts +26 -0
- package/dist/components/motion/AnimatedContent.svelte +34 -0
- package/dist/components/motion/AnimatedContent.svelte.d.ts +31 -0
- package/dist/components/motion/AnimatedVisibility.svelte +59 -0
- package/dist/components/motion/AnimatedVisibility.svelte.d.ts +32 -0
- package/dist/components/textFields/BaseTextField.svelte +188 -0
- package/dist/components/textFields/BaseTextField.svelte.d.ts +41 -0
- package/dist/components/textFields/OutlinedTextField.svelte +64 -0
- package/dist/components/textFields/OutlinedTextField.svelte.d.ts +46 -0
- package/dist/components/textFields/TextField.svelte +49 -0
- package/dist/components/textFields/TextField.svelte.d.ts +46 -0
- package/dist/components/textFields/TextFieldColors.d.ts +12 -0
- package/dist/components/textFields/TextFieldColors.js +1 -0
- package/dist/components/textFields/TextFieldDefaults.d.ts +11 -0
- package/dist/components/textFields/TextFieldDefaults.js +42 -0
- package/dist/core/elevation/elevation.d.ts +1 -0
- package/dist/core/elevation/elevation.js +6 -0
- package/dist/core/helpers/painterResource.d.ts +12 -0
- package/dist/core/helpers/painterResource.js +22 -0
- package/dist/core/modifier/Modifier.d.ts +195 -0
- package/dist/core/modifier/Modifier.js +237 -0
- package/dist/core/modifier/ModifierImpl.d.ts +38 -0
- package/dist/core/modifier/ModifierImpl.js +214 -0
- package/dist/core/motion/AnimationSpec.d.ts +6 -0
- package/dist/core/motion/AnimationSpec.js +1 -0
- package/dist/core/motion/ContentTransition.d.ts +5 -0
- package/dist/core/motion/ContentTransition.js +1 -0
- package/dist/core/motion/applyAnimation.d.ts +0 -0
- package/dist/core/motion/applyAnimation.js +0 -0
- package/dist/core/motion/contentTransitions.d.ts +4 -0
- package/dist/core/motion/contentTransitions.js +22 -0
- package/dist/core/motion/transitions.d.ts +7 -0
- package/dist/core/motion/transitions.js +70 -0
- package/dist/core/navigation/NavBackStackEntry.d.ts +4 -0
- package/dist/core/navigation/NavBackStackEntry.js +1 -0
- package/dist/core/navigation/NavController.d.ts +9 -0
- package/dist/core/navigation/NavController.js +31 -0
- package/dist/core/navigation/NavHost.svelte +45 -0
- package/dist/core/navigation/NavHost.svelte.d.ts +31 -0
- package/dist/core/navigation/NavStore.d.ts +7 -0
- package/dist/core/navigation/NavStore.js +24 -0
- package/dist/core/navigation/Route.d.ts +3 -0
- package/dist/core/navigation/Route.js +1 -0
- package/dist/core/navigation/composable.d.ts +5 -0
- package/dist/core/navigation/composable.js +6 -0
- package/dist/core/navigation/rememberNavController.d.ts +2 -0
- package/dist/core/navigation/rememberNavController.js +4 -0
- package/dist/core/shapes/RoundedCornerShape.d.ts +13 -0
- package/dist/core/shapes/RoundedCornerShape.js +27 -0
- package/dist/core/shapes/Shape.d.ts +3 -0
- package/dist/core/shapes/Shape.js +1 -0
- package/dist/core/theme/ColorScheme.d.ts +17 -0
- package/dist/core/theme/ColorScheme.js +15 -0
- package/dist/core/theme/ComposeTheme.svelte +22 -0
- package/dist/core/theme/ComposeTheme.svelte.d.ts +32 -0
- package/dist/core/theme/Density.d.ts +5 -0
- package/dist/core/theme/Density.js +4 -0
- package/dist/core/theme/TextStyle.d.ts +19 -0
- package/dist/core/theme/TextStyle.js +17 -0
- package/dist/core/theme/colors.d.ts +15 -0
- package/dist/core/theme/colors.js +1 -0
- package/dist/core/theme/cssVars.d.ts +2 -0
- package/dist/core/theme/cssVars.js +29 -0
- package/dist/core/theme/defaults/darkColors.d.ts +2 -0
- package/dist/core/theme/defaults/darkColors.js +15 -0
- package/dist/core/theme/defaults/defaultTheme.d.ts +3 -0
- package/dist/core/theme/defaults/defaultTheme.js +40 -0
- package/dist/core/theme/defaults/lightColors.d.ts +2 -0
- package/dist/core/theme/defaults/lightColors.js +15 -0
- package/dist/core/theme/defaults/typography.d.ts +2 -0
- package/dist/core/theme/defaults/typography.js +120 -0
- package/dist/core/theme/elevation.d.ts +7 -0
- package/dist/core/theme/elevation.js +1 -0
- package/dist/core/theme/getCurrentColor.d.ts +1 -0
- package/dist/core/theme/getCurrentColor.js +9 -0
- package/dist/core/theme/resolve.d.ts +5 -0
- package/dist/core/theme/resolve.js +17 -0
- package/dist/core/theme/shapes.d.ts +7 -0
- package/dist/core/theme/shapes.js +1 -0
- package/dist/core/theme/spacing.d.ts +7 -0
- package/dist/core/theme/spacing.js +1 -0
- package/dist/core/theme/store.d.ts +7 -0
- package/dist/core/theme/store.js +15 -0
- package/dist/core/theme/systemTheme.d.ts +2 -0
- package/dist/core/theme/systemTheme.js +14 -0
- package/dist/core/theme/theme.d.ts +13 -0
- package/dist/core/theme/theme.js +1 -0
- package/dist/core/theme/typography.d.ts +24 -0
- package/dist/core/theme/typography.js +1 -0
- package/dist/index.d.ts +22 -45
- package/package.json +46 -11
- package/dist/index.js +0 -1164
- package/dist/vite.svg +0 -1
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default OutlinedButton;
|
|
2
|
+
type OutlinedButton = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const OutlinedButton: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default OutlinedButtonWithIcon;
|
|
2
|
+
type OutlinedButtonWithIcon = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const OutlinedButtonWithIcon: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default OutlinedIconButton;
|
|
2
|
+
type OutlinedIconButton = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const OutlinedIconButton: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default TextButton;
|
|
2
|
+
type TextButton = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const TextButton: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Surface from "../Surface.svelte";
|
|
3
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
4
|
+
import type { Shape } from "../../core/shapes/Shape";
|
|
5
|
+
import { RoundedCornerShape } from "../../core/shapes/RoundedCornerShape";
|
|
6
|
+
|
|
7
|
+
export let elevation: number | string = 1;
|
|
8
|
+
export let shape: Shape = RoundedCornerShape(16);
|
|
9
|
+
export let modifier: Modifier = Modifier.empty();
|
|
10
|
+
|
|
11
|
+
function elevationToShadow(value: number | string): string {
|
|
12
|
+
if (!value || value === 0) return "none";
|
|
13
|
+
const v = typeof value === "number" ? `${value}px` : value;
|
|
14
|
+
return `0 ${v} calc(${v} * 3) rgba(0,0,0,0.16)`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$: shadow = elevationToShadow(elevation);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<Surface
|
|
21
|
+
modifier={modifier}
|
|
22
|
+
>
|
|
23
|
+
<div style={`box-shadow: ${shadow}; border-radius: ${shape.toCssBorderRadius()};`}>
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</Surface>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
2
|
+
import type { Shape } from "../../core/shapes/Shape";
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
17
|
+
default: any;
|
|
18
|
+
} ? Props extends Record<string, never> ? any : {
|
|
19
|
+
children?: any;
|
|
20
|
+
} : {});
|
|
21
|
+
declare const Card: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
22
|
+
elevation?: number | string;
|
|
23
|
+
shape?: Shape;
|
|
24
|
+
modifier?: Modifier;
|
|
25
|
+
}, {
|
|
26
|
+
default: {};
|
|
27
|
+
}>, {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
}, {
|
|
30
|
+
default: {};
|
|
31
|
+
}, {}, string>;
|
|
32
|
+
type Card = InstanceType<typeof Card>;
|
|
33
|
+
export default Card;
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default OutlinedCard;
|
|
2
|
+
type OutlinedCard = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const OutlinedCard: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
3
|
+
import { ColorScheme } from "../../core/theme/ColorScheme";
|
|
4
|
+
|
|
5
|
+
export let language: string | undefined = undefined;
|
|
6
|
+
export let modifier: Modifier = Modifier.empty();
|
|
7
|
+
|
|
8
|
+
// Si false → scroll horizontal
|
|
9
|
+
export let wrap: boolean = false;
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
style={modifier.toStyle()}
|
|
14
|
+
class="relative"
|
|
15
|
+
>
|
|
16
|
+
{#if language}
|
|
17
|
+
<div
|
|
18
|
+
class="absolute top-2 right-3 text-xs opacity-60 select-none"
|
|
19
|
+
style="color: var(--md-sys-color-onSurfaceVariant)"
|
|
20
|
+
>
|
|
21
|
+
{language}
|
|
22
|
+
</div>
|
|
23
|
+
{/if}
|
|
24
|
+
|
|
25
|
+
<pre
|
|
26
|
+
class={`inline-block max-w-full rounded-xl overflow-x-auto ${
|
|
27
|
+
wrap ? "whitespace-pre-wrap" : "whitespace-pre"
|
|
28
|
+
}`}
|
|
29
|
+
style={`
|
|
30
|
+
margin: 2;
|
|
31
|
+
background: var(--md-sys-color-surfaceVariant);
|
|
32
|
+
color: var(--md-sys-color-onSurface);
|
|
33
|
+
padding: 12px 16px;
|
|
34
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
35
|
+
font-size: 0.85rem;
|
|
36
|
+
line-height: 1.35;
|
|
37
|
+
`}
|
|
38
|
+
>
|
|
39
|
+
<code><slot /></code>
|
|
40
|
+
</pre>
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
16
|
+
default: any;
|
|
17
|
+
} ? Props extends Record<string, never> ? any : {
|
|
18
|
+
children?: any;
|
|
19
|
+
} : {});
|
|
20
|
+
declare const CodeBlock: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
21
|
+
language?: string | undefined;
|
|
22
|
+
modifier?: Modifier;
|
|
23
|
+
wrap?: boolean;
|
|
24
|
+
}, {
|
|
25
|
+
default: {};
|
|
26
|
+
}>, {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
}, {
|
|
29
|
+
default: {};
|
|
30
|
+
}, {}, string>;
|
|
31
|
+
type CodeBlock = InstanceType<typeof CodeBlock>;
|
|
32
|
+
export default CodeBlock;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const Alignment: {
|
|
2
|
+
readonly Start: "flex-start";
|
|
3
|
+
readonly CenterHorizontally: "center";
|
|
4
|
+
readonly End: "flex-end";
|
|
5
|
+
readonly Top: "flex-start";
|
|
6
|
+
readonly CenterVertically: "center";
|
|
7
|
+
readonly Bottom: "flex-end";
|
|
8
|
+
readonly TopStart: "flex-start flex-start";
|
|
9
|
+
readonly TopCenter: "center flex-start";
|
|
10
|
+
readonly TopEnd: "flex-end flex-start";
|
|
11
|
+
readonly CenterStart: "flex-start center";
|
|
12
|
+
readonly Center: "center center";
|
|
13
|
+
readonly CenterEnd: "flex-end center";
|
|
14
|
+
readonly BottomStart: "flex-start flex-end";
|
|
15
|
+
readonly BottomCenter: "center flex-end";
|
|
16
|
+
readonly BottomEnd: "flex-end flex-end";
|
|
17
|
+
};
|
|
18
|
+
export type HorizontalAlignment = typeof Alignment.Start | typeof Alignment.CenterHorizontally | typeof Alignment.End;
|
|
19
|
+
export type VerticalAlignment = typeof Alignment.Top | typeof Alignment.CenterVertically | typeof Alignment.Bottom;
|
|
20
|
+
export type BoxAlignment = typeof Alignment[keyof typeof Alignment];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export var Alignment = {
|
|
2
|
+
// Horizontal only (para Column)
|
|
3
|
+
Start: "flex-start",
|
|
4
|
+
CenterHorizontally: "center",
|
|
5
|
+
End: "flex-end",
|
|
6
|
+
// Vertical only (para Row)
|
|
7
|
+
Top: "flex-start",
|
|
8
|
+
CenterVertically: "center",
|
|
9
|
+
Bottom: "flex-end",
|
|
10
|
+
// Compuestos (para Box y layouts avanzados)
|
|
11
|
+
TopStart: "flex-start flex-start",
|
|
12
|
+
TopCenter: "center flex-start",
|
|
13
|
+
TopEnd: "flex-end flex-start",
|
|
14
|
+
CenterStart: "flex-start center",
|
|
15
|
+
Center: "center center",
|
|
16
|
+
CenterEnd: "flex-end center",
|
|
17
|
+
BottomStart: "flex-start flex-end",
|
|
18
|
+
BottomCenter: "center flex-end",
|
|
19
|
+
BottomEnd: "flex-end flex-end",
|
|
20
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arrangement — eje principal (main axis)
|
|
3
|
+
* Fiel a Jetpack Compose
|
|
4
|
+
*/
|
|
5
|
+
export type ArrangementValue = {
|
|
6
|
+
type: "static";
|
|
7
|
+
justifyContent: string;
|
|
8
|
+
} | {
|
|
9
|
+
type: "spaced";
|
|
10
|
+
gap: number;
|
|
11
|
+
justifyContent: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const Arrangement: {
|
|
14
|
+
readonly Start: ArrangementValue;
|
|
15
|
+
readonly Center: ArrangementValue;
|
|
16
|
+
readonly End: ArrangementValue;
|
|
17
|
+
readonly Bottom: ArrangementValue;
|
|
18
|
+
readonly Top: ArrangementValue;
|
|
19
|
+
readonly SpaceBetween: ArrangementValue;
|
|
20
|
+
readonly SpaceAround: ArrangementValue;
|
|
21
|
+
readonly SpaceEvenly: ArrangementValue;
|
|
22
|
+
readonly spacedBy: (value: number) => ArrangementValue;
|
|
23
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arrangement — eje principal (main axis)
|
|
3
|
+
* Fiel a Jetpack Compose
|
|
4
|
+
*/
|
|
5
|
+
export var Arrangement = {
|
|
6
|
+
// --- simples ---
|
|
7
|
+
Start: {
|
|
8
|
+
type: "static",
|
|
9
|
+
justifyContent: "flex-start",
|
|
10
|
+
},
|
|
11
|
+
Center: {
|
|
12
|
+
type: "static",
|
|
13
|
+
justifyContent: "center",
|
|
14
|
+
},
|
|
15
|
+
End: {
|
|
16
|
+
type: "static",
|
|
17
|
+
justifyContent: "flex-end",
|
|
18
|
+
},
|
|
19
|
+
Bottom: {
|
|
20
|
+
type: "static",
|
|
21
|
+
justifyContent: "flex-end"
|
|
22
|
+
},
|
|
23
|
+
Top: {
|
|
24
|
+
type: "static",
|
|
25
|
+
justifyContent: "flex-start"
|
|
26
|
+
},
|
|
27
|
+
SpaceBetween: {
|
|
28
|
+
type: "static",
|
|
29
|
+
justifyContent: "space-between",
|
|
30
|
+
},
|
|
31
|
+
SpaceAround: {
|
|
32
|
+
type: "static",
|
|
33
|
+
justifyContent: "space-around",
|
|
34
|
+
},
|
|
35
|
+
SpaceEvenly: {
|
|
36
|
+
type: "static",
|
|
37
|
+
justifyContent: "space-evenly",
|
|
38
|
+
},
|
|
39
|
+
spacedBy: function (value) {
|
|
40
|
+
return {
|
|
41
|
+
type: "spaced",
|
|
42
|
+
gap: value,
|
|
43
|
+
justifyContent: "flex-start",
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
3
|
+
import type {BoxAlignment} from "./Alignment";
|
|
4
|
+
|
|
5
|
+
export let modifier: Modifier = Modifier.empty();
|
|
6
|
+
export let contentAlignment: BoxAlignment | undefined = undefined;
|
|
7
|
+
|
|
8
|
+
$: contentStyle = contentAlignment ? alignmentToFlexStyle(contentAlignment) : "";
|
|
9
|
+
|
|
10
|
+
function alignmentToFlexStyle(alignment: BoxAlignment): string {
|
|
11
|
+
const parts = alignment.split(" ");
|
|
12
|
+
const horiz = parts[0] === "flex-start" ? "flex-start" : parts[0] === "flex-end" ? "flex-end" : "center";
|
|
13
|
+
const vert = parts[1] || parts[0];
|
|
14
|
+
const v = vert === "flex-start" ? "flex-start" : vert === "flex-end" ? "flex-end" : "center";
|
|
15
|
+
|
|
16
|
+
return `display:flex; align-items:${v}; justify-content:${horiz};`;
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<div
|
|
21
|
+
class="relative"
|
|
22
|
+
style={`${contentStyle} ${modifier.toStyle()}`}
|
|
23
|
+
>
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
2
|
+
import type { BoxAlignment } from "./Alignment";
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
17
|
+
default: any;
|
|
18
|
+
} ? Props extends Record<string, never> ? any : {
|
|
19
|
+
children?: any;
|
|
20
|
+
} : {});
|
|
21
|
+
declare const Box: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
22
|
+
modifier?: Modifier;
|
|
23
|
+
contentAlignment?: BoxAlignment | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
default: {};
|
|
26
|
+
}>, {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
}, {
|
|
29
|
+
default: {};
|
|
30
|
+
}, {}, string>;
|
|
31
|
+
type Box = InstanceType<typeof Box>;
|
|
32
|
+
export default Box;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
3
|
+
import { Alignment } from "./Alignment";
|
|
4
|
+
import { Arrangement } from "./Arrangement";
|
|
5
|
+
import type { ArrangementValue } from "./Arrangement";
|
|
6
|
+
import type { HorizontalAlignment } from "./Alignment";
|
|
7
|
+
|
|
8
|
+
export let modifier: Modifier = Modifier.empty();
|
|
9
|
+
export let horizontalAlignment: HorizontalAlignment = Alignment.Start;
|
|
10
|
+
export let verticalArrangement: ArrangementValue = Arrangement.Start;
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
class="flex flex-col"
|
|
15
|
+
style={`
|
|
16
|
+
align-items: ${horizontalAlignment};
|
|
17
|
+
justify-content: ${verticalArrangement.justifyContent};
|
|
18
|
+
${verticalArrangement.type === "spaced" ? `gap:${verticalArrangement.gap}px;` : ""}
|
|
19
|
+
${modifier.toStyle()}
|
|
20
|
+
`}
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
2
|
+
import type { ArrangementValue } from "./Arrangement";
|
|
3
|
+
import type { HorizontalAlignment } from "./Alignment";
|
|
4
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
5
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
|
+
$$bindings?: Bindings;
|
|
7
|
+
} & Exports;
|
|
8
|
+
(internal: unknown, props: Props & {
|
|
9
|
+
$$events?: Events;
|
|
10
|
+
$$slots?: Slots;
|
|
11
|
+
}): Exports & {
|
|
12
|
+
$set?: any;
|
|
13
|
+
$on?: any;
|
|
14
|
+
};
|
|
15
|
+
z_$$bindings?: Bindings;
|
|
16
|
+
}
|
|
17
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
18
|
+
default: any;
|
|
19
|
+
} ? Props extends Record<string, never> ? any : {
|
|
20
|
+
children?: any;
|
|
21
|
+
} : {});
|
|
22
|
+
declare const Column: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
23
|
+
modifier?: Modifier;
|
|
24
|
+
horizontalAlignment?: HorizontalAlignment;
|
|
25
|
+
verticalArrangement?: ArrangementValue;
|
|
26
|
+
}, {
|
|
27
|
+
default: {};
|
|
28
|
+
}>, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {
|
|
31
|
+
default: {};
|
|
32
|
+
}, {}, string>;
|
|
33
|
+
type Column = InstanceType<typeof Column>;
|
|
34
|
+
export default Column;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
3
|
+
import { onMount, tick } from "svelte";
|
|
4
|
+
import { Alignment } from "./Alignment";
|
|
5
|
+
import { Arrangement } from "./Arrangement";
|
|
6
|
+
import type { ArrangementValue } from "./Arrangement";
|
|
7
|
+
import type { HorizontalAlignment } from "./Alignment";
|
|
8
|
+
|
|
9
|
+
export let items: any[] = [];
|
|
10
|
+
export let modifier: Modifier = Modifier.empty();
|
|
11
|
+
|
|
12
|
+
export let horizontalAlignment: HorizontalAlignment = Alignment.Start;
|
|
13
|
+
export let verticalArrangement: ArrangementValue = Arrangement.Start;
|
|
14
|
+
|
|
15
|
+
let container: HTMLDivElement;
|
|
16
|
+
let probeItem: HTMLDivElement | null = null;
|
|
17
|
+
|
|
18
|
+
let scrollTop = 0;
|
|
19
|
+
let viewportHeight = 0;
|
|
20
|
+
|
|
21
|
+
let estimatedItemHeight = 56; // fallback Material
|
|
22
|
+
let measured = false;
|
|
23
|
+
|
|
24
|
+
const overscan = 3;
|
|
25
|
+
|
|
26
|
+
onMount(() => {
|
|
27
|
+
viewportHeight = container.clientHeight;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
async function measure() {
|
|
31
|
+
await tick();
|
|
32
|
+
if (probeItem) {
|
|
33
|
+
estimatedItemHeight = probeItem.offsetHeight;
|
|
34
|
+
measured = true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
$: if (probeItem && !measured) {
|
|
39
|
+
measure();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function onScroll(e: Event) {
|
|
43
|
+
scrollTop = (e.target as HTMLDivElement).scrollTop;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// --- Virtualization math ---
|
|
47
|
+
$: totalHeight = items.length * estimatedItemHeight;
|
|
48
|
+
|
|
49
|
+
$: startIndex = Math.max(
|
|
50
|
+
0,
|
|
51
|
+
Math.floor(scrollTop / estimatedItemHeight) - overscan
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
$: visibleCount =
|
|
55
|
+
Math.ceil(viewportHeight / estimatedItemHeight) + overscan * 2;
|
|
56
|
+
|
|
57
|
+
$: endIndex = Math.min(items.length, startIndex + visibleCount);
|
|
58
|
+
|
|
59
|
+
$: visibleItems = items.slice(startIndex, endIndex);
|
|
60
|
+
|
|
61
|
+
// --- Arrangement ---
|
|
62
|
+
function resolveGap(arrangement: ArrangementValue): string {
|
|
63
|
+
return arrangement.type === "spaced"
|
|
64
|
+
? `${arrangement.gap}px`
|
|
65
|
+
: "0px";
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<div
|
|
70
|
+
bind:this={container}
|
|
71
|
+
on:scroll={onScroll}
|
|
72
|
+
style={`
|
|
73
|
+
overflow-y:auto;
|
|
74
|
+
position:relative;
|
|
75
|
+
${modifier.toStyle()}
|
|
76
|
+
`}
|
|
77
|
+
>
|
|
78
|
+
<!-- Total scroll space -->
|
|
79
|
+
<div style={`height:${totalHeight}px; position:relative;`}>
|
|
80
|
+
<!-- Visible window -->
|
|
81
|
+
<div
|
|
82
|
+
style={`
|
|
83
|
+
position:absolute;
|
|
84
|
+
top:${startIndex * estimatedItemHeight}px;
|
|
85
|
+
left:0;
|
|
86
|
+
right:0;
|
|
87
|
+
|
|
88
|
+
display:flex;
|
|
89
|
+
flex-direction:column;
|
|
90
|
+
align-items:${horizontalAlignment};
|
|
91
|
+
gap:${resolveGap(verticalArrangement)};
|
|
92
|
+
`}
|
|
93
|
+
>
|
|
94
|
+
{#each visibleItems as item, i}
|
|
95
|
+
{#if i === 0 && !measured}
|
|
96
|
+
<div bind:this={probeItem}>
|
|
97
|
+
<slot {item} />
|
|
98
|
+
</div>
|
|
99
|
+
{:else}
|
|
100
|
+
<div>
|
|
101
|
+
<slot {item} />
|
|
102
|
+
</div>
|
|
103
|
+
{/if}
|
|
104
|
+
{/each}
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Modifier } from "../../core/modifier/Modifier";
|
|
2
|
+
import type { ArrangementValue } from "./Arrangement";
|
|
3
|
+
import type { HorizontalAlignment } from "./Alignment";
|
|
4
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
5
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
6
|
+
$$bindings?: Bindings;
|
|
7
|
+
} & Exports;
|
|
8
|
+
(internal: unknown, props: Props & {
|
|
9
|
+
$$events?: Events;
|
|
10
|
+
$$slots?: Slots;
|
|
11
|
+
}): Exports & {
|
|
12
|
+
$set?: any;
|
|
13
|
+
$on?: any;
|
|
14
|
+
};
|
|
15
|
+
z_$$bindings?: Bindings;
|
|
16
|
+
}
|
|
17
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
18
|
+
default: any;
|
|
19
|
+
} ? Props extends Record<string, never> ? any : {
|
|
20
|
+
children?: any;
|
|
21
|
+
} : {});
|
|
22
|
+
declare const LazyColumn: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
23
|
+
items?: any[];
|
|
24
|
+
modifier?: Modifier;
|
|
25
|
+
horizontalAlignment?: HorizontalAlignment;
|
|
26
|
+
verticalArrangement?: ArrangementValue;
|
|
27
|
+
}, {
|
|
28
|
+
default: {
|
|
29
|
+
item: any;
|
|
30
|
+
};
|
|
31
|
+
}>, {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
}, {
|
|
34
|
+
default: {
|
|
35
|
+
item: any;
|
|
36
|
+
};
|
|
37
|
+
}, {}, string>;
|
|
38
|
+
type LazyColumn = InstanceType<typeof LazyColumn>;
|
|
39
|
+
export default LazyColumn;
|