quirk-ui 0.1.129 → 0.1.130
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/index14.css +1 -1
- package/dist/index3.css +1 -1
- package/dist/index6.css +1 -1
- package/dist/index7.css +1 -1
- package/dist/index8.css +1 -1
- package/dist/index9.css +1 -1
- package/dist/next/blocks/AdditionalCategoriesBlock/AdditionalCategoriesBlock.test.cjs +1 -1
- package/dist/next/blocks/AdditionalCategoriesBlock/AdditionalCategoriesBlock.test.mjs +92 -88
- package/dist/next/blocks/AdditionalCategoriesBlock/index.cjs +1 -1
- package/dist/next/blocks/AdditionalCategoriesBlock/index.mjs +24 -24
- package/dist/next/blocks/ContentBlock/index.cjs +1 -1
- package/dist/next/blocks/ContentBlock/index.mjs +69 -69
- package/dist/next/blocks/FeaturedDocumentsBlock/index.cjs +1 -1
- package/dist/next/blocks/FeaturedDocumentsBlock/index.mjs +32 -32
- package/dist/next/blocks/QuoteBlock/index.cjs +1 -1
- package/dist/next/blocks/QuoteBlock/index.mjs +14 -14
- package/dist/next/blocks/RichTextBlock/index.cjs +1 -1
- package/dist/next/blocks/RichTextBlock/index.mjs +10 -10
- package/dist/next/blocks/WasHelpfulBlock/WasHelpfulBlock.test.cjs +1 -1
- package/dist/next/blocks/WasHelpfulBlock/WasHelpfulBlock.test.mjs +56 -56
- package/dist/next/blocks/WasHelpfulBlock/index.cjs +1 -1
- package/dist/next/blocks/WasHelpfulBlock/index.mjs +23 -23
- package/package.json +1 -1
package/dist/index14.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._wasHelpful_1msqu_1{width:100%}._container_1msqu_5{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-md);padding:var(--spacing-lg) var(--spacing-md) var(--spacing-xl);max-width:var(--layout-width);margin:0 auto}._container_1msqu_5 hr{width:100%;border:0;height:0;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(255,255,255,.3)}._container_1msqu_5 hr:first-of-type{margin-bottom:var(--spacing-lg)}._container_1msqu_5 hr:last-of-type{margin-top:var(--spacing-lg)}._buttons_1msqu_34{width:100%}._heading_1msqu_49{font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold)}.narrow ._container_1msqu_5{max-width:var(--narrow-width)}
|
package/dist/index3.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._additionalCategories_tfoxo_1{width:100%;margin-bottom:var(--spacing-md)}._container_tfoxo_6{padding:0 var(--spacing-md) var(--spacing-md);max-width:var(--layout-width);margin:0 auto}._categories_tfoxo_12{display:flex;align-items:center;justify-content:flex-start;gap:var(--spacing-md)}._categories_tfoxo_12 p{font-weight:var(--font-weight-semibold)}._list_tfoxo_23{display:flex;align-items:center;justify-content:center;gap:var(--spacing-md);flex-wrap:wrap}._category_tfoxo_31{display:flex;align-items:center;justify-content:center;padding:0 var(--spacing-md);height:35px;background-color:var(--color-secondary-75);border-radius:var(--radius-full);transition:background-color .3s ease-in-out;cursor:pointer;color:#fff;text-decoration:none}._category_tfoxo_31:hover{background-color:var(--color-primary-100)}.narrow ._container_tfoxo_6{max-width:var(--narrow-width)}
|
package/dist/index6.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._content_1mhfh_1{width:100%;padding-top:var(--spacing-xl);padding-bottom:var(--spacing-xl)}._container_1mhfh_7{display:flex;align-items:center;justify-content:space-between;flex-direction:column;width:100%;max-width:var(--container-max-width, var(--layout-width));margin:0 auto;padding-left:var(--spacing-md);padding-right:var(--spacing-md)}._container_1mhfh_7 h1,._container_1mhfh_7 h2,._container_1mhfh_7 h3,._container_1mhfh_7 h4,._container_1mhfh_7 h5,._container_1mhfh_7 h6{width:100%;margin-block:0}@media (max-width: 767px){._container_1mhfh_7{gap:var(--spacing-xl)}}._eyebrow_1mhfh_34{font-weight:var(--font-weight-bold)}._metrics_1mhfh_38{display:flex;align-items:flex-start;flex-wrap:wrap;gap:var(--spacing-md);padding:var(--spacing-md)}@media (max-width: 767px){._metrics_1mhfh_38{flex-direction:column}}._metric_1mhfh_38{flex:1}._metricValue_1mhfh_54{font-size:2.5rem;font-weight:var(--font-weight-bold);position:relative;z-index:1;color:var(--color-text-primary)}._metricValue_1mhfh_54:after{content:"";display:block;background-color:var(--color-primary-10);width:35px;height:35px;position:absolute;top:-3px;left:-.5rem;z-index:-1;border-radius:var(--radius-md)}._disclaimer_1mhfh_75{color:var(--color-text-primary);font-size:var(--font-size-sm)}._layoutHImageRight_1mhfh_80{flex-direction:row;gap:var(--gap, 5rem)}._layoutHImageRight_1mhfh_80 ._heading_1mhfh_84{gap:var(--spacing-md);flex:.65}._layoutHImageRight_1mhfh_80 ._media_1mhfh_89{flex:.5}@media (max-width: 768px){._layoutHImageRight_1mhfh_80{flex-direction:column-reverse;gap:var(--spacing-lg)}}._noImage_1mhfh_99{flex-direction:column}._layoutHImageLeft_1mhfh_103{flex-direction:row-reverse;gap:var(--gap, 5rem)}._layoutHImageLeft_1mhfh_103 ._heading_1mhfh_84{gap:var(--spacing-md);flex:.65}._layoutHImageLeft_1mhfh_103 ._media_1mhfh_89{flex:.5}@media (max-width: 768px){._layoutHImageLeft_1mhfh_103{flex-direction:column-reverse;gap:var(--spacing-lg)}}._layoutVImageTop_1mhfh_122{flex-direction:column-reverse;gap:var(--gap, var(--spacing-lg))}._layoutVImageTop_1mhfh_122 ._heading_1mhfh_84{gap:var(--spacing-md)}@media (max-width: 768px){._layoutVImageTop_1mhfh_122{gap:var(--spacing-lg)}}._layoutVImageBottom_1mhfh_135{flex-direction:column;gap:var(--gap, var(--spacing-lg))}._layoutVImageBottom_1mhfh_135 ._heading_1mhfh_84{gap:var(--spacing-md)}@media (max-width: 768px){._layoutVImageBottom_1mhfh_135{gap:var(--spacing-lg)}}._heading_1mhfh_84{display:flex;flex-direction:column;width:100%;gap:var(--spacing-md)}._heading_1mhfh_84:not(:has(._text_1mhfh_154 .portableTextContainer)){gap:var(--spacing-lg)}._title_1mhfh_159{text-wrap:pretty}._text_1mhfh_154{flex:1;display:flex;justify-content:center;flex-direction:column;gap:var(--spacing-lg)}@media (max-width: 767px){._text_1mhfh_154{flex:1;width:100%;align-items:flex-start}}._cta_1mhfh_178{width:100%}@media (max-width: 767px){._cta_1mhfh_178{justify-content:flex-start}}._headingHorizontal_1mhfh_186{flex-direction:row;justify-content:space-between;gap:5rem}@media (max-width: 767px){._headingHorizontal_1mhfh_186{gap:var(--spacing-md)}}._headingHorizontal_1mhfh_186 ._titleWrapper_1mhfh_195,._headingHorizontal_1mhfh_186 .portableTextContainer{flex:1}._headingHorizontal_1mhfh_186 ._title_1mhfh_159{margin-bottom:0}._headingHorizontal_1mhfh_186 p._title_1mhfh_159{margin-top:1rem}@media (max-width: 768px){._headingHorizontal_1mhfh_186{flex-direction:column}}._headingVertical_1mhfh_216{flex-direction:column;justify-content:flex-start}._media_1mhfh_89{display:flex;align-items:center;justify-content:center;flex:1;width:100%;margin:0 auto;line-height:0}._media_1mhfh_89 img{width:100%;height:auto}._videoWrapper_1mhfh_237{position:relative;width:100%;padding-bottom:56.25%;height:0;overflow:hidden;border-radius:var(--radius-md);flex:1}._videoWrapper_1mhfh_237 iframe,._videoWrapper_1mhfh_237 video{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}._default_1mhfh_257{display:block}._default_1mhfh_257 img{border-radius:var(--radius-md)}._maxWidth_1mhfh_265{margin:0 auto}._maxWidth_1mhfh_265 img{max-width:var(--max-width, var(--layout-width));border-radius:var(--radius-md);height:auto}._fullBleed_1mhfh_275{width:100%;max-width:unset;border-radius:var(--radius-md);overflow:hidden}.narrow ._container_1mhfh_7{max-width:var(--narrow-width)}.centered ._heading_1mhfh_84{gap:var(--spacing-md);align-items:center;justify-content:center}.centered ._text_1mhfh_154{align-items:center}.centered ._cta_1mhfh_178{justify-content:center}.backgroundPrimary ._text_1mhfh_154 p,.backgroundPrimary ._text_1mhfh_154 p a,.backgroundPrimary ._metricValue_1mhfh_54{color:#fff}.backgroundPrimary ._metricValue_1mhfh_54:after{background-color:var(--color-secondary-100)}.backgroundPrimary ._cta_1mhfh_178 ._secondary_1mhfh_316{background-color:#fff}.split-35-65 ._heading_1mhfh_84{flex:.35}._layoutSplitText_1mhfh_329{flex-direction:row;align-items:flex-start;gap:var(--gap, 5rem)}@media (max-width: 768px){._layoutSplitText_1mhfh_329{flex-direction:column;gap:var(--spacing-lg)}}._layoutSplitText_1mhfh_329 ._heading_1mhfh_84{flex:.5}._additionalContent_1mhfh_344{flex:.5;display:flex;flex-direction:column;gap:var(--spacing-md)}@media (max-width: 768px){._additionalContent_1mhfh_344{flex:1;width:100%}}.imageRadius-sm ._media_1mhfh_89 img{border-radius:var(--radius-sm)}.imageRadius-md ._media_1mhfh_89 img{border-radius:var(--radius-md)}.imageRadius-lg ._media_1mhfh_89 img{border-radius:var(--radius-lg)}.imageRadius-full ._media_1mhfh_89 img{border-radius:var(--radius-full)}
|
package/dist/index7.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._featuredDocuments_knk5c_1{width:100%;padding-top:var(--spacing-xl);padding-bottom:var(--spacing-xl)}._container_knk5c_7{width:100%;max-width:var(--layout-width);margin:0 auto;display:flex;flex-direction:column;gap:var(--spacing-md);padding-left:var(--spacing-md);padding-right:var(--spacing-md)}._container_knk5c_7:has(._carousel_knk5c_17){padding-left:var(--spacing-md);padding-right:var(--spacing-md)}@media (max-width: 767px){._container_knk5c_7:has(._carousel_knk5c_17){padding-left:0;padding-right:0}}@media (max-width: 767px){._container_knk5c_7:has(._carousel_knk5c_17) ._heading_knk5c_25{padding-left:var(--spacing-md);padding-right:var(--spacing-md)}}._heading_knk5c_25{display:flex;flex-direction:column;gap:var(--spacing-md);width:100%;min-height:2.4rem}@media (max-width: 767px){._heading_knk5c_25{gap:2rem}}._eyebrow_knk5c_46{font-weight:var(--font-weight-bold)}._flex_knk5c_50{display:flex;align-items:flex-end;justify-content:space-between}@media (max-width: 767px){._flex_knk5c_50{flex-direction:column;align-items:flex-start;gap:var(--spacing-md)}}._flex_knk5c_50>div{flex:1}._flex_knk5c_50 a{display:flex;align-items:center;gap:var(--spacing-sm);color:var(--color-primary-100);font-weight:var(--font-weight-semibold);text-decoration:none;transition:color .3s ease-in-out}._flex_knk5c_50 a:hover{color:var(--color-secondary)}._title_knk5c_80{flex:1;text-wrap:balance}._text_knk5c_85{flex:1;display:flex;justify-content:center;flex-direction:column;gap:var(--spacing-lg)}@media (max-width: 767px){._text_knk5c_85{flex:1;width:100%;align-items:flex-start}}._disclaimer_knk5c_99{color:var(--color-text-primary);font-size:var(--font-size-sm)}._carousel_knk5c_17{display:block}._carousel_knk5c_17 ._document_knk5c_107{margin:0 auto;flex:0 0 300px}@media (max-width: 767px){._carousel_knk5c_17 ._document_knk5c_107{flex:0 0 100%}}._documents_knk5c_126{display:grid;gap:var(--spacing-md)}._documents_knk5c_126._col1_knk5c_130{display:block}._documents_knk5c_126._col1_knk5c_130 ._document_knk5c_107{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--spacing-lg)}@media (max-width: 767px){._documents_knk5c_126._col1_knk5c_130 ._document_knk5c_107{flex-direction:column;gap:var(--spacing-md)}}._documents_knk5c_126._col2_knk5c_147{grid-template-columns:repeat(2,1fr)}._documents_knk5c_126._col2_knk5c_147 ._document_knk5c_107{display:flex;flex-direction:column;gap:var(--spacing-md)}._documents_knk5c_126._col3_knk5c_157{grid-template-columns:repeat(3,1fr)}._documents_knk5c_126._col3_knk5c_157 ._document_knk5c_107{display:flex;flex-direction:column;gap:var(--spacing-md)}._documents_knk5c_126._col4_knk5c_167{grid-template-columns:repeat(4,1fr)}._documents_knk5c_126._col4_knk5c_167 ._document_knk5c_107{display:flex;flex-direction:column;gap:var(--spacing-md)}._documents_knk5c_126._featuredTop_knk5c_177{grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,1fr);row-gap:var(--spacing-xl)}@media (max-width: 767px){._documents_knk5c_126._featuredTop_knk5c_177{row-gap:var(--spacing-xl)}}._documents_knk5c_126._featuredTop_knk5c_177 ._document_knk5c_107:not(:first-of-type) ._documentExcerpt_knk5c_187{display:none}@media (max-width: 767px){._documents_knk5c_126._featuredTop_knk5c_177 ._document_knk5c_107:not(:first-of-type) ._documentExcerpt_knk5c_187{display:block}}._documents_knk5c_126._featuredTop_knk5c_177 ._document_knk5c_107:first-of-type{grid-column:1/4;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--spacing-lg)}@media (max-width: 767px){._documents_knk5c_126._featuredTop_knk5c_177 ._document_knk5c_107:first-of-type{flex-direction:column;gap:var(--spacing-md)}}._documents_knk5c_126._featuredTop_knk5c_177 ._document_knk5c_107:first-of-type ._documentContent_knk5c_211{flex:.4}._documents_knk5c_126._featuredLeft_knk5c_217{grid-template-rows:repeat(3,1fr);grid-template-columns:repeat(2,1fr);column-gap:var(--spacing-xl)}@media (max-width: 767px){._documents_knk5c_126._featuredLeft_knk5c_217{column-gap:var(--spacing-md)}}._documents_knk5c_126._featuredLeft_knk5c_217 ._document_knk5c_107:not(:first-of-type){flex-direction:row;gap:var(--spacing-md)}@media (max-width: 767px){._documents_knk5c_126._featuredLeft_knk5c_217 ._document_knk5c_107:not(:first-of-type){flex-direction:column}}._documents_knk5c_126._featuredLeft_knk5c_217 ._document_knk5c_107:not(:first-of-type) ._documentContent_knk5c_211{flex:1}@media (max-width: 767px){._documents_knk5c_126._featuredLeft_knk5c_217 ._document_knk5c_107:not(:first-of-type) ._documentExcerpt_knk5c_187{display:block}}._documents_knk5c_126._featuredLeft_knk5c_217 ._document_knk5c_107:first-of-type{grid-row:1/4;display:flex;flex-direction:column;align-items:center;justify-content:center}._documents_knk5c_126._featuredLeft_knk5c_217 ._document_knk5c_107:first-of-type ._documentContent_knk5c_211{flex:.4}._documents_knk5c_126._twoColumn_knk5c_258{grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr)}._documents_knk5c_126._twoColumn_knk5c_258 ._document_knk5c_107{flex-direction:row;gap:var(--spacing-md);align-items:center}@media (max-width: 767px){._documents_knk5c_126._col1_knk5c_130,._documents_knk5c_126._col2_knk5c_147,._documents_knk5c_126._col3_knk5c_157,._documents_knk5c_126._col4_knk5c_167,._documents_knk5c_126._featuredTop_knk5c_177,._documents_knk5c_126._featuredLeft_knk5c_217,._documents_knk5c_126._twoColumn_knk5c_258{display:flex;flex-direction:column}._documents_knk5c_126._col1_knk5c_130 ._document_knk5c_107:first-of-type,._documents_knk5c_126._col1_knk5c_130 ._document_knk5c_107:not(:first-of-type),._documents_knk5c_126._col2_knk5c_147 ._document_knk5c_107:first-of-type,._documents_knk5c_126._col2_knk5c_147 ._document_knk5c_107:not(:first-of-type),._documents_knk5c_126._col3_knk5c_157 ._document_knk5c_107:first-of-type,._documents_knk5c_126._col3_knk5c_157 ._document_knk5c_107:not(:first-of-type),._documents_knk5c_126._col4_knk5c_167 ._document_knk5c_107:first-of-type,._documents_knk5c_126._col4_knk5c_167 ._document_knk5c_107:not(:first-of-type),._documents_knk5c_126._featuredTop_knk5c_177 ._document_knk5c_107:first-of-type,._documents_knk5c_126._featuredTop_knk5c_177 ._document_knk5c_107:not(:first-of-type),._documents_knk5c_126._featuredLeft_knk5c_217 ._document_knk5c_107:first-of-type,._documents_knk5c_126._featuredLeft_knk5c_217 ._document_knk5c_107:not(:first-of-type),._documents_knk5c_126._twoColumn_knk5c_258 ._document_knk5c_107:first-of-type,._documents_knk5c_126._twoColumn_knk5c_258 ._document_knk5c_107:not(:first-of-type){flex-direction:column;gap:var(--spacing-md)}}@media (max-width: 767px){._documents_knk5c_126{gap:var(--spacing-xl)}}._multiple_knk5c_293 ._documents_knk5c_126{display:grid;grid-template-columns:repeat(4,1fr);gap:var(--spacing-md)}._multiple_knk5c_293 ._document_knk5c_107{display:flex;flex-direction:column}._document_knk5c_107{display:flex;text-decoration:none;overflow:hidden;transition:border-color .3s ease-in-out}._document_knk5c_107:hover{border-color:var(--color-primary-100)}._document_knk5c_107:hover ._documentTitle_knk5c_317 h3{color:var(--color-primary-100)}._document_knk5c_107:hover ._callToAction_knk5c_323 ._label_knk5c_324{opacity:1;transform:translateY(0);color:#fff}._document_knk5c_107:hover ._callToAction_knk5c_323 ._icon_knk5c_330{color:var(--color-primary-100)}._documentEyebrow_knk5c_337{font-size:var(--font-size-sm);color:var(--color-secondary)}._documentImage_knk5c_342{width:100%;height:100%;aspect-ratio:16/9;position:relative;overflow:hidden;border-radius:var(--radius-md);line-height:0}._documentImage_knk5c_342 img{width:100%;height:100%;object-fit:cover;transition:transform .3s ease-in-out}._documentTitle_knk5c_317{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-lg)}._documentContent_knk5c_211{display:flex;flex-direction:column;gap:var(--spacing-sm);width:100%;color:var(--color-text-primary)}._documentContent_knk5c_211 h3{flex:1;font-size:var(--font-size-lg);margin-bottom:0;transition:color .3s ease-in-out}._documentContent_knk5c_211 p{text-decoration:none}._callToAction_knk5c_323{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:var(--spacing-sm)}._callToAction_knk5c_323 ._icon_knk5c_330{display:flex;align-items:center;justify-content:center;width:25px;height:25px;background-color:transparent;color:var(--color-text-primary);transition:color .3s ease-in-out,background-color .3s ease-in-out,border-color .3s ease-in-out}._callToAction_knk5c_323 ._label_knk5c_324{color:var(--color-primary-100);font-weight:var(--font-weight-semibold);opacity:0;transform:translateY(10px);transition:opacity .3s ease-in-out,transform .3s ease-in-out}.narrow ._container_knk5c_7{max-width:var(--narrow-width)}
|
package/dist/index8.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._quote_6i4ni_1{width:100%}._container_6i4ni_5{max-width:calc(var(--layout-width) - 8rem);padding:var(--spacing-md);border-left:5px solid var(--color-primary-100);margin-left:auto;margin-right:auto}._quoteText_6i4ni_13{color:var(--color-text-primary);font-size:var(--font-size-lg);line-height:1.3}._quoteText_6i4ni_13:before{content:open-quote;font-size:2rem;display:inline-block;position:relative;top:.15rem;left:-3px;color:var(--color-primary-100);font-family:Times New Roman,Times,serif;font-weight:var(--font-weight-bold);line-height:0}._quoteText_6i4ni_13:after{content:close-quote;font-size:2rem;display:inline-block;position:relative;top:.15rem;right:-3px;color:var(--color-primary-100);font-family:Times New Roman,Times,serif;font-weight:var(--font-weight-bold);line-height:0}._author_6i4ni_45{margin-top:var(--spacing-md)}.narrow ._container_6i4ni_5{max-width:calc(var(--narrow-width) - 10rem)}
|
package/dist/index9.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._richText_l9mhr_1{width:100%}._container_l9mhr_5{max-width:var(--layout-width);margin:0 auto;padding:0 var(--spacing-md)}.narrow ._container_l9mhr_5{max-width:var(--narrow-width)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),o=require("./index.cjs");e.vi.mock("./styles.module.css",()=>({default:new Proxy({},{get:(i,l)=>l})}));function s(t){return{_id:t._id??"cat-1",title:t.title??"Test Category",slug:{current:t.slug}}}const a=s({_id:"kw-1",title:"AI keyword",slug:"topics/keyword/ai"}),g=s({_id:"tc-1",title:"Article Type",slug:"library/type/article"}),d=s({_id:"g-1",title:"Generic",slug:"topics/general/intro"}),c=({href:t,className:i,children:l})=>r.jsx("a",{"data-testid":"render-link",href:t,className:i,children:l});function n(t={}){return{categories:[a],...t}}e.describe("1. Empty / null rendering",()=>{e.it("renders nothing when categories prop is omitted",()=>{const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{}));e.globalExpect(t.firstChild).toBeNull()}),e.it("renders nothing when categories is an empty array",()=>{const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[]}));e.globalExpect(t.firstChild).toBeNull()}),e.it("renders nothing when all categories are type-classifiers (none pass the filter)",()=>{const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[g]}));e.globalExpect(t.firstChild).toBeNull()}),e.it("renders nothing when all categories are generic (no keyword in slug)",()=>{const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[d]}));e.globalExpect(t.firstChild).toBeNull()}),e.it("renders nothing when the only categories are a mix of type-classifiers and generics",()=>{const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[g,d]}));e.globalExpect(t.firstChild).toBeNull()})});e.describe("2. Keyword filter — only categories whose slug contains 'keyword' are shown",()=>{e.it("renders a keyword category",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()})),e.globalExpect(e.screen.getByText("AI keyword")).toBeInTheDocument()}),e.it("does not render a category whose slug does not contain 'keyword'",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[a,d]})),e.globalExpect(e.screen.queryByText("Generic")).toBeNull(),e.globalExpect(e.screen.getByText("AI keyword")).toBeInTheDocument()}),e.it("renders multiple keyword categories when all pass the filter",()=>{const t=s({_id:"kw-2",title:"ML keyword",slug:"topics/keyword/ml"});e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[a,t]})),e.globalExpect(e.screen.getByText("AI keyword")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("ML keyword")).toBeInTheDocument()})});e.describe("3. Type-classifier filter — slugs starting with 'library/type' are excluded",()=>{e.it("excludes a type-classifier even if its slug also contains 'keyword'",()=>{const t=s({_id:"amb-1",title:"Ambiguous",slug:"library/type/keyword/article"}),{container:i}=e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[t]}));e.globalExpect(i.firstChild).toBeNull()}),e.it("keeps a keyword category that does not start with library/type",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[g,a]})),e.globalExpect(e.screen.getByText("AI keyword")).toBeInTheDocument(),e.globalExpect(e.screen.queryByText("Article Type")).toBeNull()})});e.describe("4. Combined filter — type-classifiers AND non-keywords excluded in one pass",()=>{e.it("shows only the keyword category from a mixed list",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[g,d,a]}));const t=e.screen.getAllByRole("link");e.globalExpect(t).toHaveLength(1),e.globalExpect(t[0]).toHaveTextContent("AI keyword")})});e.describe("5. Link href — /blog/search?categories=<encoded _id>",()=>{e.it("builds the correct href for a category",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()}));const t=e.screen.getByRole("link");e.globalExpect(t.getAttribute("href")).toBe(`/blog/search?categories=${encodeURIComponent("kw-1")}`)}),e.it("URL-encodes special characters in the category _id",()=>{const t=s({_id:"kw id/special",title:"Special keyword",slug:"topics/keyword/special"});e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[t]}));const i=e.screen.getByRole("link");e.globalExpect(i.getAttribute("href")).toBe(`/blog/search?categories=${encodeURIComponent("kw id/special")}`)}),e.it("generates a distinct href for each category",()=>{const t=s({_id:"kw-2",title:"ML keyword",slug:"topics/keyword/ml"});e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[a,t]}));const l=e.screen.getAllByRole("link").map(k=>k.getAttribute("href"));e.globalExpect(l).toContain(`/blog/search?categories=${encodeURIComponent("kw-1")}`),e.globalExpect(l).toContain(`/blog/search?categories=${encodeURIComponent("kw-2")}`)})});e.describe("6. renderLink render prop — called with href, className, and children",()=>{e.it("uses renderLink when provided",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n({renderLink:c})})),e.globalExpect(e.screen.getByTestId("render-link")).toBeInTheDocument()}),e.it("passes the category title as children to renderLink",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n({renderLink:c})})),e.globalExpect(e.screen.getByTestId("render-link")).toHaveTextContent("AI keyword")}),e.it("passes the correct href to renderLink",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n({renderLink:c})})),e.globalExpect(e.screen.getByTestId("render-link").getAttribute("href")).toBe(`/blog/search?categories=${encodeURIComponent("kw-1")}`)}),e.it("passes the 'category' CSS class to renderLink",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n({renderLink:c})})),e.globalExpect(e.screen.getByTestId("render-link").getAttribute("class")).toContain("category")}),e.it("calls renderLink once per visible keyword category",()=>{const t=e.vi.fn(c),i=s({_id:"kw-2",title:"ML keyword",slug:"topics/keyword/ml"});e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[a,i],renderLink:t})),e.globalExpect(t).toHaveBeenCalledTimes(2)})});e.describe("7. Plain <a> fallback — rendered when renderLink is not provided",()=>{e.it("renders a plain anchor tag",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()}));const t=e.screen.getByRole("link");e.globalExpect(t.tagName).toBe("A")}),e.it("plain anchor has the correct href",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()})),e.globalExpect(e.screen.getByRole("link").getAttribute("href")).toBe(`/blog/search?categories=${encodeURIComponent("kw-1")}`)}),e.it("plain anchor has the 'category' CSS class",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()})),e.globalExpect(e.screen.getByRole("link").getAttribute("class")).toContain("category")}),e.it("plain anchor displays the category title",()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()})),e.globalExpect(e.screen.getByRole("link")).toHaveTextContent("AI keyword")})});e.describe('8. type="article" — adds "narrow" class to the section',()=>{e.it('adds the "narrow" class when type is "article"',()=>{var i;const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{...n({type:"article"})}));e.globalExpect((i=t.querySelector("section"))==null?void 0:i.className).toContain("narrow")})});e.describe('9. Non-"article" type — "narrow" class is absent',()=>{e.it('does not add "narrow" class when type is omitted',()=>{var i;const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()}));e.globalExpect((i=t.querySelector("section"))==null?void 0:i.className).not.toContain("narrow")}),e.it('does not add "narrow" class when type is something other than "article"',()=>{var i;const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{...n({type:"video"})}));e.globalExpect((i=t.querySelector("section"))==null?void 0:i.className).not.toContain("narrow")})});e.describe('10. "In this article:" label — always present when categories render',()=>{e.it('renders the "In this article:" paragraph',()=>{e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()})),e.globalExpect(e.screen.getByText("In this article:")).toBeInTheDocument()}),e.it("does not render the label when there are no keyword categories",()=>{const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{categories:[d]}));e.globalExpect(t.firstChild).toBeNull()})});e.describe("11. id prop — forwarded to the <section> element",()=>{e.it("sets the id attribute on the section",()=>{var i;const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{...n({id:"related-tags"})}));e.globalExpect((i=t.querySelector("section"))==null?void 0:i.id).toBe("related-tags")}),e.it("renders without an id attribute when prop is omitted",()=>{var i;const{container:t}=e.render(r.jsx(o.AdditionalCategoriesBlock,{...n()}));e.globalExpect((i=t.querySelector("section"))==null?void 0:i.hasAttribute("id")).toBe(!1)})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { v as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { v as p, d as l, i as o, r as n, g as t, s as a } from "../../../react.esm-DjxyacK8.js";
|
|
3
3
|
import { AdditionalCategoriesBlock as i } from "./index.mjs";
|
|
4
|
-
|
|
4
|
+
p.mock("./styles.module.css", () => ({ default: new Proxy({}, { get: (s, y) => y }) }));
|
|
5
5
|
function d(e) {
|
|
6
6
|
return {
|
|
7
7
|
_id: e._id ?? "cat-1",
|
|
@@ -13,7 +13,7 @@ const g = d({
|
|
|
13
13
|
_id: "kw-1",
|
|
14
14
|
title: "AI keyword",
|
|
15
15
|
slug: "topics/keyword/ai"
|
|
16
|
-
}),
|
|
16
|
+
}), w = d({
|
|
17
17
|
_id: "tc-1",
|
|
18
18
|
title: "Article Type",
|
|
19
19
|
slug: "library/type/article"
|
|
@@ -21,84 +21,84 @@ const g = d({
|
|
|
21
21
|
_id: "g-1",
|
|
22
22
|
title: "Generic",
|
|
23
23
|
slug: "topics/general/intro"
|
|
24
|
-
}), h = ({ href: e, className: s, children: y }) => /* @__PURE__ */
|
|
25
|
-
function
|
|
24
|
+
}), h = ({ href: e, className: s, children: y }) => /* @__PURE__ */ r("a", { "data-testid": "render-link", href: e, className: s, children: y });
|
|
25
|
+
function c(e = {}) {
|
|
26
26
|
return {
|
|
27
27
|
categories: [g],
|
|
28
28
|
...e
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const { container: e } = n(/* @__PURE__ */
|
|
31
|
+
l("1. Empty / null rendering", () => {
|
|
32
|
+
o("renders nothing when categories prop is omitted", () => {
|
|
33
|
+
const { container: e } = n(/* @__PURE__ */ r(i, {}));
|
|
34
34
|
t(e.firstChild).toBeNull();
|
|
35
|
-
}),
|
|
36
|
-
const { container: e } = n(/* @__PURE__ */
|
|
35
|
+
}), o("renders nothing when categories is an empty array", () => {
|
|
36
|
+
const { container: e } = n(/* @__PURE__ */ r(i, { categories: [] }));
|
|
37
37
|
t(e.firstChild).toBeNull();
|
|
38
|
-
}),
|
|
38
|
+
}), o("renders nothing when all categories are type-classifiers (none pass the filter)", () => {
|
|
39
39
|
const { container: e } = n(
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ r(i, { categories: [w] })
|
|
41
41
|
);
|
|
42
42
|
t(e.firstChild).toBeNull();
|
|
43
|
-
}),
|
|
43
|
+
}), o("renders nothing when all categories are generic (no keyword in slug)", () => {
|
|
44
44
|
const { container: e } = n(
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ r(i, { categories: [k] })
|
|
46
46
|
);
|
|
47
47
|
t(e.firstChild).toBeNull();
|
|
48
|
-
}),
|
|
48
|
+
}), o("renders nothing when the only categories are a mix of type-classifiers and generics", () => {
|
|
49
49
|
const { container: e } = n(
|
|
50
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ r(
|
|
51
51
|
i,
|
|
52
52
|
{
|
|
53
|
-
categories: [
|
|
53
|
+
categories: [w, k]
|
|
54
54
|
}
|
|
55
55
|
)
|
|
56
56
|
);
|
|
57
57
|
t(e.firstChild).toBeNull();
|
|
58
58
|
});
|
|
59
59
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
n(/* @__PURE__ */
|
|
63
|
-
}),
|
|
64
|
-
n(/* @__PURE__ */
|
|
65
|
-
}),
|
|
60
|
+
l("2. Keyword filter — only categories whose slug contains 'keyword' are shown", () => {
|
|
61
|
+
o("renders a keyword category", () => {
|
|
62
|
+
n(/* @__PURE__ */ r(i, { ...c() })), t(a.getByText("AI keyword")).toBeInTheDocument();
|
|
63
|
+
}), o("does not render a category whose slug does not contain 'keyword'", () => {
|
|
64
|
+
n(/* @__PURE__ */ r(i, { categories: [g, k] })), t(a.queryByText("Generic")).toBeNull(), t(a.getByText("AI keyword")).toBeInTheDocument();
|
|
65
|
+
}), o("renders multiple keyword categories when all pass the filter", () => {
|
|
66
66
|
const e = d({
|
|
67
67
|
_id: "kw-2",
|
|
68
68
|
title: "ML keyword",
|
|
69
69
|
slug: "topics/keyword/ml"
|
|
70
70
|
});
|
|
71
|
-
n(/* @__PURE__ */
|
|
71
|
+
n(/* @__PURE__ */ r(i, { categories: [g, e] })), t(a.getByText("AI keyword")).toBeInTheDocument(), t(a.getByText("ML keyword")).toBeInTheDocument();
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
l("3. Type-classifier filter — slugs starting with 'library/type' are excluded", () => {
|
|
75
|
+
o("excludes a type-classifier even if its slug also contains 'keyword'", () => {
|
|
76
76
|
const e = d({
|
|
77
77
|
_id: "amb-1",
|
|
78
78
|
title: "Ambiguous",
|
|
79
79
|
slug: "library/type/keyword/article"
|
|
80
80
|
}), { container: s } = n(
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ r(i, { categories: [e] })
|
|
82
82
|
);
|
|
83
83
|
t(s.firstChild).toBeNull();
|
|
84
|
-
}),
|
|
84
|
+
}), o("keeps a keyword category that does not start with library/type", () => {
|
|
85
85
|
n(
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ r(
|
|
87
87
|
i,
|
|
88
88
|
{
|
|
89
|
-
categories: [
|
|
89
|
+
categories: [w, g]
|
|
90
90
|
}
|
|
91
91
|
)
|
|
92
92
|
), t(a.getByText("AI keyword")).toBeInTheDocument(), t(a.queryByText("Article Type")).toBeNull();
|
|
93
93
|
});
|
|
94
94
|
});
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
l("4. Combined filter — type-classifiers AND non-keywords excluded in one pass", () => {
|
|
96
|
+
o("shows only the keyword category from a mixed list", () => {
|
|
97
97
|
n(
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ r(
|
|
99
99
|
i,
|
|
100
100
|
{
|
|
101
|
-
categories: [
|
|
101
|
+
categories: [w, k, g]
|
|
102
102
|
}
|
|
103
103
|
)
|
|
104
104
|
);
|
|
@@ -106,31 +106,31 @@ c("4. Combined filter — type-classifiers AND non-keywords excluded in one pass
|
|
|
106
106
|
t(e).toHaveLength(1), t(e[0]).toHaveTextContent("AI keyword");
|
|
107
107
|
});
|
|
108
108
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
n(/* @__PURE__ */
|
|
109
|
+
l("5. Link href — /blog/search?categories=<encoded _id>", () => {
|
|
110
|
+
o("builds the correct href for a category", () => {
|
|
111
|
+
n(/* @__PURE__ */ r(i, { ...c() }));
|
|
112
112
|
const e = a.getByRole("link");
|
|
113
113
|
t(e.getAttribute("href")).toBe(
|
|
114
114
|
`/blog/search?categories=${encodeURIComponent("kw-1")}`
|
|
115
115
|
);
|
|
116
|
-
}),
|
|
116
|
+
}), o("URL-encodes special characters in the category _id", () => {
|
|
117
117
|
const e = d({
|
|
118
118
|
_id: "kw id/special",
|
|
119
119
|
title: "Special keyword",
|
|
120
120
|
slug: "topics/keyword/special"
|
|
121
121
|
});
|
|
122
|
-
n(/* @__PURE__ */
|
|
122
|
+
n(/* @__PURE__ */ r(i, { categories: [e] }));
|
|
123
123
|
const s = a.getByRole("link");
|
|
124
124
|
t(s.getAttribute("href")).toBe(
|
|
125
125
|
`/blog/search?categories=${encodeURIComponent("kw id/special")}`
|
|
126
126
|
);
|
|
127
|
-
}),
|
|
127
|
+
}), o("generates a distinct href for each category", () => {
|
|
128
128
|
const e = d({
|
|
129
129
|
_id: "kw-2",
|
|
130
130
|
title: "ML keyword",
|
|
131
131
|
slug: "topics/keyword/ml"
|
|
132
132
|
});
|
|
133
|
-
n(/* @__PURE__ */
|
|
133
|
+
n(/* @__PURE__ */ r(i, { categories: [g, e] }));
|
|
134
134
|
const y = a.getAllByRole("link").map((u) => u.getAttribute("href"));
|
|
135
135
|
t(y).toContain(
|
|
136
136
|
`/blog/search?categories=${encodeURIComponent("kw-1")}`
|
|
@@ -139,55 +139,55 @@ c("5. Link href — /blog/search?categories=<encoded _id>", () => {
|
|
|
139
139
|
);
|
|
140
140
|
});
|
|
141
141
|
});
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
l("6. renderLink render prop — called with href, className, and children", () => {
|
|
143
|
+
o("uses renderLink when provided", () => {
|
|
144
144
|
n(
|
|
145
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ r(
|
|
146
146
|
i,
|
|
147
147
|
{
|
|
148
|
-
...
|
|
148
|
+
...c({ renderLink: h })
|
|
149
149
|
}
|
|
150
150
|
)
|
|
151
151
|
), t(a.getByTestId("render-link")).toBeInTheDocument();
|
|
152
|
-
}),
|
|
152
|
+
}), o("passes the category title as children to renderLink", () => {
|
|
153
153
|
n(
|
|
154
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ r(
|
|
155
155
|
i,
|
|
156
156
|
{
|
|
157
|
-
...
|
|
157
|
+
...c({ renderLink: h })
|
|
158
158
|
}
|
|
159
159
|
)
|
|
160
160
|
), t(a.getByTestId("render-link")).toHaveTextContent("AI keyword");
|
|
161
|
-
}),
|
|
161
|
+
}), o("passes the correct href to renderLink", () => {
|
|
162
162
|
n(
|
|
163
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ r(
|
|
164
164
|
i,
|
|
165
165
|
{
|
|
166
|
-
...
|
|
166
|
+
...c({ renderLink: h })
|
|
167
167
|
}
|
|
168
168
|
)
|
|
169
169
|
), t(a.getByTestId("render-link").getAttribute("href")).toBe(
|
|
170
170
|
`/blog/search?categories=${encodeURIComponent("kw-1")}`
|
|
171
171
|
);
|
|
172
|
-
}),
|
|
172
|
+
}), o("passes the 'category' CSS class to renderLink", () => {
|
|
173
173
|
n(
|
|
174
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ r(
|
|
175
175
|
i,
|
|
176
176
|
{
|
|
177
|
-
...
|
|
177
|
+
...c({ renderLink: h })
|
|
178
178
|
}
|
|
179
179
|
)
|
|
180
180
|
), t(a.getByTestId("render-link").getAttribute("class")).toContain(
|
|
181
181
|
"category"
|
|
182
182
|
);
|
|
183
|
-
}),
|
|
184
|
-
const e =
|
|
183
|
+
}), o("calls renderLink once per visible keyword category", () => {
|
|
184
|
+
const e = p.fn(h), s = d({
|
|
185
185
|
_id: "kw-2",
|
|
186
186
|
title: "ML keyword",
|
|
187
187
|
slug: "topics/keyword/ml"
|
|
188
188
|
});
|
|
189
189
|
n(
|
|
190
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ r(
|
|
191
191
|
i,
|
|
192
192
|
{
|
|
193
193
|
categories: [g, s],
|
|
@@ -197,68 +197,72 @@ c("6. renderLink render prop — called with href, className, and children", ()
|
|
|
197
197
|
), t(e).toHaveBeenCalledTimes(2);
|
|
198
198
|
});
|
|
199
199
|
});
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
n(/* @__PURE__ */
|
|
200
|
+
l("7. Plain <a> fallback — rendered when renderLink is not provided", () => {
|
|
201
|
+
o("renders a plain anchor tag", () => {
|
|
202
|
+
n(/* @__PURE__ */ r(i, { ...c() }));
|
|
203
203
|
const e = a.getByRole("link");
|
|
204
204
|
t(e.tagName).toBe("A");
|
|
205
|
-
}),
|
|
206
|
-
n(/* @__PURE__ */
|
|
205
|
+
}), o("plain anchor has the correct href", () => {
|
|
206
|
+
n(/* @__PURE__ */ r(i, { ...c() })), t(a.getByRole("link").getAttribute("href")).toBe(
|
|
207
207
|
`/blog/search?categories=${encodeURIComponent("kw-1")}`
|
|
208
208
|
);
|
|
209
|
-
}),
|
|
210
|
-
n(/* @__PURE__ */
|
|
209
|
+
}), o("plain anchor has the 'category' CSS class", () => {
|
|
210
|
+
n(/* @__PURE__ */ r(i, { ...c() })), t(a.getByRole("link").getAttribute("class")).toContain(
|
|
211
211
|
"category"
|
|
212
212
|
);
|
|
213
|
-
}),
|
|
214
|
-
n(/* @__PURE__ */
|
|
213
|
+
}), o("plain anchor displays the category title", () => {
|
|
214
|
+
n(/* @__PURE__ */ r(i, { ...c() })), t(a.getByRole("link")).toHaveTextContent("AI keyword");
|
|
215
215
|
});
|
|
216
216
|
});
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
l('8. type="article" — adds "narrow" class to the section', () => {
|
|
218
|
+
o('adds the "narrow" class when type is "article"', () => {
|
|
219
219
|
var s;
|
|
220
220
|
const { container: e } = n(
|
|
221
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ r(i, { ...c({ type: "article" }) })
|
|
222
222
|
);
|
|
223
|
-
t((s = e.querySelector("section")) == null ? void 0 : s.className).toContain("
|
|
223
|
+
t((s = e.querySelector("section")) == null ? void 0 : s.className).toContain("narrow");
|
|
224
224
|
});
|
|
225
225
|
});
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
l('9. Non-"article" type — "narrow" class is absent', () => {
|
|
227
|
+
o('does not add "narrow" class when type is omitted', () => {
|
|
228
228
|
var s;
|
|
229
229
|
const { container: e } = n(
|
|
230
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ r(i, { ...c() })
|
|
231
231
|
);
|
|
232
|
-
t((s = e.querySelector("section")) == null ? void 0 : s.className).not.toContain(
|
|
233
|
-
|
|
232
|
+
t((s = e.querySelector("section")) == null ? void 0 : s.className).not.toContain(
|
|
233
|
+
"narrow"
|
|
234
|
+
);
|
|
235
|
+
}), o('does not add "narrow" class when type is something other than "article"', () => {
|
|
234
236
|
var s;
|
|
235
237
|
const { container: e } = n(
|
|
236
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ r(i, { ...c({ type: "video" }) })
|
|
239
|
+
);
|
|
240
|
+
t((s = e.querySelector("section")) == null ? void 0 : s.className).not.toContain(
|
|
241
|
+
"narrow"
|
|
237
242
|
);
|
|
238
|
-
t((s = e.querySelector("section")) == null ? void 0 : s.className).not.toContain("blog");
|
|
239
243
|
});
|
|
240
244
|
});
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
n(/* @__PURE__ */
|
|
244
|
-
}),
|
|
245
|
+
l('10. "In this article:" label — always present when categories render', () => {
|
|
246
|
+
o('renders the "In this article:" paragraph', () => {
|
|
247
|
+
n(/* @__PURE__ */ r(i, { ...c() })), t(a.getByText("In this article:")).toBeInTheDocument();
|
|
248
|
+
}), o("does not render the label when there are no keyword categories", () => {
|
|
245
249
|
const { container: e } = n(
|
|
246
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ r(i, { categories: [k] })
|
|
247
251
|
);
|
|
248
252
|
t(e.firstChild).toBeNull();
|
|
249
253
|
});
|
|
250
254
|
});
|
|
251
|
-
|
|
252
|
-
|
|
255
|
+
l("11. id prop — forwarded to the <section> element", () => {
|
|
256
|
+
o("sets the id attribute on the section", () => {
|
|
253
257
|
var s;
|
|
254
258
|
const { container: e } = n(
|
|
255
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ r(i, { ...c({ id: "related-tags" }) })
|
|
256
260
|
);
|
|
257
261
|
t((s = e.querySelector("section")) == null ? void 0 : s.id).toBe("related-tags");
|
|
258
|
-
}),
|
|
262
|
+
}), o("renders without an id attribute when prop is omitted", () => {
|
|
259
263
|
var s;
|
|
260
264
|
const { container: e } = n(
|
|
261
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ r(i, { ...c() })
|
|
262
266
|
);
|
|
263
267
|
t((s = e.querySelector("section")) == null ? void 0 : s.hasAttribute("id")).toBe(!1);
|
|
264
268
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index3.css');const t=require("react/jsx-runtime"),d=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index3.css');const t=require("react/jsx-runtime"),d=require("react"),u="_additionalCategories_tfoxo_1",g="_container_tfoxo_6",_="_categories_tfoxo_12",h="_list_tfoxo_23",x="_category_tfoxo_31",i={additionalCategories:u,container:g,categories:_,list:h,category:x};function f({categories:o,type:l,id:c,renderLink:s}){if(!(o!=null&&o.length))return null;const n=o.filter(e=>{var r,a;return!((a=(r=e.slug)==null?void 0:r.current)!=null&&a.startsWith("library/type"))&&e.slug.current.includes("keyword")});return n.length?t.jsx("section",{id:c,className:`${i.additionalCategories} ${l==="article"?"narrow":""}`,children:t.jsx("article",{className:i.container,children:t.jsxs("div",{className:i.categories,children:[t.jsx("p",{children:"In this article:"}),t.jsx("div",{className:i.list,children:n.map(e=>{const r=`/blog/search?categories=${encodeURIComponent(e._id)}`;return t.jsx(d.Fragment,{children:s?s({href:r,className:i.category,children:e.title}):t.jsx("a",{href:r,className:i.category,children:e.title})},e._id)})})]})})}):null}exports.AdditionalCategoriesBlock=f;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import _ from "react";
|
|
3
|
-
import '../../../index3.css';const
|
|
4
|
-
additionalCategories:
|
|
5
|
-
container:
|
|
6
|
-
categories:
|
|
7
|
-
list:
|
|
8
|
-
category:
|
|
3
|
+
import '../../../index3.css';const g = "_additionalCategories_tfoxo_1", h = "_container_tfoxo_6", f = "_categories_tfoxo_12", m = "_list_tfoxo_23", u = "_category_tfoxo_31", i = {
|
|
4
|
+
additionalCategories: g,
|
|
5
|
+
container: h,
|
|
6
|
+
categories: f,
|
|
7
|
+
list: m,
|
|
8
|
+
category: u
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function y({
|
|
11
11
|
categories: r,
|
|
12
|
-
type:
|
|
12
|
+
type: s,
|
|
13
13
|
id: c,
|
|
14
|
-
renderLink:
|
|
14
|
+
renderLink: n
|
|
15
15
|
}) {
|
|
16
16
|
if (!(r != null && r.length)) return null;
|
|
17
17
|
const a = r.filter(
|
|
18
|
-
(
|
|
19
|
-
var
|
|
20
|
-
return !((
|
|
18
|
+
(t) => {
|
|
19
|
+
var o, l;
|
|
20
|
+
return !((l = (o = t.slug) == null ? void 0 : o.current) != null && l.startsWith("library/type")) && t.slug.current.includes("keyword");
|
|
21
21
|
}
|
|
22
22
|
);
|
|
23
|
-
return a.length ? /* @__PURE__ */
|
|
23
|
+
return a.length ? /* @__PURE__ */ e(
|
|
24
24
|
"section",
|
|
25
25
|
{
|
|
26
26
|
id: c,
|
|
27
|
-
className: `${i.additionalCategories} ${
|
|
28
|
-
children: /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
href:
|
|
27
|
+
className: `${i.additionalCategories} ${s === "article" ? "narrow" : ""}`,
|
|
28
|
+
children: /* @__PURE__ */ e("article", { className: i.container, children: /* @__PURE__ */ d("div", { className: i.categories, children: [
|
|
29
|
+
/* @__PURE__ */ e("p", { children: "In this article:" }),
|
|
30
|
+
/* @__PURE__ */ e("div", { className: i.list, children: a.map((t) => {
|
|
31
|
+
const o = `/blog/search?categories=${encodeURIComponent(t._id)}`;
|
|
32
|
+
return /* @__PURE__ */ e(_.Fragment, { children: n ? n({
|
|
33
|
+
href: o,
|
|
34
34
|
className: i.category,
|
|
35
|
-
children:
|
|
36
|
-
}) : /* @__PURE__ */
|
|
35
|
+
children: t.title
|
|
36
|
+
}) : /* @__PURE__ */ e("a", { href: o, className: i.category, children: t.title }) }, t._id);
|
|
37
37
|
}) })
|
|
38
38
|
] }) })
|
|
39
39
|
}
|
|
40
40
|
) : null;
|
|
41
41
|
}
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
y as AdditionalCategoriesBlock
|
|
44
44
|
};
|