sk-clib 1.2.0 → 1.3.0
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 +10 -49
- package/dist/docs/_layouts/bare.svelte +3 -1
- package/dist/docs/contributing/+page.svelte +17 -1
- package/dist/docs/contributing/documentation/+page.svelte +1 -1
- package/dist/docs/contributing/library/+page.svelte +1 -1
- package/dist/docs/getting_started/installation.svelte +5 -1
- package/dist/styles.css +46 -8
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/spacer/components/spacer.svelte +50 -0
- package/dist/ui/spacer/components/spacer.svelte.d.ts +17 -0
- package/dist/ui/spacer/index.d.ts +2 -0
- package/dist/ui/spacer/index.js +1 -0
- package/dist/ui/spacer/types.d.ts +7 -0
- package/dist/ui/spacer/types.js +1 -0
- package/package.json +3 -1
- package/dist/docs/contributing/documentation/sublevel/+page.svelte +0 -12
- package/dist/docs/contributing/library/other.svelte +0 -12
package/README.md
CHANGED
|
@@ -1,61 +1,22 @@
|
|
|
1
|
-
# sk-clib
|
|
1
|
+
# [sk-clib](https://treltasev.github.io/sk-clib/)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/sk-clib)
|
|
2
4
|
|
|
3
5
|
A flexible and modular component library built for my SvelteKit projects.
|
|
4
6
|
|
|
5
7
|
## 📦 Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 🔧 Usage
|
|
12
|
-
|
|
13
|
-
Once installed, you can import and use components like this:
|
|
14
|
-
|
|
15
|
-
```svelte
|
|
16
|
-
<script>
|
|
17
|
-
import { Header, Text } from 'sk-clib';
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<Header lg bold>Welp... Hi there :)</Header>
|
|
21
|
-
<Text size="lg" weight="bold">Hello World</Text>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
If you're using path aliases, make sure to configure them properly in your `tsconfig.json` or `jsconfig.json`.
|
|
25
|
-
|
|
26
|
-
## 🛠Development
|
|
27
|
-
|
|
28
|
-
To contribute or develop locally:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
bun clone https://github.com/TreltaSev/sk-clib.git
|
|
32
|
-
cd sk-clib
|
|
33
|
-
bun install
|
|
34
|
-
bun run dev
|
|
10
|
+
npm install sk-clib # Install from npmjs
|
|
35
11
|
```
|
|
36
12
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* `npm run dev` – Start development server with live preview
|
|
42
|
-
* `npm run build` – Build the library for publishing
|
|
43
|
-
* `npm run lint` – Lint codebase
|
|
44
|
-
* `npm run check` – Run type checking
|
|
45
|
-
* `npm run test` – (If applicable) Run tests
|
|
46
|
-
|
|
47
|
-
## ✅ Publishing
|
|
13
|
+
```css
|
|
14
|
+
/* app.css */
|
|
15
|
+
@import 'sk-clib/style';
|
|
48
16
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
bun run build
|
|
17
|
+
/* ... Other Styling ... */
|
|
53
18
|
```
|
|
54
19
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
bun publish
|
|
59
|
-
```
|
|
20
|
+
## 🔧 Documentation
|
|
60
21
|
|
|
61
|
-
|
|
22
|
+
Take a look at [https://treltasev.github.io/sk-clib/](https://treltasev.github.io/sk-clib/)
|
|
@@ -8,5 +8,21 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<Layout_MDSVEX_DEFAULT {...$$props} {...metadata}>
|
|
11
|
-
<p>You can choose to either contribute to the documentation or the library
|
|
11
|
+
<p>You can choose to either contribute to the documentation or the library, either way, you’ll need to cloen this repo, most likeley as a fork.</p>
|
|
12
|
+
<pre class="language-bash">{@html `<code class="language-bash">bun clone https://github.com/TreltaSev/sk-clib.git
|
|
13
|
+
<span class="token builtin class-name">cd</span> sk-clib
|
|
14
|
+
<span class="token function">npm</span> <span class="token function">install</span>
|
|
15
|
+
<span class="token function">npm</span> run dev</code>`}</pre>
|
|
16
|
+
<p>This should be enough to get you started.</p>
|
|
17
|
+
<h2>Commands</h2>
|
|
18
|
+
<ul>
|
|
19
|
+
<li><code>npm run dev</code> – Start development server with live preview</li>
|
|
20
|
+
<li><code>npm run build</code> – Build the library for publishing</li>
|
|
21
|
+
<li><code>npm run lint</code> – Lint codebase</li>
|
|
22
|
+
<li><code>npm run check</code> – Run type checking</li>
|
|
23
|
+
<li><code>npm run test</code> – (If applicable) Run tests</li>
|
|
24
|
+
</ul>
|
|
25
|
+
<h2>✅ Publishing</h2>
|
|
26
|
+
<p>Make sure everything builds correctly:</p>
|
|
27
|
+
<pre class="language-bash">{@html `<code class="language-bash"><span class="token function">npm</span> run build</code>`}</pre>
|
|
12
28
|
</Layout_MDSVEX_DEFAULT>
|
|
@@ -8,5 +8,9 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<Layout_MDSVEX_DEFAULT {...$$props} {...metadata}>
|
|
11
|
-
<pre class="language-bash">{@html `<code class="language-bash">
|
|
11
|
+
<pre class="language-bash">{@html `<code class="language-bash"><span class="token function">npm</span> <span class="token function">install</span> sk-clib <span class="token comment"># Install from npmjs</span></code>`}</pre>
|
|
12
|
+
<pre class="language-css">{@html `<code class="language-css"><span class="token comment">/* app.css */</span>
|
|
13
|
+
<span class="token atrule"><span class="token rule">@import</span> <span class="token string">'sk-clib/style'</span><span class="token punctuation">;</span></span>
|
|
14
|
+
|
|
15
|
+
<span class="token comment">/* ... Other Styling ... */</span></code>`}</pre>
|
|
12
16
|
</Layout_MDSVEX_DEFAULT>
|
package/dist/styles.css
CHANGED
|
@@ -207,6 +207,9 @@
|
|
|
207
207
|
.mt-5 {
|
|
208
208
|
margin-top: calc(var(--spacing) * 5);
|
|
209
209
|
}
|
|
210
|
+
.mb-20 {
|
|
211
|
+
margin-bottom: calc(var(--spacing) * 20);
|
|
212
|
+
}
|
|
210
213
|
.block {
|
|
211
214
|
display: block;
|
|
212
215
|
}
|
|
@@ -216,6 +219,10 @@
|
|
|
216
219
|
.aspect-square {
|
|
217
220
|
aspect-ratio: 1 / 1;
|
|
218
221
|
}
|
|
222
|
+
.size-6 {
|
|
223
|
+
width: calc(var(--spacing) * 6);
|
|
224
|
+
height: calc(var(--spacing) * 6);
|
|
225
|
+
}
|
|
219
226
|
.size-full {
|
|
220
227
|
width: 100%;
|
|
221
228
|
height: 100%;
|
|
@@ -223,9 +230,6 @@
|
|
|
223
230
|
.h-12 {
|
|
224
231
|
height: calc(var(--spacing) * 12);
|
|
225
232
|
}
|
|
226
|
-
.h-20 {
|
|
227
|
-
height: calc(var(--spacing) * 20);
|
|
228
|
-
}
|
|
229
233
|
.h-fit {
|
|
230
234
|
height: fit-content;
|
|
231
235
|
}
|
|
@@ -262,9 +266,15 @@
|
|
|
262
266
|
.justify-center {
|
|
263
267
|
justify-content: center;
|
|
264
268
|
}
|
|
269
|
+
.gap-4 {
|
|
270
|
+
gap: calc(var(--spacing) * 4);
|
|
271
|
+
}
|
|
265
272
|
.overflow-y-auto {
|
|
266
273
|
overflow-y: auto;
|
|
267
274
|
}
|
|
275
|
+
.scroll-smooth {
|
|
276
|
+
scroll-behavior: smooth;
|
|
277
|
+
}
|
|
268
278
|
.rounded-md {
|
|
269
279
|
border-radius: var(--radius-md);
|
|
270
280
|
}
|
|
@@ -334,9 +344,18 @@
|
|
|
334
344
|
--tw-font-weight: var(--font-weight-semibold);
|
|
335
345
|
font-weight: var(--font-weight-semibold);
|
|
336
346
|
}
|
|
347
|
+
.whitespace-nowrap {
|
|
348
|
+
white-space: nowrap;
|
|
349
|
+
}
|
|
337
350
|
.text-white {
|
|
338
351
|
color: var(--color-white);
|
|
339
352
|
}
|
|
353
|
+
.text-white\/40 {
|
|
354
|
+
color: color-mix(in srgb, #fff 40%, transparent);
|
|
355
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
356
|
+
color: color-mix(in oklab, var(--color-white) 40%, transparent);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
340
359
|
.text-white\/80 {
|
|
341
360
|
color: color-mix(in srgb, #fff 80%, transparent);
|
|
342
361
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -346,6 +365,17 @@
|
|
|
346
365
|
.italic {
|
|
347
366
|
font-style: italic;
|
|
348
367
|
}
|
|
368
|
+
.duration-200 {
|
|
369
|
+
--tw-duration: 200ms;
|
|
370
|
+
transition-duration: 200ms;
|
|
371
|
+
}
|
|
372
|
+
.hover\:text-white\/100 {
|
|
373
|
+
&:hover {
|
|
374
|
+
@media (hover: hover) {
|
|
375
|
+
color: var(--color-white);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
349
379
|
.data-\[state\=toggled\]\:bg-black {
|
|
350
380
|
&[data-state="toggled"] {
|
|
351
381
|
background-color: var(--color-black);
|
|
@@ -358,7 +388,7 @@
|
|
|
358
388
|
}
|
|
359
389
|
}
|
|
360
390
|
@layer base {
|
|
361
|
-
html,
|
|
391
|
+
html, body {
|
|
362
392
|
width: 100%;
|
|
363
393
|
height: 100%;
|
|
364
394
|
overflow-y: auto;
|
|
@@ -370,11 +400,14 @@
|
|
|
370
400
|
font-size: calc(var(--spacing) * 8);
|
|
371
401
|
color: var(--color-primary);
|
|
372
402
|
}
|
|
373
|
-
h1 {
|
|
374
|
-
color: var(--color-primary);
|
|
375
|
-
}
|
|
376
|
-
h2 {
|
|
403
|
+
h1, h2, h3, h4, h5, h6 {
|
|
377
404
|
color: var(--color-gray-400);
|
|
405
|
+
margin-top: calc((var(--spacing) * 5));
|
|
406
|
+
}
|
|
407
|
+
pre {
|
|
408
|
+
display: flex;
|
|
409
|
+
flex-shrink: 0;
|
|
410
|
+
max-height: 20vh;
|
|
378
411
|
}
|
|
379
412
|
}
|
|
380
413
|
@property --tw-border-style {
|
|
@@ -386,11 +419,16 @@
|
|
|
386
419
|
syntax: "*";
|
|
387
420
|
inherits: false;
|
|
388
421
|
}
|
|
422
|
+
@property --tw-duration {
|
|
423
|
+
syntax: "*";
|
|
424
|
+
inherits: false;
|
|
425
|
+
}
|
|
389
426
|
@layer properties {
|
|
390
427
|
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
391
428
|
*, ::before, ::after, ::backdrop {
|
|
392
429
|
--tw-border-style: solid;
|
|
393
430
|
--tw-font-weight: initial;
|
|
431
|
+
--tw-duration: initial;
|
|
394
432
|
}
|
|
395
433
|
}
|
|
396
434
|
}
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { default as Button } from "./button/components/button.svelte";
|
|
|
2
2
|
export { default as Flex } from "./flex/components/flex.svelte";
|
|
3
3
|
export { default as Frame } from "./frame/components/frame.svelte";
|
|
4
4
|
export { default as Header } from "./header/components/header.svelte";
|
|
5
|
+
export { default as Spacer } from "./spacer/components/spacer.svelte";
|
|
5
6
|
export { default as Text } from "./text/components/text.svelte";
|
package/dist/ui/index.js
CHANGED
|
@@ -5,4 +5,5 @@ export { default as Button } from "./button/components/button.svelte";
|
|
|
5
5
|
export { default as Flex } from "./flex/components/flex.svelte";
|
|
6
6
|
export { default as Frame } from "./frame/components/frame.svelte";
|
|
7
7
|
export { default as Header } from "./header/components/header.svelte";
|
|
8
|
+
export { default as Spacer } from "./spacer/components/spacer.svelte";
|
|
8
9
|
export { default as Text } from "./text/components/text.svelte";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// --- Logic ---
|
|
3
|
+
import { cn, Tokenizer } from '../../../utils';
|
|
4
|
+
import type { Props } from '..';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
children,
|
|
8
|
+
class: className,
|
|
9
|
+
|
|
10
|
+
// Horizontal / Vertical
|
|
11
|
+
horizontal = $bindable(undefined),
|
|
12
|
+
vertical = $bindable(undefined),
|
|
13
|
+
|
|
14
|
+
// Width / Height
|
|
15
|
+
width = $bindable(undefined),
|
|
16
|
+
height = $bindable(undefined),
|
|
17
|
+
|
|
18
|
+
// Catch-alls
|
|
19
|
+
...rest
|
|
20
|
+
}: Props = $props();
|
|
21
|
+
|
|
22
|
+
const tokenInstance = new Tokenizer(className);
|
|
23
|
+
|
|
24
|
+
// Horizontal / Vertical
|
|
25
|
+
tokenInstance.addTokenIf(horizontal || width, 'w-full');
|
|
26
|
+
tokenInstance.addTokenIf(vertical || height, 'h-full');
|
|
27
|
+
|
|
28
|
+
if ([horizontal, vertical, width, height].every((val) => val === undefined)) {
|
|
29
|
+
tokenInstance.addTokenIf(true, 'size-full');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<div class={cn(tokenInstance.className)} {...rest}>
|
|
35
|
+
{@render children?.()}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<!--@component
|
|
39
|
+
---
|
|
40
|
+
name: Spacer
|
|
41
|
+
props:
|
|
42
|
+
horizontal (undefined|boolean) = undefined: Expands the component to the most width it can occupy
|
|
43
|
+
vertical (undefined|boolean) = undefined: Expands the component to the most height it can occupy
|
|
44
|
+
width (undefined|boolean) = undefined: Expands the component to the most width it can occupy
|
|
45
|
+
height (undefined|boolean) = undefined: Expands the component to the most height it can occupy
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
Element that is soley made to fill in space. If nothing is passed, assumes 'size-full',
|
|
49
|
+
otherwise, it fills the direction you tell it to.
|
|
50
|
+
-->
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Props } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* ---
|
|
4
|
+
* name: Spacer
|
|
5
|
+
* props:
|
|
6
|
+
* horizontal (undefined|boolean) = undefined: Expands the component to the most width it can occupy
|
|
7
|
+
* vertical (undefined|boolean) = undefined: Expands the component to the most height it can occupy
|
|
8
|
+
* width (undefined|boolean) = undefined: Expands the component to the most width it can occupy
|
|
9
|
+
* height (undefined|boolean) = undefined: Expands the component to the most height it can occupy
|
|
10
|
+
* ---
|
|
11
|
+
*
|
|
12
|
+
* Element that is soley made to fill in space. If nothing is passed, assumes 'size-full',
|
|
13
|
+
* otherwise, it fills the direction you tell it to.
|
|
14
|
+
*/
|
|
15
|
+
declare const Spacer: import("svelte").Component<Props, {}, "horizontal" | "vertical" | "width" | "height">;
|
|
16
|
+
type Spacer = ReturnType<typeof Spacer>;
|
|
17
|
+
export default Spacer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as _, default as Root } from "./components/spacer.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sk-clib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"svelte": "^5.0.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@iconify-json/mdi": "^1.2.3",
|
|
45
46
|
"@sveltejs/kit": "^2.0.0",
|
|
46
47
|
"@sveltejs/package": "^2.0.0",
|
|
47
48
|
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"svelte": "^5.0.0",
|
|
56
57
|
"svelte-check": "^4.0.0",
|
|
57
58
|
"typescript": "^5.0.0",
|
|
59
|
+
"unplugin-icons": "^22.1.0",
|
|
58
60
|
"vite": "^6.2.6"
|
|
59
61
|
},
|
|
60
62
|
"keywords": [
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
export const metadata = {"title":"This is a sub level","order":6};
|
|
3
|
-
const { title, order } = metadata;
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<script>
|
|
7
|
-
import Layout_MDSVEX_DEFAULT from '/home/runner/work/sk-clib/sk-clib/src/lib/docs/_layouts/bare.svelte';
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<Layout_MDSVEX_DEFAULT {...$$props} {...metadata}>
|
|
11
|
-
<p>This is a dope sub level</p>
|
|
12
|
-
</Layout_MDSVEX_DEFAULT>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script context="module">
|
|
2
|
-
export const metadata = {"title":"Other Doc Key","order":2};
|
|
3
|
-
const { title, order } = metadata;
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<script>
|
|
7
|
-
import Layout_MDSVEX_DEFAULT from '/home/runner/work/sk-clib/sk-clib/src/lib/docs/_layouts/bare.svelte';
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<Layout_MDSVEX_DEFAULT {...$$props} {...metadata}>
|
|
11
|
-
<p> sma lama duma</p>
|
|
12
|
-
</Layout_MDSVEX_DEFAULT>
|