@lumen-design/container 0.0.2

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.
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+
4
+ interface AsideProps {
5
+ width?: string
6
+ children?: Snippet
7
+ class?: string
8
+ }
9
+
10
+ let { width, children, class: cls = '', ...attrs }: AsideProps = $props()
11
+
12
+ const classes = $derived(cls ? `lm-aside ${cls}` : 'lm-aside')
13
+ const style = $derived(width ? `width: ${width}` : '')
14
+ </script>
15
+
16
+ <aside {...attrs} class={classes} {style}>
17
+ {#if children}
18
+ {@render children()}
19
+ {/if}
20
+ </aside>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface AsideProps {
3
+ width?: string;
4
+ children?: Snippet;
5
+ class?: string;
6
+ }
7
+ declare const Aside: import("svelte").Component<AsideProps, {}, "">;
8
+ type Aside = ReturnType<typeof Aside>;
9
+ export default Aside;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+
4
+ interface ContainerProps {
5
+ direction?: 'horizontal' | 'vertical'
6
+ children?: Snippet
7
+ class?: string
8
+ }
9
+
10
+ let { direction = 'vertical', children, class: cls = '', ...attrs }: ContainerProps = $props()
11
+
12
+ const classes = $derived(`lm-container${direction === 'horizontal' ? ' is-horizontal' : ''}${cls ? ` ${cls}` : ''}`)
13
+ </script>
14
+
15
+ <div {...attrs} class={classes}>
16
+ {#if children}
17
+ {@render children()}
18
+ {/if}
19
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface ContainerProps {
3
+ direction?: 'horizontal' | 'vertical';
4
+ children?: Snippet;
5
+ class?: string;
6
+ }
7
+ declare const Container: import("svelte").Component<ContainerProps, {}, "">;
8
+ type Container = ReturnType<typeof Container>;
9
+ export default Container;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+
4
+ interface FooterProps {
5
+ height?: string
6
+ children?: Snippet
7
+ class?: string
8
+ }
9
+
10
+ let { height, children, class: cls = '', ...attrs }: FooterProps = $props()
11
+
12
+ const classes = $derived(cls ? `lm-footer ${cls}` : 'lm-footer')
13
+ const style = $derived(height ? `height: ${height}` : '')
14
+ </script>
15
+
16
+ <footer {...attrs} class={classes} {style}>
17
+ {#if children}
18
+ {@render children()}
19
+ {/if}
20
+ </footer>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface FooterProps {
3
+ height?: string;
4
+ children?: Snippet;
5
+ class?: string;
6
+ }
7
+ declare const Footer: import("svelte").Component<FooterProps, {}, "">;
8
+ type Footer = ReturnType<typeof Footer>;
9
+ export default Footer;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+
4
+ interface HeaderProps {
5
+ height?: string
6
+ children?: Snippet
7
+ class?: string
8
+ }
9
+
10
+ let { height, children, class: cls = '', ...attrs }: HeaderProps = $props()
11
+
12
+ const classes = $derived(cls ? `lm-header ${cls}` : 'lm-header')
13
+ const style = $derived(height ? `height: ${height}` : '')
14
+ </script>
15
+
16
+ <header {...attrs} class={classes} {style}>
17
+ {#if children}
18
+ {@render children()}
19
+ {/if}
20
+ </header>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface HeaderProps {
3
+ height?: string;
4
+ children?: Snippet;
5
+ class?: string;
6
+ }
7
+ declare const Header: import("svelte").Component<HeaderProps, {}, "">;
8
+ type Header = ReturnType<typeof Header>;
9
+ export default Header;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte'
3
+
4
+ interface MainProps {
5
+ children?: Snippet
6
+ class?: string
7
+ }
8
+
9
+ let { children, class: cls = '', ...attrs }: MainProps = $props()
10
+
11
+ const classes = $derived(cls ? `lm-main ${cls}` : 'lm-main')
12
+ </script>
13
+
14
+ <main {...attrs} class={classes}>
15
+ {#if children}
16
+ {@render children()}
17
+ {/if}
18
+ </main>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface MainProps {
3
+ children?: Snippet;
4
+ class?: string;
5
+ }
6
+ declare const Main: import("svelte").Component<MainProps, {}, "">;
7
+ type Main = ReturnType<typeof Main>;
8
+ export default Main;
@@ -0,0 +1,6 @@
1
+ export { default as Container } from './Container.svelte';
2
+ export { default as Header } from './Header.svelte';
3
+ export { default as Footer } from './Footer.svelte';
4
+ export { default as Aside } from './Aside.svelte';
5
+ export { default as Main } from './Main.svelte';
6
+ export type { ContainerProps, ContainerDirection, HeaderProps, FooterProps, AsideProps, MainProps } from './types';
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { default as Container } from './Container.svelte';
2
+ export { default as Header } from './Header.svelte';
3
+ export { default as Footer } from './Footer.svelte';
4
+ export { default as Aside } from './Aside.svelte';
5
+ export { default as Main } from './Main.svelte';
@@ -0,0 +1,46 @@
1
+ import type { Snippet } from 'svelte';
2
+ /** Container 方向 */
3
+ export type ContainerDirection = 'horizontal' | 'vertical';
4
+ /** Container 属性 */
5
+ export interface ContainerProps {
6
+ /** 方向 */
7
+ direction?: ContainerDirection;
8
+ /** 子内容 */
9
+ children?: Snippet;
10
+ /** 自定义类名 */
11
+ class?: string;
12
+ }
13
+ /** Header 属性 */
14
+ export interface HeaderProps {
15
+ /** 高度 */
16
+ height?: string;
17
+ /** 子内容 */
18
+ children?: Snippet;
19
+ /** 自定义类名 */
20
+ class?: string;
21
+ }
22
+ /** Footer 属性 */
23
+ export interface FooterProps {
24
+ /** 高度 */
25
+ height?: string;
26
+ /** 子内容 */
27
+ children?: Snippet;
28
+ /** 自定义类名 */
29
+ class?: string;
30
+ }
31
+ /** Aside 属性 */
32
+ export interface AsideProps {
33
+ /** 宽度 */
34
+ width?: string;
35
+ /** 子内容 */
36
+ children?: Snippet;
37
+ /** 自定义类名 */
38
+ class?: string;
39
+ }
40
+ /** Main 属性 */
41
+ export interface MainProps {
42
+ /** 子内容 */
43
+ children?: Snippet;
44
+ /** 自定义类名 */
45
+ class?: string;
46
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@lumen-design/container",
3
+ "version": "0.0.2",
4
+ "description": "Container components for Lumen UI",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "svelte": "./dist/index.js",
13
+ "import": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "svelte-package -i src -o dist --types",
21
+ "build:watch": "svelte-package -i src -o dist --types -w"
22
+ },
23
+ "devDependencies": {
24
+ "@sveltejs/package": "^2.5.7",
25
+ "svelte": "5.48.2"
26
+ },
27
+ "peerDependencies": {
28
+ "svelte": "^5.0.0"
29
+ }
30
+ }