@finhay-pro/leaf-design-system 0.1.9 → 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/README.md +116 -35
- package/dist/calendar.css +17 -6
- package/dist/cdn/leaf-0.2.1.min.css +2 -0
- package/dist/cdn/leaf-0.2.1.min.js +9 -0
- package/dist/checkbox.css +2 -2
- package/dist/classes.css +29 -16
- package/dist/components/Calendar/Calendar.d.ts +11 -3
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +34 -8
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +3 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +3 -2
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +3 -1
- package/dist/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +3 -2
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/InputDate.d.ts +15 -4
- package/dist/components/Input/InputDate.d.ts.map +1 -1
- package/dist/components/Input/InputDate.js +39 -19
- package/dist/components/Input/InputDate.js.map +1 -1
- package/dist/components/Input/InputOtp.d.ts.map +1 -1
- package/dist/components/Input/InputOtp.js +1 -0
- package/dist/components/Input/InputOtp.js.map +1 -1
- package/dist/components/Input/InputStepper.d.ts.map +1 -1
- package/dist/components/Input/InputStepper.js +3 -2
- package/dist/components/Input/InputStepper.js.map +1 -1
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +1 -0
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Slider/Slider.d.ts.map +1 -1
- package/dist/components/Slider/Slider.js +4 -1
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +3 -2
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.js +2 -1
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/core/calendar.d.ts +8 -0
- package/dist/core/calendar.d.ts.map +1 -1
- package/dist/core/calendar.js +32 -0
- package/dist/core/calendar.js.map +1 -1
- package/dist/core/dialog.d.ts +2 -1
- package/dist/core/dialog.d.ts.map +1 -1
- package/dist/core/dialog.js +7 -7
- package/dist/core/dialog.js.map +1 -1
- package/dist/core/icons.d.ts +27 -0
- package/dist/core/icons.d.ts.map +1 -0
- package/dist/core/icons.js +29 -0
- package/dist/core/icons.js.map +1 -0
- package/dist/core/toast.d.ts +3 -13
- package/dist/core/toast.d.ts.map +1 -1
- package/dist/core/toast.js +6 -17
- package/dist/core/toast.js.map +1 -1
- package/dist/skill/leaf-design-system-0.2.1.zip +0 -0
- package/dist/styles.css +29 -16
- package/dist/toast.css +8 -6
- package/dist/toggle.css +2 -2
- package/dist/utils/RemixGlyph.d.ts +7 -0
- package/dist/utils/RemixGlyph.d.ts.map +1 -0
- package/dist/utils/RemixGlyph.js +7 -0
- package/dist/utils/RemixGlyph.js.map +1 -0
- package/package.json +8 -4
- package/dist/cdn/leaf-0.1.9.min.css +0 -2
- package/dist/cdn/leaf-0.1.9.min.js +0 -2
package/README.md
CHANGED
|
@@ -216,6 +216,35 @@ viết thêm gì cho light mode.
|
|
|
216
216
|
<html data-theme="light"></html>
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
+
## Icon
|
|
220
|
+
|
|
221
|
+
Mọi icon của Leaf là **Remix Icon** (https://remixicon.com, lưới 24px, bản `-line` / `-fill`) —
|
|
222
|
+
cả icon dựng sẵn trong component (chevron Dropdown / Calendar, check Checkbox / Toggle, close /
|
|
223
|
+
back Dialog, icon Toast…) lẫn icon app tự thêm. Leaf **không** đóng gói lại bộ icon: app dùng thẳng
|
|
224
|
+
package / CDN của Remix. Tra tên icon trên https://remixicon.com.
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
pnpm add @remixicon/react
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
```tsx
|
|
231
|
+
import { Button } from "@finhay-pro/leaf-design-system";
|
|
232
|
+
import { RiAddLine, RiHomeLine } from "@remixicon/react";
|
|
233
|
+
|
|
234
|
+
<RiHomeLine size={24} />
|
|
235
|
+
<RiHomeLine size={20} className="text-secondary" /> {/* màu = currentColor → class màu Leaf */}
|
|
236
|
+
<Button leadingIcon={<RiAddLine />}>Thêm</Button> {/* slot icon tự set size */}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
```html
|
|
240
|
+
<!-- HTML tĩnh: font CSS của Remix, size theo font-size, màu theo color -->
|
|
241
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/remixicon@4.9.1/fonts/remixicon.css" />
|
|
242
|
+
<i class="ri-home-line text-secondary"></i>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Không dùng thư viện icon khác hay tự vẽ SVG icon. Icons by [Remix Icon](https://remixicon.com)
|
|
246
|
+
(Remix Icon License v1.0 — không dùng icon làm logo / nhận diện thương hiệu).
|
|
247
|
+
|
|
219
248
|
## Cần biết
|
|
220
249
|
|
|
221
250
|
- **Class typography chỉ set đúng 3 thuộc tính** (`font-size`, `line-height`, `font-weight`);
|
|
@@ -257,9 +286,9 @@ tuyến token vào `tokens.css` / `styles.css`). Sau đó `scripts/build-cdn.mjs
|
|
|
257
286
|
`dist/cdn/leaf-<version>.min.{css,js}`. Không sửa file trong `dist`.
|
|
258
287
|
|
|
259
288
|
`build` ghi đè `dist` tại chỗ, **không xoá `dist` trước** (chỉ `prepublishOnly` mới `clean`):
|
|
260
|
-
`turbo run dev` luôn build package trước docs, và nếu `dist` biến mất dù chỉ một lúc thì
|
|
261
|
-
|
|
262
|
-
|
|
289
|
+
`turbo run dev` luôn build package trước docs, và nếu `dist` biến mất dù chỉ một lúc thì dev server
|
|
290
|
+
của docs lỗi resolve `@finhay-pro/leaf-design-system/…css`. Gặp lỗi đó: chạy lại `pnpm dev` (vẫn lỗi
|
|
291
|
+
thì xoá `apps/docs/node_modules/.vite`).
|
|
263
292
|
|
|
264
293
|
**Mọi hình thức nằm trong CSS** và chỉ đọc attribute (`data-*`, `aria-*`, `:disabled`), kể cả
|
|
265
294
|
typography của label. Component React chỉ gắn attribute, không gắn class theo prop — nhờ vậy HTML
|
|
@@ -282,27 +311,27 @@ vào bản CDN, không vào bản npm.
|
|
|
282
311
|
|
|
283
312
|
## Components
|
|
284
313
|
|
|
285
|
-
| Export | Mô tả
|
|
286
|
-
| ---------------------- |
|
|
287
|
-
| `Button` | Khung icon · label · icon — bật/tắt từng phần; `width` / `height`; `onClick` trả Promise → tự loading (spinner thay leading icon, khoá click), `loading` controlled
|
|
288
|
-
| `Tabs` | Tabs Items — `items[]` (`value` · `label: ReactNode` · `disabled`); phím ← → Home End
|
|
289
|
-
| `Dialog` | Panel + backdrop blur — `open` (controlled), `title` / `onBack` / `onClose(reason)`, `dismissible`, `closeLabel` / `backLabel`, `theme`, `maxWidth` / `height` / `maxHeight`
|
|
290
|
-
| `Logo` | Wordmark FHSC · Finhay · FHC — `brand` / `mode` / `side` / `size`
|
|
291
|
-
| `Skeleton` | Placeholder shimmer — `width` / `height` / `border` (radius), nền `--base-tertiary`
|
|
292
|
-
| `Spinner` | Indicator 8 nan — `animation` (`spin` · `fade` · `pulse` · `breathe`), `size`
|
|
293
|
-
| `Toggle` | Công tắc On/Off — `size` md/sm, `checked`, `disabled` (Figma Active Off); `name` / `value` → input ẩn cho form
|
|
294
|
-
| `Slider` | Kéo từng `step` trong `min`–`max` (mặc định 0–100, bước 1) · mốc `steps` · `labels`; `name` → input ẩn
|
|
295
|
-
| `Tooltip` | Hover/focus/Escape — `size`, `position`, `align`, `onOpenChange`; `trigger="click"`, `openDelay` / `closeDelay`, tự lật phía khi thiếu chỗ, `theme`; kèm `TooltipContent`
|
|
296
|
-
| `Radio` / `RadioGroup` | Radio đơn + nhóm — `value` / `defaultValue` / `onValueChange`, `name` cho form, `disabled`, `orientation`
|
|
297
|
-
| `Checkbox` | Checkbox — `checked` / `defaultChecked` / `onCheckedChange` (`checked="indeterminate"` cho trạng thái lưng chừng), `label`, `disabled`; input native nên đi thẳng vào `FormData`
|
|
298
|
-
| `Input` | Input dynamic — `variant` field/inline, `shape` default/pill, slot `label` · `leadingIcon` · `trailingIcon` · `action` · `message`, `invalid`, `revealPassword`; `as="button"` làm trigger
|
|
299
|
-
| `InputOtp` | Ô OTP — `length`, `mask`, dán cả mã, `onComplete`; `name` → input ẩn
|
|
300
|
-
| `InputStepper` | Nhập số với −/+ — `tone` buy/sell, `step` / `min` / `max` / `precision`, `locale`, `unit`; phím ↑ ↓, chốt khi blur/Enter
|
|
301
|
-
| `Calendar` | Lịch tháng (port từ vnsc) — chọn ngày / giờ (`showTime`, `timeOnly`), `minDate` / `maxDate` / `disablePast` / `disableFuture` / `disableDate`, luật giờ (`minHour` / `maxHour` / `minuteStep`…), `weekStartsOn`, `labels`; dùng độc lập được |
|
|
302
|
-
| `InputDate` | `Input` trigger + popover `Calendar` — `value` chốt khi bấm "Chọn" (hoặc `confirmOnSelect`), `formatDisplay`, `align`,
|
|
303
|
-
| `Toaster` / `toast` | Toast success / error / warning — `toast.success(title, { description, duration })`, `duration: -1` không tự đóng, dừng khi hover / focus, `toast.dismiss(id)`; `<Toaster position closeLabel theme />` đặt một lần; kèm `ToastContent`
|
|
304
|
-
| `Dropdown` | Chọn một giá trị — `variant` list / radio, `trigger` field / text, `appearance` filled / outlined, `size` md / sm, `openOn` click / hover, `align`, `readOnly`, `maxHeight`; option `leading` / `disabled`; phím ↑ ↓ Home End + typeahead
|
|
305
|
-
| `LanguageDropdown` | Chọn ngôn ngữ Tiếng Việt / English kèm cờ (CDN Finhay) — danh sách ở `LEAF_LANGUAGES`, `value` kiểu `LeafLanguageCode`; mặc định `size="sm"`, `openOn="hover"`, `align="end"`
|
|
314
|
+
| Export | Mô tả |
|
|
315
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
316
|
+
| `Button` | Khung icon · label · icon — bật/tắt từng phần; `width` / `height`; `onClick` trả Promise → tự loading (spinner thay leading icon, khoá click), `loading` controlled |
|
|
317
|
+
| `Tabs` | Tabs Items — `items[]` (`value` · `label: ReactNode` · `disabled`); phím ← → Home End |
|
|
318
|
+
| `Dialog` | Panel + backdrop blur — `open` (controlled), `title` / `onBack` / `onClose(reason)`, `dismissible`, `closeLabel` / `backLabel`, `theme`, `maxWidth` / `height` / `maxHeight` |
|
|
319
|
+
| `Logo` | Wordmark FHSC · Finhay · FHC — `brand` / `mode` / `side` / `size` |
|
|
320
|
+
| `Skeleton` | Placeholder shimmer — `width` / `height` / `border` (radius), nền `--base-tertiary` |
|
|
321
|
+
| `Spinner` | Indicator 8 nan — `animation` (`spin` · `fade` · `pulse` · `breathe`), `size` |
|
|
322
|
+
| `Toggle` | Công tắc On/Off — `size` md/sm, `checked`, `disabled` (Figma Active Off); `name` / `value` → input ẩn cho form |
|
|
323
|
+
| `Slider` | Kéo từng `step` trong `min`–`max` (mặc định 0–100, bước 1) · mốc `steps` · `labels`; `name` → input ẩn |
|
|
324
|
+
| `Tooltip` | Hover/focus/Escape — `size`, `position`, `align`, `onOpenChange`; `trigger="click"`, `openDelay` / `closeDelay`, tự lật phía khi thiếu chỗ, `theme`; kèm `TooltipContent` |
|
|
325
|
+
| `Radio` / `RadioGroup` | Radio đơn + nhóm — `value` / `defaultValue` / `onValueChange`, `name` cho form, `disabled`, `orientation` |
|
|
326
|
+
| `Checkbox` | Checkbox — `checked` / `defaultChecked` / `onCheckedChange` (`checked="indeterminate"` cho trạng thái lưng chừng), `label`, `disabled`; input native nên đi thẳng vào `FormData` |
|
|
327
|
+
| `Input` | Input dynamic — `variant` field/inline, `shape` default/pill, slot `label` · `leadingIcon` · `trailingIcon` · `action` · `message`, `invalid`, `revealPassword`; `as="button"` làm trigger |
|
|
328
|
+
| `InputOtp` | Ô OTP — `length`, `mask`, dán cả mã, `onComplete`; `name` → input ẩn |
|
|
329
|
+
| `InputStepper` | Nhập số với −/+ — `tone` buy/sell, `step` / `min` / `max` / `precision`, `locale`, `unit`; phím ↑ ↓, chốt khi blur/Enter |
|
|
330
|
+
| `Calendar` | Lịch tháng (port từ vnsc) — chọn ngày / giờ / tháng (`showTime`, `timeOnly`, `monthOnly`), `minDate` / `maxDate` / `disablePast` / `disableFuture` / `disableDate`, luật giờ (`minHour` / `maxHour` / `minuteStep`…), `weekStartsOn`, `labels`; dùng độc lập được |
|
|
331
|
+
| `InputDate` | `Input` trigger + popover `Calendar` — `value` chốt khi bấm "Chọn" (hoặc `confirmOnSelect`), `formatDisplay`, `align`, `monthOnly` (MM/YYYY); `name` → input ẩn ISO |
|
|
332
|
+
| `Toaster` / `toast` | Toast success / error / warning — `toast.success(title, { description, duration })`, `duration: -1` không tự đóng, dừng khi hover / focus, `toast.dismiss(id)`; `<Toaster position closeLabel theme />` đặt một lần; kèm `ToastContent` |
|
|
333
|
+
| `Dropdown` | Chọn một giá trị — `variant` list / radio, `trigger` field / text, `appearance` filled / outlined, `size` md / sm, `openOn` click / hover, `align`, `readOnly`, `maxHeight`; option `leading` / `disabled`; phím ↑ ↓ Home End + typeahead |
|
|
334
|
+
| `LanguageDropdown` | Chọn ngôn ngữ Tiếng Việt / English kèm cờ (CDN Finhay) — danh sách ở `LEAF_LANGUAGES`, `value` kiểu `LeafLanguageCode`; mặc định `size="sm"`, `openOn="hover"`, `align="end"` |
|
|
306
335
|
|
|
307
336
|
```css
|
|
308
337
|
/* Ngoài tokens.css + typography.css, mỗi component cần CSS riêng của nó
|
|
@@ -341,12 +370,13 @@ import {
|
|
|
341
370
|
Toaster,
|
|
342
371
|
toast,
|
|
343
372
|
} from "@finhay-pro/leaf-design-system";
|
|
373
|
+
import { RiAddLine, RiArrowRightLine } from "@remixicon/react";
|
|
344
374
|
|
|
345
|
-
<Button priority="primary" size="md" leadingIcon={<
|
|
375
|
+
<Button priority="primary" size="md" leadingIcon={<RiAddLine />} trailingIcon={<RiArrowRightLine />}>
|
|
346
376
|
Label
|
|
347
377
|
</Button>
|
|
348
378
|
{/* Chỉ icon → layout tròn, bắt buộc aria-label */}
|
|
349
|
-
<Button aria-label="Thêm" leadingIcon={<
|
|
379
|
+
<Button aria-label="Thêm" leadingIcon={<RiAddLine />} />
|
|
350
380
|
{/* Loading: onClick trả Promise (tự loading tới khi settle) hoặc controlled `loading` —
|
|
351
381
|
không tự nhét <Spinner> vào leadingIcon (Spinner ép màu --base-quinary, không theo màu nút) */}
|
|
352
382
|
<Button size="md" onClick={() => placeOrder()}>
|
|
@@ -378,8 +408,10 @@ Calendar / InputDate chưa có bản HTML tĩnh (chỉ React).
|
|
|
378
408
|
Layout, spacing, responsive của page viết trong CSS của page, dùng token Leaf.
|
|
379
409
|
|
|
380
410
|
```html
|
|
381
|
-
<link rel="stylesheet" href="https://<cdn>/leaf-0.1.
|
|
382
|
-
<script src="https://<cdn>/leaf-0.1.
|
|
411
|
+
<link rel="stylesheet" href="https://<cdn>/leaf-0.2.1.min.css" />
|
|
412
|
+
<script src="https://<cdn>/leaf-0.2.1.min.js" defer></script>
|
|
413
|
+
<!-- Icon: Remix Icon (xem mục Icon) -->
|
|
414
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/remixicon@4.9.1/fonts/remixicon.css" />
|
|
383
415
|
|
|
384
416
|
<style>
|
|
385
417
|
/* CSS của page — bọc trong @layer để không đè nhầm CSS component (xem "Cần biết") */
|
|
@@ -418,10 +450,11 @@ Layout, spacing, responsive của page viết trong CSS của page, dùng token
|
|
|
418
450
|
| `leaf-<version>.min.css` | `styles.css` đã minify: token + typography + color + CSS của mọi component. |
|
|
419
451
|
| `leaf-<version>.min.js` | Hành vi Button loading · Tabs · Toggle · Dialog · Slider · Tooltip · InputOtp · InputStepper · Toast · Dropdown → `window.Leaf`. Trang CSS-only có thể bỏ. |
|
|
420
452
|
|
|
421
|
-
|
|
422
|
-
cũng nằm trong package npm (`dist/cdn/`), nên jsDelivr phục vụ trực tiếp theo version:
|
|
453
|
+
Bản CDN nằm trong package npm (`dist/cdn/`), nên jsDelivr phục vụ trực tiếp theo version:
|
|
423
454
|
`https://cdn.jsdelivr.net/npm/@finhay-pro/leaf-design-system@<version>/dist/cdn/leaf-<version>.min.css`
|
|
424
|
-
(và `.min.js`)
|
|
455
|
+
(và `.min.js`) — cũng là link trên trang docs
|
|
456
|
+
[**Develop → Web**](http://leaf-design-system.finhay.local/develop/web) (`apps/docs/config/shared.ts` →
|
|
457
|
+
`leafCdn`). Trang demo đủ mọi component có bản HTML tĩnh:
|
|
425
458
|
[`examples/static.html`](examples/static.html) (mở bằng `file://` sau khi build).
|
|
426
459
|
|
|
427
460
|
`leaf.js` nạp bằng `defer` — code gọi `Leaf.*` ngay khi tải trang phải đặt trong
|
|
@@ -569,13 +602,61 @@ Chỉ CSS. Skeleton: `--leaf-skeleton-width` / `height` / `radius`. Spinner: `da
|
|
|
569
602
|
1. Bump `version` trong `packages/react/package.json`, ghi thay đổi vào [Changelog](#changelog).
|
|
570
603
|
2. `pnpm --filter @finhay-pro/leaf-design-system build` → `dist/cdn/leaf-<version>.min.css` + `.min.js`.
|
|
571
604
|
3. Đổi version trong `examples/static.html`, mở bằng `file://` để kiểm tra nhanh.
|
|
572
|
-
4.
|
|
573
|
-
|
|
574
|
-
5.
|
|
575
|
-
|
|
605
|
+
4. Publish lên npm (`pnpm publish` trong `packages/react`) — link jsDelivr của version mới chỉ
|
|
606
|
+
chạy sau bước này.
|
|
607
|
+
5. Cập nhật `leafCdnVersion` trong `apps/docs/config/shared.ts` (cùng version) và version trong
|
|
608
|
+
link CDN của `skills/leaf-design-system`. Landing đang dùng link version cũ vẫn chạy bình thường.
|
|
576
609
|
|
|
577
610
|
## Changelog
|
|
578
611
|
|
|
612
|
+
### 0.2.1
|
|
613
|
+
|
|
614
|
+
**InputDate / Calendar — chọn theo tháng**
|
|
615
|
+
|
|
616
|
+
- Thêm prop `monthOnly` cho `InputDate` và `Calendar`: panel là lưới 12 tháng (header năm trước /
|
|
617
|
+
năm / năm sau, footer "Tháng này" / "Chọn") thay cho lưới ngày. Giá trị là ngày 1 của tháng lúc
|
|
618
|
+
00:00 (giờ local); `showTime` / `timeOnly` bị bỏ qua khi có `monthOnly`.
|
|
619
|
+
- `InputDate monthOnly`: trigger + placeholder `MM/YYYY`, input ẩn (`name`) `YYYY-MM`,
|
|
620
|
+
`confirmOnSelect` chọn tháng là xác nhận.
|
|
621
|
+
- Rule ngày so theo tháng khi `monthOnly`: `minDate` / `maxDate` / `disablePast` /
|
|
622
|
+
`disableFuture` khoá cả tháng nằm ngoài khoảng, `disableDate` nhận ngày 1 của từng tháng.
|
|
623
|
+
- `CalendarLabels` thêm `thisMonth` (mặc định "Tháng này").
|
|
624
|
+
- `calendar.css`: ô tháng (`.leaf-calendar__option`) có trạng thái `data-today` / `:disabled`;
|
|
625
|
+
root `data-month-only="true"` cho ô cao 40px.
|
|
626
|
+
- Docs (Input, Calendar) và Claude skill (`input-date.md`, `calendar.md`) cập nhật ví dụ / prop.
|
|
627
|
+
- `monthOnly` chỉ có ở React — leaf.js không có Calendar / InputDate.
|
|
628
|
+
|
|
629
|
+
**Sửa lỗi**
|
|
630
|
+
|
|
631
|
+
- Dialog: hàm dọn dẹp của dialog gọi lại lần nữa (đóng 2 lần) không còn mở khoá scroll của
|
|
632
|
+
`<body>` khi dialog khác vẫn đang mở — cả React lẫn leaf.js.
|
|
633
|
+
|
|
634
|
+
**Test**
|
|
635
|
+
|
|
636
|
+
- Test chuyển ra `test/` (không nằm trong `src`): `test/unit` (giống cấu trúc `src`), `test/build`
|
|
637
|
+
(test bản build: export npm, CSS, CDN `window.Leaf`, skill zip, markup build so với source),
|
|
638
|
+
`test/helpers`. Coverage bắt buộc 100%. Chạy `pnpm verify` (cần Node ≥ 22).
|
|
639
|
+
|
|
640
|
+
### 0.2.0
|
|
641
|
+
|
|
642
|
+
**Icon — Remix Icon**
|
|
643
|
+
|
|
644
|
+
- Mọi icon dựng sẵn trong component chuyển sang Remix Icon (svg 24×24, `fill="currentColor"`):
|
|
645
|
+
chevron `Dropdown` / `Calendar` (`arrow-down-s-line`, `arrow-left-s-line`, `arrow-right-s-line`),
|
|
646
|
+
check `Checkbox` / `Toggle` (`check-line`, `subtract-line`), `Dialog` (`arrow-left-line`,
|
|
647
|
+
`close-line`), `Input` password (`eye-line` / `eye-off-line`), `InputStepper` (`subtract-line` /
|
|
648
|
+
`add-line`), `InputDate` (`calendar-line`). React và leaf.js dùng chung path
|
|
649
|
+
(`src/core/icons.ts`).
|
|
650
|
+
- `Toast`: icon status là `checkbox-circle-fill` / `close-circle-fill` / `error-warning-fill`
|
|
651
|
+
tô màu accent, **bỏ nền tròn** quanh icon (`.leaf-toast__icon` không còn padding / background).
|
|
652
|
+
Nút đóng `close-line`.
|
|
653
|
+
- Markup HTML tĩnh viết tay theo bản cũ (svg stroke) vẫn chạy, nhưng nên đổi sang svg Remix như
|
|
654
|
+
snippet trên docs để khớp nét.
|
|
655
|
+
- Icon app tự thêm: dùng `@remixicon/react` (React) / font `ri-*` (HTML tĩnh) — xem mục Icon.
|
|
656
|
+
Leaf không phụ thuộc và không đóng gói lại Remix Icon.
|
|
657
|
+
- Docs: icon của docs dùng `@remixicon/react`; snippet HTML tĩnh kèm link CSS của Remix. Claude
|
|
658
|
+
skill thêm `references/icons.md`, `check-leaf` cảnh báo thư viện icon khác / svg viết tay.
|
|
659
|
+
|
|
579
660
|
### 0.1.9
|
|
580
661
|
|
|
581
662
|
**Thay đổi hành vi** (kiểm tra nếu app đang dựa vào hành vi cũ)
|
package/dist/calendar.css
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
/* --- src/components/Calendar/calendar.css --- */
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
|
-
* Calendar — port từ vnsc Calendar (panel chọn ngày / giờ).
|
|
7
|
+
* Calendar — port từ vnsc Calendar (panel chọn ngày / giờ / tháng).
|
|
8
8
|
*
|
|
9
9
|
* Typography và màu tĩnh (nền, màu viền) là class Leaf trên markup. File này giữ khung
|
|
10
|
-
* (padding, radius, độ dày viền), layout, size cố định (panel 256, ô 28, select 64),
|
|
11
|
-
* trạng thái ngày (data-selected / data-today / :disabled), vị trí dropdown
|
|
10
|
+
* (padding, radius, độ dày viền), layout, size cố định (panel 256, ô 28, ô tháng 40, select 64),
|
|
11
|
+
* hover, trạng thái ngày / tháng (data-selected / data-today / :disabled), vị trí dropdown
|
|
12
12
|
* (data-placement), bóng đổ, reset button. Footer là `Button` (cần button.css).
|
|
13
13
|
*/
|
|
14
14
|
|
|
@@ -147,6 +147,15 @@
|
|
|
147
147
|
gap: 4px;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
/* monthOnly — lưới 12 tháng thay cho lưới ngày. */
|
|
151
|
+
.leaf-calendar[data-month-only="true"] .leaf-calendar__months-grid {
|
|
152
|
+
row-gap: 8px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.leaf-calendar[data-month-only="true"] .leaf-calendar__option {
|
|
156
|
+
height: 40px;
|
|
157
|
+
}
|
|
158
|
+
|
|
150
159
|
.leaf-calendar__weekdays,
|
|
151
160
|
.leaf-calendar__days {
|
|
152
161
|
display: grid;
|
|
@@ -188,11 +197,12 @@
|
|
|
188
197
|
}
|
|
189
198
|
|
|
190
199
|
.leaf-calendar__day:not(:disabled):not([data-selected="true"]):hover,
|
|
191
|
-
.leaf-calendar__option:not([data-selected="true"]):hover {
|
|
200
|
+
.leaf-calendar__option:not(:disabled):not([data-selected="true"]):hover {
|
|
192
201
|
background-color: var(--base-tertiary);
|
|
193
202
|
}
|
|
194
203
|
|
|
195
|
-
.leaf-calendar__day[data-today="true"]
|
|
204
|
+
.leaf-calendar__day[data-today="true"],
|
|
205
|
+
.leaf-calendar__option[data-today="true"] {
|
|
196
206
|
border-color: var(--text-highlight);
|
|
197
207
|
color: var(--text-highlight);
|
|
198
208
|
}
|
|
@@ -205,7 +215,8 @@
|
|
|
205
215
|
font-weight: var(--body-5-highlight-weight);
|
|
206
216
|
}
|
|
207
217
|
|
|
208
|
-
.leaf-calendar__day:disabled
|
|
218
|
+
.leaf-calendar__day:disabled,
|
|
219
|
+
.leaf-calendar__option:disabled {
|
|
209
220
|
border-color: transparent;
|
|
210
221
|
background-color: transparent;
|
|
211
222
|
color: var(--text-tertiary);
|