@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 @@
|
|
|
1
|
+
export { ThemeableElement, type ComponentTheme } from './themeable-element';
|
|
@@ -0,0 +1,35 @@
|
|
|
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/base/themeable-element.ts
|
|
13
|
+
import { LitElement } from "lit";
|
|
14
|
+
import { property } from "lit/decorators.js";
|
|
15
|
+
var ThemeableElement = class extends LitElement {
|
|
16
|
+
willUpdate(changed) {
|
|
17
|
+
super.willUpdate(changed);
|
|
18
|
+
if (changed.has("theme")) {
|
|
19
|
+
this._syncThemeAttribute();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
_syncThemeAttribute() {
|
|
23
|
+
if (this.theme === "dark" || this.theme === "light") {
|
|
24
|
+
this.setAttribute("data-theme", this.theme);
|
|
25
|
+
} else {
|
|
26
|
+
this.removeAttribute("data-theme");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
__decorateClass([
|
|
31
|
+
property({ reflect: true })
|
|
32
|
+
], ThemeableElement.prototype, "theme", 2);
|
|
33
|
+
export {
|
|
34
|
+
ThemeableElement
|
|
35
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
export type ComponentTheme = 'dark' | 'light';
|
|
3
|
+
export declare class ThemeableElement extends LitElement {
|
|
4
|
+
/**
|
|
5
|
+
* Forces the component into a specific theme regardless of the page theme.
|
|
6
|
+
* `'dark'` | `'light'` — if unset, the component inherits the global scope theme.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```html
|
|
10
|
+
* <!-- Always dark, even on a light page -->
|
|
11
|
+
* <lt-surface theme="dark">…</lt-surface>
|
|
12
|
+
*
|
|
13
|
+
* <!-- Always light, even on a dark page -->
|
|
14
|
+
* <lt-button theme="light">Submit</lt-button>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
theme?: ComponentTheme;
|
|
18
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
19
|
+
private _syncThemeAttribute;
|
|
20
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ThemeableElement } from '../../base';
|
|
2
|
+
import { AccordionAppearance } from './accordion.types';
|
|
3
|
+
import '@latty-ds/icons';
|
|
4
|
+
import '../text/text';
|
|
5
|
+
/**
|
|
6
|
+
* An accordion component using native details/summary elements.
|
|
7
|
+
* Provides collapsible content sections with smooth animations.
|
|
8
|
+
*
|
|
9
|
+
* @element lt-accordion
|
|
10
|
+
*
|
|
11
|
+
* @fires {CustomEvent<{open: boolean}>} toggle - Dispatched when the accordion is opened or closed
|
|
12
|
+
*
|
|
13
|
+
* @slot - Content to display when accordion is expanded
|
|
14
|
+
* @slot summary - Custom content for the summary/header (defaults to label property)
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <lt-accordion label="What is Latty?">
|
|
19
|
+
* Latty is a design system built with Web Components.
|
|
20
|
+
* </lt-accordion>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```html
|
|
25
|
+
* <lt-accordion appearance="filled" label="Features" icon-start="settings" open>
|
|
26
|
+
* <ul>
|
|
27
|
+
* <li>Design tokens</li>
|
|
28
|
+
* <li>Web Components</li>
|
|
29
|
+
* <li>Accessible</li>
|
|
30
|
+
* </ul>
|
|
31
|
+
* </lt-accordion>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class Accordion extends ThemeableElement {
|
|
35
|
+
static styles: import("lit").CSSResult;
|
|
36
|
+
/**
|
|
37
|
+
* Label/title text for the accordion header.
|
|
38
|
+
* @default ''
|
|
39
|
+
*/
|
|
40
|
+
label: string;
|
|
41
|
+
/**
|
|
42
|
+
* Icon name to display at the start of the header.
|
|
43
|
+
* @default ''
|
|
44
|
+
*/
|
|
45
|
+
iconStart: string;
|
|
46
|
+
/**
|
|
47
|
+
* Visual appearance of the accordion.
|
|
48
|
+
* @default 'default'
|
|
49
|
+
*/
|
|
50
|
+
appearance: AccordionAppearance;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the accordion is initially open.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
open: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the accordion is disabled.
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
disabled: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Renders the header label in small caps with wider letter spacing.
|
|
63
|
+
* @default false
|
|
64
|
+
*/
|
|
65
|
+
uppercase: boolean;
|
|
66
|
+
private _details;
|
|
67
|
+
private _content;
|
|
68
|
+
private _contentInner;
|
|
69
|
+
private _animating;
|
|
70
|
+
protected updated(changedProperties: Map<string, unknown>): void;
|
|
71
|
+
/**
|
|
72
|
+
* Handles click on summary to animate the accordion.
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
private handleSummaryClick;
|
|
76
|
+
/**
|
|
77
|
+
* Handles the end of the transition to clear inline styles.
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
private handleTransitionEnd;
|
|
81
|
+
render(): import("lit").TemplateResult<1>;
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const accordionStyles: import("lit").CSSResult;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visual variant of the accordion component.
|
|
3
|
+
* Determines the styling of the accordion.
|
|
4
|
+
*
|
|
5
|
+
* - `default`: Standard appearance with border
|
|
6
|
+
* - `filled`: Filled background
|
|
7
|
+
* - `outlined`: Outlined with border only
|
|
8
|
+
* - `clean`: No border, no background — for embedding in sidebars or nested layouts
|
|
9
|
+
*/
|
|
10
|
+
export type AccordionAppearance = 'default' | 'filled' | 'outlined' | 'clean';
|
|
@@ -0,0 +1,468 @@
|
|
|
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/accordion/accordion.ts
|
|
13
|
+
import { html as html2 } 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/accordion/accordion.ts
|
|
38
|
+
import { customElement as customElement2, property as property3, query } from "lit/decorators.js";
|
|
39
|
+
|
|
40
|
+
// src/components/accordion/accordion.styles.ts
|
|
41
|
+
import { css } from "lit";
|
|
42
|
+
var accordionStyles = css`
|
|
43
|
+
:host {
|
|
44
|
+
display: block;
|
|
45
|
+
font-family: 'Hanken Grotesk', sans-serif;
|
|
46
|
+
width: 100%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
details {
|
|
50
|
+
border-radius: var(--lt-border-radius);
|
|
51
|
+
transition:
|
|
52
|
+
background-color 120ms ease,
|
|
53
|
+
border-color 120ms ease;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
summary {
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
list-style: none;
|
|
59
|
+
user-select: none;
|
|
60
|
+
border-radius: var(--lt-border-radius);
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
summary::-webkit-details-marker {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.summary-content {
|
|
69
|
+
align-items: center;
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: var(--lt-spacing-3);
|
|
72
|
+
justify-content: space-between;
|
|
73
|
+
padding: var(--lt-accordion-summary-padding, var(--lt-spacing-4));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.start-icon {
|
|
77
|
+
color: var(--lt-text-subtle);
|
|
78
|
+
flex-shrink: 0;
|
|
79
|
+
font-size: 1.25rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.summary-text {
|
|
83
|
+
color: var(--lt-accordion-header-color, var(--lt-text-default));
|
|
84
|
+
flex: 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.summary-text::part(base) {
|
|
88
|
+
font-size: var(--lt-accordion-header-font-size, 1rem);
|
|
89
|
+
font-weight: var(--lt-accordion-header-font-weight, 600);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.chevron {
|
|
93
|
+
color: var(--lt-text-subtle);
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
height: 20px;
|
|
96
|
+
transition: transform 200ms ease;
|
|
97
|
+
width: 20px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
details[open] .chevron {
|
|
101
|
+
transform: rotate(180deg);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
summary:hover .chevron {
|
|
105
|
+
color: var(--lt-text-default);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
summary:focus-visible {
|
|
109
|
+
outline: 2px solid var(--lt-border-focus);
|
|
110
|
+
outline-offset: 2px;
|
|
111
|
+
border-radius: var(--lt-border-radius);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.content {
|
|
115
|
+
height: 0;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
transition: height 200ms ease;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.content-inner {
|
|
121
|
+
color: var(--lt-text-subtle);
|
|
122
|
+
font-size: 0.9375rem;
|
|
123
|
+
line-height: 1.6;
|
|
124
|
+
padding: var(--lt-accordion-content-padding, 0 var(--lt-spacing-4) var(--lt-spacing-4));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Variant: default */
|
|
128
|
+
:host([appearance='default']) details {
|
|
129
|
+
background: var(--lt-bg-subtle);
|
|
130
|
+
border: 1px solid var(--lt-border-default);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:host([appearance='default']) details:hover {
|
|
134
|
+
border-color: var(--lt-border-strong);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Variant: filled */
|
|
138
|
+
:host([appearance='filled']) details {
|
|
139
|
+
background: var(--lt-bg-surface);
|
|
140
|
+
border: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
:host([appearance='filled']) details:hover {
|
|
144
|
+
background: var(--lt-bg-overlay);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Variant: outlined */
|
|
148
|
+
:host([appearance='outlined']) details {
|
|
149
|
+
background: transparent;
|
|
150
|
+
border: 1px solid var(--lt-border-default);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([appearance='outlined']) details:hover {
|
|
154
|
+
border-color: var(--lt-border-strong);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Variant: clean */
|
|
158
|
+
:host([appearance='clean']) details {
|
|
159
|
+
background: transparent;
|
|
160
|
+
border: none;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Disabled state */
|
|
164
|
+
:host([disabled]) details {
|
|
165
|
+
opacity: 0.6;
|
|
166
|
+
pointer-events: none;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
:host([uppercase]) .summary-text::part(base) {
|
|
170
|
+
font-variant-caps: small-caps;
|
|
171
|
+
letter-spacing: 0.05rem;
|
|
172
|
+
text-transform: lowercase;
|
|
173
|
+
}
|
|
174
|
+
`;
|
|
175
|
+
|
|
176
|
+
// src/components/accordion/accordion.ts
|
|
177
|
+
import "@latty-ds/icons";
|
|
178
|
+
|
|
179
|
+
// src/components/text/text.ts
|
|
180
|
+
import { customElement, property as property2 } from "lit/decorators.js";
|
|
181
|
+
import { html, unsafeStatic } from "lit/static-html.js";
|
|
182
|
+
|
|
183
|
+
// src/components/text/text.styles.ts
|
|
184
|
+
import { css as css2 } from "lit";
|
|
185
|
+
var textStyles = css2`
|
|
186
|
+
:host {
|
|
187
|
+
display: block;
|
|
188
|
+
color: inherit;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Inline variants sit in text flow */
|
|
192
|
+
:host([variant='caption']),
|
|
193
|
+
:host([variant='overline']),
|
|
194
|
+
:host([variant='label']) {
|
|
195
|
+
display: inline;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
[part='base'] {
|
|
199
|
+
margin: 0;
|
|
200
|
+
color: inherit;
|
|
201
|
+
font-family: var(--lt-typography-fontfamily);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* ── Display ─────────────────────────────────────────────────────────── */
|
|
205
|
+
|
|
206
|
+
:host([variant='display-2xl']) [part='base'] {
|
|
207
|
+
font-size: clamp(2.5rem, 6vw, 4.5rem);
|
|
208
|
+
font-weight: var(--lt-text-weight, 200);
|
|
209
|
+
line-height: 1.1;
|
|
210
|
+
letter-spacing: -0.02em;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
:host([variant='display-xl']) [part='base'] {
|
|
214
|
+
font-size: clamp(2rem, 5vw, 3.75rem);
|
|
215
|
+
font-weight: var(--lt-text-weight, 200);
|
|
216
|
+
line-height: 1.1;
|
|
217
|
+
letter-spacing: -0.02em;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host([variant='display-lg']) [part='base'] {
|
|
221
|
+
font-size: clamp(2rem, 4vw, 3rem);
|
|
222
|
+
font-weight: var(--lt-text-weight, 200);
|
|
223
|
+
line-height: 1.15;
|
|
224
|
+
letter-spacing: -0.01em;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* ── Headings ─────────────────────────────────────────────────────────── */
|
|
228
|
+
|
|
229
|
+
:host([variant='h1']) [part='base'] {
|
|
230
|
+
font-size: clamp(1.75rem, 2.5vw + 0.75rem, 2.5rem);
|
|
231
|
+
font-weight: var(--lt-text-weight, 600);
|
|
232
|
+
line-height: 1.2;
|
|
233
|
+
letter-spacing: -0.02em;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
:host([variant='h2']) [part='base'] {
|
|
237
|
+
font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
|
|
238
|
+
font-weight: var(--lt-text-weight, 600);
|
|
239
|
+
line-height: 1.25;
|
|
240
|
+
letter-spacing: -0.01em;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:host([variant='h3']) [part='base'] {
|
|
244
|
+
font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem);
|
|
245
|
+
font-weight: var(--lt-text-weight, 600);
|
|
246
|
+
line-height: 1.3;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
:host([variant='h4']) [part='base'] {
|
|
250
|
+
font-size: 1.25rem;
|
|
251
|
+
font-weight: var(--lt-text-weight, 600);
|
|
252
|
+
line-height: 1.35;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
:host([variant='h5']) [part='base'] {
|
|
256
|
+
font-size: 1.125rem;
|
|
257
|
+
font-weight: var(--lt-text-weight, 600);
|
|
258
|
+
line-height: 1.4;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
:host([variant='h6']) [part='base'] {
|
|
262
|
+
font-size: 1rem;
|
|
263
|
+
font-weight: var(--lt-text-weight, 600);
|
|
264
|
+
line-height: 1.4;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* ── Body ─────────────────────────────────────────────────────────────── */
|
|
268
|
+
|
|
269
|
+
:host([variant='lead']) [part='base'] {
|
|
270
|
+
font-size: 1.25rem;
|
|
271
|
+
font-weight: var(--lt-text-weight, 400);
|
|
272
|
+
line-height: 1.6;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
:host([variant='body']) [part='base'],
|
|
276
|
+
:host(:not([variant])) [part='base'] {
|
|
277
|
+
font-size: 1rem;
|
|
278
|
+
font-weight: var(--lt-text-weight, 400);
|
|
279
|
+
line-height: 1.6;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:host([variant='body-sm']) [part='base'] {
|
|
283
|
+
font-size: 0.875rem;
|
|
284
|
+
font-weight: var(--lt-text-weight, 400);
|
|
285
|
+
line-height: 1.6;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* ── Inline ───────────────────────────────────────────────────────────── */
|
|
289
|
+
|
|
290
|
+
:host([variant='caption']) [part='base'] {
|
|
291
|
+
font-size: 0.75rem;
|
|
292
|
+
font-weight: var(--lt-text-weight, 400);
|
|
293
|
+
line-height: 1.5;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
:host([variant='overline']) [part='base'] {
|
|
297
|
+
font-size: 0.6875rem;
|
|
298
|
+
font-weight: var(--lt-text-weight, 600);
|
|
299
|
+
line-height: 1.2;
|
|
300
|
+
letter-spacing: 0.08em;
|
|
301
|
+
text-transform: uppercase;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
:host([variant='label']) [part='base'] {
|
|
305
|
+
font-size: 0.875rem;
|
|
306
|
+
font-weight: var(--lt-text-weight, 600);
|
|
307
|
+
line-height: 1.4;
|
|
308
|
+
}
|
|
309
|
+
`;
|
|
310
|
+
|
|
311
|
+
// src/components/text/text.ts
|
|
312
|
+
var VARIANT_TAG = {
|
|
313
|
+
"display-2xl": "p",
|
|
314
|
+
"display-xl": "p",
|
|
315
|
+
"display-lg": "p",
|
|
316
|
+
h1: "h1",
|
|
317
|
+
h2: "h2",
|
|
318
|
+
h3: "h3",
|
|
319
|
+
h4: "h4",
|
|
320
|
+
h5: "h5",
|
|
321
|
+
h6: "h6",
|
|
322
|
+
lead: "p",
|
|
323
|
+
body: "p",
|
|
324
|
+
"body-sm": "p",
|
|
325
|
+
caption: "span",
|
|
326
|
+
overline: "span",
|
|
327
|
+
label: "span"
|
|
328
|
+
};
|
|
329
|
+
var Text = class extends ThemeableElement {
|
|
330
|
+
constructor() {
|
|
331
|
+
super(...arguments);
|
|
332
|
+
this.variant = "body";
|
|
333
|
+
this.as = "";
|
|
334
|
+
}
|
|
335
|
+
render() {
|
|
336
|
+
const tag = unsafeStatic(this.as || VARIANT_TAG[this.variant] || "p");
|
|
337
|
+
return html`<${tag} part="base"><slot></slot></${tag}>`;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
Text.styles = textStyles;
|
|
341
|
+
__decorateClass([
|
|
342
|
+
property2({ reflect: true })
|
|
343
|
+
], Text.prototype, "variant", 2);
|
|
344
|
+
__decorateClass([
|
|
345
|
+
property2({ reflect: true })
|
|
346
|
+
], Text.prototype, "as", 2);
|
|
347
|
+
Text = __decorateClass([
|
|
348
|
+
customElement("lt-text")
|
|
349
|
+
], Text);
|
|
350
|
+
|
|
351
|
+
// src/components/accordion/accordion.ts
|
|
352
|
+
var Accordion = class extends ThemeableElement {
|
|
353
|
+
constructor() {
|
|
354
|
+
super(...arguments);
|
|
355
|
+
this.label = "";
|
|
356
|
+
this.iconStart = "";
|
|
357
|
+
this.appearance = "default";
|
|
358
|
+
this.open = false;
|
|
359
|
+
this.disabled = false;
|
|
360
|
+
this.uppercase = false;
|
|
361
|
+
this._animating = false;
|
|
362
|
+
}
|
|
363
|
+
updated(changedProperties) {
|
|
364
|
+
super.updated(changedProperties);
|
|
365
|
+
if (changedProperties.has("open") && !this._animating) {
|
|
366
|
+
this._details.open = this.open;
|
|
367
|
+
this._content.style.height = this.open ? "auto" : "0px";
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Handles click on summary to animate the accordion.
|
|
372
|
+
* @private
|
|
373
|
+
*/
|
|
374
|
+
handleSummaryClick(e) {
|
|
375
|
+
e.preventDefault();
|
|
376
|
+
if (this.disabled) return;
|
|
377
|
+
this._animating = true;
|
|
378
|
+
if (this.open) {
|
|
379
|
+
const startHeight = this._contentInner.offsetHeight;
|
|
380
|
+
this.open = false;
|
|
381
|
+
this._content.style.height = `${startHeight}px`;
|
|
382
|
+
requestAnimationFrame(() => {
|
|
383
|
+
this._content.style.height = "0px";
|
|
384
|
+
});
|
|
385
|
+
} else {
|
|
386
|
+
this._details.open = true;
|
|
387
|
+
this.open = true;
|
|
388
|
+
const endHeight = this._contentInner.offsetHeight;
|
|
389
|
+
this._content.style.height = "0px";
|
|
390
|
+
requestAnimationFrame(() => {
|
|
391
|
+
this._content.style.height = `${endHeight}px`;
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
this.dispatchEvent(
|
|
395
|
+
new CustomEvent("toggle", {
|
|
396
|
+
detail: { open: this.open },
|
|
397
|
+
bubbles: true,
|
|
398
|
+
composed: true
|
|
399
|
+
})
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Handles the end of the transition to clear inline styles.
|
|
404
|
+
* @private
|
|
405
|
+
*/
|
|
406
|
+
handleTransitionEnd() {
|
|
407
|
+
this._animating = false;
|
|
408
|
+
if (this.open) {
|
|
409
|
+
this._content.style.height = "auto";
|
|
410
|
+
} else {
|
|
411
|
+
this._details.open = false;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
render() {
|
|
415
|
+
return html2`
|
|
416
|
+
<details>
|
|
417
|
+
<summary @click=${this.handleSummaryClick}>
|
|
418
|
+
<div class="summary-content">
|
|
419
|
+
${this.iconStart ? html2`<lt-icon class="start-icon" name="${this.iconStart}"></lt-icon>` : ""}
|
|
420
|
+
<lt-text variant="h6" as="span" class="summary-text">
|
|
421
|
+
<slot name="summary">${this.label}</slot>
|
|
422
|
+
</lt-text>
|
|
423
|
+
<lt-icon class="chevron" name="caret-down" size="md"></lt-icon>
|
|
424
|
+
</div>
|
|
425
|
+
</summary>
|
|
426
|
+
<div class="content" @transitionend=${this.handleTransitionEnd}>
|
|
427
|
+
<div class="content-inner">
|
|
428
|
+
<slot></slot>
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
</details>
|
|
432
|
+
`;
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
Accordion.styles = accordionStyles;
|
|
436
|
+
__decorateClass([
|
|
437
|
+
property3()
|
|
438
|
+
], Accordion.prototype, "label", 2);
|
|
439
|
+
__decorateClass([
|
|
440
|
+
property3({ attribute: "icon-start" })
|
|
441
|
+
], Accordion.prototype, "iconStart", 2);
|
|
442
|
+
__decorateClass([
|
|
443
|
+
property3({ reflect: true })
|
|
444
|
+
], Accordion.prototype, "appearance", 2);
|
|
445
|
+
__decorateClass([
|
|
446
|
+
property3({ type: Boolean, reflect: true })
|
|
447
|
+
], Accordion.prototype, "open", 2);
|
|
448
|
+
__decorateClass([
|
|
449
|
+
property3({ type: Boolean, reflect: true })
|
|
450
|
+
], Accordion.prototype, "disabled", 2);
|
|
451
|
+
__decorateClass([
|
|
452
|
+
property3({ type: Boolean, reflect: true })
|
|
453
|
+
], Accordion.prototype, "uppercase", 2);
|
|
454
|
+
__decorateClass([
|
|
455
|
+
query("details")
|
|
456
|
+
], Accordion.prototype, "_details", 2);
|
|
457
|
+
__decorateClass([
|
|
458
|
+
query(".content")
|
|
459
|
+
], Accordion.prototype, "_content", 2);
|
|
460
|
+
__decorateClass([
|
|
461
|
+
query(".content-inner")
|
|
462
|
+
], Accordion.prototype, "_contentInner", 2);
|
|
463
|
+
Accordion = __decorateClass([
|
|
464
|
+
customElement2("lt-accordion")
|
|
465
|
+
], Accordion);
|
|
466
|
+
export {
|
|
467
|
+
Accordion
|
|
468
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ThemeableElement } from '../../base';
|
|
2
|
+
import type { AlertVariant, AlertAppearance } from './alert.types';
|
|
3
|
+
import '../icon-button/icon-button';
|
|
4
|
+
import '../text/text';
|
|
5
|
+
/**
|
|
6
|
+
* Inline notification for persistent contextual feedback.
|
|
7
|
+
*
|
|
8
|
+
* @element lt-alert
|
|
9
|
+
*
|
|
10
|
+
* @slot - Alert body. Accepts any HTML — bold, links, lists, etc.
|
|
11
|
+
*
|
|
12
|
+
* @fires close - Fired when the dismiss button is clicked, just before the element is removed.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <lt-alert variant="success" title="Upload complete">
|
|
17
|
+
* Your file has been processed and is ready to download.
|
|
18
|
+
* </lt-alert>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```html
|
|
23
|
+
* <lt-alert variant="error" closable>
|
|
24
|
+
* Failed to save — <a href="#">retry</a>
|
|
25
|
+
* </lt-alert>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class Alert extends ThemeableElement {
|
|
29
|
+
static styles: import("lit").CSSResult;
|
|
30
|
+
/** Visual style. */
|
|
31
|
+
variant: AlertVariant;
|
|
32
|
+
/** Visual treatment. `filled` uses a tinted background with border, `outlined` uses a white background with border, `solid` uses a solid color background with no border. */
|
|
33
|
+
appearance: AlertAppearance;
|
|
34
|
+
/** Optional bold heading above the body content. */
|
|
35
|
+
title: string;
|
|
36
|
+
/**
|
|
37
|
+
* Icon to show before the body. Leave empty for auto (shows variant icon for status variants),
|
|
38
|
+
* set to `"none"` to suppress, or pass any icon name to override.
|
|
39
|
+
*/
|
|
40
|
+
icon: string;
|
|
41
|
+
/** Show a dismiss button. Clicking it fires lt-close and removes the element. */
|
|
42
|
+
closable: boolean;
|
|
43
|
+
/** Background color override. Accepts a hex value (#1a1a2e) or a CSS token name (--lt-color-primary-600). */
|
|
44
|
+
background: string;
|
|
45
|
+
/** Renders the title in small caps with wider letter spacing. */
|
|
46
|
+
uppercase: boolean;
|
|
47
|
+
private static readonly _iconMap;
|
|
48
|
+
private _handleClose;
|
|
49
|
+
private get _resolvedIcon();
|
|
50
|
+
render(): import("lit").TemplateResult<1>;
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const alertStyles: import("lit").CSSResult;
|