@awc-ui/svelte 1.0.0-beta
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 +21 -0
- package/README.md +55 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +7 -0
- package/dist/lib/components.d.ts +2 -0
- package/dist/lib/components.d.ts.map +1 -0
- package/package.json +47 -0
- package/src/index.ts +22 -0
- package/src/lib/components.ts +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AWC UI
|
|
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,55 @@
|
|
|
1
|
+
# @awc-ui/svelte
|
|
2
|
+
|
|
3
|
+
Svelte bindings for [AWC UI](https://www.npmjs.com/package/@awc-ui/core) — Material Design 3 web components.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @awc-ui/svelte @awc-ui/core @awc-ui/tokens
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Svelte 4 or 5.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Register the custom elements once on the client, then use `md-*` tags directly in any `.svelte` file — Svelte has first-class custom-element support, so no per-component wrappers are needed:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
// main.ts (plain Vite/SPA app)
|
|
19
|
+
import { defineCustomElements } from '@awc-ui/svelte';
|
|
20
|
+
defineCustomElements(window);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```svelte
|
|
24
|
+
<md-button variant="filled" on:click={save}>Save</md-button>
|
|
25
|
+
<md-text-field label="Email" variant="outlined"></md-text-field>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### SvelteKit (SSR)
|
|
29
|
+
|
|
30
|
+
Registration is client-only — guard it so it runs in the browser:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { browser } from '$app/environment';
|
|
34
|
+
import { defineCustomElements } from '@awc-ui/svelte';
|
|
35
|
+
|
|
36
|
+
if (browser) defineCustomElements(window);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For server-rendered markup use `@awc-ui/core/hydrate` (`renderToString`).
|
|
40
|
+
|
|
41
|
+
## Styling
|
|
42
|
+
|
|
43
|
+
Load the design tokens once (they carry the whole MD3 theme):
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import '@awc-ui/tokens/tokens.css';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Docs
|
|
50
|
+
|
|
51
|
+
Full component reference, theming, and framework setup: **[awc-ui.dev](https://awc-ui.dev)** — see [Installation](https://awc-ui.dev/getting-started/installation/) for the Svelte section.
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @awc-ui/svelte
|
|
3
|
+
*
|
|
4
|
+
* Svelte integration for AWC UI Material Design 3 components.
|
|
5
|
+
*
|
|
6
|
+
* Registration is client-only. In a plain Vite/SPA app:
|
|
7
|
+
* @example
|
|
8
|
+
* import { defineCustomElements } from '@awc-ui/svelte';
|
|
9
|
+
* defineCustomElements(window);
|
|
10
|
+
*
|
|
11
|
+
* Under SvelteKit (SSR), guard it so it runs only in the browser — and for
|
|
12
|
+
* server-rendered markup use `@awc-ui/core/hydrate` (`renderToString`):
|
|
13
|
+
* @example
|
|
14
|
+
* import { browser } from '$app/environment';
|
|
15
|
+
* import { defineCustomElements } from '@awc-ui/svelte';
|
|
16
|
+
* if (browser) defineCustomElements(window);
|
|
17
|
+
*
|
|
18
|
+
* Then use components directly in .svelte files:
|
|
19
|
+
* @example
|
|
20
|
+
* <md-button variant="filled">Click me</md-button>
|
|
21
|
+
*/
|
|
22
|
+
export * from './lib/components';
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,cAAc,kBAAkB,CAAC"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/components.ts"],
|
|
4
|
+
"sourcesContent": ["/* Auto-generated by Stencil svelte integration */\n/* This file re-exports stencil components for Svelte usage */\n\n// All AWC UI components work as native custom elements in Svelte.\n// Import defineCustomElements to register them.\nexport { defineCustomElements } from '@awc-ui/core/loader';\n"],
|
|
5
|
+
"mappings": ";AAKA,SAAS,4BAA4B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/lib/components.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@awc-ui/svelte",
|
|
3
|
+
"version": "1.0.0-beta",
|
|
4
|
+
"description": "Svelte wrapper for AWC UI Material Design 3 components",
|
|
5
|
+
"main": "dist/index.mjs",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.mjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"src",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"svelte": ">=4",
|
|
20
|
+
"@awc-ui/core": "1.0.0-beta"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"esbuild": "^0.25.12",
|
|
24
|
+
"typescript": "^5.4.0",
|
|
25
|
+
"@awc-ui/core": "1.0.0-beta"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"author": "AWC UI",
|
|
29
|
+
"homepage": "https://awc-ui.dev",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/awc-ui/core.git",
|
|
33
|
+
"directory": "packages/svelte"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/awc-ui/core/issues"
|
|
37
|
+
},
|
|
38
|
+
"module": "dist/index.mjs",
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"type": "module",
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "rm -rf dist && tsc -p tsconfig.json --emitDeclarationOnly && esbuild src/index.ts --bundle --format=esm --target=es2020 --sourcemap --outfile=dist/index.mjs --external:svelte --external:@awc-ui/core --external:@awc-ui/core/*"
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @awc-ui/svelte
|
|
3
|
+
*
|
|
4
|
+
* Svelte integration for AWC UI Material Design 3 components.
|
|
5
|
+
*
|
|
6
|
+
* Registration is client-only. In a plain Vite/SPA app:
|
|
7
|
+
* @example
|
|
8
|
+
* import { defineCustomElements } from '@awc-ui/svelte';
|
|
9
|
+
* defineCustomElements(window);
|
|
10
|
+
*
|
|
11
|
+
* Under SvelteKit (SSR), guard it so it runs only in the browser — and for
|
|
12
|
+
* server-rendered markup use `@awc-ui/core/hydrate` (`renderToString`):
|
|
13
|
+
* @example
|
|
14
|
+
* import { browser } from '$app/environment';
|
|
15
|
+
* import { defineCustomElements } from '@awc-ui/svelte';
|
|
16
|
+
* if (browser) defineCustomElements(window);
|
|
17
|
+
*
|
|
18
|
+
* Then use components directly in .svelte files:
|
|
19
|
+
* @example
|
|
20
|
+
* <md-button variant="filled">Click me</md-button>
|
|
21
|
+
*/
|
|
22
|
+
export * from './lib/components';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* Auto-generated by Stencil svelte integration */
|
|
2
|
+
/* This file re-exports stencil components for Svelte usage */
|
|
3
|
+
|
|
4
|
+
// All AWC UI components work as native custom elements in Svelte.
|
|
5
|
+
// Import defineCustomElements to register them.
|
|
6
|
+
export { defineCustomElements } from '@awc-ui/core/loader';
|