@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,52 @@
|
|
|
1
|
+
import { ThemeableElement } from '../../base';
|
|
2
|
+
import type { DatepickerType, DatepickerSize, DatepickerVariant } from './datepicker.types';
|
|
3
|
+
import '../text/text';
|
|
4
|
+
/**
|
|
5
|
+
* Date and time picker wrapping the native browser date/time input with design-system styling.
|
|
6
|
+
*
|
|
7
|
+
* @element lt-datepicker
|
|
8
|
+
*
|
|
9
|
+
* @fires {CustomEvent<{value: string}>} change - Fired when the value changes (on blur).
|
|
10
|
+
* @fires {CustomEvent<{value: string}>} input - Fired on every keystroke / picker selection.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```html
|
|
14
|
+
* <lt-datepicker label="Start date" type="date"></lt-datepicker>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```html
|
|
19
|
+
* <lt-datepicker label="Meeting time" type="datetime-local" required></lt-datepicker>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class Datepicker extends ThemeableElement {
|
|
23
|
+
static styles: import("lit").CSSResult;
|
|
24
|
+
/** Native input type. */
|
|
25
|
+
type: DatepickerType;
|
|
26
|
+
/** Current value in the format required by the native input (`YYYY-MM-DD`, `HH:MM`, or `YYYY-MM-DDTHH:MM`). */
|
|
27
|
+
value: string;
|
|
28
|
+
/** Minimum allowed value. */
|
|
29
|
+
min: string;
|
|
30
|
+
/** Maximum allowed value. */
|
|
31
|
+
max: string;
|
|
32
|
+
/** Field label displayed above the input. */
|
|
33
|
+
label: string;
|
|
34
|
+
/** Helper or error text displayed below the input. */
|
|
35
|
+
helperText: string;
|
|
36
|
+
/** Visual state variant. */
|
|
37
|
+
variant: DatepickerVariant;
|
|
38
|
+
/** Visual size. */
|
|
39
|
+
size: DatepickerSize;
|
|
40
|
+
/** Whether the field is disabled. */
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
/** Whether the field is required. */
|
|
43
|
+
required: boolean;
|
|
44
|
+
/** Whether the field is read-only. */
|
|
45
|
+
readonly: boolean;
|
|
46
|
+
/** Name used in form submission. */
|
|
47
|
+
name: string;
|
|
48
|
+
private input;
|
|
49
|
+
private handleChange;
|
|
50
|
+
private handleInput;
|
|
51
|
+
render(): import("lit").TemplateResult<1>;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const datepickerStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,416 @@
|
|
|
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/datepicker/datepicker.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/datepicker/datepicker.ts
|
|
38
|
+
import { customElement as customElement2, property as property3, query } from "lit/decorators.js";
|
|
39
|
+
|
|
40
|
+
// src/components/datepicker/datepicker.styles.ts
|
|
41
|
+
import { css } from "lit";
|
|
42
|
+
var datepickerStyles = css`
|
|
43
|
+
:host {
|
|
44
|
+
display: block;
|
|
45
|
+
font-family: 'Hanken Grotesk', sans-serif;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.wrapper {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: var(--lt-spacing-1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
label {
|
|
55
|
+
color: var(--lt-text-default);
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: var(--lt-spacing-1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.required-indicator {
|
|
62
|
+
color: var(--lt-color-error-500);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
input {
|
|
66
|
+
background: var(--lt-bg-surface);
|
|
67
|
+
border-radius: var(--lt-border-radius);
|
|
68
|
+
border: 1px solid var(--lt-border-default);
|
|
69
|
+
color: var(--lt-text-default);
|
|
70
|
+
font-family: inherit;
|
|
71
|
+
font-size: 0.9375rem;
|
|
72
|
+
outline: none;
|
|
73
|
+
transition:
|
|
74
|
+
border-color 150ms ease,
|
|
75
|
+
box-shadow 150ms ease;
|
|
76
|
+
width: 100%;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
input:focus {
|
|
81
|
+
border-color: var(--lt-border-primary);
|
|
82
|
+
box-shadow: 0 0 0 3px var(--lt-bg-primary-subtle);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
input:disabled {
|
|
86
|
+
background: var(--lt-bg-neutral-subtle);
|
|
87
|
+
color: var(--lt-text-subtle);
|
|
88
|
+
cursor: not-allowed;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Sizes */
|
|
92
|
+
:host([size='sm']) input {
|
|
93
|
+
font-size: 0.8125rem;
|
|
94
|
+
height: 32px;
|
|
95
|
+
padding: 0 var(--lt-spacing-2);
|
|
96
|
+
}
|
|
97
|
+
:host([size='md']) input,
|
|
98
|
+
:host(:not([size])) input {
|
|
99
|
+
font-size: 0.9375rem;
|
|
100
|
+
height: 40px;
|
|
101
|
+
padding: 0 var(--lt-spacing-3);
|
|
102
|
+
}
|
|
103
|
+
:host([size='lg']) input {
|
|
104
|
+
font-size: 1rem;
|
|
105
|
+
height: 48px;
|
|
106
|
+
padding: 0 var(--lt-spacing-4);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Variants */
|
|
110
|
+
:host([variant='success']) input {
|
|
111
|
+
border-color: var(--lt-color-success-500);
|
|
112
|
+
}
|
|
113
|
+
:host([variant='success']) input:focus {
|
|
114
|
+
box-shadow: 0 0 0 3px var(--lt-bg-success-subtle);
|
|
115
|
+
}
|
|
116
|
+
:host([variant='warning']) input {
|
|
117
|
+
border-color: var(--lt-color-warning-500);
|
|
118
|
+
}
|
|
119
|
+
:host([variant='warning']) input:focus {
|
|
120
|
+
box-shadow: 0 0 0 3px var(--lt-bg-warning-subtle);
|
|
121
|
+
}
|
|
122
|
+
:host([variant='error']) input {
|
|
123
|
+
border-color: var(--lt-color-error-500);
|
|
124
|
+
}
|
|
125
|
+
:host([variant='error']) input:focus {
|
|
126
|
+
box-shadow: 0 0 0 3px var(--lt-bg-error-subtle);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.helper-text {
|
|
130
|
+
color: var(--lt-text-subtle);
|
|
131
|
+
font-size: 0.8125rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host([variant='error']) .helper-text {
|
|
135
|
+
color: var(--lt-color-error-600);
|
|
136
|
+
}
|
|
137
|
+
:host([variant='success']) .helper-text {
|
|
138
|
+
color: var(--lt-color-success-600);
|
|
139
|
+
}
|
|
140
|
+
:host([variant='warning']) .helper-text {
|
|
141
|
+
color: var(--lt-color-warning-700);
|
|
142
|
+
}
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
// src/utils/dispatch.ts
|
|
146
|
+
var dispatch = (host, name, detail, init) => host.dispatchEvent(new CustomEvent(name, { detail, bubbles: true, composed: true, ...init }));
|
|
147
|
+
|
|
148
|
+
// src/components/text/text.ts
|
|
149
|
+
import { customElement, property as property2 } from "lit/decorators.js";
|
|
150
|
+
import { html, unsafeStatic } from "lit/static-html.js";
|
|
151
|
+
|
|
152
|
+
// src/components/text/text.styles.ts
|
|
153
|
+
import { css as css2 } from "lit";
|
|
154
|
+
var textStyles = css2`
|
|
155
|
+
:host {
|
|
156
|
+
display: block;
|
|
157
|
+
color: inherit;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Inline variants sit in text flow */
|
|
161
|
+
:host([variant='caption']),
|
|
162
|
+
:host([variant='overline']),
|
|
163
|
+
:host([variant='label']) {
|
|
164
|
+
display: inline;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[part='base'] {
|
|
168
|
+
margin: 0;
|
|
169
|
+
color: inherit;
|
|
170
|
+
font-family: var(--lt-typography-fontfamily);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* ── Display ─────────────────────────────────────────────────────────── */
|
|
174
|
+
|
|
175
|
+
:host([variant='display-2xl']) [part='base'] {
|
|
176
|
+
font-size: clamp(2.5rem, 6vw, 4.5rem);
|
|
177
|
+
font-weight: var(--lt-text-weight, 200);
|
|
178
|
+
line-height: 1.1;
|
|
179
|
+
letter-spacing: -0.02em;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:host([variant='display-xl']) [part='base'] {
|
|
183
|
+
font-size: clamp(2rem, 5vw, 3.75rem);
|
|
184
|
+
font-weight: var(--lt-text-weight, 200);
|
|
185
|
+
line-height: 1.1;
|
|
186
|
+
letter-spacing: -0.02em;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
:host([variant='display-lg']) [part='base'] {
|
|
190
|
+
font-size: clamp(2rem, 4vw, 3rem);
|
|
191
|
+
font-weight: var(--lt-text-weight, 200);
|
|
192
|
+
line-height: 1.15;
|
|
193
|
+
letter-spacing: -0.01em;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* ── Headings ─────────────────────────────────────────────────────────── */
|
|
197
|
+
|
|
198
|
+
:host([variant='h1']) [part='base'] {
|
|
199
|
+
font-size: clamp(1.75rem, 2.5vw + 0.75rem, 2.5rem);
|
|
200
|
+
font-weight: var(--lt-text-weight, 600);
|
|
201
|
+
line-height: 1.2;
|
|
202
|
+
letter-spacing: -0.02em;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
:host([variant='h2']) [part='base'] {
|
|
206
|
+
font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
|
|
207
|
+
font-weight: var(--lt-text-weight, 600);
|
|
208
|
+
line-height: 1.25;
|
|
209
|
+
letter-spacing: -0.01em;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
:host([variant='h3']) [part='base'] {
|
|
213
|
+
font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
|
|
214
|
+
font-weight: var(--lt-text-weight, 600);
|
|
215
|
+
line-height: 1.3;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
:host([variant='h4']) [part='base'] {
|
|
219
|
+
font-size: 1.25rem;
|
|
220
|
+
font-weight: var(--lt-text-weight, 600);
|
|
221
|
+
line-height: 1.35;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
:host([variant='h5']) [part='base'] {
|
|
225
|
+
font-size: 1.125rem;
|
|
226
|
+
font-weight: var(--lt-text-weight, 600);
|
|
227
|
+
line-height: 1.4;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
:host([variant='h6']) [part='base'] {
|
|
231
|
+
font-size: 1rem;
|
|
232
|
+
font-weight: var(--lt-text-weight, 600);
|
|
233
|
+
line-height: 1.4;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* ── Body ─────────────────────────────────────────────────────────────── */
|
|
237
|
+
|
|
238
|
+
:host([variant='lead']) [part='base'] {
|
|
239
|
+
font-size: 1.25rem;
|
|
240
|
+
font-weight: var(--lt-text-weight, 400);
|
|
241
|
+
line-height: 1.6;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:host([variant='body']) [part='base'],
|
|
245
|
+
:host(:not([variant])) [part='base'] {
|
|
246
|
+
font-size: 1rem;
|
|
247
|
+
font-weight: var(--lt-text-weight, 400);
|
|
248
|
+
line-height: 1.6;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
:host([variant='body-sm']) [part='base'] {
|
|
252
|
+
font-size: 0.875rem;
|
|
253
|
+
font-weight: var(--lt-text-weight, 400);
|
|
254
|
+
line-height: 1.6;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/* ── Inline ───────────────────────────────────────────────────────────── */
|
|
258
|
+
|
|
259
|
+
:host([variant='caption']) [part='base'] {
|
|
260
|
+
font-size: 0.75rem;
|
|
261
|
+
font-weight: var(--lt-text-weight, 400);
|
|
262
|
+
line-height: 1.5;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
:host([variant='overline']) [part='base'] {
|
|
266
|
+
font-size: 0.6875rem;
|
|
267
|
+
font-weight: var(--lt-text-weight, 600);
|
|
268
|
+
line-height: 1.2;
|
|
269
|
+
letter-spacing: 0.08em;
|
|
270
|
+
text-transform: uppercase;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
:host([variant='label']) [part='base'] {
|
|
274
|
+
font-size: 0.875rem;
|
|
275
|
+
font-weight: var(--lt-text-weight, 600);
|
|
276
|
+
line-height: 1.4;
|
|
277
|
+
}
|
|
278
|
+
`;
|
|
279
|
+
|
|
280
|
+
// src/components/text/text.ts
|
|
281
|
+
var VARIANT_TAG = {
|
|
282
|
+
"display-2xl": "p",
|
|
283
|
+
"display-xl": "p",
|
|
284
|
+
"display-lg": "p",
|
|
285
|
+
h1: "h1",
|
|
286
|
+
h2: "h2",
|
|
287
|
+
h3: "h3",
|
|
288
|
+
h4: "h4",
|
|
289
|
+
h5: "h5",
|
|
290
|
+
h6: "h6",
|
|
291
|
+
lead: "p",
|
|
292
|
+
body: "p",
|
|
293
|
+
"body-sm": "p",
|
|
294
|
+
caption: "span",
|
|
295
|
+
overline: "span",
|
|
296
|
+
label: "span"
|
|
297
|
+
};
|
|
298
|
+
var Text = class extends ThemeableElement {
|
|
299
|
+
constructor() {
|
|
300
|
+
super(...arguments);
|
|
301
|
+
this.variant = "body";
|
|
302
|
+
this.as = "";
|
|
303
|
+
}
|
|
304
|
+
render() {
|
|
305
|
+
const tag = unsafeStatic(this.as || VARIANT_TAG[this.variant] || "p");
|
|
306
|
+
return html`<${tag} part="base"><slot></slot></${tag}>`;
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
Text.styles = textStyles;
|
|
310
|
+
__decorateClass([
|
|
311
|
+
property2({ reflect: true })
|
|
312
|
+
], Text.prototype, "variant", 2);
|
|
313
|
+
__decorateClass([
|
|
314
|
+
property2({ reflect: true })
|
|
315
|
+
], Text.prototype, "as", 2);
|
|
316
|
+
Text = __decorateClass([
|
|
317
|
+
customElement("lt-text")
|
|
318
|
+
], Text);
|
|
319
|
+
|
|
320
|
+
// src/components/datepicker/datepicker.ts
|
|
321
|
+
var Datepicker = class extends ThemeableElement {
|
|
322
|
+
constructor() {
|
|
323
|
+
super(...arguments);
|
|
324
|
+
this.type = "date";
|
|
325
|
+
this.value = "";
|
|
326
|
+
this.min = "";
|
|
327
|
+
this.max = "";
|
|
328
|
+
this.label = "";
|
|
329
|
+
this.helperText = "";
|
|
330
|
+
this.variant = "default";
|
|
331
|
+
this.size = "md";
|
|
332
|
+
this.disabled = false;
|
|
333
|
+
this.required = false;
|
|
334
|
+
this.readonly = false;
|
|
335
|
+
this.name = "";
|
|
336
|
+
}
|
|
337
|
+
handleChange() {
|
|
338
|
+
this.value = this.input.value;
|
|
339
|
+
dispatch(this, "change", { value: this.value });
|
|
340
|
+
}
|
|
341
|
+
handleInput() {
|
|
342
|
+
this.value = this.input.value;
|
|
343
|
+
dispatch(this, "input", { value: this.value });
|
|
344
|
+
}
|
|
345
|
+
render() {
|
|
346
|
+
const inputEl = html2`
|
|
347
|
+
<input
|
|
348
|
+
type=${this.type}
|
|
349
|
+
.value=${this.value}
|
|
350
|
+
min=${this.min || nothing}
|
|
351
|
+
max=${this.max || nothing}
|
|
352
|
+
name=${this.name || nothing}
|
|
353
|
+
?disabled=${this.disabled}
|
|
354
|
+
?required=${this.required}
|
|
355
|
+
?readonly=${this.readonly}
|
|
356
|
+
@change=${this.handleChange}
|
|
357
|
+
@input=${this.handleInput}
|
|
358
|
+
/>
|
|
359
|
+
`;
|
|
360
|
+
return html2`
|
|
361
|
+
<div class="wrapper">
|
|
362
|
+
${this.label ? html2`<label>
|
|
363
|
+
<lt-text variant="label" as="span">${this.label}</lt-text>
|
|
364
|
+
${this.required ? html2`<span class="required-indicator">*</span>` : nothing} ${inputEl}
|
|
365
|
+
</label>` : inputEl}
|
|
366
|
+
${this.helperText ? html2`<span class="helper-text">${this.helperText}</span>` : nothing}
|
|
367
|
+
</div>
|
|
368
|
+
`;
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
Datepicker.styles = datepickerStyles;
|
|
372
|
+
__decorateClass([
|
|
373
|
+
property3({ reflect: true })
|
|
374
|
+
], Datepicker.prototype, "type", 2);
|
|
375
|
+
__decorateClass([
|
|
376
|
+
property3()
|
|
377
|
+
], Datepicker.prototype, "value", 2);
|
|
378
|
+
__decorateClass([
|
|
379
|
+
property3()
|
|
380
|
+
], Datepicker.prototype, "min", 2);
|
|
381
|
+
__decorateClass([
|
|
382
|
+
property3()
|
|
383
|
+
], Datepicker.prototype, "max", 2);
|
|
384
|
+
__decorateClass([
|
|
385
|
+
property3()
|
|
386
|
+
], Datepicker.prototype, "label", 2);
|
|
387
|
+
__decorateClass([
|
|
388
|
+
property3({ attribute: "helper-text" })
|
|
389
|
+
], Datepicker.prototype, "helperText", 2);
|
|
390
|
+
__decorateClass([
|
|
391
|
+
property3({ reflect: true })
|
|
392
|
+
], Datepicker.prototype, "variant", 2);
|
|
393
|
+
__decorateClass([
|
|
394
|
+
property3({ reflect: true })
|
|
395
|
+
], Datepicker.prototype, "size", 2);
|
|
396
|
+
__decorateClass([
|
|
397
|
+
property3({ type: Boolean, reflect: true })
|
|
398
|
+
], Datepicker.prototype, "disabled", 2);
|
|
399
|
+
__decorateClass([
|
|
400
|
+
property3({ type: Boolean, reflect: true })
|
|
401
|
+
], Datepicker.prototype, "required", 2);
|
|
402
|
+
__decorateClass([
|
|
403
|
+
property3({ type: Boolean, reflect: true })
|
|
404
|
+
], Datepicker.prototype, "readonly", 2);
|
|
405
|
+
__decorateClass([
|
|
406
|
+
property3()
|
|
407
|
+
], Datepicker.prototype, "name", 2);
|
|
408
|
+
__decorateClass([
|
|
409
|
+
query("input")
|
|
410
|
+
], Datepicker.prototype, "input", 2);
|
|
411
|
+
Datepicker = __decorateClass([
|
|
412
|
+
customElement2("lt-datepicker")
|
|
413
|
+
], Datepicker);
|
|
414
|
+
export {
|
|
415
|
+
Datepicker
|
|
416
|
+
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { ThemeableElement } from '../../base';
|
|
2
|
+
import { DialogSize } from './dialog.types';
|
|
3
|
+
import '../icon-button/icon-button';
|
|
4
|
+
import '../surface/surface';
|
|
5
|
+
import '../text/text';
|
|
6
|
+
/**
|
|
7
|
+
* Dialog component (modal) with backdrop, animations, and accessibility features.
|
|
8
|
+
*
|
|
9
|
+
* @element lt-dialog
|
|
10
|
+
*
|
|
11
|
+
* Features:
|
|
12
|
+
* - Multiple size options (sm, md, lg, xl, fullscreen)
|
|
13
|
+
* - Backdrop overlay with configurable click-to-close
|
|
14
|
+
* - Close on Escape key
|
|
15
|
+
* - Header with optional title and close button
|
|
16
|
+
* - Scrollable body content
|
|
17
|
+
* - Optional footer for actions
|
|
18
|
+
* - Focus trap and restoration
|
|
19
|
+
* - Custom open/close events
|
|
20
|
+
* - Accessible with aria-modal and role="dialog"
|
|
21
|
+
*
|
|
22
|
+
* @slot - Dialog body content
|
|
23
|
+
* @slot header - Custom header content (overrides title prop)
|
|
24
|
+
* @slot footer - Footer content (typically for action buttons)
|
|
25
|
+
*
|
|
26
|
+
* @fires dialog-open - Fired when dialog opens
|
|
27
|
+
* @fires dialog-close - Fired when dialog closes
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```html
|
|
31
|
+
* <lt-dialog open title="Confirm Action">
|
|
32
|
+
* <p>Are you sure you want to proceed?</p>
|
|
33
|
+
* <div slot="footer">
|
|
34
|
+
* <lt-button variant="neutral">Cancel</lt-button>
|
|
35
|
+
* <lt-button variant="primary">Confirm</lt-button>
|
|
36
|
+
* </div>
|
|
37
|
+
* </lt-dialog>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```html
|
|
42
|
+
* <lt-dialog size="lg" open title="Settings" no-close-button>
|
|
43
|
+
* <p>Dialog content here...</p>
|
|
44
|
+
* </lt-dialog>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare class Dialog extends ThemeableElement {
|
|
48
|
+
static styles: import("lit").CSSResult[];
|
|
49
|
+
/**
|
|
50
|
+
* Size of the dialog (affects max width).
|
|
51
|
+
* @default 'md'
|
|
52
|
+
*/
|
|
53
|
+
size: DialogSize;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the dialog is open.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
open: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Dialog title displayed in the header.
|
|
61
|
+
* @default ''
|
|
62
|
+
*/
|
|
63
|
+
title: string;
|
|
64
|
+
/**
|
|
65
|
+
* Suppress the built-in close button in the header.
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
noCloseButton: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether clicking the backdrop closes the dialog.
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
closeOnBackdropClick: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Whether pressing Escape closes the dialog.
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
78
|
+
closeOnEscape: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Renders the dialog title in small caps with wider letter spacing.
|
|
81
|
+
* @default false
|
|
82
|
+
*/
|
|
83
|
+
uppercase: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Apply a frosted-glass blur effect to the backdrop.
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
backdropBlur: boolean;
|
|
89
|
+
private dialogElement?;
|
|
90
|
+
private previouslyFocusedElement?;
|
|
91
|
+
/**
|
|
92
|
+
* Opens the dialog.
|
|
93
|
+
*/
|
|
94
|
+
show(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Closes the dialog.
|
|
97
|
+
*/
|
|
98
|
+
hide(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Toggles the dialog open/closed state.
|
|
101
|
+
*/
|
|
102
|
+
toggle(): void;
|
|
103
|
+
connectedCallback(): void;
|
|
104
|
+
disconnectedCallback(): void;
|
|
105
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
106
|
+
private handleOpen;
|
|
107
|
+
private handleClose;
|
|
108
|
+
private restoreFocus;
|
|
109
|
+
private handleKeydown;
|
|
110
|
+
private handleBackdropClick;
|
|
111
|
+
private handleCloseClick;
|
|
112
|
+
render(): import("lit").TemplateResult<1>;
|
|
113
|
+
private hasSlot;
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const dialogStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size variant of the dialog component.
|
|
3
|
+
* Determines the width and overall size of the dialog.
|
|
4
|
+
*
|
|
5
|
+
* - `sm`: 400px max width
|
|
6
|
+
* - `md`: 600px max width (default)
|
|
7
|
+
* - `lg`: 800px max width
|
|
8
|
+
* - `xl`: 1000px max width
|
|
9
|
+
* - `fullscreen`: Full viewport width and height
|
|
10
|
+
*/
|
|
11
|
+
export type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'fullscreen';
|