@prokodo/ui 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/components/accordion/Accordion.css +46 -0
- package/dist/components/accordion/Accordion.module.css +46 -0
- package/dist/components/accordion/Accordion.module.scss.js +4 -0
- package/dist/components/accordion/Accordion.view.js +25 -5
- package/dist/components/autocomplete/Autocomplete.client.js +132 -0
- package/dist/components/autocomplete/Autocomplete.css +317 -0
- package/dist/components/autocomplete/Autocomplete.js +12 -0
- package/dist/components/autocomplete/Autocomplete.lazy.js +12 -0
- package/dist/components/autocomplete/Autocomplete.module.css +317 -0
- package/dist/components/autocomplete/Autocomplete.module.scss.js +21 -0
- package/dist/components/autocomplete/Autocomplete.server.js +11 -0
- package/dist/components/autocomplete/Autocomplete.view.js +142 -0
- package/dist/components/autocomplete/index.js +4 -0
- package/dist/components/button/Button.css +114 -6
- package/dist/components/button/Button.module.css +114 -6
- package/dist/components/button/Button.module.scss.js +10 -2
- package/dist/components/button/Button.view.js +1 -0
- package/dist/components/checkbox/Checkbox.client.js +42 -0
- package/dist/components/checkbox/Checkbox.css +312 -0
- package/dist/components/checkbox/Checkbox.js +12 -0
- package/dist/components/checkbox/Checkbox.lazy.js +12 -0
- package/dist/components/checkbox/Checkbox.module.css +312 -0
- package/dist/components/checkbox/Checkbox.module.scss.js +20 -0
- package/dist/components/checkbox/Checkbox.server.js +20 -0
- package/dist/components/checkbox/Checkbox.view.js +86 -0
- package/dist/components/checkbox/index.js +4 -0
- package/dist/components/checkbox-group/CheckboxGroup.client.js +57 -0
- package/dist/components/checkbox-group/CheckboxGroup.css +238 -0
- package/dist/components/checkbox-group/CheckboxGroup.js +13 -0
- package/dist/components/checkbox-group/CheckboxGroup.lazy.js +12 -0
- package/dist/components/checkbox-group/CheckboxGroup.module.css +238 -0
- package/dist/components/checkbox-group/CheckboxGroup.module.scss.js +15 -0
- package/dist/components/checkbox-group/CheckboxGroup.server.js +25 -0
- package/dist/components/checkbox-group/CheckboxGroup.view.js +97 -0
- package/dist/components/checkbox-group/index.js +4 -0
- package/dist/components/dialog/Dialog.view.js +2 -1
- package/dist/components/dynamic-list/DynamicList.view.js +1 -1
- package/dist/components/input/Input.css +2 -2
- package/dist/components/input/Input.module.css +2 -2
- package/dist/components/rich-text/RichText.css +0 -1
- package/dist/components/rich-text/RichText.module.css +0 -1
- package/dist/components/snackbar/Snackbar.css +5 -1
- package/dist/components/snackbar/Snackbar.module.css +5 -1
- package/dist/components/tabs/Tabs.client.js +182 -0
- package/dist/components/tabs/Tabs.css +330 -0
- package/dist/components/tabs/Tabs.js +13 -0
- package/dist/components/tabs/Tabs.lazy.js +15 -0
- package/dist/components/tabs/Tabs.module.css +330 -0
- package/dist/components/tabs/Tabs.module.scss.js +19 -0
- package/dist/components/tabs/Tabs.server.js +11 -0
- package/dist/components/tabs/Tabs.view.js +157 -0
- package/dist/components/tabs/index.js +4 -0
- package/dist/components/tooltip/Tooltip.client.js +10 -1
- package/dist/components/tooltip/Tooltip.css +1 -0
- package/dist/components/tooltip/Tooltip.module.css +1 -0
- package/dist/constants/project.js +1 -1
- package/dist/index.js +8 -0
- package/dist/theme.css +937 -74
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/accordion/Accordion.d.ts +3 -0
- package/dist/types/components/accordion/Accordion.lazy.d.ts +3 -0
- package/dist/types/components/accordion/Accordion.model.d.ts +3 -0
- package/dist/types/components/accordion/Accordion.view.d.ts +1 -1
- package/dist/types/components/autocomplete/Autocomplete.client.d.ts +5 -0
- package/dist/types/components/autocomplete/Autocomplete.d.ts +4 -0
- package/dist/types/components/autocomplete/Autocomplete.lazy.d.ts +5 -0
- package/dist/types/components/autocomplete/Autocomplete.model.d.ts +58 -0
- package/dist/types/components/autocomplete/Autocomplete.server.d.ts +3 -0
- package/dist/types/components/autocomplete/Autocomplete.view.d.ts +3 -0
- package/dist/types/components/autocomplete/index.d.ts +2 -0
- package/dist/types/components/checkbox/Checkbox.client.d.ts +4 -0
- package/dist/types/components/checkbox/Checkbox.d.ts +18 -0
- package/dist/types/components/checkbox/Checkbox.lazy.d.ts +19 -0
- package/dist/types/components/checkbox/Checkbox.model.d.ts +23 -0
- package/dist/types/components/checkbox/Checkbox.server.d.ts +3 -0
- package/dist/types/components/checkbox/Checkbox.view.d.ts +3 -0
- package/dist/types/components/checkbox/index.d.ts +2 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.client.d.ts +4 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.d.ts +4 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.lazy.d.ts +5 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.model.d.ts +38 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.server.d.ts +3 -0
- package/dist/types/components/checkbox-group/CheckboxGroup.view.d.ts +3 -0
- package/dist/types/components/checkbox-group/index.d.ts +2 -0
- package/dist/types/components/dialog/Dialog.model.d.ts +1 -0
- package/dist/types/components/dialog/Dialog.view.d.ts +1 -1
- package/dist/types/components/tabs/Tabs.client.d.ts +5 -0
- package/dist/types/components/tabs/Tabs.d.ts +4 -0
- package/dist/types/components/tabs/Tabs.lazy.d.ts +5 -0
- package/dist/types/components/tabs/Tabs.model.d.ts +43 -0
- package/dist/types/components/tabs/Tabs.server.d.ts +3 -0
- package/dist/types/components/tabs/Tabs.view.d.ts +3 -0
- package/dist/types/components/tabs/index.d.ts +2 -0
- package/dist/types/index.d.ts +4 -0
- package/package.json +21 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/* stylelint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a rem-based value by a given pixel size.
|
|
4
|
+
*/
|
|
5
|
+
/* stylelint-disable */
|
|
6
|
+
/**
|
|
7
|
+
* Applies flex-column and gap.
|
|
8
|
+
*/
|
|
9
|
+
/*
|
|
10
|
+
As example (light, primary)
|
|
11
|
+
See defined modes in designsystem/config/gradients
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Mixin that renders a media query that target screens that are larger than the
|
|
15
|
+
* given size.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Mixin that renders a media query that target screens that are smaller than the
|
|
19
|
+
* given size.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Mixin that renders a media query that target screens in between the given range.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Mixin that renders a media query that target screens that have height larger than the
|
|
26
|
+
* given size.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Mixin that renders a media query that target screens that have height smaller than the
|
|
30
|
+
* given size.
|
|
31
|
+
*/
|
|
32
|
+
/* stylelint-disable */
|
|
33
|
+
/* M3/Elevation Light/1 */
|
|
34
|
+
/* M3/Elevation Light/2 */
|
|
35
|
+
/* M3/Elevation/5 */
|
|
36
|
+
/* M3/Elevation/1 Text */
|
|
37
|
+
/* Inner elevations */
|
|
38
|
+
/* stylelint-disable */
|
|
39
|
+
/**
|
|
40
|
+
* Visually hides an element but not removes them for screen readers.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* The inverse of the `hidden` helper to reset a previously hidden element to be
|
|
44
|
+
* visible for users.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Creates a selector for :hover effects depending on the current user input
|
|
48
|
+
* device. If the input device is a mouse, this hover effect will appear.
|
|
49
|
+
* Keyboard and touch inputs are ignored.
|
|
50
|
+
*
|
|
51
|
+
* Example usage:
|
|
52
|
+
* .link {
|
|
53
|
+
* color: blue;
|
|
54
|
+
*
|
|
55
|
+
* @include when-hovered() {
|
|
56
|
+
* color: green;
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* Creates a selector for :active effects depending on the current user input
|
|
62
|
+
* device. The state applies when the input device is a mouse or keyboard. Touch
|
|
63
|
+
* devices will not show a pressed state.
|
|
64
|
+
*
|
|
65
|
+
* Example usage:
|
|
66
|
+
* .link {
|
|
67
|
+
* box-shadow: none;
|
|
68
|
+
*
|
|
69
|
+
* @include when-pressed() {
|
|
70
|
+
* box-shadow: inset 0 2px 4px grey;
|
|
71
|
+
* }
|
|
72
|
+
* }
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Creates a selector for :focus effects depending on the current user input
|
|
76
|
+
* device. When the user navigates using a keyboard, the focus effect defined in
|
|
77
|
+
* here is applied. For other input devices they don't show up.
|
|
78
|
+
*
|
|
79
|
+
* Example usage:
|
|
80
|
+
* .link {
|
|
81
|
+
* text-decoration: none;
|
|
82
|
+
*
|
|
83
|
+
* @include when-focused() {
|
|
84
|
+
* text-decoration: underline;
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* Creates a selector for :focus-within effects depending on the current user
|
|
90
|
+
* input device. When the user navigates using a keyboard, the focus effect
|
|
91
|
+
* defined in here is applied. For other input devices they don't show up.
|
|
92
|
+
*
|
|
93
|
+
* Example usage:
|
|
94
|
+
* .link {
|
|
95
|
+
* img {
|
|
96
|
+
* opacity: 0.75;
|
|
97
|
+
*
|
|
98
|
+
* @include when-focused-within() {
|
|
99
|
+
* opacity: 1;
|
|
100
|
+
* }
|
|
101
|
+
* }
|
|
102
|
+
* }
|
|
103
|
+
*/
|
|
104
|
+
/**
|
|
105
|
+
* Wrapper for media query "prefers-reduced-motion".
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
108
|
+
* This helper hides the outline but still makes it visible for
|
|
109
|
+
* Windows high-contrast users. Use this instead of `outline: 0;`.
|
|
110
|
+
*/
|
|
111
|
+
/**
|
|
112
|
+
* This helper hides the outline but still makes it visible for
|
|
113
|
+
* Windows high-contrast users. Use this instead of `outline: 0;`.
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Renders an alternative, but application consistent focus-ring.
|
|
117
|
+
*/
|
|
118
|
+
/**
|
|
119
|
+
* Specifies the outer layout for all contents across breakpoints. Apply this
|
|
120
|
+
* mixin to the container element, to center the contents on the screen within
|
|
121
|
+
* the layout offsets.
|
|
122
|
+
*/
|
|
123
|
+
/**
|
|
124
|
+
* This mixin specifies basic text-styles for components that render a richtext
|
|
125
|
+
* content.
|
|
126
|
+
*/
|
|
127
|
+
.prokodo-Tabs {
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
.prokodo-Tabs--vertical {
|
|
131
|
+
display: grid;
|
|
132
|
+
grid-gap: 1rem;
|
|
133
|
+
gap: 1rem;
|
|
134
|
+
grid-template-columns: minmax(px-to-rem(180px), px-to-rem(260px)) 1fr;
|
|
135
|
+
}
|
|
136
|
+
.prokodo-Tabs__list {
|
|
137
|
+
align-items: stretch;
|
|
138
|
+
border-bottom: 1px solid var(--color-grey-200);
|
|
139
|
+
display: flex;
|
|
140
|
+
gap: 0;
|
|
141
|
+
overflow-x: auto;
|
|
142
|
+
padding: 0;
|
|
143
|
+
position: relative;
|
|
144
|
+
scrollbar-width: none;
|
|
145
|
+
}
|
|
146
|
+
html[data-theme=dark] .prokodo-Tabs__list {
|
|
147
|
+
border-bottom-color: var(--color-grey-700);
|
|
148
|
+
}
|
|
149
|
+
.prokodo-Tabs__list--vertical {
|
|
150
|
+
border-bottom: none;
|
|
151
|
+
border-right: 1px solid var(--color-grey-200);
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
overflow-x: visible;
|
|
154
|
+
}
|
|
155
|
+
html[data-theme=dark] .prokodo-Tabs__list--vertical {
|
|
156
|
+
border-right-color: var(--color-grey-700);
|
|
157
|
+
}
|
|
158
|
+
.prokodo-Tabs__list--disabled {
|
|
159
|
+
opacity: 0.7;
|
|
160
|
+
}
|
|
161
|
+
.prokodo-Tabs__tab {
|
|
162
|
+
align-items: center;
|
|
163
|
+
background: transparent;
|
|
164
|
+
border: none;
|
|
165
|
+
border-top-left-radius: 1.5rem;
|
|
166
|
+
border-top-right-radius: 1.5rem;
|
|
167
|
+
box-shadow: none;
|
|
168
|
+
color: var(--color-grey-700);
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
display: inline-flex;
|
|
171
|
+
gap: 0.5rem;
|
|
172
|
+
justify-content: center;
|
|
173
|
+
min-height: px-to-rem(44px);
|
|
174
|
+
padding: 0.75rem 1rem;
|
|
175
|
+
position: relative;
|
|
176
|
+
transition: background-color 160ms ease, color 160ms ease, opacity 160ms ease;
|
|
177
|
+
font-weight: 400;
|
|
178
|
+
font-size: 1.125rem;
|
|
179
|
+
font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
180
|
+
font-style: normal;
|
|
181
|
+
line-height: 1.55;
|
|
182
|
+
letter-spacing: 0.03em;
|
|
183
|
+
text-transform: none;
|
|
184
|
+
text-align: left;
|
|
185
|
+
text-decoration: none;
|
|
186
|
+
}
|
|
187
|
+
@media screen and (min-width: 480px) {
|
|
188
|
+
.prokodo-Tabs__tab {
|
|
189
|
+
font-size: 1rem;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
@media screen and (min-width: 960px) {
|
|
193
|
+
.prokodo-Tabs__tab {
|
|
194
|
+
font-size: 1rem;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
.prokodo-Tabs__tab--vertical {
|
|
198
|
+
border-top-left-radius: 0;
|
|
199
|
+
border-top-right-radius: 0;
|
|
200
|
+
}
|
|
201
|
+
.prokodo-Tabs__tab:hover {
|
|
202
|
+
background: var(--color-primary-50);
|
|
203
|
+
}
|
|
204
|
+
.prokodo-Tabs__tab:focus-visible {
|
|
205
|
+
outline: 0;
|
|
206
|
+
background: var(--color-primary-50);
|
|
207
|
+
}
|
|
208
|
+
.prokodo-Tabs__tab::after {
|
|
209
|
+
background: transparent;
|
|
210
|
+
bottom: 0;
|
|
211
|
+
content: "";
|
|
212
|
+
height: 3px;
|
|
213
|
+
left: 0;
|
|
214
|
+
position: absolute;
|
|
215
|
+
right: 0;
|
|
216
|
+
transform: scaleX(0.35);
|
|
217
|
+
transform-origin: center;
|
|
218
|
+
transition: background-color 180ms ease, transform 180ms ease;
|
|
219
|
+
}
|
|
220
|
+
.prokodo-Tabs__tab--fullWidth {
|
|
221
|
+
flex: 1 1;
|
|
222
|
+
}
|
|
223
|
+
.prokodo-Tabs__tab--selected {
|
|
224
|
+
color: var(--color-primary-900);
|
|
225
|
+
}
|
|
226
|
+
.prokodo-Tabs__tab--selected::after {
|
|
227
|
+
background: var(--gradient-border-4);
|
|
228
|
+
transform: scaleX(1);
|
|
229
|
+
}
|
|
230
|
+
.prokodo-Tabs__tab--disabled {
|
|
231
|
+
color: var(--color-grey-500);
|
|
232
|
+
cursor: not-allowed;
|
|
233
|
+
opacity: 0.58;
|
|
234
|
+
}
|
|
235
|
+
.prokodo-Tabs__tab--disabled:hover {
|
|
236
|
+
background: transparent;
|
|
237
|
+
}
|
|
238
|
+
.prokodo-Tabs__tab--disabled::after {
|
|
239
|
+
background: transparent;
|
|
240
|
+
}
|
|
241
|
+
.prokodo-Tabs__list--vertical .prokodo-Tabs__tab {
|
|
242
|
+
justify-content: flex-start;
|
|
243
|
+
text-align: left;
|
|
244
|
+
}
|
|
245
|
+
.prokodo-Tabs__list--vertical .prokodo-Tabs__tab::after {
|
|
246
|
+
bottom: 0;
|
|
247
|
+
height: auto;
|
|
248
|
+
left: 0;
|
|
249
|
+
right: auto;
|
|
250
|
+
top: 0;
|
|
251
|
+
transform: scaleY(0.35);
|
|
252
|
+
transform-origin: center;
|
|
253
|
+
width: 3px;
|
|
254
|
+
}
|
|
255
|
+
.prokodo-Tabs__list--vertical .prokodo-Tabs__tab--selected::after {
|
|
256
|
+
transform: scaleY(1);
|
|
257
|
+
}
|
|
258
|
+
.prokodo-Tabs__tabLabel {
|
|
259
|
+
display: -webkit-box;
|
|
260
|
+
-webkit-line-clamp: 1;
|
|
261
|
+
-webkit-box-orient: vertical;
|
|
262
|
+
overflow: hidden;
|
|
263
|
+
}
|
|
264
|
+
.prokodo-Tabs__badge {
|
|
265
|
+
align-items: center;
|
|
266
|
+
background: var(--color-grey-200);
|
|
267
|
+
border-radius: px-to-rem(999px);
|
|
268
|
+
color: var(--color-grey-700);
|
|
269
|
+
display: inline-flex;
|
|
270
|
+
justify-content: center;
|
|
271
|
+
min-width: px-to-rem(20px);
|
|
272
|
+
padding: 0 0.25rem;
|
|
273
|
+
font-size: px-to-rem(12px);
|
|
274
|
+
font-weight: 400;
|
|
275
|
+
font-size: 1.125rem;
|
|
276
|
+
font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
277
|
+
font-style: normal;
|
|
278
|
+
line-height: 1.55;
|
|
279
|
+
letter-spacing: 0.03em;
|
|
280
|
+
text-transform: none;
|
|
281
|
+
text-align: left;
|
|
282
|
+
text-decoration: none;
|
|
283
|
+
}
|
|
284
|
+
@media screen and (min-width: 480px) {
|
|
285
|
+
.prokodo-Tabs__badge {
|
|
286
|
+
font-size: 1rem;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
@media screen and (min-width: 960px) {
|
|
290
|
+
.prokodo-Tabs__badge {
|
|
291
|
+
font-size: 1rem;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
.prokodo-Tabs__badgeChip {
|
|
295
|
+
pointer-events: none;
|
|
296
|
+
font-weight: 400;
|
|
297
|
+
font-size: 1rem;
|
|
298
|
+
font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
299
|
+
font-style: normal;
|
|
300
|
+
line-height: 1.45;
|
|
301
|
+
letter-spacing: 0.03em;
|
|
302
|
+
text-transform: none;
|
|
303
|
+
text-align: left;
|
|
304
|
+
text-decoration: none;
|
|
305
|
+
}
|
|
306
|
+
@media screen and (min-width: 480px) {
|
|
307
|
+
.prokodo-Tabs__badgeChip {
|
|
308
|
+
font-size: 0.875rem;
|
|
309
|
+
line-height: 1.4;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
@media screen and (min-width: 960px) {
|
|
313
|
+
.prokodo-Tabs__badgeChip {
|
|
314
|
+
font-size: 0.875rem;
|
|
315
|
+
line-height: 1.4;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
.prokodo-Tabs__panel {
|
|
319
|
+
background: transparent;
|
|
320
|
+
border-radius: 0;
|
|
321
|
+
box-shadow: none;
|
|
322
|
+
padding: 1rem;
|
|
323
|
+
}
|
|
324
|
+
.prokodo-Tabs__panel[hidden] {
|
|
325
|
+
display: none !important;
|
|
326
|
+
}
|
|
327
|
+
.prokodo-Tabs__panel:focus-visible {
|
|
328
|
+
outline: 0;
|
|
329
|
+
background: var(--gradient-border-4);
|
|
330
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const styles = {
|
|
2
|
+
"prokodo-Tabs": "prokodo-Tabs",
|
|
3
|
+
"prokodo-Tabs--vertical": "prokodo-Tabs--vertical",
|
|
4
|
+
"prokodo-Tabs__list": "prokodo-Tabs__list",
|
|
5
|
+
"prokodo-Tabs__list--vertical": "prokodo-Tabs__list--vertical",
|
|
6
|
+
"prokodo-Tabs__list--disabled": "prokodo-Tabs__list--disabled",
|
|
7
|
+
"prokodo-Tabs__tab": "prokodo-Tabs__tab",
|
|
8
|
+
"prokodo-Tabs__tab--vertical": "prokodo-Tabs__tab--vertical",
|
|
9
|
+
"prokodo-Tabs__tab--fullWidth": "prokodo-Tabs__tab--fullWidth",
|
|
10
|
+
"prokodo-Tabs__tab--selected": "prokodo-Tabs__tab--selected",
|
|
11
|
+
"prokodo-Tabs__tab--disabled": "prokodo-Tabs__tab--disabled",
|
|
12
|
+
"prokodo-Tabs__tabLabel": "prokodo-Tabs__tabLabel",
|
|
13
|
+
"prokodo-Tabs__badge": "prokodo-Tabs__badge",
|
|
14
|
+
"prokodo-Tabs__badgeChip": "prokodo-Tabs__badgeChip",
|
|
15
|
+
"prokodo-Tabs__panel": "prokodo-Tabs__panel"
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
styles as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { TabsView } from "./Tabs.view.js";
|
|
5
|
+
function TabsServer(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx(TabsView, { ...props });
|
|
7
|
+
}
|
|
8
|
+
__name(TabsServer, "TabsServer");
|
|
9
|
+
export {
|
|
10
|
+
TabsServer as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { create } from "../../helpers/bem.js";
|
|
5
|
+
import styles from "./Tabs.module.scss.js";
|
|
6
|
+
import { Chip } from "../chip/Chip.js";
|
|
7
|
+
const bem = create(styles, "Tabs");
|
|
8
|
+
function getFirstEnabledValue(items) {
|
|
9
|
+
const firstEnabled = items.find((item) => item.disabled !== true);
|
|
10
|
+
return (firstEnabled == null ? void 0 : firstEnabled.value) ?? null;
|
|
11
|
+
}
|
|
12
|
+
__name(getFirstEnabledValue, "getFirstEnabledValue");
|
|
13
|
+
function resolveSelectedValue(items, value, defaultValue) {
|
|
14
|
+
const activeCandidate = value ?? defaultValue;
|
|
15
|
+
if (activeCandidate !== void 0) {
|
|
16
|
+
const isValid = items.some(
|
|
17
|
+
(item) => item.value === activeCandidate && item.disabled !== true
|
|
18
|
+
);
|
|
19
|
+
if (isValid) return activeCandidate;
|
|
20
|
+
}
|
|
21
|
+
return getFirstEnabledValue(items);
|
|
22
|
+
}
|
|
23
|
+
__name(resolveSelectedValue, "resolveSelectedValue");
|
|
24
|
+
function TabsView({
|
|
25
|
+
id,
|
|
26
|
+
ariaLabel,
|
|
27
|
+
items,
|
|
28
|
+
value,
|
|
29
|
+
defaultValue,
|
|
30
|
+
orientation = "horizontal",
|
|
31
|
+
disabled,
|
|
32
|
+
fullWidth,
|
|
33
|
+
className,
|
|
34
|
+
listClassName,
|
|
35
|
+
tabClassName,
|
|
36
|
+
panelsClassName,
|
|
37
|
+
badgeChipProps,
|
|
38
|
+
_clientState
|
|
39
|
+
}) {
|
|
40
|
+
var _a;
|
|
41
|
+
if (!(items == null ? void 0 : items.length)) return null;
|
|
42
|
+
const selectedValue = (_clientState == null ? void 0 : _clientState.activeValue) ?? resolveSelectedValue(items, value, defaultValue) ?? ((_a = items[0]) == null ? void 0 : _a.value);
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: bem(
|
|
47
|
+
void 0,
|
|
48
|
+
{
|
|
49
|
+
vertical: orientation === "vertical"
|
|
50
|
+
},
|
|
51
|
+
className
|
|
52
|
+
),
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
"aria-label": ariaLabel,
|
|
58
|
+
"aria-orientation": orientation,
|
|
59
|
+
role: "tablist",
|
|
60
|
+
className: bem(
|
|
61
|
+
"list",
|
|
62
|
+
{
|
|
63
|
+
disabled: disabled === true,
|
|
64
|
+
fullWidth: fullWidth === true,
|
|
65
|
+
vertical: orientation === "vertical"
|
|
66
|
+
},
|
|
67
|
+
listClassName
|
|
68
|
+
),
|
|
69
|
+
children: items.map((item, index) => {
|
|
70
|
+
const isDisabled = disabled === true || item.disabled === true;
|
|
71
|
+
const isSelected = item.value === selectedValue;
|
|
72
|
+
const tabId = `${id}-tab-${index}`;
|
|
73
|
+
const panelId = `${id}-panel-${index}`;
|
|
74
|
+
const mergedBadgeChipProps = {
|
|
75
|
+
variant: "outlined",
|
|
76
|
+
color: "primary",
|
|
77
|
+
...badgeChipProps,
|
|
78
|
+
...item.badgeChipProps
|
|
79
|
+
};
|
|
80
|
+
const { className: badgeChipClassName, ...restBadgeChipProps } = mergedBadgeChipProps;
|
|
81
|
+
return /* @__PURE__ */ jsxs(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
ref: /* @__PURE__ */ __name((node) => {
|
|
85
|
+
if (_clientState == null ? void 0 : _clientState.tabsRef.current) {
|
|
86
|
+
_clientState.tabsRef.current[index] = node;
|
|
87
|
+
}
|
|
88
|
+
}, "ref"),
|
|
89
|
+
"aria-controls": panelId,
|
|
90
|
+
"aria-selected": isSelected,
|
|
91
|
+
disabled: isDisabled,
|
|
92
|
+
id: tabId,
|
|
93
|
+
role: "tab",
|
|
94
|
+
tabIndex: isSelected ? 0 : -1,
|
|
95
|
+
type: "button",
|
|
96
|
+
className: bem(
|
|
97
|
+
"tab",
|
|
98
|
+
{
|
|
99
|
+
disabled: isDisabled,
|
|
100
|
+
fullWidth: fullWidth === true,
|
|
101
|
+
selected: isSelected,
|
|
102
|
+
vertical: orientation === "vertical"
|
|
103
|
+
},
|
|
104
|
+
tabClassName
|
|
105
|
+
),
|
|
106
|
+
onClick: /* @__PURE__ */ __name((event) => _clientState == null ? void 0 : _clientState.onTabClick(index, event), "onClick"),
|
|
107
|
+
onKeyDown: /* @__PURE__ */ __name((event) => _clientState == null ? void 0 : _clientState.onTabKeyDown(index, event), "onKeyDown"),
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsx("span", { className: bem("tabLabel"), children: item.label }),
|
|
110
|
+
item.badge ? /* @__PURE__ */ jsx(
|
|
111
|
+
Chip,
|
|
112
|
+
{
|
|
113
|
+
...restBadgeChipProps,
|
|
114
|
+
className: bem("badgeChip", void 0, badgeChipClassName),
|
|
115
|
+
label: item.badge
|
|
116
|
+
}
|
|
117
|
+
) : null
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
item.value
|
|
121
|
+
);
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
items.map((item, index) => {
|
|
126
|
+
const isSelected = item.value === selectedValue;
|
|
127
|
+
const tabId = `${id}-tab-${index}`;
|
|
128
|
+
const panelId = `${id}-panel-${index}`;
|
|
129
|
+
const mergedPanelClassName = [item.className, panelsClassName].filter(Boolean).join(" ");
|
|
130
|
+
return /* @__PURE__ */ jsx(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
"aria-labelledby": tabId,
|
|
134
|
+
hidden: !isSelected,
|
|
135
|
+
id: panelId,
|
|
136
|
+
role: "tabpanel",
|
|
137
|
+
tabIndex: 0,
|
|
138
|
+
className: bem(
|
|
139
|
+
"panel",
|
|
140
|
+
{
|
|
141
|
+
selected: isSelected
|
|
142
|
+
},
|
|
143
|
+
mergedPanelClassName
|
|
144
|
+
),
|
|
145
|
+
children: item.content
|
|
146
|
+
},
|
|
147
|
+
`${item.value}-panel`
|
|
148
|
+
);
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
__name(TabsView, "TabsView");
|
|
155
|
+
export {
|
|
156
|
+
TabsView
|
|
157
|
+
};
|
|
@@ -206,8 +206,10 @@ function TooltipClient(props) {
|
|
|
206
206
|
scheduleOpen();
|
|
207
207
|
} : triggerProps == null ? void 0 : triggerProps.onMouseEnter,
|
|
208
208
|
onMouseLeave: openOnHover ? (e) => {
|
|
209
|
-
var _a;
|
|
209
|
+
var _a, _b;
|
|
210
210
|
(_a = triggerProps == null ? void 0 : triggerProps.onMouseLeave) == null ? void 0 : _a.call(triggerProps, e);
|
|
211
|
+
const nextTarget = e.relatedTarget;
|
|
212
|
+
if (nextTarget && ((_b = bubbleRef.current) == null ? void 0 : _b.contains(nextTarget))) return;
|
|
211
213
|
if (anchor === "pointer") lastPointer.current = null;
|
|
212
214
|
scheduleClose();
|
|
213
215
|
} : triggerProps == null ? void 0 : triggerProps.onMouseLeave,
|
|
@@ -359,6 +361,13 @@ function TooltipClient(props) {
|
|
|
359
361
|
role: "tooltip",
|
|
360
362
|
style: bubbleStyle,
|
|
361
363
|
className: bubbleStyle ? portalBubbleClassFinal : portalBubbleClassBase,
|
|
364
|
+
onMouseEnter: openOnHover ? () => {
|
|
365
|
+
clearTimers();
|
|
366
|
+
setOpen(true);
|
|
367
|
+
} : void 0,
|
|
368
|
+
onMouseLeave: openOnHover ? () => {
|
|
369
|
+
scheduleClose();
|
|
370
|
+
} : void 0,
|
|
362
371
|
children: content
|
|
363
372
|
}
|
|
364
373
|
),
|
package/dist/index.js
CHANGED
|
@@ -2,12 +2,15 @@ import { UIRuntimeProvider, useUIRuntime } from "./helpers/runtime.client.js";
|
|
|
2
2
|
import { Accordion } from "./components/accordion/Accordion.js";
|
|
3
3
|
import { Animated } from "./components/animated/Animated.js";
|
|
4
4
|
import { AnimatedText } from "./components/animatedText/AnimatedText.js";
|
|
5
|
+
import { Autocomplete } from "./components/autocomplete/Autocomplete.js";
|
|
5
6
|
import { Avatar } from "./components/avatar/Avatar.js";
|
|
6
7
|
import { BaseLink } from "./components/base-link/BaseLink.js";
|
|
7
8
|
import { Button } from "./components/button/Button.js";
|
|
8
9
|
import { Calendly } from "./components/calendly/Calendly.js";
|
|
9
10
|
import { Card } from "./components/card/Card.js";
|
|
10
11
|
import { Carousel } from "./components/carousel/Carousel.js";
|
|
12
|
+
import { Checkbox } from "./components/checkbox/Checkbox.js";
|
|
13
|
+
import { CheckboxGroup } from "./components/checkbox-group/CheckboxGroup.js";
|
|
11
14
|
import { Chip } from "./components/chip/Chip.js";
|
|
12
15
|
import { DatePicker } from "./components/datePicker/DatePicker.js";
|
|
13
16
|
import { Dialog } from "./components/dialog/Dialog.js";
|
|
@@ -47,18 +50,22 @@ import { Snackbar } from "./components/snackbar/Snackbar.js";
|
|
|
47
50
|
import { Stepper } from "./components/stepper/Stepper.js";
|
|
48
51
|
import { Switch } from "./components/switch/Switch.js";
|
|
49
52
|
import { Table } from "./components/table/Table.js";
|
|
53
|
+
import { Tabs } from "./components/tabs/Tabs.js";
|
|
50
54
|
import { Teaser } from "./components/teaser/Teaser.js";
|
|
51
55
|
import { Tooltip } from "./components/tooltip/Tooltip.js";
|
|
52
56
|
export {
|
|
53
57
|
Accordion,
|
|
54
58
|
Animated,
|
|
55
59
|
AnimatedText,
|
|
60
|
+
Autocomplete,
|
|
56
61
|
Avatar,
|
|
57
62
|
BaseLink,
|
|
58
63
|
Button,
|
|
59
64
|
Calendly,
|
|
60
65
|
Card,
|
|
61
66
|
Carousel,
|
|
67
|
+
Checkbox,
|
|
68
|
+
CheckboxGroup,
|
|
62
69
|
Chip,
|
|
63
70
|
DatePicker,
|
|
64
71
|
Dialog,
|
|
@@ -98,6 +105,7 @@ export {
|
|
|
98
105
|
Stepper,
|
|
99
106
|
Switch,
|
|
100
107
|
Table,
|
|
108
|
+
Tabs,
|
|
101
109
|
Teaser,
|
|
102
110
|
Tooltip,
|
|
103
111
|
UIRuntimeProvider,
|