dv-web-components 1.0.1 → 1.0.4

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.
@@ -0,0 +1,13 @@
1
+ export class AppAlert extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ handleDismiss(): void;
4
+ set variant(value: string);
5
+ get variant(): string;
6
+ set dismissible(value: boolean);
7
+ get dismissible(): boolean;
8
+ connectedCallback(): void;
9
+ disconnectedCallback(): void;
10
+ attributeChangedCallback(name: any, oldValue: any, newValue: any): void;
11
+ close(): void;
12
+ #private;
13
+ }
@@ -0,0 +1,3 @@
1
+ declare const template: HTMLTemplateElement;
2
+ declare class AppCard extends HTMLElement {
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export const AppAlert: import("@lit/react").ReactWebComponent<AppAlertElement, {
2
+ onClose: string;
3
+ }>;
4
+ export const AppCard: import("@lit/react").ReactWebComponent<HTMLElement, {}>;
5
+ import { AppAlert as AppAlertElement } from '../alert-component/index.js';
package/package.json CHANGED
@@ -1,19 +1,33 @@
1
1
  {
2
2
  "name": "dv-web-components",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "Librería de Web Components nativos y accesibles",
5
5
  "type": "module",
6
6
  "main": "./index.js",
7
7
  "module": "./index.js",
8
+ "types": "./dist/types/index.d.ts",
8
9
  "exports": {
9
- ".": "./index.js",
10
- "./alert": "./alert-component/index.js",
11
- "./card": "./card-component/index.js"
10
+ ".": {
11
+ "types": "./dist/types/index.d.ts",
12
+ "default": "./index.js"
13
+ },
14
+ "./react": {
15
+ "types": "./dist/types/react/index.d.ts",
16
+ "default": "./react/index.js"
17
+ },
18
+ "./*": "./*-component/index.js"
19
+ },
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "prepublishOnly": "npm run build",
23
+ "release": "npm version patch && npm publish"
12
24
  },
13
25
  "files": [
14
26
  "index.js",
15
27
  "alert-component",
16
- "card-component"
28
+ "card-component",
29
+ "react",
30
+ "dist"
17
31
  ],
18
32
  "keywords": [
19
33
  "web-components",
@@ -21,5 +35,25 @@
21
35
  "ui"
22
36
  ],
23
37
  "author": "Diego Villa",
24
- "license": "MIT"
38
+ "license": "MIT",
39
+ "dependencies": {
40
+ "@lit/react": "^1.0.8"
41
+ },
42
+ "peerDependencies": {
43
+ "react": ">=18.0.0",
44
+ "react-dom": ">=18.0.0"
45
+ },
46
+ "peerDependenciesMeta": {
47
+ "react": {
48
+ "optional": true
49
+ },
50
+ "react-dom": {
51
+ "optional": true
52
+ }
53
+ },
54
+ "devDependencies": {
55
+ "@types/react": "^19.0.0",
56
+ "@types/react-dom": "^19.0.0",
57
+ "typescript": "^5.0.0"
58
+ }
25
59
  }
package/react/index.js ADDED
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { createComponent } from '@lit/react';
3
+ import { AppAlert as AppAlertElement } from '../alert-component/index.js';
4
+ import { AppCard as AppCardElement } from '../card-component/index.js';
5
+
6
+ // Envolvemos el Web Component y lo convertimos en un Componente React real
7
+ export const AppAlert = createComponent({
8
+ tagName: 'app-alert',
9
+ elementClass: AppAlertElement,
10
+ react: React,
11
+ events: {
12
+ onClose: 'app-close' // 👈 Mapea el CustomEvent nativo 'app-close' a una prop React 'onClose'
13
+ }
14
+ });
15
+
16
+ export const AppCard = createComponent({
17
+ tagName: 'app-card',
18
+ elementClass: AppCardElement,
19
+ react: React
20
+ });