@sarunyu/system-one 4.9.35 → 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/llms.txt CHANGED
@@ -20,7 +20,7 @@ that uses this library. The rules are non-negotiable.
20
20
  4. **Use `@phosphor-icons/react` for all icons.** Never import from `lucide-react`
21
21
  or any other icon library. Install with `npm install @phosphor-icons/react`.
22
22
  Import named icons: `import { House, MagnifyingGlass, CaretDown } from "@phosphor-icons/react"`.
23
- Every icon accepts `size`, `weight` (`"regular"` | `"bold"` | `"fill"` | `"duotone"` | `"light"` | `"thin"`), and `className` props.
23
+ Every icon accepts `size`, `weight` (`"regular"` | `"fill"` no other weights), and `className` props.
24
24
  5. **No arbitrary bracket values for spacing / sizing / typography.**
25
25
  Use scale utilities, not pixel overrides. The library's shipped stylesheet
26
26
  only contains scale utilities + a fixed list of safelisted container widths,
@@ -41,6 +41,17 @@ that uses this library. The rules are non-negotiable.
41
41
  + Tailwind utilities (flex, grid, container, max-w-*, gap-*, p-*, mx-auto).
42
42
  The library does NOT ship layout primitives. Do not import `Page`, `Section`,
43
43
  `Stack`, `CardGrid`, `Toolbar` — they don't exist.
44
+ 7. **Dark sections use `data-theme="dark"`.** When a section has a dark background
45
+ (e.g. brand blue, charcoal, black), wrap it with `data-theme="dark"` — all
46
+ child components automatically switch to their dark-mode tokens. No props, no
47
+ variants needed.
48
+ ```tsx
49
+ <div data-theme="dark" className="bg-bg-brand-primary rounded-2xl p-8">
50
+ <Button>ติดต่อ Online Service</Button>
51
+ <p className="text-text-default-primary">อัตโนมัติ สีตาม token dark</p>
52
+ </div>
53
+ ```
54
+ Never use `class="dark"` for section-level theming — that resets the global theme.
44
55
 
45
56
  ---
46
57
 
@@ -1113,6 +1124,24 @@ type BottomSheetRightSide = "icon" | "action" | "none";
1113
1124
  - `rightSide="action"` — inline text button (e.g., "Save"), fires `onActionClick`.
1114
1125
  - `rightSide="none"` — nothing on the right.
1115
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
+
1116
1145
  `showHandle` (default `true`) shows the grab handle at the top. Hide it only
1117
1146
  when you want a fully formal surface. Do not render a `<BottomSheet>` on desktop
1118
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.35",
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": [
@@ -51,6 +51,7 @@
51
51
  "dev": "vite",
52
52
  "build": "vite build",
53
53
  "build:lib": "vite build --config vite.lib.config.ts && tailwindcss --input src/styles/globals.css --output dist/style.css --minify && node scripts/strip-layers.mjs",
54
+ "lint": "eslint src",
54
55
  "prepublishOnly": "npm run build:lib"
55
56
  },
56
57
  "dependencies": {
@@ -103,6 +104,7 @@
103
104
  "cmdk": "1.1.1",
104
105
  "date-fns": "3.6.0",
105
106
  "embla-carousel-react": "8.6.0",
107
+ "eslint": "^10.3.0",
106
108
  "input-otp": "1.4.2",
107
109
  "motion": "12.23.24",
108
110
  "next-themes": "0.4.6",
@@ -121,6 +123,7 @@
121
123
  "tailwindcss": "4.1.12",
122
124
  "tw-animate-css": "1.3.8",
123
125
  "typescript": "^6.0.2",
126
+ "typescript-eslint": "^8.59.2",
124
127
  "vite": "^6.4.2",
125
128
  "vite-plugin-dts": "^4.5.4"
126
129
  },