@repobit/dex-system-design 0.10.0 → 0.12.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 (107) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/package.json +2 -2
  3. package/src/assets/icons/Identity_protection.png +0 -0
  4. package/src/assets/icons/arrow_down.png +0 -0
  5. package/src/assets/icons/arrow_up.png +0 -0
  6. package/src/assets/icons/device_protection.png +0 -0
  7. package/src/assets/icons/financial_insurance.png +0 -0
  8. package/src/assets/icons/privacy_protection.png +0 -0
  9. package/src/assets/icons/user_guide.png +0 -0
  10. package/src/components/Button/Button.js +19 -16
  11. package/src/components/Button/button.css.js +18 -16
  12. package/src/components/Button/icons.js +8 -8
  13. package/src/components/FAQ/faq.css.js +48 -49
  14. package/src/components/FAQ/faq.js +0 -86
  15. package/src/components/Input/Input.js +68 -6
  16. package/src/components/Input/custom-form.stories.js +88 -0
  17. package/src/components/Input/input-clipboard.css.js +168 -0
  18. package/src/components/Input/input-clipboard.js +137 -0
  19. package/src/components/Input/input.css.js +122 -42
  20. package/src/components/accordion/accordion-bg.css.js +117 -0
  21. package/src/components/accordion/accordion-bg.js +80 -0
  22. package/src/components/accordion/accordion-no-bg.css.js +114 -0
  23. package/src/components/accordion/accordion-no-bg.js +80 -0
  24. package/src/components/accordion/accordion.css.js +88 -0
  25. package/src/components/accordion/accordion.js +81 -0
  26. package/src/components/anchor/anchor-nav.css.js +15 -15
  27. package/src/components/anchor/anchor-nav.js +0 -1
  28. package/src/components/anchor/anchor.stories.js +10 -13
  29. package/src/components/badge/badge.css.js +6 -6
  30. package/src/components/badge/badge.js +1 -2
  31. package/src/components/badge/badge.stories.js +6 -6
  32. package/src/components/carousel/carousel.css.js +60 -60
  33. package/src/components/carousel/carousel.js +26 -30
  34. package/src/components/carousel/carousel.stories.js +55 -55
  35. package/src/components/checkbox/checkbox.css.js +14 -14
  36. package/src/components/divider/divider-horizontal.js +19 -14
  37. package/src/components/divider/divider-vertical.js +23 -14
  38. package/src/components/divider/divider.css.js +19 -0
  39. package/src/components/dropdown/dropdown.css.js +138 -0
  40. package/src/components/dropdown/dropdown.js +111 -0
  41. package/src/components/footer/footer-links-group.css.js +42 -0
  42. package/src/components/footer/footer-links-group.js +25 -0
  43. package/src/components/footer/footer-lp.css.js +625 -0
  44. package/src/components/footer/footer-lp.js +368 -0
  45. package/src/components/footer/footer-lp.stories.js +69 -0
  46. package/src/components/footer/footer-nav-menu.css.js +24 -0
  47. package/src/components/footer/footer-nav-menu.js +36 -0
  48. package/src/components/footer/footer.css.js +625 -0
  49. package/src/components/footer/footer.js +465 -0
  50. package/src/components/footer/footer.stories.js +60 -0
  51. package/src/components/footer/localeMap.js +1 -0
  52. package/src/components/grid/grid.css.js +38 -0
  53. package/src/components/grid/grid.js +55 -0
  54. package/src/components/header/header.css.js +81 -52
  55. package/src/components/header/header.js +19 -19
  56. package/src/components/highlight/highlight.css.js +32 -22
  57. package/src/components/highlight/highlight.js +15 -4
  58. package/src/components/highlight/highlight.stories.js +4 -4
  59. package/src/components/light-carousel/light-carousel-simple.css.js +183 -0
  60. package/src/components/light-carousel/light-carousel-simple.js +73 -0
  61. package/src/components/light-carousel/light-carousel.css.js +50 -31
  62. package/src/components/light-carousel/light-carousel.js +14 -57
  63. package/src/components/light-carousel/light-carousel.stories.js +51 -10
  64. package/src/components/link/link.css.js +41 -0
  65. package/src/components/link/link.js +54 -0
  66. package/src/components/modal/modal.css.js +75 -0
  67. package/src/components/modal/modal.js +41 -0
  68. package/src/components/modal/modal.stories.js +40 -0
  69. package/src/components/paragraph/paragraph.css.js +1 -3
  70. package/src/components/pricing-cards/new-pricing-card.js +30 -0
  71. package/src/components/pricing-cards/new-pricing.css.js +58 -0
  72. package/src/components/pricing-cards/pricing-card-actions.css.js +16 -0
  73. package/src/components/pricing-cards/pricing-card-actions.js +20 -0
  74. package/src/components/pricing-cards/pricing-card-container.css.js +41 -0
  75. package/src/components/pricing-cards/pricing-card-container.js +31 -0
  76. package/src/components/pricing-cards/pricing-card-header.css.js +70 -0
  77. package/src/components/pricing-cards/pricing-card-header.js +46 -0
  78. package/src/components/pricing-cards/pricing-card-pricing.css.js +63 -0
  79. package/src/components/pricing-cards/pricing-card-pricing.js +101 -0
  80. package/src/components/pricing-cards/pricing-card-show-more.css.js +22 -0
  81. package/src/components/pricing-cards/pricing-card-show-more.js +33 -0
  82. package/src/components/pricing-cards/pricing-card.css.js +91 -89
  83. package/src/components/pricing-cards/pricing-card.js +13 -16
  84. package/src/components/pricing-cards/pricing-feature-item.css.js +18 -0
  85. package/src/components/pricing-cards/pricing-feature-item.js +14 -0
  86. package/src/components/radio/radio.css.js +18 -18
  87. package/src/components/radio/radio.js +1 -0
  88. package/src/components/tabs/tabs.css.js +21 -11
  89. package/src/components/tabs/tabs.js +24 -18
  90. package/src/components/termsOfUse/terms.css.js +6 -6
  91. package/src/components/termsOfUse/terms.js +0 -1
  92. package/src/stories/demo.stories.js +271 -0
  93. package/src/tokens/colors.js +10 -10
  94. package/src/tokens/fonts.css +166 -0
  95. package/src/tokens/fonts.stories.js +5 -5
  96. package/src/tokens/layout.css +4 -3
  97. package/src/tokens/new-tokens.css +698 -0
  98. package/src/tokens/spacing.stories.js +1 -1
  99. package/src/tokens/tokens.css +1063 -0
  100. package/src/tokens/tokens.js +0 -133
  101. package/src/tokens/tokens.stories.js +3 -3
  102. package/src/tokens/typography.css.js +0 -4
  103. package/src/tokens/typography.stories.js +2 -2
  104. package/src/components/Input/index.js +0 -0
  105. package/src/components/highlight/highlight-s.css.js +0 -88
  106. package/src/components/highlight/highlight-s.js +0 -35
  107. package/src/components/highlight/highlight-s.stories.js +0 -22
package/CHANGELOG.md CHANGED
@@ -3,6 +3,40 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.12.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.11.0...@repobit/dex-system-design@0.12.0) (2025-09-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * **DEX-999:** custom forms and modal storybook file ([7d113e0](https://github.com/bitdefender/dex-core/commit/7d113e0f07c19535a49825cbaf2dcdf95d6e1fd1))
12
+ * **DEX-999:** input with clipboard ([7ee096a](https://github.com/bitdefender/dex-core/commit/7ee096a6eb2e831cbfd0374510bb7b56e7167bfa))
13
+ * **DEX-999:** move photos to public folder and update footer component ([84db2fa](https://github.com/bitdefender/dex-core/commit/84db2faefd33bfd1a37a228124380cbef73acdaa))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **DEX-999:** feedback din PR review ([b44f4c0](https://github.com/bitdefender/dex-core/commit/b44f4c0704ffb579bf9309ef2957d14b50e74eab))
19
+ * **DEX-999:** modified package json and package-lock ([9dc9a3c](https://github.com/bitdefender/dex-core/commit/9dc9a3c1e031e9d69f8b7256cce8afca5153a41c))
20
+ * **DEX-999:** review updates ([a4fee53](https://github.com/bitdefender/dex-core/commit/a4fee533d667d711002cc763e8ea1f696fd6f898))
21
+
22
+
23
+
24
+ ## [0.11.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.10.0...@repobit/dex-system-design@0.11.0) (2025-07-23)
25
+
26
+
27
+ ### Features
28
+
29
+ * **DEX-23636:** add font-face definitions for IBM Plex Mono and Sans to tokens ([55e9d08](https://github.com/bitdefender/dex-core/commit/55e9d083afb8a9def6bb21a340693d7662516c21))
30
+ * **DEX-23636:** add global font-face definitions for IBM Plex Mono and Sans in tokens ([6a537cd](https://github.com/bitdefender/dex-core/commit/6a537cd7a7627eafa1d22655c30faadc05398c27))
31
+ * **DEX-23636:** remove font-face definitions for IBM Plex Mono and Sans from tokens ([b9eed11](https://github.com/bitdefender/dex-core/commit/b9eed116857699f898ef7a8d23a9b8cc1daa28b9))
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * **DEX-23636:** update font URLs to use relative paths instead of absolute URLs ([79647a2](https://github.com/bitdefender/dex-core/commit/79647a2d7a01bbf9a5b70e2c0a8972f8a1991aa1))
37
+
38
+
39
+
6
40
  ## [0.10.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-system-design@0.9.1...@repobit/dex-system-design@0.10.0) (2025-07-23)
7
41
 
8
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repobit/dex-system-design",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "description": "Design system based on Web Components.",
5
5
  "author": "Iordache Matei Cezar <miordache@bitdefender.com>",
6
6
  "homepage": "https://github.com/bitdefender/dex-core#readme",
@@ -68,5 +68,5 @@
68
68
  "volta": {
69
69
  "node": "22.14.0"
70
70
  },
71
- "gitHead": "04e6ba773d3e1a126262cf6869e5280e00ce8863"
71
+ "gitHead": "60551ca051b44ffc8d4b34a6b948e2d9db0c6e0d"
72
72
  }
Binary file
Binary file
Binary file
@@ -101,6 +101,7 @@ class Button extends LitElement {
101
101
  `;
102
102
  }
103
103
  }
104
+
104
105
  class ButtonLink extends LitElement {
105
106
  static properties = {
106
107
  label : { type: String },
@@ -114,13 +115,14 @@ class ButtonLink extends LitElement {
114
115
  fontWeight : { type: String, attribute: "font-weight" }
115
116
  };
116
117
 
117
- /** @private -> for private properties we are using "_text" */
118
-
119
118
  constructor() {
120
119
  super();
121
120
  this.label = "Buy now";
122
121
  this.href = "";
123
122
  this.size = "md";
123
+ this.kind = "primary";
124
+ this.fullWidth = false;
125
+ this.strong = false;
124
126
  this.fontSize = "";
125
127
  this.fontWeight = "";
126
128
  }
@@ -154,6 +156,7 @@ class ButtonLink extends LitElement {
154
156
  return "";
155
157
  }
156
158
  }
159
+
157
160
  get fullWidthClass() {
158
161
  return this.fullWidth ? "max--width" : "";
159
162
  }
@@ -164,19 +167,17 @@ class ButtonLink extends LitElement {
164
167
 
165
168
  render() {
166
169
  return html`
167
- <a class="href-button" href="${this.href}" aria-label="${this.label}">
168
- <button
169
- @click=${this._handleClick}
170
- class="button ${this.kindClass} ${this.sizeClass} ${this
171
- .fullWidthClass} ${this.strongClass}"
172
- aria-label="${this.label}"
173
- style="
174
- ${this.fontSize ? `font-size: ${this.fontSize};` : ""}
175
- ${this.fontWeight ? `font-weight: ${this.fontWeight};` : ""}
176
- "
177
- >
178
- <slot></slot>
179
- </button>
170
+ <a
171
+ href="${this.href}"
172
+ class="button ${this.kindClass} ${this.sizeClass} ${this.fullWidthClass} ${this.strongClass}"
173
+ aria-label="${this.label}"
174
+ @click=${this._handleClick}
175
+ style="
176
+ ${this.fontSize ? `font-size: ${this.fontSize};` : ""}
177
+ ${this.fontWeight ? `font-weight: ${this.fontWeight};` : ""}
178
+ "
179
+ >
180
+ <slot>${this.label}</slot>
180
181
  </a>
181
182
  `;
182
183
  }
@@ -184,7 +185,10 @@ class ButtonLink extends LitElement {
184
185
  _handleClick() {
185
186
  this.dispatchEvent(new Event("custom-click"));
186
187
  }
188
+
187
189
  }
190
+
191
+
188
192
  class ContactButton extends LitElement {
189
193
  static properties = {
190
194
  label: { type: String },
@@ -217,7 +221,6 @@ class ContactButton extends LitElement {
217
221
  }
218
222
 
219
223
  _handleClick() {
220
- console.log("Contact button clicked!");
221
224
  this.dispatchEvent(new Event("custom-click"));
222
225
  }
223
226
  }
@@ -35,8 +35,8 @@ export default css`
35
35
  }
36
36
 
37
37
  button:focus-visible {
38
- outline: var(--size-2) solid var(--bd-accesibility-focus);
39
- outline-offset: var(--size-2);
38
+ outline: var(--spacing-2) solid var(--bd-accesibility-focus);
39
+ outline-offset: var(--spacing-2);
40
40
  }
41
41
  .href-button:focus,
42
42
  .href-button:focus-visible {
@@ -44,10 +44,12 @@ export default css`
44
44
  }
45
45
 
46
46
  .href-button:focus-visible button {
47
- outline: var(--size-2) solid var(--bd-accesibility-focus);
48
- outline-offset: var(--size-2);
47
+ outline: var(--spacing-2) solid var(--bd-accesibility-focus);
48
+ outline-offset: var(--spacing-2);
49
49
  }
50
-
50
+ a.button {
51
+ text-decoration: none;
52
+ }
51
53
  .href-button {
52
54
  text-decoration: none;
53
55
  display: inline-flex;
@@ -134,31 +136,31 @@ export default css`
134
136
  }
135
137
 
136
138
  .button--small {
137
- padding: var(--size-8) var(--size-16);
138
- font-size: var(--size-14);
139
+ padding: var(--spacing-8) var(--spacing-16);
140
+ font-size: var(--spacing-14);
139
141
  font-weight: 400;
140
- font-family: var(--font-family-sans);
142
+ font-family: var(--typography-fontFamily-sans);
141
143
  border-radius: 6px;
142
144
  min-height: 34px;
143
145
  min-width: 115px;
144
146
  }
145
147
 
146
148
  .button--medium {
147
- padding: var(--size-12) var(--size-20);
148
- font-size: var(--size-16);
149
+ padding: var(--spacing-12) var(--spacing-20);
150
+ font-size: var(--spacing-16);
149
151
  font-weight: 400;
150
- font-family: var(--font-family-sans);
151
- border-radius: 8px;
152
+ font-family: var(--typography-fontFamily-sans);
153
+ border-radius: var(--radius-lg);
152
154
  min-height: 45px;
153
155
  min-width: 150px;
154
156
  }
155
157
 
156
158
  .button--large {
157
- padding: var(--size-16) var(--size-24);
158
- font-size: var(--size-18);
159
+ padding: var(--spacing-16) var(--spacing-24);
160
+ font-size: var(--spacing-18);
159
161
  font-weight: 400;
160
- font-family: var(--font-family-sans);
161
- border-radius: 8px;
162
+ font-family: var(--typography-fontFamily-sans);
163
+ border-radius: var(--radius-lg);
162
164
  min-height: 55px;
163
165
  min-width: 150px;
164
166
  }
@@ -1,16 +1,16 @@
1
- import { LitElement, html, css } from "lit";
1
+ import { LitElement, css, html } from "lit";
2
2
 
3
3
 
4
4
  class ArrowIconComponent extends LitElement {
5
-
6
- static styles = css`
5
+
6
+ static styles = css`
7
7
  .arrow-icon {
8
8
  height: 10px;
9
9
  font-weight: 600;
10
10
  }
11
11
  `;
12
- render() {
13
- return html`
12
+ render() {
13
+ return html`
14
14
  <svg class="arrow-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 404.39">
15
15
  <path
16
16
  fill-rule="nonzero"
@@ -18,7 +18,7 @@ class ArrowIconComponent extends LitElement {
18
18
  />
19
19
  </svg>
20
20
  `;
21
- }
22
21
  }
23
-
24
- customElements.define('arrow-icon', ArrowIconComponent);
22
+ }
23
+
24
+ customElements.define('arrow-icon', ArrowIconComponent);
@@ -8,111 +8,110 @@ export default css`
8
8
  --badge-background: var(--color-blue-500);
9
9
  --text-color-white: var(--color-neutral-0);
10
10
  --bd-accesibility-focus: var(--color-blue-500);
11
-
12
11
  display: block;
13
12
  }
14
13
 
15
- .bd-faq-item {
16
- margin-bottom: var(--size-10);
17
- border-radius: var(--size-8);
14
+ .bd-accordion-bg-item {
15
+ margin-bottom: var(--spacing-16);
16
+ border-radius: var(--spacing-8);
18
17
  background-color: var(--color-blue-50);
19
18
  overflow: hidden;
20
19
  transition: box-shadow 0.3s ease;
21
20
  }
22
21
 
23
- .bd-faq-item:hover {
24
- .bd-question-text {
22
+ .bd-accordion-bg-item:hover {
23
+ .bd-accordion-bg-question-text {
25
24
  text-decoration-line: underline;
26
- text-decoration-style: solid;
27
25
  }
28
26
  }
29
27
 
30
- .bd-question {
28
+ .bd-accordion-bg-question {
31
29
  cursor: pointer;
32
30
  display: flex;
33
31
  justify-content: flex-start;
34
32
  align-items: center;
35
- gap: var(--size-10);
36
- padding: 15px;
33
+ gap: var(--spacing-10);
34
+ padding: var(--spacing-16);
37
35
  font-weight: bold;
38
36
  background-color: var(--color-blue-50);
39
37
  color: #333;
40
38
  transition: background-color 0.3s ease, color 0.3s ease;
41
39
  }
42
40
 
43
- .bd-header-section-faq {
44
- margin-bottom: 50px;
45
- margin-top: 50px;
41
+ .bd-accordion-bg-header {
42
+ margin-bottom: var(--spacing-32);
46
43
  }
47
44
 
48
- .bd-question:hover {
45
+ .bd-accordion-bg-question:hover {
49
46
  color: #0073e6;
50
47
  }
51
48
 
52
- .bd-faq-item:focus-visible {
53
- outline: var(--size-2) solid var(--bd-accesibility-focus);
54
- outline-offset: var(--size-2);
49
+ .bd-accordion-bg-item:focus-visible {
50
+ outline: var(--spacing-2) solid var(--bd-accesibility-focus);
51
+ outline-offset: var(--spacing-2);
55
52
  border-radius: var(--space-2xs);
56
53
  }
57
54
 
58
- .bd-faq-item:focus {
59
- .bd-question-text {
55
+ .bd-accordion-bg-item:focus {
56
+ .bd-accordion-bg-question-text {
60
57
  font-weight: 600;
61
58
  text-decoration-line: underline;
62
- text-decoration-style: solid;
63
59
  color: var(--color-blue-600);
64
- text-decoration-thickness: var(--size-2);
60
+ text-decoration-thickness: var(--spacing-2);
65
61
  }
66
62
  }
67
63
 
68
- .bd-question-text {
69
- font-family: var(--font-family-sans);
70
- font-weight: var(--font-weight-sans-semibold);
64
+ .bd-accordion-bg-question-text {
65
+ font-family: var(--typography-fontFamily-sans);
66
+ font-weight: var(--typography-fontWeight-semibold);
71
67
  }
72
68
 
73
- .bd-section-title {
74
- font-family: var(--font-family-sans);
75
- font-weight: var(--font-weight-sans-semibold);
69
+ .bd-accordion-bg-title {
70
+ font-family: var(--typography-fontFamily-sans);
71
+ font-weight: var(--typography-fontWeight-semibold);
72
+ margin-left: auto;
73
+ margin-right: auto;
74
+ text-align: center;
76
75
  }
77
76
 
78
- .bd-icon {
77
+ .bd-accordion-bg-icon {
79
78
  transition: transform 0.3s ease;
80
- width: var(--size-14);
81
- height: var(--size-14);
79
+ width: var(--spacing-14);
80
+ height: var(--spacing-14);
82
81
  color: var(--color-blue-500);
83
82
  text-align: center;
84
83
  position: relative;
85
84
  bottom: 1px;
86
85
  }
87
86
 
88
- .bd-answer {
89
- overflow: hidden;
90
- max-height: 0;
91
- opacity: 0;
92
- padding: 0 15px;
93
- background-color: var(--color-blue-50);
94
- font-family: var(--font-family-sans);
95
- font-weight: var(--font-weight-sans-medium);
96
- }
87
+ .bd-accordion-bg-answer {
88
+ overflow: hidden;
89
+ max-height: 0;
90
+ opacity: 0;
91
+ padding: 0 15px;
92
+ background-color: var(--color-blue-50);
93
+ font-family: var(--typography-fontFamily-sans);
94
+ font-weight: var(--font-weight-sans-medium);
95
+ }
97
96
 
98
- .bd-faq-item.open .bd-answer {
99
- max-height: 1000px; /* pune un maxim generos, dar realist */
100
- opacity: 1;
101
- padding: var(--size-0) var(--size-40);
102
- }
97
+ .bd-accordion-bg-item.open .bd-accordion-bg-answer {
98
+ max-height: 1000px;
99
+ opacity: 1;
100
+ padding: var(--spacing-0) var(--spacing-40);
101
+ }
103
102
 
104
- .bd-answer > div {
103
+ .bd-accordion-bg-answer > div {
105
104
  overflow: hidden;
106
105
  }
107
106
 
108
-
109
-
110
- .bd-faq-container {
107
+ .bd-accordion-bg-container {
111
108
  width: 90%;
112
109
  margin: auto;
110
+ padding-top: var(--spacing-64);
111
+ padding-bottom: var(--spacing-64);
113
112
  }
114
113
 
115
- .bd-link-noline {
114
+ .bd-accordion-bg-link-noline {
116
115
  text-decoration: none;
117
116
  }
118
117
  `;
@@ -1,86 +0,0 @@
1
- import { LitElement, html } from "lit";
2
- import { tokens } from "../../tokens/tokens.js";
3
-
4
- import faqCSS from "../FAQ/faq.css.js";
5
-
6
- class FaqSection extends LitElement {
7
- static properties = {
8
- faqs: { type: Array }
9
- };
10
-
11
- constructor() {
12
- super();
13
- }
14
-
15
- render() {
16
- return html`
17
- <div class="bd-faq-container">
18
- <div class="bd-header-section-faq">
19
- <h1 class="bd-section-title">${this.title}</h1>
20
- </div>
21
- <slot></slot>
22
- </div>
23
- `;
24
- }
25
- }
26
-
27
- class FaqSectionItem extends LitElement {
28
- static properties = {
29
- title: { type: String },
30
- open : { type: Boolean, reflect: true }
31
- };
32
-
33
- constructor() {
34
- super();
35
- this.title = "";
36
- this.open = false;
37
- this.id = `faq-${Math.random().toString(36)
38
- .substr(2, 9)}`;
39
- }
40
-
41
- toggleItem() {
42
- this.open = !this.open;
43
- this.requestUpdate();
44
- }
45
-
46
- handleKeyDown(event) {
47
- if (event.key === "Enter" || event.key === " ") {
48
- event.preventDefault();
49
- this.toggleItem();
50
- }
51
- }
52
-
53
- render() {
54
- return html`
55
- <div
56
- class="bd-faq-item ${this.open ? "open" : ""}"
57
- role="button"
58
- aria-expanded="${this.open}"
59
- aria-controls="${this.id}"
60
- tabindex="0"
61
- @click=${this.toggleItem}
62
- @keydown=${this.handleKeyDown}
63
- >
64
- <div class="bd-question">
65
- <span class="bd-icon">${this.open ? "−" : "+"}</span>
66
- <span class="bd-question-text">${this.title}</span>
67
- </div>
68
-
69
- <div
70
- id="${this.id}"
71
- class="bd-answer"
72
- role="region"
73
- aria-labelledby="${this.id}"
74
- >
75
- <slot></slot>
76
- </div>
77
- </div>
78
- `;
79
- }
80
- }
81
-
82
- FaqSection.styles = [tokens, faqCSS];
83
- FaqSectionItem.styles = [tokens, faqCSS];
84
-
85
- customElements.define("bd-faq-section-item", FaqSectionItem);
86
- customElements.define("bd-faq-section", FaqSection);
@@ -1,28 +1,90 @@
1
1
  import { LitElement, html } from "lit";
2
2
  import { tokens } from "../../tokens/tokens.js";
3
- import inputCSS from "../Input/input.css.js";
3
+ import inputCSS from "./input.css.js";
4
4
 
5
5
  class CustomInput extends LitElement {
6
6
  static properties = {
7
- label: { type: String },
8
- type : { type: String }
7
+ label : { type: String },
8
+ type : { type: String },
9
+ kind : { type: String }, // sm, md, lg
10
+ placeholder: { type: String },
11
+ required : { type: Boolean },
12
+ focused : { type: Boolean },
13
+ tooltip : { type: String },
14
+ invalid : { type: Boolean },
15
+ validated : { type: Boolean, reflect: true },
16
+ disabled : { type: Boolean, reflect: true }
9
17
  };
10
18
 
11
19
  constructor() {
12
20
  super();
13
21
  this.label = "Default Label";
14
22
  this.type = "text";
23
+ this.kind = "md";
24
+ this.placeholder = "Enter something...";
25
+ this.required = false;
26
+ this.focused = false;
27
+ this.tooltip = "";
28
+ this.invalid = false;
29
+ this.validated = false;
30
+ this.disabled = false;
15
31
  }
16
32
 
17
33
 
18
34
  render() {
35
+ const inputClass = {
36
+ sm: "input-sm",
37
+ md: "input-md",
38
+ lg: "input-lg"
39
+ }[this.kind];
40
+
41
+ const labelClass = {
42
+ sm: "label-sm",
43
+ md: "label-md",
44
+ lg: "label-lg"
45
+ }[this.kind];
46
+
47
+ const inputStateClass = this.disabled
48
+ ? "form-input--disabled"
49
+ : this.invalid
50
+ ? "form-input--error"
51
+ : this.validated
52
+ ? "form-input--success"
53
+ : "";
54
+
55
+ const helpTextClass = this.invalid
56
+ ? "form-help-text--error"
57
+ : this.validated
58
+ ? "form-help-text--success"
59
+ : "form-help-text--default";
60
+
19
61
  return html`
20
62
  <div class="input-container">
21
- <label for="custom-input">${this.label}</label>
22
- <input type="${this.type}" id="custom-input" />
63
+ <label for="custom-input" class="form-label ${labelClass}">
64
+ ${this.label}
65
+ ${this.required
66
+ ? html`<span class="form-label__required">*</span>`
67
+ : ""}
68
+ </label>
69
+ <input
70
+ id="custom-input"
71
+ class="form-input-bd ${inputClass} ${this.focused
72
+ ? "focused"
73
+ : ""} ${inputStateClass}"
74
+ type="${this.type}"
75
+ placeholder="${this.placeholder}"
76
+ ?required="${this.required}"
77
+ ?disabled="${this.disabled}"
78
+ />
79
+ ${this.tooltip
80
+ ? html`<div class="form-help-text ${helpTextClass}">
81
+ ${this.tooltip}
82
+ </div>`
83
+ : ""}
23
84
  </div>
24
85
  `;
25
86
  }
26
87
  }
27
88
  CustomInput.styles = [tokens, inputCSS];
28
- customElements.define("custom-input", CustomInput);
89
+
90
+ customElements.define("bd-custom-input", CustomInput);