aristid-ds 0.5.1
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/README.md +434 -0
- package/dist/Kit/App/index.d.ts +5 -0
- package/dist/Kit/App/style.d.ts +3 -0
- package/dist/Kit/App/types.d.ts +5 -0
- package/dist/Kit/DataDisplay/Avatar/Avatar.d.ts +4 -0
- package/dist/Kit/DataDisplay/Avatar/AvatarGroup.d.ts +4 -0
- package/dist/Kit/DataDisplay/Avatar/index.d.ts +7 -0
- package/dist/Kit/DataDisplay/Avatar/types.d.ts +15 -0
- package/dist/Kit/DataDisplay/Badge/index.d.ts +3 -0
- package/dist/Kit/DataDisplay/Badge/types.d.ts +9 -0
- package/dist/Kit/DataDisplay/Card/ColorBar.d.ts +4 -0
- package/dist/Kit/DataDisplay/Card/index.d.ts +3 -0
- package/dist/Kit/DataDisplay/Card/types.d.ts +27 -0
- package/dist/Kit/DataDisplay/Collapse/Collapse.d.ts +4 -0
- package/dist/Kit/DataDisplay/Collapse/Header.d.ts +4 -0
- package/dist/Kit/DataDisplay/Collapse/HeaderExtra.d.ts +4 -0
- package/dist/Kit/DataDisplay/Collapse/index.d.ts +8 -0
- package/dist/Kit/DataDisplay/Collapse/types.d.ts +29 -0
- package/dist/Kit/DataDisplay/Image/index.d.ts +8 -0
- package/dist/Kit/DataDisplay/Image/theme.d.ts +3 -0
- package/dist/Kit/DataDisplay/Image/types.d.ts +14 -0
- package/dist/Kit/DataDisplay/ItemList/index.d.ts +3 -0
- package/dist/Kit/DataDisplay/ItemList/types.d.ts +12 -0
- package/dist/Kit/DataDisplay/Tabs/index.d.ts +4 -0
- package/dist/Kit/DataDisplay/Tabs/theme.d.ts +2 -0
- package/dist/Kit/DataDisplay/Tabs/types.d.ts +16 -0
- package/dist/Kit/DataDisplay/Tooltip/index.d.ts +3 -0
- package/dist/Kit/DataDisplay/Tooltip/types.d.ts +6 -0
- package/dist/Kit/DataDisplay/Tree/index.d.ts +3 -0
- package/dist/Kit/DataDisplay/Tree/types.d.ts +19 -0
- package/dist/Kit/DataDisplay/index.d.ts +18 -0
- package/dist/Kit/DataEntry/AutoComplete/index.d.ts +3 -0
- package/dist/Kit/DataEntry/AutoComplete/types.d.ts +8 -0
- package/dist/Kit/DataEntry/Checkbox/Checkbox.d.ts +4 -0
- package/dist/Kit/DataEntry/Checkbox/Group.d.ts +30 -0
- package/dist/Kit/DataEntry/Checkbox/index.d.ts +9 -0
- package/dist/Kit/DataEntry/Checkbox/theme.d.ts +3 -0
- package/dist/Kit/DataEntry/Checkbox/types.d.ts +50 -0
- package/dist/Kit/DataEntry/DatePicker/DatePicker.d.ts +4 -0
- package/dist/Kit/DataEntry/DatePicker/RangePicker.d.ts +4 -0
- package/dist/Kit/DataEntry/DatePicker/index.d.ts +7 -0
- package/dist/Kit/DataEntry/DatePicker/style.d.ts +2 -0
- package/dist/Kit/DataEntry/DatePicker/types.d.ts +24 -0
- package/dist/Kit/DataEntry/Input/Input.d.ts +4 -0
- package/dist/Kit/DataEntry/Input/InputWrapper.d.ts +4 -0
- package/dist/Kit/DataEntry/Input/Password.d.ts +4 -0
- package/dist/Kit/DataEntry/Input/TextArea.d.ts +4 -0
- package/dist/Kit/DataEntry/Input/index.d.ts +8 -0
- package/dist/Kit/DataEntry/Input/types.d.ts +36 -0
- package/dist/Kit/DataEntry/InputNumber/index.d.ts +3 -0
- package/dist/Kit/DataEntry/InputNumber/types.d.ts +11 -0
- package/dist/Kit/DataEntry/Radio/Group.d.ts +4 -0
- package/dist/Kit/DataEntry/Radio/Radio.d.ts +4 -0
- package/dist/Kit/DataEntry/Radio/index.d.ts +8 -0
- package/dist/Kit/DataEntry/Radio/theme.d.ts +3 -0
- package/dist/Kit/DataEntry/Radio/types.d.ts +70 -0
- package/dist/Kit/DataEntry/Rate/index.d.ts +3 -0
- package/dist/Kit/DataEntry/Rate/types.d.ts +11 -0
- package/dist/Kit/DataEntry/Select/index.d.ts +3 -0
- package/dist/Kit/DataEntry/Select/style.d.ts +561 -0
- package/dist/Kit/DataEntry/Select/types.d.ts +48 -0
- package/dist/Kit/DataEntry/Slider/index.d.ts +3 -0
- package/dist/Kit/DataEntry/Slider/types.d.ts +18 -0
- package/dist/Kit/DataEntry/Switch/index.d.ts +3 -0
- package/dist/Kit/DataEntry/Switch/theme.d.ts +3 -0
- package/dist/Kit/DataEntry/Switch/types.d.ts +53 -0
- package/dist/Kit/DataEntry/Tag/Tag.d.ts +4 -0
- package/dist/Kit/DataEntry/Tag/index.d.ts +3 -0
- package/dist/Kit/DataEntry/Tag/types.d.ts +12 -0
- package/dist/Kit/DataEntry/Upload/Dragger.d.ts +4 -0
- package/dist/Kit/DataEntry/Upload/Upload.d.ts +4 -0
- package/dist/Kit/DataEntry/Upload/index.d.ts +8 -0
- package/dist/Kit/DataEntry/Upload/types.d.ts +20 -0
- package/dist/Kit/DataEntry/index.d.ts +23 -0
- package/dist/Kit/Feedback/Alert/index.d.ts +3 -0
- package/dist/Kit/Feedback/Alert/types.d.ts +6 -0
- package/dist/Kit/Feedback/Feedback/index.d.ts +0 -0
- package/dist/Kit/Feedback/Modal/ConfirmDialog.d.ts +4 -0
- package/dist/Kit/Feedback/Modal/Modal.d.ts +4 -0
- package/dist/Kit/Feedback/Modal/confirm.d.ts +10 -0
- package/dist/Kit/Feedback/Modal/index.d.ts +11 -0
- package/dist/Kit/Feedback/Modal/theme.d.ts +2 -0
- package/dist/Kit/Feedback/Modal/types.d.ts +68 -0
- package/dist/Kit/Feedback/Notification/index.d.ts +1 -0
- package/dist/Kit/Feedback/Notification/style.d.ts +2 -0
- package/dist/Kit/Feedback/Notification/types.d.ts +26 -0
- package/dist/Kit/Feedback/Notification/useKitNotification.d.ts +6 -0
- package/dist/Kit/Feedback/Progress/index.d.ts +3 -0
- package/dist/Kit/Feedback/Progress/theme.d.ts +2 -0
- package/dist/Kit/Feedback/Progress/types.d.ts +9 -0
- package/dist/Kit/Feedback/SnackBar/SnackBar.d.ts +6 -0
- package/dist/Kit/Feedback/SnackBar/SnackBarProvider.d.ts +3 -0
- package/dist/Kit/Feedback/SnackBar/index.d.ts +4 -0
- package/dist/Kit/Feedback/SnackBar/types.d.ts +16 -0
- package/dist/Kit/Feedback/index.d.ts +5 -0
- package/dist/Kit/General/Button/index.d.ts +5 -0
- package/dist/Kit/General/Button/types.d.ts +18 -0
- package/dist/Kit/General/Icon/index.d.ts +3 -0
- package/dist/Kit/General/Icon/theme.d.ts +2 -0
- package/dist/Kit/General/Icon/types.d.ts +35 -0
- package/dist/Kit/General/Typography/Link.d.ts +4 -0
- package/dist/Kit/General/Typography/Paragraph.d.ts +4 -0
- package/dist/Kit/General/Typography/Text.d.ts +4 -0
- package/dist/Kit/General/Typography/Title.d.ts +4 -0
- package/dist/Kit/General/Typography/commons.d.ts +12 -0
- package/dist/Kit/General/Typography/index.d.ts +11 -0
- package/dist/Kit/General/Typography/types.d.ts +39 -0
- package/dist/Kit/General/index.d.ts +6 -0
- package/dist/Kit/Layout/Divider/index.d.ts +3 -0
- package/dist/Kit/Layout/Divider/types.d.ts +11 -0
- package/dist/Kit/Layout/Grid/Col.d.ts +4 -0
- package/dist/Kit/Layout/Grid/Row.d.ts +4 -0
- package/dist/Kit/Layout/Grid/index.d.ts +9 -0
- package/dist/Kit/Layout/Grid/types.d.ts +12 -0
- package/dist/Kit/Layout/Space/index.d.ts +8 -0
- package/dist/Kit/Layout/Space/theme.d.ts +7 -0
- package/dist/Kit/Layout/Space/types.d.ts +14 -0
- package/dist/Kit/Layout/index.d.ts +6 -0
- package/dist/Kit/Navigation/Breadcrumb/index.d.ts +3 -0
- package/dist/Kit/Navigation/Breadcrumb/theme.d.ts +8 -0
- package/dist/Kit/Navigation/Breadcrumb/types.d.ts +4 -0
- package/dist/Kit/Navigation/DropDown/index.d.ts +3 -0
- package/dist/Kit/Navigation/DropDown/style.d.ts +2 -0
- package/dist/Kit/Navigation/DropDown/types.d.ts +6 -0
- package/dist/Kit/Navigation/Header/index.d.ts +3 -0
- package/dist/Kit/Navigation/Header/theme.d.ts +6 -0
- package/dist/Kit/Navigation/Header/types.d.ts +10 -0
- package/dist/Kit/Navigation/Menu/ItemMenu.d.ts +4 -0
- package/dist/Kit/Navigation/Menu/Menu.d.ts +4 -0
- package/dist/Kit/Navigation/Menu/index.d.ts +7 -0
- package/dist/Kit/Navigation/Menu/types.d.ts +34 -0
- package/dist/Kit/Navigation/Pagination/index.d.ts +3 -0
- package/dist/Kit/Navigation/Pagination/theme.d.ts +2 -0
- package/dist/Kit/Navigation/Pagination/types.d.ts +17 -0
- package/dist/Kit/Navigation/Steps/index.d.ts +3 -0
- package/dist/Kit/Navigation/Steps/types.d.ts +12 -0
- package/dist/Kit/Navigation/index.d.ts +12 -0
- package/dist/Kit/index.d.ts +6 -0
- package/dist/icons/KitCalendarOutlined.d.ts +4 -0
- package/dist/icons/KitDeleteOutlined.d.ts +4 -0
- package/dist/icons/KitDownloadOutlined.d.ts +4 -0
- package/dist/icons/KitDropdownOutlined.d.ts +4 -0
- package/dist/icons/KitDropupOutlined.d.ts +4 -0
- package/dist/icons/KitEditOutlined.d.ts +4 -0
- package/dist/icons/KitHideOutlined.d.ts +4 -0
- package/dist/icons/KitInfoOutlined.d.ts +4 -0
- package/dist/icons/KitLessOutlined.d.ts +4 -0
- package/dist/icons/KitListOutlined.d.ts +4 -0
- package/dist/icons/KitLockOutlined.d.ts +4 -0
- package/dist/icons/KitLogoutOutlined.d.ts +4 -0
- package/dist/icons/KitPdfOutlined.d.ts +4 -0
- package/dist/icons/KitPlusOutlined.d.ts +4 -0
- package/dist/icons/KitRailroadOutlined.d.ts +4 -0
- package/dist/icons/KitShowOutlined.d.ts +4 -0
- package/dist/icons/KitWarningOutlined.d.ts +4 -0
- package/dist/icons/asn/KitCalendarOutlined.d.ts +3 -0
- package/dist/icons/asn/KitDeleteOutlined.d.ts +3 -0
- package/dist/icons/asn/KitDownloadOutlined.d.ts +3 -0
- package/dist/icons/asn/KitDropdownOutlined.d.ts +3 -0
- package/dist/icons/asn/KitDropupOutlined.d.ts +3 -0
- package/dist/icons/asn/KitEditOutlined.d.ts +3 -0
- package/dist/icons/asn/KitHideOutlined.d.ts +3 -0
- package/dist/icons/asn/KitInfoOutlined.d.ts +3 -0
- package/dist/icons/asn/KitLessOutlined.d.ts +3 -0
- package/dist/icons/asn/KitListOutlined.d.ts +3 -0
- package/dist/icons/asn/KitLockOutlined.d.ts +3 -0
- package/dist/icons/asn/KitLogoutOutlined.d.ts +3 -0
- package/dist/icons/asn/KitPdfOutlined.d.ts +3 -0
- package/dist/icons/asn/KitPlusOutlined.d.ts +3 -0
- package/dist/icons/asn/KitRailroadOutlined.d.ts +3 -0
- package/dist/icons/asn/KitShowOutlined.d.ts +3 -0
- package/dist/icons/asn/KitWarningOutlined.d.ts +3 -0
- package/dist/icons/index.d.ts +17 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.es.js +4281 -0
- package/dist/theme/aristid/components/DataDisplay/Avatar/index.d.ts +22 -0
- package/dist/theme/aristid/components/DataDisplay/Badge/index.d.ts +1 -0
- package/dist/theme/aristid/components/DataDisplay/Card/index.d.ts +101 -0
- package/dist/theme/aristid/components/DataDisplay/Tooltip/index.d.ts +1 -0
- package/dist/theme/aristid/components/DataEntry/Input/Input/index.d.ts +1 -0
- package/dist/theme/aristid/components/DataEntry/Input/InputWrapper/index.d.ts +14 -0
- package/dist/theme/aristid/components/DataEntry/Rate/index.d.ts +1 -0
- package/dist/theme/aristid/components/DataEntry/Slider/index.d.ts +1 -0
- package/dist/theme/aristid/components/DataEntry/Tag/index.d.ts +1 -0
- package/dist/theme/aristid/components/General/Button/index.d.ts +1 -0
- package/dist/theme/aristid/general/border/index.d.ts +2 -0
- package/dist/theme/aristid/general/colors/index.d.ts +2 -0
- package/dist/theme/aristid/general/index.d.ts +2 -0
- package/dist/theme/aristid/general/spacing/index.d.ts +2 -0
- package/dist/theme/aristid/general/typography/index.d.ts +2 -0
- package/dist/theme/aristid/index.d.ts +2 -0
- package/dist/theme/colors.d.ts +95 -0
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/theme-context.d.ts +9 -0
- package/dist/theme/types/components/DataDisplay/Avatar/index.d.ts +27 -0
- package/dist/theme/types/components/DataDisplay/Badge/index.d.ts +34 -0
- package/dist/theme/types/components/DataDisplay/Card/index.d.ts +103 -0
- package/dist/theme/types/components/DataDisplay/Tooltip/index.d.ts +19 -0
- package/dist/theme/types/components/DataEntry/Input/Input/index.d.ts +59 -0
- package/dist/theme/types/components/DataEntry/Input/InputWrapper/index.d.ts +16 -0
- package/dist/theme/types/components/DataEntry/Rate/index.d.ts +25 -0
- package/dist/theme/types/components/DataEntry/Slider/index.d.ts +69 -0
- package/dist/theme/types/components/DataEntry/Tag/index.d.ts +40 -0
- package/dist/theme/types/components/General/Button/index.d.ts +66 -0
- package/dist/theme/types/general/border/index.d.ts +14 -0
- package/dist/theme/types/general/colors/index.d.ts +96 -0
- package/dist/theme/types/general/spacing/index.d.ts +12 -0
- package/dist/theme/types/general/typography/index.d.ts +22 -0
- package/dist/theme/types/index.d.ts +52 -0
- package/dist/theme/typography.d.ts +35 -0
- package/dist/vite-env.d.ts +1 -0
- package/package.json +94 -0
package/README.md
ADDED
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
<div className="git-intro">
|
|
2
|
+
<div style="text-align: center">
|
|
3
|
+
<img src="public/images/logo-aristid.png" alt="Logo" height="100px">
|
|
4
|
+
<p style="text-align: center">
|
|
5
|
+
ARiSTiD design system documentation.
|
|
6
|
+
<a href="https://storybook.aristid.com/?path=/docs/introduction-wip--docs">View Demo</a>
|
|
7
|
+
·
|
|
8
|
+
<a href="https://gitlab.aristid.com/dev/design-system/-/issues">Report Bug</a>
|
|
9
|
+
·
|
|
10
|
+
<a href="https://gitlab.aristid.com/dev/design-system/-/issues">Request Feature</a>
|
|
11
|
+
</p>
|
|
12
|
+
</div>
|
|
13
|
+
<br/>
|
|
14
|
+
<hr>
|
|
15
|
+
<details open className="toc-block">
|
|
16
|
+
<summary>Table of Contents</summary>
|
|
17
|
+
<ol>
|
|
18
|
+
<li>
|
|
19
|
+
<a href="#getting-started">Getting Started</a>
|
|
20
|
+
<ul>
|
|
21
|
+
<li>
|
|
22
|
+
<a href="#prerequisites">Prerequisites</a>
|
|
23
|
+
</li>
|
|
24
|
+
<li>
|
|
25
|
+
<a href="#installation">Installation</a>
|
|
26
|
+
</li>
|
|
27
|
+
<li>
|
|
28
|
+
<a href="#usage-in-a-project">Usage in a project</a>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</li>
|
|
32
|
+
<li>
|
|
33
|
+
<a href="#development">Development</a>
|
|
34
|
+
<ul>
|
|
35
|
+
<li>
|
|
36
|
+
<a href="#code-structure">Code structure</a>
|
|
37
|
+
</li>
|
|
38
|
+
<li>
|
|
39
|
+
<a href="#creating-a-component">Creating a component</a>
|
|
40
|
+
<ul>
|
|
41
|
+
<li>
|
|
42
|
+
<a href="#component-code">Component code</a>
|
|
43
|
+
</li>
|
|
44
|
+
<li>
|
|
45
|
+
<a href="#component-documentation">Component documentation</a>
|
|
46
|
+
</li>
|
|
47
|
+
</ul>
|
|
48
|
+
</li>
|
|
49
|
+
</ul>
|
|
50
|
+
</li>
|
|
51
|
+
<li>
|
|
52
|
+
<a href="#contributing">Contributing</a>
|
|
53
|
+
<ul>
|
|
54
|
+
<li>
|
|
55
|
+
<a href="#commit">Commit</a>
|
|
56
|
+
</li>
|
|
57
|
+
<li>
|
|
58
|
+
<a href="#gitflow">Gitflow</a>
|
|
59
|
+
<ul>
|
|
60
|
+
<li>
|
|
61
|
+
<a href="#feature">Feature</a>
|
|
62
|
+
</li>
|
|
63
|
+
<li>
|
|
64
|
+
<a href="#release">Release</a>
|
|
65
|
+
</li>
|
|
66
|
+
<li>
|
|
67
|
+
<a href="#hotfix">Hotfix</a>
|
|
68
|
+
</li>
|
|
69
|
+
</ul>
|
|
70
|
+
</li>
|
|
71
|
+
</ul>
|
|
72
|
+
</li>
|
|
73
|
+
</ol>
|
|
74
|
+
</details>
|
|
75
|
+
<hr>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
## Getting Started
|
|
79
|
+
### Prerequisites
|
|
80
|
+
|
|
81
|
+
* npm
|
|
82
|
+
|
|
83
|
+
```sh dark
|
|
84
|
+
npm install npm@latest -g
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
* yarn
|
|
88
|
+
|
|
89
|
+
```sh dark
|
|
90
|
+
npm install yarn -g
|
|
91
|
+
```
|
|
92
|
+
<br/>
|
|
93
|
+
|
|
94
|
+
### Installation
|
|
95
|
+
|
|
96
|
+
1. Create a folder for this repo
|
|
97
|
+
|
|
98
|
+
```sh dark
|
|
99
|
+
mkdir DESIGN-SYSTEM
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
2. Clone the repo
|
|
103
|
+
|
|
104
|
+
```sh dark
|
|
105
|
+
git clone https://gitlab.aristid.com/dev/design-system.git
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
3. Install requiered packages
|
|
109
|
+
|
|
110
|
+
```sh dark
|
|
111
|
+
yarn install
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
6. Start the application
|
|
115
|
+
|
|
116
|
+
```sh dark
|
|
117
|
+
yarn storybook
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
7. Once the installation is complete, you can access to the application at http://localhost:6006.
|
|
121
|
+
|
|
122
|
+
<br/>
|
|
123
|
+
|
|
124
|
+
### Usage in a project
|
|
125
|
+
|
|
126
|
+
⚠️ TODO :
|
|
127
|
+
- How to import
|
|
128
|
+
- How to use
|
|
129
|
+
- How to use KitApp ?
|
|
130
|
+
- Internationalization / themes (?)
|
|
131
|
+
|
|
132
|
+
<br/>
|
|
133
|
+
|
|
134
|
+
## Development
|
|
135
|
+
|
|
136
|
+
### Code structure
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
1. 📁 .storybook (💡 Configuration files of Storybook)
|
|
140
|
+
2. 📁 src (💡 Design system code)
|
|
141
|
+
- 📁 fonts
|
|
142
|
+
- 📁 icons (💡 Custom icons components)
|
|
143
|
+
- 📁 Kit (💡 Components are in this folder and follow the same structure as in "stories/02-Design System/")
|
|
144
|
+
- 📁 App
|
|
145
|
+
- 📁 DataDisplay
|
|
146
|
+
- 📁 DataEntry
|
|
147
|
+
- 📁 Feedback
|
|
148
|
+
- 📁 General
|
|
149
|
+
- 📁 Layout
|
|
150
|
+
- 📁 theme (💡 Theme variables declaration)
|
|
151
|
+
- index.tsx (💡 Components export)
|
|
152
|
+
- vite-env.d.ts
|
|
153
|
+
3. 📁 stories (💡 Storybook documentation)
|
|
154
|
+
- 📁 01-Design
|
|
155
|
+
- 📁 02-Design System (💡 Components documentation are in this folder)
|
|
156
|
+
- 📁 01-General
|
|
157
|
+
- 📁 02-Layout
|
|
158
|
+
- 📁 03-Navigation
|
|
159
|
+
- 📁 04-DataEntry
|
|
160
|
+
- 📁 05-DataDisplay
|
|
161
|
+
- 📁 06-Feedback
|
|
162
|
+
- 📁 assets
|
|
163
|
+
- 📁 Root
|
|
164
|
+
<br/>
|
|
165
|
+
|
|
166
|
+
### Creating a component
|
|
167
|
+
#### Component code
|
|
168
|
+
|
|
169
|
+
1. Create a new folder for the code of your component
|
|
170
|
+
|
|
171
|
+
```sh dark
|
|
172
|
+
mkdir DESIGN-SYSTEM/src/Kit/DataDisplay/Tooltip
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
2. In this folder create two files
|
|
176
|
+
|
|
177
|
+
```sh dark
|
|
178
|
+
cd Tooltip
|
|
179
|
+
touch index.tsx
|
|
180
|
+
touch types.d.ts
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
3. Exemple of `Tooltip/index.tsx`
|
|
184
|
+
|
|
185
|
+
```tsx dark
|
|
186
|
+
import React from 'react';
|
|
187
|
+
import {Tooltip as AntdTooltip} from 'antd';
|
|
188
|
+
import {KitTooltipProps} from './types';
|
|
189
|
+
|
|
190
|
+
export const KitTooltip: React.FunctionComponent<KitTooltipProps> = tooltipProps => {
|
|
191
|
+
return <AntdTooltip {...tooltipProps} />;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
KitTooltip.displayName = 'KitTooltip';
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
4. Exemple of `Tooltip/types.d.ts`
|
|
198
|
+
|
|
199
|
+
```tsx dark
|
|
200
|
+
import {TooltipProps} from 'antd';
|
|
201
|
+
import {HTMLAttributes} from 'react';
|
|
202
|
+
|
|
203
|
+
type AntdTooltipTypesToOmit = 'color' | 'overlayClassName' | 'overlayStyle' | 'overlayInnerStyle';
|
|
204
|
+
|
|
205
|
+
export interface KitTooltipProps extends Omit<TooltipProps, AntdTooltipTypesToOmit>, HTMLAttributes<HTMLDivElement> {}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
5. Export your component in `/Kit/05-DataDisplay/index.tsx`
|
|
209
|
+
|
|
210
|
+
```tsx dark
|
|
211
|
+
import {KitTooltip} from './Tooltip';
|
|
212
|
+
...
|
|
213
|
+
export {KitTooltip};
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
<br/>
|
|
217
|
+
|
|
218
|
+
#### Component documentation
|
|
219
|
+
|
|
220
|
+
1. Create a new folder for the documentation of your component
|
|
221
|
+
|
|
222
|
+
```sh dark
|
|
223
|
+
mkdir DESIGN-SYSTEM/stories/02-Design System/05-DataDisplay/Tooltip
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
2. In this folder create two files
|
|
227
|
+
|
|
228
|
+
```sh dark
|
|
229
|
+
cd Tooltip
|
|
230
|
+
touch Tooltip.stories.mdx
|
|
231
|
+
touch data.tsx
|
|
232
|
+
```
|
|
233
|
+
- Tooltip.stories.mdx : Contain all your documentation and exemples
|
|
234
|
+
- data.tsx : Used mainly for the API section (Args, Template, ...)
|
|
235
|
+
|
|
236
|
+
3. Create `exemples` for your component
|
|
237
|
+
|
|
238
|
+
```sh dark
|
|
239
|
+
mkdir exemples
|
|
240
|
+
cd exemples
|
|
241
|
+
touch basic.tsx
|
|
242
|
+
touch index.tsx
|
|
243
|
+
```
|
|
244
|
+
- basic.tsx : Contain your exemple
|
|
245
|
+
- index.tsx : Used for export exemples and sources
|
|
246
|
+
|
|
247
|
+
4. Exemple of `Tooltip/exemples/basic.tsx`
|
|
248
|
+
|
|
249
|
+
```tsx dark
|
|
250
|
+
import React from 'react';
|
|
251
|
+
import {KitTooltip} from '@aristid/design-system';
|
|
252
|
+
|
|
253
|
+
const App = () => {
|
|
254
|
+
return (
|
|
255
|
+
<KitTooltip title="Hey i'm a tooltip">
|
|
256
|
+
Tooltip will show on mouse enter.
|
|
257
|
+
</KitTooltip>
|
|
258
|
+
);
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export default App;
|
|
262
|
+
```
|
|
263
|
+
<br/>
|
|
264
|
+
|
|
265
|
+
5. Exemple of `Tooltip/exemples/index.tsx`
|
|
266
|
+
|
|
267
|
+
```tsx dark
|
|
268
|
+
import Basic from './basic';
|
|
269
|
+
import BasicSource from './basic?raw';
|
|
270
|
+
|
|
271
|
+
export const Sources = {
|
|
272
|
+
Basic: BasicSource
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export default {
|
|
276
|
+
Basic
|
|
277
|
+
};
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
<br/>
|
|
281
|
+
|
|
282
|
+
6. Exemple of `Tooltip/data.tsx`
|
|
283
|
+
|
|
284
|
+
```tsx dark
|
|
285
|
+
import React from 'react';
|
|
286
|
+
import {KitTooltip} from '@aristid/design-system';
|
|
287
|
+
|
|
288
|
+
export const TooltipArgTypes = {
|
|
289
|
+
title: {
|
|
290
|
+
name: 'title',
|
|
291
|
+
description: 'The text shown in the tooltip',
|
|
292
|
+
control: {type: 'text'},
|
|
293
|
+
table: {
|
|
294
|
+
type: {
|
|
295
|
+
summary: 'ReactNode | () => ReactNode'
|
|
296
|
+
},
|
|
297
|
+
category: 'Tooltip'
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
...
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export const Template = ({component, ...args}) => {
|
|
304
|
+
return (
|
|
305
|
+
<KitTooltip {...args}>
|
|
306
|
+
Tooltip will show on mouse enter.
|
|
307
|
+
</KitTooltip>
|
|
308
|
+
);
|
|
309
|
+
};
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
<br/>
|
|
313
|
+
|
|
314
|
+
7. Exemple of `Tooltip/Tooltip.stories.mdx`
|
|
315
|
+
|
|
316
|
+
```tsx dark
|
|
317
|
+
import { TooltipArgTypes, Template } from "./data";
|
|
318
|
+
import Exemples, { Sources } from './exemples';
|
|
319
|
+
import CustomCanvas from '../../../../.storybook/components/CustomCanvas.jsx';
|
|
320
|
+
|
|
321
|
+
<Meta
|
|
322
|
+
title="Design System/DataDisplay/Tooltip"
|
|
323
|
+
argTypes={TooltipArgTypes}
|
|
324
|
+
/>
|
|
325
|
+
|
|
326
|
+
<CustomCanvas content={Exemples.Basic} source={Sources.Basic} />
|
|
327
|
+
|
|
328
|
+
<Canvas>
|
|
329
|
+
<Story name="Tooltip">{Template.bind({})}</Story>
|
|
330
|
+
</Canvas>
|
|
331
|
+
|
|
332
|
+
<Controls story="Tooltip" />
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
<br/>
|
|
336
|
+
|
|
337
|
+
## Contributing
|
|
338
|
+
|
|
339
|
+
Any contributions you make are **greatly appreciated**. If you have a suggestion that would make this better, please create a pull request. You can also simply open an issue with the appropriate tag to report a bug or inconsistencies in documentation.
|
|
340
|
+
|
|
341
|
+
### Commit
|
|
342
|
+
|
|
343
|
+
Commit message must respect the following pattern :
|
|
344
|
+
|
|
345
|
+
```sh
|
|
346
|
+
git commit -m "type[(component)] : message"
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
The type is telling us what change or iteration is being made. We have the following types:
|
|
350
|
+
|
|
351
|
+
| Type | Description | Exemple |
|
|
352
|
+
|---|---|---|
|
|
353
|
+
| test | indicates any type of creation or alteration of test codes | Creation of unit tests |
|
|
354
|
+
| feat | indicates the development of a new feature for the project. | Adding a service, functionality, endpoint, etc |
|
|
355
|
+
| refactor | used when there is a code refactoring that does not have any impact on the system logic/rules | Code changes after a code review |
|
|
356
|
+
| style | used when there are code formatting and style changes that do not change the system in any way | Change the style-guide, change the lint convention, fix indentations, remove white spaces, remove comments, etc… |
|
|
357
|
+
| fix | used when correcting errors that are generating bugs in the system | Apply a handling for a function that is not behaving as expected and returning an error |
|
|
358
|
+
| chore | indicates changes to the project that do not affect the system or test files. These are developmental changes | Change rules for eslint, add prettier, add more file extensions to .gitignore |
|
|
359
|
+
| docs | used when there are changes in the project documentation | add information in the API documentation, change the README, etc |
|
|
360
|
+
| build | used to indicate changes that affect the project build process or external dependencies | add/remove npm dependencies, etc… |
|
|
361
|
+
| perf | indicates a change that improved system performance | change ForEach to While, etc… |
|
|
362
|
+
| ci | used for changes in CI configuration files | Circle, Travis, BrowserStack, etc… |
|
|
363
|
+
| revert | indicates the reversal of a previous commit |
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
Exemple :
|
|
367
|
+
|
|
368
|
+
```sh
|
|
369
|
+
git commit -m "style(Tooltip) : Change color on hover"
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
📚 Based on this [article](https://dev.to/hornet_daemon/git-commit-patterns-5dm7).
|
|
373
|
+
|
|
374
|
+
<br/>
|
|
375
|
+
|
|
376
|
+
### Gitflow
|
|
377
|
+
|
|
378
|
+
We use Gitflow as Git branching model for this project. We have two branches to record our project history :
|
|
379
|
+
- main (💡 Stores the official release history)
|
|
380
|
+
- develop (💡 Serves as an integration branch for features)
|
|
381
|
+
|
|
382
|
+
📚 Based on this [article](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow).
|
|
383
|
+
|
|
384
|
+
#### Feature
|
|
385
|
+
|
|
386
|
+
<img src="public/images/gitflow-feature.png" alt="Logo" height="250px">
|
|
387
|
+
|
|
388
|
+
Creating a feature branch
|
|
389
|
+
|
|
390
|
+
```sh
|
|
391
|
+
git flow feature start addTooltipComponent
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
Continue your work and use Git like you normally would.
|
|
395
|
+
|
|
396
|
+
Finishing a feature branch
|
|
397
|
+
|
|
398
|
+
```sh
|
|
399
|
+
git flow feature finish addTooltipComponent
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
#### Release
|
|
403
|
+
|
|
404
|
+
<img src="public/images/gitflow-release.png" alt="Logo" height="250px">
|
|
405
|
+
|
|
406
|
+
Creating a release
|
|
407
|
+
|
|
408
|
+
```sh
|
|
409
|
+
git flow release start 0.1.0
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
⚠️ - Don't forget to update the version number in `package.json`
|
|
413
|
+
|
|
414
|
+
Finishing a release
|
|
415
|
+
|
|
416
|
+
```sh
|
|
417
|
+
git flow release finish '0.1.0'
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
#### Hotfix
|
|
421
|
+
|
|
422
|
+
<img src="public/images/gitflow-hotfix.png" alt="Logo" height="250px">
|
|
423
|
+
|
|
424
|
+
Creating a release
|
|
425
|
+
|
|
426
|
+
```sh
|
|
427
|
+
git flow hotfix start fixTooltip
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Finishing a release
|
|
431
|
+
|
|
432
|
+
```sh
|
|
433
|
+
git flow hotfix finish fixTooltip
|
|
434
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { KitAvatarGroupProps, KitAvatarProps } from './types';
|
|
3
|
+
type CompoundedComponent = React.FunctionComponent<KitAvatarProps> & {
|
|
4
|
+
Group: React.FunctionComponent<KitAvatarGroupProps>;
|
|
5
|
+
};
|
|
6
|
+
export declare const KitAvatar: CompoundedComponent;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {AvatarProps} from 'antd';
|
|
2
|
+
import {GroupProps} from 'antd/es/avatar';
|
|
3
|
+
|
|
4
|
+
type AntdAvatarTypesToOmit = '';
|
|
5
|
+
type AntdAvatarGroupTypesToOmit = 'maxStyle';
|
|
6
|
+
|
|
7
|
+
export type KitAvatarColorType = 'default' | 'blueInvert';
|
|
8
|
+
|
|
9
|
+
export interface KitAvatarProps extends Omit<AvatarProps, AntdAvatarTypesToOmit>, HTMLAttributes<HTMLSpanElement> {
|
|
10
|
+
color?: KitAvatarColorType;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface KitAvatarGroupProps
|
|
14
|
+
extends Omit<GroupProps, AntdAvatarGroupTypesToOmit>,
|
|
15
|
+
HTMLAttributes<HTMLDivElement> {}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {BadgeProps} from 'antd';
|
|
2
|
+
|
|
3
|
+
type AntdBadgeTypesToOmit = 'color' | 'size' | 'offset' | 'text';
|
|
4
|
+
|
|
5
|
+
export type KitBadgeCountColor = 'default' | 'green' | 'blue' | 'blueInvert' | 'gray';
|
|
6
|
+
|
|
7
|
+
export interface KitBadgeProps extends Omit<BadgeProps, AntdBadgeTypesToOmit>, HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
countColor?: KitBadgeCountColor;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {HTMLAttributes} from 'react';
|
|
2
|
+
import {KitTagProps} from '../../DataEntry/Tag/types';
|
|
3
|
+
|
|
4
|
+
export type cardColor = {
|
|
5
|
+
label: string;
|
|
6
|
+
color: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export interface KitColorbarProps {
|
|
10
|
+
colors?: cardColor[] | null;
|
|
11
|
+
vertical?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default interface KitCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
vertical?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
colors?: cardColor[] | null;
|
|
19
|
+
picture?: ReactNode;
|
|
20
|
+
title?: ReactNode;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
extrainfo?: ReactNode;
|
|
23
|
+
tags?: KitTagProps[] | string[];
|
|
24
|
+
actions?: (typeof Button)[];
|
|
25
|
+
onSelectChange?: (e: T) => void;
|
|
26
|
+
onEdit?: () => void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { KitHeaderProps, KitCollapseProps, KitHeaderExtraProps } from './types';
|
|
3
|
+
type CompoundedComponent = React.FunctionComponent<KitCollapseProps> & {
|
|
4
|
+
Header: React.FunctionComponent<KitHeaderProps>;
|
|
5
|
+
HeaderExtra: React.FunctionComponent<KitHeaderExtraProps>;
|
|
6
|
+
};
|
|
7
|
+
export declare const KitCollapse: CompoundedComponent;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {CollapseProps} from 'antd';
|
|
2
|
+
import {HTMLAttributes, ReactNode} from 'react';
|
|
3
|
+
|
|
4
|
+
type AntdCollapseTypesToOmit = 'bordered' | 'expandIconPosition' | 'ghost';
|
|
5
|
+
|
|
6
|
+
export interface KitCollapseProps
|
|
7
|
+
extends Omit<CollapseProps, AntdCollapseTypesToOmit>,
|
|
8
|
+
HTMLAttributes<HTMLDivElement> {}
|
|
9
|
+
|
|
10
|
+
export interface KitHeaderProps {
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
imageSrc?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
tagContent?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface KitHeaderExtraAction {
|
|
19
|
+
icon: ReactNode;
|
|
20
|
+
label: string;
|
|
21
|
+
onClick: MenuClickEventHandler;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface KitHeaderExtraActions extends Array<KitHeaderExtraAction> {}
|
|
25
|
+
|
|
26
|
+
export interface KitHeaderExtraProps {
|
|
27
|
+
onSelectChange?: (e: CheckboxChangeEvent) => void;
|
|
28
|
+
actions?: KitHeaderExtraActions;
|
|
29
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image as AntdImage } from 'antd';
|
|
3
|
+
import { KitImageProps } from './types';
|
|
4
|
+
type CompoundedComponent = React.FunctionComponent<KitImageProps> & {
|
|
5
|
+
PreviewGroup: typeof AntdImage.PreviewGroup;
|
|
6
|
+
};
|
|
7
|
+
export declare const KitImage: CompoundedComponent;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {ImageProps} from 'antd';
|
|
2
|
+
import {Image} from 'antd';
|
|
3
|
+
import {HTMLAttributes, ReactElement} from 'react';
|
|
4
|
+
|
|
5
|
+
export interface KitImageProps extends ImageProps, HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
rounded?: boolean;
|
|
7
|
+
bordered?: boolean;
|
|
8
|
+
PreviewGroup?: ReactElement<Image.PreviewGroup>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface themeProps {
|
|
12
|
+
borderRadius: number;
|
|
13
|
+
borderColor: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {HTMLAttributes} from 'react';
|
|
2
|
+
|
|
3
|
+
export interface KitItemListProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
picture?: ReactNode;
|
|
7
|
+
onSelectChange?: (e: CheckboxChangeEvent) => void;
|
|
8
|
+
tagNumber?: number;
|
|
9
|
+
onRafterClick?: Function;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
onClick?: Function;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TabsProps } from 'antd';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
export interface KitTabsProps extends TabsProps, HTMLAttributes<HTMLDivElement> { };
|
|
5
|
+
|
|
6
|
+
export interface KitTabsThemeProps {
|
|
7
|
+
extra: {
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
borderColor: string;
|
|
10
|
+
padding: string;
|
|
11
|
+
height: number;
|
|
12
|
+
color: string;
|
|
13
|
+
verticalMargin: number;
|
|
14
|
+
horizontalMargin: number;
|
|
15
|
+
}
|
|
16
|
+
}
|