@edifice.io/react 2.2.8-develop-integration.20250527162920 → 2.2.8-develop-b2school.20250527172818

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 (90) hide show
  1. package/dist/components/Button/Button.d.ts +1 -1
  2. package/dist/components/Button/Button.js +1 -1
  3. package/dist/components/Button/IconButton.js +1 -1
  4. package/dist/components/Combobox/Combobox.d.ts +60 -5
  5. package/dist/components/Combobox/Combobox.js +18 -7
  6. package/dist/components/Combobox/ComboboxTrigger.d.ts +34 -3
  7. package/dist/components/Combobox/ComboboxTrigger.js +33 -8
  8. package/dist/components/Dropdown/Dropdown.d.ts +10 -2
  9. package/dist/components/Dropdown/Dropdown.js +5 -3
  10. package/dist/components/Dropdown/DropdownItem.d.ts +5 -1
  11. package/dist/components/Dropdown/DropdownItem.js +4 -1
  12. package/dist/components/Dropdown/DropdownTrigger.js +5 -1
  13. package/dist/components/Input/Input.d.ts +4 -0
  14. package/dist/components/Input/Input.js +21 -5
  15. package/dist/components/Layout/components/Header.js +1 -1
  16. package/dist/components/List/List.d.ts +15 -1
  17. package/dist/components/List/List.js +15 -12
  18. package/dist/components/Modal/ModalHeader.js +2 -2
  19. package/dist/components/SearchBar/SearchBar.d.ts +1 -1
  20. package/dist/components/SearchBar/SearchBar.js +3 -1
  21. package/dist/components/Toolbar/Toolbar.d.ts +4 -0
  22. package/dist/components/Toolbar/Toolbar.js +8 -3
  23. package/dist/components/Tree/components/Tree.js +1 -2
  24. package/dist/components/Tree/hooks/useTree.d.ts +0 -1
  25. package/dist/components/Tree/hooks/useTree.js +2 -25
  26. package/dist/components/Tree/types/index.d.ts +0 -4
  27. package/dist/editor.js +28 -24
  28. package/dist/hooks/index.d.ts +1 -0
  29. package/dist/hooks/useCheckable/useCheckable.js +10 -3
  30. package/dist/hooks/useConversation/useConversation.d.ts +1 -1
  31. package/dist/hooks/useConversation/useConversation.js +13 -17
  32. package/dist/hooks/useDate/useDate.d.ts +1 -0
  33. package/dist/hooks/useDate/useDate.js +33 -27
  34. package/dist/hooks/useDropdown/useDropdown.d.ts +2 -1
  35. package/dist/hooks/useDropdown/useDropdown.js +5 -3
  36. package/dist/hooks/useHttpErrorToast/useHttpErrorToast.js +12 -3
  37. package/dist/hooks/useWorkspaceFolders/index.d.ts +3 -0
  38. package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.js +54 -0
  39. package/dist/hooks/useWorkspaceFolders/useWorkspaceFoldersTree.d.ts +13 -0
  40. package/dist/hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js +51 -0
  41. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +1 -2
  42. package/dist/icons.js +236 -216
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.js +50 -20
  45. package/dist/modals.js +16 -14
  46. package/dist/modules/editor/components/Editor/Editor.d.ts +8 -1
  47. package/dist/modules/editor/components/Editor/Editor.js +7 -3
  48. package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.d.ts +2 -0
  49. package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.js +10 -0
  50. package/dist/modules/editor/components/NodeView/index.d.ts +2 -1
  51. package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.d.ts +8 -0
  52. package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.js +28 -0
  53. package/dist/modules/editor/components/Renderer/index.d.ts +2 -1
  54. package/dist/modules/editor/hooks/useTipTapEditor.d.ts +6 -2
  55. package/dist/modules/editor/hooks/useTipTapEditor.js +2 -2
  56. package/dist/modules/icons/components/IconFolderAdd.d.ts +7 -0
  57. package/dist/modules/icons/components/IconFolderAdd.js +13 -0
  58. package/dist/modules/icons/components/IconFolderDelete.d.ts +7 -0
  59. package/dist/modules/icons/components/IconFolderDelete.js +12 -0
  60. package/dist/modules/icons/components/IconGlobe2.d.ts +7 -0
  61. package/dist/modules/icons/components/IconGlobe2.js +16 -0
  62. package/dist/modules/icons/components/IconGroupAvatar.d.ts +7 -0
  63. package/dist/modules/icons/components/IconGroupAvatar.js +12 -0
  64. package/dist/modules/icons/components/IconMailRecall.d.ts +7 -0
  65. package/dist/modules/icons/components/IconMailRecall.js +13 -0
  66. package/dist/modules/icons/components/IconQuestionMark.d.ts +7 -0
  67. package/dist/modules/icons/components/IconQuestionMark.js +13 -0
  68. package/dist/modules/icons/components/IconReadMail.d.ts +7 -0
  69. package/dist/modules/icons/components/IconReadMail.js +16 -0
  70. package/dist/modules/icons/components/IconSignature.d.ts +7 -0
  71. package/dist/modules/icons/components/IconSignature.js +13 -0
  72. package/dist/modules/icons/components/IconUndoAll.d.ts +7 -0
  73. package/dist/modules/icons/components/IconUndoAll.js +14 -0
  74. package/dist/modules/icons/components/IconUnreadMail.d.ts +7 -0
  75. package/dist/modules/icons/components/IconUnreadMail.js +16 -0
  76. package/dist/modules/icons/components/index.d.ts +10 -0
  77. package/dist/modules/modals/ConfirmModal/ConfirmModal.d.ts +47 -0
  78. package/dist/modules/modals/ConfirmModal/ConfirmModal.js +37 -0
  79. package/dist/modules/modals/ConfirmModal/index.d.ts +1 -0
  80. package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +9 -5
  81. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +5 -4
  82. package/dist/modules/modals/index.d.ts +1 -0
  83. package/dist/modules/multimedia/WorkspaceFolders/WorkspaceFolders.d.ts +8 -0
  84. package/dist/modules/multimedia/WorkspaceFolders/WorkspaceFolders.js +55 -0
  85. package/dist/modules/multimedia/WorkspaceFolders/components/NewFolderForm.d.ts +16 -0
  86. package/dist/modules/multimedia/WorkspaceFolders/components/NewFolderForm.js +39 -0
  87. package/dist/modules/multimedia/WorkspaceFolders/index.d.ts +1 -0
  88. package/dist/modules/multimedia/index.d.ts +1 -0
  89. package/dist/multimedia.js +3 -1
  90. package/package.json +6 -6
@@ -25,7 +25,7 @@ export interface ButtonProps extends React.ComponentPropsWithRef<'button'> {
25
25
  /**
26
26
  * Does it has a text ?
27
27
  */
28
- children: ReactNode;
28
+ children?: ReactNode;
29
29
  /**
30
30
  * Display Icon Component to the left
31
31
  */
@@ -19,7 +19,7 @@ const Button = /* @__PURE__ */ forwardRef(({
19
19
  const classes = clsx("btn", {
20
20
  [`btn-filled btn-${color}`]: variant === "filled",
21
21
  [`btn-${variant}-${color}`]: variant === "outline" || variant === "ghost",
22
- "btn-icon": !children,
22
+ "btn-icon btn-sm": !children,
23
23
  "btn-loading": isLoading,
24
24
  "btn-lg": size === "lg",
25
25
  "btn-sm": size === "sm"
@@ -11,7 +11,7 @@ const IconButton = /* @__PURE__ */ forwardRef(({
11
11
  ...restProps,
12
12
  className: clsx("btn-icon btn-sm", className)
13
13
  };
14
- return /* @__PURE__ */ jsx(Button, { ref, ...buttonProps, children: icon });
14
+ return /* @__PURE__ */ jsx(Button, { ref, ...buttonProps, leftIcon: icon });
15
15
  });
16
16
  export {
17
17
  IconButton as default
@@ -1,13 +1,23 @@
1
- import { ChangeEvent } from 'react';
1
+ import { ChangeEvent, KeyboardEvent, ReactNode } from 'react';
2
2
  export interface ComboboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
- onSearchResultsChange: (model: (string | number)[]) => void;
4
3
  onSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
5
4
  options: OptionListItemType[];
6
5
  value: string;
7
6
  isLoading: boolean;
8
7
  noResult: boolean;
8
+ onFocus?: (event: ChangeEvent<HTMLInputElement>) => void;
9
+ onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
10
+ onSearchResultsChange?: (model: (string | number)[]) => void;
11
+ onSearchInputKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;
9
12
  searchMinLength?: number;
10
13
  placeholder?: string;
14
+ variant?: 'outline' | 'ghost';
15
+ renderInputGroup?: ReactNode;
16
+ renderList?: (items: OptionListItemType[]) => ReactNode;
17
+ renderListItem?: (item: OptionListItemType) => ReactNode;
18
+ renderSelectedItems?: ReactNode;
19
+ renderNoResult?: ReactNode;
20
+ hasDefault?: boolean;
11
21
  }
12
22
  export interface OptionListItemType {
13
23
  /**
@@ -17,15 +27,60 @@ export interface OptionListItemType {
17
27
  /**
18
28
  * Label
19
29
  */
20
- label: string;
30
+ label?: string;
21
31
  /**
22
32
  * Add an icon
23
33
  */
24
34
  icon?: any;
35
+ /**
36
+ * Display Separator or not
37
+ */
38
+ withSeparator?: boolean;
39
+ /**
40
+ * Disable option
41
+ */
42
+ disabled?: boolean;
25
43
  }
44
+ /**
45
+ * A component that combines an input field with a dropdown list of selectable options.
46
+ *
47
+ * @component
48
+ * @example
49
+ * ```tsx
50
+ * <Combobox
51
+ * onSearchResultsChange={(values) => console.log(values)}
52
+ * onSearchInputChange={(e) => console.log(e.target.value)}
53
+ * options={[{ value: '1', label: 'Option 1' }]}
54
+ * value=""
55
+ * isLoading={false}
56
+ * noResult={false}
57
+ * />
58
+ * ```
59
+ *
60
+ * @param props - The component props
61
+ * @param props.onFocus - Callback fired when the input is focused
62
+ * @param props.onBlur - Callback fired when the input is blured
63
+ * @param props.onSearchResultsChange - Callback fired when the selected values change
64
+ * @param props.onSearchInputChange - Callback fired when the search input value changes
65
+ * @param props.options - Array of options to display in the dropdown
66
+ * @param props.value - Current value of the search input
67
+ * @param props.isLoading - Whether the component is in a loading state
68
+ * @param props.noResult - Whether to show a "no results" message
69
+ * @param props.searchMinLength - Minimum number of characters required to trigger search
70
+ * @param props.placeholder - Placeholder text for the input field
71
+ * @param props.variant - Visual variant of the input ('outline' or 'ghost')
72
+ * @param props.renderInputGroup - Custom render function for the input group
73
+ * @param props.renderList - Custom render function for the dropdown list
74
+ * @param props.renderListItem - Custom render function for each option item
75
+ * @param props.renderSelectedItems - Custom render function for selected items
76
+ * @param props.renderNoResult - Custom render function for no results message
77
+ * @param props.hasDefault - Whether to show default options
78
+ *
79
+ * @extends {React.InputHTMLAttributes<HTMLInputElement>}
80
+ */
26
81
  declare const Combobox: {
27
- ({ onSearchResultsChange, onSearchInputChange, options, value, isLoading, noResult, searchMinLength, placeholder, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
28
- Trigger: ({ placeholder, value, searchMinLength, handleSearchInputChange, }: import('./ComboboxTrigger').ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
82
+ ({ onFocus, onBlur, onSearchResultsChange, onSearchInputChange, onSearchInputKeyUp, options, value, isLoading, noResult, searchMinLength, placeholder, variant, renderInputGroup, renderList, renderListItem, renderSelectedItems, renderNoResult, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
83
+ Trigger: ({ placeholder, value, searchMinLength, onFocus, onBlur, handleSearchInputChange, handleSearchInputKeyUp, renderInputGroup, variant, renderSelectedItems, hasDefault, }: import('./ComboboxTrigger').ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
29
84
  displayName: string;
30
85
  };
31
86
  export default Combobox;
@@ -5,32 +5,43 @@ import ComboboxTrigger from "./ComboboxTrigger.js";
5
5
  import Dropdown from "../Dropdown/Dropdown.js";
6
6
  import Loading from "../Loading/Loading.js";
7
7
  const Combobox = ({
8
+ onFocus,
9
+ onBlur,
8
10
  onSearchResultsChange,
9
11
  onSearchInputChange,
12
+ onSearchInputKeyUp,
10
13
  options,
11
14
  value,
12
15
  isLoading,
13
16
  noResult,
14
17
  searchMinLength,
15
- placeholder
18
+ placeholder,
19
+ variant = "outline",
20
+ renderInputGroup,
21
+ renderList,
22
+ renderListItem,
23
+ renderSelectedItems,
24
+ renderNoResult
16
25
  }) => {
17
26
  const {
18
27
  t
19
28
  } = useTranslation(), [localValue, setLocalValue] = useState([]);
20
29
  useEffect(() => {
21
- onSearchResultsChange(localValue);
30
+ onSearchResultsChange == null || onSearchResultsChange(localValue);
22
31
  }, [localValue]);
23
32
  const handleOptionClick = (value2) => {
24
33
  setLocalValue([value2]);
25
34
  }, renderContent = () => isLoading ? /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center p-4", children: [
26
35
  /* @__PURE__ */ jsx(Loading, { isLoading }),
27
36
  /* @__PURE__ */ jsx("span", { className: "ps-4", children: t("explorer.search.pending") })
28
- ] }) : noResult ? /* @__PURE__ */ jsx("div", { className: "p-4", children: t("portal.no.result") }) : options.map((option, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
29
- /* @__PURE__ */ jsx(Dropdown.Item, { type: "select", icon: option.icon, onClick: () => handleOptionClick(option.value), children: option.label }),
30
- index < options.length - 1 && /* @__PURE__ */ jsx(Dropdown.Separator, {})
37
+ ] }) : noResult ? renderNoResult || /* @__PURE__ */ jsx("div", { className: "p-4", children: t("portal.no.result") }) : renderList ? renderList(options) : options.map((option, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
38
+ /* @__PURE__ */ jsx(Dropdown.Item, { type: "select", icon: option.icon, onClick: () => handleOptionClick(option.value), disabled: option.disabled, children: renderListItem ? renderListItem(option) : option.label }),
39
+ (option.withSeparator || option.withSeparator === void 0) && index < options.length - 1 && /* @__PURE__ */ jsx(Dropdown.Separator, {})
31
40
  ] }, index));
32
- return /* @__PURE__ */ jsxs(Dropdown, { block: !0, children: [
33
- /* @__PURE__ */ jsx(Combobox.Trigger, { placeholder, searchMinLength, handleSearchInputChange: onSearchInputChange, value }),
41
+ return /* @__PURE__ */ jsxs(Dropdown, { block: !0, focusOnVisible: !1, openOnSpace: !1, children: [
42
+ /* @__PURE__ */ jsx(Combobox.Trigger, { placeholder, searchMinLength, handleSearchInputChange: onSearchInputChange, handleSearchInputKeyUp: (event) => {
43
+ onSearchInputKeyUp == null || onSearchInputKeyUp(event);
44
+ }, value, variant, renderInputGroup, renderSelectedItems, hasDefault: !!options.length, onFocus, onBlur }),
34
45
  /* @__PURE__ */ jsx(Dropdown.Menu, { children: renderContent() })
35
46
  ] });
36
47
  };
@@ -1,9 +1,40 @@
1
- import { ChangeEvent } from 'react';
2
- export interface ComboboxTriggerProps extends React.ComponentPropsWithRef<'button'> {
1
+ import { ChangeEvent, KeyboardEvent, ReactNode } from 'react';
2
+ export interface ComboboxTriggerProps extends React.ComponentPropsWithRef<'input'> {
3
3
  handleSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
4
+ handleSearchInputKeyUp: (event: KeyboardEvent<HTMLInputElement>) => void;
4
5
  value: string;
5
6
  searchMinLength?: number;
6
7
  placeholder?: string;
8
+ renderInputGroup?: React.ReactNode;
9
+ variant?: 'outline' | 'ghost';
10
+ renderSelectedItems?: ReactNode;
11
+ hasDefault: boolean;
12
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
13
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
7
14
  }
8
- declare const ComboboxTrigger: ({ placeholder, value, searchMinLength, handleSearchInputChange, }: ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
15
+ /**
16
+ * A trigger component for the Combobox that handles user input and displays selected items.
17
+ *
18
+ * @component
19
+ * @example
20
+ * ```tsx
21
+ * <ComboboxTrigger
22
+ * value={searchValue}
23
+ * handleSearchInputChange={(e) => setSearchValue(e.target.value)}
24
+ * placeholder="Search..."
25
+ * />
26
+ * ```
27
+ *
28
+ * @param {object} props - Component props
29
+ * @param {string} [props.placeholder] - Placeholder text for the search input
30
+ * @param {string} [props.value=''] - Current value of the search input
31
+ * @param {number} [props.searchMinLength=3] - Minimum number of characters required before showing dropdown
32
+ * @param {(event: ChangeEvent<HTMLInputElement>) => void} props.handleSearchInputChange - Handler for input change events
33
+ * @param {ReactNode} [props.renderInputGroup] - Optional content to render in the input group (e.g., icons)
34
+ * @param {'outline' | 'ghost'} [props.variant='outline'] - Visual variant of the input
35
+ * @param {ReactNode} [props.renderSelectedItems] - Optional content to render selected items
36
+ *
37
+ * @returns {JSX.Element} A form control containing an input field with optional input group and selected items
38
+ */
39
+ declare const ComboboxTrigger: ({ placeholder, value, searchMinLength, onFocus, onBlur, handleSearchInputChange, handleSearchInputKeyUp, renderInputGroup, variant, renderSelectedItems, hasDefault, }: ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
9
40
  export default ComboboxTrigger;
@@ -1,5 +1,6 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from "react";
3
+ import clsx from "clsx";
3
4
  import { useDropdownContext } from "../Dropdown/DropdownContext.js";
4
5
  import Input from "../Input/Input.js";
5
6
  import FormControl from "../Form/FormControl.js";
@@ -7,23 +8,47 @@ const ComboboxTrigger = ({
7
8
  placeholder,
8
9
  value = "",
9
10
  searchMinLength = 3,
10
- handleSearchInputChange
11
+ onFocus,
12
+ onBlur,
13
+ handleSearchInputChange,
14
+ handleSearchInputKeyUp,
15
+ renderInputGroup,
16
+ variant = "outline",
17
+ renderSelectedItems,
18
+ hasDefault
11
19
  }) => {
12
20
  const {
13
21
  triggerProps,
14
22
  itemProps,
15
23
  setVisible
16
- } = useDropdownContext(), inputProps = {
24
+ } = useDropdownContext(), containerProps = {
17
25
  ...triggerProps,
26
+ className: clsx("d-flex combobox-trigger", renderInputGroup ? "input-group flex-nowrap align-items-start" : "flex-wrap align-items-center", triggerProps.className),
27
+ onClick: (event) => {
28
+ event.stopPropagation();
29
+ }
30
+ }, inputProps = {
18
31
  role: "combobox",
19
- onClick: () => {
20
- value.length >= searchMinLength && setVisible(!0);
32
+ onChange: (event) => {
33
+ handleSearchInputChange(event), setVisible(event.target.value.length >= searchMinLength);
21
34
  },
22
- onChange: handleSearchInputChange
23
- };
35
+ onClick: (event) => {
36
+ const input = event.target;
37
+ setVisible(input.value.length >= searchMinLength || hasDefault), input.focus();
38
+ },
39
+ onKeyUp: (event) => {
40
+ handleSearchInputKeyUp == null || handleSearchInputKeyUp(event);
41
+ }
42
+ }, classNameVariant = variant === "ghost" ? " border-0" : "", classNameInput = clsx(classNameVariant, renderSelectedItems ? "flex-fill w-auto " : "");
24
43
  return useEffect(() => {
25
44
  setVisible(value.length >= searchMinLength);
26
- }, [setVisible, value, searchMinLength]), /* @__PURE__ */ jsx(FormControl, { className: "d-flex align-items-center", id: "search", children: /* @__PURE__ */ jsx(Input, { ...inputProps, className: "max-w-512", noValidationIcon: !0, placeholder, size: "md", type: "search", onKeyDown: itemProps.onMenuItemKeyDown }) });
45
+ }, [value, searchMinLength]), /* @__PURE__ */ jsxs(FormControl, { id: "search", ...containerProps, children: [
46
+ !!renderInputGroup && /* @__PURE__ */ jsx("label", { className: "input-group-text pe-0" + classNameVariant, htmlFor: triggerProps.id, children: renderInputGroup }),
47
+ /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center flex-wrap flex-fill", children: [
48
+ renderSelectedItems,
49
+ /* @__PURE__ */ jsx(Input, { ...inputProps, className: classNameInput, onFocus, onBlur, noValidationIcon: !0, placeholder, size: "md", type: "search", onKeyDown: itemProps.onMenuItemKeyDown })
50
+ ] })
51
+ ] });
27
52
  };
28
53
  export {
29
54
  ComboboxTrigger as default
@@ -32,6 +32,14 @@ export interface DropdownProps {
32
32
  * Whether the trigger is hovered or not.
33
33
  */
34
34
  isTriggerHovered?: boolean;
35
+ /**
36
+ * Whether to focus the first element when the dropdown is opened.
37
+ */
38
+ focusOnVisible?: boolean;
39
+ /**
40
+ * Whether to open the dropdown on space key press.
41
+ */
42
+ openOnSpace?: boolean;
35
43
  }
36
44
  export type DropdownMenuOptions = {
37
45
  /**
@@ -57,13 +65,13 @@ export type DropdownMenuOptions = {
57
65
  type: 'divider';
58
66
  };
59
67
  declare const Dropdown: {
60
- ({ children, block, overflow, noWrap, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
68
+ ({ children, block, overflow, noWrap, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, focusOnVisible, openOnSpace, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
61
69
  displayName: string;
62
70
  } & {
63
71
  Trigger: import('react').ForwardRefExoticComponent<Omit<import('./DropdownTrigger').DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
64
72
  Menu: import('react').ForwardRefExoticComponent<Omit<import('./DropdownMenu').DropdownMenuProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
65
73
  Item: {
66
- ({ type, icon, onClick, children, className, minWidth, ...restProps }: import('./DropdownItem').DropdownItemProps): import("react/jsx-runtime").JSX.Element;
74
+ ({ type, icon, onClick, children, className, minWidth, disabled, ...restProps }: import('./DropdownItem').DropdownItemProps): import("react/jsx-runtime").JSX.Element;
67
75
  displayName: string;
68
76
  };
69
77
  Separator: {
@@ -1,6 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useMemo, useEffect } from "react";
3
3
  import clsx from "clsx";
4
+ import useDropdown from "../../hooks/useDropdown/useDropdown.js";
4
5
  import DropdownCheckboxItem from "./DropdownCheckboxItem.js";
5
6
  import { DropdownContext } from "./DropdownContext.js";
6
7
  import DropdownItem from "./DropdownItem.js";
@@ -9,7 +10,6 @@ import DropdownMenuGroup from "./DropdownMenuGroup.js";
9
10
  import DropdownRadioItem from "./DropdownRadioItem.js";
10
11
  import DropdownSeparator from "./DropdownSeparator.js";
11
12
  import DropdownTrigger from "./DropdownTrigger.js";
12
- import useDropdown from "../../hooks/useDropdown/useDropdown.js";
13
13
  import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
14
14
  const Root = ({
15
15
  children,
@@ -19,7 +19,9 @@ const Root = ({
19
19
  placement = "bottom-start",
20
20
  extraTriggerKeyDownHandler,
21
21
  onToggle,
22
- isTriggerHovered = !1
22
+ isTriggerHovered = !1,
23
+ focusOnVisible = !0,
24
+ openOnSpace = !0
23
25
  }) => {
24
26
  const {
25
27
  visible,
@@ -29,7 +31,7 @@ const Root = ({
29
31
  itemProps,
30
32
  itemRefs,
31
33
  setVisible
32
- } = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered), ref = useClickOutside(() => {
34
+ } = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered, focusOnVisible, openOnSpace), ref = useClickOutside(() => {
33
35
  setVisible(!1);
34
36
  }), value = useMemo(() => ({
35
37
  visible,
@@ -25,9 +25,13 @@ export interface DropdownItemProps {
25
25
  * Set minimum width in pixels
26
26
  */
27
27
  minWidth?: number;
28
+ /**
29
+ * Disabled status
30
+ */
31
+ disabled?: boolean;
28
32
  }
29
33
  declare const DropdownItem: {
30
- ({ type, icon, onClick, children, className, minWidth, ...restProps }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
34
+ ({ type, icon, onClick, children, className, minWidth, disabled, ...restProps }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
31
35
  displayName: string;
32
36
  };
33
37
  export default DropdownItem;
@@ -9,6 +9,7 @@ const DropdownItem = ({
9
9
  children,
10
10
  className,
11
11
  minWidth,
12
+ disabled,
12
13
  ...restProps
13
14
  }) => {
14
15
  const {
@@ -20,9 +21,11 @@ const DropdownItem = ({
20
21
  onMenuItemMouseEnter,
21
22
  onMenuItemClick
22
23
  } = itemProps, handleOnClick = (event) => {
23
- onClick == null || onClick(event), type === "action" && (onMenuItemClick(), event.stopPropagation());
24
+ disabled || (onClick == null || onClick(event), type === "action" && (onMenuItemClick(), event.stopPropagation()));
24
25
  }, id = useId(), dropdownItem = clsx("dropdown-item", {
25
26
  focus: isFocused === id
27
+ }, {
28
+ "text-gray-600": disabled
26
29
  }, className), style = {
27
30
  ...minWidth && {
28
31
  minWidth: `${minWidth}px`
@@ -3,6 +3,7 @@ import { forwardRef } from "react";
3
3
  import clsx from "clsx";
4
4
  import SvgIconRafterUp from "../../modules/icons/components/IconRafterUp.js";
5
5
  import { useDropdownContext } from "./DropdownContext.js";
6
+ import Badge from "../Badge/Badge.js";
6
7
  const DropdownTrigger = /* @__PURE__ */ forwardRef(({
7
8
  label,
8
9
  icon,
@@ -46,7 +47,10 @@ const DropdownTrigger = /* @__PURE__ */ forwardRef(({
46
47
  return /* @__PURE__ */ jsxs("button", { ref: forwardRef2, type: "button", disabled, ...mergedProps, children: [
47
48
  icon,
48
49
  label,
49
- badgeContent ? /* @__PURE__ */ jsx("span", { className: "badge text-bg-secondary rounded-pill", children: badgeContent }) : !hideCarret && /* @__PURE__ */ jsx(SvgIconRafterUp, { width: 16, height: 16, className: "dropdown-toggle-caret" })
50
+ badgeContent ? /* @__PURE__ */ jsx(Badge, { variant: {
51
+ level: "info",
52
+ type: "notification"
53
+ }, children: badgeContent }) : !hideCarret && /* @__PURE__ */ jsx(SvgIconRafterUp, { width: 16, height: 16, className: "dropdown-toggle-caret" })
50
54
  ] });
51
55
  });
52
56
  export {
@@ -25,6 +25,10 @@ export interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, O
25
25
  * Optional class for styling purpose
26
26
  */
27
27
  className?: string;
28
+ /**
29
+ * Show count of characters
30
+ */
31
+ showCounter?: boolean;
28
32
  }
29
33
  /**
30
34
  * Input Form Component
@@ -1,5 +1,5 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useState } from "react";
3
3
  import clsx from "clsx";
4
4
  import { useFormControl } from "../Form/FormContext.js";
5
5
  const Input = /* @__PURE__ */ forwardRef(({
@@ -8,23 +8,39 @@ const Input = /* @__PURE__ */ forwardRef(({
8
8
  size = "md",
9
9
  type = "text",
10
10
  className,
11
+ showCounter,
11
12
  ...restProps
12
13
  }, ref) => {
14
+ var _a;
13
15
  const {
14
16
  id,
15
17
  isRequired,
16
18
  isReadOnly,
17
19
  status
18
- } = useFormControl(), classes = clsx({
20
+ } = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.value) == null ? void 0 : _a.toString().length) || 0), classes = clsx({
19
21
  "form-control": !isReadOnly,
20
22
  "form-control-lg": size === "lg",
21
23
  "form-control-sm": size === "sm",
22
24
  "is-invalid": status === "invalid",
23
25
  "is-valid": status === "valid",
24
26
  "form-control-plaintext": isReadOnly,
25
- "no-validation-icon": noValidationIcon
27
+ "no-validation-icon": noValidationIcon,
28
+ "pe-64": showCounter && !status
26
29
  }, className);
27
- return /* @__PURE__ */ jsx("input", { ref, id, className: classes, type, placeholder, required: isRequired, readOnly: isReadOnly, ...restProps });
30
+ return /* @__PURE__ */ jsxs("div", { children: [
31
+ /* @__PURE__ */ jsx("input", { ref, id, className: classes, type, placeholder, required: isRequired, readOnly: isReadOnly, ...restProps, onChange: (e) => {
32
+ var _a2;
33
+ setCurrentLength(e.target.value.length), (_a2 = restProps.onChange) == null || _a2.call(restProps, e);
34
+ } }),
35
+ showCounter && !status && /* @__PURE__ */ jsxs("span", { className: clsx("caption text-end float-end mt-n32 py-2 px-12 ", {
36
+ "text-danger": currentLength === restProps.maxLength,
37
+ "text-gray-700": currentLength !== restProps.maxLength
38
+ }), children: [
39
+ currentLength,
40
+ " / ",
41
+ restProps.maxLength
42
+ ] })
43
+ ] });
28
44
  });
29
45
  export {
30
46
  Input as default
@@ -54,7 +54,7 @@ const Header = ({
54
54
  parsedContent,
55
55
  parsedHeadline,
56
56
  error
57
- } = useHelp(hasOldHelpEnableWorkflow), classes = clsx("header", {
57
+ } = useHelp(hasOldHelpEnableWorkflow), classes = clsx("header d-print-none", {
58
58
  "no-2d": is1d,
59
59
  "no-1d": !is1d
60
60
  }), {
@@ -5,6 +5,10 @@ export type ListProps<T> = {
5
5
  * Toolbar data items
6
6
  */
7
7
  items?: ToolbarItem[];
8
+ /**
9
+ * Checkable list
10
+ */
11
+ isCheckable?: boolean;
8
12
  /**
9
13
  * Generic data
10
14
  */
@@ -17,7 +21,17 @@ export type ListProps<T> = {
17
21
  * Callback to get selected ids
18
22
  */
19
23
  onSelectedItems?: (selectedIds: string[]) => void;
24
+ /**
25
+ * Custom class name
26
+ */
27
+ className?: string;
28
+ /**
29
+ * Toolbar options
30
+ */
31
+ toolbarOptions?: {
32
+ shouldHideLabelsOnMobile?: boolean;
33
+ };
20
34
  };
21
35
  export declare const List: <T extends {
22
36
  _id: string;
23
- }>({ items, data, renderNode, onSelectedItems, }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
37
+ }>({ items, isCheckable, data, renderNode, onSelectedItems, className, toolbarOptions, }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,18 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useMediaQuery } from "@uidotdev/usehooks";
3
2
  import clsx from "clsx";
4
3
  import { useEffect, Fragment as Fragment$1 } from "react";
5
4
  import { useCheckable } from "../../hooks/useCheckable/useCheckable.js";
5
+ import useBreakpoint from "../../hooks/useBreakpoint/useBreakpoint.js";
6
6
  import Checkbox from "../Checkbox/Checkbox.js";
7
7
  import { Toolbar } from "../Toolbar/Toolbar.js";
8
8
  const List = ({
9
9
  items,
10
+ isCheckable = !1,
10
11
  data,
11
12
  renderNode,
12
- onSelectedItems
13
+ onSelectedItems,
14
+ className,
15
+ toolbarOptions
13
16
  }) => {
14
17
  const {
15
18
  selectedItems,
@@ -17,15 +20,15 @@ const List = ({
17
20
  isIndeterminate,
18
21
  handleOnSelectAllItems,
19
22
  handleOnSelectItem
20
- } = useCheckable(data), isDesktopDevice = useMediaQuery("only screen and (min-width: 1024px)");
23
+ } = useCheckable(data), {
24
+ lg
25
+ } = useBreakpoint();
21
26
  return useEffect(() => {
22
27
  selectedItems && (onSelectedItems == null || onSelectedItems(selectedItems));
23
28
  }, [onSelectedItems, selectedItems]), /* @__PURE__ */ jsxs(Fragment, { children: [
24
- items && /* @__PURE__ */ jsxs(Fragment, { children: [
25
- /* @__PURE__ */ jsx("div", { className: clsx("d-flex align-items-center gap-8", {
26
- "px-12": items
27
- }), children: /* @__PURE__ */ jsxs(Fragment, { children: [
28
- /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center gap-8", children: [
29
+ (items || isCheckable) && /* @__PURE__ */ jsxs(Fragment, { children: [
30
+ /* @__PURE__ */ jsx("div", { className: clsx("list-header d-flex align-items-center gap-8 px-12", className), children: /* @__PURE__ */ jsxs(Fragment, { children: [
31
+ /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center gap-8 py-12", children: [
29
32
  /* @__PURE__ */ jsx(Checkbox, { checked: allItemsSelected, indeterminate: isIndeterminate, onChange: () => handleOnSelectAllItems(allItemsSelected) }),
30
33
  /* @__PURE__ */ jsxs("span", { children: [
31
34
  "(",
@@ -33,15 +36,15 @@ const List = ({
33
36
  ")"
34
37
  ] })
35
38
  ] }),
36
- /* @__PURE__ */ jsx(Toolbar, { items, isBlock: !0, align: "left", variant: "no-shadow", className: clsx("gap-4 py-4", {
37
- "px-0 ms-auto": !isDesktopDevice
39
+ items && /* @__PURE__ */ jsx(Toolbar, { items, shouldHideLabelsOnMobile: toolbarOptions == null ? void 0 : toolbarOptions.shouldHideLabelsOnMobile, isBlock: !0, align: "left", variant: "no-shadow", className: clsx("gap-4 py-4", {
40
+ "px-0 ms-auto": !lg
38
41
  }) })
39
42
  ] }) }),
40
43
  /* @__PURE__ */ jsx("div", { className: "border-top" })
41
44
  ] }),
42
45
  /* @__PURE__ */ jsx("div", { className: "mt-8", children: data == null ? void 0 : data.map((node) => {
43
- const checkbox = /* @__PURE__ */ jsx(Checkbox, { checked: selectedItems.includes(node._id), onChange: () => handleOnSelectItem(node._id) }), checked = selectedItems.includes(node._id);
44
- return /* @__PURE__ */ jsx(Fragment$1, { children: renderNode(node, checkbox, checked) }, node._id);
46
+ const checked = selectedItems.includes(node._id);
47
+ return /* @__PURE__ */ jsx(Fragment$1, { children: renderNode(node, /* @__PURE__ */ jsx(Checkbox, { checked, onChange: () => handleOnSelectItem(node._id), onClick: (event) => event.stopPropagation() }), checked) }, node._id);
45
48
  }) })
46
49
  ] });
47
50
  };
@@ -17,8 +17,8 @@ const ModalHeader = (props) => {
17
17
  return useEffect(() => {
18
18
  var _a;
19
19
  focusId || (_a = closeButtonRef.current) == null || _a.focus();
20
- }, [focusId]), /* @__PURE__ */ jsxs("div", { className: "modal-header", children: [
21
- /* @__PURE__ */ jsx("h2", { id: ariaLabelId, className: "modal-title", tabIndex: -1, children }),
20
+ }, [focusId]), /* @__PURE__ */ jsxs("div", { className: "modal-header align-self-center", children: [
21
+ /* @__PURE__ */ jsx("h2", { id: ariaLabelId, className: "modal-title text-center", tabIndex: -1, children }),
22
22
  /* @__PURE__ */ jsx(IconButton, { ref: closeButtonRef, "aria-label": t("close"), color: "tertiary", icon: /* @__PURE__ */ jsx(SvgIconClose, {}), type: "button", variant: "ghost", title: t("close"), onClick: onModalClose, className: "btn-close" })
23
23
  ] });
24
24
  };
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { Size } from '../../types';
3
- export interface BaseProps {
3
+ export interface BaseProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'size'> {
4
4
  /**
5
5
  * String or Template literal with React i18next namespace
6
6
  */
@@ -24,10 +24,12 @@ const SearchBar = ({
24
24
  "ps-48": isVariant
25
25
  }), handleClick = () => {
26
26
  onClick == null || onClick();
27
+ }, handleKeyDown = (e) => {
28
+ e.key === "Enter" && (e.preventDefault(), handleClick());
27
29
  };
28
30
  return /* @__PURE__ */ jsxs(FormControl, { id: "search-bar", className: searchbar, children: [
29
31
  isVariant && /* @__PURE__ */ jsx("div", { className: "position-absolute z-1 top-50 start-0 translate-middle-y border-0 ps-12 bg-transparent", children: /* @__PURE__ */ jsx(SvgIconSearch, {}) }),
30
- /* @__PURE__ */ jsx(FormControl.Input, { type: "search", placeholder: t(placeholder), size, noValidationIcon: !0, className: input, onChange, disabled, ...restProps }),
32
+ /* @__PURE__ */ jsx(FormControl.Input, { type: "search", placeholder: t(placeholder), size, noValidationIcon: !0, className: input, onChange, disabled, onKeyDown: handleKeyDown, ...restProps }),
31
33
  !isVariant && /* @__PURE__ */ jsx(SearchButton, { type: "submit", "aria-label": t("search"), icon: /* @__PURE__ */ jsx(SvgIconSearch, {}), className: "border-start-0", onClick: handleClick })
32
34
  ] });
33
35
  };
@@ -71,6 +71,10 @@ export interface ToolbarProps extends React.ComponentPropsWithRef<'div'> {
71
71
  * Accept optional children
72
72
  */
73
73
  children?: ReactNode;
74
+ /**
75
+ * Hide labels on mobile
76
+ */
77
+ shouldHideLabelsOnMobile?: boolean;
74
78
  }
75
79
  export declare const Toolbar: import('react').ForwardRefExoticComponent<Omit<ToolbarProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
76
80
  export default Toolbar;