sk-clib 1.1.2 → 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 CHANGED
@@ -1,61 +1,22 @@
1
- # sk-clib
1
+ # [sk-clib](https://treltasev.github.io/sk-clib/)
2
+
3
+ [![NPM](https://img.shields.io/badge/NPM-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white)](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
- bun install sk-clib
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
- This will launch the SvelteKit dev environment so you can view and test components live.
38
-
39
- ### Commands
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
- Make sure everything builds correctly:
50
-
51
- ```bash
52
- bun run build
17
+ /* ... Other Styling ... */
53
18
  ```
54
19
 
55
- Then publish:
56
-
57
- ```bash
58
- bun publish
59
- ```
20
+ ## 🔧 Documentation
60
21
 
61
- > Ensure your version is bumped and `package.json` is clean of any local dependencies before publishing.
22
+ Take a look at [https://treltasev.github.io/sk-clib/](https://treltasev.github.io/sk-clib/)
@@ -7,6 +7,8 @@
7
7
  } = $props();
8
8
  </script>
9
9
 
10
- <Header xl class="mt-5" id={`${prev}`}>{title}</Header>
10
+ <a href={`#${prev}`}>
11
+ <Header xxl class="mt-5" id={`${prev}`}>{title}</Header>
12
+ </a>
11
13
 
12
14
  {@render children?.()}
@@ -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</p>
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,5 @@
8
8
  </script>
9
9
 
10
10
  <Layout_MDSVEX_DEFAULT {...$$props} {...metadata}>
11
- <p>So, you want to contribute to the documentation?</p>
11
+ <p>Just add ’[release]’ to your commit message and push to main.</p>
12
12
  </Layout_MDSVEX_DEFAULT>
@@ -8,5 +8,5 @@
8
8
  </script>
9
9
 
10
10
  <Layout_MDSVEX_DEFAULT {...$$props} {...metadata}>
11
- <p>So, you want to contribute to the library?</p>
11
+ <p>Push to production branch</p>
12
12
  </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">bun <span class="token function">install</span> sk-clib</code>`}</pre>
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,8 +207,8 @@
207
207
  .mt-5 {
208
208
  margin-top: calc(var(--spacing) * 5);
209
209
  }
210
- .mt-20 {
211
- margin-top: calc(var(--spacing) * 20);
210
+ .mb-20 {
211
+ margin-bottom: calc(var(--spacing) * 20);
212
212
  }
213
213
  .block {
214
214
  display: block;
@@ -219,6 +219,10 @@
219
219
  .aspect-square {
220
220
  aspect-ratio: 1 / 1;
221
221
  }
222
+ .size-6 {
223
+ width: calc(var(--spacing) * 6);
224
+ height: calc(var(--spacing) * 6);
225
+ }
222
226
  .size-full {
223
227
  width: 100%;
224
228
  height: 100%;
@@ -226,6 +230,9 @@
226
230
  .h-12 {
227
231
  height: calc(var(--spacing) * 12);
228
232
  }
233
+ .h-fit {
234
+ height: fit-content;
235
+ }
229
236
  .h-full {
230
237
  height: 100%;
231
238
  }
@@ -259,11 +266,14 @@
259
266
  .justify-center {
260
267
  justify-content: center;
261
268
  }
262
- .gap-0 {
263
- gap: calc(var(--spacing) * 0);
269
+ .gap-4 {
270
+ gap: calc(var(--spacing) * 4);
271
+ }
272
+ .overflow-y-auto {
273
+ overflow-y: auto;
264
274
  }
265
- .gap-5 {
266
- gap: calc(var(--spacing) * 5);
275
+ .scroll-smooth {
276
+ scroll-behavior: smooth;
267
277
  }
268
278
  .rounded-md {
269
279
  border-radius: var(--radius-md);
@@ -281,9 +291,6 @@
281
291
  .bg-surface-0 {
282
292
  background-color: var(--color-surface-0);
283
293
  }
284
- .bg-surface-2 {
285
- background-color: var(--color-surface-2);
286
- }
287
294
  .px-4 {
288
295
  padding-inline: calc(var(--spacing) * 4);
289
296
  }
@@ -337,9 +344,18 @@
337
344
  --tw-font-weight: var(--font-weight-semibold);
338
345
  font-weight: var(--font-weight-semibold);
339
346
  }
347
+ .whitespace-nowrap {
348
+ white-space: nowrap;
349
+ }
340
350
  .text-white {
341
351
  color: var(--color-white);
342
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
+ }
343
359
  .text-white\/80 {
344
360
  color: color-mix(in srgb, #fff 80%, transparent);
345
361
  @supports (color: color-mix(in lab, red, red)) {
@@ -349,6 +365,17 @@
349
365
  .italic {
350
366
  font-style: italic;
351
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
+ }
352
379
  .data-\[state\=toggled\]\:bg-black {
353
380
  &[data-state="toggled"] {
354
381
  background-color: var(--color-black);
@@ -361,9 +388,11 @@
361
388
  }
362
389
  }
363
390
  @layer base {
364
- html, body {
391
+ html, body {
365
392
  width: 100%;
366
393
  height: 100%;
394
+ overflow-y: auto;
395
+ background-color: var(--color-surface-2);
367
396
  }
368
397
  }
369
398
  @layer docs {
@@ -371,11 +400,14 @@
371
400
  font-size: calc(var(--spacing) * 8);
372
401
  color: var(--color-primary);
373
402
  }
374
- h1 {
375
- color: var(--color-primary);
376
- }
377
- h2 {
403
+ h1, h2, h3, h4, h5, h6 {
378
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;
379
411
  }
380
412
  }
381
413
  @property --tw-border-style {
@@ -387,11 +419,16 @@
387
419
  syntax: "*";
388
420
  inherits: false;
389
421
  }
422
+ @property --tw-duration {
423
+ syntax: "*";
424
+ inherits: false;
425
+ }
390
426
  @layer properties {
391
427
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
392
428
  *, ::before, ::after, ::backdrop {
393
429
  --tw-border-style: solid;
394
430
  --tw-font-weight: initial;
431
+ --tw-duration: initial;
395
432
  }
396
433
  }
397
434
  }
@@ -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,2 @@
1
+ export { default as _, default as Root } from "./components/spacer.svelte";
2
+ export type { tSpacerProps as Props, } from "./types";
@@ -0,0 +1 @@
1
+ export { default as _, default as Root } from "./components/spacer.svelte";
@@ -0,0 +1,7 @@
1
+ import type { HTMLAttributes } from 'svelte/elements';
2
+ export type tSpacerProps = HTMLAttributes<HTMLDivElement> & {
3
+ horizontal?: boolean;
4
+ vertical?: boolean;
5
+ width?: boolean;
6
+ height?: boolean;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sk-clib",
3
- "version": "1.1.2",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -28,6 +28,7 @@
28
28
  ],
29
29
  "scripts": {
30
30
  "build": "svelte-package && npx tailwindcss -i ./src/app.css -o ./dist/styles.css",
31
+ "webbuild": "vite build",
31
32
  "prepublishOnly": "npm run build && publint --skip-pack",
32
33
  "dev": "vite dev",
33
34
  "preview": "vite preview",
@@ -41,6 +42,7 @@
41
42
  "svelte": "^5.0.0"
42
43
  },
43
44
  "devDependencies": {
45
+ "@iconify-json/mdi": "^1.2.3",
44
46
  "@sveltejs/kit": "^2.0.0",
45
47
  "@sveltejs/package": "^2.0.0",
46
48
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
@@ -54,6 +56,7 @@
54
56
  "svelte": "^5.0.0",
55
57
  "svelte-check": "^4.0.0",
56
58
  "typescript": "^5.0.0",
59
+ "unplugin-icons": "^22.1.0",
57
60
  "vite": "^6.2.6"
58
61
  },
59
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>