tst.stan.xbe.shared2 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/xbe-lib/src/component-props/index.d.ts +55 -0
- package/dist/xbe-lib/src/component-props/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/component-props/index.js +1 -0
- package/dist/xbe-lib/src/index.d.ts +8 -0
- package/dist/xbe-lib/src/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/index.js +7 -0
- package/dist/xbe-lib/src/middleware/index.d.ts +2 -0
- package/dist/xbe-lib/src/middleware/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/middleware/index.js +3 -0
- package/dist/xbe-lib/src/services/CacheService/InMemoryCacheProvider.d.ts +26 -0
- package/dist/xbe-lib/src/services/CacheService/InMemoryCacheProvider.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/CacheService/InMemoryCacheProvider.js +50 -0
- package/dist/xbe-lib/src/services/CacheService/VercelEdgeCacheService.d.ts +26 -0
- package/dist/xbe-lib/src/services/CacheService/VercelEdgeCacheService.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/CacheService/VercelEdgeCacheService.js +37 -0
- package/dist/xbe-lib/src/services/CacheService/index.d.ts +53 -0
- package/dist/xbe-lib/src/services/CacheService/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/CacheService/index.js +55 -0
- package/dist/xbe-lib/src/services/NavigationService/NavigationService.d.ts +61 -0
- package/dist/xbe-lib/src/services/NavigationService/NavigationService.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/NavigationService.js +82 -0
- package/dist/xbe-lib/src/services/NavigationService/index.d.ts +4 -0
- package/dist/xbe-lib/src/services/NavigationService/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/index.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/ItemSearchResults.d.ts +5 -0
- package/dist/xbe-lib/src/services/NavigationService/models/ItemSearchResults.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/ItemSearchResults.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/LinkField.d.ts +19 -0
- package/dist/xbe-lib/src/services/NavigationService/models/LinkField.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/LinkField.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationCTA.d.ts +11 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationCTA.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationCTA.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationDataSourceResponse.d.ts +5 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationDataSourceResponse.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationDataSourceResponse.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationDropdown.d.ts +14 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationDropdown.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationDropdown.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationFolder.d.ts +12 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationFolder.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationFolder.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationGroup.d.ts +10 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationGroup.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationGroup.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationItem.d.ts +9 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationItem.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/NavigationItem.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/TextField.d.ts +5 -0
- package/dist/xbe-lib/src/services/NavigationService/models/TextField.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/TextField.js +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/index.d.ts +10 -0
- package/dist/xbe-lib/src/services/NavigationService/models/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/models/index.js +9 -0
- package/dist/xbe-lib/src/services/NavigationService/queries/navigation-datasource.graphql.d.ts +2 -0
- package/dist/xbe-lib/src/services/NavigationService/queries/navigation-datasource.graphql.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/NavigationService/queries/navigation-datasource.graphql.js +62 -0
- package/dist/xbe-lib/src/services/SxaService/constants.d.ts +44 -0
- package/dist/xbe-lib/src/services/SxaService/constants.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/constants.js +43 -0
- package/dist/xbe-lib/src/services/SxaService/index.d.ts +166 -0
- package/dist/xbe-lib/src/services/SxaService/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/index.js +319 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoCollection.d.ts +21 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoCollection.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoCollection.js +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoCollectionResult.d.ts +17 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoCollectionResult.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoCollectionResult.js +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoQueryResult.d.ts +15 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoQueryResult.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/SiteInfoQueryResult.js +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/Tenant.d.ts +17 -0
- package/dist/xbe-lib/src/services/SxaService/models/Tenant.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/Tenant.js +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/TenantQueryResult.d.ts +49 -0
- package/dist/xbe-lib/src/services/SxaService/models/TenantQueryResult.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/TenantQueryResult.js +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/TenantSite.d.ts +19 -0
- package/dist/xbe-lib/src/services/SxaService/models/TenantSite.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/TenantSite.js +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/index.d.ts +7 -0
- package/dist/xbe-lib/src/services/SxaService/models/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/models/index.js +1 -0
- package/dist/xbe-lib/src/services/SxaService/queries/index.d.ts +2 -0
- package/dist/xbe-lib/src/services/SxaService/queries/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/queries/index.js +1 -0
- package/dist/xbe-lib/src/services/SxaService/queries/queryTenantData.d.ts +19 -0
- package/dist/xbe-lib/src/services/SxaService/queries/queryTenantData.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/SxaService/queries/queryTenantData.js +84 -0
- package/dist/xbe-lib/src/services/index.d.ts +6 -0
- package/dist/xbe-lib/src/services/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/services/index.js +7 -0
- package/dist/xbe-lib/src/sitecore/SitecoreConfigLoader.d.ts +16 -0
- package/dist/xbe-lib/src/sitecore/SitecoreConfigLoader.d.ts.map +1 -0
- package/dist/xbe-lib/src/sitecore/SitecoreConfigLoader.js +22 -0
- package/dist/xbe-lib/src/sitecore/createSitecoreClient.d.ts +29 -0
- package/dist/xbe-lib/src/sitecore/createSitecoreClient.d.ts.map +1 -0
- package/dist/xbe-lib/src/sitecore/createSitecoreClient.js +26 -0
- package/dist/xbe-lib/src/sitecore/fetchComponentData.d.ts +37 -0
- package/dist/xbe-lib/src/sitecore/fetchComponentData.d.ts.map +1 -0
- package/dist/xbe-lib/src/sitecore/fetchComponentData.js +44 -0
- package/dist/xbe-lib/src/utils/debug.d.ts +40 -0
- package/dist/xbe-lib/src/utils/debug.d.ts.map +1 -0
- package/dist/xbe-lib/src/utils/debug.js +37 -0
- package/dist/xbe-lib/src/utils/index.d.ts +6 -0
- package/dist/xbe-lib/src/utils/index.d.ts.map +1 -0
- package/dist/xbe-lib/src/utils/index.js +7 -0
- package/dist/xbe-lib/src/utils/isServer.d.ts +24 -0
- package/dist/xbe-lib/src/utils/isServer.d.ts.map +1 -0
- package/dist/xbe-lib/src/utils/isServer.js +25 -0
- package/dist/xbe-lib/src/utils/sitecorePathExtractor.d.ts +53 -0
- package/dist/xbe-lib/src/utils/sitecorePathExtractor.d.ts.map +1 -0
- package/dist/xbe-lib/src/utils/sitecorePathExtractor.js +236 -0
- package/dist/xbe-ui/src/components/basic/icon/icon.d.ts +59 -0
- package/dist/xbe-ui/src/components/basic/icon/icon.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/basic/icon/icon.js +83 -0
- package/dist/xbe-ui/src/components/basic/image/image.d.ts +54 -0
- package/dist/xbe-ui/src/components/basic/image/image.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/basic/image/image.js +47 -0
- package/dist/xbe-ui/src/components/basic/richtext/richtext.d.ts +36 -0
- package/dist/xbe-ui/src/components/basic/richtext/richtext.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/basic/richtext/richtext.js +16 -0
- package/dist/xbe-ui/src/components/basic/text/text.d.ts +30 -0
- package/dist/xbe-ui/src/components/basic/text/text.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/basic/text/text.js +42 -0
- package/dist/xbe-ui/src/components/basic/video/video.d.ts +48 -0
- package/dist/xbe-ui/src/components/basic/video/video.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/basic/video/video.js +37 -0
- package/dist/xbe-ui/src/components/collections/accordion/accordion-item.d.ts +16 -0
- package/dist/xbe-ui/src/components/collections/accordion/accordion-item.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/accordion/accordion-item.js +27 -0
- package/dist/xbe-ui/src/components/collections/accordion/index.d.ts +12 -0
- package/dist/xbe-ui/src/components/collections/accordion/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/accordion/index.js +17 -0
- package/dist/xbe-ui/src/components/collections/carousel/carousel-slide.d.ts +7 -0
- package/dist/xbe-ui/src/components/collections/carousel/carousel-slide.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/carousel/carousel-slide.js +5 -0
- package/dist/xbe-ui/src/components/collections/carousel/index.d.ts +11 -0
- package/dist/xbe-ui/src/components/collections/carousel/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/carousel/index.js +26 -0
- package/dist/xbe-ui/src/components/collections/content-block/index.d.ts +34 -0
- package/dist/xbe-ui/src/components/collections/content-block/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/content-block/index.js +35 -0
- package/dist/xbe-ui/src/components/collections/content-card/index.d.ts +57 -0
- package/dist/xbe-ui/src/components/collections/content-card/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/content-card/index.js +75 -0
- package/dist/xbe-ui/src/components/collections/duo-block/index.d.ts +24 -0
- package/dist/xbe-ui/src/components/collections/duo-block/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/duo-block/index.js +28 -0
- package/dist/xbe-ui/src/components/collections/icon-card/index.d.ts +38 -0
- package/dist/xbe-ui/src/components/collections/icon-card/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/icon-card/index.js +27 -0
- package/dist/xbe-ui/src/components/collections/link-list/index.d.ts +116 -0
- package/dist/xbe-ui/src/components/collections/link-list/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/link-list/index.js +77 -0
- package/dist/xbe-ui/src/components/collections/maps/index.d.ts +21 -0
- package/dist/xbe-ui/src/components/collections/maps/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/maps/index.js +11 -0
- package/dist/xbe-ui/src/components/collections/profile/index.d.ts +40 -0
- package/dist/xbe-ui/src/components/collections/profile/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/collections/profile/index.js +99 -0
- package/dist/xbe-ui/src/components/layout/grid-container.d.ts +27 -0
- package/dist/xbe-ui/src/components/layout/grid-container.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/layout/grid-container.js +110 -0
- package/dist/xbe-ui/src/components/layout/grid-item.d.ts +32 -0
- package/dist/xbe-ui/src/components/layout/grid-item.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/layout/grid-item.js +57 -0
- package/dist/xbe-ui/src/components/structure/breadcrumb/breadcrumb.d.ts +24 -0
- package/dist/xbe-ui/src/components/structure/breadcrumb/breadcrumb.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/structure/breadcrumb/breadcrumb.js +27 -0
- package/dist/xbe-ui/src/components/system/linkrenderer.d.ts +52 -0
- package/dist/xbe-ui/src/components/system/linkrenderer.d.ts.map +1 -0
- package/dist/xbe-ui/src/components/system/linkrenderer.js +42 -0
- package/dist/xbe-ui/src/hooks/useDisableBodyScroll.d.ts +7 -0
- package/dist/xbe-ui/src/hooks/useDisableBodyScroll.d.ts.map +1 -0
- package/dist/xbe-ui/src/hooks/useDisableBodyScroll.js +24 -0
- package/dist/xbe-ui/src/hooks/useToggle.d.ts +2 -0
- package/dist/xbe-ui/src/hooks/useToggle.d.ts.map +1 -0
- package/dist/xbe-ui/src/hooks/useToggle.js +11 -0
- package/dist/xbe-ui/src/index.d.ts +27 -0
- package/dist/xbe-ui/src/index.d.ts.map +1 -0
- package/dist/xbe-ui/src/index.js +27 -0
- package/dist/xbe-ui/src/lib/utils.d.ts +3 -0
- package/dist/xbe-ui/src/lib/utils.d.ts.map +1 -0
- package/dist/xbe-ui/src/lib/utils.js +5 -0
- package/dist/xbe-ui/src/shardcn/accordion.d.ts +8 -0
- package/dist/xbe-ui/src/shardcn/accordion.d.ts.map +1 -0
- package/dist/xbe-ui/src/shardcn/accordion.js +14 -0
- package/dist/xbe-ui/src/shardcn/carousel.d.ts +29 -0
- package/dist/xbe-ui/src/shardcn/carousel.d.ts.map +1 -0
- package/dist/xbe-ui/src/shardcn/carousel.js +111 -0
- package/dist/xbe-ui/src/types/heading.d.ts +9 -0
- package/dist/xbe-ui/src/types/heading.d.ts.map +1 -0
- package/dist/xbe-ui/src/types/heading.js +1 -0
- package/dist/xbe-ui/src/utils/images/cloudflare-loader.d.ts +4 -0
- package/dist/xbe-ui/src/utils/images/cloudflare-loader.d.ts.map +1 -0
- package/dist/xbe-ui/src/utils/images/cloudflare-loader.js +40 -0
- package/dist/xbe-ui/src/utils/images/default-loader.d.ts +4 -0
- package/dist/xbe-ui/src/utils/images/default-loader.d.ts.map +1 -0
- package/dist/xbe-ui/src/utils/images/default-loader.js +30 -0
- package/dist/xbe-ui/src/utils/images/generate-image-url.d.ts +10 -0
- package/dist/xbe-ui/src/utils/images/generate-image-url.d.ts.map +1 -0
- package/dist/xbe-ui/src/utils/images/generate-image-url.js +28 -0
- package/dist/xbe-ui/src/utils/images/image-loader.d.ts +4 -0
- package/dist/xbe-ui/src/utils/images/image-loader.d.ts.map +1 -0
- package/dist/xbe-ui/src/utils/images/image-loader.js +11 -0
- package/dist/xbe-ui/src/utils/images/raw-loader.d.ts +17 -0
- package/dist/xbe-ui/src/utils/images/raw-loader.d.ts.map +1 -0
- package/dist/xbe-ui/src/utils/images/raw-loader.js +28 -0
- package/dist/xbe-ui/src/utils/url.d.ts +2 -0
- package/dist/xbe-ui/src/utils/url.d.ts.map +1 -0
- package/dist/xbe-ui/src/utils/url.js +22 -0
- package/dist/xbe.shared/src/index.d.ts +2 -0
- package/dist/xbe.shared/src/index.d.ts.map +1 -0
- package/dist/xbe.shared/src/index.js +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IconProps extends Omit<React.SVGProps<SVGSVGElement>, 'ref'> {
|
|
3
|
+
/**
|
|
4
|
+
* Icon identifier - either a Lucide icon name or a Sitecore media path
|
|
5
|
+
* @example "Star", "Home", "Settings", "BookOpen" (Lucide icons)
|
|
6
|
+
* @example "/-/media/Feature/XBE/Icons/Basic/Icon.svg" (Sitecore media)
|
|
7
|
+
* @see https://lucide.dev/icons for available icons
|
|
8
|
+
*/
|
|
9
|
+
identifier: string;
|
|
10
|
+
/**
|
|
11
|
+
* Alt text for Sitecore media icons (ignored for Lucide icons)
|
|
12
|
+
*/
|
|
13
|
+
alt?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Additional CSS classes
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Wrapper CSS classes for background, alignment, etc.
|
|
20
|
+
*/
|
|
21
|
+
wrapperClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Icon Component
|
|
25
|
+
*
|
|
26
|
+
* A flexible icon component that supports both Lucide icons and Sitecore media.
|
|
27
|
+
* Automatically detects the type based on the identifier format.
|
|
28
|
+
*
|
|
29
|
+
* @example Lucide icon
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Icon identifier="Star" />
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example Sitecore media icon
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <Icon identifier="/-/media/Feature/XBE/Icons/Basic/Icon.svg" alt="Icon" />
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example With styling
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <Icon
|
|
42
|
+
* identifier="Star"
|
|
43
|
+
* className="w-6 h-6"
|
|
44
|
+
* stroke="currentColor"
|
|
45
|
+
* fill="none"
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example With CSS variables
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <Icon
|
|
52
|
+
* identifier="Star"
|
|
53
|
+
* style={{ stroke: 'var(--color-primary)' }}
|
|
54
|
+
* />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const Icon: React.FC<IconProps>;
|
|
58
|
+
export default Icon;
|
|
59
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/basic/icon/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC;IAC3E;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAkEpC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as LucideIcons from 'lucide-react';
|
|
3
|
+
import { cn } from '../../../lib/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Get the full Sitecore media URL for an icon
|
|
6
|
+
* @param iconPath - The icon path from Sitecore (e.g., "/-/media/Feature/XBE/Icons/Basic/Icon.svg")
|
|
7
|
+
* @returns Full URL to the icon
|
|
8
|
+
*/
|
|
9
|
+
function getComponentIcon(iconPath) {
|
|
10
|
+
const sitecoreHost = process.env.NEXT_PUBLIC_SITECORE_API_HOST || '';
|
|
11
|
+
return `${sitecoreHost}${iconPath}`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Icon Component
|
|
15
|
+
*
|
|
16
|
+
* A flexible icon component that supports both Lucide icons and Sitecore media.
|
|
17
|
+
* Automatically detects the type based on the identifier format.
|
|
18
|
+
*
|
|
19
|
+
* @example Lucide icon
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <Icon identifier="Star" />
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example Sitecore media icon
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Icon identifier="/-/media/Feature/XBE/Icons/Basic/Icon.svg" alt="Icon" />
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example With styling
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Icon
|
|
32
|
+
* identifier="Star"
|
|
33
|
+
* className="w-6 h-6"
|
|
34
|
+
* stroke="currentColor"
|
|
35
|
+
* fill="none"
|
|
36
|
+
* />
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example With CSS variables
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <Icon
|
|
42
|
+
* identifier="Star"
|
|
43
|
+
* style={{ stroke: 'var(--color-primary)' }}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export const Icon = ({ identifier, alt = '', className, wrapperClassName, ...props }) => {
|
|
48
|
+
// Check if identifier is a Sitecore media path
|
|
49
|
+
const isSitecoreMedia = identifier.startsWith('/-/media/') || identifier.startsWith('/media/');
|
|
50
|
+
const iconElement = isSitecoreMedia ? (_jsx("img", { src: getComponentIcon(identifier), alt: alt, className: cn('icon__icon', className), "aria-hidden": !alt })) : (() => {
|
|
51
|
+
// Normalize icon name to PascalCase for Lucide
|
|
52
|
+
const normalizeIconName = (name) => {
|
|
53
|
+
// First, replace underscores with hyphens for consistency
|
|
54
|
+
const normalized = name.replace(/_/g, '-');
|
|
55
|
+
// If it's already in PascalCase, return as-is
|
|
56
|
+
if (/^[A-Z][a-z]+([A-Z][a-z]+)*$/.test(normalized)) {
|
|
57
|
+
return normalized;
|
|
58
|
+
}
|
|
59
|
+
// If it's kebab-case (contains hyphens), split and convert to PascalCase
|
|
60
|
+
if (normalized.includes('-')) {
|
|
61
|
+
return normalized
|
|
62
|
+
.split('-')
|
|
63
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
64
|
+
.join('');
|
|
65
|
+
}
|
|
66
|
+
// For all other cases (lowercase, uppercase, mixed), capitalize first letter
|
|
67
|
+
return normalized.charAt(0).toUpperCase() + normalized.slice(1).toLowerCase();
|
|
68
|
+
};
|
|
69
|
+
const normalizedName = normalizeIconName(identifier);
|
|
70
|
+
const LucideIcon = LucideIcons[normalizedName];
|
|
71
|
+
if (!LucideIcon) {
|
|
72
|
+
console.warn(`Icon "${identifier}" (normalized to "${normalizedName}") not found in lucide-react`);
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
return (_jsx(LucideIcon, { className: cn('icon__icon', 'icon__size', 'icon__stroke__color', 'icon__fill__color', className), ...props }));
|
|
76
|
+
})();
|
|
77
|
+
// If wrapperClassName is provided (even if empty string), wrap the icon
|
|
78
|
+
if (wrapperClassName !== undefined) {
|
|
79
|
+
return (_jsx("span", { className: cn('icon__wrapper', 'icon__background__color', 'icon__background__shape', 'icon__background__opacity', 'icon__shape', 'icon__opacity', wrapperClassName), children: iconElement }));
|
|
80
|
+
}
|
|
81
|
+
return iconElement;
|
|
82
|
+
};
|
|
83
|
+
export default Icon;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ImageLicenseMetadata {
|
|
3
|
+
creatorName?: string;
|
|
4
|
+
creatorUrl?: string;
|
|
5
|
+
creatorType?: 'Person' | 'Organization';
|
|
6
|
+
creditText?: string;
|
|
7
|
+
copyrightNotice?: string;
|
|
8
|
+
licenseUrl?: string;
|
|
9
|
+
acquireLicensePageUrl?: string;
|
|
10
|
+
contentUrl?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'src' | 'alt' | 'width' | 'height'> {
|
|
13
|
+
/**
|
|
14
|
+
* The image source URL
|
|
15
|
+
*/
|
|
16
|
+
src: string;
|
|
17
|
+
/**
|
|
18
|
+
* Alternative text for the image
|
|
19
|
+
*/
|
|
20
|
+
alt: string;
|
|
21
|
+
/**
|
|
22
|
+
* Width of the image (in pixels)
|
|
23
|
+
*/
|
|
24
|
+
width?: string | number;
|
|
25
|
+
/**
|
|
26
|
+
* Height of the image (in pixels)
|
|
27
|
+
*/
|
|
28
|
+
height?: string | number;
|
|
29
|
+
/**
|
|
30
|
+
* Override width - if provided, height will be calculated to preserve aspect ratio
|
|
31
|
+
*/
|
|
32
|
+
overrideWidth?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Object fit for the image
|
|
35
|
+
*/
|
|
36
|
+
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
37
|
+
/**
|
|
38
|
+
* Border radius for custom corners
|
|
39
|
+
*/
|
|
40
|
+
borderRadius?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Additional CSS classes
|
|
43
|
+
*/
|
|
44
|
+
className?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional JSON-LD image license metadata
|
|
47
|
+
*/
|
|
48
|
+
licenseMetadata?: ImageLicenseMetadata;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A flexible image component with responsive srcset, aspect ratio preservation, and customizable styling.
|
|
52
|
+
*/
|
|
53
|
+
export declare const Image: React.FC<ImageProps>;
|
|
54
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/basic/image/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrH;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;IACjE;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACxC;AAED;;GAEG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAmFtC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import NextImage from "next/image";
|
|
3
|
+
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import { extractParameterFromUrl } from '../../../utils/url';
|
|
5
|
+
import { generateImageUrl } from '../../../utils/images/generate-image-url';
|
|
6
|
+
/**
|
|
7
|
+
* A flexible image component with responsive srcset, aspect ratio preservation, and customizable styling.
|
|
8
|
+
*/
|
|
9
|
+
export const Image = ({ src, alt, width, height, overrideWidth, objectFit = 'cover', borderRadius, className, style, licenseMetadata, ...props }) => {
|
|
10
|
+
const imageClasses = twMerge('image__clipping', 'image__size', 'image__placement', 'img__position', 'img__fit', className);
|
|
11
|
+
// Extract original dimensions from URL if not provided
|
|
12
|
+
const originalWidth = width ? Number(width) : extractParameterFromUrl('w', src);
|
|
13
|
+
const originalHeight = height ? Number(height) : extractParameterFromUrl('h', src);
|
|
14
|
+
// Calculate dimensions with aspect ratio preservation
|
|
15
|
+
let finalWidth = originalWidth;
|
|
16
|
+
let finalHeight = originalHeight;
|
|
17
|
+
if (overrideWidth && originalWidth && originalHeight) {
|
|
18
|
+
const aspectRatio = originalWidth / originalHeight;
|
|
19
|
+
finalWidth = overrideWidth;
|
|
20
|
+
finalHeight = Math.round(overrideWidth / aspectRatio);
|
|
21
|
+
}
|
|
22
|
+
// Generate responsive srcset
|
|
23
|
+
const responsiveSizes = [576, 640, 750, 828, 1080, 1200, 1920, 2040, 3840];
|
|
24
|
+
const srcSet = responsiveSizes
|
|
25
|
+
.map(size => `${generateImageUrl(src, size)} ${size}w`)
|
|
26
|
+
.join(', ');
|
|
27
|
+
const sizes = "(max-width: 640px) 640px, (max-width: 750px) 750px, (max-width: 828px) 828px, (max-width: 1080px) 1080px, (max-width: 1200px) 1200px, (max-width: 1920px) 1920px, (max-width: 2048px) 2048px, 3840px";
|
|
28
|
+
const jsonLd = licenseMetadata
|
|
29
|
+
? {
|
|
30
|
+
'@context': 'https://schema.org',
|
|
31
|
+
'@type': 'ImageObject',
|
|
32
|
+
contentUrl: licenseMetadata.contentUrl ?? src,
|
|
33
|
+
license: licenseMetadata.licenseUrl,
|
|
34
|
+
acquireLicensePage: licenseMetadata.acquireLicensePageUrl,
|
|
35
|
+
creditText: licenseMetadata.creditText,
|
|
36
|
+
copyrightNotice: licenseMetadata.copyrightNotice,
|
|
37
|
+
creator: licenseMetadata.creatorName || licenseMetadata.creatorUrl
|
|
38
|
+
? {
|
|
39
|
+
'@type': licenseMetadata.creatorType ?? 'Person',
|
|
40
|
+
name: licenseMetadata.creatorName,
|
|
41
|
+
url: licenseMetadata.creatorUrl,
|
|
42
|
+
}
|
|
43
|
+
: undefined,
|
|
44
|
+
}
|
|
45
|
+
: undefined;
|
|
46
|
+
return (_jsxs(_Fragment, { children: [_jsx(NextImage, { src: src, alt: alt, width: finalWidth || 1920, height: finalHeight || 1080, sizes: sizes, className: imageClasses, style: style, ...props }), jsonLd && (_jsx("script", { type: "application/ld+json", children: JSON.stringify(jsonLd) }))] }));
|
|
47
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface RichTextProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
|
+
/**
|
|
4
|
+
* The rich text content - can be a React node from Sitecore SDK or other source
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Additional CSS classes
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Text color - falls back to --richtext-color CSS variable if not provided
|
|
13
|
+
*/
|
|
14
|
+
color?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Font family - falls back to --richtext-font-family CSS variable if not provided
|
|
17
|
+
*/
|
|
18
|
+
fontFamily?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Line height - falls back to --richtext-line-height CSS variable if not provided
|
|
21
|
+
*/
|
|
22
|
+
lineHeight?: string | number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A rich text component wrapper that provides consistent styling for rich text content.
|
|
26
|
+
* Use with Sitecore's RichText component or other safe rendering methods.
|
|
27
|
+
*
|
|
28
|
+
* @example With Sitecore SDK
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <RichText>
|
|
31
|
+
* <SitecoreRichText field={field} />
|
|
32
|
+
* </RichText>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare const RichText: React.FC<RichTextProps>;
|
|
36
|
+
//# sourceMappingURL=richtext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"richtext.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/basic/richtext/richtext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC3F;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAe5C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
/**
|
|
4
|
+
* A rich text component wrapper that provides consistent styling for rich text content.
|
|
5
|
+
* Use with Sitecore's RichText component or other safe rendering methods.
|
|
6
|
+
*
|
|
7
|
+
* @example With Sitecore SDK
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <RichText>
|
|
10
|
+
* <SitecoreRichText field={field} />
|
|
11
|
+
* </RichText>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export const RichText = ({ children, className, style, ...props }) => {
|
|
15
|
+
return (_jsx("div", { className: twMerge('richtext__component richtext__color richtext__vertical__alignment enable__vertical__alignment vertical__alignment ', className), ...props, children: children }));
|
|
16
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type TextTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div';
|
|
3
|
+
export interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* The HTML tag to render
|
|
6
|
+
*/
|
|
7
|
+
tag?: TextTag;
|
|
8
|
+
/**
|
|
9
|
+
* The text content to display
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Additional CSS classes
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Text color (Tailwind color classes or custom CSS)
|
|
18
|
+
*/
|
|
19
|
+
color?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A flexible text component that can render as any heading or text tag
|
|
23
|
+
* with customizable styling and color. Supports CSS variables for theming.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Text({ tag, children, className, color, style, ...props }: TextProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare namespace Text {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/basic/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,KAAK,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,MAAM,GAAG,KAAK,CAAC;AAE9E,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAClE;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,EACnB,GAAS,EACT,QAAQ,EACR,SAAS,EACT,KAAK,EACL,KAAK,EACL,GAAG,KAAK,EACT,EAAE,SAAS,kDA0CX;yBAjDe,IAAI"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../../lib/utils';
|
|
3
|
+
/**
|
|
4
|
+
* A flexible text component that can render as any heading or text tag
|
|
5
|
+
* with customizable styling and color. Supports CSS variables for theming.
|
|
6
|
+
*/
|
|
7
|
+
export function Text({ tag = 'p', children, className, color, style, ...props }) {
|
|
8
|
+
// If no children, don't render anything
|
|
9
|
+
if (!children) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const textClasses = cn('title__heading', 'title__color', 'title__alignment', color, // Apply color class if provided (overrides CSS variable)
|
|
13
|
+
className);
|
|
14
|
+
const elementProps = {
|
|
15
|
+
className: textClasses,
|
|
16
|
+
style,
|
|
17
|
+
...props,
|
|
18
|
+
};
|
|
19
|
+
// Render the appropriate tag
|
|
20
|
+
switch (tag) {
|
|
21
|
+
case 'h1':
|
|
22
|
+
return _jsx("h1", { ...elementProps, children: children });
|
|
23
|
+
case 'h2':
|
|
24
|
+
return _jsx("h2", { ...elementProps, children: children });
|
|
25
|
+
case 'h3':
|
|
26
|
+
return _jsx("h3", { ...elementProps, children: children });
|
|
27
|
+
case 'h4':
|
|
28
|
+
return _jsx("h4", { ...elementProps, children: children });
|
|
29
|
+
case 'h5':
|
|
30
|
+
return _jsx("h5", { ...elementProps, children: children });
|
|
31
|
+
case 'h6':
|
|
32
|
+
return _jsx("h6", { ...elementProps, children: children });
|
|
33
|
+
case 'span':
|
|
34
|
+
return _jsx("span", { ...elementProps, children: children });
|
|
35
|
+
case 'div':
|
|
36
|
+
return _jsx("div", { ...elementProps, children: children });
|
|
37
|
+
case 'p':
|
|
38
|
+
default:
|
|
39
|
+
return _jsx("p", { ...elementProps, children: children });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
Text.displayName = 'Text';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
interface VideoProps {
|
|
2
|
+
styles?: string | undefined;
|
|
3
|
+
props: {
|
|
4
|
+
params: {
|
|
5
|
+
"Auto Play"?: string | undefined;
|
|
6
|
+
Fullscreen?: string | undefined;
|
|
7
|
+
MuteSoundtrack?: string | undefined;
|
|
8
|
+
FieldNames?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
fields: {
|
|
11
|
+
data: {
|
|
12
|
+
video: {
|
|
13
|
+
template: {
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
16
|
+
xBE_Icon?: {
|
|
17
|
+
jsonValue: {
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
baseUrl: {
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
videoId: {
|
|
25
|
+
value: string;
|
|
26
|
+
};
|
|
27
|
+
mP4Movie?: {
|
|
28
|
+
value: {
|
|
29
|
+
href?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
posterImage: {
|
|
33
|
+
jsonValue: {
|
|
34
|
+
value: {
|
|
35
|
+
src: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
pageEditing?: boolean;
|
|
44
|
+
allowCustomPoster: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const Video: React.FC<VideoProps>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=video.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/basic/video/video.tsx"],"names":[],"mappings":"AAKA,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE;QACL,MAAM,EAAE;YACN,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YACjC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YAChC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;YACpC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;SACjC,CAAC;QACF,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,KAAK,EAAE;oBACL,QAAQ,EAAE;wBACR,IAAI,EAAE,MAAM,CAAC;qBACd,CAAC;oBACF,QAAQ,CAAC,EAAE;wBACT,SAAS,EAAE;4BACT,KAAK,EAAE,MAAM,CAAC;yBACf,CAAC;qBACH,CAAC;oBACF,OAAO,EAAE;wBACP,KAAK,EAAE,MAAM,CAAC;qBACf,CAAC;oBACF,OAAO,EAAE;wBACP,KAAK,EAAE,MAAM,CAAC;qBACf,CAAC;oBACF,QAAQ,CAAC,EAAE;wBACT,KAAK,EAAE;4BACL,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;yBAC3B,CAAC;qBACH,CAAC;oBACF,WAAW,EAAE;wBACX,SAAS,EAAE;4BACT,KAAK,EAAE;gCACL,GAAG,EAAE,MAAM,CAAC;6BACb,CAAC;yBACH,CAAC;qBACH,CAAC;iBACH,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;IACF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAyCtC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Icon } from "../icon/icon";
|
|
4
|
+
import { useToggle } from "../../../hooks/useToggle";
|
|
5
|
+
export const Video = ({ props, pageEditing, styles }) => {
|
|
6
|
+
const [isPlaying, handleIsPlaying] = useToggle();
|
|
7
|
+
let { template, mP4Movie, baseUrl, videoId, xBE_Icon } = props.fields.data.video;
|
|
8
|
+
const iconIdentifier = xBE_Icon?.jsonValue?.value || 'play';
|
|
9
|
+
const videoSrc = template.name === "Video"
|
|
10
|
+
? (mP4Movie?.value?.href ?? "")
|
|
11
|
+
: `${baseUrl?.value}${videoId?.value}`;
|
|
12
|
+
// Check if custom poster exists, then set posterType accordingly
|
|
13
|
+
const customPoster = props.fields.data.video.posterImage?.jsonValue?.value?.src;
|
|
14
|
+
const posterType = customPoster ? "Custom" : "Default";
|
|
15
|
+
const posterImage = posterType === "Custom" ? customPoster : getDefaultImage(template.name, videoId?.value);
|
|
16
|
+
const autoPlay = props.params["Auto Play"];
|
|
17
|
+
const fullscreen = props.params["Fullscreen"] === "1" ? "fullscreen" : "";
|
|
18
|
+
const muteSoundtrack = props.params["MuteSoundtrack"] === "1";
|
|
19
|
+
return (_jsx("div", { className: styles, children: (pageEditing || !isPlaying) && !(autoPlay === "1" && !pageEditing) ? (_jsx(PosterFrame, { posterImage: posterImage, handleIsPlaying: handleIsPlaying, pageEditing: pageEditing, iconIdentifier: iconIdentifier })) : (_jsx(VideoFrame, { videoSrc: videoSrc, title: template.name, posterImage: posterImage, handleIsPlaying: handleIsPlaying, muteSoundtrack: muteSoundtrack, fullscreen: fullscreen })) }));
|
|
20
|
+
};
|
|
21
|
+
const PosterFrame = ({ posterImage, handleIsPlaying, pageEditing, iconIdentifier, }) => (_jsx("div", { className: "xm-image w-full aspect-video bg-cover bg-center cursor-pointer object-cover group flex items-center justify-center", style: { backgroundImage: `url('${posterImage}')` }, onClick: handleIsPlaying, children: _jsx(Icon, { identifier: iconIdentifier, wrapperClassName: "icon__wrapper icon__background__color icon__shape icon__opacity", className: `text-[100px] text-white opacity-100 ${!pageEditing && "group-hover:text-brand-primary-1"}` }) }));
|
|
22
|
+
const VideoFrame = ({ videoSrc, title, posterImage, fullscreen, muteSoundtrack, handleIsPlaying, }) => (_jsx("div", { className: "xm-image w-full aspect-video bg-cover bg-center object-cover flex items-center justify-center", style: { backgroundImage: `url('${posterImage}')` }, onClick: handleIsPlaying, children: _jsx("iframe", { className: "w-full aspect-video", src: `${videoSrc}?autoplay=1&mute=1`, title: title, allow: `autoplay; ${fullscreen}` }) }));
|
|
23
|
+
// a function to get the default image for the video platform
|
|
24
|
+
function getDefaultImage(template, videoId) {
|
|
25
|
+
if (!videoId)
|
|
26
|
+
return "";
|
|
27
|
+
switch (template) {
|
|
28
|
+
case "XBE_YouTube":
|
|
29
|
+
case "YouTube":
|
|
30
|
+
return `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`;
|
|
31
|
+
case "XBE_Vimeo":
|
|
32
|
+
case "Vimeo":
|
|
33
|
+
return `https://vumbnail.com/${videoId}.jpg`;
|
|
34
|
+
default:
|
|
35
|
+
return "";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface AccordionItemProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
id: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AccordionItemTitleProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface AccordionItemContentProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function AccordionItemTitle({ children }: AccordionItemTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function AccordionItemContent({ children }: AccordionItemContentProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function AccordionItem({ children, id, className }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=accordion-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-item.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/collections/accordion/accordion-item.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAA4B,MAAM,OAAO,CAAC;AAE5D,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB;IACtC,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,uBAAuB,2CAEvE;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CAE3E;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,kBAAkB,2CA0B5E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AccordionShardCnItem, AccordionShardCnContent, AccordionShardCnTrigger } from "../../../shardcn/accordion";
|
|
3
|
+
import { Children, isValidElement } from "react";
|
|
4
|
+
export function AccordionItemTitle({ children }) {
|
|
5
|
+
return _jsx(_Fragment, { children: children });
|
|
6
|
+
}
|
|
7
|
+
export function AccordionItemContent({ children }) {
|
|
8
|
+
return _jsx(_Fragment, { children: children });
|
|
9
|
+
}
|
|
10
|
+
export function AccordionItem({ children, id, className }) {
|
|
11
|
+
let titleContent = null;
|
|
12
|
+
let itemContent = null;
|
|
13
|
+
// Parse children to find AccordionItemTitle and AccordionItemContent
|
|
14
|
+
Children.forEach(children, (child) => {
|
|
15
|
+
if (isValidElement(child)) {
|
|
16
|
+
if (child.type === AccordionItemTitle) {
|
|
17
|
+
titleContent = child.props.children;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (isValidElement(child)) {
|
|
21
|
+
if (child.type === AccordionItemContent) {
|
|
22
|
+
itemContent = child.props.children;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return (_jsxs(AccordionShardCnItem, { value: id, className: className, children: [_jsx(AccordionShardCnTrigger, { children: titleContent }), _jsx(AccordionShardCnContent, { children: itemContent })] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { AccordionShardCnContent, AccordionShardCnItem, AccordionShardCnTrigger } from "../../../shardcn/accordion";
|
|
3
|
+
export { AccordionShardCnContent as AccordionContent, AccordionShardCnItem as AccordionItem, AccordionShardCnTrigger as AccordionTrigger };
|
|
4
|
+
export { AccordionItem as AccordionItemWrapper, AccordionItemTitle, AccordionItemContent } from './accordion-item';
|
|
5
|
+
interface AccordionProps {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
defaultValue?: number | number[];
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function Accordion({ children, multiple, defaultValue, className }: AccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/collections/accordion/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAEH,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EAC1B,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,oBAAoB,IAAI,aAAa,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,CAAC;AAC3I,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEnH,UAAU,cAAc;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,SAAS,CAAC,EACtB,QAAQ,EACR,QAAe,EACf,YAAY,EACZ,SAAc,EACjB,EAAE,cAAc,2CA8BhB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AccordionShardCn, AccordionShardCnContent, AccordionShardCnItem, AccordionShardCnTrigger, } from "../../../shardcn/accordion";
|
|
4
|
+
export { AccordionShardCnContent as AccordionContent, AccordionShardCnItem as AccordionItem, AccordionShardCnTrigger as AccordionTrigger };
|
|
5
|
+
export { AccordionItem as AccordionItemWrapper, AccordionItemTitle, AccordionItemContent } from './accordion-item';
|
|
6
|
+
export function Accordion({ children, multiple = true, defaultValue, className = '' }) {
|
|
7
|
+
// Convert numeric defaultValue to string format that Radix UI expects
|
|
8
|
+
const defaultOpenValue = defaultValue !== undefined
|
|
9
|
+
? Array.isArray(defaultValue)
|
|
10
|
+
? defaultValue.map(v => String(v))
|
|
11
|
+
: [String(defaultValue)]
|
|
12
|
+
: undefined;
|
|
13
|
+
if (multiple) {
|
|
14
|
+
return (_jsx(AccordionShardCn, { type: "multiple", defaultValue: defaultOpenValue, className: className, children: children }));
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(AccordionShardCn, { type: "single", defaultValue: defaultOpenValue?.[0], collapsible: true, className: className, children: children }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface CarouselSlideProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function CarouselSlide({ children }: CarouselSlideProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=carousel-slide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-slide.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/collections/carousel/carousel-slide.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,UAAU,kBAAkB;IACxB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,2CAW7D"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CarouselItem } from "../../../shardcn/carousel";
|
|
3
|
+
export function CarouselSlide({ children }) {
|
|
4
|
+
return (_jsx(CarouselItem, { className: "pl-0 flex-shrink-0 relative", style: { flexBasis: 'var(--slide-width, 100%)', minWidth: 'var(--slide-width, 100%)' }, children: _jsx("div", { className: "w-full h-full", children: children }) }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export { CarouselSlide } from "./carousel-slide";
|
|
3
|
+
interface CarouselProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
isEditMode?: boolean;
|
|
6
|
+
variant?: 'default' | 'multi';
|
|
7
|
+
slidesPerView?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function Carousel({ children, isEditMode, variant, slidesPerView, className }: CarouselProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/collections/carousel/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,UAAkB,EAAE,OAAmB,EAAE,aAAiB,EAAE,SAAc,EAAE,EAAE,aAAa,2CAsD/H"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Carousel as CarouselComponent, CarouselContent, CarouselNext, CarouselPrevious } from "../../../shardcn/carousel";
|
|
4
|
+
export { CarouselSlide } from "./carousel-slide";
|
|
5
|
+
export function Carousel({ children, isEditMode = false, variant = 'default', slidesPerView = 3, className = '' }) {
|
|
6
|
+
//const plugins = isEditMode ? [] : [Fade()];
|
|
7
|
+
const isMultiSlide = variant === 'multi';
|
|
8
|
+
const slideWidth = isMultiSlide ? `${100 / slidesPerView}%` : '100%';
|
|
9
|
+
// In edit mode, ensure buttons are clickable by using higher z-index and pointer-events
|
|
10
|
+
const buttonClassName = isEditMode
|
|
11
|
+
? "!z-[9999] pointer-events-auto"
|
|
12
|
+
: "z-50 pointer-events-auto";
|
|
13
|
+
return (_jsx(CarouselComponent, { className: className || "w-full", opts: {
|
|
14
|
+
align: isMultiSlide ? "start" : "start",
|
|
15
|
+
loop: true,
|
|
16
|
+
containScroll: isMultiSlide ? "trimSnaps" : false,
|
|
17
|
+
skipSnaps: false,
|
|
18
|
+
watchDrag: !isEditMode, // Disable drag in edit mode to avoid conflicts
|
|
19
|
+
axis: 'x',
|
|
20
|
+
slidesToScroll: isMultiSlide ? 1 : 1,
|
|
21
|
+
}, children: _jsxs("div", { className: "w-full", children: [_jsxs("div", { className: "relative w-full min-h-[200px]", children: [_jsx(CarouselContent, { className: isEditMode
|
|
22
|
+
? "ml-0 flex gap-4 [&>*]:pointer-events-auto"
|
|
23
|
+
: isMultiSlide
|
|
24
|
+
? "ml-0 flex gap-4"
|
|
25
|
+
: "ml-0 flex [&_.embla__slide]:!absolute [&_.embla__slide]:!left-0 [&_.embla__slide]:!top-0", style: isMultiSlide ? { '--slide-width': slideWidth } : undefined, children: children }), !isMultiSlide && (_jsxs(_Fragment, { children: [_jsx(CarouselPrevious, { className: `absolute top-1/2 -translate-y-1/2 left-2 ${buttonClassName}` }), _jsx(CarouselNext, { className: `absolute top-1/2 -translate-y-1/2 right-2 ${buttonClassName}` })] }))] }), isMultiSlide && (_jsxs("div", { className: "flex justify-center items-center gap-4 mt-8 mb-8 w-full min-h-[80px] pb-4", children: [_jsx(CarouselPrevious, { className: `!relative !top-auto !left-auto !right-auto !bottom-auto !translate-y-0 !translate-x-0 !transform-none ${buttonClassName}` }), _jsx(CarouselNext, { className: `!relative !top-auto !left-auto !right-auto !bottom-auto !translate-y-0 !translate-x-0 !transform-none ${buttonClassName}` })] }))] }) }));
|
|
26
|
+
}
|