@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,115 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
EMPTY STATE COMPONENT
|
|
3
|
+
Placeholder for lists, tables, and searches
|
|
4
|
+
that have nothing to show
|
|
5
|
+
============================================ */
|
|
6
|
+
|
|
7
|
+
.ds-empty-state {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
text-align: center;
|
|
13
|
+
gap: var(--gap-md); /* 16px */
|
|
14
|
+
padding: var(--padding-xl); /* 32px */
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* ============================================
|
|
19
|
+
ICON
|
|
20
|
+
============================================ */
|
|
21
|
+
|
|
22
|
+
.ds-empty-state__icon {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 48px;
|
|
27
|
+
height: 48px;
|
|
28
|
+
border-radius: var(--radius-full);
|
|
29
|
+
background-color: var(--color-bg-container-primary);
|
|
30
|
+
color: var(--color-icon-primary);
|
|
31
|
+
flex-shrink: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.ds-empty-state__icon .material-symbols-rounded {
|
|
35
|
+
--icon-size: var(--icon-size-md);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* ============================================
|
|
39
|
+
CONTENT
|
|
40
|
+
============================================ */
|
|
41
|
+
|
|
42
|
+
.ds-empty-state__content {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: var(--gap-xs); /* 4px */
|
|
46
|
+
max-width: 420px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ds-empty-state__title {
|
|
50
|
+
font-family: var(--font-title-body-family);
|
|
51
|
+
font-size: var(--font-title-body-size);
|
|
52
|
+
font-weight: var(--font-title-body-weight);
|
|
53
|
+
line-height: var(--font-title-body-line-height);
|
|
54
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
55
|
+
color: var(--color-text-primary);
|
|
56
|
+
margin: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.ds-empty-state__description {
|
|
60
|
+
font-family: var(--font-paragraph-sm-family);
|
|
61
|
+
font-size: var(--font-paragraph-sm-size);
|
|
62
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
63
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
64
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
65
|
+
color: var(--color-text-tertiary);
|
|
66
|
+
margin: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* ============================================
|
|
70
|
+
ACTION
|
|
71
|
+
============================================ */
|
|
72
|
+
|
|
73
|
+
.ds-empty-state__action {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
gap: var(--gap-sm); /* 8px */
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* ============================================
|
|
82
|
+
VARIANT — BORDERED
|
|
83
|
+
Dashed container for use inside cards/tables
|
|
84
|
+
============================================ */
|
|
85
|
+
|
|
86
|
+
.ds-empty-state--bordered {
|
|
87
|
+
border: var(--border-xs) dashed var(--color-bg-container-border);
|
|
88
|
+
border-radius: var(--radius-md); /* 12px */
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* ============================================
|
|
92
|
+
SIZE — COMPACT
|
|
93
|
+
============================================ */
|
|
94
|
+
|
|
95
|
+
.ds-empty-state--compact {
|
|
96
|
+
gap: var(--gap-sm); /* 8px */
|
|
97
|
+
padding: var(--padding-lg); /* 20px */
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ds-empty-state--compact .ds-empty-state__icon {
|
|
101
|
+
width: 36px;
|
|
102
|
+
height: 36px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ds-empty-state--compact .ds-empty-state__icon .material-symbols-rounded {
|
|
106
|
+
--icon-size: var(--icon-size-sm);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ds-empty-state--compact .ds-empty-state__title {
|
|
110
|
+
font-family: var(--font-paragraph-em-family);
|
|
111
|
+
font-size: var(--font-paragraph-em-size);
|
|
112
|
+
font-weight: var(--font-paragraph-em-weight);
|
|
113
|
+
line-height: var(--font-paragraph-em-line-height);
|
|
114
|
+
letter-spacing: var(--font-paragraph-em-letter-spacing);
|
|
115
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface EmptyStateProps {
|
|
3
|
+
/** Material Symbol icon name, or a custom element (e.g. an illustration) */
|
|
4
|
+
icon?: string | React.ReactNode;
|
|
5
|
+
/** Short headline describing the empty condition */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Supporting copy — say what to do next, not just what is missing */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Action slot — typically one primary Button, optionally a secondary */
|
|
10
|
+
action?: React.ReactNode;
|
|
11
|
+
/** Component size */
|
|
12
|
+
size?: 'default' | 'compact';
|
|
13
|
+
/**
|
|
14
|
+
* Visual treatment. `plain` sits directly on the page; `bordered` draws a
|
|
15
|
+
* dashed container, which reads better inside a card, table, or panel.
|
|
16
|
+
*/
|
|
17
|
+
variant?: 'plain' | 'bordered';
|
|
18
|
+
/** Additional CSS classes */
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* EmptyState component — the placeholder shown when a list, table, search,
|
|
23
|
+
* or dashboard has nothing to display. Pairs an icon with a headline,
|
|
24
|
+
* supporting copy, and an optional action so the blank space still tells
|
|
25
|
+
* the user what to do next.
|
|
26
|
+
*/
|
|
27
|
+
export declare const EmptyState: ({ icon, title, description, action, size, variant, className, }: EmptyStateProps) => React.JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "./EmptyState.css";
|
|
4
|
+
import "../../fonts/material-symbols.css";
|
|
5
|
+
const EmptyState = ({
|
|
6
|
+
icon,
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
action,
|
|
10
|
+
size = "default",
|
|
11
|
+
variant = "plain",
|
|
12
|
+
className = ""
|
|
13
|
+
}) => {
|
|
14
|
+
const baseClass = "ds-empty-state";
|
|
15
|
+
const classes = [
|
|
16
|
+
baseClass,
|
|
17
|
+
`${baseClass}--${variant}`,
|
|
18
|
+
size === "compact" ? `${baseClass}--compact` : "",
|
|
19
|
+
className
|
|
20
|
+
].filter(Boolean).join(" ");
|
|
21
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, children: [
|
|
22
|
+
icon && /* @__PURE__ */ jsx("div", { className: `${baseClass}__icon`, "aria-hidden": "true", children: typeof icon === "string" ? /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", children: icon }) : icon }),
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
|
|
24
|
+
/* @__PURE__ */ jsx("p", { className: `${baseClass}__title`, children: title }),
|
|
25
|
+
description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description })
|
|
26
|
+
] }),
|
|
27
|
+
action && /* @__PURE__ */ jsx("div", { className: `${baseClass}__action`, children: action })
|
|
28
|
+
] });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
EmptyState
|
|
32
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
ENTITY CARD COMPONENT
|
|
3
|
+
Compact card with a centred icon or image
|
|
4
|
+
and a label. Used on Icons and Logos pages.
|
|
5
|
+
============================================ */
|
|
6
|
+
|
|
7
|
+
.ds-entity-card {
|
|
8
|
+
/* Layout */
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--gap-md);
|
|
13
|
+
|
|
14
|
+
/* Sizing */
|
|
15
|
+
flex: 1 1 0;
|
|
16
|
+
min-width: 100px;
|
|
17
|
+
|
|
18
|
+
/* Appearance */
|
|
19
|
+
background: var(--color-bg-container-primary);
|
|
20
|
+
border: var(--border-xs) solid var(--color-bg-container-border);
|
|
21
|
+
border-radius: var(--radius-xl);
|
|
22
|
+
padding: var(--padding-lg);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* ============================================
|
|
26
|
+
PREVIEW AREA
|
|
27
|
+
============================================ */
|
|
28
|
+
|
|
29
|
+
.ds-entity-card__preview {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
width: 100%;
|
|
34
|
+
min-height: 48px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* ============================================
|
|
38
|
+
ICON (Material Symbols Rounded)
|
|
39
|
+
============================================ */
|
|
40
|
+
|
|
41
|
+
.ds-entity-card__icon {
|
|
42
|
+
--icon-size: var(--icon-size-lg);
|
|
43
|
+
color: var(--color-text-primary);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* ============================================
|
|
47
|
+
IMAGE (Logo SVGs etc.)
|
|
48
|
+
============================================ */
|
|
49
|
+
|
|
50
|
+
.ds-entity-card__image {
|
|
51
|
+
max-width: 100%;
|
|
52
|
+
max-height: 48px;
|
|
53
|
+
object-fit: contain;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ============================================
|
|
57
|
+
LABEL
|
|
58
|
+
============================================ */
|
|
59
|
+
|
|
60
|
+
.ds-entity-card__label {
|
|
61
|
+
font-family: var(--font-paragraph-sm-family);
|
|
62
|
+
font-size: var(--font-paragraph-sm-size);
|
|
63
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
64
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
65
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
66
|
+
color: var(--color-text-tertiary);
|
|
67
|
+
text-align: center;
|
|
68
|
+
word-break: break-word;
|
|
69
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface EntityCardProps {
|
|
2
|
+
/** Display label beneath the icon / image */
|
|
3
|
+
label: string;
|
|
4
|
+
/** Material Symbol icon name rendered via the rounded font (e.g. "home") */
|
|
5
|
+
icon?: string;
|
|
6
|
+
/** Path to an image asset — used instead of icon when provided */
|
|
7
|
+
imageSrc?: string;
|
|
8
|
+
/** Alt text for the image */
|
|
9
|
+
imageAlt?: string;
|
|
10
|
+
/** Additional CSS classes */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* EntityCard
|
|
15
|
+
* A compact card with a centred icon (Material Symbols Rounded)
|
|
16
|
+
* or image and a label underneath. Used on Icons and Logos pages.
|
|
17
|
+
*/
|
|
18
|
+
export declare const EntityCard: ({ label, icon, imageSrc, imageAlt, className, }: EntityCardProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "./EntityCard.css";
|
|
3
|
+
const EntityCard = ({
|
|
4
|
+
label,
|
|
5
|
+
icon,
|
|
6
|
+
imageSrc,
|
|
7
|
+
imageAlt,
|
|
8
|
+
className = ""
|
|
9
|
+
}) => {
|
|
10
|
+
const baseClass = "ds-entity-card";
|
|
11
|
+
const classes = [baseClass, className].filter(Boolean).join(" ");
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { className: classes, children: [
|
|
13
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__preview`, children: imageSrc ? /* @__PURE__ */ jsx(
|
|
14
|
+
"img",
|
|
15
|
+
{
|
|
16
|
+
src: imageSrc,
|
|
17
|
+
alt: imageAlt || label,
|
|
18
|
+
className: `${baseClass}__image`
|
|
19
|
+
}
|
|
20
|
+
) : icon ? /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon material-symbols-rounded`, "aria-hidden": "true", children: icon }) : null }),
|
|
21
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label })
|
|
22
|
+
] });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
EntityCard
|
|
26
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
FIGURE COMPONENT
|
|
3
|
+
Image + caption in a rounded container.
|
|
4
|
+
Pass onClick for a zoomable (lightbox) figure.
|
|
5
|
+
============================================ */
|
|
6
|
+
|
|
7
|
+
.ds-figure {
|
|
8
|
+
margin: 0;
|
|
9
|
+
border-radius: var(--radius-md);
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
background-color: var(--color-bg-container-secondary);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* ============================================
|
|
15
|
+
MEDIA — child img/picture fills the width
|
|
16
|
+
============================================ */
|
|
17
|
+
|
|
18
|
+
.ds-figure__media {
|
|
19
|
+
display: block;
|
|
20
|
+
line-height: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ds-figure__media img {
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: auto;
|
|
26
|
+
display: block;
|
|
27
|
+
transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* ============================================
|
|
31
|
+
CAPTION
|
|
32
|
+
============================================ */
|
|
33
|
+
|
|
34
|
+
.ds-figure__caption {
|
|
35
|
+
display: block;
|
|
36
|
+
padding: var(--padding-md) var(--padding-lg);
|
|
37
|
+
border-top: var(--border-xs) solid var(--color-bg-container-border);
|
|
38
|
+
font-family: var(--font-paragraph-sm-family);
|
|
39
|
+
font-size: var(--font-paragraph-sm-size);
|
|
40
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
41
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
42
|
+
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
43
|
+
color: var(--color-text-tertiary);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* ============================================
|
|
47
|
+
ZOOMABLE (has onClick)
|
|
48
|
+
============================================ */
|
|
49
|
+
|
|
50
|
+
.ds-figure--zoomable {
|
|
51
|
+
cursor: zoom-in;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ds-figure--zoomable:hover .ds-figure__media img {
|
|
55
|
+
opacity: 0.88;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ds-figure--zoomable:focus-visible {
|
|
59
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
60
|
+
outline-offset: 2px;
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface FigureProps {
|
|
3
|
+
/** The image element — a plain <img> or a framework image component */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Caption rendered below the image */
|
|
6
|
+
caption?: React.ReactNode;
|
|
7
|
+
/** Click handler (e.g. open a lightbox) — adds zoom affordance + keyboard support */
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
/** Additional CSS classes */
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Figure component — an image with an optional caption in a bordered,
|
|
14
|
+
* rounded container. Pass onClick to make it zoomable (adds the
|
|
15
|
+
* zoom cursor, hover dim, and keyboard activation).
|
|
16
|
+
*/
|
|
17
|
+
export declare const Figure: ({ children, caption, onClick, className, }: FigureProps) => React.JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import "./Figure.css";
|
|
4
|
+
const Figure = ({
|
|
5
|
+
children,
|
|
6
|
+
caption,
|
|
7
|
+
onClick,
|
|
8
|
+
className = ""
|
|
9
|
+
}) => {
|
|
10
|
+
const baseClass = "ds-figure";
|
|
11
|
+
const classes = [baseClass, onClick && `${baseClass}--zoomable`, className].filter(Boolean).join(" ");
|
|
12
|
+
const onKeyDown = onClick ? (e) => {
|
|
13
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
14
|
+
e.preventDefault();
|
|
15
|
+
onClick();
|
|
16
|
+
}
|
|
17
|
+
} : void 0;
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
"figure",
|
|
20
|
+
{
|
|
21
|
+
className: classes,
|
|
22
|
+
onClick,
|
|
23
|
+
onKeyDown,
|
|
24
|
+
role: onClick ? "button" : void 0,
|
|
25
|
+
tabIndex: onClick ? 0 : void 0,
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__media`, children }),
|
|
28
|
+
caption && /* @__PURE__ */ jsx("figcaption", { className: `${baseClass}__caption`, children: caption })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
Figure
|
|
35
|
+
};
|