@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
package/dist/toast.js ADDED
@@ -0,0 +1,180 @@
1
+
2
+ import { icon } from "./icons.js";
3
+ import { mergeMessages } from "./messages.js";
4
+ import { animationsFinished } from "./motion.js";
5
+ import theme_generated_css_sheet_default from "./styles/theme.generated.css.sheet.js";
6
+ import tokens_css_sheet_default from "./styles/tokens.css.sheet.js";
7
+ import toast_css_sheet_default from "./styles/toast.css.sheet.js";
8
+ import { LitElement, html, nothing } from "lit";
9
+ import { keyed } from "lit/directives/keyed.js";
10
+ //#region src/toast.ts
11
+ const DEFAULT_DURATION = 3600;
12
+ /**
13
+ * The `<bchc-toast>` custom element, confirming a successful connection. It is
14
+ * separate from the modal so it can outlive it; it never blocks the page, and a
15
+ * dapp with its own notifications can leave it out.
16
+ *
17
+ * @tag bchc-toast
18
+ *
19
+ * @attr {BchcAccent} data-bchc-accent - Curated accent color.
20
+ * @attr {BchcNeutral} data-bchc-neutral - Neutral family override; each accent has a default pairing.
21
+ * @attr {BchcRadius} data-bchc-radius - Corner radius preset applied to every rounded part.
22
+ * @attr {BchcFont} data-bchc-font - Font stack; `brand` falls back to `system` until a face is injected.
23
+ * @attr {BchcMode} data-bchc-mode - Color scheme; `auto` follows `prefers-color-scheme`.
24
+ *
25
+ * @fires {CustomEvent<void>} bchc-dismiss - Fired once the exit has played. Remove the element on it.
26
+ *
27
+ * @cssprop --bchc-font-brand-family - Brand font family read when `data-bchc-font="brand"`; falls back to the system stack until set.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * defineElements();
32
+ * const toast = document.createElement("bchc-toast") as BchcToast;
33
+ * toast.view = { walletName: "Cashonize", walletLogo: "/cashonize.png" };
34
+ * toast.addEventListener("bchc-dismiss", () => toast.remove());
35
+ * document.body.append(toast);
36
+ * ```
37
+ *
38
+ * @beta
39
+ */
40
+ var BchcToast = class extends LitElement {
41
+ /** Lit's reactive property declarations. @internal */
42
+ static properties = {
43
+ view: { attribute: false },
44
+ messages: { attribute: false },
45
+ _appearance: { state: true }
46
+ };
47
+ /** Lit's adopted style sheets. @internal */
48
+ static styles = [
49
+ theme_generated_css_sheet_default,
50
+ tokens_css_sheet_default,
51
+ toast_css_sheet_default
52
+ ];
53
+ /**
54
+ * How long the toast stays before it dismisses itself, in milliseconds.
55
+ * Hovering or focusing it pauses the countdown. `Infinity` keeps it until
56
+ * {@link BchcToast.dismiss} is called or the visitor dismisses it. Setting
57
+ * it while the toast is shown restarts the countdown.
58
+ *
59
+ * @defaultValue `3600`
60
+ */
61
+ get duration() {
62
+ return this.#duration;
63
+ }
64
+ set duration(next) {
65
+ this.#duration = next;
66
+ if (!this.#shown() || this.#exiting) return;
67
+ if (this.#timer !== null) clearTimeout(this.#timer);
68
+ this.#timer = null;
69
+ this.#remainingMs = next;
70
+ if (this.#pauseCount === 0) this.#startTimer(next);
71
+ }
72
+ #timer = null;
73
+ #exiting = false;
74
+ #duration = DEFAULT_DURATION;
75
+ get #messages() {
76
+ return mergeMessages(this.messages);
77
+ }
78
+ #remainingMs = DEFAULT_DURATION;
79
+ #timerStartedAt = 0;
80
+ #pauseCount = 0;
81
+ constructor() {
82
+ super();
83
+ this.view = null;
84
+ this.messages = null;
85
+ this._appearance = 0;
86
+ }
87
+ /** Called by the browser when the element is detached. @internal */
88
+ disconnectedCallback() {
89
+ super.disconnectedCallback();
90
+ if (this.#timer !== null) clearTimeout(this.#timer);
91
+ this.#timer = null;
92
+ this.#exiting = false;
93
+ this.#pauseCount = 0;
94
+ this._appearance += 1;
95
+ }
96
+ /** Play the exit, then tell the caller. A second call does nothing. */
97
+ async dismiss() {
98
+ await this.updateComplete;
99
+ const toastElement = this.renderRoot.querySelector(".toast");
100
+ if (!(toastElement instanceof HTMLElement) || this.#exiting) return;
101
+ this.#exiting = true;
102
+ if (this.#timer !== null) clearTimeout(this.#timer);
103
+ this.#timer = null;
104
+ toastElement.classList.add("is-exiting");
105
+ await animationsFinished(toastElement);
106
+ this.dispatchEvent(new CustomEvent("bchc-dismiss", {
107
+ bubbles: true,
108
+ composed: true
109
+ }));
110
+ }
111
+ /** Lit hook producing the template. @internal */
112
+ render() {
113
+ const view = this.view;
114
+ if (view === null) return nothing;
115
+ const logo = view.walletLogo;
116
+ const messages = this.#messages;
117
+ return keyed(this._appearance, html`<div
118
+ class="toast"
119
+ lang=${messages.lang}
120
+ @click=${this.#onClick}
121
+ @pointerenter=${this.#onPauseStart}
122
+ @pointerleave=${this.#onPauseEnd}
123
+ @focusin=${this.#onPauseStart}
124
+ @focusout=${this.#onPauseEnd}
125
+ >
126
+ <span class="toast-live" role="status">
127
+ <span class=${logo === null ? "done-mark is-bare" : "done-mark"}>
128
+ ${logo === null ? nothing : html`<img src=${logo} alt="" width="44" height="44" />`}
129
+ <span class="check">${icon("check")}</span>
130
+ </span>
131
+ <span class="done-title">${view.walletName === null ? messages.walletConnected : messages.connectedTo(view.walletName)}</span>
132
+ </span>
133
+ <button class="toast-dismiss" type="button" aria-label=${messages.dismiss}></button>
134
+ </div>`);
135
+ }
136
+ /** Lit hook run after each render. @internal */
137
+ updated(changed) {
138
+ if (this.view === null) {
139
+ if (!changed.has("view")) return;
140
+ if (this.#timer !== null) clearTimeout(this.#timer);
141
+ this.#timer = null;
142
+ this.#pauseCount = 0;
143
+ return;
144
+ }
145
+ this.#arm();
146
+ }
147
+ #shown() {
148
+ return this.isConnected && this.renderRoot.querySelector(".toast") !== null;
149
+ }
150
+ #arm() {
151
+ if (!this.#shown() || this.#timer !== null || this.#exiting) return;
152
+ if (this.#pauseCount > 0) return;
153
+ this.#remainingMs = this.#duration;
154
+ this.#startTimer(this.#duration);
155
+ }
156
+ #startTimer(duration) {
157
+ if (!(duration < 2 ** 31)) return;
158
+ this.#timerStartedAt = Date.now();
159
+ this.#timer = setTimeout(() => void this.dismiss(), duration);
160
+ }
161
+ #onClick() {
162
+ this.dismiss();
163
+ }
164
+ #onPauseStart() {
165
+ this.#pauseCount += 1;
166
+ if (this.#pauseCount > 1 || this.#timer === null) return;
167
+ clearTimeout(this.#timer);
168
+ this.#timer = null;
169
+ this.#remainingMs -= Date.now() - this.#timerStartedAt;
170
+ }
171
+ #onPauseEnd() {
172
+ this.#pauseCount = Math.max(0, this.#pauseCount - 1);
173
+ if (this.#pauseCount > 0 || this.#exiting) return;
174
+ this.#startTimer(Math.max(this.#remainingMs, 0));
175
+ }
176
+ };
177
+ //#endregion
178
+ export { BchcToast };
179
+
180
+ //# sourceMappingURL=toast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.js","names":["theme","tokens","toast"],"sources":["../src/toast.ts"],"sourcesContent":["import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\tnothing,\n\ttype PropertyDeclarations,\n\ttype PropertyValues,\n} from \"lit\";\nimport { keyed } from \"lit/directives/keyed.js\";\nimport { icon } from \"./icons.ts\";\nimport { type BchcMessages, mergeMessages } from \"./messages.ts\";\nimport { animationsFinished } from \"./motion.ts\";\nimport theme from \"./styles/theme.generated.css\" with { type: \"css\" };\nimport toast from \"./styles/toast.css\" with { type: \"css\" };\nimport tokens from \"./styles/tokens.css\" with { type: \"css\" };\n\n/**\n * What the toast shows: who answered.\n *\n * @beta\n */\nexport interface ToastView {\n\t/**\n\t * The wallet that connected, shown alongside its logo. `null` when the\n\t * wallet didn't identify itself; the toast then says \"Wallet connected\".\n\t */\n\treadonly walletName: string | null;\n\t/** The wallet's logo, so the moment shows who answered. */\n\treadonly walletLogo: string | null;\n}\n\n/**\n * What the toast asks the caller to do. It never does this itself.\n *\n * @beta\n */\nexport interface BchcToastEvents {\n\t/** Fired once the exit has played. Remove the element on it. */\n\t\"bchc-dismiss\": CustomEvent<void>;\n}\n\nconst DEFAULT_DURATION = 3600;\n\n/**\n * The `<bchc-toast>` custom element, confirming a successful connection. It is\n * separate from the modal so it can outlive it; it never blocks the page, and a\n * dapp with its own notifications can leave it out.\n *\n * @tag bchc-toast\n *\n * @attr {BchcAccent} data-bchc-accent - Curated accent color.\n * @attr {BchcNeutral} data-bchc-neutral - Neutral family override; each accent has a default pairing.\n * @attr {BchcRadius} data-bchc-radius - Corner radius preset applied to every rounded part.\n * @attr {BchcFont} data-bchc-font - Font stack; `brand` falls back to `system` until a face is injected.\n * @attr {BchcMode} data-bchc-mode - Color scheme; `auto` follows `prefers-color-scheme`.\n *\n * @fires {CustomEvent<void>} bchc-dismiss - Fired once the exit has played. Remove the element on it.\n *\n * @cssprop --bchc-font-brand-family - Brand font family read when `data-bchc-font=\"brand\"`; falls back to the system stack until set.\n *\n * @example\n * ```ts\n * defineElements();\n * const toast = document.createElement(\"bchc-toast\") as BchcToast;\n * toast.view = { walletName: \"Cashonize\", walletLogo: \"/cashonize.png\" };\n * toast.addEventListener(\"bchc-dismiss\", () => toast.remove());\n * document.body.append(toast);\n * ```\n *\n * @beta\n */\nexport class BchcToast extends LitElement {\n\t/** Lit's reactive property declarations. @internal */\n\tstatic override properties: PropertyDeclarations = {\n\t\tview: { attribute: false },\n\t\tmessages: { attribute: false },\n\t\t_appearance: { state: true },\n\t};\n\n\t/** Lit's adopted style sheets. @internal */\n\tstatic override styles: CSSResultGroup = [theme, tokens, toast];\n\n\t/**\n\t * The connection to announce. Setting it re-renders the toast: the first\n\t * time builds it and plays its entrance; afterwards it updates the name\n\t * and logo in place, without replaying the entrance.\n\t */\n\tdeclare view: ToastView | null;\n\n\t/**\n\t * Overrides for the strings this element shows and announces.\n\t *\n\t * @defaultValue `null`\n\t */\n\tdeclare messages: Partial<BchcMessages> | null;\n\n\t/**\n\t * How long the toast stays before it dismisses itself, in milliseconds.\n\t * Hovering or focusing it pauses the countdown. `Infinity` keeps it until\n\t * {@link BchcToast.dismiss} is called or the visitor dismisses it. Setting\n\t * it while the toast is shown restarts the countdown.\n\t *\n\t * @defaultValue `3600`\n\t */\n\tget duration(): number {\n\t\treturn this.#duration;\n\t}\n\n\tset duration(next: number) {\n\t\tthis.#duration = next;\n\t\tif (!this.#shown() || this.#exiting) return;\n\t\tif (this.#timer !== null) clearTimeout(this.#timer);\n\t\tthis.#timer = null;\n\t\tthis.#remainingMs = next;\n\t\tif (this.#pauseCount === 0) this.#startTimer(next);\n\t}\n\n\t// Bumped on detach, so the next attach builds a fresh toast that enters again.\n\tdeclare private _appearance: number;\n\n\t#timer: ReturnType<typeof setTimeout> | null = null;\n\t#exiting = false;\n\t#duration = DEFAULT_DURATION;\n\n\tget #messages(): BchcMessages {\n\t\treturn mergeMessages(this.messages);\n\t}\n\n\t// Ticked down on pause, restarted with this value on resume.\n\t#remainingMs = DEFAULT_DURATION;\n\t#timerStartedAt = 0;\n\t#pauseCount = 0;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Assigned here, not as class fields, which would shadow the reactive accessors.\n\t\tthis.view = null;\n\t\tthis.messages = null;\n\t\tthis._appearance = 0;\n\t}\n\n\t/** Called by the browser when the element is detached. @internal */\n\toverride disconnectedCallback(): void {\n\t\tsuper.disconnectedCallback();\n\t\tif (this.#timer !== null) clearTimeout(this.#timer);\n\t\tthis.#timer = null;\n\t\tthis.#exiting = false;\n\t\tthis.#pauseCount = 0;\n\t\tthis._appearance += 1;\n\t}\n\n\t/** Play the exit, then tell the caller. A second call does nothing. */\n\tasync dismiss(): Promise<void> {\n\t\t// A dismiss right after setting `view` must still find the toast.\n\t\tawait this.updateComplete;\n\t\tconst toastElement = this.renderRoot.querySelector(\".toast\");\n\t\tif (!(toastElement instanceof HTMLElement) || this.#exiting) return;\n\t\tthis.#exiting = true;\n\t\tif (this.#timer !== null) clearTimeout(this.#timer);\n\t\tthis.#timer = null;\n\t\t// Safe outside render: the template's class attribute is static, so Lit never rewrites it.\n\t\ttoastElement.classList.add(\"is-exiting\");\n\t\tawait animationsFinished(toastElement);\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(\"bchc-dismiss\", { bubbles: true, composed: true }),\n\t\t);\n\t}\n\n\t/** Lit hook producing the template. @internal */\n\tprotected override render(): unknown {\n\t\tconst view = this.view;\n\t\tif (view === null) return nothing;\n\t\tconst logo = view.walletLogo;\n\t\tconst messages = this.#messages;\n\t\t// Siblings, not nested: a live region inside the button wouldn't announce.\n\t\treturn keyed(\n\t\t\tthis._appearance,\n\t\t\thtml`<div\n\t\t\t\tclass=\"toast\"\n\t\t\t\tlang=${messages.lang}\n\t\t\t\t@click=${this.#onClick}\n\t\t\t\t@pointerenter=${this.#onPauseStart}\n\t\t\t\t@pointerleave=${this.#onPauseEnd}\n\t\t\t\t@focusin=${this.#onPauseStart}\n\t\t\t\t@focusout=${this.#onPauseEnd}\n\t\t\t>\n\t\t\t\t<span class=\"toast-live\" role=\"status\">\n\t\t\t\t\t<span class=${logo === null ? \"done-mark is-bare\" : \"done-mark\"}>\n\t\t\t\t\t\t${logo === null ? nothing : html`<img src=${logo} alt=\"\" width=\"44\" height=\"44\" />`}\n\t\t\t\t\t\t<span class=\"check\">${icon(\"check\")}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"done-title\">${\n\t\t\t\t\t\tview.walletName === null\n\t\t\t\t\t\t\t? messages.walletConnected\n\t\t\t\t\t\t\t: messages.connectedTo(view.walletName)\n\t\t\t\t\t}</span>\n\t\t\t\t</span>\n\t\t\t\t<button class=\"toast-dismiss\" type=\"button\" aria-label=${messages.dismiss}></button>\n\t\t\t</div>`,\n\t\t);\n\t}\n\n\t/** Lit hook run after each render. @internal */\n\tprotected override updated(changed: PropertyValues<this>): void {\n\t\tif (this.view === null) {\n\t\t\tif (!changed.has(\"view\")) return;\n\t\t\tif (this.#timer !== null) clearTimeout(this.#timer);\n\t\t\tthis.#timer = null;\n\t\t\t// The removed element never reports its pointer or focus leaving.\n\t\t\tthis.#pauseCount = 0;\n\t\t\treturn;\n\t\t}\n\t\tthis.#arm();\n\t}\n\n\t// The toast is on screen: built and attached.\n\t#shown(): boolean {\n\t\treturn this.isConnected && this.renderRoot.querySelector(\".toast\") !== null;\n\t}\n\n\t// Starts the countdown once per appearance, whichever of attaching or setting `view` comes last.\n\t#arm(): void {\n\t\tif (!this.#shown() || this.#timer !== null || this.#exiting) return;\n\t\tif (this.#pauseCount > 0) return;\n\t\tthis.#remainingMs = this.#duration;\n\t\tthis.#startTimer(this.#duration);\n\t}\n\n\t#startTimer(duration: number): void {\n\t\t// setTimeout fires at once for delays of 2^31 ms or more, Infinity included.\n\t\tif (!(duration < 2 ** 31)) return;\n\t\tthis.#timerStartedAt = Date.now();\n\t\tthis.#timer = setTimeout(() => void this.dismiss(), duration);\n\t}\n\n\t#onClick(): void {\n\t\tvoid this.dismiss();\n\t}\n\n\t// First of hover/focus to arrive pauses the timer.\n\t#onPauseStart(): void {\n\t\tthis.#pauseCount += 1;\n\t\tif (this.#pauseCount > 1 || this.#timer === null) return;\n\t\tclearTimeout(this.#timer);\n\t\tthis.#timer = null;\n\t\tthis.#remainingMs -= Date.now() - this.#timerStartedAt;\n\t}\n\n\t// Resumes only once neither hover nor focus still holds it paused.\n\t#onPauseEnd(): void {\n\t\tthis.#pauseCount = Math.max(0, this.#pauseCount - 1);\n\t\tif (this.#pauseCount > 0 || this.#exiting) return;\n\t\tthis.#startTimer(Math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CACnB;CAGA,gBAAsB;EACrB,KAAK,eAAe;EACpB,IAAI,KAAK,cAAc,KAAK,KAAK,WAAW,MAAM;EAClD,aAAa,KAAK,MAAM;EACxB,KAAK,SAAS;EACd,KAAK,gBAAgB,KAAK,IAAI,IAAI,KAAK;CACxC;CAGA,cAAoB;EACnB,KAAK,cAAc,KAAK,IAAI,GAAG,KAAK,cAAc,CAAC;EACnD,IAAI,KAAK,cAAc,KAAK,KAAK,UAAU;EAC3C,KAAK,YAAY,KAAK,IAAI,KAAK,cAAc,CAAC,CAAC;CAChD;AACD"}
package/package.json CHANGED
@@ -1,6 +1,90 @@
1
1
  {
2
2
  "name": "@bchconnect/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Connect modal and success toast for BCH Connect",
5
+ "keywords": [
6
+ "bitcoin-cash",
7
+ "bch",
8
+ "walletconnect",
9
+ "wizardconnect",
10
+ "connect",
11
+ "modal",
12
+ "web-components",
13
+ "lit"
14
+ ],
15
+ "homepage": "https://bchconnect.dev",
16
+ "bugs": {
17
+ "url": "https://github.com/BCH-Connect/bchconnect/issues"
18
+ },
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/BCH-Connect/bchconnect.git",
23
+ "directory": "packages/ui"
24
+ },
25
+ "type": "module",
26
+ "sideEffects": false,
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "./modal": {
33
+ "types": "./dist/bchconnect-modal.d.ts",
34
+ "default": "./dist/bchconnect-modal.js"
35
+ },
36
+ "./headless": {
37
+ "types": "./dist/headless.d.ts",
38
+ "default": "./dist/headless.js"
39
+ },
40
+ "./locales/es": {
41
+ "types": "./dist/locales/es.d.ts",
42
+ "default": "./dist/locales/es.js"
43
+ },
44
+ "./package.json": "./package.json"
45
+ },
46
+ "types": "./dist/index.d.ts",
47
+ "customElements": "custom-elements.json",
48
+ "files": [
49
+ "dist",
50
+ "custom-elements.json"
51
+ ],
52
+ "engines": {
53
+ "node": ">=22"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public",
57
+ "provenance": true
58
+ },
59
+ "dependencies": {
60
+ "lit": "^3.3.3",
61
+ "qr-code-styling": "1.9.2"
62
+ },
63
+ "peerDependencies": {
64
+ "@bchconnect/core": "^0.1.1"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "@bchconnect/core": {
68
+ "optional": true
69
+ }
70
+ },
71
+ "devDependencies": {
72
+ "@bchconnect/core": "0.1.1",
73
+ "@custom-elements-manifest/analyzer": "0.11.0",
74
+ "@fontsource-variable/plus-jakarta-sans": "5.3.0",
75
+ "@storybook/addon-a11y": "10.6.1",
76
+ "@storybook/addon-docs": "10.6.1",
77
+ "@storybook/web-components": "10.6.1",
78
+ "@storybook/web-components-vite": "10.6.1",
79
+ "lightningcss": "1.33.0",
80
+ "storybook": "10.6.1",
81
+ "vite": "8.3.1"
82
+ },
83
+ "scripts": {
84
+ "build": "pnpm cem && tsdown",
85
+ "cem": "cem analyze --config custom-elements-manifest.config.mjs",
86
+ "api": "api-extractor run --local --verbose",
87
+ "storybook": "pnpm cem && storybook dev -p 6006",
88
+ "build-storybook": "pnpm cem && storybook build"
89
+ }
6
90
  }