react-restyle-components 0.4.12 → 0.4.13
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/lib/src/core-components/src/components/Accordion/AccordionSection/elements.d.ts +1 -1
- package/lib/src/core-components/src/components/Accordion/AccordionSection/elements.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Accordion/collapsible/collapsible.component.d.ts +22 -2
- package/lib/src/core-components/src/components/Accordion/collapsible/collapsible.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Accordion/collapsible/collapsible.component.js +2 -2
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.d.ts +58 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-multiple-select-multiple-fields-display/auto-complete-filter-multiple-select-multiple-fields-display.component.js +11 -11
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-single-select/auto-complete-filter-single-select.component.d.ts +26 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-single-select/auto-complete-filter-single-select.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-single-select/auto-complete-filter-single-select.component.js +11 -11
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.d.ts +28 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/AutoComplete/auto-complete-filter-single-select-multiple-fields-display/auto-complete-filter-single-select-multiple-fields-display.component.js +7 -5
- package/lib/src/core-components/src/components/Avatar/Avatar.d.ts +25 -1
- package/lib/src/core-components/src/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Avatar/Avatar.js +4 -4
- package/lib/src/core-components/src/components/Badge/Badge.d.ts +17 -3
- package/lib/src/core-components/src/components/Badge/Badge.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Badge/Badge.js +2 -2
- package/lib/src/core-components/src/components/Button1/button.component.d.ts +13 -2
- package/lib/src/core-components/src/components/Button1/button.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Button1/button.component.js +2 -2
- package/lib/src/core-components/src/components/Button1/buttonGroup/buttonGroup.component.d.ts +18 -4
- package/lib/src/core-components/src/components/Button1/buttonGroup/buttonGroup.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Button1/buttonGroup/buttonGroup.component.js +1 -1
- package/lib/src/core-components/src/components/Icon/Icon.d.ts +27 -12
- package/lib/src/core-components/src/components/Icon/Icon.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Icon/Icon.js +8 -8
- package/lib/src/core-components/src/components/Loader/loader.component.d.ts +38 -1
- package/lib/src/core-components/src/components/Loader/loader.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Loader/loader.component.js +12 -7
- package/lib/src/core-components/src/components/Modal/BasicModal/modal.component.d.ts +42 -2
- package/lib/src/core-components/src/components/Modal/BasicModal/modal.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Modal/BasicModal/modal.component.js +15 -8
- package/lib/src/core-components/src/components/Modal/modal-confirm/modal-confirm.component.d.ts +54 -2
- package/lib/src/core-components/src/components/Modal/modal-confirm/modal-confirm.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Modal/modal-confirm/modal-confirm.component.js +5 -5
- package/lib/src/core-components/src/components/Picker/color-picker/color-picker.component.d.ts +26 -4
- package/lib/src/core-components/src/components/Picker/color-picker/color-picker.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Picker/color-picker/color-picker.component.js +2 -2
- package/lib/src/core-components/src/components/Selection/multi-select/multi-select.component.d.ts +42 -1
- package/lib/src/core-components/src/components/Selection/multi-select/multi-select.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Selection/multi-select/multi-select.component.js +4 -4
- package/lib/src/core-components/src/components/Selection/single-select/single-select.component.d.ts +38 -2
- package/lib/src/core-components/src/components/Selection/single-select/single-select.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Selection/single-select/single-select.component.js +8 -6
- package/lib/src/core-components/src/components/Stepper2/stepper.component.d.ts +38 -2
- package/lib/src/core-components/src/components/Stepper2/stepper.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Stepper2/stepper.component.js +12 -7
- package/lib/src/core-components/src/components/Tabs/tabs.component.d.ts +33 -3
- package/lib/src/core-components/src/components/Tabs/tabs.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Tabs/tabs.component.js +8 -5
- package/lib/src/core-components/src/components/Tags1/Tags.component.d.ts +46 -1
- package/lib/src/core-components/src/components/Tags1/Tags.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Tags1/Tags.component.js +5 -5
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.d.ts +21 -2
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.d.ts.map +1 -1
- package/lib/src/core-components/src/components/Tooltip/tooltip.component.js +2 -2
- package/lib/src/core-components/src/tc.global.css +3 -2
- package/lib/src/core-components/src/tc.module.css +2 -2
- package/package.json +1 -1
package/lib/src/core-components/src/components/Selection/multi-select/multi-select.component.d.ts
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface MultiSelectClassNames {
|
|
3
|
+
/** Custom className for the container */
|
|
4
|
+
container?: string;
|
|
5
|
+
/** Custom className for the trigger/display span */
|
|
6
|
+
trigger?: string;
|
|
7
|
+
/** Custom className for the dropdown container */
|
|
8
|
+
dropdown?: string;
|
|
9
|
+
/** Custom className for the list */
|
|
10
|
+
list?: string;
|
|
11
|
+
/** Custom className for list items */
|
|
12
|
+
listItem?: string;
|
|
13
|
+
/** Custom className for the label */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Custom className for the checkbox */
|
|
16
|
+
checkbox?: string;
|
|
17
|
+
/** Custom className for the item text */
|
|
18
|
+
itemText?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface MultiSelectStyles {
|
|
21
|
+
/** Custom style for the container */
|
|
22
|
+
container?: CSSProperties;
|
|
23
|
+
/** Custom style for the trigger/display span */
|
|
24
|
+
trigger?: CSSProperties;
|
|
25
|
+
/** Custom style for the dropdown container */
|
|
26
|
+
dropdown?: CSSProperties;
|
|
27
|
+
/** Custom style for the list */
|
|
28
|
+
list?: CSSProperties;
|
|
29
|
+
/** Custom style for list items */
|
|
30
|
+
listItem?: CSSProperties;
|
|
31
|
+
/** Custom style for the label */
|
|
32
|
+
label?: CSSProperties;
|
|
33
|
+
/** Custom style for the checkbox */
|
|
34
|
+
checkbox?: CSSProperties;
|
|
35
|
+
/** Custom style for the item text */
|
|
36
|
+
itemText?: CSSProperties;
|
|
37
|
+
}
|
|
1
38
|
interface MultiSelectProps {
|
|
2
39
|
options: Array<string>;
|
|
3
40
|
selectedItems?: Array<string>;
|
|
4
41
|
hasError?: boolean;
|
|
42
|
+
/** Custom classNames for component parts */
|
|
43
|
+
classNames?: MultiSelectClassNames;
|
|
44
|
+
/** Custom inline styles for component parts */
|
|
45
|
+
styles?: MultiSelectStyles;
|
|
5
46
|
onSelect: (item: any) => any;
|
|
6
47
|
}
|
|
7
|
-
export declare const MultiSelect: ({ options, selectedItems, hasError, onSelect, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare const MultiSelect: ({ options, selectedItems, hasError, classNames, styles, onSelect, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
49
|
export {};
|
|
9
50
|
//# sourceMappingURL=multi-select.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-select.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/core-components/src/components/Selection/multi-select/multi-select.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"multi-select.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/core-components/src/components/Selection/multi-select/multi-select.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAA8B,aAAa,EAAC,MAAM,OAAO,CAAC;AAIxE,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,gDAAgD;IAChD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,gCAAgC;IAChC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,iCAAiC;IACjC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED,UAAU,gBAAgB;IACxB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,+CAA+C;IAC/C,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAC9B;AAED,eAAO,MAAM,WAAW,wEAOrB,gBAAgB,4CAsIlB,CAAC"}
|
package/lib/src/core-components/src/components/Selection/multi-select/multi-select.component.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import s from '../../../tc.module.css';
|
|
4
4
|
import { cn } from '../../../utils';
|
|
5
|
-
export const MultiSelect = ({ options = [], selectedItems = [], hasError = false, onSelect, }) => {
|
|
5
|
+
export const MultiSelect = ({ options = [], selectedItems = [], hasError = false, classNames = {}, styles = {}, onSelect, }) => {
|
|
6
6
|
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
7
7
|
const [isListOpen, setIsListOpen] = useState(false);
|
|
8
8
|
const useOutsideAlerter = (ref) => {
|
|
@@ -26,10 +26,10 @@ export const MultiSelect = ({ options = [], selectedItems = [], hasError = false
|
|
|
26
26
|
return (_jsx(_Fragment, { children: _jsxs("div", { className: cn(s['flex'], s['dark:bg-boxdark'], s['dark:text-white'], s['flex-col'], s['w-full'], s['rounded-md'], s['border'], {
|
|
27
27
|
[s['border-red']]: hasError,
|
|
28
28
|
[s['border-gray-300']]: !hasError,
|
|
29
|
-
}), ref: wrapperRef, children: [_jsx("span", { className: cn(s['p-2'], s['shadow-sm']), onClick: () => {
|
|
29
|
+
}, classNames.container), style: styles.container, ref: wrapperRef, children: [_jsx("span", { className: cn(s['p-2'], s['shadow-sm'], classNames.trigger), style: styles.trigger, onClick: () => {
|
|
30
30
|
setIsListOpen(!isListOpen);
|
|
31
31
|
}, children: selectedOptions?.length > 0 ? selectedOptions?.join(',') : 'Select' }), _jsx("div", { className: cn(s['flex'], { [s['show']]: isListOpen, [s['hidden']]: !isListOpen }, s['relative']), children: options
|
|
32
|
-
? options?.length > 0 && (_jsx("div", { className: cn(s['flex'], s['absolute'], s['rounded-sm'], s['w-full']), style: { zIndex: 999 }, children: _jsx("ul", { className: cn(s['flex'], s['flex-col'], s['gap-1'], s['w-full'], s['bg-white'], s['shadow-md'], s['rounded-md'], s['border'], s['border-gray-200'], s['list-none'], s['m-0'], s['p-0']), children: options?.map((item, index) => (_jsx("li", { className: cn(s['flex'], s['gap-2'], s['p-2']), children: _jsxs("label", { className: cn(s['flex'], s['gap-2']), children: [_jsx("input", { className: cn(s['flex'], s['h-4'], s['w-4']), type: "checkbox", checked: selectedOptions?.includes(item), onChange: () => {
|
|
32
|
+
? options?.length > 0 && (_jsx("div", { className: cn(s['flex'], s['absolute'], s['rounded-sm'], s['w-full'], classNames.dropdown), style: { zIndex: 999, ...styles.dropdown }, children: _jsx("ul", { className: cn(s['flex'], s['flex-col'], s['gap-1'], s['w-full'], s['bg-white'], s['shadow-md'], s['rounded-md'], s['border'], s['border-gray-200'], s['list-none'], s['m-0'], s['p-0'], classNames.list), style: styles.list, children: options?.map((item, index) => (_jsx("li", { className: cn(s['flex'], s['gap-2'], s['p-2'], classNames.listItem), style: styles.listItem, children: _jsxs("label", { className: cn(s['flex'], s['gap-2'], classNames.label), style: styles.label, children: [_jsx("input", { className: cn(s['flex'], s['h-4'], s['w-4'], classNames.checkbox), style: styles.checkbox, type: "checkbox", checked: selectedOptions?.includes(item), onChange: () => {
|
|
33
33
|
if (selectedOptions?.includes(item)) {
|
|
34
34
|
setSelectedOptions(selectedOptions?.filter((e) => e != item));
|
|
35
35
|
}
|
|
@@ -44,6 +44,6 @@ export const MultiSelect = ({ options = [], selectedItems = [], hasError = false
|
|
|
44
44
|
}, onBlur: () => {
|
|
45
45
|
if (!isListOpen)
|
|
46
46
|
onSelect(selectedOptions);
|
|
47
|
-
} }), _jsx("span", { className: cn(s['flex'], s['h-4']), children: item })] }) }, index))) }) }))
|
|
47
|
+
} }), _jsx("span", { className: cn(s['flex'], s['h-4'], classNames.itemText), style: styles.itemText, children: item })] }) }, index))) }) }))
|
|
48
48
|
: null })] }) }));
|
|
49
49
|
};
|
package/lib/src/core-components/src/components/Selection/single-select/single-select.component.d.ts
CHANGED
|
@@ -1,4 +1,36 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
export interface SingleSelectClassNames {
|
|
3
|
+
/** Custom className for the container */
|
|
4
|
+
container?: string;
|
|
5
|
+
/** Custom className for the trigger/display span */
|
|
6
|
+
trigger?: string;
|
|
7
|
+
/** Custom className for the icon wrapper */
|
|
8
|
+
icon?: string;
|
|
9
|
+
/** Custom className for the dropdown container */
|
|
10
|
+
dropdown?: string;
|
|
11
|
+
/** Custom className for the list */
|
|
12
|
+
list?: string;
|
|
13
|
+
/** Custom className for list items */
|
|
14
|
+
listItem?: string;
|
|
15
|
+
/** Custom className for the item text */
|
|
16
|
+
itemText?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SingleSelectStyles {
|
|
19
|
+
/** Custom style for the container */
|
|
20
|
+
container?: CSSProperties;
|
|
21
|
+
/** Custom style for the trigger/display span */
|
|
22
|
+
trigger?: CSSProperties;
|
|
23
|
+
/** Custom style for the icon wrapper */
|
|
24
|
+
icon?: CSSProperties;
|
|
25
|
+
/** Custom style for the dropdown container */
|
|
26
|
+
dropdown?: CSSProperties;
|
|
27
|
+
/** Custom style for the list */
|
|
28
|
+
list?: CSSProperties;
|
|
29
|
+
/** Custom style for list items */
|
|
30
|
+
listItem?: CSSProperties;
|
|
31
|
+
/** Custom style for the item text */
|
|
32
|
+
itemText?: CSSProperties;
|
|
33
|
+
}
|
|
2
34
|
interface SingleSelectProps {
|
|
3
35
|
options: Array<any>;
|
|
4
36
|
displayKey?: string;
|
|
@@ -6,8 +38,12 @@ interface SingleSelectProps {
|
|
|
6
38
|
hasError?: boolean;
|
|
7
39
|
className?: string;
|
|
8
40
|
style?: React.CSSProperties;
|
|
41
|
+
/** Custom classNames for component parts */
|
|
42
|
+
classNames?: SingleSelectClassNames;
|
|
43
|
+
/** Custom inline styles for component parts */
|
|
44
|
+
styles?: SingleSelectStyles;
|
|
9
45
|
onSelect: (item: any) => any;
|
|
10
46
|
}
|
|
11
|
-
export declare const SingleSelect: ({ options, displayKey, displayValue, hasError, className, style, onSelect, }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare const SingleSelect: ({ options, displayKey, displayValue, hasError, className, style, classNames, styles, onSelect, }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
48
|
export {};
|
|
13
49
|
//# sourceMappingURL=single-select.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-select.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/core-components/src/components/Selection/single-select/single-select.component.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"single-select.component.d.ts","sourceRoot":"","sources":["../../../../../../../src/core-components/src/components/Selection/single-select/single-select.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA8B,aAAa,EAAC,MAAM,OAAO,CAAC;AAKxE,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,gDAAgD;IAChD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,wCAAwC;IACxC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,gCAAgC;IAChC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,4CAA4C;IAC5C,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC,+CAA+C;IAC/C,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAC9B;AAED,eAAO,MAAM,YAAY,qGAUtB,iBAAiB,4CA8LnB,CAAC"}
|
package/lib/src/core-components/src/components/Selection/single-select/single-select.component.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useState, useEffect, useRef } from 'react';
|
|
|
3
3
|
import { Icon } from '../../Icon/Icon';
|
|
4
4
|
import s from '../../../tc.module.css';
|
|
5
5
|
import { cn } from '../../../utils';
|
|
6
|
-
export const SingleSelect = ({ options = [], displayKey = 'title', displayValue = '', hasError = false, className = '', style = {}, onSelect, }) => {
|
|
6
|
+
export const SingleSelect = ({ options = [], displayKey = 'title', displayValue = '', hasError = false, className = '', style = {}, classNames = {}, styles = {}, onSelect, }) => {
|
|
7
7
|
const [value, setValue] = useState('');
|
|
8
8
|
const [isListOpen, setIsListOpen] = useState(false);
|
|
9
9
|
// Arrow navigation state
|
|
@@ -61,10 +61,10 @@ export const SingleSelect = ({ options = [], displayKey = 'title', displayValue
|
|
|
61
61
|
return (_jsx(_Fragment, { children: _jsxs("div", { className: cn(s['flex'], s['dark:bg-boxdark'], s['dark:text-white'], s['flex-col'], s['w-full'], s['rounded-md'], s['border'], {
|
|
62
62
|
[s['border-red']]: hasError,
|
|
63
63
|
[s['border-gray-300']]: !hasError,
|
|
64
|
-
}, className), ref: wrapperRef, style: style, children: [_jsxs("span", { className: cn(s['p-2'], s['shadow-sm'], s['flex'], s['justify-between'], s['items-center']), onClick: () => {
|
|
64
|
+
}, className, classNames.container), ref: wrapperRef, style: { ...style, ...styles.container }, children: [_jsxs("span", { className: cn(s['p-2'], s['shadow-sm'], s['flex'], s['justify-between'], s['items-center'], classNames.trigger), onClick: () => {
|
|
65
65
|
setIsListOpen(!isListOpen);
|
|
66
|
-
}, tabIndex: 0, style: { cursor: 'pointer' }, children: [value ? value : 'Select', _jsx("span", { children: isListOpen ? (_jsx(Icon, { nameIcon: "FaChevronUp", propsIcon: { size: 16 } })) : (_jsx(Icon, { nameIcon: "FaChevronDown", propsIcon: { size: 16 } })) })] }), _jsx("div", { className: cn(s['flex'], { [s['show']]: isListOpen, [s['hidden']]: !isListOpen }, s['relative']), children: options
|
|
67
|
-
? options?.length > 0 && (_jsx("div", { className: cn(s['flex'], s['absolute'], s['rounded-sm'], s['w-full']), style: {
|
|
66
|
+
}, tabIndex: 0, style: { cursor: 'pointer', ...styles.trigger }, children: [value ? value : 'Select', _jsx("span", { className: classNames.icon, style: styles.icon, children: isListOpen ? (_jsx(Icon, { nameIcon: "FaChevronUp", propsIcon: { size: 16 } })) : (_jsx(Icon, { nameIcon: "FaChevronDown", propsIcon: { size: 16 } })) })] }), _jsx("div", { className: cn(s['flex'], { [s['show']]: isListOpen, [s['hidden']]: !isListOpen }, s['relative']), children: options
|
|
67
|
+
? options?.length > 0 && (_jsx("div", { className: cn(s['flex'], s['absolute'], s['rounded-sm'], s['w-full'], classNames.dropdown), style: {
|
|
68
68
|
zIndex: 999,
|
|
69
69
|
top: 'calc(100% + 0.5rem)',
|
|
70
70
|
left: 0,
|
|
@@ -73,13 +73,15 @@ export const SingleSelect = ({ options = [], displayKey = 'title', displayValue
|
|
|
73
73
|
padding: 0,
|
|
74
74
|
animation: 'fadeIn 0.15s ease-out',
|
|
75
75
|
transformOrigin: 'top',
|
|
76
|
-
|
|
76
|
+
...styles.dropdown,
|
|
77
|
+
}, children: _jsx("ul", { className: cn(s['flex'], s['flex-col'], s['gap-1'], s['w-full'], s['bg-white'], s['shadow-md'], s['rounded-md'], s['border'], s['border-gray-200'], s['list-none'], s['m-0'], s['p-0'], classNames.list), style: styles.list, children: options?.map((item, index) => (_jsx("li", { className: cn(s['flex'], s['gap-2'], s['p-2'], highlightedIndex === index && s['bg-blue-100'], classNames.listItem), style: {
|
|
77
78
|
cursor: 'pointer',
|
|
78
79
|
background: highlightedIndex === index ? '#e0e7ff' : undefined,
|
|
80
|
+
...styles.listItem,
|
|
79
81
|
}, onClick: () => {
|
|
80
82
|
setValue(item[displayKey]);
|
|
81
83
|
onSelect(item);
|
|
82
84
|
setIsListOpen(false);
|
|
83
|
-
}, onMouseEnter: () => setHighlightedIndex(index), children: _jsx("label", { className: cn(s['flex'], s['gap-2']), children: _jsx("span", { className: cn(s['flex'], s['h-4']), children: item[displayKey] }) }) }, index))) }) }))
|
|
85
|
+
}, onMouseEnter: () => setHighlightedIndex(index), children: _jsx("label", { className: cn(s['flex'], s['gap-2']), children: _jsx("span", { className: cn(s['flex'], s['h-4'], classNames.itemText), style: styles.itemText, children: item[displayKey] }) }) }, index))) }) }))
|
|
84
86
|
: null })] }) }));
|
|
85
87
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
2
|
export type StepperSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export type StepperStepStatus = 'completed' | 'current' | 'pending';
|
|
4
4
|
export interface StepperStep {
|
|
@@ -27,6 +27,38 @@ export interface StepperColors {
|
|
|
27
27
|
/** Text color for pending steps */
|
|
28
28
|
pendingTextColor?: string;
|
|
29
29
|
}
|
|
30
|
+
export interface StepperClassNames {
|
|
31
|
+
/** Custom className for the root container */
|
|
32
|
+
container?: string;
|
|
33
|
+
/** Custom className for the steps wrapper */
|
|
34
|
+
stepsWrapper?: string;
|
|
35
|
+
/** Custom className for the background line */
|
|
36
|
+
backgroundLine?: string;
|
|
37
|
+
/** Custom className for the progress line */
|
|
38
|
+
progressLine?: string;
|
|
39
|
+
/** Custom className for individual step wrapper */
|
|
40
|
+
stepWrapper?: string;
|
|
41
|
+
/** Custom className for the step circle */
|
|
42
|
+
stepCircle?: string;
|
|
43
|
+
/** Custom className for the step description */
|
|
44
|
+
stepDescription?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface StepperStyles {
|
|
47
|
+
/** Custom style for the root container */
|
|
48
|
+
container?: CSSProperties;
|
|
49
|
+
/** Custom style for the steps wrapper */
|
|
50
|
+
stepsWrapper?: CSSProperties;
|
|
51
|
+
/** Custom style for the background line */
|
|
52
|
+
backgroundLine?: CSSProperties;
|
|
53
|
+
/** Custom style for the progress line */
|
|
54
|
+
progressLine?: CSSProperties;
|
|
55
|
+
/** Custom style for individual step wrapper */
|
|
56
|
+
stepWrapper?: CSSProperties;
|
|
57
|
+
/** Custom style for the step circle */
|
|
58
|
+
stepCircle?: CSSProperties;
|
|
59
|
+
/** Custom style for the step description */
|
|
60
|
+
stepDescription?: CSSProperties;
|
|
61
|
+
}
|
|
30
62
|
export interface StepperProps {
|
|
31
63
|
/** Additional className for the container */
|
|
32
64
|
className?: string;
|
|
@@ -52,6 +84,10 @@ export interface StepperProps {
|
|
|
52
84
|
style?: React.CSSProperties;
|
|
53
85
|
/** Orientation (horizontal is default) */
|
|
54
86
|
orientation?: 'horizontal' | 'vertical';
|
|
87
|
+
/** Custom classNames for component parts */
|
|
88
|
+
classNames?: StepperClassNames;
|
|
89
|
+
/** Custom inline styles for component parts */
|
|
90
|
+
styles?: StepperStyles;
|
|
55
91
|
}
|
|
56
|
-
export declare const Stepper: ({ className, steps, currentStep, onStepClick, size, colors, showNumbers, lineThickness, stepSize, clickable, style, orientation, }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
92
|
+
export declare const Stepper: ({ className, steps, currentStep, onStepClick, size, colors, showNumbers, lineThickness, stepSize, clickable, style, orientation, classNames: customClassNames, styles: customStyles, }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
93
|
//# sourceMappingURL=stepper.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Stepper2/stepper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"stepper.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Stepper2/stepper.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAI3C,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7C,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpE,MAAM,WAAW,WAAW;IAC1B,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,yCAAyC;IACzC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,2CAA2C;IAC3C,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,yCAAyC;IACzC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,uCAAuC;IACvC,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,4CAA4C;IAC5C,eAAe,CAAC,EAAE,aAAa,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC;IACnC,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,WAAW,CAAC,EAAE,CACZ,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GAAG,WAAW,EAC1B,KAAK,EAAE,MAAM,KACV,IAAI,CAAC;IACV,mBAAmB;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,oBAAoB;IACpB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,wBAAwB;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+BAA+B;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,0CAA0C;IAC1C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAqBD,eAAO,MAAM,OAAO,2LAejB,YAAY,4CAoMd,CAAC"}
|
|
@@ -15,12 +15,12 @@ const SIZE_CONFIG = {
|
|
|
15
15
|
md: { stepSize: 32, fontSize: '0.75rem', padding: 4 },
|
|
16
16
|
lg: { stepSize: 40, fontSize: '0.875rem', padding: 6 },
|
|
17
17
|
};
|
|
18
|
-
export const Stepper = ({ className = '', steps, currentStep = 1, onStepClick, size = 'md', colors = {}, showNumbers = true, lineThickness = 2, stepSize, clickable = true, style, orientation = 'horizontal', }) => {
|
|
18
|
+
export const Stepper = ({ className = '', steps, currentStep = 1, onStepClick, size = 'md', colors = {}, showNumbers = true, lineThickness = 2, stepSize, clickable = true, style, orientation = 'horizontal', classNames: customClassNames = {}, styles: customStyles = {}, }) => {
|
|
19
19
|
const mergedColors = { ...DEFAULT_COLORS, ...colors };
|
|
20
20
|
const sizeConfig = SIZE_CONFIG[size];
|
|
21
21
|
const finalStepSize = stepSize || sizeConfig.stepSize;
|
|
22
22
|
const linePosition = sizeConfig.padding + finalStepSize / 2;
|
|
23
|
-
const finalClass = cn(className, s['w-full'], s['px-4'], s['sm:px-8']);
|
|
23
|
+
const finalClass = cn(className, s['w-full'], s['px-4'], s['sm:px-8'], customClassNames.container);
|
|
24
24
|
// Helper to get step info
|
|
25
25
|
const getStepInfo = (step, index) => {
|
|
26
26
|
if (typeof step === 'string') {
|
|
@@ -93,11 +93,12 @@ export const Stepper = ({ className = '', steps, currentStep = 1, onStepClick, s
|
|
|
93
93
|
}
|
|
94
94
|
return (_jsxs("div", { style: {
|
|
95
95
|
left: steps.length > 1 ? `${(index / (steps.length - 1)) * 100}%` : '50%',
|
|
96
|
-
|
|
96
|
+
...customStyles.stepWrapper,
|
|
97
|
+
}, className: cn(s['absolute'], customClassNames.stepWrapper), children: [_jsx("span", { className: cn(stepClass, s['font-arimaRegular'], customClassNames.stepCircle), style: { ...stepStyles, ...customStyles.stepCircle }, onClick: () => {
|
|
97
98
|
if (clickable && onStepClick) {
|
|
98
99
|
onStepClick(stepNumber, step, index);
|
|
99
100
|
}
|
|
100
|
-
}, children: showNumbers ? stepNumber : stepInfo.label }), !showNumbers && stepInfo.description && (_jsx("div", { style: {
|
|
101
|
+
}, children: showNumbers ? stepNumber : stepInfo.label }), !showNumbers && stepInfo.description && (_jsx("div", { className: customClassNames.stepDescription, style: {
|
|
101
102
|
position: 'absolute',
|
|
102
103
|
top: `${finalStepSize + 8}px`,
|
|
103
104
|
left: '50%',
|
|
@@ -107,6 +108,7 @@ export const Stepper = ({ className = '', steps, currentStep = 1, onStepClick, s
|
|
|
107
108
|
? mergedColors.activeColor
|
|
108
109
|
: mergedColors.pendingTextColor,
|
|
109
110
|
whiteSpace: 'nowrap',
|
|
111
|
+
...customStyles.stepDescription,
|
|
110
112
|
}, children: stepInfo.description }))] }, `step-${index}-${stepInfo.label}`));
|
|
111
113
|
});
|
|
112
114
|
// Calculate progress width based on current step
|
|
@@ -114,21 +116,24 @@ export const Stepper = ({ className = '', steps, currentStep = 1, onStepClick, s
|
|
|
114
116
|
? `${((currentStep - 1) / (steps.length - 1)) * 100}%`
|
|
115
117
|
: '0%';
|
|
116
118
|
const containerHeight = sizeConfig.padding * 2 + finalStepSize;
|
|
117
|
-
return (_jsx("div", { className: finalClass, style: style, children: _jsxs("div", { className: cn(s['w-full'], s['relative']), style: {
|
|
119
|
+
return (_jsx("div", { className: finalClass, style: { ...style, ...customStyles.container }, children: _jsxs("div", { className: cn(s['w-full'], s['relative'], customClassNames.stepsWrapper), style: {
|
|
118
120
|
minHeight: `${containerHeight}px`,
|
|
119
121
|
paddingTop: `${sizeConfig.padding}px`,
|
|
120
|
-
|
|
122
|
+
...customStyles.stepsWrapper,
|
|
123
|
+
}, children: [_jsx("div", { className: cn(s['absolute'], s['left-0'], s['w-full'], s['transition-width'], s['ease-in-out'], s['duration-500'], customClassNames.backgroundLine), style: {
|
|
121
124
|
top: `${linePosition}px`,
|
|
122
125
|
height: `${lineThickness}px`,
|
|
123
126
|
backgroundColor: mergedColors.lineColor,
|
|
124
127
|
transform: 'translateY(-50%)',
|
|
125
128
|
zIndex: 0,
|
|
126
|
-
|
|
129
|
+
...customStyles.backgroundLine,
|
|
130
|
+
} }), _jsx("div", { className: cn(s['absolute'], s['left-0'], s['transition-width'], s['ease-in-out'], s['duration-500'], customClassNames.progressLine), style: {
|
|
127
131
|
top: `${linePosition}px`,
|
|
128
132
|
width: progressWidth,
|
|
129
133
|
height: `${lineThickness}px`,
|
|
130
134
|
backgroundColor: mergedColors.completedColor,
|
|
131
135
|
transform: 'translateY(-50%)',
|
|
132
136
|
zIndex: 1,
|
|
137
|
+
...customStyles.progressLine,
|
|
133
138
|
} }), _jsx("div", { className: cn(s['relative'], s['sm:block']), style: { zIndex: 2 }, children: Steps })] }) }));
|
|
134
139
|
};
|
|
@@ -1,9 +1,35 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
export interface TabsClassNames {
|
|
3
|
+
/** Custom className for the root container */
|
|
4
|
+
container?: string;
|
|
5
|
+
/** Custom className for the tabs header container */
|
|
6
|
+
tabsHeader?: string;
|
|
7
|
+
/** Custom className for individual tab button */
|
|
8
|
+
tabButton?: string;
|
|
9
|
+
/** Custom className for active tab button */
|
|
10
|
+
activeTabButton?: string;
|
|
11
|
+
/** Custom className for the content container */
|
|
12
|
+
contentContainer?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TabsStyles {
|
|
15
|
+
/** Custom style for the root container */
|
|
16
|
+
container?: CSSProperties;
|
|
17
|
+
/** Custom style for the tabs header container */
|
|
18
|
+
tabsHeader?: CSSProperties;
|
|
19
|
+
/** Custom style for individual tab button */
|
|
20
|
+
tabButton?: CSSProperties;
|
|
21
|
+
/** Custom style for active tab button */
|
|
22
|
+
activeTabButton?: CSSProperties;
|
|
23
|
+
/** Custom style for the content container */
|
|
24
|
+
contentContainer?: CSSProperties;
|
|
25
|
+
}
|
|
2
26
|
interface TabProps {
|
|
3
27
|
title: string;
|
|
4
28
|
children: React.JSX.Element;
|
|
29
|
+
className?: string;
|
|
30
|
+
style?: CSSProperties;
|
|
5
31
|
}
|
|
6
|
-
export declare const Tab: ({ title, children }: TabProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare const Tab: ({ title, children, className, style }: TabProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
33
|
export interface TabsProps {
|
|
8
34
|
options: Array<{
|
|
9
35
|
title: string;
|
|
@@ -12,7 +38,11 @@ export interface TabsProps {
|
|
|
12
38
|
}>;
|
|
13
39
|
onSelect?: (item: any, index: number) => void;
|
|
14
40
|
children: React.ReactNode;
|
|
41
|
+
/** Custom classNames for component parts */
|
|
42
|
+
classNames?: TabsClassNames;
|
|
43
|
+
/** Custom inline styles for component parts */
|
|
44
|
+
styles?: TabsStyles;
|
|
15
45
|
}
|
|
16
|
-
export declare const Tabs: ({ options, onSelect, children }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare const Tabs: ({ options, onSelect, children, classNames, styles }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
47
|
export {};
|
|
18
48
|
//# sourceMappingURL=tabs.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Tabs/tabs.component.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tabs.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Tabs/tabs.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAW,aAAa,EAAC,MAAM,OAAO,CAAC;AAIrD,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,iDAAiD;IACjD,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,6CAA6C;IAC7C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,yCAAyC;IACzC,eAAe,CAAC,EAAE,aAAa,CAAC;IAChC,6CAA6C;IAC7C,gBAAgB,CAAC,EAAE,aAAa,CAAC;CAClC;AAED,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,eAAO,MAAM,GAAG,0CAAyC,QAAQ,4CAMhE,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;QAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4CAA4C;IAC5C,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,wDAAiE,SAAS,4CA6D1F,CAAC"}
|
|
@@ -2,18 +2,21 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import s from '../../tc.module.css';
|
|
4
4
|
import { cn } from '../../utils';
|
|
5
|
-
export const Tab = ({ title, children }) => {
|
|
6
|
-
return (_jsx("div", { className: cn(s.flex), children: children }, title));
|
|
5
|
+
export const Tab = ({ title, children, className, style }) => {
|
|
6
|
+
return (_jsx("div", { className: cn(s.flex, className), style: style, children: children }, title));
|
|
7
7
|
};
|
|
8
|
-
export const Tabs = ({ options, onSelect, children }) => {
|
|
8
|
+
export const Tabs = ({ options, onSelect, children, classNames = {}, styles = {} }) => {
|
|
9
9
|
const [activeTab, setActiveTab] = useState(0);
|
|
10
10
|
const [selected, setSelected] = useState(options[0].title);
|
|
11
11
|
const tabs = React.Children.toArray(children).filter((child) => React.isValidElement(child) && child.type === Tab);
|
|
12
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: cn(s.flex, s['flex-col'], s['w-full']), children: [_jsx("div", { className: cn(s.flex, s['border-b']), children: options?.map((tab, index) => (_jsx("button", { type: "button", className: cn(s['py-2'], s['px-4'], s['mr-1'], s['border-none'], s['rounded-t-md'], s['shadow-inner'], s['cursor-pointer'], activeTab === index && s['bg-blue-500'], activeTab === index && s['border-none'], activeTab === index && s['text-white']
|
|
12
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: cn(s.flex, s['flex-col'], s['w-full'], classNames.container), style: styles.container, children: [_jsx("div", { className: cn(s.flex, s['border-b'], classNames.tabsHeader), style: styles.tabsHeader, children: options?.map((tab, index) => (_jsx("button", { type: "button", className: cn(s['py-2'], s['px-4'], s['mr-1'], s['border-none'], s['rounded-t-md'], s['shadow-inner'], s['cursor-pointer'], activeTab === index && s['bg-blue-500'], activeTab === index && s['border-none'], activeTab === index && s['text-white'], classNames.tabButton, activeTab === index && classNames.activeTabButton), style: {
|
|
13
|
+
...styles.tabButton,
|
|
14
|
+
...(activeTab === index ? styles.activeTabButton : {}),
|
|
15
|
+
}, onClick: () => {
|
|
13
16
|
setSelected(tab?.title);
|
|
14
17
|
onSelect && onSelect(tab, index);
|
|
15
18
|
!tab.inActive && setActiveTab(index);
|
|
16
|
-
}, disabled: tab.inActive, children: tab.title }, index))) }), _jsx("div", { className: cn(s['p-2'], s.border, s['border-solid'], s['border-slate-600'], s['rounded-b-md']), children: options[activeTab]?.content
|
|
19
|
+
}, disabled: tab.inActive, children: tab.title }, index))) }), _jsx("div", { className: cn(s['p-2'], s.border, s['border-solid'], s['border-slate-600'], s['rounded-b-md'], classNames.contentContainer), style: styles.contentContainer, children: options[activeTab]?.content
|
|
17
20
|
? options[activeTab]?.content
|
|
18
21
|
: tabs[options?.findIndex((item) => item.title === selected)] })] }) }));
|
|
19
22
|
};
|
|
@@ -1,3 +1,44 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface TagsClassNames {
|
|
3
|
+
/** Custom className for the root container */
|
|
4
|
+
container?: string;
|
|
5
|
+
/** Custom className for the label */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Custom className for the tags container (input wrapper) */
|
|
8
|
+
tagsContainer?: string;
|
|
9
|
+
/** Custom className for individual tag */
|
|
10
|
+
tag?: string;
|
|
11
|
+
/** Custom className for the tag text */
|
|
12
|
+
tagText?: string;
|
|
13
|
+
/** Custom className for the remove button */
|
|
14
|
+
removeButton?: string;
|
|
15
|
+
/** Custom className for the input field */
|
|
16
|
+
input?: string;
|
|
17
|
+
/** Custom className for the helper/error text container */
|
|
18
|
+
helperText?: string;
|
|
19
|
+
/** Custom className for error message */
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TagsStyles {
|
|
23
|
+
/** Custom style for the root container */
|
|
24
|
+
container?: CSSProperties;
|
|
25
|
+
/** Custom style for the label */
|
|
26
|
+
label?: CSSProperties;
|
|
27
|
+
/** Custom style for the tags container (input wrapper) */
|
|
28
|
+
tagsContainer?: CSSProperties;
|
|
29
|
+
/** Custom style for individual tag */
|
|
30
|
+
tag?: CSSProperties;
|
|
31
|
+
/** Custom style for the tag text */
|
|
32
|
+
tagText?: CSSProperties;
|
|
33
|
+
/** Custom style for the remove button */
|
|
34
|
+
removeButton?: CSSProperties;
|
|
35
|
+
/** Custom style for the input field */
|
|
36
|
+
input?: CSSProperties;
|
|
37
|
+
/** Custom style for the helper/error text container */
|
|
38
|
+
helperText?: CSSProperties;
|
|
39
|
+
/** Custom style for error message */
|
|
40
|
+
errorMessage?: CSSProperties;
|
|
41
|
+
}
|
|
1
42
|
export interface TagsProps {
|
|
2
43
|
/** Array of initial tags */
|
|
3
44
|
defaultTags?: string[];
|
|
@@ -21,6 +62,10 @@ export interface TagsProps {
|
|
|
21
62
|
tagVariant?: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
22
63
|
/** Size of tags */
|
|
23
64
|
size?: 'sm' | 'md' | 'lg';
|
|
65
|
+
/** Custom classNames for component parts */
|
|
66
|
+
classNames?: TagsClassNames;
|
|
67
|
+
/** Custom inline styles for component parts */
|
|
68
|
+
styles?: TagsStyles;
|
|
24
69
|
/** Callback when tags change */
|
|
25
70
|
onChange?: (tags: string[]) => void;
|
|
26
71
|
/** Callback when input loses focus */
|
|
@@ -30,5 +75,5 @@ export interface TagsProps {
|
|
|
30
75
|
/** Callback when a tag is removed */
|
|
31
76
|
onTagRemove?: (tag: string, index: number) => void;
|
|
32
77
|
}
|
|
33
|
-
export declare const Tags: ({ defaultTags, placeholder, maxTags, disabled, className, label, hasError, errorMessage, removable, tagVariant, size, onChange, onBlur, onTagAdd, onTagRemove, }: TagsProps) => import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
export declare const Tags: ({ defaultTags, placeholder, maxTags, disabled, className, label, hasError, errorMessage, removable, tagVariant, size, classNames, styles, onChange, onBlur, onTagAdd, onTagRemove, }: TagsProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
79
|
//# sourceMappingURL=Tags.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tags.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Tags1/Tags.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tags.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Tags1/Tags.component.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAkC,aAAa,EAAC,MAAM,OAAO,CAAC;AAI5E,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,iCAAiC;IACjC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,sCAAsC;IACtC,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB,oCAAoC;IACpC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,yCAAyC;IACzC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,uCAAuC;IACvC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,uDAAuD;IACvD,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,qCAAqC;IACrC,YAAY,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+BAA+B;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wBAAwB;IACxB,UAAU,CAAC,EACP,SAAS,GACT,SAAS,GACT,WAAW,GACX,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;IACb,mBAAmB;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,4CAA4C;IAC5C,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACpC,sCAAsC;IACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAClC,mCAAmC;IACnC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,qCAAqC;IACrC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,IAAI,yLAkBd,SAAS,4CAgSX,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useRef } from 'react';
|
|
3
3
|
import s from '../../tc.module.css';
|
|
4
4
|
import { cn } from '../../utils';
|
|
5
|
-
export const Tags = ({ defaultTags = [], placeholder = 'Type and press Enter to add tags...', maxTags, disabled = false, className = '', label, hasError = false, errorMessage, removable = true, tagVariant = 'default', size = 'md', onChange, onBlur, onTagAdd, onTagRemove, }) => {
|
|
5
|
+
export const Tags = ({ defaultTags = [], placeholder = 'Type and press Enter to add tags...', maxTags, disabled = false, className = '', label, hasError = false, errorMessage, removable = true, tagVariant = 'default', size = 'md', classNames = {}, styles = {}, onChange, onBlur, onTagAdd, onTagRemove, }) => {
|
|
6
6
|
const [tags, setTags] = useState(defaultTags);
|
|
7
7
|
const [inputValue, setInputValue] = useState('');
|
|
8
8
|
const [isFocused, setIsFocused] = useState(false);
|
|
@@ -100,7 +100,7 @@ export const Tags = ({ defaultTags = [], placeholder = 'Type and press Enter to
|
|
|
100
100
|
inputRef.current?.focus();
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
return (_jsxs("div", { className: cn(s.flex, s['flex-col'], s['w-full'], className), children: [label && (_jsxs("label", { className: cn(s['text-sm'], s['font-medium'], s['mb-2'], hasError ? s['text-red-600'] : s['text-gray-700']), children: [label, maxTags && (_jsxs("span", { className: cn(s['text-xs'], s['text-gray-500'], s['ml-2']), children: ["(", tags.length, "/", maxTags, ")"] }))] })), _jsxs("div", { onClick: handleContainerClick, className: cn(s['min-h-10'], s['w-full'], s['border'], s['rounded-md'], s['bg-white'], s['flex'], s['flex-wrap'], s['gap-2'], s['p-2'], s['cursor-text'], s['transition-colors'],
|
|
103
|
+
return (_jsxs("div", { className: cn(s.flex, s['flex-col'], s['w-full'], className, classNames.container), style: styles.container, children: [label && (_jsxs("label", { className: cn(s['text-sm'], s['font-medium'], s['mb-2'], hasError ? s['text-red-600'] : s['text-gray-700'], classNames.label), style: styles.label, children: [label, maxTags && (_jsxs("span", { className: cn(s['text-xs'], s['text-gray-500'], s['ml-2']), children: ["(", tags.length, "/", maxTags, ")"] }))] })), _jsxs("div", { onClick: handleContainerClick, className: cn(s['min-h-10'], s['w-full'], s['border'], s['rounded-md'], s['bg-white'], s['flex'], s['flex-wrap'], s['gap-2'], s['p-2'], s['cursor-text'], s['transition-colors'],
|
|
104
104
|
// Focus styles
|
|
105
105
|
isFocused &&
|
|
106
106
|
!hasError &&
|
|
@@ -110,9 +110,9 @@ export const Tags = ({ defaultTags = [], placeholder = 'Type and press Enter to
|
|
|
110
110
|
// Disabled styles
|
|
111
111
|
disabled && s['bg-gray-50'] + ' ' + s['cursor-not-allowed'],
|
|
112
112
|
// Hover styles
|
|
113
|
-
!disabled && s['hover:border-gray-400']), children: [tags.map((tag, index) => (_jsxs("span", { className: cn(s['flex'], s['inline-flex'], s['items-center'], s['border'], s['rounded-full'], s['font-medium'], s['transition-colors'], s['items-center'], sizeStyles[size].tag, tagVariants[tagVariant], disabled && s['opacity-60']), children: [_jsx("span", { className: cn(s['truncate'], s['max-w-32']), children: tag }), removable && !disabled && (_jsx("button", { type: "button", onClick: (e) => {
|
|
113
|
+
!disabled && s['hover:border-gray-400'], classNames.tagsContainer), style: styles.tagsContainer, children: [tags.map((tag, index) => (_jsxs("span", { className: cn(s['flex'], s['inline-flex'], s['items-center'], s['border'], s['rounded-full'], s['font-medium'], s['transition-colors'], s['items-center'], sizeStyles[size].tag, tagVariants[tagVariant], disabled && s['opacity-60'], classNames.tag), style: styles.tag, children: [_jsx("span", { className: cn(s['truncate'], s['max-w-32'], classNames.tagText), style: styles.tagText, children: tag }), removable && !disabled && (_jsx("button", { type: "button", onClick: (e) => {
|
|
114
114
|
e.stopPropagation();
|
|
115
115
|
removeTag(index);
|
|
116
|
-
}, className: cn(s['ml-2'], s['flex-shrink-0'], s['rounded-full'], s['hover:bg-black'], s['hover:bg-opacity-10'], s['transition-colors'], s['focus:outline-none'], s['focus:ring-2'], s['focus:ring-offset-1'], s['focus:ring-gray-500']), "aria-label": `Remove ${tag} tag`, children: _jsx("svg", { className: cn(sizeStyles[size].removeBtn), fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) }))] }, `${tag}-${index}`))), (!maxTags || tags.length < maxTags) && (_jsx("input", { ref: inputRef, type: "text", value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, onFocus: () => setIsFocused(true), onBlur: handleInputBlur, placeholder: tags.length === 0 ? placeholder : '', disabled: disabled, className: cn(s['flex-1'], s['min-w-32'], s['border-0'], s['outline-none'], s['bg-transparent'], sizeStyles[size].input.replace(s['p-3'], s['p-1']), // Adjust padding for input inside container
|
|
117
|
-
disabled && s['cursor-not-allowed']), "aria-label": "Add new tag" }))] }), (errorMessage || maxTags) && (_jsxs("div", { className: cn(s['mt-1'], s['flex'], s['justify-between'], s['text-xs']), children: [errorMessage && hasError && (_jsx("span", { className: cn(s['text-red-600']), children: errorMessage })), maxTags && !hasError && (_jsxs("span", { className: cn(s['text-gray-500'], s['ml-auto']), children: [tags.length, "/", maxTags, " tags"] }))] })), !hasError && !errorMessage && (_jsx("p", { className: cn(s['mt-1'], s['text-xs'], s['text-gray-500']), children: "Press Enter to add tags, Backspace to remove last tag" }))] }));
|
|
116
|
+
}, className: cn(s['ml-2'], s['flex-shrink-0'], s['rounded-full'], s['hover:bg-black'], s['hover:bg-opacity-10'], s['transition-colors'], s['focus:outline-none'], s['focus:ring-2'], s['focus:ring-offset-1'], s['focus:ring-gray-500'], classNames.removeButton), style: styles.removeButton, "aria-label": `Remove ${tag} tag`, children: _jsx("svg", { className: cn(sizeStyles[size].removeBtn), fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) }))] }, `${tag}-${index}`))), (!maxTags || tags.length < maxTags) && (_jsx("input", { ref: inputRef, type: "text", value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, onFocus: () => setIsFocused(true), onBlur: handleInputBlur, placeholder: tags.length === 0 ? placeholder : '', disabled: disabled, className: cn(s['flex-1'], s['min-w-32'], s['border-0'], s['outline-none'], s['bg-transparent'], sizeStyles[size].input.replace(s['p-3'], s['p-1']), // Adjust padding for input inside container
|
|
117
|
+
disabled && s['cursor-not-allowed'], classNames.input), style: styles.input, "aria-label": "Add new tag" }))] }), (errorMessage || maxTags) && (_jsxs("div", { className: cn(s['mt-1'], s['flex'], s['justify-between'], s['text-xs'], classNames.helperText), style: styles.helperText, children: [errorMessage && hasError && (_jsx("span", { className: cn(s['text-red-600'], classNames.errorMessage), style: styles.errorMessage, children: errorMessage })), maxTags && !hasError && (_jsxs("span", { className: cn(s['text-gray-500'], s['ml-auto']), children: [tags.length, "/", maxTags, " tags"] }))] })), !hasError && !errorMessage && (_jsx("p", { className: cn(s['mt-1'], s['text-xs'], s['text-gray-500'], classNames.helperText), style: styles.helperText, children: "Press Enter to add tags, Backspace to remove last tag" }))] }));
|
|
118
118
|
};
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
4
4
|
import { TooltipProps } from './types';
|
|
5
|
+
export interface TooltipClassNames {
|
|
6
|
+
/** Custom className for the trigger wrapper */
|
|
7
|
+
trigger?: string;
|
|
8
|
+
/** Custom className for the content container */
|
|
9
|
+
content?: string;
|
|
10
|
+
/** Custom className for the arrow */
|
|
11
|
+
arrow?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TooltipStyles {
|
|
14
|
+
/** Custom style for the trigger wrapper */
|
|
15
|
+
trigger?: CSSProperties;
|
|
16
|
+
/** Custom style for the content container */
|
|
17
|
+
content?: CSSProperties;
|
|
18
|
+
/** Custom style for the arrow */
|
|
19
|
+
arrow?: CSSProperties;
|
|
20
|
+
}
|
|
5
21
|
/**
|
|
6
22
|
* The `Tooltip` must be nested somewhere inside the `TooltipProvider` in the component tree.
|
|
7
23
|
*/
|
|
8
|
-
export declare const Tooltip: ({ align, side, children, content, avoidCollisions, alignOffset, sideOffset, disabled, delay, className, }: PropsWithChildren<TooltipProps
|
|
24
|
+
export declare const Tooltip: ({ align, side, children, content, avoidCollisions, alignOffset, sideOffset, disabled, delay, className, classNames, styles, }: React.PropsWithChildren<TooltipProps & {
|
|
25
|
+
classNames?: TooltipClassNames | undefined;
|
|
26
|
+
styles?: TooltipStyles | undefined;
|
|
27
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
9
28
|
export declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
10
29
|
//# sourceMappingURL=tooltip.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Tooltip/tooltip.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tooltip.component.d.ts","sourceRoot":"","sources":["../../../../../../src/core-components/src/components/Tooltip/tooltip.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAC,iBAAiB,EAAC,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAErC,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iCAAiC;IACjC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,OAAO;;;8CA8CnB,CAAC;AACF,eAAO,MAAM,eAAe,iDAA4B,CAAC"}
|
|
@@ -3,8 +3,8 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
|
3
3
|
/**
|
|
4
4
|
* The `Tooltip` must be nested somewhere inside the `TooltipProvider` in the component tree.
|
|
5
5
|
*/
|
|
6
|
-
export const Tooltip = ({ align = 'center', side = 'bottom', children, content, avoidCollisions = true, alignOffset = 0, sideOffset = 5, disabled = false, delay = 400, className, }) => {
|
|
6
|
+
export const Tooltip = ({ align = 'center', side = 'bottom', children, content, avoidCollisions = true, alignOffset = 0, sideOffset = 5, disabled = false, delay = 400, className, classNames = {}, styles = {}, }) => {
|
|
7
7
|
const isChildrenString = typeof children === 'string';
|
|
8
|
-
return (_jsxs(TooltipPrimitive.Root, { delayDuration: delay, children: [_jsx(TooltipPrimitive.Trigger, { asChild: !isChildrenString, disabled: disabled, className: className, children: children }), _jsx(TooltipPrimitive.Portal, { children: !disabled && content && (_jsxs(TooltipPrimitive.Content, { className: className, avoidCollisions: avoidCollisions, side: side, align: align, alignOffset: alignOffset, sideOffset: sideOffset, children: [content, _jsx(TooltipPrimitive.Arrow, { className:
|
|
8
|
+
return (_jsxs(TooltipPrimitive.Root, { delayDuration: delay, children: [_jsx(TooltipPrimitive.Trigger, { asChild: !isChildrenString, disabled: disabled, className: className || classNames.trigger, style: styles.trigger, children: children }), _jsx(TooltipPrimitive.Portal, { children: !disabled && content && (_jsxs(TooltipPrimitive.Content, { className: className || classNames.content, style: styles.content, avoidCollisions: avoidCollisions, side: side, align: align, alignOffset: alignOffset, sideOffset: sideOffset, children: [content, _jsx(TooltipPrimitive.Arrow, { className: classNames.arrow, style: styles.arrow })] })) })] }));
|
|
9
9
|
};
|
|
10
10
|
export const TooltipProvider = TooltipPrimitive.Provider;
|