@yatoday/astro-ui 0.18.2 → 0.18.4

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 (47) hide show
  1. package/components/Analytics/AnalyticsGTM.astro +3 -3
  2. package/components/Analytics/AnalyticsGTMBody.astro +16 -12
  3. package/components/Analytics/AnalyticsGoogle.astro +3 -1
  4. package/components/BreadcrumbsItem/BreadcrumbsItem.astro +8 -1
  5. package/components/Button/types.ts +2 -1
  6. package/components/CallToAction/CallToAction.astro +1 -1
  7. package/components/Card0/Card0.astro +20 -32
  8. package/components/Card1/Card1.astro +11 -19
  9. package/components/Card2/Card2.astro +10 -14
  10. package/components/Card3/Card3.astro +15 -20
  11. package/components/Card4/Card4.astro +6 -2
  12. package/components/Card5/Card5.astro +8 -1
  13. package/components/Card6/Card6.astro +76 -59
  14. package/components/Card7/Card7.astro +27 -18
  15. package/components/CookieConsent/CookieConsent.astro +323 -308
  16. package/components/CopyToClipboard/CopyToClipboard.astro +6 -14
  17. package/components/CopyToClipboard/copy.ts +1 -1
  18. package/components/DarkMode/__tests__/DarkMode.test.ts +8 -8
  19. package/components/Headline/Headline.astro +4 -1
  20. package/components/HeroSection/HeroSection.astro +13 -16
  21. package/components/Image/Image.astro +1 -7
  22. package/components/ImageGallery/ImageGallery.astro +85 -90
  23. package/components/ImageGalleryIkea/ImageGalleryIkea.astro +3 -2
  24. package/components/ImagePreload/ImagePreload.astro +22 -20
  25. package/components/ItemGrid1/ItemGrid1.astro +34 -24
  26. package/components/Metadata/Metadata.astro +1 -5
  27. package/components/PointMap/PointMap.astro +62 -48
  28. package/components/PointMap/types.ts +3 -3
  29. package/components/SEO/SEO.astro +34 -33
  30. package/components/WidgetBrands/WidgetBrands.astro +8 -1
  31. package/components/WidgetContent/WidgetContent.astro +22 -9
  32. package/components/WidgetContent/types.ts +1 -1
  33. package/components/WidgetFeaturesCard/WidgetFeaturesCard.astro +10 -2
  34. package/components/WidgetHeroSlider/WidgetHeroSlider.astro +6 -1
  35. package/components/WidgetNavbarFlyout/WidgetNavbarFlyout.astro +16 -7
  36. package/components/WidgetSwiperPhotoSlider/WidgetSwiperPhotoSlider.astro +18 -7
  37. package/components/WidgetTestimonials/WidgetTestimonials.astro +8 -1
  38. package/components/WidgetWrapper/WidgetWrapper.astro +11 -2
  39. package/index.d.ts +20 -20
  40. package/package.json +11 -9
  41. package/styles/styles.css +303 -160
  42. package/utils/i18n.ts +2 -2
  43. package/utils/images.ts +0 -1
  44. package/utils/slugify.ts +3 -0
  45. package/vendor-config/config.example.yaml +0 -1
  46. package/vendor-config/index.ts +1 -1
  47. package/vendor-config/utils/loadConfig.ts +15 -18
package/utils/i18n.ts CHANGED
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  // Dynamic imports to handle case when i18n is not enabled
7
- let i18nConfig: { locales?: unknown[]; defaultLocale?: string } | null = null;
8
- let toCodesFunction: ((locales: unknown[]) => string[]) | null = null;
7
+ const i18nConfig: { locales?: unknown[]; defaultLocale?: string } | null = null;
8
+ const toCodesFunction: ((locales: unknown[]) => string[]) | null = null;
9
9
 
10
10
  // Try to load i18n modules - they may not be available if i18n is not configured
11
11
  try {
package/utils/images.ts CHANGED
@@ -6,7 +6,6 @@ import type { ImageMetadata } from 'astro';
6
6
  const load = async function () {
7
7
  let images: Record<string, () => Promise<unknown>> | undefined;
8
8
  try {
9
- // @ts-ignore
10
9
  images = import.meta.glob(
11
10
  '/src/assets/images/**/*.{jpeg,jpg,png,tiff,webp,gif,svg,JPEG,JPG,PNG,TIFF,WEBP,GIF,SVG}'
12
11
  );
package/utils/slugify.ts CHANGED
@@ -16,6 +16,9 @@ interface CharMap {
16
16
  }
17
17
 
18
18
  const charMap: CharMap = JSON.parse(
19
+ // The \" sequences are redundant for this single-quoted JS string but are part of the
20
+ // embedded JSON payload (they encode a literal " for the smart-quote entries); leave them.
21
+ // eslint-disable-next-line no-useless-escape
19
22
  '{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E\'","Ը":"Y\'","Թ":"T\'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C\'","Կ":"K","Հ":"H","Ձ":"D\'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R\'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P\'","Ք":"Q\'","Օ":"O\'\'","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"\'","’":"\'","“":"\\\"","”":"\\\"","„":"\\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}'
20
23
  );
21
24
 
@@ -88,7 +88,6 @@ analytics:
88
88
  ui:
89
89
  # Options: 'system' | 'light' | 'dark' | 'light:only' | 'dark:only'
90
90
  theme: '${UI_THEME:system}'
91
-
92
91
  # Example: Custom API Configuration
93
92
  # (Add this section if your application needs external APIs)
94
93
  # api:
@@ -26,7 +26,7 @@ export default ({ config: _themeConfig = 'src/config.yaml' } = {}): AstroIntegra
26
26
  const resolvedVirtualModuleId = `\0${virtualModuleId}`;
27
27
 
28
28
  const rawJsonConfig = (await loadConfig(_themeConfig)) as Config;
29
- const { SITE, I18N, METADATA, APP_BLOG, UI, ANALYTICS} = configBuilder(rawJsonConfig);
29
+ const { SITE, I18N, METADATA, APP_BLOG, UI, ANALYTICS } = configBuilder(rawJsonConfig);
30
30
 
31
31
  updateConfig({
32
32
  site: SITE.site,
@@ -18,25 +18,22 @@ import fs from 'node:fs';
18
18
  * // Returns: 'https://example.com'
19
19
  */
20
20
  const interpolateEnvVars = (content: string): string => {
21
- return content.replace(
22
- /\$\{([A-Z_][A-Z0-9_]*):?([^}]*)\}/g,
23
- (match, varName, defaultValue) => {
24
- const envValue = process.env[varName];
25
-
26
- // If env var exists, use it
27
- if (envValue !== undefined) {
28
- return envValue;
29
- }
30
-
31
- // If default value provided, use it
32
- if (defaultValue !== '') {
33
- return defaultValue;
34
- }
35
-
36
- // Otherwise, keep the original placeholder
37
- return match;
21
+ return content.replace(/\$\{([A-Z_][A-Z0-9_]*):?([^}]*)\}/g, (match, varName, defaultValue) => {
22
+ const envValue = process.env[varName];
23
+
24
+ // If env var exists, use it
25
+ if (envValue !== undefined) {
26
+ return envValue;
27
+ }
28
+
29
+ // If default value provided, use it
30
+ if (defaultValue !== '') {
31
+ return defaultValue;
38
32
  }
39
- );
33
+
34
+ // Otherwise, keep the original placeholder
35
+ return match;
36
+ });
40
37
  };
41
38
 
42
39
  const loadConfig = async (configPathOrData: string | object) => {