design-zystem 1.0.197 → 1.0.202
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 +99 -0
- package/dist/index.css +118 -0
- package/dist/index.d.mts +718 -0
- package/dist/index.d.ts +718 -0
- package/dist/index.js +3941 -883
- package/dist/index.mjs +3875 -0
- package/package.json +36 -10
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# DesignSystem — design-zystem
|
|
2
|
+
|
|
3
|
+
Internal React component library shared across all DevCar web apps. Published as the `design-zystem` npm package.
|
|
4
|
+
|
|
5
|
+
## Tech stack
|
|
6
|
+
|
|
7
|
+
| Category | Technology |
|
|
8
|
+
| ---------- | --------------------------------------- |
|
|
9
|
+
| Framework | React 18 |
|
|
10
|
+
| Styling | styled-components 6 |
|
|
11
|
+
| Build | tsup (CJS + ESM) |
|
|
12
|
+
| TypeScript | strict, full .d.ts |
|
|
13
|
+
| Storybook | v10 (Vite) |
|
|
14
|
+
| Tests | vitest + jsdom + @testing-library/react |
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install
|
|
20
|
+
npx playwright install chromium # required once for Storybook browser tests
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Scripts
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run build # tsup → dist/ (CJS + ESM + .d.ts)
|
|
27
|
+
npm run storybook # Storybook dev server on :6006
|
|
28
|
+
npm test # behavioral unit tests (jsdom)
|
|
29
|
+
npm publish # build + publish to npm
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Storybook
|
|
33
|
+
|
|
34
|
+
`npm run storybook` launches a local dev server on `:6006` with interactive docs and stories for all 35+ components. Each component has an auto-generated **Docs** page (props table + live playground) and multiple variant stories.
|
|
35
|
+
|
|
36
|
+
A static version can be generated with `npm run build-storybook` (outputs to `storybook-static/`) for deployment to a hosting service — not committed to the repo.
|
|
37
|
+
|
|
38
|
+
## Structure
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
src/
|
|
42
|
+
index.tsx # barrel export
|
|
43
|
+
Components/ # one folder per component
|
|
44
|
+
<Name>/
|
|
45
|
+
<Name>.tsx # component + exported interface <Name>Props
|
|
46
|
+
<Name>.css
|
|
47
|
+
<Name>.stories.tsx
|
|
48
|
+
data/
|
|
49
|
+
colors.ts # color palette
|
|
50
|
+
globalMethods.ts # shared helpers
|
|
51
|
+
__tests__/ # behavioral tests (vitest + @testing-library/react)
|
|
52
|
+
dist/ # generated — do not edit
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Components
|
|
56
|
+
|
|
57
|
+
### Layout
|
|
58
|
+
|
|
59
|
+
`Box` · `Col` · `Row` · `Grid` · `PageContainer` · `Divider` · `Bulk`
|
|
60
|
+
|
|
61
|
+
### Typography & media
|
|
62
|
+
|
|
63
|
+
`Text` · `Bubble` · `Link` · `Icon` · `Image`
|
|
64
|
+
|
|
65
|
+
### Inputs
|
|
66
|
+
|
|
67
|
+
`Button` · `Input` · `Checkbox` · `Radio` · `Switch` · `Select` · `MultiSelect` · `DatePicker`
|
|
68
|
+
|
|
69
|
+
### Navigation
|
|
70
|
+
|
|
71
|
+
`Tabs` · `IconTabs` · `Stepper` · `Options`
|
|
72
|
+
|
|
73
|
+
### Overlays
|
|
74
|
+
|
|
75
|
+
`Modal` · `NewModal` · `ModalConfirmation` · `Drawer` · `Popover` · `Tooltip`
|
|
76
|
+
|
|
77
|
+
### Data
|
|
78
|
+
|
|
79
|
+
`List` · `ListItem` · `Table` · `CardSkeleton`
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { Button, Input, Modal } from 'design-zystem'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Publishing a new version
|
|
88
|
+
|
|
89
|
+
1. Bump `version` in `package.json`
|
|
90
|
+
2. `npm publish` — triggers `prepublishOnly` → `npm run build` automatically
|
|
91
|
+
3. Update `design-zystem` version in `ClientOffice/package.json` + `DeliveryApp/package.json`
|
|
92
|
+
|
|
93
|
+
## Related projects
|
|
94
|
+
|
|
95
|
+
| Project | Description |
|
|
96
|
+
| ------------ | ------------------ |
|
|
97
|
+
| ClientOffice | Uses design-zystem |
|
|
98
|
+
| DeliveryApp | Uses design-zystem |
|
|
99
|
+
| Check | Uses design-zystem |
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* src/Components/DatePicker/DatePicker.css */
|
|
2
|
+
.date-picker-container {
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
.date-picker-popup {
|
|
6
|
+
position: absolute;
|
|
7
|
+
top: 0;
|
|
8
|
+
right: 56px;
|
|
9
|
+
z-index: 50;
|
|
10
|
+
background-color: white;
|
|
11
|
+
border: 1px solid #e5e7eb;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
14
|
+
min-width: max-content;
|
|
15
|
+
}
|
|
16
|
+
.date-picker-content {
|
|
17
|
+
display: flex;
|
|
18
|
+
}
|
|
19
|
+
.calendar-container {
|
|
20
|
+
padding: 16px;
|
|
21
|
+
width: 320px;
|
|
22
|
+
}
|
|
23
|
+
.calendar-header {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
margin-bottom: 16px;
|
|
28
|
+
}
|
|
29
|
+
.calendar-nav-button {
|
|
30
|
+
padding: 4px;
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
background: none;
|
|
33
|
+
border: none;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
.calendar-nav-button:hover {
|
|
37
|
+
background-color: #f3f4f6;
|
|
38
|
+
}
|
|
39
|
+
.calendar-nav-icon {
|
|
40
|
+
width: 20px;
|
|
41
|
+
height: 20px;
|
|
42
|
+
}
|
|
43
|
+
.calendar-month-title {
|
|
44
|
+
font-size: 18px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
}
|
|
47
|
+
.calendar-days-header {
|
|
48
|
+
display: grid;
|
|
49
|
+
grid-template-columns: repeat(7, 1fr);
|
|
50
|
+
gap: 4px;
|
|
51
|
+
margin-bottom: 8px;
|
|
52
|
+
}
|
|
53
|
+
.calendar-day-name {
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
color: #6b7280;
|
|
57
|
+
text-align: center;
|
|
58
|
+
padding: 8px 0;
|
|
59
|
+
}
|
|
60
|
+
.calendar-days-grid {
|
|
61
|
+
display: grid;
|
|
62
|
+
grid-template-columns: repeat(7, 1fr);
|
|
63
|
+
gap: 4px;
|
|
64
|
+
}
|
|
65
|
+
.calendar-day-button {
|
|
66
|
+
padding: 8px;
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
border-radius: 4px;
|
|
69
|
+
transition: all 0.15s;
|
|
70
|
+
background: none;
|
|
71
|
+
border: none;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
.calendar-day-disabled {
|
|
75
|
+
color: #d1d5db;
|
|
76
|
+
cursor: not-allowed;
|
|
77
|
+
}
|
|
78
|
+
.calendar-day-button:not(.calendar-day-disabled):hover {
|
|
79
|
+
background-color: #eff6ff;
|
|
80
|
+
}
|
|
81
|
+
.calendar-day-in-range {
|
|
82
|
+
background-color: #dbeafe;
|
|
83
|
+
color: #1d4ed8;
|
|
84
|
+
}
|
|
85
|
+
.calendar-day-selected {
|
|
86
|
+
background-color: #3b82f6;
|
|
87
|
+
color: white;
|
|
88
|
+
}
|
|
89
|
+
.calendar-day-selected:hover {
|
|
90
|
+
background-color: #2563eb;
|
|
91
|
+
}
|
|
92
|
+
.calendar-day-today {
|
|
93
|
+
background-color: #f3f4f6;
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
}
|
|
96
|
+
.selected-dates-display {
|
|
97
|
+
margin-top: 16px;
|
|
98
|
+
padding: 12px;
|
|
99
|
+
background-color: #f9fafb;
|
|
100
|
+
border-radius: 4px;
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
}
|
|
103
|
+
.selected-dates-text {
|
|
104
|
+
color: #4b5563;
|
|
105
|
+
}
|
|
106
|
+
.select-end-date-hint {
|
|
107
|
+
color: #2563eb;
|
|
108
|
+
margin-left: 8px;
|
|
109
|
+
}
|
|
110
|
+
.reset-button {
|
|
111
|
+
padding: 8px 16px;
|
|
112
|
+
background-color: #9ca3af;
|
|
113
|
+
color: white;
|
|
114
|
+
border-radius: 4px;
|
|
115
|
+
font-size: 14px;
|
|
116
|
+
border: none;
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
}
|