@talentlytica/prodigy 1.1.1 → 1.2.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.
package/README.md CHANGED
@@ -103,7 +103,7 @@ Pakai yarn / auto-install peers off? sebutkan peer-nya: `pnpm add @talentlytica/
103
103
 
104
104
  > **Font:** tema memakai Avenir → fallback Open Sans. Muat font pilihanmu di app konsumen (mis. `@fontsource/open-sans`, atau `<link>` Google Fonts); tanpa itu browser jatuh ke sans-serif sistem.
105
105
 
106
- > **Komponen bertanda †** (chart, date picker, dropzone, carousel, notifikasi, rich text) butuh paket ekstensi + CSS-nya sendiri, mis. `pnpm add @mantine/charts recharts` lalu `import '@mantine/charts/styles.css'`. Lihat halaman docs komponennya untuk paket persis yang diperlukan.
106
+ > **Komponen "berat"** (chart, date picker, dropzone, carousel, notifikasi, rich text) **di-import dari subpath tersendiri** (bukan barrel utama) supaya app yang tak memakainya tak menanggung `recharts`/`tiptap`/dll — mis. `import { BarChart } from '@talentlytica/prodigy/charts'`, lalu install peer + CSS-nya (`pnpm add @mantine/charts recharts` → `import '@mantine/charts/styles.css'`). Daftar lengkap "komponen → subpath + peer" ada di Storybook **Components & Imports** (ringkas juga di **Getting Started §5**).
107
107
 
108
108
  Rilis versi baru (maintainer): lihat [`RELEASING.md`](RELEASING.md).
109
109
 
@@ -111,7 +111,7 @@ Rilis versi baru (maintainer): lihat [`RELEASING.md`](RELEASING.md).
111
111
 
112
112
  1. Buat `src/components/<Nama>/<Nama>.tsx` → `export { X, type XProps } from '@mantine/core';` + JSDoc konvensi pakainya.
113
113
  2. Tambahkan default visual (jika perlu) di `src/themes/kelola.ts` via `X.extend({ defaultProps })`.
114
- 3. Daftarkan di `src/components/index.ts`.
114
+ 3. Daftarkan export-nya. **Komponen ringan** (hanya butuh `@mantine/core`): tambah di `src/components/index.ts` (barrel utama). **Komponen berat** (butuh peer ekstensi seperti `@mantine/charts`/`dates`/`tiptap`/dll): JANGAN di barrel — buat/tambah di file entry subpath (`src/<subpath>.ts`), lalu daftarkan subpath itu di `vite.lib.config.ts` (`build.lib.entry`), `package.json` (`exports` + `typesVersions`), dan tambahkan peer-nya ke `peerDependencies` (+`peerDependenciesMeta.optional`) & `rollupOptions.external`. Lihat `src/charts.ts` sebagai contoh.
115
115
  4. Buat `<Nama>.stories.tsx` (title sesuai kategori kontekstual Mantine, mis. `Buttons/…` / `Inputs/…` / `Navigation/…` — lihat daftar di atas —, `argTypes` mengikuti props Mantine — **tanpa** `tags: ['autodocs']`).
116
116
  5. Buat halaman docs `<Nama>.mdx` gaya Gamut (attach via `<Meta of={…Stories} />`; embed story lewat `<Canvas of>` + `<Controls of>`), seperti komponen lain.
117
117
 
@@ -0,0 +1 @@
1
+ export { Carousel, type CarouselProps } from './components/Carousel/Carousel';
@@ -0,0 +1,2 @@
1
+ import { Carousel as e } from "@mantine/carousel";
2
+ export { e as Carousel };
@@ -0,0 +1,2 @@
1
+ export { BarChart, type BarChartProps } from './components/BarChart/BarChart';
2
+ export { DonutChart, type DonutChartProps } from './components/DonutChart/DonutChart';
package/dist/charts.js ADDED
@@ -0,0 +1,2 @@
1
+ import { BarChart as e, DonutChart as t } from "@mantine/charts";
2
+ export { e as BarChart, t as DonutChart };
@@ -15,11 +15,8 @@ export { Checkbox, type CheckboxProps } from './Checkbox/Checkbox';
15
15
  export { Radio, type RadioProps } from './Radio/Radio';
16
16
  export { Switch, type SwitchProps } from './Switch/Switch';
17
17
  export { SegmentedControl, type SegmentedControlProps } from './SegmentedControl/SegmentedControl';
18
- export { DatePickerInput, type DatePickerInputProps } from './DatePickerInput/DatePickerInput';
19
18
  export { DateTimePicker, type DateTimePickerProps } from './DateTimePicker/DateTimePicker';
20
19
  export { DateTimeRangePicker, type DateTimeRangePickerProps } from './DateTimeRangePicker/DateTimeRangePicker';
21
- export { Dropzone, type DropzoneProps } from './Dropzone/Dropzone';
22
- export { RichTextEditor, type RichTextEditorProps } from './RichTextEditor/RichTextEditor';
23
20
  export { Anchor, type AnchorProps } from './Anchor/Anchor';
24
21
  export { Breadcrumbs, type BreadcrumbsProps } from './Breadcrumbs/Breadcrumbs';
25
22
  export { NavLink, type NavLinkProps } from './NavLink/NavLink';
@@ -36,7 +33,6 @@ export { LoadingOverlay, type LoadingOverlayProps } from './LoadingOverlay/Loadi
36
33
  export { Skeleton, type SkeletonProps } from './Skeleton/Skeleton';
37
34
  export { EmptyState, type EmptyStateProps } from './EmptyState/EmptyState';
38
35
  export { Notification, type NotificationProps } from './Notification/Notification';
39
- export { notifications, Notifications, type NotificationData, } from './NotificationsSystem/NotificationsSystem';
40
36
  export { Modal, type ModalProps } from './Modal/Modal';
41
37
  export { Popover, type PopoverProps } from './Popover/Popover';
42
38
  export { Tooltip, type TooltipProps } from './Tooltip/Tooltip';
@@ -47,13 +43,9 @@ export { ThemeIcon, type ThemeIconProps } from './ThemeIcon/ThemeIcon';
47
43
  export { Indicator, type IndicatorProps } from './Indicator/Indicator';
48
44
  export { Paper, type PaperProps } from './Paper/Paper';
49
45
  export { Table, type TableProps } from './Table/Table';
50
- export { DataTable, type DataTableProps } from './DataTable/DataTable';
51
46
  export { ColorSwatch, type ColorSwatchProps } from './ColorSwatch/ColorSwatch';
52
47
  export { Pill, type PillProps } from './Pill/Pill';
53
48
  export { Divider, type DividerProps } from './Divider/Divider';
54
49
  export { VisuallyHidden, type VisuallyHiddenProps } from './VisuallyHidden/VisuallyHidden';
55
- export { Carousel, type CarouselProps } from './Carousel/Carousel';
56
- export { BarChart, type BarChartProps } from './BarChart/BarChart';
57
- export { DonutChart, type DonutChartProps } from './DonutChart/DonutChart';
58
50
  export { AppShell, type AppShellProps } from './AppShell/AppShell';
59
51
  export * from './primitives';
@@ -0,0 +1 @@
1
+ export { DataTable, type DataTableProps } from './components/DataTable/DataTable';
@@ -0,0 +1,63 @@
1
+ import { d as e, h as t, m as n, o as r, p as i, u as a } from "./primitives-BiEY8qsh.js";
2
+ import { IconChevronDown as o, IconChevronUp as s, IconSearch as c, IconSelector as l } from "@tabler/icons-react";
3
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
4
+ import { flexRender as f, getCoreRowModel as p, getFilteredRowModel as m, getPaginationRowModel as h, getSortedRowModel as g, useReactTable as _ } from "@tanstack/react-table";
5
+ //#region src/components/DataTable/DataTable.tsx
6
+ function v({ data: v, columns: y, searchPlaceholder: b = "Cari...", pageSize: x = 10, emptyLabel: S = "Belum ada data" }) {
7
+ let C = _({
8
+ data: v,
9
+ columns: y,
10
+ getCoreRowModel: p(),
11
+ getSortedRowModel: g(),
12
+ getFilteredRowModel: m(),
13
+ getPaginationRowModel: h(),
14
+ initialState: { pagination: {
15
+ pageSize: x,
16
+ pageIndex: 0
17
+ } }
18
+ }), w = C.getRowModel().rows, T = {
19
+ asc: /* @__PURE__ */ u(s, { size: 14 }),
20
+ desc: /* @__PURE__ */ u(o, { size: 14 })
21
+ };
22
+ return /* @__PURE__ */ d(a, {
23
+ gap: "sm",
24
+ children: [
25
+ b !== void 0 && /* @__PURE__ */ u(t, {
26
+ placeholder: b,
27
+ leftSection: /* @__PURE__ */ u(c, { size: 16 }),
28
+ value: C.getState().globalFilter ?? "",
29
+ onChange: (e) => C.setGlobalFilter(e.currentTarget.value)
30
+ }),
31
+ /* @__PURE__ */ d(i, { children: [/* @__PURE__ */ u(i.Thead, { children: C.getHeaderGroups().map((e) => /* @__PURE__ */ u(i.Tr, { children: e.headers.map((e) => /* @__PURE__ */ u(i.Th, {
32
+ onClick: e.column.getToggleSortingHandler(),
33
+ style: { cursor: e.column.getCanSort() ? "pointer" : void 0 },
34
+ children: /* @__PURE__ */ d(r, {
35
+ gap: 4,
36
+ wrap: "nowrap",
37
+ children: [e.isPlaceholder ? null : f(e.column.columnDef.header, e.getContext()), e.column.getCanSort() && (T[e.column.getIsSorted()] ?? /* @__PURE__ */ u(l, {
38
+ size: 14,
39
+ opacity: .4
40
+ }))]
41
+ })
42
+ }, e.id)) }, e.id)) }), /* @__PURE__ */ u(i.Tbody, { children: w.length === 0 ? /* @__PURE__ */ u(i.Tr, { children: /* @__PURE__ */ u(i.Td, {
43
+ colSpan: y.length,
44
+ children: /* @__PURE__ */ u(e, {
45
+ ta: "center",
46
+ c: "dimmed",
47
+ py: "md",
48
+ children: S
49
+ })
50
+ }) }) : w.map((e) => /* @__PURE__ */ u(i.Tr, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ u(i.Td, { children: f(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })] }),
51
+ C.getPageCount() > 1 && /* @__PURE__ */ u(r, {
52
+ justify: "flex-end",
53
+ children: /* @__PURE__ */ u(n, {
54
+ total: C.getPageCount(),
55
+ value: C.getState().pagination.pageIndex + 1,
56
+ onChange: (e) => C.setPageIndex(e - 1)
57
+ })
58
+ })
59
+ ]
60
+ });
61
+ }
62
+ //#endregion
63
+ export { v as DataTable };
@@ -0,0 +1 @@
1
+ export { DatePickerInput, type DatePickerInputProps } from './components/DatePickerInput/DatePickerInput';
package/dist/dates.js ADDED
@@ -0,0 +1,9 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { DatePickerInput as t, DateTimePicker as n } from "@mantine/dates";
3
+ //#region src/components/DatePickerInput/DatePickerInput.tsx
4
+ function r(r) {
5
+ let { withTime: i, ...a } = r;
6
+ return e(i ? n : t, { ...a });
7
+ }
8
+ //#endregion
9
+ export { r as DatePickerInput };
@@ -0,0 +1 @@
1
+ export { Dropzone, type DropzoneProps } from './components/Dropzone/Dropzone';
@@ -0,0 +1,2 @@
1
+ import { Dropzone as e } from "@mantine/dropzone";
2
+ export { e as Dropzone };