@stokr/components-library 3.0.41 → 3.0.42

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.
@@ -298,7 +298,15 @@ function HeaderView({
298
298
  ] }),
299
299
  /* @__PURE__ */ jsxs(MobileMenu, { isActive: currentActiveMenu === "main", withSidebar, children: [
300
300
  /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(MobileMenuPart, { withPadding: true, children: /* @__PURE__ */ jsx(MenuNav, { mobile: true, children: /* @__PURE__ */ jsxs("ul", { children: [
301
- /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(MobileMenuLink, { to: newPlatformUrl + "/featured-assets", "data-cy": "invest-nav-link", children: "Invest" }) }),
301
+ /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(
302
+ MobileMenuLink,
303
+ {
304
+ to: newPlatformUrl + "/featured-assets",
305
+ "data-cy": "invest-nav-link",
306
+ onClick: () => toggleMenu("main"),
307
+ children: "Invest"
308
+ }
309
+ ) }),
302
310
  /* @__PURE__ */ jsx(
303
311
  RenderSubMenu,
304
312
  {
@@ -323,7 +331,7 @@ function HeaderView({
323
331
  }
324
332
  }
325
333
  ),
326
- /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(MobileMenuLink, { to: newPlatformUrl + "/team", children: "Team" }) })
334
+ /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(MobileMenuLink, { to: newPlatformUrl + "/team", onClick: () => toggleMenu("main"), children: "Team" }) })
327
335
  ] }) }) }) }),
328
336
  hasLoggedInSession(user) ? /* @__PURE__ */ jsxs(Fragment, { children: [
329
337
  !signupFlow && /* @__PURE__ */ jsx(MobileMenuPart, { withPadding: true, flexColumn: true, borderTop: true, children: /* @__PURE__ */ jsx(MenuNav, { mobile: true, children: /* @__PURE__ */ jsx("ul", { children: isAdmin ? /* @__PURE__ */ jsx(Fragment, { children: isVentureDashboard ? /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(stdin_default$1, { to: "/settings", children: "Settings" }) }) : /* @__PURE__ */ jsx(MobileMenuItem, { children: /* @__PURE__ */ jsx(stdin_default$1, { to: getConfig("adminUrl"), onClick: () => toggleMenu("main"), children: "Dashboard" }) }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -97,6 +97,7 @@ const Select = (props) => {
97
97
  multiple = false,
98
98
  menuHeight,
99
99
  selectedLabel = "Selected",
100
+ floatingLabel = true,
100
101
  formatCreateLabel,
101
102
  dataCy,
102
103
  onChange,
@@ -157,9 +158,15 @@ const Select = (props) => {
157
158
  }
158
159
  return options?.find((o) => o.value === value) || null;
159
160
  }, [multiple, creatable, value, options]);
161
+ const hasValue = useMemo(() => {
162
+ if (multiple) return currentValue.length > 0;
163
+ return currentValue != null && currentValue.value !== "";
164
+ }, [multiple, currentValue]);
165
+ const isLabelUp = floatingLabel ? hasFocus || hasValue : Boolean(label);
166
+ const effectivePlaceholder = label ? hasFocus && placeholder ? placeholder : "" : placeholder;
160
167
  return /* @__PURE__ */ jsxs(Wrapper, { children: [
161
168
  /* @__PURE__ */ jsx(IoniconsStyles, {}),
162
- label && /* @__PURE__ */ jsx(Label, { isUp: Boolean(label), active: hasFocus, error: error && touched, htmlFor: id, children: label }),
169
+ label && /* @__PURE__ */ jsx(Label, { isUp: isLabelUp, active: hasFocus, error: error && touched, htmlFor: id, children: label }),
163
170
  /* @__PURE__ */ jsx(
164
171
  SelectComponent,
165
172
  {
@@ -168,7 +175,7 @@ const Select = (props) => {
168
175
  name,
169
176
  options,
170
177
  value: currentValue,
171
- placeholder,
178
+ placeholder: effectivePlaceholder,
172
179
  isMulti: multiple,
173
180
  isDisabled: disabled,
174
181
  isSearchable: search,
@@ -242,6 +249,8 @@ Select.propTypes = {
242
249
  menuHeight: PropTypes.number,
243
250
  /** Heading shown above the chips list in multi mode (default: "Selected"). */
244
251
  selectedLabel: PropTypes.string,
252
+ /** Input-like floating label behavior: label starts in-field, moves up on focus/value. */
253
+ floatingLabel: PropTypes.bool,
245
254
  formatCreateLabel: PropTypes.func,
246
255
  onChange: PropTypes.func,
247
256
  onBlur: PropTypes.func,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokr/components-library",
3
- "version": "3.0.41",
3
+ "version": "3.0.42",
4
4
  "description": "STOKR - Components Library",
5
5
  "author": "Bilal Hodzic <bilal@stokr.io>",
6
6
  "license": "MIT",