@skdx/react-blocks 0.35.0 → 0.36.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 B=Object.create;var c=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var _=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},b=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of E(e))!H.call(t,a)&&a!==r&&c(t,a,{get:()=>e[a],enumerable:!(o=C(e,a))||o.enumerable});return t};var q=(t,e,r)=>(r=t!=null?B(I(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");var A=q(require("react"),1),u=require("@skdx/react"),l=require("react/jsx-runtime"),p=({parts:t,title:e,error:r,footer:o,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,o&&t.footer?(0,l.jsx)("div",{...t.footer,children:o}):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 o=e==="root",a=o?`skdx-${t}`:`skdx-${t}__${e}`,d={className:M(a,r),"data-part":e};return o&&(d["data-skdx-component"]=t),d}var n=require("react/jsx-runtime"),m=({title:t="Enter your verification code",description:e,error:r,pending:o=!1,codeLabel:a="Verification code",length:d=6,value:f,defaultValue:h,onValueChange:y,submitLabel:R="Verify",resendLabel:V="Resend code",resendDisabled:S=!1,resendHint:g,footer:N,onVerify:F,onResend:P,children:$,...x})=>{let D=v=>{v.preventDefault();let T=new FormData(v.currentTarget);F?.({code:k(T,"code")})};return(0,n.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,n.jsx)(s.Text,{as:"p",tone:"muted",...i("verification-page","description"),children:e}):null,(0,n.jsxs)(s.Form,{onSubmit:D,...i("verification-page","form"),children:[(0,n.jsx)(s.Field,{label:a,...i("verification-page","field"),children:(0,n.jsx)(s.PinInput,{"aria-label":a,name:"code",required:!0,otp:!0,length:d,value:f,defaultValue:h,onValueChange:y,...i("verification-page","code")})}),$,(0,n.jsx)(s.Button,{type:"submit",loading:o,disabled:o,...i("verification-page","submit"),children:R})]}),P?(0,n.jsxs)("div",{...i("verification-page","resend"),children:[(0,n.jsx)(s.Button,{type:"button",variant:"ghost",disabled:S,onClick:P,children:V}),g?(0,n.jsx)("span",{...i("verification-page","resend-hint"),children:g}):null]}):null]})};m.displayName="VerificationPage";0&&(module.exports={VerificationPage});
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});
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{Button as v,Field as E,Form as I,PinInput as H,Text as _}from"@skdx/react";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 f=({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]})})};f.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 c}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:N,...m})=>{let F=g=>{g.preventDefault();let $=new FormData(g.currentTarget);S?.({code:x($,"code")})};return c(f,{...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(_,{as:"p",tone:"muted",...i("verification-page","description"),children:e}):null,c(I,{onSubmit:F,...i("verification-page","form"),children:[s(E,{label:o,...i("verification-page","field"),children:s(H,{"aria-label":o,name:"code",required:!0,otp:!0,length:n,value:l,defaultValue:A,onValueChange:k,...i("verification-page","code")})}),N,s(v,{type:"submit",loading:a,disabled:a,...i("verification-page","submit"),children:h})]}),p?c("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{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};
@@ -27,7 +27,7 @@ export interface VerificationPageProps extends React.ComponentPropsWithRef<'sect
27
27
  */
28
28
  pending?: boolean | undefined;
29
29
  /**
30
- * Field label and accessible name of the derived pin input holding the code.
30
+ * Legend of the code fieldset and accessible name of the derived pin input holding the code.
31
31
  * @default 'Verification code'
32
32
  */
33
33
  codeLabel?: string | undefined;
@@ -27,7 +27,7 @@ export interface VerificationPageProps extends React.ComponentPropsWithRef<'sect
27
27
  */
28
28
  pending?: boolean | undefined;
29
29
  /**
30
- * Field label and accessible name of the derived pin input holding the code.
30
+ * Legend of the code fieldset and accessible name of the derived pin input holding the code.
31
31
  * @default 'Verification code'
32
32
  */
33
33
  codeLabel?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skdx/react-blocks",
3
- "version": "0.35.0",
3
+ "version": "0.36.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": {
@@ -265,7 +265,7 @@
265
265
  "peerDependencies": {
266
266
  "react": "^19.0.0",
267
267
  "react-dom": "^19.0.0",
268
- "@skdx/react": "^0.35.0"
268
+ "@skdx/react": "^0.36.0"
269
269
  },
270
270
  "devDependencies": {
271
271
  "@testing-library/jest-dom": "^6.9.1",
@@ -283,8 +283,8 @@
283
283
  "tsup": "^8.5.1",
284
284
  "typescript": "^6.0.3",
285
285
  "vitest": "^4.1.10",
286
- "@skdx/shared": "0.35.0",
287
- "@skdx/react": "0.35.0"
286
+ "@skdx/react": "0.36.0",
287
+ "@skdx/shared": "0.36.0"
288
288
  },
289
289
  "scripts": {
290
290
  "lint": "eslint . --cache --cache-location node_modules/.cache/eslint/",