@deneb-ui/ui 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -0
- package/dist/EditableBox.d.ts +56 -0
- package/dist/EditableBox.js +113 -0
- package/dist/EditableCard.d.ts +48 -0
- package/dist/EditableCard.js +85 -0
- package/dist/EditableContactForm.d.ts +11 -0
- package/dist/EditableContactForm.js +146 -0
- package/dist/EditableDialog.d.ts +25 -0
- package/dist/EditableDialog.js +145 -0
- package/dist/EditableFAQAccordion.d.ts +19 -0
- package/dist/EditableFAQAccordion.js +62 -0
- package/dist/EditableFooter.d.ts +31 -0
- package/dist/EditableFooter.js +330 -0
- package/dist/EditableGrid.d.ts +40 -0
- package/dist/EditableGrid.js +39 -0
- package/dist/EditableHero.d.ts +27 -0
- package/dist/EditableHero.js +154 -0
- package/dist/EditableImage.d.ts +13 -0
- package/dist/EditableImage.js +38 -0
- package/dist/EditableList.d.ts +33 -0
- package/dist/EditableList.js +19 -0
- package/dist/EditableNavbar.d.ts +28 -0
- package/dist/EditableNavbar.js +178 -0
- package/dist/EditablePricingCard.d.ts +31 -0
- package/dist/EditablePricingCard.js +93 -0
- package/dist/EditableProductCard.d.ts +60 -0
- package/dist/EditableProductCard.js +116 -0
- package/dist/EditableSection.d.ts +35 -0
- package/dist/EditableSection.js +34 -0
- package/dist/EditableServiceCard.d.ts +38 -0
- package/dist/EditableServiceCard.js +28 -0
- package/dist/EditableTestimonialCard.d.ts +17 -0
- package/dist/EditableTestimonialCard.js +46 -0
- package/dist/EditableText.d.ts +117 -0
- package/dist/EditableText.js +319 -0
- package/dist/SiteDataProvider.d.ts +61 -0
- package/dist/SiteDataProvider.js +316 -0
- package/dist/ThemeStyles.d.ts +46 -0
- package/dist/ThemeStyles.js +181 -0
- package/dist/business/BusinessHours.d.ts +20 -0
- package/dist/business/BusinessHours.js +109 -0
- package/dist/business/index.d.ts +1 -0
- package/dist/business/index.js +17 -0
- package/dist/contact/ContactActions.d.ts +24 -0
- package/dist/contact/ContactActions.js +30 -0
- package/dist/contact/ContactButton.d.ts +15 -0
- package/dist/contact/ContactButton.js +94 -0
- package/dist/contact/EmailButton.d.ts +6 -0
- package/dist/contact/EmailButton.js +12 -0
- package/dist/contact/PhoneButton.d.ts +6 -0
- package/dist/contact/PhoneButton.js +12 -0
- package/dist/contact/WhatsAppButton.d.ts +6 -0
- package/dist/contact/WhatsAppButton.js +13 -0
- package/dist/contact/index.d.ts +5 -0
- package/dist/contact/index.js +21 -0
- package/dist/core/DenebAction.d.ts +19 -0
- package/dist/core/DenebAction.js +107 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +17 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +106 -0
- package/dist/location/Address.d.ts +14 -0
- package/dist/location/Address.js +26 -0
- package/dist/location/LocationCard.d.ts +20 -0
- package/dist/location/LocationCard.js +41 -0
- package/dist/location/LocationLink.d.ts +18 -0
- package/dist/location/LocationLink.js +23 -0
- package/dist/location/MapEmbed.d.ts +18 -0
- package/dist/location/MapEmbed.js +30 -0
- package/dist/location/MapLink.d.ts +13 -0
- package/dist/location/MapLink.js +63 -0
- package/dist/location/index.d.ts +5 -0
- package/dist/location/index.js +21 -0
- package/dist/social/SocialButton.d.ts +11 -0
- package/dist/social/SocialButton.js +112 -0
- package/dist/social/SocialLinks.d.ts +14 -0
- package/dist/social/SocialLinks.js +42 -0
- package/dist/social/index.d.ts +2 -0
- package/dist/social/index.js +18 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/dist/utils/urls.d.ts +32 -0
- package/dist/utils/urls.js +91 -0
- package/package.json +41 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DENEB UI — The Visual-First React Framework for High-Converting Storefronts
|
|
4
|
+
* Created by Chamika Gayashan (CEE G)
|
|
5
|
+
*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
18
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.CEEG_AUTHOR = exports.CEEG_FRAMEWORK_VERSION = exports.CEEG_FRAMEWORK_NAME = exports.DENEB_AUTHOR = exports.DENEB_FRAMEWORK_VERSION = exports.DENEB_FRAMEWORK_NAME = exports.HeroSplit = exports.Hero = exports.Footer = exports.Header = exports.Navbar = exports.ContactForm = exports.FAQ = exports.Accordion = exports.TestimonialCard = exports.PricingCard = exports.ServiceCard = exports.ProductCard = exports.List = exports.Box = exports.Section = exports.Grid = exports.Image = exports.Quote = exports.Badge = exports.Paragraph = exports.Heading = exports.Text = exports.Dialog = exports.Card = exports.Button = void 0;
|
|
22
|
+
__exportStar(require("./EditableText"), exports);
|
|
23
|
+
__exportStar(require("./EditableImage"), exports);
|
|
24
|
+
__exportStar(require("./EditableList"), exports);
|
|
25
|
+
__exportStar(require("./EditableBox"), exports);
|
|
26
|
+
__exportStar(require("./EditableGrid"), exports);
|
|
27
|
+
__exportStar(require("./EditableSection"), exports);
|
|
28
|
+
__exportStar(require("./EditableProductCard"), exports);
|
|
29
|
+
__exportStar(require("./EditableServiceCard"), exports);
|
|
30
|
+
__exportStar(require("./EditableCard"), exports);
|
|
31
|
+
__exportStar(require("./EditablePricingCard"), exports);
|
|
32
|
+
__exportStar(require("./EditableTestimonialCard"), exports);
|
|
33
|
+
__exportStar(require("./EditableFAQAccordion"), exports);
|
|
34
|
+
__exportStar(require("./EditableContactForm"), exports);
|
|
35
|
+
__exportStar(require("./EditableNavbar"), exports);
|
|
36
|
+
__exportStar(require("./EditableFooter"), exports);
|
|
37
|
+
__exportStar(require("./EditableHero"), exports);
|
|
38
|
+
__exportStar(require("./EditableDialog"), exports);
|
|
39
|
+
__exportStar(require("./ThemeStyles"), exports);
|
|
40
|
+
__exportStar(require("./SiteDataProvider"), exports);
|
|
41
|
+
// Smart template components & actions
|
|
42
|
+
__exportStar(require("./utils"), exports);
|
|
43
|
+
__exportStar(require("./core"), exports);
|
|
44
|
+
__exportStar(require("./contact"), exports);
|
|
45
|
+
__exportStar(require("./location"), exports);
|
|
46
|
+
__exportStar(require("./social"), exports);
|
|
47
|
+
__exportStar(require("./business"), exports);
|
|
48
|
+
// Canonical DENEB UI Component Aliases (shadcn / HeroUI style)
|
|
49
|
+
var EditableText_1 = require("./EditableText");
|
|
50
|
+
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return EditableText_1.EditableButton; } });
|
|
51
|
+
var EditableCard_1 = require("./EditableCard");
|
|
52
|
+
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return EditableCard_1.EditableCard; } });
|
|
53
|
+
var EditableDialog_1 = require("./EditableDialog");
|
|
54
|
+
Object.defineProperty(exports, "Dialog", { enumerable: true, get: function () { return EditableDialog_1.EditableDialog; } });
|
|
55
|
+
var EditableText_2 = require("./EditableText");
|
|
56
|
+
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return EditableText_2.EditableText; } });
|
|
57
|
+
var EditableText_3 = require("./EditableText");
|
|
58
|
+
Object.defineProperty(exports, "Heading", { enumerable: true, get: function () { return EditableText_3.EditableHeading; } });
|
|
59
|
+
var EditableText_4 = require("./EditableText");
|
|
60
|
+
Object.defineProperty(exports, "Paragraph", { enumerable: true, get: function () { return EditableText_4.EditableParagraph; } });
|
|
61
|
+
var EditableText_5 = require("./EditableText");
|
|
62
|
+
Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return EditableText_5.EditableBadge; } });
|
|
63
|
+
var EditableText_6 = require("./EditableText");
|
|
64
|
+
Object.defineProperty(exports, "Quote", { enumerable: true, get: function () { return EditableText_6.EditableQuote; } });
|
|
65
|
+
var EditableImage_1 = require("./EditableImage");
|
|
66
|
+
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return EditableImage_1.EditableImage; } });
|
|
67
|
+
var EditableGrid_1 = require("./EditableGrid");
|
|
68
|
+
Object.defineProperty(exports, "Grid", { enumerable: true, get: function () { return EditableGrid_1.EditableGrid; } });
|
|
69
|
+
var EditableSection_1 = require("./EditableSection");
|
|
70
|
+
Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return EditableSection_1.EditableSection; } });
|
|
71
|
+
var EditableBox_1 = require("./EditableBox");
|
|
72
|
+
Object.defineProperty(exports, "Box", { enumerable: true, get: function () { return EditableBox_1.EditableBox; } });
|
|
73
|
+
var EditableList_1 = require("./EditableList");
|
|
74
|
+
Object.defineProperty(exports, "List", { enumerable: true, get: function () { return EditableList_1.EditableList; } });
|
|
75
|
+
var EditableProductCard_1 = require("./EditableProductCard");
|
|
76
|
+
Object.defineProperty(exports, "ProductCard", { enumerable: true, get: function () { return EditableProductCard_1.EditableProductCard; } });
|
|
77
|
+
var EditableServiceCard_1 = require("./EditableServiceCard");
|
|
78
|
+
Object.defineProperty(exports, "ServiceCard", { enumerable: true, get: function () { return EditableServiceCard_1.EditableServiceCard; } });
|
|
79
|
+
var EditablePricingCard_1 = require("./EditablePricingCard");
|
|
80
|
+
Object.defineProperty(exports, "PricingCard", { enumerable: true, get: function () { return EditablePricingCard_1.EditablePricingCard; } });
|
|
81
|
+
var EditableTestimonialCard_1 = require("./EditableTestimonialCard");
|
|
82
|
+
Object.defineProperty(exports, "TestimonialCard", { enumerable: true, get: function () { return EditableTestimonialCard_1.EditableTestimonialCard; } });
|
|
83
|
+
var EditableFAQAccordion_1 = require("./EditableFAQAccordion");
|
|
84
|
+
Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return EditableFAQAccordion_1.EditableFAQAccordion; } });
|
|
85
|
+
Object.defineProperty(exports, "FAQ", { enumerable: true, get: function () { return EditableFAQAccordion_1.EditableFAQAccordion; } });
|
|
86
|
+
var EditableContactForm_1 = require("./EditableContactForm");
|
|
87
|
+
Object.defineProperty(exports, "ContactForm", { enumerable: true, get: function () { return EditableContactForm_1.EditableContactForm; } });
|
|
88
|
+
var EditableNavbar_1 = require("./EditableNavbar");
|
|
89
|
+
Object.defineProperty(exports, "Navbar", { enumerable: true, get: function () { return EditableNavbar_1.EditableNavbar; } });
|
|
90
|
+
Object.defineProperty(exports, "Header", { enumerable: true, get: function () { return EditableNavbar_1.EditableNavbar; } });
|
|
91
|
+
var EditableFooter_1 = require("./EditableFooter");
|
|
92
|
+
Object.defineProperty(exports, "Footer", { enumerable: true, get: function () { return EditableFooter_1.EditableFooter; } });
|
|
93
|
+
var EditableHero_1 = require("./EditableHero");
|
|
94
|
+
Object.defineProperty(exports, "Hero", { enumerable: true, get: function () { return EditableHero_1.EditableHeroCentered; } });
|
|
95
|
+
Object.defineProperty(exports, "HeroSplit", { enumerable: true, get: function () { return EditableHero_1.EditableHeroSplit; } });
|
|
96
|
+
/**
|
|
97
|
+
* DENEB UI Framework Metadata
|
|
98
|
+
* Developed by Chamika Gayashan (CEE G)
|
|
99
|
+
*/
|
|
100
|
+
exports.DENEB_FRAMEWORK_NAME = 'DENEB UI';
|
|
101
|
+
exports.DENEB_FRAMEWORK_VERSION = '2.0.0';
|
|
102
|
+
exports.DENEB_AUTHOR = 'Chamika Gayashan (CEE G)';
|
|
103
|
+
// Backward compatibility alias
|
|
104
|
+
exports.CEEG_FRAMEWORK_NAME = exports.DENEB_FRAMEWORK_NAME;
|
|
105
|
+
exports.CEEG_FRAMEWORK_VERSION = exports.DENEB_FRAMEWORK_VERSION;
|
|
106
|
+
exports.CEEG_AUTHOR = exports.DENEB_AUTHOR;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AddressProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
address?: string | null;
|
|
4
|
+
city?: string | null;
|
|
5
|
+
country?: string | null;
|
|
6
|
+
postalCode?: string | null;
|
|
7
|
+
fieldPath?: string;
|
|
8
|
+
addressFieldPath?: string;
|
|
9
|
+
cityFieldPath?: string;
|
|
10
|
+
countryFieldPath?: string;
|
|
11
|
+
postalCodeFieldPath?: string;
|
|
12
|
+
inline?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function Address({ address, city, country, postalCode, fieldPath, addressFieldPath, cityFieldPath, countryFieldPath, postalCodeFieldPath, inline, className, style, ...rest }: AddressProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Address = Address;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
function Address({ address, city, country, postalCode, fieldPath, addressFieldPath = 'common.business.location.address', cityFieldPath = 'common.business.location.city', countryFieldPath = 'common.business.location.country', postalCodeFieldPath, inline = false, className = '', style, ...rest }) {
|
|
7
|
+
if (!address && !city && !country && !postalCode) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
const baseStyles = {
|
|
11
|
+
fontStyle: 'normal',
|
|
12
|
+
lineHeight: 1.5,
|
|
13
|
+
color: 'var(--color-text, #0f172a)',
|
|
14
|
+
...style,
|
|
15
|
+
};
|
|
16
|
+
if (inline) {
|
|
17
|
+
const parts = [
|
|
18
|
+
address,
|
|
19
|
+
city,
|
|
20
|
+
postalCode,
|
|
21
|
+
country,
|
|
22
|
+
].filter(Boolean);
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)("address", { "data-preview-field-path": fieldPath, className: `deneb-address deneb-address-inline ${className}`.trim(), style: baseStyles, ...rest, children: parts.join(', ') }));
|
|
24
|
+
}
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)("address", { className: `deneb-address ${className}`.trim(), style: baseStyles, ...rest, children: [address && ((0, jsx_runtime_1.jsx)("p", { "data-preview-field-path": addressFieldPath, className: "deneb-address-street", style: { margin: '0 0 0.25rem 0' }, children: address })), (city || country || postalCode) && ((0, jsx_runtime_1.jsxs)("p", { className: "deneb-address-locality", style: { margin: 0 }, children: [city && (0, jsx_runtime_1.jsx)("span", { "data-preview-field-path": cityFieldPath, children: city }), city && (country || postalCode) ? ', ' : null, postalCode && (postalCodeFieldPath ? ((0, jsx_runtime_1.jsxs)("span", { "data-preview-field-path": postalCodeFieldPath, children: [postalCode, " "] })) : ((0, jsx_runtime_1.jsxs)("span", { "data-preview-static": "address-postal-code", children: [postalCode, " "] }))), country && (0, jsx_runtime_1.jsx)("span", { "data-preview-field-path": countryFieldPath, children: country })] }))] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface LocationCardProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
titleFieldPath?: string;
|
|
5
|
+
address?: string | null;
|
|
6
|
+
city?: string | null;
|
|
7
|
+
country?: string | null;
|
|
8
|
+
postalCode?: string | null;
|
|
9
|
+
mapUrl?: string | null;
|
|
10
|
+
fieldPath?: string;
|
|
11
|
+
addressFieldPath?: string;
|
|
12
|
+
mapUrlFieldPath?: string;
|
|
13
|
+
directionsLabel?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Premium storefront LocationCard displaying address, pin icon, and Google Maps directions button.
|
|
19
|
+
*/
|
|
20
|
+
export declare function LocationCard({ title, titleFieldPath, address, city, country, postalCode, mapUrl, fieldPath, addressFieldPath, mapUrlFieldPath, directionsLabel, className, style, }: LocationCardProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LocationCard = LocationCard;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const Address_1 = require("./Address");
|
|
7
|
+
const MapLink_1 = require("./MapLink");
|
|
8
|
+
const EditableText_1 = require("../EditableText");
|
|
9
|
+
/**
|
|
10
|
+
* Premium storefront LocationCard displaying address, pin icon, and Google Maps directions button.
|
|
11
|
+
*/
|
|
12
|
+
function LocationCard({ title = 'Our Location', titleFieldPath, address, city, country, postalCode, mapUrl, fieldPath, addressFieldPath = 'common.business.location.address', mapUrlFieldPath = 'common.business.location.mapUrl', directionsLabel = 'Get Directions →', className = '', style, }) {
|
|
13
|
+
if (!address && !city && !country && !mapUrl) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const cardStyles = {
|
|
17
|
+
padding: '2rem',
|
|
18
|
+
borderRadius: '1rem',
|
|
19
|
+
border: '1px solid var(--color-border, #e2e8f0)',
|
|
20
|
+
backgroundColor: 'var(--color-surface, #ffffff)',
|
|
21
|
+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.03)',
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
textAlign: 'center',
|
|
26
|
+
gap: '1rem',
|
|
27
|
+
maxWidth: '400px',
|
|
28
|
+
...style,
|
|
29
|
+
};
|
|
30
|
+
const iconCircleStyles = {
|
|
31
|
+
width: '48px',
|
|
32
|
+
height: '48px',
|
|
33
|
+
borderRadius: '50%',
|
|
34
|
+
backgroundColor: 'var(--color-secondary, #f1f5f9)',
|
|
35
|
+
color: 'var(--color-primary, #0f172a)',
|
|
36
|
+
display: 'flex',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
};
|
|
40
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `deneb-location-card ${className}`.trim(), style: cardStyles, children: [(0, jsx_runtime_1.jsx)("div", { style: iconCircleStyles, children: (0, jsx_runtime_1.jsxs)("svg", { "data-preview-static": "location-card-icon", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "10", r: "3" })] }) }), titleFieldPath ? ((0, jsx_runtime_1.jsx)(EditableText_1.EditableText, { as: "h3", id: titleFieldPath, defaultValue: title, style: { margin: 0, fontSize: '1.25rem', fontWeight: 600, color: 'var(--color-text, #0f172a)' } })) : ((0, jsx_runtime_1.jsx)("h3", { "data-preview-static": "location-card-title", style: { margin: 0, fontSize: '1.25rem', fontWeight: 600, color: 'var(--color-text, #0f172a)' }, children: title })), (0, jsx_runtime_1.jsx)(Address_1.Address, { address: address, city: city, country: country, postalCode: postalCode, fieldPath: fieldPath, addressFieldPath: addressFieldPath }), (0, jsx_runtime_1.jsx)("div", { style: { marginTop: '0.5rem', width: '100%' }, children: (0, jsx_runtime_1.jsx)(MapLink_1.MapLink, { mapUrl: mapUrl, address: address, city: city, country: country, label: directionsLabel, fieldPath: mapUrlFieldPath, variant: "primary", size: "md", style: { width: '100%' } }) })] }));
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface LocationLinkProps {
|
|
3
|
+
address?: string | null;
|
|
4
|
+
city?: string | null;
|
|
5
|
+
country?: string | null;
|
|
6
|
+
mapUrl?: string | null;
|
|
7
|
+
fieldPath?: string;
|
|
8
|
+
addressFieldPath?: string;
|
|
9
|
+
mapUrlFieldPath?: string;
|
|
10
|
+
directionsLabel?: string;
|
|
11
|
+
showAddress?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Combines physical address with an interactive "Get Directions" action.
|
|
17
|
+
*/
|
|
18
|
+
export declare function LocationLink({ address, city, country, mapUrl, fieldPath, addressFieldPath, mapUrlFieldPath, directionsLabel, showAddress, className, style, }: LocationLinkProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.LocationLink = LocationLink;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const Address_1 = require("./Address");
|
|
7
|
+
const MapLink_1 = require("./MapLink");
|
|
8
|
+
/**
|
|
9
|
+
* Combines physical address with an interactive "Get Directions" action.
|
|
10
|
+
*/
|
|
11
|
+
function LocationLink({ address, city, country, mapUrl, fieldPath, addressFieldPath = 'common.business.location.address', mapUrlFieldPath = 'common.business.location.mapUrl', directionsLabel = 'Get Directions', showAddress = true, className = '', style, }) {
|
|
12
|
+
if (!address && !city && !country && !mapUrl) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const containerStyles = {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
gap: '0.5rem',
|
|
19
|
+
alignItems: 'flex-start',
|
|
20
|
+
...style,
|
|
21
|
+
};
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `deneb-location-link ${className}`.trim(), style: containerStyles, children: [showAddress && ((0, jsx_runtime_1.jsx)(Address_1.Address, { address: address, city: city, country: country, fieldPath: fieldPath, addressFieldPath: addressFieldPath })), (0, jsx_runtime_1.jsx)(MapLink_1.MapLink, { mapUrl: mapUrl, address: address, city: city, country: country, label: directionsLabel, fieldPath: mapUrlFieldPath, variant: "outline", size: "sm" })] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MapEmbedProps {
|
|
3
|
+
embedUrl?: string | null;
|
|
4
|
+
mapUrl?: string | null;
|
|
5
|
+
address?: string | null;
|
|
6
|
+
city?: string | null;
|
|
7
|
+
country?: string | null;
|
|
8
|
+
title?: string;
|
|
9
|
+
fieldPath?: string;
|
|
10
|
+
height?: number | string;
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Safe, responsive Google Maps Embed component with automatic fallback to MapLink
|
|
16
|
+
* when an embed URL is not yet configured by the merchant.
|
|
17
|
+
*/
|
|
18
|
+
export declare function MapEmbed({ embedUrl, mapUrl, address, city, country, title, fieldPath, height, className, style, }: MapEmbedProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MapEmbed = MapEmbed;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const MapLink_1 = require("./MapLink");
|
|
7
|
+
/**
|
|
8
|
+
* Safe, responsive Google Maps Embed component with automatic fallback to MapLink
|
|
9
|
+
* when an embed URL is not yet configured by the merchant.
|
|
10
|
+
*/
|
|
11
|
+
function MapEmbed({ embedUrl, mapUrl, address, city, country, title = 'Business Location Map', fieldPath = 'common.business.location.mapEmbedUrl', height = 360, className = '', style, }) {
|
|
12
|
+
const containerStyles = {
|
|
13
|
+
width: '100%',
|
|
14
|
+
height: typeof height === 'number' ? `${height}px` : height,
|
|
15
|
+
borderRadius: '0.75rem',
|
|
16
|
+
overflow: 'hidden',
|
|
17
|
+
border: '1px solid var(--color-border, #e2e8f0)',
|
|
18
|
+
backgroundColor: 'var(--color-secondary, #f8fafc)',
|
|
19
|
+
position: 'relative',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
...style,
|
|
24
|
+
};
|
|
25
|
+
if (embedUrl && (embedUrl.startsWith('http://') || embedUrl.startsWith('https://'))) {
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `deneb-map-embed ${className}`.trim(), style: containerStyles, children: (0, jsx_runtime_1.jsx)("iframe", { "data-preview-field-path": fieldPath, src: embedUrl, title: title, width: "100%", height: "100%", style: { border: 0 }, loading: "lazy", allowFullScreen: true, referrerPolicy: "no-referrer-when-downgrade" }) }));
|
|
27
|
+
}
|
|
28
|
+
// Fallback when no direct iframe URL is provided
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `deneb-map-embed deneb-map-fallback ${className}`.trim(), style: containerStyles, children: (0, jsx_runtime_1.jsxs)("div", { style: { textAlign: 'center', padding: '1.5rem' }, children: [(0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '0.75rem', opacity: 0.6 }, children: (0, jsx_runtime_1.jsxs)("svg", { "data-preview-static": "map-pin-icon", width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "10", r: "3" })] }) }), (0, jsx_runtime_1.jsx)("p", { "data-preview-static": "map-placeholder-title", style: { margin: '0 0 0.75rem 0', fontWeight: 500, color: 'var(--color-text, #0f172a)' }, children: address ? `${address}${city ? `, ${city}` : ''}` : 'Location Map' }), (0, jsx_runtime_1.jsx)(MapLink_1.MapLink, { mapUrl: mapUrl, address: address, city: city, country: country, label: "Open in Google Maps \u2197", variant: "primary", size: "sm" })] }) }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MapLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
|
+
mapUrl?: string | null;
|
|
4
|
+
address?: string | null;
|
|
5
|
+
city?: string | null;
|
|
6
|
+
country?: string | null;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
fieldPath?: string;
|
|
9
|
+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'link';
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function MapLink({ mapUrl, address, city, country, label, fieldPath, variant, size, icon, className, style, ...rest }: MapLinkProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MapLink = MapLink;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const urls_1 = require("../utils/urls");
|
|
7
|
+
function MapLink({ mapUrl, address, city, country, label = 'Get Directions', fieldPath = 'common.business.location.mapUrl', variant = 'outline', size = 'md', icon, className = '', style, ...rest }) {
|
|
8
|
+
const resolvedHref = (0, urls_1.createMapUrl)({ mapUrl, address, city, country });
|
|
9
|
+
const hasFieldPath = Boolean(fieldPath && fieldPath.trim());
|
|
10
|
+
const finalHref = resolvedHref || (hasFieldPath ? '#' : '');
|
|
11
|
+
if (!finalHref)
|
|
12
|
+
return null;
|
|
13
|
+
const defaultIcon = ((0, jsx_runtime_1.jsxs)("svg", { "data-preview-static": "map-link-icon", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "10", r: "3" })] }));
|
|
14
|
+
const baseStyles = {
|
|
15
|
+
display: 'inline-flex',
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
gap: '0.5rem',
|
|
19
|
+
fontWeight: 500,
|
|
20
|
+
textDecoration: 'none',
|
|
21
|
+
transition: 'all 0.2s ease',
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
borderRadius: '0.5rem',
|
|
24
|
+
...style,
|
|
25
|
+
};
|
|
26
|
+
const sizeStyles = {
|
|
27
|
+
sm: { fontSize: '0.875rem', padding: '0.375rem 0.75rem' },
|
|
28
|
+
md: { fontSize: '0.95rem', padding: '0.5rem 1rem' },
|
|
29
|
+
lg: { fontSize: '1.05rem', padding: '0.75rem 1.5rem' },
|
|
30
|
+
};
|
|
31
|
+
const variantStyles = {
|
|
32
|
+
primary: {
|
|
33
|
+
backgroundColor: 'var(--color-primary, #0f172a)',
|
|
34
|
+
color: '#ffffff',
|
|
35
|
+
},
|
|
36
|
+
secondary: {
|
|
37
|
+
backgroundColor: 'var(--color-secondary, #f1f5f9)',
|
|
38
|
+
color: 'var(--color-text, #0f172a)',
|
|
39
|
+
},
|
|
40
|
+
outline: {
|
|
41
|
+
backgroundColor: 'transparent',
|
|
42
|
+
border: '1px solid var(--color-border, #e2e8f0)',
|
|
43
|
+
color: 'var(--color-text, #0f172a)',
|
|
44
|
+
},
|
|
45
|
+
ghost: {
|
|
46
|
+
backgroundColor: 'transparent',
|
|
47
|
+
color: 'var(--color-text, #0f172a)',
|
|
48
|
+
},
|
|
49
|
+
link: {
|
|
50
|
+
backgroundColor: 'transparent',
|
|
51
|
+
color: 'var(--color-primary, #2563eb)',
|
|
52
|
+
padding: 0,
|
|
53
|
+
textDecoration: 'underline',
|
|
54
|
+
borderRadius: 0,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const mergedStyles = {
|
|
58
|
+
...baseStyles,
|
|
59
|
+
...(variant !== 'link' ? sizeStyles[size] : {}),
|
|
60
|
+
...variantStyles[variant],
|
|
61
|
+
};
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)("a", { href: finalHref, "data-preview-field-path": fieldPath, target: finalHref !== '#' ? '_blank' : undefined, rel: finalHref !== '#' ? 'noopener noreferrer' : undefined, className: `deneb-map-link ${className}`.trim(), style: mergedStyles, ...rest, children: [icon !== undefined ? icon : defaultIcon, label] }));
|
|
63
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Address"), exports);
|
|
18
|
+
__exportStar(require("./MapLink"), exports);
|
|
19
|
+
__exportStar(require("./LocationLink"), exports);
|
|
20
|
+
__exportStar(require("./LocationCard"), exports);
|
|
21
|
+
__exportStar(require("./MapEmbed"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type SocialPlatform = 'instagram' | 'facebook' | 'tiktok' | 'youtube' | 'linkedin' | 'twitter' | 'x' | 'pinterest' | 'github';
|
|
3
|
+
export interface SocialButtonProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
platform: SocialPlatform;
|
|
5
|
+
url?: string | null;
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
fieldPath?: string;
|
|
8
|
+
variant?: 'icon' | 'pill' | 'button';
|
|
9
|
+
size?: 'sm' | 'md' | 'lg';
|
|
10
|
+
}
|
|
11
|
+
export declare function SocialButton({ platform, url, href, label, fieldPath, variant, size, className, style, ...rest }: SocialButtonProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SocialButton = SocialButton;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const PLATFORM_CONFIG = {
|
|
7
|
+
instagram: {
|
|
8
|
+
label: 'Instagram',
|
|
9
|
+
bg: '#E4405F',
|
|
10
|
+
color: '#ffffff',
|
|
11
|
+
icon: (s) => ((0, jsx_runtime_1.jsxs)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("rect", { width: "20", height: "20", x: "2", y: "2", rx: "5", ry: "5" }), (0, jsx_runtime_1.jsx)("path", { d: "M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z" }), (0, jsx_runtime_1.jsx)("line", { x1: "17.5", x2: "17.51", y1: "6.5", y2: "6.5" })] })),
|
|
12
|
+
},
|
|
13
|
+
facebook: {
|
|
14
|
+
label: 'Facebook',
|
|
15
|
+
bg: '#1877F2',
|
|
16
|
+
color: '#ffffff',
|
|
17
|
+
icon: (s) => ((0, jsx_runtime_1.jsx)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: (0, jsx_runtime_1.jsx)("path", { d: "M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z" }) })),
|
|
18
|
+
},
|
|
19
|
+
tiktok: {
|
|
20
|
+
label: 'TikTok',
|
|
21
|
+
bg: '#000000',
|
|
22
|
+
color: '#ffffff',
|
|
23
|
+
icon: (s) => ((0, jsx_runtime_1.jsx)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: (0, jsx_runtime_1.jsx)("path", { d: "M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5" }) })),
|
|
24
|
+
},
|
|
25
|
+
youtube: {
|
|
26
|
+
label: 'YouTube',
|
|
27
|
+
bg: '#FF0000',
|
|
28
|
+
color: '#ffffff',
|
|
29
|
+
icon: (s) => ((0, jsx_runtime_1.jsxs)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17" }), (0, jsx_runtime_1.jsx)("polygon", { points: "10 15 15 12 10 9 10 15" })] })),
|
|
30
|
+
},
|
|
31
|
+
linkedin: {
|
|
32
|
+
label: 'LinkedIn',
|
|
33
|
+
bg: '#0A66C2',
|
|
34
|
+
color: '#ffffff',
|
|
35
|
+
icon: (s) => ((0, jsx_runtime_1.jsxs)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z" }), (0, jsx_runtime_1.jsx)("rect", { width: "4", height: "12", x: "2", y: "9" }), (0, jsx_runtime_1.jsx)("circle", { cx: "4", cy: "4", r: "2" })] })),
|
|
36
|
+
},
|
|
37
|
+
twitter: {
|
|
38
|
+
label: 'Twitter',
|
|
39
|
+
bg: '#1DA1F2',
|
|
40
|
+
color: '#ffffff',
|
|
41
|
+
icon: (s) => ((0, jsx_runtime_1.jsx)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: (0, jsx_runtime_1.jsx)("path", { d: "M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z" }) })),
|
|
42
|
+
},
|
|
43
|
+
x: {
|
|
44
|
+
label: 'X',
|
|
45
|
+
bg: '#0f172a',
|
|
46
|
+
color: '#ffffff',
|
|
47
|
+
icon: (s) => ((0, jsx_runtime_1.jsx)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" }) })),
|
|
48
|
+
},
|
|
49
|
+
pinterest: {
|
|
50
|
+
label: 'Pinterest',
|
|
51
|
+
bg: '#BD081C',
|
|
52
|
+
color: '#ffffff',
|
|
53
|
+
icon: (s) => ((0, jsx_runtime_1.jsxs)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("line", { x1: "12", x2: "12", y1: "8", y2: "16" }), (0, jsx_runtime_1.jsx)("line", { x1: "8", x2: "16", y1: "12", y2: "12" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10" })] })),
|
|
54
|
+
},
|
|
55
|
+
github: {
|
|
56
|
+
label: 'GitHub',
|
|
57
|
+
bg: '#24292e',
|
|
58
|
+
color: '#ffffff',
|
|
59
|
+
icon: (s) => ((0, jsx_runtime_1.jsxs)("svg", { width: s, height: s, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" }), (0, jsx_runtime_1.jsx)("path", { d: "M9 18c-4.51 2-5-2-7-2" })] })),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
function SocialButton({ platform, url, href, label, fieldPath, variant = 'icon', size = 'md', className = '', style, ...rest }) {
|
|
63
|
+
const derivedFieldPath = fieldPath || `common.business.social.${platform}`;
|
|
64
|
+
const hasFieldPath = Boolean(fieldPath);
|
|
65
|
+
const targetUrl = url || href || (hasFieldPath ? '#' : '');
|
|
66
|
+
// Don't render broken button if no valid URL and no fieldPath
|
|
67
|
+
if (!targetUrl)
|
|
68
|
+
return null;
|
|
69
|
+
const config = PLATFORM_CONFIG[platform] || PLATFORM_CONFIG.x;
|
|
70
|
+
const iconSize = size === 'sm' ? 16 : size === 'lg' ? 22 : 18;
|
|
71
|
+
const baseStyles = {
|
|
72
|
+
display: 'inline-flex',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'center',
|
|
75
|
+
textDecoration: 'none',
|
|
76
|
+
transition: 'transform 0.15s ease, opacity 0.15s ease',
|
|
77
|
+
cursor: 'pointer',
|
|
78
|
+
...style,
|
|
79
|
+
};
|
|
80
|
+
let variantStyles = {};
|
|
81
|
+
if (variant === 'icon') {
|
|
82
|
+
const dim = size === 'sm' ? '32px' : size === 'lg' ? '44px' : '38px';
|
|
83
|
+
variantStyles = {
|
|
84
|
+
width: dim,
|
|
85
|
+
height: dim,
|
|
86
|
+
borderRadius: '50%',
|
|
87
|
+
backgroundColor: 'var(--color-secondary, #f1f5f9)',
|
|
88
|
+
color: 'var(--color-text, #0f172a)',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
else if (variant === 'pill') {
|
|
92
|
+
variantStyles = {
|
|
93
|
+
gap: '0.4rem',
|
|
94
|
+
padding: size === 'sm' ? '0.25rem 0.6rem' : '0.4rem 0.85rem',
|
|
95
|
+
borderRadius: '9999px',
|
|
96
|
+
fontSize: size === 'sm' ? '0.8rem' : '0.9rem',
|
|
97
|
+
backgroundColor: 'var(--color-secondary, #f1f5f9)',
|
|
98
|
+
color: 'var(--color-text, #0f172a)',
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
variantStyles = {
|
|
103
|
+
gap: '0.5rem',
|
|
104
|
+
padding: size === 'sm' ? '0.4rem 0.75rem' : '0.55rem 1.1rem',
|
|
105
|
+
borderRadius: '0.5rem',
|
|
106
|
+
fontSize: size === 'sm' ? '0.85rem' : '0.95rem',
|
|
107
|
+
backgroundColor: config.bg,
|
|
108
|
+
color: config.color,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return ((0, jsx_runtime_1.jsxs)("a", { href: targetUrl, "data-preview-field-path": derivedFieldPath, target: "_blank", rel: "noopener noreferrer", "aria-label": typeof label === 'string' ? label : config.label, className: `deneb-social-btn deneb-social-${platform} deneb-social-${variant} ${className}`.trim(), style: { ...baseStyles, ...variantStyles }, ...rest, children: [config.icon(iconSize), variant !== 'icon' && (0, jsx_runtime_1.jsx)("span", { children: label || config.label })] }));
|
|
112
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SocialLinksProps {
|
|
3
|
+
social?: Record<string, string | null | undefined>;
|
|
4
|
+
fieldPathPrefix?: string;
|
|
5
|
+
variant?: 'icon' | 'pill' | 'button';
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Smart container rendering active social buttons.
|
|
12
|
+
* Automatically filters out any unconfigured or empty platforms.
|
|
13
|
+
*/
|
|
14
|
+
export declare function SocialLinks({ social, fieldPathPrefix, variant, size, className, style, }: SocialLinksProps): React.JSX.Element | null;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.SocialLinks = SocialLinks;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const SocialButton_1 = require("./SocialButton");
|
|
7
|
+
const SUPPORTED_PLATFORMS = [
|
|
8
|
+
'instagram',
|
|
9
|
+
'facebook',
|
|
10
|
+
'tiktok',
|
|
11
|
+
'youtube',
|
|
12
|
+
'linkedin',
|
|
13
|
+
'twitter',
|
|
14
|
+
'x',
|
|
15
|
+
'pinterest',
|
|
16
|
+
'github',
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Smart container rendering active social buttons.
|
|
20
|
+
* Automatically filters out any unconfigured or empty platforms.
|
|
21
|
+
*/
|
|
22
|
+
function SocialLinks({ social = {}, fieldPathPrefix = 'common.business.social', variant = 'icon', size = 'md', className = '', style, }) {
|
|
23
|
+
// Find platforms with valid URLs
|
|
24
|
+
const activePlatforms = Object.entries(social).filter(([platform, url]) => {
|
|
25
|
+
return Boolean(url && typeof url === 'string' && url.trim().length > 0);
|
|
26
|
+
});
|
|
27
|
+
if (activePlatforms.length === 0) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const containerStyles = {
|
|
31
|
+
display: 'inline-flex',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
flexWrap: 'wrap',
|
|
34
|
+
gap: '0.625rem',
|
|
35
|
+
...style,
|
|
36
|
+
};
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `deneb-social-links ${className}`.trim(), style: containerStyles, children: activePlatforms.map(([key, url]) => {
|
|
38
|
+
const lowerKey = key.toLowerCase();
|
|
39
|
+
const platform = SUPPORTED_PLATFORMS.includes(lowerKey) ? lowerKey : 'x';
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(SocialButton_1.SocialButton, { platform: platform, url: url, fieldPath: `${fieldPathPrefix}.${key}`, variant: variant, size: size }, key));
|
|
41
|
+
}) }));
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./SocialButton"), exports);
|
|
18
|
+
__exportStar(require("./SocialLinks"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './urls';
|