@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
@@ -7,6 +7,7 @@ const quoteAnimation = ({
7
7
  quote,
8
8
  quoteElement
9
9
  }) => {
10
+ if (!includesAnimation || !quote) return;
10
11
  const quoteTextElement = quoteElement.element.querySelector(
11
12
  ".quote-container-quote"
12
13
  );
@@ -19,45 +20,69 @@ const quoteAnimation = ({
19
20
  const actionsElement = quoteElement.element.querySelector(
20
21
  ".quote-container-actions"
21
22
  );
23
+ const animateAction = !isTypeFeatured || isTypeFeatured && !image;
24
+ const applyFinalState = () => {
25
+ const wordsList = Array.from(
26
+ quoteTextElement.querySelectorAll(".quote-text-split-word")
27
+ );
28
+ wordsList.forEach((word) => {
29
+ word.style.transition = "none";
30
+ word.style.opacity = "1";
31
+ word.style.transform = "translateY(0)";
32
+ });
33
+ if (attributionElement) {
34
+ attributionElement.style.transition = "none";
35
+ attributionElement.style.opacity = "1";
36
+ attributionElement.style.transform = "translateY(0)";
37
+ }
38
+ if (attributionSubTextElement) {
39
+ attributionSubTextElement.style.transition = "none";
40
+ attributionSubTextElement.style.opacity = "1";
41
+ attributionSubTextElement.style.transform = "translateY(0)";
42
+ }
43
+ if (actionsElement && animateAction) {
44
+ actionsElement.style.transition = "none";
45
+ actionsElement.style.opacity = "1";
46
+ actionsElement.style.transform = "translateY(0)";
47
+ }
48
+ };
49
+ const runAnimation = () => {
50
+ const wordsList = Array.from(
51
+ quoteTextElement.querySelectorAll(".quote-text-split-word")
52
+ );
53
+ let quoteAnimationLength = 50;
54
+ wordsList.forEach((word, i) => {
55
+ setTimeout(() => {
56
+ word.style.opacity = "1";
57
+ word.style.transform = "translateY(0)";
58
+ }, i * 50);
59
+ quoteAnimationLength += 50;
60
+ });
61
+ if (attributionElement) {
62
+ setTimeout(() => {
63
+ attributionElement.style.opacity = "1";
64
+ attributionElement.style.transform = "translateY(0)";
65
+ }, quoteAnimationLength);
66
+ }
67
+ if (attributionSubTextElement) {
68
+ setTimeout(() => {
69
+ attributionSubTextElement.style.opacity = "1";
70
+ attributionSubTextElement.style.transform = "translateY(0)";
71
+ }, quoteAnimationLength);
72
+ }
73
+ if (actionsElement && animateAction) {
74
+ setTimeout(() => {
75
+ actionsElement.style.opacity = "1";
76
+ actionsElement.style.transform = "translateY(0)";
77
+ }, quoteAnimationLength);
78
+ }
79
+ };
22
80
  const observer = new IntersectionObserver(
23
81
  (entries) => {
24
82
  entries.forEach((entry) => {
25
83
  if (entry.isIntersecting) {
26
- if (!quote || !includesAnimation || !quoteTextElement) {
27
- return;
28
- }
29
- const wordsList = Array.from(
30
- quoteTextElement.querySelectorAll(".quote-text-split-word")
31
- );
32
- const animateAction = !isTypeFeatured || isTypeFeatured && !image;
33
- let quoteAnimationLength = 50;
34
- wordsList.forEach((word, i) => {
35
- setTimeout(() => {
36
- word.style.opacity = "1";
37
- word.style.transform = "translateY(0)";
38
- }, i * 50);
39
- quoteAnimationLength += 50;
40
- });
41
- if (attributionElement) {
42
- setTimeout(() => {
43
- if (attributionElement) {
44
- attributionElement.style.opacity = "1";
45
- attributionElement.style.transform = "translateY(0)";
46
- }
47
- }, quoteAnimationLength);
48
- }
49
- if (attributionSubTextElement) {
50
- setTimeout(() => {
51
- attributionSubTextElement.style.opacity = "1";
52
- attributionSubTextElement.style.transform = "translateY(0)";
53
- }, quoteAnimationLength);
54
- }
55
- if (actionsElement && animateAction) {
56
- setTimeout(() => {
57
- actionsElement.style.opacity = "1";
58
- actionsElement.style.transform = "translateY(0)";
59
- }, quoteAnimationLength);
60
- }
84
+ runAnimation();
85
+ observer.unobserve(entry.target);
61
86
  }
62
87
  });
63
88
  },
@@ -66,7 +91,13 @@ const quoteAnimation = ({
66
91
  threshold: 0
67
92
  }
68
93
  );
69
- if (quoteTextElement && includesAnimation) {
94
+ const rect = quoteTextElement.getBoundingClientRect();
95
+ const windowHeight = window.innerHeight || document.documentElement.clientHeight;
96
+ const triggerPoint = windowHeight - 120;
97
+ const isAlreadyPast = rect.top < triggerPoint;
98
+ if (isAlreadyPast) {
99
+ applyFinalState();
100
+ } else {
70
101
  observer.observe(quoteTextElement);
71
102
  }
72
103
  };
@@ -1 +1 @@
1
- {"version":3,"file":"animation.js","sources":["../../../../source/composite/quote/helper/animation.ts"],"sourcesContent":["import { type QuoteBaseProps, type QuoteVariantProps } from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteAnimationProps\n extends QuoteVariantProps,\n Pick<QuoteBaseProps, 'quote' | 'includesAnimation' | 'image'> {\n quoteElement: ElementVisual;\n}\n\nexport const quoteAnimation = ({\n image,\n includesAnimation,\n isTypeFeatured = false,\n quote,\n quoteElement,\n}: QuoteAnimationProps) => {\n const quoteTextElement = quoteElement.element.querySelector(\n '.quote-container-quote',\n ) as HTMLElement;\n const attributionElement = quoteElement.element.querySelector(\n '.quote-container-attribution',\n ) as HTMLElement;\n const attributionSubTextElement = quoteElement.element.querySelector(\n '.quote-container-text-attribution-sub-text',\n ) as HTMLElement;\n const actionsElement = quoteElement.element.querySelector(\n '.quote-container-actions',\n ) as HTMLElement;\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!quote || !includesAnimation || !quoteTextElement) {\n return;\n }\n\n const wordsList = Array.from(\n quoteTextElement.querySelectorAll('.quote-text-split-word'),\n ) as HTMLElement[];\n const animateAction = !isTypeFeatured || (isTypeFeatured && !image);\n\n let quoteAnimationLength = 50;\n\n wordsList.forEach((word, i) => {\n setTimeout(() => {\n word.style.opacity = '1';\n word.style.transform = 'translateY(0)';\n }, i * 50);\n\n quoteAnimationLength += 50;\n });\n\n if (attributionElement) {\n setTimeout(() => {\n if (attributionElement) {\n attributionElement.style.opacity = '1';\n attributionElement.style.transform = 'translateY(0)';\n }\n }, quoteAnimationLength);\n }\n\n if (attributionSubTextElement) {\n setTimeout(() => {\n attributionSubTextElement.style.opacity = '1';\n attributionSubTextElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n\n if (actionsElement && animateAction) {\n setTimeout(() => {\n actionsElement.style.opacity = '1';\n actionsElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n }\n });\n },\n {\n rootMargin: '0px 0px -120px 0px',\n threshold: 0,\n },\n );\n\n if (quoteTextElement && includesAnimation) {\n observer.observe(quoteTextElement);\n }\n};\n"],"names":[],"mappings":";;AASO,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AACF,MAA2B;AACzB,QAAM,mBAAmB,aAAa,QAAQ;AAAA,IAC5C;AAAA,EAAA;AAEF,QAAM,qBAAqB,aAAa,QAAQ;AAAA,IAC9C;AAAA,EAAA;AAEF,QAAM,4BAA4B,aAAa,QAAQ;AAAA,IACrD;AAAA,EAAA;AAEF,QAAM,iBAAiB,aAAa,QAAQ;AAAA,IAC1C;AAAA,EAAA;AAGF,QAAM,WAAW,IAAI;AAAA,IACnB,CAAC,YAAY;AACX,cAAQ,QAAQ,CAAC,UAAU;AACzB,YAAI,MAAM,gBAAgB;AACxB,cAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,kBAAkB;AACrD;AAAA,UACF;AAEA,gBAAM,YAAY,MAAM;AAAA,YACtB,iBAAiB,iBAAiB,wBAAwB;AAAA,UAAA;AAE5D,gBAAM,gBAAgB,CAAC,kBAAmB,kBAAkB,CAAC;AAE7D,cAAI,uBAAuB;AAE3B,oBAAU,QAAQ,CAAC,MAAM,MAAM;AAC7B,uBAAW,MAAM;AACf,mBAAK,MAAM,UAAU;AACrB,mBAAK,MAAM,YAAY;AAAA,YACzB,GAAG,IAAI,EAAE;AAET,oCAAwB;AAAA,UAC1B,CAAC;AAED,cAAI,oBAAoB;AACtB,uBAAW,MAAM;AACf,kBAAI,oBAAoB;AACtB,mCAAmB,MAAM,UAAU;AACnC,mCAAmB,MAAM,YAAY;AAAA,cACvC;AAAA,YACF,GAAG,oBAAoB;AAAA,UACzB;AAEA,cAAI,2BAA2B;AAC7B,uBAAW,MAAM;AACf,wCAA0B,MAAM,UAAU;AAC1C,wCAA0B,MAAM,YAAY;AAAA,YAC9C,GAAG,oBAAoB;AAAA,UACzB;AAEA,cAAI,kBAAkB,eAAe;AACnC,uBAAW,MAAM;AACf,6BAAe,MAAM,UAAU;AAC/B,6BAAe,MAAM,YAAY;AAAA,YACnC,GAAG,oBAAoB;AAAA,UACzB;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,MACE,YAAY;AAAA,MACZ,WAAW;AAAA,IAAA;AAAA,EACb;AAGF,MAAI,oBAAoB,mBAAmB;AACzC,aAAS,QAAQ,gBAAgB;AAAA,EACnC;AACF;;"}
1
+ {"version":3,"file":"animation.js","sources":["../../../../source/composite/quote/helper/animation.ts"],"sourcesContent":["import { type QuoteBaseProps, type QuoteVariantProps } from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteAnimationProps\n extends QuoteVariantProps,\n Pick<QuoteBaseProps, 'quote' | 'includesAnimation' | 'image'> {\n quoteElement: ElementVisual;\n}\n\nexport const quoteAnimation = ({\n image,\n includesAnimation,\n isTypeFeatured = false,\n quote,\n quoteElement,\n}: QuoteAnimationProps) => {\n if (!includesAnimation || !quote) return;\n\n const quoteTextElement = quoteElement.element.querySelector(\n '.quote-container-quote',\n ) as HTMLElement;\n const attributionElement = quoteElement.element.querySelector(\n '.quote-container-attribution',\n ) as HTMLElement;\n const attributionSubTextElement = quoteElement.element.querySelector(\n '.quote-container-text-attribution-sub-text',\n ) as HTMLElement;\n const actionsElement = quoteElement.element.querySelector(\n '.quote-container-actions',\n ) as HTMLElement;\n\n const animateAction = !isTypeFeatured || (isTypeFeatured && !image);\n\n const applyFinalState = () => {\n const wordsList = Array.from(\n quoteTextElement.querySelectorAll('.quote-text-split-word'),\n ) as HTMLElement[];\n\n wordsList.forEach((word) => {\n word.style.transition = 'none';\n word.style.opacity = '1';\n word.style.transform = 'translateY(0)';\n });\n\n if (attributionElement) {\n attributionElement.style.transition = 'none';\n attributionElement.style.opacity = '1';\n attributionElement.style.transform = 'translateY(0)';\n }\n\n if (attributionSubTextElement) {\n attributionSubTextElement.style.transition = 'none';\n attributionSubTextElement.style.opacity = '1';\n attributionSubTextElement.style.transform = 'translateY(0)';\n }\n\n if (actionsElement && animateAction) {\n actionsElement.style.transition = 'none';\n actionsElement.style.opacity = '1';\n actionsElement.style.transform = 'translateY(0)';\n }\n };\n\n const runAnimation = () => {\n const wordsList = Array.from(\n quoteTextElement.querySelectorAll('.quote-text-split-word'),\n ) as HTMLElement[];\n\n let quoteAnimationLength = 50;\n\n wordsList.forEach((word, i) => {\n setTimeout(() => {\n word.style.opacity = '1';\n word.style.transform = 'translateY(0)';\n }, i * 50);\n\n quoteAnimationLength += 50;\n });\n\n if (attributionElement) {\n setTimeout(() => {\n attributionElement.style.opacity = '1';\n attributionElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n\n if (attributionSubTextElement) {\n setTimeout(() => {\n attributionSubTextElement.style.opacity = '1';\n attributionSubTextElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n\n if (actionsElement && animateAction) {\n setTimeout(() => {\n actionsElement.style.opacity = '1';\n actionsElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n };\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n runAnimation();\n observer.unobserve(entry.target);\n }\n });\n },\n {\n rootMargin: '0px 0px -120px 0px',\n threshold: 0,\n },\n );\n\n const rect = quoteTextElement.getBoundingClientRect();\n const windowHeight =\n window.innerHeight || document.documentElement.clientHeight;\n const triggerPoint = windowHeight - 120;\n const isAlreadyPast = rect.top < triggerPoint;\n\n if (isAlreadyPast) {\n applyFinalState();\n } else {\n observer.observe(quoteTextElement);\n }\n};\n"],"names":[],"mappings":";;AASO,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AACF,MAA2B;AACzB,MAAI,CAAC,qBAAqB,CAAC,MAAO;AAElC,QAAM,mBAAmB,aAAa,QAAQ;AAAA,IAC5C;AAAA,EAAA;AAEF,QAAM,qBAAqB,aAAa,QAAQ;AAAA,IAC9C;AAAA,EAAA;AAEF,QAAM,4BAA4B,aAAa,QAAQ;AAAA,IACrD;AAAA,EAAA;AAEF,QAAM,iBAAiB,aAAa,QAAQ;AAAA,IAC1C;AAAA,EAAA;AAGF,QAAM,gBAAgB,CAAC,kBAAmB,kBAAkB,CAAC;AAE7D,QAAM,kBAAkB,MAAM;AAC5B,UAAM,YAAY,MAAM;AAAA,MACtB,iBAAiB,iBAAiB,wBAAwB;AAAA,IAAA;AAG5D,cAAU,QAAQ,CAAC,SAAS;AAC1B,WAAK,MAAM,aAAa;AACxB,WAAK,MAAM,UAAU;AACrB,WAAK,MAAM,YAAY;AAAA,IACzB,CAAC;AAED,QAAI,oBAAoB;AACtB,yBAAmB,MAAM,aAAa;AACtC,yBAAmB,MAAM,UAAU;AACnC,yBAAmB,MAAM,YAAY;AAAA,IACvC;AAEA,QAAI,2BAA2B;AAC7B,gCAA0B,MAAM,aAAa;AAC7C,gCAA0B,MAAM,UAAU;AAC1C,gCAA0B,MAAM,YAAY;AAAA,IAC9C;AAEA,QAAI,kBAAkB,eAAe;AACnC,qBAAe,MAAM,aAAa;AAClC,qBAAe,MAAM,UAAU;AAC/B,qBAAe,MAAM,YAAY;AAAA,IACnC;AAAA,EACF;AAEA,QAAM,eAAe,MAAM;AACzB,UAAM,YAAY,MAAM;AAAA,MACtB,iBAAiB,iBAAiB,wBAAwB;AAAA,IAAA;AAG5D,QAAI,uBAAuB;AAE3B,cAAU,QAAQ,CAAC,MAAM,MAAM;AAC7B,iBAAW,MAAM;AACf,aAAK,MAAM,UAAU;AACrB,aAAK,MAAM,YAAY;AAAA,MACzB,GAAG,IAAI,EAAE;AAET,8BAAwB;AAAA,IAC1B,CAAC;AAED,QAAI,oBAAoB;AACtB,iBAAW,MAAM;AACf,2BAAmB,MAAM,UAAU;AACnC,2BAAmB,MAAM,YAAY;AAAA,MACvC,GAAG,oBAAoB;AAAA,IACzB;AAEA,QAAI,2BAA2B;AAC7B,iBAAW,MAAM;AACf,kCAA0B,MAAM,UAAU;AAC1C,kCAA0B,MAAM,YAAY;AAAA,MAC9C,GAAG,oBAAoB;AAAA,IACzB;AAEA,QAAI,kBAAkB,eAAe;AACnC,iBAAW,MAAM;AACf,uBAAe,MAAM,UAAU;AAC/B,uBAAe,MAAM,YAAY;AAAA,MACnC,GAAG,oBAAoB;AAAA,IACzB;AAAA,EACF;AAEA,QAAM,WAAW,IAAI;AAAA,IACnB,CAAC,YAAY;AACX,cAAQ,QAAQ,CAAC,UAAU;AACzB,YAAI,MAAM,gBAAgB;AACxB,uBAAA;AACA,mBAAS,UAAU,MAAM,MAAM;AAAA,QACjC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,MACE,YAAY;AAAA,MACZ,WAAW;AAAA,IAAA;AAAA,EACb;AAGF,QAAM,OAAO,iBAAiB,sBAAA;AAC9B,QAAM,eACJ,OAAO,eAAe,SAAS,gBAAgB;AACjD,QAAM,eAAe,eAAe;AACpC,QAAM,gBAAgB,KAAK,MAAM;AAEjC,MAAI,eAAe;AACjB,oBAAA;AAAA,EACF,OAAO;AACL,aAAS,QAAQ,gBAAgB;AAAA,EACnC;AACF;;"}
@@ -5,6 +5,7 @@ const quoteAnimation = ({
5
5
  quote,
6
6
  quoteElement
7
7
  }) => {
8
+ if (!includesAnimation || !quote) return;
8
9
  const quoteTextElement = quoteElement.element.querySelector(
9
10
  ".quote-container-quote"
10
11
  );
@@ -17,45 +18,69 @@ const quoteAnimation = ({
17
18
  const actionsElement = quoteElement.element.querySelector(
18
19
  ".quote-container-actions"
19
20
  );
21
+ const animateAction = !isTypeFeatured || isTypeFeatured && !image;
22
+ const applyFinalState = () => {
23
+ const wordsList = Array.from(
24
+ quoteTextElement.querySelectorAll(".quote-text-split-word")
25
+ );
26
+ wordsList.forEach((word) => {
27
+ word.style.transition = "none";
28
+ word.style.opacity = "1";
29
+ word.style.transform = "translateY(0)";
30
+ });
31
+ if (attributionElement) {
32
+ attributionElement.style.transition = "none";
33
+ attributionElement.style.opacity = "1";
34
+ attributionElement.style.transform = "translateY(0)";
35
+ }
36
+ if (attributionSubTextElement) {
37
+ attributionSubTextElement.style.transition = "none";
38
+ attributionSubTextElement.style.opacity = "1";
39
+ attributionSubTextElement.style.transform = "translateY(0)";
40
+ }
41
+ if (actionsElement && animateAction) {
42
+ actionsElement.style.transition = "none";
43
+ actionsElement.style.opacity = "1";
44
+ actionsElement.style.transform = "translateY(0)";
45
+ }
46
+ };
47
+ const runAnimation = () => {
48
+ const wordsList = Array.from(
49
+ quoteTextElement.querySelectorAll(".quote-text-split-word")
50
+ );
51
+ let quoteAnimationLength = 50;
52
+ wordsList.forEach((word, i) => {
53
+ setTimeout(() => {
54
+ word.style.opacity = "1";
55
+ word.style.transform = "translateY(0)";
56
+ }, i * 50);
57
+ quoteAnimationLength += 50;
58
+ });
59
+ if (attributionElement) {
60
+ setTimeout(() => {
61
+ attributionElement.style.opacity = "1";
62
+ attributionElement.style.transform = "translateY(0)";
63
+ }, quoteAnimationLength);
64
+ }
65
+ if (attributionSubTextElement) {
66
+ setTimeout(() => {
67
+ attributionSubTextElement.style.opacity = "1";
68
+ attributionSubTextElement.style.transform = "translateY(0)";
69
+ }, quoteAnimationLength);
70
+ }
71
+ if (actionsElement && animateAction) {
72
+ setTimeout(() => {
73
+ actionsElement.style.opacity = "1";
74
+ actionsElement.style.transform = "translateY(0)";
75
+ }, quoteAnimationLength);
76
+ }
77
+ };
20
78
  const observer = new IntersectionObserver(
21
79
  (entries) => {
22
80
  entries.forEach((entry) => {
23
81
  if (entry.isIntersecting) {
24
- if (!quote || !includesAnimation || !quoteTextElement) {
25
- return;
26
- }
27
- const wordsList = Array.from(
28
- quoteTextElement.querySelectorAll(".quote-text-split-word")
29
- );
30
- const animateAction = !isTypeFeatured || isTypeFeatured && !image;
31
- let quoteAnimationLength = 50;
32
- wordsList.forEach((word, i) => {
33
- setTimeout(() => {
34
- word.style.opacity = "1";
35
- word.style.transform = "translateY(0)";
36
- }, i * 50);
37
- quoteAnimationLength += 50;
38
- });
39
- if (attributionElement) {
40
- setTimeout(() => {
41
- if (attributionElement) {
42
- attributionElement.style.opacity = "1";
43
- attributionElement.style.transform = "translateY(0)";
44
- }
45
- }, quoteAnimationLength);
46
- }
47
- if (attributionSubTextElement) {
48
- setTimeout(() => {
49
- attributionSubTextElement.style.opacity = "1";
50
- attributionSubTextElement.style.transform = "translateY(0)";
51
- }, quoteAnimationLength);
52
- }
53
- if (actionsElement && animateAction) {
54
- setTimeout(() => {
55
- actionsElement.style.opacity = "1";
56
- actionsElement.style.transform = "translateY(0)";
57
- }, quoteAnimationLength);
58
- }
82
+ runAnimation();
83
+ observer.unobserve(entry.target);
59
84
  }
60
85
  });
61
86
  },
@@ -64,7 +89,13 @@ const quoteAnimation = ({
64
89
  threshold: 0
65
90
  }
66
91
  );
67
- if (quoteTextElement && includesAnimation) {
92
+ const rect = quoteTextElement.getBoundingClientRect();
93
+ const windowHeight = window.innerHeight || document.documentElement.clientHeight;
94
+ const triggerPoint = windowHeight - 120;
95
+ const isAlreadyPast = rect.top < triggerPoint;
96
+ if (isAlreadyPast) {
97
+ applyFinalState();
98
+ } else {
68
99
  observer.observe(quoteTextElement);
69
100
  }
70
101
  };
@@ -1 +1 @@
1
- {"version":3,"file":"animation.mjs","sources":["../../../../source/composite/quote/helper/animation.ts"],"sourcesContent":["import { type QuoteBaseProps, type QuoteVariantProps } from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteAnimationProps\n extends QuoteVariantProps,\n Pick<QuoteBaseProps, 'quote' | 'includesAnimation' | 'image'> {\n quoteElement: ElementVisual;\n}\n\nexport const quoteAnimation = ({\n image,\n includesAnimation,\n isTypeFeatured = false,\n quote,\n quoteElement,\n}: QuoteAnimationProps) => {\n const quoteTextElement = quoteElement.element.querySelector(\n '.quote-container-quote',\n ) as HTMLElement;\n const attributionElement = quoteElement.element.querySelector(\n '.quote-container-attribution',\n ) as HTMLElement;\n const attributionSubTextElement = quoteElement.element.querySelector(\n '.quote-container-text-attribution-sub-text',\n ) as HTMLElement;\n const actionsElement = quoteElement.element.querySelector(\n '.quote-container-actions',\n ) as HTMLElement;\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n if (!quote || !includesAnimation || !quoteTextElement) {\n return;\n }\n\n const wordsList = Array.from(\n quoteTextElement.querySelectorAll('.quote-text-split-word'),\n ) as HTMLElement[];\n const animateAction = !isTypeFeatured || (isTypeFeatured && !image);\n\n let quoteAnimationLength = 50;\n\n wordsList.forEach((word, i) => {\n setTimeout(() => {\n word.style.opacity = '1';\n word.style.transform = 'translateY(0)';\n }, i * 50);\n\n quoteAnimationLength += 50;\n });\n\n if (attributionElement) {\n setTimeout(() => {\n if (attributionElement) {\n attributionElement.style.opacity = '1';\n attributionElement.style.transform = 'translateY(0)';\n }\n }, quoteAnimationLength);\n }\n\n if (attributionSubTextElement) {\n setTimeout(() => {\n attributionSubTextElement.style.opacity = '1';\n attributionSubTextElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n\n if (actionsElement && animateAction) {\n setTimeout(() => {\n actionsElement.style.opacity = '1';\n actionsElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n }\n });\n },\n {\n rootMargin: '0px 0px -120px 0px',\n threshold: 0,\n },\n );\n\n if (quoteTextElement && includesAnimation) {\n observer.observe(quoteTextElement);\n }\n};\n"],"names":[],"mappings":"AASO,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AACF,MAA2B;AACzB,QAAM,mBAAmB,aAAa,QAAQ;AAAA,IAC5C;AAAA,EAAA;AAEF,QAAM,qBAAqB,aAAa,QAAQ;AAAA,IAC9C;AAAA,EAAA;AAEF,QAAM,4BAA4B,aAAa,QAAQ;AAAA,IACrD;AAAA,EAAA;AAEF,QAAM,iBAAiB,aAAa,QAAQ;AAAA,IAC1C;AAAA,EAAA;AAGF,QAAM,WAAW,IAAI;AAAA,IACnB,CAAC,YAAY;AACX,cAAQ,QAAQ,CAAC,UAAU;AACzB,YAAI,MAAM,gBAAgB;AACxB,cAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,kBAAkB;AACrD;AAAA,UACF;AAEA,gBAAM,YAAY,MAAM;AAAA,YACtB,iBAAiB,iBAAiB,wBAAwB;AAAA,UAAA;AAE5D,gBAAM,gBAAgB,CAAC,kBAAmB,kBAAkB,CAAC;AAE7D,cAAI,uBAAuB;AAE3B,oBAAU,QAAQ,CAAC,MAAM,MAAM;AAC7B,uBAAW,MAAM;AACf,mBAAK,MAAM,UAAU;AACrB,mBAAK,MAAM,YAAY;AAAA,YACzB,GAAG,IAAI,EAAE;AAET,oCAAwB;AAAA,UAC1B,CAAC;AAED,cAAI,oBAAoB;AACtB,uBAAW,MAAM;AACf,kBAAI,oBAAoB;AACtB,mCAAmB,MAAM,UAAU;AACnC,mCAAmB,MAAM,YAAY;AAAA,cACvC;AAAA,YACF,GAAG,oBAAoB;AAAA,UACzB;AAEA,cAAI,2BAA2B;AAC7B,uBAAW,MAAM;AACf,wCAA0B,MAAM,UAAU;AAC1C,wCAA0B,MAAM,YAAY;AAAA,YAC9C,GAAG,oBAAoB;AAAA,UACzB;AAEA,cAAI,kBAAkB,eAAe;AACnC,uBAAW,MAAM;AACf,6BAAe,MAAM,UAAU;AAC/B,6BAAe,MAAM,YAAY;AAAA,YACnC,GAAG,oBAAoB;AAAA,UACzB;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,MACE,YAAY;AAAA,MACZ,WAAW;AAAA,IAAA;AAAA,EACb;AAGF,MAAI,oBAAoB,mBAAmB;AACzC,aAAS,QAAQ,gBAAgB;AAAA,EACnC;AACF;"}
1
+ {"version":3,"file":"animation.mjs","sources":["../../../../source/composite/quote/helper/animation.ts"],"sourcesContent":["import { type QuoteBaseProps, type QuoteVariantProps } from '../_types';\nimport { type ElementVisual } from '../../../_types';\n\ninterface QuoteAnimationProps\n extends QuoteVariantProps,\n Pick<QuoteBaseProps, 'quote' | 'includesAnimation' | 'image'> {\n quoteElement: ElementVisual;\n}\n\nexport const quoteAnimation = ({\n image,\n includesAnimation,\n isTypeFeatured = false,\n quote,\n quoteElement,\n}: QuoteAnimationProps) => {\n if (!includesAnimation || !quote) return;\n\n const quoteTextElement = quoteElement.element.querySelector(\n '.quote-container-quote',\n ) as HTMLElement;\n const attributionElement = quoteElement.element.querySelector(\n '.quote-container-attribution',\n ) as HTMLElement;\n const attributionSubTextElement = quoteElement.element.querySelector(\n '.quote-container-text-attribution-sub-text',\n ) as HTMLElement;\n const actionsElement = quoteElement.element.querySelector(\n '.quote-container-actions',\n ) as HTMLElement;\n\n const animateAction = !isTypeFeatured || (isTypeFeatured && !image);\n\n const applyFinalState = () => {\n const wordsList = Array.from(\n quoteTextElement.querySelectorAll('.quote-text-split-word'),\n ) as HTMLElement[];\n\n wordsList.forEach((word) => {\n word.style.transition = 'none';\n word.style.opacity = '1';\n word.style.transform = 'translateY(0)';\n });\n\n if (attributionElement) {\n attributionElement.style.transition = 'none';\n attributionElement.style.opacity = '1';\n attributionElement.style.transform = 'translateY(0)';\n }\n\n if (attributionSubTextElement) {\n attributionSubTextElement.style.transition = 'none';\n attributionSubTextElement.style.opacity = '1';\n attributionSubTextElement.style.transform = 'translateY(0)';\n }\n\n if (actionsElement && animateAction) {\n actionsElement.style.transition = 'none';\n actionsElement.style.opacity = '1';\n actionsElement.style.transform = 'translateY(0)';\n }\n };\n\n const runAnimation = () => {\n const wordsList = Array.from(\n quoteTextElement.querySelectorAll('.quote-text-split-word'),\n ) as HTMLElement[];\n\n let quoteAnimationLength = 50;\n\n wordsList.forEach((word, i) => {\n setTimeout(() => {\n word.style.opacity = '1';\n word.style.transform = 'translateY(0)';\n }, i * 50);\n\n quoteAnimationLength += 50;\n });\n\n if (attributionElement) {\n setTimeout(() => {\n attributionElement.style.opacity = '1';\n attributionElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n\n if (attributionSubTextElement) {\n setTimeout(() => {\n attributionSubTextElement.style.opacity = '1';\n attributionSubTextElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n\n if (actionsElement && animateAction) {\n setTimeout(() => {\n actionsElement.style.opacity = '1';\n actionsElement.style.transform = 'translateY(0)';\n }, quoteAnimationLength);\n }\n };\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n runAnimation();\n observer.unobserve(entry.target);\n }\n });\n },\n {\n rootMargin: '0px 0px -120px 0px',\n threshold: 0,\n },\n );\n\n const rect = quoteTextElement.getBoundingClientRect();\n const windowHeight =\n window.innerHeight || document.documentElement.clientHeight;\n const triggerPoint = windowHeight - 120;\n const isAlreadyPast = rect.top < triggerPoint;\n\n if (isAlreadyPast) {\n applyFinalState();\n } else {\n observer.observe(quoteTextElement);\n }\n};\n"],"names":[],"mappings":"AASO,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB;AAAA,EACA;AACF,MAA2B;AACzB,MAAI,CAAC,qBAAqB,CAAC,MAAO;AAElC,QAAM,mBAAmB,aAAa,QAAQ;AAAA,IAC5C;AAAA,EAAA;AAEF,QAAM,qBAAqB,aAAa,QAAQ;AAAA,IAC9C;AAAA,EAAA;AAEF,QAAM,4BAA4B,aAAa,QAAQ;AAAA,IACrD;AAAA,EAAA;AAEF,QAAM,iBAAiB,aAAa,QAAQ;AAAA,IAC1C;AAAA,EAAA;AAGF,QAAM,gBAAgB,CAAC,kBAAmB,kBAAkB,CAAC;AAE7D,QAAM,kBAAkB,MAAM;AAC5B,UAAM,YAAY,MAAM;AAAA,MACtB,iBAAiB,iBAAiB,wBAAwB;AAAA,IAAA;AAG5D,cAAU,QAAQ,CAAC,SAAS;AAC1B,WAAK,MAAM,aAAa;AACxB,WAAK,MAAM,UAAU;AACrB,WAAK,MAAM,YAAY;AAAA,IACzB,CAAC;AAED,QAAI,oBAAoB;AACtB,yBAAmB,MAAM,aAAa;AACtC,yBAAmB,MAAM,UAAU;AACnC,yBAAmB,MAAM,YAAY;AAAA,IACvC;AAEA,QAAI,2BAA2B;AAC7B,gCAA0B,MAAM,aAAa;AAC7C,gCAA0B,MAAM,UAAU;AAC1C,gCAA0B,MAAM,YAAY;AAAA,IAC9C;AAEA,QAAI,kBAAkB,eAAe;AACnC,qBAAe,MAAM,aAAa;AAClC,qBAAe,MAAM,UAAU;AAC/B,qBAAe,MAAM,YAAY;AAAA,IACnC;AAAA,EACF;AAEA,QAAM,eAAe,MAAM;AACzB,UAAM,YAAY,MAAM;AAAA,MACtB,iBAAiB,iBAAiB,wBAAwB;AAAA,IAAA;AAG5D,QAAI,uBAAuB;AAE3B,cAAU,QAAQ,CAAC,MAAM,MAAM;AAC7B,iBAAW,MAAM;AACf,aAAK,MAAM,UAAU;AACrB,aAAK,MAAM,YAAY;AAAA,MACzB,GAAG,IAAI,EAAE;AAET,8BAAwB;AAAA,IAC1B,CAAC;AAED,QAAI,oBAAoB;AACtB,iBAAW,MAAM;AACf,2BAAmB,MAAM,UAAU;AACnC,2BAAmB,MAAM,YAAY;AAAA,MACvC,GAAG,oBAAoB;AAAA,IACzB;AAEA,QAAI,2BAA2B;AAC7B,iBAAW,MAAM;AACf,kCAA0B,MAAM,UAAU;AAC1C,kCAA0B,MAAM,YAAY;AAAA,MAC9C,GAAG,oBAAoB;AAAA,IACzB;AAEA,QAAI,kBAAkB,eAAe;AACnC,iBAAW,MAAM;AACf,uBAAe,MAAM,UAAU;AAC/B,uBAAe,MAAM,YAAY;AAAA,MACnC,GAAG,oBAAoB;AAAA,IACzB;AAAA,EACF;AAEA,QAAM,WAAW,IAAI;AAAA,IACnB,CAAC,YAAY;AACX,cAAQ,QAAQ,CAAC,UAAU;AACzB,YAAI,MAAM,gBAAgB;AACxB,uBAAA;AACA,mBAAS,UAAU,MAAM,MAAM;AAAA,QACjC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,IACA;AAAA,MACE,YAAY;AAAA,MACZ,WAAW;AAAA,IAAA;AAAA,EACb;AAGF,QAAM,OAAO,iBAAiB,sBAAA;AAC9B,QAAM,eACJ,OAAO,eAAe,SAAS,gBAAgB;AACjD,QAAM,eAAe,eAAe;AACpC,QAAM,gBAAgB,KAAK,MAAM;AAEjC,MAAI,eAAe;AACjB,oBAAA;AAAA,EACF,OAAO;AACL,aAAS,QAAQ,gBAAgB;AAAA,EACnC;AACF;"}
@@ -1,5 +1,8 @@
1
1
  import { QuoteInlineProps } from './_types';
2
2
  declare const _default: (props: QuoteInlineProps) => {
3
+ events: {
4
+ loadAnimation: () => void;
5
+ };
3
6
  element: HTMLElement;
4
7
  className: string;
5
8
  styles: string;
@@ -1 +1 @@
1
- {"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../../source/composite/quote/inline.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;yBAGjC,OAAO,gBAAgB;;;;;AAAvC,wBA0DE"}
1
+ {"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../../source/composite/quote/inline.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;yBAGjC,OAAO,gBAAgB;;;;;;;;AAAvC,wBAiEE"}
@@ -6,6 +6,7 @@ const text = require("./elements/text.js");
6
6
  require("@universityofmaryland/web-icons-library/brand");
7
7
  const _constants = require("./_constants.js");
8
8
  require("@universityofmaryland/web-styles-library/layout");
9
+ require("@universityofmaryland/web-styles-library/typography");
9
10
  const animation = require("./helper/animation.js");
10
11
  function _interopNamespaceDefault(e) {
11
12
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -25,14 +26,14 @@ function _interopNamespaceDefault(e) {
25
26
  }
26
27
  const token__namespace = /* @__PURE__ */ _interopNamespaceDefault(token);
27
28
  const InlineQuote = (props) => {
28
- const { isSizeLarge, image: image$1 } = props;
29
+ const { isSizeLarge, image: image$1, isTypeFeatured = false } = props;
29
30
  const textContainer = text(props);
30
31
  const getInlineWrapperChildren = (props2) => {
31
32
  const wrapperChildren2 = [];
32
33
  if (image$1) {
33
34
  const imageContainer = image({
34
35
  ...props2,
35
- isTypeFeatured: false,
36
+ isTypeFeatured,
36
37
  image: image$1
37
38
  });
38
39
  wrapperChildren2.push(imageContainer);
@@ -69,11 +70,18 @@ const InlineQuote = (props) => {
69
70
  };
70
71
  const wrapperChildren = getInlineWrapperChildren(props);
71
72
  const wrapper = createWrapper(wrapperChildren);
72
- animation.quoteAnimation({
73
- ...props,
74
- quoteElement: wrapper
75
- });
76
- return createContainer(wrapper);
73
+ const loadAnimation = () => {
74
+ animation.quoteAnimation({
75
+ ...props,
76
+ quoteElement: wrapper
77
+ });
78
+ };
79
+ return {
80
+ ...createContainer(wrapper),
81
+ events: {
82
+ loadAnimation
83
+ }
84
+ };
77
85
  };
78
86
  module.exports = InlineQuote;
79
87
  //# sourceMappingURL=inline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inline.js","sources":["../../../source/composite/quote/inline.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { ElementModel } from 'model';\nimport { image as elementImage, text as elementText } from './elements';\nimport { quoteAnimation } from './helper/animation';\nimport { SMALL } from './_constants';\nimport { type QuoteInlineProps } from './_types';\nimport { type ElementVisual } from '../../_types';\n\nexport default (props: QuoteInlineProps) => {\n const { isSizeLarge, image } = props;\n const textContainer = elementText(props);\n const getInlineWrapperChildren = (props: QuoteInlineProps) => {\n const wrapperChildren: ElementVisual[] = [];\n\n if (image) {\n const imageContainer = elementImage({\n ...props,\n isTypeFeatured: false,\n image,\n });\n\n wrapperChildren.push(imageContainer);\n }\n\n wrapperChildren.push(textContainer);\n return wrapperChildren;\n };\n\n const createWrapper = (children: ElementVisual[]) => {\n return ElementModel.createDiv({\n className: 'quote-inline-container-wrapper',\n children: children,\n elementStyles: {\n element: {\n [`@container (min-width: ${SMALL}px)`]: {\n display: 'flex',\n gap: token.spacing.lg,\n ...(isSizeLarge && { gap: token.spacing.xl }),\n },\n },\n },\n });\n };\n\n const createContainer = (wrapper: ElementVisual) => {\n return ElementModel.createDiv({\n className: 'quote-inline-container',\n children: [wrapper],\n elementStyles: {\n element: {\n containerType: 'inline-size',\n width: '100%',\n },\n },\n });\n };\n\n const wrapperChildren = getInlineWrapperChildren(props);\n const wrapper = createWrapper(wrapperChildren);\n\n quoteAnimation({\n ...props,\n quoteElement: wrapper,\n });\n\n return createContainer(wrapper);\n};\n"],"names":["image","elementText","props","wrapperChildren","elementImage","ElementModel.createDiv","SMALL","token","wrapper","quoteAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAA,cAAe,CAAC,UAA4B;AAC1C,QAAM,EAAE,oBAAaA,QAAA,IAAU;AAC/B,QAAM,gBAAgBC,KAAY,KAAK;AACvC,QAAM,2BAA2B,CAACC,WAA4B;AAC5D,UAAMC,mBAAmC,CAAA;AAEzC,QAAIH,SAAO;AACT,YAAM,iBAAiBI,MAAa;AAAA,QAClC,GAAGF;AAAAA,QACH,gBAAgB;AAAA,QAAA,OAChBF;AAAAA,MAAA,CACD;AAEDG,uBAAgB,KAAK,cAAc;AAAA,IACrC;AAEAA,qBAAgB,KAAK,aAAa;AAClC,WAAOA;AAAAA,EACT;AAEA,QAAM,gBAAgB,CAAC,aAA8B;AACnD,WAAOE,gBAAuB;AAAA,MAC5B,WAAW;AAAA,MACX;AAAA,MACA,eAAe;AAAA,QACb,SAAS;AAAA,UACP,CAAC,0BAA0BC,gBAAK,KAAK,GAAG;AAAA,YACtC,SAAS;AAAA,YACT,KAAKC,iBAAM,QAAQ;AAAA,YACnB,GAAI,eAAe,EAAE,KAAKA,iBAAM,QAAQ,GAAA;AAAA,UAAG;AAAA,QAC7C;AAAA,MACF;AAAA,IACF,CACD;AAAA,EACH;AAEA,QAAM,kBAAkB,CAACC,aAA2B;AAClD,WAAOH,gBAAuB;AAAA,MAC5B,WAAW;AAAA,MACX,UAAU,CAACG,QAAO;AAAA,MAClB,eAAe;AAAA,QACb,SAAS;AAAA,UACP,eAAe;AAAA,UACf,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF,CACD;AAAA,EACH;AAEA,QAAM,kBAAkB,yBAAyB,KAAK;AACtD,QAAM,UAAU,cAAc,eAAe;AAE7CC,2BAAe;AAAA,IACb,GAAG;AAAA,IACH,cAAc;AAAA,EAAA,CACf;AAED,SAAO,gBAAgB,OAAO;AAChC;;"}
1
+ {"version":3,"file":"inline.js","sources":["../../../source/composite/quote/inline.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { ElementModel } from 'model';\nimport { image as elementImage, text as elementText } from './elements';\nimport { quoteAnimation } from './helper/animation';\nimport { SMALL } from './_constants';\nimport { type QuoteInlineProps } from './_types';\nimport { type ElementVisual } from '../../_types';\n\nexport default (props: QuoteInlineProps) => {\n const { isSizeLarge, image, isTypeFeatured = false } = props;\n const textContainer = elementText(props);\n const getInlineWrapperChildren = (props: QuoteInlineProps) => {\n const wrapperChildren: ElementVisual[] = [];\n\n if (image) {\n const imageContainer = elementImage({\n ...props,\n isTypeFeatured,\n image,\n });\n\n wrapperChildren.push(imageContainer);\n }\n\n wrapperChildren.push(textContainer);\n return wrapperChildren;\n };\n\n const createWrapper = (children: ElementVisual[]) => {\n return ElementModel.createDiv({\n className: 'quote-inline-container-wrapper',\n children: children,\n elementStyles: {\n element: {\n [`@container (min-width: ${SMALL}px)`]: {\n display: 'flex',\n gap: token.spacing.lg,\n ...(isSizeLarge && { gap: token.spacing.xl }),\n },\n },\n },\n });\n };\n\n const createContainer = (wrapper: ElementVisual) => {\n return ElementModel.createDiv({\n className: 'quote-inline-container',\n children: [wrapper],\n elementStyles: {\n element: {\n containerType: 'inline-size',\n width: '100%',\n },\n },\n });\n };\n\n const wrapperChildren = getInlineWrapperChildren(props);\n const wrapper = createWrapper(wrapperChildren);\n\n const loadAnimation = () => {\n quoteAnimation({\n ...props,\n quoteElement: wrapper,\n });\n };\n\n return {\n ...createContainer(wrapper),\n events: {\n loadAnimation,\n },\n };\n};\n"],"names":["image","elementText","props","wrapperChildren","elementImage","ElementModel.createDiv","SMALL","token","wrapper","quoteAnimation"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAA,cAAe,CAAC,UAA4B;AAC1C,QAAM,EAAE,aAAA,OAAaA,SAAO,iBAAiB,UAAU;AACvD,QAAM,gBAAgBC,KAAY,KAAK;AACvC,QAAM,2BAA2B,CAACC,WAA4B;AAC5D,UAAMC,mBAAmC,CAAA;AAEzC,QAAIH,SAAO;AACT,YAAM,iBAAiBI,MAAa;AAAA,QAClC,GAAGF;AAAAA,QACH;AAAA,QAAA,OACAF;AAAAA,MAAA,CACD;AAEDG,uBAAgB,KAAK,cAAc;AAAA,IACrC;AAEAA,qBAAgB,KAAK,aAAa;AAClC,WAAOA;AAAAA,EACT;AAEA,QAAM,gBAAgB,CAAC,aAA8B;AACnD,WAAOE,gBAAuB;AAAA,MAC5B,WAAW;AAAA,MACX;AAAA,MACA,eAAe;AAAA,QACb,SAAS;AAAA,UACP,CAAC,0BAA0BC,gBAAK,KAAK,GAAG;AAAA,YACtC,SAAS;AAAA,YACT,KAAKC,iBAAM,QAAQ;AAAA,YACnB,GAAI,eAAe,EAAE,KAAKA,iBAAM,QAAQ,GAAA;AAAA,UAAG;AAAA,QAC7C;AAAA,MACF;AAAA,IACF,CACD;AAAA,EACH;AAEA,QAAM,kBAAkB,CAACC,aAA2B;AAClD,WAAOH,gBAAuB;AAAA,MAC5B,WAAW;AAAA,MACX,UAAU,CAACG,QAAO;AAAA,MAClB,eAAe;AAAA,QACb,SAAS;AAAA,UACP,eAAe;AAAA,UACf,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF,CACD;AAAA,EACH;AAEA,QAAM,kBAAkB,yBAAyB,KAAK;AACtD,QAAM,UAAU,cAAc,eAAe;AAE7C,QAAM,gBAAgB,MAAM;AAC1BC,6BAAe;AAAA,MACb,GAAG;AAAA,MACH,cAAc;AAAA,IAAA,CACf;AAAA,EACH;AAEA,SAAO;AAAA,IACL,GAAG,gBAAgB,OAAO;AAAA,IAC1B,QAAQ;AAAA,MACN;AAAA,IAAA;AAAA,EACF;AAEJ;;"}
@@ -5,16 +5,17 @@ import elementText from "./elements/text.mjs";
5
5
  import "@universityofmaryland/web-icons-library/brand";
6
6
  import { SMALL } from "./_constants.mjs";
7
7
  import "@universityofmaryland/web-styles-library/layout";
8
+ import "@universityofmaryland/web-styles-library/typography";
8
9
  import { quoteAnimation } from "./helper/animation.mjs";
9
10
  const InlineQuote = (props) => {
10
- const { isSizeLarge, image } = props;
11
+ const { isSizeLarge, image, isTypeFeatured = false } = props;
11
12
  const textContainer = elementText(props);
12
13
  const getInlineWrapperChildren = (props2) => {
13
14
  const wrapperChildren2 = [];
14
15
  if (image) {
15
16
  const imageContainer = elementImage({
16
17
  ...props2,
17
- isTypeFeatured: false,
18
+ isTypeFeatured,
18
19
  image
19
20
  });
20
21
  wrapperChildren2.push(imageContainer);
@@ -51,11 +52,18 @@ const InlineQuote = (props) => {
51
52
  };
52
53
  const wrapperChildren = getInlineWrapperChildren(props);
53
54
  const wrapper = createWrapper(wrapperChildren);
54
- quoteAnimation({
55
- ...props,
56
- quoteElement: wrapper
57
- });
58
- return createContainer(wrapper);
55
+ const loadAnimation = () => {
56
+ quoteAnimation({
57
+ ...props,
58
+ quoteElement: wrapper
59
+ });
60
+ };
61
+ return {
62
+ ...createContainer(wrapper),
63
+ events: {
64
+ loadAnimation
65
+ }
66
+ };
59
67
  };
60
68
  export {
61
69
  InlineQuote as default
@@ -1 +1 @@
1
- {"version":3,"file":"inline.mjs","sources":["../../../source/composite/quote/inline.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { ElementModel } from 'model';\nimport { image as elementImage, text as elementText } from './elements';\nimport { quoteAnimation } from './helper/animation';\nimport { SMALL } from './_constants';\nimport { type QuoteInlineProps } from './_types';\nimport { type ElementVisual } from '../../_types';\n\nexport default (props: QuoteInlineProps) => {\n const { isSizeLarge, image } = props;\n const textContainer = elementText(props);\n const getInlineWrapperChildren = (props: QuoteInlineProps) => {\n const wrapperChildren: ElementVisual[] = [];\n\n if (image) {\n const imageContainer = elementImage({\n ...props,\n isTypeFeatured: false,\n image,\n });\n\n wrapperChildren.push(imageContainer);\n }\n\n wrapperChildren.push(textContainer);\n return wrapperChildren;\n };\n\n const createWrapper = (children: ElementVisual[]) => {\n return ElementModel.createDiv({\n className: 'quote-inline-container-wrapper',\n children: children,\n elementStyles: {\n element: {\n [`@container (min-width: ${SMALL}px)`]: {\n display: 'flex',\n gap: token.spacing.lg,\n ...(isSizeLarge && { gap: token.spacing.xl }),\n },\n },\n },\n });\n };\n\n const createContainer = (wrapper: ElementVisual) => {\n return ElementModel.createDiv({\n className: 'quote-inline-container',\n children: [wrapper],\n elementStyles: {\n element: {\n containerType: 'inline-size',\n width: '100%',\n },\n },\n });\n };\n\n const wrapperChildren = getInlineWrapperChildren(props);\n const wrapper = createWrapper(wrapperChildren);\n\n quoteAnimation({\n ...props,\n quoteElement: wrapper,\n });\n\n return createContainer(wrapper);\n};\n"],"names":["props","wrapperChildren","ElementModel.createDiv","wrapper"],"mappings":";;;;;;;;AAQA,MAAA,cAAe,CAAC,UAA4B;AAC1C,QAAM,EAAE,aAAa,MAAA,IAAU;AAC/B,QAAM,gBAAgB,YAAY,KAAK;AACvC,QAAM,2BAA2B,CAACA,WAA4B;AAC5D,UAAMC,mBAAmC,CAAA;AAEzC,QAAI,OAAO;AACT,YAAM,iBAAiB,aAAa;AAAA,QAClC,GAAGD;AAAAA,QACH,gBAAgB;AAAA,QAChB;AAAA,MAAA,CACD;AAEDC,uBAAgB,KAAK,cAAc;AAAA,IACrC;AAEAA,qBAAgB,KAAK,aAAa;AAClC,WAAOA;AAAAA,EACT;AAEA,QAAM,gBAAgB,CAAC,aAA8B;AACnD,WAAOC,UAAuB;AAAA,MAC5B,WAAW;AAAA,MACX;AAAA,MACA,eAAe;AAAA,QACb,SAAS;AAAA,UACP,CAAC,0BAA0B,KAAK,KAAK,GAAG;AAAA,YACtC,SAAS;AAAA,YACT,KAAK,MAAM,QAAQ;AAAA,YACnB,GAAI,eAAe,EAAE,KAAK,MAAM,QAAQ,GAAA;AAAA,UAAG;AAAA,QAC7C;AAAA,MACF;AAAA,IACF,CACD;AAAA,EACH;AAEA,QAAM,kBAAkB,CAACC,aAA2B;AAClD,WAAOD,UAAuB;AAAA,MAC5B,WAAW;AAAA,MACX,UAAU,CAACC,QAAO;AAAA,MAClB,eAAe;AAAA,QACb,SAAS;AAAA,UACP,eAAe;AAAA,UACf,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF,CACD;AAAA,EACH;AAEA,QAAM,kBAAkB,yBAAyB,KAAK;AACtD,QAAM,UAAU,cAAc,eAAe;AAE7C,iBAAe;AAAA,IACb,GAAG;AAAA,IACH,cAAc;AAAA,EAAA,CACf;AAED,SAAO,gBAAgB,OAAO;AAChC;"}
1
+ {"version":3,"file":"inline.mjs","sources":["../../../source/composite/quote/inline.ts"],"sourcesContent":["import * as token from '@universityofmaryland/web-styles-library/token';\nimport { ElementModel } from 'model';\nimport { image as elementImage, text as elementText } from './elements';\nimport { quoteAnimation } from './helper/animation';\nimport { SMALL } from './_constants';\nimport { type QuoteInlineProps } from './_types';\nimport { type ElementVisual } from '../../_types';\n\nexport default (props: QuoteInlineProps) => {\n const { isSizeLarge, image, isTypeFeatured = false } = props;\n const textContainer = elementText(props);\n const getInlineWrapperChildren = (props: QuoteInlineProps) => {\n const wrapperChildren: ElementVisual[] = [];\n\n if (image) {\n const imageContainer = elementImage({\n ...props,\n isTypeFeatured,\n image,\n });\n\n wrapperChildren.push(imageContainer);\n }\n\n wrapperChildren.push(textContainer);\n return wrapperChildren;\n };\n\n const createWrapper = (children: ElementVisual[]) => {\n return ElementModel.createDiv({\n className: 'quote-inline-container-wrapper',\n children: children,\n elementStyles: {\n element: {\n [`@container (min-width: ${SMALL}px)`]: {\n display: 'flex',\n gap: token.spacing.lg,\n ...(isSizeLarge && { gap: token.spacing.xl }),\n },\n },\n },\n });\n };\n\n const createContainer = (wrapper: ElementVisual) => {\n return ElementModel.createDiv({\n className: 'quote-inline-container',\n children: [wrapper],\n elementStyles: {\n element: {\n containerType: 'inline-size',\n width: '100%',\n },\n },\n });\n };\n\n const wrapperChildren = getInlineWrapperChildren(props);\n const wrapper = createWrapper(wrapperChildren);\n\n const loadAnimation = () => {\n quoteAnimation({\n ...props,\n quoteElement: wrapper,\n });\n };\n\n return {\n ...createContainer(wrapper),\n events: {\n loadAnimation,\n },\n };\n};\n"],"names":["props","wrapperChildren","ElementModel.createDiv","wrapper"],"mappings":";;;;;;;;;AAQA,MAAA,cAAe,CAAC,UAA4B;AAC1C,QAAM,EAAE,aAAa,OAAO,iBAAiB,UAAU;AACvD,QAAM,gBAAgB,YAAY,KAAK;AACvC,QAAM,2BAA2B,CAACA,WAA4B;AAC5D,UAAMC,mBAAmC,CAAA;AAEzC,QAAI,OAAO;AACT,YAAM,iBAAiB,aAAa;AAAA,QAClC,GAAGD;AAAAA,QACH;AAAA,QACA;AAAA,MAAA,CACD;AAEDC,uBAAgB,KAAK,cAAc;AAAA,IACrC;AAEAA,qBAAgB,KAAK,aAAa;AAClC,WAAOA;AAAAA,EACT;AAEA,QAAM,gBAAgB,CAAC,aAA8B;AACnD,WAAOC,UAAuB;AAAA,MAC5B,WAAW;AAAA,MACX;AAAA,MACA,eAAe;AAAA,QACb,SAAS;AAAA,UACP,CAAC,0BAA0B,KAAK,KAAK,GAAG;AAAA,YACtC,SAAS;AAAA,YACT,KAAK,MAAM,QAAQ;AAAA,YACnB,GAAI,eAAe,EAAE,KAAK,MAAM,QAAQ,GAAA;AAAA,UAAG;AAAA,QAC7C;AAAA,MACF;AAAA,IACF,CACD;AAAA,EACH;AAEA,QAAM,kBAAkB,CAACC,aAA2B;AAClD,WAAOD,UAAuB;AAAA,MAC5B,WAAW;AAAA,MACX,UAAU,CAACC,QAAO;AAAA,MAClB,eAAe;AAAA,QACb,SAAS;AAAA,UACP,eAAe;AAAA,UACf,OAAO;AAAA,QAAA;AAAA,MACT;AAAA,IACF,CACD;AAAA,EACH;AAEA,QAAM,kBAAkB,yBAAyB,KAAK;AACtD,QAAM,UAAU,cAAc,eAAe;AAE7C,QAAM,gBAAgB,MAAM;AAC1B,mBAAe;AAAA,MACb,GAAG;AAAA,MACH,cAAc;AAAA,IAAA,CACf;AAAA,EACH;AAEA,SAAO;AAAA,IACL,GAAG,gBAAgB,OAAO;AAAA,IAC1B,QAAQ;AAAA,MACN;AAAA,IAAA;AAAA,EACF;AAEJ;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universityofmaryland/web-elements-library",
3
- "version": "1.5.0-beta.0",
3
+ "version": "1.5.0",
4
4
  "description": "UMD Web Elements",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",