@repobit/dex-system-design 0.11.0 → 0.14.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 (97) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/package.json +2 -2
  3. package/src/assets/icons/Identity_protection.png +0 -0
  4. package/src/assets/icons/device_protection.png +0 -0
  5. package/src/assets/icons/financial_insurance.png +0 -0
  6. package/src/assets/icons/privacy_protection.png +0 -0
  7. package/src/assets/icons/user_guide.png +0 -0
  8. package/src/components/Button/Button.js +19 -16
  9. package/src/components/Button/button.css.js +18 -16
  10. package/src/components/Button/icons.js +8 -8
  11. package/src/components/FAQ/faq.css.js +48 -49
  12. package/src/components/FAQ/faq.js +0 -86
  13. package/src/components/Input/Input.js +68 -6
  14. package/src/components/Input/custom-form.stories.js +88 -0
  15. package/src/components/Input/input-clipboard.css.js +168 -0
  16. package/src/components/Input/input-clipboard.js +137 -0
  17. package/src/components/Input/input.css.js +122 -42
  18. package/src/components/accordion/accordion-bg.css.js +117 -0
  19. package/src/components/accordion/accordion-bg.js +80 -0
  20. package/src/components/accordion/accordion-no-bg.css.js +114 -0
  21. package/src/components/accordion/accordion-no-bg.js +80 -0
  22. package/src/components/accordion/accordion.css.js +88 -0
  23. package/src/components/accordion/accordion.js +81 -0
  24. package/src/components/anchor/anchor-nav.css.js +15 -15
  25. package/src/components/anchor/anchor-nav.js +0 -1
  26. package/src/components/anchor/anchor.stories.js +10 -13
  27. package/src/components/badge/badge.css.js +6 -6
  28. package/src/components/badge/badge.js +1 -2
  29. package/src/components/badge/badge.stories.js +6 -6
  30. package/src/components/carousel/carousel.css.js +60 -60
  31. package/src/components/carousel/carousel.js +26 -30
  32. package/src/components/carousel/carousel.stories.js +55 -55
  33. package/src/components/checkbox/checkbox.css.js +14 -14
  34. package/src/components/divider/divider-horizontal.js +19 -14
  35. package/src/components/divider/divider-vertical.js +23 -14
  36. package/src/components/divider/divider.css.js +19 -0
  37. package/src/components/dropdown/dropdown.css.js +138 -0
  38. package/src/components/dropdown/dropdown.js +111 -0
  39. package/src/components/footer/footer-links-group.css.js +42 -0
  40. package/src/components/footer/footer-links-group.js +25 -0
  41. package/src/components/footer/footer-lp.css.js +625 -0
  42. package/src/components/footer/footer-lp.js +368 -0
  43. package/src/components/footer/footer-lp.stories.js +69 -0
  44. package/src/components/footer/footer-nav-menu.css.js +24 -0
  45. package/src/components/footer/footer-nav-menu.js +36 -0
  46. package/src/components/footer/footer.css.js +625 -0
  47. package/src/components/footer/footer.js +465 -0
  48. package/src/components/footer/footer.stories.js +60 -0
  49. package/src/components/footer/localeMap.js +1 -0
  50. package/src/components/grid/grid.css.js +38 -0
  51. package/src/components/grid/grid.js +55 -0
  52. package/src/components/header/header.css.js +81 -52
  53. package/src/components/header/header.js +19 -19
  54. package/src/components/highlight/highlight.css.js +32 -22
  55. package/src/components/highlight/highlight.js +15 -4
  56. package/src/components/highlight/highlight.stories.js +4 -4
  57. package/src/components/light-carousel/light-carousel-simple.css.js +183 -0
  58. package/src/components/light-carousel/light-carousel-simple.js +73 -0
  59. package/src/components/light-carousel/light-carousel.css.js +50 -31
  60. package/src/components/light-carousel/light-carousel.js +14 -57
  61. package/src/components/light-carousel/light-carousel.stories.js +51 -10
  62. package/src/components/link/link.css.js +41 -0
  63. package/src/components/link/link.js +54 -0
  64. package/src/components/modal/modal.css.js +75 -0
  65. package/src/components/modal/modal.js +41 -0
  66. package/src/components/modal/modal.stories.js +40 -0
  67. package/src/components/paragraph/paragraph.css.js +1 -3
  68. package/src/components/pricing-cards/new-pricing-card.js +30 -0
  69. package/src/components/pricing-cards/new-pricing.css.js +58 -0
  70. package/src/components/pricing-cards/pricing-card-actions.css.js +16 -0
  71. package/src/components/pricing-cards/pricing-card-actions.js +20 -0
  72. package/src/components/pricing-cards/pricing-card-container.css.js +41 -0
  73. package/src/components/pricing-cards/pricing-card-container.js +31 -0
  74. package/src/components/pricing-cards/pricing-card-header.css.js +70 -0
  75. package/src/components/pricing-cards/pricing-card-header.js +46 -0
  76. package/src/components/pricing-cards/pricing-card-pricing.css.js +63 -0
  77. package/src/components/pricing-cards/pricing-card-pricing.js +101 -0
  78. package/src/components/pricing-cards/pricing-card-show-more.css.js +22 -0
  79. package/src/components/pricing-cards/pricing-card-show-more.js +33 -0
  80. package/src/components/pricing-cards/pricing-card.css.js +91 -89
  81. package/src/components/pricing-cards/pricing-card.js +13 -16
  82. package/src/components/pricing-cards/pricing-feature-item.css.js +18 -0
  83. package/src/components/pricing-cards/pricing-feature-item.js +14 -0
  84. package/src/components/radio/radio.css.js +18 -18
  85. package/src/components/radio/radio.js +1 -0
  86. package/src/components/tabs/tabs.css.js +21 -11
  87. package/src/components/tabs/tabs.js +24 -18
  88. package/src/components/termsOfUse/terms.css.js +6 -6
  89. package/src/components/termsOfUse/terms.js +0 -1
  90. package/src/stories/demo.stories.js +270 -0
  91. package/src/tokens/layout.css +1 -0
  92. package/src/tokens/tokens.css +412 -0
  93. package/src/components/highlight/highlight-s.css.js +0 -88
  94. package/src/components/highlight/highlight-s.js +0 -35
  95. package/src/components/highlight/highlight-s.stories.js +0 -22
  96. package/src/tokens/fonts.css +0 -166
  97. package/src/tokens/tokens.js +0 -281
@@ -0,0 +1,168 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ :host {
5
+ display: block;
6
+ width: 90%;
7
+ }
8
+
9
+ .input-container {
10
+ display: flex;
11
+ flex-direction: column;
12
+ }
13
+
14
+ label {
15
+ margin-bottom: 4px;
16
+ font-weight: 500;
17
+ color: var(--color-neutral-900);
18
+ }
19
+
20
+ .form-label__required {
21
+ color: var(--color-red-500);
22
+ margin-left: var(--spacing-4);
23
+ }
24
+
25
+ .label-sm {
26
+ font-size: var(--typography-fontSize-xs);
27
+ font-weight: var(--typography-fontWeight-bold);
28
+ line-height: var(--typography-lineHeight-normal);
29
+ letter-spacing: var(--typography-letterSpacing-wide);
30
+ margin-bottom: var(--spacing-4);
31
+ }
32
+
33
+ .label-md {
34
+ font-size: var(--typography-fontSize-sm);
35
+ font-weight: var(--typography-fontWeight-bold);
36
+ line-height: var(--typography-lineHeight-normal);
37
+ margin-bottom: var(--spacing-4);
38
+ }
39
+
40
+ .label-lg {
41
+ font-size: var(--typography-fontSize-lg);
42
+ font-weight: var(--typography-fontWeight-bold);
43
+ line-height: var(--typography-lineHeight-normal);
44
+ margin-bottom: var(--spacing-8);
45
+ }
46
+
47
+ .form-input-bd {
48
+ width: 100%;
49
+ border: var(--border-width-1, 1px) solid var(--color-neutral-300);
50
+ font-family: var(--typography-fontFamily-sans, sans-serif);
51
+ line-height: var(--typography-lineHeight-normal, 1.5);
52
+ transition: border-color 0.3s ease, background-color 0.3s ease,
53
+ box-shadow 0.3s ease;
54
+ background-color: var(--color-neutral-0);
55
+ color: var(--color-neutral-900);
56
+ outline: none;
57
+ }
58
+
59
+ input:focus {
60
+ border-color: var(--color-blue-500);
61
+ box-shadow: var(--focus-outline-primary, 0 0 0 2px rgba(0, 109, 255, 0.3));
62
+ }
63
+
64
+ .input-sm {
65
+ padding: var(--spacing-8) var(--spacing-12);
66
+ font-size: var(--typography-fontSize-sm);
67
+ height: var(--dimension-34px);
68
+ border-radius: var(--form-input-medium-borderRadius);
69
+ }
70
+
71
+ .input-md {
72
+ padding: var(--spacing-12) var(--spacing-16);
73
+ font-size: var(--typography-fontSize-base);
74
+ height: var(--dimension-45px);
75
+ border-radius: var(--form-input-large-borderRadius);
76
+ }
77
+
78
+ .input-lg {
79
+ padding: var(--spacing-16) var(--spacing-20);
80
+ font-size: var(--typography-fontSize-lg);
81
+ height: var(--dimension-55px);
82
+ border-radius: var(--form-input-large-borderRadius);
83
+ }
84
+
85
+ ::placeholder {
86
+ color: var(--color-neutral-500);
87
+ opacity: 1;
88
+ }
89
+
90
+ .form-label {
91
+ display: block;
92
+ font-family: var(--typography-fontFamily-sans);
93
+ color: var(--color-neutral-900);
94
+ letter-spacing: var(--typography-letterSpacing-normal);
95
+ }
96
+
97
+ .form-input-bd:focus,
98
+ .form-input-bd.focused {
99
+ border-color: var(--color-blue-500);
100
+ box-shadow: var(--focus-outline-primary, 0 0 0 2px rgba(0, 109, 255, 0.3));
101
+ background: none;
102
+ }
103
+
104
+ .form-help-text {
105
+ font-size: var(--typography-fontSize-xs);
106
+ font-weight: var(--typography-fontWeight-normal);
107
+ line-height: var(--typography-lineHeight-normal);
108
+ letter-spacing: var(--typography-letterSpacing-normal);
109
+ font-family: var(--typography-fontFamily-sans);
110
+ margin-top: var(--spacing-4);
111
+ }
112
+
113
+ .form-help-text--default {
114
+ color: var(--color-neutral-600);
115
+ }
116
+
117
+ .form-input--error {
118
+ background-color: var(--color-red-50);
119
+ border-color: var(--color-red-500);
120
+ }
121
+
122
+ .form-help-text--error {
123
+ color: var(--color-red-600);
124
+ }
125
+
126
+ .form-input--success {
127
+ background-color: var(--color-green-50);
128
+ border-color: var(--color-green-500);
129
+ }
130
+
131
+ .form-help-text--success {
132
+ color: var(--color-green-600);
133
+ }
134
+
135
+ .form-input--disabled {
136
+ background-color: var(--color-neutral-100);
137
+ border-color: var(--color-neutral-300);
138
+ color: var(--color-neutral-500);
139
+ cursor: not-allowed;
140
+ }
141
+
142
+ .input-with-button {
143
+ position: relative;
144
+ display: flex;
145
+ align-items: center;
146
+ }
147
+
148
+ input.form-input-bd {
149
+ flex: 1;
150
+ padding-right: 2.5rem; /* space for button */
151
+ }
152
+
153
+ .paste-button {
154
+ position: absolute;
155
+ right: 0.5rem;
156
+ background: transparent;
157
+ border: none;
158
+ cursor: pointer;
159
+ font-size: 1rem;
160
+ padding: 0;
161
+ color: var(--color-gray-700);
162
+ }
163
+
164
+ .paste-button:disabled {
165
+ cursor: not-allowed;
166
+ opacity: 0.5;
167
+ }
168
+ `;
@@ -0,0 +1,137 @@
1
+ import { LitElement, html } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import inputClipboardCSS from "../input/input-clipboard.css.js";
4
+
5
+ class CustomInputClipboard extends LitElement {
6
+ static properties = {
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 },
17
+ value : { type: String }
18
+ };
19
+
20
+ constructor() {
21
+ super();
22
+ this.label = "Default Label";
23
+ this.type = "text";
24
+ this.kind = "md";
25
+ this.placeholder = "Paste something...";
26
+ this.required = false;
27
+ this.focused = false;
28
+ this.tooltip = "";
29
+ this.invalid = false;
30
+ this.validated = false;
31
+ this.disabled = false;
32
+ this.value = "";
33
+ }
34
+
35
+ async pasteFromClipboard() {
36
+ try {
37
+ const text = await navigator.clipboard.readText();
38
+ this.value = text;
39
+ this.dispatchEvent(new CustomEvent("input", { detail: text }));
40
+ } catch (err) {
41
+ console.error("Clipboard paste failed:", err);
42
+ }
43
+ }
44
+
45
+ handleInput(e) {
46
+ this.value = e.target.value;
47
+ this.dispatchEvent(new CustomEvent("input", { detail: this.value }));
48
+ }
49
+
50
+ render() {
51
+ const inputClass = {
52
+ sm: "input-sm",
53
+ md: "input-md",
54
+ lg: "input-lg"
55
+ }[this.kind];
56
+
57
+ const labelClass = {
58
+ sm: "label-sm",
59
+ md: "label-md",
60
+ lg: "label-lg"
61
+ }[this.kind];
62
+
63
+ const inputStateClass = this.disabled
64
+ ? "form-input--disabled"
65
+ : this.invalid
66
+ ? "form-input--error"
67
+ : this.validated
68
+ ? "form-input--success"
69
+ : "";
70
+
71
+ const helpTextClass = this.invalid
72
+ ? "form-help-text--error"
73
+ : this.validated
74
+ ? "form-help-text--success"
75
+ : "form-help-text--default";
76
+
77
+ return html`
78
+ <div class="input-container">
79
+ <label for="clipboard-input" class="form-label ${labelClass}">
80
+ ${this.label}
81
+ ${this.required
82
+ ? html`<span class="form-label__required">*</span>`
83
+ : ""}
84
+ </label>
85
+ <div class="input-with-button">
86
+ <input
87
+ id="clipboard-input"
88
+ class="form-input-bd ${inputClass} ${this.focused
89
+ ? "focused"
90
+ : ""} ${inputStateClass}"
91
+ type="${this.type}"
92
+ placeholder="${this.placeholder}"
93
+ .value="${this.value}"
94
+ ?required="${this.required}"
95
+ ?disabled="${this.disabled}"
96
+ @input="${this.handleInput}"
97
+ />
98
+ <button
99
+ class="paste-button"
100
+ @click="${this.pasteFromClipboard}"
101
+ title="Paste from clipboard"
102
+ ?disabled="${this.disabled}"
103
+ type="button"
104
+ aria-label="Paste from clipboard"
105
+ >
106
+ <svg
107
+ xmlns="http://www.w3.org/2000/svg"
108
+ width="20"
109
+ height="20"
110
+ viewBox="0 0 24 24"
111
+ fill="none"
112
+ stroke="currentColor"
113
+ stroke-width="1.5"
114
+ stroke-linecap="round"
115
+ stroke-linejoin="round"
116
+ >
117
+ <path
118
+ d="M16 4H18A2 2 0 0 1 20 6V20A2 2 0 0 1 18 22H6A2 2 0 0 1 4 20V6A2 2 0 0 1 6 4H8"
119
+ />
120
+ <rect x="8" y="2" width="8" height="4" rx="1" ry="1" />
121
+ </svg>
122
+ </button>
123
+ </div>
124
+
125
+ ${this.tooltip
126
+ ? html`<div class="form-help-text ${helpTextClass}">
127
+ ${this.tooltip}
128
+ </div>`
129
+ : ""}
130
+ </div>
131
+ `;
132
+ }
133
+
134
+ }
135
+ CustomInputClipboard.styles = [tokens, inputClipboardCSS];
136
+
137
+ customElements.define("bd-custom-input-clipboard", CustomInputClipboard);
@@ -1,68 +1,148 @@
1
1
  import { css } from "lit";
2
2
 
3
3
  export default css`
4
+ :host {
5
+ display: block;
6
+ width: 90%;
7
+ }
8
+
4
9
  .input-container {
5
10
  display: flex;
6
11
  flex-direction: column;
7
- margin-bottom: 1em;
8
12
  }
9
13
 
10
14
  label {
11
- font-size: 14px;
12
- font-weight: bold;
13
- margin-bottom: 5px;
14
- color: #333;
15
- }
16
-
17
- input {
18
- width: 20%;
19
- padding: 10px;
20
- font-size: 16px;
21
- border: 1px solid #ccc;
22
- border-radius: 4px;
15
+ margin-bottom: 4px;
16
+ font-weight: 500;
17
+ color: var(--color-neutral-900);
18
+ }
19
+
20
+ .form-label__required {
21
+ color: var(--color-red-500);
22
+ margin-left: var(--spacing-4);
23
+ }
24
+
25
+ .label-sm {
26
+ font-size: var(--typography-fontSize-xs);
27
+ font-weight: var(--typography-fontWeight-bold);
28
+ line-height: var(--typography-lineHeight-normal);
29
+ letter-spacing: var(--typography-letterSpacing-wide);
30
+ margin-bottom: var(--spacing-4);
31
+ }
32
+
33
+ .label-md {
34
+ font-size: var(--typography-fontSize-sm);
35
+ font-weight: var(--typography-fontWeight-bold);
36
+ line-height: var(--typography-lineHeight-normal);
37
+ margin-bottom: var(--spacing-4);
38
+ }
39
+
40
+ .label-lg {
41
+ font-size: var(--typography-fontSize-lg);
42
+ font-weight: var(--typography-fontWeight-bold);
43
+ line-height: var(--typography-lineHeight-normal);
44
+ margin-bottom: var(--spacing-8);
45
+ }
46
+
47
+ .form-input-bd {
48
+ width: 100%;
49
+ border: var(--border-width-1, 1px) solid var(--color-neutral-300);
50
+ font-family: var(--typography-fontFamily-sans, sans-serif);
51
+ line-height: var(--typography-lineHeight-normal, 1.5);
52
+ transition: border-color 0.3s ease, background-color 0.3s ease,
53
+ box-shadow 0.3s ease;
54
+ background-color: var(--color-neutral-0);
55
+ color: var(--color-neutral-900);
23
56
  outline: none;
24
- transition: border-color 0.3s ease, box-shadow 0.3s ease;
25
57
  }
26
58
 
27
59
  input:focus {
28
- border-color: #006eff;
29
- box-shadow: 0px 0px 5px rgba(0, 110, 255, 0.5);
60
+ border-color: var(--color-blue-500);
61
+ box-shadow: var(
62
+ --focus-outline-primary,
63
+ 0 0 0 2px rgba(0, 109, 255, 0.3)
64
+ );
30
65
  }
31
66
 
32
- form {
33
- max-width: 400px;
34
- margin: 20px auto;
35
- padding: 10px;
36
- border: 1px solid #ddd;
37
- border-radius: 5px;
38
- background-color: #f9f9f9;
67
+ .input-sm {
68
+ padding: var(--spacing-8) var(--spacing-12);
69
+ font-size: var(--typography-fontSize-sm);
70
+ height: var(--dimension-34px);
71
+ border-radius: var(--form-input-medium-borderRadius);
39
72
  }
40
73
 
41
- .form-group {
42
- display: flex;
43
- flex-direction: column;
44
- margin-bottom: 15px;
74
+ .input-md {
75
+ padding: var(--spacing-12) var(--spacing-16);
76
+ font-size: var(--typography-fontSize-base);
77
+ height: var(--dimension-45px);
78
+ border-radius: var(--form-input-large-borderRadius);
45
79
  }
46
80
 
47
- .form-group label {
48
- font-size: 14px;
49
- margin-bottom: 5px;
50
- font-weight: bold;
81
+ .input-lg {
82
+ padding: var(--spacing-16) var(--spacing-20);
83
+ font-size: var(--typography-fontSize-lg);
84
+ height: var(--dimension-55px);
85
+ border-radius: var(--form-input-large-borderRadius);
51
86
  }
52
87
 
53
- .form-group input {
54
- padding: 10px;
55
- font-size: 16px;
56
- border: 1px solid #ccc;
57
- border-radius: 4px;
58
- transition: border-color 0.3s ease, box-shadow 0.3s ease;
59
- width: 80% !important;
88
+ ::placeholder {
89
+ color: var(--color-neutral-500);
90
+ opacity: 1;
60
91
  }
61
92
 
62
- .form-group input:focus {
63
- border-color: #006eff;
64
- box-shadow: 0px 0px 5px rgba(0, 110, 255, 0.5);
93
+ .form-label {
94
+ display: block;
95
+ font-family: var(--typography-fontFamily-sans);
96
+ color: var(--color-neutral-900);
97
+ letter-spacing: var(--typography-letterSpacing-normal);
65
98
  }
66
99
 
67
-
100
+ .form-input-bd:focus,
101
+ .form-input-bd.focused {
102
+ border-color: var(--color-blue-500);
103
+ box-shadow: var(
104
+ --focus-outline-primary,
105
+ 0 0 0 2px rgba(0, 109, 255, 0.3)
106
+ );
107
+ background: none;
108
+ }
109
+
110
+ .form-help-text {
111
+ font-size: var(--typography-fontSize-xs);
112
+ font-weight: var(--typography-fontWeight-normal);
113
+ line-height: var(--typography-lineHeight-normal);
114
+ letter-spacing: var(--typography-letterSpacing-normal);
115
+ font-family: var(--typography-fontFamily-sans);
116
+ margin-top: var(--spacing-4);
117
+ }
118
+
119
+ .form-help-text--default {
120
+ color: var(--color-neutral-600);
121
+ }
122
+
123
+ .form-input--error {
124
+ background-color: var(--color-red-50);
125
+ border-color: var(--color-red-500);
126
+ }
127
+
128
+ .form-help-text--error {
129
+ color: var(--color-red-600);
130
+ }
131
+
132
+ .form-input--success {
133
+ background-color: var(--color-green-50);
134
+ border-color: var(--color-green-500);
135
+ }
136
+
137
+ .form-help-text--success {
138
+ color: var(--color-green-600);
139
+ }
140
+
141
+ .form-input--disabled {
142
+ background-color: var(--color-neutral-100);
143
+ border-color: var(--color-neutral-300);
144
+ color: var(--color-neutral-500);
145
+ cursor: not-allowed;
146
+ }
147
+
68
148
  `;
@@ -0,0 +1,117 @@
1
+ import { css } from "lit";
2
+
3
+ export default css`
4
+ :host {
5
+ --background-card-grey: var(--color-neutral-25);
6
+ --border-card-grey: var(--color-neutral-50);
7
+ --border-card-green: var(--color-green-700);
8
+ --badge-background: var(--color-blue-500);
9
+ --text-color-white: var(--color-neutral-0);
10
+ --bd-accesibility-focus: var(--color-blue-500);
11
+ display: block;
12
+ }
13
+
14
+ .bd-accordion-bg-item {
15
+ margin-bottom: var(--spacing-16);
16
+ border-radius: var(--spacing-8);
17
+ background-color: var(--color-blue-50);
18
+ overflow: hidden;
19
+ transition: box-shadow 0.3s ease;
20
+ }
21
+
22
+ .bd-accordion-bg-item:hover {
23
+ .bd-accordion-bg-question-text {
24
+ text-decoration-line: underline;
25
+ }
26
+ }
27
+
28
+ .bd-accordion-bg-question {
29
+ cursor: pointer;
30
+ display: flex;
31
+ justify-content: flex-start;
32
+ align-items: center;
33
+ gap: var(--spacing-10);
34
+ padding: var(--spacing-16);
35
+ font-weight: bold;
36
+ background-color: var(--color-blue-50);
37
+ color: #333;
38
+ transition: background-color 0.3s ease, color 0.3s ease;
39
+ }
40
+
41
+ .bd-accordion-bg-header {
42
+ margin-bottom: var(--spacing-32);
43
+ }
44
+
45
+ .bd-accordion-bg-question:hover {
46
+ color: #0073e6;
47
+ }
48
+
49
+ .bd-accordion-bg-item:focus-visible {
50
+ outline: var(--spacing-2) solid var(--bd-accesibility-focus);
51
+ outline-offset: var(--spacing-2);
52
+ border-radius: var(--space-2xs);
53
+ }
54
+
55
+ .bd-accordion-bg-item:focus {
56
+ .bd-accordion-bg-question-text {
57
+ font-weight: 600;
58
+ text-decoration-line: underline;
59
+ color: var(--color-blue-600);
60
+ text-decoration-thickness: var(--spacing-2);
61
+ }
62
+ }
63
+
64
+ .bd-accordion-bg-question-text {
65
+ font-family: var(--typography-fontFamily-sans);
66
+ font-weight: var(--typography-fontWeight-semibold);
67
+ }
68
+
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;
75
+ }
76
+
77
+ .bd-accordion-bg-icon {
78
+ transition: transform 0.3s ease;
79
+ width: var(--spacing-14);
80
+ height: var(--spacing-14);
81
+ color: var(--color-blue-500);
82
+ text-align: center;
83
+ position: relative;
84
+ bottom: 1px;
85
+ }
86
+
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
+ }
96
+
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
+ }
102
+
103
+ .bd-accordion-bg-answer > div {
104
+ overflow: hidden;
105
+ }
106
+
107
+ .bd-accordion-bg-container {
108
+ width: 90%;
109
+ margin: auto;
110
+ padding-top: var(--spacing-64);
111
+ padding-bottom: var(--spacing-64);
112
+ }
113
+
114
+ .bd-accordion-bg-link-noline {
115
+ text-decoration: none;
116
+ }
117
+ `;
@@ -0,0 +1,80 @@
1
+ import { LitElement, html } from "lit";
2
+ import { tokens } from "../../tokens/tokens.js";
3
+ import accordionCSS from "./accordion-bg.css";
4
+
5
+ class BdAccordionBg extends LitElement {
6
+ static properties = {
7
+ title: { type: String }
8
+ };
9
+
10
+ static styles = [tokens, accordionCSS];
11
+
12
+ render() {
13
+ return html`
14
+ <div class="bd-accordion-bg-container">
15
+ <div class="bd-accordion-bg-header">
16
+ <h1 class="bd-accordion-bg-title">${this.title}</h1>
17
+ </div>
18
+ <slot></slot>
19
+ </div>
20
+ `;
21
+ }
22
+ }
23
+
24
+ class BdAccordionBgItem extends LitElement {
25
+ static properties = {
26
+ title: { type: String },
27
+ open : { type: Boolean, reflect: true }
28
+ };
29
+
30
+ constructor() {
31
+ super();
32
+ this.title = "";
33
+ this.open = false;
34
+ this.id = `accordion-${Math.random().toString(36)
35
+ .substr(2, 9)}`;
36
+ }
37
+
38
+ static styles = [tokens, accordionCSS];
39
+
40
+ toggleItem() {
41
+ this.open = !this.open;
42
+ }
43
+
44
+ handleKeyDown(event) {
45
+ if (event.key === "Enter" || event.key === " ") {
46
+ event.preventDefault();
47
+ this.toggleItem();
48
+ }
49
+ }
50
+
51
+ render() {
52
+ return html`
53
+ <div
54
+ class="bd-accordion-bg-item ${this.open ? "open" : ""}"
55
+ role="button"
56
+ aria-expanded="${this.open}"
57
+ aria-controls="${this.id}"
58
+ tabindex="0"
59
+ @click=${this.toggleItem}
60
+ @keydown=${this.handleKeyDown}
61
+ >
62
+ <div class="bd-accordion-bg-question">
63
+ <span class="bd-accordion-bg-icon">${this.open ? "−" : "+"}</span>
64
+ <span class="bd-accordion-bg-question-text">${this.title}</span>
65
+ </div>
66
+ <div
67
+ id="${this.id}"
68
+ class="bd-accordion-bg-answer"
69
+ role="region"
70
+ aria-labelledby="${this.id}"
71
+ >
72
+ <slot></slot>
73
+ </div>
74
+ </div>
75
+ `;
76
+ }
77
+ }
78
+
79
+ customElements.define("bd-accordion-bg", BdAccordionBg);
80
+ customElements.define("bd-accordion-bg-item", BdAccordionBgItem);