@nd-storybook/storybook 0.3.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/README.md +71 -0
- package/dist/css/badge.css +20 -0
- package/dist/css/button.css +0 -0
- package/dist/css/components/.DS_Store +0 -0
- package/dist/css/components/modal.css +133 -0
- package/dist/css/components/portal/accordion.css +39 -0
- package/dist/css/components/portal/accordionItem.css +102 -0
- package/dist/css/components/portal/alert.css +71 -0
- package/dist/css/components/portal/dataFrame.css +450 -0
- package/dist/css/components/portal/description-list.css +37 -0
- package/dist/css/components/portal/menuItem.css +93 -0
- package/dist/css/components/portal/navigationCard.css +86 -0
- package/dist/css/components/portal/portal-navigation.css +45 -0
- package/dist/css/components/portal/tabs.css +220 -0
- package/dist/css/experimental/collapsed-card.css +16 -0
- package/dist/css/molecules/form.css +28 -0
- package/dist/css/tailwind.css +21 -0
- package/dist/css/tokens.css +511 -0
- package/dist/css/typography.css +359 -0
- package/dist/index.cjs.js +107 -0
- package/dist/index.d.ts +396 -0
- package/dist/index.es.js +6369 -0
- package/dist/tailwind.config.js +96 -0
- package/dist/tailwind.tokens.js +452 -0
- package/dist/tokens.utilities.js +1042 -0
- package/package.json +83 -0
- package/tailwind.config.js +86 -0
- package/tailwind.tokens.js +252 -0
- package/tokens.utilities.js +870 -0
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Company Design System
|
|
2
|
+
|
|
3
|
+
This repository contains the design system for our company, built with Vue 3, Tailwind CSS, and Storybook.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Updating tokens
|
|
14
|
+
|
|
15
|
+
1. Go to the Design system in Figma: https://www.figma.com/design/KBKdkDiytfjb5XDctGX367.
|
|
16
|
+
2. Install the plugin 'Design token manager' from the Figma community.
|
|
17
|
+
3. Open the plugin and click the 'export' button.
|
|
18
|
+
4. Copy the generated JSON to the `/tokens` folder in this project.
|
|
19
|
+
5. Run the `yarn build-tailwind-tokens` command to generate the Tailwind CSS configuration from the tokens.
|
|
20
|
+
|
|
21
|
+
> Note: this command only needs to be run when the tokens are updated in Figma. No need to call this method every time you run the project, or deploy it.
|
|
22
|
+
|
|
23
|
+
### Development
|
|
24
|
+
|
|
25
|
+
To run the development server:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm run serve
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To run Storybook:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm run storybook
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Building
|
|
38
|
+
|
|
39
|
+
To build the library:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm run build
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
To build Storybook:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm run build-storybook
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Components
|
|
52
|
+
|
|
53
|
+
The design system includes the following components:
|
|
54
|
+
|
|
55
|
+
- Button
|
|
56
|
+
- Card
|
|
57
|
+
|
|
58
|
+
Each component has its own directory with:
|
|
59
|
+
- Vue component file
|
|
60
|
+
- Storybook stories file
|
|
61
|
+
|
|
62
|
+
## Customization
|
|
63
|
+
|
|
64
|
+
The design system uses Tailwind CSS for styling. You can customize the design tokens in the `tailwind.config.js` file.
|
|
65
|
+
|
|
66
|
+
## Adding New Components
|
|
67
|
+
|
|
68
|
+
1. Create a new directory in `src/components/`
|
|
69
|
+
2. Add your Vue component file
|
|
70
|
+
3. Create a Storybook stories file
|
|
71
|
+
4. Export the component in `src/components/index.js`
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
|
|
3
|
+
.badge-premium {
|
|
4
|
+
@apply
|
|
5
|
+
inline-flex
|
|
6
|
+
items-center
|
|
7
|
+
gap-x-xs
|
|
8
|
+
p-s
|
|
9
|
+
bg-background-accent-pink-subtlest
|
|
10
|
+
text-meta-regular
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.badge-premium-small {
|
|
14
|
+
@apply
|
|
15
|
+
p-xs
|
|
16
|
+
gap-x-xs
|
|
17
|
+
text-meta-regular
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
/* Modal Overlay */
|
|
3
|
+
.modal-overlay {
|
|
4
|
+
@apply fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity duration-300 ease-in-out;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Modal Panel */
|
|
8
|
+
.modal-panel {
|
|
9
|
+
@apply inline-block align-bottom bg-white p-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all duration-300 ease-in-out w-full max-w-sm;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Modal Dialog */
|
|
13
|
+
.modal-dialog {
|
|
14
|
+
@apply inline-block w-full max-w-md overflow-y-auto text-left align-middle transition-all duration-300 ease-in-out transform bg-white shadow-xl rounded-lg font-fira-sans;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.modal-dialog-md {
|
|
18
|
+
@apply w-full max-w-md;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.modal-dialog-xl {
|
|
22
|
+
@apply w-full max-w-xl;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.modal-dialog-scrollable {
|
|
26
|
+
max-height: calc(100vh - 3rem);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Modal Header */
|
|
30
|
+
.modal-header {
|
|
31
|
+
@apply flex flex-col justify-between flex-wrap px-4 py-6 border-b border-gray-200;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@screen sm {
|
|
35
|
+
.modal-header {
|
|
36
|
+
@apply flex-nowrap px-6;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.modal-dialog h2 {
|
|
41
|
+
@apply text-lg font-medium text-gray-900;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Modal Body */
|
|
45
|
+
.modal-body {
|
|
46
|
+
@apply p-4;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@screen sm {
|
|
50
|
+
.modal-body {
|
|
51
|
+
@apply p-6;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Modal Footer */
|
|
56
|
+
.modal-footer {
|
|
57
|
+
@apply flex-row px-4 py-5 border-t border-gray-200 flex;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@screen sm {
|
|
61
|
+
.modal-footer {
|
|
62
|
+
@apply p-6;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Simplified Modal */
|
|
67
|
+
.modal-simplified .modal-header {
|
|
68
|
+
@apply border-b-0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.modal-simplified .modal-body {
|
|
72
|
+
@apply pt-2 pb-2;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.modal-simplified .modal-footer {
|
|
76
|
+
@apply border-t-0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Slideover Modal */
|
|
80
|
+
.modal-slideover {
|
|
81
|
+
@apply pointer-events-auto w-screen max-w-md;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.modal-slideover-xl {
|
|
85
|
+
@apply max-w-2xl;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.modal-slideover-container {
|
|
89
|
+
@apply flex h-full flex-col overflow-y-hidden bg-white shadow-xl;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Close button */
|
|
93
|
+
.modal-close-button {
|
|
94
|
+
@apply absolute top-7 right-7;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Slideover Body */
|
|
98
|
+
.modal-slideover-body {
|
|
99
|
+
@apply relative flex-grow;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Mobile Modal Styles */
|
|
103
|
+
@media (max-width: 767px) {
|
|
104
|
+
.modal-dialog:not(.modal-compact) {
|
|
105
|
+
width: 100% !important;
|
|
106
|
+
max-width: 100% !important;
|
|
107
|
+
margin: 0 !important;
|
|
108
|
+
height: 100vh !important;
|
|
109
|
+
max-height: 100vh !important;
|
|
110
|
+
border-radius: 0 !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.modal-dialog:not(.modal-compact) .modal-container {
|
|
114
|
+
border-radius: 0 !important;
|
|
115
|
+
width: 100% !important;
|
|
116
|
+
height: 100% !important;
|
|
117
|
+
max-height: 100vh !important;
|
|
118
|
+
display: flex !important;
|
|
119
|
+
flex-direction: column !important;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.modal-dialog:not(.modal-compact) .modal-body {
|
|
123
|
+
flex: 1 !important;
|
|
124
|
+
overflow-y: auto !important;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.modal-dialog.modal-compact {
|
|
128
|
+
width: calc(100% - 2rem) !important;
|
|
129
|
+
max-width: calc(100% - 2rem) !important;
|
|
130
|
+
margin: 0 1rem !important;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* Accordion.css - COMPLETE */
|
|
2
|
+
.accordion {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
width: 100%;
|
|
6
|
+
max-width: 799px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.accordion__title {
|
|
10
|
+
margin-bottom: var(--spacing-m);
|
|
11
|
+
font-family: var(--heading-2-fontFamily);
|
|
12
|
+
font-size: var(--heading-2-fontSize);
|
|
13
|
+
font-weight: var(--heading-2-fontWeight);
|
|
14
|
+
line-height: var(--heading-2-lineHeight);
|
|
15
|
+
color: var(--color-text-default);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.accordion__items {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.accordion__item-wrapper {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.accordion__item-wrapper + .accordion__item-wrapper {
|
|
28
|
+
margin-top: var(--spacing-s);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* FAQ-specific styling */
|
|
32
|
+
.faq {
|
|
33
|
+
width: 100%;
|
|
34
|
+
max-width: 799px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.faq .accordion {
|
|
38
|
+
width: 100%;
|
|
39
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/* AccordionItem.css - COMPLETE */
|
|
2
|
+
.accordion-item {
|
|
3
|
+
border: var(--border-width-s) solid var(--color-border-accent-gray);
|
|
4
|
+
background: var(--color-background-default);
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: block;
|
|
7
|
+
transition: border-color 0.2s ease;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.accordion-item--open {
|
|
11
|
+
border-color: var(--color-border-brand);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.accordion-item__button {
|
|
15
|
+
padding: var(--spacing-xs) var(--spacing-s);
|
|
16
|
+
width: 100%;
|
|
17
|
+
border: 0;
|
|
18
|
+
background: transparent;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
text-align: left;
|
|
24
|
+
outline: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.accordion-item__button:focus-visible {
|
|
28
|
+
outline: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.accordion-item:has(.accordion-item__button:focus-visible):not(.accordion-item--open) {
|
|
32
|
+
border-color: var(--color-border-brand);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.accordion-item__button:hover .accordion-item__question {
|
|
36
|
+
text-decoration: underline;
|
|
37
|
+
text-underline-offset: 25%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.accordion-item__question {
|
|
41
|
+
flex: 1;
|
|
42
|
+
display: block;
|
|
43
|
+
font-family: var(--body-bold-fontFamily);
|
|
44
|
+
font-size: var(--body-bold-fontSize);
|
|
45
|
+
font-weight: var(--body-bold-fontWeight);
|
|
46
|
+
line-height: var(--body-bold-lineHeight);
|
|
47
|
+
color: var(--color-text-default);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Large variant */
|
|
51
|
+
.accordion-item__question--large {
|
|
52
|
+
font-family: var(--heading-2-fontFamily);
|
|
53
|
+
font-size: var(--heading-2-fontSize);
|
|
54
|
+
font-weight: var(--heading-2-fontWeight);
|
|
55
|
+
line-height: var(--heading-2-lineHeight);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.accordion-item__icon {
|
|
59
|
+
width: 20px;
|
|
60
|
+
height: 20px;
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
transition: transform 0.2s ease;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.accordion-item--open .accordion-item__icon {
|
|
69
|
+
transform: rotate(180deg);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.accordion-item__answer {
|
|
73
|
+
max-height: 0;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
opacity: 0;
|
|
76
|
+
transform: translateY(-10px);
|
|
77
|
+
transition: max-height 0.3s ease,
|
|
78
|
+
opacity 0.3s ease,
|
|
79
|
+
transform 0.3s ease,
|
|
80
|
+
padding 0.3s ease;
|
|
81
|
+
padding: 0 var(--spacing-s);
|
|
82
|
+
width: 100%;
|
|
83
|
+
display: block;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.accordion-item__answer--open {
|
|
87
|
+
max-height: 500px;
|
|
88
|
+
opacity: 1;
|
|
89
|
+
transform: translateY(0);
|
|
90
|
+
padding: var(--spacing-xs) var(--spacing-s) var(--spacing-xs);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.accordion-item__content {
|
|
94
|
+
margin-top: var(--spacing-xs);
|
|
95
|
+
margin-bottom: 0;
|
|
96
|
+
display: block;
|
|
97
|
+
font-family: var(--body-light-fontFamily);
|
|
98
|
+
font-size: var(--body-light-fontSize);
|
|
99
|
+
font-weight: var(--body-light-fontWeight);
|
|
100
|
+
line-height: var(--body-light-lineHeight);
|
|
101
|
+
color: var(--color-text-default);
|
|
102
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* Alert.css - COMPLETE */
|
|
2
|
+
.alert {
|
|
3
|
+
padding: var(--spacing-s) var(--spacing-m);
|
|
4
|
+
display: flex;
|
|
5
|
+
width: 100%;
|
|
6
|
+
gap: var(--spacing-xs);
|
|
7
|
+
font-family: var(--body-light-fontFamily);
|
|
8
|
+
font-size: var(--body-light-fontSize);
|
|
9
|
+
font-weight: var(--body-light-fontWeight);
|
|
10
|
+
color: var(--color-text-default);
|
|
11
|
+
border-radius: var(--border-radius-0);
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
min-height: 48px;
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.alert--dark {
|
|
18
|
+
background: var(--color-neutral-100);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.alert--danger {
|
|
22
|
+
background: var(--color-background-accent-pink-subtlest);
|
|
23
|
+
border: 1px solid var(--color-text-warning);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.alert--info {
|
|
27
|
+
background: var(--color-background-default);
|
|
28
|
+
border: 1px solid var(--color-neutral-400);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.alert--success {
|
|
32
|
+
background: var(--color-background-brand-subtlest);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.alert--warning {
|
|
36
|
+
background: var(--color-background-default);
|
|
37
|
+
border: 2px solid var(--color-text-warning);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Icon adjustments */
|
|
41
|
+
.alert svg {
|
|
42
|
+
flex-shrink: 0;
|
|
43
|
+
margin-top: 2px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Icon colors */
|
|
47
|
+
.alert__icon--dark {
|
|
48
|
+
color: var(--color-blue-400);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.alert__icon--danger {
|
|
52
|
+
color: var(--color-text-warning);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.alert__icon--info {
|
|
56
|
+
color: var(--color-blue-400);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.alert__icon--success {
|
|
60
|
+
color: var(--color-text-brand);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.alert__icon--warning {
|
|
64
|
+
color: var(--color-icons-warning);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Alert text content */
|
|
68
|
+
.alert span {
|
|
69
|
+
flex: 1;
|
|
70
|
+
line-height: 1.5;
|
|
71
|
+
}
|