@edifice.io/react 2.2.2-develop-b2school.20250410105023 → 2.2.2-develop-pedago.20250411150037

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 (126) hide show
  1. package/dist/components/Avatar/Avatar.d.ts +21 -0
  2. package/dist/components/Avatar/Avatar.js +15 -2
  3. package/dist/components/AvatarGroup/AvatarGroup.d.ts +24 -0
  4. package/dist/components/AvatarGroup/AvatarGroup.js +24 -0
  5. package/dist/components/AvatarGroup/index.d.ts +2 -0
  6. package/dist/components/Card/Card.d.ts +3 -1
  7. package/dist/components/Card/CardBody.d.ts +3 -1
  8. package/dist/components/Card/CardBody.js +4 -2
  9. package/dist/components/Combobox/Combobox.d.ts +5 -55
  10. package/dist/components/Combobox/Combobox.js +7 -13
  11. package/dist/components/Combobox/ComboboxTrigger.d.ts +2 -30
  12. package/dist/components/Combobox/ComboboxTrigger.js +8 -27
  13. package/dist/components/Dropdown/Dropdown.d.ts +6 -10
  14. package/dist/components/Dropdown/Dropdown.js +5 -5
  15. package/dist/components/Dropdown/DropdownItem.d.ts +3 -3
  16. package/dist/components/Dropdown/DropdownItem.js +8 -6
  17. package/dist/components/Dropdown/DropdownTrigger.d.ts +31 -2
  18. package/dist/components/Dropdown/DropdownTrigger.js +24 -8
  19. package/dist/components/Flex/Flex.d.ts +12 -0
  20. package/dist/components/List/List.d.ts +1 -9
  21. package/dist/components/List/List.js +9 -9
  22. package/dist/components/PreventPropagation/PreventPropagation.d.ts +10 -0
  23. package/dist/components/PreventPropagation/PreventPropagation.js +9 -0
  24. package/dist/components/PreventPropagation/index.d.ts +2 -0
  25. package/dist/components/SearchBar/SearchBar.d.ts +1 -1
  26. package/dist/components/SearchBar/SearchBar.js +1 -3
  27. package/dist/components/StackedGroup/StackedGroup.d.ts +23 -0
  28. package/dist/components/StackedGroup/StackedGroup.js +21 -0
  29. package/dist/components/StackedGroup/index.d.ts +1 -0
  30. package/dist/components/Switch/Switch.d.ts +29 -0
  31. package/dist/components/Switch/Switch.js +27 -0
  32. package/dist/components/Switch/index.d.ts +2 -0
  33. package/dist/components/index.d.ts +4 -0
  34. package/dist/editor.js +22 -22
  35. package/dist/hooks/index.d.ts +0 -1
  36. package/dist/hooks/useCheckable/useCheckable.js +3 -10
  37. package/dist/hooks/useConf/useConf.d.ts +1 -1
  38. package/dist/hooks/useConversation/useConversation.d.ts +1 -1
  39. package/dist/hooks/useConversation/useConversation.js +17 -13
  40. package/dist/hooks/useDropdown/useDropdown.d.ts +1 -2
  41. package/dist/hooks/useDropdown/useDropdown.js +3 -5
  42. package/dist/hooks/useSession/useSession.d.ts +1 -1
  43. package/dist/icons.js +212 -230
  44. package/dist/index.d.ts +0 -1
  45. package/dist/index.js +154 -172
  46. package/dist/modals.js +14 -16
  47. package/dist/modules/comments/components/Comment.js +49 -34
  48. package/dist/modules/comments/components/CommentDeleted.d.ts +1 -0
  49. package/dist/modules/comments/components/CommentDeleted.js +11 -0
  50. package/dist/modules/comments/components/CommentForm.d.ts +2 -1
  51. package/dist/modules/comments/components/CommentForm.js +12 -8
  52. package/dist/modules/comments/components/CommentList.js +3 -3
  53. package/dist/modules/comments/components/CommentReplies.d.ts +4 -0
  54. package/dist/modules/comments/components/CommentReplies.js +33 -0
  55. package/dist/modules/comments/constants.d.ts +4 -0
  56. package/dist/modules/comments/constants.js +2 -1
  57. package/dist/modules/comments/context/Context.d.ts +6 -4
  58. package/dist/modules/comments/hooks/useCommentReplies.d.ts +12 -0
  59. package/dist/modules/comments/hooks/useCommentReplies.js +36 -0
  60. package/dist/modules/comments/hooks/useComments.d.ts +7 -7
  61. package/dist/modules/comments/hooks/useComments.js +24 -19
  62. package/dist/modules/comments/hooks/useCommentsContext.d.ts +6 -4
  63. package/dist/modules/comments/provider/CommentProvider.js +16 -13
  64. package/dist/modules/comments/types.d.ts +14 -1
  65. package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.d.ts +6 -0
  66. package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.js +136 -0
  67. package/dist/modules/editor/components/BubbleMenuEditInformationPane/index.d.ts +1 -0
  68. package/dist/modules/editor/components/Editor/Editor.d.ts +1 -3
  69. package/dist/modules/editor/components/Editor/Editor.js +8 -5
  70. package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +12 -0
  71. package/dist/modules/editor/components/NodeView/InformationPaneNodeView.d.ts +2 -0
  72. package/dist/modules/editor/components/NodeView/InformationPaneNodeView.js +10 -0
  73. package/dist/modules/editor/components/NodeView/index.d.ts +2 -2
  74. package/dist/modules/editor/components/Renderer/InformationPaneRenderer.d.ts +3 -0
  75. package/dist/modules/editor/components/Renderer/InformationPaneRenderer.js +33 -0
  76. package/dist/modules/editor/components/Renderer/index.d.ts +2 -2
  77. package/dist/modules/editor/hooks/useTipTapEditor.d.ts +2 -6
  78. package/dist/modules/editor/hooks/useTipTapEditor.js +4 -2
  79. package/dist/modules/icons/components/IconInfoRectangle.d.ts +7 -0
  80. package/dist/modules/icons/components/IconInfoRectangle.js +13 -0
  81. package/dist/modules/icons/components/index.d.ts +1 -10
  82. package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
  83. package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
  84. package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -1
  85. package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
  86. package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
  87. package/dist/modules/modals/index.d.ts +0 -1
  88. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +9 -5
  89. package/dist/modules/multimedia/index.d.ts +0 -1
  90. package/dist/multimedia.js +1 -3
  91. package/dist/providers/EdificeClientProvider/EdificeClientProvider.context.d.ts +1 -1
  92. package/dist/types/index.d.ts +1 -0
  93. package/package.json +6 -6
  94. package/dist/hooks/useWorkspaceFolders/index.d.ts +0 -1
  95. package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.d.ts +0 -14
  96. package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.js +0 -44
  97. package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.d.ts +0 -2
  98. package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.js +0 -10
  99. package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.d.ts +0 -8
  100. package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.js +0 -28
  101. package/dist/modules/icons/components/IconFolderAdd.d.ts +0 -7
  102. package/dist/modules/icons/components/IconFolderAdd.js +0 -13
  103. package/dist/modules/icons/components/IconFolderDelete.d.ts +0 -7
  104. package/dist/modules/icons/components/IconFolderDelete.js +0 -12
  105. package/dist/modules/icons/components/IconGlobe2.d.ts +0 -7
  106. package/dist/modules/icons/components/IconGlobe2.js +0 -16
  107. package/dist/modules/icons/components/IconGroupAvatar.d.ts +0 -7
  108. package/dist/modules/icons/components/IconGroupAvatar.js +0 -12
  109. package/dist/modules/icons/components/IconMailRecall.d.ts +0 -7
  110. package/dist/modules/icons/components/IconMailRecall.js +0 -13
  111. package/dist/modules/icons/components/IconQuestionMark.d.ts +0 -7
  112. package/dist/modules/icons/components/IconQuestionMark.js +0 -13
  113. package/dist/modules/icons/components/IconReadMail.d.ts +0 -7
  114. package/dist/modules/icons/components/IconReadMail.js +0 -16
  115. package/dist/modules/icons/components/IconSignature.d.ts +0 -7
  116. package/dist/modules/icons/components/IconSignature.js +0 -13
  117. package/dist/modules/icons/components/IconUndoAll.d.ts +0 -7
  118. package/dist/modules/icons/components/IconUndoAll.js +0 -14
  119. package/dist/modules/icons/components/IconUnreadMail.d.ts +0 -7
  120. package/dist/modules/icons/components/IconUnreadMail.js +0 -16
  121. package/dist/modules/modals/ConfirmModal/ConfirmModal.d.ts +0 -42
  122. package/dist/modules/modals/ConfirmModal/ConfirmModal.js +0 -36
  123. package/dist/modules/modals/ConfirmModal/index.d.ts +0 -1
  124. package/dist/modules/multimedia/WorkspaceFolders/WorkspaceFolders.d.ts +0 -8
  125. package/dist/modules/multimedia/WorkspaceFolders/WorkspaceFolders.js +0 -28
  126. package/dist/modules/multimedia/WorkspaceFolders/index.d.ts +0 -1
@@ -1,3 +1,4 @@
1
+ import { Color } from 'src/types/color';
1
2
  export type AvatarVariants = 'square' | 'rounded' | 'circle';
2
3
  export type AvatarSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
4
  export interface AvatarProps extends React.ComponentPropsWithRef<'img'> {
@@ -26,6 +27,26 @@ export interface AvatarProps extends React.ComponentPropsWithRef<'img'> {
26
27
  * Optional class for styling purpose
27
28
  */
28
29
  className?: string;
30
+ /**
31
+ * Inner border color
32
+ */
33
+ innerBorderColor?: Color;
34
+ /**
35
+ * Inner border width in pixels
36
+ */
37
+ innerBorderWidth?: number;
38
+ /**
39
+ * Outer border color
40
+ */
41
+ outerBorderColor?: Color;
42
+ /**
43
+ * Outer border width in pixels
44
+ */
45
+ outerBorderWidth?: number;
46
+ /**
47
+ * Outer border offset in pixels
48
+ */
49
+ outerBorderOffset?: number;
29
50
  }
30
51
  declare const Avatar: import('react').ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
31
52
  export default Avatar;
@@ -10,6 +10,11 @@ const Avatar = /* @__PURE__ */ forwardRef(({
10
10
  src,
11
11
  imgPlaceholder,
12
12
  className,
13
+ innerBorderColor,
14
+ innerBorderWidth,
15
+ outerBorderColor,
16
+ outerBorderWidth,
17
+ outerBorderOffset,
13
18
  ...restProps
14
19
  }, ref) => {
15
20
  const placeholder = imgPlaceholder || noAvatar, classes = clsx("avatar", {
@@ -25,8 +30,16 @@ const Avatar = /* @__PURE__ */ forwardRef(({
25
30
  rounded: variant === "rounded",
26
31
  "rounded-circle": variant === "circle"
27
32
  }
28
- }, className);
29
- return /* @__PURE__ */ jsx("div", { ref, className: classes, children: /* @__PURE__ */ jsx(Image, { src: src || placeholder, alt, imgPlaceholder: placeholder, ...restProps }) });
33
+ }, className), style = {
34
+ ...outerBorderColor && {
35
+ outline: `${outerBorderWidth}px solid var(--edifice-${outerBorderColor})`,
36
+ outlineOffset: outerBorderOffset
37
+ },
38
+ ...innerBorderColor && {
39
+ border: `${innerBorderWidth}px solid var(--edifice-${innerBorderColor})`
40
+ }
41
+ };
42
+ return /* @__PURE__ */ jsx("div", { ref, className: classes, style, children: /* @__PURE__ */ jsx(Image, { src: src || placeholder, alt, imgPlaceholder: placeholder, ...restProps }) });
30
43
  });
31
44
  export {
32
45
  Avatar as default
@@ -0,0 +1,24 @@
1
+ import { AvatarProps } from '../Avatar';
2
+ export interface AvatarGroupProps extends Omit<AvatarProps, 'src'> {
3
+ /**
4
+ * List of avatar sources
5
+ */
6
+ src: string[];
7
+ /**
8
+ * Maximum number of avatars to display
9
+ * @default 3
10
+ */
11
+ maxAvatars?: number;
12
+ /**
13
+ * Overlap between avatars (in pixels)
14
+ * @default 20
15
+ */
16
+ overlap?: number;
17
+ /**
18
+ * Controls stacking order. When 'rightFirst', rightmost avatar has highest z-index
19
+ * @default 'leftFirst'
20
+ */
21
+ stackingOrder?: 'leftFirst' | 'rightFirst';
22
+ }
23
+ declare const AvatarGroup: import('react').ForwardRefExoticComponent<Omit<AvatarGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
24
+ export default AvatarGroup;
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import clsx from "clsx";
4
+ import StackedGroup from "../StackedGroup/StackedGroup.js";
5
+ import Avatar from "../Avatar/Avatar.js";
6
+ const AvatarGroup = /* @__PURE__ */ forwardRef(({
7
+ src,
8
+ maxAvatars = 3,
9
+ overlap = 20,
10
+ className,
11
+ size = "md",
12
+ variant = "circle",
13
+ alt,
14
+ stackingOrder = "leftFirst",
15
+ ...restProps
16
+ }, ref) => {
17
+ const visibleAvatars = src.slice(0, maxAvatars), classes = clsx("avatar-group", className);
18
+ return /* @__PURE__ */ jsx("div", { ref, className: classes, style: {
19
+ display: "flex"
20
+ }, children: /* @__PURE__ */ jsx(StackedGroup, { overlap, stackingOrder, children: visibleAvatars.map((avatarSrc, index) => /* @__PURE__ */ jsx(Avatar, { src: avatarSrc, size, variant, alt: `${alt} ${index + 1}`, ...restProps })) }) });
21
+ });
22
+ export {
23
+ AvatarGroup as default
24
+ };
@@ -0,0 +1,2 @@
1
+ export { default as AvatarGroup } from './AvatarGroup';
2
+ export * from './AvatarGroup';
@@ -59,8 +59,10 @@ declare const Card: import('react').ForwardRefExoticComponent<CardProps & import
59
59
  displayName: string;
60
60
  };
61
61
  Body: {
62
- ({ children, space, flexDirection, }: {
62
+ ({ children, gap, space, padding, flexDirection, }: {
63
+ gap?: "0" | "8" | "16" | null;
63
64
  space?: "0" | "8" | "16" | null;
65
+ padding?: "0" | "8" | "16" | null;
64
66
  flexDirection?: "row" | "column" | null;
65
67
  children: ReactNode;
66
68
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,9 @@
1
1
  import { ReactNode } from 'react';
2
2
  declare const CardBody: {
3
- ({ children, space, flexDirection, }: {
3
+ ({ children, gap, space, padding, flexDirection, }: {
4
+ gap?: "0" | "8" | "16" | null;
4
5
  space?: "0" | "8" | "16" | null;
6
+ padding?: "0" | "8" | "16" | null;
5
7
  flexDirection?: "row" | "column" | null;
6
8
  children: ReactNode;
7
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -2,12 +2,14 @@ import { jsx } from "react/jsx-runtime";
2
2
  import clsx from "clsx";
3
3
  const CardBody = ({
4
4
  children,
5
+ gap = null,
5
6
  space = null,
7
+ padding = null,
6
8
  flexDirection = "row"
7
9
  }) => {
8
10
  const cardbody = clsx("card-body", {
9
- [`p-${space}`]: space,
10
- [`gap-${space}`]: space,
11
+ [`p-${padding ?? space}`]: space,
12
+ [`gap-${gap ?? space}`]: space,
11
13
  "align-items-start": flexDirection === "column",
12
14
  "flex-column": flexDirection === "column"
13
15
  });
@@ -1,20 +1,13 @@
1
- import { ChangeEvent, ReactNode } from 'react';
1
+ import { ChangeEvent } from 'react';
2
2
  export interface ComboboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
+ onSearchResultsChange: (model: (string | number)[]) => void;
3
4
  onSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
4
5
  options: OptionListItemType[];
5
6
  value: string;
6
7
  isLoading: boolean;
7
8
  noResult: boolean;
8
- onSearchResultsChange?: (model: (string | number)[]) => void;
9
9
  searchMinLength?: number;
10
10
  placeholder?: string;
11
- variant?: 'outline' | 'ghost';
12
- renderInputGroup?: ReactNode;
13
- renderList?: (items: OptionListItemType[]) => ReactNode;
14
- renderListItem?: (item: OptionListItemType) => ReactNode;
15
- renderSelectedItems?: ReactNode;
16
- renderNoResult?: ReactNode;
17
- hasDefault?: boolean;
18
11
  }
19
12
  export interface OptionListItemType {
20
13
  /**
@@ -24,58 +17,15 @@ export interface OptionListItemType {
24
17
  /**
25
18
  * Label
26
19
  */
27
- label?: string;
20
+ label: string;
28
21
  /**
29
22
  * Add an icon
30
23
  */
31
24
  icon?: any;
32
- /**
33
- * Display Separator or not
34
- */
35
- withSeparator?: boolean;
36
- /**
37
- * Disable option
38
- */
39
- disabled?: boolean;
40
25
  }
41
- /**
42
- * A component that combines an input field with a dropdown list of selectable options.
43
- *
44
- * @component
45
- * @example
46
- * ```tsx
47
- * <Combobox
48
- * onSearchResultsChange={(values) => console.log(values)}
49
- * onSearchInputChange={(e) => console.log(e.target.value)}
50
- * options={[{ value: '1', label: 'Option 1' }]}
51
- * value=""
52
- * isLoading={false}
53
- * noResult={false}
54
- * />
55
- * ```
56
- *
57
- * @param props - The component props
58
- * @param props.onSearchResultsChange - Callback fired when the selected values change
59
- * @param props.onSearchInputChange - Callback fired when the search input value changes
60
- * @param props.options - Array of options to display in the dropdown
61
- * @param props.value - Current value of the search input
62
- * @param props.isLoading - Whether the component is in a loading state
63
- * @param props.noResult - Whether to show a "no results" message
64
- * @param props.searchMinLength - Minimum number of characters required to trigger search
65
- * @param props.placeholder - Placeholder text for the input field
66
- * @param props.variant - Visual variant of the input ('outline' or 'ghost')
67
- * @param props.renderInputGroup - Custom render function for the input group
68
- * @param props.renderList - Custom render function for the dropdown list
69
- * @param props.renderListItem - Custom render function for each option item
70
- * @param props.renderSelectedItems - Custom render function for selected items
71
- * @param props.renderNoResult - Custom render function for no results message
72
- * @param props.hasDefault - Whether to show default options
73
- *
74
- * @extends {React.InputHTMLAttributes<HTMLInputElement>}
75
- */
76
26
  declare const Combobox: {
77
- ({ onSearchResultsChange, onSearchInputChange, options, value, isLoading, noResult, searchMinLength, placeholder, variant, renderInputGroup, renderList, renderListItem, renderSelectedItems, renderNoResult, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
78
- Trigger: ({ placeholder, value, searchMinLength, handleSearchInputChange, renderInputGroup, variant, renderSelectedItems, hasDefault, }: import('./ComboboxTrigger').ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
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;
79
29
  displayName: string;
80
30
  };
81
31
  export default Combobox;
@@ -12,31 +12,25 @@ const Combobox = ({
12
12
  isLoading,
13
13
  noResult,
14
14
  searchMinLength,
15
- placeholder,
16
- variant = "outline",
17
- renderInputGroup,
18
- renderList,
19
- renderListItem,
20
- renderSelectedItems,
21
- renderNoResult
15
+ placeholder
22
16
  }) => {
23
17
  const {
24
18
  t
25
19
  } = useTranslation(), [localValue, setLocalValue] = useState([]);
26
20
  useEffect(() => {
27
- onSearchResultsChange == null || onSearchResultsChange(localValue);
21
+ onSearchResultsChange(localValue);
28
22
  }, [localValue]);
29
23
  const handleOptionClick = (value2) => {
30
24
  setLocalValue([value2]);
31
25
  }, renderContent = () => isLoading ? /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center p-4", children: [
32
26
  /* @__PURE__ */ jsx(Loading, { isLoading }),
33
27
  /* @__PURE__ */ jsx("span", { className: "ps-4", children: t("explorer.search.pending") })
34
- ] }) : noResult ? renderNoResult || /* @__PURE__ */ jsx("div", { className: "p-4", children: t("portal.no.result") }) : renderList ? renderList(options) : options.map((option, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
35
- /* @__PURE__ */ jsx(Dropdown.Item, { type: "select", icon: option.icon, onClick: () => handleOptionClick(option.value), disabled: option.disabled, children: renderListItem ? renderListItem(option) : option.label }),
36
- (option.withSeparator || option.withSeparator === void 0) && index < options.length - 1 && /* @__PURE__ */ jsx(Dropdown.Separator, {})
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
31
  ] }, index));
38
- return /* @__PURE__ */ jsxs(Dropdown, { block: !0, focusOnVisible: !1, openOnSpace: !1, children: [
39
- /* @__PURE__ */ jsx(Combobox.Trigger, { placeholder, searchMinLength, handleSearchInputChange: onSearchInputChange, value, variant, renderInputGroup, renderSelectedItems, hasDefault: !!options.length }),
32
+ return /* @__PURE__ */ jsxs(Dropdown, { block: !0, children: [
33
+ /* @__PURE__ */ jsx(Combobox.Trigger, { placeholder, searchMinLength, handleSearchInputChange: onSearchInputChange, value }),
40
34
  /* @__PURE__ */ jsx(Dropdown.Menu, { children: renderContent() })
41
35
  ] });
42
36
  };
@@ -1,37 +1,9 @@
1
- import { ChangeEvent, ReactNode } from 'react';
1
+ import { ChangeEvent } from 'react';
2
2
  export interface ComboboxTriggerProps extends React.ComponentPropsWithRef<'button'> {
3
3
  handleSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
4
4
  value: string;
5
5
  searchMinLength?: number;
6
6
  placeholder?: string;
7
- renderInputGroup?: React.ReactNode;
8
- variant?: 'outline' | 'ghost';
9
- renderSelectedItems?: ReactNode;
10
- hasDefault?: boolean;
11
7
  }
12
- /**
13
- * A trigger component for the Combobox that handles user input and displays selected items.
14
- *
15
- * @component
16
- * @example
17
- * ```tsx
18
- * <ComboboxTrigger
19
- * value={searchValue}
20
- * handleSearchInputChange={(e) => setSearchValue(e.target.value)}
21
- * placeholder="Search..."
22
- * />
23
- * ```
24
- *
25
- * @param {object} props - Component props
26
- * @param {string} [props.placeholder] - Placeholder text for the search input
27
- * @param {string} [props.value=''] - Current value of the search input
28
- * @param {number} [props.searchMinLength=3] - Minimum number of characters required before showing dropdown
29
- * @param {(event: ChangeEvent<HTMLInputElement>) => void} props.handleSearchInputChange - Handler for input change events
30
- * @param {ReactNode} [props.renderInputGroup] - Optional content to render in the input group (e.g., icons)
31
- * @param {'outline' | 'ghost'} [props.variant='outline'] - Visual variant of the input
32
- * @param {ReactNode} [props.renderSelectedItems] - Optional content to render selected items
33
- *
34
- * @returns {JSX.Element} A form control containing an input field with optional input group and selected items
35
- */
36
- declare const ComboboxTrigger: ({ placeholder, value, searchMinLength, handleSearchInputChange, renderInputGroup, variant, renderSelectedItems, hasDefault, }: ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const ComboboxTrigger: ({ placeholder, value, searchMinLength, handleSearchInputChange, }: ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
37
9
  export default ComboboxTrigger;
@@ -1,6 +1,5 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from "react";
3
- import clsx from "clsx";
4
3
  import { useDropdownContext } from "../Dropdown/DropdownContext.js";
5
4
  import Input from "../Input/Input.js";
6
5
  import FormControl from "../Form/FormControl.js";
@@ -8,41 +7,23 @@ const ComboboxTrigger = ({
8
7
  placeholder,
9
8
  value = "",
10
9
  searchMinLength = 3,
11
- handleSearchInputChange,
12
- renderInputGroup,
13
- variant = "outline",
14
- renderSelectedItems,
15
- hasDefault
10
+ handleSearchInputChange
16
11
  }) => {
17
12
  const {
18
13
  triggerProps,
19
14
  itemProps,
20
15
  setVisible
21
- } = useDropdownContext(), containerProps = {
16
+ } = useDropdownContext(), inputProps = {
22
17
  ...triggerProps,
23
- className: clsx("d-flex combobox-trigger", renderInputGroup ? "input-group flex-nowrap align-items-start" : "flex-wrap align-items-center", triggerProps.className),
24
- onClick: (event) => {
25
- event.stopPropagation();
26
- }
27
- }, inputProps = {
28
18
  role: "combobox",
29
- onChange: (event) => {
30
- handleSearchInputChange(event), setVisible(event.target.value.length >= searchMinLength);
19
+ onClick: () => {
20
+ value.length >= searchMinLength && setVisible(!0);
31
21
  },
32
- onClick: (event) => {
33
- const input = event.target;
34
- setVisible(input.value.length >= searchMinLength || !!hasDefault), input.focus();
35
- }
36
- }, classNameVariant = variant === "ghost" ? " border-0" : "", classNameInput = clsx(classNameVariant, renderSelectedItems ? "flex-fill w-auto " : "");
22
+ onChange: handleSearchInputChange
23
+ };
37
24
  return useEffect(() => {
38
25
  setVisible(value.length >= searchMinLength);
39
- }, [value, searchMinLength]), /* @__PURE__ */ jsxs(FormControl, { id: "search", ...containerProps, children: [
40
- !!renderInputGroup && /* @__PURE__ */ jsx("label", { className: "input-group-text pe-0" + classNameVariant, htmlFor: triggerProps.id, children: renderInputGroup }),
41
- /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center flex-wrap flex-fill", children: [
42
- renderSelectedItems,
43
- /* @__PURE__ */ jsx(Input, { ...inputProps, className: classNameInput, noValidationIcon: !0, placeholder, size: "md", type: "search", onKeyDown: itemProps.onMenuItemKeyDown })
44
- ] })
45
- ] });
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 }) });
46
27
  };
47
28
  export {
48
29
  ComboboxTrigger as default
@@ -14,6 +14,10 @@ export interface DropdownProps {
14
14
  * Default placement with FloatingUI
15
15
  */
16
16
  placement?: Placement;
17
+ /**
18
+ * If true, the text will not wrap
19
+ */
20
+ noWrap?: boolean;
17
21
  /**
18
22
  * Extra keydown handler for the Dropdown Trigger.
19
23
  * Useful for a11y keyboard navigation between a Dropdown element and other elements,
@@ -28,14 +32,6 @@ export interface DropdownProps {
28
32
  * Whether the trigger is hovered or not.
29
33
  */
30
34
  isTriggerHovered?: boolean;
31
- /**
32
- * Whether to focus the first element when the dropdown is opened.
33
- */
34
- focusOnVisible?: boolean;
35
- /**
36
- * Whether to open the dropdown on space key press.
37
- */
38
- openOnSpace?: boolean;
39
35
  }
40
36
  export type DropdownMenuOptions = {
41
37
  /**
@@ -61,13 +57,13 @@ export type DropdownMenuOptions = {
61
57
  type: 'divider';
62
58
  };
63
59
  declare const Dropdown: {
64
- ({ children, block, overflow, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, focusOnVisible, openOnSpace, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
60
+ ({ children, block, overflow, noWrap, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
65
61
  displayName: string;
66
62
  } & {
67
63
  Trigger: import('react').ForwardRefExoticComponent<Omit<import('./DropdownTrigger').DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
68
64
  Menu: import('react').ForwardRefExoticComponent<Omit<import('./DropdownMenu').DropdownMenuProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
69
65
  Item: {
70
- ({ type, icon, onClick, children, className, disabled, ...restProps }: import('./DropdownItem').DropdownItemProps): import("react/jsx-runtime").JSX.Element;
66
+ ({ type, icon, onClick, children, className, minWidth, ...restProps }: import('./DropdownItem').DropdownItemProps): import("react/jsx-runtime").JSX.Element;
71
67
  displayName: string;
72
68
  };
73
69
  Separator: {
@@ -1,7 +1,6 @@
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";
5
4
  import DropdownCheckboxItem from "./DropdownCheckboxItem.js";
6
5
  import { DropdownContext } from "./DropdownContext.js";
7
6
  import DropdownItem from "./DropdownItem.js";
@@ -10,17 +9,17 @@ import DropdownMenuGroup from "./DropdownMenuGroup.js";
10
9
  import DropdownRadioItem from "./DropdownRadioItem.js";
11
10
  import DropdownSeparator from "./DropdownSeparator.js";
12
11
  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,
16
16
  block,
17
17
  overflow = !0,
18
+ noWrap,
18
19
  placement = "bottom-start",
19
20
  extraTriggerKeyDownHandler,
20
21
  onToggle,
21
- isTriggerHovered = !1,
22
- focusOnVisible = !0,
23
- openOnSpace = !0
22
+ isTriggerHovered = !1
24
23
  }) => {
25
24
  const {
26
25
  visible,
@@ -30,7 +29,7 @@ const Root = ({
30
29
  itemProps,
31
30
  itemRefs,
32
31
  setVisible
33
- } = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered, focusOnVisible, openOnSpace), ref = useClickOutside(() => {
32
+ } = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered), ref = useClickOutside(() => {
34
33
  setVisible(!1);
35
34
  }), value = useMemo(() => ({
36
35
  visible,
@@ -43,6 +42,7 @@ const Root = ({
43
42
  setVisible
44
43
  }), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible]), dropdown = clsx("dropdown", {
45
44
  "w-100": block,
45
+ "dropdown-nowrap": noWrap,
46
46
  overflow
47
47
  });
48
48
  return useEffect(() => {
@@ -22,12 +22,12 @@ export interface DropdownItemProps {
22
22
  */
23
23
  className?: string;
24
24
  /**
25
- * Disabled status
25
+ * Set minimum width in pixels
26
26
  */
27
- disabled?: boolean;
27
+ minWidth?: number;
28
28
  }
29
29
  declare const DropdownItem: {
30
- ({ type, icon, onClick, children, className, disabled, ...restProps }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
30
+ ({ type, icon, onClick, children, className, minWidth, ...restProps }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
31
31
  displayName: string;
32
32
  };
33
33
  export default DropdownItem;
@@ -8,7 +8,7 @@ const DropdownItem = ({
8
8
  onClick,
9
9
  children,
10
10
  className,
11
- disabled,
11
+ minWidth,
12
12
  ...restProps
13
13
  }) => {
14
14
  const {
@@ -20,13 +20,15 @@ const DropdownItem = ({
20
20
  onMenuItemMouseEnter,
21
21
  onMenuItemClick
22
22
  } = itemProps, handleOnClick = (event) => {
23
- disabled || (onClick == null || onClick(event), type === "action" && (onMenuItemClick(), event.stopPropagation()));
23
+ onClick == null || onClick(event), type === "action" && (onMenuItemClick(), event.stopPropagation());
24
24
  }, id = useId(), dropdownItem = clsx("dropdown-item", {
25
25
  focus: isFocused === id
26
- }, {
27
- "text-gray-600": disabled
28
- }, className);
29
- return /* @__PURE__ */ jsx("div", { id, role: "menuitem", ref: (el) => itemRefs.current[id] = el, tabIndex: isFocused === id ? 0 : -1, className: dropdownItem, "aria-current": isFocused === id, onClick: handleOnClick, onMouseEnter: onMenuItemMouseEnter, onKeyDown: (event) => onMenuItemKeyDown(event, onClick), ...restProps, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-8 align-items-center", children: [
26
+ }, className), style = {
27
+ ...minWidth && {
28
+ minWidth: `${minWidth}px`
29
+ }
30
+ };
31
+ return /* @__PURE__ */ jsx("div", { id, role: "menuitem", style, ref: (el) => itemRefs.current[id] = el, tabIndex: isFocused === id ? 0 : -1, className: dropdownItem, "aria-current": isFocused === id, onClick: handleOnClick, onMouseEnter: onMenuItemMouseEnter, onKeyDown: (event) => onMenuItemKeyDown(event, onClick), ...restProps, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-8 align-items-center", children: [
30
32
  icon,
31
33
  children
32
34
  ] }) });
@@ -1,8 +1,9 @@
1
+ import { Color } from 'src/types';
1
2
  export interface DropdownTriggerProps extends React.ComponentPropsWithRef<'button'> {
2
3
  /**
3
4
  * Dropdown trigger title
4
5
  */
5
- label?: string;
6
+ label?: React.ReactNode;
6
7
  /**
7
8
  * Add an icon in dropdown trigger
8
9
  */
@@ -14,7 +15,7 @@ export interface DropdownTriggerProps extends React.ComponentPropsWithRef<'butto
14
15
  /**
15
16
  * Set appearance
16
17
  */
17
- variant?: 'ghost';
18
+ variant?: 'default' | 'ghost' | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info';
18
19
  /**
19
20
  * Button size
20
21
  */
@@ -31,6 +32,34 @@ export interface DropdownTriggerProps extends React.ComponentPropsWithRef<'butto
31
32
  * Hide the carret
32
33
  */
33
34
  hideCarret?: boolean;
35
+ /**
36
+ * Make the dropdown trigger a pill
37
+ */
38
+ pill?: boolean;
39
+ /**
40
+ * Inner border color
41
+ */
42
+ innerBorderColor?: Color;
43
+ /**
44
+ * Inner border width in pixels
45
+ */
46
+ innerBorderWidth?: number;
47
+ /**
48
+ * Outer border color
49
+ */
50
+ outerBorderColor?: Color;
51
+ /**
52
+ * Outer border width in pixels
53
+ */
54
+ outerBorderWidth?: number;
55
+ /**
56
+ * Outer border offset in pixels
57
+ */
58
+ outerBorderOffset?: number;
59
+ /**
60
+ * Use base shade color
61
+ */
62
+ baseShade?: boolean;
34
63
  }
35
64
  export type DropdownTriggerType = React.ReactElement<DropdownTriggerProps>;
36
65
  declare const DropdownTrigger: import('react').ForwardRefExoticComponent<Omit<DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
@@ -3,15 +3,21 @@ 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";
7
6
  const DropdownTrigger = /* @__PURE__ */ forwardRef(({
8
7
  label,
9
8
  icon,
10
- variant,
9
+ variant = "default",
11
10
  disabled = !1,
12
11
  size,
13
12
  badgeContent,
14
13
  hideCarret = !1,
14
+ pill = !1,
15
+ innerBorderColor,
16
+ innerBorderWidth,
17
+ outerBorderColor,
18
+ outerBorderWidth,
19
+ outerBorderOffset,
20
+ baseShade,
15
21
  ...restProps
16
22
  }, forwardRef2) => {
17
23
  const {
@@ -19,18 +25,28 @@ const DropdownTrigger = /* @__PURE__ */ forwardRef(({
19
25
  block
20
26
  } = useDropdownContext(), className = clsx("dropdown-toggle ", size, variant, {
21
27
  "w-100": block
22
- }, triggerProps.className, restProps.className), mergedProps = {
28
+ }, triggerProps.className, restProps.className, {
29
+ "rounded-pill": pill
30
+ }, {
31
+ "base-shade": baseShade
32
+ }), style = {
33
+ ...outerBorderColor && {
34
+ outline: `${outerBorderWidth}px solid var(--edifice-${outerBorderColor})`,
35
+ outlineOffset: outerBorderOffset
36
+ },
37
+ ...innerBorderColor && {
38
+ border: `${innerBorderWidth}px solid var(--edifice-${innerBorderColor})`
39
+ }
40
+ }, mergedProps = {
23
41
  ...triggerProps,
24
42
  ...restProps,
25
- className
43
+ className,
44
+ style
26
45
  };
27
46
  return /* @__PURE__ */ jsxs("button", { ref: forwardRef2, type: "button", disabled, ...mergedProps, children: [
28
47
  icon,
29
48
  label,
30
- badgeContent ? /* @__PURE__ */ jsx(Badge, { variant: {
31
- level: "info",
32
- type: "notification"
33
- }, children: badgeContent }) : !hideCarret && /* @__PURE__ */ jsx(SvgIconRafterUp, { width: 16, height: 16, className: "dropdown-toggle-caret" })
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" })
34
50
  ] });
35
51
  });
36
52
  export {
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ interface FlexProps extends React.HTMLAttributes<HTMLElement> {
3
+ as?: React.ElementType;
4
+ direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse' | 'fill';
5
+ align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
6
+ justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
7
+ gap?: string;
8
+ wrap?: 'wrap' | 'nowrap' | 'reverse';
9
+ className?: string;
10
+ }
11
+ declare const Flex: React.FC<FlexProps>;
12
+ export default Flex;