@lockerverse/react 0.2.106-dev.1 → 0.2.108-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/auction-base.css +1 -1
- package/dist/auction-catalog.css +1 -1
- package/dist/public-events.css +14 -4
- package/dist/public-events.d.ts.map +1 -1
- package/dist/public-events.js +1 -1
- package/dist/public-events.js.map +1 -1
- package/dist/signup.css +1 -2
- package/dist/styles.css +1 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -261,7 +261,7 @@ Auction checkout, payment, and signup use common email, phone, field-error, and
|
|
|
261
261
|
|
|
262
262
|
Payment and auction Stripe forms resolve the rendered SDK font and theme tokens before passing them to Stripe. Custom font files are not loaded into Stripe by a font family name alone. See [the shared form foundation](https://github.com/Lockerverse/lockerverse-sdk/blob/main/docs/shared-form-foundation.md) for module boundaries and bundle measurement.
|
|
263
263
|
|
|
264
|
-
Use `theme="dark"` or `theme="light"
|
|
264
|
+
Use `theme="dark"` or `theme="light"` to match the host background. The outer payment, signup, auction, and Events widgets are transparent, so the host controls their canvas. Lockerverse applies the community branding returned by the widget API. Pass the same `LockerverseStyle` object to payment, signup, and donate launcher components.
|
|
265
265
|
|
|
266
266
|
```tsx
|
|
267
267
|
import type { LockerverseStyle } from "@lockerverse/react";
|
package/dist/auction-base.css
CHANGED
package/dist/auction-catalog.css
CHANGED
package/dist/public-events.css
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
padding: 28px;
|
|
11
11
|
font: 14px / 1.5 var(--lockerverse-font-family);
|
|
12
12
|
color: var(--lockerverse-text);
|
|
13
|
-
background:
|
|
13
|
+
background: transparent;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
.lockerverse-public-events[data-lockerverse-theme="light"] {
|
|
@@ -107,12 +107,22 @@
|
|
|
107
107
|
white-space: pre-line;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
.lockerverse-public-events
|
|
111
|
-
display: inline-
|
|
110
|
+
.lockerverse-public-events .lockerverse-public-events__link {
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
gap: 8px;
|
|
113
|
+
align-items: center;
|
|
114
|
+
min-height: 44px;
|
|
115
|
+
padding: 8px 14px;
|
|
112
116
|
margin-top: 14px;
|
|
113
117
|
font-weight: 600;
|
|
114
118
|
color: var(--lockerverse-accent);
|
|
115
|
-
text-
|
|
119
|
+
text-decoration: none;
|
|
120
|
+
border: 1px solid var(--lockerverse-border);
|
|
121
|
+
border-radius: 8px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.lockerverse-public-events .lockerverse-public-events__link:hover {
|
|
125
|
+
border-color: var(--lockerverse-accent);
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
.lockerverse-public-events a:focus-visible,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-events.d.ts","names":[],"sources":["../src/use-lockerverse-public-events.ts","../src/lockerverse-public-events.tsx"],"mappings":";;;KAUY;EACV,QAAQ;EACR,QAAQ;EACR;EACA,OAAO;EACP;;;iBAIc,2BACd,SAAS,uCACR;;;KCjBS;EACV,QAAQ;;EAER;EACA;EACA;;EAEA;EACA,QAAQ;EACR,QAAQ;EACR;;;
|
|
1
|
+
{"version":3,"file":"public-events.d.ts","names":[],"sources":["../src/use-lockerverse-public-events.ts","../src/lockerverse-public-events.tsx"],"mappings":";;;KAUY;EACV,QAAQ;EACR,QAAQ;EACR;EACA,OAAO;EACP;;;iBAIc,2BACd,SAAS,uCACR;;;KCjBS;EACV,QAAQ;;EAER;EACA;EACA;;EAEA;EACA,QAAQ;EACR,QAAQ;EACR;;;iBAoGc,0BACd,QACA,OACA,aACA,cACA,UACA,OACA,OACA,aACC,+CAA4B,IAAA"}
|
package/dist/public-events.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as e}from"./immutable-resource-identity.js";import{useCallback as t,useEffect as n,useRef as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{createLockerversePublicEventsClient as s}from"@lockerverse/sdk/public-events";function c(e,t){return new Intl.DateTimeFormat(`en-US`,{day:`numeric`,month:`short`,timeZone:t,year:`numeric`}).format(new Date(e))}function l(e,t){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,timeZone:t,timeZoneName:`short`}).format(new Date(e))}function u(e){if(!e)return null;try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.toString():null}catch{return null}}function d({item:e,timeZone:t}){let n=new Date(e.startAt),r=new Intl.DateTimeFormat(`en-US`,{month:`short`,timeZone:t}).format(n),i=new Intl.DateTimeFormat(`en-US`,{day:`numeric`,timeZone:t}).format(n),s=c(e.startAt,t)===c(e.endAt,t)?l(e.endAt,t):`${c(e.endAt,t)} at ${l(e.endAt,t)}`,d=u(e.link);return a(`li`,{className:`lockerverse-public-events__item`,children:o(`article`,{className:`lockerverse-public-events__row`,children:[o(`div`,{"aria-hidden":`true`,className:`lockerverse-public-events__date`,children:[a(`span`,{className:`lockerverse-public-events__month`,children:r}),a(`span`,{className:`lockerverse-public-events__day`,children:i})]}),o(`div`,{className:`lockerverse-public-events__content`,children:[a(`h3`,{children:e.name}),o(`p`,{className:`lockerverse-public-events__time`,children:[o(`time`,{dateTime:e.startAt,children:[c(e.startAt,t),` at`,` `,l(e.startAt,t)]}),a(`span`,{"aria-hidden":`true`,children:` — `}),a(`time`,{dateTime:e.endAt,children:s})]}),e.location?a(`p`,{className:`lockerverse-public-events__place`,children:e.location}):null,e.description?a(`p`,{className:`lockerverse-public-events__description`,children:e.description}):null,d?o(`a`,{href:d,rel:`noopener noreferrer`,target:`_blank`,children:[`
|
|
1
|
+
import{t as e}from"./immutable-resource-identity.js";import{useCallback as t,useEffect as n,useRef as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{createLockerversePublicEventsClient as s}from"@lockerverse/sdk/public-events";function c(e,t){return new Intl.DateTimeFormat(`en-US`,{day:`numeric`,month:`short`,timeZone:t,year:`numeric`}).format(new Date(e))}function l(e,t){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,timeZone:t,timeZoneName:`short`}).format(new Date(e))}function u(e){if(!e)return null;try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.toString():null}catch{return null}}function d({item:e,timeZone:t}){let n=new Date(e.startAt),r=new Intl.DateTimeFormat(`en-US`,{month:`short`,timeZone:t}).format(n),i=new Intl.DateTimeFormat(`en-US`,{day:`numeric`,timeZone:t}).format(n),s=c(e.startAt,t)===c(e.endAt,t)?l(e.endAt,t):`${c(e.endAt,t)} at ${l(e.endAt,t)}`,d=u(e.link);return a(`li`,{className:`lockerverse-public-events__item`,children:o(`article`,{className:`lockerverse-public-events__row`,children:[o(`div`,{"aria-hidden":`true`,className:`lockerverse-public-events__date`,children:[a(`span`,{className:`lockerverse-public-events__month`,children:r}),a(`span`,{className:`lockerverse-public-events__day`,children:i})]}),o(`div`,{className:`lockerverse-public-events__content`,children:[a(`h3`,{children:e.name}),o(`p`,{className:`lockerverse-public-events__time`,children:[o(`time`,{dateTime:e.startAt,children:[c(e.startAt,t),` at`,` `,l(e.startAt,t)]}),a(`span`,{"aria-hidden":`true`,children:` — `}),a(`time`,{dateTime:e.endAt,children:s})]}),e.location?a(`p`,{className:`lockerverse-public-events__place`,children:e.location}):null,e.description?a(`p`,{className:`lockerverse-public-events__description`,children:e.description}):null,d?o(`a`,{className:`lockerverse-public-events__link`,href:d,rel:`noopener noreferrer`,target:`_blank`,children:[`View event `,a(`span`,{"aria-hidden":`true`,children:`↗`})]}):null]})]})})}function f({events:e,title:t=`Events`,showHeading:n=!0,emptyMessage:r=`No events yet.`,timeZone:i=`America/New_York`,theme:s=`dark`,style:c,className:l}){return o(`section`,{"aria-busy":e.loading,"aria-label":t,className:[`lockerverse-public-events`,l].filter(Boolean).join(` `),"data-lockerverse-theme":s,style:c,children:[n?a(`h2`,{children:t}):null,e.loading&&!e.events?a(`p`,{role:`status`,children:`Loading events…`}):null,e.error?o(`div`,{role:`alert`,children:[a(`p`,{children:e.error.message}),a(`button`,{onClick:e.refresh,type:`button`,children:`Try again`})]}):null,e.events?.length===0?a(`p`,{className:`lockerverse-public-events__empty`,children:r}):null,e.events&&e.events.length>0?a(`ol`,{className:`lockerverse-public-events__list`,children:e.events.map(e=>a(d,{item:e,timeZone:i},e.id))}):null]})}function p(a){e(`public events`,{apiBaseUrl:a.apiBaseUrl,communitySlug:a.communitySlug,environment:a.environment,slug:``});let o=r(a.onError);o.current=a.onError;let[c]=i(()=>s({...a,onError:e=>o.current?.(e)})),[l,u]=i(0),[d,f]=i({error:null,events:null,loading:!0});n(()=>{let e=!0;return c.list().then(t=>{e&&f({error:null,events:t,loading:!1})},t=>{e&&f(e=>({...e,error:t,loading:!1}))}),()=>{e=!1}},[c,l]);let p=t(()=>{f(e=>({...e,error:null,loading:!0})),u(e=>e+1)},[]);return{...d,client:c,refresh:p}}export{f as LockerversePublicEvents,p as useLockerversePublicEvents};
|
|
2
2
|
//# sourceMappingURL=public-events.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-events.js","names":[],"sources":["../src/lockerverse-public-events.tsx","../src/use-lockerverse-public-events.ts"],"sourcesContent":["import type { LockerversePublicEvent } from \"@lockerverse/sdk/public-events\";\nimport type { LockerverseStyle, LockerverseTheme } from \"./theme.ts\";\nimport type { UseLockerversePublicEventsResult } from \"./use-lockerverse-public-events.ts\";\n\nexport type LockerversePublicEventsProps = {\n events: UseLockerversePublicEventsResult;\n /** The visible heading. Defaults to Events. */\n title?: string;\n showHeading?: boolean;\n emptyMessage?: string;\n /** Used to show dates and times. Defaults to America/New_York. */\n timeZone?: string;\n theme?: LockerverseTheme;\n style?: LockerverseStyle;\n className?: string;\n};\n\nfunction formatDate(value: string, timeZone: string) {\n return new Intl.DateTimeFormat(\"en-US\", {\n day: \"numeric\",\n month: \"short\",\n timeZone,\n year: \"numeric\",\n }).format(new Date(value));\n}\n\nfunction formatTime(value: string, timeZone: string) {\n return new Intl.DateTimeFormat(\"en-US\", {\n hour: \"numeric\",\n minute: \"2-digit\",\n timeZone,\n timeZoneName: \"short\",\n }).format(new Date(value));\n}\n\nfunction getLink(value: string | null) {\n if (!value) {\n return null;\n }\n try {\n const url = new URL(value);\n return url.protocol === \"https:\" || url.protocol === \"http:\"\n ? url.toString()\n : null;\n } catch {\n return null;\n }\n}\n\nfunction PublicEventRow({\n item,\n timeZone,\n}: {\n item: LockerversePublicEvent;\n timeZone: string;\n}) {\n const start = new Date(item.startAt);\n const month = new Intl.DateTimeFormat(\"en-US\", {\n month: \"short\",\n timeZone,\n }).format(start);\n const day = new Intl.DateTimeFormat(\"en-US\", {\n day: \"numeric\",\n timeZone,\n }).format(start);\n const sameDay =\n formatDate(item.startAt, timeZone) === formatDate(item.endAt, timeZone);\n const endLabel = sameDay\n ? formatTime(item.endAt, timeZone)\n : `${formatDate(item.endAt, timeZone)} at ${formatTime(item.endAt, timeZone)}`;\n const link = getLink(item.link);\n\n return (\n <li className=\"lockerverse-public-events__item\">\n <article className=\"lockerverse-public-events__row\">\n <div aria-hidden=\"true\" className=\"lockerverse-public-events__date\">\n <span className=\"lockerverse-public-events__month\">{month}</span>\n <span className=\"lockerverse-public-events__day\">{day}</span>\n </div>\n <div className=\"lockerverse-public-events__content\">\n <h3>{item.name}</h3>\n <p className=\"lockerverse-public-events__time\">\n <time dateTime={item.startAt}>\n {formatDate(item.startAt, timeZone)} at{\" \"}\n {formatTime(item.startAt, timeZone)}\n </time>\n <span aria-hidden=\"true\"> — </span>\n <time dateTime={item.endAt}>{endLabel}</time>\n </p>\n {item.location ? (\n <p className=\"lockerverse-public-events__place\">{item.location}</p>\n ) : null}\n {item.description ? (\n <p className=\"lockerverse-public-events__description\">\n {item.description}\n </p>\n ) : null}\n {link ? (\n <a href={link} rel=\"noopener noreferrer\" target=\"_blank\">\n Event details <span aria-hidden=\"true\">↗</span>\n </a>\n ) : null}\n </div>\n </article>\n </li>\n );\n}\n\n/** Optional public list that can be embedded in any React site. */\nexport function LockerversePublicEvents({\n events,\n title = \"Events\",\n showHeading = true,\n emptyMessage = \"No events yet.\",\n timeZone = \"America/New_York\",\n theme = \"dark\",\n style,\n className,\n}: LockerversePublicEventsProps) {\n return (\n <section\n aria-busy={events.loading}\n aria-label={title}\n className={[\"lockerverse-public-events\", className]\n .filter(Boolean)\n .join(\" \")}\n data-lockerverse-theme={theme}\n style={style}\n >\n {showHeading ? <h2>{title}</h2> : null}\n {events.loading && !events.events ? (\n <p role=\"status\">Loading events…</p>\n ) : null}\n {events.error ? (\n <div role=\"alert\">\n <p>{events.error.message}</p>\n <button onClick={events.refresh} type=\"button\">\n Try again\n </button>\n </div>\n ) : null}\n {events.events?.length === 0 ? (\n <p className=\"lockerverse-public-events__empty\">{emptyMessage}</p>\n ) : null}\n {events.events && events.events.length > 0 ? (\n <ol className=\"lockerverse-public-events__list\">\n {events.events.map((item) => (\n <PublicEventRow item={item} key={item.id} timeZone={timeZone} />\n ))}\n </ol>\n ) : null}\n </section>\n );\n}\n","import {\n type CreateLockerversePublicEventsOptions,\n createLockerversePublicEventsClient,\n type LockerversePublicEvent,\n type LockerversePublicEventsClient,\n type LockerverseSdkError,\n} from \"@lockerverse/sdk/public-events\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useImmutableResourceIdentity } from \"./immutable-resource-identity.ts\";\n\nexport type UseLockerversePublicEventsResult = {\n client: LockerversePublicEventsClient;\n events: LockerversePublicEvent[] | null;\n loading: boolean;\n error: LockerverseSdkError | null;\n refresh: () => void;\n};\n\n/** Load the public events list for one community. */\nexport function useLockerversePublicEvents(\n options: CreateLockerversePublicEventsOptions\n): UseLockerversePublicEventsResult {\n useImmutableResourceIdentity(\"public events\", {\n apiBaseUrl: options.apiBaseUrl,\n communitySlug: options.communitySlug,\n environment: options.environment,\n slug: \"\",\n });\n const onErrorRef = useRef(options.onError);\n onErrorRef.current = options.onError;\n const [client] = useState(() =>\n createLockerversePublicEventsClient({\n ...options,\n onError: (error) => onErrorRef.current?.(error),\n })\n );\n const [revision, setRevision] = useState(0);\n const [state, setState] = useState<\n Pick<UseLockerversePublicEventsResult, \"events\" | \"loading\" | \"error\">\n >({ error: null, events: null, loading: true });\n\n useEffect(() => {\n let active = true;\n client.list().then(\n (events) => {\n if (active) {\n setState({ error: null, events, loading: false });\n }\n },\n (error: LockerverseSdkError) => {\n if (active) {\n setState((current) => ({ ...current, error, loading: false }));\n }\n }\n );\n return () => {\n active = false;\n };\n }, [client, revision]);\n\n const refresh = useCallback(() => {\n setState((current) => ({ ...current, error: null, loading: true }));\n setRevision((current) => current + 1);\n }, []);\n\n return { ...state, client, refresh };\n}\n"],"mappings":"yQAiBA,SAAS,EAAW,EAAe,EAAkB,CACnD,OAAO,IAAI,KAAK,eAAe,QAAS,CACtC,IAAK,UACL,MAAO,QACP,WACA,KAAM,SACR,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK,CAAK,CAAC,CAC3B,CAEA,SAAS,EAAW,EAAe,EAAkB,CACnD,OAAO,IAAI,KAAK,eAAe,QAAS,CACtC,KAAM,UACN,OAAQ,UACR,WACA,aAAc,OAChB,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK,CAAK,CAAC,CAC3B,CAEA,SAAS,EAAQ,EAAsB,CACrC,GAAI,CAAC,EACH,OAAO,KAET,GAAI,CACF,IAAM,EAAM,IAAI,IAAI,CAAK,EACzB,OAAO,EAAI,WAAa,UAAY,EAAI,WAAa,QACjD,EAAI,SAAS,EACb,IACN,MAAQ,CACN,OAAO,IACT,CACF,CAEA,SAAS,EAAe,CACtB,OACA,YAIC,CACD,IAAM,EAAQ,IAAI,KAAK,EAAK,OAAO,EAC7B,EAAQ,IAAI,KAAK,eAAe,QAAS,CAC7C,MAAO,QACP,UACF,CAAC,CAAC,CAAC,OAAO,CAAK,EACT,EAAM,IAAI,KAAK,eAAe,QAAS,CAC3C,IAAK,UACL,UACF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C,CAAC,EAAO,GAAY,EAExB,CAAE,MAAO,KAAM,OAAQ,KAAM,QAAS,EAAK,CAAC,EAE9C,MAAgB,CACd,IAAI,EAAS,GAab,OAZA,EAAO,KAAK,CAAC,CAAC,KACX,GAAW,CACN,GACF,EAAS,CAAE,MAAO,KAAM,SAAQ,QAAS,EAAM,CAAC,CAEpD,EACC,GAA+B,CAC1B,GACF,EAAU,IAAa,CAAE,GAAG,EAAS,QAAO,QAAS,EAAM,EAAE,CAEjE,CACF,MACa,CACX,EAAS,EACX,CACF,EAAG,CAAC,EAAQ,CAAQ,CAAC,EAErB,IAAM,EAAU,MAAkB,CAChC,EAAU,IAAa,CAAE,GAAG,EAAS,MAAO,KAAM,QAAS,EAAK,EAAE,EAClE,EAAa,GAAY,EAAU,CAAC,CACtC,EAAG,CAAC,CAAC,EAEL,MAAO,CAAE,GAAG,EAAO,SAAQ,SAAQ,CACrC"}
|
|
1
|
+
{"version":3,"file":"public-events.js","names":[],"sources":["../src/lockerverse-public-events.tsx","../src/use-lockerverse-public-events.ts"],"sourcesContent":["import type { LockerversePublicEvent } from \"@lockerverse/sdk/public-events\";\nimport type { LockerverseStyle, LockerverseTheme } from \"./theme.ts\";\nimport type { UseLockerversePublicEventsResult } from \"./use-lockerverse-public-events.ts\";\n\nexport type LockerversePublicEventsProps = {\n events: UseLockerversePublicEventsResult;\n /** The visible heading. Defaults to Events. */\n title?: string;\n showHeading?: boolean;\n emptyMessage?: string;\n /** Used to show dates and times. Defaults to America/New_York. */\n timeZone?: string;\n theme?: LockerverseTheme;\n style?: LockerverseStyle;\n className?: string;\n};\n\nfunction formatDate(value: string, timeZone: string) {\n return new Intl.DateTimeFormat(\"en-US\", {\n day: \"numeric\",\n month: \"short\",\n timeZone,\n year: \"numeric\",\n }).format(new Date(value));\n}\n\nfunction formatTime(value: string, timeZone: string) {\n return new Intl.DateTimeFormat(\"en-US\", {\n hour: \"numeric\",\n minute: \"2-digit\",\n timeZone,\n timeZoneName: \"short\",\n }).format(new Date(value));\n}\n\nfunction getLink(value: string | null) {\n if (!value) {\n return null;\n }\n try {\n const url = new URL(value);\n return url.protocol === \"https:\" || url.protocol === \"http:\"\n ? url.toString()\n : null;\n } catch {\n return null;\n }\n}\n\nfunction PublicEventRow({\n item,\n timeZone,\n}: {\n item: LockerversePublicEvent;\n timeZone: string;\n}) {\n const start = new Date(item.startAt);\n const month = new Intl.DateTimeFormat(\"en-US\", {\n month: \"short\",\n timeZone,\n }).format(start);\n const day = new Intl.DateTimeFormat(\"en-US\", {\n day: \"numeric\",\n timeZone,\n }).format(start);\n const sameDay =\n formatDate(item.startAt, timeZone) === formatDate(item.endAt, timeZone);\n const endLabel = sameDay\n ? formatTime(item.endAt, timeZone)\n : `${formatDate(item.endAt, timeZone)} at ${formatTime(item.endAt, timeZone)}`;\n const link = getLink(item.link);\n\n return (\n <li className=\"lockerverse-public-events__item\">\n <article className=\"lockerverse-public-events__row\">\n <div aria-hidden=\"true\" className=\"lockerverse-public-events__date\">\n <span className=\"lockerverse-public-events__month\">{month}</span>\n <span className=\"lockerverse-public-events__day\">{day}</span>\n </div>\n <div className=\"lockerverse-public-events__content\">\n <h3>{item.name}</h3>\n <p className=\"lockerverse-public-events__time\">\n <time dateTime={item.startAt}>\n {formatDate(item.startAt, timeZone)} at{\" \"}\n {formatTime(item.startAt, timeZone)}\n </time>\n <span aria-hidden=\"true\"> — </span>\n <time dateTime={item.endAt}>{endLabel}</time>\n </p>\n {item.location ? (\n <p className=\"lockerverse-public-events__place\">{item.location}</p>\n ) : null}\n {item.description ? (\n <p className=\"lockerverse-public-events__description\">\n {item.description}\n </p>\n ) : null}\n {link ? (\n <a\n className=\"lockerverse-public-events__link\"\n href={link}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n >\n View event <span aria-hidden=\"true\">↗</span>\n </a>\n ) : null}\n </div>\n </article>\n </li>\n );\n}\n\n/** Optional public list that can be embedded in any React site. */\nexport function LockerversePublicEvents({\n events,\n title = \"Events\",\n showHeading = true,\n emptyMessage = \"No events yet.\",\n timeZone = \"America/New_York\",\n theme = \"dark\",\n style,\n className,\n}: LockerversePublicEventsProps) {\n return (\n <section\n aria-busy={events.loading}\n aria-label={title}\n className={[\"lockerverse-public-events\", className]\n .filter(Boolean)\n .join(\" \")}\n data-lockerverse-theme={theme}\n style={style}\n >\n {showHeading ? <h2>{title}</h2> : null}\n {events.loading && !events.events ? (\n <p role=\"status\">Loading events…</p>\n ) : null}\n {events.error ? (\n <div role=\"alert\">\n <p>{events.error.message}</p>\n <button onClick={events.refresh} type=\"button\">\n Try again\n </button>\n </div>\n ) : null}\n {events.events?.length === 0 ? (\n <p className=\"lockerverse-public-events__empty\">{emptyMessage}</p>\n ) : null}\n {events.events && events.events.length > 0 ? (\n <ol className=\"lockerverse-public-events__list\">\n {events.events.map((item) => (\n <PublicEventRow item={item} key={item.id} timeZone={timeZone} />\n ))}\n </ol>\n ) : null}\n </section>\n );\n}\n","import {\n type CreateLockerversePublicEventsOptions,\n createLockerversePublicEventsClient,\n type LockerversePublicEvent,\n type LockerversePublicEventsClient,\n type LockerverseSdkError,\n} from \"@lockerverse/sdk/public-events\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useImmutableResourceIdentity } from \"./immutable-resource-identity.ts\";\n\nexport type UseLockerversePublicEventsResult = {\n client: LockerversePublicEventsClient;\n events: LockerversePublicEvent[] | null;\n loading: boolean;\n error: LockerverseSdkError | null;\n refresh: () => void;\n};\n\n/** Load the public events list for one community. */\nexport function useLockerversePublicEvents(\n options: CreateLockerversePublicEventsOptions\n): UseLockerversePublicEventsResult {\n useImmutableResourceIdentity(\"public events\", {\n apiBaseUrl: options.apiBaseUrl,\n communitySlug: options.communitySlug,\n environment: options.environment,\n slug: \"\",\n });\n const onErrorRef = useRef(options.onError);\n onErrorRef.current = options.onError;\n const [client] = useState(() =>\n createLockerversePublicEventsClient({\n ...options,\n onError: (error) => onErrorRef.current?.(error),\n })\n );\n const [revision, setRevision] = useState(0);\n const [state, setState] = useState<\n Pick<UseLockerversePublicEventsResult, \"events\" | \"loading\" | \"error\">\n >({ error: null, events: null, loading: true });\n\n useEffect(() => {\n let active = true;\n client.list().then(\n (events) => {\n if (active) {\n setState({ error: null, events, loading: false });\n }\n },\n (error: LockerverseSdkError) => {\n if (active) {\n setState((current) => ({ ...current, error, loading: false }));\n }\n }\n );\n return () => {\n active = false;\n };\n }, [client, revision]);\n\n const refresh = useCallback(() => {\n setState((current) => ({ ...current, error: null, loading: true }));\n setRevision((current) => current + 1);\n }, []);\n\n return { ...state, client, refresh };\n}\n"],"mappings":"yQAiBA,SAAS,EAAW,EAAe,EAAkB,CACnD,OAAO,IAAI,KAAK,eAAe,QAAS,CACtC,IAAK,UACL,MAAO,QACP,WACA,KAAM,SACR,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK,CAAK,CAAC,CAC3B,CAEA,SAAS,EAAW,EAAe,EAAkB,CACnD,OAAO,IAAI,KAAK,eAAe,QAAS,CACtC,KAAM,UACN,OAAQ,UACR,WACA,aAAc,OAChB,CAAC,CAAC,CAAC,OAAO,IAAI,KAAK,CAAK,CAAC,CAC3B,CAEA,SAAS,EAAQ,EAAsB,CACrC,GAAI,CAAC,EACH,OAAO,KAET,GAAI,CACF,IAAM,EAAM,IAAI,IAAI,CAAK,EACzB,OAAO,EAAI,WAAa,UAAY,EAAI,WAAa,QACjD,EAAI,SAAS,EACb,IACN,MAAQ,CACN,OAAO,IACT,CACF,CAEA,SAAS,EAAe,CACtB,OACA,YAIC,CACD,IAAM,EAAQ,IAAI,KAAK,EAAK,OAAO,EAC7B,EAAQ,IAAI,KAAK,eAAe,QAAS,CAC7C,MAAO,QACP,UACF,CAAC,CAAC,CAAC,OAAO,CAAK,EACT,EAAM,IAAI,KAAK,eAAe,QAAS,CAC3C,IAAK,UACL,UACF,CAAC,CAAC,CAAC,OAAO,CAAK,EAGT,EADJ,EAAW,EAAK,QAAS,CAAQ,IAAM,EAAW,EAAK,MAAO,CAAQ,EAEpE,E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S,GAab,OAZA,EAAO,KAAK,CAAC,CAAC,KACX,GAAW,CACN,GACF,EAAS,CAAE,MAAO,KAAM,SAAQ,QAAS,EAAM,CAAC,CAEpD,EACC,GAA+B,CAC1B,GACF,EAAU,IAAa,CAAE,GAAG,EAAS,QAAO,QAAS,EAAM,EAAE,CAEjE,CACF,MACa,CACX,EAAS,EACX,CACF,EAAG,CAAC,EAAQ,CAAQ,CAAC,EAErB,IAAM,EAAU,MAAkB,CAChC,EAAU,IAAa,CAAE,GAAG,EAAS,MAAO,KAAM,QAAS,EAAK,EAAE,EAClE,EAAa,GAAY,EAAU,CAAC,CACtC,EAAG,CAAC,CAAC,EAEL,MAAO,CAAE,GAAG,EAAO,SAAQ,SAAQ,CACrC"}
|
package/dist/signup.css
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
font-size: 15px;
|
|
39
39
|
line-height: 1.4;
|
|
40
40
|
color: var(--lockerverse-text);
|
|
41
|
-
background:
|
|
41
|
+
background: transparent;
|
|
42
42
|
border-radius: var(--lockerverse-radius);
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
);
|
|
55
55
|
--lockerverse-subtle: var(--lockerverse-signup-subtle, rgb(18 20 22 / 8%));
|
|
56
56
|
--lockerverse-text: var(--lockerverse-signup-text, #121416);
|
|
57
|
-
box-shadow: 0 18px 55px rgb(20 25 32 / 10%);
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
.lockerverse-signup *,
|
package/dist/styles.css
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
font-size: 15px;
|
|
27
27
|
line-height: 1.4;
|
|
28
28
|
color: var(--lockerverse-text);
|
|
29
|
-
background:
|
|
29
|
+
background: transparent;
|
|
30
30
|
border-radius: var(--lockerverse-radius);
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
--lockerverse-subtle: rgb(18 20 22 / 8%);
|
|
42
42
|
--lockerverse-success: #157a42;
|
|
43
43
|
--lockerverse-text: #121416;
|
|
44
|
-
box-shadow: 0 18px 55px rgb(20 25 32 / 10%);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
.lockerverse-payment *,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lockerverse/react",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.108-dev.1",
|
|
4
4
|
"description": "Tree-shakable React payment and signup UI for Lockerverse",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"embla-carousel-react": "8.6.0",
|
|
118
118
|
"lucide-react": "0.536.0",
|
|
119
119
|
"valibot": "1.4.2",
|
|
120
|
-
"@lockerverse/sdk": "0.2.
|
|
120
|
+
"@lockerverse/sdk": "0.2.108-dev.1"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@size-limit/file": "13.0.3",
|