@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/AGENTS.md +35 -5
- package/DESIGN.md +1 -0
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/llms.txt +30 -1
- package/package.json +4 -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`,
|
|
@@ -117,14 +135,26 @@ utilities (`p-6`, `gap-4`, `max-w-*`, etc.) win over host-written ones.
|
|
|
117
135
|
|
|
118
136
|
## Dark mode
|
|
119
137
|
|
|
120
|
-
|
|
138
|
+
**Global dark mode** — add `.dark` to `<html>`. All tokens adapt automatically.
|
|
139
|
+
|
|
140
|
+
**Section-level dark mode** — add `data-theme="dark"` to any container with a
|
|
141
|
+
dark background. All child components automatically switch to dark tokens.
|
|
142
|
+
Never use `class="dark"` for sections — that resets the entire page theme.
|
|
143
|
+
|
|
144
|
+
```tsx
|
|
145
|
+
// ✅ section on a dark background
|
|
146
|
+
<div data-theme="dark" className="bg-bg-brand-primary rounded-2xl p-8">
|
|
147
|
+
<Button>ติดต่อ Online Service</Button>
|
|
148
|
+
<p className="text-text-default-primary">สีปรับอัตโนมัติ</p>
|
|
149
|
+
</div>
|
|
150
|
+
```
|
|
121
151
|
|
|
122
152
|
## Theming
|
|
123
153
|
|
|
124
154
|
Override CSS custom properties after the stylesheet import.
|
|
125
|
-
**Both `:root` (light) and `.dark` (dark) must be overridden
|
|
126
|
-
the library hard-codes dark-mode colors in its `.dark` block,
|
|
127
|
-
override leaves dark mode unchanged.
|
|
155
|
+
**Both `:root` (light) and `.dark, [data-theme="dark"]` (dark) must be overridden
|
|
156
|
+
separately** — the library hard-codes dark-mode colors in its `.dark` block,
|
|
157
|
+
so a `:root`-only override leaves dark mode unchanged.
|
|
128
158
|
|
|
129
159
|
```css
|
|
130
160
|
:root {
|
|
@@ -134,7 +164,7 @@ override leaves dark mode unchanged.
|
|
|
134
164
|
--font-sans: "Inter", sans-serif;
|
|
135
165
|
}
|
|
136
166
|
|
|
137
|
-
.dark {
|
|
167
|
+
.dark, [data-theme="dark"] {
|
|
138
168
|
--primary-action: #a78bfa;
|
|
139
169
|
--primary-action-hover: #c4b5fd;
|
|
140
170
|
--primary-action-active: #8b5cf6;
|
package/DESIGN.md
CHANGED
|
@@ -236,6 +236,7 @@ Use sparingly. Corporate UIs prefer border separation over heavy elevation.
|
|
|
236
236
|
| Do | Don't |
|
|
237
237
|
|---|---|
|
|
238
238
|
| Use `bg-background`, `bg-card` for surfaces | Hard-code `#ffffff` or `bg-white` |
|
|
239
|
+
| Use `data-theme="dark"` on dark-background sections | Use `class="dark"` on a section (resets the whole page) |
|
|
239
240
|
| Use `text-foreground` for body text | Use `text-gray-900` or `text-black` |
|
|
240
241
|
| Use `border-border` for dividers | Use `border-gray-200` |
|
|
241
242
|
| Use `rounded` (4px) by default | Use `rounded-xl` or `rounded-2xl` on data elements |
|
package/dist/index.cjs
CHANGED
|
@@ -3068,7 +3068,7 @@ function RemovableTag({
|
|
|
3068
3068
|
react.X,
|
|
3069
3069
|
{
|
|
3070
3070
|
size: 12,
|
|
3071
|
-
weight: "
|
|
3071
|
+
weight: "regular",
|
|
3072
3072
|
color: iconColor,
|
|
3073
3073
|
className: "shrink-0"
|
|
3074
3074
|
}
|
|
@@ -3607,7 +3607,7 @@ const DropdownMultiple = React.forwardRef(
|
|
|
3607
3607
|
react.Check,
|
|
3608
3608
|
{
|
|
3609
3609
|
size: 12,
|
|
3610
|
-
weight: "
|
|
3610
|
+
weight: "regular",
|
|
3611
3611
|
className: "text-primary-action"
|
|
3612
3612
|
}
|
|
3613
3613
|
)
|
|
@@ -4250,7 +4250,7 @@ function ToastCloseButton({
|
|
|
4250
4250
|
colorClass
|
|
4251
4251
|
),
|
|
4252
4252
|
onClick: onClose,
|
|
4253
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 12, weight: "
|
|
4253
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.X, { size: 12, weight: "regular" })
|
|
4254
4254
|
}
|
|
4255
4255
|
);
|
|
4256
4256
|
}
|
|
@@ -4441,7 +4441,7 @@ const OptionList = React.forwardRef(
|
|
|
4441
4441
|
react.Check,
|
|
4442
4442
|
{
|
|
4443
4443
|
size: 16,
|
|
4444
|
-
weight: "
|
|
4444
|
+
weight: "regular",
|
|
4445
4445
|
className: "text-primary-action"
|
|
4446
4446
|
}
|
|
4447
4447
|
) })
|
|
@@ -4811,7 +4811,7 @@ const Tag = React.forwardRef(function Tag2({
|
|
|
4811
4811
|
className: cn(
|
|
4812
4812
|
"inline-flex items-center justify-center rounded-[2px] transition-colors",
|
|
4813
4813
|
s.closeButton,
|
|
4814
|
-
!isDisabled && "cursor-pointer hover:bg-black/10"
|
|
4814
|
+
!isDisabled && "cursor-pointer hover:bg-black/10 dark:hover:bg-white/10"
|
|
4815
4815
|
),
|
|
4816
4816
|
children: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon, { disabled: isDisabled, className: s.closeIcon })
|
|
4817
4817
|
}
|
|
@@ -4889,7 +4889,7 @@ function StickyShadowEdge({ direction }) {
|
|
|
4889
4889
|
"aria-hidden": "true",
|
|
4890
4890
|
className: "pointer-events-none absolute inset-y-0 left-[-10px] w-2.5",
|
|
4891
4891
|
style: {
|
|
4892
|
-
background: "linear-gradient(90deg, rgba(
|
|
4892
|
+
background: "linear-gradient(90deg, rgba(var(--scroll-shadow-rgb),0.00) 0%, rgba(var(--scroll-shadow-rgb),0.03) 55%, rgba(var(--scroll-shadow-rgb),0.08) 100%)"
|
|
4893
4893
|
}
|
|
4894
4894
|
}
|
|
4895
4895
|
);
|
|
@@ -4900,7 +4900,7 @@ function StickyShadowEdge({ direction }) {
|
|
|
4900
4900
|
"aria-hidden": "true",
|
|
4901
4901
|
className: "pointer-events-none absolute inset-y-0 right-[-10px] w-2.5",
|
|
4902
4902
|
style: {
|
|
4903
|
-
background: "linear-gradient(90deg, rgba(
|
|
4903
|
+
background: "linear-gradient(90deg, rgba(var(--scroll-shadow-rgb),0.08) 0%, rgba(var(--scroll-shadow-rgb),0.03) 45%, rgba(var(--scroll-shadow-rgb),0.00) 100%)"
|
|
4904
4904
|
}
|
|
4905
4905
|
}
|
|
4906
4906
|
);
|
|
@@ -6180,7 +6180,7 @@ function PaginationBanner({
|
|
|
6180
6180
|
onClick: () => onIndexChange == null ? void 0 : onIndexChange(i),
|
|
6181
6181
|
className: cn(
|
|
6182
6182
|
"h-1.5 rounded-[12px] transition-all duration-200",
|
|
6183
|
-
i === activeIndex ? "w-8 bg-bg-brand" : "w-1.5 bg-black/10 hover:bg-black/20"
|
|
6183
|
+
i === activeIndex ? "w-8 bg-bg-brand" : "w-1.5 bg-black/10 dark:bg-white/10 hover:bg-black/20 dark:hover:bg-white/20"
|
|
6184
6184
|
)
|
|
6185
6185
|
},
|
|
6186
6186
|
i
|
|
@@ -6205,7 +6205,7 @@ function PaginationCarousel({
|
|
|
6205
6205
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6206
6206
|
"div",
|
|
6207
6207
|
{
|
|
6208
|
-
className: "relative h-1.5 overflow-hidden rounded-[48px] bg-black/10",
|
|
6208
|
+
className: "relative h-1.5 overflow-hidden rounded-[48px] bg-black/10 dark:bg-white/10",
|
|
6209
6209
|
style: { width: trackWidth },
|
|
6210
6210
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6211
6211
|
"div",
|