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,99 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
export const Profile = ({ children, className }) => {
|
|
5
|
+
let imageChild = null;
|
|
6
|
+
let nameChild = null;
|
|
7
|
+
let roleChild = null;
|
|
8
|
+
let contactChildren = [];
|
|
9
|
+
console.log("Profile component - children count:", React.Children.count(children));
|
|
10
|
+
React.Children.forEach(children, (child) => {
|
|
11
|
+
if (React.isValidElement(child)) {
|
|
12
|
+
console.log("Child type:", child.type, "ProfileContact:", ProfileContact, "Match:", child.type === ProfileContact);
|
|
13
|
+
if (child.type === ProfileImage) {
|
|
14
|
+
imageChild = child;
|
|
15
|
+
}
|
|
16
|
+
else if (child.type === ProfileName) {
|
|
17
|
+
nameChild = child;
|
|
18
|
+
}
|
|
19
|
+
else if (child.type === ProfileRole) {
|
|
20
|
+
roleChild = child;
|
|
21
|
+
}
|
|
22
|
+
else if (child.type === ProfileContact) {
|
|
23
|
+
contactChildren.push(child);
|
|
24
|
+
console.log("Added to contactChildren, total:", contactChildren.length);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return (_jsx("div", { className: clsx("component__height", className), children: _jsxs("div", { className: "flex flex-col bg-brand-card-bg border border-brand-card-border-color shadow hover:shadow-xl component__height portrait__text__position", children: [_jsxs("div", { children: [imageChild, _jsxs("div", { className: "px-6 pt-5 space-y-3", children: [nameChild, roleChild] })] }), _jsx("div", { children: contactChildren })] }) }));
|
|
29
|
+
};
|
|
30
|
+
export const ProfileImage = ({ children, }) => {
|
|
31
|
+
if (!children)
|
|
32
|
+
return null;
|
|
33
|
+
// Clone the child element and add the imageClassName to it
|
|
34
|
+
const imageClassName = "w-full object-cover object-center image__height";
|
|
35
|
+
if (React.isValidElement(children)) {
|
|
36
|
+
return React.cloneElement(children, {
|
|
37
|
+
imageClassName: imageClassName,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return _jsx(_Fragment, { children: children });
|
|
41
|
+
};
|
|
42
|
+
export const ProfileName = ({ children, }) => {
|
|
43
|
+
if (!children)
|
|
44
|
+
return null;
|
|
45
|
+
return (_jsx("h5", { className: "w-full text-sm font-bold text-brand-potrait-card-name", children: children }));
|
|
46
|
+
};
|
|
47
|
+
export const ProfileRole = ({ children, }) => {
|
|
48
|
+
if (!children)
|
|
49
|
+
return null;
|
|
50
|
+
return (_jsx("span", { className: "w-full text-base text-brand-potrait-card-role", children: children }));
|
|
51
|
+
};
|
|
52
|
+
export const ProfileContact = ({ children, iconName, href, isPageEditing = false, }) => {
|
|
53
|
+
// Map icon names to CSS classes that trigger ::before pseudo-elements
|
|
54
|
+
const getIconClass = (icon) => {
|
|
55
|
+
if (!icon)
|
|
56
|
+
return '';
|
|
57
|
+
const iconMap = {
|
|
58
|
+
'Mail': 'richtext__icon-link--email',
|
|
59
|
+
'Phone': 'richtext__icon-link--tel',
|
|
60
|
+
'Smartphone': 'richtext__icon-link--tel',
|
|
61
|
+
'Linkedin': 'richtext__icon-link--linkedin',
|
|
62
|
+
};
|
|
63
|
+
return iconMap[icon] || '';
|
|
64
|
+
};
|
|
65
|
+
const iconClass = getIconClass(iconName);
|
|
66
|
+
// Check if children have content - important for Sitecore fields in live mode
|
|
67
|
+
const hasContent = React.Children.toArray(children).some(child => {
|
|
68
|
+
if (!child)
|
|
69
|
+
return false;
|
|
70
|
+
if (typeof child === 'string')
|
|
71
|
+
return child.trim().length > 0;
|
|
72
|
+
if (React.isValidElement(child)) {
|
|
73
|
+
// Check if React element has field value or text content
|
|
74
|
+
const element = child;
|
|
75
|
+
const fieldValue = element.props?.field?.value;
|
|
76
|
+
// For Link fields, check href and text
|
|
77
|
+
if (fieldValue && typeof fieldValue === 'object' && 'href' in fieldValue) {
|
|
78
|
+
return Boolean(fieldValue.href || fieldValue.text);
|
|
79
|
+
}
|
|
80
|
+
// For Text fields, check value directly
|
|
81
|
+
return Boolean(fieldValue || element.props?.children);
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
});
|
|
85
|
+
// In live mode, don't render if there's no content
|
|
86
|
+
if (!isPageEditing && !hasContent) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
// If in page editing mode, render as div with icon class on the wrapper
|
|
90
|
+
if (isPageEditing) {
|
|
91
|
+
return (_jsx("div", { className: clsx("flex items-baseline px-6 py-4 border-b border-slate-300", iconClass), children: _jsx("div", { className: "w-full text-base text-brand-card-text [&_a]:component-link [&_a]:w-full [&_a]:text-base [&_a]:text-brand-card-text [&_a]:no-underline [&_a]:hover:no-underline [&_a>*]:no-underline", children: children }) }));
|
|
92
|
+
}
|
|
93
|
+
// For live mode, render as link (href attributes will trigger CSS ::before automatically)
|
|
94
|
+
return (_jsx("div", { className: "px-6 py-4 border-b border-slate-300", children: _jsx("a", { href: href, className: "inline-flex items-baseline font-normal no-underline hover:no-underline text-brand-card-text group", children: _jsx("span", { className: "text-brand-card-text group-hover:text-brand-card-text font-normal", children: children }) }) }));
|
|
95
|
+
};
|
|
96
|
+
Profile.Image = ProfileImage;
|
|
97
|
+
Profile.Name = ProfileName;
|
|
98
|
+
Profile.Role = ProfileRole;
|
|
99
|
+
Profile.Contact = ProfileContact;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type JustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
|
|
2
|
+
type AlignItems = 'flex-start' | 'flex-end' | 'center' | 'strech' | 'baseline';
|
|
3
|
+
type Direction = 'row' | 'row-reverse';
|
|
4
|
+
type SpacingValue = '0' | '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '16' | '20' | '24' | '28' | '32' | '36' | '40' | '44' | '48' | '52' | '56' | '60' | '64' | '72' | '80' | '96';
|
|
5
|
+
type Spacing = SpacingValue | {
|
|
6
|
+
xs?: SpacingValue;
|
|
7
|
+
sm?: SpacingValue;
|
|
8
|
+
md?: SpacingValue;
|
|
9
|
+
lg?: SpacingValue;
|
|
10
|
+
xl?: SpacingValue;
|
|
11
|
+
'2xl'?: SpacingValue;
|
|
12
|
+
};
|
|
13
|
+
interface GridContainerProps {
|
|
14
|
+
grid?: string;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
columnSpacing?: Spacing;
|
|
18
|
+
rowSpacing?: Spacing;
|
|
19
|
+
justifyContent?: JustifyContent;
|
|
20
|
+
direction?: Direction;
|
|
21
|
+
alignItems?: AlignItems;
|
|
22
|
+
styles?: any;
|
|
23
|
+
id?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const GridContainer: React.FC<GridContainerProps>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=grid-container.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-container.d.ts","sourceRoot":"","sources":["../../../../../../xbe-ui/src/components/layout/grid-container.tsx"],"names":[],"mappings":"AAEA,KAAK,cAAc,GACf,YAAY,GACZ,UAAU,GACV,QAAQ,GACR,eAAe,GACf,cAAc,GACd,cAAc,CAAC;AAEnB,KAAK,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/E,KAAK,SAAS,GAAG,KAAK,GAAG,aAAa,CAAC;AAEvC,KAAK,YAAY,GACb,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAET,KAAK,OAAO,GACR,YAAY,GACZ;IACE,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,EAAE,CAAC,EAAE,YAAY,CAAC;IAClB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CAAC;AAEN,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkCtD,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../lib/utils";
|
|
3
|
+
export const GridContainer = ({ children, className = '', columnSpacing, rowSpacing, justifyContent, alignItems, direction, styles, id, }) => {
|
|
4
|
+
const justifyContentClasses = justifyContent ? justifyContentMap[justifyContent] : '';
|
|
5
|
+
const alignItemsClasses = alignItems ? alignItemsMap[alignItems] : '';
|
|
6
|
+
const directionClasses = direction ? directionMap[direction] : '';
|
|
7
|
+
const columnSpacingClasses = generateSpacingClasses(columnSpacing, columnSpacingMap);
|
|
8
|
+
const rowSpacingClasses = generateSpacingClasses(rowSpacing, rowSpacingMap);
|
|
9
|
+
return (_jsx("div", { className: cn('flex-container flex-wrap', className, justifyContentClasses, alignItemsClasses, directionClasses, columnSpacingClasses, rowSpacingClasses), style: styles, id: id, children: children }));
|
|
10
|
+
};
|
|
11
|
+
// =============================================
|
|
12
|
+
// CSS Property Mapping and Function Generation
|
|
13
|
+
// =============================================
|
|
14
|
+
const justifyContentMap = {
|
|
15
|
+
'flex-start': 'justify-start',
|
|
16
|
+
'flex-end': 'justify-end',
|
|
17
|
+
center: 'justify-center',
|
|
18
|
+
'space-between': 'justify-between',
|
|
19
|
+
'space-around': 'justify-around',
|
|
20
|
+
'space-evenly': 'justify-evenly',
|
|
21
|
+
};
|
|
22
|
+
const alignItemsMap = {
|
|
23
|
+
'flex-start': 'items-start',
|
|
24
|
+
'flex-end': 'items-end',
|
|
25
|
+
center: 'items-center',
|
|
26
|
+
strech: 'items-stretch',
|
|
27
|
+
baseline: 'items-baseline',
|
|
28
|
+
};
|
|
29
|
+
const directionMap = {
|
|
30
|
+
row: 'flex-row',
|
|
31
|
+
'row-reverse': 'flex-row-reverse',
|
|
32
|
+
};
|
|
33
|
+
const columnSpacingMap = {
|
|
34
|
+
'0': 'gap-size-x-0',
|
|
35
|
+
'01': 'gap-size-x-1',
|
|
36
|
+
'02': 'gap-size-x-2',
|
|
37
|
+
'03': 'gap-size-x-3',
|
|
38
|
+
'04': 'gap-size-x-4',
|
|
39
|
+
'05': 'gap-size-x-5',
|
|
40
|
+
'06': 'gap-size-x-6',
|
|
41
|
+
'07': 'gap-size-x-7',
|
|
42
|
+
'08': 'gap-size-x-8',
|
|
43
|
+
'09': 'gap-size-x-9',
|
|
44
|
+
'10': 'gap-size-x-10',
|
|
45
|
+
'11': 'gap-size-x-11',
|
|
46
|
+
'12': 'gap-size-x-12',
|
|
47
|
+
'16': 'gap-size-x-16',
|
|
48
|
+
'20': 'gap-size-x-20',
|
|
49
|
+
'24': 'gap-size-x-24',
|
|
50
|
+
'28': 'gap-size-x-28',
|
|
51
|
+
'32': 'gap-size-x-32',
|
|
52
|
+
'36': 'gap-size-x-36',
|
|
53
|
+
'40': 'gap-size-x-40',
|
|
54
|
+
'44': 'gap-size-x-44',
|
|
55
|
+
'48': 'gap-size-x-48',
|
|
56
|
+
'52': 'gap-size-x-52',
|
|
57
|
+
'56': 'gap-size-x-56',
|
|
58
|
+
'60': 'gap-size-x-60',
|
|
59
|
+
'64': 'gap-size-x-64',
|
|
60
|
+
'72': 'gap-size-x-72',
|
|
61
|
+
'80': 'gap-size-x-80',
|
|
62
|
+
'96': 'gap-size-x-96',
|
|
63
|
+
};
|
|
64
|
+
const rowSpacingMap = {
|
|
65
|
+
'0': 'gap-size-y-0',
|
|
66
|
+
'01': 'gap-size-y-1',
|
|
67
|
+
'02': 'gap-size-y-2',
|
|
68
|
+
'03': 'gap-size-y-3',
|
|
69
|
+
'04': 'gap-size-y-4',
|
|
70
|
+
'05': 'gap-size-y-5',
|
|
71
|
+
'06': 'gap-size-y-6',
|
|
72
|
+
'07': 'gap-size-y-7',
|
|
73
|
+
'08': 'gap-size-y-8',
|
|
74
|
+
'09': 'gap-size-y-9',
|
|
75
|
+
'10': 'gap-size-y-10',
|
|
76
|
+
'11': 'gap-size-y-11',
|
|
77
|
+
'12': 'gap-size-y-12',
|
|
78
|
+
'16': 'gap-size-y-16',
|
|
79
|
+
'20': 'gap-size-y-20',
|
|
80
|
+
'24': 'gap-size-y-24',
|
|
81
|
+
'28': 'gap-size-y-28',
|
|
82
|
+
'32': 'gap-size-y-32',
|
|
83
|
+
'36': 'gap-size-y-36',
|
|
84
|
+
'40': 'gap-size-y-40',
|
|
85
|
+
'44': 'gap-size-y-44',
|
|
86
|
+
'48': 'gap-size-y-48',
|
|
87
|
+
'52': 'gap-size-y-52',
|
|
88
|
+
'56': 'gap-size-y-56',
|
|
89
|
+
'60': 'gap-size-y-60',
|
|
90
|
+
'64': 'gap-size-y-64',
|
|
91
|
+
'72': 'gap-size-y-72',
|
|
92
|
+
'80': 'gap-size-y-80',
|
|
93
|
+
'96': 'gap-size-y-96',
|
|
94
|
+
};
|
|
95
|
+
function generateSpacingClasses(spacing, spacingMap) {
|
|
96
|
+
let classes = '';
|
|
97
|
+
if (!spacing) {
|
|
98
|
+
return '';
|
|
99
|
+
}
|
|
100
|
+
if (typeof spacing === 'string') {
|
|
101
|
+
classes = spacingMap[spacing] || '';
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
for (const [key, value] of Object.entries(spacing)) {
|
|
105
|
+
const prefix = key === 'xs' ? '' : `${key}:`;
|
|
106
|
+
classes += ` ${prefix}${spacingMap[value]}`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return classes.trim();
|
|
110
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ColSize = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12';
|
|
3
|
+
interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
xs?: ColSize;
|
|
5
|
+
sm?: ColSize;
|
|
6
|
+
md?: ColSize;
|
|
7
|
+
lg?: ColSize;
|
|
8
|
+
xl?: ColSize;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
props?: any;
|
|
11
|
+
interfaceName?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
dataSource?: boolean;
|
|
14
|
+
id?: string;
|
|
15
|
+
backgroundImageUrl?: string;
|
|
16
|
+
href?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @property {React.ReactNode} children - The content of the grid.
|
|
20
|
+
* @property {string} [interfaceName] - The name of the interface or type we need to put interfaceName in the parent component to make every component works properly in sitecore pages (without page reload, it's written in sitecore docs).
|
|
21
|
+
* @property {boolean} [dataSource] - If true, the component will be connected to a data source.
|
|
22
|
+
* @property {string} [className] - Additional CSS classes to apply to the component.
|
|
23
|
+
*/
|
|
24
|
+
export declare const GridItem: React.ForwardRefExoticComponent<GridItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
interface NoDataSourceProps {
|
|
26
|
+
interfaceName?: string | undefined;
|
|
27
|
+
grid?: string | undefined;
|
|
28
|
+
gridParams?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const NoDataSource: React.FC<NoDataSourceProps>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=grid-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-item.d.ts","sourceRoot":"","sources":["../../../../../../xbe-ui/src/components/layout/grid-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAI1C,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE/F,UAAU,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAClE,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AAEH,eAAO,MAAM,QAAQ,sFA4GpB,CAAC;AAEF,UAAU,iBAAiB;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CASpD,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { Icon } from '../basic/icon/icon';
|
|
6
|
+
import { mediaApi } from '@sitecore-content-sdk/core/media';
|
|
7
|
+
/**
|
|
8
|
+
* @property {React.ReactNode} children - The content of the grid.
|
|
9
|
+
* @property {string} [interfaceName] - The name of the interface or type we need to put interfaceName in the parent component to make every component works properly in sitecore pages (without page reload, it's written in sitecore docs).
|
|
10
|
+
* @property {boolean} [dataSource] - If true, the component will be connected to a data source.
|
|
11
|
+
* @property {string} [className] - Additional CSS classes to apply to the component.
|
|
12
|
+
*/
|
|
13
|
+
export const GridItem = forwardRef(({ xs, sm, lg, md, xl, interfaceName, props = {}, children, id, dataSource = false, className = '', href, ...rest }, ref) => {
|
|
14
|
+
const gridParams = props?.params?.GridParameters || '';
|
|
15
|
+
const stylesParams = props?.params?.Styles || '';
|
|
16
|
+
const idParam = props?.params?.RenderingIdentifier || '';
|
|
17
|
+
const colClasses = cn(xs ? `flex-col-${xs}` : '', sm ? `sm:flex-col-${sm}` : '', md ? `md:flex-col-${md}` : '', lg ? `lg:flex-col-${lg}` : '', xl ? `xl:flex-col-${xl}` : '');
|
|
18
|
+
// if data is empty, show a message to the user
|
|
19
|
+
if (dataSource && !props.fields?.data) {
|
|
20
|
+
return (_jsx(NoDataSource, { interfaceName: interfaceName, grid: colClasses, gridParams: gridParams }));
|
|
21
|
+
}
|
|
22
|
+
// Generate a unique class for background targeting
|
|
23
|
+
const uniqueBgClass = idParam ? `griditem-bg-${idParam}` : '';
|
|
24
|
+
// Responsive background images using mediaApi
|
|
25
|
+
let backgroundStyles = {};
|
|
26
|
+
let responsiveBackgroundCSS = null;
|
|
27
|
+
if (typeof rest.backgroundImageUrl === 'string' && rest.backgroundImageUrl) {
|
|
28
|
+
const bgUrl = rest.backgroundImageUrl;
|
|
29
|
+
// Generate responsive URLs for different breakpoints
|
|
30
|
+
const bg576 = mediaApi.updateImageUrl(bgUrl, { mw: 576 });
|
|
31
|
+
const bg768 = mediaApi.updateImageUrl(bgUrl, { mw: 768 });
|
|
32
|
+
const bg1024 = mediaApi.updateImageUrl(bgUrl, { mw: 1024 });
|
|
33
|
+
const bg1280 = mediaApi.updateImageUrl(bgUrl, { mw: 1280 });
|
|
34
|
+
const bg1920 = mediaApi.updateImageUrl(bgUrl, { mw: 1920 });
|
|
35
|
+
// Use the largest as default inline style
|
|
36
|
+
backgroundStyles = {
|
|
37
|
+
backgroundImage: `url('${bg1920}')`,
|
|
38
|
+
backgroundSize: 'cover',
|
|
39
|
+
backgroundPosition: 'center',
|
|
40
|
+
};
|
|
41
|
+
// Generate server-side CSS for responsive backgrounds
|
|
42
|
+
if (uniqueBgClass) {
|
|
43
|
+
responsiveBackgroundCSS = `
|
|
44
|
+
@media (max-width: 576px) { .${uniqueBgClass} { background-image: url('${bg576}'); } }
|
|
45
|
+
@media (min-width: 577px) and (max-width: 768px) { .${uniqueBgClass} { background-image: url('${bg768}'); } }
|
|
46
|
+
@media (min-width: 769px) and (max-width: 1024px) { .${uniqueBgClass} { background-image: url('${bg1024}'); } }
|
|
47
|
+
@media (min-width: 1025px) and (max-width: 1280px) { .${uniqueBgClass} { background-image: url('${bg1280}'); } }
|
|
48
|
+
@media (min-width: 1281px) { .${uniqueBgClass} { background-image: url('${bg1920}'); } }
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return (_jsxs(_Fragment, { children: [responsiveBackgroundCSS && (_jsx("style", { dangerouslySetInnerHTML: { __html: responsiveBackgroundCSS } })), _jsx("div", { className: twMerge('component flex-item', colClasses, interfaceName, gridParams, className, stylesParams, uniqueBgClass), id: idParam, ref: ref, style: { ...backgroundStyles, ...rest.style }, ...rest, children: href ? (_jsx("a", { href: href, className: "flex flex-col h-full no-underline hover:no-underline text-inherit", children: children })) : (children) })] }));
|
|
53
|
+
});
|
|
54
|
+
export const NoDataSource = ({ interfaceName, grid, gridParams }) => {
|
|
55
|
+
return (_jsx("div", { className: twMerge('col-span-12 component', interfaceName, grid, gridParams), children: _jsxs("div", { className: "flex items-center justify-center w-full p-3 bg-orange-400 border-2 border-black rounded-md gap-x-4", children: [_jsx(Icon, { identifier: "info", className: "text-xl text-white" }), _jsx("h4", { className: "text-black", children: "No datasource selected for this component" })] }) }));
|
|
56
|
+
};
|
|
57
|
+
GridItem.displayName = 'GridItem';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Breadcrumb Component Suite
|
|
4
|
+
*
|
|
5
|
+
* A flexible breadcrumb navigation component built on Radix UI primitives.
|
|
6
|
+
* These are low-level building blocks - for simpler usage, see BreadcrumbList
|
|
7
|
+
* from the collections package.
|
|
8
|
+
*
|
|
9
|
+
* **Visual Only**: These components render the breadcrumb UI. For SEO structured data,
|
|
10
|
+
* use the StructuredDataService from @repo/xbe-lib-structureddata at the page level.
|
|
11
|
+
*/
|
|
12
|
+
interface BreadcrumbProps extends React.ComponentProps<"nav"> {
|
|
13
|
+
}
|
|
14
|
+
declare function Breadcrumb({ children, ...props }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function BreadcrumbLink({ asChild, className, ...props }: React.ComponentProps<"a"> & {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
24
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../../../../../xbe-ui/src/components/structure/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;GASG;AAEH,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;CAAG;AAEhE,iBAAS,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAM1D;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAW1E;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAQ1E;AAED,iBAAS,cAAc,CAAC,EACtB,OAAO,EACP,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAUA;AAED,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAY5E;AAED,iBAAS,mBAAmB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,2CAmB5B;AAED,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAa9B;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,GACnB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { MoreHorizontal } from "lucide-react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cn } from "../../../lib/utils";
|
|
5
|
+
function Breadcrumb({ children, ...props }) {
|
|
6
|
+
return (_jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props, children: children }));
|
|
7
|
+
}
|
|
8
|
+
function BreadcrumbList({ className, ...props }) {
|
|
9
|
+
return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn("flex flex-wrap items-center gap-1.5 break-words sm:gap-2.5", className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
12
|
+
return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn("inline-flex items-center gap-1.5", className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
function BreadcrumbLink({ asChild, className, ...props }) {
|
|
15
|
+
const Comp = (asChild ? Slot : "a");
|
|
16
|
+
return (_jsx(Comp, { "data-slot": "breadcrumb-link", className: cn("transition-colors", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
19
|
+
return (_jsx("span", { "data-slot": "breadcrumb-page", role: "link", tabIndex: 0, "aria-disabled": "true", "aria-current": "page", className: cn("font-normal", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
22
|
+
return (_jsx("li", { "data-slot": "breadcrumb-separator", role: "presentation", "aria-hidden": "true", className: className, ...props, children: children !== undefined ? (children) : (_jsx("span", { "data-slot": "breadcrumb-separator-content", className: "before:content-[var(--breadcrumb-separator,'/')]" })) }));
|
|
23
|
+
}
|
|
24
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
25
|
+
return (_jsxs("span", { "data-slot": "breadcrumb-ellipsis", role: "presentation", "aria-hidden": "true", className: cn("flex size-9 items-center justify-center", className), ...props, children: [_jsx(MoreHorizontal, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "More" })] }));
|
|
26
|
+
}
|
|
27
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface LinkRendererProps {
|
|
3
|
+
/** The URL to link to */
|
|
4
|
+
href?: string;
|
|
5
|
+
/** Link target (_self, _blank, etc.) */
|
|
6
|
+
target?: string;
|
|
7
|
+
/** Link title attribute */
|
|
8
|
+
title?: string;
|
|
9
|
+
/** Link text (for accessibility) */
|
|
10
|
+
text?: string;
|
|
11
|
+
/** Children to render inside the link */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/** Additional CSS classes */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Aria label for accessibility */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
/** Additional props to pass to the anchor or span element */
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* LinkRenderer Component
|
|
22
|
+
*
|
|
23
|
+
* Generic link renderer that handles:
|
|
24
|
+
* - Link validation (href exists and is not '#')
|
|
25
|
+
* - Security attributes (noopener noreferrer for external links)
|
|
26
|
+
* - Accessibility (aria-label)
|
|
27
|
+
* - Fallback to span when no valid link exists
|
|
28
|
+
*
|
|
29
|
+
* This component is framework-agnostic and doesn't depend on Sitecore types.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <LinkRenderer
|
|
34
|
+
* href="/about"
|
|
35
|
+
* target="_self"
|
|
36
|
+
* ariaLabel="Learn more"
|
|
37
|
+
* >
|
|
38
|
+
* Click here
|
|
39
|
+
* </LinkRenderer>
|
|
40
|
+
*
|
|
41
|
+
* // External link
|
|
42
|
+
* <LinkRenderer
|
|
43
|
+
* href="https://example.com"
|
|
44
|
+
* target="_blank"
|
|
45
|
+
* >
|
|
46
|
+
* Visit site
|
|
47
|
+
* </LinkRenderer>
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare const LinkRenderer: ({ href, target, title, text, children, className, ariaLabel, ...rest }: LinkRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export default LinkRenderer;
|
|
52
|
+
//# sourceMappingURL=linkrenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkrenderer.d.ts","sourceRoot":"","sources":["../../../../../../xbe-ui/src/components/system/linkrenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,QAAQ,EAAE,SAAS,CAAC;IACpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,YAAY,GAAI,wEAS1B,iBAAiB,4CAgCnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* LinkRenderer Component
|
|
4
|
+
*
|
|
5
|
+
* Generic link renderer that handles:
|
|
6
|
+
* - Link validation (href exists and is not '#')
|
|
7
|
+
* - Security attributes (noopener noreferrer for external links)
|
|
8
|
+
* - Accessibility (aria-label)
|
|
9
|
+
* - Fallback to span when no valid link exists
|
|
10
|
+
*
|
|
11
|
+
* This component is framework-agnostic and doesn't depend on Sitecore types.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <LinkRenderer
|
|
16
|
+
* href="/about"
|
|
17
|
+
* target="_self"
|
|
18
|
+
* ariaLabel="Learn more"
|
|
19
|
+
* >
|
|
20
|
+
* Click here
|
|
21
|
+
* </LinkRenderer>
|
|
22
|
+
*
|
|
23
|
+
* // External link
|
|
24
|
+
* <LinkRenderer
|
|
25
|
+
* href="https://example.com"
|
|
26
|
+
* target="_blank"
|
|
27
|
+
* >
|
|
28
|
+
* Visit site
|
|
29
|
+
* </LinkRenderer>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const LinkRenderer = ({ href, target = '_self', title, text, children, className = '', ariaLabel, ...rest }) => {
|
|
33
|
+
const isExternalLink = target === '_blank';
|
|
34
|
+
const hasValidLink = Boolean(href && href !== '' && href !== '#');
|
|
35
|
+
// If no valid link, render as span with role="img" if ariaLabel is provided
|
|
36
|
+
if (!hasValidLink) {
|
|
37
|
+
return (_jsx("span", { className: className, ...(ariaLabel && { role: 'img', 'aria-label': ariaLabel }), ...(title && { title }), ...rest, children: children }));
|
|
38
|
+
}
|
|
39
|
+
// Render as anchor with proper attributes
|
|
40
|
+
return (_jsx("a", { href: href, target: target, className: className, ...(title && { title }), ...(ariaLabel && { 'aria-label': ariaLabel }), ...(isExternalLink && { rel: 'noopener noreferrer' }), ...rest, children: children }));
|
|
41
|
+
};
|
|
42
|
+
export default LinkRenderer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDisableBodyScroll.d.ts","sourceRoot":"","sources":["../../../../../xbe-ui/src/hooks/useDisableBodyScroll.ts"],"names":[],"mappings":"AAGA,UAAU,wBAAwB;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,GAC/B,YAAY,OAAO,EACnB,UAAS,wBAA0D,SAuBpE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
export const useDisableBodyScroll = (isDisabled, options = { mobile: true, desktop: true }) => {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const handleResize = () => {
|
|
6
|
+
const { mobile, desktop } = options;
|
|
7
|
+
if (mobile && window.innerWidth <= 1024) {
|
|
8
|
+
document.body.style.overflow = isDisabled ? 'hidden' : '';
|
|
9
|
+
}
|
|
10
|
+
else if (desktop && window.innerWidth > 1024) {
|
|
11
|
+
document.body.style.overflow = isDisabled ? 'hidden' : '';
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
document.body.style.overflow = '';
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
handleResize(); // Initial check
|
|
18
|
+
window.addEventListener('resize', handleResize);
|
|
19
|
+
return () => {
|
|
20
|
+
document.body.style.overflow = '';
|
|
21
|
+
window.removeEventListener('resize', handleResize);
|
|
22
|
+
};
|
|
23
|
+
}, [isDisabled, options]);
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToggle.d.ts","sourceRoot":"","sources":["../../../../../xbe-ui/src/hooks/useToggle.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS,GAAI,sBAAoB,mCAQ7C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
// useToggle is a custom hook that manages a single boolean state.
|
|
4
|
+
// It's useful when you need to handle the state of a single UI element, like a modal or a dropdown.
|
|
5
|
+
export const useToggle = (initialState = false) => {
|
|
6
|
+
const [toggle, setToggle] = useState(initialState);
|
|
7
|
+
const handleToggle = () => {
|
|
8
|
+
setToggle((prev) => !prev);
|
|
9
|
+
};
|
|
10
|
+
return [toggle, handleToggle];
|
|
11
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export * from './components/structure/breadcrumb/breadcrumb';
|
|
2
|
+
export * from './components/layout/grid-container';
|
|
3
|
+
export * from './components/layout/grid-item';
|
|
4
|
+
export * from './components/basic/richtext/richtext';
|
|
5
|
+
export * from './components/basic/image/image';
|
|
6
|
+
export * from './components/basic/video/video';
|
|
7
|
+
export * from './components/basic/icon/icon';
|
|
8
|
+
export * from './components/basic/text/text';
|
|
9
|
+
export * from './components/collections/link-list';
|
|
10
|
+
export * from './components/collections/accordion';
|
|
11
|
+
export * from './components/collections/content-block';
|
|
12
|
+
export * from './components/collections/content-card';
|
|
13
|
+
export * from './components/collections/icon-card';
|
|
14
|
+
export * from './components/collections/duo-block';
|
|
15
|
+
export * from './components/collections/profile';
|
|
16
|
+
export * from './components/collections/maps';
|
|
17
|
+
export * from './components/system/linkrenderer';
|
|
18
|
+
export * from './lib/utils';
|
|
19
|
+
export * from './hooks/useToggle';
|
|
20
|
+
export * from './hooks/useDisableBodyScroll';
|
|
21
|
+
export * from './utils/images/raw-loader';
|
|
22
|
+
export * from './utils/images/image-loader';
|
|
23
|
+
export * from './utils/images/generate-image-url';
|
|
24
|
+
export * from './utils/url';
|
|
25
|
+
export * from './components/collections/carousel';
|
|
26
|
+
export * from './types/heading';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../xbe-ui/src/index.ts"],"names":[],"mappings":"AACA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,mCAAmC,CAAC;AAClD,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Export all components
|
|
2
|
+
export * from './components/structure/breadcrumb/breadcrumb';
|
|
3
|
+
export * from './components/layout/grid-container';
|
|
4
|
+
export * from './components/layout/grid-item';
|
|
5
|
+
export * from './components/basic/richtext/richtext';
|
|
6
|
+
export * from './components/basic/image/image';
|
|
7
|
+
export * from './components/basic/video/video';
|
|
8
|
+
export * from './components/basic/icon/icon';
|
|
9
|
+
export * from './components/basic/text/text';
|
|
10
|
+
export * from './components/collections/link-list';
|
|
11
|
+
export * from './components/collections/accordion';
|
|
12
|
+
export * from './components/collections/content-block';
|
|
13
|
+
export * from './components/collections/content-card';
|
|
14
|
+
export * from './components/collections/icon-card';
|
|
15
|
+
export * from './components/collections/duo-block';
|
|
16
|
+
export * from './components/collections/profile';
|
|
17
|
+
export * from './components/collections/maps';
|
|
18
|
+
export * from './components/system/linkrenderer';
|
|
19
|
+
export * from './lib/utils';
|
|
20
|
+
export * from './hooks/useToggle';
|
|
21
|
+
export * from './hooks/useDisableBodyScroll';
|
|
22
|
+
export * from './utils/images/raw-loader';
|
|
23
|
+
export * from './utils/images/image-loader';
|
|
24
|
+
export * from './utils/images/generate-image-url';
|
|
25
|
+
export * from './utils/url';
|
|
26
|
+
export * from './components/collections/carousel';
|
|
27
|
+
export * from './types/heading';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../xbe-ui/src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|