ublo-lib 1.35.10 → 1.35.12

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.
@@ -5,6 +5,6 @@ type Props = {
5
5
  lang: string;
6
6
  gradientColor: string;
7
7
  };
8
- export default function Collapsible({ gradientColor, height: initHeight, children, lang, }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export default function Collapsible({ gradientColor, height, children, lang, }: Props): import("react/jsx-runtime").JSX.Element;
9
9
  export {};
10
10
  //# sourceMappingURL=collapsible.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../../src/common/components/collapsible/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAaF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAsB,EACtB,MAAM,EAAE,UAAgB,EACxB,QAAQ,EACR,IAAI,GACL,EAAE,KAAK,2CAqDP"}
1
+ {"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../../src/common/components/collapsible/collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAaF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAsB,EACtB,MAAY,EACZ,QAAQ,EACR,IAAI,GACL,EAAE,KAAK,2CAkDP"}
@@ -16,7 +16,7 @@ const messages = {
16
16
  close: "Close",
17
17
  },
18
18
  };
19
- export default function Collapsible({ gradientColor = "#fff", height: initHeight = 150, children, lang, }) {
19
+ export default function Collapsible({ gradientColor = "#fff", height = 150, children, lang, }) {
20
20
  const [opened, setOpened] = React.useState(false);
21
21
  const [hasOverflow, setHasOverflow] = React.useState(false);
22
22
  const classes = classnames(styles.collapsible, {
@@ -33,16 +33,15 @@ export default function Collapsible({ gradientColor = "#fff", height: initHeight
33
33
  ? messages[messageLang].close
34
34
  : messages[messageLang].open;
35
35
  const Icon = opened ? Icons.ChevronUp : Icons.ChevronDown;
36
- const parentHeight = parentRef.current?.offsetHeight;
37
- const childrenHeight = childrenRef.current?.offsetHeight;
38
- const openedHeight = childrenHeight + 50;
39
36
  React.useEffect(() => {
37
+ const parentHeight = parentRef.current?.offsetHeight;
38
+ const childrenHeight = childrenRef.current?.offsetHeight;
40
39
  const isConnected = Cms.isConnected();
41
40
  if (!isConnected && childrenHeight > parentHeight) {
42
41
  setHasOverflow(true);
43
42
  }
44
- }, [parentHeight, childrenHeight]);
43
+ }, []);
45
44
  return (_jsxs(motion.div, { ref: parentRef, animate: {
46
- height: opened || !hasOverflow ? openedHeight : initHeight,
47
- }, initial: { height: initHeight }, className: classes, style: { "--gradient-color": gradientColor }, children: [_jsx("div", { ref: childrenRef, children: children }), hasOverflow && (_jsxs(Button, { className: styles.message, onClick: toggleOpen, children: [message, _jsx(Icon, {})] }))] }));
45
+ height: opened || !hasOverflow ? "auto" : height,
46
+ }, initial: { height }, className: classes, style: { "--gradient-color": gradientColor }, children: [_jsx("div", { ref: childrenRef, children: children }), hasOverflow && (_jsxs(Button, { className: styles.message, onClick: toggleOpen, children: [message, _jsx(Icon, {})] }))] }));
48
47
  }
@@ -24,10 +24,9 @@
24
24
  }
25
25
 
26
26
  button.message {
27
- position: absolute;
28
- bottom: 10px;
29
- left: 50%;
30
- transform: translateX(-50%);
27
+ position: sticky;
28
+ bottom: 0;
29
+ margin: 10px auto;
31
30
  z-index: 2;
32
31
  }
33
32
 
@@ -139,11 +139,15 @@ const SearchBar = ({ lang, resultFormatter, backdrop, OverrideIcons = {}, messag
139
139
  "Terms - Destination": `${text} - ${path}`,
140
140
  });
141
141
  };
142
+ const onClick = () => {
143
+ close();
144
+ sendPlausibleGoal();
145
+ };
142
146
  const props = externalLink ? anchorProps : linkProps;
143
147
  const classes = classNames("search-bar__result", {
144
148
  "search-bar__result--active": i === state.active,
145
149
  });
146
- return (_jsx(Tag, { className: classes, ...props, onClick: sendPlausibleGoal }, `${name}-${i}`));
150
+ return (_jsx(Tag, { className: classes, ...props, onClick: onClick }, `${name}-${i}`));
147
151
  }), search.result?.length === 0 && (_jsx("div", { className: "search-bar__no-result", children: message(ubloLang, "no-results", messages) }))] })] })] }));
148
152
  };
149
153
  export default React.memo(SearchBar);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.35.10",
3
+ "version": "1.35.12",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.8.5",
6
6
  "leaflet": "^1.9.1",