sk-clib 1.2.0 → 1.4.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
@@ -1,4 +1,4 @@
1
- /*! tailwindcss v4.1.7 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.1.8 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
4
  @layer theme {
@@ -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);
@@ -357,26 +387,6 @@
357
387
  }
358
388
  }
359
389
  }
360
- @layer base {
361
- html, body {
362
- width: 100%;
363
- height: 100%;
364
- overflow-y: auto;
365
- background-color: var(--color-surface-2);
366
- }
367
- }
368
- @layer docs {
369
- header {
370
- font-size: calc(var(--spacing) * 8);
371
- color: var(--color-primary);
372
- }
373
- h1 {
374
- color: var(--color-primary);
375
- }
376
- h2 {
377
- color: var(--color-gray-400);
378
- }
379
- }
380
390
  @property --tw-border-style {
381
391
  syntax: "*";
382
392
  inherits: false;
@@ -386,11 +396,16 @@
386
396
  syntax: "*";
387
397
  inherits: false;
388
398
  }
399
+ @property --tw-duration {
400
+ syntax: "*";
401
+ inherits: false;
402
+ }
389
403
  @layer properties {
390
404
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
391
405
  *, ::before, ::after, ::backdrop {
392
406
  --tw-border-style: solid;
393
407
  --tw-font-weight: initial;
408
+ --tw-duration: initial;
394
409
  }
395
410
  }
396
411
  }
@@ -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.2.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -27,7 +27,7 @@
27
27
  "**/*.css"
28
28
  ],
29
29
  "scripts": {
30
- "build": "svelte-package && npx tailwindcss -i ./src/app.css -o ./dist/styles.css",
30
+ "build": "svelte-package && npm run css_build",
31
31
  "webbuild": "vite build",
32
32
  "prepublishOnly": "npm run build && publint --skip-pack",
33
33
  "dev": "vite dev",
@@ -35,13 +35,15 @@
35
35
  "check": "svelte-check --tsconfig ./tsconfig.json",
36
36
  "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
37
37
  "format": "prettier --write .",
38
- "lint": "prettier --check . && eslint ."
38
+ "lint": "prettier --check . && eslint .",
39
+ "css_build": "npx tailwindcss -i ./src/library.css -o ./dist/styles.css"
39
40
  },
40
41
  "peerDependencies": {
41
42
  "@sveltejs/kit": "^2.0.0",
42
43
  "svelte": "^5.0.0"
43
44
  },
44
45
  "devDependencies": {
46
+ "@iconify-json/mdi": "^1.2.3",
45
47
  "@sveltejs/kit": "^2.0.0",
46
48
  "@sveltejs/package": "^2.0.0",
47
49
  "@sveltejs/vite-plugin-svelte": "^5.0.0",
@@ -55,6 +57,7 @@
55
57
  "svelte": "^5.0.0",
56
58
  "svelte-check": "^4.0.0",
57
59
  "typescript": "^5.0.0",
60
+ "unplugin-icons": "^22.1.0",
58
61
  "vite": "^6.2.6"
59
62
  },
60
63
  "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>