@xmesh/system-design 0.0.4 → 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 +5 -0
- package/dist/lit/components/alert/index.js +8 -2
- package/dist/lit/components/alert/index.styles.js +215 -0
- package/dist/lit/components/app-bar/index.d.ts +1 -0
- package/dist/lit/components/app-bar/index.js +4 -2
- package/dist/lit/components/app-bar/index.styles.js +94 -0
- package/dist/lit/components/artifact/index.d.ts +5 -0
- package/dist/lit/components/artifact/index.js +14 -10
- 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 +1 -0
- package/dist/lit/components/avatar/index.js +4 -2
- package/dist/lit/components/avatar/index.styles.js +76 -0
- package/dist/lit/components/avatar-group/index.d.ts +1 -0
- package/dist/lit/components/avatar-group/index.js +4 -2
- package/dist/lit/components/avatar-group/index.styles.js +74 -0
- package/dist/lit/components/badge/index.d.ts +1 -0
- package/dist/lit/components/badge/index.js +4 -2
- package/dist/lit/components/badge/index.styles.js +86 -0
- package/dist/lit/components/brand-mark/index.js +8 -9
- package/dist/lit/components/brand-mark/index.styles.js +123 -0
- package/dist/lit/components/breadcrumbs/index.d.ts +1 -0
- package/dist/lit/components/breadcrumbs/index.js +5 -4
- package/dist/lit/components/breadcrumbs/index.styles.js +105 -0
- package/dist/lit/components/bubble/index.d.ts +4 -0
- package/dist/lit/components/bubble/index.js +14 -11
- package/dist/lit/components/bubble/index.styles.js +196 -0
- package/dist/lit/components/button/index.d.ts +1 -0
- package/dist/lit/components/button/index.js +6 -13
- package/dist/lit/components/button/index.styles.js +356 -0
- package/dist/lit/components/card/index.d.ts +1 -0
- package/dist/lit/components/card/index.js +4 -2
- package/dist/lit/components/card/index.styles.js +113 -0
- package/dist/lit/components/chat/index.d.ts +6 -0
- package/dist/lit/components/chat/index.js +15 -10
- package/dist/lit/components/chat/index.styles.js +306 -0
- package/dist/lit/components/checkbox/index.d.ts +1 -0
- package/dist/lit/components/checkbox/index.js +7 -4
- package/dist/lit/components/checkbox/index.styles.js +140 -0
- package/dist/lit/components/chip/index.d.ts +5 -0
- package/dist/lit/components/chip/index.js +8 -2
- package/dist/lit/components/chip/index.styles.js +159 -0
- package/dist/lit/components/chip-group/index.d.ts +4 -0
- package/dist/lit/components/chip-group/index.js +7 -2
- package/dist/lit/components/chip-group/index.styles.js +33 -0
- package/dist/lit/components/code/index.d.ts +1 -0
- package/dist/lit/components/code/index.js +4 -3
- package/dist/lit/components/code/index.styles.js +56 -0
- package/dist/lit/components/composer/index.d.ts +6 -0
- package/dist/lit/components/composer/index.js +15 -10
- 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 +1 -0
- package/dist/lit/components/divider/index.js +4 -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 +5 -0
- package/dist/lit/components/expansion-panel/index.js +8 -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 +1 -0
- package/dist/lit/components/grid/index.js +4 -2
- package/dist/lit/components/grid/index.styles.js +67 -0
- package/dist/lit/components/kbd/index.d.ts +1 -0
- package/dist/lit/components/kbd/index.js +4 -2
- package/dist/lit/components/kbd/index.styles.js +49 -0
- package/dist/lit/components/list/index.d.ts +4 -0
- package/dist/lit/components/list/index.js +7 -2
- package/dist/lit/components/list/index.styles.js +29 -0
- package/dist/lit/components/list-item/index.d.ts +1 -0
- package/dist/lit/components/list-item/index.js +4 -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 +4 -0
- package/dist/lit/components/navigation-drawer/index.js +7 -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 +17 -0
- package/dist/lit/components/pagination/index.js +53 -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.js +8 -9
- 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.js +8 -9
- 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 +4 -0
- package/dist/lit/components/snackbar/index.js +14 -10
- package/dist/lit/components/snackbar/index.styles.js +293 -0
- package/dist/lit/components/stack/index.d.ts +1 -0
- package/dist/lit/components/stack/index.js +4 -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 +1 -0
- package/dist/lit/components/table/index.js +4 -2
- package/dist/lit/components/table/index.styles.js +99 -0
- package/dist/lit/components/tabs/index.d.ts +4 -0
- package/dist/lit/components/tabs/index.js +8 -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 +6 -0
- package/dist/lit/components/validation/index.js +15 -10
- 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,133 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/list-item/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
|
+
List item — a row in <xm-list>.
|
|
12
|
+
|
|
13
|
+
Generalizes the shipped <xm-sidebar-item> desk-row pattern (FR-156):
|
|
14
|
+
8px radius, surface-container-lowest hover/active, short3 background
|
|
15
|
+
transition, on-surface / on-surface-variant ink — into a reusable
|
|
16
|
+
surface* row with leading / body (title + optional secondary) /
|
|
17
|
+
trailing slots.
|
|
18
|
+
|
|
19
|
+
Lives on the surface* desk family (AD-13): primary ink
|
|
20
|
+
--md-sys-color-on-surface, secondary --md-sys-color-on-surface-variant.
|
|
21
|
+
Selected adds a coral leading indicator + a soft selected background;
|
|
22
|
+
selection is conveyed by the indicator + aria-selected, never by color
|
|
23
|
+
alone (NFR-15). State changes are real token swaps, not filter/opacity.
|
|
24
|
+
============================================ */
|
|
25
|
+
|
|
26
|
+
.list-item {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--s-3);
|
|
30
|
+
padding: var(--s-2) var(--s-3);
|
|
31
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
32
|
+
color: var(--md-sys-color-on-surface);
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
position: relative;
|
|
35
|
+
transition:
|
|
36
|
+
background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
37
|
+
color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
38
|
+
}
|
|
39
|
+
.list-item:focus { outline: none; }
|
|
40
|
+
|
|
41
|
+
/* ---------- Hover / active (shared with sidebar-item) ---------- */
|
|
42
|
+
.list-item:hover,
|
|
43
|
+
.list-item.is-hover {
|
|
44
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ---------- Selected — coral leading indicator + soft fill ---------- */
|
|
48
|
+
.list-item--selected {
|
|
49
|
+
background: var(--md-sys-color-surface-container-low);
|
|
50
|
+
}
|
|
51
|
+
.list-item--selected::before {
|
|
52
|
+
content: "";
|
|
53
|
+
position: absolute;
|
|
54
|
+
left: 0;
|
|
55
|
+
top: 50%;
|
|
56
|
+
transform: translateY(-50%);
|
|
57
|
+
width: 3px;
|
|
58
|
+
height: 60%;
|
|
59
|
+
border-radius: var(--md-sys-shape-corner-full);
|
|
60
|
+
background: var(--md-sys-color-primary);
|
|
61
|
+
}
|
|
62
|
+
.list-item--selected .list-item__title {
|
|
63
|
+
color: var(--md-sys-color-on-surface);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ---------- Disabled — reduced emphasis, no hover ---------- */
|
|
67
|
+
.list-item--disabled {
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
color: var(--xm-color-on-surface-disabled);
|
|
70
|
+
}
|
|
71
|
+
.list-item--disabled:hover,
|
|
72
|
+
.list-item--disabled.is-hover {
|
|
73
|
+
background: transparent;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* ---------- Leading / body / trailing ---------- */
|
|
77
|
+
.list-item__leading {
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
83
|
+
}
|
|
84
|
+
.list-item__leading.is-empty { display: none; }
|
|
85
|
+
|
|
86
|
+
.list-item__body {
|
|
87
|
+
flex: 1;
|
|
88
|
+
min-width: 0;
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: 1px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.list-item__title {
|
|
95
|
+
font-family: var(--md-sys-typescale-title-small-font);
|
|
96
|
+
font-size: var(--md-sys-typescale-title-small-size);
|
|
97
|
+
font-weight: 500;
|
|
98
|
+
line-height: 1.25;
|
|
99
|
+
color: var(--md-sys-color-on-surface);
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
white-space: nowrap;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.list-item__secondary {
|
|
106
|
+
font-family: var(--md-sys-typescale-body-medium-font);
|
|
107
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
108
|
+
line-height: 1.35;
|
|
109
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
text-overflow: ellipsis;
|
|
112
|
+
white-space: nowrap;
|
|
113
|
+
}
|
|
114
|
+
.list-item__secondary.is-empty { display: none; }
|
|
115
|
+
|
|
116
|
+
.list-item__trailing {
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
flex-shrink: 0;
|
|
120
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
121
|
+
}
|
|
122
|
+
.list-item__trailing.is-empty { display: none; }
|
|
123
|
+
|
|
124
|
+
/* Dark theme — like sidebar-item, push the resting title into gray so a
|
|
125
|
+
hovered/selected row's brighter title pops as the active state. */
|
|
126
|
+
[data-theme="dark"] .list-item:not(.list-item--selected):not(:hover):not(.is-hover) .list-item__title {
|
|
127
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}`);
|
|
131
|
+
sheets = [sheet];
|
|
132
|
+
}
|
|
133
|
+
export default sheets;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { LitElement } from "lit";
|
|
2
2
|
import type { TemplateResult } from "lit";
|
|
3
3
|
import type { OverlayPlacement } from "../overlay/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* @fires close - Fired when the element requests to close.
|
|
6
|
+
* @fires xm-menu-item-activate - Fired when a menu item is activated.
|
|
7
|
+
* @fires xm-menu-item-hover - Fired when a menu item is hovered.
|
|
8
|
+
* @fires xm-menu-select - Fired when a menu option is selected.
|
|
9
|
+
*/
|
|
4
10
|
export declare class XmMenu extends LitElement {
|
|
11
|
+
static styles: CSSStyleSheet[];
|
|
5
12
|
open: boolean;
|
|
6
13
|
placement: OverlayPlacement;
|
|
7
14
|
label: string;
|
|
@@ -30,6 +37,7 @@ export declare class XmMenu extends LitElement {
|
|
|
30
37
|
protected updated(): void;
|
|
31
38
|
}
|
|
32
39
|
export declare class XmMenuItem extends LitElement {
|
|
40
|
+
static styles: CSSStyleSheet[];
|
|
33
41
|
value: string | number;
|
|
34
42
|
disabled: boolean;
|
|
35
43
|
active: boolean;
|
|
@@ -48,8 +48,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
48
48
|
};
|
|
49
49
|
import { LitElement, html } from "lit";
|
|
50
50
|
import { customElement, property, query, state } from "lit/decorators.js";
|
|
51
|
-
|
|
51
|
+
import menuSheets from "./index.styles.js";
|
|
52
52
|
let menuSeq = 0;
|
|
53
|
+
/**
|
|
54
|
+
* @fires close - Fired when the element requests to close.
|
|
55
|
+
* @fires xm-menu-item-activate - Fired when a menu item is activated.
|
|
56
|
+
* @fires xm-menu-item-hover - Fired when a menu item is hovered.
|
|
57
|
+
* @fires xm-menu-select - Fired when a menu option is selected.
|
|
58
|
+
*/
|
|
53
59
|
let XmMenu = class XmMenu extends LitElement {
|
|
54
60
|
constructor() {
|
|
55
61
|
super(...arguments);
|
|
@@ -155,6 +161,9 @@ let XmMenu = class XmMenu extends LitElement {
|
|
|
155
161
|
}
|
|
156
162
|
};
|
|
157
163
|
}
|
|
164
|
+
// Adopted from the build-generated sheet (gen-styles.mjs) — no runtime URL
|
|
165
|
+
// fetch (ADR 0012). Both xm-menu and xm-menu-item share this one folder sheet.
|
|
166
|
+
static { this.styles = [...menuSheets]; }
|
|
158
167
|
get _items() {
|
|
159
168
|
const slot = this.renderRoot.querySelector(".menu__list slot:not([name])");
|
|
160
169
|
if (!slot)
|
|
@@ -171,7 +180,6 @@ let XmMenu = class XmMenu extends LitElement {
|
|
|
171
180
|
render() {
|
|
172
181
|
const activeId = this._activeIndex >= 0 ? `${this._listId}-item-${this._activeIndex}` : "";
|
|
173
182
|
return html `
|
|
174
|
-
<link rel="stylesheet" href="${MENU_CSS}" />
|
|
175
183
|
<style>
|
|
176
184
|
:host { display: inline-flex; }
|
|
177
185
|
</style>
|
|
@@ -340,6 +348,7 @@ let XmMenuItem = class XmMenuItem extends LitElement {
|
|
|
340
348
|
this.dispatchEvent(new CustomEvent("xm-menu-item-hover", { bubbles: true, composed: true }));
|
|
341
349
|
};
|
|
342
350
|
}
|
|
351
|
+
static { this.styles = [...menuSheets]; }
|
|
343
352
|
render() {
|
|
344
353
|
const cls = [
|
|
345
354
|
"menu-item",
|
|
@@ -349,7 +358,6 @@ let XmMenuItem = class XmMenuItem extends LitElement {
|
|
|
349
358
|
.filter(Boolean)
|
|
350
359
|
.join(" ");
|
|
351
360
|
return html `
|
|
352
|
-
<link rel="stylesheet" href="${MENU_CSS}" />
|
|
353
361
|
<style>
|
|
354
362
|
:host { display: block; }
|
|
355
363
|
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/menu/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
|
+
Menu — an anchored dropdown of menu items.
|
|
12
|
+
|
|
13
|
+
The popover surface chrome (inverse-surface fill, inverse-on-surface ink,
|
|
14
|
+
hairline border, level3 elevation, edge-flip, open/close motion) is owned by
|
|
15
|
+
the composed <xm-overlay> in the \`menu\` tier. This file styles the list, the
|
|
16
|
+
trigger wrapper, and each <xm-menu-item> (a separate block, rendered in its
|
|
17
|
+
own shadow root).
|
|
18
|
+
|
|
19
|
+
All ink is inverse-on-surface (AD-13) — the popover stack ink. Item
|
|
20
|
+
hover/active uses a state layer mixed from the ink, not opacity tricks on the
|
|
21
|
+
real content. Disabled items take the shared reduced emphasis — never an
|
|
22
|
+
error hue (AD-11). Destructive actions are icon + copy.
|
|
23
|
+
|
|
24
|
+
BEM blocks: \`menu\` (root) + \`menu-item\` (the item, its own shadow root). Both
|
|
25
|
+
registered in scripts/check-bem.sh STRICT_BLOCKS.
|
|
26
|
+
Elements: menu__trigger, menu__list; menu-item__icon, menu-item__label.
|
|
27
|
+
Modifiers: menu-item--active, menu-item--disabled.
|
|
28
|
+
============================================ */
|
|
29
|
+
|
|
30
|
+
.menu__trigger {
|
|
31
|
+
display: inline-flex;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.menu__list {
|
|
36
|
+
list-style: none;
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: var(--s-1);
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: var(--s-0-5);
|
|
42
|
+
min-width: 180px;
|
|
43
|
+
outline: none;
|
|
44
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ---------- Menu item (separate block / shadow root) ---------- */
|
|
48
|
+
.menu-item {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: var(--s-3);
|
|
52
|
+
padding: var(--s-2) var(--s-3);
|
|
53
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
54
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
55
|
+
font-family: var(--md-sys-typescale-body-medium-font);
|
|
56
|
+
font-size: var(--md-sys-typescale-body-medium-size);
|
|
57
|
+
line-height: var(--md-sys-typescale-body-medium-line-height);
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
user-select: none;
|
|
60
|
+
transition: background var(--md-sys-motion-duration-short3)
|
|
61
|
+
var(--md-sys-motion-easing-standard);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Active (keyboard / hover) — a state layer mixed from the popover ink. */
|
|
65
|
+
.menu-item--active {
|
|
66
|
+
background: color-mix(
|
|
67
|
+
in oklch,
|
|
68
|
+
var(--md-sys-color-inverse-on-surface) 10%,
|
|
69
|
+
transparent
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.menu-item--disabled {
|
|
74
|
+
color: color-mix(
|
|
75
|
+
in oklch,
|
|
76
|
+
var(--md-sys-color-inverse-on-surface) 40%,
|
|
77
|
+
transparent
|
|
78
|
+
);
|
|
79
|
+
cursor: default;
|
|
80
|
+
pointer-events: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.menu-item__icon {
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: center;
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
color: color-mix(
|
|
89
|
+
in oklch,
|
|
90
|
+
var(--md-sys-color-inverse-on-surface) 70%,
|
|
91
|
+
transparent
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
/* Collapse the icon column entirely when no icon is slotted so labels align. */
|
|
95
|
+
.menu-item__icon.is-empty {
|
|
96
|
+
display: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.menu-item__label {
|
|
100
|
+
flex: 1;
|
|
101
|
+
min-width: 0;
|
|
102
|
+
text-wrap: pretty;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
}`);
|
|
106
|
+
sheets = [sheet];
|
|
107
|
+
}
|
|
108
|
+
export default sheets;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
xm-multi-select — multiple-value picker for XmField (Component-Capability
|
|
3
|
+
Epic 2, ADR 0014).
|
|
4
|
+
|
|
5
|
+
Composes XmField (chrome) + xm-overlay (anchored panel) + xm-checkbox (the
|
|
6
|
+
per-option selected indicator) + xm-text-field (search). This file styles ONLY
|
|
7
|
+
the bespoke parts: the closed trigger (a full-bleed <button> inside the base's
|
|
8
|
+
.field__control wrapper), the chevron, and the panel content (search + listbox)
|
|
9
|
+
projected into the overlay. Positioning / elevation of the panel is owned by
|
|
10
|
+
xm-overlay; the option checkbox visual is owned by xm-checkbox.
|
|
11
|
+
|
|
12
|
+
Surface & ink (AD-13):
|
|
13
|
+
• Closed trigger rides the inverse-surface card tier → inverse-on-surface ink,
|
|
14
|
+
inverse-on-surface-muted for the placeholder.
|
|
15
|
+
• The panel rows sit on the overlay's inverse-surface panel → ink stays
|
|
16
|
+
inverse-on-surface; hover/active uses the MD3 state layer.
|
|
17
|
+
• Selection is carried by the row's xm-checkbox (coral fill), NOT a row tint —
|
|
18
|
+
so the active (keyboard/hover) highlight never double-signals with selection.
|
|
19
|
+
|
|
20
|
+
BEM block: `multi-select`. Registered in scripts/check-bem.sh STRICT_BLOCKS.
|
|
21
|
+
============================================ */
|
|
22
|
+
|
|
23
|
+
/* ---------- Closed trigger — full-bleed button in the field wrapper ---------- */
|
|
24
|
+
.multi-select__control {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: var(--s-2);
|
|
28
|
+
flex: 1;
|
|
29
|
+
min-width: 0;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 100%;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
appearance: none;
|
|
34
|
+
border: none;
|
|
35
|
+
outline: none;
|
|
36
|
+
background: transparent;
|
|
37
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
38
|
+
font:
|
|
39
|
+
var(--md-sys-typescale-body-large-weight)
|
|
40
|
+
var(--md-sys-typescale-body-large-size) /
|
|
41
|
+
var(--md-sys-typescale-body-large-line-height)
|
|
42
|
+
var(--md-sys-typescale-body-large-font);
|
|
43
|
+
padding: 0 var(--s-3);
|
|
44
|
+
text-align: left;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
.multi-select__control:disabled {
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ---------- Value / placeholder ---------- */
|
|
52
|
+
.multi-select__value {
|
|
53
|
+
flex: 1;
|
|
54
|
+
min-width: 0;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
text-overflow: ellipsis;
|
|
58
|
+
}
|
|
59
|
+
.multi-select__value--placeholder {
|
|
60
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* ---------- Chevron — rotates on open (short3, standard) ---------- */
|
|
64
|
+
.multi-select__chevron {
|
|
65
|
+
display: inline-flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
69
|
+
transition: transform var(--md-sys-motion-duration-short3)
|
|
70
|
+
var(--md-sys-motion-easing-standard);
|
|
71
|
+
}
|
|
72
|
+
.multi-select__chevron--open {
|
|
73
|
+
transform: rotate(180deg);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* ---------- Panel (inside the overlay): search + listbox ---------- */
|
|
77
|
+
.multi-select__panel {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
gap: var(--s-2);
|
|
81
|
+
min-width: 220px;
|
|
82
|
+
}
|
|
83
|
+
.multi-select__search {
|
|
84
|
+
display: block;
|
|
85
|
+
width: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* ---------- Listbox ---------- */
|
|
89
|
+
.multi-select__listbox {
|
|
90
|
+
list-style: none;
|
|
91
|
+
margin: 0;
|
|
92
|
+
padding: 0;
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
gap: var(--s-0-5);
|
|
96
|
+
max-height: 280px;
|
|
97
|
+
overflow-y: auto;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* ---------- Option rows ---------- */
|
|
101
|
+
.multi-select__option {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: var(--s-2);
|
|
105
|
+
padding: var(--s-1) var(--s-2);
|
|
106
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
107
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
108
|
+
font:
|
|
109
|
+
var(--md-sys-typescale-body-medium-weight)
|
|
110
|
+
var(--md-sys-typescale-body-medium-size) /
|
|
111
|
+
var(--md-sys-typescale-body-medium-line-height)
|
|
112
|
+
var(--md-sys-typescale-body-medium-font);
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
user-select: none;
|
|
115
|
+
}
|
|
116
|
+
.multi-select__option-label {
|
|
117
|
+
flex: 1;
|
|
118
|
+
min-width: 0;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
text-overflow: ellipsis;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* The option checkbox is presentational — the row owns the click + a11y. */
|
|
125
|
+
.multi-select__check {
|
|
126
|
+
flex-shrink: 0;
|
|
127
|
+
pointer-events: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Active (keyboard / pointer hover) — the MD3 state layer over the panel ink. */
|
|
131
|
+
.multi-select__option--active {
|
|
132
|
+
background: color-mix(
|
|
133
|
+
in oklab,
|
|
134
|
+
var(--md-sys-color-inverse-on-surface)
|
|
135
|
+
var(--md-sys-state-hover-state-layer-opacity),
|
|
136
|
+
transparent
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Disabled option (explicitly disabled, or unselected at the `max` cap). */
|
|
141
|
+
.multi-select__option--disabled {
|
|
142
|
+
opacity: 0.4;
|
|
143
|
+
cursor: not-allowed;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* ---------- Empty (no search matches) ---------- */
|
|
147
|
+
.multi-select__empty {
|
|
148
|
+
list-style: none;
|
|
149
|
+
padding: var(--s-2) var(--s-2);
|
|
150
|
+
color: var(--xm-color-inverse-on-surface-muted);
|
|
151
|
+
font:
|
|
152
|
+
var(--md-sys-typescale-body-medium-weight)
|
|
153
|
+
var(--md-sys-typescale-body-medium-size) /
|
|
154
|
+
var(--md-sys-typescale-body-medium-line-height)
|
|
155
|
+
var(--md-sys-typescale-body-medium-font);
|
|
156
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { PropertyValues, TemplateResult } from "lit";
|
|
2
|
+
import { XmField } from "../field/index.js";
|
|
3
|
+
import type { XmOverlay } from "../overlay/index.js";
|
|
4
|
+
import "../overlay/index.js";
|
|
5
|
+
import "../checkbox/index.js";
|
|
6
|
+
import "../text-field/index.js";
|
|
7
|
+
export interface MultiSelectOption {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string | number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @fires change - Fired on every toggle; `detail.value` is the full selection as an Array<primitive>.
|
|
14
|
+
*/
|
|
15
|
+
export declare class XmMultiSelect extends XmField {
|
|
16
|
+
static styles: CSSStyleSheet[];
|
|
17
|
+
/** The option model — `{ label, value, disabled? }` shared with xm-select / radio-group. */
|
|
18
|
+
options: MultiSelectOption[];
|
|
19
|
+
/** Shown on the trigger when nothing is selected. */
|
|
20
|
+
placeholder: string;
|
|
21
|
+
/** Selection cap (0 = uncapped). At the cap, unselected options disable; selected stay removable. */
|
|
22
|
+
max: number;
|
|
23
|
+
/** Render the in-panel search filter. */
|
|
24
|
+
searchable: boolean;
|
|
25
|
+
protected _open: boolean;
|
|
26
|
+
protected _activeIndex: number;
|
|
27
|
+
protected _selected: Set<string | number>;
|
|
28
|
+
protected _query: string;
|
|
29
|
+
protected _control: HTMLElement | null;
|
|
30
|
+
protected _overlay: XmOverlay | null;
|
|
31
|
+
protected _search: HTMLElement | null;
|
|
32
|
+
private _typeahead;
|
|
33
|
+
private _typeaheadTimer;
|
|
34
|
+
connectedCallback(): void;
|
|
35
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
36
|
+
disconnectedCallback(): void;
|
|
37
|
+
protected updated(changed: PropertyValues<this>): void;
|
|
38
|
+
/** The selected primitives, in option order. The typed multi-value accessor
|
|
39
|
+
(the inherited string `value` stays a comma-joined mirror for plain consumers). */
|
|
40
|
+
get selectedValues(): (string | number)[];
|
|
41
|
+
private _seedFromValue;
|
|
42
|
+
private get _q();
|
|
43
|
+
private _matches;
|
|
44
|
+
private get _atCap();
|
|
45
|
+
private _optDisabled;
|
|
46
|
+
/** Original indices of options that are visible (match the query) AND togglable. */
|
|
47
|
+
private get _navigable();
|
|
48
|
+
private get _visibleCount();
|
|
49
|
+
private _nextNavigable;
|
|
50
|
+
private _toggleValue;
|
|
51
|
+
private _toggleIndex;
|
|
52
|
+
private _syncForm;
|
|
53
|
+
private _emitChange;
|
|
54
|
+
private _onDocPointerDown;
|
|
55
|
+
private _openList;
|
|
56
|
+
private _closeList;
|
|
57
|
+
private _onOverlayClose;
|
|
58
|
+
private _onControlKeydown;
|
|
59
|
+
private _onListKeydown;
|
|
60
|
+
private _onSearchKeydown;
|
|
61
|
+
private _onSearchInput;
|
|
62
|
+
private _typeAhead;
|
|
63
|
+
protected renderControl(): TemplateResult;
|
|
64
|
+
private _renderOption;
|
|
65
|
+
}
|
|
66
|
+
declare global {
|
|
67
|
+
interface HTMLElementTagNameMap {
|
|
68
|
+
"xm-multi-select": XmMultiSelect;
|
|
69
|
+
}
|
|
70
|
+
}
|