@tetjana/flowmakers-ds 0.1.7 → 0.1.9
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/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/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/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 +13 -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/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/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 +830 -110
- package/dist/styles.css +1 -1
- package/guidelines/Guidelines.md +17 -0
- package/guidelines/components/cardcareer.md +70 -0
- package/guidelines/components/cardtest.md +82 -0
- package/guidelines/components/iconbutton.md +42 -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/widgetcard.md +187 -0
- package/guidelines/design-tokens/colors.md +3 -3
- package/guidelines/overview-components.md +49 -10
- package/package.json +1 -1
|
@@ -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
|
|
@@ -6,8 +6,8 @@ All colors are CSS variables. Import `@tetjana/flowmakers-ds/styles` to use them
|
|
|
6
6
|
| Token | Value | Use for |
|
|
7
7
|
|-----------------------------|-----------|--------------------------------------|
|
|
8
8
|
| `--primary-fill-100` | `#eeecfb` | Light purple backgrounds, tag bg |
|
|
9
|
-
| `--primary-fill-500` | `#
|
|
10
|
-
| `--primary-fill-600` | `#
|
|
9
|
+
| `--primary-fill-500` | `#9076dc` | Focus rings, active checkboxes |
|
|
10
|
+
| `--primary-fill-600` | `#754ccc` | Hover states on purple elements |
|
|
11
11
|
| `--primary-fill-700` | `#6d45bc` | Purple tag text |
|
|
12
12
|
|
|
13
13
|
## Black & White
|
|
@@ -29,7 +29,7 @@ All colors are CSS variables. Import `@tetjana/flowmakers-ds/styles` to use them
|
|
|
29
29
|
| `--pink-fill-300` | `#ffa8f1` | Hero button hover border |
|
|
30
30
|
| `--pink-fill-700` | `#b51692` | Pink tag text |
|
|
31
31
|
| `--green-fill-100` | `#d9f2e7` | Green tag background, success tint |
|
|
32
|
-
| `--green-fill-500` | `#
|
|
32
|
+
| `--green-fill-500` | `#31987f` | Success input border |
|
|
33
33
|
| `--green-fill-700` | `#1b6153` | Green tag text |
|
|
34
34
|
| `--yellow-fill-100` | `#fff0d4` | Yellow tag background, warning tint |
|
|
35
35
|
| `--yellow-fill-700` | `#c54e09` | Yellow tag text |
|
|
@@ -3,17 +3,56 @@
|
|
|
3
3
|
All components are imported from `@tetjana/flowmakers-ds`.
|
|
4
4
|
Always import the CSS too: `import '@tetjana/flowmakers-ds/styles'`
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
|
9
|
-
|
|
10
|
-
| `
|
|
11
|
-
| `
|
|
12
|
-
| `
|
|
13
|
-
| `
|
|
14
|
-
| `
|
|
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
|
+
---
|
|
15
52
|
|
|
16
53
|
## General rules
|
|
17
|
-
- Do NOT add `className` to override colors — use CSS variables
|
|
54
|
+
- Do NOT add `className` to override colors — use CSS variables from design tokens
|
|
18
55
|
- All components accept standard HTML attributes via spread props
|
|
19
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
|