@xenosystem/components 0.3.1 → 0.4.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.
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode } from 'react';
2
+ import { ReactNode, ReactElement } from 'react';
3
3
  import { ButtonVariant } from '@xenosystem/elements-react';
4
4
 
5
5
  declare function ensureAuthStyles(): void;
@@ -143,4 +143,24 @@ declare const CREDENTIAL_STATES: {
143
143
  props: CredentialStateProps;
144
144
  }[];
145
145
 
146
- export { AuthDoor, type AuthDoorProps, AuthHero, type AuthHeroProps, type AuthHeroStat, CREDENTIAL_STATES, type CredentialErrors, CredentialForm, type CredentialFormProps, type CredentialMode, type CredentialValues, EmailDisclosure, type EmailDisclosureProps, LicencePlate, OrDivider, STATES, type SignInAction, SignInForm, type SignInFormProps, type SocialProvider, SocialSignIn, type SocialSignInProps, XenoMark, ensureAuthStyles };
146
+ /**
147
+ * `gallery()` — every unit of the family in every state, as renderable entries. This is what the
148
+ * workshop (rungs 1–2, from source) and xeno-apps' Library mode (from the published package) both
149
+ * consume, so neither hand-lists a state: `XENO FRONT-END HIERARCHY.md` — "states are derived, never
150
+ * hand-listed, IN the rung packages, so the workshop and the Library render the same list."
151
+ *
152
+ * `render` is pure: fixture props in, element out, callbacks inert. A gallery entry never reaches a
153
+ * network or a host.
154
+ */
155
+
156
+ interface GalleryEntry {
157
+ family: 'auth';
158
+ unit: string;
159
+ state: string;
160
+ /** How the entry wants to be staged: `form` (a 400 px column) or `door` (fills a box, `inset: 0`). */
161
+ stage: 'form' | 'door';
162
+ render: () => ReactElement;
163
+ }
164
+ declare function gallery(): GalleryEntry[];
165
+
166
+ export { AuthDoor, type AuthDoorProps, AuthHero, type AuthHeroProps, type AuthHeroStat, CREDENTIAL_STATES, type CredentialErrors, CredentialForm, type CredentialFormProps, type CredentialMode, type CredentialValues, EmailDisclosure, type EmailDisclosureProps, type GalleryEntry, LicencePlate, OrDivider, STATES, type SignInAction, SignInForm, type SignInFormProps, type SocialProvider, SocialSignIn, type SocialSignInProps, XenoMark, ensureAuthStyles, gallery };
@@ -317,6 +317,46 @@ var CREDENTIAL_STATES = [
317
317
  { id: "collapsed", props: { mode: "signin", values: empty, open: false, title: "Welcome back", body: "Enter your credentials to access your account" } },
318
318
  { id: "rejected", props: { mode: "signin", values: { name: "", email: "you@example.com", password: "hunter22" }, errors: { form: "Invalid email or password." }, title: "Welcome back", body: "Enter your credentials to access your account" } }
319
319
  ];
320
+
321
+ // src/auth/gallery.tsx
322
+ import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
323
+ var noop = () => {
324
+ };
325
+ function gallery() {
326
+ const out = [];
327
+ const hero = {
328
+ headline: /* @__PURE__ */ jsxs8(Fragment2, { children: [
329
+ "One account.",
330
+ /* @__PURE__ */ jsx9("br", {}),
331
+ "Every XENO product."
332
+ ] }),
333
+ lead: "Sign in once and XENO Canvas \u2014 and every other XENO app \u2014 runs under your plan, your credits and your files.",
334
+ stats: [{ value: "1", label: "Account" }, { value: "Yours", label: "Files stay put" }, { value: "Browser", label: "Sign-in, never in-app" }]
335
+ };
336
+ for (const s of STATES) {
337
+ out.push({ family: "auth", unit: "SignInForm", state: s.id, stage: "form", render: () => /* @__PURE__ */ jsx9(SignInForm, { ...s.props, phase: s.id }) });
338
+ out.push({ family: "auth", unit: "AuthDoor", state: s.id, stage: "door", render: () => /* @__PURE__ */ jsx9(AuthDoor, { label: `XENO Canvas sign-in \u2014 ${s.id}`, hero, rootAttributes: { "data-xeno-auth-gate": s.id }, children: /* @__PURE__ */ jsx9(SignInForm, { ...s.props, phase: s.id }) }) });
339
+ }
340
+ for (const s of CREDENTIAL_STATES) {
341
+ out.push({ family: "auth", unit: "CredentialForm", state: s.id, stage: "form", render: () => /* @__PURE__ */ jsx9(CredentialForm, { ...s.props, id: `gallery-${s.id}`, onModeChange: noop, onChange: noop, onSubmit: noop, before: /* @__PURE__ */ jsxs8(Fragment2, { children: [
342
+ /* @__PURE__ */ jsx9(SocialSignIn, { onSelect: noop }),
343
+ /* @__PURE__ */ jsx9(EmailDisclosure, { open: s.props.open !== false, onToggle: noop, controls: `gallery-${s.id}` })
344
+ ] }) }) });
345
+ }
346
+ out.push({ family: "auth", unit: "SocialSignIn", state: "default", stage: "form", render: () => /* @__PURE__ */ jsx9(SocialSignIn, { onSelect: noop }) });
347
+ out.push({ family: "auth", unit: "SocialSignIn", state: "disabled", stage: "form", render: () => /* @__PURE__ */ jsx9(SocialSignIn, { onSelect: noop, disabled: true }) });
348
+ const region = (id, open) => /* @__PURE__ */ jsx9("div", { id, hidden: !open, className: "xc-form__note", children: "the email form" });
349
+ out.push({ family: "auth", unit: "EmailDisclosure", state: "closed", stage: "form", render: () => /* @__PURE__ */ jsxs8(Fragment2, { children: [
350
+ /* @__PURE__ */ jsx9(EmailDisclosure, { open: false, onToggle: noop, controls: "gallery-disclosure-closed" }),
351
+ region("gallery-disclosure-closed", false)
352
+ ] }) });
353
+ out.push({ family: "auth", unit: "EmailDisclosure", state: "open", stage: "form", render: () => /* @__PURE__ */ jsxs8(Fragment2, { children: [
354
+ /* @__PURE__ */ jsx9(EmailDisclosure, { open: true, onToggle: noop, controls: "gallery-disclosure-open" }),
355
+ region("gallery-disclosure-open", true)
356
+ ] }) });
357
+ out.push({ family: "auth", unit: "OrDivider", state: "default", stage: "form", render: () => /* @__PURE__ */ jsx9(OrDivider, {}) });
358
+ return out;
359
+ }
320
360
  export {
321
361
  AuthDoor,
322
362
  AuthHero,
@@ -329,5 +369,6 @@ export {
329
369
  SignInForm,
330
370
  SocialSignIn,
331
371
  XenoMark,
332
- ensureAuthStyles
372
+ ensureAuthStyles,
373
+ gallery
333
374
  };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,6 @@
3
3
  * Families are subpaths: `@xenosystem/components/auth`, `/navigation`, `/feedback`, `/data`.
4
4
  * This root re-exports nothing on purpose: import the family you use, so a bundle carries only it.
5
5
  */
6
- declare const COMPONENTS_VERSION = "0.3.1";
6
+ declare const COMPONENTS_VERSION = "0.4.0";
7
7
 
8
8
  export { COMPONENTS_VERSION };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- var COMPONENTS_VERSION = "0.3.1";
2
+ var COMPONENTS_VERSION = "0.4.0";
3
3
  export {
4
4
  COMPONENTS_VERSION
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/components",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "XENO Components — rung 2 of the front ladder: molecules composed from @xenosystem/elements, with no host contract. Families as subpaths: /auth, /navigation, /feedback, /data.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",