@vertz/ui 0.2.32 → 0.2.33

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 (2) hide show
  1. package/README.md +81 -85
  2. package/package.json +17 -17
package/README.md CHANGED
@@ -160,9 +160,7 @@ import { query } from '@vertz/ui';
160
160
  function UserProfile() {
161
161
  let userId = 1;
162
162
 
163
- const { data, loading } = query(() =>
164
- fetch(`/api/users/${userId}`).then((r) => r.json())
165
- );
163
+ const { data, loading } = query(() => fetch(`/api/users/${userId}`).then((r) => r.json()));
166
164
 
167
165
  return (
168
166
  <div>
@@ -316,10 +314,12 @@ const createUser = Object.assign(
316
314
  const res = await fetch('/api/users', { method: 'POST', body: JSON.stringify(body) });
317
315
  return res.json() as Promise<{ id: string }>;
318
316
  },
319
- { url: '/api/users', method: 'POST' }
317
+ { url: '/api/users', method: 'POST' },
320
318
  );
321
319
 
322
- const userSchema = { /* validation schema */ };
320
+ const userSchema = {
321
+ /* validation schema */
322
+ };
323
323
 
324
324
  function CreateUser() {
325
325
  const f = form(createUser, {
@@ -442,9 +442,7 @@ function ProjectToolbar() {
442
442
  <div>
443
443
  {deleteCheck.allowed && <button onClick={handleDelete}>Delete</button>}
444
444
  {deleteCheck.reason === 'plan_required' && <span>Upgrade to unlock</span>}
445
- {deleteCheck.meta?.limit && (
446
- <span>{deleteCheck.meta.limit.remaining} uses left</span>
447
- )}
445
+ {deleteCheck.meta?.limit && <span>{deleteCheck.meta.limit.remaining} uses left</span>}
448
446
  </div>
449
447
  );
450
448
  }
@@ -471,9 +469,7 @@ function App() {
471
469
 
472
470
  return (
473
471
  <AccessContext.Provider value={accessValue}>
474
- <AccessGate fallback={() => <Spinner />}>
475
- {() => <Router />}
476
- </AccessGate>
472
+ <AccessGate fallback={() => <Spinner />}>{() => <Router />}</AccessGate>
477
473
  </AccessContext.Provider>
478
474
  );
479
475
  }
@@ -497,7 +493,7 @@ function Logger() {
497
493
 
498
494
  watch(
499
495
  () => count,
500
- (value) => console.log('count changed to', value)
496
+ (value) => console.log('count changed to', value),
501
497
  );
502
498
 
503
499
  return <button onClick={() => count++}>Increment</button>;
@@ -545,23 +541,23 @@ unmount();
545
541
 
546
542
  ### Query Helpers
547
543
 
548
- | Export | Description |
549
- |---|---|
550
- | `findByTestId(id)` | Find element by `data-testid` — throws if not found |
551
- | `findByText(text)` | Find element by text content — throws if not found |
552
- | `queryByTestId(id)` | Find element by `data-testid` — returns `null` if not found |
553
- | `queryByText(text)` | Find element by text content — returns `null` if not found |
554
- | `waitFor(fn, options?)` | Retry an assertion until it passes |
544
+ | Export | Description |
545
+ | ----------------------- | ----------------------------------------------------------- |
546
+ | `findByTestId(id)` | Find element by `data-testid` — throws if not found |
547
+ | `findByText(text)` | Find element by text content — throws if not found |
548
+ | `queryByTestId(id)` | Find element by `data-testid` — returns `null` if not found |
549
+ | `queryByText(text)` | Find element by text content — returns `null` if not found |
550
+ | `waitFor(fn, options?)` | Retry an assertion until it passes |
555
551
 
556
552
  ### Interaction Helpers
557
553
 
558
- | Export | Description |
559
- |---|---|
560
- | `click(el)` | Simulate a click event |
561
- | `type(el, text)` | Simulate typing into an input |
562
- | `press(key)` | Simulate a key press |
563
- | `fillForm(form, values)` | Fill multiple form fields |
564
- | `submitForm(form)` | Submit a form |
554
+ | Export | Description |
555
+ | ------------------------ | ----------------------------- |
556
+ | `click(el)` | Simulate a click event |
557
+ | `type(el, text)` | Simulate typing into an input |
558
+ | `press(key)` | Simulate a key press |
559
+ | `fillForm(form, values)` | Fill multiple form fields |
560
+ | `submitForm(form)` | Submit a form |
565
561
 
566
562
  ### Route Testing
567
563
 
@@ -573,7 +569,7 @@ const { component, router, navigate } = await createTestRouter(
573
569
  '/': { component: () => <Home /> },
574
570
  '/about': { component: () => <About /> },
575
571
  },
576
- { initialPath: '/' }
572
+ { initialPath: '/' },
577
573
  );
578
574
 
579
575
  await navigate('/about');
@@ -638,93 +634,93 @@ onMount(() => {
638
634
 
639
635
  ### Lifecycle
640
636
 
641
- | Export | Description |
642
- |---|---|
637
+ | Export | Description |
638
+ | --------- | --------------------------------------------------------------------- |
643
639
  | `onMount` | Run code once when a component mounts (return a function for cleanup) |
644
- | `watch` | Watch a dependency and run a callback on change |
640
+ | `watch` | Watch a dependency and run a callback on change |
645
641
 
646
642
  ### Components
647
643
 
648
- | Export | Description |
649
- |---|---|
644
+ | Export | Description |
645
+ | --------------- | ----------------------------------------- |
650
646
  | `createContext` | Create a context for dependency injection |
651
- | `useContext` | Read a context value |
652
- | `children` | Access resolved children |
653
- | `ref` | Create a ref for DOM element access |
654
- | `ErrorBoundary` | Catch errors in a component tree |
655
- | `Suspense` | Show fallback while async content loads |
647
+ | `useContext` | Read a context value |
648
+ | `children` | Access resolved children |
649
+ | `ref` | Create a ref for DOM element access |
650
+ | `ErrorBoundary` | Catch errors in a component tree |
651
+ | `Suspense` | Show fallback while async content loads |
656
652
 
657
653
  ### Mounting
658
654
 
659
- | Export | Description |
660
- |---|---|
655
+ | Export | Description |
656
+ | ------- | ----------------------------- |
661
657
  | `mount` | Mount an app to a DOM element |
662
658
 
663
659
  ### CSS (`@vertz/ui/css`)
664
660
 
665
- | Export | Description |
666
- |---|---|
667
- | `css` | Create scoped styles |
668
- | `variants` | Create typed variant styles |
669
- | `s` | Inline dynamic styles |
670
- | `defineTheme` | Define a theme |
671
- | `compileTheme` | Compile a theme to CSS |
672
- | `ThemeProvider` | Provide a theme to descendants |
673
- | `globalCss` | Inject global CSS |
674
- | `font` | Declare a font family descriptor |
675
- | `compileFonts` | Compile font descriptors into CSS, vars, and preload tags |
661
+ | Export | Description |
662
+ | --------------- | --------------------------------------------------------- |
663
+ | `css` | Create scoped styles |
664
+ | `variants` | Create typed variant styles |
665
+ | `s` | Inline dynamic styles |
666
+ | `defineTheme` | Define a theme |
667
+ | `compileTheme` | Compile a theme to CSS |
668
+ | `ThemeProvider` | Provide a theme to descendants |
669
+ | `globalCss` | Inject global CSS |
670
+ | `font` | Declare a font family descriptor |
671
+ | `compileFonts` | Compile font descriptors into CSS, vars, and preload tags |
676
672
 
677
673
  ### Forms
678
674
 
679
- | Export | Description |
680
- |---|---|
681
- | `form` | Create a form bound to an SDK method |
682
- | `formDataToObject` | Convert FormData to a plain object |
683
- | `validate` | Run schema validation |
675
+ | Export | Description |
676
+ | ------------------ | ------------------------------------ |
677
+ | `form` | Create a form bound to an SDK method |
678
+ | `formDataToObject` | Convert FormData to a plain object |
679
+ | `validate` | Run schema validation |
684
680
 
685
681
  ### Data
686
682
 
687
- | Export | Description |
688
- |---|---|
683
+ | Export | Description |
684
+ | ------- | ---------------------- |
689
685
  | `query` | Reactive data fetching |
690
686
 
691
687
  ### Routing (`@vertz/ui/router`)
692
688
 
693
- | Export | Description |
694
- |---|---|
695
- | `defineRoutes` | Define route configuration |
696
- | `createRouter` | Create a router instance |
697
- | `createLink` | Create a `<Link>` component |
698
- | `createOutlet` | Create a route outlet |
689
+ | Export | Description |
690
+ | ------------------- | --------------------------- |
691
+ | `defineRoutes` | Define route configuration |
692
+ | `createRouter` | Create a router instance |
693
+ | `createLink` | Create a `<Link>` component |
694
+ | `createOutlet` | Create a route outlet |
699
695
  | `parseSearchParams` | Parse URL search parameters |
700
- | `useSearchParams` | Reactive search parameters |
696
+ | `useSearchParams` | Reactive search parameters |
701
697
 
702
698
  ### Auth (`@vertz/ui/auth`)
703
699
 
704
- | Export | Description |
705
- |---|---|
706
- | `AccessContext` | Context for access set data |
707
- | `can` | Check if the user has an entitlement |
708
- | `AccessGate` | Gate rendering until access set loads |
709
- | `createAccessProvider` | Bootstrap access context from SSR data |
710
- | `useAccessContext` | Read the access context (throws without provider) |
700
+ | Export | Description |
701
+ | ---------------------- | ------------------------------------------------- |
702
+ | `AccessContext` | Context for access set data |
703
+ | `can` | Check if the user has an entitlement |
704
+ | `AccessGate` | Gate rendering until access set loads |
705
+ | `createAccessProvider` | Bootstrap access context from SSR data |
706
+ | `useAccessContext` | Read the access context (throws without provider) |
711
707
 
712
708
  ### Testing (`@vertz/ui/test`)
713
709
 
714
- | Export | Description |
715
- |---|---|
716
- | `renderTest` | Mount a component for testing |
717
- | `findByTestId` | Find element by `data-testid` (throws) |
718
- | `findByText` | Find element by text content (throws) |
719
- | `queryByTestId` | Find element by `data-testid` (nullable) |
720
- | `queryByText` | Find element by text content (nullable) |
721
- | `waitFor` | Retry an assertion until it passes |
722
- | `click` | Simulate a click |
723
- | `type` | Simulate typing |
724
- | `press` | Simulate a key press |
725
- | `fillForm` | Fill multiple form fields |
726
- | `submitForm` | Submit a form |
727
- | `createTestRouter` | Create a router for testing |
710
+ | Export | Description |
711
+ | ------------------ | ---------------------------------------- |
712
+ | `renderTest` | Mount a component for testing |
713
+ | `findByTestId` | Find element by `data-testid` (throws) |
714
+ | `findByText` | Find element by text content (throws) |
715
+ | `queryByTestId` | Find element by `data-testid` (nullable) |
716
+ | `queryByText` | Find element by text content (nullable) |
717
+ | `waitFor` | Retry an assertion until it passes |
718
+ | `click` | Simulate a click |
719
+ | `type` | Simulate typing |
720
+ | `press` | Simulate a key press |
721
+ | `fillForm` | Fill multiple form fields |
722
+ | `submitForm` | Submit a form |
723
+ | `createTestRouter` | Create a router for testing |
728
724
 
729
725
  ---
730
726
 
package/package.json CHANGED
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "name": "@vertz/ui",
3
- "version": "0.2.32",
4
- "type": "module",
5
- "license": "MIT",
3
+ "version": "0.2.33",
6
4
  "description": "Vertz UI framework — signals, components, JSX runtime",
5
+ "license": "MIT",
7
6
  "repository": {
8
7
  "type": "git",
9
8
  "url": "https://github.com/vertz-dev/vertz.git",
10
9
  "directory": "packages/ui"
11
10
  },
12
- "publishConfig": {
13
- "access": "public",
14
- "provenance": true
15
- },
11
+ "files": [
12
+ "dist",
13
+ "reactivity.json"
14
+ ],
15
+ "type": "module",
16
+ "sideEffects": [
17
+ "dist/shared/*.js"
18
+ ],
16
19
  "main": "dist/src/index.js",
17
20
  "types": "dist/src/index.d.ts",
18
21
  "exports": {
@@ -62,10 +65,10 @@
62
65
  },
63
66
  "./reactivity.json": "./reactivity.json"
64
67
  },
65
- "files": [
66
- "dist",
67
- "reactivity.json"
68
- ],
68
+ "publishConfig": {
69
+ "access": "public",
70
+ "provenance": true
71
+ },
69
72
  "scripts": {
70
73
  "build": "bunup",
71
74
  "test": "bun test",
@@ -74,19 +77,16 @@
74
77
  "typecheck": "tsc --noEmit"
75
78
  },
76
79
  "dependencies": {
77
- "@vertz/fetch": "^0.2.30"
80
+ "@vertz/fetch": "^0.2.31"
78
81
  },
79
82
  "devDependencies": {
80
83
  "@happy-dom/global-registrator": "^20.7.0",
81
- "@vertz/schema": "^0.2.30",
84
+ "@vertz/schema": "^0.2.31",
82
85
  "bunup": "^0.16.31",
83
86
  "happy-dom": "^20.7.0",
84
87
  "typescript": "^5.7.0"
85
88
  },
86
89
  "engines": {
87
90
  "node": ">=22"
88
- },
89
- "sideEffects": [
90
- "dist/shared/*.js"
91
- ]
91
+ }
92
92
  }