@logosphere-ui/core 0.0.0-alpha.2
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/README.md +759 -0
- package/dist/atoms/Badge/badge.d.ts +21 -0
- package/dist/atoms/Badge/index.d.ts +2 -0
- package/dist/atoms/Button/button.d.ts +11 -0
- package/dist/atoms/Button/index.d.ts +1 -0
- package/dist/atoms/Checkbox/checkbox.d.ts +20 -0
- package/dist/atoms/Checkbox/index.d.ts +1 -0
- package/dist/atoms/FormField/formfield.d.ts +30 -0
- package/dist/atoms/FormField/index.d.ts +2 -0
- package/dist/atoms/Switch/index.d.ts +1 -0
- package/dist/atoms/Switch/switch.d.ts +10 -0
- package/dist/badge-BbhaO73N.cjs +13 -0
- package/dist/badge-DE7Tgd8Z.js +71 -0
- package/dist/badge.cjs +1 -0
- package/dist/badge.js +4 -0
- package/dist/breadcrumb-B-4yqoJZ.js +41 -0
- package/dist/breadcrumb-Cop-B1J7.cjs +12 -0
- package/dist/breadcrumb.cjs +1 -0
- package/dist/breadcrumb.js +4 -0
- package/dist/button-C1EwOosO.js +58 -0
- package/dist/button-CDRccsk9.cjs +10 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +4 -0
- package/dist/card-CUhlTJyJ.js +97 -0
- package/dist/card-n8ka8Zk-.cjs +43 -0
- package/dist/card.cjs +1 -0
- package/dist/card.js +4 -0
- package/dist/chatbot-Ces7Xveb.js +496 -0
- package/dist/chatbot-oRwt64d8.cjs +160 -0
- package/dist/chatbot.cjs +1 -0
- package/dist/chatbot.js +4 -0
- package/dist/checkbox-7Rb3WKGx.js +119 -0
- package/dist/checkbox-CdDTRdKV.cjs +37 -0
- package/dist/checkbox.cjs +1 -0
- package/dist/checkbox.js +4 -0
- package/dist/combobox-BJbI-Tgi.js +268 -0
- package/dist/combobox-pmE7bgEL.cjs +99 -0
- package/dist/combobox.cjs +1 -0
- package/dist/combobox.js +4 -0
- package/dist/datepicker-DFJx45C-.js +750 -0
- package/dist/datepicker-b9JGTTMx.cjs +115 -0
- package/dist/datepicker.cjs +1 -0
- package/dist/datepicker.js +4 -0
- package/dist/directive-Z_rhNYWK.js +240 -0
- package/dist/directive-ekjitgzi.cjs +3 -0
- package/dist/download-manager-A4fOxGWJ.js +381 -0
- package/dist/download-manager-BSIMTGaK.cjs +97 -0
- package/dist/download-manager.cjs +1 -0
- package/dist/download-manager.js +4 -0
- package/dist/formfield-D_7NFFoe.cjs +27 -0
- package/dist/formfield-d8fp9FTV.js +118 -0
- package/dist/formfield.cjs +1 -0
- package/dist/formfield.js +4 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +34 -0
- package/dist/index.umd.js +819 -0
- package/dist/input-ByllRq9M.js +192 -0
- package/dist/input-DsIOQPGV.cjs +46 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +4 -0
- package/dist/live-BX-yBGvT.cjs +1 -0
- package/dist/live-WTVSYE2F.js +24 -0
- package/dist/modal-Bfc6WQSL.js +110 -0
- package/dist/modal-DQ8VFL-P.cjs +39 -0
- package/dist/modal.cjs +1 -0
- package/dist/modal.js +4 -0
- package/dist/molecules/Breadcrumb/breadcrumb.d.ts +10 -0
- package/dist/molecules/Breadcrumb/index.d.ts +1 -0
- package/dist/molecules/Card/card.d.ts +16 -0
- package/dist/molecules/Card/index.d.ts +1 -0
- package/dist/molecules/Input/index.d.ts +2 -0
- package/dist/molecules/Input/input.d.ts +50 -0
- package/dist/molecules/Popover/index.d.ts +1 -0
- package/dist/molecules/Popover/popover.d.ts +33 -0
- package/dist/molecules/Textarea/index.d.ts +1 -0
- package/dist/molecules/Textarea/text-area.d.ts +49 -0
- package/dist/organisms/Chatbot/chatbot.d.ts +79 -0
- package/dist/organisms/Chatbot/index.d.ts +1 -0
- package/dist/organisms/Combobox/combobox.d.ts +49 -0
- package/dist/organisms/Combobox/index.d.ts +1 -0
- package/dist/organisms/DatePicker/datepicker.d.ts +79 -0
- package/dist/organisms/DatePicker/index.d.ts +1 -0
- package/dist/organisms/DownloadManager/download-manager.d.ts +52 -0
- package/dist/organisms/DownloadManager/index.d.ts +1 -0
- package/dist/organisms/Modal/index.d.ts +1 -0
- package/dist/organisms/Modal/modal.d.ts +21 -0
- package/dist/organisms/Tab/index.d.ts +1 -0
- package/dist/organisms/Tab/tab.d.ts +33 -0
- package/dist/popover-C_Ob86CJ.cjs +30 -0
- package/dist/popover-D-FXdEdS.js +1040 -0
- package/dist/popover.cjs +1 -0
- package/dist/popover.js +4 -0
- package/dist/shared/icons/icon-map.d.ts +1 -0
- package/dist/shared/icons/ui-icon.d.ts +15 -0
- package/dist/styles/main.css +247 -0
- package/dist/switch-Cpl53nRW.js +64 -0
- package/dist/switch-Rnnn10bn.cjs +17 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +4 -0
- package/dist/tab-BKdN4xAz.js +176 -0
- package/dist/tab-DcjAlXzU.cjs +40 -0
- package/dist/tab.cjs +1 -0
- package/dist/tab.js +4 -0
- package/dist/text-area-CtZY3yLA.js +204 -0
- package/dist/text-area-DFDF5oos.cjs +44 -0
- package/dist/textarea.cjs +1 -0
- package/dist/textarea.js +4 -0
- package/dist/vite.svg +1 -0
- package/package.json +185 -0
package/dist/popover.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./popover-C_Ob86CJ.cjs");Object.defineProperty(exports,"Popover",{enumerable:!0,get:()=>e.Popover});
|
package/dist/popover.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const icons: Record<string, string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class UiIcon extends LitElement {
|
|
3
|
+
static properties: {
|
|
4
|
+
name: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
};
|
|
7
|
+
size: {
|
|
8
|
+
type: NumberConstructor;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
name: string;
|
|
12
|
+
size: number;
|
|
13
|
+
static styles: import("lit").CSSResult;
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logosphere UI - Main Stylesheet
|
|
3
|
+
* Design tokens and base styles
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Theme Configuration
|
|
8
|
+
* Logosphere UI Design System
|
|
9
|
+
*
|
|
10
|
+
* Bu dosya tüm renk paletini, tipografiyi ve design token'ları içerir
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");
|
|
14
|
+
|
|
15
|
+
:host,
|
|
16
|
+
:root {
|
|
17
|
+
/* ==================== TYPOGRAPHY ==================== */
|
|
18
|
+
|
|
19
|
+
/* Font Families */
|
|
20
|
+
--font-family-base:
|
|
21
|
+
"Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
|
|
22
|
+
sans-serif;
|
|
23
|
+
--font-family-mono:
|
|
24
|
+
"SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
|
25
|
+
|
|
26
|
+
/* Font Sizes */
|
|
27
|
+
--font-size-xs: 0.75rem; /* 12px */
|
|
28
|
+
--font-size-sm: 0.875rem; /* 14px */
|
|
29
|
+
--font-size-base: 1rem; /* 16px */
|
|
30
|
+
--font-size-lg: 1.125rem; /* 18px */
|
|
31
|
+
--font-size-xl: 1.25rem; /* 20px */
|
|
32
|
+
--font-size-2xl: 1.5rem; /* 24px */
|
|
33
|
+
--font-size-3xl: 1.875rem; /* 30px */
|
|
34
|
+
--font-size-4xl: 2.25rem; /* 36px */
|
|
35
|
+
|
|
36
|
+
/* Font Weights */
|
|
37
|
+
--font-weight-light: 300;
|
|
38
|
+
--font-weight-regular: 400;
|
|
39
|
+
--font-weight-medium: 500;
|
|
40
|
+
--font-weight-semibold: 600;
|
|
41
|
+
--font-weight-bold: 700;
|
|
42
|
+
|
|
43
|
+
/* Line Heights */
|
|
44
|
+
--line-height-tight: 1.25;
|
|
45
|
+
--line-height-normal: 1.5;
|
|
46
|
+
--line-height-relaxed: 1.75;
|
|
47
|
+
|
|
48
|
+
/* ==================== SPACING ==================== */
|
|
49
|
+
|
|
50
|
+
--spacing-0: 0;
|
|
51
|
+
--spacing-1: 0.25rem; /* 4px */
|
|
52
|
+
--spacing-1-5: 0.375rem; /* 6px */
|
|
53
|
+
--spacing-2: 0.5rem; /* 8px */
|
|
54
|
+
--spacing-3: 0.75rem; /* 12px */
|
|
55
|
+
--spacing-4: 1rem; /* 16px */
|
|
56
|
+
--spacing-5: 1.25rem; /* 20px */
|
|
57
|
+
--spacing-6: 1.5rem; /* 24px */
|
|
58
|
+
--spacing-8: 2rem; /* 32px */
|
|
59
|
+
--spacing-10: 2.5rem; /* 40px */
|
|
60
|
+
--spacing-12: 3rem; /* 48px */
|
|
61
|
+
--spacing-16: 4rem; /* 64px */
|
|
62
|
+
--spacing-20: 5rem; /* 80px */
|
|
63
|
+
--spacing-24: 6rem; /* 96px */
|
|
64
|
+
|
|
65
|
+
/* ==================== BORDER RADIUS ==================== */
|
|
66
|
+
|
|
67
|
+
--radius-none: 0;
|
|
68
|
+
--radius-sm: 0.25rem; /* 4px */
|
|
69
|
+
--radius-base: 0.5rem; /* 8px */
|
|
70
|
+
--radius-md: 0.75rem; /* 12px */
|
|
71
|
+
--radius-lg: 1rem; /* 16px */
|
|
72
|
+
--radius-xl: 1.5rem; /* 24px */
|
|
73
|
+
--radius-2xl: 2rem; /* 32px */
|
|
74
|
+
--radius-full: 9999px;
|
|
75
|
+
|
|
76
|
+
/* ==================== SHADOWS ==================== */
|
|
77
|
+
|
|
78
|
+
--shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
79
|
+
--shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
|
|
80
|
+
--shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
81
|
+
--shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
|
|
82
|
+
--shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
|
|
83
|
+
--shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
84
|
+
--shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
|
|
85
|
+
|
|
86
|
+
/* ==================== Z-INDEX SCALE ==================== */
|
|
87
|
+
|
|
88
|
+
--z-index-dropdown: 1000;
|
|
89
|
+
--z-index-sticky: 1020;
|
|
90
|
+
--z-index-fixed: 1030;
|
|
91
|
+
--z-index-modal-backdrop: 1040;
|
|
92
|
+
--z-index-modal: 1050;
|
|
93
|
+
--z-index-popover: 1060;
|
|
94
|
+
--z-index-tooltip: 1070;
|
|
95
|
+
|
|
96
|
+
/* ==================== TRANSITIONS ==================== */
|
|
97
|
+
|
|
98
|
+
--transition-speed-fast: 150ms;
|
|
99
|
+
--transition-speed-base: 200ms;
|
|
100
|
+
--transition-speed-slow: 300ms;
|
|
101
|
+
--transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
|
|
102
|
+
|
|
103
|
+
/* ==================== LIGHT THEME COLORS ==================== */
|
|
104
|
+
|
|
105
|
+
/* Body & Layout */
|
|
106
|
+
--color-body-bg: #ffffff;
|
|
107
|
+
--color-body-bg-rgb: 255, 255, 255;
|
|
108
|
+
--color-body-text: #2b2b2b;
|
|
109
|
+
--color-body-text-rgb: 43, 43, 43;
|
|
110
|
+
|
|
111
|
+
/* Hovers */
|
|
112
|
+
--color-outline-hover: #7878780d;
|
|
113
|
+
|
|
114
|
+
/* Tertiary Colors */
|
|
115
|
+
--color-tertiary: #8e8e8e;
|
|
116
|
+
--color-tertiary-rgb: 142, 142, 142;
|
|
117
|
+
--color-tertiary-bg: #f8f8f8;
|
|
118
|
+
--color-tertiary-bg-rgb: 248, 248, 248;
|
|
119
|
+
|
|
120
|
+
/* Emphasis */
|
|
121
|
+
--color-emphasis: #000000;
|
|
122
|
+
--color-emphasis-rgb: 0, 0, 0;
|
|
123
|
+
|
|
124
|
+
/* Borders */
|
|
125
|
+
--color-border: #e0e0e0;
|
|
126
|
+
--color-border-success: #19875424;
|
|
127
|
+
--color-border-warning: #f7c15924;
|
|
128
|
+
--color-border-danger: #da5b5b24;
|
|
129
|
+
--color-border-info: #377dff24;
|
|
130
|
+
--color-border-rgb: 229, 231, 235;
|
|
131
|
+
--color-primary-border-subtle: #f0b8bd;
|
|
132
|
+
|
|
133
|
+
/* Primary Brand Color */
|
|
134
|
+
--color-primary: #da5b5b;
|
|
135
|
+
--color-primary-rgb: 218, 88, 91;
|
|
136
|
+
--color-primary-hover: #b94d4d;
|
|
137
|
+
--color-primary-active: #aa4547;
|
|
138
|
+
--color-primary-bg-subtle: #f0b8bd;
|
|
139
|
+
--color-primary-text-emphasis: #da5b5b;
|
|
140
|
+
|
|
141
|
+
/* Secondary Colors */
|
|
142
|
+
--color-secondary: #565656;
|
|
143
|
+
--color-secondary-rgb: 187, 187, 187;
|
|
144
|
+
--color-secondary-bg-rgb: 75, 75, 75;
|
|
145
|
+
--color-secondary-hover: #2b2b2b;
|
|
146
|
+
--color-secondary-active: #fffff;
|
|
147
|
+
|
|
148
|
+
/* Success Colors */
|
|
149
|
+
--color-success: #198754;
|
|
150
|
+
--color-success-rgb: #ebf7ed;
|
|
151
|
+
--color-success-hover: #125f3b24;
|
|
152
|
+
--color-success-active: #126038;
|
|
153
|
+
--color-success-bg-subtle: #ebf7ed;
|
|
154
|
+
--color-success-text-emphasis: #0e4a2e;
|
|
155
|
+
--color-success-outline-text-emphasis: #157347;
|
|
156
|
+
|
|
157
|
+
/* Purple Colors */
|
|
158
|
+
--color-purple: #3D246A;
|
|
159
|
+
--color-purple-rgb: #EDE8F4;
|
|
160
|
+
/* Danger Colors */
|
|
161
|
+
--color-danger: #b94d4d;
|
|
162
|
+
--color-danger-rgb: #b94d4d15;
|
|
163
|
+
--color-danger-hover: #99404024;
|
|
164
|
+
--color-danger-active: #8f343b;
|
|
165
|
+
--color-danger-bg-subtle: #f0b8bd;
|
|
166
|
+
--color-danger-text-emphasis: #662a2a;
|
|
167
|
+
--color-danger-outline-text-emphasis: #783232;
|
|
168
|
+
|
|
169
|
+
/* Info Colors */
|
|
170
|
+
--color-info: #377dff24;
|
|
171
|
+
--color-info-rgb: #ebf2ff;
|
|
172
|
+
--color-info-hover: #2f64cc24;
|
|
173
|
+
--color-info-active: #2661cc;
|
|
174
|
+
--color-info-bg-subtle: #acf8ff;
|
|
175
|
+
--color-info-text-emphasis: #1e458c;
|
|
176
|
+
--color-info-outline-text-emphasis: #1e458c;
|
|
177
|
+
|
|
178
|
+
/* Warning Colors */
|
|
179
|
+
--color-warning: #f7c15924;
|
|
180
|
+
--color-warning-rgb: #ffedcc;
|
|
181
|
+
--color-warning-hover: #ad873e24;
|
|
182
|
+
--color-warning-active: #f3b128;
|
|
183
|
+
--color-warning-bg-subtle: #ffedcc;
|
|
184
|
+
--color-warning-text-emphasis: #886a31;
|
|
185
|
+
|
|
186
|
+
/* Gray Scale */
|
|
187
|
+
--color-gray-50: #f9fafb;
|
|
188
|
+
--color-gray-100: #f3f4f6;
|
|
189
|
+
--color-gray-200: #e5e7eb;
|
|
190
|
+
--color-gray-300: #d1d5db;
|
|
191
|
+
--color-gray-400: #9ca3af;
|
|
192
|
+
--color-gray-500: #6b7280;
|
|
193
|
+
--color-gray-600: #4b5563;
|
|
194
|
+
--color-gray-700: #374151;
|
|
195
|
+
--color-gray-800: #1f2937;
|
|
196
|
+
--color-gray-900: #111827;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* ==================== DARK THEME ==================== */
|
|
200
|
+
|
|
201
|
+
/*[data-theme="dark"] {*/
|
|
202
|
+
/* !* Body & Layout *!*/
|
|
203
|
+
/* --color-body-bg: #2b2b2b;*/
|
|
204
|
+
/* --color-body-bg-rgb: 43, 43, 43;*/
|
|
205
|
+
/* --color-body-text: #f8f8f8;*/
|
|
206
|
+
/* --color-body-text-rgb: 248, 248, 248;*/
|
|
207
|
+
|
|
208
|
+
/* !* Secondary Colors *!*/
|
|
209
|
+
/* --color-secondary: #bbbbbb;*/
|
|
210
|
+
/* --color-secondary-rgb: 187, 187, 187;*/
|
|
211
|
+
/* --color-secondary-bg: #565656;*/
|
|
212
|
+
/* --color-secondary-bg-rgb: 75, 75, 75;*/
|
|
213
|
+
/* --color-secondary-hover: #2B2B2B;*/
|
|
214
|
+
/* --color-secondary-outline-hover: #7878780D;*/
|
|
215
|
+
|
|
216
|
+
/* !* Tertiary Colors *!*/
|
|
217
|
+
/* --color-tertiary-bg: #3a3a3a;*/
|
|
218
|
+
/* --color-tertiary-bg-rgb: 58, 58, 58;*/
|
|
219
|
+
|
|
220
|
+
/* !* Emphasis *!*/
|
|
221
|
+
/* --color-emphasis: #ffffff;*/
|
|
222
|
+
/* --color-emphasis-rgb: 255, 255, 255;*/
|
|
223
|
+
|
|
224
|
+
/* !* Borders *!*/
|
|
225
|
+
/* --color-border: #E0E0E0;*/
|
|
226
|
+
/* --color-border-rgb: 75, 75, 75;*/
|
|
227
|
+
|
|
228
|
+
/* !* Primary (Dark Mode) *!*/
|
|
229
|
+
/* --color-primary-hover: #e36366;*/
|
|
230
|
+
/* --color-primary-active: #ed7478;*/
|
|
231
|
+
/* --color-primary-bg-subtle: #572424;*/
|
|
232
|
+
/* --color-primary-border-subtle: #572424;*/
|
|
233
|
+
/* --color-primary-text-emphasis: #eba5a5;*/
|
|
234
|
+
|
|
235
|
+
/* !* Success (Dark Mode) *!*/
|
|
236
|
+
/* --color-success-hover: #1fa768;*/
|
|
237
|
+
/* --color-success-active: #25c07e;*/
|
|
238
|
+
/* --color-success-bg-subtle: #0a3622;*/
|
|
239
|
+
/* --color-success-border-subtle: #0a3622;*/
|
|
240
|
+
/* --color-success-text-emphasis: #80bda1;*/
|
|
241
|
+
|
|
242
|
+
/* !* Light (Dark Mode) *!*/
|
|
243
|
+
/* --color-light: #4b4b4b;*/
|
|
244
|
+
/* --color-light-hover: #5a5a5a;*/
|
|
245
|
+
/* --color-light-active: #6a6a6a;*/
|
|
246
|
+
/*}*/
|
|
247
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { LitElement as l, html as d, unsafeCSS as p, css as _ } from "lit";
|
|
2
|
+
import { property as n, query as w, customElement as b } from "lit/decorators.js";
|
|
3
|
+
const u = ":host{display:block}.switch{display:inline-block;position:relative}.switch--md{width:36px;height:20px}.switch--sm{width:32px;height:18px}.switch__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.switch__track{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:var(--radius-full);cursor:pointer;transition:background-color var(--transition-speed-base) var(--transition-timing);background-color:var(--color-gray-300)}.switch__track--on{background-color:var(--color-primary)}.switch__track--disabled{cursor:not-allowed}.switch__track--disabled-on{background-color:color-mix(in srgb,var(--color-primary) 30%,transparent)}.switch__track--disabled-off{background-color:var(--color-gray-200)}.switch__thumb{position:absolute;background-color:#fff;border-radius:var(--radius-full);box-shadow:var(--shadow-xs);top:2px;left:2px;transform:translate(0);transition:transform var(--transition-speed-base) var(--transition-timing)}.switch--md .switch__thumb{width:16px;height:16px}.switch--sm .switch__thumb{width:14px;height:14px}.switch__thumb--on.switch--md .switch__thumb,.switch__track--on~.switch__thumb{transform:translate(16px)}.switch__track--on+.switch__thumb{transform:translate(16px)}";
|
|
4
|
+
var m = Object.defineProperty, k = Object.getOwnPropertyDescriptor, a = (e, t, r, c) => {
|
|
5
|
+
for (var s = c > 1 ? void 0 : c ? k(t, r) : t, o = e.length - 1, h; o >= 0; o--)
|
|
6
|
+
(h = e[o]) && (s = (c ? h(t, r, s) : h(s)) || s);
|
|
7
|
+
return c && s && m(t, r, s), s;
|
|
8
|
+
};
|
|
9
|
+
let i = class extends l {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.checked = !1, this.disabled = !1, this.size = "md";
|
|
12
|
+
}
|
|
13
|
+
onChange(e) {
|
|
14
|
+
const t = e.target;
|
|
15
|
+
this.checked = t.checked, this.dispatchEvent(new CustomEvent("change", {
|
|
16
|
+
detail: { checked: this.checked }
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
const e = `switch switch--${this.size}`, t = [
|
|
21
|
+
"switch__track",
|
|
22
|
+
this.checked && !this.disabled ? "switch__track--on" : "",
|
|
23
|
+
this.disabled ? "switch__track--disabled" : "",
|
|
24
|
+
this.disabled && this.checked ? "switch__track--disabled-on" : "",
|
|
25
|
+
this.disabled && !this.checked ? "switch__track--disabled-off" : ""
|
|
26
|
+
].filter(Boolean).join(" "), r = this.checked ? "translateX(16px)" : "translateX(0)";
|
|
27
|
+
return d`
|
|
28
|
+
<label class="${e}">
|
|
29
|
+
<input
|
|
30
|
+
class="switch__input"
|
|
31
|
+
type="checkbox"
|
|
32
|
+
?checked=${this.checked}
|
|
33
|
+
?disabled=${this.disabled}
|
|
34
|
+
@change=${this.onChange}
|
|
35
|
+
/>
|
|
36
|
+
<div class="${t}">
|
|
37
|
+
<span
|
|
38
|
+
class="switch__thumb"
|
|
39
|
+
style="transform: ${r}"
|
|
40
|
+
></span>
|
|
41
|
+
</div>
|
|
42
|
+
</label>
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
i.styles = [_`${p(u)}`];
|
|
47
|
+
a([
|
|
48
|
+
n({ type: Boolean })
|
|
49
|
+
], i.prototype, "checked", 2);
|
|
50
|
+
a([
|
|
51
|
+
n({ type: Boolean })
|
|
52
|
+
], i.prototype, "disabled", 2);
|
|
53
|
+
a([
|
|
54
|
+
n({ type: String })
|
|
55
|
+
], i.prototype, "size", 2);
|
|
56
|
+
a([
|
|
57
|
+
w("input")
|
|
58
|
+
], i.prototype, "inputElement", 2);
|
|
59
|
+
i = a([
|
|
60
|
+
b("logosphere-switch")
|
|
61
|
+
], i);
|
|
62
|
+
export {
|
|
63
|
+
i as S
|
|
64
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";const a=require("lit"),r=require("lit/decorators.js"),d=":host{display:block}.switch{display:inline-block;position:relative}.switch--md{width:36px;height:20px}.switch--sm{width:32px;height:18px}.switch__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.switch__track{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:var(--radius-full);cursor:pointer;transition:background-color var(--transition-speed-base) var(--transition-timing);background-color:var(--color-gray-300)}.switch__track--on{background-color:var(--color-primary)}.switch__track--disabled{cursor:not-allowed}.switch__track--disabled-on{background-color:color-mix(in srgb,var(--color-primary) 30%,transparent)}.switch__track--disabled-off{background-color:var(--color-gray-200)}.switch__thumb{position:absolute;background-color:#fff;border-radius:var(--radius-full);box-shadow:var(--shadow-xs);top:2px;left:2px;transform:translate(0);transition:transform var(--transition-speed-base) var(--transition-timing)}.switch--md .switch__thumb{width:16px;height:16px}.switch--sm .switch__thumb{width:14px;height:14px}.switch__thumb--on.switch--md .switch__thumb,.switch__track--on~.switch__thumb{transform:translate(16px)}.switch__track--on+.switch__thumb{transform:translate(16px)}";var l=Object.defineProperty,p=Object.getOwnPropertyDescriptor,c=(o,t,s,e)=>{for(var i=e>1?void 0:e?p(t,s):t,h=o.length-1,n;h>=0;h--)(n=o[h])&&(i=(e?n(t,s,i):n(i))||i);return e&&i&&l(t,s,i),i};exports.Switch=class extends a.LitElement{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.size="md"}onChange(t){const s=t.target;this.checked=s.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked}}))}render(){const t=`switch switch--${this.size}`,s=["switch__track",this.checked&&!this.disabled?"switch__track--on":"",this.disabled?"switch__track--disabled":"",this.disabled&&this.checked?"switch__track--disabled-on":"",this.disabled&&!this.checked?"switch__track--disabled-off":""].filter(Boolean).join(" "),e=this.checked?"translateX(16px)":"translateX(0)";return a.html`
|
|
2
|
+
<label class="${t}">
|
|
3
|
+
<input
|
|
4
|
+
class="switch__input"
|
|
5
|
+
type="checkbox"
|
|
6
|
+
?checked=${this.checked}
|
|
7
|
+
?disabled=${this.disabled}
|
|
8
|
+
@change=${this.onChange}
|
|
9
|
+
/>
|
|
10
|
+
<div class="${s}">
|
|
11
|
+
<span
|
|
12
|
+
class="switch__thumb"
|
|
13
|
+
style="transform: ${e}"
|
|
14
|
+
></span>
|
|
15
|
+
</div>
|
|
16
|
+
</label>
|
|
17
|
+
`}};exports.Switch.styles=[a.css`${a.unsafeCSS(d)}`];c([r.property({type:Boolean})],exports.Switch.prototype,"checked",2);c([r.property({type:Boolean})],exports.Switch.prototype,"disabled",2);c([r.property({type:String})],exports.Switch.prototype,"size",2);c([r.query("input")],exports.Switch.prototype,"inputElement",2);exports.Switch=c([r.customElement("logosphere-switch")],exports.Switch);
|
package/dist/switch.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./switch-Rnnn10bn.cjs");Object.defineProperty(exports,"Switch",{enumerable:!0,get:()=>e.Switch});
|
package/dist/switch.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { LitElement as p, nothing as c, html as r, unsafeCSS as f, css as v } from "lit";
|
|
2
|
+
import { property as b, state as h, query as _, customElement as u } from "lit/decorators.js";
|
|
3
|
+
const y = ".tab{width:100%;font-family:var(--font-family-base)}.tab__list{display:flex;overflow-x:auto;overflow-y:hidden;border-bottom:1px solid var(--color-border);scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}.tab__list::-webkit-scrollbar{display:none}.tab__button{display:inline-flex;flex-direction:row;align-items:center;gap:var(--spacing-2);padding:var(--spacing-3) var(--spacing-4);min-width:120px;position:relative;cursor:pointer;border:none;border-bottom:2px solid transparent;background:transparent;font-family:var(--font-family-base);white-space:nowrap;transition:background-color var(--transition-speed-base) var(--transition-timing),border-color var(--transition-speed-base) var(--transition-timing)}.tab__button:hover:not(.tab__button--disabled):not(.tab__button--active){background-color:var(--color-tertiary-bg)}.tab__button--active{border-bottom-color:var(--color-primary)}.tab__button--disabled{cursor:not-allowed;opacity:.4;pointer-events:none}.tab__icon{font-size:var(--font-size-xl);flex-shrink:0;color:inherit;line-height:1}.tab__content{display:flex;flex-direction:column;align-items:flex-start}.tab__label{font-weight:var(--font-weight-medium);font-size:var(--font-size-sm);color:var(--color-body-text)}.tab__label--inactive{color:var(--color-tertiary)}.tab__description{font-size:var(--font-size-xs);text-align:left;color:var(--color-tertiary)}.tab__description--active{color:var(--color-secondary)}.tab__panel{padding:var(--spacing-4);outline:none}.tab__panel--hidden{display:none}";
|
|
4
|
+
var g = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (e, i, t, a) => {
|
|
5
|
+
for (var s = a > 1 ? void 0 : a ? w(i, t) : i, l = e.length - 1, d; l >= 0; l--)
|
|
6
|
+
(d = e[l]) && (s = (a ? d(i, t, s) : d(s)) || s);
|
|
7
|
+
return a && s && g(i, t, s), s;
|
|
8
|
+
};
|
|
9
|
+
let o = class extends p {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.tabs = [], this.activeTab = "", this.lazy = !0, this.variant = "default", this._focusedIndex = 0, this._renderedTabs = /* @__PURE__ */ new Set();
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
super.connectedCallback(), !this.activeTab && this.tabs.length > 0 && (this.activeTab = this.tabs[0].id);
|
|
15
|
+
}
|
|
16
|
+
willUpdate(e) {
|
|
17
|
+
if (super.willUpdate(e), e.has("activeTab") && this.activeTab) {
|
|
18
|
+
this._renderedTabs.add(this.activeTab);
|
|
19
|
+
const i = this.tabs.findIndex((t) => t.id === this.activeTab);
|
|
20
|
+
i !== -1 && (this._focusedIndex = i);
|
|
21
|
+
}
|
|
22
|
+
e.has("tabs") && this.tabs.length > 0 && (this.tabs.some((t) => t.id === this.activeTab) || (this.activeTab = this.tabs[0].id), this._focusedIndex = this.tabs.findIndex((t) => t.id === this.activeTab));
|
|
23
|
+
}
|
|
24
|
+
// ==================== EVENTS ====================
|
|
25
|
+
handleTabClick(e, i) {
|
|
26
|
+
if (i) return;
|
|
27
|
+
const t = this.activeTab;
|
|
28
|
+
this.activeTab = e, this._focusedIndex = this.tabs.findIndex((a) => a.id === e), this.dispatchEvent(
|
|
29
|
+
new CustomEvent("tab-change", {
|
|
30
|
+
detail: { oldTab: t, newTab: e },
|
|
31
|
+
bubbles: !0,
|
|
32
|
+
composed: !0
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
handleKeyDown(e) {
|
|
37
|
+
const { tabs: i } = this;
|
|
38
|
+
if (i.filter((s) => !s.disabled).length === 0) return;
|
|
39
|
+
let t = this._focusedIndex;
|
|
40
|
+
const a = this._focusedIndex;
|
|
41
|
+
switch (e.key) {
|
|
42
|
+
case "ArrowLeft":
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
do
|
|
45
|
+
t = t > 0 ? t - 1 : i.length - 1;
|
|
46
|
+
while (i[t]?.disabled && t !== a);
|
|
47
|
+
break;
|
|
48
|
+
case "ArrowRight":
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
do
|
|
51
|
+
t = t < i.length - 1 ? t + 1 : 0;
|
|
52
|
+
while (i[t]?.disabled && t !== a);
|
|
53
|
+
break;
|
|
54
|
+
case "Home":
|
|
55
|
+
for (e.preventDefault(), t = 0; i[t]?.disabled && t < i.length - 1; ) t++;
|
|
56
|
+
break;
|
|
57
|
+
case "End":
|
|
58
|
+
for (e.preventDefault(), t = i.length - 1; i[t]?.disabled && t > 0; ) t--;
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (t !== this._focusedIndex && !i[t]?.disabled) {
|
|
64
|
+
const s = this.activeTab;
|
|
65
|
+
this._focusedIndex = t, this.activeTab = i[t].id, this.updateComplete.then(() => {
|
|
66
|
+
this.shadowRoot?.querySelector(
|
|
67
|
+
`[role="tab"][data-tab-id="${i[t].id}"]`
|
|
68
|
+
)?.focus();
|
|
69
|
+
}), this.dispatchEvent(
|
|
70
|
+
new CustomEvent("tab-change", {
|
|
71
|
+
detail: { oldTab: s, newTab: i[t].id },
|
|
72
|
+
bubbles: !0,
|
|
73
|
+
composed: !0
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
scrollTabIntoView(e) {
|
|
79
|
+
this.updateComplete.then(() => {
|
|
80
|
+
const i = this.shadowRoot?.querySelector(
|
|
81
|
+
`[role="tab"][data-tab-id="${e}"]`
|
|
82
|
+
);
|
|
83
|
+
if (i && this.tablist) {
|
|
84
|
+
const t = this.tablist.getBoundingClientRect(), a = i.getBoundingClientRect();
|
|
85
|
+
a.left < t.left ? this.tablist.scrollLeft -= t.left - a.left + 16 : a.right > t.right && (this.tablist.scrollLeft += a.right - t.right + 16);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// ==================== RENDER ====================
|
|
90
|
+
renderTabButton(e, i) {
|
|
91
|
+
const t = this.activeTab === e.id, a = this._focusedIndex === i, s = [
|
|
92
|
+
"tab__button",
|
|
93
|
+
t ? "tab__button--active" : "",
|
|
94
|
+
e.disabled ? "tab__button--disabled" : ""
|
|
95
|
+
].filter(Boolean).join(" "), l = ["tab__label", t ? "" : "tab__label--inactive"].filter(Boolean).join(" "), d = ["tab__description", t ? "tab__description--active" : ""].filter(Boolean).join(" ");
|
|
96
|
+
return r`
|
|
97
|
+
<button
|
|
98
|
+
role="tab"
|
|
99
|
+
class=${s}
|
|
100
|
+
data-tab-id=${e.id}
|
|
101
|
+
aria-selected=${t ? "true" : "false"}
|
|
102
|
+
aria-controls="panel-${e.id}"
|
|
103
|
+
tabindex=${t || a ? "0" : "-1"}
|
|
104
|
+
?disabled=${e.disabled}
|
|
105
|
+
@click=${() => this.handleTabClick(e.id, e.disabled)}
|
|
106
|
+
@focus=${() => this.scrollTabIntoView(e.id)}
|
|
107
|
+
>
|
|
108
|
+
${e.icon ? r`<i class="${e.icon} tab__icon"></i>` : c}
|
|
109
|
+
<div class="tab__content">
|
|
110
|
+
<span class=${l}>${e.label}</span>
|
|
111
|
+
${e.description ? r`<span class=${d}>${e.description}</span>` : c}
|
|
112
|
+
</div>
|
|
113
|
+
</button>
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
116
|
+
renderTabPanel(e) {
|
|
117
|
+
const i = this.activeTab === e.id;
|
|
118
|
+
if (!(!this.lazy || this._renderedTabs.has(e.id))) return c;
|
|
119
|
+
const a = ["tab__panel", i ? "" : "tab__panel--hidden"].filter(Boolean).join(" ");
|
|
120
|
+
return r`
|
|
121
|
+
<div
|
|
122
|
+
role="tabpanel"
|
|
123
|
+
id="panel-${e.id}"
|
|
124
|
+
aria-labelledby="tab-${e.id}"
|
|
125
|
+
class=${a}
|
|
126
|
+
tabindex="0"
|
|
127
|
+
>
|
|
128
|
+
<slot name=${`panel-${e.id}`}>
|
|
129
|
+
${typeof e.content == "string" ? r`${e.content}` : c}
|
|
130
|
+
</slot>
|
|
131
|
+
</div>
|
|
132
|
+
`;
|
|
133
|
+
}
|
|
134
|
+
render() {
|
|
135
|
+
return r`
|
|
136
|
+
<div class="tab">
|
|
137
|
+
<div role="tablist" aria-label="Tabs" class="tab__list" @keydown=${this.handleKeyDown}>
|
|
138
|
+
${this.tabs.map((e, i) => this.renderTabButton(e, i))}
|
|
139
|
+
</div>
|
|
140
|
+
<div class="tab__panels">${this.tabs.map((e) => this.renderTabPanel(e))}</div>
|
|
141
|
+
</div>
|
|
142
|
+
`;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
o.styles = [
|
|
146
|
+
v`
|
|
147
|
+
${f(y)}
|
|
148
|
+
`
|
|
149
|
+
];
|
|
150
|
+
n([
|
|
151
|
+
b({ type: Array })
|
|
152
|
+
], o.prototype, "tabs", 2);
|
|
153
|
+
n([
|
|
154
|
+
b({ type: String })
|
|
155
|
+
], o.prototype, "activeTab", 2);
|
|
156
|
+
n([
|
|
157
|
+
b({ type: Boolean })
|
|
158
|
+
], o.prototype, "lazy", 2);
|
|
159
|
+
n([
|
|
160
|
+
b({ type: String })
|
|
161
|
+
], o.prototype, "variant", 2);
|
|
162
|
+
n([
|
|
163
|
+
h()
|
|
164
|
+
], o.prototype, "_focusedIndex", 2);
|
|
165
|
+
n([
|
|
166
|
+
h()
|
|
167
|
+
], o.prototype, "_renderedTabs", 2);
|
|
168
|
+
n([
|
|
169
|
+
_('[role="tablist"]')
|
|
170
|
+
], o.prototype, "tablist", 2);
|
|
171
|
+
o = n([
|
|
172
|
+
u("logosphere-tab")
|
|
173
|
+
], o);
|
|
174
|
+
export {
|
|
175
|
+
o as L
|
|
176
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";const s=require("lit"),n=require("lit/decorators.js"),c=".tab{width:100%;font-family:var(--font-family-base)}.tab__list{display:flex;overflow-x:auto;overflow-y:hidden;border-bottom:1px solid var(--color-border);scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}.tab__list::-webkit-scrollbar{display:none}.tab__button{display:inline-flex;flex-direction:row;align-items:center;gap:var(--spacing-2);padding:var(--spacing-3) var(--spacing-4);min-width:120px;position:relative;cursor:pointer;border:none;border-bottom:2px solid transparent;background:transparent;font-family:var(--font-family-base);white-space:nowrap;transition:background-color var(--transition-speed-base) var(--transition-timing),border-color var(--transition-speed-base) var(--transition-timing)}.tab__button:hover:not(.tab__button--disabled):not(.tab__button--active){background-color:var(--color-tertiary-bg)}.tab__button--active{border-bottom-color:var(--color-primary)}.tab__button--disabled{cursor:not-allowed;opacity:.4;pointer-events:none}.tab__icon{font-size:var(--font-size-xl);flex-shrink:0;color:inherit;line-height:1}.tab__content{display:flex;flex-direction:column;align-items:flex-start}.tab__label{font-weight:var(--font-weight-medium);font-size:var(--font-size-sm);color:var(--color-body-text)}.tab__label--inactive{color:var(--color-tertiary)}.tab__description{font-size:var(--font-size-xs);text-align:left;color:var(--color-tertiary)}.tab__description--active{color:var(--color-secondary)}.tab__panel{padding:var(--spacing-4);outline:none}.tab__panel--hidden{display:none}";var h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,r=(d,e,a,t)=>{for(var i=t>1?void 0:t?p(e,a):e,o=d.length-1,l;o>=0;o--)(l=d[o])&&(i=(t?l(e,a,i):l(i))||i);return t&&i&&h(e,a,i),i};exports.LogosphereTab=class extends s.LitElement{constructor(){super(...arguments),this.tabs=[],this.activeTab="",this.lazy=!0,this.variant="default",this._focusedIndex=0,this._renderedTabs=new Set}connectedCallback(){super.connectedCallback(),!this.activeTab&&this.tabs.length>0&&(this.activeTab=this.tabs[0].id)}willUpdate(e){if(super.willUpdate(e),e.has("activeTab")&&this.activeTab){this._renderedTabs.add(this.activeTab);const a=this.tabs.findIndex(t=>t.id===this.activeTab);a!==-1&&(this._focusedIndex=a)}e.has("tabs")&&this.tabs.length>0&&(this.tabs.some(t=>t.id===this.activeTab)||(this.activeTab=this.tabs[0].id),this._focusedIndex=this.tabs.findIndex(t=>t.id===this.activeTab))}handleTabClick(e,a){if(a)return;const t=this.activeTab;this.activeTab=e,this._focusedIndex=this.tabs.findIndex(i=>i.id===e),this.dispatchEvent(new CustomEvent("tab-change",{detail:{oldTab:t,newTab:e},bubbles:!0,composed:!0}))}handleKeyDown(e){const{tabs:a}=this;if(a.filter(o=>!o.disabled).length===0)return;let t=this._focusedIndex;const i=this._focusedIndex;switch(e.key){case"ArrowLeft":e.preventDefault();do t=t>0?t-1:a.length-1;while(a[t]?.disabled&&t!==i);break;case"ArrowRight":e.preventDefault();do t=t<a.length-1?t+1:0;while(a[t]?.disabled&&t!==i);break;case"Home":for(e.preventDefault(),t=0;a[t]?.disabled&&t<a.length-1;)t++;break;case"End":for(e.preventDefault(),t=a.length-1;a[t]?.disabled&&t>0;)t--;break;default:return}if(t!==this._focusedIndex&&!a[t]?.disabled){const o=this.activeTab;this._focusedIndex=t,this.activeTab=a[t].id,this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`[role="tab"][data-tab-id="${a[t].id}"]`)?.focus()}),this.dispatchEvent(new CustomEvent("tab-change",{detail:{oldTab:o,newTab:a[t].id},bubbles:!0,composed:!0}))}}scrollTabIntoView(e){this.updateComplete.then(()=>{const a=this.shadowRoot?.querySelector(`[role="tab"][data-tab-id="${e}"]`);if(a&&this.tablist){const t=this.tablist.getBoundingClientRect(),i=a.getBoundingClientRect();i.left<t.left?this.tablist.scrollLeft-=t.left-i.left+16:i.right>t.right&&(this.tablist.scrollLeft+=i.right-t.right+16)}})}renderTabButton(e,a){const t=this.activeTab===e.id,i=this._focusedIndex===a,o=["tab__button",t?"tab__button--active":"",e.disabled?"tab__button--disabled":""].filter(Boolean).join(" "),l=["tab__label",t?"":"tab__label--inactive"].filter(Boolean).join(" "),b=["tab__description",t?"tab__description--active":""].filter(Boolean).join(" ");return s.html`
|
|
2
|
+
<button
|
|
3
|
+
role="tab"
|
|
4
|
+
class=${o}
|
|
5
|
+
data-tab-id=${e.id}
|
|
6
|
+
aria-selected=${t?"true":"false"}
|
|
7
|
+
aria-controls="panel-${e.id}"
|
|
8
|
+
tabindex=${t||i?"0":"-1"}
|
|
9
|
+
?disabled=${e.disabled}
|
|
10
|
+
@click=${()=>this.handleTabClick(e.id,e.disabled)}
|
|
11
|
+
@focus=${()=>this.scrollTabIntoView(e.id)}
|
|
12
|
+
>
|
|
13
|
+
${e.icon?s.html`<i class="${e.icon} tab__icon"></i>`:s.nothing}
|
|
14
|
+
<div class="tab__content">
|
|
15
|
+
<span class=${l}>${e.label}</span>
|
|
16
|
+
${e.description?s.html`<span class=${b}>${e.description}</span>`:s.nothing}
|
|
17
|
+
</div>
|
|
18
|
+
</button>
|
|
19
|
+
`}renderTabPanel(e){const a=this.activeTab===e.id;if(!(!this.lazy||this._renderedTabs.has(e.id)))return s.nothing;const i=["tab__panel",a?"":"tab__panel--hidden"].filter(Boolean).join(" ");return s.html`
|
|
20
|
+
<div
|
|
21
|
+
role="tabpanel"
|
|
22
|
+
id="panel-${e.id}"
|
|
23
|
+
aria-labelledby="tab-${e.id}"
|
|
24
|
+
class=${i}
|
|
25
|
+
tabindex="0"
|
|
26
|
+
>
|
|
27
|
+
<slot name=${`panel-${e.id}`}>
|
|
28
|
+
${typeof e.content=="string"?s.html`${e.content}`:s.nothing}
|
|
29
|
+
</slot>
|
|
30
|
+
</div>
|
|
31
|
+
`}render(){return s.html`
|
|
32
|
+
<div class="tab">
|
|
33
|
+
<div role="tablist" aria-label="Tabs" class="tab__list" @keydown=${this.handleKeyDown}>
|
|
34
|
+
${this.tabs.map((e,a)=>this.renderTabButton(e,a))}
|
|
35
|
+
</div>
|
|
36
|
+
<div class="tab__panels">${this.tabs.map(e=>this.renderTabPanel(e))}</div>
|
|
37
|
+
</div>
|
|
38
|
+
`}};exports.LogosphereTab.styles=[s.css`
|
|
39
|
+
${s.unsafeCSS(c)}
|
|
40
|
+
`];r([n.property({type:Array})],exports.LogosphereTab.prototype,"tabs",2);r([n.property({type:String})],exports.LogosphereTab.prototype,"activeTab",2);r([n.property({type:Boolean})],exports.LogosphereTab.prototype,"lazy",2);r([n.property({type:String})],exports.LogosphereTab.prototype,"variant",2);r([n.state()],exports.LogosphereTab.prototype,"_focusedIndex",2);r([n.state()],exports.LogosphereTab.prototype,"_renderedTabs",2);r([n.query('[role="tablist"]')],exports.LogosphereTab.prototype,"tablist",2);exports.LogosphereTab=r([n.customElement("logosphere-tab")],exports.LogosphereTab);
|
package/dist/tab.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./tab-DcjAlXzU.cjs");Object.defineProperty(exports,"LogosphereTab",{enumerable:!0,get:()=>e.LogosphereTab});
|
package/dist/tab.js
ADDED