@koobiq/react-components 0.27.1 → 0.28.0
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/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/ContenPanel/hooks/useContentPanelContainer/useContentPanelContainer.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.js +21 -16
- package/dist/components/DatePicker/types.d.ts +2 -0
- package/dist/components/Divider/Divider.d.ts +1 -1
- package/dist/components/Input/Input.js +1 -0
- package/dist/components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/components/Table/Table.js +3 -1
- package/dist/components/Table/components/TableColumnHeader/TableColumnHeader.js +21 -5
- package/dist/components/Table/components/TableSelectAllCell/TableSelectAllCell.d.ts +2 -1
- package/dist/components/Table/components/TableSelectAllCell/TableSelectAllCell.js +10 -2
- package/dist/components/Table/types.d.ts +5 -0
- package/dist/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/Tree/Tree.d.ts +17 -0
- package/dist/components/Tree/Tree.js +34 -0
- package/dist/components/Tree/components/TreeItem/TreeItem.d.ts +2 -0
- package/dist/components/Tree/components/TreeItem/TreeItem.js +29 -0
- package/dist/components/Tree/components/TreeItem/index.d.ts +2 -0
- package/dist/components/Tree/components/TreeItem/types.d.ts +3 -0
- package/dist/components/Tree/components/TreeItemContent/TreeItemContent.d.ts +2 -0
- package/dist/components/Tree/components/TreeItemContent/TreeItemContent.js +33 -0
- package/dist/components/Tree/components/TreeItemContent/index.d.ts +2 -0
- package/dist/components/Tree/components/TreeItemContent/types.d.ts +11 -0
- package/dist/components/Tree/components/TreeLoadMoreItem/TreeLoadMoreItem.d.ts +2 -0
- package/dist/components/Tree/components/TreeLoadMoreItem/TreeLoadMoreItem.js +35 -0
- package/dist/components/Tree/components/TreeLoadMoreItem/index.d.ts +1 -0
- package/dist/components/Tree/components/index.d.ts +3 -0
- package/dist/components/Tree/index.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +9 -0
- package/dist/style.css +76 -0
- package/package.json +5 -5
|
@@ -17,4 +17,4 @@ export declare const CheckboxGroup: import("react").ForwardRefExoticComponent<{
|
|
|
17
17
|
label?: FormFieldLabelProps<"span">;
|
|
18
18
|
checkboxGroup?: import("react").ComponentPropsWithRef<"div">;
|
|
19
19
|
};
|
|
20
|
-
} & Omit<import("
|
|
20
|
+
} & Omit<import("react-aria").AriaCheckboxGroupProps, "description" | "validationState"> & import("react").RefAttributes<HTMLDivElement>>;
|
package/dist/components/ContenPanel/hooks/useContentPanelContainer/useContentPanelContainer.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes } from 'react';
|
|
|
2
2
|
import type { ButtonBaseProps } from '@koobiq/react-primitives';
|
|
3
3
|
import type { OverlayTriggerState } from '@react-stately/overlays';
|
|
4
4
|
export type UseContentPanelReturnValue = {
|
|
5
|
-
triggerProps: ButtonBaseProps
|
|
5
|
+
triggerProps: Omit<ButtonBaseProps, 'isLoading' | 'children' | 'className' | 'style'>;
|
|
6
6
|
closeButtonProps: ButtonBaseProps;
|
|
7
7
|
containerProps?: HTMLAttributes<HTMLElement>;
|
|
8
8
|
panelProps?: HTMLAttributes<HTMLElement>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs, Fragment
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useRef } from "react";
|
|
4
4
|
import { mergeProps } from "@koobiq/react-core";
|
|
5
5
|
import { IconCalendarO16 } from "@koobiq/react-icons";
|
|
@@ -57,23 +57,28 @@ function DatePickerRender(props, ref) {
|
|
|
57
57
|
anchorRef
|
|
58
58
|
);
|
|
59
59
|
const { slotProps: rootSlotProps, ...otherRoot } = slotProps?.root || {};
|
|
60
|
+
const triggerButtonProps = mergeProps(
|
|
61
|
+
{
|
|
62
|
+
variant: isInvalid ? "error" : "fade-contrast",
|
|
63
|
+
className: s.calendar,
|
|
64
|
+
children: /* @__PURE__ */ jsx(IconCalendarO16, {})
|
|
65
|
+
},
|
|
66
|
+
buttonProps,
|
|
67
|
+
slotProps?.triggerButton
|
|
68
|
+
);
|
|
60
69
|
const mergedRootSlotProps = {
|
|
61
70
|
...rootSlotProps,
|
|
62
|
-
group: mergeProps(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
] })
|
|
76
|
-
})
|
|
71
|
+
group: mergeProps(
|
|
72
|
+
groupProps,
|
|
73
|
+
{
|
|
74
|
+
ref: anchorRef,
|
|
75
|
+
endAddon: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
76
|
+
endAddon,
|
|
77
|
+
/* @__PURE__ */ jsx(IconButton, { ...triggerButtonProps })
|
|
78
|
+
] })
|
|
79
|
+
},
|
|
80
|
+
rootSlotProps?.group
|
|
81
|
+
)
|
|
77
82
|
};
|
|
78
83
|
const rootProps = mergeProps(
|
|
79
84
|
{
|
|
@@ -3,6 +3,7 @@ import type { AriaDatePickerProps, DateValue } from '@koobiq/react-primitives';
|
|
|
3
3
|
import type { CalendarProps } from '../Calendar';
|
|
4
4
|
import type { DateInputPropLabelAlign, DateInputPropLabelPlacement, DateInputProps, DateInputRef } from '../DateInput';
|
|
5
5
|
import type { FormFieldLabelProps } from '../FormField';
|
|
6
|
+
import type { IconButtonProps } from '../IconButton';
|
|
6
7
|
import type { PopoverProps } from '../Popover';
|
|
7
8
|
export type DatePickerProps<T extends DateValue> = {
|
|
8
9
|
/**
|
|
@@ -40,6 +41,7 @@ export type DatePickerProps<T extends DateValue> = {
|
|
|
40
41
|
label?: FormFieldLabelProps;
|
|
41
42
|
popover?: PopoverProps;
|
|
42
43
|
calendar?: CalendarProps<T>;
|
|
44
|
+
triggerButton?: IconButtonProps;
|
|
43
45
|
};
|
|
44
46
|
} & Omit<AriaDatePickerProps<T>, 'description' | 'validationState'>;
|
|
45
47
|
export type DatePickerComponent = <T extends DateValue>(props: DatePickerProps<T>) => ReactElement | null;
|
|
@@ -11,4 +11,4 @@ export declare const Divider: (props: {
|
|
|
11
11
|
flexItem?: boolean;
|
|
12
12
|
disablePaddings?: boolean;
|
|
13
13
|
as?: ElementType;
|
|
14
|
-
} & Omit<import("
|
|
14
|
+
} & Omit<import("react-aria").SeparatorProps, "elementType"> & import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>) => import("react").ReactElement | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormFieldProps, FormFieldLabelProps, FormFieldInputProps, FormFieldErrorProps, FormFieldCaptionProps, FormFieldControlGroupProps } from '../FormField';
|
|
2
|
-
export declare const SearchInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("
|
|
2
|
+
export declare const SearchInput: import("react").ForwardRefExoticComponent<Omit<Omit<import("react-aria").AriaSearchFieldProps, "description" | "validationState">, "caption" | "style" | "className" | `data-${string}` | "startAddon" | "endAddon" | "variant" | "slotProps" | "labelPlacement" | "labelAlign" | "fullWidth" | "isLabelHidden"> & {
|
|
3
3
|
className?: string;
|
|
4
4
|
style?: import("react").CSSProperties;
|
|
5
5
|
isLabelHidden?: boolean;
|
|
@@ -24,6 +24,7 @@ function TableBase(props) {
|
|
|
24
24
|
const {
|
|
25
25
|
divider = "none",
|
|
26
26
|
stickyHeader,
|
|
27
|
+
hideSelectAll = false,
|
|
27
28
|
fullWidth,
|
|
28
29
|
slotProps,
|
|
29
30
|
isResizable,
|
|
@@ -67,7 +68,8 @@ function TableBase(props) {
|
|
|
67
68
|
{
|
|
68
69
|
state,
|
|
69
70
|
column,
|
|
70
|
-
layoutState
|
|
71
|
+
layoutState,
|
|
72
|
+
hideSelectAll
|
|
71
73
|
},
|
|
72
74
|
column.key
|
|
73
75
|
) : /* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useRef } from "react";
|
|
4
|
-
import { useFocusRing, clsx, mergeProps } from "@koobiq/react-core";
|
|
4
|
+
import { useFocusRing, useHover, clsx, mergeProps } from "@koobiq/react-core";
|
|
5
5
|
import { IconChevronUpS16, IconChevronDownS16 } from "@koobiq/react-icons";
|
|
6
6
|
import { useTableColumnHeader } from "@koobiq/react-primitives";
|
|
7
7
|
import { utilClasses } from "../../../../styles/utility.js";
|
|
@@ -32,11 +32,27 @@ function TableColumnHeader({
|
|
|
32
32
|
allowsResizing
|
|
33
33
|
} = column.props;
|
|
34
34
|
const { isFocusVisible, focusProps } = useFocusRing();
|
|
35
|
+
const { isHovered, hoverProps } = useHover({ isDisabled: !allowsSorting });
|
|
35
36
|
const isActive = state.sortDescriptor?.column === column.key;
|
|
36
37
|
const direction = isActive ? state.sortDescriptor?.direction : void 0;
|
|
37
|
-
const defaultIcon =
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const defaultIcon = () => {
|
|
39
|
+
if (direction === "ascending") {
|
|
40
|
+
return /* @__PURE__ */ jsx(IconChevronUpS16, {});
|
|
41
|
+
}
|
|
42
|
+
if (direction === "descending") {
|
|
43
|
+
return /* @__PURE__ */ jsx(IconChevronDownS16, {});
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
};
|
|
47
|
+
const iconToRender = renderSortIcon?.({ direction, isActive }) ?? defaultIcon();
|
|
48
|
+
const columnSortIcon = allowsSorting && /* @__PURE__ */ jsx(
|
|
49
|
+
"span",
|
|
50
|
+
{
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
className: clsx(s.sortIcon, (isActive || isHovered) && s.active),
|
|
53
|
+
children: iconToRender
|
|
54
|
+
}
|
|
55
|
+
);
|
|
40
56
|
const isResizable = !!(allowsResizing && layoutState);
|
|
41
57
|
return /* @__PURE__ */ jsx(
|
|
42
58
|
"th",
|
|
@@ -54,7 +70,7 @@ function TableColumnHeader({
|
|
|
54
70
|
"data-valign": valign || void 0,
|
|
55
71
|
"data-allows-sorting": allowsSorting || void 0,
|
|
56
72
|
"data-allows-resizing": isResizable || void 0,
|
|
57
|
-
...mergeProps(columnHeaderProps, focusProps),
|
|
73
|
+
...mergeProps(columnHeaderProps, hoverProps, focusProps),
|
|
58
74
|
style: {
|
|
59
75
|
...styleProp,
|
|
60
76
|
inlineSize: layoutState?.getColumnWidth(column.key)
|
|
@@ -3,6 +3,7 @@ type TableSelectAllCellProps<T> = {
|
|
|
3
3
|
column: AriaTableColumnHeaderProps<T>['node'];
|
|
4
4
|
state: TableState<T>;
|
|
5
5
|
layoutState?: TableColumnResizeState<T>;
|
|
6
|
+
hideSelectAll?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare function TableSelectAllCell<T>({ column, state, layoutState, }: TableSelectAllCellProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function TableSelectAllCell<T>({ column, state, layoutState, hideSelectAll, }: TableSelectAllCellProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -7,7 +7,8 @@ import { Checkbox } from "../../../Checkbox/Checkbox.js";
|
|
|
7
7
|
function TableSelectAllCell({
|
|
8
8
|
column,
|
|
9
9
|
state,
|
|
10
|
-
layoutState
|
|
10
|
+
layoutState,
|
|
11
|
+
hideSelectAll = false
|
|
11
12
|
}) {
|
|
12
13
|
const ref = useRef(null);
|
|
13
14
|
const { columnHeaderProps } = useTableColumnHeader(
|
|
@@ -16,6 +17,13 @@ function TableSelectAllCell({
|
|
|
16
17
|
ref
|
|
17
18
|
);
|
|
18
19
|
const { checkboxProps } = useTableSelectAllCheckbox(state);
|
|
20
|
+
const isSingleSelection = state.selectionManager.selectionMode === "single";
|
|
21
|
+
let content = null;
|
|
22
|
+
if (isSingleSelection) {
|
|
23
|
+
content = /* @__PURE__ */ jsx(VisuallyHidden, { children: checkboxProps["aria-label"] });
|
|
24
|
+
} else if (!hideSelectAll) {
|
|
25
|
+
content = /* @__PURE__ */ jsx(Checkbox, { ...checkboxProps });
|
|
26
|
+
}
|
|
19
27
|
return /* @__PURE__ */ jsx(
|
|
20
28
|
"th",
|
|
21
29
|
{
|
|
@@ -25,7 +33,7 @@ function TableSelectAllCell({
|
|
|
25
33
|
inlineSize: layoutState?.getColumnWidth(column.key)
|
|
26
34
|
},
|
|
27
35
|
ref,
|
|
28
|
-
children:
|
|
36
|
+
children: content
|
|
29
37
|
}
|
|
30
38
|
);
|
|
31
39
|
}
|
|
@@ -26,6 +26,11 @@ export type TableProps<T> = Pick<TableStateProps<T>, 'selectionBehavior' | 'sele
|
|
|
26
26
|
fullWidth?: boolean;
|
|
27
27
|
/** Flag indicating a fixed table header. */
|
|
28
28
|
stickyHeader?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Hides the select-all checkbox in the table header during multiple selection.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
hideSelectAll?: boolean;
|
|
29
34
|
/** Render function for a custom sort icon for the column */
|
|
30
35
|
renderSortIcon?: TablePropSortIconRender;
|
|
31
36
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<import("
|
|
1
|
+
export declare const Tooltip: import("react").ForwardRefExoticComponent<Omit<import("react-aria").TooltipTriggerProps, "children" | "style" | "className" | "id" | "placement" | `data-${string}` | "variant" | "offset" | "control" | "portalContainer" | "anchorRef" | "hideArrow" | "arrowBoundaryOffset" | "crossOffset" | "delay" | "closeDelay" | keyof {
|
|
2
2
|
open?: boolean;
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
}> & {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TreeProps } from '@koobiq/react-primitives';
|
|
2
|
+
import './Tree.css';
|
|
3
|
+
import { TreeItem, TreeItemContent, TreeLoadMoreItem } from './components';
|
|
4
|
+
export type { TreeProps };
|
|
5
|
+
export declare function TreeComponent<T extends object>({ className, ...props }: TreeProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare namespace TreeComponent {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
var Item: typeof TreeItem;
|
|
9
|
+
var ItemContent: typeof TreeItemContent;
|
|
10
|
+
var LoadMoreItem: typeof TreeLoadMoreItem;
|
|
11
|
+
}
|
|
12
|
+
type CompoundedComponent = typeof TreeComponent & {
|
|
13
|
+
Item: typeof TreeItem;
|
|
14
|
+
ItemContent: typeof TreeItemContent;
|
|
15
|
+
LoadMoreItem: typeof TreeLoadMoreItem;
|
|
16
|
+
};
|
|
17
|
+
export declare const Tree: CompoundedComponent;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import { Tree as Tree$1, composeRenderProps } from "@koobiq/react-primitives";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { utilClasses } from "../../styles/utility.js";
|
|
7
|
+
import { TreeItem } from "./components/TreeItem/TreeItem.js";
|
|
8
|
+
import { TreeItemContent } from "./components/TreeItemContent/TreeItemContent.js";
|
|
9
|
+
import { TreeLoadMoreItem } from "./components/TreeLoadMoreItem/TreeLoadMoreItem.js";
|
|
10
|
+
const { list } = utilClasses;
|
|
11
|
+
function TreeComponent({
|
|
12
|
+
className,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
Tree$1,
|
|
17
|
+
{
|
|
18
|
+
...props,
|
|
19
|
+
className: composeRenderProps(
|
|
20
|
+
className,
|
|
21
|
+
(className2) => clsx("kbq-Tree", list, className2)
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
TreeComponent.displayName = "Tree";
|
|
27
|
+
const Tree = TreeComponent;
|
|
28
|
+
TreeComponent.Item = TreeItem;
|
|
29
|
+
TreeComponent.ItemContent = TreeItemContent;
|
|
30
|
+
TreeComponent.LoadMoreItem = TreeLoadMoreItem;
|
|
31
|
+
export {
|
|
32
|
+
Tree,
|
|
33
|
+
TreeComponent
|
|
34
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import { TreeItem as TreeItem$1, composeRenderProps } from "@koobiq/react-primitives";
|
|
5
|
+
import { utilClasses } from "../../../../styles/utility.js";
|
|
6
|
+
const textVariant = utilClasses.typography;
|
|
7
|
+
const { listItem } = utilClasses;
|
|
8
|
+
function TreeItem({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
textValue,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
TreeItem$1,
|
|
16
|
+
{
|
|
17
|
+
...props,
|
|
18
|
+
textValue: textValue ?? "",
|
|
19
|
+
className: composeRenderProps(
|
|
20
|
+
className,
|
|
21
|
+
(className2) => clsx("kbq-TreeItem", listItem, textVariant["text-normal"], className2)
|
|
22
|
+
),
|
|
23
|
+
children
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
TreeItem
|
|
29
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { mergeProps } from "@koobiq/react-core";
|
|
4
|
+
import { IconChevronRightS16 } from "@koobiq/react-icons";
|
|
5
|
+
import { TreeItemContent as TreeItemContent$1 } from "@koobiq/react-primitives";
|
|
6
|
+
import { IconButton } from "../../../IconButton/IconButton.js";
|
|
7
|
+
import { AnimatedIcon } from "../../../AnimatedIcon/AnimatedIcon.js";
|
|
8
|
+
import { Checkbox } from "../../../Checkbox/Checkbox.js";
|
|
9
|
+
function TreeItemContent(props) {
|
|
10
|
+
const { children, slotProps, ...other } = props;
|
|
11
|
+
return /* @__PURE__ */ jsx(TreeItemContent$1, { ...other, children: (renderProps) => {
|
|
12
|
+
const { selectionBehavior, selectionMode, isDisabled, isExpanded } = renderProps;
|
|
13
|
+
const chevronProps = mergeProps(
|
|
14
|
+
{ variant: "fade-contrast", size: "l", isCompact: true, isDisabled },
|
|
15
|
+
slotProps?.chevron
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(IconButton, { slot: "chevron", "data-slot": "chevron", ...chevronProps, children: /* @__PURE__ */ jsx(
|
|
19
|
+
AnimatedIcon,
|
|
20
|
+
{
|
|
21
|
+
icons: [/* @__PURE__ */ jsx(IconChevronRightS16, {}, "chevron")],
|
|
22
|
+
directions: [0, 90],
|
|
23
|
+
activeIndex: +isExpanded
|
|
24
|
+
}
|
|
25
|
+
) }),
|
|
26
|
+
selectionBehavior === "toggle" && selectionMode === "multiple" && /* @__PURE__ */ jsx(Checkbox, { slot: "selection", ...slotProps?.checkbox }),
|
|
27
|
+
typeof children === "function" ? children(renderProps) : children
|
|
28
|
+
] });
|
|
29
|
+
} });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
TreeItemContent
|
|
33
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DataAttributeProps } from '@koobiq/react-core';
|
|
2
|
+
import type { TreeItemContentProps as AriaTreeItemContentProps } from '@koobiq/react-primitives';
|
|
3
|
+
import type { CheckboxProps } from '../../../Checkbox';
|
|
4
|
+
import type { IconButtonProps } from '../../../IconButton';
|
|
5
|
+
export type TreeItemContentPropSlotProps = {
|
|
6
|
+
chevron?: Omit<IconButtonProps, 'slot' | 'children'> & DataAttributeProps;
|
|
7
|
+
checkbox?: Omit<CheckboxProps, 'slot'>;
|
|
8
|
+
};
|
|
9
|
+
export type TreeItemContentProps = AriaTreeItemContentProps & {
|
|
10
|
+
slotProps?: TreeItemContentPropSlotProps;
|
|
11
|
+
} & DataAttributeProps;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { clsx } from "@koobiq/react-core";
|
|
4
|
+
import { TreeLoadMoreItem as TreeLoadMoreItem$1, composeRenderProps } from "@koobiq/react-primitives";
|
|
5
|
+
import { utilClasses } from "../../../../styles/utility.js";
|
|
6
|
+
import { ProgressSpinner } from "../../../ProgressSpinner/ProgressSpinner.js";
|
|
7
|
+
import { Typography } from "../../../Typography/Typography.js";
|
|
8
|
+
const { listItem } = utilClasses;
|
|
9
|
+
function TreeLoadMoreItem(props) {
|
|
10
|
+
const { className, style, ...other } = props;
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
TreeLoadMoreItem$1,
|
|
13
|
+
{
|
|
14
|
+
...other,
|
|
15
|
+
className: composeRenderProps(
|
|
16
|
+
className,
|
|
17
|
+
(className2) => clsx("kbq-TreeLoadMoreItem", listItem, className2)
|
|
18
|
+
),
|
|
19
|
+
style: composeRenderProps(
|
|
20
|
+
style,
|
|
21
|
+
(style2, { level }) => ({
|
|
22
|
+
"--tree-item-level": level,
|
|
23
|
+
...style2
|
|
24
|
+
})
|
|
25
|
+
),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ jsx(ProgressSpinner, { isIndeterminate: true, "aria-label": "Loading more..." }),
|
|
28
|
+
/* @__PURE__ */ jsx(Typography, { children: "Loading more..." })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
TreeLoadMoreItem
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TreeLoadMoreItem';
|
|
@@ -47,6 +47,7 @@ export * from './Accordion';
|
|
|
47
47
|
export * from './ContenPanel';
|
|
48
48
|
export * from './Navbar';
|
|
49
49
|
export * from './ActionsPanel';
|
|
50
|
+
export * from './Tree';
|
|
50
51
|
export * from './layout';
|
|
51
52
|
export { useListData, useAsyncList, type ListData, type ListOptions, type AsyncListData, type AsyncListOptions, type AsyncListLoadFunction, type AsyncListLoadOptions, type TimeValue, type DateValue, } from '@koobiq/react-primitives';
|
|
52
53
|
export { useRouter, useLocale, useFilter, type Locale, type Key, type SortDescriptor, type Selection, RouterProvider, useDateFormatter, } from '@koobiq/react-core';
|
package/dist/index.js
CHANGED
|
@@ -118,6 +118,10 @@ import { navbarPropVariant } from "./components/Navbar/types.js";
|
|
|
118
118
|
import { ActionsPanel } from "./components/ActionsPanel/ActionsPanel.js";
|
|
119
119
|
import { ActionsPanelContainer } from "./components/ActionsPanel/components/ActionsPanelContainer/ActionsPanelContainer.js";
|
|
120
120
|
import { ActionsPanelContext } from "./components/ActionsPanel/ActionsPanelContext.js";
|
|
121
|
+
import { Tree, TreeComponent } from "./components/Tree/Tree.js";
|
|
122
|
+
import { TreeLoadMoreItem } from "./components/Tree/components/TreeLoadMoreItem/TreeLoadMoreItem.js";
|
|
123
|
+
import { TreeItem } from "./components/Tree/components/TreeItem/TreeItem.js";
|
|
124
|
+
import { TreeItemContent } from "./components/Tree/components/TreeItemContent/TreeItemContent.js";
|
|
121
125
|
import { flex, flexPropAlignItems, flexPropDirection, flexPropFlex, flexPropGap, flexPropJustifyContent, flexPropOrder, flexPropWrap } from "./components/layout/flex/flex.js";
|
|
122
126
|
import { spacing, spacingGap } from "./components/layout/spacing/spacing.js";
|
|
123
127
|
export {
|
|
@@ -220,6 +224,11 @@ export {
|
|
|
220
224
|
ToastProvider,
|
|
221
225
|
Toggle,
|
|
222
226
|
Tooltip,
|
|
227
|
+
Tree,
|
|
228
|
+
TreeComponent,
|
|
229
|
+
TreeItem,
|
|
230
|
+
TreeItemContent,
|
|
231
|
+
TreeLoadMoreItem,
|
|
223
232
|
Typography,
|
|
224
233
|
alertPropStatus,
|
|
225
234
|
autocompletePropLabelAlign,
|
package/dist/style.css
CHANGED
|
@@ -658,6 +658,10 @@
|
|
|
658
658
|
display: inline-flex;
|
|
659
659
|
}
|
|
660
660
|
|
|
661
|
+
.kbq-iconbutton-0ff1bd > * {
|
|
662
|
+
flex-shrink: 0;
|
|
663
|
+
}
|
|
664
|
+
|
|
661
665
|
.kbq-iconbutton-l-2f8f66 {
|
|
662
666
|
--icon-button-size: 24px;
|
|
663
667
|
--icon-button-padding: var(--kbq-size-xxs);
|
|
@@ -4081,6 +4085,10 @@
|
|
|
4081
4085
|
|
|
4082
4086
|
.kbq-tablecolumnheader-sortIcon-b98bf4 {
|
|
4083
4087
|
visibility: hidden;
|
|
4088
|
+
opacity: 1;
|
|
4089
|
+
inline-size: var(--kbq-size-l);
|
|
4090
|
+
justify-content: center;
|
|
4091
|
+
align-items: center;
|
|
4084
4092
|
display: flex;
|
|
4085
4093
|
}
|
|
4086
4094
|
|
|
@@ -5704,6 +5712,74 @@ body[data-resizing="true"] .kbq-contentpanel-3541ee {
|
|
|
5704
5712
|
.kbq-actionpanelcontainer-panel-0ab5be {
|
|
5705
5713
|
position: absolute;
|
|
5706
5714
|
}
|
|
5715
|
+
.kbq-Tree {
|
|
5716
|
+
--tree-item-level: ;
|
|
5717
|
+
--tree-item-padding: var(--kbq-size-m);
|
|
5718
|
+
box-sizing: border-box;
|
|
5719
|
+
forced-color-adjust: none;
|
|
5720
|
+
outline: none;
|
|
5721
|
+
flex-direction: column;
|
|
5722
|
+
display: flex;
|
|
5723
|
+
overflow: auto;
|
|
5724
|
+
}
|
|
5725
|
+
|
|
5726
|
+
.kbq-Tree[data-empty] {
|
|
5727
|
+
min-block-size: 100px;
|
|
5728
|
+
font-size: var(--kbq-typography-text-normal-font-size);
|
|
5729
|
+
font-weight: var(--kbq-typography-text-normal-font-weight);
|
|
5730
|
+
line-height: var(--kbq-typography-text-normal-line-height);
|
|
5731
|
+
font-family: var(--kbq-typography-text-normal-font-family);
|
|
5732
|
+
font-style: var(--kbq-typography-text-normal-font-style);
|
|
5733
|
+
text-transform: var(--kbq-typography-text-normal-text-transform);
|
|
5734
|
+
font-feature-settings: var(--kbq-typography-text-normal-font-feature-settings);
|
|
5735
|
+
letter-spacing: var(--kbq-typography-text-normal-letter-spacing);
|
|
5736
|
+
text-underline-offset: calc(( var(--kbq-typography-text-normal-line-height) - var(--kbq-typography-text-normal-font-size)) / 2);
|
|
5737
|
+
justify-content: center;
|
|
5738
|
+
align-items: center;
|
|
5739
|
+
}
|
|
5740
|
+
|
|
5741
|
+
.kbq-TreeItem {
|
|
5742
|
+
padding-inline-start: calc((var(--tree-item-level)) * var(--tree-item-padding));
|
|
5743
|
+
}
|
|
5744
|
+
|
|
5745
|
+
.kbq-TreeItem:not([data-disabled], [data-has-child-items], [data-selection-mode]) {
|
|
5746
|
+
cursor: default;
|
|
5747
|
+
}
|
|
5748
|
+
|
|
5749
|
+
.kbq-TreeItem:not([data-disabled])[data-has-child-items], .kbq-TreeItem:not([data-disabled])[data-selection-mode], .kbq-TreeItem:not([data-disabled])[data-href] {
|
|
5750
|
+
cursor: pointer;
|
|
5751
|
+
}
|
|
5752
|
+
|
|
5753
|
+
.kbq-TreeItem[data-disabled]:not([data-has-child-items], [data-selection-mode]) {
|
|
5754
|
+
cursor: default;
|
|
5755
|
+
}
|
|
5756
|
+
|
|
5757
|
+
.kbq-TreeItem [data-slot="chevron"] {
|
|
5758
|
+
visibility: hidden;
|
|
5759
|
+
margin-block: var(--kbq-size-3xs);
|
|
5760
|
+
}
|
|
5761
|
+
|
|
5762
|
+
.kbq-TreeItem[data-has-child-items] [data-slot="chevron"] {
|
|
5763
|
+
visibility: visible;
|
|
5764
|
+
}
|
|
5765
|
+
|
|
5766
|
+
.kbq-TreeLoader {
|
|
5767
|
+
justify-content: center;
|
|
5768
|
+
align-items: center;
|
|
5769
|
+
display: flex;
|
|
5770
|
+
}
|
|
5771
|
+
|
|
5772
|
+
.kbq-TreeLoadMoreItem {
|
|
5773
|
+
align-items: center;
|
|
5774
|
+
gap: var(--kbq-size-m);
|
|
5775
|
+
cursor: default;
|
|
5776
|
+
padding-inline-start: calc((var(--tree-item-level)) * var(--tree-item-padding) + 24px);
|
|
5777
|
+
display: flex;
|
|
5778
|
+
}
|
|
5779
|
+
|
|
5780
|
+
.kbq-TreeLoadMoreItem > * {
|
|
5781
|
+
display: contents;
|
|
5782
|
+
}
|
|
5707
5783
|
.kbq-spacing-mbs_0-be7021 {
|
|
5708
5784
|
margin-block-start: 0;
|
|
5709
5785
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"@koobiq/design-tokens": "^3.15.2",
|
|
29
29
|
"@types/react-transition-group": "^4.4.12",
|
|
30
30
|
"react-transition-group": "^4.4.5",
|
|
31
|
-
"@koobiq/logger": "0.
|
|
32
|
-
"@koobiq/react-
|
|
33
|
-
"@koobiq/react-
|
|
34
|
-
"@koobiq/react-
|
|
31
|
+
"@koobiq/logger": "0.28.0",
|
|
32
|
+
"@koobiq/react-core": "0.28.0",
|
|
33
|
+
"@koobiq/react-icons": "0.28.0",
|
|
34
|
+
"@koobiq/react-primitives": "0.28.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@koobiq/design-tokens": "^3.15.2",
|