@slexkit/components-svelte 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Simgor001
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # @slexkit/components-svelte
2
+
3
+ Official Svelte component registration for SlexKit.
4
+
5
+ This package re-exports `slexkit/components-svelte` and auto-registers all built-in components on import. It is not a standalone physical package — install `slexkit` alongside it.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install slexkit @slexkit/runtime @slexkit/components-svelte @slexkit/theme-shadcn
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```js
16
+ import { mount } from "@slexkit/runtime";
17
+ import "@slexkit/components-svelte";
18
+ import "@slexkit/theme-shadcn/style.css";
19
+
20
+ mount({
21
+ namespace: "demo",
22
+ g: { count: 0 },
23
+ layout: {
24
+ "text:label": { "$content": "'Count: ' + g.count" },
25
+ "button:add": { text: "+1", onclick: "g.count++" },
26
+ },
27
+ }, document.getElementById("app"));
28
+ ```
29
+
30
+ The import side-effect registers all 28 built-in Svelte components into the global runtime registry.
31
+
32
+ ## Component list
33
+
34
+ | Category | Components |
35
+ |----------|------------|
36
+ | **Layout** | `column`, `row`, `grid`, `card`, `section` |
37
+ | **Content** | `badge`, `callout`, `code-block`, `divider`, `link`, `table` |
38
+ | **Display** | `stat`, `text` |
39
+ | **Action** | `button`, `submit` |
40
+ | **Input** | `input`, `select`, `switch`, `checkbox`, `slider`, `radio-group` |
41
+ | **Navigation** | `tabs` |
42
+ | **Disclosure** | `accordion`, `collapsible` |
43
+ | **Feedback** | `progress`, `toast` |
44
+ | **Tooling** | `playground`, `icon` |
45
+
46
+ All components support the shadcn/ui design token theme when using `@slexkit/theme-shadcn`. Components also support Phosphor Icons and custom icon registration via the icon system API.
47
+
48
+ ## Manual registration
49
+
50
+ If you need a subset, import and register manually:
51
+
52
+ ```js
53
+ import { mount, register, getRenderer } from "@slexkit/runtime";
54
+ import { registerSubset } from "@slexkit/components-svelte";
55
+
56
+ // Register only layout and display components
57
+ registerSubset(["column", "row", "grid", "card", "text", "stat"]);
58
+ ```
59
+
60
+ Add a custom component alongside the built-ins:
61
+
62
+ ```js
63
+ import { registerSvelteComponent } from "@slexkit/components-svelte";
64
+ import MyComponent from "./MyComponent.svelte";
65
+
66
+ registerSvelteComponent("my-component", MyComponent, { state: "value" });
67
+ ```
68
+
69
+ ## Theming
70
+
71
+ ```js
72
+ import "@slexkit/theme-shadcn/style.css"; // theme + all components
73
+ import "@slexkit/theme-shadcn/base.css"; // theme only (no component styles)
74
+ import "@slexkit/theme-shadcn/components/button.css"; // individual component
75
+ ```
76
+
77
+ ## Documentation
78
+
79
+ - [SlexKit Components docs](https://slexkit.pages.dev/docs/components/accordion)
80
+ - [Icon system](https://github.com/slexkit/slexkit/blob/main/site/content/reference/icons/en-US.md)
81
+ - [Package boundaries](https://github.com/slexkit/slexkit/blob/main/site/content/reference/packages/en-US.md)
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export {
2
+ registerAll,
3
+ registerSvelteComponent,
4
+ registerSubset,
5
+ } from "slexkit/components-svelte";
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export {
2
+ registerAll,
3
+ registerSvelteComponent,
4
+ registerSubset,
5
+ } from "slexkit/components";
6
+
7
+ import "slexkit/components";
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@slexkit/components-svelte",
3
+ "version": "0.2.0",
4
+ "description": "Official Svelte component registrations for SlexKit.",
5
+ "author": "SlexKit contributors",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/slexkit/slexkit.git",
10
+ "directory": "packages/components-svelte"
11
+ },
12
+ "homepage": "https://github.com/slexkit/slexkit/tree/main/packages/components-svelte#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/slexkit/slexkit/issues"
15
+ },
16
+ "main": "./index.js",
17
+ "module": "./index.js",
18
+ "types": "./index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./index.d.ts",
22
+ "import": "./index.js"
23
+ }
24
+ },
25
+ "files": [
26
+ "index.js",
27
+ "index.d.ts",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
31
+ "sideEffects": [
32
+ "./index.js"
33
+ ],
34
+ "keywords": [
35
+ "slexkit",
36
+ "svelte",
37
+ "components"
38
+ ],
39
+ "license": "MIT",
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "peerDependencies": {
44
+ "slexkit": "^0.2.0"
45
+ },
46
+ "peerDependenciesMeta": {
47
+ "slexkit": {
48
+ "optional": true
49
+ }
50
+ },
51
+ "devDependencies": {
52
+ "slexkit": "file:../.."
53
+ }
54
+ }