lightview 1.8.2 → 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 (264) hide show
  1. package/.agent/workflows/daisyui-component-migration.md +155 -0
  2. package/.codacy/cli.sh +149 -0
  3. package/.codacy/codacy.yaml +15 -0
  4. package/.github/instructions/codacy.instructions.md +72 -0
  5. package/.wranglerignore +21 -0
  6. package/README.md +1330 -19
  7. package/_headers +4 -0
  8. package/build.js +70 -0
  9. package/components/actions/button.js +151 -0
  10. package/components/actions/dropdown.js +120 -0
  11. package/components/actions/modal.js +146 -0
  12. package/components/actions/swap.js +118 -0
  13. package/components/daisyui.js +288 -0
  14. package/components/data-display/accordion.js +128 -0
  15. package/components/data-display/alert.js +112 -0
  16. package/components/data-display/avatar.js +170 -0
  17. package/components/data-display/badge.js +82 -0
  18. package/components/data-display/card.js +151 -0
  19. package/components/data-display/carousel.js +94 -0
  20. package/components/data-display/chart.js +220 -0
  21. package/components/data-display/chat.js +128 -0
  22. package/components/data-display/collapse.js +103 -0
  23. package/components/data-display/countdown.js +69 -0
  24. package/components/data-display/diff.js +111 -0
  25. package/components/data-display/kbd.js +65 -0
  26. package/components/data-display/loading.js +75 -0
  27. package/components/data-display/progress.js +79 -0
  28. package/components/data-display/radial-progress.js +88 -0
  29. package/components/data-display/skeleton.js +66 -0
  30. package/components/data-display/stats.js +159 -0
  31. package/components/data-display/table.js +146 -0
  32. package/components/data-display/timeline.js +146 -0
  33. package/components/data-display/toast.js +72 -0
  34. package/components/data-display/tooltip.js +74 -0
  35. package/components/data-input/checkbox.js +253 -0
  36. package/components/data-input/file-input.js +224 -0
  37. package/components/data-input/input.js +264 -0
  38. package/components/data-input/radio.js +338 -0
  39. package/components/data-input/range.js +204 -0
  40. package/components/data-input/rating.js +219 -0
  41. package/components/data-input/select.js +287 -0
  42. package/components/data-input/textarea.js +287 -0
  43. package/components/data-input/toggle.js +201 -0
  44. package/components/index.js +137 -0
  45. package/components/layout/divider.js +72 -0
  46. package/components/layout/drawer.js +142 -0
  47. package/components/layout/footer.js +100 -0
  48. package/components/layout/hero.js +109 -0
  49. package/components/layout/indicator.js +90 -0
  50. package/components/layout/join.js +78 -0
  51. package/components/layout/navbar.js +110 -0
  52. package/components/navigation/breadcrumbs.js +91 -0
  53. package/components/navigation/dock.js +103 -0
  54. package/components/navigation/menu.js +126 -0
  55. package/components/navigation/pagination.js +105 -0
  56. package/components/navigation/steps.js +89 -0
  57. package/components/navigation/tabs.css +177 -0
  58. package/components/navigation/tabs.js +123 -0
  59. package/components/theme/theme-switch.css +65 -0
  60. package/components/theme/theme-switch.js +177 -0
  61. package/docs/about.html +164 -0
  62. package/docs/api/computed.html +184 -0
  63. package/docs/api/effects.html +173 -0
  64. package/docs/api/elements.html +180 -0
  65. package/docs/api/enhance.html +225 -0
  66. package/docs/api/hypermedia.html +165 -0
  67. package/docs/api/index.html +178 -0
  68. package/docs/api/nav.html +18 -0
  69. package/docs/api/signals.html +136 -0
  70. package/docs/api/state.html +217 -0
  71. package/docs/assets/images/logo-favicon.svg +42 -0
  72. package/docs/assets/images/logo-static.svg +40 -0
  73. package/docs/assets/images/logo.svg +66 -0
  74. package/docs/assets/js/examplify.js +395 -0
  75. package/docs/assets/styles/site.css +1102 -0
  76. package/docs/assets/styles/themes.css +236 -0
  77. package/docs/components/accordion.html +439 -0
  78. package/docs/components/alert.html +528 -0
  79. package/docs/components/avatar.html +586 -0
  80. package/docs/components/badge.html +531 -0
  81. package/docs/components/breadcrumbs.html +278 -0
  82. package/docs/components/button.html +579 -0
  83. package/docs/components/card.html +561 -0
  84. package/docs/components/carousel.html +286 -0
  85. package/docs/components/chart-area.html +702 -0
  86. package/docs/components/chart-bar.html +782 -0
  87. package/docs/components/chart-column.html +735 -0
  88. package/docs/components/chart-line.html +794 -0
  89. package/docs/components/chart-pie.html +823 -0
  90. package/docs/components/chart.html +610 -15
  91. package/docs/components/chat.html +547 -0
  92. package/docs/components/checkbox.html +641 -0
  93. package/docs/components/collapse.html +536 -0
  94. package/docs/components/component-nav.html +53 -0
  95. package/docs/components/countdown.html +470 -0
  96. package/docs/components/diff.html +245 -0
  97. package/docs/components/divider.html +240 -0
  98. package/docs/components/dock.html +277 -0
  99. package/docs/components/drawer.html +515 -0
  100. package/docs/components/dropdown.html +479 -0
  101. package/docs/components/file-input.html +591 -0
  102. package/docs/components/footer.html +301 -0
  103. package/docs/components/gallery.html +504 -0
  104. package/docs/components/hero.html +264 -0
  105. package/docs/components/index.css +840 -0
  106. package/docs/components/index.html +735 -0
  107. package/docs/components/indicator.html +342 -0
  108. package/docs/components/input.html +644 -0
  109. package/docs/components/join.html +285 -0
  110. package/docs/components/kbd.html +322 -0
  111. package/docs/components/loading.html +521 -0
  112. package/docs/components/menu.html +461 -0
  113. package/docs/components/modal.html +639 -0
  114. package/docs/components/navbar.html +321 -0
  115. package/docs/components/pagination.html +279 -0
  116. package/docs/components/progress.html +514 -0
  117. package/docs/components/radial-progress.html +434 -0
  118. package/docs/components/radio.html +655 -0
  119. package/docs/components/range.html +611 -0
  120. package/docs/components/rating.html +642 -0
  121. package/docs/components/select.html +696 -0
  122. package/docs/components/sidebar-setup.js +93 -0
  123. package/docs/components/skeleton.html +447 -0
  124. package/docs/components/spinner.html +68 -0
  125. package/docs/components/stats.html +486 -0
  126. package/docs/components/steps.html +356 -0
  127. package/docs/components/swap.html +517 -0
  128. package/docs/components/switch.html +68 -0
  129. package/docs/components/table.html +668 -0
  130. package/docs/components/tabs.html +506 -0
  131. package/docs/components/text-input.html +68 -0
  132. package/docs/components/textarea.html +603 -0
  133. package/docs/components/timeline.html +485 -42
  134. package/docs/components/toast.html +474 -0
  135. package/docs/components/toggle.html +564 -0
  136. package/docs/components/tooltip.html +423 -0
  137. package/docs/examples/getting-started-example.html +40 -0
  138. package/docs/examples/index.html +93 -0
  139. package/docs/getting-started/index.html +739 -0
  140. package/docs/getting-started/reviews.html +23 -0
  141. package/docs/getting-started/reviews.odom +108 -0
  142. package/docs/getting-started/reviews.vdom +84 -0
  143. package/docs/index.html +132 -42
  144. package/docs/playground.html +416 -0
  145. package/docs/router.html +285 -0
  146. package/docs/styles/index.html +190 -0
  147. package/functions/_middleware.js +32 -0
  148. package/index.html +309 -0
  149. package/lightview-router.js +364 -0
  150. package/lightview-x.js +1577 -0
  151. package/lightview.js +659 -1200
  152. package/lightview.js.backup +793 -0
  153. package/middleware/locale.js +25 -0
  154. package/middleware/markdown.js +44 -0
  155. package/middleware/notFound.js +37 -0
  156. package/package.json +27 -41
  157. package/watch.js +92 -0
  158. package/wrangler.toml +12 -0
  159. package/.idea/lightview.iml +0 -12
  160. package/.idea/modules.xml +0 -8
  161. package/.idea/vcs.xml +0 -6
  162. package/LICENSE +0 -21
  163. package/codepen-no-tabs-embed.css +0 -2
  164. package/docs/CNAME +0 -1
  165. package/docs/api.html +0 -674
  166. package/docs/blank.html +0 -10
  167. package/docs/comparedto.html +0 -89
  168. package/docs/components/chart-repl.html +0 -69
  169. package/docs/components/components.js +0 -113
  170. package/docs/components/contents.html +0 -17
  171. package/docs/components/gantt-repl.html +0 -61
  172. package/docs/components/gantt.html +0 -42
  173. package/docs/components/gauge-repl.html +0 -66
  174. package/docs/components/gauge.html +0 -20
  175. package/docs/components/orgchart-repl.html +0 -64
  176. package/docs/components/orgchart.html +0 -41
  177. package/docs/components/repl-as-src.html +0 -17
  178. package/docs/components/repl-repl.html +0 -95
  179. package/docs/components/repl.html +0 -527
  180. package/docs/components/timeline-repl.html +0 -72
  181. package/docs/components.html +0 -14
  182. package/docs/css/highlightjs.min.css +0 -9
  183. package/docs/css/tutorial.css +0 -35
  184. package/docs/examples/anchor.html +0 -11
  185. package/docs/examples/chart.html +0 -34
  186. package/docs/examples/counter.html +0 -26
  187. package/docs/examples/counter.test.mjs +0 -47
  188. package/docs/examples/counter2.html +0 -26
  189. package/docs/examples/directives.html +0 -79
  190. package/docs/examples/foreign.html +0 -50
  191. package/docs/examples/forgeinform.html +0 -98
  192. package/docs/examples/form.html +0 -61
  193. package/docs/examples/gauge.html +0 -18
  194. package/docs/examples/invalid-template-literals.html +0 -44
  195. package/docs/examples/medium/remote.html +0 -60
  196. package/docs/examples/message.html +0 -18
  197. package/docs/examples/nested.html +0 -11
  198. package/docs/examples/object-bound-form.html +0 -34
  199. package/docs/examples/remote-server.js +0 -51
  200. package/docs/examples/remote.html +0 -34
  201. package/docs/examples/remote.json +0 -1
  202. package/docs/examples/scratch.html +0 -69
  203. package/docs/examples/sensors/index.html +0 -44
  204. package/docs/examples/sensors/sensor-server.js +0 -30
  205. package/docs/examples/shared.html +0 -41
  206. package/docs/examples/template.html +0 -33
  207. package/docs/examples/timeline.html +0 -21
  208. package/docs/examples/todo.html +0 -40
  209. package/docs/examples/top.html +0 -10
  210. package/docs/examples/types.html +0 -94
  211. package/docs/examples/xor.html +0 -62
  212. package/docs/examples.html +0 -25
  213. package/docs/javascript/codejar.min.js +0 -8
  214. package/docs/javascript/highlightjs.min.js +0 -1173
  215. package/docs/javascript/isomorphic-git.js +0 -9
  216. package/docs/javascript/json5.min.js +0 -1
  217. package/docs/javascript/lightning-fs.js +0 -1
  218. package/docs/javascript/lightview.js +0 -1285
  219. package/docs/javascript/marked.min.js +0 -6
  220. package/docs/javascript/peerjs.min.js +0 -70
  221. package/docs/javascript/turndown.js +0 -973
  222. package/docs/javascript/types.js +0 -606
  223. package/docs/javascript/utils.js +0 -45
  224. package/docs/lightview.html +0 -63
  225. package/docs/old_index.html +0 -965
  226. package/docs/old_index.md +0 -1132
  227. package/docs/slidein.html +0 -51
  228. package/docs/tutorial/0-getting-started.html +0 -67
  229. package/docs/tutorial/1-intro-to-variables.html +0 -103
  230. package/docs/tutorial/10-template-components.html +0 -80
  231. package/docs/tutorial/11-linked-components.html +0 -76
  232. package/docs/tutorial/12-imported-components.html +0 -67
  233. package/docs/tutorial/13-input-binding.html +0 -94
  234. package/docs/tutorial/14-automatic-variable-creation.html +0 -74
  235. package/docs/tutorial/15-form-binding.html +0 -110
  236. package/docs/tutorial/16-if-directive.html +0 -60
  237. package/docs/tutorial/17-loop-directives.html +0 -83
  238. package/docs/tutorial/18-sanitizing-and-escaping-input.html +0 -79
  239. package/docs/tutorial/2-imported-and-exported-variables.html +0 -80
  240. package/docs/tutorial/3-data-types.html +0 -89
  241. package/docs/tutorial/4-extended-data-types.html +0 -83
  242. package/docs/tutorial/5-extended-functional-types.html +0 -96
  243. package/docs/tutorial/5.1-extended-functional-types.html +0 -79
  244. package/docs/tutorial/5.2-extended-functional-types.html +0 -70
  245. package/docs/tutorial/6-conventional-javascript.html +0 -75
  246. package/docs/tutorial/7-monitoring-with-observers.html +0 -107
  247. package/docs/tutorial/8-event-listeners.html +0 -65
  248. package/docs/tutorial/9-intro-to-components.html +0 -91
  249. package/docs/tutorial/contents.html +0 -32
  250. package/docs/tutorial/my-component.html +0 -29
  251. package/docs/tutorial/remote-value.json +0 -4
  252. package/docs/websiterepl.html +0 -46
  253. package/jest-puppeteer.config.js +0 -5
  254. package/jest.config.json +0 -12
  255. package/lightview.min.js +0 -1
  256. package/lightview_good.js +0 -1267
  257. package/lightview_optimized.js +0 -1274
  258. package/repl_hold.html +0 -320
  259. package/test/basic.html +0 -104
  260. package/test/basic.test.mjs +0 -315
  261. package/test/extended.html +0 -29
  262. package/test/extended.test.mjs +0 -448
  263. package/types.js +0 -607
  264. package/unsplash.key +0 -1
@@ -0,0 +1,321 @@
1
+ <!-- SEO-friendly SPA Shim -->
2
+ <script src="/lightview-router.js"></script>
3
+ <script>
4
+ if (window.LightviewRouter) {
5
+ LightviewRouter.base('/index.html');
6
+ }
7
+ </script>
8
+
9
+ <!-- Load the page-specific stylesheet -->
10
+ <link rel="stylesheet" href="./index.css">
11
+
12
+ <!-- Gallery Structure -->
13
+ <div class="gallery-page">
14
+ <div class="gallery-layout">
15
+ <!-- Sidebar Overlay -->
16
+ <div id="sidebar-overlay" class="sidebar-overlay"></div>
17
+
18
+ <!-- Sidebar -->
19
+ <div id="gallery-sidebar" class="gallery-sidebar" style="visibility: hidden" src="./component-nav.html"></div>
20
+
21
+ <!-- Main Content -->
22
+ <div id="gallery-main" class="gallery-main">
23
+ <!-- Header Container -->
24
+ <div
25
+ style="position: sticky; top: 0; z-index: 30; background: var(--gallery-surface); border-bottom: 1px solid var(--gallery-border); backdrop-filter: blur(8px);">
26
+ <!-- Breadcrumbs Row -->
27
+ <div style="padding: 0.75rem 1.5rem 0;">
28
+ <script>
29
+ (() => {
30
+ const { Breadcrumbs } = Lightview.tags;
31
+ const breadcrumbs = Breadcrumbs({
32
+ id: 'page-breadcrumbs',
33
+ items: [
34
+ { label: 'Components', href: '/docs/components' },
35
+ { label: 'Navbar' }
36
+ ]
37
+ });
38
+ document.currentScript.replaceWith(breadcrumbs.domEl);
39
+ })();
40
+ </script>
41
+ </div>
42
+ <!-- Title Row -->
43
+ <div class="gallery-header"
44
+ style="border-bottom: none; height: auto; padding-top: 0.5rem; padding-bottom: 0.75rem;">
45
+ <button id="toggle-btn" class="toggle-btn" aria-label="Toggle Sidebar">
46
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="toggle-icon"
47
+ style="stroke: currentColor; stroke-width: 2;">
48
+ <path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
49
+ <path stroke-linecap="round" stroke-linejoin="round" d="M11 19l-7-7 7-7" />
50
+ </svg>
51
+ </button>
52
+ <h1 class="gallery-title">Navbar</h1>
53
+ </div>
54
+ </div>
55
+
56
+ <!-- Content -->
57
+ <div class="gallery-content">
58
+ <div class="section-content" style="max-width: 1000px;">
59
+ <p class="text-lg" style="opacity: 0.7; margin-bottom: 1.5rem;">
60
+ Navbar is a horizontal navigation bar at the top of the page.
61
+ Supports start, center, and end sections.
62
+ </p>
63
+
64
+ <!-- Basic Example with Examplify -->
65
+ <div class="card bg-base-200" style="margin-bottom: 2rem;">
66
+ <div class="card-body">
67
+ <h2 class="card-title">Basic Example</h2>
68
+ <p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">Navbar with brand and menu
69
+ items</p>
70
+
71
+ <!-- Tabs -->
72
+ <script>
73
+ window.switchSyntaxTab = (tabId) => {
74
+ const tabs = ['tagged', 'vdom', 'object'];
75
+ tabs.forEach(t => {
76
+ const tabEl = document.getElementById(`tab-btn-${t}`);
77
+ const contentEl = document.getElementById(`syntax-${t}`);
78
+ if (t === tabId) {
79
+ tabEl.classList.add('syntax-tab-active');
80
+ contentEl.style.display = 'block';
81
+ } else {
82
+ tabEl.classList.remove('syntax-tab-active');
83
+ contentEl.style.display = 'none';
84
+ }
85
+ });
86
+ };
87
+ </script>
88
+ <div role="tablist" class="syntax-tabs" style="margin-bottom: 1rem;">
89
+ <button id="tab-btn-tagged" role="tab" class="syntax-tab syntax-tab-active"
90
+ onclick="switchSyntaxTab('tagged')">Tagged</button>
91
+ <button id="tab-btn-vdom" role="tab" class="syntax-tab"
92
+ onclick="switchSyntaxTab('vdom')">vDOM</button>
93
+ <button id="tab-btn-object" role="tab" class="syntax-tab"
94
+ onclick="switchSyntaxTab('object')">Object
95
+ DOM</button>
96
+ </div>
97
+
98
+ <!-- Tagged Syntax -->
99
+ <div id="syntax-tagged">
100
+ <pre><script>
101
+ examplify(document.currentScript.nextElementSibling, {
102
+ at: document.currentScript.parentElement,
103
+ scripts: ['/lightview.js', '/lightview-x.js'],
104
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
105
+ type: 'module',
106
+ minHeight: 80,
107
+ autoRun: true
108
+ });
109
+ </script><code contenteditable="true">await import('/components/layout/navbar.js');
110
+ await import('/components/actions/button.js');
111
+ await import('/components/navigation/menu.js');
112
+
113
+ const { tags, $ } = Lightview;
114
+ const { Navbar, Button, Menu } = tags;
115
+
116
+ const navbar = Navbar({ style: 'background-color: oklch(var(--b1)); border-radius: var(--rounded-box, 1rem);' },
117
+ Navbar.Start({},
118
+ Button({ ghost: true, style: 'font-size: 1.25rem;' }, '🚀 Lightview')
119
+ ),
120
+ Navbar.Center({ style: 'display: flex;' },
121
+ Menu({ horizontal: true },
122
+ Menu.Item({}, 'Features'),
123
+ Menu.Item({}, 'Pricing'),
124
+ Menu.Item({}, 'About')
125
+ )
126
+ ),
127
+ Navbar.End({},
128
+ Button({ color: 'primary' }, 'Get Started')
129
+ )
130
+ );
131
+
132
+ $('#example').content(navbar);</code></pre>
133
+ </div>
134
+
135
+ <!-- vDOM Syntax -->
136
+ <div id="syntax-vdom" style="display: none;">
137
+ <pre><script>
138
+ examplify(document.currentScript.nextElementSibling, {
139
+ at: document.currentScript.parentElement,
140
+ scripts: ['/lightview.js', '/lightview-x.js'],
141
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
142
+ type: 'module',
143
+ minHeight: 80
144
+ });
145
+ </script><code contenteditable="true">await import('/components/layout/navbar.js');
146
+ await import('/components/actions/button.js');
147
+ await import('/components/navigation/menu.js');
148
+ const { $, tags } = Lightview;
149
+ const { Navbar, Button, Menu } = tags;
150
+
151
+ const navbar = {
152
+ tag: Navbar,
153
+ attributes: { style: 'background-color: oklch(var(--b1)); border-radius: var(--rounded-box, 1rem);' },
154
+ children: [
155
+ {
156
+ tag: Navbar.Start,
157
+ children: [{ tag: Button, attributes: { ghost: true, style: 'font-size: 1.25rem;' }, children: ['🚀 Lightview'] }]
158
+ },
159
+ {
160
+ tag: Navbar.Center,
161
+ attributes: { style: 'display: flex;' },
162
+ children: [
163
+ {
164
+ tag: Menu,
165
+ attributes: { horizontal: true },
166
+ children: [
167
+ { tag: Menu.Item, children: ['Features'] },
168
+ { tag: Menu.Item, children: ['Pricing'] },
169
+ { tag: Menu.Item, children: ['About'] }
170
+ ]
171
+ }
172
+ ]
173
+ },
174
+ {
175
+ tag: Navbar.End,
176
+ children: [{ tag: Button, attributes: { color: 'primary' }, children: ['Get Started'] }]
177
+ }
178
+ ]
179
+ };
180
+
181
+ $('#example').content(navbar);</code></pre>
182
+ </div>
183
+
184
+ <!-- Object DOM Syntax -->
185
+ <div id="syntax-object" style="display: none;">
186
+ <pre><script>
187
+ examplify(document.currentScript.nextElementSibling, {
188
+ at: document.currentScript.parentElement,
189
+ scripts: ['/lightview.js', '/lightview-x.js'],
190
+ styles: ['https://cdn.jsdelivr.net/npm/daisyui@3.9.4/dist/full.min.css'],
191
+ type: 'module',
192
+ minHeight: 80
193
+ });
194
+ </script><code contenteditable="true">await import('/components/layout/navbar.js');
195
+ await import('/components/actions/button.js');
196
+ await import('/components/navigation/menu.js');
197
+ const { $ } = Lightview;
198
+
199
+ const navbar = {
200
+ Navbar: {
201
+ style: 'background-color: oklch(var(--b1)); border-radius: var(--rounded-box, 1rem);',
202
+ children: [
203
+ {
204
+ 'Navbar.Start': {
205
+ children: [{ Button: { ghost: true, style: 'font-size: 1.25rem;', children: ['🚀 Lightview'] } }]
206
+ }
207
+ },
208
+ {
209
+ 'Navbar.Center': {
210
+ style: 'display: flex;',
211
+ children: [
212
+ {
213
+ Menu: {
214
+ horizontal: true,
215
+ children: [
216
+ { 'Menu.Item': { children: ['Features'] } },
217
+ { 'Menu.Item': { children: ['Pricing'] } },
218
+ { 'Menu.Item': { children: ['About'] } }
219
+ ]
220
+ }
221
+ }
222
+ ]
223
+ }
224
+ },
225
+ {
226
+ 'Navbar.End': {
227
+ children: [{ Button: { color: 'primary', children: ['Get Started'] } }]
228
+ }
229
+ }
230
+ ]
231
+ }
232
+ };
233
+
234
+ $('#example').content(navbar);</code></pre>
235
+ </div>
236
+ </div>
237
+ </div>
238
+
239
+ <!-- Props Table -->
240
+ <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">Sub-components</h2>
241
+ <div style="overflow-x: auto; margin-bottom: 2rem;">
242
+ <table class="table table-zebra">
243
+ <thead>
244
+ <tr>
245
+ <th>Component</th>
246
+ <th>Description</th>
247
+ </tr>
248
+ </thead>
249
+ <tbody>
250
+ <tr>
251
+ <td><code>Navbar.Start</code></td>
252
+ <td>Left section (flex-1)</td>
253
+ </tr>
254
+ <tr>
255
+ <td><code>Navbar.Center</code></td>
256
+ <td>Center section</td>
257
+ </tr>
258
+ <tr>
259
+ <td><code>Navbar.End</code></td>
260
+ <td>Right section</td>
261
+ </tr>
262
+ </tbody>
263
+ </table>
264
+ </div>
265
+
266
+ <!-- Static Examples -->
267
+ <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">With Dropdown</h2>
268
+ <div class="navbar"
269
+ style="background-color: oklch(var(--b1)); border-radius: var(--rounded-box, 1rem); margin-bottom: 2rem;">
270
+ <div style="flex: none;">
271
+ <div class="dropdown">
272
+ <div tabindex="0" role="button" class="btn btn-ghost btn-circle">
273
+ <svg xmlns="http://www.w3.org/2000/svg" style="height: 1.25rem; width: 1.25rem;"
274
+ fill="none" viewBox="0 0 24 24" stroke="currentColor">
275
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
276
+ d="M4 6h16M4 12h16M4 18h7" />
277
+ </svg>
278
+ </div>
279
+ <ul tabindex="0" class="menu menu-sm dropdown-content"
280
+ style="background-color: oklch(var(--b1)); border-radius: var(--rounded-box, 1rem); z-index: 10; margin-top: 0.75rem; width: 13rem; padding: 0.5rem; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);">
281
+ <li><a>Homepage</a></li>
282
+ <li><a>Portfolio</a></li>
283
+ <li><a>About</a></li>
284
+ </ul>
285
+ </div>
286
+ </div>
287
+ <div style="flex: 1;">
288
+ <a class="btn btn-ghost" style="font-size: 1.25rem;">daisyUI</a>
289
+ </div>
290
+ <div style="flex: none;">
291
+ <button class="btn btn-ghost btn-circle">
292
+ <svg xmlns="http://www.w3.org/2000/svg" style="height: 1.25rem; width: 1.25rem;"
293
+ fill="none" viewBox="0 0 24 24" stroke="currentColor">
294
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
295
+ d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" />
296
+ </svg>
297
+ </button>
298
+ </div>
299
+ </div>
300
+
301
+ <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">With Background Color</h2>
302
+ <div class="navbar"
303
+ style="background-color: oklch(var(--n)); color: oklch(var(--nc)); border-radius: var(--rounded-box, 1rem); margin-bottom: 2rem;">
304
+ <div class="navbar-start">
305
+ <a class="btn btn-ghost" style="font-size: 1.25rem;">daisyUI</a>
306
+ </div>
307
+ <div class="navbar-center" style="display: flex;">
308
+ <ul class="menu menu-horizontal" style="padding-left: 0.25rem; padding-right: 0.25rem;">
309
+ <li><a>Item 1</a></li>
310
+ <li><a>Item 2</a></li>
311
+ <li><a>Item 3</a></li>
312
+ </ul>
313
+ </div>
314
+ <div class="navbar-end">
315
+ <a class="btn">Button</a>
316
+ </div>
317
+ </div>
318
+ </div>
319
+ </div>
320
+ </div>
321
+ </div>
@@ -0,0 +1,279 @@
1
+ <!-- SEO-friendly SPA Shim -->
2
+ <script src="/lightview-router.js"></script>
3
+ <script>
4
+ if (window.LightviewRouter) {
5
+ LightviewRouter.base('/index.html');
6
+ }
7
+ </script>
8
+
9
+ <!-- Load the page-specific stylesheet -->
10
+ <link rel="stylesheet" href="./index.css">
11
+
12
+ <!-- Gallery Structure -->
13
+ <div class="gallery-page">
14
+ <div class="gallery-layout">
15
+ <!-- Sidebar Overlay -->
16
+ <div id="sidebar-overlay" class="sidebar-overlay"></div>
17
+
18
+ <!-- Sidebar -->
19
+ <div id="gallery-sidebar" class="gallery-sidebar" style="visibility: hidden" src="./component-nav.html"></div>
20
+
21
+ <!-- Main Content -->
22
+ <div id="gallery-main" class="gallery-main">
23
+ <!-- Header Container -->
24
+ <div
25
+ style="position: sticky; top: 0; z-index: 30; background: var(--gallery-surface); border-bottom: 1px solid var(--gallery-border); backdrop-filter: blur(8px);">
26
+ <!-- Breadcrumbs Row -->
27
+ <div style="padding: 0.75rem 1.5rem 0;">
28
+ <script>
29
+ (() => {
30
+ const { Breadcrumbs } = Lightview.tags;
31
+ const breadcrumbs = Breadcrumbs({
32
+ id: 'page-breadcrumbs',
33
+ items: [
34
+ { label: 'Components', href: '/docs/components' },
35
+ { label: 'Pagination' }
36
+ ]
37
+ });
38
+ document.currentScript.replaceWith(breadcrumbs.domEl);
39
+ })();
40
+ </script>
41
+ </div>
42
+ <!-- Title Row -->
43
+ <div class="gallery-header"
44
+ style="border-bottom: none; height: auto; padding-top: 0.5rem; padding-bottom: 0.75rem;">
45
+ <button id="toggle-btn" class="toggle-btn" aria-label="Toggle Sidebar">
46
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="toggle-icon"
47
+ style="stroke: currentColor; stroke-width: 2;">
48
+ <path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" />
49
+ <path stroke-linecap="round" stroke-linejoin="round" d="M11 19l-7-7 7-7" />
50
+ </svg>
51
+ </button>
52
+ <h1 class="gallery-title">Pagination</h1>
53
+ </div>
54
+ </div>
55
+
56
+ <!-- Content -->
57
+ <div class="gallery-content">
58
+ <div class="section-content" style="max-width: 1000px;">
59
+ <p class="text-lg" style="opacity: 0.7; margin-bottom: 1.5rem;">
60
+ Pagination is a group of buttons that allow navigation between pages.
61
+ Uses the Join component for grouping.
62
+ </p>
63
+
64
+ <!-- Basic Example with Examplify -->
65
+ <div class="card bg-base-200" style="margin-bottom: 2rem;">
66
+ <div class="card-body">
67
+ <h2 class="card-title">Basic Example</h2>
68
+ <p class="text-sm" style="opacity: 0.7; margin-bottom: 1rem;">Interactive pagination with
69
+ page state</p>
70
+
71
+ <!-- Tabs -->
72
+ <script>
73
+ window.switchSyntaxTab = (tabId) => {
74
+ const tabs = ['tagged', 'vdom', 'object'];
75
+ tabs.forEach(t => {
76
+ const tabEl = document.getElementById(`tab-btn-${t}`);
77
+ const contentEl = document.getElementById(`syntax-${t}`);
78
+ if (t === tabId) {
79
+ tabEl.classList.add('syntax-tab-active');
80
+ contentEl.style.display = 'block';
81
+ } else {
82
+ tabEl.classList.remove('syntax-tab-active');
83
+ contentEl.style.display = 'none';
84
+ }
85
+ });
86
+ };
87
+ </script>
88
+ <div role="tablist" class="syntax-tabs" style="margin-bottom: 1rem;">
89
+ <button id="tab-btn-tagged" role="tab" class="syntax-tab syntax-tab-active"
90
+ onclick="switchSyntaxTab('tagged')">Tagged</button>
91
+ <button id="tab-btn-vdom" role="tab" class="syntax-tab"
92
+ onclick="switchSyntaxTab('vdom')">vDOM</button>
93
+ <button id="tab-btn-object" role="tab" class="syntax-tab"
94
+ onclick="switchSyntaxTab('object')">Object
95
+ DOM</button>
96
+ </div>
97
+
98
+ <!-- Tagged Syntax -->
99
+ <div id="syntax-tagged">
100
+ <pre><script>
101
+ examplify(document.currentScript.nextElementSibling, {
102
+ at: document.currentScript.parentElement,
103
+ scripts: ['/lightview.js', '/lightview-x.js'],
104
+ type: 'module',
105
+ minHeight: 100,
106
+ autoRun: true
107
+ });
108
+ </script><code contenteditable="true">const { default: Join } = await import('/components/layout/join.js');
109
+ const { default: Button } = await import('/components/actions/button.js');
110
+
111
+ const { signal, tags, $ } = Lightview;
112
+ const { div, span } = tags;
113
+
114
+ const page = signal(1);
115
+ const totalPages = 5;
116
+
117
+ const demo = div({ style: 'display: flex; flex-direction: column; gap: 1rem; align-items: center' },
118
+ Join({},
119
+ Button({
120
+ class: 'join-item',
121
+ onclick: () => { if(page.value > 1) page.value--; }
122
+ }, '«'),
123
+ ...Array.from({ length: totalPages }, (_, i) =>
124
+ Button({
125
+ class: 'join-item',
126
+ color: () => page.value === i + 1 ? 'primary' : undefined,
127
+ onclick: () => { page.value = i + 1; }
128
+ }, i + 1)
129
+ ),
130
+ Button({
131
+ class: 'join-item',
132
+ onclick: () => { if(page.value < totalPages) page.value++; }
133
+ }, '»')
134
+ ),
135
+ span({ class: 'text-sm opacity-70' }, () => `Page ${page.value} of ${totalPages}`)
136
+ );
137
+
138
+ $('#example').content(demo);</code></pre>
139
+ </div>
140
+
141
+ <!-- vDOM Syntax -->
142
+ <div id="syntax-vdom" style="display: none;">
143
+ <pre><script>
144
+ examplify(document.currentScript.nextElementSibling, {
145
+ at: document.currentScript.parentElement,
146
+ scripts: ['/lightview.js', '/lightview-x.js'],
147
+ type: 'module',
148
+ minHeight: 100
149
+ });
150
+ </script><code contenteditable="true">const { default: Join } = await import('/components/layout/join.js');
151
+ const { default: Button } = await import('/components/actions/button.js');
152
+ const { signal, $ } = Lightview;
153
+
154
+ const page = signal(1);
155
+ const totalPages = 5;
156
+
157
+ const demo = {
158
+ tag: 'div',
159
+ attributes: { style: 'display: flex; flex-direction: column; gap: 1rem; align-items: center' },
160
+ children: [
161
+ {
162
+ tag: Join,
163
+ children: [
164
+ {
165
+ tag: Button,
166
+ attributes: { class: 'join-item', onclick: () => { if (page.value > 1) page.value--; } },
167
+ children: ['«']
168
+ },
169
+ ...Array.from({ length: totalPages }, (_, i) => ({
170
+ tag: Button,
171
+ attributes: {
172
+ class: 'join-item',
173
+ color: () => page.value === i + 1 ? 'primary' : undefined,
174
+ onclick: () => { page.value = i + 1; }
175
+ },
176
+ children: [i + 1]
177
+ })),
178
+ {
179
+ tag: Button,
180
+ attributes: { class: 'join-item', onclick: () => { if (page.value < totalPages) page.value++; } },
181
+ children: ['»']
182
+ }
183
+ ]
184
+ },
185
+ { tag: 'span', attributes: { class: 'text-sm opacity-70' }, children: [() => `Page ${page.value} of ${totalPages}`] }
186
+ ]
187
+ };
188
+
189
+ $('#example').content(demo);</code></pre>
190
+ </div>
191
+
192
+ <!-- Object DOM Syntax -->
193
+ <div id="syntax-object" style="display: none;">
194
+ <pre><script>
195
+ examplify(document.currentScript.nextElementSibling, {
196
+ at: document.currentScript.parentElement,
197
+ scripts: ['/lightview.js', '/lightview-x.js'],
198
+ type: 'module',
199
+ minHeight: 100
200
+ });
201
+ </script><code contenteditable="true">const { default: Join } = await import('/components/layout/join.js');
202
+ const { default: Button } = await import('/components/actions/button.js');
203
+ const { signal, tags, $ } = Lightview;
204
+ tags.Join = Join;
205
+ tags.Button = Button;
206
+
207
+ const page = signal(1);
208
+ const totalPages = 5;
209
+
210
+ const demo = {
211
+ div: {
212
+ style: 'display: flex; flex-direction: column; gap: 1rem; align-items: center',
213
+ children: [
214
+ {
215
+ Join: {
216
+ children: [
217
+ { Button: { class: 'join-item', onclick: () => { if (page.value > 1) page.value--; }, text: '«' } },
218
+ ...Array.from({ length: totalPages }, (_, i) => ({
219
+ Button: {
220
+ class: 'join-item',
221
+ color: () => page.value === i + 1 ? 'primary' : undefined,
222
+ onclick: () => { page.value = i + 1; },
223
+ text: i + 1
224
+ }
225
+ })),
226
+ { Button: { class: 'join-item', onclick: () => { if (page.value < totalPages) page.value++; }, text: '»' } }
227
+ ]
228
+ }
229
+ },
230
+ { span: { class: 'text-sm opacity-70', text: () => `Page ${page.value} of ${totalPages}` } }
231
+ ]
232
+ }
233
+ };
234
+
235
+ $('#example').content(demo);</code></pre>
236
+ </div>
237
+ </div>
238
+ </div>
239
+
240
+ <!-- Props Table -->
241
+ <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">Note</h2>
242
+ <div class="alert alert-info" style="margin-bottom: 2rem;">
243
+ <span>Pagination uses the <a href="/docs/components/join" class="link">Join</a> component to
244
+ group buttons
245
+ together.</span>
246
+ </div>
247
+
248
+ <!-- Sizes -->
249
+ <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">Sizes</h2>
250
+ <div class="example-stack" style="margin-bottom: 2rem;">
251
+ <div class="join">
252
+ <button class="join-item btn btn-xs">1</button>
253
+ <button class="join-item btn btn-xs btn-active">2</button>
254
+ <button class="join-item btn btn-xs">3</button>
255
+ </div>
256
+ <div class="join">
257
+ <button class="join-item btn btn-sm">1</button>
258
+ <button class="join-item btn btn-sm btn-active">2</button>
259
+ <button class="join-item btn btn-sm">3</button>
260
+ </div>
261
+ <div class="join">
262
+ <button class="join-item btn btn-lg">1</button>
263
+ <button class="join-item btn btn-lg btn-active">2</button>
264
+ <button class="join-item btn btn-lg">3</button>
265
+ </div>
266
+ </div>
267
+
268
+ <!-- Radio Style -->
269
+ <h2 class="text-xl font-bold" style="margin-bottom: 1rem;">Radio Style</h2>
270
+ <div class="join" style="margin-bottom: 2rem;">
271
+ <input class="join-item btn btn-square" type="radio" name="options" aria-label="1" checked />
272
+ <input class="join-item btn btn-square" type="radio" name="options" aria-label="2" />
273
+ <input class="join-item btn btn-square" type="radio" name="options" aria-label="3" />
274
+ <input class="join-item btn btn-square" type="radio" name="options" aria-label="4" />
275
+ </div>
276
+ </div>
277
+ </div>
278
+ </div>
279
+ </div>