@ceed/ads 1.35.0 → 1.35.1

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.
package/dist/index.cjs CHANGED
@@ -7938,34 +7938,34 @@ RadioList.displayName = "RadioList";
7938
7938
  // src/components/SearchBar/SearchBar.tsx
7939
7939
  var React54 = __toESM(require("react"));
7940
7940
  var import_styles = require("@mui/joy/styles");
7941
+ var import_Box5 = __toESM(require("@mui/joy/Box"));
7941
7942
  var import_SearchRounded = __toESM(require("@mui/icons-material/SearchRounded"));
7942
7943
  var import_CloseRounded = __toESM(require("@mui/icons-material/CloseRounded"));
7943
- var SearchBarRoot = (0, import_styles.styled)("div", {
7944
+ var SearchBarRoot = (0, import_styles.styled)(import_Box5.default, {
7944
7945
  name: "SearchBar",
7945
- slot: "root"
7946
- })(({ theme, ownerState }) => {
7947
- const width = `--${theme.cssVarPrefix}-SearchBar-width`;
7948
- return {
7949
- [width]: ownerState.hideSelect ? "220px" : "300px",
7950
- display: "flex",
7951
- flexDirection: "row",
7952
- width: `var(${width})`,
7953
- backgroundColor: theme.vars.palette.background.surface,
7954
- borderRadius: theme.vars.radius.sm,
7955
- border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
7956
- overflow: "hidden"
7957
- };
7958
- });
7946
+ slot: "root",
7947
+ shouldForwardProp: (prop) => prop !== "ownerState"
7948
+ })(({ theme, ownerState }) => ({
7949
+ display: "inline-flex",
7950
+ flexDirection: "row",
7951
+ minWidth: "220px",
7952
+ ...ownerState.showSelect && { maxWidth: "330px" },
7953
+ backgroundColor: theme.vars.palette.background.surface,
7954
+ borderRadius: theme.vars.radius.sm,
7955
+ border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
7956
+ overflow: "hidden",
7957
+ flexShrink: 0
7958
+ }));
7959
7959
  var SearchBar = React54.forwardRef(function SearchBar2(inProps, ref) {
7960
7960
  const props = (0, import_styles.useThemeProps)({ props: inProps, name: "SearchBar" });
7961
- const { hideSelect = false, options, value, onChange, onSearch, ...other } = props;
7961
+ const { showSelect = false, options, placeholder: placeholderProp, value, onChange, onSearch, ...other } = props;
7962
7962
  const [selectVal, setSelectVal] = React54.useState(options?.[0]?.value ?? "");
7963
7963
  const [isHovered, setIsHovered] = React54.useState(false);
7964
- const ownerState = { hideSelect };
7964
+ const ownerState = { showSelect };
7965
7965
  const selectedOption = options?.find((o) => o.value === selectVal);
7966
- const placeholder = selectedOption?.placeholder ?? "";
7966
+ const placeholder = placeholderProp ?? selectedOption?.placeholder ?? "";
7967
7967
  const handleSearch = () => {
7968
- onSearch?.({ selectValue: hideSelect ? void 0 : selectVal, inputValue: value });
7968
+ onSearch?.({ selectValue: showSelect ? selectVal : void 0, inputValue: value });
7969
7969
  };
7970
7970
  const handleClear = () => {
7971
7971
  onChange("");
@@ -7975,7 +7975,7 @@ var SearchBar = React54.forwardRef(function SearchBar2(inProps, ref) {
7975
7975
  handleSearch();
7976
7976
  }
7977
7977
  };
7978
- return /* @__PURE__ */ React54.createElement(SearchBarRoot, { ref, ownerState, ...other }, !hideSelect && options && /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(
7978
+ return /* @__PURE__ */ React54.createElement(SearchBarRoot, { ref, ownerState, ...other }, showSelect && options && /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(
7979
7979
  Select,
7980
7980
  {
7981
7981
  variant: "plain",
@@ -7984,14 +7984,14 @@ var SearchBar = React54.forwardRef(function SearchBar2(inProps, ref) {
7984
7984
  value: selectVal,
7985
7985
  options,
7986
7986
  onChange: (_, newValue) => setSelectVal(newValue),
7987
- sx: { flex: 1, maxWidth: "110px" },
7987
+ sx: { flex: 1, minWidth: "80px", maxWidth: "110px" },
7988
7988
  slotProps: {
7989
7989
  button: {
7990
7990
  style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
7991
7991
  }
7992
7992
  }
7993
7993
  }
7994
- ), /* @__PURE__ */ React54.createElement(Divider, { orientation: "vertical", sx: { height: "16px", alignSelf: "center" } })), /* @__PURE__ */ React54.createElement(
7994
+ ), /* @__PURE__ */ React54.createElement(Divider, { orientation: "vertical", sx: { height: (theme) => theme.spacing(4), alignSelf: "center" } })), /* @__PURE__ */ React54.createElement(
7995
7995
  Input,
7996
7996
  {
7997
7997
  variant: "plain",
package/dist/index.js CHANGED
@@ -7831,34 +7831,34 @@ RadioList.displayName = "RadioList";
7831
7831
  // src/components/SearchBar/SearchBar.tsx
7832
7832
  import * as React54 from "react";
7833
7833
  import { styled as styled28, useThemeProps as useThemeProps9 } from "@mui/joy/styles";
7834
+ import Box2 from "@mui/joy/Box";
7834
7835
  import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
7835
7836
  import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
7836
- var SearchBarRoot = styled28("div", {
7837
+ var SearchBarRoot = styled28(Box2, {
7837
7838
  name: "SearchBar",
7838
- slot: "root"
7839
- })(({ theme, ownerState }) => {
7840
- const width = `--${theme.cssVarPrefix}-SearchBar-width`;
7841
- return {
7842
- [width]: ownerState.hideSelect ? "220px" : "300px",
7843
- display: "flex",
7844
- flexDirection: "row",
7845
- width: `var(${width})`,
7846
- backgroundColor: theme.vars.palette.background.surface,
7847
- borderRadius: theme.vars.radius.sm,
7848
- border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
7849
- overflow: "hidden"
7850
- };
7851
- });
7839
+ slot: "root",
7840
+ shouldForwardProp: (prop) => prop !== "ownerState"
7841
+ })(({ theme, ownerState }) => ({
7842
+ display: "inline-flex",
7843
+ flexDirection: "row",
7844
+ minWidth: "220px",
7845
+ ...ownerState.showSelect && { maxWidth: "330px" },
7846
+ backgroundColor: theme.vars.palette.background.surface,
7847
+ borderRadius: theme.vars.radius.sm,
7848
+ border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
7849
+ overflow: "hidden",
7850
+ flexShrink: 0
7851
+ }));
7852
7852
  var SearchBar = React54.forwardRef(function SearchBar2(inProps, ref) {
7853
7853
  const props = useThemeProps9({ props: inProps, name: "SearchBar" });
7854
- const { hideSelect = false, options, value, onChange, onSearch, ...other } = props;
7854
+ const { showSelect = false, options, placeholder: placeholderProp, value, onChange, onSearch, ...other } = props;
7855
7855
  const [selectVal, setSelectVal] = React54.useState(options?.[0]?.value ?? "");
7856
7856
  const [isHovered, setIsHovered] = React54.useState(false);
7857
- const ownerState = { hideSelect };
7857
+ const ownerState = { showSelect };
7858
7858
  const selectedOption = options?.find((o) => o.value === selectVal);
7859
- const placeholder = selectedOption?.placeholder ?? "";
7859
+ const placeholder = placeholderProp ?? selectedOption?.placeholder ?? "";
7860
7860
  const handleSearch = () => {
7861
- onSearch?.({ selectValue: hideSelect ? void 0 : selectVal, inputValue: value });
7861
+ onSearch?.({ selectValue: showSelect ? selectVal : void 0, inputValue: value });
7862
7862
  };
7863
7863
  const handleClear = () => {
7864
7864
  onChange("");
@@ -7868,7 +7868,7 @@ var SearchBar = React54.forwardRef(function SearchBar2(inProps, ref) {
7868
7868
  handleSearch();
7869
7869
  }
7870
7870
  };
7871
- return /* @__PURE__ */ React54.createElement(SearchBarRoot, { ref, ownerState, ...other }, !hideSelect && options && /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(
7871
+ return /* @__PURE__ */ React54.createElement(SearchBarRoot, { ref, ownerState, ...other }, showSelect && options && /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(
7872
7872
  Select,
7873
7873
  {
7874
7874
  variant: "plain",
@@ -7877,14 +7877,14 @@ var SearchBar = React54.forwardRef(function SearchBar2(inProps, ref) {
7877
7877
  value: selectVal,
7878
7878
  options,
7879
7879
  onChange: (_, newValue) => setSelectVal(newValue),
7880
- sx: { flex: 1, maxWidth: "110px" },
7880
+ sx: { flex: 1, minWidth: "80px", maxWidth: "110px" },
7881
7881
  slotProps: {
7882
7882
  button: {
7883
7883
  style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
7884
7884
  }
7885
7885
  }
7886
7886
  }
7887
- ), /* @__PURE__ */ React54.createElement(Divider, { orientation: "vertical", sx: { height: "16px", alignSelf: "center" } })), /* @__PURE__ */ React54.createElement(
7887
+ ), /* @__PURE__ */ React54.createElement(Divider, { orientation: "vertical", sx: { height: (theme) => theme.spacing(4), alignSelf: "center" } })), /* @__PURE__ */ React54.createElement(
7888
7888
  Input,
7889
7889
  {
7890
7890
  variant: "plain",