@raketa-builder/builder 0.3.0 → 0.5.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.
@@ -4,5 +4,5 @@ CLI Using tsconfig: tsconfig.json
4
4
  CLI tsup v6.5.0
5
5
  CLI Target: es6
6
6
  CJS Build start
7
- CJS dist/index.js 123.74 KB
8
- CJS ⚡️ Build success in 406ms
7
+ CJS dist/index.js 124.42 KB
8
+ CJS ⚡️ Build success in 24ms
@@ -1,13 +1,13 @@
1
1
  $ TIMING=1 eslint "**/*.js"
2
2
  Rule | Time (ms) | Relative
3
3
  :---------------------------------|----------:|--------:
4
- react/no-direct-mutation-state | 112.696 | 28.7%
5
- react/display-name | 89.187 | 22.7%
6
- react/require-render-return | 81.105 | 20.7%
7
- react-hooks/exhaustive-deps | 21.685 | 5.5%
8
- react/no-deprecated | 18.021 | 4.6%
9
- react-hooks/rules-of-hooks | 10.621 | 2.7%
10
- react/no-string-refs | 9.744 | 2.5%
11
- jsx-a11y/role-supports-aria-props | 7.943 | 2.0%
12
- react/no-unescaped-entities | 4.903 | 1.2%
13
- react/jsx-no-comment-textnodes | 4.680 | 1.2%
4
+ react/display-name | 13.824 | 28.4%
5
+ react/no-direct-mutation-state | 13.056 | 26.8%
6
+ react/require-render-return | 7.386 | 15.2%
7
+ react/no-deprecated | 2.027 | 4.2%
8
+ react/no-string-refs | 1.655 | 3.4%
9
+ react-hooks/rules-of-hooks | 1.618 | 3.3%
10
+ jsx-a11y/role-supports-aria-props | 1.235 | 2.5%
11
+ react-hooks/exhaustive-deps | 1.158 | 2.4%
12
+ react/no-unescaped-entities | 0.938 | 1.9%
13
+ react/jsx-no-comment-textnodes | 0.647 | 1.3%
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @raketa-builder/builder
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - eb06bba: Update Container element handlong of the settings prop
8
+ - 8019bfc: Guard against missing settings in for the Builder container element
9
+
10
+ ## 0.4.0
11
+
12
+ ### Minor Changes
13
+
14
+ - Update list input's buttons
15
+
16
+ ## 0.3.0
17
+
18
+ ### Minor Changes
19
+
20
+ - Update Admin sidebar buttons
21
+
3
22
  ## 0.1.0
4
23
 
5
24
  ### Minor Changes
package/dist/index.js CHANGED
@@ -117,11 +117,13 @@ var require_dist = __commonJS({
117
117
  Col: () => Col,
118
118
  Container: () => Container_default2,
119
119
  DataGrid: () => DataGrid_default,
120
+ DefaultAvatar: () => DefaultAvatar_default,
120
121
  Field: () => Field_default,
121
122
  FormGroup: () => FormGroup_default,
122
123
  H: () => H_default,
123
124
  Handle: () => Handle_default,
124
125
  Hint: () => Hint_default,
126
+ ImageAvatar: () => ImageAvatar_default,
125
127
  Input: () => Input_default,
126
128
  Label: () => Label_default,
127
129
  LanguageSwitcher: () => LanguageSwitcher_default2,
@@ -1031,6 +1033,64 @@ var require_dist = __commonJS({
1031
1033
  ] });
1032
1034
  };
1033
1035
  var LanguageSwitcher_default2 = LanguageSwitcher2;
1036
+ var import_styled_components25 = __toESM2(require("styled-components"));
1037
+ var ImageAvatar = import_styled_components25.default.img`
1038
+ ${reset_default};
1039
+ display: block;
1040
+ width: ${(props) => props.size};
1041
+ height: ${(props) => props.size};
1042
+ border-radius: 50%;
1043
+ `;
1044
+ ImageAvatar.defaultProps = {
1045
+ size: "24px"
1046
+ };
1047
+ var ImageAvatar_default = ImageAvatar;
1048
+ var import_react82 = __toESM2(require("react"));
1049
+ var import_styled_components26 = __toESM2(require("styled-components"));
1050
+ var import_jsx_runtime82 = require("react/jsx-runtime");
1051
+ var AVATAR_COLORS = [
1052
+ "darkkhaki",
1053
+ "palevioletred",
1054
+ "mediumseagreen",
1055
+ "olivedrab",
1056
+ "steelblue",
1057
+ "salmon",
1058
+ "indianred",
1059
+ "mediumpurple",
1060
+ "coral",
1061
+ "rosybrown",
1062
+ "lightseagreen",
1063
+ "plum",
1064
+ "tan"
1065
+ ];
1066
+ var initialsToColor = (initials, colors2) => {
1067
+ let asciiVal = initials.charCodeAt(0);
1068
+ asciiVal += initials.charCodeAt(1);
1069
+ let colorIndex = asciiVal % colors2.length;
1070
+ return colors2[colorIndex];
1071
+ };
1072
+ var DefaultAvatarStyles = import_styled_components26.default.div`
1073
+ ${reset_default};
1074
+ display: flex;
1075
+ justify-content: center;
1076
+ align-items: center;
1077
+ width: ${(props) => props.size};
1078
+ height: ${(props) => props.size};
1079
+ padding: 0.5rem;
1080
+ border-radius: 50%;
1081
+ background-color: ${(props) => initialsToColor(props.initials, AVATAR_COLORS)};
1082
+ color: #fff;
1083
+ font-size: calc(${(props) => props.size} * 0.5);
1084
+ text-shadow: 1px 1px rgba(0, 0, 0, 0.1)
1085
+ `;
1086
+ var DefaultAvatar = (_a) => {
1087
+ var _b = _a, { initials } = _b, props = __objRest2(_b, ["initials"]);
1088
+ return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(DefaultAvatarStyles, __spreadProps2(__spreadValues2({ initials }, props), { children: initials }));
1089
+ };
1090
+ DefaultAvatar.defaultProps = {
1091
+ initials: "AA"
1092
+ };
1093
+ var DefaultAvatar_default = DefaultAvatar;
1034
1094
  }
1035
1095
  });
1036
1096
 
@@ -2687,13 +2747,14 @@ var TitleBar = import_styled_components10.default.div`
2687
2747
  padding: 8px;
2688
2748
  background-color: #efefef;
2689
2749
  `;
2690
- var TitleWrapper = import_styled_components10.default.button`
2691
- ${import_ui13.buttonReset};
2750
+ var TitleWrapper = import_styled_components10.default.div`
2751
+ ${import_ui13.reset};
2692
2752
  display: flex;
2693
2753
  justify-content: space-between;
2694
2754
  align-items: center;
2695
2755
  flex: 1;
2696
2756
  padding: 0;
2757
+ cursor: pointer;
2697
2758
  `;
2698
2759
  var ContentWrapper = import_styled_components10.default.div`
2699
2760
  ${import_ui13.reset};
@@ -2737,7 +2798,7 @@ var Item = ({
2737
2798
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ItemWrapper, { children: [
2738
2799
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TitleBar, { children: [
2739
2800
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Handle2, {}),
2740
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TitleWrapper, { type: "button", onClick: () => setOpen(!open), children: [
2801
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(TitleWrapper, { onClick: () => setOpen(!open), children: [
2741
2802
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Title, { children: extractPrimaryField(primaryField2, item, idx) }),
2742
2803
  !alwaysOpened && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ListButton, { type: "button", children: open ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconMinimize, {}) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconMaximize, {}) })
2743
2804
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/builder",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
package/src/List.js CHANGED
@@ -88,13 +88,14 @@ const TitleBar = styled.div`
88
88
  background-color: #efefef;
89
89
  `;
90
90
 
91
- const TitleWrapper = styled.button`
92
- ${buttonReset};
91
+ const TitleWrapper = styled.div`
92
+ ${reset};
93
93
  display: flex;
94
94
  justify-content: space-between;
95
95
  align-items: center;
96
96
  flex: 1;
97
97
  padding: 0;
98
+ cursor: pointer;
98
99
  `;
99
100
 
100
101
  const ContentWrapper = styled.div`
@@ -150,7 +151,7 @@ const Item = ({
150
151
  <TitleBar>
151
152
  <Handle />
152
153
 
153
- <TitleWrapper type="button" onClick={() => setOpen(!open)}>
154
+ <TitleWrapper onClick={() => setOpen(!open)}>
154
155
  <Title>{extractPrimaryField(primaryField, item, idx)}</Title>
155
156
  {!alwaysOpened && (
156
157
  <ListButton type="button">