@pontive/pontkit-core 1.28.0 → 1.30.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.
Files changed (43) hide show
  1. package/catalog.json +1 -1
  2. package/custom-elements.json +1 -1
  3. package/dist/components/renderers/auth/scope-list/_scope-list.d.ts +1 -1
  4. package/dist/components/renderers/auth/scope-list/scope-list.types.d.ts +1 -1
  5. package/dist/components/widgets/pont-consent/consent-api.d.ts +1 -1
  6. package/dist/components/widgets/pont-consent/pont-consent.d.ts +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/pont2/core/names.d.ts +1 -1
  10. package/dist/pont2/globals.css +19 -7
  11. package/dist/pont2/index.mjs +678 -617
  12. package/dist/pont2/index.mjs.map +1 -1
  13. package/dist/pont2/kit/alert/alert.d.ts +2 -1
  14. package/dist/pont2/kit/block/block.d.ts +3 -1
  15. package/dist/pont2/kit/flow-widget/preview.d.ts +46 -0
  16. package/dist/pont2/kit/index.d.ts +1 -0
  17. package/dist/pont2/kit/link/link.d.ts +2 -0
  18. package/dist/pont2/kit/otp-field/otp-resend.d.ts +2 -0
  19. package/dist/pont2/kit/qr-code/qr-code.d.ts +1 -0
  20. package/dist/pont2/kit/recovery-codes/recovery-codes.d.ts +1 -0
  21. package/dist/pont2/kit/typography/typography.d.ts +4 -0
  22. package/dist/pont2/kit/watermark/watermark.d.ts +2 -0
  23. package/dist/pont2/primitives/card/card.d.ts +3 -1
  24. package/dist/pont2/primitives/dropdown-menu/dropdown-menu.d.ts +5 -0
  25. package/dist/pont2/primitives/popover/popover.d.ts +2 -0
  26. package/dist/pont2/primitives/tooltip/tooltip.d.ts +2 -0
  27. package/dist/pont2/styles.css +2433 -1026
  28. package/dist/pont2/theme/apply.d.ts +29 -0
  29. package/dist/pont2/theme/compile.d.ts +23 -0
  30. package/dist/pont2/theme/index.d.ts +23 -0
  31. package/dist/pont2/theme/manifest.d.ts +2 -0
  32. package/dist/pont2/theme/scopes.d.ts +13 -0
  33. package/dist/pont2/theme/shadcn.d.ts +7 -0
  34. package/dist/pont2/theme/tokens.json.d.ts +7009 -0
  35. package/dist/pont2/theme/types.d.ts +92 -0
  36. package/dist/pont2/theme/validate.d.ts +11 -0
  37. package/dist/pont2/theme/value.d.ts +10 -0
  38. package/dist/pont2/theme/vocabulary.d.ts +32 -0
  39. package/dist/pont2/theme.mjs +337 -0
  40. package/dist/pont2/theme.mjs.map +1 -0
  41. package/dist/pont2/tokens.json +7006 -0
  42. package/dist/pont2/with-legacy.css +1 -1
  43. package/package.json +8 -2
@@ -28,7 +28,7 @@ export type AlertStatus = (typeof ALERT_STATUSES)[number];
28
28
  * with the primitive's attributes), not nested elements.
29
29
  * - **What it adds** over shadcn: `status` (`error` maps to shadcn's
30
30
  * `destructive` variant; `warning`/`success`/`info` are coloured in
31
- * `@layer pont2.kit` with the `--pont2-success|warning|info` tokens), a
31
+ * `@layer pont2.kit` with the `--pont2-sem-color-success|warning|info` tokens), a
32
32
  * status icon, and a status-appropriate role (`alert` for error/warning,
33
33
  * `status` otherwise, as the legacy `pont-alert` did). An author `role`
34
34
  * attribute still wins.
@@ -43,6 +43,7 @@ export type AlertStatus = (typeof ALERT_STATUSES)[number];
43
43
  * @attr heading - the alert title text
44
44
  * @attr description - the description text
45
45
  * @attr icon - show the status icon
46
+ * @cssprop --pont2-alert-warning-fg, --pont2-alert-success-fg, --pont2-alert-info-fg - status colours (default the sem status colours)
46
47
  */
47
48
  export declare class KitAlert extends Alert {
48
49
  static composite: boolean;
@@ -44,8 +44,10 @@ export type BlockJustify = "start" | "center" | "end";
44
44
  * @attr align - stretch (default) | start | center | end: the content's cross-axis alignment
45
45
  * @attr justify - start (default) | center | end: when the block is taller than its content
46
46
  * @attr size - default | sm (the Card primitive's spacing)
47
- * @cssprop --pont2-block-width - max width on wider screens (default 24rem)
47
+ * @cssprop --pont2-block-max-width - max width on wider screens (default 24rem)
48
48
  * @cssprop --pont2-block-gap - gap between children (default 1rem)
49
+ * @cssprop --pont2-block-bg, --pont2-block-fg, --pont2-block-border-color, --pont2-block-radius, --pont2-block-shadow, --pont2-block-spacing - the screen card (fall back to the Card's tokens)
50
+ * @cssprop --pont2-block-footer-bg - the watermark band
49
51
  */
50
52
  export declare class Block extends Card {
51
53
  static composite: boolean;
@@ -0,0 +1,46 @@
1
+ import { WidgetClient } from './flow-widget';
2
+ export interface PreviewScreen {
3
+ /** A name for a screen picker. */
4
+ label: string;
5
+ /** The widget to preview it in (its tag is `pont2-<flow>`). */
6
+ flow: "signin" | "signup";
7
+ /** The screen, as a render spec would write it. */
8
+ spec: string;
9
+ }
10
+ /** Sample screens for a branding preview, keyed by id. */
11
+ export declare const PREVIEW_SCREENS: {
12
+ readonly signin: {
13
+ readonly label: "Sign in";
14
+ readonly flow: "signin";
15
+ readonly spec: "<pont2-block>\n <pont2-header>\n <pont2-title content=\"Welcome back\"></pont2-title>\n <pont2-subtitle content=\"Sign in to your account\"></pont2-subtitle>\n </pont2-header>\n <pont2-provider-field providers=\"google apple github\"></pont2-provider-field>\n <pont2-divider label=\"Or continue with\"></pont2-divider>\n <pont2-identifier-field identifiers=\"email username\" required></pont2-identifier-field>\n <pont2-submit-button event=\"submit_identifier\" label=\"Continue\"></pont2-submit-button>\n <pont2-passkey-button content=\"icon-label\" event=\"passkey\"></pont2-passkey-button>\n <pont2-link prompt=\"Don't have an account?\" label=\"Sign up\" event=\"goto_signup\"></pont2-link>\n</pont2-block>";
16
+ };
17
+ readonly password: {
18
+ readonly label: "Password";
19
+ readonly flow: "signin";
20
+ readonly spec: "<pont2-block>\n <pont2-header>\n <pont2-title content=\"Enter your password\"></pont2-title>\n </pont2-header>\n <pont2-edit-identifier identifier=\"ada@example.com\" event=\"change_identifier\"></pont2-edit-identifier>\n <pont2-password-field required rules=\"[]\" forgot forgot-event=\"forgot_password\"></pont2-password-field>\n <pont2-submit-button event=\"submit_password\" label=\"Sign in\"></pont2-submit-button>\n</pont2-block>";
21
+ };
22
+ readonly verify: {
23
+ readonly label: "Verification code";
24
+ readonly flow: "signin";
25
+ readonly spec: "<pont2-block>\n <pont2-header>\n <pont2-title content=\"Check your email\"></pont2-title>\n <pont2-subtitle content=\"We sent a 6-digit code to ada@example.com\"></pont2-subtitle>\n </pont2-header>\n <pont2-alert status=\"info\" icon description=\"The code expires in 10 minutes.\"></pont2-alert>\n <pont2-container align=\"center\">\n <pont2-otp-field layout=\"simple\" required></pont2-otp-field>\n </pont2-container>\n <pont2-submit-button event=\"verify_code\" label=\"Verify\"></pont2-submit-button>\n <pont2-otp-resend duration=\"30\" event=\"resend_code\"></pont2-otp-resend>\n</pont2-block>";
26
+ };
27
+ readonly signup: {
28
+ readonly label: "Sign up";
29
+ readonly flow: "signup";
30
+ readonly spec: "<pont2-block>\n <pont2-header>\n <pont2-title content=\"Create an account\"></pont2-title>\n <pont2-subtitle content=\"It only takes a minute\"></pont2-subtitle>\n </pont2-header>\n <pont2-name-field required></pont2-name-field>\n <pont2-email-field required></pont2-email-field>\n <pont2-password-field required></pont2-password-field>\n <pont2-confirm-field required></pont2-confirm-field>\n <pont2-submit-button event=\"submit_signup\" label=\"Create account\"></pont2-submit-button>\n <pont2-link prompt=\"Already have an account?\" label=\"Sign in\" event=\"goto_signin\"></pont2-link>\n</pont2-block>";
31
+ };
32
+ };
33
+ export type PreviewScreenId = keyof typeof PREVIEW_SCREENS;
34
+ export interface PreviewClientOptions {
35
+ /** How long each request stays busy, in ms, so busy states can be seen (default 600). */
36
+ delay?: number;
37
+ /** The flow's localised messages (flow errors, "Start again" …). */
38
+ messages?: Record<string, string>;
39
+ }
40
+ /**
41
+ * A `WidgetClient` that shows one screen and never leaves it. Every request
42
+ * (a submit, a provider button, a link) is busy for `delay` ms and then
43
+ * resolves without a new screen, so the screen and what was typed stay put.
44
+ * Nothing is sent anywhere.
45
+ */
46
+ export declare function previewClient(spec: string, options?: PreviewClientOptions): WidgetClient;
@@ -24,3 +24,4 @@ export * from './recovery-codes/recovery-codes';
24
24
  export * from './scope-list/scope-list';
25
25
  export * from './layout/layout';
26
26
  export * from './flow-widget/flow-widget';
27
+ export * from './flow-widget/preview';
@@ -30,6 +30,8 @@ export type LinkAlign = "start" | "center" | "end";
30
30
  * @attr href, target, rel - render a real link instead
31
31
  * @attr align - start | center (default) | end
32
32
  * @attr disabled, loading
33
+ * @cssprop --pont2-link-fg - the row's text (default muted-foreground)
34
+ * @cssprop --pont2-link-button-fg, --pont2-link-button-fg-hover - the link (default the row's colour; primary on hover)
33
35
  * @fires pont2-action, pont2-action-success, pont2-action-error
34
36
  */
35
37
  export declare class Link extends HostElement {
@@ -29,6 +29,8 @@ import { HostElement } from '../../core/host-element';
29
29
  * @attr event - the action requested on press
30
30
  * @attr label - button text (default "Resend code")
31
31
  * @attr countdown-text - text before the seconds (default "Resend code in ")
32
+ * @cssprop --pont2-otp-resend-fg - the row's text (default muted-foreground)
33
+ * @cssprop --pont2-otp-resend-button-fg, --pont2-otp-resend-button-fg-hover - the link (default the row's colour; primary on hover)
32
34
  * @fires pont2-action, pont2-action-success, pont2-action-error
33
35
  */
34
36
  export declare class OtpResend extends HostElement {
@@ -47,6 +47,7 @@ export interface QrDetail {
47
47
  * @attr label - accessible name of the image (default "QR code")
48
48
  * @attr reveal-label - the button text (default "Show QR code")
49
49
  * @attr disabled - never obscures, and disables the button
50
+ * @cssprop --pont2-qr-code-width - the image width (default 12rem)
50
51
  * @fires pont2-qr-obscured, pont2-qr-revealed - `{ url }`
51
52
  * @fires pont2-qr-error - `{ url }` when the text cannot be encoded
52
53
  */
@@ -31,6 +31,7 @@ import { HostElement } from '../../core/host-element';
31
31
  * @attr title-text, description, empty-text, copy-label, download-label, copied-text - copy
32
32
  * @attr filename - download file name (default "recovery-codes.txt")
33
33
  * @attr disabled
34
+ * @cssprop --pont2-recovery-codes-list-bg, --pont2-recovery-codes-list-radius - the code list's surface (default muted, radius-md)
34
35
  * @fires pont2-copied, pont2-copy-error, pont2-recovery-codes-downloaded
35
36
  */
36
37
  export declare class RecoveryCodes extends HostElement {
@@ -38,6 +38,9 @@ declare abstract class TextShell extends ShellElement {
38
38
  * @attr level - 1 (default) | 2 | 3 | 4: the native heading level
39
39
  * @attr content - the heading text
40
40
  * @attr align - auto (default: inherit) | start | center | end
41
+ * @cssprop --pont2-title-fg, --pont2-title-font-weight - colour and weight (default foreground, semibold)
42
+ * @cssprop --pont2-title-h1-font-size … --pont2-title-h4-font-size - size per level (default text-2xl, -xl, -lg, -base)
43
+ * @cssprop --pont2-title-h1-font-weight - level 1 weight (default the title weight, else bold)
41
44
  */
42
45
  export declare class Title extends TextShell {
43
46
  static properties: PropertyDeclarations;
@@ -57,6 +60,7 @@ export declare class Title extends TextShell {
57
60
  *
58
61
  * @tag pont2-subtitle
59
62
  * @attr content, align - as Title
63
+ * @cssprop --pont2-subtitle-fg, --pont2-subtitle-font-size - colour and size (default muted-foreground, text-sm)
60
64
  */
61
65
  export declare class Subtitle extends TextShell {
62
66
  render(): TemplateResult;
@@ -22,6 +22,8 @@ export declare function watermarkContent(label: string, logoAlign: WatermarkLogo
22
22
  * @attr variant - brand (default: the mark in Pontive indigo) | theme (currentColor) | muted (muted text)
23
23
  * @attr logo-align - start | end (default)
24
24
  * @attr label - default "Powered by"
25
+ * @cssprop --pont2-watermark-brand-icon-color - the mark in the brand variant (default #6366f1)
26
+ * @cssprop --pont2-watermark-muted-fg - text and mark in the muted variant (default muted-foreground)
25
27
  */
26
28
  export declare class Watermark extends HostElement {
27
29
  static identity: string;
@@ -10,7 +10,9 @@ export type CardSize = "default" | "sm";
10
10
  *
11
11
  * @tag pont2-prim-card
12
12
  * @attr size - default | sm
13
- * @cssprop --pont2-card-spacing - padding/gap unit (1.5rem, 1rem when size="sm")
13
+ * @cssprop --pont2-card-spacing - padding/gap unit (default 1.5rem)
14
+ * @cssprop --pont2-card-sm-spacing - the same for size="sm" (default 1rem)
15
+ * @cssprop --pont2-card-bg, --pont2-card-fg, --pont2-card-border-color, --pont2-card-radius, --pont2-card-shadow - see docs/11-tokens.md
14
16
  */
15
17
  export declare class Card extends HostElement {
16
18
  static identity: string;
@@ -74,6 +74,11 @@ export declare class DropdownMenuTrigger extends PopupTrigger {
74
74
  * @tag pont2-prim-dropdown-menu-content
75
75
  * @attr side - bottom (default) … @attr align - start (default) …
76
76
  * @attr side-offset - 4 @attr align-offset - 0
77
+ * @cssprop --pont2-dropdown-menu-bg, --pont2-dropdown-menu-fg, --pont2-dropdown-menu-border-color, --pont2-dropdown-menu-radius, --pont2-dropdown-menu-shadow - see docs/11-tokens.md
78
+ * @cssprop --pont2-dropdown-menu-min-width, --pont2-dropdown-menu-padding-x, --pont2-dropdown-menu-padding-y - sizes (defaults 8rem, 0.25rem, 0.25rem)
79
+ * @cssprop --pont2-dropdown-menu-sub-content-shadow - submenu shadow (default: the menu shadow token, else shadow-lg)
80
+ * @cssprop --pont2-dropdown-menu-item-radius, --pont2-dropdown-menu-item-bg-focus, --pont2-dropdown-menu-item-fg-focus - items, inherited from the content
81
+ * @cssprop --pont2-dropdown-menu-item-destructive-fg, --pont2-dropdown-menu-item-destructive-bg-focus - variant="destructive" items
77
82
  */
78
83
  export declare class DropdownMenuContent extends PopupContent {
79
84
  static identity: string;
@@ -47,6 +47,8 @@ export declare class PopoverTrigger extends PopupTrigger {
47
47
  * @attr align - center (default) | start | end
48
48
  * @attr side-offset - default 4
49
49
  * @attr align-offset - default 0
50
+ * @cssprop --pont2-popover-bg, --pont2-popover-fg, --pont2-popover-border-color, --pont2-popover-radius, --pont2-popover-shadow - see docs/11-tokens.md
51
+ * @cssprop --pont2-popover-width, --pont2-popover-padding-x, --pont2-popover-padding-y, --pont2-popover-gap - sizes (defaults 18rem, 1rem, 1rem, 1rem)
50
52
  */
51
53
  export declare class PopoverContent extends PopupContent {
52
54
  static identity: string;
@@ -53,6 +53,8 @@ export declare class TooltipTrigger extends PopupTrigger {
53
53
  * The tooltip popup (`role=tooltip`), `side="top"` by default.
54
54
  *
55
55
  * @tag pont2-prim-tooltip-content
56
+ * @cssprop --pont2-tooltip-bg, --pont2-tooltip-fg, --pont2-tooltip-radius - see docs/11-tokens.md (the arrow shares the background)
57
+ * @cssprop --pont2-tooltip-max-width, --pont2-tooltip-padding-x, --pont2-tooltip-padding-y - sizes (defaults 20rem, 0.75rem, 0.375rem)
56
58
  */
57
59
  export declare class TooltipContent extends PopupContent {
58
60
  static identity: string;