@sarunyu/system-one 1.2.0 → 1.3.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/llms.txt +29 -154
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @sarunyu/system-one
|
|
2
2
|
|
|
3
|
-
React component library
|
|
3
|
+
React UI component library for AI-powered generation tools (v0, Lovable, Figma Make). Provides production-ready interactive components — you design the layouts freely, the library handles the UI primitives. Tailwind CSS v4 + CSS custom properties.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -37,9 +37,6 @@ import "@sarunyu/system-one/styles.css"
|
|
|
37
37
|
|
|
38
38
|
```tsx
|
|
39
39
|
import {
|
|
40
|
-
// Layout primitives (always use these for page structure)
|
|
41
|
-
Page, PageHeader, Section, Toolbar, CardGrid, Stack,
|
|
42
|
-
// Components
|
|
43
40
|
Button, Input, TextArea, SearchInput,
|
|
44
41
|
Dropdown, DropdownMultiple, OptionList,
|
|
45
42
|
Tag, StatusTag, Chip,
|
|
@@ -373,169 +370,47 @@ import type { ButtonVariant, ButtonSize, TagVariant, ChipSize } from "@sarunyu/s
|
|
|
373
370
|
|
|
374
371
|
---
|
|
375
372
|
|
|
376
|
-
##
|
|
373
|
+
## Design Guidance
|
|
377
374
|
|
|
378
|
-
**
|
|
375
|
+
**You own the layout. The library only provides UI components.** Design page structure, layout, and composition entirely on your own — use your best aesthetic judgment to create beautiful, polished pages. The library has no opinions about layout. It only asks that you use its components (listed below) when the UI element matches one the library provides.
|
|
379
376
|
|
|
380
|
-
### Layout
|
|
377
|
+
### Layout — full creative freedom
|
|
381
378
|
|
|
382
|
-
|
|
379
|
+
Design the layout yourself. Use any technique that produces the best result:
|
|
383
380
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
<Page width="lg"> {/* 1200px — default app pages */}
|
|
389
|
-
<Page width="xl"> {/* 1440px — dashboards */}
|
|
390
|
-
<Page width="full"> {/* no max-width */}
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
**`<PageHeader>`** — the top block of a page: title, description, and optional right-side action buttons.
|
|
394
|
-
|
|
395
|
-
```tsx
|
|
396
|
-
<PageHeader
|
|
397
|
-
title="Events"
|
|
398
|
-
description="Browse and register for upcoming events."
|
|
399
|
-
actions={<Button variant="primary" size="md">New event</Button>}
|
|
400
|
-
eyebrow={<Tag text="Live" variant="green" size="small" />}
|
|
401
|
-
/>
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
Props: `title` (required), `description`, `actions`, `eyebrow`.
|
|
405
|
-
|
|
406
|
-
**`<Section>`** — a content block with an optional heading row. Stacks heading + body with the correct gap.
|
|
381
|
+
- Flex, grid, CSS columns, absolute positioning, sticky headers, split panes, sidebars, hero sections, masonry grids, full-bleed backgrounds, overlapping elements — anything goes.
|
|
382
|
+
- Choose spacing, padding, max-widths, breakpoints, and visual hierarchy based on what looks best for the specific page. There is no prescribed spacing rhythm or container width.
|
|
383
|
+
- Prioritize aesthetics: generous whitespace, clear visual hierarchy, balanced proportions, elegant transitions and micro-interactions.
|
|
384
|
+
- Do **not** use the library's layout helper components (`Page`, `PageHeader`, `Section`, `Toolbar`, `CardGrid`, `Stack`). They exist for internal use only. Build your own layouts — they will look better.
|
|
407
385
|
|
|
408
|
-
|
|
409
|
-
<Section title="Upcoming" description="Events in the next 30 days.">
|
|
410
|
-
{/* body content */}
|
|
411
|
-
</Section>
|
|
386
|
+
### Component usage — use ours when we have it, build your own when we don't
|
|
412
387
|
|
|
413
|
-
|
|
414
|
-
<Toolbar>…</Toolbar>
|
|
415
|
-
</Section>
|
|
416
|
-
```
|
|
388
|
+
The library provides a specific set of UI components. The rule is simple:
|
|
417
389
|
|
|
418
|
-
|
|
390
|
+
**If the UI element matches a component below → use the library's component.** Do not recreate it with raw HTML or Tailwind.
|
|
419
391
|
|
|
420
|
-
|
|
392
|
+
- Buttons → `<Button>`
|
|
393
|
+
- Text inputs / textareas / search → `<Input>`, `<TextArea>`, `<SearchInput>`
|
|
394
|
+
- Single / multi select → `<Dropdown>`, `<DropdownMultiple>`, `<OptionList>`
|
|
395
|
+
- Date / time pickers → `<DateInput>`, `<TimeInput>`
|
|
396
|
+
- Labels / statuses / filters → `<Tag>`, `<StatusTag>`, `<Chip>`
|
|
397
|
+
- Tabs → `<TabGroup>`
|
|
398
|
+
- Event/content cards → `<Card>`
|
|
421
399
|
|
|
422
|
-
|
|
423
|
-
<Toolbar end={<Button variant="outline" size="md">Export</Button>}>
|
|
424
|
-
<SearchInput placeholder="Search…" value={q} onChange={setQ} className="max-w-[320px]" />
|
|
425
|
-
<Chip label="All" selected={f === "all"} onClick={() => setF("all")} />
|
|
426
|
-
<Chip label="Active" selected={f === "active"} onClick={() => setF("active")} />
|
|
427
|
-
</Toolbar>
|
|
428
|
-
```
|
|
400
|
+
**If the UI element does NOT match any component above → build it yourself.** Use Tailwind, custom components, or any other approach. Examples of things the library does NOT provide (build these yourself): modals/dialogs, sidebars/navigation, tables, accordions, tooltips, progress bars, avatars, breadcrumbs, sliders, toggles/switches, file uploads, charts, carousels, skeletons/loaders, pagination, badges (use `<Tag>` only if it semantically fits), alert/notification banners, steppers, menus, etc.
|
|
429
401
|
|
|
430
|
-
|
|
402
|
+
Pick the correct variant / prop for the semantic role (e.g. `StatusTag type="success"` for success, `Button variant="primary"` once per context). See "Design Rules" below for per-component constraints.
|
|
431
403
|
|
|
432
|
-
|
|
404
|
+
### Visual anchors from the library
|
|
433
405
|
|
|
434
|
-
|
|
435
|
-
<CardGrid cols={3}> {/* 1 → 2 → 3 columns */}
|
|
436
|
-
<CardGrid cols={2}> {/* 1 → 2 columns */}
|
|
437
|
-
<CardGrid cols={4}> {/* 1 → 2 → 3 → 4 columns */}
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
**`<Stack>`** — generic vertical/horizontal flex container. Use when you need a gap between arbitrary elements inside a `Section` body.
|
|
441
|
-
|
|
442
|
-
```tsx
|
|
443
|
-
<Stack gap={4}> {/* vertical, 16px gap */}
|
|
444
|
-
<Stack direction="row" gap={3} wrap> {/* horizontal, 12px gap, wraps */}
|
|
445
|
-
<Stack gap={6} align="center" justify="between">
|
|
446
|
-
```
|
|
447
|
-
|
|
448
|
-
Props: `direction` (`"col"` default | `"row"`), `gap` (1, 2, 3, 4, 6, 8, 10, 12 — default 4), `align`, `justify`, `wrap`.
|
|
449
|
-
|
|
450
|
-
### The required page skeleton
|
|
451
|
-
|
|
452
|
-
Every generated page must follow this shape. Replace content — keep the structure.
|
|
453
|
-
|
|
454
|
-
```tsx
|
|
455
|
-
import { Page, PageHeader, Section, Toolbar, CardGrid, Button, SearchInput, Chip, Card } from "@sarunyu/system-one";
|
|
456
|
-
|
|
457
|
-
export default function EventsPage() {
|
|
458
|
-
return (
|
|
459
|
-
<Page>
|
|
460
|
-
<PageHeader
|
|
461
|
-
title="Events"
|
|
462
|
-
description="Browse and register for upcoming events."
|
|
463
|
-
actions={<Button variant="primary" size="md">New event</Button>}
|
|
464
|
-
/>
|
|
465
|
-
|
|
466
|
-
<Toolbar>
|
|
467
|
-
<SearchInput placeholder="Search events…" value={q} onChange={setQ} className="max-w-[320px]" />
|
|
468
|
-
<Chip label="All" selected={filter === "all"} onClick={() => setFilter("all")} />
|
|
469
|
-
<Chip label="This week" selected={filter === "week"} onClick={() => setFilter("week")} />
|
|
470
|
-
</Toolbar>
|
|
471
|
-
|
|
472
|
-
<Section title="Upcoming">
|
|
473
|
-
<CardGrid cols={3}>
|
|
474
|
-
{events.map((e) => <Card key={e.id} variant="desktop" {...e} />)}
|
|
475
|
-
</CardGrid>
|
|
476
|
-
</Section>
|
|
477
|
-
</Page>
|
|
478
|
-
);
|
|
479
|
-
}
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
### Forms — use `<Stack>` inside `<Section>`
|
|
483
|
-
|
|
484
|
-
```tsx
|
|
485
|
-
<Page width="sm">
|
|
486
|
-
<PageHeader title="Sign in" description="Welcome back." />
|
|
487
|
-
<Section>
|
|
488
|
-
<Stack gap={4} className="max-w-[480px]">
|
|
489
|
-
<Input placeholder="Email" value={email} onChange={setEmail} />
|
|
490
|
-
<Input placeholder="Password" type="password" value={pw} onChange={setPw} />
|
|
491
|
-
<Stack direction="row" gap={3}>
|
|
492
|
-
<Button variant="primary" size="md">Sign in</Button>
|
|
493
|
-
<Button variant="outline" size="md">Cancel</Button>
|
|
494
|
-
</Stack>
|
|
495
|
-
</Stack>
|
|
496
|
-
</Section>
|
|
497
|
-
</Page>
|
|
498
|
-
```
|
|
499
|
-
|
|
500
|
-
### Hero section — use `<PageHeader>` + actions
|
|
501
|
-
|
|
502
|
-
Do not build a custom hero. Use `PageHeader` with `eyebrow` and `actions` — it already handles title size, description max-width, and action alignment.
|
|
503
|
-
|
|
504
|
-
```tsx
|
|
505
|
-
<Page>
|
|
506
|
-
<PageHeader
|
|
507
|
-
eyebrow={<><Tag text="LIVE" variant="green" size="small" /><Tag text="SET +0.82%" variant="lime" size="small" /></>}
|
|
508
|
-
title="ลงทุนหุ้นอย่างชาญฉลาด ด้วยข้อมูลเรียลไทม์"
|
|
509
|
-
description="ติดตามราคา วิเคราะห์เทคนิคอล รับสัญญาณซื้อขาย บนแพลตฟอร์มเดียว"
|
|
510
|
-
actions={<><Button variant="primary" size="lg">เริ่มต้นใช้งานฟรี</Button><Button variant="outline" size="lg">ดูแผนพรีเมียม</Button></>}
|
|
511
|
-
/>
|
|
512
|
-
{/* rest of page */}
|
|
513
|
-
</Page>
|
|
514
|
-
```
|
|
406
|
+
Use these tokens to keep custom elements visually coherent with the design system:
|
|
515
407
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
- **
|
|
519
|
-
- **
|
|
520
|
-
- **
|
|
521
|
-
- **
|
|
522
|
-
- **Don't** add manual spacing like `mt-8` / `mb-12` between sections — `<Page>` already provides section gap.
|
|
523
|
-
- **Don't** wrap `<Section>` in another flex container — it breaks the rhythm.
|
|
524
|
-
- **Don't** override heading sizes with utility classes — `h1`–`h4` inside these primitives are already sized.
|
|
525
|
-
- **Don't** use `max-w-*` on `<Page>` via className — use the `width` prop instead.
|
|
526
|
-
|
|
527
|
-
### Spacing scale (used internally by primitives — reference only)
|
|
528
|
-
|
|
529
|
-
| Purpose | Value |
|
|
530
|
-
|---|---|
|
|
531
|
-
| Between label and input | gap-1 / gap-2 (4–8px) |
|
|
532
|
-
| Between fields in a form | gap-4 (16px) — default `<Stack>` |
|
|
533
|
-
| Between heading and content | gap-6 (24px) — built into `<Section>` |
|
|
534
|
-
| Between top-level sections | gap-12 (48px) — built into `<Page>` |
|
|
535
|
-
| Page horizontal padding | px-6 md:px-8 — built into `<Page>` |
|
|
536
|
-
| Page vertical padding | py-10 — built into `<Page>` |
|
|
537
|
-
|
|
538
|
-
If you need a custom gap, use `<Stack gap={N}>` with a value from: 1, 2, 3, 4, 6, 8, 10, 12.
|
|
408
|
+
- **Typography** — `<h1>`–`<h4>` are pre-styled. Use them as-is.
|
|
409
|
+
- **Text color** — body text: `--foreground`. Secondary: `text-muted-foreground`. Don't hard-code hex colors.
|
|
410
|
+
- **Surfaces** — `bg-background` / `bg-card` / `bg-muted` (dark mode compatible).
|
|
411
|
+
- **Brand color** — `--primary-action`, or Tailwind `text-primary-action` / `bg-primary-action`.
|
|
412
|
+
- **Radius** — `rounded-md` (6px), `rounded-lg` (8px), `rounded-xl` (12px), `rounded-full`.
|
|
413
|
+
- **Border** — `border-border` for default borders.
|
|
539
414
|
|
|
540
415
|
---
|
|
541
416
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarunyu/system-one",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
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": [
|