oolib 2.7.6 → 2.8.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.
@@ -69,12 +69,12 @@ var ButtonGhost = function (props) { return react_1.default.createElement(Button
69
69
  exports.ButtonGhost = ButtonGhost;
70
70
  var UploadButton = function (props) {
71
71
  var inputRef = (0, react_1.useRef)(null);
72
- var mutilple = props.mutilple, onChange = props.onChange, variant = props.variant, id = props.id;
72
+ var mutilple = props.mutilple, onChange = props.onChange, variant = props.variant, id = props.id, accept = props.accept;
73
73
  var handleFileUpload = function () {
74
74
  inputRef.current.click();
75
75
  };
76
76
  return (react_1.default.createElement(react_1.default.Fragment, null,
77
- react_1.default.createElement("input", { id: id, ref: inputRef, type: "file", multiple: mutilple, onChange: onChange, style: { display: 'none' } }),
77
+ react_1.default.createElement("input", { id: id, ref: inputRef, type: "file", accept: accept, multiple: mutilple, onChange: onChange, style: { display: 'none' } }),
78
78
  react_1.default.createElement(ButtonStyledWrapper, { props: __assign(__assign({}, props), { onClick: handleFileUpload }), variant: variant || 'secondary' })));
79
79
  };
80
80
  exports.UploadButton = UploadButton;
@@ -0,0 +1 @@
1
+ export function Section(props: any): JSX.Element;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Section = void 0;
18
+ var react_1 = __importDefault(require("react"));
19
+ var index_styled_1 = require("./index.styled");
20
+ /*
21
+ especially meant for usecases where
22
+ the page container has a max width, but we need its bottom border to stretch the full
23
+ width of the screen
24
+ */
25
+ /**
26
+ * props can be any valid color value,
27
+ * can be borderBottom/Top/Left/Right
28
+ * can be style, className & children
29
+ */
30
+ var Section = function (props) {
31
+ return (react_1.default.createElement(index_styled_1.StyledSection, __assign({}, props), props.children));
32
+ };
33
+ exports.Section = Section;
@@ -0,0 +1 @@
1
+ export const StyledSection: any;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.StyledSection = void 0;
11
+ var styled_components_1 = __importDefault(require("styled-components"));
12
+ var colors_1 = require("../../themes/colors");
13
+ var setBorder = function (_a) {
14
+ var _b;
15
+ var props = _a.props;
16
+ var borderStyles = "";
17
+ var greyColor15 = (((_b = props.theme) === null || _b === void 0 ? void 0 : _b.colors) || colors_1.colors).greyColor15;
18
+ if (props.borderTop || props.borderRight || props.borderLeft || props.borderBottom) {
19
+ if (props.borderTop)
20
+ borderStyles += "border-top: 1px solid ".concat(greyColor15, ";");
21
+ if (props.borderLeft)
22
+ borderStyles += "border-left: 1px solid ".concat(greyColor15, ";");
23
+ if (props.borderRight)
24
+ borderStyles += "border-right: 1px solid ".concat(greyColor15, ";");
25
+ if (props.borderBottom)
26
+ borderStyles += "border-bottom: 1px solid ".concat(greyColor15, ";");
27
+ }
28
+ return borderStyles;
29
+ };
30
+ var setFill = function (_a) {
31
+ var props = _a.props;
32
+ var colorsObj = props.theme.colors || colors_1.colors;
33
+ var colorKey = Object.keys(props).find(function (p) { return !!colorsObj[p]; });
34
+ return colorKey ? "background-color: ".concat(colorsObj[colorKey], ";") : '';
35
+ };
36
+ exports.StyledSection = styled_components_1.default.section(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (props) { return setBorder({ props: props }); }, function (props) { return setFill({ props: props }); });
37
+ var templateObject_1;
@@ -17,7 +17,7 @@ export function TagClear({ id, display, value, M, invert, onClick, theme, varian
17
17
  variant?: string;
18
18
  grey: any;
19
19
  }): JSX.Element;
20
- export function TagSelect({ onClick, isSelected, display, value, M, theme, style }: {
20
+ export function TagSelect({ onClick, isSelected, display, value, M, theme, style, onMouseDown }: {
21
21
  onClick: any;
22
22
  isSelected?: boolean;
23
23
  display: any;
@@ -25,6 +25,7 @@ export function TagSelect({ onClick, isSelected, display, value, M, theme, style
25
25
  M: any;
26
26
  theme: any;
27
27
  style: any;
28
+ onMouseDown: any;
28
29
  }): JSX.Element;
29
30
  export function TagLink({ display, to, invert, M, theme, variant }: {
30
31
  display: any;
@@ -42,7 +42,7 @@ function TagClear(_a) {
42
42
  }
43
43
  exports.TagClear = TagClear;
44
44
  function TagSelect(_a) {
45
- var onClick = _a.onClick, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b, display = _a.display, value = _a.value, M = _a.M, theme = _a.theme, style = _a.style;
45
+ var onClick = _a.onClick, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b, display = _a.display, value = _a.value, M = _a.M, theme = _a.theme, style = _a.style, onMouseDown = _a.onMouseDown;
46
46
  var _c = (0, react_1.useState)(isSelected), selected = _c[0], setSelected = _c[1];
47
47
  var handleOnClick = function () {
48
48
  setSelected(!selected);
@@ -54,7 +54,7 @@ function TagSelect(_a) {
54
54
  }
55
55
  }, [isSelected]);
56
56
  var size = M ? 'M' : 'S';
57
- return (react_1.default.createElement(index_styled_1.StyledTagSelect, { theme: theme, onClick: handleOnClick, selected: selected, size: size, style: style },
57
+ return (react_1.default.createElement(index_styled_1.StyledTagSelect, { theme: theme, onClick: onMouseDown ? function () { return null; } : handleOnClick, selected: selected, size: size, style: style, onMouseDown: onMouseDown },
58
58
  react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, display)));
59
59
  }
60
60
  exports.TagSelect = TagSelect;
package/dist/index.d.ts CHANGED
@@ -12,3 +12,4 @@ export * from "./components/Wrappers";
12
12
  export * from "./themes/mixins";
13
13
  export { colors } from "./themes";
14
14
  export { phosphorIcons } from "./icons";
15
+ export { Section } from "./components/Section";
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.phosphorIcons = exports.colors = exports.GlobalStyles = void 0;
13
+ exports.Section = exports.phosphorIcons = exports.colors = exports.GlobalStyles = void 0;
14
14
  var globalStyles_1 = require("./globalStyles");
15
15
  Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
16
16
  __exportStar(require("./components/Typo"), exports);
@@ -27,4 +27,6 @@ __exportStar(require("./components/InlineAlert"), exports);
27
27
  __exportStar(require("./components/TextInputs"), exports);
28
28
  __exportStar(require("./components/Container"), exports);
29
29
  __exportStar(require("./components/Wrappers"), exports);
30
+ var Section_1 = require("./components/Section");
31
+ Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return Section_1.Section; } });
30
32
  __exportStar(require("./themes/mixins"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.7.6",
3
+ "version": "2.8.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",