@modul/mbui 0.0.13-beta-pv-53036-91768058 → 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.
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Calendar/Calendar.d.ts +8 -0
- package/dist/Calendar/Calendar.js +43 -0
- package/dist/Calendar/Calendar.js.map +1 -0
- package/dist/Calendar/index.d.ts +1 -0
- package/dist/Calendar/index.js +6 -0
- package/dist/Calendar/index.js.map +1 -0
- package/dist/Chip/Chip.d.ts +1 -1
- package/dist/Input/Input.js +1 -1
- package/dist/Input/Input.js.map +1 -1
- package/dist/Input/InputMask.d.ts +3 -0
- package/dist/Input/InputMask.js +12 -0
- package/dist/Input/InputMask.js.map +1 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Input/index.js +3 -1
- package/dist/Input/index.js.map +1 -1
- package/dist/Input-OTP/Input.d.ts +4 -4
- package/dist/Select/SelectAsync.d.ts +8 -0
- package/dist/Select/SelectAsync.js +75 -0
- package/dist/Select/SelectAsync.js.map +1 -0
- package/dist/Select/index.d.ts +1 -0
- package/dist/Select/index.js +4 -1
- package/dist/Select/index.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/src/Calendar/Calendar.tsx +59 -0
- package/src/Calendar/index.ts +1 -0
- package/src/Datepicker/Datepicker.tsx +41 -0
- package/src/Datepicker/index.ts +1 -0
- package/src/Input/Input.tsx +1 -1
- package/src/Input/InputMask.tsx +15 -0
- package/src/Input/index.ts +2 -1
- package/src/Select/SelectAsync.tsx +186 -0
- package/src/Select/index.ts +2 -0
- package/src/index.ts +8 -2
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: {
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "primary" | "secondary" | "success" | "primary-outline" | "outline" | "ghost";
|
|
5
5
|
size?: "lg" | "md" | "sm" | "xs" | "xxs";
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
7
7
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DayPicker } from 'react-day-picker';
|
|
3
|
+
export declare type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
4
|
+
declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): React.JSX.Element;
|
|
5
|
+
declare namespace Calendar {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
export { Calendar };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Calendar = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
+
const react_day_picker_1 = require("react-day-picker");
|
|
7
|
+
const utils_1 = require("../@/lib/utils");
|
|
8
|
+
const Button_1 = require("../Button");
|
|
9
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
|
10
|
+
return (React.createElement(react_day_picker_1.DayPicker, { showOutsideDays: showOutsideDays, className: (0, utils_1.cn)('p-3', className), classNames: {
|
|
11
|
+
months: 'flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0',
|
|
12
|
+
month: 'space-y-4',
|
|
13
|
+
caption: 'flex justify-center pt-1 relative items-center',
|
|
14
|
+
caption_label: 'text-sm font-medium',
|
|
15
|
+
nav: 'space-x-1 flex items-center',
|
|
16
|
+
nav_button: (0, utils_1.cn)((0, Button_1.buttonVariants)({ variant: 'outline' }), 'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100'),
|
|
17
|
+
nav_button_previous: 'absolute left-1',
|
|
18
|
+
nav_button_next: 'absolute right-1',
|
|
19
|
+
table: 'w-full border-collapse space-y-1',
|
|
20
|
+
head_row: 'flex',
|
|
21
|
+
head_cell: 'text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]',
|
|
22
|
+
row: 'flex w-full mt-2',
|
|
23
|
+
cell: (0, utils_1.cn)('relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md', props.mode === 'range'
|
|
24
|
+
? '[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md'
|
|
25
|
+
: '[&:has([aria-selected])]:rounded-md'),
|
|
26
|
+
day: (0, utils_1.cn)((0, Button_1.buttonVariants)({ variant: 'ghost' }), 'h-8 w-8 p-0 font-normal aria-selected:opacity-100'),
|
|
27
|
+
day_range_start: 'day-range-start',
|
|
28
|
+
day_range_end: 'day-range-end',
|
|
29
|
+
day_selected: 'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',
|
|
30
|
+
day_today: 'bg-accent text-accent-foreground',
|
|
31
|
+
day_outside: 'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',
|
|
32
|
+
day_disabled: 'text-muted-foreground opacity-50',
|
|
33
|
+
day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',
|
|
34
|
+
day_hidden: 'invisible',
|
|
35
|
+
...classNames,
|
|
36
|
+
}, components: {
|
|
37
|
+
// IconLeft: ({ ...props }) => <Left className="w-4 h-4" />,
|
|
38
|
+
// IconRight: ({ ...props }) => <Right className="w-4 h-4" />,
|
|
39
|
+
}, ...props }));
|
|
40
|
+
}
|
|
41
|
+
exports.Calendar = Calendar;
|
|
42
|
+
Calendar.displayName = 'Calendar';
|
|
43
|
+
//# sourceMappingURL=Calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.js","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,uDAA4C;AAC5C,0CAAmC;AACnC,sCAA0C;AAK1C,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,EAAE,GAAG,KAAK,EAAiB;IAC3F,OAAO,CACN,oBAAC,4BAAS,IACT,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,IAAA,UAAE,EAAC,KAAK,EAAE,SAAS,CAAC,EAC/B,UAAU,EAAE;YACX,MAAM,EAAE,+DAA+D;YACvE,KAAK,EAAE,WAAW;YAClB,OAAO,EAAE,gDAAgD;YACzD,aAAa,EAAE,qBAAqB;YACpC,GAAG,EAAE,6BAA6B;YAClC,UAAU,EAAE,IAAA,UAAE,EACb,IAAA,uBAAc,EAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EACtC,yDAAyD,CACzD;YACD,mBAAmB,EAAE,iBAAiB;YACtC,eAAe,EAAE,kBAAkB;YACnC,KAAK,EAAE,kCAAkC;YACzC,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,gEAAgE;YAC3E,GAAG,EAAE,kBAAkB;YACvB,IAAI,EAAE,IAAA,UAAE,EACP,mNAAmN,EACnN,KAAK,CAAC,IAAI,KAAK,OAAO;gBACrB,CAAC,CAAC,sKAAsK;gBACxK,CAAC,CAAC,qCAAqC,CACxC;YACD,GAAG,EAAE,IAAA,UAAE,EAAC,IAAA,uBAAc,EAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,mDAAmD,CAAC;YAClG,eAAe,EAAE,iBAAiB;YAClC,aAAa,EAAE,eAAe;YAC9B,YAAY,EACX,kIAAkI;YACnI,SAAS,EAAE,kCAAkC;YAC7C,WAAW,EACV,uIAAuI;YACxI,YAAY,EAAE,kCAAkC;YAChD,gBAAgB,EAAE,8DAA8D;YAChF,UAAU,EAAE,WAAW;YACvB,GAAG,UAAU;SACb,EACD,UAAU,EAAE;QACX,4DAA4D;QAC5D,8DAA8D;SAC9D,KACG,KAAK,GACR,CACF,CAAA;AACF,CAAC;AAGQ,4BAAQ;AAFjB,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Calendar } from './Calendar';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Calendar = void 0;
|
|
4
|
+
var Calendar_1 = require("./Calendar");
|
|
5
|
+
Object.defineProperty(exports, "Calendar", { enumerable: true, get: function () { return Calendar_1.Calendar; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Calendar/index.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA"}
|
package/dist/Chip/Chip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const chipVariants: (props?: {
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "primary" | "secondary" | "success" | "primary-outline" | "outline" | "ghost";
|
|
5
5
|
size?: "lg" | "md" | "sm" | "xs" | "xxs";
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
7
7
|
export interface IChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof chipVariants> {
|
package/dist/Input/Input.js
CHANGED
|
@@ -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';
|
package/dist/Input/Input.js.map
CHANGED
|
@@ -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,
|
|
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,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"}
|
package/dist/Input/index.d.ts
CHANGED
package/dist/Input/index.js
CHANGED
|
@@ -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
|
package/dist/Input/index.js.map
CHANGED
|
@@ -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"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
2
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
3
3
|
value?: string;
|
|
4
4
|
onChange?: (newValue: string) => unknown;
|
|
5
5
|
maxLength: number;
|
|
6
|
-
textAlign?: "center" | "
|
|
6
|
+
textAlign?: "center" | "right" | "left";
|
|
7
7
|
onComplete?: (...args: any[]) => unknown;
|
|
8
8
|
pushPasswordManagerStrategy?: "none" | "increase-width";
|
|
9
9
|
containerClassName?: string;
|
|
@@ -11,11 +11,11 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
11
11
|
} & {
|
|
12
12
|
render: (props: import("input-otp").RenderProps) => React.ReactNode;
|
|
13
13
|
children?: never;
|
|
14
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
14
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
15
15
|
value?: string;
|
|
16
16
|
onChange?: (newValue: string) => unknown;
|
|
17
17
|
maxLength: number;
|
|
18
|
-
textAlign?: "center" | "
|
|
18
|
+
textAlign?: "center" | "right" | "left";
|
|
19
19
|
onComplete?: (...args: any[]) => unknown;
|
|
20
20
|
pushPasswordManagerStrategy?: "none" | "increase-width";
|
|
21
21
|
containerClassName?: string;
|
|
@@ -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,CA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,CAAC,CAAA;AAED,MAAM,IAAI,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAa,EAAE,EAAE;IAClD,OAAO,CACN,oBAAC,yBAAU,CAAC,IAAI,IACf,SAAS,EAAC,8DAA8D,KACpE,KAAK,IAER,QAAQ,CACQ,CAClB,CAAA;AACF,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,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"}
|
package/dist/Select/index.d.ts
CHANGED
package/dist/Select/index.js
CHANGED
|
@@ -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
|
package/dist/Select/index.js.map
CHANGED
|
@@ -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,11 +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, 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.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; } });
|
|
@@ -71,4 +73,6 @@ Object.defineProperty(exports, "FormItem", { enumerable: true, get: function ()
|
|
|
71
73
|
Object.defineProperty(exports, "FormControl", { enumerable: true, get: function () { return Form_1.FormControl; } });
|
|
72
74
|
Object.defineProperty(exports, "FormDescription", { enumerable: true, get: function () { return Form_1.FormDescription; } });
|
|
73
75
|
Object.defineProperty(exports, "FormMessage", { enumerable: true, get: function () { return Form_1.FormMessage; } });
|
|
76
|
+
const Calendar_1 = require("./Calendar");
|
|
77
|
+
Object.defineProperty(exports, "Calendar", { enumerable: true, get: function () { return Calendar_1.Calendar; } });
|
|
74
78
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,uCAAmC;
|
|
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;AArCL,qCAAiC;AAsChC,uFAtCQ,eAAM,OAsCR;AArCP,uCAAmC;AAsClC,wFAtCQ,iBAAO,OAsCR;AArCR,+DAAyB;AAsCxB,eAtCM,cAAI,CAsCN;AArCL,2CAAsF;AAsCrF,yFAtCQ,oBAAQ,OAsCR;AACR,8FAvCkB,yBAAa,OAuClB;AACb,6FAxCiC,wBAAY,OAwCjC;AACZ,kGAzC+C,6BAAiB,OAyC/C;AAxClB,yDAK2B;AAuD1B,iGA3DA,mCAAgB,OA2DA;AAChB,qGA3DA,uCAAoB,OA2DA;AACpB,yGA3DA,2CAAwB,OA2DA;AACxB,qGA3DA,uCAAoB,OA2DA;AAzDrB,0DAA8B;AAgD7B,oBAAI;AA/CL,+CAAmF;AAkClF,4FAlCQ,yBAAW,OAkCR;AACX,mGAnCqB,gCAAkB,OAmCrB;A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,yFAlDQ,mBAAQ,OAkDR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modul/mbui",
|
|
3
|
-
"version": "0.0.13-beta-pv-53036-
|
|
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",
|
|
@@ -40,8 +40,9 @@
|
|
|
40
40
|
"input-otp": "1.2.4",
|
|
41
41
|
"lodash": "4.17.5",
|
|
42
42
|
"react-datepicker": "4.16.0",
|
|
43
|
+
"react-day-picker": "^9.0.8",
|
|
43
44
|
"react-hook-form": "7.53.0",
|
|
44
|
-
"react-imask": "7.1
|
|
45
|
+
"react-imask": "7.6.1",
|
|
45
46
|
"react-select": "5.8.0",
|
|
46
47
|
"tailwind-merge": "^2.3.0",
|
|
47
48
|
"tailwindcss": "^3.4.4",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { DayPicker } from 'react-day-picker'
|
|
3
|
+
import { cn } from '../@/lib/utils'
|
|
4
|
+
import { buttonVariants } from '../Button'
|
|
5
|
+
import { Left, Right } from '../Icon'
|
|
6
|
+
|
|
7
|
+
export type CalendarProps = React.ComponentProps<typeof DayPicker>
|
|
8
|
+
|
|
9
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {
|
|
10
|
+
return (
|
|
11
|
+
<DayPicker
|
|
12
|
+
showOutsideDays={showOutsideDays}
|
|
13
|
+
className={cn('p-3', className)}
|
|
14
|
+
classNames={{
|
|
15
|
+
months: 'flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0',
|
|
16
|
+
month: 'space-y-4',
|
|
17
|
+
caption: 'flex justify-center pt-1 relative items-center',
|
|
18
|
+
caption_label: 'text-sm font-medium',
|
|
19
|
+
nav: 'space-x-1 flex items-center',
|
|
20
|
+
nav_button: cn(
|
|
21
|
+
buttonVariants({ variant: 'outline' }),
|
|
22
|
+
'h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100'
|
|
23
|
+
),
|
|
24
|
+
nav_button_previous: 'absolute left-1',
|
|
25
|
+
nav_button_next: 'absolute right-1',
|
|
26
|
+
table: 'w-full border-collapse space-y-1',
|
|
27
|
+
head_row: 'flex',
|
|
28
|
+
head_cell: 'text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]',
|
|
29
|
+
row: 'flex w-full mt-2',
|
|
30
|
+
cell: cn(
|
|
31
|
+
'relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md',
|
|
32
|
+
props.mode === 'range'
|
|
33
|
+
? '[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md'
|
|
34
|
+
: '[&:has([aria-selected])]:rounded-md'
|
|
35
|
+
),
|
|
36
|
+
day: cn(buttonVariants({ variant: 'ghost' }), 'h-8 w-8 p-0 font-normal aria-selected:opacity-100'),
|
|
37
|
+
day_range_start: 'day-range-start',
|
|
38
|
+
day_range_end: 'day-range-end',
|
|
39
|
+
day_selected:
|
|
40
|
+
'bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground',
|
|
41
|
+
day_today: 'bg-accent text-accent-foreground',
|
|
42
|
+
day_outside:
|
|
43
|
+
'day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30',
|
|
44
|
+
day_disabled: 'text-muted-foreground opacity-50',
|
|
45
|
+
day_range_middle: 'aria-selected:bg-accent aria-selected:text-accent-foreground',
|
|
46
|
+
day_hidden: 'invisible',
|
|
47
|
+
...classNames,
|
|
48
|
+
}}
|
|
49
|
+
components={{
|
|
50
|
+
// IconLeft: ({ ...props }) => <Left className="w-4 h-4" />,
|
|
51
|
+
// IconRight: ({ ...props }) => <Right className="w-4 h-4" />,
|
|
52
|
+
}}
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
Calendar.displayName = 'Calendar'
|
|
58
|
+
|
|
59
|
+
export { Calendar }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Calendar } from './Calendar'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
|
|
5
|
+
import { format } from "date-fns"
|
|
6
|
+
|
|
7
|
+
import { cn } from "../@/lib/utils"
|
|
8
|
+
import { Button } from "../Button"
|
|
9
|
+
import { Calendar } from "../Calendar"
|
|
10
|
+
import {
|
|
11
|
+
Popover,
|
|
12
|
+
} from "../Popover"
|
|
13
|
+
|
|
14
|
+
export function DatePickerDemo() {
|
|
15
|
+
const [date, setDate] = React.useState<Date>()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Popover>
|
|
19
|
+
<Popover.Trigger asChild>
|
|
20
|
+
<Button
|
|
21
|
+
variant={"outline"}
|
|
22
|
+
className={cn(
|
|
23
|
+
"w-[240px] justify-start text-left font-normal",
|
|
24
|
+
!date && "text-muted-foreground"
|
|
25
|
+
)}
|
|
26
|
+
>
|
|
27
|
+
{/* <CalendarIcon className="mr-2 w-4 h-4" /> */}
|
|
28
|
+
{date ? format(date, "PPP") : <span>Pick a date</span>}
|
|
29
|
+
</Button>
|
|
30
|
+
</Popover.Trigger>
|
|
31
|
+
<Popover.Content className="p-0 w-auto" align="start">
|
|
32
|
+
<Calendar
|
|
33
|
+
mode="single"
|
|
34
|
+
// selected={date}
|
|
35
|
+
// onSelect={setDate}
|
|
36
|
+
// initialFocus
|
|
37
|
+
/>
|
|
38
|
+
</Popover.Content>
|
|
39
|
+
</Popover>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Datepicker } from './Datepicker'
|
package/src/Input/Input.tsx
CHANGED
|
@@ -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 }
|
package/src/Input/index.ts
CHANGED
|
@@ -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 }
|
package/src/Select/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -25,13 +25,15 @@ 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
|
+
import { Calendar } from './Calendar'
|
|
36
|
+
// import { Datepicker } from './Datepicker'
|
|
35
37
|
|
|
36
38
|
export {
|
|
37
39
|
Tooltip,
|
|
@@ -80,4 +82,8 @@ export {
|
|
|
80
82
|
FormControl,
|
|
81
83
|
FormDescription,
|
|
82
84
|
FormMessage,
|
|
85
|
+
Calendar,
|
|
86
|
+
// Datepicker,
|
|
87
|
+
SelectAsync,
|
|
88
|
+
InputMask,
|
|
83
89
|
}
|