@tetjana/flowmakers-ds 0.1.6 → 0.1.8
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/dist/components/Button.figma.d.ts +1 -0
- package/dist/components/CardCareer.d.ts +18 -0
- package/dist/components/CardCareer.figma.d.ts +1 -0
- package/dist/components/CardTest.d.ts +19 -0
- package/dist/components/CardTest.figma.d.ts +1 -0
- package/dist/components/Checkbox.figma.d.ts +1 -0
- package/dist/components/DashboardTitle.d.ts +12 -0
- package/dist/components/DatePicker.d.ts +10 -0
- package/dist/components/Dropdown.d.ts +14 -0
- package/dist/components/Footer.figma.d.ts +1 -0
- package/dist/components/Header.figma.d.ts +1 -0
- package/dist/components/IconButton.d.ts +12 -0
- package/dist/components/IconButton.figma.d.ts +1 -0
- package/dist/components/Input.figma.d.ts +1 -0
- package/dist/components/ListItem.d.ts +8 -0
- package/dist/components/NavMenu.d.ts +18 -0
- package/dist/components/NavMenu.figma.d.ts +1 -0
- package/dist/components/Pagination.d.ts +15 -0
- package/dist/components/Pagination.figma.d.ts +1 -0
- package/dist/components/Price.d.ts +13 -0
- package/dist/components/PriceCard.d.ts +15 -0
- package/dist/components/ProcessStep.d.ts +12 -0
- package/dist/components/Question.d.ts +12 -0
- package/dist/components/RadioButton.d.ts +8 -0
- package/dist/components/Search.d.ts +7 -0
- package/dist/components/SectionTitle.d.ts +14 -0
- package/dist/components/SegmentedControl.d.ts +14 -0
- package/dist/components/SegmentedControl.figma.d.ts +1 -0
- package/dist/components/SignupForm.d.ts +10 -0
- package/dist/components/Stepper.d.ts +18 -0
- package/dist/components/StepperProgress.d.ts +13 -0
- package/dist/components/Tag.figma.d.ts +1 -0
- package/dist/components/TagBig.d.ts +9 -0
- package/dist/components/Tariffs.d.ts +12 -0
- package/dist/components/TasksWidget.d.ts +13 -0
- package/dist/components/TestimonialCard.d.ts +11 -0
- package/dist/components/TimePicker.d.ts +10 -0
- package/dist/components/Toggle.figma.d.ts +1 -0
- package/dist/components/WidgetCard.d.ts +65 -0
- package/dist/components/WidgetCard.figma.d.ts +1 -0
- package/dist/demo.d.ts +3 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +52 -0
- package/dist/index.esm.js +816 -98
- package/dist/styles.css +1 -1
- package/guidelines/Guidelines.md +53 -0
- package/guidelines/components/button.md +50 -0
- package/guidelines/components/cardcareer.md +70 -0
- package/guidelines/components/cardtest.md +82 -0
- package/guidelines/components/checkbox.md +51 -0
- package/guidelines/components/footer.md +63 -0
- package/guidelines/components/header.md +57 -0
- package/guidelines/components/iconbutton.md +42 -0
- package/guidelines/components/input.md +39 -0
- package/guidelines/components/navmenu.md +48 -0
- package/guidelines/components/pagination.md +61 -0
- package/guidelines/components/segmentedcontrol.md +37 -0
- package/guidelines/components/tag.md +27 -0
- package/guidelines/components/toggle.md +41 -0
- package/guidelines/components/widgetcard.md +187 -0
- package/guidelines/design-tokens/colors.md +42 -0
- package/guidelines/design-tokens/spacing.md +41 -0
- package/guidelines/design-tokens/typography.md +23 -0
- package/guidelines/overview-components.md +58 -0
- package/package.json +21 -12
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# NavMenu — Navigation components
|
|
2
|
+
|
|
3
|
+
## Import
|
|
4
|
+
```tsx
|
|
5
|
+
import { NavItem, NavBar } from '@tetjana/flowmakers-ds';
|
|
6
|
+
import '@tetjana/flowmakers-ds/styles';
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Components
|
|
10
|
+
|
|
11
|
+
### NavBar
|
|
12
|
+
Vertical navigation container. Wrap `NavItem` elements inside it.
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
<NavBar>
|
|
16
|
+
<NavItem label="Дашборд" active icon={<DashboardIcon />} />
|
|
17
|
+
<NavItem label="Тести" href="/tests" icon={<TestsIcon />} />
|
|
18
|
+
<NavItem label="Аналітика" href="/analytics" icon={<AnalyticsIcon />} />
|
|
19
|
+
<NavItem label="Резюме" href="/resume" icon={<ResumeIcon />} />
|
|
20
|
+
<NavItem label="Ризики" href="/risks" icon={<RisksIcon />} />
|
|
21
|
+
<NavItem label="AI асистент" href="/ai" icon={<AIIcon />} />
|
|
22
|
+
</NavBar>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### NavItem props
|
|
26
|
+
| Prop | Type | Default | Description |
|
|
27
|
+
|------|------|---------|-------------|
|
|
28
|
+
| `label` | `string` | required | Menu item label |
|
|
29
|
+
| `active` | `boolean` | `false` | Highlights the currently active route |
|
|
30
|
+
| `href` | `string` | — | Renders as `<a>` link when provided |
|
|
31
|
+
| `onClick` | `() => void` | — | Renders as `<button>` when no href |
|
|
32
|
+
| `icon` | `ReactNode` | — | Icon element shown before the label |
|
|
33
|
+
|
|
34
|
+
### NavBar props
|
|
35
|
+
| Prop | Type | Default | Description |
|
|
36
|
+
|------|------|---------|-------------|
|
|
37
|
+
| `horizontal` | `boolean` | `false` | Lays items out horizontally |
|
|
38
|
+
|
|
39
|
+
## When to use
|
|
40
|
+
- **NavBar** — always as the sidebar/top navigation wrapper
|
|
41
|
+
- **NavItem** — one per destination in the app
|
|
42
|
+
- Mark `active` on the item matching the current route
|
|
43
|
+
- Always pass an `icon` — navigation icons are required by design
|
|
44
|
+
- Use `href` for real links; use `onClick` for SPA navigation handlers
|
|
45
|
+
|
|
46
|
+
## Do NOT
|
|
47
|
+
- Nest `NavBar` inside another `NavBar`
|
|
48
|
+
- Manually add active styles via className
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Pagination — Previous/Next navigation with indicator
|
|
2
|
+
|
|
3
|
+
## Import
|
|
4
|
+
```tsx
|
|
5
|
+
import { Pagination } from '@tetjana/flowmakers-ds';
|
|
6
|
+
import '@tetjana/flowmakers-ds/styles';
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
### Dots variant (carousel, image gallery)
|
|
12
|
+
```tsx
|
|
13
|
+
const [page, setPage] = useState(1);
|
|
14
|
+
const total = 9;
|
|
15
|
+
|
|
16
|
+
<Pagination
|
|
17
|
+
variant="dots"
|
|
18
|
+
page={page}
|
|
19
|
+
total={total}
|
|
20
|
+
onPrev={() => setPage(p => Math.max(1, p - 1))}
|
|
21
|
+
onNext={() => setPage(p => Math.min(total, p + 1))}
|
|
22
|
+
prevDisabled={page === 1}
|
|
23
|
+
nextDisabled={page === total}
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Numbers variant (test cards, long lists)
|
|
28
|
+
```tsx
|
|
29
|
+
<Pagination
|
|
30
|
+
variant="numbers"
|
|
31
|
+
page={page}
|
|
32
|
+
total={total}
|
|
33
|
+
onPrev={() => setPage(p => p - 1)}
|
|
34
|
+
onNext={() => setPage(p => p + 1)}
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Hidden variant (just prev/next arrows)
|
|
39
|
+
```tsx
|
|
40
|
+
<Pagination
|
|
41
|
+
variant="hidden"
|
|
42
|
+
onPrev={handlePrev}
|
|
43
|
+
onNext={handleNext}
|
|
44
|
+
/>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
| Prop | Type | Default | Description |
|
|
49
|
+
|------|------|---------|-------------|
|
|
50
|
+
| `variant` | `'dots' \| 'numbers' \| 'hidden'` | `'dots'` | Indicator style |
|
|
51
|
+
| `page` | `number` | `1` | Current page (1-based) |
|
|
52
|
+
| `total` | `number` | `9` | Total number of pages |
|
|
53
|
+
| `onPrev` | `() => void` | — | Called on previous arrow click |
|
|
54
|
+
| `onNext` | `() => void` | — | Called on next arrow click |
|
|
55
|
+
| `prevDisabled` | `boolean` | `false` | Disables the previous arrow |
|
|
56
|
+
| `nextDisabled` | `boolean` | `false` | Disables the next arrow |
|
|
57
|
+
|
|
58
|
+
## When to use
|
|
59
|
+
- `dots` — carousels, image sliders, up to ~10 pages
|
|
60
|
+
- `numbers` — shows "2 з 9", for medium-length lists
|
|
61
|
+
- `hidden` — when page count is unknown or unlimited
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# SegmentedControl — Tab/filter switcher
|
|
2
|
+
|
|
3
|
+
## Import
|
|
4
|
+
```tsx
|
|
5
|
+
import { SegmentedControl } from '@tetjana/flowmakers-ds';
|
|
6
|
+
import '@tetjana/flowmakers-ds/styles';
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
```tsx
|
|
11
|
+
const [tab, setTab] = useState('all');
|
|
12
|
+
|
|
13
|
+
<SegmentedControl
|
|
14
|
+
options={[
|
|
15
|
+
{ value: 'all', label: 'Всі' },
|
|
16
|
+
{ value: 'active', label: 'Активні' },
|
|
17
|
+
{ value: 'completed', label: 'Завершені' },
|
|
18
|
+
]}
|
|
19
|
+
value={tab}
|
|
20
|
+
onChange={setTab}
|
|
21
|
+
/>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
| Prop | Type | Default | Description |
|
|
26
|
+
|------|------|---------|-------------|
|
|
27
|
+
| `options` | `{ value: string; label: string }[]` | required | List of segments |
|
|
28
|
+
| `value` | `string` | — | Currently selected segment value |
|
|
29
|
+
| `onChange` | `(value: string) => void` | — | Called when user selects a segment |
|
|
30
|
+
|
|
31
|
+
## When to use
|
|
32
|
+
- Switching between content views (All / Active / Completed)
|
|
33
|
+
- Filtering a list by category
|
|
34
|
+
- Toggling between 2–5 mutually exclusive options
|
|
35
|
+
- Do NOT use for navigation — use `NavBar` instead
|
|
36
|
+
- Do NOT use for binary on/off — use `Toggle` instead
|
|
37
|
+
- Maximum 5 options; prefer 2–3 for clarity
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Tag
|
|
2
|
+
|
|
3
|
+
**Import**: `import { Tag } from '@tetjana/flowmakers-ds'`
|
|
4
|
+
|
|
5
|
+
## Colors
|
|
6
|
+
| Color | Background | Text | Use for |
|
|
7
|
+
|----------|-------------------|-------------------|-----------------------------|
|
|
8
|
+
| `grey` | `#eeeef0` | `#4c4d58` | Neutral labels, duration |
|
|
9
|
+
| `green` | `#d9f2e7` | `#1b6153` | Success, available, done |
|
|
10
|
+
| `yellow` | `#fff0d4` | `#c54e09` | Warning, in progress |
|
|
11
|
+
| `purple` | `#eeecfb` | `#6d45bc` | Category, feature label |
|
|
12
|
+
| `pink` | `#ffe7fc` | `#b51692` | Special, premium |
|
|
13
|
+
|
|
14
|
+
## Props
|
|
15
|
+
| Prop | Type | Default | Description |
|
|
16
|
+
|------------|-----------|----------|----------------------|
|
|
17
|
+
| `color` | TagColor | `'grey'` | Color variant |
|
|
18
|
+
| `children` | ReactNode | — | Tag label text |
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
```tsx
|
|
22
|
+
<Tag>5 хв</Tag>
|
|
23
|
+
<Tag color="green">Завершено</Tag>
|
|
24
|
+
<Tag color="yellow">В процесі</Tag>
|
|
25
|
+
<Tag color="purple">AI</Tag>
|
|
26
|
+
<Tag color="pink">Premium</Tag>
|
|
27
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Toggle
|
|
2
|
+
|
|
3
|
+
**Import**: `import { Toggle } from '@tetjana/flowmakers-ds'`
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
Перемикач on/off. Обов'язково потребує контрольованого стану (`checked` + `onChange`).
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
| Prop | Type | Required | Default | Description |
|
|
10
|
+
|-------------|----------------------------|----------|---------|-------------------------------|
|
|
11
|
+
| `checked` | boolean | ✅ yes | — | Current on/off state |
|
|
12
|
+
| `onChange` | (checked: boolean) => void | ✅ yes | — | Called when user toggles |
|
|
13
|
+
| `label` | string | no | — | Text label next to the toggle |
|
|
14
|
+
| `disabled` | boolean | no | `false` | Prevents interaction |
|
|
15
|
+
|
|
16
|
+
## Visual
|
|
17
|
+
- **Off** → grey track, white thumb
|
|
18
|
+
- **On** → gradient track (pink→yellow→mint→purple), white thumb, animated
|
|
19
|
+
- **Disabled** → 50% opacity, no pointer events
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
```tsx
|
|
23
|
+
// Controlled toggle with useState
|
|
24
|
+
const [enabled, setEnabled] = useState(false);
|
|
25
|
+
<Toggle
|
|
26
|
+
checked={enabled}
|
|
27
|
+
onChange={setEnabled}
|
|
28
|
+
label="Отримувати сповіщення"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
// Disabled
|
|
32
|
+
<Toggle checked={false} onChange={() => {}} disabled label="Недоступно" />
|
|
33
|
+
|
|
34
|
+
// Without label (icon-only row)
|
|
35
|
+
<Toggle checked={active} onChange={setActive} />
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Do NOT
|
|
39
|
+
- Do NOT use without `checked` + `onChange` — the component is always controlled
|
|
40
|
+
- Do NOT use for multi-option selection — use `Checkbox` instead
|
|
41
|
+
- Do NOT change the track color via CSS — the gradient is part of the brand style
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# WidgetCard — Dashboard widget components
|
|
2
|
+
|
|
3
|
+
## Import
|
|
4
|
+
```tsx
|
|
5
|
+
import {
|
|
6
|
+
WidgetCard,
|
|
7
|
+
WidgetHeader,
|
|
8
|
+
PlatformNewsWidget,
|
|
9
|
+
GeneralNewsWidget,
|
|
10
|
+
NotesWidget,
|
|
11
|
+
PersonalAdviceWidget,
|
|
12
|
+
CalendarWidget,
|
|
13
|
+
} from '@tetjana/flowmakers-ds';
|
|
14
|
+
import '@tetjana/flowmakers-ds/styles';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## WidgetCard — Container wrapper
|
|
20
|
+
|
|
21
|
+
Wraps a `WidgetHeader` + any widget content.
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
<WidgetCard
|
|
25
|
+
header={<WidgetHeader title="Новини платформи" color="purple" />}
|
|
26
|
+
>
|
|
27
|
+
<PlatformNewsWidget
|
|
28
|
+
title="Оновлення платформи"
|
|
29
|
+
text="Нова функція вже доступна"
|
|
30
|
+
/>
|
|
31
|
+
</WidgetCard>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### WidgetCard props
|
|
35
|
+
| Prop | Type | Default | Description |
|
|
36
|
+
|------|------|---------|-------------|
|
|
37
|
+
| `header` | `ReactNode` | — | `<WidgetHeader>` element |
|
|
38
|
+
| `children` | `ReactNode` | — | Widget content |
|
|
39
|
+
| `width` | `number \| string` | — | Optional fixed width |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## WidgetHeader — Widget title bar
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
// Purple (default)
|
|
47
|
+
<WidgetHeader title="Персональна порада" color="purple" />
|
|
48
|
+
|
|
49
|
+
// Grey
|
|
50
|
+
<WidgetHeader title="Загальні новини" color="grey" />
|
|
51
|
+
|
|
52
|
+
// With subtitle and actions
|
|
53
|
+
<WidgetHeader
|
|
54
|
+
title="Календар"
|
|
55
|
+
subtitle="Лютий 2024"
|
|
56
|
+
color="purple"
|
|
57
|
+
leftAction={<IconButton icon="arrow-left" size="small" />}
|
|
58
|
+
rightAction={<IconButton icon="arrow-right" size="small" />}
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### WidgetHeader props
|
|
63
|
+
| Prop | Type | Default | Description |
|
|
64
|
+
|------|------|---------|-------------|
|
|
65
|
+
| `title` | `string` | required | Widget title |
|
|
66
|
+
| `subtitle` | `string` | — | Secondary text |
|
|
67
|
+
| `color` | `'purple' \| 'grey'` | `'purple'` | Header background color |
|
|
68
|
+
| `leftAction` | `ReactNode` | — | Icon/button on the left |
|
|
69
|
+
| `rightAction` | `ReactNode` | — | Icon/button on the right |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## PlatformNewsWidget — Platform update news item
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<PlatformNewsWidget
|
|
77
|
+
tag={<Tag color="purple">Оновлення</Tag>}
|
|
78
|
+
title="Нова функція: Аналітика ризиків"
|
|
79
|
+
text="Тепер ви можете переглядати детальну аналітику своїх ризиків у реальному часі"
|
|
80
|
+
/>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## GeneralNewsWidget — Industry news with image
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<GeneralNewsWidget
|
|
89
|
+
image="/news/article-cover.jpg"
|
|
90
|
+
tag={<Tag color="grey">Ринок праці</Tag>}
|
|
91
|
+
title="Попит на React-розробників зріс на 40% у 2024 році"
|
|
92
|
+
/>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## NotesWidget — Personal notes
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
<NotesWidget
|
|
101
|
+
title="Мої нотатки"
|
|
102
|
+
text="Записати головні думки з лекції про TypeScript generics..."
|
|
103
|
+
date="21.02.2024"
|
|
104
|
+
/>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## PersonalAdviceWidget — AI-generated advice
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
<PersonalAdviceWidget
|
|
113
|
+
tag={<Tag color="purple">AI порада</Tag>}
|
|
114
|
+
text="Пройди тест з TypeScript, щоб підвищити рівень до Middle. Це підвищить твої шанси на ринку праці."
|
|
115
|
+
action={<Button variant="ghost">Переглянути тест</Button>}
|
|
116
|
+
/>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## CalendarWidget — Weekly calendar with events
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
<CalendarWidget
|
|
125
|
+
days={[
|
|
126
|
+
{ dayLabel: 'Пн', date: 19 },
|
|
127
|
+
{ dayLabel: 'Вт', date: 20, hasEvent: true },
|
|
128
|
+
{ dayLabel: 'Ср', date: 21, active: true },
|
|
129
|
+
{ dayLabel: 'Чт', date: 22 },
|
|
130
|
+
{ dayLabel: 'Пт', date: 23 },
|
|
131
|
+
{ dayLabel: 'Сб', date: 24 },
|
|
132
|
+
{ dayLabel: 'Нд', date: 25 },
|
|
133
|
+
]}
|
|
134
|
+
events={[
|
|
135
|
+
{ title: 'Менторська сесія', time: '10:00', color: '#9076dc' },
|
|
136
|
+
{ title: 'Вебінар з React', time: '14:00', color: '#4CAF50' },
|
|
137
|
+
]}
|
|
138
|
+
/>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### CalendarDayItem fields
|
|
142
|
+
| Field | Type | Description |
|
|
143
|
+
|-------|------|-------------|
|
|
144
|
+
| `dayLabel` | `string` | Short day name: 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Нд' |
|
|
145
|
+
| `date` | `number` | Day of month |
|
|
146
|
+
| `active` | `boolean` | Highlights today |
|
|
147
|
+
| `hasEvent` | `boolean` | Shows a dot indicator under the date |
|
|
148
|
+
|
|
149
|
+
### CalendarEvent fields
|
|
150
|
+
| Field | Type | Description |
|
|
151
|
+
|-------|------|-------------|
|
|
152
|
+
| `title` | `string` | Event name |
|
|
153
|
+
| `time` | `string` | Time string, e.g. '14:00' |
|
|
154
|
+
| `color` | `string` | CSS color for the left accent bar |
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Dashboard layout example
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
<div className="dashboard-grid">
|
|
162
|
+
<WidgetCard header={<WidgetHeader title="Новини платформи" color="purple" />}>
|
|
163
|
+
<PlatformNewsWidget title="Оновлення" text="..." />
|
|
164
|
+
</WidgetCard>
|
|
165
|
+
|
|
166
|
+
<WidgetCard header={<WidgetHeader title="Загальні новини" color="grey" />}>
|
|
167
|
+
<GeneralNewsWidget title="Ринок праці" image="/news.jpg" />
|
|
168
|
+
</WidgetCard>
|
|
169
|
+
|
|
170
|
+
<WidgetCard header={<WidgetHeader title="Мої нотатки" color="purple" />}>
|
|
171
|
+
<NotesWidget title="Нотатка" text="..." date="21.02.2024" />
|
|
172
|
+
</WidgetCard>
|
|
173
|
+
|
|
174
|
+
<WidgetCard header={<WidgetHeader title="Порада" color="purple" />}>
|
|
175
|
+
<PersonalAdviceWidget text="Пройди тест..." />
|
|
176
|
+
</WidgetCard>
|
|
177
|
+
|
|
178
|
+
<WidgetCard header={<WidgetHeader title="Календар" subtitle="Лютий 2024" color="grey" />}>
|
|
179
|
+
<CalendarWidget days={[...]} events={[...]} />
|
|
180
|
+
</WidgetCard>
|
|
181
|
+
</div>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Rules
|
|
185
|
+
- Always wrap widget content in `<WidgetCard>` with a `<WidgetHeader>`
|
|
186
|
+
- Use `color="purple"` for primary/featured widgets, `color="grey"` for secondary
|
|
187
|
+
- One content component per `WidgetCard` — do not stack multiple widgets inside one card
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Color Tokens
|
|
2
|
+
|
|
3
|
+
All colors are CSS variables. Import `@tetjana/flowmakers-ds/styles` to use them.
|
|
4
|
+
|
|
5
|
+
## Primary palette (Purple)
|
|
6
|
+
| Token | Value | Use for |
|
|
7
|
+
|-----------------------------|-----------|--------------------------------------|
|
|
8
|
+
| `--primary-fill-100` | `#eeecfb` | Light purple backgrounds, tag bg |
|
|
9
|
+
| `--primary-fill-500` | `#9076dc` | Focus rings, active checkboxes |
|
|
10
|
+
| `--primary-fill-600` | `#754ccc` | Hover states on purple elements |
|
|
11
|
+
| `--primary-fill-700` | `#6d45bc` | Purple tag text |
|
|
12
|
+
|
|
13
|
+
## Black & White
|
|
14
|
+
| Token | Value | Use for |
|
|
15
|
+
|-----------------------------|-----------|--------------------------------------|
|
|
16
|
+
| `--bw-fill-black` | `#121212` | Primary buttons, headings, body text |
|
|
17
|
+
| `--bw-fill-white` | `#ffffff` | Backgrounds, button text on dark |
|
|
18
|
+
| `--bw-fill-50` | `#f7f7f8` | Page background, grey header |
|
|
19
|
+
| `--bw-fill-100` | `#eeeef0` | Hover backgrounds |
|
|
20
|
+
| `--bw-fill-200` | `#dcdcdc` | Disabled button background |
|
|
21
|
+
| `--bw-fill-300` | `#b8b9c1` | Input borders (default) |
|
|
22
|
+
| `--bw-fill-400` | `#989898` | Subtitle, secondary text |
|
|
23
|
+
| `--bw-fill-500` | `#7c7c7c` | Muted text |
|
|
24
|
+
|
|
25
|
+
## Accent colors
|
|
26
|
+
| Token | Value | Use for |
|
|
27
|
+
|-----------------------------|-----------|--------------------------------------|
|
|
28
|
+
| `--pink-fill-100` | `#ffe7fc` | Pink tag background |
|
|
29
|
+
| `--pink-fill-300` | `#ffa8f1` | Hero button hover border |
|
|
30
|
+
| `--pink-fill-700` | `#b51692` | Pink tag text |
|
|
31
|
+
| `--green-fill-100` | `#d9f2e7` | Green tag background, success tint |
|
|
32
|
+
| `--green-fill-500` | `#31987f` | Success input border |
|
|
33
|
+
| `--green-fill-700` | `#1b6153` | Green tag text |
|
|
34
|
+
| `--yellow-fill-100` | `#fff0d4` | Yellow tag background, warning tint |
|
|
35
|
+
| `--yellow-fill-700` | `#c54e09` | Yellow tag text |
|
|
36
|
+
|
|
37
|
+
## Decision tree
|
|
38
|
+
- Need a background? → Start with `--bw-fill-50` or `--primary-fill-100`
|
|
39
|
+
- Need text on white? → Use `--bw-fill-black`
|
|
40
|
+
- Need muted/secondary text? → Use `--bw-fill-400`
|
|
41
|
+
- Need a border? → Use `--bw-fill-300` (default) or `--primary-fill-500` (focused)
|
|
42
|
+
- Need a status color? → Use the matching `--green`, `--yellow`, or `--pink` token
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Spacing & Border Radius Tokens
|
|
2
|
+
|
|
3
|
+
All tokens are CSS variables available after `import '@tetjana/flowmakers-ds/styles'`.
|
|
4
|
+
|
|
5
|
+
## Spacing scale
|
|
6
|
+
| Token | Value | Use for |
|
|
7
|
+
|----------------|-------|---------------------------------------------------|
|
|
8
|
+
| `--space-xxs` | 4px | Icon gaps, tiny internal padding |
|
|
9
|
+
| `--space-xs` | 8px | Between icon and text, small card gaps |
|
|
10
|
+
| `--space-s` | 10px | Button padding (sm), tight list items |
|
|
11
|
+
| `--space-sm` | 12px | Between label and input, small section gaps |
|
|
12
|
+
| `--space-m` | 16px | Default padding inside cards, between form fields |
|
|
13
|
+
| `--space-l` | 20px | Card/widget internal padding |
|
|
14
|
+
| `--space-xl` | 24px | Section padding, between major blocks |
|
|
15
|
+
| `--space-2xl` | 32px | Large gaps, between sections |
|
|
16
|
+
| `--space-3xl` | 48px | Between major page sections |
|
|
17
|
+
|
|
18
|
+
## Border radius scale
|
|
19
|
+
| Token | Value | Use for |
|
|
20
|
+
|----------------|--------|----------------------------------------------|
|
|
21
|
+
| `--radius-xs` | 8px | Small chips, badges, compact inputs |
|
|
22
|
+
| `--radius-s` | 10px | Buttons (sm), small cards |
|
|
23
|
+
| `--radius-m` | 12px | Buttons (md/lg), inputs, standard cards |
|
|
24
|
+
| `--radius-l` | 16px | Large cards, modals |
|
|
25
|
+
| `--radius-xl` | 20px | Widget containers, Header component |
|
|
26
|
+
| `--radius-full`| 9999px | Pills, Tags, Toggle track, Avatar circles |
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
- Always use `--space-*` tokens instead of hardcoded pixel values
|
|
30
|
+
- For card padding: use `var(--space-m, 16px)` as the default fallback
|
|
31
|
+
- For inner component spacing: `--space-xs` (8px) or `--space-sm` (12px)
|
|
32
|
+
- For section-level gaps: `--space-xl` (24px) or `--space-2xl` (32px)
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
```css
|
|
36
|
+
.my-card {
|
|
37
|
+
padding: var(--space-m);
|
|
38
|
+
border-radius: var(--radius-l);
|
|
39
|
+
gap: var(--space-sm);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Typography Tokens
|
|
2
|
+
|
|
3
|
+
## Font families
|
|
4
|
+
- **Headings**: `Manrope` (Bold 700) — page titles, widget titles, display text
|
|
5
|
+
- **Body & UI**: `Nunito Sans` — all other text (labels, body, buttons, captions)
|
|
6
|
+
|
|
7
|
+
## Font size scale
|
|
8
|
+
| Token | Value | Class | Use for |
|
|
9
|
+
|----------------------|--------|----------------|--------------------------------|
|
|
10
|
+
| `--font-size-12` | 12px | `.text-tiny` | Tags, tiny labels, captions |
|
|
11
|
+
| `--font-size-14` | 14px | `.text-body-md`| Default body text, button text |
|
|
12
|
+
| `--font-size-16` | 16px | `.text-body-lg`| Input labels, subtitles |
|
|
13
|
+
| `--font-size-18` | 18px | `.text-h4` | Widget/card headings |
|
|
14
|
+
| `--font-size-24` | 24px | `.text-h3` | Section headings |
|
|
15
|
+
| `--font-size-30` | 30px | `.text-h2` | Page headings, footer headline |
|
|
16
|
+
| `--font-size-36`+ | 36px+ | `.text-h1` | Hero/landing headings |
|
|
17
|
+
|
|
18
|
+
## Rules
|
|
19
|
+
- Always use **Manrope Bold** for headings (h1–h4)
|
|
20
|
+
- Use **Nunito Sans Regular (400)** for body text
|
|
21
|
+
- Use **Nunito Sans Bold (700)** for buttons and tags
|
|
22
|
+
- Use **Nunito Sans SemiBold (600)** for subtitles and section labels
|
|
23
|
+
- **Minimum body text size: 14px** — never use 12px for paragraph text
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# FlowMakers Components Overview
|
|
2
|
+
|
|
3
|
+
All components are imported from `@tetjana/flowmakers-ds`.
|
|
4
|
+
Always import the CSS too: `import '@tetjana/flowmakers-ds/styles'`
|
|
5
|
+
|
|
6
|
+
## Primitives
|
|
7
|
+
|
|
8
|
+
| Component | Purpose | Guidelines |
|
|
9
|
+
|-----------|---------|------------|
|
|
10
|
+
| `Button` | All clickable actions (hero, secondary, ghost) | [button.md](components/button.md) |
|
|
11
|
+
| `Input` | Text fields, email, password, search | [input.md](components/input.md) |
|
|
12
|
+
| `Tag` | Labels, badges, status indicators | [tag.md](components/tag.md) |
|
|
13
|
+
| `Toggle` | Boolean on/off switches | [toggle.md](components/toggle.md) |
|
|
14
|
+
| `Checkbox` | Multi-select options, agreements | [checkbox.md](components/checkbox.md) |
|
|
15
|
+
| `IconButton` | Icon-only action buttons (arrows, plus, pen) | [iconbutton.md](components/iconbutton.md) |
|
|
16
|
+
|
|
17
|
+
## Navigation
|
|
18
|
+
|
|
19
|
+
| Component | Purpose | Guidelines |
|
|
20
|
+
|-----------|---------|------------|
|
|
21
|
+
| `NavItem`, `NavBar` | Sidebar navigation menu | [navmenu.md](components/navmenu.md) |
|
|
22
|
+
| `SegmentedControl` | Tab/filter switcher (2–5 options) | [segmentedcontrol.md](components/segmentedcontrol.md) |
|
|
23
|
+
| `Pagination` | Prev/next navigation with dots or numbers | [pagination.md](components/pagination.md) |
|
|
24
|
+
|
|
25
|
+
## Layout
|
|
26
|
+
|
|
27
|
+
| Component | Purpose | Guidelines |
|
|
28
|
+
|-----------|---------|------------|
|
|
29
|
+
| `Header` | Widget/card header with title and subtitle | [header.md](components/header.md) |
|
|
30
|
+
| `Footer` | Page footer with links, CTA, and copyright | [footer.md](components/footer.md) |
|
|
31
|
+
|
|
32
|
+
## Cards
|
|
33
|
+
|
|
34
|
+
| Component | Purpose | Guidelines |
|
|
35
|
+
|-----------|---------|------------|
|
|
36
|
+
| `CardTest` | Test/quiz card with state (available/in-progress/completed/unavailable) | [cardtest.md](components/cardtest.md) |
|
|
37
|
+
| `CardCareer` | Accordion card showing career level + task progress | [cardcareer.md](components/cardcareer.md) |
|
|
38
|
+
|
|
39
|
+
## Dashboard widgets
|
|
40
|
+
|
|
41
|
+
| Component | Purpose | Guidelines |
|
|
42
|
+
|-----------|---------|------------|
|
|
43
|
+
| `WidgetCard` | Dashboard card container | [widgetcard.md](components/widgetcard.md) |
|
|
44
|
+
| `WidgetHeader` | Widget title bar (purple or grey) | [widgetcard.md](components/widgetcard.md) |
|
|
45
|
+
| `PlatformNewsWidget` | Platform update news item | [widgetcard.md](components/widgetcard.md) |
|
|
46
|
+
| `GeneralNewsWidget` | Industry news with cover image | [widgetcard.md](components/widgetcard.md) |
|
|
47
|
+
| `NotesWidget` | Personal notes snippet | [widgetcard.md](components/widgetcard.md) |
|
|
48
|
+
| `PersonalAdviceWidget` | AI-generated advice card | [widgetcard.md](components/widgetcard.md) |
|
|
49
|
+
| `CalendarWidget` | Weekly calendar with event list | [widgetcard.md](components/widgetcard.md) |
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## General rules
|
|
54
|
+
- Do NOT add `className` to override colors — use CSS variables from design tokens
|
|
55
|
+
- All components accept standard HTML attributes via spread props
|
|
56
|
+
- Disabled state: always pass `disabled` prop, never CSS-only
|
|
57
|
+
- Always prefer FlowMakers components over native HTML elements
|
|
58
|
+
- Read the component's `.md` file before using it
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tetjana/flowmakers-ds",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "FlowMakers UI Design System — React components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -13,24 +13,33 @@
|
|
|
13
13
|
},
|
|
14
14
|
"./styles": "./dist/styles.css"
|
|
15
15
|
},
|
|
16
|
-
"files": [
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"guidelines"
|
|
19
|
+
],
|
|
17
20
|
"scripts": {
|
|
18
21
|
"build": "vite build && tsc --emitDeclarationOnly --declaration --outDir dist",
|
|
19
|
-
"dev":
|
|
20
|
-
"lint":
|
|
22
|
+
"dev": "vite",
|
|
23
|
+
"lint": "eslint src"
|
|
21
24
|
},
|
|
22
25
|
"peerDependencies": {
|
|
23
|
-
"react":
|
|
26
|
+
"react": ">=18",
|
|
24
27
|
"react-dom": ">=18"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|
|
27
|
-
"@
|
|
28
|
-
"@types/react
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"vite
|
|
30
|
+
"@figma/code-connect": "^1.4.1",
|
|
31
|
+
"@types/react": "^18.0.0",
|
|
32
|
+
"@types/react-dom": "^18.0.0",
|
|
33
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
34
|
+
"typescript": "^5.0.0",
|
|
35
|
+
"vite": "^5.0.0",
|
|
36
|
+
"vite-plugin-dts": "^3.0.0"
|
|
33
37
|
},
|
|
34
|
-
"keywords": [
|
|
38
|
+
"keywords": [
|
|
39
|
+
"flowmakers",
|
|
40
|
+
"design-system",
|
|
41
|
+
"react",
|
|
42
|
+
"ui"
|
|
43
|
+
],
|
|
35
44
|
"license": "MIT"
|
|
36
45
|
}
|