@raketa-builder/ui 0.1.0 → 0.1.1

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.
@@ -0,0 +1,1001 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/theme.js
34
+ var base = 14;
35
+ var fraction = 1.25;
36
+ var small = base / fraction;
37
+ var tiny = small / fraction;
38
+ var medium = base * fraction;
39
+ var large = medium * fraction;
40
+ var xlarge = large * fraction;
41
+ var xxlarge = xlarge * fraction;
42
+ var huge = xxlarge * fraction;
43
+ var theme = {
44
+ font: {
45
+ tiny: `${tiny}px`,
46
+ small: `${small}px`,
47
+ base: `${base}px`,
48
+ medium: `${medium}px`,
49
+ large: `${large}px`,
50
+ xlarge: `${xlarge}px`,
51
+ xxlarge: `${xxlarge}px`,
52
+ huge: `${huge}px`,
53
+ line: 1.5
54
+ },
55
+ colors: {
56
+ trueBlack: "#000",
57
+ black: "#2C2C2C",
58
+ darkerGray: "#4B4B4B",
59
+ darkGray: "#6E6E6E",
60
+ gray: "#B3B3B3",
61
+ lightGray: "#E1E1E1",
62
+ lighterGray: "#F5F5F5",
63
+ white: "#FAFAFA",
64
+ trueWhite: "#fff",
65
+ primaryDarker: "#095aba",
66
+ primaryDark: "#0d66d0",
67
+ primary: "#1473e6",
68
+ primaryRGB06: "rgba(20, 115, 230, 0.6)",
69
+ primaryLight: "#2680eb",
70
+ successDarker: "#107154",
71
+ successDark: "#12805c",
72
+ success: "#268e6c",
73
+ successLight: "#2d9d78",
74
+ dangerDarker: "#bb121a",
75
+ dangerDark: "#c9252d",
76
+ danger: "#d7373f",
77
+ dangerLight: "#e34850"
78
+ }
79
+ };
80
+ var theme_default = theme;
81
+
82
+ // src/reset.js
83
+ import { css } from "styled-components";
84
+ var reset = css`
85
+ box-sizing: border-box;
86
+ color: ${theme_default.colors.black};
87
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
88
+ Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
89
+ font-size: ${theme_default.font.base};
90
+ line-height: ${theme_default.font.line};
91
+ `;
92
+ var reset_default = reset;
93
+
94
+ // src/buttonReset.js
95
+ import { css as css2 } from "styled-components";
96
+ var buttonReset = css2`
97
+ ${reset_default};
98
+ background: none;
99
+ border: 0;
100
+ outline: 0;
101
+ cursor: pointer;
102
+ `;
103
+ var buttonReset_default = buttonReset;
104
+
105
+ // src/H.js
106
+ import styled from "styled-components";
107
+ var H_default = styled.div`
108
+ ${reset_default};
109
+ margin: 0;
110
+ padding: 0;
111
+ font-size: ${(props) => props.theme.font[props.size]};
112
+ padding-bottom: 0.5em;
113
+ `;
114
+
115
+ // src/P.js
116
+ import styled2 from "styled-components";
117
+ var P_default = styled2.p`
118
+ ${reset_default};
119
+ margin: 0;
120
+ padding: 0;
121
+ padding-bottom: 1em;
122
+ `;
123
+
124
+ // src/Button.js
125
+ import styled3 from "styled-components";
126
+ var variants = {
127
+ primary: {
128
+ border: "primary",
129
+ background: "primary",
130
+ color: "white",
131
+ hoverBorder: "primaryDark",
132
+ hoverBackground: "primaryDark",
133
+ hoverColor: "white",
134
+ activeBorder: "primaryDarker",
135
+ activeBackground: "primaryDarker",
136
+ activeColor: "white"
137
+ },
138
+ secondary: {
139
+ border: "darkerGray",
140
+ background: "white",
141
+ color: "darkerGray",
142
+ hoverBorder: "darkGray",
143
+ hoverBackground: "darkGray",
144
+ hoverColor: "white",
145
+ activeBorder: "darkerGray",
146
+ activeBackground: "darkerGray",
147
+ activeColor: "white"
148
+ },
149
+ success: {
150
+ border: "success",
151
+ background: "success",
152
+ color: "white",
153
+ hoverBorder: "successDark",
154
+ hoverBackground: "successDark",
155
+ hoverColor: "white",
156
+ activeBorder: "successDarker",
157
+ activeBackground: "successDarker",
158
+ activeColor: "white"
159
+ },
160
+ danger: {
161
+ border: "danger",
162
+ background: "danger",
163
+ color: "white",
164
+ hoverBorder: "dangerDark",
165
+ hoverBackground: "dangerDark",
166
+ hoverColor: "white",
167
+ activeBorder: "dangerDarker",
168
+ activeBackground: "dangerDarker",
169
+ activeColor: "white"
170
+ }
171
+ };
172
+ var sizes = {
173
+ sm: theme_default.font.small,
174
+ md: theme_default.font.base,
175
+ lg: theme_default.font.medium
176
+ };
177
+ var getColor = (props, variant, key) => props.theme.colors[variants[variant][key]];
178
+ var Button = styled3.button`
179
+ ${buttonReset_default};
180
+ padding: 0.5em 1em;
181
+ margin-right: 0.25em;
182
+ border: 2px solid ${(props) => getColor(props, props.variant, "border")};
183
+ border-radius: 48px;
184
+ background-color: ${(props) => getColor(props, props.variant, "background")};
185
+ color: ${(props) => getColor(props, props.variant, "color")};
186
+ font-size: ${(props) => sizes[props.size || "md"]};
187
+ font-weight: 700;
188
+ line-height: 1;
189
+ transition: 0.2s ease-in-out all;
190
+
191
+ &:focus {
192
+ border-color: ${(props) => getColor(props, props.variant, "activeBorder")};
193
+ }
194
+
195
+ &:hover {
196
+ border-color: ${(props) => getColor(props, props.variant, "hoverBorder")};
197
+ background-color: ${(props) => getColor(props, props.variant, "hoverBackground")};
198
+ color: ${(props) => getColor(props, props.variant, "hoverColor")};
199
+ }
200
+
201
+ &:active {
202
+ border-color: ${(props) => getColor(props, props.variant, "activeBorder")};
203
+ background-color: ${(props) => getColor(props, props.variant, "activeBackground")};
204
+ color: ${(props) => getColor(props, props.variant, "activeColor")};
205
+ }
206
+
207
+ &:last-of-type {
208
+ margin-right: 0;
209
+ }
210
+ `;
211
+ Button.defaultProps = {
212
+ type: "button",
213
+ variant: "primary"
214
+ };
215
+ var Button_default = Button;
216
+
217
+ // src/Tabs.js
218
+ import React from "react";
219
+ import styled4 from "styled-components";
220
+ import { jsx, jsxs } from "react/jsx-runtime";
221
+ var TabsWrapper = styled4.div`
222
+ ${reset_default};
223
+ display: inline-flex;
224
+ margin-bottom: 1em;
225
+ border-bottom: 3px solid ${(props) => props.theme.colors.lightGray};
226
+ `;
227
+ var Tab = styled4.button`
228
+ ${buttonReset_default};
229
+ position: relative;
230
+ top: 3px;
231
+ margin-right: 2em;
232
+ padding: 0 0 0.5em 0;
233
+ border-bottom: 3px solid
234
+ ${(props) => props.active ? props.theme.colors.black : "transparent"};
235
+ color: ${(props) => props.active ? props.theme.colors.black : props.theme.colors.darkGray};
236
+ font-weight: 500;
237
+
238
+ &:hover {
239
+ border-color: ${(props) => props.theme.colors.black};
240
+ }
241
+
242
+ &:last-of-type {
243
+ margin-right: 4em;
244
+ }
245
+ `;
246
+ var Tabs = ({ initial = 0, children }) => {
247
+ const [current, setCurrent] = React.useState(initial);
248
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
249
+ /* @__PURE__ */ jsx(TabsWrapper, { children: children.map((child, idx) => /* @__PURE__ */ jsx(
250
+ Tab,
251
+ {
252
+ type: "button",
253
+ active: idx === current,
254
+ onClick: () => setCurrent(idx),
255
+ children: child.props.title
256
+ },
257
+ idx
258
+ )) }),
259
+ children[current]
260
+ ] });
261
+ };
262
+ var Tabs_default = Tabs;
263
+
264
+ // src/Input.js
265
+ import styled5 from "styled-components";
266
+ var Input_default = styled5.input`
267
+ ${reset_default};
268
+ border: 0;
269
+ outline: 0;
270
+ border-radius: 4px;
271
+ border: 0;
272
+ width: 100%;
273
+ padding: 0.5em 0.75em;
274
+ border: 1px solid ${(props) => props.theme.colors.gray};
275
+ background-color: ${(props) => props.theme.colors.trueWhite};
276
+ transition: all 0.2s ease-in-out;
277
+
278
+ &:hover {
279
+ border-color: ${(props) => props.theme.colors.darkGray};
280
+ }
281
+
282
+ &:focus {
283
+ border-color: ${(props) => props.theme.colors.primary};
284
+ }
285
+ `;
286
+
287
+ // src/Textarea.js
288
+ import styled6 from "styled-components";
289
+ var Textarea_default = styled6.textarea`
290
+ ${reset_default};
291
+ border: 0;
292
+ outline: 0;
293
+ border-radius: 4px;
294
+ border: 0;
295
+ width: 100%;
296
+ height: 100px;
297
+ padding: 0.5em 0.75em;
298
+ border: 1px solid ${(props) => props.theme.colors.gray};
299
+ background-color: ${(props) => props.theme.colors.trueWhite};
300
+ transition: all 0.2s ease-in-out;
301
+
302
+ &:hover {
303
+ border-color: ${(props) => props.theme.colors.darkGray};
304
+ }
305
+
306
+ &:focus {
307
+ border-color: ${(props) => props.theme.colors.primary};
308
+ }
309
+ `;
310
+
311
+ // src/Select.js
312
+ import styled7 from "styled-components";
313
+ var Select_default = styled7.select`
314
+ ${reset_default};
315
+ -webkit-appearance: none;
316
+ -moz-appearance: none;
317
+ border: 0;
318
+ outline: 0;
319
+ border-radius: 4px;
320
+ border: 0;
321
+ width: 100%;
322
+ padding: 0.5em 0.75em;
323
+ border: 1px solid ${(props) => props.theme.colors.gray};
324
+ background-size: 16px;
325
+ background-repeat: no-repeat;
326
+ background-position: center right 0.25em;
327
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZXZyb24tZG93biI+PHBvbHlsaW5lIHBvaW50cz0iNiA5IDEyIDE1IDE4IDkiPjwvcG9seWxpbmU+PC9zdmc+);
328
+ background-color: ${(props) => props.theme.colors.trueWhite};
329
+ transition: all 0.2s ease-in-out;
330
+
331
+ &:hover {
332
+ border-color: ${(props) => props.theme.colors.darkGray};
333
+ }
334
+
335
+ &:focus {
336
+ border-color: ${(props) => props.theme.colors.primary};
337
+ }
338
+ `;
339
+
340
+ // src/FormGroup.js
341
+ import styled8 from "styled-components";
342
+ var FormGroup_default = styled8.div`
343
+ ${reset_default};
344
+ width: 100%;
345
+ margin-bottom: 1em;
346
+ `;
347
+
348
+ // src/Label.js
349
+ import styled9 from "styled-components";
350
+ var Label_default = styled9.label`
351
+ ${reset_default};
352
+ display: block;
353
+ margin-bottom: 0.25em;
354
+ color: ${(props) => props.theme.colors.darkerGray};
355
+ font-size: ${(props) => props.theme.font.small};
356
+ font-weight: 600;
357
+ cursor: pointer;
358
+ `;
359
+
360
+ // src/Field.js
361
+ import React2 from "react";
362
+
363
+ // src/Hint.js
364
+ import styled10 from "styled-components";
365
+ var Hint = styled10.div`
366
+ ${reset_default};
367
+
368
+ font-size: ${(props) => props.theme.font.small};
369
+ opacity: 0.7;
370
+ color: ${(props) => props.type === "error" && props.theme.colors.danger};
371
+ `;
372
+ var Hint_default = Hint;
373
+
374
+ // src/Field.js
375
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
376
+ var Field = (_a) => {
377
+ var _b = _a, {
378
+ as = "input",
379
+ r,
380
+ name,
381
+ label,
382
+ hint = "",
383
+ error = "",
384
+ wrapperProps
385
+ } = _b, props = __objRest(_b, [
386
+ "as",
387
+ "r",
388
+ "name",
389
+ "label",
390
+ "hint",
391
+ "error",
392
+ "wrapperProps"
393
+ ]);
394
+ const types = {
395
+ input: Input_default,
396
+ select: Select_default,
397
+ textarea: Textarea_default
398
+ };
399
+ const Component = types[as];
400
+ return /* @__PURE__ */ jsxs2(FormGroup_default, __spreadProps(__spreadValues({}, wrapperProps), { children: [
401
+ label && /* @__PURE__ */ jsx2(Label_default, { htmlFor: name, children: label }),
402
+ /* @__PURE__ */ jsx2(Component, __spreadValues({ ref: r, id: name, name }, props)),
403
+ hint && /* @__PURE__ */ jsx2(Hint_default, { children: hint }),
404
+ error && /* @__PURE__ */ jsx2(Hint_default, { type: "error", children: error })
405
+ ] }));
406
+ };
407
+ var Field_default = Field;
408
+
409
+ // src/Toolbar.js
410
+ import styled11 from "styled-components";
411
+ var Toolbar_default = styled11.div`
412
+ ${reset_default};
413
+
414
+ display: flex;
415
+ align-items: center;
416
+ gap: 0.5em;
417
+ margin-bottom: ${(props) => props.mb || 0};
418
+ `;
419
+
420
+ // src/Stack.js
421
+ import styled12 from "styled-components";
422
+ var Stack_default = styled12.div`
423
+ display: flex;
424
+ justify-content: ${(props) => props.h};
425
+ align-items: ${(props) => props.v};
426
+ gap: ${(props) => props.g};
427
+ `;
428
+
429
+ // src/Container.js
430
+ import styled13 from "styled-components";
431
+ var Container_default = styled13.div`
432
+ ${reset_default};
433
+ width: 100%;
434
+ padding: 0 calc(1em / 2);
435
+
436
+ padding-top: ${(props) => props.top && "1em"};
437
+ padding-bottom: ${(props) => props.bottom && "1em"};
438
+
439
+ @media (min-width: 1184px) {
440
+ width: 98%;
441
+ margin: 0 auto;
442
+ }
443
+ `;
444
+
445
+ // src/Panel.js
446
+ import styled14 from "styled-components";
447
+ var Panel = styled14.div`
448
+ ${reset_default};
449
+ margin-bottom: 0.5em;
450
+ border: 1px solid #ddd;
451
+ border-radius: 3px;
452
+ background-color: #fff;
453
+
454
+ &.sortable-selected {
455
+ background-color: #0a0a;
456
+ }
457
+ `;
458
+ var PanelTitle = styled14.div`
459
+ ${reset_default};
460
+ display: flex;
461
+ justify-content: space-between;
462
+ align-items: center;
463
+ padding: 0.25em 0.25em 0.25em;
464
+ border-bottom: 1px solid #ddd;
465
+ background-color: ${(props) => props.theme.colors.lighterGray};
466
+ font-weight: 700;
467
+ `;
468
+ var PanelContent = styled14.div`
469
+ padding: 1em;
470
+ `;
471
+
472
+ // src/Handle.js
473
+ import styled15 from "styled-components";
474
+ var Handle_default = styled15.div`
475
+ width: 2em;
476
+ height: 2em;
477
+ background-size: 50%;
478
+ background-repeat: no-repeat;
479
+ background-position: center;
480
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLW1vcmUtdmVydGljYWwiPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEiPjwvY2lyY2xlPjxjaXJjbGUgY3g9IjEyIiBjeT0iNSIgcj0iMSI+PC9jaXJjbGU+PGNpcmNsZSBjeD0iMTIiIGN5PSIxOSIgcj0iMSI+PC9jaXJjbGU+PC9zdmc+);
481
+ cursor: grabbing;
482
+ filter: invert(${(props) => props.active ? 1 : 0});
483
+ `;
484
+
485
+ // src/Modal.js
486
+ import React3 from "react";
487
+ import styled16 from "styled-components";
488
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
489
+ var Overlay = styled16.div`
490
+ ${reset_default};
491
+ position: fixed;
492
+ top: 0;
493
+ right: 0;
494
+ bottom: 0;
495
+ left: 0;
496
+ z-index: 11;
497
+ background-color: rgba(0, 0, 0, 0.6);
498
+ cursor: pointer;
499
+ `;
500
+ var Wrapper = styled16.div`
501
+ ${reset_default};
502
+ position: fixed;
503
+ top: 0;
504
+ right: 0;
505
+ bottom: 0;
506
+ left: 0;
507
+ z-index: 12;
508
+ display: flex;
509
+ justify-content: center;
510
+ align-items: center;
511
+ pointer-events: none;
512
+ `;
513
+ var Inner = styled16.div`
514
+ ${reset_default};
515
+ width: 80%;
516
+ border-radius: 5px;
517
+ background-color: ${(props) => props.theme.colors.lighterGray};
518
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
519
+ pointer-events: all;
520
+ `;
521
+ var TitleBar = styled16.div`
522
+ ${reset_default};
523
+ display: flex;
524
+ justify-content: space-between;
525
+ align-items: center;
526
+ padding: 1em;
527
+ border-bottom: 2px solid ${(props) => props.theme.colors.lightGray};
528
+ `;
529
+ var Title = styled16.div`
530
+ ${reset_default};
531
+ font-size: 1.25em;
532
+ font-weight: 500;
533
+ `;
534
+ var CloseButton = styled16.button`
535
+ ${buttonReset_default};
536
+ position: relative;
537
+ right: -4px;
538
+ z-index: 13;
539
+ width: 2em;
540
+ height: 2em;
541
+ margin: 0;
542
+ padding: 0;
543
+ background-repeat: no-repeat;
544
+ background-size: 80%;
545
+ background-position: center;
546
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLXgiPjxsaW5lIHgxPSIxOCIgeTE9IjYiIHgyPSI2IiB5Mj0iMTgiPjwvbGluZT48bGluZSB4MT0iNiIgeTE9IjYiIHgyPSIxOCIgeTI9IjE4Ij48L2xpbmU+PC9zdmc+);
547
+ font-size: 1em;
548
+ overflow: hidden;
549
+ text-indent: -9999px;
550
+ `;
551
+ var Content = styled16.div`
552
+ ${reset_default};
553
+ padding: 0.5em 1em 1em 1em;
554
+ `;
555
+ var Modal = ({ title, children, onClose }) => {
556
+ const handleKeyUp = ({ key }) => {
557
+ if (key === "Escape")
558
+ onClose();
559
+ };
560
+ React3.useEffect(() => {
561
+ document.addEventListener("keyup", handleKeyUp);
562
+ return () => {
563
+ document.removeEventListener("keyup", handleKeyUp);
564
+ };
565
+ });
566
+ return /* @__PURE__ */ jsxs3(React3.Fragment, { children: [
567
+ /* @__PURE__ */ jsx3(Overlay, { onClick: onClose }),
568
+ /* @__PURE__ */ jsx3(Wrapper, { children: /* @__PURE__ */ jsxs3(Inner, { children: [
569
+ /* @__PURE__ */ jsxs3(TitleBar, { children: [
570
+ /* @__PURE__ */ jsx3(Title, { children: title }),
571
+ /* @__PURE__ */ jsx3(CloseButton, { type: "button", onClick: onClose, children: "\xD7" })
572
+ ] }),
573
+ /* @__PURE__ */ jsx3(Content, { children })
574
+ ] }) })
575
+ ] });
576
+ };
577
+ var Modal_default = Modal;
578
+
579
+ // src/DataGrid.js
580
+ import React4 from "react";
581
+ import styled17 from "styled-components";
582
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
583
+ var Wrapper2 = styled17.div`
584
+ ${reset_default}
585
+
586
+ table {
587
+ border-collapse: collapse;
588
+ width: 100%;
589
+ margin-bottom: 1em;
590
+
591
+ th,
592
+ td {
593
+ padding: 0.5em;
594
+ text-align: left;
595
+ }
596
+
597
+ tr {
598
+ border-bottom: 1px solid ${(props) => props.theme.colors.lightGray};
599
+ transition: all 0.3s ease-in-out;
600
+ }
601
+
602
+ a {
603
+ color: ${(props) => props.theme.colors.primary};
604
+ }
605
+
606
+ tbody {
607
+ tr {
608
+ &:hover {
609
+ border-color: ${(props) => props.theme.colors.gray};
610
+
611
+ td {
612
+ background-color: ${(props) => props.theme.colors.lighterGray};
613
+ }
614
+ }
615
+ }
616
+ }
617
+
618
+ .actions {
619
+ width: 50px;
620
+ white-space: nowrap;
621
+
622
+ div:first-of-type {
623
+ display: flex;
624
+ align-items: center;
625
+ }
626
+
627
+ a,
628
+ button {
629
+ margin-left: 0.5em;
630
+ }
631
+ }
632
+ }
633
+ `;
634
+ var DataGrid = ({ list, header, row }) => /* @__PURE__ */ jsx4(Wrapper2, { children: /* @__PURE__ */ jsxs4("table", { children: [
635
+ /* @__PURE__ */ jsx4("thead", { children: /* @__PURE__ */ jsx4("tr", { children: header() }) }),
636
+ /* @__PURE__ */ jsx4("tbody", { children: list.map((item, idx) => /* @__PURE__ */ jsx4("tr", { children: row(item) }, item.id || idx)) })
637
+ ] }) });
638
+ var DataGrid_default = DataGrid;
639
+
640
+ // src/Grid.js
641
+ import styled18 from "styled-components";
642
+ var Row = styled18.div`
643
+ ${reset_default};
644
+
645
+ @media (min-width: 1184px) {
646
+ display: grid;
647
+ grid-template-columns: repeat(12, 1fr);
648
+ grid-column-gap: ${(props) => props.gutter || "1em"};
649
+ grid-row-gap: ${(props) => props.gutter || "1em"};
650
+ margin: 0;
651
+ }
652
+ `;
653
+ var Col = styled18.div`
654
+ ${reset_default};
655
+
656
+ grid-column: span ${(props) => props.s || 12};
657
+ `;
658
+ var getShift = (s) => {
659
+ const SHIFTS = {
660
+ 1: "2 / span 10",
661
+ 2: "3 / span 8",
662
+ 3: "4 / span 6"
663
+ };
664
+ return SHIFTS[s];
665
+ };
666
+ var Shift = styled18.div`
667
+ ${reset_default};
668
+
669
+ grid-column: ${(props) => getShift(props.s)};
670
+ `;
671
+
672
+ // src/Navigation.js
673
+ import styled19 from "styled-components";
674
+ var Navigation = styled19.div`
675
+ ${reset_default};
676
+
677
+ position: fixed;
678
+ top: 0;
679
+ bottom: 0;
680
+ left: 0;
681
+ display: flex;
682
+ gap: 8px;
683
+ flex-direction: column;
684
+ align-items: center;
685
+ width: 64px;
686
+ padding: 8px 0;
687
+ background-color: ${(props) => props.theme.colors.black};
688
+ `;
689
+ var NavItem = styled19.div`
690
+ ${reset_default};
691
+
692
+ width: 48px;
693
+ height: 48px;
694
+ border-radius: 4px;
695
+ background-color: ${(props) => props.active ? props.theme.colors.darkerGray : "transparent"};
696
+ transition: all 0.2s ease-in-out;
697
+
698
+ &:hover {
699
+ background-color: ${(props) => props.theme.colors.darkerGray};
700
+ }
701
+
702
+ a,
703
+ button {
704
+ display: flex;
705
+ justify-content: center;
706
+ align-items: center;
707
+ width: 100%;
708
+ height: 100%;
709
+ }
710
+ `;
711
+
712
+ // src/PageTitle.js
713
+ import React5 from "react";
714
+ import styled20 from "styled-components";
715
+ import { jsx as jsx5 } from "react/jsx-runtime";
716
+ var Wrapper3 = styled20.div`
717
+ ${reset_default};
718
+
719
+ margin: 1em 0;
720
+ `;
721
+ var PageTitle = ({ children }) => /* @__PURE__ */ jsx5(Wrapper3, { children: /* @__PURE__ */ jsx5(
722
+ H_default,
723
+ {
724
+ as: "h1",
725
+ size: "xlarge",
726
+ style: { fontFamily: "sans-serif", fontWeight: 700 },
727
+ children
728
+ }
729
+ ) });
730
+ var PageTitle_default = PageTitle;
731
+
732
+ // src/Pagination.js
733
+ import React6 from "react";
734
+ import styled21 from "styled-components";
735
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
736
+ var Wrapper4 = styled21.div`
737
+ ${reset_default}
738
+
739
+ display: flex;
740
+ justify-content: center;
741
+ flex-wrap: wrap;
742
+ gap: 0.25em;
743
+ padding: 1em 0 1em 0;
744
+
745
+ a,
746
+ span {
747
+ display: block;
748
+ min-width: 1.25em;
749
+ padding: 0.5em 0.75em;
750
+ font-weight: 500;
751
+ text-align: center;
752
+ }
753
+
754
+ a {
755
+ color: ${(props) => props.theme.colors.primary};
756
+ border: 1px solid ${(props) => props.theme.colors.lightGray};
757
+ border-radius: 4px;
758
+ transition: all 0.2s ease-in-out;
759
+
760
+ &:hover {
761
+ border-color: ${(props) => props.theme.colors.primary};
762
+ background-color: ${(props) => props.theme.colors.primary};
763
+ color: ${(props) => props.theme.colors.white};
764
+ }
765
+ }
766
+ `;
767
+ var Prev = ({ LinkComponent, router, currentPage }) => {
768
+ if (currentPage === 1) {
769
+ return /* @__PURE__ */ jsx6("span", { children: "Previous" });
770
+ }
771
+ return /* @__PURE__ */ jsx6(
772
+ LinkComponent,
773
+ {
774
+ href: {
775
+ pathname: router.pathname,
776
+ query: __spreadValues(__spreadValues({}, router.query), { page: currentPage - 1 })
777
+ },
778
+ children: /* @__PURE__ */ jsx6("a", { children: "Previous" })
779
+ }
780
+ );
781
+ };
782
+ var Next = ({ currentPage, pagesCount, LinkComponent, router }) => {
783
+ if (currentPage === pagesCount) {
784
+ return /* @__PURE__ */ jsx6("span", { children: "Next" });
785
+ }
786
+ return /* @__PURE__ */ jsx6(
787
+ LinkComponent,
788
+ {
789
+ href: {
790
+ pathname: router.pathname,
791
+ query: __spreadValues(__spreadValues({}, router.query), { page: currentPage + 1 })
792
+ },
793
+ children: /* @__PURE__ */ jsx6("a", { children: "Next" })
794
+ }
795
+ );
796
+ };
797
+ var Pagination = ({ pagination, LinkComponent, router }) => {
798
+ const { currentPage, pagesCount } = pagination;
799
+ const pages = Array(pagesCount).fill(1);
800
+ if (pagesCount <= 1 || router === null) {
801
+ return "";
802
+ }
803
+ return /* @__PURE__ */ jsxs5(Wrapper4, { children: [
804
+ /* @__PURE__ */ jsx6(
805
+ Prev,
806
+ {
807
+ LinkComponent,
808
+ router,
809
+ currentPage
810
+ }
811
+ ),
812
+ pages.map((_, idx) => {
813
+ const pageNum = idx + 1;
814
+ if (pageNum === currentPage) {
815
+ return /* @__PURE__ */ jsx6("span", { children: pageNum }, pageNum);
816
+ } else {
817
+ return /* @__PURE__ */ jsx6(
818
+ LinkComponent,
819
+ {
820
+ href: {
821
+ pathname: router.pathname,
822
+ query: __spreadValues(__spreadValues({}, router.query), { page: pageNum })
823
+ },
824
+ children: /* @__PURE__ */ jsx6("a", { children: pageNum })
825
+ },
826
+ pageNum
827
+ );
828
+ }
829
+ }),
830
+ /* @__PURE__ */ jsx6(
831
+ Next,
832
+ {
833
+ LinkComponent,
834
+ router,
835
+ currentPage,
836
+ pagesCount
837
+ }
838
+ )
839
+ ] });
840
+ };
841
+ var Pagination_default = Pagination;
842
+
843
+ // src/LanguageSwitcher.js
844
+ import React7 from "react";
845
+ import styled22 from "styled-components";
846
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
847
+ var LanguageSwitcherWrapper = styled22.div`
848
+ ${reset_default};
849
+ position: relative;
850
+ display: flex;
851
+ flex-wrap: nowrap;
852
+ width: 100%;
853
+ height: 100%;
854
+ color: #fff;
855
+
856
+ &:hover {
857
+ [data-switcher] {
858
+ left: 48px;
859
+ opacity: 1;
860
+ }
861
+ }
862
+ `;
863
+ var LanguageSwitcherMenu = styled22.div`
864
+ ${reset_default};
865
+ position: absolute;
866
+ z-index: 9;
867
+ left: -1000px;
868
+ display: flex;
869
+ flex-wrap: nowrap;
870
+ height: 100%;
871
+ background-color: ${(props) => props.theme.colors.trueBlack};
872
+ opacity: 0;
873
+ transition: all ease-in-out 0.3s;
874
+ `;
875
+ var LanguageSwitcherItem = styled22.div`
876
+ ${reset_default};
877
+ display: flex;
878
+ justify-content: center;
879
+ align-items: center;
880
+ width: 48px;
881
+ height: 48px;
882
+ background-color: ${(props) => props.theme.colors.trueBlack};
883
+ text-transform: uppercase;
884
+
885
+ a {
886
+ color: ${(props) => props.theme.colors.trueWhite};
887
+ font-weight: 500;
888
+ text-decoration: none;
889
+
890
+ :hover {
891
+ background-color: ${(props) => props.theme.colors.primaryRGB06};
892
+ }
893
+ }
894
+ `;
895
+ var LanguageSwitcherNewItem = styled22.div`
896
+ ${reset_default};
897
+ position: relative;
898
+ width: 48px;
899
+ height: 48px;
900
+ background-color: ${(props) => props.theme.colors.trueBlack};
901
+ text-transform: uppercase;
902
+
903
+ span {
904
+ display: flex;
905
+ justify-content: center;
906
+ align-items: center;
907
+ width: 100%;
908
+ height: 100%;
909
+ opacity: 0.6;
910
+
911
+ color: ${(props) => props.theme.colors.trueWhite};
912
+ font-weight: 500;
913
+ text-decoration: none;
914
+ }
915
+
916
+ a {
917
+ position: absolute;
918
+ top: 0;
919
+ bottom: 0;
920
+ left: 0;
921
+ right: 0;
922
+ z-index: 3;
923
+
924
+ color: ${(props) => props.theme.colors.trueWhite};
925
+ font-weight: 700;
926
+ text-decoration: none;
927
+
928
+ :hover {
929
+ background-color: ${(props) => props.theme.colors.primaryRGB06};
930
+ }
931
+ }
932
+ `;
933
+ var LanguageSwitcherCurrent = styled22.div`
934
+ ${reset_default};
935
+ position: relative;
936
+ z-index: 10;
937
+ display: flex;
938
+ justify-content: center;
939
+ align-items: center;
940
+ width: 100%;
941
+ height: 100%;
942
+ border-radius: 4px;
943
+ background-color: ${(props) => props.theme.colors.primary};
944
+ text-transform: uppercase;
945
+ cursor: pointer;
946
+ `;
947
+ var LanguageSwitcherItemComponent = ({ path, label }) => /* @__PURE__ */ jsx7(LanguageSwitcherItem, { children: /* @__PURE__ */ jsx7("a", { href: path, children: label }) });
948
+ var LanguageSwitcherNewItemComponent = ({ path, label }) => /* @__PURE__ */ jsxs6(LanguageSwitcherNewItem, { children: [
949
+ /* @__PURE__ */ jsx7("span", { children: label }),
950
+ /* @__PURE__ */ jsx7("a", { href: path, children: "+" })
951
+ ] });
952
+ var LanguageSwitcher = ({ current, navigation }) => {
953
+ return /* @__PURE__ */ jsxs6(LanguageSwitcherWrapper, { children: [
954
+ /* @__PURE__ */ jsx7(LanguageSwitcherCurrent, { children: current }),
955
+ /* @__PURE__ */ jsx7(LanguageSwitcherMenu, { "data-switcher": true, children: navigation.map((navItem, idx) => {
956
+ const LinkComponent = navItem.newItem ? LanguageSwitcherNewItemComponent : LanguageSwitcherItemComponent;
957
+ return /* @__PURE__ */ jsx7(
958
+ LinkComponent,
959
+ {
960
+ path: navItem.path,
961
+ label: navItem.label
962
+ },
963
+ idx
964
+ );
965
+ }) })
966
+ ] });
967
+ };
968
+ var LanguageSwitcher_default = LanguageSwitcher;
969
+ export {
970
+ Button_default as Button,
971
+ Col,
972
+ Container_default as Container,
973
+ DataGrid_default as DataGrid,
974
+ Field_default as Field,
975
+ FormGroup_default as FormGroup,
976
+ H_default as H,
977
+ Handle_default as Handle,
978
+ Hint_default as Hint,
979
+ Input_default as Input,
980
+ Label_default as Label,
981
+ LanguageSwitcher_default as LanguageSwitcher,
982
+ Modal_default as Modal,
983
+ NavItem,
984
+ Navigation,
985
+ P_default as P,
986
+ PageTitle_default as PageTitle,
987
+ Pagination_default as Pagination,
988
+ Panel,
989
+ PanelContent,
990
+ PanelTitle,
991
+ Row,
992
+ Select_default as Select,
993
+ Shift,
994
+ Stack_default as Stack,
995
+ Tabs_default as Tabs,
996
+ Textarea_default as Textarea,
997
+ Toolbar_default as Toolbar,
998
+ buttonReset_default as buttonReset,
999
+ reset_default as reset,
1000
+ theme_default as theme
1001
+ };