@conferencesuite/ui 0.0.0-stage → 0.0.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/NOTICE +9 -0
- package/README.md +11 -2
- package/dist/AuthButton.d.ts +8 -0
- package/dist/AuthButton.js +73 -0
- package/dist/AuthButton.js.map +1 -0
- package/dist/AuthDialog.d.ts +2 -0
- package/dist/AuthDialog.js +295 -0
- package/dist/AuthDialog.js.map +1 -0
- package/dist/AuthNotice.d.ts +2 -0
- package/dist/AuthNotice.js +32 -0
- package/dist/AuthNotice.js.map +1 -0
- package/dist/CatalogPicker.d.ts +13 -0
- package/dist/CatalogPicker.js +272 -0
- package/dist/CatalogPicker.js.map +1 -0
- package/dist/CheckoutMount.d.ts +10 -0
- package/dist/CheckoutMount.js +51 -0
- package/dist/CheckoutMount.js.map +1 -0
- package/dist/PaymentStatus.d.ts +16 -0
- package/dist/PaymentStatus.js +173 -0
- package/dist/PaymentStatus.js.map +1 -0
- package/dist/ProposalForm.d.ts +12 -0
- package/dist/ProposalForm.js +345 -0
- package/dist/ProposalForm.js.map +1 -0
- package/dist/RegistrationCta.d.ts +17 -0
- package/dist/RegistrationCta.js +39 -0
- package/dist/RegistrationCta.js.map +1 -0
- package/dist/RegistrationForm.d.ts +13 -0
- package/dist/RegistrationForm.js +523 -0
- package/dist/RegistrationForm.js.map +1 -0
- package/dist/ScheduleBadge.d.ts +5 -0
- package/dist/ScheduleBadge.js +22 -0
- package/dist/ScheduleBadge.js.map +1 -0
- package/dist/SchedulePage.d.ts +10 -0
- package/dist/SchedulePage.js +435 -0
- package/dist/SchedulePage.js.map +1 -0
- package/dist/ScheduleViews.d.ts +32 -0
- package/dist/ScheduleViews.js +294 -0
- package/dist/ScheduleViews.js.map +1 -0
- package/dist/SessionDialog.d.ts +16 -0
- package/dist/SessionDialog.js +144 -0
- package/dist/SessionDialog.js.map +1 -0
- package/dist/SuiteAuth.d.ts +6 -0
- package/dist/SuiteAuth.js +20 -0
- package/dist/SuiteAuth.js.map +1 -0
- package/dist/classes.d.ts +36 -0
- package/dist/classes.js +40 -0
- package/dist/classes.js.map +1 -0
- package/dist/fields.d.ts +10 -0
- package/dist/fields.js +250 -0
- package/dist/fields.js.map +1 -0
- package/dist/scheduleClasses.d.ts +16 -0
- package/dist/scheduleClasses.js +20 -0
- package/dist/scheduleClasses.js.map +1 -0
- package/package.json +43 -3
package/dist/fields.js
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Plus, Trash2 } from "lucide-react";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { emptyEntry, entryBounds, isRepeatable, toEntries, toPerson } from "@conferencesuite/core/registration/validation";
|
|
5
|
+
import { ui } from "./classes.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/fields.tsx
|
|
8
|
+
const labelOf = (item) => typeof item.label === "string" && item.label ? item.label : item.key;
|
|
9
|
+
function describedBy(id, hasHint, error) {
|
|
10
|
+
return [hasHint ? `${id}-hint` : "", error ? `${id}-error` : ""].filter(Boolean).join(" ") || void 0;
|
|
11
|
+
}
|
|
12
|
+
/** A single-value input (text, textarea, select) with its label, hint and error wired up. */
|
|
13
|
+
function SingleInput({ field, id, label, value, onChange, error, hint, hideLabel }) {
|
|
14
|
+
const aria = {
|
|
15
|
+
"aria-invalid": !!error,
|
|
16
|
+
"aria-describedby": describedBy(id, !!hint, error),
|
|
17
|
+
"aria-required": field.required || void 0
|
|
18
|
+
};
|
|
19
|
+
const inputType = field.type === "text" ? field.inputType : void 0;
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: ui.field,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("label", {
|
|
24
|
+
htmlFor: id,
|
|
25
|
+
className: hideLabel ? "sr-only" : ui.label,
|
|
26
|
+
children: [label, field.required && !hideLabel && /* @__PURE__ */ jsx("span", {
|
|
27
|
+
"aria-hidden": "true",
|
|
28
|
+
children: " *"
|
|
29
|
+
})]
|
|
30
|
+
}),
|
|
31
|
+
hint && /* @__PURE__ */ jsx("p", {
|
|
32
|
+
id: `${id}-hint`,
|
|
33
|
+
className: "text-sm text-base-content/70",
|
|
34
|
+
children: hint
|
|
35
|
+
}),
|
|
36
|
+
field.type === "textarea" ? /* @__PURE__ */ jsx("textarea", {
|
|
37
|
+
id,
|
|
38
|
+
className: `${ui.textarea} ${error ? ui.inputInvalid : ""}`,
|
|
39
|
+
value,
|
|
40
|
+
onChange: (e) => onChange(e.target.value),
|
|
41
|
+
placeholder: field.placeholder,
|
|
42
|
+
...aria
|
|
43
|
+
}) : field.type === "select" ? /* @__PURE__ */ jsxs("select", {
|
|
44
|
+
id,
|
|
45
|
+
className: `${ui.select} ${error ? ui.inputInvalid : ""}`,
|
|
46
|
+
value,
|
|
47
|
+
onChange: (e) => onChange(e.target.value),
|
|
48
|
+
...aria,
|
|
49
|
+
children: [/* @__PURE__ */ jsx("option", {
|
|
50
|
+
value: "",
|
|
51
|
+
children: "Choose one"
|
|
52
|
+
}), field.items.map((i) => /* @__PURE__ */ jsx("option", {
|
|
53
|
+
value: i.key,
|
|
54
|
+
children: labelOf(i)
|
|
55
|
+
}, i.key))]
|
|
56
|
+
}) : /* @__PURE__ */ jsx("input", {
|
|
57
|
+
id,
|
|
58
|
+
className: `${ui.input} ${error ? ui.inputInvalid : ""}`,
|
|
59
|
+
type: inputType === "email" ? "email" : inputType === "url" ? "url" : inputType === "number" ? "number" : "text",
|
|
60
|
+
autoComplete: inputType === "email" ? "email" : "off",
|
|
61
|
+
value,
|
|
62
|
+
onChange: (e) => onChange(e.target.value),
|
|
63
|
+
placeholder: field.type === "text" ? field.placeholder : void 0,
|
|
64
|
+
...aria
|
|
65
|
+
}),
|
|
66
|
+
error && /* @__PURE__ */ jsx("p", {
|
|
67
|
+
id: `${id}-error`,
|
|
68
|
+
className: ui.fieldError,
|
|
69
|
+
children: error
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function PersonInputs({ field, idBase, person, onChange, legend }) {
|
|
75
|
+
const set = (patch) => onChange({
|
|
76
|
+
...person,
|
|
77
|
+
...patch
|
|
78
|
+
});
|
|
79
|
+
const input = (key, label, type = "text") => /* @__PURE__ */ jsxs("div", {
|
|
80
|
+
className: ui.field,
|
|
81
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
82
|
+
htmlFor: `${idBase}-${key}`,
|
|
83
|
+
className: ui.label,
|
|
84
|
+
children: label
|
|
85
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
86
|
+
id: `${idBase}-${key}`,
|
|
87
|
+
type,
|
|
88
|
+
className: ui.input,
|
|
89
|
+
value: person[key] ?? "",
|
|
90
|
+
onChange: (e) => set({ [key]: e.target.value }),
|
|
91
|
+
autoComplete: "off"
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
95
|
+
className: ui.fieldset,
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx("legend", {
|
|
98
|
+
className: ui.legend,
|
|
99
|
+
children: legend
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ jsxs("div", {
|
|
102
|
+
className: "grid gap-3 sm:grid-cols-2",
|
|
103
|
+
children: [input("fname", "First name"), input("lname", "Last name")]
|
|
104
|
+
}),
|
|
105
|
+
field.extras?.email !== false && input("email", "Email", "email"),
|
|
106
|
+
input("affiliation", "Affiliation"),
|
|
107
|
+
field.extras?.title && input("title", "Title"),
|
|
108
|
+
field.extras?.department && input("department", "Department"),
|
|
109
|
+
field.customFields?.map((c) => /* @__PURE__ */ jsxs("div", {
|
|
110
|
+
className: ui.field,
|
|
111
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
112
|
+
htmlFor: `${idBase}-c-${c.id}`,
|
|
113
|
+
className: ui.label,
|
|
114
|
+
children: c.label
|
|
115
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
116
|
+
id: `${idBase}-c-${c.id}`,
|
|
117
|
+
className: ui.input,
|
|
118
|
+
value: person.custom?.[c.id] ?? "",
|
|
119
|
+
onChange: (e) => set({ custom: {
|
|
120
|
+
...person.custom,
|
|
121
|
+
[c.id]: e.target.value
|
|
122
|
+
} }),
|
|
123
|
+
autoComplete: "off"
|
|
124
|
+
})]
|
|
125
|
+
}, c.id))
|
|
126
|
+
]
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/** One form question: text, textarea, select or person, optionally repeatable ("add another"). */
|
|
130
|
+
function FieldInput({ field, value, error, onChange }) {
|
|
131
|
+
const id = useId();
|
|
132
|
+
const hint = field.description || void 0;
|
|
133
|
+
if (!isRepeatable(field)) {
|
|
134
|
+
if (field.type === "person") {
|
|
135
|
+
const single = Array.isArray(value) ? value[0] : value;
|
|
136
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
137
|
+
className: "flex flex-col gap-1",
|
|
138
|
+
children: [
|
|
139
|
+
hint && /* @__PURE__ */ jsx("p", {
|
|
140
|
+
className: "text-sm text-base-content/70",
|
|
141
|
+
children: hint
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ jsx(PersonInputs, {
|
|
144
|
+
field,
|
|
145
|
+
idBase: id,
|
|
146
|
+
person: toPerson(single),
|
|
147
|
+
onChange,
|
|
148
|
+
legend: `${field.title}${field.required ? " *" : ""}`
|
|
149
|
+
}),
|
|
150
|
+
error && /* @__PURE__ */ jsx("p", {
|
|
151
|
+
role: "alert",
|
|
152
|
+
className: ui.fieldError,
|
|
153
|
+
children: error
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const single = Array.isArray(value) ? value[0] : value;
|
|
159
|
+
return /* @__PURE__ */ jsx(SingleInput, {
|
|
160
|
+
field,
|
|
161
|
+
id,
|
|
162
|
+
label: field.title,
|
|
163
|
+
value: typeof single === "string" ? single : "",
|
|
164
|
+
onChange,
|
|
165
|
+
error,
|
|
166
|
+
hint
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const [min, max] = entryBounds(field);
|
|
170
|
+
const entries = toEntries(value);
|
|
171
|
+
const shown = entries.length >= min ? entries : [...entries, ...Array.from({ length: min - entries.length }, () => emptyEntry(field))];
|
|
172
|
+
const itemLabel = field.itemLabel || "Entry";
|
|
173
|
+
const update = (next) => onChange(next);
|
|
174
|
+
return /* @__PURE__ */ jsxs("fieldset", {
|
|
175
|
+
className: "flex flex-col gap-3",
|
|
176
|
+
"aria-describedby": describedBy(id, !!hint, error),
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ jsxs("legend", {
|
|
179
|
+
className: ui.label,
|
|
180
|
+
children: [field.title, field.required && /* @__PURE__ */ jsx("span", {
|
|
181
|
+
"aria-hidden": "true",
|
|
182
|
+
children: " *"
|
|
183
|
+
})]
|
|
184
|
+
}),
|
|
185
|
+
hint && /* @__PURE__ */ jsx("p", {
|
|
186
|
+
id: `${id}-hint`,
|
|
187
|
+
className: "text-sm text-base-content/70",
|
|
188
|
+
children: hint
|
|
189
|
+
}),
|
|
190
|
+
shown.map((entry, i) => {
|
|
191
|
+
const n = i + 1;
|
|
192
|
+
const canRemove = shown.length > min;
|
|
193
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
194
|
+
className: "flex flex-col gap-2",
|
|
195
|
+
children: [field.type === "person" ? /* @__PURE__ */ jsx(PersonInputs, {
|
|
196
|
+
field,
|
|
197
|
+
idBase: `${id}-${i}`,
|
|
198
|
+
person: toPerson(entry),
|
|
199
|
+
onChange: (p) => update(shown.map((e, j) => j === i ? p : e)),
|
|
200
|
+
legend: `${itemLabel} ${n}`
|
|
201
|
+
}) : /* @__PURE__ */ jsx(SingleInput, {
|
|
202
|
+
field,
|
|
203
|
+
id: `${id}-${i}`,
|
|
204
|
+
label: `${field.title}, ${itemLabel.toLowerCase()} ${n}`,
|
|
205
|
+
hideLabel: true,
|
|
206
|
+
value: typeof entry === "string" ? entry : "",
|
|
207
|
+
onChange: (v) => update(shown.map((e, j) => j === i ? v : e))
|
|
208
|
+
}), canRemove && /* @__PURE__ */ jsxs("button", {
|
|
209
|
+
type: "button",
|
|
210
|
+
className: "btn btn-ghost btn-sm self-start",
|
|
211
|
+
onClick: () => update(shown.filter((_, j) => j !== i)),
|
|
212
|
+
children: [
|
|
213
|
+
/* @__PURE__ */ jsx(Trash2, {
|
|
214
|
+
className: "size-4",
|
|
215
|
+
"aria-hidden": "true"
|
|
216
|
+
}),
|
|
217
|
+
" Remove ",
|
|
218
|
+
itemLabel.toLowerCase(),
|
|
219
|
+
" ",
|
|
220
|
+
n
|
|
221
|
+
]
|
|
222
|
+
})]
|
|
223
|
+
}, i);
|
|
224
|
+
}),
|
|
225
|
+
shown.length < max && /* @__PURE__ */ jsxs("button", {
|
|
226
|
+
type: "button",
|
|
227
|
+
className: "btn btn-outline btn-sm self-start",
|
|
228
|
+
onClick: () => update([...shown, emptyEntry(field)]),
|
|
229
|
+
children: [
|
|
230
|
+
/* @__PURE__ */ jsx(Plus, {
|
|
231
|
+
className: "size-4",
|
|
232
|
+
"aria-hidden": "true"
|
|
233
|
+
}),
|
|
234
|
+
" Add ",
|
|
235
|
+
shown.length > 0 ? "another " : "a ",
|
|
236
|
+
itemLabel.toLowerCase()
|
|
237
|
+
]
|
|
238
|
+
}),
|
|
239
|
+
error && /* @__PURE__ */ jsx("p", {
|
|
240
|
+
id: `${id}-error`,
|
|
241
|
+
role: "alert",
|
|
242
|
+
className: ui.fieldError,
|
|
243
|
+
children: error
|
|
244
|
+
})
|
|
245
|
+
]
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
export { FieldInput };
|
|
249
|
+
|
|
250
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","names":[],"sources":["../src/fields.tsx"],"sourcesContent":["\"use client\";\n\nimport { Plus, Trash2 } from \"lucide-react\";\nimport { useId } from \"react\";\nimport { emptyEntry, entryBounds, isRepeatable, toEntries, toPerson } from \"@conferencesuite/core/registration/validation\";\nimport type { FieldValue, FormField, PersonValue } from \"@conferencesuite/core/registration/types\";\nimport { ui } from \"./classes\";\n\ntype Common = {\n field: FormField;\n value: FieldValue | undefined;\n error?: string;\n onChange: (v: FieldValue) => void;\n};\n\nconst labelOf = (item: { key: string; label?: unknown }) => (typeof item.label === \"string\" && item.label ? item.label : item.key);\n\nfunction describedBy(id: string, hasHint: boolean, error?: string) {\n const ids = [hasHint ? `${id}-hint` : \"\", error ? `${id}-error` : \"\"].filter(Boolean).join(\" \");\n return ids || undefined;\n}\n\n/** A single-value input (text, textarea, select) with its label, hint and error wired up. */\nfunction SingleInput({\n field,\n id,\n label,\n value,\n onChange,\n error,\n hint,\n hideLabel,\n}: {\n field: FormField;\n id: string;\n label: string;\n value: string;\n onChange: (v: string) => void;\n error?: string;\n hint?: string;\n hideLabel?: boolean;\n}) {\n const aria = { \"aria-invalid\": !!error, \"aria-describedby\": describedBy(id, !!hint, error), \"aria-required\": field.required || undefined };\n const inputType = field.type === \"text\" ? field.inputType : undefined;\n return (\n <div className={ui.field}>\n <label htmlFor={id} className={hideLabel ? \"sr-only\" : ui.label}>\n {label}\n {field.required && !hideLabel && <span aria-hidden=\"true\"> *</span>}\n </label>\n {hint && (\n <p id={`${id}-hint`} className=\"text-sm text-base-content/70\">\n {hint}\n </p>\n )}\n {field.type === \"textarea\" ? (\n <textarea id={id} className={`${ui.textarea} ${error ? ui.inputInvalid : \"\"}`} value={value} onChange={(e) => onChange(e.target.value)} placeholder={field.placeholder} {...aria} />\n ) : field.type === \"select\" ? (\n <select id={id} className={`${ui.select} ${error ? ui.inputInvalid : \"\"}`} value={value} onChange={(e) => onChange(e.target.value)} {...aria}>\n <option value=\"\">Choose one</option>\n {field.items.map((i) => (\n <option key={i.key} value={i.key}>\n {labelOf(i)}\n </option>\n ))}\n </select>\n ) : (\n <input\n id={id}\n className={`${ui.input} ${error ? ui.inputInvalid : \"\"}`}\n type={inputType === \"email\" ? \"email\" : inputType === \"url\" ? \"url\" : inputType === \"number\" ? \"number\" : \"text\"}\n autoComplete={inputType === \"email\" ? \"email\" : \"off\"}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={field.type === \"text\" ? field.placeholder : undefined}\n {...aria}\n />\n )}\n {error && (\n <p id={`${id}-error`} className={ui.fieldError}>\n {error}\n </p>\n )}\n </div>\n );\n}\n\nfunction PersonInputs({\n field,\n idBase,\n person,\n onChange,\n legend,\n}: {\n field: Extract<FormField, { type: \"person\" }>;\n idBase: string;\n person: PersonValue;\n onChange: (p: PersonValue) => void;\n legend: string;\n}) {\n const set = (patch: Partial<PersonValue>) => onChange({ ...person, ...patch });\n const input = (key: \"fname\" | \"lname\" | \"email\" | \"affiliation\" | \"title\" | \"department\", label: string, type = \"text\") => (\n <div className={ui.field}>\n <label htmlFor={`${idBase}-${key}`} className={ui.label}>\n {label}\n </label>\n <input id={`${idBase}-${key}`} type={type} className={ui.input} value={(person[key] as string | undefined) ?? \"\"} onChange={(e) => set({ [key]: e.target.value })} autoComplete=\"off\" />\n </div>\n );\n return (\n <fieldset className={ui.fieldset}>\n <legend className={ui.legend}>{legend}</legend>\n <div className=\"grid gap-3 sm:grid-cols-2\">\n {input(\"fname\", \"First name\")}\n {input(\"lname\", \"Last name\")}\n </div>\n {field.extras?.email !== false && input(\"email\", \"Email\", \"email\")}\n {input(\"affiliation\", \"Affiliation\")}\n {field.extras?.title && input(\"title\", \"Title\")}\n {field.extras?.department && input(\"department\", \"Department\")}\n {field.customFields?.map((c) => (\n <div key={c.id} className={ui.field}>\n <label htmlFor={`${idBase}-c-${c.id}`} className={ui.label}>\n {c.label}\n </label>\n <input\n id={`${idBase}-c-${c.id}`}\n className={ui.input}\n value={person.custom?.[c.id] ?? \"\"}\n onChange={(e) => set({ custom: { ...person.custom, [c.id]: e.target.value } })}\n autoComplete=\"off\"\n />\n </div>\n ))}\n </fieldset>\n );\n}\n\n/** One form question: text, textarea, select or person, optionally repeatable (\"add another\"). */\nexport function FieldInput({ field, value, error, onChange }: Common) {\n const id = useId();\n const hint = field.description || undefined;\n\n if (!isRepeatable(field)) {\n if (field.type === \"person\") {\n const single = Array.isArray(value) ? value[0] : value;\n return (\n <div className=\"flex flex-col gap-1\">\n {hint && <p className=\"text-sm text-base-content/70\">{hint}</p>}\n <PersonInputs field={field} idBase={id} person={toPerson(single)} onChange={onChange} legend={`${field.title}${field.required ? \" *\" : \"\"}`} />\n {error && (\n <p role=\"alert\" className={ui.fieldError}>\n {error}\n </p>\n )}\n </div>\n );\n }\n const single = Array.isArray(value) ? value[0] : value;\n return <SingleInput field={field} id={id} label={field.title} value={typeof single === \"string\" ? single : \"\"} onChange={onChange} error={error} hint={hint} />;\n }\n\n const [min, max] = entryBounds(field);\n const entries = toEntries(value);\n // An optional list starts empty (\"Add a guest\"); a required one starts with the entries it needs\n const shown = entries.length >= min ? entries : [...entries, ...Array.from({ length: min - entries.length }, () => emptyEntry(field))];\n const itemLabel = field.itemLabel || \"Entry\";\n const update = (next: Array<string | PersonValue>) => onChange(next);\n\n return (\n <fieldset className=\"flex flex-col gap-3\" aria-describedby={describedBy(id, !!hint, error)}>\n <legend className={ui.label}>\n {field.title}\n {field.required && <span aria-hidden=\"true\"> *</span>}\n </legend>\n {hint && (\n <p id={`${id}-hint`} className=\"text-sm text-base-content/70\">\n {hint}\n </p>\n )}\n {shown.map((entry, i) => {\n const n = i + 1;\n const canRemove = shown.length > min;\n return (\n <div key={i} className=\"flex flex-col gap-2\">\n {field.type === \"person\" ? (\n <PersonInputs field={field} idBase={`${id}-${i}`} person={toPerson(entry)} onChange={(p) => update(shown.map((e, j) => (j === i ? p : e)))} legend={`${itemLabel} ${n}`} />\n ) : (\n <SingleInput\n field={field}\n id={`${id}-${i}`}\n label={`${field.title}, ${itemLabel.toLowerCase()} ${n}`}\n hideLabel\n value={typeof entry === \"string\" ? entry : \"\"}\n onChange={(v) => update(shown.map((e, j) => (j === i ? v : e)))}\n />\n )}\n {canRemove && (\n <button type=\"button\" className=\"btn btn-ghost btn-sm self-start\" onClick={() => update(shown.filter((_, j) => j !== i))}>\n <Trash2 className=\"size-4\" aria-hidden=\"true\" /> Remove {itemLabel.toLowerCase()} {n}\n </button>\n )}\n </div>\n );\n })}\n {shown.length < max && (\n <button type=\"button\" className=\"btn btn-outline btn-sm self-start\" onClick={() => update([...shown, emptyEntry(field)])}>\n <Plus className=\"size-4\" aria-hidden=\"true\" /> Add {shown.length > 0 ? \"another \" : \"a \"}\n {itemLabel.toLowerCase()}\n </button>\n )}\n {error && (\n <p id={`${id}-error`} role=\"alert\" className={ui.fieldError}>\n {error}\n </p>\n )}\n </fieldset>\n );\n}\n"],"mappings":";;;;;;;AAeA,MAAM,WAAW,SAA4C,OAAO,KAAK,UAAU,YAAY,KAAK,QAAQ,KAAK,QAAQ,KAAK;AAE9H,SAAS,YAAY,IAAY,SAAkB,OAAgB;CAEjE,OADY,CAAC,UAAU,GAAG,GAAG,SAAS,IAAI,QAAQ,GAAG,GAAG,UAAU,EAAE,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAClF,KAAK,KAAA;AAChB;;AAGA,SAAS,YAAY,EACnB,OACA,IACA,OACA,OACA,UACA,OACA,MACA,aAUC;CACD,MAAM,OAAO;EAAE,gBAAgB,CAAC,CAAC;EAAO,oBAAoB,YAAY,IAAI,CAAC,CAAC,MAAM,KAAK;EAAG,iBAAiB,MAAM,YAAY,KAAA;CAAU;CACzI,MAAM,YAAY,MAAM,SAAS,SAAS,MAAM,YAAY,KAAA;CAC5D,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG;EAAnB,UAAA;GACE,qBAAC,SAAD;IAAO,SAAS;IAAI,WAAW,YAAY,YAAY,GAAG;IAA1D,UAAA,CACG,OACA,MAAM,YAAY,CAAC,aAAa,oBAAC,QAAD;KAAM,eAAY;KAAO,UA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AAG;IAAS,MAAK;IAAQ,WAAW,GAAG;IAC9C,UAAA;GACA,CAAA;EAEG;;AAEd"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedule styling. The org's admin-chosen theme arrives as --cs-* CSS variables on the
|
|
3
|
+
* schedule's wrapper; each class falls back to the site's daisyUI tokens, so with no theme
|
|
4
|
+
* the schedule simply follows the site (light/dark included).
|
|
5
|
+
*/
|
|
6
|
+
export declare const sch: {
|
|
7
|
+
readonly root: "text-[var(--cs-fg,var(--color-base-content))] bg-[var(--cs-bg,transparent)] rounded-box";
|
|
8
|
+
readonly surface: "bg-[var(--cs-surface,var(--color-base-100))] text-[var(--cs-fg,var(--color-base-content))] border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_25%,transparent)]";
|
|
9
|
+
readonly muted: "text-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_78%,transparent)]";
|
|
10
|
+
readonly accentBtn: "inline-flex items-center justify-center gap-2 rounded-field px-3 py-2 text-sm font-semibold bg-[var(--cs-accent,var(--color-primary))] text-[var(--cs-accent-fg,var(--color-primary-content))] hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]";
|
|
11
|
+
readonly ghostBtn: "inline-flex items-center justify-center gap-2 rounded-field px-3 py-2 text-sm font-medium border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_35%,transparent)] hover:bg-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_8%,transparent)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]";
|
|
12
|
+
readonly toggleOn: "bg-[var(--cs-accent,var(--color-primary))]! hover:bg-[var(--cs-accent,var(--color-primary))]! text-[var(--cs-accent-fg,var(--color-primary-content))]! border-transparent";
|
|
13
|
+
readonly field: "w-full rounded-field border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_40%,transparent)] bg-[var(--cs-surface,var(--color-base-100))] text-[var(--cs-fg,var(--color-base-content))] px-3 py-2 text-sm";
|
|
14
|
+
readonly focus: "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]";
|
|
15
|
+
readonly link: "underline underline-offset-2 text-[var(--cs-accent,var(--color-primary))] hover:opacity-80";
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/scheduleClasses.ts
|
|
2
|
+
/**
|
|
3
|
+
* Schedule styling. The org's admin-chosen theme arrives as --cs-* CSS variables on the
|
|
4
|
+
* schedule's wrapper; each class falls back to the site's daisyUI tokens, so with no theme
|
|
5
|
+
* the schedule simply follows the site (light/dark included).
|
|
6
|
+
*/
|
|
7
|
+
const sch = {
|
|
8
|
+
root: "text-[var(--cs-fg,var(--color-base-content))] bg-[var(--cs-bg,transparent)] rounded-box",
|
|
9
|
+
surface: "bg-[var(--cs-surface,var(--color-base-100))] text-[var(--cs-fg,var(--color-base-content))] border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_25%,transparent)]",
|
|
10
|
+
muted: "text-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_78%,transparent)]",
|
|
11
|
+
accentBtn: "inline-flex items-center justify-center gap-2 rounded-field px-3 py-2 text-sm font-semibold bg-[var(--cs-accent,var(--color-primary))] text-[var(--cs-accent-fg,var(--color-primary-content))] hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]",
|
|
12
|
+
ghostBtn: "inline-flex items-center justify-center gap-2 rounded-field px-3 py-2 text-sm font-medium border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_35%,transparent)] hover:bg-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_8%,transparent)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]",
|
|
13
|
+
toggleOn: "bg-[var(--cs-accent,var(--color-primary))]! hover:bg-[var(--cs-accent,var(--color-primary))]! text-[var(--cs-accent-fg,var(--color-primary-content))]! border-transparent",
|
|
14
|
+
field: "w-full rounded-field border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_40%,transparent)] bg-[var(--cs-surface,var(--color-base-100))] text-[var(--cs-fg,var(--color-base-content))] px-3 py-2 text-sm",
|
|
15
|
+
focus: "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]",
|
|
16
|
+
link: "underline underline-offset-2 text-[var(--cs-accent,var(--color-primary))] hover:opacity-80"
|
|
17
|
+
};
|
|
18
|
+
export { sch };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=scheduleClasses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduleClasses.js","names":[],"sources":["../src/scheduleClasses.ts"],"sourcesContent":["/**\n * Schedule styling. The org's admin-chosen theme arrives as --cs-* CSS variables on the\n * schedule's wrapper; each class falls back to the site's daisyUI tokens, so with no theme\n * the schedule simply follows the site (light/dark included).\n */\nexport const sch = {\n root: \"text-[var(--cs-fg,var(--color-base-content))] bg-[var(--cs-bg,transparent)] rounded-box\",\n surface: \"bg-[var(--cs-surface,var(--color-base-100))] text-[var(--cs-fg,var(--color-base-content))] border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_25%,transparent)]\",\n muted: \"text-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_78%,transparent)]\",\n accentBtn:\n \"inline-flex items-center justify-center gap-2 rounded-field px-3 py-2 text-sm font-semibold bg-[var(--cs-accent,var(--color-primary))] text-[var(--cs-accent-fg,var(--color-primary-content))] hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]\",\n ghostBtn:\n \"inline-flex items-center justify-center gap-2 rounded-field px-3 py-2 text-sm font-medium border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_35%,transparent)] hover:bg-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_8%,transparent)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]\",\n // Important so the ghost button's hover tint can never replace the accent (that put accent text on a tint: 1.2:1)\n toggleOn: \"bg-[var(--cs-accent,var(--color-primary))]! hover:bg-[var(--cs-accent,var(--color-primary))]! text-[var(--cs-accent-fg,var(--color-primary-content))]! border-transparent\",\n field:\n \"w-full rounded-field border border-[color-mix(in_oklab,var(--cs-fg,var(--color-base-content))_40%,transparent)] bg-[var(--cs-surface,var(--color-base-100))] text-[var(--cs-fg,var(--color-base-content))] px-3 py-2 text-sm\",\n focus: \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--cs-accent,var(--color-primary))]\",\n link: \"underline underline-offset-2 text-[var(--cs-accent,var(--color-primary))] hover:opacity-80\",\n} as const;\n"],"mappings":";;;;;;AAKA,MAAa,MAAM;CACjB,MAAM;CACN,SAAS;CACT,OAAO;CACP,WACE;CACF,UACE;CAEF,UAAU;CACV,OACE;CACF,OAAO;CACP,MAAM;AACR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conferencesuite/ui",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Accessible Conference Suite components (Tailwind + Ark UI), themed with --cs-* variables.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/conferencesuite/sdk.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": "https://github.com/conferencesuite/sdk/issues",
|
|
13
|
+
"homepage": "https://github.com/conferencesuite/sdk#readme",
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"NOTICE"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsdown",
|
|
25
|
+
"prepack": "cp ../../LICENSE ../../NOTICE .",
|
|
26
|
+
"postpack": "rm -f LICENSE NOTICE"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
"./package.json": "./package.json",
|
|
30
|
+
"./*": {
|
|
31
|
+
"types": "./dist/*.d.ts",
|
|
32
|
+
"import": "./dist/*.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@conferencesuite/core": "^0.0.0",
|
|
37
|
+
"@conferencesuite/react": "^0.0.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@ark-ui/react": "^5",
|
|
41
|
+
"@stripe/stripe-js": "^5",
|
|
42
|
+
"lucide-react": ">=0.400",
|
|
43
|
+
"react": "^19",
|
|
44
|
+
"react-dom": "^19"
|
|
45
|
+
}
|
|
6
46
|
}
|