ppij-design-system 0.0.0-stage → 0.3.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.
Files changed (151) hide show
  1. package/dist/banners.d.ts +31 -0
  2. package/dist/banners.js +18 -0
  3. package/dist/card-themes.d.ts +14 -0
  4. package/dist/card-themes.js +325 -0
  5. package/dist/components/account-menu.d.ts +24 -0
  6. package/dist/components/account-menu.js +13 -0
  7. package/dist/components/admin-drawer.d.ts +40 -0
  8. package/dist/components/admin-drawer.js +35 -0
  9. package/dist/components/alert-dialog.d.ts +16 -0
  10. package/dist/components/alert-dialog.js +39 -0
  11. package/dist/components/alert.d.ts +11 -0
  12. package/dist/components/alert.js +29 -0
  13. package/dist/components/avatar.d.ts +11 -0
  14. package/dist/components/avatar.js +22 -0
  15. package/dist/components/badge.d.ts +9 -0
  16. package/dist/components/badge.js +27 -0
  17. package/dist/components/banner-carousel.d.ts +14 -0
  18. package/dist/components/banner-carousel.js +90 -0
  19. package/dist/components/bottom-bar.d.ts +22 -0
  20. package/dist/components/bottom-bar.js +12 -0
  21. package/dist/components/button.d.ts +10 -0
  22. package/dist/components/button.js +37 -0
  23. package/dist/components/card-upload.d.ts +30 -0
  24. package/dist/components/card-upload.js +19 -0
  25. package/dist/components/card.d.ts +9 -0
  26. package/dist/components/card.js +24 -0
  27. package/dist/components/checkbox.d.ts +4 -0
  28. package/dist/components/checkbox.js +9 -0
  29. package/dist/components/data-table.d.ts +26 -0
  30. package/dist/components/data-table.js +17 -0
  31. package/dist/components/dialog.d.ts +17 -0
  32. package/dist/components/dialog.js +37 -0
  33. package/dist/components/drawer.d.ts +13 -0
  34. package/dist/components/drawer.js +34 -0
  35. package/dist/components/dropdown-menu.d.ts +25 -0
  36. package/dist/components/dropdown-menu.js +50 -0
  37. package/dist/components/editable-panel.d.ts +25 -0
  38. package/dist/components/editable-panel.js +18 -0
  39. package/dist/components/empty.d.ts +12 -0
  40. package/dist/components/empty.js +33 -0
  41. package/dist/components/file-upload.d.ts +28 -0
  42. package/dist/components/file-upload.js +21 -0
  43. package/dist/components/form-panel.d.ts +15 -0
  44. package/dist/components/form-panel.js +9 -0
  45. package/dist/components/funding-picker.d.ts +20 -0
  46. package/dist/components/funding-picker.js +16 -0
  47. package/dist/components/input.d.ts +3 -0
  48. package/dist/components/input.js +6 -0
  49. package/dist/components/invitation-card.d.ts +14 -0
  50. package/dist/components/invitation-card.js +13 -0
  51. package/dist/components/label.d.ts +4 -0
  52. package/dist/components/label.js +7 -0
  53. package/dist/components/member-card-block.d.ts +47 -0
  54. package/dist/components/member-card-block.js +329 -0
  55. package/dist/components/member-card.css +92 -0
  56. package/dist/components/member-card.d.ts +29 -0
  57. package/dist/components/member-card.js +22 -0
  58. package/dist/components/month-picker.d.ts +16 -0
  59. package/dist/components/month-picker.js +19 -0
  60. package/dist/components/offline-banner.d.ts +14 -0
  61. package/dist/components/offline-banner.js +14 -0
  62. package/dist/components/page-header.d.ts +14 -0
  63. package/dist/components/page-header.js +10 -0
  64. package/dist/components/phone-field.d.ts +25 -0
  65. package/dist/components/phone-field.js +64 -0
  66. package/dist/components/pill-radio.d.ts +21 -0
  67. package/dist/components/pill-radio.js +15 -0
  68. package/dist/components/portal-shell.d.ts +53 -0
  69. package/dist/components/portal-shell.js +19 -0
  70. package/dist/components/postcode-field.d.ts +26 -0
  71. package/dist/components/postcode-field.js +14 -0
  72. package/dist/components/progress.d.ts +4 -0
  73. package/dist/components/progress.js +8 -0
  74. package/dist/components/radio-group.d.ts +5 -0
  75. package/dist/components/radio-group.js +11 -0
  76. package/dist/components/review-panel.d.ts +20 -0
  77. package/dist/components/review-panel.js +14 -0
  78. package/dist/components/saving-indicator.d.ts +15 -0
  79. package/dist/components/saving-indicator.js +19 -0
  80. package/dist/components/scroll-area.d.ts +5 -0
  81. package/dist/components/scroll-area.js +13 -0
  82. package/dist/components/search-filter.d.ts +39 -0
  83. package/dist/components/search-filter.js +19 -0
  84. package/dist/components/segmented-progress.d.ts +16 -0
  85. package/dist/components/segmented-progress.js +12 -0
  86. package/dist/components/select.d.ts +15 -0
  87. package/dist/components/select.js +38 -0
  88. package/dist/components/separator.d.ts +4 -0
  89. package/dist/components/separator.js +7 -0
  90. package/dist/components/service-tiles.d.ts +26 -0
  91. package/dist/components/service-tiles.js +17 -0
  92. package/dist/components/sheet.d.ts +14 -0
  93. package/dist/components/sheet.js +40 -0
  94. package/dist/components/sidebar.d.ts +69 -0
  95. package/dist/components/sidebar.js +210 -0
  96. package/dist/components/skeleton.d.ts +11 -0
  97. package/dist/components/skeleton.js +11 -0
  98. package/dist/components/sonner.d.ts +9 -0
  99. package/dist/components/sonner.js +25 -0
  100. package/dist/components/spinner.d.ts +14 -0
  101. package/dist/components/spinner.js +22 -0
  102. package/dist/components/stat-card.d.ts +22 -0
  103. package/dist/components/stat-card.js +12 -0
  104. package/dist/components/status-card.d.ts +24 -0
  105. package/dist/components/status-card.js +26 -0
  106. package/dist/components/stepper.d.ts +25 -0
  107. package/dist/components/stepper.js +23 -0
  108. package/dist/components/submit-overlay.d.ts +16 -0
  109. package/dist/components/submit-overlay.js +15 -0
  110. package/dist/components/suggestion-sheet.d.ts +20 -0
  111. package/dist/components/suggestion-sheet.js +36 -0
  112. package/dist/components/switch.d.ts +6 -0
  113. package/dist/components/switch.js +8 -0
  114. package/dist/components/table.d.ts +10 -0
  115. package/dist/components/table.js +28 -0
  116. package/dist/components/tabs.d.ts +11 -0
  117. package/dist/components/tabs.js +28 -0
  118. package/dist/components/tag-input.d.ts +15 -0
  119. package/dist/components/tag-input.js +31 -0
  120. package/dist/components/textarea.d.ts +3 -0
  121. package/dist/components/textarea.js +6 -0
  122. package/dist/components/timeline.d.ts +18 -0
  123. package/dist/components/timeline.js +11 -0
  124. package/dist/components/todo-strip.d.ts +14 -0
  125. package/dist/components/todo-strip.js +11 -0
  126. package/dist/components/tooltip.d.ts +7 -0
  127. package/dist/components/tooltip.js +16 -0
  128. package/dist/components/top-bar.d.ts +23 -0
  129. package/dist/components/top-bar.js +14 -0
  130. package/dist/components/type-ahead.d.ts +20 -0
  131. package/dist/components/type-ahead.js +22 -0
  132. package/dist/components/unit-card.d.ts +26 -0
  133. package/dist/components/unit-card.js +18 -0
  134. package/dist/components/view-toggle.d.ts +20 -0
  135. package/dist/components/view-toggle.js +15 -0
  136. package/dist/components/wizard-footer.d.ts +24 -0
  137. package/dist/components/wizard-footer.js +17 -0
  138. package/dist/components/wizard-header.d.ts +29 -0
  139. package/dist/components/wizard-header.js +18 -0
  140. package/dist/hooks/use-mobile.d.ts +1 -0
  141. package/dist/hooks/use-mobile.js +11 -0
  142. package/dist/index.d.ts +70 -0
  143. package/dist/index.js +70 -0
  144. package/dist/lib/utils.d.ts +2 -0
  145. package/dist/lib/utils.js +5 -0
  146. package/dist/sample-banners.d.ts +8 -0
  147. package/dist/sample-banners.js +28 -0
  148. package/dist/tokens.css +119 -0
  149. package/dist/tokens.json +50 -0
  150. package/package.json +60 -4
  151. package/README.md +0 -3
@@ -0,0 +1,25 @@
1
+ export interface EditablePanelProps {
2
+ title: string;
3
+ /** One line on how this panel behaves: what updates directly, or what is reviewed. */
4
+ description?: string;
5
+ /** A change proposal for this panel is waiting for review: shows the pending badge. */
6
+ pending?: boolean;
7
+ pendingLabel?: string;
8
+ onEdit: () => void;
9
+ editLabel?: string;
10
+ /** A pending-proposal block (for example an Alert listing the proposed values), shown under the read values. */
11
+ proposal?: React.ReactNode;
12
+ /** The read view: committed values as text. */
13
+ children: React.ReactNode;
14
+ }
15
+ /**
16
+ * The standard editable surface of the portal: a read-first panel.
17
+ * The panel only ever reads: title, one behaviour line, committed
18
+ * values as text, and an Edit action. Editing itself happens in
19
+ * the AdminDrawer (a right drawer on desktop, a bottom sheet on
20
+ * the phone), one panel at a time; the page owns the drawer.
21
+ * Reviewed changes leave a proposal block inside the panel with a
22
+ * Menunggu badge while the current values stay in effect. This is
23
+ * the profile pattern; every editable surface follows it.
24
+ */
25
+ export declare function EditablePanel({ title, description, pending, pendingLabel, onEdit, editLabel, proposal, children }: EditablePanelProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconPencil } from "@tabler/icons-react";
3
+ import { Badge } from "./badge";
4
+ import { Button } from "./button";
5
+ import { Card } from "./card";
6
+ /**
7
+ * The standard editable surface of the portal: a read-first panel.
8
+ * The panel only ever reads: title, one behaviour line, committed
9
+ * values as text, and an Edit action. Editing itself happens in
10
+ * the AdminDrawer (a right drawer on desktop, a bottom sheet on
11
+ * the phone), one panel at a time; the page owns the drawer.
12
+ * Reviewed changes leave a proposal block inside the panel with a
13
+ * Menunggu badge while the current values stay in effect. This is
14
+ * the profile pattern; every editable surface follows it.
15
+ */
16
+ export function EditablePanel({ title, description, pending = false, pendingLabel = "Menunggu", onEdit, editLabel = "Edit", proposal, children }) {
17
+ return (_jsxs(Card, { className: "gap-0 rounded-xl border border-brand-border bg-card py-0", children: [_jsxs("div", { className: "flex flex-row items-start justify-between gap-3 px-5 pt-5 pb-4", children: [_jsxs("div", { className: "grid min-w-0 gap-1.5", children: [_jsx("h2", { className: "text-base leading-6 font-bold text-brand-ink", children: title }), description ? _jsx("p", { className: "text-sm leading-5 text-brand-muted", children: description }) : null] }), pending ? _jsx(Badge, { variant: "outline", className: "shrink-0", children: pendingLabel }) : null] }), _jsxs("div", { className: "grid gap-4 px-5 pb-5", children: [children, proposal, _jsx("div", { className: "flex justify-end border-t border-brand-border pt-4", children: _jsxs(Button, { type: "button", variant: "outline", onClick: onEdit, children: [_jsx(IconPencil, { "aria-hidden": "true" }), editLabel] }) })] })] }));
18
+ }
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare function Empty({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
4
+ declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
5
+ declare const emptyMediaVariants: (props?: ({
6
+ variant?: "default" | "icon" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function EmptyMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>): React.JSX.Element;
9
+ declare function EmptyTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function EmptyDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
11
+ declare function EmptyContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia };
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "../lib/utils";
4
+ function Empty({ className, ...props }) {
5
+ return (_jsx("div", { "data-slot": "empty", className: cn("flex min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-lg border border-dashed border-brand-border bg-card p-10 text-center text-balance", className), ...props }));
6
+ }
7
+ function EmptyHeader({ className, ...props }) {
8
+ return (_jsx("div", { "data-slot": "empty-header", className: cn("flex max-w-sm flex-col items-center gap-2 text-center", className), ...props }));
9
+ }
10
+ const emptyMediaVariants = cva("flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", {
11
+ variants: {
12
+ variant: {
13
+ default: "bg-transparent [&_svg]:size-10 [&_svg]:text-brand-muted",
14
+ icon: "flex size-12 rounded-full bg-secondary text-brand-ink [&_svg]:size-6",
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: "default",
19
+ },
20
+ });
21
+ function EmptyMedia({ className, variant = "default", ...props }) {
22
+ return (_jsx("div", { "data-slot": "empty-icon", "data-variant": variant, className: cn(emptyMediaVariants({ variant, className })), ...props }));
23
+ }
24
+ function EmptyTitle({ className, ...props }) {
25
+ return (_jsx("div", { "data-slot": "empty-title", className: cn("text-base font-semibold tracking-tight text-brand-ink", className), ...props }));
26
+ }
27
+ function EmptyDescription({ className, ...props }) {
28
+ return (_jsx("p", { "data-slot": "empty-description", className: cn("text-sm text-brand-muted [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), ...props }));
29
+ }
30
+ function EmptyContent({ className, ...props }) {
31
+ return (_jsx("div", { "data-slot": "empty-content", className: cn("flex w-full max-w-sm min-w-0 flex-col items-center gap-3 text-sm text-balance", className), ...props }));
32
+ }
33
+ export { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia };
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ export type FileUploadStatus = "empty" | "uploading" | "done" | "error";
3
+ export interface FileUploadProps {
4
+ /** Field label, for example "Foto kartu anggota". */
5
+ label: string;
6
+ /** One quiet line of guidance: accepted formats and maximum size. */
7
+ hint?: string;
8
+ accept?: string;
9
+ status: FileUploadStatus;
10
+ /** Name of the chosen file, shown in the done and error states. */
11
+ fileName?: string;
12
+ /** Upload progress from 0 to 100, shown in the uploading state. */
13
+ progress?: number;
14
+ /** Error message shown in the error state. */
15
+ errorText?: string;
16
+ /** Called with the file the person picked. */
17
+ onPick: (file: File) => void;
18
+ /** Called when the person removes the chosen file. */
19
+ onRemove?: () => void;
20
+ className?: string;
21
+ }
22
+ /**
23
+ * One file field with its states designed: empty dropzone, uploading
24
+ * with progress, done with the file name and a remove action, error
25
+ * with the reason. The page owns the actual upload; this component
26
+ * renders whichever state the page reports.
27
+ */
28
+ export declare function FileUpload({ label, hint, accept, status, fileName, progress, errorText, onPick, onRemove, className }: FileUploadProps): React.JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { IconUpload, IconX, IconFileCheck, IconLoader2, IconAlertTriangle } from "@tabler/icons-react";
4
+ import { cn } from "../lib/utils";
5
+ import { Button } from "./button";
6
+ /**
7
+ * One file field with its states designed: empty dropzone, uploading
8
+ * with progress, done with the file name and a remove action, error
9
+ * with the reason. The page owns the actual upload; this component
10
+ * renders whichever state the page reports.
11
+ */
12
+ export function FileUpload({ label, hint, accept, status, fileName, progress = 0, errorText, onPick, onRemove, className }) {
13
+ const inputRef = React.useRef(null);
14
+ const openPicker = () => inputRef.current?.click();
15
+ return (_jsxs("div", { className: cn("grid gap-2", className), children: [_jsx("span", { className: "text-sm font-medium", children: label }), _jsx("input", { ref: inputRef, type: "file", accept: accept, className: "hidden", onChange: (event) => {
16
+ const file = event.target.files?.[0];
17
+ if (file)
18
+ onPick(file);
19
+ event.target.value = "";
20
+ } }), status === "empty" && (_jsxs("button", { type: "button", onClick: openPicker, className: "grid justify-items-center gap-2 rounded-lg border border-dashed border-input bg-card px-4 py-6 text-center outline-none transition-colors hover:border-brand-red/50 focus-visible:ring-2 focus-visible:ring-ring", children: [_jsx("span", { className: "flex size-10 items-center justify-center rounded-full bg-secondary text-muted-foreground", children: _jsx(IconUpload, { className: "size-5" }) }), _jsx("span", { className: "text-sm font-medium text-brand-ink", children: "Pilih berkas atau jatuhkan di sini" }), hint && _jsx("span", { className: "text-xs text-muted-foreground", children: hint })] })), status === "uploading" && (_jsxs("div", { className: "grid gap-2 rounded-lg border bg-card px-4 py-4", children: [_jsxs("div", { className: "flex items-center gap-2 text-sm", children: [_jsx(IconLoader2, { className: "size-4 animate-spin text-muted-foreground" }), _jsx("span", { className: "font-medium", children: fileName }), _jsxs("span", { className: "ml-auto text-muted-foreground", children: [progress, "%"] })] }), _jsx("div", { className: "h-1.5 overflow-hidden rounded-full bg-secondary", children: _jsx("div", { className: "h-full rounded-full bg-brand-red transition-all", style: { width: progress + "%" } }) })] })), status === "done" && (_jsxs("div", { className: "flex items-center gap-3 rounded-lg border bg-card px-4 py-3", children: [_jsx("span", { className: "flex size-9 items-center justify-center rounded-md bg-success/10 text-success", children: _jsx(IconFileCheck, { className: "size-5" }) }), _jsxs("div", { className: "grid min-w-0", children: [_jsx("span", { className: "truncate text-sm font-medium", children: fileName }), _jsx("span", { className: "text-xs text-muted-foreground", children: "Terunggah" })] }), onRemove && (_jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", className: "ml-auto", onClick: onRemove, "aria-label": "Hapus berkas", children: _jsx(IconX, {}) }))] })), status === "error" && (_jsx("div", { className: "grid gap-2", children: _jsxs("div", { className: "flex items-center gap-3 rounded-lg border border-destructive/40 bg-card px-4 py-3", children: [_jsx("span", { className: "flex size-9 items-center justify-center rounded-md bg-destructive/10 text-destructive", children: _jsx(IconAlertTriangle, { className: "size-5" }) }), _jsxs("div", { className: "grid min-w-0", children: [_jsx("span", { className: "truncate text-sm font-medium", children: fileName }), _jsx("span", { className: "text-xs text-destructive", children: errorText ?? "Unggahan gagal. Coba lagi." })] }), _jsx(Button, { type: "button", variant: "outline", size: "sm", className: "ml-auto", onClick: openPicker, children: "Coba lagi" })] }) }))] }));
21
+ }
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ type FormPanelProps = {
3
+ title: string;
4
+ description?: string;
5
+ children: React.ReactNode;
6
+ footer?: React.ReactNode;
7
+ className?: string;
8
+ /**
9
+ * Element for the panel title. "div" (default) keeps step pages to their single h1; review
10
+ * screens pass "h2" so each section is a navigable heading.
11
+ */
12
+ titleAs?: "div" | "h2";
13
+ };
14
+ export declare function FormPanel({ title, description, children, footer, className, titleAs }: FormPanelProps): React.JSX.Element;
15
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils";
3
+ import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card";
4
+ export function FormPanel({ title, description, children, footer, className, titleAs = "div" }) {
5
+ const titleNode = titleAs === "h2"
6
+ ? _jsx(CardTitle, { children: _jsx("h2", { className: "text-base leading-snug font-semibold", children: title }) })
7
+ : _jsx(CardTitle, { children: title });
8
+ return (_jsxs(Card, { className: cn("bg-card py-4 shadow-none sm:py-6", className), children: [_jsxs(CardHeader, { className: "px-4 sm:px-6", children: [titleNode, description ? _jsx(CardDescription, { children: description }) : null] }), _jsx(CardContent, { className: "px-4 sm:px-6", children: children }), footer ? _jsx(CardFooter, { className: "px-4 sm:px-6", children: footer }) : null] }));
9
+ }
@@ -0,0 +1,20 @@
1
+ export interface FundingPickerProps {
2
+ /** Picked funding sources, as display labels. */
3
+ values: string[];
4
+ onChange: (values: string[]) => void;
5
+ /** Catalogue entries offered as one-tap suggestions; the lookup stays in the application. */
6
+ options: string[];
7
+ /** The wizard caps funding at 3 sources (MAX_FUNDING). */
8
+ max?: number;
9
+ placeholder?: string;
10
+ maxMessage?: string;
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Funding source picker, extracted from the wizard FundingPicker:
15
+ * the minat-style multi-pick (chips in the field, catalogue
16
+ * suggestions under it, custom entries allowed) with the funding
17
+ * cap applied. The catalogue itself arrives as props; searching
18
+ * and suggesting new sources stay in the application.
19
+ */
20
+ export declare function FundingPicker({ values, onChange, options, max, placeholder, maxMessage, className, }: FundingPickerProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { TagInput } from "./tag-input";
3
+ /**
4
+ * Funding source picker, extracted from the wizard FundingPicker:
5
+ * the minat-style multi-pick (chips in the field, catalogue
6
+ * suggestions under it, custom entries allowed) with the funding
7
+ * cap applied. The catalogue itself arrives as props; searching
8
+ * and suggesting new sources stay in the application.
9
+ */
10
+ export function FundingPicker({ values, onChange, options, max = 3, placeholder = "Cari atau ketik sumber pendanaan", maxMessage, className, }) {
11
+ const reachedMax = values.length >= max;
12
+ return (_jsxs("div", { className: className, children: [_jsx(TagInput, { values: values, onChange: (next) => {
13
+ if (next.length <= max)
14
+ onChange(next);
15
+ }, suggestions: reachedMax ? [] : options.filter((option) => !values.includes(option)), placeholder: reachedMax ? "" : placeholder }), reachedMax && (_jsx("p", { role: "status", className: "mt-2 text-sm text-brand-muted", children: maxMessage ?? `Maksimal ${max} sumber pendanaan.` }))] }));
16
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
3
+ export { Input };
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils";
3
+ function Input({ className, type, ...props }) {
4
+ return (_jsx("input", { type: type, "data-slot": "input", className: cn("h-9 w-full min-w-0 data-[size=sm]:h-8 data-[size=lg]:h-11 rounded-md border border-input bg-card px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className), ...props }));
5
+ }
6
+ export { Input };
@@ -0,0 +1,14 @@
1
+ export interface InvitationCardProps {
2
+ heading: string;
3
+ body: string;
4
+ actionLabel: string;
5
+ href: string;
6
+ }
7
+ /**
8
+ * The Beranda role-invitation card, extracted exactly from
9
+ * ppij-identity-sso Beranda.tsx (the me.invitation element): spans
10
+ * both columns, heading, one body line (the app composes it from
11
+ * role, unit, and the invitation end date), and an outline action.
12
+ * Real copy: heading "Undangan peran", action "Lihat undangan".
13
+ */
14
+ export declare function InvitationCard({ heading, body, actionLabel, href }: InvitationCardProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "./button";
3
+ import { Card } from "./card";
4
+ /**
5
+ * The Beranda role-invitation card, extracted exactly from
6
+ * ppij-identity-sso Beranda.tsx (the me.invitation element): spans
7
+ * both columns, heading, one body line (the app composes it from
8
+ * role, unit, and the invitation end date), and an outline action.
9
+ * Real copy: heading "Undangan peran", action "Lihat undangan".
10
+ */
11
+ export function InvitationCard({ heading, body, actionLabel, href }) {
12
+ return (_jsxs(Card, { className: "gap-3 rounded-xl border border-brand-border bg-card py-5 md:col-span-2", children: [_jsxs("div", { className: "px-5", children: [_jsx("h2", { className: "font-bold text-brand-ink", children: heading }), _jsx("p", { className: "mt-1 text-sm text-brand-muted", children: body })] }), _jsx("div", { className: "px-5", children: _jsx(Button, { asChild: true, variant: "outline", className: "min-h-11 px-5", children: _jsx("a", { href: href, children: actionLabel }) }) })] }));
13
+ }
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Label as LabelPrimitive } from "radix-ui";
3
+ declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
4
+ export { Label };
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils";
3
+ import { Label as LabelPrimitive } from "radix-ui";
4
+ function Label({ className, ...props }) {
5
+ return (_jsx(LabelPrimitive.Root, { "data-slot": "label", className: cn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", className), ...props }));
6
+ }
7
+ export { Label };
@@ -0,0 +1,47 @@
1
+ import "./member-card.css";
2
+ /**
3
+ * The member card block, ported exactly from ppij-identity-sso
4
+ * portal/MemberCard.tsx (design in member-card.css, themes in
5
+ * ../card-themes.ts). Adaptations for the design system are seams
6
+ * only: membership fields arrive as flat props, the card logo and
7
+ * back map are src props, copy comes from the locale label maps
8
+ * below (the app's i18n strings, verbatim), and theme persistence
9
+ * goes through the CardThemePreference seam (an in-memory store by
10
+ * default; the app passes its preference API).
11
+ */
12
+ export type MemberCardState = "active" | "expiring" | "change_pending" | "expired_grace" | "expired" | "suspended";
13
+ /** Where the theme choice persists. Production uses the member preference API; the harness substitutes a simulated store. */
14
+ export interface CardThemePreference {
15
+ read: (memberId: string) => Promise<string | null>;
16
+ save: (memberId: string, id: string | null) => Promise<void>;
17
+ }
18
+ export interface MemberCardBlockProps {
19
+ locale: "id" | "en";
20
+ /** Used only as the card theme preference key; never rendered on the card. */
21
+ memberId: string;
22
+ /** Defaults to an in-memory store. The app passes its member preference API. */
23
+ themePreference?: CardThemePreference;
24
+ /** Full name. The card shows it clamped to two lines; assistive technology gets the whole text. */
25
+ name: string;
26
+ /** Membership number, printed on both faces and encoded in the barcode. */
27
+ number: string;
28
+ /** Komsat display name (may carry the "Komsat " prefix; the card strips it). Null for korda-only members. */
29
+ komsat?: string | null;
30
+ /** Korda display name, e.g. "PPI Kansai". Also seeds the automatic theme. */
31
+ korda: string;
32
+ validUntil?: string | null;
33
+ graceUntil?: string | null;
34
+ suspendReason?: string | null;
35
+ state: MemberCardState;
36
+ /** The PPIJ logo shown on the front (the app serves /ppij-logo.png). */
37
+ logoSrc: string;
38
+ /** The decorative Indonesia map on the back (the app serves /id-map.svg). */
39
+ mapSrc: string;
40
+ }
41
+ /** Only the states with a valid membership show the barcode. */
42
+ export declare const hasBarcode: (state: MemberCardState) => state is "active" | "expiring" | "change_pending";
43
+ /**
44
+ * The member card with its actions. "Barcode" and the tap on the card share one flip state.
45
+ * Buttons appear only while a barcode is available (ACTIVE, expiring, change pending).
46
+ */
47
+ export declare function MemberCardBlock(props: MemberCardBlockProps): import("react").JSX.Element;