@latty-ds/web 0.2.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/LICENSE +21 -0
- package/README.md +106 -0
- package/custom-elements.json +8785 -0
- package/dist/base/index.d.ts +1 -0
- package/dist/base/index.js +35 -0
- package/dist/base/themeable-element.d.ts +20 -0
- package/dist/components/accordion/accordion.d.ts +82 -0
- package/dist/components/accordion/accordion.styles.d.ts +1 -0
- package/dist/components/accordion/accordion.types.d.ts +10 -0
- package/dist/components/accordion/index.d.ts +8 -0
- package/dist/components/accordion/index.js +468 -0
- package/dist/components/alert/alert.d.ts +51 -0
- package/dist/components/alert/alert.styles.d.ts +1 -0
- package/dist/components/alert/alert.types.d.ts +2 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +746 -0
- package/dist/components/avatar/avatar.d.ts +27 -0
- package/dist/components/avatar/avatar.styles.d.ts +1 -0
- package/dist/components/avatar/avatar.types.d.ts +3 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +222 -0
- package/dist/components/badge/badge.d.ts +29 -0
- package/dist/components/badge/badge.styles.d.ts +1 -0
- package/dist/components/badge/badge.types.d.ts +3 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +277 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +53 -0
- package/dist/components/breadcrumb/breadcrumb.styles.d.ts +2 -0
- package/dist/components/breadcrumb/breadcrumb.types.d.ts +1 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.js +166 -0
- package/dist/components/button/button.d.ts +111 -0
- package/dist/components/button/button.styles.d.ts +1 -0
- package/dist/components/button/button.types.d.ts +38 -0
- package/dist/components/button/index.d.ts +8 -0
- package/dist/components/button/index.js +466 -0
- package/dist/components/calendar/calendar.d.ts +84 -0
- package/dist/components/calendar/calendar.styles.d.ts +1 -0
- package/dist/components/calendar/calendar.types.d.ts +15 -0
- package/dist/components/calendar/index.d.ts +1 -0
- package/dist/components/calendar/index.js +958 -0
- package/dist/components/checkbox/checkbox.d.ts +113 -0
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -0
- package/dist/components/checkbox/checkbox.types.d.ts +21 -0
- package/dist/components/checkbox/index.d.ts +8 -0
- package/dist/components/checkbox/index.js +320 -0
- package/dist/components/chip/chip.d.ts +35 -0
- package/dist/components/chip/chip.styles.d.ts +1 -0
- package/dist/components/chip/chip.types.d.ts +3 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +282 -0
- package/dist/components/color-input/color-input.d.ts +55 -0
- package/dist/components/color-input/color-input.styles.d.ts +1 -0
- package/dist/components/color-input/color-input.types.d.ts +2 -0
- package/dist/components/color-input/index.d.ts +1 -0
- package/dist/components/color-input/index.js +489 -0
- package/dist/components/combobox/combobox.d.ts +59 -0
- package/dist/components/combobox/combobox.styles.d.ts +1 -0
- package/dist/components/combobox/combobox.types.d.ts +7 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.js +1988 -0
- package/dist/components/date-input/date-input.d.ts +66 -0
- package/dist/components/date-input/date-input.styles.d.ts +1 -0
- package/dist/components/date-input/date-input.types.d.ts +3 -0
- package/dist/components/date-input/index.d.ts +2 -0
- package/dist/components/date-input/index.js +2863 -0
- package/dist/components/datepicker/datepicker.d.ts +52 -0
- package/dist/components/datepicker/datepicker.styles.d.ts +1 -0
- package/dist/components/datepicker/datepicker.types.d.ts +3 -0
- package/dist/components/datepicker/index.d.ts +2 -0
- package/dist/components/datepicker/index.js +416 -0
- package/dist/components/dialog/dialog.d.ts +114 -0
- package/dist/components/dialog/dialog.styles.d.ts +1 -0
- package/dist/components/dialog/dialog.types.d.ts +11 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +920 -0
- package/dist/components/divider/divider.d.ts +35 -0
- package/dist/components/divider/divider.styles.d.ts +1 -0
- package/dist/components/divider/divider.types.d.ts +2 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +149 -0
- package/dist/components/dropdown/dropdown-item.d.ts +24 -0
- package/dist/components/dropdown/dropdown-item.styles.d.ts +1 -0
- package/dist/components/dropdown/dropdown.d.ts +30 -0
- package/dist/components/dropdown/dropdown.styles.d.ts +1 -0
- package/dist/components/dropdown/dropdown.types.d.ts +1 -0
- package/dist/components/dropdown/index.d.ts +3 -0
- package/dist/components/dropdown/index.js +1791 -0
- package/dist/components/header/header.d.ts +19 -0
- package/dist/components/header/header.styles.d.ts +1 -0
- package/dist/components/header/header.types.d.ts +1 -0
- package/dist/components/header/index.d.ts +2 -0
- package/dist/components/header/index.js +104 -0
- package/dist/components/icon-button/icon-button.d.ts +52 -0
- package/dist/components/icon-button/icon-button.styles.d.ts +1 -0
- package/dist/components/icon-button/icon-button.types.d.ts +8 -0
- package/dist/components/icon-button/index.d.ts +1 -0
- package/dist/components/icon-button/index.js +342 -0
- package/dist/components/image/image.d.ts +26 -0
- package/dist/components/image/image.styles.d.ts +1 -0
- package/dist/components/image/image.types.d.ts +0 -0
- package/dist/components/image/index.d.ts +1 -0
- package/dist/components/image/index.js +105 -0
- package/dist/components/link/index.d.ts +1 -0
- package/dist/components/link/index.js +108 -0
- package/dist/components/link/link.d.ts +22 -0
- package/dist/components/link/link.styles.d.ts +1 -0
- package/dist/components/link/link.types.d.ts +1 -0
- package/dist/components/list/index.d.ts +9 -0
- package/dist/components/list/index.js +254 -0
- package/dist/components/list/list-item.d.ts +41 -0
- package/dist/components/list/list-item.styles.d.ts +1 -0
- package/dist/components/list/list.d.ts +85 -0
- package/dist/components/list/list.styles.d.ts +1 -0
- package/dist/components/list/list.types.d.ts +16 -0
- package/dist/components/nav/index.d.ts +3 -0
- package/dist/components/nav/index.js +345 -0
- package/dist/components/nav/nav-item.d.ts +73 -0
- package/dist/components/nav/nav.d.ts +49 -0
- package/dist/components/nav/nav.styles.d.ts +2 -0
- package/dist/components/nav/nav.types.d.ts +1 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +210 -0
- package/dist/components/pagination/pagination.d.ts +34 -0
- package/dist/components/pagination/pagination.styles.d.ts +1 -0
- package/dist/components/pagination/pagination.types.d.ts +1 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/index.js +167 -0
- package/dist/components/progress/progress.d.ts +44 -0
- package/dist/components/progress/progress.styles.d.ts +1 -0
- package/dist/components/progress/progress.types.d.ts +2 -0
- package/dist/components/radio/index.d.ts +8 -0
- package/dist/components/radio/index.js +294 -0
- package/dist/components/radio/radio.d.ts +96 -0
- package/dist/components/radio/radio.styles.d.ts +1 -0
- package/dist/components/radio/radio.types.d.ts +21 -0
- package/dist/components/radio-group/index.d.ts +8 -0
- package/dist/components/radio-group/index.js +384 -0
- package/dist/components/radio-group/radio-group.d.ts +100 -0
- package/dist/components/radio-group/radio-group.styles.d.ts +1 -0
- package/dist/components/radio-group/radio-group.types.d.ts +8 -0
- package/dist/components/select/index.d.ts +8 -0
- package/dist/components/select/index.js +2123 -0
- package/dist/components/select/select.d.ts +129 -0
- package/dist/components/select/select.styles.d.ts +1 -0
- package/dist/components/select/select.types.d.ts +37 -0
- package/dist/components/shared/backdrop.styles.d.ts +1 -0
- package/dist/components/shared/floating.d.ts +10 -0
- package/dist/components/sidepanel/index.d.ts +1 -0
- package/dist/components/sidepanel/index.js +768 -0
- package/dist/components/sidepanel/sidepanel.d.ts +48 -0
- package/dist/components/sidepanel/sidepanel.styles.d.ts +1 -0
- package/dist/components/sidepanel/sidepanel.types.d.ts +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +129 -0
- package/dist/components/skeleton/skeleton.d.ts +39 -0
- package/dist/components/skeleton/skeleton.styles.d.ts +1 -0
- package/dist/components/skeleton/skeleton.types.d.ts +1 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +635 -0
- package/dist/components/slider/slider.d.ts +33 -0
- package/dist/components/slider/slider.styles.d.ts +1 -0
- package/dist/components/slider/slider.types.d.ts +1 -0
- package/dist/components/snackbar/index.d.ts +2 -0
- package/dist/components/snackbar/index.js +358 -0
- package/dist/components/snackbar/snackbar.d.ts +63 -0
- package/dist/components/snackbar/snackbar.styles.d.ts +1 -0
- package/dist/components/snackbar/snackbar.types.d.ts +1 -0
- package/dist/components/spinner/index.d.ts +8 -0
- package/dist/components/spinner/index.js +131 -0
- package/dist/components/spinner/spineer.styles.d.ts +1 -0
- package/dist/components/spinner/spinner.d.ts +52 -0
- package/dist/components/spinner/spinner.types.d.ts +18 -0
- package/dist/components/surface/index.d.ts +8 -0
- package/dist/components/surface/index.js +128 -0
- package/dist/components/surface/surface.d.ts +48 -0
- package/dist/components/surface/surface.styles.d.ts +1 -0
- package/dist/components/surface/surface.types.d.ts +20 -0
- package/dist/components/switch/index.d.ts +8 -0
- package/dist/components/switch/index.js +293 -0
- package/dist/components/switch/switch.d.ts +90 -0
- package/dist/components/switch/switch.styles.d.ts +1 -0
- package/dist/components/switch/switch.types.d.ts +21 -0
- package/dist/components/tab/index.d.ts +9 -0
- package/dist/components/tab/index.js +252 -0
- package/dist/components/tab/tab-panel.d.ts +28 -0
- package/dist/components/tab/tab-panel.styles.d.ts +1 -0
- package/dist/components/tab/tab.d.ts +59 -0
- package/dist/components/tab/tab.styles.d.ts +1 -0
- package/dist/components/tab/tab.types.d.ts +7 -0
- package/dist/components/tab-group/index.d.ts +8 -0
- package/dist/components/tab-group/index.js +441 -0
- package/dist/components/tab-group/tab-group.d.ts +99 -0
- package/dist/components/tab-group/tab-group.styles.d.ts +1 -0
- package/dist/components/tab-group/tab-group.types.d.ts +11 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +582 -0
- package/dist/components/table/table.d.ts +160 -0
- package/dist/components/table/table.styles.d.ts +1 -0
- package/dist/components/table/table.types.d.ts +106 -0
- package/dist/components/text/index.d.ts +1 -0
- package/dist/components/text/index.js +207 -0
- package/dist/components/text/text.d.ts +32 -0
- package/dist/components/text/text.styles.d.ts +1 -0
- package/dist/components/text/text.types.d.ts +2 -0
- package/dist/components/textfield/index.d.ts +8 -0
- package/dist/components/textfield/index.js +718 -0
- package/dist/components/textfield/textfield.d.ts +168 -0
- package/dist/components/textfield/textfield.styles.d.ts +1 -0
- package/dist/components/textfield/textfield.types.d.ts +40 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +379 -0
- package/dist/components/tooltip/tooltip.d.ts +42 -0
- package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
- package/dist/components/tooltip/tooltip.types.d.ts +1 -0
- package/dist/css/font-face.css +22 -0
- package/dist/css/latty.css +57 -0
- package/dist/fonts/HankenGrotesk-Variable.woff2 +0 -0
- package/dist/fonts/HankenGrotesk-VariableItalic.woff2 +0 -0
- package/dist/index.cjs +12739 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +11406 -0
- package/dist/manifest.json +2396 -0
- package/dist/utils/click-outside.d.ts +22 -0
- package/dist/utils/color.d.ts +14 -0
- package/dist/utils/dispatch.d.ts +18 -0
- package/dist/utils/index.d.ts +3 -0
- package/package.json +231 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ThemeableElement } from '../../base';
|
|
2
|
+
import type { AvatarSize, AvatarShape, AvatarColor } from './avatar.types';
|
|
3
|
+
import '@latty-ds/icons';
|
|
4
|
+
/**
|
|
5
|
+
* Displays a user avatar — image, initials fallback, or icon fallback.
|
|
6
|
+
*
|
|
7
|
+
* @element lt-avatar
|
|
8
|
+
*/
|
|
9
|
+
export declare class Avatar extends ThemeableElement {
|
|
10
|
+
static styles: import("lit").CSSResult;
|
|
11
|
+
/** URL of the avatar image. */
|
|
12
|
+
src: string;
|
|
13
|
+
/** Full name used to derive initials when no image is available. */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Accessible label for the image (defaults to `name`). */
|
|
16
|
+
alt: string;
|
|
17
|
+
/** Size of the avatar. */
|
|
18
|
+
size: AvatarSize;
|
|
19
|
+
/** Shape of the avatar. */
|
|
20
|
+
shape: AvatarShape;
|
|
21
|
+
/** Background color used for the initials and icon fallback states. */
|
|
22
|
+
color: AvatarColor;
|
|
23
|
+
private _imgError;
|
|
24
|
+
private get _initials();
|
|
25
|
+
private _handleImgError;
|
|
26
|
+
render(): import("lit").TemplateResult<1>;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const avatarStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/components/avatar/avatar.ts
|
|
13
|
+
import { html } from "lit";
|
|
14
|
+
|
|
15
|
+
// src/base/themeable-element.ts
|
|
16
|
+
import { LitElement } from "lit";
|
|
17
|
+
import { property } from "lit/decorators.js";
|
|
18
|
+
var ThemeableElement = class extends LitElement {
|
|
19
|
+
willUpdate(changed) {
|
|
20
|
+
super.willUpdate(changed);
|
|
21
|
+
if (changed.has("theme")) {
|
|
22
|
+
this._syncThemeAttribute();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
_syncThemeAttribute() {
|
|
26
|
+
if (this.theme === "dark" || this.theme === "light") {
|
|
27
|
+
this.setAttribute("data-theme", this.theme);
|
|
28
|
+
} else {
|
|
29
|
+
this.removeAttribute("data-theme");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
__decorateClass([
|
|
34
|
+
property({ reflect: true })
|
|
35
|
+
], ThemeableElement.prototype, "theme", 2);
|
|
36
|
+
|
|
37
|
+
// src/components/avatar/avatar.ts
|
|
38
|
+
import { customElement, property as property2, state } from "lit/decorators.js";
|
|
39
|
+
|
|
40
|
+
// src/components/avatar/avatar.styles.ts
|
|
41
|
+
import { css } from "lit";
|
|
42
|
+
var avatarStyles = css`
|
|
43
|
+
:host {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
vertical-align: middle;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
span[part='base'] {
|
|
50
|
+
align-items: center;
|
|
51
|
+
background: var(--lt-avatar-bg, var(--lt-bg-overlay));
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
color: var(--lt-avatar-color, var(--lt-color-neutral-700));
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
overflow: hidden;
|
|
57
|
+
position: relative;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
img[part='image'] {
|
|
61
|
+
height: 100%;
|
|
62
|
+
object-fit: cover;
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.initials {
|
|
67
|
+
font-family: 'Hanken Grotesk', sans-serif;
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
letter-spacing: 0.02em;
|
|
70
|
+
line-height: 1;
|
|
71
|
+
user-select: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ── Colors (fallback bg + text) ────────────────────────────────────── */
|
|
75
|
+
:host([color='neutral']) span[part='base'] {
|
|
76
|
+
background: var(--lt-bg-overlay);
|
|
77
|
+
color: var(--lt-text-neutral);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:host([color='primary']) span[part='base'] {
|
|
81
|
+
background: var(--lt-bg-primary-subtle);
|
|
82
|
+
color: var(--lt-text-primary);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([color='secondary']) span[part='base'] {
|
|
86
|
+
background: var(--lt-bg-secondary-subtle);
|
|
87
|
+
color: var(--lt-text-secondary);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
:host([color='success']) span[part='base'] {
|
|
91
|
+
background: var(--lt-bg-success-subtle);
|
|
92
|
+
color: var(--lt-text-success);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host([color='warning']) span[part='base'] {
|
|
96
|
+
background: var(--lt-bg-warning-subtle);
|
|
97
|
+
color: var(--lt-text-warning);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host([color='error']) span[part='base'] {
|
|
101
|
+
background: var(--lt-bg-error-subtle);
|
|
102
|
+
color: var(--lt-text-error);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([color='info']) span[part='base'] {
|
|
106
|
+
background: var(--lt-bg-info-subtle);
|
|
107
|
+
color: var(--lt-text-info);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* ── Shape ───────────────────────────────────────────────────────────── */
|
|
111
|
+
:host([shape='circle']) span[part='base'] {
|
|
112
|
+
border-radius: 999px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host([shape='square']) span[part='base'] {
|
|
116
|
+
border-radius: var(--lt-border-radius);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* ── Sizes ───────────────────────────────────────────────────────────── */
|
|
120
|
+
:host([size='xs']) span[part='base'] {
|
|
121
|
+
height: 24px;
|
|
122
|
+
width: 24px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
:host([size='xs']) .initials {
|
|
126
|
+
font-size: 0.625rem;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:host([size='sm']) span[part='base'] {
|
|
130
|
+
height: 32px;
|
|
131
|
+
width: 32px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host([size='sm']) .initials {
|
|
135
|
+
font-size: 0.75rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:host([size='md']) span[part='base'] {
|
|
139
|
+
height: 40px;
|
|
140
|
+
width: 40px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([size='md']) .initials {
|
|
144
|
+
font-size: 0.9375rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:host([size='lg']) span[part='base'] {
|
|
148
|
+
height: 52px;
|
|
149
|
+
width: 52px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([size='lg']) .initials {
|
|
153
|
+
font-size: 1.125rem;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:host([size='xl']) span[part='base'] {
|
|
157
|
+
height: 68px;
|
|
158
|
+
width: 68px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:host([size='xl']) .initials {
|
|
162
|
+
font-size: 1.5rem;
|
|
163
|
+
}
|
|
164
|
+
`;
|
|
165
|
+
|
|
166
|
+
// src/components/avatar/avatar.ts
|
|
167
|
+
import "@latty-ds/icons";
|
|
168
|
+
var Avatar = class extends ThemeableElement {
|
|
169
|
+
constructor() {
|
|
170
|
+
super(...arguments);
|
|
171
|
+
this.src = "";
|
|
172
|
+
this.name = "";
|
|
173
|
+
this.alt = "";
|
|
174
|
+
this.size = "md";
|
|
175
|
+
this.shape = "circle";
|
|
176
|
+
this.color = "neutral";
|
|
177
|
+
this._imgError = false;
|
|
178
|
+
}
|
|
179
|
+
get _initials() {
|
|
180
|
+
return this.name.trim().split(/\s+/).slice(0, 2).map((w) => w[0].toUpperCase()).join("");
|
|
181
|
+
}
|
|
182
|
+
_handleImgError() {
|
|
183
|
+
this._imgError = true;
|
|
184
|
+
}
|
|
185
|
+
render() {
|
|
186
|
+
const showImage = this.src && !this._imgError;
|
|
187
|
+
const showInitials = !showImage && this.name;
|
|
188
|
+
return html`
|
|
189
|
+
<span part="base" aria-label=${this.alt || this.name || "avatar"} role="img">
|
|
190
|
+
${showImage ? html`<img part="image" src=${this.src} alt=${this.alt || this.name} @error=${this._handleImgError} />` : showInitials ? html`<span part="initials" class="initials">${this._initials}</span>` : html`<lt-icon part="icon" name="user" size="sm"></lt-icon>`}
|
|
191
|
+
</span>
|
|
192
|
+
`;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
Avatar.styles = avatarStyles;
|
|
196
|
+
__decorateClass([
|
|
197
|
+
property2()
|
|
198
|
+
], Avatar.prototype, "src", 2);
|
|
199
|
+
__decorateClass([
|
|
200
|
+
property2()
|
|
201
|
+
], Avatar.prototype, "name", 2);
|
|
202
|
+
__decorateClass([
|
|
203
|
+
property2()
|
|
204
|
+
], Avatar.prototype, "alt", 2);
|
|
205
|
+
__decorateClass([
|
|
206
|
+
property2({ reflect: true })
|
|
207
|
+
], Avatar.prototype, "size", 2);
|
|
208
|
+
__decorateClass([
|
|
209
|
+
property2({ reflect: true })
|
|
210
|
+
], Avatar.prototype, "shape", 2);
|
|
211
|
+
__decorateClass([
|
|
212
|
+
property2({ reflect: true })
|
|
213
|
+
], Avatar.prototype, "color", 2);
|
|
214
|
+
__decorateClass([
|
|
215
|
+
state()
|
|
216
|
+
], Avatar.prototype, "_imgError", 2);
|
|
217
|
+
Avatar = __decorateClass([
|
|
218
|
+
customElement("lt-avatar")
|
|
219
|
+
], Avatar);
|
|
220
|
+
export {
|
|
221
|
+
Avatar
|
|
222
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ThemeableElement } from '../../base';
|
|
2
|
+
import type { BadgeVariant, BadgeSize, BadgeAppearance } from './badge.types';
|
|
3
|
+
/**
|
|
4
|
+
* A compact status label for categories, counts, and states.
|
|
5
|
+
*
|
|
6
|
+
* @element lt-badge
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```html
|
|
10
|
+
* <lt-badge variant="success" content="Active" />
|
|
11
|
+
* <lt-badge variant="error" appearance="solid" content="Failed" />
|
|
12
|
+
* <lt-badge variant="primary" content="New" dot />
|
|
13
|
+
* <lt-badge variant="warning" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class Badge extends ThemeableElement {
|
|
17
|
+
static styles: import("lit").CSSResult;
|
|
18
|
+
/** Visual style: tinted fill, outline only, or full-color solid. */
|
|
19
|
+
appearance: BadgeAppearance;
|
|
20
|
+
/** Color scheme. */
|
|
21
|
+
variant: BadgeVariant;
|
|
22
|
+
/** Size. */
|
|
23
|
+
size: BadgeSize;
|
|
24
|
+
/** Label text. When empty the badge renders as a circle indicator. */
|
|
25
|
+
content: string;
|
|
26
|
+
/** Show a leading status dot (only visible when content is set). */
|
|
27
|
+
dot: boolean;
|
|
28
|
+
render(): import("lit").TemplateResult<1>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const badgeStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/components/badge/badge.ts
|
|
13
|
+
import { html } from "lit";
|
|
14
|
+
|
|
15
|
+
// src/base/themeable-element.ts
|
|
16
|
+
import { LitElement } from "lit";
|
|
17
|
+
import { property } from "lit/decorators.js";
|
|
18
|
+
var ThemeableElement = class extends LitElement {
|
|
19
|
+
willUpdate(changed) {
|
|
20
|
+
super.willUpdate(changed);
|
|
21
|
+
if (changed.has("theme")) {
|
|
22
|
+
this._syncThemeAttribute();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
_syncThemeAttribute() {
|
|
26
|
+
if (this.theme === "dark" || this.theme === "light") {
|
|
27
|
+
this.setAttribute("data-theme", this.theme);
|
|
28
|
+
} else {
|
|
29
|
+
this.removeAttribute("data-theme");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
__decorateClass([
|
|
34
|
+
property({ reflect: true })
|
|
35
|
+
], ThemeableElement.prototype, "theme", 2);
|
|
36
|
+
|
|
37
|
+
// src/components/badge/badge.ts
|
|
38
|
+
import { customElement, property as property2 } from "lit/decorators.js";
|
|
39
|
+
|
|
40
|
+
// src/components/badge/badge.styles.ts
|
|
41
|
+
import { css } from "lit";
|
|
42
|
+
var badgeStyles = css`
|
|
43
|
+
:host {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
font-family: 'Hanken Grotesk', sans-serif;
|
|
46
|
+
vertical-align: middle;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
span[part='base'] {
|
|
50
|
+
align-items: center;
|
|
51
|
+
background: var(--lt-badge-bg);
|
|
52
|
+
border-radius: 999px;
|
|
53
|
+
border: 1px solid var(--lt-badge-border-color, transparent);
|
|
54
|
+
color: var(--lt-badge-color);
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
display: inline-flex;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
gap: var(--lt-spacing-1);
|
|
59
|
+
line-height: 1;
|
|
60
|
+
user-select: none;
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.dot {
|
|
65
|
+
border-radius: 50%;
|
|
66
|
+
flex-shrink: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* ── Sizes ──────────────────────────────────────────────────────────── */
|
|
70
|
+
|
|
71
|
+
:host([size='sm']) span[part='base'] {
|
|
72
|
+
font-size: 0.6875rem;
|
|
73
|
+
height: 18px;
|
|
74
|
+
padding-inline: var(--lt-spacing-2);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([size='sm']) .dot {
|
|
78
|
+
height: 6px;
|
|
79
|
+
width: 6px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([size='md']) span[part='base'] {
|
|
83
|
+
font-size: 0.75rem;
|
|
84
|
+
height: 22px;
|
|
85
|
+
padding-inline: var(--lt-spacing-2);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([size='md']) .dot {
|
|
89
|
+
height: 7px;
|
|
90
|
+
width: 7px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
:host([size='lg']) span[part='base'] {
|
|
94
|
+
font-size: 0.8125rem;
|
|
95
|
+
height: 26px;
|
|
96
|
+
padding-inline: var(--lt-spacing-3);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
:host([size='lg']) .dot {
|
|
100
|
+
height: 8px;
|
|
101
|
+
width: 8px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* When dot is the only content, fill it to the circle size */
|
|
105
|
+
:host([dot][content='']) .dot,
|
|
106
|
+
:host([dot]:not([content])) .dot {
|
|
107
|
+
height: 40%;
|
|
108
|
+
width: 40%;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* ── Empty = perfect circle (covers content="" and absent attribute) */
|
|
112
|
+
|
|
113
|
+
:host([content='']) span[part='base'],
|
|
114
|
+
:host(:not([content])) span[part='base'] {
|
|
115
|
+
aspect-ratio: 1;
|
|
116
|
+
justify-content: center;
|
|
117
|
+
padding: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* ── Filled (tinted bg, colored border, dark text) ───────────────── */
|
|
121
|
+
|
|
122
|
+
:host([appearance='filled'][variant='primary']) span[part='base'] {
|
|
123
|
+
background: var(--lt-bg-primary-subtle);
|
|
124
|
+
border-color: var(--lt-border-primary);
|
|
125
|
+
color: var(--lt-text-primary);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([appearance='filled'][variant='secondary']) span[part='base'] {
|
|
129
|
+
background: var(--lt-bg-secondary-subtle);
|
|
130
|
+
border-color: var(--lt-border-secondary);
|
|
131
|
+
color: var(--lt-text-secondary);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host([appearance='filled'][variant='success']) span[part='base'] {
|
|
135
|
+
background: var(--lt-bg-success-subtle);
|
|
136
|
+
border-color: var(--lt-border-success);
|
|
137
|
+
color: var(--lt-text-success);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:host([appearance='filled'][variant='warning']) span[part='base'] {
|
|
141
|
+
background: var(--lt-bg-warning-subtle);
|
|
142
|
+
border-color: var(--lt-border-warning);
|
|
143
|
+
color: var(--lt-text-warning);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:host([appearance='filled'][variant='error']) span[part='base'] {
|
|
147
|
+
background: var(--lt-bg-error-subtle);
|
|
148
|
+
border-color: var(--lt-border-error);
|
|
149
|
+
color: var(--lt-text-error);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([appearance='filled'][variant='neutral']) span[part='base'] {
|
|
153
|
+
background: var(--lt-bg-surface);
|
|
154
|
+
border-color: var(--lt-border-default);
|
|
155
|
+
color: var(--lt-text-neutral);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* ── Outlined (transparent bg, colored border and text) ──────────── */
|
|
159
|
+
|
|
160
|
+
:host([appearance='outlined'][variant='primary']) span[part='base'] {
|
|
161
|
+
background: transparent;
|
|
162
|
+
border-color: var(--lt-border-primary-strong);
|
|
163
|
+
color: var(--lt-text-primary);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:host([appearance='outlined'][variant='secondary']) span[part='base'] {
|
|
167
|
+
background: transparent;
|
|
168
|
+
border-color: var(--lt-border-secondary-strong);
|
|
169
|
+
color: var(--lt-text-secondary);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
:host([appearance='outlined'][variant='success']) span[part='base'] {
|
|
173
|
+
background: transparent;
|
|
174
|
+
border-color: var(--lt-border-success-strong);
|
|
175
|
+
color: var(--lt-text-success);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
:host([appearance='outlined'][variant='warning']) span[part='base'] {
|
|
179
|
+
background: transparent;
|
|
180
|
+
border-color: var(--lt-border-warning-strong);
|
|
181
|
+
color: var(--lt-text-warning);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
:host([appearance='outlined'][variant='error']) span[part='base'] {
|
|
185
|
+
background: transparent;
|
|
186
|
+
border-color: var(--lt-border-error-strong);
|
|
187
|
+
color: var(--lt-text-error);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
:host([appearance='outlined'][variant='neutral']) span[part='base'] {
|
|
191
|
+
background: transparent;
|
|
192
|
+
border-color: var(--lt-border-strong);
|
|
193
|
+
color: var(--lt-text-neutral);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* ── Solid (full-color bg, white text) ───────────────────────────── */
|
|
197
|
+
|
|
198
|
+
:host([appearance='solid'][variant='primary']) span[part='base'] {
|
|
199
|
+
background: var(--lt-interactive-primary-bg);
|
|
200
|
+
border-color: transparent;
|
|
201
|
+
color: var(--lt-text-on-primary);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([appearance='solid'][variant='secondary']) span[part='base'] {
|
|
205
|
+
background: var(--lt-interactive-secondary-bg);
|
|
206
|
+
border-color: transparent;
|
|
207
|
+
color: var(--lt-text-on-secondary);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
:host([appearance='solid'][variant='success']) span[part='base'] {
|
|
211
|
+
background: var(--lt-interactive-success-bg);
|
|
212
|
+
border-color: transparent;
|
|
213
|
+
color: var(--lt-text-on-success);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
:host([appearance='solid'][variant='warning']) span[part='base'] {
|
|
217
|
+
background: var(--lt-interactive-warning-bg);
|
|
218
|
+
border-color: transparent;
|
|
219
|
+
color: var(--lt-text-on-warning);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
:host([appearance='solid'][variant='error']) span[part='base'] {
|
|
223
|
+
background: var(--lt-interactive-error-bg);
|
|
224
|
+
border-color: transparent;
|
|
225
|
+
color: var(--lt-text-on-error);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
:host([appearance='solid'][variant='neutral']) span[part='base'] {
|
|
229
|
+
background: var(--lt-color-neutral-500);
|
|
230
|
+
border-color: transparent;
|
|
231
|
+
color: var(--lt-color-white);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* ── Dot color inherits text color ───────────────────────────────── */
|
|
235
|
+
.dot {
|
|
236
|
+
background: currentColor;
|
|
237
|
+
}
|
|
238
|
+
`;
|
|
239
|
+
|
|
240
|
+
// src/components/badge/badge.ts
|
|
241
|
+
var Badge = class extends ThemeableElement {
|
|
242
|
+
constructor() {
|
|
243
|
+
super(...arguments);
|
|
244
|
+
this.appearance = "filled";
|
|
245
|
+
this.variant = "primary";
|
|
246
|
+
this.size = "md";
|
|
247
|
+
this.content = "";
|
|
248
|
+
this.dot = false;
|
|
249
|
+
}
|
|
250
|
+
render() {
|
|
251
|
+
return html`
|
|
252
|
+
<span part="base"> ${this.dot ? html`<span class="dot" part="dot"></span>` : ""} ${this.content} </span>
|
|
253
|
+
`;
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
Badge.styles = badgeStyles;
|
|
257
|
+
__decorateClass([
|
|
258
|
+
property2({ reflect: true })
|
|
259
|
+
], Badge.prototype, "appearance", 2);
|
|
260
|
+
__decorateClass([
|
|
261
|
+
property2({ reflect: true })
|
|
262
|
+
], Badge.prototype, "variant", 2);
|
|
263
|
+
__decorateClass([
|
|
264
|
+
property2({ reflect: true })
|
|
265
|
+
], Badge.prototype, "size", 2);
|
|
266
|
+
__decorateClass([
|
|
267
|
+
property2({ reflect: true })
|
|
268
|
+
], Badge.prototype, "content", 2);
|
|
269
|
+
__decorateClass([
|
|
270
|
+
property2({ type: Boolean, reflect: true })
|
|
271
|
+
], Badge.prototype, "dot", 2);
|
|
272
|
+
Badge = __decorateClass([
|
|
273
|
+
customElement("lt-badge")
|
|
274
|
+
], Badge);
|
|
275
|
+
export {
|
|
276
|
+
Badge
|
|
277
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type PropertyValues } from 'lit';
|
|
2
|
+
import { ThemeableElement } from '../../base';
|
|
3
|
+
/**
|
|
4
|
+
* Navigation breadcrumb trail container.
|
|
5
|
+
* Place `lt-breadcrumb-item` elements inside as direct children.
|
|
6
|
+
*
|
|
7
|
+
* @element lt-breadcrumb
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```html
|
|
11
|
+
* <lt-breadcrumb separator=">">
|
|
12
|
+
* <lt-breadcrumb-item href="/">Home</lt-breadcrumb-item>
|
|
13
|
+
* <lt-breadcrumb-item href="/components">Components</lt-breadcrumb-item>
|
|
14
|
+
* <lt-breadcrumb-item current>Button</lt-breadcrumb-item>
|
|
15
|
+
* </lt-breadcrumb>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class Breadcrumb extends ThemeableElement {
|
|
19
|
+
static styles: import("lit").CSSResult;
|
|
20
|
+
/**
|
|
21
|
+
* The character or element to use as a separator between breadcrumb items.
|
|
22
|
+
* This is passed down to all children items via CSS variables.
|
|
23
|
+
* @default '/'
|
|
24
|
+
*/
|
|
25
|
+
separator: string;
|
|
26
|
+
updated(changed: PropertyValues<this>): void;
|
|
27
|
+
render(): import("lit").TemplateResult<1>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A single step in a breadcrumb trail.
|
|
31
|
+
* Renders as a link when `href` is provided, or as plain text when `current`.
|
|
32
|
+
*
|
|
33
|
+
* @element lt-breadcrumb-item
|
|
34
|
+
*/
|
|
35
|
+
export declare class BreadcrumbItem extends ThemeableElement {
|
|
36
|
+
static styles: import("lit").CSSResult;
|
|
37
|
+
/**
|
|
38
|
+
* URL this item links to. Omit for the current (last) item.
|
|
39
|
+
* @default ''
|
|
40
|
+
*/
|
|
41
|
+
href: string;
|
|
42
|
+
/**
|
|
43
|
+
* Marks this item as the current page. Renders as non-linked text with `aria-current="page"`.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
current: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Custom separator for this specific item. Overrides the parent's separator.
|
|
49
|
+
* @default ''
|
|
50
|
+
*/
|
|
51
|
+
separator: string;
|
|
52
|
+
render(): import("lit").TemplateResult<1>;
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type BreadcrumbSeparator = string;
|