@ceed/cds 1.34.0 → 1.34.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
@@ -6978,34 +6978,34 @@ RadioList.displayName = "RadioList";
6978
6978
  // src/components/SearchBar/SearchBar.tsx
6979
6979
  var React43 = __toESM(require("react"));
6980
6980
  var import_styles = require("@mui/joy/styles");
6981
+ var import_Box5 = __toESM(require("@mui/joy/Box"));
6981
6982
  var import_SearchRounded = __toESM(require("@mui/icons-material/SearchRounded"));
6982
6983
  var import_CloseRounded = __toESM(require("@mui/icons-material/CloseRounded"));
6983
- var SearchBarRoot = (0, import_styles.styled)("div", {
6984
+ var SearchBarRoot = (0, import_styles.styled)(import_Box5.default, {
6984
6985
  name: "SearchBar",
6985
- slot: "root"
6986
- })(({ theme, ownerState }) => {
6987
- const width = `--${theme.cssVarPrefix}-SearchBar-width`;
6988
- return {
6989
- [width]: ownerState.hideSelect ? "220px" : "300px",
6990
- display: "flex",
6991
- flexDirection: "row",
6992
- width: `var(${width})`,
6993
- backgroundColor: theme.vars.palette.background.surface,
6994
- borderRadius: theme.vars.radius.sm,
6995
- border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
6996
- overflow: "hidden"
6997
- };
6998
- });
6986
+ slot: "root",
6987
+ shouldForwardProp: (prop) => prop !== "ownerState"
6988
+ })(({ theme, ownerState }) => ({
6989
+ display: "inline-flex",
6990
+ flexDirection: "row",
6991
+ minWidth: "220px",
6992
+ ...ownerState.showSelect && { maxWidth: "330px" },
6993
+ backgroundColor: theme.vars.palette.background.surface,
6994
+ borderRadius: theme.vars.radius.sm,
6995
+ border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
6996
+ overflow: "hidden",
6997
+ flexShrink: 0
6998
+ }));
6999
6999
  var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
7000
7000
  const props = (0, import_styles.useThemeProps)({ props: inProps, name: "SearchBar" });
7001
- const { hideSelect = false, options, value, onChange, onSearch, ...other } = props;
7001
+ const { showSelect = false, options, placeholder: placeholderProp, value, onChange, onSearch, ...other } = props;
7002
7002
  const [selectVal, setSelectVal] = React43.useState(options?.[0]?.value ?? "");
7003
7003
  const [isHovered, setIsHovered] = React43.useState(false);
7004
- const ownerState = { hideSelect };
7004
+ const ownerState = { showSelect };
7005
7005
  const selectedOption = options?.find((o) => o.value === selectVal);
7006
- const placeholder = selectedOption?.placeholder ?? "";
7006
+ const placeholder = placeholderProp ?? selectedOption?.placeholder ?? "";
7007
7007
  const handleSearch = () => {
7008
- onSearch?.({ selectValue: hideSelect ? void 0 : selectVal, inputValue: value });
7008
+ onSearch?.({ selectValue: showSelect ? selectVal : void 0, inputValue: value });
7009
7009
  };
7010
7010
  const handleClear = () => {
7011
7011
  onChange("");
@@ -7015,7 +7015,7 @@ var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
7015
7015
  handleSearch();
7016
7016
  }
7017
7017
  };
7018
- return /* @__PURE__ */ React43.createElement(SearchBarRoot, { ref, ownerState, ...other }, !hideSelect && options && /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
7018
+ return /* @__PURE__ */ React43.createElement(SearchBarRoot, { ref, ownerState, ...other }, showSelect && options && /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
7019
7019
  Select,
7020
7020
  {
7021
7021
  variant: "plain",
@@ -7024,14 +7024,14 @@ var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
7024
7024
  value: selectVal,
7025
7025
  options,
7026
7026
  onChange: (_, newValue) => setSelectVal(newValue),
7027
- sx: { flex: 1, maxWidth: "110px" },
7027
+ sx: { flex: 1, minWidth: "80px", maxWidth: "110px" },
7028
7028
  slotProps: {
7029
7029
  button: {
7030
7030
  style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
7031
7031
  }
7032
7032
  }
7033
7033
  }
7034
- ), /* @__PURE__ */ React43.createElement(Divider, { orientation: "vertical", sx: { height: "16px", alignSelf: "center" } })), /* @__PURE__ */ React43.createElement(
7034
+ ), /* @__PURE__ */ React43.createElement(Divider, { orientation: "vertical", sx: { height: (theme) => theme.spacing(4), alignSelf: "center" } })), /* @__PURE__ */ React43.createElement(
7035
7035
  Input,
7036
7036
  {
7037
7037
  variant: "plain",
package/dist/index.js CHANGED
@@ -6879,34 +6879,34 @@ RadioList.displayName = "RadioList";
6879
6879
  // src/components/SearchBar/SearchBar.tsx
6880
6880
  import * as React43 from "react";
6881
6881
  import { styled as styled27, useThemeProps as useThemeProps9 } from "@mui/joy/styles";
6882
+ import Box2 from "@mui/joy/Box";
6882
6883
  import SearchRoundedIcon from "@mui/icons-material/SearchRounded";
6883
6884
  import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
6884
- var SearchBarRoot = styled27("div", {
6885
+ var SearchBarRoot = styled27(Box2, {
6885
6886
  name: "SearchBar",
6886
- slot: "root"
6887
- })(({ theme, ownerState }) => {
6888
- const width = `--${theme.cssVarPrefix}-SearchBar-width`;
6889
- return {
6890
- [width]: ownerState.hideSelect ? "220px" : "300px",
6891
- display: "flex",
6892
- flexDirection: "row",
6893
- width: `var(${width})`,
6894
- backgroundColor: theme.vars.palette.background.surface,
6895
- borderRadius: theme.vars.radius.sm,
6896
- border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
6897
- overflow: "hidden"
6898
- };
6899
- });
6887
+ slot: "root",
6888
+ shouldForwardProp: (prop) => prop !== "ownerState"
6889
+ })(({ theme, ownerState }) => ({
6890
+ display: "inline-flex",
6891
+ flexDirection: "row",
6892
+ minWidth: "220px",
6893
+ ...ownerState.showSelect && { maxWidth: "330px" },
6894
+ backgroundColor: theme.vars.palette.background.surface,
6895
+ borderRadius: theme.vars.radius.sm,
6896
+ border: `1px solid ${theme.vars.palette.neutral.outlinedBorder}`,
6897
+ overflow: "hidden",
6898
+ flexShrink: 0
6899
+ }));
6900
6900
  var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
6901
6901
  const props = useThemeProps9({ props: inProps, name: "SearchBar" });
6902
- const { hideSelect = false, options, value, onChange, onSearch, ...other } = props;
6902
+ const { showSelect = false, options, placeholder: placeholderProp, value, onChange, onSearch, ...other } = props;
6903
6903
  const [selectVal, setSelectVal] = React43.useState(options?.[0]?.value ?? "");
6904
6904
  const [isHovered, setIsHovered] = React43.useState(false);
6905
- const ownerState = { hideSelect };
6905
+ const ownerState = { showSelect };
6906
6906
  const selectedOption = options?.find((o) => o.value === selectVal);
6907
- const placeholder = selectedOption?.placeholder ?? "";
6907
+ const placeholder = placeholderProp ?? selectedOption?.placeholder ?? "";
6908
6908
  const handleSearch = () => {
6909
- onSearch?.({ selectValue: hideSelect ? void 0 : selectVal, inputValue: value });
6909
+ onSearch?.({ selectValue: showSelect ? selectVal : void 0, inputValue: value });
6910
6910
  };
6911
6911
  const handleClear = () => {
6912
6912
  onChange("");
@@ -6916,7 +6916,7 @@ var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
6916
6916
  handleSearch();
6917
6917
  }
6918
6918
  };
6919
- return /* @__PURE__ */ React43.createElement(SearchBarRoot, { ref, ownerState, ...other }, !hideSelect && options && /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
6919
+ return /* @__PURE__ */ React43.createElement(SearchBarRoot, { ref, ownerState, ...other }, showSelect && options && /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement(
6920
6920
  Select,
6921
6921
  {
6922
6922
  variant: "plain",
@@ -6925,14 +6925,14 @@ var SearchBar = React43.forwardRef(function SearchBar2(inProps, ref) {
6925
6925
  value: selectVal,
6926
6926
  options,
6927
6927
  onChange: (_, newValue) => setSelectVal(newValue),
6928
- sx: { flex: 1, maxWidth: "110px" },
6928
+ sx: { flex: 1, minWidth: "80px", maxWidth: "110px" },
6929
6929
  slotProps: {
6930
6930
  button: {
6931
6931
  style: { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }
6932
6932
  }
6933
6933
  }
6934
6934
  }
6935
- ), /* @__PURE__ */ React43.createElement(Divider, { orientation: "vertical", sx: { height: "16px", alignSelf: "center" } })), /* @__PURE__ */ React43.createElement(
6935
+ ), /* @__PURE__ */ React43.createElement(Divider, { orientation: "vertical", sx: { height: (theme) => theme.spacing(4), alignSelf: "center" } })), /* @__PURE__ */ React43.createElement(
6936
6936
  Input,
6937
6937
  {
6938
6938
  variant: "plain",