@koobiq/react-components 0.27.0 → 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.
Files changed (36) hide show
  1. package/dist/components/Autocomplete/Autocomplete.js +26 -10
  2. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  3. package/dist/components/ContenPanel/hooks/useContentPanelContainer/useContentPanelContainer.d.ts +1 -1
  4. package/dist/components/DatePicker/DatePicker.js +21 -16
  5. package/dist/components/DatePicker/types.d.ts +2 -0
  6. package/dist/components/Divider/Divider.d.ts +1 -1
  7. package/dist/components/Input/Input.js +1 -0
  8. package/dist/components/SearchInput/SearchInput.d.ts +1 -1
  9. package/dist/components/SearchInput/SearchInput.js +25 -9
  10. package/dist/components/Select/Select.js +32 -16
  11. package/dist/components/SelectNext/Select.js +32 -16
  12. package/dist/components/Table/Table.js +3 -1
  13. package/dist/components/Table/components/TableColumnHeader/TableColumnHeader.js +21 -5
  14. package/dist/components/Table/components/TableSelectAllCell/TableSelectAllCell.d.ts +2 -1
  15. package/dist/components/Table/components/TableSelectAllCell/TableSelectAllCell.js +10 -2
  16. package/dist/components/Table/types.d.ts +5 -0
  17. package/dist/components/Tooltip/Tooltip.d.ts +1 -1
  18. package/dist/components/Tree/Tree.d.ts +17 -0
  19. package/dist/components/Tree/Tree.js +34 -0
  20. package/dist/components/Tree/components/TreeItem/TreeItem.d.ts +2 -0
  21. package/dist/components/Tree/components/TreeItem/TreeItem.js +29 -0
  22. package/dist/components/Tree/components/TreeItem/index.d.ts +2 -0
  23. package/dist/components/Tree/components/TreeItem/types.d.ts +3 -0
  24. package/dist/components/Tree/components/TreeItemContent/TreeItemContent.d.ts +2 -0
  25. package/dist/components/Tree/components/TreeItemContent/TreeItemContent.js +33 -0
  26. package/dist/components/Tree/components/TreeItemContent/index.d.ts +2 -0
  27. package/dist/components/Tree/components/TreeItemContent/types.d.ts +11 -0
  28. package/dist/components/Tree/components/TreeLoadMoreItem/TreeLoadMoreItem.d.ts +2 -0
  29. package/dist/components/Tree/components/TreeLoadMoreItem/TreeLoadMoreItem.js +35 -0
  30. package/dist/components/Tree/components/TreeLoadMoreItem/index.d.ts +1 -0
  31. package/dist/components/Tree/components/index.d.ts +3 -0
  32. package/dist/components/Tree/index.d.ts +2 -0
  33. package/dist/components/index.d.ts +1 -0
  34. package/dist/index.js +9 -0
  35. package/dist/style.css +76 -0
  36. package/package.json +5 -5
@@ -3,7 +3,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
3
  import { forwardRef, useRef, useCallback } from "react";
4
4
  import { useDOMRef, useFilter, useElementSize, mergeProps, clsx } from "@koobiq/react-core";
5
5
  import { IconChevronDownS16 } from "@koobiq/react-icons";
6
- import { useComboBoxState, removeDataAttributes, useSlottedContext, FormContext, useComboBox, FieldErrorContext } from "@koobiq/react-primitives";
6
+ import { useComboBoxState, removeDataAttributes, useSlottedContext, FormContext, useComboBox, Provider, ButtonContext, FieldErrorContext, DEFAULT_SLOT } from "@koobiq/react-primitives";
7
7
  import { PopoverInner } from "../Popover/PopoverInner.js";
8
8
  import s from "./Autocomplete.module.css.js";
9
9
  import { ListInner, List } from "../List/List.js";
@@ -200,15 +200,31 @@ function AutocompleteRender(props, ref) {
200
200
  },
201
201
  slotProps?.input
202
202
  );
203
- return /* @__PURE__ */ jsxs(FormField, { ...rootProps, children: [
204
- /* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
205
- /* @__PURE__ */ jsxs("div", { className: s.body, children: [
206
- /* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Input, { ...inputProps }) }),
207
- /* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FormField.Error, { ...errorProps }) }),
208
- /* @__PURE__ */ jsx(FormField.Caption, { ...captionProps })
209
- ] }),
210
- /* @__PURE__ */ jsx(PopoverInner, { ...popoverProps, children: /* @__PURE__ */ jsx(ListInner, { ...listProps }) })
211
- ] });
203
+ return /* @__PURE__ */ jsx(
204
+ Provider,
205
+ {
206
+ values: [
207
+ [
208
+ ButtonContext,
209
+ {
210
+ slots: {
211
+ [DEFAULT_SLOT]: {},
212
+ "clear-button": {}
213
+ }
214
+ }
215
+ ]
216
+ ],
217
+ children: /* @__PURE__ */ jsxs(FormField, { ...rootProps, children: [
218
+ /* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
219
+ /* @__PURE__ */ jsxs("div", { className: s.body, children: [
220
+ /* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Input, { ...inputProps }) }),
221
+ /* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FormField.Error, { ...errorProps }) }),
222
+ /* @__PURE__ */ jsx(FormField.Caption, { ...captionProps })
223
+ ] }),
224
+ /* @__PURE__ */ jsx(PopoverInner, { ...popoverProps, children: /* @__PURE__ */ jsx(ListInner, { ...listProps }) })
225
+ ] })
226
+ }
227
+ );
212
228
  }
213
229
  const AutocompleteComponent = forwardRef(
214
230
  AutocompleteRender
@@ -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("@react-types/checkbox").AriaCheckboxGroupProps, "description" | "validationState"> & import("react").RefAttributes<HTMLDivElement>>;
20
+ } & Omit<import("react-aria").AriaCheckboxGroupProps, "description" | "validationState"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -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, jsx } from "react/jsx-runtime";
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(rootSlotProps?.group, groupProps, {
63
- ref: anchorRef,
64
- endAddon: /* @__PURE__ */ jsxs(Fragment, { children: [
65
- endAddon,
66
- /* @__PURE__ */ jsx(
67
- IconButton,
68
- {
69
- variant: isInvalid ? "error" : "fade-contrast",
70
- className: s.calendar,
71
- ...buttonProps,
72
- children: /* @__PURE__ */ jsx(IconCalendarO16, {})
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("@react-aria/separator").SeparatorProps, "elementType"> & import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>) => import("react").ReactElement | null;
14
+ } & Omit<import("react-aria").SeparatorProps, "elementType"> & import("react").HTMLAttributes<HTMLElement> & import("react").RefAttributes<HTMLElement>) => import("react").ReactElement | null;
@@ -94,6 +94,7 @@ const Input = forwardRef((props, ref) => {
94
94
  const clearButtonProps = mergeProps(
95
95
  {
96
96
  isClearable,
97
+ tabIndex: -1,
97
98
  isHidden: clearButtonIsHidden
98
99
  },
99
100
  slotProps?.clearButton
@@ -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("@react-types/searchfield").AriaSearchFieldProps, "description" | "validationState">, "caption" | "style" | "className" | `data-${string}` | "startAddon" | "endAddon" | "variant" | "slotProps" | "labelPlacement" | "labelAlign" | "fullWidth" | "isLabelHidden"> & {
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;
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
3
  import { forwardRef } from "react";
4
4
  import { useDOMRef, mergeProps, clsx } from "@koobiq/react-core";
5
5
  import { IconMagnifyingGlass16 } from "@koobiq/react-icons";
6
- import { useSearchFieldState, removeDataAttributes, useSlottedContext, FormContext, useSearchField, FieldErrorContext } from "@koobiq/react-primitives";
6
+ import { useSearchFieldState, removeDataAttributes, useSlottedContext, FormContext, useSearchField, Provider, ButtonContext, FieldErrorContext, DEFAULT_SLOT } from "@koobiq/react-primitives";
7
7
  import s from "./SearchInput.module.css.js";
8
8
  import { useForm } from "../Form/FormContext.js";
9
9
  import { FormFieldClearButton } from "../FormField/FormFieldClearButton/FormFieldClearButton.js";
@@ -122,14 +122,30 @@ const SearchInput = forwardRef(
122
122
  errorMessagePropsAria,
123
123
  slotProps?.errorMessage
124
124
  );
125
- return /* @__PURE__ */ jsxs(FormField, { ...rootProps, children: [
126
- /* @__PURE__ */ jsx(FormField.Label, { ...labelProps, children: label }),
127
- /* @__PURE__ */ jsxs("div", { className: s.body, children: [
128
- /* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Input, { ...inputProps }) }),
129
- /* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FormField.Error, { ...errorProps }) }),
130
- /* @__PURE__ */ jsx(FormField.Caption, { ...captionProps })
131
- ] })
132
- ] });
125
+ return /* @__PURE__ */ jsx(
126
+ Provider,
127
+ {
128
+ values: [
129
+ [
130
+ ButtonContext,
131
+ {
132
+ slots: {
133
+ [DEFAULT_SLOT]: {},
134
+ "clear-button": {}
135
+ }
136
+ }
137
+ ]
138
+ ],
139
+ children: /* @__PURE__ */ jsxs(FormField, { ...rootProps, children: [
140
+ /* @__PURE__ */ jsx(FormField.Label, { ...labelProps, children: label }),
141
+ /* @__PURE__ */ jsxs("div", { className: s.body, children: [
142
+ /* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Input, { ...inputProps }) }),
143
+ /* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FormField.Error, { ...errorProps }) }),
144
+ /* @__PURE__ */ jsx(FormField.Caption, { ...captionProps })
145
+ ] })
146
+ ] })
147
+ }
148
+ );
133
149
  }
134
150
  );
135
151
  SearchInput.displayName = "SearchInput";
@@ -3,7 +3,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
3
  import { forwardRef, useCallback } from "react";
4
4
  import { useDOMRef, useElementSize, mergeProps } from "@koobiq/react-core";
5
5
  import { IconChevronDownS16 } from "@koobiq/react-icons";
6
- import { useSlottedContext, FormContext, useMultiSelectState, removeDataAttributes, useMultiSelect, FieldErrorContext } from "@koobiq/react-primitives";
6
+ import { useSlottedContext, FormContext, useMultiSelectState, removeDataAttributes, useMultiSelect, Provider, ButtonContext, FieldErrorContext, DEFAULT_SLOT } from "@koobiq/react-primitives";
7
7
  import { PopoverInner } from "../Popover/PopoverInner.js";
8
8
  import s from "./Select.module.css.js";
9
9
  import { SelectList } from "./components/SelectList/SelectList.js";
@@ -185,21 +185,37 @@ function SelectRender(props, ref) {
185
185
  return state2.selectedItems[0].textValue;
186
186
  };
187
187
  const renderValue = renderValueProp || renderDefaultValue;
188
- return /* @__PURE__ */ jsxs(Fragment, { children: [
189
- /* @__PURE__ */ jsxs(FormField, { ...rootProps, children: [
190
- /* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
191
- /* @__PURE__ */ jsxs("div", { className: s.body, children: [
192
- /* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Select, { ...controlProps, children: renderValue(state, {
193
- isInvalid,
194
- isDisabled: props.isDisabled,
195
- isRequired: props.isRequired
196
- }) }) }),
197
- /* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FormField.Error, { ...errorProps }) }),
198
- /* @__PURE__ */ jsx(FormField.Caption, { ...captionProps })
199
- ] })
200
- ] }),
201
- /* @__PURE__ */ jsx(PopoverInner, { ...popoverProps, children: /* @__PURE__ */ jsx(SelectList, { ...listProps }) })
202
- ] });
188
+ return /* @__PURE__ */ jsxs(
189
+ Provider,
190
+ {
191
+ values: [
192
+ [
193
+ ButtonContext,
194
+ {
195
+ slots: {
196
+ [DEFAULT_SLOT]: {},
197
+ "clear-button": {}
198
+ }
199
+ }
200
+ ]
201
+ ],
202
+ children: [
203
+ /* @__PURE__ */ jsxs(FormField, { ...rootProps, children: [
204
+ /* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
205
+ /* @__PURE__ */ jsxs("div", { className: s.body, children: [
206
+ /* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Select, { ...controlProps, children: renderValue(state, {
207
+ isInvalid,
208
+ isDisabled: props.isDisabled,
209
+ isRequired: props.isRequired
210
+ }) }) }),
211
+ /* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FormField.Error, { ...errorProps }) }),
212
+ /* @__PURE__ */ jsx(FormField.Caption, { ...captionProps })
213
+ ] })
214
+ ] }),
215
+ /* @__PURE__ */ jsx(PopoverInner, { ...popoverProps, children: /* @__PURE__ */ jsx(SelectList, { ...listProps }) })
216
+ ]
217
+ }
218
+ );
203
219
  }
204
220
  const SelectComponent = forwardRef(SelectRender);
205
221
  const Select = SelectComponent;
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
3
  import { forwardRef, useCallback } from "react";
4
4
  import { useDOMRef, useElementSize, mergeProps } from "@koobiq/react-core";
5
5
  import { IconChevronDownS16 } from "@koobiq/react-icons";
6
- import { CollectionBuilder, Collection, useSelectState, removeDataAttributes, useSlottedContext, FormContext, useSelect, FieldErrorContext } from "@koobiq/react-primitives";
6
+ import { CollectionBuilder, Collection, useSelectState, removeDataAttributes, useSlottedContext, FormContext, useSelect, Provider, ButtonContext, FieldErrorContext, DEFAULT_SLOT } from "@koobiq/react-primitives";
7
7
  import { PopoverInner } from "../Popover/PopoverInner.js";
8
8
  import s from "./Select.module.css.js";
9
9
  import { SelectList } from "./components/SelectList/SelectList.js";
@@ -197,21 +197,37 @@ function SelectInner({
197
197
  return state.selectedItems[0].textValue;
198
198
  };
199
199
  const renderValue = renderValueProp || renderDefaultValue;
200
- return /* @__PURE__ */ jsxs(Fragment, { children: [
201
- /* @__PURE__ */ jsxs(FormField, { ...rootProps, children: [
202
- /* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
203
- /* @__PURE__ */ jsxs("div", { className: s.body, children: [
204
- /* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Select, { ...controlProps, children: renderValue(inState, {
205
- isInvalid,
206
- isDisabled: props.isDisabled,
207
- isRequired: props.isRequired
208
- }) }) }),
209
- /* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FormField.Error, { ...errorProps }) }),
210
- /* @__PURE__ */ jsx(FormField.Caption, { ...captionProps })
211
- ] })
212
- ] }),
213
- /* @__PURE__ */ jsx(PopoverInner, { ...popoverProps, children: /* @__PURE__ */ jsx(SelectList, { ...listProps }) })
214
- ] });
200
+ return /* @__PURE__ */ jsxs(
201
+ Provider,
202
+ {
203
+ values: [
204
+ [
205
+ ButtonContext,
206
+ {
207
+ slots: {
208
+ [DEFAULT_SLOT]: {},
209
+ "clear-button": {}
210
+ }
211
+ }
212
+ ]
213
+ ],
214
+ children: [
215
+ /* @__PURE__ */ jsxs(FormField, { ...rootProps, children: [
216
+ /* @__PURE__ */ jsx(FormField.Label, { ...labelProps }),
217
+ /* @__PURE__ */ jsxs("div", { className: s.body, children: [
218
+ /* @__PURE__ */ jsx(FormField.ControlGroup, { ...groupProps, children: /* @__PURE__ */ jsx(FormField.Select, { ...controlProps, children: renderValue(inState, {
219
+ isInvalid,
220
+ isDisabled: props.isDisabled,
221
+ isRequired: props.isRequired
222
+ }) }) }),
223
+ /* @__PURE__ */ jsx(FieldErrorContext.Provider, { value: validation, children: /* @__PURE__ */ jsx(FormField.Error, { ...errorProps }) }),
224
+ /* @__PURE__ */ jsx(FormField.Caption, { ...captionProps })
225
+ ] })
226
+ ] }),
227
+ /* @__PURE__ */ jsx(PopoverInner, { ...popoverProps, children: /* @__PURE__ */ jsx(SelectList, { ...listProps }) })
228
+ ]
229
+ }
230
+ );
215
231
  }
216
232
  function StandaloneSelect({
217
233
  props: inProps,
@@ -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 = direction === "ascending" ? /* @__PURE__ */ jsx(IconChevronUpS16, {}) : /* @__PURE__ */ jsx(IconChevronDownS16, {});
38
- const iconToRender = renderSortIcon?.({ direction, isActive }) ?? defaultIcon;
39
- const columnSortIcon = allowsSorting && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: clsx(s.sortIcon, isActive && s.active), children: iconToRender });
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: state.selectionManager.selectionMode === "single" ? /* @__PURE__ */ jsx(VisuallyHidden, { children: checkboxProps["aria-label"] }) : /* @__PURE__ */ jsx(Checkbox, { ...checkboxProps })
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("@react-types/tooltip").TooltipTriggerProps, "children" | "style" | "className" | "id" | "placement" | `data-${string}` | "variant" | "offset" | "control" | "portalContainer" | "anchorRef" | "hideArrow" | "arrowBoundaryOffset" | "crossOffset" | "delay" | "closeDelay" | keyof {
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,2 @@
1
+ import type { TreeItemProps } from './types';
2
+ export declare function TreeItem({ children, className, textValue, ...props }: TreeItemProps): import("react/jsx-runtime").JSX.Element;
@@ -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,2 @@
1
+ export * from './TreeItem';
2
+ export * from './types';
@@ -0,0 +1,3 @@
1
+ import type { DataAttributeProps } from '@koobiq/react-core';
2
+ import type { TreeItemProps as AriaTreeItemProps } from '@koobiq/react-primitives';
3
+ export type TreeItemProps = Partial<AriaTreeItemProps> & DataAttributeProps;
@@ -0,0 +1,2 @@
1
+ import type { TreeItemContentProps } from './types';
2
+ export declare function TreeItemContent(props: TreeItemContentProps): import("react/jsx-runtime").JSX.Element;
@@ -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,2 @@
1
+ export * from './TreeItemContent';
2
+ export * from './types';
@@ -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,2 @@
1
+ import { type TreeLoadMoreItemProps } from '@koobiq/react-primitives';
2
+ export declare function TreeLoadMoreItem(props: TreeLoadMoreItemProps): import("react/jsx-runtime").JSX.Element;
@@ -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';
@@ -0,0 +1,3 @@
1
+ export * from './TreeLoadMoreItem';
2
+ export * from './TreeItem';
3
+ export * from './TreeItemContent';
@@ -0,0 +1,2 @@
1
+ export * from './Tree';
2
+ export * from './components';
@@ -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.27.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.27.0",
32
- "@koobiq/react-icons": "0.27.0",
33
- "@koobiq/react-core": "0.27.0",
34
- "@koobiq/react-primitives": "0.27.0"
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",