@apextelemed/partner-core 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.
Files changed (114) hide show
  1. package/LICENSE +64 -0
  2. package/README.md +363 -0
  3. package/dist/api/index.d.ts +12 -0
  4. package/dist/api/index.js +8 -0
  5. package/dist/api/index.js.map +1 -0
  6. package/dist/api/index.jsx +127 -0
  7. package/dist/cart-CBH8Em8f.d.ts +189 -0
  8. package/dist/cart-D4mVX_zx.d.ts +66 -0
  9. package/dist/chunk/2OXI5TKO.jsx +249 -0
  10. package/dist/chunk/3A3MF7R2.jsx +1 -0
  11. package/dist/chunk/3VEOP7TZ.jsx +16679 -0
  12. package/dist/chunk/5XGPFYIJ.js +26 -0
  13. package/dist/chunk/5XGPFYIJ.js.map +1 -0
  14. package/dist/chunk/67KHO66G.js +26 -0
  15. package/dist/chunk/67KHO66G.js.map +1 -0
  16. package/dist/chunk/6TFBQECC.jsx +135 -0
  17. package/dist/chunk/AN3WPMEP.js +3 -0
  18. package/dist/chunk/AN3WPMEP.js.map +1 -0
  19. package/dist/chunk/DHII7L5Y.js +686 -0
  20. package/dist/chunk/DHII7L5Y.js.map +1 -0
  21. package/dist/chunk/DS4E7FAI.js +132 -0
  22. package/dist/chunk/DS4E7FAI.js.map +1 -0
  23. package/dist/chunk/DY5BJ6UG.js +1195 -0
  24. package/dist/chunk/DY5BJ6UG.js.map +1 -0
  25. package/dist/chunk/E7722UPF.js +378 -0
  26. package/dist/chunk/E7722UPF.js.map +1 -0
  27. package/dist/chunk/HLXKWRRW.js +16774 -0
  28. package/dist/chunk/HLXKWRRW.js.map +1 -0
  29. package/dist/chunk/I46Y2J5W.jsx +144 -0
  30. package/dist/chunk/J63XPQP4.jsx +21 -0
  31. package/dist/chunk/J6KNY37T.js +122 -0
  32. package/dist/chunk/J6KNY37T.js.map +1 -0
  33. package/dist/chunk/KNTZTYXE.jsx +3315 -0
  34. package/dist/chunk/KZZSQ7LP.jsx +409 -0
  35. package/dist/chunk/L46OKCKG.jsx +733 -0
  36. package/dist/chunk/LDZIUFDM.jsx +31 -0
  37. package/dist/chunk/LZWA44KD.js +3 -0
  38. package/dist/chunk/LZWA44KD.js.map +1 -0
  39. package/dist/chunk/NVRAOAVV.js +3 -0
  40. package/dist/chunk/NVRAOAVV.js.map +1 -0
  41. package/dist/chunk/O3QK7YZR.jsx +1 -0
  42. package/dist/chunk/UZCST66N.jsx +21 -0
  43. package/dist/chunk/V42CGY2S.jsx +1229 -0
  44. package/dist/chunk/YJEHCCLY.js +467 -0
  45. package/dist/chunk/YJEHCCLY.js.map +1 -0
  46. package/dist/chunk/ZMOG2IIC.js +3194 -0
  47. package/dist/chunk/ZMOG2IIC.js.map +1 -0
  48. package/dist/client-BzSg2DEK.d.ts +1539 -0
  49. package/dist/config/index.d.ts +55 -0
  50. package/dist/config/index.js +3 -0
  51. package/dist/config/index.js.map +1 -0
  52. package/dist/config/index.jsx +11 -0
  53. package/dist/flows/index.d.ts +1322 -0
  54. package/dist/flows/index.js +9 -0
  55. package/dist/flows/index.js.map +1 -0
  56. package/dist/flows/index.jsx +124 -0
  57. package/dist/index/index.d.ts +71 -0
  58. package/dist/index/index.js +15 -0
  59. package/dist/index/index.js.map +1 -0
  60. package/dist/index/index.jsx +311 -0
  61. package/dist/pages/index.d.ts +617 -0
  62. package/dist/pages/index.js +10 -0
  63. package/dist/pages/index.js.map +1 -0
  64. package/dist/pages/index.jsx +50 -0
  65. package/dist/primitives/default/index.d.ts +6 -0
  66. package/dist/primitives/default/index.js +3 -0
  67. package/dist/primitives/default/index.js.map +1 -0
  68. package/dist/primitives/default/index.jsx +7 -0
  69. package/dist/primitives/index.d.ts +122 -0
  70. package/dist/primitives/index.js +3 -0
  71. package/dist/primitives/index.js.map +1 -0
  72. package/dist/primitives/index.jsx +9 -0
  73. package/dist/stores/index.d.ts +48 -0
  74. package/dist/stores/index.js +6 -0
  75. package/dist/stores/index.js.map +1 -0
  76. package/dist/stores/index.jsx +16 -0
  77. package/dist/surveyV2-BgQHK0GE.d.ts +48 -0
  78. package/dist/testing/adapter.d.ts +104 -0
  79. package/dist/testing/adapter.d.ts.map +1 -0
  80. package/dist/testing/adapter.js +14 -0
  81. package/dist/testing/adapter.js.map +1 -0
  82. package/dist/testing/env.d.ts +29 -0
  83. package/dist/testing/env.d.ts.map +1 -0
  84. package/dist/testing/env.js +42 -0
  85. package/dist/testing/env.js.map +1 -0
  86. package/dist/testing/fixtures.d.ts +70 -0
  87. package/dist/testing/fixtures.d.ts.map +1 -0
  88. package/dist/testing/fixtures.js +74 -0
  89. package/dist/testing/fixtures.js.map +1 -0
  90. package/dist/testing/index.d.ts +15 -0
  91. package/dist/testing/index.d.ts.map +1 -0
  92. package/dist/testing/index.js +14 -0
  93. package/dist/testing/index.js.map +1 -0
  94. package/dist/testing/mocks.d.ts +53 -0
  95. package/dist/testing/mocks.d.ts.map +1 -0
  96. package/dist/testing/mocks.js +90 -0
  97. package/dist/testing/mocks.js.map +1 -0
  98. package/dist/testing/seam-suite.d.ts +39 -0
  99. package/dist/testing/seam-suite.d.ts.map +1 -0
  100. package/dist/testing/seam-suite.js +196 -0
  101. package/dist/testing/seam-suite.js.map +1 -0
  102. package/dist/testing/storage.d.ts +40 -0
  103. package/dist/testing/storage.d.ts.map +1 -0
  104. package/dist/testing/storage.js +71 -0
  105. package/dist/testing/storage.js.map +1 -0
  106. package/dist/theme/admin.css +579 -0
  107. package/dist/theme/affiliate.css +191 -0
  108. package/dist/theme/flow.css +497 -0
  109. package/dist/theme/index.d.ts +84 -0
  110. package/dist/theme/index.js +94 -0
  111. package/dist/theme/index.js.map +1 -0
  112. package/dist/theme/index.jsx +97 -0
  113. package/dist/theme/member-portal.css +1762 -0
  114. package/package.json +199 -0
@@ -0,0 +1,189 @@
1
+ interface FunnelConfig {
2
+ telemetry: boolean;
3
+ emailGate: boolean;
4
+ /** When true (tenant features.funnelEmailGateRequired), the gate offers no skip. */
5
+ emailGateRequired: boolean;
6
+ }
7
+ /**
8
+ * The tenant's funnel-capture posture, fetched once per page load and cached.
9
+ * Fails closed: any error reads as "both off".
10
+ */
11
+ declare function fetchFunnelConfig(): Promise<FunnelConfig>;
12
+ /**
13
+ * Continue an existing funnel session (resume-from-email): the emailed link
14
+ * identifies the session that already holds this person's email and reminder
15
+ * history, so adopting its id keeps everything on one row instead of forking a
16
+ * new one that looks like a brand-new visitor.
17
+ */
18
+ declare function adoptFunnelSessionId(id: string): void;
19
+ /** Test seam: forget the cached config so the next fetch re-resolves. */
20
+ declare function resetFunnelConfigCache(): void;
21
+ /**
22
+ * Stable id for this survey session, minted on first use and kept in
23
+ * sessionStorage — a refresh continues the same session (matching the survey
24
+ * draft's resume behavior); a new tab or browser session starts a new one.
25
+ */
26
+ declare function funnelSessionId(): string;
27
+ /**
28
+ * The current survey session id, or null — WITHOUT minting one.
29
+ *
30
+ * `funnelSessionId()` creates an id on first read, which is right for the
31
+ * survey (asking means a survey is starting) and wrong for anything else. Cart
32
+ * capture uses this to say "if this shopper also has a survey session, here it
33
+ * is" — letting the backend borrow the email the gate already collected —
34
+ * without conjuring survey sessions on a storefront that never runs one.
35
+ */
36
+ declare function peekFunnelSessionId(): string | null;
37
+ /**
38
+ * Fire-and-forget event post. `keepalive` lets the request survive a page
39
+ * unload — which is exactly when the `abandoned` event is sent. (This is why
40
+ * it's `fetch` and not `navigator.sendBeacon`: beacons can't carry the
41
+ * X-Tenant-Key header the tenant-scoped mount requires.)
42
+ */
43
+ declare function postFunnelEvent(type: string, data?: Record<string, unknown>): void;
44
+ interface FunnelDraftPayload {
45
+ answers: Array<{
46
+ questionId: string;
47
+ value: unknown;
48
+ }>;
49
+ stepIndex: number;
50
+ }
51
+ /**
52
+ * Save in-progress answers to Apex (through the-backend's embed proxy) and
53
+ * return the draft id, so the next save updates the same row.
54
+ *
55
+ * Answers travel to the CLINICAL system — the partner backend stores only the
56
+ * returned pointer. Returns null on any failure: a draft is best-effort, and
57
+ * losing one costs a retype, never correctness.
58
+ */
59
+ declare function saveFunnelDraft(draft: FunnelDraftPayload & {
60
+ draftId?: string;
61
+ drugIds?: string[];
62
+ templateId?: string;
63
+ mode?: string;
64
+ }): Promise<string | null>;
65
+ interface ResumedDraft extends FunnelDraftPayload {
66
+ sessionId: string;
67
+ draftId: string;
68
+ }
69
+ /**
70
+ * Exchange an emailed resume token for the saved answers.
71
+ *
72
+ * The token is the ONLY thing authorizing this read — the-backend verifies its
73
+ * HMAC before fetching from Apex with credentials the browser never sees. A
74
+ * 404 (expired, already submitted, tampered) resolves to null so the caller
75
+ * simply starts a fresh survey.
76
+ */
77
+ declare function fetchResumedDraft(token: string): Promise<ResumedDraft | null>;
78
+ /** Read the `?resume=` token from the current URL. */
79
+ declare function readResumeToken(): string | null;
80
+ /**
81
+ * Drop `?resume=` from the address bar once it has been redeemed.
82
+ *
83
+ * This token authorizes a read of someone's clinical answers, so leaving it in
84
+ * the address bar is worse than leaving the cart's there: it gets bookmarked,
85
+ * pasted into a support chat, or captured by whatever the patient's browser
86
+ * syncs. The answers are mirrored into local storage on redemption, so a
87
+ * refresh resumes from this device without it. History is replaced, not
88
+ * pushed — the token was never a page.
89
+ */
90
+ declare function stripResumeToken(): void;
91
+
92
+ interface CartCaptureConfig {
93
+ /** Tenant opted in (features.cartRecovery); false = never send anything. */
94
+ snapshot: boolean;
95
+ }
96
+ /**
97
+ * The tenant's cart-capture posture, fetched once per page load and cached.
98
+ * Fails closed: any error reads as "off".
99
+ */
100
+ declare function fetchCartConfig(): Promise<CartCaptureConfig>;
101
+ /** Test seam: forget the cached config so the next fetch re-resolves. */
102
+ declare function resetCartConfigCache(): void;
103
+ /**
104
+ * Stable id for this shopper's cart, minted on first use and kept in
105
+ * localStorage — NOT sessionStorage like the survey session.
106
+ *
107
+ * A cart outlives the tab it was filled in: someone adds items, closes the
108
+ * browser, comes back tomorrow and finds the cart still there (the cart store
109
+ * itself persists the same way). The id has to survive with it, or every visit
110
+ * would look like a brand-new abandoned cart and one shopper would accumulate
111
+ * a row — and a reminder track — per session.
112
+ */
113
+ declare function cartId(): string;
114
+ /**
115
+ * Continue the cart a recovery email points at, instead of the one this browser
116
+ * happens to hold. Adopting the emailed id keeps the reminder history, the
117
+ * email address and the eventual conversion on ONE row.
118
+ */
119
+ declare function adoptCartId(id: string): void;
120
+ /**
121
+ * Start a fresh cart id. Called after a purchase: the old id is stamped
122
+ * converted server-side and must never be written to again, or a new cart
123
+ * would inherit a bought cart's row (and its silence — converted rows are
124
+ * never nudged).
125
+ */
126
+ declare function resetCartId(): void;
127
+ interface CartSnapshotLine {
128
+ productId: string;
129
+ dosage?: string;
130
+ quantity: number;
131
+ }
132
+ /**
133
+ * Mirror the cart server-side. Identity only — the backend re-prices from the
134
+ * catalog and ignores anything else we send, so there is no point shipping
135
+ * names or prices.
136
+ *
137
+ * `keepalive` lets the request survive the page unload that so often IS the
138
+ * abandonment.
139
+ */
140
+ declare function postCartSnapshot(params: {
141
+ items: CartSnapshotLine[];
142
+ promoCode?: string | null;
143
+ email?: string | null;
144
+ }): void;
145
+ /** A resumed cart line, already re-priced against today's catalog. */
146
+ interface ResumedCartLine {
147
+ productId: string;
148
+ dosage?: string;
149
+ quantity: number;
150
+ name: string;
151
+ priceCents: number;
152
+ salePriceCents: number | null;
153
+ thumbnailUrl: string | null;
154
+ isSubscription: boolean;
155
+ apexDrugId: string | null;
156
+ categories: string[];
157
+ hideDoseLabel: boolean;
158
+ }
159
+ interface ResumedCart {
160
+ cartId: string;
161
+ items: ResumedCartLine[];
162
+ /** Lines whose product has since been discontinued or deactivated. */
163
+ unavailable: Array<{
164
+ productId: string;
165
+ dosage?: string;
166
+ quantity: number;
167
+ }>;
168
+ promoCode: string | null;
169
+ subtotalCents: number;
170
+ }
171
+ /**
172
+ * Exchange an emailed recovery token for the saved cart.
173
+ *
174
+ * The token is the ONLY thing authorizing this read — the-backend verifies its
175
+ * HMAC before returning anything. A 404 (expired, already bought, tampered, or
176
+ * every product gone) resolves to null so the caller simply keeps whatever cart
177
+ * this browser already had.
178
+ */
179
+ declare function fetchResumedCart(token: string): Promise<ResumedCart | null>;
180
+ /** Read the `?cart=` token from the current URL. */
181
+ declare function readCartToken(): string | null;
182
+ /**
183
+ * Drop `?cart=` from the address bar once it's been redeemed, so a refresh (or
184
+ * a shared URL) doesn't re-run the restore over a cart the shopper has since
185
+ * edited. History is replaced, not pushed — the token was never a page.
186
+ */
187
+ declare function stripCartToken(): void;
188
+
189
+ export { type CartCaptureConfig as C, type FunnelConfig as F, type ResumedCart as R, type CartSnapshotLine as a, type FunnelDraftPayload as b, type ResumedCartLine as c, type ResumedDraft as d, adoptCartId as e, adoptFunnelSessionId as f, cartId as g, fetchCartConfig as h, fetchFunnelConfig as i, fetchResumedCart as j, fetchResumedDraft as k, funnelSessionId as l, postCartSnapshot as m, postFunnelEvent as n, readResumeToken as o, peekFunnelSessionId as p, resetCartConfigCache as q, readCartToken as r, resetCartId as s, resetFunnelConfigCache as t, saveFunnelDraft as u, stripCartToken as v, stripResumeToken as w };
@@ -0,0 +1,66 @@
1
+ import * as solid_js from 'solid-js';
2
+
3
+ interface CartItem {
4
+ productId: string;
5
+ productName: string;
6
+ dosage: string;
7
+ /** Dose redesign (Phase 8): optional patient-requested intake hints, mirroring
8
+ * Apex intake — `requestedSku` is the binding patient-bought SKU,
9
+ * `requestedClinicalDose` is the advisory dose. Default undefined; carried
10
+ * through to the /apex/requests medications payload. Nothing sets these yet. */
11
+ requestedSku?: string;
12
+ /** SKU identity S4: the stable, opaque `skus[].id` form of `requestedSku`
13
+ * (from Apex's /v1/drugs catalog). Preferred over the label — survives a
14
+ * relabel. Additive; carried through to the medications payload. */
15
+ requestedSkuId?: string;
16
+ requestedClinicalDose?: {
17
+ value: number;
18
+ unit: string;
19
+ };
20
+ quantity: number;
21
+ priceCents: number;
22
+ drugId: string | null;
23
+ /** The linked Apex drug id, copied from the catalog product. Matches the id
24
+ * the survey qualification verdict (`drugResults[].drugId`) is keyed on, so
25
+ * request creation can gate out drugs the survey marked ineligible. Null/
26
+ * undefined for non-Apex products or carts saved before this field existed. */
27
+ apexDrugId?: string | null;
28
+ categories: string[];
29
+ thumbnailUrl?: string;
30
+ /** True when the product uses flat_fee pricing. The dosage is still set
31
+ * (Apex needs it for the prescription) but consumer cart drawers should
32
+ * skip rendering the dose suffix. */
33
+ hideDoseLabel?: boolean;
34
+ /** Copied from the catalog's `is_subscription` at add-time. The one-time
35
+ * checkout flow excludes subscription items (the backend 400s a
36
+ * /payments/checkout containing one, and stays the authority). Undefined —
37
+ * legacy persisted carts, non-catalog adds — is treated as one-time-purchasable. */
38
+ isSubscription?: boolean;
39
+ }
40
+ interface AppliedPromoCode {
41
+ code: string;
42
+ discountType: 'percent' | 'fixed';
43
+ discountValueCents: number;
44
+ discountCents: number;
45
+ }
46
+ declare function itemKey(productId: string, dosage: string): string;
47
+ declare const cartStore: {
48
+ items: solid_js.Accessor<CartItem[]>;
49
+ count: () => number;
50
+ subtotalCents: () => number;
51
+ add: (item: CartItem) => void;
52
+ remove: (key: string) => void;
53
+ setQuantity: (key: string, quantity: number) => void;
54
+ clear: () => void;
55
+ hasGlp1: () => boolean;
56
+ isMultiItem: () => boolean;
57
+ itemKey: typeof itemKey;
58
+ isOpen: solid_js.Accessor<boolean>;
59
+ open: () => true;
60
+ close: () => false;
61
+ toggle: () => boolean;
62
+ appliedPromo: solid_js.Accessor<AppliedPromoCode | null>;
63
+ setPromo: (promo: AppliedPromoCode | null) => void;
64
+ };
65
+
66
+ export { type AppliedPromoCode as A, type CartItem as C, cartStore as c };
@@ -0,0 +1,249 @@
1
+ // src/primitives.default.tsx
2
+ import { For, Show, createUniqueId } from "solid-js";
3
+ import { Dynamic } from "solid-js/web";
4
+ function Button(props) {
5
+ const variant = () => props.variant ?? "primary";
6
+ const size = () => props.size ?? "md";
7
+ const classes = () => [
8
+ "flow-btn",
9
+ `flow-btn--${size()}`,
10
+ `flow-btn--${variant()}`,
11
+ props.fullWidth ? "flow-btn--full" : ""
12
+ ].filter(Boolean).join(" ");
13
+ return <button
14
+ type={props.type ?? "button"}
15
+ onClick={(e) => props.onClick?.(e)}
16
+ disabled={props.disabled || props.loading}
17
+ class={classes()}
18
+ >
19
+ <Show when={props.loading}>
20
+ <span class="flow-btn-spinner" aria-hidden="true" />
21
+ </Show>
22
+ {props.children}
23
+ </button>;
24
+ }
25
+ function FieldShell(props) {
26
+ return <div class="flow-field">
27
+ <Show when={props.label}>
28
+ {
29
+ /* The required marker is a CSS ::after, not a text node — inside the
30
+ label it would land in the control's accessible name ("Email *"). */
31
+ }
32
+ <Dynamic
33
+ component={props.controlId ? "label" : "span"}
34
+ class={`flow-label${props.required ? " flow-label--required" : ""}`}
35
+ id={props.labelId}
36
+ for={props.controlId}
37
+ >
38
+ {props.label}
39
+ </Dynamic>
40
+ </Show>
41
+ {props.children}
42
+ <Show when={props.error}>
43
+ <p class="flow-error" id={props.errorId} role="alert">
44
+ {props.error}
45
+ </p>
46
+ </Show>
47
+ </div>;
48
+ }
49
+ function fieldIds() {
50
+ const base = createUniqueId();
51
+ return { controlId: base, labelId: `${base}-label`, errorId: `${base}-error` };
52
+ }
53
+ function TextField(props) {
54
+ const ids = fieldIds();
55
+ return <FieldShell {...ids} label={props.label} error={props.error} required={props.required}>
56
+ <input
57
+ id={ids.controlId}
58
+ class={`flow-input${props.error ? " flow-input--error" : ""}`}
59
+ type={props.type ?? "text"}
60
+ value={props.value}
61
+ onInput={(e) => props.onInput(e.currentTarget.value)}
62
+ placeholder={props.placeholder}
63
+ disabled={props.disabled}
64
+ required={props.required}
65
+ autocomplete={props.autocomplete}
66
+ inputmode={props.inputmode}
67
+ aria-invalid={props.error ? "true" : void 0}
68
+ aria-describedby={props.error ? ids.errorId : void 0}
69
+ />
70
+ </FieldShell>;
71
+ }
72
+ function Textarea(props) {
73
+ const ids = fieldIds();
74
+ return <FieldShell {...ids} label={props.label} error={props.error} required={props.required}>
75
+ <textarea
76
+ id={ids.controlId}
77
+ class={`flow-input flow-textarea${props.error ? " flow-input--error" : ""}`}
78
+ value={props.value}
79
+ onInput={(e) => props.onInput(e.currentTarget.value)}
80
+ rows={props.rows ?? 4}
81
+ placeholder={props.placeholder}
82
+ required={props.required}
83
+ aria-invalid={props.error ? "true" : void 0}
84
+ aria-describedby={props.error ? ids.errorId : void 0}
85
+ />
86
+ </FieldShell>;
87
+ }
88
+ function Select(props) {
89
+ const ids = fieldIds();
90
+ return <FieldShell {...ids} label={props.label} error={props.error} required={props.required}>
91
+ <select
92
+ id={ids.controlId}
93
+ class={`flow-input flow-select${props.error ? " flow-input--error" : ""}`}
94
+ value={props.value}
95
+ onChange={(e) => props.onChange(e.currentTarget.value)}
96
+ required={props.required}
97
+ disabled={props.disabled}
98
+ aria-invalid={props.error ? "true" : void 0}
99
+ aria-describedby={props.error ? ids.errorId : void 0}
100
+ >
101
+ <Show when={props.placeholder}>
102
+ <option value="">{props.placeholder}</option>
103
+ </Show>
104
+ <For each={props.options}>
105
+ {(opt) => <option value={opt.value}>{opt.label}</option>}
106
+ </For>
107
+ </select>
108
+ </FieldShell>;
109
+ }
110
+ function RadioGroup(props) {
111
+ const { controlId: groupName, labelId, errorId } = fieldIds();
112
+ return <FieldShell labelId={labelId} errorId={errorId} label={props.label} error={props.error}>
113
+ <div
114
+ class="flow-choices"
115
+ role="radiogroup"
116
+ aria-labelledby={props.label ? labelId : void 0}
117
+ aria-invalid={props.error ? "true" : void 0}
118
+ aria-describedby={props.error ? errorId : void 0}
119
+ >
120
+ <For each={props.options}>
121
+ {(opt) => <label class="flow-choice">
122
+ <input
123
+ type="radio"
124
+ name={groupName}
125
+ checked={props.value === opt.value}
126
+ onChange={() => props.onChange(opt.value)}
127
+ />
128
+ <span class="flow-choice-body">
129
+ <span class="flow-choice-label">{opt.label}</span>
130
+ <Show when={opt.description}>
131
+ <span class="flow-choice-desc">{opt.description}</span>
132
+ </Show>
133
+ </span>
134
+ </label>}
135
+ </For>
136
+ </div>
137
+ </FieldShell>;
138
+ }
139
+ function CheckboxGroup(props) {
140
+ const { labelId, errorId } = fieldIds();
141
+ return <FieldShell labelId={labelId} errorId={errorId} label={props.label} error={props.error}>
142
+ <div
143
+ class="flow-choices"
144
+ role="group"
145
+ aria-labelledby={props.label ? labelId : void 0}
146
+ aria-describedby={props.error ? errorId : void 0}
147
+ >
148
+ <For each={props.options}>
149
+ {(opt) => {
150
+ const selected = () => props.values.includes(opt.value);
151
+ const toggle = () => props.onChange(
152
+ selected() ? props.values.filter((v) => v !== opt.value) : [...props.values, opt.value]
153
+ );
154
+ return <label class="flow-choice">
155
+ <input type="checkbox" checked={selected()} onChange={toggle} />
156
+ <span class="flow-choice-body">
157
+ <span class="flow-choice-label">{opt.label}</span>
158
+ <Show when={opt.description}>
159
+ <span class="flow-choice-desc">{opt.description}</span>
160
+ </Show>
161
+ </span>
162
+ </label>;
163
+ }}
164
+ </For>
165
+ </div>
166
+ </FieldShell>;
167
+ }
168
+ function Card(props) {
169
+ const variant = () => props.variant ?? "primary";
170
+ const padding = () => props.padding ?? "md";
171
+ const classes = () => [
172
+ "flow-card",
173
+ variant() === "inset" ? "flow-card--inset" : "",
174
+ `flow-card--pad-${padding()}`,
175
+ props.class ?? ""
176
+ ].filter(Boolean).join(" ");
177
+ return <div class={classes()}>{props.children}</div>;
178
+ }
179
+ function Banner(props) {
180
+ return <div class={`flow-banner flow-banner--${props.variant}`}>{props.children}</div>;
181
+ }
182
+ function StatusPill(props) {
183
+ const label = () => props.label ?? props.status.charAt(0).toUpperCase() + props.status.slice(1);
184
+ return <span class={`flow-pill flow-pill--${props.status}`}>{label()}</span>;
185
+ }
186
+ function Spinner(props) {
187
+ return <span
188
+ class={`flow-spinner flow-spinner--${props.size ?? "md"}`}
189
+ role="status"
190
+ aria-label="Loading"
191
+ />;
192
+ }
193
+ function Heading(props) {
194
+ return <Dynamic
195
+ component={`h${props.level}`}
196
+ class={`flow-heading flow-heading--${props.level} ${props.class ?? ""}`.trim()}
197
+ >
198
+ {props.children}
199
+ </Dynamic>;
200
+ }
201
+ function StepIndicator(props) {
202
+ const steps = () => Array.from({ length: props.total }, (_, i) => props.labels?.[i] ?? `Step ${i + 1}`);
203
+ return <div
204
+ class="flow-steps"
205
+ role="group"
206
+ aria-label={`Step ${props.current + 1} of ${props.total}`}
207
+ >
208
+ <For each={steps()}>
209
+ {(label, i) => {
210
+ const state = () => i() < props.current ? "done" : i() === props.current ? "current" : "upcoming";
211
+ return <div class="flow-step">
212
+ <span
213
+ aria-hidden="true"
214
+ class={`flow-step-dot${state() === "upcoming" ? "" : ` flow-step-dot--${state()}`}`}
215
+ >
216
+ {i() < props.current ? "\u2713" : i() + 1}
217
+ </span>
218
+ <span
219
+ class={`flow-step-label${state() === "current" ? " flow-step-label--current" : ""}`}
220
+ >
221
+ {label}
222
+ </span>
223
+ <Show when={i() < props.total - 1}>
224
+ <span class="flow-step-line" aria-hidden="true" />
225
+ </Show>
226
+ </div>;
227
+ }}
228
+ </For>
229
+ </div>;
230
+ }
231
+ var defaultPrimitives = {
232
+ Card,
233
+ TextField,
234
+ Textarea,
235
+ Select,
236
+ RadioGroup,
237
+ CheckboxGroup,
238
+ Button,
239
+ Banner,
240
+ StatusPill,
241
+ Spinner,
242
+ Heading,
243
+ StepIndicator
244
+ };
245
+
246
+ export {
247
+ defaultPrimitives
248
+ };
249
+ //# sourceMappingURL=2OXI5TKO.jsx.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=3A3MF7R2.jsx.map