@hkdigital/lib-sveltekit 0.2.20 → 0.2.22
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/README.md +38 -24
- package/dist/themes/hkdev/components/blocks/text-block.css +1 -8
- package/dist/themes/hkdev/components/boxes/game-box.css +1 -2
- package/dist/themes/hkdev/components/buttons/button.css +21 -21
- package/dist/themes/hkdev/components/buttons/skip-button.css +1 -2
- package/dist/themes/hkdev/components/drag-drop/draggable.css +2 -2
- package/dist/themes/hkdev/components/drag-drop/drop-zone.css +49 -39
- package/dist/themes/hkdev/components/icons/icon-steeze.css +12 -18
- package/dist/themes/hkdev/components/inputs/text-input.css +64 -66
- package/dist/themes/hkdev/components/panels/panel.css +18 -20
- package/dist/themes/hkdev/components/rows/panel-grid-row.css +1 -3
- package/dist/themes/hkdev/components/rows/panel-row-2.css +2 -4
- package/dist/themes/hkdev/components.css +0 -24
- package/dist/themes/hkdev/global/layout.css +24 -31
- package/dist/themes/hkdev/global/on-colors.css +22 -43
- package/dist/themes/hkdev/globals.css +2 -9
- package/dist/themes/hkdev/theme-ext.js +4 -7
- package/dist/themes/hkdev/theme.css +219 -0
- package/dist/themes/index.d.ts +1 -1
- package/dist/util/design-system/skeleton.js +12 -12
- package/dist/util/exceptions/index.d.ts +11 -0
- package/dist/util/exceptions/index.js +17 -0
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +1 -0
- package/package.json +8 -4
- package/dist/themes/hkdev/theme.d.ts +0 -234
- package/dist/themes/hkdev/theme.js +0 -235
package/README.md
CHANGED
@@ -13,14 +13,6 @@ Do not use in production environments yet.
|
|
13
13
|
|
14
14
|
### TODO
|
15
15
|
|
16
|
-
Add information about Skeleton, theming and imagetools
|
17
|
-
|
18
|
-
## A note about tailwindcss
|
19
|
-
|
20
|
-
Components in this package use [tailwindcss](https://tailwindcss.com/).
|
21
|
-
|
22
|
-
To compile tailwind classes inside this package, you must add the package location to your tailwindcss plugin configuration (instructions below).
|
23
|
-
|
24
16
|
## Using the library
|
25
17
|
|
26
18
|
### Install
|
@@ -31,37 +23,51 @@ The library can be installed as a normal NPM library.
|
|
31
23
|
pnpm add @hkdigital/lib-sveltekit
|
32
24
|
```
|
33
25
|
|
34
|
-
|
26
|
+
#### Tailwind
|
35
27
|
|
36
|
-
|
28
|
+
Components in this package use [tailwindcss](https://tailwindcss.com/).
|
37
29
|
|
38
|
-
|
39
|
-
|
30
|
+
To compile tailwind classes inside this package, you must add the package location to your tailwindcss plugin configuration.
|
31
|
+
|
32
|
+
```
|
33
|
+
// tailwind.config.js
|
34
|
+
export default {
|
35
|
+
content: [
|
36
|
+
'./node_modules/@hkdigital/**/*.{html,js,svelte,ts}',
|
37
|
+
'./src/**/*.{html,js,svelte,ts}',
|
40
38
|
```
|
41
39
|
|
42
|
-
|
40
|
+
### Update
|
41
|
+
|
42
|
+
Make sure your project has a script called `upgrade:hk` to upgrade all packages
|
43
|
+
in the '@hkdigital' namespace.
|
43
44
|
|
44
45
|
```bash
|
45
|
-
|
46
|
+
pnpm upgrade:hk
|
46
47
|
```
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
You can also add this command to your project. To do so, add the lines to the bottom of the `scripts` section of your `package.json`.
|
49
|
+
### The package.json scripts:
|
51
50
|
|
52
51
|
```bash
|
53
|
-
|
54
|
-
|
52
|
+
pnpm add -D npm-check-updates
|
53
|
+
pnpm add -D npm-check-updates
|
55
54
|
```
|
56
55
|
|
57
|
-
|
56
|
+
```js
|
57
|
+
"scripts": {
|
58
|
+
"upgrade:hk": "run-s upgrade:hk:update pnpm:install",
|
59
|
+
"upgrade:hk:update": "ncu --dep dev,optional,peer,prod '@hkdigital/*' -u",
|
60
|
+
"pnpm:install": "pnpm install"
|
61
|
+
}
|
62
|
+
```
|
58
63
|
|
59
|
-
All exports are in subfolders.
|
60
64
|
|
61
|
-
|
65
|
+
### Import JS, Svelte files and Typedefs
|
66
|
+
|
67
|
+
Most subfolders have an index.js that export all functionality and typedefs.
|
62
68
|
|
63
69
|
```svelte
|
64
|
-
import { CHAR } from '@hkdigital/lib-sveltekit/constants/regexp';
|
70
|
+
import { CHAR } from '@hkdigital/lib-sveltekit/constants/regexp/index.js';
|
65
71
|
```
|
66
72
|
|
67
73
|
### Import CSS
|
@@ -130,6 +136,14 @@ npm publish --access public
|
|
130
136
|
pnpm run publish:npm
|
131
137
|
```
|
132
138
|
|
139
|
+
### Troubleshooting
|
140
|
+
|
141
|
+
#### Running scripts from package.json in Windows
|
142
|
+
|
143
|
+
The CMD terminal in Windows is quite limited. Use the PowerShell instead of some scripts from package.json do not run correctly.
|
144
|
+
|
145
|
+
|
133
146
|
## Contribute
|
134
147
|
|
135
|
-
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.
|
148
|
+
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. Don't forget to change the package name in [package.json](./package.json) if you do so.
|
149
|
+
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@define-mixin text_block {
|
2
|
-
|
3
1
|
/* .on-primary-dark
|
4
2
|
{
|
5
3
|
& [data-title-text-button-block] {
|
@@ -14,7 +12,6 @@
|
|
14
12
|
} */
|
15
13
|
|
16
14
|
[data-title-text-button-block] {
|
17
|
-
|
18
15
|
&.block-width {
|
19
16
|
@apply w-1/2;
|
20
17
|
}
|
@@ -28,14 +25,10 @@
|
|
28
25
|
@apply text-base-md;
|
29
26
|
}
|
30
27
|
|
31
|
-
& > .content-box:has(
|
32
|
-
{
|
28
|
+
& > .content-box:has(+ .footer-box) {
|
33
29
|
@apply mb-30p; /* 10p + 20p */
|
34
30
|
}
|
35
31
|
|
36
32
|
& > .footer-box {
|
37
33
|
}
|
38
34
|
}
|
39
|
-
|
40
|
-
|
41
|
-
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
|
2
2
|
[data-component='button'] {
|
3
3
|
/* ---- Core Button Variables ---- */
|
4
4
|
|
@@ -73,48 +73,48 @@
|
|
73
73
|
/* Role-based styling for primary buttons */
|
74
74
|
[data-component='button'][data-role='primary'] {
|
75
75
|
@apply border-width-normal;
|
76
|
-
border-color:
|
77
|
-
background-color:
|
78
|
-
color:
|
76
|
+
border-color: var(--btn-primary-border);
|
77
|
+
background-color: var(--btn-primary-bg);
|
78
|
+
color: var(--btn-primary-text);
|
79
79
|
|
80
80
|
&:hover:not(:disabled):not(.state-selected) {
|
81
|
-
border-color:
|
82
|
-
background-color:
|
81
|
+
border-color: var(--btn-primary-hover-border);
|
82
|
+
background-color: var(--btn-primary-hover-bg);
|
83
83
|
}
|
84
84
|
|
85
85
|
&:focus-visible {
|
86
|
-
@apply outline
|
87
|
-
outline-color:
|
86
|
+
@apply outline-normal outline-offset-normal;
|
87
|
+
outline-color: var(--btn-primary-focus-outline);
|
88
88
|
}
|
89
89
|
|
90
90
|
&.state-selected {
|
91
|
-
background-color:
|
92
|
-
border-color:
|
93
|
-
color:
|
91
|
+
background-color: var(--btn-primary-selected-bg);
|
92
|
+
border-color: var(--btn-primary-selected-border);
|
93
|
+
color: var(--btn-primary-selected-text);
|
94
94
|
}
|
95
95
|
}
|
96
96
|
|
97
97
|
/* Role-based styling for secondary buttons */
|
98
98
|
[data-component='button'][data-role='secondary'] {
|
99
99
|
@apply border-width-normal;
|
100
|
-
border-color:
|
101
|
-
color:
|
100
|
+
border-color: var(--btn-secondary-border);
|
101
|
+
color: var(--btn-secondary-text);
|
102
102
|
background-color: var(--btn-secondary-bg);
|
103
103
|
|
104
104
|
&:hover:not(:disabled):not(.state-selected) {
|
105
|
-
background-color:
|
106
|
-
border-color:
|
105
|
+
background-color: var(--btn-secondary-hover-bg);
|
106
|
+
border-color: var(--btn-secondary-hover-border);
|
107
107
|
}
|
108
108
|
|
109
109
|
&:focus-visible {
|
110
110
|
@apply outline outline-normal outline-offset-normal;
|
111
|
-
outline-color:
|
111
|
+
outline-color: var(--btn-secondary-focus-outline);
|
112
112
|
}
|
113
113
|
|
114
114
|
&.state-selected {
|
115
|
-
background-color:
|
116
|
-
border-color:
|
117
|
-
color:
|
115
|
+
background-color: var(--btn-secondary-selected-bg);
|
116
|
+
border-color: var(--btn-secondary-selected-border);
|
117
|
+
color: var(--btn-secondary-selected-text);
|
118
118
|
}
|
119
119
|
}
|
120
120
|
|
@@ -128,7 +128,7 @@
|
|
128
128
|
}
|
129
129
|
|
130
130
|
&.state-error {
|
131
|
-
border-color:
|
131
|
+
border-color:var(--btn-error-border);
|
132
132
|
}
|
133
133
|
|
134
134
|
&.state-loading {
|
@@ -143,4 +143,4 @@
|
|
143
143
|
opacity: var(--btn-disabled-opacity);
|
144
144
|
pointer-events: none;
|
145
145
|
}
|
146
|
-
|
146
|
+
|
@@ -1,48 +1,58 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
background-color: rgb(var(--color-surface-50) / 0.5);
|
1
|
+
/* Visual styling and customizable aspects */
|
2
|
+
[data-component='drop-zone'] {
|
3
|
+
/*min-height: 100px;*/
|
4
|
+
border: 1px dashed var(--color-surface-400);
|
5
|
+
border-radius: var(--theme-rounded-container);
|
6
|
+
/*padding: 1rem;*/
|
7
|
+
transition: all 0.2s ease;
|
8
|
+
position: relative;
|
9
|
+
background-color: --alpha(var(--color-surface-50) / 0.5);
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
&.state-drag-over {
|
19
|
-
border-color: rgb(var(--color-primary-400));
|
20
|
-
background-color: rgb(var(--color-primary-500) / 0.05);
|
21
|
-
}
|
11
|
+
/* State-based styling using state classes - visual aspects only */
|
12
|
+
&.state-ready {
|
13
|
+
border-color: var(--color-surface-400);
|
14
|
+
background-color: transparent;
|
15
|
+
}
|
22
16
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
&.state-drag-over {
|
18
|
+
border-color: var(--color-primary-400);
|
19
|
+
background-color: color-mix(
|
20
|
+
in oklch,
|
21
|
+
var(--color-primary-500) 5%,
|
22
|
+
transparent
|
23
|
+
);
|
24
|
+
}
|
25
|
+
&.state-can-drop {
|
26
|
+
border-color: var(--color-success-500);
|
27
|
+
background-color: color-mix(
|
28
|
+
in oklch,
|
29
|
+
var(--color-success-500) 8%,
|
30
|
+
transparent
|
31
|
+
);
|
32
|
+
box-shadow: 0 0 0 3px
|
33
|
+
color-mix(in oklch, var(--color-success-500) 20%, transparent);
|
34
|
+
}
|
28
35
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
36
|
+
&.state-cannot-drop {
|
37
|
+
border-color: var(--color-error-500);
|
38
|
+
background-color: color-mix(
|
39
|
+
in oklch,
|
40
|
+
var(--color-error-500) 8%,
|
41
|
+
transparent
|
42
|
+
);
|
43
|
+
cursor: not-allowed;
|
44
|
+
}
|
34
45
|
|
35
|
-
|
46
|
+
/*&.state-drop-disabled {
|
36
47
|
opacity: 0.5;
|
37
48
|
cursor: not-allowed;
|
38
|
-
background-color:
|
49
|
+
background-color: var(--color-surface-100);
|
39
50
|
}*/
|
40
|
-
|
51
|
+
}
|
41
52
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
}
|
53
|
+
/* Default styling for inner elements - all visual/customizable */
|
54
|
+
[data-layer='content'],
|
55
|
+
[data-layer='preview'],
|
56
|
+
[data-layer='empty'] {
|
57
|
+
@apply type-base-md;
|
48
58
|
}
|
@@ -1,22 +1,16 @@
|
|
1
|
-
@
|
1
|
+
/* @note using CSS vars defined in the parent button postcss */
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
&[data-size="sm"] {
|
9
|
-
@apply w-16bt h-16bt;
|
10
|
-
}
|
11
|
-
|
12
|
-
&[data-size="md"] {
|
13
|
-
@apply w-28bt h-28bt;
|
14
|
-
}
|
15
|
-
|
16
|
-
&[data-size="lg"] {
|
17
|
-
@apply w-50bt h-50bt;
|
18
|
-
}
|
3
|
+
/* Type-based styling for text buttons */
|
4
|
+
[data-component='icon'][data-type='steeze'] {
|
5
|
+
&[data-size='sm'] {
|
6
|
+
@apply w-16bt h-16bt;
|
7
|
+
}
|
19
8
|
|
9
|
+
&[data-size='md'] {
|
10
|
+
@apply w-28bt h-28bt;
|
20
11
|
}
|
21
12
|
|
22
|
-
|
13
|
+
&[data-size='lg'] {
|
14
|
+
@apply w-50bt h-50bt;
|
15
|
+
}
|
16
|
+
}
|
@@ -1,103 +1,101 @@
|
|
1
1
|
/*@import "../../global/on-colors.css";*/
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
/* Base */
|
3
|
+
[data-input='text-input'] {
|
4
|
+
/* Base */
|
6
5
|
|
7
|
-
|
6
|
+
/* Required and disabled */
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
&.required {
|
9
|
+
}
|
10
|
+
&.disabled {
|
11
|
+
}
|
12
|
+
|
13
|
+
/* Focus */
|
14
|
+
|
15
|
+
&.focused {
|
16
|
+
border: solid thin black;
|
17
|
+
|
18
|
+
& [data-child='legend'] {
|
19
|
+
color: black;
|
12
20
|
}
|
13
21
|
|
14
|
-
|
22
|
+
& [data-child='input'] {
|
23
|
+
color: black;
|
24
|
+
}
|
25
|
+
}
|
15
26
|
|
16
|
-
|
17
|
-
|
27
|
+
&.unfocused {
|
28
|
+
border: solid thin grey;
|
18
29
|
|
19
|
-
|
20
|
-
|
21
|
-
|
30
|
+
& [data-child='legend'] {
|
31
|
+
color: grey;
|
32
|
+
}
|
22
33
|
|
23
|
-
|
24
|
-
|
25
|
-
}
|
34
|
+
& [data-child='input'] {
|
35
|
+
color: grey;
|
26
36
|
}
|
37
|
+
}
|
27
38
|
|
28
|
-
|
29
|
-
|
39
|
+
/* Invalid */
|
40
|
+
&.invalid {
|
41
|
+
&.pristine [data-child='legend'] {
|
42
|
+
color: white;
|
43
|
+
background-color: orange;
|
44
|
+
}
|
30
45
|
|
31
|
-
|
32
|
-
|
46
|
+
&.dirty {
|
47
|
+
&.focused [data-child='legend'] {
|
48
|
+
color: black;
|
49
|
+
background-color: yellow;
|
33
50
|
}
|
34
51
|
|
35
|
-
|
36
|
-
color:
|
52
|
+
&.unfocused [data-child='legend'] {
|
53
|
+
color: white;
|
54
|
+
background-color: red;
|
37
55
|
}
|
38
56
|
}
|
57
|
+
}
|
39
58
|
|
40
|
-
|
41
|
-
&.invalid {
|
42
|
-
&.pristine [data-child='legend'] {
|
43
|
-
color: white;
|
44
|
-
background-color: orange;
|
45
|
-
}
|
59
|
+
/* Pristine (valid-invalid) */
|
46
60
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
61
|
+
&.pristine.valid {
|
62
|
+
& [data-child='icon-box'] {
|
63
|
+
color: grey;
|
64
|
+
}
|
65
|
+
}
|
52
66
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
}
|
57
|
-
}
|
67
|
+
&.pristine.invalid {
|
68
|
+
& [data-child='icon-box'] {
|
69
|
+
color: orange;
|
58
70
|
}
|
71
|
+
}
|
59
72
|
|
60
|
-
|
73
|
+
/* Dirty (valid-invalid) */
|
61
74
|
|
62
|
-
|
75
|
+
&.dirty.valid {
|
76
|
+
&.focused {
|
63
77
|
& [data-child='icon-box'] {
|
64
78
|
color: grey;
|
65
79
|
}
|
66
80
|
}
|
67
81
|
|
68
|
-
&.
|
82
|
+
&.unfocused {
|
69
83
|
& [data-child='icon-box'] {
|
70
|
-
color:
|
84
|
+
color: green;
|
71
85
|
}
|
72
86
|
}
|
87
|
+
}
|
73
88
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
& [data-child='icon-box'] {
|
79
|
-
color: grey;
|
80
|
-
}
|
81
|
-
}
|
82
|
-
|
83
|
-
&.unfocused {
|
84
|
-
& [data-child='icon-box'] {
|
85
|
-
color: green;
|
86
|
-
}
|
89
|
+
&.dirty.invalid {
|
90
|
+
&.focused {
|
91
|
+
& [data-child='icon-box'] {
|
92
|
+
color: orange;
|
87
93
|
}
|
88
94
|
}
|
89
95
|
|
90
|
-
&.
|
91
|
-
|
92
|
-
|
93
|
-
color: orange;
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
&.unfocused {
|
98
|
-
& [data-child='icon-box'] {
|
99
|
-
color: red;
|
100
|
-
}
|
96
|
+
&.unfocused {
|
97
|
+
& [data-child='icon-box'] {
|
98
|
+
color: red;
|
101
99
|
}
|
102
100
|
}
|
103
101
|
}
|
@@ -1,27 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
@apply rounded-md;
|
1
|
+
[data-component='panel'] {
|
2
|
+
@apply py-30up px-40up;
|
3
|
+
@apply rounded-md;
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
&[data-variant='light'] {
|
6
|
+
@apply bg-surface-50;
|
7
|
+
}
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
&[data-variant='dark'] {
|
10
|
+
@apply bg-surface-950;
|
11
|
+
}
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
/* Size variants */
|
14
|
+
&[data-width='sm'] {
|
15
|
+
width: calc(400px * var(--scale-ui));
|
16
|
+
}
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
&[data-width='md'] {
|
19
|
+
width: calc(600px * var(--scale-ui));
|
20
|
+
}
|
22
21
|
|
23
|
-
|
24
|
-
|
25
|
-
}
|
22
|
+
&[data-width='lg'] {
|
23
|
+
width: calc(800px * var(--scale-ui));
|
26
24
|
}
|
27
25
|
}
|
@@ -26,28 +26,4 @@
|
|
26
26
|
/* ... */
|
27
27
|
@import './components/blocks/text-block.css';
|
28
28
|
|
29
|
-
/* Wrap component styles in theme selector */
|
30
29
|
|
31
|
-
[data-theme='hkdev'] {
|
32
|
-
/* Rows */
|
33
|
-
/* @mixin rows-panel-grid-row;*/
|
34
|
-
/* @mixin rows-panel-row-2;*/
|
35
|
-
|
36
|
-
/* Buttons */
|
37
|
-
@mixin component-button;
|
38
|
-
@mixin component-button-text;
|
39
|
-
@mixin component-button-icon-steeze;
|
40
|
-
/* @mixin buttons-skip-button;*/
|
41
|
-
|
42
|
-
@mixin component-draggable;
|
43
|
-
@mixin component-drop-zone;
|
44
|
-
|
45
|
-
@mixin component-icon-steeze;
|
46
|
-
|
47
|
-
@mixin component-panel;
|
48
|
-
|
49
|
-
@mixin text_block;
|
50
|
-
|
51
|
-
/* Inputs */
|
52
|
-
@mixin inputs-text-input;
|
53
|
-
}
|