@windstream/react-shared-components 0.1.93 → 0.1.95

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.
Files changed (112) hide show
  1. package/dist/contentful/index.esm.js +2 -2
  2. package/dist/contentful/index.esm.js.map +1 -1
  3. package/dist/contentful/index.js +3 -3
  4. package/dist/contentful/index.js.map +1 -1
  5. package/dist/core.d.ts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.esm.js +1 -1
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +3 -3
  10. package/dist/index.js.map +1 -1
  11. package/dist/styles.css +1 -1
  12. package/dist/utils/index.esm.js +1 -1
  13. package/dist/utils/index.js +1 -1
  14. package/package.json +14 -8
  15. package/src/components/accordion/index.test.tsx +270 -0
  16. package/src/components/alert-card/index.test.tsx +152 -0
  17. package/src/components/animation-wrapper/index.test.tsx +424 -0
  18. package/src/components/brand-button/index.test.tsx +292 -0
  19. package/src/components/button/index.test.tsx +91 -0
  20. package/src/components/call-button/index.test.tsx +260 -0
  21. package/src/components/checkbox/index.test.tsx +252 -0
  22. package/src/components/checklist/index.test.tsx +231 -0
  23. package/src/components/checklist/index.tsx +64 -29
  24. package/src/components/checklist/types.ts +7 -1
  25. package/src/components/collapse/index.test.tsx +277 -0
  26. package/src/components/collapse/index.tsx +1 -0
  27. package/src/components/divider/index.test.tsx +53 -0
  28. package/src/components/image/index.test.tsx +174 -0
  29. package/src/components/input/index.test.tsx +348 -0
  30. package/src/components/link/index.test.tsx +199 -0
  31. package/src/components/list/index.test.tsx +166 -0
  32. package/src/components/material-icon/index.test.tsx +130 -0
  33. package/src/components/modal/index.test.tsx +310 -0
  34. package/src/components/next-image/index.test.tsx +406 -0
  35. package/src/components/pagination/index.test.tsx +521 -0
  36. package/src/components/radio-button/index.test.tsx +151 -0
  37. package/src/components/see-more/index.test.tsx +96 -0
  38. package/src/components/select/index.test.tsx +256 -0
  39. package/src/components/select-plan-button/index.test.tsx +173 -0
  40. package/src/components/skeleton/index.test.tsx +74 -0
  41. package/src/components/spinner/index.test.tsx +76 -0
  42. package/src/components/text/index.test.tsx +65 -0
  43. package/src/components/tooltip/index.test.tsx +50 -0
  44. package/src/components/view-cart-button/index.test.tsx +57 -0
  45. package/src/contentful/blocks/accordion/index.test.tsx +218 -0
  46. package/src/contentful/blocks/accordion/index.tsx +3 -1
  47. package/src/contentful/blocks/address-input-banner/index.test.tsx +132 -0
  48. package/src/contentful/blocks/anchored-bottom-banner/index.test.tsx +287 -0
  49. package/src/contentful/blocks/blogs-grid/BlogGrid.stories.tsx +5 -4
  50. package/src/contentful/blocks/blogs-grid/index.test.tsx +355 -0
  51. package/src/contentful/blocks/blogs-grid-base/index.test.tsx +274 -0
  52. package/src/contentful/blocks/breadcrumbs/index.test.tsx +281 -0
  53. package/src/contentful/blocks/button/index.test.tsx +339 -0
  54. package/src/contentful/blocks/callout/index.test.tsx +539 -0
  55. package/src/contentful/blocks/cards/blog-card/index.test.tsx +218 -0
  56. package/src/contentful/blocks/cards/floating-image-card/index.test.tsx +201 -0
  57. package/src/contentful/blocks/cards/full-image-card/index.test.tsx +216 -0
  58. package/src/contentful/blocks/cards/index.test.tsx +39 -0
  59. package/src/contentful/blocks/cards/product-card/index.test.tsx +263 -0
  60. package/src/contentful/blocks/cards/simple-card/index.test.tsx +364 -0
  61. package/src/contentful/blocks/cards/simple-card/index.tsx +1 -1
  62. package/src/contentful/blocks/cards/testimonial-card/index.test.tsx +180 -0
  63. package/src/contentful/blocks/carousel/helper.test.tsx +539 -0
  64. package/src/contentful/blocks/carousel/index.test.tsx +308 -0
  65. package/src/contentful/blocks/carousel/types.test.ts +16 -0
  66. package/src/contentful/blocks/cart-retention-banner/index.test.tsx +409 -0
  67. package/src/contentful/blocks/cart-retention-banner/index.tsx +4 -4
  68. package/src/contentful/blocks/comparison-table/index.test.tsx +114 -0
  69. package/src/contentful/blocks/cookiebanner/index.test.tsx +277 -0
  70. package/src/contentful/blocks/cta-callout/index.test.tsx +244 -0
  71. package/src/contentful/blocks/dynamic-tabs/index.test.tsx +240 -0
  72. package/src/contentful/blocks/email-input-block/index.test.tsx +213 -0
  73. package/src/contentful/blocks/email-input-block/index.tsx +40 -35
  74. package/src/contentful/blocks/find-kinetic/index.test.tsx +269 -0
  75. package/src/contentful/blocks/floating-banner/index.test.tsx +246 -0
  76. package/src/contentful/blocks/footer/index.test.tsx +302 -0
  77. package/src/contentful/blocks/image-promo-bar/helper.test.tsx +61 -0
  78. package/src/contentful/blocks/image-promo-bar/index.test.tsx +467 -0
  79. package/src/contentful/blocks/image-promo-bar/index.tsx +248 -246
  80. package/src/contentful/blocks/image-promo-bar/vimeo-embed.test.tsx +142 -0
  81. package/src/contentful/blocks/image-promo-bar/youtube-embed.test.tsx +104 -0
  82. package/src/contentful/blocks/modal/index.test.tsx +209 -0
  83. package/src/contentful/blocks/navigation/desktop-link-groups.tsx/index.test.tsx +208 -0
  84. package/src/contentful/blocks/navigation/index.test.tsx +924 -0
  85. package/src/contentful/blocks/navigation/mobile-link-groups.tsx/index.test.tsx +131 -0
  86. package/src/contentful/blocks/primary-hero/index.test.tsx +286 -0
  87. package/src/contentful/blocks/primary-hero/index.tsx +7 -4
  88. package/src/contentful/blocks/search-block/index.test.tsx +268 -0
  89. package/src/contentful/blocks/shape-background-wrapper/index.test.tsx +284 -0
  90. package/src/contentful/blocks/text/index.test.tsx +36 -0
  91. package/src/contentful/index.test.ts +45 -0
  92. package/src/global-mocks/contentful/to-document.ts +25 -0
  93. package/src/global-mocks/cookie.ts +48 -0
  94. package/src/global-mocks/cx.ts +37 -0
  95. package/src/global-mocks/index.ts +89 -0
  96. package/src/global-mocks/speed-card-bg.ts +27 -0
  97. package/src/global-mocks/utm.ts +49 -0
  98. package/src/hooks/contentful/use-contentful-rich-text.test.tsx +1758 -0
  99. package/src/hooks/contentful/use-contentful-rich-text.tsx +1 -1
  100. package/src/hooks/contentful/use-processed-check-list.test.tsx +277 -0
  101. package/src/hooks/use-body-scroll-lock.test.ts +134 -0
  102. package/src/hooks/use-carousel-swipe.test.ts +393 -0
  103. package/src/hooks/use-outside-click.test.ts +142 -0
  104. package/src/index.ts +1 -1
  105. package/src/next/index.test.ts +7 -0
  106. package/src/setupTests.ts +17 -11
  107. package/src/utils/contentful/to-document.test.ts +85 -0
  108. package/src/utils/cookie.test.ts +180 -0
  109. package/src/utils/cx.test.ts +90 -0
  110. package/src/utils/index.test.ts +115 -0
  111. package/src/utils/speed-card-bg.test.ts +46 -0
  112. package/src/utils/utm.test.ts +359 -0
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("clsx"),t=require("tailwind-merge"),n=require("js-base64"),r=require("js-cookie"),i=require("react/jsx-runtime"),o=require("react"),l=require("@windstream/react-shared-components"),s=require("@windstream/react-shared-components"),a=require("@windstream/react-shared-components"),d=require("@windstream/react-shared-components");const c=t.extendTailwindMerge({extend:{classGroups:{"font-variants":["heading1","heading2","heading3","heading4","heading5","heading6","subheading1","subheading2","subheading3","subheading4","subheading5","subheading6","body1","body2","body3","footnote","micro","label1","label2","label3","label4"],"button-sizes":["btn-small","btn-medium","btn-large","btn-x-large"]}}}),u="utm_parameters",E=".gokinetic.com";function h(e){if("undefined"==typeof window)return"";const t=r.get(e);return t?n.Base64.decode(t):null}const m=["utm_content","utm_medium","utm_campaign","utm_source","utm_term","utm_campaign_id","utm_adgroup_id","fbclid","gclid","msclkid"];const p=e=>!!e&&"object"==typeof e&&"nodeType"in e&&"content"in e,_=e=>{if(!e)return null;if(p(e))return e;if("object"==typeof e&&null!==e&&"json"in e){const t=e.json;return p(t)?t:null}return null};var A=function(e){return e.DOCUMENT="document",e.PARAGRAPH="paragraph",e.HEADING_1="heading-1",e.HEADING_2="heading-2",e.HEADING_3="heading-3",e.HEADING_4="heading-4",e.HEADING_5="heading-5",e.HEADING_6="heading-6",e.OL_LIST="ordered-list",e.UL_LIST="unordered-list",e.LIST_ITEM="list-item",e.HR="hr",e.QUOTE="blockquote",e.EMBEDDED_ENTRY="embedded-entry-block",e.EMBEDDED_ASSET="embedded-asset-block",e.EMBEDDED_RESOURCE="embedded-resource-block",e.TABLE="table",e.TABLE_ROW="table-row",e.TABLE_CELL="table-cell",e.TABLE_HEADER_CELL="table-header-cell",e}({}),f=function(e){return e.ASSET_HYPERLINK="asset-hyperlink",e.EMBEDDED_ENTRY="embedded-entry-inline",e.EMBEDDED_RESOURCE="embedded-resource-inline",e.ENTRY_HYPERLINK="entry-hyperlink",e.HYPERLINK="hyperlink",e.RESOURCE_HYPERLINK="resource-hyperlink",e}({}),T=function(e){return e.BOLD="bold",e.ITALIC="italic",e.UNDERLINE="underline",e.CODE="code",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.STRIKETHROUGH="strikethrough",e}({});const D=[A.PARAGRAPH,A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6,A.OL_LIST,A.UL_LIST,A.HR,A.QUOTE,A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,A.EMBEDDED_RESOURCE,A.TABLE],L=[A.PARAGRAPH,A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6,A.OL_LIST,A.UL_LIST,A.HR,A.QUOTE,A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,A.EMBEDDED_RESOURCE];A.TABLE,A.TABLE_ROW,A.TABLE_CELL,A.TABLE_HEADER_CELL,A.HR,A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,A.EMBEDDED_RESOURCE;const v={[A.OL_LIST]:[A.LIST_ITEM],[A.UL_LIST]:[A.LIST_ITEM],[A.LIST_ITEM]:L,[A.QUOTE]:[A.PARAGRAPH],[A.TABLE]:[A.TABLE_ROW],[A.TABLE_ROW]:[A.TABLE_CELL,A.TABLE_HEADER_CELL],[A.TABLE_CELL]:[A.PARAGRAPH,A.UL_LIST,A.OL_LIST],[A.TABLE_HEADER_CELL]:[A.PARAGRAPH]};A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6;A.PARAGRAPH,A.DOCUMENT,A.PARAGRAPH,A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6,A.OL_LIST,A.UL_LIST,A.LIST_ITEM,A.HR,A.QUOTE,A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,f.HYPERLINK,f.ENTRY_HYPERLINK,f.ASSET_HYPERLINK,f.EMBEDDED_ENTRY,T.BOLD,T.CODE,T.ITALIC,T.UNDERLINE,A.DOCUMENT,A.PARAGRAPH;function y(e){if(!function(e){return null!=e&&"object"==typeof e&&"content"in e&&Array.isArray(e.content)}(e)||e.content.length<2)return e;return function(e){if(e.nodeType!==A.PARAGRAPH)return!1;if(1!==e.content.length)return!1;const t=e.content[0];return"text"===t.nodeType&&""===t.value}(e.content[e.content.length-1])?{...e,content:e.content.slice(0,-1)}:e}const R=({path:e,property:t,typeName:n,value:r})=>({details:`The type of "${t}" is incorrect, expected type: ${n}`,name:"type",path:e.toArray(),type:n,value:r});class g{obj;path;_errors=[];constructor(e,t){this.obj=e,this.path=t}catch=(...e)=>{this._errors.push(...e)};get errors(){const e=e=>JSON.stringify({details:e.details,path:e.path});return this._errors.filter((t,n)=>this._errors.findIndex(n=>e(t)===e(n))===n)}exists=e=>e in this.obj||(this.catch((({property:e,path:t})=>({details:`The property "${e}" is required here`,name:"required",path:t.toArray()}))({property:e,path:this.path.of(e)})),!1);object=e=>{const t=e?this.obj[e]:this.obj;if(e&&!this.exists(e))return!1;if("object"==typeof t&&!Array.isArray(t)&&null!==t)return!0;const n=e?this.path.of(e):this.path,r=e??this.path.last()??"value";return this.catch(R({typeName:"Object",property:r,path:n,value:t})),!1};string=e=>{const t=this.obj[e];return!(e&&!this.exists(e))&&("string"==typeof t||(this.catch(R({typeName:"String",property:e,path:this.path.of(e),value:t})),!1))};number=(e,t)=>{const n=this.obj[e];return!(!t||e in this.obj)||!!this.exists(e)&&("number"==typeof n&&!Number.isNaN(n)||(this.catch(R({typeName:"Number",property:e,path:this.path.of(e),value:n})),!1))};array=e=>{const t=this.obj[e];return!(e&&!this.exists(e))&&(!!Array.isArray(t)||(this.catch(R({typeName:"Array",property:e,path:this.path.of(e),value:t})),!1))};enum=(e,t)=>{const n=this.obj[e];return!("string"!=typeof n||!t.includes(n))||(this.catch((({expected:e,value:t,path:n})=>({details:"Value must be one of expected values",name:"in",expected:[...e].sort(),path:n.toArray(),value:t}))({expected:t,value:n,path:this.path.of(e)})),!1)};empty=e=>{if(!this.array(e))return!1;const t=this.obj[e];return 0===t.length||(this.catch((({max:e,value:t,path:n})=>({name:"size",max:e,path:n.toArray(),details:`Size must be at most ${e}`,value:t}))({max:0,value:t,path:this.path.of(e)})),!1)};minLength=(e,t)=>{if(!this.array(e))return!1;const n=this.obj[e];return n.length>=t||(this.catch((({min:e,value:t,path:n})=>({name:"size",min:e,path:n.toArray(),details:`Size must be at least ${e}`,value:t}))({min:t,value:n,path:this.path.of(e)})),!1)};noAdditionalProperties=e=>{const t=Object.keys(this.obj).sort().filter(t=>!e.includes(t));return t.forEach(e=>this.catch((({property:e,path:t})=>({details:`The property "${e}" is not expected`,name:"unexpected",path:t.toArray()}))({property:e,path:this.path.of(e)}))),0===t.length};each=(e,t)=>{if(!this.array(e))return;const n=this.obj[e];let r=!1;n.forEach((n,i)=>{if(r)return;const o=t(n,this.path.of(e).of(i));o.length>0&&(r=!0),this.catch(...o)})}}const N=[];class b{contentRule;validateData;constructor(e,t){this.contentRule=e,this.validateData=t}assert(e,t){const n=new g(e,t);if(!n.object())return n.errors;n.noAdditionalProperties(["nodeType","data","content"]);const{nodeTypes:r,min:i=0}=Array.isArray(this.contentRule)?{nodeTypes:this.contentRule}:this.contentRule(e,t);if(0===r.length&&i>0)throw new Error(`Invalid content rule. Cannot have enforce a 'min' of ${i} with no nodeTypes`);if(n.minLength("content",i),0===r.length?n.empty("content"):n.each("content",(e,t)=>{const n=new g(e,t);return n.object()?(n.enum("nodeType",r),n.errors):n.errors}),n.object("data")){const r=this.validateData?.(e.data,t.of("data"))??[];n.catch(...r)}return n.errors}}class I extends b{linkType;type;constructor(e,t){super(t,(e,t)=>this.assertLink(e,t)),this.linkType=e,this.type=this.linkType.startsWith("Contentful:")?"ResourceLink":"Link"}assertLink=(e,t)=>{const n=new g(e,t);if(n.object("target")){const r=new g(e.target.sys,t.of("target").of("sys"));r.object()&&(r.enum("type",[this.type]),r.enum("linkType",[this.linkType]),"Link"===this.type?(r.string("id"),r.noAdditionalProperties(["type","linkType","id"])):"ResourceLink"===this.type&&(r.string("urn"),r.noAdditionalProperties(["type","linkType","urn"]))),n.catch(...r.errors)}return n.noAdditionalProperties(["target"]),n.errors}}const x=(e,t)=>new b(e,t),H=(e,t)=>new I(e,t);x([...Object.values(f),"text"].sort()),x([A.LIST_ITEM]),H("Entry",N),x(()=>({nodeTypes:[A.PARAGRAPH],min:1}),(e,t)=>{const n=new g(e,t);return n.noAdditionalProperties(["colspan","rowspan"]),n.number("colspan",!0),n.number("rowspan",!0),n.errors});function C(e,t){return e.map((e,n)=>{return r=S(e,t),i=n,o.isValidElement(r)&&null===r.key?o.cloneElement(r,{key:i}):r;var r,i})}function S(e,t){const{renderNode:n,renderMark:r,renderText:i,preserveWhitespace:l}=t;if(function(e){return"text"===e.nodeType}(e)){let t=i?i(e.value):e.value;if(l&&!i){t=t.replace(/ {2,}/g,e=>" ".repeat(e.length));const e=t.split("\n"),n=[];e.forEach((t,r)=>{n.push(t),r!==e.length-1&&n.push(o.createElement("br",null))}),t=n}return e.marks.reduce((e,t)=>r[t.type]?r[t.type](e):e,t)}{const r=C(e.content,t);return e.nodeType&&n[e.nodeType]?n[e.nodeType](e,r):o.createElement(o.Fragment,null,r)}}A.DOCUMENT,x(D),A.PARAGRAPH,A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6,A.QUOTE,x(v[A.QUOTE]),A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,H("Asset",N),A.EMBEDDED_RESOURCE,H("Contentful:Entry",N),A.HR,x(N),A.OL_LIST,A.UL_LIST,A.LIST_ITEM,x([...L].sort()),A.TABLE,x(()=>({nodeTypes:[A.TABLE_ROW],min:1})),A.TABLE_ROW,x(()=>({nodeTypes:[A.TABLE_CELL,A.TABLE_HEADER_CELL],min:1})),A.TABLE_CELL,A.TABLE_HEADER_CELL,f.HYPERLINK,new class extends b{constructor(){super(["text"],(e,t)=>this.assertLink(e,t))}assertLink=(e,t)=>{const n=new g(e,t);return n.string("uri"),n.noAdditionalProperties(["uri"]),n.errors}},f.EMBEDDED_ENTRY,f.EMBEDDED_RESOURCE,H("Contentful:Entry",N),f.ENTRY_HYPERLINK,H("Entry",["text"]),f.ASSET_HYPERLINK,H("Asset",["text"]),f.RESOURCE_HYPERLINK,H("Contentful:Entry",["text"]);const w={[A.DOCUMENT]:(e,t)=>t,[A.PARAGRAPH]:(e,t)=>o.createElement("p",null,t),[A.HEADING_1]:(e,t)=>o.createElement("h1",null,t),[A.HEADING_2]:(e,t)=>o.createElement("h2",null,t),[A.HEADING_3]:(e,t)=>o.createElement("h3",null,t),[A.HEADING_4]:(e,t)=>o.createElement("h4",null,t),[A.HEADING_5]:(e,t)=>o.createElement("h5",null,t),[A.HEADING_6]:(e,t)=>o.createElement("h6",null,t),[A.EMBEDDED_ENTRY]:(e,t)=>o.createElement("div",null,t),[A.EMBEDDED_RESOURCE]:(e,t)=>o.createElement("div",null,t),[A.UL_LIST]:(e,t)=>o.createElement("ul",null,t),[A.OL_LIST]:(e,t)=>o.createElement("ol",null,t),[A.LIST_ITEM]:(e,t)=>o.createElement("li",null,t),[A.QUOTE]:(e,t)=>o.createElement("blockquote",null,t),[A.HR]:()=>o.createElement("hr",null),[A.TABLE]:(e,t)=>o.createElement("table",null,o.createElement("tbody",null,t)),[A.TABLE_ROW]:(e,t)=>o.createElement("tr",null,t),[A.TABLE_HEADER_CELL]:(e,t)=>o.createElement("th",null,t),[A.TABLE_CELL]:(e,t)=>o.createElement("td",null,t),[f.ASSET_HYPERLINK]:e=>B(f.ASSET_HYPERLINK,e),[f.ENTRY_HYPERLINK]:e=>B(f.ENTRY_HYPERLINK,e),[f.RESOURCE_HYPERLINK]:e=>j(f.RESOURCE_HYPERLINK,e),[f.EMBEDDED_ENTRY]:e=>B(f.EMBEDDED_ENTRY,e),[f.EMBEDDED_RESOURCE]:(e,t)=>j(f.EMBEDDED_RESOURCE,e),[f.HYPERLINK]:(e,t)=>o.createElement("a",{href:e.data.uri},t)},P={[T.BOLD]:e=>o.createElement("b",null,e),[T.ITALIC]:e=>o.createElement("i",null,e),[T.UNDERLINE]:e=>o.createElement("u",null,e),[T.CODE]:e=>o.createElement("code",null,e),[T.SUPERSCRIPT]:e=>o.createElement("sup",null,e),[T.SUBSCRIPT]:e=>o.createElement("sub",null,e),[T.STRIKETHROUGH]:e=>o.createElement("s",null,e)};function B(e,t){return o.createElement("span",{key:t.data.target.sys.id},"type: ",t.nodeType," id: ",t.data.target.sys.id)}function j(e,t){return o.createElement("span",{key:t.data.target.sys.urn},"type: ",t.nodeType," urn: ",t.data.target.sys.urn)}function k(e,t={}){if(!e)return null;let n=e;return t.stripEmptyTrailingParagraph&&(n=y(e)),S(n,{renderNode:{...w,...t.renderNode},renderMark:{...P,...t.renderMark},renderText:t.renderText,preserveWhitespace:t.preserveWhitespace})}const M={renderMark:{[T.BOLD]:e=>i.jsx("strong",{className:"label3",children:e}),[T.ITALIC]:e=>i.jsx("em",{children:e}),[T.UNDERLINE]:e=>i.jsx("u",{children:e}),[T.CODE]:e=>i.jsx("code",{children:e})},renderNode:{[A.PARAGRAPH]:(e,t)=>i.jsx("div",{className:"body3 mb-4",children:t}),[A.HEADING_1]:(e,t)=>i.jsx(d.Text,{as:"h1",className:"heading2 md:heading1",children:t}),[A.HEADING_2]:(e,t)=>i.jsx(d.Text,{as:"h2",className:"heading6 md:heading5",children:t}),[A.HEADING_3]:(e,t)=>i.jsx(d.Text,{as:"h3",className:"heading6 md:heading5",children:t}),[A.HEADING_4]:(e,t)=>i.jsx(d.Text,{as:"h3",className:"headingClass",children:t}),[A.HEADING_5]:(e,t)=>i.jsx(d.Text,{as:"h3",className:"heading6 md:heading5",children:t}),[A.HEADING_6]:(e,t)=>i.jsx(d.Text,{as:"h3",className:"heading6",children:t}),[A.QUOTE]:(e,t)=>i.jsx("blockquote",{children:t}),[A.UL_LIST]:(e,t)=>i.jsx("ul",{children:t}),[A.OL_LIST]:(e,t)=>i.jsx("ol",{children:t}),[A.LIST_ITEM]:(e,t)=>i.jsx("li",{children:t}),[f.HYPERLINK]:(e,t)=>{var n;const r=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.uri,o=/^https?:\/\//.test(r);return i.jsx("a",{href:r,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,children:t})},[A.EMBEDDED_ASSET]:e=>{var t,n;const r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.target,o=null==r?void 0:r.fields,l=(null==r?void 0:r.url)||(null===(n=null==o?void 0:o.file)||void 0===n?void 0:n.url),s=(null==o?void 0:o.title)||(null==o?void 0:o.description)||"Embedded asset";if(!l)return null;const a=l.startsWith("//")?`https:${l}`:l;return i.jsx("img",{src:a,alt:s,style:{maxWidth:"100%"}})},[A.EMBEDDED_ENTRY]:e=>{var t,n,r,o;const l=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.target;return"callout"===(null===(o=null===(r=null===(n=null==l?void 0:l.sys)||void 0===n?void 0:n.contentType)||void 0===r?void 0:r.sys)||void 0===o?void 0:o.id)?i.jsxs("aside",{style:{border:"1px solid #ddd",padding:12,borderRadius:8},children:[i.jsx("strong",{children:l.fields.title}),i.jsx("div",{children:l.fields.body})]}):null},[f.EMBEDDED_ENTRY]:e=>{var t,n,r,o,l,s;const a=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.target;return"componentCheckList"===(null===(o=null===(r=null===(n=null==a?void 0:a.sys)||void 0===n?void 0:n.contentType)||void 0===r?void 0:r.sys)||void 0===o?void 0:o.id)?i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 6px",backgroundColor:"#f0fdf4",border:"1px solid #bbf7d0",borderRadius:"4px",fontSize:"0.9em"},children:["✅ ",a.fields.title]}):i.jsx("span",{children:null!==(s=null===(l=null==a?void 0:a.fields)||void 0===l?void 0:l.title)&&void 0!==s?s:""})}}};function O(e,t,n="body1",r="body1 font-bold",o){if(!e||!Array.isArray(e.content))return null;return k(e,{...M,...o,renderNode:{...M.renderNode,...null==o?void 0:o.renderNode,[A.PARAGRAPH]:(e,t)=>i.jsx("div",{className:n,children:t}),[f.HYPERLINK]:(e,n)=>{var o;const l=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.uri,a=/^https?:\/\//.test(l),d=null!=t?t:a;return i.jsx(s.Link,{href:l,target:d?"_blank":"_self",rel:d?"noopener noreferrer":void 0,variant:"default",className:r,children:n})}}})}const G={renderMark:{[T.BOLD]:e=>o.createElement("span",{className:"label1"},e)}};Object.defineProperty(exports,"clsx",{enumerable:!0,get:function(){return e.clsx}}),exports.SpeedCardBg=(e="#24A76A")=>`<svg xmlns="http://www.w3.org/2000/svg" width="684" height="107" viewBox="0 0 684 107" fill="none">\n <g clip-path="url(#clip0_12352_9042)">\n <path d="M154.09 -70.5605C173.769 -7.58032 204.79 24.8889 328.202 55.2823C444.619 83.9133 629.479 141.332 667.653 80.7015C691.679 45.2165 678.322 -5.62201 670.537 -46.3554C664.452 -73.1846 658.327 -97.1939 652.913 -123.475C651.135 -132.091 638.766 -131.974 637.067 -123.318C628.136 -77.6888 612.526 -44.9062 577.593 -22.4637C517.962 20.1889 377.954 -6.48361 303.148 -38.287C223.245 -70.7171 200.918 -132.366 195.425 -199.341C193.37 -235.257 198.467 -269.841 208.07 -299.569C210.915 -308.303 199.218 -314.178 193.844 -306.697C151.324 -247.751 137.69 -140.395 154.129 -70.5213" fill="${e}" />\n <path d="M167.605 -417.382C104.062 -397.877 71.302 -367.131 40.6368 -244.813C11.7499 -129.428 -46.182 53.7941 14.9903 91.6292C50.7927 115.443 102.086 102.204 143.183 94.4883C170.253 88.4567 194.476 82.3858 220.992 77.02C229.686 75.2574 229.568 62.9983 220.834 61.3141C174.797 52.4624 141.721 36.9915 119.078 2.36813C76.0441 -56.7345 102.955 -195.502 135.043 -269.645C167.763 -348.84 229.963 -370.969 297.537 -376.414C333.774 -378.45 368.667 -373.398 398.661 -363.88C407.473 -361.06 413.401 -372.654 405.853 -377.98C346.38 -420.124 238.064 -433.636 167.565 -417.343" fill="${e}" />\n </g>\n <defs>\n <clipPath id="clip0_12352_9042">\n <rect width="684" height="107" fill="white" />\n </clipPath>\n </defs>\n </svg>`,exports.UTM_PARAM_NAMES=m,exports.buildPreservedQueryHref=function(e,t){if(!t)return e;const n=new URLSearchParams(t),r=new Set(m),i=new Set([...r,"searchtext","page"]);let o,l;try{if(e.startsWith("http://")||e.startsWith("https://")){const t=new URL(e);o=t.origin+t.pathname,l=t.searchParams}else{const[t,n]=e.split("?");o=t,l=new URLSearchParams(n||"")}}catch(t){return e}const s=new URLSearchParams(l);n.forEach((e,t)=>{i.has(t.toLowerCase())||s.has(t)||s.set(t,e)});const a=s.toString();return a?`${o}?${a}`:o},exports.combineExistingAndNewUTMs=function(e,t){if(!t)return e||{};if(!e)return t;if(["utm_campaign","utm_medium","utm_source","utm_campaign_id","utm_adgroup_id","fbclid","gclid","msclkid"].every(n=>(e[n]||"")===(t[n]||"")))return{...t,utm_content:e.utm_content||t.utm_content,utm_term:e.utm_term||t.utm_term};const n=!!t.utm_content,r=!!t.utm_term;return{...t,...!n&&e.utm_content&&{utm_content:e.utm_content},...!r&&e.utm_term&&{utm_term:e.utm_term}}},exports.cx=(...t)=>c(e.clsx(...t)),exports.getCampaignProperties=function(e){if(!e)return null;const t={};return e.utm_campaign&&(t.name=e.utm_campaign),e.utm_source&&(t.source=e.utm_source),e.utm_medium&&(t.medium=e.utm_medium),e.utm_term&&(t.term=e.utm_term),e.utm_content&&(t.content=e.utm_content),e.utm_campaign_id&&(t.campaign_id=e.utm_campaign_id),e.utm_adgroup_id&&(t.adgroup_id=e.utm_adgroup_id),e.gclid&&(t.gclid=e.gclid),e.fbclid&&(t.fbclid=e.fbclid),e.msclkid&&(t.msclkid=e.msclkid),Object.keys(t).length>0?t:null},exports.getCookie=h,exports.getOrganicTrafficUtmParameters=function(){if("undefined"==typeof document)return null;const e=document.referrer;if(!e)return{utm_medium:"direct",utm_source:"direct"};let t;try{t=new URL(e).hostname.toLowerCase()}catch(e){return{utm_medium:"direct",utm_source:"direct"}}return t.includes("windstream.com")||t.includes("gokinetic.com")?null:t.includes("google.")?{utm_medium:"organic",utm_source:"google"}:t.includes("bing.")?{utm_medium:"organic",utm_source:"bing"}:{utm_medium:"referral",utm_source:t}},exports.getParsedCookie=e=>{try{return JSON.parse(h(e)||"")}catch(e){return null}},exports.getUTMs=function(){if("undefined"==typeof window)return null;const e=r.get(u);if(!e)return null;try{const t=n.Base64.decode(e);return JSON.parse(t)}catch(e){return null}},exports.getUtmParametersFromURL=function(){if("undefined"==typeof window)return null;const e=new URLSearchParams(window.location.search),t={};let n=!1;for(const r of m){const i=e.get(r);i&&(t[r]=i,n=!0)}return n?t:null},exports.label1BoldOptions=G,exports.removeUTMs=function(e=E){r.remove(u,{domain:e,path:"/"})},exports.renderContentfulRichText=O,exports.renderContentfulRichTextTable=function(e,t){if(!e||!Array.isArray(e.content))return null;const n={...M,renderMark:{...M.renderMark,[T.BOLD]:e=>i.jsx("strong",{className:"label4 md:label2",children:e})},renderNode:{...M.renderNode,[A.PARAGRAPH]:(e,t)=>i.jsx(i.Fragment,{children:t}),[A.TABLE]:(e,t)=>{var n,r;return i.jsx("div",{className:"comparison-table-wrapper w-full overflow-x-auto border-none md:overflow-hidden",children:i.jsx("table",{className:"responsive-table w-full table-fixed border-collapse "+((null===(r=null===(n=e.content[0])||void 0===n?void 0:n.content)||void 0===r?void 0:r.length)>2?"min-w-[100.1%]":"min-w-full"),children:i.jsx("tbody",{children:t})})})},[A.TABLE_ROW]:(e,t)=>i.jsx("tr",{className:"border-b border-gray-200 last:border-0",children:t}),[A.TABLE_HEADER_CELL]:(e,t)=>{var n;const r=(null===(n=e.parent)||void 0===n?void 0:n.content.length)>2;return i.jsx("th",{className:`label4 break-words py-4 text-center md:label2 ${r?"sticky left-0 z-20 w-[50vw] min-w-[50vw] first:z-30 first:w-[50vw] first:min-w-[50vw] first:border-r":"w-1/4 first:w-1/2"} `,children:t})},[A.TABLE_CELL]:(e,t)=>{var n,r,o,l;const s=(null===(n=e.parent)||void 0===n?void 0:n.content.length)>2,d=null===(l=null===(o=null===(r=e.content[0])||void 0===r?void 0:r.content[0])||void 0===o?void 0:o.value)||void 0===l?void 0:l.toLowerCase().trim();return i.jsx("td",{className:`rt-table-cell footnote break-words bg-white py-2 md:py-4 text-center align-top leading-5 text-text md:body2 first:text-left md:leading-7 ${s?"w-[50vw] min-w-[50vw] first:sticky first:left-0 first:z-10 first:w-[50vw] first:min-w-[50vw] first:border-r":"w-1/4 first:w-1/2"} `,children:i.jsxs(i.Fragment,{children:[" ","yes"===d?i.jsx(a.MaterialIcon,{name:"check_circle",color:"#24A76A",fill:1}):"no"===d?i.jsx(a.MaterialIcon,{name:"cancel",color:"#CECECE",fill:1}):t]})})},[f.EMBEDDED_ENTRY]:e=>{var n,r,o,s;const a=e.data.target.sys.id,d=null===(r=null===(n=null==t?void 0:t.entries)||void 0===n?void 0:n.inline)||void 0===r?void 0:r.find(e=>e.sys.id===a);if(!d)return null;if("ComponentCheckList"===d.__typename){const e=(null===(s=null===(o=d.list)||void 0===o?void 0:o.items)||void 0===s?void 0:s.map(e=>{var t;return O(_(null!==(t=null==e?void 0:e.checkListTitle)&&void 0!==t?t:""),!0,"")}))||[];return i.jsx(l.Checklist,{items:e,listIconName:"disc",listItemClassName:"items-baseline footnote md:body2 leading-5 md:leading-7 text-text"})}return i.jsx("span",{children:d.title||""})}}};return k(e,n)},exports.setCookie=(e,t,i)=>{if("undefined"==typeof window)return;const o=JSON.stringify(t),l=n.Base64.encode(o);r.set(e,l,i)},exports.setUTMs=function(e,t=E){if("undefined"==typeof window)return;const i=JSON.stringify(e),o=n.Base64.encode(i);r.set(u,o,{domain:t,path:"/",sameSite:"Lax"})},exports.toDocument=_,exports.useContentfulRichText=function(e,t){return o.useMemo(()=>{if(!e||!Array.isArray(e.content))return null;const n={...M,renderMark:{...M.renderMark,...null==t?void 0:t.renderMark},renderNode:{...M.renderNode,...null==t?void 0:t.renderNode}};return k(e,n)},[e,t])},exports.useProcessedChecklist=function(e,t,n,r){return o.useMemo(()=>{var i,o;const l=null!==(o=null===(i=null==e?void 0:e.list)||void 0===i?void 0:i.items)&&void 0!==o?o:[];return t?l.map(e=>{var t,i;return null!==(i=O(_(null!==(t=null==e?void 0:e.checkListTitle)&&void 0!==t?t:""),void 0,r,void 0,n))&&void 0!==i?i:""}):l.map(e=>{var t,i,o,l,s;return{title:null!==(i=O(_(null!==(t=null==e?void 0:e.checkListTitle)&&void 0!==t?t:""),void 0,r,void 0,n))&&void 0!==i?i:"",iconUrl:null!==(l=null===(o=null==e?void 0:e.icon)||void 0===o?void 0:o.url)&&void 0!==l?l:void 0,anchorId:null!==(s=null==e?void 0:e.anchorId)&&void 0!==s?s:void 0}})},[e,t,n,r])};
1
+ "use strict";var e=require("clsx"),t=require("tailwind-merge"),n=require("js-base64"),r=require("js-cookie"),i=require("react/jsx-runtime"),o=require("react"),l=require("@windstream/react-shared-components"),s=require("@windstream/react-shared-components"),a=require("@windstream/react-shared-components"),d=require("@windstream/react-shared-components");const c=t.extendTailwindMerge({extend:{classGroups:{"font-variants":["heading1","heading2","heading3","heading4","heading5","heading6","subheading1","subheading2","subheading3","subheading4","subheading5","subheading6","body1","body2","body3","footnote","micro","label1","label2","label3","label4"],"button-sizes":["btn-small","btn-medium","btn-large","btn-x-large"]}}}),u="utm_parameters",E=".gokinetic.com";function h(e){if("undefined"==typeof window)return"";const t=r.get(e);return t?n.Base64.decode(t):null}const m=["utm_content","utm_medium","utm_campaign","utm_source","utm_term","utm_campaign_id","utm_adgroup_id","fbclid","gclid","msclkid"];const p=e=>!!e&&"object"==typeof e&&"nodeType"in e&&"content"in e,_=e=>{if(!e)return null;if(p(e))return e;if("object"==typeof e&&null!==e&&"json"in e){const t=e.json;return p(t)?t:null}return null};var A=function(e){return e.DOCUMENT="document",e.PARAGRAPH="paragraph",e.HEADING_1="heading-1",e.HEADING_2="heading-2",e.HEADING_3="heading-3",e.HEADING_4="heading-4",e.HEADING_5="heading-5",e.HEADING_6="heading-6",e.OL_LIST="ordered-list",e.UL_LIST="unordered-list",e.LIST_ITEM="list-item",e.HR="hr",e.QUOTE="blockquote",e.EMBEDDED_ENTRY="embedded-entry-block",e.EMBEDDED_ASSET="embedded-asset-block",e.EMBEDDED_RESOURCE="embedded-resource-block",e.TABLE="table",e.TABLE_ROW="table-row",e.TABLE_CELL="table-cell",e.TABLE_HEADER_CELL="table-header-cell",e}({}),f=function(e){return e.ASSET_HYPERLINK="asset-hyperlink",e.EMBEDDED_ENTRY="embedded-entry-inline",e.EMBEDDED_RESOURCE="embedded-resource-inline",e.ENTRY_HYPERLINK="entry-hyperlink",e.HYPERLINK="hyperlink",e.RESOURCE_HYPERLINK="resource-hyperlink",e}({}),T=function(e){return e.BOLD="bold",e.ITALIC="italic",e.UNDERLINE="underline",e.CODE="code",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.STRIKETHROUGH="strikethrough",e}({});const D=[A.PARAGRAPH,A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6,A.OL_LIST,A.UL_LIST,A.HR,A.QUOTE,A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,A.EMBEDDED_RESOURCE,A.TABLE],L=[A.PARAGRAPH,A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6,A.OL_LIST,A.UL_LIST,A.HR,A.QUOTE,A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,A.EMBEDDED_RESOURCE];A.TABLE,A.TABLE_ROW,A.TABLE_CELL,A.TABLE_HEADER_CELL,A.HR,A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,A.EMBEDDED_RESOURCE;const v={[A.OL_LIST]:[A.LIST_ITEM],[A.UL_LIST]:[A.LIST_ITEM],[A.LIST_ITEM]:L,[A.QUOTE]:[A.PARAGRAPH],[A.TABLE]:[A.TABLE_ROW],[A.TABLE_ROW]:[A.TABLE_CELL,A.TABLE_HEADER_CELL],[A.TABLE_CELL]:[A.PARAGRAPH,A.UL_LIST,A.OL_LIST],[A.TABLE_HEADER_CELL]:[A.PARAGRAPH]};A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6;A.PARAGRAPH,A.DOCUMENT,A.PARAGRAPH,A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6,A.OL_LIST,A.UL_LIST,A.LIST_ITEM,A.HR,A.QUOTE,A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,f.HYPERLINK,f.ENTRY_HYPERLINK,f.ASSET_HYPERLINK,f.EMBEDDED_ENTRY,T.BOLD,T.CODE,T.ITALIC,T.UNDERLINE,A.DOCUMENT,A.PARAGRAPH;function y(e){if(!function(e){return null!=e&&"object"==typeof e&&"content"in e&&Array.isArray(e.content)}(e)||e.content.length<2)return e;return function(e){if(e.nodeType!==A.PARAGRAPH)return!1;if(1!==e.content.length)return!1;const t=e.content[0];return"text"===t.nodeType&&""===t.value}(e.content[e.content.length-1])?{...e,content:e.content.slice(0,-1)}:e}const R=({path:e,property:t,typeName:n,value:r})=>({details:`The type of "${t}" is incorrect, expected type: ${n}`,name:"type",path:e.toArray(),type:n,value:r});class g{obj;path;_errors=[];constructor(e,t){this.obj=e,this.path=t}catch=(...e)=>{this._errors.push(...e)};get errors(){const e=e=>JSON.stringify({details:e.details,path:e.path});return this._errors.filter((t,n)=>this._errors.findIndex(n=>e(t)===e(n))===n)}exists=e=>e in this.obj||(this.catch((({property:e,path:t})=>({details:`The property "${e}" is required here`,name:"required",path:t.toArray()}))({property:e,path:this.path.of(e)})),!1);object=e=>{const t=e?this.obj[e]:this.obj;if(e&&!this.exists(e))return!1;if("object"==typeof t&&!Array.isArray(t)&&null!==t)return!0;const n=e?this.path.of(e):this.path,r=e??this.path.last()??"value";return this.catch(R({typeName:"Object",property:r,path:n,value:t})),!1};string=e=>{const t=this.obj[e];return!(e&&!this.exists(e))&&("string"==typeof t||(this.catch(R({typeName:"String",property:e,path:this.path.of(e),value:t})),!1))};number=(e,t)=>{const n=this.obj[e];return!(!t||e in this.obj)||!!this.exists(e)&&("number"==typeof n&&!Number.isNaN(n)||(this.catch(R({typeName:"Number",property:e,path:this.path.of(e),value:n})),!1))};array=e=>{const t=this.obj[e];return!(e&&!this.exists(e))&&(!!Array.isArray(t)||(this.catch(R({typeName:"Array",property:e,path:this.path.of(e),value:t})),!1))};enum=(e,t)=>{const n=this.obj[e];return!("string"!=typeof n||!t.includes(n))||(this.catch((({expected:e,value:t,path:n})=>({details:"Value must be one of expected values",name:"in",expected:[...e].sort(),path:n.toArray(),value:t}))({expected:t,value:n,path:this.path.of(e)})),!1)};empty=e=>{if(!this.array(e))return!1;const t=this.obj[e];return 0===t.length||(this.catch((({max:e,value:t,path:n})=>({name:"size",max:e,path:n.toArray(),details:`Size must be at most ${e}`,value:t}))({max:0,value:t,path:this.path.of(e)})),!1)};minLength=(e,t)=>{if(!this.array(e))return!1;const n=this.obj[e];return n.length>=t||(this.catch((({min:e,value:t,path:n})=>({name:"size",min:e,path:n.toArray(),details:`Size must be at least ${e}`,value:t}))({min:t,value:n,path:this.path.of(e)})),!1)};noAdditionalProperties=e=>{const t=Object.keys(this.obj).sort().filter(t=>!e.includes(t));return t.forEach(e=>this.catch((({property:e,path:t})=>({details:`The property "${e}" is not expected`,name:"unexpected",path:t.toArray()}))({property:e,path:this.path.of(e)}))),0===t.length};each=(e,t)=>{if(!this.array(e))return;const n=this.obj[e];let r=!1;n.forEach((n,i)=>{if(r)return;const o=t(n,this.path.of(e).of(i));o.length>0&&(r=!0),this.catch(...o)})}}const N=[];class b{contentRule;validateData;constructor(e,t){this.contentRule=e,this.validateData=t}assert(e,t){const n=new g(e,t);if(!n.object())return n.errors;n.noAdditionalProperties(["nodeType","data","content"]);const{nodeTypes:r,min:i=0}=Array.isArray(this.contentRule)?{nodeTypes:this.contentRule}:this.contentRule(e,t);if(0===r.length&&i>0)throw new Error(`Invalid content rule. Cannot have enforce a 'min' of ${i} with no nodeTypes`);if(n.minLength("content",i),0===r.length?n.empty("content"):n.each("content",(e,t)=>{const n=new g(e,t);return n.object()?(n.enum("nodeType",r),n.errors):n.errors}),n.object("data")){const r=this.validateData?.(e.data,t.of("data"))??[];n.catch(...r)}return n.errors}}class I extends b{linkType;type;constructor(e,t){super(t,(e,t)=>this.assertLink(e,t)),this.linkType=e,this.type=this.linkType.startsWith("Contentful:")?"ResourceLink":"Link"}assertLink=(e,t)=>{const n=new g(e,t);if(n.object("target")){const r=new g(e.target.sys,t.of("target").of("sys"));r.object()&&(r.enum("type",[this.type]),r.enum("linkType",[this.linkType]),"Link"===this.type?(r.string("id"),r.noAdditionalProperties(["type","linkType","id"])):"ResourceLink"===this.type&&(r.string("urn"),r.noAdditionalProperties(["type","linkType","urn"]))),n.catch(...r.errors)}return n.noAdditionalProperties(["target"]),n.errors}}const x=(e,t)=>new b(e,t),H=(e,t)=>new I(e,t);x([...Object.values(f),"text"].sort()),x([A.LIST_ITEM]),H("Entry",N),x(()=>({nodeTypes:[A.PARAGRAPH],min:1}),(e,t)=>{const n=new g(e,t);return n.noAdditionalProperties(["colspan","rowspan"]),n.number("colspan",!0),n.number("rowspan",!0),n.errors});function C(e,t){return e.map((e,n)=>{return r=S(e,t),i=n,o.isValidElement(r)&&null===r.key?o.cloneElement(r,{key:i}):r;var r,i})}function S(e,t){const{renderNode:n,renderMark:r,renderText:i,preserveWhitespace:l}=t;if(function(e){return"text"===e.nodeType}(e)){let t=i?i(e.value):e.value;if(l&&!i){t=t.replace(/ {2,}/g,e=>" ".repeat(e.length));const e=t.split("\n"),n=[];e.forEach((t,r)=>{n.push(t),r!==e.length-1&&n.push(o.createElement("br",null))}),t=n}return e.marks.reduce((e,t)=>r[t.type]?r[t.type](e):e,t)}{const r=C(e.content,t);return e.nodeType&&n[e.nodeType]?n[e.nodeType](e,r):o.createElement(o.Fragment,null,r)}}A.DOCUMENT,x(D),A.PARAGRAPH,A.HEADING_1,A.HEADING_2,A.HEADING_3,A.HEADING_4,A.HEADING_5,A.HEADING_6,A.QUOTE,x(v[A.QUOTE]),A.EMBEDDED_ENTRY,A.EMBEDDED_ASSET,H("Asset",N),A.EMBEDDED_RESOURCE,H("Contentful:Entry",N),A.HR,x(N),A.OL_LIST,A.UL_LIST,A.LIST_ITEM,x([...L].sort()),A.TABLE,x(()=>({nodeTypes:[A.TABLE_ROW],min:1})),A.TABLE_ROW,x(()=>({nodeTypes:[A.TABLE_CELL,A.TABLE_HEADER_CELL],min:1})),A.TABLE_CELL,A.TABLE_HEADER_CELL,f.HYPERLINK,new class extends b{constructor(){super(["text"],(e,t)=>this.assertLink(e,t))}assertLink=(e,t)=>{const n=new g(e,t);return n.string("uri"),n.noAdditionalProperties(["uri"]),n.errors}},f.EMBEDDED_ENTRY,f.EMBEDDED_RESOURCE,H("Contentful:Entry",N),f.ENTRY_HYPERLINK,H("Entry",["text"]),f.ASSET_HYPERLINK,H("Asset",["text"]),f.RESOURCE_HYPERLINK,H("Contentful:Entry",["text"]);const w={[A.DOCUMENT]:(e,t)=>t,[A.PARAGRAPH]:(e,t)=>o.createElement("p",null,t),[A.HEADING_1]:(e,t)=>o.createElement("h1",null,t),[A.HEADING_2]:(e,t)=>o.createElement("h2",null,t),[A.HEADING_3]:(e,t)=>o.createElement("h3",null,t),[A.HEADING_4]:(e,t)=>o.createElement("h4",null,t),[A.HEADING_5]:(e,t)=>o.createElement("h5",null,t),[A.HEADING_6]:(e,t)=>o.createElement("h6",null,t),[A.EMBEDDED_ENTRY]:(e,t)=>o.createElement("div",null,t),[A.EMBEDDED_RESOURCE]:(e,t)=>o.createElement("div",null,t),[A.UL_LIST]:(e,t)=>o.createElement("ul",null,t),[A.OL_LIST]:(e,t)=>o.createElement("ol",null,t),[A.LIST_ITEM]:(e,t)=>o.createElement("li",null,t),[A.QUOTE]:(e,t)=>o.createElement("blockquote",null,t),[A.HR]:()=>o.createElement("hr",null),[A.TABLE]:(e,t)=>o.createElement("table",null,o.createElement("tbody",null,t)),[A.TABLE_ROW]:(e,t)=>o.createElement("tr",null,t),[A.TABLE_HEADER_CELL]:(e,t)=>o.createElement("th",null,t),[A.TABLE_CELL]:(e,t)=>o.createElement("td",null,t),[f.ASSET_HYPERLINK]:e=>B(f.ASSET_HYPERLINK,e),[f.ENTRY_HYPERLINK]:e=>B(f.ENTRY_HYPERLINK,e),[f.RESOURCE_HYPERLINK]:e=>j(f.RESOURCE_HYPERLINK,e),[f.EMBEDDED_ENTRY]:e=>B(f.EMBEDDED_ENTRY,e),[f.EMBEDDED_RESOURCE]:(e,t)=>j(f.EMBEDDED_RESOURCE,e),[f.HYPERLINK]:(e,t)=>o.createElement("a",{href:e.data.uri},t)},P={[T.BOLD]:e=>o.createElement("b",null,e),[T.ITALIC]:e=>o.createElement("i",null,e),[T.UNDERLINE]:e=>o.createElement("u",null,e),[T.CODE]:e=>o.createElement("code",null,e),[T.SUPERSCRIPT]:e=>o.createElement("sup",null,e),[T.SUBSCRIPT]:e=>o.createElement("sub",null,e),[T.STRIKETHROUGH]:e=>o.createElement("s",null,e)};function B(e,t){return o.createElement("span",{key:t.data.target.sys.id},"type: ",t.nodeType," id: ",t.data.target.sys.id)}function j(e,t){return o.createElement("span",{key:t.data.target.sys.urn},"type: ",t.nodeType," urn: ",t.data.target.sys.urn)}function k(e,t={}){if(!e)return null;let n=e;return t.stripEmptyTrailingParagraph&&(n=y(e)),S(n,{renderNode:{...w,...t.renderNode},renderMark:{...P,...t.renderMark},renderText:t.renderText,preserveWhitespace:t.preserveWhitespace})}const M={renderMark:{[T.BOLD]:e=>i.jsx("strong",{className:"label3",children:e}),[T.ITALIC]:e=>i.jsx("em",{children:e}),[T.UNDERLINE]:e=>i.jsx("u",{children:e}),[T.CODE]:e=>i.jsx("code",{children:e})},renderNode:{[A.PARAGRAPH]:(e,t)=>i.jsx("div",{className:"body3 mb-4",children:t}),[A.HEADING_1]:(e,t)=>i.jsx(d.Text,{as:"h1",className:"heading2 md:heading1",children:t}),[A.HEADING_2]:(e,t)=>i.jsx(d.Text,{as:"h2",className:"heading6 md:heading5",children:t}),[A.HEADING_3]:(e,t)=>i.jsx(d.Text,{as:"h3",className:"heading6 md:heading5",children:t}),[A.HEADING_4]:(e,t)=>i.jsx(d.Text,{as:"h3",className:"headingClass",children:t}),[A.HEADING_5]:(e,t)=>i.jsx(d.Text,{as:"h3",className:"heading6 md:heading5",children:t}),[A.HEADING_6]:(e,t)=>i.jsx(d.Text,{as:"h3",className:"heading6",children:t}),[A.QUOTE]:(e,t)=>i.jsx("blockquote",{children:t}),[A.UL_LIST]:(e,t)=>i.jsx("ul",{children:t}),[A.OL_LIST]:(e,t)=>i.jsx("ol",{children:t}),[A.LIST_ITEM]:(e,t)=>i.jsx("li",{children:t}),[f.HYPERLINK]:(e,t)=>{var n;const r=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.uri,o=/^https?:\/\//.test(r);return i.jsx("a",{href:r,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,children:t})},[A.EMBEDDED_ASSET]:e=>{var t,n;const r=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.target,o=null==r?void 0:r.fields,l=(null==r?void 0:r.url)||(null===(n=null==o?void 0:o.file)||void 0===n?void 0:n.url),s=(null==o?void 0:o.title)||(null==o?void 0:o.description)||"Embedded asset";if(!l)return null;const a=l.startsWith("//")?`https:${l}`:l;return i.jsx("img",{src:a,alt:s,style:{maxWidth:"100%"}})},[A.EMBEDDED_ENTRY]:e=>{var t,n,r,o;const l=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.target;return"callout"===(null===(o=null===(r=null===(n=null==l?void 0:l.sys)||void 0===n?void 0:n.contentType)||void 0===r?void 0:r.sys)||void 0===o?void 0:o.id)?i.jsxs("aside",{style:{border:"1px solid #ddd",padding:12,borderRadius:8},children:[i.jsx("strong",{children:l.fields.title}),i.jsx("div",{children:l.fields.body})]}):null},[f.EMBEDDED_ENTRY]:e=>{var t,n,r,o,l,s;const a=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.target;return"componentCheckList"===(null===(o=null===(r=null===(n=null==a?void 0:a.sys)||void 0===n?void 0:n.contentType)||void 0===r?void 0:r.sys)||void 0===o?void 0:o.id)?i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 6px",backgroundColor:"#f0fdf4",border:"1px solid #bbf7d0",borderRadius:"4px",fontSize:"0.9em"},children:["✅ ",a.fields.title]}):i.jsx("span",{children:null!==(s=null===(l=null==a?void 0:a.fields)||void 0===l?void 0:l.title)&&void 0!==s?s:""})}}};function O(e,t,n="body1",r="body1 font-bold",o){if(!e||!Array.isArray(e.content))return null;return k(e,{...M,...o,renderNode:{...M.renderNode,...null==o?void 0:o.renderNode,[A.PARAGRAPH]:(e,t)=>i.jsx("div",{className:n,children:t}),[f.HYPERLINK]:(e,n)=>{var o;const l=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.uri,a=/^https?:\/\//.test(l),d=null!=t?t:a;return i.jsx(s.Link,{href:l,target:d?"_blank":"_self",rel:d?"noopener noreferrer":void 0,variant:"default",className:r,children:n})}}})}const G={renderMark:{[T.BOLD]:e=>o.createElement("span",{className:"label1"},e)}};Object.defineProperty(exports,"clsx",{enumerable:!0,get:function(){return e.clsx}}),exports.SpeedCardBg=(e="#24A76A")=>`<svg xmlns="http://www.w3.org/2000/svg" width="684" height="107" viewBox="0 0 684 107" fill="none">\n <g clip-path="url(#clip0_12352_9042)">\n <path d="M154.09 -70.5605C173.769 -7.58032 204.79 24.8889 328.202 55.2823C444.619 83.9133 629.479 141.332 667.653 80.7015C691.679 45.2165 678.322 -5.62201 670.537 -46.3554C664.452 -73.1846 658.327 -97.1939 652.913 -123.475C651.135 -132.091 638.766 -131.974 637.067 -123.318C628.136 -77.6888 612.526 -44.9062 577.593 -22.4637C517.962 20.1889 377.954 -6.48361 303.148 -38.287C223.245 -70.7171 200.918 -132.366 195.425 -199.341C193.37 -235.257 198.467 -269.841 208.07 -299.569C210.915 -308.303 199.218 -314.178 193.844 -306.697C151.324 -247.751 137.69 -140.395 154.129 -70.5213" fill="${e}" />\n <path d="M167.605 -417.382C104.062 -397.877 71.302 -367.131 40.6368 -244.813C11.7499 -129.428 -46.182 53.7941 14.9903 91.6292C50.7927 115.443 102.086 102.204 143.183 94.4883C170.253 88.4567 194.476 82.3858 220.992 77.02C229.686 75.2574 229.568 62.9983 220.834 61.3141C174.797 52.4624 141.721 36.9915 119.078 2.36813C76.0441 -56.7345 102.955 -195.502 135.043 -269.645C167.763 -348.84 229.963 -370.969 297.537 -376.414C333.774 -378.45 368.667 -373.398 398.661 -363.88C407.473 -361.06 413.401 -372.654 405.853 -377.98C346.38 -420.124 238.064 -433.636 167.565 -417.343" fill="${e}" />\n </g>\n <defs>\n <clipPath id="clip0_12352_9042">\n <rect width="684" height="107" fill="white" />\n </clipPath>\n </defs>\n </svg>`,exports.UTM_PARAM_NAMES=m,exports.buildPreservedQueryHref=function(e,t){if(!t)return e;const n=new URLSearchParams(t),r=new Set(m),i=new Set([...r,"searchtext","page"]);let o,l;try{if(e.startsWith("http://")||e.startsWith("https://")){const t=new URL(e);o=t.origin+t.pathname,l=t.searchParams}else{const[t,n]=e.split("?");o=t,l=new URLSearchParams(n||"")}}catch(t){return e}const s=new URLSearchParams(l);n.forEach((e,t)=>{i.has(t.toLowerCase())||s.has(t)||s.set(t,e)});const a=s.toString();return a?`${o}?${a}`:o},exports.combineExistingAndNewUTMs=function(e,t){if(!t)return e||{};if(!e)return t;if(["utm_campaign","utm_medium","utm_source","utm_campaign_id","utm_adgroup_id","fbclid","gclid","msclkid"].every(n=>(e[n]||"")===(t[n]||"")))return{...t,utm_content:e.utm_content||t.utm_content,utm_term:e.utm_term||t.utm_term};const n=!!t.utm_content,r=!!t.utm_term;return{...t,...!n&&e.utm_content&&{utm_content:e.utm_content},...!r&&e.utm_term&&{utm_term:e.utm_term}}},exports.cx=(...t)=>c(e.clsx(...t)),exports.getCampaignProperties=function(e){if(!e)return null;const t={};return e.utm_campaign&&(t.name=e.utm_campaign),e.utm_source&&(t.source=e.utm_source),e.utm_medium&&(t.medium=e.utm_medium),e.utm_term&&(t.term=e.utm_term),e.utm_content&&(t.content=e.utm_content),e.utm_campaign_id&&(t.campaign_id=e.utm_campaign_id),e.utm_adgroup_id&&(t.adgroup_id=e.utm_adgroup_id),e.gclid&&(t.gclid=e.gclid),e.fbclid&&(t.fbclid=e.fbclid),e.msclkid&&(t.msclkid=e.msclkid),Object.keys(t).length>0?t:null},exports.getCookie=h,exports.getOrganicTrafficUtmParameters=function(){if("undefined"==typeof document)return null;const e=document.referrer;if(!e)return{utm_medium:"direct",utm_source:"direct"};let t;try{t=new URL(e).hostname.toLowerCase()}catch(e){return{utm_medium:"direct",utm_source:"direct"}}return t.includes("windstream.com")||t.includes("gokinetic.com")?null:t.includes("google.")?{utm_medium:"organic",utm_source:"google"}:t.includes("bing.")?{utm_medium:"organic",utm_source:"bing"}:{utm_medium:"referral",utm_source:t}},exports.getParsedCookie=e=>{try{return JSON.parse(h(e)||"")}catch(e){return null}},exports.getUTMs=function(){if("undefined"==typeof window)return null;const e=r.get(u);if(!e)return null;try{const t=n.Base64.decode(e);return JSON.parse(t)}catch(e){return null}},exports.getUtmParametersFromURL=function(){if("undefined"==typeof window)return null;const e=new URLSearchParams(window.location.search),t={};let n=!1;for(const r of m){const i=e.get(r);i&&(t[r]=i,n=!0)}return n?t:null},exports.label1BoldOptions=G,exports.removeUTMs=function(e=E){r.remove(u,{domain:e,path:"/"})},exports.renderContentfulRichText=O,exports.renderContentfulRichTextTable=function(e,t){if(!e||!Array.isArray(e.content))return null;const n={...M,renderMark:{...M.renderMark,[T.BOLD]:e=>i.jsx("strong",{className:"label4 md:label2",children:e})},renderNode:{...M.renderNode,[A.PARAGRAPH]:(e,t)=>i.jsx(i.Fragment,{children:t}),[A.TABLE]:(e,t)=>{var n,r;return i.jsx("div",{className:"comparison-table-wrapper w-full overflow-x-auto border-none md:overflow-hidden",children:i.jsx("table",{className:"responsive-table w-full table-fixed border-collapse "+((null===(r=null===(n=e.content[0])||void 0===n?void 0:n.content)||void 0===r?void 0:r.length)>2?"min-w-[100.1%]":"min-w-full"),children:i.jsx("tbody",{children:t})})})},[A.TABLE_ROW]:(e,t)=>i.jsx("tr",{className:"border-b border-gray-200 last:border-0",children:t}),[A.TABLE_HEADER_CELL]:(e,t)=>{var n;const r=(null===(n=e.parent)||void 0===n?void 0:n.content.length)>2;return i.jsx("th",{className:`label4 break-words py-4 text-center md:label2 ${r?"sticky left-0 z-20 w-[50vw] min-w-[50vw] first:z-30 first:w-[50vw] first:min-w-[50vw] first:border-r":"w-1/4 first:w-1/2"} `,children:t})},[A.TABLE_CELL]:(e,t)=>{var n,r,o,l;const s=(null===(n=e.parent)||void 0===n?void 0:n.content.length)>2,d=null===(l=null===(o=null===(r=e.content[0])||void 0===r?void 0:r.content[0])||void 0===o?void 0:o.value)||void 0===l?void 0:l.toLowerCase().trim();return i.jsx("td",{className:`rt-table-cell footnote break-words bg-white py-2 text-center align-top leading-5 text-text md:body2 first:text-left md:py-4 md:leading-7 ${s?"w-[50vw] min-w-[50vw] first:sticky first:left-0 first:z-10 first:w-[50vw] first:min-w-[50vw] first:border-r":"w-1/4 first:w-1/2"} `,children:i.jsxs(i.Fragment,{children:[" ","yes"===d?i.jsx(a.MaterialIcon,{name:"check_circle",color:"#24A76A",fill:1}):"no"===d?i.jsx(a.MaterialIcon,{name:"cancel",color:"#CECECE",fill:1}):t]})})},[f.EMBEDDED_ENTRY]:e=>{var n,r,o,s;const a=e.data.target.sys.id,d=null===(r=null===(n=null==t?void 0:t.entries)||void 0===n?void 0:n.inline)||void 0===r?void 0:r.find(e=>e.sys.id===a);if(!d)return null;if("ComponentCheckList"===d.__typename){const e=(null===(s=null===(o=d.list)||void 0===o?void 0:o.items)||void 0===s?void 0:s.map(e=>{var t;return O(_(null!==(t=null==e?void 0:e.checkListTitle)&&void 0!==t?t:""),!0,"")}))||[];return i.jsx(l.Checklist,{items:e,listIconName:"disc",listItemClassName:"items-baseline footnote md:body2 leading-5 md:leading-7 text-text"})}return i.jsx("span",{children:d.title||""})}}};return k(e,n)},exports.setCookie=(e,t,i)=>{if("undefined"==typeof window)return;const o=JSON.stringify(t),l=n.Base64.encode(o);r.set(e,l,i)},exports.setUTMs=function(e,t=E){if("undefined"==typeof window)return;const i=JSON.stringify(e),o=n.Base64.encode(i);r.set(u,o,{domain:t,path:"/",sameSite:"Lax"})},exports.toDocument=_,exports.useContentfulRichText=function(e,t){return o.useMemo(()=>{if(!e||!Array.isArray(e.content))return null;const n={...M,renderMark:{...M.renderMark,...null==t?void 0:t.renderMark},renderNode:{...M.renderNode,...null==t?void 0:t.renderNode}};return k(e,n)},[e,t])},exports.useProcessedChecklist=function(e,t,n,r){return o.useMemo(()=>{var i,o;const l=null!==(o=null===(i=null==e?void 0:e.list)||void 0===i?void 0:i.items)&&void 0!==o?o:[];return t?l.map(e=>{var t,i;return null!==(i=O(_(null!==(t=null==e?void 0:e.checkListTitle)&&void 0!==t?t:""),void 0,r,void 0,n))&&void 0!==i?i:""}):l.map(e=>{var t,i,o,l,s;return{title:null!==(i=O(_(null!==(t=null==e?void 0:e.checkListTitle)&&void 0!==t?t:""),void 0,r,void 0,n))&&void 0!==i?i:"",iconUrl:null!==(l=null===(o=null==e?void 0:e.icon)||void 0===o?void 0:o.url)&&void 0!==l?l:void 0,anchorId:null!==(s=null==e?void 0:e.anchorId)&&void 0!==s?s:void 0}})},[e,t,n,r])};
2
2
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windstream/react-shared-components",
3
- "version": "0.1.93",
3
+ "version": "0.1.95",
4
4
  "type": "module",
5
5
  "description": "Shared React components for Kinetic applications",
6
6
  "main": "dist/index.js",
@@ -85,8 +85,10 @@
85
85
  "lint:fix": "eslint src --ext .ts,.tsx --fix",
86
86
  "format": "prettier --write \"src/**/*.(js|jsx|ts|tsx|css)\" | grep -v \"changed\" || true",
87
87
  "format:check": "prettier --check .",
88
- "test": "jest",
88
+ "test": "npm run lint:tests && jest",
89
+ "test:unit": "jest --ci --coverage --watchAll=false",
89
90
  "test:watch": "jest --watch",
91
+ "test:coverage": "jest --coverage",
90
92
  "type-check": "tsc --noEmit",
91
93
  "storybook": "storybook dev -p 6006",
92
94
  "build-storybook": "storybook build"
@@ -104,16 +106,16 @@
104
106
  "dependencies": {
105
107
  "@contentful/rich-text-react-renderer": "^16.1.6",
106
108
  "@contentful/rich-text-types": "^17.2.5",
109
+ "@radix-ui/react-dialog": "1.0.5",
107
110
  "@types/react-modal": "3.16.3",
108
111
  "@types/react-transition-group": "4.4.12",
109
112
  "clsx": "2.1.1",
110
- "js-cookie": "^3.0.5",
113
+ "framer-motion": "10.12.16",
111
114
  "js-base64": "^3.7.7",
115
+ "js-cookie": "^3.0.5",
112
116
  "react-modal": "3.16.3",
113
117
  "react-select": "5.10.2",
114
- "react-transition-group": "4.4.5",
115
- "@radix-ui/react-dialog": "1.0.5",
116
- "framer-motion": "10.12.16"
118
+ "react-transition-group": "4.4.5"
117
119
  },
118
120
  "optionalDependencies": {
119
121
  "@types/js-cookie": "^3.0.6"
@@ -132,6 +134,7 @@
132
134
  "@tailwindcss/typography": "^0.5.19",
133
135
  "@testing-library/jest-dom": "6.6.4",
134
136
  "@testing-library/react": "16.3.0",
137
+ "@types/jest": "^29.5.14",
135
138
  "@types/react": "18.3.23",
136
139
  "@types/react-dom": "18.3.7",
137
140
  "@types/react-select": "5.0.1",
@@ -145,8 +148,9 @@
145
148
  "eslint-plugin-react": "7.37.5",
146
149
  "eslint-plugin-react-hooks": "5.2.0",
147
150
  "eslint-plugin-storybook": "9.1.3",
148
- "jest": "30.0.5",
149
- "jest-environment-jsdom": "30.0.5",
151
+ "identity-obj-proxy": "^3.0.0",
152
+ "jest": "^29.7.0",
153
+ "jest-environment-jsdom": "^29.7.0",
150
154
  "next": "^16.1.6",
151
155
  "postcss": "8.5.6",
152
156
  "postcss-loader": "8.1.1",
@@ -162,6 +166,8 @@
162
166
  "tailwind-merge": "3.3.1",
163
167
  "tailwindcss": "3.4.17",
164
168
  "tailwindcss-radix": "^4.0.2",
169
+ "ts-jest": "^29.4.9",
170
+ "ts-node": "^10.9.2",
165
171
  "typescript": "5.3.3"
166
172
  },
167
173
  "keywords": [
@@ -0,0 +1,270 @@
1
+ import "@testing-library/jest-dom";
2
+
3
+ import { Accordion } from "./index";
4
+
5
+ import { fireEvent, render, screen } from "@testing-library/react";
6
+
7
+ // Mock dependencies
8
+ jest.mock("@shared/components/button", () => ({
9
+ Button: ({ children, onClick, ...props }: any) => (
10
+ <button onClick={onClick} {...props}>
11
+ {children}
12
+ </button>
13
+ ),
14
+ }));
15
+
16
+ jest.mock("@shared/components/collapse", () => ({
17
+ Collapse: ({ open, children }: any) => (
18
+ <div data-testid="collapse" data-open={open}>
19
+ {open ? children : null}
20
+ </div>
21
+ ),
22
+ }));
23
+
24
+ jest.mock("@shared/components/material-icon", () => ({
25
+ MaterialIcon: ({ name, className }: any) => (
26
+ <span data-testid="material-icon" data-name={name} className={className}>
27
+ {name}
28
+ </span>
29
+ ),
30
+ }));
31
+
32
+ jest.mock("@shared/utils", () => ({
33
+ cx: (...args: any[]) => args.filter(Boolean).join(" "),
34
+ }));
35
+
36
+ describe("Accordion", () => {
37
+ const defaultProps = {
38
+ title: "Accordion Title",
39
+ children: <p>Accordion content</p>,
40
+ };
41
+
42
+ it("renders without crashing", () => {
43
+ render(<Accordion {...defaultProps} />);
44
+ expect(screen.getByText("Accordion Title")).toBeInTheDocument();
45
+ });
46
+
47
+ it("has displayName set to Accordion", () => {
48
+ expect(Accordion.displayName).toBe("Accordion");
49
+ });
50
+
51
+ describe("initial state", () => {
52
+ it("starts closed by default", () => {
53
+ render(<Accordion {...defaultProps} />);
54
+ const collapse = screen.getByTestId("collapse");
55
+ expect(collapse).toHaveAttribute("data-open", "false");
56
+ });
57
+
58
+ it("starts open when defaultOpen is true", () => {
59
+ render(<Accordion {...defaultProps} defaultOpen={true} />);
60
+ const collapse = screen.getByTestId("collapse");
61
+ expect(collapse).toHaveAttribute("data-open", "true");
62
+ });
63
+
64
+ it("starts closed when defaultOpen is false", () => {
65
+ render(<Accordion {...defaultProps} defaultOpen={false} />);
66
+ const collapse = screen.getByTestId("collapse");
67
+ expect(collapse).toHaveAttribute("data-open", "false");
68
+ });
69
+ });
70
+
71
+ describe("openOnlyOnDesktop", () => {
72
+ it("opens on desktop (width >= 1024)", () => {
73
+ Object.defineProperty(window, "innerWidth", {
74
+ writable: true,
75
+ value: 1024,
76
+ });
77
+ render(<Accordion {...defaultProps} openOnlyOnDesktop={true} />);
78
+ const collapse = screen.getByTestId("collapse");
79
+ expect(collapse).toHaveAttribute("data-open", "true");
80
+ });
81
+
82
+ it("stays closed on mobile (width < 1024)", () => {
83
+ Object.defineProperty(window, "innerWidth", {
84
+ writable: true,
85
+ value: 768,
86
+ });
87
+ render(<Accordion {...defaultProps} openOnlyOnDesktop={true} />);
88
+ const collapse = screen.getByTestId("collapse");
89
+ expect(collapse).toHaveAttribute("data-open", "false");
90
+ });
91
+
92
+ it("ignores defaultOpen when openOnlyOnDesktop is true", () => {
93
+ Object.defineProperty(window, "innerWidth", {
94
+ writable: true,
95
+ value: 500,
96
+ });
97
+ render(
98
+ <Accordion
99
+ {...defaultProps}
100
+ openOnlyOnDesktop={true}
101
+ defaultOpen={true}
102
+ />
103
+ );
104
+ const collapse = screen.getByTestId("collapse");
105
+ expect(collapse).toHaveAttribute("data-open", "false");
106
+ });
107
+ });
108
+
109
+ describe("toggle behavior", () => {
110
+ it("opens when button is clicked while closed", () => {
111
+ render(<Accordion {...defaultProps} />);
112
+ const button = screen.getByRole("button");
113
+ fireEvent.click(button);
114
+ const collapse = screen.getByTestId("collapse");
115
+ expect(collapse).toHaveAttribute("data-open", "true");
116
+ });
117
+
118
+ it("closes when button is clicked while open", () => {
119
+ render(<Accordion {...defaultProps} defaultOpen={true} />);
120
+ const button = screen.getByRole("button");
121
+ fireEvent.click(button);
122
+ const collapse = screen.getByTestId("collapse");
123
+ expect(collapse).toHaveAttribute("data-open", "false");
124
+ });
125
+
126
+ it("toggles multiple times", () => {
127
+ render(<Accordion {...defaultProps} />);
128
+ const button = screen.getByRole("button");
129
+ const collapse = screen.getByTestId("collapse");
130
+
131
+ fireEvent.click(button);
132
+ expect(collapse).toHaveAttribute("data-open", "true");
133
+
134
+ fireEvent.click(button);
135
+ expect(collapse).toHaveAttribute("data-open", "false");
136
+
137
+ fireEvent.click(button);
138
+ expect(collapse).toHaveAttribute("data-open", "true");
139
+ });
140
+ });
141
+
142
+ describe("icon state", () => {
143
+ it("shows keyboard_arrow_down when closed", () => {
144
+ render(<Accordion {...defaultProps} />);
145
+ const icon = screen.getByTestId("material-icon");
146
+ expect(icon).toHaveAttribute("data-name", "keyboard_arrow_down");
147
+ });
148
+
149
+ it("shows keyboard_arrow_up when open", () => {
150
+ render(<Accordion {...defaultProps} defaultOpen={true} />);
151
+ const icon = screen.getByTestId("material-icon");
152
+ expect(icon).toHaveAttribute("data-name", "keyboard_arrow_up");
153
+ });
154
+
155
+ it("toggles icon when clicked", () => {
156
+ render(<Accordion {...defaultProps} />);
157
+ const button = screen.getByRole("button");
158
+ const icon = screen.getByTestId("material-icon");
159
+
160
+ expect(icon).toHaveAttribute("data-name", "keyboard_arrow_down");
161
+ fireEvent.click(button);
162
+ expect(icon).toHaveAttribute("data-name", "keyboard_arrow_up");
163
+ });
164
+ });
165
+
166
+ describe("children rendering", () => {
167
+ it("renders children when open", () => {
168
+ render(<Accordion {...defaultProps} defaultOpen={true} />);
169
+ expect(screen.getByText("Accordion content")).toBeInTheDocument();
170
+ });
171
+
172
+ it("does not render children when closed", () => {
173
+ render(<Accordion {...defaultProps} />);
174
+ expect(screen.queryByText("Accordion content")).not.toBeInTheDocument();
175
+ });
176
+
177
+ it("renders complex children", () => {
178
+ render(
179
+ <Accordion title="Test">
180
+ <div data-testid="child-1">Child 1</div>
181
+ <div data-testid="child-2">Child 2</div>
182
+ </Accordion>
183
+ );
184
+ const button = screen.getByRole("button");
185
+ fireEvent.click(button);
186
+ expect(screen.getByTestId("child-1")).toBeInTheDocument();
187
+ expect(screen.getByTestId("child-2")).toBeInTheDocument();
188
+ });
189
+ });
190
+
191
+ describe("className props", () => {
192
+ it("applies containerClassName to outer div", () => {
193
+ const { container } = render(
194
+ <Accordion {...defaultProps} containerClassName="custom-container" />
195
+ );
196
+ expect(container.firstChild).toHaveClass("custom-container");
197
+ });
198
+
199
+ it("applies titleClassName to title span", () => {
200
+ render(<Accordion {...defaultProps} titleClassName="custom-title" />);
201
+ const titleSpan = screen.getByText("Accordion Title");
202
+ expect(titleSpan).toHaveClass("custom-title");
203
+ });
204
+
205
+ it("applies buttonClassName to button", () => {
206
+ render(<Accordion {...defaultProps} buttonClassName="custom-button" />);
207
+ const button = screen.getByRole("button");
208
+ expect(button.className).toContain("custom-button");
209
+ });
210
+
211
+ it("applies iconClassName to material icon", () => {
212
+ render(<Accordion {...defaultProps} iconClassName="custom-icon" />);
213
+ const icon = screen.getByTestId("material-icon");
214
+ expect(icon).toHaveClass("custom-icon");
215
+ });
216
+
217
+ it("applies className to content div when open", () => {
218
+ render(
219
+ <Accordion
220
+ {...defaultProps}
221
+ defaultOpen={true}
222
+ className="custom-content"
223
+ />
224
+ );
225
+ const contentDiv = screen.getByText("Accordion content").parentElement;
226
+ expect(contentDiv).toHaveClass("custom-content");
227
+ });
228
+ });
229
+
230
+ describe("borderRadiusNone", () => {
231
+ it("applies rounded-none when borderRadiusNone is true", () => {
232
+ const { container } = render(
233
+ <Accordion {...defaultProps} borderRadiusNone={true} />
234
+ );
235
+ expect(container.firstChild).toHaveClass("rounded-none");
236
+ });
237
+
238
+ it("applies rounded-surface-xs when borderRadiusNone is false", () => {
239
+ const { container } = render(
240
+ <Accordion {...defaultProps} borderRadiusNone={false} />
241
+ );
242
+ expect(container.firstChild).toHaveClass("rounded-surface-xs");
243
+ });
244
+
245
+ it("applies rounded-surface-xs by default", () => {
246
+ const { container } = render(<Accordion {...defaultProps} />);
247
+ expect(container.firstChild).toHaveClass("rounded-surface-xs");
248
+ });
249
+
250
+ it("applies rounded-none to button when borderRadiusNone is true", () => {
251
+ render(<Accordion {...defaultProps} borderRadiusNone={true} />);
252
+ const button = screen.getByRole("button");
253
+ expect(button.className).toContain("rounded-none");
254
+ });
255
+
256
+ it("applies rounded-t-surface-xs to button when borderRadiusNone is false", () => {
257
+ render(<Accordion {...defaultProps} borderRadiusNone={false} />);
258
+ const button = screen.getByRole("button");
259
+ expect(button.className).toContain("rounded-t-surface-xs");
260
+ });
261
+ });
262
+
263
+ describe("button attributes", () => {
264
+ it("renders button with type button", () => {
265
+ render(<Accordion {...defaultProps} />);
266
+ const button = screen.getByRole("button");
267
+ expect(button).toHaveAttribute("type", "button");
268
+ });
269
+ });
270
+ });
@@ -0,0 +1,152 @@
1
+ import "@testing-library/jest-dom";
2
+
3
+ import { AlertCard } from "./index";
4
+
5
+ import { render, screen } from "@testing-library/react";
6
+
7
+ // Mock dependencies
8
+ jest.mock("@shared/components/material-icon", () => ({
9
+ MaterialIcon: ({ name, size, className }: any) => (
10
+ <span
11
+ data-testid="material-icon"
12
+ data-name={name}
13
+ data-size={size}
14
+ className={className}
15
+ >
16
+ {name}
17
+ </span>
18
+ ),
19
+ }));
20
+
21
+ jest.mock("@shared/components/text", () => ({
22
+ Text: ({ children, className }: any) => (
23
+ <span data-testid="alert-text" className={className}>
24
+ {children}
25
+ </span>
26
+ ),
27
+ }));
28
+
29
+ jest.mock("@shared/utils", () => ({
30
+ cx: (...args: any[]) => args.filter(Boolean).join(" "),
31
+ }));
32
+
33
+ describe("AlertCard", () => {
34
+ it("has displayName set to AlertCard", () => {
35
+ expect(AlertCard.displayName).toBe("AlertCard");
36
+ });
37
+
38
+ describe("rendering", () => {
39
+ it("renders null when errorMessage is undefined", () => {
40
+ const { container } = render(<AlertCard />);
41
+ expect(container.firstChild).toBeNull();
42
+ });
43
+
44
+ it("renders null when errorMessage is empty string", () => {
45
+ const { container } = render(<AlertCard errorMessage="" />);
46
+ expect(container.firstChild).toBeNull();
47
+ });
48
+
49
+ it("renders null when errorMessage is null", () => {
50
+ const { container } = render(<AlertCard errorMessage={null as any} />);
51
+ expect(container.firstChild).toBeNull();
52
+ });
53
+
54
+ it("renders when errorMessage is provided", () => {
55
+ render(<AlertCard errorMessage="Something went wrong" />);
56
+ expect(screen.getByTestId("alert-card")).toBeInTheDocument();
57
+ });
58
+
59
+ it("renders the error message text", () => {
60
+ render(<AlertCard errorMessage="Connection failed" />);
61
+ expect(screen.getByText("Connection failed")).toBeInTheDocument();
62
+ });
63
+
64
+ it("renders a ReactNode as errorMessage", () => {
65
+ render(
66
+ <AlertCard
67
+ errorMessage={<strong data-testid="custom-node">Error!</strong>}
68
+ />
69
+ );
70
+ expect(screen.getByTestId("custom-node")).toBeInTheDocument();
71
+ });
72
+ });
73
+
74
+ describe("icon props", () => {
75
+ it("renders default icon name 'dangerous'", () => {
76
+ render(<AlertCard errorMessage="Error" />);
77
+ const icon = screen.getByTestId("material-icon");
78
+ expect(icon).toHaveAttribute("data-name", "dangerous");
79
+ });
80
+
81
+ it("renders custom icon name", () => {
82
+ render(<AlertCard errorMessage="Error" iconName="error" />);
83
+ const icon = screen.getByTestId("material-icon");
84
+ expect(icon).toHaveAttribute("data-name", "error");
85
+ });
86
+
87
+ it("uses default icon size of 52", () => {
88
+ render(<AlertCard errorMessage="Error" />);
89
+ const icon = screen.getByTestId("material-icon");
90
+ expect(icon).toHaveAttribute("data-size", "52");
91
+ });
92
+
93
+ it("uses custom icon size", () => {
94
+ render(<AlertCard errorMessage="Error" iconSize={24} />);
95
+ const icon = screen.getByTestId("material-icon");
96
+ expect(icon).toHaveAttribute("data-size", "24");
97
+ });
98
+
99
+ it("applies iconClassName to icon", () => {
100
+ render(<AlertCard errorMessage="Error" iconClassName="custom-icon" />);
101
+ const icon = screen.getByTestId("material-icon");
102
+ expect(icon).toHaveClass("custom-icon");
103
+ });
104
+
105
+ it("applies text-icon-critical class to icon by default", () => {
106
+ render(<AlertCard errorMessage="Error" />);
107
+ const icon = screen.getByTestId("material-icon");
108
+ expect(icon).toHaveClass("text-icon-critical");
109
+ });
110
+ });
111
+
112
+ describe("className props", () => {
113
+ it("applies custom className to container", () => {
114
+ render(<AlertCard errorMessage="Error" className="custom-class" />);
115
+ const card = screen.getByTestId("alert-card");
116
+ expect(card).toHaveClass("custom-class");
117
+ });
118
+
119
+ it("applies textVariant to text element", () => {
120
+ render(<AlertCard errorMessage="Error" textVariant="body1" />);
121
+ const text = screen.getByTestId("alert-text");
122
+ expect(text).toHaveClass("body1");
123
+ });
124
+
125
+ it("applies default text classes", () => {
126
+ render(<AlertCard errorMessage="Error" />);
127
+ const text = screen.getByTestId("alert-text");
128
+ expect(text.className).toContain("body2");
129
+ expect(text.className).toContain("text-text");
130
+ });
131
+ });
132
+
133
+ describe("structure", () => {
134
+ it("renders data-testid attribute on container", () => {
135
+ render(<AlertCard errorMessage="Error" />);
136
+ expect(screen.getByTestId("alert-card")).toBeInTheDocument();
137
+ });
138
+
139
+ it("renders icon within a wrapper div", () => {
140
+ render(<AlertCard errorMessage="Error" />);
141
+ const icon = screen.getByTestId("material-icon");
142
+ expect(icon.parentElement?.tagName).toBe("DIV");
143
+ });
144
+
145
+ it("applies base styling classes to container", () => {
146
+ render(<AlertCard errorMessage="Error" />);
147
+ const card = screen.getByTestId("alert-card");
148
+ expect(card).toHaveClass("flex");
149
+ expect(card).toHaveClass("flex-col");
150
+ });
151
+ });
152
+ });