@modul/mbui 0.0.13-beta-pv-53036-3e26be0c → 0.0.13-beta-pv-53036-7c290859

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.
@@ -10,7 +10,7 @@ const InputLabel = React.forwardRef(({ className, children, ...props }) => {
10
10
  exports.InputLabel = InputLabel;
11
11
  InputLabel.displayName = 'InputLabel';
12
12
  const InputField = React.forwardRef(({ className, type, ...props }, ref) => {
13
- return (React.createElement("input", { type: type, className: (0, utils_1.cn)('border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-sm focus-visible:ring-1 focus-visible:ring-ring w-full h-[44px] file:font-medium file:text-sm placeholder:text-muted-foreground leading-[1.17] transition-colors focus-visible:outline-none disabled:cursor-not-allowed', className), ref: ref, ...props }));
13
+ return (React.createElement("input", { type: type, className: (0, utils_1.cn)('form-input border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-sm focus-visible:ring-1 focus-visible:ring-ring w-full h-[44px] file:font-medium file:text-sm placeholder:text-muted-foreground leading-[1.17] transition-colors focus-visible:outline-none disabled:cursor-not-allowed', className), ref: ref, ...props }));
14
14
  });
15
15
  exports.InputField = InputField;
16
16
  InputField.displayName = 'InputField';
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,0CAAmC;AAEnC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACrC,OAAO,CACN,+BACC,SAAS,EAAE,IAAA,UAAE,EAAC,0GAA0G,EAAE,SAAS,CAAC,KAChI,KAAK,IAER,QAAQ,CACF,CACR,CAAA;AACF,CAAC,CACD,CAAA;AAoBoB,gCAAU;AAlB/B,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAgE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzI,OAAO,CACN,+BACC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAA,UAAE,EACZ,sUAAsU,EACtU,SAAS,CACT,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACR,CACF,CAAA;AACF,CAAC,CAAC,CAAA;AAIO,gCAAU;AAFnB,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA"}
1
+ {"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/Input/Input.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,0CAAmC;AAEnC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAClC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACrC,OAAO,CACN,+BACC,SAAS,EAAE,IAAA,UAAE,EAAC,0GAA0G,EAAE,SAAS,CAAC,KAChI,KAAK,IAER,QAAQ,CACF,CACR,CAAA;AACF,CAAC,CACD,CAAA;AAoBoB,gCAAU;AAlB/B,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA;AAErC,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAgE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACzI,OAAO,CACN,+BACC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,IAAA,UAAE,EACZ,iVAAiV,EACjV,SAAS,CACT,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACR,CACF,CAAA;AACF,CAAC,CAAC,CAAA;AAIO,gCAAU;AAFnB,UAAU,CAAC,WAAW,GAAG,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare const InputMask: React.FC;
3
+ export { InputMask };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InputMask = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = (0, tslib_1.__importStar)(require("react"));
6
+ const react_imask_1 = require("react-imask");
7
+ const inputClasses = 'form-input border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-sm focus-visible:ring-1 focus-visible:ring-ring w-full h-[44px] file:font-medium file:text-sm placeholder:text-muted-foreground leading-[1.17] transition-colors focus-visible:outline-none disabled:cursor-not-allowed';
8
+ const InputMask = ({ ...props }) => {
9
+ return (React.createElement(react_imask_1.IMaskInput, { className: inputClasses, ...props }));
10
+ };
11
+ exports.InputMask = InputMask;
12
+ //# sourceMappingURL=InputMask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputMask.js","sourceRoot":"","sources":["../../src/Input/InputMask.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,6CAAwC;AAExC,MAAM,YAAY,GAAG,iVAAiV,CAAA;AAEtW,MAAM,SAAS,GAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC5C,OAAO,CACN,oBAAC,wBAAU,IACV,SAAS,EAAE,YAAY,KACnB,KAAK,GACR,CACF,CAAA;AACF,CAAC,CAAA;AAEQ,8BAAS"}
@@ -1 +1,2 @@
1
1
  export { InputField, InputLabel } from './Input';
2
+ export { InputMask } from './InputMask';
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InputLabel = exports.InputField = void 0;
3
+ exports.InputMask = exports.InputLabel = exports.InputField = void 0;
4
4
  var Input_1 = require("./Input");
5
5
  Object.defineProperty(exports, "InputField", { enumerable: true, get: function () { return Input_1.InputField; } });
6
6
  Object.defineProperty(exports, "InputLabel", { enumerable: true, get: function () { return Input_1.InputLabel; } });
7
+ var InputMask_1 = require("./InputMask");
8
+ Object.defineProperty(exports, "InputMask", { enumerable: true, get: function () { return InputMask_1.InputMask; } });
7
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Input/index.ts"],"names":[],"mappings":";;;AAAA,iCAAgD;AAAvC,mGAAA,UAAU,OAAA;AAAE,mGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Input/index.ts"],"names":[],"mappings":";;;AAAA,iCAAgD;AAAvC,mGAAA,UAAU,OAAA;AAAE,mGAAA,UAAU,OAAA;AAC/B,yCAAuC;AAA9B,sGAAA,SAAS,OAAA"}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ declare const SelectAsync: {
3
+ ({ ...props }: {
4
+ [x: string]: any;
5
+ }): React.JSX.Element;
6
+ displayName: string;
7
+ };
8
+ export { SelectAsync };
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SelectAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = (0, tslib_1.__importStar)(require("react"));
6
+ const Icon_1 = require("../Icon");
7
+ const react_select_1 = require("react-select");
8
+ const async_1 = (0, tslib_1.__importDefault)(require("react-select/async"));
9
+ const utils_1 = require("../@/lib/utils");
10
+ const selectTriggerClasses = 'flex items-center border-[1px] border-input rounded-md h-[44px] text-left px-[16px] py-[12px] cursor-pointer';
11
+ const colourStyles = {
12
+ control: () => ({}),
13
+ option: () => ({}),
14
+ input: () => ({}),
15
+ dropdownIndicator: () => ({}),
16
+ indicatorsContainer: () => ({}),
17
+ menu: () => ({}),
18
+ menuList: () => ({}),
19
+ singleValue: () => ({}),
20
+ valueContainer: () => ({}),
21
+ };
22
+ const Input = ({ ...props }) => {
23
+ return React.createElement(react_select_1.components.Input, { className: 'col-start-1 col-end-3 row-start-1 row-end-2', ...props });
24
+ };
25
+ const Control = ({ children, ...props }) => {
26
+ const { isFocused } = props;
27
+ return (React.createElement(react_select_1.components.Control, { className: (0, utils_1.cn)(selectTriggerClasses, { 'outline outline-primary outline-offset-2 outline-2': isFocused }), ...props }, children));
28
+ };
29
+ const optionClasses = 'flex items-center first:rounded-t-md last:rounded-b-md px-[16px] py-[12px] w-full cursor-default select-none outline-none';
30
+ const Option = ({ children, ...props }) => {
31
+ const { isSelected, isFocused, isDisabled,
32
+ // @ts-ignore
33
+ data: { label, account, balance, cur }, } = props;
34
+ return (React.createElement(react_select_1.components.Option, { className: (0, utils_1.cn)(optionClasses, { 'bg-light': isFocused }, { 'opacity-50 pointer-events-none': isDisabled }), ...props },
35
+ React.createElement("span", { className: "flex basis-0 grow" }, children),
36
+ React.createElement("span", { className: "ml-[16px] w-[24px] h-[24px] shrink-0" }, isSelected && (React.createElement(Icon_1.CheckSmall, { width: "24", height: "24", className: "text-primary" })))));
37
+ };
38
+ const IndicatorsContainer = ({ children, ...props }) => {
39
+ return (React.createElement(react_select_1.components.IndicatorsContainer, { className: 'flex items-center gap-x-[8px] shrink-0', ...props }, children));
40
+ };
41
+ const LoadingIndicator = ({ ...props }) => {
42
+ return (React.createElement(react_select_1.components.LoadingIndicator, { className: 'text-light shrink-0', ...props }));
43
+ };
44
+ const DropdownIndicator = ({ children, ...props }) => {
45
+ return (React.createElement(react_select_1.components.DropdownIndicator, { className: "shrink-0", ...props },
46
+ React.createElement(Icon_1.DropdownSmallOld, { className: "text-light", width: "12", height: "12" })));
47
+ };
48
+ const ValueContainer = ({ children, ...props }) => {
49
+ return (React.createElement(react_select_1.components.ValueContainer, { className: "flex-1 grid", ...props }, children));
50
+ };
51
+ const SingleValue = ({ children, ...props }) => {
52
+ return (React.createElement(react_select_1.components.SingleValue, { className: "col-start-1 col-end-3 row-start-1 row-end-2", ...props }, children));
53
+ };
54
+ const Menu = ({ children, ...props }) => {
55
+ return (React.createElement(react_select_1.components.Menu, { className: "absolute inset-x-0 bg-page drop-shadow-1 mt-[8px] rounded-md", ...props }, children));
56
+ };
57
+ const Placeholder = ({ children, ...props }) => {
58
+ return (React.createElement(react_select_1.components.Placeholder, { className: "col-start-1 col-end-3 row-start-1 row-end-2 text-[16px] text-light truncate", ...props }, children));
59
+ };
60
+ const SelectAsync = ({ ...props }) => (React.createElement(async_1.default, { classNamePrefix: 'red', components: {
61
+ Control,
62
+ Option,
63
+ SingleValue,
64
+ DropdownIndicator,
65
+ IndicatorSeparator: () => null,
66
+ Menu,
67
+ ValueContainer,
68
+ Placeholder,
69
+ Input,
70
+ LoadingIndicator,
71
+ IndicatorsContainer
72
+ }, styles: colourStyles, unstyled: true, ...props }));
73
+ exports.SelectAsync = SelectAsync;
74
+ SelectAsync.displayName = 'SelectAsync';
75
+ //# sourceMappingURL=SelectAsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectAsync.js","sourceRoot":"","sources":["../../src/Select/SelectAsync.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAE9B,kCAAsD;AAEtD,+CAaqB;AAErB,4EAA4C;AAE5C,0CAAmC;AAEnC,MAAM,oBAAoB,GACzB,8GAA8G,CAAA;AAE/G,MAAM,YAAY,GAAiB;IAClC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IAClB,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACjB,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IAC7B,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IAChB,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACpB,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACvB,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;CAC1B,CAAA;AAED,MAAM,KAAK,GAAG,CAAC,EAAC,GAAG,KAAK,EAAc,EAAE,EA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CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB,EAAE,EAAE;IAChE,OAAO,CACN,oBAAC,yBAAU,CAAC,WAAW,IACtB,SAAS,EAAC,6EAA6E,KACnF,KAAK,IAER,QAAQ,CACe,CACzB,CAAA;AACF,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CACrC,oBAAC,eAAW,IACZ,eAAe,EAAC,KAAK,EACpB,UAAU,EAAE;QACX,OAAO;QACP,MAAM;QACN,WAAW;QACX,iBAAiB;QACjB,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI;QAC9B,IAAI;QACJ,cAAc;QACd,WAAW;QACX,KAAK;QACL,gBAAgB;QAChB,mBAAmB;KACnB,EACD,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,IAAI,KACV,KAAK,GACR,CACF,CAAA;AAIQ,kCAAW;AAFpB,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA"}
@@ -1 +1,2 @@
1
1
  export { SelectAccountCard } from './SelectAccountCard';
2
+ export { SelectAsync } from './SelectAsync';
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SelectAccountCard = void 0;
3
+ exports.SelectAsync = exports.SelectAccountCard = void 0;
4
4
  var SelectAccountCard_1 = require("./SelectAccountCard");
5
5
  Object.defineProperty(exports, "SelectAccountCard", { enumerable: true, get: function () { return SelectAccountCard_1.SelectAccountCard; } });
6
+ var SelectAsync_1 = require("./SelectAsync");
7
+ Object.defineProperty(exports, "SelectAsync", { enumerable: true, get: function () { return SelectAsync_1.SelectAsync; } });
8
+ // export { Select } from './Select'
6
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Select/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Select/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,oCAAoC"}
package/dist/index.d.ts CHANGED
@@ -14,12 +14,12 @@ import { cn } from './@/lib/utils';
14
14
  import { Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent } from './Drawer';
15
15
  import { Page } from './Page';
16
16
  import { Chip } from './Chip';
17
- import { InputField, InputLabel } from './Input';
17
+ import { InputField, InputLabel, InputMask } from './Input';
18
18
  import { Alert } from './Alert';
19
19
  import { Switch } from './Switch';
20
20
  import { Label } from './Label';
21
21
  import { Textarea } from './Textarea';
22
- import { SelectAccountCard } from './Select';
22
+ import { SelectAccountCard, SelectAsync } from './Select';
23
23
  import { Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage } from './Form';
24
24
  import { Calendar } from './Calendar';
25
- export { Tooltip, Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, Chip, Alert, Switch, Label, Textarea, SelectAccountCard, Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage, Calendar, };
25
+ export { Tooltip, Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, Chip, Alert, Switch, Label, Textarea, SelectAccountCard, Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage, Calendar, SelectAsync, InputMask, };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Calendar = exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormItem = exports.FormField = exports.FormLabel = exports.Form = exports.SelectAccountCard = exports.Textarea = exports.Label = exports.Switch = exports.Alert = exports.Chip = exports.Page = exports.BottomNavigationLink = exports.BottomNavigationListItem = exports.BottomNavigationList = exports.BottomNavigation = exports.DrawerContent = exports.DrawerClose = exports.DrawerTitle = exports.DrawerTrigger = exports.Drawer = exports.Icon = exports.cn = exports.Audio = exports.InputLabel = exports.InputField = exports.Button = exports.AccountCollapsibleContentItem = exports.AccountCollapsibleContent = exports.AccountCollapsibleTrigger = exports.AccountCollapsibleHeader = exports.AccountCollapsible = exports.CollapsibleContent = exports.CollapsibleTrigger = exports.Collapsible = exports.InputOTPSeparator = exports.InputOTPSlot = exports.InputOTPGroup = exports.InputOTP = exports.Logo = exports.Popover = exports.Slider = exports.Tabs = exports.Tooltip = void 0;
3
+ exports.InputMask = exports.SelectAsync = exports.Calendar = exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormItem = exports.FormField = exports.FormLabel = exports.Form = exports.SelectAccountCard = exports.Textarea = exports.Label = exports.Switch = exports.Alert = exports.Chip = exports.Page = exports.BottomNavigationLink = exports.BottomNavigationListItem = exports.BottomNavigationList = exports.BottomNavigation = exports.DrawerContent = exports.DrawerClose = exports.DrawerTitle = exports.DrawerTrigger = exports.Drawer = exports.Icon = exports.cn = exports.Audio = exports.InputLabel = exports.InputField = exports.Button = exports.AccountCollapsibleContentItem = exports.AccountCollapsibleContent = exports.AccountCollapsibleTrigger = exports.AccountCollapsibleHeader = exports.AccountCollapsible = exports.CollapsibleContent = exports.CollapsibleTrigger = exports.Collapsible = exports.InputOTPSeparator = exports.InputOTPSlot = exports.InputOTPGroup = exports.InputOTP = exports.Logo = exports.Popover = exports.Slider = exports.Tabs = exports.Tooltip = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Tooltip_1 = require("./Tooltip");
6
6
  Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
@@ -53,6 +53,7 @@ Object.defineProperty(exports, "Chip", { enumerable: true, get: function () { re
53
53
  const Input_1 = require("./Input");
54
54
  Object.defineProperty(exports, "InputField", { enumerable: true, get: function () { return Input_1.InputField; } });
55
55
  Object.defineProperty(exports, "InputLabel", { enumerable: true, get: function () { return Input_1.InputLabel; } });
56
+ Object.defineProperty(exports, "InputMask", { enumerable: true, get: function () { return Input_1.InputMask; } });
56
57
  const Alert_1 = require("./Alert");
57
58
  Object.defineProperty(exports, "Alert", { enumerable: true, get: function () { return Alert_1.Alert; } });
58
59
  const Switch_1 = require("./Switch");
@@ -63,6 +64,7 @@ const Textarea_1 = require("./Textarea");
63
64
  Object.defineProperty(exports, "Textarea", { enumerable: true, get: function () { return Textarea_1.Textarea; } });
64
65
  const Select_1 = require("./Select");
65
66
  Object.defineProperty(exports, "SelectAccountCard", { enumerable: true, get: function () { return Select_1.SelectAccountCard; } });
67
+ Object.defineProperty(exports, "SelectAsync", { enumerable: true, get: function () { return Select_1.SelectAsync; } });
66
68
  const Form_1 = require("./Form");
67
69
  Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return Form_1.Form; } });
68
70
  Object.defineProperty(exports, "FormLabel", { enumerable: true, get: function () { return Form_1.FormLabel; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,uCAAmC;AAsClC,wFAtCQ,iBAAO,OAsCR;AArCR,iCAA6B;AAsC5B,qFAtCQ,WAAI,OAsCR;AAr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  {
2
2
  "name": "@modul/mbui",
3
- "version": "0.0.13-beta-pv-53036-3e26be0c",
3
+ "version": "0.0.13-beta-pv-53036-7c290859",
4
4
  "packageManager": "yarn@3.5.1",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "react-datepicker": "4.16.0",
43
43
  "react-day-picker": "^9.0.8",
44
44
  "react-hook-form": "7.53.0",
45
- "react-imask": "7.1.3",
45
+ "react-imask": "7.6.1",
46
46
  "react-select": "5.8.0",
47
47
  "tailwind-merge": "^2.3.0",
48
48
  "tailwindcss": "^3.4.4",
@@ -21,7 +21,7 @@ const InputField = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<
21
21
  <input
22
22
  type={type}
23
23
  className={cn(
24
- 'border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-sm focus-visible:ring-1 focus-visible:ring-ring w-full h-[44px] file:font-medium file:text-sm placeholder:text-muted-foreground leading-[1.17] transition-colors focus-visible:outline-none disabled:cursor-not-allowed',
24
+ 'form-input border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-sm focus-visible:ring-1 focus-visible:ring-ring w-full h-[44px] file:font-medium file:text-sm placeholder:text-muted-foreground leading-[1.17] transition-colors focus-visible:outline-none disabled:cursor-not-allowed',
25
25
  className
26
26
  )}
27
27
  ref={ref}
@@ -0,0 +1,15 @@
1
+ import * as React from 'react'
2
+ import { IMaskInput } from 'react-imask'
3
+
4
+ const inputClasses = 'form-input border-input file:border-0 bg-transparent font-normal file:bg-transparent disabled:opacity-50 border rounded-sm focus-visible:ring-1 focus-visible:ring-ring w-full h-[44px] file:font-medium file:text-sm placeholder:text-muted-foreground leading-[1.17] transition-colors focus-visible:outline-none disabled:cursor-not-allowed'
5
+
6
+ const InputMask: React.FC = ({ ...props }) => {
7
+ return (
8
+ <IMaskInput
9
+ className={inputClasses}
10
+ {...props}
11
+ />
12
+ )
13
+ }
14
+
15
+ export { InputMask }
@@ -1 +1,2 @@
1
- export { InputField, InputLabel } from './Input'
1
+ export { InputField, InputLabel } from './Input'
2
+ export { InputMask } from './InputMask'
@@ -0,0 +1,186 @@
1
+ import * as React from 'react'
2
+
3
+ import { DropdownSmallOld, CheckSmall } from '../Icon'
4
+
5
+ import {
6
+ components,
7
+ ControlProps,
8
+ OptionProps,
9
+ DropdownIndicatorProps,
10
+ StylesConfig,
11
+ SingleValueProps,
12
+ MenuProps,
13
+ PlaceholderProps,
14
+ ValueContainerProps,
15
+ InputProps,
16
+ LoadingIndicatorProps,
17
+ IndicatorsContainerProps,
18
+ } from 'react-select'
19
+
20
+ import AsyncSelect from 'react-select/async'
21
+
22
+ import { cn } from '../@/lib/utils'
23
+
24
+ const selectTriggerClasses: string =
25
+ 'flex items-center border-[1px] border-input rounded-md h-[44px] text-left px-[16px] py-[12px] cursor-pointer'
26
+
27
+ const colourStyles: StylesConfig = {
28
+ control: () => ({}),
29
+ option: () => ({}),
30
+ input: () => ({}),
31
+ dropdownIndicator: () => ({}),
32
+ indicatorsContainer: () => ({}),
33
+ menu: () => ({}),
34
+ menuList: () => ({}),
35
+ singleValue: () => ({}),
36
+ valueContainer: () => ({}),
37
+ }
38
+
39
+ const Input = ({...props }: InputProps) => {
40
+ return <components.Input className='col-start-1 col-end-3 row-start-1 row-end-2' {...props} />
41
+ }
42
+
43
+ const Control = ({ children, ...props }: ControlProps) => {
44
+ const { isFocused } = props
45
+ return (
46
+ <components.Control
47
+ className={cn(selectTriggerClasses, { 'outline outline-primary outline-offset-2 outline-2': isFocused })}
48
+ {...props}
49
+ >
50
+ {children}
51
+ </components.Control>
52
+ )
53
+ }
54
+
55
+ const optionClasses =
56
+ 'flex items-center first:rounded-t-md last:rounded-b-md px-[16px] py-[12px] w-full cursor-default select-none outline-none'
57
+
58
+ const Option = ({ children, ...props }: OptionProps) => {
59
+ const {
60
+ isSelected,
61
+ isFocused,
62
+ isDisabled,
63
+ // @ts-ignore
64
+ data: { label, account, balance, cur },
65
+ } = props
66
+ return (
67
+ <components.Option
68
+ className={cn(optionClasses, { 'bg-light': isFocused }, { 'opacity-50 pointer-events-none': isDisabled })}
69
+ {...props}
70
+ >
71
+ <span className="flex basis-0 grow">{children}</span>
72
+
73
+ <span className="ml-[16px] w-[24px] h-[24px] shrink-0">
74
+ {isSelected && (
75
+ <CheckSmall
76
+ width="24"
77
+ height="24"
78
+ className="text-primary"
79
+ />
80
+ )}
81
+ </span>
82
+ </components.Option>
83
+ )
84
+ }
85
+
86
+ const IndicatorsContainer = ({ children, ...props }: IndicatorsContainerProps) => {
87
+ return (
88
+ <components.IndicatorsContainer className='flex items-center gap-x-[8px] shrink-0' {...props}>
89
+ {children}
90
+ </components.IndicatorsContainer>
91
+ )
92
+ }
93
+
94
+ const LoadingIndicator = ({...props }: LoadingIndicatorProps) => {
95
+ return (
96
+ <components.LoadingIndicator
97
+ className='text-light shrink-0'
98
+ {...props}
99
+ />
100
+ )
101
+ }
102
+
103
+ const DropdownIndicator = ({ children, ...props }: DropdownIndicatorProps) => {
104
+ return (
105
+ <components.DropdownIndicator
106
+ className="shrink-0"
107
+ {...props}
108
+ >
109
+ <DropdownSmallOld
110
+ className="text-light"
111
+ width="12"
112
+ height="12"
113
+ />
114
+ </components.DropdownIndicator>
115
+ )
116
+ }
117
+
118
+ const ValueContainer = ({ children, ...props }: ValueContainerProps) => {
119
+ return (
120
+ <components.ValueContainer
121
+ className="flex-1 grid"
122
+ {...props}
123
+ >
124
+ {children}
125
+ </components.ValueContainer>
126
+ )
127
+ }
128
+
129
+ const SingleValue = ({ children, ...props }: SingleValueProps) => {
130
+ return (
131
+ <components.SingleValue
132
+ className="col-start-1 col-end-3 row-start-1 row-end-2"
133
+ {...props}
134
+ >
135
+ {children}
136
+ </components.SingleValue>
137
+ )
138
+ }
139
+
140
+ const Menu = ({ children, ...props }: MenuProps) => {
141
+ return (
142
+ <components.Menu
143
+ className="absolute inset-x-0 bg-page drop-shadow-1 mt-[8px] rounded-md"
144
+ {...props}
145
+ >
146
+ {children}
147
+ </components.Menu>
148
+ )
149
+ }
150
+
151
+ const Placeholder = ({ children, ...props }: PlaceholderProps) => {
152
+ return (
153
+ <components.Placeholder
154
+ className="col-start-1 col-end-3 row-start-1 row-end-2 text-[16px] text-light truncate"
155
+ {...props}
156
+ >
157
+ {children}
158
+ </components.Placeholder>
159
+ )
160
+ }
161
+
162
+ const SelectAsync = ({ ...props }) => (
163
+ <AsyncSelect
164
+ classNamePrefix='red'
165
+ components={{
166
+ Control,
167
+ Option,
168
+ SingleValue,
169
+ DropdownIndicator,
170
+ IndicatorSeparator: () => null,
171
+ Menu,
172
+ ValueContainer,
173
+ Placeholder,
174
+ Input,
175
+ LoadingIndicator,
176
+ IndicatorsContainer
177
+ }}
178
+ styles={colourStyles}
179
+ unstyled={true}
180
+ {...props}
181
+ />
182
+ )
183
+
184
+ SelectAsync.displayName = 'SelectAsync'
185
+
186
+ export { SelectAsync }
@@ -1 +1,3 @@
1
1
  export { SelectAccountCard } from './SelectAccountCard'
2
+ export { SelectAsync } from './SelectAsync'
3
+ // export { Select } from './Select'
package/src/index.ts CHANGED
@@ -25,12 +25,12 @@ import { cn } from './@/lib/utils'
25
25
  import { Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent } from './Drawer'
26
26
  import { Page } from './Page'
27
27
  import { Chip } from './Chip'
28
- import { InputField, InputLabel } from './Input'
28
+ import { InputField, InputLabel, InputMask } from './Input'
29
29
  import { Alert } from './Alert'
30
30
  import { Switch } from './Switch'
31
31
  import { Label } from './Label'
32
32
  import { Textarea } from './Textarea'
33
- import { SelectAccountCard } from './Select'
33
+ import { SelectAccountCard, SelectAsync } from './Select'
34
34
  import { Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage } from './Form'
35
35
  import { Calendar } from './Calendar'
36
36
  // import { Datepicker } from './Datepicker'
@@ -84,4 +84,6 @@ export {
84
84
  FormMessage,
85
85
  Calendar,
86
86
  // Datepicker,
87
+ SelectAsync,
88
+ InputMask,
87
89
  }