@pihanga2/shadcn 0.2.0 → 0.2.1
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/AGENT.md +10 -3
- package/AGENT.using-cards.md +55 -246
- package/cards/box/box.component.js +2 -2
- package/cards/box/box.component.js.map +1 -1
- package/cards/button/button.types.d.ts +3 -0
- package/cards/button/button.types.js +2 -2
- package/cards/button/button.types.js.map +1 -1
- package/cards/button/index.js +5 -5
- package/cards/chartGraph/chartGraph.component.d.ts +4 -0
- package/cards/chartGraph/chartGraph.types.d.ts +102 -0
- package/cards/chartGraph/index.d.ts +1 -0
- package/cards/conditional/conditional.component.d.ts +14 -3
- package/cards/conditional/conditional.component.js +17 -9
- package/cards/conditional/conditional.component.js.map +1 -1
- package/cards/conditional/conditional.types.d.ts +100 -8
- package/cards/conditional/conditional.types.js.map +1 -1
- package/cards/core-index.js +31 -31
- package/cards/graphin/contextMenu.component.d.ts +28 -0
- package/cards/graphin/eventDispatcher.component.d.ts +8 -0
- package/cards/graphin/graphin.component.d.ts +2 -2
- package/cards/graphin/graphin.playground-cards.d.ts +1 -0
- package/cards/graphin/graphin.types.d.ts +444 -4
- package/cards/graphin/graphinOpHandler.component.d.ts +8 -0
- package/cards/graphin/index.d.ts +1 -0
- package/cards/graphin/tooltip.component.d.ts +13 -1
- package/cards/slider/index.d.ts +1 -0
- package/cards/slider/slider.component.d.ts +4 -0
- package/cards/slider/slider.types.d.ts +102 -0
- package/cards/sliderValue/index.d.ts +1 -0
- package/cards/sliderValue/sliderValue.component.d.ts +15 -0
- package/cards/sliderValue/sliderValue.types.d.ts +21 -0
- package/cards/tabs/tabs.component.js +51 -25
- package/cards/tabs/tabs.component.js.map +1 -1
- package/cards/tabs/tabs.types.d.ts +10 -0
- package/cards/tabs/tabs.types.js.map +1 -1
- package/components/hooks/use-breakpoint.d.ts +49 -0
- package/components/hooks/use-breakpoint.js +73 -0
- package/components/hooks/use-breakpoint.js.map +1 -0
- package/package.json +1 -1
package/AGENT.md
CHANGED
|
@@ -30,12 +30,19 @@ https://github.com/ivcap-works/pihanga-shadcn
|
|
|
30
30
|
|
|
31
31
|
| If your task is … | Read this file |
|
|
32
32
|
|---|---|
|
|
33
|
+
| **Getting started** — brand-new project, shadcn/ui + pihanga setup, file layout | [`AGENTS.getting-started.md`](./AGENTS.getting-started.md) |
|
|
33
34
|
| **Using** existing cards — install, wire, compose, navigate | [`AGENT.using-cards.md`](./AGENT.using-cards.md) |
|
|
34
35
|
| **Building** new cards — create a new card type for this repo | [`AGENT.building-cards.md`](./AGENT.building-cards.md) |
|
|
35
36
|
|
|
36
|
-
If you are **
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
If you are **starting from scratch**, read `AGENTS.getting-started.md` first — it
|
|
38
|
+
covers Vite setup, shadcn/ui init, pihanga-core installation, and the initial file
|
|
39
|
+
layout. Then continue with `AGENT.using-cards.md` for wiring and composing cards.
|
|
40
|
+
|
|
41
|
+
If you are adding cards to an **existing project**, go straight to
|
|
42
|
+
`AGENT.using-cards.md`.
|
|
43
|
+
|
|
44
|
+
Switch to `AGENT.building-cards.md` only when you need to add a new card *type*
|
|
45
|
+
to `src/cards/` itself.
|
|
39
46
|
|
|
40
47
|
---
|
|
41
48
|
|
package/AGENT.using-cards.md
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
> Read [`AGENT.md`](./AGENT.md) first for orientation and universal rules.
|
|
5
5
|
> If you need to *create* a new card type, switch to
|
|
6
6
|
> [`AGENT.building-cards.md`](./AGENT.building-cards.md).
|
|
7
|
+
>
|
|
8
|
+
> **Starting from scratch?** Follow [`AGENTS.getting-started.md`](./AGENTS.getting-started.md)
|
|
9
|
+
> first to scaffold your Vite project, run `shadcn init`, install `@pihanga2/core`,
|
|
10
|
+
> and wire up the initial file layout. Return here once the scaffold is in place.
|
|
7
11
|
|
|
8
12
|
> 💬 **Encountered a bug, a missing card, or an agent-unfriendly doc section?**
|
|
9
13
|
> Please open an issue at **https://github.com/ivcap-works/pihanga-shadcn/issues**
|
|
@@ -41,12 +45,10 @@
|
|
|
41
45
|
## Table of Contents
|
|
42
46
|
|
|
43
47
|
- [Distribution channels — choose one](#distribution-channels--choose-one)
|
|
44
|
-
- [Channel 1 — shadcn registry
|
|
48
|
+
- [Channel 1 — shadcn registry (one-time project setup)](#channel-1--shadcn-registry-one-time-project-setup)
|
|
45
49
|
- [Channel 2 — npm package `@pihanga2/shadcn`](#channel-2--npm-package-pihanga2shadcn)
|
|
46
50
|
- [Migrating a card from npm to a local copy](#migrating-a-card-from-npm-to-a-local-customised-copy)
|
|
47
51
|
- [Vite configuration (both channels)](#vite-configuration-both-channels)
|
|
48
|
-
- [Required Vite aliases](#required-vite-aliases)
|
|
49
|
-
- [Required `src/components/lib/utils.ts`](#required-srccomponentslibutils-ts)
|
|
50
52
|
- [`@pihanga2/cards` — deprecated, do not use](#pihanga2cards--deprecated-do-not-use)
|
|
51
53
|
- [Type-only import gotcha](#type-only-import-gotcha--picardref-store-etc)
|
|
52
54
|
- [Transitive card dependencies](#transitive-card-dependencies)
|
|
@@ -69,7 +71,7 @@
|
|
|
69
71
|
|
|
70
72
|
| | Registry | npm package |
|
|
71
73
|
|---|---|---|
|
|
72
|
-
| **Install** | `npx shadcn@latest add <url>` | `npm install @pihanga2/shadcn` |
|
|
74
|
+
| **Install** | `npx shadcn@latest add <url>` (or `yarn dlx shadcn@latest add <url>`) | `npm install @pihanga2/shadcn` |
|
|
73
75
|
| **Cards available** | All 34 | 30 core (no graphin / jsonViewer / markdownViewer / resizable) |
|
|
74
76
|
| **Requires `shadcn init`** | Yes | No |
|
|
75
77
|
| **Files land in your project** | Yes — editable source | No — compiled bundle |
|
|
@@ -81,192 +83,23 @@ a clean `npm install` workflow is preferred.
|
|
|
81
83
|
|
|
82
84
|
---
|
|
83
85
|
|
|
84
|
-
## Channel 1 — shadcn registry
|
|
85
|
-
|
|
86
|
-
### 1 — Initialise shadcn (creates `components.json` and `@/` alias)
|
|
87
|
-
|
|
88
|
-
```sh
|
|
89
|
-
npx shadcn@latest init
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
When prompted, choose:
|
|
93
|
-
- **Style**: New York
|
|
94
|
-
- **Base colour**: Neutral
|
|
95
|
-
- **CSS variables**: Yes
|
|
96
|
-
|
|
97
|
-
This command creates `components.json`, patches `tsconfig.json` with the `@/`
|
|
98
|
-
path alias, and installs Tailwind CSS if not already present.
|
|
99
|
-
|
|
100
|
-
### 2 — Ensure `@/cards` alias is configured
|
|
101
|
-
|
|
102
|
-
Pihanga cards are copied to `src/cards/` and import each other via the
|
|
103
|
-
`@/cards/` alias. After `shadcn init`, add this alias to `tsconfig.json`:
|
|
104
|
-
|
|
105
|
-
```jsonc
|
|
106
|
-
// tsconfig.json → compilerOptions.paths
|
|
107
|
-
{
|
|
108
|
-
"compilerOptions": {
|
|
109
|
-
"paths": {
|
|
110
|
-
"@/*": ["./src/*"]
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
The `@/*` → `./src/*` mapping (which `shadcn init` creates) already covers
|
|
117
|
-
`@/cards/` → `src/cards/`, so **no extra alias is needed** as long as cards
|
|
118
|
-
are placed at `src/cards/`.
|
|
119
|
-
|
|
120
|
-
If cards end up elsewhere, add an explicit alias:
|
|
121
|
-
```jsonc
|
|
122
|
-
"@/cards/*": ["./src/cards/*"]
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### 3 — Configure `src/index.css` (Tailwind v4 + shadcn theme)
|
|
86
|
+
## Channel 1 — shadcn registry (one-time project setup)
|
|
126
87
|
|
|
127
|
-
>
|
|
128
|
-
>
|
|
129
|
-
>
|
|
130
|
-
>
|
|
131
|
-
> foreign stylesheets will conflict with Tailwind's generated output and break
|
|
132
|
-
> the shadcn colour variables.
|
|
88
|
+
> **New project?** The full one-time setup (Vite scaffold, shadcn init, Tailwind
|
|
89
|
+
> theme, Vite aliases, pihanga-core install) is documented step-by-step in
|
|
90
|
+
> **[`AGENTS.getting-started.md`](./AGENTS.getting-started.md)**. Follow that
|
|
91
|
+
> guide first, then return here to install and wire individual cards.
|
|
133
92
|
|
|
134
|
-
|
|
135
|
-
an explicit `@theme inline` block, classes like `bg-card`, `bg-background`, and
|
|
136
|
-
`border-border` have no associated colour and render as **transparent** — causing
|
|
137
|
-
dialog panels, popovers, and cards to appear invisible.
|
|
93
|
+
Key things the setup guide covers:
|
|
138
94
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
```
|
|
148
|
-
or from `src/index.css` in a local clone. The full content is reproduced below
|
|
149
|
-
for reference / offline use:
|
|
150
|
-
|
|
151
|
-
The required `src/index.css`:
|
|
152
|
-
|
|
153
|
-
```css
|
|
154
|
-
@import "tailwindcss";
|
|
155
|
-
|
|
156
|
-
/*
|
|
157
|
-
* Tailwind v4 — map shadcn semantic CSS variables to Tailwind colour utilities.
|
|
158
|
-
* Without this @theme block, classes like bg-card / bg-background / border-border
|
|
159
|
-
* have no associated colour and render as transparent. This means dialog panels,
|
|
160
|
-
* cards, popovers, etc. will appear invisible or incorrectly coloured.
|
|
161
|
-
*/
|
|
162
|
-
@theme inline {
|
|
163
|
-
/*
|
|
164
|
-
* Brand button tokens — override these in your app to retheme variant="brand".
|
|
165
|
-
* Defaults to the primary colour family. See the pi/button section below.
|
|
166
|
-
*/
|
|
167
|
-
--color-btn-brand: var(--primary);
|
|
168
|
-
--color-btn-brand-foreground: var(--primary-foreground);
|
|
169
|
-
--radius-btn-brand: var(--radius-md);
|
|
170
|
-
|
|
171
|
-
--color-background: var(--background);
|
|
172
|
-
--color-foreground: var(--foreground);
|
|
173
|
-
--color-card: var(--card);
|
|
174
|
-
--color-card-foreground: var(--card-foreground);
|
|
175
|
-
--color-popover: var(--popover);
|
|
176
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
177
|
-
--color-primary: var(--primary);
|
|
178
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
179
|
-
--color-secondary: var(--secondary);
|
|
180
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
181
|
-
--color-muted: var(--muted);
|
|
182
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
183
|
-
--color-accent: var(--accent);
|
|
184
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
185
|
-
--color-destructive: var(--destructive);
|
|
186
|
-
--color-border: var(--border);
|
|
187
|
-
--color-input: var(--input);
|
|
188
|
-
--color-ring: var(--ring);
|
|
189
|
-
--radius-sm: calc(var(--radius) - 4px);
|
|
190
|
-
--radius-md: calc(var(--radius) - 2px);
|
|
191
|
-
--radius-lg: var(--radius);
|
|
192
|
-
--radius-xl: calc(var(--radius) + 4px);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/* ── Light theme (shadcn neutral / new-york) ─────────────────────────────── */
|
|
196
|
-
:root {
|
|
197
|
-
--background: oklch(1 0 0);
|
|
198
|
-
--foreground: oklch(0.145 0 0);
|
|
199
|
-
--card: oklch(1 0 0);
|
|
200
|
-
--card-foreground: oklch(0.145 0 0);
|
|
201
|
-
--popover: oklch(1 0 0);
|
|
202
|
-
--popover-foreground: oklch(0.145 0 0);
|
|
203
|
-
--primary: oklch(0.205 0 0);
|
|
204
|
-
--primary-foreground: oklch(0.985 0 0);
|
|
205
|
-
--secondary: oklch(0.97 0 0);
|
|
206
|
-
--secondary-foreground: oklch(0.205 0 0);
|
|
207
|
-
--muted: oklch(0.97 0 0);
|
|
208
|
-
--muted-foreground: oklch(0.556 0 0);
|
|
209
|
-
--accent: oklch(0.97 0 0);
|
|
210
|
-
--accent-foreground: oklch(0.205 0 0);
|
|
211
|
-
--destructive: oklch(0.577 0.245 27.325);
|
|
212
|
-
--border: oklch(0.922 0 0);
|
|
213
|
-
--input: oklch(0.922 0 0);
|
|
214
|
-
--ring: oklch(0.708 0 0);
|
|
215
|
-
--radius: 0.625rem;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/* ── Dark theme ──────────────────────────────────────────────────────────── */
|
|
219
|
-
.dark {
|
|
220
|
-
--background: oklch(0.145 0 0);
|
|
221
|
-
--foreground: oklch(0.985 0 0);
|
|
222
|
-
--card: oklch(0.205 0 0);
|
|
223
|
-
--card-foreground: oklch(0.985 0 0);
|
|
224
|
-
--popover: oklch(0.205 0 0);
|
|
225
|
-
--popover-foreground: oklch(0.985 0 0);
|
|
226
|
-
--primary: oklch(0.922 0 0);
|
|
227
|
-
--primary-foreground: oklch(0.205 0 0);
|
|
228
|
-
--secondary: oklch(0.269 0 0);
|
|
229
|
-
--secondary-foreground: oklch(0.985 0 0);
|
|
230
|
-
--muted: oklch(0.269 0 0);
|
|
231
|
-
--muted-foreground: oklch(0.708 0 0);
|
|
232
|
-
--accent: oklch(0.269 0 0);
|
|
233
|
-
--accent-foreground: oklch(0.985 0 0);
|
|
234
|
-
--destructive: oklch(0.704 0.191 22.216);
|
|
235
|
-
--border: oklch(1 0 0 / 10%);
|
|
236
|
-
--input: oklch(1 0 0 / 15%);
|
|
237
|
-
--ring: oklch(0.556 0 0);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
@layer base {
|
|
241
|
-
* {
|
|
242
|
-
@apply border-border outline-ring/50;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
body {
|
|
246
|
-
@apply bg-background text-foreground;
|
|
247
|
-
/*
|
|
248
|
-
* Prevent layout reflow when a dialog (or any Radix overlay) applies
|
|
249
|
-
* `overflow: hidden` to <body> to disable background scrolling.
|
|
250
|
-
* Without this, removing the scrollbar widens the content area by ~15 px
|
|
251
|
-
* and causes visible text reflow behind the dialog backdrop.
|
|
252
|
-
*/
|
|
253
|
-
scrollbar-gutter: stable;
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
> **Why `@theme inline`?** Tailwind v4 separates design tokens from utility
|
|
259
|
-
> generation. shadcn stores its colours as CSS custom properties (`--card`,
|
|
260
|
-
> `--background`, …) but Tailwind v4 will not generate colour utilities from
|
|
261
|
-
> raw CSS variables unless they are declared inside an `@theme` block. Without
|
|
262
|
-
> it the generated CSS contains no colour definitions for those utility classes.
|
|
263
|
-
|
|
264
|
-
> **Why `scrollbar-gutter: stable`?** When a Radix dialog opens, the library
|
|
265
|
-
> `@radix-ui/react-remove-scroll` sets `overflow: hidden` on `<body>` to
|
|
266
|
-
> prevent background scrolling. This hides the scrollbar and adds ~15 px of
|
|
267
|
-
> width back to the page — causing text to reflow. `scrollbar-gutter: stable`
|
|
268
|
-
> reserves a permanent gutter for the scrollbar so its appearance/disappearance
|
|
269
|
-
> never changes the usable width.
|
|
95
|
+
- **⚠️ npx + npm 11 + Node 24 incompatibility** — use `nvm use 22` or `yarn dlx`
|
|
96
|
+
as a drop-in (see getting-started § *npx compatibility*)
|
|
97
|
+
- `npx shadcn@latest init` / `yarn dlx shadcn@latest init` — creates
|
|
98
|
+
`components.json`, patches `tsconfig.json` with `@/*` alias, installs Tailwind
|
|
99
|
+
- `src/index.css` — requires a full `@theme inline` block; without it `bg-card`,
|
|
100
|
+
`bg-background` etc. render transparent and dialogs appear invisible
|
|
101
|
+
- `src/components/lib/utils.ts` — must create the `cn()` helper at this path
|
|
102
|
+
- `vite.config.ts` aliases — `@/lib`, `@/registry`, `@/components`, `@/cards`, `@`
|
|
270
103
|
|
|
271
104
|
---
|
|
272
105
|
|
|
@@ -364,62 +197,10 @@ import-order dependency.
|
|
|
364
197
|
|
|
365
198
|
## Vite configuration (both channels)
|
|
366
199
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
### Required Vite aliases
|
|
372
|
-
|
|
373
|
-
pihanga-shadcn cards reference each other and shadcn UI primitives via these
|
|
374
|
-
path aliases. Without the `@/registry` alias in particular, `button.component.tsx`
|
|
375
|
-
(and other cards) will fail at Vite dev time with a cryptic
|
|
376
|
-
`"Failed to resolve import '@/registry/ui/button'"` error.
|
|
377
|
-
|
|
378
|
-
```ts
|
|
379
|
-
// vite.config.ts — required for both channels
|
|
380
|
-
import path from "path";
|
|
381
|
-
import tailwindcss from "@tailwindcss/vite";
|
|
382
|
-
import react from "@vitejs/plugin-react";
|
|
383
|
-
import {defineConfig} from "vite";
|
|
384
|
-
|
|
385
|
-
export default defineConfig({
|
|
386
|
-
plugins: [react(), tailwindcss()],
|
|
387
|
-
resolve: {
|
|
388
|
-
alias: [
|
|
389
|
-
// @/lib → src/lib (shared utilities used by cards)
|
|
390
|
-
{find: "@/lib", replacement: path.resolve(__dirname, "./src/lib")},
|
|
391
|
-
// @/registry → src/components (shadcn UI primitives — cards import via
|
|
392
|
-
// "@/registry/ui/button" etc.; this alias bridges them to the local copies)
|
|
393
|
-
{find: "@/registry", replacement: path.resolve(__dirname, "./src/components")},
|
|
394
|
-
// @/components → src/components (needed for cross-component imports)
|
|
395
|
-
{find: "@/components", replacement: path.resolve(__dirname, "./src/components")},
|
|
396
|
-
// @/cards → src/cards (explicit card-to-card imports)
|
|
397
|
-
{find: "@/cards", replacement: path.resolve(__dirname, "./src/cards")},
|
|
398
|
-
// @ → src (catch-all for everything else)
|
|
399
|
-
{find: "@", replacement: path.resolve(__dirname, "./src")},
|
|
400
|
-
],
|
|
401
|
-
},
|
|
402
|
-
});
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
### Required `src/components/lib/utils.ts`
|
|
406
|
-
|
|
407
|
-
All shadcn UI components (`button.tsx`, `tooltip.tsx`, `sheet.tsx`, `badge.tsx`,
|
|
408
|
-
etc.) import the `cn()` helper from `@/components/lib/utils` — **not** from
|
|
409
|
-
`@/lib/utils`. Create this file:
|
|
410
|
-
|
|
411
|
-
```ts
|
|
412
|
-
// src/components/lib/utils.ts
|
|
413
|
-
import {clsx, type ClassValue} from "clsx";
|
|
414
|
-
import {twMerge} from "tailwind-merge";
|
|
415
|
-
|
|
416
|
-
export function cn(...inputs: ClassValue[]): string {
|
|
417
|
-
return twMerge(clsx(inputs));
|
|
418
|
-
}
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
Note that `@/lib/utils.ts` can also exist for app-level utilities; they are two
|
|
422
|
-
separate files at two separate paths.
|
|
200
|
+
> **Vite project setup** (aliases, `src/components/lib/utils.ts`, `src/index.css`)
|
|
201
|
+
> is documented in full in **[`AGENTS.getting-started.md`](./AGENTS.getting-started.md)
|
|
202
|
+
> — Step 5 & Step 2**. The sub-sections below cover **runtime-only gotchas** that
|
|
203
|
+
> apply regardless of when the project was scaffolded.
|
|
423
204
|
|
|
424
205
|
### `@pihanga2/cards` — deprecated, do not use
|
|
425
206
|
|
|
@@ -502,15 +283,28 @@ After the one-time setup (Channel 1 prerequisites above), add any card with a
|
|
|
502
283
|
single command. `@pihanga2/core` and all card-specific npm packages are
|
|
503
284
|
installed automatically.
|
|
504
285
|
|
|
286
|
+
> ⚠️ **npm 11 + Node 24:** `npx` fails on this combination — use Node 22 via
|
|
287
|
+
> `nvm use 22`, or use `yarn dlx` instead (see the
|
|
288
|
+
> [compatibility note above](#channel-1--shadcn-registry-prerequisites)).
|
|
289
|
+
|
|
505
290
|
```sh
|
|
506
|
-
#
|
|
291
|
+
# npm / npx (Node 22 recommended)
|
|
507
292
|
npx shadcn@latest add https://ivcap-works.github.io/pihanga-shadcn/r/button.json
|
|
508
293
|
|
|
509
|
-
#
|
|
294
|
+
# yarn (works on all supported Node versions)
|
|
295
|
+
yarn dlx shadcn@latest add https://ivcap-works.github.io/pihanga-shadcn/r/button.json
|
|
296
|
+
|
|
297
|
+
# Add multiple cards at once (npx)
|
|
510
298
|
npx shadcn@latest add \
|
|
511
299
|
https://ivcap-works.github.io/pihanga-shadcn/r/button.json \
|
|
512
300
|
https://ivcap-works.github.io/pihanga-shadcn/r/form.json \
|
|
513
|
-
https://ivcap-works.github.io/pihanga-shadcn/r/
|
|
301
|
+
https://ivcap-works.github.io/pihanga-shadcn/r/dataTable.json
|
|
302
|
+
|
|
303
|
+
# Add multiple cards at once (yarn dlx)
|
|
304
|
+
yarn dlx shadcn@latest add \
|
|
305
|
+
https://ivcap-works.github.io/pihanga-shadcn/r/button.json \
|
|
306
|
+
https://ivcap-works.github.io/pihanga-shadcn/r/form.json \
|
|
307
|
+
https://ivcap-works.github.io/pihanga-shadcn/r/dataTable.json
|
|
514
308
|
```
|
|
515
309
|
|
|
516
310
|
### npm channel
|
|
@@ -570,6 +364,8 @@ Full registry index: `https://ivcap-works.github.io/pihanga-shadcn/r/registry.js
|
|
|
570
364
|
**Registry channel:**
|
|
571
365
|
- `npx shadcn@latest add <url>` automatically installs `@pihanga2/core` and all
|
|
572
366
|
card-specific npm packages — no separate `npm install` needed.
|
|
367
|
+
- **`npx` fails on npm 11 + Node 24** — use `nvm use 22` or replace every
|
|
368
|
+
`npx shadcn@latest` with `yarn dlx shadcn@latest` (identical output).
|
|
573
369
|
- Cards land at `src/cards/<card-name>/` in the consumer's project.
|
|
574
370
|
- The `framework` card is the Pihanga app root — add it first for new apps.
|
|
575
371
|
- `graphin` has heavy AntV dependencies (~5 MB) — only add if graph
|
|
@@ -1240,3 +1036,16 @@ local modifications to the registry code for features that already existed.
|
|
|
1240
1036
|
| `shad/list` icon decorators silently rendered nothing when icon names were unregistered | The `shad/list` card calls `getIcon(name)` which requires icons to be pre-registered via `registerIcon()` in `src/cards/icons.ts`; this contract is not visible in the type declarations | Added *`shad/list` — icon decorators require registered icons* to *Card API quick reference* |
|
|
1241
1037
|
| `flexGrid.component.tsx` failed to compile under `verbatimModuleSyntax` / `noImplicitAny` strict TypeScript | Registry source mixed value and type imports; had implicit `any` in `.map()` callback; `Object.entries` lacked an explicit cast; `_style` lacked widened type for `gridTemplateAreas` | Fixed directly in `flexGrid.component.tsx`: split `import type`, added explicit `row: string[]` annotation, added `as [string, PiCardRef][]` cast, widened `_style` type |
|
|
1242
1038
|
| `stack.component.tsx` contained commented-out Joy UI dead code | Leftover from a previous MUI Joy UI implementation; the current Tailwind implementation is complete and the comment block serves no purpose | Removed the dead code block |
|
|
1039
|
+
|
|
1040
|
+
### 2026-06 user feedback — `npx shadcn@latest add` fails on npm 11 + Node 24
|
|
1041
|
+
|
|
1042
|
+
Users reported that every `npx shadcn@latest` command failed with
|
|
1043
|
+
`npm error could not determine executable to run` when running Node 24 (which
|
|
1044
|
+
bundles npm 11). The docs only showed `npx` examples with no mention of a
|
|
1045
|
+
yarn alternative or Node version constraint.
|
|
1046
|
+
|
|
1047
|
+
| Reported gap | Fix applied |
|
|
1048
|
+
|---|---|
|
|
1049
|
+
| No `yarn dlx` alternative documented | Added `yarn dlx shadcn@latest` as the yarn-compatible alternative in the distribution channels table, Channel 1 init step, and "Adding individual cards" commands |
|
|
1050
|
+
| No warning about npm 11 + Node 24 incompatibility | Added a prominent compatibility callout at the top of *Channel 1 — shadcn registry prerequisites*, with the `nvm use 22` workaround and the `yarn dlx` alternative |
|
|
1051
|
+
| "Notes for AI agents" section did not mention the `npx` breakage | Added a bullet noting that `npx` fails on npm 11 + Node 24 and that `yarn dlx shadcn@latest` is a drop-in replacement |
|
|
@@ -3,8 +3,8 @@ import "react";
|
|
|
3
3
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/cards/box/box.component.tsx
|
|
5
5
|
var r = (r) => {
|
|
6
|
-
let { content: i, className: a, style: o, cardName: s } = r, c = {};
|
|
7
|
-
r.height && (c.height = `${r.height}px`), r.width && (c.
|
|
6
|
+
let { content: i, className: a, style: o, cardName: s } = r, c = { ...o?.shad };
|
|
7
|
+
r.height && (c.height = `${r.height}px`), r.width && (c.width = `${r.width}px`), r.marginTop && (c.marginTop = `${r.marginTop}px`), r.marginBottom && (c.marginBottom = `${r.marginBottom}px`), r.marginLeft && (c.marginLeft = `${r.marginLeft}px`), r.marginRight && (c.marginRight = `${r.marginRight}px`), r.paddingTop && (c.paddingTop = `${r.paddingTop}px`), r.paddingBottom && (c.paddingBottom = `${r.paddingBottom}px`), r.paddingLeft && (c.paddingLeft = `${r.paddingLeft}px`), r.paddingRight && (c.paddingRight = `${r.paddingRight}px`);
|
|
8
8
|
function l() {
|
|
9
9
|
return i ? i.map((n, r) => /* @__PURE__ */ t(e, {
|
|
10
10
|
cardName: n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box.component.js","names":[],"sources":["../../../src/cards/box/box.component.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\nimport type {BoxProps} from \"./box.types\";\n\nexport const BoxComponent = (props: PiCardProps<BoxProps>): React.ReactNode => {\n const {content, className, style, cardName} = props;\n\n
|
|
1
|
+
{"version":3,"file":"box.component.js","names":[],"sources":["../../../src/cards/box/box.component.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\nimport type {BoxProps} from \"./box.types\";\n\nexport const BoxComponent = (props: PiCardProps<BoxProps>): React.ReactNode => {\n const {content, className, style, cardName} = props;\n\n const sy: Record<string, string | number> = {\n ...(style as {shad?: Record<string, string | number>} | undefined)?.shad,\n };\n if (props.height) sy.height = `${props.height}px`;\n if (props.width) sy.width = `${props.width}px`;\n\n if (props.marginTop) sy.marginTop = `${props.marginTop}px`;\n if (props.marginBottom) sy.marginBottom = `${props.marginBottom}px`;\n if (props.marginLeft) sy.marginLeft = `${props.marginLeft}px`;\n if (props.marginRight) sy.marginRight = `${props.marginRight}px`;\n\n if (props.paddingTop) sy.paddingTop = `${props.paddingTop}px`;\n if (props.paddingBottom) sy.paddingBottom = `${props.paddingBottom}px`;\n if (props.paddingLeft) sy.paddingLeft = `${props.paddingLeft}px`;\n if (props.paddingRight) sy.paddingRight = `${props.paddingRight}px`;\n\n function renderContent() {\n if (!content) return null;\n return content.map((cn, i) => (\n <Card cardName={cn} parentCard={cardName} key={i} />\n ));\n }\n\n return (\n <div className={className} style={sy} data-pihanga={cardName}>\n {renderContent()}\n {props.children}\n </div>\n );\n};\n"],"mappings":";;;;AAKA,IAAa,KAAgB,MAAkD;CAC7E,IAAM,EAAC,YAAS,cAAW,UAAO,gBAAY,GAExC,IAAsC,EAC1C,GAAI,GAAgE,KACtE;CAYA,AAXI,EAAM,WAAQ,EAAG,SAAS,GAAG,EAAM,OAAO,MAC1C,EAAM,UAAO,EAAG,QAAQ,GAAG,EAAM,MAAM,MAEvC,EAAM,cAAW,EAAG,YAAY,GAAG,EAAM,UAAU,MACnD,EAAM,iBAAc,EAAG,eAAe,GAAG,EAAM,aAAa,MAC5D,EAAM,eAAY,EAAG,aAAa,GAAG,EAAM,WAAW,MACtD,EAAM,gBAAa,EAAG,cAAc,GAAG,EAAM,YAAY,MAEzD,EAAM,eAAY,EAAG,aAAa,GAAG,EAAM,WAAW,MACtD,EAAM,kBAAe,EAAG,gBAAgB,GAAG,EAAM,cAAc,MAC/D,EAAM,gBAAa,EAAG,cAAc,GAAG,EAAM,YAAY,MACzD,EAAM,iBAAc,EAAG,eAAe,GAAG,EAAM,aAAa;CAEhE,SAAS,IAAgB;EAEvB,OADK,IACE,EAAQ,KAAK,GAAI,MACtB,kBAAC,GAAD;GAAM,UAAU;GAAI,YAAY;EAAmB,GAAJ,CAAI,CACpD,IAHoB;CAIvB;CAEA,OACE,kBAAC,OAAD;EAAgB;EAAW,OAAO;EAAI,gBAAc;YAApD,CACG,EAAc,GACd,EAAM,QACJ;;AAET"}
|
|
@@ -4,6 +4,9 @@ export declare const Button: <S extends import('@pihanga2/core').ReduxState>(p:
|
|
|
4
4
|
export declare const PI_BUTTON_ACTION: {
|
|
5
5
|
CLICKED: string;
|
|
6
6
|
};
|
|
7
|
+
export declare const onButtonClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
|
+
cardID: string;
|
|
9
|
+
} & PiButtonClickedEvent>) => void;
|
|
7
10
|
export declare const onPiButtonClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
11
|
cardID: string;
|
|
9
12
|
} & PiButtonClickedEvent>) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCardDeclaration as e, createOnAction as t, registerActions as n } from "@pihanga2/core";
|
|
2
2
|
//#region src/cards/button/button.types.ts
|
|
3
|
-
var r = "pi/button", i = e(r), a = n(r, ["clicked"]), o = t(a.CLICKED);
|
|
3
|
+
var r = "pi/button", i = e(r), a = n(r, ["clicked"]), o = t(a.CLICKED), s = o;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { i as Button, a as PI_BUTTON_ACTION, r as PI_BUTTON_CARD, o as onPiButtonClicked };
|
|
5
|
+
export { i as Button, a as PI_BUTTON_ACTION, r as PI_BUTTON_CARD, o as onButtonClicked, s as onPiButtonClicked };
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=button.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.types.js","names":[],"sources":["../../../src/cards/button/button.types.ts"],"sourcesContent":["import {\n createCardDeclaration,\n createOnAction,\n PiCardRef,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const PI_BUTTON_CARD = \"pi/button\";\n\nexport const Button = createCardDeclaration<PiButtonProps, PiButtonEvents>(\n PI_BUTTON_CARD,\n);\n\nexport const PI_BUTTON_ACTION = registerActions(PI_BUTTON_CARD, [\"clicked\"]);\n\nexport const
|
|
1
|
+
{"version":3,"file":"button.types.js","names":[],"sources":["../../../src/cards/button/button.types.ts"],"sourcesContent":["import {\n createCardDeclaration,\n createOnAction,\n PiCardRef,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const PI_BUTTON_CARD = \"pi/button\";\n\nexport const Button = createCardDeclaration<PiButtonProps, PiButtonEvents>(\n PI_BUTTON_CARD,\n);\n\nexport const PI_BUTTON_ACTION = registerActions(PI_BUTTON_CARD, [\"clicked\"]);\n\nexport const onButtonClicked = createOnAction<PiButtonClickedEvent>(\n PI_BUTTON_ACTION.CLICKED,\n);\n\n/* @deprecated Use `onButtonClicked` instead. */\nexport const onPiButtonClicked = onButtonClicked;\n\n/**\n * Declarative \"opts\" subset based on `src/registry/ui/button.tsx`.\n *\n * Notes:\n * - Any icon is referenced by name and resolved via `src/pihanga/icons.ts`.\n * - `children` are provided via `label` (simple) or `content` (card ref).\n */\nexport type PiButtonOpts = {\n /**\n * Visual style variant of the button.\n * Determines the button's appearance (colors, borders, etc.).\n */\n variant?:\n | \"default\"\n | \"destructive\"\n | \"outline\"\n | \"secondary\"\n | \"ghost\"\n | \"ghost2\"\n | \"ghost3\"\n | \"ghostActive\"\n | \"brand\"\n | \"nav\"\n | \"navAction\"\n | \"menuAction\"\n | \"blockAction\"\n | \"blockActionSecondary\"\n | \"primaryOutline\"\n | \"radio\"\n | \"none\";\n\n /**\n * Size of the button.\n * Controls padding, font size, and overall dimensions.\n */\n size?:\n | \"default\"\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"icon\"\n | \"iconSm\"\n | \"navAction\"\n | \"menuAction\"\n | \"blockAction\"\n | \"none\";\n\n /** Truncate button content with ellipsis if it overflows. */\n truncate?: boolean;\n\n /** If true, button is rendered as a menu trigger button. */\n isMenu?: boolean;\n\n /** Custom CSS class to apply to the loading spinner/indicator. */\n loadingClassName?: string;\n\n /** Icon to display before the button content. Set 'size' to 'icon' if ONLY show icon */\n beforeIcon?: string;\n\n /** Icon to display after the button content */\n afterIcon?: string;\n};\n\nexport type PiButtonProps = {\n id?: string; // optional 'id' to be added to events\n\n /**\n * Optional explicit aria-label.\n *\n * Useful for icon-only / letter-only buttons where the visible content\n * shouldn't be used as the accessible name.\n */\n ariaLabel?: string;\n\n /**\n * Declarative options; maps closely to `@/registry/ui/button`.\n */\n opts?: PiButtonOpts;\n\n /** Simple label; used as children and aria-label fallback. */\n label?: string;\n\n /**\n * Icon name to use as the main button content (instead of text label).\n * Resolved via `src/pihanga/icons.ts`.\n * Takes precedence over `label` and `contentCard`.\n */\n iconLabel?: string;\n\n /**\n * If set, renders this card as the content instead of `label`.\n * (Useful for rich content.)\n */\n contentCard?: PiCardRef;\n\n /** When provided, button will render as an anchor. */\n href?: string;\n target?: string;\n\n tooltip?: string;\n\n /**\n * If set, renders this card as the tooltip content instead of `tooltip`.\n * (Useful for rich tooltip content.)\n */\n tooltipCard?: PiCardRef;\n\n /**\n * Controls tooltip visibility mode.\n * - 'auto' (default): Normal hover behavior\n * - 'open': Force tooltip to be visible\n * - 'closed': Force tooltip to be hidden\n */\n tooltipMode?: \"auto\" | \"open\" | \"closed\";\n\n /**\n * Controls tooltip placement/position.\n * - 'top': Tooltip appears above the button (default)\n * - 'right': Tooltip appears to the right of the button\n * - 'bottom': Tooltip appears below the button\n * - 'left': Tooltip appears to the left of the button\n */\n tooltipPlacement?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\n /** Indicates whether the button is in an active/selected state. */\n active?: boolean;\n\n /** Indicates whether the button has focus state styling applied. */\n focused?: boolean;\n\n /** If true, disables the button and prevents interaction. */\n disabled?: boolean;\n\n /** If true, shows loading state and typically disables interaction. */\n loading?: boolean;\n\n /** If true, indicates an async operation is pending (similar to loading but distinct). */\n isPending?: boolean;\n\n className?: string;\n};\n\nexport type PiButtonClickedEvent = {\n id?: string;\n};\n\nexport type PiButtonEvents = {\n onClicked: PiButtonClickedEvent;\n};\n"],"mappings":";;AAOA,IAAa,IAAiB,aAEjB,IAAS,EACpB,CACF,GAEa,IAAmB,EAAgB,GAAgB,CAAC,SAAS,CAAC,GAE9D,IAAkB,EAC7B,EAAiB,OACnB,GAGa,IAAoB"}
|
package/cards/button/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ButtonComponent as e } from "./button.component.js";
|
|
2
|
-
import { Button as t, PI_BUTTON_ACTION as n, PI_BUTTON_CARD as r,
|
|
3
|
-
import { actionTypesToEvents as
|
|
2
|
+
import { Button as t, PI_BUTTON_ACTION as n, PI_BUTTON_CARD as r, onButtonClicked as i, onPiButtonClicked as a } from "./button.types.js";
|
|
3
|
+
import { actionTypesToEvents as o, registerCardComponent as s } from "@pihanga2/core";
|
|
4
4
|
//#region src/cards/button/index.ts
|
|
5
|
-
|
|
5
|
+
s({
|
|
6
6
|
name: r,
|
|
7
7
|
component: e,
|
|
8
|
-
events:
|
|
8
|
+
events: o(n)
|
|
9
9
|
});
|
|
10
10
|
//#endregion
|
|
11
|
-
export { t as Button, n as PI_BUTTON_ACTION, r as PI_BUTTON_CARD, i as onPiButtonClicked };
|
|
11
|
+
export { t as Button, n as PI_BUTTON_ACTION, r as PI_BUTTON_CARD, i as onButtonClicked, a as onPiButtonClicked };
|
|
12
12
|
|
|
13
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ChartConfig } from '../../components/ui/chart';
|
|
2
|
+
export declare const PI_CHART_GRAPH_CARD = "shad/chart-graph";
|
|
3
|
+
export declare const ChartGraph: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<PiChartGraphProps, S, {}>) => import('@pihanga2/core').PiCardDef;
|
|
4
|
+
export type { ChartConfig };
|
|
5
|
+
export type PiChartSeries = {
|
|
6
|
+
/** Key in each data-point object whose value will be plotted on the y-axis. */
|
|
7
|
+
dataKey: string;
|
|
8
|
+
/** Human-readable label used in the tooltip and legend. Defaults to `dataKey`. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/**
|
|
11
|
+
* CSS colour string for this series.
|
|
12
|
+
* Falls back to the shadcn chart CSS variables
|
|
13
|
+
* (`hsl(var(--chart-1))`, `hsl(var(--chart-2))`, …) in order.
|
|
14
|
+
*/
|
|
15
|
+
color?: string;
|
|
16
|
+
};
|
|
17
|
+
export type PiChartGraphProps = {
|
|
18
|
+
/**
|
|
19
|
+
* Whether to render an **area** chart (filled) or a **line** chart (stroke only).
|
|
20
|
+
*/
|
|
21
|
+
chartType: "area" | "line";
|
|
22
|
+
/**
|
|
23
|
+
* Array of data points. Each entry must contain:
|
|
24
|
+
* - a value for `xDataKey` (used for the x-axis labels), and
|
|
25
|
+
* - a numeric value for each `series[].dataKey`.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* [
|
|
30
|
+
* { month: "Jan", desktop: 186, mobile: 80 },
|
|
31
|
+
* { month: "Feb", desktop: 305, mobile: 200 },
|
|
32
|
+
* ]
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
data: Array<Record<string, unknown>>;
|
|
36
|
+
/**
|
|
37
|
+
* Series definitions. Each entry describes one plotted line or area.
|
|
38
|
+
* At least one series is required.
|
|
39
|
+
*/
|
|
40
|
+
series: PiChartSeries[];
|
|
41
|
+
/** Key inside each data-point object used for the x-axis tick labels. */
|
|
42
|
+
xDataKey: string;
|
|
43
|
+
/**
|
|
44
|
+
* Optional card title rendered above the chart.
|
|
45
|
+
* When either `title` or `description` is set the chart is wrapped in a
|
|
46
|
+
* shadcn `<Card>` shell; otherwise it renders as a bare `<div>`.
|
|
47
|
+
*/
|
|
48
|
+
title?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Optional subtitle rendered below `title`.
|
|
51
|
+
* Has no effect when `title` is not set.
|
|
52
|
+
*/
|
|
53
|
+
description?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Minimum chart height in pixels.
|
|
56
|
+
* The chart expands if the responsive container requires more space.
|
|
57
|
+
* Defaults to `250`.
|
|
58
|
+
*/
|
|
59
|
+
height?: number;
|
|
60
|
+
/** Show a legend beneath the chart. Defaults to `true`. */
|
|
61
|
+
showLegend?: boolean;
|
|
62
|
+
/** Show horizontal cartesian grid lines. Defaults to `true`. */
|
|
63
|
+
showGrid?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Show the y-axis with numeric tick labels on the left edge of the chart.
|
|
66
|
+
* Defaults to `false` (y-axis hidden) to keep the chart compact.
|
|
67
|
+
*/
|
|
68
|
+
showYAxis?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Unit string appended to every y-axis tick label (e.g. `"ms"`, `"%"`, `" km"`).
|
|
71
|
+
* Only visible when `showYAxis` is `true`.
|
|
72
|
+
*
|
|
73
|
+
* @example `yAxisUnit="%"` renders ticks as `"0%"`, `"50%"`, `"100%"`.
|
|
74
|
+
*/
|
|
75
|
+
yAxisUnit?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Unit string appended to every x-axis tick label.
|
|
78
|
+
* Useful when x-axis values are numeric (e.g. seconds, iterations).
|
|
79
|
+
* Has no effect when x-axis values are already formatted strings (e.g. month names).
|
|
80
|
+
*
|
|
81
|
+
* @example `xAxisUnit="s"` renders ticks as `"1s"`, `"2s"`, etc.
|
|
82
|
+
*/
|
|
83
|
+
xAxisUnit?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Stack all area series on top of each other (area chart only).
|
|
86
|
+
* When `false` (default) the filled areas overlap.
|
|
87
|
+
*/
|
|
88
|
+
stacked?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Opacity of the filled area (area chart only).
|
|
91
|
+
* Range 0–1. Defaults to `0.4`.
|
|
92
|
+
*/
|
|
93
|
+
fillOpacity?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Suppress the recharts entry animation so the chart renders immediately
|
|
96
|
+
* without the "draw-in" / "unfold" effect.
|
|
97
|
+
* Defaults to `false` (animation enabled).
|
|
98
|
+
*/
|
|
99
|
+
suppressAnimation?: boolean;
|
|
100
|
+
/** Extra Tailwind / CSS classes forwarded to the outermost element. */
|
|
101
|
+
className?: string;
|
|
102
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './chartGraph.types';
|
|
@@ -4,8 +4,19 @@ import * as React from "react";
|
|
|
4
4
|
/**
|
|
5
5
|
* ConditionalComponent
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* returns `null` otherwise.
|
|
9
|
-
*
|
|
7
|
+
* Renders the `content` card when the combined visibility condition is `true`,
|
|
8
|
+
* returns `null` otherwise.
|
|
9
|
+
*
|
|
10
|
+
* Visibility rules (all must be satisfied):
|
|
11
|
+
* 1. `show` — manual boolean gate (defaults to `true` when omitted)
|
|
12
|
+
* 2. `showOn` — breakpoint selector (always `true` when omitted)
|
|
13
|
+
* • `containerQuery: false` (default) → evaluated against the **viewport**
|
|
14
|
+
* via `window.matchMedia`
|
|
15
|
+
* • `containerQuery: true` → evaluated against the width of the
|
|
16
|
+
* **enclosing container** via `ResizeObserver`; a thin `<div>` wrapper
|
|
17
|
+
* is rendered so the container width can be measured
|
|
18
|
+
*
|
|
19
|
+
* Both hooks are always called unconditionally (React rules); whichever is not
|
|
20
|
+
* "active" receives `undefined` and returns `true` immediately.
|
|
10
21
|
*/
|
|
11
22
|
export declare const ConditionalComponent: (props: PiCardProps<ConditionalProps>) => React.ReactNode;
|