@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 +3 -3
- package/dist/ui/primitives/icons/HkIcon.svelte +44 -31
- package/dist/ui/primitives/icons/{HkTabIcon.svelte → HkTabIcon.svelte__} +4 -0
- package/dist/ui/primitives/icons/SteezeIcon.svelte +40 -42
- package/dist/ui/primitives/icons/index.d.ts +1 -2
- package/dist/ui/primitives/icons/index.js +9 -2
- package/dist/ui/primitives/inputs/text-input/TextInput.svelte +3 -0
- package/package.json +1 -1
- package/dist/ui/primitives/icons/HkTabIcon.svelte.d.ts +0 -40
- package/scripts/import-fixes.txt +0 -60
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,
|
|
43
|
+
import { Button, TextInput, SteezeIcon } from '$lib/ui/primitives.js';
|
|
44
44
|
|
|
45
45
|
// Import components for complete solutions
|
|
46
|
-
import { Presenter, ImageBox
|
|
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 {
|
|
42
|
-
let icon = $state();
|
|
46
|
+
/** @type {import('./typedef.js').IconThemeSource|null} */
|
|
47
|
+
let icon = $state(null);
|
|
43
48
|
|
|
44
49
|
$effect(() => {
|
|
45
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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}
|
|
@@ -50,50 +50,48 @@
|
|
|
50
50
|
...attrs
|
|
51
51
|
} = $props();
|
|
52
52
|
|
|
53
|
-
/** @type {
|
|
54
|
-
let icon = $state();
|
|
53
|
+
/** @type {import('./typedef.js').IconThemeSource|null} */
|
|
54
|
+
let icon = $state(null);
|
|
55
55
|
|
|
56
56
|
$effect(() => {
|
|
57
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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,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
|
-
|
|
9
|
+
// @depreceated
|
|
10
|
+
// export { default as HkTabIcon } from './HkTabIcon.svelte';
|
|
11
|
+
|
package/package.json
CHANGED
|
@@ -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
|
-
}, {}, "">;
|
package/scripts/import-fixes.txt
DELETED
|
@@ -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
|
-
|