@fairfox/polly 0.23.0 → 0.25.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/README.md +55 -1
- package/dist/cli/polly.js +21 -1
- package/dist/cli/polly.js.map +3 -3
- package/dist/src/actions/error.d.ts +26 -0
- package/dist/src/actions/event-delegation.d.ts +48 -0
- package/dist/src/actions/form.d.ts +72 -0
- package/dist/src/actions/index.d.ts +13 -0
- package/dist/src/actions/index.js +525 -0
- package/dist/src/actions/index.js.map +15 -0
- package/dist/src/actions/overlay.d.ts +26 -0
- package/dist/src/actions/registry.d.ts +25 -0
- package/dist/src/actions/store.d.ts +26 -0
- package/dist/src/actions/testing.d.ts +26 -0
- package/dist/src/background/index.js +26 -1
- package/dist/src/background/index.js.map +2 -2
- package/dist/src/background/message-router.js +26 -1
- package/dist/src/background/message-router.js.map +2 -2
- package/dist/src/client/index.js +27 -2
- package/dist/src/client/index.js.map +3 -3
- package/dist/src/elysia/index.js +27 -2
- package/dist/src/elysia/index.js.map +3 -3
- package/dist/src/elysia/peer-repo-plugin.d.ts +1 -1
- package/dist/src/index.js +26 -1
- package/dist/src/index.js.map +2 -2
- package/dist/src/mesh-node.d.ts +89 -0
- package/dist/src/mesh-node.js +619 -0
- package/dist/src/mesh-node.js.map +14 -0
- package/dist/src/mesh.d.ts +10 -0
- package/dist/src/mesh.js +951 -24
- package/dist/src/mesh.js.map +17 -9
- package/dist/src/peer.d.ts +1 -0
- package/dist/src/peer.js +130 -84
- package/dist/src/peer.js.map +11 -10
- package/dist/src/polly-ui/ActionForm.d.ts +21 -0
- package/dist/src/polly-ui/ActionInput.d.ts +41 -0
- package/dist/src/polly-ui/ConfirmDialog.d.ts +24 -0
- package/dist/src/polly-ui/Layout.d.ts +51 -0
- package/dist/src/polly-ui/Modal.d.ts +52 -0
- package/dist/src/polly-ui/OverlayRoot.d.ts +10 -0
- package/dist/src/polly-ui/TextInput.d.ts +31 -0
- package/dist/src/polly-ui/Toast.d.ts +19 -0
- package/dist/src/polly-ui/index.css +319 -0
- package/dist/src/polly-ui/index.d.ts +17 -0
- package/dist/src/polly-ui/index.js +953 -0
- package/dist/src/polly-ui/index.js.map +22 -0
- package/dist/src/polly-ui/internal/focus-trap.d.ts +10 -0
- package/dist/src/polly-ui/internal/input-base.d.ts +18 -0
- package/dist/src/polly-ui/internal/scroll-lock.d.ts +9 -0
- package/dist/src/polly-ui/styles.css +70 -0
- package/dist/src/polly-ui/theme.css +163 -0
- package/dist/src/shared/adapters/index.js +26 -1
- package/dist/src/shared/adapters/index.js.map +2 -2
- package/dist/src/shared/lib/blob-cache.d.ts +58 -0
- package/dist/src/shared/lib/blob-store-impl.d.ts +33 -0
- package/dist/src/shared/lib/blob-store.d.ts +87 -0
- package/dist/src/shared/lib/blob-transfer.d.ts +58 -0
- package/dist/src/shared/lib/context-helpers.js +26 -1
- package/dist/src/shared/lib/context-helpers.js.map +2 -2
- package/dist/src/shared/lib/crdt-specialised.d.ts +1 -1
- package/dist/src/shared/lib/crdt-state.d.ts +1 -1
- package/dist/src/shared/lib/errors.js +26 -1
- package/dist/src/shared/lib/errors.js.map +2 -2
- package/dist/src/shared/lib/keyring-storage.d.ts +57 -0
- package/dist/src/shared/lib/mesh-client.d.ts +91 -0
- package/dist/src/shared/lib/mesh-network-adapter.d.ts +1 -1
- package/dist/src/shared/lib/mesh-signaling-client.d.ts +6 -0
- package/dist/src/shared/lib/mesh-state.d.ts +1 -1
- package/dist/src/shared/lib/mesh-webrtc-adapter.d.ts +20 -1
- package/dist/src/shared/lib/message-bus.js +26 -1
- package/dist/src/shared/lib/message-bus.js.map +2 -2
- package/dist/src/shared/lib/peer-relay-adapter.d.ts +1 -1
- package/dist/src/shared/lib/peer-repo-server.d.ts +1 -1
- package/dist/src/shared/lib/peer-state.d.ts +1 -1
- package/dist/src/shared/lib/resource.js +26 -1
- package/dist/src/shared/lib/resource.js.map +2 -2
- package/dist/src/shared/lib/state.js +26 -1
- package/dist/src/shared/lib/state.js.map +2 -2
- package/dist/src/shared/lib/test-helpers.js +26 -1
- package/dist/src/shared/lib/test-helpers.js.map +2 -2
- package/dist/src/shared/lib/wasm-init.d.ts +17 -0
- package/dist/src/shared/state/app-state.js +26 -1
- package/dist/src/shared/state/app-state.js.map +2 -2
- package/dist/src/shared/types/messages.js +26 -1
- package/dist/src/shared/types/messages.js.map +2 -2
- package/dist/tools/quality/src/cli.js +647 -28
- package/dist/tools/quality/src/cli.js.map +11 -5
- package/dist/tools/quality/src/css/check-layout.d.ts +19 -0
- package/dist/tools/quality/src/css/check-quality.d.ts +24 -0
- package/dist/tools/quality/src/css/check-unused.d.ts +20 -0
- package/dist/tools/quality/src/css/check-vars.d.ts +22 -0
- package/dist/tools/quality/src/css/shared.d.ts +33 -0
- package/dist/tools/quality/src/index.d.ts +37 -0
- package/dist/tools/quality/src/index.js +735 -0
- package/dist/tools/quality/src/index.js.map +16 -0
- package/dist/tools/quality/src/logger.d.ts +26 -0
- package/dist/tools/quality/src/no-as-casting.d.ts +44 -0
- package/dist/tools/test/src/adapters/index.js +26 -1
- package/dist/tools/test/src/adapters/index.js.map +2 -2
- package/dist/tools/test/src/browser/index.js +26 -1
- package/dist/tools/test/src/browser/index.js.map +2 -2
- package/dist/tools/test/src/browser/run.js +238 -0
- package/dist/tools/test/src/browser/run.js.map +11 -0
- package/dist/tools/test/src/index.js +26 -1
- package/dist/tools/test/src/index.js.map +2 -2
- package/dist/tools/test/src/test-utils.js +26 -1
- package/dist/tools/test/src/test-utils.js.map +2 -2
- package/dist/tools/test/src/visual/compare.d.ts +23 -0
- package/dist/tools/test/src/visual/harness.d.ts +53 -0
- package/dist/tools/test/src/visual/index.d.ts +12 -0
- package/dist/tools/test/src/visual/index.js +13968 -0
- package/dist/tools/test/src/visual/index.js.map +41 -0
- package/dist/tools/verify/src/cli.js +3 -3
- package/dist/tools/verify/src/cli.js.map +1 -1
- package/dist/tools/verify/src/config.js +26 -1
- package/dist/tools/verify/src/config.js.map +2 -2
- package/package.json +42 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConfirmDialog — Promise-returning confirmation primitive.
|
|
3
|
+
*
|
|
4
|
+
* `confirm({ title, body, danger })` returns Promise<boolean>. Opens the
|
|
5
|
+
* rendered `<ConfirmDialog.Host />` modal (which must be mounted once at
|
|
6
|
+
* the app root). User picking confirm or cancel resolves the promise.
|
|
7
|
+
* Escape, backdrop click, and explicit `.dismiss()` resolve false.
|
|
8
|
+
*/
|
|
9
|
+
import type { JSX } from "preact";
|
|
10
|
+
export type ConfirmOptions = {
|
|
11
|
+
title: string;
|
|
12
|
+
body?: string;
|
|
13
|
+
danger?: boolean;
|
|
14
|
+
confirmLabel?: string;
|
|
15
|
+
cancelLabel?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function confirm(options: ConfirmOptions): Promise<boolean>;
|
|
18
|
+
/** Renders the active confirm dialog. Mount once near the app root. */
|
|
19
|
+
declare function Host(): JSX.Element | null;
|
|
20
|
+
export declare const ConfirmDialog: {
|
|
21
|
+
Host: typeof Host;
|
|
22
|
+
confirm: typeof confirm;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout — the one primitive that owns layouting concerns.
|
|
3
|
+
*
|
|
4
|
+
* Every other component in @fairfox/polly/ui (and every consumer app
|
|
5
|
+
* that runs `polly quality css-layout`) routes flex/grid decisions
|
|
6
|
+
* through this component. Props map to CSS custom properties so the
|
|
7
|
+
* stylesheet can read them uniformly and so consumers can override
|
|
8
|
+
* any of them in media queries without touching specificity.
|
|
9
|
+
*/
|
|
10
|
+
import { type ComponentChildren, type JSX } from "preact";
|
|
11
|
+
export type LayoutProps = {
|
|
12
|
+
children: ComponentChildren;
|
|
13
|
+
/** Polymorphic element (div, section, header, nav, …). Defaults to 'div'. */
|
|
14
|
+
as?: keyof JSX.IntrinsicElements;
|
|
15
|
+
/** CSS grid structure. */
|
|
16
|
+
rows?: string;
|
|
17
|
+
columns?: string;
|
|
18
|
+
autoFlow?: string;
|
|
19
|
+
autoRows?: string;
|
|
20
|
+
autoColumns?: string;
|
|
21
|
+
/** display: contents — lets children participate in an ancestor grid. */
|
|
22
|
+
contents?: boolean;
|
|
23
|
+
/** Inherit parent grid tracks via CSS subgrid. */
|
|
24
|
+
subgrid?: boolean;
|
|
25
|
+
/** Spacing. */
|
|
26
|
+
gap?: string;
|
|
27
|
+
padding?: string;
|
|
28
|
+
/** Sizing. */
|
|
29
|
+
height?: string;
|
|
30
|
+
minHeight?: string;
|
|
31
|
+
/** Container alignment. */
|
|
32
|
+
justifyItems?: string;
|
|
33
|
+
alignItems?: string;
|
|
34
|
+
justifyContent?: string;
|
|
35
|
+
alignContent?: string;
|
|
36
|
+
/** Self alignment (when this Layout is an item in a parent grid). */
|
|
37
|
+
justifySelf?: string;
|
|
38
|
+
alignSelf?: string;
|
|
39
|
+
/** Collapse to a single column at ≤640px. */
|
|
40
|
+
stackOnMobile?: boolean;
|
|
41
|
+
className?: string;
|
|
42
|
+
onClick?: JSX.MouseEventHandler<HTMLElement>;
|
|
43
|
+
onKeyDown?: JSX.KeyboardEventHandler<HTMLElement>;
|
|
44
|
+
role?: JSX.AriaRole;
|
|
45
|
+
tabIndex?: number;
|
|
46
|
+
id?: string;
|
|
47
|
+
"aria-label"?: string;
|
|
48
|
+
"aria-labelledby"?: string;
|
|
49
|
+
"aria-describedby"?: string;
|
|
50
|
+
};
|
|
51
|
+
export declare function Layout(props: LayoutProps): JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modal — compound dialog with focus trap, Escape handling, portal,
|
|
3
|
+
* and overlay-stack integration.
|
|
4
|
+
*
|
|
5
|
+
* Root takes a `when` signal (or boolean). When truthy the content mounts
|
|
6
|
+
* into the OverlayRoot portal, focus moves inside, Tab is trapped, Escape
|
|
7
|
+
* fires `data-action="modal:close"` (or the overlay registry's onClose
|
|
8
|
+
* callback), and the body scroll locks.
|
|
9
|
+
*/
|
|
10
|
+
import type { ReadonlySignal } from "@preact/signals";
|
|
11
|
+
import { type ComponentChildren } from "preact";
|
|
12
|
+
type RootProps = {
|
|
13
|
+
when: ReadonlySignal<boolean> | boolean;
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
children: ComponentChildren;
|
|
16
|
+
/** Accessible label source: "title" uses the <Modal.Title> id, or pass an explicit label. */
|
|
17
|
+
"aria-label"?: string;
|
|
18
|
+
};
|
|
19
|
+
declare function Root({ when, onClose, children, "aria-label": ariaLabel }: RootProps): import("preact").VNode<any> | null;
|
|
20
|
+
declare function Backdrop(): import("preact").JSX.Element;
|
|
21
|
+
declare function Content({ children }: {
|
|
22
|
+
children: ComponentChildren;
|
|
23
|
+
}): import("preact").JSX.Element;
|
|
24
|
+
declare function Header({ children }: {
|
|
25
|
+
children: ComponentChildren;
|
|
26
|
+
}): import("preact").JSX.Element;
|
|
27
|
+
declare function Title({ children }: {
|
|
28
|
+
children: ComponentChildren;
|
|
29
|
+
}): import("preact").JSX.Element;
|
|
30
|
+
declare function Body({ children }: {
|
|
31
|
+
children: ComponentChildren;
|
|
32
|
+
}): import("preact").JSX.Element;
|
|
33
|
+
declare function Footer({ children }: {
|
|
34
|
+
children: ComponentChildren;
|
|
35
|
+
}): import("preact").JSX.Element;
|
|
36
|
+
type CloseProps = {
|
|
37
|
+
children: ComponentChildren;
|
|
38
|
+
/** Fire a registered data-action instead of calling the onClose callback. */
|
|
39
|
+
action?: string;
|
|
40
|
+
};
|
|
41
|
+
declare function Close({ children, action }: CloseProps): import("preact").JSX.Element;
|
|
42
|
+
export declare const Modal: {
|
|
43
|
+
Root: typeof Root;
|
|
44
|
+
Backdrop: typeof Backdrop;
|
|
45
|
+
Content: typeof Content;
|
|
46
|
+
Header: typeof Header;
|
|
47
|
+
Title: typeof Title;
|
|
48
|
+
Body: typeof Body;
|
|
49
|
+
Footer: typeof Footer;
|
|
50
|
+
Close: typeof Close;
|
|
51
|
+
};
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OverlayRoot — portal target for stacked overlays.
|
|
3
|
+
*
|
|
4
|
+
* Apps render <OverlayRoot /> once, typically as the last child of the
|
|
5
|
+
* app root. Modal, ConfirmDialog, and Toast portal into this element;
|
|
6
|
+
* the scroll lock toggles based on the overlay registry count.
|
|
7
|
+
*/
|
|
8
|
+
export declare function OverlayRoot(): import("preact").JSX.Element;
|
|
9
|
+
/** Get the mount node for portaled overlays. Returns null before mount. */
|
|
10
|
+
export declare function getOverlayRootNode(): HTMLElement | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextInput — passive, signal-friendly native input wrapper.
|
|
3
|
+
*
|
|
4
|
+
* Designed to live inside <ActionForm>. Pass a plain string for
|
|
5
|
+
* uncontrolled mode (FormData-on-submit picks up the value) or a
|
|
6
|
+
* Signal<string> for controlled mode. Either way, a11y attributes are
|
|
7
|
+
* wired by the shared input-base, the stable `[data-polly-input]` hook
|
|
8
|
+
* is applied for styling, and `invalid` flips `aria-invalid` and
|
|
9
|
+
* `data-state="invalid"` for consumer selectors.
|
|
10
|
+
*/
|
|
11
|
+
import type { Signal } from "@preact/signals";
|
|
12
|
+
import type { JSX } from "preact";
|
|
13
|
+
type Variant = "single" | "multi";
|
|
14
|
+
export type TextInputProps = {
|
|
15
|
+
name: string;
|
|
16
|
+
/** Signal<string> for controlled, string for uncontrolled default. */
|
|
17
|
+
value?: Signal<string> | string;
|
|
18
|
+
variant?: Variant;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
readOnly?: boolean;
|
|
24
|
+
id?: string;
|
|
25
|
+
describedBy?: string;
|
|
26
|
+
rows?: number;
|
|
27
|
+
autoFocus?: boolean;
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function TextInput(props: TextInputProps): JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toast — consumer-facing surface for the global errorState.
|
|
3
|
+
*
|
|
4
|
+
* Renders every entry of the `errorState` signal into a viewport mounted
|
|
5
|
+
* inside OverlayRoot. `aria-live` is polite for info/warning and
|
|
6
|
+
* assertive for error severity. Each item auto-dismisses after
|
|
7
|
+
* `autoDismissMs` unless the user hovers the viewport. Clicking a
|
|
8
|
+
* toast or its close button removes that single entry.
|
|
9
|
+
*/
|
|
10
|
+
import type { JSX } from "preact";
|
|
11
|
+
export type ToastViewportProps = {
|
|
12
|
+
autoDismissMs?: number;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
declare function Viewport(props: ToastViewportProps): JSX.Element | null;
|
|
16
|
+
export declare const Toast: {
|
|
17
|
+
Viewport: typeof Viewport;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/* src/polly-ui/ActionForm.module.css */
|
|
2
|
+
@layer polly-components {
|
|
3
|
+
.form_oqTahQ {
|
|
4
|
+
inline-size: 100%;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.form_oqTahQ[aria-busy="true"] {
|
|
8
|
+
opacity: var(--polly-opacity-disabled);
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* src/polly-ui/ActionInput.module.css */
|
|
14
|
+
@layer polly-components {
|
|
15
|
+
.root_-n6UrQ {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
padding: var(--polly-space-sm) var(--polly-space-md);
|
|
18
|
+
font: inherit;
|
|
19
|
+
font-family: var(--polly-font-sans);
|
|
20
|
+
color: var(--polly-text);
|
|
21
|
+
line-height: var(--polly-line-height-base);
|
|
22
|
+
border: var(--polly-border-width-default) solid transparent;
|
|
23
|
+
border-radius: var(--polly-radius-md);
|
|
24
|
+
min-block-size: calc(1.5em + 2 * var(--polly-space-sm) + 2 * var(--polly-border-width-default));
|
|
25
|
+
inline-size: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.view_-n6UrQ {
|
|
29
|
+
cursor: text;
|
|
30
|
+
white-space: pre-wrap;
|
|
31
|
+
word-break: break-word;
|
|
32
|
+
transition: background var(--polly-motion-fast) ease, border-color var(--polly-motion-fast) ease;
|
|
33
|
+
background: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.view_-n6UrQ:hover {
|
|
37
|
+
background: var(--polly-surface-sunken);
|
|
38
|
+
border-color: var(--polly-border);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.edit_-n6UrQ {
|
|
42
|
+
background: var(--polly-surface);
|
|
43
|
+
border-color: var(--polly-border);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.placeholder_-n6UrQ {
|
|
47
|
+
color: var(--polly-text-muted);
|
|
48
|
+
font-style: italic;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.root_-n6UrQ[data-variant="multi"] {
|
|
52
|
+
field-sizing: content;
|
|
53
|
+
resize: vertical;
|
|
54
|
+
max-block-size: 40em;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* src/polly-ui/ConfirmDialog.module.css */
|
|
59
|
+
@layer polly-components {
|
|
60
|
+
.actions_ZfTX4A {
|
|
61
|
+
display: grid;
|
|
62
|
+
grid-auto-flow: column;
|
|
63
|
+
gap: var(--polly-space-sm);
|
|
64
|
+
justify-content: end;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.cancel_ZfTX4A, .confirm_ZfTX4A, .confirmDanger_ZfTX4A {
|
|
68
|
+
appearance: none;
|
|
69
|
+
padding: var(--polly-space-sm) var(--polly-space-lg);
|
|
70
|
+
font: inherit;
|
|
71
|
+
font-weight: var(--polly-weight-medium);
|
|
72
|
+
border: var(--polly-border-width-default) solid var(--polly-border);
|
|
73
|
+
border-radius: var(--polly-radius-md);
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
transition: background var(--polly-motion-fast) ease;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cancel_ZfTX4A {
|
|
79
|
+
background: var(--polly-surface);
|
|
80
|
+
color: var(--polly-text);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.cancel_ZfTX4A:hover {
|
|
84
|
+
background: var(--polly-surface-sunken);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.confirm_ZfTX4A {
|
|
88
|
+
background: var(--polly-accent);
|
|
89
|
+
color: var(--polly-accent-contrast);
|
|
90
|
+
border-color: var(--polly-accent);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.confirm_ZfTX4A:hover {
|
|
94
|
+
filter: brightness(1.05);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.confirmDanger_ZfTX4A {
|
|
98
|
+
background: var(--polly-danger);
|
|
99
|
+
color: var(--polly-danger-contrast);
|
|
100
|
+
border-color: var(--polly-danger);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.confirmDanger_ZfTX4A:hover {
|
|
104
|
+
filter: brightness(1.05);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* src/polly-ui/Modal.module.css */
|
|
109
|
+
@layer polly-components {
|
|
110
|
+
.container_fLMrWA {
|
|
111
|
+
position: fixed;
|
|
112
|
+
display: grid;
|
|
113
|
+
pointer-events: none;
|
|
114
|
+
place-items: center;
|
|
115
|
+
inset: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.backdrop_fLMrWA {
|
|
119
|
+
position: absolute;
|
|
120
|
+
background: color-mix(in srgb, var(--polly-text) 50%, transparent);
|
|
121
|
+
pointer-events: auto;
|
|
122
|
+
inset: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.surface_fLMrWA {
|
|
126
|
+
position: relative;
|
|
127
|
+
pointer-events: auto;
|
|
128
|
+
background: var(--polly-surface-raised);
|
|
129
|
+
color: var(--polly-text);
|
|
130
|
+
border: var(--polly-border-width-default) solid var(--polly-border);
|
|
131
|
+
border-radius: var(--polly-radius-lg);
|
|
132
|
+
box-shadow: var(--polly-shadow-lg);
|
|
133
|
+
max-inline-size: min(640px, calc(100vw - 2 * var(--polly-space-lg)));
|
|
134
|
+
max-block-size: calc(100vh - 2 * var(--polly-space-lg));
|
|
135
|
+
overflow: auto;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.header_fLMrWA {
|
|
139
|
+
padding: var(--polly-space-lg);
|
|
140
|
+
border-block-end: var(--polly-border-width-default) solid var(--polly-border);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.title_fLMrWA {
|
|
144
|
+
font-size: var(--polly-text-xl);
|
|
145
|
+
font-weight: var(--polly-weight-bold);
|
|
146
|
+
line-height: var(--polly-line-height-tight);
|
|
147
|
+
margin: 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.body_fLMrWA {
|
|
151
|
+
padding: var(--polly-space-lg);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.footer_fLMrWA {
|
|
155
|
+
padding: var(--polly-space-lg);
|
|
156
|
+
border-block-start: var(--polly-border-width-default) solid var(--polly-border);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.close_fLMrWA {
|
|
160
|
+
appearance: none;
|
|
161
|
+
color: var(--polly-text);
|
|
162
|
+
border: var(--polly-border-width-default) solid transparent;
|
|
163
|
+
border-radius: var(--polly-radius-md);
|
|
164
|
+
padding: var(--polly-space-sm) var(--polly-space-md);
|
|
165
|
+
font: inherit;
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
transition: background var(--polly-motion-fast) ease, border-color var(--polly-motion-fast) ease;
|
|
168
|
+
background: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.close_fLMrWA:hover {
|
|
172
|
+
background: var(--polly-surface-sunken);
|
|
173
|
+
border-color: var(--polly-border);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* src/polly-ui/OverlayRoot.module.css */
|
|
178
|
+
@layer polly-components {
|
|
179
|
+
.root_CqRu1Q {
|
|
180
|
+
position: fixed;
|
|
181
|
+
pointer-events: none;
|
|
182
|
+
inset: 0;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* src/polly-ui/Layout.module.css */
|
|
187
|
+
@layer polly-components {
|
|
188
|
+
.layout_QgwWPg {
|
|
189
|
+
--l-cols: none;
|
|
190
|
+
--l-rows: none;
|
|
191
|
+
--l-gap: 0;
|
|
192
|
+
--l-p: 0;
|
|
193
|
+
--l-h: auto;
|
|
194
|
+
--l-mh: auto;
|
|
195
|
+
--l-ji: stretch;
|
|
196
|
+
--l-ai: start;
|
|
197
|
+
--l-jc: normal;
|
|
198
|
+
--l-ac: normal;
|
|
199
|
+
--l-js: auto;
|
|
200
|
+
--l-as: auto;
|
|
201
|
+
--l-flow: row;
|
|
202
|
+
--l-arows: auto;
|
|
203
|
+
--l-acols: auto;
|
|
204
|
+
--l-col: auto;
|
|
205
|
+
display: grid;
|
|
206
|
+
grid-template-columns: var(--l-cols);
|
|
207
|
+
grid-template-rows: var(--l-rows);
|
|
208
|
+
gap: var(--l-gap);
|
|
209
|
+
padding: var(--l-p);
|
|
210
|
+
height: var(--l-h);
|
|
211
|
+
min-height: var(--l-mh);
|
|
212
|
+
justify-items: var(--l-ji);
|
|
213
|
+
align-items: var(--l-ai);
|
|
214
|
+
justify-content: var(--l-jc);
|
|
215
|
+
align-content: var(--l-ac);
|
|
216
|
+
justify-self: var(--l-js);
|
|
217
|
+
align-self: var(--l-as);
|
|
218
|
+
grid-auto-flow: var(--l-flow);
|
|
219
|
+
grid-auto-rows: var(--l-arows);
|
|
220
|
+
grid-auto-columns: var(--l-acols);
|
|
221
|
+
grid-column: var(--l-col);
|
|
222
|
+
inline-size: 100%;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@media (max-width: 640px) {
|
|
226
|
+
.stackOnMobile_QgwWPg {
|
|
227
|
+
grid-template-columns: 1fr;
|
|
228
|
+
grid-auto-flow: row;
|
|
229
|
+
grid-column: auto;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* src/polly-ui/TextInput.module.css */
|
|
235
|
+
@layer polly-components {
|
|
236
|
+
.input_ez4_Vg {
|
|
237
|
+
box-sizing: border-box;
|
|
238
|
+
padding: var(--polly-space-sm) var(--polly-space-md);
|
|
239
|
+
font: inherit;
|
|
240
|
+
font-family: var(--polly-font-sans);
|
|
241
|
+
color: var(--polly-text);
|
|
242
|
+
background: var(--polly-surface);
|
|
243
|
+
border: var(--polly-border-width-default) solid var(--polly-border);
|
|
244
|
+
border-radius: var(--polly-radius-md);
|
|
245
|
+
transition: border-color var(--polly-motion-fast) ease, background var(--polly-motion-fast) ease;
|
|
246
|
+
inline-size: 100%;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.input_ez4_Vg:hover {
|
|
250
|
+
border-color: var(--polly-border-strong);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.input_ez4_Vg[data-state="invalid"] {
|
|
254
|
+
border-color: var(--polly-danger);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.input_ez4_Vg:disabled {
|
|
258
|
+
opacity: var(--polly-opacity-disabled);
|
|
259
|
+
cursor: not-allowed;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.input_ez4_Vg[data-polly-input-variant="multi"] {
|
|
263
|
+
field-sizing: content;
|
|
264
|
+
min-block-size: calc(1.5em + 2 * var(--polly-space-sm) + 2 * var(--polly-border-width-default));
|
|
265
|
+
resize: vertical;
|
|
266
|
+
max-block-size: 40em;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* src/polly-ui/Toast.module.css */
|
|
271
|
+
@layer polly-components {
|
|
272
|
+
.viewport_xVzRuA {
|
|
273
|
+
display: grid;
|
|
274
|
+
gap: var(--polly-space-sm);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.item_xVzRuA {
|
|
278
|
+
display: grid;
|
|
279
|
+
grid-template-columns: 1fr auto;
|
|
280
|
+
gap: var(--polly-space-md);
|
|
281
|
+
padding: var(--polly-space-md) var(--polly-space-lg);
|
|
282
|
+
background: var(--polly-surface-raised);
|
|
283
|
+
color: var(--polly-text);
|
|
284
|
+
border: var(--polly-border-width-default) solid var(--polly-border);
|
|
285
|
+
border-radius: var(--polly-radius-md);
|
|
286
|
+
box-shadow: var(--polly-shadow-md);
|
|
287
|
+
align-items: center;
|
|
288
|
+
min-inline-size: 16em;
|
|
289
|
+
max-inline-size: 28em;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.item_xVzRuA[data-severity="error"] {
|
|
293
|
+
border-color: var(--polly-danger);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.item_xVzRuA[data-severity="warning"] {
|
|
297
|
+
border-color: var(--polly-warning);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.message_xVzRuA {
|
|
301
|
+
font-size: var(--polly-text-md);
|
|
302
|
+
line-height: var(--polly-line-height-base);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.close_xVzRuA {
|
|
306
|
+
appearance: none;
|
|
307
|
+
color: inherit;
|
|
308
|
+
border: var(--polly-border-width-default) solid transparent;
|
|
309
|
+
border-radius: var(--polly-radius-sm);
|
|
310
|
+
padding: var(--polly-space-xs) var(--polly-space-sm);
|
|
311
|
+
font: inherit;
|
|
312
|
+
cursor: pointer;
|
|
313
|
+
background: none;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.close_xVzRuA:hover {
|
|
317
|
+
background: var(--polly-surface-sunken);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fairfox/polly/ui — compound UI primitives.
|
|
3
|
+
*
|
|
4
|
+
* Every primitive is built on @fairfox/polly/actions: data-action hooks
|
|
5
|
+
* route events into the consumer's action registry, semantic tokens
|
|
6
|
+
* drive all visual values, and the <Layout> primitive owns every
|
|
7
|
+
* layouting concern. Ship styles.css and theme.css alongside to pick up
|
|
8
|
+
* the default look; redefine variables to re-theme.
|
|
9
|
+
*/
|
|
10
|
+
export { ActionForm, type ActionFormProps } from "./ActionForm.tsx";
|
|
11
|
+
export { ActionInput, type ActionInputProps, type ActionInputSaveOn, type ActionInputVariant, } from "./ActionInput.tsx";
|
|
12
|
+
export { ConfirmDialog, type ConfirmOptions, confirm } from "./ConfirmDialog.tsx";
|
|
13
|
+
export { Layout, type LayoutProps } from "./Layout.tsx";
|
|
14
|
+
export { Modal } from "./Modal.tsx";
|
|
15
|
+
export { getOverlayRootNode, OverlayRoot } from "./OverlayRoot.tsx";
|
|
16
|
+
export { TextInput, type TextInputProps } from "./TextInput.tsx";
|
|
17
|
+
export { Toast, type ToastViewportProps } from "./Toast.tsx";
|