@hkdigital/lib-sveltekit 0.1.16 → 0.1.17
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/buttons/button/Button.svelte +1 -1
 - package/dist/components/buttons/button/Button.svelte.d.ts +2 -2
 - package/dist/components/layout/GridLayersLayout.svelte +89 -0
 - package/dist/components/layout/{HkGridLayers.svelte.d.ts → GridLayersLayout.svelte.d.ts} +21 -21
 - package/dist/components/layout/index.d.ts +1 -1
 - package/dist/components/layout/index.js +1 -1
 - package/package.json +1 -1
 - package/dist/components/layout/HkGridLayers.svelte +0 -82
 
| 
         @@ -7,7 +7,7 @@ type Button = { 
     | 
|
| 
       7 
7 
     | 
    
         
             
                    bg?: string;
         
     | 
| 
       8 
8 
     | 
    
         
             
                    classes?: string;
         
     | 
| 
       9 
9 
     | 
    
         
             
                    type?: string;
         
     | 
| 
       10 
     | 
    
         
            -
                    role?: "primary" | "secondary";
         
     | 
| 
      
 10 
     | 
    
         
            +
                    role?: "custom" | "primary" | "secondary" | "tertiary";
         
     | 
| 
       11 
11 
     | 
    
         
             
                    size?: "sm" | "md" | "lg";
         
     | 
| 
       12 
12 
     | 
    
         
             
                    variant?: string;
         
     | 
| 
       13 
13 
     | 
    
         
             
                    active?: boolean;
         
     | 
| 
         @@ -26,7 +26,7 @@ declare const Button: import("svelte").Component<{ 
     | 
|
| 
       26 
26 
     | 
    
         
             
                bg?: string;
         
     | 
| 
       27 
27 
     | 
    
         
             
                classes?: string;
         
     | 
| 
       28 
28 
     | 
    
         
             
                type?: string;
         
     | 
| 
       29 
     | 
    
         
            -
                role?: "primary" | "secondary";
         
     | 
| 
      
 29 
     | 
    
         
            +
                role?: "primary" | "secondary" | "tertiary" | "custom";
         
     | 
| 
       30 
30 
     | 
    
         
             
                size?: "sm" | "md" | "lg";
         
     | 
| 
       31 
31 
     | 
    
         
             
                variant?: string;
         
     | 
| 
       32 
32 
     | 
    
         
             
                active?: boolean;
         
     | 
| 
         @@ -0,0 +1,89 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <script>
         
     | 
| 
      
 2 
     | 
    
         
            +
            	/**
         
     | 
| 
      
 3 
     | 
    
         
            +
            	 * Grid Layers component
         
     | 
| 
      
 4 
     | 
    
         
            +
            	 * This is a grid with only one cell. All direct children are
         
     | 
| 
      
 5 
     | 
    
         
            +
            	 * place in the same cell and form a visually stacked component.
         
     | 
| 
      
 6 
     | 
    
         
            +
            	 *
         
     | 
| 
      
 7 
     | 
    
         
            +
            	 * This can be used to place e.g. texts over an image. Place the
         
     | 
| 
      
 8 
     | 
    
         
            +
            	 * image in a layer and the text in another. The standard grid
         
     | 
| 
      
 9 
     | 
    
         
            +
            	 * content placement options can be used.
         
     | 
| 
      
 10 
     | 
    
         
            +
            	 *
         
     | 
| 
      
 11 
     | 
    
         
            +
            	 * Following component guidelines from Skeleton
         
     | 
| 
      
 12 
     | 
    
         
            +
            	 * @see https://next.skeleton.dev/docs/resources/contribute/components
         
     | 
| 
      
 13 
     | 
    
         
            +
            	 */
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            	/**
         
     | 
| 
      
 16 
     | 
    
         
            +
            	 * @type {{
         
     | 
| 
      
 17 
     | 
    
         
            +
            	 *   base?: string,
         
     | 
| 
      
 18 
     | 
    
         
            +
            	 *   bg?: string,
         
     | 
| 
      
 19 
     | 
    
         
            +
            	 *   padding?: string,
         
     | 
| 
      
 20 
     | 
    
         
            +
            	 *   margin?: string,
         
     | 
| 
      
 21 
     | 
    
         
            +
            	 *   height?: string,
         
     | 
| 
      
 22 
     | 
    
         
            +
            	 *   classes?: string,
         
     | 
| 
      
 23 
     | 
    
         
            +
            	 *   style?: string,
         
     | 
| 
      
 24 
     | 
    
         
            +
            	 *   cellBase?: string,
         
     | 
| 
      
 25 
     | 
    
         
            +
            	 *   cellBg?: string,
         
     | 
| 
      
 26 
     | 
    
         
            +
            	 *   cellPadding?: string,
         
     | 
| 
      
 27 
     | 
    
         
            +
            	 *   cellMargin?: string,
         
     | 
| 
      
 28 
     | 
    
         
            +
            	 *   cellClasses?: string,
         
     | 
| 
      
 29 
     | 
    
         
            +
            	 *   cellStyle?: string,
         
     | 
| 
      
 30 
     | 
    
         
            +
            	 *   children: import('svelte').Snippet,
         
     | 
| 
      
 31 
     | 
    
         
            +
            	 *   cellAttrs?: { [attr: string]: * },
         
     | 
| 
      
 32 
     | 
    
         
            +
            	 *   [attr: string]: any
         
     | 
| 
      
 33 
     | 
    
         
            +
            	 * }}
         
     | 
| 
      
 34 
     | 
    
         
            +
            	 */
         
     | 
| 
      
 35 
     | 
    
         
            +
            	const {
         
     | 
| 
      
 36 
     | 
    
         
            +
            		// Style
         
     | 
| 
      
 37 
     | 
    
         
            +
            		base,
         
     | 
| 
      
 38 
     | 
    
         
            +
            		bg,
         
     | 
| 
      
 39 
     | 
    
         
            +
            		padding,
         
     | 
| 
      
 40 
     | 
    
         
            +
            		margin,
         
     | 
| 
      
 41 
     | 
    
         
            +
            		height,
         
     | 
| 
      
 42 
     | 
    
         
            +
            		classes,
         
     | 
| 
      
 43 
     | 
    
         
            +
            		style,
         
     | 
| 
      
 44 
     | 
    
         
            +
            		cellBase,
         
     | 
| 
      
 45 
     | 
    
         
            +
            		cellBg,
         
     | 
| 
      
 46 
     | 
    
         
            +
            		cellPadding,
         
     | 
| 
      
 47 
     | 
    
         
            +
            		cellMargin,
         
     | 
| 
      
 48 
     | 
    
         
            +
            		cellClasses,
         
     | 
| 
      
 49 
     | 
    
         
            +
            		cellStyle,
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
            		cellAttrs,
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
            		// Snippets
         
     | 
| 
      
 54 
     | 
    
         
            +
            		children,
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
            		// Attributes
         
     | 
| 
      
 57 
     | 
    
         
            +
            		...attrs
         
     | 
| 
      
 58 
     | 
    
         
            +
            	} = $props();
         
     | 
| 
      
 59 
     | 
    
         
            +
            </script>
         
     | 
| 
      
 60 
     | 
    
         
            +
             
     | 
| 
      
 61 
     | 
    
         
            +
            <div
         
     | 
| 
      
 62 
     | 
    
         
            +
            	data-component="grid-layers"
         
     | 
| 
      
 63 
     | 
    
         
            +
            	class="relative {base} {bg} {height} {classes} {margin} {padding}"
         
     | 
| 
      
 64 
     | 
    
         
            +
            	{style}
         
     | 
| 
      
 65 
     | 
    
         
            +
            	{...attrs}
         
     | 
| 
      
 66 
     | 
    
         
            +
            >
         
     | 
| 
      
 67 
     | 
    
         
            +
            	<div
         
     | 
| 
      
 68 
     | 
    
         
            +
            		data-section="layer"
         
     | 
| 
      
 69 
     | 
    
         
            +
            		class="absolute inset-0 grid {cellBase} {cellBg} {cellPadding} {cellMargin} {cellClasses}"
         
     | 
| 
      
 70 
     | 
    
         
            +
            		style={cellStyle}
         
     | 
| 
      
 71 
     | 
    
         
            +
            	>
         
     | 
| 
      
 72 
     | 
    
         
            +
            		{@render children()}
         
     | 
| 
      
 73 
     | 
    
         
            +
            	</div>
         
     | 
| 
      
 74 
     | 
    
         
            +
            </div>
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
            <style>
         
     | 
| 
      
 77 
     | 
    
         
            +
            	/* All children of the layer share the same grid area
         
     | 
| 
      
 78 
     | 
    
         
            +
            	   but aren't absolutely positioned */
         
     | 
| 
      
 79 
     | 
    
         
            +
            	[data-section='layer'] {
         
     | 
| 
      
 80 
     | 
    
         
            +
            		grid-template-columns: 1fr;
         
     | 
| 
      
 81 
     | 
    
         
            +
            		grid-template-rows: 1fr;
         
     | 
| 
      
 82 
     | 
    
         
            +
            	}
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
            	[data-section='layer'] > :global(*) {
         
     | 
| 
      
 85 
     | 
    
         
            +
            		grid-column: 1;
         
     | 
| 
      
 86 
     | 
    
         
            +
            		grid-row: 1;
         
     | 
| 
      
 87 
     | 
    
         
            +
            		z-index: 0; /* Base z-index to allow explicit stacking order */
         
     | 
| 
      
 88 
     | 
    
         
            +
            	}
         
     | 
| 
      
 89 
     | 
    
         
            +
            </style>
         
     | 
| 
         @@ -1,7 +1,8 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            export default  
     | 
| 
       2 
     | 
    
         
            -
            type  
     | 
| 
      
 1 
     | 
    
         
            +
            export default GridLayersLayout;
         
     | 
| 
      
 2 
     | 
    
         
            +
            type GridLayersLayout = {
         
     | 
| 
       3 
3 
     | 
    
         
             
                $on?(type: string, callback: (e: any) => void): () => void;
         
     | 
| 
       4 
4 
     | 
    
         
             
                $set?(props: Partial<{
         
     | 
| 
      
 5 
     | 
    
         
            +
                    [attr: string]: any;
         
     | 
| 
       5 
6 
     | 
    
         
             
                    base?: string;
         
     | 
| 
       6 
7 
     | 
    
         
             
                    bg?: string;
         
     | 
| 
       7 
8 
     | 
    
         
             
                    padding?: string;
         
     | 
| 
         @@ -9,20 +10,20 @@ type HkGridLayers = { 
     | 
|
| 
       9 
10 
     | 
    
         
             
                    height?: string;
         
     | 
| 
       10 
11 
     | 
    
         
             
                    classes?: string;
         
     | 
| 
       11 
12 
     | 
    
         
             
                    style?: string;
         
     | 
| 
       12 
     | 
    
         
            -
                     
     | 
| 
       13 
     | 
    
         
            -
                     
     | 
| 
       14 
     | 
    
         
            -
                     
     | 
| 
       15 
     | 
    
         
            -
                     
     | 
| 
       16 
     | 
    
         
            -
                     
     | 
| 
       17 
     | 
    
         
            -
                     
     | 
| 
      
 13 
     | 
    
         
            +
                    cellBase?: string;
         
     | 
| 
      
 14 
     | 
    
         
            +
                    cellBg?: string;
         
     | 
| 
      
 15 
     | 
    
         
            +
                    cellPadding?: string;
         
     | 
| 
      
 16 
     | 
    
         
            +
                    cellMargin?: string;
         
     | 
| 
      
 17 
     | 
    
         
            +
                    cellClasses?: string;
         
     | 
| 
      
 18 
     | 
    
         
            +
                    cellStyle?: string;
         
     | 
| 
      
 19 
     | 
    
         
            +
                    children: Snippet<[]>;
         
     | 
| 
      
 20 
     | 
    
         
            +
                    cellAttrs?: {
         
     | 
| 
       18 
21 
     | 
    
         
             
                        [attr: string]: any;
         
     | 
| 
       19 
22 
     | 
    
         
             
                    };
         
     | 
| 
       20 
     | 
    
         
            -
                    children: Snippet<[]>;
         
     | 
| 
       21 
     | 
    
         
            -
                } & {
         
     | 
| 
       22 
     | 
    
         
            -
                    [attr: string]: any;
         
     | 
| 
       23 
23 
     | 
    
         
             
                }>): void;
         
     | 
| 
       24 
24 
     | 
    
         
             
            };
         
     | 
| 
       25 
     | 
    
         
            -
            declare const  
     | 
| 
      
 25 
     | 
    
         
            +
            declare const GridLayersLayout: import("svelte").Component<{
         
     | 
| 
      
 26 
     | 
    
         
            +
                [attr: string]: any;
         
     | 
| 
       26 
27 
     | 
    
         
             
                base?: string;
         
     | 
| 
       27 
28 
     | 
    
         
             
                bg?: string;
         
     | 
| 
       28 
29 
     | 
    
         
             
                padding?: string;
         
     | 
| 
         @@ -30,15 +31,14 @@ declare const HkGridLayers: import("svelte").Component<{ 
     | 
|
| 
       30 
31 
     | 
    
         
             
                height?: string;
         
     | 
| 
       31 
32 
     | 
    
         
             
                classes?: string;
         
     | 
| 
       32 
33 
     | 
    
         
             
                style?: string;
         
     | 
| 
       33 
     | 
    
         
            -
                 
     | 
| 
       34 
     | 
    
         
            -
                 
     | 
| 
       35 
     | 
    
         
            -
                 
     | 
| 
       36 
     | 
    
         
            -
                 
     | 
| 
       37 
     | 
    
         
            -
                 
     | 
| 
       38 
     | 
    
         
            -
                 
     | 
| 
      
 34 
     | 
    
         
            +
                cellBase?: string;
         
     | 
| 
      
 35 
     | 
    
         
            +
                cellBg?: string;
         
     | 
| 
      
 36 
     | 
    
         
            +
                cellPadding?: string;
         
     | 
| 
      
 37 
     | 
    
         
            +
                cellMargin?: string;
         
     | 
| 
      
 38 
     | 
    
         
            +
                cellClasses?: string;
         
     | 
| 
      
 39 
     | 
    
         
            +
                cellStyle?: string;
         
     | 
| 
      
 40 
     | 
    
         
            +
                children: import("svelte").Snippet;
         
     | 
| 
      
 41 
     | 
    
         
            +
                cellAttrs?: {
         
     | 
| 
       39 
42 
     | 
    
         
             
                    [attr: string]: any;
         
     | 
| 
       40 
43 
     | 
    
         
             
                };
         
     | 
| 
       41 
     | 
    
         
            -
                children: import("svelte").Snippet;
         
     | 
| 
       42 
     | 
    
         
            -
            } & {
         
     | 
| 
       43 
     | 
    
         
            -
                [attr: string]: any;
         
     | 
| 
       44 
44 
     | 
    
         
             
            }, {}, "">;
         
     | 
| 
         @@ -1,3 +1,3 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            export { default as HkAppLayout } from "./HkAppLayout.svelte";
         
     | 
| 
       2 
     | 
    
         
            -
            export { default as  
     | 
| 
      
 2 
     | 
    
         
            +
            export { default as GridLayersLayout } from "./GridLayersLayout.svelte";
         
     | 
| 
       3 
3 
     | 
    
         
             
            export { createOrGetState as createOrGetAppLayoutState, createState as createAppLayoutState, getState as getAppLayoutState } from "./HkAppLayout.state.svelte.js";
         
     | 
    
        package/package.json
    CHANGED
    
    
| 
         @@ -1,82 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <script>
         
     | 
| 
       2 
     | 
    
         
            -
            	/**
         
     | 
| 
       3 
     | 
    
         
            -
            	 * Grid Layers component
         
     | 
| 
       4 
     | 
    
         
            -
            	 * This is a grid with only one cell. All direct children are
         
     | 
| 
       5 
     | 
    
         
            -
            	 * place in the same cell and form a visually stacked component.
         
     | 
| 
       6 
     | 
    
         
            -
            	 *
         
     | 
| 
       7 
     | 
    
         
            -
            	 * This can be used to place e.g. texts over an image. Place the
         
     | 
| 
       8 
     | 
    
         
            -
            	 * image in a layer and the text in another. The standard grid
         
     | 
| 
       9 
     | 
    
         
            -
            	 * content placement options can be used.
         
     | 
| 
       10 
     | 
    
         
            -
            	 *
         
     | 
| 
       11 
     | 
    
         
            -
            	 * Following component guidelines from Skeleton
         
     | 
| 
       12 
     | 
    
         
            -
            	 * @see https://next.skeleton.dev/docs/resources/contribute/components
         
     | 
| 
       13 
     | 
    
         
            -
            	 */
         
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
            	/**
         
     | 
| 
       16 
     | 
    
         
            -
            	 * @type {{
         
     | 
| 
       17 
     | 
    
         
            -
            	 *   base?: string,
         
     | 
| 
       18 
     | 
    
         
            -
            	 *   bg?: string,
         
     | 
| 
       19 
     | 
    
         
            -
            	 *   padding?: string,
         
     | 
| 
       20 
     | 
    
         
            -
            	 *   margin?: string,
         
     | 
| 
       21 
     | 
    
         
            -
            	 *   height?: string,
         
     | 
| 
       22 
     | 
    
         
            -
            	 *   classes?: string,
         
     | 
| 
       23 
     | 
    
         
            -
            	 *   style?: string,
         
     | 
| 
       24 
     | 
    
         
            -
            	 *   boxBase?: string,
         
     | 
| 
       25 
     | 
    
         
            -
            	 *   boxBg?: string,
         
     | 
| 
       26 
     | 
    
         
            -
            	 *   boxPadding?: string,
         
     | 
| 
       27 
     | 
    
         
            -
            	 *   boxMargin?: string,
         
     | 
| 
       28 
     | 
    
         
            -
            	 *   boxClasses?: string,
         
     | 
| 
       29 
     | 
    
         
            -
            	 *   boxAttrs?: { [attr: string]: * },
         
     | 
| 
       30 
     | 
    
         
            -
            	 *   children: import('svelte').Snippet
         
     | 
| 
       31 
     | 
    
         
            -
            	 * } & { [attr: string]: any }}
         
     | 
| 
       32 
     | 
    
         
            -
            	 */
         
     | 
| 
       33 
     | 
    
         
            -
            	const {
         
     | 
| 
       34 
     | 
    
         
            -
            		// Style
         
     | 
| 
       35 
     | 
    
         
            -
            		base,
         
     | 
| 
       36 
     | 
    
         
            -
            		bg,
         
     | 
| 
       37 
     | 
    
         
            -
            		padding,
         
     | 
| 
       38 
     | 
    
         
            -
            		margin,
         
     | 
| 
       39 
     | 
    
         
            -
            		height = 'h-full',
         
     | 
| 
       40 
     | 
    
         
            -
            		classes,
         
     | 
| 
       41 
     | 
    
         
            -
            		style,
         
     | 
| 
       42 
     | 
    
         
            -
            		boxBase,
         
     | 
| 
       43 
     | 
    
         
            -
            		boxBg,
         
     | 
| 
       44 
     | 
    
         
            -
            		boxPadding,
         
     | 
| 
       45 
     | 
    
         
            -
            		boxMargin,
         
     | 
| 
       46 
     | 
    
         
            -
            		boxClasses,
         
     | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
            		// Snippets
         
     | 
| 
       49 
     | 
    
         
            -
            		children,
         
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
            		// Attributes
         
     | 
| 
       52 
     | 
    
         
            -
            		...attrs
         
     | 
| 
       53 
     | 
    
         
            -
            	} = $props();
         
     | 
| 
       54 
     | 
    
         
            -
            </script>
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
            <div
         
     | 
| 
       57 
     | 
    
         
            -
            	data-hk-grid-layers-box
         
     | 
| 
       58 
     | 
    
         
            -
            	class="{boxBase} {boxBg} {boxPadding} {boxMargin} {boxClasses}"
         
     | 
| 
       59 
     | 
    
         
            -
            	{...attrs}
         
     | 
| 
       60 
     | 
    
         
            -
            >
         
     | 
| 
       61 
     | 
    
         
            -
            	<div
         
     | 
| 
       62 
     | 
    
         
            -
            		data-hk-grid-layers
         
     | 
| 
       63 
     | 
    
         
            -
            		class="grid grid-cols-1 grid-rows-1 {base} {bg} {height} {classes} {margin} {padding}"
         
     | 
| 
       64 
     | 
    
         
            -
            		{style}
         
     | 
| 
       65 
     | 
    
         
            -
            	>
         
     | 
| 
       66 
     | 
    
         
            -
            		{@render children()}
         
     | 
| 
       67 
     | 
    
         
            -
            	</div>
         
     | 
| 
       68 
     | 
    
         
            -
            </div>
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
            <style>
         
     | 
| 
       71 
     | 
    
         
            -
            	[data-hk-grid-layers] > :global(.area-above) {
         
     | 
| 
       72 
     | 
    
         
            -
            		grid-area: 1/1/2/2;
         
     | 
| 
       73 
     | 
    
         
            -
            	}
         
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
            	[data-hk-grid-layers] > :global(*) {
         
     | 
| 
       76 
     | 
    
         
            -
            		grid-area: 2/1/3/2;
         
     | 
| 
       77 
     | 
    
         
            -
            	}
         
     | 
| 
       78 
     | 
    
         
            -
             
     | 
| 
       79 
     | 
    
         
            -
            	[data-hk-grid-layers] > :global(.area-below) {
         
     | 
| 
       80 
     | 
    
         
            -
            		grid-area: 3/1/4/2;
         
     | 
| 
       81 
     | 
    
         
            -
            	}
         
     | 
| 
       82 
     | 
    
         
            -
            </style>
         
     |