@exponential-at/ui 0.0.0-stage → 0.1.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 +201 -0
- package/NOTICE +54 -0
- package/README.md +360 -2
- package/catalog/a11y.json +668 -0
- package/catalog/basic-map.json +104 -0
- package/catalog/code.json +58 -0
- package/catalog/core.catalog.json +4752 -0
- package/catalog/core.schema.json +22667 -0
- package/catalog/host.json +64 -0
- package/catalog/layout.json +20 -0
- package/catalog/limits.json +9 -0
- package/catalog/locale.json +48 -0
- package/catalog/macros.json +3417 -0
- package/catalog/recipes.json +61 -0
- package/catalog/strings.json +72 -0
- package/catalog/style.json +128 -0
- package/catalog/theme.schema.json +42543 -0
- package/catalog/tokens.json +47 -0
- package/conformance/README.md +217 -0
- package/conformance/baseline.ts +101 -0
- package/conformance/browser-page.ts +146 -0
- package/conformance/browser-suites.ts +683 -0
- package/conformance/compare.ts +201 -0
- package/conformance/dom.ts +96 -0
- package/conformance/dump.ts +163 -0
- package/conformance/fonts.json +154 -0
- package/conformance/manifest.json +224 -0
- package/conformance/parity-compare.ts +191 -0
- package/conformance/parity-report.schema.json +73 -0
- package/conformance/parity.ts +412 -0
- package/conformance/pixel.ts +177 -0
- package/conformance/primitives-page.ts +49 -0
- package/conformance/report.schema.json +66 -0
- package/conformance/run.ts +118 -0
- package/dist/chunks/index-98npjvsd.js +3940 -0
- package/dist/chunks/index-98npjvsd.js.map +27 -0
- package/dist/chunks/index-gwkt14w3.js +7314 -0
- package/dist/chunks/index-gwkt14w3.js.map +10 -0
- package/dist/chunks/index-njt7yzzm.js +134 -0
- package/dist/chunks/index-njt7yzzm.js.map +9 -0
- package/dist/chunks/index-we7va6v6.js +7984 -0
- package/dist/chunks/index-we7va6v6.js.map +15 -0
- package/dist/chunks/index-xrm6f7wc.js +2563 -0
- package/dist/chunks/index-xrm6f7wc.js.map +10 -0
- package/dist/conformance.js +182749 -0
- package/dist/conformance.js.map +10 -0
- package/dist/entries/prompt.js +251 -0
- package/dist/entries/prompt.js.map +11 -0
- package/dist/entries/schema.js +1725 -0
- package/dist/entries/schema.js.map +11 -0
- package/dist/host/index.js +122 -0
- package/dist/host/index.js.map +9 -0
- package/dist/index.js +3213 -0
- package/dist/index.js.map +27 -0
- package/dist/types/src/a11y.d.ts +21 -0
- package/dist/types/src/animation.d.ts +76 -0
- package/dist/types/src/basic-map.d.ts +38 -0
- package/dist/types/src/builder.d.ts +50 -0
- package/dist/types/src/catalog.d.ts +54 -0
- package/dist/types/src/catalog.described.d.ts +33 -0
- package/dist/types/src/catalog.generated.d.ts +829 -0
- package/dist/types/src/chart.d.ts +46 -0
- package/dist/types/src/code.d.ts +44 -0
- package/dist/types/src/color.d.ts +20 -0
- package/dist/types/src/conformance.d.ts +39 -0
- package/dist/types/src/connector/app.d.ts +14 -0
- package/dist/types/src/connector/connector.d.ts +77 -0
- package/dist/types/src/connector/index.d.ts +4 -0
- package/dist/types/src/css.d.ts +29 -0
- package/dist/types/src/define.d.ts +66 -0
- package/dist/types/src/direction.d.ts +16 -0
- package/dist/types/src/dynamic.d.ts +159 -0
- package/dist/types/src/entries/prompt.d.ts +11 -0
- package/dist/types/src/entries/schema.d.ts +8 -0
- package/dist/types/src/expr.d.ts +71 -0
- package/dist/types/src/extension.d.ts +4 -0
- package/dist/types/src/format.d.ts +112 -0
- package/dist/types/src/geometry.d.ts +40 -0
- package/dist/types/src/host/contract.d.ts +188 -0
- package/dist/types/src/host/decoders.d.ts +61 -0
- package/dist/types/src/host/index.d.ts +11 -0
- package/dist/types/src/host/package.d.ts +58 -0
- package/dist/types/src/host/policy.d.ts +105 -0
- package/dist/types/src/host/router.d.ts +34 -0
- package/dist/types/src/host/runtime.d.ts +205 -0
- package/dist/types/src/host/sources.d.ts +15 -0
- package/dist/types/src/host/transports.d.ts +109 -0
- package/dist/types/src/index.d.ts +63 -0
- package/dist/types/src/layout.d.ts +20 -0
- package/dist/types/src/limits.d.ts +21 -0
- package/dist/types/src/list.d.ts +133 -0
- package/dist/types/src/locale.d.ts +22 -0
- package/dist/types/src/macros.d.ts +29 -0
- package/dist/types/src/overlay.d.ts +27 -0
- package/dist/types/src/prompt.d.ts +44 -0
- package/dist/types/src/recipes.d.ts +17 -0
- package/dist/types/src/reducer.d.ts +41 -0
- package/dist/types/src/resizable.d.ts +38 -0
- package/dist/types/src/schema.d.ts +7 -0
- package/dist/types/src/strings.d.ts +13 -0
- package/dist/types/src/style.d.ts +201 -0
- package/dist/types/src/test-preload.d.ts +1 -0
- package/dist/types/src/text-shimmer.d.ts +24 -0
- package/dist/types/src/theme-types.d.ts +162 -0
- package/dist/types/src/theme.d.ts +73 -0
- package/dist/types/src/themes.d.ts +22 -0
- package/dist/types/src/tree-guides.d.ts +17 -0
- package/dist/types/src/types.d.ts +314 -0
- package/dist/types/src/validate.d.ts +31 -0
- package/dist/types/src/web/base-css.d.ts +1 -0
- package/dist/types/src/web/box-css.d.ts +55 -0
- package/dist/types/src/web/coerce.d.ts +32 -0
- package/dist/types/src/web/data.d.ts +105 -0
- package/dist/types/src/web/dates.d.ts +12 -0
- package/dist/types/src/web/form.d.ts +44 -0
- package/dist/types/src/web/host-types.d.ts +119 -0
- package/dist/types/src/web/index.d.ts +28 -0
- package/dist/types/src/web/inputs.d.ts +55 -0
- package/dist/types/src/web/list.d.ts +13 -0
- package/dist/types/src/web/listbox.d.ts +14 -0
- package/dist/types/src/web/markdown.d.ts +96 -0
- package/dist/types/src/web/media.d.ts +62 -0
- package/dist/types/src/web/parts.d.ts +4 -0
- package/dist/types/src/web/primitives/alert-dialog.d.ts +10 -0
- package/dist/types/src/web/primitives/alert.d.ts +9 -0
- package/dist/types/src/web/primitives/avatar-color.d.ts +2 -0
- package/dist/types/src/web/primitives/avatar.d.ts +13 -0
- package/dist/types/src/web/primitives/badge.d.ts +10 -0
- package/dist/types/src/web/primitives/breadcrumb.d.ts +10 -0
- package/dist/types/src/web/primitives/button.d.ts +6 -0
- package/dist/types/src/web/primitives/calendar.d.ts +43 -0
- package/dist/types/src/web/primitives/card.d.ts +9 -0
- package/dist/types/src/web/primitives/checkbox.d.ts +5 -0
- package/dist/types/src/web/primitives/choice-tiles.d.ts +32 -0
- package/dist/types/src/web/primitives/cn.d.ts +3 -0
- package/dist/types/src/web/primitives/code-block.d.ts +24 -0
- package/dist/types/src/web/primitives/command.d.ts +134 -0
- package/dist/types/src/web/primitives/context-ring.d.ts +24 -0
- package/dist/types/src/web/primitives/dialog-arms.d.ts +6 -0
- package/dist/types/src/web/primitives/dialog.d.ts +24 -0
- package/dist/types/src/web/primitives/disclosure-header.d.ts +5 -0
- package/dist/types/src/web/primitives/dock.d.ts +42 -0
- package/dist/types/src/web/primitives/dropdown-menu.d.ts +14 -0
- package/dist/types/src/web/primitives/empty-state.d.ts +15 -0
- package/dist/types/src/web/primitives/glass-card.d.ts +4 -0
- package/dist/types/src/web/primitives/hover-card.d.ts +7 -0
- package/dist/types/src/web/primitives/icon-disc.d.ts +12 -0
- package/dist/types/src/web/primitives/index.d.ts +48 -0
- package/dist/types/src/web/primitives/input.d.ts +5 -0
- package/dist/types/src/web/primitives/kbd.d.ts +4 -0
- package/dist/types/src/web/primitives/label.d.ts +3 -0
- package/dist/types/src/web/primitives/menu-surface.d.ts +17 -0
- package/dist/types/src/web/primitives/meter.d.ts +21 -0
- package/dist/types/src/web/primitives/popover.d.ts +3 -0
- package/dist/types/src/web/primitives/progress-ring.d.ts +5 -0
- package/dist/types/src/web/primitives/progress.d.ts +8 -0
- package/dist/types/src/web/primitives/scroll-area.d.ts +49 -0
- package/dist/types/src/web/primitives/segmented-control.d.ts +5 -0
- package/dist/types/src/web/primitives/select.d.ts +47 -0
- package/dist/types/src/web/primitives/separator.d.ts +3 -0
- package/dist/types/src/web/primitives/sheet-chrome.d.ts +4 -0
- package/dist/types/src/web/primitives/sheet.d.ts +20 -0
- package/dist/types/src/web/primitives/skeleton.d.ts +3 -0
- package/dist/types/src/web/primitives/spinner.d.ts +3 -0
- package/dist/types/src/web/primitives/switch.d.ts +4 -0
- package/dist/types/src/web/primitives/table.d.ts +11 -0
- package/dist/types/src/web/primitives/tabs.d.ts +13 -0
- package/dist/types/src/web/primitives/textarea.d.ts +3 -0
- package/dist/types/src/web/primitives/toast.d.ts +163 -0
- package/dist/types/src/web/primitives/tooltip.d.ts +3 -0
- package/dist/types/src/web/primitives/truncate.d.ts +7 -0
- package/dist/types/src/web/primitives/typeahead-portal.d.ts +12 -0
- package/dist/types/src/web/share.d.ts +6 -0
- package/dist/types/src/web/table.d.ts +20 -0
- package/dist/types/src/web/theme-css.d.ts +69 -0
- package/dist/types/src/web/urls.d.ts +21 -0
- package/dist/web/index.js +2303 -0
- package/dist/web/index.js.map +26 -0
- package/dist/web/primitives/index.js +1450 -0
- package/dist/web/primitives/index.js.map +57 -0
- package/docs/components.generated.json +6238 -0
- package/docs/round-1-contract.md +679 -0
- package/docs/round-2-contract.md +476 -0
- package/docs/round-3-contract.md +174 -0
- package/docs/themes.generated.json +3503 -0
- package/fixtures/animations.json +2890 -0
- package/fixtures/bench-list.json +58 -0
- package/fixtures/bind-time.json +30664 -0
- package/fixtures/catalog-basic-map.json +1692 -0
- package/fixtures/catalog-components.json +9323 -0
- package/fixtures/catalog-extension.json +620 -0
- package/fixtures/catalog-macros.json +36370 -0
- package/fixtures/code-tokens.json +1993 -0
- package/fixtures/conformance-baseline.json +55544 -0
- package/fixtures/conformance-cases.json +49 -0
- package/fixtures/conformance-known.json +2123 -0
- package/fixtures/control-geometry.json +4200 -0
- package/fixtures/dashboard.data.json +74 -0
- package/fixtures/dashboard.json +752 -0
- package/fixtures/demo-surface.json +47 -0
- package/fixtures/format.json +870 -0
- package/fixtures/host-policy.json +1067 -0
- package/fixtures/host-router.json +1152 -0
- package/fixtures/host-transport.json +590 -0
- package/fixtures/interactions-round1.json +773 -0
- package/fixtures/kitchen-sink.expanded.json +10844 -0
- package/fixtures/kitchen-sink.json +3049 -0
- package/fixtures/layout-geometry-round1.json +7278 -0
- package/fixtures/layout-geometry.json +2072 -0
- package/fixtures/overlay-geometry.json +272 -0
- package/fixtures/primitive-specimens.json +58 -0
- package/fixtures/prompt-budget.json +33 -0
- package/fixtures/resizable.json +714 -0
- package/fixtures/round4-contract.json +2985 -0
- package/fixtures/specimens.json +9832 -0
- package/fixtures/style-conditions.json +336 -0
- package/fixtures/template-items.json +2215 -0
- package/fixtures/text-direction.json +309 -0
- package/fixtures/text-shimmer.json +96 -0
- package/fixtures/theme-extends.json +573 -0
- package/fixtures/theme-invalid.json +1296 -0
- package/fixtures/theme-recipes.json +58600 -0
- package/fixtures/theme-resolved.json +23949 -0
- package/fixtures/toast-stack.json +215 -0
- package/fixtures/tree-guides.json +224 -0
- package/fixtures/virtual-list.json +733 -0
- package/generated/ExponentialUICatalog.generated.kt +67 -0
- package/generated/ExponentialUICatalog.generated.swift +67 -0
- package/generated/ExponentialUIThemes.generated.kt +23 -0
- package/generated/ExponentialUIThemes.generated.swift +23 -0
- package/generated/catalog.descriptions.generated.rs +6 -0
- package/generated/catalog.generated.rs +80 -0
- package/generated/catalog.themes.generated.rs +34 -0
- package/generated/core.descriptions.json +2505 -0
- package/generated/core.runtime.json +3609 -0
- package/package.json +87 -4
- package/themes/exponential.recipes.json +49 -0
- package/themes/exponential.theme.json +755 -0
- package/themes/neutral.theme.json +5676 -0
- package/themes/orange.theme.json +43 -0
- package/themes/playful.theme.json +219 -0
- package/vendor/a2ui/LICENSE.txt +203 -0
- package/vendor/a2ui/README.md +27 -0
- package/vendor/a2ui/v0_9/basic_catalog.json +1387 -0
- package/vendor/a2ui/v0_9/basic_catalog_rules.txt +5 -0
- package/vendor/a2ui/v0_9/client_capabilities.json +97 -0
- package/vendor/a2ui/v0_9/client_to_server.json +104 -0
- package/vendor/a2ui/v0_9/common_types.json +315 -0
- package/vendor/a2ui/v0_9/server_to_client.json +132 -0
- package/vendor/json-render/LICENSE.txt +201 -0
- package/vendor/json-render/README.md +13 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const SEGMENTED_LIST = "inline-flex h-9 w-fit items-center justify-center rounded-full border border-glass-stroke-section bg-glass-section p-[3px] text-muted-foreground";
|
|
2
|
+
export declare const SEGMENTED_ROW = "flex shrink-0 items-center justify-between gap-2 px-4 pt-3 pb-2 md:px-6";
|
|
3
|
+
export declare const SEGMENTED_ROW_COMPACT = "flex shrink-0 items-center justify-between gap-2 px-2 pt-2 pb-2";
|
|
4
|
+
/** The ONE trigger sizing both strips use — no per-surface `h-8`/`text-xs`
|
|
5
|
+
* overrides, or the two drift by a pixel again. */
|
|
6
|
+
export declare const SEGMENTED_TAB = "px-3";
|
|
7
|
+
export declare const SEGMENTED_ITEM = "inline-flex shrink-0 items-center justify-center gap-1.5 rounded-full border border-transparent px-3 py-1 text-sm font-medium whitespace-nowrap transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
|
|
8
|
+
export declare const TABS_CLASSES: {
|
|
9
|
+
readonly root: "flex flex-col gap-2";
|
|
10
|
+
readonly list: "inline-flex h-9 w-fit items-center justify-center rounded-full border border-glass-stroke-section bg-glass-section p-[3px] text-muted-foreground";
|
|
11
|
+
readonly trigger: "inline-flex shrink-0 items-center justify-center gap-1.5 rounded-full border border-transparent px-3 py-1 text-sm font-medium whitespace-nowrap transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 h-[calc(100%-1px)] flex-1 text-foreground dark:text-muted-foreground dark:data-[state=active]:border-glass-stroke-active dark:data-[state=active]:bg-glass-active dark:data-[state=active]:text-foreground disabled:pointer-events-none disabled:opacity-50";
|
|
12
|
+
readonly content: "flex-1 outline-none";
|
|
13
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const TEXTAREA_CLASSES: {
|
|
2
|
+
readonly root: "flex field-sizing-content min-h-16 w-full resize-y [@supports(field-sizing:content)]:resize-none rounded-lg border border-glass-stroke-card bg-glass-card px-3 py-2 text-base shadow-none transition-[color,border-color] duration-fast outline-none placeholder:text-foreground/50 focus-visible:border-glass-stroke-active focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:ring-destructive/40";
|
|
3
|
+
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export declare const TOAST_CONSTANTS: {
|
|
2
|
+
width: number;
|
|
3
|
+
gap: number;
|
|
4
|
+
peek: number;
|
|
5
|
+
scaleStep: number;
|
|
6
|
+
visible: number;
|
|
7
|
+
durationMs: number;
|
|
8
|
+
swipeThreshold: number;
|
|
9
|
+
viewportOffset: number;
|
|
10
|
+
mobileViewportOffset: number;
|
|
11
|
+
placement: {
|
|
12
|
+
pointer: string;
|
|
13
|
+
touch: string;
|
|
14
|
+
};
|
|
15
|
+
touchMaxWidth: number;
|
|
16
|
+
kinds: string[];
|
|
17
|
+
};
|
|
18
|
+
export type ToastKind = `success` | `error` | `info` | `warning`;
|
|
19
|
+
export type ToastPlacement = `bottom-right` | `top-center`;
|
|
20
|
+
export declare const TOAST_KINDS: readonly ToastKind[];
|
|
21
|
+
/** Touch = up to and including `touchMaxWidth` (the fixture's phone breakpoint). */
|
|
22
|
+
export declare const TOAST_TOUCH_QUERY: string;
|
|
23
|
+
export declare const TOAST_CLASSES: {
|
|
24
|
+
/** The fixed region (`<section>`), per placement: `viewportOffset` from
|
|
25
|
+
* the corner on a pointer, `mobileViewportOffset` below the status bar
|
|
26
|
+
* on touch. */
|
|
27
|
+
readonly region: "pointer-events-none fixed z-[100] flex";
|
|
28
|
+
readonly regionPlacement: {
|
|
29
|
+
"bottom-right": string;
|
|
30
|
+
"top-center": string;
|
|
31
|
+
};
|
|
32
|
+
/** The stack box (`<ol>`): `width` wide, its height = the geometry's. */
|
|
33
|
+
readonly list: "pointer-events-auto relative m-0 w-[356px] max-w-full list-none p-0 transition-[height] duration-standard ease-standard";
|
|
34
|
+
readonly listPlacement: {
|
|
35
|
+
"bottom-right": string;
|
|
36
|
+
"top-center": string;
|
|
37
|
+
};
|
|
38
|
+
/** The card: the opaque glass card at radius lg, no shadow; placed by its
|
|
39
|
+
* `--offset`/`--scale`. A collapsed back toast hides its contents behind
|
|
40
|
+
* the front one; a toast past `visible` draws nothing. */
|
|
41
|
+
readonly toast: "absolute inset-x-0 top-(--offset) flex items-start gap-3 rounded-lg border border-glass-stroke-card bg-glass-card-opaque p-4 font-sans text-sm text-foreground scale-(--scale) transition-[top,scale,opacity] duration-standard ease-standard data-[expanded=false]:data-[front=false]:*:opacity-0 data-[visible=false]:pointer-events-none data-[visible=false]:opacity-0";
|
|
42
|
+
/** A back card shrinks about the edge that PEEKS OUT: the top on a bottom
|
|
43
|
+
* stack, the bottom on a top stack. */
|
|
44
|
+
readonly toastOrigin: {
|
|
45
|
+
readonly bottom: "origin-top";
|
|
46
|
+
readonly top: "origin-bottom";
|
|
47
|
+
};
|
|
48
|
+
readonly content: "flex min-w-0 flex-1 flex-col gap-0.5";
|
|
49
|
+
readonly title: "leading-5 font-medium text-foreground";
|
|
50
|
+
readonly description: "leading-5 text-muted-foreground";
|
|
51
|
+
readonly action: "inline-flex h-6 shrink-0 cursor-pointer items-center rounded-md border-0 bg-primary px-2 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90";
|
|
52
|
+
/** The close glyph: last in the row. */
|
|
53
|
+
readonly close: "order-last inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm border-0 bg-transparent p-0 text-muted-foreground transition-colors hover:text-foreground [&_svg]:size-3.5";
|
|
54
|
+
readonly iconSlot: "flex h-5 shrink-0 items-center";
|
|
55
|
+
readonly icon: "size-4 shrink-0";
|
|
56
|
+
/** The ONLY place a toast wears its kind. */
|
|
57
|
+
readonly kindIcon: {
|
|
58
|
+
success: string;
|
|
59
|
+
error: string;
|
|
60
|
+
info: string;
|
|
61
|
+
warning: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/** The Lucide glyph each kind paints (the app's concept icons
|
|
65
|
+
* `ui-success`/`ui-error`/`ui-info`/`ui-warning`, packages/icons/icons.json). */
|
|
66
|
+
export declare const TOAST_KIND_GLYPH: {
|
|
67
|
+
readonly success: "circle-check";
|
|
68
|
+
readonly error: "circle-x";
|
|
69
|
+
readonly info: "info";
|
|
70
|
+
readonly warning: "triangle-alert";
|
|
71
|
+
};
|
|
72
|
+
/** The fixture's `placement`: bottom-right on a pointer, top-centre on touch;
|
|
73
|
+
* a bottom stack measures its peek above the front toast. */
|
|
74
|
+
export declare function toastPlacement(isTouch: boolean): {
|
|
75
|
+
placement: ToastPlacement;
|
|
76
|
+
anchoredBottom: boolean;
|
|
77
|
+
};
|
|
78
|
+
export interface ToastStackItem {
|
|
79
|
+
/** The item's top inside the stack box. */
|
|
80
|
+
offset: number;
|
|
81
|
+
/** Its width factor. */
|
|
82
|
+
scale: number;
|
|
83
|
+
/** Whether it draws at all. */
|
|
84
|
+
visible: boolean;
|
|
85
|
+
}
|
|
86
|
+
/** The numbers a stack is drawn from (the toast's, the Dock pile's). */
|
|
87
|
+
export interface StackConstants {
|
|
88
|
+
/** How far an older item peeks out behind the one in front of it. */
|
|
89
|
+
peek: number;
|
|
90
|
+
/** How much smaller each rank behind the front draws. */
|
|
91
|
+
scaleStep: number;
|
|
92
|
+
/** How many items draw at all while collapsed. */
|
|
93
|
+
visible: number;
|
|
94
|
+
/** The space between items while expanded. */
|
|
95
|
+
gap: number;
|
|
96
|
+
}
|
|
97
|
+
/** THE stack geometry ×4 (fixtures/toast-stack.json `geometry`; N-12: the
|
|
98
|
+
* Dock pile draws it too): `heights` oldest first (the newest is in front).
|
|
99
|
+
* Collapsed, the item of rank r (0 = front) sits r × `peek` from the
|
|
100
|
+
* anchoring edge, shrunk by `scaleStep` per rank (clamped at the last
|
|
101
|
+
* visible rank), `visible` of them drawn; expanded, every item at full
|
|
102
|
+
* size, `gap` apart. */
|
|
103
|
+
export declare function stackGeometry(heights: readonly number[], expanded: boolean, anchoredBottom: boolean, constants: StackConstants): {
|
|
104
|
+
height: number;
|
|
105
|
+
items: ToastStackItem[];
|
|
106
|
+
};
|
|
107
|
+
/** The toast's stack (`stackGeometry` with the toast's numbers). */
|
|
108
|
+
export declare function toastStackGeometry(heights: readonly number[], expanded: boolean, anchoredBottom: boolean): {
|
|
109
|
+
height: number;
|
|
110
|
+
items: ToastStackItem[];
|
|
111
|
+
};
|
|
112
|
+
export interface ToastAction {
|
|
113
|
+
label: string;
|
|
114
|
+
onClick?: (event: Event) => void;
|
|
115
|
+
}
|
|
116
|
+
export interface ToastOptions {
|
|
117
|
+
/** A fixed id (else the store generates `toast-<n>`); re-using a live id
|
|
118
|
+
* replaces that toast. */
|
|
119
|
+
id?: string;
|
|
120
|
+
kind?: ToastKind;
|
|
121
|
+
description?: string;
|
|
122
|
+
action?: ToastAction;
|
|
123
|
+
/** The auto-dismiss clock in ms (default `durationMs`); `Infinity` = sticky. */
|
|
124
|
+
duration?: number;
|
|
125
|
+
/** A fixed height for the stack geometry (else the renderer measures). */
|
|
126
|
+
height?: number;
|
|
127
|
+
onDismiss?: (toast: ToastRecord) => void;
|
|
128
|
+
}
|
|
129
|
+
export interface ToastRecord {
|
|
130
|
+
id: string;
|
|
131
|
+
kind?: ToastKind;
|
|
132
|
+
title: string;
|
|
133
|
+
description?: string;
|
|
134
|
+
action?: ToastAction;
|
|
135
|
+
duration: number;
|
|
136
|
+
height?: number;
|
|
137
|
+
}
|
|
138
|
+
export interface ToastFn {
|
|
139
|
+
(title: string, options?: ToastOptions): string;
|
|
140
|
+
(options: ToastOptions & {
|
|
141
|
+
title: string;
|
|
142
|
+
}): string;
|
|
143
|
+
success: (title: string, options?: Omit<ToastOptions, `kind`>) => string;
|
|
144
|
+
error: (title: string, options?: Omit<ToastOptions, `kind`>) => string;
|
|
145
|
+
info: (title: string, options?: Omit<ToastOptions, `kind`>) => string;
|
|
146
|
+
warning: (title: string, options?: Omit<ToastOptions, `kind`>) => string;
|
|
147
|
+
}
|
|
148
|
+
export interface ToastStore {
|
|
149
|
+
toast: ToastFn;
|
|
150
|
+
/** Removes one toast, or every toast without an id. */
|
|
151
|
+
dismiss: (id?: string) => void;
|
|
152
|
+
/** The live toasts, oldest first. */
|
|
153
|
+
toasts: () => readonly ToastRecord[];
|
|
154
|
+
/** Called with the toasts on every change; returns the unsubscribe. */
|
|
155
|
+
subscribe: (listener: (toasts: readonly ToastRecord[]) => void) => () => void;
|
|
156
|
+
/** Stops every clock (the stack expanded), keeping what is left of each. */
|
|
157
|
+
pauseAll: () => void;
|
|
158
|
+
/** Restarts every clock with its remaining time. */
|
|
159
|
+
resumeAll: () => void;
|
|
160
|
+
readonly paused: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** A toast store: the queue, the per-toast clocks and their pause. */
|
|
163
|
+
export declare function createToastStore(): ToastStore;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shorten `value` to at most `max` characters by replacing its middle with an
|
|
3
|
+
* ellipsis, keeping both ends visible (the tail slightly longer, since that is
|
|
4
|
+
* where the filename lives). Shorter values, and any `max` too small to hold a
|
|
5
|
+
* character on each side of the ellipsis, are returned unchanged.
|
|
6
|
+
*/
|
|
7
|
+
export declare function middleTruncate(value: string, max: number): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The attribute the anchored arm stamps on its portal. It lives outside the
|
|
2
|
+
* host's subtree, so a Radix modal would take a click on it as an OUTSIDE
|
|
3
|
+
* interaction and close: dialog hosts whitelist this selector in their
|
|
4
|
+
* `onInteractOutside`, and treat a mounted one as "a menu is open" when
|
|
5
|
+
* routing Escape. */
|
|
6
|
+
export declare const TYPEAHEAD_PORTAL_SELECTOR = "[data-editor-autocomplete]";
|
|
7
|
+
/** Whether a Radix outside-interaction (its `target` is the pointed-at
|
|
8
|
+
* node) landed inside the anchored arm's portal. `DialogContent` and
|
|
9
|
+
* `SheetContent` ignore that one by default. */
|
|
10
|
+
export declare function isTypeaheadPortalInteraction(event: {
|
|
11
|
+
target: EventTarget | null;
|
|
12
|
+
}): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** `next` with every part deep-equal to `prev`'s replaced by `prev`'s
|
|
2
|
+
* object (arrays of nodes matched by `id`, other arrays by index): a
|
|
3
|
+
* re-reduce (`updateComponents`) hands every unchanged node its old
|
|
4
|
+
* object, so the renderers skip it. Plain JSON only; anything else is
|
|
5
|
+
* taken as it is. */
|
|
6
|
+
export declare function share<T>(prev: unknown, next: T): T;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface TableColumn {
|
|
2
|
+
key: string;
|
|
3
|
+
/** The header text (a slot or checkbox column may have none). */
|
|
4
|
+
label?: string;
|
|
5
|
+
type?: `text` | `number` | `date` | `boolean` | `badge` | `slot` | `currency` | `percent` | `relativeTime`;
|
|
6
|
+
slot?: string;
|
|
7
|
+
/** ISO 4217 code of a `currency` column. */
|
|
8
|
+
currency?: string;
|
|
9
|
+
/** Fixed fraction digits of a number / currency / percent column. */
|
|
10
|
+
decimals?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
align?: `start` | `center` | `end`;
|
|
13
|
+
sortable?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface TableSort {
|
|
16
|
+
key: string;
|
|
17
|
+
direction: `asc` | `desc`;
|
|
18
|
+
}
|
|
19
|
+
/** The renderer's local order of `rows` for a sort (unbound sort). */
|
|
20
|
+
export declare function sortRows(rows: readonly Record<string, unknown>[], sort: TableSort | null, column: TableColumn | undefined, locale: string): number[];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { FontSpec, RecipeRule, ResolvedTheme } from "@exponential-at/ui";
|
|
2
|
+
export declare const LAYERS = "@layer xui-base, xui-recipe, xui-node, xui-part;";
|
|
3
|
+
/** `$color.primary` → `--xui-color-primary`; `$type.lineHeight.sm` →
|
|
4
|
+
* `--xui-type-lineHeight-sm` (the group path verbatim); `$type.family.sans`
|
|
5
|
+
* → `--xui-font-sans`. */
|
|
6
|
+
export declare function tokenVarName(ref: string): string | null;
|
|
7
|
+
export declare function tokenVar(ref: string): string | null;
|
|
8
|
+
/** One style value → its CSS text; `null` = nothing to emit. */
|
|
9
|
+
export declare function cssValue(key: string, value: unknown, fonts?: Record<string, FontSpec>): string | null;
|
|
10
|
+
/** Flat declarations (`prop:value` pairs) for one condition-free style. A
|
|
11
|
+
* border width without a `borderStyle` is solid (contract §2). An
|
|
12
|
+
* animation that moves opacity MULTIPLIES the node's own (round 2 §2): the
|
|
13
|
+
* keyframes move `--xui-a-opacity` and `opacity` = own ×
|
|
14
|
+
* `var(--xui-a-opacity, 1)`. `base` = the style a condition block cascades
|
|
15
|
+
* over, so a block that adds only the animation (or only the opacity)
|
|
16
|
+
* still multiplies the other's value. */
|
|
17
|
+
export declare function declarations(style: Record<string, unknown>, fonts?: Record<string, FontSpec>, base?: Record<string, unknown>): [string, string][];
|
|
18
|
+
/** `animation: <name>` as CSS longhands over `@keyframes xui-<name>`
|
|
19
|
+
* (base-css.ts): duration = the motion token × the set's factor (an
|
|
20
|
+
* `animationDuration` token replaces the token, the factor kept), easing
|
|
21
|
+
* per segment = `animation-timing-function`, fill both. An unknown name =
|
|
22
|
+
* no animation. Reduced motion zeroes the duration (base-css.ts), which
|
|
23
|
+
* shows each set's rest frame. */
|
|
24
|
+
export declare function animationDeclarations(name: unknown, durationToken?: unknown): [string, string][];
|
|
25
|
+
/** The shimmer BAND of `animation: shimmer` (style.json `animations.shimmer`
|
|
26
|
+
* `band`): an `::after` over the box, a gradient of the band colour at
|
|
27
|
+
* alpha 0 → .5 → 0, one box wide, at `--xui-band` box widths (the
|
|
28
|
+
* keyframes move it −1 → 1), clipped to the box. Empty for anything else. */
|
|
29
|
+
export declare function shimmerRule(selector: string, style: Record<string, unknown>): string;
|
|
30
|
+
export declare const rule: (selector: string, decls: [string, string][]) => string;
|
|
31
|
+
/** Every way an element can be in a state: the pseudo-class or the attribute
|
|
32
|
+
* Radix sets, plus the forced marker the recipe sheet writes. */
|
|
33
|
+
export declare const STATE_SELECTORS: Record<string, string[]>;
|
|
34
|
+
/** A native's recipe props ride as `data-r-<prop>`, a macro part's as
|
|
35
|
+
* `data-m-<prop>`: a Badge's label is a Text, and both key on `variant`. */
|
|
36
|
+
export declare const propAttribute: (macro: boolean, prop: string) => string;
|
|
37
|
+
/** The selectors one recipe rule applies to, for the part's class. */
|
|
38
|
+
export declare function ruleSelectors(base: string, rule: RecipeRule, macro?: boolean): string[];
|
|
39
|
+
export interface CompiledTheme {
|
|
40
|
+
/** The class on the surface root AND on every element it paints. */
|
|
41
|
+
scope: string;
|
|
42
|
+
/** The whole sheet: layer order, variables (both modes), recipes. */
|
|
43
|
+
css: string;
|
|
44
|
+
theme: ResolvedTheme;
|
|
45
|
+
}
|
|
46
|
+
export declare function themeScope(theme: ResolvedTheme): string;
|
|
47
|
+
/** Whether a component's parts go in the `xui-part` layer (macro parts win
|
|
48
|
+
* over an author's style) or the `xui-recipe` layer (a native's own look
|
|
49
|
+
* yields to it). Extension macros are listed by the caller. */
|
|
50
|
+
export declare function isMacroComponent(component: string, extensionMacros?: ReadonlySet<string>): boolean;
|
|
51
|
+
export declare const partClass: (component: string, part: string) => string;
|
|
52
|
+
export declare function compileTheme(theme: ResolvedTheme, options?: {
|
|
53
|
+
extensionMacros?: ReadonlySet<string>;
|
|
54
|
+
}): CompiledTheme;
|
|
55
|
+
/** `compileTheme`, memoized per resolved theme object (the common case:
|
|
56
|
+
* a built-in or a theme the host loaded once). */
|
|
57
|
+
export declare function compiledTheme(theme: ResolvedTheme, options?: {
|
|
58
|
+
extensionMacros?: ReadonlySet<string>;
|
|
59
|
+
}): CompiledTheme;
|
|
60
|
+
/** FEED-128: the theme as an app's UNSCOPED shadcn globals: the shadcn /
|
|
61
|
+
* Tailwind variable names (the same `SHADCN_ALIASES` the surface sheet
|
|
62
|
+
* maps) with LITERAL values (hex colours, px radius, font stacks; never a
|
|
63
|
+
* `var(--xui-*)`), light under `:root` and dark under `.dark` by default.
|
|
64
|
+
* A non-Exponential-UI app (shadcn-solid, plain Tailwind) pastes it as its
|
|
65
|
+
* globals.css and wears the theme. */
|
|
66
|
+
export declare function globalsCss(theme: ResolvedTheme, options?: {
|
|
67
|
+
light?: string;
|
|
68
|
+
dark?: string;
|
|
69
|
+
}): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type MediaRequest, type UrlPolicy } from "@exponential-at/ui";
|
|
2
|
+
import type { AnyHostPlugin as HostPlugin } from "./host-types.js";
|
|
3
|
+
/** VAPP-107: the page's OWN host when it is private (a dev server on
|
|
4
|
+
* localhost): the renderer opts it in on top of the host's `allowPrivate`,
|
|
5
|
+
* exactly as the Exponential app's hosts opt their own origin in. The page
|
|
6
|
+
* already runs there; nothing else private is reached. */
|
|
7
|
+
export declare function ownPrivateHosts(): string[];
|
|
8
|
+
/** The URL policy a plugin's hrefs pass. */
|
|
9
|
+
export declare function urlPolicyOf(host: HostPlugin): UrlPolicy;
|
|
10
|
+
/** The href a link may navigate to, or undefined (paint it as text). */
|
|
11
|
+
export declare function linkHref(host: HostPlugin, href: unknown): string | undefined;
|
|
12
|
+
/** The media request for a src (`resolveUrl` rewrites first; the host's
|
|
13
|
+
* `mediaRequest` or the plugin's `media` options build it), re-checked
|
|
14
|
+
* against the media schemes/hosts so a host hook cannot widen them. Null =
|
|
15
|
+
* nothing loads. */
|
|
16
|
+
export declare function mediaRequestOf(host: HostPlugin, src: unknown): MediaRequest | null;
|
|
17
|
+
/** Does an absolute media url pass the media schemes, hosts and private
|
|
18
|
+
* opt-ins (VAPP-107; the page's own private host counts as opted in)? */
|
|
19
|
+
export declare function mediaUrlAllowed(host: HostPlugin, url: string): boolean;
|
|
20
|
+
/** The default opener: only what the policy allows, in a new tab. */
|
|
21
|
+
export declare function openAllowed(host: HostPlugin, url: string): void;
|