@strapi/design-system 2.0.0-rc.23 → 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,
@@ -3144,10 +3148,19 @@ const Combobox = React.forwardRef(
3144
3148
  loading ? /* @__PURE__ */ jsx(Flex, { justifyContent: "center", alignItems: "center", paddingTop: 2, paddingBottom: 2, children: /* @__PURE__ */ jsx(Loader, { small: true, children: loadingMessage }) }) : null,
3145
3149
  /* @__PURE__ */ jsx(Box, { id: intersectionId, width: "100%", height: "1px" })
3146
3150
  ] }),
3147
- creatable ? /* @__PURE__ */ jsx(ComboboxCreateItem, { onPointerUp: handleCreateItemClick, onClick: handleCreateItemClick, asChild: true, children: /* @__PURE__ */ jsx(OptionBox, { children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
3148
- creatableStartIcon && /* @__PURE__ */ jsx(Box, { tag: "span", "aria-hidden": true, display: "inline-flex", children: creatableStartIcon }),
3149
- /* @__PURE__ */ jsx(Typography, { children: createMessage(internalTextValue ?? "") })
3150
- ] }) }) }) : 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
3151
3164
  ] }) }) })
3152
3165
  ]
3153
3166
  }
@@ -3267,7 +3280,18 @@ const ComboboxCreateItem = styled(Combobox$1.CreateItem)`
3267
3280
  }
3268
3281
  &&:hover,
3269
3282
  &&[data-highlighted] {
3270
- 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};
3271
3295
  }
3272
3296
  && > div {
3273
3297
  padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[4]};
@@ -3276,6 +3300,9 @@ const ComboboxCreateItem = styled(Combobox$1.CreateItem)`
3276
3300
  &&[data-highlighted] > div {
3277
3301
  background-color: ${({ theme }) => theme.colors.primary100};
3278
3302
  }
3303
+ &&[data-disabled] > div:hover {
3304
+ background: ${({ theme }) => theme.colors.neutral150};
3305
+ }
3279
3306
  `;
3280
3307
  const ScrollAreaCombobox = styled(ScrollAreaImpl$1)`
3281
3308
  padding: ${({ theme }) => theme.spaces[1]};
@@ -5299,6 +5326,10 @@ const BodyScroll = styled(ScrollAreaImpl$1)`
5299
5326
 
5300
5327
  & > div {
5301
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;
5302
5333
 
5303
5334
  & > div {
5304
5335
  // the scroll area component applies a display: table to the child, which we don't want.