@nuralyui/icon 0.0.7 → 0.0.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"icon.variables.js","sourceRoot":"","sources":["../../../src/components/icon/icon.variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEhC,CAAC","sourcesContent":["import { css } from 'lit';\n\n/**\n * Icon component CSS custom properties (design tokens)\n * \n * This file contains all the CSS custom properties used by the hy-icon component,\n * organized by functionality and including both light and dark theme variants.\n * \n * The styling system uses CSS custom properties with fallbacks to allow\n * for both global and local customization of icon appearance.\n */\nexport const styleVariables = css`\n :host {\n /* ----------------------------------------\n * BASIC ICON PROPERTIES\n * ---------------------------------------- */\n --hybrid-icon-local-color: #000000;\n --hybrid-icon-local-width: 18px;\n --hybrid-icon-local-height: 18px;\n\n /* ----------------------------------------\n * INTERACTIVE STATES\n * ---------------------------------------- */\n --hybrid-icon-local-transition: opacity 0.2s ease, transform 0.2s ease;\n --hybrid-icon-local-hover-opacity: 0.8;\n --hybrid-icon-local-hover-transform: scale(1.1);\n --hybrid-icon-local-hover-color: #0f62fe;\n --hybrid-icon-local-active-opacity: 0.6;\n --hybrid-icon-local-active-transform: scale(0.95);\n --hybrid-icon-local-active-color: #054ada;\n --hybrid-icon-local-disabled-opacity: 0.4;\n --hybrid-icon-local-disabled-color: #c6c6c6;\n \n /* ----------------------------------------\n * FOCUS STYLES\n * ---------------------------------------- */\n --hybrid-icon-local-focus-outline: 2px solid #0f62fe;\n --hybrid-icon-local-focus-outline-offset: 2px;\n --hybrid-icon-local-focus-background: rgba(15, 98, 254, 0.1);\n --hybrid-icon-local-focus-border-radius: 4px;\n\n /* ----------------------------------------\n * CURSOR STYLES\n * ---------------------------------------- */\n --hybrid-icon-local-cursor: pointer;\n --hybrid-icon-local-disabled-cursor: not-allowed;\n }\n\n /* ========================================\n * DARK THEME OVERRIDES\n * ======================================== */\n \n /**\n * Dark theme styles using data-theme attribute on the SVG element\n * These override the light theme defaults when data-theme=\"dark\" is applied\n */\n .svg-icon[data-theme=\"dark\"] {\n --hybrid-icon-local-color: #ffffff;\n --hybrid-icon-local-hover-color: #78a9ff;\n --hybrid-icon-local-active-color: #a6c8ff;\n --hybrid-icon-local-disabled-color: #6f6f6f;\n --hybrid-icon-local-focus-outline: 2px solid #78a9ff;\n --hybrid-icon-local-focus-background: rgba(120, 169, 255, 0.1);\n }\n\n /* ========================================\n * REDUCED MOTION SUPPORT\n * ======================================== */\n \n /**\n * Accessibility: Respect user's motion preferences\n * Disables animations when user prefers reduced motion\n */\n @media (prefers-reduced-motion: reduce) {\n :host {\n --hybrid-icon-local-transition: none;\n --hybrid-icon-local-hover-transform: none;\n --hybrid-icon-local-active-transform: none;\n }\n }\n`;\n"]}
1
+ {"version":3,"file":"icon.variables.js","sourceRoot":"","sources":["../../../src/components/icon/icon.variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkHhC,CAAC","sourcesContent":["import { css } from 'lit';\n\n/**\n * Icon component CSS custom properties (design tokens)\n * \n * This file contains all the CSS custom properties used by the nr-icon component,\n * organized by functionality and including comprehensive theme support for multiple design systems.\n * \n * The styling system uses CSS custom properties with fallbacks to allow\n * for both global and local customization of icon appearance across different themes:\n * - Light theme (default)\n * - Dark theme\n * - Carbon Design System (light/dark)\n * - Default Design System (light/dark)\n * \n * Design tokens follow the pattern: --nuraly-[component]-[property]-[variant]\n */\nexport const styleVariables = css`\n :host {\n /* ========================================\n * BASE ICON PROPERTIES\n * ======================================== */\n \n /* Size properties with fallbacks */\n --nuraly-icon-size-fallback: 18px;\n --nuraly-icon-size-small-fallback: 14px;\n --nuraly-icon-size-medium-fallback: 20px;\n --nuraly-icon-size-large-fallback: 24px;\n --nuraly-icon-size-xlarge-fallback: 32px;\n --nuraly-icon-size-xxlarge-fallback: 40px;\n --nuraly-icon-min-size-fallback: 12px;\n \n /* Color properties with theme-aware fallbacks */\n --nuraly-color-icon-fallback: #161616;\n \n /* ========================================\n * INTERACTIVE STATE PROPERTIES\n * ======================================== */\n \n /* Transition properties */\n --nuraly-icon-transition-fallback: opacity 0.2s ease, transform 0.2s ease, fill 0.2s ease;\n \n /* Hover state properties */\n --nuraly-icon-hover-opacity-fallback: 0.8;\n --nuraly-icon-hover-transform-fallback: scale(1.05);\n --nuraly-color-icon-hover-fallback: #0f62fe;\n \n /* Active state properties */\n --nuraly-icon-active-opacity-fallback: 0.6;\n --nuraly-icon-active-transform-fallback: scale(0.95);\n --nuraly-color-icon-active-fallback: #054ada;\n \n /* Disabled state properties */\n --nuraly-icon-disabled-opacity-fallback: 0.25;\n --nuraly-color-icon-disabled-fallback: #c6c6c6;\n \n /* ========================================\n * FOCUS STATE PROPERTIES\n * ======================================== */\n \n --nuraly-icon-focus-outline-fallback: 2px solid #0f62fe;\n --nuraly-icon-focus-outline-offset-fallback: 2px;\n --nuraly-icon-focus-background-fallback: rgba(15, 98, 254, 0.1);\n --nuraly-icon-focus-border-radius-fallback: 4px;\n --nuraly-icon-focus-shadow-fallback: none;\n \n /* ========================================\n * CURSOR PROPERTIES\n * ======================================== */\n \n --nuraly-cursor-default: default;\n --nuraly-cursor-interactive: pointer;\n --nuraly-cursor-disabled: not-allowed;\n }\n\n /* ========================================\n * SIZE-SPECIFIC DESIGN TOKENS\n * ======================================== */\n \n /**\n * Size-specific customizations that can be overridden in themes\n * These provide defaults that themes can customize for different design systems\n */\n \n :host([size=\"small\"]) {\n --nuraly-icon-size: var(--nuraly-icon-size-small, var(--nuraly-icon-size-small-fallback));\n }\n \n :host([size=\"medium\"]) {\n --nuraly-icon-size: var(--nuraly-icon-size-medium, var(--nuraly-icon-size-medium-fallback));\n }\n \n :host([size=\"large\"]) {\n --nuraly-icon-size: var(--nuraly-icon-size-large, var(--nuraly-icon-size-large-fallback));\n }\n \n :host([size=\"xlarge\"]) {\n --nuraly-icon-size: var(--nuraly-icon-size-xlarge, var(--nuraly-icon-size-xlarge-fallback));\n }\n \n :host([size=\"xxlarge\"]) {\n --nuraly-icon-size: var(--nuraly-icon-size-xxlarge, var(--nuraly-icon-size-xxlarge-fallback));\n }\n\n /* ========================================\n * ACCESSIBILITY DESIGN TOKENS\n * ======================================== */\n \n /**\n * Accessibility features that respect user preferences\n * These ensure the component works well for all users\n */\n \n /* High contrast mode support */\n @media (prefers-contrast: high) {\n :host {\n --nuraly-color-icon: CanvasText;\n --nuraly-color-icon-hover: CanvasText;\n --nuraly-color-icon-active: CanvasText;\n --nuraly-icon-focus-outline: 3px solid CanvasText;\n --nuraly-icon-focus-background: Canvas;\n }\n }\n \n /* Reduced motion support */\n @media (prefers-reduced-motion: reduce) {\n :host {\n --nuraly-icon-transition: none;\n --nuraly-icon-hover-transform: none;\n --nuraly-icon-active-transform: none;\n }\n`;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuralyui/icon",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -8,5 +8,19 @@
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
9
9
  },
10
10
  "author": "Labidi Aymen",
11
- "license": "ISC"
11
+ "license": "ISC",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./index.js"
15
+ },
16
+ "./bundle": {
17
+ "import": "./bundle.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "bundle.js",
22
+ "*.js",
23
+ "*.d.ts",
24
+ "*.js.map"
25
+ ]
12
26
  }
package/react.js CHANGED
@@ -2,7 +2,7 @@ import { createComponent } from '@lit-labs/react';
2
2
  import * as React from 'react';
3
3
  import { HyIconElement } from './icon.component.js';
4
4
  export const HyIcon = createComponent({
5
- tagName: 'hy-icon',
5
+ tagName: 'nr-icon',
6
6
  elementClass: HyIconElement,
7
7
  react: React,
8
8
  });
package/react.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/icon/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC;IACpC,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE,KAAK;CACb,CAAC,CAAC","sourcesContent":["import {createComponent} from '@lit-labs/react';\nimport * as React from 'react';\nimport {HyIconElement} from './icon.component.js';\nexport const HyIcon = createComponent({\n tagName: 'hy-icon',\n elementClass: HyIconElement,\n react: React,\n});\n"]}
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/icon/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC;IACpC,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE,KAAK;CACb,CAAC,CAAC","sourcesContent":["import { createComponent } from '@lit-labs/react';\nimport * as React from 'react';\nimport { HyIconElement } from './icon.component.js';\nexport const HyIcon = createComponent({\n tagName: 'nr-icon',\n elementClass: HyIconElement,\n react: React,\n});\n"]}
@@ -1,17 +0,0 @@
1
- import { LitElement } from 'lit';
2
- import '../icon.component.js';
3
- export declare class HyIconDemo extends LitElement {
4
- private currentTheme;
5
- static readonly styles: import("lit").CSSResult;
6
- private handleIconClick;
7
- private logEvent;
8
- private toggleTheme;
9
- private clearLog;
10
- render(): import("lit").TemplateResult<1>;
11
- }
12
- declare global {
13
- interface HTMLElementTagNameMap {
14
- 'hy-icon-demo': HyIconDemo;
15
- }
16
- }
17
- //# sourceMappingURL=hy-icon-demo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hy-icon-demo.d.ts","sourceRoot":"","sources":["../../../../src/components/icon/demo/hy-icon-demo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,sBAAsB,CAAC;AAE9B,qBACa,UAAW,SAAQ,UAAU;IAExC,OAAO,CAAC,YAAY,CAA6B;IAEjD,gBAAyB,MAAM,0BAmG7B;IAEF,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,QAAQ;IAOP,MAAM;CA2EhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,UAAU,CAAC;KAC5B;CACF"}
@@ -1,223 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { LitElement, css, html } from 'lit';
8
- import { customElement, state } from 'lit/decorators.js';
9
- import '../icon.component.js';
10
- let HyIconDemo = class HyIconDemo extends LitElement {
11
- constructor() {
12
- super(...arguments);
13
- this.currentTheme = 'light';
14
- }
15
- handleIconClick(event) {
16
- const detail = event.detail;
17
- this.logEvent('icon-click', detail);
18
- }
19
- logEvent(eventType, detail) {
20
- var _a;
21
- const eventLog = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.event-log');
22
- if (eventLog) {
23
- const timestamp = new Date().toLocaleTimeString();
24
- const logEntry = `[${timestamp}] ${eventType}: ${JSON.stringify(detail)}\n`;
25
- eventLog.textContent = logEntry + (eventLog.textContent || '');
26
- }
27
- }
28
- toggleTheme() {
29
- this.currentTheme = this.currentTheme === 'light' ? 'dark' : 'light';
30
- // Apply theme to document for global effect
31
- document.documentElement.setAttribute('data-theme', this.currentTheme);
32
- }
33
- clearLog() {
34
- var _a;
35
- const eventLog = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.event-log');
36
- if (eventLog) {
37
- eventLog.textContent = '';
38
- }
39
- }
40
- render() {
41
- return html `
42
- <div class="theme-controls" data-theme="${this.currentTheme}">
43
- <h2>Icon Component Demo - Theme: ${this.currentTheme}</h2>
44
- <button @click="${this.toggleTheme}" data-theme="${this.currentTheme}">
45
- Switch to ${this.currentTheme === 'light' ? 'Dark' : 'Light'} Theme
46
- </button>
47
- <button @click="${this.clearLog}" data-theme="${this.currentTheme}">
48
- Clear Event Log
49
- </button>
50
- </div>
51
-
52
- <div class="demo-container" data-theme="${this.currentTheme}">
53
- <h3>Basic Icons</h3>
54
-
55
- <div class="icon-group" data-theme="${this.currentTheme}">
56
- <span>Default solid:</span>
57
- <hy-icon name="envelope"></hy-icon>
58
- <span>Regular:</span>
59
- <hy-icon name="envelope" type="regular"></hy-icon>
60
- <span>Different icons:</span>
61
- <hy-icon name="check"></hy-icon>
62
- <hy-icon name="warning"></hy-icon>
63
- <hy-icon name="bug"></hy-icon>
64
- <hy-icon name="heart"></hy-icon>
65
- </div>
66
-
67
- <h3>Custom Styling</h3>
68
-
69
- <div class="icon-group" data-theme="${this.currentTheme}">
70
- <span>Custom red color:</span>
71
- <hy-icon id="custom-red-icon" name="exclamation-triangle"></hy-icon>
72
- <span>Custom size:</span>
73
- <hy-icon id="custom-size-icon" name="star"></hy-icon>
74
- <span>Custom size + color:</span>
75
- <hy-icon id="custom-both-icon" name="check-circle"></hy-icon>
76
- </div>
77
-
78
- <h3>Interactive Icons</h3>
79
-
80
- <div class="interactive-examples">
81
- <span>Clickable icons:</span>
82
- <hy-icon
83
- name="thumbs-up"
84
- clickable
85
- alt="Like button"
86
- @icon-click="${this.handleIconClick}">
87
- </hy-icon>
88
- <hy-icon
89
- name="heart"
90
- clickable
91
- alt="Favorite button"
92
- @icon-click="${this.handleIconClick}">
93
- </hy-icon>
94
- <hy-icon
95
- name="share"
96
- clickable
97
- alt="Share button"
98
- @icon-click="${this.handleIconClick}">
99
- </hy-icon>
100
- <hy-icon
101
- name="bookmark"
102
- clickable
103
- disabled
104
- alt="Disabled bookmark button"
105
- @icon-click="${this.handleIconClick}">
106
- </hy-icon>
107
- </div>
108
-
109
- <div class="event-log" data-theme="${this.currentTheme}">
110
- Event log (click icons above to see events)...
111
- </div>
112
- </div>
113
- `;
114
- }
115
- };
116
- HyIconDemo.styles = css `
117
- :host {
118
- display: block;
119
- padding: 20px;
120
- font-family: system-ui, sans-serif;
121
- }
122
-
123
- .demo-container {
124
- border: 1px solid #e0e0e0;
125
- padding: 20px;
126
- border-radius: 8px;
127
- margin-bottom: 20px;
128
- }
129
-
130
- .demo-container[data-theme="dark"] {
131
- background: #1a1a1a;
132
- border-color: #404040;
133
- color: #ffffff;
134
- }
135
-
136
- .theme-controls {
137
- margin-bottom: 30px;
138
- padding: 15px;
139
- background: #f5f5f5;
140
- border-radius: 8px;
141
- }
142
-
143
- .theme-controls[data-theme="dark"] {
144
- background: #2d2d2d;
145
- color: #ffffff;
146
- }
147
-
148
- .icon-group {
149
- display: flex;
150
- align-items: center;
151
- gap: 15px;
152
- margin: 15px 0;
153
- padding: 10px;
154
- border: 1px dashed #ccc;
155
- border-radius: 4px;
156
- }
157
-
158
- .icon-group[data-theme="dark"] {
159
- border-color: #555;
160
- }
161
-
162
- #custom-red-icon {
163
- --hybrid-icon-local-color: #dc3545;
164
- }
165
-
166
- #custom-size-icon {
167
- --hybrid-icon-local-width: 32px;
168
- --hybrid-icon-local-height: 32px;
169
- }
170
-
171
- #custom-both-icon {
172
- --hybrid-icon-local-width: 24px;
173
- --hybrid-icon-local-height: 24px;
174
- --hybrid-icon-local-color: #28a745;
175
- }
176
-
177
- .interactive-examples {
178
- display: flex;
179
- gap: 10px;
180
- flex-wrap: wrap;
181
- align-items: center;
182
- }
183
-
184
- button {
185
- padding: 8px 16px;
186
- border: 1px solid #ddd;
187
- background: #fff;
188
- border-radius: 4px;
189
- cursor: pointer;
190
- }
191
-
192
- button[data-theme="dark"] {
193
- background: #333;
194
- border-color: #555;
195
- color: #fff;
196
- }
197
-
198
- .event-log {
199
- background: #f8f9fa;
200
- border: 1px solid #dee2e6;
201
- border-radius: 4px;
202
- padding: 10px;
203
- font-family: monospace;
204
- font-size: 12px;
205
- max-height: 150px;
206
- overflow-y: auto;
207
- margin-top: 15px;
208
- }
209
-
210
- .event-log[data-theme="dark"] {
211
- background: #1e1e1e;
212
- border-color: #404040;
213
- color: #ffffff;
214
- }
215
- `;
216
- __decorate([
217
- state()
218
- ], HyIconDemo.prototype, "currentTheme", void 0);
219
- HyIconDemo = __decorate([
220
- customElement('hy-icon-demo')
221
- ], HyIconDemo);
222
- export { HyIconDemo };
223
- //# sourceMappingURL=hy-icon-demo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hy-icon-demo.js","sourceRoot":"","sources":["../../../../src/components/icon/demo/hy-icon-demo.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAE,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACvD,OAAO,sBAAsB,CAAC;AAG9B,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,UAAU;IAA1C;;QAEU,iBAAY,GAAqB,OAAO,CAAC;IA6MnD,CAAC;IAtGS,eAAe,CAAC,KAAkB;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAEO,QAAQ,CAAC,SAAiB,EAAE,MAAW;;QAC7C,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,CAAC,YAAY,CAAC,CAAC;QAC9D,IAAI,QAAQ,EAAE;YACZ,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,CAAC;YAClD,MAAM,QAAQ,GAAG,IAAI,SAAS,KAAK,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;YAC5E,QAAQ,CAAC,WAAW,GAAG,QAAQ,GAAG,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;SAChE;IACH,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QACrE,4CAA4C;QAC5C,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACzE,CAAC;IAEO,QAAQ;;QACd,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,UAAU,0CAAE,aAAa,CAAC,YAAY,CAAC,CAAC;QAC9D,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,WAAW,GAAG,EAAE,CAAC;SAC3B;IACH,CAAC;IAEQ,MAAM;QACb,OAAO,IAAI,CAAA;gDACiC,IAAI,CAAC,YAAY;2CACtB,IAAI,CAAC,YAAY;0BAClC,IAAI,CAAC,WAAW,iBAAiB,IAAI,CAAC,YAAY;sBACtD,IAAI,CAAC,YAAY,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;0BAE5C,IAAI,CAAC,QAAQ,iBAAiB,IAAI,CAAC,YAAY;;;;;gDAKzB,IAAI,CAAC,YAAY;;;8CAGnB,IAAI,CAAC,YAAY;;;;;;;;;;;;;;8CAcjB,IAAI,CAAC,YAAY;;;;;;;;;;;;;;;;;2BAiBpC,IAAI,CAAC,eAAe;;;;;;2BAMpB,IAAI,CAAC,eAAe;;;;;;2BAMpB,IAAI,CAAC,eAAe;;;;;;;2BAOpB,IAAI,CAAC,eAAe;;;;6CAIF,IAAI,CAAC,YAAY;;;;KAIzD,CAAC;IACJ,CAAC;CACF,CAAA;AA3M0B,iBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGnC,CAAA;AArGF;IADC,KAAK,EAAE;gDACyC;AAFtC,UAAU;IADtB,aAAa,CAAC,cAAc,CAAC;GACjB,UAAU,CA+MtB;SA/MY,UAAU","sourcesContent":["import {LitElement, css, html} from 'lit';\nimport {customElement, state} from 'lit/decorators.js';\nimport '../icon.component.js';\n\n@customElement('hy-icon-demo')\nexport class HyIconDemo extends LitElement {\n @state() \n private currentTheme: 'light' | 'dark' = 'light';\n\n static override readonly styles = css`\n :host {\n display: block;\n padding: 20px;\n font-family: system-ui, sans-serif;\n }\n\n .demo-container {\n border: 1px solid #e0e0e0;\n padding: 20px;\n border-radius: 8px;\n margin-bottom: 20px;\n }\n\n .demo-container[data-theme=\"dark\"] {\n background: #1a1a1a;\n border-color: #404040;\n color: #ffffff;\n }\n\n .theme-controls {\n margin-bottom: 30px;\n padding: 15px;\n background: #f5f5f5;\n border-radius: 8px;\n }\n\n .theme-controls[data-theme=\"dark\"] {\n background: #2d2d2d;\n color: #ffffff;\n }\n\n .icon-group {\n display: flex;\n align-items: center;\n gap: 15px;\n margin: 15px 0;\n padding: 10px;\n border: 1px dashed #ccc;\n border-radius: 4px;\n }\n\n .icon-group[data-theme=\"dark\"] {\n border-color: #555;\n }\n\n #custom-red-icon {\n --hybrid-icon-local-color: #dc3545;\n }\n\n #custom-size-icon {\n --hybrid-icon-local-width: 32px;\n --hybrid-icon-local-height: 32px;\n }\n\n #custom-both-icon {\n --hybrid-icon-local-width: 24px;\n --hybrid-icon-local-height: 24px;\n --hybrid-icon-local-color: #28a745;\n }\n\n .interactive-examples {\n display: flex;\n gap: 10px;\n flex-wrap: wrap;\n align-items: center;\n }\n\n button {\n padding: 8px 16px;\n border: 1px solid #ddd;\n background: #fff;\n border-radius: 4px;\n cursor: pointer;\n }\n\n button[data-theme=\"dark\"] {\n background: #333;\n border-color: #555;\n color: #fff;\n }\n\n .event-log {\n background: #f8f9fa;\n border: 1px solid #dee2e6;\n border-radius: 4px;\n padding: 10px;\n font-family: monospace;\n font-size: 12px;\n max-height: 150px;\n overflow-y: auto;\n margin-top: 15px;\n }\n\n .event-log[data-theme=\"dark\"] {\n background: #1e1e1e;\n border-color: #404040;\n color: #ffffff;\n }\n `;\n\n private handleIconClick(event: CustomEvent) {\n const detail = event.detail;\n this.logEvent('icon-click', detail);\n }\n\n private logEvent(eventType: string, detail: any) {\n const eventLog = this.shadowRoot?.querySelector('.event-log');\n if (eventLog) {\n const timestamp = new Date().toLocaleTimeString();\n const logEntry = `[${timestamp}] ${eventType}: ${JSON.stringify(detail)}\\n`;\n eventLog.textContent = logEntry + (eventLog.textContent || '');\n }\n }\n\n private toggleTheme() {\n this.currentTheme = this.currentTheme === 'light' ? 'dark' : 'light';\n // Apply theme to document for global effect\n document.documentElement.setAttribute('data-theme', this.currentTheme);\n }\n\n private clearLog() {\n const eventLog = this.shadowRoot?.querySelector('.event-log');\n if (eventLog) {\n eventLog.textContent = '';\n }\n }\n\n override render() {\n return html`\n <div class=\"theme-controls\" data-theme=\"${this.currentTheme}\">\n <h2>Icon Component Demo - Theme: ${this.currentTheme}</h2>\n <button @click=\"${this.toggleTheme}\" data-theme=\"${this.currentTheme}\">\n Switch to ${this.currentTheme === 'light' ? 'Dark' : 'Light'} Theme\n </button>\n <button @click=\"${this.clearLog}\" data-theme=\"${this.currentTheme}\">\n Clear Event Log\n </button>\n </div>\n\n <div class=\"demo-container\" data-theme=\"${this.currentTheme}\">\n <h3>Basic Icons</h3>\n \n <div class=\"icon-group\" data-theme=\"${this.currentTheme}\">\n <span>Default solid:</span>\n <hy-icon name=\"envelope\"></hy-icon>\n <span>Regular:</span>\n <hy-icon name=\"envelope\" type=\"regular\"></hy-icon>\n <span>Different icons:</span>\n <hy-icon name=\"check\"></hy-icon>\n <hy-icon name=\"warning\"></hy-icon>\n <hy-icon name=\"bug\"></hy-icon>\n <hy-icon name=\"heart\"></hy-icon>\n </div>\n\n <h3>Custom Styling</h3>\n \n <div class=\"icon-group\" data-theme=\"${this.currentTheme}\">\n <span>Custom red color:</span>\n <hy-icon id=\"custom-red-icon\" name=\"exclamation-triangle\"></hy-icon>\n <span>Custom size:</span>\n <hy-icon id=\"custom-size-icon\" name=\"star\"></hy-icon>\n <span>Custom size + color:</span>\n <hy-icon id=\"custom-both-icon\" name=\"check-circle\"></hy-icon>\n </div>\n\n <h3>Interactive Icons</h3>\n \n <div class=\"interactive-examples\">\n <span>Clickable icons:</span>\n <hy-icon \n name=\"thumbs-up\" \n clickable \n alt=\"Like button\"\n @icon-click=\"${this.handleIconClick}\">\n </hy-icon>\n <hy-icon \n name=\"heart\" \n clickable \n alt=\"Favorite button\"\n @icon-click=\"${this.handleIconClick}\">\n </hy-icon>\n <hy-icon \n name=\"share\" \n clickable \n alt=\"Share button\"\n @icon-click=\"${this.handleIconClick}\">\n </hy-icon>\n <hy-icon \n name=\"bookmark\" \n clickable \n disabled\n alt=\"Disabled bookmark button\"\n @icon-click=\"${this.handleIconClick}\">\n </hy-icon>\n </div>\n\n <div class=\"event-log\" data-theme=\"${this.currentTheme}\">\n Event log (click icons above to see events)...\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'hy-icon-demo': HyIconDemo;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon.component.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.component.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AASvC,OAAO,EAAE,SAAS,EAAkC,MAAM,iBAAiB,CAAC;AAI5E;;;;;;;;;;;;GAYG;AAEH,QAAA,MAAM,aAAa,wWAAgD,CAAC;AACpE,qBACa,aAAc,SAAQ,aAAa;IAC9C,gBAAyB,MAAM,4BAAU;IAEzC,gCAAgC;IAEhC,IAAI,EAAG,MAAM,CAAC;IAEd,uCAAuC;IAEvC,IAAI,YAAmB;IAEvB,yCAAyC;IAEzC,GAAG,SAAM;IAET;;OAEG;IACM,UAAU,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IAa9C,MAAM;IAuBf,WAAW;IAmCX;;OAEG;IACM,WAAW,IAAI,MAAM;IAO9B;;OAEG;IACM,eAAe,IAAI,MAAM;IAOlC;;OAEG;IACM,eAAe,IAAI,MAAM,GAAG,SAAS;CAG/C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon.style.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.style.ts"],"names":[],"mappings":"AA2EA,eAAO,MAAM,MAAM,2BAA+B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon.types.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.types.ts"],"names":[],"mappings":"AAAA,0BAAkB,SAAS;IACzB,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AACD,eAAO,MAAM,aAAa,QAAQ,CAAC;AACnC,eAAO,MAAM,eAAe,QAAQ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon.variables.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.variables.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,yBAqE1B,CAAC"}
package/index.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -1,57 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Nuraly, Laabidi Aymen
4
- * SPDX-License-Identifier: MIT
5
- */
6
- import { LitElement } from 'lit';
7
- declare type Constructor<T = {}> = new (...args: any[]) => T;
8
- /**
9
- * Interface for components that support clickable icon functionality
10
- */
11
- export interface ClickableCapable {
12
- /**
13
- * Whether the icon is clickable/interactive
14
- */
15
- clickable: boolean;
16
- /**
17
- * Whether the icon is disabled
18
- */
19
- disabled: boolean;
20
- /**
21
- * Handle click events on the icon
22
- */
23
- handleIconClick(event: MouseEvent): void;
24
- /**
25
- * Handle keyboard events for accessibility
26
- */
27
- handleIconKeydown(event: KeyboardEvent): void;
28
- /**
29
- * Get appropriate role for accessibility
30
- */
31
- getIconRole(): string;
32
- /**
33
- * Get appropriate tabindex for accessibility
34
- */
35
- getIconTabIndex(): string;
36
- /**
37
- * Get appropriate aria-disabled attribute
38
- */
39
- getAriaDisabled(): string | undefined;
40
- }
41
- /**
42
- * Mixin that provides clickable icon functionality with proper event handling
43
- * and accessibility support.
44
- *
45
- * @param superClass - The base class to extend
46
- * @returns Enhanced class with clickable capabilities
47
- *
48
- * @example
49
- * ```typescript
50
- * export class IconComponent extends ClickableMixin(NuralyUIBaseMixin(LitElement)) {
51
- * // Component implementation
52
- * }
53
- * ```
54
- */
55
- export declare const ClickableMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<ClickableCapable> & T;
56
- export {};
57
- //# sourceMappingURL=clickable-mixin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clickable-mixin.d.ts","sourceRoot":"","sources":["../../../../src/components/icon/mixins/clickable-mixin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC,aAAK,WAAW,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAE9C;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC;IAEtB;;OAEG;IACH,eAAe,IAAI,MAAM,CAAC;IAE1B;;OAEG;IACH,eAAe,IAAI,MAAM,GAAG,SAAS,CAAC;CACvC;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,yFAwF1B,CAAC"}
@@ -1,111 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Nuraly, Laabidi Aymen
4
- * SPDX-License-Identifier: MIT
5
- */
6
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
9
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
10
- return c > 3 && r && Object.defineProperty(target, key, r), r;
11
- };
12
- import { property } from 'lit/decorators.js';
13
- /**
14
- * Mixin that provides clickable icon functionality with proper event handling
15
- * and accessibility support.
16
- *
17
- * @param superClass - The base class to extend
18
- * @returns Enhanced class with clickable capabilities
19
- *
20
- * @example
21
- * ```typescript
22
- * export class IconComponent extends ClickableMixin(NuralyUIBaseMixin(LitElement)) {
23
- * // Component implementation
24
- * }
25
- * ```
26
- */
27
- export const ClickableMixin = (superClass) => {
28
- class ClickableMixinClass extends superClass {
29
- constructor() {
30
- super(...arguments);
31
- /** Whether the icon is clickable/interactive */
32
- this.clickable = false;
33
- /** Whether the icon is disabled */
34
- this.disabled = false;
35
- }
36
- /**
37
- * Handle click events on the icon
38
- */
39
- handleIconClick(event) {
40
- if (this.disabled || !this.clickable) {
41
- event.preventDefault();
42
- event.stopPropagation();
43
- return;
44
- }
45
- // Dispatch custom click event with icon details
46
- this.dispatchCustomEvent('icon-click', {
47
- iconName: this.name,
48
- iconType: this.type,
49
- originalEvent: event,
50
- timestamp: Date.now()
51
- });
52
- }
53
- /**
54
- * Handle keyboard events for accessibility
55
- */
56
- handleIconKeydown(event) {
57
- if (this.disabled || !this.clickable) {
58
- return;
59
- }
60
- // Check if it's an activation key (Enter or Space)
61
- // Use isActivationKey from EventHandlerMixin if available, otherwise fallback
62
- const isActivationKey = typeof this.isActivationKey === 'function'
63
- ? this.isActivationKey(event)
64
- : (event.key === 'Enter' || event.key === ' ');
65
- if (isActivationKey) {
66
- event.preventDefault();
67
- event.stopPropagation();
68
- // Simulate click event
69
- this.handleIconClick(event);
70
- // Dispatch keyboard activation event with improved naming consistency
71
- if (typeof this.dispatchCustomEvent === 'function') {
72
- this.dispatchCustomEvent('icon-keyboard-activation', {
73
- iconName: this.name,
74
- iconType: this.type,
75
- key: event.key,
76
- originalEvent: event,
77
- timestamp: Date.now()
78
- });
79
- }
80
- }
81
- }
82
- /**
83
- * Get appropriate role for accessibility
84
- */
85
- getIconRole() {
86
- return this.clickable ? 'button' : 'img';
87
- }
88
- /**
89
- * Get appropriate tabindex for accessibility
90
- */
91
- getIconTabIndex() {
92
- if (!this.clickable)
93
- return '-1';
94
- return this.disabled ? '-1' : '0';
95
- }
96
- /**
97
- * Get appropriate aria-disabled attribute
98
- */
99
- getAriaDisabled() {
100
- return this.clickable && this.disabled ? 'true' : undefined;
101
- }
102
- }
103
- __decorate([
104
- property({ type: Boolean, reflect: true })
105
- ], ClickableMixinClass.prototype, "clickable", void 0);
106
- __decorate([
107
- property({ type: Boolean, reflect: true })
108
- ], ClickableMixinClass.prototype, "disabled", void 0);
109
- return ClickableMixinClass;
110
- };
111
- //# sourceMappingURL=clickable-mixin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clickable-mixin.js","sourceRoot":"","sources":["../../../../src/components/icon/mixins/clickable-mixin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AA4C7C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAoC,UAAa,EAAE,EAAE;IACjF,MAAM,mBAAoB,SAAQ,UAAU;QAA5C;;YAEE,gDAAgD;YAEhD,cAAS,GAAG,KAAK,CAAC;YAElB,mCAAmC;YAEnC,aAAQ,GAAG,KAAK,CAAC;QA4EnB,CAAC;QA1EC;;WAEG;QACH,eAAe,CAAC,KAAiB;YAC/B,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACpC,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;gBACxB,OAAO;aACR;YAED,gDAAgD;YAC/C,IAAY,CAAC,mBAAmB,CAAC,YAAY,EAAE;gBAC9C,QAAQ,EAAG,IAAY,CAAC,IAAI;gBAC5B,QAAQ,EAAG,IAAY,CAAC,IAAI;gBAC5B,aAAa,EAAE,KAAK;gBACpB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;aACtB,CAAC,CAAC;QACL,CAAC;QAED;;WAEG;QACH,iBAAiB,CAAC,KAAoB;YACpC,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;gBACpC,OAAO;aACR;YAED,mDAAmD;YACnD,8EAA8E;YAC9E,MAAM,eAAe,GAAG,OAAQ,IAAY,CAAC,eAAe,KAAK,UAAU;gBACzE,CAAC,CAAE,IAAY,CAAC,eAAe,CAAC,KAAK,CAAC;gBACtC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;YAEjD,IAAI,eAAe,EAAE;gBACnB,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;gBAExB,uBAAuB;gBACvB,IAAI,CAAC,eAAe,CAAC,KAAY,CAAC,CAAC;gBAEnC,sEAAsE;gBACtE,IAAI,OAAQ,IAAY,CAAC,mBAAmB,KAAK,UAAU,EAAE;oBAC1D,IAAY,CAAC,mBAAmB,CAAC,0BAA0B,EAAE;wBAC5D,QAAQ,EAAG,IAAY,CAAC,IAAI;wBAC5B,QAAQ,EAAG,IAAY,CAAC,IAAI;wBAC5B,GAAG,EAAE,KAAK,CAAC,GAAG;wBACd,aAAa,EAAE,KAAK;wBACpB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;qBACtB,CAAC,CAAC;iBACJ;aACF;QACH,CAAC;QAED;;WAEG;QACH,WAAW;YACT,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;QAC3C,CAAC;QAED;;WAEG;QACH,eAAe;YACb,IAAI,CAAC,IAAI,CAAC,SAAS;gBAAE,OAAO,IAAI,CAAC;YACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACpC,CAAC;QAED;;WAEG;QACH,eAAe;YACb,OAAO,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9D,CAAC;KACF;IAhFC;QADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0DACvB;IAIlB;QADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yDACxB;IA8EnB,OAAO,mBAAwD,CAAC;AAClE,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\ntype Constructor<T = {}> = new (...args: any[]) => T;\n\n/**\n * Interface for components that support clickable icon functionality\n */\nexport interface ClickableCapable {\n /**\n * Whether the icon is clickable/interactive\n */\n clickable: boolean;\n \n /**\n * Whether the icon is disabled\n */\n disabled: boolean;\n \n /**\n * Handle click events on the icon\n */\n handleIconClick(event: MouseEvent): void;\n \n /**\n * Handle keyboard events for accessibility\n */\n handleIconKeydown(event: KeyboardEvent): void;\n \n /**\n * Get appropriate role for accessibility\n */\n getIconRole(): string;\n \n /**\n * Get appropriate tabindex for accessibility\n */\n getIconTabIndex(): string;\n \n /**\n * Get appropriate aria-disabled attribute\n */\n getAriaDisabled(): string | undefined;\n}\n\n/**\n * Mixin that provides clickable icon functionality with proper event handling\n * and accessibility support.\n * \n * @param superClass - The base class to extend\n * @returns Enhanced class with clickable capabilities\n * \n * @example\n * ```typescript\n * export class IconComponent extends ClickableMixin(NuralyUIBaseMixin(LitElement)) {\n * // Component implementation\n * }\n * ```\n */\nexport const ClickableMixin = <T extends Constructor<LitElement>>(superClass: T) => {\n class ClickableMixinClass extends superClass implements ClickableCapable {\n \n /** Whether the icon is clickable/interactive */\n @property({type: Boolean, reflect: true})\n clickable = false;\n \n /** Whether the icon is disabled */\n @property({type: Boolean, reflect: true})\n disabled = false;\n\n /**\n * Handle click events on the icon\n */\n handleIconClick(event: MouseEvent): void {\n if (this.disabled || !this.clickable) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n\n // Dispatch custom click event with icon details\n (this as any).dispatchCustomEvent('icon-click', {\n iconName: (this as any).name,\n iconType: (this as any).type,\n originalEvent: event,\n timestamp: Date.now()\n });\n }\n\n /**\n * Handle keyboard events for accessibility\n */\n handleIconKeydown(event: KeyboardEvent): void {\n if (this.disabled || !this.clickable) {\n return;\n }\n\n // Check if it's an activation key (Enter or Space)\n // Use isActivationKey from EventHandlerMixin if available, otherwise fallback\n const isActivationKey = typeof (this as any).isActivationKey === 'function'\n ? (this as any).isActivationKey(event)\n : (event.key === 'Enter' || event.key === ' ');\n\n if (isActivationKey) {\n event.preventDefault();\n event.stopPropagation();\n \n // Simulate click event\n this.handleIconClick(event as any);\n \n // Dispatch keyboard activation event with improved naming consistency\n if (typeof (this as any).dispatchCustomEvent === 'function') {\n (this as any).dispatchCustomEvent('icon-keyboard-activation', {\n iconName: (this as any).name,\n iconType: (this as any).type,\n key: event.key,\n originalEvent: event,\n timestamp: Date.now()\n });\n }\n }\n }\n\n /**\n * Get appropriate role for accessibility\n */\n getIconRole(): string {\n return this.clickable ? 'button' : 'img';\n }\n\n /**\n * Get appropriate tabindex for accessibility\n */\n getIconTabIndex(): string {\n if (!this.clickable) return '-1';\n return this.disabled ? '-1' : '0';\n }\n\n /**\n * Get appropriate aria-disabled attribute\n */\n getAriaDisabled(): string | undefined {\n return this.clickable && this.disabled ? 'true' : undefined;\n }\n }\n\n return ClickableMixinClass as Constructor<ClickableCapable> & T;\n};\n"]}
package/mixins/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Nuraly, Laabidi Aymen
4
- * SPDX-License-Identifier: MIT
5
- */
6
- export * from './clickable-mixin.js';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/icon/mixins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,sBAAsB,CAAC"}
package/mixins/index.js DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2023 Nuraly, Laabidi Aymen
4
- * SPDX-License-Identifier: MIT
5
- */
6
- export * from './clickable-mixin.js';
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/icon/mixins/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,sBAAsB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './clickable-mixin.js';\n"]}
package/react.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/components/icon/react.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,eAAO,MAAM,MAAM,gEAIjB,CAAC"}