@raketa-builder/ui 0.5.0 → 0.7.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.
@@ -1,8 +1,11 @@
1
- $ tsup src/index.js --format cjs --loader ".js=jsx"
1
+
2
+ > @raketa-builder/ui@0.7.0 build
3
+ > tsup src/index.js --format cjs --loader ".js=jsx"
4
+
2
5
  CLI Building entry: src/index.js
3
6
  CLI Using tsconfig: tsconfig.json
4
7
  CLI tsup v6.5.0
5
8
  CLI Target: es6
6
9
  CJS Build start
7
- CJS dist/index.js 27.61 KB
8
- CJS ⚡️ Build success in 175ms
10
+ CJS dist/index.js 28.15 KB
11
+ CJS ⚡️ Build success in 298ms
@@ -0,0 +1,38 @@
1
+
2
+ > @raketa-builder/ui@0.6.0 format
3
+ > prettier --write .
4
+
5
+ biome.json 378ms (unchanged)
6
+ CHANGELOG.md 371ms (unchanged)
7
+ dist/index.js 2514ms
8
+ package.json 32ms (unchanged)
9
+ src/Button.jsx 50ms
10
+ src/cn.js 4ms (unchanged)
11
+ src/Container.jsx 7ms (unchanged)
12
+ src/DataGrid.jsx 61ms (unchanged)
13
+ src/DefaultAvatar.jsx 81ms (unchanged)
14
+ src/Field.jsx 128ms (unchanged)
15
+ src/FormGroup.jsx 4ms (unchanged)
16
+ src/Grid.jsx 40ms (unchanged)
17
+ src/H.jsx 58ms (unchanged)
18
+ src/Handle.jsx 6ms (unchanged)
19
+ src/Hint.jsx 4ms
20
+ src/ImageAvatar.jsx 18ms (unchanged)
21
+ src/index.js 43ms (unchanged)
22
+ src/Input.jsx 8ms (unchanged)
23
+ src/Label.jsx 3ms (unchanged)
24
+ src/LanguageSwitcher.jsx 126ms (unchanged)
25
+ src/Modal.jsx 147ms (unchanged)
26
+ src/Navigation.jsx 67ms
27
+ src/P.jsx 7ms (unchanged)
28
+ src/PageTitle.jsx 6ms (unchanged)
29
+ src/Pagination.jsx 72ms (unchanged)
30
+ src/Panel.jsx 17ms (unchanged)
31
+ src/Select.jsx 3ms (unchanged)
32
+ src/Stack.jsx 3ms (unchanged)
33
+ src/styles.css 1290ms
34
+ src/Tabs.jsx 97ms
35
+ src/Textarea.jsx 2ms (unchanged)
36
+ src/theme.js 26ms (unchanged)
37
+ src/Toolbar.jsx 21ms (unchanged)
38
+ tsconfig.json 26ms
@@ -1,13 +1,4 @@
1
- $ TIMING=1 eslint "**/*.js"
2
- Rule | Time (ms) | Relative
3
- :------------------------------|----------:|--------:
4
- react/no-direct-mutation-state | 224.448 | 32.5%
5
- react/display-name | 193.592 | 28.1%
6
- react/require-render-return | 126.812 | 18.4%
7
- react/no-is-mounted | 32.734 | 4.7%
8
- react/no-unescaped-entities | 26.523 | 3.8%
9
- react/no-deprecated | 18.055 | 2.6%
10
- react/no-children-prop | 13.340 | 1.9%
11
- react-hooks/exhaustive-deps | 12.323 | 1.8%
12
- @next/next/no-page-custom-font | 10.972 | 1.6%
13
- turbo/no-undeclared-env-vars | 10.263 | 1.5%
1
+
2
+ > @raketa-builder/ui@0.6.0 lint
3
+ > biome lint --max-diagnostics=5000 .
4
+
package/biome.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": ["../../biome.json"]
3
+ }
package/dist/index.js CHANGED
@@ -173,7 +173,7 @@ var P_default = P;
173
173
  var import_react3 = __toESM(require("react"));
174
174
  var import_jsx_runtime3 = require("react/jsx-runtime");
175
175
  var Button = (_a) => {
176
- var _b = _a, { as = "button", size, variant, className } = _b, props = __objRest(_b, ["as", "size", "variant", "className"]);
176
+ var _b = _a, { as = "button", size, variant, className } = _b, rest = __objRest(_b, ["as", "size", "variant", "className"]);
177
177
  const Component = as;
178
178
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
179
179
  Component,
@@ -186,7 +186,7 @@ var Button = (_a) => {
186
186
  `r-button-${variant}`,
187
187
  className
188
188
  )
189
- }, props)
189
+ }, rest)
190
190
  );
191
191
  };
192
192
  Button.defaultProps = {
@@ -243,8 +243,8 @@ var Tabs_default = Tabs;
243
243
  var import_react5 = __toESM(require("react"));
244
244
  var import_jsx_runtime5 = require("react/jsx-runtime");
245
245
  var Input = (_a) => {
246
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
247
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", __spreadValues({ className: cn("r-reset", "r-input", className) }, props));
246
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
247
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", __spreadValues({ className: cn("r-reset", "r-input", className) }, rest));
248
248
  };
249
249
  var Input_default = Input;
250
250
 
@@ -441,11 +441,28 @@ var CloseButton = (_a) => {
441
441
  }, props)
442
442
  );
443
443
  };
444
+ var FooterBar = (_a) => {
445
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
446
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", __spreadValues({ className: cn("r-reset", "r-modal-footer-bar", className) }, props));
447
+ };
444
448
  var Content = (_a) => {
445
449
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
446
450
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", __spreadValues({ className: cn("r-reset", "r-modal-content", className) }, props));
447
451
  };
448
- var Modal = ({ title, children, onClose }) => {
452
+ var Modal = (_a) => {
453
+ var _b = _a, {
454
+ title,
455
+ children,
456
+ customWrapper,
457
+ FooterContent,
458
+ onClose
459
+ } = _b, rest = __objRest(_b, [
460
+ "title",
461
+ "children",
462
+ "customWrapper",
463
+ "FooterContent",
464
+ "onClose"
465
+ ]);
449
466
  const handleKeyUp = ({ key }) => {
450
467
  if (key === "Escape")
451
468
  onClose();
@@ -456,15 +473,17 @@ var Modal = ({ title, children, onClose }) => {
456
473
  document.removeEventListener("keyup", handleKeyUp);
457
474
  };
458
475
  });
476
+ const ModalWrapper = customWrapper ? customWrapper : Wrapper;
459
477
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react17.default.Fragment, { children: [
460
478
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Overlay, { onClick: onClose }),
461
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Wrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Inner, { children: [
479
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ModalWrapper, __spreadProps(__spreadValues({}, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Inner, { children: [
462
480
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(TitleBar, { children: [
463
481
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Title, { children: title }),
464
482
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CloseButton, { type: "button", onClick: onClose, children: "\xD7" })
465
483
  ] }),
466
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Content, { children })
467
- ] }) })
484
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Content, { children }),
485
+ FooterContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FooterContent, {}) })
486
+ ] }) }))
468
487
  ] });
469
488
  };
470
489
  var Modal_default = Modal;
package/package.json CHANGED
@@ -1,23 +1,24 @@
1
1
  {
2
2
  "name": "@raketa-builder/ui",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
7
7
  "scripts": {
8
- "lint": "TIMING=1 eslint \"**/*.js\"",
9
8
  "build": "tsup src/index.js --format cjs --loader \".js=jsx\"",
10
- "dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch"
9
+ "dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch",
10
+ "format": "prettier --write .",
11
+ "lint": "biome lint --max-diagnostics=5000 ."
11
12
  },
12
13
  "peerDependencies": {
13
14
  "react": "18.2.0",
14
15
  "react-dom": "18.2.0"
15
16
  },
16
17
  "devDependencies": {
18
+ "@biomejs/biome": "1.5.2",
17
19
  "@types/react": "17.0.37",
18
20
  "@types/react-dom": "17.0.11",
19
- "eslint": "7.32.0",
20
- "eslint-config-custom": "*",
21
+ "prettier": "3.2.4",
21
22
  "react": "18.2.0",
22
23
  "tsconfig": "*",
23
24
  "tsup": "6.5.0",
package/src/Button.jsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import cn from "./cn";
3
3
 
4
- const Button = ({ as = "button", size, variant, className, ...props }) => {
4
+ const Button = ({ as = "button", size, variant, className, ...rest }) => {
5
5
  const Component = as;
6
6
 
7
7
  return (
@@ -12,9 +12,9 @@ const Button = ({ as = "button", size, variant, className, ...props }) => {
12
12
  "r-button",
13
13
  `r-button-${size}`,
14
14
  `r-button-${variant}`,
15
- className
15
+ className,
16
16
  )}
17
- {...props}
17
+ {...rest}
18
18
  />
19
19
  );
20
20
  };
package/src/Hint.jsx CHANGED
@@ -7,7 +7,7 @@ const Hint = ({ type, className, ...props }) => (
7
7
  "r-reset",
8
8
  "r-fs-small r-hint",
9
9
  className,
10
- type === "error" && "r-hint-error"
10
+ type === "error" && "r-hint-error",
11
11
  )}
12
12
  {...props}
13
13
  />
package/src/Input.jsx CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
2
  import cn from "./cn";
3
3
 
4
- const Input = ({ className, ...props }) => (
5
- <input className={cn("r-reset", "r-input", className)} {...props} />
4
+ const Input = ({ className, ...rest }) => (
5
+ <input className={cn("r-reset", "r-input", className)} {...rest} />
6
6
  );
7
7
 
8
8
  export default Input;
package/src/Modal.jsx CHANGED
@@ -28,11 +28,22 @@ const CloseButton = ({ className, ...props }) => (
28
28
  />
29
29
  );
30
30
 
31
+ const FooterBar = ({ className, ...props }) => (
32
+ <div className={cn("r-reset", "r-modal-footer-bar", className)} {...props} />
33
+ );
34
+
31
35
  const Content = ({ className, ...props }) => (
32
36
  <div className={cn("r-reset", "r-modal-content", className)} {...props} />
33
37
  );
34
38
 
35
- const Modal = ({ title, children, onClose }) => {
39
+ const Modal = ({
40
+ title,
41
+ children,
42
+ customWrapper,
43
+ FooterContent,
44
+ onClose,
45
+ ...rest
46
+ }) => {
36
47
  const handleKeyUp = ({ key }) => {
37
48
  if (key === "Escape") onClose();
38
49
  };
@@ -45,11 +56,13 @@ const Modal = ({ title, children, onClose }) => {
45
56
  };
46
57
  });
47
58
 
59
+ const ModalWrapper = customWrapper ? customWrapper : Wrapper;
60
+
48
61
  return (
49
62
  <React.Fragment>
50
63
  <Overlay onClick={onClose} />
51
64
 
52
- <Wrapper>
65
+ <ModalWrapper {...rest}>
53
66
  <Inner>
54
67
  <TitleBar>
55
68
  <Title>{title}</Title>
@@ -59,8 +72,14 @@ const Modal = ({ title, children, onClose }) => {
59
72
  </TitleBar>
60
73
 
61
74
  <Content>{children}</Content>
75
+
76
+ {FooterContent && (
77
+ <FooterBar>
78
+ <FooterContent />
79
+ </FooterBar>
80
+ )}
62
81
  </Inner>
63
- </Wrapper>
82
+ </ModalWrapper>
64
83
  </React.Fragment>
65
84
  );
66
85
  };
@@ -11,7 +11,7 @@ const NavItem = ({ active, className, ...props }) => (
11
11
  "r-reset",
12
12
  "r-navigation-item",
13
13
  active ? "r-navigation-item-active" : "",
14
- className
14
+ className,
15
15
  )}
16
16
  {...props}
17
17
  />
package/src/Tabs.jsx CHANGED
@@ -9,7 +9,7 @@ const Tab = ({ active, className, ...props }) => (
9
9
  <button
10
10
  className={cn(
11
11
  `r-reset-button r-tab-button ${active ? "r-tab-button-active" : ""}`,
12
- className
12
+ className,
13
13
  )}
14
14
  {...props}
15
15
  ></button>
package/src/styles.css CHANGED
@@ -31,8 +31,17 @@
31
31
  margin: 0;
32
32
  padding: 0;
33
33
  color: var(--r-black);
34
- font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
35
- Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
34
+ font-family:
35
+ system-ui,
36
+ -apple-system,
37
+ BlinkMacSystemFont,
38
+ "Segoe UI",
39
+ Roboto,
40
+ Oxygen,
41
+ Ubuntu,
42
+ Cantarell,
43
+ "Open Sans",
44
+ "Helvetica Neue",
36
45
  sans-serif;
37
46
  font-size: 14px;
38
47
  line-height: 1;
@@ -234,6 +243,7 @@
234
243
  width: 100%;
235
244
  height: 100%;
236
245
  }
246
+
237
247
  .r-navigation-item:hover {
238
248
  background-color: var(--r-darker-gray);
239
249
  }
@@ -254,9 +264,11 @@
254
264
  .r-panel .sortable-selected {
255
265
  background-color: var(--r-dark-green);
256
266
  }
267
+
257
268
  .r-panel-content {
258
269
  padding: 1em;
259
270
  }
271
+
260
272
  .r-panel-title {
261
273
  display: flex;
262
274
  justify-content: space-between;
@@ -286,6 +298,43 @@
286
298
  border-color: var(--r-primary);
287
299
  }
288
300
 
301
+ input.r-input[type="radio"] {
302
+ appearance: none;
303
+ width: 1rem;
304
+ height: 1rem;
305
+ padding: 0;
306
+ margin: 0;
307
+ border: 2px solid var(--r-black);
308
+ background-color: transparent;
309
+ outline: none;
310
+ border-radius: 50%;
311
+ transition: all 0.2s ease-in-out;
312
+ cursor: pointer;
313
+ }
314
+
315
+ input.r-input[type="radio"]:focus {
316
+ border: 2px solid var(--r-primary);
317
+ }
318
+
319
+ input.r-input[type="radio"]:checked {
320
+ position: relative;
321
+ border: 2px solid var(--r-primary);
322
+ color: var(--r-primary);
323
+ background: transparent;
324
+ }
325
+
326
+ input.r-input[type="radio"]:checked:after {
327
+ content: "";
328
+ position: absolute;
329
+ left: 50%;
330
+ top: 50%;
331
+ transform: translate(-50%, -50%);
332
+ width: 0.5rem;
333
+ height: 0.5rem;
334
+ border-radius: 50%;
335
+ background: var(--r-primary);
336
+ }
337
+
289
338
  .r-select {
290
339
  background-size: 16px;
291
340
  background-repeat: no-repeat;
@@ -387,7 +436,7 @@
387
436
 
388
437
  .r-stack {
389
438
  display: flex;
390
- gap: 1rem;
439
+ gap: 0.5rem;
391
440
  }
392
441
 
393
442
  .r-stack-justify-beteen {
@@ -502,6 +551,7 @@
502
551
  opacity: 0;
503
552
  transition: all ease-in-out 0.3s;
504
553
  }
554
+
505
555
  .r-language-item {
506
556
  display: flex;
507
557
  justify-content: center;
@@ -511,9 +561,11 @@
511
561
  background-color: var(--r-true-black);
512
562
  text-transform: uppercase;
513
563
  }
564
+
514
565
  .r-language-item a:hover {
515
566
  background-color: var(--r-primaryRGB06);
516
567
  }
568
+
517
569
  .r-language-item a {
518
570
  color: var(--r-true-white);
519
571
  font-weight: 500;
@@ -539,6 +591,7 @@
539
591
  font-weight: 700;
540
592
  text-decoration: none;
541
593
  }
594
+
542
595
  .r-language-new-item a:hover {
543
596
  background-color: var(--r-primaryRGB06);
544
597
  }
@@ -554,6 +607,7 @@
554
607
  font-weight: 500;
555
608
  text-decoration: none;
556
609
  }
610
+
557
611
  .r-language-current-item {
558
612
  position: relative;
559
613
  z-index: 100;
@@ -582,6 +636,7 @@
582
636
  align-items: center;
583
637
  pointer-events: none;
584
638
  }
639
+
585
640
  .r-modal-overlay {
586
641
  position: fixed;
587
642
  top: 0;
@@ -592,6 +647,7 @@
592
647
  background-color: rgba(0, 0, 0, 0.6);
593
648
  cursor: pointer;
594
649
  }
650
+
595
651
  .r-modal-inner {
596
652
  width: 80%;
597
653
  border-radius: 5px;
@@ -599,13 +655,16 @@
599
655
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
600
656
  pointer-events: all;
601
657
  }
658
+
602
659
  .r-modal-content {
603
660
  padding: 0.5em 1em 1em 1em;
604
661
  }
662
+
605
663
  .r-modal-title {
606
664
  font-size: 1.25em;
607
665
  font-weight: 500;
608
666
  }
667
+
609
668
  .r-modal-title-bar {
610
669
  display: flex;
611
670
  justify-content: space-between;
@@ -613,6 +672,16 @@
613
672
  padding: 1em;
614
673
  border-bottom: 2px solid var(--r-light-gray);
615
674
  }
675
+
676
+ .r-modal-footer-bar {
677
+ display: flex;
678
+ justify-content: flex-start;
679
+ align-items: center;
680
+ gap: 0.25rem;
681
+ padding: 1em;
682
+ border-top: 2px solid var(--r-light-gray);
683
+ }
684
+
616
685
  .r-modal-close-btn {
617
686
  position: relative;
618
687
  right: -4px;
@@ -640,17 +709,20 @@
640
709
  font-weight: 500;
641
710
  text-align: center;
642
711
  }
712
+
643
713
  .r-pagination a {
644
- color: var(--r-primary);
645
714
  border: 1px solid var(--r-light-gray);
646
715
  border-radius: 4px;
716
+ color: var(--r-primary);
647
717
  transition: all 0.2s ease-in-out;
648
718
  }
719
+
649
720
  .r-pagination a:hover {
650
721
  border-color: var(--r-primary);
651
722
  background-color: var(--r-primary);
652
723
  color: var(--r-white);
653
724
  }
725
+
654
726
  .r-pagination {
655
727
  display: flex;
656
728
  justify-content: center;
@@ -658,6 +730,20 @@
658
730
  gap: 0.25em;
659
731
  padding: 1em 0 1em 0;
660
732
  }
733
+
734
+ /* Spacings */
735
+ .r-spacing-top-sm {
736
+ padding-top: 1rem;
737
+ }
738
+
739
+ .r-spacing-bottom-sm {
740
+ padding-bottom: 1rem;
741
+ }
742
+
743
+ .r-spacing-both-sm {
744
+ padding-top: 1rem;
745
+ padding-bottom: 1rem;
746
+ }
661
747
  }
662
748
 
663
749
  :root {
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "extends": "tsconfig/react-library.json",
3
3
  "include": ["src"],
4
- "exclude": ["dist", "build", "node_modules"]
4
+ "exclude": ["dist", "build", "node_modules"],
5
5
  }