@lovince/my-lit-library 1.0.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/dist/index.d.ts +14 -0
- package/dist/index.js +37 -0
- package/package.json +36 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
|
|
5
|
+
declare class button extends LitElement {
|
|
6
|
+
static styles: lit.CSSResult;
|
|
7
|
+
render(): lit_html.TemplateResult<1>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare function defineButton(): void;
|
|
11
|
+
|
|
12
|
+
declare function defineAllComponents(): void;
|
|
13
|
+
|
|
14
|
+
export { button, defineAllComponents, defineButton };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// src/components/button.ts
|
|
2
|
+
import { LitElement, html, css } from "lit";
|
|
3
|
+
var button = class extends LitElement {
|
|
4
|
+
static styles = css`
|
|
5
|
+
button {
|
|
6
|
+
padding: 0.6rem 1rem;
|
|
7
|
+
border-radius: 6px;
|
|
8
|
+
background: royalblue;
|
|
9
|
+
color: white;
|
|
10
|
+
border: none;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
render() {
|
|
15
|
+
return html` <button>
|
|
16
|
+
<slot></slot>
|
|
17
|
+
</button>
|
|
18
|
+
`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// src/define/button.ts
|
|
23
|
+
function defineButton() {
|
|
24
|
+
if (!customElements.get("my-button")) {
|
|
25
|
+
customElements.define("my-button", button);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/define/all.ts
|
|
30
|
+
function defineAllComponents() {
|
|
31
|
+
defineButton();
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
button,
|
|
35
|
+
defineAllComponents,
|
|
36
|
+
defineButton
|
|
37
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lovince/my-lit-library",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Reusable Web Components built with Lit",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"web-components",
|
|
23
|
+
"lit",
|
|
24
|
+
"design-system"
|
|
25
|
+
],
|
|
26
|
+
"author": "Steve",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"lit": "^3.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"lit": "^3.3.2",
|
|
33
|
+
"tsup": "^8.5.1",
|
|
34
|
+
"typescript": "^5.9.3"
|
|
35
|
+
}
|
|
36
|
+
}
|