@sakaniui/react 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 +131 -0
- package/dist/components/Accordion/Accordion.d.ts +18 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Alert/Alert.d.ts +13 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/ActivityFeed/ActivityFeed.d.ts +27 -0
- package/dist/components/ApplicationComponents/ActivityFeed/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/Announcement/Announcement.d.ts +15 -0
- package/dist/components/ApplicationComponents/Announcement/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/AvatarUpload/AvatarUpload.d.ts +20 -0
- package/dist/components/ApplicationComponents/AvatarUpload/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/Balance/Balance.d.ts +21 -0
- package/dist/components/ApplicationComponents/Balance/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/CodeSnippet/CodeSnippet.d.ts +16 -0
- package/dist/components/ApplicationComponents/CodeSnippet/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/Expenses/Expenses.d.ts +18 -0
- package/dist/components/ApplicationComponents/Expenses/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/InlineHint/InlineHint.d.ts +9 -0
- package/dist/components/ApplicationComponents/InlineHint/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/Modal/Modal.d.ts +43 -0
- package/dist/components/ApplicationComponents/Modal/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/NotificationItem/NotificationItem.d.ts +19 -0
- package/dist/components/ApplicationComponents/NotificationItem/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/ProgressItem/ProgressItem.d.ts +15 -0
- package/dist/components/ApplicationComponents/ProgressItem/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/ProgressStat/ProgressStat.d.ts +11 -0
- package/dist/components/ApplicationComponents/ProgressStat/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/RichSeparator/RichSeparator.d.ts +10 -0
- package/dist/components/ApplicationComponents/RichSeparator/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/SpendingBalance/SpendingBalance.d.ts +11 -0
- package/dist/components/ApplicationComponents/SpendingBalance/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/StockMarket/StockMarket.d.ts +22 -0
- package/dist/components/ApplicationComponents/StockMarket/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/Tags/Tags.d.ts +9 -0
- package/dist/components/ApplicationComponents/Tags/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/Ticker/Ticker.d.ts +14 -0
- package/dist/components/ApplicationComponents/Ticker/index.d.ts +2 -0
- package/dist/components/ApplicationComponents/Transactions/Transactions.d.ts +18 -0
- package/dist/components/ApplicationComponents/Transactions/index.d.ts +2 -0
- package/dist/components/AreaChart/AreaChart.d.ts +21 -0
- package/dist/components/AreaChart/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +17 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +17 -0
- package/dist/components/AvatarGroup/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +15 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/BarChart/BarChart.d.ts +19 -0
- package/dist/components/BarChart/index.d.ts +2 -0
- package/dist/components/BoardCard/BoardCard.d.ts +26 -0
- package/dist/components/BoardCard/index.d.ts +2 -0
- package/dist/components/BoardColumn/BoardColumn.d.ts +17 -0
- package/dist/components/BoardColumn/index.d.ts +2 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +13 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +19 -0
- package/dist/components/Button/index.d.ts +9 -0
- package/dist/components/Calendar/Calendar.d.ts +24 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/CardMetaItem/CardMetaItem.d.ts +9 -0
- package/dist/components/CardMetaItem/index.d.ts +2 -0
- package/dist/components/ChatComposer/ChatComposer-simple.d.ts +15 -0
- package/dist/components/ChatComposer/ChatComposer.d.ts +22 -0
- package/dist/components/ChatComposer/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Combobox/Combobox.d.ts +27 -0
- package/dist/components/Combobox/index.d.ts +2 -0
- package/dist/components/ConversationItem/ConversationItem.d.ts +17 -0
- package/dist/components/ConversationItem/index.d.ts +2 -0
- package/dist/components/Divider/Divider.d.ts +10 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/DonutChart/DonutChart.d.ts +19 -0
- package/dist/components/DonutChart/index.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.d.ts +15 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/FileUpload/FileUpload.d.ts +14 -0
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/FilterChip/FilterChip.d.ts +13 -0
- package/dist/components/FilterChip/index.d.ts +2 -0
- package/dist/components/FunnelChart/FunnelChart.d.ts +13 -0
- package/dist/components/FunnelChart/index.d.ts +2 -0
- package/dist/components/HeatmapChart/HeatmapChart.d.ts +14 -0
- package/dist/components/HeatmapChart/index.d.ts +2 -0
- package/dist/components/IconButton/IconButton.d.ts +14 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +19 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Kbd/Kbd.d.ts +7 -0
- package/dist/components/Kbd/index.d.ts +2 -0
- package/dist/components/Label/Label.d.ts +8 -0
- package/dist/components/Label/index.d.ts +2 -0
- package/dist/components/LineChart/LineChart.d.ts +25 -0
- package/dist/components/LineChart/index.d.ts +2 -0
- package/dist/components/Link/Link.d.ts +8 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/ListItem/ListItem.d.ts +13 -0
- package/dist/components/ListItem/index.d.ts +2 -0
- package/dist/components/Menu/Menu.d.ts +12 -0
- package/dist/components/Menu/index.d.ts +2 -0
- package/dist/components/MenuItem/MenuItem.d.ts +15 -0
- package/dist/components/MenuItem/index.d.ts +2 -0
- package/dist/components/MessageBubble/MessageBubble.d.ts +25 -0
- package/dist/components/MessageBubble/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +13 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/PieChart/PieChart.d.ts +18 -0
- package/dist/components/PieChart/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +15 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Progress/Progress.d.ts +12 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/RadarChart/RadarChart.d.ts +19 -0
- package/dist/components/RadarChart/index.d.ts +2 -0
- package/dist/components/RadialChart/RadialChart.d.ts +18 -0
- package/dist/components/RadialChart/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +7 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +16 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +25 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +8 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/SidebarDivider/SidebarDivider.d.ts +3 -0
- package/dist/components/SidebarDivider/index.d.ts +1 -0
- package/dist/components/SidebarFooter/SidebarFooter.d.ts +16 -0
- package/dist/components/SidebarFooter/index.d.ts +2 -0
- package/dist/components/SidebarGroupLabel/SidebarGroupLabel.d.ts +6 -0
- package/dist/components/SidebarGroupLabel/index.d.ts +2 -0
- package/dist/components/SidebarHeader/SidebarHeader.d.ts +16 -0
- package/dist/components/SidebarHeader/index.d.ts +2 -0
- package/dist/components/SidebarItem/SidebarItem.d.ts +24 -0
- package/dist/components/SidebarItem/index.d.ts +2 -0
- package/dist/components/SidebarPromo/SidebarPromo.d.ts +14 -0
- package/dist/components/SidebarPromo/index.d.ts +2 -0
- package/dist/components/SidebarSearch/SidebarSearch.d.ts +11 -0
- package/dist/components/SidebarSearch/index.d.ts +2 -0
- package/dist/components/SidebarSubItem/SidebarSubItem.d.ts +10 -0
- package/dist/components/SidebarSubItem/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +12 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Slider/Slider.d.ts +10 -0
- package/dist/components/Slider/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.d.ts +10 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/StatCard/StatCard.d.ts +28 -0
- package/dist/components/StatCard/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.d.ts +24 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +7 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +32 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +27 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +8 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Toast/Toast.d.ts +13 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +15 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/TopBar/TopBar.d.ts +37 -0
- package/dist/components/TopBar/index.d.ts +2 -0
- package/dist/components/TopBarMobile/TopBarMobile.d.ts +16 -0
- package/dist/components/TopBarMobile/index.d.ts +2 -0
- package/dist/favicon.svg +1 -0
- package/dist/icons.svg +24 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.mjs +6107 -0
- package/dist/style.css +2 -0
- package/package.json +85 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Samuel Okpere
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Sakani Design System
|
|
2
|
+
|
|
3
|
+
An open-source, token-driven React component library for SaaS products — **1,500+ accessible components and variants**, built 1:1 from a Figma design system and now spanning **1,500+ components and variants** across light and dark modes.
|
|
4
|
+
|
|
5
|
+
**[Live Storybook →](https://main--6a5a658b3681fcc010430db5.chromatic.com)** · **[Figma file →](https://www.figma.com/design/Fd3uY263mEQKnaTEfrzQxh/)**
|
|
6
|
+
|
|
7
|
+
   
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Why Sakani
|
|
12
|
+
|
|
13
|
+
Most component libraries start in code and retrofit the design. Sakani was built the other way: every component is designed first in Figma with a strict three-layer token architecture, then implemented 1:1 in React — same variants, same states, same tokens. The Figma file has grown into a 1,500+ component-and-variant system across light and dark mode; the React library mirrors it component by component, with new ones landing as they're built out.
|
|
14
|
+
|
|
15
|
+
- **Token-driven** — components bind only to semantic tokens (`bg/surface`, `fg/muted`, `accent/default`…), so the entire library re-themes from one place
|
|
16
|
+
- **Light & dark mode** — add the `.dark` class to any container; every component re-themes automatically, no per-component dark styles
|
|
17
|
+
- **Accessible by default** — WCAG AA contrast audited, global focus-ring system, `prefers-reduced-motion` support, full ARIA semantics (combobox active-descendant, calendar date labels, live-region toasts, focus-return popovers)
|
|
18
|
+
- **Typed & composable** — strict TypeScript, generic `Table<T>`, slot-based composition, controlled + uncontrolled patterns
|
|
19
|
+
- **Geist typography** and **Lucide icons** throughout, matching the Figma source exactly
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/samzydd/Sakani-design-system.git
|
|
25
|
+
cd Sakani-design-system
|
|
26
|
+
npm install
|
|
27
|
+
npm run storybook
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Storybook opens at `http://localhost:6006` with every component, all variants, and dark-mode stories.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
Components live in `src/components`, tokens in `src/styles/tokens.css`. Import the tokens once, then use any component:
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import '@/styles/tokens.css';
|
|
38
|
+
import { Button } from '@/components/Button';
|
|
39
|
+
import { StatCard } from '@/components/StatCard';
|
|
40
|
+
import { DollarSign } from 'lucide-react';
|
|
41
|
+
|
|
42
|
+
export const Dashboard = () => (
|
|
43
|
+
<>
|
|
44
|
+
<StatCard
|
|
45
|
+
variant="icon"
|
|
46
|
+
icon={DollarSign}
|
|
47
|
+
title="Revenue"
|
|
48
|
+
value="$48,120"
|
|
49
|
+
delta="+12.5%"
|
|
50
|
+
trend="up"
|
|
51
|
+
sparkline={[12, 18, 14, 22, 19, 28]}
|
|
52
|
+
/>
|
|
53
|
+
<Button variant="primary" size="md">Get started</Button>
|
|
54
|
+
</>
|
|
55
|
+
);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Dark mode
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
<div className="dark">
|
|
62
|
+
{/* everything inside re-themes automatically */}
|
|
63
|
+
</div>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Token architecture
|
|
67
|
+
|
|
68
|
+
Three layers, defined in Figma and exported to `tokens.css`:
|
|
69
|
+
|
|
70
|
+
1. **Primitives** — raw scales (`neutral/50–950`, `primary/…`, spacing, radii)
|
|
71
|
+
2. **Semantic** — purpose-named aliases that flip between light and dark (`bg/surface`, `fg/default`, `border/subtle`, `accent/default`, `chart/1–5`)
|
|
72
|
+
3. **Components** — bind *only* to semantic tokens, never to primitives
|
|
73
|
+
|
|
74
|
+
Change a semantic token and every component follows — in both the design file and the code.
|
|
75
|
+
|
|
76
|
+
## Components (66+, syncing toward Figma's 1,500+)
|
|
77
|
+
|
|
78
|
+
**Core** — Button · Icon Button · Badge · Label · Divider · Link · Kbd · Spinner · Skeleton · Progress · Tooltip · Avatar · Avatar Group
|
|
79
|
+
|
|
80
|
+
**Forms** — Input · Textarea · Select · Checkbox · Radio · Switch · Slider · Combobox (single/multi, async loading) · File Upload
|
|
81
|
+
|
|
82
|
+
**Composite** — Card · Alert · Toast · Accordion · Tabs · Breadcrumb · Table (generic, selectable) · Stat Card (sparklines) · Stepper · Calendar (single + range, dropdown navigation) · Pagination · Popover · Segmented Control · List Item
|
|
83
|
+
|
|
84
|
+
**Sidebar kit** — Sidebar · Header · Search · Item · Sub Item · Group Label · Divider · Promo · Footer — nine standalone parts that compose into full navigation
|
|
85
|
+
|
|
86
|
+
**Charts** — Area · Bar · Donut · Funnel · Heatmap · Line · Pie · Radar · Radial — Recharts wrappers styled entirely with the `chart/1–6` tokens
|
|
87
|
+
|
|
88
|
+
## Blocks
|
|
89
|
+
|
|
90
|
+
Blocks are full sections assembled from Sakani components — **composition examples** you copy into your project and edit directly, rather than configurable components. Each ships with the states it needs (loading, empty, error, and so on).
|
|
91
|
+
|
|
92
|
+
They live in `src/blocks`:
|
|
93
|
+
|
|
94
|
+
| Block | States |
|
|
95
|
+
|---|---|
|
|
96
|
+
| **Data Table + Toolbar** | default · filtered · bulk selection · loading · empty · error |
|
|
97
|
+
| **Kanban Board** | default · loading · empty column · dragging |
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { DataTableBlock } from '@/blocks/DataTableBlock';
|
|
101
|
+
|
|
102
|
+
// Copy the file, swap the sample data for your own, edit the columns.
|
|
103
|
+
<DataTableBlock />
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Browse every block and state in the [live Storybook](https://main--6a5a658b3681fcc010430db5.chromatic.com) under **Blocks**.
|
|
107
|
+
|
|
108
|
+
## Accessibility
|
|
109
|
+
|
|
110
|
+
The library ships with an audited AA baseline: contrast-checked token pairs in both modes, a global token-driven focus ring on every interactive element, reduced-motion support, Escape-dismissible tooltips, screen-reader-tracked combobox options, full-date calendar labels, assertive error toasts, and focus-returning popovers. See the Storybook docs tab on each component for its ARIA contract.
|
|
111
|
+
|
|
112
|
+
## Roadmap
|
|
113
|
+
|
|
114
|
+
- [ ] npm package (`@sakani/react`)
|
|
115
|
+
- [ ] Figma Community publication
|
|
116
|
+
- [ ] Theming CLI (custom brand token generation)
|
|
117
|
+
- [ ] Vue port
|
|
118
|
+
|
|
119
|
+
## Support
|
|
120
|
+
|
|
121
|
+
If Sakani is useful to you, you can [tip the creator](https://csakani.gumroad.com/coffee). It funds the time that keeps the system maintained and growing.
|
|
122
|
+
|
|
123
|
+
## Author
|
|
124
|
+
|
|
125
|
+
**Sam Okpere** — senior UI/UX & design systems designer
|
|
126
|
+
|
|
127
|
+
[Portfolio](https://samdesignworks.framer.website) · [Dribbble](https://dribbble.com/samthedes) · [LinkedIn](https://www.linkedin.com/in/samuel-okpere) · [GitHub](https://github.com/samzydd)
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT — free for personal and commercial use. If Sakani saves you time, a star ⭐ helps others find it.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface AccordionItemProps {
|
|
3
|
+
title: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Controlled open state (optional). */
|
|
6
|
+
open?: boolean;
|
|
7
|
+
/** Uncontrolled initial open state. */
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const AccordionItem: React.FC<AccordionItemProps>;
|
|
12
|
+
export interface AccordionProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Accordion wrapper — groups items with a shared top/bottom border. */
|
|
17
|
+
export declare const Accordion: React.FC<AccordionProps>;
|
|
18
|
+
export default Accordion;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type AlertColor = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
3
|
+
export interface AlertProps {
|
|
4
|
+
/** Figma Color axis. Defaults to "info". */
|
|
5
|
+
color?: AlertColor;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Override the default status icon. */
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Alert: React.FC<AlertProps>;
|
|
13
|
+
export default Alert;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Colors its children fg/default within an otherwise-muted description. */
|
|
3
|
+
export declare const ActivityFeedHighlight: React.FC<{
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}>;
|
|
6
|
+
export type ActivityFeedVariant = 'default' | 'compact';
|
|
7
|
+
export interface ActivityFeedItem {
|
|
8
|
+
id?: string | number;
|
|
9
|
+
/** Who performed the action — rendered in fg/default, the rest in fg/muted. */
|
|
10
|
+
actor: string;
|
|
11
|
+
/** Rest of the sentence, e.g. "commented on Design Review". Wrap the
|
|
12
|
+
* object/target span in `ActivityFeedHighlight` to color it fg/default. */
|
|
13
|
+
description: React.ReactNode;
|
|
14
|
+
timestamp: string;
|
|
15
|
+
/** Rail dot icon (variant="default"). Rendered at 16px, colored fg/muted. */
|
|
16
|
+
icon?: React.ReactNode;
|
|
17
|
+
/** Avatar image (variant="compact"). */
|
|
18
|
+
avatarSrc?: string;
|
|
19
|
+
avatarAlt?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ActivityFeedProps {
|
|
22
|
+
items: ActivityFeedItem[];
|
|
23
|
+
variant?: ActivityFeedVariant;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const ActivityFeed: React.FC<ActivityFeedProps>;
|
|
27
|
+
export default ActivityFeed;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type AnnouncementVariant = 'neutral' | 'urgent';
|
|
3
|
+
export interface AnnouncementProps {
|
|
4
|
+
message: string;
|
|
5
|
+
/** "Learn more"-style link, shown only for variant="neutral". */
|
|
6
|
+
linkLabel?: string;
|
|
7
|
+
linkHref?: string;
|
|
8
|
+
onLinkClick?: () => void;
|
|
9
|
+
/** Dismiss button only renders when this is provided. */
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
variant?: AnnouncementVariant;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const Announcement: React.FC<AnnouncementProps>;
|
|
15
|
+
export default Announcement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type AvatarUploadOrientation = 'vertical' | 'horizontal';
|
|
3
|
+
export interface AvatarUploadProps {
|
|
4
|
+
/** Current photo URL. Filled/empty state is derived from this. */
|
|
5
|
+
src?: string;
|
|
6
|
+
alt?: string;
|
|
7
|
+
orientation?: AvatarUploadOrientation;
|
|
8
|
+
/** Passed to the hidden file input's `accept`. */
|
|
9
|
+
accept?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
hint?: string;
|
|
12
|
+
/** Fires with the chosen file -- this component doesn't upload it itself. */
|
|
13
|
+
onFileSelect?: (file: File) => void;
|
|
14
|
+
/** Horizontal "Remove" button handler, for real removal (e.g. an API call).
|
|
15
|
+
* Uncontrolled usage clears the local preview regardless of whether this is passed. */
|
|
16
|
+
onRemove?: () => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const AvatarUpload: React.FC<AvatarUploadProps>;
|
|
20
|
+
export default AvatarUpload;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface BalanceChangeInfo {
|
|
3
|
+
/** e.g. "+$1,240.50" -- sign/formatting is the caller's responsibility. */
|
|
4
|
+
value: string;
|
|
5
|
+
/** Defaults to "this month". */
|
|
6
|
+
label?: string;
|
|
7
|
+
direction?: 'up' | 'down';
|
|
8
|
+
}
|
|
9
|
+
export interface BalanceProps {
|
|
10
|
+
label?: string;
|
|
11
|
+
value: string;
|
|
12
|
+
change?: BalanceChangeInfo;
|
|
13
|
+
/** 0-100. Renders the small progress ring beside the content when set. */
|
|
14
|
+
progress?: number;
|
|
15
|
+
/** Controlled masked state. Omit to let the component manage it itself. */
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
onToggleHidden?: (hidden: boolean) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const Balance: React.FC<BalanceProps>;
|
|
21
|
+
export default Balance;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface CodeSnippetProps {
|
|
3
|
+
code: string;
|
|
4
|
+
/** Shows the filename header + copy button when set. */
|
|
5
|
+
filename?: string;
|
|
6
|
+
onCopy?: (code: string) => void;
|
|
7
|
+
/** Lets people type directly into the block. Defaults to false (read-only). */
|
|
8
|
+
editable?: boolean;
|
|
9
|
+
/** Fires with the new text on every keystroke. Only relevant when editable. */
|
|
10
|
+
onChange?: (code: string) => void;
|
|
11
|
+
/** Shown (via the real textarea's native placeholder) when editable and empty. */
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const CodeSnippet: React.FC<CodeSnippetProps>;
|
|
16
|
+
export default CodeSnippet;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ExpenseCategory {
|
|
3
|
+
id?: string | number;
|
|
4
|
+
icon: React.ReactNode;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Raw amount -- formatted for display via `formatAmount`. */
|
|
7
|
+
amount: number;
|
|
8
|
+
}
|
|
9
|
+
export type ExpensesVariant = 'default' | 'compact';
|
|
10
|
+
export interface ExpensesProps {
|
|
11
|
+
categories: ExpenseCategory[];
|
|
12
|
+
variant?: ExpensesVariant;
|
|
13
|
+
/** Defaults to USD currency, 2 decimals (e.g. "$840.20"). */
|
|
14
|
+
formatAmount?: (amount: number) => string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const Expenses: React.FC<ExpensesProps>;
|
|
18
|
+
export default Expenses;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type InlineHintVariant = 'neutral' | 'warning';
|
|
3
|
+
export interface InlineHintProps {
|
|
4
|
+
message: string;
|
|
5
|
+
variant?: InlineHintVariant;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const InlineHint: React.FC<InlineHintProps>;
|
|
9
|
+
export default InlineHint;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ModalVariant = 'default' | 'destructive';
|
|
3
|
+
export interface ModalProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
variant?: ModalVariant;
|
|
9
|
+
/** Overrides the default TriangleAlert icon (variant="destructive" only). */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
cancelLabel?: string;
|
|
12
|
+
confirmLabel?: string;
|
|
13
|
+
/** Defaults to `onClose`. */
|
|
14
|
+
onCancel?: () => void;
|
|
15
|
+
onConfirm?: () => void;
|
|
16
|
+
confirmLoading?: boolean;
|
|
17
|
+
closeOnEscape?: boolean;
|
|
18
|
+
closeOnBackdropClick?: boolean;
|
|
19
|
+
/** Custom body content (e.g. a form) rendered below `description`, above
|
|
20
|
+
* the footer's Divider. Lets consumers like FormModalBlock reuse this
|
|
21
|
+
* component's portal/focus-trap/dark-mode plumbing instead of
|
|
22
|
+
* duplicating it just to swap in different body content. */
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
/** Hides the title+close-X header row entirely, so `children` owns the
|
|
25
|
+
* whole top of the card (e.g. MultistepModalBlock's own steps-row +
|
|
26
|
+
* title + description, which Figma draws with no header bar or close
|
|
27
|
+
* control at all). `title` is still required and used as the dialog's
|
|
28
|
+
* aria-label in this mode, since there's no #modal-title element to
|
|
29
|
+
* point aria-labelledby at. */
|
|
30
|
+
hideHeader?: boolean;
|
|
31
|
+
/** Hides the Divider between the body and the footer buttons (Figma's
|
|
32
|
+
* Multistep Modal has no such rule). */
|
|
33
|
+
hideFooterDivider?: boolean;
|
|
34
|
+
/** Footer button alignment. 'end' (default) clusters Cancel/Confirm at
|
|
35
|
+
* the right, matching the base Modal's Figma spec. 'between' spreads
|
|
36
|
+
* them across the full width (Figma: Multistep Modal's Back / Continue
|
|
37
|
+
* footer), so the footer <div> fills the card instead of just wrapping
|
|
38
|
+
* its two buttons. */
|
|
39
|
+
footerJustify?: 'end' | 'between';
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
43
|
+
export default Modal;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface NotificationItemProps {
|
|
3
|
+
icon?: React.ReactNode;
|
|
4
|
+
title: string;
|
|
5
|
+
/** Simple row only. */
|
|
6
|
+
timestamp?: string;
|
|
7
|
+
/** Simple row only -- false (default) shows the unread background + dot. */
|
|
8
|
+
read?: boolean;
|
|
9
|
+
/** Presence switches to the actionable card style. */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** Fires from both the header's X and the footer's Dismiss button. */
|
|
12
|
+
onDismiss?: () => void;
|
|
13
|
+
dismissLabel?: string;
|
|
14
|
+
actionLabel?: string;
|
|
15
|
+
onAction?: () => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const NotificationItem: React.FC<NotificationItemProps>;
|
|
19
|
+
export default NotificationItem;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ProgressItemOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export interface ProgressItemProps {
|
|
4
|
+
step: number;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
/** Shows a checkmark in the circle instead of `step`. */
|
|
8
|
+
completed?: boolean;
|
|
9
|
+
orientation?: ProgressItemOrientation;
|
|
10
|
+
/** Hides the trailing connector -- the last row in a list. */
|
|
11
|
+
isLast?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ProgressItem: React.FC<ProgressItemProps>;
|
|
15
|
+
export default ProgressItem;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ProgressStatProps {
|
|
3
|
+
label: string;
|
|
4
|
+
/** Formatted value shown on the right, e.g. "80%" or "24 GB / 30 GB". */
|
|
5
|
+
value: string;
|
|
6
|
+
/** 0-100, drives the bar fill. */
|
|
7
|
+
progress: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ProgressStat: React.FC<ProgressStatProps>;
|
|
11
|
+
export default ProgressStat;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RichSeparatorProps {
|
|
3
|
+
/** Full custom content between the two lines (e.g. a brand badge or icon-wrap). */
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/** Shorthand for the common case -- plain uppercase overline text. Ignored if `children` is set. */
|
|
6
|
+
label?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const RichSeparator: React.FC<RichSeparatorProps>;
|
|
10
|
+
export default RichSeparator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SpendingBalanceProps {
|
|
3
|
+
label?: string;
|
|
4
|
+
spent: number;
|
|
5
|
+
limit: number;
|
|
6
|
+
/** Defaults to USD currency, 2 decimals (e.g. "$1,240.00"). */
|
|
7
|
+
formatAmount?: (amount: number) => string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SpendingBalance: React.FC<SpendingBalanceProps>;
|
|
11
|
+
export default SpendingBalance;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BarChartDatum } from '../../BarChart';
|
|
3
|
+
export interface StockMarketChange {
|
|
4
|
+
amount: number;
|
|
5
|
+
percent: number;
|
|
6
|
+
}
|
|
7
|
+
export interface StockMarketProps {
|
|
8
|
+
logo: React.ReactNode;
|
|
9
|
+
symbol: string;
|
|
10
|
+
name: string;
|
|
11
|
+
price: number;
|
|
12
|
+
change: StockMarketChange;
|
|
13
|
+
/** Defaults to USD currency, 2 decimals. */
|
|
14
|
+
formatAmount?: (amount: number) => string;
|
|
15
|
+
/** Presence switches to the expanded Full card with a bar chart. */
|
|
16
|
+
chart?: BarChartDatum[];
|
|
17
|
+
periodLabel?: string;
|
|
18
|
+
onPeriodClick?: () => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const StockMarket: React.FC<StockMarketProps>;
|
|
22
|
+
export default StockMarket;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TagsProps {
|
|
3
|
+
tags: string[];
|
|
4
|
+
/** Presence makes every tag removable, showing an "x" that calls this with the removed tag. */
|
|
5
|
+
onRemove?: (tag: string, index: number) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Tags: React.FC<TagsProps>;
|
|
9
|
+
export default Tags;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface TickerItem {
|
|
3
|
+
symbol: string;
|
|
4
|
+
changePercent: number;
|
|
5
|
+
}
|
|
6
|
+
export interface TickerProps {
|
|
7
|
+
items: TickerItem[];
|
|
8
|
+
/** Scroll speed in pixels/second. Defaults to 40. */
|
|
9
|
+
speed?: number;
|
|
10
|
+
formatChange?: (changePercent: number) => string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const Ticker: React.FC<TickerProps>;
|
|
14
|
+
export default Ticker;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface Transaction {
|
|
3
|
+
id?: string | number;
|
|
4
|
+
name: string;
|
|
5
|
+
category: string;
|
|
6
|
+
/** Positive = income (success), negative = expense (danger). */
|
|
7
|
+
amount: number;
|
|
8
|
+
icon: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface TransactionsProps {
|
|
11
|
+
transactions: Transaction[];
|
|
12
|
+
formatAmount?: (amount: number) => string;
|
|
13
|
+
emptyTitle?: string;
|
|
14
|
+
emptyDescription?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const Transactions: React.FC<TransactionsProps>;
|
|
18
|
+
export default Transactions;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type AreaChartVariant = 'default' | 'stacked' | 'step' | 'linear';
|
|
4
|
+
export interface AreaChartDatum {
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
/** Second series (Figma: "Revenue" alongside "Costs"). Renders a second
|
|
8
|
+
* area, stacked on top of `value` when `variant="stacked"`. */
|
|
9
|
+
value2?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface AreaChartProps {
|
|
12
|
+
data: AreaChartDatum[];
|
|
13
|
+
variant?: AreaChartVariant;
|
|
14
|
+
/** Legend label for `value` / `value2` in the tooltip. */
|
|
15
|
+
seriesLabels?: [string, string?];
|
|
16
|
+
size?: ChartSize;
|
|
17
|
+
height?: number;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare const AreaChart: React.FC<AreaChartProps>;
|
|
21
|
+
export default AreaChart;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export interface AvatarProps {
|
|
4
|
+
/** Figma AV axis. Defaults to "md". */
|
|
5
|
+
size?: AvatarSize;
|
|
6
|
+
/** Image URL — renders Image type. */
|
|
7
|
+
src?: string;
|
|
8
|
+
/** Alt text for the image. */
|
|
9
|
+
alt?: string;
|
|
10
|
+
/** 1–2 letters — renders Initials type when no src. */
|
|
11
|
+
initials?: string;
|
|
12
|
+
/** Custom icon — renders Icon type when no src/initials. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Avatar: React.FC<AvatarProps>;
|
|
17
|
+
export default Avatar;
|