@xmesh/system-design 0.0.4 → 0.0.6
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 +47 -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 +48 -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 +70 -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 +38 -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 +48 -0
- package/dist/react/XmCheckbox.d.ts +145 -0
- package/dist/react/XmCheckbox.js +60 -0
- package/dist/react/XmChip.d.ts +99 -0
- package/dist/react/XmChip.js +48 -0
- package/dist/react/XmChipGroup.d.ts +79 -0
- package/dist/react/XmChipGroup.js +36 -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 +56 -0
- package/dist/react/XmDataTable.d.ts +125 -0
- package/dist/react/XmDataTable.js +66 -0
- package/dist/react/XmDateRange.d.ts +93 -0
- package/dist/react/XmDateRange.js +42 -0
- package/dist/react/XmDialog.d.ts +87 -0
- package/dist/react/XmDialog.js +41 -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 +49 -0
- package/dist/react/XmFileInput.d.ts +151 -0
- package/dist/react/XmFileInput.js +70 -0
- package/dist/react/XmFileValidationBlock.d.ts +111 -0
- package/dist/react/XmFileValidationBlock.js +50 -0
- package/dist/react/XmForm.d.ts +91 -0
- package/dist/react/XmForm.js +38 -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 +38 -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 +46 -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 +74 -0
- package/dist/react/XmNavigationDrawer.d.ts +93 -0
- package/dist/react/XmNavigationDrawer.js +42 -0
- package/dist/react/XmOverlay.d.ts +120 -0
- package/dist/react/XmOverlay.js +56 -0
- package/dist/react/XmPagination.d.ts +117 -0
- package/dist/react/XmPagination.js +58 -0
- package/dist/react/XmPopover.d.ts +90 -0
- package/dist/react/XmPopover.js +42 -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 +42 -0
- package/dist/react/XmRadioGroup.d.ts +139 -0
- package/dist/react/XmRadioGroup.js +58 -0
- package/dist/react/XmSelect.d.ts +152 -0
- package/dist/react/XmSelect.js +70 -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 +76 -0
- package/dist/react/XmSnackbar.d.ts +110 -0
- package/dist/react/XmSnackbar.js +51 -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 +58 -0
- package/dist/react/XmTab.d.ts +79 -0
- package/dist/react/XmTab.js +38 -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 +38 -0
- package/dist/react/XmTextField.d.ts +147 -0
- package/dist/react/XmTextField.js +62 -0
- package/dist/react/XmTextarea.d.ts +155 -0
- package/dist/react/XmTextarea.js +66 -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
|
@@ -53,9 +53,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
53
53
|
};
|
|
54
54
|
import { LitElement, html, nothing } from "lit";
|
|
55
55
|
import { customElement, property, query } from "lit/decorators.js";
|
|
56
|
+
import navigationDrawerSheets from "./index.styles.js";
|
|
56
57
|
// Resolve CSS relative to the *built* file:
|
|
57
58
|
// lit/build/components/navigation-drawer/index.js → ../...
|
|
58
|
-
|
|
59
|
+
/**
|
|
60
|
+
* @fires close - Fired when the element requests to close.
|
|
61
|
+
*/
|
|
59
62
|
let XmNavigationDrawer = class XmNavigationDrawer extends LitElement {
|
|
60
63
|
constructor() {
|
|
61
64
|
super(...arguments);
|
|
@@ -89,6 +92,9 @@ let XmNavigationDrawer = class XmNavigationDrawer extends LitElement {
|
|
|
89
92
|
}
|
|
90
93
|
};
|
|
91
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 = [...navigationDrawerSheets]; }
|
|
92
98
|
static { this.shadowRootOptions = {
|
|
93
99
|
...LitElement.shadowRootOptions,
|
|
94
100
|
delegatesFocus: true,
|
|
@@ -108,7 +114,6 @@ let XmNavigationDrawer = class XmNavigationDrawer extends LitElement {
|
|
|
108
114
|
</nav>
|
|
109
115
|
`;
|
|
110
116
|
return html `
|
|
111
|
-
<link rel="stylesheet" href="${NAV_DRAWER_CSS}" />
|
|
112
117
|
<style>
|
|
113
118
|
:host {
|
|
114
119
|
display: contents;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/navigation-drawer/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-navigation-drawer> — side navigation panel.
|
|
12
|
+
|
|
13
|
+
Surface / ink (AD-13): the INVERSE-SURFACE family (the card stack) —
|
|
14
|
+
panel background var(--md-sys-color-inverse-surface), ink
|
|
15
|
+
var(--md-sys-color-inverse-on-surface), directional drawer shadow
|
|
16
|
+
var(--xm-elevation-drawer). Hairline 1px borders only.
|
|
17
|
+
|
|
18
|
+
Hosts light-DOM xm-sidebar-item children. Those items reference the desk
|
|
19
|
+
surface roles (--md-sys-color-on-surface / -variant / -container-lowest); to
|
|
20
|
+
keep AD-12 (no reaching into their shadow root) while making them read on
|
|
21
|
+
the inverse-surface panel, the panel REMAPS those role custom properties to
|
|
22
|
+
their inverse equivalents at the panel scope. Custom properties inherit, so
|
|
23
|
+
the items pick up the right ink/hover automatically.
|
|
24
|
+
|
|
25
|
+
Modal mode is a native <dialog> in EDGE layout (showModal gives focus-trap +
|
|
26
|
+
inert for free; ::backdrop is the scrim). Persistent mode is a static panel;
|
|
27
|
+
collapsed mode is an icon rail. Slide-in is short4 emphasized-decelerate.
|
|
28
|
+
|
|
29
|
+
BEM block \`nav-drawer\`; elements \`__dialog\` \`__panel\`; modifiers \`--open\`
|
|
30
|
+
\`--collapsed\` \`--modal\` \`--persistent\`.
|
|
31
|
+
============================================ */
|
|
32
|
+
|
|
33
|
+
.nav-drawer__panel {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: var(--s-1);
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
width: 280px;
|
|
39
|
+
height: 100%;
|
|
40
|
+
padding: var(--s-3);
|
|
41
|
+
background: var(--md-sys-color-inverse-surface);
|
|
42
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
43
|
+
border-inline-end: 1px solid var(--md-sys-color-outline-variant);
|
|
44
|
+
box-shadow: var(--xm-elevation-drawer);
|
|
45
|
+
overflow-y: auto;
|
|
46
|
+
|
|
47
|
+
/* Remap the desk surface roles to the card-stack equivalents so slotted
|
|
48
|
+
xm-sidebar-item children (which use these roles) read on inverse-surface.
|
|
49
|
+
This is token-level composition, not reaching into the item's shadow. */
|
|
50
|
+
--md-sys-color-on-surface: var(--md-sys-color-inverse-on-surface);
|
|
51
|
+
--md-sys-color-on-surface-variant: var(--xm-color-inverse-on-surface-muted);
|
|
52
|
+
--md-sys-color-surface-container-lowest: color-mix(
|
|
53
|
+
in oklab,
|
|
54
|
+
var(--md-sys-color-inverse-on-surface) 8%,
|
|
55
|
+
var(--md-sys-color-inverse-surface)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* ---------- Modal: native <dialog> in edge layout ---------- */
|
|
60
|
+
.nav-drawer__dialog {
|
|
61
|
+
margin: 0;
|
|
62
|
+
inset-block: 0;
|
|
63
|
+
inset-inline-start: 0;
|
|
64
|
+
height: 100dvh;
|
|
65
|
+
max-height: 100dvh;
|
|
66
|
+
max-width: 92vw;
|
|
67
|
+
padding: 0;
|
|
68
|
+
border: 0;
|
|
69
|
+
background: transparent;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
.nav-drawer__dialog::backdrop {
|
|
73
|
+
background: var(--md-sys-color-scrim);
|
|
74
|
+
opacity: 0.5;
|
|
75
|
+
}
|
|
76
|
+
.nav-drawer__dialog .nav-drawer__panel {
|
|
77
|
+
border-radius: 0;
|
|
78
|
+
/* Slide-in: panel translates from the leading edge on open. */
|
|
79
|
+
transform: translateX(-100%);
|
|
80
|
+
transition: transform var(--md-sys-motion-duration-short4)
|
|
81
|
+
var(--md-sys-motion-easing-emphasized-decelerate);
|
|
82
|
+
}
|
|
83
|
+
.nav-drawer__dialog[open] .nav-drawer__panel {
|
|
84
|
+
transform: translateX(0);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* ---------- Persistent panel ---------- */
|
|
88
|
+
.nav-drawer--persistent .nav-drawer__panel {
|
|
89
|
+
border-radius: var(--md-sys-shape-corner-medium);
|
|
90
|
+
height: auto;
|
|
91
|
+
/* Slide + collapse on open/close. Width animates to 0 so the closed drawer
|
|
92
|
+
yields its layout space (not just translated off-screen). */
|
|
93
|
+
transition:
|
|
94
|
+
width var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-decelerate),
|
|
95
|
+
transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized-decelerate),
|
|
96
|
+
opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Closed persistent drawer: collapse to zero width, slide out, and hide so its
|
|
100
|
+
slotted (focusable) children leave the tab order — \`aria-hidden\` alone would
|
|
101
|
+
leave focusable descendants inside a hidden region (an a11y anti-pattern). */
|
|
102
|
+
.nav-drawer--persistent:not(.nav-drawer--open) .nav-drawer__panel {
|
|
103
|
+
width: 0;
|
|
104
|
+
padding-inline: 0;
|
|
105
|
+
transform: translateX(-100%);
|
|
106
|
+
opacity: 0;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
visibility: hidden;
|
|
109
|
+
border-inline-end-color: transparent;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
@media (prefers-reduced-motion: reduce) {
|
|
113
|
+
.nav-drawer--persistent .nav-drawer__panel {
|
|
114
|
+
transition: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ---------- Collapsed icon rail ---------- */
|
|
119
|
+
.nav-drawer--collapsed .nav-drawer__panel {
|
|
120
|
+
width: 64px;
|
|
121
|
+
align-items: center;
|
|
122
|
+
padding-inline: var(--s-2);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}`);
|
|
126
|
+
sheets = [sheet];
|
|
127
|
+
}
|
|
128
|
+
export default sheets;
|
|
@@ -13,7 +13,12 @@ export interface OverlayOpenDetail {
|
|
|
13
13
|
tier: OverlayTier;
|
|
14
14
|
mode: OverlayMode;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* @fires xm-overlay-close - Fired when the overlay closes.
|
|
18
|
+
* @fires xm-overlay-open - Fired when the overlay opens.
|
|
19
|
+
*/
|
|
16
20
|
export declare class XmOverlay extends LitElement {
|
|
21
|
+
static styles: CSSStyleSheet[];
|
|
17
22
|
static shadowRootOptions: ShadowRootInit;
|
|
18
23
|
open: boolean;
|
|
19
24
|
mode: OverlayMode;
|
|
@@ -120,14 +120,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
120
120
|
};
|
|
121
121
|
import { LitElement, html } from "lit";
|
|
122
122
|
import { customElement, property, query } from "lit/decorators.js";
|
|
123
|
+
import overlaySheets from "./index.styles.js";
|
|
123
124
|
// Resolve CSS relative to the *built* file:
|
|
124
125
|
// lit/build/components/overlay/index.js → ../overlay/index.css.
|
|
125
|
-
const OVERLAY_CSS = new URL("../overlay/index.css", import.meta.url).href;
|
|
126
126
|
let overlaySeq = 0;
|
|
127
127
|
// Live stack of every open overlay, in open order (last = innermost). Used to
|
|
128
128
|
// route Esc to the innermost layer and to cascade-close descendant popovers
|
|
129
129
|
// when an ancestor (modal) closes.
|
|
130
130
|
const OPEN_STACK = [];
|
|
131
|
+
/**
|
|
132
|
+
* @fires xm-overlay-close - Fired when the overlay closes.
|
|
133
|
+
* @fires xm-overlay-open - Fired when the overlay opens.
|
|
134
|
+
*/
|
|
131
135
|
let XmOverlay = class XmOverlay extends LitElement {
|
|
132
136
|
constructor() {
|
|
133
137
|
super(...arguments);
|
|
@@ -198,6 +202,9 @@ let XmOverlay = class XmOverlay extends LitElement {
|
|
|
198
202
|
this._pinToAnchor();
|
|
199
203
|
};
|
|
200
204
|
}
|
|
205
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
206
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
207
|
+
static { this.styles = [...overlaySheets]; }
|
|
201
208
|
// The trigger that opened us lives in another shadow root; delegatesFocus
|
|
202
209
|
// keeps the overlay itself out of the tab order while letting content focus.
|
|
203
210
|
static { this.shadowRootOptions = {
|
|
@@ -217,7 +224,6 @@ let XmOverlay = class XmOverlay extends LitElement {
|
|
|
217
224
|
</div>
|
|
218
225
|
`;
|
|
219
226
|
return html `
|
|
220
|
-
<link rel="stylesheet" href="${OVERLAY_CSS}" />
|
|
221
227
|
<style>
|
|
222
228
|
:host {
|
|
223
229
|
display: contents;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/overlay/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-overlay> — platform-native overlay foundation.
|
|
12
|
+
|
|
13
|
+
The single surface that xm-dialog / xm-menu / xm-tooltip / xm-select /
|
|
14
|
+
xm-autocomplete compose. Modal mode is a native <dialog> (its ::backdrop
|
|
15
|
+
is the scrim); non-modal mode is a Popover-API element in the top layer,
|
|
16
|
+
anchored with CSS anchor() / @position-try.
|
|
17
|
+
|
|
18
|
+
Surface is the card tier — inverse-surface fill + inverse-on-surface ink
|
|
19
|
+
(AD-13). Elevation level3 for popovers/menus, level4–5 for modals
|
|
20
|
+
(DESIGN.md). Scrim is var(--md-sys-color-scrim) with alpha at this use
|
|
21
|
+
site. No blur / backdrop-filter; no gradient.
|
|
22
|
+
|
|
23
|
+
BEM block: \`overlay\`. Registered in scripts/check-bem.sh STRICT_BLOCKS.
|
|
24
|
+
Modifiers: --modal / --non-modal · --tier-tooltip / --tier-menu /
|
|
25
|
+
--tier-dialog. Elements: __dialog (native <dialog>), __popover (popover
|
|
26
|
+
element), __surface (the card chrome), __body (content region).
|
|
27
|
+
============================================ */
|
|
28
|
+
|
|
29
|
+
/* ---------- Native <dialog> (modal) ---------- */
|
|
30
|
+
/* The <dialog> element is the positioning + top-layer host; its visible card
|
|
31
|
+
is .overlay__surface inside it. The dialog box itself is transparent so the
|
|
32
|
+
surface owns the chrome. */
|
|
33
|
+
.overlay__dialog {
|
|
34
|
+
margin: auto;
|
|
35
|
+
padding: 0;
|
|
36
|
+
max-width: min(92vw, 560px);
|
|
37
|
+
max-height: 86vh;
|
|
38
|
+
border: none;
|
|
39
|
+
background: transparent;
|
|
40
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
41
|
+
overflow: visible;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* The scrim — flat token-alpha fill (DESIGN.md: scrim is pure black, alpha
|
|
45
|
+
applied at the callsite). No blur. */
|
|
46
|
+
.overlay__dialog::backdrop {
|
|
47
|
+
background: color-mix(in oklab, var(--md-sys-color-scrim) 48%, transparent);
|
|
48
|
+
animation: overlay-fade var(--md-sys-motion-duration-short4)
|
|
49
|
+
var(--md-sys-motion-easing-standard);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* ---------- Popover (non-modal, anchored) ---------- */
|
|
53
|
+
.overlay__popover {
|
|
54
|
+
margin: 0;
|
|
55
|
+
padding: 0;
|
|
56
|
+
border: none;
|
|
57
|
+
background: transparent;
|
|
58
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
59
|
+
overflow: visible;
|
|
60
|
+
/* Top-layer popover, positioned against the viewport. anchor() resolves
|
|
61
|
+
against the per-instance position-anchor set inline. @position-try flips
|
|
62
|
+
the popover when it would overflow the viewport. */
|
|
63
|
+
position: fixed;
|
|
64
|
+
position-try-fallbacks: flip-block, flip-inline;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Native anchor() path — used when the anchor element lives in the SAME tree
|
|
68
|
+
scope as the popover (anchor-name is tree-scoped). data-placement is set by
|
|
69
|
+
the element at open time; inset: auto resets so only the chosen edges bind. */
|
|
70
|
+
.overlay__popover[data-placement^="bottom"] {
|
|
71
|
+
inset: auto;
|
|
72
|
+
top: anchor(bottom);
|
|
73
|
+
left: anchor(left);
|
|
74
|
+
margin-block-start: var(--s-1);
|
|
75
|
+
}
|
|
76
|
+
.overlay__popover[data-placement^="top"] {
|
|
77
|
+
inset: auto;
|
|
78
|
+
bottom: anchor(top);
|
|
79
|
+
left: anchor(left);
|
|
80
|
+
margin-block-end: var(--s-1);
|
|
81
|
+
}
|
|
82
|
+
.overlay__popover[data-placement^="right"] {
|
|
83
|
+
inset: auto;
|
|
84
|
+
left: anchor(right);
|
|
85
|
+
top: anchor(top);
|
|
86
|
+
margin-inline-start: var(--s-1);
|
|
87
|
+
}
|
|
88
|
+
.overlay__popover[data-placement^="left"] {
|
|
89
|
+
inset: auto;
|
|
90
|
+
right: anchor(left);
|
|
91
|
+
top: anchor(top);
|
|
92
|
+
margin-inline-end: var(--s-1);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Cross-root fallback path — when the consumer's trigger is in ANOTHER shadow
|
|
96
|
+
root, CSS anchor-name is NOT visible to this popover (tree-scoped). The
|
|
97
|
+
element computes a fixed top/left from the trigger's bounding rect (no
|
|
98
|
+
dependency) and pins them via these custom properties; anchor() is skipped.
|
|
99
|
+
This is the built-in, dependency-free fallback — Floating UI (the heavier
|
|
100
|
+
escape hatch) is only for deep/virtual cases, never the common cross-root
|
|
101
|
+
one. */
|
|
102
|
+
.overlay__popover.overlay__popover--pinned {
|
|
103
|
+
inset: auto;
|
|
104
|
+
top: var(--xm-overlay-pin-top, 0);
|
|
105
|
+
left: var(--xm-overlay-pin-left, 0);
|
|
106
|
+
position-try-fallbacks: none;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* ---------- The card surface (shared) ---------- */
|
|
110
|
+
.overlay__surface {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
min-width: 0;
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
116
|
+
border-radius: var(--md-sys-shape-corner-large);
|
|
117
|
+
background: var(--md-sys-color-inverse-surface);
|
|
118
|
+
color: var(--md-sys-color-inverse-on-surface);
|
|
119
|
+
font:
|
|
120
|
+
var(--md-sys-typescale-body-large-weight)
|
|
121
|
+
var(--md-sys-typescale-body-large-size) /
|
|
122
|
+
var(--md-sys-typescale-body-large-line-height)
|
|
123
|
+
var(--md-sys-typescale-body-large-font);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Elevation per tier: dialogs lift highest (level5), menus/select-listbox
|
|
127
|
+
sit at popover height (level3), tooltips are the quietest layer (level3
|
|
128
|
+
too — they never cover a menu, but read as a raised chip). */
|
|
129
|
+
.overlay--modal .overlay__surface {
|
|
130
|
+
box-shadow: var(--md-sys-elevation-level5);
|
|
131
|
+
min-width: min(86vw, 320px);
|
|
132
|
+
}
|
|
133
|
+
.overlay--non-modal.overlay--tier-menu .overlay__surface {
|
|
134
|
+
box-shadow: var(--md-sys-elevation-level3);
|
|
135
|
+
min-width: 180px;
|
|
136
|
+
}
|
|
137
|
+
.overlay--non-modal.overlay--tier-dialog .overlay__surface {
|
|
138
|
+
box-shadow: var(--md-sys-elevation-level3);
|
|
139
|
+
}
|
|
140
|
+
.overlay--tier-tooltip .overlay__surface {
|
|
141
|
+
box-shadow: var(--md-sys-elevation-level3);
|
|
142
|
+
border-radius: var(--md-sys-shape-corner-small);
|
|
143
|
+
max-width: 260px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* ---------- Content region ---------- */
|
|
147
|
+
.overlay__body {
|
|
148
|
+
flex: 1;
|
|
149
|
+
min-width: 0;
|
|
150
|
+
min-height: 0;
|
|
151
|
+
overflow: auto;
|
|
152
|
+
padding: var(--s-5);
|
|
153
|
+
}
|
|
154
|
+
.overlay--tier-tooltip .overlay__body,
|
|
155
|
+
.overlay--tier-menu .overlay__body {
|
|
156
|
+
padding: var(--s-2);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* ---------- Open transition (short4, standard) ---------- */
|
|
160
|
+
@keyframes overlay-fade {
|
|
161
|
+
from {
|
|
162
|
+
opacity: 0;
|
|
163
|
+
}
|
|
164
|
+
to {
|
|
165
|
+
opacity: 1;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
.overlay__dialog[open],
|
|
169
|
+
.overlay__popover:popover-open {
|
|
170
|
+
animation: overlay-fade var(--md-sys-motion-duration-short4)
|
|
171
|
+
var(--md-sys-motion-easing-standard);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@media (prefers-reduced-motion: reduce) {
|
|
175
|
+
.overlay__dialog[open],
|
|
176
|
+
.overlay__popover:popover-open,
|
|
177
|
+
.overlay__dialog::backdrop {
|
|
178
|
+
animation: none;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
}`);
|
|
183
|
+
sheets = [sheet];
|
|
184
|
+
}
|
|
185
|
+
export default sheets;
|
|
@@ -4,11 +4,28 @@ type PaginationSize = "xs" | "sm" | "md" | "lg";
|
|
|
4
4
|
export interface PaginationPageChangeDetail {
|
|
5
5
|
page: number;
|
|
6
6
|
}
|
|
7
|
+
export interface PaginationOffsetChangeDetail {
|
|
8
|
+
offset: number;
|
|
9
|
+
limit: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @fires change - Fired on commit with the new value in `detail`.
|
|
13
|
+
* @fires xm-pagination-page-change - Fired when the page changes (`detail.page`).
|
|
14
|
+
* @fires xm-pagination-offset-change - Fired in offset/limit mode (`detail.offset`, `detail.limit`).
|
|
15
|
+
*/
|
|
7
16
|
export declare class XmPagination extends LitElement {
|
|
17
|
+
static styles: CSSStyleSheet[];
|
|
8
18
|
page: number;
|
|
9
19
|
total: number;
|
|
10
20
|
siblings: number;
|
|
11
21
|
size: PaginationSize;
|
|
22
|
+
/** Offset/limit mode (AD-18): set `limit` + `total-items` (+ `offset`) instead
|
|
23
|
+
of `page` + `total`. The page-based API stays available and unchanged; in
|
|
24
|
+
this mode the control ALSO emits xm-pagination-offset-change. */
|
|
25
|
+
offset: number;
|
|
26
|
+
limit: number;
|
|
27
|
+
totalItems: number;
|
|
28
|
+
private _isOffsetMode;
|
|
12
29
|
render(): TemplateResult;
|
|
13
30
|
private _clamp;
|
|
14
31
|
private _goto;
|
|
@@ -35,10 +35,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
35
35
|
};
|
|
36
36
|
import { LitElement, html, nothing } from "lit";
|
|
37
37
|
import { customElement, property } from "lit/decorators.js";
|
|
38
|
+
import primitivesSheets from "../primitives/index.styles.js";
|
|
39
|
+
import paginationSheets from "./index.styles.js";
|
|
38
40
|
// Resolve CSS relative to the *built* file:
|
|
39
41
|
// lit/build/components/pagination/index.js → ../...
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
/**
|
|
43
|
+
* @fires change - Fired on commit with the new value in `detail`.
|
|
44
|
+
* @fires xm-pagination-page-change - Fired when the page changes (`detail.page`).
|
|
45
|
+
* @fires xm-pagination-offset-change - Fired in offset/limit mode (`detail.offset`, `detail.limit`).
|
|
46
|
+
*/
|
|
42
47
|
let XmPagination = class XmPagination extends LitElement {
|
|
43
48
|
constructor() {
|
|
44
49
|
super(...arguments);
|
|
@@ -46,10 +51,27 @@ let XmPagination = class XmPagination extends LitElement {
|
|
|
46
51
|
this.total = 1;
|
|
47
52
|
this.siblings = 1;
|
|
48
53
|
this.size = "md";
|
|
54
|
+
/** Offset/limit mode (AD-18): set `limit` + `total-items` (+ `offset`) instead
|
|
55
|
+
of `page` + `total`. The page-based API stays available and unchanged; in
|
|
56
|
+
this mode the control ALSO emits xm-pagination-offset-change. */
|
|
57
|
+
this.offset = 0;
|
|
58
|
+
this.limit = 0;
|
|
59
|
+
this.totalItems = 0;
|
|
60
|
+
}
|
|
61
|
+
// Adopted from the build-generated sheets (scripts/gen-styles.mjs) — no
|
|
62
|
+
// runtime URL fetch (ADR 0012). Cascade order preserved from the old <link>s.
|
|
63
|
+
static { this.styles = [...primitivesSheets, ...paginationSheets]; }
|
|
64
|
+
_isOffsetMode() {
|
|
65
|
+
return this.limit > 0 && this.totalItems > 0;
|
|
49
66
|
}
|
|
50
67
|
render() {
|
|
51
|
-
const
|
|
52
|
-
const
|
|
68
|
+
const offsetMode = this._isOffsetMode();
|
|
69
|
+
const total = offsetMode
|
|
70
|
+
? Math.max(1, Math.ceil(this.totalItems / this.limit))
|
|
71
|
+
: Math.max(1, Math.floor(this.total));
|
|
72
|
+
const page = offsetMode
|
|
73
|
+
? this._clamp(Math.floor(this.offset / this.limit) + 1, total)
|
|
74
|
+
: this._clamp(this.page, total);
|
|
53
75
|
const size = ["xs", "sm", "md", "lg"].includes(this.size)
|
|
54
76
|
? this.size
|
|
55
77
|
: "md";
|
|
@@ -57,8 +79,6 @@ let XmPagination = class XmPagination extends LitElement {
|
|
|
57
79
|
const atFirst = page <= 1;
|
|
58
80
|
const atLast = page >= total;
|
|
59
81
|
return html `
|
|
60
|
-
<link rel="stylesheet" href="${PRIMITIVES_CSS}" />
|
|
61
|
-
<link rel="stylesheet" href="${PAGINATION_CSS}" />
|
|
62
82
|
<style>
|
|
63
83
|
:host {
|
|
64
84
|
display: inline-block;
|
|
@@ -116,9 +136,16 @@ let XmPagination = class XmPagination extends LitElement {
|
|
|
116
136
|
}
|
|
117
137
|
_goto(target, total) {
|
|
118
138
|
const next = this._clamp(target, total);
|
|
119
|
-
|
|
139
|
+
const offsetMode = this._isOffsetMode();
|
|
140
|
+
const currentPage = offsetMode
|
|
141
|
+
? Math.floor(this.offset / this.limit) + 1
|
|
142
|
+
: this.page;
|
|
143
|
+
if (next === currentPage)
|
|
120
144
|
return;
|
|
121
|
-
|
|
145
|
+
// Client/page mode is uncontrolled-first (updates locally); offset mode is
|
|
146
|
+
// controlled by the consumer's `offset` prop, so don't mutate locally.
|
|
147
|
+
if (!offsetMode)
|
|
148
|
+
this.page = next;
|
|
122
149
|
const detail = { page: next };
|
|
123
150
|
this.dispatchEvent(new CustomEvent("xm-pagination-page-change", {
|
|
124
151
|
detail,
|
|
@@ -130,6 +157,15 @@ let XmPagination = class XmPagination extends LitElement {
|
|
|
130
157
|
bubbles: true,
|
|
131
158
|
composed: true,
|
|
132
159
|
}));
|
|
160
|
+
// Offset mode ALSO emits the offset event so the consumer needs no converter
|
|
161
|
+
// (AD-18); the page-based event above is never suppressed.
|
|
162
|
+
if (offsetMode) {
|
|
163
|
+
this.dispatchEvent(new CustomEvent("xm-pagination-offset-change", {
|
|
164
|
+
detail: { offset: (next - 1) * this.limit, limit: this.limit },
|
|
165
|
+
bubbles: true,
|
|
166
|
+
composed: true,
|
|
167
|
+
}));
|
|
168
|
+
}
|
|
133
169
|
}
|
|
134
170
|
// Compute the visible page window with ellipsis truncation, e.g.
|
|
135
171
|
// 1 … 4 5 6 … 20. Always shows first + last; `siblings` pages flank current.
|
|
@@ -179,6 +215,15 @@ __decorate([
|
|
|
179
215
|
__decorate([
|
|
180
216
|
property({ type: String })
|
|
181
217
|
], XmPagination.prototype, "size", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
property({ type: Number })
|
|
220
|
+
], XmPagination.prototype, "offset", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
property({ type: Number })
|
|
223
|
+
], XmPagination.prototype, "limit", void 0);
|
|
224
|
+
__decorate([
|
|
225
|
+
property({ type: Number, attribute: "total-items" })
|
|
226
|
+
], XmPagination.prototype, "totalItems", void 0);
|
|
182
227
|
XmPagination = __decorate([
|
|
183
228
|
customElement("xm-pagination")
|
|
184
229
|
], XmPagination);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// GENERATED by scripts/gen-styles.mjs — do not edit. Source: lit/components/pagination/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-pagination> — numbered page controls.
|
|
12
|
+
|
|
13
|
+
Surface / ink (AD-13): a transparent control row tracing its host surface.
|
|
14
|
+
Idle controls take var(--md-sys-color-on-surface-variant) ink; the CURRENT
|
|
15
|
+
page is a coral chip — var(--md-sys-color-primary) fill + var(--md-sys-color-on-primary)
|
|
16
|
+
ink (matched to the coral fill). Hairline 1px borders only (2px is reserved
|
|
17
|
+
for drag-active, not used here). Disabled edges use the shared reduced-
|
|
18
|
+
emphasis treatment — no error color.
|
|
19
|
+
|
|
20
|
+
BEM: block \`pagination\`; elements \`__item\` \`__page\` \`__prev\` \`__next\`
|
|
21
|
+
\`__ellipsis\`; modifiers \`__page--current\`, size \`--xs|sm|md|lg\`.
|
|
22
|
+
============================================ */
|
|
23
|
+
|
|
24
|
+
.pagination {
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: var(--s-1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* ---------- Shared control chrome ---------- */
|
|
31
|
+
.pagination__item {
|
|
32
|
+
appearance: none;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
38
|
+
border-radius: var(--md-sys-shape-corner-button);
|
|
39
|
+
background: transparent;
|
|
40
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
41
|
+
font-family: var(--md-sys-typescale-label-large-font);
|
|
42
|
+
font-weight: 600;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
user-select: none;
|
|
45
|
+
transition:
|
|
46
|
+
background var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
47
|
+
color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
48
|
+
border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard),
|
|
49
|
+
box-shadow var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
|
|
50
|
+
}
|
|
51
|
+
.pagination__item:hover {
|
|
52
|
+
background: color-mix(
|
|
53
|
+
in oklab,
|
|
54
|
+
var(--md-sys-color-on-surface) var(--md-sys-state-hover-state-layer-opacity),
|
|
55
|
+
transparent
|
|
56
|
+
);
|
|
57
|
+
color: var(--md-sys-color-on-surface);
|
|
58
|
+
border-color: var(--md-sys-color-outline);
|
|
59
|
+
}
|
|
60
|
+
.pagination__item:focus {
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
.pagination__item:focus-visible {
|
|
64
|
+
outline: none;
|
|
65
|
+
box-shadow: var(--xm-state-focus-ring);
|
|
66
|
+
}
|
|
67
|
+
.pagination__item svg {
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* ---------- Sizes — one shared control height per size ---------- */
|
|
72
|
+
.pagination--xs .pagination__item { min-width: 22px; height: 22px; padding: 0 var(--s-1); font-size: var(--md-sys-typescale-label-small-size); }
|
|
73
|
+
.pagination--sm .pagination__item { min-width: 26px; height: 26px; padding: 0 var(--s-2); font-size: var(--md-sys-typescale-body-small-size); }
|
|
74
|
+
.pagination--md .pagination__item { min-width: 32px; height: 32px; padding: 0 var(--s-2); font-size: var(--md-sys-typescale-body-medium-size); }
|
|
75
|
+
.pagination--lg .pagination__item { min-width: 42px; height: 42px; padding: 0 var(--s-3); font-size: var(--md-sys-typescale-title-small-size); }
|
|
76
|
+
|
|
77
|
+
/* ---------- Current page — coral chip ----------
|
|
78
|
+
The page digit is text on the coral fill, so it uses --xm-color-primary-fill
|
|
79
|
+
(the darker coral) for WCAG AA, not the lighter --md-sys-color-primary. */
|
|
80
|
+
.pagination__page--current {
|
|
81
|
+
background: var(--xm-color-primary-fill);
|
|
82
|
+
border-color: var(--xm-color-primary-fill);
|
|
83
|
+
color: var(--md-sys-color-on-primary);
|
|
84
|
+
}
|
|
85
|
+
.pagination__page--current:hover {
|
|
86
|
+
background: var(--xm-color-primary-fill);
|
|
87
|
+
border-color: var(--xm-color-primary-fill);
|
|
88
|
+
color: var(--md-sys-color-on-primary);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* ---------- Ellipsis ---------- */
|
|
92
|
+
.pagination__ellipsis {
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
min-width: 24px;
|
|
97
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
98
|
+
user-select: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/* ---------- Disabled edges — shared reduced emphasis ---------- */
|
|
102
|
+
.pagination__item[disabled] {
|
|
103
|
+
cursor: not-allowed;
|
|
104
|
+
color: var(--xm-color-on-surface-disabled);
|
|
105
|
+
box-shadow: none;
|
|
106
|
+
}
|
|
107
|
+
.pagination__item[disabled]:hover {
|
|
108
|
+
background: transparent;
|
|
109
|
+
color: var(--xm-color-on-surface-disabled);
|
|
110
|
+
border-color: var(--md-sys-color-outline-variant);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
}`);
|
|
114
|
+
sheets = [sheet];
|
|
115
|
+
}
|
|
116
|
+
export default sheets;
|
|
@@ -1,7 +1,12 @@
|
|
|
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 xm-popover-close - Fired when the popover closes.
|
|
6
|
+
* @fires xm-popover-open - Fired when the popover opens.
|
|
7
|
+
*/
|
|
4
8
|
export declare class XmPopover extends LitElement {
|
|
9
|
+
static styles: CSSStyleSheet[];
|
|
5
10
|
open: boolean;
|
|
6
11
|
placement: OverlayPlacement;
|
|
7
12
|
label: string;
|