@finhay-pro/leaf-design-system 0.2.4 → 0.2.5

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 CHANGED
@@ -375,8 +375,8 @@ vào bản CDN, không vào bản npm.
375
375
  | Export | Mô tả |
376
376
  | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
377
377
  | `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 |
378
- | `Tabs` | Tabs Items — `items[]` (`value` · `label: ReactNode` · `disabled`); phím ← → Home End |
379
- | `Dialog` | Panel + backdrop blur — `open` (controlled), `title` / `onBack` / `onClose(reason)`, `dismissible`, `closeLabel` / `backLabel`, `theme`, `maxWidth` / `height` / `maxHeight` |
378
+ | `Tabs` | Tabs Items — `items[]` (`value` · `label: ReactNode` · `disabled`), `fit`; phím ← → Home End |
379
+ | `Dialog` | Panel + backdrop blur — `open` (controlled), `title` / `onBack` / `onClose(reason)`, `dismissible`, `closeLabel` / `backLabel`, `theme`, `maxWidth` / `height` / `maxHeight`, `backgroundGradient` |
380
380
  | `Logo` | Wordmark FHSC · Finhay · FHC — `brand` / `mode` / `side` / `size` |
381
381
  | `Skeleton` | Placeholder shimmer — `width` / `height` / `border` (radius), nền `--base-tertiary` |
382
382
  | `Empty` | Trạng thái không có dữ liệu — `image` (string URL; không truyền = ẩn, `""` = CDN mặc định) · `size` sm/md · `description` (mặc định “Không có dữ liệu”) |
@@ -605,13 +605,13 @@ Layout, spacing, responsive, hover dùng Tailwind giống app React.
605
605
  ```html
606
606
  <link
607
607
  rel="stylesheet"
608
- href="https://<cdn>/leaf-0.2.4.min.css"
609
- integrity="sha384-cNx3KlySoGIvdPeUckbxadJRHEsRDiWjfoVxgJFicBHnzpq731mN6UuwdWHvdByA"
608
+ href="https://<cdn>/leaf-0.2.5.min.css"
609
+ integrity="sha384-4Y2dKd+qWT/j/vzSqisWr24T93m2BiQ1qwNzq/NE1gr1x0jresCkMQnyOheVweVW"
610
610
  crossorigin="anonymous"
611
611
  />
612
612
  <script
613
- src="https://<cdn>/leaf-0.2.4.min.js"
614
- integrity="sha384-ypImqpMbo8OFY9IT5C9bxaBRhShzoZbO9pUft1u8T0KSaU+V3BnQu29U40bRhssI"
613
+ src="https://<cdn>/leaf-0.2.5.min.js"
614
+ integrity="sha384-3mvnC8gyvSnGroVSMa3oCnAhIgzJBdUeiOiUsDM0vfs+NIANZiLocfYAetDBPb4T"
615
615
  crossorigin="anonymous"
616
616
  defer
617
617
  ></script>
@@ -860,6 +860,17 @@ overlay = `.leaf-spinner-overlay` (app tự `hidden`/mount).
860
860
 
861
861
  ## Changelog
862
862
 
863
+ ### 0.2.5
864
+
865
+ - **Sửa lỗi `Carousel`:** `slidesPerView` dạng số lấy bề rộng slide theo viewport (container query
866
+ `cqi`), không còn giãn vô hạn khi nội dung tự resize (ECharts, ảnh).
867
+ - **`Tabs`:** prop `fit` / `data-fit` — tab `title` / `functional` co theo nội dung.
868
+ - **`Table`:** `TableColumn.headerPrefix` đặt trước nhãn header (đối xứng `headerExtra`).
869
+ - **`Dialog` / `Drawer`:** prop `backgroundGradient` / `data-bg-gradient` — nền gradient phủ cả
870
+ panel; chỉ nhận `*-gradient(…)`, chặn `url(` và ký tự nguy hiểm.
871
+
872
+ Tương thích ngược với 0.2.4 — prop mới đều tuỳ chọn. Chi tiết: `CHANGELOG.md`.
873
+
863
874
  ### 0.2.4
864
875
 
865
876
  - **Hook / utils / server:** 3 entry mới `/hooks`, `/utils`, `/server` (xem "Hooks, utils & server"),
@@ -958,7 +969,8 @@ overlay = `.leaf-spinner-overlay` (app tự `hidden`/mount).
958
969
  - Bảng quản trị: lọc (`filters`, `filterFn`, `manualFilter`), sort nhiều cột (`multiSort`,
959
970
  Shift + click), phân trang (`pageSize` / `page`, `manualPagination` + `totalRows`, ghép
960
971
  `<Pagination>`), chọn dòng (`selectable`, cột checkbox ghim trái), kéo đổi vị trí cột
961
- (`reorderable`, Pointer + Alt ← →), `headerExtra` (nút lọc / menu trong header).
972
+ (`reorderable`, Pointer + Alt ← →), `headerPrefix` / `headerExtra` (icon / nút lọc / menu
973
+ trước / sau nhãn header).
962
974
  - Virtual / load thêm: `scrollSource` (`self` · `window` · `parent`), `onEndReached`,
963
975
  `loadingMore` — thuật toán JS thuần trong `core/virtual.ts`.
964
976
  - leaf.js: `setOptions`, `setRows`, `update({ [rowId]: patch })` (gộp theo frame), `getSort` /
package/dist/carousel.css CHANGED
@@ -74,22 +74,28 @@
74
74
  opacity: 0.92;
75
75
  }
76
76
 
77
+ /*
78
+ * slidesPerView dạng số: bề rộng slide tính theo viewport (container query `cqi`), không theo
79
+ * track. Track là `width: max-content` nên `%` của track phụ thuộc chính slide — nội dung tự
80
+ * resize theo khung (ECharts, ảnh) làm kích thước tính vòng tròn, slide giãn tới hàng triệu px.
81
+ * `container-type` chỉ bật khi slidesPerView là số: containment bỏ qua kích thước nội dung,
82
+ * để `auto` giữ nguyên hành vi cũ (carousel trong khung co theo nội dung).
83
+ */
84
+ .leaf-carousel[data-slides-per-view]:not([data-slides-per-view="auto"])
85
+ .leaf-carousel__viewport {
86
+ container-type: inline-size;
87
+ }
88
+
77
89
  .leaf-carousel[data-slides-per-view]:not([data-slides-per-view="auto"]) .leaf-carousel__slide {
78
90
  flex: 0 0
79
91
  calc(
80
92
  (
81
- 100% - (var(--leaf-carousel-slides-per-view) - 1) *
93
+ 100cqi - (var(--leaf-carousel-slides-per-view) - 1) *
82
94
  var(--leaf-carousel-space-between)
83
95
  ) /
84
96
  var(--leaf-carousel-slides-per-view)
85
97
  );
86
- max-width: calc(
87
- (
88
- 100% - (var(--leaf-carousel-slides-per-view) - 1) *
89
- var(--leaf-carousel-space-between)
90
- ) /
91
- var(--leaf-carousel-slides-per-view)
92
- );
98
+ min-width: 0;
93
99
  }
94
100
 
95
101
  .leaf-carousel__nav {