@bodynarf/react.components 1.7.1 → 1.7.2
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 → components}/accordion/component/index.d.ts +7 -4
- package/components/accordion/component/index.d.ts.map +1 -0
- package/components/accordion/component/index.js +35 -0
- package/components/accordion/index.d.ts +3 -0
- package/components/accordion/index.d.ts.map +1 -0
- package/{dist/components/anchor/index.d.ts → components/accordion/index.js} +2 -2
- package/{dist/components → components}/accordion/types.d.ts +18 -16
- package/components/accordion/types.d.ts.map +1 -0
- package/components/accordion/types.js +1 -0
- package/components/anchor/component/index.d.ts +6 -0
- package/components/anchor/component/index.d.ts.map +1 -0
- package/components/anchor/component/index.js +20 -0
- package/{dist/components → components}/anchor/components/anchorWithIcon/index.d.ts +5 -3
- package/components/anchor/components/anchorWithIcon/index.d.ts.map +1 -0
- package/components/anchor/components/anchorWithIcon/index.js +16 -0
- package/{dist/components → components}/anchor/components/simpleAnchor/index.d.ts +5 -3
- package/components/anchor/components/simpleAnchor/index.d.ts.map +1 -0
- package/components/anchor/components/simpleAnchor/index.js +5 -0
- package/components/anchor/index.d.ts +3 -0
- package/components/anchor/index.d.ts.map +1 -0
- package/{dist/components/button/index.d.ts → components/anchor/index.js} +2 -2
- package/{dist/components → components}/anchor/types.d.ts +39 -38
- package/components/anchor/types.d.ts.map +1 -0
- package/components/anchor/types.js +1 -0
- package/{dist/components → components}/button/component/index.d.ts +9 -6
- package/components/button/component/index.d.ts.map +1 -0
- package/components/button/component/index.js +36 -0
- package/{dist/components → components}/button/components/buttonWithIcon/index.d.ts +5 -3
- package/components/button/components/buttonWithIcon/index.d.ts.map +1 -0
- package/components/button/components/buttonWithIcon/index.js +19 -0
- package/{dist/components → components}/button/components/simpleButton/index.d.ts +5 -3
- package/components/button/components/simpleButton/index.d.ts.map +1 -0
- package/components/button/components/simpleButton/index.js +5 -0
- package/components/button/index.d.ts +3 -0
- package/components/button/index.d.ts.map +1 -0
- package/{dist/components/dropdown/index.d.ts → components/button/index.js} +2 -2
- package/{dist/components → components}/button/types.d.ts +37 -36
- package/components/button/types.d.ts.map +1 -0
- package/components/button/types.js +4 -0
- package/components/dropdown/component/index.d.ts +7 -0
- package/components/dropdown/component/index.d.ts.map +1 -0
- package/components/dropdown/component/index.js +15 -0
- package/{dist/components → components}/dropdown/components/compact/index.d.ts +5 -3
- package/components/dropdown/components/compact/index.d.ts.map +1 -0
- package/components/dropdown/components/compact/index.js +62 -0
- package/{dist/components → components}/dropdown/components/item/index.d.ts +15 -13
- package/components/dropdown/components/item/index.d.ts.map +1 -0
- package/components/dropdown/components/item/index.js +6 -0
- package/{dist/components → components}/dropdown/components/label/index.d.ts +18 -17
- package/components/dropdown/components/label/index.d.ts.map +1 -0
- package/components/dropdown/components/label/index.js +22 -0
- package/{dist/components → components}/dropdown/components/withLabel/index.d.ts +5 -3
- package/components/dropdown/components/withLabel/index.d.ts.map +1 -0
- package/components/dropdown/components/withLabel/index.js +83 -0
- package/components/dropdown/index.d.ts +3 -0
- package/components/dropdown/index.d.ts.map +1 -0
- package/{dist/components/accordion/index.d.ts → components/dropdown/index.js} +2 -2
- package/{dist/components → components}/dropdown/types.d.ts +46 -45
- package/components/dropdown/types.d.ts.map +1 -0
- package/components/dropdown/types.js +1 -0
- package/components/icon/component/index.d.ts +8 -0
- package/components/icon/component/index.d.ts.map +1 -0
- package/components/icon/component/index.js +23 -0
- package/components/icon/index.d.ts +3 -0
- package/components/icon/index.d.ts.map +1 -0
- package/components/icon/index.js +2 -0
- package/{dist/components → components}/icon/types.d.ts +16 -15
- package/components/icon/types.d.ts.map +1 -0
- package/components/icon/types.js +1 -0
- package/components/index.d.ts +12 -0
- package/components/index.d.ts.map +1 -0
- package/{dist/components/index.d.ts → components/index.js} +11 -11
- package/{dist/components → components}/paginator/component/index.d.ts +8 -6
- package/components/paginator/component/index.d.ts.map +1 -0
- package/components/paginator/component/index.js +47 -0
- package/components/paginator/index.d.ts +4 -0
- package/components/paginator/index.d.ts.map +1 -0
- package/{dist/components/paginator/index.d.ts → components/paginator/index.js} +3 -3
- package/{dist/components → components}/paginator/types.d.ts +28 -27
- package/components/paginator/types.d.ts.map +1 -0
- package/components/paginator/types.js +1 -0
- package/{dist/components → components}/paginator/utils.d.ts +10 -9
- package/components/paginator/utils.d.ts.map +1 -0
- package/components/paginator/utils.js +18 -0
- package/{dist/components → components}/primitives/checkbox/component/index.d.ts +7 -4
- package/components/primitives/checkbox/component/index.d.ts.map +1 -0
- package/components/primitives/checkbox/component/index.js +37 -0
- package/components/primitives/checkbox/index.d.ts +3 -0
- package/components/primitives/checkbox/index.d.ts.map +1 -0
- package/components/primitives/checkbox/index.js +2 -0
- package/{dist/components → components}/primitives/checkbox/types.d.ts +25 -24
- package/components/primitives/checkbox/types.d.ts.map +1 -0
- package/components/primitives/checkbox/types.js +1 -0
- package/{dist/components → components}/primitives/date/component/index.d.ts +7 -4
- package/components/primitives/date/component/index.d.ts.map +1 -0
- package/components/primitives/date/component/index.js +48 -0
- package/components/primitives/date/index.d.ts +3 -0
- package/components/primitives/date/index.d.ts.map +1 -0
- package/components/primitives/date/index.js +2 -0
- package/{dist/components → components}/primitives/date/types.d.ts +9 -8
- package/components/primitives/date/types.d.ts.map +1 -0
- package/components/primitives/date/types.js +1 -0
- package/components/primitives/index.d.ts +8 -0
- package/components/primitives/index.d.ts.map +1 -0
- package/{dist/components/primitives/index.d.ts → components/primitives/index.js} +7 -7
- package/components/primitives/multiline/component/index.d.ts +7 -0
- package/components/primitives/multiline/component/index.d.ts.map +1 -0
- package/components/primitives/multiline/component/index.js +15 -0
- package/{dist/components → components}/primitives/multiline/components/multilineWithLabel/index.d.ts +6 -4
- package/components/primitives/multiline/components/multilineWithLabel/index.d.ts.map +1 -0
- package/components/primitives/multiline/components/multilineWithLabel/index.js +45 -0
- package/{dist/components → components}/primitives/multiline/components/multilineWithoutLabel/index.d.ts +6 -4
- package/components/primitives/multiline/components/multilineWithoutLabel/index.d.ts.map +1 -0
- package/components/primitives/multiline/components/multilineWithoutLabel/index.js +27 -0
- package/components/primitives/multiline/index.d.ts +3 -0
- package/components/primitives/multiline/index.d.ts.map +1 -0
- package/components/primitives/multiline/index.js +2 -0
- package/{dist/components → components}/primitives/multiline/types.d.ts +11 -10
- package/components/primitives/multiline/types.d.ts.map +1 -0
- package/components/primitives/multiline/types.js +1 -0
- package/components/primitives/number/component/index.d.ts +6 -0
- package/components/primitives/number/component/index.d.ts.map +1 -0
- package/components/primitives/number/component/index.js +14 -0
- package/{dist/components → components}/primitives/number/components/withLabel/index.d.ts +6 -4
- package/components/primitives/number/components/withLabel/index.d.ts.map +1 -0
- package/components/primitives/number/components/withLabel/index.js +44 -0
- package/{dist/components → components}/primitives/number/components/withoutLabel/index.d.ts +6 -4
- package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -0
- package/components/primitives/number/components/withoutLabel/index.js +26 -0
- package/components/primitives/number/index.d.ts +3 -0
- package/components/primitives/number/index.d.ts.map +1 -0
- package/components/primitives/number/index.js +2 -0
- package/{dist/components → components}/primitives/number/types.d.ts +13 -12
- package/components/primitives/number/types.d.ts.map +1 -0
- package/components/primitives/number/types.js +1 -0
- package/components/primitives/password/component/index.d.ts +7 -0
- package/components/primitives/password/component/index.d.ts.map +1 -0
- package/components/primitives/password/component/index.js +13 -0
- package/{dist/components → components}/primitives/password/components/withLabel/index.d.ts +5 -3
- package/components/primitives/password/components/withLabel/index.d.ts.map +1 -0
- package/components/primitives/password/components/withLabel/index.js +51 -0
- package/{dist/components → components}/primitives/password/components/withoutLabel/index.d.ts +5 -3
- package/components/primitives/password/components/withoutLabel/index.d.ts.map +1 -0
- package/components/primitives/password/components/withoutLabel/index.js +33 -0
- package/components/primitives/password/index.d.ts +3 -0
- package/components/primitives/password/index.d.ts.map +1 -0
- package/components/primitives/password/index.js +2 -0
- package/{dist/components → components}/primitives/password/types.d.ts +10 -9
- package/components/primitives/password/types.d.ts.map +1 -0
- package/components/primitives/password/types.js +1 -0
- package/components/primitives/text/component/index.d.ts +7 -0
- package/components/primitives/text/component/index.d.ts.map +1 -0
- package/components/primitives/text/component/index.js +15 -0
- package/{dist/components → components}/primitives/text/components/textWithLabel/index.d.ts +6 -4
- package/components/primitives/text/components/textWithLabel/index.d.ts.map +1 -0
- package/components/primitives/text/components/textWithLabel/index.js +44 -0
- package/{dist/components → components}/primitives/text/components/textWithoutLabel/index.d.ts +6 -4
- package/components/primitives/text/components/textWithoutLabel/index.d.ts.map +1 -0
- package/components/primitives/text/components/textWithoutLabel/index.js +26 -0
- package/components/primitives/text/index.d.ts +3 -0
- package/components/primitives/text/index.d.ts.map +1 -0
- package/components/primitives/text/index.js +2 -0
- package/{dist/components → components}/primitives/text/types.d.ts +7 -6
- package/components/primitives/text/types.d.ts.map +1 -0
- package/components/primitives/text/types.js +1 -0
- package/{dist/components → components}/primitives/types/baseProps.d.ts +30 -29
- package/components/primitives/types/baseProps.d.ts.map +1 -0
- package/components/primitives/types/baseProps.js +1 -0
- package/components/primitives/types/index.d.ts +4 -0
- package/components/primitives/types/index.d.ts.map +1 -0
- package/{dist/components/primitives/types/index.d.ts → components/primitives/types/index.js} +3 -3
- package/{dist/components → components}/primitives/types/label.d.ts +14 -13
- package/components/primitives/types/label.d.ts.map +1 -0
- package/components/primitives/types/label.js +1 -0
- package/components/primitives/types/validation/index.d.ts +3 -0
- package/components/primitives/types/validation/index.d.ts.map +1 -0
- package/{dist/components/primitives/types/validation/index.d.ts → components/primitives/types/validation/index.js} +2 -2
- package/{dist/components → components}/primitives/types/validation/state.d.ts +9 -8
- package/components/primitives/types/validation/state.d.ts.map +1 -0
- package/components/primitives/types/validation/state.js +2 -0
- package/{dist/components → components}/primitives/types/validation/status.d.ts +10 -9
- package/components/primitives/types/validation/status.d.ts.map +1 -0
- package/components/primitives/types/validation/status.js +11 -0
- package/{dist/components → components}/search/component/index.d.ts +6 -3
- package/components/search/component/index.d.ts.map +1 -0
- package/components/search/component/index.js +37 -0
- package/components/search/index.d.ts +3 -0
- package/components/search/index.d.ts.map +1 -0
- package/components/search/index.js +2 -0
- package/{dist/components → components}/search/types.d.ts +27 -26
- package/components/search/types.d.ts.map +1 -0
- package/components/search/types.js +1 -0
- package/{dist/components → components}/tabs/component/index.d.ts +34 -31
- package/components/tabs/component/index.d.ts.map +1 -0
- package/components/tabs/component/index.js +68 -0
- package/{dist/components → components}/tabs/components/item/index.d.ts +13 -11
- package/components/tabs/components/item/index.d.ts.map +1 -0
- package/components/tabs/components/item/index.js +27 -0
- package/components/tabs/index.d.ts +3 -0
- package/components/tabs/index.d.ts.map +1 -0
- package/components/tabs/index.js +2 -0
- package/{dist/components → components}/tabs/types.d.ts +43 -42
- package/components/tabs/types.d.ts.map +1 -0
- package/components/tabs/types.js +34 -0
- package/{dist/components → components}/tag/component/index.d.ts +7 -4
- package/components/tag/component/index.d.ts.map +1 -0
- package/components/tag/component/index.js +28 -0
- package/components/tag/index.d.ts +3 -0
- package/components/tag/index.d.ts.map +1 -0
- package/components/tag/index.js +2 -0
- package/{dist/components → components}/tag/types.d.ts +27 -26
- package/components/tag/types.d.ts.map +1 -0
- package/components/tag/types.js +1 -0
- package/{dist/components → components}/types.d.ts +67 -66
- package/components/types.d.ts.map +1 -0
- package/components/types.js +31 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/index.d.ts.map +1 -0
- package/{dist/hooks/index.d.ts → hooks/index.js} +2 -2
- package/{dist/hooks → hooks}/useComponentOutsideClick.d.ts +11 -10
- package/hooks/useComponentOutsideClick.d.ts.map +1 -0
- package/hooks/useComponentOutsideClick.js +32 -0
- package/{dist/hooks → hooks}/usePagination.d.ts +20 -19
- package/hooks/usePagination.d.ts.map +1 -0
- package/hooks/usePagination.js +28 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/{dist/index.d.ts → index.js} +3 -3
- package/package.json +39 -45
- package/readme.md +56 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/{dist/utils → utils}/dataAttributes.d.ts +8 -7
- package/utils/dataAttributes.d.ts.map +1 -0
- package/utils/dataAttributes.js +19 -0
- package/{dist/utils → utils}/formValidation.d.ts +16 -15
- package/utils/formValidation.d.ts.map +1 -0
- package/utils/formValidation.js +35 -0
- package/utils/index.d.ts +3 -0
- package/utils/index.d.ts.map +1 -0
- package/{dist/utils/index.d.ts → utils/index.js} +2 -2
- package/dist/bbr-components.js +0 -1040
- package/dist/bbr-components.umd.cjs +0 -27
- package/dist/components/anchor/component/index.d.ts +0 -3
- package/dist/components/dropdown/component/index.d.ts +0 -4
- package/dist/components/icon/component/index.d.ts +0 -5
- package/dist/components/icon/index.d.ts +0 -2
- package/dist/components/primitives/checkbox/index.d.ts +0 -2
- package/dist/components/primitives/date/index.d.ts +0 -2
- package/dist/components/primitives/multiline/component/index.d.ts +0 -4
- package/dist/components/primitives/multiline/index.d.ts +0 -2
- package/dist/components/primitives/number/component/index.d.ts +0 -4
- package/dist/components/primitives/number/index.d.ts +0 -2
- package/dist/components/primitives/password/component/index.d.ts +0 -4
- package/dist/components/primitives/password/index.d.ts +0 -2
- package/dist/components/primitives/text/component/index.d.ts +0 -4
- package/dist/components/primitives/text/index.d.ts +0 -2
- package/dist/components/search/index.d.ts +0 -2
- package/dist/components/tabs/index.d.ts +0 -2
- package/dist/components/tag/index.d.ts +0 -2
- package/dist/style.css +0 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./style.scss";
|
|
3
|
+
import { AccordionProps } from "../../accordion";
|
|
4
|
+
/** Accordion panel */
|
|
5
|
+
declare const Accordion: ({ children, caption, style, size, defaultExpanded, onToggle, className, data, title, }: AccordionProps) => JSX.Element;
|
|
6
|
+
export default Accordion;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/component/index.tsx"],"names":[],"mappings":";AAIA,OAAO,cAAc,CAAC;AAOtB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,sBAAsB;AACtB,QAAA,MAAM,SAAS,2FAKZ,cAAc,KAAG,WA8DnB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { getClassName, isNullOrUndefined } from "@bodynarf/utils";
|
|
4
|
+
import "./style.scss";
|
|
5
|
+
import { ElementSize } from "../..";
|
|
6
|
+
import Icon from "../../icon";
|
|
7
|
+
import { mapDataAttributes } from "../../../utils";
|
|
8
|
+
/** Accordion panel */
|
|
9
|
+
const Accordion = ({ children, caption, style, size, defaultExpanded, onToggle, className, data, title, }) => {
|
|
10
|
+
const expandablePanelRef = useRef(null);
|
|
11
|
+
const [isExpanded, setIsExpanded] = useState(defaultExpanded ?? false);
|
|
12
|
+
const [maxHeight, setMaxHeight] = useState(defaultExpanded === true ? undefined : 0);
|
|
13
|
+
const toggleCollapse = useCallback(() => setMaxHeight(isExpanded ? 0 : expandablePanelRef.current.scrollHeight), [isExpanded]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (defaultExpanded === true && !isNullOrUndefined(expandablePanelRef.current)) {
|
|
16
|
+
setMaxHeight(expandablePanelRef.current.scrollHeight);
|
|
17
|
+
}
|
|
18
|
+
}, [defaultExpanded]);
|
|
19
|
+
useEffect(() => setIsExpanded(maxHeight !== 0), [maxHeight]);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
onToggle?.call(undefined, !isExpanded);
|
|
22
|
+
}, [isExpanded, onToggle]);
|
|
23
|
+
const elClassName = getClassName([
|
|
24
|
+
"bbr-accordion",
|
|
25
|
+
"message",
|
|
26
|
+
isNullOrUndefined(style) ? "" : `is-${style}`,
|
|
27
|
+
isNullOrUndefined(size) ? "" : `is-${size}`,
|
|
28
|
+
className,
|
|
29
|
+
]);
|
|
30
|
+
const dataAttributes = isNullOrUndefined(data)
|
|
31
|
+
? undefined
|
|
32
|
+
: mapDataAttributes(data);
|
|
33
|
+
return (_jsxs("article", { className: elClassName, "aria-expanded": isExpanded, ...dataAttributes, children: [_jsxs("div", { className: "message-header is-unselectable", onClick: toggleCollapse, children: [_jsx("span", { title: title, children: caption }), _jsx(Icon, { name: "arrow-down", size: size ?? ElementSize.Medium })] }), _jsx("div", { className: "message-body", ref: expandablePanelRef, style: { maxHeight: `${maxHeight}px` }, children: _jsx("div", { className: "message-body__content", children: children }) })] }));
|
|
34
|
+
};
|
|
35
|
+
export default Accordion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./component";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export { default } from "./component";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
caption
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
size
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BaseElementProps, ElementColor, ElementSize } from "..";
|
|
3
|
+
/** Accordion panel props type */
|
|
4
|
+
export interface AccordionProps extends BaseElementProps {
|
|
5
|
+
/** Content that should be collapsed inside */
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** Collapsible panel caption */
|
|
8
|
+
caption: string;
|
|
9
|
+
/** Default expanded state */
|
|
10
|
+
defaultExpanded?: boolean;
|
|
11
|
+
/** Panel size */
|
|
12
|
+
size?: ElementSize;
|
|
13
|
+
/** Color */
|
|
14
|
+
style?: ElementColor;
|
|
15
|
+
/** Extra handler for toggling visibility. Doesn't affect component logic */
|
|
16
|
+
onToggle?: (collapsed: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/types.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9E,iCAAiC;AACjC,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,8CAA8C;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAEhB,6BAA6B;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,iBAAiB;IACjB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,YAAY;IACZ,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/anchor/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAe,MAAM,iBAAiB,CAAC;AAK3D,uBAAuB;AACvB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA6B9D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrUndefined, isNullOrEmpty, getClassName } from "@bodynarf/utils";
|
|
3
|
+
import "./style.scss";
|
|
4
|
+
import { SimpleAnchor } from "../../anchor/components/simpleAnchor";
|
|
5
|
+
import { AnchorWithIcon } from "../../anchor/components/anchorWithIcon";
|
|
6
|
+
/** Anchor component */
|
|
7
|
+
export default function Anchor(props) {
|
|
8
|
+
if (isNullOrUndefined(props.caption) && isNullOrUndefined(props.icon)) {
|
|
9
|
+
throw new Error("No anchor content provided");
|
|
10
|
+
}
|
|
11
|
+
const className = getClassName([
|
|
12
|
+
"bbr-anchor",
|
|
13
|
+
!isNullOrEmpty(props.className) ? ` ${props.className}` : "",
|
|
14
|
+
props.disableHovering === true ? " bbr-anchor--unhoverable" : ""
|
|
15
|
+
]);
|
|
16
|
+
if (isNullOrUndefined(props.icon)) {
|
|
17
|
+
return (_jsx(SimpleAnchor, { ...props, className: className, onClick: props.onClick }));
|
|
18
|
+
}
|
|
19
|
+
return (_jsx(AnchorWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon }));
|
|
20
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnchorWithIconProps } from "../../../anchor";
|
|
3
|
+
/** Anchor with icon component */
|
|
4
|
+
export declare const AnchorWithIcon: ({ href, className, onClick, caption, title, target, icon }: AnchorWithIconProps) => JSX.Element;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/anchorWithIcon/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,iCAAiC;AACjC,eAAO,MAAM,cAAc,+DAAgE,mBAAmB,KAAG,WAqChH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrEmpty } from "@bodynarf/utils";
|
|
3
|
+
import Icon from "../../../icon";
|
|
4
|
+
/** Anchor with icon component */
|
|
5
|
+
export const AnchorWithIcon = ({ href, className, onClick, caption, title, target, icon }) => {
|
|
6
|
+
const iconPosition = icon.position || "left";
|
|
7
|
+
const iconClassName = isNullOrEmpty(caption)
|
|
8
|
+
? icon.className
|
|
9
|
+
: iconPosition === "left"
|
|
10
|
+
? `${icon.className} bbr-icon--left`
|
|
11
|
+
: `${icon.className} bbr-icon--right`;
|
|
12
|
+
if (iconPosition === "left") {
|
|
13
|
+
return (_jsxs("a", { href: href, className: className, title: title, target: target, onClick: onClick, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
|
|
14
|
+
}
|
|
15
|
+
return (_jsxs("a", { href: href, className: className, title: title, target: target, onClick: onClick, children: [caption, _jsx(Icon, { ...icon, className: iconClassName })] }));
|
|
16
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SimpleAnchorProps } from "../../../anchor";
|
|
3
|
+
/** Simple anchor component, without icon */
|
|
4
|
+
export declare const SimpleAnchor: ({ href, className, onClick, caption, title, target }: SimpleAnchorProps) => JSX.Element;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/anchor/components/simpleAnchor/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,4CAA4C;AAC5C,eAAO,MAAM,YAAY,yDAA0D,iBAAiB,KAAG,WAYtG,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** Simple anchor component, without icon */
|
|
3
|
+
export const SimpleAnchor = ({ href, className, onClick, caption, title, target }) => {
|
|
4
|
+
return (_jsx("a", { className: className, href: href, title: title, target: target, onClick: onClick, children: caption }));
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./component";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export { default } from "./component";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import { ElementIcon } from
|
|
2
|
-
/** Anchor component props type */
|
|
3
|
-
export interface AnchorProps {
|
|
4
|
-
/** Link destination */
|
|
5
|
-
href?: string;
|
|
6
|
-
/** Link caption */
|
|
7
|
-
caption?: string;
|
|
8
|
-
/** Click handler */
|
|
9
|
-
onClick?: () => void;
|
|
10
|
-
/** Configuration od inner icon */
|
|
11
|
-
icon?: ElementIcon;
|
|
12
|
-
/** Title of anchor */
|
|
13
|
-
title?: string;
|
|
14
|
-
/** Where to open the linked document */
|
|
15
|
-
target?: "_blank" | "_top";
|
|
16
|
-
/** Additional class names */
|
|
17
|
-
className?: string;
|
|
18
|
-
/** Should css hovering effects be disabled */
|
|
19
|
-
disableHovering?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface SimpleAnchorProps {
|
|
22
|
-
/** Link destination */
|
|
23
|
-
href?: string;
|
|
24
|
-
/** Class names */
|
|
25
|
-
className: string;
|
|
26
|
-
/** Click handler */
|
|
27
|
-
onClick?: () => void;
|
|
28
|
-
/** Link caption */
|
|
29
|
-
caption?: string;
|
|
30
|
-
/** Title of anchor */
|
|
31
|
-
title?: string;
|
|
32
|
-
/** Where to open the linked document */
|
|
33
|
-
target?: "_blank" | "_top";
|
|
34
|
-
}
|
|
35
|
-
export interface AnchorWithIconProps extends SimpleAnchorProps {
|
|
36
|
-
/** Configuration of icon */
|
|
37
|
-
icon: ElementIcon;
|
|
38
|
-
}
|
|
1
|
+
import { ElementIcon } from "..";
|
|
2
|
+
/** Anchor component props type */
|
|
3
|
+
export interface AnchorProps {
|
|
4
|
+
/** Link destination */
|
|
5
|
+
href?: string;
|
|
6
|
+
/** Link caption */
|
|
7
|
+
caption?: string;
|
|
8
|
+
/** Click handler */
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
/** Configuration od inner icon */
|
|
11
|
+
icon?: ElementIcon;
|
|
12
|
+
/** Title of anchor */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Where to open the linked document */
|
|
15
|
+
target?: "_blank" | "_top";
|
|
16
|
+
/** Additional class names */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Should css hovering effects be disabled */
|
|
19
|
+
disableHovering?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SimpleAnchorProps {
|
|
22
|
+
/** Link destination */
|
|
23
|
+
href?: string;
|
|
24
|
+
/** Class names */
|
|
25
|
+
className: string;
|
|
26
|
+
/** Click handler */
|
|
27
|
+
onClick?: () => void;
|
|
28
|
+
/** Link caption */
|
|
29
|
+
caption?: string;
|
|
30
|
+
/** Title of anchor */
|
|
31
|
+
title?: string;
|
|
32
|
+
/** Where to open the linked document */
|
|
33
|
+
target?: "_blank" | "_top";
|
|
34
|
+
}
|
|
35
|
+
export interface AnchorWithIconProps extends SimpleAnchorProps {
|
|
36
|
+
/** Configuration of icon */
|
|
37
|
+
icon: ElementIcon;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/anchor/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,kCAAkC;AAClC,MAAM,WAAW,WAAW;IACxB,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAE3B,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAC9B,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,kBAAkB;IAClB,SAAS,EAAE,MAAM,CAAC;IAElB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sBAAsB;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,wCAAwC;IACxC,MAAM,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,4BAA4B;IAC5B,IAAI,EAAE,WAAW,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./style.scss";
|
|
3
|
+
import { ButtonProps } from "../..";
|
|
4
|
+
/**
|
|
5
|
+
* Button component
|
|
6
|
+
* @throws Caption is not defined and icon configuration is not defined at the same time
|
|
7
|
+
*/
|
|
8
|
+
export default function Button(props: ButtonProps): JSX.Element;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/button/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAe,MAAM,iBAAiB,CAAC;AAO3D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA0C9D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrEmpty, isNullOrUndefined, getClassName } from "@bodynarf/utils";
|
|
3
|
+
import "./style.scss";
|
|
4
|
+
import { mapDataAttributes } from "../../../utils";
|
|
5
|
+
import { ButtonWithIcon } from "../../button/components/buttonWithIcon";
|
|
6
|
+
import { SimpleButton } from "../../button/components/simpleButton";
|
|
7
|
+
/**
|
|
8
|
+
* Button component
|
|
9
|
+
* @throws Caption is not defined and icon configuration is not defined at the same time
|
|
10
|
+
*/
|
|
11
|
+
export default function Button(props) {
|
|
12
|
+
if (isNullOrEmpty(props.caption) && isNullOrUndefined(props.icon)) {
|
|
13
|
+
throw new Error("No button content provided.");
|
|
14
|
+
}
|
|
15
|
+
const className = getClassName([
|
|
16
|
+
"button",
|
|
17
|
+
"bbr-button",
|
|
18
|
+
props.className,
|
|
19
|
+
`is-${props.type}`,
|
|
20
|
+
props.light === true ? "is-light" : "",
|
|
21
|
+
!isNullOrUndefined(props.size) ? `is-${props.size}` : "",
|
|
22
|
+
props.outlined === true ? "is-outlined" : "",
|
|
23
|
+
props.rounded === true ? "is-rounded" : "",
|
|
24
|
+
props.isLoading === true ? "is-loading" : "",
|
|
25
|
+
props.static === true ? "is-static" : "",
|
|
26
|
+
]);
|
|
27
|
+
const data = isNullOrUndefined(props.data)
|
|
28
|
+
? undefined
|
|
29
|
+
: mapDataAttributes(props.data);
|
|
30
|
+
if (!isNullOrUndefined(props.icon)) {
|
|
31
|
+
return (_jsx(ButtonWithIcon, { ...props, className: className, onClick: props.onClick, icon: props.icon, data: data }));
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
return (_jsx(SimpleButton, { ...props, className: className, onClick: props.onClick, data: data }));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonWithIconProps } from "../../../button";
|
|
3
|
+
/** Button with icon component */
|
|
4
|
+
export declare const ButtonWithIcon: ({ className, disabled, onClick, caption, title, icon, data, }: ButtonWithIconProps) => JSX.Element;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/buttonWithIcon/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,iCAAiC;AACjC,eAAO,MAAM,cAAc,kEAKxB,mBAAmB,KAAG,WAwCxB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrEmpty } from "@bodynarf/utils";
|
|
3
|
+
import Icon from "../../../icon";
|
|
4
|
+
/** Button with icon component */
|
|
5
|
+
export const ButtonWithIcon = ({ className, disabled, onClick, caption, title, icon, data, }) => {
|
|
6
|
+
const iconPosition = icon.position || "left";
|
|
7
|
+
const iconClassName = isNullOrEmpty(caption)
|
|
8
|
+
? icon.className
|
|
9
|
+
: iconPosition === "left"
|
|
10
|
+
? `${icon.className} bbr-icon--left`
|
|
11
|
+
: `${icon.className} bbr-icon--right`;
|
|
12
|
+
className = isNullOrEmpty(caption)
|
|
13
|
+
? `${className} bbr-button--icon-only`
|
|
14
|
+
: className;
|
|
15
|
+
if (iconPosition === "left") {
|
|
16
|
+
return (_jsxs("button", { className: className, disabled: disabled, onClick: onClick, title: title, ...data, children: [_jsx(Icon, { ...icon, className: iconClassName }), caption] }));
|
|
17
|
+
}
|
|
18
|
+
return (_jsxs("button", { className: className, disabled: disabled, onClick: onClick, title: title, ...data, children: [caption, _jsx(Icon, { ...icon, className: iconClassName })] }));
|
|
19
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SimpleButtonProps } from "../../../button";
|
|
3
|
+
/** Simple button component, without icon */
|
|
4
|
+
export declare const SimpleButton: ({ className, disabled, onClick, caption, title, data }: SimpleButtonProps) => JSX.Element;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/button/components/simpleButton/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,4CAA4C;AAC5C,eAAO,MAAM,YAAY,2DAKtB,iBAAiB,KAAG,WAYtB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** Simple button component, without icon */
|
|
3
|
+
export const SimpleButton = ({ className, disabled, onClick, caption, title, data }) => {
|
|
4
|
+
return (_jsx("button", { className: className, disabled: disabled, onClick: onClick, title: title, ...data, children: caption }));
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./component";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export { default } from "./component";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { BaseElementProps, ElementIcon, ElementSize } from
|
|
2
|
-
export interface ButtonProps extends BaseElementProps {
|
|
3
|
-
/** Button displaying text */
|
|
4
|
-
caption?: string;
|
|
5
|
-
/** Type of button (color) */
|
|
6
|
-
type: ButtonType;
|
|
7
|
-
/** Configuration of inner icon */
|
|
8
|
-
icon?: ElementIcon;
|
|
9
|
-
/** Button size */
|
|
10
|
-
size?: ElementSize;
|
|
11
|
-
/** Is button uses light version of color */
|
|
12
|
-
light?: boolean;
|
|
13
|
-
/** Is button outlined */
|
|
14
|
-
outlined?: boolean;
|
|
15
|
-
/** Should button corners be rounded */
|
|
16
|
-
rounded?: boolean;
|
|
17
|
-
/** Display loading icon */
|
|
18
|
-
isLoading?: boolean;
|
|
19
|
-
/** Is button disabled */
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
/** Is non-interactive button */
|
|
22
|
-
static?: boolean;
|
|
23
|
-
/** Click action handler */
|
|
24
|
-
onClick?: () => void;
|
|
25
|
-
}
|
|
26
|
-
/** Button types according to Bulma framework */
|
|
27
|
-
export type ButtonType = "default" /** color: transparent */ | "primary" /** color: sea-wave green */ | "link" /** color: blue-violet */ | "info" /** color: sky-blue */ | "success" /** color: green */ | "warning" /** color: yellow */ | "danger" /** color: red */ | "white" /** color: white */ | "light" /** color: light-gray */ | "dark" /** color: dark-gray */ | "black" /** color: black */ | "text" /** Underline text with color: gray */ | "ghost" /** Blue underline text with color: transparent */;
|
|
28
|
-
/** Simple button props type */
|
|
29
|
-
export interface SimpleButtonProps extends Omit<ButtonProps, 'className'> {
|
|
30
|
-
/** Button class name*/
|
|
31
|
-
className: string;
|
|
32
|
-
}
|
|
33
|
-
export interface ButtonWithIconProps extends SimpleButtonProps {
|
|
34
|
-
/** Icon configuration */
|
|
35
|
-
icon: ElementIcon;
|
|
36
|
-
}
|
|
1
|
+
import { BaseElementProps, ElementIcon, ElementSize } from "..";
|
|
2
|
+
export interface ButtonProps extends BaseElementProps {
|
|
3
|
+
/** Button displaying text */
|
|
4
|
+
caption?: string;
|
|
5
|
+
/** Type of button (color) */
|
|
6
|
+
type: ButtonType;
|
|
7
|
+
/** Configuration of inner icon */
|
|
8
|
+
icon?: ElementIcon;
|
|
9
|
+
/** Button size */
|
|
10
|
+
size?: ElementSize;
|
|
11
|
+
/** Is button uses light version of color */
|
|
12
|
+
light?: boolean;
|
|
13
|
+
/** Is button outlined */
|
|
14
|
+
outlined?: boolean;
|
|
15
|
+
/** Should button corners be rounded */
|
|
16
|
+
rounded?: boolean;
|
|
17
|
+
/** Display loading icon */
|
|
18
|
+
isLoading?: boolean;
|
|
19
|
+
/** Is button disabled */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Is non-interactive button */
|
|
22
|
+
static?: boolean;
|
|
23
|
+
/** Click action handler */
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
}
|
|
26
|
+
/** Button types according to Bulma framework */
|
|
27
|
+
export declare type ButtonType = "default" /** color: transparent */ | "primary" /** color: sea-wave green */ | "link" /** color: blue-violet */ | "info" /** color: sky-blue */ | "success" /** color: green */ | "warning" /** color: yellow */ | "danger" /** color: red */ | "white" /** color: white */ | "light" /** color: light-gray */ | "dark" /** color: dark-gray */ | "black" /** color: black */ | "text" /** Underline text with color: gray */ | "ghost" /** Blue underline text with color: transparent */;
|
|
28
|
+
/** Simple button props type */
|
|
29
|
+
export interface SimpleButtonProps extends Omit<ButtonProps, 'className'> {
|
|
30
|
+
/** Button class name*/
|
|
31
|
+
className: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ButtonWithIconProps extends SimpleButtonProps {
|
|
34
|
+
/** Icon configuration */
|
|
35
|
+
icon: ElementIcon;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8BAA8B;IAC9B,IAAI,EAAE,UAAU,CAAC;IAEjB,kCAAkC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,mBAAmB;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,2BAA2B;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,gDAAgD;AAChD,oBAAY,UAAU,GAClB,SAAS,CAAC,yBAAyB,GACjC,SAAS,CAAC,4BAA4B,GACtC,MAAM,CAAC,yBAAyB,GAChC,MAAM,CAAC,sBAAsB,GAC7B,SAAS,CAAC,mBAAmB,GAC7B,SAAS,CAAC,oBAAoB,GAC9B,QAAQ,CAAC,iBAAiB,GAC1B,OAAO,CAAC,mBAAmB,GAC3B,OAAO,CAAC,wBAAwB,GAChC,MAAM,CAAC,uBAAuB,GAC9B,OAAO,CAAC,mBAAmB,GAC3B,MAAM,CAAC,sCAAsC,GAC7C,OAAO,CAAC,kDAAkD,CAC3D;AAEL,+BAA+B;AAC/B,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC;IACrE,uBAAuB;IACvB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC1D,yBAAyB;IACzB,IAAI,EAAE,WAAW,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dropdown/component/index.tsx"],"names":[],"mappings":";AAEA,OAAO,cAAc,CAAC;AAKtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,yBAAyB;AACzB,QAAA,MAAM,QAAQ,UAAW,aAAa,KAAG,WAMxC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNullOrUndefined } from "@bodynarf/utils";
|
|
3
|
+
import "./style.scss";
|
|
4
|
+
import DropdownWithLabel from "../../dropdown/components/withLabel";
|
|
5
|
+
import DropdownCompact from "../../dropdown/components/compact";
|
|
6
|
+
/** Dropdown component */
|
|
7
|
+
const Dropdown = (props) => {
|
|
8
|
+
if (!isNullOrUndefined(props.label)) {
|
|
9
|
+
return _jsx(DropdownWithLabel, { ...props });
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return _jsx(DropdownCompact, { ...props });
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export default Dropdown;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DropdownProps } from "../../../dropdown";
|
|
3
|
+
declare const DropdownCompact: ({ items, value, onSelect, deselectable, className, hideOnOuterClick, listMaxHeight, placeholder, compact, disabled, }: DropdownProps) => JSX.Element;
|
|
4
|
+
export default DropdownCompact;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dropdown/components/compact/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,QAAA,MAAM,eAAe,0HAMlB,aAAa,KAAG,WAsGlB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|