@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,357 +0,0 @@
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 Label (TvLabel)
5
- A lightweight and customizable label (chip) component for Vue 3 designed to highlight statuses,
6
- categories, or tags within your UI.
7
- Perfect for Single Page Apps or Server-Side Rendered (SSR) environments (e.g. Nuxt 3).
8
-
9
- [![npm](https://img.shields.io/npm/v/@todovue/tv-label.svg)](https://www.npmjs.com/package/@todovue/tv-label)
10
- [![npm downloads](https://img.shields.io/npm/dm/@todovue/tv-label.svg)](https://www.npmjs.com/package/@todovue/tv-label)
11
- [![npm total downloads](https://img.shields.io/npm/dt/@todovue/tv-label.svg)](https://www.npmjs.com/package/@todovue/tv-label)
12
- ![License](https://img.shields.io/github/license/TODOvue/tv-label)
13
- ![Release Date](https://img.shields.io/github/release-date/TODOvue/tv-label)
14
- ![Bundle Size](https://img.shields.io/bundlephobia/minzip/@todovue/tv-label)
15
- ![Node Version](https://img.shields.io/node/v/@todovue/tv-label)
16
- ![Last Commit](https://img.shields.io/github/last-commit/TODOvue/tv-label)
17
- ![Stars](https://img.shields.io/github/stars/TODOvue/tv-label?style=social)
18
-
19
- > Demo: https://ui.todovue.blog/label
20
-
21
- ## Table of Contents
22
- - [Features](#features)
23
- - [Installation](#installation)
24
- - [Quick Start (SPA)](#quick-start-spa)
25
- - [Styles usage](#styles-usage)
26
- - [Nuxt 4 / SSR Usage](#nuxt-4--ssr-usage)
27
- - [Component Registration Options](#component-registration-options)
28
- - [Props](#props)
29
- - [Events](#events)
30
- - [Slots](#slots)
31
- - [Customization (Styles / Theming)](#customization-styles--theming)
32
- - [Icon Usage](#icon-usage)
33
- - [Accessibility](#accessibility)
34
- - [SSR Notes](#ssr-notes)
35
- - [Development](#development)
36
- - [Changelog](#changelog)
37
- - [Contributing](#contributing)
38
- - [License](#license)
39
-
40
- ## Features
41
- - Customizable color schemes with automatic opacity handling
42
- - Optional edit and remove icons
43
- - Flexible icon positioning (left or right)
44
- - Custom text color support
45
- - Slot-based or prop-based content
46
- - Click event handling
47
- - SSR compatible (works in Nuxt 3)
48
- - Lightweight and performant
49
- - Tree-shake friendly (Vue marked external in library build)
50
-
51
- ## Installation
52
- Using npm:
53
- ```bash
54
- npm install @todovue/tv-label
55
- ```
56
- Using yarn:
57
- ```bash
58
- yarn add @todovue/tv-label
59
- ```
60
- Using pnpm:
61
- ```bash
62
- pnpm add @todovue/tv-label
63
- ```
64
-
65
- ## Quick Start (SPA)
66
- Global registration (main.js / main.ts):
67
- ```js
68
- import { createApp } from 'vue'
69
- import App from './App.vue'
70
- import '@todovue/tv-label/style.css'
71
- import { TvLabel } from '@todovue/tv-label'
72
-
73
- createApp(App)
74
- .component('TvLabel', TvLabel)
75
- .mount('#app')
76
- ```
77
-
78
- Local import inside a component:
79
- ```vue
80
- <script setup>
81
- import '@todovue/tv-label/style.css'
82
- import { TvLabel } from '@todovue/tv-label'
83
-
84
- const clickHandler = () => {
85
- console.log('Label clicked')
86
- }
87
- </script>
88
-
89
- <template>
90
- <TvLabel @click-label="clickHandler" color="#4FC08D">
91
- Vue
92
- </TvLabel>
93
- </template>
94
- ```
95
-
96
- ## Styles usage
97
-
98
- ### Vue 4 / Vite (SPA)
99
-
100
- ```ts
101
- // main.ts
102
- import { createApp } from 'vue'
103
- import App from './App.vue'
104
-
105
- import '@todovue/tv-label/style.css'
106
- import { TvLabel } from '@todovue/tv-label'
107
-
108
- const app = createApp(App)
109
- app.component('TvLabel', TvLabel)
110
- app.mount('#app')
111
- ```
112
-
113
- ### Nuxt 3 / 4
114
-
115
- ```ts
116
- // nuxt.config.ts
117
- export default defineNuxtConfig({
118
- modules: [
119
- '@todovue/tv-label/nuxt'
120
- ]
121
- })
122
- ```
123
-
124
- ## Nuxt 4 / SSR Usage
125
- Create a plugin file: `plugins/tv-label.client.ts` (client-only is fine, or without suffix for SSR as it is safe):
126
- ```ts
127
- import { defineNuxtPlugin } from '#app'
128
- import TvLabel from '@todovue/tv-label'
129
-
130
- export default defineNuxtPlugin(nuxtApp => {
131
- nuxtApp.vueApp.use(TvLabel)
132
- })
133
- ```
134
-
135
- Use anywhere in your Nuxt app:
136
- ```vue
137
- <template>
138
- <TvLabel color="#42b883" :isEdit="true">
139
- Editable Label
140
- </TvLabel>
141
- </template>
142
- ```
143
-
144
- Optional direct import (no plugin):
145
- ```vue
146
- <script setup>
147
- import { TvLabel } from '@todovue/tv-label'
148
- </script>
149
-
150
- <template>
151
- <TvLabel color="#ff6b6b" :isRemove="true">
152
- Removable Tag
153
- </TvLabel>
154
- </template>
155
- ```
156
-
157
- ## Component Registration Options
158
- | Approach | When to use |
159
- |-----------------------------------------------------------------|------------------------------------------------|
160
- | Global via `app.use(TvLabel)` | Many usages across app / design system install |
161
- | Global via `app.use(TvLabelPlugin)` | Alternative plugin syntax |
162
- | Local named import `{ TvLabel }` | Isolated / code-split contexts |
163
- | Direct default import `import TvLabel from '@todovue/tv-label'` | Single usage or manual registration |
164
-
165
- ## Props
166
- | Prop | Type | Default | Description |
167
- |--------------|---------|-------------|-----------------------------------------------------------------------------------------|
168
- | color | String | `''` | Label background color in hexadecimal (e.g., `#4FC08D`). Automatically applies opacity. |
169
- | textLabel | String | `''` | Text content for the label (alternative to using the default slot). |
170
- | textColor | String | `'inherit'` | Text color for the label content. |
171
- | isEdit | Boolean | `false` | Show edit icon inside the label. |
172
- | isRemove | Boolean | `false` | Show remove icon inside the label. |
173
- | isOutline | Boolean | `false` | Applies a rounded pill shape and a solid border matching the label color. |
174
- | iconPosition | String | `'right'` | Position of icons relative to text: `'left'` or `'right'`. |
175
- | size | String | `'md'` | Size of the label: `'sm'` (small), `'md'` (medium), or `'lg'` (large). |
176
-
177
- ## Events
178
- | Event name (kebab) | Emits (camel) | Description |
179
- |--------------------|---------------|------------------------------------------------------------|
180
- | `click-label` | `clickLabel` | Custom semantic click event emitted when label is clicked. |
181
- | `click` | `click` | Native click event (also emitted). |
182
-
183
- Usage examples:
184
- ```vue
185
- <template>
186
- <!-- Using custom event -->
187
- <TvLabel @click-label="handleLabelClick" color="#3498db">
188
- Click me
189
- </TvLabel>
190
-
191
- <!-- Using native click event -->
192
- <TvLabel @click="handleClick" color="#e74c3c">
193
- Native click
194
- </TvLabel>
195
-
196
- <!-- Both events work simultaneously -->
197
- <TvLabel
198
- @click-label="handleCustom"
199
- @click="handleNative"
200
- color="#9b59b6"
201
- >
202
- Dual events
203
- </TvLabel>
204
- </template>
205
-
206
- <script setup>
207
- const handleLabelClick = () => {
208
- console.log('Custom click-label event')
209
- }
210
-
211
- const handleClick = () => {
212
- console.log('Native click event')
213
- }
214
-
215
- const handleCustom = () => {
216
- console.log('Custom handler')
217
- }
218
-
219
- const handleNative = () => {
220
- console.log('Native handler')
221
- }
222
- </script>
223
- ```
224
-
225
- ## Slots
226
- | Slot name | Description |
227
- |-----------|------------------------------------------------------------------------------|
228
- | default | Main content slot for label text. If not provided, `textLabel` prop is used. |
229
-
230
- Example:
231
- ```vue
232
- <template>
233
- <!-- Using slot -->
234
- <TvLabel color="#4FC08D">
235
- <strong>Vue 3</strong> Framework
236
- </TvLabel>
237
-
238
- <!-- Using textLabel prop -->
239
- <TvLabel color="#4FC08D" textLabel="Vue 3 Framework" />
240
- </template>
241
- ```
242
-
243
- ## Customization (Styles / Theming)
244
- The component automatically handles color opacity and border styling based on the `color` prop:
245
-
246
- ```vue
247
- <template>
248
- <!-- Green label -->
249
- <TvLabel color="#4FC08D">Success</TvLabel>
250
-
251
- <!-- Red label with custom text color -->
252
- <TvLabel color="#f56565" textColor="#ffffff">Error</TvLabel>
253
-
254
- <!-- Blue label with white text -->
255
- <TvLabel color="#3182ce" textColor="#fff">Info</TvLabel>
256
-
257
- <!-- Custom brand color -->
258
- <TvLabel color="#6366f1" textColor="#e0e7ff">Brand</TvLabel>
259
- </template>
260
- ```
261
-
262
- The component applies:
263
- - Background color with automatic opacity (lighter shade)
264
- - 2px solid border using the full color
265
- - Customizable text color via `textColor` prop
266
-
267
- ## Icon Usage
268
- Display edit or remove icons within your labels:
269
-
270
- ```vue
271
- <template>
272
- <!-- Edit icon on the right (default) -->
273
- <TvLabel color="#4FC08D" :isEdit="true">
274
- Editable
275
- </TvLabel>
276
-
277
- <!-- Remove icon on the right -->
278
- <TvLabel color="#f56565" :isRemove="true">
279
- Removable
280
- </TvLabel>
281
-
282
- <!-- Edit icon on the left -->
283
- <TvLabel color="#3182ce" :isEdit="true" iconPosition="left">
284
- Edit Left
285
- </TvLabel>
286
-
287
- <!-- Remove icon on the left -->
288
- <TvLabel color="#9f7aea" :isRemove="true" iconPosition="left">
289
- Remove Left
290
- </TvLabel>
291
-
292
- <!-- With click handler -->
293
- <TvLabel
294
- color="#ed8936"
295
- :isEdit="true"
296
- @click-label="handleEdit"
297
- >
298
- Click to Edit
299
- </TvLabel>
300
- </template>
301
-
302
- <script setup>
303
- const handleEdit = () => {
304
- console.log('Edit action triggered')
305
- }
306
- </script>
307
- ```
308
-
309
- ## Accessibility
310
- - **Semantic HTML**: The component uses a `<div>` with click handlers. For better accessibility, consider wrapping in a `<button>` if it represents an interactive action.
311
- - **Color contrast**: Ensure sufficient contrast between `color` and `textColor` for readability.
312
- - **Interactive labels**: When using `isEdit` or `isRemove`, consider adding ARIA attributes or wrapping in semantic elements.
313
-
314
- Best practices:
315
- ```vue
316
- <template>
317
- <!-- For non-interactive labels (display only) -->
318
- <TvLabel color="#4FC08D">Status: Active</TvLabel>
319
-
320
- <!-- For interactive labels, consider adding role or wrapping -->
321
- <div role="button" tabindex="0" @keydown.enter="handleAction">
322
- <TvLabel color="#3182ce" :isEdit="true" @click-label="handleAction">
323
- Edit me
324
- </TvLabel>
325
- </div>
326
- </template>
327
- ```
328
-
329
- ## SSR Notes
330
- - **SSR Compatible**: No direct DOM (`window` / `document`) access → safe for server-side rendering.
331
- - **Nuxt 3 Ready**: Works seamlessly in Nuxt 3 applications.
332
- - **Styles**: Component styles are scoped and work correctly in SSR environments.
333
- - **Icons**: SVG icons are embedded inline, ensuring they render correctly on the server.
334
-
335
- ## Development
336
- Clone the repository and install dependencies:
337
- ```bash
338
- git clone https://github.com/TODOvue/tv-label.git
339
- cd tv-label
340
- yarn install
341
- yarn dev # run demo playground
342
- yarn build # build library
343
- ```
344
-
345
- The demo is served from Vite using `index.html` and includes various usage examples.
346
-
347
- ## Changelog
348
- See [CHANGELOG.md](https://github.com/TODOvue/tv-label/blob/main/CHANGELOG.md) for version history and updates.
349
-
350
- ## Contributing
351
- Contributions are welcome! Please read our [Contributing Guidelines](https://github.com/TODOvue/tv-label/blob/main/CONTRIBUTING.md) and [Code of Conduct](https://github.com/TODOvue/tv-label/blob/main/CODE_OF_CONDUCT.md).
352
-
353
- ## License
354
- [MIT](https://github.com/TODOvue/tv-label/blob/main/LICENSE) © TODOvue
355
-
356
- ### Attributions
357
- Crafted for the TODOvue component ecosystem
@@ -1,145 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `@todovue/tv-menu` 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.4] - 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 `@todovue/tv-search` to `^1.2.1`.
26
- - Updated `vue` to `^3.5.27`.
27
- - Updated `sass` to `^1.97.3`.
28
-
29
- ## [1.1.3] - 2026-01-20
30
-
31
- ### Added
32
- - Introduced the `noResultsText` property to allow for customizable feedback when search queries return no matches.
33
- - Added `activeMenu` prop to highlight the active menu item.
34
- - Added slots: `#logo`, `#item`, and `#action-end` for greater customization.
35
- - Added `update:activeMenu` event for v-model support.
36
-
37
- ### Dependencies
38
- - Updated `@todovue/tv-demo` to `^1.4.4`.
39
- - Updated `sass` to `^1.97.2`.
40
- - Updated `vite` to `^7.3.1`.
41
-
42
- ## [1.1.2] - 2025-12-27
43
-
44
- ### Added
45
- - Added automatic publishing to the TODOvue cPanel in `release.yml` for each release, simplifying package distribution and updates.
46
- - Added `package-lock.json` to the repository to ensure dependency consistency and facilitate version management across development and production environments.
47
-
48
- ### Changed
49
- - Changed the `base` option in `vite.config.js` for website deployment in cpanel.
50
-
51
- ### Fixed
52
- - Fixed repository URL in `package.json` to point to the correct GitHub repository.
53
- - Fixed the token configuration used to generate the package in the GitHub Actions workflow `release.yml`.
54
-
55
- ### Dependencies
56
- - Updated dependency versions in `package.json` to maintain compatibility and benefit from improvements and bug fixes in the used libraries.
57
-
58
- ## [1.1.1] - 2025-11-24
59
-
60
- ### Changed
61
- - Updated background and text colors for dark and light themes to improve readability and visual comfort.
62
-
63
- ### Dependencies
64
- - Updated the `@todovue/tv-demo` dev dependency to `^1.2.2` to ensure compatibility with the latest changes.
65
- - Updated the `@todovue/tv-search` dependency to `^1.1.1` to ensure compatibility with the latest changes
66
-
67
- ## [1.1.0] - 2025-11-21
68
-
69
- ### Added
70
- - Added `nux.js` configuration file for Nuxt 4 integration.
71
- - Added `tsconfig.json` for proper type checking during build.
72
- - Create `global.d.ts` to declare module for TypeScript users.
73
- - Added Nuxt module for automatic style injection and auto-registration of the `TvMenu` component.
74
- - The `@todovue/tv-menu` component is now externalized from the final build, reducing bundle size.
75
- - Added `CHANGELOG.md` in script to generate demo and documentation site.
76
-
77
- ### Dependencies
78
- - Updated the `@todovue/tv-demo` dependency to `^1.2.1` to ensure compatibility with the latest changes.
79
- - Updated the `@todovue/tv-search` dependency to `^1.1.0` to ensure compatibility with the latest changes.
80
-
81
- ## [1.0.3] - 2025-11-15
82
-
83
- ### Changed
84
- - Styles are now served as a separate CSS file (`dist/tv-menu.css`) generated by Vite during the build process.
85
- - Users must now explicitly import the stylesheet in their application:
86
- - For Vue/Vite SPA: `import '@todovue/tv-menu/style.css'` in `main.ts`
87
- - For Nuxt 3/4: Add `'@todovue/tv-menu/style.css'` to the `css` array in `nuxt.config.ts`
88
-
89
- ### Added
90
- - Added `sideEffects` field to `package.json` to support proper tree-shaking with CSS files.
91
- - Added `./style.css` export path in `package.json` for explicit CSS imports.
92
- - Improved SSR/SSG compatibility, especially for Nuxt 3/4 applications.
93
-
94
- ### Dependencies
95
- - Removed dependency on `vite-plugin-css-injected-by-js` from `devDependencies`
96
-
97
- ## [1.0.2] - 2025-11-13
98
-
99
- ### Fixed
100
- - The emit event is fixed to send the selected object and not the input.
101
-
102
- ## [1.0.1] - 2025-11-13
103
-
104
- ### Fixed
105
- - Fixed search results display in TvSearch component.
106
-
107
- ### Changed
108
- - Corrected demo application routes.
109
-
110
- ## [1.0.0] - 2025-10-20
111
-
112
- ### Added
113
- - Initial release of TvMenu component
114
- - Responsive navigation menu with desktop and mobile views
115
- - Integrated search functionality using `@todovue/tv-search` component
116
- - Logo/image support with click event handling (`@clickImage`)
117
- - Menu items array support with configurable structure (`id`, `title`, `url`)
118
- - Menu item click events with data payload (`@clickMenu`)
119
- - Search event emission for custom search implementations (`@searchMenu`)
120
- - Automatic mobile menu toggle with hamburger icon
121
- - Mobile overlay menu with slide-in animation
122
- - Props for customization:
123
- - `menus`: Array of menu items
124
- - `placeholder`: Search input placeholder
125
- - `titleButton`: Search button label
126
- - `imageMenu`: Logo/image URL
127
- - Composable `useMenu` for menu state and event management
128
- - SCSS styling with modular architecture (_variables, _mixins, _global)
129
- - Icon assets (menu and cancel icons)
130
- - SSR (Server-Side Rendering) compatibility
131
- - Nuxt 3 support
132
- - Tree-shakeable ES and CommonJS module exports
133
- - TypeScript declarations generation
134
- - Vite build configuration with CSS injection
135
- - Demo playground with example implementations
136
-
137
- [1.1.4]: https://github.com/TODOvue/tv-menu/pull/9/files
138
- [1.1.3]: https://github.com/TODOvue/tv-menu/pull/8/files
139
- [1.1.2]: https://github.com/TODOvue/tv-menu/pull/7/files
140
- [1.1.1]: https://github.com/TODOvue/tv-menu/pull/6/files
141
- [1.1.0]: https://github.com/TODOvue/tv-menu/pull/5/files
142
- [1.0.3]: https://github.com/TODOvue/tv-menu/pull/4/files
143
- [1.0.2]: https://github.com/TODOvue/tv-menu/pull/3/files
144
- [1.0.1]: https://github.com/TODOvue/tv-menu/pull/2/files
145
- [1.0.0]: https://github.com/TODOvue/tv-menu/pull/1/files