@todovue/tv-search 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Cristhian Daza
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,190 @@
1
+ <p align="center"><img width="150" src="https://firebasestorage.googleapis.com/v0/b/todovue-blog.appspot.com/o/logo.png?alt=media&token=d8eb592f-e4a9-4b02-8aff-62d337745f41" alt="TODOvue logo">
2
+ </p>
3
+
4
+ # TODOvue Search
5
+ ###### TvSearch provides a fast, accessible, and fully customizable search interface for Vue 3 apps.
6
+
7
+ [![npm](https://img.shields.io/npm/v/@todovue/tv-search.svg)](https://www.npmjs.com/package/@todovue/tv-search) [![Netlify Status](https://api.netlify.com/api/v1/badges/c6992bf1-ed06-4d9b-8b77-752254880951/deploy-status)](https://app.netlify.com/sites/tv-search/deploys) [![npm](https://img.shields.io/npm/dm/@todovue/tv-search.svg)](https://www.npmjs.com/package/@todovue/tv-search) [![npm](https://img.shields.io/npm/dt/@todovue/tv-search.svg)](https://www.npmjs.com/package/@todovue/tv-search) ![GitHub](https://img.shields.io/github/license/TODOvue/tv-search) ![GitHub Release Date](https://img.shields.io/github/release-date/TODOvue/tv-search)
8
+
9
+ ## Table of Contents
10
+ - [Demo](https://tv-search.netlify.app/)
11
+ - [Installation](#installation)
12
+ - [Usage](#usage)
13
+ - [Props](#props)
14
+ - [Events](#events)
15
+ - [Customize](#customize)
16
+ - [Development](#development)
17
+ - [Changelog](https://github.com/TODOvue/tv-search/blob/main/CHANGELOG.md)
18
+ - [Contributing](https://github.com/TODOvue/tv-search/blob/main/CONTRIBUTING.md)
19
+ - [License](https://github.com/TODOvue/tv-search/search/main/LICENSE)
20
+
21
+ ## Installation
22
+ Install with npm or yarn
23
+ ```bash
24
+ npm install @todovue/tv-search
25
+ ```
26
+ ```bash
27
+ yarn add @todovue/tv-search
28
+ ```
29
+ Import
30
+ ```js
31
+ import TvSearch from '@todovue/tv-search'
32
+ ```
33
+
34
+ You can also import it directly in the **main.js** file, so you don't have to import it in the pages
35
+ ```js
36
+ import { createApp } from "vue";
37
+ import App from "./App.vue";
38
+ import TvSearch from '@todovue/tv-search'
39
+
40
+ const app = createApp(App);
41
+ app.component("TvSearch", TvSearch);
42
+ app.mount("#app");
43
+ ```
44
+ ---
45
+ ## Usage
46
+ You can open the search component with `Ctrl + k` or `Command + k`
47
+ ```js
48
+ <template>
49
+ <tv-search
50
+ placeholder="Search blog..."
51
+ titleButton="Search"
52
+ :results="results"
53
+ />
54
+ </template>
55
+
56
+ <script setup>
57
+ import { ref } from 'vue';
58
+ import TvSearch from '@todovue/tv-search';
59
+
60
+ const results = ref([
61
+ {
62
+ id: 1,
63
+ title: 'How to use Vue 3',
64
+ description: 'Vue 3 is the latest version of Vue.js',
65
+ url: 'https://todovue.com/blog/how-to-use-vue-3',
66
+ },
67
+ {
68
+ id: 2,
69
+ title: 'How to use Vite',
70
+ description: 'Vite is a build tool for modern web development',
71
+ url: 'https://todovue.com/blog/how-to-use-vite',
72
+ },
73
+ {
74
+ id: 3,
75
+ title: 'How to use Pinia',
76
+ description: 'Pinia is a modern store for Vue 3',
77
+ url: 'https://todovue.com/blog/how-to-use-pinia',
78
+ },
79
+ {
80
+ id: 4,
81
+ title: 'How to use Windi CSS',
82
+ description: 'Windi CSS is a utility-first CSS framework',
83
+ url: 'https://todovue.com/blog/how-to-use-windi-css',
84
+ },
85
+ {
86
+ id: 5,
87
+ title: 'How to use Vitesse',
88
+ description: 'Vitesse is a Vue 3 starter template',
89
+ url: 'https://todovue.com/blog/how-to-use-vitesse',
90
+ }
91
+ ]);
92
+ </script>
93
+ ```
94
+ ---
95
+ ## Props
96
+ | Name | Type | Default | Description | Required |
97
+ |--------------|--------|----------------------------|-------------------|----------|
98
+ | placeHolder | String | `""` | Placeholder input | `true` |
99
+ | titleButton | String | `""` | Title button | `true` |
100
+ | results | Array | `[]` | Array of results | `true` |
101
+ | customStyles | Object | [See below](#customStyles) | Custom styles | `false` |
102
+
103
+ ### customStyles
104
+ | Name | Type | Default | Description |
105
+ |-------------|--------|-------------|-------------------------|
106
+ | bgBody | String | `"#0E131F"` | Background color body |
107
+ | bgInput | String | `"#B9C4DF"` | Background color input |
108
+ | bgButton | String | `"#Ef233C"` | Background color button |
109
+ | colorButton | String | `"#F4FAFF"` | Color button |
110
+ ---
111
+ ## Events
112
+ | Name | Description |
113
+ |--------|-----------------------------------|
114
+ | search | Event when the search is executed |
115
+
116
+ ## Customize
117
+ You can customize the component by customStyles, you can see the [props](#props) section to see the available options
118
+ ```js
119
+ const customStyles = {
120
+ bgBody: "#0A4539",
121
+ bgInput: "#284780",
122
+ bgButton: "#80286E",
123
+ colorButton: "#D5B7B7",
124
+ };
125
+ ```
126
+ ```js
127
+ <template>
128
+ <tv-search
129
+ placeholder="Search blog..."
130
+ titleButton="Search"
131
+ :results="results"
132
+ :customStyles="customStyles"
133
+ />
134
+ </template>
135
+
136
+ <script setup>
137
+ import { ref } from 'vue';
138
+ import TvSearch from '@todovue/tv-search';
139
+
140
+ const customStyles = ref({
141
+ bgBody: "#0A4539",
142
+ bgInput: "#284780",
143
+ bgButton: "#80286E",
144
+ colorButton: "#D5B7B7",
145
+ });
146
+
147
+ const results = ref([
148
+ {
149
+ id: 1,
150
+ title: 'Blog - How to use Vue 3',
151
+ description: 'Vue 3 is the latest version of Vue.js',
152
+ url: 'https://todovue.com/blog/how-to-use-vue-3',
153
+ },
154
+ {
155
+ id: 2,
156
+ title: 'Blog - How to use Vite',
157
+ description: 'Vite is a build tool for modern web development',
158
+ url: 'https://todovue.com/blog/how-to-use-vite',
159
+ },
160
+ {
161
+ id: 3,
162
+ title: 'Blog - How to use Pinia',
163
+ description: 'Pinia is a modern store for Vue 3',
164
+ url: 'https://todovue.com/blog/how-to-use-pinia',
165
+ },
166
+ {
167
+ id: 4,
168
+ title: 'Blog - How to use Windi CSS',
169
+ description: 'Windi CSS is a utility-first CSS framework',
170
+ url: 'https://todovue.com/blog/how-to-use-windi-css',
171
+ },
172
+ {
173
+ id: 5,
174
+ title: 'Blog - How to use Vitesse',
175
+ description: 'Vitesse is a Vue 3 starter template',
176
+ url: 'https://todovue.com/blog/how-to-use-vitesse',
177
+ }
178
+ ]);
179
+ </script>
180
+ ```
181
+ ## Development
182
+ Clone the repository and install the dependencies
183
+ ```bash
184
+ git clone https://github.com/TODOvue/tv-search.git
185
+ cd tv-search
186
+ yarn install
187
+ ```
188
+ ---
189
+ ## License
190
+ [MIT](https://github.com/TODOvue/tv-search/blob/main/LICENSE)
Binary file