@xmesh/system-design 0.0.3 → 0.0.5
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/README.md +2 -1
- package/custom-elements.json +18382 -0
- package/dist/lit/components/alert/index.d.ts +6 -1
- package/dist/lit/components/alert/index.js +9 -2
- package/dist/lit/components/alert/index.styles.js +215 -0
- package/dist/lit/components/app-bar/index.d.ts +2 -1
- package/dist/lit/components/app-bar/index.js +5 -2
- package/dist/lit/components/app-bar/index.styles.js +94 -0
- package/dist/lit/components/artifact/index.d.ts +6 -1
- package/dist/lit/components/artifact/index.js +20 -2
- package/dist/lit/components/artifact/index.styles.js +180 -0
- package/dist/lit/components/autocomplete/index.d.ts +5 -0
- package/dist/lit/components/autocomplete/index.js +11 -2
- package/dist/lit/components/autocomplete/index.styles.js +185 -0
- package/dist/lit/components/avatar/index.d.ts +2 -1
- package/dist/lit/components/avatar/index.js +5 -2
- package/dist/lit/components/avatar/index.styles.js +76 -0
- package/dist/lit/components/avatar-group/index.d.ts +2 -1
- package/dist/lit/components/avatar-group/index.js +5 -2
- package/dist/lit/components/avatar-group/index.styles.js +74 -0
- package/dist/lit/components/badge/index.d.ts +2 -2
- package/dist/lit/components/badge/index.js +5 -2
- package/dist/lit/components/badge/index.styles.js +86 -0
- package/dist/lit/components/brand-mark/index.d.ts +2 -2
- package/dist/lit/components/brand-mark/index.js +13 -0
- package/dist/lit/components/brand-mark/index.styles.js +123 -0
- package/dist/lit/components/breadcrumbs/index.d.ts +2 -1
- package/dist/lit/components/breadcrumbs/index.js +6 -4
- package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
- package/dist/lit/components/bubble/index.d.ts +8 -4
- package/dist/lit/components/bubble/index.js +21 -0
- package/dist/lit/components/bubble/index.styles.js +196 -0
- package/dist/lit/components/button/index.d.ts +2 -1
- package/dist/lit/components/button/index.js +7 -13
- package/dist/lit/components/button/index.styles.js +356 -0
- package/dist/lit/components/card/index.d.ts +2 -1
- package/dist/lit/components/card/index.js +5 -2
- package/dist/lit/components/card/index.styles.js +113 -0
- package/dist/lit/components/chat/index.d.ts +7 -2
- package/dist/lit/components/chat/index.js +21 -2
- package/dist/lit/components/chat/index.styles.js +306 -0
- package/dist/lit/components/checkbox/index.d.ts +2 -2
- package/dist/lit/components/checkbox/index.js +8 -4
- package/dist/lit/components/checkbox/index.styles.js +140 -0
- package/dist/lit/components/chip/index.d.ts +6 -1
- package/dist/lit/components/chip/index.js +9 -2
- package/dist/lit/components/chip/index.styles.js +159 -0
- package/dist/lit/components/chip-group/index.d.ts +5 -1
- package/dist/lit/components/chip-group/index.js +8 -2
- package/dist/lit/components/chip-group/index.styles.js +33 -0
- package/dist/lit/components/code/index.d.ts +2 -2
- package/dist/lit/components/code/index.js +5 -3
- package/dist/lit/components/code/index.styles.js +56 -0
- package/dist/lit/components/composer/index.d.ts +7 -2
- package/dist/lit/components/composer/index.js +19 -0
- package/dist/lit/components/composer/index.styles.js +562 -0
- package/dist/lit/components/data-table/index.css +18 -0
- package/dist/lit/components/data-table/index.d.ts +30 -0
- package/dist/lit/components/data-table/index.js +120 -34
- package/dist/lit/components/data-table/index.styles.js +198 -0
- package/dist/lit/components/date-range/index.d.ts +4 -0
- package/dist/lit/components/date-range/index.js +7 -2
- package/dist/lit/components/date-range/index.styles.js +338 -0
- package/dist/lit/components/dialog/index.d.ts +4 -0
- package/dist/lit/components/dialog/index.js +7 -2
- package/dist/lit/components/dialog/index.styles.js +138 -0
- package/dist/lit/components/divider/index.d.ts +2 -1
- package/dist/lit/components/divider/index.js +5 -2
- package/dist/lit/components/divider/index.styles.js +41 -0
- package/dist/lit/components/empty-state/index.d.ts +1 -0
- package/dist/lit/components/empty-state/index.js +4 -2
- package/dist/lit/components/empty-state/index.styles.js +83 -0
- package/dist/lit/components/expansion-panel/index.d.ts +6 -2
- package/dist/lit/components/expansion-panel/index.js +9 -2
- package/dist/lit/components/expansion-panel/index.styles.js +134 -0
- package/dist/lit/components/field/index.d.ts +4 -0
- package/dist/lit/components/field/index.js +9 -4
- package/dist/lit/components/field/index.styles.js +237 -0
- package/dist/lit/components/file-input/index.d.ts +4 -0
- package/dist/lit/components/file-input/index.js +10 -4
- package/dist/lit/components/file-input/index.styles.js +271 -0
- package/dist/lit/components/form/index.d.ts +4 -0
- package/dist/lit/components/form/index.js +7 -2
- package/dist/lit/components/form/index.styles.js +43 -0
- package/dist/lit/components/grid/index.d.ts +2 -1
- package/dist/lit/components/grid/index.js +5 -2
- package/dist/lit/components/grid/index.styles.js +67 -0
- package/dist/lit/components/kbd/index.d.ts +2 -2
- package/dist/lit/components/kbd/index.js +5 -2
- package/dist/lit/components/kbd/index.styles.js +49 -0
- package/dist/lit/components/list/index.d.ts +5 -1
- package/dist/lit/components/list/index.js +8 -2
- package/dist/lit/components/list/index.styles.js +29 -0
- package/dist/lit/components/list-item/index.d.ts +2 -2
- package/dist/lit/components/list-item/index.js +5 -2
- package/dist/lit/components/list-item/index.styles.js +133 -0
- package/dist/lit/components/menu/index.d.ts +8 -0
- package/dist/lit/components/menu/index.js +11 -3
- package/dist/lit/components/menu/index.styles.js +108 -0
- package/dist/lit/components/multi-select/index.css +156 -0
- package/dist/lit/components/multi-select/index.d.ts +70 -0
- package/dist/lit/components/multi-select/index.js +497 -0
- package/dist/lit/components/multi-select/index.styles.js +170 -0
- package/dist/lit/components/navigation-drawer/index.d.ts +5 -2
- package/dist/lit/components/navigation-drawer/index.js +8 -2
- package/dist/lit/components/navigation-drawer/index.styles.js +128 -0
- package/dist/lit/components/overlay/index.d.ts +5 -0
- package/dist/lit/components/overlay/index.js +8 -2
- package/dist/lit/components/overlay/index.styles.js +185 -0
- package/dist/lit/components/pagination/index.d.ts +18 -1
- package/dist/lit/components/pagination/index.js +54 -8
- package/dist/lit/components/pagination/index.styles.js +116 -0
- package/dist/lit/components/popover/index.d.ts +5 -0
- package/dist/lit/components/popover/index.js +8 -2
- package/dist/lit/components/popover/index.styles.js +48 -0
- package/dist/lit/components/primitives/index.d.ts +2 -2
- package/dist/lit/components/primitives/index.js +13 -0
- package/dist/lit/components/primitives/index.styles.js +518 -0
- package/dist/lit/components/progress/index.d.ts +1 -0
- package/dist/lit/components/progress/index.js +4 -2
- package/dist/lit/components/progress/index.styles.js +157 -0
- package/dist/lit/components/radio-group/index.d.ts +5 -0
- package/dist/lit/components/radio-group/index.js +10 -6
- package/dist/lit/components/radio-group/index.styles.js +192 -0
- package/dist/lit/components/select/index.d.ts +4 -0
- package/dist/lit/components/select/index.js +10 -2
- package/dist/lit/components/select/index.styles.js +165 -0
- package/dist/lit/components/sidebar-item/index.d.ts +1 -1
- package/dist/lit/components/sidebar-item/index.js +12 -0
- package/dist/lit/components/sidebar-item/index.styles.js +147 -0
- package/dist/lit/components/skeleton/index.d.ts +1 -0
- package/dist/lit/components/skeleton/index.js +4 -2
- package/dist/lit/components/skeleton/index.styles.js +95 -0
- package/dist/lit/components/slider/index.d.ts +5 -0
- package/dist/lit/components/slider/index.js +11 -4
- package/dist/lit/components/slider/index.styles.js +185 -0
- package/dist/lit/components/snackbar/index.d.ts +5 -2
- package/dist/lit/components/snackbar/index.js +20 -2
- package/dist/lit/components/snackbar/index.styles.js +293 -0
- package/dist/lit/components/stack/index.d.ts +2 -1
- package/dist/lit/components/stack/index.js +5 -2
- package/dist/lit/components/stack/index.styles.js +55 -0
- package/dist/lit/components/switch/index.d.ts +1 -0
- package/dist/lit/components/switch/index.js +7 -4
- package/dist/lit/components/switch/index.styles.js +140 -0
- package/dist/lit/components/table/index.d.ts +2 -2
- package/dist/lit/components/table/index.js +5 -2
- package/dist/lit/components/table/index.styles.js +99 -0
- package/dist/lit/components/tabs/index.d.ts +7 -3
- package/dist/lit/components/tabs/index.js +11 -4
- package/dist/lit/components/tabs/index.styles.js +130 -0
- package/dist/lit/components/text-field/index.d.ts +1 -0
- package/dist/lit/components/text-field/index.js +7 -2
- package/dist/lit/components/text-field/index.styles.js +104 -0
- package/dist/lit/components/textarea/index.d.ts +1 -0
- package/dist/lit/components/textarea/index.js +7 -2
- package/dist/lit/components/textarea/index.styles.js +69 -0
- package/dist/lit/components/tooltip/index.d.ts +1 -0
- package/dist/lit/components/tooltip/index.js +4 -2
- package/dist/lit/components/tooltip/index.styles.js +51 -0
- package/dist/lit/components/validation/index.d.ts +7 -2
- package/dist/lit/components/validation/index.js +21 -1
- package/dist/lit/components/validation/index.styles.js +400 -0
- package/dist/lit/index.d.ts +1 -0
- package/dist/lit/index.js +1 -0
- package/dist/react/XmAlert.d.ts +99 -0
- package/dist/react/XmAlert.js +45 -0
- package/dist/react/XmAppBar.d.ts +59 -0
- package/dist/react/XmAppBar.js +34 -0
- package/dist/react/XmArtifact.d.ts +113 -0
- package/dist/react/XmArtifact.js +45 -0
- package/dist/react/XmArtifactChip.d.ts +56 -0
- package/dist/react/XmArtifactChip.js +32 -0
- package/dist/react/XmAutocomplete.d.ts +153 -0
- package/dist/react/XmAutocomplete.js +68 -0
- package/dist/react/XmAvatar.d.ts +71 -0
- package/dist/react/XmAvatar.js +40 -0
- package/dist/react/XmAvatarGroup.d.ts +59 -0
- package/dist/react/XmAvatarGroup.js +34 -0
- package/dist/react/XmBadge.d.ts +67 -0
- package/dist/react/XmBadge.js +38 -0
- package/dist/react/XmBrandGlyph.d.ts +46 -0
- package/dist/react/XmBrandGlyph.js +24 -0
- package/dist/react/XmBrandMark.d.ts +71 -0
- package/dist/react/XmBrandMark.js +40 -0
- package/dist/react/XmBreadcrumbs.d.ts +56 -0
- package/dist/react/XmBreadcrumbs.js +32 -0
- package/dist/react/XmBubble.d.ts +69 -0
- package/dist/react/XmBubble.js +38 -0
- package/dist/react/XmBubbleActions.d.ts +59 -0
- package/dist/react/XmBubbleActions.js +34 -0
- package/dist/react/XmBubbleGroup.d.ts +82 -0
- package/dist/react/XmBubbleGroup.js +36 -0
- package/dist/react/XmButton.d.ts +89 -0
- package/dist/react/XmButton.js +48 -0
- package/dist/react/XmCard.d.ts +59 -0
- package/dist/react/XmCard.js +34 -0
- package/dist/react/XmChatShell.d.ts +110 -0
- package/dist/react/XmChatShell.js +44 -0
- package/dist/react/XmCheckbox.d.ts +145 -0
- package/dist/react/XmCheckbox.js +58 -0
- package/dist/react/XmChip.d.ts +99 -0
- package/dist/react/XmChip.js +46 -0
- package/dist/react/XmChipGroup.d.ts +79 -0
- package/dist/react/XmChipGroup.js +35 -0
- package/dist/react/XmCode.d.ts +55 -0
- package/dist/react/XmCode.js +32 -0
- package/dist/react/XmComposer.d.ts +123 -0
- package/dist/react/XmComposer.js +52 -0
- package/dist/react/XmDataTable.d.ts +125 -0
- package/dist/react/XmDataTable.js +65 -0
- package/dist/react/XmDateRange.d.ts +93 -0
- package/dist/react/XmDateRange.js +41 -0
- package/dist/react/XmDialog.d.ts +87 -0
- package/dist/react/XmDialog.js +40 -0
- package/dist/react/XmDivider.d.ts +55 -0
- package/dist/react/XmDivider.js +32 -0
- package/dist/react/XmEmptyState.d.ts +61 -0
- package/dist/react/XmEmptyState.js +34 -0
- package/dist/react/XmExpansionPanel.d.ts +101 -0
- package/dist/react/XmExpansionPanel.js +48 -0
- package/dist/react/XmFileInput.d.ts +151 -0
- package/dist/react/XmFileInput.js +68 -0
- package/dist/react/XmFileValidationBlock.d.ts +111 -0
- package/dist/react/XmFileValidationBlock.js +45 -0
- package/dist/react/XmForm.d.ts +91 -0
- package/dist/react/XmForm.js +37 -0
- package/dist/react/XmGrid.d.ts +59 -0
- package/dist/react/XmGrid.js +34 -0
- package/dist/react/XmKbd.d.ts +46 -0
- package/dist/react/XmKbd.js +24 -0
- package/dist/react/XmList.d.ts +83 -0
- package/dist/react/XmList.js +37 -0
- package/dist/react/XmListItem.d.ts +67 -0
- package/dist/react/XmListItem.js +38 -0
- package/dist/react/XmMenu.d.ts +98 -0
- package/dist/react/XmMenu.js +42 -0
- package/dist/react/XmMenuItem.d.ts +63 -0
- package/dist/react/XmMenuItem.js +36 -0
- package/dist/react/XmMultiSelect.d.ts +161 -0
- package/dist/react/XmMultiSelect.js +72 -0
- package/dist/react/XmNavigationDrawer.d.ts +93 -0
- package/dist/react/XmNavigationDrawer.js +41 -0
- package/dist/react/XmOverlay.d.ts +120 -0
- package/dist/react/XmOverlay.js +54 -0
- package/dist/react/XmPagination.d.ts +117 -0
- package/dist/react/XmPagination.js +57 -0
- package/dist/react/XmPopover.d.ts +90 -0
- package/dist/react/XmPopover.js +40 -0
- package/dist/react/XmProgress.d.ts +75 -0
- package/dist/react/XmProgress.js +42 -0
- package/dist/react/XmRadio.d.ts +88 -0
- package/dist/react/XmRadio.js +41 -0
- package/dist/react/XmRadioGroup.d.ts +139 -0
- package/dist/react/XmRadioGroup.js +56 -0
- package/dist/react/XmSelect.d.ts +152 -0
- package/dist/react/XmSelect.js +68 -0
- package/dist/react/XmSidebarItem.d.ts +75 -0
- package/dist/react/XmSidebarItem.js +42 -0
- package/dist/react/XmSkeleton.d.ts +71 -0
- package/dist/react/XmSkeleton.js +40 -0
- package/dist/react/XmSlider.d.ts +160 -0
- package/dist/react/XmSlider.js +74 -0
- package/dist/react/XmSnackbar.d.ts +110 -0
- package/dist/react/XmSnackbar.js +49 -0
- package/dist/react/XmStack.d.ts +71 -0
- package/dist/react/XmStack.js +40 -0
- package/dist/react/XmSwitch.d.ts +136 -0
- package/dist/react/XmSwitch.js +56 -0
- package/dist/react/XmTab.d.ts +79 -0
- package/dist/react/XmTab.js +37 -0
- package/dist/react/XmTabPanel.d.ts +55 -0
- package/dist/react/XmTabPanel.js +32 -0
- package/dist/react/XmTable.d.ts +57 -0
- package/dist/react/XmTable.js +32 -0
- package/dist/react/XmTabs.d.ts +82 -0
- package/dist/react/XmTabs.js +37 -0
- package/dist/react/XmTextField.d.ts +147 -0
- package/dist/react/XmTextField.js +60 -0
- package/dist/react/XmTextarea.d.ts +155 -0
- package/dist/react/XmTextarea.js +64 -0
- package/dist/react/XmTooltip.d.ts +67 -0
- package/dist/react/XmTooltip.js +38 -0
- package/dist/react/index.d.ts +59 -0
- package/dist/react/index.js +59 -0
- package/dist/react/react-utils.js +67 -0
- package/package.json +37 -9
- package/styles/_base-typography.css +86 -0
- package/styles/_primitives.css +54 -0
- package/styles/_reset.css +58 -0
- package/styles/base.css +23 -0
- package/vscode.css-custom-data.json +6 -0
- package/vscode.html-custom-data.json +979 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/table/index.css
|
|
2
|
+
// SSR-safe: constructable stylesheets need the DOM, so in a non-DOM context
|
|
3
|
+
// (Node/SSR import) this exports [] instead of throwing. The CSS self-declares
|
|
4
|
+
// the @layer order so the override contract holds even without ./base (AD-2).
|
|
5
|
+
let sheets = [];
|
|
6
|
+
if (typeof CSSStyleSheet !== "undefined") {
|
|
7
|
+
const sheet = new CSSStyleSheet();
|
|
8
|
+
sheet.replaceSync(`@layer reset, base, tokens, components, utilities;
|
|
9
|
+
@layer components {
|
|
10
|
+
/* ============================================
|
|
11
|
+
Table — static, semantic, hairline-ruled grid.
|
|
12
|
+
|
|
13
|
+
<xm-table> renders a real <table> in its shadow root. Borders are
|
|
14
|
+
1px --md-sys-color-outline-variant hairlines (no 2px, no heavy
|
|
15
|
+
elevation). The table sits on one surface family — surface* with
|
|
16
|
+
ink --md-sys-color-on-surface (AD-13). Header rows are
|
|
17
|
+
differentiated by the hairline rule + an optional surface-container
|
|
18
|
+
raise, never a status hue (AD-11).
|
|
19
|
+
|
|
20
|
+
Numeric cells right-align (text-align: end) with tabular figures so
|
|
21
|
+
columns of numbers line up; the number + unit carry a space (412 KB)
|
|
22
|
+
in the content (NFR-22 / UX-DR4).
|
|
23
|
+
|
|
24
|
+
Static only — sorting / paging live in xm-data-table (Epic 6).
|
|
25
|
+
============================================ */
|
|
26
|
+
|
|
27
|
+
.table {
|
|
28
|
+
width: 100%;
|
|
29
|
+
border-collapse: collapse;
|
|
30
|
+
background: transparent;
|
|
31
|
+
color: var(--md-sys-color-on-surface);
|
|
32
|
+
font-family: var(--md-sys-typescale-body-medium-font);
|
|
33
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
34
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
35
|
+
/* A hairline frame around the whole grid. */
|
|
36
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.table__caption {
|
|
40
|
+
caption-side: top;
|
|
41
|
+
text-align: start;
|
|
42
|
+
padding: 0 0 var(--s-2);
|
|
43
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
44
|
+
font-family: var(--md-sys-typescale-label-large-font);
|
|
45
|
+
font-size: var(--md-sys-typescale-label-large-size);
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.table__head {
|
|
50
|
+
background: var(--md-sys-color-surface-container-low);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.table__header-cell {
|
|
54
|
+
text-align: start;
|
|
55
|
+
padding: var(--s-3) var(--s-4);
|
|
56
|
+
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
57
|
+
color: var(--md-sys-color-on-surface);
|
|
58
|
+
font-family: var(--md-sys-typescale-label-large-font);
|
|
59
|
+
font-size: var(--md-sys-typescale-label-medium-size);
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
letter-spacing: 0;
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.table__row + .table__row .table__cell {
|
|
66
|
+
border-top: 1px solid var(--md-sys-color-outline-variant);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.table__cell {
|
|
70
|
+
padding: var(--s-3) var(--s-4);
|
|
71
|
+
text-align: start;
|
|
72
|
+
vertical-align: middle;
|
|
73
|
+
color: var(--md-sys-color-on-surface);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Secondary ink for muted cells (e.g. timestamps). */
|
|
77
|
+
.table__cell--muted {
|
|
78
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Numeric — right-aligned, tabular figures so digits line up. */
|
|
82
|
+
.table__header-cell--numeric,
|
|
83
|
+
.table__cell--numeric {
|
|
84
|
+
text-align: end;
|
|
85
|
+
font-variant-numeric: tabular-nums;
|
|
86
|
+
font-feature-settings: "tnum" 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Zebra is intentionally omitted — the hairline rule does the region
|
|
90
|
+
work (UX-DR10). A subtle row-hover keeps long tables scannable
|
|
91
|
+
without a status hue. */
|
|
92
|
+
.table__row:hover .table__cell {
|
|
93
|
+
background: color-mix(in oklab, var(--md-sys-color-on-surface) var(--md-sys-state-hover-state-layer-opacity), transparent);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}`);
|
|
97
|
+
sheets = [sheet];
|
|
98
|
+
}
|
|
99
|
+
export default sheets;
|
|
@@ -4,20 +4,24 @@ type TabsSize = "xs" | "sm" | "md" | "lg";
|
|
|
4
4
|
export interface TabsChangeDetail {
|
|
5
5
|
value: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @fires change - Fired on commit with the new value in `detail`.
|
|
9
|
+
*/
|
|
10
|
+
export declare class XmTab extends LitElement {
|
|
8
11
|
value: string;
|
|
9
12
|
disabled: boolean;
|
|
10
13
|
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
11
14
|
connectedCallback(): void;
|
|
12
15
|
render(): TemplateResult;
|
|
13
16
|
}
|
|
14
|
-
declare class XmTabPanel extends LitElement {
|
|
17
|
+
export declare class XmTabPanel extends LitElement {
|
|
15
18
|
value: string;
|
|
16
19
|
createRenderRoot(): HTMLElement | DocumentFragment;
|
|
17
20
|
connectedCallback(): void;
|
|
18
21
|
render(): TemplateResult;
|
|
19
22
|
}
|
|
20
|
-
declare class XmTabs extends LitElement {
|
|
23
|
+
export declare class XmTabs extends LitElement {
|
|
24
|
+
static styles: CSSStyleSheet[];
|
|
21
25
|
value: string;
|
|
22
26
|
size: TabsSize;
|
|
23
27
|
private _list;
|
|
@@ -47,13 +47,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
47
47
|
};
|
|
48
48
|
import { LitElement, html } from "lit";
|
|
49
49
|
import { customElement, property, query } from "lit/decorators.js";
|
|
50
|
-
|
|
51
|
-
// lit/build/components/tabs/index.js → ../tabs/index.css.
|
|
52
|
-
const TABS_CSS = new URL("../tabs/index.css", import.meta.url).href;
|
|
50
|
+
import tabsSheets from "./index.styles.js";
|
|
53
51
|
let tabsSeq = 0;
|
|
54
52
|
/* ─────────────────────────────────────────────────────────────
|
|
55
53
|
<xm-tab> — one tab. Light DOM: the host is the role="tab" target.
|
|
56
54
|
─────────────────────────────────────────────────────────────*/
|
|
55
|
+
/**
|
|
56
|
+
* @fires change - Fired on commit with the new value in `detail`.
|
|
57
|
+
*/
|
|
57
58
|
let XmTab = class XmTab extends LitElement {
|
|
58
59
|
constructor() {
|
|
59
60
|
super(...arguments);
|
|
@@ -85,6 +86,7 @@ __decorate([
|
|
|
85
86
|
XmTab = __decorate([
|
|
86
87
|
customElement("xm-tab")
|
|
87
88
|
], XmTab);
|
|
89
|
+
export { XmTab };
|
|
88
90
|
/* ─────────────────────────────────────────────────────────────
|
|
89
91
|
<xm-tab-panel> — one panel. Light DOM: the host is role="tabpanel".
|
|
90
92
|
─────────────────────────────────────────────────────────────*/
|
|
@@ -111,6 +113,7 @@ __decorate([
|
|
|
111
113
|
XmTabPanel = __decorate([
|
|
112
114
|
customElement("xm-tab-panel")
|
|
113
115
|
], XmTabPanel);
|
|
116
|
+
export { XmTabPanel };
|
|
114
117
|
/* ─────────────────────────────────────────────────────────────
|
|
115
118
|
<xm-tabs> — the tablist container.
|
|
116
119
|
─────────────────────────────────────────────────────────────*/
|
|
@@ -207,12 +210,15 @@ let XmTabs = class XmTabs extends LitElement {
|
|
|
207
210
|
this._activate(next.value);
|
|
208
211
|
};
|
|
209
212
|
}
|
|
213
|
+
// Adopted from the build-generated sheet (gen-styles.mjs) — no runtime URL
|
|
214
|
+
// fetch (ADR 0012). Includes the ::slotted(xm-tab) rules that style the
|
|
215
|
+
// light-DOM <xm-tab> / <xm-tab-panel> children.
|
|
216
|
+
static { this.styles = [...tabsSheets]; }
|
|
210
217
|
render() {
|
|
211
218
|
const size = ["xs", "sm", "md", "lg"].includes(this.size)
|
|
212
219
|
? this.size
|
|
213
220
|
: "md";
|
|
214
221
|
return html `
|
|
215
|
-
<link rel="stylesheet" href="${TABS_CSS}" />
|
|
216
222
|
<style>
|
|
217
223
|
:host {
|
|
218
224
|
display: block;
|
|
@@ -318,3 +324,4 @@ __decorate([
|
|
|
318
324
|
XmTabs = __decorate([
|
|
319
325
|
customElement("xm-tabs")
|
|
320
326
|
], XmTabs);
|
|
327
|
+
export { XmTabs };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/tabs/index.css
|
|
2
|
+
// SSR-safe: constructable stylesheets need the DOM, so in a non-DOM context
|
|
3
|
+
// (Node/SSR import) this exports [] instead of throwing. The CSS self-declares
|
|
4
|
+
// the @layer order so the override contract holds even without ./base (AD-2).
|
|
5
|
+
let sheets = [];
|
|
6
|
+
if (typeof CSSStyleSheet !== "undefined") {
|
|
7
|
+
const sheet = new CSSStyleSheet();
|
|
8
|
+
sheet.replaceSync(`@layer reset, base, tokens, components, utilities;
|
|
9
|
+
@layer components {
|
|
10
|
+
/* ============================================
|
|
11
|
+
<xm-tabs> / <xm-tab> / <xm-tab-panel> — tab strip.
|
|
12
|
+
|
|
13
|
+
Surface / ink (AD-13): a transparent strip tracing its host surface. On the
|
|
14
|
+
desk family the inactive tab ink is var(--md-sys-color-on-surface-variant)
|
|
15
|
+
and the active tab is var(--md-sys-color-on-surface). The active indicator
|
|
16
|
+
is the single coral accent var(--md-sys-color-primary). Hairline 1px
|
|
17
|
+
baseline rule. Indicator slide is short3 standard easing — no bounce.
|
|
18
|
+
|
|
19
|
+
xm-tab / xm-tab-panel are LIGHT-DOM hosts projected through this element's
|
|
20
|
+
slots, so they are styled with ::slotted(...). The active/disabled state
|
|
21
|
+
classes are added to the xm-tab HOST by xm-tabs.
|
|
22
|
+
|
|
23
|
+
BEM root block \`tabs\`; elements \`__list\` \`__tab\` \`__label\` \`__indicator\`
|
|
24
|
+
\`__panels\` \`__panel\`; modifiers \`__tab--active\` \`__tab--disabled\`,
|
|
25
|
+
size \`--xs|sm|md|lg\`.
|
|
26
|
+
============================================ */
|
|
27
|
+
|
|
28
|
+
.tabs {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ---------- Tablist (the strip) ---------- */
|
|
33
|
+
.tabs__list {
|
|
34
|
+
position: relative;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: stretch;
|
|
37
|
+
gap: var(--s-1);
|
|
38
|
+
border-bottom: 1px solid var(--md-sys-color-outline-variant);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* ---------- Tabs (slotted xm-tab hosts) ---------- */
|
|
42
|
+
::slotted(xm-tab) {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
gap: var(--s-2);
|
|
47
|
+
padding: var(--s-2) var(--s-3);
|
|
48
|
+
margin-bottom: -1px;
|
|
49
|
+
border: 0;
|
|
50
|
+
background: transparent;
|
|
51
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
52
|
+
font-family: var(--md-sys-typescale-label-large-font);
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
user-select: none;
|
|
57
|
+
border-radius: var(--md-sys-shape-corner-small) var(--md-sys-shape-corner-small) 0 0;
|
|
58
|
+
transition:
|
|
59
|
+
color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
60
|
+
background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
61
|
+
}
|
|
62
|
+
::slotted(xm-tab:hover) {
|
|
63
|
+
color: var(--md-sys-color-on-surface);
|
|
64
|
+
background: color-mix(
|
|
65
|
+
in oklab,
|
|
66
|
+
var(--md-sys-color-on-surface) var(--md-sys-state-hover-state-layer-opacity),
|
|
67
|
+
transparent
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
::slotted(xm-tab:focus) {
|
|
71
|
+
outline: none;
|
|
72
|
+
}
|
|
73
|
+
::slotted(xm-tab:focus-visible) {
|
|
74
|
+
outline: none;
|
|
75
|
+
box-shadow: var(--xm-state-focus-ring);
|
|
76
|
+
}
|
|
77
|
+
::slotted(.tabs__tab--active) {
|
|
78
|
+
color: var(--md-sys-color-on-surface);
|
|
79
|
+
}
|
|
80
|
+
::slotted(.tabs__tab--disabled) {
|
|
81
|
+
cursor: not-allowed;
|
|
82
|
+
color: var(--xm-color-on-surface-disabled);
|
|
83
|
+
}
|
|
84
|
+
::slotted(.tabs__tab--disabled:hover) {
|
|
85
|
+
background: transparent;
|
|
86
|
+
color: var(--xm-color-on-surface-disabled);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* ---------- Sizes — one shared tab height per size ---------- */
|
|
90
|
+
.tabs--xs ::slotted(xm-tab) { padding: var(--s-1) var(--s-2); font-size: var(--md-sys-typescale-label-small-size); }
|
|
91
|
+
.tabs--sm ::slotted(xm-tab) { padding: var(--s-1) var(--s-3); font-size: var(--md-sys-typescale-body-small-size); }
|
|
92
|
+
.tabs--md ::slotted(xm-tab) { padding: var(--s-2) var(--s-3); font-size: var(--md-sys-typescale-body-medium-size); }
|
|
93
|
+
.tabs--lg ::slotted(xm-tab) { padding: var(--s-3) var(--s-4); font-size: var(--md-sys-typescale-title-small-size); }
|
|
94
|
+
|
|
95
|
+
/* ---------- Coral active indicator (sliding underline) ---------- */
|
|
96
|
+
.tabs__indicator {
|
|
97
|
+
position: absolute;
|
|
98
|
+
bottom: 0;
|
|
99
|
+
left: 0;
|
|
100
|
+
height: 2px;
|
|
101
|
+
width: 0;
|
|
102
|
+
background: var(--md-sys-color-primary);
|
|
103
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
104
|
+
opacity: 0;
|
|
105
|
+
transform: translateX(0);
|
|
106
|
+
transition:
|
|
107
|
+
transform var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
108
|
+
width var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ---------- Panels ---------- */
|
|
113
|
+
.tabs__panels {
|
|
114
|
+
padding-top: var(--s-4);
|
|
115
|
+
}
|
|
116
|
+
::slotted(xm-tab-panel) {
|
|
117
|
+
display: block;
|
|
118
|
+
color: var(--md-sys-color-on-surface);
|
|
119
|
+
font-family: var(--md-sys-typescale-body-medium-font);
|
|
120
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
121
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
122
|
+
}
|
|
123
|
+
::slotted(xm-tab-panel[hidden]) {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
}`);
|
|
128
|
+
sheets = [sheet];
|
|
129
|
+
}
|
|
130
|
+
export default sheets;
|
|
@@ -2,6 +2,7 @@ import type { TemplateResult } from "lit";
|
|
|
2
2
|
import { XmField } from "../field/index.js";
|
|
3
3
|
export type TextFieldType = "text" | "email" | "password" | "number" | "search" | "url" | "tel";
|
|
4
4
|
export declare class XmTextField extends XmField {
|
|
5
|
+
static styles: CSSStyleSheet[];
|
|
5
6
|
/** Native input type — single-line text variants only. */
|
|
6
7
|
type: TextFieldType;
|
|
7
8
|
/** Native placeholder — shown when the live value is empty. */
|
|
@@ -42,9 +42,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
42
42
|
import { html, nothing } from "lit";
|
|
43
43
|
import { customElement, property } from "lit/decorators.js";
|
|
44
44
|
import { XmField } from "../field/index.js";
|
|
45
|
+
import primitivesSheets from "../primitives/index.styles.js";
|
|
46
|
+
import fieldSheets from "../field/index.styles.js";
|
|
47
|
+
import textFieldSheets from "./index.styles.js";
|
|
45
48
|
// Resolve CSS relative to the *built* file:
|
|
46
49
|
// lit/build/components/text-field/index.js → ../text-field/index.css.
|
|
47
|
-
const TEXT_FIELD_CSS = new URL("../text-field/index.css", import.meta.url).href;
|
|
48
50
|
let XmTextField = class XmTextField extends XmField {
|
|
49
51
|
constructor() {
|
|
50
52
|
super(...arguments);
|
|
@@ -59,10 +61,13 @@ let XmTextField = class XmTextField extends XmField {
|
|
|
59
61
|
this.emitChange(e.target.value);
|
|
60
62
|
};
|
|
61
63
|
}
|
|
64
|
+
// Adopted from build-generated sheets (gen-styles.mjs) — no runtime URL
|
|
65
|
+
// fetch (ADR 0012). Lit static styles don't merge on override, so subclasses
|
|
66
|
+
// re-include the chrome (primitives + field) sheets.
|
|
67
|
+
static { this.styles = [...primitivesSheets, ...fieldSheets, ...textFieldSheets]; }
|
|
62
68
|
renderControl() {
|
|
63
69
|
const a = this.controlAria;
|
|
64
70
|
return html `
|
|
65
|
-
<link rel="stylesheet" href="${TEXT_FIELD_CSS}" />
|
|
66
71
|
<span class="text-field__lead">
|
|
67
72
|
<slot name="icon-left"></slot>
|
|
68
73
|
<slot name="prefix"></slot>
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/text-field/index.css
|
|
2
|
+
// SSR-safe: constructable stylesheets need the DOM, so in a non-DOM context
|
|
3
|
+
// (Node/SSR import) this exports [] instead of throwing. The CSS self-declares
|
|
4
|
+
// the @layer order so the override contract holds even without ./base (AD-2).
|
|
5
|
+
let sheets = [];
|
|
6
|
+
if (typeof CSSStyleSheet !== "undefined") {
|
|
7
|
+
const sheet = new CSSStyleSheet();
|
|
8
|
+
sheet.replaceSync(`@layer reset, base, tokens, components, utilities;
|
|
9
|
+
@layer components {
|
|
10
|
+
/* ============================================
|
|
11
|
+
xm-text-field — concrete control for XmField (Story 2.1).
|
|
12
|
+
|
|
13
|
+
The chrome (surface, border, radius, height, focus ring, label, helper/
|
|
14
|
+
error row, disabled/readonly) is owned by the XmField base — see
|
|
15
|
+
field/index.css. The native <input> rendered by this subclass is already
|
|
16
|
+
styled by the base's \`.field__control input\` rule (transparent, borderless,
|
|
17
|
+
full-bleed, inherits ink + type). So THIS file owns only the leading/trailing
|
|
18
|
+
affordance rails: the icon-left / icon-right slots and the prefix / suffix
|
|
19
|
+
inline units that flank the input inside the shared control wrapper.
|
|
20
|
+
|
|
21
|
+
Surface/ink: the field sits on the inverse-surface card tier, so all ink here
|
|
22
|
+
is inverse-on-surface (icons) or inverse-on-surface-muted (prefix/suffix
|
|
23
|
+
units) — matching the host surface (AD-13). No error color: severity is the base's
|
|
24
|
+
icon + copy in the message row (AD-11). Tokens only (AD-1).
|
|
25
|
+
|
|
26
|
+
BEM block: \`text-field\`. Registered in scripts/check-bem.sh STRICT_BLOCKS.
|
|
27
|
+
============================================ */
|
|
28
|
+
|
|
29
|
+
/* ---------- Leading / trailing rails ----------
|
|
30
|
+
Flex children of the base's .field__control row, sitting on either side of
|
|
31
|
+
the input. Each collapses to zero width when its slots are empty, so the
|
|
32
|
+
input keeps its native edge padding when no affordance is authored. The
|
|
33
|
+
icon↔text gap rides the --s-N spacing scale to match the shared chrome. */
|
|
34
|
+
.text-field__lead,
|
|
35
|
+
.text-field__trail {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: var(--s-2);
|
|
39
|
+
flex-shrink: 0;
|
|
40
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Empty rails contribute no inset — the inner pad-collapse below removes the
|
|
44
|
+
matching input padding so a field with no affordance looks untouched. */
|
|
45
|
+
.text-field__lead:not(:has(*)),
|
|
46
|
+
.text-field__trail:not(:has(*)) {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* When a leading rail is present it owns the leading inset; the input drops its
|
|
51
|
+
own left pad so the icon/prefix sits at the wrapper edge inset, and text
|
|
52
|
+
follows the rail's gap. Mirror on the trailing side. */
|
|
53
|
+
.text-field__lead {
|
|
54
|
+
padding-left: var(--s-3);
|
|
55
|
+
}
|
|
56
|
+
.text-field__trail {
|
|
57
|
+
padding-right: var(--s-3);
|
|
58
|
+
}
|
|
59
|
+
.text-field__lead:not(:has(*)) + .text-field__input {
|
|
60
|
+
padding-left: var(--s-3);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* ---------- Prefix / suffix inline units ----------
|
|
64
|
+
Static affordances like \`$\` or \`KB\` — quieter than the live value, so they
|
|
65
|
+
take the muted inverse ink. Slotted content inherits this via the rail color +
|
|
66
|
+
::slotted override. */
|
|
67
|
+
.text-field__lead ::slotted([slot="prefix"]),
|
|
68
|
+
.text-field__trail ::slotted([slot="suffix"]) {
|
|
69
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
70
|
+
font:
|
|
71
|
+
var(--md-sys-typescale-body-large-weight)
|
|
72
|
+
var(--md-sys-typescale-body-large-size) /
|
|
73
|
+
var(--md-sys-typescale-body-large-line-height)
|
|
74
|
+
var(--md-sys-typescale-body-large-font);
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Icons inherit currentColor from the rail (inverse-on-surface), matching the
|
|
79
|
+
host card surface — never an accent or error hue. */
|
|
80
|
+
.text-field__lead ::slotted([slot="icon-left"]),
|
|
81
|
+
.text-field__trail ::slotted([slot="icon-right"]) {
|
|
82
|
+
display: inline-flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
color: inherit;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* The input flexes to fill the gap between the rails. Its transparent /
|
|
88
|
+
borderless / type styling comes from the base; the rails set the inset, so
|
|
89
|
+
when a rail is present the input loses the matching native edge pad. */
|
|
90
|
+
.text-field__input {
|
|
91
|
+
flex: 1;
|
|
92
|
+
min-width: 0;
|
|
93
|
+
}
|
|
94
|
+
.text-field__lead:has(*) + .text-field__input {
|
|
95
|
+
padding-left: var(--s-2);
|
|
96
|
+
}
|
|
97
|
+
.text-field__input:has(+ .text-field__trail:has(*)) {
|
|
98
|
+
padding-right: var(--s-2);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}`);
|
|
102
|
+
sheets = [sheet];
|
|
103
|
+
}
|
|
104
|
+
export default sheets;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PropertyValues, TemplateResult } from "lit";
|
|
2
2
|
import { XmField } from "../field/index.js";
|
|
3
3
|
export declare class XmTextarea extends XmField {
|
|
4
|
+
static styles: CSSStyleSheet[];
|
|
4
5
|
/** Initial visible height in text rows. */
|
|
5
6
|
rows: number;
|
|
6
7
|
/** Native placeholder — shown when the live value is empty. */
|
|
@@ -38,7 +38,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
38
38
|
import { html, nothing } from "lit";
|
|
39
39
|
import { customElement, property, query } from "lit/decorators.js";
|
|
40
40
|
import { XmField } from "../field/index.js";
|
|
41
|
-
|
|
41
|
+
import primitivesSheets from "../primitives/index.styles.js";
|
|
42
|
+
import fieldSheets from "../field/index.styles.js";
|
|
43
|
+
import textareaSheets from "./index.styles.js";
|
|
42
44
|
let XmTextarea = class XmTextarea extends XmField {
|
|
43
45
|
constructor() {
|
|
44
46
|
super(...arguments);
|
|
@@ -59,6 +61,10 @@ let XmTextarea = class XmTextarea extends XmField {
|
|
|
59
61
|
this.emitChange(e.target.value);
|
|
60
62
|
};
|
|
61
63
|
}
|
|
64
|
+
// Adopted from build-generated sheets (gen-styles.mjs) — no runtime URL
|
|
65
|
+
// fetch (ADR 0012). Lit static styles don't merge on override, so subclasses
|
|
66
|
+
// re-include the chrome (primitives + field) sheets.
|
|
67
|
+
static { this.styles = [...primitivesSheets, ...fieldSheets, ...textareaSheets]; }
|
|
62
68
|
updated(changed) {
|
|
63
69
|
super.updated?.(changed);
|
|
64
70
|
if (this.autoGrow)
|
|
@@ -84,7 +90,6 @@ let XmTextarea = class XmTextarea extends XmField {
|
|
|
84
90
|
const a = this.controlAria;
|
|
85
91
|
const controlCls = `textarea__control${this.autoGrow ? " textarea__control--auto-grow" : ""}`;
|
|
86
92
|
return html `
|
|
87
|
-
<link rel="stylesheet" href="${TEXTAREA_CSS}" />
|
|
88
93
|
<textarea
|
|
89
94
|
class="${controlCls}"
|
|
90
95
|
id=${a.id}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/textarea/index.css
|
|
2
|
+
// SSR-safe: constructable stylesheets need the DOM, so in a non-DOM context
|
|
3
|
+
// (Node/SSR import) this exports [] instead of throwing. The CSS self-declares
|
|
4
|
+
// the @layer order so the override contract holds even without ./base (AD-2).
|
|
5
|
+
let sheets = [];
|
|
6
|
+
if (typeof CSSStyleSheet !== "undefined") {
|
|
7
|
+
const sheet = new CSSStyleSheet();
|
|
8
|
+
sheet.replaceSync(`@layer reset, base, tokens, components, utilities;
|
|
9
|
+
@layer components {
|
|
10
|
+
/* ============================================
|
|
11
|
+
xm-textarea — multi-line concrete control for XmField (Story 2.2).
|
|
12
|
+
|
|
13
|
+
The chrome (surface, border, radius, focus ring, label, helper/error row,
|
|
14
|
+
disabled/readonly) is owned by the XmField base — see field/index.css. The
|
|
15
|
+
only delta from xm-text-field is the multi-line <textarea>: it is taller
|
|
16
|
+
than one control row, so the control wrapper must stop vertically centering
|
|
17
|
+
its child and let the textarea own its own block size.
|
|
18
|
+
|
|
19
|
+
The native <textarea> rendered here is already styled transparent /
|
|
20
|
+
borderless / full-bleed / inherits-ink by the base's \`.field__control
|
|
21
|
+
textarea\` rule. So THIS file only:
|
|
22
|
+
• un-centers the control wrapper for a multi-row box,
|
|
23
|
+
• sets the textarea's own vertical padding + resize behavior,
|
|
24
|
+
• caps the auto-grow height.
|
|
25
|
+
|
|
26
|
+
Surface/ink: rides the inverse-surface card tier — ink is inverse-on-surface,
|
|
27
|
+
placeholder is on-surface-variant (matching the host surface, AD-13). No
|
|
28
|
+
error color — severity is the base's icon + copy (AD-11). Tokens only (AD-1).
|
|
29
|
+
|
|
30
|
+
BEM block: \`textarea\`. Registered in scripts/check-bem.sh STRICT_BLOCKS.
|
|
31
|
+
============================================ */
|
|
32
|
+
|
|
33
|
+
/* The control wrapper centers a single-line input; a textarea needs the box to
|
|
34
|
+
start at the top and stretch, so the field-level control wrapper is realigned
|
|
35
|
+
when it hosts this block. Scoped under the block so it never leaks to other
|
|
36
|
+
fields. */
|
|
37
|
+
.textarea {
|
|
38
|
+
display: block;
|
|
39
|
+
width: 100%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* The native <textarea> — already transparent/borderless/inheriting via the
|
|
43
|
+
base rule. Here we own the multi-line geometry: top-aligned text, vertical
|
|
44
|
+
pad on the --s-N scale, and the resize affordance. */
|
|
45
|
+
.textarea__control {
|
|
46
|
+
display: block;
|
|
47
|
+
width: 100%;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
/* Override the base \`.field__control textarea { height: 100% }\` rule — a
|
|
50
|
+
textarea owns its own block size from \`rows\` / scrollHeight, not the
|
|
51
|
+
single-line wrapper height. */
|
|
52
|
+
height: auto;
|
|
53
|
+
align-self: stretch;
|
|
54
|
+
padding: var(--s-2) var(--s-3);
|
|
55
|
+
resize: vertical;
|
|
56
|
+
line-height: var(--md-sys-typescale-body-large-line-height);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Auto-grow disables the manual resize handle — the box tracks its content up
|
|
60
|
+
to the capped max-height instead. */
|
|
61
|
+
.textarea__control--auto-grow {
|
|
62
|
+
resize: none;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}`);
|
|
67
|
+
sheets = [sheet];
|
|
68
|
+
}
|
|
69
|
+
export default sheets;
|
|
@@ -2,6 +2,7 @@ import { LitElement } from "lit";
|
|
|
2
2
|
import type { TemplateResult } from "lit";
|
|
3
3
|
import type { OverlayPlacement } from "../overlay/index.js";
|
|
4
4
|
export declare class XmTooltip extends LitElement {
|
|
5
|
+
static styles: CSSStyleSheet[];
|
|
5
6
|
text: string;
|
|
6
7
|
placement: OverlayPlacement;
|
|
7
8
|
openDelay: number;
|
|
@@ -46,7 +46,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
46
46
|
};
|
|
47
47
|
import { LitElement, html, nothing } from "lit";
|
|
48
48
|
import { customElement, property, query, state } from "lit/decorators.js";
|
|
49
|
-
|
|
49
|
+
import tooltipSheets from "./index.styles.js";
|
|
50
50
|
let tooltipSeq = 0;
|
|
51
51
|
let XmTooltip = class XmTooltip extends LitElement {
|
|
52
52
|
constructor() {
|
|
@@ -92,13 +92,15 @@ let XmTooltip = class XmTooltip extends LitElement {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
96
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
97
|
+
static { this.styles = [...tooltipSheets]; }
|
|
95
98
|
disconnectedCallback() {
|
|
96
99
|
super.disconnectedCallback();
|
|
97
100
|
window.clearTimeout(this._showTimer);
|
|
98
101
|
}
|
|
99
102
|
render() {
|
|
100
103
|
return html `
|
|
101
|
-
<link rel="stylesheet" href="${TOOLTIP_CSS}" />
|
|
102
104
|
<style>
|
|
103
105
|
:host { display: inline-flex; }
|
|
104
106
|
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/tooltip/index.css
|
|
2
|
+
// SSR-safe: constructable stylesheets need the DOM, so in a non-DOM context
|
|
3
|
+
// (Node/SSR import) this exports [] instead of throwing. The CSS self-declares
|
|
4
|
+
// the @layer order so the override contract holds even without ./base (AD-2).
|
|
5
|
+
let sheets = [];
|
|
6
|
+
if (typeof CSSStyleSheet !== "undefined") {
|
|
7
|
+
const sheet = new CSSStyleSheet();
|
|
8
|
+
sheet.replaceSync(`@layer reset, base, tokens, components, utilities;
|
|
9
|
+
@layer components {
|
|
10
|
+
/* ============================================
|
|
11
|
+
Tooltip — a small anchored contextual label.
|
|
12
|
+
|
|
13
|
+
The surface chrome (inverse-surface fill, inverse-on-surface ink, hairline
|
|
14
|
+
border, level3 elevation, small radius, edge-flip) is owned by the composed
|
|
15
|
+
<xm-overlay> in the \`tooltip\` tier — this file styles only the LABEL the
|
|
16
|
+
tooltip projects into the overlay, plus the trigger wrapper.
|
|
17
|
+
|
|
18
|
+
The label is a neutral, sentence-cased description — NO severity color, no
|
|
19
|
+
per-severity hue (AD-11). The ink is inverse-on-surface, inherited from the
|
|
20
|
+
overlay surface; it is restated here so the label reads correctly even if the
|
|
21
|
+
cascade is interrupted.
|
|
22
|
+
|
|
23
|
+
Motion (short3 fade/translate) is owned by the overlay's open transition.
|
|
24
|
+
|
|
25
|
+
BEM block: \`tooltip\`. Registered in scripts/check-bem.sh STRICT_BLOCKS.
|
|
26
|
+
Elements: __trigger (the anchored control wrapper), __label (the copy).
|
|
27
|
+
============================================ */
|
|
28
|
+
|
|
29
|
+
.tooltip__trigger {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.tooltip__label {
|
|
35
|
+
display: block;
|
|
36
|
+
max-width: 240px;
|
|
37
|
+
/* Compact label scale; sentence case enforced by content, no transform. */
|
|
38
|
+
font-family: var(--md-sys-typescale-body-small-font);
|
|
39
|
+
font-size: var(--md-sys-typescale-body-small-size);
|
|
40
|
+
line-height: var(--md-sys-typescale-body-small-line-height);
|
|
41
|
+
letter-spacing: var(--md-sys-typescale-body-small-tracking);
|
|
42
|
+
/* Neutral popover-stack ink (matches the overlay surface). */
|
|
43
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
44
|
+
padding: var(--s-1) var(--s-2);
|
|
45
|
+
text-wrap: pretty;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}`);
|
|
49
|
+
sheets = [sheet];
|
|
50
|
+
}
|
|
51
|
+
export default sheets;
|
|
@@ -19,7 +19,13 @@ export interface ValidationPreset extends ValidationError {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const VALIDATION_TITLE: Record<ValidationCode, string>;
|
|
21
21
|
export declare const VALIDATION_PRESETS: Record<ValidationCode, ValidationPreset>;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @fires file-pick - Fired when the user requests to pick a file.
|
|
24
|
+
* @fires file-drop - Fired when a file is dropped (`detail.file`).
|
|
25
|
+
* @fires copy-path - Fired when the file path is copied (`detail.path`).
|
|
26
|
+
* @fires error-dismiss - Fired when the validation error is dismissed.
|
|
27
|
+
*/
|
|
28
|
+
export declare class XmFileValidationBlock extends LitElement {
|
|
23
29
|
state: ValidationState;
|
|
24
30
|
file: ValidationFile | null;
|
|
25
31
|
error: ValidationError | null;
|
|
@@ -42,4 +48,3 @@ declare global {
|
|
|
42
48
|
"xm-file-validation-block": XmFileValidationBlock;
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
|
-
export {};
|