@raketa-builder/ui 0.7.0 → 0.9.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,5 +1,5 @@
1
1
 
2
- > @raketa-builder/ui@0.7.0 build
2
+ > @raketa-builder/ui@0.9.0 build
3
3
  > tsup src/index.js --format cjs --loader ".js=jsx"
4
4
 
5
5
  CLI Building entry: src/index.js
@@ -7,5 +7,5 @@ CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v6.5.0
8
8
  CLI Target: es6
9
9
  CJS Build start
10
- CJS dist/index.js 28.15 KB
11
- CJS ⚡️ Build success in 298ms
10
+ CJS dist/index.js 30.93 KB
11
+ CJS ⚡️ Build success in 121ms
package/dist/index.js CHANGED
@@ -56,6 +56,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
56
56
  var src_exports = {};
57
57
  __export(src_exports, {
58
58
  Button: () => Button_default,
59
+ CategoriesMenu: () => CategoriesMenu_default,
59
60
  Col: () => Col,
60
61
  Container: () => Container_default,
61
62
  DataGrid: () => DataGrid_default,
@@ -173,7 +174,19 @@ var P_default = P;
173
174
  var import_react3 = __toESM(require("react"));
174
175
  var import_jsx_runtime3 = require("react/jsx-runtime");
175
176
  var Button = (_a) => {
176
- var _b = _a, { as = "button", size, variant, className } = _b, rest = __objRest(_b, ["as", "size", "variant", "className"]);
177
+ var _b = _a, {
178
+ as = "button",
179
+ size = "md",
180
+ variant = "primary",
181
+ className,
182
+ type = "button"
183
+ } = _b, rest = __objRest(_b, [
184
+ "as",
185
+ "size",
186
+ "variant",
187
+ "className",
188
+ "type"
189
+ ]);
177
190
  const Component = as;
178
191
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
179
192
  Component,
@@ -189,11 +202,6 @@ var Button = (_a) => {
189
202
  }, rest)
190
203
  );
191
204
  };
192
- Button.defaultProps = {
193
- type: "button",
194
- size: "md",
195
- variant: "primary"
196
- };
197
205
  Button.variants = ["primary", "secondary", "success", "danger"];
198
206
  Button.sizes = {
199
207
  sm: "sm",
@@ -728,7 +736,7 @@ var LanguageSwitcher_default = LanguageSwitcher;
728
736
  var import_react24 = __toESM(require("react"));
729
737
  var import_jsx_runtime24 = require("react/jsx-runtime");
730
738
  var ImageAvatar = (_a) => {
731
- var _b = _a, { size, className } = _b, props = __objRest(_b, ["size", "className"]);
739
+ var _b = _a, { size = "24px", className } = _b, props = __objRest(_b, ["size", "className"]);
732
740
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
733
741
  "img",
734
742
  __spreadValues({
@@ -741,9 +749,6 @@ var ImageAvatar = (_a) => {
741
749
  }, props)
742
750
  );
743
751
  };
744
- ImageAvatar.defaultProps = {
745
- size: "24px"
746
- };
747
752
  var ImageAvatar_default = ImageAvatar;
748
753
 
749
754
  // src/DefaultAvatar.jsx
@@ -786,17 +791,59 @@ var DefaultAvatarStyles = (_a) => {
786
791
  );
787
792
  };
788
793
  var DefaultAvatar = (_a) => {
789
- var _b = _a, { initials } = _b, props = __objRest(_b, ["initials"]);
790
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DefaultAvatarStyles, __spreadProps(__spreadValues({ initials }, props), { children: initials }));
791
- };
792
- DefaultAvatar.defaultProps = {
793
- size: "24px",
794
- initials: "AA"
794
+ var _b = _a, { initials = "AA", size = "24px" } = _b, props = __objRest(_b, ["initials", "size"]);
795
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DefaultAvatarStyles, __spreadProps(__spreadValues({ initials, size }, props), { children: initials }));
795
796
  };
796
797
  var DefaultAvatar_default = DefaultAvatar;
798
+
799
+ // src/CategoriesMenu.js
800
+ var import_react26 = __toESM(require("react"));
801
+ var import_jsx_runtime26 = require("react/jsx-runtime");
802
+ var IconsWrapper = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "r-reset r-categories-icons-wrapper", children: [
803
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
804
+ "img",
805
+ {
806
+ style: {
807
+ color: "#fff",
808
+ width: "24px",
809
+ height: "24px",
810
+ filter: "invert(1)"
811
+ },
812
+ alt: "directions",
813
+ src: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItZ3JpZCI+PHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjciIGhlaWdodD0iNyI+PC9yZWN0PjxyZWN0IHg9IjE0IiB5PSIzIiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48L3JlY3Q+PHJlY3QgeD0iMTQiIHk9IjE0IiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48L3JlY3Q+PHJlY3QgeD0iMyIgeT0iMTQiIHdpZHRoPSI3IiBoZWlnaHQ9IjciPjwvcmVjdD48L3N2Zz4="
814
+ }
815
+ ),
816
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
817
+ "img",
818
+ {
819
+ className: "r-reset r-category-chevron",
820
+ alt: "directions",
821
+ src: "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAyMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIxIDExLjVMMTEgMS41TDEgMTEuNSIgc3Ryb2tlPSIjMEMwQTA5IiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg=="
822
+ }
823
+ )
824
+ ] });
825
+ var Title2 = () => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-categories-title", children: "Categories" });
826
+ var CategoriesInner = (_a) => {
827
+ var props = __objRest(_a, []);
828
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", __spreadProps(__spreadValues({}, props), { className: "r-reset r-categories-inner" }));
829
+ };
830
+ var CategoriesHiddenMenu = ({ paths }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "r-reset r-categories-hidden-menu", children: paths.map(({ title, link }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: link, className: "r-reset r-category-link", children: title })) });
831
+ var CategoriesMenuWrapper = (_a) => {
832
+ var props = __objRest(_a, []);
833
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", __spreadValues({ className: "r-reset r-categories-menu" }, props));
834
+ };
835
+ var CategoriesMenu = ({ paths }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CategoriesMenuWrapper, { children: [
836
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CategoriesInner, { children: [
837
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(IconsWrapper, {}),
838
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Title2, {})
839
+ ] }),
840
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CategoriesHiddenMenu, { paths })
841
+ ] });
842
+ var CategoriesMenu_default = CategoriesMenu;
797
843
  // Annotate the CommonJS export names for ESM import in node:
798
844
  0 && (module.exports = {
799
845
  Button,
846
+ CategoriesMenu,
800
847
  Col,
801
848
  Container,
802
849
  DataGrid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/ui",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
package/src/Button.jsx CHANGED
@@ -1,7 +1,14 @@
1
1
  import React from "react";
2
2
  import cn from "./cn";
3
3
 
4
- const Button = ({ as = "button", size, variant, className, ...rest }) => {
4
+ const Button = ({
5
+ as = "button",
6
+ size = "md",
7
+ variant = "primary",
8
+ className,
9
+ type = "button",
10
+ ...rest
11
+ }) => {
5
12
  const Component = as;
6
13
 
7
14
  return (
@@ -12,19 +19,13 @@ const Button = ({ as = "button", size, variant, className, ...rest }) => {
12
19
  "r-button",
13
20
  `r-button-${size}`,
14
21
  `r-button-${variant}`,
15
- className,
22
+ className
16
23
  )}
17
24
  {...rest}
18
25
  />
19
26
  );
20
27
  };
21
28
 
22
- Button.defaultProps = {
23
- type: "button",
24
- size: "md",
25
- variant: "primary",
26
- };
27
-
28
29
  Button.variants = ["primary", "secondary", "success", "danger"];
29
30
 
30
31
  Button.sizes = {
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+ const IconsWrapper = () => (
3
+ <div className="r-reset r-categories-icons-wrapper">
4
+ <img
5
+ style={{
6
+ color: "#fff",
7
+ width: "24px",
8
+ height: "24px",
9
+ filter: "invert(1)",
10
+ }}
11
+ alt="directions"
12
+ src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItZ3JpZCI+PHJlY3QgeD0iMyIgeT0iMyIgd2lkdGg9IjciIGhlaWdodD0iNyI+PC9yZWN0PjxyZWN0IHg9IjE0IiB5PSIzIiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48L3JlY3Q+PHJlY3QgeD0iMTQiIHk9IjE0IiB3aWR0aD0iNyIgaGVpZ2h0PSI3Ij48L3JlY3Q+PHJlY3QgeD0iMyIgeT0iMTQiIHdpZHRoPSI3IiBoZWlnaHQ9IjciPjwvcmVjdD48L3N2Zz4="
13
+ />
14
+
15
+ <img
16
+ className="r-reset r-category-chevron"
17
+ alt="directions"
18
+ src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIiIGhlaWdodD0iMTMiIHZpZXdCb3g9IjAgMCAyMiAxMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIxIDExLjVMMTEgMS41TDEgMTEuNSIgc3Ryb2tlPSIjMEMwQTA5IiBzdHJva2Utd2lkdGg9IjIiLz4KPC9zdmc+Cg=="
19
+ />
20
+ </div>
21
+ );
22
+ const Title = () => <div className="r-categories-title">Categories</div>;
23
+
24
+ const CategoriesInner = ({ ...props }) => (
25
+ <div {...props} className="r-reset r-categories-inner" />
26
+ );
27
+
28
+ const CategoriesHiddenMenu = ({ paths }) => (
29
+ <div className="r-reset r-categories-hidden-menu">
30
+ {paths.map(({ title, link }) => (
31
+ <a href={link} className="r-reset r-category-link">
32
+ {title}
33
+ </a>
34
+ ))}
35
+ </div>
36
+ );
37
+
38
+ const CategoriesMenuWrapper = ({ ...props }) => (
39
+ <div className="r-reset r-categories-menu" {...props} />
40
+ );
41
+
42
+ const CategoriesMenu = ({ paths }) => (
43
+ <CategoriesMenuWrapper>
44
+ <CategoriesInner>
45
+ <IconsWrapper />
46
+
47
+ <Title />
48
+ </CategoriesInner>
49
+ <CategoriesHiddenMenu paths={paths} />
50
+ </CategoriesMenuWrapper>
51
+ );
52
+
53
+ export default CategoriesMenu;
@@ -38,15 +38,10 @@ const DefaultAvatarStyles = ({ initials, size, className, ...props }) => (
38
38
  />
39
39
  );
40
40
 
41
- const DefaultAvatar = ({ initials, ...props }) => (
42
- <DefaultAvatarStyles initials={initials} {...props}>
41
+ const DefaultAvatar = ({ initials = "AA", size = "24px", ...props }) => (
42
+ <DefaultAvatarStyles initials={initials} size={size} {...props}>
43
43
  {initials}
44
44
  </DefaultAvatarStyles>
45
45
  );
46
46
 
47
- DefaultAvatar.defaultProps = {
48
- size: "24px",
49
- initials: "AA",
50
- };
51
-
52
47
  export default DefaultAvatar;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import cn from "./cn";
3
3
 
4
- const ImageAvatar = ({ size, className, ...props }) => (
4
+ const ImageAvatar = ({ size = "24px", className, ...props }) => (
5
5
  <img
6
6
  alt=""
7
7
  style={{
@@ -13,8 +13,4 @@ const ImageAvatar = ({ size, className, ...props }) => (
13
13
  />
14
14
  );
15
15
 
16
- ImageAvatar.defaultProps = {
17
- size: "24px",
18
- };
19
-
20
16
  export default ImageAvatar;
package/src/index.js CHANGED
@@ -27,3 +27,4 @@ export { default as LanguageSwitcher } from "./LanguageSwitcher";
27
27
  export { default as ImageAvatar } from "./ImageAvatar";
28
28
  export { default as DefaultAvatar } from "./DefaultAvatar";
29
29
  export { default as cn } from "./cn";
30
+ export { default as CategoriesMenu } from "./CategoriesMenu";
package/src/styles.css CHANGED
@@ -744,6 +744,86 @@
744
744
  padding-top: 1rem;
745
745
  padding-bottom: 1rem;
746
746
  }
747
+
748
+ .r-categories-menu {
749
+ position: relative;
750
+ width: 100%;
751
+ padding: 0 0.25rem;
752
+ }
753
+ .r-categories-menu:hover .r-category-chevron {
754
+ transform: rotate(90deg);
755
+ transition: all 0.3s ease-in-out;
756
+ }
757
+ .r-categories-menu:hover .r-categories-hidden-menu {
758
+ transform: translateX(64px);
759
+ transition: all 0.3s ease-in-out;
760
+ }
761
+ .r-categories-menu:hover .r-categories-inner {
762
+ background-color: #4b4b4b;
763
+ }
764
+
765
+ .r-categories-inner {
766
+ position: relative;
767
+ z-index: 100;
768
+ padding: 0.25rem;
769
+ display: flex;
770
+ align-items: center;
771
+ justify-content: center;
772
+ flex-direction: column;
773
+ gap: 0.5rem;
774
+ background-color: #000;
775
+ border-radius: 4px;
776
+ }
777
+
778
+ .r-categories-title {
779
+ color: #fff;
780
+ font-size: 10px;
781
+ }
782
+
783
+ .r-categories-icons-wrapper {
784
+ display: flex;
785
+ align-items: center;
786
+ justify-content: center;
787
+ gap: 0.25rem;
788
+ }
789
+
790
+ .r-category-chevron {
791
+ color: #fff;
792
+ width: 12px;
793
+ height: 12px;
794
+ filter: invert(1);
795
+ transform: rotate(-90deg);
796
+ transition: all 0.3s ease-in-out;
797
+ }
798
+
799
+ .r-categories-hidden-menu {
800
+ position: absolute;
801
+ z-index: 99;
802
+ top: 0;
803
+ left: 0;
804
+ bottom: 0;
805
+ background-color: #000;
806
+ display: flex;
807
+ align-items: center;
808
+ gap: 0.5rem;
809
+ transform: translateX(-100%);
810
+ transition: all 0.3s ease-in-out;
811
+ }
812
+
813
+ .r-category-link {
814
+ padding: 0.25rem 0.5rem;
815
+ display: flex;
816
+ align-items: center;
817
+ height: 100%;
818
+ color: #fff;
819
+ font-size: 13px;
820
+ text-decoration: none;
821
+ white-space: nowrap;
822
+ }
823
+
824
+ .r-category-link:hover {
825
+ background-color: #4b4b4b;
826
+ }
747
827
  }
748
828
 
749
829
  :root {