@repobit/dex-system-design 0.5.0 → 0.6.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/CHANGELOG.md +9 -0
- package/package.json +4 -3
- package/src/assets/images/bd-header-img.jpg +0 -0
- package/src/assets/images/bd-header-us.jpg +0 -0
- package/src/components/Button/Button.js +115 -3
- package/src/components/Button/button.css.js +80 -43
- package/src/components/Button/button.stories.js +83 -7
- package/src/components/FAQ/faq.css.js +27 -16
- package/src/components/FAQ/faq.js +23 -114
- package/src/components/FAQ/faq.stories.js +41 -20
- package/src/components/Input/Input.js +2 -2
- package/src/components/Input/input.css.js +1 -1
- package/src/components/anchor/anchor-nav.css.js +92 -0
- package/src/components/anchor/anchor-nav.js +121 -0
- package/src/components/anchor/anchor.stories.js +134 -0
- package/src/components/badge/badge.css.js +27 -0
- package/src/components/badge/badge.js +30 -0
- package/src/components/badge/badge.stories.js +36 -0
- package/src/components/carousel/carousel.css.js +36 -19
- package/src/components/carousel/carousel.js +149 -99
- package/src/components/carousel/carousel.stories.js +202 -46
- package/src/components/checkbox/checkbox.css.js +132 -0
- package/src/components/checkbox/checkbox.js +130 -0
- package/src/components/checkbox/checkbox.stories.js +63 -0
- package/src/components/divider/divider-horizontal.js +29 -0
- package/src/components/divider/divider-vertical.js +32 -0
- package/src/components/divider/divider.css.js +0 -0
- package/src/components/divider/divider.stories.js +77 -0
- package/src/components/header/header.css.js +248 -0
- package/src/components/header/header.js +87 -0
- package/src/components/header/header.stories.js +57 -0
- package/src/components/highlight/highlight-s.css.js +88 -0
- package/src/components/highlight/highlight-s.js +35 -0
- package/src/components/highlight/highlight-s.stories.js +22 -0
- package/src/components/highlight/highlight.css.js +119 -0
- package/src/components/highlight/highlight.js +60 -0
- package/src/components/highlight/highlight.stories.js +53 -0
- package/src/components/light-carousel/light-carousel.css.js +18 -10
- package/src/components/light-carousel/light-carousel.js +29 -16
- package/src/components/light-carousel/light-carousel.stories.js +9 -7
- package/src/components/paragraph/paragraph.css.js +1 -1
- package/src/components/pricing-cards/pricing-card.css.js +138 -3
- package/src/components/pricing-cards/pricing-card.js +63 -82
- package/src/components/pricing-cards/pricing-card.stories.js +1 -0
- package/src/components/radio/radio.css.js +168 -0
- package/src/components/radio/radio.js +222 -0
- package/src/components/radio/radio.stories.js +103 -0
- package/src/components/tabs/tabs.css.js +26 -8
- package/src/components/tabs/tabs.js +19 -12
- package/src/components/termsOfUse/terms.css.js +7 -1
- package/src/tokens/fonts.stories.js +73 -0
- package/src/tokens/spacing.stories.js +56 -0
- package/src/tokens/tokens-grid.stories.js +83 -0
- package/src/tokens/tokens.css +116 -1
- package/src/tokens/tokens.stories.js +67 -0
- package/src/tokens/typography.stories.js +69 -0
- package/src/tokens/tokens.js +0 -206
- /package/src/assets/{icons → images}/tabs-img1.png +0 -0
- /package/src/assets/{icons → images}/tabs-img2.png +0 -0
- /package/src/assets/{icons → images}/tabs-img3.png +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import './radio.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Atoms/Radio',
|
|
6
|
+
component: 'bd-radio',
|
|
7
|
+
tags: ['autodocs'], // 👉 Asta activează Docs
|
|
8
|
+
argTypes: {
|
|
9
|
+
name: { control: 'text' },
|
|
10
|
+
value: { control: 'text' },
|
|
11
|
+
label: { control: 'text' },
|
|
12
|
+
checked: { control: 'boolean' },
|
|
13
|
+
disabled: { control: 'boolean' },
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// 👇 Template de bază
|
|
18
|
+
const Template = ({ name, value, label, checked, disabled }) => html`
|
|
19
|
+
<bd-radio
|
|
20
|
+
.name=${name}
|
|
21
|
+
.value=${value}
|
|
22
|
+
.label=${label}
|
|
23
|
+
.checked=${checked}
|
|
24
|
+
.disabled=${disabled}
|
|
25
|
+
></bd-radio>
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
// 👉 Exemples BdRadio
|
|
29
|
+
export const Default = Template.bind({});
|
|
30
|
+
Default.args = {
|
|
31
|
+
name: 'group1',
|
|
32
|
+
value: 'default',
|
|
33
|
+
label: 'Radio normal',
|
|
34
|
+
checked: false,
|
|
35
|
+
disabled: false,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Checked = Template.bind({});
|
|
39
|
+
Checked.args = {
|
|
40
|
+
name: 'group1',
|
|
41
|
+
value: 'checked',
|
|
42
|
+
label: 'Radio checked',
|
|
43
|
+
checked: true,
|
|
44
|
+
disabled: false,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const Disabled = Template.bind({});
|
|
48
|
+
Disabled.args = {
|
|
49
|
+
name: 'group1',
|
|
50
|
+
value: 'disabled',
|
|
51
|
+
label: 'Radio disabled',
|
|
52
|
+
checked: false,
|
|
53
|
+
disabled: true,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const DisabledChecked = Template.bind({});
|
|
57
|
+
DisabledChecked.args = {
|
|
58
|
+
name: 'group1',
|
|
59
|
+
value: 'disabled-checked',
|
|
60
|
+
label: 'Radio disabled & checked',
|
|
61
|
+
checked: true,
|
|
62
|
+
disabled: true,
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// ------------------------------
|
|
66
|
+
// BdToggleRadio
|
|
67
|
+
// ------------------------------
|
|
68
|
+
export const ToggleRadio = ({ name, value, label, checked, disabled }) => html`
|
|
69
|
+
<bd-toggle-radio
|
|
70
|
+
.name=${name}
|
|
71
|
+
.value=${value}
|
|
72
|
+
.label=${label}
|
|
73
|
+
.checked=${checked}
|
|
74
|
+
.disabled=${disabled}
|
|
75
|
+
></bd-toggle-radio>
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
ToggleRadio.args = {
|
|
79
|
+
name: 'toggle-group',
|
|
80
|
+
value: 'toggle1',
|
|
81
|
+
label: 'Toggle radio',
|
|
82
|
+
checked: false,
|
|
83
|
+
disabled: false,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const ToggleChecked = ToggleRadio.bind({});
|
|
87
|
+
ToggleChecked.args = {
|
|
88
|
+
...ToggleRadio.args,
|
|
89
|
+
checked: true,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const ToggleDisabled = ToggleRadio.bind({});
|
|
93
|
+
ToggleDisabled.args = {
|
|
94
|
+
...ToggleRadio.args,
|
|
95
|
+
disabled: true,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const ToggleDisabledChecked = ToggleRadio.bind({});
|
|
99
|
+
ToggleDisabledChecked.args = {
|
|
100
|
+
...ToggleRadio.args,
|
|
101
|
+
checked: true,
|
|
102
|
+
disabled: true,
|
|
103
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
1
|
+
import { css } from "../lit";
|
|
2
2
|
|
|
3
3
|
export default css`
|
|
4
4
|
:host {
|
|
5
5
|
--background-card-grey: var(--color-neutral-25);
|
|
6
6
|
--border-card-grey: var(--color-neutral-50);
|
|
7
7
|
--border-card-green: var(--color-green-700);
|
|
8
|
-
--badge-background: var(--color-blue-
|
|
8
|
+
--badge-background: var(--color-blue-700);
|
|
9
|
+
--bd-accesibility-focus: var(--color-blue-500);
|
|
10
|
+
|
|
9
11
|
--text-color-white: var(--color-neutral-0);
|
|
10
12
|
font-size: 100%;
|
|
11
13
|
display: block;
|
|
@@ -16,7 +18,12 @@ export default css`
|
|
|
16
18
|
margin-top: 1em;
|
|
17
19
|
margin-bottom: 1em;
|
|
18
20
|
}
|
|
19
|
-
|
|
21
|
+
.bd-tab-button:focus-visible,
|
|
22
|
+
.bd-find-out-more:focus-visible {
|
|
23
|
+
outline: var(--size-2) solid var(--bd-accesibility-focus);
|
|
24
|
+
outline-offset: var(--size-2);
|
|
25
|
+
border-radius: var(--space-2xs);
|
|
26
|
+
}
|
|
20
27
|
.bd-tabs-component .bd-left img {
|
|
21
28
|
max-width: 90%;
|
|
22
29
|
}
|
|
@@ -53,7 +60,6 @@ export default css`
|
|
|
53
60
|
}
|
|
54
61
|
|
|
55
62
|
.bd-tabs-container button {
|
|
56
|
-
background-color: white;
|
|
57
63
|
color: #006eff;
|
|
58
64
|
border: 0;
|
|
59
65
|
padding: 9px;
|
|
@@ -94,7 +100,7 @@ export default css`
|
|
|
94
100
|
border: none;
|
|
95
101
|
padding: 10px;
|
|
96
102
|
cursor: pointer;
|
|
97
|
-
|
|
103
|
+
<!-- font-weight: bold; -->
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
.bd-tab-button img {
|
|
@@ -184,7 +190,7 @@ export default css`
|
|
|
184
190
|
}
|
|
185
191
|
|
|
186
192
|
.bd-tabs-component .bd-left img {
|
|
187
|
-
max-width:
|
|
193
|
+
max-width: 50%;
|
|
188
194
|
}
|
|
189
195
|
|
|
190
196
|
.bd-tabs-component .bd-right {
|
|
@@ -206,6 +212,17 @@ export default css`
|
|
|
206
212
|
padding: 20px;
|
|
207
213
|
}
|
|
208
214
|
|
|
215
|
+
.bd-section-title {
|
|
216
|
+
text-align: center;
|
|
217
|
+
font-size: 1.6em;
|
|
218
|
+
margin-bottom: 30px;
|
|
219
|
+
padding: 10px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.bd-right h3 {
|
|
223
|
+
text-align: center;
|
|
224
|
+
}
|
|
225
|
+
|
|
209
226
|
.bd-tabs-component {
|
|
210
227
|
margin-top: 24px;
|
|
211
228
|
}
|
|
@@ -218,18 +235,19 @@ export default css`
|
|
|
218
235
|
}
|
|
219
236
|
|
|
220
237
|
.bd-tabs-container button {
|
|
221
|
-
font-size:
|
|
238
|
+
font-size: 1.2em;
|
|
222
239
|
padding: 6px;
|
|
223
240
|
}
|
|
224
241
|
|
|
225
242
|
.bd-tabs-component .bd-left img {
|
|
226
|
-
max-width:
|
|
243
|
+
max-width: 100%;
|
|
227
244
|
height: auto;
|
|
228
245
|
}
|
|
229
246
|
|
|
230
247
|
.bd-tabs-component .bd-right {
|
|
231
248
|
text-align: center;
|
|
232
249
|
padding: 10px;
|
|
250
|
+
text-align: left;
|
|
233
251
|
}
|
|
234
252
|
|
|
235
253
|
.bd-find-out-more {
|
|
@@ -23,23 +23,23 @@ class TabsComponent extends LitElement {
|
|
|
23
23
|
const tabs = [
|
|
24
24
|
{
|
|
25
25
|
title: "Privacy Protection",
|
|
26
|
-
imageBase: "
|
|
27
|
-
icon: "
|
|
26
|
+
imageBase: "images/tabs-img1.png",
|
|
27
|
+
icon: "icons/pic1.png",
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
title: "Identity Protection",
|
|
31
|
-
imageBase: "
|
|
32
|
-
icon: "
|
|
31
|
+
imageBase: "images/tabs-img2.png",
|
|
32
|
+
icon: "icons/pic2.png",
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
title: "Device Protection",
|
|
36
|
-
imageBase: "
|
|
37
|
-
icon: "
|
|
36
|
+
imageBase: "images/tabs-img3.png",
|
|
37
|
+
icon: "icons/pic3.png",
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
title: "Financial Insurance",
|
|
41
|
-
imageBase: "
|
|
42
|
-
icon: "
|
|
41
|
+
imageBase: "images/tabs-img3.png",
|
|
42
|
+
icon: "icons/pic3.png",
|
|
43
43
|
},
|
|
44
44
|
];
|
|
45
45
|
|
|
@@ -113,12 +113,16 @@ class TabsComponent extends LitElement {
|
|
|
113
113
|
${tabs.map(
|
|
114
114
|
(tab, index) => html`
|
|
115
115
|
<button
|
|
116
|
+
role="tab"
|
|
117
|
+
aria-selected="${this.selectedTab === index ? 'true' : 'false'}"
|
|
116
118
|
class=${this.selectedTab === index
|
|
117
119
|
? "bd-selected bd-tab-button"
|
|
118
120
|
: "bd-tab-button"}
|
|
119
121
|
@click=${() => this.selectTab(index)}
|
|
122
|
+
aria-controls="tab-content-${index}"
|
|
123
|
+
id="tab-${index}"
|
|
120
124
|
>
|
|
121
|
-
<img src="${tab.icon}" />
|
|
125
|
+
<img src="${tab.icon}" alt="${tab.title} Icon" />
|
|
122
126
|
<p><strong>${tab.title}</strong></p>
|
|
123
127
|
</button>
|
|
124
128
|
`
|
|
@@ -142,17 +146,20 @@ class TabsComponent extends LitElement {
|
|
|
142
146
|
)}
|
|
143
147
|
<img
|
|
144
148
|
loading="lazy"
|
|
145
|
-
alt="${selectedTabData.title}"
|
|
149
|
+
alt="${selectedTabData.title} Image"
|
|
146
150
|
src="${selectedTabData.imageBase}?width=750&format=png&optimize=medium"
|
|
147
151
|
/>
|
|
148
152
|
</picture>
|
|
149
153
|
</div>
|
|
150
154
|
<div class="bd-right">
|
|
151
|
-
<h3>${content[this.selectedTab].heading}</h3>
|
|
152
|
-
|
|
155
|
+
<h3 id="tab-content-heading-${this.selectedTab}">${content[this.selectedTab].heading}</h3>
|
|
156
|
+
<div id="tab-content-${this.selectedTab}" aria-labelledby="tab-content-heading-${this.selectedTab}">
|
|
157
|
+
${content[this.selectedTab].description()}
|
|
158
|
+
</div>
|
|
153
159
|
<a
|
|
154
160
|
href="${content[this.selectedTab].href}"
|
|
155
161
|
class="bd-find-out-more"
|
|
162
|
+
aria-label="Find out more about ${content[this.selectedTab].heading}"
|
|
156
163
|
>
|
|
157
164
|
Find out more
|
|
158
165
|
<span class="bd-arrow">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from "lit";
|
|
1
|
+
import { css } from "../lit";
|
|
2
2
|
|
|
3
3
|
export default css`
|
|
4
4
|
:host {
|
|
@@ -10,8 +10,14 @@ export default css`
|
|
|
10
10
|
-webkit-font-smoothing: antialiased;
|
|
11
11
|
-moz-osx-font-smoothing: grayscale;
|
|
12
12
|
display: block;
|
|
13
|
+
--bd-accesibility-focus: var(--color-blue-500);
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
.bd-terms-text-a:focus-visible{
|
|
17
|
+
outline: var(--size-2) solid var(--bd-accesibility-focus);
|
|
18
|
+
outline-offset: var(--size-2);
|
|
19
|
+
border-radius: var(--space-2xs);
|
|
20
|
+
}
|
|
15
21
|
.bd-terms-container {
|
|
16
22
|
background: #f2f2f2;
|
|
17
23
|
padding: var(--size-44) 0;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Design Tokens/Fonts',
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const FontFace = () => html`
|
|
8
|
+
<style>
|
|
9
|
+
section {
|
|
10
|
+
margin-bottom: 24px;
|
|
11
|
+
}
|
|
12
|
+
h3 {
|
|
13
|
+
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
font-size: 1.2rem;
|
|
16
|
+
margin-bottom: 12px;
|
|
17
|
+
}
|
|
18
|
+
.sample {
|
|
19
|
+
margin-bottom: 12px;
|
|
20
|
+
font-size: 1.1rem;
|
|
21
|
+
}
|
|
22
|
+
.sans-normal {
|
|
23
|
+
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
font-style: normal;
|
|
26
|
+
}
|
|
27
|
+
.sans-semibold {
|
|
28
|
+
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
font-style: normal;
|
|
31
|
+
}
|
|
32
|
+
.sans-bold {
|
|
33
|
+
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
34
|
+
font-weight: 700;
|
|
35
|
+
font-style: normal;
|
|
36
|
+
}
|
|
37
|
+
.sans-italic {
|
|
38
|
+
font-family: var(--font-family-sans, 'IBM Plex Sans', Arial, sans-serif);
|
|
39
|
+
font-weight: 400;
|
|
40
|
+
font-style: italic;
|
|
41
|
+
}
|
|
42
|
+
.mono-regular {
|
|
43
|
+
font-family: var(--font-family-mono, 'IBM Plex Mono', monospace);
|
|
44
|
+
font-weight: 400;
|
|
45
|
+
font-style: normal;
|
|
46
|
+
}
|
|
47
|
+
.mono-bold {
|
|
48
|
+
font-family: var(--font-family-mono, 'IBM Plex Mono', monospace);
|
|
49
|
+
font-weight: 700;
|
|
50
|
+
font-style: normal;
|
|
51
|
+
}
|
|
52
|
+
.mono-italic {
|
|
53
|
+
font-family: var(--font-family-mono, 'IBM Plex Mono', monospace);
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
font-style: italic;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
58
|
+
|
|
59
|
+
<section>
|
|
60
|
+
<h3>IBM Plex Sans - Weights & Styles</h3>
|
|
61
|
+
<div class="sample sans-normal">Regular 400 - The quick brown fox jumps over the lazy dog.</div>
|
|
62
|
+
<div class="sample sans-semibold">SemiBold 600 - The quick brown fox jumps over the lazy dog.</div>
|
|
63
|
+
<div class="sample sans-bold">Bold 700 - The quick brown fox jumps over the lazy dog.</div>
|
|
64
|
+
<div class="sample sans-italic">Italic 400 - The quick brown fox jumps over the lazy dog.</div>
|
|
65
|
+
</section>
|
|
66
|
+
|
|
67
|
+
<section>
|
|
68
|
+
<h3>IBM Plex Mono - Weights & Styles</h3>
|
|
69
|
+
<div class="sample mono-regular">Regular 400 - The quick brown fox jumps over the lazy dog.</div>
|
|
70
|
+
<div class="sample mono-bold">Bold 700 - The quick brown fox jumps over the lazy dog.</div>
|
|
71
|
+
<div class="sample mono-italic">Italic 400 - The quick brown fox jumps over the lazy dog.</div>
|
|
72
|
+
</section>
|
|
73
|
+
`;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Design Tokens/Spacing',
|
|
5
|
+
args: {
|
|
6
|
+
spaceNone: 'var(--space-none, 0)',
|
|
7
|
+
space4xs: 'var(--space-4xs, 0.125rem)',
|
|
8
|
+
space3xs: 'var(--space-3xs, 0.25rem)',
|
|
9
|
+
space2xs: 'var(--space-2xs, 0.5rem)',
|
|
10
|
+
spaceXs: 'var(--space-xs, 0.75rem)',
|
|
11
|
+
spaceSm: 'var(--space-sm, 1rem)',
|
|
12
|
+
spaceMd: 'var(--space-md, 1.5rem)',
|
|
13
|
+
spaceLg: 'var(--space-lg, 2rem)',
|
|
14
|
+
spaceXl: 'var(--space-xl, 2.5rem)',
|
|
15
|
+
space2xl: 'var(--space-2xl, 3rem)',
|
|
16
|
+
space3xl: 'var(--space-3xl, 4rem)',
|
|
17
|
+
space4xl: 'var(--space-4xl, 6rem)',
|
|
18
|
+
space5xl: 'var(--space-5xl, 8rem)',
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
spaceNone: { control: 'text', name: '--space-none' },
|
|
22
|
+
space4xs: { control: 'text', name: '--space-4xs' },
|
|
23
|
+
space3xs: { control: 'text', name: '--space-3xs' },
|
|
24
|
+
space2xs: { control: 'text', name: '--space-2xs' },
|
|
25
|
+
spaceXs: { control: 'text', name: '--space-xs' },
|
|
26
|
+
spaceSm: { control: 'text', name: '--space-sm' },
|
|
27
|
+
spaceMd: { control: 'text', name: '--space-md' },
|
|
28
|
+
spaceLg: { control: 'text', name: '--space-lg' },
|
|
29
|
+
spaceXl: { control: 'text', name: '--space-xl' },
|
|
30
|
+
space2xl: { control: 'text', name: '--space-2xl' },
|
|
31
|
+
space3xl: { control: 'text', name: '--space-3xl' },
|
|
32
|
+
space4xl: { control: 'text', name: '--space-4xl' },
|
|
33
|
+
space5xl: { control: 'text', name: '--space-5xl' },
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const AllSpacings = (args) => html`
|
|
38
|
+
<style>
|
|
39
|
+
.spacing-box {
|
|
40
|
+
background-color: var(--color-neutral-200, #eee);
|
|
41
|
+
margin-bottom: 16px;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
font-family: var(--font-family-sans, sans-serif);
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
border: 1px dashed #ccc;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
48
|
+
|
|
49
|
+
<section>
|
|
50
|
+
${Object.entries(args).map(([key, value]) => html`
|
|
51
|
+
<div class="spacing-box" style="padding: ${value}">
|
|
52
|
+
Token <strong>${key.replace('space', '--space-').toLowerCase()}</strong>: ${value}
|
|
53
|
+
</div>
|
|
54
|
+
`)}
|
|
55
|
+
</section>
|
|
56
|
+
`;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Design Tokens/Grid',
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: 'fullscreen',
|
|
7
|
+
},
|
|
8
|
+
argTypes: {
|
|
9
|
+
backgroundColor: { control: 'color' },
|
|
10
|
+
padding: { control: 'text' },
|
|
11
|
+
gutter: { control: 'text' },
|
|
12
|
+
colBg1: { control: 'color' },
|
|
13
|
+
colBg2: { control: 'color' },
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const GridContainer = ({ backgroundColor, padding }) => html`
|
|
18
|
+
<div class="grid-container" style="background: ${backgroundColor}; padding: ${padding};">
|
|
19
|
+
<p style="margin: 0;">.grid-container (folosește max-width & padding din tokens)</p>
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
GridContainer.args = {
|
|
23
|
+
backgroundColor: '#f4f4f4',
|
|
24
|
+
padding: '1rem',
|
|
25
|
+
};
|
|
26
|
+
GridContainer.storyName = 'Container';
|
|
27
|
+
|
|
28
|
+
export const GridRowCol = ({ colBg1, colBg2, padding }) => html`
|
|
29
|
+
<div class="grid-container" style="margin-top: 2rem;">
|
|
30
|
+
<div class="grid-row" style="background: #ddd;">
|
|
31
|
+
<div class="grid-col" style="background: ${colBg1}; text-align: center; padding: ${padding};">
|
|
32
|
+
.grid-col 1
|
|
33
|
+
</div>
|
|
34
|
+
<div class="grid-col" style="background: ${colBg2}; text-align: center; padding: ${padding};">
|
|
35
|
+
.grid-col 2
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
GridRowCol.args = {
|
|
41
|
+
colBg1: '#bbb',
|
|
42
|
+
colBg2: '#999',
|
|
43
|
+
padding: '1rem',
|
|
44
|
+
};
|
|
45
|
+
GridRowCol.storyName = 'Row + Col (auto)';
|
|
46
|
+
|
|
47
|
+
export const FixedColumns = ({ colBg1, colBg2, padding }) => html`
|
|
48
|
+
<div class="grid-container" style="margin-top: 2rem;">
|
|
49
|
+
<div class="grid-row">
|
|
50
|
+
<div class="col-6" style="background: ${colBg1}; padding: ${padding}; text-align: center;">
|
|
51
|
+
.col-6 (50%)
|
|
52
|
+
</div>
|
|
53
|
+
<div class="col-6" style="background: ${colBg2}; padding: ${padding}; text-align: center;">
|
|
54
|
+
.col-6 (50%)
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
59
|
+
FixedColumns.args = {
|
|
60
|
+
colBg1: '#ccc',
|
|
61
|
+
colBg2: '#aaa',
|
|
62
|
+
padding: '1rem',
|
|
63
|
+
};
|
|
64
|
+
FixedColumns.storyName = 'Coloane fixe (.col-6)';
|
|
65
|
+
|
|
66
|
+
export const GutterExample = ({ gutter, colBg1, colBg2 }) => html`
|
|
67
|
+
<div class="grid-container" style="margin-top: 2rem;">
|
|
68
|
+
<div class="grid-row" style="gap: ${gutter};">
|
|
69
|
+
<div class="grid-col" style="background: ${colBg1}; padding: 1rem; border: 1px dashed red;">
|
|
70
|
+
.grid-col cu gutter (verifică spacing)
|
|
71
|
+
</div>
|
|
72
|
+
<div class="grid-col" style="background: ${colBg2}; padding: 1rem; border: 1px dashed red;">
|
|
73
|
+
.grid-col cu gutter
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
`;
|
|
78
|
+
GutterExample.args = {
|
|
79
|
+
gutter: '1rem',
|
|
80
|
+
colBg1: '#e0e0e0',
|
|
81
|
+
colBg2: '#d0d0d0',
|
|
82
|
+
};
|
|
83
|
+
GutterExample.storyName = 'Spațiere între coloane (gutter)';
|
package/src/tokens/tokens.css
CHANGED
|
@@ -107,6 +107,25 @@
|
|
|
107
107
|
--caption-large: 12px; /* 15.996px = 1rem */
|
|
108
108
|
|
|
109
109
|
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
/* Display Default */
|
|
113
|
+
--display-xlarge-line-height: 1.1; /* For 60px */
|
|
114
|
+
--display-medium-line-height: 1.15; /* For 52px */
|
|
115
|
+
|
|
116
|
+
/* Display Mobile */
|
|
117
|
+
--display-xlarge-mobile-line-height: 1.15; /* For 44px */
|
|
118
|
+
--display-medium-mobile-line-height: 1.2; /* For 38px */
|
|
119
|
+
|
|
120
|
+
/* Heading */
|
|
121
|
+
--heading-xlarge-line-height: 1.2; /* For 36px */
|
|
122
|
+
--heading-small-line-height: 1.3; /* For 24px */
|
|
123
|
+
|
|
124
|
+
/* Body */
|
|
125
|
+
--body-large-line-height: 1.5; /* For 16px */
|
|
126
|
+
|
|
127
|
+
/* Caption */
|
|
128
|
+
--caption-large-line-height: 1.35; /* For 12px */
|
|
110
129
|
/* =====================
|
|
111
130
|
PADDING SIZES
|
|
112
131
|
====================== */
|
|
@@ -124,6 +143,7 @@
|
|
|
124
143
|
--size-16: 16px;
|
|
125
144
|
--size-18: 18px;
|
|
126
145
|
--size-20: 20px;
|
|
146
|
+
--size-22: 22px;
|
|
127
147
|
--size-24: 24px;
|
|
128
148
|
--size-32: 32px;
|
|
129
149
|
--size-36: 36px;
|
|
@@ -133,7 +153,102 @@
|
|
|
133
153
|
--size-64: 64px;
|
|
134
154
|
--size-full: 99999999999999999999;
|
|
135
155
|
|
|
136
|
-
|
|
156
|
+
|
|
157
|
+
/* Spacing Tokens
|
|
158
|
+
-----------------------------------------------*/
|
|
159
|
+
/* Base spacing tokens - Based on 4px grid */
|
|
160
|
+
--space-none: 0;
|
|
161
|
+
--space-4xs: 0.125rem; /* 2px */
|
|
162
|
+
--space-3xs: 0.25rem; /* 4px */
|
|
163
|
+
--space-2xs: 0.5rem; /* 8px */
|
|
164
|
+
--space-xs: 0.75rem; /* 12px */
|
|
165
|
+
--space-sm: 1rem; /* 16px */
|
|
166
|
+
--space-md: 1.5rem; /* 24px */
|
|
167
|
+
--space-lg: 2rem; /* 32px */
|
|
168
|
+
--space-xl: 2.5rem; /* 40px */
|
|
169
|
+
--space-2xl: 3rem; /* 48px */
|
|
170
|
+
--space-3xl: 4rem; /* 64px */
|
|
171
|
+
--space-4xl: 6rem; /* 96px */
|
|
172
|
+
--space-5xl: 8rem; /* 128px */
|
|
173
|
+
|
|
174
|
+
/* Semantic Padding Tokens */
|
|
175
|
+
--padding-button: var(--space-xs) var(--space-md);
|
|
176
|
+
--padding-input: var(--space-xs);
|
|
177
|
+
--padding-card: var(--space-md);
|
|
178
|
+
--padding-card-sm: var(--space-sm);
|
|
179
|
+
--padding-card-lg: var(--space-lg);
|
|
180
|
+
|
|
181
|
+
--padding-section: var(--space-3xl) 0;
|
|
182
|
+
--padding-section-sm: var(--space-2xl) 0;
|
|
183
|
+
--padding-section-lg: var(--space-4xl) 0;
|
|
184
|
+
|
|
185
|
+
/* Container and Layout Tokens */
|
|
186
|
+
--container-padding: var(--space-md);
|
|
187
|
+
--container-padding-sm: var(--space-sm);
|
|
188
|
+
--container-padding-lg: var(--space-lg);
|
|
189
|
+
|
|
190
|
+
/* Inset (Padding All Sides) Tokens */
|
|
191
|
+
--inset-xs: var(--space-xs);
|
|
192
|
+
--inset-sm: var(--space-sm);
|
|
193
|
+
--inset-md: var(--space-md);
|
|
194
|
+
--inset-lg: var(--space-lg);
|
|
195
|
+
|
|
196
|
+
/* Stack (Vertical Spacing) Tokens */
|
|
197
|
+
--stack-xs: var(--space-xs);
|
|
198
|
+
--stack-sm: var(--space-sm);
|
|
199
|
+
--stack-md: var(--space-md);
|
|
200
|
+
--stack-lg: var(--space-lg);
|
|
201
|
+
--stack-xl: var(--space-xl);
|
|
202
|
+
|
|
203
|
+
/* Inline (Horizontal Spacing) Tokens */
|
|
204
|
+
--inline-xs: var(--space-xs);
|
|
205
|
+
--inline-sm: var(--space-sm);
|
|
206
|
+
--inline-md: var(--space-md);
|
|
207
|
+
--inline-lg: var(--space-lg);
|
|
208
|
+
|
|
209
|
+
/* Accessibility Spacing Tokens
|
|
210
|
+
-----------------------------------------------*/
|
|
211
|
+
/* Touch Target Sizes - WCAG 2.1 Success Criterion 2.5.5 (AAA) and 2.5.8 (AA) */
|
|
212
|
+
--touch-target-size: 44px; /* Minimum touch target size (44px × 44px) */
|
|
213
|
+
--touch-target-spacing: 8px; /* Minimum space between touch targets */
|
|
214
|
+
|
|
215
|
+
/* Readable Line Lengths - For optimal readability */
|
|
216
|
+
--content-width-readable: 70ch; /* Approximately 70 characters per line */
|
|
217
|
+
--content-width-max: 1200px; /* Maximum overall content width */
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
/** GRID TOKENS
|
|
221
|
+
*/
|
|
222
|
+
/* Grid container max widths */
|
|
223
|
+
--grid-container-max-xs: 100%; /* mobile full width */
|
|
224
|
+
--grid-container-max-sm: 540px;
|
|
225
|
+
--grid-container-max-md: 720px;
|
|
226
|
+
--grid-container-max-lg: 960px;
|
|
227
|
+
--grid-container-max-xl: 1140px;
|
|
228
|
+
--grid-container-max-xxl: 1320px;
|
|
229
|
+
|
|
230
|
+
/* Column count (usually 12) */
|
|
231
|
+
--grid-columns: 12;
|
|
232
|
+
|
|
233
|
+
/* Gutter spacing between columns */
|
|
234
|
+
--grid-gutter-xs: 16px;
|
|
235
|
+
--grid-gutter-sm: 24px;
|
|
236
|
+
--grid-gutter-md: 32px;
|
|
237
|
+
--grid-gutter-lg: 40px;
|
|
238
|
+
|
|
239
|
+
/* Container padding (horizontal spacing) */
|
|
240
|
+
--grid-padding-xs: 16px;
|
|
241
|
+
--grid-padding-sm: 24px;
|
|
242
|
+
--grid-padding-md: 32px;
|
|
243
|
+
--grid-padding-lg: 40px;
|
|
244
|
+
|
|
245
|
+
/* Breakpoints */
|
|
246
|
+
--breakpoint-xs: 0px;
|
|
247
|
+
--breakpoint-sm: 576px;
|
|
248
|
+
--breakpoint-md: 768px;
|
|
249
|
+
--breakpoint-lg: 992px;
|
|
250
|
+
--breakpoint-xl: 1200px;
|
|
251
|
+
--breakpoint-xxl: 1400px;
|
|
137
252
|
/* =====================
|
|
138
253
|
FONT-FACE DEFINITIONS
|
|
139
254
|
====================== */
|