@todovue/tv-ui 0.1.0 → 0.1.2

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 (48) hide show
  1. package/README.md +20 -20
  2. package/dist/entry.d.ts +2 -2
  3. package/dist/tv-ui.cjs.js +1 -1
  4. package/dist/tv-ui.css +1 -1
  5. package/dist/tv-ui.es.js +50 -49
  6. package/package.json +4 -2
  7. package/dist/.htaccess +0 -8
  8. package/dist/demos/tv-alert/CHANGELOG.md +0 -127
  9. package/dist/demos/tv-alert/README.md +0 -334
  10. package/dist/demos/tv-article/CHANGELOG.md +0 -221
  11. package/dist/demos/tv-article/README.md +0 -258
  12. package/dist/demos/tv-breadcrumbs/CHANGELOG.md +0 -135
  13. package/dist/demos/tv-breadcrumbs/README.md +0 -364
  14. package/dist/demos/tv-button/CHANGELOG.md +0 -158
  15. package/dist/demos/tv-button/README.md +0 -255
  16. package/dist/demos/tv-card/CHANGELOG.md +0 -158
  17. package/dist/demos/tv-card/README.md +0 -332
  18. package/dist/demos/tv-demo/CHANGELOG.md +0 -352
  19. package/dist/demos/tv-demo/README.md +0 -229
  20. package/dist/demos/tv-footer/CHANGELOG.md +0 -67
  21. package/dist/demos/tv-footer/README.md +0 -760
  22. package/dist/demos/tv-hero/CHANGELOG.md +0 -137
  23. package/dist/demos/tv-hero/README.md +0 -410
  24. package/dist/demos/tv-label/CHANGELOG.md +0 -138
  25. package/dist/demos/tv-label/README.md +0 -357
  26. package/dist/demos/tv-menu/CHANGELOG.md +0 -145
  27. package/dist/demos/tv-menu/README.md +0 -389
  28. package/dist/demos/tv-modal/CHANGELOG.md +0 -127
  29. package/dist/demos/tv-modal/README.md +0 -466
  30. package/dist/demos/tv-pagination/CHANGELOG.md +0 -125
  31. package/dist/demos/tv-pagination/README.md +0 -275
  32. package/dist/demos/tv-progress-bar/CHANGELOG.md +0 -84
  33. package/dist/demos/tv-progress-bar/README.md +0 -894
  34. package/dist/demos/tv-relative-time/CHANGELOG.md +0 -122
  35. package/dist/demos/tv-relative-time/README.md +0 -405
  36. package/dist/demos/tv-scroll-top/CHANGELOG.md +0 -69
  37. package/dist/demos/tv-scroll-top/README.md +0 -445
  38. package/dist/demos/tv-search/CHANGELOG.md +0 -155
  39. package/dist/demos/tv-search/README.md +0 -407
  40. package/dist/demos/tv-settings/CHANGELOG.md +0 -94
  41. package/dist/demos/tv-settings/README.md +0 -314
  42. package/dist/demos/tv-sidebar/CHANGELOG.md +0 -229
  43. package/dist/demos/tv-sidebar/README.md +0 -592
  44. package/dist/demos/tv-theme-button/CHANGELOG.md +0 -136
  45. package/dist/demos/tv-theme-button/README.md +0 -392
  46. package/dist/demos/tv-toc/CHANGELOG.md +0 -80
  47. package/dist/demos/tv-toc/README.md +0 -288
  48. package/dist/favicon.ico +0 -0
@@ -1,275 +0,0 @@
1
- <p align="center"><img width="150" src="https://res.cloudinary.com/dcdfhi8qz/image/upload/v1763663056/uqqtkgp1lg3xdplutpga.png" alt="TODOvue logo" /></p>
2
-
3
- # TODOvue Pagination (TvPagination)
4
-
5
- A pagination component for Vue 3, flexible and customizable, with support for smart ranges (sibling pages and boundaries), ellipsis, optional navigation buttons, icons, custom styles, and a slot for labels. Designed for SPAs and SSR environments (e.g. Nuxt 3) without assuming DOM details.
6
-
7
- [![npm](https://img.shields.io/npm/v/@todovue/tv-pagination.svg)](https://www.npmjs.com/package/@todovue/tv-pagination)
8
- [![npm downloads](https://img.shields.io/npm/dm/@todovue/tv-pagination.svg)](https://www.npmjs.com/package/@todovue/tv-pagination)
9
- [![npm total downloads](https://img.shields.io/npm/dt/@todovue/tv-pagination.svg)](https://www.npmjs.com/package/@todovue/tv-pagination)
10
- ![License](https://img.shields.io/github/license/TODOvue/tv-pagination)
11
- ![Release Date](https://img.shields.io/github/release-date/TODOvue/tv-pagination)
12
- ![Bundle Size](https://img.shields.io/bundlephobia/minzip/@todovue/tv-pagination)
13
- ![Node Version](https://img.shields.io/node/v/@todovue/tv-pagination)
14
- ![Last Commit](https://img.shields.io/github/last-commit/TODOvue/tv-pagination)
15
- ![Stars](https://img.shields.io/github/stars/TODOvue/tv-pagination?style=social)
16
-
17
- > Demo: https://ui.todovue.blog/pagination
18
-
19
- ## Table of Contents
20
-
21
- * [Features](#features)
22
- * [Installation](#installation)
23
- * [Quick Start (SPA)](#quick-start-spa)
24
- * [Usage in Nuxt 4 / SSR](#usage-in-nuxt-4--ssr)
25
- * [Component Registration Options](#component-registration-options)
26
- * [Props](#props)
27
- * [Events](#events)
28
- * [Slots](#slots)
29
- * [Customization (Styles / Theming)](#customization-styles--theming)
30
- * [Accessibility](#accessibility)
31
- * [SSR Notes](#ssr-notes)
32
- * [Development](#development)
33
- * [Contribute](#contribute)
34
- * [License](#license)
35
- * [Attributions](#attributions)
36
-
37
- ## Features
38
-
39
- * Automatic calculation of total pages from `totalItems` and `pageSize`.
40
- * Dynamic range with sibling pages (`siblingCount`) and boundaries (`boundaryCount`).
41
- * Conditional left / right ellipsis when large jumps exist.
42
- * Optional buttons: first / last (`showFirstLast`) and previous / next (`showPrevNext`).
43
- * Navigation icons (internally uses `@todovue/tv-button`).
44
- * Custom styles for active / inactive pages (`activeStyle`, `inactiveStyle`).
45
- * Slot to customize each page label (`page-label`).
46
- * Controlled via `v-model` (current page) + semantic change event.
47
- * Ready for SSR (no direct access to `window` / `document`).
48
- * No heavy dependencies (only `vue` as peer + `@todovue/tv-button`).
49
- * Easy integration in TODOvue design systems.
50
-
51
- ## Installation
52
-
53
- Using npm:
54
-
55
- ```bash
56
- npm install @todovue/tv-pagination
57
- ```
58
-
59
- Using yarn:
60
-
61
- ```bash
62
- yarn add @todovue/tv-pagination
63
- ```
64
-
65
- Using pnpm:
66
-
67
- ```bash
68
- pnpm add @todovue/tv-pagination
69
- ```
70
-
71
- > Requires `vue@^3`. `@todovue/tv-button` installs as a dependency.
72
-
73
- ## Quick Start (SPA)
74
-
75
- Global registration (main.js / main.ts):
76
-
77
- ```js
78
- import { createApp } from 'vue'
79
- import App from './App.vue'
80
- import { TvPagination } from '@todovue/tv-pagination'
81
- import '@todovue/tv-pagination/style.css' // import styles
82
- import '@todovue/tv-button/style.css' // import styles
83
-
84
- createApp(App)
85
- .use(TvPagination) // enables <TvPagination /> globally
86
- .mount('#app')
87
- ```
88
-
89
- Local usage inside a component:
90
-
91
- ```vue
92
- <script setup>
93
- import { ref } from 'vue'
94
- import { TvPagination } from '@todovue/tv-pagination'
95
- import '@todovue/tv-pagination/style.css' // import styles
96
- import '@todovue/tv-button/style.css' // import styles
97
-
98
- const page = ref(1)
99
- </script>
100
-
101
- <template>
102
- <TvPagination v-model="page" :total-items="500" :sibling-count="2" :boundary-count="2" />
103
- </template>
104
- ```
105
-
106
- ## Usage in Nuxt 4 / SSR
107
- ```ts
108
- // nuxt.config.ts
109
- export default defineNuxtConfig({
110
- modules: [
111
- '@todovue/tv-card/nuxt'
112
- ]
113
- })
114
- ```
115
-
116
- Use anywhere:
117
-
118
- ```vue
119
- <TvPagination v-model="page" :total-items="120" />
120
- ```
121
-
122
- ## Component Registration Options
123
-
124
- | Approach | When to use |
125
- |-----------------------------------------------|-------------------------------------|
126
- | Global `app.use(TvPagination)` | Frequent use in many views |
127
- | Local import `{ TvPagination }` | Isolated contexts / code-splitting |
128
- | Default import `import TvPagination from ...` | Single usage or manual registration |
129
- | Nuxt plugin | SSR / design consistency |
130
-
131
- ## Props
132
-
133
- | Prop | Type | Default | Required | Description |
134
- |---------------|---------|------------------------------------------------------------|----------|----------------------------------------------------------------|
135
- | modelValue | Number | 1 | No | Current page (v-model). Normalized to valid range. |
136
- | totalItems | Number | — | Yes | Total items being paginated. |
137
- | pageSize | Number | 10 | No | Page size to calculate `totalPages`. |
138
- | siblingCount | Number | 1 | No | Number of visible pages next to the active one. |
139
- | boundaryCount | Number | 1 | No | Number of always-visible starting and ending pages. |
140
- | showFirstLast | Boolean | true | No | Shows first/last page buttons. |
141
- | showPrevNext | Boolean | true | No | Shows previous/next buttons. |
142
- | showIcons | Boolean | false | No | Uses icons on navigation buttons (arrows). |
143
- | disabled | Boolean | false | No | Disables all interaction. |
144
- | ariaLabel | String | 'Pagination' | No | Accessible label for `<nav>`. |
145
- | labels | Object | `{ first:'First', prev:'Prev', next:'Next', last:'Last' }` | No | Text for navigation buttons. |
146
- | buttonProps | Object | `{}` | No | Additional props (and styles) passed to each `TvButton`. |
147
- | activeStyle | Object | `{}` | No | Inline styles for active pages (`{ backgroundColor, color }`). |
148
- | inactiveStyle | Object | `{ backgroundColor:'#ffffff', color:'#000000' }` | No | Inline styles for inactive pages. |
149
- | square | Boolean | `false` | No | Controls if buttons are square. |
150
- | size | String | `'small'` | No | Button size (`'small'`, `'md'`, `'large'`). |
151
- | showSummary | Boolean | `false` | No | Displays text showing the current range of items. |
152
- | textSummary | String | `'Showing {from} to {to} of {total} items'` | No | Template for summary text (uses `{from}`, `{to}`, `{total}`). |
153
-
154
- > Note: If `activeStyle` is empty, TvButton default styling is used. `inactiveStyle` always provides white/black fallback if omitted.
155
-
156
- ## Events
157
-
158
- | Name (kebab) | Payload | Description |
159
- |---------------------|----------|---------------------------------------------------------------------|
160
- | `update:modelValue` | `number` | Emits new page number for v-model. |
161
- | `change` | `number` | Semantic event triggered when the page changes (only if different). |
162
-
163
- Example:
164
-
165
- ```vue
166
- <TvPagination v-model="page" :total-items="300" @change="onPage" />
167
- ```
168
-
169
- ```js
170
- function onPage(newPage) {
171
- console.log('Current page:', newPage)
172
- }
173
- ```
174
-
175
- ## Slots
176
-
177
- | Slot | Exposed props | Description |
178
- |--------------|--------------------|----------------------------------------|
179
- | `page-label` | `{ page, active }` | Customize content of each page button. |
180
-
181
- Example:
182
-
183
- ```vue
184
- <TvPagination
185
- v-model="page"
186
- :total-items="100"
187
- >
188
- <template #page-label="{ page, active }">
189
- <span :style="active ? 'font-weight:600' : ''">Pg {{ page }}</span>
190
- </template>
191
- </TvPagination>
192
- ```
193
-
194
- ## Customization (Styles / Theming)
195
-
196
- Active styles with `activeStyle`:
197
-
198
- ```vue
199
- <TvPagination
200
- v-model="page"
201
- :total-items="300"
202
- :active-style="{ backgroundColor: '#10b981', color: '#ffffff' }"
203
- />
204
- ```
205
-
206
- Inactive styles:
207
-
208
- ```vue
209
- <TvPagination
210
- v-model="page"
211
- :total-items="300"
212
- :inactive-style="{ backgroundColor: '#f1f5f9', color: '#0f172a' }"
213
- />
214
- ```
215
-
216
- Passing styles / variants to base button via `buttonProps`:
217
-
218
- ```vue
219
- <TvPagination
220
- v-model="page"
221
- :total-items="120"
222
- :button-props="{ outlined: true, small: true }"
223
- />
224
- ```
225
-
226
- > All `buttonProps` values are passed to each `TvButton` instance (including variants like `success`, `outlined`, `small`, etc.).
227
-
228
- ## Accessibility
229
-
230
- * `nav` container with configurable `aria-label` (`ariaLabel`).
231
- * Active page receives `aria-current="page"`.
232
- * Ellipsis marked with `aria-hidden="true"` and are not focusable.
233
- * Disabled buttons use `disabled` attribute (inherited from `TvButton`).
234
- * If icons are used (`showIcons=true`) accessible text is preserved (or empty for icon-only). Ensure `labels.*` describe the action.
235
-
236
- ## SSR Notes
237
-
238
- * No direct DOM access → safe for server rendering.
239
- * Styles are served as a separate CSS file (`dist/tv-pagination.css`) that must be explicitly imported (see [Importing Styles](#importing-styles)).
240
- * `vue` is marked as external in the library build (tree-shake friendly).
241
- * Compatible with Nuxt 3/4 by adding the stylesheet to the `css` array in `nuxt.config.ts`.
242
-
243
- ## Development
244
-
245
- ```bash
246
- git clone https://github.com/TODOvue/tv-pagination.git
247
- cd tv-pagination
248
- npm install
249
- npm run dev # runs playground demo (Vite)
250
- npm run build # builds the library
251
- ```
252
-
253
- Build demo (uses environment variable):
254
-
255
- ```bash
256
- npm run build:demo # generates dist-demo with README in public/
257
- ```
258
-
259
- Output structure:
260
-
261
- * `dist/tv-pagination.es.js`
262
- * `dist/tv-pagination.cjs.js`
263
- * Types: `dist/tv-pagination.d.ts`
264
-
265
- ## Contribute
266
-
267
- PRs and issues are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md).
268
-
269
- ## License
270
-
271
- MIT © TODOvue
272
-
273
- ## Attributions
274
-
275
- Created for the TODOvue component ecosystem.
@@ -1,84 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `@todovue/tv-progress-bar` will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.1.1] - 2026-01-27
9
-
10
- ### Changed
11
- - Simplified the file list in `package.json` to include only essential assets.
12
- - Simplified the build configuration by removing demo-specific logic.
13
- - Enhanced GitHub Actions workflows to automate npm package publishing and GitHub release creation.
14
- - Moved the `@todovue/tv-demo` component import from main.js to `Demo.vue` to localize its usage.
15
- - Updated build commands to include `README.md` and `CHANGELOG.md` files in the public directory during the build process.
16
-
17
- ### Added
18
- - Included the `src` directory in the `package.json` files list to ensure component source files are bundled in the package distribution.
19
-
20
- ### Removed
21
- - Eliminated the global import of the `@todovue/tv-demo` component from `main.js`.
22
-
23
- ### Dependencies
24
- - Updated `@todovue/tv-demo` to `^1.4.11`.
25
- - Updated `vue` to `^3.5.27`.
26
- - Updated `sass` to `^1.97.3`.
27
-
28
- ## [1.1.0] - 2026-01-21
29
-
30
- ### Added
31
- - **Gradient Support**: New `gradient` prop (Array) to create modern, multicolor progress bars.
32
- - **Glow Effect**: New `glow` prop (Boolean) and `glowColor` (String) to add a neon-like depth effect.
33
- - **Customizable Transitions**: New `duration` and `easing` props to control the progress bar animation smoothness and feel.
34
- - New demo variants in the documentation showcasing gradients, glow effects, and custom easing functions.
35
- - - **Vertical Orientation**: New `orientation` prop to support side progress bars (left/right). Perfect for modern documentation or blogs.
36
- - **Reading Checkpoints**: New `checkpoints` prop (Array) to show indicators at specific progress points (e.g., [25, 50, 75]).
37
- - **Progress Labels**: New `showLabel` and `labelPosition` props to display the percentage inside the bar or as a floating bubble.
38
- - **Configurable Positioning**: New `position` prop to fix the bar at the `top`, `bottom`, `left`, `right`, or even use `sticky` behavior.
39
- - **Custom Width**: New `width` prop for vertical orientation (default: '4px').
40
-
41
- ### Updated
42
- - `TvProgressBar` internal styles now use dynamic transitions and backgrounds via `:style` for better flexibility.
43
- - Documentation updated with detailed prop descriptions and usage examples for new aesthetic features.
44
- - Refactored internal structure to support both horizontal and vertical layouts.
45
- - Enhanced CSS for track background and checkpoint indicators.
46
- - Added new demo variants in the documentation.
47
-
48
- ### Dependencies
49
- - Updated `@todovue/tv-demo` to `^1.4.4`.
50
- - Updated `sass` to `^1.97.2`.
51
- - Updated `vite` to `^7.3.1`.
52
-
53
- ## [1.0.0] - 2026-01-06
54
-
55
- ### Added
56
- - Initial release of TvProgressBar component
57
- - Real-time reading progress tracking based on scroll position
58
- - Flexible target selection (CSS selector, element reference, or DOM element)
59
- - Configurable `height` prop for progress bar thickness (default: '4px')
60
- - Configurable `color` prop for custom progress bar colors
61
- - `offsetTop` prop to account for fixed headers (default: 0)
62
- - `offsetBottom` prop to account for fixed footers (default: 0)
63
- - `zIndex` prop for controlling stacking order (default: 1200)
64
- - `disabled` prop to conditionally show/hide the progress bar (default: false)
65
- - Smooth linear transitions with 120ms duration
66
- - Reduced motion support via `prefers-reduced-motion` media query
67
- - SSR-safe implementation with proper window/document guards
68
- - `useProgressBar` composable for custom progress implementations
69
- - ResizeObserver support for responsive content tracking
70
- - RequestAnimationFrame optimization for smooth performance
71
- - Automatic recalculation on window scroll, resize, and load events
72
- - Template ref support for target element selection
73
- - `recalculate()` exposed method for manual progress updates
74
- - Proper cleanup of event listeners and observers on unmount
75
- - ARIA accessibility attributes (role, aria-label, aria-valuemin, aria-valuemax, aria-valuenow)
76
- - Pointer-events: none to avoid interference with page interactions
77
- - TypeScript support with type definitions
78
- - Nuxt 3/4 module support
79
- - Comprehensive documentation and usage examples
80
- - Demo playground with multiple configuration examples
81
-
82
- [1.1.1]: https://github.com/TODOvue/tv-progress-bar/pull/3/files
83
- [1.1.0]: https://github.com/TODOvue/tv-progress-bar/pull/2/files
84
- [1.0.0]: https://github.com/TODOvue/tv-progress-bar/pull/1/files