@times-design-system/components-wordpress 1.18.0 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/ad-container/block.json +1 -1
- package/dist/blocks/banner/block.json +1 -1
- package/dist/blocks/banner/render.php +1 -1
- package/dist/blocks/banner/style.css +1 -1
- package/dist/blocks/button/block.json +1 -2
- package/dist/blocks/button/render.php +1 -1
- package/dist/blocks/checkbox/block.json +1 -1
- package/dist/blocks/checkbox-list/block.json +1 -1
- package/dist/blocks/checkbox-list-item/block.json +1 -1
- package/dist/blocks/chip/block.json +1 -1
- package/dist/blocks/chip/style.css +1 -1
- package/dist/blocks/dialog-box/block.json +1 -1
- package/dist/blocks/divider/block.json +1 -1
- package/dist/blocks/dropdown/block.json +1 -1
- package/dist/blocks/dropdown-menu/block.json +1 -1
- package/dist/blocks/grid/block.json +1 -1
- package/dist/blocks/grid-item/block.json +1 -1
- package/dist/blocks/icon/block.json +1 -1
- package/dist/blocks/icon-button/block.json +1 -1
- package/dist/blocks/image/block.json +1 -1
- package/dist/blocks/input/block.json +1 -1
- package/dist/blocks/input-helper-message/block.json +1 -1
- package/dist/blocks/label/block.json +1 -1
- package/dist/blocks/link/block.json +1 -1
- package/dist/blocks/list-item/block.json +1 -1
- package/dist/blocks/switch/block.json +1 -1
- package/dist/blocks/tab/block.json +1 -1
- package/dist/blocks/tab-group/block.json +1 -1
- package/dist/blocks/tag/block.json +1 -1
- package/dist/blocks/text/block.json +1 -1
- package/dist/blocks/toast/block.json +1 -1
- package/dist/blocks/tooltip/block.json +1 -1
- package/dist/blocks-manifest.php +28 -29
- package/dist/editor.asset.php +1 -1
- package/dist/editor.js +1 -1
- package/dist/index.css +2 -2
- package/dist/index.js +0 -1
- package/package.json +4 -4
package/dist/editor.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(x,b,e,t){"use strict";const oe={large:"medium",xlarge:"large"};function de({attributes:u,setAttributes:a}){var E;const{label:l,intent:s,size:r,behaviour:d,isRounded:o,isLoading:n,disabled:c,href:v,target:p,rel:y,type:h,iconLeft:m,iconRight:f,ariaLabel:i,classes:g}=u,$=["tds-button",`tds-button--intent-${s}`,d?`tds-button--behaviour-${d}`:"",o?"tds-button--is-rounded":"",n?"tds-button--loading":"",`tds-button--size-${r}`,g].filter(Boolean).join(" "),T=`utility-button-${(E=oe[r])!=null?E:r}`;return e.createElement("div",b.useBlockProps(),e.createElement("button",{type:"button",className:$,"aria-busy":n||void 0,"aria-label":i||void 0,disabled:c||n},n?e.createElement("span",{className:"tds-button__spinner","aria-hidden":"true"}):e.createElement("span",{className:"tds-button__label-container"},e.createElement("span",{className:`tds-text ${T}`},l))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Button Settings"},e.createElement(t.TextControl,{label:"Label",value:l,onChange:C=>a({label:C}),help:"The text displayed inside the button"}),e.createElement(t.SelectControl,{label:"Intent (Style)",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Negative",value:"negative"}],onChange:C=>a({intent:C})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"},{label:"XLarge",value:"xlarge"}],onChange:C=>a({size:C})}),e.createElement(t.SelectControl,{label:"Behaviour",value:d,options:[{label:"Default",value:""},{label:"Hug Content",value:"hug"},{label:"Full Width",value:"full"}],onChange:C=>a({behaviour:C||void 0})}),e.createElement(t.ToggleControl,{label:"Rounded Corners",checked:o,onChange:C=>a({isRounded:C}),help:"Apply rounded corner styling"}),e.createElement(t.ToggleControl,{label:"Loading",checked:n,onChange:C=>a({isLoading:C}),help:"Show loading state with spinner"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:c,onChange:C=>a({disabled:C})})),e.createElement(t.PanelBody,{title:"Link Settings",initialOpen:!1},e.createElement(t.TextControl,{label:"URL",value:v,onChange:C=>a({href:C}),placeholder:"https://example.com"}),e.createElement(t.SelectControl,{label:"Link Target",value:p,options:[{label:"Default",value:""},{label:"Same Window",value:"_self"},{label:"New Window",value:"_blank"},{label:"Parent Window",value:"_parent"},{label:"Top Window",value:"_top"}],onChange:C=>a({target:C||void 0})}),e.createElement(t.TextControl,{label:"Link Rel",value:y,onChange:C=>a({rel:C}),placeholder:"noopener noreferrer"})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.SelectControl,{label:"Button Type",value:h,options:[{label:"Button",value:"button"},{label:"Submit",value:"submit"},{label:"Reset",value:"reset"}],onChange:C=>a({type:C})}),e.createElement(t.TextControl,{label:"Aria Label",value:i,onChange:C=>a({ariaLabel:C}),help:"Accessible name for icon-only buttons"}),e.createElement(t.TextControl,{label:"Icon Left",value:m,onChange:C=>a({iconLeft:C}),placeholder:"Icon name"}),e.createElement(t.TextControl,{label:"Icon Right",value:f,onChange:C=>a({iconRight:C}),placeholder:"Icon name"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:g,onChange:C=>a({classes:C}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the button element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))))}function ce(){return null}var ue="https://schemas.wp.org/trunk/block.json",pe=3,be="tds/button",he="Button",me="common",ge="A customizable button component for user interactions",ve="admin-generic",ye={html:!1,spacing:{margin:!0,padding:!1},align:!0,customClassName:!0},fe="times-design-system",Ce="file:./render.php",xe={label:{type:"string",default:"Button label",description:"The text label displayed inside the button"},intent:{type:"string",enum:["primary","secondary","negative"],default:"primary",description:"Visual style variant"},size:{type:"string",enum:["small","medium","large","xlarge"],default:"medium",description:"Controls the overall dimensions of the button"},behaviour:{type:"string",enum:["hug","full"],description:"Controls the width behaviour"},isRounded:{type:"boolean",default:!1,description:"Applies rounded corner styling to the button"},isLoading:{type:"boolean",default:!1,description:"Show loading state with spinner and disable interaction"},disabled:{type:"boolean",default:!1,description:"Whether the button is disabled"},href:{type:"string",description:"Optional href to render as a link"},target:{type:"string",enum:["_blank","_self","_parent","_top"],description:"Optional target attribute for links"},rel:{type:"string",description:"Optional rel attribute for links"},type:{type:"string",enum:["button","submit","reset"],default:"button",description:"Button type"},iconLeft:{type:"string",description:"Icon on the left with variant prefix (e.g., 'filled_circle', 'outlined_circle')"},iconRight:{type:"string",description:"Icon on the right with variant prefix (e.g., 'filled_circle', 'outlined_circle')"},ariaLabel:{type:"string",description:"Accessible name for icon-only buttons"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered button/link element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"},onClick:{type:"string",default:"",description:"Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and button element context."}},Se="times-design-system",$e="file:./init.js",Ee="file:./style.css",ke={combinations:[{label:"Primary",intent:"primary"},{label:"Secondary",intent:"secondary"},{label:"Negative",intent:"negative"},{label:"Small",size:"small"},{label:"Medium",size:"medium"},{label:"Large",size:"large"},{label:"XLarge",size:"xlarge"},{label:"Icon Left",iconLeft:"filled_search"},{label:"Icon Right",iconRight:"filled_arrow_right"},{label:"Rounded",isRounded:!0},{label:"Loading",isLoading:!0},{label:"Disabled",disabled:!0},{label:"Full Width",behaviour:"full"},{label:"As Link",href:"https://www.thetimes.com",target:"_blank"}]},_={$schema:ue,apiVersion:pe,name:be,title:he,category:me,description:ge,icon:ve,supports:ye,textdomain:fe,render:Ce,attributes:xe,editorScript:Se,viewScript:$e,style:Ee,preview:ke};x.registerBlockType(_.name,{..._,edit:de,save:ce});var we="https://schemas.wp.org/trunk/block.json",Te=3,Le="tds/divider",_e="Divider",Be="common",Ie="A horizontal or vertical line divider component",Ne="minus",ze={html:!1,spacing:{margin:!0},align:["wide","full"]},Pe="file:./render.php",De={variant:{type:"string",enum:["solid","dashed","dotted"],default:"solid",description:"Line style: dashed for editorial content breaks, solid for structural UI separation"},orientation:{type:"string",enum:["horizontal","vertical"],default:"horizontal",description:"Axis along which the divider is drawn"},padding:{type:"boolean",default:!0,description:"Adds gutter spacing around the line"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered divider element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},je={},Oe="file:./style.css",Re="times-design-system",Ve={combinations:[{variant:"solid"},{variant:"dashed"},{variant:"dotted"},{orientation:"vertical"},{orientation:"vertical",variant:"dashed"},{padding:!1}]},B={$schema:we,apiVersion:Te,name:Le,title:_e,category:Be,description:Ie,icon:Ne,supports:ze,render:Pe,attributes:De,example:je,style:Oe,editorScript:Re,preview:Ve};function We({attributes:u,setAttributes:a}){const{variant:l,orientation:s,padding:r,classes:d}=u,o=["tds-divider",`tds-divider--${s}`,`tds-divider--${l}`,r?"tds-divider--padding":"",d].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{role:"separator","aria-orientation":s,className:o}),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Divider Settings"},e.createElement(t.SelectControl,{label:"Variant",value:l,options:[{label:"Solid",value:"solid"},{label:"Dashed",value:"dashed"},{label:"Dotted",value:"dotted"}],onChange:n=>a({variant:n})}),e.createElement(t.SelectControl,{label:"Orientation",value:s,options:[{label:"Horizontal",value:"horizontal"},{label:"Vertical",value:"vertical"}],onChange:n=>a({orientation:n})}),e.createElement(t.ToggleControl,{label:"Padding",checked:r,onChange:n=>a({padding:n}),help:"Adds gutter spacing around the line"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d,onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the divider element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters."))))}function Me(){return null}x.registerBlockType(B.name,{...B,edit:We,save:Me});var Ue="https://schemas.wp.org/trunk/block.json",He=3,qe="tds/text",Ae="Text",Fe="common",Ge="Typography component for displaying text with style variants",Xe="editor-paragraph",Je={html:!1,spacing:{margin:!0,padding:!1}},Ye="file:./render.php",Ke={as:{type:"string",enum:["h1","h2","h3","h4","h5","h6","p","span","figcaption","blockquote","label","legend","li","dt","dd","time","address","cite","em","strong"],default:"span",description:"HTML element to render"},typographyStyle:{type:"string",enum:["brand.heading.fluid.light.2xsmall","brand.heading.fluid.light.xsmall","brand.heading.fluid.light.small","brand.heading.fluid.light.medium","brand.heading.fluid.light.large","brand.heading.fluid.light.xlarge","brand.heading.fluid.light.2xlarge","brand.heading.fluid.regular.2xsmall","brand.heading.fluid.regular.xsmall","brand.heading.fluid.regular.small","brand.heading.fluid.regular.medium","brand.heading.fluid.regular.large","brand.heading.fluid.regular.xlarge","brand.heading.fluid.regular.2xlarge","brand.heading.fluid.bold.2xsmall","brand.heading.fluid.bold.xsmall","brand.heading.fluid.bold.small","brand.heading.fluid.bold.medium","brand.heading.fluid.bold.large","brand.heading.fluid.bold.xlarge","brand.heading.fluid.bold.2xlarge","brand.heading.fluid.black.2xsmall","brand.heading.fluid.black.xsmall","brand.heading.fluid.black.small","brand.heading.fluid.black.medium","brand.heading.fluid.black.large","brand.heading.fluid.black.xlarge","brand.heading.fluid.black.2xlarge","brand.heading.static.bold.010","brand.heading.static.bold.020","brand.heading.static.bold.030","brand.heading.static.bold.040","brand.heading.static.bold.050","brand.heading.static.bold.060","brand.heading.static.bold.070","brand.heading.static.bold.080","brand.heading.static.bold.090","brand.heading.static.bold.100","brand.heading.static.black.010","brand.heading.static.black.020","brand.heading.static.black.030","brand.heading.static.black.040","brand.heading.static.black.050","brand.heading.static.black.060","brand.heading.static.black.070","brand.heading.static.black.080","brand.heading.static.black.090","brand.heading.static.black.100","brand.subheading.light.xsmall","brand.subheading.light.small","brand.subheading.light.medium","brand.subheading.light.large","brand.subheading.light.xlarge","brand.subheading.regular.xsmall","brand.subheading.regular.small","brand.subheading.regular.medium","brand.subheading.regular.large","brand.subheading.regular.xlarge","brand.subheading.bold.xsmall","brand.subheading.bold.small","brand.subheading.bold.medium","brand.subheading.bold.large","brand.subheading.bold.xlarge","brand.standfirst.medium","brand.standfirst.large","brand.paragraph.regular.small","brand.paragraph.regular.medium","brand.paragraph.bold.small","brand.paragraph.bold.medium","brand.caption.small","brand.caption.medium","brand.byline.small","brand.byline.medium","utility.heading.small","utility.heading.medium","utility.heading.large","utility.subheading.xsmall","utility.subheading.small","utility.subheading.medium","utility.subheading.large","utility.body.regular.2xsmall","utility.body.regular.xsmall","utility.body.regular.small","utility.body.regular.medium","utility.body.regular.large","utility.body.bold.2xsmall","utility.body.bold.xsmall","utility.body.bold.small","utility.body.bold.medium","utility.body.bold.large","utility.button.xsmall","utility.button.small","utility.button.medium","utility.button.large","utility.label.xsmall","utility.label.small","utility.label.medium","utility.label.large","utility.inputLabel.xsmall","utility.inputLabel.small","utility.inputLabel.medium","utility.inputLabel.large"],default:"utility.body.regular.medium",description:"Typography token (dotted), output as a class with dots replaced by dashes"},content:{type:"string",default:"",description:"Text content (React children)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered text element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Ze={},Qe="file:./style.css",et="times-design-system",tt={combinations:[{as:"span",content:"Utility body regular medium"},{as:"h1",typographyStyle:"brand.heading.fluid.bold.2xlarge",content:"Brand heading fluid"},{as:"h2",typographyStyle:"brand.heading.static.black.060",content:"Brand heading static"},{as:"h3",typographyStyle:"brand.subheading.regular.large",content:"Brand subheading"},{as:"blockquote",typographyStyle:"brand.standfirst.large",content:"Brand standfirst"},{as:"p",typographyStyle:"brand.paragraph.regular.medium",content:"Brand paragraph"},{as:"figcaption",typographyStyle:"brand.caption.medium",content:"Brand caption"},{as:"cite",typographyStyle:"brand.byline.medium",content:"Brand byline"},{as:"h4",typographyStyle:"utility.heading.large",content:"Utility heading"},{as:"h5",typographyStyle:"utility.subheading.medium",content:"Utility subheading"},{as:"p",typographyStyle:"utility.body.bold.small",content:"Utility body bold small"},{as:"span",typographyStyle:"utility.button.medium",content:"Utility button"},{as:"label",typographyStyle:"utility.label.medium",content:"Utility label"},{as:"span",typographyStyle:"utility.inputLabel.medium",content:"Utility input label"}]},k={$schema:Ue,apiVersion:He,name:qe,title:Ae,category:Fe,description:Ge,icon:Xe,supports:Je,render:Ye,attributes:Ke,example:Ze,style:Qe,editorScript:et,preview:tt};const at=k.attributes.as.enum.map(u=>({label:u,value:u})),lt=k.attributes.typographyStyle.enum.map(u=>({label:u,value:u}));function it({attributes:u,setAttributes:a}){const{as:l,typographyStyle:s,content:r,classes:d}=u,o=["tds-text",(s||"utility.body.regular.medium").replaceAll(".","-"),d].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement(b.RichText,{tagName:l||"span",className:o,value:r,onChange:n=>a({content:n}),placeholder:"Enter text..."}),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Text Settings"},e.createElement(t.SelectControl,{label:"Element",value:l,options:at,onChange:n=>a({as:n})}),e.createElement(t.SelectControl,{label:"Typography Style",value:s,options:lt,onChange:n=>a({typographyStyle:n})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d,onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the text element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters."))))}function nt(){return null}x.registerBlockType(k.name,{...k,edit:it,save:nt});var rt="https://schemas.wp.org/trunk/block.json",st=3,ot="tds/input",dt="Input",ct="common",ut="Form input field component",pt="text",bt={html:!1,spacing:{margin:!0}},ht="file:./render.php",mt={label:{type:"string",description:"Label text for the input"},placeholder:{type:"string",description:"Input placeholder text"},type:{type:"string",default:"text",enum:["text","email","password","number","tel","url"],description:"Input type"},value:{type:"string",description:"Initial input value"},disabled:{type:"boolean",default:!1,description:"Disabled state"},required:{type:"boolean",default:!1,description:"Required state; adds an asterisk to the label"},name:{type:"string",description:"Input name attribute (also used as the id when id is not set)"},id:{type:"string",description:"Input id attribute"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered input element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},gt={},vt="file:./style.css",yt="times-design-system",ft={combinations:[{label:"Text",name:"text-input",type:"text",placeholder:"Enter text..."},{label:"Email",name:"email-input",type:"email",placeholder:"Enter email..."},{label:"Password",name:"password-input",type:"password",placeholder:"Enter password..."},{label:"Number",name:"number-input",type:"number",placeholder:"Enter a number..."},{label:"Telephone",name:"tel-input",type:"tel",placeholder:"Enter phone number..."},{label:"URL",name:"url-input",type:"url",placeholder:"https://"},{label:"With Value",name:"value-input",value:"Pre-filled value"},{label:"Required",name:"required-input",required:!0,placeholder:"This field is required"},{label:"Disabled",name:"disabled-input",disabled:!0,placeholder:"Disabled"},{name:"no-label-input",placeholder:"No label"}]},I={$schema:rt,apiVersion:st,name:ot,title:dt,category:ct,description:ut,icon:pt,supports:bt,render:ht,attributes:mt,example:gt,style:vt,editorScript:yt,preview:ft};function Ct({attributes:u,setAttributes:a}){const{label:l,placeholder:s,type:r,value:d,disabled:o,required:n,name:c,id:v,classes:p}=u,y=v||c||void 0;return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Input Settings"},e.createElement(t.TextControl,{label:"Label",value:l||"",onChange:h=>a({label:h||void 0})}),e.createElement(t.TextControl,{label:"Placeholder",value:s||"",onChange:h=>a({placeholder:h||void 0})}),e.createElement(t.TextControl,{label:"Value",value:d||"",onChange:h=>a({value:h||void 0}),help:"Initial value"}),e.createElement(t.SelectControl,{label:"Type",value:r,options:[{label:"Text",value:"text"},{label:"Email",value:"email"},{label:"Password",value:"password"},{label:"Number",value:"number"},{label:"Tel",value:"tel"},{label:"URL",value:"url"}],onChange:h=>a({type:h})}),e.createElement(t.TextControl,{label:"Name",value:c||"",onChange:h=>a({name:h||void 0})}),e.createElement(t.TextControl,{label:"ID",value:v||"",onChange:h=>a({id:h||void 0}),help:"Defaults to the name when empty"}),e.createElement(t.ToggleControl,{label:"Required",checked:n,onChange:h=>a({required:h})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:o,onChange:h=>a({disabled:h})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:p,onChange:h=>a({classes:h}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the input element"}))),e.createElement("div",{className:"tds-input-wrapper"},l&&e.createElement("label",{htmlFor:y,className:"tds-input-label utility-label-medium"},l,n&&e.createElement("span",{className:"tds-input-required"},"*")),e.createElement("input",{id:y,type:r,name:c,className:["tds-input --tds-utility-body-regular-medium",p].filter(Boolean).join(" "),placeholder:s,defaultValue:d,disabled:o,required:n,readOnly:!0})))}function xt(){return null}x.registerBlockType(I.name,{...I,edit:Ct,save:xt});var St="https://schemas.wp.org/trunk/block.json",$t=3,Et="tds/icon-button",kt="Icon Button",wt="common",Tt="Button component displaying only an icon",Lt="button",_t={html:!1,spacing:{margin:!0}},Bt="file:./render.php",It={iconName:{type:"string",default:"filled_add",description:"Icon name with variant prefix (e.g., 'filled_add', 'outlined_add')"},intent:{type:"string",enum:["primary","secondary","negative"],default:"primary",description:"Visual style variant matching button intents"},size:{type:"string",enum:["small","medium","large","xlarge"],default:"large",description:"Controls the overall dimensions of the icon button"},isRounded:{type:"boolean",default:!1,description:"Applies rounded corner styling"},isLoading:{type:"boolean",default:!1,description:"Show loading state with spinner and disable interaction"},disabled:{type:"boolean",default:!1,description:"Whether the button is disabled"},type:{type:"string",enum:["button","submit","reset"],default:"button",description:"Button type"},href:{type:"string",description:"Optional href to render as a link"},target:{type:"string",enum:["_blank","_self","_parent","_top"],description:"Optional target attribute for links"},rel:{type:"string",description:"Optional rel attribute for links"},ariaLabel:{type:"string",description:"Accessible name for this icon-only control"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered button/link element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"},onClick:{type:"string",default:"",description:"Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and icon button element context."}},Nt={combinations:[{ariaLabel:"Primary",intent:"primary"},{ariaLabel:"Secondary",intent:"secondary"},{ariaLabel:"Negative",intent:"negative"},{ariaLabel:"Small",size:"small",iconName:"filled_close"},{ariaLabel:"Medium",size:"medium",iconName:"filled_search"},{ariaLabel:"Large",size:"large"},{ariaLabel:"XLarge",size:"xlarge",iconName:"filled_settings"},{ariaLabel:"Rounded",isRounded:!0},{ariaLabel:"Loading",isLoading:!0},{ariaLabel:"Disabled",disabled:!0},{ariaLabel:"As Link",href:"https://www.thetimes.com",target:"_blank"},{ariaLabel:"With onClick",onClick:"handleIconButtonClick"}]},zt={},Pt=["file:./style.css","tds-button-style"],Dt="times-design-system",jt="file:./init.js",N={$schema:St,apiVersion:$t,name:Et,title:kt,category:wt,description:Tt,icon:Lt,supports:_t,render:Bt,attributes:It,preview:Nt,example:zt,style:Pt,editorScript:Dt,viewScript:jt};function Ot({attributes:u,setAttributes:a}){const{iconName:l,intent:s,size:r,isRounded:d,isLoading:o,disabled:n,type:c,href:v,target:p,rel:y,ariaLabel:h,classes:m}=u,f=["tds-button",`tds-button--intent-${s}`,d?"tds-button--is-rounded":"",o?"tds-button--loading":"",`tds-icon-button--size-${r}`,m].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("button",{type:"button",className:f,"aria-busy":o||void 0,"aria-label":h||void 0,disabled:n||o},o?e.createElement("span",{className:"tds-button__spinner","aria-hidden":"true"}):e.createElement("span",{className:"tds-button__icon","aria-hidden":"true"},l)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Icon Button Settings"},e.createElement(t.TextControl,{label:"Icon Name",value:l,onChange:i=>a({iconName:i}),placeholder:"e.g., filled_add"}),e.createElement(t.TextControl,{label:"Aria Label",value:h,onChange:i=>a({ariaLabel:i}),help:"Accessible name for this icon-only control"}),e.createElement(t.SelectControl,{label:"Intent (Style)",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Negative",value:"negative"}],onChange:i=>a({intent:i})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"},{label:"XLarge",value:"xlarge"}],onChange:i=>a({size:i})}),e.createElement(t.ToggleControl,{label:"Rounded",checked:d,onChange:i=>a({isRounded:i})}),e.createElement(t.ToggleControl,{label:"Loading",checked:o,onChange:i=>a({isLoading:i}),help:"Show loading state with spinner"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:n,onChange:i=>a({disabled:i})})),e.createElement(t.PanelBody,{title:"Link Settings",initialOpen:!1},e.createElement(t.TextControl,{label:"URL (leave empty for button)",value:v,onChange:i=>a({href:i}),placeholder:"https://example.com"}),e.createElement(t.SelectControl,{label:"Link Target",value:p,options:[{label:"Default",value:""},{label:"Same Window",value:"_self"},{label:"New Window",value:"_blank"},{label:"Parent Window",value:"_parent"},{label:"Top Window",value:"_top"}],onChange:i=>a({target:i||void 0})}),e.createElement(t.TextControl,{label:"Link Rel",value:y,onChange:i=>a({rel:i}),placeholder:"noopener noreferrer"})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.SelectControl,{label:"Button Type",value:c,options:[{label:"Button",value:"button"},{label:"Submit",value:"submit"},{label:"Reset",value:"reset"}],onChange:i=>a({type:i})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:m,onChange:i=>a({classes:i}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the button/link element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))))}function Rt(){return null}x.registerBlockType(N.name,{...N,edit:Ot,save:Rt});var Vt="https://schemas.wp.org/trunk/block.json",Wt=3,Mt="tds/chip",Ut="Chip",Ht="common",qt="Compact selectable/toggle control for in-page state changes",At="tag",Ft={html:!1,spacing:{margin:!0}},Gt="file:./render.php",Xt={label:{type:"string",description:"Label content"},intent:{type:"string",enum:["primary","secondary"],default:"primary",description:"Visual emphasis style"},size:{type:"string",enum:["small","large"],default:"small",description:"Chip size variant"},channel:{type:"boolean",default:!1,description:"Applies channel color token family"},toggle:{type:"boolean",default:!1,description:"Persistent toggle selection state"},iconLeft:{type:"string",description:"Leading icon with variant prefix (e.g., 'filled_circle')"},iconRight:{type:"string",description:"Trailing icon with variant prefix (e.g., 'outlined_circle')"},ariaLabel:{type:"string",description:"Accessible name (aria-label)"},href:{type:"string",description:"Link target URL. When provided, renders as an anchor element instead of button."},disabled:{type:"boolean",default:!1,description:"Whether the chip button is disabled"},type:{type:"string",enum:["button","submit","reset"],default:"button",description:"Button type"},onClick:{type:"string",default:"",description:"Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and chip element context."},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered chip element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Jt={},Yt="file:./style.css",Kt="times-design-system",Zt="file:./init.js",Qt={combinations:[{label:"Primary Small",intent:"primary",size:"small"},{label:"Primary Large",intent:"primary",size:"large"},{label:"Secondary",intent:"secondary"},{label:"Channel",channel:!0},{label:"Channel Secondary",channel:!0,intent:"secondary"},{label:"Toggle",toggle:!0},{label:"Secondary Toggle",intent:"secondary",toggle:!0},{label:"Icons",iconLeft:"filled_check",iconRight:"filled_close"},{label:"Disabled",disabled:!0},{label:"Link",href:"#"}]},z={$schema:Vt,apiVersion:Wt,name:Mt,title:Ut,category:Ht,description:qt,icon:At,supports:Ft,render:Gt,attributes:Xt,example:Jt,style:Yt,editorScript:Kt,viewScript:Zt,preview:Qt};function ea({attributes:u,setAttributes:a}){const{label:l,intent:s,size:r,channel:d,toggle:o,iconLeft:n,iconRight:c,ariaLabel:v,href:p,disabled:y,type:h,classes:m}=u,f=["tds-chip",`tds-chip--intent-${s}`,`tds-chip--size-${r}`,p?"":`tds-chip--toggle-${o?"off":"on"}`,d?"tds-chip--channel":"",m].filter(Boolean).join(" "),i=e.createElement(e.Fragment,null,n&&e.createElement("span",{className:"tds-chip__icon","aria-hidden":"true"},n),e.createElement("span",{className:`tds-text utility-button-${r} tds-chip__label`},l),c&&e.createElement("span",{className:"tds-chip__icon","aria-hidden":"true"},c));return e.createElement("div",b.useBlockProps(),p?e.createElement("span",{className:f,"aria-label":v||void 0},i):e.createElement("button",{type:"button",className:f,"aria-label":v||void 0,"aria-pressed":o||void 0,disabled:y},i),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Chip Settings"},e.createElement(t.TextControl,{label:"Label",value:l,onChange:g=>a({label:g})}),e.createElement(t.SelectControl,{label:"Intent",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"}],onChange:g=>a({intent:g})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Large",value:"large"}],onChange:g=>a({size:g})}),e.createElement(t.ToggleControl,{label:"Channel",checked:d,onChange:g=>a({channel:g})}),e.createElement(t.ToggleControl,{label:"Toggle",checked:o,onChange:g=>a({toggle:g})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:y,onChange:g=>a({disabled:g})}),e.createElement(t.TextControl,{label:"Left Icon",value:n,onChange:g=>a({iconLeft:g}),placeholder:"e.g., filled_check"}),e.createElement(t.TextControl,{label:"Right Icon",value:c,onChange:g=>a({iconRight:g}),placeholder:"e.g., filled_close"}),e.createElement(t.TextControl,{label:"Aria Label",value:v,onChange:g=>a({ariaLabel:g})})),e.createElement(t.PanelBody,{title:"Link & Advanced",initialOpen:!1},e.createElement(t.TextControl,{label:"URL (renders a link chip)",value:p,onChange:g=>a({href:g}),placeholder:"https://example.com"}),e.createElement(t.SelectControl,{label:"Button Type",value:h,options:[{label:"Button",value:"button"},{label:"Submit",value:"submit"},{label:"Reset",value:"reset"}],onChange:g=>a({type:g})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:m,onChange:g=>a({classes:g}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the chip element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))))}function ta(){return null}x.registerBlockType(z.name,{...z,edit:ea,save:ta});var aa="https://schemas.wp.org/trunk/block.json",la=3,ia="tds/tag",na="Tag",ra="common",sa="Badge or status indicator component",oa="tag",da={html:!1,spacing:{margin:!0}},ca="file:./render.php",ua={label:{type:"string",description:"Visible label text"},intent:{type:"string",enum:["primary","secondary","tertiary"],default:"primary",description:"Visual treatment"},size:{type:"string",enum:["small","medium","large"],default:"medium",description:"Typography size variant"},callout:{type:"boolean",description:"Callout variant"},channel:{type:"boolean",description:"Channel variant"},iconLeft:{type:"string",description:"Icon on the left side of the label, with variant prefix (e.g. 'filled_check')"},iconRight:{type:"string",description:"Icon on the right side of the label, with variant prefix (e.g. 'filled_check')"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered tag element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},pa={},ba="file:./style.css",ha="times-design-system",ma={combinations:[{label:"Primary",intent:"primary"},{label:"Secondary",intent:"secondary"},{label:"Tertiary",intent:"tertiary"},{label:"Small",size:"small"},{label:"Medium",size:"medium"},{label:"Large",size:"large"},{label:"Callout",callout:!0},{label:"Channel",channel:!0},{label:"Icon Left",iconLeft:"filled_check"},{label:"Icon Right",iconRight:"filled_arrow_right"}]},P={$schema:aa,apiVersion:la,name:ia,title:na,category:ra,description:sa,icon:oa,supports:da,render:ca,attributes:ua,example:pa,style:ba,editorScript:ha,preview:ma};const ga={small:"xsmall",large:"medium"};function va({attributes:u,setAttributes:a}){var h;const{label:l,intent:s,size:r,callout:d,channel:o,iconLeft:n,iconRight:c,classes:v}=u,p=["tds-tag",`tds-tag--intent-${s}`,`tds-tag--size-${r}`,d?"tds-tag--callout":"",o?"tds-tag--channel":"",v].filter(Boolean).join(" "),y=`utility-label-${(h=ga[r])!=null?h:"small"}`;return e.createElement("div",b.useBlockProps(),e.createElement("span",{className:p},e.createElement("span",{className:`tds-text ${y} tds-tag__label`},l)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Tag Settings"},e.createElement(t.TextControl,{label:"Label",value:l,onChange:m=>a({label:m})}),e.createElement(t.SelectControl,{label:"Intent",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Tertiary",value:"tertiary"}],onChange:m=>a({intent:m})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"}],onChange:m=>a({size:m})}),e.createElement(t.ToggleControl,{label:"Callout",checked:!!d,onChange:m=>a({callout:m})}),e.createElement(t.ToggleControl,{label:"Channel",checked:!!o,onChange:m=>a({channel:m})}),e.createElement(t.TextControl,{label:"Icon Left",value:n,onChange:m=>a({iconLeft:m}),placeholder:"e.g. filled_check"}),e.createElement(t.TextControl,{label:"Icon Right",value:c,onChange:m=>a({iconRight:m}),placeholder:"e.g. filled_check"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:v,onChange:m=>a({classes:m}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the tag element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters."))))}function ya(){return null}x.registerBlockType(P.name,{...P,edit:va,save:ya});function fa({attributes:u,setAttributes:a}){const{label:l,intent:s,size:r,ariaLabel:d,classes:o}=u,n=["tds-label",`tds-label--intent-${s}`,`utility-label-${r}`,o].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("span",{className:n,"aria-label":d||void 0},l),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Label Settings"},e.createElement(t.TextControl,{label:"Label Text",value:l,onChange:c=>a({label:c}),help:"The text content displayed in the label"}),e.createElement(t.SelectControl,{label:"Intent (Visual Treatment)",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Channel",value:"channel"},{label:"Callout",value:"callout"}],onChange:c=>a({intent:c})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"}],onChange:c=>a({size:c})}),e.createElement(t.TextControl,{label:"Aria Label",value:d,onChange:c=>a({ariaLabel:c}),help:"Optional accessible name for the label"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:o,onChange:c=>a({classes:c}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the label element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters."))))}function Ca(){return null}var xa="https://schemas.wp.org/trunk/block.json",Sa=3,$a="tds/label",Ea="Label",ka="common",wa="A label component used to denote article category, channel, or content type near metadata",Ta="tag",La={html:!1,spacing:{margin:!0,padding:!1},align:!0,customClassName:!0},_a="times-design-system",Ba="file:./render.php",Ia={label:{type:"string",default:"LABEL",description:"The text content displayed in the label"},intent:{type:"string",enum:["primary","secondary","channel","callout"],default:"primary",description:"Visual treatment variant"},size:{type:"string",enum:["small","medium","large"],default:"medium",description:"Typography size variant"},ariaLabel:{type:"string",description:"Optional accessible name for the label"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered label element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Na="times-design-system",za="file:./style.css",Pa={combinations:[{label:"PRIMARY",intent:"primary"},{label:"SECONDARY",intent:"secondary"},{label:"CHANNEL",intent:"channel"},{label:"CALLOUT",intent:"callout"},{label:"SMALL",size:"small"},{label:"MEDIUM",size:"medium"},{label:"LARGE",size:"large"}]},D={$schema:xa,apiVersion:Sa,name:$a,title:Ea,category:ka,description:wa,icon:Ta,supports:La,textdomain:_a,render:Ba,attributes:Ia,editorScript:Na,style:za,preview:Pa};x.registerBlockType(D.name,{...D,edit:fa,save:Ca});var Da="https://schemas.wp.org/trunk/block.json",ja=3,Oa="tds/toast",Ra="Toast",Va="common",Wa="Compact, transient feedback message for low-disruption status updates",Ma="bell",Ua={html:!1,spacing:{margin:!0}},Ha="file:./render.php",qa={intent:{type:"string",enum:["success","info","warning","error"],default:"success",description:"Semantic intent for toast visuals and icon"},label:{type:"string",description:"Primary toast message (nothing renders without it)"},linkHref:{type:"string",description:"Optional inline link URL; the link is shown when set"},linkLabel:{type:"string",default:"Link",description:"Optional link text"},timeout:{type:"number",default:2e3,description:"Auto-dismiss delay in milliseconds (minimum 1500), output as data-timeout"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered toast element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Aa={},Fa=["file:./style.css","tds-link-style"],Ga="times-design-system",Xa={combinations:[{label:"Saved successfully",intent:"success"},{label:"Information",intent:"info"},{label:"Warning",intent:"warning"},{label:"Error occurred",intent:"error"},{label:"Article saved",linkHref:"#",linkLabel:"View"},{label:"With default link label",intent:"info",linkHref:"#"}]},j={$schema:Da,apiVersion:ja,name:Oa,title:Ra,category:Va,description:Wa,icon:Ma,supports:Ua,render:Ha,attributes:qa,example:Aa,style:Fa,editorScript:Ga,preview:Xa};function Ja({attributes:u,setAttributes:a}){const{intent:l,label:s,linkHref:r,linkLabel:d,timeout:o,classes:n}=u,c=["tds-toast",`tds-toast--intent-${l}`,n].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{className:c},e.createElement("span",{className:"tds-toast__icon","aria-hidden":"true"}),e.createElement("span",{className:"tds-text utility-body-regular-medium tds-toast__label"},s||"Add a toast message"),r&&e.createElement("span",{className:"tds-link tds-link--primary tds-link--sentiment-utility tds-link--size-medium tds-toast__link"},e.createElement("span",{className:"tds-link__label"},d))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Toast Settings"},e.createElement(t.TextControl,{label:"Label",value:s||"",onChange:v=>a({label:v}),help:"The toast is not rendered without a label"}),e.createElement(t.SelectControl,{label:"Intent",value:l,options:[{label:"Success",value:"success"},{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}],onChange:v=>a({intent:v})}),e.createElement(t.TextControl,{label:"Link URL",value:r||"",onChange:v=>a({linkHref:v||void 0}),placeholder:"https://example.com",help:"Shows an inline link when set"}),r&&e.createElement(t.TextControl,{label:"Link Label",value:d,onChange:v=>a({linkLabel:v})}),e.createElement(t.TextControl,{label:"Timeout (ms)",type:"number",min:1500,step:500,value:o,onChange:v=>a({timeout:parseInt(v,10)||2e3})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:n,onChange:v=>a({classes:v}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the toast element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))))}function Ya(){return null}x.registerBlockType(j.name,{...j,edit:Ja,save:Ya});var Ka="https://schemas.wp.org/trunk/block.json",Za=3,Qa="tds/link",el="Link",tl="common",al="Styled link component with variants and states",ll="link",il={html:!1,spacing:{margin:!0}},nl="file:./render.php",rl={href:{type:"string",description:"Link destination URL"},label:{type:"string",default:"Link",description:"Link text (React children), rendered inside span.tds-link__label"},intent:{type:"string",default:"primary",enum:["primary","secondary"],description:"Link color and style variant"},sentiment:{type:"string",default:"brand",enum:["brand","utility"],description:"Brand or utility colour treatment"},size:{type:"string",default:"medium",enum:["xsmall","small","medium","large"],description:"Link size variant"},iconLeft:{type:"string",description:"Icon on the left with variant prefix (e.g., 'filled_arrow_left')"},iconRight:{type:"string",description:"Icon on the right with variant prefix (e.g., 'filled_arrow_right')"},inline:{type:"boolean",default:!0,description:"Inline link; false renders the standalone variant"},isDisabled:{type:"boolean",default:!1,description:"Disables the link and prevents navigation"},target:{type:"string",enum:["_self","_blank","_parent","_top"],description:'Link target; _blank adds rel="noopener noreferrer"'},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered link element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"},onClick:{type:"string",default:"",description:"Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and link element context."}},sl={},ol="file:./style.css",dl="times-design-system",cl="file:./init.js",ul={combinations:[{label:"Primary",href:"#",intent:"primary"},{label:"Secondary",href:"#",intent:"secondary"},{label:"Utility",href:"#",sentiment:"utility"},{label:"Utility Secondary",href:"#",sentiment:"utility",intent:"secondary"},{label:"XSmall",href:"#",size:"xsmall"},{label:"Small",href:"#",size:"small"},{label:"Medium",href:"#",size:"medium"},{label:"Large",href:"#",size:"large"},{label:"Icon Left",href:"#",iconLeft:"filled_arrow_left"},{label:"Icon Right",href:"#",iconRight:"filled_arrow_right"},{label:"Standalone",href:"#",inline:!1},{label:"External",href:"https://www.thetimes.com",target:"_blank"},{label:"Disabled",href:"#",isDisabled:!0},{label:"With onClick",href:"#",onClick:"handleLinkClick"}]},O={$schema:Ka,apiVersion:Za,name:Qa,title:el,category:tl,description:al,icon:ll,supports:il,render:nl,attributes:rl,example:sl,style:ol,editorScript:dl,viewScript:cl,preview:ul};function pl({attributes:u,setAttributes:a}){const{href:l,label:s,intent:r,sentiment:d,size:o,iconLeft:n,iconRight:c,inline:v,isDisabled:p,target:y,classes:h,onClick:m}=u,f=["tds-link",`tds-link--${r}`,`tds-link--sentiment-${d}`,`tds-link--size-${o}`,p?"tds-link--is-disabled":"",v?"":"tds-link--standalone",h].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Link Settings"},e.createElement(t.TextControl,{label:"URL",value:l||"",onChange:i=>a({href:i}),type:"url"}),e.createElement(t.SelectControl,{label:"Intent",value:r,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"}],onChange:i=>a({intent:i})}),e.createElement(t.SelectControl,{label:"Sentiment",value:d,options:[{label:"Brand",value:"brand"},{label:"Utility",value:"utility"}],onChange:i=>a({sentiment:i})}),e.createElement(t.SelectControl,{label:"Size",value:o,options:[{label:"XSmall",value:"xsmall"},{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"}],onChange:i=>a({size:i})}),e.createElement(t.TextControl,{label:"Icon Left",value:n||"",onChange:i=>a({iconLeft:i||void 0}),placeholder:"Icon name"}),e.createElement(t.TextControl,{label:"Icon Right",value:c||"",onChange:i=>a({iconRight:i||void 0}),placeholder:"Icon name"}),e.createElement(t.ToggleControl,{label:"Inline",checked:v,onChange:i=>a({inline:i}),help:"Turn off for the standalone variant"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:p,onChange:i=>a({isDisabled:i})}),e.createElement(t.SelectControl,{label:"Target",value:y||"",options:[{label:"Default",value:""},{label:"Same window",value:"_self"},{label:"New window",value:"_blank"},{label:"Parent",value:"_parent"},{label:"Top",value:"_top"}],onChange:i=>a({target:i||void 0})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:h,onChange:i=>a({classes:i}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the link element"}),e.createElement(t.TextControl,{label:"onClick Function",value:m,onChange:i=>a({onClick:i}),placeholder:"myFunction",help:"Name of a global function called on click"}))),e.createElement("a",{href:p?void 0:l||"#",className:f,"aria-disabled":p||void 0,onClick:i=>i.preventDefault()},n&&e.createElement("span",{className:"tds-link__icon","aria-hidden":"true"}),e.createElement(b.RichText,{tagName:"span",className:"tds-link__label",value:s,onChange:i=>a({label:i}),placeholder:"Link text",allowedFormats:[]}),c&&e.createElement("span",{className:"tds-link__icon","aria-hidden":"true"})))}function bl(){return null}x.registerBlockType(O.name,{...O,edit:pl,save:bl});var hl="https://schemas.wp.org/trunk/block.json",ml=3,gl="tds/ad-container",vl="Ad Container",yl="common",fl="Advertising container placeholder",Cl="image",xl={html:!1,spacing:{margin:!0,padding:!0}},Sl="file:./render.php",$l={type:{type:"string",default:"inline",enum:["header","inline"],description:'Ad placement; inline ads show an "Advertisement" label'},slotID:{type:"string",description:"Ad slot element id (inline only; header always uses 'ad-header')"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the ad container element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},El={},kl="file:./style.css",wl="times-design-system",Tl={combinations:[{type:"inline",slotID:"ad-slot-001"},{type:"inline"},{type:"header"}]},R={$schema:hl,apiVersion:ml,name:gl,title:vl,category:yl,description:fl,icon:Cl,supports:xl,render:Sl,attributes:$l,example:El,style:kl,editorScript:wl,preview:Tl};function Ll({attributes:u,setAttributes:a}){const{type:l,slotID:s,classes:r}=u,d=l==="header"?"ad-header":s||void 0;return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Ad Container Settings"},e.createElement(t.SelectControl,{label:"Type",value:l,options:[{label:"Inline",value:"inline"},{label:"Header",value:"header"}],onChange:o=>a({type:o})}),l==="inline"&&e.createElement(t.TextControl,{label:"Slot ID",value:s||"",onChange:o=>a({slotID:o||void 0}),placeholder:"e.g., ad-slot-001",help:"Element id of the ad slot"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:r,onChange:o=>a({classes:o}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the ad container element"}))),e.createElement("div",{className:[`ad-${l}-container`,r].filter(Boolean).join(" ")},l==="inline"&&e.createElement("span",{className:"tds-text utility-body-regular-medium ad-label"},"Advertisement"),e.createElement("div",{className:`ad-${l}-wrapper`},e.createElement("div",null,e.createElement("p",{style:{fontSize:"12px",color:"#666",margin:0}},"Ad slot: ",d||"(not configured)")))))}function _l(){return null}x.registerBlockType(R.name,{...R,edit:Ll,save:_l});function Bl({attributes:u,setAttributes:a}){const{size:l,active:s,channel:r,leftIcon:d,rightIcon:o,label:n,id:c,panelId:v,disabled:p,classes:y}=u,h=["tds-tab",`tds-tab--size-${l}`,`tds-tab--active-${!!s}`,`tds-tab--channel-${!!r}`,y].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("button",{type:"button",role:"tab","aria-selected":!!s,tabIndex:s?0:-1,className:h,disabled:p},d&&e.createElement("span",{className:"tds-tab__icon","aria-hidden":"true"},d),e.createElement("span",{className:`tds-text utility-label-${l} tds-tab__label`},n),o&&e.createElement("span",{className:"tds-tab__icon","aria-hidden":"true"},o)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Tab Settings"},e.createElement(t.TextControl,{label:"Label",value:n||"",onChange:m=>a({label:m})}),e.createElement(t.SelectControl,{label:"Size",value:l,options:[{label:"Medium",value:"medium"},{label:"Large",value:"large"}],onChange:m=>a({size:m})}),e.createElement(t.ToggleControl,{label:"Active",checked:!!s,onChange:m=>a({active:m}),help:"Inside a Tab Group the selected tab is set by the group's Default Selected Index"}),e.createElement(t.ToggleControl,{label:"Channel",checked:!!r,onChange:m=>a({channel:m}),help:"Apply the channel colour token family"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!p,onChange:m=>a({disabled:m})}),e.createElement(t.TextControl,{label:"Left Icon",value:d||"",onChange:m=>a({leftIcon:m||void 0}),placeholder:"Icon name"}),e.createElement(t.TextControl,{label:"Right Icon",value:o||"",onChange:m=>a({rightIcon:m||void 0}),placeholder:"Icon name"})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.TextControl,{label:"Tab ID",value:c||"",onChange:m=>a({id:m||void 0})}),e.createElement(t.TextControl,{label:"Panel ID",value:v||"",onChange:m=>a({panelId:m||void 0}),help:"Id of the panel this tab controls (aria-controls)"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:y||"",onChange:m=>a({classes:m}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the tab element"}))))}function Il(){return null}var Nl="https://schemas.wp.org/trunk/block.json",zl=3,Pl="tds/tab",Dl="Times Design System - Tab",jl="common",Ol="Single tab inside a TabGroup",Rl="block-default",Vl=["tds/tab-group"],Wl={html:!1,multiple:!0,reusable:!0,customClassName:!0},Ml="times-blocks",Ul={size:{type:"string",enum:["medium","large"],default:"medium",description:"Tab size variant"},active:{type:"boolean",default:!1,description:"Whether the tab is the selected tab in its group (TabGroup overrides this from defaultSelectedIndex)"},channel:{type:"boolean",default:!1,description:"Applies channel color token family"},leftIcon:{type:"string",description:"Leading icon name with variant prefix (e.g. 'filled_circle')"},rightIcon:{type:"string",description:"Trailing icon name with variant prefix (e.g. 'filled_circle')"},label:{type:"string",description:"Visible label"},id:{type:"string",description:"Optional id for aria-controls relationships"},panelId:{type:"string",description:"Id of the panel this tab controls"},disabled:{type:"boolean",default:!1,description:"Whether the tab is disabled"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered tab element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Hl="file:./render.php",ql="file:./style.css",Al="times-design-system",Fl={combinations:[{label:"Default"},{label:"Active",active:!0},{label:"Large",size:"large"},{label:"Large active",size:"large",active:!0},{label:"Channel",channel:!0},{label:"Channel active",channel:!0,active:!0},{label:"Left icon",leftIcon:"filled_circle"},{label:"Right icon",rightIcon:"filled_circle"},{label:"Disabled",disabled:!0}]},V={$schema:Nl,apiVersion:zl,name:Pl,title:Dl,category:jl,description:Ol,icon:Rl,parent:Vl,supports:Wl,textdomain:Ml,attributes:Ul,render:Hl,style:ql,editorScript:Al,preview:Fl};x.registerBlockType(V.name,{...V,edit:Bl,save:Il});const Gl=["tds/tab"],Xl=[["tds/tab",{label:"Tab 1"}],["tds/tab",{label:"Tab 2"}]];function Jl({attributes:u,setAttributes:a}){const{behaviour:l,defaultSelectedIndex:s,ariaLabel:r,id:d,classes:o}=u,n=["tds-tab-group",`tds-tab-group--behaviour-${l==="100%"?"fill":"hug"}`,o].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{role:"tablist","aria-orientation":"horizontal","aria-label":r||void 0,className:n},e.createElement(b.InnerBlocks,{allowedBlocks:Gl,template:Xl,orientation:"horizontal"})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Tab Group Settings"},e.createElement(t.SelectControl,{label:"Behaviour",value:l,options:[{label:"Hug content",value:"hug"},{label:"Fill container (100%)",value:"100%"}],onChange:c=>a({behaviour:c})}),e.createElement(t.RangeControl,{label:"Default Selected Index",value:s,onChange:c=>a({defaultSelectedIndex:c!=null?c:0}),min:0,max:20,help:"Zero-based index of the initially selected tab"}),e.createElement(t.TextControl,{label:"Aria Label",value:r||"",onChange:c=>a({ariaLabel:c||void 0}),help:"Accessible name for the tablist"}),e.createElement(t.TextControl,{label:"ID",value:d||"",onChange:c=>a({id:c||void 0})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:o||"",onChange:c=>a({classes:c}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the tab group element"}))))}function Yl(){return e.createElement(b.InnerBlocks.Content,null)}var Kl="https://schemas.wp.org/trunk/block.json",Zl=3,Ql="tds/tab-group",ei="Times Design System - TabGroup",ti="common",ai="Tablist container that manages selection and keyboard navigation across Tab children",li="block-default",ii={html:!1,multiple:!0,reusable:!0,customClassName:!0},ni="times-blocks",ri={behaviour:{type:"string",enum:["hug","100%"],default:"hug",description:"Sizing behaviour: hug content or fill the container (100%)"},defaultSelectedIndex:{type:"number",default:0,description:"Index of the initially selected tab"},ariaLabel:{type:"string",description:"Accessible label for the tablist"},id:{type:"string",description:"Optional id for the tablist root"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered tab group element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},si="file:./render.php",oi="file:./style.css",di="times-design-system",ci="file:./init.js",ui={combinations:[{ariaLabel:"Sections",innerBlocks:[{block:"tab",attributes:{label:"Overview"}},{block:"tab",attributes:{label:"Details"}},{block:"tab",attributes:{label:"Settings"}}]},{ariaLabel:"Sections",defaultSelectedIndex:1,innerBlocks:[{block:"tab",attributes:{label:"Overview"}},{block:"tab",attributes:{label:"Details"}},{block:"tab",attributes:{label:"Disabled",disabled:!0}}]},{ariaLabel:"Sections",behaviour:"100%",innerBlocks:[{block:"tab",attributes:{label:"News",leftIcon:"filled_circle"}},{block:"tab",attributes:{label:"Sport",leftIcon:"filled_circle"}},{block:"tab",attributes:{label:"Culture",leftIcon:"filled_circle"}}]},{ariaLabel:"Sections",innerBlocks:[{block:"tab",attributes:{label:"Overview",size:"large",channel:!0}},{block:"tab",attributes:{label:"Details",size:"large",channel:!0}}]}]},W={$schema:Kl,apiVersion:Zl,name:Ql,title:ei,category:ti,description:ai,icon:li,supports:ii,textdomain:ni,attributes:ri,render:si,style:oi,editorScript:di,viewScript:ci,preview:ui};x.registerBlockType(W.name,{...W,edit:Jl,save:Yl});function M({title:u,value:a={},onChange:l}){const s=(r,d)=>{const o={...a,[r]:d||void 0};l(o.label?o:void 0)};return e.createElement(t.PanelBody,{title:u,initialOpen:!1},e.createElement(t.TextControl,{label:"Label",value:a.label||"",onChange:r=>s("label",r),help:"Leave empty to hide the button"}),e.createElement(t.TextControl,{label:"URL",value:a.href||"",onChange:r=>s("href",r)}),e.createElement(t.TextControl,{label:"onClick function name",value:a.onClick||"",onChange:r=>s("onClick",r)}))}function U({intent:u,cta:a}){return a!=null&&a.label?e.createElement("button",{type:"button",className:`tds-button tds-button--intent-${u} tds-button--size-small`},e.createElement("span",{className:"tds-button__label-container"},e.createElement("span",{className:"tds-text utility-button-small"},a.label))):null}function pi({attributes:u,setAttributes:a}){const{title:l,primaryCTA:s,secondaryCTA:r,isOpen:d,dismiss:o,hideOverlay:n,disableOverlayDismiss:c,disableEscDismiss:v,role:p,id:y,content:h,classes:m}=u,f=["tds-dialog-box",n?"tds-dialog-box--no-overlay":"",m].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),!d&&e.createElement("p",{style:{fontSize:"12px",color:"#666"}},"Dialog is closed (isOpen is off) and renders nothing on the frontend."),e.createElement("div",{className:f,style:{position:"relative",zIndex:0}},e.createElement("div",{className:"tds-dialog-box__overlay","aria-hidden":"true"}),e.createElement("div",{className:"tds-dialog-box__surface",role:p,"aria-modal":"true"},e.createElement("div",{className:"tds-dialog-box__header"},e.createElement("span",{className:"tds-text brand-heading-fluid-regular-small"},l),o&&e.createElement("button",{type:"button",className:"tds-button tds-button--intent-secondary tds-icon-button--size-small tds-dialog-box__dismiss","aria-label":"Dismiss"},e.createElement("span",{className:"tds-button__icon","aria-hidden":"true"},"\xD7"))),e.createElement("div",{className:"tds-dialog-box__content"},h&&e.createElement("div",{dangerouslySetInnerHTML:{__html:h}}),e.createElement(b.InnerBlocks,null)),e.createElement("div",{className:"tds-dialog-box__footer"},e.createElement(U,{intent:"secondary",cta:r}),e.createElement(U,{intent:"primary",cta:s})))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Dialog Settings"},e.createElement(t.ToggleControl,{label:"Open",checked:!!d,onChange:i=>a({isOpen:i})}),e.createElement(t.TextControl,{label:"Title",value:l||"",onChange:i=>a({title:i})}),e.createElement(t.TextareaControl,{label:"Content",value:h,onChange:i=>a({content:i}),help:"Inner blocks are rendered after this content"}),e.createElement(t.ToggleControl,{label:"Dismiss button",checked:!!o,onChange:i=>a({dismiss:i})}),e.createElement(t.SelectControl,{label:"Role",value:p,options:[{label:"Dialog",value:"dialog"},{label:"Alert dialog",value:"alertdialog"}],onChange:i=>a({role:i})}),e.createElement(t.ToggleControl,{label:"Hide overlay",checked:n,onChange:i=>a({hideOverlay:i})}),e.createElement(t.ToggleControl,{label:"Disable overlay dismiss",checked:c,onChange:i=>a({disableOverlayDismiss:i})}),e.createElement(t.ToggleControl,{label:"Disable Escape dismiss",checked:v,onChange:i=>a({disableEscDismiss:i})})),e.createElement(M,{title:"Primary CTA",value:s,onChange:i=>a({primaryCTA:i})}),e.createElement(M,{title:"Secondary CTA",value:r,onChange:i=>a({secondaryCTA:i})}),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"ID",value:y||"",onChange:i=>a({id:i||void 0})}),e.createElement(t.TextControl,{label:"Custom Classes",value:m,onChange:i=>a({classes:i}),placeholder:"class-name-1 class-name-2"}))))}function bi(){return e.createElement(b.InnerBlocks.Content,null)}var hi="https://schemas.wp.org/trunk/block.json",mi=3,gi="tds/dialog-box",vi="Dialog Box",yi="common",fi="Modal dialog with title, content and call-to-action buttons",Ci="welcome-widgets-menus",xi={html:!1,customClassName:!0},Si="times-design-system",$i="file:./render.php",Ei={title:{type:"string",description:"Dialog title"},primaryCTA:{type:"object",properties:{label:{type:"string"},href:{type:"string"},onClick:{type:"string"}},description:"Primary CTA: { label, href?, onClick? } (onClick is a global JS function name)"},secondaryCTA:{type:"object",properties:{label:{type:"string"},href:{type:"string"},onClick:{type:"string"}},description:"Secondary CTA: { label, href?, onClick? } (onClick is a global JS function name)"},isOpen:{type:"boolean",description:"Controls dialog visibility; nothing renders unless true"},dismiss:{type:"boolean",description:"Show the dismiss icon button in the header"},hideOverlay:{type:"boolean",default:!1,description:"Hide the overlay scrim (use only for embedded demos)"},disableOverlayDismiss:{type:"boolean",default:!1,description:"Disable overlay click-to-dismiss"},disableEscDismiss:{type:"boolean",default:!1,description:"Disable ESC-to-dismiss"},role:{type:"string",enum:["dialog","alertdialog"],default:"dialog",description:"Accessible role; use 'alertdialog' for urgent confirmations"},id:{type:"string",description:"Root element id; also used to build the title/body ids (generated when empty)"},content:{type:"string",default:"",description:"Dialog body HTML (WordPress extra; inner blocks are rendered after it)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the dialog root element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},ki="times-design-system",wi="file:./init.js",Ti=["file:./style.css","tds-button-style","tds-icon-button-style"],Li={combinations:[{isOpen:!0,hideOverlay:!0,title:"Confirm action",content:"Are you sure you want to proceed?",primaryCTA:{label:"Confirm"},secondaryCTA:{label:"Cancel"}},{isOpen:!0,hideOverlay:!0,dismiss:!0,title:"Information",content:"This is an informational dialog.",primaryCTA:{label:"Read more",href:"https://www.thetimes.com"}},{isOpen:!0,hideOverlay:!0,role:"alertdialog",disableOverlayDismiss:!0,disableEscDismiss:!0,title:"Delete item",content:"This action cannot be undone.",primaryCTA:{label:"Delete"},secondaryCTA:{label:"Keep"}}]},H={$schema:hi,apiVersion:mi,name:gi,title:vi,category:yi,description:fi,icon:Ci,supports:xi,textdomain:Si,render:$i,attributes:Ei,editorScript:ki,viewScript:wi,style:Ti,preview:Li};x.registerBlockType(H.name,{...H,edit:pi,save:bi});function _i({attributes:u,setAttributes:a}){const{type:l,message:s,id:r,classes:d}=u,o=l||"info";return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Input Helper Message Settings",initialOpen:!0},e.createElement(t.SelectControl,{label:"Type",value:o,options:[{label:"Error",value:"error"},{label:"Success",value:"success"},{label:"Info",value:"info"},{label:"Warning",value:"warning"}],onChange:n=>a({type:n})}),e.createElement(t.TextControl,{label:"Message",value:s||"",onChange:n=>a({message:n}),placeholder:"Enter helper text..."}),e.createElement(t.TextControl,{label:"ID",value:r||"",onChange:n=>a({id:n||void 0}),help:"Reference this id from the input's aria-describedby"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d||"",onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the message element"}))),e.createElement("span",{id:r||void 0,className:["tds-input-helper-message",`tds-input-helper-message--${o}`,d].filter(Boolean).join(" ")},e.createElement("span",{className:"tds-input-helper-message__icon","aria-hidden":"true"}),e.createElement("span",{className:"tds-text utility-body-regular-small"},s)))}function Bi(){return null}var Ii="https://schemas.wp.org/trunk/block.json",Ni=3,zi="tds/input-helper-message",Pi="Input Helper Message",Di="common",ji="Per-field status indicator: a status icon and helper text beneath an input control",Oi="info-outline",Ri={html:!1,multiple:!0,reusable:!0,customClassName:!0},Vi="times-blocks",Wi={type:{type:"string",enum:["error","success","info","warning"],description:"Sets semantic intent, icon variant, and icon colour (falls back to info when unset)"},message:{type:"string",description:"Plain text or text with inline links"},id:{type:"string",description:"Element id, for aria-describedby association from the parent input"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered message element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Mi="file:./render.php",Ui="file:./style.css",Hi="times-design-system",qi={combinations:[{type:"error",message:"This field is required"},{type:"success",message:"Username is available"},{type:"info",message:"Minimum 8 characters"},{type:"warning",message:"Your session will expire soon"},{type:"info",message:'Read our <a href="#">password guidance</a>'}]},q={$schema:Ii,apiVersion:Ni,name:zi,title:Pi,category:Di,description:ji,icon:Oi,supports:Ri,textdomain:Vi,attributes:Wi,render:Mi,style:Ui,editorScript:Hi,preview:qi};x.registerBlockType(q.name,{...q,edit:_i,save:Bi});const Ai={"2xsmall":12,xsmall:16,small:20,medium:24,large:28,xlarge:32,"2xlarge":40};function Fi({attributes:u,setAttributes:a}){const{iconName:l,size:s,sizeName:r,classes:d}=u,o=s||Ai[r]||24;return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Icon Settings",initialOpen:!0},e.createElement(t.TextControl,{label:"Icon Name",value:l||"",onChange:n=>a({iconName:n||void 0}),placeholder:"filled_circle",help:"Icon name with variant prefix (filled_ or outlined_)"}),e.createElement(t.SelectControl,{label:"Size Name",value:r||"",options:[{label:"Default (24px)",value:""},{label:"2XSmall (12px)",value:"2xsmall"},{label:"XSmall (16px)",value:"xsmall"},{label:"Small (20px)",value:"small"},{label:"Medium (24px)",value:"medium"},{label:"Large (28px)",value:"large"},{label:"XLarge (32px)",value:"xlarge"},{label:"2XLarge (40px)",value:"2xlarge"}],onChange:n=>a({sizeName:n||void 0})}),e.createElement(t.__experimentalNumberControl,{label:"Size (px)",value:s!=null?s:"",min:1,onChange:n=>{const c=parseInt(n,10);a({size:c>0?c:void 0})},help:"Overrides Size Name when set"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d||"",onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the svg element"}))),e.createElement("svg",{className:d||void 0,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":l||"No icon selected"},e.createElement("rect",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeDasharray:"2 2"})))}function Gi(){return null}var Xi="https://schemas.wp.org/trunk/block.json",Ji=3,Yi="tds/icon",Ki="Icon",Zi="common",Qi="Inline SVG icon from the Times Design System icon set",en="star-filled",tn={html:!1,multiple:!0,reusable:!0,customClassName:!0},an="times-blocks",ln={iconName:{type:"string",description:"The name of the icon with variant prefix (e.g., 'filled_circle', 'outlined_check')"},size:{type:"number",description:"Icon size in pixels; takes precedence over sizeName"},sizeName:{type:"string",enum:["2xsmall","xsmall","small","medium","large","xlarge","2xlarge"],description:"Named icon size (2xsmall 12px to 2xlarge 40px)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the svg element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},nn="file:./render.php",rn="times-design-system",sn="file:./style.css",on={combinations:[{iconName:"filled_circle"},{iconName:"filled_circle",sizeName:"2xsmall"},{iconName:"filled_circle",sizeName:"xsmall"},{iconName:"filled_circle",sizeName:"small"},{iconName:"filled_circle",sizeName:"medium"},{iconName:"filled_circle",sizeName:"large"},{iconName:"filled_circle",sizeName:"xlarge"},{iconName:"filled_circle",sizeName:"2xlarge"},{iconName:"outlined_check",size:48},{iconName:"filled_arrow_right"}]},A={$schema:Xi,apiVersion:Ji,name:Yi,title:Ki,category:Zi,description:Qi,icon:en,supports:tn,textdomain:an,attributes:ln,render:nn,editorScript:rn,style:sn,preview:on};x.registerBlockType(A.name,{...A,edit:Fi,save:Gi});function F({title:u,value:a,onChange:l}){const s=a||{},r=(d,o)=>{const n={...s,[d]:o};l(n.label?n:void 0)};return e.createElement(t.PanelBody,{title:u,initialOpen:!1},e.createElement(t.TextControl,{label:"Label",value:s.label||"",onChange:d=>r("label",d),placeholder:"Button label..."}),e.createElement(t.TextControl,{label:"URL",value:s.href||"",onChange:d=>r("href",d||void 0),placeholder:"https://example.com"}),e.createElement(t.TextControl,{label:"onClick function name",value:s.onClick||"",onChange:d=>r("onClick",d||void 0),placeholder:"myFunction"}))}function G({cta:u,className:a}){return e.createElement("button",{type:"button",className:`tds-button tds-button--intent-secondary tds-button--size-small ${a}`},e.createElement("span",{className:"tds-button__label-container"},e.createElement("span",{className:"tds-text utility-button-small"},u.label)))}function dn({attributes:u,setAttributes:a}){const{intent:l,heading:s,body:r,dismiss:d,cta_1:o,cta_2:n,classes:c}=u,v=["tds-banner",`tds-banner--${l}`,c].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{className:v},e.createElement("div",{className:"tds-banner__label"},e.createElement("span",{className:"tds-banner__icon","aria-hidden":"true"}),e.createElement("span",{className:"tds-text utility-body-bold-medium tds-banner__heading"},s),d&&e.createElement("button",{type:"button",className:"tds-banner__dismiss","aria-label":"Dismiss"},"\xD7")),e.createElement("p",{className:"tds-text utility-body-regular-medium tds-banner__content"},r),(o||n)&&e.createElement("div",{className:"tds-banner__actions"},o&&e.createElement(G,{cta:o,className:n?"tds-banner__button":"tds-banner__button tds-banner__button--full"}),n&&e.createElement(G,{cta:n,className:"tds-banner__button"}))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Banner Settings",initialOpen:!0},e.createElement(t.SelectControl,{label:"Intent",value:l,options:[{label:"Success",value:"success"},{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}],onChange:p=>a({intent:p})}),e.createElement(t.TextControl,{label:"Heading",value:s||"",onChange:p=>a({heading:p}),placeholder:"Banner heading..."}),e.createElement(t.TextControl,{label:"Body",value:r||"",onChange:p=>a({body:p}),placeholder:"Banner message..."}),e.createElement(t.ToggleControl,{label:"Dismissible",checked:!!d,onChange:p=>a({dismiss:p}),help:"Allow users to dismiss this banner"})),e.createElement(F,{title:"CTA Button 1",value:o,onChange:p=>a({cta_1:p})}),e.createElement(F,{title:"CTA Button 2",value:n,onChange:p=>a({cta_2:p})}),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:c||"",onChange:p=>a({classes:p}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the banner element"}))))}function cn(){return null}var un="https://schemas.wp.org/trunk/block.json",pn=3,bn="tds/banner",hn="Banner",mn="common",gn="Inline status banner with optional dismiss and call-to-action buttons",vn="megaphone",yn={html:!1,multiple:!0,reusable:!0,customClassName:!0},fn="times-design-system",Cn={intent:{type:"string",enum:["success","info","warning","error"],default:"info",description:"Semantic intent controlling colours and icon (required in React)"},heading:{type:"string",description:"The heading text displayed inside the banner"},body:{type:"string",description:"The body text displayed inside the banner"},dismiss:{type:"boolean",description:"Whether the banner can be dismissed by the user"},cta_1:{type:"object",description:"CTA button 1: { label, href?, onClick? } (onClick is a global JS function name)"},cta_2:{type:"object",description:"CTA button 2: { label, href?, onClick? } (onClick is a global JS function name)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the banner element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},xn="file:./render.php",Sn=["file:./style.css","tds-button-style"],$n="times-design-system",En="file:./init.js",kn={combinations:[{intent:"info",heading:"Information",body:"This is an informational banner"},{intent:"success",heading:"Success",body:"Operation completed successfully"},{intent:"warning",heading:"Warning",body:"This is a warning message"},{intent:"error",heading:"Error",body:"An error occurred"},{intent:"info",heading:"Dismissible",body:"This banner can be dismissed",dismiss:!0},{intent:"info",heading:"One action",body:"A single CTA fills the width",cta_1:{label:"Learn more",href:"#"}},{intent:"warning",heading:"Two actions",body:"Two CTAs share the row",dismiss:!0,cta_1:{label:"Accept",href:"#"},cta_2:{label:"Decline",href:"#"}}]},X={$schema:un,apiVersion:pn,name:bn,title:hn,category:mn,description:gn,icon:vn,supports:yn,textdomain:fn,attributes:Cn,render:xn,style:Sn,editorScript:$n,viewScript:En,preview:kn};x.registerBlockType(X.name,{...X,edit:dn,save:cn});function wn({attributes:u,setAttributes:a}){const{direction:l,icon:s,label:r,classes:d}=u,o=["tds-tooltip",`tds-tooltip--direction-${l}`,d].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("span",{className:o},e.createElement("span",{className:"tds-text utility-body-regular-small"},r)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Tooltip Settings"},e.createElement(t.SelectControl,{label:"Direction",value:l,options:[{label:"Up",value:"up"},{label:"Down",value:"down"},{label:"Up Left",value:"up-left"},{label:"Up Right",value:"up-right"},{label:"Down Left",value:"down-left"},{label:"Down Right",value:"down-right"}],onChange:n=>a({direction:n})}),e.createElement(t.TextControl,{label:"Label",value:r||"",onChange:n=>a({label:n}),placeholder:"Enter tooltip text..."}),e.createElement(t.TextControl,{label:"Icon",value:s||"",onChange:n=>a({icon:n}),placeholder:"e.g. filled_info"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d||"",onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the tooltip element"}))))}function Tn(){return null}var Ln="https://schemas.wp.org/trunk/block.json",_n=3,Bn="tds/tooltip",In="Times Design System - Tooltip",Nn="common",zn="Small tooltip bubble with a directional arrow, optional icon and label",Pn="block-default",Dn={html:!1,multiple:!0,reusable:!0,customClassName:!0},jn="times-blocks",On={direction:{type:"string",enum:["up","down","up-left","up-right","down-left","down-right"],default:"up",description:"Direction of the tooltip arrow"},icon:{type:"string",description:"Optional icon name with variant prefix (e.g. 'filled_info')"},label:{type:"string",description:"Visible label text"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the tooltip element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Rn="file:./render.php",Vn="file:./style.css",Wn="times-design-system",Mn={combinations:[{label:"Helpful information",direction:"up"},{label:"Below tooltip",direction:"down"},{label:"Top left",direction:"up-left"},{label:"Top right",direction:"up-right"},{label:"Bottom left",direction:"down-left"},{label:"Bottom right",direction:"down-right"},{label:"With icon",direction:"up",icon:"filled_help"}]},J={$schema:Ln,apiVersion:_n,name:Bn,title:In,category:Nn,description:zn,icon:Pn,supports:Dn,textdomain:jn,attributes:On,render:Rn,style:Vn,editorScript:Wn,preview:Mn};x.registerBlockType(J.name,{...J,edit:wn,save:Tn});function w(){return w=Object.assign?Object.assign.bind():function(u){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var s in l)({}).hasOwnProperty.call(l,s)&&(u[s]=l[s])}return u},w.apply(null,arguments)}const Un=["base","hover","focus","readOnly","disabled","info","success","error","warning"],Hn=["info","success","error","warning"];function L({state:u="base",intent:a="off",checked:l,defaultChecked:s=!1,indeterminate:r,label:d,description:o,statusMessage:n,disabled:c=!1,readOnly:v=!1,className:p}){const y=l!==void 0?!!l:s,h=c||u==="disabled",m=v||u==="readOnly",f=r!==void 0?r:a==="indeterminate",i=Hn.includes(u)?u:void 0;return e.createElement("label",{className:["tds-checkbox",`tds-checkbox--state-${u}`,y&&"tds-checkbox--checked",f&&"tds-checkbox--indeterminate",h&&"tds-checkbox--disabled",m&&"tds-checkbox--readonly",p].filter(Boolean).join(" ")},e.createElement("input",{type:"checkbox",checked:y,disabled:h,readOnly:!0}),e.createElement("span",{className:"tds-checkbox__box","aria-hidden":"true"}),(d||o||n)&&e.createElement("span",{className:"tds-checkbox__content"},d&&e.createElement("span",{className:"tds-checkbox__label"},d),o&&e.createElement("span",{className:"tds-checkbox__description"},o),n&&e.createElement("span",{className:["tds-checkbox__status",i&&`tds-checkbox__status--${i}`].filter(Boolean).join(" ")},n)))}function qn({attributes:u,setAttributes:a}){const{state:l,intent:s,checked:r,defaultChecked:d,indeterminate:o,label:n,description:c,statusMessage:v,id:p,name:y,disabled:h,readOnly:m,ariaLabel:f,classes:i}=u;return e.createElement("div",b.useBlockProps(),e.createElement(L,w({},u,{className:i})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Checkbox Settings"},e.createElement(t.TextControl,{label:"Label",value:n||"",onChange:g=>a({label:g||void 0})}),e.createElement(t.TextControl,{label:"Description",value:c||"",onChange:g=>a({description:g||void 0})}),e.createElement(t.TextControl,{label:"Status message",value:v||"",onChange:g=>a({statusMessage:g||void 0})}),e.createElement(t.SelectControl,{label:"State",value:l,options:Un.map(g=>({label:g,value:g})),onChange:g=>a({state:g})}),e.createElement(t.SelectControl,{label:"Intent",value:s,options:[{label:"Off",value:"off"},{label:"On",value:"on"},{label:"Indeterminate",value:"indeterminate"}],onChange:g=>a({intent:g})}),e.createElement(t.SelectControl,{label:"Checked",value:r===void 0?"":String(r),options:[{label:"Uncontrolled (use default)",value:""},{label:"Checked",value:"true"},{label:"Unchecked",value:"false"}],onChange:g=>a({checked:g===""?void 0:g==="true"})}),e.createElement(t.ToggleControl,{label:"Default checked",checked:!!d,onChange:g=>a({defaultChecked:g})}),e.createElement(t.SelectControl,{label:"Indeterminate",value:o===void 0?"":String(o),options:[{label:"From intent",value:""},{label:"Yes",value:"true"},{label:"No",value:"false"}],onChange:g=>a({indeterminate:g===""?void 0:g==="true"})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!h,onChange:g=>a({disabled:g})}),e.createElement(t.ToggleControl,{label:"Read only",checked:!!m,onChange:g=>a({readOnly:g})})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.TextControl,{label:"Name",value:y||"",onChange:g=>a({name:g||void 0})}),e.createElement(t.TextControl,{label:"ID",value:p||"",onChange:g=>a({id:g||void 0})}),e.createElement(t.TextControl,{label:"Aria label",value:f||"",onChange:g=>a({ariaLabel:g||void 0}),help:"Defaults to the label, then 'Checkbox'"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:i||"",onChange:g=>a({classes:g}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the checkbox label element"}))))}function An(){return null}var Fn="https://schemas.wp.org/trunk/block.json",Gn=3,Xn="tds/checkbox",Jn="Times Design System - Checkbox",Yn="common",Kn="WordPress block for Times Design System Checkbox component",Zn="block-default",Qn={html:!1,multiple:!0,reusable:!0,customClassName:!0},er="times-blocks",tr={checked:{type:"boolean",description:"Controlled checked state (falls back to defaultChecked when unset)"},defaultChecked:{type:"boolean",default:!1,description:"Initial checked state when checked is unset"},indeterminate:{type:"boolean",description:"Indeterminate state (overrides intent when set)"},label:{type:"string",description:"Label text displayed next to the checkbox"},description:{type:"string",description:"Description text displayed below the label"},helperMessage:{type:"string",description:"Helper message"},id:{type:"string",description:"id attribute for the checkbox input"},name:{type:"string",description:"name attribute for the checkbox input"},disabled:{type:"boolean",default:!1,description:"Whether the checkbox is disabled"},readOnly:{type:"boolean",default:!1,description:"Whether the checkbox is read-only"},ariaLabel:{type:"string",description:"Accessible name override (defaults to the label, then 'Checkbox')"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the checkbox element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},ar="file:./render.php",lr="file:./style.css",ir="times-design-system",nr="file:./init.js",rr={combinations:[{label:"Unchecked"},{label:"Checked",checked:!0},{label:"Indeterminate",indeterminate:!0},{label:"Read only",readOnly:!0,checked:!0},{label:"Disabled",disabled:!0},{label:"Disabled checked",disabled:!0,checked:!0},{label:"With description",description:"Supporting description text"},{label:"With status message",checked:!0,helperMessage:"Selection saved"},{ariaLabel:"Unlabelled checkbox"}]},Y={$schema:Fn,apiVersion:Gn,name:Xn,title:Jn,category:Yn,description:Kn,icon:Zn,supports:Qn,textdomain:er,attributes:tr,render:ar,style:lr,editorScript:ir,viewScript:nr,preview:rr};x.registerBlockType(Y.name,{...Y,edit:qn,save:An});const sr={active:"focus",hover:"hover"};function K({size:u="medium",state:a="base",checked:l,defaultChecked:s=!1,indeterminate:r=!1,disabled:d=!1,label:o,description:n,endContent:c,className:v}){var p;return e.createElement("div",{className:["tds-checkbox-list-item",`tds-checkbox-list-item--size-${u}`,`tds-checkbox-list-item--state-${a}`,d&&"tds-checkbox-list-item--disabled",v].filter(Boolean).join(" ")},e.createElement(L,{state:d?"disabled":(p=sr[a])!=null?p:"base",checked:l!==void 0?l:s,indeterminate:r,disabled:d,label:o,description:n}),c&&e.createElement("div",{className:"tds-checkbox-list-item__end-content","aria-hidden":"true"},c))}function or({attributes:u,setAttributes:a,context:l={}}){var m;const{size:s,state:r,checked:d,defaultChecked:o,indeterminate:n,disabled:c,label:v,description:p,endContent:y,classes:h}=u;return e.createElement("div",b.useBlockProps(),e.createElement(K,w({},u,{size:(m=l["tds/checkboxListSize"])!=null?m:s,disabled:c||!!l["tds/checkboxListDisabled"],className:h})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Checkbox List Item Settings"},e.createElement(t.TextControl,{label:"Label",value:v||"",onChange:f=>a({label:f})}),e.createElement(t.TextControl,{label:"Description",value:p||"",onChange:f=>a({description:f||void 0})}),e.createElement(t.TextControl,{label:"End content",value:y||"",onChange:f=>a({endContent:f||void 0}),help:"Trailing content such as a count"}),e.createElement(t.SelectControl,{label:"Size",value:s,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:f=>a({size:f}),help:"Overridden by the parent checkbox list size"}),e.createElement(t.SelectControl,{label:"State",value:r,options:[{label:"Base",value:"base"},{label:"Hover",value:"hover"},{label:"Active",value:"active"}],onChange:f=>a({state:f})}),e.createElement(t.SelectControl,{label:"Checked",value:d===void 0?"":String(d),options:[{label:"Uncontrolled (use default)",value:""},{label:"Checked",value:"true"},{label:"Unchecked",value:"false"}],onChange:f=>a({checked:f===""?void 0:f==="true"})}),e.createElement(t.ToggleControl,{label:"Default checked",checked:!!o,onChange:f=>a({defaultChecked:f})}),e.createElement(t.ToggleControl,{label:"Indeterminate",checked:!!n,onChange:f=>a({indeterminate:f})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!c,onChange:f=>a({disabled:f})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:h||"",onChange:f=>a({classes:f}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the list item element"}))))}const dr=["tds/checkbox-list-item"],cr=[["tds/checkbox-list-item",{label:"Option 1"}],["tds/checkbox-list-item",{label:"Option 2"}]];function ur({attributes:u,setAttributes:a}){var C;const{size:l,options:s,selectedIds:r,defaultSelectedIds:d,label:o,helperText:n,statusMessage:c,hasDividers:v,showSelectAll:p,selectAllLabel:y,disabled:h,classes:m}=u,f=Array.isArray(s)?s:[],i=f.length>0,g=new Set((C=r!=null?r:d)!=null?C:[]),$=f.filter(S=>!S.disabled),T=$.filter(S=>g.has(S.id)).length,E=$.length>0&&T===$.length;return e.createElement("div",b.useBlockProps(),e.createElement("fieldset",{className:["tds-checkbox-list",`tds-checkbox-list--size-${l}`,v&&"tds-checkbox-list--dividers",h&&"tds-checkbox-list--disabled",m].filter(Boolean).join(" ")},o&&e.createElement("legend",{className:"tds-checkbox-list__label"},o),n&&e.createElement("p",{className:"tds-checkbox-list__helper"},n),p&&e.createElement("div",{className:"tds-checkbox-list__select-all"},e.createElement(L,{checked:i&&E,indeterminate:i&&!E&&T>0,label:y,disabled:h})),e.createElement("div",{className:"tds-checkbox-list__items"},i?f.map(S=>e.createElement("div",{key:S.id,className:"tds-checkbox-list__item-row"},e.createElement(K,{size:l,label:S.label,description:S.description,endContent:S.endContent,checked:g.has(S.id),disabled:h||!!S.disabled}))):e.createElement(b.InnerBlocks,{allowedBlocks:dr,template:cr})),c&&e.createElement("p",{className:"tds-checkbox-list__status"},c)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Checkbox List Settings"},e.createElement(t.TextControl,{label:"Label",value:o||"",onChange:S=>a({label:S||void 0})}),e.createElement(t.TextControl,{label:"Helper text",value:n||"",onChange:S=>a({helperText:S||void 0})}),e.createElement(t.TextControl,{label:"Status message",value:c||"",onChange:S=>a({statusMessage:S||void 0})}),e.createElement(t.SelectControl,{label:"Size",value:l,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:S=>a({size:S})}),e.createElement(t.ToggleControl,{label:"Dividers",checked:!!v,onChange:S=>a({hasDividers:S})}),e.createElement(t.ToggleControl,{label:"Show select all",checked:!!p,onChange:S=>a({showSelectAll:S})}),p&&e.createElement(t.TextControl,{label:"Select all label",value:y||"",onChange:S=>a({selectAllLabel:S})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!h,onChange:S=>a({disabled:S})}),e.createElement("p",{style:{fontSize:"12px",color:"#666"}},"Add items as Checkbox List Item blocks. On the front end the options attribute is used only when there are no inner blocks.")),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:m||"",onChange:S=>a({classes:S}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the fieldset element"}))))}function pr(){return e.createElement(b.InnerBlocks.Content,null)}var br="https://schemas.wp.org/trunk/block.json",hr=3,mr="tds/checkbox-list",gr="Times Design System - CheckboxList",vr="common",yr="WordPress block for Times Design System CheckboxList container component",fr="block-default",Cr={html:!1,multiple:!0,reusable:!0,customClassName:!0},xr="times-blocks",Sr={size:{type:"string",enum:["small","medium"],default:"medium",description:"Size applied to every item"},options:{type:"array",items:{type:"object"},description:"Items as { id, label, description?, disabled?, endContent? }; used when the block has no inner checkbox-list-item blocks"},selectedIds:{type:"array",items:{type:"string"},description:"Controlled selected option ids (falls back to defaultSelectedIds when unset)"},defaultSelectedIds:{type:"array",items:{type:"string"},default:[],description:"Initially selected option ids"},label:{type:"string",description:"Group label rendered as the fieldset legend"},helperText:{type:"string",description:"Helper text displayed under the label"},statusMessage:{type:"string",description:"Status message displayed after the items"},hasDividers:{type:"boolean",default:!1,description:"Show dividers between items"},showSelectAll:{type:"boolean",default:!1,description:"Show a select-all checkbox above the items"},selectAllLabel:{type:"string",default:"Select all",description:"Label for the select-all checkbox"},disabled:{type:"boolean",default:!1,description:"Disable the whole list"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the checkbox list element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},$r="file:./render.php",Er=["file:./style.css","tds-checkbox-style","tds-checkbox-list-item-style"],kr="times-design-system",wr="file:./init.js",Tr={combinations:[{label:"Topics",options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Topics",helperText:"Choose one or more",options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}],defaultSelectedIds:["sport"]},{label:"Topics",size:"small",options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Topics",hasDividers:!0,options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Topics",showSelectAll:!0,options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}],defaultSelectedIds:["news"]},{label:"Topics",showSelectAll:!0,options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}],defaultSelectedIds:["news","sport","culture"]},{label:"Topics",statusMessage:"Select at least one topic",options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Topics",disabled:!0,showSelectAll:!0,options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Inner blocks",showSelectAll:!0,innerBlocks:[{block:"checkbox-list-item",attributes:{label:"Newsletter",checked:!0}},{block:"checkbox-list-item",attributes:{label:"Offers",description:"Partner offers"}},{block:"checkbox-list-item",attributes:{label:"Events",endContent:"4"}}]}]},Lr={"tds/checkboxListSize":"size","tds/checkboxListDisabled":"disabled"},Z={$schema:br,apiVersion:hr,name:mr,title:gr,category:vr,description:yr,icon:fr,supports:Cr,textdomain:xr,attributes:Sr,render:$r,style:Er,editorScript:kr,viewScript:wr,preview:Tr,providesContext:Lr};x.registerBlockType(Z.name,{...Z,edit:ur,save:pr});function _r(){return null}var Br="https://schemas.wp.org/trunk/block.json",Ir=3,Nr="tds/checkbox-list-item",zr="Times Design System - CheckboxListItem",Pr="common",Dr="WordPress block for Times Design System CheckboxListItem child component (use inside CheckboxList)",jr="block-default",Or=["tds/checkbox-list"],Rr={html:!1,multiple:!0,reusable:!1,customClassName:!0},Vr="times-blocks",Wr={size:{type:"string",enum:["small","medium"],default:"medium",description:"Item size"},checked:{type:"boolean",description:"Controlled checked state (falls back to defaultChecked when unset)"},defaultChecked:{type:"boolean",default:!1,description:"Initial checked state when checked is unset"},indeterminate:{type:"boolean",default:!1,description:"Whether the checkbox is indeterminate"},disabled:{type:"boolean",default:!1,description:"Whether the item is disabled"},label:{type:"string",description:"Label text"},description:{type:"string",description:"Description text displayed below the label"},endContent:{type:"string",description:"Trailing content (e.g. a count) shown at the end of the row"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the list item element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Mr="file:./render.php",Ur=["file:./style.css","tds-checkbox-style"],Hr="times-design-system",qr={combinations:[{label:"Medium"},{label:"Small",size:"small"},{label:"Checked",checked:!0},{label:"Indeterminate",indeterminate:!0},{label:"Disabled",disabled:!0},{label:"With description",description:"Supporting description text"},{label:"With end content",endContent:"24"}]},Ar=["tds/checkboxListSize","tds/checkboxListDisabled"],Q={$schema:Br,apiVersion:Ir,name:Nr,title:zr,category:Pr,description:Dr,icon:jr,parent:Or,supports:Rr,textdomain:Vr,attributes:Wr,render:Mr,style:Ur,editorScript:Hr,preview:qr,usesContext:Ar};x.registerBlockType(Q.name,{...Q,edit:or,save:_r});function Fr(u=[]){return u.map(({value:a,label:l})=>`${a}|${l}`).join(`
|
|
1
|
+
(function(x,b,e,t){"use strict";const oe={large:"medium",xlarge:"large"};function de({attributes:u,setAttributes:a}){var E;const{label:l,intent:s,size:r,behaviour:d,isRounded:o,isLoading:n,disabled:c,href:v,target:p,rel:y,type:h,iconLeft:m,iconRight:f,ariaLabel:i,classes:g}=u,$=["tds-button",`tds-button--intent-${s}`,d?`tds-button--behaviour-${d}`:"",o?"tds-button--is-rounded":"",n?"tds-button--loading":"",`tds-button--size-${r}`,g].filter(Boolean).join(" "),T=`utility-button-${(E=oe[r])!=null?E:r}`;return e.createElement("div",b.useBlockProps(),e.createElement("button",{type:"button",className:$,"aria-busy":n||void 0,"aria-label":i||void 0,disabled:c||n},n?e.createElement("span",{className:"tds-button__spinner","aria-hidden":"true"}):e.createElement("span",{className:"tds-button__label-container"},e.createElement("span",{className:`tds-text ${T}`},l))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Button Settings"},e.createElement(t.TextControl,{label:"Label",value:l,onChange:C=>a({label:C}),help:"The text displayed inside the button"}),e.createElement(t.SelectControl,{label:"Intent (Style)",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Negative",value:"negative"}],onChange:C=>a({intent:C})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"},{label:"XLarge",value:"xlarge"}],onChange:C=>a({size:C})}),e.createElement(t.SelectControl,{label:"Behaviour",value:d,options:[{label:"Default",value:""},{label:"Hug Content",value:"hug"},{label:"Full Width",value:"full"}],onChange:C=>a({behaviour:C||void 0})}),e.createElement(t.ToggleControl,{label:"Rounded Corners",checked:o,onChange:C=>a({isRounded:C}),help:"Apply rounded corner styling"}),e.createElement(t.ToggleControl,{label:"Loading",checked:n,onChange:C=>a({isLoading:C}),help:"Show loading state with spinner"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:c,onChange:C=>a({disabled:C})})),e.createElement(t.PanelBody,{title:"Link Settings",initialOpen:!1},e.createElement(t.TextControl,{label:"URL",value:v,onChange:C=>a({href:C}),placeholder:"https://example.com"}),e.createElement(t.SelectControl,{label:"Link Target",value:p,options:[{label:"Default",value:""},{label:"Same Window",value:"_self"},{label:"New Window",value:"_blank"},{label:"Parent Window",value:"_parent"},{label:"Top Window",value:"_top"}],onChange:C=>a({target:C||void 0})}),e.createElement(t.TextControl,{label:"Link Rel",value:y,onChange:C=>a({rel:C}),placeholder:"noopener noreferrer"})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.SelectControl,{label:"Button Type",value:h,options:[{label:"Button",value:"button"},{label:"Submit",value:"submit"},{label:"Reset",value:"reset"}],onChange:C=>a({type:C})}),e.createElement(t.TextControl,{label:"Aria Label",value:i,onChange:C=>a({ariaLabel:C}),help:"Accessible name for icon-only buttons"}),e.createElement(t.TextControl,{label:"Icon Left",value:m,onChange:C=>a({iconLeft:C}),placeholder:"Icon name"}),e.createElement(t.TextControl,{label:"Icon Right",value:f,onChange:C=>a({iconRight:C}),placeholder:"Icon name"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:g,onChange:C=>a({classes:C}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the button element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))))}function ce(){return null}var ue="https://schemas.wp.org/trunk/block.json",pe=3,be="tds/button",he="Button",me="common",ge="A customizable button component for user interactions",ve="admin-generic",ye={html:!1,spacing:{margin:!0,padding:!1},align:!0,customClassName:!0},fe="times-design-system",Ce="file:./render.php",xe={label:{type:"string",description:"The text label displayed inside the button"},intent:{type:"string",enum:["primary","secondary","negative"],default:"primary",description:"Visual style variant"},size:{type:"string",enum:["small","medium","large","xlarge"],default:"medium",description:"Controls the overall dimensions of the button"},behaviour:{type:"string",enum:["hug","full"],description:"Controls the width behaviour"},isRounded:{type:"boolean",default:!1,description:"Applies rounded corner styling to the button"},isLoading:{type:"boolean",default:!1,description:"Show loading state with spinner and disable interaction"},disabled:{type:"boolean",default:!1,description:"Whether the button is disabled"},href:{type:"string",description:"Optional href to render as a link"},target:{type:"string",enum:["_blank","_self","_parent","_top"],description:"Optional target attribute for links"},rel:{type:"string",description:"Optional rel attribute for links"},type:{type:"string",enum:["button","submit","reset"],default:"button",description:"Button type"},iconLeft:{type:"string",description:"Icon on the left with variant prefix (e.g., 'filled_circle', 'outlined_circle')"},iconRight:{type:"string",description:"Icon on the right with variant prefix (e.g., 'filled_circle', 'outlined_circle')"},ariaLabel:{type:"string",description:"Accessible name for icon-only buttons"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered button/link element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"},onClick:{type:"string",default:"",description:"Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and button element context."}},Se="times-design-system",$e="file:./init.js",Ee="file:./style.css",ke={combinations:[{label:"Primary",intent:"primary"},{label:"Secondary",intent:"secondary"},{label:"Negative",intent:"negative"},{label:"Small",size:"small"},{label:"Medium",size:"medium"},{label:"Large",size:"large"},{label:"XLarge",size:"xlarge"},{label:"Icon Left",iconLeft:"filled_search"},{label:"Icon Right",iconRight:"filled_arrow_right"},{label:"Rounded",isRounded:!0},{label:"Loading",isLoading:!0},{label:"Disabled",disabled:!0},{label:"Full Width",behaviour:"full"},{label:"As Link",href:"https://www.thetimes.com",target:"_blank"}]},_={$schema:ue,apiVersion:pe,name:be,title:he,category:me,description:ge,icon:ve,supports:ye,textdomain:fe,render:Ce,attributes:xe,editorScript:Se,viewScript:$e,style:Ee,preview:ke};x.registerBlockType(_.name,{..._,edit:de,save:ce});var we="https://schemas.wp.org/trunk/block.json",Te=3,Le="tds/divider",_e="Divider",Be="common",Ie="A horizontal or vertical line divider component",Ne="minus",ze={html:!1,spacing:{margin:!0},align:["wide","full"]},Pe="file:./render.php",De={variant:{type:"string",enum:["solid","dashed","dotted"],default:"solid",description:"Line style: dashed for editorial content breaks, solid for structural UI separation"},orientation:{type:"string",enum:["horizontal","vertical"],default:"horizontal",description:"Axis along which the divider is drawn"},padding:{type:"boolean",default:!0,description:"Adds gutter spacing around the line"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered divider element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},je={},Oe="file:./style.css",Re="times-design-system",Ve={combinations:[{variant:"solid"},{variant:"dashed"},{variant:"dotted"},{orientation:"vertical"},{orientation:"vertical",variant:"dashed"},{padding:!1}]},B={$schema:we,apiVersion:Te,name:Le,title:_e,category:Be,description:Ie,icon:Ne,supports:ze,render:Pe,attributes:De,example:je,style:Oe,editorScript:Re,preview:Ve};function We({attributes:u,setAttributes:a}){const{variant:l,orientation:s,padding:r,classes:d}=u,o=["tds-divider",`tds-divider--${s}`,`tds-divider--${l}`,r?"tds-divider--padding":"",d].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{role:"separator","aria-orientation":s,className:o}),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Divider Settings"},e.createElement(t.SelectControl,{label:"Variant",value:l,options:[{label:"Solid",value:"solid"},{label:"Dashed",value:"dashed"},{label:"Dotted",value:"dotted"}],onChange:n=>a({variant:n})}),e.createElement(t.SelectControl,{label:"Orientation",value:s,options:[{label:"Horizontal",value:"horizontal"},{label:"Vertical",value:"vertical"}],onChange:n=>a({orientation:n})}),e.createElement(t.ToggleControl,{label:"Padding",checked:r,onChange:n=>a({padding:n}),help:"Adds gutter spacing around the line"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d,onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the divider element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters."))))}function Me(){return null}x.registerBlockType(B.name,{...B,edit:We,save:Me});var Ue="https://schemas.wp.org/trunk/block.json",He=3,qe="tds/text",Ae="Text",Fe="common",Ge="Typography component for displaying text with style variants",Xe="editor-paragraph",Je={html:!1,spacing:{margin:!0,padding:!1}},Ye="file:./render.php",Ke={as:{type:"string",enum:["h1","h2","h3","h4","h5","h6","p","span","figcaption","blockquote","label","legend","li","dt","dd","time","address","cite","em","strong"],default:"span",description:"HTML element to render"},typographyStyle:{type:"string",enum:["brand.heading.fluid.light.2xsmall","brand.heading.fluid.light.xsmall","brand.heading.fluid.light.small","brand.heading.fluid.light.medium","brand.heading.fluid.light.large","brand.heading.fluid.light.xlarge","brand.heading.fluid.light.2xlarge","brand.heading.fluid.regular.2xsmall","brand.heading.fluid.regular.xsmall","brand.heading.fluid.regular.small","brand.heading.fluid.regular.medium","brand.heading.fluid.regular.large","brand.heading.fluid.regular.xlarge","brand.heading.fluid.regular.2xlarge","brand.heading.fluid.bold.2xsmall","brand.heading.fluid.bold.xsmall","brand.heading.fluid.bold.small","brand.heading.fluid.bold.medium","brand.heading.fluid.bold.large","brand.heading.fluid.bold.xlarge","brand.heading.fluid.bold.2xlarge","brand.heading.fluid.black.2xsmall","brand.heading.fluid.black.xsmall","brand.heading.fluid.black.small","brand.heading.fluid.black.medium","brand.heading.fluid.black.large","brand.heading.fluid.black.xlarge","brand.heading.fluid.black.2xlarge","brand.heading.static.bold.010","brand.heading.static.bold.020","brand.heading.static.bold.030","brand.heading.static.bold.040","brand.heading.static.bold.050","brand.heading.static.bold.060","brand.heading.static.bold.070","brand.heading.static.bold.080","brand.heading.static.bold.090","brand.heading.static.bold.100","brand.heading.static.black.010","brand.heading.static.black.020","brand.heading.static.black.030","brand.heading.static.black.040","brand.heading.static.black.050","brand.heading.static.black.060","brand.heading.static.black.070","brand.heading.static.black.080","brand.heading.static.black.090","brand.heading.static.black.100","brand.subheading.light.xsmall","brand.subheading.light.small","brand.subheading.light.medium","brand.subheading.light.large","brand.subheading.light.xlarge","brand.subheading.regular.xsmall","brand.subheading.regular.small","brand.subheading.regular.medium","brand.subheading.regular.large","brand.subheading.regular.xlarge","brand.subheading.bold.xsmall","brand.subheading.bold.small","brand.subheading.bold.medium","brand.subheading.bold.large","brand.subheading.bold.xlarge","brand.standfirst.medium","brand.standfirst.large","brand.paragraph.regular.small","brand.paragraph.regular.medium","brand.paragraph.bold.small","brand.paragraph.bold.medium","brand.caption.small","brand.caption.medium","brand.byline.small","brand.byline.medium","utility.heading.small","utility.heading.medium","utility.heading.large","utility.subheading.xsmall","utility.subheading.small","utility.subheading.medium","utility.subheading.large","utility.body.regular.2xsmall","utility.body.regular.xsmall","utility.body.regular.small","utility.body.regular.medium","utility.body.regular.large","utility.body.bold.2xsmall","utility.body.bold.xsmall","utility.body.bold.small","utility.body.bold.medium","utility.body.bold.large","utility.button.xsmall","utility.button.small","utility.button.medium","utility.button.large","utility.label.xsmall","utility.label.small","utility.label.medium","utility.label.large","utility.inputLabel.xsmall","utility.inputLabel.small","utility.inputLabel.medium","utility.inputLabel.large"],default:"utility.body.regular.medium",description:"Typography token (dotted), output as a class with dots replaced by dashes"},content:{type:"string",default:"",description:"Text content (React children)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered text element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Ze={},Qe="file:./style.css",et="times-design-system",tt={combinations:[{as:"span",content:"Utility body regular medium"},{as:"h1",typographyStyle:"brand.heading.fluid.bold.2xlarge",content:"Brand heading fluid"},{as:"h2",typographyStyle:"brand.heading.static.black.060",content:"Brand heading static"},{as:"h3",typographyStyle:"brand.subheading.regular.large",content:"Brand subheading"},{as:"blockquote",typographyStyle:"brand.standfirst.large",content:"Brand standfirst"},{as:"p",typographyStyle:"brand.paragraph.regular.medium",content:"Brand paragraph"},{as:"figcaption",typographyStyle:"brand.caption.medium",content:"Brand caption"},{as:"cite",typographyStyle:"brand.byline.medium",content:"Brand byline"},{as:"h4",typographyStyle:"utility.heading.large",content:"Utility heading"},{as:"h5",typographyStyle:"utility.subheading.medium",content:"Utility subheading"},{as:"p",typographyStyle:"utility.body.bold.small",content:"Utility body bold small"},{as:"span",typographyStyle:"utility.button.medium",content:"Utility button"},{as:"label",typographyStyle:"utility.label.medium",content:"Utility label"},{as:"span",typographyStyle:"utility.inputLabel.medium",content:"Utility input label"}]},k={$schema:Ue,apiVersion:He,name:qe,title:Ae,category:Fe,description:Ge,icon:Xe,supports:Je,render:Ye,attributes:Ke,example:Ze,style:Qe,editorScript:et,preview:tt};const at=k.attributes.as.enum.map(u=>({label:u,value:u})),lt=k.attributes.typographyStyle.enum.map(u=>({label:u,value:u}));function it({attributes:u,setAttributes:a}){const{as:l,typographyStyle:s,content:r,classes:d}=u,o=["tds-text",(s||"utility.body.regular.medium").replaceAll(".","-"),d].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement(b.RichText,{tagName:l||"span",className:o,value:r,onChange:n=>a({content:n}),placeholder:"Enter text..."}),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Text Settings"},e.createElement(t.SelectControl,{label:"Element",value:l,options:at,onChange:n=>a({as:n})}),e.createElement(t.SelectControl,{label:"Typography Style",value:s,options:lt,onChange:n=>a({typographyStyle:n})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d,onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the text element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters."))))}function nt(){return null}x.registerBlockType(k.name,{...k,edit:it,save:nt});var rt="https://schemas.wp.org/trunk/block.json",st=3,ot="tds/input",dt="Input",ct="common",ut="Form input field component",pt="text",bt={html:!1,spacing:{margin:!0}},ht="file:./render.php",mt={label:{type:"string",description:"Label text for the input"},placeholder:{type:"string",description:"Input placeholder text"},type:{type:"string",default:"text",enum:["text","email","password","number","tel","url"],description:"Input type"},value:{type:"string",description:"Initial input value"},disabled:{type:"boolean",default:!1,description:"Disabled state"},required:{type:"boolean",default:!1,description:"Required state; adds an asterisk to the label"},name:{type:"string",description:"Input name attribute (also used as the id when id is not set)"},id:{type:"string",description:"Input id attribute"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered input element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},gt={},vt="file:./style.css",yt="times-design-system",ft={combinations:[{label:"Text",name:"text-input",type:"text",placeholder:"Enter text..."},{label:"Email",name:"email-input",type:"email",placeholder:"Enter email..."},{label:"Password",name:"password-input",type:"password",placeholder:"Enter password..."},{label:"Number",name:"number-input",type:"number",placeholder:"Enter a number..."},{label:"Telephone",name:"tel-input",type:"tel",placeholder:"Enter phone number..."},{label:"URL",name:"url-input",type:"url",placeholder:"https://"},{label:"With Value",name:"value-input",value:"Pre-filled value"},{label:"Required",name:"required-input",required:!0,placeholder:"This field is required"},{label:"Disabled",name:"disabled-input",disabled:!0,placeholder:"Disabled"},{name:"no-label-input",placeholder:"No label"}]},I={$schema:rt,apiVersion:st,name:ot,title:dt,category:ct,description:ut,icon:pt,supports:bt,render:ht,attributes:mt,example:gt,style:vt,editorScript:yt,preview:ft};function Ct({attributes:u,setAttributes:a}){const{label:l,placeholder:s,type:r,value:d,disabled:o,required:n,name:c,id:v,classes:p}=u,y=v||c||void 0;return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Input Settings"},e.createElement(t.TextControl,{label:"Label",value:l||"",onChange:h=>a({label:h||void 0})}),e.createElement(t.TextControl,{label:"Placeholder",value:s||"",onChange:h=>a({placeholder:h||void 0})}),e.createElement(t.TextControl,{label:"Value",value:d||"",onChange:h=>a({value:h||void 0}),help:"Initial value"}),e.createElement(t.SelectControl,{label:"Type",value:r,options:[{label:"Text",value:"text"},{label:"Email",value:"email"},{label:"Password",value:"password"},{label:"Number",value:"number"},{label:"Tel",value:"tel"},{label:"URL",value:"url"}],onChange:h=>a({type:h})}),e.createElement(t.TextControl,{label:"Name",value:c||"",onChange:h=>a({name:h||void 0})}),e.createElement(t.TextControl,{label:"ID",value:v||"",onChange:h=>a({id:h||void 0}),help:"Defaults to the name when empty"}),e.createElement(t.ToggleControl,{label:"Required",checked:n,onChange:h=>a({required:h})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:o,onChange:h=>a({disabled:h})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:p,onChange:h=>a({classes:h}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the input element"}))),e.createElement("div",{className:"tds-input-wrapper"},l&&e.createElement("label",{htmlFor:y,className:"tds-input-label utility-label-medium"},l,n&&e.createElement("span",{className:"tds-input-required"},"*")),e.createElement("input",{id:y,type:r,name:c,className:["tds-input --tds-utility-body-regular-medium",p].filter(Boolean).join(" "),placeholder:s,defaultValue:d,disabled:o,required:n,readOnly:!0})))}function xt(){return null}x.registerBlockType(I.name,{...I,edit:Ct,save:xt});var St="https://schemas.wp.org/trunk/block.json",$t=3,Et="tds/icon-button",kt="Icon Button",wt="common",Tt="Button component displaying only an icon",Lt="button",_t={html:!1,spacing:{margin:!0}},Bt="file:./render.php",It={iconName:{type:"string",default:"filled_add",description:"Icon name with variant prefix (e.g., 'filled_add', 'outlined_add')"},intent:{type:"string",enum:["primary","secondary","negative"],default:"primary",description:"Visual style variant matching button intents"},size:{type:"string",enum:["small","medium","large","xlarge"],default:"large",description:"Controls the overall dimensions of the icon button"},isRounded:{type:"boolean",default:!1,description:"Applies rounded corner styling"},isLoading:{type:"boolean",default:!1,description:"Show loading state with spinner and disable interaction"},disabled:{type:"boolean",default:!1,description:"Whether the button is disabled"},type:{type:"string",enum:["button","submit","reset"],default:"button",description:"Button type"},href:{type:"string",description:"Optional href to render as a link"},target:{type:"string",enum:["_blank","_self","_parent","_top"],description:"Optional target attribute for links"},rel:{type:"string",description:"Optional rel attribute for links"},ariaLabel:{type:"string",description:"Accessible name for this icon-only control"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered button/link element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"},onClick:{type:"string",default:"",description:"Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and icon button element context."}},Nt={combinations:[{ariaLabel:"Primary",intent:"primary"},{ariaLabel:"Secondary",intent:"secondary"},{ariaLabel:"Negative",intent:"negative"},{ariaLabel:"Small",size:"small",iconName:"filled_close"},{ariaLabel:"Medium",size:"medium",iconName:"filled_search"},{ariaLabel:"Large",size:"large"},{ariaLabel:"XLarge",size:"xlarge",iconName:"filled_settings"},{ariaLabel:"Rounded",isRounded:!0},{ariaLabel:"Loading",isLoading:!0},{ariaLabel:"Disabled",disabled:!0},{ariaLabel:"As Link",href:"https://www.thetimes.com",target:"_blank"},{ariaLabel:"With onClick",onClick:"handleIconButtonClick"}]},zt={},Pt=["file:./style.css","tds-button-style"],Dt="times-design-system",jt="file:./init.js",N={$schema:St,apiVersion:$t,name:Et,title:kt,category:wt,description:Tt,icon:Lt,supports:_t,render:Bt,attributes:It,preview:Nt,example:zt,style:Pt,editorScript:Dt,viewScript:jt};function Ot({attributes:u,setAttributes:a}){const{iconName:l,intent:s,size:r,isRounded:d,isLoading:o,disabled:n,type:c,href:v,target:p,rel:y,ariaLabel:h,classes:m}=u,f=["tds-button",`tds-button--intent-${s}`,d?"tds-button--is-rounded":"",o?"tds-button--loading":"",`tds-icon-button--size-${r}`,m].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("button",{type:"button",className:f,"aria-busy":o||void 0,"aria-label":h||void 0,disabled:n||o},o?e.createElement("span",{className:"tds-button__spinner","aria-hidden":"true"}):e.createElement("span",{className:"tds-button__icon","aria-hidden":"true"},l)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Icon Button Settings"},e.createElement(t.TextControl,{label:"Icon Name",value:l,onChange:i=>a({iconName:i}),placeholder:"e.g., filled_add"}),e.createElement(t.TextControl,{label:"Aria Label",value:h,onChange:i=>a({ariaLabel:i}),help:"Accessible name for this icon-only control"}),e.createElement(t.SelectControl,{label:"Intent (Style)",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Negative",value:"negative"}],onChange:i=>a({intent:i})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"},{label:"XLarge",value:"xlarge"}],onChange:i=>a({size:i})}),e.createElement(t.ToggleControl,{label:"Rounded",checked:d,onChange:i=>a({isRounded:i})}),e.createElement(t.ToggleControl,{label:"Loading",checked:o,onChange:i=>a({isLoading:i}),help:"Show loading state with spinner"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:n,onChange:i=>a({disabled:i})})),e.createElement(t.PanelBody,{title:"Link Settings",initialOpen:!1},e.createElement(t.TextControl,{label:"URL (leave empty for button)",value:v,onChange:i=>a({href:i}),placeholder:"https://example.com"}),e.createElement(t.SelectControl,{label:"Link Target",value:p,options:[{label:"Default",value:""},{label:"Same Window",value:"_self"},{label:"New Window",value:"_blank"},{label:"Parent Window",value:"_parent"},{label:"Top Window",value:"_top"}],onChange:i=>a({target:i||void 0})}),e.createElement(t.TextControl,{label:"Link Rel",value:y,onChange:i=>a({rel:i}),placeholder:"noopener noreferrer"})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.SelectControl,{label:"Button Type",value:c,options:[{label:"Button",value:"button"},{label:"Submit",value:"submit"},{label:"Reset",value:"reset"}],onChange:i=>a({type:i})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:m,onChange:i=>a({classes:i}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the button/link element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))))}function Rt(){return null}x.registerBlockType(N.name,{...N,edit:Ot,save:Rt});var Vt="https://schemas.wp.org/trunk/block.json",Wt=3,Mt="tds/chip",Ut="Chip",Ht="common",qt="Compact selectable/toggle control for in-page state changes",At="tag",Ft={html:!1,spacing:{margin:!0}},Gt="file:./render.php",Xt={label:{type:"string",description:"Label content"},intent:{type:"string",enum:["primary","secondary"],default:"primary",description:"Visual emphasis style"},size:{type:"string",enum:["small","large"],default:"small",description:"Chip size variant"},channel:{type:"boolean",default:!1,description:"Applies channel color token family"},toggle:{type:"boolean",default:!1,description:"Persistent toggle selection state"},iconLeft:{type:"string",description:"Leading icon with variant prefix (e.g., 'filled_circle')"},iconRight:{type:"string",description:"Trailing icon with variant prefix (e.g., 'outlined_circle')"},ariaLabel:{type:"string",description:"Accessible name (aria-label)"},href:{type:"string",description:"Link target URL. When provided, renders as an anchor element instead of button."},disabled:{type:"boolean",default:!1,description:"Whether the chip button is disabled"},type:{type:"string",enum:["button","submit","reset"],default:"button",description:"Button type"},onClick:{type:"string",default:"",description:"Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and chip element context."},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered chip element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Jt={},Yt="file:./style.css",Kt="times-design-system",Zt="file:./init.js",Qt={combinations:[{label:"Primary Small",intent:"primary",size:"small"},{label:"Primary Large",intent:"primary",size:"large"},{label:"Secondary",intent:"secondary"},{label:"Channel",channel:!0},{label:"Channel Secondary",channel:!0,intent:"secondary"},{label:"Toggle",toggle:!0},{label:"Secondary Toggle",intent:"secondary",toggle:!0},{label:"Icons",iconLeft:"filled_check",iconRight:"filled_close"},{label:"Disabled",disabled:!0},{label:"Link",href:"#"}]},z={$schema:Vt,apiVersion:Wt,name:Mt,title:Ut,category:Ht,description:qt,icon:At,supports:Ft,render:Gt,attributes:Xt,example:Jt,style:Yt,editorScript:Kt,viewScript:Zt,preview:Qt};function ea({attributes:u,setAttributes:a}){const{label:l,intent:s,size:r,channel:d,toggle:o,iconLeft:n,iconRight:c,ariaLabel:v,href:p,disabled:y,type:h,classes:m}=u,f=["tds-chip",`tds-chip--intent-${s}`,`tds-chip--size-${r}`,p?"":`tds-chip--toggle-${o?"off":"on"}`,d?"tds-chip--channel":"",m].filter(Boolean).join(" "),i=e.createElement(e.Fragment,null,n&&e.createElement("span",{className:"tds-chip__icon","aria-hidden":"true"},n),e.createElement("span",{className:`tds-text utility-button-${r} tds-chip__label`},l),c&&e.createElement("span",{className:"tds-chip__icon","aria-hidden":"true"},c));return e.createElement("div",b.useBlockProps(),p?e.createElement("span",{className:f,"aria-label":v||void 0},i):e.createElement("button",{type:"button",className:f,"aria-label":v||void 0,"aria-pressed":o||void 0,disabled:y},i),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Chip Settings"},e.createElement(t.TextControl,{label:"Label",value:l,onChange:g=>a({label:g})}),e.createElement(t.SelectControl,{label:"Intent",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"}],onChange:g=>a({intent:g})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Large",value:"large"}],onChange:g=>a({size:g})}),e.createElement(t.ToggleControl,{label:"Channel",checked:d,onChange:g=>a({channel:g})}),e.createElement(t.ToggleControl,{label:"Toggle",checked:o,onChange:g=>a({toggle:g})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:y,onChange:g=>a({disabled:g})}),e.createElement(t.TextControl,{label:"Left Icon",value:n,onChange:g=>a({iconLeft:g}),placeholder:"e.g., filled_check"}),e.createElement(t.TextControl,{label:"Right Icon",value:c,onChange:g=>a({iconRight:g}),placeholder:"e.g., filled_close"}),e.createElement(t.TextControl,{label:"Aria Label",value:v,onChange:g=>a({ariaLabel:g})})),e.createElement(t.PanelBody,{title:"Link & Advanced",initialOpen:!1},e.createElement(t.TextControl,{label:"URL (renders a link chip)",value:p,onChange:g=>a({href:g}),placeholder:"https://example.com"}),e.createElement(t.SelectControl,{label:"Button Type",value:h,options:[{label:"Button",value:"button"},{label:"Submit",value:"submit"},{label:"Reset",value:"reset"}],onChange:g=>a({type:g})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:m,onChange:g=>a({classes:g}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the chip element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))))}function ta(){return null}x.registerBlockType(z.name,{...z,edit:ea,save:ta});var aa="https://schemas.wp.org/trunk/block.json",la=3,ia="tds/tag",na="Tag",ra="common",sa="Badge or status indicator component",oa="tag",da={html:!1,spacing:{margin:!0}},ca="file:./render.php",ua={label:{type:"string",description:"Visible label text"},intent:{type:"string",enum:["primary","secondary","tertiary"],default:"primary",description:"Visual treatment"},size:{type:"string",enum:["small","medium","large"],default:"medium",description:"Typography size variant"},callout:{type:"boolean",description:"Callout variant"},channel:{type:"boolean",description:"Channel variant"},iconLeft:{type:"string",description:"Icon on the left side of the label, with variant prefix (e.g. 'filled_check')"},iconRight:{type:"string",description:"Icon on the right side of the label, with variant prefix (e.g. 'filled_check')"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered tag element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},pa={},ba="file:./style.css",ha="times-design-system",ma={combinations:[{label:"Primary",intent:"primary"},{label:"Secondary",intent:"secondary"},{label:"Tertiary",intent:"tertiary"},{label:"Small",size:"small"},{label:"Medium",size:"medium"},{label:"Large",size:"large"},{label:"Callout",callout:!0},{label:"Channel",channel:!0},{label:"Icon Left",iconLeft:"filled_check"},{label:"Icon Right",iconRight:"filled_arrow_right"}]},P={$schema:aa,apiVersion:la,name:ia,title:na,category:ra,description:sa,icon:oa,supports:da,render:ca,attributes:ua,example:pa,style:ba,editorScript:ha,preview:ma};const ga={small:"xsmall",large:"medium"};function va({attributes:u,setAttributes:a}){var h;const{label:l,intent:s,size:r,callout:d,channel:o,iconLeft:n,iconRight:c,classes:v}=u,p=["tds-tag",`tds-tag--intent-${s}`,`tds-tag--size-${r}`,d?"tds-tag--callout":"",o?"tds-tag--channel":"",v].filter(Boolean).join(" "),y=`utility-label-${(h=ga[r])!=null?h:"small"}`;return e.createElement("div",b.useBlockProps(),e.createElement("span",{className:p},e.createElement("span",{className:`tds-text ${y} tds-tag__label`},l)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Tag Settings"},e.createElement(t.TextControl,{label:"Label",value:l,onChange:m=>a({label:m})}),e.createElement(t.SelectControl,{label:"Intent",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Tertiary",value:"tertiary"}],onChange:m=>a({intent:m})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"}],onChange:m=>a({size:m})}),e.createElement(t.ToggleControl,{label:"Callout",checked:!!d,onChange:m=>a({callout:m})}),e.createElement(t.ToggleControl,{label:"Channel",checked:!!o,onChange:m=>a({channel:m})}),e.createElement(t.TextControl,{label:"Icon Left",value:n,onChange:m=>a({iconLeft:m}),placeholder:"e.g. filled_check"}),e.createElement(t.TextControl,{label:"Icon Right",value:c,onChange:m=>a({iconRight:m}),placeholder:"e.g. filled_check"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:v,onChange:m=>a({classes:m}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the tag element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters."))))}function ya(){return null}x.registerBlockType(P.name,{...P,edit:va,save:ya});function fa({attributes:u,setAttributes:a}){const{label:l,intent:s,size:r,ariaLabel:d,classes:o}=u,n=["tds-label",`tds-label--intent-${s}`,`utility-label-${r}`,o].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("span",{className:n,"aria-label":d||void 0},l),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Label Settings"},e.createElement(t.TextControl,{label:"Label Text",value:l,onChange:c=>a({label:c}),help:"The text content displayed in the label"}),e.createElement(t.SelectControl,{label:"Intent (Visual Treatment)",value:s,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"},{label:"Channel",value:"channel"},{label:"Callout",value:"callout"}],onChange:c=>a({intent:c})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"}],onChange:c=>a({size:c})}),e.createElement(t.TextControl,{label:"Aria Label",value:d,onChange:c=>a({ariaLabel:c}),help:"Optional accessible name for the label"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:o,onChange:c=>a({classes:c}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the label element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters."))))}function Ca(){return null}var xa="https://schemas.wp.org/trunk/block.json",Sa=3,$a="tds/label",Ea="Label",ka="common",wa="A label component used to denote article category, channel, or content type near metadata",Ta="tag",La={html:!1,spacing:{margin:!0,padding:!1},align:!0,customClassName:!0},_a="times-design-system",Ba="file:./render.php",Ia={label:{type:"string",default:"LABEL",description:"The text content displayed in the label"},intent:{type:"string",enum:["primary","secondary","channel","callout"],default:"primary",description:"Visual treatment variant"},size:{type:"string",enum:["small","medium","large"],default:"medium",description:"Typography size variant"},ariaLabel:{type:"string",description:"Optional accessible name for the label"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered label element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Na="times-design-system",za="file:./style.css",Pa={combinations:[{label:"PRIMARY",intent:"primary"},{label:"SECONDARY",intent:"secondary"},{label:"CHANNEL",intent:"channel"},{label:"CALLOUT",intent:"callout"},{label:"SMALL",size:"small"},{label:"MEDIUM",size:"medium"},{label:"LARGE",size:"large"}]},D={$schema:xa,apiVersion:Sa,name:$a,title:Ea,category:ka,description:wa,icon:Ta,supports:La,textdomain:_a,render:Ba,attributes:Ia,editorScript:Na,style:za,preview:Pa};x.registerBlockType(D.name,{...D,edit:fa,save:Ca});var Da="https://schemas.wp.org/trunk/block.json",ja=3,Oa="tds/toast",Ra="Toast",Va="common",Wa="Compact, transient feedback message for low-disruption status updates",Ma="bell",Ua={html:!1,spacing:{margin:!0}},Ha="file:./render.php",qa={intent:{type:"string",enum:["success","info","warning","error"],default:"success",description:"Semantic intent for toast visuals and icon"},label:{type:"string",description:"Primary toast message (nothing renders without it)"},linkHref:{type:"string",description:"Optional inline link URL; the link is shown when set"},linkLabel:{type:"string",default:"Link",description:"Optional link text"},timeout:{type:"number",default:2e3,description:"Auto-dismiss delay in milliseconds (minimum 1500), output as data-timeout"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered toast element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Aa={},Fa=["file:./style.css","tds-link-style"],Ga="times-design-system",Xa={combinations:[{label:"Saved successfully",intent:"success"},{label:"Information",intent:"info"},{label:"Warning",intent:"warning"},{label:"Error occurred",intent:"error"},{label:"Article saved",linkHref:"#",linkLabel:"View"},{label:"With default link label",intent:"info",linkHref:"#"}]},j={$schema:Da,apiVersion:ja,name:Oa,title:Ra,category:Va,description:Wa,icon:Ma,supports:Ua,render:Ha,attributes:qa,example:Aa,style:Fa,editorScript:Ga,preview:Xa};function Ja({attributes:u,setAttributes:a}){const{intent:l,label:s,linkHref:r,linkLabel:d,timeout:o,classes:n}=u,c=["tds-toast",`tds-toast--intent-${l}`,n].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{className:c},e.createElement("span",{className:"tds-toast__icon","aria-hidden":"true"}),e.createElement("span",{className:"tds-text utility-body-regular-medium tds-toast__label"},s||"Add a toast message"),r&&e.createElement("span",{className:"tds-link tds-link--primary tds-link--sentiment-utility tds-link--size-medium tds-toast__link"},e.createElement("span",{className:"tds-link__label"},d))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Toast Settings"},e.createElement(t.TextControl,{label:"Label",value:s||"",onChange:v=>a({label:v}),help:"The toast is not rendered without a label"}),e.createElement(t.SelectControl,{label:"Intent",value:l,options:[{label:"Success",value:"success"},{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}],onChange:v=>a({intent:v})}),e.createElement(t.TextControl,{label:"Link URL",value:r||"",onChange:v=>a({linkHref:v||void 0}),placeholder:"https://example.com",help:"Shows an inline link when set"}),r&&e.createElement(t.TextControl,{label:"Link Label",value:d,onChange:v=>a({linkLabel:v})}),e.createElement(t.TextControl,{label:"Timeout (ms)",type:"number",min:1500,step:500,value:o,onChange:v=>a({timeout:parseInt(v,10)||2e3})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:n,onChange:v=>a({classes:v}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the toast element"}),e.createElement("p",{style:{fontSize:"12px",color:"#666",marginTop:"8px"}},e.createElement("strong",null,"Data Attributes:")," Custom data-* attributes are typically set via block templates or PHP filters for analytics, testing, and custom hooks. See the block documentation for examples."))))}function Ya(){return null}x.registerBlockType(j.name,{...j,edit:Ja,save:Ya});var Ka="https://schemas.wp.org/trunk/block.json",Za=3,Qa="tds/link",el="Link",tl="common",al="Styled link component with variants and states",ll="link",il={html:!1,spacing:{margin:!0}},nl="file:./render.php",rl={href:{type:"string",description:"Link destination URL"},label:{type:"string",default:"Link",description:"Link text (React children), rendered inside span.tds-link__label"},intent:{type:"string",default:"primary",enum:["primary","secondary"],description:"Link color and style variant"},sentiment:{type:"string",default:"brand",enum:["brand","utility"],description:"Brand or utility colour treatment"},size:{type:"string",default:"medium",enum:["xsmall","small","medium","large"],description:"Link size variant"},iconLeft:{type:"string",description:"Icon on the left with variant prefix (e.g., 'filled_arrow_left')"},iconRight:{type:"string",description:"Icon on the right with variant prefix (e.g., 'filled_arrow_right')"},inline:{type:"boolean",default:!0,description:"Inline link; false renders the standalone variant"},isDisabled:{type:"boolean",default:!1,description:"Disables the link and prevents navigation"},target:{type:"string",enum:["_self","_blank","_parent","_top"],description:'Link target; _blank adds rel="noopener noreferrer"'},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered link element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"},onClick:{type:"string",default:"",description:"Name of JavaScript function to call on click (e.g., 'myFunction'). Function receives click event and link element context."}},sl={},ol="file:./style.css",dl="times-design-system",cl="file:./init.js",ul={combinations:[{label:"Primary",href:"#",intent:"primary"},{label:"Secondary",href:"#",intent:"secondary"},{label:"Utility",href:"#",sentiment:"utility"},{label:"Utility Secondary",href:"#",sentiment:"utility",intent:"secondary"},{label:"XSmall",href:"#",size:"xsmall"},{label:"Small",href:"#",size:"small"},{label:"Medium",href:"#",size:"medium"},{label:"Large",href:"#",size:"large"},{label:"Icon Left",href:"#",iconLeft:"filled_arrow_left"},{label:"Icon Right",href:"#",iconRight:"filled_arrow_right"},{label:"Standalone",href:"#",inline:!1},{label:"External",href:"https://www.thetimes.com",target:"_blank"},{label:"Disabled",href:"#",isDisabled:!0},{label:"With onClick",href:"#",onClick:"handleLinkClick"}]},O={$schema:Ka,apiVersion:Za,name:Qa,title:el,category:tl,description:al,icon:ll,supports:il,render:nl,attributes:rl,example:sl,style:ol,editorScript:dl,viewScript:cl,preview:ul};function pl({attributes:u,setAttributes:a}){const{href:l,label:s,intent:r,sentiment:d,size:o,iconLeft:n,iconRight:c,inline:v,isDisabled:p,target:y,classes:h,onClick:m}=u,f=["tds-link",`tds-link--${r}`,`tds-link--sentiment-${d}`,`tds-link--size-${o}`,p?"tds-link--is-disabled":"",v?"":"tds-link--standalone",h].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Link Settings"},e.createElement(t.TextControl,{label:"URL",value:l||"",onChange:i=>a({href:i}),type:"url"}),e.createElement(t.SelectControl,{label:"Intent",value:r,options:[{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"}],onChange:i=>a({intent:i})}),e.createElement(t.SelectControl,{label:"Sentiment",value:d,options:[{label:"Brand",value:"brand"},{label:"Utility",value:"utility"}],onChange:i=>a({sentiment:i})}),e.createElement(t.SelectControl,{label:"Size",value:o,options:[{label:"XSmall",value:"xsmall"},{label:"Small",value:"small"},{label:"Medium",value:"medium"},{label:"Large",value:"large"}],onChange:i=>a({size:i})}),e.createElement(t.TextControl,{label:"Icon Left",value:n||"",onChange:i=>a({iconLeft:i||void 0}),placeholder:"Icon name"}),e.createElement(t.TextControl,{label:"Icon Right",value:c||"",onChange:i=>a({iconRight:i||void 0}),placeholder:"Icon name"}),e.createElement(t.ToggleControl,{label:"Inline",checked:v,onChange:i=>a({inline:i}),help:"Turn off for the standalone variant"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:p,onChange:i=>a({isDisabled:i})}),e.createElement(t.SelectControl,{label:"Target",value:y||"",options:[{label:"Default",value:""},{label:"Same window",value:"_self"},{label:"New window",value:"_blank"},{label:"Parent",value:"_parent"},{label:"Top",value:"_top"}],onChange:i=>a({target:i||void 0})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:h,onChange:i=>a({classes:i}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the link element"}),e.createElement(t.TextControl,{label:"onClick Function",value:m,onChange:i=>a({onClick:i}),placeholder:"myFunction",help:"Name of a global function called on click"}))),e.createElement("a",{href:p?void 0:l||"#",className:f,"aria-disabled":p||void 0,onClick:i=>i.preventDefault()},n&&e.createElement("span",{className:"tds-link__icon","aria-hidden":"true"}),e.createElement(b.RichText,{tagName:"span",className:"tds-link__label",value:s,onChange:i=>a({label:i}),placeholder:"Link text",allowedFormats:[]}),c&&e.createElement("span",{className:"tds-link__icon","aria-hidden":"true"})))}function bl(){return null}x.registerBlockType(O.name,{...O,edit:pl,save:bl});var hl="https://schemas.wp.org/trunk/block.json",ml=3,gl="tds/ad-container",vl="Ad Container",yl="common",fl="Advertising container placeholder",Cl="image",xl={html:!1,spacing:{margin:!0,padding:!0}},Sl="file:./render.php",$l={type:{type:"string",default:"inline",enum:["header","inline"],description:'Ad placement; inline ads show an "Advertisement" label'},slotID:{type:"string",description:"Ad slot element id (inline only; header always uses 'ad-header')"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the ad container element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},El={},kl="file:./style.css",wl="times-design-system",Tl={combinations:[{type:"inline",slotID:"ad-slot-001"},{type:"inline"},{type:"header"}]},R={$schema:hl,apiVersion:ml,name:gl,title:vl,category:yl,description:fl,icon:Cl,supports:xl,render:Sl,attributes:$l,example:El,style:kl,editorScript:wl,preview:Tl};function Ll({attributes:u,setAttributes:a}){const{type:l,slotID:s,classes:r}=u,d=l==="header"?"ad-header":s||void 0;return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Ad Container Settings"},e.createElement(t.SelectControl,{label:"Type",value:l,options:[{label:"Inline",value:"inline"},{label:"Header",value:"header"}],onChange:o=>a({type:o})}),l==="inline"&&e.createElement(t.TextControl,{label:"Slot ID",value:s||"",onChange:o=>a({slotID:o||void 0}),placeholder:"e.g., ad-slot-001",help:"Element id of the ad slot"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:r,onChange:o=>a({classes:o}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the ad container element"}))),e.createElement("div",{className:[`ad-${l}-container`,r].filter(Boolean).join(" ")},l==="inline"&&e.createElement("span",{className:"tds-text utility-body-regular-medium ad-label"},"Advertisement"),e.createElement("div",{className:`ad-${l}-wrapper`},e.createElement("div",null,e.createElement("p",{style:{fontSize:"12px",color:"#666",margin:0}},"Ad slot: ",d||"(not configured)")))))}function _l(){return null}x.registerBlockType(R.name,{...R,edit:Ll,save:_l});function Bl({attributes:u,setAttributes:a}){const{size:l,active:s,channel:r,leftIcon:d,rightIcon:o,label:n,id:c,panelId:v,disabled:p,classes:y}=u,h=["tds-tab",`tds-tab--size-${l}`,`tds-tab--active-${!!s}`,`tds-tab--channel-${!!r}`,y].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("button",{type:"button",role:"tab","aria-selected":!!s,tabIndex:s?0:-1,className:h,disabled:p},d&&e.createElement("span",{className:"tds-tab__icon","aria-hidden":"true"},d),e.createElement("span",{className:`tds-text utility-label-${l} tds-tab__label`},n),o&&e.createElement("span",{className:"tds-tab__icon","aria-hidden":"true"},o)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Tab Settings"},e.createElement(t.TextControl,{label:"Label",value:n||"",onChange:m=>a({label:m})}),e.createElement(t.SelectControl,{label:"Size",value:l,options:[{label:"Medium",value:"medium"},{label:"Large",value:"large"}],onChange:m=>a({size:m})}),e.createElement(t.ToggleControl,{label:"Active",checked:!!s,onChange:m=>a({active:m}),help:"Inside a Tab Group the selected tab is set by the group's Default Selected Index"}),e.createElement(t.ToggleControl,{label:"Channel",checked:!!r,onChange:m=>a({channel:m}),help:"Apply the channel colour token family"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!p,onChange:m=>a({disabled:m})}),e.createElement(t.TextControl,{label:"Left Icon",value:d||"",onChange:m=>a({leftIcon:m||void 0}),placeholder:"Icon name"}),e.createElement(t.TextControl,{label:"Right Icon",value:o||"",onChange:m=>a({rightIcon:m||void 0}),placeholder:"Icon name"})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.TextControl,{label:"Tab ID",value:c||"",onChange:m=>a({id:m||void 0})}),e.createElement(t.TextControl,{label:"Panel ID",value:v||"",onChange:m=>a({panelId:m||void 0}),help:"Id of the panel this tab controls (aria-controls)"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:y||"",onChange:m=>a({classes:m}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the tab element"}))))}function Il(){return null}var Nl="https://schemas.wp.org/trunk/block.json",zl=3,Pl="tds/tab",Dl="Times Design System - Tab",jl="common",Ol="Single tab inside a TabGroup",Rl="block-default",Vl=["tds/tab-group"],Wl={html:!1,multiple:!0,reusable:!0,customClassName:!0},Ml="times-blocks",Ul={size:{type:"string",enum:["medium","large"],default:"medium",description:"Tab size variant"},active:{type:"boolean",default:!1,description:"Whether the tab is the selected tab in its group (TabGroup overrides this from defaultSelectedIndex)"},channel:{type:"boolean",default:!1,description:"Applies channel color token family"},leftIcon:{type:"string",description:"Leading icon name with variant prefix (e.g. 'filled_circle')"},rightIcon:{type:"string",description:"Trailing icon name with variant prefix (e.g. 'filled_circle')"},label:{type:"string",description:"Visible label"},id:{type:"string",description:"Optional id for aria-controls relationships"},panelId:{type:"string",description:"Id of the panel this tab controls"},disabled:{type:"boolean",default:!1,description:"Whether the tab is disabled"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered tab element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Hl="file:./render.php",ql="file:./style.css",Al="times-design-system",Fl={combinations:[{label:"Default"},{label:"Active",active:!0},{label:"Large",size:"large"},{label:"Large active",size:"large",active:!0},{label:"Channel",channel:!0},{label:"Channel active",channel:!0,active:!0},{label:"Left icon",leftIcon:"filled_circle"},{label:"Right icon",rightIcon:"filled_circle"},{label:"Disabled",disabled:!0}]},V={$schema:Nl,apiVersion:zl,name:Pl,title:Dl,category:jl,description:Ol,icon:Rl,parent:Vl,supports:Wl,textdomain:Ml,attributes:Ul,render:Hl,style:ql,editorScript:Al,preview:Fl};x.registerBlockType(V.name,{...V,edit:Bl,save:Il});const Gl=["tds/tab"],Xl=[["tds/tab",{label:"Tab 1"}],["tds/tab",{label:"Tab 2"}]];function Jl({attributes:u,setAttributes:a}){const{behaviour:l,defaultSelectedIndex:s,ariaLabel:r,id:d,classes:o}=u,n=["tds-tab-group",`tds-tab-group--behaviour-${l==="100%"?"fill":"hug"}`,o].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{role:"tablist","aria-orientation":"horizontal","aria-label":r||void 0,className:n},e.createElement(b.InnerBlocks,{allowedBlocks:Gl,template:Xl,orientation:"horizontal"})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Tab Group Settings"},e.createElement(t.SelectControl,{label:"Behaviour",value:l,options:[{label:"Hug content",value:"hug"},{label:"Fill container (100%)",value:"100%"}],onChange:c=>a({behaviour:c})}),e.createElement(t.RangeControl,{label:"Default Selected Index",value:s,onChange:c=>a({defaultSelectedIndex:c!=null?c:0}),min:0,max:20,help:"Zero-based index of the initially selected tab"}),e.createElement(t.TextControl,{label:"Aria Label",value:r||"",onChange:c=>a({ariaLabel:c||void 0}),help:"Accessible name for the tablist"}),e.createElement(t.TextControl,{label:"ID",value:d||"",onChange:c=>a({id:c||void 0})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:o||"",onChange:c=>a({classes:c}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the tab group element"}))))}function Yl(){return e.createElement(b.InnerBlocks.Content,null)}var Kl="https://schemas.wp.org/trunk/block.json",Zl=3,Ql="tds/tab-group",ei="Times Design System - TabGroup",ti="common",ai="Tablist container that manages selection and keyboard navigation across Tab children",li="block-default",ii={html:!1,multiple:!0,reusable:!0,customClassName:!0},ni="times-blocks",ri={behaviour:{type:"string",enum:["hug","100%"],default:"hug",description:"Sizing behaviour: hug content or fill the container (100%)"},defaultSelectedIndex:{type:"number",default:0,description:"Index of the initially selected tab"},ariaLabel:{type:"string",description:"Accessible label for the tablist"},id:{type:"string",description:"Optional id for the tablist root"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered tab group element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},si="file:./render.php",oi="file:./style.css",di="times-design-system",ci="file:./init.js",ui={combinations:[{ariaLabel:"Sections",innerBlocks:[{block:"tab",attributes:{label:"Overview"}},{block:"tab",attributes:{label:"Details"}},{block:"tab",attributes:{label:"Settings"}}]},{ariaLabel:"Sections",defaultSelectedIndex:1,innerBlocks:[{block:"tab",attributes:{label:"Overview"}},{block:"tab",attributes:{label:"Details"}},{block:"tab",attributes:{label:"Disabled",disabled:!0}}]},{ariaLabel:"Sections",behaviour:"100%",innerBlocks:[{block:"tab",attributes:{label:"News",leftIcon:"filled_circle"}},{block:"tab",attributes:{label:"Sport",leftIcon:"filled_circle"}},{block:"tab",attributes:{label:"Culture",leftIcon:"filled_circle"}}]},{ariaLabel:"Sections",innerBlocks:[{block:"tab",attributes:{label:"Overview",size:"large",channel:!0}},{block:"tab",attributes:{label:"Details",size:"large",channel:!0}}]}]},W={$schema:Kl,apiVersion:Zl,name:Ql,title:ei,category:ti,description:ai,icon:li,supports:ii,textdomain:ni,attributes:ri,render:si,style:oi,editorScript:di,viewScript:ci,preview:ui};x.registerBlockType(W.name,{...W,edit:Jl,save:Yl});function M({title:u,value:a={},onChange:l}){const s=(r,d)=>{const o={...a,[r]:d||void 0};l(o.label?o:void 0)};return e.createElement(t.PanelBody,{title:u,initialOpen:!1},e.createElement(t.TextControl,{label:"Label",value:a.label||"",onChange:r=>s("label",r),help:"Leave empty to hide the button"}),e.createElement(t.TextControl,{label:"URL",value:a.href||"",onChange:r=>s("href",r)}),e.createElement(t.TextControl,{label:"onClick function name",value:a.onClick||"",onChange:r=>s("onClick",r)}))}function U({intent:u,cta:a}){return a!=null&&a.label?e.createElement("button",{type:"button",className:`tds-button tds-button--intent-${u} tds-button--size-small`},e.createElement("span",{className:"tds-button__label-container"},e.createElement("span",{className:"tds-text utility-button-small"},a.label))):null}function pi({attributes:u,setAttributes:a}){const{title:l,primaryCTA:s,secondaryCTA:r,isOpen:d,dismiss:o,hideOverlay:n,disableOverlayDismiss:c,disableEscDismiss:v,role:p,id:y,content:h,classes:m}=u,f=["tds-dialog-box",n?"tds-dialog-box--no-overlay":"",m].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),!d&&e.createElement("p",{style:{fontSize:"12px",color:"#666"}},"Dialog is closed (isOpen is off) and renders nothing on the frontend."),e.createElement("div",{className:f,style:{position:"relative",zIndex:0}},e.createElement("div",{className:"tds-dialog-box__overlay","aria-hidden":"true"}),e.createElement("div",{className:"tds-dialog-box__surface",role:p,"aria-modal":"true"},e.createElement("div",{className:"tds-dialog-box__header"},e.createElement("span",{className:"tds-text brand-heading-fluid-regular-small"},l),o&&e.createElement("button",{type:"button",className:"tds-button tds-button--intent-secondary tds-icon-button--size-small tds-dialog-box__dismiss","aria-label":"Dismiss"},e.createElement("span",{className:"tds-button__icon","aria-hidden":"true"},"\xD7"))),e.createElement("div",{className:"tds-dialog-box__content"},h&&e.createElement("div",{dangerouslySetInnerHTML:{__html:h}}),e.createElement(b.InnerBlocks,null)),e.createElement("div",{className:"tds-dialog-box__footer"},e.createElement(U,{intent:"secondary",cta:r}),e.createElement(U,{intent:"primary",cta:s})))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Dialog Settings"},e.createElement(t.ToggleControl,{label:"Open",checked:!!d,onChange:i=>a({isOpen:i})}),e.createElement(t.TextControl,{label:"Title",value:l||"",onChange:i=>a({title:i})}),e.createElement(t.TextareaControl,{label:"Content",value:h,onChange:i=>a({content:i}),help:"Inner blocks are rendered after this content"}),e.createElement(t.ToggleControl,{label:"Dismiss button",checked:!!o,onChange:i=>a({dismiss:i})}),e.createElement(t.SelectControl,{label:"Role",value:p,options:[{label:"Dialog",value:"dialog"},{label:"Alert dialog",value:"alertdialog"}],onChange:i=>a({role:i})}),e.createElement(t.ToggleControl,{label:"Hide overlay",checked:n,onChange:i=>a({hideOverlay:i})}),e.createElement(t.ToggleControl,{label:"Disable overlay dismiss",checked:c,onChange:i=>a({disableOverlayDismiss:i})}),e.createElement(t.ToggleControl,{label:"Disable Escape dismiss",checked:v,onChange:i=>a({disableEscDismiss:i})})),e.createElement(M,{title:"Primary CTA",value:s,onChange:i=>a({primaryCTA:i})}),e.createElement(M,{title:"Secondary CTA",value:r,onChange:i=>a({secondaryCTA:i})}),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"ID",value:y||"",onChange:i=>a({id:i||void 0})}),e.createElement(t.TextControl,{label:"Custom Classes",value:m,onChange:i=>a({classes:i}),placeholder:"class-name-1 class-name-2"}))))}function bi(){return e.createElement(b.InnerBlocks.Content,null)}var hi="https://schemas.wp.org/trunk/block.json",mi=3,gi="tds/dialog-box",vi="Dialog Box",yi="common",fi="Modal dialog with title, content and call-to-action buttons",Ci="welcome-widgets-menus",xi={html:!1,customClassName:!0},Si="times-design-system",$i="file:./render.php",Ei={title:{type:"string",description:"Dialog title"},primaryCTA:{type:"object",properties:{label:{type:"string"},href:{type:"string"},onClick:{type:"string"}},description:"Primary CTA: { label, href?, onClick? } (onClick is a global JS function name)"},secondaryCTA:{type:"object",properties:{label:{type:"string"},href:{type:"string"},onClick:{type:"string"}},description:"Secondary CTA: { label, href?, onClick? } (onClick is a global JS function name)"},isOpen:{type:"boolean",description:"Controls dialog visibility; nothing renders unless true"},dismiss:{type:"boolean",description:"Show the dismiss icon button in the header"},hideOverlay:{type:"boolean",default:!1,description:"Hide the overlay scrim (use only for embedded demos)"},disableOverlayDismiss:{type:"boolean",default:!1,description:"Disable overlay click-to-dismiss"},disableEscDismiss:{type:"boolean",default:!1,description:"Disable ESC-to-dismiss"},role:{type:"string",enum:["dialog","alertdialog"],default:"dialog",description:"Accessible role; use 'alertdialog' for urgent confirmations"},id:{type:"string",description:"Root element id; also used to build the title/body ids (generated when empty)"},content:{type:"string",default:"",description:"Dialog body HTML (WordPress extra; inner blocks are rendered after it)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the dialog root element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},ki="times-design-system",wi="file:./init.js",Ti=["file:./style.css","tds-button-style","tds-icon-button-style"],Li={combinations:[{isOpen:!0,hideOverlay:!0,title:"Confirm action",content:"Are you sure you want to proceed?",primaryCTA:{label:"Confirm"},secondaryCTA:{label:"Cancel"}},{isOpen:!0,hideOverlay:!0,dismiss:!0,title:"Information",content:"This is an informational dialog.",primaryCTA:{label:"Read more",href:"https://www.thetimes.com"}},{isOpen:!0,hideOverlay:!0,role:"alertdialog",disableOverlayDismiss:!0,disableEscDismiss:!0,title:"Delete item",content:"This action cannot be undone.",primaryCTA:{label:"Delete"},secondaryCTA:{label:"Keep"}}]},H={$schema:hi,apiVersion:mi,name:gi,title:vi,category:yi,description:fi,icon:Ci,supports:xi,textdomain:Si,render:$i,attributes:Ei,editorScript:ki,viewScript:wi,style:Ti,preview:Li};x.registerBlockType(H.name,{...H,edit:pi,save:bi});function _i({attributes:u,setAttributes:a}){const{type:l,message:s,id:r,classes:d}=u,o=l||"info";return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Input Helper Message Settings",initialOpen:!0},e.createElement(t.SelectControl,{label:"Type",value:o,options:[{label:"Error",value:"error"},{label:"Success",value:"success"},{label:"Info",value:"info"},{label:"Warning",value:"warning"}],onChange:n=>a({type:n})}),e.createElement(t.TextControl,{label:"Message",value:s||"",onChange:n=>a({message:n}),placeholder:"Enter helper text..."}),e.createElement(t.TextControl,{label:"ID",value:r||"",onChange:n=>a({id:n||void 0}),help:"Reference this id from the input's aria-describedby"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d||"",onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the message element"}))),e.createElement("span",{id:r||void 0,className:["tds-input-helper-message",`tds-input-helper-message--${o}`,d].filter(Boolean).join(" ")},e.createElement("span",{className:"tds-input-helper-message__icon","aria-hidden":"true"}),e.createElement("span",{className:"tds-text utility-body-regular-small"},s)))}function Bi(){return null}var Ii="https://schemas.wp.org/trunk/block.json",Ni=3,zi="tds/input-helper-message",Pi="Input Helper Message",Di="common",ji="Per-field status indicator: a status icon and helper text beneath an input control",Oi="info-outline",Ri={html:!1,multiple:!0,reusable:!0,customClassName:!0},Vi="times-blocks",Wi={type:{type:"string",enum:["error","success","info","warning"],description:"Sets semantic intent, icon variant, and icon colour (falls back to info when unset)"},message:{type:"string",description:"Plain text or text with inline links"},id:{type:"string",description:"Element id, for aria-describedby association from the parent input"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the rendered message element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Mi="file:./render.php",Ui="file:./style.css",Hi="times-design-system",qi={combinations:[{type:"error",message:"This field is required"},{type:"success",message:"Username is available"},{type:"info",message:"Minimum 8 characters"},{type:"warning",message:"Your session will expire soon"},{type:"info",message:'Read our <a href="#">password guidance</a>'}]},q={$schema:Ii,apiVersion:Ni,name:zi,title:Pi,category:Di,description:ji,icon:Oi,supports:Ri,textdomain:Vi,attributes:Wi,render:Mi,style:Ui,editorScript:Hi,preview:qi};x.registerBlockType(q.name,{...q,edit:_i,save:Bi});const Ai={"2xsmall":12,xsmall:16,small:20,medium:24,large:28,xlarge:32,"2xlarge":40};function Fi({attributes:u,setAttributes:a}){const{iconName:l,size:s,sizeName:r,classes:d}=u,o=s||Ai[r]||24;return e.createElement("div",b.useBlockProps(),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Icon Settings",initialOpen:!0},e.createElement(t.TextControl,{label:"Icon Name",value:l||"",onChange:n=>a({iconName:n||void 0}),placeholder:"filled_circle",help:"Icon name with variant prefix (filled_ or outlined_)"}),e.createElement(t.SelectControl,{label:"Size Name",value:r||"",options:[{label:"Default (24px)",value:""},{label:"2XSmall (12px)",value:"2xsmall"},{label:"XSmall (16px)",value:"xsmall"},{label:"Small (20px)",value:"small"},{label:"Medium (24px)",value:"medium"},{label:"Large (28px)",value:"large"},{label:"XLarge (32px)",value:"xlarge"},{label:"2XLarge (40px)",value:"2xlarge"}],onChange:n=>a({sizeName:n||void 0})}),e.createElement(t.__experimentalNumberControl,{label:"Size (px)",value:s!=null?s:"",min:1,onChange:n=>{const c=parseInt(n,10);a({size:c>0?c:void 0})},help:"Overrides Size Name when set"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d||"",onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the svg element"}))),e.createElement("svg",{className:d||void 0,width:o,height:o,viewBox:"0 0 24 24",role:"img","aria-label":l||"No icon selected"},e.createElement("rect",{width:"24",height:"24",fill:"none",stroke:"currentColor",strokeDasharray:"2 2"})))}function Gi(){return null}var Xi="https://schemas.wp.org/trunk/block.json",Ji=3,Yi="tds/icon",Ki="Icon",Zi="common",Qi="Inline SVG icon from the Times Design System icon set",en="star-filled",tn={html:!1,multiple:!0,reusable:!0,customClassName:!0},an="times-blocks",ln={iconName:{type:"string",description:"The name of the icon with variant prefix (e.g., 'filled_circle', 'outlined_check')"},size:{type:"number",description:"Icon size in pixels; takes precedence over sizeName"},sizeName:{type:"string",enum:["2xsmall","xsmall","small","medium","large","xlarge","2xlarge"],description:"Named icon size (2xsmall 12px to 2xlarge 40px)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the svg element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},nn="file:./render.php",rn="times-design-system",sn="file:./style.css",on={combinations:[{iconName:"filled_circle"},{iconName:"filled_circle",sizeName:"2xsmall"},{iconName:"filled_circle",sizeName:"xsmall"},{iconName:"filled_circle",sizeName:"small"},{iconName:"filled_circle",sizeName:"medium"},{iconName:"filled_circle",sizeName:"large"},{iconName:"filled_circle",sizeName:"xlarge"},{iconName:"filled_circle",sizeName:"2xlarge"},{iconName:"outlined_check",size:48},{iconName:"filled_arrow_right"}]},A={$schema:Xi,apiVersion:Ji,name:Yi,title:Ki,category:Zi,description:Qi,icon:en,supports:tn,textdomain:an,attributes:ln,render:nn,editorScript:rn,style:sn,preview:on};x.registerBlockType(A.name,{...A,edit:Fi,save:Gi});function F({title:u,value:a,onChange:l}){const s=a||{},r=(d,o)=>{const n={...s,[d]:o};l(n.label?n:void 0)};return e.createElement(t.PanelBody,{title:u,initialOpen:!1},e.createElement(t.TextControl,{label:"Label",value:s.label||"",onChange:d=>r("label",d),placeholder:"Button label..."}),e.createElement(t.TextControl,{label:"URL",value:s.href||"",onChange:d=>r("href",d||void 0),placeholder:"https://example.com"}),e.createElement(t.TextControl,{label:"onClick function name",value:s.onClick||"",onChange:d=>r("onClick",d||void 0),placeholder:"myFunction"}))}function G({cta:u,className:a}){return e.createElement("button",{type:"button",className:`tds-button tds-button--intent-secondary tds-button--size-small ${a}`},e.createElement("span",{className:"tds-button__label-container"},e.createElement("span",{className:"tds-text utility-button-small"},u.label)))}function dn({attributes:u,setAttributes:a}){const{intent:l,heading:s,body:r,dismiss:d,cta_1:o,cta_2:n,classes:c}=u,v=["tds-banner",`tds-banner--${l}`,c].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{className:v},e.createElement("div",{className:"tds-banner__label"},e.createElement("span",{className:"tds-banner__icon","aria-hidden":"true"}),e.createElement("span",{className:"tds-text utility-body-bold-medium tds-banner__heading"},s),d&&e.createElement("button",{type:"button",className:"tds-banner__dismiss","aria-label":"Dismiss"},"\xD7")),e.createElement("p",{className:"tds-text utility-body-regular-medium tds-banner__content"},r),(o||n)&&e.createElement("div",{className:"tds-banner__actions"},o&&e.createElement(G,{cta:o,className:n?"tds-banner__button":"tds-banner__button tds-banner__button--full"}),n&&e.createElement(G,{cta:n,className:"tds-banner__button"}))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Banner Settings",initialOpen:!0},e.createElement(t.SelectControl,{label:"Intent",value:l,options:[{label:"Success",value:"success"},{label:"Info",value:"info"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}],onChange:p=>a({intent:p})}),e.createElement(t.TextControl,{label:"Heading",value:s||"",onChange:p=>a({heading:p}),placeholder:"Banner heading..."}),e.createElement(t.TextControl,{label:"Body",value:r||"",onChange:p=>a({body:p}),placeholder:"Banner message..."}),e.createElement(t.ToggleControl,{label:"Dismissible",checked:!!d,onChange:p=>a({dismiss:p}),help:"Allow users to dismiss this banner"})),e.createElement(F,{title:"CTA Button 1",value:o,onChange:p=>a({cta_1:p})}),e.createElement(F,{title:"CTA Button 2",value:n,onChange:p=>a({cta_2:p})}),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:c||"",onChange:p=>a({classes:p}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the banner element"}))))}function cn(){return null}var un="https://schemas.wp.org/trunk/block.json",pn=3,bn="tds/banner",hn="Banner",mn="common",gn="Inline status banner with optional dismiss and call-to-action buttons",vn="megaphone",yn={html:!1,multiple:!0,reusable:!0,customClassName:!0},fn="times-design-system",Cn={intent:{type:"string",enum:["success","info","warning","error"],default:"info",description:"Semantic intent controlling colours and icon (required in React)"},heading:{type:"string",description:"The heading text displayed inside the banner"},body:{type:"string",description:"The body text displayed inside the banner"},dismiss:{type:"boolean",description:"Whether the banner can be dismissed by the user"},cta_1:{type:"object",description:"CTA button 1: { label, href?, onClick? } (onClick is a global JS function name)"},cta_2:{type:"object",description:"CTA button 2: { label, href?, onClick? } (onClick is a global JS function name)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the banner element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},xn="file:./render.php",Sn=["file:./style.css","tds-button-style"],$n="times-design-system",En="file:./init.js",kn={combinations:[{intent:"info",heading:"Information",body:"This is an informational banner"},{intent:"success",heading:"Success",body:"Operation completed successfully"},{intent:"warning",heading:"Warning",body:"This is a warning message"},{intent:"error",heading:"Error",body:"An error occurred"},{intent:"info",heading:"Dismissible",body:"This banner can be dismissed",dismiss:!0},{intent:"info",heading:"One action",body:"A single CTA fills the width",cta_1:{label:"Learn more",href:"#"}},{intent:"warning",heading:"Two actions",body:"Two CTAs share the row",dismiss:!0,cta_1:{label:"Accept",href:"#"},cta_2:{label:"Decline",href:"#"}}]},X={$schema:un,apiVersion:pn,name:bn,title:hn,category:mn,description:gn,icon:vn,supports:yn,textdomain:fn,attributes:Cn,render:xn,style:Sn,editorScript:$n,viewScript:En,preview:kn};x.registerBlockType(X.name,{...X,edit:dn,save:cn});function wn({attributes:u,setAttributes:a}){const{direction:l,icon:s,label:r,classes:d}=u,o=["tds-tooltip",`tds-tooltip--direction-${l}`,d].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("span",{className:o},e.createElement("span",{className:"tds-text utility-body-regular-small"},r)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Tooltip Settings"},e.createElement(t.SelectControl,{label:"Direction",value:l,options:[{label:"Up",value:"up"},{label:"Down",value:"down"},{label:"Up Left",value:"up-left"},{label:"Up Right",value:"up-right"},{label:"Down Left",value:"down-left"},{label:"Down Right",value:"down-right"}],onChange:n=>a({direction:n})}),e.createElement(t.TextControl,{label:"Label",value:r||"",onChange:n=>a({label:n}),placeholder:"Enter tooltip text..."}),e.createElement(t.TextControl,{label:"Icon",value:s||"",onChange:n=>a({icon:n}),placeholder:"e.g. filled_info"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:d||"",onChange:n=>a({classes:n}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the tooltip element"}))))}function Tn(){return null}var Ln="https://schemas.wp.org/trunk/block.json",_n=3,Bn="tds/tooltip",In="Times Design System - Tooltip",Nn="common",zn="Small tooltip bubble with a directional arrow, optional icon and label",Pn="block-default",Dn={html:!1,multiple:!0,reusable:!0,customClassName:!0},jn="times-blocks",On={direction:{type:"string",enum:["up","down","up-left","up-right","down-left","down-right"],default:"up",description:"Direction of the tooltip arrow"},icon:{type:"string",description:"Optional icon name with variant prefix (e.g. 'filled_info')"},label:{type:"string",description:"Visible label text"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the tooltip element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Rn="file:./render.php",Vn="file:./style.css",Wn="times-design-system",Mn={combinations:[{label:"Helpful information",direction:"up"},{label:"Below tooltip",direction:"down"},{label:"Top left",direction:"up-left"},{label:"Top right",direction:"up-right"},{label:"Bottom left",direction:"down-left"},{label:"Bottom right",direction:"down-right"},{label:"With icon",direction:"up",icon:"filled_help"}]},J={$schema:Ln,apiVersion:_n,name:Bn,title:In,category:Nn,description:zn,icon:Pn,supports:Dn,textdomain:jn,attributes:On,render:Rn,style:Vn,editorScript:Wn,preview:Mn};x.registerBlockType(J.name,{...J,edit:wn,save:Tn});function w(){return w=Object.assign?Object.assign.bind():function(u){for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var s in l)({}).hasOwnProperty.call(l,s)&&(u[s]=l[s])}return u},w.apply(null,arguments)}const Un=["base","hover","focus","readOnly","disabled","info","success","error","warning"],Hn=["info","success","error","warning"];function L({state:u="base",intent:a="off",checked:l,defaultChecked:s=!1,indeterminate:r,label:d,description:o,statusMessage:n,disabled:c=!1,readOnly:v=!1,className:p}){const y=l!==void 0?!!l:s,h=c||u==="disabled",m=v||u==="readOnly",f=r!==void 0?r:a==="indeterminate",i=Hn.includes(u)?u:void 0;return e.createElement("label",{className:["tds-checkbox",`tds-checkbox--state-${u}`,y&&"tds-checkbox--checked",f&&"tds-checkbox--indeterminate",h&&"tds-checkbox--disabled",m&&"tds-checkbox--readonly",p].filter(Boolean).join(" ")},e.createElement("input",{type:"checkbox",checked:y,disabled:h,readOnly:!0}),e.createElement("span",{className:"tds-checkbox__box","aria-hidden":"true"}),(d||o||n)&&e.createElement("span",{className:"tds-checkbox__content"},d&&e.createElement("span",{className:"tds-checkbox__label"},d),o&&e.createElement("span",{className:"tds-checkbox__description"},o),n&&e.createElement("span",{className:["tds-checkbox__status",i&&`tds-checkbox__status--${i}`].filter(Boolean).join(" ")},n)))}function qn({attributes:u,setAttributes:a}){const{state:l,intent:s,checked:r,defaultChecked:d,indeterminate:o,label:n,description:c,statusMessage:v,id:p,name:y,disabled:h,readOnly:m,ariaLabel:f,classes:i}=u;return e.createElement("div",b.useBlockProps(),e.createElement(L,w({},u,{className:i})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Checkbox Settings"},e.createElement(t.TextControl,{label:"Label",value:n||"",onChange:g=>a({label:g||void 0})}),e.createElement(t.TextControl,{label:"Description",value:c||"",onChange:g=>a({description:g||void 0})}),e.createElement(t.TextControl,{label:"Status message",value:v||"",onChange:g=>a({statusMessage:g||void 0})}),e.createElement(t.SelectControl,{label:"State",value:l,options:Un.map(g=>({label:g,value:g})),onChange:g=>a({state:g})}),e.createElement(t.SelectControl,{label:"Intent",value:s,options:[{label:"Off",value:"off"},{label:"On",value:"on"},{label:"Indeterminate",value:"indeterminate"}],onChange:g=>a({intent:g})}),e.createElement(t.SelectControl,{label:"Checked",value:r===void 0?"":String(r),options:[{label:"Uncontrolled (use default)",value:""},{label:"Checked",value:"true"},{label:"Unchecked",value:"false"}],onChange:g=>a({checked:g===""?void 0:g==="true"})}),e.createElement(t.ToggleControl,{label:"Default checked",checked:!!d,onChange:g=>a({defaultChecked:g})}),e.createElement(t.SelectControl,{label:"Indeterminate",value:o===void 0?"":String(o),options:[{label:"From intent",value:""},{label:"Yes",value:"true"},{label:"No",value:"false"}],onChange:g=>a({indeterminate:g===""?void 0:g==="true"})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!h,onChange:g=>a({disabled:g})}),e.createElement(t.ToggleControl,{label:"Read only",checked:!!m,onChange:g=>a({readOnly:g})})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.TextControl,{label:"Name",value:y||"",onChange:g=>a({name:g||void 0})}),e.createElement(t.TextControl,{label:"ID",value:p||"",onChange:g=>a({id:g||void 0})}),e.createElement(t.TextControl,{label:"Aria label",value:f||"",onChange:g=>a({ariaLabel:g||void 0}),help:"Defaults to the label, then 'Checkbox'"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:i||"",onChange:g=>a({classes:g}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the checkbox label element"}))))}function An(){return null}var Fn="https://schemas.wp.org/trunk/block.json",Gn=3,Xn="tds/checkbox",Jn="Times Design System - Checkbox",Yn="common",Kn="WordPress block for Times Design System Checkbox component",Zn="block-default",Qn={html:!1,multiple:!0,reusable:!0,customClassName:!0},er="times-blocks",tr={checked:{type:"boolean",description:"Controlled checked state (falls back to defaultChecked when unset)"},defaultChecked:{type:"boolean",default:!1,description:"Initial checked state when checked is unset"},indeterminate:{type:"boolean",description:"Indeterminate state (overrides intent when set)"},label:{type:"string",description:"Label text displayed next to the checkbox"},description:{type:"string",description:"Description text displayed below the label"},helperMessage:{type:"string",description:"Helper message"},id:{type:"string",description:"id attribute for the checkbox input"},name:{type:"string",description:"name attribute for the checkbox input"},disabled:{type:"boolean",default:!1,description:"Whether the checkbox is disabled"},readOnly:{type:"boolean",default:!1,description:"Whether the checkbox is read-only"},ariaLabel:{type:"string",description:"Accessible name override (defaults to the label, then 'Checkbox')"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the checkbox element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},ar="file:./render.php",lr="file:./style.css",ir="times-design-system",nr="file:./init.js",rr={combinations:[{label:"Unchecked"},{label:"Checked",checked:!0},{label:"Indeterminate",indeterminate:!0},{label:"Read only",readOnly:!0,checked:!0},{label:"Disabled",disabled:!0},{label:"Disabled checked",disabled:!0,checked:!0},{label:"With description",description:"Supporting description text"},{label:"With status message",checked:!0,helperMessage:"Selection saved"},{ariaLabel:"Unlabelled checkbox"}]},Y={$schema:Fn,apiVersion:Gn,name:Xn,title:Jn,category:Yn,description:Kn,icon:Zn,supports:Qn,textdomain:er,attributes:tr,render:ar,style:lr,editorScript:ir,viewScript:nr,preview:rr};x.registerBlockType(Y.name,{...Y,edit:qn,save:An});const sr={active:"focus",hover:"hover"};function K({size:u="medium",state:a="base",checked:l,defaultChecked:s=!1,indeterminate:r=!1,disabled:d=!1,label:o,description:n,endContent:c,className:v}){var p;return e.createElement("div",{className:["tds-checkbox-list-item",`tds-checkbox-list-item--size-${u}`,`tds-checkbox-list-item--state-${a}`,d&&"tds-checkbox-list-item--disabled",v].filter(Boolean).join(" ")},e.createElement(L,{state:d?"disabled":(p=sr[a])!=null?p:"base",checked:l!==void 0?l:s,indeterminate:r,disabled:d,label:o,description:n}),c&&e.createElement("div",{className:"tds-checkbox-list-item__end-content","aria-hidden":"true"},c))}function or({attributes:u,setAttributes:a,context:l={}}){var m;const{size:s,state:r,checked:d,defaultChecked:o,indeterminate:n,disabled:c,label:v,description:p,endContent:y,classes:h}=u;return e.createElement("div",b.useBlockProps(),e.createElement(K,w({},u,{size:(m=l["tds/checkboxListSize"])!=null?m:s,disabled:c||!!l["tds/checkboxListDisabled"],className:h})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Checkbox List Item Settings"},e.createElement(t.TextControl,{label:"Label",value:v||"",onChange:f=>a({label:f})}),e.createElement(t.TextControl,{label:"Description",value:p||"",onChange:f=>a({description:f||void 0})}),e.createElement(t.TextControl,{label:"End content",value:y||"",onChange:f=>a({endContent:f||void 0}),help:"Trailing content such as a count"}),e.createElement(t.SelectControl,{label:"Size",value:s,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:f=>a({size:f}),help:"Overridden by the parent checkbox list size"}),e.createElement(t.SelectControl,{label:"State",value:r,options:[{label:"Base",value:"base"},{label:"Hover",value:"hover"},{label:"Active",value:"active"}],onChange:f=>a({state:f})}),e.createElement(t.SelectControl,{label:"Checked",value:d===void 0?"":String(d),options:[{label:"Uncontrolled (use default)",value:""},{label:"Checked",value:"true"},{label:"Unchecked",value:"false"}],onChange:f=>a({checked:f===""?void 0:f==="true"})}),e.createElement(t.ToggleControl,{label:"Default checked",checked:!!o,onChange:f=>a({defaultChecked:f})}),e.createElement(t.ToggleControl,{label:"Indeterminate",checked:!!n,onChange:f=>a({indeterminate:f})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!c,onChange:f=>a({disabled:f})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:h||"",onChange:f=>a({classes:f}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the list item element"}))))}const dr=["tds/checkbox-list-item"],cr=[["tds/checkbox-list-item",{label:"Option 1"}],["tds/checkbox-list-item",{label:"Option 2"}]];function ur({attributes:u,setAttributes:a}){var C;const{size:l,options:s,selectedIds:r,defaultSelectedIds:d,label:o,helperText:n,statusMessage:c,hasDividers:v,showSelectAll:p,selectAllLabel:y,disabled:h,classes:m}=u,f=Array.isArray(s)?s:[],i=f.length>0,g=new Set((C=r!=null?r:d)!=null?C:[]),$=f.filter(S=>!S.disabled),T=$.filter(S=>g.has(S.id)).length,E=$.length>0&&T===$.length;return e.createElement("div",b.useBlockProps(),e.createElement("fieldset",{className:["tds-checkbox-list",`tds-checkbox-list--size-${l}`,v&&"tds-checkbox-list--dividers",h&&"tds-checkbox-list--disabled",m].filter(Boolean).join(" ")},o&&e.createElement("legend",{className:"tds-checkbox-list__label"},o),n&&e.createElement("p",{className:"tds-checkbox-list__helper"},n),p&&e.createElement("div",{className:"tds-checkbox-list__select-all"},e.createElement(L,{checked:i&&E,indeterminate:i&&!E&&T>0,label:y,disabled:h})),e.createElement("div",{className:"tds-checkbox-list__items"},i?f.map(S=>e.createElement("div",{key:S.id,className:"tds-checkbox-list__item-row"},e.createElement(K,{size:l,label:S.label,description:S.description,endContent:S.endContent,checked:g.has(S.id),disabled:h||!!S.disabled}))):e.createElement(b.InnerBlocks,{allowedBlocks:dr,template:cr})),c&&e.createElement("p",{className:"tds-checkbox-list__status"},c)),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Checkbox List Settings"},e.createElement(t.TextControl,{label:"Label",value:o||"",onChange:S=>a({label:S||void 0})}),e.createElement(t.TextControl,{label:"Helper text",value:n||"",onChange:S=>a({helperText:S||void 0})}),e.createElement(t.TextControl,{label:"Status message",value:c||"",onChange:S=>a({statusMessage:S||void 0})}),e.createElement(t.SelectControl,{label:"Size",value:l,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:S=>a({size:S})}),e.createElement(t.ToggleControl,{label:"Dividers",checked:!!v,onChange:S=>a({hasDividers:S})}),e.createElement(t.ToggleControl,{label:"Show select all",checked:!!p,onChange:S=>a({showSelectAll:S})}),p&&e.createElement(t.TextControl,{label:"Select all label",value:y||"",onChange:S=>a({selectAllLabel:S})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!h,onChange:S=>a({disabled:S})}),e.createElement("p",{style:{fontSize:"12px",color:"#666"}},"Add items as Checkbox List Item blocks. On the front end the options attribute is used only when there are no inner blocks.")),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:m||"",onChange:S=>a({classes:S}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the fieldset element"}))))}function pr(){return e.createElement(b.InnerBlocks.Content,null)}var br="https://schemas.wp.org/trunk/block.json",hr=3,mr="tds/checkbox-list",gr="Times Design System - CheckboxList",vr="common",yr="WordPress block for Times Design System CheckboxList container component",fr="block-default",Cr={html:!1,multiple:!0,reusable:!0,customClassName:!0},xr="times-blocks",Sr={size:{type:"string",enum:["small","medium"],default:"medium",description:"Size applied to every item"},options:{type:"array",items:{type:"object"},description:"Items as { id, label, description?, disabled?, endContent? }; used when the block has no inner checkbox-list-item blocks"},selectedIds:{type:"array",items:{type:"string"},description:"Controlled selected option ids (falls back to defaultSelectedIds when unset)"},defaultSelectedIds:{type:"array",items:{type:"string"},default:[],description:"Initially selected option ids"},label:{type:"string",description:"Group label rendered as the fieldset legend"},helperText:{type:"string",description:"Helper text displayed under the label"},statusMessage:{type:"string",description:"Status message displayed after the items"},hasDividers:{type:"boolean",default:!1,description:"Show dividers between items"},showSelectAll:{type:"boolean",default:!1,description:"Show a select-all checkbox above the items"},selectAllLabel:{type:"string",default:"Select all",description:"Label for the select-all checkbox"},disabled:{type:"boolean",default:!1,description:"Disable the whole list"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the checkbox list element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},$r="file:./render.php",Er=["file:./style.css","tds-checkbox-style","tds-checkbox-list-item-style"],kr="times-design-system",wr="file:./init.js",Tr={combinations:[{label:"Topics",options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Topics",helperText:"Choose one or more",options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}],defaultSelectedIds:["sport"]},{label:"Topics",size:"small",options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Topics",hasDividers:!0,options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Topics",showSelectAll:!0,options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}],defaultSelectedIds:["news"]},{label:"Topics",showSelectAll:!0,options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}],defaultSelectedIds:["news","sport","culture"]},{label:"Topics",statusMessage:"Select at least one topic",options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Topics",disabled:!0,showSelectAll:!0,options:[{id:"news",label:"News"},{id:"sport",label:"Sport",description:"Scores and analysis"},{id:"culture",label:"Culture",endContent:"12"},{id:"puzzles",label:"Puzzles",disabled:!0}]},{label:"Inner blocks",showSelectAll:!0,innerBlocks:[{block:"checkbox-list-item",attributes:{label:"Newsletter",checked:!0}},{block:"checkbox-list-item",attributes:{label:"Offers",description:"Partner offers"}},{block:"checkbox-list-item",attributes:{label:"Events",endContent:"4"}}]}]},Lr={"tds/checkboxListSize":"size","tds/checkboxListDisabled":"disabled"},Z={$schema:br,apiVersion:hr,name:mr,title:gr,category:vr,description:yr,icon:fr,supports:Cr,textdomain:xr,attributes:Sr,render:$r,style:Er,editorScript:kr,viewScript:wr,preview:Tr,providesContext:Lr};x.registerBlockType(Z.name,{...Z,edit:ur,save:pr});function _r(){return null}var Br="https://schemas.wp.org/trunk/block.json",Ir=3,Nr="tds/checkbox-list-item",zr="Times Design System - CheckboxListItem",Pr="common",Dr="WordPress block for Times Design System CheckboxListItem child component (use inside CheckboxList)",jr="block-default",Or=["tds/checkbox-list"],Rr={html:!1,multiple:!0,reusable:!1,customClassName:!0},Vr="times-blocks",Wr={size:{type:"string",enum:["small","medium"],default:"medium",description:"Item size"},checked:{type:"boolean",description:"Controlled checked state (falls back to defaultChecked when unset)"},defaultChecked:{type:"boolean",default:!1,description:"Initial checked state when checked is unset"},indeterminate:{type:"boolean",default:!1,description:"Whether the checkbox is indeterminate"},disabled:{type:"boolean",default:!1,description:"Whether the item is disabled"},label:{type:"string",description:"Label text"},description:{type:"string",description:"Description text displayed below the label"},endContent:{type:"string",description:"Trailing content (e.g. a count) shown at the end of the row"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the list item element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Mr="file:./render.php",Ur=["file:./style.css","tds-checkbox-style"],Hr="times-design-system",qr={combinations:[{label:"Medium"},{label:"Small",size:"small"},{label:"Checked",checked:!0},{label:"Indeterminate",indeterminate:!0},{label:"Disabled",disabled:!0},{label:"With description",description:"Supporting description text"},{label:"With end content",endContent:"24"}]},Ar=["tds/checkboxListSize","tds/checkboxListDisabled"],Q={$schema:Br,apiVersion:Ir,name:Nr,title:zr,category:Pr,description:Dr,icon:jr,parent:Or,supports:Rr,textdomain:Vr,attributes:Wr,render:Mr,style:Ur,editorScript:Hr,preview:qr,usesContext:Ar};x.registerBlockType(Q.name,{...Q,edit:or,save:_r});function Fr(u=[]){return u.map(({value:a,label:l})=>`${a}|${l}`).join(`
|
|
2
2
|
`)}function Gr(u){return u.split(`
|
|
3
3
|
`).map(a=>a.trim()).filter(Boolean).map(a=>{const[l,...s]=a.split("|"),r=s.join("|").trim();return{value:l.trim(),label:r||l.trim()}})}function ee({items:u,onChange:a}){return e.createElement(t.TextareaControl,{label:"Items",help:"One option per line as value|label",value:Fr(u),onChange:l=>a(Gr(l))})}function Xr({attributes:u,setAttributes:a}){const{size:l,placeholder:s,options:r,items:d=[],value:o,label:n,iconLeft:c,isDisabled:v,isReadOnly:p,isError:y,classes:h}=u,m=d.find(i=>i.value===o),f=["tds-dropdown__trigger",`tds-dropdown__trigger--size-${l}`,m?"tds-dropdown__trigger--completed":"",p?"tds-dropdown__trigger--read-only":"",y?"tds-dropdown__trigger--error":""].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("div",{className:["tds-dropdown",h].filter(Boolean).join(" ")},n&&e.createElement("label",{className:"tds-text utility-body-regular-medium tds-dropdown__label utility-label-small"},n),e.createElement("button",{type:"button",className:f,"aria-haspopup":"listbox","aria-expanded":"false","data-value":m==null?void 0:m.value,disabled:v||p},e.createElement("span",{className:"tds-dropdown__value"},e.createElement("span",{className:`tds-text utility-inputLabel-${l}`},m?m.label:s))),e.createElement(b.InnerBlocks,{allowedBlocks:["tds/dropdown-menu"]})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Dropdown Settings"},e.createElement(t.TextControl,{label:"Label",value:n||"",onChange:i=>a({label:i})}),e.createElement(t.TextControl,{label:"Placeholder",value:s,onChange:i=>a({placeholder:i})}),e.createElement(t.SelectControl,{label:"Size",value:l,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:i=>a({size:i})}),e.createElement(t.SelectControl,{label:"Options",value:r,options:[{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"}],onChange:i=>a({options:i})}),e.createElement(ee,{items:d,onChange:i=>a({items:i})}),e.createElement(t.SelectControl,{label:"Value",value:o||"",options:[{label:"None",value:""},...d.map(i=>({label:i.label,value:i.value}))],onChange:i=>a({value:i||void 0})}),e.createElement(t.TextControl,{label:"Icon Left",value:c||"",onChange:i=>a({iconLeft:i}),placeholder:"Icon name"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:v,onChange:i=>a({isDisabled:i})}),e.createElement(t.ToggleControl,{label:"Read only",checked:p,onChange:i=>a({isReadOnly:i})}),e.createElement(t.ToggleControl,{label:"Error",checked:y,onChange:i=>a({isError:i})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:h,onChange:i=>a({classes:i}),placeholder:"class-name-1 class-name-2"}))))}function Jr(){return e.createElement(b.InnerBlocks.Content,null)}var Yr="https://schemas.wp.org/trunk/block.json",Kr=3,Zr="tds/dropdown",Qr="Dropdown",es="common",ts="Select a single value from a dropdown menu of options",as="arrow-down-alt2",ls={html:!1,customClassName:!0},is="times-design-system",ns="file:./render.php",rs={size:{type:"string",enum:["small","medium"],default:"small",description:"Dropdown size variant"},placeholder:{type:"string",default:"Select",description:"Text shown when no value is selected"},options:{type:"string",enum:["3","4","5"],default:"3",description:"Number of visible options (Figma variant; not used for rendering)"},items:{type:"array",items:{type:"object",properties:{value:{type:"string"},label:{type:"string"}}},description:"Menu options: { value: string, label: string }[]"},value:{type:"string",description:"Value of the selected item"},label:{type:"string",description:"Label displayed above the trigger"},iconLeft:{type:"string",description:"Icon name shown at the start of the trigger"},isDisabled:{type:"boolean",default:!1,description:"Whether the dropdown is disabled"},isReadOnly:{type:"boolean",default:!1,description:"Whether the dropdown is read-only"},isError:{type:"boolean",default:!1,description:"Whether the dropdown is in an error state"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the dropdown element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},ss="times-design-system",os="file:./init.js",ds=["file:./style.css","tds-dropdown-menu-style","tds-list-item-style"],cs={combinations:[{label:"Label",items:[{value:"opt1",label:"Option 1"},{value:"opt2",label:"Option 2"},{value:"opt3",label:"Option 3"}]},{label:"Selected",value:"opt2",items:[{value:"opt1",label:"Option 1"},{value:"opt2",label:"Option 2"},{value:"opt3",label:"Option 3"}]},{label:"Medium with icon",size:"medium",iconLeft:"filled_search",items:[{value:"opt1",label:"Option 1"},{value:"opt2",label:"Option 2"}]},{label:"Error",isError:!0,items:[{value:"opt1",label:"Option 1"}]},{label:"Read only",isReadOnly:!0,value:"opt1",items:[{value:"opt1",label:"Option 1"}]},{label:"Disabled",isDisabled:!0,items:[{value:"opt1",label:"Option 1"}]},{label:"Inner menu block",innerBlocks:[{block:"dropdown-menu",attributes:{items:[{value:"a",label:"Inner A"},{value:"b",label:"Inner B"}]}}]}]},te={$schema:Yr,apiVersion:Kr,name:Zr,title:Qr,category:es,description:ts,icon:as,supports:ls,textdomain:is,render:ns,attributes:rs,editorScript:ss,viewScript:os,style:ds,preview:cs};x.registerBlockType(te.name,{...te,edit:Xr,save:Jr});function us({attributes:u,setAttributes:a}){const{size:l,options:s,items:r=[],selectedId:d,classes:o}=u,n=["tds-dropdown-menu",`tds-dropdown-menu--size-${l}`,o].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("ul",{className:n,role:"listbox","aria-label":"Dropdown menu options"},r.map(c=>e.createElement("li",{key:c.value,role:"option","aria-selected":d===c.value},e.createElement("button",{type:"button",className:`tds-list-item tds-list-item--size-${l}`,"aria-disabled":"false"},e.createElement("div",{className:"tds-list-item__content"},e.createElement("span",{className:`tds-text utility-label-${l}`},c.label)),e.createElement("div",{className:"tds-list-item__focus-ring","aria-hidden":"true"}))))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Dropdown Menu Settings"},e.createElement(t.SelectControl,{label:"Size",value:l,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:c=>a({size:c})}),e.createElement(t.SelectControl,{label:"Options",value:s||"",options:[{label:"Default",value:""},{label:"3",value:"3"},{label:"4",value:"4"},{label:"5",value:"5"}],onChange:c=>a({options:c||void 0})}),e.createElement(ee,{items:r,onChange:c=>a({items:c})}),e.createElement(t.SelectControl,{label:"Selected item",value:d||"",options:[{label:"None",value:""},...r.map(({value:c,label:v})=>({label:v,value:c}))],onChange:c=>a({selectedId:c||void 0})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:o,onChange:c=>a({classes:c}),placeholder:"class-name-1 class-name-2"}))))}function ps(){return null}var bs="https://schemas.wp.org/trunk/block.json",hs=3,ms="tds/dropdown-menu",gs="Dropdown Menu",vs="common",ys="Listbox of selectable options, used by Dropdown",fs="list-view",Cs={html:!1,customClassName:!0},xs="times-design-system",Ss="file:./render.php",$s={size:{type:"string",enum:["small","medium"],default:"small",description:"Size of the menu items"},options:{type:"string",enum:["3","4","5"],description:"Number of visible options (Figma variant; not used for rendering)"},items:{type:"array",items:{type:"object",properties:{value:{type:"string"},label:{type:"string"}}},description:"Menu options: { value: string, label: string }[]"},selectedId:{type:"string",description:"Value of the selected item"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the menu element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Es="times-design-system",ks=["file:./style.css","tds-list-item-style"],ws={combinations:[{label:"Small",items:[{value:"opt1",label:"Option 1"},{value:"opt2",label:"Option 2"},{value:"opt3",label:"Option 3"}]},{label:"Medium with selection",size:"medium",selectedId:"opt2",items:[{value:"opt1",label:"Option 1"},{value:"opt2",label:"Option 2"},{value:"opt3",label:"Option 3"}]}]},ae={$schema:bs,apiVersion:hs,name:ms,title:gs,category:vs,description:ys,icon:fs,supports:Cs,textdomain:xs,render:Ss,attributes:$s,editorScript:Es,style:ks,preview:ws};x.registerBlockType(ae.name,{...ae,edit:us,save:ps});const Ts={name:"tds/grid-item"},Ls=[["tds/grid-item"]];function _s({attributes:u,setAttributes:a}){const{fullWidth:l,classes:s}=u,r=b.useBlockProps({className:["tds-grid",l?"tds-grid--full-width":"",s].filter(Boolean).join(" ")}),d=b.useInnerBlocksProps(r,{template:Ls,defaultBlock:Ts,directInsert:!0});return e.createElement(e.Fragment,null,e.createElement("div",d),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Grid Settings"},e.createElement(t.ToggleControl,{label:"Full Width",checked:!!l,onChange:o=>a({fullWidth:o||void 0}),help:"Span the full container instead of the content area"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:s||"",onChange:o=>a({classes:o}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the grid element"}))))}function Bs(){return e.createElement(b.InnerBlocks.Content,null)}var Is="https://schemas.wp.org/trunk/block.json",Ns=3,zs="tds/grid",Ps="Times Design System - Grid",Ds="layout",js="Responsive layout grid containing Grid Items",Os="block-default",Rs={html:!1,multiple:!0,reusable:!0,customClassName:!0},Vs="times-blocks",Ws={fullWidth:{type:"boolean",description:"Removes the content-area max width so the grid spans its container"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the grid element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Ms="file:./render.php",Us="file:./style.css",Hs="times-design-system",qs={combinations:[{innerBlocks:[{block:"grid-item",attributes:{span:4},innerBlocks:[{block:"text",attributes:{content:"Span 4"}}]},{block:"grid-item",attributes:{span:4},innerBlocks:[{block:"text",attributes:{content:"Span 4"}}]},{block:"grid-item",attributes:{span:4},innerBlocks:[{block:"text",attributes:{content:"Span 4"}}]}]},{fullWidth:!0,innerBlocks:[{block:"grid-item",attributes:{span:6},innerBlocks:[{block:"text",attributes:{content:"Span 6"}}]},{block:"grid-item",attributes:{span:6},innerBlocks:[{block:"text",attributes:{content:"Span 6"}}]}]},{innerBlocks:[{block:"grid-item",attributes:{span:4,start:3},innerBlocks:[{block:"text",attributes:{content:"Span 4, start 3"}}]}]}]},le={$schema:Is,apiVersion:Ns,name:zs,title:Ps,category:Ds,description:js,icon:Os,supports:Rs,textdomain:Vs,attributes:Ws,render:Ms,style:Us,editorScript:Hs,preview:qs};x.registerBlockType(le.name,{...le,edit:_s,save:Bs});function As({attributes:u,setAttributes:a}){const{size:l,checked:s,defaultChecked:r,label:d,subtitle:o,ariaLabel:n,disabled:c,id:v,classes:p}=u,y=s!==void 0?s:!!r;return e.createElement("div",b.useBlockProps(),e.createElement("button",{type:"button",role:"switch","aria-checked":y,"aria-label":n||d||"Switch",className:["tds-switch",`tds-switch--size-${l}`,`tds-switch--checked-${y}`,p].filter(Boolean).join(" "),disabled:c},e.createElement("span",{className:"tds-switch__track","aria-hidden":"true"},e.createElement("span",{className:"tds-switch__thumb-container"},e.createElement("span",{className:"tds-switch__thumb"}))),(d||o)&&e.createElement("span",{className:"tds-switch__content"},d&&e.createElement("span",{className:"tds-text utility-label-small tds-switch__label"},d),o&&e.createElement("span",{className:"tds-text utility-inputLabel-small tds-switch__subtitle"},o))),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Switch Settings"},e.createElement(t.TextControl,{label:"Label",value:d||"",onChange:h=>a({label:h||void 0})}),e.createElement(t.TextControl,{label:"Subtitle",value:o||"",onChange:h=>a({subtitle:h||void 0})}),e.createElement(t.SelectControl,{label:"Size",value:l,options:[{label:"Small",value:"small"},{label:"Large",value:"large"}],onChange:h=>a({size:h})}),e.createElement(t.SelectControl,{label:"Checked",value:s===void 0?"":String(s),options:[{label:"Uncontrolled (use default)",value:""},{label:"On",value:"true"},{label:"Off",value:"false"}],onChange:h=>a({checked:h===""?void 0:h==="true"})}),e.createElement(t.ToggleControl,{label:"Default checked",checked:!!r,onChange:h=>a({defaultChecked:h})}),e.createElement(t.ToggleControl,{label:"Disabled",checked:!!c,onChange:h=>a({disabled:h})})),e.createElement(t.PanelBody,{title:"Advanced",initialOpen:!1},e.createElement(t.TextControl,{label:"Aria label",value:n||"",onChange:h=>a({ariaLabel:h||void 0}),help:"Defaults to the label, then 'Switch'"}),e.createElement(t.TextControl,{label:"ID",value:v||"",onChange:h=>a({id:h||void 0})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:p||"",onChange:h=>a({classes:h}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the switch button"}))))}function Fs(){return null}var Gs="https://schemas.wp.org/trunk/block.json",Xs=3,Js="tds/switch",Ys="Times Design System - Switch",Ks="common",Zs="WordPress block for Times Design System Switch toggle component",Qs="block-default",eo={html:!1,multiple:!0,reusable:!0,customClassName:!0},to="times-blocks",ao={size:{type:"string",enum:["small","large"],default:"small",description:"Size variant"},checked:{type:"boolean",description:"Controlled checked state (falls back to defaultChecked when unset)"},defaultChecked:{type:"boolean",default:!1,description:"Initial checked state when checked is unset"},label:{type:"string",description:"Primary label text"},subtitle:{type:"string",description:"Optional subtitle text"},ariaLabel:{type:"string",description:"Accessible name override (defaults to the label, then 'Switch')"},disabled:{type:"boolean",default:!1,description:"Whether the switch is disabled"},id:{type:"string",description:"id attribute for the switch button"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the switch button"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},lo="file:./render.php",io="file:./style.css",no="times-design-system",ro="file:./init.js",so={combinations:[{label:"Notifications"},{label:"Notifications",checked:!0},{label:"Large",size:"large"},{label:"Large checked",size:"large",checked:!0},{label:"Enable updates",subtitle:"Receive notifications about new updates",checked:!0},{label:"Disabled",disabled:!0},{label:"Disabled checked",disabled:!0,checked:!0},{ariaLabel:"Toggle dark mode"}]},ie={$schema:Gs,apiVersion:Xs,name:Js,title:Ys,category:Ks,description:Zs,icon:Qs,supports:eo,textdomain:to,attributes:ao,render:lo,style:io,editorScript:no,viewScript:ro,preview:so};x.registerBlockType(ie.name,{...ie,edit:As,save:Fs});function oo({attributes:u,setAttributes:a}){const{label:l,subtitle:s,size:r,iconLeft:d,iconRight:o,disabled:n,onClick:c,classes:v}=u,p=["tds-list-item",`tds-list-item--size-${r}`,n?"tds-list-item--disabled":"",v].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),e.createElement("button",{type:"button",className:p,disabled:n,"aria-disabled":n},e.createElement("div",{className:"tds-list-item__content"},e.createElement("span",{className:`tds-text utility-label-${r}`},l),s&&e.createElement("span",{className:`tds-text utility-body-regular-${r}`},s)),e.createElement("div",{className:"tds-list-item__focus-ring","aria-hidden":"true"})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"List Item Settings"},e.createElement(t.TextControl,{label:"Label",value:l||"",onChange:y=>a({label:y})}),e.createElement(t.TextControl,{label:"Subtitle",value:s||"",onChange:y=>a({subtitle:y})}),e.createElement(t.SelectControl,{label:"Size",value:r,options:[{label:"Small",value:"small"},{label:"Medium",value:"medium"}],onChange:y=>a({size:y})}),e.createElement(t.TextControl,{label:"Icon Left",value:d||"",onChange:y=>a({iconLeft:y}),placeholder:"Icon name"}),e.createElement(t.TextControl,{label:"Icon Right",value:o||"",onChange:y=>a({iconRight:y}),placeholder:"Icon name"}),e.createElement(t.ToggleControl,{label:"Disabled",checked:n,onChange:y=>a({disabled:y})})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"onClick function name",value:c,onChange:y=>a({onClick:y}),help:"Global JavaScript function called on click"}),e.createElement(t.TextControl,{label:"Custom Classes",value:v,onChange:y=>a({classes:y}),placeholder:"class-name-1 class-name-2"}))))}function co(){return null}var uo="https://schemas.wp.org/trunk/block.json",po=3,bo="tds/list-item",ho="List Item",mo="common",go="A selectable list row with optional subtitle and icons",vo="list-view",yo={html:!1,customClassName:!0},fo="times-design-system",Co="file:./render.php",xo={label:{type:"string",description:"The primary text label for the list item"},subtitle:{type:"string",description:"Optional supporting text below the label"},size:{type:"string",enum:["small","medium"],default:"small",description:"Size variant of the list item"},iconLeft:{type:"string",description:"Icon name to display on the left (e.g. 'filled_search')"},iconRight:{type:"string",description:"Icon name to display on the right (e.g. 'filled_arrow_right')"},disabled:{type:"boolean",default:!1,description:"Whether the list item is disabled"},onClick:{type:"string",default:"",description:"Name of a global JavaScript function to call on click"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the list item element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},So="times-design-system",$o="file:./init.js",Eo="file:./style.css",ko={combinations:[{label:"List item"},{label:"With subtitle",subtitle:"Supporting text"},{label:"Medium",size:"medium",subtitle:"Supporting text"},{label:"With icons",iconLeft:"filled_search",iconRight:"filled_arrow_right"},{label:"Disabled",disabled:!0}]},ne={$schema:uo,apiVersion:po,name:bo,title:ho,category:mo,description:go,icon:vo,supports:yo,textdomain:fo,render:Co,attributes:xo,editorScript:So,viewScript:$o,style:Eo,preview:ko};x.registerBlockType(ne.name,{...ne,edit:oo,save:co});function wo({attributes:u,setAttributes:a}){const{span:l,start:s,classes:r}=u,d=b.useBlockProps({className:["tds-gridItem",r].filter(Boolean).join(" "),style:{"--span":l!=null?l:1,"--start":s!=null?s:"auto"}});return e.createElement("div",d,e.createElement(b.InnerBlocks,null),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Grid Item Settings"},e.createElement(t.RangeControl,{label:"Span",value:l,onChange:o=>a({span:o}),min:1,max:12,allowReset:!0,help:"Number of columns the item spans (default 1)"}),e.createElement(t.RangeControl,{label:"Start",value:s,onChange:o=>a({start:o}),min:1,max:12,allowReset:!0,help:"Column the item starts at (default auto)"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:r||"",onChange:o=>a({classes:o}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the grid item element"}))))}function To(){return e.createElement(b.InnerBlocks.Content,null)}var Lo="https://schemas.wp.org/trunk/block.json",_o=3,Bo="tds/grid-item",Io="Times Design System - Grid Item",No="layout",zo="A cell inside a Grid spanning one or more columns",Po="block-default",Do=["tds/grid"],jo={html:!1,multiple:!0,reusable:!0,customClassName:!0},Oo="times-blocks",Ro={span:{type:"number",description:"Number of columns the item spans (CSS --span, defaults to 1)"},start:{type:"number",description:"Column the item starts at (CSS --start, defaults to auto)"},classes:{type:"string",default:"",description:"Additional CSS classes applied to the grid item element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},Vo="file:./render.php",Wo="times-design-system",Mo="file:./style.css",Uo={combinations:[{innerBlocks:[{block:"text",attributes:{content:"Default (span 1)"}}]},{span:6,innerBlocks:[{block:"text",attributes:{content:"Span 6"}}]},{span:4,start:3,innerBlocks:[{block:"text",attributes:{content:"Span 4, start 3"}}]}]},re={$schema:Lo,apiVersion:_o,name:Bo,title:Io,category:No,description:zo,icon:Po,parent:Do,supports:jo,textdomain:Oo,attributes:Ro,render:Vo,editorScript:Wo,style:Mo,preview:Uo};x.registerBlockType(re.name,{...re,edit:wo,save:To});const Ho=["1:1","3:2","2:3","3:4","4:3","4:5","5:4","16:9","9:16"];function qo({attributes:u,setAttributes:a}){const{src:l,ratio:s,alt:r,caption:d,credit:o,isLazy:n,classes:c}=u,v=["tds-image",`tds-image--${s||"16:9"}`,c].filter(Boolean).join(" ");return e.createElement("div",b.useBlockProps(),l?e.createElement("img",{src:l,className:v,alt:r,loading:n?"lazy":"eager"}):e.createElement(b.MediaUploadCheck,null,e.createElement(b.MediaUpload,{allowedTypes:["image"],onSelect:p=>a({src:p.url,alt:r!=null?r:p.alt}),render:({open:p})=>e.createElement(t.Button,{variant:"secondary",onClick:p},"Select image")})),e.createElement(b.InspectorControls,null,e.createElement(t.PanelBody,{title:"Image Settings"},e.createElement(t.TextControl,{label:"Image URL",value:l||"",onChange:p=>a({src:p||void 0})}),e.createElement(b.MediaUploadCheck,null,e.createElement(b.MediaUpload,{allowedTypes:["image"],onSelect:p=>a({src:p.url}),render:({open:p})=>e.createElement(t.Button,{variant:"secondary",onClick:p},l?"Replace image":"Select image")})),e.createElement(t.SelectControl,{label:"Ratio",value:s||"",options:[{label:"Select a ratio",value:""},...Ho.map(p=>({label:p,value:p}))],onChange:p=>a({ratio:p||void 0})}),e.createElement(t.TextControl,{label:"Alt Text",value:r||"",onChange:p=>a({alt:p})}),e.createElement(t.ToggleControl,{label:"Lazy Load",checked:!!n,onChange:p=>a({isLazy:p})}),e.createElement(t.TextControl,{label:"Caption",value:d||"",onChange:p=>a({caption:p||void 0}),help:"Not rendered by the React Image component"}),e.createElement(t.TextControl,{label:"Credit",value:o||"",onChange:p=>a({credit:p||void 0}),help:"Not rendered by the React Image component"})),e.createElement(t.PanelBody,{title:"Extensibility",initialOpen:!1},e.createElement(t.TextControl,{label:"Custom Classes",value:c||"",onChange:p=>a({classes:p}),placeholder:"class-name-1 class-name-2",help:"Space-separated CSS classes added to the image element"}))))}function Ao(){return null}var Fo="https://schemas.wp.org/trunk/block.json",Go=3,Xo="tds/image",Jo="Times Design System - Image",Yo="media",Ko="Image with a fixed aspect ratio",Zo="format-image",Qo={html:!1,multiple:!0,reusable:!0,customClassName:!0},ed="times-blocks",td={src:{type:"string",description:"Image URL"},ratio:{type:"string",enum:["1:1","3:2","2:3","3:4","4:3","4:5","5:4","16:9","9:16"],description:"Aspect ratio"},alt:{type:"string",description:"Alternative text"},caption:{type:"string",description:"Caption (accepted but not rendered by the React component)"},credit:{type:"string",description:"Credit (accepted but not rendered by the React component)"},isLazy:{type:"boolean",description:'Lazy-load the image (loading="lazy" instead of "eager")'},classes:{type:"string",default:"",description:"Additional CSS classes applied to the image element"},dataAttributes:{type:"object",default:{},description:"Custom data-* attributes for extensibility (allowlisted server-side)"},ariaAttributes:{type:"object",default:{},description:"Custom aria-* attributes for extensibility (allowlisted server-side)"}},ad="file:./render.php",ld="file:./style.css",id="times-design-system",nd={combinations:[{src:"https://picsum.photos/id/1015/800/800",ratio:"1:1",alt:"Landscape"},{src:"https://picsum.photos/id/1015/800/800",ratio:"3:2",alt:"Landscape"},{src:"https://picsum.photos/id/1015/800/800",ratio:"4:3",alt:"Landscape"},{src:"https://picsum.photos/id/1015/800/800",ratio:"16:9",alt:"Landscape"},{src:"https://picsum.photos/id/1015/800/800",ratio:"3:4",alt:"Landscape"},{src:"https://picsum.photos/id/1015/800/800",ratio:"9:16",alt:"Landscape",isLazy:!0}]},se={$schema:Fo,apiVersion:Go,name:Xo,title:Jo,category:Yo,description:Ko,icon:Zo,supports:Qo,textdomain:ed,attributes:td,render:ad,style:ld,editorScript:id,preview:nd};x.registerBlockType(se.name,{...se,edit:qo,save:Ao})})(wp.blocks,wp.blockEditor,wp.element,wp.components);
|