@ds-gn/ui 0.0.0-stage → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +155 -2
- package/THIRD_PARTY_NOTICES +167 -0
- package/assets/logo-full-dark.svg +4 -0
- package/assets/logo-full.svg +4 -0
- package/assets/logo-mark.svg +3 -0
- package/custom-elements.json +4696 -0
- package/dist/common/Base/Base.d.ts +22 -0
- package/dist/common/controllers/AuroraMeshController.d.ts +68 -0
- package/dist/common/controllers/AutoRotateController.d.ts +38 -0
- package/dist/common/controllers/BreakpointController.d.ts +30 -0
- package/dist/common/controllers/LayoutChangeController.d.ts +28 -0
- package/dist/common/controllers/WordCycleController.d.ts +36 -0
- package/dist/common/helpers/aurora-mesh.d.ts +11 -0
- package/dist/common/helpers/define-element.d.ts +14 -0
- package/dist/common/helpers/enum-creator.d.ts +2 -0
- package/dist/common/helpers/enum-validator.d.ts +1 -0
- package/dist/common/helpers/layout-change.d.ts +39 -0
- package/dist/common/helpers/layout-change.testing.d.ts +15 -0
- package/dist/common/helpers/logo.string.d.ts +23 -0
- package/dist/common/helpers/logo.string.js +43 -0
- package/dist/common/helpers/logo.utils.d.ts +8 -0
- package/dist/common/helpers/motion.d.ts +9 -0
- package/dist/common/helpers/story.utils.d.ts +32 -0
- package/dist/common/props/surface/surface.props.d.ts +6 -0
- package/dist/components/Background/src/Background.d.ts +44 -0
- package/dist/components/Background/src/Background.js +576 -0
- package/dist/components/Background/src/Background.props.d.ts +20 -0
- package/dist/components/Background/src/Background.props.js +47 -0
- package/dist/components/Background/src/Background.styles.d.ts +3 -0
- package/dist/components/Badge/src/Badge.d.ts +28 -0
- package/dist/components/Badge/src/Badge.js +429 -0
- package/dist/components/Badge/src/Badge.playground.d.ts +2 -0
- package/dist/components/Badge/src/Badge.props.d.ts +16 -0
- package/dist/components/Badge/src/Badge.props.js +44 -0
- package/dist/components/Badge/src/Badge.styles.d.ts +2 -0
- package/dist/components/Button/src/Button.d.ts +138 -0
- package/dist/components/Button/src/Button.js +1102 -0
- package/dist/components/Button/src/Button.playground.d.ts +2 -0
- package/dist/components/Button/src/Button.props.d.ts +47 -0
- package/dist/components/Button/src/Button.props.js +79 -0
- package/dist/components/Button/src/Button.styles.d.ts +11 -0
- package/dist/components/Card/src/Card.d.ts +39 -0
- package/dist/components/Card/src/Card.js +564 -0
- package/dist/components/Card/src/Card.playground.d.ts +2 -0
- package/dist/components/Card/src/Card.props.d.ts +22 -0
- package/dist/components/Card/src/Card.props.js +42 -0
- package/dist/components/Card/src/Card.styles.d.ts +11 -0
- package/dist/components/CodeBlock/src/CodeBlock.d.ts +18 -0
- package/dist/components/CodeBlock/src/CodeBlock.js +372 -0
- package/dist/components/CodeBlock/src/CodeBlock.props.d.ts +1 -0
- package/dist/components/CodeBlock/src/CodeBlock.props.js +5 -0
- package/dist/components/CodeBlock/src/CodeBlock.styles.d.ts +9 -0
- package/dist/components/Container/src/Container.d.ts +26 -0
- package/dist/components/Container/src/Container.js +354 -0
- package/dist/components/Container/src/Container.props.d.ts +20 -0
- package/dist/components/Container/src/Container.props.js +49 -0
- package/dist/components/Container/src/Container.styles.d.ts +2 -0
- package/dist/components/Divider/src/Divider.d.ts +23 -0
- package/dist/components/Divider/src/Divider.js +250 -0
- package/dist/components/Divider/src/Divider.props.d.ts +7 -0
- package/dist/components/Divider/src/Divider.props.js +34 -0
- package/dist/components/Divider/src/Divider.styles.d.ts +2 -0
- package/dist/components/FeatureItem/src/FeatureItem.d.ts +30 -0
- package/dist/components/FeatureItem/src/FeatureItem.js +368 -0
- package/dist/components/FeatureItem/src/FeatureItem.props.d.ts +10 -0
- package/dist/components/FeatureItem/src/FeatureItem.props.js +37 -0
- package/dist/components/FeatureItem/src/FeatureItem.styles.d.ts +3 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.d.ts +48 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.js +1333 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.props.d.ts +27 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.props.js +80 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.styles.d.ts +35 -0
- package/dist/components/Footer/src/Footer.d.ts +39 -0
- package/dist/components/Footer/src/Footer.js +361 -0
- package/dist/components/Footer/src/Footer.styles.d.ts +6 -0
- package/dist/components/FormBlock/src/FormBlock.d.ts +40 -0
- package/dist/components/FormBlock/src/FormBlock.js +476 -0
- package/dist/components/FormBlock/src/FormBlock.props.d.ts +5 -0
- package/dist/components/FormBlock/src/FormBlock.props.js +8 -0
- package/dist/components/FormBlock/src/FormBlock.styles.d.ts +6 -0
- package/dist/components/Grid/src/Grid.d.ts +35 -0
- package/dist/components/Grid/src/Grid.js +381 -0
- package/dist/components/Grid/src/Grid.props.d.ts +28 -0
- package/dist/components/Grid/src/Grid.props.js +57 -0
- package/dist/components/Grid/src/Grid.styles.d.ts +3 -0
- package/dist/components/Heading/src/Heading.d.ts +26 -0
- package/dist/components/Heading/src/Heading.js +755 -0
- package/dist/components/Heading/src/Heading.playground.d.ts +2 -0
- package/dist/components/Heading/src/Heading.props.d.ts +19 -0
- package/dist/components/Heading/src/Heading.props.js +47 -0
- package/dist/components/Heading/src/Heading.styles.d.ts +4 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.d.ts +28 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.js +288 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.playground.d.ts +2 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.props.d.ts +6 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.props.js +33 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.styles.d.ts +2 -0
- package/dist/components/Hero/src/Hero.d.ts +42 -0
- package/dist/components/Hero/src/Hero.js +506 -0
- package/dist/components/Hero/src/Hero.props.d.ts +22 -0
- package/dist/components/Hero/src/Hero.props.js +51 -0
- package/dist/components/Hero/src/Hero.styles.d.ts +10 -0
- package/dist/components/Icon/src/Icon.d.ts +67 -0
- package/dist/components/Icon/src/Icon.js +303 -0
- package/dist/components/Icon/src/Icon.props.d.ts +8 -0
- package/dist/components/Icon/src/Icon.props.js +35 -0
- package/dist/components/Icon/src/Icon.styles.d.ts +3 -0
- package/dist/components/Icon/src/icons/arrow-left.d.ts +1 -0
- package/dist/components/Icon/src/icons/arrow-left.js +6 -0
- package/dist/components/Icon/src/icons/arrow-right.d.ts +1 -0
- package/dist/components/Icon/src/icons/arrow-right.js +6 -0
- package/dist/components/Icon/src/icons/calendar.d.ts +1 -0
- package/dist/components/Icon/src/icons/calendar.js +6 -0
- package/dist/components/Icon/src/icons/check.d.ts +1 -0
- package/dist/components/Icon/src/icons/check.js +6 -0
- package/dist/components/Icon/src/icons/chevron-down.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevron-down.js +6 -0
- package/dist/components/Icon/src/icons/chevron-left.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevron-left.js +6 -0
- package/dist/components/Icon/src/icons/chevron-right.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevron-right.js +6 -0
- package/dist/components/Icon/src/icons/chevron-up.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevron-up.js +6 -0
- package/dist/components/Icon/src/icons/circle-alert.d.ts +1 -0
- package/dist/components/Icon/src/icons/circle-alert.js +6 -0
- package/dist/components/Icon/src/icons/circle-check.d.ts +1 -0
- package/dist/components/Icon/src/icons/circle-check.js +6 -0
- package/dist/components/Icon/src/icons/circle-x.d.ts +1 -0
- package/dist/components/Icon/src/icons/circle-x.js +6 -0
- package/dist/components/Icon/src/icons/copy.d.ts +1 -0
- package/dist/components/Icon/src/icons/copy.js +6 -0
- package/dist/components/Icon/src/icons/download.d.ts +1 -0
- package/dist/components/Icon/src/icons/download.js +6 -0
- package/dist/components/Icon/src/icons/ellipsis-vertical.d.ts +1 -0
- package/dist/components/Icon/src/icons/ellipsis-vertical.js +6 -0
- package/dist/components/Icon/src/icons/ellipsis.d.ts +1 -0
- package/dist/components/Icon/src/icons/ellipsis.js +6 -0
- package/dist/components/Icon/src/icons/external-link.d.ts +1 -0
- package/dist/components/Icon/src/icons/external-link.js +6 -0
- package/dist/components/Icon/src/icons/eye-off.d.ts +1 -0
- package/dist/components/Icon/src/icons/eye-off.js +6 -0
- package/dist/components/Icon/src/icons/eye.d.ts +1 -0
- package/dist/components/Icon/src/icons/eye.js +6 -0
- package/dist/components/Icon/src/icons/icon-names.d.ts +2 -0
- package/dist/components/Icon/src/icons/icon-names.js +36 -0
- package/dist/components/Icon/src/icons/index.d.ts +34 -0
- package/dist/components/Icon/src/icons/index.js +35 -0
- package/dist/components/Icon/src/icons/info.d.ts +1 -0
- package/dist/components/Icon/src/icons/info.js +6 -0
- package/dist/components/Icon/src/icons/loader.d.ts +1 -0
- package/dist/components/Icon/src/icons/loader.js +6 -0
- package/dist/components/Icon/src/icons/mail.d.ts +1 -0
- package/dist/components/Icon/src/icons/mail.js +6 -0
- package/dist/components/Icon/src/icons/menu.d.ts +1 -0
- package/dist/components/Icon/src/icons/menu.js +6 -0
- package/dist/components/Icon/src/icons/minus.d.ts +1 -0
- package/dist/components/Icon/src/icons/minus.js +6 -0
- package/dist/components/Icon/src/icons/pencil.d.ts +1 -0
- package/dist/components/Icon/src/icons/pencil.js +6 -0
- package/dist/components/Icon/src/icons/plus.d.ts +1 -0
- package/dist/components/Icon/src/icons/plus.js +6 -0
- package/dist/components/Icon/src/icons/search.d.ts +1 -0
- package/dist/components/Icon/src/icons/search.js +6 -0
- package/dist/components/Icon/src/icons/settings.d.ts +1 -0
- package/dist/components/Icon/src/icons/settings.js +6 -0
- package/dist/components/Icon/src/icons/trash-2.d.ts +1 -0
- package/dist/components/Icon/src/icons/trash-2.js +6 -0
- package/dist/components/Icon/src/icons/triangle-alert.d.ts +1 -0
- package/dist/components/Icon/src/icons/triangle-alert.js +6 -0
- package/dist/components/Icon/src/icons/upload.d.ts +1 -0
- package/dist/components/Icon/src/icons/upload.js +6 -0
- package/dist/components/Icon/src/icons/user.d.ts +1 -0
- package/dist/components/Icon/src/icons/user.js +6 -0
- package/dist/components/Icon/src/icons/x.d.ts +1 -0
- package/dist/components/Icon/src/icons/x.js +6 -0
- package/dist/components/Image/src/Image.d.ts +76 -0
- package/dist/components/Image/src/Image.js +456 -0
- package/dist/components/Image/src/Image.props.d.ts +35 -0
- package/dist/components/Image/src/Image.props.js +65 -0
- package/dist/components/Image/src/Image.styles.d.ts +4 -0
- package/dist/components/Input/src/Input.d.ts +60 -0
- package/dist/components/Input/src/Input.js +648 -0
- package/dist/components/Input/src/Input.playground.d.ts +2 -0
- package/dist/components/Input/src/Input.props.d.ts +13 -0
- package/dist/components/Input/src/Input.props.js +41 -0
- package/dist/components/Input/src/Input.styles.d.ts +6 -0
- package/dist/components/Modal/src/Modal.d.ts +166 -0
- package/dist/components/Modal/src/Modal.js +1434 -0
- package/dist/components/Modal/src/Modal.playground.d.ts +2 -0
- package/dist/components/Modal/src/Modal.props.d.ts +66 -0
- package/dist/components/Modal/src/Modal.props.js +65 -0
- package/dist/components/Modal/src/Modal.styles.d.ts +29 -0
- package/dist/components/Nav/src/Nav.d.ts +66 -0
- package/dist/components/Nav/src/Nav.js +750 -0
- package/dist/components/Nav/src/Nav.props.d.ts +8 -0
- package/dist/components/Nav/src/Nav.props.js +13 -0
- package/dist/components/Nav/src/Nav.styles.d.ts +10 -0
- package/dist/components/NavDropdownColumn/src/NavDropdownColumn.d.ts +17 -0
- package/dist/components/NavDropdownColumn/src/NavDropdownColumn.js +170 -0
- package/dist/components/NavDropdownColumn/src/NavDropdownColumn.styles.d.ts +1 -0
- package/dist/components/NavLink/src/NavLink.d.ts +191 -0
- package/dist/components/NavLink/src/NavLink.js +1916 -0
- package/dist/components/NavLink/src/NavLink.props.d.ts +38 -0
- package/dist/components/NavLink/src/NavLink.props.js +58 -0
- package/dist/components/NavLink/src/NavLink.styles.d.ts +22 -0
- package/dist/components/Stack/src/Stack.d.ts +30 -0
- package/dist/components/Stack/src/Stack.js +300 -0
- package/dist/components/Stack/src/Stack.props.d.ts +24 -0
- package/dist/components/Stack/src/Stack.props.js +53 -0
- package/dist/components/Stack/src/Stack.styles.d.ts +2 -0
- package/dist/components/Text/src/Text.d.ts +32 -0
- package/dist/components/Text/src/Text.js +327 -0
- package/dist/components/Text/src/Text.props.d.ts +23 -0
- package/dist/components/Text/src/Text.props.js +52 -0
- package/dist/components/Text/src/Text.styles.d.ts +2 -0
- package/dist/playground/types.d.ts +29 -0
- package/dist/playground-manifest.d.ts +6 -0
- package/dist/playground-manifest.js +556 -0
- package/dist/react/Background.d.ts +6 -0
- package/dist/react/Background.js +13 -0
- package/dist/react/Badge.d.ts +6 -0
- package/dist/react/Badge.js +13 -0
- package/dist/react/Button.d.ts +6 -0
- package/dist/react/Button.js +13 -0
- package/dist/react/Card.d.ts +6 -0
- package/dist/react/Card.js +13 -0
- package/dist/react/CodeBlock.d.ts +6 -0
- package/dist/react/CodeBlock.js +13 -0
- package/dist/react/Container.d.ts +6 -0
- package/dist/react/Container.js +13 -0
- package/dist/react/Divider.d.ts +6 -0
- package/dist/react/Divider.js +13 -0
- package/dist/react/FeatureItem.d.ts +6 -0
- package/dist/react/FeatureItem.js +13 -0
- package/dist/react/FeatureTabs.d.ts +6 -0
- package/dist/react/FeatureTabs.js +13 -0
- package/dist/react/Footer.d.ts +6 -0
- package/dist/react/Footer.js +13 -0
- package/dist/react/FormBlock.d.ts +6 -0
- package/dist/react/FormBlock.js +13 -0
- package/dist/react/Grid.d.ts +6 -0
- package/dist/react/Grid.js +13 -0
- package/dist/react/Heading.d.ts +6 -0
- package/dist/react/Heading.js +13 -0
- package/dist/react/HeadingBlock.d.ts +6 -0
- package/dist/react/HeadingBlock.js +13 -0
- package/dist/react/Hero.d.ts +6 -0
- package/dist/react/Hero.js +13 -0
- package/dist/react/Icon.d.ts +6 -0
- package/dist/react/Icon.js +13 -0
- package/dist/react/Image.d.ts +8 -0
- package/dist/react/Image.js +13 -0
- package/dist/react/Input.d.ts +8 -0
- package/dist/react/Input.js +13 -0
- package/dist/react/Modal.d.ts +10 -0
- package/dist/react/Modal.js +17 -0
- package/dist/react/Nav.d.ts +6 -0
- package/dist/react/Nav.js +13 -0
- package/dist/react/NavDropdownColumn.d.ts +6 -0
- package/dist/react/NavDropdownColumn.js +13 -0
- package/dist/react/NavLink.d.ts +8 -0
- package/dist/react/NavLink.js +13 -0
- package/dist/react/Stack.d.ts +6 -0
- package/dist/react/Stack.js +13 -0
- package/dist/react/Text.d.ts +6 -0
- package/dist/react/Text.js +13 -0
- package/dist/react/index.d.ts +24 -0
- package/dist/react/index.js +25 -0
- package/dist/surface/surface.props.js +33 -0
- package/package.json +352 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import '../../types/global.d.ts';
|
|
2
|
+
import { type CSSResultGroup, LitElement } from 'lit';
|
|
3
|
+
export declare class Base extends LitElement {
|
|
4
|
+
static styles: CSSResultGroup;
|
|
5
|
+
protected updateTheme(changedProperties: Map<string | number | symbol, unknown>, surface: string | undefined): void;
|
|
6
|
+
/**
|
|
7
|
+
* Dispatch a namespaced custom event. The `dsgn-` prefix is enforced at compile
|
|
8
|
+
* time, and the event always bubbles and is `composed` — so it crosses the
|
|
9
|
+
* shadow boundary and reliably reaches consumers and the React wrappers.
|
|
10
|
+
*
|
|
11
|
+
* Because the dispatch goes through this helper, the CEM analyzer can't see
|
|
12
|
+
* the event statically — declare it with a `@fires dsgn-…` JSDoc on the class
|
|
13
|
+
* so it lands in the manifest and the generated wrapper's `on<Event>` prop.
|
|
14
|
+
*
|
|
15
|
+
* Pass `{ cancelable: true }` for an event a consumer is allowed to veto with
|
|
16
|
+
* `preventDefault()`; the return value is then `false` when it was vetoed.
|
|
17
|
+
*/
|
|
18
|
+
protected emit<T = unknown>(name: `dsgn-${string}`, detail?: T, options?: {
|
|
19
|
+
cancelable?: boolean;
|
|
20
|
+
}): boolean;
|
|
21
|
+
render(): import("lit").TemplateResult<1>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/** Per-blob configuration: how big, how bright, and how often it re-targets. */
|
|
3
|
+
export interface AuroraBlobConfig {
|
|
4
|
+
minSize: number;
|
|
5
|
+
maxSize: number;
|
|
6
|
+
minOpacity: number;
|
|
7
|
+
maxOpacity: number;
|
|
8
|
+
/** Milliseconds between random re-targets. */
|
|
9
|
+
interval: number;
|
|
10
|
+
/** CSS transition duration; defaults to `interval × TRANSITION_RATIO`. */
|
|
11
|
+
transitionMs?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Current rendered state of a single blob (read by `renderAuroraMesh`). */
|
|
14
|
+
export interface AuroraBlobState {
|
|
15
|
+
/** Horizontal centre, % across the host. */
|
|
16
|
+
x: number;
|
|
17
|
+
/** Vertical centre, % down the host. */
|
|
18
|
+
y: number;
|
|
19
|
+
/** Width in px (height is derived in the render helper). */
|
|
20
|
+
size: number;
|
|
21
|
+
opacity: number;
|
|
22
|
+
transitionMs: number;
|
|
23
|
+
}
|
|
24
|
+
export interface AuroraMeshOptions {
|
|
25
|
+
/** Override the default three-blob recipe. */
|
|
26
|
+
blobs?: AuroraBlobConfig[];
|
|
27
|
+
/** Multiplies every blob's opacity (drives the `intensity` prop). */
|
|
28
|
+
opacityScale?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare const DEFAULT_AURORA_BLOBS: AuroraBlobConfig[];
|
|
31
|
+
/**
|
|
32
|
+
* Drives an "aurora mesh" of blurred colour blobs that drift behind content,
|
|
33
|
+
* each independently re-randomising position, size, and opacity on its own
|
|
34
|
+
* timer. CSS transitions animate the moves; this controller only flips state
|
|
35
|
+
* and asks the host to re-render.
|
|
36
|
+
*
|
|
37
|
+
* Mirrors AutoRotateController's gating: the host injects a `canRun` predicate
|
|
38
|
+
* for contextual gates (e.g. "is the host in the viewport?"), while intrinsic
|
|
39
|
+
* gates — `paused` and `prefers-reduced-motion` — are owned here. A single
|
|
40
|
+
* `hostUpdated()` chokepoint reconciles the timers against the gate after every
|
|
41
|
+
* host update, including the updates an IntersectionController pushes when the
|
|
42
|
+
* predicate flips. Under reduced motion the blobs hold their initial random
|
|
43
|
+
* positions (a still, visible glow) rather than animating.
|
|
44
|
+
*/
|
|
45
|
+
export declare class AuroraMeshController implements ReactiveController {
|
|
46
|
+
private host;
|
|
47
|
+
private _configs;
|
|
48
|
+
private _canRun;
|
|
49
|
+
private _opacityScale;
|
|
50
|
+
private _timers;
|
|
51
|
+
private _states;
|
|
52
|
+
paused: boolean;
|
|
53
|
+
/** Current blob states for the render helper to read. */
|
|
54
|
+
get blobs(): readonly AuroraBlobState[];
|
|
55
|
+
get running(): boolean;
|
|
56
|
+
constructor(host: ReactiveControllerHost, options?: AuroraMeshOptions, canRun?: () => boolean);
|
|
57
|
+
hostDisconnected(): void;
|
|
58
|
+
hostUpdated(): void;
|
|
59
|
+
/** Rescale opacity in place (used by the host's `intensity` prop). */
|
|
60
|
+
setOpacityScale(scale: number): void;
|
|
61
|
+
pause(): void;
|
|
62
|
+
resume(): void;
|
|
63
|
+
private get _allowed();
|
|
64
|
+
private _reconcile;
|
|
65
|
+
private _randomState;
|
|
66
|
+
private _startAll;
|
|
67
|
+
private _stopAll;
|
|
68
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Drives auto-rotating, timer-based content (active index + progress).
|
|
4
|
+
*
|
|
5
|
+
* The controller is decoupled from *where* it lives: the host injects a
|
|
6
|
+
* `canRun` predicate for contextual gates (e.g. "is the host in the
|
|
7
|
+
* viewport?"). Intrinsic motion gates — `paused` and the user's
|
|
8
|
+
* `prefers-reduced-motion` preference — are owned by the controller itself.
|
|
9
|
+
* Whenever the host updates — including updates the host's own observers push
|
|
10
|
+
* when the predicate flips — `hostUpdated()` reconciles the timer against the
|
|
11
|
+
* gate. Navigation and duration changes additionally re-time the running
|
|
12
|
+
* interval from now.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AutoRotateController implements ReactiveController {
|
|
15
|
+
private host;
|
|
16
|
+
private _duration;
|
|
17
|
+
private _canRun;
|
|
18
|
+
private _timerId;
|
|
19
|
+
private _startedAt;
|
|
20
|
+
private _itemCount;
|
|
21
|
+
activeIndex: number;
|
|
22
|
+
progress: number;
|
|
23
|
+
paused: boolean;
|
|
24
|
+
get running(): boolean;
|
|
25
|
+
constructor(host: ReactiveControllerHost, duration?: number, canRun?: () => boolean);
|
|
26
|
+
hostDisconnected(): void;
|
|
27
|
+
hostUpdated(): void;
|
|
28
|
+
setDuration(ms: number): void;
|
|
29
|
+
goTo(index: number): void;
|
|
30
|
+
pause(): void;
|
|
31
|
+
resume(itemCount: number): void;
|
|
32
|
+
next(itemCount: number): void;
|
|
33
|
+
private get _allowed();
|
|
34
|
+
private _reconcile;
|
|
35
|
+
private _retime;
|
|
36
|
+
private _startTimer;
|
|
37
|
+
private _stopTimer;
|
|
38
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
3
|
+
export interface BreakpointConfig {
|
|
4
|
+
name: Breakpoint;
|
|
5
|
+
cssVarName: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class BreakpointController implements ReactiveController {
|
|
8
|
+
private host;
|
|
9
|
+
private registry;
|
|
10
|
+
private mediaQueryLists;
|
|
11
|
+
private _currentBreakpoint;
|
|
12
|
+
private _initialized;
|
|
13
|
+
constructor(host: ReactiveControllerHost);
|
|
14
|
+
hostConnected(): void;
|
|
15
|
+
private initializeBreakpoints;
|
|
16
|
+
hostDisconnected(): void;
|
|
17
|
+
private handleBreakpointChange;
|
|
18
|
+
/** Get current breakpoint */
|
|
19
|
+
get current(): Breakpoint;
|
|
20
|
+
/** Check if current breakpoint matches */
|
|
21
|
+
is(breakpoint: Breakpoint): boolean;
|
|
22
|
+
/** Check if current breakpoint is at least the given size */
|
|
23
|
+
isAtLeast(breakpoint: Breakpoint): boolean;
|
|
24
|
+
/** Check if current breakpoint is at most the given size */
|
|
25
|
+
isAtMost(breakpoint: Breakpoint): boolean;
|
|
26
|
+
/** Check if current breakpoint is between two sizes (inclusive) */
|
|
27
|
+
isBetween(min: Breakpoint, max: Breakpoint): boolean;
|
|
28
|
+
/** Get breakpoint value (useful for debugging) */
|
|
29
|
+
getBreakpointValue(breakpoint: Breakpoint): string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Subscribes a host to layout changes around it for as long as it asks to be
|
|
4
|
+
* subscribed, over the shared observer in `helpers/layout-change.ts`. See that
|
|
5
|
+
* module for what is and is not covered.
|
|
6
|
+
*
|
|
7
|
+
* The subscription is *conditional* — a dropdown only needs it while its panel
|
|
8
|
+
* is open — so this is `observe()`/`unobserve()` rather than something driven
|
|
9
|
+
* purely by the host's connected state. Connection is still tracked underneath:
|
|
10
|
+
* a host moved in the DOM while observing resubscribes on reconnect, which a
|
|
11
|
+
* listener added from `updated()` cannot do (the property change that started
|
|
12
|
+
* it does not repeat).
|
|
13
|
+
*/
|
|
14
|
+
export declare class LayoutChangeController implements ReactiveController {
|
|
15
|
+
private host;
|
|
16
|
+
private onLayoutChange;
|
|
17
|
+
private unsubscribe?;
|
|
18
|
+
private wantsUpdates;
|
|
19
|
+
constructor(host: ReactiveControllerHost & Element, onLayoutChange: () => void);
|
|
20
|
+
/** Start receiving layout changes. Idempotent. */
|
|
21
|
+
observe(): void;
|
|
22
|
+
/** Stop receiving layout changes. Idempotent. */
|
|
23
|
+
unobserve(): void;
|
|
24
|
+
hostConnected(): void;
|
|
25
|
+
hostDisconnected(): void;
|
|
26
|
+
private subscribe;
|
|
27
|
+
private clear;
|
|
28
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Cycles through a list of words on an interval, stopping after a configured
|
|
4
|
+
* number of full cycles.
|
|
5
|
+
*
|
|
6
|
+
* Like AutoRotateController, the host injects a `canRun` predicate for
|
|
7
|
+
* contextual gates (e.g. "is the host in the viewport?"), while the
|
|
8
|
+
* `prefers-reduced-motion` preference is gated by the controller itself. The
|
|
9
|
+
* timer is reconciled against that gate on every host update via
|
|
10
|
+
* `hostUpdated()`, so the cycle pauses while the host is off-screen and
|
|
11
|
+
* resumes when it returns (unless it has already finished its cycles).
|
|
12
|
+
*/
|
|
13
|
+
export declare class WordCycleController implements ReactiveController {
|
|
14
|
+
private host;
|
|
15
|
+
private _words;
|
|
16
|
+
private _interval;
|
|
17
|
+
private _currentIndex;
|
|
18
|
+
private _timerId;
|
|
19
|
+
private _cycles;
|
|
20
|
+
private _completedCycles;
|
|
21
|
+
private _done;
|
|
22
|
+
private _canRun;
|
|
23
|
+
constructor(host: ReactiveControllerHost, words?: string[], interval?: number, canRun?: () => boolean);
|
|
24
|
+
hostDisconnected(): void;
|
|
25
|
+
hostUpdated(): void;
|
|
26
|
+
private get _allowed();
|
|
27
|
+
private _reconcile;
|
|
28
|
+
private _startCycling;
|
|
29
|
+
private _stopCycling;
|
|
30
|
+
private _restart;
|
|
31
|
+
get currentWord(): string | undefined;
|
|
32
|
+
get currentIndex(): number;
|
|
33
|
+
setWords(words: string[]): void;
|
|
34
|
+
setInterval(ms: number): void;
|
|
35
|
+
setCycles(cycles: number): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
import type { AuroraBlobState, AuroraMeshController } from '../controllers/AuroraMeshController.js';
|
|
3
|
+
/** Inline style for a single drifting blob. */
|
|
4
|
+
export declare const blobStyle: (b: AuroraBlobState) => Record<string, string>;
|
|
5
|
+
export declare const driftStyle: (b: AuroraBlobState) => Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* Renders the aurora mesh layer for a host using an {@link AuroraMeshController}.
|
|
8
|
+
* Drop into any component's template behind its content; the host owns the
|
|
9
|
+
* positioning context (`position: relative`) and stacks content above it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const renderAuroraMesh: (controller: AuroraMeshController) => TemplateResult;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers a custom element, safely across runtimes.
|
|
3
|
+
*
|
|
4
|
+
* On a server runtime that has no DOM (e.g. Node during SSR), `customElements`
|
|
5
|
+
* is `undefined`; touching it at module-evaluation time throws a
|
|
6
|
+
* `ReferenceError`. Importing an element module must stay side-effect-safe so
|
|
7
|
+
* that the React wrappers in `@ds-gn/ui/react` can be imported during a
|
|
8
|
+
* Node SSR render without crashing — the element upgrades client-side once the
|
|
9
|
+
* registry exists. See `packages/ui/CLAUDE.md` (React wrappers / SSR contract).
|
|
10
|
+
*
|
|
11
|
+
* In the browser (and Happy DOM tests) the registry exists, so this behaves
|
|
12
|
+
* exactly like the previous inline guard: define once, never double-register.
|
|
13
|
+
*/
|
|
14
|
+
export declare const defineElement: (tag: string, ctor: CustomElementConstructor) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const enumValidator: <T>(propName: string, enumSet: Set<T>, candidateValue: T) => void;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single, shared ResizeObserver for components that position themselves
|
|
3
|
+
* against the space around them — anchored dropdown panels, popovers.
|
|
4
|
+
*
|
|
5
|
+
* It watches two things: the document element, whose width changes on window
|
|
6
|
+
* resize, zoom, and a scrollbar appearing; and each subscriber's own element,
|
|
7
|
+
* whose box changes when its content reflows (a late font swap widening a
|
|
8
|
+
* label, a container query restyling it).
|
|
9
|
+
*
|
|
10
|
+
* ## What this does NOT catch
|
|
11
|
+
*
|
|
12
|
+
* A **pure position change** — the element moving with no box, anywhere,
|
|
13
|
+
* changing size. The clearest case is a consumer's split pane: dragging the
|
|
14
|
+
* divider narrows the region the component sits in, so the component shifts
|
|
15
|
+
* left, while the window never resizes and the document element keeps its
|
|
16
|
+
* width. Sibling content reflowing a row does the same thing.
|
|
17
|
+
*
|
|
18
|
+
* Nothing observable fires for that. Catching it means polling
|
|
19
|
+
* `getBoundingClientRect` on an animation frame, which is why floating-ui ships
|
|
20
|
+
* the equivalent (`autoUpdate({ animationFrame: true })`) as opt-in rather than
|
|
21
|
+
* the default — it is a layout read every frame for the whole time a panel is
|
|
22
|
+
* open. Not worth it until a real case asks for it; the subscriber can also
|
|
23
|
+
* register an ancestor whose box *does* change to cover most of it.
|
|
24
|
+
*
|
|
25
|
+
* Observing the subscriber's element alone would not be enough either: a
|
|
26
|
+
* fixed-width trigger keeps its box at every viewport width and merely moves,
|
|
27
|
+
* which is the case that broke anchored nav dropdowns in the first place.
|
|
28
|
+
*
|
|
29
|
+
* One observer serves every subscriber. It is created on the first subscription
|
|
30
|
+
* and disconnected when the last one leaves, so a page with nothing open is not
|
|
31
|
+
* paying for an idle observer.
|
|
32
|
+
*/
|
|
33
|
+
type LayoutChangeListener = () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Call `listener` when the document width changes, or when `target`'s own box
|
|
36
|
+
* does. Returns an unsubscribe function; calling it more than once is safe.
|
|
37
|
+
*/
|
|
38
|
+
export declare const observeLayoutChanges: (target: Element, listener: LayoutChangeListener) => (() => void);
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only driver for the ResizeObserver stub installed by `happydom.js`.
|
|
3
|
+
*
|
|
4
|
+
* Not imported by any component, so it never reaches `dist/` or the published
|
|
5
|
+
* package. Lives here rather than in one component's tests because every
|
|
6
|
+
* component that uses `LayoutChangeController` needs the same hooks.
|
|
7
|
+
*/
|
|
8
|
+
/** How many observers are currently observing something. */
|
|
9
|
+
export declare const layoutObserverCount: () => number;
|
|
10
|
+
/** Every element currently observed, across all observers. */
|
|
11
|
+
export declare const observedTargets: () => Element[];
|
|
12
|
+
/** Deliver a document-width change. */
|
|
13
|
+
export declare const emitViewportResize: (width: number) => void;
|
|
14
|
+
/** Deliver a size change for one observed element. */
|
|
15
|
+
export declare const emitElementResize: (target: Element, width: number) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-provided DS/GN artwork. Lettering inherits the foreground color so the
|
|
3
|
+
* same outlined paths work on light and dark surfaces; the slash stays orange.
|
|
4
|
+
* Framework-neutral and safe to import during server rendering.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getLogoSvg: (color?: string) => string;
|
|
7
|
+
/** The orange slash from the supplied artwork, centered in a square. */
|
|
8
|
+
export declare const getLogoMarkSvg: () => string;
|
|
9
|
+
export declare const logoVariants: {
|
|
10
|
+
readonly FULL: "full";
|
|
11
|
+
readonly MARK: "mark";
|
|
12
|
+
};
|
|
13
|
+
export type LogoVariant = (typeof logoVariants)[keyof typeof logoVariants];
|
|
14
|
+
export interface LogoHtmlOptions {
|
|
15
|
+
color?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
markHtml?: string;
|
|
18
|
+
size?: number;
|
|
19
|
+
variant?: LogoVariant;
|
|
20
|
+
wordmarkHtml?: string;
|
|
21
|
+
}
|
|
22
|
+
/** Renders the supplied logo with an accessible name and configurable height. */
|
|
23
|
+
export declare const getLogoHtml: ({ color, label, markHtml, size, variant, wordmarkHtml, }?: LogoHtmlOptions) => string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// common/helpers/logo.string.ts
|
|
2
|
+
var getLogoSvg = (color = "currentColor") => `
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="101" height="24"
|
|
4
|
+
viewBox="0 0 3299 782" style="display:block;color:${color}"
|
|
5
|
+
role="img" aria-label="DS-GN" focusable="false">
|
|
6
|
+
<path fill="currentColor" d="M74.00 701.00L74.00 566.00L245.00 566.00Q283.00 566.00 315.50 550.00Q348.00 534.00 368.00 492.50Q388.00 451.00 388.00 373.00Q388.00 317.00 377.00 279.00Q366.00 241.00 345.50 218.50Q325.00 196.00 295.50 186.00Q266.00 176.00 228.00 176.00L74.00 176.00L74.00 41.00L221.00 41.00Q338.00 41.00 412.00 80.00Q486.00 119.00 521.00 191.50Q556.00 264.00 556.00 365.00Q556.00 443.00 538.50 500.00Q521.00 557.00 490.00 596.00Q459.00 635.00 420.00 658.00Q381.00 681.00 337.00 691.00Q293.00 701.00 250.00 701.00ZM0.00 701.00L0.00 41.00L162.00 41.00L162.00 701.00ZM888.00 715.00Q818.00 715.00 765.50 699.00Q713.00 683.00 678.00 653.00Q643.00 623.00 626.50 580.50Q610.00 538.00 612.00 486.00L762.00 453.00Q764.00 499.00 781.50 527.50Q799.00 556.00 829.00 569.50Q859.00 583.00 896.00 583.00Q926.00 583.00 949.00 575.50Q972.00 568.00 985.50 554.50Q999.00 541.00 999.00 523.00Q999.00 499.00 981.00 483.50Q963.00 468.00 931.50 457.00Q900.00 446.00 860.00 435.00Q817.00 423.00 774.50 408.50Q732.00 394.00 697.00 372.00Q662.00 350.00 640.50 315.00Q619.00 280.00 619.00 228.00Q619.00 164.00 651.50 119.00Q684.00 74.00 741.50 50.50Q799.00 27.00 873.00 27.00Q951.00 27.00 1012.00 53.50Q1073.00 80.00 1106.00 131.00Q1139.00 182.00 1132.00 256.00L984.00 280.00Q985.00 250.00 978.00 227.00Q971.00 204.00 956.50 188.00Q942.00 172.00 920.00 163.50Q898.00 155.00 868.00 155.00Q837.00 155.00 816.50 163.00Q796.00 171.00 785.50 185.00Q775.00 199.00 775.00 217.00Q775.00 238.00 791.00 252.00Q807.00 266.00 837.00 276.50Q867.00 287.00 908.00 298.00Q951.00 310.00 994.50 324.50Q1038.00 339.00 1075.00 362.50Q1112.00 386.00 1134.50 423.00Q1157.00 460.00 1157.00 517.00Q1157.00 583.00 1122.50 627.00Q1088.00 671.00 1027.50 693.00Q967.00 715.00 888.00 715.00ZM1895.00 715.00Q1809.00 715.00 1747.50 672.00Q1686.00 629.00 1653.50 552.50Q1621.00 476.00 1621.00 376.00Q1621.00 302.00 1639.50 238.50Q1658.00 175.00 1697.00 127.50Q1736.00 80.00 1796.00 53.50Q1856.00 27.00 1939.00 27.00Q2009.00 27.00 2059.50 46.00Q2110.00 65.00 2142.00 99.00Q2174.00 133.00 2187.00 177.50Q2200.00 222.00 2195.00 273.00L2044.00 291.00Q2046.00 246.00 2033.00 217.50Q2020.00 189.00 1994.50 175.00Q1969.00 161.00 1933.00 161.00Q1890.00 161.00 1858.00 184.00Q1826.00 207.00 1808.50 253.00Q1791.00 299.00 1791.00 368.00Q1791.00 419.00 1801.00 459.50Q1811.00 500.00 1831.00 527.50Q1851.00 555.00 1880.50 569.50Q1910.00 584.00 1948.00 584.00Q1986.00 584.00 2013.00 570.50Q2040.00 557.00 2054.50 533.50Q2069.00 510.00 2069.00 479.00L1965.00 479.00L1965.00 365.00L2213.00 365.00L2213.00 489.00L2213.00 701.00L2102.00 701.00L2102.00 523.00L2093.00 523.00Q2088.00 585.00 2063.50 628.00Q2039.00 671.00 1996.50 693.00Q1954.00 715.00 1895.00 715.00ZM2293.00 701.00L2293.00 41.00L2510.00 41.00L2745.00 488.00L2747.00 488.00L2747.00 41.00L2907.00 41.00L2907.00 701.00L2703.00 701.00L2455.00 239.00L2453.00 239.00L2453.00 701.00ZM2996.28 184.80L2996.28 -0.00L3031.84 -0.00L3031.84 184.80ZM2947.00 30.80L2947.00 -0.00L3081.40 -0.00L3081.40 30.80ZM3100.91 184.80L3100.91 -0.00L3154.95 -0.00L3200.87 144.20L3201.43 144.20L3246.51 -0.00L3298.03 -0.00L3298.03 184.80L3264.71 184.80L3264.71 35.84L3264.15 35.84L3215.99 184.80L3182.67 184.80L3134.79 35.84L3134.23 35.84L3134.23 184.80Z" />
|
|
7
|
+
<path fill="#f97316" d="M1197.00 782.00L1434.00 0.00L1586.00 0.00L1349.00 782.00Z" />
|
|
8
|
+
</svg>
|
|
9
|
+
`;
|
|
10
|
+
var getLogoMarkSvg = () => `
|
|
11
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
|
|
12
|
+
viewBox="1000.5 0 782 782" style="display:block"
|
|
13
|
+
role="img" aria-label="DS-GN" focusable="false">
|
|
14
|
+
<path fill="#f97316" d="M1197.00 782.00L1434.00 0.00L1586.00 0.00L1349.00 782.00Z" />
|
|
15
|
+
</svg>
|
|
16
|
+
`;
|
|
17
|
+
var logoVariants = {
|
|
18
|
+
FULL: "full",
|
|
19
|
+
MARK: "mark"
|
|
20
|
+
};
|
|
21
|
+
var getLogoHtml = ({
|
|
22
|
+
color = "currentColor",
|
|
23
|
+
label = "DS-GN",
|
|
24
|
+
markHtml,
|
|
25
|
+
size = 24,
|
|
26
|
+
variant = logoVariants.FULL,
|
|
27
|
+
wordmarkHtml
|
|
28
|
+
} = {}) => {
|
|
29
|
+
let artwork = getLogoSvg(color).replace('width="101" height="24"', `width="${size * (3299 / 782)}" height="${size}"`);
|
|
30
|
+
if (variant === logoVariants.MARK) {
|
|
31
|
+
artwork = markHtml ?? getLogoMarkSvg().replace('width="24" height="24"', `width="${size}" height="${size}"`);
|
|
32
|
+
} else if (markHtml !== undefined || wordmarkHtml !== undefined) {
|
|
33
|
+
artwork = `<span style="display:inline-block;height:${size}px">${markHtml ?? getLogoMarkSvg()}</span><span>${wordmarkHtml ?? "DS-GN"}</span>`;
|
|
34
|
+
}
|
|
35
|
+
artwork = artwork.replaceAll('role="img" aria-label="DS-GN"', 'aria-hidden="true"');
|
|
36
|
+
return `<span role="img" aria-label="${label}" style="display:inline-flex;align-items:center;gap:${size * 0.233}px;height:${size}px;color:${color};line-height:1">${artwork}</span>`;
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
getLogoHtml,
|
|
40
|
+
getLogoMarkSvg,
|
|
41
|
+
getLogoSvg,
|
|
42
|
+
logoVariants
|
|
43
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Renders the DS-GN logo SVG (Lit version).
|
|
4
|
+
* @param color - CSS color value for the wordmark (defaults to 'currentColor')
|
|
5
|
+
*/
|
|
6
|
+
export declare const logoSvg: (color?: string) => TemplateResult;
|
|
7
|
+
/** Renders the supplied DS/GN artwork for Lit templates. */
|
|
8
|
+
export declare const logoHtml: (color?: string) => TemplateResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the user has requested reduced motion via the OS/browser setting.
|
|
3
|
+
*
|
|
4
|
+
* Used as a gate for auto-animating controllers (e.g. AutoRotateController,
|
|
5
|
+
* WordCycleController) so motion respects `prefers-reduced-motion: reduce`.
|
|
6
|
+
* Guarded for environments without `matchMedia` (SSR, test DOMs), where it
|
|
7
|
+
* reports `false` (motion allowed) rather than throwing.
|
|
8
|
+
*/
|
|
9
|
+
export declare function prefersReducedMotion(): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a component render function in a container with a background color
|
|
4
|
+
* that contrasts with the `surface` prop.
|
|
5
|
+
*
|
|
6
|
+
* `min-h-screen` makes the wrapper fill the story canvas. Without it the
|
|
7
|
+
* wrapper is only as tall as its content and the rest of the canvas shows
|
|
8
|
+
* Storybook's own white background — the preset already sets
|
|
9
|
+
* `layout: 'fullscreen'`, so the wrapper starts at the canvas origin and this
|
|
10
|
+
* is all that is needed to cover it. It is spelled out literally rather than
|
|
11
|
+
* composed, because Tailwind only generates classes it finds as literal strings
|
|
12
|
+
* in the source.
|
|
13
|
+
*
|
|
14
|
+
* @param componentRender The component's render function
|
|
15
|
+
* @param padding Tailwind padding scale value (e.g. '6')
|
|
16
|
+
* @param surface Optional surface override; defaults to args.surface
|
|
17
|
+
* @param withTextColor Whether to apply color: var(--color-text-primary)
|
|
18
|
+
* @returns A new render function that wraps the component
|
|
19
|
+
*/
|
|
20
|
+
export declare const renderWithBackground: <T extends object>(componentRender: (args: T) => TemplateResult, padding?: string, surface?: string, withTextColor?: boolean) => (args: T) => TemplateResult<1>;
|
|
21
|
+
/**
|
|
22
|
+
* Prefixes keys in an object with a given string using `--` as separator.
|
|
23
|
+
* e.g. prefix "heading", key "headingText" → "heading--headingText"
|
|
24
|
+
* Used to avoid prop collisions when composing stories.
|
|
25
|
+
*/
|
|
26
|
+
export declare const prefixArgs: (prefix: string, ...argsList: object[]) => Record<string, unknown>[];
|
|
27
|
+
/**
|
|
28
|
+
* Removes prefixes from keys in an object.
|
|
29
|
+
* e.g. prefix "heading", key "heading--headingText" → "headingText"
|
|
30
|
+
* Used to retrieve original props from a prefixed object.
|
|
31
|
+
*/
|
|
32
|
+
export declare const unprefixArgs: (prefix: string, args: object) => Record<string, unknown>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import '../../../types/global.d.ts';
|
|
2
|
+
import { type CSSResultGroup } from 'lit';
|
|
3
|
+
import { Base } from '../../../common/Base/Base.js';
|
|
4
|
+
import { type SurfaceType } from '../../../common/props/surface/surface.props.js';
|
|
5
|
+
import { type AuroraIntensityType, type BackgroundVariantType } from './Background.props.js';
|
|
6
|
+
/**
|
|
7
|
+
* Full-bleed backdrop that wraps a group of slotted components. A `variant`
|
|
8
|
+
* (`solid` or `gradient`) sets the base fill; `aurora` layers the animated mesh
|
|
9
|
+
* on top of that base, so a solid or gradient backdrop and the drift can be
|
|
10
|
+
* combined. The sole consumer of the shared aurora-mesh engine
|
|
11
|
+
* (`AuroraMeshController` + `renderAuroraMesh`). Used from the CMS to give a
|
|
12
|
+
* section its own background while composing other components within it.
|
|
13
|
+
*
|
|
14
|
+
* @slot - Section content rendered above the background.
|
|
15
|
+
*/
|
|
16
|
+
export declare class Background extends Base {
|
|
17
|
+
static styles: CSSResultGroup;
|
|
18
|
+
private _inView;
|
|
19
|
+
private _mesh;
|
|
20
|
+
/**
|
|
21
|
+
* Base fill: a flat surface or a gradient.
|
|
22
|
+
*/
|
|
23
|
+
variant: BackgroundVariantType;
|
|
24
|
+
/**
|
|
25
|
+
* Layer the animated aurora mesh on top of the base fill.
|
|
26
|
+
*/
|
|
27
|
+
aurora: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Brightness of the drifting aurora blobs (only applies when `aurora`).
|
|
30
|
+
*/
|
|
31
|
+
intensity: AuroraIntensityType;
|
|
32
|
+
/**
|
|
33
|
+
* Surface theme variant (light or dark)
|
|
34
|
+
*/
|
|
35
|
+
surface: SurfaceType;
|
|
36
|
+
constructor();
|
|
37
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
38
|
+
render(): import("lit").TemplateResult<1>;
|
|
39
|
+
}
|
|
40
|
+
declare global {
|
|
41
|
+
interface HTMLElementTagNameMap {
|
|
42
|
+
'dsgn-background': Background;
|
|
43
|
+
}
|
|
44
|
+
}
|