@starasia/admin 12.41.0 → 12.42.0

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.
@@ -47,13 +47,14 @@ interface AppLayoutProps {
47
47
  /**
48
48
  * Optional: array tombol di profile menu body. Caller bisa tambah
49
49
  * berapapun item terstruktur (Settings, Bahasa, Tema, dll). Tiap item
50
- * dirender sebagai `<MenuButton>` dengan style konsisten.
50
+ * dirender sebagai `<MenuItem>` dari `@starasia/menu` — hover, spacing,
51
+ * dan auto-close saat dipilih mengikuti komponen menu DS.
51
52
  */
52
53
  profileMenuButtons?: ProfileMenuButton[];
53
54
  /**
54
55
  * Optional: slot kustom tambahan di profile menu body (setelah
55
56
  * `profileMenuButtons`). Pakai untuk konten non-button atau item dengan
56
- * style/struktur custom. Caller compose `<MenuButton>` sendiri.
57
+ * style/struktur custom. Caller compose `<MenuItem>` sendiri.
57
58
  */
58
59
  profileMenuItems?: ReactNode;
59
60
  /**
@@ -12,16 +12,82 @@ export interface RightDrawerProps {
12
12
  style?: CSSProperties;
13
13
  children: ReactNode;
14
14
  closeButton?: CloseButton | null | false;
15
+ /**
16
+ * Padding kiri/kanan body panel. Default `true` (`lg`, sama seperti
17
+ * sebelumnya). Set `false` kalau konten mau edge-to-edge horizontal — mis.
18
+ * list/tabel yang punya padding row sendiri. Padding atas/bawah dan header
19
+ * bar tidak terpengaruh.
20
+ */
15
21
  paddingHorizontal?: boolean;
16
22
  width?: CSSProperties["width"];
17
23
  minWidth?: CSSProperties["minWidth"];
18
24
  maxWidth?: CSSProperties["maxWidth"];
25
+ hideBackdrop?: boolean;
26
+ /**
27
+ * Konten sisi kiri header bar — judul, breadcrumb, atau node apapun.
28
+ * String dibungkus otomatis jadi `<Text>`.
29
+ */
30
+ title?: ReactNode;
31
+ /**
32
+ * Aksi di sisi kanan header bar, dirender sebelum tombol resize & close.
33
+ * Mis. tombol Favorite / Ask AI / navigasi prev-next.
34
+ */
35
+ headerAction?: ReactNode;
36
+ /**
37
+ * Matikan header bar sepenuhnya (tanpa border & tanpa tombol close).
38
+ * Default `true`.
39
+ */
40
+ header?: boolean;
41
+ /**
42
+ * Preset lebar yang bisa diputar lewat tombol di header. Isi minimal 2
43
+ * nilai untuk mengaktifkannya — tombolnya muncul di sisi kanan header,
44
+ * sebelum tombol close. Preset awal diambil dari `width` kalau nilainya
45
+ * ada di daftar, kalau tidak dari elemen pertama.
46
+ *
47
+ * Butuh `header` aktif — tombolnya tinggal di header bar.
48
+ */
49
+ widthPresets?: CSSProperties["width"][];
50
+ /**
51
+ * Drag-to-resize lewat handle di tepi kiri panel. Default `true`.
52
+ * Otomatis mati di mobile (< 768px) — drag di layar sentuh bentrok dengan
53
+ * gestur swipe, dan lebar panel di sana praktis selalu penuh.
54
+ */
55
+ resizable?: boolean;
56
+ /** Lebar minimum saat di-drag, dalam px. Default `320`. */
57
+ resizeMin?: number;
58
+ /**
59
+ * Lebar maksimum saat di-drag, dalam px. Default lebar viewport
60
+ * (panel tetap di-clamp oleh CSS `max-width` milik Drawer).
61
+ */
62
+ resizeMax?: number;
63
+ /**
64
+ * Dipanggil saat lebar berubah — setelah drag selesai (bukan tiap frame)
65
+ * dan saat preset berganti. Lebarnya disimpan internal (uncontrolled);
66
+ * pakai callback ini kalau mau persist sendiri, dan beri key per konteks:
67
+ * lebar yang pas untuk drawer filter belum tentu pas untuk drawer detail.
68
+ */
69
+ onWidthChange?: (width: CSSProperties["width"]) => void;
19
70
  }
20
71
  /**
21
- * Lebar panel sekarang di-set via prop `size` milik Drawer (bukan inline
22
- * `style` + helper clamp manual). Drawer's CSS `max-width: calc(100vw - 16px)`
23
- * yang otomatis meng-clamp ke viewport, jadi tidak perlu `min(...)` lagi.
72
+ * Lebar panel di-set via prop `size` milik Drawer (bukan inline `style` +
73
+ * helper clamp manual). Drawer's CSS `max-width: calc(100vw - 16px)` yang
74
+ * otomatis meng-clamp ke viewport, jadi tidak perlu `min(...)` lagi.
24
75
  * `width`/`minWidth`/`maxWidth` dipertahankan untuk backward-compat call site.
76
+ *
77
+ * Tiga cara mengatur lebar, prioritas dari atas:
78
+ * 1. drag handle → menang selama sesi drawer terbuka
79
+ * 2. `widthPresets` → klik preset menghapus hasil drag
80
+ * 3. `width` / `maxWidth` / `minWidth` → nilai awal
81
+ *
82
+ * `paddingHorizontal` sebelumnya ada di type tapi tidak pernah dipakai —
83
+ * sekarang benar-benar mengontrol padding kiri/kanan body (default `true`,
84
+ * jadi perilaku lama tidak berubah).
85
+ *
86
+ * Header bar tingginya mengikuti `--app-header-height` supaya sejajar dengan
87
+ * header AppLayout. AppLayout mem-publish var itu ke `<html>` justru karena
88
+ * Drawer di-portal ke `document.body` — di luar subtree AppLayout, jadi var
89
+ * yang di-set di root-nya tidak terwarisi. Fallback `44px` dipakai kalau
90
+ * RightDrawer dipakai di luar AppLayout.
25
91
  */
26
92
  export declare const RightDrawer: React.ForwardRefExoticComponent<RightDrawerProps & React.RefAttributes<HTMLDivElement>>;
27
93
  export {};
@@ -27,7 +27,7 @@ export interface SidePanelProps {
27
27
  width?: number;
28
28
  /** Which edge the panel hugs (and where the toggle "ear" sits). @default 'left' */
29
29
  side?: "left" | "right";
30
- /** Distance from the top of the viewport for sticky positioning. @default '4rem' */
30
+ /** Distance from the top of the viewport for sticky positioning. @default 'var(--app-header-height, 4rem)' (AppLayout header height) */
31
31
  offsetTop?: number | string;
32
32
  /** Panel height. @default 'calc(100vh - {offsetTop})' */
33
33
  height?: number | string;
@@ -1,4 +1,15 @@
1
1
  import { default as React } from 'react';
2
2
  import { BaseRecord, TableSectionProps } from '../types';
3
3
 
4
+ /**
5
+ * Template tabel + header + footer pagination dalam satu komponen.
6
+ *
7
+ * @deprecated Digantikan oleh `<FilterBar>` + `<TableLayout>` yang memisahkan
8
+ * kontrol filter dari tabel, mendukung row selection, kolom yang bisa
9
+ * di-customize, saved views, dan layout mobile. Panduan migrasi ada di skill
10
+ * `starasia-list-page-pattern`.
11
+ *
12
+ * Masih berfungsi penuh, tapi tidak lagi menerima fitur baru dan akan dihapus
13
+ * di `@starasia/admin@13.0.0`.
14
+ */
4
15
  export declare const TableSection: <T extends BaseRecord>({ wrapperProps, dataTableProps, headerProps, footerProps }: TableSectionProps<T>) => React.JSX.Element;
@@ -1,3 +1,14 @@
1
+ /**
2
+ * ⚠️ Pattern tabel LAMA — deprecated, akan dihapus di `@starasia/admin@13.0.0`.
3
+ *
4
+ * Untuk halaman list baru pakai `<FilterBar>` + `<TableLayout>` (skill
5
+ * `starasia-list-page-pattern`). Sub-komponen di bawah (`TableWrapper`,
6
+ * `TableHeader`, `TableFooter`, `DataTable`, `ColumnFilterDropdown`) adalah
7
+ * bagian dari pattern ini dan ikut dihapus bersamanya.
8
+ *
9
+ * Catatan: `./types` masih dipakai pattern baru (mis. tipe `Pagination` yang
10
+ * di-import `FilterBar`), jadi modul tipe-nya sendiri TIDAK deprecated.
11
+ */
1
12
  export { TableSection } from './components/TableSection';
2
13
  export { TableWrapper } from './components/Wrapper';
3
14
  export { TableHeader } from './components/Header';
@@ -117,6 +117,9 @@ export type TableFooterProps = {
117
117
  showFooter?: boolean;
118
118
  totalData?: number;
119
119
  };
120
+ /**
121
+ * @deprecated Ikut `TableSection`. Pakai props `<FilterBar>` + `<TableLayout>`.
122
+ */
120
123
  export type TableSectionProps<T extends BaseRecord> = {
121
124
  headerProps?: TableHeaderProps;
122
125
  wrapperProps?: Omit<WrapperProps, 'children'>;
@@ -1,13 +1,14 @@
1
1
  import { default as React, PropsWithChildren } from 'react';
2
2
 
3
- /** Default expanded sidebar width in px (16.375rem). */
4
- export declare const SIDEBAR_DEFAULT_WIDTH = 262;
3
+ /** Default expanded sidebar width in px (15rem). */
4
+ export declare const SIDEBAR_DEFAULT_WIDTH = 240;
5
5
  /**
6
- * Smallest draggable expanded width in px. Equal to the default — the sidebar
7
- * can be dragged WIDER than its default, never narrower. (To collapse, use the
8
- * toggle or drag past the snap threshold.)
6
+ * Smallest draggable expanded width in px. Sengaja SAMA dengan
7
+ * `SIDEBAR_SNAP_COLLAPSE_THRESHOLD` di AppLayout: menyeret sampai batas ini
8
+ * masih menyisakan sidebar, sedikit lebih sempit dari itu langsung snap ke
9
+ * icon rail — tanpa zona mati di antaranya.
9
10
  */
10
- export declare const SIDEBAR_MIN_WIDTH = 262;
11
+ export declare const SIDEBAR_MIN_WIDTH = 200;
11
12
  /** Largest draggable expanded width in px. */
12
13
  export declare const SIDEBAR_MAX_WIDTH = 480;
13
14
  export interface SidebarContextValue {