@repobit/dex-system-design 0.4.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +4 -3
  3. package/src/assets/images/bd-header-img.jpg +0 -0
  4. package/src/assets/images/bd-header-us.jpg +0 -0
  5. package/src/components/Button/Button.js +115 -3
  6. package/src/components/Button/button.css.js +48 -10
  7. package/src/components/Button/button.stories.js +83 -7
  8. package/src/components/FAQ/faq.css.js +27 -16
  9. package/src/components/FAQ/faq.js +23 -114
  10. package/src/components/FAQ/faq.stories.js +41 -20
  11. package/src/components/Input/Input.js +2 -2
  12. package/src/components/Input/input.css.js +1 -1
  13. package/src/components/anchor/anchor-nav.css.js +92 -0
  14. package/src/components/anchor/anchor-nav.js +121 -0
  15. package/src/components/anchor/anchor.stories.js +134 -0
  16. package/src/components/badge/badge.css.js +27 -0
  17. package/src/components/badge/badge.js +30 -0
  18. package/src/components/badge/badge.stories.js +36 -0
  19. package/src/components/carousel/carousel.css.js +36 -19
  20. package/src/components/carousel/carousel.js +149 -99
  21. package/src/components/carousel/carousel.stories.js +202 -46
  22. package/src/components/checkbox/checkbox.css.js +132 -0
  23. package/src/components/checkbox/checkbox.js +130 -0
  24. package/src/components/checkbox/checkbox.stories.js +63 -0
  25. package/src/components/divider/divider-horizontal.js +29 -0
  26. package/src/components/divider/divider-vertical.js +32 -0
  27. package/src/components/divider/divider.css.js +0 -0
  28. package/src/components/divider/divider.stories.js +77 -0
  29. package/src/components/header/header.css.js +248 -0
  30. package/src/components/header/header.js +87 -0
  31. package/src/components/header/header.stories.js +57 -0
  32. package/src/components/highlight/highlight-s.css.js +88 -0
  33. package/src/components/highlight/highlight-s.js +35 -0
  34. package/src/components/highlight/highlight-s.stories.js +22 -0
  35. package/src/components/highlight/highlight.css.js +119 -0
  36. package/src/components/highlight/highlight.js +60 -0
  37. package/src/components/highlight/highlight.stories.js +53 -0
  38. package/src/components/light-carousel/light-carousel.css.js +18 -10
  39. package/src/components/light-carousel/light-carousel.js +29 -16
  40. package/src/components/light-carousel/light-carousel.stories.js +9 -7
  41. package/src/components/paragraph/paragraph.css.js +1 -1
  42. package/src/components/pricing-cards/pricing-card.css.js +138 -3
  43. package/src/components/pricing-cards/pricing-card.js +63 -82
  44. package/src/components/pricing-cards/pricing-card.stories.js +1 -0
  45. package/src/components/radio/radio.css.js +168 -0
  46. package/src/components/radio/radio.js +222 -0
  47. package/src/components/radio/radio.stories.js +103 -0
  48. package/src/components/tabs/tabs.css.js +26 -8
  49. package/src/components/tabs/tabs.js +19 -12
  50. package/src/components/termsOfUse/terms.css.js +7 -1
  51. package/src/tokens/fonts.stories.js +73 -0
  52. package/src/tokens/spacing.stories.js +56 -0
  53. package/src/tokens/tokens-grid.stories.js +83 -0
  54. package/src/tokens/tokens.css +116 -1
  55. package/src/tokens/tokens.stories.js +67 -0
  56. package/src/tokens/typography.stories.js +69 -0
  57. /package/src/assets/{icons → images}/tabs-img1.png +0 -0
  58. /package/src/assets/{icons → images}/tabs-img2.png +0 -0
  59. /package/src/assets/{icons → images}/tabs-img3.png +0 -0
@@ -1,73 +1,229 @@
1
- import { html } from 'lit';
2
- import './carousel.js';
1
+ import { html } from "lit";
2
+ import "./carousel.js";
3
3
 
4
4
  export default {
5
- title: 'Components/Carousel Section',
6
- component: 'bd-carousel-section',
7
- tags: ['autodocs'],
5
+ title: "Components/Carousel Section",
6
+ component: "bd-carousel-section",
7
+ tags: ["autodocs"],
8
+ argTypes: {
9
+ title: { control: "text" },
10
+
11
+ // Item 1
12
+ item1Title: { control: "text", name: "Item 1 Title" },
13
+ item1SubTitle: { control: "text", name: "Item 1 SubTitle" },
14
+ item1ModalText: { control: "text", name: "Item 1 Modal Text" },
15
+ item1Icon: { control: "text", name: "Item 1 Icon" },
16
+ item1Content: { control: "text", name: "Item 1 Content (use \\n\\n for paragraphs)" },
17
+
18
+ // Item 2
19
+ item2Title: { control: "text", name: "Item 2 Title" },
20
+ item2SubTitle: { control: "text", name: "Item 2 SubTitle" },
21
+ item2ModalText: { control: "text", name: "Item 2 Modal Text" },
22
+ item2Icon: { control: "text", name: "Item 2 Icon" },
23
+ item2Content: { control: "text", name: "Item 2 Content (use \\n\\n for paragraphs)" },
24
+
25
+ // Item 3
26
+ item3Title: { control: "text", name: "Item 3 Title" },
27
+ item3SubTitle: { control: "text", name: "Item 3 SubTitle" },
28
+ item3ModalText: { control: "text", name: "Item 3 Modal Text" },
29
+ item3Icon: { control: "text", name: "Item 3 Icon" },
30
+ item3Content: { control: "text", name: "Item 3 Content (use \\n\\n for paragraphs)" },
31
+
32
+ // Item 4
33
+ item4Title: { control: "text", name: "Item 4 Title" },
34
+ item4SubTitle: { control: "text", name: "Item 4 SubTitle" },
35
+ item4ModalText: { control: "text", name: "Item 4 Modal Text" },
36
+ item4Icon: { control: "text", name: "Item 4 Icon" },
37
+ item4Content: { control: "text", name: "Item 4 Content (use \\n\\n for paragraphs)" },
38
+
39
+ // Item 5
40
+ item5Title: { control: "text", name: "Item 5 Title" },
41
+ item5SubTitle: { control: "text", name: "Item 5 SubTitle" },
42
+ item5ModalText: { control: "text", name: "Item 5 Modal Text" },
43
+ item5Icon: { control: "text", name: "Item 5 Icon" },
44
+ item5Content: { control: "text", name: "Item 5 Content (use \\n\\n for paragraphs)" },
45
+
46
+ // Item 6
47
+ item6Title: { control: "text", name: "Item 6 Title" },
48
+ item6SubTitle: { control: "text", name: "Item 6 SubTitle" },
49
+ item6ModalText: { control: "text", name: "Item 6 Modal Text" },
50
+ item6Icon: { control: "text", name: "Item 6 Icon" },
51
+ item6Content: { control: "text", name: "Item 6 Content (use \\n\\n for paragraphs)" },
52
+
53
+ // Item 7
54
+ item7Title: { control: "text", name: "Item 7 Title" },
55
+ item7SubTitle: { control: "text", name: "Item 7 SubTitle" },
56
+ item7ModalText: { control: "text", name: "Item 7 Modal Text" },
57
+ item7Icon: { control: "text", name: "Item 7 Icon" },
58
+ item7Content: { control: "text", name: "Item 7 Content (use \\n\\n for paragraphs)" },
59
+
60
+ // Item 8
61
+ item8Title: { control: "text", name: "Item 8 Title" },
62
+ item8SubTitle: { control: "text", name: "Item 8 SubTitle" },
63
+ item8ModalText: { control: "text", name: "Item 8 Modal Text" },
64
+ item8Icon: { control: "text", name: "Item 8 Icon" },
65
+ item8Content: { control: "text", name: "Item 8 Content (use \\n\\n for paragraphs)" },
66
+ },
8
67
  };
9
68
 
69
+ const renderParagraphs = (text) =>
70
+ text
71
+ ? text.split("\n\n").map(
72
+ (paragraph) => html`<p>${paragraph}</p>`
73
+ )
74
+ : null;
75
+
10
76
  const Template = (args) => html`
11
- <bd-carousel-section title=${args.title}>
77
+ <bd-carousel-section title="${args.title}">
12
78
  <bd-carousel-item
13
- title="Scam Copilot Bot"
14
- subTitle="Specialized AI chatbot that helps you identify suspicious online interactions so you don’t become a victim"
15
- modalText="Specialized AI chatbot that helps you identify suspicious online interactions so you don’t become a victim"
16
- icon="src/assets/icons/light-carousel-img1.png"
17
- ></bd-carousel-item>
79
+ title="${args.item1Title}"
80
+ subTitle="${args.item1SubTitle}"
81
+ modalText="${args.item1ModalText}"
82
+ icon="${args.item1Icon}"
83
+ >
84
+ <h3>${args.item1Title}</h3>
85
+ ${renderParagraphs(args.item1Content)}
86
+ </bd-carousel-item>
18
87
 
19
88
  <bd-carousel-item
20
- title="Scam Wave Alerts"
21
- subTitle="Proactively informs you about scam outbreaks in your region"
22
- modalText="Proactively informs you about scam outbreaks in your region"
23
- icon="src/assets/icons/light-carousel-img1.png"
24
- ></bd-carousel-item>
89
+ title="${args.item2Title}"
90
+ subTitle="${args.item2SubTitle}"
91
+ modalText="${args.item2ModalText}"
92
+ icon="${args.item2Icon}"
93
+ >
94
+ <h3>${args.item2Title}</h3>
95
+ ${renderParagraphs(args.item2Content)}
96
+ </bd-carousel-item>
25
97
 
26
98
  <bd-carousel-item
27
- title="AI-Powered Scam Check"
28
- subTitle="AI-driven tool that instantly evaluates the legitimacy of any link, message, or online interaction"
29
- modalText="AI-driven tool that instantly evaluates the legitimacy of any link, message, or online interaction"
30
- icon="src/assets/icons/light-carousel-img1.png"
31
- ></bd-carousel-item>
99
+ title="${args.item3Title}"
100
+ subTitle="${args.item3SubTitle}"
101
+ modalText="${args.item3ModalText}"
102
+ icon="${args.item3Icon}"
103
+ >
104
+ <h3>${args.item3Title}</h3>
105
+ ${renderParagraphs(args.item3Content)}
106
+ </bd-carousel-item>
32
107
 
33
108
  <bd-carousel-item
34
- title="Educational Resources"
35
- subTitle="Access a wealth of information and best practices to stay informed and vigilant against scams"
36
- modalText="Access a wealth of information and best practices to stay informed and vigilant against scams"
37
- icon="src/assets/icons/light-carousel-img1.png"
38
- ></bd-carousel-item>
109
+ title="${args.item4Title}"
110
+ subTitle="${args.item4SubTitle}"
111
+ modalText="${args.item4ModalText}"
112
+ icon="${args.item4Icon}"
113
+ >
114
+ <h3>${args.item4Title}</h3>
115
+ ${renderParagraphs(args.item4Content)}
116
+ </bd-carousel-item>
39
117
 
40
118
  <bd-carousel-item
41
- title="Phishing Simulator"
42
- subTitle="Simulates phishing attacks to help you recognize and respond appropriately to real threats"
43
- modalText="Simulates phishing attacks to help you recognize and respond appropriately to real threats"
44
- icon="src/assets/icons/light-carousel-img1.png"
45
- ></bd-carousel-item>
119
+ title="${args.item5Title}"
120
+ subTitle="${args.item5SubTitle}"
121
+ modalText="${args.item5ModalText}"
122
+ icon="${args.item5Icon}"
123
+ >
124
+ <h3>${args.item5Title}</h3>
125
+ ${renderParagraphs(args.item5Content)}
126
+ </bd-carousel-item>
46
127
 
47
128
  <bd-carousel-item
48
- title="Real-Time Scam Updates"
49
- subTitle="Stay ahead with up-to-the-minute alerts on the latest scams targeting your region or industry"
50
- modalText="Stay ahead with up-to-the-minute alerts on the latest scams targeting your region or industry"
51
- icon="src/assets/icons/light-carousel-img1.png"
52
- ></bd-carousel-item>
129
+ title="${args.item6Title}"
130
+ subTitle="${args.item6SubTitle}"
131
+ modalText="${args.item6ModalText}"
132
+ icon="${args.item6Icon}"
133
+ >
134
+ <h3>${args.item6Title}</h3>
135
+ ${renderParagraphs(args.item6Content)}
136
+ </bd-carousel-item>
53
137
 
54
138
  <bd-carousel-item
55
- title="Community Reporting Hub"
56
- subTitle="A platform where users can report scams and share experiences to help protect others"
57
- modalText="A platform where users can report scams and share experiences to help protect others"
58
- icon="src/assets/icons/light-carousel-img1.png"
59
- ></bd-carousel-item>
139
+ title="${args.item7Title}"
140
+ subTitle="${args.item7SubTitle}"
141
+ modalText="${args.item7ModalText}"
142
+ icon="${args.item7Icon}"
143
+ >
144
+ <h3>${args.item7Title}</h3>
145
+ ${renderParagraphs(args.item7Content)}
146
+ </bd-carousel-item>
60
147
 
61
148
  <bd-carousel-item
62
- title="Fraud Prevention Workshops"
63
- subTitle="Interactive workshops that educate users on identifying and avoiding scams"
64
- modalText="Interactive workshops that educate users on identifying and avoiding scams"
65
- icon="src/assets/icons/light-carousel-img1.png"
66
- ></bd-carousel-item>
149
+ title="${args.item8Title}"
150
+ subTitle="${args.item8SubTitle}"
151
+ modalText="${args.item8ModalText}"
152
+ icon="${args.item8Icon}"
153
+ >
154
+ <h3>${args.item8Title}</h3>
155
+ ${renderParagraphs(args.item8Content)}
156
+ </bd-carousel-item>
67
157
  </bd-carousel-section>
68
158
  `;
69
159
 
70
160
  export const Default = Template.bind({});
71
161
  Default.args = {
72
162
  title: "Need help? We've got answers!",
163
+
164
+ item1Title: "Scam Copilot Bot",
165
+ item1SubTitle:
166
+ "Specialized AI chatbot that helps you identify suspicious online interactions so you don’t become a victim",
167
+ item1ModalText:
168
+ "Specialized AI chatbot that helps you identify suspicious online interactions so you don’t become a victim",
169
+ item1Icon: "icons/light-carousel-img1.png",
170
+ item1Content: `Specialized AI chatbot that helps you identify suspicious online interactions so you don’t become a victim.\n\nSpecialized AI chatbot that helps you identify suspicious online interactions so you don’t become a victim.\n\nTest Scam Copilot Bot`,
171
+
172
+ item2Title: "Scam Wave Alerts",
173
+ item2SubTitle: "Proactively informs you about scam outbreaks in your region",
174
+ item2ModalText: "Proactively informs you about scam outbreaks in your region",
175
+ item2Icon: "icons/light-carousel-img1.png",
176
+ item2Content: "Proactively informs you about scam outbreaks in your region.",
177
+
178
+ item3Title: "AI-Powered Scam Check",
179
+ item3SubTitle:
180
+ "AI-driven tool that instantly evaluates the legitimacy of any link, message, or online interaction",
181
+ item3ModalText:
182
+ "AI-driven tool that instantly evaluates the legitimacy of any link, message, or online interaction",
183
+ item3Icon: "icons/light-carousel-img1.png",
184
+ item3Content:
185
+ "AI-driven tool that instantly evaluates the legitimacy of any link, message, or online interaction.",
186
+
187
+ item4Title: "Educational Resources",
188
+ item4SubTitle:
189
+ "Access a wealth of information and best practices to stay informed and vigilant against scams",
190
+ item4ModalText:
191
+ "Access a wealth of information and best practices to stay informed and vigilant against scams",
192
+ item4Icon: "icons/light-carousel-img1.png",
193
+ item4Content:
194
+ "Access a wealth of information and best practices to stay informed and vigilant against scams.",
195
+
196
+ item5Title: "Phishing Simulator",
197
+ item5SubTitle:
198
+ "Simulates phishing attacks to help you recognize and respond appropriately to real threats",
199
+ item5ModalText:
200
+ "Simulates phishing attacks to help you recognize and respond appropriately to real threats",
201
+ item5Icon: "icons/light-carousel-img1.png",
202
+ item5Content:
203
+ "Simulates phishing attacks to help you recognize and respond appropriately to real threats.",
204
+
205
+ item6Title: "Real-Time Scam Updates",
206
+ item6SubTitle:
207
+ "Stay ahead with up-to-the-minute alerts on the latest scams targeting your region or industry",
208
+ item6ModalText:
209
+ "Stay ahead with up-to-the-minute alerts on the latest scams targeting your region or industry",
210
+ item6Icon: "icons/light-carousel-img1.png",
211
+ item6Content:
212
+ "Stay ahead with up-to-the-minute alerts on the latest scams targeting your region or industry.",
213
+
214
+ item7Title: "Community Reporting Hub",
215
+ item7SubTitle:
216
+ "A platform where users can report scams and share experiences to help protect others",
217
+ item7ModalText:
218
+ "A platform where users can report scams and share experiences to help protect others",
219
+ item7Icon: "icons/light-carousel-img1.png",
220
+ item7Content:"A platform where users can report scams and share experiences to help protect others.",
221
+ item8Title: "Fraud Prevention Workshops",
222
+ item8SubTitle:
223
+ "Interactive workshops that educate users on identifying and avoiding scams",
224
+ item8ModalText:
225
+ "Interactive workshops that educate users on identifying and avoiding scams",
226
+ item8Icon: "icons/light-carousel-img1.png",
227
+ item8Content:
228
+ "Interactive workshops that educate users on identifying and avoiding scams.",
73
229
  };
@@ -0,0 +1,132 @@
1
+ import { css } from "../lit";
2
+
3
+ export default css`
4
+ :host {
5
+ display: inline-block;
6
+ }
7
+
8
+ .bd-checkbox,
9
+ .bd-radio {
10
+ display: inline-flex;
11
+ align-items: center;
12
+ cursor: pointer;
13
+ gap: var(--size-8);
14
+ font-family: sans-serif;
15
+ font-size: 14px;
16
+ vertical-align: middle;
17
+ }
18
+
19
+ .bd-checkbox.disabled,
20
+ .bd-radio.disabled {
21
+ cursor: not-allowed;
22
+ opacity: 0.6;
23
+ }
24
+
25
+ .checkbox-label,
26
+ .radio-label {
27
+ font-size: 14px;
28
+ color: black;
29
+ }
30
+
31
+ /* Checkbox */
32
+ .bd-checkbox .bd-outer {
33
+ width: var(--size-22);
34
+ height: var(--size-22);
35
+ border: var(--size-2) solid var(--color-blue-500);
36
+ border-radius: 4px;
37
+ display: flex;
38
+ align-items: center;
39
+ justify-content: center;
40
+ box-sizing: border-box;
41
+ transition: border-color 0.2s ease;
42
+ outline: none;
43
+ }
44
+
45
+ .bd-checkbox .bd-inner {
46
+ width: var(--size-12);
47
+ height: var(--size-12);
48
+ background-color: var(--color-blue-500);
49
+ border-radius: var(--size-2);
50
+ transform: scale(0);
51
+ transition: transform 0.2s ease, background-color 0.2s ease;
52
+ }
53
+
54
+ .bd-checkbox .bd-inner.visible {
55
+ transform: scale(1);
56
+ }
57
+
58
+ .bd-radio .bd-outer {
59
+ width: var(--size-22);
60
+ height: var(--size-22);
61
+ border: var(--size-2) solid var(--color-blue-500);
62
+ border-radius: 50%;
63
+ display: flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ box-sizing: border-box;
67
+ transition: border-color 0.2s ease;
68
+ outline: none;
69
+ }
70
+
71
+ .bd-radio .bd-inner {
72
+ width: var(--size-12);
73
+ height: var(--size-12);
74
+ background-color: var(--color-blue-500);
75
+ border-radius: 50%;
76
+ transform: scale(0);
77
+ transition: transform 0.2s ease, background-color 0.2s ease;
78
+ }
79
+
80
+ .bd-radio .bd-inner.visible {
81
+ transform: scale(1);
82
+ }
83
+
84
+ .bd-checkbox .bd-outer:hover,
85
+ .bd-radio .bd-outer:hover {
86
+ border-color: var(--color-blue-700);
87
+ }
88
+
89
+ .bd-checkbox .bd-inner:hover,
90
+ .bd-radio .bd-inner:hover {
91
+ background-color: var(--color-blue-700);
92
+ }
93
+
94
+ .bd-checkbox.disabled .bd-outer.checked,
95
+ .bd-radio.disabled .bd-outer.checked {
96
+ border-color: #b0b0b0;
97
+ }
98
+
99
+ .bd-checkbox.disabled .bd-outer,
100
+ .bd-radio.disabled .bd-outer {
101
+ border-color: #b0b0b0;
102
+ }
103
+
104
+ .bd-checkbox.disabled .bd-inner,
105
+ .bd-radio.disabled .bd-inner {
106
+ background-color: #b0b0b0;
107
+ }
108
+
109
+
110
+ .bd-checkbox .bd-outer:focus {
111
+ outline: none;
112
+ }
113
+
114
+ .bd-checkbox .bd-outer:focus-visible {
115
+ outline: var(--size-2) solid var(--color-blue-500);
116
+ outline-offset: var(--size-2);
117
+ }
118
+ .bd-checkbox .bd-outer.checked:focus-visible {
119
+ border-color: var(--color-blue-700);
120
+ }
121
+
122
+ .bd-checkbox .bd-outer.checked:focus-visible .bd-inner.visible {
123
+ background-color: var(--color-blue-700);
124
+ }
125
+ .bd-checkbox .bd-outer.checked.kbd-activate {
126
+ border-color: var(--color-blue-700);
127
+ }
128
+
129
+ .bd-checkbox .bd-outer.checked.kbd-activate .bd-inner.visible {
130
+ background-color: var(--color-blue-700);
131
+ }
132
+ `;
@@ -0,0 +1,130 @@
1
+ import { LitElement, html } from "lit";
2
+ import checkboxCSS from "./checkbox.css";
3
+
4
+ export class BdCheckbox extends LitElement {
5
+ static styles = [checkboxCSS];
6
+
7
+ static properties = {
8
+ name: { type: String },
9
+ value: { type: String },
10
+ checked: { type: Boolean, reflect: true },
11
+ disabled: { type: Boolean, reflect: true },
12
+ label: { type: String },
13
+ };
14
+
15
+ constructor() {
16
+ super();
17
+ this.name = "";
18
+ this.value = "";
19
+ this.disabled = false;
20
+ this.label = "";
21
+ this._hadKeyboardFocus = false;
22
+
23
+ this._handleDocumentKeydown = (e) => {
24
+ if (e.key === "Tab") {
25
+ this._hadKeyboardFocus = true;
26
+ }
27
+ };
28
+
29
+ this._handleDocumentMousedown = this._handleDocumentMousedown.bind(this);
30
+ }
31
+
32
+ _handleDocumentMousedown(e) {
33
+ const path = e.composedPath();
34
+ const target = path.find(
35
+ (el) =>
36
+ el instanceof HTMLElement &&
37
+ el.classList &&
38
+ el.classList.contains("bd-outer")
39
+ );
40
+ if (target) {
41
+ target.classList.remove("focus");
42
+ }
43
+ setTimeout(() => {
44
+ this._hadKeyboardFocus = false;
45
+ }, 0);
46
+ }
47
+
48
+ connectedCallback() {
49
+ super.connectedCallback();
50
+ document.addEventListener("keydown", this._handleDocumentKeydown);
51
+ document.addEventListener("mousedown", this._handleDocumentMousedown);
52
+ }
53
+
54
+ disconnectedCallback() {
55
+ super.disconnectedCallback();
56
+ document.removeEventListener("keydown", this._handleDocumentKeydown);
57
+ document.removeEventListener("mousedown", this._handleDocumentMousedown);
58
+ }
59
+
60
+ handleClick() {
61
+ if (this.disabled) return;
62
+ this.checked = !this.checked;
63
+
64
+ this.dispatchEvent(
65
+ new CustomEvent("change", {
66
+ detail: { value: this.checked ? this.value : null },
67
+ bubbles: true,
68
+ composed: true,
69
+ })
70
+ );
71
+ }
72
+
73
+ handleFocus(e) {
74
+ if (this._hadKeyboardFocus) {
75
+ e.target.classList.add("focus");
76
+ }
77
+ }
78
+
79
+ handleKeydown(e) {
80
+ if (this.disabled) return;
81
+
82
+ if (e.key === " " || e.key === "Enter") {
83
+ e.preventDefault();
84
+ this.handleClick();
85
+
86
+ const outer = e.target;
87
+
88
+ if (this._hadKeyboardFocus) {
89
+ outer.classList.add("focus", "kbd-activate");
90
+
91
+ setTimeout(() => {
92
+ outer.classList.remove("kbd-activate");
93
+ }, 150);
94
+ }
95
+ }
96
+ }
97
+
98
+
99
+ handleBlur(e) {
100
+ setTimeout(() => {
101
+ const active = this.shadowRoot.activeElement || document.activeElement;
102
+ if (active !== e.target) {
103
+ e.target.classList.remove("focus");
104
+ }
105
+ }, 0);
106
+ }
107
+
108
+ render() {
109
+ return html`
110
+ <label class="bd-checkbox ${this.disabled ? "disabled" : ""}">
111
+ <span
112
+ class="bd-outer ${this.checked && !this.disabled ? "checked" : ""}"
113
+ role="checkbox"
114
+ aria-checked="${this.checked}"
115
+ aria-disabled="${this.disabled}"
116
+ tabindex="${this.disabled ? -1 : 0}"
117
+ @click=${this.handleClick}
118
+ @keydown=${this.handleKeydown}
119
+ @focus=${this.handleFocus}
120
+ @blur=${this.handleBlur}
121
+ >
122
+ <span class="bd-inner ${this.checked ? "visible" : ""}"></span>
123
+ </span>
124
+ <span class="checkbox-label">${this.label}</span>
125
+ </label>
126
+ `;
127
+ }
128
+ }
129
+
130
+ customElements.define("bd-checkbox", BdCheckbox);
@@ -0,0 +1,63 @@
1
+ import { html } from 'lit';
2
+ import './checkbox.js';
3
+
4
+ export default {
5
+ title: 'Atoms/Checkbox',
6
+ component: 'bd-checkbox',
7
+ tags: ['autodocs'], // 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-checkbox
20
+ .name=${name}
21
+ .value=${value}
22
+ .label=${label}
23
+ .checked=${checked}
24
+ .disabled=${disabled}
25
+ ></bd-checkbox>
26
+ `;
27
+
28
+ // Exemple BdCheckbox
29
+ export const Default = Template.bind({});
30
+ Default.args = {
31
+ name: 'group1',
32
+ value: 'default',
33
+ label: 'Checkbox 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: 'Checkbox 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: 'Checkbox 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: 'Checkbox disabled & checked',
61
+ checked: true,
62
+ disabled: true,
63
+ };
@@ -0,0 +1,29 @@
1
+ import { LitElement, html, css } from 'lit';
2
+
3
+ export class BdDividerHorizontal extends LitElement {
4
+ static properties = {
5
+ width: { type: String }, // Noua proprietate
6
+ };
7
+
8
+ static styles = css`
9
+ .hr-line {
10
+ border: none;
11
+ border-top: 1px solid var(--color-neutral-200);
12
+ margin: 0;
13
+ width: 100%; /* valoare implicită */
14
+ }
15
+ `;
16
+
17
+ constructor() {
18
+ super();
19
+ this.width = '100%'; // default
20
+ }
21
+
22
+ render() {
23
+ return html`
24
+ <hr class="hr-line" style="width: ${this.width};" />
25
+ `;
26
+ }
27
+ }
28
+
29
+ customElements.define('bd-divider-horizontal', BdDividerHorizontal);
@@ -0,0 +1,32 @@
1
+ import { LitElement, html, css } from 'lit';
2
+
3
+ export class BdDividerVertical extends LitElement {
4
+ static properties = {
5
+ height: { type: String },
6
+ thickness: { type: String }, // lățimea "vizuală"
7
+ };
8
+
9
+ static styles = css`
10
+ .divider {
11
+ background-color: var(--color-neutral-200);
12
+ display: inline-block;
13
+ }
14
+ `;
15
+
16
+ constructor() {
17
+ super();
18
+ this.height = '100%';
19
+ this.thickness = '1px';
20
+ }
21
+
22
+ render() {
23
+ return html`
24
+ <div
25
+ class="divider"
26
+ style="width: ${this.thickness}; height: ${this.height};"
27
+ ></div>
28
+ `;
29
+ }
30
+ }
31
+
32
+ customElements.define('bd-divider-vertical', BdDividerVertical);
File without changes