ppij-design-system 0.0.0-stage → 0.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/dist/banners.d.ts +31 -0
- package/dist/banners.js +18 -0
- package/dist/card-themes.d.ts +14 -0
- package/dist/card-themes.js +325 -0
- package/dist/components/account-menu.d.ts +24 -0
- package/dist/components/account-menu.js +13 -0
- package/dist/components/admin-drawer.d.ts +34 -0
- package/dist/components/admin-drawer.js +30 -0
- package/dist/components/alert-dialog.d.ts +16 -0
- package/dist/components/alert-dialog.js +39 -0
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.js +29 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +22 -0
- package/dist/components/badge.d.ts +9 -0
- package/dist/components/badge.js +27 -0
- package/dist/components/banner-carousel.d.ts +14 -0
- package/dist/components/banner-carousel.js +90 -0
- package/dist/components/bottom-bar.d.ts +22 -0
- package/dist/components/bottom-bar.js +12 -0
- package/dist/components/button.d.ts +10 -0
- package/dist/components/button.js +37 -0
- package/dist/components/card-upload.d.ts +30 -0
- package/dist/components/card-upload.js +19 -0
- package/dist/components/card.d.ts +9 -0
- package/dist/components/card.js +24 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.js +9 -0
- package/dist/components/data-table.d.ts +26 -0
- package/dist/components/data-table.js +17 -0
- package/dist/components/dialog.d.ts +17 -0
- package/dist/components/dialog.js +37 -0
- package/dist/components/drawer.d.ts +13 -0
- package/dist/components/drawer.js +34 -0
- package/dist/components/dropdown-menu.d.ts +25 -0
- package/dist/components/dropdown-menu.js +50 -0
- package/dist/components/editable-panel.d.ts +25 -0
- package/dist/components/editable-panel.js +18 -0
- package/dist/components/empty.d.ts +12 -0
- package/dist/components/empty.js +33 -0
- package/dist/components/file-upload.d.ts +28 -0
- package/dist/components/file-upload.js +21 -0
- package/dist/components/form-panel.d.ts +15 -0
- package/dist/components/form-panel.js +9 -0
- package/dist/components/funding-picker.d.ts +20 -0
- package/dist/components/funding-picker.js +16 -0
- package/dist/components/input.d.ts +3 -0
- package/dist/components/input.js +6 -0
- package/dist/components/invitation-card.d.ts +14 -0
- package/dist/components/invitation-card.js +13 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.js +7 -0
- package/dist/components/member-card-block.d.ts +47 -0
- package/dist/components/member-card-block.js +329 -0
- package/dist/components/member-card.css +92 -0
- package/dist/components/member-card.d.ts +29 -0
- package/dist/components/member-card.js +22 -0
- package/dist/components/month-picker.d.ts +16 -0
- package/dist/components/month-picker.js +19 -0
- package/dist/components/offline-banner.d.ts +14 -0
- package/dist/components/offline-banner.js +14 -0
- package/dist/components/page-header.d.ts +14 -0
- package/dist/components/page-header.js +10 -0
- package/dist/components/phone-field.d.ts +25 -0
- package/dist/components/phone-field.js +64 -0
- package/dist/components/pill-radio.d.ts +21 -0
- package/dist/components/pill-radio.js +15 -0
- package/dist/components/portal-shell.d.ts +53 -0
- package/dist/components/portal-shell.js +19 -0
- package/dist/components/postcode-field.d.ts +26 -0
- package/dist/components/postcode-field.js +14 -0
- package/dist/components/progress.d.ts +4 -0
- package/dist/components/progress.js +8 -0
- package/dist/components/radio-group.d.ts +5 -0
- package/dist/components/radio-group.js +11 -0
- package/dist/components/review-panel.d.ts +20 -0
- package/dist/components/review-panel.js +14 -0
- package/dist/components/saving-indicator.d.ts +15 -0
- package/dist/components/saving-indicator.js +19 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.js +13 -0
- package/dist/components/search-filter.d.ts +39 -0
- package/dist/components/search-filter.js +19 -0
- package/dist/components/segmented-progress.d.ts +16 -0
- package/dist/components/segmented-progress.js +12 -0
- package/dist/components/select.d.ts +15 -0
- package/dist/components/select.js +38 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/service-tiles.d.ts +26 -0
- package/dist/components/service-tiles.js +17 -0
- package/dist/components/sheet.d.ts +14 -0
- package/dist/components/sheet.js +40 -0
- package/dist/components/sidebar.d.ts +69 -0
- package/dist/components/sidebar.js +210 -0
- package/dist/components/skeleton.d.ts +11 -0
- package/dist/components/skeleton.js +11 -0
- package/dist/components/sonner.d.ts +9 -0
- package/dist/components/sonner.js +25 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.js +22 -0
- package/dist/components/stat-card.d.ts +22 -0
- package/dist/components/stat-card.js +12 -0
- package/dist/components/status-card.d.ts +24 -0
- package/dist/components/status-card.js +26 -0
- package/dist/components/stepper.d.ts +25 -0
- package/dist/components/stepper.js +23 -0
- package/dist/components/submit-overlay.d.ts +16 -0
- package/dist/components/submit-overlay.js +15 -0
- package/dist/components/suggestion-sheet.d.ts +20 -0
- package/dist/components/suggestion-sheet.js +36 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.js +8 -0
- package/dist/components/table.d.ts +10 -0
- package/dist/components/table.js +28 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +28 -0
- package/dist/components/tag-input.d.ts +15 -0
- package/dist/components/tag-input.js +31 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +6 -0
- package/dist/components/timeline.d.ts +18 -0
- package/dist/components/timeline.js +11 -0
- package/dist/components/todo-strip.d.ts +14 -0
- package/dist/components/todo-strip.js +11 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.js +16 -0
- package/dist/components/top-bar.d.ts +23 -0
- package/dist/components/top-bar.js +14 -0
- package/dist/components/type-ahead.d.ts +20 -0
- package/dist/components/type-ahead.js +22 -0
- package/dist/components/unit-card.d.ts +26 -0
- package/dist/components/unit-card.js +18 -0
- package/dist/components/view-toggle.d.ts +20 -0
- package/dist/components/view-toggle.js +15 -0
- package/dist/components/wizard-footer.d.ts +24 -0
- package/dist/components/wizard-footer.js +17 -0
- package/dist/components/wizard-header.d.ts +29 -0
- package/dist/components/wizard-header.js +18 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +11 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +70 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +5 -0
- package/dist/sample-banners.d.ts +8 -0
- package/dist/sample-banners.js +28 -0
- package/dist/tokens.css +119 -0
- package/dist/tokens.json +50 -0
- package/package.json +60 -4
- package/README.md +0 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ToasterProps } from "sonner";
|
|
2
|
+
/**
|
|
3
|
+
* Toast surface for the whole system. Theme is fixed light: the system
|
|
4
|
+
* has one theme, and toasts follow the design tokens, not the OS.
|
|
5
|
+
* Toasts report finished actions only; see the Guidelines for the
|
|
6
|
+
* do and do not list.
|
|
7
|
+
*/
|
|
8
|
+
declare function Toaster({ ...props }: ToasterProps): import("react").JSX.Element;
|
|
9
|
+
export { Toaster };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Toaster as Sonner } from "sonner";
|
|
4
|
+
import { IconCircleCheck, IconInfoCircle, IconAlertTriangle, IconCircleX, IconLoader2 } from "@tabler/icons-react";
|
|
5
|
+
/**
|
|
6
|
+
* Toast surface for the whole system. Theme is fixed light: the system
|
|
7
|
+
* has one theme, and toasts follow the design tokens, not the OS.
|
|
8
|
+
* Toasts report finished actions only; see the Guidelines for the
|
|
9
|
+
* do and do not list.
|
|
10
|
+
*/
|
|
11
|
+
function Toaster({ ...props }) {
|
|
12
|
+
return (_jsx(Sonner, { theme: "light", className: "toaster group", icons: {
|
|
13
|
+
success: _jsx(IconCircleCheck, { className: "size-4" }),
|
|
14
|
+
info: _jsx(IconInfoCircle, { className: "size-4" }),
|
|
15
|
+
warning: _jsx(IconAlertTriangle, { className: "size-4" }),
|
|
16
|
+
error: _jsx(IconCircleX, { className: "size-4" }),
|
|
17
|
+
loading: _jsx(IconLoader2, { className: "size-4 animate-spin" }),
|
|
18
|
+
}, style: {
|
|
19
|
+
"--normal-bg": "var(--color-popover)",
|
|
20
|
+
"--normal-text": "var(--color-popover-foreground)",
|
|
21
|
+
"--normal-border": "var(--color-border)",
|
|
22
|
+
"--border-radius": "var(--radius)",
|
|
23
|
+
}, toastOptions: { classNames: { toast: "cn-toast" } }, ...props }));
|
|
24
|
+
}
|
|
25
|
+
export { Toaster };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SpinnerProps extends React.SVGAttributes<SVGSVGElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
5
|
+
decorative?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Shared accessible Spinner component.
|
|
9
|
+
* Tailwind only, respects motion-reduce with motion-reduce:animate-none.
|
|
10
|
+
* When decorative={false} (default), renders role="status" with aria-busy and sr-only label.
|
|
11
|
+
* When decorative={true} (used inside buttons or status containers with visible text),
|
|
12
|
+
* renders aria-hidden svg without nested role="status" announcements.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Spinner({ className, label, size, decorative, ...props }: SpinnerProps): React.JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
const sizeClasses = {
|
|
4
|
+
xs: "size-3.5",
|
|
5
|
+
sm: "size-4",
|
|
6
|
+
md: "size-5",
|
|
7
|
+
lg: "size-6",
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Shared accessible Spinner component.
|
|
11
|
+
* Tailwind only, respects motion-reduce with motion-reduce:animate-none.
|
|
12
|
+
* When decorative={false} (default), renders role="status" with aria-busy and sr-only label.
|
|
13
|
+
* When decorative={true} (used inside buttons or status containers with visible text),
|
|
14
|
+
* renders aria-hidden svg without nested role="status" announcements.
|
|
15
|
+
*/
|
|
16
|
+
export function Spinner({ className, label = "Memuat…", size = "md", decorative = false, ...props }) {
|
|
17
|
+
const svg = (_jsxs("svg", { className: cn("animate-spin motion-reduce:animate-none text-current", sizeClasses[size], className), xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "data-spinner": true, ...props, children: [_jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }));
|
|
18
|
+
if (decorative) {
|
|
19
|
+
return svg;
|
|
20
|
+
}
|
|
21
|
+
return (_jsxs("span", { role: "status", "aria-busy": "true", className: "inline-flex items-center justify-center", children: [svg, label && _jsx("span", { className: "sr-only", children: label })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface StatCardProps {
|
|
3
|
+
/** What the number counts, for example "Anggota aktif". */
|
|
4
|
+
label: string;
|
|
5
|
+
/** The number itself, already formatted by the page. */
|
|
6
|
+
value: string;
|
|
7
|
+
/** Tabler icon shown in a quiet chip at the top right. */
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/** Change against the previous period, for example "+12 bulan ini". */
|
|
10
|
+
delta?: string;
|
|
11
|
+
/** Whether the change is good, bad, or neutral. */
|
|
12
|
+
deltaTone?: "success" | "destructive" | "muted";
|
|
13
|
+
/** One quiet line of context under the value. */
|
|
14
|
+
hint?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One dashboard figure: a label, a large value, and the change against
|
|
19
|
+
* the last period in the matching status color. Presentation only; the
|
|
20
|
+
* page computes the numbers.
|
|
21
|
+
*/
|
|
22
|
+
export declare function StatCard({ label, value, icon, delta, deltaTone, hint, className }: StatCardProps): React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconTrendingUp, IconTrendingDown } from "@tabler/icons-react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
import { Card } from "./card";
|
|
5
|
+
/**
|
|
6
|
+
* One dashboard figure: a label, a large value, and the change against
|
|
7
|
+
* the last period in the matching status color. Presentation only; the
|
|
8
|
+
* page computes the numbers.
|
|
9
|
+
*/
|
|
10
|
+
export function StatCard({ label, value, icon, delta, deltaTone = "muted", hint, className }) {
|
|
11
|
+
return (_jsxs(Card, { className: cn("grid gap-2 p-5", className), children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsx("span", { className: "text-sm font-medium text-muted-foreground", children: label }), icon && (_jsx("span", { className: "flex size-8 items-center justify-center rounded-md bg-secondary text-muted-foreground [&_svg]:size-4", children: icon }))] }), _jsx("span", { className: "text-3xl font-bold tracking-tight text-brand-ink", children: value }), (delta || hint) && (_jsxs("div", { className: "flex flex-wrap items-center gap-2 text-sm", children: [delta && (_jsxs("span", { className: cn("inline-flex items-center gap-1 font-medium", deltaTone === "success" && "text-success", deltaTone === "destructive" && "text-destructive", deltaTone === "muted" && "text-muted-foreground"), children: [deltaTone === "success" && _jsx(IconTrendingUp, { className: "size-4" }), deltaTone === "destructive" && _jsx(IconTrendingDown, { className: "size-4" }), delta] })), hint && _jsx("span", { className: "text-muted-foreground", children: hint })] }))] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type StatusCardTone = "default" | "warning" | "danger" | "info" | "muted";
|
|
3
|
+
export interface StatusCardProps {
|
|
4
|
+
/** State icon, shown at size 6 with stroke 1.75 by the caller or as given. */
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
title: string;
|
|
7
|
+
body?: string;
|
|
8
|
+
actionLabel?: string;
|
|
9
|
+
actionHref?: string;
|
|
10
|
+
onAction?: () => void;
|
|
11
|
+
tone?: StatusCardTone;
|
|
12
|
+
/** Compact: one row, title and action only (the active and expiring states on Beranda). */
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The Beranda status element: one headline that states the member's
|
|
18
|
+
* situation and the single primary action for it. Calm states (active,
|
|
19
|
+
* expiring) use the compact one-row form; states whose body informs
|
|
20
|
+
* (submitted, needs changes, rejected) use the full card. The tone
|
|
21
|
+
* carries urgency: default white, warning amber, danger red, info sky,
|
|
22
|
+
* muted for closed memberships.
|
|
23
|
+
*/
|
|
24
|
+
export declare function StatusCard({ icon, title, body, actionLabel, actionHref, onAction, tone, compact, className }: StatusCardProps): React.JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
import { Card } from "./card";
|
|
5
|
+
const TONES = {
|
|
6
|
+
default: "border-brand-border bg-card text-brand-ink",
|
|
7
|
+
warning: "border-amber-300 bg-amber-50 text-amber-900",
|
|
8
|
+
danger: "border-red-200 bg-red-50 text-red-900",
|
|
9
|
+
info: "border-sky-200 bg-sky-50 text-sky-900",
|
|
10
|
+
muted: "border-brand-border bg-secondary text-brand-muted",
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The Beranda status element: one headline that states the member's
|
|
14
|
+
* situation and the single primary action for it. Calm states (active,
|
|
15
|
+
* expiring) use the compact one-row form; states whose body informs
|
|
16
|
+
* (submitted, needs changes, rejected) use the full card. The tone
|
|
17
|
+
* carries urgency: default white, warning amber, danger red, info sky,
|
|
18
|
+
* muted for closed memberships.
|
|
19
|
+
*/
|
|
20
|
+
export function StatusCard({ icon, title, body, actionLabel, actionHref, onAction, tone = "default", compact = false, className }) {
|
|
21
|
+
const action = actionLabel ? (_jsx(Button, { asChild: Boolean(actionHref), onClick: onAction, className: cn("shrink-0 bg-brand-red text-white hover:bg-brand-red/90", compact ? "min-h-11 px-4" : "min-h-11 px-5"), children: actionHref ? _jsx("a", { href: actionHref, children: actionLabel }) : _jsx("span", { children: actionLabel }) })) : null;
|
|
22
|
+
if (compact) {
|
|
23
|
+
return (_jsxs("div", { role: "region", "aria-label": title, className: cn("flex min-h-[60px] items-center gap-3 rounded-xl border py-2 pr-2 pl-4", TONES[tone], className), children: [_jsx("span", { className: "shrink-0 [&_svg]:size-6", children: icon }), _jsx("h2", { className: "line-clamp-2 min-w-0 flex-1 text-base leading-snug font-bold", children: title }), action] }));
|
|
24
|
+
}
|
|
25
|
+
return (_jsxs(Card, { className: cn("gap-3 rounded-xl border py-5", TONES[tone], className), children: [_jsxs("div", { className: "flex items-start gap-3 px-5", children: [_jsx("span", { className: "mt-0.5 shrink-0 [&_svg]:size-6", children: icon }), _jsxs("div", { className: "min-w-0", children: [_jsx("h2", { className: "text-lg leading-snug font-bold", children: title }), body && _jsx("p", { className: "mt-1 text-sm", children: body })] })] }), action && _jsx("div", { className: "px-5", children: action })] }));
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface StepperStep {
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface StepperProps {
|
|
7
|
+
steps: StepperStep[];
|
|
8
|
+
/** Current step, counting from 1. */
|
|
9
|
+
current: number;
|
|
10
|
+
/** Label shown in the compact form, for example "Langkah". */
|
|
11
|
+
stepWord?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Wizard progress. On wide screens every step is shown with its state:
|
|
16
|
+
* completed steps carry a check, the current step is filled red, and
|
|
17
|
+
* upcoming steps stay quiet. On phones it compacts to one line, the
|
|
18
|
+
* current step name, and a progress bar, because seven labels do not
|
|
19
|
+
* fit in a phone width and the person only needs to know where they are.
|
|
20
|
+
*
|
|
21
|
+
* @deprecated The wizard's segmented progress (SegmentedProgress, WIZ106-09) is the
|
|
22
|
+
* standard progress treatment for multi-step flows. Kept for compatibility; do not
|
|
23
|
+
* adopt for new surfaces.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Stepper({ steps, current, stepWord, className }: StepperProps): React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheck } from "@tabler/icons-react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
/**
|
|
5
|
+
* Wizard progress. On wide screens every step is shown with its state:
|
|
6
|
+
* completed steps carry a check, the current step is filled red, and
|
|
7
|
+
* upcoming steps stay quiet. On phones it compacts to one line, the
|
|
8
|
+
* current step name, and a progress bar, because seven labels do not
|
|
9
|
+
* fit in a phone width and the person only needs to know where they are.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated The wizard's segmented progress (SegmentedProgress, WIZ106-09) is the
|
|
12
|
+
* standard progress treatment for multi-step flows. Kept for compatibility; do not
|
|
13
|
+
* adopt for new surfaces.
|
|
14
|
+
*/
|
|
15
|
+
export function Stepper({ steps, current, stepWord = "Langkah", className }) {
|
|
16
|
+
const total = steps.length;
|
|
17
|
+
const percent = Math.round((current / total) * 100);
|
|
18
|
+
return (_jsxs("div", { className: className, children: [_jsxs("div", { className: "grid gap-2 sm:hidden", children: [_jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [_jsxs("span", { className: "text-sm font-medium text-muted-foreground", children: [stepWord, " ", current, " dari ", total] }), _jsx("span", { className: "text-sm font-semibold text-brand-ink", children: steps[current - 1]?.label })] }), _jsx("div", { className: "h-1.5 overflow-hidden rounded-full bg-secondary", role: "progressbar", "aria-valuenow": current, "aria-valuemin": 1, "aria-valuemax": total, "aria-label": stepWord + " " + current + " dari " + total, children: _jsx("div", { className: "h-full rounded-full bg-brand-red transition-all", style: { width: percent + "%" } }) })] }), _jsx("ol", { className: "hidden items-start sm:flex", children: steps.map((step, index) => {
|
|
19
|
+
const number = index + 1;
|
|
20
|
+
const state = number < current ? "complete" : number === current ? "current" : "upcoming";
|
|
21
|
+
return (_jsxs("li", { className: cn("flex items-start", index > 0 && "flex-1"), children: [index > 0 && _jsx("span", { "aria-hidden": true, className: cn("mx-2 mt-4 h-px flex-1", number <= current ? "bg-brand-red" : "bg-border") }), _jsxs("div", { className: "grid justify-items-center gap-1.5 text-center", "aria-current": state === "current" ? "step" : undefined, children: [_jsx("span", { className: cn("flex size-8 items-center justify-center rounded-full border text-sm font-semibold", state === "complete" && "border-brand-red bg-brand-red text-white", state === "current" && "border-brand-red bg-brand-red text-white ring-4 ring-brand-red/15", state === "upcoming" && "border-border bg-card text-muted-foreground"), children: state === "complete" ? _jsx(IconCheck, { className: "size-4" }) : number }), _jsx("span", { className: cn("max-w-24 text-xs leading-tight", state === "upcoming" ? "text-muted-foreground" : "font-medium text-brand-ink"), children: step.label })] })] }, step.label));
|
|
22
|
+
}) })] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SubmitOverlayProps {
|
|
2
|
+
phase: "sending" | "sent";
|
|
3
|
+
/** Status line, for example "Mengirim pendaftaran..." or "Terkirim. Membuka Beranda...". */
|
|
4
|
+
title: string;
|
|
5
|
+
/** Supporting line shown while sending. Defaults to the wizard's "Jangan tutup halaman ini." */
|
|
6
|
+
line?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Full-screen submit layer, extracted from the wizard SubmitOverlay:
|
|
11
|
+
* shown from the moment a submit that ends in a redirect starts
|
|
12
|
+
* until the browser navigates away. A white veiled layer with one
|
|
13
|
+
* centered card, a large spinner while sending, and the success
|
|
14
|
+
* check on the status token once sent.
|
|
15
|
+
*/
|
|
16
|
+
export declare function SubmitOverlay({ phase, title, line, className }: SubmitOverlayProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconCircleCheck } from "@tabler/icons-react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
import { Spinner } from "./spinner";
|
|
5
|
+
/**
|
|
6
|
+
* Full-screen submit layer, extracted from the wizard SubmitOverlay:
|
|
7
|
+
* shown from the moment a submit that ends in a redirect starts
|
|
8
|
+
* until the browser navigates away. A white veiled layer with one
|
|
9
|
+
* centered card, a large spinner while sending, and the success
|
|
10
|
+
* check on the status token once sent.
|
|
11
|
+
*/
|
|
12
|
+
export function SubmitOverlay({ phase, title, line = "Jangan tutup halaman ini.", className }) {
|
|
13
|
+
const sent = phase === "sent";
|
|
14
|
+
return (_jsx("div", { className: cn("fixed inset-0 z-50 flex items-center justify-center bg-white/80 p-4 backdrop-blur-sm", className), children: _jsxs("div", { className: "w-full max-w-sm rounded-xl border border-border bg-card p-6 text-center shadow-lg", children: [_jsx("div", { className: "flex justify-center", "aria-hidden": "true", children: sent ? _jsx(IconCircleCheck, { className: "size-10 text-success", stroke: 1.75 }) : _jsx(Spinner, { size: "lg", decorative: true, className: "text-primary" }) }), _jsx("p", { role: "status", "aria-live": "polite", className: "mt-4 text-lg font-bold text-brand-ink", children: title }), !sent && _jsx("p", { className: "mt-1 text-sm text-brand-muted", children: line })] }) }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type SuggestKind = "institution" | "major" | "minat" | "funding";
|
|
2
|
+
export interface SuggestionSheetProps {
|
|
3
|
+
kind: SuggestKind | null;
|
|
4
|
+
onDismiss: () => void;
|
|
5
|
+
name: string;
|
|
6
|
+
onNameChange: (name: string) => void;
|
|
7
|
+
onConfirm: () => void;
|
|
8
|
+
error?: string;
|
|
9
|
+
/** For institution suggestions the wizard shows the chosen prefecture as context. */
|
|
10
|
+
prefectureLabel?: string;
|
|
11
|
+
locale?: "id" | "en";
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The use-and-suggest sheet (WIZ106-13), extracted from the wizard
|
|
15
|
+
* SuggestionSheet on AdminDrawer: a TypeAhead "not in the list"
|
|
16
|
+
* action opens it with the typed text pre-filled; "Gunakan &
|
|
17
|
+
* sarankan" commits, and cancel, Escape, backdrop, and close never
|
|
18
|
+
* commit. The parent owns the name, the error, and the commit.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SuggestionSheet({ kind, onDismiss, name, onNameChange, onConfirm, error, prefectureLabel, locale, }: SuggestionSheetProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AdminDrawer } from "./admin-drawer";
|
|
3
|
+
import { Button } from "./button";
|
|
4
|
+
import { Input } from "./input";
|
|
5
|
+
import { Label } from "./label";
|
|
6
|
+
const TITLES = {
|
|
7
|
+
institution: ["Sarankan institusi", "Suggest an institution"],
|
|
8
|
+
major: ["Sarankan jurusan", "Suggest a major"],
|
|
9
|
+
minat: ["Sarankan minat", "Suggest an interest"],
|
|
10
|
+
funding: ["Sarankan sumber dana", "Suggest a funding source"],
|
|
11
|
+
};
|
|
12
|
+
const NAME_LABELS = {
|
|
13
|
+
institution: ["Nama institusi", "Institution name"],
|
|
14
|
+
major: ["Nama jurusan", "Major name"],
|
|
15
|
+
minat: ["Nama minat", "Interest name"],
|
|
16
|
+
funding: ["Nama sumber dana", "Funding source name"],
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The use-and-suggest sheet (WIZ106-13), extracted from the wizard
|
|
20
|
+
* SuggestionSheet on AdminDrawer: a TypeAhead "not in the list"
|
|
21
|
+
* action opens it with the typed text pre-filled; "Gunakan &
|
|
22
|
+
* sarankan" commits, and cancel, Escape, backdrop, and close never
|
|
23
|
+
* commit. The parent owns the name, the error, and the commit.
|
|
24
|
+
*/
|
|
25
|
+
export function SuggestionSheet({ kind, onDismiss, name, onNameChange, onConfirm, error, prefectureLabel, locale = "id", }) {
|
|
26
|
+
const en = locale === "en";
|
|
27
|
+
return (_jsx(AdminDrawer, { open: kind !== null, onOpenChange: (open) => {
|
|
28
|
+
if (!open)
|
|
29
|
+
onDismiss();
|
|
30
|
+
}, locale: locale, title: kind ? (en ? TITLES[kind][1] : TITLES[kind][0]) : "", description: en ? "The name is queued for admin review; your registration can continue meanwhile." : "Nama diusulkan untuk ditinjau pengurus; pendaftaran tetap bisa dilanjutkan.", footer: _jsx(Button, { type: "submit", form: "ds-suggestion-form", children: en ? "Use & suggest" : "Gunakan & sarankan" }), children: _jsxs("form", { id: "ds-suggestion-form", className: "grid gap-4", onSubmit: (event) => {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
onConfirm();
|
|
33
|
+
}, children: [_jsxs("div", { className: "grid gap-2", children: [_jsx(Label, { htmlFor: "ds-suggestion-name", children: kind ? (en ? NAME_LABELS[kind][1] : NAME_LABELS[kind][0]) : "" }), _jsx(Input, { id: "ds-suggestion-name", value: name, onChange: (event) => onNameChange(event.target.value), "aria-invalid": Boolean(error) || undefined, autoComplete: "off" })] }), kind === "institution" ? (_jsxs("p", { className: "text-sm text-brand-muted", children: [en ? "Prefecture" : "Prefektur", ": ", prefectureLabel ?? "—"] })) : null, error ? (_jsx("p", { role: "alert", className: "text-sm text-destructive", children: error })) : null, _jsx("p", { className: "text-sm leading-6 text-brand-muted", children: en
|
|
34
|
+
? "Your answer is used right away so registration can continue, and the name is proposed for the catalogue for admin review."
|
|
35
|
+
: "Jawaban ini langsung dipakai agar pendaftaran bisa lanjut, dan nama diusulkan ke katalog untuk ditinjau pengurus nasional." })] }) }));
|
|
36
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
3
|
+
declare function Switch({ className, size, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
|
|
4
|
+
size?: "sm" | "default";
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
export { Switch };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Switch as SwitchPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
function Switch({ className, size = "default", ...props }) {
|
|
6
|
+
return (_jsx(SwitchPrimitive.Root, { "data-slot": "switch", "data-size": size, className: cn("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: cn("pointer-events-none block rounded-full bg-background shadow-xs ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0") }) }));
|
|
7
|
+
}
|
|
8
|
+
export { Switch };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
|
|
3
|
+
declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
|
|
4
|
+
declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
|
|
5
|
+
declare function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">): React.JSX.Element;
|
|
6
|
+
declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
|
|
7
|
+
declare function TableHead({ className, ...props }: React.ComponentProps<"th">): React.JSX.Element;
|
|
8
|
+
declare function TableCell({ className, ...props }: React.ComponentProps<"td">): React.JSX.Element;
|
|
9
|
+
declare function TableCaption({ className, ...props }: React.ComponentProps<"caption">): React.JSX.Element;
|
|
10
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
function Table({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn("w-full caption-bottom text-sm", className), ...props }) }));
|
|
6
|
+
}
|
|
7
|
+
function TableHeader({ className, ...props }) {
|
|
8
|
+
return (_jsx("thead", { "data-slot": "table-header", className: cn("[&_tr]:border-b", className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function TableBody({ className, ...props }) {
|
|
11
|
+
return (_jsx("tbody", { "data-slot": "table-body", className: cn("[&_tr:last-child]:border-0", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function TableFooter({ className, ...props }) {
|
|
14
|
+
return (_jsx("tfoot", { "data-slot": "table-footer", className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function TableRow({ className, ...props }) {
|
|
17
|
+
return (_jsx("tr", { "data-slot": "table-row", className: cn("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function TableHead({ className, ...props }) {
|
|
20
|
+
return (_jsx("th", { "data-slot": "table-head", className: cn("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function TableCell({ className, ...props }) {
|
|
23
|
+
return (_jsx("td", { "data-slot": "table-cell", className: cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function TableCaption({ className, ...props }) {
|
|
26
|
+
return (_jsx("caption", { "data-slot": "table-caption", className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
4
|
+
declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof TabsPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare const tabsListVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "line" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): React.JSX.Element;
|
|
9
|
+
declare function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>): React.JSX.Element;
|
|
10
|
+
declare function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>): React.JSX.Element;
|
|
11
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
import { Tabs as TabsPrimitive } from "radix-ui";
|
|
5
|
+
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
6
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, orientation: orientation, className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-muted",
|
|
12
|
+
line: "gap-1 bg-transparent",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: "default",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
function TabsList({ className, variant = "default", ...props }) {
|
|
20
|
+
return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, className: cn(tabsListVariants({ variant }), className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function TabsTrigger({ className, ...props }) {
|
|
23
|
+
return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent", "data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function TabsContent({ className, ...props }) {
|
|
26
|
+
return (_jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("flex-1 outline-none", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TagInputProps {
|
|
3
|
+
values: string[];
|
|
4
|
+
onChange: (values: string[]) => void;
|
|
5
|
+
/** Curated suggestions shown as pills under the field; clicking adds the tag. */
|
|
6
|
+
suggestions?: string[];
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Multi-value field for interests and skills: chosen values sit as
|
|
12
|
+
* removable chips inside the field, typing plus Enter adds a new one,
|
|
13
|
+
* and curated suggestions under the field add with one tap.
|
|
14
|
+
*/
|
|
15
|
+
export declare function TagInput({ values, onChange, suggestions, placeholder, className }: TagInputProps): React.JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { IconX, IconPlus } from "@tabler/icons-react";
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
|
+
import { Badge } from "./badge";
|
|
6
|
+
/**
|
|
7
|
+
* Multi-value field for interests and skills: chosen values sit as
|
|
8
|
+
* removable chips inside the field, typing plus Enter adds a new one,
|
|
9
|
+
* and curated suggestions under the field add with one tap.
|
|
10
|
+
*/
|
|
11
|
+
export function TagInput({ values, onChange, suggestions = [], placeholder, className }) {
|
|
12
|
+
const [draft, setDraft] = React.useState("");
|
|
13
|
+
const add = (raw) => {
|
|
14
|
+
const value = raw.trim();
|
|
15
|
+
if (value === "" || values.some((v) => v.toLowerCase() === value.toLowerCase()))
|
|
16
|
+
return;
|
|
17
|
+
onChange([...values, value]);
|
|
18
|
+
setDraft("");
|
|
19
|
+
};
|
|
20
|
+
const remove = (value) => onChange(values.filter((v) => v !== value));
|
|
21
|
+
const available = suggestions.filter((s) => !values.some((v) => v.toLowerCase() === s.toLowerCase()));
|
|
22
|
+
return (_jsxs("div", { className: cn("grid gap-2", className), children: [_jsxs("div", { className: "flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-card px-2 py-1.5 shadow-xs focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50", children: [values.map((value) => (_jsxs(Badge, { variant: "secondary", className: "gap-1 pr-1", children: [_jsx("span", { children: value }), _jsx("button", { type: "button", onClick: () => remove(value), "aria-label": "Hapus " + value, className: "flex size-4 items-center justify-center rounded-full outline-none hover:bg-background/60 focus-visible:ring-2 focus-visible:ring-ring", children: _jsx(IconX, { className: "size-3" }) })] }, value))), _jsx("input", { value: draft, onChange: (event) => setDraft(event.target.value), onKeyDown: (event) => {
|
|
23
|
+
if (event.key === "Enter" || event.key === ",") {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
add(draft);
|
|
26
|
+
}
|
|
27
|
+
if (event.key === "Backspace" && draft === "" && values.length > 0) {
|
|
28
|
+
remove(values[values.length - 1]);
|
|
29
|
+
}
|
|
30
|
+
}, onBlur: () => add(draft), placeholder: values.length === 0 ? placeholder : undefined, className: "min-w-28 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground", "aria-label": placeholder ?? "Tambah nilai" })] }), available.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-1.5", children: available.map((suggestion) => (_jsxs("button", { type: "button", onClick: () => add(suggestion), className: "inline-flex items-center gap-1 rounded-full border bg-card px-2.5 py-1 text-xs font-medium text-muted-foreground outline-none transition-colors hover:border-brand-red/50 hover:text-brand-ink focus-visible:ring-2 focus-visible:ring-ring", children: [_jsx(IconPlus, { className: "size-3" }), suggestion] }, suggestion))) }))] }));
|
|
31
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
function Textarea({ className, ...props }) {
|
|
4
|
+
return (_jsx("textarea", { "data-slot": "textarea", className: cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-card px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
export { Textarea };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TimelineItem {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
/** When it happened or will happen, already formatted by the page. */
|
|
6
|
+
time?: string;
|
|
7
|
+
state: "complete" | "current" | "upcoming";
|
|
8
|
+
}
|
|
9
|
+
export interface TimelineProps {
|
|
10
|
+
items: TimelineItem[];
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A vertical history: what happened, in order, with the current point
|
|
15
|
+
* marked. Used for profile history and verification status, where the
|
|
16
|
+
* person asks one question: where is my process now.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Timeline({ items, className }: TimelineProps): React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconCheck } from "@tabler/icons-react";
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
|
+
/**
|
|
5
|
+
* A vertical history: what happened, in order, with the current point
|
|
6
|
+
* marked. Used for profile history and verification status, where the
|
|
7
|
+
* person asks one question: where is my process now.
|
|
8
|
+
*/
|
|
9
|
+
export function Timeline({ items, className }) {
|
|
10
|
+
return (_jsx("ol", { className: cn("grid", className), children: items.map((item, index) => (_jsxs("li", { className: "relative flex gap-3 pb-6 last:pb-0", children: [index < items.length - 1 && (_jsx("span", { "aria-hidden": true, className: cn("absolute top-6 left-[11px] h-[calc(100%-24px)] w-px", item.state === "complete" ? "bg-brand-red" : "bg-border") })), _jsxs("span", { className: cn("relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full border", item.state === "complete" && "border-brand-red bg-brand-red text-white", item.state === "current" && "border-brand-red bg-card ring-4 ring-brand-red/15", item.state === "upcoming" && "border-border bg-card"), children: [item.state === "complete" && _jsx(IconCheck, { className: "size-3.5" }), item.state === "current" && _jsx("span", { className: "size-2 rounded-full bg-brand-red" }), item.state === "upcoming" && _jsx("span", { className: "size-2 rounded-full bg-border" })] }), _jsxs("div", { className: "grid gap-0.5 pt-0.5", children: [_jsx("span", { className: cn("text-sm", item.state === "upcoming" ? "text-muted-foreground" : "font-medium text-brand-ink"), children: item.title }), item.description && _jsx("span", { className: "text-sm text-muted-foreground", children: item.description }), item.time && _jsx("span", { className: "text-xs text-muted-foreground", children: item.time })] })] }, item.title + index))) }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface TodoStripProps {
|
|
2
|
+
heading: string;
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The Beranda "next steps" strip, extracted exactly from
|
|
9
|
+
* ppij-identity-sso Beranda.tsx (the optional_todo element): a
|
|
10
|
+
* full-width link card spanning both columns. Real copy:
|
|
11
|
+
* heading "Langkah berikutnya", label "Tambahkan minat Anda
|
|
12
|
+
* (opsional)", linking to the profile's interests section.
|
|
13
|
+
*/
|
|
14
|
+
export declare function TodoStrip({ heading, label, href, onClick }: TodoStripProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The Beranda "next steps" strip, extracted exactly from
|
|
4
|
+
* ppij-identity-sso Beranda.tsx (the optional_todo element): a
|
|
5
|
+
* full-width link card spanning both columns. Real copy:
|
|
6
|
+
* heading "Langkah berikutnya", label "Tambahkan minat Anda
|
|
7
|
+
* (opsional)", linking to the profile's interests section.
|
|
8
|
+
*/
|
|
9
|
+
export function TodoStrip({ heading, label, href, onClick }) {
|
|
10
|
+
return (_jsxs("a", { href: href, onClick: onClick, className: "flex min-h-11 items-center justify-between gap-3 rounded-xl border border-brand-border bg-card px-4 py-3 text-brand-ink hover:border-brand-red focus-visible:outline-2 focus-visible:outline-brand-red md:col-span-2", children: [_jsxs("span", { children: [_jsx("span", { className: "block text-xs font-semibold tracking-wide text-brand-muted uppercase", children: heading }), _jsx("span", { className: "block font-semibold", children: label })] }), _jsx("span", { className: "text-sm font-semibold text-brand-red", "aria-hidden": "true", children: "\u203A" })] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
4
|
+
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
5
|
+
return (_jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delayDuration: delayDuration, ...props }));
|
|
6
|
+
}
|
|
7
|
+
function Tooltip({ ...props }) {
|
|
8
|
+
return _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
|
|
9
|
+
}
|
|
10
|
+
function TooltipTrigger({ ...props }) {
|
|
11
|
+
return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
12
|
+
}
|
|
13
|
+
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
14
|
+
return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" })] }) }));
|
|
15
|
+
}
|
|
16
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TopBarLink {
|
|
3
|
+
label: string;
|
|
4
|
+
href: string;
|
|
5
|
+
current?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TopBarProps {
|
|
8
|
+
/** Brand lockup node, usually the logo plus wordmark or the wordmark alone. */
|
|
9
|
+
brand: React.ReactNode;
|
|
10
|
+
brandHref?: string;
|
|
11
|
+
links?: TopBarLink[];
|
|
12
|
+
/** Right side nodes: language text action, sign-in button, bell, avatar. */
|
|
13
|
+
actions?: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Top navigation bar pattern for the public site and the portal.
|
|
18
|
+
* Brand left, section links in the middle, quiet actions right.
|
|
19
|
+
* The language switch stays a quiet text action, never boxed codes.
|
|
20
|
+
* On narrow screens the links hide and the caller provides a menu
|
|
21
|
+
* through the actions slot.
|
|
22
|
+
*/
|
|
23
|
+
export declare function TopBar({ brand, brandHref, links, actions, className }: TopBarProps): React.JSX.Element;
|