@adres/adrec-dls 0.1.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 +38 -0
- package/dist-lib/components/ApplicationHistory/ApplicationHistory.d.ts +30 -0
- package/dist-lib/components/Badge/Badge.d.ts +27 -0
- package/dist-lib/components/Button/Button.d.ts +34 -0
- package/dist-lib/components/CardTitle/CardTitle.d.ts +39 -0
- package/dist-lib/components/Checkbox/Checkbox.d.ts +20 -0
- package/dist-lib/components/DataTable/DataTable.d.ts +28 -0
- package/dist-lib/components/DescriptionList/DescriptionList.d.ts +21 -0
- package/dist-lib/components/Drawer/Drawer.d.ts +27 -0
- package/dist-lib/components/ImagePlaceholder/ImagePlaceholder.d.ts +16 -0
- package/dist-lib/components/InputField/InputField.d.ts +45 -0
- package/dist-lib/components/LinkRow/LinkRow.d.ts +17 -0
- package/dist-lib/components/Modal/Modal.d.ts +13 -0
- package/dist-lib/components/Notification/Notification.d.ts +16 -0
- package/dist-lib/components/Panel/Panel.d.ts +12 -0
- package/dist-lib/components/Popover/Popover.d.ts +29 -0
- package/dist-lib/components/RadioGroup/RadioGroup.d.ts +25 -0
- package/dist-lib/components/ScreenBottomActions/ScreenBottomActions.d.ts +29 -0
- package/dist-lib/components/SectionHeader/SectionHeader.d.ts +20 -0
- package/dist-lib/components/Select/Select.d.ts +33 -0
- package/dist-lib/components/SidePanel/SidePanel.d.ts +25 -0
- package/dist-lib/components/StatusIndicator/StatusIndicator.d.ts +8 -0
- package/dist-lib/components/Textarea/Textarea.d.ts +28 -0
- package/dist-lib/icons/Aed.d.ts +3 -0
- package/dist-lib/icons/AlertCircle.d.ts +3 -0
- package/dist-lib/icons/Asterisk.d.ts +3 -0
- package/dist-lib/icons/Bell.d.ts +3 -0
- package/dist-lib/icons/Calendar.d.ts +3 -0
- package/dist-lib/icons/CancelSolid.d.ts +4 -0
- package/dist-lib/icons/CheckCircle.d.ts +3 -0
- package/dist-lib/icons/CheckSolid.d.ts +3 -0
- package/dist-lib/icons/ChevronDown.d.ts +3 -0
- package/dist-lib/icons/ChevronRight.d.ts +3 -0
- package/dist-lib/icons/HelpCircle.d.ts +3 -0
- package/dist-lib/icons/Image.d.ts +3 -0
- package/dist-lib/icons/InfoCircle.d.ts +3 -0
- package/dist-lib/icons/Plus.d.ts +3 -0
- package/dist-lib/icons/Question.d.ts +3 -0
- package/dist-lib/icons/User.d.ts +3 -0
- package/dist-lib/icons/WarningTriangle.d.ts +3 -0
- package/dist-lib/icons/index.d.ts +17 -0
- package/dist-lib/index.d.ts +22 -0
- package/dist-lib/index.js +6706 -0
- package/dist-lib/styles/tv.d.ts +1 -0
- package/dist-lib/tokens.css +441 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @adres/adrec-dls
|
|
2
|
+
|
|
3
|
+
React components implementing the ADREC Design System, for ADREC admin-panel
|
|
4
|
+
apps (Tawtheeq and others) to install instead of rebuilding.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @adres/adrec-dls
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`react` and `react-dom` (`^19.0.0`) are peer dependencies - install them in
|
|
13
|
+
your app if they aren't already there.
|
|
14
|
+
|
|
15
|
+
## Set up the design tokens
|
|
16
|
+
|
|
17
|
+
Components use Tailwind CSS v4 utility classes from the `ads-*` design
|
|
18
|
+
tokens. Without importing this package's token sheet, those utilities don't
|
|
19
|
+
exist and components will render unstyled. Import it once, in your app's
|
|
20
|
+
Tailwind entry CSS:
|
|
21
|
+
|
|
22
|
+
```css
|
|
23
|
+
@import "@adres/adrec-dls/tokens.css";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { Badge } from '@adres/adrec-dls';
|
|
30
|
+
|
|
31
|
+
function Example() {
|
|
32
|
+
return <Badge text="Active" color="Success green" type="Light" />;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Every component supports `dir="ltr"`/`dir="rtl"` via its `content`/language
|
|
37
|
+
props for EN/AR layouts - see each component's exported props `interface`
|
|
38
|
+
for the full API.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { StatusIndicatorColor } from '../StatusIndicator/StatusIndicator';
|
|
2
|
+
export type StepStatus = 'default' | 'current' | 'done' | 'rejected' | 'returned';
|
|
3
|
+
export interface ReviewHistoryEntry {
|
|
4
|
+
label: string;
|
|
5
|
+
statusColor: StatusIndicatorColor;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ApplicationHistoryStepData {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
status: StepStatus;
|
|
12
|
+
by?: string;
|
|
13
|
+
date?: string;
|
|
14
|
+
reviewHistory?: ReviewHistoryEntry[];
|
|
15
|
+
/** Whether the step's detail (by/date/review history) starts expanded. Defaults to true. */
|
|
16
|
+
defaultExpanded?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ApplicationHistoryProps {
|
|
19
|
+
steps: ApplicationHistoryStepData[];
|
|
20
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
21
|
+
content?: 'EN' | 'AR';
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ADS Application history (stepper / timeline). Structured as a single layout that
|
|
26
|
+
* mirrors automatically under `dir="rtl"`, rather than Figma's separate EN/AR variants.
|
|
27
|
+
* Unlike the static Figma mockup, each step's detail panel is a real expand/collapse
|
|
28
|
+
* toggle rather than a fixed set of visibility flags.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ApplicationHistory: ({ steps, content, className }: ApplicationHistoryProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StatusIndicatorColor } from '../StatusIndicator/StatusIndicator';
|
|
3
|
+
export type BadgeColor = 'Red' | 'Black' | 'Orange' | 'Gray' | 'Success green' | 'Beige' | 'ADREC Green';
|
|
4
|
+
export type BadgeType = 'Light' | 'Solid' | 'Text';
|
|
5
|
+
export interface BadgeProps {
|
|
6
|
+
/** Badge color. Only the color/type pairs defined in Figma are styled; others fall back to Gray/Light (Text falls back to Black). */
|
|
7
|
+
color?: BadgeColor;
|
|
8
|
+
/** Solid = filled background. Light = tinted background. Text = no background, label only. */
|
|
9
|
+
type?: BadgeType;
|
|
10
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
11
|
+
content?: 'EN' | 'AR';
|
|
12
|
+
text?: string;
|
|
13
|
+
showText?: boolean;
|
|
14
|
+
leftIcon?: ReactNode;
|
|
15
|
+
showLeftIcon?: boolean;
|
|
16
|
+
rightIcon?: ReactNode;
|
|
17
|
+
showRightIcon?: boolean;
|
|
18
|
+
/** Only meaningful for type="Text", matching the Figma "Badge" component. */
|
|
19
|
+
showStatusIndicator?: boolean;
|
|
20
|
+
statusColor?: StatusIndicatorColor;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ADS Badge. Structured as a single layout (icon, optional status dot, text, icon) that
|
|
25
|
+
* mirrors automatically under `dir="rtl"`, rather than Figma's separate EN/AR variants.
|
|
26
|
+
*/
|
|
27
|
+
export declare const Badge: ({ color, type, content, text, showText, leftIcon, showLeftIcon, rightIcon, showRightIcon, showStatusIndicator, statusColor, className, }: BadgeProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type ButtonKind = 'primary' | 'secondary' | 'tertiary' | 'text' | 'danger';
|
|
3
|
+
type ButtonRef = ((instance: HTMLButtonElement | null) => void) | {
|
|
4
|
+
current: HTMLButtonElement | null;
|
|
5
|
+
} | null;
|
|
6
|
+
export interface ButtonProps {
|
|
7
|
+
/** Forwarded to the underlying `<button>` — needed for anything that measures/positions
|
|
8
|
+
* off it (e.g. using a Button as a Popover's `asChild` trigger). */
|
|
9
|
+
ref?: ButtonRef;
|
|
10
|
+
kind?: ButtonKind;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Stretches the button to fill its container, matching the mobile layout in ScreenBottomActions. */
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
/** Renders as a square control sized to fit just an icon — no text, no horizontal
|
|
15
|
+
* padding/gap. Pass the icon itself as `children` (it's sized and centered
|
|
16
|
+
* automatically, the same way leftIcon/rightIcon are). There's no visible label for
|
|
17
|
+
* assistive tech in this mode, so pass `aria-label` too. */
|
|
18
|
+
iconOnly?: boolean;
|
|
19
|
+
type?: 'button' | 'submit';
|
|
20
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
21
|
+
content?: 'EN' | 'AR';
|
|
22
|
+
leftIcon?: ReactNode;
|
|
23
|
+
rightIcon?: ReactNode;
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* ADS Button. The shared button primitive, consolidated from the button
|
|
31
|
+
* styles already duplicated inline in CardTitle and ScreenBottomActions.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Button: ({ ref, kind, disabled, fullWidth, iconOnly, type, content, leftIcon, rightIcon, onClick, "aria-label": ariaLabel, className, children, }: ButtonProps) => import("react").JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StatusIndicatorColor } from '../StatusIndicator/StatusIndicator';
|
|
3
|
+
export interface CardTitleProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
mandatory?: boolean;
|
|
6
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
7
|
+
content?: 'EN' | 'AR';
|
|
8
|
+
showInfoIcon?: boolean;
|
|
9
|
+
infoText?: string;
|
|
10
|
+
showSideText?: boolean;
|
|
11
|
+
sideText?: string;
|
|
12
|
+
showBottomText?: boolean;
|
|
13
|
+
bottomText?: string;
|
|
14
|
+
showBadge?: boolean;
|
|
15
|
+
badgeText?: string;
|
|
16
|
+
badgeStatusColor?: StatusIndicatorColor;
|
|
17
|
+
/** Whether the section this title heads is expanded or collapsed. Only rotates the chevron — the header's own look stays constant. */
|
|
18
|
+
expanded?: boolean;
|
|
19
|
+
/** Renders a trailing chevron the caller can wire up to toggle `expanded`. */
|
|
20
|
+
collapsible?: boolean;
|
|
21
|
+
onToggle?: () => void;
|
|
22
|
+
cta?: 'none' | 'one' | 'two';
|
|
23
|
+
ctaLabel?: string;
|
|
24
|
+
onCtaClick?: () => void;
|
|
25
|
+
ctaTwoLabels?: [string, string];
|
|
26
|
+
ctaTwoIcons?: [ReactNode, ReactNode];
|
|
27
|
+
onCtaTwoClick?: [() => void, () => void];
|
|
28
|
+
/** Bold corner text, e.g. a price or count. */
|
|
29
|
+
cornerBoldText?: string;
|
|
30
|
+
/** Muted corner text, e.g. a timestamp. */
|
|
31
|
+
cornerMutedText?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ADS Card title. Structured as a single layout that mirrors automatically under
|
|
36
|
+
* `dir="rtl"`, rather than Figma's separate EN/AR variants. `expanded` folds together
|
|
37
|
+
* Figma's separate "Expanded" / "Collapsed" variants into one togglable component.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CardTitle: ({ title, mandatory, content, showInfoIcon, infoText, showSideText, sideText, showBottomText, bottomText, showBadge, badgeText, badgeStatusColor, expanded, collapsible, onToggle, cta, ctaLabel, onCtaClick, ctaTwoLabels, ctaTwoIcons, onCtaTwoClick, cornerBoldText, cornerMutedText, className, }: CardTitleProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ChangeEvent } from 'react';
|
|
2
|
+
export interface CheckboxProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
showLabel?: boolean;
|
|
6
|
+
/** Controlled checked state. Omit it (with or without `onChange`) to let the box manage its own state. */
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
/** Initial state for uncontrolled usage, i.e. when `checked` is omitted. */
|
|
9
|
+
defaultChecked?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
12
|
+
content?: 'EN' | 'AR';
|
|
13
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ADS Checkbox. A native `<input type="checkbox">` wrapped in its `<label>` (rather than
|
|
18
|
+
* a custom-drawn box) so the whole row stays keyboard- and screen-reader-accessible for free.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Checkbox: ({ id, label, showLabel, checked, defaultChecked, disabled, content, onChange, className, }: CheckboxProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface DataTableColumn {
|
|
3
|
+
key: string;
|
|
4
|
+
header: string;
|
|
5
|
+
/** Any valid CSS width (e.g. "120px", "20%"). Applied inline since it is an arbitrary,
|
|
6
|
+
* caller-supplied value that can't be known ahead of time as a static Tailwind class. */
|
|
7
|
+
width?: string;
|
|
8
|
+
}
|
|
9
|
+
export type DataTableRow = Record<string, ReactNode>;
|
|
10
|
+
export interface DataTableProps {
|
|
11
|
+
columns: DataTableColumn[];
|
|
12
|
+
rows: DataTableRow[];
|
|
13
|
+
/** Derives a unique key per row, for React's list key and to match `highlightedRowKey`. Defaults to the row's index. */
|
|
14
|
+
rowKey?: (row: DataTableRow, index: number) => string;
|
|
15
|
+
/** Fired when the first column's cell is clicked; that cell renders as a link when this is set. */
|
|
16
|
+
onRowAction?: (row: DataTableRow) => void;
|
|
17
|
+
highlightedRowKey?: string;
|
|
18
|
+
emptyMessage?: string;
|
|
19
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
20
|
+
content?: 'EN' | 'AR';
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ADS Data table. Header row is filled gold with white text (matching `table.gt th`
|
|
25
|
+
* exactly), body rows alternate cream/cream-alt, and an optional `highlightedRowKey`
|
|
26
|
+
* tints one row for emphasis using the same fill as the prototype's `tr.hi`.
|
|
27
|
+
*/
|
|
28
|
+
export declare const DataTable: ({ columns, rows, rowKey, onRowAction, highlightedRowKey, emptyMessage, content, className, }: DataTableProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface DescriptionListItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value: ReactNode;
|
|
5
|
+
/** Spans both the label and value columns, stacking label above value (e.g. a "Remarks" row). */
|
|
6
|
+
fullWidth?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface DescriptionListProps {
|
|
9
|
+
items: DescriptionListItem[];
|
|
10
|
+
/** Renders a filled header bar above the rows. */
|
|
11
|
+
headerLabel?: string;
|
|
12
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
13
|
+
content?: 'EN' | 'AR';
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ADS Description list. A semantic label/value table (rows are literally label:value
|
|
18
|
+
* pairs, so a `<table>` is the appropriate element here), with alternating row shading
|
|
19
|
+
* and an optional filled header bar.
|
|
20
|
+
*/
|
|
21
|
+
export declare const DescriptionList: ({ items, headerLabel, content, className }: DescriptionListProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type DrawerSide = 'top' | 'right' | 'bottom' | 'left';
|
|
3
|
+
export interface DrawerProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
/** Which screen edge the drawer slides in from. */
|
|
7
|
+
side?: DrawerSide;
|
|
8
|
+
/** Sizing/shape for the drawer panel itself (e.g. `w-80` for left/right, a `max-w-*`
|
|
9
|
+
* wrapper inside for top/bottom) — the panel itself is always edge-to-edge on its axis. */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Whether to render a dimming backdrop behind the panel. Default true. When false, the
|
|
12
|
+
* rest of the page stays fully visible and clickable while the drawer is open. */
|
|
13
|
+
overlay?: boolean;
|
|
14
|
+
/** When false, clicking the backdrop or pressing Escape no longer closes the drawer —
|
|
15
|
+
* only an explicit `onClose` call (e.g. from a close button in the drawer's own content)
|
|
16
|
+
* does. Default true. Pair with `overlay={false}` to let the drawer stay open while the
|
|
17
|
+
* user interacts with the rest of the page. */
|
|
18
|
+
dismissible?: boolean;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ADS Drawer. A generic slide-in panel — an optional dimmed backdrop plus a panel pinned
|
|
23
|
+
* to one screen edge, sliding in/out via a CSS transform transition (always mounted,
|
|
24
|
+
* toggled through `open` rather than conditionally rendered, so the slide animation plays
|
|
25
|
+
* both ways).
|
|
26
|
+
*/
|
|
27
|
+
export declare function Drawer({ open, onClose, side, className, overlay, dismissible, children }: DrawerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type ImagePlaceholderSize = 'sm' | 'md' | 'lg';
|
|
2
|
+
export interface ImagePlaceholderProps {
|
|
3
|
+
/** Scales the centered icon — the box itself is always sized by the caller (via
|
|
4
|
+
* `className`), since placeholders stand in for images of very different aspect
|
|
5
|
+
* ratios (a plot thumbnail vs. a signature scan). */
|
|
6
|
+
size?: ImagePlaceholderSize;
|
|
7
|
+
/** Accessible description, since there's no real image behind this placeholder. */
|
|
8
|
+
label?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* ADS Image placeholder. A generic "no image" box — muted fill, centered icon — sized
|
|
13
|
+
* entirely by the caller (wrap it in an element with the desired width/height, or pass
|
|
14
|
+
* `className` directly). Use wherever a real image/photo isn't available yet.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ImagePlaceholder: ({ size, label, className }: ImagePlaceholderProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ChangeEvent, type ReactNode } from 'react';
|
|
2
|
+
export type InputFieldType = 'default' | 'error' | 'success' | 'filled' | 'disabled';
|
|
3
|
+
export interface InputFieldProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Hides the label row entirely — for compact layouts (e.g. a table cell with its own
|
|
7
|
+
* label to the side) that don't want the field's own floating label. */
|
|
8
|
+
showLabel?: boolean;
|
|
9
|
+
mandatory?: boolean;
|
|
10
|
+
showTooltipIcon?: boolean;
|
|
11
|
+
tooltipText?: string;
|
|
12
|
+
type?: InputFieldType;
|
|
13
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
14
|
+
content?: 'EN' | 'AR';
|
|
15
|
+
/** Controlled value. Omit it (with or without `onChange`) to let the field manage its own text. */
|
|
16
|
+
value?: string;
|
|
17
|
+
/** Initial text for uncontrolled usage, i.e. when `value` is omitted. */
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
21
|
+
/** Fired when the clear ("x") button is pressed. Only rendered for type="error" / type="filled" when there is a value. */
|
|
22
|
+
onClear?: () => void;
|
|
23
|
+
showLeftIcon?: boolean;
|
|
24
|
+
leftIcon?: ReactNode;
|
|
25
|
+
showRightIcon?: boolean;
|
|
26
|
+
rightIcon?: ReactNode;
|
|
27
|
+
/** Renders a leading "<dropdownText> ⌄" group inside the field, e.g. a country-code prefix. */
|
|
28
|
+
showInnerDropdown?: boolean;
|
|
29
|
+
dropdownText?: string;
|
|
30
|
+
/** Renders a trailing chevron, indicating the whole field opens a select/dropdown. */
|
|
31
|
+
dropDown?: boolean;
|
|
32
|
+
showRightUnit?: boolean;
|
|
33
|
+
unit?: string;
|
|
34
|
+
showSupportingText?: boolean;
|
|
35
|
+
showLeftText?: boolean;
|
|
36
|
+
leftText?: string;
|
|
37
|
+
showRightText?: boolean;
|
|
38
|
+
rightText?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ADS Input Field. Structured as a single layout that mirrors automatically under
|
|
43
|
+
* `dir="rtl"`, rather than Figma's separate EN/AR variants.
|
|
44
|
+
*/
|
|
45
|
+
export declare const InputField: ({ id, label: labelText, showLabel, mandatory, showTooltipIcon, tooltipText, type, content, value, defaultValue, placeholder, onChange, onClear, showLeftIcon, leftIcon, showRightIcon, rightIcon, showInnerDropdown, dropdownText, dropDown, showRightUnit, unit, showSupportingText, showLeftText, leftText, showRightText, rightText, className, }: InputFieldProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface LinkRowProps {
|
|
2
|
+
/** One or more Text Button links, rendered after the status dot. */
|
|
3
|
+
links: string[];
|
|
4
|
+
/** Bold label on the right (e.g. an owner/party name). Omit for a links-only row. */
|
|
5
|
+
name?: string;
|
|
6
|
+
onLinkClick?: (link: string) => void;
|
|
7
|
+
/** Colors the leading dot Orange when true, Gray otherwise. */
|
|
8
|
+
active?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* ADS Link row. A status dot followed by one or more Text Button links, with an
|
|
13
|
+
* optional bold label on the right. Pairs with SectionHeader below a plain title —
|
|
14
|
+
* e.g. `<SectionHeader title="Owners" />` + `<LinkRow links={[...]} name="QA-Company" />` —
|
|
15
|
+
* so the title stays untouched while its actions live in their own row underneath.
|
|
16
|
+
*/
|
|
17
|
+
export declare const LinkRow: ({ links, name, onLinkClick, active, className }: LinkRowProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ModalProps {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
title: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
footer: ReactNode;
|
|
7
|
+
onDismiss: () => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* ADS Modal. A centered dialog with a header (optional icon + title), a body, and a
|
|
11
|
+
* footer action row. Dismisses on a click outside the dialog card.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Modal({ icon, title, children, footer, onDismiss }: ModalProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type NotificationView = 'system' | 'warning' | 'error' | 'success' | 'informative' | 'lowest-priority';
|
|
2
|
+
export interface NotificationProps {
|
|
3
|
+
view?: NotificationView;
|
|
4
|
+
message?: string;
|
|
5
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
6
|
+
content?: 'EN' | 'AR';
|
|
7
|
+
showLink?: boolean;
|
|
8
|
+
linkText?: string;
|
|
9
|
+
onLinkClick?: () => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* ADS Notification banner. Structured as a single layout (icon, message, link) that
|
|
14
|
+
* mirrors automatically under `dir="rtl"`, rather than Figma's separate EN/AR variants.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Notification: ({ view, message, content, showLink, linkText, onLinkClick, className, }: NotificationProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** Matches the prototype's `.pnl`/`.pnl-h`/`.pnl-b` side-rail panel, built on CardTitle's
|
|
3
|
+
* own collapsible header rather than reproducing its chrome. */
|
|
4
|
+
export interface PanelProps {
|
|
5
|
+
title: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
defaultExpanded?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** ADS Panel. A bordered, collapsible section — a CardTitle header plus a content area
|
|
10
|
+
* that shows/hides under it. Purely structural (no domain content of its own), meant to
|
|
11
|
+
* be composed by callers into specific sections (e.g. an "Actions" or "Owner" side-rail panel). */
|
|
12
|
+
export declare function Panel({ title, children, defaultExpanded }: PanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as RadixPopover from '@radix-ui/react-popover';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export type PopoverAlign = 'start' | 'center' | 'end';
|
|
4
|
+
export type PopoverSide = 'top' | 'right' | 'bottom' | 'left';
|
|
5
|
+
export interface PopoverProps {
|
|
6
|
+
/** The element that opens the popover on click — rendered as-is (via Radix's `asChild`),
|
|
7
|
+
* so pass a real interactive element (e.g. a Button) rather than plain text. */
|
|
8
|
+
trigger: ReactNode;
|
|
9
|
+
/** Popover body content. Wrap any item that should close the popover on click (e.g. a
|
|
10
|
+
* menu link) in `PopoverClose`. */
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
align?: PopoverAlign;
|
|
13
|
+
side?: PopoverSide;
|
|
14
|
+
/** Controlled open state. Omit (with or without `onOpenChange`) to let the popover
|
|
15
|
+
* manage its own open/closed state. */
|
|
16
|
+
open?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* ADS Popover. A floating, dismissible panel anchored to a trigger — built on Radix's
|
|
22
|
+
* Popover primitive for free focus-trapping, click-outside/Escape-to-close, and
|
|
23
|
+
* collision-aware positioning (no 1:1 prototype element for this; every prototype menu
|
|
24
|
+
* is a plain click-to-navigate link, not a floating panel).
|
|
25
|
+
*/
|
|
26
|
+
export declare function Popover({ trigger, children, align, side, open, onOpenChange, className }: PopoverProps): import("react").JSX.Element;
|
|
27
|
+
/** Wrap any popover-content item that should close the popover when clicked (e.g. a
|
|
28
|
+
* menu link/button), same as Radix's own `Popover.Close`. */
|
|
29
|
+
export declare const PopoverClose: import("react").ForwardRefExoticComponent<RadixPopover.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface RadioGroupOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface RadioGroupProps {
|
|
6
|
+
/** Shared `name` for the underlying native radio inputs — auto-generated if omitted. */
|
|
7
|
+
name?: string;
|
|
8
|
+
options: RadioGroupOption[];
|
|
9
|
+
/** Controlled value. Omit it (with or without `onChange`) to let the group manage its own selection. */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** Initial selection for uncontrolled usage, i.e. when `value` is omitted. Defaults to the first option. */
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
16
|
+
content?: 'EN' | 'AR';
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ADS Radio group. A compact row of native radio inputs for a handful of
|
|
21
|
+
* mutually-exclusive options sitting tightly together — deliberately not styled as a
|
|
22
|
+
* Tabs-style navigation control, so a page doesn't end up reading as "all tabs" when
|
|
23
|
+
* it already carries real navigational tabs elsewhere.
|
|
24
|
+
*/
|
|
25
|
+
export declare const RadioGroup: ({ name, options, value, defaultValue, onChange, disabled, content, className, }: RadioGroupProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type ScreenBottomActionsChannel = 'desktop' | 'mobile';
|
|
2
|
+
export interface ScreenBottomActionsProps {
|
|
3
|
+
channel?: ScreenBottomActionsChannel;
|
|
4
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
5
|
+
content?: 'EN' | 'AR';
|
|
6
|
+
showLeftButtons?: boolean;
|
|
7
|
+
previousLabel?: string;
|
|
8
|
+
onPrevious?: () => void;
|
|
9
|
+
showCancelButton?: boolean;
|
|
10
|
+
cancelLabel?: string;
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
showSelected?: boolean;
|
|
13
|
+
selectedCountLabel?: string;
|
|
14
|
+
showLinkOfSelected?: boolean;
|
|
15
|
+
viewSelectedLabel?: string;
|
|
16
|
+
onViewSelected?: () => void;
|
|
17
|
+
showTertiaryButton?: boolean;
|
|
18
|
+
tertiaryLabel?: string;
|
|
19
|
+
onTertiaryClick?: () => void;
|
|
20
|
+
nextLabel?: string;
|
|
21
|
+
onNext?: () => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ADS Screen Bottom Actions bar. Structured as a single layout that mirrors
|
|
26
|
+
* automatically under `dir="rtl"`, rather than Figma's separate EN/AR variants —
|
|
27
|
+
* including the Previous/Next chevrons, which flip direction to match reading order.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ScreenBottomActions: ({ channel, content, showLeftButtons, previousLabel, onPrevious, showCancelButton, cancelLabel, onCancel, showSelected, selectedCountLabel, showLinkOfSelected, viewSelectedLabel, onViewSelected, showTertiaryButton, tertiaryLabel, onTertiaryClick, nextLabel, onNext, className, }: ScreenBottomActionsProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StatusIndicatorColor } from '../StatusIndicator/StatusIndicator';
|
|
2
|
+
export interface SectionHeaderAction {
|
|
3
|
+
label: string;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface SectionHeaderProps {
|
|
7
|
+
title: string;
|
|
8
|
+
/** Renders a right-aligned, link-styled clickable element, baseline-aligned with the title. */
|
|
9
|
+
action?: SectionHeaderAction;
|
|
10
|
+
/** Renders a StatusIndicator dot before the title text. */
|
|
11
|
+
leadingStatus?: StatusIndicatorColor;
|
|
12
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
13
|
+
content?: 'EN' | 'AR';
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ADS Section header. A bold small title with a bottom border, optionally preceded by a
|
|
18
|
+
* StatusIndicator dot and followed by a right-aligned, link-styled action.
|
|
19
|
+
*/
|
|
20
|
+
export declare const SectionHeader: ({ title, action, leadingStatus, content, className }: SectionHeaderProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ChangeEvent } from 'react';
|
|
2
|
+
export type SelectType = 'default' | 'error' | 'disabled';
|
|
3
|
+
export interface SelectOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SelectProps {
|
|
8
|
+
id?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Hides the label row entirely — for compact layouts (e.g. a table cell with its own
|
|
11
|
+
* label to the side) that don't want the field's own floating label. */
|
|
12
|
+
showLabel?: boolean;
|
|
13
|
+
mandatory?: boolean;
|
|
14
|
+
type?: SelectType;
|
|
15
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
16
|
+
content?: 'EN' | 'AR';
|
|
17
|
+
options: SelectOption[];
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Controlled value. Omit it (with or without `onChange`) to let the field manage its own selection. */
|
|
20
|
+
value?: string;
|
|
21
|
+
/** Initial selection for uncontrolled usage, i.e. when `value` is omitted. */
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
24
|
+
showSupportingText?: boolean;
|
|
25
|
+
supportingText?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* ADS Select. A native `<select>` styled to match InputField's visual language
|
|
30
|
+
* (there is no Radix Select primitive in this project's dependencies), with a
|
|
31
|
+
* custom trailing chevron laid over the native control.
|
|
32
|
+
*/
|
|
33
|
+
export declare const Select: ({ id, label: labelText, showLabel, mandatory, type, content, options, placeholder, value, defaultValue, onChange, showSupportingText, supportingText, className, }: SelectProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface SidePanelProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
/** Called on Escape while open. Optional — omit for a panel with no keyboard-dismiss
|
|
5
|
+
* affordance (e.g. one that only closes via its own explicit close button). */
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
/** Width the panel occupies when open, as a literal Tailwind width class (e.g.
|
|
8
|
+
* `w-96`) — the panel's content keeps this width throughout, clipped by the
|
|
9
|
+
* animating outer wrapper so the slide reads as a width change, not a translate. */
|
|
10
|
+
width?: string;
|
|
11
|
+
/** Applied to the inner, fixed-width content — its own border/shadow/scroll
|
|
12
|
+
* behavior is entirely up to the caller, same as Drawer. */
|
|
13
|
+
className?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ADS Side panel. Unlike Drawer (a `fixed` overlay that floats above the page, never
|
|
18
|
+
* part of layout flow), this is a normal in-flow flex child — animating its own width
|
|
19
|
+
* rather than a transform — so opening it pushes/squeezes its layout siblings instead
|
|
20
|
+
* of covering them. Render it as a sibling inside the same flex row as the content it
|
|
21
|
+
* should push (its left/right position comes from where the caller places it in that
|
|
22
|
+
* row, not from a prop), with `self-stretch` implicit so it always spans the row's
|
|
23
|
+
* full height regardless of the row's own align-items.
|
|
24
|
+
*/
|
|
25
|
+
export declare function SidePanel({ open, onClose, width, className, children }: SidePanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type StatusIndicatorColor = 'Success green' | 'Blue' | 'Orange' | 'Red' | 'Gray';
|
|
2
|
+
export interface StatusIndicatorProps {
|
|
3
|
+
/** Status color. Maps 1:1 to the Figma "Status indicator" component. */
|
|
4
|
+
color?: StatusIndicatorColor;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/** A small colored dot used to convey status, e.g. inside a Badge. */
|
|
8
|
+
export declare const StatusIndicator: ({ color, className }: StatusIndicatorProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ChangeEvent } from 'react';
|
|
2
|
+
export type TextareaType = 'default' | 'error' | 'disabled';
|
|
3
|
+
export interface TextareaProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Hides the label row entirely — for compact layouts (e.g. a table cell with its own
|
|
7
|
+
* label to the side) that don't want the field's own floating label. */
|
|
8
|
+
showLabel?: boolean;
|
|
9
|
+
mandatory?: boolean;
|
|
10
|
+
type?: TextareaType;
|
|
11
|
+
/** EN renders left-to-right with the Latin font stack; AR renders right-to-left with the Arabic font stack. */
|
|
12
|
+
content?: 'EN' | 'AR';
|
|
13
|
+
/** Controlled value. Omit it (with or without `onChange`) to let the field manage its own text. */
|
|
14
|
+
value?: string;
|
|
15
|
+
/** Initial text for uncontrolled usage, i.e. when `value` is omitted. */
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
onChange?: (event: ChangeEvent<HTMLTextAreaElement>) => void;
|
|
19
|
+
rows?: number;
|
|
20
|
+
showSupportingText?: boolean;
|
|
21
|
+
supportingText?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ADS Textarea. Same label/mandatory/type structure as InputField, scaled up to a
|
|
26
|
+
* resizable multi-line field.
|
|
27
|
+
*/
|
|
28
|
+
export declare const Textarea: ({ id, label: labelText, showLabel, mandatory, type, content, value, defaultValue, placeholder, onChange, rows, showSupportingText, supportingText, className, }: TextareaProps) => import("react").JSX.Element;
|