tinywidgets 1.1.1 → 1.1.3
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/README.md +29 -0
- package/bun.lockb +0 -0
- package/package.json +13 -13
- package/src/components/Code/index.tsx +1 -1
- package/src/components/TasksProvider/index.tsx +27 -2
package/README.md
CHANGED
|
@@ -15,6 +15,35 @@ TinyWidgets uses [React](https://react.dev/) for DOM manipulation, [Vanilla-Extr
|
|
|
15
15
|
|
|
16
16
|
But, just to be clear - that doesn't mean you need to use Vanilla-Extract, Lucide, or Tinybase in the apps you build with these widgets. You can set arbitrary class names (from Tailwind, for example!) on all components if you like.
|
|
17
17
|
|
|
18
|
+
## Meet the family
|
|
19
|
+
|
|
20
|
+
TinyTick is part of a group of small libraries designed to help make rich client and local-first apps easier to build. Check out the others!
|
|
21
|
+
|
|
22
|
+
<p>
|
|
23
|
+
<a href='https://tinybase.org' target='_blank'>
|
|
24
|
+
<img width="48" src="https://tinybase.org/favicon.svg" />
|
|
25
|
+
<br/>
|
|
26
|
+
<b>TinyBase</b>
|
|
27
|
+
</a>
|
|
28
|
+
<br />The reactive data store for local-first apps.<br />
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
<p>
|
|
32
|
+
<img width="48" src="https://tinywidgets.org/favicon.svg" />
|
|
33
|
+
<br/>
|
|
34
|
+
<b>TinyWidgets</b>
|
|
35
|
+
<br />A collection of tiny, reusable, UI components.<br />
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
<p>
|
|
39
|
+
<a href='https://tinytick.org' target='_blank'>
|
|
40
|
+
<img width="48" src="https://tinytick.org/favicon.svg" />
|
|
41
|
+
<br />
|
|
42
|
+
<b>TinyTick</b>
|
|
43
|
+
</a>
|
|
44
|
+
<br />A tiny but very useful task orchestrator.<br />
|
|
45
|
+
</p>
|
|
46
|
+
|
|
18
47
|
## Help out!
|
|
19
48
|
|
|
20
49
|
This project was created because [I](https://github.com/jamesgpearce) want to be able to build lots of local-first apps quickly and without the overhead of all the app boilerplate each time.
|
package/bun.lockb
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinywidgets",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinywidgets",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,26 +21,26 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/react": "^18.3.11",
|
|
23
23
|
"@types/react-dom": "^18.3.0",
|
|
24
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
25
|
-
"@typescript-eslint/parser": "^8.
|
|
26
|
-
"cspell": "^8.
|
|
24
|
+
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
25
|
+
"@typescript-eslint/parser": "^8.26.1",
|
|
26
|
+
"cspell": "^8.17.5",
|
|
27
27
|
"eslint": "^8.57.0",
|
|
28
|
-
"eslint-config-prettier": "^
|
|
29
|
-
"eslint-plugin-react": "^7.37.
|
|
30
|
-
"eslint-plugin-react-hooks": "^5.
|
|
31
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
32
|
-
"prettier": "^3.
|
|
33
|
-
"typescript": "^5.
|
|
28
|
+
"eslint-config-prettier": "^10.1.1",
|
|
29
|
+
"eslint-plugin-react": "^7.37.4",
|
|
30
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
31
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
32
|
+
"prettier": "^3.5.3",
|
|
33
|
+
"typescript": "^5.8.2"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
|
36
36
|
".": "./src/index.ts",
|
|
37
37
|
"./css": "./src/index.css.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@vanilla-extract/css": "^1.
|
|
41
|
-
"lucide-react": "^0.
|
|
40
|
+
"@vanilla-extract/css": "^1.17.1",
|
|
41
|
+
"lucide-react": "^0.479.0",
|
|
42
42
|
"react": "^18.3.1",
|
|
43
43
|
"react-dom": "^18.3.1",
|
|
44
|
-
"tinybase": "^5.4.
|
|
44
|
+
"tinybase": "^5.4.8"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -120,8 +120,8 @@ const TaskRunner = ({
|
|
|
120
120
|
*
|
|
121
121
|
* - `taskId`: a required string to identify the task by Id.
|
|
122
122
|
* - `arg`: an optional string that will be passed to the task when run.
|
|
123
|
-
* - `storeId`: an optional string that will be used to look up a Store by Id
|
|
124
|
-
*
|
|
123
|
+
* - `storeId`: an optional string that will be used to look up a Store by Id in
|
|
124
|
+
* the current TinyBase Provider context and be passed to the task.
|
|
125
125
|
*
|
|
126
126
|
* @example
|
|
127
127
|
* ```tsx
|
|
@@ -163,6 +163,31 @@ const TaskRunner = ({
|
|
|
163
163
|
* ```
|
|
164
164
|
* This example shows the hook returning a function that will schedule a task to
|
|
165
165
|
* be run by the provider. That task in turn will call another.
|
|
166
|
+
* @example
|
|
167
|
+
* ```tsx
|
|
168
|
+
* const TaskButton3 = () => {
|
|
169
|
+
* const scheduleTask = useScheduleTask();
|
|
170
|
+
* return (<Button
|
|
171
|
+
* title="JSON"
|
|
172
|
+
* onClick={() => scheduleTask('json', '', 'store1')}
|
|
173
|
+
* />);
|
|
174
|
+
* };
|
|
175
|
+
* // ...
|
|
176
|
+
* <Provider storesById={{
|
|
177
|
+
* store1: useCreateStore(() =>
|
|
178
|
+
* createStore().setCell('pets', 'fido', 'species', 'dog')),
|
|
179
|
+
* }}>
|
|
180
|
+
* <TasksProvider tasks={{
|
|
181
|
+
* json: (_arg: string, store: Store | undefined) =>
|
|
182
|
+
* alert(store?.getJson()),
|
|
183
|
+
* }}>
|
|
184
|
+
* <TaskButton3 />
|
|
185
|
+
* </TasksProvider>
|
|
186
|
+
* </Provider>
|
|
187
|
+
* ```
|
|
188
|
+
* This example shows the hook returning a function that will schedule a task to
|
|
189
|
+
* be run by the provider, using a Store from the current context, specified by
|
|
190
|
+
* Id.
|
|
166
191
|
*/
|
|
167
192
|
export const useScheduleTask = () => useContext(Context);
|
|
168
193
|
|