@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.
Files changed (84) hide show
  1. package/README.md +182 -0
  2. package/dist/EditableBox.d.ts +56 -0
  3. package/dist/EditableBox.js +113 -0
  4. package/dist/EditableCard.d.ts +48 -0
  5. package/dist/EditableCard.js +85 -0
  6. package/dist/EditableContactForm.d.ts +11 -0
  7. package/dist/EditableContactForm.js +146 -0
  8. package/dist/EditableDialog.d.ts +25 -0
  9. package/dist/EditableDialog.js +145 -0
  10. package/dist/EditableFAQAccordion.d.ts +19 -0
  11. package/dist/EditableFAQAccordion.js +62 -0
  12. package/dist/EditableFooter.d.ts +31 -0
  13. package/dist/EditableFooter.js +330 -0
  14. package/dist/EditableGrid.d.ts +40 -0
  15. package/dist/EditableGrid.js +39 -0
  16. package/dist/EditableHero.d.ts +27 -0
  17. package/dist/EditableHero.js +154 -0
  18. package/dist/EditableImage.d.ts +13 -0
  19. package/dist/EditableImage.js +38 -0
  20. package/dist/EditableList.d.ts +33 -0
  21. package/dist/EditableList.js +19 -0
  22. package/dist/EditableNavbar.d.ts +28 -0
  23. package/dist/EditableNavbar.js +178 -0
  24. package/dist/EditablePricingCard.d.ts +31 -0
  25. package/dist/EditablePricingCard.js +93 -0
  26. package/dist/EditableProductCard.d.ts +60 -0
  27. package/dist/EditableProductCard.js +116 -0
  28. package/dist/EditableSection.d.ts +35 -0
  29. package/dist/EditableSection.js +34 -0
  30. package/dist/EditableServiceCard.d.ts +38 -0
  31. package/dist/EditableServiceCard.js +28 -0
  32. package/dist/EditableTestimonialCard.d.ts +17 -0
  33. package/dist/EditableTestimonialCard.js +46 -0
  34. package/dist/EditableText.d.ts +117 -0
  35. package/dist/EditableText.js +319 -0
  36. package/dist/SiteDataProvider.d.ts +61 -0
  37. package/dist/SiteDataProvider.js +316 -0
  38. package/dist/ThemeStyles.d.ts +46 -0
  39. package/dist/ThemeStyles.js +181 -0
  40. package/dist/business/BusinessHours.d.ts +20 -0
  41. package/dist/business/BusinessHours.js +109 -0
  42. package/dist/business/index.d.ts +1 -0
  43. package/dist/business/index.js +17 -0
  44. package/dist/contact/ContactActions.d.ts +24 -0
  45. package/dist/contact/ContactActions.js +30 -0
  46. package/dist/contact/ContactButton.d.ts +15 -0
  47. package/dist/contact/ContactButton.js +94 -0
  48. package/dist/contact/EmailButton.d.ts +6 -0
  49. package/dist/contact/EmailButton.js +12 -0
  50. package/dist/contact/PhoneButton.d.ts +6 -0
  51. package/dist/contact/PhoneButton.js +12 -0
  52. package/dist/contact/WhatsAppButton.d.ts +6 -0
  53. package/dist/contact/WhatsAppButton.js +13 -0
  54. package/dist/contact/index.d.ts +5 -0
  55. package/dist/contact/index.js +21 -0
  56. package/dist/core/DenebAction.d.ts +19 -0
  57. package/dist/core/DenebAction.js +107 -0
  58. package/dist/core/index.d.ts +1 -0
  59. package/dist/core/index.js +17 -0
  60. package/dist/index.d.ts +61 -0
  61. package/dist/index.js +106 -0
  62. package/dist/location/Address.d.ts +14 -0
  63. package/dist/location/Address.js +26 -0
  64. package/dist/location/LocationCard.d.ts +20 -0
  65. package/dist/location/LocationCard.js +41 -0
  66. package/dist/location/LocationLink.d.ts +18 -0
  67. package/dist/location/LocationLink.js +23 -0
  68. package/dist/location/MapEmbed.d.ts +18 -0
  69. package/dist/location/MapEmbed.js +30 -0
  70. package/dist/location/MapLink.d.ts +13 -0
  71. package/dist/location/MapLink.js +63 -0
  72. package/dist/location/index.d.ts +5 -0
  73. package/dist/location/index.js +21 -0
  74. package/dist/social/SocialButton.d.ts +11 -0
  75. package/dist/social/SocialButton.js +112 -0
  76. package/dist/social/SocialLinks.d.ts +14 -0
  77. package/dist/social/SocialLinks.js +42 -0
  78. package/dist/social/index.d.ts +2 -0
  79. package/dist/social/index.js +18 -0
  80. package/dist/utils/index.d.ts +1 -0
  81. package/dist/utils/index.js +17 -0
  82. package/dist/utils/urls.d.ts +32 -0
  83. package/dist/utils/urls.js +91 -0
  84. package/package.json +41 -0
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ export interface DialogProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ open?: boolean;
4
+ onClose?: () => void;
5
+ title?: string;
6
+ description?: string;
7
+ titleFieldPath?: string;
8
+ descriptionFieldPath?: string;
9
+ size?: 'sm' | 'md' | 'lg' | 'xl' | 'full';
10
+ showCloseButton?: boolean;
11
+ footerSlot?: React.ReactNode;
12
+ }
13
+ /**
14
+ * Dialog (Modal) component for DENEB UI.
15
+ * Features backdrop blur, keyboard Escape to close, smooth scaling animation,
16
+ * and optional live visual editing for title and description.
17
+ */
18
+ export declare function EditableDialog({ open, onClose, title, description, titleFieldPath, descriptionFieldPath, size, showCloseButton, footerSlot, children, className, style, ...props }: DialogProps): React.JSX.Element | null;
19
+ export interface DialogContentProps extends React.HTMLAttributes<HTMLDivElement> {
20
+ }
21
+ export declare function DialogHeader({ className, style, children, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
22
+ export declare function DialogTitle({ className, style, children, ...props }: React.HTMLAttributes<HTMLHeadingElement>): React.JSX.Element;
23
+ export declare function DialogDescription({ className, style, children, ...props }: React.HTMLAttributes<HTMLParagraphElement>): React.JSX.Element;
24
+ export declare function DialogFooter({ className, style, children, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
25
+ export declare const Dialog: typeof EditableDialog;
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Dialog = void 0;
4
+ exports.EditableDialog = EditableDialog;
5
+ exports.DialogHeader = DialogHeader;
6
+ exports.DialogTitle = DialogTitle;
7
+ exports.DialogDescription = DialogDescription;
8
+ exports.DialogFooter = DialogFooter;
9
+ const jsx_runtime_1 = require("react/jsx-runtime");
10
+ const react_1 = require("react");
11
+ const EditableText_1 = require("./EditableText");
12
+ const SIZE_MAP = {
13
+ sm: '400px',
14
+ md: '540px',
15
+ lg: '720px',
16
+ xl: '900px',
17
+ full: '96vw',
18
+ };
19
+ /**
20
+ * Dialog (Modal) component for DENEB UI.
21
+ * Features backdrop blur, keyboard Escape to close, smooth scaling animation,
22
+ * and optional live visual editing for title and description.
23
+ */
24
+ function EditableDialog({ open = false, onClose, title, description, titleFieldPath, descriptionFieldPath, size = 'md', showCloseButton = true, footerSlot, children, className = '', style, ...props }) {
25
+ // Handle ESC key press to close
26
+ (0, react_1.useEffect)(() => {
27
+ if (!open)
28
+ return;
29
+ const handleKeyDown = (e) => {
30
+ if (e.key === 'Escape' && onClose) {
31
+ onClose();
32
+ }
33
+ };
34
+ window.addEventListener('keydown', handleKeyDown);
35
+ return () => window.removeEventListener('keydown', handleKeyDown);
36
+ }, [open, onClose]);
37
+ // Lock body scroll when open
38
+ (0, react_1.useEffect)(() => {
39
+ if (open) {
40
+ const originalOverflow = document.body.style.overflow;
41
+ document.body.style.overflow = 'hidden';
42
+ return () => {
43
+ document.body.style.overflow = originalOverflow;
44
+ };
45
+ }
46
+ }, [open]);
47
+ if (!open)
48
+ return null;
49
+ const maxWidth = SIZE_MAP[size] || SIZE_MAP.md;
50
+ return ((0, jsx_runtime_1.jsxs)("div", { role: "dialog", "aria-modal": "true", style: {
51
+ position: 'fixed',
52
+ inset: 0,
53
+ zIndex: 9999,
54
+ display: 'flex',
55
+ alignItems: 'center',
56
+ justifyContent: 'center',
57
+ padding: '1rem',
58
+ }, className: `deneb-dialog-portal ${className}`.trim(), ...props, children: [(0, jsx_runtime_1.jsx)("div", { onClick: onClose, style: {
59
+ position: 'fixed',
60
+ inset: 0,
61
+ backgroundColor: 'rgba(15, 23, 42, 0.65)',
62
+ backdropFilter: 'blur(8px)',
63
+ WebkitBackdropFilter: 'blur(8px)',
64
+ animation: 'deneb-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1)',
65
+ }, className: "deneb-dialog-backdrop" }), (0, jsx_runtime_1.jsxs)("div", { style: {
66
+ position: 'relative',
67
+ width: '100%',
68
+ maxWidth,
69
+ backgroundColor: '#ffffff',
70
+ borderRadius: '20px',
71
+ boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05)',
72
+ padding: '2rem',
73
+ zIndex: 10,
74
+ overflow: 'hidden',
75
+ display: 'flex',
76
+ flexDirection: 'column',
77
+ maxHeight: '90vh',
78
+ animation: 'deneb-zoom-in 0.25s cubic-bezier(0.16, 1, 0.3, 1)',
79
+ ...style,
80
+ }, className: "deneb-dialog-content", children: [(title || titleFieldPath || showCloseButton) && ((0, jsx_runtime_1.jsxs)("div", { style: {
81
+ display: 'flex',
82
+ alignItems: 'flex-start',
83
+ justifyContent: 'space-between',
84
+ marginBottom: description || descriptionFieldPath ? '0.5rem' : '1.25rem',
85
+ }, children: [titleFieldPath ? ((0, jsx_runtime_1.jsx)(EditableText_1.EditableText, { as: "h2", id: titleFieldPath, defaultValue: title, style: {
86
+ fontSize: '1.35rem',
87
+ fontWeight: 700,
88
+ color: 'var(--heading-color, #0f172a)',
89
+ margin: 0,
90
+ } })) : title ? ((0, jsx_runtime_1.jsx)("h2", { "data-preview-static": "dialog-title", style: {
91
+ fontSize: '1.35rem',
92
+ fontWeight: 700,
93
+ color: 'var(--heading-color, #0f172a)',
94
+ margin: 0,
95
+ }, children: title })) : ((0, jsx_runtime_1.jsx)("div", {})), showCloseButton && onClose && ((0, jsx_runtime_1.jsx)("button", { type: "button", "data-preview-static": "dialog-close-btn", onClick: onClose, "aria-label": "Close dialog", style: {
96
+ background: 'none',
97
+ border: 'none',
98
+ padding: '0.375rem',
99
+ borderRadius: '9999px',
100
+ cursor: 'pointer',
101
+ color: '#94a3b8',
102
+ display: 'flex',
103
+ alignItems: 'center',
104
+ justifyContent: 'center',
105
+ transition: 'background-color 0.15s ease, color 0.15s ease',
106
+ }, onMouseEnter: (e) => {
107
+ e.currentTarget.style.backgroundColor = '#f1f5f9';
108
+ e.currentTarget.style.color = '#0f172a';
109
+ }, onMouseLeave: (e) => {
110
+ e.currentTarget.style.backgroundColor = 'transparent';
111
+ e.currentTarget.style.color = '#94a3b8';
112
+ }, children: (0, jsx_runtime_1.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }))] })), descriptionFieldPath ? ((0, jsx_runtime_1.jsx)(EditableText_1.EditableText, { as: "p", id: descriptionFieldPath, defaultValue: description, style: {
113
+ fontSize: '0.925rem',
114
+ color: 'var(--muted-text, #64748b)',
115
+ marginBottom: '1.5rem',
116
+ lineHeight: 1.5,
117
+ } })) : description ? ((0, jsx_runtime_1.jsx)("p", { "data-preview-static": "dialog-description", style: {
118
+ fontSize: '0.925rem',
119
+ color: 'var(--muted-text, #64748b)',
120
+ marginBottom: '1.5rem',
121
+ lineHeight: 1.5,
122
+ margin: '0 0 1.5rem 0',
123
+ }, children: description })) : null, (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, overflowY: 'auto' }, children: children }), footerSlot && ((0, jsx_runtime_1.jsx)("div", { style: {
124
+ marginTop: '1.75rem',
125
+ paddingTop: '1rem',
126
+ borderTop: '1px solid #f1f5f9',
127
+ display: 'flex',
128
+ alignItems: 'center',
129
+ justifyContent: 'flex-end',
130
+ gap: '0.75rem',
131
+ }, children: footerSlot }))] })] }));
132
+ }
133
+ function DialogHeader({ className = '', style, children, ...props }) {
134
+ return ((0, jsx_runtime_1.jsx)("div", { style: { marginBottom: '1rem', ...style }, className: `deneb-dialog-header ${className}`.trim(), ...props, children: children }));
135
+ }
136
+ function DialogTitle({ className = '', style, children, ...props }) {
137
+ return ((0, jsx_runtime_1.jsx)("h3", { style: { fontSize: '1.25rem', fontWeight: 700, color: 'var(--heading-color, #0f172a)', margin: 0, ...style }, className: `deneb-dialog-title ${className}`.trim(), ...props, children: children }));
138
+ }
139
+ function DialogDescription({ className = '', style, children, ...props }) {
140
+ return ((0, jsx_runtime_1.jsx)("p", { style: { fontSize: '0.9rem', color: 'var(--muted-text, #64748b)', marginTop: '0.375rem', ...style }, className: `deneb-dialog-description ${className}`.trim(), ...props, children: children }));
141
+ }
142
+ function DialogFooter({ className = '', style, children, ...props }) {
143
+ return ((0, jsx_runtime_1.jsx)("div", { style: { marginTop: '1.5rem', display: 'flex', justifyContent: 'flex-end', gap: '0.75rem', ...style }, className: `deneb-dialog-footer ${className}`.trim(), ...props, children: children }));
144
+ }
145
+ exports.Dialog = EditableDialog;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ export interface FAQItem {
3
+ id?: string | number;
4
+ question?: string;
5
+ answer?: string;
6
+ [key: string]: unknown;
7
+ }
8
+ export interface EditableFAQItemProps extends React.HTMLAttributes<HTMLElement> {
9
+ itemPath: string;
10
+ item: FAQItem;
11
+ defaultOpen?: boolean;
12
+ }
13
+ export declare function EditableFAQItem({ itemPath, item, defaultOpen, className, style, ...props }: EditableFAQItemProps): React.JSX.Element;
14
+ export interface EditableFAQAccordionProps extends React.HTMLAttributes<HTMLDivElement> {
15
+ listPath?: string;
16
+ items: FAQItem[];
17
+ defaultOpenIndex?: number;
18
+ }
19
+ export declare function EditableFAQAccordion({ listPath, items, defaultOpenIndex, className, style, ...props }: EditableFAQAccordionProps): React.JSX.Element;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditableFAQItem = EditableFAQItem;
4
+ exports.EditableFAQAccordion = EditableFAQAccordion;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const EditableText_1 = require("./EditableText");
8
+ function EditableFAQItem({ itemPath, item, defaultOpen = true, className = '', style, ...props }) {
9
+ const [isOpen, setIsOpen] = (0, react_1.useState)(defaultOpen);
10
+ const question = String(item?.question || 'Frequently Asked Question?');
11
+ const answer = String(item?.answer || 'Detailed answer explaining the details clearly.');
12
+ return ((0, jsx_runtime_1.jsxs)("div", { "data-preview-item-path": itemPath, style: {
13
+ borderBottom: '1px solid #e2e8f0',
14
+ padding: '1.25rem 0',
15
+ ...style,
16
+ }, className: `editable-faq-item ${className}`.trim(), ...props, children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => setIsOpen(!isOpen), "aria-expanded": isOpen, style: {
17
+ width: '100%',
18
+ display: 'flex',
19
+ justifyContent: 'space-between',
20
+ alignItems: 'center',
21
+ textAlign: 'left',
22
+ background: 'none',
23
+ border: 'none',
24
+ padding: 0,
25
+ cursor: 'pointer',
26
+ }, children: [(0, jsx_runtime_1.jsx)(EditableText_1.EditableText, { as: "h4", id: `${itemPath}.question`, defaultValue: question, style: {
27
+ fontSize: '1.1rem',
28
+ fontWeight: 600,
29
+ color: 'var(--heading-color, #0f172a)',
30
+ paddingRight: '1rem',
31
+ } }), (0, jsx_runtime_1.jsx)("div", { style: {
32
+ width: '28px',
33
+ height: '28px',
34
+ borderRadius: '9999px',
35
+ backgroundColor: isOpen ? 'var(--brand-color, #2563eb)' : '#f1f5f9',
36
+ color: isOpen ? '#ffffff' : '#64748b',
37
+ display: 'flex',
38
+ alignItems: 'center',
39
+ justifyContent: 'center',
40
+ flexShrink: 0,
41
+ transition: 'transform 0.25s ease, background-color 0.25s ease',
42
+ transform: isOpen ? 'rotate(180deg)' : 'rotate(0deg)',
43
+ }, children: (0, jsx_runtime_1.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "data-preview-static": "faq-chevron", children: (0, jsx_runtime_1.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) })] }), (0, jsx_runtime_1.jsx)("div", { style: {
44
+ marginTop: '0.875rem',
45
+ paddingRight: '2rem',
46
+ maxHeight: isOpen ? '1000px' : '0px',
47
+ overflow: 'hidden',
48
+ opacity: isOpen ? 1 : 0.01,
49
+ transition: 'all 0.25s ease',
50
+ }, children: (0, jsx_runtime_1.jsx)(EditableText_1.EditableText, { as: "p", id: `${itemPath}.answer`, defaultValue: answer, style: {
51
+ fontSize: '0.95rem',
52
+ color: 'var(--muted-text, #64748b)',
53
+ lineHeight: 1.6,
54
+ } }) })] }));
55
+ }
56
+ function EditableFAQAccordion({ listPath = 'home.faq', items = [], defaultOpenIndex = 0, className = '', style, ...props }) {
57
+ return ((0, jsx_runtime_1.jsx)("div", { "data-preview-list-path": listPath, style: {
58
+ maxWidth: '800px',
59
+ margin: '0 auto',
60
+ ...style,
61
+ }, className: `editable-faq-accordion ${className}`.trim(), ...props, children: items.map((item, idx) => ((0, jsx_runtime_1.jsx)(EditableFAQItem, { itemPath: `${listPath}[${idx}]`, item: item, defaultOpen: idx === defaultOpenIndex }, item.id || idx))) }));
62
+ }
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export interface FooterLink {
3
+ id: string;
4
+ label: string;
5
+ route: string;
6
+ }
7
+ export interface EditableFooterProps extends React.HTMLAttributes<HTMLElement> {
8
+ defaultLinks?: FooterLink[];
9
+ links?: FooterLink[];
10
+ basePath?: string;
11
+ showNewsletter?: boolean;
12
+ }
13
+ /**
14
+ * Next-Level DENEB UI Footer
15
+ *
16
+ * Features:
17
+ * - High-end Shadcn-inspired dark aesthetic with subtle borders and ambient highlights
18
+ * - 100% Real-Time Auto-Synchronization with Header (Logo, Website Title, Nav labels)
19
+ * - 4-Column Responsive Layout:
20
+ * Col 1: Synced Brand (Logo + Site Name + Short Description + Social Icons)
21
+ * Col 2: Synced Explore Navigation (Routes dynamically synced with Header nav items)
22
+ * Col 3: Contact & Support (Direct contact shortcuts, address, email, phone)
23
+ * Col 4: Dynamic Footer Heading & Sleek Interactive Newsletter Card
24
+ * - Strict Visual Editing Marker Support (`common.shortDescription`, `common.footerHeading`, `common.copyright`)
25
+ * - Route Filtering Compliance (`data-target-page` wrappers)
26
+ * - Tailored Tailwind CSS utility classes + resilient inline CSS fallbacks
27
+ *
28
+ * Created by Chamika Gayashan (CEE G)
29
+ */
30
+ export declare function EditableFooter({ defaultLinks, links, basePath, showNewsletter, className, style, ...props }: EditableFooterProps): React.JSX.Element;
31
+ export declare const Footer: typeof EditableFooter;