@proprioo/salatim 23.0.0 → 23.1.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,10 +1,10 @@
1
- import { FC, MouseEvent, ReactElement } from 'react';
1
+ import { FC, MouseEvent, ReactNode } from 'react';
2
2
  import { ButtonAppearance, ButtonSizes, ButtonTheme, IconPosition } from './Button.interfaces';
3
3
  export interface ButtonProps {
4
4
  label: string;
5
5
  appearance?: ButtonAppearance;
6
6
  disabled?: boolean;
7
- icon?: ReactElement<Element>;
7
+ icon?: ReactNode;
8
8
  iconPosition?: IconPosition;
9
9
  id?: string;
10
10
  rounded?: boolean;
@@ -1,4 +1,23 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
2
21
  var __rest = (this && this.__rest) || function (s, e) {
3
22
  var t = {};
4
23
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -10,17 +29,19 @@ var __rest = (this && this.__rest) || function (s, e) {
10
29
  }
11
30
  return t;
12
31
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
32
  Object.defineProperty(exports, "__esModule", { value: true });
17
- const react_1 = __importDefault(require("react"));
33
+ const react_1 = __importStar(require("react"));
18
34
  const Button_interfaces_1 = require("./Button.interfaces");
19
35
  const Button_styles_1 = require("./Button.styles");
20
36
  const Button = (_a) => {
21
37
  var { appearance = Button_interfaces_1.ButtonAppearance.PRIMARY, icon, iconPosition = Button_interfaces_1.IconPosition.RIGHT, label, rounded = false, size = Button_interfaces_1.ButtonSizes.LARGE, theme = Button_interfaces_1.ButtonTheme.ORANGE } = _a, rest = __rest(_a, ["appearance", "icon", "iconPosition", "label", "rounded", "size", "theme"]);
22
38
  return (react_1.default.createElement(Button_styles_1.Layout, Object.assign({}, Object.assign({ appearance, icon, iconPosition, rounded, size, theme }, rest), { "aria-label": label }),
23
- icon && (react_1.default.createElement(Button_styles_1.IconWrapper, Object.assign({}, { appearance, iconPosition, size, theme }, { "data-test": iconPosition === Button_interfaces_1.IconPosition.LEFT ? 'icon-left' : 'icon-right' }), icon)),
39
+ icon && (react_1.default.createElement(Button_styles_1.IconWrapper, Object.assign({}, { appearance, iconPosition, size, theme }, { "data-test": iconPosition === Button_interfaces_1.IconPosition.LEFT ? 'icon-left' : 'icon-right' }), (0, react_1.isValidElement)(icon)
40
+ ? (0, react_1.cloneElement)(icon, {
41
+ 'aria-hidden': true,
42
+ focusable: false
43
+ })
44
+ : icon)),
24
45
  !rounded && react_1.default.createElement(Button_styles_1.LabelLayout, { "data-test": "label" }, label)));
25
46
  };
26
47
  exports.default = Button;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../packages/ui/src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4D;AAE5D,2DAK6B;AAC7B,mDAAmE;AAgBnE,MAAM,MAAM,GAAoB,CAAC,EASnB,EAAE,EAAE;QATe,EAC/B,UAAU,GAAG,oCAAgB,CAAC,OAAO,EACrC,IAAI,EACJ,YAAY,GAAG,gCAAY,CAAC,KAAK,EACjC,KAAK,EACL,OAAO,GAAG,KAAK,EACf,IAAI,GAAG,+BAAW,CAAC,KAAK,EACxB,KAAK,GAAG,+BAAW,CAAC,MAAM,OAEd,EADT,IAAI,cARwB,2EAShC,CADQ;IACU,OAAA,CACjB,8BAAC,sBAAM,oCACC,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,IAAK,IAAI,mBACvD,KAAK;QAEhB,IAAI,IAAI,CACP,8BAAC,2BAAW,oBACN,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,iBAE3C,YAAY,KAAK,gCAAY,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,KAGhE,IAAI,CACO,CACf;QACA,CAAC,OAAO,IAAI,8BAAC,2BAAW,iBAAW,OAAO,IAAE,KAAK,CAAe,CAC1D,CACV,CAAA;CAAA,CAAC;AAEF,kBAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../packages/ui/src/button/Button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAMe;AAEf,2DAK6B;AAC7B,mDAAmE;AAgBnE,MAAM,MAAM,GAAoB,CAAC,EASnB,EAAE,EAAE;QATe,EAC/B,UAAU,GAAG,oCAAgB,CAAC,OAAO,EACrC,IAAI,EACJ,YAAY,GAAG,gCAAY,CAAC,KAAK,EACjC,KAAK,EACL,OAAO,GAAG,KAAK,EACf,IAAI,GAAG,+BAAW,CAAC,KAAK,EACxB,KAAK,GAAG,+BAAW,CAAC,MAAM,OAEd,EADT,IAAI,cARwB,2EAShC,CADQ;IACU,OAAA,CACjB,8BAAC,sBAAM,oCACC,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,IAAK,IAAI,mBACvD,KAAK;QAEhB,IAAI,IAAI,CACP,8BAAC,2BAAW,oBACN,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,iBAE3C,YAAY,KAAK,gCAAY,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,KAGhE,IAAA,sBAAc,EAAC,IAAI,CAAC;YACnB,CAAC,CAAC,IAAA,oBAAY,EAAC,IAAI,EAAE;gBACjB,aAAa,EAAE,IAAI;gBACnB,SAAS,EAAE,KAAK;aACjB,CAAC;YACJ,CAAC,CAAC,IAAI,CACI,CACf;QACA,CAAC,OAAO,IAAI,8BAAC,2BAAW,iBAAW,OAAO,IAAE,KAAK,CAAe,CAC1D,CACV,CAAA;CAAA,CAAC;AAEF,kBAAe,MAAM,CAAC"}
@@ -8,13 +8,13 @@ const addon_actions_1 = require("@storybook/addon-actions");
8
8
  const addon_knobs_1 = require("@storybook/addon-knobs");
9
9
  const react_2 = require("@storybook/react");
10
10
  const utils_1 = require("../../../utils");
11
- const icons_1 = __importDefault(require("../icons"));
12
11
  const Button_1 = __importDefault(require("./Button"));
13
12
  const Button_interfaces_1 = require("./Button.interfaces");
14
- const { Arrow } = icons_1.default;
13
+ const Arrow = (react_1.default.createElement("svg", { viewBox: "0 0 32 32" },
14
+ react_1.default.createElement("path", { fill: "currentColor", d: "M16.5 10a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zm-.66 10.292-.965-.948 2.844-2.844-2.844-2.844.965-.948 3.775 3.792-3.775 3.792z" })));
15
15
  const knobs = () => ({
16
16
  disabled: (0, addon_knobs_1.boolean)('Disabled', false),
17
- icon: react_1.default.createElement(Arrow, null),
17
+ icon: Arrow,
18
18
  iconPosition: (0, addon_knobs_1.select)('Icon position', Button_interfaces_1.IconPosition, Button_interfaces_1.IconPosition.RIGHT),
19
19
  label: (0, addon_knobs_1.text)('Label', 'Click me please'),
20
20
  rounded: (0, addon_knobs_1.boolean)('Rounded', false),
@@ -1 +1 @@
1
- {"version":3,"file":"Button.stories.js","s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C,8BAAC,gBAAM,sCAAU,KAAK,EAAE,KAAI,UAAU,EAAE,oCAAgB,CAAC,OAAO,IAAI,CAChE,CACP,CAAC;KACD,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,CACtB,uCAAK,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;IAClC,8BAAC,gBAAM,sCAAU,KAAK,EAAE,KAAI,UAAU,EAAE,oCAAgB,CAAC,SAAS,IAAI,CAClE,CACP,CAAC;KACD,GAAG,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,CAC1B,uCAAK,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;IAClC,8BAAC,gBAAM,sCAAU,KAAK,EAAE,KAAI,UAAU,EAAE,oCAAgB,CAAC,aAAa,IAAI,CACtE,CACP,CAAC;KACD,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAClB,uCAAK,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;IAClC,8BAAC,gBAAM,sCAAU,KAAK,EAAE,KAAI,UAAU,EAAE,oCAAgB,CAAC,KAAK,IAAI,CAC9D,CACP,CAAC,CAAC"}
1
+ {"version":3,"file":"Button.stories.js","sourceRoot":"","sources":["../../../../packages/ui/src/button/Button.stories.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAE1B,4DAAkD;AAClD,wDAA+D;AAC/D,4CAA6C;AAE7C,0CAAwC;AACxC,sDAA8B;AAC9B,2DAK6B;AAE7B,MAAM,KAAK,GAAG,CACZ,uCAAK,OAAO,EAAC,WAAW;IACtB,wCACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,iIAAiI,GACnI,CACE,CACP,CAAC;AAEF,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC;IACnB,QAAQ,EAAE,IAAA,qBAAO,EAAC,UAAU,EAAE,KAAK,CAAC;IACpC,IAAI,EAAE,KAAK;IACX,YAAY,E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AAC,KAAK,EAAE,CAAC,KAAK,CAAC;IAClC,8BAAC,gBAAM,sCAAU,KAAK,EAAE,KAAI,UAAU,EAAE,oCAAgB,CAAC,aAAa,IAAI,CACtE,CACP,CAAC;KACD,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAClB,uCAAK,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;IAClC,8BAAC,gBAAM,sCAAU,KAAK,EAAE,KAAI,UAAU,EAAE,oCAAgB,CAAC,KAAK,IAAI,CAC9D,CACP,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proprioo/salatim",
3
- "version": "23.0.0",
3
+ "version": "23.1.0",
4
4
  "description": "Proprioo component library",
5
5
  "keywords": [
6
6
  "components",