@sarunyu/system-one 4.9.36 → 4.9.37
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/AGENTS.md +18 -0
- package/llms.txt +18 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -90,6 +90,24 @@ in this package.** This file is the short version: the rules you must follow.
|
|
|
90
90
|
share one `const body = …` between the two branches. See the `LoginSheet`
|
|
91
91
|
recipe in `llms.txt`.
|
|
92
92
|
|
|
93
|
+
8. **`<BottomSheet>` MUST use the lazy-mount pattern.** Vaul mounts its portal
|
|
94
|
+
immediately when `<BottomSheet>` enters the React tree — even with
|
|
95
|
+
`open={false}`. Always guard with an `everOpened` flag so the component
|
|
96
|
+
never mounts until the user first opens it.
|
|
97
|
+
```tsx
|
|
98
|
+
// button-triggered
|
|
99
|
+
const [everOpened, setEverOpened] = useState(false);
|
|
100
|
+
const [open, setOpen] = useState(false);
|
|
101
|
+
<Button onClick={() => { setEverOpened(true); setOpen(true); }}>Open</Button>
|
|
102
|
+
{everOpened && <BottomSheet open={open} onOpenChange={setOpen}>…</BottomSheet>}
|
|
103
|
+
|
|
104
|
+
// prop-driven (receiving open from parent)
|
|
105
|
+
const [everOpened, setEverOpened] = useState(false);
|
|
106
|
+
useEffect(() => { if (open) setEverOpened(true); }, [open]);
|
|
107
|
+
if (!everOpened) return null;
|
|
108
|
+
return <BottomSheet open={open} onOpenChange={…}>…</BottomSheet>;
|
|
109
|
+
```
|
|
110
|
+
|
|
93
111
|
## Setup check
|
|
94
112
|
|
|
95
113
|
Required one-liner in the app entry (App Router: `app/layout.tsx`,
|
package/llms.txt
CHANGED
|
@@ -1124,6 +1124,24 @@ type BottomSheetRightSide = "icon" | "action" | "none";
|
|
|
1124
1124
|
- `rightSide="action"` — inline text button (e.g., "Save"), fires `onActionClick`.
|
|
1125
1125
|
- `rightSide="none"` — nothing on the right.
|
|
1126
1126
|
|
|
1127
|
+
**CRITICAL — lazy-mount pattern (always required):** Vaul mounts its portal
|
|
1128
|
+
immediately when `<BottomSheet>` enters the React tree, even with `open={false}`.
|
|
1129
|
+
Always guard with an `everOpened` flag so it never mounts until first opened.
|
|
1130
|
+
|
|
1131
|
+
```tsx
|
|
1132
|
+
// button-triggered
|
|
1133
|
+
const [everOpened, setEverOpened] = useState(false);
|
|
1134
|
+
const [open, setOpen] = useState(false);
|
|
1135
|
+
<Button onClick={() => { setEverOpened(true); setOpen(true); }}>Open</Button>
|
|
1136
|
+
{everOpened && <BottomSheet open={open} onOpenChange={setOpen}>…</BottomSheet>}
|
|
1137
|
+
|
|
1138
|
+
// prop-driven (open comes from parent)
|
|
1139
|
+
const [everOpened, setEverOpened] = useState(false);
|
|
1140
|
+
useEffect(() => { if (open) setEverOpened(true); }, [open]);
|
|
1141
|
+
if (!everOpened) return null;
|
|
1142
|
+
return <BottomSheet open={open} onOpenChange={…}>…</BottomSheet>;
|
|
1143
|
+
```
|
|
1144
|
+
|
|
1127
1145
|
`showHandle` (default `true`) shows the grab handle at the top. Hide it only
|
|
1128
1146
|
when you want a fully formal surface. Do not render a `<BottomSheet>` on desktop
|
|
1129
1147
|
layouts — use `<Modal>` instead.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarunyu/system-one",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A production-ready React design system built for AI-powered web generation tools (Figma Make, Lovable, V0). Tailwind CSS v4 + CSS custom properties for full theming support.",
|
|
6
6
|
"keywords": [
|