@bchconnect/ui 0.0.0-stage → 0.1.1

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 (68) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +280 -2
  3. package/custom-elements.json +1771 -0
  4. package/dist/assets.generated.js +28 -0
  5. package/dist/assets.generated.js.map +1 -0
  6. package/dist/bchconnect-modal.d.ts +89 -0
  7. package/dist/bchconnect-modal.js +121 -0
  8. package/dist/bchconnect-modal.js.map +1 -0
  9. package/dist/code.js +130 -0
  10. package/dist/code.js.map +1 -0
  11. package/dist/defaults.d.ts +50 -0
  12. package/dist/defaults.js +139 -0
  13. package/dist/defaults.js.map +1 -0
  14. package/dist/define.d.ts +17 -0
  15. package/dist/define.js +23 -0
  16. package/dist/define.js.map +1 -0
  17. package/dist/directory.js +37 -0
  18. package/dist/directory.js.map +1 -0
  19. package/dist/faces.js +80 -0
  20. package/dist/faces.js.map +1 -0
  21. package/dist/gesture.js +78 -0
  22. package/dist/gesture.js.map +1 -0
  23. package/dist/headless.d.ts +99 -0
  24. package/dist/headless.js +190 -0
  25. package/dist/headless.js.map +1 -0
  26. package/dist/html.js +17 -0
  27. package/dist/html.js.map +1 -0
  28. package/dist/icons.js +21 -0
  29. package/dist/icons.js.map +1 -0
  30. package/dist/index.d.ts +32 -0
  31. package/dist/index.js +8 -0
  32. package/dist/locales/es.d.ts +12 -0
  33. package/dist/locales/es.js +50 -0
  34. package/dist/locales/es.js.map +1 -0
  35. package/dist/messages.d.ts +95 -0
  36. package/dist/messages.js +63 -0
  37. package/dist/messages.js.map +1 -0
  38. package/dist/modal.d.ts +112 -0
  39. package/dist/modal.js +700 -0
  40. package/dist/modal.js.map +1 -0
  41. package/dist/motion.js +160 -0
  42. package/dist/motion.js.map +1 -0
  43. package/dist/page-scroll.js +28 -0
  44. package/dist/page-scroll.js.map +1 -0
  45. package/dist/register.js +14 -0
  46. package/dist/register.js.map +1 -0
  47. package/dist/sheet-query.js +8 -0
  48. package/dist/sheet-query.js.map +1 -0
  49. package/dist/sheet.js +329 -0
  50. package/dist/sheet.js.map +1 -0
  51. package/dist/state.d.ts +175 -0
  52. package/dist/state.js +11 -0
  53. package/dist/state.js.map +1 -0
  54. package/dist/styles/modal.css.sheet.js +13 -0
  55. package/dist/styles/modal.css.sheet.js.map +1 -0
  56. package/dist/styles/theme.generated.css.sheet.js +13 -0
  57. package/dist/styles/theme.generated.css.sheet.js.map +1 -0
  58. package/dist/styles/toast.css.sheet.js +13 -0
  59. package/dist/styles/toast.css.sheet.js.map +1 -0
  60. package/dist/styles/tokens.css.sheet.js +13 -0
  61. package/dist/styles/tokens.css.sheet.js.map +1 -0
  62. package/dist/theme.generated.d.ts +105 -0
  63. package/dist/theme.generated.js +96 -0
  64. package/dist/theme.generated.js.map +1 -0
  65. package/dist/toast.d.ts +96 -0
  66. package/dist/toast.js +180 -0
  67. package/dist/toast.js.map +1 -0
  68. package/package.json +87 -3
@@ -0,0 +1,112 @@
1
+
2
+ import { ModalScreen, ModalView, ProtocolId } from "./state.js";
3
+ import { BchcMessages } from "./messages.js";
4
+ import { CSSResultGroup, LitElement, PropertyDeclarations, PropertyValues } from "lit";
5
+ //#region src/modal.d.ts
6
+ /**
7
+ * Events representing what the modal asks the caller to do.
8
+ *
9
+ * @beta
10
+ */
11
+ export interface BchcModalEvents {
12
+ /**
13
+ * Fired when the visitor selects a wallet, and before `bchc-protocol` when a
14
+ * tab change pins the default wallet. When the selected wallet lacks the
15
+ * current session type, `bchc-protocol` follows with the first one it speaks.
16
+ */
17
+ "bchc-wallet": CustomEvent<{
18
+ wallet: string;
19
+ }>;
20
+ /** Fired when the visitor picks a different session type. */
21
+ "bchc-protocol": CustomEvent<{
22
+ protocol: ProtocolId;
23
+ }>;
24
+ /** Fired when the visitor moves between the connect and wallets screens. */
25
+ "bchc-screen": CustomEvent<{
26
+ screen: ModalScreen;
27
+ }>;
28
+ /** Fired once the exit has played. Remove the element on it. */
29
+ "bchc-close": CustomEvent<void>;
30
+ /** Fired when "Try again" is pressed after a failure. */
31
+ "bchc-retry": CustomEvent<void>;
32
+ }
33
+ /**
34
+ * The `<bchc-modal>` web component
35
+ *
36
+ * @tag bchc-modal
37
+ *
38
+ * @attr {BchcAccent} data-bchc-accent - Curated accent color.
39
+ * @attr {BchcNeutral} data-bchc-neutral - Neutral family override; each accent has a default pairing.
40
+ * @attr {BchcRadius} data-bchc-radius - Corner radius preset applied to every rounded part.
41
+ * @attr {BchcFont} data-bchc-font - Font stack; `brand` falls back to `system` until a face is injected.
42
+ * @attr {BchcBlur} data-bchc-blur - Backdrop blur behind the modal.
43
+ * @attr {BchcMode} data-bchc-mode - Color scheme; `auto` follows `prefers-color-scheme`.
44
+ *
45
+ * @fires {CustomEvent<{ wallet: string }>} bchc-wallet - Fired when the visitor selects a wallet, and before `bchc-protocol` when a tab change pins the default wallet; `bchc-protocol` follows when the selected wallet lacks the current session type.
46
+ * @fires {CustomEvent<{ protocol: ProtocolId }>} bchc-protocol - Fired when the visitor picks a different session type.
47
+ * @fires {CustomEvent<{ screen: ModalScreen }>} bchc-screen - Fired when the visitor moves between the connect and wallets screens.
48
+ * @fires {CustomEvent<void>} bchc-close - Fired once the exit has played. Remove the element on it, or set `view` to `null` before showing it again.
49
+ * @fires {CustomEvent<void>} bchc-retry - Fired when "Try again" is pressed after a failure.
50
+ *
51
+ * @cssprop --bchc-font-brand-family - Brand font family read when `data-bchc-font="brand"`; falls back to the system stack until set.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * defineElements();
56
+ * const modal = document.createElement("bchc-modal") as BchcModal;
57
+ * modal.view = view;
58
+ * modal.addEventListener("bchc-wallet", (event) => { ... });
59
+ * modal.addEventListener("bchc-protocol", (event) => { ... });
60
+ * modal.addEventListener("bchc-close", () => modal.remove());
61
+ * document.body.append(modal);
62
+ * ```
63
+ *
64
+ * @beta
65
+ */
66
+ export declare class BchcModal extends LitElement {
67
+ #private;
68
+ /** Lit's reactive property declarations. @internal */
69
+ static override properties: PropertyDeclarations;
70
+ /** Lit's adopted style sheets. @internal */
71
+ static override styles: CSSResultGroup;
72
+ /** The state to render. Setting it re-renders the modal. */
73
+ view: ModalView | null;
74
+ /**
75
+ * Overrides for the strings this element shows and announces.
76
+ *
77
+ * @defaultValue `null`
78
+ */
79
+ messages: Partial<BchcMessages> | null;
80
+ private _appearance;
81
+ private _bodyView;
82
+ private _bodyKey;
83
+ private _sheet;
84
+ private _rtl;
85
+ private _title;
86
+ private _caption;
87
+ private _captionWallet;
88
+ private _status;
89
+ private _copied;
90
+ private _linkFailed;
91
+ private _brokenLogos;
92
+ constructor();
93
+ /** Called by the browser when the element is attached. @internal */
94
+ override connectedCallback(): void;
95
+ /** Called by the browser when the element is detached. @internal */
96
+ override disconnectedCallback(): void;
97
+ /**
98
+ * Plays the exit, then emits `bchc-close`. A second call while the first
99
+ * is still playing does nothing.
100
+ */
101
+ close(): Promise<void>;
102
+ /** Lit hook run before each render; derives the shell and body state from `view`. @internal */
103
+ protected override willUpdate(changed: PropertyValues<this>): void;
104
+ /** Lit hook committing the template; a body rebuild is committed inside its motion. @internal */
105
+ protected override update(changed: PropertyValues<this>): void;
106
+ /** Lit hook producing the template. @internal */
107
+ protected override render(): unknown;
108
+ /** Lit hook run after each render. @internal */
109
+ protected override updated(): void;
110
+ }
111
+ //#endregion
112
+ //# sourceMappingURL=modal.d.ts.map