@embleema/design-system 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 +2 -0
- package/dist/Accordion.d.ts +42 -0
- package/dist/Alert.d.ts +46 -0
- package/dist/Badge.d.ts +45 -0
- package/dist/Barcode.d.ts +38 -0
- package/dist/Boolean.d.ts +48 -0
- package/dist/Button.d.ts +55 -0
- package/dist/Cards.d.ts +95 -0
- package/dist/Checkbox.d.ts +47 -0
- package/dist/Chip.d.ts +63 -0
- package/dist/DateField.d.ts +44 -0
- package/dist/Dropdown.d.ts +68 -0
- package/dist/Field.d.ts +48 -0
- package/dist/FormStatusChip.d.ts +47 -0
- package/dist/Label.d.ts +39 -0
- package/dist/Link.d.ts +38 -0
- package/dist/Loading.d.ts +46 -0
- package/dist/MedicationCard.d.ts +54 -0
- package/dist/MenuDropdown.d.ts +51 -0
- package/dist/MenuItem.d.ts +38 -0
- package/dist/MenuTrigger.d.ts +37 -0
- package/dist/Modals.d.ts +96 -0
- package/dist/NativeBottomNav.d.ts +53 -0
- package/dist/ObjectGroupField.d.ts +63 -0
- package/dist/ParticipantActivityStatus.d.ts +39 -0
- package/dist/ProgressBar.d.ts +56 -0
- package/dist/Radio.d.ts +45 -0
- package/dist/Scrim.d.ts +34 -0
- package/dist/SectionHeader.d.ts +37 -0
- package/dist/Selector.d.ts +64 -0
- package/dist/SelectorOption.d.ts +44 -0
- package/dist/SelectorOptionGroup.d.ts +61 -0
- package/dist/SliderBar.d.ts +46 -0
- package/dist/SliderField.d.ts +47 -0
- package/dist/Snackbar.d.ts +67 -0
- package/dist/Spinner.d.ts +34 -0
- package/dist/StatusBadge.d.ts +40 -0
- package/dist/StatusMessage.d.ts +40 -0
- package/dist/StudyProgressSymbol.d.ts +29 -0
- package/dist/Tab.d.ts +64 -0
- package/dist/Table.d.ts +85 -0
- package/dist/Tag.d.ts +54 -0
- package/dist/TaskStatus.d.ts +35 -0
- package/dist/TaskStatusIcon.d.ts +29 -0
- package/dist/TextArea.d.ts +56 -0
- package/dist/TextField.d.ts +48 -0
- package/dist/TimePicker.d.ts +46 -0
- package/dist/Toggle.d.ts +42 -0
- package/dist/Tooltip.d.ts +59 -0
- package/dist/Upload.d.ts +50 -0
- package/dist/WebTopNav.d.ts +46 -0
- package/dist/index.cjs.js +9609 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.es.js +19521 -0
- package/dist/index.es.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { StatusBadgeType } from './StatusBadge';
|
|
2
|
+
/**
|
|
3
|
+
* FormStatusChip — React port of Embleema Design System 2.0's Clinical/Form
|
|
4
|
+
* Status Chip component (Figma node 4700:102).
|
|
5
|
+
*
|
|
6
|
+
* Pill-shaped status indicator for eCRF forms. Composes a StatusBadge with a
|
|
7
|
+
* label and a sync indicator for the Saving state.
|
|
8
|
+
*
|
|
9
|
+
* Layout (per Figma):
|
|
10
|
+
* pill (h 32, padding 4 vertical / 16 horizontal, gap 12, radius 999)
|
|
11
|
+
* ├── status group (gap 8):
|
|
12
|
+
* │ ├── StatusBadge (20 × 20 padded, 16 × 16 inner pill)
|
|
13
|
+
* │ └── label (Nunito Regular 16/1.5, Text/Primary)
|
|
14
|
+
* └── sync icon (optional, only when state="Saving")
|
|
15
|
+
*
|
|
16
|
+
* Type → border color (1.5 px). The chip's body stays Background/Default;
|
|
17
|
+
* type identity comes from the badge gradient + a matching border tint:
|
|
18
|
+
* - NotStarted → Border/Default
|
|
19
|
+
* - Valid → #0A595C (darkest teal in Valid badge)
|
|
20
|
+
* - WarningsFlagged → #FCA266 (light orange in WarningsFlagged badge)
|
|
21
|
+
* - ErrorsFlagged → #FA6400 (orange in ErrorsFlagged badge)
|
|
22
|
+
* - LockedSubmitted → #644AD4 (purple in LockedSubmitted badge)
|
|
23
|
+
*
|
|
24
|
+
* Saving state: rotates the sync icon at 1.2 s per turn (linear infinite)
|
|
25
|
+
* plus a subtle background pulse on the chip body. Both honor
|
|
26
|
+
* `prefers-reduced-motion`.
|
|
27
|
+
*
|
|
28
|
+
* Props:
|
|
29
|
+
* - type : NotStarted | Valid | WarningsFlagged | ErrorsFlagged | LockedSubmitted
|
|
30
|
+
* - state : Default | Saving
|
|
31
|
+
* - label : override the auto-generated label text
|
|
32
|
+
*/
|
|
33
|
+
import * as React from "react";
|
|
34
|
+
export type FormStatusChipType = StatusBadgeType;
|
|
35
|
+
export type FormStatusChipState = "Default" | "Saving";
|
|
36
|
+
export type FormStatusType = FormStatusChipType;
|
|
37
|
+
export type FormStatusChipProps = {
|
|
38
|
+
type?: FormStatusChipType;
|
|
39
|
+
state?: FormStatusChipState;
|
|
40
|
+
label?: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
"aria-label"?: string;
|
|
44
|
+
};
|
|
45
|
+
export declare const FormStatusChip: React.ForwardRefExoticComponent<FormStatusChipProps & React.RefAttributes<HTMLSpanElement>>;
|
|
46
|
+
export default FormStatusChip;
|
|
47
|
+
export declare function FormStatusChipMatrix(): import("react/jsx-runtime").JSX.Element;
|
package/dist/Label.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label — React port of the Embleema Design System 2.0 Input/Label component
|
|
3
|
+
* (Figma node 4220:977). Reusable form label that supports a required
|
|
4
|
+
* asterisk and an info tooltip. Two sizes (Small for standard inputs, Large
|
|
5
|
+
* for section headers).
|
|
6
|
+
*
|
|
7
|
+
* Layout in Figma (order = asterisk → info icon → label text, gap = Space/2 = 2px):
|
|
8
|
+
* [* (required)] [ⓘ info icon (tooltip)] [Label text]
|
|
9
|
+
*
|
|
10
|
+
* Color bindings:
|
|
11
|
+
* - Required asterisk: Feedback/Error/Text = #B31A1A
|
|
12
|
+
* - Label text: Text/Primary = #0E0E0E
|
|
13
|
+
* - Info icon: currentColor (inherits Text/Primary)
|
|
14
|
+
*
|
|
15
|
+
* Typography:
|
|
16
|
+
* - Small: body/md, Nunito Regular 16px / 150%
|
|
17
|
+
* - Large: Nunito Regular 20px / 120%
|
|
18
|
+
*
|
|
19
|
+
* Tooltip is rendered via the existing Tooltip component, so hover/focus,
|
|
20
|
+
* positioning, and accessibility (aria-describedby) are handled there.
|
|
21
|
+
*/
|
|
22
|
+
import * as React from "react";
|
|
23
|
+
export type LabelSize = "Small" | "Large";
|
|
24
|
+
export type LabelProps = {
|
|
25
|
+
size?: LabelSize;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
tooltip?: boolean;
|
|
28
|
+
/** Tooltip title shown when `tooltip` is true. */
|
|
29
|
+
tooltipTitle?: string;
|
|
30
|
+
/** Tooltip body shown when `tooltip` is true. */
|
|
31
|
+
tooltipText?: string;
|
|
32
|
+
/** htmlFor target — links the label to a form control by id. */
|
|
33
|
+
htmlFor?: string;
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
38
|
+
export default Label;
|
|
39
|
+
export declare function LabelMatrix(): import("react/jsx-runtime").JSX.Element;
|
package/dist/Link.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Link — React port of the Embleema Design System 2.0 Action/Link component
|
|
3
|
+
* (Figma node 4682:7). Size and the icon/disabled booleans are props;
|
|
4
|
+
* Default / Hover / Pressed are wired to real browser :hover and :active
|
|
5
|
+
* states. Disabled prevents interaction via aria-disabled + pointer-events.
|
|
6
|
+
*
|
|
7
|
+
* Color bindings from the Figma component:
|
|
8
|
+
* - Default text: Action/Link/Default = Blue/400 (#306AE8)
|
|
9
|
+
* - Hover / Pressed text: Action/Link/Hover = Blue/300 (#6994EE)
|
|
10
|
+
* - Hover bg: Feedback/Information/Background = Blue/100 (#E3ECFF)
|
|
11
|
+
* - Pressed bg: Feedback/AI/Background = AI/Tint (#C7D9FF)
|
|
12
|
+
* - Disabled text: Text/Disabled = Neutral/500 (#848484)
|
|
13
|
+
* - Disabled underline: Border/Default = Neutral/300 (#DDDDDD)
|
|
14
|
+
*
|
|
15
|
+
* Sizes:
|
|
16
|
+
* - Medium: 16px Medium (button/md), 16×16 icon
|
|
17
|
+
* - Small: 14px Medium (button/sm) with 0.01em letter-spacing, 14×14 icon
|
|
18
|
+
*/
|
|
19
|
+
import * as React from "react";
|
|
20
|
+
export type LinkSize = "Medium" | "Small";
|
|
21
|
+
export type LinkProps = {
|
|
22
|
+
size?: LinkSize;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** true → default arrow-back glyph. Pass a ReactNode to inject a custom icon. */
|
|
25
|
+
leadingIcon?: boolean | React.ReactNode;
|
|
26
|
+
/** true → default arrow-forward glyph. Pass a ReactNode to inject a custom icon. */
|
|
27
|
+
trailingIcon?: boolean | React.ReactNode;
|
|
28
|
+
href?: string;
|
|
29
|
+
target?: string;
|
|
30
|
+
rel?: string;
|
|
31
|
+
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
"aria-label"?: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
37
|
+
export default Link;
|
|
38
|
+
export declare function LinkMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SpinnerSize, SpinnerStyle } from './Spinner';
|
|
2
|
+
/**
|
|
3
|
+
* Loading — React port of Embleema Design System 2.0's Feedback/Loading
|
|
4
|
+
* component (Figma node 4887:67).
|
|
5
|
+
*
|
|
6
|
+
* Composes Feedback/SpinnerIcon with an optional text label. Used as a
|
|
7
|
+
* standalone loading indicator for content regions, page-level loads, or any
|
|
8
|
+
* surface where the spinner alone isn't expressive enough.
|
|
9
|
+
*
|
|
10
|
+
* Sizes (spinner + label scale together):
|
|
11
|
+
* - Small → 16 px spinner, 14 px label (body/sm)
|
|
12
|
+
* - Medium → 20 px spinner, 16 px label (body/md)
|
|
13
|
+
* - Large → 32 px spinner, 18 px label (body/lg)
|
|
14
|
+
*
|
|
15
|
+
* Style:
|
|
16
|
+
* - Default → solid stroke (Action/Primary/Background) + Text/Primary label
|
|
17
|
+
* - AI → gradient stroke (#90B3FF → #6F59CF) + Text/Primary label
|
|
18
|
+
*
|
|
19
|
+
* Layout:
|
|
20
|
+
* - Horizontal → spinner and label side by side, gap 8
|
|
21
|
+
* - Vertical → spinner above label, items centered, gap 8
|
|
22
|
+
*
|
|
23
|
+
* Props:
|
|
24
|
+
* - size : Small | Medium | Large
|
|
25
|
+
* - style : Default | AI
|
|
26
|
+
* - layout : Horizontal | Vertical
|
|
27
|
+
* - label : show the label (default true)
|
|
28
|
+
* - labelText : label string (default "Loading...")
|
|
29
|
+
*/
|
|
30
|
+
import * as React from "react";
|
|
31
|
+
export type LoadingSize = SpinnerSize;
|
|
32
|
+
export type LoadingStyle = SpinnerStyle;
|
|
33
|
+
export type LoadingLayout = "Horizontal" | "Vertical";
|
|
34
|
+
export type LoadingProps = {
|
|
35
|
+
size?: LoadingSize;
|
|
36
|
+
style?: LoadingStyle;
|
|
37
|
+
layout?: LoadingLayout;
|
|
38
|
+
label?: boolean;
|
|
39
|
+
labelText?: string;
|
|
40
|
+
className?: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
"aria-label"?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const Loading: React.ForwardRefExoticComponent<LoadingProps & React.RefAttributes<HTMLSpanElement>>;
|
|
45
|
+
export default Loading;
|
|
46
|
+
export declare function LoadingMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MedicationCard — React port of Embleema Design System 2.0's
|
|
3
|
+
* Clinical/Medication Card component (Figma node 4718:1611).
|
|
4
|
+
*
|
|
5
|
+
* Pre-composed form card for medication data entry. Lays out medication
|
|
6
|
+
* name, dosage, unit, frequency, dates, reason-for-change, and comments
|
|
7
|
+
* across a responsive 3-column (Desktop) or 1-column (Tablet) grid.
|
|
8
|
+
*
|
|
9
|
+
* Per Figma:
|
|
10
|
+
* - Card: Background/Default, 8 px radius, Elevation 0 0 4 rgba(0,0,0,0.08)
|
|
11
|
+
* - Header: 16 px top/horizontal padding, status badge + 3-dot menu
|
|
12
|
+
* - Each cell: 16 px / 20 px padding, label + 48 px field
|
|
13
|
+
* - Field: Background/Field (#F8F8F8), 1 px Border/Default, 4 px radius,
|
|
14
|
+
* 4 px gap, 12 px padding, body/md Light placeholder
|
|
15
|
+
* - Footer: ActionButton (text-link primary, small)
|
|
16
|
+
*
|
|
17
|
+
* State drives the card's outer affordance:
|
|
18
|
+
* - Default → standard shadow, neutral border
|
|
19
|
+
* - Error → 2 px Feedback/Error/Text outline + faint red halo
|
|
20
|
+
*
|
|
21
|
+
* Size:
|
|
22
|
+
* - Desktop → 1000 px wide, three 3-cell rows
|
|
23
|
+
* - Tablet → 400 px wide, all cells stacked single-column
|
|
24
|
+
*
|
|
25
|
+
* Props:
|
|
26
|
+
* - state : forced visual override (Default | Error)
|
|
27
|
+
* - size : Desktop | Tablet
|
|
28
|
+
* - medicationName : value shown in the first field (placeholder when empty)
|
|
29
|
+
* - dosage / unit / frequency / startDate / endDate / reasonForChange /
|
|
30
|
+
* comments : same — each accepts an optional string
|
|
31
|
+
* - onRemove : destructive footer button callback (removes the card)
|
|
32
|
+
*/
|
|
33
|
+
import * as React from "react";
|
|
34
|
+
export type MedicationCardSize = "Desktop" | "Tablet";
|
|
35
|
+
export type MedicationCardState = "Default" | "Error";
|
|
36
|
+
export type MedicationCardProps = {
|
|
37
|
+
state?: MedicationCardState;
|
|
38
|
+
size?: MedicationCardSize;
|
|
39
|
+
medicationName?: string;
|
|
40
|
+
dosage?: string;
|
|
41
|
+
unit?: string;
|
|
42
|
+
frequency?: string;
|
|
43
|
+
startDate?: string;
|
|
44
|
+
endDate?: string;
|
|
45
|
+
reasonForChange?: string;
|
|
46
|
+
comments?: string;
|
|
47
|
+
onRemove?: () => void;
|
|
48
|
+
id?: string;
|
|
49
|
+
className?: string;
|
|
50
|
+
"aria-label"?: string;
|
|
51
|
+
};
|
|
52
|
+
export declare const MedicationCard: React.ForwardRefExoticComponent<MedicationCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
export default MedicationCard;
|
|
54
|
+
export declare function MedicationCardMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MenuDropdown — React port of Embleema Design System 2.0's
|
|
3
|
+
* Navigation/Menu/Dropdown component (Figma node 5125:7).
|
|
4
|
+
*
|
|
5
|
+
* The panel container that hosts a column of Navigation/Menu/Item rows. Opens
|
|
6
|
+
* below a Navigation/Menu/Trigger. The component renders only the panel —
|
|
7
|
+
* popover positioning, click-outside, and Escape-to-close live in the parent
|
|
8
|
+
* (see the matrix demo below for a complete trigger + dropdown wiring).
|
|
9
|
+
*
|
|
10
|
+
* Panel styling (semantic tokens from embleema-design-system.md):
|
|
11
|
+
* - Background : Background/Default (#FEFEFE)
|
|
12
|
+
* - Corner radius : Radius/m (8 px)
|
|
13
|
+
* - Shadow : Elevation/300 (0 4 12 rgba(0,0,0,0.12))
|
|
14
|
+
* - Padding : 8 px vertical, 0 horizontal
|
|
15
|
+
* - Min-width : 200 px (hugs the longest MenuItem label otherwise)
|
|
16
|
+
*/
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
export type MenuDropdownItem = {
|
|
19
|
+
/** Stable id used as the active key + onItemClick payload. */
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
/** Controls the leading icon slot on the MenuItem row. */
|
|
23
|
+
leadingIcon?: boolean | React.ReactNode;
|
|
24
|
+
/** When true, the row renders the trailing slot with `shortcut`. */
|
|
25
|
+
trailingText?: boolean;
|
|
26
|
+
shortcut?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type MenuDropdownProps = {
|
|
30
|
+
items: MenuDropdownItem[];
|
|
31
|
+
/** Currently selected value — controls which row gets the Active state. */
|
|
32
|
+
activeValue?: string;
|
|
33
|
+
onItemClick?: (value: string) => void;
|
|
34
|
+
/** Optional override of the min panel width (200 px per Figma default). */
|
|
35
|
+
minWidth?: number;
|
|
36
|
+
id?: string;
|
|
37
|
+
className?: string;
|
|
38
|
+
/** Forwarded to the panel for ARIA association with a MenuTrigger. */
|
|
39
|
+
"aria-labelledby"?: string;
|
|
40
|
+
"aria-label"?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const MenuDropdown: React.ForwardRefExoticComponent<MenuDropdownProps & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
export default MenuDropdown;
|
|
44
|
+
/**
|
|
45
|
+
* MenuComposedDemo — the interactive popover demo combining MenuTrigger,
|
|
46
|
+
* MenuDropdown, and MenuItem. Exported separately so it can be reused on
|
|
47
|
+
* pages that aggregate the whole Menu family (e.g. the consolidated "Menu"
|
|
48
|
+
* page) without duplicating the popover logic.
|
|
49
|
+
*/
|
|
50
|
+
export declare function MenuComposedDemo(): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
export declare function MenuDropdownMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MenuItem — React port of Embleema Design System 2.0's
|
|
3
|
+
* Navigation/Menu/Item component set (Figma node 5121:65).
|
|
4
|
+
*
|
|
5
|
+
* Single row inside a Navigation/Menu/Dropdown. 40 px tall, 240 px wide by
|
|
6
|
+
* default, with a 20 px leading icon, a body-size label, and an optional
|
|
7
|
+
* trailing shortcut/text slot.
|
|
8
|
+
*
|
|
9
|
+
* Color mapping (semantic tokens from embleema-design-system.md):
|
|
10
|
+
* Default : transparent + Text/Primary label
|
|
11
|
+
* Hover : Background/Selected + Text/Primary label
|
|
12
|
+
* Focus : Background/Selected + 2 px Border/FocusRing outline + Text/Primary label
|
|
13
|
+
* Active : Background/Selected + Action/Primary/Background label
|
|
14
|
+
* Disabled : transparent + Action/Disabled/Text label, no interaction
|
|
15
|
+
*
|
|
16
|
+
* Typography:
|
|
17
|
+
* Label : body/sm — Nunito Regular 14 / 1.5, Text/Primary (or per state)
|
|
18
|
+
* Shortcut : body/xs — Nunito Regular 12 / 1.4, letter-spacing 0.01em
|
|
19
|
+
*/
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
export type MenuItemState = "Default" | "Hover" | "Focus" | "Active" | "Disabled";
|
|
22
|
+
export type MenuItemProps = {
|
|
23
|
+
label: string;
|
|
24
|
+
state?: MenuItemState;
|
|
25
|
+
/** true → default settings glyph; false → no icon; ReactNode → custom. */
|
|
26
|
+
leadingIcon?: boolean | React.ReactNode;
|
|
27
|
+
/** true → render shortcut slot with `shortcut`; false → hidden. */
|
|
28
|
+
trailingText?: boolean;
|
|
29
|
+
/** Text shown in the trailing slot when trailingText is true. */
|
|
30
|
+
shortcut?: string;
|
|
31
|
+
onClick?: () => void;
|
|
32
|
+
id?: string;
|
|
33
|
+
className?: string;
|
|
34
|
+
"aria-label"?: string;
|
|
35
|
+
};
|
|
36
|
+
export declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
export default MenuItem;
|
|
38
|
+
export declare function MenuItemMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MenuTrigger — React port of Embleema Design System 2.0's
|
|
3
|
+
* Navigation/Menu/Trigger component set (Figma node 5104:70).
|
|
4
|
+
*
|
|
5
|
+
* The clickable button that opens a Navigation/Menu/Dropdown. 20 px leading
|
|
6
|
+
* icon (Icon/People/User by default), label, and a chevron that points down
|
|
7
|
+
* by default and rotates 180° on the Open state.
|
|
8
|
+
*
|
|
9
|
+
* Color mapping (semantic tokens from embleema-design-system.md):
|
|
10
|
+
* Default : transparent + Text/Primary label
|
|
11
|
+
* Hover : Background/Selected + Text/Primary label
|
|
12
|
+
* Focus : Background/Selected + 4 px Border/FocusRing outline + Text/Primary label
|
|
13
|
+
* Open : Background/Selected + Text/Primary label + chevron rotated 180°
|
|
14
|
+
*
|
|
15
|
+
* Geometry:
|
|
16
|
+
* - Padding: 8 / 12
|
|
17
|
+
* - Gap: 8
|
|
18
|
+
* - Corner radius: 4 (Radius/s)
|
|
19
|
+
* - Leading icon: 20 × 20
|
|
20
|
+
* - Chevron: 20 × 20 (CSS-rotated on Open, same Icon/Navigation/Dropdown asset)
|
|
21
|
+
*/
|
|
22
|
+
import * as React from "react";
|
|
23
|
+
export type MenuTriggerState = "Default" | "Hover" | "Focus" | "Open";
|
|
24
|
+
export type MenuTriggerProps = {
|
|
25
|
+
label: string;
|
|
26
|
+
state?: MenuTriggerState;
|
|
27
|
+
/** true → default person glyph; false → no icon; ReactNode → custom. */
|
|
28
|
+
leadingIcon?: boolean | React.ReactNode;
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
id?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
"aria-controls"?: string;
|
|
33
|
+
"aria-label"?: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const MenuTrigger: React.ForwardRefExoticComponent<MenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
36
|
+
export default MenuTrigger;
|
|
37
|
+
export declare function MenuTriggerMatrix(): import("react/jsx-runtime").JSX.Element;
|
package/dist/Modals.d.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modals — React ports of Embleema Design System 2.0's Layout modal family:
|
|
3
|
+
* - Modal (Figma node 5036:86) — feedback modal with Success /
|
|
4
|
+
* Warning / Error types
|
|
5
|
+
* - ModalNavigation (Figma node 5040:111) — native onboarding card with
|
|
6
|
+
* General / Medications / Labs /
|
|
7
|
+
* CareTeam types
|
|
8
|
+
* - ModalSurvey (Figma node 5038:7) — survey modal with prompt, slot
|
|
9
|
+
* for options, and optional
|
|
10
|
+
* free-text response area
|
|
11
|
+
*
|
|
12
|
+
* All three accept an `inline` prop. When `inline` is set, the modal renders
|
|
13
|
+
* as a static panel (no Scrim, no Overlay) — useful for design-system pages
|
|
14
|
+
* that want to display every variant side by side. When `inline` is omitted,
|
|
15
|
+
* the modal renders inside a Scrim overlay with click-to-dismiss + Escape.
|
|
16
|
+
*
|
|
17
|
+
* Color tokens used (per embleema-design-system.md):
|
|
18
|
+
* - Background/Default #FEFEFE
|
|
19
|
+
* - Background/Primary #F8F8F8
|
|
20
|
+
* - Background/Field #F8F8F8
|
|
21
|
+
* - Text/Primary #0E0E0E
|
|
22
|
+
* - Text/Secondary #5E5E5E
|
|
23
|
+
* - Text/Placeholder #848484
|
|
24
|
+
* - Text/Inverse #FEFEFE
|
|
25
|
+
* - Action/Primary/Background #306AE8
|
|
26
|
+
* - Action/Primary/Text #FEFEFE
|
|
27
|
+
* - Feedback/Success/Indicator #32A032
|
|
28
|
+
* - Feedback/Warning/Indicator #FA6400
|
|
29
|
+
* - Feedback/Error/Text #B31A1A
|
|
30
|
+
* - Purple/400 (ModalNav border) #644AD4
|
|
31
|
+
* - AI/Light (Survey textarea) #90B3FF
|
|
32
|
+
*/
|
|
33
|
+
import * as React from "react";
|
|
34
|
+
export type ModalType = "Success" | "Warning" | "Error";
|
|
35
|
+
export type ModalProps = {
|
|
36
|
+
type?: ModalType;
|
|
37
|
+
header: string;
|
|
38
|
+
body: string;
|
|
39
|
+
primaryLabel?: string;
|
|
40
|
+
onPrimaryClick?: () => void;
|
|
41
|
+
secondaryLabel?: string;
|
|
42
|
+
onSecondaryClick?: () => void;
|
|
43
|
+
closeButton?: boolean;
|
|
44
|
+
secondaryButton?: boolean;
|
|
45
|
+
/** When true, render the panel inline (no Scrim, ignores open/onClose). */
|
|
46
|
+
inline?: boolean;
|
|
47
|
+
/** Only used when inline is false. */
|
|
48
|
+
open?: boolean;
|
|
49
|
+
onClose?: () => void;
|
|
50
|
+
id?: string;
|
|
51
|
+
};
|
|
52
|
+
export declare function Modal(props: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export type ModalNavigationType = "General" | "Medications" | "Labs" | "CareTeam";
|
|
54
|
+
export type ModalNavigationProps = {
|
|
55
|
+
type?: ModalNavigationType;
|
|
56
|
+
title: string;
|
|
57
|
+
body: string;
|
|
58
|
+
primaryLabel?: string;
|
|
59
|
+
onPrimaryClick?: () => void;
|
|
60
|
+
secondaryLabel?: string;
|
|
61
|
+
onSecondaryClick?: () => void;
|
|
62
|
+
closeButton?: boolean;
|
|
63
|
+
secondaryButton?: boolean;
|
|
64
|
+
featureIcon?: React.ReactNode;
|
|
65
|
+
inline?: boolean;
|
|
66
|
+
open?: boolean;
|
|
67
|
+
onClose?: () => void;
|
|
68
|
+
id?: string;
|
|
69
|
+
};
|
|
70
|
+
export declare function ModalNavigation(props: ModalNavigationProps): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export type SurveyOption = {
|
|
72
|
+
value: string;
|
|
73
|
+
label: string;
|
|
74
|
+
};
|
|
75
|
+
export type ModalSurveyProps = {
|
|
76
|
+
header: string;
|
|
77
|
+
body: string;
|
|
78
|
+
prompt?: string;
|
|
79
|
+
options?: SurveyOption[];
|
|
80
|
+
/** Show the free-text response textarea. */
|
|
81
|
+
textInput?: boolean;
|
|
82
|
+
textInputLabel?: string;
|
|
83
|
+
textInputPlaceholder?: string;
|
|
84
|
+
primaryLabel?: string;
|
|
85
|
+
onPrimaryClick?: (selected: string[], text: string) => void;
|
|
86
|
+
secondaryLabel?: string;
|
|
87
|
+
onSecondaryClick?: () => void;
|
|
88
|
+
closeButton?: boolean;
|
|
89
|
+
secondaryButton?: boolean;
|
|
90
|
+
inline?: boolean;
|
|
91
|
+
open?: boolean;
|
|
92
|
+
onClose?: () => void;
|
|
93
|
+
id?: string;
|
|
94
|
+
};
|
|
95
|
+
export declare function ModalSurvey(props: ModalSurveyProps): import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
export declare function ModalsMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NativeBottomNav — React port of Embleema Design System 2.0's
|
|
3
|
+
* Navigation/BottomNav component (Figma node 5113:7) and the underlying
|
|
4
|
+
* Navigation/NavItem variant set (5112:15).
|
|
5
|
+
*
|
|
6
|
+
* Native app bottom navigation bar with 5 fixed sections (Home, Health,
|
|
7
|
+
* Studies, Tokens, Profile). Exactly one item is Active at a time; the icon
|
|
8
|
+
* and label both highlight in Action/Primary/Background when Active.
|
|
9
|
+
*
|
|
10
|
+
* Layout (per Figma):
|
|
11
|
+
* Bar:
|
|
12
|
+
* - bg Background/Default
|
|
13
|
+
* - shadow Elevation/100 (0 0 3 rgba(0,0,0,0.12))
|
|
14
|
+
* - flex items-center justify-between
|
|
15
|
+
* - padding 8 top, 24 bottom (safe-area), 24 horizontal
|
|
16
|
+
* - 390 px reference width (responsive FILL in production)
|
|
17
|
+
* NavItem:
|
|
18
|
+
* - flex-col items-center, gap 4
|
|
19
|
+
* - 24 × 24 icon
|
|
20
|
+
* - 12 / 16 Nunito Bold label, text-center, color per state
|
|
21
|
+
* - 44 × 44 minimum tap target (CSS padding inflates the visual 24-px
|
|
22
|
+
* icon column to meet the spec)
|
|
23
|
+
* Colors:
|
|
24
|
+
* - Active → Action/Primary/Background (#306AE8)
|
|
25
|
+
* - Inactive → Text/Placeholder (#848484)
|
|
26
|
+
*
|
|
27
|
+
* Accessibility (per Figma docs):
|
|
28
|
+
* - role="navigation" + aria-label="Main navigation" on the bar
|
|
29
|
+
* - role="tablist" inside; role="tab" on each item
|
|
30
|
+
* - Active item: aria-selected="true" + aria-current="page"
|
|
31
|
+
* - Icons aria-hidden; label carries the accessible name
|
|
32
|
+
*/
|
|
33
|
+
import * as React from "react";
|
|
34
|
+
export type NativeBottomNavValue = "home" | "health" | "studies" | "tokens" | "profile";
|
|
35
|
+
export type NativeBottomNavItem = {
|
|
36
|
+
value: NativeBottomNavValue;
|
|
37
|
+
label: string;
|
|
38
|
+
icon: React.ReactNode;
|
|
39
|
+
};
|
|
40
|
+
export type NativeBottomNavProps = {
|
|
41
|
+
/** Override the 5 default Embleema sections. */
|
|
42
|
+
items?: NativeBottomNavItem[];
|
|
43
|
+
/** Controlled active value. */
|
|
44
|
+
value?: NativeBottomNavValue | string;
|
|
45
|
+
defaultValue?: NativeBottomNavValue | string;
|
|
46
|
+
onChange?: (value: string) => void;
|
|
47
|
+
id?: string;
|
|
48
|
+
className?: string;
|
|
49
|
+
"aria-label"?: string;
|
|
50
|
+
};
|
|
51
|
+
export declare const NativeBottomNav: React.ForwardRefExoticComponent<NativeBottomNavProps & React.RefAttributes<HTMLElement>>;
|
|
52
|
+
export default NativeBottomNav;
|
|
53
|
+
export declare function NativeBottomNavMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { DropdownOption } from './Dropdown';
|
|
2
|
+
/**
|
|
3
|
+
* ObjectGroupField — React port of Embleema Design System 2.0's
|
|
4
|
+
* Clinical/Object Group Field component (Figma node 4730:460).
|
|
5
|
+
*
|
|
6
|
+
* Grouped measurement input for clinical data: a section heading plus one
|
|
7
|
+
* or more value fields and a unit-selector dropdown. Pre-configured for
|
|
8
|
+
* Weight / Height / Temperature / Other; responsive via Direction.
|
|
9
|
+
*
|
|
10
|
+
* Type → field set (per Figma):
|
|
11
|
+
* - Weight : [Value field labeled "Weight"] + [Unit dropdown]
|
|
12
|
+
* - Height : [Feet field] + [Inches field] + [Unit dropdown]
|
|
13
|
+
* - Temperature : [Value field labeled "Value"] + [Unit dropdown]
|
|
14
|
+
* - Other : [Value field labeled "Value"] + [Unit dropdown]
|
|
15
|
+
*
|
|
16
|
+
* Direction:
|
|
17
|
+
* - Horizontal → fields laid out side-by-side, each flex-1
|
|
18
|
+
* - Vertical → fields stacked full-width
|
|
19
|
+
*
|
|
20
|
+
* Composition: the unit picker uses the shared <Dropdown /> component so it
|
|
21
|
+
* inherits search, keyboard navigation, click-outside-to-close, and validation
|
|
22
|
+
* styling. The numeric value inputs are rendered inline (a plain styled
|
|
23
|
+
* <input>) since they don't need the full TextField molecule's chrome —
|
|
24
|
+
* simpler markup, closer to the Figma source.
|
|
25
|
+
*
|
|
26
|
+
* Props:
|
|
27
|
+
* - type / direction
|
|
28
|
+
* - heading : override the section heading (default per type)
|
|
29
|
+
* - value : controlled numeric value (Weight / Temperature / Other)
|
|
30
|
+
* - defaultValue : uncontrolled initial value
|
|
31
|
+
* - onValueChange
|
|
32
|
+
* - feetValue / defaultFeetValue / onFeetChange (Height only)
|
|
33
|
+
* - inchesValue / defaultInchesValue / onInchesChange (Height only)
|
|
34
|
+
* - unit / defaultUnit / onUnitChange
|
|
35
|
+
* - unitOptions : override the per-type default unit list
|
|
36
|
+
*/
|
|
37
|
+
import * as React from "react";
|
|
38
|
+
export type ObjectGroupFieldType = "Weight" | "Height" | "Temperature" | "Other";
|
|
39
|
+
export type ObjectGroupFieldDirection = "Horizontal" | "Vertical";
|
|
40
|
+
export type ObjectGroupFieldProps = {
|
|
41
|
+
type?: ObjectGroupFieldType;
|
|
42
|
+
direction?: ObjectGroupFieldDirection;
|
|
43
|
+
heading?: string;
|
|
44
|
+
value?: string;
|
|
45
|
+
defaultValue?: string;
|
|
46
|
+
onValueChange?: (next: string) => void;
|
|
47
|
+
feetValue?: string;
|
|
48
|
+
defaultFeetValue?: string;
|
|
49
|
+
onFeetChange?: (next: string) => void;
|
|
50
|
+
inchesValue?: string;
|
|
51
|
+
defaultInchesValue?: string;
|
|
52
|
+
onInchesChange?: (next: string) => void;
|
|
53
|
+
unit?: string;
|
|
54
|
+
defaultUnit?: string;
|
|
55
|
+
onUnitChange?: (next: string) => void;
|
|
56
|
+
unitOptions?: DropdownOption[];
|
|
57
|
+
id?: string;
|
|
58
|
+
className?: string;
|
|
59
|
+
"aria-label"?: string;
|
|
60
|
+
};
|
|
61
|
+
export declare const ObjectGroupField: React.ForwardRefExoticComponent<ObjectGroupFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
export default ObjectGroupField;
|
|
63
|
+
export declare function ObjectGroupFieldMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ParticipantActivityStatus — React port of Embleema Design System 2.0's
|
|
3
|
+
* Clinical/ParticipantActivityStatus component (Figma node 4740:31).
|
|
4
|
+
*
|
|
5
|
+
* Participant enrollment indicator: 24 × 24 icon + label showing where a
|
|
6
|
+
* participant sits in the study lifecycle. Used in participant lists,
|
|
7
|
+
* dashboards, and detail headers.
|
|
8
|
+
*
|
|
9
|
+
* Status → icon + label + fill (per Figma):
|
|
10
|
+
* - PendingAccount → person + gear → "Pending Sign-Up" → orange gradient #FCA266 → #FA6400
|
|
11
|
+
* - Onboarding → person + pencil → "Onboarding" → pink → blue #FF66AB → #6694FA
|
|
12
|
+
* - Participating → people + check → "Active" → teal stack #0A5A5C → #028388 → #00AFB2
|
|
13
|
+
* - NotParticipating → people + X → "Inactive" → Neutral/500 flat #B0B0B0
|
|
14
|
+
* - StudyComplete → check in circle → "Study Complete" → purple → blue #644AD4 → #2760DE
|
|
15
|
+
* - Ineligible → X in circle → "Ineligible" → Neutral/500 flat #B0B0B0
|
|
16
|
+
*
|
|
17
|
+
* The label is always Text/Primary; status identity is carried by the icon's
|
|
18
|
+
* gradient or flat fill, all of which are baked into the Figma source as raw
|
|
19
|
+
* primitives (gradient stops cannot be variable-bound in Figma, so we inline
|
|
20
|
+
* the same hex values).
|
|
21
|
+
*
|
|
22
|
+
* Type style: body/sm (Nunito Regular 14 / 1.5).
|
|
23
|
+
*
|
|
24
|
+
* Props:
|
|
25
|
+
* - status : PendingAccount | Onboarding | Participating | NotParticipating | StudyComplete | Ineligible
|
|
26
|
+
* - label : optional override (defaults to the per-status label)
|
|
27
|
+
*/
|
|
28
|
+
import * as React from "react";
|
|
29
|
+
export type ParticipantActivityStatusType = "PendingAccount" | "Onboarding" | "Participating" | "NotParticipating" | "StudyComplete" | "Ineligible";
|
|
30
|
+
export type ParticipantActivityStatusProps = {
|
|
31
|
+
status?: ParticipantActivityStatusType;
|
|
32
|
+
label?: string;
|
|
33
|
+
id?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
"aria-label"?: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const ParticipantActivityStatus: React.ForwardRefExoticComponent<ParticipantActivityStatusProps & React.RefAttributes<HTMLSpanElement>>;
|
|
38
|
+
export default ParticipantActivityStatus;
|
|
39
|
+
export declare function ParticipantActivityStatusMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ProgressBar — React port of Embleema Design System 2.0's Feedback/ProgressBar
|
|
3
|
+
* component (Figma node 4897:157).
|
|
4
|
+
*
|
|
5
|
+
* Determinate progress indicator. For unknown-duration loading, use Spinner
|
|
6
|
+
* or Loading instead.
|
|
7
|
+
*
|
|
8
|
+
* Sizes (track height per Figma):
|
|
9
|
+
* - Small → 4 px, 4 px radius
|
|
10
|
+
* - Medium → 7 px, pill radius
|
|
11
|
+
* - Large → 12 px, pill radius
|
|
12
|
+
*
|
|
13
|
+
* Styles:
|
|
14
|
+
* - Default → fill in Action/Primary/Background (#306AE8)
|
|
15
|
+
* - AI → fill is the Gradient/AI treatment (#90B3FF → #6F59CF)
|
|
16
|
+
*
|
|
17
|
+
* Track:
|
|
18
|
+
* - bg Background/Secondary (#F1F1F1), 1 px Border/Default outline.
|
|
19
|
+
*
|
|
20
|
+
* Label (optional, right of the bar):
|
|
21
|
+
* - Small → 12 px Nunito Regular 1.4
|
|
22
|
+
* - Medium → 14 px Nunito Regular 1.5
|
|
23
|
+
* - Large → 16 px Nunito Regular 1.5
|
|
24
|
+
* All in Text/Secondary.
|
|
25
|
+
*
|
|
26
|
+
* Props:
|
|
27
|
+
* - progress : 0–100 (number, clamped). Accepts any continuous value, not
|
|
28
|
+
* just the five Figma stops.
|
|
29
|
+
* - size : Small | Medium | Large
|
|
30
|
+
* - style : Default | AI
|
|
31
|
+
* - label : show the label (default false)
|
|
32
|
+
* - labelText : overrides the default "<progress>%" string
|
|
33
|
+
*
|
|
34
|
+
* NOTE: Figma defines a discrete "Medium / 100% / Default" variant with a 4 px
|
|
35
|
+
* track radius (the rest of Medium uses pill). That looks like a designer
|
|
36
|
+
* inconsistency and creates a visible "snap" when sliding through 100%, so
|
|
37
|
+
* we keep Medium at pill radius across all progress values. Verified
|
|
38
|
+
* intentional with: this matches the Medium/AI and Medium/<100% behavior;
|
|
39
|
+
* only the single Medium/100%/Default cell differs in the source.
|
|
40
|
+
*/
|
|
41
|
+
import * as React from "react";
|
|
42
|
+
export type ProgressBarSize = "Small" | "Medium" | "Large";
|
|
43
|
+
export type ProgressBarStyle = "Default" | "AI";
|
|
44
|
+
export type ProgressBarProps = {
|
|
45
|
+
progress?: number;
|
|
46
|
+
size?: ProgressBarSize;
|
|
47
|
+
style?: ProgressBarStyle;
|
|
48
|
+
label?: boolean;
|
|
49
|
+
labelText?: string;
|
|
50
|
+
id?: string;
|
|
51
|
+
className?: string;
|
|
52
|
+
"aria-label"?: string;
|
|
53
|
+
};
|
|
54
|
+
export declare const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
export default ProgressBar;
|
|
56
|
+
export declare function ProgressBarMatrix(): import("react/jsx-runtime").JSX.Element;
|