@universityofmaryland/web-elements-library 1.5.0-beta.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/composite/banner/promo.d.ts.map +1 -1
- package/dist/composite/banner/promo.js +6 -3
- package/dist/composite/banner/promo.js.map +1 -1
- package/dist/composite/banner/promo.mjs +6 -3
- package/dist/composite/banner/promo.mjs.map +1 -1
- package/dist/composite/footer/elements/main-section/index.js.map +1 -1
- package/dist/composite/footer/elements/main-section/index.mjs.map +1 -1
- package/dist/composite/navigation/header.d.ts.map +1 -1
- package/dist/composite/navigation/header.js +4 -1
- package/dist/composite/navigation/header.js.map +1 -1
- package/dist/composite/navigation/header.mjs +4 -1
- package/dist/composite/navigation/header.mjs.map +1 -1
- package/dist/composite/quote/elements/icon.d.ts +3 -2
- package/dist/composite/quote/elements/icon.d.ts.map +1 -1
- package/dist/composite/quote/elements/icon.js +23 -16
- package/dist/composite/quote/elements/icon.js.map +1 -1
- package/dist/composite/quote/elements/icon.mjs +23 -16
- package/dist/composite/quote/elements/icon.mjs.map +1 -1
- package/dist/composite/quote/elements/image.d.ts.map +1 -1
- package/dist/composite/quote/elements/image.js +6 -6
- package/dist/composite/quote/elements/image.js.map +1 -1
- package/dist/composite/quote/elements/image.mjs +6 -6
- package/dist/composite/quote/elements/image.mjs.map +1 -1
- package/dist/composite/quote/elements/index.d.ts +1 -0
- package/dist/composite/quote/elements/index.d.ts.map +1 -1
- package/dist/composite/quote/elements/index.js +2 -0
- package/dist/composite/quote/elements/index.js.map +1 -1
- package/dist/composite/quote/elements/index.mjs +2 -0
- package/dist/composite/quote/elements/index.mjs.map +1 -1
- package/dist/composite/quote/elements/quote.d.ts +13 -0
- package/dist/composite/quote/elements/quote.d.ts.map +1 -0
- package/dist/composite/quote/elements/quote.js +114 -0
- package/dist/composite/quote/elements/quote.js.map +1 -0
- package/dist/composite/quote/elements/quote.mjs +97 -0
- package/dist/composite/quote/elements/quote.mjs.map +1 -0
- package/dist/composite/quote/elements/text.d.ts +1 -1
- package/dist/composite/quote/elements/text.d.ts.map +1 -1
- package/dist/composite/quote/elements/text.js +103 -172
- package/dist/composite/quote/elements/text.js.map +1 -1
- package/dist/composite/quote/elements/text.mjs +103 -172
- package/dist/composite/quote/elements/text.mjs.map +1 -1
- package/dist/composite/quote/featured.d.ts +3 -0
- package/dist/composite/quote/featured.d.ts.map +1 -1
- package/dist/composite/quote/featured.js +14 -7
- package/dist/composite/quote/featured.js.map +1 -1
- package/dist/composite/quote/featured.mjs +14 -7
- package/dist/composite/quote/featured.mjs.map +1 -1
- package/dist/composite/quote/helper/animation.d.ts.map +1 -1
- package/dist/composite/quote/helper/animation.js +67 -36
- package/dist/composite/quote/helper/animation.js.map +1 -1
- package/dist/composite/quote/helper/animation.mjs +67 -36
- package/dist/composite/quote/helper/animation.mjs.map +1 -1
- package/dist/composite/quote/inline.d.ts +3 -0
- package/dist/composite/quote/inline.d.ts.map +1 -1
- package/dist/composite/quote/inline.js +15 -7
- package/dist/composite/quote/inline.js.map +1 -1
- package/dist/composite/quote/inline.mjs +15 -7
- package/dist/composite/quote/inline.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.mjs","sources":["../../../../source/composite/quote/elements/icon.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { quote as iconQuote } from '@universityofmaryland/web-icons-library/brand';\nimport { ElementModel } from 'model';\nimport { SMALL } from '../_constants';\nimport { type QuoteBaseProps, type QuoteVariantProps } from '../_types';\n\ninterface QuoteIconProps\n extends QuoteVariantProps,\n Pick<QuoteBaseProps, 'isThemeMaryland'
|
|
1
|
+
{"version":3,"file":"icon.mjs","sources":["../../../../source/composite/quote/elements/icon.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { quote as iconQuote } from '@universityofmaryland/web-icons-library/brand';\nimport { ElementModel } from 'model';\nimport { SMALL } from '../_constants';\nimport { type QuoteBaseProps, type QuoteVariantProps } from '../_types';\n\ninterface QuoteIconProps\n extends QuoteVariantProps,\n Pick<QuoteBaseProps, 'isThemeMaryland'> {\n hasImage?: boolean;\n}\n\nexport default ({\n hasImage = false,\n isThemeMaryland,\n isTypeFeatured = false,\n}: QuoteIconProps) => {\n const imageWithFeaturedLayout = hasImage && isTypeFeatured;\n\n const iconSpan = ElementModel.createSpan({\n className: 'quote-icon-span',\n elementStyles: {\n element: {\n display: 'block',\n position: 'absolute',\n\n ...(imageWithFeaturedLayout && {\n display: 'none',\n }),\n\n ...(!hasImage && {\n height: '15px',\n width: '22px',\n left: '-24px',\n top: '-32px',\n\n [`@container (min-width: ${SMALL}px)`]: {\n left: `-${token.spacing['4xl']}`,\n top: '0',\n },\n }),\n\n ...(hasImage && {\n bottom: '-7px',\n left: '-2px',\n height: '15px',\n width: '21px',\n\n [`@container (min-width: ${SMALL}px)`]: {\n height: '20px',\n width: '29px',\n top: '-11px',\n right: '-20px',\n left: 'inherit',\n },\n }),\n\n ['& svg']: {\n fill: token.color.red,\n\n ...(isThemeMaryland && {\n fill: token.color.gold,\n }),\n },\n },\n },\n });\n\n iconSpan.element.innerHTML = iconQuote;\n\n return iconSpan;\n};\n"],"names":["ElementModel.createSpan","iconQuote"],"mappings":";;;;AAYA,MAAA,cAAe,CAAC;AAAA,EACd,WAAW;AAAA,EACX;AAAA,EACA,iBAAiB;AACnB,MAAsB;AACpB,QAAM,0BAA0B,YAAY;AAE5C,QAAM,WAAWA,WAAwB;AAAA,IACvC,WAAW;AAAA,IACX,eAAe;AAAA,MACb,SAAS;AAAA,QACP,SAAS;AAAA,QACT,UAAU;AAAA,QAEV,GAAI,2BAA2B;AAAA,UAC7B,SAAS;AAAA,QAAA;AAAA,QAGX,GAAI,CAAC,YAAY;AAAA,UACf,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,MAAM;AAAA,UACN,KAAK;AAAA,UAEL,CAAC,0BAA0B,KAAK,KAAK,GAAG;AAAA,YACtC,MAAM,IAAI,MAAM,QAAQ,KAAK,CAAC;AAAA,YAC9B,KAAK;AAAA,UAAA;AAAA,QACP;AAAA,QAGF,GAAI,YAAY;AAAA,UACd,QAAQ;AAAA,UACR,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,OAAO;AAAA,UAEP,CAAC,0BAA0B,KAAK,KAAK,GAAG;AAAA,YACtC,QAAQ;AAAA,YACR,OAAO;AAAA,YACP,KAAK;AAAA,YACL,OAAO;AAAA,YACP,MAAM;AAAA,UAAA;AAAA,QACR;AAAA,QAGF,CAAC,OAAO,GAAG;AAAA,UACT,MAAM,MAAM,MAAM;AAAA,UAElB,GAAI,mBAAmB;AAAA,YACrB,MAAM,MAAM,MAAM;AAAA,UAAA;AAAA,QACpB;AAAA,MACF;AAAA,IACF;AAAA,EACF,CACD;AAED,WAAS,QAAQ,YAAYC;AAE7B,SAAO;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../source/composite/quote/elements/image.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAGnB,UAAU,eACR,SAAQ,iBAAiB,EACvB,cAAc,EACd,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC;IACzC,KAAK,EAAE,gBAAgB,CAAC;CACzB;yBAEe,0DAKb,eAAe;;;;;AALlB,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../source/composite/quote/elements/image.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAGnB,UAAU,eACR,SAAQ,iBAAiB,EACvB,cAAc,EACd,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC;IACzC,KAAK,EAAE,gBAAgB,CAAC;CACzB;yBAEe,0DAKb,eAAe;;;;;AALlB,wBA2DE"}
|
|
@@ -27,7 +27,7 @@ const elementImage = ({
|
|
|
27
27
|
isTypeFeatured
|
|
28
28
|
}) => {
|
|
29
29
|
const iconSpan = icon({
|
|
30
|
-
image,
|
|
30
|
+
hasImage: image != null,
|
|
31
31
|
isTypeFeatured,
|
|
32
32
|
isThemeMaryland
|
|
33
33
|
});
|
|
@@ -41,13 +41,13 @@ const elementImage = ({
|
|
|
41
41
|
height: "auto",
|
|
42
42
|
...!isTypeFeatured && {
|
|
43
43
|
maxWidth: "160px",
|
|
44
|
-
...isSizeLarge && { maxWidth: "200px" },
|
|
45
44
|
[`@container (min-width: ${_constants.SMALL}px)`]: {
|
|
46
|
-
borderRight: `2px solid ${token__namespace.color.red}
|
|
47
|
-
...isThemeMaryland && {
|
|
48
|
-
borderRight: `2px solid ${token__namespace.color.gold}`
|
|
49
|
-
}
|
|
45
|
+
borderRight: `2px solid ${token__namespace.color.red}`
|
|
50
46
|
}
|
|
47
|
+
},
|
|
48
|
+
...!isTypeFeatured && isSizeLarge && { maxWidth: "200px" },
|
|
49
|
+
...!isTypeFeatured && isThemeMaryland && {
|
|
50
|
+
borderRight: `2px solid ${token__namespace.color.gold}`
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sources":["../../../../source/composite/quote/elements/image.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { ElementModel } from 'model';\nimport { default as elementIcon } from './icon';\nimport { SMALL } from '../_constants';\nimport {\n type QuoteBaseProps,\n type QuoteVariantProps,\n type QuoteSizeProps,\n} from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteImageProps\n extends QuoteVariantProps,\n QuoteSizeProps,\n Pick<QuoteBaseProps, 'isThemeMaryland'> {\n image: HTMLImageElement;\n}\n\nexport default ({\n image,\n isSizeLarge,\n isThemeMaryland,\n isTypeFeatured,\n}: QuoteImageProps) => {\n const iconSpan = elementIcon({\n image,\n isTypeFeatured,\n isThemeMaryland,\n });\n const imageContainerChildren: ElementVisual[] = [];\n const imageElement = ElementModel.create({\n element: image,\n className: 'quote-image',\n elementStyles: {\n element: {\n maxWidth: '100%',\n height: 'auto',\n\n ...(!isTypeFeatured && {\n maxWidth: '160px',\n\n
|
|
1
|
+
{"version":3,"file":"image.js","sources":["../../../../source/composite/quote/elements/image.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { ElementModel } from 'model';\nimport { default as elementIcon } from './icon';\nimport { SMALL } from '../_constants';\nimport {\n type QuoteBaseProps,\n type QuoteVariantProps,\n type QuoteSizeProps,\n} from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteImageProps\n extends QuoteVariantProps,\n QuoteSizeProps,\n Pick<QuoteBaseProps, 'isThemeMaryland'> {\n image: HTMLImageElement;\n}\n\nexport default ({\n image,\n isSizeLarge,\n isThemeMaryland,\n isTypeFeatured,\n}: QuoteImageProps) => {\n const iconSpan = elementIcon({\n hasImage: image != null,\n isTypeFeatured,\n isThemeMaryland,\n });\n const imageContainerChildren: ElementVisual[] = [];\n const imageElement = ElementModel.create({\n element: image,\n className: 'quote-image',\n elementStyles: {\n element: {\n maxWidth: '100%',\n height: 'auto',\n\n ...(!isTypeFeatured && {\n maxWidth: '160px',\n\n [`@container (min-width: ${SMALL}px)`]: {\n borderRight: `2px solid ${token.color.red}`,\n },\n }),\n\n ...(!isTypeFeatured && isSizeLarge && { maxWidth: '200px' }),\n\n ...(!isTypeFeatured &&\n isThemeMaryland && {\n borderRight: `2px solid ${token.color.gold}`,\n }),\n },\n },\n });\n\n if (!isTypeFeatured) {\n imageContainerChildren.push(iconSpan);\n }\n\n imageContainerChildren.push(imageElement);\n\n return ElementModel.createDiv({\n className: 'quote-image-container',\n children: imageContainerChildren,\n elementStyles: {\n element: {\n display: 'inline-block',\n position: 'relative',\n\n ...(!isTypeFeatured && {\n marginBottom: token.spacing.sm,\n position: 'relative',\n }),\n },\n },\n });\n};\n"],"names":["elementIcon","ElementModel.create","SMALL","token","ElementModel.createDiv"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAA,eAAe,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACrB,QAAM,WAAWA,KAAY;AAAA,IAC3B,UAAU,SAAS;AAAA,IACnB;AAAA,IACA;AAAA,EAAA,CACD;AACD,QAAM,yBAA0C,CAAA;AAChD,QAAM,eAAeC,MAAAA,OAAoB;AAAA,IACvC,SAAS;AAAA,IACT,WAAW;AAAA,IACX,eAAe;AAAA,MACb,SAAS;AAAA,QACP,UAAU;AAAA,QACV,QAAQ;AAAA,QAER,GAAI,CAAC,kBAAkB;AAAA,UACrB,UAAU;AAAA,UAEV,CAAC,0BAA0BC,gBAAK,KAAK,GAAG;AAAA,YACtC,aAAa,aAAaC,iBAAM,MAAM,GAAG;AAAA,UAAA;AAAA,QAC3C;AAAA,QAGF,GAAI,CAAC,kBAAkB,eAAe,EAAE,UAAU,QAAA;AAAA,QAElD,GAAI,CAAC,kBACH,mBAAmB;AAAA,UACjB,aAAa,aAAaA,iBAAM,MAAM,IAAI;AAAA,QAAA;AAAA,MAC5C;AAAA,IACJ;AAAA,EACF,CACD;AAED,MAAI,CAAC,gBAAgB;AACnB,2BAAuB,KAAK,QAAQ;AAAA,EACtC;AAEA,yBAAuB,KAAK,YAAY;AAExC,SAAOC,gBAAuB;AAAA,IAC5B,WAAW;AAAA,IACX,UAAU;AAAA,IACV,eAAe;AAAA,MACb,SAAS;AAAA,QACP,SAAS;AAAA,QACT,UAAU;AAAA,QAEV,GAAI,CAAC,kBAAkB;AAAA,UACrB,cAAcD,iBAAM,QAAQ;AAAA,UAC5B,UAAU;AAAA,QAAA;AAAA,MACZ;AAAA,IACF;AAAA,EACF,CACD;AACH;;"}
|
|
@@ -9,7 +9,7 @@ const elementImage = ({
|
|
|
9
9
|
isTypeFeatured
|
|
10
10
|
}) => {
|
|
11
11
|
const iconSpan = elementIcon({
|
|
12
|
-
image,
|
|
12
|
+
hasImage: image != null,
|
|
13
13
|
isTypeFeatured,
|
|
14
14
|
isThemeMaryland
|
|
15
15
|
});
|
|
@@ -23,13 +23,13 @@ const elementImage = ({
|
|
|
23
23
|
height: "auto",
|
|
24
24
|
...!isTypeFeatured && {
|
|
25
25
|
maxWidth: "160px",
|
|
26
|
-
...isSizeLarge && { maxWidth: "200px" },
|
|
27
26
|
[`@container (min-width: ${SMALL}px)`]: {
|
|
28
|
-
borderRight: `2px solid ${token.color.red}
|
|
29
|
-
...isThemeMaryland && {
|
|
30
|
-
borderRight: `2px solid ${token.color.gold}`
|
|
31
|
-
}
|
|
27
|
+
borderRight: `2px solid ${token.color.red}`
|
|
32
28
|
}
|
|
29
|
+
},
|
|
30
|
+
...!isTypeFeatured && isSizeLarge && { maxWidth: "200px" },
|
|
31
|
+
...!isTypeFeatured && isThemeMaryland && {
|
|
32
|
+
borderRight: `2px solid ${token.color.gold}`
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.mjs","sources":["../../../../source/composite/quote/elements/image.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { ElementModel } from 'model';\nimport { default as elementIcon } from './icon';\nimport { SMALL } from '../_constants';\nimport {\n type QuoteBaseProps,\n type QuoteVariantProps,\n type QuoteSizeProps,\n} from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteImageProps\n extends QuoteVariantProps,\n QuoteSizeProps,\n Pick<QuoteBaseProps, 'isThemeMaryland'> {\n image: HTMLImageElement;\n}\n\nexport default ({\n image,\n isSizeLarge,\n isThemeMaryland,\n isTypeFeatured,\n}: QuoteImageProps) => {\n const iconSpan = elementIcon({\n image,\n isTypeFeatured,\n isThemeMaryland,\n });\n const imageContainerChildren: ElementVisual[] = [];\n const imageElement = ElementModel.create({\n element: image,\n className: 'quote-image',\n elementStyles: {\n element: {\n maxWidth: '100%',\n height: 'auto',\n\n ...(!isTypeFeatured && {\n maxWidth: '160px',\n\n
|
|
1
|
+
{"version":3,"file":"image.mjs","sources":["../../../../source/composite/quote/elements/image.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { ElementModel } from 'model';\nimport { default as elementIcon } from './icon';\nimport { SMALL } from '../_constants';\nimport {\n type QuoteBaseProps,\n type QuoteVariantProps,\n type QuoteSizeProps,\n} from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteImageProps\n extends QuoteVariantProps,\n QuoteSizeProps,\n Pick<QuoteBaseProps, 'isThemeMaryland'> {\n image: HTMLImageElement;\n}\n\nexport default ({\n image,\n isSizeLarge,\n isThemeMaryland,\n isTypeFeatured,\n}: QuoteImageProps) => {\n const iconSpan = elementIcon({\n hasImage: image != null,\n isTypeFeatured,\n isThemeMaryland,\n });\n const imageContainerChildren: ElementVisual[] = [];\n const imageElement = ElementModel.create({\n element: image,\n className: 'quote-image',\n elementStyles: {\n element: {\n maxWidth: '100%',\n height: 'auto',\n\n ...(!isTypeFeatured && {\n maxWidth: '160px',\n\n [`@container (min-width: ${SMALL}px)`]: {\n borderRight: `2px solid ${token.color.red}`,\n },\n }),\n\n ...(!isTypeFeatured && isSizeLarge && { maxWidth: '200px' }),\n\n ...(!isTypeFeatured &&\n isThemeMaryland && {\n borderRight: `2px solid ${token.color.gold}`,\n }),\n },\n },\n });\n\n if (!isTypeFeatured) {\n imageContainerChildren.push(iconSpan);\n }\n\n imageContainerChildren.push(imageElement);\n\n return ElementModel.createDiv({\n className: 'quote-image-container',\n children: imageContainerChildren,\n elementStyles: {\n element: {\n display: 'inline-block',\n position: 'relative',\n\n ...(!isTypeFeatured && {\n marginBottom: token.spacing.sm,\n position: 'relative',\n }),\n },\n },\n });\n};\n"],"names":["ElementModel.create","ElementModel.createDiv"],"mappings":";;;;AAkBA,MAAA,eAAe,CAAC;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACrB,QAAM,WAAW,YAAY;AAAA,IAC3B,UAAU,SAAS;AAAA,IACnB;AAAA,IACA;AAAA,EAAA,CACD;AACD,QAAM,yBAA0C,CAAA;AAChD,QAAM,eAAeA,OAAoB;AAAA,IACvC,SAAS;AAAA,IACT,WAAW;AAAA,IACX,eAAe;AAAA,MACb,SAAS;AAAA,QACP,UAAU;AAAA,QACV,QAAQ;AAAA,QAER,GAAI,CAAC,kBAAkB;AAAA,UACrB,UAAU;AAAA,UAEV,CAAC,0BAA0B,KAAK,KAAK,GAAG;AAAA,YACtC,aAAa,aAAa,MAAM,MAAM,GAAG;AAAA,UAAA;AAAA,QAC3C;AAAA,QAGF,GAAI,CAAC,kBAAkB,eAAe,EAAE,UAAU,QAAA;AAAA,QAElD,GAAI,CAAC,kBACH,mBAAmB;AAAA,UACjB,aAAa,aAAa,MAAM,MAAM,IAAI;AAAA,QAAA;AAAA,MAC5C;AAAA,IACJ;AAAA,EACF,CACD;AAED,MAAI,CAAC,gBAAgB;AACnB,2BAAuB,KAAK,QAAQ;AAAA,EACtC;AAEA,yBAAuB,KAAK,YAAY;AAExC,SAAOC,UAAuB;AAAA,IAC5B,WAAW;AAAA,IACX,UAAU;AAAA,IACV,eAAe;AAAA,MACb,SAAS;AAAA,QACP,SAAS;AAAA,QACT,UAAU;AAAA,QAEV,GAAI,CAAC,kBAAkB;AAAA,UACrB,cAAc,MAAM,QAAQ;AAAA,UAC5B,UAAU;AAAA,QAAA;AAAA,MACZ;AAAA,IACF;AAAA,EACF,CACD;AACH;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../source/composite/quote/elements/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../source/composite/quote/elements/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -4,8 +4,10 @@ const image = require("./image.js");
|
|
|
4
4
|
const text = require("./text.js");
|
|
5
5
|
const icon = require("./icon.js");
|
|
6
6
|
const action = require("./action.js");
|
|
7
|
+
const quote = require("./quote.js");
|
|
7
8
|
exports.image = image;
|
|
8
9
|
exports.text = text;
|
|
9
10
|
exports.icon = icon;
|
|
10
11
|
exports.action = action;
|
|
12
|
+
exports.quote = quote;
|
|
11
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -2,10 +2,12 @@ import { default as default2 } from "./image.mjs";
|
|
|
2
2
|
import { default as default3 } from "./text.mjs";
|
|
3
3
|
import { default as default4 } from "./icon.mjs";
|
|
4
4
|
import { default as default5 } from "./action.mjs";
|
|
5
|
+
import { default as default6 } from "./quote.mjs";
|
|
5
6
|
export {
|
|
6
7
|
default5 as action,
|
|
7
8
|
default4 as icon,
|
|
8
9
|
default2 as image,
|
|
10
|
+
default6 as quote,
|
|
9
11
|
default3 as text
|
|
10
12
|
};
|
|
11
13
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { QuoteTextProps } from '../_types';
|
|
2
|
+
interface QuoteProps extends Pick<QuoteTextProps, 'quote' | 'isThemeMaryland' | 'isSizeLarge' | 'isTypeFeatured' | 'includesAnimation'> {
|
|
3
|
+
hasImage?: boolean;
|
|
4
|
+
shouldHaveWhiteText?: boolean;
|
|
5
|
+
quote: HTMLElement;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: (props: QuoteProps) => {
|
|
8
|
+
element: HTMLElement;
|
|
9
|
+
className: string;
|
|
10
|
+
styles: string;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=quote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../../source/composite/quote/elements/quote.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAGhD,UAAU,UACR,SAAQ,IAAI,CACV,cAAc,EACZ,OAAO,GACP,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,mBAAmB,CACtB;IACD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,EAAE,WAAW,CAAC;CACpB;yBA0Be,OAAO,UAAU;;;;;AAAjC,wBAkFE"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const token = require("@universityofmaryland/web-styles-library/token");
|
|
3
|
+
const typography = require("@universityofmaryland/web-styles-library/typography");
|
|
4
|
+
const index = require("../../../model/elements/index.js");
|
|
5
|
+
const icon = require("./icon.js");
|
|
6
|
+
const _constants = require("../_constants.js");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const token__namespace = /* @__PURE__ */ _interopNamespaceDefault(token);
|
|
24
|
+
const typography__namespace = /* @__PURE__ */ _interopNamespaceDefault(typography);
|
|
25
|
+
const splitWords = (quote) => {
|
|
26
|
+
const text = quote.textContent ?? "";
|
|
27
|
+
const words = text.trim().split(/\s+/);
|
|
28
|
+
const wordElements = words.map((word, index2) => {
|
|
29
|
+
const wordElement = document.createElement("div");
|
|
30
|
+
wordElement.classList.add("quote-text-split-word");
|
|
31
|
+
Object.assign(wordElement.style, {
|
|
32
|
+
display: "inline-block",
|
|
33
|
+
whiteSpace: "pre-wrap",
|
|
34
|
+
opacity: "0",
|
|
35
|
+
transform: "translateY(20px)",
|
|
36
|
+
transition: "opacity 1s ease, transform 0.5s ease"
|
|
37
|
+
});
|
|
38
|
+
wordElement.textContent = word + (index2 < words.length - 1 ? " " : "");
|
|
39
|
+
return wordElement;
|
|
40
|
+
});
|
|
41
|
+
return wordElements;
|
|
42
|
+
};
|
|
43
|
+
const elementQuote = (props) => {
|
|
44
|
+
const {
|
|
45
|
+
hasImage = false,
|
|
46
|
+
includesAnimation = false,
|
|
47
|
+
isSizeLarge = false,
|
|
48
|
+
isThemeMaryland = false,
|
|
49
|
+
isTypeFeatured = false,
|
|
50
|
+
quote,
|
|
51
|
+
shouldHaveWhiteText = false
|
|
52
|
+
} = props;
|
|
53
|
+
const children = [];
|
|
54
|
+
const isHasImageAndNotFeatured = hasImage && !isTypeFeatured;
|
|
55
|
+
const iconSpan = icon(props);
|
|
56
|
+
const wordsList = splitWords(quote);
|
|
57
|
+
let quoteTextElement = quote;
|
|
58
|
+
if (!hasImage) {
|
|
59
|
+
children.push(iconSpan);
|
|
60
|
+
}
|
|
61
|
+
if (includesAnimation) {
|
|
62
|
+
quoteTextElement = document.createElement("div");
|
|
63
|
+
wordsList.map((word) => {
|
|
64
|
+
quoteTextElement.appendChild(word);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const quoteElement = index.create({
|
|
68
|
+
element: quoteTextElement,
|
|
69
|
+
className: "quote-container-quote",
|
|
70
|
+
children,
|
|
71
|
+
elementStyles: {
|
|
72
|
+
element: {
|
|
73
|
+
position: "relative",
|
|
74
|
+
fontWeight: "700",
|
|
75
|
+
color: token__namespace.color.black,
|
|
76
|
+
...typography__namespace.sans.larger,
|
|
77
|
+
...isSizeLarge && { ...typography__namespace.sans.extraLarge },
|
|
78
|
+
...shouldHaveWhiteText && {
|
|
79
|
+
color: token__namespace.color.white
|
|
80
|
+
},
|
|
81
|
+
[`&::before`]: {
|
|
82
|
+
content: '""',
|
|
83
|
+
position: "absolute",
|
|
84
|
+
left: `-${token__namespace.spacing.md}`,
|
|
85
|
+
top: "7px",
|
|
86
|
+
height: "calc(100% - 14px)",
|
|
87
|
+
width: "2px",
|
|
88
|
+
display: "block",
|
|
89
|
+
backgroundColor: token__namespace.color.red,
|
|
90
|
+
...isThemeMaryland && { backgroundColor: token__namespace.color.gold },
|
|
91
|
+
...isHasImageAndNotFeatured && {
|
|
92
|
+
display: "none"
|
|
93
|
+
},
|
|
94
|
+
[`@container (min-width: ${_constants.SMALL}px)`]: {
|
|
95
|
+
left: `-${token__namespace.spacing.md}`
|
|
96
|
+
},
|
|
97
|
+
[`@container (max-width: ${_constants.SMALL - 1}px)`]: {
|
|
98
|
+
...!isTypeFeatured && {
|
|
99
|
+
display: "block"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
["& *"]: {
|
|
104
|
+
color: "currentColor",
|
|
105
|
+
...!isSizeLarge && { ...typography__namespace.sans.larger },
|
|
106
|
+
...isSizeLarge && { ...typography__namespace.sans.extraLarge }
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return quoteElement;
|
|
112
|
+
};
|
|
113
|
+
module.exports = elementQuote;
|
|
114
|
+
//# sourceMappingURL=quote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.js","sources":["../../../../source/composite/quote/elements/quote.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport * as typography from '@universityofmaryland/web-styles-library/typography';\nimport { ElementModel } from 'model';\nimport { default as elementIcon } from './icon';\nimport { SMALL } from '../_constants';\nimport { type QuoteTextProps } from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteProps\n extends Pick<\n QuoteTextProps,\n | 'quote'\n | 'isThemeMaryland'\n | 'isSizeLarge'\n | 'isTypeFeatured'\n | 'includesAnimation'\n > {\n hasImage?: boolean;\n shouldHaveWhiteText?: boolean;\n quote: HTMLElement;\n}\n\nconst splitWords = (quote: HTMLElement) => {\n const text = quote.textContent ?? '';\n const words = text.trim().split(/\\s+/);\n\n const wordElements = words.map((word, index) => {\n const wordElement = document.createElement('div');\n wordElement.classList.add('quote-text-split-word');\n\n Object.assign(wordElement.style, {\n display: 'inline-block',\n whiteSpace: 'pre-wrap',\n opacity: '0',\n transform: 'translateY(20px)',\n transition: 'opacity 1s ease, transform 0.5s ease',\n });\n\n wordElement.textContent = word + (index < words.length - 1 ? ' ' : '');\n\n return wordElement;\n });\n\n return wordElements;\n};\n\nexport default (props: QuoteProps) => {\n const {\n hasImage = false,\n includesAnimation = false,\n isSizeLarge = false,\n isThemeMaryland = false,\n isTypeFeatured = false,\n quote,\n shouldHaveWhiteText = false,\n } = props;\n\n const children: ElementVisual[] = [];\n const isHasImageAndNotFeatured = hasImage && !isTypeFeatured;\n const iconSpan = elementIcon(props);\n const wordsList = splitWords(quote);\n let quoteTextElement: HTMLElement = quote;\n\n if (!hasImage) {\n children.push(iconSpan);\n }\n\n if (includesAnimation) {\n quoteTextElement = document.createElement('div');\n\n wordsList.map((word) => {\n quoteTextElement.appendChild(word);\n });\n }\n\n const quoteElement = ElementModel.create({\n element: quoteTextElement,\n className: 'quote-container-quote',\n children,\n elementStyles: {\n element: {\n position: 'relative',\n fontWeight: '700',\n color: token.color.black,\n ...typography.sans.larger,\n\n ...(isSizeLarge && { ...typography.sans.extraLarge }),\n\n ...(shouldHaveWhiteText && {\n color: token.color.white,\n }),\n\n [`&::before`]: {\n content: '\"\"',\n position: 'absolute',\n left: `-${token.spacing.md}`,\n top: '7px',\n height: 'calc(100% - 14px)',\n width: '2px',\n display: 'block',\n backgroundColor: token.color.red,\n ...(isThemeMaryland && { backgroundColor: token.color.gold }),\n\n ...(isHasImageAndNotFeatured && {\n display: 'none',\n }),\n\n [`@container (min-width: ${SMALL}px)`]: {\n left: `-${token.spacing.md}`,\n },\n\n [`@container (max-width: ${SMALL - 1}px)`]: {\n ...(!isTypeFeatured && {\n display: 'block',\n }),\n },\n },\n\n ['& *']: {\n color: 'currentColor',\n ...(!isSizeLarge && { ...typography.sans.larger }),\n ...(isSizeLarge && { ...typography.sans.extraLarge }),\n },\n },\n },\n });\n\n return quoteElement;\n};\n"],"names":["index","elementIcon","ElementModel.create","token","typography","SMALL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,aAAa,CAAC,UAAuB;AACzC,QAAM,OAAO,MAAM,eAAe;AAClC,QAAM,QAAQ,KAAK,KAAA,EAAO,MAAM,KAAK;AAErC,QAAM,eAAe,MAAM,IAAI,CAAC,MAAMA,WAAU;AAC9C,UAAM,cAAc,SAAS,cAAc,KAAK;AAChD,gBAAY,UAAU,IAAI,uBAAuB;AAEjD,WAAO,OAAO,YAAY,OAAO;AAAA,MAC/B,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,WAAW;AAAA,MACX,YAAY;AAAA,IAAA,CACb;AAED,gBAAY,cAAc,QAAQA,SAAQ,MAAM,SAAS,IAAI,MAAM;AAEnE,WAAO;AAAA,EACT,CAAC;AAED,SAAO;AACT;AAEA,MAAA,eAAe,CAAC,UAAsB;AACpC,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB;AAAA,IACA,sBAAsB;AAAA,EAAA,IACpB;AAEJ,QAAM,WAA4B,CAAA;AAClC,QAAM,2BAA2B,YAAY,CAAC;AAC9C,QAAM,WAAWC,KAAY,KAAK;AAClC,QAAM,YAAY,WAAW,KAAK;AAClC,MAAI,mBAAgC;AAEpC,MAAI,CAAC,UAAU;AACb,aAAS,KAAK,QAAQ;AAAA,EACxB;AAEA,MAAI,mBAAmB;AACrB,uBAAmB,SAAS,cAAc,KAAK;AAE/C,cAAU,IAAI,CAAC,SAAS;AACtB,uBAAiB,YAAY,IAAI;AAAA,IACnC,CAAC;AAAA,EACH;AAEA,QAAM,eAAeC,MAAAA,OAAoB;AAAA,IACvC,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA,eAAe;AAAA,MACb,SAAS;AAAA,QACP,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,OAAOC,iBAAM,MAAM;AAAA,QACnB,GAAGC,sBAAW,KAAK;AAAA,QAEnB,GAAI,eAAe,EAAE,GAAGA,sBAAW,KAAK,WAAA;AAAA,QAExC,GAAI,uBAAuB;AAAA,UACzB,OAAOD,iBAAM,MAAM;AAAA,QAAA;AAAA,QAGrB,CAAC,WAAW,GAAG;AAAA,UACb,SAAS;AAAA,UACT,UAAU;AAAA,UACV,MAAM,IAAIA,iBAAM,QAAQ,EAAE;AAAA,UAC1B,KAAK;AAAA,UACL,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,SAAS;AAAA,UACT,iBAAiBA,iBAAM,MAAM;AAAA,UAC7B,GAAI,mBAAmB,EAAE,iBAAiBA,iBAAM,MAAM,KAAA;AAAA,UAEtD,GAAI,4BAA4B;AAAA,YAC9B,SAAS;AAAA,UAAA;AAAA,UAGX,CAAC,0BAA0BE,gBAAK,KAAK,GAAG;AAAA,YACtC,MAAM,IAAIF,iBAAM,QAAQ,EAAE;AAAA,UAAA;AAAA,UAG5B,CAAC,0BAA0BE,WAAAA,QAAQ,CAAC,KAAK,GAAG;AAAA,YAC1C,GAAI,CAAC,kBAAkB;AAAA,cACrB,SAAS;AAAA,YAAA;AAAA,UACX;AAAA,QACF;AAAA,QAGF,CAAC,KAAK,GAAG;AAAA,UACP,OAAO;AAAA,UACP,GAAI,CAAC,eAAe,EAAE,GAAGD,sBAAW,KAAK,OAAA;AAAA,UACzC,GAAI,eAAe,EAAE,GAAGA,sBAAW,KAAK,WAAA;AAAA,QAAW;AAAA,MACrD;AAAA,IACF;AAAA,EACF,CACD;AAED,SAAO;AACT;;"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as token from "@universityofmaryland/web-styles-library/token";
|
|
2
|
+
import * as typography from "@universityofmaryland/web-styles-library/typography";
|
|
3
|
+
import { create } from "../../../model/elements/index.mjs";
|
|
4
|
+
import elementIcon from "./icon.mjs";
|
|
5
|
+
import { SMALL } from "../_constants.mjs";
|
|
6
|
+
const splitWords = (quote) => {
|
|
7
|
+
const text = quote.textContent ?? "";
|
|
8
|
+
const words = text.trim().split(/\s+/);
|
|
9
|
+
const wordElements = words.map((word, index) => {
|
|
10
|
+
const wordElement = document.createElement("div");
|
|
11
|
+
wordElement.classList.add("quote-text-split-word");
|
|
12
|
+
Object.assign(wordElement.style, {
|
|
13
|
+
display: "inline-block",
|
|
14
|
+
whiteSpace: "pre-wrap",
|
|
15
|
+
opacity: "0",
|
|
16
|
+
transform: "translateY(20px)",
|
|
17
|
+
transition: "opacity 1s ease, transform 0.5s ease"
|
|
18
|
+
});
|
|
19
|
+
wordElement.textContent = word + (index < words.length - 1 ? " " : "");
|
|
20
|
+
return wordElement;
|
|
21
|
+
});
|
|
22
|
+
return wordElements;
|
|
23
|
+
};
|
|
24
|
+
const elementQuote = (props) => {
|
|
25
|
+
const {
|
|
26
|
+
hasImage = false,
|
|
27
|
+
includesAnimation = false,
|
|
28
|
+
isSizeLarge = false,
|
|
29
|
+
isThemeMaryland = false,
|
|
30
|
+
isTypeFeatured = false,
|
|
31
|
+
quote,
|
|
32
|
+
shouldHaveWhiteText = false
|
|
33
|
+
} = props;
|
|
34
|
+
const children = [];
|
|
35
|
+
const isHasImageAndNotFeatured = hasImage && !isTypeFeatured;
|
|
36
|
+
const iconSpan = elementIcon(props);
|
|
37
|
+
const wordsList = splitWords(quote);
|
|
38
|
+
let quoteTextElement = quote;
|
|
39
|
+
if (!hasImage) {
|
|
40
|
+
children.push(iconSpan);
|
|
41
|
+
}
|
|
42
|
+
if (includesAnimation) {
|
|
43
|
+
quoteTextElement = document.createElement("div");
|
|
44
|
+
wordsList.map((word) => {
|
|
45
|
+
quoteTextElement.appendChild(word);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const quoteElement = create({
|
|
49
|
+
element: quoteTextElement,
|
|
50
|
+
className: "quote-container-quote",
|
|
51
|
+
children,
|
|
52
|
+
elementStyles: {
|
|
53
|
+
element: {
|
|
54
|
+
position: "relative",
|
|
55
|
+
fontWeight: "700",
|
|
56
|
+
color: token.color.black,
|
|
57
|
+
...typography.sans.larger,
|
|
58
|
+
...isSizeLarge && { ...typography.sans.extraLarge },
|
|
59
|
+
...shouldHaveWhiteText && {
|
|
60
|
+
color: token.color.white
|
|
61
|
+
},
|
|
62
|
+
[`&::before`]: {
|
|
63
|
+
content: '""',
|
|
64
|
+
position: "absolute",
|
|
65
|
+
left: `-${token.spacing.md}`,
|
|
66
|
+
top: "7px",
|
|
67
|
+
height: "calc(100% - 14px)",
|
|
68
|
+
width: "2px",
|
|
69
|
+
display: "block",
|
|
70
|
+
backgroundColor: token.color.red,
|
|
71
|
+
...isThemeMaryland && { backgroundColor: token.color.gold },
|
|
72
|
+
...isHasImageAndNotFeatured && {
|
|
73
|
+
display: "none"
|
|
74
|
+
},
|
|
75
|
+
[`@container (min-width: ${SMALL}px)`]: {
|
|
76
|
+
left: `-${token.spacing.md}`
|
|
77
|
+
},
|
|
78
|
+
[`@container (max-width: ${SMALL - 1}px)`]: {
|
|
79
|
+
...!isTypeFeatured && {
|
|
80
|
+
display: "block"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
["& *"]: {
|
|
85
|
+
color: "currentColor",
|
|
86
|
+
...!isSizeLarge && { ...typography.sans.larger },
|
|
87
|
+
...isSizeLarge && { ...typography.sans.extraLarge }
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return quoteElement;
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
elementQuote as default
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=quote.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.mjs","sources":["../../../../source/composite/quote/elements/quote.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport * as typography from '@universityofmaryland/web-styles-library/typography';\nimport { ElementModel } from 'model';\nimport { default as elementIcon } from './icon';\nimport { SMALL } from '../_constants';\nimport { type QuoteTextProps } from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteProps\n extends Pick<\n QuoteTextProps,\n | 'quote'\n | 'isThemeMaryland'\n | 'isSizeLarge'\n | 'isTypeFeatured'\n | 'includesAnimation'\n > {\n hasImage?: boolean;\n shouldHaveWhiteText?: boolean;\n quote: HTMLElement;\n}\n\nconst splitWords = (quote: HTMLElement) => {\n const text = quote.textContent ?? '';\n const words = text.trim().split(/\\s+/);\n\n const wordElements = words.map((word, index) => {\n const wordElement = document.createElement('div');\n wordElement.classList.add('quote-text-split-word');\n\n Object.assign(wordElement.style, {\n display: 'inline-block',\n whiteSpace: 'pre-wrap',\n opacity: '0',\n transform: 'translateY(20px)',\n transition: 'opacity 1s ease, transform 0.5s ease',\n });\n\n wordElement.textContent = word + (index < words.length - 1 ? ' ' : '');\n\n return wordElement;\n });\n\n return wordElements;\n};\n\nexport default (props: QuoteProps) => {\n const {\n hasImage = false,\n includesAnimation = false,\n isSizeLarge = false,\n isThemeMaryland = false,\n isTypeFeatured = false,\n quote,\n shouldHaveWhiteText = false,\n } = props;\n\n const children: ElementVisual[] = [];\n const isHasImageAndNotFeatured = hasImage && !isTypeFeatured;\n const iconSpan = elementIcon(props);\n const wordsList = splitWords(quote);\n let quoteTextElement: HTMLElement = quote;\n\n if (!hasImage) {\n children.push(iconSpan);\n }\n\n if (includesAnimation) {\n quoteTextElement = document.createElement('div');\n\n wordsList.map((word) => {\n quoteTextElement.appendChild(word);\n });\n }\n\n const quoteElement = ElementModel.create({\n element: quoteTextElement,\n className: 'quote-container-quote',\n children,\n elementStyles: {\n element: {\n position: 'relative',\n fontWeight: '700',\n color: token.color.black,\n ...typography.sans.larger,\n\n ...(isSizeLarge && { ...typography.sans.extraLarge }),\n\n ...(shouldHaveWhiteText && {\n color: token.color.white,\n }),\n\n [`&::before`]: {\n content: '\"\"',\n position: 'absolute',\n left: `-${token.spacing.md}`,\n top: '7px',\n height: 'calc(100% - 14px)',\n width: '2px',\n display: 'block',\n backgroundColor: token.color.red,\n ...(isThemeMaryland && { backgroundColor: token.color.gold }),\n\n ...(isHasImageAndNotFeatured && {\n display: 'none',\n }),\n\n [`@container (min-width: ${SMALL}px)`]: {\n left: `-${token.spacing.md}`,\n },\n\n [`@container (max-width: ${SMALL - 1}px)`]: {\n ...(!isTypeFeatured && {\n display: 'block',\n }),\n },\n },\n\n ['& *']: {\n color: 'currentColor',\n ...(!isSizeLarge && { ...typography.sans.larger }),\n ...(isSizeLarge && { ...typography.sans.extraLarge }),\n },\n },\n },\n });\n\n return quoteElement;\n};\n"],"names":["ElementModel.create"],"mappings":";;;;;AAsBA,MAAM,aAAa,CAAC,UAAuB;AACzC,QAAM,OAAO,MAAM,eAAe;AAClC,QAAM,QAAQ,KAAK,KAAA,EAAO,MAAM,KAAK;AAErC,QAAM,eAAe,MAAM,IAAI,CAAC,MAAM,UAAU;AAC9C,UAAM,cAAc,SAAS,cAAc,KAAK;AAChD,gBAAY,UAAU,IAAI,uBAAuB;AAEjD,WAAO,OAAO,YAAY,OAAO;AAAA,MAC/B,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,WAAW;AAAA,MACX,YAAY;AAAA,IAAA,CACb;AAED,gBAAY,cAAc,QAAQ,QAAQ,MAAM,SAAS,IAAI,MAAM;AAEnE,WAAO;AAAA,EACT,CAAC;AAED,SAAO;AACT;AAEA,MAAA,eAAe,CAAC,UAAsB;AACpC,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,oBAAoB;AAAA,IACpB,cAAc;AAAA,IACd,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB;AAAA,IACA,sBAAsB;AAAA,EAAA,IACpB;AAEJ,QAAM,WAA4B,CAAA;AAClC,QAAM,2BAA2B,YAAY,CAAC;AAC9C,QAAM,WAAW,YAAY,KAAK;AAClC,QAAM,YAAY,WAAW,KAAK;AAClC,MAAI,mBAAgC;AAEpC,MAAI,CAAC,UAAU;AACb,aAAS,KAAK,QAAQ;AAAA,EACxB;AAEA,MAAI,mBAAmB;AACrB,uBAAmB,SAAS,cAAc,KAAK;AAE/C,cAAU,IAAI,CAAC,SAAS;AACtB,uBAAiB,YAAY,IAAI;AAAA,IACnC,CAAC;AAAA,EACH;AAEA,QAAM,eAAeA,OAAoB;AAAA,IACvC,SAAS;AAAA,IACT,WAAW;AAAA,IACX;AAAA,IACA,eAAe;AAAA,MACb,SAAS;AAAA,QACP,UAAU;AAAA,QACV,YAAY;AAAA,QACZ,OAAO,MAAM,MAAM;AAAA,QACnB,GAAG,WAAW,KAAK;AAAA,QAEnB,GAAI,eAAe,EAAE,GAAG,WAAW,KAAK,WAAA;AAAA,QAExC,GAAI,uBAAuB;AAAA,UACzB,OAAO,MAAM,MAAM;AAAA,QAAA;AAAA,QAGrB,CAAC,WAAW,GAAG;AAAA,UACb,SAAS;AAAA,UACT,UAAU;AAAA,UACV,MAAM,IAAI,MAAM,QAAQ,EAAE;AAAA,UAC1B,KAAK;AAAA,UACL,QAAQ;AAAA,UACR,OAAO;AAAA,UACP,SAAS;AAAA,UACT,iBAAiB,MAAM,MAAM;AAAA,UAC7B,GAAI,mBAAmB,EAAE,iBAAiB,MAAM,MAAM,KAAA;AAAA,UAEtD,GAAI,4BAA4B;AAAA,YAC9B,SAAS;AAAA,UAAA;AAAA,UAGX,CAAC,0BAA0B,KAAK,KAAK,GAAG;AAAA,YACtC,MAAM,IAAI,MAAM,QAAQ,EAAE;AAAA,UAAA;AAAA,UAG5B,CAAC,0BAA0B,QAAQ,CAAC,KAAK,GAAG;AAAA,YAC1C,GAAI,CAAC,kBAAkB;AAAA,cACrB,SAAS;AAAA,YAAA;AAAA,UACX;AAAA,QACF;AAAA,QAGF,CAAC,KAAK,GAAG;AAAA,UACP,OAAO;AAAA,UACP,GAAI,CAAC,eAAe,EAAE,GAAG,WAAW,KAAK,OAAA;AAAA,UACzC,GAAI,eAAe,EAAE,GAAG,WAAW,KAAK,WAAA;AAAA,QAAW;AAAA,MACrD;AAAA,IACF;AAAA,EACF,CACD;AAED,SAAO;AACT;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QuoteTextProps } from '../_types';
|
|
2
|
-
declare const _default: (props: QuoteTextProps) => {
|
|
2
|
+
declare const _default: (props: Pick<QuoteTextProps, "isThemeDark" | "isThemeMaryland" | "isSizeLarge" | "isTypeFeatured" | "image" | "quote" | "attribution" | "attributionSubText" | "action" | "includesAnimation">) => {
|
|
3
3
|
element: HTMLElement;
|
|
4
4
|
className: string;
|
|
5
5
|
styles: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../source/composite/quote/elements/text.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../source/composite/quote/elements/text.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;yBA2G9C,OAAO,IAAI,CACT,cAAc,EACZ,aAAa,GACb,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,OAAO,GACP,OAAO,GACP,aAAa,GACb,oBAAoB,GACpB,QAAQ,GACR,mBAAmB,CACtB;;;;;AAbH,wBA0EE"}
|