@todovue/tv-ui 0.1.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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +207 -0
  3. package/dist/.htaccess +8 -0
  4. package/dist/demos/tv-alert/CHANGELOG.md +127 -0
  5. package/dist/demos/tv-alert/README.md +334 -0
  6. package/dist/demos/tv-article/CHANGELOG.md +221 -0
  7. package/dist/demos/tv-article/README.md +258 -0
  8. package/dist/demos/tv-breadcrumbs/CHANGELOG.md +135 -0
  9. package/dist/demos/tv-breadcrumbs/README.md +364 -0
  10. package/dist/demos/tv-button/CHANGELOG.md +158 -0
  11. package/dist/demos/tv-button/README.md +255 -0
  12. package/dist/demos/tv-card/CHANGELOG.md +158 -0
  13. package/dist/demos/tv-card/README.md +332 -0
  14. package/dist/demos/tv-demo/CHANGELOG.md +352 -0
  15. package/dist/demos/tv-demo/README.md +229 -0
  16. package/dist/demos/tv-footer/CHANGELOG.md +67 -0
  17. package/dist/demos/tv-footer/README.md +760 -0
  18. package/dist/demos/tv-hero/CHANGELOG.md +137 -0
  19. package/dist/demos/tv-hero/README.md +410 -0
  20. package/dist/demos/tv-label/CHANGELOG.md +138 -0
  21. package/dist/demos/tv-label/README.md +357 -0
  22. package/dist/demos/tv-menu/CHANGELOG.md +145 -0
  23. package/dist/demos/tv-menu/README.md +389 -0
  24. package/dist/demos/tv-modal/CHANGELOG.md +127 -0
  25. package/dist/demos/tv-modal/README.md +466 -0
  26. package/dist/demos/tv-pagination/CHANGELOG.md +125 -0
  27. package/dist/demos/tv-pagination/README.md +275 -0
  28. package/dist/demos/tv-progress-bar/CHANGELOG.md +84 -0
  29. package/dist/demos/tv-progress-bar/README.md +894 -0
  30. package/dist/demos/tv-relative-time/CHANGELOG.md +122 -0
  31. package/dist/demos/tv-relative-time/README.md +405 -0
  32. package/dist/demos/tv-scroll-top/CHANGELOG.md +69 -0
  33. package/dist/demos/tv-scroll-top/README.md +445 -0
  34. package/dist/demos/tv-search/CHANGELOG.md +155 -0
  35. package/dist/demos/tv-search/README.md +407 -0
  36. package/dist/demos/tv-settings/CHANGELOG.md +94 -0
  37. package/dist/demos/tv-settings/README.md +314 -0
  38. package/dist/demos/tv-sidebar/CHANGELOG.md +229 -0
  39. package/dist/demos/tv-sidebar/README.md +592 -0
  40. package/dist/demos/tv-theme-button/CHANGELOG.md +136 -0
  41. package/dist/demos/tv-theme-button/README.md +392 -0
  42. package/dist/demos/tv-toc/CHANGELOG.md +80 -0
  43. package/dist/demos/tv-toc/README.md +288 -0
  44. package/dist/entry.d.ts +48 -0
  45. package/dist/favicon.ico +0 -0
  46. package/dist/tv-ui.cjs.js +1 -0
  47. package/dist/tv-ui.css +1 -0
  48. package/dist/tv-ui.d.ts +6 -0
  49. package/dist/tv-ui.es.js +92 -0
  50. package/nuxt.js +58 -0
  51. package/package.json +92 -0
@@ -0,0 +1,288 @@
1
+ <p align="center"><img width="150" src="https://res.cloudinary.com/dcdfhi8qz/image/upload/v1763663056/uqqtkgp1lg3xdplutpga.png" alt="TODOvue logo">
2
+ </p>
3
+
4
+ # TODOvue TOC Component (TvToc)
5
+ A lightweight Vue 3 component to render a Table of Contents (TOC) for your articles or documentation, with smooth scrolling and nested sections support.
6
+
7
+ [![npm](https://img.shields.io/npm/v/@todovue/tv-toc.svg)](https://www.npmjs.com/package/@todovue/tv-toc)
8
+ [![npm downloads](https://img.shields.io/npm/dm/@todovue/tv-toc.svg)](https://www.npmjs.com/package/@todovue/tv-toc)
9
+ [![npm total downloads](https://img.shields.io/npm/dt/@todovue/tv-toc.svg)](https://www.npmjs.com/package/@todovue/tv-toc)
10
+ ![License](https://img.shields.io/github/license/TODOvue/tv-toc)
11
+ ![Release Date](https://img.shields.io/github/release-date/TODOvue/tv-toc)
12
+ ![Bundle Size](https://img.shields.io/bundlephobia/minzip/@todovue/tv-toc)
13
+ ![Node Version](https://img.shields.io/node/v/@todovue/tv-toc)
14
+ ![Last Commit](https://img.shields.io/github/last-commit/TODOvue/tv-toc)
15
+ ![Stars](https://img.shields.io/github/stars/TODOvue/tv-toc?style=social)
16
+
17
+ > Demo: https://ui.todovue.blog/toc
18
+
19
+ ## Table of Contents
20
+ - [Features](#features)
21
+ - [Installation](#installation)
22
+ - [Usage of Styles](#usage-of-styles)
23
+ - [Quick Start (SPA)](#quick-start-spa)
24
+ - [Nuxt 4 / SSR Usage](#nuxt-4--ssr-usage)
25
+ - [Component Registration Options](#component-registration-options)
26
+ - [Props](#props)
27
+ - [Composable: useToc](#composable-usetoc)
28
+ - [Customization (Styles)](#customization-styles)
29
+ - [SSR Notes](#ssr-notes)
30
+ - [Examples](#examples)
31
+ - [Development](#development)
32
+ - [Contributing](#contributing)
33
+ - [License](#license)
34
+
35
+ ## Features
36
+ - Simple and focused Table of Contents (TOC) component for Vue 3.
37
+ - Supports nested sections via children links.
38
+ - Smooth scrolling to headings using `scrollIntoView`.
39
+ - URL hash is updated using `history.pushState` for better navigation and shareable links.
40
+ - Works in SPA (Vite, Vue CLI) and Nuxt 3 (with client-side rendering constraints).
41
+ - Ships with minimal, customizable styles.
42
+
43
+ ## Installation
44
+ Using npm:
45
+ ```bash
46
+ npm install @todovue/tv-toc
47
+ ```
48
+ Using yarn:
49
+ ```bash
50
+ yarn add @todovue/tv-toc
51
+ ```
52
+ Using pnpm:
53
+ ```bash
54
+ pnpm add @todovue/tv-toc
55
+ ```
56
+
57
+ ## Usage of Styles
58
+
59
+ ### Vue/Vite (SPA)
60
+ Import the CSS generated by the library in your main entry file:
61
+ ```ts
62
+ // main.ts
63
+ import { createApp } from 'vue'
64
+ import App from './App.vue'
65
+
66
+ import '@todovue/tv-toc/style.css'
67
+ import { TvToc } from '@todovue/tv-toc'
68
+
69
+ const app = createApp(App)
70
+ app.component('TvToc', TvToc)
71
+ app.mount('#app')
72
+ ```
73
+
74
+ ### Nuxt 3/4
75
+ Add the library's CSS to your Nuxt configuration:
76
+ ```ts
77
+ // nuxt.config.ts
78
+ export default defineNuxtConfig({
79
+ modules: [
80
+ '@todovue/tv-toc/nuxt'
81
+ ]
82
+ })
83
+ ```
84
+
85
+ ## Quick Start (SPA)
86
+ Global registration (main.js / main.ts):
87
+ ```js
88
+ import { createApp } from 'vue'
89
+ import App from './App.vue'
90
+ import TvToc from '@todovue/tv-toc'
91
+
92
+ createApp(App)
93
+ .component('TvToc', TvToc)
94
+ .mount('#app')
95
+ ```
96
+ Local import inside a component:
97
+ ```vue
98
+ <script setup>
99
+ import { TvToc } from '@todovue/tv-toc'
100
+
101
+ const toc = {
102
+ title: 'On this page',
103
+ links: [
104
+ { id: 'introduction', text: 'Introduction' },
105
+ {
106
+ id: 'getting-started',
107
+ text: 'Getting started',
108
+ children: [
109
+ { id: 'installation', text: 'Installation' },
110
+ { id: 'basic-usage', text: 'Basic usage' },
111
+ ],
112
+ },
113
+ { id: 'api', text: 'API Reference' },
114
+ ],
115
+ }
116
+ </script>
117
+
118
+ <template>
119
+ <div class="page-layout">
120
+ <main class="page-content">
121
+ <h2 id="introduction">Introduction</h2>
122
+ <!-- ... -->
123
+ <h2 id="getting-started">Getting started</h2>
124
+ <h3 id="installation">Installation</h3>
125
+ <h3 id="basic-usage">Basic usage</h3>
126
+ <!-- ... -->
127
+ <h2 id="api">API Reference</h2>
128
+ </main>
129
+
130
+ <aside class="page-toc">
131
+ <TvToc :toc="toc" />
132
+ </aside>
133
+ </div>
134
+ </template>
135
+ ```
136
+
137
+ ## Nuxt 4 / SSR Usage
138
+ Create a plugin file: `plugins/tv-toc.client.ts` (client-only because it uses `document` and `history` under the hood when scrolling):
139
+ ```ts
140
+ import { defineNuxtPlugin } from '#app'
141
+ import TvToc from '@todovue/tv-toc'
142
+
143
+ export default defineNuxtPlugin(nuxtApp => {
144
+ nuxtApp.vueApp.component('TvToc', TvToc)
145
+ })
146
+ ```
147
+ Use anywhere (recommended inside `<client-only>` when using Nuxt 3):
148
+ ```vue
149
+ <template>
150
+ <client-only>
151
+ <TvToc :toc="toc" />
152
+ </client-only>
153
+ </template>
154
+ ```
155
+ Direct import (no plugin):
156
+ ```vue
157
+ <script setup>
158
+ import { TvToc } from '@todovue/tv-toc'
159
+ </script>
160
+
161
+ <template>
162
+ <TvToc :toc="toc" />
163
+ </template>
164
+ ```
165
+
166
+ ## Component Registration Options
167
+ | Approach | When to use |
168
+ |-----------------------------------------------|-----------------------------------|
169
+ | Global via `app.component('TvToc', TvToc)` | Frequent use across the app |
170
+ | Local named import `{ TvToc }` | Isolated/code-split contexts |
171
+ | Direct default import `import TvToc from ...` | Single use or manual registration |
172
+
173
+ ## Props
174
+ | Name | Type | Default | Description | Required |
175
+ |-----------------|---------|------------|----------------------------------------------------------------------------|----------|
176
+ | toc | Object | - | TOC configuration: title and list of links (with optional nested children) | `true` |
177
+ | marker | Boolean | `false` | Whether to display a visual marker for the active item. | `false` |
178
+ | collapsible | Boolean | `false` | Whether sublists can be collapsed/expanded. | `false` |
179
+ | activeClass | String | `'active'` | Custom CSS class for the active item. | `false` |
180
+ | observerOptions | Object | `{}` | options to pass to the IntersectionObserver (rootMargin, threshold, etc). | `false` |
181
+
182
+ ### `toc` shape
183
+ ```ts
184
+ type TocLink = {
185
+ id: string
186
+ text: string
187
+ children?: TocLink[]
188
+ }
189
+
190
+ type Toc = {
191
+ title?: string
192
+ links: TocLink[]
193
+ }
194
+ ```
195
+ - `title`: Optional title shown at the top of the TOC (`h3`).
196
+ - `links`: Array of top-level sections.
197
+ - `id`: Must match the `id` attribute of the target heading in your content.
198
+ - `text`: Label shown in the TOC.
199
+ - `children`: Optional array of subsections, rendered as nested list.
200
+
201
+ ## Composable: `useToc`
202
+ This composable is used internally by `TvToc` but can also be imported directly if needed.
203
+
204
+ ```ts
205
+ import { useToc } from '@todovue/tv-toc'
206
+
207
+ const { formatId, scrollToId } = useToc(links, {
208
+ rootMargin: '0px 0px -50% 0px'
209
+ })
210
+ ```
211
+
212
+ ### API
213
+ | Name | Type | Description |
214
+ |------------|--------------------------|----------------------------------------------------------------|
215
+ | formatId | `(id: string) => string` | Returns a hash-based id string (e.g. `"#section-id"`). |
216
+ | scrollToId | `(id: string) => void` | Smooth scrolls to the element with that `id` and updates hash. |
217
+
218
+ > Note: `scrollToId` accesses `document` and `history`, so it should run only in the browser (e.g. in event handlers or inside `onMounted`).
219
+
220
+ ## Customization (Styles)
221
+ The component ships with minimal default styles, exposed through the built CSS file and scoped CSS classes.
222
+
223
+ Main CSS classes:
224
+ - `.tv-toc` — Root `<nav>` container.
225
+ - `.tv-toc-title` — Title of the TOC.
226
+ - `.tv-toc-list` — Top-level list container.
227
+ - `.tv-toc-item` — Top-level list item.
228
+ - `.tv-toc-link` — Anchor for top-level items.
229
+ - `.tv-toc-sublist` — Nested list container for children.
230
+ - `.tv-toc-subitem` — Nested list item.
231
+ - `.tv-toc-sublink` — Anchor for nested items.
232
+
233
+ You can override these styles in your own global stylesheet:
234
+ ```css
235
+ /* example overrides */
236
+ .tv-toc {
237
+ font-size: 0.9rem;
238
+ }
239
+
240
+ .tv-toc-link,
241
+ .tv-toc-sublink {
242
+ color: #4b5563;
243
+ }
244
+
245
+ .tv-toc-link:hover,
246
+ .tv-toc-sublink:hover {
247
+ color: #111827;
248
+ }
249
+ ```
250
+
251
+ If you are using SCSS, you can also rely on your own design tokens and overrides. The package itself internally uses SCSS (see `src/assets/scss/_variables.scss` and `src/assets/scss/style.scss`).
252
+
253
+ ## SSR Notes
254
+ - The component can be rendered on the server (template is static), but scrolling behavior uses browser APIs.
255
+ - `scrollToId` uses `document.getElementById` and `history.pushState`; these are only invoked in event handlers on the client.
256
+ - When using Nuxt 3, prefer registering `TvToc` in a `*.client.ts` plugin or wrap usages in `<client-only>` to avoid hydration edge cases in environments with stricter SSR.
257
+
258
+ ## Examples
259
+ This repository includes a small demo application built with Vite.
260
+
261
+ - Basic TOC example.
262
+ - Blog-like layout with nested headings.
263
+
264
+ To run the demo locally, see the [Development](#development) section.
265
+
266
+ ## Development
267
+ ```bash
268
+ git clone https://github.com/TODOvue/tv-toc.git
269
+ cd tv-toc
270
+ npm install
271
+ npm run dev # run local demo
272
+ npm run build # build library
273
+ ```
274
+ The local demo is served with Vite using `index.html` and examples in `src/demo`.
275
+
276
+ To build the standalone demo used for documentation:
277
+ ```bash
278
+ npm run build:demo
279
+ ```
280
+
281
+ ## Contributing
282
+ PRs and issues are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md).
283
+
284
+ ## License
285
+ MIT © TODOvue
286
+
287
+ ### Attributions
288
+ Crafted for the TODOvue component ecosystem
@@ -0,0 +1,48 @@
1
+ import { Plugin } from 'vue';
2
+ import { TvAlert } from '@todovue/tv-alert';
3
+ import { TvArticle } from '@todovue/tv-article';
4
+ import { TvBreadcrumbs } from '@todovue/tv-breadcrumbs';
5
+ import { TvButton } from '@todovue/tv-button';
6
+ import { TvCard } from '@todovue/tv-card';
7
+ import { TvDemo } from '@todovue/tv-demo';
8
+ import { TvFooter } from '@todovue/tv-footer';
9
+ import { TvHero } from '@todovue/tv-hero';
10
+ import { TvLabel } from '@todovue/tv-label';
11
+ import { TvMenu } from '@todovue/tv-menu';
12
+ import { TvModal } from '@todovue/tv-modal';
13
+ import { TvPagination } from '@todovue/tv-pagination';
14
+ import { TvProgressBar } from '@todovue/tv-progress-bar';
15
+ import { TvRelativeTime } from '@todovue/tv-relative-time';
16
+ import { TvScrollTop } from '@todovue/tv-scroll-top';
17
+ import { TvSearch } from '@todovue/tv-search';
18
+ import { TvSettings } from '@todovue/tv-settings';
19
+ import { TvSidebar } from '@todovue/tv-sidebar';
20
+ import { TvThemeButton } from '@todovue/tv-theme-button';
21
+ import { TvToc } from '@todovue/tv-toc';
22
+ export { TvAlert, TvArticle, TvBreadcrumbs, TvButton, TvCard, TvDemo, TvFooter, TvHero, TvLabel, TvMenu, TvModal, TvPagination, TvProgressBar, TvRelativeTime, TvScrollTop, TvSearch, TvSettings, TvSidebar, TvThemeButton, TvToc };
23
+ export declare const TvUi: Plugin;
24
+ export default TvUi;
25
+ declare module 'vue' {
26
+ interface GlobalComponents {
27
+ TvAlert: typeof TvAlert;
28
+ TvArticle: typeof TvArticle;
29
+ TvBreadcrumbs: typeof TvBreadcrumbs;
30
+ TvButton: typeof TvButton;
31
+ TvCard: typeof TvCard;
32
+ TvDemo: typeof TvDemo;
33
+ TvFooter: typeof TvFooter;
34
+ TvHero: typeof TvHero;
35
+ TvLabel: typeof TvLabel;
36
+ TvMenu: typeof TvMenu;
37
+ TvModal: typeof TvModal;
38
+ TvPagination: typeof TvPagination;
39
+ TvProgressBar: typeof TvProgressBar;
40
+ TvRelativeTime: typeof TvRelativeTime;
41
+ TvScrollTop: typeof TvScrollTop;
42
+ TvSearch: typeof TvSearch;
43
+ TvSettings: typeof TvSettings;
44
+ TvSidebar: typeof TvSidebar;
45
+ TvThemeButton: typeof TvThemeButton;
46
+ TvToc: typeof TvToc;
47
+ }
48
+ }
Binary file
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@todovue/tv-alert"),t=require("@todovue/tv-article"),o=require("@todovue/tv-breadcrumbs"),n=require("@todovue/tv-button"),v=require("@todovue/tv-card"),u=require("@todovue/tv-demo"),T=require("@todovue/tv-footer"),i=require("@todovue/tv-hero"),a=require("@todovue/tv-label"),c=require("@todovue/tv-menu"),l=require("@todovue/tv-modal"),b=require("@todovue/tv-pagination"),s=require("@todovue/tv-progress-bar"),d=require("@todovue/tv-relative-time"),m=require("@todovue/tv-scroll-top"),g=require("@todovue/tv-search"),P=require("@todovue/tv-settings"),p=require("@todovue/tv-sidebar"),f=require("@todovue/tv-theme-button"),j=require("@todovue/tv-toc"),q=[r.TvAlert,t.TvArticle,o.TvBreadcrumbs,n.TvButton,v.TvCard,u.TvDemo,T.TvFooter,i.TvHero,a.TvLabel,c.TvMenu,l.TvModal,b.TvPagination,s.TvProgressBar,d.TvRelativeTime,m.TvScrollTop,g.TvSearch,P.TvSettings,p.TvSidebar,f.TvThemeButton,j.TvToc],S=O=>{q.forEach(e=>{e.name&&O.component(e.name,e)})},y={install:S};Object.defineProperty(exports,"TvAlert",{enumerable:!0,get:()=>r.TvAlert});Object.defineProperty(exports,"TvArticle",{enumerable:!0,get:()=>t.TvArticle});Object.defineProperty(exports,"TvBreadcrumbs",{enumerable:!0,get:()=>o.TvBreadcrumbs});Object.defineProperty(exports,"TvButton",{enumerable:!0,get:()=>n.TvButton});Object.defineProperty(exports,"TvCard",{enumerable:!0,get:()=>v.TvCard});Object.defineProperty(exports,"TvDemo",{enumerable:!0,get:()=>u.TvDemo});Object.defineProperty(exports,"TvFooter",{enumerable:!0,get:()=>T.TvFooter});Object.defineProperty(exports,"TvHero",{enumerable:!0,get:()=>i.TvHero});Object.defineProperty(exports,"TvLabel",{enumerable:!0,get:()=>a.TvLabel});Object.defineProperty(exports,"TvMenu",{enumerable:!0,get:()=>c.TvMenu});Object.defineProperty(exports,"TvModal",{enumerable:!0,get:()=>l.TvModal});Object.defineProperty(exports,"TvPagination",{enumerable:!0,get:()=>b.TvPagination});Object.defineProperty(exports,"TvProgressBar",{enumerable:!0,get:()=>s.TvProgressBar});Object.defineProperty(exports,"TvRelativeTime",{enumerable:!0,get:()=>d.TvRelativeTime});Object.defineProperty(exports,"TvScrollTop",{enumerable:!0,get:()=>m.TvScrollTop});Object.defineProperty(exports,"TvSearch",{enumerable:!0,get:()=>g.TvSearch});Object.defineProperty(exports,"TvSettings",{enumerable:!0,get:()=>P.TvSettings});Object.defineProperty(exports,"TvSidebar",{enumerable:!0,get:()=>p.TvSidebar});Object.defineProperty(exports,"TvThemeButton",{enumerable:!0,get:()=>f.TvThemeButton});Object.defineProperty(exports,"TvToc",{enumerable:!0,get:()=>j.TvToc});exports.TvUi=y;exports.default=y;
package/dist/tv-ui.css ADDED
@@ -0,0 +1 @@
1
+ body{background:#161e31;color:#cbd5e1;font-family:Roboto,sans-serif}
@@ -0,0 +1,6 @@
1
+ export * from './entry'
2
+ export {}
3
+ import TvUi from './entry'
4
+ export default TvUi
5
+ export * from './entry'
6
+ export {}
@@ -0,0 +1,92 @@
1
+ import { TvAlert as m } from "@todovue/tv-alert";
2
+ import { TvAlert as V } from "@todovue/tv-alert";
3
+ import { TvArticle as t } from "@todovue/tv-article";
4
+ import { TvArticle as X } from "@todovue/tv-article";
5
+ import { TvBreadcrumbs as e } from "@todovue/tv-breadcrumbs";
6
+ import { TvBreadcrumbs as Z } from "@todovue/tv-breadcrumbs";
7
+ import { TvButton as T } from "@todovue/tv-button";
8
+ import { TvButton as $ } from "@todovue/tv-button";
9
+ import { TvCard as f } from "@todovue/tv-card";
10
+ import { TvCard as ro } from "@todovue/tv-card";
11
+ import { TvDemo as p } from "@todovue/tv-demo";
12
+ import { TvDemo as to } from "@todovue/tv-demo";
13
+ import { TvFooter as v } from "@todovue/tv-footer";
14
+ import { TvFooter as To } from "@todovue/tv-footer";
15
+ import { TvHero as i } from "@todovue/tv-hero";
16
+ import { TvHero as po } from "@todovue/tv-hero";
17
+ import { TvLabel as a } from "@todovue/tv-label";
18
+ import { TvLabel as io } from "@todovue/tv-label";
19
+ import { TvMenu as x } from "@todovue/tv-menu";
20
+ import { TvMenu as xo } from "@todovue/tv-menu";
21
+ import { TvModal as n } from "@todovue/tv-modal";
22
+ import { TvModal as lo } from "@todovue/tv-modal";
23
+ import { TvPagination as l } from "@todovue/tv-pagination";
24
+ import { TvPagination as so } from "@todovue/tv-pagination";
25
+ import { TvProgressBar as c } from "@todovue/tv-progress-bar";
26
+ import { TvProgressBar as Bo } from "@todovue/tv-progress-bar";
27
+ import { TvRelativeTime as s } from "@todovue/tv-relative-time";
28
+ import { TvRelativeTime as bo } from "@todovue/tv-relative-time";
29
+ import { TvScrollTop as d } from "@todovue/tv-scroll-top";
30
+ import { TvScrollTop as ho } from "@todovue/tv-scroll-top";
31
+ import { TvSearch as u } from "@todovue/tv-search";
32
+ import { TvSearch as Mo } from "@todovue/tv-search";
33
+ import { TvSettings as B } from "@todovue/tv-settings";
34
+ import { TvSettings as Co } from "@todovue/tv-settings";
35
+ import { TvSidebar as S } from "@todovue/tv-sidebar";
36
+ import { TvSidebar as Fo } from "@todovue/tv-sidebar";
37
+ import { TvThemeButton as b } from "@todovue/tv-theme-button";
38
+ import { TvThemeButton as Lo } from "@todovue/tv-theme-button";
39
+ import { TvToc as g } from "@todovue/tv-toc";
40
+ import { TvToc as Eo } from "@todovue/tv-toc";
41
+ const h = [
42
+ m,
43
+ t,
44
+ e,
45
+ T,
46
+ f,
47
+ p,
48
+ v,
49
+ i,
50
+ a,
51
+ x,
52
+ n,
53
+ l,
54
+ c,
55
+ s,
56
+ d,
57
+ u,
58
+ B,
59
+ S,
60
+ b,
61
+ g
62
+ ], A = (r) => {
63
+ h.forEach((o) => {
64
+ o.name && r.component(o.name, o);
65
+ });
66
+ }, N = {
67
+ install: A
68
+ };
69
+ export {
70
+ V as TvAlert,
71
+ X as TvArticle,
72
+ Z as TvBreadcrumbs,
73
+ $ as TvButton,
74
+ ro as TvCard,
75
+ to as TvDemo,
76
+ To as TvFooter,
77
+ po as TvHero,
78
+ io as TvLabel,
79
+ xo as TvMenu,
80
+ lo as TvModal,
81
+ so as TvPagination,
82
+ Bo as TvProgressBar,
83
+ bo as TvRelativeTime,
84
+ ho as TvScrollTop,
85
+ Mo as TvSearch,
86
+ Co as TvSettings,
87
+ Fo as TvSidebar,
88
+ Lo as TvThemeButton,
89
+ Eo as TvToc,
90
+ N as TvUi,
91
+ N as default
92
+ };
package/nuxt.js ADDED
@@ -0,0 +1,58 @@
1
+
2
+ import { defineNuxtModule } from '@nuxt/kit'
3
+
4
+ export default defineNuxtModule({
5
+ meta: {
6
+ name: '@todovue/tv-ui',
7
+ configKey: 'tvUi'
8
+ },
9
+ setup(_options, nuxt) {
10
+ const alertCss = '@todovue/tv-alert/style.css';
11
+ const articleCss = '@todovue/tv-article/style.css';
12
+ const breadcrumbsCss = '@todovue/tv-breadcrumbs/style.css';
13
+ const cardCss = '@todovue/tv-card/style.css';
14
+ const footerCss = '@todovue/tv-footer/style.css';
15
+ const labelCss = '@todovue/tv-label/style.css';
16
+ const modalCss = '@todovue/tv-modal/style.css';
17
+ const buttonCss = '@todovue/tv-button/style.css';
18
+ const demoCss = '@todovue/tv-demo/style.css';
19
+ const heroCss = '@todovue/tv-hero/style.css';
20
+ const menuCss = '@todovue/tv-menu/style.css';
21
+ const paginationCss = '@todovue/tv-pagination/style.css';
22
+ const progressBarCss = '@todovue/tv-progress-bar/style.css';
23
+ const scrollTopCss = '@todovue/tv-scroll-top/style.css';
24
+ const searchCss = '@todovue/tv-search/style.css';
25
+ const settingsCss = '@todovue/tv-settings/style.css';
26
+ const sidebarCss = '@todovue/tv-sidebar/style.css';
27
+ const themeButtonCss = '@todovue/tv-theme-button/style.css';
28
+ const tocCss = '@todovue/tv-toc/style.css';
29
+
30
+ const pushUnique = (path) => {
31
+ if (!nuxt.options.css.includes(path)) {
32
+ nuxt.options.css.push(path);
33
+ }
34
+ };
35
+
36
+ [
37
+ alertCss,
38
+ articleCss,
39
+ breadcrumbsCss,
40
+ cardCss,
41
+ footerCss,
42
+ labelCss,
43
+ modalCss,
44
+ buttonCss,
45
+ demoCss,
46
+ heroCss,
47
+ menuCss,
48
+ paginationCss,
49
+ progressBarCss,
50
+ scrollTopCss,
51
+ searchCss,
52
+ settingsCss,
53
+ sidebarCss,
54
+ themeButtonCss,
55
+ tocCss
56
+ ].forEach(pushUnique);
57
+ }
58
+ })
package/package.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "@todovue/tv-ui",
3
+ "private": false,
4
+ "author": "Cristhian Daza",
5
+ "description": "UI component library for TODOvue application",
6
+ "license": "MIT",
7
+ "version": "0.1.0",
8
+ "type": "module",
9
+ "homepage": "https://ui.todovue.blog",
10
+ "repository": {
11
+ "name": "@todovue/tv-ui",
12
+ "type": "git",
13
+ "url": "git+https://github.com/TODOvue/tv-ui.git"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/TODOvue/tv-ui/issues"
17
+ },
18
+ "keywords": [
19
+ "todovue",
20
+ "front-end",
21
+ "web",
22
+ "vue",
23
+ "vuejs",
24
+ "vue-js",
25
+ "ui",
26
+ "show-ui",
27
+ "vue-ui",
28
+ "vue-ui-component"
29
+ ],
30
+ "exports": {
31
+ ".": {
32
+ "import": "./dist/tv-ui.es.js",
33
+ "require": "./dist/tv-ui.cjs.js"
34
+ },
35
+ "./style.css": "./dist/tv-ui.css",
36
+ "./nuxt": "./nuxt.js"
37
+ },
38
+ "main": "dist/tv-ui.cjs.js",
39
+ "module": "dist/tv-ui.es.js",
40
+ "types": "dist/tv-ui.d.ts",
41
+ "files": [
42
+ "dist",
43
+ "LICENSE",
44
+ "README.md",
45
+ "nuxt.js"
46
+ ],
47
+ "engines": {
48
+ "node": ">=20.19.0"
49
+ },
50
+ "sideEffects": [
51
+ "*.css",
52
+ "*.scss",
53
+ "dist/*.css"
54
+ ],
55
+ "scripts": {
56
+ "dev": "node scripts/copy-assets.js && vite",
57
+ "build": "vite build",
58
+ "build:demo": "cp README.md public/ && cp CHANGELOG.md public/ && VITE_BUILD_TARGET=demo vite build"
59
+ },
60
+ "peerDependencies": {
61
+ "vue": "^3.5.27"
62
+ },
63
+ "devDependencies": {
64
+ "@vitejs/plugin-vue": "^6.0.3",
65
+ "sass": "^1.97.2",
66
+ "vite": "^7.3.1",
67
+ "vite-plugin-dts": "^4.5.4"
68
+ },
69
+ "dependencies": {
70
+ "@todovue/tv-alert": "^1.2.1",
71
+ "@todovue/tv-article": "^1.3.4",
72
+ "@todovue/tv-breadcrumbs": "^1.1.4",
73
+ "@todovue/tv-button": "^1.2.6",
74
+ "@todovue/tv-card": "^1.1.4",
75
+ "@todovue/tv-demo": "^1.4.11",
76
+ "@todovue/tv-footer": "^1.1.1",
77
+ "@todovue/tv-hero": "^1.2.1",
78
+ "@todovue/tv-label": "^1.2.4",
79
+ "@todovue/tv-menu": "^1.1.4",
80
+ "@todovue/tv-modal": "^1.2.1",
81
+ "@todovue/tv-pagination": "^1.1.4",
82
+ "@todovue/tv-progress-bar": "^1.1.1",
83
+ "@todovue/tv-relative-time": "^1.3.1",
84
+ "@todovue/tv-scroll-top": "^1.0.3",
85
+ "@todovue/tv-search": "^1.2.1",
86
+ "@todovue/tv-settings": "^1.0.4",
87
+ "@todovue/tv-sidebar": "^2.2.2",
88
+ "@todovue/tv-theme-button": "^1.2.1",
89
+ "@todovue/tv-toc": "^1.1.1",
90
+ "vue-router": "^4.6.4"
91
+ }
92
+ }