@hkdigital/lib-sveltekit 0.0.94 → 0.0.96

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 (69) hide show
  1. package/dist/components/buttons/index.d.ts +1 -0
  2. package/dist/components/buttons/index.js +1 -0
  3. package/dist/components/buttons/plain-button/PlainButton.svelte +37 -0
  4. package/dist/components/buttons/plain-button/PlainButton.svelte.d.ts +10 -0
  5. package/dist/components/icon/HkIcon.svelte +1 -1
  6. package/dist/components/icon/HkIcon.svelte.d.ts +1 -1
  7. package/dist/components/image/ImageBox.svelte +2 -2
  8. package/dist/components/image/ResponsiveImage.svelte +1 -2
  9. package/dist/components/inputs/index.d.ts +1 -0
  10. package/dist/components/inputs/index.js +1 -0
  11. package/dist/components/inputs/text-input/TestTextInput.svelte__ +102 -0
  12. package/dist/components/inputs/text-input/TextInput.svelte +226 -0
  13. package/dist/components/inputs/text-input/TextInput.svelte.d.ts +26 -0
  14. package/dist/components/inputs/text-input/TextInput.svelte___ +83 -0
  15. package/dist/components/inputs/text-input/assets/IconInvalid.svelte +14 -0
  16. package/dist/components/inputs/text-input/assets/IconInvalid.svelte.d.ts +26 -0
  17. package/dist/components/inputs/text-input/assets/IconValid.svelte +12 -0
  18. package/dist/components/inputs/text-input/assets/IconValid.svelte.d.ts +26 -0
  19. package/dist/components/panels/index.d.ts +1 -0
  20. package/dist/components/panels/index.js +1 -0
  21. package/dist/components/panels/plain-panel/PlainPanel.svelte +33 -0
  22. package/dist/components/panels/plain-panel/PlainPanel.svelte.d.ts +10 -0
  23. package/dist/components/rows/index.d.ts +2 -0
  24. package/dist/components/rows/index.js +3 -0
  25. package/dist/components/rows/panel-grid-row/PanelGridRow.svelte +104 -0
  26. package/dist/components/rows/panel-grid-row/PanelGridRow.svelte.d.ts +12 -0
  27. package/dist/components/rows/panel-row-2/PanelRow2.svelte +40 -0
  28. package/dist/components/rows/panel-row-2/PanelRow2.svelte.d.ts +12 -0
  29. package/dist/components/widgets/compare-left-right/CompareLeftRight.svelte +13 -9
  30. package/dist/components/widgets/scale-control/ScaleControl.svelte +0 -0
  31. package/dist/components/widgets/scale-control/ScaleControl.svelte.d.ts +26 -0
  32. package/dist/components/widgets/scale-control/index.d.ts +1 -0
  33. package/dist/components/widgets/scale-control/index.js +1 -0
  34. package/dist/config/tailwind.extend.d.ts +49 -0
  35. package/dist/config/tailwind.extend.js +56 -0
  36. package/dist/constants/css-states/index.d.ts +1 -0
  37. package/dist/constants/css-states/index.js +1 -0
  38. package/dist/constants/css-states/input-states.d.ts +8 -0
  39. package/dist/constants/css-states/input-states.js +11 -0
  40. package/dist/constants/index.js +1 -0
  41. package/dist/css/tw-prose.postcss__ +259 -0
  42. package/dist/index.js +0 -9
  43. package/dist/themes/hkdev/components/boxes/game-box.postcss +13 -0
  44. package/dist/themes/hkdev/components/buttons/plain-button.postcss +73 -0
  45. package/dist/themes/hkdev/components/buttons/skip-button.postcss +8 -0
  46. package/dist/themes/hkdev/components/inputs/text-input.postcss +108 -0
  47. package/dist/themes/hkdev/components/panels/plain-panel.postcss +46 -0
  48. package/dist/themes/hkdev/components/panels/speech-bubble.postcss +52 -0
  49. package/dist/themes/hkdev/components/rows/panel-grid-row.postcss +7 -0
  50. package/dist/themes/hkdev/components/rows/panel-row-2.postcss +9 -0
  51. package/dist/themes/hkdev/components.postcss +49 -0
  52. package/dist/themes/hkdev/debug.postcss +2 -0
  53. package/dist/themes/hkdev/global/layout.postcss +39 -0
  54. package/dist/themes/hkdev/global/on-colors.postcss +53 -0
  55. package/dist/themes/hkdev/global/text.postcss__ +35 -0
  56. package/dist/themes/hkdev/global/vars.postcss__ +7 -0
  57. package/dist/themes/hkdev/globals.postcss +12 -0
  58. package/dist/themes/hkdev/responsive.postcss +12 -0
  59. package/dist/themes/hkdev/theme-ext.d.ts +4 -0
  60. package/dist/themes/hkdev/theme-ext.js +15 -0
  61. package/dist/themes/hkdev/theme.d.ts +226 -0
  62. package/dist/themes/hkdev/theme.js +227 -0
  63. package/dist/themes/index.d.ts +1 -0
  64. package/dist/themes/index.js +1 -0
  65. package/package.json +5 -2
  66. package/dist/components/input/HkInputField.svelte +0 -50
  67. package/dist/components/input/HkInputField.svelte.d.ts +0 -14
  68. package/dist/components/input/index.d.ts +0 -1
  69. package/dist/components/input/index.js +0 -1
@@ -0,0 +1,73 @@
1
+
2
+ @import "../../global/on-colors.postcss";
3
+
4
+ @define-mixin buttons-plain-button {
5
+
6
+ [data-button="plain-button"] {
7
+ @apply py-6p rounded-sm;
8
+
9
+ & p {
10
+ @apply text-20p base-font-family font-black my-0 mx-16p uppercase;
11
+ }
12
+
13
+ /* not disabled */
14
+
15
+ &:not([disabled]) {
16
+ &.role-primary {
17
+ @apply border-4p border-primary-500 bg-primary-500;
18
+ & .p {
19
+ color: rgb(var(--color-primary-50));
20
+ }
21
+ }
22
+
23
+ &.role-secondary {
24
+ @apply border-4p border-primary-500;
25
+
26
+ & .p {
27
+ color: rgb(var(--color-primary-500));
28
+ }
29
+
30
+ &.variant-white
31
+ {
32
+ @apply border-surface-50;
33
+
34
+ & .p {
35
+ color: rgb(var(--color-surface-50));
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ /* disabled */
42
+
43
+ &[disabled] {
44
+ &.role-primary {
45
+ @apply bg-surface-500;
46
+ & .p {
47
+ color: rgb(var(--color-surface-300));
48
+ }
49
+ }
50
+
51
+ &.role-secondary {
52
+ @apply border-4p bg-primary-50;
53
+
54
+ & .p {
55
+ color: rgb(var(--color-surface-300));
56
+ }
57
+ }
58
+
59
+ }
60
+ }
61
+
62
+
63
+
64
+ /*[data-button-round-arrow-next] {
65
+ / * @apply bg-primary-500; * /
66
+ @apply text-24p base-font-family font-bold;
67
+
68
+ & svg {
69
+ color: rgb(var(--color-primary-500));
70
+ @apply w-80p h-80p;
71
+ }
72
+ }*/
73
+ }
@@ -0,0 +1,8 @@
1
+ @import "../../global/on-colors.postcss";
2
+
3
+ @define-mixin buttons-skip-button {
4
+
5
+ [data-button="skip-button"] {
6
+
7
+ }
8
+ }
@@ -0,0 +1,108 @@
1
+
2
+ /*@import "../../global/on-colors.postcss";*/
3
+
4
+ @define-mixin inputs-text-input {
5
+
6
+ [data-input="text-input"] {
7
+
8
+ /* Base */
9
+
10
+
11
+
12
+ /* Required and disabled */
13
+
14
+ &.required {}
15
+ &.disabled {}
16
+
17
+ /* Focus */
18
+
19
+ &.focused {
20
+ border: solid thin black;
21
+
22
+ & [data-child="legend"] {
23
+ color: black;
24
+ }
25
+
26
+ & [data-child="input"] {
27
+ color: black;
28
+ }
29
+ }
30
+
31
+ &.unfocused {
32
+ border: solid thin grey;
33
+
34
+ & [data-child="legend"] {
35
+ color: grey;
36
+ }
37
+
38
+ & [data-child="input"] {
39
+ color: grey;
40
+ }
41
+ }
42
+
43
+ /* Invalid */
44
+ &.invalid {
45
+ &.pristine [data-child="legend"] {
46
+ color: white;
47
+ background-color: orange;
48
+ }
49
+
50
+ &.dirty {
51
+ &.focused [data-child="legend"] {
52
+ color: black;
53
+ background-color: yellow;
54
+ }
55
+
56
+ &.unfocused [data-child="legend"] {
57
+ color: white;
58
+ background-color: red;
59
+ }
60
+ }
61
+ }
62
+
63
+ /* Pristine (valid-invalid) */
64
+
65
+ &.pristine.valid {
66
+ & [data-child="icon-box"] {
67
+ color: grey;
68
+ }
69
+ }
70
+
71
+ &.pristine.invalid {
72
+ & [data-child="icon-box"] {
73
+ color: orange;
74
+ }
75
+ }
76
+
77
+ /* Dirty (valid-invalid) */
78
+
79
+ &.dirty.valid {
80
+ &.focused {
81
+ & [data-child="icon-box"] {
82
+ color: grey;
83
+ }
84
+ }
85
+
86
+ &.unfocused {
87
+ & [data-child="icon-box"] {
88
+ color: green;
89
+ }
90
+ }
91
+ }
92
+
93
+ &.dirty.invalid {
94
+ &.focused {
95
+ & [data-child="icon-box"] {
96
+ color: orange;
97
+ }
98
+ }
99
+
100
+ &.unfocused {
101
+ & [data-child="icon-box"] {
102
+ color: red;
103
+ }
104
+ }
105
+ }
106
+
107
+ }
108
+ }
@@ -0,0 +1,46 @@
1
+ /*@import "../../global/on-colors.postcss";*/
2
+
3
+ @define-mixin panels-plain-panel {
4
+ [data-panel="plain-panel"] {
5
+
6
+ @mixin on_surface_light;
7
+ @apply bg-primary-50;
8
+
9
+ @apply p-40p rounded-md;
10
+
11
+ max-width: 50vw;
12
+ /* max-width: 27vw;*/
13
+ /* width: 26vw; */
14
+
15
+ & picture {
16
+ display: block;
17
+ max-width: 100%;
18
+ @apply pr-80p;
19
+ /* border: solid 1px red; */
20
+ }
21
+
22
+ & > .h1 {
23
+ @apply text-32p mb-20p;
24
+ }
25
+
26
+ & > .p {
27
+ @apply text-24p mb-10p;
28
+
29
+ & + picture {
30
+ @apply mt-40p;
31
+ }
32
+
33
+ }
34
+
35
+ & button {
36
+ /* @apply min-w-180p; */
37
+ }
38
+
39
+ & .cc_cols-stretch {
40
+ @apply grid auto-cols-fr grid-flow-col;
41
+ @apply justify-stretch;
42
+
43
+ border: solid 8px red;
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,52 @@
1
+
2
+ @import "../../global/on-colors.postcss";
3
+
4
+ @define-mixin panels-speech-bubble {
5
+ [data-panel="speech-bubble"] {
6
+
7
+ @mixin on_surface_light;
8
+ @apply bg-primary-50;
9
+
10
+ @apply pt-20p pb-20p pr-40p pl-40p rounded-tl-lg rounded-tr-lg rounded-bl-lg;
11
+
12
+ /* max-width: 26vw;*/
13
+ /* width: 26vw; */
14
+
15
+ &.small {
16
+ max-width: 16vw;
17
+ }
18
+
19
+ & picture {
20
+ display: block;
21
+ max-width: 100%;
22
+ @apply pr-80p;
23
+ /* border: solid 1px red; */
24
+ }
25
+
26
+ & [data-section="title"]
27
+ {
28
+ & .h1 {
29
+ @apply text-32p pt-8p pb-8p;
30
+ }
31
+ }
32
+
33
+ & [data-section="text"]
34
+ {
35
+ & .p {
36
+ @apply text-20p pb-10p;
37
+
38
+ /*& + picture {
39
+ @apply mt-40p;
40
+ }*/
41
+ }
42
+ }
43
+
44
+
45
+ /* Footer */
46
+
47
+ & [data-row][data-section="footer"]
48
+ {
49
+ @apply pt-10p;
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,7 @@
1
+
2
+ @import "../../global/on-colors.postcss";
3
+
4
+ @define-mixin rows-panel-grid-row {
5
+ [data-row="panel-grid-row"] {
6
+ }
7
+ }
@@ -0,0 +1,9 @@
1
+
2
+ @import "../../global/on-colors.postcss";
3
+
4
+ @define-mixin rows-panel-row-2 {
5
+ [data-row="panel-grid-row"][data-wrapper="panel-row-2"] {
6
+ @apply gap-20p mb-8p mt-8p;
7
+
8
+ }
9
+ }
@@ -0,0 +1,49 @@
1
+ /* Import component styles */
2
+
3
+ /* Panels */
4
+ /*@import "./components/panels/plain-panel.postcss";*/
5
+ /*@import "./components/panels/speech-bubble.postcss";*/
6
+
7
+ /* Rows */
8
+ /*@import "./components/rows/panel-grid-row.postcss";*/
9
+ /*@import "./components/rows/panel-row-2.postcss";*/
10
+
11
+ /* Buttons */
12
+ @import "./components/buttons/plain-button.postcss";
13
+ /*@import "./components/buttons/skip-button.postcss";*/
14
+
15
+ /* Inputs */
16
+ @import "./components/inputs/text-input.postcss";
17
+
18
+ /* ... */
19
+ /*@import "./components/select-level.postcss";*/
20
+
21
+ /* Not used */
22
+ /*@import "./components/hk-tab-icon.postcss";*/
23
+ /*@import "./components/avatar-layer.postcss";*/
24
+
25
+ /* Wrap component styles in theme selector */
26
+
27
+
28
+ [data-theme=hkdev] {
29
+
30
+ /* Panels */
31
+ /* @mixin panels-plain-panel;*/
32
+ /* @mixin panels-speech-bubble;*/
33
+
34
+ /* Rows */
35
+ /* @mixin rows-panel-grid-row;*/
36
+ /* @mixin rows-panel-row-2;*/
37
+
38
+ /* Buttons */
39
+ @mixin buttons-plain-button;
40
+ /* @mixin buttons-skip-button;*/
41
+
42
+ /* Inputs */
43
+ @mixin inputs-text-input;
44
+
45
+ /* ... */
46
+ /* @mixin hk_tab_icon;*/
47
+ /* @mixin avatar_layer;*/
48
+ /* @mixin select_level;*/
49
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /**/
@@ -0,0 +1,39 @@
1
+
2
+ @define-mixin all_layout {
3
+
4
+ .page-centered-xl {
5
+ @apply max-w-xl px-20p mb-40p;
6
+ @apply flex flex-col;
7
+
8
+ @apply self-center;
9
+ @apply w-full;
10
+ }
11
+
12
+ .page-full {
13
+ @apply flex flex-col;
14
+
15
+ @apply w-full h-full;
16
+ }
17
+
18
+ .page-row {
19
+ @apply w-full flex flex-col;
20
+ }
21
+
22
+
23
+ .page-ui-margins
24
+ {
25
+ @apply mt-120p;
26
+ @apply mr-20p;
27
+ @apply mb-120p;
28
+ @apply ml-20p;
29
+ }
30
+
31
+ .page-ui-margins-equal
32
+ {
33
+ @apply mt-20p;
34
+ @apply mr-20p;
35
+ @apply mb-20p;
36
+ @apply ml-20p;
37
+ }
38
+
39
+ }
@@ -0,0 +1,53 @@
1
+
2
+ @define-mixin on_surface_dark {
3
+
4
+ & .h1 {
5
+ color: rgb(var(--color-primary-contrast-light));
6
+ }
7
+
8
+ & .p {
9
+ color: rgb(var(--color-primary-contrast-light));
10
+ }
11
+
12
+ & .a {
13
+ color: rgb(var(--color-primary-contrast-light));
14
+ }
15
+
16
+ & svg {
17
+ color: rgb(var(--color-primary-contrast-light));
18
+ }
19
+
20
+ }
21
+
22
+ @define-mixin on_surface_light {
23
+
24
+ & .h1 {
25
+ color: rgb(var(--color-surface-950));
26
+ }
27
+
28
+ & .p {
29
+ color: rgb(var(--color-surface-500));
30
+ }
31
+
32
+ & .a {
33
+ color: rgb(var(--color-surface-500));
34
+ }
35
+
36
+ & svg {
37
+ color: rgb(var(--color-surface-500));
38
+ }
39
+
40
+ }
41
+
42
+ @define-mixin all_on_colors {
43
+
44
+ /* .on-primary-dark < :not('cancel-on-primary-dark') */
45
+ .on-primary-dark {
46
+ @mixin on_surface_dark;
47
+ }
48
+
49
+ .on-primary-light {
50
+ @mixin on_surface_light;
51
+ }
52
+
53
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Tailwind defaults
3
+ *
4
+ * text-sm 14px;
5
+ * text-base 16px;
6
+ * text-lg 18px;
7
+ * text-xl 20px;
8
+ * text-2xl 24px;
9
+ * text-3xl 30px;
10
+ * text-4xl 36px;
11
+ * text-5xl 48px;
12
+ * text-6xl 60px;
13
+ * text-7xl 72px;
14
+ * text-8xl 96px;
15
+ * text-9xl 128px;
16
+ *
17
+ * @see https://tailwindcss.com/docs/font-size
18
+ */
19
+
20
+ @define-mixin all_text {
21
+
22
+ a {
23
+ @apply text-sm font-bold underline;
24
+ }
25
+
26
+ p {
27
+ @apply text-xl;
28
+ }
29
+
30
+ h1 {
31
+ &.text-presenter-title {
32
+ @apply text-5xl;
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,7 @@
1
+
2
+ @define-mixin all_vars {
3
+
4
+ /* --tab-bar-height: 72px;
5
+ --tab-bar-selector-width: 132px;
6
+ --tab-bar-selector-height: var(--tab-bar-height, 72px); */
7
+ }
@@ -0,0 +1,12 @@
1
+ /*@import "./global/vars.postcss";*/
2
+ /*@import "./global/on-colors.postcss";*/
3
+ @import "./global/layout.postcss";
4
+ /*@import "./global/text.postcss";*/
5
+
6
+ [data-theme] {
7
+ /* @mixin all_vars;*/
8
+ /* @mixin all_on_colors;*/
9
+ @mixin all_layout;
10
+ /* @mixin all_text;*/
11
+
12
+ }
@@ -0,0 +1,12 @@
1
+
2
+
3
+ /*html:has(body[data-theme=hkdev]) {
4
+ font-size: 0.83333vw;
5
+ }*/
6
+
7
+ /*[data-theme=hkdev]
8
+ {
9
+ & [data-panel="test"]
10
+ {
11
+ }
12
+ }*/
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Set meta them color for the current theme
3
+ */
4
+ export function setMetaThemeColor(): void;
@@ -0,0 +1,15 @@
1
+ import theme from '../hkdev/theme.js';
2
+
3
+ import { theme as themeStore } from '@hkdigital/lib-sveltekit/stores/index.js';
4
+
5
+ /**
6
+ * Set meta them color for the current theme
7
+ */
8
+ export function setMetaThemeColor() {
9
+ const props = theme.properties;
10
+
11
+ themeStore.setMetaThemeColor(`rgb( ${props['--color-surface-950']})`);
12
+
13
+ // setMetaThemeColorDark(`rgb( ${props['--color-primary-950']})`);
14
+ // setMetaThemeColorBase(`rgb( ${props['--color-primary-50']})`);
15
+ }