lightview 1.8.1-b → 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/.agent/workflows/daisyui-component-migration.md +155 -0
- package/.codacy/cli.sh +149 -0
- package/.codacy/codacy.yaml +15 -0
- package/.github/instructions/codacy.instructions.md +72 -0
- package/.wranglerignore +21 -0
- package/README.md +1331 -21
- package/_headers +4 -0
- package/build.js +70 -0
- package/components/actions/button.js +151 -0
- package/components/actions/dropdown.js +120 -0
- package/components/actions/modal.js +146 -0
- package/components/actions/swap.js +118 -0
- package/components/daisyui.js +288 -0
- package/components/data-display/accordion.js +128 -0
- package/components/data-display/alert.js +112 -0
- package/components/data-display/avatar.js +170 -0
- package/components/data-display/badge.js +82 -0
- package/components/data-display/card.js +151 -0
- package/components/data-display/carousel.js +94 -0
- package/components/data-display/chart.js +220 -0
- package/components/data-display/chat.js +128 -0
- package/components/data-display/collapse.js +103 -0
- package/components/data-display/countdown.js +69 -0
- package/components/data-display/diff.js +111 -0
- package/components/data-display/kbd.js +65 -0
- package/components/data-display/loading.js +75 -0
- package/components/data-display/progress.js +79 -0
- package/components/data-display/radial-progress.js +88 -0
- package/components/data-display/skeleton.js +66 -0
- package/components/data-display/stats.js +159 -0
- package/components/data-display/table.js +146 -0
- package/components/data-display/timeline.js +146 -0
- package/components/data-display/toast.js +72 -0
- package/components/data-display/tooltip.js +74 -0
- package/components/data-input/checkbox.js +253 -0
- package/components/data-input/file-input.js +224 -0
- package/components/data-input/input.js +264 -0
- package/components/data-input/radio.js +338 -0
- package/components/data-input/range.js +204 -0
- package/components/data-input/rating.js +219 -0
- package/components/data-input/select.js +287 -0
- package/components/data-input/textarea.js +287 -0
- package/components/data-input/toggle.js +201 -0
- package/components/index.js +137 -0
- package/components/layout/divider.js +72 -0
- package/components/layout/drawer.js +142 -0
- package/components/layout/footer.js +100 -0
- package/components/layout/hero.js +109 -0
- package/components/layout/indicator.js +90 -0
- package/components/layout/join.js +78 -0
- package/components/layout/navbar.js +110 -0
- package/components/navigation/breadcrumbs.js +91 -0
- package/components/navigation/dock.js +103 -0
- package/components/navigation/menu.js +126 -0
- package/components/navigation/pagination.js +105 -0
- package/components/navigation/steps.js +89 -0
- package/components/navigation/tabs.css +177 -0
- package/components/navigation/tabs.js +123 -0
- package/components/theme/theme-switch.css +65 -0
- package/components/theme/theme-switch.js +177 -0
- package/docs/about.html +164 -0
- package/docs/api/computed.html +184 -0
- package/docs/api/effects.html +173 -0
- package/docs/api/elements.html +180 -0
- package/docs/api/enhance.html +225 -0
- package/docs/api/hypermedia.html +165 -0
- package/docs/api/index.html +178 -0
- package/docs/api/nav.html +18 -0
- package/docs/api/signals.html +136 -0
- package/docs/api/state.html +217 -0
- package/docs/assets/images/logo-favicon.svg +42 -0
- package/docs/assets/images/logo-static.svg +40 -0
- package/docs/assets/images/logo.svg +66 -0
- package/docs/assets/js/examplify.js +395 -0
- package/docs/assets/styles/site.css +1102 -0
- package/docs/assets/styles/themes.css +236 -0
- package/docs/components/accordion.html +439 -0
- package/docs/components/alert.html +528 -0
- package/docs/components/avatar.html +586 -0
- package/docs/components/badge.html +531 -0
- package/docs/components/breadcrumbs.html +278 -0
- package/docs/components/button.html +579 -0
- package/docs/components/card.html +561 -0
- package/docs/components/carousel.html +286 -0
- package/docs/components/chart-area.html +702 -0
- package/docs/components/chart-bar.html +782 -0
- package/docs/components/chart-column.html +735 -0
- package/docs/components/chart-line.html +794 -0
- package/docs/components/chart-pie.html +823 -0
- package/docs/components/chart.html +612 -0
- package/docs/components/chat.html +547 -0
- package/docs/components/checkbox.html +641 -0
- package/docs/components/collapse.html +536 -0
- package/docs/components/component-nav.html +53 -0
- package/docs/components/countdown.html +470 -0
- package/docs/components/diff.html +245 -0
- package/docs/components/divider.html +240 -0
- package/docs/components/dock.html +277 -0
- package/docs/components/drawer.html +515 -0
- package/docs/components/dropdown.html +479 -0
- package/docs/components/file-input.html +591 -0
- package/docs/components/footer.html +301 -0
- package/docs/components/gallery.html +504 -0
- package/docs/components/hero.html +264 -0
- package/docs/components/index.css +840 -0
- package/docs/components/index.html +735 -0
- package/docs/components/indicator.html +342 -0
- package/docs/components/input.html +644 -0
- package/docs/components/join.html +285 -0
- package/docs/components/kbd.html +322 -0
- package/docs/components/loading.html +521 -0
- package/docs/components/menu.html +461 -0
- package/docs/components/modal.html +639 -0
- package/docs/components/navbar.html +321 -0
- package/docs/components/pagination.html +279 -0
- package/docs/components/progress.html +514 -0
- package/docs/components/radial-progress.html +434 -0
- package/docs/components/radio.html +655 -0
- package/docs/components/range.html +611 -0
- package/docs/components/rating.html +642 -0
- package/docs/components/select.html +696 -0
- package/docs/components/sidebar-setup.js +93 -0
- package/docs/components/skeleton.html +447 -0
- package/docs/components/spinner.html +68 -0
- package/docs/components/stats.html +486 -0
- package/docs/components/steps.html +356 -0
- package/docs/components/swap.html +517 -0
- package/docs/components/switch.html +68 -0
- package/docs/components/table.html +668 -0
- package/docs/components/tabs.html +506 -0
- package/docs/components/text-input.html +68 -0
- package/docs/components/textarea.html +603 -0
- package/docs/components/timeline.html +487 -0
- package/docs/components/toast.html +474 -0
- package/docs/components/toggle.html +564 -0
- package/docs/components/tooltip.html +423 -0
- package/docs/examples/getting-started-example.html +40 -0
- package/docs/examples/index.html +93 -0
- package/docs/getting-started/index.html +739 -0
- package/docs/getting-started/reviews.html +23 -0
- package/docs/getting-started/reviews.odom +108 -0
- package/docs/getting-started/reviews.vdom +84 -0
- package/docs/index.html +134 -0
- package/docs/playground.html +416 -0
- package/docs/router.html +285 -0
- package/docs/styles/index.html +190 -0
- package/functions/_middleware.js +32 -0
- package/index.html +309 -0
- package/lightview-router.js +364 -0
- package/lightview-x.js +1577 -0
- package/lightview.js +658 -1109
- package/lightview.js.backup +793 -0
- package/middleware/locale.js +25 -0
- package/middleware/markdown.js +44 -0
- package/middleware/notFound.js +37 -0
- package/package.json +27 -41
- package/watch.js +92 -0
- package/wrangler.toml +12 -0
- package/.idea/lightview.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/LICENSE +0 -21
- package/codepen-no-tabs-embed.css +0 -2
- package/components/chart/chart.html +0 -17
- package/components/chart/example.html +0 -32
- package/components/chart.html +0 -83
- package/components/components.js +0 -113
- package/components/gantt/example.html +0 -22
- package/components/gantt/gantt.html +0 -42
- package/components/gauge/example.html +0 -28
- package/components/gauge/gauge.html +0 -20
- package/components/gauge.html +0 -60
- package/components/orgchart/example.html +0 -25
- package/components/orgchart/orgchart.html +0 -41
- package/components/repl/code-editor.html +0 -64
- package/components/repl/editor.html +0 -37
- package/components/repl/editorjs-inline-tool/index.js +0 -3
- package/components/repl/editorjs-inline-tool/inline-tools.js +0 -28
- package/components/repl/editorjs-inline-tool/tool.js +0 -175
- package/components/repl/repl-with-wysiwyg.html +0 -355
- package/components/repl/repl.html +0 -345
- package/components/repl/sup.js +0 -44
- package/components/repl/wysiwyg-repl.html +0 -258
- package/components/timeline/example.html +0 -33
- package/components/timeline/timeline.html +0 -44
- package/components/timeline.html +0 -81
- package/examples/anchor.html +0 -11
- package/examples/chart.html +0 -34
- package/examples/counter.html +0 -26
- package/examples/counter.test.mjs +0 -47
- package/examples/counter2.html +0 -26
- package/examples/directives.html +0 -79
- package/examples/foreign.html +0 -50
- package/examples/forgeinform.html +0 -98
- package/examples/form.html +0 -61
- package/examples/gauge.html +0 -18
- package/examples/invalid-template-literals.html +0 -44
- package/examples/medium/remote.html +0 -60
- package/examples/message.html +0 -18
- package/examples/nested.html +0 -11
- package/examples/object-bound-form.html +0 -34
- package/examples/remote-server.js +0 -51
- package/examples/remote.html +0 -34
- package/examples/remote.json +0 -1
- package/examples/scratch.html +0 -69
- package/examples/sensors/index.html +0 -30
- package/examples/sensors/sensor-server.js +0 -30
- package/examples/shared.html +0 -41
- package/examples/template.html +0 -33
- package/examples/timeline.html +0 -21
- package/examples/todo.html +0 -38
- package/examples/top.html +0 -10
- package/examples/types.html +0 -94
- package/examples/xor.html +0 -62
- package/jest-puppeteer.config.js +0 -5
- package/jest.config.json +0 -12
- package/sites/client.html +0 -48
- package/sites/index.html +0 -247
- package/test/basic.html +0 -93
- package/test/basic.test.mjs +0 -315
- package/test/extended.html +0 -29
- package/test/extended.test.mjs +0 -448
- package/types.js +0 -534
- package/unsplash.key +0 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightview Drawer Component (DaisyUI)
|
|
3
|
+
* @see https://daisyui.com/components/drawer/
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import '../daisyui.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Drawer Component
|
|
10
|
+
* @param {Object} props
|
|
11
|
+
* @param {string} props.id - Unique ID for the drawer
|
|
12
|
+
* @param {boolean|function} props.open - Control open state
|
|
13
|
+
* @param {boolean} props.end - Drawer on right side
|
|
14
|
+
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
15
|
+
*/
|
|
16
|
+
const Drawer = (props = {}, ...children) => {
|
|
17
|
+
const { tags } = window.Lightview || {};
|
|
18
|
+
const LVX = window.LightviewX || {};
|
|
19
|
+
|
|
20
|
+
if (!tags) return null;
|
|
21
|
+
|
|
22
|
+
const { div, input, label, shadowDOM } = tags;
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
id = 'drawer-' + Math.random().toString(36).slice(2),
|
|
26
|
+
open = false,
|
|
27
|
+
end = false,
|
|
28
|
+
useShadow,
|
|
29
|
+
class: className = '',
|
|
30
|
+
...rest
|
|
31
|
+
} = props;
|
|
32
|
+
|
|
33
|
+
const classes = ['drawer'];
|
|
34
|
+
if (end) classes.push('drawer-end');
|
|
35
|
+
if (className) classes.push(className);
|
|
36
|
+
|
|
37
|
+
const drawerEl = div({ class: classes.join(' '), ...rest },
|
|
38
|
+
input({
|
|
39
|
+
id,
|
|
40
|
+
type: 'checkbox',
|
|
41
|
+
class: 'drawer-toggle',
|
|
42
|
+
checked: typeof open === 'function' ? open : open
|
|
43
|
+
}),
|
|
44
|
+
...children
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
// Check if we should use shadow DOM
|
|
48
|
+
let usesShadow = false;
|
|
49
|
+
if (LVX.shouldUseShadow) {
|
|
50
|
+
usesShadow = LVX.shouldUseShadow(useShadow);
|
|
51
|
+
} else {
|
|
52
|
+
usesShadow = useShadow === true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (usesShadow) {
|
|
56
|
+
const adoptedStyleSheets = LVX.getAdoptedStyleSheets ? LVX.getAdoptedStyleSheets() : [];
|
|
57
|
+
|
|
58
|
+
const themeValue = LVX.themeSignal ? () => LVX.themeSignal.value : 'light';
|
|
59
|
+
|
|
60
|
+
return div({ class: 'contents' },
|
|
61
|
+
shadowDOM({ mode: 'open', adoptedStyleSheets },
|
|
62
|
+
div({ 'data-theme': themeValue },
|
|
63
|
+
drawerEl
|
|
64
|
+
)
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return drawerEl;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Drawer Content - main content area
|
|
74
|
+
*/
|
|
75
|
+
Drawer.Content = (props = {}, ...children) => {
|
|
76
|
+
const { tags } = window.Lightview || {};
|
|
77
|
+
if (!tags) return null;
|
|
78
|
+
|
|
79
|
+
const { class: className = '', ...rest } = props;
|
|
80
|
+
|
|
81
|
+
return tags.div({
|
|
82
|
+
class: `drawer-content ${className}`.trim(),
|
|
83
|
+
...rest
|
|
84
|
+
}, ...children);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Drawer Side - sidebar content
|
|
89
|
+
*/
|
|
90
|
+
Drawer.Side = (props = {}, ...children) => {
|
|
91
|
+
const { tags } = window.Lightview || {};
|
|
92
|
+
if (!tags) return null;
|
|
93
|
+
|
|
94
|
+
const { class: className = '', ...rest } = props;
|
|
95
|
+
|
|
96
|
+
return tags.div({
|
|
97
|
+
class: `drawer-side ${className}`.trim(),
|
|
98
|
+
...rest
|
|
99
|
+
}, ...children);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Drawer Overlay - click to close
|
|
104
|
+
*/
|
|
105
|
+
Drawer.Overlay = (props = {}) => {
|
|
106
|
+
const { tags } = window.Lightview || {};
|
|
107
|
+
if (!tags) return null;
|
|
108
|
+
|
|
109
|
+
const { for: forId, class: className = '', ...rest } = props;
|
|
110
|
+
|
|
111
|
+
return tags.label({
|
|
112
|
+
for: forId,
|
|
113
|
+
'aria-label': 'close sidebar',
|
|
114
|
+
class: `drawer-overlay ${className}`.trim(),
|
|
115
|
+
...rest
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Drawer Button - toggle button
|
|
121
|
+
*/
|
|
122
|
+
Drawer.Button = (props = {}, ...children) => {
|
|
123
|
+
const { tags } = window.Lightview || {};
|
|
124
|
+
if (!tags) return null;
|
|
125
|
+
|
|
126
|
+
const { for: forId, class: className = '', ...rest } = props;
|
|
127
|
+
|
|
128
|
+
return tags.label({
|
|
129
|
+
for: forId,
|
|
130
|
+
class: `btn btn-primary drawer-button ${className}`.trim(),
|
|
131
|
+
...rest
|
|
132
|
+
}, ...children);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const tags = window.Lightview.tags;
|
|
136
|
+
tags.Drawer = Drawer;
|
|
137
|
+
tags['Drawer.Content'] = Drawer.Content;
|
|
138
|
+
tags['Drawer.Side'] = Drawer.Side;
|
|
139
|
+
tags['Drawer.Overlay'] = Drawer.Overlay;
|
|
140
|
+
tags['Drawer.Button'] = Drawer.Button;
|
|
141
|
+
|
|
142
|
+
export default Drawer;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightview Footer Component (DaisyUI)
|
|
3
|
+
* @see https://daisyui.com/components/footer/
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import '../daisyui.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Footer Component
|
|
10
|
+
* @param {Object} props
|
|
11
|
+
* @param {boolean} props.center - Center content
|
|
12
|
+
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
13
|
+
*/
|
|
14
|
+
const Footer = (props = {}, ...children) => {
|
|
15
|
+
const { tags } = window.Lightview || {};
|
|
16
|
+
const LVX = window.LightviewX || {};
|
|
17
|
+
|
|
18
|
+
if (!tags) return null;
|
|
19
|
+
|
|
20
|
+
const { footer, div, shadowDOM } = tags;
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
center = false,
|
|
24
|
+
useShadow,
|
|
25
|
+
class: className = '',
|
|
26
|
+
...rest
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
const classes = ['footer', 'bg-neutral', 'text-neutral-content', 'p-10'];
|
|
30
|
+
if (center) classes.push('footer-center');
|
|
31
|
+
if (className) classes.push(className);
|
|
32
|
+
|
|
33
|
+
const footerEl = footer({ class: classes.join(' '), ...rest }, ...children);
|
|
34
|
+
|
|
35
|
+
// Check if we should use shadow DOM
|
|
36
|
+
let usesShadow = false;
|
|
37
|
+
if (LVX.shouldUseShadow) {
|
|
38
|
+
usesShadow = LVX.shouldUseShadow(useShadow);
|
|
39
|
+
} else {
|
|
40
|
+
usesShadow = useShadow === true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (usesShadow) {
|
|
44
|
+
const adoptedStyleSheets = LVX.getAdoptedStyleSheets ? LVX.getAdoptedStyleSheets() : [];
|
|
45
|
+
|
|
46
|
+
const themeValue = LVX.themeSignal ? () => LVX.themeSignal.value : 'light';
|
|
47
|
+
|
|
48
|
+
return div({ class: 'contents' },
|
|
49
|
+
shadowDOM({ mode: 'open', adoptedStyleSheets },
|
|
50
|
+
div({ 'data-theme': themeValue },
|
|
51
|
+
footerEl
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return footerEl;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Footer Title
|
|
62
|
+
*/
|
|
63
|
+
Footer.Title = (props = {}, ...children) => {
|
|
64
|
+
const { tags } = window.Lightview || {};
|
|
65
|
+
if (!tags) return null;
|
|
66
|
+
|
|
67
|
+
const { class: className = '', ...rest } = props;
|
|
68
|
+
|
|
69
|
+
return tags.h6({
|
|
70
|
+
class: `footer-title ${className}`.trim(),
|
|
71
|
+
...rest
|
|
72
|
+
}, ...children);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Footer Nav - Navigation section within footer
|
|
77
|
+
*/
|
|
78
|
+
Footer.Nav = (props = {}, ...children) => {
|
|
79
|
+
const { tags } = window.Lightview || {};
|
|
80
|
+
if (!tags) return null;
|
|
81
|
+
|
|
82
|
+
const { class: className = '', style = '', ...rest } = props;
|
|
83
|
+
|
|
84
|
+
// Use border radius variable for consistent padding
|
|
85
|
+
const defaultStyle = 'padding: var(--rounded-box, 1rem);';
|
|
86
|
+
const combinedStyle = style ? `${defaultStyle} ${style}` : defaultStyle;
|
|
87
|
+
|
|
88
|
+
return tags.nav({
|
|
89
|
+
class: className || undefined,
|
|
90
|
+
style: combinedStyle,
|
|
91
|
+
...rest
|
|
92
|
+
}, ...children);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const tags = window.Lightview.tags;
|
|
96
|
+
tags.Footer = Footer;
|
|
97
|
+
tags['Footer.Title'] = Footer.Title;
|
|
98
|
+
tags['Footer.Nav'] = Footer.Nav;
|
|
99
|
+
|
|
100
|
+
export default Footer;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightview Hero Component (DaisyUI)
|
|
3
|
+
* @see https://daisyui.com/components/hero/
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import '../daisyui.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Hero Component
|
|
10
|
+
* @param {Object} props
|
|
11
|
+
* @param {string} props.bgImage - Background image URL
|
|
12
|
+
* @param {boolean} props.overlay - Add overlay on background
|
|
13
|
+
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
14
|
+
*/
|
|
15
|
+
const Hero = (props = {}, ...children) => {
|
|
16
|
+
const { tags } = window.Lightview || {};
|
|
17
|
+
const LVX = window.LightviewX || {};
|
|
18
|
+
|
|
19
|
+
if (!tags) return null;
|
|
20
|
+
|
|
21
|
+
const { div, shadowDOM } = tags;
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
bgImage,
|
|
25
|
+
overlay = false,
|
|
26
|
+
useShadow,
|
|
27
|
+
class: className = '',
|
|
28
|
+
style = '',
|
|
29
|
+
...rest
|
|
30
|
+
} = props;
|
|
31
|
+
|
|
32
|
+
const classes = ['hero', 'min-h-96'];
|
|
33
|
+
if (className) classes.push(className);
|
|
34
|
+
|
|
35
|
+
let styleStr = style;
|
|
36
|
+
if (bgImage) {
|
|
37
|
+
styleStr = `background-image: url("${bgImage}"); ${style}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const heroContent = [
|
|
41
|
+
overlay ? div({ class: 'hero-overlay bg-opacity-60' }) : null,
|
|
42
|
+
...children
|
|
43
|
+
].filter(Boolean);
|
|
44
|
+
|
|
45
|
+
const heroEl = div({
|
|
46
|
+
class: classes.join(' '),
|
|
47
|
+
style: styleStr || undefined,
|
|
48
|
+
...rest
|
|
49
|
+
}, ...heroContent);
|
|
50
|
+
|
|
51
|
+
// Check if we should use shadow DOM
|
|
52
|
+
let usesShadow = false;
|
|
53
|
+
if (LVX.shouldUseShadow) {
|
|
54
|
+
usesShadow = LVX.shouldUseShadow(useShadow);
|
|
55
|
+
} else {
|
|
56
|
+
usesShadow = useShadow === true;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (usesShadow) {
|
|
60
|
+
const adoptedStyleSheets = LVX.getAdoptedStyleSheets ? LVX.getAdoptedStyleSheets() : [];
|
|
61
|
+
|
|
62
|
+
const themeValue = LVX.themeSignal ? () => LVX.themeSignal.value : 'light';
|
|
63
|
+
|
|
64
|
+
return div({ class: 'contents' },
|
|
65
|
+
shadowDOM({ mode: 'open', adoptedStyleSheets },
|
|
66
|
+
div({ 'data-theme': themeValue },
|
|
67
|
+
heroEl
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return heroEl;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Hero Content
|
|
78
|
+
*/
|
|
79
|
+
Hero.Content = (props = {}, ...children) => {
|
|
80
|
+
const { tags } = window.Lightview || {};
|
|
81
|
+
if (!tags) return null;
|
|
82
|
+
|
|
83
|
+
const { position = 'center', center, class: className = '', ...rest } = props;
|
|
84
|
+
|
|
85
|
+
const classes = ['hero-content'];
|
|
86
|
+
if (position === 'center' || center === true) classes.push('text-center');
|
|
87
|
+
else if (position === 'start') classes.push('text-start');
|
|
88
|
+
if (className) classes.push(className);
|
|
89
|
+
|
|
90
|
+
return tags.div({ class: classes.join(' '), ...rest }, ...children);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Hero Overlay
|
|
95
|
+
*/
|
|
96
|
+
Hero.Overlay = (props = {}) => {
|
|
97
|
+
const { tags } = window.Lightview || {};
|
|
98
|
+
if (!tags) return null;
|
|
99
|
+
|
|
100
|
+
const { class: className = '', ...rest } = props;
|
|
101
|
+
return tags.div({ class: `hero-overlay bg-opacity-60 ${className}`.trim(), ...rest });
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const tags = window.Lightview.tags;
|
|
105
|
+
tags.Hero = Hero;
|
|
106
|
+
tags['Hero.Content'] = Hero.Content;
|
|
107
|
+
tags['Hero.Overlay'] = Hero.Overlay;
|
|
108
|
+
|
|
109
|
+
export default Hero;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightview Indicator Component (DaisyUI)
|
|
3
|
+
* @see https://daisyui.com/components/indicator/
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import '../daisyui.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Indicator Component - positions a badge/element on corner of another element
|
|
10
|
+
* @param {Object} props
|
|
11
|
+
* @param {string} props.position - Combination of 'top'|'middle'|'bottom' and 'start'|'center'|'end'
|
|
12
|
+
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
13
|
+
*/
|
|
14
|
+
const Indicator = (props = {}, ...children) => {
|
|
15
|
+
const { tags } = window.Lightview || {};
|
|
16
|
+
const LVX = window.LightviewX || {};
|
|
17
|
+
|
|
18
|
+
if (!tags) return null;
|
|
19
|
+
|
|
20
|
+
const { div, shadowDOM } = tags;
|
|
21
|
+
|
|
22
|
+
const { useShadow, class: className = '', ...rest } = props;
|
|
23
|
+
|
|
24
|
+
const indicatorEl = div({
|
|
25
|
+
class: `indicator ${className}`.trim(),
|
|
26
|
+
...rest
|
|
27
|
+
}, ...children);
|
|
28
|
+
|
|
29
|
+
// Check if we should use shadow DOM
|
|
30
|
+
let usesShadow = false;
|
|
31
|
+
if (LVX.shouldUseShadow) {
|
|
32
|
+
usesShadow = LVX.shouldUseShadow(useShadow);
|
|
33
|
+
} else {
|
|
34
|
+
usesShadow = useShadow === true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (usesShadow) {
|
|
38
|
+
const adoptedStyleSheets = LVX.getAdoptedStyleSheets ? LVX.getAdoptedStyleSheets() : [];
|
|
39
|
+
|
|
40
|
+
const themeValue = LVX.themeSignal ? () => LVX.themeSignal.value : 'light';
|
|
41
|
+
|
|
42
|
+
return div({ class: 'contents' },
|
|
43
|
+
shadowDOM({ mode: 'open', adoptedStyleSheets },
|
|
44
|
+
div({ 'data-theme': themeValue },
|
|
45
|
+
indicatorEl
|
|
46
|
+
)
|
|
47
|
+
)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return indicatorEl;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Indicator Item - the positioned element
|
|
56
|
+
*/
|
|
57
|
+
Indicator.Item = (props = {}, ...children) => {
|
|
58
|
+
const { tags } = window.Lightview || {};
|
|
59
|
+
if (!tags) return null;
|
|
60
|
+
|
|
61
|
+
const {
|
|
62
|
+
position,
|
|
63
|
+
class: className = '',
|
|
64
|
+
...rest
|
|
65
|
+
} = props;
|
|
66
|
+
|
|
67
|
+
const classes = ['indicator-item'];
|
|
68
|
+
|
|
69
|
+
// Position classes
|
|
70
|
+
if (position) {
|
|
71
|
+
const [v, h] = position.split('-');
|
|
72
|
+
if (v === 'top') classes.push('indicator-top');
|
|
73
|
+
else if (v === 'middle') classes.push('indicator-middle');
|
|
74
|
+
else if (v === 'bottom') classes.push('indicator-bottom');
|
|
75
|
+
|
|
76
|
+
if (h === 'start') classes.push('indicator-start');
|
|
77
|
+
else if (h === 'center') classes.push('indicator-center');
|
|
78
|
+
else if (h === 'end') classes.push('indicator-end');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (className) classes.push(className);
|
|
82
|
+
|
|
83
|
+
return tags.span({ class: classes.join(' '), ...rest }, ...children);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const tags = window.Lightview.tags;
|
|
87
|
+
tags.Indicator = Indicator;
|
|
88
|
+
tags['Indicator.Item'] = Indicator.Item;
|
|
89
|
+
|
|
90
|
+
export default Indicator;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightview Join Component (DaisyUI)
|
|
3
|
+
* @see https://daisyui.com/components/join/
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import '../daisyui.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Join Component - groups items with shared borders
|
|
10
|
+
* @param {Object} props
|
|
11
|
+
* @param {boolean} props.vertical - Vertical layout
|
|
12
|
+
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
13
|
+
*/
|
|
14
|
+
const Join = (props = {}, ...children) => {
|
|
15
|
+
const { tags } = window.Lightview || {};
|
|
16
|
+
const LVX = window.LightviewX || {};
|
|
17
|
+
|
|
18
|
+
if (!tags) return null;
|
|
19
|
+
|
|
20
|
+
const { div, shadowDOM } = tags;
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
vertical = false,
|
|
24
|
+
useShadow,
|
|
25
|
+
class: className = '',
|
|
26
|
+
...rest
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
const classes = ['join'];
|
|
30
|
+
if (vertical) classes.push('join-vertical');
|
|
31
|
+
if (className) classes.push(className);
|
|
32
|
+
|
|
33
|
+
const joinEl = div({ class: classes.join(' '), ...rest }, ...children);
|
|
34
|
+
|
|
35
|
+
// Check if we should use shadow DOM
|
|
36
|
+
let usesShadow = false;
|
|
37
|
+
if (LVX.shouldUseShadow) {
|
|
38
|
+
usesShadow = LVX.shouldUseShadow(useShadow);
|
|
39
|
+
} else {
|
|
40
|
+
usesShadow = useShadow === true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (usesShadow) {
|
|
44
|
+
const adoptedStyleSheets = LVX.getAdoptedStyleSheets ? LVX.getAdoptedStyleSheets() : [];
|
|
45
|
+
|
|
46
|
+
const themeValue = LVX.themeSignal ? () => LVX.themeSignal.value : 'light';
|
|
47
|
+
|
|
48
|
+
return div({ class: 'contents' },
|
|
49
|
+
shadowDOM({ mode: 'open', adoptedStyleSheets },
|
|
50
|
+
div({ 'data-theme': themeValue },
|
|
51
|
+
joinEl
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return joinEl;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Join Item - each joined element should have this class
|
|
62
|
+
*/
|
|
63
|
+
Join.Item = (props = {}, ...children) => {
|
|
64
|
+
const { tags } = window.Lightview || {};
|
|
65
|
+
if (!tags) return null;
|
|
66
|
+
|
|
67
|
+
const { as = 'button', class: className = '', ...rest } = props;
|
|
68
|
+
const el = tags[as] || tags.div;
|
|
69
|
+
|
|
70
|
+
return el({
|
|
71
|
+
class: `join-item ${className}`.trim(),
|
|
72
|
+
...rest
|
|
73
|
+
}, ...children);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
window.Lightview.tags.Join = Join;
|
|
77
|
+
|
|
78
|
+
export default Join;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightview Navbar Component (DaisyUI)
|
|
3
|
+
* @see https://daisyui.com/components/navbar/
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import '../daisyui.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Navbar Component
|
|
10
|
+
* @param {Object} props
|
|
11
|
+
* @param {string} props.bg - Background class (e.g., 'bg-base-100')
|
|
12
|
+
* @param {boolean} props.useShadow - Render in Shadow DOM with isolated DaisyUI styles
|
|
13
|
+
*/
|
|
14
|
+
const Navbar = (props = {}, ...children) => {
|
|
15
|
+
const { tags } = window.Lightview || {};
|
|
16
|
+
const LVX = window.LightviewX || {};
|
|
17
|
+
|
|
18
|
+
if (!tags) return null;
|
|
19
|
+
|
|
20
|
+
const { div, shadowDOM } = tags;
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
bg = 'bg-base-100',
|
|
24
|
+
useShadow,
|
|
25
|
+
class: className = '',
|
|
26
|
+
...rest
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
const classes = ['navbar', bg];
|
|
30
|
+
if (className) classes.push(className);
|
|
31
|
+
|
|
32
|
+
const navbarEl = div({ class: classes.join(' '), ...rest }, ...children);
|
|
33
|
+
|
|
34
|
+
// Check if we should use shadow DOM
|
|
35
|
+
let usesShadow = false;
|
|
36
|
+
if (LVX.shouldUseShadow) {
|
|
37
|
+
usesShadow = LVX.shouldUseShadow(useShadow);
|
|
38
|
+
} else {
|
|
39
|
+
usesShadow = useShadow === true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (usesShadow) {
|
|
43
|
+
const adoptedStyleSheets = LVX.getAdoptedStyleSheets ? LVX.getAdoptedStyleSheets() : [];
|
|
44
|
+
|
|
45
|
+
const themeValue = LVX.themeSignal ? () => LVX.themeSignal.value : 'light';
|
|
46
|
+
|
|
47
|
+
return div({ class: 'contents' },
|
|
48
|
+
shadowDOM({ mode: 'open', adoptedStyleSheets },
|
|
49
|
+
div({ 'data-theme': themeValue },
|
|
50
|
+
navbarEl
|
|
51
|
+
)
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return navbarEl;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Navbar Start
|
|
61
|
+
*/
|
|
62
|
+
Navbar.Start = (props = {}, ...children) => {
|
|
63
|
+
const { tags } = window.Lightview || {};
|
|
64
|
+
if (!tags) return null;
|
|
65
|
+
|
|
66
|
+
const { class: className = '', ...rest } = props;
|
|
67
|
+
|
|
68
|
+
return tags.div({
|
|
69
|
+
class: `navbar-start ${className}`.trim(),
|
|
70
|
+
...rest
|
|
71
|
+
}, ...children);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Navbar Center
|
|
76
|
+
*/
|
|
77
|
+
Navbar.Center = (props = {}, ...children) => {
|
|
78
|
+
const { tags } = window.Lightview || {};
|
|
79
|
+
if (!tags) return null;
|
|
80
|
+
|
|
81
|
+
const { class: className = '', ...rest } = props;
|
|
82
|
+
|
|
83
|
+
return tags.div({
|
|
84
|
+
class: `navbar-center ${className}`.trim(),
|
|
85
|
+
...rest
|
|
86
|
+
}, ...children);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Navbar End
|
|
91
|
+
*/
|
|
92
|
+
Navbar.End = (props = {}, ...children) => {
|
|
93
|
+
const { tags } = window.Lightview || {};
|
|
94
|
+
if (!tags) return null;
|
|
95
|
+
|
|
96
|
+
const { class: className = '', ...rest } = props;
|
|
97
|
+
|
|
98
|
+
return tags.div({
|
|
99
|
+
class: `navbar-end ${className}`.trim(),
|
|
100
|
+
...rest
|
|
101
|
+
}, ...children);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const tags = window.Lightview.tags;
|
|
105
|
+
tags.Navbar = Navbar;
|
|
106
|
+
tags['Navbar.Start'] = Navbar.Start;
|
|
107
|
+
tags['Navbar.Center'] = Navbar.Center;
|
|
108
|
+
tags['Navbar.End'] = Navbar.End;
|
|
109
|
+
|
|
110
|
+
export default Navbar;
|