sk-clib 1.19.0 → 2.0.4
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 +12 -32
- package/dist/index.d.ts +0 -2
- package/dist/index.js +2 -2
- package/dist/theme/index.d.ts +3 -4
- package/dist/theme/index.js +3 -7
- package/dist/theme/logic.d.ts +23 -3
- package/dist/theme/logic.js +74 -71
- package/dist/theme/theme-init/components/theme-init.svelte +1 -19
- package/dist/theme/theme-init/components/theme-init.svelte.d.ts +4 -14
- package/dist/theme/theme.css +162 -0
- package/dist/theme/types.d.ts +4 -15
- package/dist/theme/types.js +9 -10
- package/dist/ui/button/components/button.svelte +3 -3
- package/dist/ui/button/components/button.svelte.d.ts +4 -14
- package/dist/ui/flex/components/flex.svelte +1 -1
- package/dist/ui/flex/components/flex.svelte.d.ts +4 -14
- package/dist/ui/frame/components/frame.svelte +1 -1
- package/dist/ui/frame/components/frame.svelte.d.ts +4 -14
- package/dist/ui/index.d.ts +0 -2
- package/dist/ui/index.js +0 -1
- package/dist/ui/input/components/input.svelte +2 -1
- package/dist/ui/input/components/input.svelte.d.ts +4 -14
- package/dist/ui/spacer/components/spacer.svelte +1 -1
- package/dist/ui/spacer/components/spacer.svelte.d.ts +4 -14
- package/dist/ui/text/components/text.svelte +1 -1
- package/dist/ui/text/components/text.svelte.d.ts +4 -14
- package/dist/{utils.d.ts → utils/classname.d.ts} +0 -9
- package/dist/{utils.js → utils/classname.js} +0 -21
- package/dist/utils/crypto.d.ts +1 -0
- package/dist/utils/crypto.js +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/number.d.ts +8 -0
- package/dist/utils/number.js +10 -0
- package/dist/utils/string.d.ts +18 -0
- package/dist/utils/string.js +28 -0
- package/package.json +35 -48
- package/dist/assets/favicon.svg +0 -1
- package/dist/styles.css +0 -1152
- package/dist/ui/header/components/header.svelte +0 -147
- package/dist/ui/header/components/header.svelte.d.ts +0 -52
- package/dist/ui/header/index.d.ts +0 -2
- package/dist/ui/header/index.js +0 -1
- package/dist/ui/header/types.d.ts +0 -31
- package/dist/ui/header/types.js +0 -1
- /package/dist/theme/{stores.svelte.d.ts → state.svelte.d.ts} +0 -0
- /package/dist/theme/{stores.svelte.js → state.svelte.js} +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
// --- Logic ---
|
|
3
|
-
import { cn, Tokenizer } from '../../../utils';
|
|
4
|
-
import { type Props } from '..';
|
|
5
|
-
|
|
6
|
-
// Size Class Lookup Table
|
|
7
|
-
const sizeClasses = {
|
|
8
|
-
xxl: 'text-2xl',
|
|
9
|
-
xl: 'text-xl',
|
|
10
|
-
lg: 'text-lg',
|
|
11
|
-
md: 'text-base',
|
|
12
|
-
sm: 'text-sm'
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
// Semantic Sizes Lookup Table
|
|
16
|
-
const semanticSizes = {
|
|
17
|
-
xxl: 'h1',
|
|
18
|
-
xl: 'h2',
|
|
19
|
-
lg: 'h3',
|
|
20
|
-
md: 'h4',
|
|
21
|
-
sm: 'h5'
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// Weight Classes Lookup Table
|
|
25
|
-
const weightClasses = {
|
|
26
|
-
extrabold: 'font-extrabold',
|
|
27
|
-
bold: 'font-bold',
|
|
28
|
-
semibold: 'font-semibold',
|
|
29
|
-
regular: 'font-normal',
|
|
30
|
-
light: 'font-light'
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
let {
|
|
34
|
-
children,
|
|
35
|
-
class: className = $bindable(undefined),
|
|
36
|
-
|
|
37
|
-
// Sizing
|
|
38
|
-
size = 'md', // Catch All
|
|
39
|
-
xxl,
|
|
40
|
-
xl,
|
|
41
|
-
lg,
|
|
42
|
-
md,
|
|
43
|
-
sm,
|
|
44
|
-
|
|
45
|
-
// Weights
|
|
46
|
-
weight = 'regular', // Catch All
|
|
47
|
-
extrabold,
|
|
48
|
-
bold,
|
|
49
|
-
semibold,
|
|
50
|
-
regular,
|
|
51
|
-
light,
|
|
52
|
-
|
|
53
|
-
// Semantic Element
|
|
54
|
-
as = undefined, // Catchall
|
|
55
|
-
|
|
56
|
-
// Italics
|
|
57
|
-
em,
|
|
58
|
-
|
|
59
|
-
...rest
|
|
60
|
-
}: Props = $props();
|
|
61
|
-
|
|
62
|
-
const tokenInstance = new Tokenizer(className);
|
|
63
|
-
|
|
64
|
-
// === Catch All statements should be applied first ===
|
|
65
|
-
|
|
66
|
-
// Apply Size Class
|
|
67
|
-
tokenInstance.addTokenIf(true, sizeClasses[size] ?? 'text-base');
|
|
68
|
-
|
|
69
|
-
// Apply Weight Class
|
|
70
|
-
tokenInstance.addTokenIf(true, weightClasses[weight] ?? 'font-normal');
|
|
71
|
-
|
|
72
|
-
// Sizing Tokens
|
|
73
|
-
tokenInstance.addTokenIf(xxl, 'text-2xl');
|
|
74
|
-
tokenInstance.addTokenIf(xl, 'text-xl');
|
|
75
|
-
tokenInstance.addTokenIf(lg, 'text-lg');
|
|
76
|
-
tokenInstance.addTokenIf(md, 'text-base');
|
|
77
|
-
tokenInstance.addTokenIf(sm, 'text-sm');
|
|
78
|
-
|
|
79
|
-
function determineSemanticViaSize() {
|
|
80
|
-
// Go in order of importance, top-down
|
|
81
|
-
if (xxl) return 'h1';
|
|
82
|
-
if (xl) return 'h2';
|
|
83
|
-
if (lg) return 'h3';
|
|
84
|
-
if (md) return 'h4';
|
|
85
|
-
if (sm) return 'h5';
|
|
86
|
-
|
|
87
|
-
// Fallback to size prop
|
|
88
|
-
return semanticSizes[size] ?? 'span';
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Weight Tokens
|
|
92
|
-
tokenInstance.addTokenIf(extrabold, 'font-extrabold');
|
|
93
|
-
tokenInstance.addTokenIf(bold, 'font-bold');
|
|
94
|
-
tokenInstance.addTokenIf(semibold, 'font-semibold');
|
|
95
|
-
tokenInstance.addTokenIf(regular, 'font-normal');
|
|
96
|
-
tokenInstance.addTokenIf(light, 'font-light');
|
|
97
|
-
|
|
98
|
-
// Italic Token
|
|
99
|
-
tokenInstance.addTokenIf(em, 'italic');
|
|
100
|
-
|
|
101
|
-
// Determine Semantic Tag
|
|
102
|
-
let semanticTag = as ?? determineSemanticViaSize();
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<svelte:element this={semanticTag} class={cn(tokenInstance.className)} {...rest}>
|
|
106
|
-
{@render children?.()}
|
|
107
|
-
</svelte:element>
|
|
108
|
-
|
|
109
|
-
<!--@component
|
|
110
|
-
Generated by SvelteForge🔥
|
|
111
|
-
|
|
112
|
-
# Header Component
|
|
113
|
-
A semantic and styled heading component that combines typography flexibility with accessible HTML.
|
|
114
|
-
|
|
115
|
-
This component maps `size` values to both Tailwind classes and semantic tags (`h1`–`h5`),
|
|
116
|
-
while also allowing direct override with the `as` prop for full control.
|
|
117
|
-
|
|
118
|
-
## Props
|
|
119
|
-
|
|
120
|
-
- `size`: `"xxl" | "xl" | "lg" | "md" | "sm"` — sets both font size and default semantic tag.
|
|
121
|
-
- `as`: `"h1" | "h2" | "h3" | "h4" | "h5" | "span"` — override the default semantic tag.
|
|
122
|
-
- `weight`: `"extrabold" | "bold" | "semibold" | "regular" | "light"` — font-weight control.
|
|
123
|
-
- `xxl`, `xl`, `lg`, `md`, `sm`: boolean shorthands to set font size via token (overrides `size`).
|
|
124
|
-
- `extrabold`, `bold`, `semibold`, `regular`, `light`: boolean shorthands to set weight (overrides `weight`).
|
|
125
|
-
- `em`: boolean — italicizes the text.
|
|
126
|
-
- `class`: Tailwind utility classes to append additional styling.
|
|
127
|
-
- `children`: Rendered content of the header.
|
|
128
|
-
|
|
129
|
-
## Example
|
|
130
|
-
|
|
131
|
-
```svelte
|
|
132
|
-
<Header size="xl" weight="semibold">
|
|
133
|
-
Dashboard
|
|
134
|
-
</Header>
|
|
135
|
-
|
|
136
|
-
<Header lg bold em>
|
|
137
|
-
Welcome Back!
|
|
138
|
-
</Header>
|
|
139
|
-
|
|
140
|
-
<Header size="md" as="h2">
|
|
141
|
-
Settings
|
|
142
|
-
</Header>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Defaults to a `h4` tag (`md` size) with `regular` weight if not specified.
|
|
146
|
-
-->
|
|
147
|
-
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: Record<string, never>;
|
|
4
|
-
events: {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
};
|
|
7
|
-
slots: {};
|
|
8
|
-
};
|
|
9
|
-
export type HeaderProps = typeof __propDef.props;
|
|
10
|
-
export type HeaderEvents = typeof __propDef.events;
|
|
11
|
-
export type HeaderSlots = typeof __propDef.slots;
|
|
12
|
-
/**
|
|
13
|
-
* Generated by SvelteForge🔥
|
|
14
|
-
*
|
|
15
|
-
* # Header Component
|
|
16
|
-
* A semantic and styled heading component that combines typography flexibility with accessible HTML.
|
|
17
|
-
*
|
|
18
|
-
* This component maps `size` values to both Tailwind classes and semantic tags (`h1`–`h5`),
|
|
19
|
-
* while also allowing direct override with the `as` prop for full control.
|
|
20
|
-
*
|
|
21
|
-
* ## Props
|
|
22
|
-
*
|
|
23
|
-
* - `size`: `"xxl" | "xl" | "lg" | "md" | "sm"` — sets both font size and default semantic tag.
|
|
24
|
-
* - `as`: `"h1" | "h2" | "h3" | "h4" | "h5" | "span"` — override the default semantic tag.
|
|
25
|
-
* - `weight`: `"extrabold" | "bold" | "semibold" | "regular" | "light"` — font-weight control.
|
|
26
|
-
* - `xxl`, `xl`, `lg`, `md`, `sm`: boolean shorthands to set font size via token (overrides `size`).
|
|
27
|
-
* - `extrabold`, `bold`, `semibold`, `regular`, `light`: boolean shorthands to set weight (overrides `weight`).
|
|
28
|
-
* - `em`: boolean — italicizes the text.
|
|
29
|
-
* - `class`: Tailwind utility classes to append additional styling.
|
|
30
|
-
* - `children`: Rendered content of the header.
|
|
31
|
-
*
|
|
32
|
-
* ## Example
|
|
33
|
-
*
|
|
34
|
-
* ```svelte
|
|
35
|
-
* <Header size="xl" weight="semibold">
|
|
36
|
-
* Dashboard
|
|
37
|
-
* </Header>
|
|
38
|
-
*
|
|
39
|
-
* <Header lg bold em>
|
|
40
|
-
* Welcome Back!
|
|
41
|
-
* </Header>
|
|
42
|
-
*
|
|
43
|
-
* <Header size="md" as="h2">
|
|
44
|
-
* Settings
|
|
45
|
-
* </Header>
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
* Defaults to a `h4` tag (`md` size) with `regular` weight if not specified.
|
|
49
|
-
*/
|
|
50
|
-
export default class Header extends SvelteComponentTyped<HeaderProps, HeaderEvents, HeaderSlots> {
|
|
51
|
-
}
|
|
52
|
-
export {};
|
package/dist/ui/header/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as _, default as Root } from "./components/header.svelte";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
export type tHeaderSizes = {
|
|
3
|
-
xxl: 'h1';
|
|
4
|
-
xl: 'h2';
|
|
5
|
-
lg: 'h3';
|
|
6
|
-
md: 'h4';
|
|
7
|
-
sm: 'h5';
|
|
8
|
-
};
|
|
9
|
-
export type tHeaderWeights = {
|
|
10
|
-
light: 'font-light';
|
|
11
|
-
regular: 'font-normal';
|
|
12
|
-
semibold: 'font-semibold';
|
|
13
|
-
bold: 'font-bold';
|
|
14
|
-
extrabold: 'font-extrabold';
|
|
15
|
-
};
|
|
16
|
-
export type tHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
17
|
-
size?: keyof tHeaderSizes;
|
|
18
|
-
xxl?: boolean;
|
|
19
|
-
xl?: boolean;
|
|
20
|
-
lg?: boolean;
|
|
21
|
-
md?: boolean;
|
|
22
|
-
sm?: boolean;
|
|
23
|
-
as?: tHeaderSizes[keyof tHeaderSizes];
|
|
24
|
-
weight?: keyof tHeaderWeights;
|
|
25
|
-
extrabold?: boolean;
|
|
26
|
-
bold?: boolean;
|
|
27
|
-
semibold?: boolean;
|
|
28
|
-
regular?: boolean;
|
|
29
|
-
light?: boolean;
|
|
30
|
-
em?: boolean;
|
|
31
|
-
};
|
package/dist/ui/header/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|