@pontive/pontkit-core 1.27.0 → 1.29.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/catalog.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/components/renderers/auth/scope-list/_scope-list.d.ts +1 -1
- package/dist/components/renderers/auth/scope-list/scope-list.types.d.ts +1 -1
- package/dist/components/widgets/pont-consent/consent-api.d.ts +1 -1
- package/dist/components/widgets/pont-consent/pont-consent.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/pont2/core/controllers/action.d.ts +79 -0
- package/dist/pont2/core/controllers/copy.d.ts +34 -0
- package/dist/pont2/core/icons.d.ts +24 -16
- package/dist/pont2/core/index.d.ts +2 -0
- package/dist/pont2/core/names.d.ts +1 -1
- package/dist/pont2/globals.css +19 -7
- package/dist/pont2/index.mjs +3349 -1494
- package/dist/pont2/index.mjs.map +1 -1
- package/dist/pont2/kit/alert/alert.d.ts +2 -1
- package/dist/pont2/kit/auth-button/auth-button.d.ts +185 -0
- package/dist/pont2/kit/auth-button/providers.d.ts +15 -0
- package/dist/pont2/kit/auth-field/auth-field.d.ts +267 -0
- package/dist/pont2/kit/auth-field/password-field.d.ts +124 -0
- package/dist/pont2/kit/block/block.d.ts +66 -0
- package/dist/pont2/kit/block/branding.d.ts +36 -0
- package/dist/pont2/kit/container/container.d.ts +40 -0
- package/dist/pont2/kit/countdown/countdown.d.ts +64 -0
- package/dist/pont2/kit/divider/divider.d.ts +30 -0
- package/dist/pont2/kit/edit-identifier/edit-identifier.d.ts +47 -0
- package/dist/pont2/kit/flow-widget/flow-widget.d.ts +151 -0
- package/dist/pont2/kit/gap/gap.d.ts +36 -0
- package/dist/pont2/kit/header/header.d.ts +37 -0
- package/dist/pont2/kit/index.d.ts +23 -0
- package/dist/pont2/kit/input-otp/input-otp.d.ts +7 -0
- package/dist/pont2/kit/layout/flow-error.d.ts +21 -0
- package/dist/pont2/kit/layout/layout.d.ts +120 -0
- package/dist/pont2/kit/link/link.d.ts +64 -0
- package/dist/pont2/kit/logo/logo.d.ts +57 -0
- package/dist/pont2/kit/otp-field/otp-field.d.ts +93 -0
- package/dist/pont2/kit/otp-field/otp-resend.d.ts +63 -0
- package/dist/pont2/kit/provider-field/provider-field.d.ts +87 -0
- package/dist/pont2/kit/qr-code/qr-code.d.ts +87 -0
- package/dist/pont2/kit/recovery-codes/recovery-codes.d.ts +65 -0
- package/dist/pont2/kit/scope-list/scope-list.d.ts +69 -0
- package/dist/pont2/kit/scope-list/scope-value.d.ts +16 -0
- package/dist/pont2/kit/secret/secret.d.ts +67 -0
- package/dist/pont2/kit/story-helpers.d.ts +9 -0
- package/dist/pont2/kit/typography/typography.d.ts +74 -0
- package/dist/pont2/kit/watermark/pontive-logo.d.ts +8 -0
- package/dist/pont2/kit/watermark/watermark.d.ts +44 -0
- package/dist/pont2/primitives/card/card.d.ts +3 -1
- package/dist/pont2/primitives/dropdown-menu/dropdown-menu.d.ts +5 -0
- package/dist/pont2/primitives/popover/popover.d.ts +2 -0
- package/dist/pont2/primitives/tooltip/tooltip.d.ts +2 -0
- package/dist/pont2/styles.css +3042 -935
- package/dist/pont2/theme/apply.d.ts +29 -0
- package/dist/pont2/theme/compile.d.ts +23 -0
- package/dist/pont2/theme/index.d.ts +23 -0
- package/dist/pont2/theme/manifest.d.ts +2 -0
- package/dist/pont2/theme/scopes.d.ts +13 -0
- package/dist/pont2/theme/shadcn.d.ts +7 -0
- package/dist/pont2/theme/tokens.json.d.ts +7009 -0
- package/dist/pont2/theme/types.d.ts +92 -0
- package/dist/pont2/theme/validate.d.ts +11 -0
- package/dist/pont2/theme/value.d.ts +10 -0
- package/dist/pont2/theme/vocabulary.d.ts +32 -0
- package/dist/pont2/theme.mjs +337 -0
- package/dist/pont2/theme.mjs.map +1 -0
- package/dist/pont2/tokens.json +7006 -0
- package/dist/pont2/with-legacy.css +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* # The action protocol: `pont2-action` + `respondWith()`
|
|
4
|
+
*
|
|
5
|
+
* Some elements start asynchronous work they must not own: a sign-in button
|
|
6
|
+
* starts a login-flow step, but the network call, the session and the next
|
|
7
|
+
* screen belong to whatever hosts the flow (a widget, a layout, the app).
|
|
8
|
+
* The element asks; an ancestor answers.
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* element ── pont2-action { action, data, respondWith } ──▶ ancestor (bubbles, composed)
|
|
12
|
+
* ancestor calls detail.respondWith(promise)
|
|
13
|
+
* element: busy until the promise settles
|
|
14
|
+
* element ── pont2-action-success { action, data, result } ──▶
|
|
15
|
+
* or pont2-action-error { action, data, error, message } ──▶
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* `respondWith()` must be called **synchronously, inside the listener** (as in
|
|
19
|
+
* a service worker's `FetchEvent`). That is deliberate: the dispatch happens
|
|
20
|
+
* inside the user's click, so work started in the listener still has the
|
|
21
|
+
* click's *transient user activation*, which WebAuthn (passkeys) and
|
|
22
|
+
* `window.open` (OAuth popups) require. Starting the work after an `await`
|
|
23
|
+
* would lose it.
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* widget.addEventListener("pont2-action", e => {
|
|
27
|
+
* if (e.detail.action) e.detail.respondWith(Auth.processLoginflowEvent({ event: e.detail.action }));
|
|
28
|
+
* });
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* Nobody responding is valid: the request event doubles as a click
|
|
32
|
+
* notification (the legacy kit's `<tag>:click`), and an element may then fall
|
|
33
|
+
* back to native behaviour (a submit button lets its form submit).
|
|
34
|
+
*
|
|
35
|
+
* Why an event and not an import: pont2 depends on no auth client, any
|
|
36
|
+
* framework can answer a DOM event, Storybook and tests answer with a fake,
|
|
37
|
+
* and the element never needs to know who is listening (docs/kit/auth-button.md).
|
|
38
|
+
*/
|
|
39
|
+
export interface ActionRequestDetail<D = Record<string, unknown>> {
|
|
40
|
+
/** What to do, e.g. a login-flow event id. May be absent (a plain click notification). */
|
|
41
|
+
action: string | undefined;
|
|
42
|
+
/** Context from the element (the provider, the form data…). */
|
|
43
|
+
data: D;
|
|
44
|
+
/** Hand the element the work's promise. Only valid during dispatch, at most once. */
|
|
45
|
+
respondWith(response: unknown): void;
|
|
46
|
+
}
|
|
47
|
+
export interface ActionSuccessDetail<D = Record<string, unknown>> {
|
|
48
|
+
action: string | undefined;
|
|
49
|
+
data: D;
|
|
50
|
+
result: unknown;
|
|
51
|
+
}
|
|
52
|
+
export interface ActionErrorDetail<D = Record<string, unknown>> {
|
|
53
|
+
action: string | undefined;
|
|
54
|
+
data: D;
|
|
55
|
+
error: unknown;
|
|
56
|
+
message: string;
|
|
57
|
+
}
|
|
58
|
+
export declare class ActionController implements ReactiveController {
|
|
59
|
+
private host;
|
|
60
|
+
/** True while a response is pending. The host re-renders when it changes. */
|
|
61
|
+
busy: boolean;
|
|
62
|
+
constructor(host: ReactiveControllerHost & HTMLElement);
|
|
63
|
+
hostConnected(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Fires `pont2-action` from the host. Returns `true` if a listener called
|
|
66
|
+
* `respondWith()` (the element is now busy), `false` otherwise or when
|
|
67
|
+
* already busy (one request at a time).
|
|
68
|
+
*/
|
|
69
|
+
request<D extends Record<string, unknown>>(action: string | undefined, data: D): boolean;
|
|
70
|
+
private track;
|
|
71
|
+
private setBusy;
|
|
72
|
+
}
|
|
73
|
+
declare global {
|
|
74
|
+
interface HTMLElementEventMap {
|
|
75
|
+
"pont2-action": CustomEvent<ActionRequestDetail>;
|
|
76
|
+
"pont2-action-success": CustomEvent<ActionSuccessDetail>;
|
|
77
|
+
"pont2-action-error": CustomEvent<ActionErrorDetail>;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
export interface CopiedDetail {
|
|
3
|
+
/** What was copied, e.g. "secret", "recovery-codes". Never the copied text. */
|
|
4
|
+
kind: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CopyErrorDetail {
|
|
7
|
+
kind: string;
|
|
8
|
+
error: unknown;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Copy-to-clipboard with transient "copied" feedback.
|
|
12
|
+
*
|
|
13
|
+
* `copy(text)` writes to the clipboard, sets `copied` for `duration` ms (the
|
|
14
|
+
* host re-renders), and fires `pont2-copied` / `pont2-copy-error`. The events
|
|
15
|
+
* deliberately carry no text: what gets copied here is secret (TOTP secrets,
|
|
16
|
+
* recovery codes), and events are observable by any script on the page.
|
|
17
|
+
*/
|
|
18
|
+
export declare class CopyController implements ReactiveController {
|
|
19
|
+
private host;
|
|
20
|
+
private kind;
|
|
21
|
+
private duration;
|
|
22
|
+
copied: boolean;
|
|
23
|
+
private timer;
|
|
24
|
+
constructor(host: ReactiveControllerHost & HTMLElement, kind: string, duration?: number);
|
|
25
|
+
hostConnected(): void;
|
|
26
|
+
hostDisconnected(): void;
|
|
27
|
+
copy(text: string): Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementEventMap {
|
|
31
|
+
"pont2-copied": CustomEvent<CopiedDetail>;
|
|
32
|
+
"pont2-copy-error": CustomEvent<CopyErrorDetail>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
|
+
import { AttrMap } from './attrs';
|
|
2
3
|
export declare const icons: {
|
|
3
|
-
check: () => TemplateResult<1>;
|
|
4
|
-
minus: () => TemplateResult<1>;
|
|
5
|
-
x: () => TemplateResult<1>;
|
|
6
|
-
chevronDown: () => TemplateResult<1>;
|
|
7
|
-
chevronUp: () => TemplateResult<1>;
|
|
8
|
-
chevronRight: () => TemplateResult<1>;
|
|
9
|
-
chevronLeft: () => TemplateResult<1>;
|
|
10
|
-
chevronsUpDown: () => TemplateResult<1>;
|
|
11
|
-
search: () => TemplateResult<1>;
|
|
12
|
-
circle: () => TemplateResult<1>;
|
|
13
|
-
loaderCircle: () => TemplateResult<1>;
|
|
14
|
-
circleAlert: () => TemplateResult<1>;
|
|
15
|
-
circleX: () => TemplateResult<1>;
|
|
16
|
-
circleCheck: () => TemplateResult<1>;
|
|
17
|
-
triangleAlert: () => TemplateResult<1>;
|
|
18
|
-
info: () => TemplateResult<1>;
|
|
4
|
+
check: (a?: AttrMap) => TemplateResult<1>;
|
|
5
|
+
minus: (a?: AttrMap) => TemplateResult<1>;
|
|
6
|
+
x: (a?: AttrMap) => TemplateResult<1>;
|
|
7
|
+
chevronDown: (a?: AttrMap) => TemplateResult<1>;
|
|
8
|
+
chevronUp: (a?: AttrMap) => TemplateResult<1>;
|
|
9
|
+
chevronRight: (a?: AttrMap) => TemplateResult<1>;
|
|
10
|
+
chevronLeft: (a?: AttrMap) => TemplateResult<1>;
|
|
11
|
+
chevronsUpDown: (a?: AttrMap) => TemplateResult<1>;
|
|
12
|
+
search: (a?: AttrMap) => TemplateResult<1>;
|
|
13
|
+
circle: (a?: AttrMap) => TemplateResult<1>;
|
|
14
|
+
loaderCircle: (a?: AttrMap) => TemplateResult<1>;
|
|
15
|
+
circleAlert: (a?: AttrMap) => TemplateResult<1>;
|
|
16
|
+
circleX: (a?: AttrMap) => TemplateResult<1>;
|
|
17
|
+
circleCheck: (a?: AttrMap) => TemplateResult<1>;
|
|
18
|
+
triangleAlert: (a?: AttrMap) => TemplateResult<1>;
|
|
19
|
+
info: (a?: AttrMap) => TemplateResult<1>;
|
|
20
|
+
eye: (a?: AttrMap) => TemplateResult<1>;
|
|
21
|
+
eyeOff: (a?: AttrMap) => TemplateResult<1>;
|
|
22
|
+
pencil: (a?: AttrMap) => TemplateResult<1>;
|
|
23
|
+
copy: (a?: AttrMap) => TemplateResult<1>;
|
|
24
|
+
download: (a?: AttrMap) => TemplateResult<1>;
|
|
25
|
+
arrowRight: (a?: AttrMap) => TemplateResult<1>;
|
|
26
|
+
userRoundKey: (a?: AttrMap) => TemplateResult<1>;
|
|
19
27
|
};
|
|
20
28
|
export type IconName = keyof typeof icons;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* | identity attr | `data-pont2-<identity>` | `data-pont2-alert` (tier-neutral: "this is an alert") |
|
|
9
9
|
* | slot attr | `data-slot="<name>"` | `data-slot="item-separator"` (shadcn's own, unprefixed) |
|
|
10
10
|
* | state attrs | `data-<state>` | `data-checked`, `data-open` (Base UI's own, unprefixed) |
|
|
11
|
-
* | CSS custom prop | `--pont2-<
|
|
11
|
+
* | CSS custom prop | `--pont2-sem-<role>` … | `--pont2-sem-color-primary` (docs/11-tokens.md) |
|
|
12
12
|
* | cascade layer | `pont2.<layer>` | `pont2.primitives`, `pont2.kit` |
|
|
13
13
|
* | custom event | `pont2-<name>` | `pont2-open-change` |
|
|
14
14
|
*
|
package/dist/pont2/globals.css
CHANGED
|
@@ -11,7 +11,19 @@
|
|
|
11
11
|
* itself to look like a shadcn app. It is global by nature (it styles
|
|
12
12
|
* `body` and `*`), which is why it is not part of styles.css.
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
/* ./layers.css */
|
|
15
|
+
/*
|
|
16
|
+
* The pont2 cascade-layer order: the ONE statement, shared by every pont2
|
|
17
|
+
* stylesheet (styles.css, globals.css, with-legacy.css and compiled themes).
|
|
18
|
+
*
|
|
19
|
+
* The first @layer statement a browser meets fixes the order, so every entry
|
|
20
|
+
* starts with this one; a theme loaded before styles.css can then never land
|
|
21
|
+
* below the recipes (docs/11-tokens.md §7).
|
|
22
|
+
*
|
|
23
|
+
* reset < tokens < base < primitives < kit < theme.preset < theme.brand
|
|
24
|
+
* < unlayered app CSS
|
|
25
|
+
*/
|
|
26
|
+
@layer pont2.reset, pont2.tokens, pont2.base, pont2.primitives, pont2.kit, pont2.theme.preset, pont2.theme.brand;
|
|
15
27
|
|
|
16
28
|
@layer pont2.reset {
|
|
17
29
|
*,
|
|
@@ -22,7 +34,7 @@
|
|
|
22
34
|
box-sizing: border-box;
|
|
23
35
|
margin: 0;
|
|
24
36
|
padding: 0;
|
|
25
|
-
border: 0 solid var(--pont2-border);
|
|
37
|
+
border: 0 solid var(--pont2-sem-color-border);
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
html,
|
|
@@ -30,18 +42,18 @@
|
|
|
30
42
|
line-height: 1.5;
|
|
31
43
|
-webkit-text-size-adjust: 100%;
|
|
32
44
|
tab-size: 4;
|
|
33
|
-
font-family: var(--pont2-font-sans);
|
|
45
|
+
font-family: var(--pont2-sem-font-sans);
|
|
34
46
|
-webkit-tap-highlight-color: transparent;
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
* {
|
|
38
|
-
outline-color: color-mix(in oklab, var(--pont2-ring) 50%, transparent);
|
|
50
|
+
outline-color: color-mix(in oklab, var(--pont2-sem-color-ring) 50%, transparent);
|
|
39
51
|
}
|
|
40
52
|
|
|
41
53
|
body {
|
|
42
54
|
line-height: inherit;
|
|
43
|
-
background-color: var(--pont2-background);
|
|
44
|
-
color: var(--pont2-foreground);
|
|
55
|
+
background-color: var(--pont2-sem-color-background);
|
|
56
|
+
color: var(--pont2-sem-color-foreground);
|
|
45
57
|
}
|
|
46
58
|
|
|
47
59
|
h1, h2, h3, h4, h5, h6 {
|
|
@@ -59,7 +71,7 @@
|
|
|
59
71
|
}
|
|
60
72
|
|
|
61
73
|
code, kbd, samp, pre {
|
|
62
|
-
font-family: var(--pont2-font-mono);
|
|
74
|
+
font-family: var(--pont2-sem-font-mono);
|
|
63
75
|
font-size: 1em;
|
|
64
76
|
}
|
|
65
77
|
|