@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
package/dist/Radio.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radio — React port of Embleema Design System 2.0's Selector/Radio component
|
|
3
|
+
* (Figma node 4258:824).
|
|
4
|
+
*
|
|
5
|
+
* Structure mirrors the Figma source:
|
|
6
|
+
* wrapper (HORIZONTAL, gap 8)
|
|
7
|
+
* ├── container (32×32 circle)
|
|
8
|
+
* │ └── state-layer (32×32, padding 4 — fills with a tint on
|
|
9
|
+
* │ hover/focus/pressed)
|
|
10
|
+
* │ ├── UncheckedIcon (20×20 hollow circle, visible when not selected)
|
|
11
|
+
* │ └── CheckedIcon (20×20 ring + dot, visible when selected)
|
|
12
|
+
* └── label (optional, body/md)
|
|
13
|
+
*
|
|
14
|
+
* Real `<input type="radio">` sits invisibly underneath the wrapper so that
|
|
15
|
+
* native group behaviour works: radios sharing a `name` attribute auto-deselect
|
|
16
|
+
* each other, keyboard arrow navigation works, screen readers announce the
|
|
17
|
+
* right semantics. Pass the same `name` to every Radio in a group.
|
|
18
|
+
*
|
|
19
|
+
* Props:
|
|
20
|
+
* - state : forced override for previews (Pressed/Hover/etc.)
|
|
21
|
+
* - selected : controlled checked state
|
|
22
|
+
* - defaultSelected : uncontrolled initial state
|
|
23
|
+
* - label : label string (clicking the label selects the radio)
|
|
24
|
+
* - disabled : maps to data-state="Disabled" + HTML disabled
|
|
25
|
+
* - name, value : standard HTML — required for grouping
|
|
26
|
+
* - onChange : called with the new selected boolean (true on selection)
|
|
27
|
+
*/
|
|
28
|
+
import * as React from "react";
|
|
29
|
+
export type RadioState = "Default" | "Hover" | "Focused" | "Pressed" | "Disabled";
|
|
30
|
+
export type RadioProps = {
|
|
31
|
+
state?: RadioState;
|
|
32
|
+
selected?: boolean;
|
|
33
|
+
defaultSelected?: boolean;
|
|
34
|
+
label?: string;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
onChange?: (selected: boolean) => void;
|
|
37
|
+
name?: string;
|
|
38
|
+
value?: string;
|
|
39
|
+
id?: string;
|
|
40
|
+
className?: string;
|
|
41
|
+
"aria-label"?: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
44
|
+
export default Radio;
|
|
45
|
+
export declare function RadioMatrix(): import("react/jsx-runtime").JSX.Element;
|
package/dist/Scrim.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scrim — React port of Embleema Design System 2.0's Layout/Scrim component
|
|
3
|
+
* (Figma node 5050:7). Full-screen dim overlay used behind modals and
|
|
4
|
+
* dialogs. Single component, no variants.
|
|
5
|
+
*
|
|
6
|
+
* Spec from Figma:
|
|
7
|
+
* - Fill: rgba(14, 14, 14, 0.32) — Text/Primary at 32 % opacity
|
|
8
|
+
* - No blur
|
|
9
|
+
* - Stretches to fill its positioning ancestor (default: viewport via
|
|
10
|
+
* position: fixed)
|
|
11
|
+
*
|
|
12
|
+
* The component is purely decorative (aria-hidden) per Figma's accessibility
|
|
13
|
+
* note. Pair it with a modal that owns the focus trap. Optional `onClick`
|
|
14
|
+
* lets the parent dismiss the modal when the user taps the scrim area.
|
|
15
|
+
*/
|
|
16
|
+
import * as React from "react";
|
|
17
|
+
export type ScrimProps = {
|
|
18
|
+
/** Render only when true. Default true (let callers handle visibility). */
|
|
19
|
+
visible?: boolean;
|
|
20
|
+
/** Fires when the scrim is clicked — wire to your modal's close handler. */
|
|
21
|
+
onClick?: () => void;
|
|
22
|
+
/** Position mode. "fixed" covers the viewport; "absolute" fills the nearest
|
|
23
|
+
* positioned ancestor (use for in-page previews). Default "fixed". */
|
|
24
|
+
position?: "fixed" | "absolute";
|
|
25
|
+
/** Stack order. Default 999. */
|
|
26
|
+
zIndex?: number;
|
|
27
|
+
id?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
/** Optional content to render inside the scrim (e.g. a modal). */
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
};
|
|
32
|
+
export declare const Scrim: React.ForwardRefExoticComponent<ScrimProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export default Scrim;
|
|
34
|
+
export declare function ScrimMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SectionHeader — Disclosure header for eCRF clinical forms.
|
|
3
|
+
*
|
|
4
|
+
* React port of Embleema Design System 2.0's Clinical/Section Header
|
|
5
|
+
* (Figma node 5017:38). A full-width row with the label left-aligned and
|
|
6
|
+
* a chevron right-aligned that toggles the section open/closed.
|
|
7
|
+
*
|
|
8
|
+
* Layout (matches Figma exactly):
|
|
9
|
+
* button (px 16, py 12, gap 8, radius 8, bg Background/Primary #F8F8F8)
|
|
10
|
+
* ├── label (Nunito Regular 20 / 1.2, Text/Primary, flex: 1, left)
|
|
11
|
+
* └── chevron (24 × 24, Neutral/500 #848484, right)
|
|
12
|
+
* - Collapsed: chevron-down (▼)
|
|
13
|
+
* - Expanded: chevron-up (▲) — same SVG rotated 180°
|
|
14
|
+
*
|
|
15
|
+
* Props:
|
|
16
|
+
* - state : forced override (Collapsed | Expanded)
|
|
17
|
+
* - defaultState : uncontrolled initial state (default "Collapsed")
|
|
18
|
+
* - onStateChange : called with the new state on click / keyboard activate
|
|
19
|
+
* - label : section label text (default "Label")
|
|
20
|
+
* - children : content rendered below the header when Expanded; omit
|
|
21
|
+
* for a header-only element
|
|
22
|
+
*/
|
|
23
|
+
import * as React from "react";
|
|
24
|
+
export type SectionHeaderState = "Collapsed" | "Expanded";
|
|
25
|
+
export type SectionHeaderProps = {
|
|
26
|
+
state?: SectionHeaderState;
|
|
27
|
+
defaultState?: SectionHeaderState;
|
|
28
|
+
onStateChange?: (next: SectionHeaderState) => void;
|
|
29
|
+
label?: string;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
id?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
"aria-label"?: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const SectionHeader: React.ForwardRefExoticComponent<SectionHeaderProps & React.RefAttributes<HTMLButtonElement>>;
|
|
36
|
+
export default SectionHeader;
|
|
37
|
+
export declare function SectionHeaderMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selector — React port of Embleema Design System 2.0's Selector/Selector
|
|
3
|
+
* component (Figma node 4240:53).
|
|
4
|
+
*
|
|
5
|
+
* A single option row. Used standalone or composed inside a Dropdown Menu's
|
|
6
|
+
* option list. Supports four content types and four states.
|
|
7
|
+
*
|
|
8
|
+
* Structure mirrors the Figma source:
|
|
9
|
+
* row (HORIZONTAL, gap 8, min-h 40, px 12, py 8)
|
|
10
|
+
* ├── (Checkbox type) Checkbox glyph (no built-in label)
|
|
11
|
+
* ├── (Radio type) Radio glyph (no built-in label)
|
|
12
|
+
* ├── (Icon type) LeadingIcon (20×20, optional)
|
|
13
|
+
* ├── label text (body/md, Nunito Light)
|
|
14
|
+
* └── trailing tooltip icon (20×20, optional info glyph)
|
|
15
|
+
*
|
|
16
|
+
* Selection model:
|
|
17
|
+
* - Plain / Icon : the whole row is the toggle. Click toggles `selected`.
|
|
18
|
+
* On Selected, the row gets the Background/Selected tint.
|
|
19
|
+
* - Checkbox : the Checkbox component owns the selected state visually.
|
|
20
|
+
* Clicking anywhere on the row toggles the checkbox.
|
|
21
|
+
* The row itself does NOT add the selected tint (the
|
|
22
|
+
* checkbox fill communicates selection).
|
|
23
|
+
* - Radio : same pattern as Checkbox but uses the Radio component
|
|
24
|
+
* and group `name` for native single-selection.
|
|
25
|
+
*
|
|
26
|
+
* Props:
|
|
27
|
+
* - type : Plain | Icon | Checkbox | Radio
|
|
28
|
+
* - state : forced visual override (Default | Hover | Selected | Disabled)
|
|
29
|
+
* - label : option text (defaults to "Option")
|
|
30
|
+
* - leadingIcon : when type=Icon — `true` renders the default placeholder
|
|
31
|
+
* glyph, or pass a React node for a custom icon
|
|
32
|
+
* - tooltip : show the trailing info icon
|
|
33
|
+
* - tooltipText : title text revealed on the trailing icon's :title
|
|
34
|
+
* - selected : controlled selection
|
|
35
|
+
* - defaultSelected : uncontrolled initial selection
|
|
36
|
+
* - disabled : maps to data-state="Disabled"
|
|
37
|
+
* - name, value : Radio group support (required for Radio type)
|
|
38
|
+
* - onChange : called with the new selected boolean
|
|
39
|
+
* - onClick : passthrough for row click
|
|
40
|
+
*/
|
|
41
|
+
import * as React from "react";
|
|
42
|
+
export type SelectorType = "Plain" | "Icon" | "Checkbox" | "Radio";
|
|
43
|
+
export type SelectorState = "Default" | "Hover" | "Selected" | "Disabled";
|
|
44
|
+
export type SelectorProps = {
|
|
45
|
+
type?: SelectorType;
|
|
46
|
+
state?: SelectorState;
|
|
47
|
+
label?: string;
|
|
48
|
+
leadingIcon?: boolean | React.ReactNode;
|
|
49
|
+
tooltip?: boolean;
|
|
50
|
+
tooltipText?: string;
|
|
51
|
+
selected?: boolean;
|
|
52
|
+
defaultSelected?: boolean;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
onChange?: (selected: boolean) => void;
|
|
55
|
+
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
56
|
+
name?: string;
|
|
57
|
+
value?: string;
|
|
58
|
+
id?: string;
|
|
59
|
+
className?: string;
|
|
60
|
+
"aria-label"?: string;
|
|
61
|
+
};
|
|
62
|
+
export declare const Selector: React.ForwardRefExoticComponent<SelectorProps & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
+
export default Selector;
|
|
64
|
+
export declare function SelectorMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectorOption — React port of the Embleema Design System 2.0
|
|
3
|
+
* Selector/Selector Option component (Figma node 4485:7). A card-style
|
|
4
|
+
* row option used inside Boolean fields, option grids, and card-based
|
|
5
|
+
* selection patterns. Supports a leading icon, a Radio indicator, a
|
|
6
|
+
* Checkbox indicator, and a plain text label.
|
|
7
|
+
*
|
|
8
|
+
* Color bindings (Figma extraction):
|
|
9
|
+
* - Default: bg Background/Field (#F8F8F8) + 1px Border/Default (#DDDDDD)
|
|
10
|
+
* - Hover: 1px Border/Focus (#306AE8), Background/Field
|
|
11
|
+
* - Focused: 1.5px Border/Focus (#306AE8) + focus ring
|
|
12
|
+
* - Selected: bg Background/Selected (#E3ECFF) + 1.5px Border/Focus
|
|
13
|
+
* - Error: bg Feedback/Error/Background + 1.5px Border/Error
|
|
14
|
+
* - Warning: bg Feedback/Warning/Background + 1.5px Feedback/Warning/Indicator
|
|
15
|
+
* - Success: bg Feedback/Success/Background + 1.5px Feedback/Success/Indicator
|
|
16
|
+
* - AI: bg Feedback/AI/Background (#C7D9FF) + 1.5px AI/Light (#90B3FF)
|
|
17
|
+
* - Disabled*: bg Background/Disabled (#F1F1F1) + 1.5px Border/Subtle
|
|
18
|
+
* - ReadOnly*: same chrome as Disabled but selection (if any) stays visible
|
|
19
|
+
*/
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
export type SelectorOptionState = "Default" | "Hover" | "Focused" | "Selected" | "Error" | "Warning" | "Success" | "AI" | "DisabledUnselected" | "DisabledSelected" | "ReadOnlyUnselected" | "ReadOnlySelected";
|
|
22
|
+
export type SelectorOptionProps = {
|
|
23
|
+
/** Force a visual state. When omitted, derived from selected + interaction. */
|
|
24
|
+
state?: SelectorOptionState;
|
|
25
|
+
label?: boolean | string;
|
|
26
|
+
leadingIcon?: boolean | React.ReactNode;
|
|
27
|
+
/** Render a Radio indicator inside the option. Mutually exclusive with checkbox. */
|
|
28
|
+
radio?: boolean;
|
|
29
|
+
/** Render a Checkbox indicator inside the option. */
|
|
30
|
+
checkbox?: boolean;
|
|
31
|
+
/** Controlled selection. */
|
|
32
|
+
selected?: boolean;
|
|
33
|
+
defaultSelected?: boolean;
|
|
34
|
+
onChange?: (selected: boolean) => void;
|
|
35
|
+
/** Underlying value passed to onChange via parent groups (not used internally). */
|
|
36
|
+
value?: string;
|
|
37
|
+
id?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
"aria-label"?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const SelectorOption: React.ForwardRefExoticComponent<SelectorOptionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
export default SelectorOption;
|
|
44
|
+
export declare function SelectorOptionMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectorOptionGroup — React port of Embleema Design System 2.0's
|
|
3
|
+
* Input/Selector Option Group (Figma node 4659:953). Groups multiple
|
|
4
|
+
* SelectorOption rows together with a shared label, single- or multi-select
|
|
5
|
+
* behavior, and group-level validation.
|
|
6
|
+
*
|
|
7
|
+
* Structure (per Figma):
|
|
8
|
+
* wrapper (LabelPosition=Top)
|
|
9
|
+
* ├── Label
|
|
10
|
+
* ├── Options column (gap 12)
|
|
11
|
+
* │ └── SelectorOption × N
|
|
12
|
+
* └── HelperText (Error only) ── Alert icon + message
|
|
13
|
+
*
|
|
14
|
+
* wrapper (LabelPosition=Left)
|
|
15
|
+
* ├── Label slot (fixed 120 px column)
|
|
16
|
+
* └── Right column
|
|
17
|
+
* ├── Options column
|
|
18
|
+
* └── HelperText (Error only)
|
|
19
|
+
*
|
|
20
|
+
* Selection model:
|
|
21
|
+
* - SelectionType="Single" → radio behavior. `value` is a single string.
|
|
22
|
+
* - SelectionType="Multi" → checkbox behavior. `value` is a string[].
|
|
23
|
+
*
|
|
24
|
+
* Group state propagation to each SelectorOption:
|
|
25
|
+
* - Default → child renders as Default / Selected based on per-option state
|
|
26
|
+
* - Error → child gets state="Error"
|
|
27
|
+
* - Disabled → child gets state="DisabledSelected" or "DisabledUnselected"
|
|
28
|
+
* - ReadOnly → child gets state="ReadOnlySelected" or "ReadOnlyUnselected"
|
|
29
|
+
*/
|
|
30
|
+
import * as React from "react";
|
|
31
|
+
export type SelectorOptionGroupState = "Default" | "Error" | "Disabled" | "ReadOnly";
|
|
32
|
+
export type SelectorOptionGroupLabelPosition = "Top" | "Left";
|
|
33
|
+
export type SelectorOptionGroupSelectionType = "Single" | "Multi";
|
|
34
|
+
export type SelectorOptionItem = {
|
|
35
|
+
value: string;
|
|
36
|
+
label: string;
|
|
37
|
+
};
|
|
38
|
+
export type SelectorOptionGroupProps = {
|
|
39
|
+
state?: SelectorOptionGroupState;
|
|
40
|
+
labelPosition?: SelectorOptionGroupLabelPosition;
|
|
41
|
+
selectionType?: SelectorOptionGroupSelectionType;
|
|
42
|
+
/** false hides the label, true uses DEFAULT_LABEL, string overrides. */
|
|
43
|
+
label?: boolean | string;
|
|
44
|
+
required?: boolean;
|
|
45
|
+
/** Controlled. Single → string. Multi → string[]. */
|
|
46
|
+
value?: string | string[];
|
|
47
|
+
/** Uncontrolled initial selection. */
|
|
48
|
+
defaultValue?: string | string[];
|
|
49
|
+
onChange?: (next: string | string[]) => void;
|
|
50
|
+
options: SelectorOptionItem[];
|
|
51
|
+
/** Shown beneath the options when state="Error". */
|
|
52
|
+
helperText?: string;
|
|
53
|
+
/** Shared `name` for the underlying inputs (radio grouping in Single mode). */
|
|
54
|
+
name?: string;
|
|
55
|
+
id?: string;
|
|
56
|
+
className?: string;
|
|
57
|
+
"aria-label"?: string;
|
|
58
|
+
};
|
|
59
|
+
export declare const SelectorOptionGroup: React.ForwardRefExoticComponent<SelectorOptionGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export default SelectorOptionGroup;
|
|
61
|
+
export declare function SelectorOptionGroupMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SliderBar — React port of the Embleema Design System 2.0 Input/Slider Bar
|
|
3
|
+
* (Figma node 4543:141). Interactive slider with four types:
|
|
4
|
+
* - Continuous: smooth dragging from min to max
|
|
5
|
+
* - Discrete: snaps to evenly-spaced steps (tick marks on the track)
|
|
6
|
+
* - Range: two thumbs for min/max selection
|
|
7
|
+
* - Scale: continuous-style drag, but track shows a blue→pink gradient
|
|
8
|
+
*
|
|
9
|
+
* Dimensions and color bindings pulled directly from Figma:
|
|
10
|
+
* - Track: 8px tall, 100px radius
|
|
11
|
+
* - Thumb: 24px circle, Action/Primary/Background (#306AE8) by default,
|
|
12
|
+
* Neutral/300 (#DDDDDD) when disabled, white-bordered when Scale
|
|
13
|
+
* - Track bg: Background/Selected (#E3ECFF) with Border/Focus-Ring
|
|
14
|
+
* (#A2BDF5) 1px outline
|
|
15
|
+
* - Active fill: gradient Blue/300 (#6694FA) → Blue/200 (#A2BDF5)
|
|
16
|
+
* - Scale track: linear gradient that mimics the radial blue→pink asset
|
|
17
|
+
* - Disabled track: Background/Disabled (#F1F1F1) with Neutral/300 fill
|
|
18
|
+
* - Number bubble (Active): Action/Primary/Background border, 4px radius
|
|
19
|
+
*
|
|
20
|
+
* "Active" state in Figma is forced for layout — at runtime it lights up
|
|
21
|
+
* automatically while the user is dragging a thumb.
|
|
22
|
+
*/
|
|
23
|
+
import * as React from "react";
|
|
24
|
+
export type SliderBarType = "Continuous" | "Discrete" | "Range" | "Scale";
|
|
25
|
+
export type SliderBarState = "Default" | "Active" | "Disabled";
|
|
26
|
+
export type SliderBarProps = {
|
|
27
|
+
type?: SliderBarType;
|
|
28
|
+
/** Force a visual state. When omitted, Active is derived from drag state. */
|
|
29
|
+
state?: SliderBarState;
|
|
30
|
+
min?: number;
|
|
31
|
+
max?: number;
|
|
32
|
+
/** Step for Discrete (default 1). Continuous/Scale/Range ignore. */
|
|
33
|
+
step?: number;
|
|
34
|
+
/** Number of tick marks for Discrete/Range (default 11 — 0,10,…,100). */
|
|
35
|
+
ticks?: number;
|
|
36
|
+
/** Single value (Continuous / Discrete / Scale) or [min, max] (Range). */
|
|
37
|
+
value?: number | [number, number];
|
|
38
|
+
defaultValue?: number | [number, number];
|
|
39
|
+
onChange?: (value: number | [number, number]) => void;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
className?: string;
|
|
42
|
+
"aria-label"?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const SliderBar: React.ForwardRefExoticComponent<SliderBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
+
export default SliderBar;
|
|
46
|
+
export declare function SliderBarMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SliderField — React port of the Embleema Design System 2.0
|
|
3
|
+
* Input/Slider Field component (Figma node 4634:231). A molecule that wraps
|
|
4
|
+
* the SliderBar atom with a label, 3 scale labels under the track, one or
|
|
5
|
+
* two numeric input fields, and a helper / error message row.
|
|
6
|
+
*
|
|
7
|
+
* Type mapping to SliderBar:
|
|
8
|
+
* - Slider → SliderBar type="Discrete" + a single numeric field below
|
|
9
|
+
* - Range → SliderBar type="Range" + two numeric fields (min / max)
|
|
10
|
+
* - Scale → SliderBar type="Scale", no numeric field
|
|
11
|
+
*
|
|
12
|
+
* Color bindings:
|
|
13
|
+
* - Default label: Text/Secondary (#5E5E5E) — per Figma
|
|
14
|
+
* - Error label: Text/Error (#E02020)
|
|
15
|
+
* - Disabled label: Text/Disabled (#848484)
|
|
16
|
+
* - Error field: Feedback/Error/Background (#FFE2E2) + Border/Error (#E02020)
|
|
17
|
+
* - Disabled field: Background/Disabled (#F1F1F1) + Border/Subtle (#F1F1F1)
|
|
18
|
+
* - Helper (error): Feedback/Error/Text (#B31A1A)
|
|
19
|
+
*/
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
export type SliderFieldType = "Slider" | "Range" | "Scale";
|
|
22
|
+
export type SliderFieldState = "Default" | "Error" | "Disabled" | "ReadOnly";
|
|
23
|
+
export type SliderFieldProps = {
|
|
24
|
+
type?: SliderFieldType;
|
|
25
|
+
state?: SliderFieldState;
|
|
26
|
+
label?: boolean | string;
|
|
27
|
+
helperText?: boolean | string;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
min?: number;
|
|
30
|
+
max?: number;
|
|
31
|
+
step?: number;
|
|
32
|
+
/** Number of evenly-spaced tick marks on the track (Slider/Range). */
|
|
33
|
+
ticks?: number;
|
|
34
|
+
/** Single value (Slider/Scale) or [min, max] (Range). */
|
|
35
|
+
value?: number | [number, number];
|
|
36
|
+
defaultValue?: number | [number, number];
|
|
37
|
+
onChange?: (value: number | [number, number]) => void;
|
|
38
|
+
/** Three labels positioned start / middle / end under the track. */
|
|
39
|
+
scaleLabels?: [string, string, string];
|
|
40
|
+
id?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
"aria-label"?: string;
|
|
44
|
+
};
|
|
45
|
+
export declare const SliderField: React.ForwardRefExoticComponent<SliderFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
export default SliderField;
|
|
47
|
+
export declare function SliderFieldMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snackbar — React port of Embleema Design System 2.0's Feedback/Snackbar
|
|
3
|
+
* component (Figma node 4913:219).
|
|
4
|
+
*
|
|
5
|
+
* Transient feedback toast. Single layout for short messages; Stacked layout
|
|
6
|
+
* (Figma calls it "Snackbar") wraps the action/close buttons onto a second
|
|
7
|
+
* row for longer text.
|
|
8
|
+
*
|
|
9
|
+
* Structure:
|
|
10
|
+
* Single (one row, items-center, gap 8, padding 8/12):
|
|
11
|
+
* [StatusIcon] [supporting text — flex 1] [(Action)] [(Close)]
|
|
12
|
+
*
|
|
13
|
+
* Stacked (flex-col, gap 4, padding 12):
|
|
14
|
+
* [StatusIcon] [supporting text — flex 1]
|
|
15
|
+
* [(Action)] [(Close)] (right-aligned)
|
|
16
|
+
*
|
|
17
|
+
* Type → border color + status icon (same icon set as Alert):
|
|
18
|
+
* - Success → Feedback/Success/Text + Icon/Status/Check (4052:2995)
|
|
19
|
+
* - Information → Feedback/Information/Text + Icon/Status/Info (4052:3158)
|
|
20
|
+
* - Warning → Feedback/Warning/Text + Icon/Status/Alert (4052:2918)
|
|
21
|
+
* - Error → Feedback/Error/Text + Icon/Action/CloseCircle (4052:3036)
|
|
22
|
+
*
|
|
23
|
+
* Fixed visual properties (per Figma):
|
|
24
|
+
* - Background: Background/Primary (#F8F8F8)
|
|
25
|
+
* - Width: 346px
|
|
26
|
+
* - Border: 2px solid (per type)
|
|
27
|
+
* - Radius: 4px
|
|
28
|
+
* - Drop shadow: 0 0 2px rgba(0,0,0,0.08)
|
|
29
|
+
* - Body text: body/md (Nunito Regular 16/1.5, Text/Primary)
|
|
30
|
+
* - Action text: 14 px Nunito Regular 1.5, Action/Primary/Background
|
|
31
|
+
*
|
|
32
|
+
* Props:
|
|
33
|
+
* - type : Success | Information | Warning | Error
|
|
34
|
+
* - layout : Single | Stacked
|
|
35
|
+
* - message : supporting text (or use children for richer content)
|
|
36
|
+
* - actionButton : show the text-button action (default false)
|
|
37
|
+
* - actionLabel : action label (default "Button")
|
|
38
|
+
* - onActionClick : action callback
|
|
39
|
+
* - closeButton : show the X (default true)
|
|
40
|
+
* - onClose : close callback
|
|
41
|
+
* - visible : controlled visibility
|
|
42
|
+
* - defaultVisible : uncontrolled initial visibility (default true)
|
|
43
|
+
* - duration : auto-dismiss ms (0 = never; default 0)
|
|
44
|
+
*/
|
|
45
|
+
import * as React from "react";
|
|
46
|
+
export type SnackbarType = "Success" | "Information" | "Warning" | "Error";
|
|
47
|
+
export type SnackbarLayout = "Single" | "Stacked";
|
|
48
|
+
export type SnackbarProps = {
|
|
49
|
+
type?: SnackbarType;
|
|
50
|
+
layout?: SnackbarLayout;
|
|
51
|
+
message?: string;
|
|
52
|
+
children?: React.ReactNode;
|
|
53
|
+
actionButton?: boolean;
|
|
54
|
+
actionLabel?: string;
|
|
55
|
+
onActionClick?: () => void;
|
|
56
|
+
closeButton?: boolean;
|
|
57
|
+
onClose?: () => void;
|
|
58
|
+
visible?: boolean;
|
|
59
|
+
defaultVisible?: boolean;
|
|
60
|
+
duration?: number;
|
|
61
|
+
id?: string;
|
|
62
|
+
className?: string;
|
|
63
|
+
"aria-label"?: string;
|
|
64
|
+
};
|
|
65
|
+
export declare const Snackbar: React.ForwardRefExoticComponent<SnackbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
export default Snackbar;
|
|
67
|
+
export declare function SnackbarMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spinner — React port of Embleema Design System 2.0's Feedback/SpinnerIcon
|
|
3
|
+
* component (Figma node 4885:25).
|
|
4
|
+
*
|
|
5
|
+
* Animated loading glyph. Used standalone, inside buttons / fields, or wrapped
|
|
6
|
+
* by Feedback/Loading.
|
|
7
|
+
*
|
|
8
|
+
* Sizes:
|
|
9
|
+
* - Small → 16 px
|
|
10
|
+
* - Medium → 20 px
|
|
11
|
+
* - Large → 32 px
|
|
12
|
+
*
|
|
13
|
+
* Styles:
|
|
14
|
+
* - Default → solid dots in Blue/400 (#306AE8)
|
|
15
|
+
* - AI → solid dots in AI/Base (#6F59CF)
|
|
16
|
+
*
|
|
17
|
+
* Visual treatment: a ring of 12 dots placed evenly around a circle. Each
|
|
18
|
+
* dot's opacity fades from 1.0 at the "head" down to ~0.15 at the tail, so
|
|
19
|
+
* when the wrapping <g> rotates clockwise the user sees a bright leading dot
|
|
20
|
+
* with a fading trail behind it. Animation is a 1.4 s linear infinite spin.
|
|
21
|
+
*/
|
|
22
|
+
import * as React from "react";
|
|
23
|
+
export type SpinnerSize = "Small" | "Medium" | "Large";
|
|
24
|
+
export type SpinnerStyle = "Default" | "AI";
|
|
25
|
+
export type SpinnerProps = {
|
|
26
|
+
size?: SpinnerSize;
|
|
27
|
+
style?: SpinnerStyle;
|
|
28
|
+
className?: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
"aria-label"?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
33
|
+
export default Spinner;
|
|
34
|
+
export declare function SpinnerMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatusBadge — React port of Embleema Design System 2.0's Clinical/Status
|
|
3
|
+
* Badge component (Figma node 4698:19).
|
|
4
|
+
*
|
|
5
|
+
* Small gradient indicator (16 × 16 pill inside a 20 × 20 padded frame) that
|
|
6
|
+
* communicates a clinical form's completion state. Per the Figma description,
|
|
7
|
+
* this is intended to be composed inside Clinical/FormStatusChip and form
|
|
8
|
+
* navigation surfaces — not used standalone — but it exports cleanly so the
|
|
9
|
+
* higher-level components can drop it in.
|
|
10
|
+
*
|
|
11
|
+
* Five types, each with a distinct gradient pulled directly from Figma:
|
|
12
|
+
* - NotStarted → #FEFEFE 23.66% → #D8D8D8 98.58% (top → bottom)
|
|
13
|
+
* + 1 px Border/Default outline
|
|
14
|
+
* - Valid → #0A595C 11.79% → #028388 55.28% → #00AFB2 99.99%
|
|
15
|
+
* (bottom → top)
|
|
16
|
+
* - WarningsFlagged → #FCA266 → #FA6400 100% (top → bottom)
|
|
17
|
+
* - ErrorsFlagged → #FA6400 → #E02020 56.5% → #FF66AB 100%
|
|
18
|
+
* (top → bottom)
|
|
19
|
+
* - LockedSubmitted → #644AD4 23.07% → #2760DE 90.48% (top → bottom)
|
|
20
|
+
* + 12 × 12 white lock icon (Icon/Utility/Lock)
|
|
21
|
+
*
|
|
22
|
+
* Note on tokens: the gradient stops are stored as raw hex values in the
|
|
23
|
+
* Figma source — none of them bind to semantic variables (Figma can't
|
|
24
|
+
* variable-bind gradient stops). Only NotStarted's border binds to
|
|
25
|
+
* Border/Default. The badge's surrounding 20 × 20 frame is inert chrome.
|
|
26
|
+
*
|
|
27
|
+
* Props:
|
|
28
|
+
* - type : NotStarted | Valid | WarningsFlagged | ErrorsFlagged | LockedSubmitted
|
|
29
|
+
*/
|
|
30
|
+
import * as React from "react";
|
|
31
|
+
export type StatusBadgeType = "NotStarted" | "Valid" | "WarningsFlagged" | "ErrorsFlagged" | "LockedSubmitted";
|
|
32
|
+
export type StatusBadgeProps = {
|
|
33
|
+
type?: StatusBadgeType;
|
|
34
|
+
id?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
"aria-label"?: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const StatusBadge: React.ForwardRefExoticComponent<StatusBadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
export default StatusBadge;
|
|
40
|
+
export declare function StatusBadgeMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatusMessage — React port of Embleema Design System 2.0's Feedback/Status
|
|
3
|
+
* Message component (Figma node 4921:27).
|
|
4
|
+
*
|
|
5
|
+
* Inline status text with a leading icon. Used for form-field validation
|
|
6
|
+
* feedback, helper messages, and contextual status indicators. Intentionally
|
|
7
|
+
* lightweight — no background, no border, no dismiss control.
|
|
8
|
+
*
|
|
9
|
+
* Structure:
|
|
10
|
+
* [20-px status icon] [12-px Nunito Regular text]
|
|
11
|
+
*
|
|
12
|
+
* Type → icon + text color (per Figma):
|
|
13
|
+
* - Error → Icon/Action/CloseCircle + Feedback/Error/Text (red icon AND red text)
|
|
14
|
+
* - Success → Icon/Status/Check + Text/Primary (green icon, neutral text)
|
|
15
|
+
* - Warning → Icon/Status/Alert + Text/Primary (orange icon, neutral text)
|
|
16
|
+
* - Information → Icon/Status/Info + Text/Primary (blue icon, neutral text)
|
|
17
|
+
*
|
|
18
|
+
* Per the Figma description, the Error variant is the only one that tints the
|
|
19
|
+
* text — every other type keeps Text/Primary so the message reads as standard
|
|
20
|
+
* helper copy with a colored marker.
|
|
21
|
+
*
|
|
22
|
+
* Type style: body/xs (Nunito Regular 12 / 1.4 / 0.12 px letter-spacing).
|
|
23
|
+
*
|
|
24
|
+
* Props:
|
|
25
|
+
* - type : Error | Success | Warning | Information
|
|
26
|
+
* - message : status text (or pass children for richer content)
|
|
27
|
+
*/
|
|
28
|
+
import * as React from "react";
|
|
29
|
+
export type StatusMessageType = "Error" | "Success" | "Warning" | "Information";
|
|
30
|
+
export type StatusMessageProps = {
|
|
31
|
+
type?: StatusMessageType;
|
|
32
|
+
message?: string;
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
id?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
"aria-label"?: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const StatusMessage: React.ForwardRefExoticComponent<StatusMessageProps & React.RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
export default StatusMessage;
|
|
40
|
+
export declare function StatusMessageMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StudyProgressSymbol — Embleema Design System 2.0 Clinical/Study Progress
|
|
3
|
+
* Symbol (Figma node 4753:7).
|
|
4
|
+
*
|
|
5
|
+
* Layout: 40×40 circular badge with a colored gradient background and a
|
|
6
|
+
* 24×24 white icon inside. The only exception is Late, which is a
|
|
7
|
+
* 43×40 rounded warning triangle with a white warning mark.
|
|
8
|
+
*
|
|
9
|
+
* Background colors are pulled directly from the Figma source per status.
|
|
10
|
+
* Inactive variants (Skipped, FutureVisit, FutureSurvey, Labwork,
|
|
11
|
+
* AdverseEvent, Medication, Withdrawal, Other, NA) use Figma's
|
|
12
|
+
* white-to-light-gray gradient and carry a 1px Border/Default outline so
|
|
13
|
+
* the circle reads against a white surface — the white icon inside will
|
|
14
|
+
* appear faint against that nearly-white background. Flag for review if
|
|
15
|
+
* those inactive variants need stronger backgrounds.
|
|
16
|
+
*/
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
export type StudyProgressStatus = "Complete" | "Incomplete" | "Current" | "Add" | "Late" | "StudyCompletion" | "Skipped" | "FutureVisit" | "FutureSurvey" | "Labwork" | "AdverseEvent" | "Medication" | "Withdrawal" | "Other" | "NA";
|
|
19
|
+
export type StudyProgressSymbolProps = {
|
|
20
|
+
status: StudyProgressStatus;
|
|
21
|
+
/** Accessible label. Defaults to "Status: <status>". */
|
|
22
|
+
"aria-label"?: string;
|
|
23
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
24
|
+
className?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const StudyProgressSymbol: React.ForwardRefExoticComponent<StudyProgressSymbolProps & React.RefAttributes<HTMLElement>>;
|
|
28
|
+
export default StudyProgressSymbol;
|
|
29
|
+
export declare function StudyProgressSymbolMatrix(): import("react/jsx-runtime").JSX.Element;
|
package/dist/Tab.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tab — React port of Embleema Design System 2.0's Navigation/TabItem
|
|
3
|
+
* (Figma node 5099:22) and Navigation/TabBar (Figma node 5331:38).
|
|
4
|
+
*
|
|
5
|
+
* Two exports:
|
|
6
|
+
* - <TabItem /> : the individual underline-style tab item.
|
|
7
|
+
* - <TabBar /> : an interactive horizontal bar of TabItems with a
|
|
8
|
+
* shared active value and onChange callback.
|
|
9
|
+
*
|
|
10
|
+
* TabItem layout (per Figma):
|
|
11
|
+
* flex flex-col items-center justify-center gap 6, pt 8, px 12
|
|
12
|
+
* - Label: 14 px Nunito, uppercase, letter-spacing 0.06em
|
|
13
|
+
* - Active label: Nunito SemiBold; Inactive: Regular
|
|
14
|
+
* - Active underline: 2 px strip, full width
|
|
15
|
+
*
|
|
16
|
+
* Color mapping:
|
|
17
|
+
* Default : Text/Secondary (#5E5E5E)
|
|
18
|
+
* Hover : Text/Primary (#0E0E0E) + Background/Selected fill
|
|
19
|
+
* Focus : Text/Primary + Background/Selected fill
|
|
20
|
+
* + 4 px Border/FocusRing outline
|
|
21
|
+
* Disabled : Text/Disabled (#B0B0B0)
|
|
22
|
+
* Primary Active : Text/Primary + Accent/Brand (#C20A72) underline
|
|
23
|
+
* Secondary Active: Blue/500 (#2655BA) + Blue/500 underline
|
|
24
|
+
*
|
|
25
|
+
* TabBar (per Figma):
|
|
26
|
+
* bg Background/Default, border-bottom 1 px Border/Default,
|
|
27
|
+
* gap 20, padding 0 40.
|
|
28
|
+
*/
|
|
29
|
+
import * as React from "react";
|
|
30
|
+
export type TabType = "Primary" | "Secondary";
|
|
31
|
+
export type TabState = "Default" | "Active" | "Hover" | "Focus" | "Disabled";
|
|
32
|
+
export type TabItemProps = {
|
|
33
|
+
label: string;
|
|
34
|
+
type?: TabType;
|
|
35
|
+
state?: TabState;
|
|
36
|
+
/** When true, ignores `state` and renders as Active. Used by TabBar. */
|
|
37
|
+
active?: boolean;
|
|
38
|
+
/** When true, ignores `state` and renders as Disabled. */
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
onClick?: () => void;
|
|
41
|
+
id?: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
"aria-controls"?: string;
|
|
44
|
+
};
|
|
45
|
+
export type TabBarItem = {
|
|
46
|
+
/** Stable id used as the active key. */
|
|
47
|
+
value: string;
|
|
48
|
+
label: string;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
};
|
|
51
|
+
export type TabBarProps = {
|
|
52
|
+
items: TabBarItem[];
|
|
53
|
+
/** Controlled active value. Falls back to the first item when omitted. */
|
|
54
|
+
value?: string;
|
|
55
|
+
defaultValue?: string;
|
|
56
|
+
onChange?: (value: string) => void;
|
|
57
|
+
type?: TabType;
|
|
58
|
+
className?: string;
|
|
59
|
+
"aria-label"?: string;
|
|
60
|
+
};
|
|
61
|
+
export declare const TabItem: React.ForwardRefExoticComponent<TabItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
62
|
+
export declare const TabBar: React.ForwardRefExoticComponent<TabBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
63
|
+
export default TabBar;
|
|
64
|
+
export declare function TabMatrix(): import("react/jsx-runtime").JSX.Element;
|