@skdx/react-blocks 0.38.0 → 0.39.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,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var h=Object.create;var u=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)u(t,r,{get:e[r],enumerable:!0})},x=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N(e))!$.call(t,o)&&o!==r&&u(t,o,{get:()=>e[o],enumerable:!(s=v(e,o))||s.enumerable});return t};var E=(t,e,r)=>(r=t!=null?h(T(t)):{},x(e||!t||!t.__esModule?u(r,"default",{value:t,enumerable:!0}):r,t)),H=t=>x(u({},"__esModule",{value:!0}),t);var q={};D(q,{ForgotPasswordPage:()=>m});module.exports=H(q);var a=require("@skdx/react"),w=require("@skdx/react/primitives/text-field");var A=E(require("react"),1),f=require("@skdx/react"),d=require("react/jsx-runtime"),g=({parts:t,title:e,error:r,footer:s,children:o,...l})=>{let p=A.useId();return(0,d.jsx)("section",{"aria-labelledby":p,...l,...t.root,children:(0,d.jsxs)("div",{...t.panel,children:[(0,d.jsx)(f.Heading,{as:"h1",id:p,...t.title,children:e}),r?(0,d.jsx)(f.Alert,{status:"danger",...t.error,children:r}):null,o,s&&t.footer?(0,d.jsx)("div",{...t.footer,children:s}):null]})})};g.displayName="AuthPanel";function b(t,e){let r=t.get(e);return typeof r=="string"?r:""}function I(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function i(t,e,r){let s=e==="root",o=s?`skdx-${t}`:`skdx-${t}__${e}`,l={className:I(o,r),"data-part":e};return s&&(l["data-skdx-component"]=t),l}var n=require("react/jsx-runtime"),m=({title:t="Reset your password",description:e,error:r,success:s,pending:o=!1,emailLabel:l="Email",submitLabel:p="Send reset link",footer:F,onRequestReset:k,children:y,...P})=>{let R=c=>{c.preventDefault();let S=new FormData(c.currentTarget);k?.({email:b(S,"email")})};return(0,n.jsxs)(g,{...P,parts:{root:i("forgot-password-page","root",P.className),panel:i("forgot-password-page","panel"),title:i("forgot-password-page","title"),error:i("forgot-password-page","error"),footer:i("forgot-password-page","footer")},title:t,error:r,footer:F,children:[e?(0,n.jsx)(a.Text,{as:"p",tone:"muted",...i("forgot-password-page","description"),children:e}):null,s?(0,n.jsx)(a.Alert,{status:"success",...i("forgot-password-page","success"),children:s}):(0,n.jsxs)(a.Form,{onSubmit:R,...i("forgot-password-page","form"),children:[(0,n.jsx)(a.Field,{label:l,required:!0,...i("forgot-password-page","field"),children:(0,n.jsx)(a.TextField,{name:"email",required:!0,children:(0,n.jsx)(w.TextFieldInput,{type:"email",autoComplete:"email"})})}),y,(0,n.jsx)(a.Button,{type:"submit",loading:o,disabled:o,...i("forgot-password-page","submit"),children:p})]})]})};m.displayName="ForgotPasswordPage";0&&(module.exports={ForgotPasswordPage});
2
+ "use strict";var h=Object.create;var u=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)u(t,r,{get:e[r],enumerable:!0})},x=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N(e))!$.call(t,o)&&o!==r&&u(t,o,{get:()=>e[o],enumerable:!(s=v(e,o))||s.enumerable});return t};var E=(t,e,r)=>(r=t!=null?h(T(t)):{},x(e||!t||!t.__esModule?u(r,"default",{value:t,enumerable:!0}):r,t)),H=t=>x(u({},"__esModule",{value:!0}),t);var q={};D(q,{ForgotPasswordPage:()=>m});module.exports=H(q);var a=require("@skdx/react"),w=require("@skdx/react/primitives/text-field");var A=E(require("react"),1),f=require("@skdx/react"),d=require("react/jsx-runtime"),g=({parts:t,title:e,error:r,footer:s,children:o,...l})=>{let p=A.useId();return(0,d.jsx)("section",{"aria-labelledby":p,...l,...t.root,children:(0,d.jsxs)("div",{...t.panel,children:[(0,d.jsx)(f.Heading,{as:"h1",id:p,...t.title,children:e}),r?(0,d.jsx)(f.Alert,{role:"alert",status:"danger",...t.error,children:r}):null,o,s&&t.footer?(0,d.jsx)("div",{...t.footer,children:s}):null]})})};g.displayName="AuthPanel";function b(t,e){let r=t.get(e);return typeof r=="string"?r:""}function I(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function i(t,e,r){let s=e==="root",o=s?`skdx-${t}`:`skdx-${t}__${e}`,l={className:I(o,r),"data-part":e};return s&&(l["data-skdx-component"]=t),l}var n=require("react/jsx-runtime"),m=({title:t="Reset your password",description:e,error:r,success:s,pending:o=!1,emailLabel:l="Email",submitLabel:p="Send reset link",footer:F,onRequestReset:k,children:y,...P})=>{let R=c=>{c.preventDefault();let S=new FormData(c.currentTarget);k?.({email:b(S,"email")})};return(0,n.jsxs)(g,{...P,parts:{root:i("forgot-password-page","root",P.className),panel:i("forgot-password-page","panel"),title:i("forgot-password-page","title"),error:i("forgot-password-page","error"),footer:i("forgot-password-page","footer")},title:t,error:r,footer:F,children:[e?(0,n.jsx)(a.Text,{as:"p",tone:"muted",...i("forgot-password-page","description"),children:e}):null,s?(0,n.jsx)(a.Alert,{status:"success",...i("forgot-password-page","success"),children:s}):(0,n.jsxs)(a.Form,{onSubmit:R,...i("forgot-password-page","form"),children:[(0,n.jsx)(a.Field,{label:l,required:!0,...i("forgot-password-page","field"),children:(0,n.jsx)(a.TextField,{name:"email",required:!0,children:(0,n.jsx)(w.TextFieldInput,{type:"email",autoComplete:"email"})})}),y,(0,n.jsx)(a.Button,{type:"submit",loading:o,disabled:o,...i("forgot-password-page","submit"),children:p})]})]})};m.displayName="ForgotPasswordPage";0&&(module.exports={ForgotPasswordPage});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{Alert as h,Button as v,Field as N,Form as T,Text as $,TextField as D}from"@skdx/react";import{TextFieldInput as E}from"@skdx/react/primitives/text-field";import*as g from"react";import{Alert as k,Heading as y}from"@skdx/react";import{jsx as l,jsxs as R}from"react/jsx-runtime";var p=({parts:t,title:e,error:r,footer:a,children:s,...i})=>{let d=g.useId();return l("section",{"aria-labelledby":d,...i,...t.root,children:R("div",{...t.panel,children:[l(y,{as:"h1",id:d,...t.title,children:e}),r?l(k,{status:"danger",...t.error,children:r}):null,s,a&&t.footer?l("div",{...t.footer,children:a}):null]})})};p.displayName="AuthPanel";function m(t,e){let r=t.get(e);return typeof r=="string"?r:""}function S(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function o(t,e,r){let a=e==="root",s=a?`skdx-${t}`:`skdx-${t}__${e}`,i={className:S(s,r),"data-part":e};return a&&(i["data-skdx-component"]=t),i}import{jsx as n,jsxs as P}from"react/jsx-runtime";var c=({title:t="Reset your password",description:e,error:r,success:a,pending:s=!1,emailLabel:i="Email",submitLabel:d="Send reset link",footer:x,onRequestReset:A,children:b,...u})=>{let w=f=>{f.preventDefault();let F=new FormData(f.currentTarget);A?.({email:m(F,"email")})};return P(p,{...u,parts:{root:o("forgot-password-page","root",u.className),panel:o("forgot-password-page","panel"),title:o("forgot-password-page","title"),error:o("forgot-password-page","error"),footer:o("forgot-password-page","footer")},title:t,error:r,footer:x,children:[e?n($,{as:"p",tone:"muted",...o("forgot-password-page","description"),children:e}):null,a?n(h,{status:"success",...o("forgot-password-page","success"),children:a}):P(T,{onSubmit:w,...o("forgot-password-page","form"),children:[n(N,{label:i,required:!0,...o("forgot-password-page","field"),children:n(D,{name:"email",required:!0,children:n(E,{type:"email",autoComplete:"email"})})}),b,n(v,{type:"submit",loading:s,disabled:s,...o("forgot-password-page","submit"),children:d})]})]})};c.displayName="ForgotPasswordPage";export{c as ForgotPasswordPage};
2
+ import{Alert as h,Button as v,Field as N,Form as T,Text as $,TextField as D}from"@skdx/react";import{TextFieldInput as E}from"@skdx/react/primitives/text-field";import*as g from"react";import{Alert as k,Heading as y}from"@skdx/react";import{jsx as l,jsxs as R}from"react/jsx-runtime";var p=({parts:t,title:e,error:r,footer:a,children:s,...i})=>{let d=g.useId();return l("section",{"aria-labelledby":d,...i,...t.root,children:R("div",{...t.panel,children:[l(y,{as:"h1",id:d,...t.title,children:e}),r?l(k,{role:"alert",status:"danger",...t.error,children:r}):null,s,a&&t.footer?l("div",{...t.footer,children:a}):null]})})};p.displayName="AuthPanel";function m(t,e){let r=t.get(e);return typeof r=="string"?r:""}function S(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function o(t,e,r){let a=e==="root",s=a?`skdx-${t}`:`skdx-${t}__${e}`,i={className:S(s,r),"data-part":e};return a&&(i["data-skdx-component"]=t),i}import{jsx as n,jsxs as P}from"react/jsx-runtime";var c=({title:t="Reset your password",description:e,error:r,success:a,pending:s=!1,emailLabel:i="Email",submitLabel:d="Send reset link",footer:x,onRequestReset:A,children:b,...u})=>{let w=f=>{f.preventDefault();let F=new FormData(f.currentTarget);A?.({email:m(F,"email")})};return P(p,{...u,parts:{root:o("forgot-password-page","root",u.className),panel:o("forgot-password-page","panel"),title:o("forgot-password-page","title"),error:o("forgot-password-page","error"),footer:o("forgot-password-page","footer")},title:t,error:r,footer:x,children:[e?n($,{as:"p",tone:"muted",...o("forgot-password-page","description"),children:e}):null,a?n(h,{status:"success",...o("forgot-password-page","success"),children:a}):P(T,{onSubmit:w,...o("forgot-password-page","form"),children:[n(N,{label:i,required:!0,...o("forgot-password-page","field"),children:n(D,{name:"email",required:!0,children:n(E,{type:"email",autoComplete:"email"})})}),b,n(v,{type:"submit",loading:s,disabled:s,...o("forgot-password-page","submit"),children:d})]})]})};c.displayName="ForgotPasswordPage";export{c as ForgotPasswordPage};
@@ -39,7 +39,11 @@ export interface PageContainerProps extends React.ComponentPropsWithRef<'section
39
39
  */
40
40
  actionsLabel?: string | undefined;
41
41
  /**
42
- * Controls rendered inside the derived Toolbar beside the page heading.
42
+ * Controls rendered inside the derived Toolbar beside the page heading. Pass
43
+ * toolbar parts — `ToolbarButton`, `ToolbarLink`, `ToolbarToggleGroup`,
44
+ * `ToolbarSeparator` from `@skdx/react/primitives/toolbar`; anything else stays
45
+ * its own Tab stop and the arrow keys skip it, since only a toolbar part joins
46
+ * the roving tabindex.
43
47
  * @default undefined — no toolbar renders.
44
48
  */
45
49
  actions?: React.ReactNode | undefined;
@@ -39,7 +39,11 @@ export interface PageContainerProps extends React.ComponentPropsWithRef<'section
39
39
  */
40
40
  actionsLabel?: string | undefined;
41
41
  /**
42
- * Controls rendered inside the derived Toolbar beside the page heading.
42
+ * Controls rendered inside the derived Toolbar beside the page heading. Pass
43
+ * toolbar parts — `ToolbarButton`, `ToolbarLink`, `ToolbarToggleGroup`,
44
+ * `ToolbarSeparator` from `@skdx/react/primitives/toolbar`; anything else stays
45
+ * its own Tab stop and the arrow keys skip it, since only a toolbar part joins
46
+ * the roving tabindex.
43
47
  * @default undefined — no toolbar renders.
44
48
  */
45
49
  actions?: React.ReactNode | undefined;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var M=Object.create;var c=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},h=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of D(t))!$.call(e,d)&&d!==r&&c(e,d,{get:()=>t[d],enumerable:!(n=T(t,d))||n.enumerable});return e};var L=(e,t,r)=>(r=e!=null?M(V(e)):{},h(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e)),_=e=>h(c({},"__esModule",{value:!0}),e);var U={};q(U,{ResetPasswordPage:()=>R});module.exports=_(U);var a=require("@skdx/react"),u=require("@skdx/react/primitives/password-input");var k=L(require("react"),1),P=require("@skdx/react"),p=require("react/jsx-runtime"),w=({parts:e,title:t,error:r,footer:n,children:d,...i})=>{let m=k.useId();return(0,p.jsx)("section",{"aria-labelledby":m,...i,...e.root,children:(0,p.jsxs)("div",{...e.panel,children:[(0,p.jsx)(P.Heading,{as:"h1",id:m,...e.title,children:t}),r?(0,p.jsx)(P.Alert,{status:"danger",...e.error,children:r}):null,d,n&&e.footer?(0,p.jsx)("div",{...e.footer,children:n}):null]})})};w.displayName="AuthPanel";function y(e,t){let r=e.get(t);return typeof r=="string"?r:""}function B(...e){let t="";for(let r of e)r&&(t=t?`${t} ${r}`:r);return t}function o(e,t,r){let n=t==="root",d=n?`skdx-${e}`:`skdx-${e}__${t}`,i={className:B(d,r),"data-part":t};return n&&(i["data-skdx-component"]=e),i}var s=require("react/jsx-runtime"),x="confirmPassword";function O(e){let t=e.elements.namedItem(x);return t instanceof HTMLInputElement?t:null}var R=({title:e="Choose a new password",error:t,success:r,pending:n=!1,passwordLabel:d="New password",confirmPasswordLabel:i,requirements:m,passwordMismatchMessage:v="Passwords do not match",submitLabel:F="Update password",footer:I,onResetPassword:S,children:C,...A})=>{let N=f=>{f.preventDefault();let l=f.currentTarget,H=new FormData(l),b={password:y(H,"password")},g=i===void 0?null:O(l);if(g&&g.value!==b.password){g.setCustomValidity(v),l.reportValidity();return}S?.(b)},E=f=>{let l=f.target;l instanceof HTMLInputElement&&l.name===x&&l.setCustomValidity("")};return(0,s.jsx)(w,{...A,parts:{root:o("reset-password-page","root",A.className),panel:o("reset-password-page","panel"),title:o("reset-password-page","title"),error:o("reset-password-page","error"),footer:o("reset-password-page","footer")},title:e,error:t,footer:I,children:r?(0,s.jsx)(a.Alert,{status:"success",...o("reset-password-page","success"),children:r}):(0,s.jsxs)(a.Form,{onSubmit:N,onChange:E,...o("reset-password-page","form"),children:[(0,s.jsx)(a.Field,{label:d,required:!0,description:m===void 0?void 0:(0,s.jsx)("span",{...o("reset-password-page","requirements"),children:m}),...o("reset-password-page","field"),children:(0,s.jsxs)(a.PasswordInput,{name:"password",required:!0,children:[(0,s.jsx)(u.PasswordInputField,{autoComplete:"new-password"}),(0,s.jsx)(u.PasswordInputToggle,{})]})}),i!==void 0?(0,s.jsx)(a.Field,{label:i,required:!0,...o("reset-password-page","field"),children:(0,s.jsxs)(a.PasswordInput,{name:x,required:!0,children:[(0,s.jsx)(u.PasswordInputField,{autoComplete:"new-password"}),(0,s.jsx)(u.PasswordInputToggle,{})]})}):null,C,(0,s.jsx)(a.Button,{type:"submit",loading:n,disabled:n,...o("reset-password-page","submit"),children:F})]})})};R.displayName="ResetPasswordPage";0&&(module.exports={ResetPasswordPage});
2
+ "use strict";var M=Object.create;var c=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var q=(e,t)=>{for(var r in t)c(e,r,{get:t[r],enumerable:!0})},h=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of D(t))!$.call(e,d)&&d!==r&&c(e,d,{get:()=>t[d],enumerable:!(n=T(t,d))||n.enumerable});return e};var L=(e,t,r)=>(r=e!=null?M(V(e)):{},h(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e)),_=e=>h(c({},"__esModule",{value:!0}),e);var U={};q(U,{ResetPasswordPage:()=>R});module.exports=_(U);var a=require("@skdx/react"),u=require("@skdx/react/primitives/password-input");var k=L(require("react"),1),P=require("@skdx/react"),p=require("react/jsx-runtime"),w=({parts:e,title:t,error:r,footer:n,children:d,...i})=>{let m=k.useId();return(0,p.jsx)("section",{"aria-labelledby":m,...i,...e.root,children:(0,p.jsxs)("div",{...e.panel,children:[(0,p.jsx)(P.Heading,{as:"h1",id:m,...e.title,children:t}),r?(0,p.jsx)(P.Alert,{role:"alert",status:"danger",...e.error,children:r}):null,d,n&&e.footer?(0,p.jsx)("div",{...e.footer,children:n}):null]})})};w.displayName="AuthPanel";function y(e,t){let r=e.get(t);return typeof r=="string"?r:""}function B(...e){let t="";for(let r of e)r&&(t=t?`${t} ${r}`:r);return t}function o(e,t,r){let n=t==="root",d=n?`skdx-${e}`:`skdx-${e}__${t}`,i={className:B(d,r),"data-part":t};return n&&(i["data-skdx-component"]=e),i}var s=require("react/jsx-runtime"),x="confirmPassword";function O(e){let t=e.elements.namedItem(x);return t instanceof HTMLInputElement?t:null}var R=({title:e="Choose a new password",error:t,success:r,pending:n=!1,passwordLabel:d="New password",confirmPasswordLabel:i,requirements:m,passwordMismatchMessage:v="Passwords do not match",submitLabel:F="Update password",footer:I,onResetPassword:S,children:C,...A})=>{let N=f=>{f.preventDefault();let l=f.currentTarget,H=new FormData(l),b={password:y(H,"password")},g=i===void 0?null:O(l);if(g&&g.value!==b.password){g.setCustomValidity(v),l.reportValidity();return}S?.(b)},E=f=>{let l=f.target;l instanceof HTMLInputElement&&l.name===x&&l.setCustomValidity("")};return(0,s.jsx)(w,{...A,parts:{root:o("reset-password-page","root",A.className),panel:o("reset-password-page","panel"),title:o("reset-password-page","title"),error:o("reset-password-page","error"),footer:o("reset-password-page","footer")},title:e,error:t,footer:I,children:r?(0,s.jsx)(a.Alert,{status:"success",...o("reset-password-page","success"),children:r}):(0,s.jsxs)(a.Form,{onSubmit:N,onChange:E,...o("reset-password-page","form"),children:[(0,s.jsx)(a.Field,{label:d,required:!0,description:m===void 0?void 0:(0,s.jsx)("span",{...o("reset-password-page","requirements"),children:m}),...o("reset-password-page","field"),children:(0,s.jsxs)(a.PasswordInput,{name:"password",required:!0,children:[(0,s.jsx)(u.PasswordInputField,{autoComplete:"new-password"}),(0,s.jsx)(u.PasswordInputToggle,{})]})}),i!==void 0?(0,s.jsx)(a.Field,{label:i,required:!0,...o("reset-password-page","field"),children:(0,s.jsxs)(a.PasswordInput,{name:x,required:!0,children:[(0,s.jsx)(u.PasswordInputField,{autoComplete:"new-password"}),(0,s.jsx)(u.PasswordInputToggle,{})]})}):null,C,(0,s.jsx)(a.Button,{type:"submit",loading:n,disabled:n,...o("reset-password-page","submit"),children:F})]})})};R.displayName="ResetPasswordPage";0&&(module.exports={ResetPasswordPage});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{Alert as $,Button as q,Field as A,Form as L,PasswordInput as b}from"@skdx/react";import{PasswordInputField as h,PasswordInputToggle as k}from"@skdx/react/primitives/password-input";import*as x from"react";import{Alert as M,Heading as T}from"@skdx/react";import{jsx as u,jsxs as D}from"react/jsx-runtime";var f=({parts:e,title:t,error:r,footer:a,children:i,...n})=>{let l=x.useId();return u("section",{"aria-labelledby":l,...n,...e.root,children:D("div",{...e.panel,children:[u(T,{as:"h1",id:l,...e.title,children:t}),r?u(M,{status:"danger",...e.error,children:r}):null,i,a&&e.footer?u("div",{...e.footer,children:a}):null]})})};f.displayName="AuthPanel";function R(e,t){let r=e.get(t);return typeof r=="string"?r:""}function V(...e){let t="";for(let r of e)r&&(t=t?`${t} ${r}`:r);return t}function s(e,t,r){let a=t==="root",i=a?`skdx-${e}`:`skdx-${e}__${t}`,n={className:V(i,r),"data-part":t};return a&&(n["data-skdx-component"]=e),n}import{jsx as o,jsxs as c}from"react/jsx-runtime";var P="confirmPassword";function _(e){let t=e.elements.namedItem(P);return t instanceof HTMLInputElement?t:null}var y=({title:e="Choose a new password",error:t,success:r,pending:a=!1,passwordLabel:i="New password",confirmPasswordLabel:n,requirements:l,passwordMismatchMessage:v="Passwords do not match",submitLabel:F="Update password",footer:I,onResetPassword:S,children:C,...g})=>{let N=p=>{p.preventDefault();let d=p.currentTarget,H=new FormData(d),w={password:R(H,"password")},m=n===void 0?null:_(d);if(m&&m.value!==w.password){m.setCustomValidity(v),d.reportValidity();return}S?.(w)},E=p=>{let d=p.target;d instanceof HTMLInputElement&&d.name===P&&d.setCustomValidity("")};return o(f,{...g,parts:{root:s("reset-password-page","root",g.className),panel:s("reset-password-page","panel"),title:s("reset-password-page","title"),error:s("reset-password-page","error"),footer:s("reset-password-page","footer")},title:e,error:t,footer:I,children:r?o($,{status:"success",...s("reset-password-page","success"),children:r}):c(L,{onSubmit:N,onChange:E,...s("reset-password-page","form"),children:[o(A,{label:i,required:!0,description:l===void 0?void 0:o("span",{...s("reset-password-page","requirements"),children:l}),...s("reset-password-page","field"),children:c(b,{name:"password",required:!0,children:[o(h,{autoComplete:"new-password"}),o(k,{})]})}),n!==void 0?o(A,{label:n,required:!0,...s("reset-password-page","field"),children:c(b,{name:P,required:!0,children:[o(h,{autoComplete:"new-password"}),o(k,{})]})}):null,C,o(q,{type:"submit",loading:a,disabled:a,...s("reset-password-page","submit"),children:F})]})})};y.displayName="ResetPasswordPage";export{y as ResetPasswordPage};
2
+ import{Alert as $,Button as q,Field as A,Form as L,PasswordInput as b}from"@skdx/react";import{PasswordInputField as h,PasswordInputToggle as k}from"@skdx/react/primitives/password-input";import*as x from"react";import{Alert as M,Heading as T}from"@skdx/react";import{jsx as u,jsxs as D}from"react/jsx-runtime";var f=({parts:e,title:t,error:r,footer:a,children:i,...n})=>{let l=x.useId();return u("section",{"aria-labelledby":l,...n,...e.root,children:D("div",{...e.panel,children:[u(T,{as:"h1",id:l,...e.title,children:t}),r?u(M,{role:"alert",status:"danger",...e.error,children:r}):null,i,a&&e.footer?u("div",{...e.footer,children:a}):null]})})};f.displayName="AuthPanel";function R(e,t){let r=e.get(t);return typeof r=="string"?r:""}function V(...e){let t="";for(let r of e)r&&(t=t?`${t} ${r}`:r);return t}function s(e,t,r){let a=t==="root",i=a?`skdx-${e}`:`skdx-${e}__${t}`,n={className:V(i,r),"data-part":t};return a&&(n["data-skdx-component"]=e),n}import{jsx as o,jsxs as c}from"react/jsx-runtime";var P="confirmPassword";function _(e){let t=e.elements.namedItem(P);return t instanceof HTMLInputElement?t:null}var y=({title:e="Choose a new password",error:t,success:r,pending:a=!1,passwordLabel:i="New password",confirmPasswordLabel:n,requirements:l,passwordMismatchMessage:v="Passwords do not match",submitLabel:F="Update password",footer:I,onResetPassword:S,children:C,...g})=>{let N=p=>{p.preventDefault();let d=p.currentTarget,H=new FormData(d),w={password:R(H,"password")},m=n===void 0?null:_(d);if(m&&m.value!==w.password){m.setCustomValidity(v),d.reportValidity();return}S?.(w)},E=p=>{let d=p.target;d instanceof HTMLInputElement&&d.name===P&&d.setCustomValidity("")};return o(f,{...g,parts:{root:s("reset-password-page","root",g.className),panel:s("reset-password-page","panel"),title:s("reset-password-page","title"),error:s("reset-password-page","error"),footer:s("reset-password-page","footer")},title:e,error:t,footer:I,children:r?o($,{status:"success",...s("reset-password-page","success"),children:r}):c(L,{onSubmit:N,onChange:E,...s("reset-password-page","form"),children:[o(A,{label:i,required:!0,description:l===void 0?void 0:o("span",{...s("reset-password-page","requirements"),children:l}),...s("reset-password-page","field"),children:c(b,{name:"password",required:!0,children:[o(h,{autoComplete:"new-password"}),o(k,{})]})}),n!==void 0?o(A,{label:n,required:!0,...s("reset-password-page","field"),children:c(b,{name:P,required:!0,children:[o(h,{autoComplete:"new-password"}),o(k,{})]})}):null,C,o(q,{type:"submit",loading:a,disabled:a,...s("reset-password-page","submit"),children:F})]})})};y.displayName="ResetPasswordPage";export{y as ResetPasswordPage};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var $=Object.create;var m=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var i in e)m(t,i,{get:e[i],enumerable:!0})},y=(t,e,i,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of q(e))!B.call(t,s)&&s!==i&&m(t,s,{get:()=>e[s],enumerable:!(l=T(e,s))||l.enumerable});return t};var H=(t,e,i)=>(i=t!=null?$(_(t)):{},y(e||!t||!t.__esModule?m(i,"default",{value:t,enumerable:!0}):i,t)),L=t=>y(m({},"__esModule",{value:!0}),t);var O={};C(O,{SignInPage:()=>x,defaultProviderLabel:()=>S});module.exports=L(O);var a=require("@skdx/react"),D=require("@skdx/react/primitives/text-field");var v=H(require("react"),1),p=require("@skdx/react"),d=require("react/jsx-runtime"),f=({parts:t,title:e,error:i,footer:l,children:s,...g})=>{let u=v.useId();return(0,d.jsx)("section",{"aria-labelledby":u,...g,...t.root,children:(0,d.jsxs)("div",{...t.panel,children:[(0,d.jsx)(p.Heading,{as:"h1",id:u,...t.title,children:e}),i?(0,d.jsx)(p.Alert,{status:"danger",...t.error,children:i}):null,s,l&&t.footer?(0,d.jsx)("div",{...t.footer,children:l}):null]})})};f.displayName="AuthPanel";function P(t,e){let i=t.get(e);return typeof i=="string"?i:""}function V(...t){let e="";for(let i of t)i&&(e=e?`${e} ${i}`:i);return e}function o(t,e,i){let l=e==="root",s=l?`skdx-${t}`:`skdx-${t}__${e}`,g={className:V(s,i),"data-part":e};return l&&(g["data-skdx-component"]=t),g}var r=require("react/jsx-runtime"),F=new Set(["credentials","magic-link"]),S=t=>`Sign in with ${t.name}`;function M({label:t}){return(0,r.jsx)(a.Field,{label:t,required:!0,...o("sign-in-page","field"),children:(0,r.jsx)(a.TextField,{name:"email",required:!0,children:(0,r.jsx)(D.TextFieldInput,{type:"email",autoComplete:"email"})})})}var x=({title:t="Sign in",providers:e,error:i,emailLabel:l="Email",passwordLabel:s="Password",submitLabel:g="Sign in",magicLinkLabel:u="Send magic link",getProviderLabel:w=S,onSignIn:b,children:N,...k})=>{let c=e.filter(n=>!F.has(n.id)),A=e.filter(n=>F.has(n.id)),E=n=>h=>{h.preventDefault();let I=new FormData(h.currentTarget),R={providerId:n,email:P(I,"email")};n==="credentials"&&(R.password=P(I,"password")),b?.(R)};return(0,r.jsxs)(f,{...k,parts:{root:o("sign-in-page","root",k.className),panel:o("sign-in-page","panel"),title:o("sign-in-page","title"),error:o("sign-in-page","error")},title:t,error:i,children:[c.length>0?(0,r.jsx)("div",{...o("sign-in-page","providers"),children:c.map(n=>(0,r.jsx)(a.Button,{type:"button","data-provider":n.id,onClick:()=>{b?.({providerId:n.id})},...o("sign-in-page","provider"),children:w(n)},n.id))}):null,c.length>0&&A.length>0?(0,r.jsx)(a.Divider,{...o("sign-in-page","divider")}):null,A.map(n=>(0,r.jsxs)(a.Form,{"data-provider":n.id,onSubmit:E(n.id),...o("sign-in-page","form"),children:[(0,r.jsx)(M,{label:l}),n.id==="credentials"?(0,r.jsx)(a.Field,{label:s,required:!0,...o("sign-in-page","field"),children:(0,r.jsx)(a.PasswordInput,{name:"password",required:!0})}):null,(0,r.jsx)(a.Button,{type:"submit",...o("sign-in-page","submit"),children:n.id==="credentials"?g:u})]},n.id)),N]})};x.displayName="SignInPage";0&&(module.exports={SignInPage,defaultProviderLabel});
2
+ "use strict";var $=Object.create;var m=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var i in e)m(t,i,{get:e[i],enumerable:!0})},y=(t,e,i,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of q(e))!B.call(t,s)&&s!==i&&m(t,s,{get:()=>e[s],enumerable:!(l=T(e,s))||l.enumerable});return t};var H=(t,e,i)=>(i=t!=null?$(_(t)):{},y(e||!t||!t.__esModule?m(i,"default",{value:t,enumerable:!0}):i,t)),L=t=>y(m({},"__esModule",{value:!0}),t);var O={};C(O,{SignInPage:()=>x,defaultProviderLabel:()=>S});module.exports=L(O);var a=require("@skdx/react"),D=require("@skdx/react/primitives/text-field");var v=H(require("react"),1),p=require("@skdx/react"),d=require("react/jsx-runtime"),f=({parts:t,title:e,error:i,footer:l,children:s,...g})=>{let u=v.useId();return(0,d.jsx)("section",{"aria-labelledby":u,...g,...t.root,children:(0,d.jsxs)("div",{...t.panel,children:[(0,d.jsx)(p.Heading,{as:"h1",id:u,...t.title,children:e}),i?(0,d.jsx)(p.Alert,{role:"alert",status:"danger",...t.error,children:i}):null,s,l&&t.footer?(0,d.jsx)("div",{...t.footer,children:l}):null]})})};f.displayName="AuthPanel";function P(t,e){let i=t.get(e);return typeof i=="string"?i:""}function V(...t){let e="";for(let i of t)i&&(e=e?`${e} ${i}`:i);return e}function o(t,e,i){let l=e==="root",s=l?`skdx-${t}`:`skdx-${t}__${e}`,g={className:V(s,i),"data-part":e};return l&&(g["data-skdx-component"]=t),g}var r=require("react/jsx-runtime"),F=new Set(["credentials","magic-link"]),S=t=>`Sign in with ${t.name}`;function M({label:t}){return(0,r.jsx)(a.Field,{label:t,required:!0,...o("sign-in-page","field"),children:(0,r.jsx)(a.TextField,{name:"email",required:!0,children:(0,r.jsx)(D.TextFieldInput,{type:"email",autoComplete:"email"})})})}var x=({title:t="Sign in",providers:e,error:i,emailLabel:l="Email",passwordLabel:s="Password",submitLabel:g="Sign in",magicLinkLabel:u="Send magic link",getProviderLabel:w=S,onSignIn:b,children:N,...k})=>{let c=e.filter(n=>!F.has(n.id)),A=e.filter(n=>F.has(n.id)),E=n=>h=>{h.preventDefault();let I=new FormData(h.currentTarget),R={providerId:n,email:P(I,"email")};n==="credentials"&&(R.password=P(I,"password")),b?.(R)};return(0,r.jsxs)(f,{...k,parts:{root:o("sign-in-page","root",k.className),panel:o("sign-in-page","panel"),title:o("sign-in-page","title"),error:o("sign-in-page","error")},title:t,error:i,children:[c.length>0?(0,r.jsx)("div",{...o("sign-in-page","providers"),children:c.map(n=>(0,r.jsx)(a.Button,{type:"button","data-provider":n.id,onClick:()=>{b?.({providerId:n.id})},...o("sign-in-page","provider"),children:w(n)},n.id))}):null,c.length>0&&A.length>0?(0,r.jsx)(a.Divider,{...o("sign-in-page","divider")}):null,A.map(n=>(0,r.jsxs)(a.Form,{"data-provider":n.id,onSubmit:E(n.id),...o("sign-in-page","form"),children:[(0,r.jsx)(M,{label:l}),n.id==="credentials"?(0,r.jsx)(a.Field,{label:s,required:!0,...o("sign-in-page","field"),children:(0,r.jsx)(a.PasswordInput,{name:"password",required:!0})}):null,(0,r.jsx)(a.Button,{type:"submit",...o("sign-in-page","submit"),children:n.id==="credentials"?g:u})]},n.id)),N]})};x.displayName="SignInPage";0&&(module.exports={SignInPage,defaultProviderLabel});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{Button as A,Divider as q,Field as R,Form as _,PasswordInput as B,TextField as C}from"@skdx/react";import{TextFieldInput as H}from"@skdx/react/primitives/text-field";import*as k from"react";import{Alert as N,Heading as E}from"@skdx/react";import{jsx as g,jsxs as $}from"react/jsx-runtime";var m=({parts:t,title:i,error:n,footer:o,children:l,...s})=>{let d=k.useId();return g("section",{"aria-labelledby":d,...s,...t.root,children:$("div",{...t.panel,children:[g(E,{as:"h1",id:d,...t.title,children:i}),n?g(N,{status:"danger",...t.error,children:n}):null,l,o&&t.footer?g("div",{...t.footer,children:o}):null]})})};m.displayName="AuthPanel";function p(t,i){let n=t.get(i);return typeof n=="string"?n:""}function T(...t){let i="";for(let n of t)n&&(i=i?`${i} ${n}`:n);return i}function r(t,i,n){let o=i==="root",l=o?`skdx-${t}`:`skdx-${t}__${i}`,s={className:T(l,n),"data-part":i};return o&&(s["data-skdx-component"]=t),s}import{jsx as a,jsxs as I}from"react/jsx-runtime";var h=new Set(["credentials","magic-link"]),y=t=>`Sign in with ${t.name}`;function L({label:t}){return a(R,{label:t,required:!0,...r("sign-in-page","field"),children:a(C,{name:"email",required:!0,children:a(H,{type:"email",autoComplete:"email"})})})}var v=({title:t="Sign in",providers:i,error:n,emailLabel:o="Email",passwordLabel:l="Password",submitLabel:s="Sign in",magicLinkLabel:d="Send magic link",getProviderLabel:F=y,onSignIn:c,children:D,...f})=>{let u=i.filter(e=>!h.has(e.id)),P=i.filter(e=>h.has(e.id)),w=e=>S=>{S.preventDefault();let x=new FormData(S.currentTarget),b={providerId:e,email:p(x,"email")};e==="credentials"&&(b.password=p(x,"password")),c?.(b)};return I(m,{...f,parts:{root:r("sign-in-page","root",f.className),panel:r("sign-in-page","panel"),title:r("sign-in-page","title"),error:r("sign-in-page","error")},title:t,error:n,children:[u.length>0?a("div",{...r("sign-in-page","providers"),children:u.map(e=>a(A,{type:"button","data-provider":e.id,onClick:()=>{c?.({providerId:e.id})},...r("sign-in-page","provider"),children:F(e)},e.id))}):null,u.length>0&&P.length>0?a(q,{...r("sign-in-page","divider")}):null,P.map(e=>I(_,{"data-provider":e.id,onSubmit:w(e.id),...r("sign-in-page","form"),children:[a(L,{label:o}),e.id==="credentials"?a(R,{label:l,required:!0,...r("sign-in-page","field"),children:a(B,{name:"password",required:!0})}):null,a(A,{type:"submit",...r("sign-in-page","submit"),children:e.id==="credentials"?s:d})]},e.id)),D]})};v.displayName="SignInPage";export{v as SignInPage,y as defaultProviderLabel};
2
+ import{Button as A,Divider as q,Field as R,Form as _,PasswordInput as B,TextField as C}from"@skdx/react";import{TextFieldInput as H}from"@skdx/react/primitives/text-field";import*as k from"react";import{Alert as N,Heading as E}from"@skdx/react";import{jsx as g,jsxs as $}from"react/jsx-runtime";var m=({parts:t,title:i,error:n,footer:o,children:l,...s})=>{let d=k.useId();return g("section",{"aria-labelledby":d,...s,...t.root,children:$("div",{...t.panel,children:[g(E,{as:"h1",id:d,...t.title,children:i}),n?g(N,{role:"alert",status:"danger",...t.error,children:n}):null,l,o&&t.footer?g("div",{...t.footer,children:o}):null]})})};m.displayName="AuthPanel";function p(t,i){let n=t.get(i);return typeof n=="string"?n:""}function T(...t){let i="";for(let n of t)n&&(i=i?`${i} ${n}`:n);return i}function r(t,i,n){let o=i==="root",l=o?`skdx-${t}`:`skdx-${t}__${i}`,s={className:T(l,n),"data-part":i};return o&&(s["data-skdx-component"]=t),s}import{jsx as a,jsxs as I}from"react/jsx-runtime";var h=new Set(["credentials","magic-link"]),y=t=>`Sign in with ${t.name}`;function L({label:t}){return a(R,{label:t,required:!0,...r("sign-in-page","field"),children:a(C,{name:"email",required:!0,children:a(H,{type:"email",autoComplete:"email"})})})}var v=({title:t="Sign in",providers:i,error:n,emailLabel:o="Email",passwordLabel:l="Password",submitLabel:s="Sign in",magicLinkLabel:d="Send magic link",getProviderLabel:F=y,onSignIn:c,children:D,...f})=>{let u=i.filter(e=>!h.has(e.id)),P=i.filter(e=>h.has(e.id)),w=e=>S=>{S.preventDefault();let x=new FormData(S.currentTarget),b={providerId:e,email:p(x,"email")};e==="credentials"&&(b.password=p(x,"password")),c?.(b)};return I(m,{...f,parts:{root:r("sign-in-page","root",f.className),panel:r("sign-in-page","panel"),title:r("sign-in-page","title"),error:r("sign-in-page","error")},title:t,error:n,children:[u.length>0?a("div",{...r("sign-in-page","providers"),children:u.map(e=>a(A,{type:"button","data-provider":e.id,onClick:()=>{c?.({providerId:e.id})},...r("sign-in-page","provider"),children:F(e)},e.id))}):null,u.length>0&&P.length>0?a(q,{...r("sign-in-page","divider")}):null,P.map(e=>I(_,{"data-provider":e.id,onSubmit:w(e.id),...r("sign-in-page","form"),children:[a(L,{label:o}),e.id==="credentials"?a(R,{label:l,required:!0,...r("sign-in-page","field"),children:a(B,{name:"password",required:!0})}):null,a(A,{type:"submit",...r("sign-in-page","submit"),children:e.id==="credentials"?s:d})]},e.id)),D]})};v.displayName="SignInPage";export{v as SignInPage,y as defaultProviderLabel};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var B=Object.create;var c=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var z=(e,t)=>{for(var n in t)c(e,n,{get:t[n],enumerable:!0})},T=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of _(t))!W.call(e,a)&&a!==n&&c(e,a,{get:()=>t[a],enumerable:!(s=L(t,a))||s.enumerable});return e};var G=(e,t,n)=>(n=e!=null?B(O(e)):{},T(t||!e||!e.__esModule?c(n,"default",{value:e,enumerable:!0}):n,e)),J=e=>T(c({},"__esModule",{value:!0}),e);var X={};z(X,{SignUpPage:()=>C});module.exports=J(X);var i=require("@skdx/react"),m=require("@skdx/react/primitives/password-input"),k=require("@skdx/react/primitives/text-field");var q=G(require("react"),1),P=require("@skdx/react"),u=require("react/jsx-runtime"),F=({parts:e,title:t,error:n,footer:s,children:a,...p})=>{let g=q.useId();return(0,u.jsx)("section",{"aria-labelledby":g,...p,...e.root,children:(0,u.jsxs)("div",{...e.panel,children:[(0,u.jsx)(P.Heading,{as:"h1",id:g,...e.title,children:t}),n?(0,u.jsx)(P.Alert,{status:"danger",...e.error,children:n}):null,a,s&&e.footer?(0,u.jsx)("div",{...e.footer,children:s}):null]})})};F.displayName="AuthPanel";function x(e,t){let n=e.get(t);return typeof n=="string"?n:""}function K(...e){let t="";for(let n of e)n&&(t=t?`${t} ${n}`:n);return t}function o(e,t,n){let s=t==="root",a=s?`skdx-${e}`:`skdx-${e}__${t}`,p={className:K(a,n),"data-part":t};return s&&(p["data-skdx-component"]=e),p}var E=require("../sign-in-page/SignInPage.cjs"),r=require("react/jsx-runtime"),y="confirmPassword";function Q(e){let t=e.elements.namedItem(y);return t instanceof HTMLInputElement?t:null}var C=({title:e="Create account",providers:t,error:n,pending:s=!1,nameLabel:a,emailLabel:p="Email",passwordLabel:g="Password",confirmPasswordLabel:b,passwordMismatchMessage:N="Passwords do not match",terms:A,submitLabel:H="Create account",getProviderLabel:M=E.defaultProviderLabel,footer:U,onSignUp:I,children:D,...R})=>{let S=t??[],V=d=>{d.preventDefault();let l=d.currentTarget,f=new FormData(l),w=x(f,"password"),h=b===void 0?null:Q(l);if(h&&h.value!==w){h.setCustomValidity(N),l.reportValidity();return}let v={providerId:"credentials",email:x(f,"email"),password:w};a!==void 0&&(v.name=x(f,"name")),A!==void 0&&(v.termsAccepted=f.get("terms")!==null),I?.(v)},$=d=>{let l=d.target;l instanceof HTMLInputElement&&l.name===y&&l.setCustomValidity("")};return(0,r.jsxs)(F,{...R,parts:{root:o("sign-up-page","root",R.className),panel:o("sign-up-page","panel"),title:o("sign-up-page","title"),error:o("sign-up-page","error"),footer:o("sign-up-page","footer")},title:e,error:n,footer:U,children:[S.length>0?(0,r.jsx)("div",{...o("sign-up-page","providers"),children:S.map(d=>(0,r.jsx)(i.Button,{type:"button","data-provider":d.id,onClick:()=>{I?.({providerId:d.id})},...o("sign-up-page","provider"),children:M(d)},d.id))}):null,S.length>0?(0,r.jsx)(i.Divider,{...o("sign-up-page","divider")}):null,(0,r.jsxs)(i.Form,{onSubmit:V,onChange:$,...o("sign-up-page","form"),children:[a!==void 0?(0,r.jsx)(i.Field,{label:a,required:!0,...o("sign-up-page","field"),children:(0,r.jsx)(i.TextField,{name:"name",required:!0,children:(0,r.jsx)(k.TextFieldInput,{autoComplete:"name"})})}):null,(0,r.jsx)(i.Field,{label:p,required:!0,...o("sign-up-page","field"),children:(0,r.jsx)(i.TextField,{name:"email",required:!0,children:(0,r.jsx)(k.TextFieldInput,{type:"email",autoComplete:"email"})})}),(0,r.jsx)(i.Field,{label:g,required:!0,...o("sign-up-page","field"),children:(0,r.jsxs)(i.PasswordInput,{name:"password",required:!0,children:[(0,r.jsx)(m.PasswordInputField,{autoComplete:"new-password"}),(0,r.jsx)(m.PasswordInputToggle,{})]})}),b!==void 0?(0,r.jsx)(i.Field,{label:b,required:!0,...o("sign-up-page","field"),children:(0,r.jsxs)(i.PasswordInput,{name:y,required:!0,children:[(0,r.jsx)(m.PasswordInputField,{autoComplete:"new-password"}),(0,r.jsx)(m.PasswordInputToggle,{})]})}):null,D,A!==void 0?(0,r.jsx)(i.Field,{label:A,required:!0,...o("sign-up-page","terms"),children:(0,r.jsx)(i.Checkbox,{name:"terms",required:!0})}):null,(0,r.jsx)(i.Button,{type:"submit",loading:s,disabled:s,...o("sign-up-page","submit"),children:H})]})]})};C.displayName="SignUpPage";0&&(module.exports={SignUpPage});
2
+ "use strict";var K=Object.create;var f=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var j=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0})},q=(e,t,r,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of X(t))!Z.call(e,a)&&a!==r&&f(e,a,{get:()=>t[a],enumerable:!(l=Q(t,a))||l.enumerable});return e};var H=(e,t,r)=>(r=e!=null?K(Y(e)):{},q(t||!e||!e.__esModule?f(r,"default",{value:e,enumerable:!0}):r,e)),ee=e=>q(f({},"__esModule",{value:!0}),e);var re={};j(re,{SignUpPage:()=>I});module.exports=ee(re);var v=H(require("react"),1),o=require("@skdx/react"),m=require("@skdx/react/primitives/password-input"),y=require("@skdx/react/primitives/text-field");var U=H(require("react"),1),P=require("@skdx/react"),u=require("react/jsx-runtime"),k=({parts:e,title:t,error:r,footer:l,children:a,...p})=>{let g=U.useId();return(0,u.jsx)("section",{"aria-labelledby":g,...p,...e.root,children:(0,u.jsxs)("div",{...e.panel,children:[(0,u.jsx)(P.Heading,{as:"h1",id:g,...e.title,children:t}),r?(0,u.jsx)(P.Alert,{role:"alert",status:"danger",...e.error,children:r}):null,a,l&&e.footer?(0,u.jsx)("div",{...e.footer,children:l}):null]})})};k.displayName="AuthPanel";function x(e,t){let r=e.get(t);return typeof r=="string"?r:""}function te(...e){let t="";for(let r of e)r&&(t=t?`${t} ${r}`:r);return t}function i(e,t,r){let l=t==="root",a=l?`skdx-${e}`:`skdx-${e}__${t}`,p={className:te(a,r),"data-part":t};return l&&(p["data-skdx-component"]=e),p}var V=require("../sign-in-page/SignInPage.cjs"),n=require("react/jsx-runtime"),C="confirmPassword",b="terms";function D(e,t){let r=e?.elements.namedItem(t);return r instanceof HTMLInputElement?r:null}var I=({title:e="Create account",providers:t,error:r,pending:l=!1,nameLabel:a,emailLabel:p="Email",passwordLabel:g="Password",confirmPasswordLabel:A,passwordMismatchMessage:$="Passwords do not match",terms:h,submitLabel:L="Create account",getProviderLabel:_=V.defaultProviderLabel,footer:B,onSignUp:E,children:O,...T})=>{let F=t??[],w=v.useRef(null),[W,M]=v.useState(""),z=s=>{s.preventDefault();let d=s.currentTarget,c=new FormData(d),N=x(c,"password"),S=A===void 0?null:D(d,C);if(S&&S.value!==N){S.setCustomValidity($),d.reportValidity();return}let R={providerId:"credentials",email:x(c,"email"),password:N};a!==void 0&&(R.name=x(c,"name")),h!==void 0&&(R.termsAccepted=c.get(b)!==null),E?.(R)},G=({name:s})=>{s===b&&M(D(w.current,b)?.validationMessage??"")},J=s=>{let d=s.target;d instanceof HTMLInputElement&&d.name===C&&d.setCustomValidity("")};return(0,n.jsxs)(k,{...T,parts:{root:i("sign-up-page","root",T.className),panel:i("sign-up-page","panel"),title:i("sign-up-page","title"),error:i("sign-up-page","error"),footer:i("sign-up-page","footer")},title:e,error:r,footer:B,children:[F.length>0?(0,n.jsx)("div",{...i("sign-up-page","providers"),children:F.map(s=>(0,n.jsx)(o.Button,{type:"button","data-provider":s.id,onClick:()=>{E?.({providerId:s.id})},...i("sign-up-page","provider"),children:_(s)},s.id))}):null,F.length>0?(0,n.jsx)(o.Divider,{...i("sign-up-page","divider")}):null,(0,n.jsxs)(o.Form,{ref:s=>{w.current=s},onSubmit:z,onChange:J,onFieldInvalid:G,...i("sign-up-page","form"),children:[a!==void 0?(0,n.jsx)(o.Field,{label:a,required:!0,...i("sign-up-page","field"),children:(0,n.jsx)(o.TextField,{name:"name",required:!0,children:(0,n.jsx)(y.TextFieldInput,{autoComplete:"name"})})}):null,(0,n.jsx)(o.Field,{label:p,required:!0,...i("sign-up-page","field"),children:(0,n.jsx)(o.TextField,{name:"email",required:!0,children:(0,n.jsx)(y.TextFieldInput,{type:"email",autoComplete:"email"})})}),(0,n.jsx)(o.Field,{label:g,required:!0,...i("sign-up-page","field"),children:(0,n.jsxs)(o.PasswordInput,{name:"password",required:!0,children:[(0,n.jsx)(m.PasswordInputField,{autoComplete:"new-password"}),(0,n.jsx)(m.PasswordInputToggle,{})]})}),A!==void 0?(0,n.jsx)(o.Field,{label:A,required:!0,...i("sign-up-page","field"),children:(0,n.jsxs)(o.PasswordInput,{name:C,required:!0,children:[(0,n.jsx)(m.PasswordInputField,{autoComplete:"new-password"}),(0,n.jsx)(m.PasswordInputToggle,{})]})}):null,O,h!==void 0?(0,n.jsx)(o.Field,{label:h,required:!0,errors:W,...i("sign-up-page","terms"),children:(0,n.jsx)(o.Checkbox,{name:b,required:!0,onCheckedChange:()=>{M("")}})}):null,(0,n.jsx)(o.Button,{type:"submit",loading:l,disabled:l,...i("sign-up-page","submit"),children:L})]})]})};I.displayName="SignUpPage";0&&(module.exports={SignUpPage});
@@ -1,4 +1,4 @@
1
- import type * as React from 'react';
1
+ import * as React from 'react';
2
2
  import type { SignUpPageProps } from './types.cjs';
3
3
  /**
4
4
  * Sign-up block: an error alert, one button per third-party provider, and the
@@ -1,4 +1,4 @@
1
- import type * as React from 'react';
1
+ import * as React from 'react';
2
2
  import type { SignUpPageProps } from './types.js';
3
3
  /**
4
4
  * Sign-up block: an error alert, one button per third-party provider, and the
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{Button as I,Checkbox as z,Divider as G,Field as u,Form as J,PasswordInput as R,TextField as w}from"@skdx/react";import{PasswordInputField as T,PasswordInputToggle as q}from"@skdx/react/primitives/password-input";import{TextFieldInput as E}from"@skdx/react/primitives/text-field";import*as C from"react";import{Alert as L,Heading as _}from"@skdx/react";import{jsx as g,jsxs as O}from"react/jsx-runtime";var h=({parts:e,title:r,error:i,footer:a,children:s,...l})=>{let p=C.useId();return g("section",{"aria-labelledby":p,...l,...e.root,children:O("div",{...e.panel,children:[g(_,{as:"h1",id:p,...e.title,children:r}),i?g(L,{status:"danger",...e.error,children:i}):null,s,a&&e.footer?g("div",{...e.footer,children:a}):null]})})};h.displayName="AuthPanel";function f(e,r){let i=e.get(r);return typeof i=="string"?i:""}function W(...e){let r="";for(let i of e)i&&(r=r?`${r} ${i}`:i);return r}function n(e,r,i){let a=r==="root",s=a?`skdx-${e}`:`skdx-${e}__${r}`,l={className:W(s,i),"data-part":r};return a&&(l["data-skdx-component"]=e),l}import{defaultProviderLabel as K}from"../sign-in-page/SignInPage.js";import{jsx as t,jsxs as c}from"react/jsx-runtime";var v="confirmPassword";function Q(e){let r=e.elements.namedItem(v);return r instanceof HTMLInputElement?r:null}var N=({title:e="Create account",providers:r,error:i,pending:a=!1,nameLabel:s,emailLabel:l="Email",passwordLabel:p="Password",confirmPasswordLabel:P,passwordMismatchMessage:H="Passwords do not match",terms:x,submitLabel:M="Create account",getProviderLabel:U=K,footer:D,onSignUp:F,children:V,...k})=>{let b=r??[],$=o=>{o.preventDefault();let d=o.currentTarget,m=new FormData(d),y=f(m,"password"),A=P===void 0?null:Q(d);if(A&&A.value!==y){A.setCustomValidity(H),d.reportValidity();return}let S={providerId:"credentials",email:f(m,"email"),password:y};s!==void 0&&(S.name=f(m,"name")),x!==void 0&&(S.termsAccepted=m.get("terms")!==null),F?.(S)},B=o=>{let d=o.target;d instanceof HTMLInputElement&&d.name===v&&d.setCustomValidity("")};return c(h,{...k,parts:{root:n("sign-up-page","root",k.className),panel:n("sign-up-page","panel"),title:n("sign-up-page","title"),error:n("sign-up-page","error"),footer:n("sign-up-page","footer")},title:e,error:i,footer:D,children:[b.length>0?t("div",{...n("sign-up-page","providers"),children:b.map(o=>t(I,{type:"button","data-provider":o.id,onClick:()=>{F?.({providerId:o.id})},...n("sign-up-page","provider"),children:U(o)},o.id))}):null,b.length>0?t(G,{...n("sign-up-page","divider")}):null,c(J,{onSubmit:$,onChange:B,...n("sign-up-page","form"),children:[s!==void 0?t(u,{label:s,required:!0,...n("sign-up-page","field"),children:t(w,{name:"name",required:!0,children:t(E,{autoComplete:"name"})})}):null,t(u,{label:l,required:!0,...n("sign-up-page","field"),children:t(w,{name:"email",required:!0,children:t(E,{type:"email",autoComplete:"email"})})}),t(u,{label:p,required:!0,...n("sign-up-page","field"),children:c(R,{name:"password",required:!0,children:[t(T,{autoComplete:"new-password"}),t(q,{})]})}),P!==void 0?t(u,{label:P,required:!0,...n("sign-up-page","field"),children:c(R,{name:v,required:!0,children:[t(T,{autoComplete:"new-password"}),t(q,{})]})}):null,V,x!==void 0?t(u,{label:x,required:!0,...n("sign-up-page","terms"),children:t(z,{name:"terms",required:!0})}):null,t(I,{type:"submit",loading:a,disabled:a,...n("sign-up-page","submit"),children:M})]})]})};N.displayName="SignUpPage";export{N as SignUpPage};
2
+ import*as x from"react";import{Button as w,Checkbox as Z,Divider as j,Field as u,Form as ee,PasswordInput as M,TextField as N}from"@skdx/react";import{PasswordInputField as q,PasswordInputToggle as H}from"@skdx/react/primitives/password-input";import{TextFieldInput as U}from"@skdx/react/primitives/text-field";import*as T from"react";import{Alert as K,Heading as Q}from"@skdx/react";import{jsx as g,jsxs as X}from"react/jsx-runtime";var S=({parts:e,title:r,error:n,footer:a,children:s,...d})=>{let p=T.useId();return g("section",{"aria-labelledby":p,...d,...e.root,children:X("div",{...e.panel,children:[g(Q,{as:"h1",id:p,...e.title,children:r}),n?g(K,{role:"alert",status:"danger",...e.error,children:n}):null,s,a&&e.footer?g("div",{...e.footer,children:a}):null]})})};S.displayName="AuthPanel";function c(e,r){let n=e.get(r);return typeof n=="string"?n:""}function Y(...e){let r="";for(let n of e)n&&(r=r?`${r} ${n}`:n);return r}function o(e,r,n){let a=r==="root",s=a?`skdx-${e}`:`skdx-${e}__${r}`,d={className:Y(s,n),"data-part":r};return a&&(d["data-skdx-component"]=e),d}import{defaultProviderLabel as te}from"../sign-in-page/SignInPage.js";import{jsx as t,jsxs as P}from"react/jsx-runtime";var R="confirmPassword",f="terms";function D(e,r){let n=e?.elements.namedItem(r);return n instanceof HTMLInputElement?n:null}var V=({title:e="Create account",providers:r,error:n,pending:a=!1,nameLabel:s,emailLabel:d="Email",passwordLabel:p="Password",confirmPasswordLabel:b,passwordMismatchMessage:$="Passwords do not match",terms:v,submitLabel:L="Create account",getProviderLabel:_=te,footer:B,onSignUp:k,children:O,...C})=>{let A=r??[],y=x.useRef(null),[W,I]=x.useState(""),z=i=>{i.preventDefault();let l=i.currentTarget,m=new FormData(l),E=c(m,"password"),h=b===void 0?null:D(l,R);if(h&&h.value!==E){h.setCustomValidity($),l.reportValidity();return}let F={providerId:"credentials",email:c(m,"email"),password:E};s!==void 0&&(F.name=c(m,"name")),v!==void 0&&(F.termsAccepted=m.get(f)!==null),k?.(F)},G=({name:i})=>{i===f&&I(D(y.current,f)?.validationMessage??"")},J=i=>{let l=i.target;l instanceof HTMLInputElement&&l.name===R&&l.setCustomValidity("")};return P(S,{...C,parts:{root:o("sign-up-page","root",C.className),panel:o("sign-up-page","panel"),title:o("sign-up-page","title"),error:o("sign-up-page","error"),footer:o("sign-up-page","footer")},title:e,error:n,footer:B,children:[A.length>0?t("div",{...o("sign-up-page","providers"),children:A.map(i=>t(w,{type:"button","data-provider":i.id,onClick:()=>{k?.({providerId:i.id})},...o("sign-up-page","provider"),children:_(i)},i.id))}):null,A.length>0?t(j,{...o("sign-up-page","divider")}):null,P(ee,{ref:i=>{y.current=i},onSubmit:z,onChange:J,onFieldInvalid:G,...o("sign-up-page","form"),children:[s!==void 0?t(u,{label:s,required:!0,...o("sign-up-page","field"),children:t(N,{name:"name",required:!0,children:t(U,{autoComplete:"name"})})}):null,t(u,{label:d,required:!0,...o("sign-up-page","field"),children:t(N,{name:"email",required:!0,children:t(U,{type:"email",autoComplete:"email"})})}),t(u,{label:p,required:!0,...o("sign-up-page","field"),children:P(M,{name:"password",required:!0,children:[t(q,{autoComplete:"new-password"}),t(H,{})]})}),b!==void 0?t(u,{label:b,required:!0,...o("sign-up-page","field"),children:P(M,{name:R,required:!0,children:[t(q,{autoComplete:"new-password"}),t(H,{})]})}):null,O,v!==void 0?t(u,{label:v,required:!0,errors:W,...o("sign-up-page","terms"),children:t(Z,{name:f,required:!0,onCheckedChange:()=>{I("")}})}):null,t(w,{type:"submit",loading:a,disabled:a,...o("sign-up-page","submit"),children:L})]})]})};V.displayName="SignUpPage";export{V as SignUpPage};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var L=Object.create;var g=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var T=(e,a)=>{for(var t in a)g(e,t,{get:a[t],enumerable:!0})},$=(e,a,t,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of A(a))!h.call(e,n)&&n!==t&&g(e,n,{get:()=>a[n],enumerable:!(r=C(a,n))||r.enumerable});return e};var _=(e,a,t)=>(t=e!=null?L(S(e)):{},$(a||!e||!e.__esModule?g(t,"default",{value:e,enumerable:!0}):t,e)),z=e=>$(g({},"__esModule",{value:!0}),e);var q={};T(q,{UsageCard:()=>f});module.exports=z(q);var y=_(require("react"),1),c=require("@skdx/react");function I(...e){let a="";for(let t of e)t&&(a=a?`${a} ${t}`:t);return a}function i(e,a,t){let r=a==="root",n=r?`skdx-${e}`:`skdx-${e}__${a}`,l={className:I(n,t),"data-part":a};return r&&(l["data-skdx-component"]=e),l}function m(e){return Number.isNaN(e)?0:Math.max(e,0)}function k(e,a){let t=m(e),r=m(a);return r===0?{limit:r,overLimit:t>0,range:null}:{limit:r,overLimit:t>r,range:{max:r,value:Math.min(t,r)}}}var s=require("react/jsx-runtime"),f=({label:e,used:a,limit:t,unit:r,formatValue:n=String,unlimitedLabel:l="Unlimited",description:x,actions:b,footer:v,status:P,...U})=>{let p=y.useId(),R=m(a),o,M=!1,u=null;if(t===null)o=l;else if(t!==void 0){let d=k(R,t);M=d.overLimit,u=d.range,o=`/ ${n(d.limit)}`}return(0,s.jsxs)("div",{role:"group","aria-labelledby":p,"data-state":M?"over-limit":void 0,"data-status":P,...U,...i("usage-card","root",U.className),children:[(0,s.jsxs)("div",{...i("usage-card","header"),children:[(0,s.jsx)("span",{id:p,...i("usage-card","label"),children:e}),b?(0,s.jsx)("div",{...i("usage-card","actions"),children:b}):null]}),(0,s.jsxs)("div",{...i("usage-card","value"),children:[(0,s.jsx)("span",{...i("usage-card","used"),children:n(R)}),o!==void 0?(0,s.jsx)("span",{...i("usage-card","limit"),children:o}):null,r?(0,s.jsx)("span",{...i("usage-card","unit"),children:r}):null]}),u?(0,s.jsx)(c.Progress,{role:"meter",min:0,max:u.max,value:u.value,"aria-labelledby":p,getValueLabel:(d,w,N)=>`${n(d)} / ${n(N)}${r?` ${r}`:""}`,...i("usage-card","progress")}):null,x?(0,s.jsx)(c.Text,{as:"p",tone:"muted",...i("usage-card","description"),children:x}):null,v?(0,s.jsx)("div",{...i("usage-card","footer"),children:v}):null]})};f.displayName="UsageCard";0&&(module.exports={UsageCard});
2
+ "use strict";var L=Object.create;var g=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var _=(e,a)=>{for(var t in a)g(e,t,{get:a[t],enumerable:!0})},M=(e,a,t,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of C(a))!S.call(e,n)&&n!==t&&g(e,n,{get:()=>a[n],enumerable:!(r=h(a,n))||r.enumerable});return e};var T=(e,a,t)=>(t=e!=null?L(A(e)):{},M(a||!e||!e.__esModule?g(t,"default",{value:e,enumerable:!0}):t,e)),z=e=>M(g({},"__esModule",{value:!0}),e);var w={};_(w,{UsageCard:()=>x});module.exports=z(w);var k=T(require("react"),1),c=require("@skdx/react");function I(...e){let a="";for(let t of e)t&&(a=a?`${a} ${t}`:t);return a}function i(e,a,t){let r=a==="root",n=r?`skdx-${e}`:`skdx-${e}__${a}`,d={className:I(n,t),"data-part":a};return r&&(d["data-skdx-component"]=e),d}function m(e){return Number.isNaN(e)?0:Math.max(e,0)}function $(e,a){let t=m(e),r=m(a);return r===0?{limit:r,overLimit:t>0,range:null}:{limit:r,overLimit:t>r,range:{max:r,value:Math.min(t,r)}}}var s=require("react/jsx-runtime"),x=({label:e,used:a,limit:t,unit:r,formatValue:n=String,unlimitedLabel:d="Unlimited",description:v,actions:b,footer:U,status:P,...y})=>{let p=k.useId(),f=m(a),o,R=!1,l=null;if(t===null)o=d;else if(t!==void 0){let u=$(f,t);R=u.overLimit,l=u.range,o=`/ ${n(u.limit)}`}return(0,s.jsxs)("div",{role:"group","aria-labelledby":p,"data-state":R?"over-limit":void 0,"data-status":P,...y,...i("usage-card","root",y.className),children:[(0,s.jsxs)("div",{...i("usage-card","header"),children:[(0,s.jsx)("span",{id:p,...i("usage-card","label"),children:e}),b?(0,s.jsx)("div",{...i("usage-card","actions"),children:b}):null]}),(0,s.jsxs)("div",{...i("usage-card","value"),children:[(0,s.jsx)("span",{...i("usage-card","used"),children:n(f)}),o!==void 0?(0,s.jsx)("span",{...i("usage-card","limit"),children:o}):null,r?(0,s.jsx)("span",{...i("usage-card","unit"),children:r}):null]}),l?(0,s.jsx)(c.Progress,{role:"meter",min:0,max:l.max,value:l.value,"aria-labelledby":p,getValueLabel:(u,q,N)=>`${n(f)} / ${n(N)}${r?` ${r}`:""}`,...i("usage-card","progress")}):null,v?(0,s.jsx)(c.Text,{as:"p",tone:"muted",...i("usage-card","description"),children:v}):null,U?(0,s.jsx)("div",{...i("usage-card","footer"),children:U}):null]})};x.displayName="UsageCard";0&&(module.exports={UsageCard});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import*as M from"react";import{Progress as N,Text as L}from"@skdx/react";function P(...t){let r="";for(let a of t)a&&(r=r?`${r} ${a}`:a);return r}function s(t,r,a){let e=r==="root",i=e?`skdx-${t}`:`skdx-${t}__${r}`,l={className:P(i,a),"data-part":r};return e&&(l["data-skdx-component"]=t),l}function g(t){return Number.isNaN(t)?0:Math.max(t,0)}function R(t,r){let a=g(t),e=g(r);return e===0?{limit:e,overLimit:a>0,range:null}:{limit:e,overLimit:a>e,range:{max:e,value:Math.min(a,e)}}}import{jsx as n,jsxs as c}from"react/jsx-runtime";var $=({label:t,used:r,limit:a,unit:e,formatValue:i=String,unlimitedLabel:l="Unlimited",description:p,actions:f,footer:x,status:k,...b})=>{let m=M.useId(),v=g(r),o,U=!1,u=null;if(a===null)o=l;else if(a!==void 0){let d=R(v,a);U=d.overLimit,u=d.range,o=`/ ${i(d.limit)}`}return c("div",{role:"group","aria-labelledby":m,"data-state":U?"over-limit":void 0,"data-status":k,...b,...s("usage-card","root",b.className),children:[c("div",{...s("usage-card","header"),children:[n("span",{id:m,...s("usage-card","label"),children:t}),f?n("div",{...s("usage-card","actions"),children:f}):null]}),c("div",{...s("usage-card","value"),children:[n("span",{...s("usage-card","used"),children:i(v)}),o!==void 0?n("span",{...s("usage-card","limit"),children:o}):null,e?n("span",{...s("usage-card","unit"),children:e}):null]}),u?n(N,{role:"meter",min:0,max:u.max,value:u.value,"aria-labelledby":m,getValueLabel:(d,C,y)=>`${i(d)} / ${i(y)}${e?` ${e}`:""}`,...s("usage-card","progress")}):null,p?n(L,{as:"p",tone:"muted",...s("usage-card","description"),children:p}):null,x?n("div",{...s("usage-card","footer"),children:x}):null]})};$.displayName="UsageCard";export{$ as UsageCard};
2
+ import*as R from"react";import{Progress as N,Text as L}from"@skdx/react";function P(...t){let r="";for(let a of t)a&&(r=r?`${r} ${a}`:a);return r}function s(t,r,a){let e=r==="root",i=e?`skdx-${t}`:`skdx-${t}__${r}`,d={className:P(i,a),"data-part":r};return e&&(d["data-skdx-component"]=t),d}function g(t){return Number.isNaN(t)?0:Math.max(t,0)}function y(t,r){let a=g(t),e=g(r);return e===0?{limit:e,overLimit:a>0,range:null}:{limit:e,overLimit:a>e,range:{max:e,value:Math.min(a,e)}}}import{jsx as n,jsxs as p}from"react/jsx-runtime";var M=({label:t,used:r,limit:a,unit:e,formatValue:i=String,unlimitedLabel:d="Unlimited",description:f,actions:x,footer:v,status:$,...b})=>{let m=R.useId(),c=g(r),o,U=!1,l=null;if(a===null)o=d;else if(a!==void 0){let u=y(c,a);U=u.overLimit,l=u.range,o=`/ ${i(u.limit)}`}return p("div",{role:"group","aria-labelledby":m,"data-state":U?"over-limit":void 0,"data-status":$,...b,...s("usage-card","root",b.className),children:[p("div",{...s("usage-card","header"),children:[n("span",{id:m,...s("usage-card","label"),children:t}),x?n("div",{...s("usage-card","actions"),children:x}):null]}),p("div",{...s("usage-card","value"),children:[n("span",{...s("usage-card","used"),children:i(c)}),o!==void 0?n("span",{...s("usage-card","limit"),children:o}):null,e?n("span",{...s("usage-card","unit"),children:e}):null]}),l?n(N,{role:"meter",min:0,max:l.max,value:l.value,"aria-labelledby":m,getValueLabel:(u,h,k)=>`${i(c)} / ${i(k)}${e?` ${e}`:""}`,...s("usage-card","progress")}):null,f?n(L,{as:"p",tone:"muted",...s("usage-card","description"),children:f}):null,v?n("div",{...s("usage-card","footer"),children:v}):null]})};M.displayName="UsageCard";export{M as UsageCard};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var C=Object.create;var c=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var _=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},b=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of I(e))!L.call(t,a)&&a!==r&&c(t,a,{get:()=>e[a],enumerable:!(n=E(e,a))||n.enumerable});return t};var q=(t,e,r)=>(r=t!=null?C(H(t)):{},b(e||!t||!t.__esModule?c(r,"default",{value:t,enumerable:!0}):r,t)),w=t=>b(c({},"__esModule",{value:!0}),t);var W={};_(W,{VerificationPage:()=>m});module.exports=w(W);var s=require("@skdx/react"),h=require("@skdx/react/primitives/field");var A=q(require("react"),1),u=require("@skdx/react"),l=require("react/jsx-runtime"),p=({parts:t,title:e,error:r,footer:n,children:a,...d})=>{let f=A.useId();return(0,l.jsx)("section",{"aria-labelledby":f,...d,...t.root,children:(0,l.jsxs)("div",{...t.panel,children:[(0,l.jsx)(u.Heading,{as:"h1",id:f,...t.title,children:e}),r?(0,l.jsx)(u.Alert,{status:"danger",...t.error,children:r}):null,a,n&&t.footer?(0,l.jsx)("div",{...t.footer,children:n}):null]})})};p.displayName="AuthPanel";function k(t,e){let r=t.get(e);return typeof r=="string"?r:""}function M(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function i(t,e,r){let n=e==="root",a=n?`skdx-${t}`:`skdx-${t}__${e}`,d={className:M(a,r),"data-part":e};return n&&(d["data-skdx-component"]=t),d}var o=require("react/jsx-runtime"),m=({title:t="Enter your verification code",description:e,error:r,pending:n=!1,codeLabel:a="Verification code",length:d=6,value:f,defaultValue:y,onValueChange:R,submitLabel:V="Verify",resendLabel:S="Resend code",resendDisabled:F=!1,resendHint:g,footer:N,onVerify:$,onResend:P,children:D,...x})=>{let T=v=>{v.preventDefault();let B=new FormData(v.currentTarget);$?.({code:k(B,"code")})};return(0,o.jsxs)(p,{...x,parts:{root:i("verification-page","root",x.className),panel:i("verification-page","panel"),title:i("verification-page","title"),error:i("verification-page","error"),footer:i("verification-page","footer")},title:t,error:r,footer:N,children:[e?(0,o.jsx)(s.Text,{as:"p",tone:"muted",...i("verification-page","description"),children:e}):null,(0,o.jsxs)(s.Form,{onSubmit:T,...i("verification-page","form"),children:[(0,o.jsxs)(s.Fieldset,{...i("verification-page","field"),children:[(0,o.jsx)(h.FieldLabel,{children:a}),(0,o.jsx)(s.PinInput,{"aria-label":a,name:"code",required:!0,otp:!0,length:d,value:f,defaultValue:y,onValueChange:R,...i("verification-page","code")})]}),D,(0,o.jsx)(s.Button,{type:"submit",loading:n,disabled:n,...i("verification-page","submit"),children:V})]}),P?(0,o.jsxs)("div",{...i("verification-page","resend"),children:[(0,o.jsx)(s.Button,{type:"button",variant:"ghost",disabled:F,onClick:P,children:S}),g?(0,o.jsx)("span",{...i("verification-page","resend-hint"),children:g}):null]}):null]})};m.displayName="VerificationPage";0&&(module.exports={VerificationPage});
2
+ "use strict";var _=Object.create;var p=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var G=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!z.call(t,a)&&a!==r&&p(t,a,{get:()=>e[a],enumerable:!(n=q(e,a))||n.enumerable});return t};var F=(t,e,r)=>(r=t!=null?_(W(t)):{},y(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)),J=t=>y(p({},"__esModule",{value:!0}),t);var O={};G(O,{VerificationPage:()=>x});module.exports=J(O);var g=F(require("react"),1),s=require("@skdx/react"),P=require("@skdx/react/primitives/field");var S=F(require("react"),1),m=require("@skdx/react"),d=require("react/jsx-runtime"),v=({parts:t,title:e,error:r,footer:n,children:a,...c})=>{let f=S.useId();return(0,d.jsx)("section",{"aria-labelledby":f,...c,...t.root,children:(0,d.jsxs)("div",{...t.panel,children:[(0,d.jsx)(m.Heading,{as:"h1",id:f,...t.title,children:e}),r?(0,d.jsx)(m.Alert,{role:"alert",status:"danger",...t.error,children:r}):null,a,n&&t.footer?(0,d.jsx)("div",{...t.footer,children:n}):null]})})};v.displayName="AuthPanel";function V(t,e){let r=t.get(e);return typeof r=="string"?r:""}function K(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function i(t,e,r){let n=e==="root",a=n?`skdx-${t}`:`skdx-${t}__${e}`,c={className:K(a,r),"data-part":e};return n&&(c["data-skdx-component"]=t),c}var o=require("react/jsx-runtime"),x=({title:t="Enter your verification code",description:e,error:r,pending:n=!1,codeLabel:a="Verification code",length:c=6,value:f,defaultValue:E,onValueChange:N,submitLabel:I="Verify",resendLabel:T="Resend code",resendDisabled:$=!1,resendHint:b,footer:C,onVerify:D,onResend:A,children:H,...R})=>{let h=g.useRef(null),[L,k]=g.useState(""),M=l=>{l.preventDefault();let u=new FormData(l.currentTarget);D?.({code:V(u,"code")})},B=({name:l})=>{if(l!=="code")return;let u=h.current?.elements.namedItem("code");k(u instanceof HTMLInputElement?u.validationMessage:"")};return(0,o.jsxs)(v,{...R,parts:{root:i("verification-page","root",R.className),panel:i("verification-page","panel"),title:i("verification-page","title"),error:i("verification-page","error"),footer:i("verification-page","footer")},title:t,error:r,footer:C,children:[e?(0,o.jsx)(s.Text,{as:"p",tone:"muted",...i("verification-page","description"),children:e}):null,(0,o.jsxs)(s.Form,{ref:l=>{h.current=l},onSubmit:M,onFieldInvalid:B,...i("verification-page","form"),children:[(0,o.jsxs)(s.Fieldset,{errors:L,...i("verification-page","field"),children:[(0,o.jsx)(P.FieldLabel,{children:a}),(0,o.jsx)(s.PinInput,{"aria-label":a,name:"code",required:!0,otp:!0,length:c,value:f,defaultValue:E,onValueChange:l=>{k(""),N?.(l)},...i("verification-page","code")}),(0,o.jsx)(P.FieldError,{})]}),H,(0,o.jsx)(s.Button,{type:"submit",loading:n,disabled:n,...i("verification-page","submit"),children:I})]}),A?(0,o.jsxs)("div",{...i("verification-page","resend"),children:[(0,o.jsx)(s.Button,{type:"button",variant:"ghost",disabled:$,onClick:A,children:T}),b?(0,o.jsx)("span",{...i("verification-page","resend-hint"),children:b}):null]}):null]})};x.displayName="VerificationPage";0&&(module.exports={VerificationPage});
@@ -1,4 +1,4 @@
1
- import type * as React from 'react';
1
+ import * as React from 'react';
2
2
  import type { VerificationPageProps } from './types.cjs';
3
3
  /**
4
4
  * Verification block: a pin input for a one-time code, a submit button reporting
@@ -1,4 +1,4 @@
1
- import type * as React from 'react';
1
+ import * as React from 'react';
2
2
  import type { VerificationPageProps } from './types.js';
3
3
  /**
4
4
  * Verification block: a pin input for a one-time code, a submit button reporting
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{Button as v,Fieldset as E,Form as I,PinInput as H,Text as L}from"@skdx/react";import{FieldLabel as _}from"@skdx/react/primitives/field";import*as P from"react";import{Alert as D,Heading as T}from"@skdx/react";import{jsx as d,jsxs as B}from"react/jsx-runtime";var c=({parts:t,title:e,error:r,footer:a,children:o,...n})=>{let l=P.useId();return d("section",{"aria-labelledby":l,...n,...t.root,children:B("div",{...t.panel,children:[d(T,{as:"h1",id:l,...t.title,children:e}),r?d(D,{status:"danger",...t.error,children:r}):null,o,a&&t.footer?d("div",{...t.footer,children:a}):null]})})};c.displayName="AuthPanel";function x(t,e){let r=t.get(e);return typeof r=="string"?r:""}function C(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function i(t,e,r){let a=e==="root",o=a?`skdx-${t}`:`skdx-${t}__${e}`,n={className:C(o,r),"data-part":e};return a&&(n["data-skdx-component"]=t),n}import{jsx as s,jsxs as f}from"react/jsx-runtime";var b=({title:t="Enter your verification code",description:e,error:r,pending:a=!1,codeLabel:o="Verification code",length:n=6,value:l,defaultValue:A,onValueChange:k,submitLabel:h="Verify",resendLabel:y="Resend code",resendDisabled:R=!1,resendHint:u,footer:V,onVerify:S,onResend:p,children:F,...m})=>{let N=g=>{g.preventDefault();let $=new FormData(g.currentTarget);S?.({code:x($,"code")})};return f(c,{...m,parts:{root:i("verification-page","root",m.className),panel:i("verification-page","panel"),title:i("verification-page","title"),error:i("verification-page","error"),footer:i("verification-page","footer")},title:t,error:r,footer:V,children:[e?s(L,{as:"p",tone:"muted",...i("verification-page","description"),children:e}):null,f(I,{onSubmit:N,...i("verification-page","form"),children:[f(E,{...i("verification-page","field"),children:[s(_,{children:o}),s(H,{"aria-label":o,name:"code",required:!0,otp:!0,length:n,value:l,defaultValue:A,onValueChange:k,...i("verification-page","code")})]}),F,s(v,{type:"submit",loading:a,disabled:a,...i("verification-page","submit"),children:h})]}),p?f("div",{...i("verification-page","resend"),children:[s(v,{type:"button",variant:"ghost",disabled:R,onClick:p,children:y}),u?s("span",{...i("verification-page","resend-hint"),children:u}):null]}):null]})};b.displayName="VerificationPage";export{b as VerificationPage};
2
+ import*as p from"react";import{Button as h,Fieldset as _,Form as q,PinInput as w,Text as W}from"@skdx/react";import{FieldError as z,FieldLabel as G}from"@skdx/react/primitives/field";import*as A from"react";import{Alert as H,Heading as L}from"@skdx/react";import{jsx as f,jsxs as M}from"react/jsx-runtime";var m=({parts:t,title:e,error:r,footer:o,children:s,...l})=>{let d=A.useId();return f("section",{"aria-labelledby":d,...l,...t.root,children:M("div",{...t.panel,children:[f(L,{as:"h1",id:d,...t.title,children:e}),r?f(H,{role:"alert",status:"danger",...t.error,children:r}):null,s,o&&t.footer?f("div",{...t.footer,children:o}):null]})})};m.displayName="AuthPanel";function R(t,e){let r=t.get(e);return typeof r=="string"?r:""}function B(...t){let e="";for(let r of t)r&&(e=e?`${e} ${r}`:r);return e}function i(t,e,r){let o=e==="root",s=o?`skdx-${t}`:`skdx-${t}__${e}`,l={className:B(s,r),"data-part":e};return o&&(l["data-skdx-component"]=t),l}import{jsx as n,jsxs as u}from"react/jsx-runtime";var k=({title:t="Enter your verification code",description:e,error:r,pending:o=!1,codeLabel:s="Verification code",length:l=6,value:d,defaultValue:y,onValueChange:F,submitLabel:S="Verify",resendLabel:V="Resend code",resendDisabled:E=!1,resendHint:g,footer:N,onVerify:I,onResend:P,children:T,...v})=>{let x=p.useRef(null),[$,b]=p.useState(""),C=a=>{a.preventDefault();let c=new FormData(a.currentTarget);I?.({code:R(c,"code")})},D=({name:a})=>{if(a!=="code")return;let c=x.current?.elements.namedItem("code");b(c instanceof HTMLInputElement?c.validationMessage:"")};return u(m,{...v,parts:{root:i("verification-page","root",v.className),panel:i("verification-page","panel"),title:i("verification-page","title"),error:i("verification-page","error"),footer:i("verification-page","footer")},title:t,error:r,footer:N,children:[e?n(W,{as:"p",tone:"muted",...i("verification-page","description"),children:e}):null,u(q,{ref:a=>{x.current=a},onSubmit:C,onFieldInvalid:D,...i("verification-page","form"),children:[u(_,{errors:$,...i("verification-page","field"),children:[n(G,{children:s}),n(w,{"aria-label":s,name:"code",required:!0,otp:!0,length:l,value:d,defaultValue:y,onValueChange:a=>{b(""),F?.(a)},...i("verification-page","code")}),n(z,{})]}),T,n(h,{type:"submit",loading:o,disabled:o,...i("verification-page","submit"),children:S})]}),P?u("div",{...i("verification-page","resend"),children:[n(h,{type:"button",variant:"ghost",disabled:E,onClick:P,children:V}),g?n("span",{...i("verification-page","resend-hint"),children:g}):null]}):null]})};k.displayName="VerificationPage";export{k as VerificationPage};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";var Z=Object.create;var w=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var re=(e,t)=>{for(var r in t)w(e,r,{get:t[r],enumerable:!0})},y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ee(t))!oe.call(e,s)&&s!==r&&w(e,s,{get:()=>t[s],enumerable:!(n=j(t,s))||n.enumerable});return e};var x=(e,t,r)=>(r=e!=null?Z(te(e)):{},y(t||!e||!e.__esModule?w(r,"default",{value:e,enumerable:!0}):r,e)),ne=e=>y(w({},"__esModule",{value:!0}),e);var de={};re(de,{WorkspaceSwitcher:()=>b});module.exports=ne(de);var L=x(require("react"),1),N=require("@skdx/react"),i=require("@skdx/react/primitives/command"),m=require("@skdx/react/primitives/popover");function ae(...e){let t="";for(let r of e)r&&(t=t?`${t} ${r}`:r);return t}function a(e,t,r){let n=t==="root",s=n?`skdx-${e}`:`skdx-${e}__${t}`,d={className:ae(s,r),"data-part":t};return n&&(d["data-skdx-component"]=e),d}var I=require("react/jsx-runtime"),g=({part:e,children:t})=>t?(0,I.jsx)("div",{...e,children:t}):null;g.displayName="Region";var W=x(require("react"),1);function k(e,t,r){let[n,s]=W.useState(t),d=e!==void 0;return[d?e:n,f=>{d||s(f),r?.(f)}]}var o=require("react/jsx-runtime");function se(e,t){let r=t.toLowerCase(),n=new Map([[void 0,[]]]);for(let c of e){let u=n.get(c.group);u?u.push(c):n.set(c.group,[c])}let s=c=>r===""||c.id.toLowerCase().includes(r)||c.label.toLowerCase().includes(r)||(c.description?.toLowerCase().includes(r)??!1),d=[];for(let[c,u]of n)u.some(s)&&d.push({heading:c,items:u});return d}function ie({current:e,placeholder:t,renderLeading:r}){return(0,o.jsxs)(o.Fragment,{children:[r&&e?(0,o.jsx)("span",{"aria-hidden":"true",...a("workspace-switcher","leading"),children:r(e)}):null,(0,o.jsx)("span",{...a("workspace-switcher","current"),children:e?.label??t}),e?.description?(0,o.jsx)("span",{...a("workspace-switcher","description"),children:e.description}):null]})}function ce({item:e,selected:t,selectedLabel:r,renderLeading:n}){return(0,o.jsxs)(o.Fragment,{children:[n?(0,o.jsx)("span",{"aria-hidden":"true",...a("workspace-switcher","item-leading"),children:n(e)}):null,(0,o.jsx)("span",{...a("workspace-switcher","item-label"),children:e.label}),e.description?(0,o.jsx)("span",{...a("workspace-switcher","item-description"),children:e.description}):null,t?(0,o.jsx)(N.VisuallyHidden,{children:r}):null]})}var b=({items:e,value:t,defaultValue:r="",onValueChange:n,placeholder:s="Select",label:d,searchLabel:c="Search",searchPlaceholder:u,emptyMessage:f="No results",loadingMessage:T="Loading",loading:A=!1,selectedLabel:O="Current",renderLeading:S,actions:G,trigger:E,open:V,defaultOpen:$=!1,onOpenChange:F,onOpenChangeComplete:D,onEscapeKeyDown:H,onPointerDownOutside:J,onFocusOutside:X,onInteractOutside:_,onOpenAutoFocus:K,onCloseAutoFocus:M,...C})=>{let[h,U]=k(t,r,n),[q,z]=k(V,$,F),[P,R]=L.useState(""),B=e.find(l=>l.id===h),Q=se(e,P),v=l=>{l||R(""),z(l)},Y=l=>{U(l),v(!1)};return(0,o.jsxs)(m.PopoverRoot,{open:q,onOpenChange:v,onOpenChangeComplete:D,modal:"none",children:[(0,o.jsx)(m.PopoverTrigger,{asChild:!0,"aria-label":d,...C,...a("workspace-switcher","root",C.className),children:E??(0,o.jsx)("button",{type:"button",children:(0,o.jsx)(ie,{current:B,placeholder:s,renderLeading:S})})}),(0,o.jsx)(m.PopoverPortal,{children:(0,o.jsxs)(m.PopoverContent,{onEscapeKeyDown:H,onPointerDownOutside:J,onFocusOutside:X,onInteractOutside:_,onOpenAutoFocus:K,onCloseAutoFocus:M,align:"start","aria-label":d??s,...a("workspace-switcher","content"),children:[(0,o.jsxs)(i.Command,{loading:A,search:P,onSearchChange:R,children:[(0,o.jsx)(i.CommandInput,{"aria-label":c,placeholder:u,...a("workspace-switcher","search")}),(0,o.jsx)(i.CommandList,{"aria-label":d??s,...a("workspace-switcher","list"),children:Q.map(l=>(0,o.jsx)(i.CommandGroup,{heading:l.heading,...a("workspace-switcher","group"),children:l.items.map(p=>(0,o.jsx)(i.CommandItem,{value:p.id,keywords:p.description?[p.label,p.description]:[p.label],disabled:p.disabled,onSelect:()=>{Y(p.id)},"data-selected":p.id===h?"":void 0,...a("workspace-switcher","item"),children:(0,o.jsx)(ce,{item:p,selected:p.id===h,selectedLabel:O,renderLeading:S})},p.id))},l.heading??""))}),(0,o.jsx)(i.CommandLoading,{...a("workspace-switcher","loading"),children:T}),(0,o.jsx)(i.CommandEmpty,{...a("workspace-switcher","empty"),children:f})]}),(0,o.jsx)(g,{part:a("workspace-switcher","footer"),children:G})]})})]})};b.displayName="WorkspaceSwitcher";0&&(module.exports={WorkspaceSwitcher});
2
+ "use strict";var ee=Object.create;var g=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var ae=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},W=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of oe(t))!ne.call(e,s)&&s!==r&&g(e,s,{get:()=>t[s],enumerable:!(n=te(t,s))||n.enumerable});return e};var T=(e,t,r)=>(r=e!=null?ee(re(e)):{},W(t||!e||!e.__esModule?g(r,"default",{value:e,enumerable:!0}):r,e)),se=e=>W(g({},"__esModule",{value:!0}),e);var le={};ae(le,{WorkspaceSwitcher:()=>S});module.exports=se(le);var f=T(require("react"),1),O=require("@skdx/react"),i=require("@skdx/react/primitives/command"),m=require("@skdx/react/primitives/popover");function ie(...e){let t="";for(let r of e)r&&(t=t?`${t} ${r}`:r);return t}function a(e,t,r){let n=t==="root",s=n?`skdx-${e}`:`skdx-${e}__${t}`,d={className:ie(s,r),"data-part":t};return n&&(d["data-skdx-component"]=e),d}var N=require("react/jsx-runtime"),b=({part:e,children:t})=>t?(0,N.jsx)("div",{...e,children:t}):null;b.displayName="Region";var A=T(require("react"),1);function R(e,t,r){let[n,s]=A.useState(t),d=e!==void 0;return[d?e:n,h=>{d||s(h),r?.(h)}]}var o=require("react/jsx-runtime");function ce(e,t){let r=t.toLowerCase(),n=new Map([[void 0,[]]]);for(let c of e){let u=n.get(c.group);u?u.push(c):n.set(c.group,[c])}let s=c=>r===""||c.id.toLowerCase().includes(r)||c.label.toLowerCase().includes(r)||(c.description?.toLowerCase().includes(r)??!1),d=[];for(let[c,u]of n)u.some(s)&&d.push({heading:c,items:u});return d}function de({current:e,placeholder:t,renderLeading:r}){return(0,o.jsxs)(o.Fragment,{children:[r&&e?(0,o.jsx)("span",{"aria-hidden":"true",...a("workspace-switcher","leading"),children:r(e)}):null,(0,o.jsx)("span",{...a("workspace-switcher","current"),children:e?.label??t}),e?.description?(0,o.jsx)("span",{...a("workspace-switcher","description"),children:e.description}):null]})}function pe({item:e,selected:t,selectedLabel:r,renderLeading:n}){return(0,o.jsxs)(o.Fragment,{children:[n?(0,o.jsx)("span",{"aria-hidden":"true",...a("workspace-switcher","item-leading"),children:n(e)}):null,(0,o.jsx)("span",{...a("workspace-switcher","item-label"),children:e.label}),e.description?(0,o.jsx)("span",{...a("workspace-switcher","item-description"),children:e.description}):null,t?(0,o.jsx)(O.VisuallyHidden,{children:r}):null]})}var S=({items:e,value:t,defaultValue:r="",onValueChange:n,placeholder:s="Select",label:d,searchLabel:c="Search",searchPlaceholder:u,emptyMessage:h="No results",loadingMessage:E="Loading",loading:G=!1,selectedLabel:V="Current",renderLeading:C,actions:$,trigger:F,open:H,defaultOpen:D=!1,onOpenChange:J,onOpenChangeComplete:M,onEscapeKeyDown:X,onPointerDownOutside:_,onFocusOutside:K,onInteractOutside:U,onOpenAutoFocus:q,onCloseAutoFocus:z,...P})=>{let[k,B]=R(t,r,n),[w,Q]=R(H,D,J),[v,y]=f.useState(""),x=f.useRef(null),I=f.useRef(w);f.useEffect(()=>{w&&!I.current&&x.current?.focus(),I.current=w},[w]);let Y=e.find(l=>l.id===k),Z=ce(e,v),L=l=>{l||y(""),Q(l)},j=l=>{B(l),L(!1)};return(0,o.jsxs)(m.PopoverRoot,{open:w,onOpenChange:L,onOpenChangeComplete:M,modal:"none",children:[(0,o.jsx)(m.PopoverTrigger,{asChild:!0,"aria-label":d,...P,...a("workspace-switcher","root",P.className),children:F??(0,o.jsx)("button",{type:"button",children:(0,o.jsx)(de,{current:Y,placeholder:s,renderLeading:C})})}),(0,o.jsx)(m.PopoverPortal,{children:(0,o.jsxs)(m.PopoverContent,{onEscapeKeyDown:X,onPointerDownOutside:_,onFocusOutside:K,onInteractOutside:U,onOpenAutoFocus:q,onCloseAutoFocus:z,align:"start","aria-label":d??s,...a("workspace-switcher","content"),children:[(0,o.jsxs)(i.Command,{loading:G,search:v,onSearchChange:y,children:[(0,o.jsx)(i.CommandInput,{ref:x,"aria-label":c,placeholder:u,...a("workspace-switcher","search")}),(0,o.jsx)(i.CommandList,{"aria-label":d??s,...a("workspace-switcher","list"),children:Z.map(l=>(0,o.jsx)(i.CommandGroup,{heading:l.heading,...a("workspace-switcher","group"),children:l.items.map(p=>(0,o.jsx)(i.CommandItem,{value:p.id,keywords:p.description?[p.label,p.description]:[p.label],disabled:p.disabled,onSelect:()=>{j(p.id)},"data-selected":p.id===k?"":void 0,...a("workspace-switcher","item"),children:(0,o.jsx)(pe,{item:p,selected:p.id===k,selectedLabel:V,renderLeading:C})},p.id))},l.heading??""))}),(0,o.jsx)(i.CommandLoading,{...a("workspace-switcher","loading"),children:E}),(0,o.jsx)(i.CommandEmpty,{...a("workspace-switcher","empty"),children:h})]}),(0,o.jsx)(b,{part:a("workspace-switcher","footer"),children:$})]})})]})};S.displayName="WorkspaceSwitcher";0&&(module.exports={WorkspaceSwitcher});
@@ -2,8 +2,8 @@ import * as React from 'react';
2
2
  import type { WorkspaceSwitcherProps } from './types.cjs';
3
3
  /**
4
4
  * Switches the active context — workspace, organisation, team, account or
5
- * project — from a searchable, groupable list in a focus-trapped popover, with
6
- * loading, empty and footer regions.
5
+ * project — from a searchable, groupable list in a popover that takes focus onto
6
+ * its search field, with loading, empty and footer regions.
7
7
  *
8
8
  * @example
9
9
  * ```tsx
@@ -2,8 +2,8 @@ import * as React from 'react';
2
2
  import type { WorkspaceSwitcherProps } from './types.js';
3
3
  /**
4
4
  * Switches the active context — workspace, organisation, team, account or
5
- * project — from a searchable, groupable list in a focus-trapped popover, with
6
- * loading, empty and footer regions.
5
+ * project — from a searchable, groupable list in a popover that takes focus onto
6
+ * its search field, with loading, empty and footer regions.
7
7
  *
8
8
  * @example
9
9
  * ```tsx
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import*as R from"react";import{VisuallyHidden as B}from"@skdx/react";import{Command as Q,CommandEmpty as Y,CommandGroup as Z,CommandInput as j,CommandItem as ee,CommandList as te,CommandLoading as oe}from"@skdx/react/primitives/command";import{PopoverContent as re,PopoverPortal as ne,PopoverRoot as ae,PopoverTrigger as se}from"@skdx/react/primitives/popover";function q(...e){let t="";for(let o of e)o&&(t=t?`${t} ${o}`:o);return t}function n(e,t,o){let a=t==="root",p=a?`skdx-${e}`:`skdx-${e}__${t}`,i={className:q(p,o),"data-part":t};return a&&(i["data-skdx-component"]=e),i}import{jsx as z}from"react/jsx-runtime";var w=({part:e,children:t})=>t?z("div",{...e,children:t}):null;w.displayName="Region";import*as P from"react";function h(e,t,o){let[a,p]=P.useState(t),i=e!==void 0;return[i?e:a,m=>{i||p(m),o?.(m)}]}import{Fragment as y,jsx as r,jsxs as u}from"react/jsx-runtime";function ie(e,t){let o=t.toLowerCase(),a=new Map([[void 0,[]]]);for(let s of e){let l=a.get(s.group);l?l.push(s):a.set(s.group,[s])}let p=s=>o===""||s.id.toLowerCase().includes(o)||s.label.toLowerCase().includes(o)||(s.description?.toLowerCase().includes(o)??!1),i=[];for(let[s,l]of a)l.some(p)&&i.push({heading:s,items:l});return i}function ce({current:e,placeholder:t,renderLeading:o}){return u(y,{children:[o&&e?r("span",{"aria-hidden":"true",...n("workspace-switcher","leading"),children:o(e)}):null,r("span",{...n("workspace-switcher","current"),children:e?.label??t}),e?.description?r("span",{...n("workspace-switcher","description"),children:e.description}):null]})}function de({item:e,selected:t,selectedLabel:o,renderLeading:a}){return u(y,{children:[a?r("span",{"aria-hidden":"true",...n("workspace-switcher","item-leading"),children:a(e)}):null,r("span",{...n("workspace-switcher","item-label"),children:e.label}),e.description?r("span",{...n("workspace-switcher","item-description"),children:e.description}):null,t?r(B,{children:o}):null]})}var v=({items:e,value:t,defaultValue:o="",onValueChange:a,placeholder:p="Select",label:i,searchLabel:s="Search",searchPlaceholder:l,emptyMessage:m="No results",loadingMessage:x="Loading",loading:I=!1,selectedLabel:W="Current",renderLeading:g,actions:L,trigger:N,open:T,defaultOpen:A=!1,onOpenChange:O,onOpenChangeComplete:G,onEscapeKeyDown:E,onPointerDownOutside:V,onFocusOutside:$,onInteractOutside:F,onOpenAutoFocus:D,onCloseAutoFocus:H,...k})=>{let[f,J]=h(t,o,a),[X,_]=h(T,A,O),[b,S]=R.useState(""),K=e.find(d=>d.id===f),M=ie(e,b),C=d=>{d||S(""),_(d)},U=d=>{J(d),C(!1)};return u(ae,{open:X,onOpenChange:C,onOpenChangeComplete:G,modal:"none",children:[r(se,{asChild:!0,"aria-label":i,...k,...n("workspace-switcher","root",k.className),children:N??r("button",{type:"button",children:r(ce,{current:K,placeholder:p,renderLeading:g})})}),r(ne,{children:u(re,{onEscapeKeyDown:E,onPointerDownOutside:V,onFocusOutside:$,onInteractOutside:F,onOpenAutoFocus:D,onCloseAutoFocus:H,align:"start","aria-label":i??p,...n("workspace-switcher","content"),children:[u(Q,{loading:I,search:b,onSearchChange:S,children:[r(j,{"aria-label":s,placeholder:l,...n("workspace-switcher","search")}),r(te,{"aria-label":i??p,...n("workspace-switcher","list"),children:M.map(d=>r(Z,{heading:d.heading,...n("workspace-switcher","group"),children:d.items.map(c=>r(ee,{value:c.id,keywords:c.description?[c.label,c.description]:[c.label],disabled:c.disabled,onSelect:()=>{U(c.id)},"data-selected":c.id===f?"":void 0,...n("workspace-switcher","item"),children:r(de,{item:c,selected:c.id===f,selectedLabel:W,renderLeading:g})},c.id))},d.heading??""))}),r(oe,{...n("workspace-switcher","loading"),children:x}),r(Y,{...n("workspace-switcher","empty"),children:m})]}),r(w,{part:n("workspace-switcher","footer"),children:L})]})})]})};v.displayName="WorkspaceSwitcher";export{v as WorkspaceSwitcher};
2
+ import*as u from"react";import{VisuallyHidden as Y}from"@skdx/react";import{Command as Z,CommandEmpty as j,CommandGroup as ee,CommandInput as te,CommandItem as oe,CommandList as re,CommandLoading as ne}from"@skdx/react/primitives/command";import{PopoverContent as ae,PopoverPortal as se,PopoverRoot as ie,PopoverTrigger as ce}from"@skdx/react/primitives/popover";function B(...e){let t="";for(let o of e)o&&(t=t?`${t} ${o}`:o);return t}function n(e,t,o){let a=t==="root",p=a?`skdx-${e}`:`skdx-${e}__${t}`,i={className:B(p,o),"data-part":t};return a&&(i["data-skdx-component"]=e),i}import{jsx as Q}from"react/jsx-runtime";var g=({part:e,children:t})=>t?Q("div",{...e,children:t}):null;g.displayName="Region";import*as x from"react";function k(e,t,o){let[a,p]=x.useState(t),i=e!==void 0;return[i?e:a,w=>{i||p(w),o?.(w)}]}import{Fragment as L,jsx as r,jsxs as f}from"react/jsx-runtime";function de(e,t){let o=t.toLowerCase(),a=new Map([[void 0,[]]]);for(let s of e){let l=a.get(s.group);l?l.push(s):a.set(s.group,[s])}let p=s=>o===""||s.id.toLowerCase().includes(o)||s.label.toLowerCase().includes(o)||(s.description?.toLowerCase().includes(o)??!1),i=[];for(let[s,l]of a)l.some(p)&&i.push({heading:s,items:l});return i}function pe({current:e,placeholder:t,renderLeading:o}){return f(L,{children:[o&&e?r("span",{"aria-hidden":"true",...n("workspace-switcher","leading"),children:o(e)}):null,r("span",{...n("workspace-switcher","current"),children:e?.label??t}),e?.description?r("span",{...n("workspace-switcher","description"),children:e.description}):null]})}function le({item:e,selected:t,selectedLabel:o,renderLeading:a}){return f(L,{children:[a?r("span",{"aria-hidden":"true",...n("workspace-switcher","item-leading"),children:a(e)}):null,r("span",{...n("workspace-switcher","item-label"),children:e.label}),e.description?r("span",{...n("workspace-switcher","item-description"),children:e.description}):null,t?r(Y,{children:o}):null]})}var I=({items:e,value:t,defaultValue:o="",onValueChange:a,placeholder:p="Select",label:i,searchLabel:s="Search",searchPlaceholder:l,emptyMessage:w="No results",loadingMessage:W="Loading",loading:T=!1,selectedLabel:N="Current",renderLeading:b,actions:A,trigger:O,open:E,defaultOpen:G=!1,onOpenChange:V,onOpenChangeComplete:$,onEscapeKeyDown:F,onPointerDownOutside:H,onFocusOutside:D,onInteractOutside:J,onOpenAutoFocus:M,onCloseAutoFocus:X,...R})=>{let[h,_]=k(t,o,a),[m,K]=k(E,G,V),[S,C]=u.useState(""),P=u.useRef(null),v=u.useRef(m);u.useEffect(()=>{m&&!v.current&&P.current?.focus(),v.current=m},[m]);let U=e.find(d=>d.id===h),q=de(e,S),y=d=>{d||C(""),K(d)},z=d=>{_(d),y(!1)};return f(ie,{open:m,onOpenChange:y,onOpenChangeComplete:$,modal:"none",children:[r(ce,{asChild:!0,"aria-label":i,...R,...n("workspace-switcher","root",R.className),children:O??r("button",{type:"button",children:r(pe,{current:U,placeholder:p,renderLeading:b})})}),r(se,{children:f(ae,{onEscapeKeyDown:F,onPointerDownOutside:H,onFocusOutside:D,onInteractOutside:J,onOpenAutoFocus:M,onCloseAutoFocus:X,align:"start","aria-label":i??p,...n("workspace-switcher","content"),children:[f(Z,{loading:T,search:S,onSearchChange:C,children:[r(te,{ref:P,"aria-label":s,placeholder:l,...n("workspace-switcher","search")}),r(re,{"aria-label":i??p,...n("workspace-switcher","list"),children:q.map(d=>r(ee,{heading:d.heading,...n("workspace-switcher","group"),children:d.items.map(c=>r(oe,{value:c.id,keywords:c.description?[c.label,c.description]:[c.label],disabled:c.disabled,onSelect:()=>{z(c.id)},"data-selected":c.id===h?"":void 0,...n("workspace-switcher","item"),children:r(le,{item:c,selected:c.id===h,selectedLabel:N,renderLeading:b})},c.id))},d.heading??""))}),r(ne,{...n("workspace-switcher","loading"),children:W}),r(j,{...n("workspace-switcher","empty"),children:w})]}),r(g,{part:n("workspace-switcher","footer"),children:A})]})})]})};I.displayName="WorkspaceSwitcher";export{I as WorkspaceSwitcher};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skdx/react-blocks",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "description": "React blocks for the SkandaDX design system — page-level compositions of @skdx/react styled by @skdx/skins",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -255,7 +255,7 @@
255
255
  "peerDependencies": {
256
256
  "react": "^19.0.0",
257
257
  "react-dom": "^19.0.0",
258
- "@skdx/react": "^0.38.0"
258
+ "@skdx/react": "^0.39.0"
259
259
  },
260
260
  "devDependencies": {
261
261
  "@testing-library/jest-dom": "^6.9.1",
@@ -273,8 +273,8 @@
273
273
  "tsup": "^8.5.1",
274
274
  "typescript": "^6.0.3",
275
275
  "vitest": "^4.1.10",
276
- "@skdx/react": "0.38.0",
277
- "@skdx/shared": "0.38.0"
276
+ "@skdx/react": "0.39.0",
277
+ "@skdx/shared": "0.39.0"
278
278
  },
279
279
  "scripts": {
280
280
  "lint": "eslint . --cache --cache-location node_modules/.cache/eslint/",