@universityofmaryland/web-elements-library 1.5.0-beta.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/dist/composite/banner/promo.d.ts.map +1 -1
  3. package/dist/composite/banner/promo.js +6 -3
  4. package/dist/composite/banner/promo.js.map +1 -1
  5. package/dist/composite/banner/promo.mjs +6 -3
  6. package/dist/composite/banner/promo.mjs.map +1 -1
  7. package/dist/composite/quote/elements/icon.d.ts +3 -2
  8. package/dist/composite/quote/elements/icon.d.ts.map +1 -1
  9. package/dist/composite/quote/elements/icon.js +23 -16
  10. package/dist/composite/quote/elements/icon.js.map +1 -1
  11. package/dist/composite/quote/elements/icon.mjs +23 -16
  12. package/dist/composite/quote/elements/icon.mjs.map +1 -1
  13. package/dist/composite/quote/elements/image.d.ts.map +1 -1
  14. package/dist/composite/quote/elements/image.js +6 -6
  15. package/dist/composite/quote/elements/image.js.map +1 -1
  16. package/dist/composite/quote/elements/image.mjs +6 -6
  17. package/dist/composite/quote/elements/image.mjs.map +1 -1
  18. package/dist/composite/quote/elements/index.d.ts +1 -0
  19. package/dist/composite/quote/elements/index.d.ts.map +1 -1
  20. package/dist/composite/quote/elements/index.js +2 -0
  21. package/dist/composite/quote/elements/index.js.map +1 -1
  22. package/dist/composite/quote/elements/index.mjs +2 -0
  23. package/dist/composite/quote/elements/index.mjs.map +1 -1
  24. package/dist/composite/quote/elements/quote.d.ts +13 -0
  25. package/dist/composite/quote/elements/quote.d.ts.map +1 -0
  26. package/dist/composite/quote/elements/quote.js +114 -0
  27. package/dist/composite/quote/elements/quote.js.map +1 -0
  28. package/dist/composite/quote/elements/quote.mjs +97 -0
  29. package/dist/composite/quote/elements/quote.mjs.map +1 -0
  30. package/dist/composite/quote/elements/text.d.ts +1 -1
  31. package/dist/composite/quote/elements/text.d.ts.map +1 -1
  32. package/dist/composite/quote/elements/text.js +103 -172
  33. package/dist/composite/quote/elements/text.js.map +1 -1
  34. package/dist/composite/quote/elements/text.mjs +103 -172
  35. package/dist/composite/quote/elements/text.mjs.map +1 -1
  36. package/dist/composite/quote/featured.d.ts +3 -0
  37. package/dist/composite/quote/featured.d.ts.map +1 -1
  38. package/dist/composite/quote/featured.js +14 -7
  39. package/dist/composite/quote/featured.js.map +1 -1
  40. package/dist/composite/quote/featured.mjs +14 -7
  41. package/dist/composite/quote/featured.mjs.map +1 -1
  42. package/dist/composite/quote/helper/animation.d.ts.map +1 -1
  43. package/dist/composite/quote/helper/animation.js +67 -36
  44. package/dist/composite/quote/helper/animation.js.map +1 -1
  45. package/dist/composite/quote/helper/animation.mjs +67 -36
  46. package/dist/composite/quote/helper/animation.mjs.map +1 -1
  47. package/dist/composite/quote/inline.d.ts +3 -0
  48. package/dist/composite/quote/inline.d.ts.map +1 -1
  49. package/dist/composite/quote/inline.js +15 -7
  50. package/dist/composite/quote/inline.js.map +1 -1
  51. package/dist/composite/quote/inline.mjs +15 -7
  52. package/dist/composite/quote/inline.mjs.map +1 -1
  53. package/package.json +1 -1
@@ -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;AAC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ACT,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;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,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;yBAGhC,OAAO,cAAc;;;;;AAArC,wBAkPE"}
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"}
@@ -2,8 +2,8 @@
2
2
  const token = require("@universityofmaryland/web-styles-library/token");
3
3
  const typography = require("@universityofmaryland/web-styles-library/typography");
4
4
  const index = require("../../../model/elements/index.js");
5
- const icon = require("./icon.js");
6
5
  const action = require("./action.js");
6
+ const quote = require("./quote.js");
7
7
  const _constants = require("../_constants.js");
8
8
  function _interopNamespaceDefault(e) {
9
9
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -23,198 +23,129 @@ function _interopNamespaceDefault(e) {
23
23
  }
24
24
  const token__namespace = /* @__PURE__ */ _interopNamespaceDefault(token);
25
25
  const typography__namespace = /* @__PURE__ */ _interopNamespaceDefault(typography);
26
- const elementText = (props) => {
26
+ const createChildren = (props) => {
27
27
  const {
28
- isThemeDark,
29
- isThemeMaryland,
30
- isSizeLarge = false,
31
- isTypeFeatured = false,
32
- image,
33
- quote,
28
+ action: action$1,
34
29
  attribution,
35
30
  attributionSubText,
36
- action: action$1,
37
- includesAnimation
31
+ hasImage,
32
+ includesAnimation,
33
+ isThemeDark,
34
+ quote: quote$1,
35
+ shouldHaveWhiteText
38
36
  } = props;
39
- const createQuoteText = (quote2, quoteChildren) => {
40
- let quoteTextElement = quote2;
41
- const wordsList = splitWords(quote2);
42
- if (includesAnimation) {
43
- quoteTextElement = document.createElement("div");
44
- wordsList.map((word) => {
45
- quoteTextElement.appendChild(word);
46
- });
47
- }
48
- const quoteElement = index.create({
49
- element: quoteTextElement,
50
- className: "quote-container-quote",
51
- children: quoteChildren,
37
+ const wrapperChildren = [];
38
+ if (quote$1) {
39
+ wrapperChildren.push(
40
+ quote({ ...props, shouldHaveWhiteText, quote: quote$1, hasImage })
41
+ );
42
+ }
43
+ if (attribution) {
44
+ const attributionElement = index.create({
45
+ element: attribution,
46
+ className: "quote-container-attribution",
52
47
  elementStyles: {
53
48
  element: {
54
- position: "relative",
55
- fontWeight: "700",
56
- color: token__namespace.color.black,
57
- ...typography__namespace.sans.larger,
58
- ...isSizeLarge && { ...typography__namespace.sans.extraLarge },
59
- ...(isThemeDark || isThemeMaryland) && {
60
- color: token__namespace.color.white
49
+ marginTop: token__namespace.spacing.sm,
50
+ ...includesAnimation && {
51
+ opacity: "0",
52
+ transform: "translateY(20px)",
53
+ transition: "opacity 1s ease, transform 0.5s ease"
61
54
  },
62
- [`&::before`]: {
63
- content: '""',
64
- position: "absolute",
65
- left: `-${token__namespace.spacing.md}`,
66
- top: "7px",
67
- height: "calc(100% - 14px)",
68
- width: "2px",
69
- display: "block",
70
- backgroundColor: token__namespace.color.red,
71
- ...isThemeMaryland && { backgroundColor: token__namespace.color.gold },
72
- ...image && !isTypeFeatured && {
73
- display: "none"
74
- },
75
- [`@container (min-width: ${_constants.SMALL}px)`]: {
76
- left: `-${token__namespace.spacing.md}`
77
- },
78
- [`@container (max-width: ${_constants.SMALL - 1}px)`]: {
79
- ...!isTypeFeatured && {
80
- display: "block"
81
- }
82
- }
55
+ ...isThemeDark && {
56
+ color: token__namespace.color.white
83
57
  },
84
- ["& *"]: {
58
+ [`& *`]: {
85
59
  color: "currentColor",
86
- ...typography__namespace.sans.larger,
87
- ...isSizeLarge && { ...typography__namespace.sans.extraLarge }
60
+ ...typography__namespace.sans.medium
88
61
  }
89
62
  }
90
63
  }
91
64
  });
92
- return quoteElement;
93
- };
94
- const getQuoteTextContainerChildren = (props2) => {
95
- const wrapperChildren = [];
96
- if (quote) {
97
- const quoteChildren = [];
98
- const iconSpan = icon(props2);
99
- if (!image) {
100
- quoteChildren.push(iconSpan);
101
- }
102
- const quoteElement = createQuoteText(quote, quoteChildren);
103
- wrapperChildren.push(quoteElement);
104
- }
105
- if (attribution) {
106
- const attributionElement = index.create({
107
- element: attribution,
108
- className: "quote-container-attribution",
109
- elementStyles: {
110
- element: {
111
- marginTop: token__namespace.spacing.sm,
112
- ...includesAnimation && {
113
- opacity: "0",
114
- transform: "translateY(20px)",
115
- transition: "opacity 1s ease, transform 0.5s ease"
116
- },
117
- ...isThemeDark && {
118
- color: token__namespace.color.white
119
- },
120
- [`& *`]: {
121
- color: "currentColor",
122
- ...typography__namespace.sans.medium
123
- }
124
- }
125
- }
126
- });
127
- wrapperChildren.push(attributionElement);
128
- }
129
- if (attributionSubText) {
130
- const attributionSubTextElement = index.create({
131
- element: attributionSubText,
132
- className: "quote-container-text-attribution-sub-text",
133
- elementStyles: {
134
- element: {
135
- color: token__namespace.color.gray.dark,
136
- fontStyle: "italic",
137
- ...typography__namespace.sans.small,
138
- ...includesAnimation && {
139
- opacity: "0",
140
- transform: "translateY(20px)",
141
- transition: "opacity 1s ease, transform 0.5s ease"
142
- },
143
- ...(isThemeDark || isThemeMaryland) && {
144
- color: token__namespace.color.white
145
- }
65
+ wrapperChildren.push(attributionElement);
66
+ }
67
+ if (attributionSubText) {
68
+ const attributionSubTextElement = index.create({
69
+ element: attributionSubText,
70
+ className: "quote-container-text-attribution-sub-text",
71
+ elementStyles: {
72
+ element: {
73
+ color: token__namespace.color.gray.dark,
74
+ fontStyle: "italic",
75
+ ...typography__namespace.sans.small,
76
+ ...includesAnimation && {
77
+ opacity: "0",
78
+ transform: "translateY(20px)",
79
+ transition: "opacity 1s ease, transform 0.5s ease"
80
+ },
81
+ ...shouldHaveWhiteText && {
82
+ color: token__namespace.color.white
146
83
  }
147
84
  }
148
- });
149
- wrapperChildren.push(attributionSubTextElement);
150
- }
151
- if (action$1) {
152
- const actionElement = action({
153
- ...props2,
154
- action: action$1
155
- });
156
- wrapperChildren.push(actionElement);
157
- }
158
- return wrapperChildren;
159
- };
160
- const splitWords = (quote2) => {
161
- const text = quote2.textContent ?? "";
162
- const words = text.trim().split(/\s+/);
163
- const wordElements = words.map((word, index2) => {
164
- const wordElement = document.createElement("div");
165
- wordElement.classList.add("quote-text-split-word");
166
- Object.assign(wordElement.style, {
167
- display: "inline-block",
168
- whiteSpace: "pre-wrap",
169
- opacity: "0",
170
- transform: "translateY(20px)",
171
- transition: "opacity 1s ease, transform 0.5s ease"
172
- });
173
- wordElement.textContent = word + (index2 < words.length - 1 ? " " : "");
174
- return wordElement;
85
+ }
175
86
  });
176
- return wordElements;
177
- };
178
- const CreateQuoteTextContainer = (props2) => {
179
- const wrapperChildren = getQuoteTextContainerChildren(props2);
180
- const wrapper = index.createDiv({
181
- className: "quote-text-container-wrapper",
182
- children: wrapperChildren
87
+ wrapperChildren.push(attributionSubTextElement);
88
+ }
89
+ if (action$1) {
90
+ const actionElement = action({
91
+ ...props,
92
+ action: action$1
183
93
  });
184
- return index.createDiv({
185
- className: "quote-text-container",
186
- children: [wrapper],
187
- elementStyles: {
188
- element: {
189
- width: "100%",
190
- ...typography__namespace.sans.medium,
191
- [`@container (max-width: ${_constants.SMALL - 1}px)`]: {
192
- paddingTop: token__namespace.spacing.lg,
193
- paddingLeft: token__namespace.spacing.md,
194
- ...!isTypeFeatured && {
195
- ...isSizeLarge && { paddingTop: token__namespace.spacing["2xl"] }
196
- }
197
- },
198
- [`@container (min-width: ${_constants.SMALL}px)`]: {
199
- paddingLeft: token__namespace.spacing["4xl"],
200
- ...!isTypeFeatured && {
201
- ...image && { paddingLeft: "0" }
202
- }
94
+ wrapperChildren.push(actionElement);
95
+ }
96
+ return wrapperChildren;
97
+ };
98
+ const elementText = (props) => {
99
+ const {
100
+ image,
101
+ isSizeLarge = false,
102
+ isThemeDark,
103
+ isThemeMaryland,
104
+ isTypeFeatured = false
105
+ } = props;
106
+ const shouldHaveWhiteText = isThemeDark || isThemeMaryland;
107
+ const isSizeLargeAndNotFeatured = isSizeLarge && !isTypeFeatured;
108
+ const hasImage = image != null;
109
+ const isHasImageAndNotFeatured = hasImage && !isTypeFeatured;
110
+ const wrapper = index.createDiv({
111
+ className: "quote-text-container-wrapper",
112
+ children: [
113
+ ...createChildren({
114
+ ...props,
115
+ shouldHaveWhiteText,
116
+ hasImage
117
+ })
118
+ ]
119
+ });
120
+ return index.createDiv({
121
+ className: "quote-text-container",
122
+ children: [wrapper],
123
+ elementStyles: {
124
+ element: {
125
+ width: "100%",
126
+ ...typography__namespace.sans.medium,
127
+ [`@container (max-width: ${_constants.SMALL - 1}px)`]: {
128
+ paddingLeft: token__namespace.spacing.md,
129
+ ...!hasImage && {
130
+ paddingTop: token__namespace.spacing.lg
203
131
  },
204
- [`& *`]: {
205
- ...typography__namespace.sans.medium,
206
- ...isThemeDark && {
207
- color: token__namespace.color.white
208
- },
209
- ...isThemeMaryland && {
210
- color: token__namespace.color.white
211
- }
132
+ ...isSizeLargeAndNotFeatured && {
133
+ paddingTop: token__namespace.spacing["2xl"]
134
+ }
135
+ },
136
+ [`@container (min-width: ${_constants.SMALL}px)`]: {
137
+ paddingLeft: token__namespace.spacing["4xl"],
138
+ ...isHasImageAndNotFeatured && { paddingLeft: "0" }
139
+ },
140
+ [`& *`]: {
141
+ ...typography__namespace.sans.medium,
142
+ ...shouldHaveWhiteText && {
143
+ color: token__namespace.color.white
212
144
  }
213
145
  }
214
146
  }
215
- });
216
- };
217
- return CreateQuoteTextContainer(props);
147
+ }
148
+ });
218
149
  };
219
150
  module.exports = elementText;
220
151
  //# sourceMappingURL=text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sources":["../../../../source/composite/quote/elements/text.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 { default as elementAction } from './action';\nimport { SMALL } from '../_constants';\nimport { type QuoteTextProps } from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\nexport default (props: QuoteTextProps) => {\n const {\n isThemeDark,\n isThemeMaryland,\n isSizeLarge = false,\n isTypeFeatured = false,\n image,\n quote,\n attribution,\n attributionSubText,\n action,\n includesAnimation,\n } = props;\n\n const createQuoteText = (\n quote: HTMLElement,\n quoteChildren: ElementVisual[],\n ) => {\n let quoteTextElement: HTMLElement = quote;\n const wordsList = splitWords(quote);\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: quoteChildren,\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 ...((isThemeDark || isThemeMaryland) && {\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 ...(image &&\n !isTypeFeatured && {\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 ...typography.sans.larger,\n ...(isSizeLarge && { ...typography.sans.extraLarge }),\n },\n },\n },\n });\n\n return quoteElement;\n };\n\n const getQuoteTextContainerChildren = (props: QuoteTextProps) => {\n const wrapperChildren: ElementVisual[] = [];\n\n if (quote) {\n const quoteChildren: ElementVisual[] = [];\n const iconSpan = elementIcon(props);\n\n if (!image) {\n quoteChildren.push(iconSpan);\n }\n\n const quoteElement = createQuoteText(quote, quoteChildren);\n\n wrapperChildren.push(quoteElement);\n }\n\n if (attribution) {\n const attributionElement = ElementModel.create({\n element: attribution,\n className: 'quote-container-attribution',\n elementStyles: {\n element: {\n marginTop: token.spacing.sm,\n\n ...(includesAnimation && {\n opacity: '0',\n transform: 'translateY(20px)',\n transition: 'opacity 1s ease, transform 0.5s ease',\n }),\n\n ...(isThemeDark && {\n color: token.color.white,\n }),\n\n [`& *`]: {\n color: 'currentColor',\n ...typography.sans.medium,\n },\n },\n },\n });\n\n wrapperChildren.push(attributionElement);\n }\n\n if (attributionSubText) {\n const attributionSubTextElement = ElementModel.create({\n element: attributionSubText,\n className: 'quote-container-text-attribution-sub-text',\n elementStyles: {\n element: {\n color: token.color.gray.dark,\n fontStyle: 'italic',\n ...typography.sans.small,\n\n ...(includesAnimation && {\n opacity: '0',\n transform: 'translateY(20px)',\n transition: 'opacity 1s ease, transform 0.5s ease',\n }),\n\n ...((isThemeDark || isThemeMaryland) && {\n color: token.color.white,\n }),\n },\n },\n });\n\n wrapperChildren.push(attributionSubTextElement);\n }\n\n if (action) {\n const actionElement = elementAction({\n ...props,\n action,\n });\n\n wrapperChildren.push(actionElement);\n }\n\n return wrapperChildren;\n };\n\n const 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\n const CreateQuoteTextContainer = (props: QuoteTextProps) => {\n const wrapperChildren = getQuoteTextContainerChildren(props);\n\n const wrapper = ElementModel.createDiv({\n className: 'quote-text-container-wrapper',\n children: wrapperChildren,\n });\n\n return ElementModel.createDiv({\n className: 'quote-text-container',\n children: [wrapper],\n elementStyles: {\n element: {\n width: '100%',\n ...typography.sans.medium,\n\n [`@container (max-width: ${SMALL - 1}px)`]: {\n paddingTop: token.spacing.lg,\n paddingLeft: token.spacing.md,\n\n ...(!isTypeFeatured && {\n ...(isSizeLarge && { paddingTop: token.spacing['2xl'] }),\n }),\n },\n\n [`@container (min-width: ${SMALL}px)`]: {\n paddingLeft: token.spacing['4xl'],\n\n ...(!isTypeFeatured && {\n ...(image && { paddingLeft: '0' }),\n }),\n },\n\n [`& *`]: {\n ...typography.sans.medium,\n\n ...(isThemeDark && {\n color: token.color.white,\n }),\n\n ...(isThemeMaryland && {\n color: token.color.white,\n }),\n },\n },\n },\n });\n };\n\n return CreateQuoteTextContainer(props);\n};\n"],"names":["action","quote","ElementModel.create","token","typography","SMALL","props","elementIcon","elementAction","index","ElementModel.createDiv"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAA,cAAe,CAAC,UAA0B;AACxC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAAA,QACAA;AAAAA,IACA;AAAA,EAAA,IACE;AAEJ,QAAM,kBAAkB,CACtBC,QACA,kBACG;AACH,QAAI,mBAAgCA;AACpC,UAAM,YAAY,WAAWA,MAAK;AAElC,QAAI,mBAAmB;AACrB,yBAAmB,SAAS,cAAc,KAAK;AAE/C,gBAAU,IAAI,CAAC,SAAS;AACtB,yBAAiB,YAAY,IAAI;AAAA,MACnC,CAAC;AAAA,IACH;AAEA,UAAM,eAAeC,MAAAA,OAAoB;AAAA,MACvC,SAAS;AAAA,MACT,WAAW;AAAA,MACX,UAAU;AAAA,MACV,eAAe;AAAA,QACb,SAAS;AAAA,UACP,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,OAAOC,iBAAM,MAAM;AAAA,UACnB,GAAGC,sBAAW,KAAK;AAAA,UAEnB,GAAI,eAAe,EAAE,GAAGA,sBAAW,KAAK,WAAA;AAAA,UAExC,IAAK,eAAe,oBAAoB;AAAA,YACtC,OAAOD,iBAAM,MAAM;AAAA,UAAA;AAAA,UAGrB,CAAC,WAAW,GAAG;AAAA,YACb,SAAS;AAAA,YACT,UAAU;AAAA,YACV,MAAM,IAAIA,iBAAM,QAAQ,EAAE;AAAA,YAC1B,KAAK;AAAA,YACL,QAAQ;AAAA,YACR,OAAO;AAAA,YACP,SAAS;AAAA,YACT,iBAAiBA,iBAAM,MAAM;AAAA,YAC7B,GAAI,mBAAmB,EAAE,iBAAiBA,iBAAM,MAAM,KAAA;AAAA,YAEtD,GAAI,SACF,CAAC,kBAAkB;AAAA,cACjB,SAAS;AAAA,YAAA;AAAA,YAGb,CAAC,0B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AED,WAAOA,gBAAuB;AAAA,MAC5B,WAAW;AAAA,MACX,UAAU,CAAC,OAAO;AAAA,MAClB,eAAe;AAAA,QACb,SAAS;AAAA,UACP,OAAO;AAAA,UACP,GAAGN,sBAAW,KAAK;AAAA,UAEnB,CAAC,0BAA0BC,WAAAA,QAAQ,CAAC,KAAK,GAAG;AAAA,YAC1C,YAAYF,iBAAM,QAAQ;AAAA,YAC1B,aAAaA,iBAAM,QAAQ;AAAA,YAE3B,GAAI,CAAC,kBAAkB;AAAA,cACrB,GAAI,eAAe,EAAE,YAAYA,iBAAM,QAAQ,KAAK,EAAA;AAAA,YAAE;AAAA,UACxD;AAAA,UAGF,CAAC,0BAA0BE,gBAAK,KAAK,GAAG;AAAA,YACtC,aAAaF,iBAAM,QAAQ,KAAK;AAAA,YAEhC,GAAI,CAAC,kBAAkB;AAAA,cACrB,GAAI,SAAS,EAAE,aAAa,IAAA;AAAA,YAAI;AAAA,UAClC;AAAA,UAGF,CAAC,KAAK,GAAG;AAAA,YACP,GAAGC,sBAAW,KAAK;AAAA,YAEnB,GAAI,eAAe;AAAA,cACjB,OAAOD,iBAAM,MAAM;AAAA,YAAA;AAAA,YAGrB,GAAI,mBAAmB;AAAA,cACrB,OAAOA,iBAAM,MAAM;AAAA,YAAA;AAAA,UACrB;AAAA,QACF;AAAA,MACF;AAAA,IACF,CACD;AAAA,EACH;AAEA,SAAO,yBAAyB,KAAK;AACvC;;"}
1
+ {"version":3,"file":"text.js","sources":["../../../../source/composite/quote/elements/text.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 elementAction } from './action';\nimport { default as elementQuote } from './quote';\nimport { SMALL } from '../_constants';\nimport { type QuoteTextProps } from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface ChildrenProps\n extends Pick<\n QuoteTextProps,\n | 'quote'\n | 'image'\n | 'attribution'\n | 'attributionSubText'\n | 'action'\n | 'isThemeDark'\n | 'isSizeLarge'\n | 'isTypeFeatured'\n | 'includesAnimation'\n > {\n shouldHaveWhiteText?: boolean;\n hasImage: boolean;\n}\n\nconst createChildren = (props: ChildrenProps) => {\n const {\n action,\n attribution,\n attributionSubText,\n hasImage,\n includesAnimation,\n isThemeDark,\n quote,\n shouldHaveWhiteText,\n } = props;\n const wrapperChildren: ElementVisual[] = [];\n\n if (quote) {\n wrapperChildren.push(\n elementQuote({ ...props, shouldHaveWhiteText, quote, hasImage }),\n );\n }\n\n if (attribution) {\n const attributionElement = ElementModel.create({\n element: attribution,\n className: 'quote-container-attribution',\n elementStyles: {\n element: {\n marginTop: token.spacing.sm,\n\n ...(includesAnimation && {\n opacity: '0',\n transform: 'translateY(20px)',\n transition: 'opacity 1s ease, transform 0.5s ease',\n }),\n\n ...(isThemeDark && {\n color: token.color.white,\n }),\n\n [`& *`]: {\n color: 'currentColor',\n ...typography.sans.medium,\n },\n },\n },\n });\n\n wrapperChildren.push(attributionElement);\n }\n\n if (attributionSubText) {\n const attributionSubTextElement = ElementModel.create({\n element: attributionSubText,\n className: 'quote-container-text-attribution-sub-text',\n elementStyles: {\n element: {\n color: token.color.gray.dark,\n fontStyle: 'italic',\n ...typography.sans.small,\n\n ...(includesAnimation && {\n opacity: '0',\n transform: 'translateY(20px)',\n transition: 'opacity 1s ease, transform 0.5s ease',\n }),\n\n ...(shouldHaveWhiteText && {\n color: token.color.white,\n }),\n },\n },\n });\n\n wrapperChildren.push(attributionSubTextElement);\n }\n\n if (action) {\n const actionElement = elementAction({\n ...props,\n action,\n });\n\n wrapperChildren.push(actionElement);\n }\n\n return wrapperChildren;\n};\n\nexport default (\n props: Pick<\n QuoteTextProps,\n | 'isThemeDark'\n | 'isThemeMaryland'\n | 'isSizeLarge'\n | 'isTypeFeatured'\n | 'image'\n | 'quote'\n | 'attribution'\n | 'attributionSubText'\n | 'action'\n | 'includesAnimation'\n >,\n) => {\n const {\n image,\n isSizeLarge = false,\n isThemeDark,\n isThemeMaryland,\n isTypeFeatured = false,\n } = props;\n const shouldHaveWhiteText = isThemeDark || isThemeMaryland;\n const isSizeLargeAndNotFeatured = isSizeLarge && !isTypeFeatured;\n const hasImage = image != null;\n const isHasImageAndNotFeatured = hasImage && !isTypeFeatured;\n\n const wrapper = ElementModel.createDiv({\n className: 'quote-text-container-wrapper',\n children: [\n ...createChildren({\n ...props,\n shouldHaveWhiteText,\n hasImage,\n }),\n ],\n });\n\n return ElementModel.createDiv({\n className: 'quote-text-container',\n children: [wrapper],\n elementStyles: {\n element: {\n width: '100%',\n ...typography.sans.medium,\n\n [`@container (max-width: ${SMALL - 1}px)`]: {\n paddingLeft: token.spacing.md,\n\n ...(!hasImage && {\n paddingTop: token.spacing.lg,\n }),\n\n ...(isSizeLargeAndNotFeatured && {\n paddingTop: token.spacing['2xl'],\n }),\n },\n\n [`@container (min-width: ${SMALL}px)`]: {\n paddingLeft: token.spacing['4xl'],\n\n ...(isHasImageAndNotFeatured && { paddingLeft: '0' }),\n },\n\n [`& *`]: {\n ...typography.sans.medium,\n\n ...(shouldHaveWhiteText && {\n color: token.color.white,\n }),\n },\n },\n },\n });\n};\n"],"names":["action","quote","elementQuote","ElementModel.create","token","typography","elementAction","ElementModel.createDiv","SMALL"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,iBAAiB,CAAC,UAAyB;AAC/C,QAAM;AAAA,IAAA,QACJA;AAAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAAA,OACAC;AAAAA,IACA;AAAA,EAAA,IACE;AACJ,QAAM,kBAAmC,CAAA;AAEzC,MAAIA,SAAO;AACT,oBAAgB;AAAA,MACdC,MAAa,EAAE,GAAG,OAAO,qBAAA,OAAqBD,SAAO,UAAU;AAAA,IAAA;AAAA,EAEnE;AAEA,MAAI,aAAa;AACf,UAAM,qBAAqBE,MAAAA,OAAoB;AAAA,MAC7C,SAAS;AAAA,MACT,WAAW;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