@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
|
@@ -0,0 +1,17 @@
|
|
|
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("./urls"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DENEB UI — URL & Action Helpers
|
|
3
|
+
* Created by Chamika Gayashan (CEE G)
|
|
4
|
+
*/
|
|
5
|
+
export interface MapLocationInput {
|
|
6
|
+
mapUrl?: string | null;
|
|
7
|
+
address?: string | null;
|
|
8
|
+
city?: string | null;
|
|
9
|
+
country?: string | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates a valid WhatsApp click-to-chat URL.
|
|
13
|
+
* Automatically cleans spaces, dashes, and special characters from the phone number.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createWhatsAppUrl(phone?: string | null, message?: string | null): string;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a telephone URI for one-click calling.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createPhoneUrl(phone?: string | null): string;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an email mailto: URI with optional subject and body.
|
|
22
|
+
*/
|
|
23
|
+
export declare function createEmailUrl(email?: string | null, subject?: string | null, body?: string | null): string;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a Google Maps search or direction URL.
|
|
26
|
+
* Prefers an explicit mapUrl, otherwise constructs a query using address, city, and country.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createMapUrl(location?: MapLocationInput | string | null): string;
|
|
29
|
+
/**
|
|
30
|
+
* Validates if a string is a safe, valid external link (prevents script injection).
|
|
31
|
+
*/
|
|
32
|
+
export declare function isSafeExternalLink(url?: string | null): boolean;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DENEB UI — URL & Action Helpers
|
|
4
|
+
* Created by Chamika Gayashan (CEE G)
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.createWhatsAppUrl = createWhatsAppUrl;
|
|
8
|
+
exports.createPhoneUrl = createPhoneUrl;
|
|
9
|
+
exports.createEmailUrl = createEmailUrl;
|
|
10
|
+
exports.createMapUrl = createMapUrl;
|
|
11
|
+
exports.isSafeExternalLink = isSafeExternalLink;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a valid WhatsApp click-to-chat URL.
|
|
14
|
+
* Automatically cleans spaces, dashes, and special characters from the phone number.
|
|
15
|
+
*/
|
|
16
|
+
function createWhatsAppUrl(phone, message) {
|
|
17
|
+
if (!phone)
|
|
18
|
+
return '';
|
|
19
|
+
const cleanPhone = phone.replace(/[^0-9]/g, '');
|
|
20
|
+
if (!cleanPhone)
|
|
21
|
+
return '';
|
|
22
|
+
const baseUrl = `https://wa.me/${cleanPhone}`;
|
|
23
|
+
if (message && message.trim()) {
|
|
24
|
+
return `${baseUrl}?text=${encodeURIComponent(message.trim())}`;
|
|
25
|
+
}
|
|
26
|
+
return baseUrl;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a telephone URI for one-click calling.
|
|
30
|
+
*/
|
|
31
|
+
function createPhoneUrl(phone) {
|
|
32
|
+
if (!phone)
|
|
33
|
+
return '';
|
|
34
|
+
const cleanPhone = phone.replace(/[^0-9+]/g, '');
|
|
35
|
+
return cleanPhone ? `tel:${cleanPhone}` : '';
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates an email mailto: URI with optional subject and body.
|
|
39
|
+
*/
|
|
40
|
+
function createEmailUrl(email, subject, body) {
|
|
41
|
+
if (!email || !email.trim())
|
|
42
|
+
return '';
|
|
43
|
+
const cleanEmail = email.trim();
|
|
44
|
+
const params = [];
|
|
45
|
+
if (subject && subject.trim()) {
|
|
46
|
+
params.push(`subject=${encodeURIComponent(subject.trim())}`);
|
|
47
|
+
}
|
|
48
|
+
if (body && body.trim()) {
|
|
49
|
+
params.push(`body=${encodeURIComponent(body.trim())}`);
|
|
50
|
+
}
|
|
51
|
+
return params.length > 0 ? `mailto:${cleanEmail}?${params.join('&')}` : `mailto:${cleanEmail}`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates a Google Maps search or direction URL.
|
|
55
|
+
* Prefers an explicit mapUrl, otherwise constructs a query using address, city, and country.
|
|
56
|
+
*/
|
|
57
|
+
function createMapUrl(location) {
|
|
58
|
+
if (!location)
|
|
59
|
+
return '';
|
|
60
|
+
if (typeof location === 'string') {
|
|
61
|
+
if (location.startsWith('http://') || location.startsWith('https://')) {
|
|
62
|
+
return location;
|
|
63
|
+
}
|
|
64
|
+
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(location)}`;
|
|
65
|
+
}
|
|
66
|
+
if (location.mapUrl && location.mapUrl.trim()) {
|
|
67
|
+
return location.mapUrl.trim();
|
|
68
|
+
}
|
|
69
|
+
const queryParts = [location.address, location.city, location.country]
|
|
70
|
+
.filter((part) => Boolean(part && part.trim()))
|
|
71
|
+
.map((part) => part.trim());
|
|
72
|
+
if (queryParts.length > 0) {
|
|
73
|
+
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(queryParts.join(', '))}`;
|
|
74
|
+
}
|
|
75
|
+
return '';
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Validates if a string is a safe, valid external link (prevents script injection).
|
|
79
|
+
*/
|
|
80
|
+
function isSafeExternalLink(url) {
|
|
81
|
+
if (!url || typeof url !== 'string')
|
|
82
|
+
return false;
|
|
83
|
+
const trimmed = url.trim().toLowerCase();
|
|
84
|
+
return (trimmed.startsWith('https://') ||
|
|
85
|
+
trimmed.startsWith('http://') ||
|
|
86
|
+
trimmed.startsWith('tel:') ||
|
|
87
|
+
trimmed.startsWith('mailto:') ||
|
|
88
|
+
trimmed.startsWith('//') ||
|
|
89
|
+
trimmed.startsWith('/') ||
|
|
90
|
+
trimmed.startsWith('#'));
|
|
91
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deneb-ui/ui",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "DENEB UI - The Visual-First React Framework for High-Converting Fivora Storefronts, created by Chamika Gayashan (CEE G).",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"deneb",
|
|
20
|
+
"deneb-ui",
|
|
21
|
+
"fivora",
|
|
22
|
+
"ecommerce",
|
|
23
|
+
"shadcn",
|
|
24
|
+
"heroui",
|
|
25
|
+
"visual-editing",
|
|
26
|
+
"nextjs",
|
|
27
|
+
"react"
|
|
28
|
+
],
|
|
29
|
+
"author": "Chamika Gayashan (CEE G)",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
34
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/react": "^19.0.0",
|
|
38
|
+
"@types/react-dom": "^19.0.0",
|
|
39
|
+
"typescript": "^5.0.0"
|
|
40
|
+
}
|
|
41
|
+
}
|