@fanfare-io/fanfare-sdk-solid 0.1.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/LICENSE +202 -0
- package/README.md +53 -0
- package/dist/components/auth/access-code-input.d.ts +17 -0
- package/dist/components/auth/auth-form.d.ts +34 -0
- package/dist/components/auth/auth-input.d.ts +19 -0
- package/dist/components/auth/email-input.d.ts +14 -0
- package/dist/components/auth/index.d.ts +6 -0
- package/dist/components/auth/otp-input.d.ts +21 -0
- package/dist/components/auth/phone-input.d.ts +14 -0
- package/dist/components/compositions/access-code-form.d.ts +25 -0
- package/dist/components/compositions/challenge-gate.d.ts +24 -0
- package/dist/components/compositions/ended-module.d.ts +13 -0
- package/dist/components/compositions/error-view.d.ts +21 -0
- package/dist/components/compositions/granted-panel.d.ts +14 -0
- package/dist/components/compositions/index.d.ts +14 -0
- package/dist/components/compositions/journey-gate.d.ts +27 -0
- package/dist/components/compositions/outcome-panel.d.ts +12 -0
- package/dist/components/internal/appointment-day-tabs.d.ts +18 -0
- package/dist/components/internal/appointment-module.d.ts +27 -0
- package/dist/components/internal/appointment-slot-grid.d.ts +9 -0
- package/dist/components/internal/appointment-slot-item.d.ts +9 -0
- package/dist/components/internal/auction-module.d.ts +32 -0
- package/dist/components/internal/draw-module.d.ts +27 -0
- package/dist/components/internal/index.d.ts +15 -0
- package/dist/components/internal/loading-view.d.ts +9 -0
- package/dist/components/internal/queue-module.d.ts +28 -0
- package/dist/components/internal/start-view.d.ts +19 -0
- package/dist/components/internal/timed-release-module.d.ts +28 -0
- package/dist/components/internal/upcoming-module.d.ts +15 -0
- package/dist/components/internal/waitlist-view.d.ts +14 -0
- package/dist/components/module/alert-panel.d.ts +17 -0
- package/dist/components/module/index.d.ts +5 -0
- package/dist/components/module/info-panel.d.ts +8 -0
- package/dist/components/module/outcome-reason.d.ts +27 -0
- package/dist/components/module/panel-heading.d.ts +13 -0
- package/dist/components/module/panel-layout.d.ts +21 -0
- package/dist/components/primitives/badge.d.ts +17 -0
- package/dist/components/primitives/button.d.ts +16 -0
- package/dist/components/primitives/card.d.ts +49 -0
- package/dist/components/primitives/countdown.d.ts +16 -0
- package/dist/components/primitives/fade-presence.d.ts +11 -0
- package/dist/components/primitives/fanfare-logo.d.ts +8 -0
- package/dist/components/primitives/index.d.ts +11 -0
- package/dist/components/primitives/input.d.ts +18 -0
- package/dist/components/primitives/progress.d.ts +11 -0
- package/dist/components/primitives/skeleton.d.ts +8 -0
- package/dist/components/primitives/spinner.d.ts +14 -0
- package/dist/components/primitives/transition.d.ts +13 -0
- package/dist/components/provider.d.ts +27 -0
- package/dist/components/web/fanfare-web-component-provider.d.ts +20 -0
- package/dist/components/web/web-component-styles.d.ts +4 -0
- package/dist/components/widgets/auction/auction-actions.d.ts +21 -0
- package/dist/components/widgets/auction/auction-bid-display.d.ts +19 -0
- package/dist/components/widgets/auction/index.d.ts +7 -0
- package/dist/components/widgets/draw/draw-actions.d.ts +22 -0
- package/dist/components/widgets/draw/index.d.ts +6 -0
- package/dist/components/widgets/experience-widget.d.ts +127 -0
- package/dist/components/widgets/index.d.ts +11 -0
- package/dist/components/widgets/queue/index.d.ts +6 -0
- package/dist/components/widgets/queue/queue-actions.d.ts +20 -0
- package/dist/components/widgets/timed-release/index.d.ts +6 -0
- package/dist/components/widgets/timed-release/timed-release-actions.d.ts +21 -0
- package/dist/components/widgets/waitlist/index.d.ts +6 -0
- package/dist/components/widgets/waitlist/waitlist-actions.d.ts +22 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/use-auth.d.ts +11 -0
- package/dist/hooks/use-experience-journey.d.ts +17 -0
- package/dist/hooks/use-journey-snapshot.d.ts +8 -0
- package/dist/hooks/use-nanostore.d.ts +7 -0
- package/dist/i18n/i18n-context.d.ts +19 -0
- package/dist/i18n/i18n-provider.d.ts +16 -0
- package/dist/i18n/index.d.ts +12 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +6370 -0
- package/dist/internal-sdk.d.ts +2 -0
- package/dist/lib/animations.d.ts +31 -0
- package/dist/lib/appointment-format.d.ts +26 -0
- package/dist/lib/confetti.d.ts +3 -0
- package/dist/lib/currency.d.ts +9 -0
- package/dist/lib/phone-formatter-lite.d.ts +4 -0
- package/dist/lib/use-grant-celebration.d.ts +2 -0
- package/dist/lib/utils.d.ts +13 -0
- package/dist/register.d.ts +52 -0
- package/dist/styles/base.css +2301 -0
- package/dist/styles/index.d.ts +2 -0
- package/dist/styles/theme.css +82 -0
- package/dist/theme/index.d.ts +8 -0
- package/dist/theme/theme-context.d.ts +10 -0
- package/dist/theme/theme-provider.d.ts +15 -0
- package/dist/theme/theme-utils.d.ts +6 -0
- package/dist/theme/theme.types.d.ts +47 -0
- package/dist/theme/use-theme.d.ts +8 -0
- package/dist/utils/solid.d.ts +1 -0
- package/dist/utils/to-accessor.d.ts +3 -0
- package/docs/SLOTS.md +91 -0
- package/package.json +128 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @fanfare-io/fanfare-sdk-solid
|
|
2
|
+
|
|
3
|
+
SolidJS components and framework-agnostic web components for [Fanfare](https://www.fanfare.io) controlled-access experiences, built on [@fanfare-io/fanfare-sdk-core](https://www.npmjs.com/package/@fanfare-io/fanfare-sdk-core).
|
|
4
|
+
|
|
5
|
+
Use it in Solid applications directly, or anywhere mounting React is not practical (static HTML, CMS pages, non-React hosts) via the `<fanfare-experience-widget>` custom element.
|
|
6
|
+
|
|
7
|
+
## States Covered
|
|
8
|
+
|
|
9
|
+
The component surface is derived from the SDK journey model: `journeyStage`, then `sequence.phase`, then `sequence.mechanism`. The server stays authoritative over what is permitted.
|
|
10
|
+
|
|
11
|
+
- `ready`: renders the start view and exposes `start(opts?)`.
|
|
12
|
+
- `routing`: renders loading UI while the route is selected.
|
|
13
|
+
- `gated`: renders auth, access-code, or challenge UI for the active gate.
|
|
14
|
+
- `routed`: renders the sequence UI for `unavailable`, `scheduled`, `enterable`, `participating`, `settling`, `granted`, and `ended`.
|
|
15
|
+
|
|
16
|
+
For routed journeys, the default widget renders `queue`, `draw`, `auction`, `timed_release`, and `appointment` modules across their supported phases. It renders waitlist entry through `UpcomingModule` and waitlist participation through `WaitlistView`. `settling` renders for `draw` and `auction`. `granted` renders for `queue`, `draw`, `auction`, and `timed_release`.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @fanfare-io/fanfare-sdk-core @fanfare-io/fanfare-sdk-solid solid-js
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<script type="module">
|
|
28
|
+
import { registerWebComponents } from "@fanfare-io/fanfare-sdk-solid";
|
|
29
|
+
|
|
30
|
+
registerWebComponents({
|
|
31
|
+
organizationId: "org_123",
|
|
32
|
+
publishableKey: "pk_live_123",
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<fanfare-experience-widget experience-id="exp_123" auto-start checkout-url="/checkout"></fanfare-experience-widget>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Solid applications can use `FanfareProvider`, `ExperienceWidget`, and `useExperienceJourney` directly: the same journey contract as the React adapter, with Solid reactivity.
|
|
40
|
+
|
|
41
|
+
`slots` override targeted states while keeping the default widget flow. `children` receives `{ journey, view, snapshot, error, start, isStarting }` when you want to render the full state yourself. Solid `ExperienceWidget` accepts both `class` and `className`.
|
|
42
|
+
|
|
43
|
+
## Documentation
|
|
44
|
+
|
|
45
|
+
- [Web components guide](https://docs.fanfare.io/sdk/components/web-components)
|
|
46
|
+
- [Theming](https://docs.fanfare.io/sdk/components/theming) · [Slots](https://docs.fanfare.io/sdk/components/slots)
|
|
47
|
+
- [SDK overview](https://docs.fanfare.io/sdk/overview)
|
|
48
|
+
- [Website](https://www.fanfare.io)
|
|
49
|
+
- [Source & issues](https://github.com/fanfare-io/fanfare-sdk)
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
[Apache-2.0](./LICENSE)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { InputProps } from '../primitives/input';
|
|
3
|
+
export interface AccessCodeInputProps extends Omit<InputProps, "onChange" | "type" | "value"> {
|
|
4
|
+
value: string;
|
|
5
|
+
onValueChange: (value: string) => void;
|
|
6
|
+
onSubmit?: () => void;
|
|
7
|
+
error?: string;
|
|
8
|
+
/** Visual error state without inline text (e.g. when an AlertPanel owns the message). */
|
|
9
|
+
hasError?: boolean;
|
|
10
|
+
autoUppercase?: boolean;
|
|
11
|
+
autoFocus?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function AccessCodeInput(props: AccessCodeInputProps): JSX.Element;
|
|
15
|
+
export declare namespace AccessCodeInput {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { PanelHeadingVariant } from '../module';
|
|
3
|
+
import { AuthInputMode } from './auth-input';
|
|
4
|
+
export interface AuthFormProps {
|
|
5
|
+
onSubmit?: (credential: string, type: AuthInputMode) => Promise<void>;
|
|
6
|
+
onVerify?: (otp: string) => Promise<void>;
|
|
7
|
+
onSkip?: () => void;
|
|
8
|
+
onSuccess?: () => void;
|
|
9
|
+
/** Badge color/intent in the panel heading. */
|
|
10
|
+
variant?: PanelHeadingVariant;
|
|
11
|
+
/** Badge text in the panel heading. Defaults to `auth.badgeLabel`. */
|
|
12
|
+
label?: JSX.Element;
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
/** When set, renders a countdown above the form. */
|
|
16
|
+
countdownTo?: Date;
|
|
17
|
+
submitLabel?: string;
|
|
18
|
+
verifyLabel?: string;
|
|
19
|
+
allowSkip?: boolean;
|
|
20
|
+
showBranding?: boolean;
|
|
21
|
+
/** Initial step when mounting. Useful for SSR-resume or storybook lanes that need the verify step. */
|
|
22
|
+
defaultStep?: "credential" | "verify";
|
|
23
|
+
/** Initial credential (email or E.164 phone) — pairs with `defaultStep="verify"`. */
|
|
24
|
+
defaultCredential?: string;
|
|
25
|
+
/** Initial credential type — pairs with `defaultStep="verify"`. */
|
|
26
|
+
defaultCredentialType?: AuthInputMode;
|
|
27
|
+
/** Initial error message when mounting. Cleared on the next input change. */
|
|
28
|
+
defaultError?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function AuthForm(props: AuthFormProps): JSX.Element;
|
|
32
|
+
export declare namespace AuthForm {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { InputProps } from '../primitives/input';
|
|
3
|
+
export type AuthInputMode = "email" | "phone";
|
|
4
|
+
export interface AuthInputProps extends Omit<InputProps, "onChange" | "type" | "value"> {
|
|
5
|
+
value: string;
|
|
6
|
+
onValueChange: (value: string, mode: AuthInputMode) => void;
|
|
7
|
+
onValidChange?: (isValid: boolean) => void;
|
|
8
|
+
onSubmit?: () => void;
|
|
9
|
+
type?: AuthInputMode | "auto";
|
|
10
|
+
error?: string;
|
|
11
|
+
/** Visual error state without inline text (e.g. when an AlertPanel owns the message). */
|
|
12
|
+
hasError?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function detectInputMode(value: string): AuthInputMode;
|
|
16
|
+
export declare function AuthInput(props: AuthInputProps): JSX.Element;
|
|
17
|
+
export declare namespace AuthInput {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { InputProps } from '../primitives/input';
|
|
3
|
+
export interface EmailInputProps extends Omit<InputProps, "onChange" | "type" | "value"> {
|
|
4
|
+
value: string;
|
|
5
|
+
onValueChange: (value: string) => void;
|
|
6
|
+
onValidChange?: (isValid: boolean) => void;
|
|
7
|
+
onSubmit?: () => void;
|
|
8
|
+
error?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function EmailInput(props: EmailInputProps): JSX.Element;
|
|
12
|
+
export declare namespace EmailInput {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AccessCodeInput, type AccessCodeInputProps } from './access-code-input';
|
|
2
|
+
export { AuthForm, type AuthFormProps } from './auth-form';
|
|
3
|
+
export { AuthInput, type AuthInputMode, type AuthInputProps } from './auth-input';
|
|
4
|
+
export { EmailInput, type EmailInputProps } from './email-input';
|
|
5
|
+
export { OTPInput, type OTPInputProps } from './otp-input';
|
|
6
|
+
export { PhoneInput, type PhoneInputProps } from './phone-input';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface OTPInputProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
onComplete?: (value: string) => void;
|
|
6
|
+
length?: number;
|
|
7
|
+
error?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Visual error state without inline text. Use when the message is rendered
|
|
10
|
+
* elsewhere (e.g. an AlertPanel) but the digits should still show danger styling.
|
|
11
|
+
*/
|
|
12
|
+
hasError?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
autoFocus?: boolean;
|
|
15
|
+
class?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function OTPInput(props: OTPInputProps): JSX.Element;
|
|
19
|
+
export declare namespace OTPInput {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { InputProps } from '../primitives/input';
|
|
3
|
+
export interface PhoneInputProps extends Omit<InputProps, "onChange" | "type" | "value"> {
|
|
4
|
+
value: string;
|
|
5
|
+
onValueChange: (value: string) => void;
|
|
6
|
+
onValidChange?: (isValid: boolean) => void;
|
|
7
|
+
onSubmit?: () => void;
|
|
8
|
+
error?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function PhoneInput(props: PhoneInputProps): JSX.Element;
|
|
12
|
+
export declare namespace PhoneInput {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { PanelHeadingVariant } from '../module';
|
|
3
|
+
export interface AccessCodeFormProps {
|
|
4
|
+
onSubmit?: (code: string) => Promise<void>;
|
|
5
|
+
onSkip?: () => void;
|
|
6
|
+
/** Badge color/intent in the panel heading. */
|
|
7
|
+
variant?: PanelHeadingVariant;
|
|
8
|
+
/** Badge text in the panel heading. Defaults to `accessCode.badgeLabel`. */
|
|
9
|
+
label?: JSX.Element;
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
/** When set, renders a countdown above the form. */
|
|
13
|
+
countdownTo?: Date;
|
|
14
|
+
submitLabel?: string;
|
|
15
|
+
allowSkip?: boolean;
|
|
16
|
+
autoUppercase?: boolean;
|
|
17
|
+
/** Initial error message when mounting. Cleared on the next input change. */
|
|
18
|
+
defaultError?: string;
|
|
19
|
+
class?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function AccessCodeForm(props: AccessCodeFormProps): JSX.Element;
|
|
23
|
+
export declare namespace AccessCodeForm {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BotMitigationState, RoutingChallenge } from '@fanfare-io/fanfare-sdk-core/challenges';
|
|
2
|
+
import { JSX } from 'solid-js';
|
|
3
|
+
import { PanelHeadingVariant } from '../module';
|
|
4
|
+
export interface ChallengeGateProps {
|
|
5
|
+
challenge: RoutingChallenge | null;
|
|
6
|
+
botMitigation?: BotMitigationState;
|
|
7
|
+
onVerifyToken: (token: string) => Promise<void>;
|
|
8
|
+
onRetry?: () => void;
|
|
9
|
+
/** Badge color/intent in the panel heading. */
|
|
10
|
+
variant?: PanelHeadingVariant;
|
|
11
|
+
/** Badge text in the panel heading. Defaults to `challenge.badgeLabel`. */
|
|
12
|
+
label?: JSX.Element;
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
/** When set, renders a countdown above the challenge. */
|
|
16
|
+
countdownTo?: Date;
|
|
17
|
+
retryLabel?: string;
|
|
18
|
+
class?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function ChallengeGate(props: ChallengeGateProps): JSX.Element;
|
|
22
|
+
export declare namespace ChallengeGate {
|
|
23
|
+
var displayName: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface EndedModuleProps {
|
|
2
|
+
title?: string;
|
|
3
|
+
message?: string;
|
|
4
|
+
endedAt?: Date | number;
|
|
5
|
+
ctaLabel?: string;
|
|
6
|
+
onCtaClick?: () => void;
|
|
7
|
+
class?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function EndedModule(props: EndedModuleProps): import("solid-js").JSX.Element;
|
|
11
|
+
export declare namespace EndedModule {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface ErrorViewProps {
|
|
3
|
+
/** Description shown inside the AlertPanel. Falls back to `t("error.description")`. */
|
|
4
|
+
error?: Error | string;
|
|
5
|
+
/** Title shown inside the AlertPanel. Falls back to `t("error.title")`. */
|
|
6
|
+
title?: JSX.Element;
|
|
7
|
+
/** Badge text in the PanelHeading. Falls back to `t("error.label")`. */
|
|
8
|
+
label?: JSX.Element;
|
|
9
|
+
/** Structured context to display below the AlertPanel. Omitted entirely when not provided. */
|
|
10
|
+
info?: JSX.Element;
|
|
11
|
+
/** Retry button label. Falls back to `t("error.retry")`. */
|
|
12
|
+
ctaLabel?: JSX.Element;
|
|
13
|
+
/** Retry callback. When provided, a CTA button is rendered. */
|
|
14
|
+
onRetry?: () => void | Promise<void>;
|
|
15
|
+
class?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function ErrorView(props: ErrorViewProps): JSX.Element;
|
|
19
|
+
export declare namespace ErrorView {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface GrantedPanelProps {
|
|
3
|
+
label: JSX.Element;
|
|
4
|
+
fallbackMessage: JSX.Element;
|
|
5
|
+
ctaLabel: JSX.Element;
|
|
6
|
+
expiresAt?: Date;
|
|
7
|
+
onCtaClick: () => void;
|
|
8
|
+
class?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function GrantedPanel(props: GrantedPanelProps): JSX.Element;
|
|
12
|
+
export declare namespace GrantedPanel {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composition Components
|
|
3
|
+
*
|
|
4
|
+
* Reusable sections that combine primitives for common widget patterns.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export { AccessCodeForm, type AccessCodeFormProps } from './access-code-form';
|
|
9
|
+
export { ChallengeGate, type ChallengeGateProps } from './challenge-gate';
|
|
10
|
+
export { EndedModule, type EndedModuleProps } from './ended-module';
|
|
11
|
+
export { ErrorView, type ErrorViewProps } from './error-view';
|
|
12
|
+
export { GrantedPanel, type GrantedPanelProps } from './granted-panel';
|
|
13
|
+
export { JourneyGate, type JourneyGateProps, type JourneyGateStage } from './journey-gate';
|
|
14
|
+
export { OutcomePanel, type OutcomePanelProps } from './outcome-panel';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { AuthInputMode } from '../auth/auth-input';
|
|
3
|
+
export type JourneyGateStage = "auth" | "access_code" | "loading" | "none";
|
|
4
|
+
export interface JourneyGateProps {
|
|
5
|
+
stage: JourneyGateStage;
|
|
6
|
+
onAuthSubmit?: (credential: string, type: AuthInputMode) => Promise<void>;
|
|
7
|
+
onAuthVerify?: (otp: string) => Promise<void>;
|
|
8
|
+
onAuthSkip?: () => void;
|
|
9
|
+
onAuthSuccess?: () => void;
|
|
10
|
+
onAccessCodeSubmit?: (code: string) => Promise<void>;
|
|
11
|
+
onAccessCodeSkip?: () => void;
|
|
12
|
+
allowAuthSkip?: boolean;
|
|
13
|
+
allowAccessCodeSkip?: boolean;
|
|
14
|
+
authTitle?: string;
|
|
15
|
+
authDescription?: string;
|
|
16
|
+
accessCodeTitle?: string;
|
|
17
|
+
accessCodeDescription?: string;
|
|
18
|
+
/** When the upcoming sequence opens — drives the countdown above the form. */
|
|
19
|
+
startsAt?: Date;
|
|
20
|
+
class?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
children?: JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export declare function JourneyGate(props: JourneyGateProps): JSX.Element;
|
|
25
|
+
export declare namespace JourneyGate {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OutcomeReason } from '../module';
|
|
2
|
+
export interface OutcomePanelProps {
|
|
3
|
+
outcomeReason: OutcomeReason;
|
|
4
|
+
onReenter?: () => Promise<void>;
|
|
5
|
+
isReentering?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function OutcomePanel(props: OutcomePanelProps): import("solid-js").JSX.Element;
|
|
10
|
+
export declare namespace OutcomePanel {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface AppointmentDay {
|
|
2
|
+
/** ISO date string (YYYY-MM-DD) used as the stable key and selection value. */
|
|
3
|
+
date: string;
|
|
4
|
+
/** Short weekday label like "Mon". */
|
|
5
|
+
weekdayLabel: string;
|
|
6
|
+
/** Day-of-month number for the large label. */
|
|
7
|
+
dayNumber: number;
|
|
8
|
+
/** Whether any slots are available on this day. */
|
|
9
|
+
hasAvailability: boolean;
|
|
10
|
+
/** Whether the location is closed entirely on this day (no slots generated at all). */
|
|
11
|
+
isClosed: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface AppointmentDayTabsProps {
|
|
14
|
+
days: AppointmentDay[];
|
|
15
|
+
selectedDate: string | null;
|
|
16
|
+
onSelect: (date: string) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function AppointmentDayTabs(props: AppointmentDayTabsProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AppointmentDisplayState } from '@fanfare-io/fanfare-sdk-core/internals';
|
|
2
|
+
import { ReadableAtom } from 'nanostores';
|
|
3
|
+
import { OutcomeReason } from '../module';
|
|
4
|
+
export interface AppointmentModuleProps {
|
|
5
|
+
appointmentId: string;
|
|
6
|
+
state$?: ReadableAtom<AppointmentDisplayState>;
|
|
7
|
+
sequencePhase: "enterable" | "participating" | "ended";
|
|
8
|
+
bookingWindowOpenAt?: string;
|
|
9
|
+
bookingWindowCloseAt?: string;
|
|
10
|
+
timezone?: string;
|
|
11
|
+
defaultLocationId?: string;
|
|
12
|
+
onBook: (slotId: string, locationId?: string) => Promise<void>;
|
|
13
|
+
onCancel: (reason?: string) => Promise<void>;
|
|
14
|
+
onReschedule: (newSlotId: string, newLocationId?: string) => Promise<void>;
|
|
15
|
+
isBooking: boolean;
|
|
16
|
+
isCancelling: boolean;
|
|
17
|
+
isRescheduling: boolean;
|
|
18
|
+
bookError?: string | null;
|
|
19
|
+
cancelError?: string | null;
|
|
20
|
+
outcomeReason?: OutcomeReason;
|
|
21
|
+
class?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function AppointmentModule(props: AppointmentModuleProps): import("solid-js").JSX.Element;
|
|
25
|
+
export declare namespace AppointmentModule {
|
|
26
|
+
var displayName: string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppointmentSlot } from '@fanfare-io/fanfare-sdk-core/appointments';
|
|
2
|
+
export interface AppointmentSlotGridProps {
|
|
3
|
+
slots: AppointmentSlot[];
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
selectedSlotId: string | null;
|
|
6
|
+
onSelect: (slotId: string) => void;
|
|
7
|
+
emptyMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function AppointmentSlotGrid(props: AppointmentSlotGridProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface AppointmentSlotItemProps {
|
|
2
|
+
slotId: string;
|
|
3
|
+
timeLabel: string;
|
|
4
|
+
ariaLabel: string;
|
|
5
|
+
isFull: boolean;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
onSelect: (slotId: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function AppointmentSlotItem(props: AppointmentSlotItemProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AuctionDisplayState } from '@fanfare-io/fanfare-sdk-core/internals';
|
|
2
|
+
import { ReadableAtom } from 'nanostores';
|
|
3
|
+
import { OutcomeReason } from '../module';
|
|
4
|
+
export interface AuctionModuleProps {
|
|
5
|
+
state$?: ReadableAtom<AuctionDisplayState>;
|
|
6
|
+
fallbackState?: AuctionDisplayState;
|
|
7
|
+
sequencePhase: "enterable" | "participating" | "settling" | "granted" | "ended";
|
|
8
|
+
canEnter: boolean;
|
|
9
|
+
canLeave: boolean;
|
|
10
|
+
onEnter: () => Promise<void>;
|
|
11
|
+
onLeave: () => Promise<void>;
|
|
12
|
+
onBid?: (amount: string) => Promise<void>;
|
|
13
|
+
isEntering: boolean;
|
|
14
|
+
isLeaving: boolean;
|
|
15
|
+
countdownTo?: Date;
|
|
16
|
+
defaultBidAmount?: string;
|
|
17
|
+
currencyCode?: string;
|
|
18
|
+
locale?: string;
|
|
19
|
+
grant?: string;
|
|
20
|
+
expiresAt?: number | Date;
|
|
21
|
+
checkoutUrl?: string;
|
|
22
|
+
onCheckoutClick?: () => void;
|
|
23
|
+
outcomeReason?: OutcomeReason;
|
|
24
|
+
onReenter?: () => Promise<void>;
|
|
25
|
+
isReentering?: boolean;
|
|
26
|
+
class?: string;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function AuctionModule(props: AuctionModuleProps): import("solid-js").JSX.Element;
|
|
30
|
+
export declare namespace AuctionModule {
|
|
31
|
+
var displayName: string;
|
|
32
|
+
}
|