@krumio/trailhand-ui 1.5.0 → 1.7.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/README.md +102 -11
- package/dist/components/button/button.d.ts +20 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +189 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/button/index.js +2 -0
- package/dist/components/button/index.js.map +1 -0
- package/dist/components/icon/icon.d.ts +18 -0
- package/dist/components/icon/icon.d.ts.map +1 -0
- package/dist/components/icon/icon.js +44 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.d.ts.map +1 -0
- package/dist/components/icon/index.js +2 -0
- package/dist/components/icon/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/styles/colors.css +132 -0
- package/package.json +25 -28
- package/dist/Button.d.ts +0 -15
- package/dist/Button.d.ts.map +0 -1
- package/dist/Button.js +0 -18
- package/dist/Button.js.map +0 -1
- package/dist/Header.d.ts +0 -15
- package/dist/Header.d.ts.map +0 -1
- package/dist/Header.js +0 -44
- package/dist/Header.js.map +0 -1
- package/dist/Page.d.ts +0 -9
- package/dist/Page.d.ts.map +0 -1
- package/dist/Page.js +0 -61
- package/dist/Page.js.map +0 -1
- package/dist/action-menu.d.ts +0 -79
- package/dist/action-menu.d.ts.map +0 -1
- package/dist/action-menu.js +0 -321
- package/dist/action-menu.js.map +0 -1
- package/dist/assets/index-B7q5L5KS.js +0 -91
- package/dist/components/action-menu/action-menu.stories.d.ts +0 -261
- package/dist/components/action-menu/action-menu.stories.d.ts.map +0 -1
- package/dist/components/action-menu/action-menu.stories.js +0 -363
- package/dist/components/action-menu/action-menu.stories.js.map +0 -1
- package/dist/components/data-table/data-table.stories.d.ts +0 -507
- package/dist/components/data-table/data-table.stories.d.ts.map +0 -1
- package/dist/components/data-table/data-table.stories.js +0 -601
- package/dist/components/data-table/data-table.stories.js.map +0 -1
- package/dist/components/th-card/index.d.ts +0 -3
- package/dist/components/th-card/index.d.ts.map +0 -1
- package/dist/components/th-card/index.js +0 -2
- package/dist/components/th-card/index.js.map +0 -1
- package/dist/components/th-card/th-card.d.ts +0 -78
- package/dist/components/th-card/th-card.d.ts.map +0 -1
- package/dist/components/th-card/th-card.js +0 -449
- package/dist/components/th-card/th-card.js.map +0 -1
- package/dist/components/th-card/th-card.stories.d.ts +0 -232
- package/dist/components/th-card/th-card.stories.d.ts.map +0 -1
- package/dist/components/th-card/th-card.stories.js +0 -385
- package/dist/components/th-card/th-card.stories.js.map +0 -1
- package/dist/components/th-tag/index.d.ts +0 -3
- package/dist/components/th-tag/index.d.ts.map +0 -1
- package/dist/components/th-tag/index.js +0 -2
- package/dist/components/th-tag/index.js.map +0 -1
- package/dist/components/th-tag/th-tag.d.ts +0 -65
- package/dist/components/th-tag/th-tag.d.ts.map +0 -1
- package/dist/components/th-tag/th-tag.js +0 -307
- package/dist/components/th-tag/th-tag.js.map +0 -1
- package/dist/components/th-tag/th-tag.stories.d.ts +0 -277
- package/dist/components/th-tag/th-tag.stories.d.ts.map +0 -1
- package/dist/components/th-tag/th-tag.stories.js +0 -415
- package/dist/components/th-tag/th-tag.stories.js.map +0 -1
- package/dist/components/toggle-switch/toggle-switch.stories.d.ts +0 -239
- package/dist/components/toggle-switch/toggle-switch.stories.d.ts.map +0 -1
- package/dist/components/toggle-switch/toggle-switch.stories.js +0 -408
- package/dist/components/toggle-switch/toggle-switch.stories.js.map +0 -1
- package/dist/data-table.d.ts +0 -191
- package/dist/data-table.d.ts.map +0 -1
- package/dist/data-table.js +0 -796
- package/dist/data-table.js.map +0 -1
- package/dist/design-system/color-palette.stories.d.ts +0 -24
- package/dist/design-system/color-palette.stories.d.ts.map +0 -1
- package/dist/design-system/color-palette.stories.js +0 -361
- package/dist/design-system/color-palette.stories.js.map +0 -1
- package/dist/index.html +0 -102
- package/dist/toggle-switch.d.ts +0 -38
- package/dist/toggle-switch.d.ts.map +0 -1
- package/dist/toggle-switch.js +0 -175
- package/dist/toggle-switch.js.map +0 -1
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
-
/**
|
|
3
|
-
* Card variant types for different visual styles
|
|
4
|
-
*/
|
|
5
|
-
export type CardVariant = 'default' | 'info' | 'outlined';
|
|
6
|
-
/**
|
|
7
|
-
* A flexible card component for displaying content in a contained box.
|
|
8
|
-
* Supports multiple variants, dismissible mode, and various slots for content.
|
|
9
|
-
*
|
|
10
|
-
* @fires card-dismiss - Fired when the dismiss button is clicked (if dismissible)
|
|
11
|
-
*
|
|
12
|
-
* @slot icon - Slot for an icon in the header
|
|
13
|
-
* @slot title - Slot for the card title
|
|
14
|
-
* @slot subtitle - Slot for a subtitle (info variant)
|
|
15
|
-
* @slot - Default slot for main body content
|
|
16
|
-
* @slot action - Slot for action buttons
|
|
17
|
-
* @slot footer - Slot for footer content (lists, links, etc.)
|
|
18
|
-
*/
|
|
19
|
-
export declare class ThCard extends LitElement {
|
|
20
|
-
/**
|
|
21
|
-
* Visual variant/style of the card
|
|
22
|
-
*/
|
|
23
|
-
variant: CardVariant;
|
|
24
|
-
/**
|
|
25
|
-
* Whether the card can be dismissed/closed
|
|
26
|
-
*/
|
|
27
|
-
dismissible: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Unique identifier for the card (used in dismiss events)
|
|
30
|
-
*/
|
|
31
|
-
cardId: string;
|
|
32
|
-
/**
|
|
33
|
-
* Card title (alternative to using title slot)
|
|
34
|
-
*/
|
|
35
|
-
cardTitle: string;
|
|
36
|
-
/**
|
|
37
|
-
* Card subtitle (alternative to using subtitle slot)
|
|
38
|
-
*/
|
|
39
|
-
subtitle: string;
|
|
40
|
-
/**
|
|
41
|
-
* Card description/body text (alternative to using default slot)
|
|
42
|
-
*/
|
|
43
|
-
description: string;
|
|
44
|
-
/**
|
|
45
|
-
* Icon class name (e.g., 'icon-namespace') - alternative to icon slot
|
|
46
|
-
*/
|
|
47
|
-
iconClass: string;
|
|
48
|
-
/**
|
|
49
|
-
* Icon URL (for image icons) - alternative to icon slot
|
|
50
|
-
*/
|
|
51
|
-
iconSrc: string;
|
|
52
|
-
/**
|
|
53
|
-
* Whether the card is in a loading state
|
|
54
|
-
*/
|
|
55
|
-
loading: boolean;
|
|
56
|
-
static styles: import("lit").CSSResult;
|
|
57
|
-
/**
|
|
58
|
-
* Handle dismiss button click
|
|
59
|
-
*/
|
|
60
|
-
private _handleDismiss;
|
|
61
|
-
/**
|
|
62
|
-
* Render the dismiss button SVG icon
|
|
63
|
-
*/
|
|
64
|
-
private _renderDismissIcon;
|
|
65
|
-
/**
|
|
66
|
-
* Render the icon based on iconClass, iconSrc, or slot
|
|
67
|
-
*/
|
|
68
|
-
private _renderIcon;
|
|
69
|
-
/**
|
|
70
|
-
* Check if icon slot or props have content
|
|
71
|
-
*/
|
|
72
|
-
private _hasIcon;
|
|
73
|
-
/**
|
|
74
|
-
* Render the component
|
|
75
|
-
*/
|
|
76
|
-
render(): TemplateResult;
|
|
77
|
-
}
|
|
78
|
-
//# sourceMappingURL=th-card.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"th-card.d.ts","sourceRoot":"","sources":["../../../src/components/th-card/th-card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,cAAc,EAAW,MAAM,KAAK,CAAC;AAGrE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAS1D;;;;;;;;;;;;GAYG;AACH,qBAAa,MAAO,SAAQ,UAAU;IACpC;;OAEG;IAEH,OAAO,EAAE,WAAW,CAAa;IAEjC;;OAEG;IAEH,WAAW,UAAS;IAEpB;;OAEG;IAEH,MAAM,SAAM;IAEZ;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,QAAQ,SAAM;IAEd;;OAEG;IAEH,WAAW,SAAM;IAEjB;;OAEG;IAEH,SAAS,SAAM;IAEf;;OAEG;IAEH,OAAO,SAAM;IAEb;;OAEG;IAEH,OAAO,UAAS;IAEhB,OAAgB,MAAM,0BAiNpB;IAEF;;OAEG;IACH,OAAO,CAAC,cAAc;IAWtB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAiB1B;;OAEG;IACH,OAAO,CAAC,WAAW;IAwBnB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;OAEG;IACM,MAAM,IAAI,cAAc;CAsFlC"}
|
|
@@ -1,449 +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, html, css, nothing } from 'lit';
|
|
8
|
-
import { property } from 'lit/decorators.js';
|
|
9
|
-
/**
|
|
10
|
-
* A flexible card component for displaying content in a contained box.
|
|
11
|
-
* Supports multiple variants, dismissible mode, and various slots for content.
|
|
12
|
-
*
|
|
13
|
-
* @fires card-dismiss - Fired when the dismiss button is clicked (if dismissible)
|
|
14
|
-
*
|
|
15
|
-
* @slot icon - Slot for an icon in the header
|
|
16
|
-
* @slot title - Slot for the card title
|
|
17
|
-
* @slot subtitle - Slot for a subtitle (info variant)
|
|
18
|
-
* @slot - Default slot for main body content
|
|
19
|
-
* @slot action - Slot for action buttons
|
|
20
|
-
* @slot footer - Slot for footer content (lists, links, etc.)
|
|
21
|
-
*/
|
|
22
|
-
export class ThCard extends LitElement {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
/**
|
|
26
|
-
* Visual variant/style of the card
|
|
27
|
-
*/
|
|
28
|
-
this.variant = 'default';
|
|
29
|
-
/**
|
|
30
|
-
* Whether the card can be dismissed/closed
|
|
31
|
-
*/
|
|
32
|
-
this.dismissible = false;
|
|
33
|
-
/**
|
|
34
|
-
* Unique identifier for the card (used in dismiss events)
|
|
35
|
-
*/
|
|
36
|
-
this.cardId = '';
|
|
37
|
-
/**
|
|
38
|
-
* Card title (alternative to using title slot)
|
|
39
|
-
*/
|
|
40
|
-
this.cardTitle = '';
|
|
41
|
-
/**
|
|
42
|
-
* Card subtitle (alternative to using subtitle slot)
|
|
43
|
-
*/
|
|
44
|
-
this.subtitle = '';
|
|
45
|
-
/**
|
|
46
|
-
* Card description/body text (alternative to using default slot)
|
|
47
|
-
*/
|
|
48
|
-
this.description = '';
|
|
49
|
-
/**
|
|
50
|
-
* Icon class name (e.g., 'icon-namespace') - alternative to icon slot
|
|
51
|
-
*/
|
|
52
|
-
this.iconClass = '';
|
|
53
|
-
/**
|
|
54
|
-
* Icon URL (for image icons) - alternative to icon slot
|
|
55
|
-
*/
|
|
56
|
-
this.iconSrc = '';
|
|
57
|
-
/**
|
|
58
|
-
* Whether the card is in a loading state
|
|
59
|
-
*/
|
|
60
|
-
this.loading = false;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Handle dismiss button click
|
|
64
|
-
*/
|
|
65
|
-
_handleDismiss(e) {
|
|
66
|
-
e.stopPropagation();
|
|
67
|
-
const event = new CustomEvent('card-dismiss', {
|
|
68
|
-
bubbles: true,
|
|
69
|
-
composed: true,
|
|
70
|
-
detail: { id: this.cardId },
|
|
71
|
-
});
|
|
72
|
-
this.dispatchEvent(event);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Render the dismiss button SVG icon
|
|
76
|
-
*/
|
|
77
|
-
_renderDismissIcon() {
|
|
78
|
-
return html `
|
|
79
|
-
<svg
|
|
80
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
81
|
-
viewBox="0 0 20 20"
|
|
82
|
-
fill="currentColor"
|
|
83
|
-
aria-hidden="true"
|
|
84
|
-
>
|
|
85
|
-
<path
|
|
86
|
-
fill-rule="evenodd"
|
|
87
|
-
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
88
|
-
clip-rule="evenodd"
|
|
89
|
-
/>
|
|
90
|
-
</svg>
|
|
91
|
-
`;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Render the icon based on iconClass, iconSrc, or slot
|
|
95
|
-
*/
|
|
96
|
-
_renderIcon() {
|
|
97
|
-
if (this.iconSrc) {
|
|
98
|
-
return html `
|
|
99
|
-
<div class="card__icon" part="icon">
|
|
100
|
-
<img src=${this.iconSrc} alt="" />
|
|
101
|
-
</div>
|
|
102
|
-
`;
|
|
103
|
-
}
|
|
104
|
-
if (this.iconClass) {
|
|
105
|
-
return html `
|
|
106
|
-
<div class="card__icon" part="icon">
|
|
107
|
-
<i class=${this.iconClass}></i>
|
|
108
|
-
</div>
|
|
109
|
-
`;
|
|
110
|
-
}
|
|
111
|
-
return html `
|
|
112
|
-
<div class="card__icon" part="icon">
|
|
113
|
-
<slot name="icon"></slot>
|
|
114
|
-
</div>
|
|
115
|
-
`;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Check if icon slot or props have content
|
|
119
|
-
*/
|
|
120
|
-
_hasIcon() {
|
|
121
|
-
return !!(this.iconSrc || this.iconClass || this.querySelector('[slot="icon"]'));
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Render the component
|
|
125
|
-
*/
|
|
126
|
-
render() {
|
|
127
|
-
const classes = [
|
|
128
|
-
'card',
|
|
129
|
-
`card--${this.variant}`,
|
|
130
|
-
this.loading ? 'card--loading' : '',
|
|
131
|
-
].filter(Boolean).join(' ');
|
|
132
|
-
if (this.loading) {
|
|
133
|
-
return html `
|
|
134
|
-
<div class=${classes} part="card">
|
|
135
|
-
<div class="card__spinner"></div>
|
|
136
|
-
</div>
|
|
137
|
-
`;
|
|
138
|
-
}
|
|
139
|
-
// Info variant - horizontal layout
|
|
140
|
-
if (this.variant === 'info') {
|
|
141
|
-
return html `
|
|
142
|
-
<div class=${classes} part="card">
|
|
143
|
-
${this._hasIcon() ? this._renderIcon() : nothing}
|
|
144
|
-
<div class="card__header">
|
|
145
|
-
<div class="card__title-group">
|
|
146
|
-
<h3 class="card__title" part="title">
|
|
147
|
-
${this.cardTitle || html `<slot name="title"></slot>`}
|
|
148
|
-
</h3>
|
|
149
|
-
${this.subtitle
|
|
150
|
-
? html `<p class="card__subtitle" part="subtitle">${this.subtitle}</p>`
|
|
151
|
-
: html `<slot name="subtitle"></slot>`}
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
${this.dismissible
|
|
155
|
-
? html `
|
|
156
|
-
<button
|
|
157
|
-
class="card__dismiss"
|
|
158
|
-
part="dismiss"
|
|
159
|
-
type="button"
|
|
160
|
-
aria-label="Dismiss card"
|
|
161
|
-
@click=${this._handleDismiss}
|
|
162
|
-
>
|
|
163
|
-
${this._renderDismissIcon()}
|
|
164
|
-
</button>
|
|
165
|
-
`
|
|
166
|
-
: nothing}
|
|
167
|
-
</div>
|
|
168
|
-
`;
|
|
169
|
-
}
|
|
170
|
-
// Default/outlined variant - vertical layout
|
|
171
|
-
return html `
|
|
172
|
-
<div class=${classes} part="card">
|
|
173
|
-
<div class="card__header">
|
|
174
|
-
${this._hasIcon() ? this._renderIcon() : nothing}
|
|
175
|
-
<div class="card__title-group">
|
|
176
|
-
<h3 class="card__title" part="title">
|
|
177
|
-
${this.cardTitle || html `<slot name="title"></slot>`}
|
|
178
|
-
</h3>
|
|
179
|
-
</div>
|
|
180
|
-
${this.dismissible
|
|
181
|
-
? html `
|
|
182
|
-
<button
|
|
183
|
-
class="card__dismiss"
|
|
184
|
-
part="dismiss"
|
|
185
|
-
type="button"
|
|
186
|
-
aria-label="Dismiss card"
|
|
187
|
-
@click=${this._handleDismiss}
|
|
188
|
-
>
|
|
189
|
-
${this._renderDismissIcon()}
|
|
190
|
-
</button>
|
|
191
|
-
`
|
|
192
|
-
: nothing}
|
|
193
|
-
</div>
|
|
194
|
-
|
|
195
|
-
<div class="card__body" part="body">
|
|
196
|
-
${this.description || html `<slot></slot>`}
|
|
197
|
-
</div>
|
|
198
|
-
|
|
199
|
-
<div class="card__action" part="action">
|
|
200
|
-
<slot name="action"></slot>
|
|
201
|
-
</div>
|
|
202
|
-
|
|
203
|
-
<div class="card__footer" part="footer">
|
|
204
|
-
<slot name="footer"></slot>
|
|
205
|
-
</div>
|
|
206
|
-
</div>
|
|
207
|
-
`;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
ThCard.styles = css `
|
|
211
|
-
:host {
|
|
212
|
-
display: block;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.card {
|
|
216
|
-
display: flex;
|
|
217
|
-
flex-direction: column;
|
|
218
|
-
background: var(--th-card-bg, #ffffff);
|
|
219
|
-
border-radius: var(--th-card-radius, 8px);
|
|
220
|
-
transition: box-shadow 0.2s ease;
|
|
221
|
-
height: 100%;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/* Variant styles */
|
|
225
|
-
.card--default {
|
|
226
|
-
border: 1px solid var(--th-card-border, #e5e7eb);
|
|
227
|
-
padding: var(--th-card-padding, 20px);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.card--outlined {
|
|
231
|
-
border: 1px solid var(--th-card-border, #e5e7eb);
|
|
232
|
-
padding: var(--th-card-padding, 20px);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.card--info {
|
|
236
|
-
border: 1px solid var(--th-card-border, #e5e7eb);
|
|
237
|
-
padding: var(--th-card-padding, 16px 20px);
|
|
238
|
-
flex-direction: row;
|
|
239
|
-
align-items: center;
|
|
240
|
-
gap: 12px;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.card:hover {
|
|
244
|
-
box-shadow: var(--th-card-hover-shadow, 0 2px 8px rgba(0, 0, 0, 0.08));
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/* Header section */
|
|
248
|
-
.card__header {
|
|
249
|
-
display: flex;
|
|
250
|
-
align-items: center;
|
|
251
|
-
gap: 12px;
|
|
252
|
-
margin-bottom: 12px;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.card--info .card__header {
|
|
256
|
-
margin-bottom: 0;
|
|
257
|
-
flex: 1;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/* Icon styles */
|
|
261
|
-
.card__icon {
|
|
262
|
-
display: flex;
|
|
263
|
-
align-items: center;
|
|
264
|
-
justify-content: center;
|
|
265
|
-
flex-shrink: 0;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.card__icon img {
|
|
269
|
-
width: 40px;
|
|
270
|
-
height: 40px;
|
|
271
|
-
object-fit: contain;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
.card__icon i {
|
|
275
|
-
font-size: 24px;
|
|
276
|
-
color: var(--th-card-icon-color, #3b82f6);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.card--info .card__icon img {
|
|
280
|
-
width: 48px;
|
|
281
|
-
height: 48px;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
/* Title styles */
|
|
285
|
-
.card__title-group {
|
|
286
|
-
flex: 1;
|
|
287
|
-
min-width: 0;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.card__title {
|
|
291
|
-
margin: 0;
|
|
292
|
-
font-size: 18px;
|
|
293
|
-
font-weight: 600;
|
|
294
|
-
color: var(--th-card-title-color, #111827);
|
|
295
|
-
line-height: 1.3;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.card__title a {
|
|
299
|
-
color: inherit;
|
|
300
|
-
text-decoration: none;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.card__title a:hover {
|
|
304
|
-
color: var(--th-primary, #3b82f6);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.card--info .card__title {
|
|
308
|
-
font-size: 16px;
|
|
309
|
-
color: var(--th-primary, #3b82f6);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.card__subtitle {
|
|
313
|
-
margin: 4px 0 0 0;
|
|
314
|
-
font-size: 14px;
|
|
315
|
-
color: var(--th-card-subtitle-color, #6b7280);
|
|
316
|
-
line-height: 1.4;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
/* Body content */
|
|
320
|
-
.card__body {
|
|
321
|
-
flex: 1;
|
|
322
|
-
font-size: 14px;
|
|
323
|
-
line-height: 1.6;
|
|
324
|
-
color: var(--th-card-text-color, #4b5563);
|
|
325
|
-
margin-bottom: 16px;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.card--info .card__body {
|
|
329
|
-
display: none;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
/* Action section */
|
|
333
|
-
.card__action {
|
|
334
|
-
margin-bottom: 16px;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.card__action ::slotted(a),
|
|
338
|
-
.card__action ::slotted(button) {
|
|
339
|
-
display: inline-flex;
|
|
340
|
-
align-items: center;
|
|
341
|
-
justify-content: center;
|
|
342
|
-
padding: 10px 20px;
|
|
343
|
-
font-size: 14px;
|
|
344
|
-
font-weight: 500;
|
|
345
|
-
border-radius: 6px;
|
|
346
|
-
text-decoration: none;
|
|
347
|
-
cursor: pointer;
|
|
348
|
-
transition: all 0.15s ease;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/* Footer section */
|
|
352
|
-
.card__footer {
|
|
353
|
-
border-top: 1px solid var(--th-card-border, #e5e7eb);
|
|
354
|
-
padding-top: 16px;
|
|
355
|
-
margin-top: auto;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.card__footer ::slotted(h3),
|
|
359
|
-
.card__footer ::slotted(h4) {
|
|
360
|
-
margin: 0 0 12px 0;
|
|
361
|
-
font-size: 14px;
|
|
362
|
-
font-weight: 600;
|
|
363
|
-
color: var(--th-card-title-color, #111827);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/* Dismiss button */
|
|
367
|
-
.card__dismiss {
|
|
368
|
-
display: flex;
|
|
369
|
-
align-items: center;
|
|
370
|
-
justify-content: center;
|
|
371
|
-
background: none;
|
|
372
|
-
border: none;
|
|
373
|
-
padding: 4px;
|
|
374
|
-
cursor: pointer;
|
|
375
|
-
color: var(--th-card-dismiss-color, #9ca3af);
|
|
376
|
-
opacity: 0.7;
|
|
377
|
-
transition: opacity 0.15s ease, color 0.15s ease;
|
|
378
|
-
flex-shrink: 0;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
.card__dismiss:hover {
|
|
382
|
-
opacity: 1;
|
|
383
|
-
color: var(--th-card-dismiss-hover-color, #6b7280);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.card__dismiss svg {
|
|
387
|
-
width: 20px;
|
|
388
|
-
height: 20px;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
/* Loading state */
|
|
392
|
-
.card--loading {
|
|
393
|
-
min-height: 200px;
|
|
394
|
-
display: flex;
|
|
395
|
-
align-items: center;
|
|
396
|
-
justify-content: center;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
.card__spinner {
|
|
400
|
-
width: 32px;
|
|
401
|
-
height: 32px;
|
|
402
|
-
border: 3px solid var(--th-card-border, #e5e7eb);
|
|
403
|
-
border-top-color: var(--th-primary, #3b82f6);
|
|
404
|
-
border-radius: 50%;
|
|
405
|
-
animation: spin 0.8s linear infinite;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
@keyframes spin {
|
|
409
|
-
to {
|
|
410
|
-
transform: rotate(360deg);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/* Empty slots handling */
|
|
415
|
-
.card__action:empty,
|
|
416
|
-
.card__footer:empty {
|
|
417
|
-
display: none;
|
|
418
|
-
}
|
|
419
|
-
`;
|
|
420
|
-
__decorate([
|
|
421
|
-
property({ type: String })
|
|
422
|
-
], ThCard.prototype, "variant", void 0);
|
|
423
|
-
__decorate([
|
|
424
|
-
property({ type: Boolean })
|
|
425
|
-
], ThCard.prototype, "dismissible", void 0);
|
|
426
|
-
__decorate([
|
|
427
|
-
property({ type: String, attribute: 'card-id' })
|
|
428
|
-
], ThCard.prototype, "cardId", void 0);
|
|
429
|
-
__decorate([
|
|
430
|
-
property({ type: String })
|
|
431
|
-
], ThCard.prototype, "cardTitle", void 0);
|
|
432
|
-
__decorate([
|
|
433
|
-
property({ type: String })
|
|
434
|
-
], ThCard.prototype, "subtitle", void 0);
|
|
435
|
-
__decorate([
|
|
436
|
-
property({ type: String })
|
|
437
|
-
], ThCard.prototype, "description", void 0);
|
|
438
|
-
__decorate([
|
|
439
|
-
property({ type: String, attribute: 'icon-class' })
|
|
440
|
-
], ThCard.prototype, "iconClass", void 0);
|
|
441
|
-
__decorate([
|
|
442
|
-
property({ type: String, attribute: 'icon-src' })
|
|
443
|
-
], ThCard.prototype, "iconSrc", void 0);
|
|
444
|
-
__decorate([
|
|
445
|
-
property({ type: Boolean })
|
|
446
|
-
], ThCard.prototype, "loading", void 0);
|
|
447
|
-
// Register the element
|
|
448
|
-
customElements.define('th-card', ThCard);
|
|
449
|
-
//# sourceMappingURL=th-card.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"th-card.js","sourceRoot":"","sources":["../../../src/components/th-card/th-card.ts"],"names":[],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