@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/Table.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table — React port of Embleema Design System 2.0's Layout/Table component
|
|
3
|
+
* (Figma node 813:3098). Responsive data table for structured records with
|
|
4
|
+
* sorting, row selection, inline row actions, navigation chevron, and
|
|
5
|
+
* pagination.
|
|
6
|
+
*
|
|
7
|
+
* Variants (per Figma):
|
|
8
|
+
* - Desktop (519:8918) — traditional row/column layout, ~1000 px wide
|
|
9
|
+
* - Mobile (813:3027) — card-based editable layout, 328 px wide
|
|
10
|
+
*
|
|
11
|
+
* Color tokens used (per embleema-design-system.md):
|
|
12
|
+
* - Background/Default #FEFEFE
|
|
13
|
+
* - Background/Primary #F8F8F8 — header band + pagination control
|
|
14
|
+
* - Border/Default #DDDDDD — row dividers + container outline
|
|
15
|
+
* - Border/Dark #0E0E0E — pagination control outline
|
|
16
|
+
* - Text/Primary #0E0E0E — body text and labels
|
|
17
|
+
* - Text/Secondary #5E5E5E — subtext and helper copy
|
|
18
|
+
* - Action/Primary/Background #306AE8 — checkbox fill + focus rings
|
|
19
|
+
*
|
|
20
|
+
* Typography:
|
|
21
|
+
* - Headers : body/md-semibold (Nunito SemiBold 16 / 1.5)
|
|
22
|
+
* - Rows : body/md (Nunito Regular 16 / 1.5)
|
|
23
|
+
* - Footer : body/sm (Nunito Regular 14 / 1.5)
|
|
24
|
+
*/
|
|
25
|
+
import * as React from "react";
|
|
26
|
+
export type SortDirection = "asc" | "desc" | null;
|
|
27
|
+
export type TableColumn<R> = {
|
|
28
|
+
/** Stable key used for sort state + cell access. */
|
|
29
|
+
key: string;
|
|
30
|
+
/** Header label. */
|
|
31
|
+
label: string;
|
|
32
|
+
/** Whether the column can be sorted. Default false. */
|
|
33
|
+
sortable?: boolean;
|
|
34
|
+
/** Cell renderer. Receives the row + key; default returns `row[key]` as string. */
|
|
35
|
+
render?: (row: R) => React.ReactNode;
|
|
36
|
+
/** Optional subtext renderer (line two of the cell). */
|
|
37
|
+
subtext?: (row: R) => React.ReactNode;
|
|
38
|
+
/** Sort comparator. Default does a string compare on `render` output. */
|
|
39
|
+
compare?: (a: R, b: R) => number;
|
|
40
|
+
};
|
|
41
|
+
export type TableSize = "Desktop" | "Mobile";
|
|
42
|
+
export type TableProps<R extends {
|
|
43
|
+
id: string;
|
|
44
|
+
}> = {
|
|
45
|
+
columns: TableColumn<R>[];
|
|
46
|
+
rows: R[];
|
|
47
|
+
size?: TableSize;
|
|
48
|
+
/** Show the selection checkbox column + bulk-select header. Default true. */
|
|
49
|
+
selectable?: boolean;
|
|
50
|
+
/** Controlled selected ids. */
|
|
51
|
+
selectedIds?: string[];
|
|
52
|
+
defaultSelectedIds?: string[];
|
|
53
|
+
onSelectionChange?: (ids: string[]) => void;
|
|
54
|
+
/** Controlled sort state. */
|
|
55
|
+
sort?: {
|
|
56
|
+
key: string;
|
|
57
|
+
direction: SortDirection;
|
|
58
|
+
};
|
|
59
|
+
onSortChange?: (next: {
|
|
60
|
+
key: string;
|
|
61
|
+
direction: SortDirection;
|
|
62
|
+
}) => void;
|
|
63
|
+
/** Show the "Actions" column with per-row action callbacks. Default true. */
|
|
64
|
+
showActions?: boolean;
|
|
65
|
+
actionLabel?: string;
|
|
66
|
+
onAction?: (row: R) => void;
|
|
67
|
+
onActionMenu?: (row: R) => void;
|
|
68
|
+
/** Show the trailing chevron-right column (per-row navigation). Default true. */
|
|
69
|
+
showRowChevron?: boolean;
|
|
70
|
+
onRowNavigate?: (row: R) => void;
|
|
71
|
+
/** Pagination controls. */
|
|
72
|
+
page?: number;
|
|
73
|
+
pageSize?: number;
|
|
74
|
+
totalCount?: number;
|
|
75
|
+
onPageChange?: (page: number) => void;
|
|
76
|
+
/** Custom "Showing X-Y of N" string (overrides the default). */
|
|
77
|
+
paginationLabel?: string;
|
|
78
|
+
id?: string;
|
|
79
|
+
className?: string;
|
|
80
|
+
};
|
|
81
|
+
export declare function Table<R extends {
|
|
82
|
+
id: string;
|
|
83
|
+
}>({ columns, rows, size, selectable, selectedIds, defaultSelectedIds, onSelectionChange, sort, onSortChange, showActions, actionLabel, onAction, onActionMenu, showRowChevron, onRowNavigate, page, pageSize, totalCount, onPageChange, paginationLabel, id, className, }: TableProps<R>): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
export default Table;
|
|
85
|
+
export declare function TableMatrix(): import("react/jsx-runtime").JSX.Element;
|
package/dist/Tag.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tag — React port of Embleema Design System 2.0's Feedback/Tag component
|
|
3
|
+
* (Figma node 4935:104).
|
|
4
|
+
*
|
|
5
|
+
* Read-only metadata label for categorization, status, or content tagging.
|
|
6
|
+
* Not interactive beyond optional dismissal. For interactive selection or
|
|
7
|
+
* filtering, use Selector/Chip instead.
|
|
8
|
+
*
|
|
9
|
+
* Structure mirrors the Figma source:
|
|
10
|
+
* pill (rounded-full, horizontal flex, padded)
|
|
11
|
+
* ├── leading icon (optional, 12px for Small / 16px for Medium)
|
|
12
|
+
* ├── label (Nunito Bold, uppercase, tracked — overline/sm or overline/lg)
|
|
13
|
+
* └── close button (optional, 10px for Small / 12px for Medium)
|
|
14
|
+
*
|
|
15
|
+
* Per-type backgrounds come directly from the Figma extraction:
|
|
16
|
+
* - Default → Action/Primary/Background (#306AE8) [semantic]
|
|
17
|
+
* - Success → Feedback/Success/Text (#288028) [semantic]
|
|
18
|
+
* - Warning → Feedback/Warning/Text (#E15A00) [semantic]
|
|
19
|
+
* - Error → Feedback/Error/Text (#B31A1A) [semantic]
|
|
20
|
+
* - Info → Teal/400 (#028388) [primitive — no semantic alias yet]
|
|
21
|
+
* - Brand → Pink/400 (#C20A72) [primitive — no semantic alias yet]
|
|
22
|
+
* Text on all types is Text/Inverse (#FEFEFE).
|
|
23
|
+
*
|
|
24
|
+
* Props:
|
|
25
|
+
* - type : Default | Success | Warning | Info | Error | Brand
|
|
26
|
+
* - size : Small (12px) | Medium (14px)
|
|
27
|
+
* - label : tag text (or use children for richer content)
|
|
28
|
+
* - leadingIcon : boolean → renders the default Status/Info glyph;
|
|
29
|
+
* React node → renders a custom icon at the right size
|
|
30
|
+
* - dismissible : show the close button
|
|
31
|
+
* - onDismiss : called when the close button is clicked
|
|
32
|
+
* - visible : controlled visibility
|
|
33
|
+
* - defaultVisible : uncontrolled initial visibility (default true)
|
|
34
|
+
*/
|
|
35
|
+
import * as React from "react";
|
|
36
|
+
export type TagType = "Default" | "Success" | "Warning" | "Info" | "Error" | "Brand";
|
|
37
|
+
export type TagSize = "Small" | "Medium";
|
|
38
|
+
export type TagProps = {
|
|
39
|
+
type?: TagType;
|
|
40
|
+
size?: TagSize;
|
|
41
|
+
label?: string;
|
|
42
|
+
children?: React.ReactNode;
|
|
43
|
+
leadingIcon?: boolean | React.ReactNode;
|
|
44
|
+
dismissible?: boolean;
|
|
45
|
+
onDismiss?: () => void;
|
|
46
|
+
visible?: boolean;
|
|
47
|
+
defaultVisible?: boolean;
|
|
48
|
+
id?: string;
|
|
49
|
+
className?: string;
|
|
50
|
+
"aria-label"?: string;
|
|
51
|
+
};
|
|
52
|
+
export declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>>;
|
|
53
|
+
export default Tag;
|
|
54
|
+
export declare function TagMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TaskStatus — React port of Embleema Design System 2.0's Task Status
|
|
3
|
+
* component (Figma node 5142:4683). Pairs a 20px TaskStatusIcon glyph with
|
|
4
|
+
* a Nunito Light status label, optionally followed by an AI sparkle badge
|
|
5
|
+
* when AI=true.
|
|
6
|
+
*
|
|
7
|
+
* Layout (per Figma):
|
|
8
|
+
* wrapper (flex, items-center, gap 4, height 24)
|
|
9
|
+
* ├── icon slot (20 × 20)
|
|
10
|
+
* └── Status + AI (flex, items-center, gap 4)
|
|
11
|
+
* ├── label (Body Medium/Light: Nunito 300, 16/24, Text/Primary)
|
|
12
|
+
* └── AI badge (Icon/Status/ArtificialIntelligence, visible when AI=true)
|
|
13
|
+
*
|
|
14
|
+
* Status → glyph mapping. TaskStatusIcon doesn't ship an explicit
|
|
15
|
+
* "IncompleteLate" variant because the Figma source reuses the Incomplete
|
|
16
|
+
* X glyph for both Incomplete and Incomplete Late (only the label differs).
|
|
17
|
+
*
|
|
18
|
+
* AI marker: Icon/Status/ArtificialIntelligence (Figma node 4052:2950)
|
|
19
|
+
* inlined as a 16-px tall sparkle that picks up the surrounding text color.
|
|
20
|
+
*/
|
|
21
|
+
import * as React from "react";
|
|
22
|
+
export type TaskStatusValue = "Complete" | "InProgress" | "InProgressLate" | "Incomplete" | "IncompleteLate" | "Skipped" | "NotApplicable" | "Upcoming";
|
|
23
|
+
export type TaskStatusProps = {
|
|
24
|
+
status: TaskStatusValue;
|
|
25
|
+
/** When true, render the AI sparkle badge after the label. */
|
|
26
|
+
ai?: boolean;
|
|
27
|
+
/** Override the default human-readable label. */
|
|
28
|
+
label?: string;
|
|
29
|
+
className?: string;
|
|
30
|
+
id?: string;
|
|
31
|
+
"aria-label"?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const TaskStatus: React.ForwardRefExoticComponent<TaskStatusProps & React.RefAttributes<HTMLSpanElement>>;
|
|
34
|
+
export default TaskStatus;
|
|
35
|
+
export declare function TaskStatusMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TaskStatusIcon — Embleema Design System 2.0 Task Status Icon (Figma
|
|
3
|
+
* node 5142:4723). Compact 20×20 glyph-only indicator used alongside task
|
|
4
|
+
* labels and in tight UI contexts like table cells.
|
|
5
|
+
*
|
|
6
|
+
* Variant families (read from Figma):
|
|
7
|
+
* - Gradient family — colored gradients applied directly to the glyph fill:
|
|
8
|
+
* Incomplete : Red (orange → red → pink, Gradient/Red)
|
|
9
|
+
* InProgress : Pink → blue (Gradient/Pink)
|
|
10
|
+
* InProgressLate : Orange (Gradient/Orange)
|
|
11
|
+
* Complete : Teal (Gradient/Green — Figma name; renders teal)
|
|
12
|
+
* - Gray family — flat #848484 (Neutral/500, text/disabled), no gradient:
|
|
13
|
+
* Skipped, NotApplicable, Upcoming
|
|
14
|
+
*
|
|
15
|
+
* InProgress and InProgressLate share the same clipboard-with-clock glyph
|
|
16
|
+
* (Icon/Files/ClipboardPending); only the gradient differs.
|
|
17
|
+
*/
|
|
18
|
+
import * as React from "react";
|
|
19
|
+
export type TaskStatusState = "Incomplete" | "InProgress" | "InProgressLate" | "Complete" | "Skipped" | "NotApplicable" | "Upcoming";
|
|
20
|
+
export type TaskStatusIconProps = {
|
|
21
|
+
state: TaskStatusState;
|
|
22
|
+
/** Accessible label. Defaults to "Status: <state>". */
|
|
23
|
+
"aria-label"?: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const TaskStatusIcon: React.ForwardRefExoticComponent<TaskStatusIconProps & React.RefAttributes<HTMLSpanElement>>;
|
|
28
|
+
export default TaskStatusIcon;
|
|
29
|
+
export declare function TaskStatusIconMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { FieldState, FieldValidation, FieldAppearance } from './Field';
|
|
2
|
+
/**
|
|
3
|
+
* TextArea — React port of Embleema Design System 2.0's Input/Text Area
|
|
4
|
+
* component (Figma node 4308:378). Composes the <Field> design language
|
|
5
|
+
* (same validation/state palette, label-group layout, helper-text rules) but
|
|
6
|
+
* wraps a multi-line <textarea> instead of an <input>.
|
|
7
|
+
*
|
|
8
|
+
* Structure mirrors the Figma source:
|
|
9
|
+
* wrapper
|
|
10
|
+
* ├── label (optional, body/md, htmlFor=textarea id)
|
|
11
|
+
* ├── textarea-field wrapper (rounded box with border/fill — matches Field)
|
|
12
|
+
* │ └── <textarea> (resizable, fills the wrapper)
|
|
13
|
+
* └── footer
|
|
14
|
+
* ├── helper text (optional)
|
|
15
|
+
* └── character counter (optional, "X/max" or "X")
|
|
16
|
+
*
|
|
17
|
+
* Props:
|
|
18
|
+
* - validation : None | Error | Warning | Success | AI
|
|
19
|
+
* - appearance : Filled | Outlined (renamed from Figma's "Style")
|
|
20
|
+
* - labelPosition : Top | Left
|
|
21
|
+
* - label, required, helperText
|
|
22
|
+
* - characterCounter : show the live "X/max" counter at footer-right
|
|
23
|
+
* - maxLength : forwarded to <textarea> and shown in the counter
|
|
24
|
+
* - rows : initial height in lines (default 4)
|
|
25
|
+
* - resize : none | vertical | horizontal | both (default "vertical")
|
|
26
|
+
* - plus standard textarea pass-through: value/defaultValue/onChange,
|
|
27
|
+
* placeholder, disabled, readOnly, id, name, aria-label
|
|
28
|
+
*/
|
|
29
|
+
import * as React from "react";
|
|
30
|
+
export type TextAreaLabelPosition = "Top" | "Left";
|
|
31
|
+
export type TextAreaProps = {
|
|
32
|
+
validation?: FieldValidation;
|
|
33
|
+
appearance?: FieldAppearance;
|
|
34
|
+
labelPosition?: TextAreaLabelPosition;
|
|
35
|
+
label?: string;
|
|
36
|
+
required?: boolean;
|
|
37
|
+
helperText?: string;
|
|
38
|
+
characterCounter?: boolean;
|
|
39
|
+
maxLength?: number;
|
|
40
|
+
rows?: number;
|
|
41
|
+
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
42
|
+
state?: FieldState;
|
|
43
|
+
value?: string;
|
|
44
|
+
defaultValue?: string;
|
|
45
|
+
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
46
|
+
placeholder?: string;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
readOnly?: boolean;
|
|
49
|
+
id?: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
className?: string;
|
|
52
|
+
"aria-label"?: string;
|
|
53
|
+
};
|
|
54
|
+
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
55
|
+
export default TextArea;
|
|
56
|
+
export declare function TextAreaMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { FieldState, FieldValidation, FieldAppearance } from './Field';
|
|
2
|
+
/**
|
|
3
|
+
* TextField — React port of Embleema Design System 2.0's Input/Text Field
|
|
4
|
+
* (Figma node 4201:149). Composes the lower-level <Field> base atom and
|
|
5
|
+
* adds an optional label group + helper text.
|
|
6
|
+
*
|
|
7
|
+
* Props:
|
|
8
|
+
* - validation : None | Error | Warning | Success | AI (passed to Field;
|
|
9
|
+
* also tints the label in Error and the helper text in Error)
|
|
10
|
+
* - appearance : Filled | Outlined (passed straight through to Field)
|
|
11
|
+
* - labelPosition : Top | Left (Top stacks; Left puts a 120 px label column
|
|
12
|
+
* on the left of a stack containing field + helper)
|
|
13
|
+
* - label : label string. Omit to hide the label.
|
|
14
|
+
* - required : adds a red "*" before the label
|
|
15
|
+
* - helperText : helper text string. Omit to hide.
|
|
16
|
+
* - state : optional forced state for previews (Pressed etc.)
|
|
17
|
+
* - plus the full Field passthrough: leadingIcon, trailingIcon, inlineButton,
|
|
18
|
+
* placeholder, value/defaultValue, onChange, disabled, readOnly, id, name,
|
|
19
|
+
* type, className, aria-label, etc.
|
|
20
|
+
*/
|
|
21
|
+
import * as React from "react";
|
|
22
|
+
export type TextFieldLabelPosition = "Top" | "Left";
|
|
23
|
+
export type TextFieldProps = {
|
|
24
|
+
validation?: FieldValidation;
|
|
25
|
+
appearance?: FieldAppearance;
|
|
26
|
+
labelPosition?: TextFieldLabelPosition;
|
|
27
|
+
label?: string;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
helperText?: string;
|
|
30
|
+
state?: FieldState;
|
|
31
|
+
leadingIcon?: React.ReactNode;
|
|
32
|
+
trailingIcon?: React.ReactNode;
|
|
33
|
+
inlineButton?: React.ReactNode;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
value?: string;
|
|
36
|
+
defaultValue?: string;
|
|
37
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
readOnly?: boolean;
|
|
40
|
+
id?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
type?: "text" | "email" | "password" | "number" | "tel" | "url" | "search";
|
|
43
|
+
className?: string;
|
|
44
|
+
"aria-label"?: string;
|
|
45
|
+
};
|
|
46
|
+
export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
47
|
+
export default TextField;
|
|
48
|
+
export declare function TextFieldMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FieldValidation, FieldAppearance } from './Field';
|
|
2
|
+
/**
|
|
3
|
+
* TimePicker — React port of the Embleema Design System 2.0 Input/TimePicker
|
|
4
|
+
* component (Figma node 4341:901). A molecule that wraps the base Field atom
|
|
5
|
+
* with a clock icon, an AM/PM segmented toggle (Figma node 4355:225), and
|
|
6
|
+
* the Time Picker Overlay (Figma node 4357:300) — a two-column scrolling
|
|
7
|
+
* Hour / Minute picker (using the Time Option atom, Figma node 4356:193).
|
|
8
|
+
*
|
|
9
|
+
* The overlay, toggle, and time-option chrome are all embedded as private
|
|
10
|
+
* sub-components — they only ship as part of TimePicker, not as standalone
|
|
11
|
+
* catalog entries.
|
|
12
|
+
*
|
|
13
|
+
* Behavior:
|
|
14
|
+
* - Clicking the field (or the clock icon) opens the overlay anchored
|
|
15
|
+
* below the field
|
|
16
|
+
* - Scrolling/clicking an hour or minute updates the draft selection
|
|
17
|
+
* - Cancel closes without writing; OK commits and closes
|
|
18
|
+
* - Toggling AM/PM updates the field's PM half directly
|
|
19
|
+
* - Outside click / Escape closes the overlay
|
|
20
|
+
*/
|
|
21
|
+
import * as React from "react";
|
|
22
|
+
export type TimePickerValidation = FieldValidation;
|
|
23
|
+
export type TimePickerStyle = FieldAppearance;
|
|
24
|
+
export type TimePickerLabelPosition = "Top" | "Left";
|
|
25
|
+
export type TimePickerMeridiem = "AM" | "PM";
|
|
26
|
+
export type TimePickerProps = {
|
|
27
|
+
validation?: TimePickerValidation;
|
|
28
|
+
style?: TimePickerStyle;
|
|
29
|
+
labelPosition?: TimePickerLabelPosition;
|
|
30
|
+
label?: boolean | string;
|
|
31
|
+
helperText?: boolean | string;
|
|
32
|
+
required?: boolean;
|
|
33
|
+
/** Controlled time string formatted "HH:MM AM/PM". */
|
|
34
|
+
value?: string;
|
|
35
|
+
defaultValue?: string;
|
|
36
|
+
onChange?: (value: string) => void;
|
|
37
|
+
id?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
readOnly?: boolean;
|
|
41
|
+
className?: string;
|
|
42
|
+
"aria-label"?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
|
|
45
|
+
export default TimePicker;
|
|
46
|
+
export declare function TimePickerMatrix(): import("react/jsx-runtime").JSX.Element;
|
package/dist/Toggle.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toggle — React port of Embleema Design System 2.0's Selector/Toggle
|
|
3
|
+
* component (Figma node 5221:23).
|
|
4
|
+
*
|
|
5
|
+
* Structure mirrors the Figma source:
|
|
6
|
+
* wrapper (<label>)
|
|
7
|
+
* ├── input (visually hidden, role=switch via aria-checked)
|
|
8
|
+
* └── track (52×32 pill)
|
|
9
|
+
* └── thumb (24×24 circle, slides via transform: translateX)
|
|
10
|
+
*
|
|
11
|
+
* Real `<input type="checkbox">` underneath provides keyboard support
|
|
12
|
+
* (Space toggles), form integration, and screen-reader semantics
|
|
13
|
+
* (announced as a switch because of role/aria-checked).
|
|
14
|
+
*
|
|
15
|
+
* Props:
|
|
16
|
+
* - state : forced override for previews
|
|
17
|
+
* (Default | Hover | Focus | Disabled)
|
|
18
|
+
* Omit to let real browser :hover / :focus-within
|
|
19
|
+
* drive Hover and Focus automatically.
|
|
20
|
+
* - selected : controlled on/off state (true = On, false = Off)
|
|
21
|
+
* - defaultSelected : uncontrolled initial state
|
|
22
|
+
* - disabled : maps to data-state="Disabled" + HTML disabled
|
|
23
|
+
* - onChange : called with the new selected boolean
|
|
24
|
+
* - name, value, id, aria-label : standard HTML passthrough
|
|
25
|
+
*/
|
|
26
|
+
import * as React from "react";
|
|
27
|
+
export type ToggleState = "Default" | "Hover" | "Focus" | "Disabled";
|
|
28
|
+
export type ToggleProps = {
|
|
29
|
+
state?: ToggleState;
|
|
30
|
+
selected?: boolean;
|
|
31
|
+
defaultSelected?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
onChange?: (selected: boolean) => void;
|
|
34
|
+
id?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
value?: string;
|
|
37
|
+
className?: string;
|
|
38
|
+
"aria-label"?: string;
|
|
39
|
+
};
|
|
40
|
+
export declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>;
|
|
41
|
+
export default Toggle;
|
|
42
|
+
export declare function ToggleMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip — React port of Embleema Design System 2.0's Feedback/Tooltip
|
|
3
|
+
* component (Figma node 4944:48).
|
|
4
|
+
*
|
|
5
|
+
* Contextual overlay triggered by hover or focus on a UI element. Wraps any
|
|
6
|
+
* child trigger and pops a styled card above (Top) or below (Bottom) it.
|
|
7
|
+
*
|
|
8
|
+
* Card structure (per Figma):
|
|
9
|
+
* - Background/Primary (#F8F8F8) + 1 px Border/Default
|
|
10
|
+
* - 8 px radius
|
|
11
|
+
* - 12 px padding all sides, 4 px gap between rows
|
|
12
|
+
* - drop-shadow: 0 0 3px rgba(0,0,0,0.12)
|
|
13
|
+
* - Optional title: body/sm-semibold (Nunito SemiBold 14/1.5, Text/Primary)
|
|
14
|
+
* - Body: body/sm-light (Nunito Light 14/1.5, Text/Secondary)
|
|
15
|
+
* - Optional action: 14 px Nunito Regular, Action/Primary/Background
|
|
16
|
+
*
|
|
17
|
+
* Arrow: 12 × 6 px triangle pointing back at the trigger, fill matches the
|
|
18
|
+
* card background, 1 px Border/Default stroke. Positioned so its inner edge
|
|
19
|
+
* overlaps the card's border by 1 px (hides the stroke seam).
|
|
20
|
+
*
|
|
21
|
+
* Visibility:
|
|
22
|
+
* - Driven by real :hover and :focus-within on the wrapper by default, so
|
|
23
|
+
* keyboard users see the tooltip too.
|
|
24
|
+
* - Pass `open` (with optional `onOpenChange`) for controlled visibility.
|
|
25
|
+
* - Subtle 150 ms opacity transition.
|
|
26
|
+
*
|
|
27
|
+
* Props:
|
|
28
|
+
* - position : Top | Bottom (default Top)
|
|
29
|
+
* - title : show the title row (default true)
|
|
30
|
+
* - titleText : title content (default "Title")
|
|
31
|
+
* - bodyText : body content (default "Tooltip description text")
|
|
32
|
+
* - actionButton : show the action button (default false)
|
|
33
|
+
* - actionLabel : action label (default "Button")
|
|
34
|
+
* - onActionClick : action callback
|
|
35
|
+
* - arrow : show the directional arrow (default true)
|
|
36
|
+
* - open : controlled visibility — disables the natural hover model
|
|
37
|
+
* - defaultOpen : uncontrolled initial visibility (debugging / matrix use)
|
|
38
|
+
* - children : the trigger element to wrap
|
|
39
|
+
*/
|
|
40
|
+
import * as React from "react";
|
|
41
|
+
export type TooltipPosition = "Top" | "Bottom";
|
|
42
|
+
export type TooltipProps = {
|
|
43
|
+
position?: TooltipPosition;
|
|
44
|
+
title?: boolean;
|
|
45
|
+
titleText?: string;
|
|
46
|
+
bodyText?: string;
|
|
47
|
+
actionButton?: boolean;
|
|
48
|
+
actionLabel?: string;
|
|
49
|
+
onActionClick?: () => void;
|
|
50
|
+
arrow?: boolean;
|
|
51
|
+
open?: boolean;
|
|
52
|
+
defaultOpen?: boolean;
|
|
53
|
+
children?: React.ReactNode;
|
|
54
|
+
id?: string;
|
|
55
|
+
className?: string;
|
|
56
|
+
};
|
|
57
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLSpanElement>>;
|
|
58
|
+
export default Tooltip;
|
|
59
|
+
export declare function TooltipMatrix(): import("react/jsx-runtime").JSX.Element;
|
package/dist/Upload.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Upload — React port of the Embleema Design System 2.0 Input/Upload
|
|
3
|
+
* component (Figma node 4434:95). A drag-and-drop file zone with primary
|
|
4
|
+
* instructions, file-format hint, and a "Choose File" button.
|
|
5
|
+
*
|
|
6
|
+
* State handling:
|
|
7
|
+
* - Default: white bg, dashed Border/Strong (#848484) outline
|
|
8
|
+
* - Hover: derived automatically when a file is being dragged over;
|
|
9
|
+
* swaps to Background/Selected fill + dashed Action/Primary outline
|
|
10
|
+
* - Focused: keyboard focus on the zone, dashed Action/Primary outline
|
|
11
|
+
* - HasFile: shows file preview card (thumbnail + name + Remove) plus a
|
|
12
|
+
* secondary drop zone for additional files
|
|
13
|
+
* - Error: Feedback/Error/Background fill + dashed Border/Error outline,
|
|
14
|
+
* error helper row in Feedback/Error/Text
|
|
15
|
+
* - Disabled / ReadOnly: muted, pointer-events suppressed
|
|
16
|
+
*
|
|
17
|
+
* Interaction:
|
|
18
|
+
* - Click on the zone (or the button) → opens the native file browser
|
|
19
|
+
* - Drag a file over the zone → flips to Hover state
|
|
20
|
+
* - Drop a file → flips to HasFile, fires onFileChange(file)
|
|
21
|
+
* - Remove → clears the file and fires onFileChange(null)
|
|
22
|
+
*/
|
|
23
|
+
import * as React from "react";
|
|
24
|
+
export type UploadState = "Default" | "Hover" | "Focused" | "HasFile" | "Error" | "Disabled" | "ReadOnly";
|
|
25
|
+
export type UploadProps = {
|
|
26
|
+
/** Force a visual state. When omitted, state is derived from drag + file. */
|
|
27
|
+
state?: UploadState;
|
|
28
|
+
label?: boolean | string;
|
|
29
|
+
helperText?: boolean | string;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
/** Primary instructions inside the drop zone. */
|
|
32
|
+
instructions?: string;
|
|
33
|
+
/** File-format hint shown beneath instructions. */
|
|
34
|
+
fileFormat?: string;
|
|
35
|
+
/** MIME / extension filter passed to the <input type="file">. */
|
|
36
|
+
accept?: string;
|
|
37
|
+
multiple?: boolean;
|
|
38
|
+
/** Controlled file (or first of multi). */
|
|
39
|
+
file?: File | null;
|
|
40
|
+
/** Uncontrolled initial file. */
|
|
41
|
+
defaultFile?: File | null;
|
|
42
|
+
onFileChange?: (file: File | null) => void;
|
|
43
|
+
id?: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
className?: string;
|
|
46
|
+
"aria-label"?: string;
|
|
47
|
+
};
|
|
48
|
+
export declare const Upload: React.ForwardRefExoticComponent<UploadProps & React.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
export default Upload;
|
|
50
|
+
export declare function UploadMatrix(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebTopNav — React port of Embleema Design System 2.0's
|
|
3
|
+
* Navigation/Web Top Nav (Figma node 5109:52). Top-of-page navigation bar
|
|
4
|
+
* with two breakpoint layouts:
|
|
5
|
+
*
|
|
6
|
+
* Desktop (full bar, 1280 px reference)
|
|
7
|
+
* ├── TopRow (logo, flex spacer, Account menu trigger)
|
|
8
|
+
* └── TabBar (horizontal tabs with brand-pink active underline)
|
|
9
|
+
*
|
|
10
|
+
* Mobile (condensed, 390 px reference)
|
|
11
|
+
* └── Row (logo, hamburger toggle)
|
|
12
|
+
*
|
|
13
|
+
* Colors map to the semantic tokens from embleema-design-system.md:
|
|
14
|
+
* - Background/Default (#FEFEFE) — bar surface
|
|
15
|
+
* - Border/Default (#DDDDDD) — TabBar bottom border
|
|
16
|
+
* - Text/Primary (#0E0E0E) — active tab + Account label
|
|
17
|
+
* - Text/Secondary (#5E5E5E) — inactive tab labels
|
|
18
|
+
* - Accent/Brand (#C20A72) — active tab underline
|
|
19
|
+
* - Action/Primary/Background (#306AE8) — logo + hamburger
|
|
20
|
+
*
|
|
21
|
+
* Tabs use the Primary TabBar style: 14 px Nunito, uppercase, letter-spacing
|
|
22
|
+
* 0.06em. Active tab is Nunito SemiBold with a 2 px pink underline; inactive
|
|
23
|
+
* tabs are Nunito Regular in Text/Secondary.
|
|
24
|
+
*/
|
|
25
|
+
import * as React from "react";
|
|
26
|
+
export type WebTopNavBreakpoint = "Desktop" | "Mobile";
|
|
27
|
+
export type WebTopNavTab = {
|
|
28
|
+
label: string;
|
|
29
|
+
active?: boolean;
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
};
|
|
32
|
+
export type WebTopNavProps = {
|
|
33
|
+
breakpoint?: WebTopNavBreakpoint;
|
|
34
|
+
/** Override the default 3-tab sample (Tab 1 / Connect Records / My Health). */
|
|
35
|
+
tabs?: WebTopNavTab[];
|
|
36
|
+
/** Account trigger label, shown on Desktop. Default "Account". */
|
|
37
|
+
accountLabel?: string;
|
|
38
|
+
onAccountClick?: () => void;
|
|
39
|
+
/** Fired when the Mobile hamburger is tapped. */
|
|
40
|
+
onMenuToggle?: () => void;
|
|
41
|
+
className?: string;
|
|
42
|
+
"aria-label"?: string;
|
|
43
|
+
};
|
|
44
|
+
export declare const WebTopNav: React.ForwardRefExoticComponent<WebTopNavProps & React.RefAttributes<HTMLElement>>;
|
|
45
|
+
export default WebTopNav;
|
|
46
|
+
export declare function WebTopNavMatrix(): import("react/jsx-runtime").JSX.Element;
|