@hkdigital/lib-core 0.5.85 → 0.5.86

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/ui/README.md CHANGED
@@ -40,10 +40,10 @@ Compound or complex components that are:
40
40
 
41
41
  ```javascript
42
42
  // Import primitives for building blocks
43
- import { Button, TextInput, HkIcon } from '$lib/ui/primitives.js';
43
+ import { Button, TextInput, SteezeIcon } from '$lib/ui/primitives.js';
44
44
 
45
45
  // Import components for complete solutions
46
- import { Presenter, ImageBox, HkAppLayout } from '$lib/ui/components.js';
46
+ import { Presenter, ImageBox } from '$lib/ui/components.js';
47
47
  ```
48
48
 
49
- The distinction helps library users understand the intended use and complexity of each component.
49
+ The distinction helps library users understand the intended use and complexity of each component.
@@ -1,5 +1,10 @@
1
1
  <script>
2
2
  /**
3
+ * ===================================
4
+ * @depreceated Use SteezeIcon instead
5
+ * ===================================
6
+ *
7
+ *
3
8
  * Icon component
4
9
  *
5
10
  * Source code adapted from
@@ -38,11 +43,17 @@
38
43
  ...attrs
39
44
  } = $props();
40
45
 
41
- /** @type {any} */
42
- let icon = $state();
46
+ /** @type {import('./typedef.js').IconThemeSource|null} */
47
+ let icon = $state(null);
43
48
 
44
49
  $effect(() => {
45
- icon = src?.[theme] ?? src?.['default'] ?? Object.values(src)?.[0];
50
+ if( src )
51
+ {
52
+ icon = src[theme] ?? src?.['default'] ?? Object.values(src)?.[0];
53
+ }
54
+ else {
55
+ throw new Error('Missing property [src]');
56
+ }
46
57
  });
47
58
 
48
59
  let normalizedSize = $derived.by(() => {
@@ -57,31 +68,33 @@
57
68
  });
58
69
  </script>
59
70
 
60
- <svg
61
- data-hk-icon
62
- {...icon?.a}
63
- xmlns="http://www.w3.org/2000/svg"
64
- width={normalizedSize}
65
- height={normalizedSize}
66
- class="{base} {classes}"
67
- {...attrs}
68
- >
69
- {#each icon?.path ?? [] as a}
70
- <path {...a} />
71
- {/each}
72
- {#each icon?.rect ?? [] as a}
73
- <rect {...a} />
74
- {/each}
75
- {#each icon?.circle ?? [] as a}
76
- <circle {...a} />
77
- {/each}
78
- {#each icon?.polygon ?? [] as a}
79
- <polygon {...a} />
80
- {/each}
81
- {#each icon?.polyline ?? [] as a}
82
- <polyline {...a} />
83
- {/each}
84
- {#each icon?.line ?? [] as a}
85
- <line {...a} />
86
- {/each}
87
- </svg>
71
+ {#if icon}
72
+ <svg
73
+ data-hk-icon
74
+ {...icon?.a}
75
+ xmlns="http://www.w3.org/2000/svg"
76
+ width={normalizedSize}
77
+ height={normalizedSize}
78
+ class="{base} {classes}"
79
+ {...attrs}
80
+ >
81
+ {#each icon?.path ?? [] as a}
82
+ <path {...a} />
83
+ {/each}
84
+ {#each icon?.rect ?? [] as a}
85
+ <rect {...a} />
86
+ {/each}
87
+ {#each icon?.circle ?? [] as a}
88
+ <circle {...a} />
89
+ {/each}
90
+ {#each icon?.polygon ?? [] as a}
91
+ <polygon {...a} />
92
+ {/each}
93
+ {#each icon?.polyline ?? [] as a}
94
+ <polyline {...a} />
95
+ {/each}
96
+ {#each icon?.line ?? [] as a}
97
+ <line {...a} />
98
+ {/each}
99
+ </svg>
100
+ {/if}
@@ -1,5 +1,9 @@
1
1
  <script>
2
2
  /**
3
+ * =========================================
4
+ * @depreceated Use SteezeTabBarIcon instead
5
+ * =========================================
6
+ *
3
7
  * TabBarIcon component
4
8
  *
5
9
  * Following component guidelines from Skeleton
@@ -50,50 +50,48 @@
50
50
  ...attrs
51
51
  } = $props();
52
52
 
53
- /** @type {any} */
54
- let icon = $state();
53
+ /** @type {import('./typedef.js').IconThemeSource|null} */
54
+ let icon = $state(null);
55
55
 
56
56
  $effect(() => {
57
- icon = src?.[theme] ?? src?.['default'] ?? Object.values(src)?.[0];
57
+ if( src )
58
+ {
59
+ icon = src[theme] ?? src?.['default'] ?? Object.values(src)?.[0];
60
+ }
61
+ else {
62
+ throw new Error('Missing property [src]');
63
+ }
58
64
  });
59
-
60
- // if (size !== '100%') {
61
- // if (size.slice(-1) !== '%') {
62
- // try {
63
- // size = parseInt(size, 10) + 'px';
64
- // } catch (error) {
65
- // size = '100%';
66
- // }
67
- // }
68
- // }
69
65
  </script>
70
66
 
71
- <svg
72
- data-component="icon"
73
- data-type="steeze"
74
- data-size={size}
75
- data-variant={variant}
76
- {...icon?.a}
77
- xmlns="http://www.w3.org/2000/svg"
78
- class="{base} {classes}"
79
- {...attrs}
80
- >
81
- {#each icon?.path ?? [] as a}
82
- <path {...a} />
83
- {/each}
84
- {#each icon?.rect ?? [] as a}
85
- <rect {...a} />
86
- {/each}
87
- {#each icon?.circle ?? [] as a}
88
- <circle {...a} />
89
- {/each}
90
- {#each icon?.polygon ?? [] as a}
91
- <polygon {...a} />
92
- {/each}
93
- {#each icon?.polyline ?? [] as a}
94
- <polyline {...a} />
95
- {/each}
96
- {#each icon?.line ?? [] as a}
97
- <line {...a} />
98
- {/each}
99
- </svg>
67
+ {#if icon}
68
+ <svg
69
+ data-component="icon"
70
+ data-type="steeze"
71
+ data-size={size}
72
+ data-variant={variant}
73
+ {...icon.a}
74
+ xmlns="http://www.w3.org/2000/svg"
75
+ class="{base} {classes}"
76
+ {...attrs}
77
+ >
78
+ {#each icon.path ?? [] as a}
79
+ <path {...a} />
80
+ {/each}
81
+ {#each icon.rect ?? [] as a}
82
+ <rect {...a} />
83
+ {/each}
84
+ {#each icon.circle ?? [] as a}
85
+ <circle {...a} />
86
+ {/each}
87
+ {#each icon.polygon ?? [] as a}
88
+ <polygon {...a} />
89
+ {/each}
90
+ {#each icon.polyline ?? [] as a}
91
+ <polyline {...a} />
92
+ {/each}
93
+ {#each icon.line ?? [] as a}
94
+ <line {...a} />
95
+ {/each}
96
+ </svg>
97
+ {/if}
@@ -1,3 +1,2 @@
1
- export { default as HkIcon } from "./HkIcon.svelte";
2
- export { default as HkTabIcon } from "./HkTabIcon.svelte";
3
1
  export { default as SteezeIcon } from "./SteezeIcon.svelte";
2
+ export { default as HkIcon } from "./HkIcon.svelte";
@@ -1,4 +1,11 @@
1
+ export { default as SteezeIcon } from './SteezeIcon.svelte';
2
+
3
+ // @todo create tab icon
4
+ //export { default as SteezeTabIcon } from './SteezeTabIcon.svelte';
5
+
6
+ // @depreceated
1
7
  export { default as HkIcon } from './HkIcon.svelte';
2
- export { default as HkTabIcon } from './HkTabIcon.svelte';
3
8
 
4
- export { default as SteezeIcon } from './SteezeIcon.svelte';
9
+ // @depreceated
10
+ // export { default as HkTabIcon } from './HkTabIcon.svelte';
11
+
@@ -4,6 +4,9 @@
4
4
 
5
5
  import { Star, ExclamationTriangle, CheckCircle } from '@steeze-ui/heroicons';
6
6
 
7
+ //
8
+ // @fixme use SteezeIcon instead
9
+ //
7
10
  import { HkIcon } from '../../../primitives.js';
8
11
 
9
12
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.85",
3
+ "version": "0.5.86",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -1,40 +0,0 @@
1
- export default HkTabIcon;
2
- type HkTabIcon = {
3
- $on?(type: string, callback: (e: any) => void): () => void;
4
- $set?(props: Partial<{
5
- src: IconSource;
6
- iconTheme?: string | undefined;
7
- label?: string | undefined;
8
- route?: string | undefined;
9
- active?: boolean | undefined;
10
- base?: string | undefined;
11
- bg?: string | undefined;
12
- padding?: string | undefined;
13
- margin?: string | undefined;
14
- classes?: string | undefined;
15
- iconClasses?: string | undefined;
16
- iconHeight?: string | undefined;
17
- labelClasses?: string | undefined;
18
- rect?: DOMRect | undefined;
19
- } & {
20
- [attr: string]: any;
21
- }>): void;
22
- };
23
- declare const HkTabIcon: import("svelte").Component<{
24
- src: import("./typedef.js").IconSource;
25
- iconTheme?: string;
26
- label?: string;
27
- route?: string;
28
- active?: boolean;
29
- base?: string;
30
- bg?: string;
31
- padding?: string;
32
- margin?: string;
33
- classes?: string;
34
- iconClasses?: string;
35
- iconHeight?: string;
36
- labelClasses?: string;
37
- rect?: DOMRect;
38
- } & {
39
- [attr: string]: any;
40
- }, {}, "">;
@@ -1,60 +0,0 @@
1
- src/lib/ui/components/rows/panel-row-2/PanelRow2.svelte:2 - Parent index.js import (use $lib/ or import specific file)
2
- import { PanelGridRow } from '../index.js';
3
- import { PanelGridRow } from '../index.js'; // TODO: Import specific file or refactor
4
-
5
- src/lib/ui/components/tab-bar/HkTabBar.svelte:9 - Missing non-standard extension (use './HkTabBar.state.svelte.js')
6
- import { createOrGetState } from './HkTabBar.state.svelte';
7
- import { createOrGetState } from './HkTabBar.state.svelte.js';
8
-
9
- src/lib/ui/primitives/icons/HkTabIcon.svelte:13 - Directory import (write explicitly: '../area/index.js')
10
- import { HkGridArea } from '../area';
11
- import { HkGridArea } from '../area/index.js';
12
-
13
- src/lib/util/array/index.js:5 - Parent index.js import (use $lib/ or import specific file)
14
- import { smallestFirst, largestFirst } from '../compare/index.js';
15
- import { smallestFirst, largestFirst } from '../compare.js';
16
-
17
- src/lib/util/array/index.js:7 - Parent index.js import (use $lib/ or import specific file)
18
- import { objectGet, PATH_SEPARATOR } from '../object/index.js';
19
- import { objectGet, PATH_SEPARATOR } from '../object.js';
20
-
21
- src/lib/util/compare/index.js:3 - Parent index.js import (use $lib/ or import specific file)
22
- import { objectGet } from '../object/index.js';
23
- import { objectGet } from '../object.js';
24
-
25
- src/lib/util/expect/compounds.js:2 - Parent index.js import (use $lib/ or import specific file)
26
- import * as is from '../is/index.js';
27
- import * as is from '../is.js';
28
-
29
- src/lib/util/expect/objects.js:2 - Parent index.js import (use $lib/ or import specific file)
30
- import * as is from '../is/index.js';
31
- import * as is from '../is.js';
32
-
33
- src/lib/util/iterate/index.js:4 - Parent index.js import (use $lib/ or import specific file)
34
- import { smallestFirst, largestFirst } from '../compare/index.js';
35
- import { smallestFirst, largestFirst } from '../compare.js';
36
-
37
- src/lib/util/object/index.js:5 - Parent index.js import (use $lib/ or import specific file)
38
- import { equals } from '../compare/index.js';
39
- import { equals } from '../compare.js';
40
-
41
- src/lib/util/object/index.js:7 - Parent index.js import (use $lib/ or import specific file)
42
- import { toArrayPath } from '../array/index.js';
43
- import { toArrayPath } from '../array.js';
44
-
45
- src/lib/util/object/index.js:11 - Parent index.js import (use $lib/ or import specific file)
46
- import * as is from '../is/index.js';
47
- import * as is from '../is.js';
48
-
49
- src/lib/util/object/index.js:13 - Parent index.js import (use $lib/ or import specific file)
50
- import { iterateObjectPaths, iterateObjectEntries } from '../iterate/index.js';
51
- import { iterateObjectPaths, iterateObjectEntries } from '../iterate.js';
52
-
53
- src/lib/util/string/interpolate.js:5 - Parent index.js import (use $lib/ or import specific file)
54
- import { objectGet, PATH_SEPARATOR } from '../object/index.js';
55
- import { objectGet, PATH_SEPARATOR } from '../object.js';
56
-
57
- src/routes/explorer/[...path]/+page.svelte:4 - Parent index.js import (use $lib/ or import specific file)
58
- import { TopBar, Explorer } from '../components/index.js';
59
- import { TopBar, Explorer } from '../components.js';
60
-