@raketa-builder/builder 0.12.0 → 0.20.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/builder",
3
- "version": "0.12.0",
3
+ "version": "0.20.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
@@ -10,7 +10,6 @@
10
10
  "dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch"
11
11
  },
12
12
  "peerDependencies": {
13
- "styled-components": "^5.1.0",
14
13
  "react": "18.2.0",
15
14
  "react-dom": "18.2.0"
16
15
  },
package/src/Canvas.js CHANGED
@@ -1,18 +1,13 @@
1
1
  import React from "react";
2
- import styled from "styled-components";
3
- import { H, P } from "@raketa-builder/ui";
4
-
5
2
  import { ReactSortable } from "react-sortablejs";
3
+ import { H, P, cn } from "@raketa-builder/ui";
6
4
  import AdminWidget from "./lib/AdminWidget";
7
5
  import ErrorBoundary from "./ErrorBoundary";
8
6
  import LibraryContext from "./LibraryContext";
9
7
 
10
- const EmptyCanvas = styled.div`
11
- display: flex;
12
- justify-content: center;
13
- align-items: center;
14
- height: 100vh;
15
- `;
8
+ const EmptyCanvas = ({ className, ...rest }) => (
9
+ <div className={cn("r-reset", "r-empty-canvas", className)} {...rest} />
10
+ );
16
11
 
17
12
  const Canvas = React.memo(
18
13
  function Canvas({ widgets, onReorder, onEdit, onRemove, identifier }) {
package/src/List.js CHANGED
@@ -1,8 +1,7 @@
1
1
  /* eslint-disable @next/next/no-img-element */
2
2
  import React from "react";
3
- import styled from "styled-components";
4
3
  import { ReactSortable } from "react-sortablejs";
5
- import { reset, buttonReset, Button, P, H } from "@raketa-builder/ui";
4
+ import { Button, P, H } from "@raketa-builder/ui";
6
5
 
7
6
  import {
8
7
  add,
@@ -11,6 +10,7 @@ import {
11
10
  updateFieldByIndex,
12
11
  randomId,
13
12
  } from "./lists";
13
+ import { cn } from "@raketa-builder/ui";
14
14
 
15
15
  const Handle = (props) => (
16
16
  <HandleWrapper data-drag>
@@ -46,74 +46,58 @@ const IconMinimize = () => (
46
46
  />
47
47
  );
48
48
 
49
- const ListWrapper = styled.div`
50
- ${reset};
51
- margin-bottom: ${(props) => props.theme.font.base};
52
- `;
53
-
54
- const AddButtonWrapepr = styled.div`
55
- ${reset};
56
- margin-bottom: ${(props) => props.theme.font.base};
57
- `;
58
-
59
- const HandleWrapper = styled.div`
60
- display: flex;
61
- align-items: center;
62
- width: 16px;
63
- padding-right: 8px;
64
- cursor: move;
65
-
66
- & > img {
67
- width: 16px;
68
- }
69
- `;
70
-
71
- const ItemWrapper = styled.div`
72
- ${reset};
73
- margin-bottom: ${(props) => props.theme.font.base};
74
- border: 1px solid ${(props) => props.theme.colors.gray};
75
- border-radius: 5px;
76
- `;
77
-
78
- const TitleBar = styled.div`
79
- ${reset};
80
- display: flex;
81
- justify-content: space-between;
82
- align-items: center;
83
- width: 100%;
84
- border-top-left-radius: 5px;
85
- border-top-right-radius: 5px;
86
- border-bottom: 1px solid ${(props) => props.theme.colors.gray};
87
- padding: 8px;
88
- background-color: #efefef;
89
- `;
90
-
91
- const TitleWrapper = styled.div`
92
- ${reset};
93
- display: flex;
94
- justify-content: space-between;
95
- align-items: center;
96
- flex: 1;
97
- padding: 0;
98
- cursor: pointer;
99
- `;
100
-
101
- const ContentWrapper = styled.div`
102
- ${reset};
103
- padding: 8px;
104
- `;
105
-
106
- const ListButton = styled.button`
107
- ${buttonReset};
108
- display: flex;
109
- justify-content: center;
110
- align-items: center;
111
- `;
112
-
113
- const Title = styled.span`
114
- ${reset};
115
- font-weight: 700;
116
- `;
49
+ const ListWrapper = ({ className, ...rest }) => (
50
+ <div className={cn("r-reset", "r-list-wrapper", className)} {...rest} />
51
+ );
52
+
53
+ const AddButtonWrapepr = ({ className, ...rest }) => (
54
+ <div
55
+ className={cn("r-reset", "r-list-add-button-wrapper", className)}
56
+ {...rest}
57
+ />
58
+ );
59
+
60
+ const HandleWrapper = ({ className, ...rest }) => (
61
+ <div
62
+ className={cn("r-reset", "r-list-handle-wrapper", className)}
63
+ {...rest}
64
+ />
65
+ );
66
+
67
+ const ItemWrapper = ({ className, ...rest }) => (
68
+ <div className={cn("r-reset", "r-list-item-wrapper", className)} {...rest} />
69
+ );
70
+
71
+ const TitleBar = ({ className, ...rest }) => (
72
+ <div className={cn("r-reset", "r-list-title-bar", className)} {...rest} />
73
+ );
74
+
75
+ const TitleWrapper = ({ className, ...rest }) => (
76
+ <div className={cn("r-reset", "r-list-title-wrapper", className)} {...rest} />
77
+ );
78
+
79
+ const ContentWrapper = ({ className, ...rest }) => (
80
+ <div
81
+ className={cn("r-reset", className)}
82
+ style={{ padding: "8px" }}
83
+ {...rest}
84
+ />
85
+ );
86
+
87
+ const ListButton = ({ className, ...rest }) => (
88
+ <div
89
+ className={cn("r-reset", "r-button-reset r-list-button", className)}
90
+ {...rest}
91
+ />
92
+ );
93
+
94
+ const Title = ({ className, ...rest }) => (
95
+ <div
96
+ className={cn("r-reset", className)}
97
+ style={{ fontWeight: "700" }}
98
+ {...rest}
99
+ />
100
+ );
117
101
 
118
102
  const extractPrimaryField = (primaryField, item, idx) => {
119
103
  if (!primaryField) {
package/src/ListInput.js CHANGED
@@ -1,13 +1,6 @@
1
1
  import React from "react";
2
- import { ThemeProvider } from "styled-components";
3
- import { theme } from "@raketa-builder/ui";
4
-
5
2
  import List from "./List";
6
3
 
7
- const ListInput = (props) => (
8
- <ThemeProvider theme={theme}>
9
- <List {...props} />
10
- </ThemeProvider>
11
- );
4
+ const ListInput = (props) => <List {...props} />;
12
5
 
13
6
  export default ListInput;
@@ -1,8 +1,5 @@
1
1
  /* eslint-disable no-undef */
2
2
  import React from "react";
3
- import { ThemeProvider } from "styled-components";
4
- import { theme } from "@raketa-builder/ui";
5
-
6
3
  import { add, removeById, updateFieldById, randomString } from "./lists";
7
4
 
8
5
  import HostContext from "./HostContext";
@@ -183,51 +180,49 @@ const PageBuilder = ({
183
180
  }));
184
181
 
185
182
  return (
186
- <ThemeProvider theme={theme}>
187
- <HostContext.Provider value={{ host }}>
188
- <LibraryContext.Provider value={{ library, adminLibrary }}>
189
- <div style={{ paddingLeft: "64px" }}>
190
- {reorderOpen && (
191
- <ReorderDialog
192
- widgets={sortableWidgets}
193
- onChange={handleReorder}
194
- onDelete={handleRemove}
195
- onSelectWidget={setSelectedWidget}
196
- onClose={() => setReorderOpen(false)}
197
- />
198
- )}
199
-
200
- <AdminSidebar
201
- languageSwitcherSettings={languageSwitcherSettings}
202
- dirty={dirty}
203
- buttons={sidebarButtons}
204
- onSave={handleSave}
205
- onAddWidget={(widgetName) => handleAdd(widgetName)}
206
- onReorderDialog={() => setReorderOpen(true)}
207
- onExit={onExit}
208
- onPasteWidget={handlePasteWidget}
209
- />
210
-
211
- <Canvas
183
+ <HostContext.Provider value={{ host }}>
184
+ <LibraryContext.Provider value={{ library, adminLibrary }}>
185
+ <div style={{ paddingLeft: "64px" }}>
186
+ {reorderOpen && (
187
+ <ReorderDialog
212
188
  widgets={sortableWidgets}
213
- identifier={identifier}
214
- onReorder={handleReorder}
215
- onEdit={setSelectedWidget}
216
- onRemove={handleRemove}
189
+ onChange={handleReorder}
190
+ onDelete={handleRemove}
191
+ onSelectWidget={setSelectedWidget}
192
+ onClose={() => setReorderOpen(false)}
217
193
  />
218
-
219
- {selectedWidget && (
220
- <SettingsDialog
221
- widget={currentWidget}
222
- settings={selectedWidget.settings}
223
- onSave={handleSaveWidget}
224
- onClose={handleClose}
225
- />
226
- )}
227
- </div>
228
- </LibraryContext.Provider>
229
- </HostContext.Provider>
230
- </ThemeProvider>
194
+ )}
195
+
196
+ <AdminSidebar
197
+ languageSwitcherSettings={languageSwitcherSettings}
198
+ dirty={dirty}
199
+ buttons={sidebarButtons}
200
+ onSave={handleSave}
201
+ onAddWidget={(widgetName) => handleAdd(widgetName)}
202
+ onReorderDialog={() => setReorderOpen(true)}
203
+ onExit={onExit}
204
+ onPasteWidget={handlePasteWidget}
205
+ />
206
+
207
+ <Canvas
208
+ widgets={sortableWidgets}
209
+ identifier={identifier}
210
+ onReorder={handleReorder}
211
+ onEdit={setSelectedWidget}
212
+ onRemove={handleRemove}
213
+ />
214
+
215
+ {selectedWidget && (
216
+ <SettingsDialog
217
+ widget={currentWidget}
218
+ settings={selectedWidget.settings}
219
+ onSave={handleSaveWidget}
220
+ onClose={handleClose}
221
+ />
222
+ )}
223
+ </div>
224
+ </LibraryContext.Provider>
225
+ </HostContext.Provider>
231
226
  );
232
227
  };
233
228
 
@@ -1,16 +1,13 @@
1
1
  import React from "react";
2
- import styled from "styled-components";
3
- import { Modal, Button } from "@raketa-builder/ui";
2
+ import { Modal, Button, cn } from "@raketa-builder/ui";
4
3
 
5
- const ModalContent = styled.div`
6
- max-height: 75vh;
7
- overflow-y: auto;
8
- `;
4
+ const ModalContent = ({ className, ...props }) => (
5
+ <div className={cn("r-modal-content", className)} {...props} />
6
+ );
9
7
 
10
- const ModalFooter = styled.div`
11
- padding-top: ${(props) => props.theme.font.base};
12
- border-top: 2px solid ${(props) => props.theme.colors.lightGray};
13
- `;
8
+ const ModalFooter = ({ className, ...props }) => (
9
+ <div className={cn("r-modal-footer", className)} {...props} />
10
+ );
14
11
 
15
12
  const Dialog = ({
16
13
  open,
@@ -1,28 +1,14 @@
1
1
  /* eslint-disable no-undef */
2
2
  import React from "react";
3
- import styled from "styled-components";
4
3
  import { ReactSortable } from "react-sortablejs";
5
- import { H, P, Button } from "@raketa-builder/ui";
4
+ import { H, P, Button, cn } from "@raketa-builder/ui";
6
5
  import Dialog from "./Dialog";
7
6
  import LibraryContext from "../LibraryContext";
8
7
  import widgetData from "../helpers/widgetData";
9
8
 
10
- const ReorderDialogItem = styled.div`
11
- display: flex;
12
- justify-content: space-between;
13
- align-items: center;
14
- padding: ${(props) => `calc(${props.theme.font.base} / 2)`};
15
- margin-bottom: ${(props) => `calc(${props.theme.font.base} / 2)`};
16
- border: 1px solid ${(props) => props.theme.colors.gray};
17
- border-radius: 3px;
18
- color: ${(props) => props.theme.colors.black};
19
- cursor: move;
20
-
21
- h6 {
22
- margin-bottom: 0;
23
- margin-left: ${(props) => `calc(${props.theme.font.base} / 2)`};
24
- }
25
- `;
9
+ const ReorderDialogItem = ({ className, ...props }) => (
10
+ <div className={cn("r-reorder-dialog-item", className)} {...props} />
11
+ );
26
12
 
27
13
  const cleanup = (string) => string.replace(/<[^>]*>?/gm, "");
28
14
 
@@ -1,60 +1,28 @@
1
1
  import React from "react";
2
- import styled from "styled-components";
3
- import { reset, Hint } from "@raketa-builder/ui";
2
+ import { Hint, cn } from "@raketa-builder/ui";
4
3
  import BuilderContext from "../contexts/BuilderContext";
5
4
 
6
5
  import TextInput from "./TextInput";
7
6
  import SelectMenu from "./SelectMenu";
8
7
 
9
- const SettingsIcon = styled.span`
10
- display: inline-block;
11
- width: ${(props) => props.theme.font.base};
12
- height: ${(props) => props.theme.font.base};
13
- margin-right: ${(props) => `calc(${props.theme.font.base} / 2)`};
14
- background-size: 100% auto;
15
- background-repeat: none;
16
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItc2xpZGVycyI+PGxpbmUgeDE9IjQiIHkxPSIyMSIgeDI9IjQiIHkyPSIxNCI+PC9saW5lPjxsaW5lIHgxPSI0IiB5MT0iMTAiIHgyPSI0IiB5Mj0iMyI+PC9saW5lPjxsaW5lIHgxPSIxMiIgeTE9IjIxIiB4Mj0iMTIiIHkyPSIxMiI+PC9saW5lPjxsaW5lIHgxPSIxMiIgeTE9IjgiIHgyPSIxMiIgeTI9IjMiPjwvbGluZT48bGluZSB4MT0iMjAiIHkxPSIyMSIgeDI9IjIwIiB5Mj0iMTYiPjwvbGluZT48bGluZSB4MT0iMjAiIHkxPSIxMiIgeDI9IjIwIiB5Mj0iMyI+PC9saW5lPjxsaW5lIHgxPSIxIiB5MT0iMTQiIHgyPSI3IiB5Mj0iMTQiPjwvbGluZT48bGluZSB4MT0iOSIgeTE9IjgiIHgyPSIxNSIgeTI9IjgiPjwvbGluZT48bGluZSB4MT0iMTciIHkxPSIxNiIgeDI9IjIzIiB5Mj0iMTYiPjwvbGluZT48L3N2Zz4=);
17
- }`;
18
-
19
- const ThreeColumns = styled.div`
20
- ${reset}
21
- display: flex;
22
-
23
- & > div {
24
- width: 33.33%;
25
- padding-right: ${(props) => props.theme.font.base};
26
-
27
- &:last-child {
28
- padding-right: 0;
29
- }
30
- }
31
-
32
- &:last-child {
33
- & > div {
34
- margin-bottom: 0;
35
- }
36
- }
37
- `;
38
-
39
- const FormSectionTitle = styled.h6`
40
- ${reset}
41
- display: flex;
42
- align-items: center;
43
- width: 100%;
44
- margin-bottom: ${(props) => `calc(${props.theme.font.base} / 2)`};
45
- font-size: ${(props) => props.theme.font.small};
46
- text-transform: uppercase;
47
- font-weight: bold;
48
- `;
49
-
50
- const ButtonControl = styled.div`
51
- ${reset}
52
- margin-bottom: 0;
53
-
54
- & + div {
55
- margin-top: ${(props) => props.theme.font.base};
56
- }
57
- `;
8
+ const SettingsIcon = ({ className, ...props }) => (
9
+ <div className={cn("r-settings-icon", className)} {...props} />
10
+ );
11
+
12
+ const ThreeColumns = ({ className, ...props }) => (
13
+ <div className={cn("r-reset", "r-three-columns", className)} {...props} />
14
+ );
15
+
16
+ const FormSectionTitle = ({ className, ...props }) => (
17
+ <div
18
+ className={cn("r-reset", "r-form-section-title", className)}
19
+ {...props}
20
+ />
21
+ );
22
+
23
+ const ButtonControl = ({ className, ...props }) => (
24
+ <div className={cn("r-reset", "r-button-control", className)} {...props} />
25
+ );
58
26
 
59
27
  const DEFAULT_BUTTON_STYLES = [
60
28
  ["primary", "Primary"],
@@ -1,60 +1,27 @@
1
1
  import React from "react";
2
- import styled from "styled-components";
3
- import { reset, Hint } from "@raketa-builder/ui";
2
+ import { Hint, cn } from "@raketa-builder/ui";
4
3
 
5
4
  import TextInput from "./TextInput";
6
5
  import SelectMenu from "./SelectMenu";
7
6
 
8
- const SettingsIcon = styled.span`
9
- display: inline-block;
10
- width: ${(props) => props.theme.font.base};
11
- height: ${(props) => props.theme.font.base};
12
- margin-right: ${(props) => `calc(${props.theme.font.base} / 2)`};
13
- background-size: 100% auto;
14
- background-repeat: none;
15
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItc2xpZGVycyI+PGxpbmUgeDE9IjQiIHkxPSIyMSIgeDI9IjQiIHkyPSIxNCI+PC9saW5lPjxsaW5lIHgxPSI0IiB5MT0iMTAiIHgyPSI0IiB5Mj0iMyI+PC9saW5lPjxsaW5lIHgxPSIxMiIgeTE9IjIxIiB4Mj0iMTIiIHkyPSIxMiI+PC9saW5lPjxsaW5lIHgxPSIxMiIgeTE9IjgiIHgyPSIxMiIgeTI9IjMiPjwvbGluZT48bGluZSB4MT0iMjAiIHkxPSIyMSIgeDI9IjIwIiB5Mj0iMTYiPjwvbGluZT48bGluZSB4MT0iMjAiIHkxPSIxMiIgeDI9IjIwIiB5Mj0iMyI+PC9saW5lPjxsaW5lIHgxPSIxIiB5MT0iMTQiIHgyPSI3IiB5Mj0iMTQiPjwvbGluZT48bGluZSB4MT0iOSIgeTE9IjgiIHgyPSIxNSIgeTI9IjgiPjwvbGluZT48bGluZSB4MT0iMTciIHkxPSIxNiIgeDI9IjIzIiB5Mj0iMTYiPjwvbGluZT48L3N2Zz4=);
16
-
17
- }`;
18
-
19
- const ThreeColumns = styled.div`
20
- ${reset}
21
- display: flex;
22
-
23
- & > div {
24
- width: 33.33%;
25
- padding-right: ${(props) => props.theme.font.base};
26
-
27
- &:last-child {
28
- padding-right: 0;
29
- }
30
- }
31
-
32
- &:last-child {
33
- & > div {
34
- margin-bottom: 0;
35
- }
36
- }
37
- `;
38
-
39
- const FormSectionTitle = styled.h6`
40
- ${reset}
41
- display: flex;
42
- align-items: center;
43
- width: 100%;
44
- margin-bottom: ${(props) => `calc(${props.theme.font.base} / 2)`};
45
- font-size: ${(props) => props.theme.font.small};
46
- text-transform: uppercase;
47
- font-weight: bold;
48
- `;
49
-
50
- const ButtonControl = styled.div`
51
- ${reset}
52
- margin-bottom: 0;
53
-
54
- & + div {
55
- margin-top: ${(props) => props.theme.font.base};
56
- }
57
- `;
7
+ const SettingsIcon = ({ className, ...props }) => (
8
+ <div className={cn("r-settings-icon", className)} {...props} />
9
+ );
10
+
11
+ const ThreeColumns = ({ className, ...props }) => (
12
+ <div className={cn("r-reset", "r-three-columns", className)} {...props} />
13
+ );
14
+
15
+ const FormSectionTitle = ({ className, ...props }) => (
16
+ <div
17
+ className={cn("r-reset", "r-form-section-title", className)}
18
+ {...props}
19
+ />
20
+ );
21
+
22
+ const ButtonControl = ({ className, ...props }) => (
23
+ <div className={cn("r-reset", "r-button-control", className)} {...props} />
24
+ );
58
25
 
59
26
  const mergeSettings = (settings, key, value) =>
60
27
  Object.assign({}, settings, { [key]: value });
package/src/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  import React from "react";
2
- import { ThemeProvider } from "styled-components";
3
- import { theme, Label, FormGroup } from "@raketa-builder/ui";
4
-
2
+ import { Label, FormGroup } from "@raketa-builder/ui";
5
3
  import PageBuilder from "./PageBuilder";
6
4
  import TextInput from "./forms/TextInput";
7
5
  import TextArea from "./forms/TextArea";
@@ -24,8 +22,9 @@ import Link from "./lib/Link";
24
22
  import BuilderContext from "./contexts/BuilderContext";
25
23
  import AdminPageRender from "./AdminPageRender";
26
24
 
27
- const RaketaUIProvider = ({ theme, children }) => (
28
- <ThemeProvider theme={theme}>{children}</ThemeProvider>
25
+ const theme = {};
26
+ const RaketaUIProvider = ({ children }) => (
27
+ <React.Fragment>{children}</React.Fragment>
29
28
  );
30
29
 
31
30
  RaketaUIProvider.defaultProps = {
@@ -64,7 +64,12 @@ const WidgetsList = ({ library, onAddWidget }) => {
64
64
  return (
65
65
  <div>
66
66
  <SideNavSearchWrapper>
67
- <TextInput value={q} onChange={setQ} placeholder="Search..." />
67
+ <TextInput
68
+ className="r-admin-sidenav-search-input"
69
+ value={q}
70
+ onChange={setQ}
71
+ placeholder="Search..."
72
+ />
68
73
  </SideNavSearchWrapper>
69
74
 
70
75
  {widgetsCategories.map((categoryName, idx) => (
@@ -1,19 +1,10 @@
1
- import styled from "styled-components";
2
- import { reset } from "@raketa-builder/ui";
1
+ import { cn } from "@raketa-builder/ui";
3
2
 
4
- const AdminWidgetLabel = styled.div`
5
- ${reset};
6
- position: absolute;
7
- top: ${(props) => props.theme.font.base};
8
- right: ${(props) => props.theme.font.base};
9
- z-index: 9;
10
- display: none;
11
- padding: 4px 12px;
12
- border-radius: 16px;
13
- background-color: rgba(64, 64, 64, 0.8);
14
- color: ${(props) => props.theme.colors.trueWhite};
15
- font-size: ${(props) => props.theme.font.small};
16
- backdrop-filter: blur(4px);
17
- `;
3
+ const AdminWidgetLabel = ({ className, ...rest }) => (
4
+ <div
5
+ className={cn("r-reset", "r-fs-small", "r-admin-widget-label", className)}
6
+ {...rest}
7
+ />
8
+ );
18
9
 
19
10
  export default AdminWidgetLabel;
@@ -1,11 +1,10 @@
1
- import styled from "styled-components";
1
+ import { cn } from "@raketa-builder/ui";
2
2
 
3
- const AdminWidgetToolbar = styled.div`
4
- display: none;
5
- position: absolute;
6
- top: ${(props) => props.theme.font.base};
7
- left: ${(props) => props.theme.font.base};
8
- z-index: 9;
9
- `;
3
+ const AdminWidgetToolbar = ({ className, ...rest }) => (
4
+ <div
5
+ className={cn("r-reset", "r-admin-widget-toolbar", className)}
6
+ {...rest}
7
+ />
8
+ );
10
9
 
11
10
  export default AdminWidgetToolbar;
@@ -1,15 +1,10 @@
1
- import styled from "styled-components";
1
+ import { cn } from "@raketa-builder/ui";
2
2
 
3
- const AdminWidgetWrapper = styled.div`
4
- ${(props) => `
5
- &:hover {
6
- position: relative;
7
- outline: 1px dashed ${props.theme.colors.gray};
8
-
9
- & > div[data-toolbar] { display: flex; }
10
- & > div[data-widget-label] { display: block; }
11
- }
12
- `}
13
- `;
3
+ const AdminWidgetWrapper = ({ className, ...rest }) => (
4
+ <div
5
+ className={cn("r-reset", "r-admin-widget-wrapper", className)}
6
+ {...rest}
7
+ />
8
+ );
14
9
 
15
10
  export default AdminWidgetWrapper;
@@ -18,7 +18,7 @@ const colors = {
18
18
  neutral: "#fff",
19
19
  };
20
20
 
21
- const IconButton = ({ type, icon, marginLeft = '0px', ...rest }) => (
21
+ const IconButton = ({ type, icon, marginLeft = "0px", ...rest }) => (
22
22
  <button
23
23
  type="button"
24
24
  style={{