@modul/mbui 0.0.20-beta-pv-52992-d5155aa6 → 0.0.20-beta-pv-53139-48074e41
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/Alert/Alert.js +1 -1
- package/dist/Alert/Alert.js.map +1 -1
- package/dist/Badge/Badge.d.ts +10 -0
- package/dist/Badge/Badge.js +52 -0
- package/dist/Badge/Badge.js.map +1 -0
- package/dist/Badge/index.d.ts +1 -0
- package/dist/Badge/index.js +7 -0
- package/dist/Badge/index.js.map +1 -0
- package/dist/Button/Button.js +1 -1
- package/dist/FavoritePyments/FavoritePaymentsList.js +1 -1
- package/dist/FavoritePyments/FavoritePaymentsList.js.map +1 -1
- package/dist/Input-OTP/Input.js +2 -3
- package/dist/Input-OTP/Input.js.map +1 -1
- package/dist/Page/Page.js +1 -1
- package/dist/Page/Page.js.map +1 -1
- package/dist/Select/SelectAccountCard.js +33 -5
- package/dist/Select/SelectAccountCard.js.map +1 -1
- package/dist/Select/SelectAsync.js +73 -12
- package/dist/Select/SelectAsync.js.map +1 -1
- package/dist/Select/SelectBase.js +73 -13
- package/dist/Select/SelectBase.js.map +1 -1
- package/dist/Select/index.d.ts +0 -1
- package/dist/Select/index.js +1 -3
- package/dist/Select/index.js.map +1 -1
- package/dist/Toaster/Toaster.d.ts +13 -0
- package/dist/Toaster/Toaster.js +60 -0
- package/dist/Toaster/Toaster.js.map +1 -0
- package/dist/Toaster/index.d.ts +1 -0
- package/dist/Toaster/index.js +7 -0
- package/dist/Toaster/index.js.map +1 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +11 -5
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
- package/src/@/config/index.ts +5 -0
- package/src/Alert/Alert.tsx +1 -1
- package/src/Badge/Badge.tsx +58 -0
- package/src/Badge/index.ts +1 -0
- package/src/Button/Button.tsx +1 -1
- package/src/FavoritePyments/FavoritePaymentsList.tsx +1 -1
- package/src/Input-OTP/Input.tsx +2 -2
- package/src/Page/Page.tsx +1 -1
- package/src/Select/SelectAccountCard.tsx +51 -1
- package/src/Select/SelectAsync.tsx +162 -1
- package/src/Select/SelectBase.tsx +168 -19
- package/src/Select/index.ts +0 -1
- package/src/Toaster/Toaster.tsx +71 -0
- package/src/Toaster/index.ts +1 -0
- package/src/assets/css/global.css +9 -1
- package/src/assets/images/logo/sbp-logo.svg +1 -0
- package/src/index.ts +16 -11
- package/src/pages/payments/SmsSign/sms-sign.tsx +151 -0
- package/dist/Select/SelectAccount.d.ts +0 -8
- package/dist/Select/SelectAccount.js +0 -50
- package/dist/Select/SelectAccount.js.map +0 -1
- package/dist/Select/components/components.d.ts +0 -15
- package/dist/Select/components/components.js +0 -80
- package/dist/Select/components/components.js.map +0 -1
- package/dist/Select/components/index.d.ts +0 -1
- package/dist/Select/components/index.js +0 -17
- package/dist/Select/components/index.js.map +0 -1
- package/src/Select/SelectAccount.tsx +0 -101
- package/src/Select/components/components.tsx +0 -186
- package/src/Select/components/index.tsx +0 -15
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Placeholder = exports.Menu = exports.SingleValue = exports.ValueContainer = exports.DropdownIndicator = exports.LoadingIndicator = exports.IndicatorsContainer = exports.Option = exports.optionClasses = exports.colourStyles = exports.Control = exports.Input = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
6
|
-
const react_select_1 = require("react-select");
|
|
7
|
-
const utils_1 = require("../../@/lib/utils");
|
|
8
|
-
const Icon_1 = require("../../Icon");
|
|
9
|
-
const Input = ({ ...props }) => {
|
|
10
|
-
return (react_1.default.createElement(react_select_1.components.Input, { className: "col-start-1 col-end-3 row-start-1 row-end-2", ...props }));
|
|
11
|
-
};
|
|
12
|
-
exports.Input = Input;
|
|
13
|
-
const selectTriggerClasses = `
|
|
14
|
-
flex
|
|
15
|
-
items-center
|
|
16
|
-
py-[12px]
|
|
17
|
-
px-[16px]
|
|
18
|
-
h-[44px]
|
|
19
|
-
text-left
|
|
20
|
-
border-[1px]
|
|
21
|
-
border-input
|
|
22
|
-
rounded-sm
|
|
23
|
-
cursor-pointer
|
|
24
|
-
`;
|
|
25
|
-
const Control = ({ children, ...props }) => {
|
|
26
|
-
const { isFocused } = props;
|
|
27
|
-
return (react_1.default.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
|
-
exports.Control = Control;
|
|
30
|
-
const colourStyles = {
|
|
31
|
-
control: () => ({}),
|
|
32
|
-
option: () => ({}),
|
|
33
|
-
input: () => ({}),
|
|
34
|
-
dropdownIndicator: () => ({}),
|
|
35
|
-
indicatorsContainer: () => ({}),
|
|
36
|
-
menu: () => ({}),
|
|
37
|
-
menuList: () => ({}),
|
|
38
|
-
singleValue: () => ({}),
|
|
39
|
-
valueContainer: () => ({}),
|
|
40
|
-
};
|
|
41
|
-
exports.colourStyles = colourStyles;
|
|
42
|
-
const optionClasses = 'flex items-center first:rounded-t-sm last:rounded-b-sm px-[16px] py-[12px] w-full cursor-default select-none outline-none';
|
|
43
|
-
exports.optionClasses = optionClasses;
|
|
44
|
-
const Option = ({ children, ...props }) => {
|
|
45
|
-
const { isSelected, isFocused, isDisabled } = props;
|
|
46
|
-
return (react_1.default.createElement(react_select_1.components.Option, { className: (0, utils_1.cn)(optionClasses, 'items-start', { 'bg-light': isFocused }, { 'opacity-50 pointer-events-none': isDisabled }), ...props },
|
|
47
|
-
react_1.default.createElement("span", { className: "flex basis-0 grow" }, children),
|
|
48
|
-
react_1.default.createElement("span", { className: "ml-[16px] shrink-0 size-[24px]" }, isSelected && (react_1.default.createElement(Icon_1.CheckSmall, { width: "24", height: "24", className: "text-primary" })))));
|
|
49
|
-
};
|
|
50
|
-
exports.Option = Option;
|
|
51
|
-
const IndicatorsContainer = ({ children, ...props }) => {
|
|
52
|
-
return (react_1.default.createElement(react_select_1.components.IndicatorsContainer, { className: "flex items-center gap-x-[8px] shrink-0", ...props }, children));
|
|
53
|
-
};
|
|
54
|
-
exports.IndicatorsContainer = IndicatorsContainer;
|
|
55
|
-
const LoadingIndicator = ({ ...props }) => {
|
|
56
|
-
return (react_1.default.createElement(react_select_1.components.LoadingIndicator, { className: "text-light shrink-0", ...props }));
|
|
57
|
-
};
|
|
58
|
-
exports.LoadingIndicator = LoadingIndicator;
|
|
59
|
-
const DropdownIndicator = ({ children, ...props }) => {
|
|
60
|
-
return (react_1.default.createElement(react_select_1.components.DropdownIndicator, { className: "shrink-0", ...props },
|
|
61
|
-
react_1.default.createElement(Icon_1.DropdownSmallOld, { className: "text-light", width: "12", height: "12" })));
|
|
62
|
-
};
|
|
63
|
-
exports.DropdownIndicator = DropdownIndicator;
|
|
64
|
-
const ValueContainer = ({ children, ...props }) => {
|
|
65
|
-
return (react_1.default.createElement(react_select_1.components.ValueContainer, { className: "flex-1 grid", ...props }, children));
|
|
66
|
-
};
|
|
67
|
-
exports.ValueContainer = ValueContainer;
|
|
68
|
-
const SingleValue = ({ children, ...props }) => {
|
|
69
|
-
return (react_1.default.createElement(react_select_1.components.SingleValue, { className: "col-start-1 col-end-3 row-start-1 row-end-2", ...props }, children));
|
|
70
|
-
};
|
|
71
|
-
exports.SingleValue = SingleValue;
|
|
72
|
-
const Menu = ({ children, ...props }) => {
|
|
73
|
-
return (react_1.default.createElement(react_select_1.components.Menu, { className: "z-[1] absolute inset-x-0 bg-page shadow-sm mt-[8px] rounded-sm", ...props }, children));
|
|
74
|
-
};
|
|
75
|
-
exports.Menu = Menu;
|
|
76
|
-
const Placeholder = ({ children, ...props }) => {
|
|
77
|
-
return (react_1.default.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));
|
|
78
|
-
};
|
|
79
|
-
exports.Placeholder = Placeholder;
|
|
80
|
-
//# sourceMappingURL=components.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../../src/Select/components/components.tsx"],"names":[],"mappings":";;;;AAAA,+DAAyB;AACzB,+CAaqB;AACrB,6CAAsC;AACtC,qCAAyD;AAEzD,MAAM,KAAK,GAAG,CAAC,EAAE,GAAG,KAAK,EAAc,EAAE,EAAE;IAC1C,OAAO,CACN,8BAAC,yBAAU,CAAC,KAAK,IAChB,SAAS,EAAC,6CAA6C,KACnD,KAAK,GACR,CACF,CAAA;AACF,CAAC,CAAA;AAoJA,sBAAK;AAlJN,MAAM,oBAAoB,GAAW;;;;;;;;;;;CAWpC,CAAA;AACD,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB,EAAE,EAAE;IACxD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAC3B,OAAO,CACN,8BAAC,yBAAU,CAAC,OAAO,IAClB,SAAS,EAAE,IAAA,UAAE,EAAC,oBAAoB,EAAE,EAAE,oDAAoD,EAAE,SAAS,EAAE,CAAC,KACpG,KAAK,IAER,QAAQ,CACW,CACrB,CAAA;AACF,CAAC,CAAA;AA6HA,0BAAO;AA3HR,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,GAA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, Control, colourStyles, optionClasses, Option, IndicatorsContainer, LoadingIndicator, DropdownIndicator, ValueContainer, SingleValue, Menu, Placeholder, } from './components';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Placeholder = exports.Menu = exports.SingleValue = exports.ValueContainer = exports.DropdownIndicator = exports.LoadingIndicator = exports.IndicatorsContainer = exports.Option = exports.optionClasses = exports.colourStyles = exports.Control = exports.Input = void 0;
|
|
4
|
-
var components_1 = require("./components");
|
|
5
|
-
Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return components_1.Input; } });
|
|
6
|
-
Object.defineProperty(exports, "Control", { enumerable: true, get: function () { return components_1.Control; } });
|
|
7
|
-
Object.defineProperty(exports, "colourStyles", { enumerable: true, get: function () { return components_1.colourStyles; } });
|
|
8
|
-
Object.defineProperty(exports, "optionClasses", { enumerable: true, get: function () { return components_1.optionClasses; } });
|
|
9
|
-
Object.defineProperty(exports, "Option", { enumerable: true, get: function () { return components_1.Option; } });
|
|
10
|
-
Object.defineProperty(exports, "IndicatorsContainer", { enumerable: true, get: function () { return components_1.IndicatorsContainer; } });
|
|
11
|
-
Object.defineProperty(exports, "LoadingIndicator", { enumerable: true, get: function () { return components_1.LoadingIndicator; } });
|
|
12
|
-
Object.defineProperty(exports, "DropdownIndicator", { enumerable: true, get: function () { return components_1.DropdownIndicator; } });
|
|
13
|
-
Object.defineProperty(exports, "ValueContainer", { enumerable: true, get: function () { return components_1.ValueContainer; } });
|
|
14
|
-
Object.defineProperty(exports, "SingleValue", { enumerable: true, get: function () { return components_1.SingleValue; } });
|
|
15
|
-
Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return components_1.Menu; } });
|
|
16
|
-
Object.defineProperty(exports, "Placeholder", { enumerable: true, get: function () { return components_1.Placeholder; } });
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Select/components/index.tsx"],"names":[],"mappings":";;;AAAA,2CAcqB;AAbpB,mGAAA,KAAK,OAAA;AACL,qGAAA,OAAO,OAAA;AACP,0GAAA,YAAY,OAAA;AACZ,2GAAA,aAAa,OAAA;AACb,oGAAA,MAAM,OAAA;AACN,iHAAA,mBAAmB,OAAA;AACnB,8GAAA,gBAAgB,OAAA;AAChB,+GAAA,iBAAiB,OAAA;AACjB,4GAAA,cAAc,OAAA;AACd,yGAAA,WAAW,OAAA;AACX,kGAAA,IAAI,OAAA;AACJ,yGAAA,WAAW,OAAA"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { CheckSmall } from '../../src/Icon'
|
|
3
|
-
import Select, { components, OptionProps, SingleValueProps, GroupBase, Props } from 'react-select'
|
|
4
|
-
import { cn } from '../@/lib/utils'
|
|
5
|
-
import {
|
|
6
|
-
colourStyles,
|
|
7
|
-
Control,
|
|
8
|
-
DropdownIndicator,
|
|
9
|
-
IndicatorsContainer,
|
|
10
|
-
Input,
|
|
11
|
-
LoadingIndicator,
|
|
12
|
-
Menu,
|
|
13
|
-
optionClasses,
|
|
14
|
-
Placeholder,
|
|
15
|
-
ValueContainer,
|
|
16
|
-
} from './components'
|
|
17
|
-
|
|
18
|
-
const Option = ({ children, ...props }: OptionProps) => {
|
|
19
|
-
const {
|
|
20
|
-
isSelected,
|
|
21
|
-
isFocused,
|
|
22
|
-
isDisabled,
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
data: { label, account, balance, cur },
|
|
25
|
-
} = props
|
|
26
|
-
return (
|
|
27
|
-
<components.Option
|
|
28
|
-
className={cn(optionClasses, 'items-start', { 'bg-light': isFocused }, { 'opacity-50 pointer-events-none': isDisabled })}
|
|
29
|
-
{...props}
|
|
30
|
-
>
|
|
31
|
-
<span className="flex basis-0 grow">
|
|
32
|
-
<span>
|
|
33
|
-
<span className="text-[16px`] leading-[1.375]">{label}</span>
|
|
34
|
-
<br />
|
|
35
|
-
<span className="text-[12px] text-light">{account}</span>
|
|
36
|
-
</span>
|
|
37
|
-
<span className="ml-auto shrink-0">{cur}</span>
|
|
38
|
-
</span>
|
|
39
|
-
|
|
40
|
-
<span className="ml-[16px] shrink-0 size-[24px]">
|
|
41
|
-
{isSelected && (
|
|
42
|
-
<CheckSmall
|
|
43
|
-
width="24"
|
|
44
|
-
height="24"
|
|
45
|
-
className="text-primary"
|
|
46
|
-
/>
|
|
47
|
-
)}
|
|
48
|
-
</span>
|
|
49
|
-
</components.Option>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const SingleValue = ({ children, ...props }: SingleValueProps) => {
|
|
54
|
-
const {
|
|
55
|
-
// @ts-ignore
|
|
56
|
-
data: { account, cur },
|
|
57
|
-
} = props
|
|
58
|
-
return (
|
|
59
|
-
<components.SingleValue
|
|
60
|
-
className="col-start-1 col-end-3 row-start-1 row-end-2"
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
{account} ({cur})
|
|
64
|
-
</components.SingleValue>
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
type SelectAccountProps<
|
|
69
|
-
Option,
|
|
70
|
-
IsMulti extends boolean = false,
|
|
71
|
-
Group extends GroupBase<Option> = GroupBase<Option>
|
|
72
|
-
> = Props<Option, IsMulti, Group>
|
|
73
|
-
|
|
74
|
-
function SelectAccount<Option, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>(
|
|
75
|
-
props: SelectAccountProps<Option, IsMulti, Group>
|
|
76
|
-
) {
|
|
77
|
-
return (
|
|
78
|
-
<Select
|
|
79
|
-
components={{
|
|
80
|
-
Control,
|
|
81
|
-
Option,
|
|
82
|
-
SingleValue,
|
|
83
|
-
DropdownIndicator,
|
|
84
|
-
IndicatorSeparator: () => null,
|
|
85
|
-
Menu,
|
|
86
|
-
ValueContainer,
|
|
87
|
-
Placeholder,
|
|
88
|
-
Input,
|
|
89
|
-
LoadingIndicator,
|
|
90
|
-
IndicatorsContainer,
|
|
91
|
-
}}
|
|
92
|
-
styles={colourStyles}
|
|
93
|
-
unstyled={true}
|
|
94
|
-
{...props}
|
|
95
|
-
/>
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
SelectAccount.displayName = 'SelectAccount'
|
|
100
|
-
|
|
101
|
-
export { SelectAccount }
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
components,
|
|
4
|
-
ControlProps,
|
|
5
|
-
OptionProps,
|
|
6
|
-
DropdownIndicatorProps,
|
|
7
|
-
StylesConfig,
|
|
8
|
-
SingleValueProps,
|
|
9
|
-
MenuProps,
|
|
10
|
-
PlaceholderProps,
|
|
11
|
-
ValueContainerProps,
|
|
12
|
-
InputProps,
|
|
13
|
-
LoadingIndicatorProps,
|
|
14
|
-
IndicatorsContainerProps,
|
|
15
|
-
} from 'react-select'
|
|
16
|
-
import { cn } from '../../@/lib/utils'
|
|
17
|
-
import { CheckSmall, DropdownSmallOld } from '../../Icon'
|
|
18
|
-
|
|
19
|
-
const Input = ({ ...props }: InputProps) => {
|
|
20
|
-
return (
|
|
21
|
-
<components.Input
|
|
22
|
-
className="col-start-1 col-end-3 row-start-1 row-end-2"
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const selectTriggerClasses: string = `
|
|
29
|
-
flex
|
|
30
|
-
items-center
|
|
31
|
-
py-[12px]
|
|
32
|
-
px-[16px]
|
|
33
|
-
h-[44px]
|
|
34
|
-
text-left
|
|
35
|
-
border-[1px]
|
|
36
|
-
border-input
|
|
37
|
-
rounded-sm
|
|
38
|
-
cursor-pointer
|
|
39
|
-
`
|
|
40
|
-
const Control = ({ children, ...props }: ControlProps) => {
|
|
41
|
-
const { isFocused } = props
|
|
42
|
-
return (
|
|
43
|
-
<components.Control
|
|
44
|
-
className={cn(selectTriggerClasses, { 'outline outline-primary outline-offset-2 outline-2': isFocused })}
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
{children}
|
|
48
|
-
</components.Control>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const colourStyles: StylesConfig = {
|
|
53
|
-
control: () => ({}),
|
|
54
|
-
option: () => ({}),
|
|
55
|
-
input: () => ({}),
|
|
56
|
-
dropdownIndicator: () => ({}),
|
|
57
|
-
indicatorsContainer: () => ({}),
|
|
58
|
-
menu: () => ({}),
|
|
59
|
-
menuList: () => ({}),
|
|
60
|
-
singleValue: () => ({}),
|
|
61
|
-
valueContainer: () => ({}),
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const optionClasses =
|
|
65
|
-
'flex items-center first:rounded-t-sm last:rounded-b-sm px-[16px] py-[12px] w-full cursor-default select-none outline-none'
|
|
66
|
-
|
|
67
|
-
const Option = ({ children, ...props }: OptionProps) => {
|
|
68
|
-
const { isSelected, isFocused, isDisabled } = props
|
|
69
|
-
return (
|
|
70
|
-
<components.Option
|
|
71
|
-
className={cn(
|
|
72
|
-
optionClasses,
|
|
73
|
-
'items-start',
|
|
74
|
-
{ 'bg-light': isFocused },
|
|
75
|
-
{ 'opacity-50 pointer-events-none': isDisabled }
|
|
76
|
-
)}
|
|
77
|
-
{...props}
|
|
78
|
-
>
|
|
79
|
-
<span className="flex basis-0 grow">{children}</span>
|
|
80
|
-
|
|
81
|
-
<span className="ml-[16px] shrink-0 size-[24px]">
|
|
82
|
-
{isSelected && (
|
|
83
|
-
<CheckSmall
|
|
84
|
-
width="24"
|
|
85
|
-
height="24"
|
|
86
|
-
className="text-primary"
|
|
87
|
-
/>
|
|
88
|
-
)}
|
|
89
|
-
</span>
|
|
90
|
-
</components.Option>
|
|
91
|
-
)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const IndicatorsContainer = ({ children, ...props }: IndicatorsContainerProps) => {
|
|
95
|
-
return (
|
|
96
|
-
<components.IndicatorsContainer
|
|
97
|
-
className="flex items-center gap-x-[8px] shrink-0"
|
|
98
|
-
{...props}
|
|
99
|
-
>
|
|
100
|
-
{children}
|
|
101
|
-
</components.IndicatorsContainer>
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const LoadingIndicator = ({ ...props }: LoadingIndicatorProps) => {
|
|
106
|
-
return (
|
|
107
|
-
<components.LoadingIndicator
|
|
108
|
-
className="text-light shrink-0"
|
|
109
|
-
{...props}
|
|
110
|
-
/>
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const DropdownIndicator = ({ children, ...props }: DropdownIndicatorProps) => {
|
|
115
|
-
return (
|
|
116
|
-
<components.DropdownIndicator
|
|
117
|
-
className="shrink-0"
|
|
118
|
-
{...props}
|
|
119
|
-
>
|
|
120
|
-
<DropdownSmallOld
|
|
121
|
-
className="text-light"
|
|
122
|
-
width="12"
|
|
123
|
-
height="12"
|
|
124
|
-
/>
|
|
125
|
-
</components.DropdownIndicator>
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const ValueContainer = ({ children, ...props }: ValueContainerProps) => {
|
|
130
|
-
return (
|
|
131
|
-
<components.ValueContainer
|
|
132
|
-
className="flex-1 grid"
|
|
133
|
-
{...props}
|
|
134
|
-
>
|
|
135
|
-
{children}
|
|
136
|
-
</components.ValueContainer>
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const SingleValue = ({ children, ...props }: SingleValueProps) => {
|
|
141
|
-
return (
|
|
142
|
-
<components.SingleValue
|
|
143
|
-
className="col-start-1 col-end-3 row-start-1 row-end-2"
|
|
144
|
-
{...props}
|
|
145
|
-
>
|
|
146
|
-
{children}
|
|
147
|
-
</components.SingleValue>
|
|
148
|
-
)
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const Menu = ({ children, ...props }: MenuProps) => {
|
|
152
|
-
return (
|
|
153
|
-
<components.Menu
|
|
154
|
-
className="z-[1] absolute inset-x-0 bg-page shadow-sm mt-[8px] rounded-sm"
|
|
155
|
-
{...props}
|
|
156
|
-
>
|
|
157
|
-
{children}
|
|
158
|
-
</components.Menu>
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const Placeholder = ({ children, ...props }: PlaceholderProps) => {
|
|
163
|
-
return (
|
|
164
|
-
<components.Placeholder
|
|
165
|
-
className="col-start-1 col-end-3 row-start-1 row-end-2 text-[16px] text-light truncate"
|
|
166
|
-
{...props}
|
|
167
|
-
>
|
|
168
|
-
{children}
|
|
169
|
-
</components.Placeholder>
|
|
170
|
-
)
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export {
|
|
174
|
-
Input,
|
|
175
|
-
Control,
|
|
176
|
-
colourStyles,
|
|
177
|
-
optionClasses,
|
|
178
|
-
Option,
|
|
179
|
-
IndicatorsContainer,
|
|
180
|
-
LoadingIndicator,
|
|
181
|
-
DropdownIndicator,
|
|
182
|
-
ValueContainer,
|
|
183
|
-
SingleValue,
|
|
184
|
-
Menu,
|
|
185
|
-
Placeholder,
|
|
186
|
-
}
|