@robr0/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/LICENSE +21 -0
- package/README.md +127 -0
- package/charts.d.ts +14 -0
- package/charts.js +20 -0
- package/components/Accordion/Accordion.css +119 -0
- package/components/Accordion/Accordion.d.ts +24 -0
- package/components/Accordion/Accordion.js +76 -0
- package/components/Alert/Alert.css +252 -0
- package/components/Alert/Alert.d.ts +24 -0
- package/components/Alert/Alert.js +53 -0
- package/components/AlertDialog/AlertDialog.css +131 -0
- package/components/AlertDialog/AlertDialog.d.ts +29 -0
- package/components/AlertDialog/AlertDialog.js +143 -0
- package/components/AppLayout/AppLayout.css +52 -0
- package/components/AppLayout/AppLayout.d.ts +27 -0
- package/components/AppLayout/AppLayout.js +45 -0
- package/components/AppSidebar/AppSidebar.css +434 -0
- package/components/AppSidebar/AppSidebar.d.ts +67 -0
- package/components/AppSidebar/AppSidebar.js +272 -0
- package/components/Avatar/Avatar.css +133 -0
- package/components/Avatar/Avatar.d.ts +20 -0
- package/components/Avatar/Avatar.js +56 -0
- package/components/Avatar/demoAvatars.d.ts +14 -0
- package/components/Avatar/demoAvatars.js +16 -0
- package/components/Badge/Badge.css +68 -0
- package/components/Badge/Badge.d.ts +13 -0
- package/components/Badge/Badge.js +15 -0
- package/components/Breadcrumb/Breadcrumb.css +92 -0
- package/components/Breadcrumb/Breadcrumb.d.ts +19 -0
- package/components/Breadcrumb/Breadcrumb.js +39 -0
- package/components/Button/Button.css +381 -0
- package/components/Button/Button.d.ts +39 -0
- package/components/Button/Button.js +71 -0
- package/components/ButtonGroup/ButtonGroup.css +39 -0
- package/components/ButtonGroup/ButtonGroup.d.ts +13 -0
- package/components/ButtonGroup/ButtonGroup.js +37 -0
- package/components/Card/Card.css +169 -0
- package/components/Card/Card.d.ts +30 -0
- package/components/Card/Card.js +90 -0
- package/components/Carousel/Carousel.css +112 -0
- package/components/Carousel/Carousel.d.ts +25 -0
- package/components/Carousel/Carousel.js +126 -0
- package/components/Chart/AreaChart.d.ts +36 -0
- package/components/Chart/AreaChart.js +99 -0
- package/components/Chart/BarChart.d.ts +34 -0
- package/components/Chart/BarChart.js +107 -0
- package/components/Chart/Chart.css +176 -0
- package/components/Chart/LineChart.d.ts +34 -0
- package/components/Chart/LineChart.js +90 -0
- package/components/Chart/PieChart.d.ts +34 -0
- package/components/Chart/PieChart.js +106 -0
- package/components/Chart/RadarChart.d.ts +34 -0
- package/components/Chart/RadarChart.js +91 -0
- package/components/Chart/RadialChart.d.ts +37 -0
- package/components/Chart/RadialChart.js +119 -0
- package/components/Chart/ScatterChart.d.ts +36 -0
- package/components/Chart/ScatterChart.js +109 -0
- package/components/Chart/StackedBarChart.d.ts +34 -0
- package/components/Chart/StackedBarChart.js +111 -0
- package/components/Chart/Treemap.d.ts +33 -0
- package/components/Chart/Treemap.js +109 -0
- package/components/Checkbox/Checkbox.css +164 -0
- package/components/Checkbox/Checkbox.d.ts +45 -0
- package/components/Checkbox/Checkbox.js +125 -0
- package/components/Chip/Chip.css +195 -0
- package/components/Chip/Chip.d.ts +27 -0
- package/components/Chip/Chip.js +80 -0
- package/components/CircularButton/CircularButton.css +206 -0
- package/components/CircularButton/CircularButton.d.ts +30 -0
- package/components/CircularButton/CircularButton.js +54 -0
- package/components/CodeBlock/CodeBlock.css +180 -0
- package/components/CodeBlock/CodeBlock.d.ts +23 -0
- package/components/CodeBlock/CodeBlock.js +85 -0
- package/components/ColourSwatch/ColourSwatch.css +88 -0
- package/components/ColourSwatch/ColourSwatch.d.ts +34 -0
- package/components/ColourSwatch/ColourSwatch.js +42 -0
- package/components/Combobox/Combobox.css +411 -0
- package/components/Combobox/Combobox.d.ts +73 -0
- package/components/Combobox/Combobox.js +312 -0
- package/components/CommandPalette/CommandPalette.css +310 -0
- package/components/CommandPalette/CommandPalette.d.ts +60 -0
- package/components/CommandPalette/CommandPalette.js +263 -0
- package/components/ContactCard/ContactCard.css +123 -0
- package/components/ContactCard/ContactCard.d.ts +23 -0
- package/components/ContactCard/ContactCard.js +78 -0
- package/components/ContributionGraph/ContributionGraph.css +142 -0
- package/components/ContributionGraph/ContributionGraph.d.ts +26 -0
- package/components/ContributionGraph/ContributionGraph.js +125 -0
- package/components/DateInput/DateInput.css +163 -0
- package/components/DateInput/DateInput.d.ts +43 -0
- package/components/DateInput/DateInput.js +69 -0
- package/components/DatePicker/DatePicker.css +198 -0
- package/components/DatePicker/DatePicker.d.ts +22 -0
- package/components/DatePicker/DatePicker.js +170 -0
- package/components/Dialog/Dialog.css +176 -0
- package/components/Dialog/Dialog.d.ts +28 -0
- package/components/Dialog/Dialog.js +132 -0
- package/components/Divider/Divider.css +100 -0
- package/components/Divider/Divider.d.ts +18 -0
- package/components/Divider/Divider.js +31 -0
- package/components/Drawer/Drawer.css +262 -0
- package/components/Drawer/Drawer.d.ts +30 -0
- package/components/Drawer/Drawer.js +134 -0
- package/components/Dropdown/Dropdown.css +300 -0
- package/components/Dropdown/Dropdown.d.ts +48 -0
- package/components/Dropdown/Dropdown.js +196 -0
- package/components/DropdownMenu/DropdownMenu.css +303 -0
- package/components/DropdownMenu/DropdownMenu.d.ts +42 -0
- package/components/DropdownMenu/DropdownMenu.js +322 -0
- package/components/EmptyState/EmptyState.css +115 -0
- package/components/EmptyState/EmptyState.d.ts +27 -0
- package/components/EmptyState/EmptyState.js +32 -0
- package/components/EntityCard/EntityCard.css +69 -0
- package/components/EntityCard/EntityCard.d.ts +18 -0
- package/components/EntityCard/EntityCard.js +26 -0
- package/components/Figure/Figure.css +61 -0
- package/components/Figure/Figure.d.ts +17 -0
- package/components/Figure/Figure.js +35 -0
- package/components/FileInput/FileInput.css +308 -0
- package/components/FileInput/FileInput.d.ts +54 -0
- package/components/FileInput/FileInput.js +177 -0
- package/components/Input/Input.css +193 -0
- package/components/Input/Input.d.ts +40 -0
- package/components/Input/Input.js +71 -0
- package/components/Instructions/Instructions.css +216 -0
- package/components/Instructions/Instructions.d.ts +28 -0
- package/components/Instructions/Instructions.js +32 -0
- package/components/LinkList/LinkList.css +71 -0
- package/components/LinkList/LinkList.d.ts +20 -0
- package/components/LinkList/LinkList.js +41 -0
- package/components/MotionSwatch/MotionSwatch.css +176 -0
- package/components/MotionSwatch/MotionSwatch.d.ts +25 -0
- package/components/MotionSwatch/MotionSwatch.js +74 -0
- package/components/Nav/Nav.css +51 -0
- package/components/Nav/Nav.d.ts +19 -0
- package/components/Nav/Nav.js +26 -0
- package/components/Pagination/Pagination.css +126 -0
- package/components/Pagination/Pagination.d.ts +22 -0
- package/components/Pagination/Pagination.js +83 -0
- package/components/Popover/Popover.css +99 -0
- package/components/Popover/Popover.d.ts +28 -0
- package/components/Popover/Popover.js +102 -0
- package/components/ProgressBar/ProgressBar.css +60 -0
- package/components/ProgressBar/ProgressBar.d.ts +16 -0
- package/components/ProgressBar/ProgressBar.js +27 -0
- package/components/Quote/Quote.css +79 -0
- package/components/Quote/Quote.d.ts +18 -0
- package/components/Quote/Quote.js +26 -0
- package/components/RadioButton/RadioButton.css +132 -0
- package/components/RadioButton/RadioButton.d.ts +43 -0
- package/components/RadioButton/RadioButton.js +77 -0
- package/components/SectionTitle/SectionTitle.css +37 -0
- package/components/SectionTitle/SectionTitle.d.ts +10 -0
- package/components/SectionTitle/SectionTitle.js +17 -0
- package/components/SegmentedControl/SegmentedControl.css +129 -0
- package/components/SegmentedControl/SegmentedControl.d.ts +33 -0
- package/components/SegmentedControl/SegmentedControl.js +91 -0
- package/components/SelectionCard/SelectionCard.css +251 -0
- package/components/SelectionCard/SelectionCard.d.ts +26 -0
- package/components/SelectionCard/SelectionCard.js +85 -0
- package/components/Skeleton/Skeleton.css +79 -0
- package/components/Skeleton/Skeleton.d.ts +16 -0
- package/components/Skeleton/Skeleton.js +30 -0
- package/components/Slider/Slider.css +86 -0
- package/components/Slider/Slider.d.ts +25 -0
- package/components/Slider/Slider.js +46 -0
- package/components/SpacingSwatch/SpacingSwatch.css +108 -0
- package/components/SpacingSwatch/SpacingSwatch.d.ts +20 -0
- package/components/SpacingSwatch/SpacingSwatch.js +50 -0
- package/components/Spinner/Spinner.css +73 -0
- package/components/Spinner/Spinner.d.ts +14 -0
- package/components/Spinner/Spinner.js +42 -0
- package/components/Stat/Stat.css +78 -0
- package/components/Stat/Stat.d.ts +19 -0
- package/components/Stat/Stat.js +30 -0
- package/components/Table/Table.css +186 -0
- package/components/Table/Table.d.ts +45 -0
- package/components/Table/Table.js +65 -0
- package/components/Tabs/Tabs.css +140 -0
- package/components/Tabs/Tabs.d.ts +28 -0
- package/components/Tabs/Tabs.js +77 -0
- package/components/Textarea/Textarea.css +152 -0
- package/components/Textarea/Textarea.d.ts +40 -0
- package/components/Textarea/Textarea.js +74 -0
- package/components/Timeline/Timeline.css +339 -0
- package/components/Timeline/Timeline.d.ts +63 -0
- package/components/Timeline/Timeline.js +69 -0
- package/components/Toast/Toast.css +342 -0
- package/components/Toast/Toast.d.ts +63 -0
- package/components/Toast/Toast.js +213 -0
- package/components/ToggleGroup/ToggleGroup.css +84 -0
- package/components/ToggleGroup/ToggleGroup.d.ts +30 -0
- package/components/ToggleGroup/ToggleGroup.js +53 -0
- package/components/ToggleSwitch/ToggleSwitch.css +139 -0
- package/components/ToggleSwitch/ToggleSwitch.d.ts +23 -0
- package/components/ToggleSwitch/ToggleSwitch.js +50 -0
- package/components/Tooltip/Tooltip.css +122 -0
- package/components/Tooltip/Tooltip.d.ts +21 -0
- package/components/Tooltip/Tooltip.js +63 -0
- package/components/TypographySwatch/TypographySwatch.css +81 -0
- package/components/TypographySwatch/TypographySwatch.d.ts +24 -0
- package/components/TypographySwatch/TypographySwatch.js +40 -0
- package/components/registry.d.ts +20 -0
- package/components/registry.js +7 -0
- package/components/registry.json +67 -0
- package/components/registry.json.d.ts +70 -0
- package/components/registry.json.js +8 -0
- package/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.woff2 +0 -0
- package/fonts/material-symbols.css +94 -0
- package/index.d.ts +62 -0
- package/index.js +123 -0
- package/package.json +63 -0
- package/tokens/registry.d.ts +22 -0
- package/tokens/registry.js +14 -0
- package/tokens/registry.json +203 -0
- package/tokens/registry.json.d.ts +206 -0
- package/tokens/registry.json.js +8 -0
- package/tokens/tokens-dark.css +119 -0
- package/tokens/tokens-light.css +159 -0
- package/tokens/tokens-motion.css +68 -0
- package/tokens/tokens-primitives.css +176 -0
- package/tokens/tokens-typography.css +116 -0
- package/tokens/tokens.css +11 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
POPOVER COMPONENT
|
|
3
|
+
Contextual overlay panel
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-popover {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* ============================================
|
|
12
|
+
TRIGGER
|
|
13
|
+
============================================ */
|
|
14
|
+
|
|
15
|
+
.ds-popover__trigger {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* ============================================
|
|
21
|
+
PANEL
|
|
22
|
+
============================================ */
|
|
23
|
+
|
|
24
|
+
.ds-popover__panel {
|
|
25
|
+
position: absolute;
|
|
26
|
+
z-index: 10;
|
|
27
|
+
min-width: 200px;
|
|
28
|
+
padding: var(--padding-md); /* 16px */
|
|
29
|
+
border: var(--border-xs) solid var(--color-bg-container-border);
|
|
30
|
+
border-radius: var(--radius-sm); /* 8px */
|
|
31
|
+
background-color: var(--color-bg-container-primary);
|
|
32
|
+
box-shadow: var(--shadow-floating);
|
|
33
|
+
|
|
34
|
+
/* Hidden by default */
|
|
35
|
+
opacity: 0;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
transform: scale(0.96);
|
|
38
|
+
transition: opacity var(--motion-duration-base) var(--motion-ease-standard), transform var(--motion-duration-base) var(--motion-ease-standard);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.ds-popover__panel--open {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
pointer-events: auto;
|
|
44
|
+
transform: scale(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* ============================================
|
|
48
|
+
POSITION — BOTTOM (default)
|
|
49
|
+
============================================ */
|
|
50
|
+
|
|
51
|
+
.ds-popover__panel--bottom {
|
|
52
|
+
top: 100%;
|
|
53
|
+
left: 0;
|
|
54
|
+
margin-top: var(--gap-xxs); /* 2px */
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ============================================
|
|
58
|
+
POSITION — TOP
|
|
59
|
+
============================================ */
|
|
60
|
+
|
|
61
|
+
.ds-popover__panel--top {
|
|
62
|
+
bottom: 100%;
|
|
63
|
+
left: 0;
|
|
64
|
+
margin-bottom: var(--gap-xxs); /* 2px */
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* ============================================
|
|
68
|
+
POSITION — LEFT
|
|
69
|
+
============================================ */
|
|
70
|
+
|
|
71
|
+
.ds-popover__panel--left {
|
|
72
|
+
right: 100%;
|
|
73
|
+
top: 0;
|
|
74
|
+
margin-right: var(--gap-xxs); /* 2px */
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ============================================
|
|
78
|
+
POSITION — RIGHT
|
|
79
|
+
============================================ */
|
|
80
|
+
|
|
81
|
+
.ds-popover__panel--right {
|
|
82
|
+
left: 100%;
|
|
83
|
+
top: 0;
|
|
84
|
+
margin-left: var(--gap-xxs); /* 2px */
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* ============================================
|
|
88
|
+
SIZE — COMPACT
|
|
89
|
+
============================================ */
|
|
90
|
+
|
|
91
|
+
.ds-popover--compact {
|
|
92
|
+
padding: var(--padding-sm); /* 8px */
|
|
93
|
+
min-width: 160px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ds-popover--compact .ds-popover__panel {
|
|
97
|
+
padding: var(--padding-sm);
|
|
98
|
+
min-width: 160px;
|
|
99
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface PopoverProps {
|
|
3
|
+
/** Trigger element */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Popover content */
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
/** Component size */
|
|
8
|
+
size?: 'default' | 'compact';
|
|
9
|
+
/** Preferred position */
|
|
10
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
11
|
+
/** Trigger mode */
|
|
12
|
+
trigger?: 'click' | 'hover';
|
|
13
|
+
/** Whether the popover is open (controlled mode) */
|
|
14
|
+
open?: boolean;
|
|
15
|
+
/** Callback when open state changes */
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
/** Accessible label for the trigger */
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/** Additional CSS classes for the popover panel */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Popover component for contextual overlays.
|
|
24
|
+
* Wraps a trigger element and displays content in a
|
|
25
|
+
* positioned panel. Supports click and hover triggers
|
|
26
|
+
* with automatic outside-click dismissal.
|
|
27
|
+
*/
|
|
28
|
+
export declare const Popover: ({ children, content, size, position, trigger, open: controlledOpen, onOpenChange, ariaLabel, className, }: PopoverProps) => React.JSX.Element;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useRef, useCallback, useEffect } from "react";
|
|
3
|
+
import "./Popover.css";
|
|
4
|
+
const Popover = ({
|
|
5
|
+
children,
|
|
6
|
+
content,
|
|
7
|
+
size = "default",
|
|
8
|
+
position = "bottom",
|
|
9
|
+
trigger = "click",
|
|
10
|
+
open: controlledOpen,
|
|
11
|
+
onOpenChange,
|
|
12
|
+
ariaLabel,
|
|
13
|
+
className = ""
|
|
14
|
+
}) => {
|
|
15
|
+
const [internalOpen, setInternalOpen] = useState(false);
|
|
16
|
+
const containerRef = useRef(null);
|
|
17
|
+
const hoverTimeoutRef = useRef(void 0);
|
|
18
|
+
const isControlled = controlledOpen !== void 0;
|
|
19
|
+
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
20
|
+
const setOpen = useCallback((next) => {
|
|
21
|
+
if (!isControlled) {
|
|
22
|
+
setInternalOpen(next);
|
|
23
|
+
}
|
|
24
|
+
onOpenChange?.(next);
|
|
25
|
+
}, [isControlled, onOpenChange]);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!isOpen || trigger !== "click") return;
|
|
28
|
+
const handler = (e) => {
|
|
29
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
30
|
+
setOpen(false);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
document.addEventListener("mousedown", handler);
|
|
34
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
35
|
+
}, [isOpen, trigger, setOpen]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!isOpen) return;
|
|
38
|
+
const handler = (e) => {
|
|
39
|
+
if (e.key === "Escape") {
|
|
40
|
+
setOpen(false);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
document.addEventListener("keydown", handler);
|
|
44
|
+
return () => document.removeEventListener("keydown", handler);
|
|
45
|
+
}, [isOpen, setOpen]);
|
|
46
|
+
const handleClick = () => {
|
|
47
|
+
if (trigger === "click") {
|
|
48
|
+
setOpen(!isOpen);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const handleMouseEnter = () => {
|
|
52
|
+
if (trigger === "hover") {
|
|
53
|
+
clearTimeout(hoverTimeoutRef.current);
|
|
54
|
+
setOpen(true);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const handleMouseLeave = () => {
|
|
58
|
+
if (trigger === "hover") {
|
|
59
|
+
hoverTimeoutRef.current = setTimeout(() => setOpen(false), 150);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const baseClass = "ds-popover";
|
|
63
|
+
const sizeClass = `${baseClass}--${size}`;
|
|
64
|
+
const positionClass = `${baseClass}__panel--${position}`;
|
|
65
|
+
const openClass = isOpen ? `${baseClass}__panel--open` : "";
|
|
66
|
+
const containerClasses = [baseClass, className].filter(Boolean).join(" ");
|
|
67
|
+
const panelClasses = [`${baseClass}__panel`, sizeClass, positionClass, openClass].filter(Boolean).join(" ");
|
|
68
|
+
return /* @__PURE__ */ jsxs(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: containerClasses,
|
|
72
|
+
ref: containerRef,
|
|
73
|
+
onMouseEnter: handleMouseEnter,
|
|
74
|
+
onMouseLeave: handleMouseLeave,
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: `${baseClass}__trigger`,
|
|
80
|
+
onClick: handleClick,
|
|
81
|
+
role: trigger === "click" ? "button" : void 0,
|
|
82
|
+
tabIndex: trigger === "click" ? 0 : void 0,
|
|
83
|
+
"aria-expanded": isOpen,
|
|
84
|
+
"aria-label": ariaLabel,
|
|
85
|
+
"aria-haspopup": "dialog",
|
|
86
|
+
onKeyDown: (e) => {
|
|
87
|
+
if (trigger === "click" && (e.key === "Enter" || e.key === " ")) {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
setOpen(!isOpen);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
children
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: panelClasses, role: "dialog", "aria-hidden": !isOpen, children: content })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
export {
|
|
101
|
+
Popover
|
|
102
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
PROGRESS BAR COMPONENT
|
|
3
|
+
Displays completion progress as a horizontal bar
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-progress-bar {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: var(--padding-sm);
|
|
10
|
+
width: 100%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* ============================================
|
|
14
|
+
TRACK
|
|
15
|
+
============================================ */
|
|
16
|
+
|
|
17
|
+
.ds-progress-bar__track {
|
|
18
|
+
flex: 1;
|
|
19
|
+
height: 8px;
|
|
20
|
+
background-color: var(--color-bg-container-secondary);
|
|
21
|
+
border-radius: var(--radius-full);
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ds-progress-bar--compact .ds-progress-bar__track {
|
|
26
|
+
height: 4px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* ============================================
|
|
30
|
+
FILL
|
|
31
|
+
============================================ */
|
|
32
|
+
|
|
33
|
+
.ds-progress-bar__fill {
|
|
34
|
+
height: 100%;
|
|
35
|
+
border-radius: var(--radius-full);
|
|
36
|
+
transition: width var(--motion-duration-slow) var(--motion-ease-standard);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* ============================================
|
|
40
|
+
LABEL
|
|
41
|
+
============================================ */
|
|
42
|
+
|
|
43
|
+
.ds-progress-bar__label {
|
|
44
|
+
font-family: var(--font-paragraph-sm-em-family);
|
|
45
|
+
font-size: var(--font-paragraph-sm-em-size);
|
|
46
|
+
font-weight: var(--font-paragraph-sm-em-weight);
|
|
47
|
+
line-height: var(--font-paragraph-sm-em-line-height);
|
|
48
|
+
letter-spacing: var(--font-paragraph-sm-em-letter-spacing);
|
|
49
|
+
color: var(--color-text-secondary);
|
|
50
|
+
min-width: 36px;
|
|
51
|
+
text-align: right;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* ============================================
|
|
55
|
+
FILL COLOUR
|
|
56
|
+
============================================ */
|
|
57
|
+
|
|
58
|
+
.ds-progress-bar__fill {
|
|
59
|
+
background-color: var(--color-core-accent-mint);
|
|
60
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ProgressBarProps {
|
|
2
|
+
/** Current progress value (0–100) */
|
|
3
|
+
value?: number;
|
|
4
|
+
/** Size of the bar */
|
|
5
|
+
size?: 'default' | 'compact';
|
|
6
|
+
/** Show percentage label */
|
|
7
|
+
showLabel?: boolean;
|
|
8
|
+
/** Accessible label describing what is loading */
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
/** Additional CSS classes */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ProgressBar displays completion progress as a horizontal bar.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ProgressBar: ({ value, size, showLabel, ariaLabel, className, }: ProgressBarProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./ProgressBar.css";
|
|
3
|
+
const ProgressBar = ({
|
|
4
|
+
value = 0,
|
|
5
|
+
size = "default",
|
|
6
|
+
showLabel = false,
|
|
7
|
+
ariaLabel,
|
|
8
|
+
className = ""
|
|
9
|
+
}) => {
|
|
10
|
+
const clamped = Math.max(0, Math.min(100, value));
|
|
11
|
+
const baseClass = "ds-progress-bar";
|
|
12
|
+
const classes = [
|
|
13
|
+
baseClass,
|
|
14
|
+
`${baseClass}--${size}`,
|
|
15
|
+
className
|
|
16
|
+
].filter(Boolean).join(" ");
|
|
17
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, role: "progressbar", "aria-valuenow": clamped, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": ariaLabel, children: [
|
|
18
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__track`, children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__fill`, style: { width: `${clamped}%` } }) }),
|
|
19
|
+
showLabel && /* @__PURE__ */ jsxs("span", { className: `${baseClass}__label`, children: [
|
|
20
|
+
clamped,
|
|
21
|
+
"%"
|
|
22
|
+
] })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
ProgressBar
|
|
27
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
QUOTE COMPONENT
|
|
3
|
+
Inline blockquote or large pull-quote with
|
|
4
|
+
optional attribution.
|
|
5
|
+
============================================ */
|
|
6
|
+
|
|
7
|
+
.ds-quote {
|
|
8
|
+
margin: 0;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: var(--gap-sm);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ds-quote__text {
|
|
15
|
+
margin: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ============================================
|
|
19
|
+
VARIANT — DEFAULT (inline blockquote)
|
|
20
|
+
============================================ */
|
|
21
|
+
|
|
22
|
+
.ds-quote--default .ds-quote__text {
|
|
23
|
+
padding-left: var(--padding-lg);
|
|
24
|
+
border-left: var(--border-md) solid var(--color-bg-container-tertiary);
|
|
25
|
+
font-family: var(--font-paragraph-family);
|
|
26
|
+
font-size: var(--font-paragraph-size);
|
|
27
|
+
font-weight: var(--font-paragraph-weight);
|
|
28
|
+
line-height: var(--font-paragraph-line-height);
|
|
29
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
30
|
+
color: var(--color-text-secondary);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ds-quote--default .ds-quote__caption {
|
|
34
|
+
padding-left: var(--padding-lg);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* ============================================
|
|
38
|
+
VARIANT — PULL (large display quote)
|
|
39
|
+
Weight 300 display type per the
|
|
40
|
+
weight-contrast rule — no border, the scale
|
|
41
|
+
is the emphasis.
|
|
42
|
+
============================================ */
|
|
43
|
+
|
|
44
|
+
.ds-quote--pull .ds-quote__text {
|
|
45
|
+
font-family: var(--font-sub-display-family);
|
|
46
|
+
font-size: var(--font-sub-display-size);
|
|
47
|
+
font-weight: var(--font-sub-display-weight);
|
|
48
|
+
line-height: var(--font-sub-display-line-height);
|
|
49
|
+
letter-spacing: var(--font-sub-display-letter-spacing);
|
|
50
|
+
color: var(--color-text-primary);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ============================================
|
|
54
|
+
ATTRIBUTION
|
|
55
|
+
============================================ */
|
|
56
|
+
|
|
57
|
+
.ds-quote__caption {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: var(--gap-xxs);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ds-quote__attribution {
|
|
64
|
+
font-family: var(--font-paragraph-sm-em-family);
|
|
65
|
+
font-size: var(--font-paragraph-sm-em-size);
|
|
66
|
+
font-weight: var(--font-paragraph-sm-em-weight);
|
|
67
|
+
line-height: var(--font-paragraph-sm-em-line-height);
|
|
68
|
+
letter-spacing: var(--font-paragraph-sm-em-letter-spacing);
|
|
69
|
+
color: var(--color-text-primary);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ds-quote__detail {
|
|
73
|
+
font-family: var(--font-paragraph-sm-family);
|
|
74
|
+
font-size: var(--font-paragraph-sm-size);
|
|
75
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
76
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
77
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
78
|
+
color: var(--color-text-tertiary);
|
|
79
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface QuoteProps {
|
|
3
|
+
/** The quote text */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Who said it, e.g. "Rob Ritacca" */
|
|
6
|
+
attribution?: string;
|
|
7
|
+
/** Context under the attribution, e.g. "Design Lead, Intuit" */
|
|
8
|
+
detail?: string;
|
|
9
|
+
/** `default` is an inline blockquote; `pull` is a large display pull-quote */
|
|
10
|
+
variant?: 'default' | 'pull';
|
|
11
|
+
/** Additional CSS classes */
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Quote component — an inline blockquote or a large pull-quote,
|
|
16
|
+
* with optional attribution.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Quote: ({ children, attribution, detail, variant, className, }: QuoteProps) => React.JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "./Quote.css";
|
|
4
|
+
const Quote = ({
|
|
5
|
+
children,
|
|
6
|
+
attribution,
|
|
7
|
+
detail,
|
|
8
|
+
variant = "default",
|
|
9
|
+
className = ""
|
|
10
|
+
}) => {
|
|
11
|
+
const baseClass = "ds-quote";
|
|
12
|
+
const classes = [baseClass, `${baseClass}--${variant}`, className].filter(Boolean).join(" ");
|
|
13
|
+
return /* @__PURE__ */ jsxs("figure", { className: classes, children: [
|
|
14
|
+
/* @__PURE__ */ jsx("blockquote", { className: `${baseClass}__text`, children }),
|
|
15
|
+
(attribution || detail) && /* @__PURE__ */ jsxs("figcaption", { className: `${baseClass}__caption`, children: [
|
|
16
|
+
attribution && /* @__PURE__ */ jsxs("span", { className: `${baseClass}__attribution`, children: [
|
|
17
|
+
"— ",
|
|
18
|
+
attribution
|
|
19
|
+
] }),
|
|
20
|
+
detail && /* @__PURE__ */ jsx("span", { className: `${baseClass}__detail`, children: detail })
|
|
21
|
+
] })
|
|
22
|
+
] });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
Quote
|
|
26
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
RADIO BUTTON COMPONENT
|
|
3
|
+
Custom radio with animated dot indicator
|
|
4
|
+
============================================ */
|
|
5
|
+
|
|
6
|
+
.ds-radio {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
gap: var(--gap-sm); /* 8px */
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
user-select: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* ============================================
|
|
15
|
+
CIRCLE (outer ring)
|
|
16
|
+
============================================ */
|
|
17
|
+
|
|
18
|
+
.ds-radio__circle {
|
|
19
|
+
position: relative;
|
|
20
|
+
width: 24px;
|
|
21
|
+
height: 24px;
|
|
22
|
+
border: var(--border-md) solid var(--color-bg-container-border);
|
|
23
|
+
border-radius: var(--radius-full); /* 999px — perfect circle */
|
|
24
|
+
background-color: var(--color-bg-container-primary-transparent);
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
transition: border-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ============================================
|
|
33
|
+
DOT (inner fill)
|
|
34
|
+
============================================ */
|
|
35
|
+
|
|
36
|
+
.ds-radio__dot {
|
|
37
|
+
width: 12px;
|
|
38
|
+
height: 12px;
|
|
39
|
+
border-radius: var(--radius-full);
|
|
40
|
+
background-color: var(--color-action-primary-bg);
|
|
41
|
+
transform: scale(0);
|
|
42
|
+
transition: transform var(--motion-duration-base) var(--motion-ease-standard);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* ============================================
|
|
46
|
+
LABEL
|
|
47
|
+
============================================ */
|
|
48
|
+
|
|
49
|
+
.ds-radio__label {
|
|
50
|
+
font-family: var(--font-paragraph-family);
|
|
51
|
+
font-size: var(--font-paragraph-size);
|
|
52
|
+
font-weight: var(--font-paragraph-weight);
|
|
53
|
+
line-height: var(--font-paragraph-line-height);
|
|
54
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
55
|
+
color: var(--color-text-primary);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* ============================================
|
|
59
|
+
CHECKED STATE
|
|
60
|
+
============================================ */
|
|
61
|
+
|
|
62
|
+
.ds-radio--checked .ds-radio__circle {
|
|
63
|
+
border-color: var(--color-action-primary-bg);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ds-radio--checked .ds-radio__dot {
|
|
67
|
+
transform: scale(1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ============================================
|
|
71
|
+
HOVER STATE
|
|
72
|
+
============================================ */
|
|
73
|
+
|
|
74
|
+
.ds-radio:not(.ds-radio--disabled):hover .ds-radio__circle {
|
|
75
|
+
border-color: var(--color-action-primary-bg);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ds-radio--checked:not(.ds-radio--disabled):hover .ds-radio__circle {
|
|
79
|
+
border-color: var(--color-action-primary-bg-hover);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ds-radio--checked:not(.ds-radio--disabled):hover .ds-radio__dot {
|
|
83
|
+
background-color: var(--color-action-primary-bg-hover);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* ============================================
|
|
87
|
+
FOCUS STATE
|
|
88
|
+
============================================ */
|
|
89
|
+
|
|
90
|
+
.ds-radio:focus-visible .ds-radio__circle {
|
|
91
|
+
outline: var(--border-md) solid var(--color-action-primary-border-tertiary);
|
|
92
|
+
outline-offset: 2px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* ============================================
|
|
96
|
+
DISABLED STATE
|
|
97
|
+
============================================ */
|
|
98
|
+
|
|
99
|
+
.ds-radio--disabled {
|
|
100
|
+
opacity: 0.4;
|
|
101
|
+
cursor: not-allowed;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* ============================================
|
|
105
|
+
RADIO GROUP
|
|
106
|
+
============================================ */
|
|
107
|
+
|
|
108
|
+
.ds-radio-group {
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-direction: column;
|
|
111
|
+
gap: var(--gap-sm); /* 8px */
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ds-radio-group__label {
|
|
115
|
+
font-family: var(--font-paragraph-em-family);
|
|
116
|
+
font-size: var(--font-paragraph-em-size);
|
|
117
|
+
font-weight: var(--font-paragraph-em-weight);
|
|
118
|
+
line-height: var(--font-paragraph-em-line-height);
|
|
119
|
+
letter-spacing: var(--font-paragraph-em-letter-spacing);
|
|
120
|
+
color: var(--color-text-primary);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ds-radio-group__options {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: var(--gap-sm); /* 8px */
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ds-radio-group--horizontal .ds-radio-group__options {
|
|
130
|
+
flex-direction: row;
|
|
131
|
+
gap: var(--gap-lg); /* 20px */
|
|
132
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RadioButtonProps {
|
|
3
|
+
/** Label text */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Whether this radio is selected */
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
/** Whether the radio is disabled */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Radio group name — groups radios together */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Value for this radio option */
|
|
12
|
+
value?: string;
|
|
13
|
+
/** Callback when selected */
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
/** Additional CSS classes */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Accessible label override */
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/** HTML id attribute */
|
|
20
|
+
id?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const RadioButton: ({ label, checked, disabled, value, onChange, className, ariaLabel, }: RadioButtonProps) => React.JSX.Element;
|
|
23
|
+
export interface RadioGroupProps {
|
|
24
|
+
/** Group label */
|
|
25
|
+
label?: string;
|
|
26
|
+
/** Currently selected value */
|
|
27
|
+
value?: string;
|
|
28
|
+
/** Radio group name */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Radio options */
|
|
31
|
+
options: {
|
|
32
|
+
label: string;
|
|
33
|
+
value: string;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}[];
|
|
36
|
+
/** Layout direction */
|
|
37
|
+
direction?: 'vertical' | 'horizontal';
|
|
38
|
+
/** Callback when selection changes */
|
|
39
|
+
onChange?: (value: string) => void;
|
|
40
|
+
/** Additional CSS classes */
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare const RadioGroup: ({ label, value, name, options, direction, onChange, className, }: RadioGroupProps) => React.JSX.Element;
|