@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,166 @@
|
|
|
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/breadcrumb/breadcrumb.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/breadcrumb/breadcrumb.ts
|
|
38
|
+
import { customElement, property as property2 } from "lit/decorators.js";
|
|
39
|
+
|
|
40
|
+
// src/components/breadcrumb/breadcrumb.styles.ts
|
|
41
|
+
import { css } from "lit";
|
|
42
|
+
var breadcrumbStyles = css`
|
|
43
|
+
:host {
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[part='list'] {
|
|
48
|
+
align-items: center;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-wrap: wrap;
|
|
51
|
+
gap: 0;
|
|
52
|
+
list-style: none;
|
|
53
|
+
margin: 0;
|
|
54
|
+
padding: 0;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
var breadcrumbItemStyles = css`
|
|
58
|
+
:host {
|
|
59
|
+
align-items: center;
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
font-family: var(--lt-typography-fontfamily);
|
|
62
|
+
font-size: 0.875rem;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[part='link'] {
|
|
66
|
+
color: var(--lt-interactive-primary-bg);
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
transition: color 120ms ease;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[part='link']:hover {
|
|
72
|
+
color: var(--lt-interactive-primary-bg-hover);
|
|
73
|
+
text-decoration: underline;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[part='text'] {
|
|
77
|
+
color: var(--lt-text-default);
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[part='separator'] {
|
|
82
|
+
color: var(--lt-text-muted);
|
|
83
|
+
margin-inline: var(--lt-spacing-2);
|
|
84
|
+
user-select: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[part='separator']::after {
|
|
88
|
+
content: var(--lt-breadcrumb-separator, '/');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host(:last-child) [part='separator'] {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
// src/components/breadcrumb/breadcrumb.ts
|
|
97
|
+
var Breadcrumb = class extends ThemeableElement {
|
|
98
|
+
constructor() {
|
|
99
|
+
super(...arguments);
|
|
100
|
+
this.separator = "/";
|
|
101
|
+
}
|
|
102
|
+
updated(changed) {
|
|
103
|
+
super.updated(changed);
|
|
104
|
+
if (changed.has("separator")) {
|
|
105
|
+
if (this.separator !== null && this.separator !== void 0) {
|
|
106
|
+
this.style.setProperty("--lt-breadcrumb-separator", `"${this.separator}"`);
|
|
107
|
+
} else {
|
|
108
|
+
this.style.removeProperty("--lt-breadcrumb-separator");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
render() {
|
|
113
|
+
return html`
|
|
114
|
+
<nav aria-label="breadcrumb">
|
|
115
|
+
<ol part="list">
|
|
116
|
+
<slot></slot>
|
|
117
|
+
</ol>
|
|
118
|
+
</nav>
|
|
119
|
+
`;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
Breadcrumb.styles = breadcrumbStyles;
|
|
123
|
+
__decorateClass([
|
|
124
|
+
property2()
|
|
125
|
+
], Breadcrumb.prototype, "separator", 2);
|
|
126
|
+
Breadcrumb = __decorateClass([
|
|
127
|
+
customElement("lt-breadcrumb")
|
|
128
|
+
], Breadcrumb);
|
|
129
|
+
var BreadcrumbItem = class extends ThemeableElement {
|
|
130
|
+
constructor() {
|
|
131
|
+
super(...arguments);
|
|
132
|
+
this.href = "";
|
|
133
|
+
this.current = false;
|
|
134
|
+
this.separator = "";
|
|
135
|
+
}
|
|
136
|
+
render() {
|
|
137
|
+
const hasSeparatorOverride = this.separator !== null && this.separator !== void 0 && this.separator !== "";
|
|
138
|
+
return html`
|
|
139
|
+
<li part="item">
|
|
140
|
+
${this.current || !this.href ? html`<span part="text" aria-current=${this.current ? "page" : "false"}><slot></slot></span>` : html`<a part="link" href=${this.href}><slot></slot></a>`}
|
|
141
|
+
<span
|
|
142
|
+
part="separator"
|
|
143
|
+
aria-hidden="true"
|
|
144
|
+
style=${hasSeparatorOverride ? `--lt-breadcrumb-separator: "${this.separator}"` : ""}
|
|
145
|
+
></span>
|
|
146
|
+
</li>
|
|
147
|
+
`;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
BreadcrumbItem.styles = breadcrumbItemStyles;
|
|
151
|
+
__decorateClass([
|
|
152
|
+
property2()
|
|
153
|
+
], BreadcrumbItem.prototype, "href", 2);
|
|
154
|
+
__decorateClass([
|
|
155
|
+
property2({ type: Boolean, reflect: true })
|
|
156
|
+
], BreadcrumbItem.prototype, "current", 2);
|
|
157
|
+
__decorateClass([
|
|
158
|
+
property2()
|
|
159
|
+
], BreadcrumbItem.prototype, "separator", 2);
|
|
160
|
+
BreadcrumbItem = __decorateClass([
|
|
161
|
+
customElement("lt-breadcrumb-item")
|
|
162
|
+
], BreadcrumbItem);
|
|
163
|
+
export {
|
|
164
|
+
Breadcrumb,
|
|
165
|
+
BreadcrumbItem
|
|
166
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ThemeableElement } from '../../base';
|
|
2
|
+
import { ButtonAppearance, ButtonSize, ButtonType, ButtonVariant } from './button.types';
|
|
3
|
+
import '../spinner/';
|
|
4
|
+
import '@latty-ds/icons';
|
|
5
|
+
/**
|
|
6
|
+
* Button component with multiple variants, sizes, appearances, and loading state support.
|
|
7
|
+
*
|
|
8
|
+
* @element lt-button
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Multiple visual variants (primary, secondary, neutral, success, warning, error, info)
|
|
12
|
+
* - Two appearance styles (filled, outlined)
|
|
13
|
+
* - Three size options (sm, md, lg)
|
|
14
|
+
* - Loading state with spinner
|
|
15
|
+
* - Icon support at start and end positions
|
|
16
|
+
* - Disabled state
|
|
17
|
+
* - Accessible with aria-busy for loading state
|
|
18
|
+
* - Renders as `<a>` when `href` is provided (link button)
|
|
19
|
+
* - Form-associated: `type="submit"` submits the containing form, `type="reset"` resets it
|
|
20
|
+
*
|
|
21
|
+
* @slot - Button label/content
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```html
|
|
25
|
+
* <lt-button variant="primary" size="md">Click me</lt-button>
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```html
|
|
30
|
+
* <lt-button href="/dashboard" variant="primary">Go to dashboard</lt-button>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```html
|
|
35
|
+
* <lt-button href="https://example.com" target="_blank" variant="secondary">Open link</lt-button>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare class Button extends ThemeableElement {
|
|
39
|
+
static styles: import("lit").CSSResult;
|
|
40
|
+
static formAssociated: boolean;
|
|
41
|
+
private _internals;
|
|
42
|
+
constructor();
|
|
43
|
+
/**
|
|
44
|
+
* Visual variant that determines the button's color scheme.
|
|
45
|
+
* @default 'primary'
|
|
46
|
+
*/
|
|
47
|
+
variant: ButtonVariant;
|
|
48
|
+
/**
|
|
49
|
+
* Appearance style (filled or outlined).
|
|
50
|
+
* @default 'filled'
|
|
51
|
+
*/
|
|
52
|
+
appearance: ButtonAppearance;
|
|
53
|
+
/**
|
|
54
|
+
* Size of the button (affects height, font size, and padding).
|
|
55
|
+
* @default 'md'
|
|
56
|
+
*/
|
|
57
|
+
size: ButtonSize;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the button is disabled.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
disabled: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the button is in loading state.
|
|
65
|
+
* Shows a spinner and disables interaction.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
loading: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Icon name to display at the start of the button.
|
|
71
|
+
* @default ''
|
|
72
|
+
*/
|
|
73
|
+
iconStart: string;
|
|
74
|
+
/**
|
|
75
|
+
* Icon name to display at the end of the button.
|
|
76
|
+
* @default ''
|
|
77
|
+
*/
|
|
78
|
+
iconEnd: string;
|
|
79
|
+
/**
|
|
80
|
+
* Whether the button stretches to fill its container's width.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
fullWidth: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Renders the button label in small caps with wider letter spacing.
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
uppercase: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* When set, renders an `<a>` tag instead of `<button>`.
|
|
91
|
+
* All visual styles and states are preserved.
|
|
92
|
+
*/
|
|
93
|
+
href: string;
|
|
94
|
+
/**
|
|
95
|
+
* Forwarded to the anchor's `target` attribute when `href` is set.
|
|
96
|
+
*/
|
|
97
|
+
target: string;
|
|
98
|
+
/**
|
|
99
|
+
* Forwarded to the anchor's `rel` attribute when `href` is set.
|
|
100
|
+
* Defaults to `noopener noreferrer` when `target="_blank"` and `rel` is not specified.
|
|
101
|
+
*/
|
|
102
|
+
rel: string;
|
|
103
|
+
/**
|
|
104
|
+
* Form behaviour when the button is inside a `<form>`.
|
|
105
|
+
* `submit` triggers form validation and submission; `reset` restores initial values.
|
|
106
|
+
* @default 'button'
|
|
107
|
+
*/
|
|
108
|
+
type: ButtonType;
|
|
109
|
+
private _handleClick;
|
|
110
|
+
render(): import("lit").TemplateResult<1>;
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buttonStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visual variant of the button component.
|
|
3
|
+
* Determines the color scheme.
|
|
4
|
+
*
|
|
5
|
+
* - `primary`: Primary brand color (default for main actions)
|
|
6
|
+
* - `secondary`: Secondary brand color
|
|
7
|
+
* - `neutral`: Neutral gray color
|
|
8
|
+
* - `success`: Green color for positive actions
|
|
9
|
+
* - `warning`: Yellow/orange color for caution
|
|
10
|
+
* - `error`: Red color for destructive actions
|
|
11
|
+
* - `info`: Blue color for informational actions
|
|
12
|
+
*/
|
|
13
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'neutral' | 'success' | 'warning' | 'error' | 'info';
|
|
14
|
+
/**
|
|
15
|
+
* Appearance style of the button component.
|
|
16
|
+
* Determines whether the button is filled or outlined.
|
|
17
|
+
*
|
|
18
|
+
* - `filled`: Solid background with the variant color (default)
|
|
19
|
+
* - `outlined`: Transparent background with colored border and text
|
|
20
|
+
*/
|
|
21
|
+
export type ButtonAppearance = 'filled' | 'outlined';
|
|
22
|
+
/**
|
|
23
|
+
* Size variant of the button component.
|
|
24
|
+
* Affects height, font size, and padding.
|
|
25
|
+
*
|
|
26
|
+
* - `sm`: 32px height, 0.875rem font size
|
|
27
|
+
* - `md`: 40px height, 1rem font size (default)
|
|
28
|
+
* - `lg`: 48px height, 1.0625rem font size
|
|
29
|
+
*/
|
|
30
|
+
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
31
|
+
/**
|
|
32
|
+
* Form behaviour of the button component.
|
|
33
|
+
*
|
|
34
|
+
* - `button`: No form interaction (default)
|
|
35
|
+
* - `submit`: Submits the associated form (runs constraint validation)
|
|
36
|
+
* - `reset`: Resets all controls in the associated form to their initial values
|
|
37
|
+
*/
|
|
38
|
+
export type ButtonType = 'button' | 'submit' | 'reset';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Button component module.
|
|
3
|
+
* Exports the Button web component and related type definitions.
|
|
4
|
+
*
|
|
5
|
+
* @module components/button
|
|
6
|
+
*/
|
|
7
|
+
export { Button } from './button';
|
|
8
|
+
export type { ButtonAppearance, ButtonSize, ButtonType, ButtonVariant } from './button.types';
|