period-ui 0.1.34 → 0.1.35
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/components/atoms/button/button.d.ts +1 -1
- package/dist/components/atoms/check-box/check-box.d.ts +14 -0
- package/dist/components/atoms/drop-down-menu/components/menu-item.js +2 -2
- package/dist/components/atoms/drop-down-menu/components/menu-item.js.map +1 -1
- package/dist/components/atoms/icon-button/icon-button.d.ts +5 -6
- package/dist/components/atoms/pop-over/index.d.ts +3 -0
- package/dist/components/atoms/pop-over/pop-over-positions.d.ts +11 -0
- package/dist/components/atoms/pop-over/pop-over.d.ts +17 -0
- package/dist/components/atoms/pop-over/pop-over.d.ts.map +1 -1
- package/dist/components/atoms/pop-over/pop-over.js +7 -5
- package/dist/components/atoms/pop-over/pop-over.js.map +1 -1
- package/dist/components/atoms/tool-tip/index.d.ts +2 -0
- package/dist/components/atoms/tool-tip/tool-tip-positions.d.ts +11 -0
- package/dist/components/atoms/tool-tip/tool-tip-positions.d.ts.map +1 -0
- package/dist/components/atoms/tool-tip/tool-tip-positions.js +15 -0
- package/dist/components/atoms/tool-tip/tool-tip-positions.js.map +1 -0
- package/dist/components/atoms/tool-tip/tool-tip.d.ts +21 -0
- package/dist/components/atoms/tool-tip/tool-tip.d.ts.map +1 -1
- package/dist/components/atoms/tool-tip/tool-tip.js +1 -1
- package/dist/components/atoms/tool-tip/tool-tip.js.map +1 -1
- package/dist/components/atoms/tool-tip/use-tool-tip.d.ts +8 -0
- package/dist/components/atoms/tool-tip/use-tool-tip.d.ts.map +1 -1
- package/dist/components/index.d.ts +18 -0
- package/dist/components/molecules/select/select.d.ts +2 -4
- package/dist/components/molecules/select/use-select.d.ts.map +1 -1
- package/dist/components/molecules/select/use-select.js +13 -3
- package/dist/components/molecules/select/use-select.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
- package/dist/components/atoms/drop-down-menu/drop-down-menu-types.d.ts +0 -13
- package/dist/components/atoms/drop-down-menu/drop-down-menu.d.ts +0 -13
- package/dist/components/atoms/drop-down-menu/index.d.ts +0 -3
- package/dist/components/atoms/icon-button/icon-button-types.d.ts +0 -7
- package/dist/components/atoms/icon-button/index.d.ts +0 -3
- package/dist/components/molecules/form/form-select/form-select.d.ts +0 -7
- package/dist/components/molecules/select/components/select-input.d.ts +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonStyles: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "primary" | "secondary" | "destructive" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
6
|
type Props = ComponentProps<'button'> & VariantProps<typeof buttonStyles>;
|
|
7
7
|
export declare const Button: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CheckboxVariant } from './check-box-types';
|
|
2
|
+
type Props = {
|
|
3
|
+
value?: boolean;
|
|
4
|
+
isDisabled?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
labelClassName?: string;
|
|
8
|
+
containerClassName?: string;
|
|
9
|
+
variant?: CheckboxVariant;
|
|
10
|
+
onCheckToggle?: (value: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare function Checkbox({ value, isDisabled, label, className, labelClassName, containerClassName, variant, onCheckToggle, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=check-box.d.ts.map
|
|
@@ -11,11 +11,11 @@ function MenuItem({ isDisabled = false, isSelected = false, id, label, className
|
|
|
11
11
|
const isDestructive = variant === menu_item_types_1.MenuItemVariant.DESTRUCTIVE;
|
|
12
12
|
const isTextButton = variant === menu_item_types_1.MenuItemVariant.TEXT_BUTTON;
|
|
13
13
|
const isCheckBox = variant === menu_item_types_1.MenuItemVariant.CHECK_BOX;
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", disabled: isDisabled, className: (0, tailwind_utils_1.tailwind)('group', 'flex flex-row items-center p-4 w-full', 'cursor-pointer bg-white outline-none', 'disabled:cursor-not-allowed disabled:bg-white hover:bg-gray-05 active:bg-gray-04', 'focus-visible:border-2 focus-visible:border-blue-01 focus-visible:p-[14px]', isTextButton &&
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("button", { type: "button", disabled: isDisabled, className: (0, tailwind_utils_1.tailwind)('group', 'flex flex-row items-center p-4 w-full md:h-[56px] h-[50px]', 'cursor-pointer bg-white outline-none', 'disabled:cursor-not-allowed disabled:bg-white hover:bg-gray-05 active:bg-gray-04', 'focus-visible:border-2 focus-visible:border-blue-01 focus-visible:p-[14px]', isTextButton &&
|
|
15
15
|
'py-2 hover:bg-blue-03 active:bg-blue-03 focus-visible:py-[6px] focus-visible:bg-blue-03', isSelected && 'bg-gray-04 hover:bg-gray-04', className), "data-testid": id, onClick: onClick, children: [icon && ((0, jsx_runtime_1.jsx)(components_1.BilloIcon, { icon: icon, size: isMobile ? components_1.IconSize.LG : components_1.IconSize.XL, className: (0, tailwind_utils_1.tailwind)('mr-2', isDestructive
|
|
16
16
|
? 'text-red-01 group-disabled:text-red-03'
|
|
17
17
|
: 'text-gray-01 group-disabled:text-gray-03') })), isCheckBox && ((0, jsx_runtime_1.jsx)(components_1.Checkbox, { isDisabled: isDisabled, value: isSelected, onCheckToggle: onClick, containerClassName: "mr-2", className: (0, tailwind_utils_1.tailwind)(!isSelected && 'group-hover:border-gray-03 group-hover:bg-gray-05', !isSelected &&
|
|
18
|
-
'group-disabled:bg-gray-06 group-disabled:border-gray-04 group-disabled:cursor-not-allowed') })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start w-full max-w-full
|
|
18
|
+
'group-disabled:bg-gray-06 group-disabled:border-gray-04 group-disabled:cursor-not-allowed') })), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-start w-full max-w-full", children: [isTextButton ? ((0, jsx_runtime_1.jsx)(components_1.TextButton, { isDisabled: isDisabled, onClick: () => { }, label: label, className: (0, tailwind_utils_1.tailwind)('text-blue-01', 'group-disabled:text-blue-03', 'group-hover:bg-blue-03', 'group-active:bg-blue-03 group-active:text-blue-00', 'group-focus-visible:bg-blue-03') })) : ((0, jsx_runtime_1.jsx)(components_1.Text, { className: (0, tailwind_utils_1.tailwind)('truncate text-left w-full', isDestructive
|
|
19
19
|
? 'text-red-01 group-disabled:text-red-03'
|
|
20
20
|
: 'text-gray-01 group-disabled:text-gray-03'), children: label })), helperLabel && ((0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.HELPER, color: components_1.TextColors.BLACK, className: "group-disabled:text-gray-03 truncate w-full", children: helperLabel }))] })] }, id));
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../../../../src/components/atoms/drop-down-menu/components/menu-item.tsx"],"names":[],"mappings":";;AA0BA,4BAqGC;;AA/HD,uDASgC;AAChC,qEAA4D;AAC5D,uFAAgF;AAChF,uDAAoD;AAcpD,SAAgB,QAAQ,CAAC,EACvB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,EAAE,EACF,KAAK,EACL,SAAS,EACT,WAAW,EACX,OAAO,GAAG,iCAAe,CAAC,OAAO,EACjC,IAAI,EACJ,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,GACZ;IACN,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC3C,MAAM,aAAa,GAAG,OAAO,KAAK,iCAAe,CAAC,WAAW,CAAC;IAC9D,MAAM,YAAY,GAAG,OAAO,KAAK,iCAAe,CAAC,WAAW,CAAC;IAC7D,MAAM,UAAU,GAAG,OAAO,KAAK,iCAAe,CAAC,SAAS,CAAC;IAEzD,OAAO,CACL,oCACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,IAAA,yBAAQ,EACjB,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"menu-item.js","sourceRoot":"","sources":["../../../../../src/components/atoms/drop-down-menu/components/menu-item.tsx"],"names":[],"mappings":";;AA0BA,4BAqGC;;AA/HD,uDASgC;AAChC,qEAA4D;AAC5D,uFAAgF;AAChF,uDAAoD;AAcpD,SAAgB,QAAQ,CAAC,EACvB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,EAAE,EACF,KAAK,EACL,SAAS,EACT,WAAW,EACX,OAAO,GAAG,iCAAe,CAAC,OAAO,EACjC,IAAI,EACJ,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,GACZ;IACN,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC3C,MAAM,aAAa,GAAG,OAAO,KAAK,iCAAe,CAAC,WAAW,CAAC;IAC9D,MAAM,YAAY,GAAG,OAAO,KAAK,iCAAe,CAAC,WAAW,CAAC;IAC7D,MAAM,UAAU,GAAG,OAAO,KAAK,iCAAe,CAAC,SAAS,CAAC;IAEzD,OAAO,CACL,oCACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,IAAA,yBAAQ,EACjB,OAAO,EACP,4DAA4D,EAC5D,sCAAsC,EACtC,kFAAkF,EAClF,4EAA4E,EAC5E,YAAY;YACV,yFAAyF,EAC3F,UAAU,IAAI,6BAA6B,EAC3C,SAAS,CACV,iBAEY,EAAE,EACf,OAAO,EAAE,OAAO,aAEf,IAAI,IAAI,CACP,uBAAC,sBAAS,IACR,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,qBAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAQ,CAAC,EAAE,EAC1C,SAAS,EAAE,IAAA,yBAAQ,EACjB,MAAM,EACN,aAAa;oBACX,CAAC,CAAC,wCAAwC;oBAC1C,CAAC,CAAC,0CAA0C,CAC/C,GACD,CACH,EAEA,UAAU,IAAI,CACb,uBAAC,qBAAQ,IACP,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,UAAU,EACjB,aAAa,EAAE,OAAO,EACtB,kBAAkB,EAAC,MAAM,EACzB,SAAS,EAAE,IAAA,yBAAQ,EACjB,CAAC,UAAU,IAAI,mDAAmD,EAClE,CAAC,UAAU;oBACT,2FAA2F,CAC9F,GACD,CACH,EAED,iCAAK,SAAS,EAAC,6CAA6C,aACzD,YAAY,CAAC,CAAC,CAAC,CACd,uBAAC,uBAAU,IACT,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EACjB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,IAAA,yBAAQ,EACjB,cAAc,EACd,6BAA6B,EAC7B,wBAAwB,EACxB,mDAAmD,EACnD,gCAAgC,CACjC,GACD,CACH,CAAC,CAAC,CAAC,CACF,uBAAC,iBAAI,IACH,SAAS,EAAE,IAAA,yBAAQ,EACjB,2BAA2B,EAC3B,aAAa;4BACX,CAAC,CAAC,wCAAwC;4BAC1C,CAAC,CAAC,0CAA0C,CAC/C,YAEA,KAAK,GACD,CACR,EAEA,WAAW,IAAI,CACd,uBAAC,iBAAI,IACH,OAAO,EAAE,wBAAW,CAAC,MAAM,EAC3B,KAAK,EAAE,uBAAU,CAAC,KAAK,EACvB,SAAS,EAAC,6CAA6C,YAEtD,WAAW,GACP,CACR,IACG,KAnED,EAAE,CAoEA,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconColor, IconSize, IconSymbol } from '../../../components';
|
|
2
2
|
type Props = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> & {
|
|
3
|
+
isDisabled?: boolean;
|
|
3
4
|
icon: IconSymbol;
|
|
4
5
|
size?: IconSize;
|
|
5
|
-
|
|
6
|
-
iconClassName?: string;
|
|
7
|
-
isDisabled?: boolean;
|
|
8
|
-
variant?: IconButtonVariant;
|
|
6
|
+
color?: IconColor;
|
|
9
7
|
onClick?: () => void;
|
|
8
|
+
className?: string;
|
|
10
9
|
};
|
|
11
|
-
export declare function IconButton({
|
|
10
|
+
export declare function IconButton({ isDisabled, icon, size, color, onClick, className, ...buttonProps }: Props): JSX.Element;
|
|
12
11
|
export {};
|
|
13
12
|
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum PopOverPosition {
|
|
2
|
+
LEFT = "left",
|
|
3
|
+
RIGHT = "right",
|
|
4
|
+
TOP_CENTER = "top",
|
|
5
|
+
TOP_LEFT = "top-left",
|
|
6
|
+
TOP_RIGHT = "top-right",
|
|
7
|
+
BOTTOM_CENTER = "bottom",
|
|
8
|
+
BOTTOM_LEFT = "bottom-left",
|
|
9
|
+
BOTTOM_RIGHT = "bottom-right"
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=pop-over-positions.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { PopOverPosition } from './pop-over-positions';
|
|
3
|
+
type Props = {
|
|
4
|
+
text?: string;
|
|
5
|
+
isVisible?: boolean;
|
|
6
|
+
isAbsolute?: boolean;
|
|
7
|
+
children?: ReactElement;
|
|
8
|
+
position?: PopOverPosition;
|
|
9
|
+
textClassName?: string;
|
|
10
|
+
containerClassName?: string;
|
|
11
|
+
arrowClassName?: string;
|
|
12
|
+
onPointerEnter?: () => void;
|
|
13
|
+
onPointerLeave?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function PopOver({ text, children, textClassName, arrowClassName, isVisible, isAbsolute, containerClassName, position, onPointerEnter, onPointerLeave, }: Props): JSX.Element;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=pop-over.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pop-over.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/pop-over/pop-over.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pop-over.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/pop-over/pop-over.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;CAC5B,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,SAAiB,EACjB,UAAiB,EACjB,kBAAkB,EAClB,QAAoC,EACpC,cAAc,EACd,cAAc,GACf,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAyDrB"}
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PopOver = PopOver;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
6
5
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
7
6
|
const components_1 = require("../../../components");
|
|
7
|
+
const tailwind_utils_1 = require("../../../utils/tailwind-utils");
|
|
8
8
|
const pop_over_positions_1 = require("./pop-over-positions");
|
|
9
|
-
function PopOver({ text, children, textClassName, arrowClassName, isVisible = false, isAbsolute = true, containerClassName, position = pop_over_positions_1.PopOverPosition.TOP_RIGHT, }) {
|
|
10
|
-
const popoverMessageStyles = (0, class_variance_authority_1.cva)([
|
|
9
|
+
function PopOver({ text, children, textClassName, arrowClassName, isVisible = false, isAbsolute = true, containerClassName, position = pop_over_positions_1.PopOverPosition.TOP_RIGHT, onPointerEnter, onPointerLeave, }) {
|
|
10
|
+
const popoverMessageStyles = (0, class_variance_authority_1.cva)([
|
|
11
|
+
'z-50 w-[max-content] md:max-w-[424px] max-w-[200px] p-4 bg-gray-01 rounded-lg shadow-black-01',
|
|
12
|
+
], {
|
|
11
13
|
variants: {
|
|
12
14
|
position: {
|
|
13
15
|
left: 'right-full mr-[12px] top-1/2 -translate-y-1/2',
|
|
14
16
|
right: 'left-full ml-[12px] top-1/2 -translate-y-1/2',
|
|
15
17
|
top: 'bottom-full mb-[12px] left-1/2 -translate-x-1/2',
|
|
16
18
|
'top-left': 'bottom-full mb-[12px] -right-[12px]',
|
|
17
|
-
'top-right': 'bottom-full mb-[12px] -left-[12px]',
|
|
19
|
+
'top-right': 'bottom-full mb-[12px] pb-[12px] -left-[12px]',
|
|
18
20
|
bottom: 'top-full mt-[12px] left-1/2 -translate-x-1/2',
|
|
19
21
|
'bottom-left': 'top-full mt-[12px] -right-[12px]',
|
|
20
22
|
'bottom-right': 'top-full mt-[12px] -left-[12px]',
|
|
@@ -37,6 +39,6 @@ function PopOver({ text, children, textClassName, arrowClassName, isVisible = fa
|
|
|
37
39
|
},
|
|
38
40
|
defaultVariants: { position: pop_over_positions_1.PopOverPosition.TOP_RIGHT },
|
|
39
41
|
});
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)({ hidden: !isVisible }, isAbsolute ? 'absolute' : 'relative', popoverMessageStyles({ position, className: containerClassName })), children: [(0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.BODY, className: (0, tailwind_utils_1.tailwind)('text-white whitespace-pre-wrap break-words', textClassName), children: children ?? text }), (0, jsx_runtime_1.jsx)("div", { className: (0, tailwind_utils_1.tailwind)(arrowStyles({ position, className: arrowClassName })) })] }));
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, tailwind_utils_1.tailwind)({ hidden: !isVisible }, isAbsolute ? 'absolute' : 'relative', popoverMessageStyles({ position, className: containerClassName })), onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, children: [(0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.BODY, className: (0, tailwind_utils_1.tailwind)('text-white whitespace-pre-wrap break-words', textClassName), children: children ?? text }), (0, jsx_runtime_1.jsx)("div", { className: (0, tailwind_utils_1.tailwind)(arrowStyles({ position, className: arrowClassName })) })] }));
|
|
41
43
|
}
|
|
42
44
|
//# sourceMappingURL=pop-over.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pop-over.js","sourceRoot":"","sources":["../../../../src/components/atoms/pop-over/pop-over.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"pop-over.js","sourceRoot":"","sources":["../../../../src/components/atoms/pop-over/pop-over.tsx"],"names":[],"mappings":";;AAmBA,0BAoEC;;AAvFD,uEAA+C;AAE/C,oDAAwD;AACxD,kEAAyD;AACzD,6DAAuD;AAevD,SAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,IAAI,EACjB,kBAAkB,EAClB,QAAQ,GAAG,oCAAe,CAAC,SAAS,EACpC,cAAc,EACd,cAAc,GACR;IACN,MAAM,oBAAoB,GAAG,IAAA,8BAAG,EAC9B;QACE,+FAA+F;KAChG,EACD;QACE,QAAQ,EAAE;YACR,Q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C,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC,GAAI,IAC9E,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum TooltipPosition {
|
|
2
|
+
LEFT = "left",
|
|
3
|
+
RIGHT = "right",
|
|
4
|
+
TOP_CENTER = "top",
|
|
5
|
+
TOP_LEFT = "top-left",
|
|
6
|
+
TOP_RIGHT = "top-right",
|
|
7
|
+
BOTTOM_CENTER = "bottom",
|
|
8
|
+
BOTTOM_LEFT = "bottom-left",
|
|
9
|
+
BOTTOM_RIGHT = "bottom-right"
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=tool-tip-positions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-tip-positions.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/tool-tip/tool-tip-positions.ts"],"names":[],"mappings":"AACA,oBAAY,eAAe;IACvB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,UAAU,QAAQ;IAClB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,aAAa,WAAW;IACxB,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;CAC9B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TooltipPosition = void 0;
|
|
4
|
+
var TooltipPosition;
|
|
5
|
+
(function (TooltipPosition) {
|
|
6
|
+
TooltipPosition["LEFT"] = "left";
|
|
7
|
+
TooltipPosition["RIGHT"] = "right";
|
|
8
|
+
TooltipPosition["TOP_CENTER"] = "top";
|
|
9
|
+
TooltipPosition["TOP_LEFT"] = "top-left";
|
|
10
|
+
TooltipPosition["TOP_RIGHT"] = "top-right";
|
|
11
|
+
TooltipPosition["BOTTOM_CENTER"] = "bottom";
|
|
12
|
+
TooltipPosition["BOTTOM_LEFT"] = "bottom-left";
|
|
13
|
+
TooltipPosition["BOTTOM_RIGHT"] = "bottom-right";
|
|
14
|
+
})(TooltipPosition || (exports.TooltipPosition = TooltipPosition = {}));
|
|
15
|
+
//# sourceMappingURL=tool-tip-positions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-tip-positions.js","sourceRoot":"","sources":["../../../../src/components/atoms/tool-tip/tool-tip-positions.ts"],"names":[],"mappings":";;;AACA,IAAY,eAST;AATH,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,qCAAkB,CAAA;IAClB,wCAAqB,CAAA;IACrB,0CAAuB,CAAA;IACvB,2CAAwB,CAAA;IACxB,8CAA2B,CAAA;IAC3B,gDAA6B,CAAA;AAC/B,CAAC,EATS,eAAe,+BAAf,eAAe,QASxB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { IconColor, IconSize, IconSymbol, PopOverPosition } from '../../../components';
|
|
3
|
+
type Props = {
|
|
4
|
+
text?: string;
|
|
5
|
+
children?: ReactElement;
|
|
6
|
+
isMessageShowed?: boolean;
|
|
7
|
+
position?: PopOverPosition;
|
|
8
|
+
iconProps?: {
|
|
9
|
+
icon?: IconSymbol;
|
|
10
|
+
size?: IconSize;
|
|
11
|
+
color?: IconColor;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
textClassName?: string;
|
|
15
|
+
containerClassName?: string;
|
|
16
|
+
arrowClassName?: string;
|
|
17
|
+
onClick?: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare function Tooltip({ text, children, iconProps, textClassName, arrowClassName, containerClassName, isMessageShowed, position, onClick, }: Props): JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=tool-tip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-tip.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/tool-tip/tool-tip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAU,MAAM,OAAO,CAAC;AAC7C,OAAO,EAEL,SAAS,EACT,QAAQ,EACR,UAAU,EAEV,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAK7B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-tip.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/tool-tip/tool-tip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAU,MAAM,OAAO,CAAC;AAC7C,OAAO,EAEL,SAAS,EACT,QAAQ,EACR,UAAU,EAEV,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAK7B,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,SAAS,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,UAAU,CAAC;QAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;QAChB,KAAK,CAAC,EAAE,SAAS,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,eAAsB,EACtB,QAAoC,EACpC,OAAkB,GACnB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAyCrB"}
|
|
@@ -11,6 +11,6 @@ function Tooltip({ text, children, iconProps, textClassName, arrowClassName, con
|
|
|
11
11
|
const { isMessageVisible, openTooltip, closeTooltip } = (0, use_tool_tip_1.useTooltip)();
|
|
12
12
|
const { isMobile } = (0, window_dimensions_utils_1.useWindowDimensions)();
|
|
13
13
|
const buttonRef = (0, react_1.useRef)(null);
|
|
14
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative inline-block", children: [(0, jsx_runtime_1.jsx)("button", { ref: buttonRef, onFocus: openTooltip, onBlur: closeTooltip, onClick: onClick, onPointerEnter: !isMobile ? openTooltip : undefined, onPointerLeave: !isMobile ? closeTooltip : undefined, className: (0, tailwind_utils_1.tailwind)('w-[24px] h-[24px] outline-none inline-flex items-center justify-center'), children: (0, jsx_runtime_1.jsx)(components_1.BilloIcon, { icon: components_1.IconSymbol.WARNING_FILLED, color: components_1.IconColor.BLUE_01, size: isMobile ? components_1.IconSize.LG : components_1.IconSize.XL, ...iconProps }) }), (0, jsx_runtime_1.jsx)(components_1.PopOver, { text: text, position: position, arrowClassName: arrowClassName, textClassName: textClassName, containerClassName: containerClassName, isVisible: isMessageVisible && isMessageShowed, children: children })] }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "relative inline-block", children: [(0, jsx_runtime_1.jsx)("button", { ref: buttonRef, onFocus: openTooltip, onBlur: closeTooltip, onClick: onClick, onPointerEnter: !isMobile ? openTooltip : undefined, onPointerLeave: !isMobile ? closeTooltip : undefined, className: (0, tailwind_utils_1.tailwind)('w-[24px] h-[24px] outline-none inline-flex items-center justify-center'), children: (0, jsx_runtime_1.jsx)(components_1.BilloIcon, { icon: components_1.IconSymbol.WARNING_FILLED, color: components_1.IconColor.BLUE_01, size: isMobile ? components_1.IconSize.LG : components_1.IconSize.XL, ...iconProps }) }), (0, jsx_runtime_1.jsx)(components_1.PopOver, { text: text, position: position, arrowClassName: arrowClassName, textClassName: textClassName, containerClassName: containerClassName, isVisible: isMessageVisible && isMessageShowed, onPointerEnter: !isMobile ? openTooltip : undefined, onPointerLeave: !isMobile ? closeTooltip : undefined, children: children })] }));
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=tool-tip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-tip.js","sourceRoot":"","sources":["../../../../src/components/atoms/tool-tip/tool-tip.tsx"],"names":[],"mappings":";;AA8BA,
|
|
1
|
+
{"version":3,"file":"tool-tip.js","sourceRoot":"","sources":["../../../../src/components/atoms/tool-tip/tool-tip.tsx"],"names":[],"mappings":";;AA8BA,0BAmDC;;AAjFD,iCAA6C;AAC7C,oDAO6B;AAC7B,kEAAyD;AACzD,oFAA6E;AAC7E,iDAA4C;AAmB5C,SAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,eAAe,GAAG,IAAI,EACtB,QAAQ,GAAG,4BAAe,CAAC,SAAS,EACpC,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,GACZ;IACN,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAA,yBAAU,GAAE,CAAC;IAErE,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAA,6CAAmB,GAAE,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAA,cAAM,EAAC,IAAI,CAAC,CAAC;IAE/B,OAAO,CACL,iCAAK,SAAS,EAAC,uBAAuB,aACpC,mCACE,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACnD,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACpD,SAAS,EAAE,IAAA,yBAAQ,EACjB,wEAAwE,CACzE,YAED,uBAAC,sBAAS,IACR,IAAI,EAAE,uBAAU,CAAC,cAAc,EAC/B,KAAK,EAAE,sBAAS,CAAC,OAAO,EACxB,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,qBAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAQ,CAAC,EAAE,KACtC,SAAS,GACb,GACK,EAET,uBAAC,oBAAO,IACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,gBAAgB,IAAI,eAAe,EAC9C,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACnD,cAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,YAEnD,QAAQ,GACD,IACN,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tool-tip.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/tool-tip/use-tool-tip.tsx"],"names":[],"mappings":"AAEA,KAAK,cAAc,GAAG;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"use-tool-tip.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/tool-tip/use-tool-tip.tsx"],"names":[],"mappings":"AAEA,KAAK,cAAc,GAAG;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF,wBAAgB,UAAU,IAAI,cAAc,CAgB3C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './atoms/billo-icon';
|
|
2
|
+
export * from './atoms/button';
|
|
3
|
+
export * from './atoms/check-box';
|
|
4
|
+
export * from './atoms/chip/chip';
|
|
5
|
+
export * from './atoms/chip/chips-list';
|
|
6
|
+
export * from './atoms/drop-down-menu';
|
|
7
|
+
export * from './atoms/icon-button';
|
|
8
|
+
export * from './atoms/search-bar';
|
|
9
|
+
export * from './atoms/text';
|
|
10
|
+
export * from './atoms/text-button';
|
|
11
|
+
export * from './atoms/tool-tip';
|
|
12
|
+
export * from './atoms/pop-over';
|
|
13
|
+
export * from './molecules/form';
|
|
14
|
+
export * from './molecules/form/form-select';
|
|
15
|
+
export * from './molecules/form/form-text-field';
|
|
16
|
+
export * from './molecules/select';
|
|
17
|
+
export * from './molecules/text-field';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
1
|
import { DropDownMenuOptionProps } from '../../../components';
|
|
3
2
|
export type SelectProps = {
|
|
4
3
|
isDisabled?: boolean;
|
|
@@ -6,14 +5,13 @@ export type SelectProps = {
|
|
|
6
5
|
removeOnSelect?: boolean;
|
|
7
6
|
isErrorVisible?: boolean;
|
|
8
7
|
className?: string;
|
|
9
|
-
emptyLabel?:
|
|
8
|
+
emptyLabel?: string;
|
|
10
9
|
initialInputValue?: string;
|
|
11
10
|
initialValues?: string[] | string;
|
|
12
11
|
options: DropDownMenuOptionProps[];
|
|
13
|
-
onBlur?: () => void;
|
|
14
12
|
onClick?: () => void;
|
|
15
13
|
onChangeText?: (value: string) => void;
|
|
16
14
|
onOptionChange?: (options: string[]) => void;
|
|
17
15
|
};
|
|
18
|
-
export declare function Select({ isDisabled, isMultiSelect, removeOnSelect, isErrorVisible, className, emptyLabel, initialInputValue, initialValues, options,
|
|
16
|
+
export declare function Select({ isDisabled, isMultiSelect, removeOnSelect, isErrorVisible, className, emptyLabel, initialInputValue, initialValues, options, onChangeText, onOptionChange, onClick, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
19
17
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-select.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/select/use-select.ts"],"names":[],"mappings":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.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useSelect = useSelect;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const string_utils_1 = require("../../../utils/string-utils/string-utils");
|
|
6
|
+
const components_1 = require("@/components/atoms/drop-down-menu/components");
|
|
6
7
|
function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options, initialValues, onChangeText = () => { }, onOptionChange = () => { }, }) {
|
|
7
8
|
const { normalize } = (0, string_utils_1.useStringUtils)();
|
|
8
9
|
const [chipsData, setChipsData] = (0, react_1.useState)([]);
|
|
@@ -10,6 +11,7 @@ function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options,
|
|
|
10
11
|
const [searchedOptions, setSearchedOptions] = (0, react_1.useState)([]);
|
|
11
12
|
const [selectedValues, setSelectedValues] = (0, react_1.useState)([]);
|
|
12
13
|
const [inputValue, setInputValue] = (0, react_1.useState)('');
|
|
14
|
+
const [firstRender, setFirstRender] = (0, react_1.useState)(false);
|
|
13
15
|
const inputRef = (0, react_1.useRef)(null);
|
|
14
16
|
const containerRef = (0, react_1.useRef)(null);
|
|
15
17
|
const memoOptions = (0, react_1.useMemo)(() => options || [], [options]);
|
|
@@ -47,6 +49,9 @@ function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options,
|
|
|
47
49
|
}
|
|
48
50
|
async function handleSelectOption(selectedValues) {
|
|
49
51
|
handleDropdownMenu();
|
|
52
|
+
if (selectedValues.variant !== components_1.MenuItemVariant.DEFAULT) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
50
55
|
const newSelectedValues = await handleGetSelectedValues(selectedValues);
|
|
51
56
|
setSelectedValues(newSelectedValues);
|
|
52
57
|
onOptionChange?.(newSelectedValues);
|
|
@@ -54,6 +59,7 @@ function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options,
|
|
|
54
59
|
function handleMapOptions() {
|
|
55
60
|
const mapOptions = options.map((option) => ({
|
|
56
61
|
...option,
|
|
62
|
+
variant: option.variant ?? components_1.MenuItemVariant.DEFAULT,
|
|
57
63
|
onClick: () => {
|
|
58
64
|
if (option?.onClick) {
|
|
59
65
|
option.onClick();
|
|
@@ -77,7 +83,7 @@ function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options,
|
|
|
77
83
|
const hasMatchingValue = normalize(currentOption.label)
|
|
78
84
|
.toLowerCase()
|
|
79
85
|
.includes(normalizedValue);
|
|
80
|
-
return hasMatchingValue || hasMatchingHelper;
|
|
86
|
+
return (hasMatchingValue || hasMatchingHelper || currentOption.variant !== components_1.MenuItemVariant.DEFAULT);
|
|
81
87
|
});
|
|
82
88
|
setSearchedOptions(filteredOptions);
|
|
83
89
|
}
|
|
@@ -101,15 +107,19 @@ function useSelect({ isMultiSelect, removeOnSelect, initialInputValue, options,
|
|
|
101
107
|
setInputValue(!isMultiSelect ? initial : '');
|
|
102
108
|
}
|
|
103
109
|
(0, react_1.useEffect)(() => {
|
|
110
|
+
if (firstRender) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
104
113
|
initializeValues();
|
|
105
|
-
|
|
114
|
+
setFirstRender(true);
|
|
115
|
+
}, [firstRender, memoOptions, initialValues]);
|
|
106
116
|
(0, react_1.useEffect)(() => {
|
|
107
117
|
const dropDownMenuOption = handleMapOptions();
|
|
108
118
|
const removedOptions = removeOnSelect
|
|
109
119
|
? dropDownMenuOption.filter((option) => !selectedValues.includes(option.value))
|
|
110
120
|
: dropDownMenuOption;
|
|
111
121
|
setSearchedOptions(removedOptions);
|
|
112
|
-
}, [
|
|
122
|
+
}, [selectedValues]);
|
|
113
123
|
(0, react_1.useEffect)(() => {
|
|
114
124
|
if (!inputRef.current) {
|
|
115
125
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-select.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/use-select.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"use-select.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/use-select.ts"],"names":[],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AC,cAAc,CAAC,CAAC,CAAC;QACrC,aAAa,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,OAAO;QACL,gBAAgB;QAChB,UAAU;QACV,cAAc;QACd,SAAS;QACT,eAAe;QACf,QAAQ;QACR,YAAY;QACZ,kBAAkB;QAClB,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const _periodUI_marker = true;
|
|
2
|
-
export { BilloIcon, IconColor, IconSymbol, IconSize, Button, ButtonVariant, Checkbox, CheckboxVariant, Chip, ChipList, DropDownMenu,
|
|
2
|
+
export { BilloIcon, IconColor, IconSymbol, IconSize, Button, ButtonVariant, Checkbox, CheckboxVariant, Chip, ChipList, DropDownMenu, IconButton, SearchBar, Text, TextVariant, TextColors, TextButton, TextButtonVariant, PopOver, PopOverPosition, Tooltip, } from './components';
|
|
3
3
|
export { Form, FormSelect, Select, FormTextField, TextField } from './components';
|
|
4
|
-
export type { FormErrors, FormConfig, FormHelpers, FormNames, FormRenderProps, FormSchema,
|
|
4
|
+
export type { FormErrors, FormConfig, FormHelpers, FormNames, FormRenderProps, FormSchema, } from './components';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { IconSymbol } from "../billo-icon";
|
|
2
|
-
import { MenuItemVariant } from "./components";
|
|
3
|
-
export type DropDownMenuOptionProps = {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
icon?: IconSymbol;
|
|
7
|
-
isSelected?: boolean;
|
|
8
|
-
isDisabled?: boolean;
|
|
9
|
-
helperLabel?: string;
|
|
10
|
-
variant?: MenuItemVariant;
|
|
11
|
-
onClick?: () => void;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=drop-down-menu-types.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { DropDownMenuOptionProps } from '../../../components';
|
|
3
|
-
import { MenuItemVariant } from './components';
|
|
4
|
-
type Props = {
|
|
5
|
-
className?: string;
|
|
6
|
-
selectedIDs: string[];
|
|
7
|
-
variant?: MenuItemVariant;
|
|
8
|
-
emptyElement?: ReactElement;
|
|
9
|
-
options: DropDownMenuOptionProps[];
|
|
10
|
-
};
|
|
11
|
-
export declare function DropDownMenu({ options, className, emptyElement, selectedIDs, variant, }: Props): JSX.Element;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=drop-down-menu.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SelectProps } from '../../../../components';
|
|
2
|
-
import { FormControlProps } from '../../../../containers';
|
|
3
|
-
export type FormSelectProps = FormControlProps & SelectProps & {
|
|
4
|
-
formControlClassName?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function FormSelect({ formControlClassName, ...props }: FormSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=form-select.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type SelectInputProps = {
|
|
2
|
-
isDisabled?: boolean;
|
|
3
|
-
className?: string;
|
|
4
|
-
inputValue: string;
|
|
5
|
-
onBlur?: () => void;
|
|
6
|
-
handleInputChange: (value: string) => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const SelectInput: import("react").ForwardRefExoticComponent<SelectInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
|
-
//# sourceMappingURL=select-input.d.ts.map
|