@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,466 @@
|
|
|
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/button/button.ts
|
|
13
|
+
import { html as html2, nothing } 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/button/button.ts
|
|
38
|
+
import { customElement as customElement2, property as property3 } from "lit/decorators.js";
|
|
39
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
40
|
+
|
|
41
|
+
// src/components/button/button.styles.ts
|
|
42
|
+
import { css } from "lit";
|
|
43
|
+
var buttonStyles = css`
|
|
44
|
+
:host {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
font-family: 'Hanken Grotesk', sans-serif;
|
|
47
|
+
|
|
48
|
+
/* Internal state props — set per variant/appearance below */
|
|
49
|
+
--_color: var(--lt-text-on-primary);
|
|
50
|
+
--_bg: var(--lt-interactive-primary-bg);
|
|
51
|
+
--_border-color: transparent;
|
|
52
|
+
--_hover-bg: var(--lt-interactive-primary-bg-hover);
|
|
53
|
+
--_active-bg: var(--lt-interactive-primary-bg-active);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([full-width]) {
|
|
57
|
+
display: block;
|
|
58
|
+
width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([full-width]) [part='base'] {
|
|
62
|
+
width: 100%;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[part='base'] {
|
|
66
|
+
align-items: center;
|
|
67
|
+
background: var(--lt-button-bg, var(--_bg));
|
|
68
|
+
border-radius: var(--lt-border-radius);
|
|
69
|
+
border: 1px solid var(--lt-button-border-color, var(--_border-color));
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
color: var(--lt-button-color, var(--_color));
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
font-family: inherit;
|
|
75
|
+
font-weight: 400;
|
|
76
|
+
gap: var(--lt-spacing-2);
|
|
77
|
+
justify-content: center;
|
|
78
|
+
line-height: 1;
|
|
79
|
+
min-width: 88px;
|
|
80
|
+
user-select: none;
|
|
81
|
+
transition:
|
|
82
|
+
background-color 120ms ease,
|
|
83
|
+
border-color 120ms ease,
|
|
84
|
+
transform 50ms ease;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[part='base']:active {
|
|
88
|
+
transform: translateY(1px);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[part='base']:focus-visible {
|
|
92
|
+
outline: 3px solid var(--lt-border-focus);
|
|
93
|
+
outline-offset: 2px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[part='base'][disabled],
|
|
97
|
+
[part='base'][aria-disabled='true'] {
|
|
98
|
+
cursor: not-allowed;
|
|
99
|
+
opacity: 0.6;
|
|
100
|
+
pointer-events: none;
|
|
101
|
+
transform: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* anchor reset — browsers apply link color + underline by default */
|
|
105
|
+
a[part='base'] {
|
|
106
|
+
text-decoration: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* sizes */
|
|
110
|
+
:host([size='sm']) [part='base'] {
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
height: 32px;
|
|
113
|
+
padding-inline: var(--lt-spacing-3);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:host([size='md']) [part='base'] {
|
|
117
|
+
font-size: 1rem;
|
|
118
|
+
height: 40px;
|
|
119
|
+
padding-inline: var(--lt-spacing-4);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([size='lg']) [part='base'] {
|
|
123
|
+
font-size: 1.0625rem;
|
|
124
|
+
height: 48px;
|
|
125
|
+
padding-inline: var(--lt-spacing-5);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* variants — solid */
|
|
129
|
+
:host([variant='primary']) {
|
|
130
|
+
--_bg: var(--lt-interactive-primary-bg);
|
|
131
|
+
--_color: var(--lt-text-on-primary);
|
|
132
|
+
--_hover-bg: var(--lt-interactive-primary-bg-hover);
|
|
133
|
+
--_active-bg: var(--lt-interactive-primary-bg-active);
|
|
134
|
+
}
|
|
135
|
+
:host([variant='secondary']) {
|
|
136
|
+
--_bg: var(--lt-interactive-secondary-bg);
|
|
137
|
+
--_color: var(--lt-text-on-secondary);
|
|
138
|
+
--_hover-bg: var(--lt-interactive-secondary-bg-hover);
|
|
139
|
+
--_active-bg: var(--lt-interactive-secondary-bg-active);
|
|
140
|
+
}
|
|
141
|
+
:host([variant='neutral']) {
|
|
142
|
+
--_bg: var(--lt-color-neutral-500);
|
|
143
|
+
--_color: var(--lt-color-neutral-50);
|
|
144
|
+
--_hover-bg: var(--lt-color-neutral-700);
|
|
145
|
+
--_active-bg: var(--lt-color-neutral-800);
|
|
146
|
+
}
|
|
147
|
+
:host([variant='success']) {
|
|
148
|
+
--_bg: var(--lt-interactive-success-bg);
|
|
149
|
+
--_color: var(--lt-text-on-success);
|
|
150
|
+
--_hover-bg: var(--lt-interactive-success-bg-hover);
|
|
151
|
+
--_active-bg: var(--lt-interactive-success-bg-active);
|
|
152
|
+
}
|
|
153
|
+
:host([variant='warning']) {
|
|
154
|
+
--_bg: var(--lt-interactive-warning-bg);
|
|
155
|
+
--_color: var(--lt-text-on-warning);
|
|
156
|
+
--_hover-bg: var(--lt-interactive-warning-bg-hover);
|
|
157
|
+
--_active-bg: var(--lt-interactive-warning-bg-active);
|
|
158
|
+
}
|
|
159
|
+
:host([variant='error']) {
|
|
160
|
+
--_bg: var(--lt-interactive-error-bg);
|
|
161
|
+
--_color: var(--lt-text-on-error);
|
|
162
|
+
--_hover-bg: var(--lt-interactive-error-bg-hover);
|
|
163
|
+
--_active-bg: var(--lt-interactive-error-bg-active);
|
|
164
|
+
}
|
|
165
|
+
:host([variant='info']) {
|
|
166
|
+
--_bg: var(--lt-interactive-info-bg);
|
|
167
|
+
--_color: var(--lt-text-on-info);
|
|
168
|
+
--_hover-bg: var(--lt-interactive-info-bg-hover);
|
|
169
|
+
--_active-bg: var(--lt-interactive-info-bg-active);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
[part='base']:hover:not([disabled]):not([aria-disabled='true']) {
|
|
173
|
+
background: var(--lt-button-bg, var(--_hover-bg));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
[part='base']:active:not([disabled]):not([aria-disabled='true']) {
|
|
177
|
+
background: var(--lt-button-bg, var(--_active-bg));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* outlined appearance */
|
|
181
|
+
:host([appearance='outlined'][variant='primary']) {
|
|
182
|
+
--_bg: transparent;
|
|
183
|
+
--_color: var(--lt-text-primary);
|
|
184
|
+
--_border-color: var(--lt-border-primary-strong);
|
|
185
|
+
--_hover-bg: var(--lt-bg-primary-subtle);
|
|
186
|
+
--_active-bg: var(--lt-bg-primary-subtle);
|
|
187
|
+
}
|
|
188
|
+
:host([appearance='outlined'][variant='secondary']) {
|
|
189
|
+
--_bg: transparent;
|
|
190
|
+
--_color: var(--lt-text-secondary);
|
|
191
|
+
--_border-color: var(--lt-border-secondary-strong);
|
|
192
|
+
--_hover-bg: var(--lt-bg-secondary-subtle);
|
|
193
|
+
--_active-bg: var(--lt-bg-secondary-subtle);
|
|
194
|
+
}
|
|
195
|
+
:host([appearance='outlined'][variant='neutral']) {
|
|
196
|
+
--_bg: transparent;
|
|
197
|
+
--_color: var(--lt-text-neutral);
|
|
198
|
+
--_border-color: var(--lt-border-strong);
|
|
199
|
+
--_hover-bg: var(--lt-bg-subtle);
|
|
200
|
+
--_active-bg: var(--lt-bg-surface);
|
|
201
|
+
}
|
|
202
|
+
:host([appearance='outlined'][variant='success']) {
|
|
203
|
+
--_bg: transparent;
|
|
204
|
+
--_color: var(--lt-text-success);
|
|
205
|
+
--_border-color: var(--lt-border-success-strong);
|
|
206
|
+
--_hover-bg: var(--lt-bg-success-subtle);
|
|
207
|
+
--_active-bg: var(--lt-bg-success-subtle);
|
|
208
|
+
}
|
|
209
|
+
:host([appearance='outlined'][variant='warning']) {
|
|
210
|
+
--_bg: transparent;
|
|
211
|
+
--_color: var(--lt-text-warning);
|
|
212
|
+
--_border-color: var(--lt-border-warning-strong);
|
|
213
|
+
--_hover-bg: var(--lt-bg-warning-subtle);
|
|
214
|
+
--_active-bg: var(--lt-bg-warning-subtle);
|
|
215
|
+
}
|
|
216
|
+
:host([appearance='outlined'][variant='error']) {
|
|
217
|
+
--_bg: transparent;
|
|
218
|
+
--_color: var(--lt-text-error);
|
|
219
|
+
--_border-color: var(--lt-border-error-strong);
|
|
220
|
+
--_hover-bg: var(--lt-bg-error-subtle);
|
|
221
|
+
--_active-bg: var(--lt-bg-error-subtle);
|
|
222
|
+
}
|
|
223
|
+
:host([appearance='outlined'][variant='info']) {
|
|
224
|
+
--_bg: transparent;
|
|
225
|
+
--_color: var(--lt-text-info);
|
|
226
|
+
--_border-color: var(--lt-border-info-strong);
|
|
227
|
+
--_hover-bg: var(--lt-bg-info-subtle);
|
|
228
|
+
--_active-bg: var(--lt-bg-info-subtle);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
:host([appearance='outlined']) [part='base']:active:not([disabled]):not([aria-disabled='true']) {
|
|
232
|
+
opacity: 0.8;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* loading */
|
|
236
|
+
.spinner {
|
|
237
|
+
animation: spin 700ms linear infinite;
|
|
238
|
+
border-radius: 999px;
|
|
239
|
+
border-right-color: transparent;
|
|
240
|
+
border: 2px solid currentColor;
|
|
241
|
+
height: 1em;
|
|
242
|
+
width: 1em;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
@keyframes spin {
|
|
246
|
+
to {
|
|
247
|
+
transform: rotate(360deg);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.icon,
|
|
252
|
+
.end {
|
|
253
|
+
align-items: center;
|
|
254
|
+
display: inline-flex;
|
|
255
|
+
justify-content: center;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:host([uppercase]) [part='base'] {
|
|
259
|
+
font-variant-caps: small-caps;
|
|
260
|
+
letter-spacing: 0.05rem;
|
|
261
|
+
text-transform: lowercase;
|
|
262
|
+
}
|
|
263
|
+
`;
|
|
264
|
+
|
|
265
|
+
// src/components/spinner/spinner.ts
|
|
266
|
+
import { html } from "lit";
|
|
267
|
+
import { customElement, property as property2 } from "lit/decorators.js";
|
|
268
|
+
|
|
269
|
+
// src/components/spinner/spineer.styles.ts
|
|
270
|
+
import { css as css2 } from "lit";
|
|
271
|
+
var spinnerStyles = css2`
|
|
272
|
+
:host {
|
|
273
|
+
--lt-spinner-size: var(--lt-spacing-4, 1rem);
|
|
274
|
+
--lt-spinner-color: currentColor;
|
|
275
|
+
|
|
276
|
+
display: inline-block;
|
|
277
|
+
line-height: 0;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/* Sizes */
|
|
281
|
+
:host([size='sm']) {
|
|
282
|
+
--lt-spinner-size: var(--lt-spacing-3, 0.75rem);
|
|
283
|
+
}
|
|
284
|
+
:host([size='md']) {
|
|
285
|
+
--lt-spinner-size: var(--lt-spacing-4, 1rem);
|
|
286
|
+
}
|
|
287
|
+
:host([size='lg']) {
|
|
288
|
+
--lt-spinner-size: var(--lt-spacing-6, 1.5rem);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* Color */
|
|
292
|
+
:host([variant='primary']) {
|
|
293
|
+
--lt-spinner-color: var(--lt-interactive-primary-bg);
|
|
294
|
+
}
|
|
295
|
+
:host([variant='secondary']) {
|
|
296
|
+
--lt-spinner-color: var(--lt-interactive-secondary-bg);
|
|
297
|
+
}
|
|
298
|
+
:host([variant='neutral']) {
|
|
299
|
+
--lt-spinner-color: var(--lt-color-neutral-500);
|
|
300
|
+
}
|
|
301
|
+
:host([variant='current']) {
|
|
302
|
+
--lt-spinner-color: currentColor;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.spinner {
|
|
306
|
+
animation: spin 700ms linear infinite;
|
|
307
|
+
border-bottom-color: var(--lt-spinner-color);
|
|
308
|
+
border-left-color: var(--lt-spinner-color);
|
|
309
|
+
border-radius: 999px;
|
|
310
|
+
border-right-color: transparent;
|
|
311
|
+
border-style: solid;
|
|
312
|
+
border-top-color: var(--lt-spinner-color);
|
|
313
|
+
border-width: 2px;
|
|
314
|
+
box-sizing: border-box;
|
|
315
|
+
display: block;
|
|
316
|
+
height: var(--lt-spinner-size);
|
|
317
|
+
width: var(--lt-spinner-size);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@keyframes spin {
|
|
321
|
+
to {
|
|
322
|
+
transform: rotate(360deg);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
@media (prefers-reduced-motion: reduce) {
|
|
327
|
+
.spinner {
|
|
328
|
+
animation: none;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
`;
|
|
332
|
+
|
|
333
|
+
// src/components/spinner/spinner.ts
|
|
334
|
+
var Spinner = class extends ThemeableElement {
|
|
335
|
+
constructor() {
|
|
336
|
+
super(...arguments);
|
|
337
|
+
this.size = "md";
|
|
338
|
+
this.variant = "current";
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Renders the spinner element.
|
|
342
|
+
* Hidden from assistive technologies with aria-hidden.
|
|
343
|
+
*/
|
|
344
|
+
render() {
|
|
345
|
+
return html`<span class="spinner" aria-hidden="true"></span>`;
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
Spinner.styles = spinnerStyles;
|
|
349
|
+
__decorateClass([
|
|
350
|
+
property2({ reflect: true })
|
|
351
|
+
], Spinner.prototype, "size", 2);
|
|
352
|
+
__decorateClass([
|
|
353
|
+
property2({ reflect: true })
|
|
354
|
+
], Spinner.prototype, "variant", 2);
|
|
355
|
+
Spinner = __decorateClass([
|
|
356
|
+
customElement("lt-spinner")
|
|
357
|
+
], Spinner);
|
|
358
|
+
|
|
359
|
+
// src/components/button/button.ts
|
|
360
|
+
import "@latty-ds/icons";
|
|
361
|
+
var Button = class extends ThemeableElement {
|
|
362
|
+
constructor() {
|
|
363
|
+
super();
|
|
364
|
+
this.variant = "primary";
|
|
365
|
+
this.appearance = "filled";
|
|
366
|
+
this.size = "md";
|
|
367
|
+
this.disabled = false;
|
|
368
|
+
this.loading = false;
|
|
369
|
+
this.iconStart = "";
|
|
370
|
+
this.iconEnd = "";
|
|
371
|
+
this.fullWidth = false;
|
|
372
|
+
this.uppercase = false;
|
|
373
|
+
this.href = "";
|
|
374
|
+
this.target = "";
|
|
375
|
+
this.rel = "";
|
|
376
|
+
this.type = "button";
|
|
377
|
+
this._internals = this.attachInternals();
|
|
378
|
+
}
|
|
379
|
+
_handleClick() {
|
|
380
|
+
if (this.disabled || this.loading) return;
|
|
381
|
+
const form = this.closest("form");
|
|
382
|
+
if (!form) return;
|
|
383
|
+
if (this.type === "submit") form.requestSubmit();
|
|
384
|
+
else if (this.type === "reset") form.reset();
|
|
385
|
+
}
|
|
386
|
+
render() {
|
|
387
|
+
const isDisabled = this.disabled || this.loading;
|
|
388
|
+
const inner = this.loading ? html2`<lt-spinner></lt-spinner>` : html2`
|
|
389
|
+
${this.iconStart ? html2`<lt-icon class="icon-start" name=${this.iconStart}></lt-icon>` : ""}
|
|
390
|
+
<slot></slot>
|
|
391
|
+
${this.iconEnd ? html2`<lt-icon class="icon-end" name=${this.iconEnd}></lt-icon>` : ""}
|
|
392
|
+
`;
|
|
393
|
+
if (this.href) {
|
|
394
|
+
const rel = this.rel || (this.target === "_blank" ? "noopener noreferrer" : void 0);
|
|
395
|
+
return html2`
|
|
396
|
+
<a
|
|
397
|
+
part="base"
|
|
398
|
+
href=${this.href}
|
|
399
|
+
target=${ifDefined(this.target || void 0)}
|
|
400
|
+
rel=${ifDefined(rel)}
|
|
401
|
+
aria-disabled=${isDisabled ? "true" : nothing}
|
|
402
|
+
tabindex=${isDisabled ? "-1" : nothing}
|
|
403
|
+
>${inner}</a
|
|
404
|
+
>
|
|
405
|
+
`;
|
|
406
|
+
}
|
|
407
|
+
return html2`
|
|
408
|
+
<button
|
|
409
|
+
part="base"
|
|
410
|
+
type="button"
|
|
411
|
+
@click=${this._handleClick}
|
|
412
|
+
?disabled=${isDisabled}
|
|
413
|
+
aria-busy=${this.loading ? "true" : "false"}
|
|
414
|
+
>
|
|
415
|
+
${inner}
|
|
416
|
+
</button>
|
|
417
|
+
`;
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
Button.styles = buttonStyles;
|
|
421
|
+
Button.formAssociated = true;
|
|
422
|
+
__decorateClass([
|
|
423
|
+
property3({ reflect: true })
|
|
424
|
+
], Button.prototype, "variant", 2);
|
|
425
|
+
__decorateClass([
|
|
426
|
+
property3({ reflect: true })
|
|
427
|
+
], Button.prototype, "appearance", 2);
|
|
428
|
+
__decorateClass([
|
|
429
|
+
property3({ reflect: true })
|
|
430
|
+
], Button.prototype, "size", 2);
|
|
431
|
+
__decorateClass([
|
|
432
|
+
property3({ type: Boolean, reflect: true })
|
|
433
|
+
], Button.prototype, "disabled", 2);
|
|
434
|
+
__decorateClass([
|
|
435
|
+
property3({ type: Boolean, reflect: true })
|
|
436
|
+
], Button.prototype, "loading", 2);
|
|
437
|
+
__decorateClass([
|
|
438
|
+
property3({ attribute: "icon-start" })
|
|
439
|
+
], Button.prototype, "iconStart", 2);
|
|
440
|
+
__decorateClass([
|
|
441
|
+
property3({ attribute: "icon-end" })
|
|
442
|
+
], Button.prototype, "iconEnd", 2);
|
|
443
|
+
__decorateClass([
|
|
444
|
+
property3({ type: Boolean, attribute: "full-width", reflect: true })
|
|
445
|
+
], Button.prototype, "fullWidth", 2);
|
|
446
|
+
__decorateClass([
|
|
447
|
+
property3({ type: Boolean, reflect: true })
|
|
448
|
+
], Button.prototype, "uppercase", 2);
|
|
449
|
+
__decorateClass([
|
|
450
|
+
property3()
|
|
451
|
+
], Button.prototype, "href", 2);
|
|
452
|
+
__decorateClass([
|
|
453
|
+
property3()
|
|
454
|
+
], Button.prototype, "target", 2);
|
|
455
|
+
__decorateClass([
|
|
456
|
+
property3()
|
|
457
|
+
], Button.prototype, "rel", 2);
|
|
458
|
+
__decorateClass([
|
|
459
|
+
property3({ reflect: true })
|
|
460
|
+
], Button.prototype, "type", 2);
|
|
461
|
+
Button = __decorateClass([
|
|
462
|
+
customElement2("lt-button")
|
|
463
|
+
], Button);
|
|
464
|
+
export {
|
|
465
|
+
Button
|
|
466
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type PropertyValues } from 'lit';
|
|
2
|
+
import { ThemeableElement } from '../../base';
|
|
3
|
+
import '@latty-ds/icons';
|
|
4
|
+
import type { CalendarMode, CalendarWeekStart } from './calendar.types';
|
|
5
|
+
/**
|
|
6
|
+
* A visual calendar grid for single-date or date-range selection.
|
|
7
|
+
*
|
|
8
|
+
* @element lt-calendar
|
|
9
|
+
*
|
|
10
|
+
* @fires {CustomEvent<{value: string}>} change - Fired when a single date is selected (mode="single").
|
|
11
|
+
* @fires {CustomEvent<{valueStart: string, valueEnd: string}>} change - Fired when a full range is selected (mode="range").
|
|
12
|
+
* @fires {CustomEvent<{year: number, month: number}>} month-change - Fired when the viewed month changes.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <lt-calendar value="2026-05-19"></lt-calendar>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```html
|
|
21
|
+
* <lt-calendar mode="range" value-start="2026-05-10" value-end="2026-05-20"></lt-calendar>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```html
|
|
26
|
+
* <lt-calendar locale="fr-FR" week-start="1" min="2026-01-01" max="2026-12-31"></lt-calendar>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class Calendar extends ThemeableElement {
|
|
30
|
+
static styles: import("lit").CSSResult;
|
|
31
|
+
/** Selection mode. "single" selects one date; "range" selects a start and end date. */
|
|
32
|
+
mode: CalendarMode;
|
|
33
|
+
/** Selected date in ISO format (YYYY-MM-DD). Used in mode="single". */
|
|
34
|
+
value: string;
|
|
35
|
+
/** Range start date in ISO format. Used in mode="range". */
|
|
36
|
+
valueStart: string;
|
|
37
|
+
/** Range end date in ISO format. Used in mode="range". */
|
|
38
|
+
valueEnd: string;
|
|
39
|
+
/** Minimum selectable date (ISO format). Dates before this are disabled. */
|
|
40
|
+
min: string;
|
|
41
|
+
/** Maximum selectable date (ISO format). Dates after this are disabled. */
|
|
42
|
+
max: string;
|
|
43
|
+
/** BCP 47 locale used for day and month names. */
|
|
44
|
+
locale: string;
|
|
45
|
+
/** First day of the week. 0 = Sunday, 1 = Monday. */
|
|
46
|
+
weekStart: CalendarWeekStart;
|
|
47
|
+
/** Whether to render filler days from the previous and next month. */
|
|
48
|
+
showOutsideDays: boolean;
|
|
49
|
+
/** Disables all interaction. */
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
/** Number of month panels to display side-by-side. */
|
|
52
|
+
months: number;
|
|
53
|
+
/** Specific dates to disable, as an array of Date objects. Not reflected as an attribute. */
|
|
54
|
+
disabledDates: Date[];
|
|
55
|
+
private _viewYear;
|
|
56
|
+
private _viewMonth;
|
|
57
|
+
private _focusedDate;
|
|
58
|
+
private _hoverDate;
|
|
59
|
+
private _pickingMonthYear;
|
|
60
|
+
private _pickerYear;
|
|
61
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
62
|
+
private _monthAtOffset;
|
|
63
|
+
private _parseDate;
|
|
64
|
+
private _toIso;
|
|
65
|
+
private _isSameDay;
|
|
66
|
+
private _isDisabled;
|
|
67
|
+
private _buildDays;
|
|
68
|
+
private _getWeekdayLabels;
|
|
69
|
+
private _navigate;
|
|
70
|
+
private _openPicker;
|
|
71
|
+
private _closePicker;
|
|
72
|
+
private _selectPickerMonth;
|
|
73
|
+
private _selectDay;
|
|
74
|
+
private _goToToday;
|
|
75
|
+
private _dayAriaLabel;
|
|
76
|
+
private _focusCell;
|
|
77
|
+
private _handleCalendarKeyDown;
|
|
78
|
+
private _handleGridMouseOver;
|
|
79
|
+
private _handleGridMouseLeave;
|
|
80
|
+
private _handleKeyDown;
|
|
81
|
+
private _renderDay;
|
|
82
|
+
private _renderMonthGrid;
|
|
83
|
+
render(): import("lit").TemplateResult<1>;
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const calendarStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type CalendarWeekStart = '0' | '1';
|
|
2
|
+
export type CalendarMode = 'single' | 'range';
|
|
3
|
+
export interface CalendarDay {
|
|
4
|
+
date: Date;
|
|
5
|
+
isCurrentMonth: boolean;
|
|
6
|
+
isToday: boolean;
|
|
7
|
+
isSelected: boolean;
|
|
8
|
+
isDisabled: boolean;
|
|
9
|
+
isRangeStart: boolean;
|
|
10
|
+
isRangeEnd: boolean;
|
|
11
|
+
isInRange: boolean;
|
|
12
|
+
isRangeHoverStart: boolean;
|
|
13
|
+
isRangeHoverEnd: boolean;
|
|
14
|
+
isInHoverRange: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Calendar } from './calendar';
|