@hkdigital/lib-sveltekit 0.0.31

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.
Files changed (109) hide show
  1. package/README.md +104 -0
  2. package/dist/classes/index.d.ts +2 -0
  3. package/dist/classes/index.js +2 -0
  4. package/dist/classes/stores/SubscribersCount.d.ts +39 -0
  5. package/dist/classes/stores/SubscribersCount.js +107 -0
  6. package/dist/classes/stores/index.d.ts +1 -0
  7. package/dist/classes/stores/index.js +1 -0
  8. package/dist/classes/streams/LogTransformStream.d.ts +4 -0
  9. package/dist/classes/streams/LogTransformStream.js +19 -0
  10. package/dist/classes/streams/ServerEventsStore.d.ts +22 -0
  11. package/dist/classes/streams/ServerEventsStore.js +110 -0
  12. package/dist/classes/streams/TimeStampSource.d.ts +13 -0
  13. package/dist/classes/streams/TimeStampSource.js +26 -0
  14. package/dist/classes/streams/index.d.ts +3 -0
  15. package/dist/classes/streams/index.js +3 -0
  16. package/dist/components/area/HkArea.svelte +49 -0
  17. package/dist/components/area/HkArea.svelte.d.ts +12 -0
  18. package/dist/components/area/HkGridArea.svelte +77 -0
  19. package/dist/components/area/HkGridArea.svelte.d.ts +20 -0
  20. package/dist/components/area/index.d.ts +2 -0
  21. package/dist/components/area/index.js +2 -0
  22. package/dist/components/icon/HkIcon.svelte +86 -0
  23. package/dist/components/icon/HkIcon.svelte.d.ts +10 -0
  24. package/dist/components/icon/HkTabIcon.svelte +112 -0
  25. package/dist/components/icon/HkTabIcon.svelte.d.ts +19 -0
  26. package/dist/components/icon/index.d.ts +3 -0
  27. package/dist/components/icon/index.js +4 -0
  28. package/dist/components/icon/typedef.d.ts +13 -0
  29. package/dist/components/icon/typedef.js +16 -0
  30. package/dist/components/index.d.ts +1 -0
  31. package/dist/components/index.js +2 -0
  32. package/dist/components/layout/HkAppLayout.state.svelte.d.ts +6 -0
  33. package/dist/components/layout/HkAppLayout.state.svelte.js +25 -0
  34. package/dist/components/layout/HkAppLayout.svelte +251 -0
  35. package/dist/components/layout/HkAppLayout.svelte.d.ts +8 -0
  36. package/dist/components/layout/HkGridLayers.svelte +72 -0
  37. package/dist/components/layout/HkGridLayers.svelte.d.ts +20 -0
  38. package/dist/components/layout/index.d.ts +3 -0
  39. package/dist/components/layout/index.js +9 -0
  40. package/dist/components/tab-bar/HkTabBar.state.svelte.d.ts +54 -0
  41. package/dist/components/tab-bar/HkTabBar.state.svelte.js +149 -0
  42. package/dist/components/tab-bar/HkTabBar.svelte +74 -0
  43. package/dist/components/tab-bar/HkTabBar.svelte.d.ts +16 -0
  44. package/dist/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +19 -0
  45. package/dist/components/tab-bar/HkTabBarSelector.state.svelte.js +93 -0
  46. package/dist/components/tab-bar/HkTabBarSelector.svelte +49 -0
  47. package/dist/components/tab-bar/HkTabBarSelector.svelte.d.ts +17 -0
  48. package/dist/components/tab-bar/index.d.ts +5 -0
  49. package/dist/components/tab-bar/index.js +17 -0
  50. package/dist/components/tab-bar/typedef.d.ts +6 -0
  51. package/dist/components/tab-bar/typedef.js +8 -0
  52. package/dist/constants/index.d.ts +2 -0
  53. package/dist/constants/index.js +2 -0
  54. package/dist/constants/regexp/index.d.ts +3 -0
  55. package/dist/constants/regexp/index.js +31 -0
  56. package/dist/constants/regexp/inspiratie.js__ +95 -0
  57. package/dist/constants/regexp/text.d.ts +47 -0
  58. package/dist/constants/regexp/text.js +49 -0
  59. package/dist/constants/regexp/user.d.ts +6 -0
  60. package/dist/constants/regexp/user.js +33 -0
  61. package/dist/constants/regexp/web.d.ts +1 -0
  62. package/dist/constants/regexp/web.js +3 -0
  63. package/dist/constants/time.d.ts +19 -0
  64. package/dist/constants/time.js +28 -0
  65. package/dist/css/test.css +3 -0
  66. package/dist/css/utilities.postcss +44 -0
  67. package/dist/index.d.ts +1 -0
  68. package/dist/index.js +9 -0
  69. package/dist/server/index.d.ts +1 -0
  70. package/dist/server/index.js +1 -0
  71. package/dist/server/logger.d.ts +24 -0
  72. package/dist/server/logger.js +94 -0
  73. package/dist/states/index.d.ts +1 -0
  74. package/dist/states/index.js +1 -0
  75. package/dist/states/navigation.svelte.d.ts +23 -0
  76. package/dist/states/navigation.svelte.js +55 -0
  77. package/dist/stores/index.d.ts +1 -0
  78. package/dist/stores/index.js +1 -0
  79. package/dist/stores/theme.d.ts +28 -0
  80. package/dist/stores/theme.js +80 -0
  81. package/dist/util/expect/index.d.ts +39 -0
  82. package/dist/util/expect/index.js +145 -0
  83. package/dist/util/function.js__ +150 -0
  84. package/dist/util/index.d.ts +2 -0
  85. package/dist/util/index.js +2 -0
  86. package/dist/util/singleton/index.d.ts +34 -0
  87. package/dist/util/singleton/index.js +97 -0
  88. package/dist/util/svelte/index.d.ts +2 -0
  89. package/dist/util/svelte/index.js +2 -0
  90. package/dist/util/svelte/observe/index.d.ts +10 -0
  91. package/dist/util/svelte/observe/index.js +49 -0
  92. package/dist/util/svelte/state-context/index.d.ts +17 -0
  93. package/dist/util/svelte/state-context/index.js +83 -0
  94. package/dist/util/time.js__ +330 -0
  95. package/dist/valibot/index.d.ts +3 -0
  96. package/dist/valibot/index.js +30 -0
  97. package/dist/valibot/user.d.ts +6 -0
  98. package/dist/valibot/user.js +23 -0
  99. package/dist/zod/all.d.ts +6 -0
  100. package/dist/zod/all.js +33 -0
  101. package/dist/zod/generic.d.ts +6 -0
  102. package/dist/zod/generic.js +11 -0
  103. package/dist/zod/javascript.d.ts +8 -0
  104. package/dist/zod/javascript.js +32 -0
  105. package/dist/zod/user.d.ts +9 -0
  106. package/dist/zod/user.js +16 -0
  107. package/dist/zod/web.d.ts +21 -0
  108. package/dist/zod/web.js +57 -0
  109. package/package.json +144 -0
package/README.md ADDED
@@ -0,0 +1,104 @@
1
+ # HKdigital's lib Sveltekit
2
+
3
+ Base library that we use to power up our Sveltekit projects
4
+
5
+ This is a library for [SvelteKit](https://svelte.dev/) projects.
6
+ It contains common code and components that we use to create our projects.
7
+
8
+ ## Status
9
+
10
+ **EARLY DEVELOPMENT RELEASE**
11
+ This package is incomplete and not fully tested.
12
+ Do not use in production environments yet.
13
+
14
+ ## A note about tailwindcss
15
+
16
+ Components in this package use [tailwindcss](https://tailwindcss.com/).
17
+
18
+ To compile tailwind classes inside this package, you must add the package location to your tailwindcss plugin configuration (instructions below).
19
+
20
+ ## Using the library
21
+
22
+ ### Install
23
+
24
+ The library can be installed as a normal NPM library.
25
+
26
+ ```bash
27
+ pnpm add @hkdigital/lib-sveltekit
28
+ ```
29
+
30
+ ### Update
31
+
32
+ ```bash
33
+ ncu "@hkdigital/*" -u && pnpm install
34
+ ```
35
+
36
+ ### Import JS & Svelte
37
+
38
+ All exports are in subfolders.
39
+
40
+ For example to import a constant from `constants/regexp/index.js`
41
+
42
+ ```svelte
43
+ import { CHAR } from '@hkdigital/lib-sveltekit-test/constants/regexp';
44
+ ```
45
+
46
+ ### import CSS
47
+
48
+ Vite should include postcss-import, but the only solution to get it working for now is to use a relative path to the node_modules folder.
49
+
50
+ For example:
51
+
52
+ ```css
53
+ /* src/app.css */
54
+ @import '../node_modules/@hkdigital/lib-sveltekit-test/dist/css/utilities.postcss';
55
+ ```
56
+
57
+ ### Enable tailwind processing
58
+
59
+ Allow the tailwind CSS processor to work on the library inside node_modules
60
+
61
+ ```js
62
+ // tailwind.config.js
63
+ export default {
64
+ content: [
65
+ './node_modules/@hkdigital/**/*.{html,js,svelte,ts}',
66
+ './src/**/*.{html,js,svelte,ts}',
67
+ ```
68
+
69
+ ## Building the showcase app
70
+
71
+ To build your library:
72
+
73
+ ```bash
74
+ npm run package
75
+ ```
76
+
77
+ To create a production version of your showcase app:
78
+
79
+ ```bash
80
+ npm run build
81
+ ```
82
+
83
+ You can preview the production build with `npm run preview`.
84
+
85
+ > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
86
+
87
+ ## Developing
88
+
89
+ To develop this library, clone the repository and install the dependencies, then start the development server of the test runners. Checkout the [package.json](./package.json) file for more details.
90
+
91
+ Everything inside `src/lib` is part of the library, everything inside `src/routes` is the showcase app of this library.
92
+
93
+ ## Publishing
94
+
95
+ The name of this library is `@hkdigital/lib-sveltekit` and it is published on [NPM](https://npmjs.com). You need NPM credentials to publish in the scope `@hkdigital`.
96
+
97
+ ### Contribute
98
+ If your wish to contribute to this library, please contact us [HKdigital](https://hkdigital.nl/contact). Alternatively, the license permits you to fork the library and publish under an alternative name. Change the package name in [package.json](./package.json) to do so.
99
+
100
+ ```bash
101
+ npm login
102
+ npm version patch
103
+ npm publish --access public
104
+ ```
@@ -0,0 +1,2 @@
1
+ export * as streams from "./streams/index.js";
2
+ export * as stores from "./stores/index.js";
@@ -0,0 +1,2 @@
1
+ export * as streams from './streams/index.js';
2
+ export * as stores from './stores/index.js';
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Class that can be used to add a `SubscribersCount` store to classes
3
+ * or other objects
4
+ */
5
+ export default class SubscribersCount {
6
+ /**
7
+ * Create a writable store with added 'subscribeCount' functionality
8
+ */
9
+ static writable(...args: any[]): any;
10
+ /**
11
+ * Add subscriber count functionality to an existing store by wrapping
12
+ * the store with a Proxy
13
+ *
14
+ * @template T;
15
+ *
16
+ * @param {import('svelte/store').Writable<T>} store
17
+ */
18
+ static wrap<T>(store: import("svelte/store").Writable<T>): any;
19
+ increment(): void;
20
+ decrement(): void;
21
+ /**
22
+ * Subscribe to `SubscribersCount` store
23
+ *
24
+ * @param {(value:number)=>void} fn
25
+ *
26
+ * @returns {()=>void} unsubscribe
27
+ */
28
+ subscribe(fn: (value: number) => void): () => void;
29
+ /**
30
+ * Subscribe to `SubscribersCount` store and receive an update once if the
31
+ * count is zero.
32
+ *
33
+ * @param {(value:number)=>void} fn
34
+ *
35
+ * @returns {()=>void} unsubscribe
36
+ */
37
+ onceEmpty(fn: (value: number) => void): () => void;
38
+ #private;
39
+ }
@@ -0,0 +1,107 @@
1
+ import { writable, get } from 'svelte/store';
2
+
3
+ /**
4
+ * Class that can be used to add a `SubscribersCount` store to classes
5
+ * or other objects
6
+ */
7
+ export default class SubscribersCount {
8
+ #count;
9
+
10
+ constructor() {
11
+ this.#count = writable(0);
12
+ }
13
+
14
+ increment() {
15
+ this.#count.update((value) => value + 1);
16
+ }
17
+
18
+ decrement() {
19
+ this.#count.update((value) => value - 1);
20
+ }
21
+
22
+ /**
23
+ * Subscribe to `SubscribersCount` store
24
+ *
25
+ * @param {(value:number)=>void} fn
26
+ *
27
+ * @returns {()=>void} unsubscribe
28
+ */
29
+ subscribe(fn) {
30
+ return this.#count.subscribe(fn);
31
+ }
32
+
33
+ /**
34
+ * Subscribe to `SubscribersCount` store and receive an update once if the
35
+ * count is zero.
36
+ *
37
+ * @param {(value:number)=>void} fn
38
+ *
39
+ * @returns {()=>void} unsubscribe
40
+ */
41
+ onceEmpty(fn) {
42
+ let unsubscribe = this.#count.subscribe((value) => {
43
+ if (value === 0) {
44
+ unsubscribe();
45
+ fn(value);
46
+ }
47
+ });
48
+
49
+ return unsubscribe;
50
+ }
51
+
52
+ /**
53
+ * Create a writable store with added 'subscribeCount' functionality
54
+ */
55
+ static writable() {
56
+ const store = writable(...arguments);
57
+
58
+ return SubscribersCount.wrap(store);
59
+ }
60
+
61
+ /**
62
+ * Add subscriber count functionality to an existing store by wrapping
63
+ * the store with a Proxy
64
+ *
65
+ * @template T;
66
+ *
67
+ * @param {import('svelte/store').Writable<T>} store
68
+ */
69
+ static wrap(store) {
70
+ // expect.store( store );
71
+
72
+ const counter = new SubscribersCount();
73
+
74
+ const handler = {
75
+ /**
76
+ * @param {*} target
77
+ * @param {string} prop
78
+ */
79
+ get(target, prop) {
80
+ switch (prop) {
81
+ case 'subscribe': {
82
+ return /* subscribe */ function () {
83
+ counter.increment();
84
+ const unsubscribe = target[prop](...arguments);
85
+
86
+ return /* unsubscribe */ () => {
87
+ counter.decrement();
88
+ unsubscribe();
89
+ };
90
+ };
91
+ }
92
+
93
+ case 'value':
94
+ return get(store);
95
+
96
+ case 'subscribersCount':
97
+ return counter;
98
+ }
99
+
100
+ return Reflect.get(target, prop);
101
+ // return target[prop];
102
+ }
103
+ };
104
+
105
+ return new Proxy(store, handler);
106
+ }
107
+ }
@@ -0,0 +1 @@
1
+ export { default as SubscribersCount } from "./SubscribersCount.js";
@@ -0,0 +1 @@
1
+ export { default as SubscribersCount } from './SubscribersCount.js';
@@ -0,0 +1,4 @@
1
+ export default class LogTransformStream extends TransformStream<any, any> {
2
+ constructor();
3
+ start(): void;
4
+ }
@@ -0,0 +1,19 @@
1
+ export default class LogTransformStream extends TransformStream {
2
+ constructor() {
3
+ const transformer = {
4
+ /**
5
+ * Log the chunk and enqueue the unchanged chunk
6
+ *
7
+ * @param {*} chunk
8
+ * @param {*} controller
9
+ */
10
+ transform: (chunk, controller) => {
11
+ console.log('log', chunk);
12
+ controller.enqueue(chunk);
13
+ }
14
+ };
15
+
16
+ super(transformer);
17
+ }
18
+ start() {}
19
+ }
@@ -0,0 +1,22 @@
1
+ export default class ServerEventsStore {
2
+ /**
3
+ * @param {object} _
4
+ * @param {Zods.AbsOrRelUrl} _.url
5
+ */
6
+ constructor({ url }: {
7
+ url: Zods.AbsOrRelUrl;
8
+ });
9
+ /** @type {SubscribersCount} */
10
+ subscribersCount: SubscribersCount;
11
+ /**
12
+ * Subscribe to Server Send Events
13
+ *
14
+ * @param {import("svelte/store").Subscriber<object|null>} fn
15
+ *
16
+ * @returns {()=>void} unsubscribe
17
+ */
18
+ subscribe(fn: import("svelte/store").Subscriber<object | null>): () => void;
19
+ #private;
20
+ }
21
+ import SubscribersCount from '../stores/SubscribersCount.js';
22
+ import * as Zods from '../../zod/all.js';
@@ -0,0 +1,110 @@
1
+ import { writable } from 'svelte/store';
2
+
3
+ // eslint-disable-next-line no-unused-vars
4
+ import * as Zods from '../../zod/all.js';
5
+
6
+ import SubscribersCount from '../stores/SubscribersCount.js';
7
+
8
+ // > Class
9
+
10
+ export default class ServerEventsStore {
11
+ /** @type {Zods.AbsOrRelUrl} */
12
+ #url;
13
+
14
+ /** @type {import("svelte/store").Writable<object|null>} */
15
+ #store;
16
+
17
+ /** @type {boolean} */
18
+ #starting = false;
19
+
20
+ /** @type {ReadableStream<Uint8Array>|null} */
21
+ #stream = null;
22
+
23
+ /** @type {SubscribersCount} */
24
+ subscribersCount;
25
+
26
+ /**
27
+ * @param {object} _
28
+ * @param {Zods.AbsOrRelUrl} _.url
29
+ */
30
+ constructor({ url }) {
31
+ this.#url = Zods.AbsOrRelUrl.parse(url);
32
+
33
+ this.#store = writable(null);
34
+
35
+ this.subscribersCount = new SubscribersCount();
36
+ }
37
+
38
+ /**
39
+ * Subscribe to Server Send Events
40
+ *
41
+ * @param {import("svelte/store").Subscriber<object|null>} fn
42
+ *
43
+ * @returns {()=>void} unsubscribe
44
+ */
45
+ subscribe(fn) {
46
+ this.subscribersCount.increment();
47
+
48
+ const unsubscribe = this.#store?.subscribe(fn);
49
+
50
+ this.#tryStartStream();
51
+
52
+ return () => {
53
+ this.subscribersCount.decrement();
54
+ unsubscribe?.();
55
+ };
56
+ }
57
+
58
+ async #tryStartStream() {
59
+ if (this.#stream || this.#starting) {
60
+ return;
61
+ }
62
+
63
+ try {
64
+ this.#starting = true;
65
+
66
+ const aborter = new AbortController();
67
+ const signal = aborter.signal;
68
+
69
+ const response = await fetch(this.#url, { signal });
70
+
71
+ const stream = (this.#stream = response.body);
72
+
73
+ this.#starting = false;
74
+
75
+ const reader =
76
+ // @ts-ignore
77
+ stream.pipeThrough(new TextDecoderStream()).getReader();
78
+
79
+ // const textDecoder = new TextDecoder('utf-8');
80
+
81
+ while (!signal.aborted) {
82
+ const { value, done } = await reader.read();
83
+
84
+ if (undefined === value) {
85
+ break;
86
+ }
87
+
88
+ const obj = JSON.parse(value);
89
+ // const obj = JSON.parse(textDecoder.decode(value));
90
+
91
+ if (!done) {
92
+ this.#store.set(obj);
93
+ }
94
+
95
+ // console.log({ ...obj, done });
96
+
97
+ if (done) {
98
+ break;
99
+ }
100
+ } // end for
101
+ } catch (e) {
102
+ this.#starting = false;
103
+ this.#stream = null;
104
+
105
+ if (e instanceof Error && e.name !== 'AbortError') {
106
+ throw e;
107
+ }
108
+ }
109
+ }
110
+ }
@@ -0,0 +1,13 @@
1
+ export default class TimestampSource {
2
+ /**
3
+ * Stream start function
4
+ *
5
+ * @param {ReadableStreamDefaultController} ctr
6
+ */
7
+ start(ctr: ReadableStreamDefaultController): void;
8
+ /**
9
+ * Stop generation of new stream output
10
+ */
11
+ cancel(): void;
12
+ #private;
13
+ }
@@ -0,0 +1,26 @@
1
+ export default class TimestampSource {
2
+ /** @type {number|NodeJS.Timeout|undefined} */
3
+ #interval;
4
+
5
+ constructor() {}
6
+
7
+ /**
8
+ * Stream start function
9
+ *
10
+ * @param {ReadableStreamDefaultController} ctr
11
+ */
12
+ start(ctr) {
13
+ ctr.enqueue(JSON.stringify({ now: Date.now() }));
14
+
15
+ this.#interval = setInterval(() => {
16
+ return ctr.enqueue(JSON.stringify({ now: Date.now() }));
17
+ }, 1000);
18
+ }
19
+
20
+ /**
21
+ * Stop generation of new stream output
22
+ */
23
+ cancel() {
24
+ clearInterval(this.#interval);
25
+ }
26
+ }
@@ -0,0 +1,3 @@
1
+ export { default as LogTransformStream } from "./LogTransformStream.js";
2
+ export { default as ServerEventsStore } from "./ServerEventsStore.js";
3
+ export { default as TimeStampSource } from "./TimeStampSource.js";
@@ -0,0 +1,3 @@
1
+ export { default as LogTransformStream } from './LogTransformStream.js';
2
+ export { default as ServerEventsStore } from './ServerEventsStore.js';
3
+ export { default as TimeStampSource } from './TimeStampSource.js';
@@ -0,0 +1,49 @@
1
+ <script>
2
+ /**
3
+ * Area component
4
+ * An area is actually a DIV that can be styled and can contain content
5
+ *
6
+ * Following component guidelines from Skeleton
7
+ * @see https://next.skeleton.dev/docs/resources/contribute/components
8
+ */
9
+
10
+ /**
11
+ * @type {{
12
+ * base?: string,
13
+ * bg?: string,
14
+ * padding?: string,
15
+ * margin?: string,
16
+ * classes?: string,
17
+ * style?: string,
18
+ * children: import('svelte').Snippet
19
+ * } & { [attr: string]: * }}
20
+ */
21
+ let {
22
+ // Style
23
+ base,
24
+ bg,
25
+ padding,
26
+ margin,
27
+ classes,
28
+ style,
29
+
30
+ // Snippets
31
+ children,
32
+
33
+ // DOM Element
34
+ domElem = $bindable(),
35
+
36
+ // Attributes
37
+ ...attrs
38
+ } = $props();
39
+ </script>
40
+
41
+ <div
42
+ data-hk-area
43
+ class="{base} {bg} {padding} {margin} {classes}"
44
+ bind:this={domElem}
45
+ {style}
46
+ {...attrs}
47
+ >
48
+ {@render children()}
49
+ </div>
@@ -0,0 +1,12 @@
1
+ export default HkArea;
2
+ declare const HkArea: import("svelte").Component<{
3
+ base?: string;
4
+ bg?: string;
5
+ padding?: string;
6
+ margin?: string;
7
+ classes?: string;
8
+ style?: string;
9
+ children: import("svelte").Snippet;
10
+ } & {
11
+ [attr: string]: any;
12
+ }, {}, "domElem">;
@@ -0,0 +1,77 @@
1
+ <script>
2
+ /**
3
+ * Grid area component
4
+ * This component contains a DIV that has display: grid set. It is
5
+ * wrapped in a box which makes it possible to add box attributes
6
+ * such as margins.
7
+ *
8
+ * Following component guidelines from Skeleton
9
+ * @see https://next.skeleton.dev/docs/resources/contribute/components
10
+ */
11
+
12
+ import HkArea from './HkArea.svelte';
13
+
14
+ /**
15
+ * @type {{
16
+ * base?: string,
17
+ * bg?: string,
18
+ * padding?: string,
19
+ * margin?: string,
20
+ * classes?: string,
21
+ * style?: string,
22
+ * boxBase?: string,
23
+ * boxBg?: string,
24
+ * boxPadding?: string,
25
+ * boxMargin?: string,
26
+ * boxClasses?: string,
27
+ * boxAttrs?: { [attr: string]: * },
28
+ * children: import('svelte').Snippet
29
+ * } & { [attr: string]: * }}
30
+ */
31
+ let {
32
+ // Style
33
+ base,
34
+ bg,
35
+ padding,
36
+ margin,
37
+ classes,
38
+ style,
39
+ boxBase,
40
+ boxBg,
41
+ boxPadding,
42
+ boxMargin,
43
+ boxClasses,
44
+ boxAttrs,
45
+
46
+ // Snippets
47
+ children,
48
+
49
+ // DOM Element's
50
+ domElem = $bindable(),
51
+ boxDomElem = $bindable(),
52
+
53
+ // Attributes
54
+ ...attrs
55
+ } = $props();
56
+ </script>
57
+
58
+ <div
59
+ data-hk-grid-area-box
60
+ class="{boxBase} {boxBg} {boxPadding} {boxMargin} {boxClasses}"
61
+ {...boxAttrs}
62
+ bind:this={boxDomElem}
63
+ >
64
+ <HkArea
65
+ data-hk-grid-area
66
+ base="grid {base}"
67
+ bind:domElem
68
+ {bg}
69
+ {padding}
70
+ {margin}
71
+ {classes}
72
+ {style}
73
+ {...attrs}
74
+ >
75
+ {@render children()}
76
+ </HkArea>
77
+ </div>
@@ -0,0 +1,20 @@
1
+ export default HkGridArea;
2
+ declare const HkGridArea: import("svelte").Component<{
3
+ base?: string;
4
+ bg?: string;
5
+ padding?: string;
6
+ margin?: string;
7
+ classes?: string;
8
+ style?: string;
9
+ boxBase?: string;
10
+ boxBg?: string;
11
+ boxPadding?: string;
12
+ boxMargin?: string;
13
+ boxClasses?: string;
14
+ boxAttrs?: {
15
+ [attr: string]: any;
16
+ };
17
+ children: import("svelte").Snippet;
18
+ } & {
19
+ [attr: string]: any;
20
+ }, {}, "domElem" | "boxDomElem">;
@@ -0,0 +1,2 @@
1
+ export { default as HkArea } from "./HkArea.svelte";
2
+ export { default as HkGridArea } from "./HkGridArea.svelte";
@@ -0,0 +1,2 @@
1
+ export { default as HkArea } from './HkArea.svelte';
2
+ export { default as HkGridArea } from './HkGridArea.svelte';