@edifice.io/react 2.3.2-develop-b2school-actualites.20251020144208 → 2.3.2-develop-b2school-actualites.20251027110554

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.
@@ -1,5 +1,7 @@
1
1
  import { ButtonProps } from '../../Button';
2
2
  export type MenuButtonProps = Pick<ButtonProps, 'children' | 'leftIcon' | 'rightIcon' | 'onClick'> & {
3
3
  selected: boolean;
4
+ className?: string;
5
+ size?: 'md' | 'lg';
4
6
  };
5
7
  export declare const MenuButton: (props: Partial<MenuButtonProps>) => import("react/jsx-runtime").JSX.Element;
@@ -8,13 +8,22 @@ const MenuButton = (props) => {
8
8
  leftIcon,
9
9
  rightIcon,
10
10
  onClick,
11
- children
11
+ children,
12
+ className,
13
+ size
12
14
  } = props, {
13
15
  childProps
14
16
  } = useMenuContext();
15
- return /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", className: clsx("stack w-100", {
16
- selected
17
- }), leftIcon, rightIcon, onClick, ...childProps, children });
17
+ return /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", className: clsx("stack w-100 overflow-hidden", {
18
+ selected,
19
+ "menu-button-lg": size === "lg"
20
+ }, className), leftIcon, rightIcon, onClick, ...childProps, style: size === "lg" ? {
21
+ height: "auto"
22
+ } : void 0, children: /* @__PURE__ */ jsx("span", { className: clsx("text-truncate", {
23
+ "text-truncate-2 text-start ms-0": size === "lg"
24
+ }), style: {
25
+ overflowWrap: "break-word"
26
+ }, children }) });
18
27
  };
19
28
  export {
20
29
  MenuButton
@@ -14,7 +14,7 @@ export interface OptionsType {
14
14
  */
15
15
  icon?: JSX.Element;
16
16
  }
17
- export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<DropdownTriggerProps, 'badgeContent'> {
17
+ export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<DropdownTriggerProps, 'badgeContent' | 'defaultValue'> {
18
18
  /**
19
19
  * Default select label
20
20
  */
@@ -27,13 +27,17 @@ export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<Dropd
27
27
  * Callback to get value
28
28
  */
29
29
  onValueChange?: (option: OptionsType | string) => void;
30
+ /**
31
+ * Default value
32
+ */
33
+ defaultValue?: string;
30
34
  }
31
35
  /**
32
36
  *
33
37
  * Select component is based on Dropdown Component. It extends `Dropdown` and `Dropdown.Trigger` props `block`, `overflow`, `icon`, `variant`, `size`, `disabled`
34
38
  */
35
39
  declare const Select: {
36
- ({ icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, }: SelectProps): import("react/jsx-runtime").JSX.Element;
40
+ ({ icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, defaultValue, }: SelectProps): import("react/jsx-runtime").JSX.Element;
37
41
  displayName: string;
38
42
  };
39
43
  export default Select;
@@ -12,7 +12,8 @@ const Select = ({
12
12
  size,
13
13
  disabled,
14
14
  placeholderOption,
15
- onValueChange
15
+ onValueChange,
16
+ defaultValue
16
17
  }) => {
17
18
  const [localValue, setLocalValue] = useState(), {
18
19
  t
@@ -22,7 +23,12 @@ const Select = ({
22
23
  const value = typeof localValue == "object" ? localValue.value : localValue;
23
24
  onValueChange == null || onValueChange(value);
24
25
  }
25
- }, [localValue]);
26
+ }, [localValue]), useEffect(() => {
27
+ if (defaultValue) {
28
+ const foundOption = options.find((option) => (typeof option == "object" ? option.value : option) === defaultValue);
29
+ foundOption !== void 0 && setLocalValue(foundOption);
30
+ }
31
+ }, []);
26
32
  const label = typeof localValue == "object" ? localValue.label : localValue, iconChange = typeof localValue == "object" ? localValue.icon : void 0;
27
33
  return /* @__PURE__ */ jsxs(Dropdown, { overflow, block, children: [
28
34
  /* @__PURE__ */ jsx(SelectTrigger, { icon: iconChange || icon, label: /* @__PURE__ */ jsx("span", { className: "text-truncate", children: t(label || placeholderOption) }), variant, size, disabled }),
@@ -35,12 +35,12 @@ const EditorPreview = ({
35
35
  }), setSummaryContent(doc.body.textContent || "");
36
36
  }
37
37
  }, [content]), /* @__PURE__ */ jsxs("div", { className: borderClass, "data-testid": "editor-preview", onClick: onDetailClick, tabIndex: onDetailClick ? -1 : void 0, role: onDetailClick ? "button" : void 0, children: [
38
- /* @__PURE__ */ jsx("div", { className: "flex-fill text-truncate text-truncate-2 post-preview-content overflow-hidden", children: summaryContent }),
38
+ /* @__PURE__ */ jsx("div", { className: "flex-fill text-truncate text-truncate-2 post-preview-content overflow-hidden", style: {
39
+ overflowWrap: "anywhere"
40
+ }, children: summaryContent }),
39
41
  /* @__PURE__ */ jsx("div", { onClick: handleMediaClick, tabIndex: hasMediaCallback ? -1 : void 0, role: hasMediaCallback ? "button" : void 0, className: "d-flex align-items-center justify-content-center gap-24 px-32 pt-16", children: medias.slice(0, maxMediaDisplayed).map((media, index) => /* @__PURE__ */ jsxs("div", { className: clsx("position-relative col-12 col-md-4 ", {
40
42
  "d-none d-md-block": index >= 1
41
- }), style: {
42
- maxHeight: "150px"
43
- }, children: [
43
+ }), children: [
44
44
  /* @__PURE__ */ jsx(Image, { alt: media.alt, objectFit: "cover", ratio: "16", className: "rounded", src: media.url, sizes: "" }),
45
45
  (index === 0 || index === 2) && medias.length - (index + 1) > 0 && /* @__PURE__ */ jsx("div", { className: clsx("position-absolute top-0 bottom-0 start-0 end-0 d-flex justify-content-center align-items-center rounded text-light bg-dark bg-opacity-50", {
46
46
  "d-flex d-md-none": index === 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.3.2-develop-b2school-actualites.20251020144208",
3
+ "version": "2.3.2-develop-b2school-actualites.20251027110554",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -131,9 +131,9 @@
131
131
  "react-slugify": "^3.0.3",
132
132
  "swiper": "^10.1.0",
133
133
  "ua-parser-js": "^1.0.36",
134
- "@edifice.io/bootstrap": "2.3.2-develop-b2school-actualites.20251020144208",
135
- "@edifice.io/tiptap-extensions": "2.3.2-develop-b2school-actualites.20251020144208",
136
- "@edifice.io/utilities": "2.3.2-develop-b2school-actualites.20251020144208"
134
+ "@edifice.io/bootstrap": "2.3.2-develop-b2school-actualites.20251027110554",
135
+ "@edifice.io/utilities": "2.3.2-develop-b2school-actualites.20251027110554",
136
+ "@edifice.io/tiptap-extensions": "2.3.2-develop-b2school-actualites.20251027110554"
137
137
  },
138
138
  "devDependencies": {
139
139
  "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
@@ -164,8 +164,8 @@
164
164
  "vite": "^5.4.11",
165
165
  "vite-plugin-dts": "^4.1.0",
166
166
  "vite-tsconfig-paths": "^5.0.1",
167
- "@edifice.io/config": "2.3.2-develop-b2school-actualites.20251020144208",
168
- "@edifice.io/client": "2.3.2-develop-b2school-actualites.20251020144208"
167
+ "@edifice.io/config": "2.3.2-develop-b2school-actualites.20251027110554",
168
+ "@edifice.io/client": "2.3.2-develop-b2school-actualites.20251027110554"
169
169
  },
170
170
  "peerDependencies": {
171
171
  "@react-spring/web": "^9.7.5",