@hkdigital/lib-sveltekit 0.1.14 → 0.1.16

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.
@@ -6,8 +6,8 @@
6
6
  /**
7
7
  * @type {{
8
8
  * src: import('../../icons/typedef.js').IconSource,
9
- * size?: string,
10
- * subset?: string,
9
+ * iconSize?: string,
10
+ * theme?: string,
11
11
  * [key: string]: any
12
12
  * }}
13
13
  */
@@ -15,7 +15,7 @@
15
15
  // Icon
16
16
  src,
17
17
  iconSize,
18
- subset,
18
+ theme,
19
19
 
20
20
  // Snippets
21
21
  children,
@@ -26,5 +26,5 @@
26
26
  </script>
27
27
 
28
28
  <Button type="icon-steeze" {...attrs}>
29
- <SteezeIcon {src} size={iconSize} {subset} />
29
+ <SteezeIcon {src} size={iconSize} {theme} />
30
30
  </Button>
@@ -4,13 +4,13 @@ type SteezeIconButton = {
4
4
  $set?(props: Partial<{
5
5
  [key: string]: any;
6
6
  src: IconSource;
7
- size?: string;
8
- subset?: string;
7
+ iconSize?: string;
8
+ theme?: string;
9
9
  }>): void;
10
10
  };
11
11
  declare const SteezeIconButton: import("svelte").Component<{
12
12
  [key: string]: any;
13
13
  src: import("../../icons/typedef.js").IconSource;
14
- size?: string;
15
- subset?: string;
14
+ iconSize?: string;
15
+ theme?: string;
16
16
  }, {}, "">;
@@ -20,12 +20,12 @@
20
20
  * ----------
21
21
  * src - icon component
22
22
  * size - width and height of the icon as percentage (..%) or in pixels
23
- * subset - name of the icon subset (e.g. 'solid' or 'outline')
23
+ * theme - name of the icon theme (e.g. 'solid' or 'outline')
24
24
  *
25
25
  * @type {{
26
26
  * src: import('./typedef.js').IconSource,
27
27
  * size?: string,
28
- * subset?: string,
28
+ * theme?: string,
29
29
  * base?: string,
30
30
  * classes?: string
31
31
  * } & { [attr: string]: any }}
@@ -40,7 +40,7 @@
40
40
 
41
41
  // Functional
42
42
  src,
43
- subset = 'default', // icon subset 'default'|'solid'|'outline'...
43
+ theme = 'default', // icon theme 'default'|'solid'|'outline'...
44
44
 
45
45
  // States
46
46
  // ...
@@ -53,7 +53,7 @@
53
53
  let icon = $state();
54
54
 
55
55
  $effect(() => {
56
- icon = src?.[subset] ?? src?.['default'] ?? Object.values(src)?.[0];
56
+ icon = src?.[theme] ?? src?.['default'] ?? Object.values(src)?.[0];
57
57
  });
58
58
 
59
59
  // if (size !== '100%') {
@@ -4,7 +4,7 @@ type SteezeIcon = {
4
4
  $set?(props: Partial<{
5
5
  src: IconSource;
6
6
  size?: string;
7
- subset?: string;
7
+ theme?: string;
8
8
  base?: string;
9
9
  classes?: string;
10
10
  } & {
@@ -14,7 +14,7 @@ type SteezeIcon = {
14
14
  declare const SteezeIcon: import("svelte").Component<{
15
15
  src: import("./typedef.js").IconSource;
16
16
  size?: string;
17
- subset?: string;
17
+ theme?: string;
18
18
  base?: string;
19
19
  classes?: string;
20
20
  } & {
@@ -1 +1 @@
1
- export { default as PlainPanel } from "./plain-panel/PlainPanel.svelte";
1
+ export { default as Panel } from "./panel/Panel.svelte";
@@ -1 +1 @@
1
- export { default as PlainPanel } from './plain-panel/PlainPanel.svelte';
1
+ export { default as Panel } from './panel/Panel.svelte';
@@ -9,8 +9,9 @@
9
9
  * @type {{
10
10
  * base?: string,
11
11
  * bg?: string,
12
- * width?: string,
13
- * classes?: string
12
+ * classes?: string,
13
+ * width?: 'sm' | 'md' | 'lg',
14
+ * variant?: string,
14
15
  * children?: import('svelte').Snippet,
15
16
  * } & { [attr: string]: any }}
16
17
  */
@@ -18,9 +19,12 @@
18
19
  // Style
19
20
  base,
20
21
  bg,
21
- width,
22
22
  classes,
23
23
 
24
+ width = 'md',
25
+ variant = 'light',
26
+
27
+ // Snippets
24
28
  children,
25
29
 
26
30
  // Attributes
@@ -28,6 +32,12 @@
28
32
  } = $props();
29
33
  </script>
30
34
 
31
- <div data-panel="plain-panel" class="{base} {bg} {width} {classes}" {...attrs}>
35
+ <div
36
+ data-component="panel"
37
+ data-width={width}
38
+ data-variant={variant}
39
+ class="{base} {bg} {classes}"
40
+ {...attrs}
41
+ >
32
42
  {@render children()}
33
43
  </div>
@@ -1,21 +1,23 @@
1
- export default PlainPanel;
2
- type PlainPanel = {
1
+ export default Panel;
2
+ type Panel = {
3
3
  $on?(type: string, callback: (e: any) => void): () => void;
4
4
  $set?(props: Partial<{
5
5
  base?: string;
6
6
  bg?: string;
7
- width?: string;
8
7
  classes?: string;
8
+ width?: "sm" | "md" | "lg";
9
+ variant?: string;
9
10
  children?: Snippet<[]>;
10
11
  } & {
11
12
  [attr: string]: any;
12
13
  }>): void;
13
14
  };
14
- declare const PlainPanel: import("svelte").Component<{
15
+ declare const Panel: import("svelte").Component<{
15
16
  base?: string;
16
17
  bg?: string;
17
- width?: string;
18
18
  classes?: string;
19
+ width?: "sm" | "md" | "lg";
20
+ variant?: string;
19
21
  children?: import("svelte").Snippet;
20
22
  } & {
21
23
  [attr: string]: any;
@@ -40,19 +40,19 @@ export const TEXT_HEADING_SIZES = {
40
40
  };
41
41
 
42
42
  export const TEXT_UI_SIZES = {
43
- sm: { size: 14, lineHeight: 1.1 },
44
- md: { size: 16, lineHeight: 1.1 },
45
- lg: { size: 18, lineHeight: 1.1 }
43
+ sm: { size: 14, lineHeight: 1 },
44
+ md: { size: 16, lineHeight: 1 },
45
+ lg: { size: 18, lineHeight: 1 }
46
46
  };
47
47
 
48
48
  /* == Border radius == */
49
49
 
50
50
  export const RADIUS_SIZES = {
51
51
  none: '0px',
52
- xs: { size: 1 },
53
- sm: { size: 2 },
54
- md: { size: 4 },
55
- lg: { size: 8 },
52
+ xs: { size: 5 },
53
+ sm: { size: 10 },
54
+ md: { size: 25 },
55
+ lg: { size: 35 },
56
56
  full: '9999px'
57
57
  };
58
58
 
@@ -1,10 +1,10 @@
1
1
  @define-mixin component-button {
2
- [data-component="button"] {
2
+ [data-component='button'] {
3
3
  /* ---- Core Button Variables ---- */
4
4
 
5
5
  /* Size variables */
6
- --btn-min-width: calc( 150px * var(--scale-ui) );
7
- --btn-min-height: calc( 40px * var(--scale-ui) );
6
+ --btn-min-width: calc(150px * var(--scale-ui));
7
+ --btn-min-height: calc(40px * var(--scale-ui));
8
8
 
9
9
  /* ---- Primary Button Variables ---- */
10
10
  --btn-primary-bg: var(--color-primary-500);
@@ -48,7 +48,8 @@
48
48
  align-items: center;
49
49
  cursor: pointer;
50
50
  position: relative;
51
- transition-property: background-color, color, border-color, transform, box-shadow;
51
+ transition-property:
52
+ background-color, color, border-color, transform, box-shadow;
52
53
  transition-duration: var(--btn-transition-duration);
53
54
  }
54
55
 
@@ -66,7 +67,7 @@
66
67
  }*/
67
68
 
68
69
  /* Role-based styling for primary buttons */
69
- [data-component="button"][data-role="primary"] {
70
+ [data-component='button'][data-role='primary'] {
70
71
  @apply border-width-normal;
71
72
  border-color: rgb(var(--btn-primary-border));
72
73
  background-color: rgb(var(--btn-primary-bg));
@@ -90,7 +91,7 @@
90
91
  }
91
92
 
92
93
  /* Role-based styling for secondary buttons */
93
- [data-component="button"][data-role="secondary"] {
94
+ [data-component='button'][data-role='secondary'] {
94
95
  @apply border-width-normal;
95
96
  border-color: rgb(var(--btn-secondary-border));
96
97
  color: rgb(var(--btn-secondary-text));
@@ -113,23 +114,27 @@
113
114
  }
114
115
  }
115
116
 
116
- /* State-based styling */
117
- [data-component="button"].state-active {
118
- transform: var(--btn-active-transform);
119
- box-shadow: var(--btn-active-shadow);
120
- }
117
+ /* State-based styling for primary and secondary buttons */
121
118
 
122
- [data-component="button"].state-error {
123
- border-color: rgb(var(--btn-error-border));
124
- }
119
+ [data-component='button'][data-role='primary'],
120
+ [data-component='button'][data-role='secondary'] {
121
+ &.state-active {
122
+ transform: var(--btn-active-transform);
123
+ box-shadow: var(--btn-active-shadow);
124
+ }
125
125
 
126
- [data-component="button"].state-loading {
127
- opacity: var(--btn-loading-opacity);
128
- cursor: wait;
126
+ &.state-error {
127
+ border-color: rgb(var(--btn-error-border));
128
+ }
129
+
130
+ &.state-loading {
131
+ opacity: var(--btn-loading-opacity);
132
+ cursor: wait;
133
+ }
129
134
  }
130
135
 
131
136
  /* Disabled state */
132
- [data-component="button"]:disabled {
137
+ [data-component='button']:disabled {
133
138
  cursor: not-allowed;
134
139
  opacity: var(--btn-disabled-opacity);
135
140
  pointer-events: none;
@@ -0,0 +1,27 @@
1
+ @define-mixin component-panel {
2
+ [data-component='panel'] {
3
+ @apply py-30up px-40up;
4
+ @apply rounded-md;
5
+
6
+ &[data-variant='light'] {
7
+ @apply bg-surface-50;
8
+ }
9
+
10
+ &[data-variant='dark'] {
11
+ @apply bg-surface-950;
12
+ }
13
+
14
+ /* Size variants */
15
+ &[data-width='sm'] {
16
+ width: calc(400px * var(--scale-ui));
17
+ }
18
+
19
+ &[data-width='md'] {
20
+ width: calc(600px * var(--scale-ui));
21
+ }
22
+
23
+ &[data-width='lg'] {
24
+ width: calc(800px * var(--scale-ui));
25
+ }
26
+ }
27
+ }
@@ -1,8 +1,5 @@
1
1
  /* Import component styles */
2
2
 
3
- /* Panels */
4
- /*@import "./components/panels/plain-panel.css";*/
5
-
6
3
  /* Rows */
7
4
  /*@import "./components/rows/panel-grid-row.css";*/
8
5
  /*@import "./components/rows/panel-row-2.css";*/
@@ -17,24 +14,18 @@
17
14
  /* Icons */
18
15
  @import './components/icons/icon-steeze.css';
19
16
 
17
+ /* Panels */
18
+ @import './components/panels/panel.css';
19
+
20
20
  /* Inputs */
21
21
  @import './components/inputs/text-input.css';
22
22
 
23
23
  /* ... */
24
- /*@import "./components/select-level.css";*/
25
24
  @import './components/blocks/text-block.css';
26
25
 
27
- /* Not used */
28
- /*@import "./components/hk-tab-icon.css";*/
29
- /*@import "./components/avatar-layer.css";*/
30
-
31
26
  /* Wrap component styles in theme selector */
32
27
 
33
28
  [data-theme='hkdev'] {
34
- /* Panels */
35
- /* @mixin panels-plain-panel;*/
36
- /* @mixin panels-speech-bubble;*/
37
-
38
29
  /* Rows */
39
30
  /* @mixin rows-panel-grid-row;*/
40
31
  /* @mixin rows-panel-row-2;*/
@@ -47,13 +38,10 @@
47
38
 
48
39
  @mixin component-icon-steeze;
49
40
 
41
+ @mixin component-panel;
42
+
50
43
  @mixin text_block;
51
44
 
52
45
  /* Inputs */
53
46
  @mixin inputs-text-input;
54
-
55
- /* ... */
56
- /* @mixin hk_tab_icon;*/
57
- /* @mixin avatar_layer;*/
58
- /* @mixin select_level;*/
59
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-sveltekit",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -1,44 +0,0 @@
1
- /*@import "../../global/on-colors.css";*/
2
-
3
- @define-mixin panels-plain-panel {
4
- [data-panel='plain-panel'] {
5
- @mixin on_surface_light;
6
- @apply bg-primary-50;
7
-
8
- @apply p-40p rounded-md;
9
-
10
- max-width: 50vw;
11
- /* max-width: 27vw;*/
12
- /* width: 26vw; */
13
-
14
- & picture {
15
- display: block;
16
- max-width: 100%;
17
- @apply pr-80p;
18
- /* border: solid 1px red; */
19
- }
20
-
21
- & > .h1 {
22
- @apply text-32p mb-20p;
23
- }
24
-
25
- & > .p {
26
- @apply text-24p mb-10p;
27
-
28
- & + picture {
29
- @apply mt-40p;
30
- }
31
- }
32
-
33
- & button {
34
- /* @apply min-w-180p; */
35
- }
36
-
37
- & .cc_cols-stretch {
38
- @apply grid auto-cols-fr grid-flow-col;
39
- @apply justify-stretch;
40
-
41
- border: solid 8px red;
42
- }
43
- }
44
- }
@@ -1,46 +0,0 @@
1
- @import '../../global/on-colors.css';
2
-
3
- @define-mixin panels-speech-bubble {
4
- [data-panel='speech-bubble'] {
5
- @mixin on_surface_light;
6
- @apply bg-primary-50;
7
-
8
- @apply pt-20p pb-20p pr-40p pl-40p rounded-tl-lg rounded-tr-lg rounded-bl-lg;
9
-
10
- /* max-width: 26vw;*/
11
- /* width: 26vw; */
12
-
13
- &.small {
14
- max-width: 16vw;
15
- }
16
-
17
- & picture {
18
- display: block;
19
- max-width: 100%;
20
- @apply pr-80p;
21
- /* border: solid 1px red; */
22
- }
23
-
24
- & [data-section='title'] {
25
- & .h1 {
26
- @apply text-32p pt-8p pb-8p;
27
- }
28
- }
29
-
30
- & [data-section='text'] {
31
- & .p {
32
- @apply text-20p pb-10p;
33
-
34
- /*& + picture {
35
- @apply mt-40p;
36
- }*/
37
- }
38
- }
39
-
40
- /* Footer */
41
-
42
- & [data-row][data-section='footer'] {
43
- @apply pt-10p;
44
- }
45
- }
46
- }