@strapi/design-system 2.0.0-rc.22 → 2.0.0-rc.24

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.mjs CHANGED
@@ -2875,11 +2875,14 @@ const CarouselImage = (props) => {
2875
2875
  }
2876
2876
  return /* @__PURE__ */ jsx(StyledImage, { tag: "img", height: "100%", maxWidth: "100%", ...props, onError: handleImageError });
2877
2877
  };
2878
+ const CarouselSlideFlex = styled(Flex)`
2879
+ display: ${({ $selected }) => $selected ? "flex" : "none"};
2880
+ `;
2878
2881
  const CarouselSlide = ({ label, children, selected = false, ...props }) => /* @__PURE__ */ jsx(
2879
- Flex,
2882
+ CarouselSlideFlex,
2880
2883
  {
2884
+ $selected: selected,
2881
2885
  alignItems: "center",
2882
- display: selected ? "flex" : "none",
2883
2886
  role: "group",
2884
2887
  "aria-roledescription": "slide",
2885
2888
  "aria-label": label,
@@ -2973,6 +2976,7 @@ const Combobox = React.forwardRef(
2973
2976
  className,
2974
2977
  clearLabel = "Clear",
2975
2978
  creatable = false,
2979
+ creatableDisabled = false,
2976
2980
  creatableStartIcon,
2977
2981
  createMessage = (value2) => `Create "${value2}"`,
2978
2982
  defaultFilterValue,
@@ -3061,6 +3065,7 @@ const Combobox = React.forwardRef(
3061
3065
  onCreateOption(internalTextValue);
3062
3066
  } else if (onCreateOption && creatable === "visible") {
3063
3067
  onCreateOption();
3068
+ setInternalIsOpen(false);
3064
3069
  }
3065
3070
  };
3066
3071
  const generatedIntersectionId = useId();
@@ -3143,10 +3148,19 @@ const Combobox = React.forwardRef(
3143
3148
  loading ? /* @__PURE__ */ jsx(Flex, { justifyContent: "center", alignItems: "center", paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Loader, { small: true, children: loadingMessage }) }) : null,
3144
3149
  /* @__PURE__ */ jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
3145
3150
  ] }),
3146
- creatable ? /* @__PURE__ */ jsx(ComboboxCreateItem, { onPointerUp: handleCreateItemClick, asChild: true, children: /* @__PURE__ */ jsx(OptionBox, { children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
3147
- creatableStartIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, display: "inline-flex", children: creatableStartIcon }),
3148
- /* @__PURE__ */ jsx(Typography, { children: createMessage(internalTextValue ?? "") })
3149
- ] }) }) }) : null
3151
+ creatable ? /* @__PURE__ */ jsx(
3152
+ ComboboxCreateItem,
3153
+ {
3154
+ onPointerUp: handleCreateItemClick,
3155
+ onClick: handleCreateItemClick,
3156
+ disabled: creatableDisabled,
3157
+ asChild: true,
3158
+ children: /* @__PURE__ */ jsx(OptionBox, { children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
3159
+ creatableStartIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, display: "inline-flex", children: creatableStartIcon }),
3160
+ /* @__PURE__ */ jsx(Typography, { children: createMessage(internalTextValue ?? "") })
3161
+ ] }) })
3162
+ }
3163
+ ) : null
3150
3164
  ] }) }) })
3151
3165
  ]
3152
3166
  }
@@ -3266,7 +3280,18 @@ const ComboboxCreateItem = styled(Combobox$1.CreateItem)`
3266
3280
  }
3267
3281
  &&:hover,
3268
3282
  &&[data-highlighted] {
3269
- background-color: transparent;
3283
+ background: ${({ theme }) => theme.colors.neutral0};
3284
+ }
3285
+ &&[data-disabled] {
3286
+ color: ${({ theme }) => theme.colors.neutral600};
3287
+ background: ${({ theme }) => theme.colors.neutral150};
3288
+ cursor: not-allowed;
3289
+ border-bottom-left-radius: 0;
3290
+ border-bottom-right-radius: 0;
3291
+ }
3292
+ &&[data-disabled]:hover {
3293
+ background: ${({ theme }) => theme.colors.neutral150};
3294
+ color: ${({ theme }) => theme.colors.neutral600};
3270
3295
  }
3271
3296
  && > div {
3272
3297
  padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[4]};
@@ -3275,6 +3300,9 @@ const ComboboxCreateItem = styled(Combobox$1.CreateItem)`
3275
3300
  &&[data-highlighted] > div {
3276
3301
  background-color: ${({ theme }) => theme.colors.primary100};
3277
3302
  }
3303
+ &&[data-disabled] > div:hover {
3304
+ background: ${({ theme }) => theme.colors.neutral150};
3305
+ }
3278
3306
  `;
3279
3307
  const ScrollAreaCombobox = styled(ScrollAreaImpl$1)`
3280
3308
  padding: ${({ theme }) => theme.spaces[1]};
@@ -5298,6 +5326,10 @@ const BodyScroll = styled(ScrollAreaImpl$1)`
5298
5326
 
5299
5327
  & > div {
5300
5328
  padding-block: ${(props) => props.theme.spaces[8]};
5329
+ /* Add negative margin and padding to avoid cropping the box shadow when the inputs are focused */
5330
+ margin: 0 -2px 0 -2px;
5331
+ padding-left: 2px;
5332
+ padding-right: 2px;
5301
5333
 
5302
5334
  & > div {
5303
5335
  // the scroll area component applies a display: table to the child, which we don't want.