@clickhouse/click-ui 0.0.208 → 0.0.210

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.
@@ -7766,6 +7766,80 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7766
7766
  const PopoverArrow = (props) => {
7767
7767
  return /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "10", viewBox: "0 0 30 10", fill: "none", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 -1L15 9L30 -1", strokeWidth: "1.5", strokeLinejoin: "round" }) });
7768
7768
  };
7769
+ const _Container = ({
7770
+ component,
7771
+ alignItems,
7772
+ children,
7773
+ fillWidth = true,
7774
+ gap = "none",
7775
+ grow,
7776
+ shrink,
7777
+ isResponsive,
7778
+ justifyContent = "start",
7779
+ maxWidth,
7780
+ minWidth,
7781
+ orientation = "horizontal",
7782
+ padding = "none",
7783
+ wrap = "nowrap",
7784
+ fillHeight,
7785
+ maxHeight,
7786
+ minHeight,
7787
+ overflow,
7788
+ ...props
7789
+ }, ref) => {
7790
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$d, { ref, as: component ?? "div", $alignItems: alignItems ?? (orientation === "vertical" ? "start" : "center"), $fillWidth: fillWidth, $gapSize: gap, $grow: grow, $shrink: shrink, $isResponsive: isResponsive, $justifyContent: justifyContent, $maxWidth: maxWidth, $minWidth: minWidth, $orientation: orientation, $paddingSize: padding, $wrap: wrap, $fillHeight: fillHeight, $maxHeight: maxHeight, $minHeight: minHeight, $overflow: overflow, "data-testid": "container", ...props, children });
7791
+ };
7792
+ const Wrapper$d = styled.styled.div.withConfig({
7793
+ componentId: "sc-bcplth-0"
7794
+ })(["display:flex;", " ", " ", " flex-wrap:", ";gap:", ";max-width:", ";min-width:", ";padding:", ";width:", ";flex-direction:", ";align-items:", ";justify-content:", ";@media (max-width:", "){width:", ";max-width:", ";flex-direction:", ";}"], ({
7795
+ $grow,
7796
+ $shrink
7797
+ }) => `
7798
+ ${$grow && `flex: ${$grow}`};
7799
+ ${$shrink && `flex-shrink: ${$shrink}`};
7800
+ `, ({
7801
+ $fillHeight,
7802
+ $maxHeight,
7803
+ $minHeight
7804
+ }) => `
7805
+ ${$fillHeight && "height: 100%"};
7806
+ ${$maxHeight && `max-height: ${$maxHeight}`};
7807
+ ${$minHeight && `min-height: ${$minHeight}`};
7808
+ `, ({
7809
+ $overflow
7810
+ }) => `
7811
+ ${$overflow && `overflow: ${$overflow}`};
7812
+ `, ({
7813
+ $wrap = "nowrap"
7814
+ }) => $wrap, ({
7815
+ theme: theme2,
7816
+ $gapSize
7817
+ }) => theme2.click.container.gap[$gapSize], ({
7818
+ $maxWidth
7819
+ }) => $maxWidth ?? "none", ({
7820
+ $minWidth
7821
+ }) => $minWidth ?? "auto", ({
7822
+ theme: theme2,
7823
+ $paddingSize
7824
+ }) => theme2.click.container.space[$paddingSize], ({
7825
+ $fillWidth = true
7826
+ }) => $fillWidth === true ? "100%" : "auto", ({
7827
+ $orientation = "horizontal"
7828
+ }) => $orientation === "horizontal" ? "row" : "column", ({
7829
+ $alignItems = "center"
7830
+ }) => $alignItems, ({
7831
+ $justifyContent = "left"
7832
+ }) => $justifyContent === "start" ? "start" : `${$justifyContent}`, ({
7833
+ theme: theme2
7834
+ }) => theme2.breakpoint.sizes.md, ({
7835
+ $isResponsive = true,
7836
+ $fillWidth = true
7837
+ }) => $isResponsive === true ? "100%" : $fillWidth === true ? "100%" : "auto", ({
7838
+ $isResponsive = true
7839
+ }) => $isResponsive === true ? "none" : "auto", ({
7840
+ $isResponsive = true
7841
+ }) => $isResponsive === true ? "column" : "auto");
7842
+ const Container = React.forwardRef(_Container);
7769
7843
  const mergeRefs = (refs) => (value) => {
7770
7844
  refs.forEach((ref) => {
7771
7845
  if (typeof ref === "function") {
@@ -7789,14 +7863,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7789
7863
  }]), ...props });
7790
7864
  };
7791
7865
  const EllipsisContent = React.forwardRef(_EllipsisContent);
7792
- const LabelContainer$1 = styled.styled.div.withConfig({
7793
- componentId: "sc-1likhxd-0"
7794
- })(["display:grid;grid-template-columns:", ";align-items:center;justify-content:flex-start;width:100%;width:-webkit-fill-available;width:fill-available;width:stretch;gap:", ";"], ({
7795
- $hasIcon,
7796
- $iconDir
7797
- }) => `${$hasIcon && $iconDir === "start" ? "auto " : ""}1fr${$hasIcon && $iconDir === "end" ? " auto" : ""}`, ({
7798
- theme: theme2
7799
- }) => theme2.click.sidebar.navigation.item.default.space.gap);
7800
7866
  const IconWrapper$3 = ({
7801
7867
  icon,
7802
7868
  iconDir = "start",
@@ -7805,10 +7871,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
7805
7871
  height,
7806
7872
  children,
7807
7873
  ellipsisContent = true,
7874
+ gap = "sm",
7808
7875
  ...props
7809
7876
  }) => {
7810
7877
  const TextWrapper2 = ellipsisContent ? EllipsisContent : "div";
7811
- return /* @__PURE__ */ jsxRuntime.jsxs(LabelContainer$1, { $hasIcon: typeof icon === "string", $iconDir: iconDir, ...props, children: [
7878
+ return /* @__PURE__ */ jsxRuntime.jsxs(Container, { orientation: "horizontal", gap, ...props, children: [
7812
7879
  icon && iconDir === "start" && /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { name: icon, size: size2, width, height }),
7813
7880
  /* @__PURE__ */ jsxRuntime.jsx(TextWrapper2, { "data-testid": `${ellipsisContent ? "ellipsed" : "normal"}-icon-wrapper-text`, children }),
7814
7881
  icon && iconDir === "end" && /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { name: icon, size: size2, width, height })
@@ -8367,7 +8434,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
8367
8434
  ...delegated
8368
8435
  }) => {
8369
8436
  const [isVisible, setIsVisible] = React.useState(true);
8370
- return isVisible ? /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$d, { $size: size2, $state: state, $type: type, "data-testid": "click-alert", ...delegated, children: [
8437
+ return isVisible ? /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$c, { $size: size2, $state: state, $type: type, "data-testid": "click-alert", ...delegated, children: [
8371
8438
  dismissible && type === "banner" && /* @__PURE__ */ jsxRuntime.jsx(DismissWrapper$1, {}),
8372
8439
  showIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper$2, { $state: state, $size: size2, $type: type, children: /* @__PURE__ */ jsxRuntime.jsx(StyledIcon, { $size: size2, size: "sm", "aria-hidden": true, name: customIcon || stateIconMap[state] }) }),
8373
8440
  /* @__PURE__ */ jsxRuntime.jsxs(TextWrapper, { $state: state, $size: size2, children: [
@@ -8377,7 +8444,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
8377
8444
  dismissible && /* @__PURE__ */ jsxRuntime.jsx(DismissWrapper$1, { "data-testid": "click-alert-dismiss-button", onClick: () => setIsVisible(false), children: /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { name: "cross", "aria-label": "close" }) })
8378
8445
  ] }) : null;
8379
8446
  };
8380
- const Wrapper$d = styled.styled.div.withConfig({
8447
+ const Wrapper$c = styled.styled.div.withConfig({
8381
8448
  componentId: "sc-1wvczk0-0"
8382
8449
  })(["display:flex;border-radius:", ";justify-content:", ";overflow:hidden;background-color:", ";color:", ";width:100%;"], ({
8383
8450
  $type,
@@ -9231,7 +9298,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
9231
9298
  font: ${theme2.click.avatar.typography.label[$textSize].hover};
9232
9299
  }
9233
9300
  `);
9234
- const Wrapper$c = styled.styled.div.withConfig({
9301
+ const Wrapper$b = styled.styled.div.withConfig({
9235
9302
  componentId: "sc-471xo0-0"
9236
9303
  })(["display:inline-flex;", ""], ({
9237
9304
  $state = "default",
@@ -9288,7 +9355,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
9288
9355
  onClose,
9289
9356
  ellipsisContent = true,
9290
9357
  ...props
9291
- }) => /* @__PURE__ */ jsxRuntime.jsx(Wrapper$c, { $state: state, $size: size2, $type: type, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Content$4, { "data-testid": `${ellipsisContent ? "ellipsed" : "normal"}-badge-content`, children: [
9358
+ }) => /* @__PURE__ */ jsxRuntime.jsx(Wrapper$b, { $state: state, $size: size2, $type: type, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(Content$4, { "data-testid": `${ellipsisContent ? "ellipsed" : "normal"}-badge-content`, children: [
9292
9359
  /* @__PURE__ */ jsxRuntime.jsx(BadgeContent, { as: IconWrapper$3, icon, iconDir, size: size2, $state: state, ellipsisContent, children: text2 }),
9293
9360
  dismissible && /* @__PURE__ */ jsxRuntime.jsx(SvgContainer, { name: "cross", $state: state, as: SvgImage, onClick: onClose, "aria-label": "close" })
9294
9361
  ] }) });
@@ -9303,11 +9370,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
9303
9370
  state = "default",
9304
9371
  title = "Title",
9305
9372
  ...props
9306
- }) => /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$b, { $height: height, $order: order, $size: size2, $spacing: spacing, $state: state, $fillWidth: fillWidth, $maxWidth: maxWidth, ...props, children: [
9373
+ }) => /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$a, { $height: height, $order: order, $size: size2, $spacing: spacing, $state: state, $fillWidth: fillWidth, $maxWidth: maxWidth, ...props, children: [
9307
9374
  /* @__PURE__ */ jsxRuntime.jsx(Label, { $state: state, $size: size2, children: label }),
9308
9375
  /* @__PURE__ */ jsxRuntime.jsx(Title$3, { $state: state, $size: size2, children: title })
9309
9376
  ] });
9310
- const Wrapper$b = styled.styled.div.withConfig({
9377
+ const Wrapper$a = styled.styled.div.withConfig({
9311
9378
  componentId: "sc-u5029o-0"
9312
9379
  })(["display:flex;justify-content:center;box-sizing:border-box;", ""], ({
9313
9380
  $fillWidth = false,
@@ -9534,7 +9601,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
9534
9601
  })(["display:flex;flex-direction:column;align-self:start;gap:", ";flex:1;width:100%;"], ({
9535
9602
  theme: theme2
9536
9603
  }) => theme2.click.card.horizontal.space.gap);
9537
- const Wrapper$a = styled.styled.div.withConfig({
9604
+ const Wrapper$9 = styled.styled.div.withConfig({
9538
9605
  componentId: "sc-1qnbjoa-2"
9539
9606
  })(["display:inline-flex;width:100%;max-width:100%;align-items:center;justify-content:flex-start;", ""], ({
9540
9607
  theme: theme2,
@@ -9640,7 +9707,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
9640
9707
  window.open(infoUrl, "_blank");
9641
9708
  }
9642
9709
  };
9643
- return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$a, { $disabled: disabled, $isSelected: isSelected, $isSelectable: isSelectable, $color: color, tabIndex: 0, onClick: handleClick, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(ContentWrapper, { children: [
9710
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$9, { $disabled: disabled, $isSelected: isSelected, $isSelectable: isSelectable, $color: color, tabIndex: 0, onClick: handleClick, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(ContentWrapper, { children: [
9644
9711
  /* @__PURE__ */ jsxRuntime.jsxs(IconTextContentWrapper, { children: [
9645
9712
  icon && /* @__PURE__ */ jsxRuntime.jsx(CardIcon$1, { name: icon, "aria-hidden": true }),
9646
9713
  /* @__PURE__ */ jsxRuntime.jsxs(Container, { padding: "none", orientation: "vertical", children: [
@@ -9708,80 +9775,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
9708
9775
  }) => $fillWidth && "width: 100%");
9709
9776
  _Text.displayName = "Text";
9710
9777
  const Text = React.forwardRef(_Text);
9711
- const _Container = ({
9712
- component,
9713
- alignItems,
9714
- children,
9715
- fillWidth = true,
9716
- gap = "none",
9717
- grow,
9718
- shrink,
9719
- isResponsive,
9720
- justifyContent = "start",
9721
- maxWidth,
9722
- minWidth,
9723
- orientation = "horizontal",
9724
- padding = "none",
9725
- wrap = "nowrap",
9726
- fillHeight,
9727
- maxHeight,
9728
- minHeight,
9729
- overflow,
9730
- ...props
9731
- }, ref) => {
9732
- return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$9, { ref, as: component ?? "div", $alignItems: alignItems ?? (orientation === "vertical" ? "start" : "center"), $fillWidth: fillWidth, $gapSize: gap, $grow: grow, $shrink: shrink, $isResponsive: isResponsive, $justifyContent: justifyContent, $maxWidth: maxWidth, $minWidth: minWidth, $orientation: orientation, $paddingSize: padding, $wrap: wrap, $fillHeight: fillHeight, $maxHeight: maxHeight, $minHeight: minHeight, $overflow: overflow, "data-testid": "container", ...props, children });
9733
- };
9734
- const Wrapper$9 = styled.styled.div.withConfig({
9735
- componentId: "sc-bcplth-0"
9736
- })(["display:flex;", " ", " ", " flex-wrap:", ";gap:", ";max-width:", ";min-width:", ";padding:", ";width:", ";flex-direction:", ";align-items:", ";justify-content:", ";@media (max-width:", "){width:", ";max-width:", ";flex-direction:", ";}"], ({
9737
- $grow,
9738
- $shrink
9739
- }) => `
9740
- ${$grow && `flex: ${$grow}`};
9741
- ${$shrink && `flex-shrink: ${$shrink}`};
9742
- `, ({
9743
- $fillHeight,
9744
- $maxHeight,
9745
- $minHeight
9746
- }) => `
9747
- ${$fillHeight && "height: 100%"};
9748
- ${$maxHeight && `max-height: ${$maxHeight}`};
9749
- ${$minHeight && `min-height: ${$minHeight}`};
9750
- `, ({
9751
- $overflow
9752
- }) => `
9753
- ${$overflow && `overflow: ${$overflow}`};
9754
- `, ({
9755
- $wrap = "nowrap"
9756
- }) => $wrap, ({
9757
- theme: theme2,
9758
- $gapSize
9759
- }) => theme2.click.container.gap[$gapSize], ({
9760
- $maxWidth
9761
- }) => $maxWidth ?? "none", ({
9762
- $minWidth
9763
- }) => $minWidth ?? "auto", ({
9764
- theme: theme2,
9765
- $paddingSize
9766
- }) => theme2.click.container.space[$paddingSize], ({
9767
- $fillWidth = true
9768
- }) => $fillWidth === true ? "100%" : "auto", ({
9769
- $orientation = "horizontal"
9770
- }) => $orientation === "horizontal" ? "row" : "column", ({
9771
- $alignItems = "center"
9772
- }) => $alignItems, ({
9773
- $justifyContent = "left"
9774
- }) => $justifyContent === "start" ? "start" : `${$justifyContent}`, ({
9775
- theme: theme2
9776
- }) => theme2.breakpoint.sizes.md, ({
9777
- $isResponsive = true,
9778
- $fillWidth = true
9779
- }) => $isResponsive === true ? "100%" : $fillWidth === true ? "100%" : "auto", ({
9780
- $isResponsive = true
9781
- }) => $isResponsive === true ? "none" : "auto", ({
9782
- $isResponsive = true
9783
- }) => $isResponsive === true ? "column" : "auto");
9784
- const Container = React.forwardRef(_Container);
9785
9778
  const TopBadgeWrapper = styled.styled(Container).withConfig({
9786
9779
  componentId: "sc-1d5pqpo-0"
9787
9780
  })(["position:relative;"]);
@@ -14378,7 +14371,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
14378
14371
  };
14379
14372
  const ActionsWrapper = styled.styled.div.withConfig({
14380
14373
  componentId: "sc-6eozxy-0"
14381
- })(["display:flex;justify-content:flex-end;gap:", ";"], (props) => props.theme.click.dialog.space.gap);
14374
+ })(["display:flex;justify-content:flex-end;gap:", ";@media (max-width:", "){flex-direction:column;}"], (props) => props.theme.click.dialog.space.gap, ({
14375
+ theme: theme2
14376
+ }) => theme2.breakpoint.sizes.sm);
14382
14377
  const DialogContent$1 = styled.styled.div.withConfig({
14383
14378
  componentId: "sc-6eozxy-1"
14384
14379
  })(["overflow:hidden;display:flex;flex-direction:column;"]);
@@ -16543,19 +16538,19 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
16543
16538
  }) => theme2.click.dialog.color.opaqueBackground.default, overlayShow);
16544
16539
  const ContentArea = styled.styled($5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2).withConfig({
16545
16540
  componentId: "sc-1wr6otn-2"
16546
- })(["background:", ";border-radius:", ";padding:", " ", ";box-shadow:", ";border:1px solid ", ";width:75%;max-width:670px;position:fixed;top:50%;left:50%;max-height:75%;overflow:auto;transform:translate(-50%,-50%);animation:", " 150ms cubic-bezier(0.16,1,0.3,1);outline:none;"], ({
16541
+ })(["background:", ";border-radius:", ";padding:", ";box-shadow:", ";border:1px solid ", ";width:75%;max-width:670px;position:fixed;top:50%;left:50%;max-height:75%;overflow:auto;transform:translate(-50%,-50%);animation:", " 150ms cubic-bezier(0.16,1,0.3,1);outline:none;@media (max-width:", "){max-height:100%;border-radius:0;width:100%;}"], ({
16547
16542
  theme: theme2
16548
16543
  }) => theme2.click.dialog.color.background.default, ({
16549
16544
  theme: theme2
16550
16545
  }) => theme2.click.dialog.radii.all, ({
16551
16546
  theme: theme2
16552
- }) => theme2.click.dialog.space.y, ({
16553
- theme: theme2
16554
- }) => theme2.click.dialog.space.x, ({
16547
+ }) => `${theme2.click.dialog.space.y} ${theme2.click.dialog.space.x}`, ({
16555
16548
  theme: theme2
16556
16549
  }) => theme2.click.dialog.shadow.default, ({
16557
16550
  theme: theme2
16558
- }) => theme2.click.global.color.stroke.default, contentShow);
16551
+ }) => theme2.click.global.color.stroke.default, contentShow, ({
16552
+ theme: theme2
16553
+ }) => theme2.breakpoint.sizes.sm);
16559
16554
  const TitleArea = styled.styled.div.withConfig({
16560
16555
  componentId: "sc-1wr6otn-3"
16561
16556
  })(["display:flex;justify-content:space-between;align-items:center;min-height:", ";"], ({
@@ -34679,6 +34674,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
34679
34674
  color: ${theme2.click.genericMenu.button.color.label.default};
34680
34675
  cursor: ${$clickable ? "pointer" : "default"}
34681
34676
  `);
34677
+ const SelectItemDescriptionText = styled.styled.div.withConfig({
34678
+ componentId: "sc-oudbwg-14"
34679
+ })(["white-space:normal;[data-disabled] &,[disabled] &{color:inherit;}", " &{display:none;}"], StyledSelectTrigger);
34682
34680
  const OptionContext = React.createContext({
34683
34681
  search: "",
34684
34682
  selectedValues: [],
@@ -37964,7 +37962,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
37964
37962
  children,
37965
37963
  label
37966
37964
  } = valueNode ?? {};
37967
- return /* @__PURE__ */ jsxRuntime.jsx(SelectValueContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(IconWrapper$3, { icon, iconDir, children: label ?? children ?? value }) });
37965
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectValueContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(IconWrapper$3, { icon, iconDir, gap: "xxs", children: label ?? children ?? value }) });
37968
37966
  };
37969
37967
  const useOption = () => {
37970
37968
  const result = React.useContext(OptionContext);
@@ -38223,14 +38221,11 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38223
38221
  options: itemList = [],
38224
38222
  ...groupProps
38225
38223
  } = props2;
38226
- return /* @__PURE__ */ jsxRuntime.jsx(SelectGroup, { ...groupProps, children: itemList.map(({
38227
- label: label2,
38228
- ...itemProps
38229
- }, itemIndex) => {
38224
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectGroup, { ...groupProps, children: itemList.map((itemProps, itemIndex) => {
38230
38225
  if (checkbox) {
38231
- return /* @__PURE__ */ jsxRuntime.jsx(MultiSelectCheckboxItem, { ...itemProps, children: label2 }, `select-${id}-group-${index2}-item-${itemIndex}`);
38226
+ return /* @__PURE__ */ jsxRuntime.jsx(MultiSelectCheckboxItem, { ...itemProps }, `select-${id}-group-${index2}-item-${itemIndex}`);
38232
38227
  }
38233
- return /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { ...itemProps, children: label2 }, `select-${id}-group-${index2}-item-${itemIndex}`);
38228
+ return /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { ...itemProps }, `select-${id}-group-${index2}-item-${itemIndex}`);
38234
38229
  }) }, `select-${id}-group-${index2}`);
38235
38230
  } else {
38236
38231
  if (checkbox) {
@@ -38277,6 +38272,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38277
38272
  disabled = false,
38278
38273
  children,
38279
38274
  label,
38275
+ description,
38280
38276
  separator,
38281
38277
  onSelect: onSelectProp,
38282
38278
  value = "",
@@ -38314,7 +38310,10 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38314
38310
  const isChecked = selectedValues.includes(value);
38315
38311
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
38316
38312
  /* @__PURE__ */ jsxRuntime.jsxs(GenericMenuItem, { ...props, "data-value": value, onClick: onSelectValue, onMouseOver, ref: forwardedRef, "data-state": isChecked ? "checked" : "unchecked", "data-disabled": disabled ? true : void 0, "data-highlighted": highlighted == value ? "true" : void 0, "cui-select-item": "", children: [
38317
- /* @__PURE__ */ jsxRuntime.jsx(IconWrapper$3, { icon, iconDir, children: label ?? children }),
38313
+ /* @__PURE__ */ jsxRuntime.jsx(IconWrapper$3, { icon, iconDir, gap: "xxs", children: label ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
38314
+ label,
38315
+ description && /* @__PURE__ */ jsxRuntime.jsx(SelectItemDescription, { children: description })
38316
+ ] }) : children }),
38318
38317
  /* @__PURE__ */ jsxRuntime.jsx(CheckIcon$1, { as: SvgImage, name: "check", size: "sm", $showCheck: isChecked })
38319
38318
  ] }),
38320
38319
  separator && /* @__PURE__ */ jsxRuntime.jsx(Separator, { size: "sm" })
@@ -38327,6 +38326,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38327
38326
  icon,
38328
38327
  iconDir = "end",
38329
38328
  label,
38329
+ description,
38330
38330
  onMouseOver: onMouseOverProp,
38331
38331
  onSelect: onSelectProp,
38332
38332
  separator,
@@ -38341,7 +38341,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38341
38341
  selectedValues,
38342
38342
  onSelect
38343
38343
  } = useOption();
38344
- const handleSelect = (evt) => {
38344
+ const handleMenuItemClick = (evt) => {
38345
38345
  if (!disabled) {
38346
38346
  onSelect(value, void 0, evt);
38347
38347
  if (typeof onSelectProp === "function") {
@@ -38349,15 +38349,6 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38349
38349
  }
38350
38350
  }
38351
38351
  };
38352
- const handleMenuItemClick = (evt) => {
38353
- if (evt.target !== evt.currentTarget) {
38354
- return;
38355
- }
38356
- handleSelect(evt);
38357
- };
38358
- const handleCheckboxClick = (evt) => {
38359
- handleSelect(evt);
38360
- };
38361
38352
  const handleMenuItemMouseOver = (e) => {
38362
38353
  if (onMouseOverProp) {
38363
38354
  onMouseOverProp(e);
@@ -38371,27 +38362,24 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38371
38362
  }
38372
38363
  const isChecked = selectedValues.includes(value);
38373
38364
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
38374
- /* @__PURE__ */ jsxRuntime.jsxs(GenericMenuItem, { ...props, "data-value": value, onClick: handleMenuItemClick, onMouseOver: handleMenuItemMouseOver, ref: forwardedRef, "data-disabled": disabled ? true : void 0, "data-highlighted": highlighted == value ? "true" : void 0, "data-testid": `multi-select-checkbox-${value}`, "cui-select-item": "", children: [
38375
- icon && iconDir === "start" && /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { checked: isChecked, "data-testid": "multi-select-checkbox", disabled, label: label ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
38376
- display: "flex",
38377
- justifyContent: "center"
38378
- }, children: [
38379
- /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { name: icon, size: "sm" }),
38380
- label
38381
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
38382
- display: "flex",
38383
- justifyContent: "center"
38384
- }, children: [
38385
- /* @__PURE__ */ jsxRuntime.jsx(SvgImage, { name: icon, size: "sm" }),
38386
- children
38387
- ] }), onClick: handleCheckboxClick, variant: variant ?? "default" }),
38388
- icon && iconDir === "end" && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper$3, { icon, iconDir: "end", children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { checked: isChecked, "data-testid": "multi-select-checkbox", disabled, label: label ?? children, onClick: handleCheckboxClick, variant: variant ?? "default" }) }),
38389
- !icon && /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { checked: isChecked, "data-testid": "multi-select-checkbox", disabled, label: label ?? children, onClick: handleCheckboxClick, variant: variant ?? "default" })
38390
- ] }),
38365
+ /* @__PURE__ */ jsxRuntime.jsx(GenericMenuItem, { ...props, "data-value": value, onClick: handleMenuItemClick, onMouseOver: handleMenuItemMouseOver, ref: forwardedRef, "data-disabled": disabled ? true : void 0, "data-highlighted": highlighted == value ? "true" : void 0, "data-testid": `multi-select-checkbox-${value}`, "cui-select-item": "", children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { orientation: "horizontal", gap: "xs", children: [
38366
+ /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { checked: isChecked, "data-testid": "multi-select-checkbox", disabled, variant: variant ?? "default" }),
38367
+ /* @__PURE__ */ jsxRuntime.jsx(IconWrapper$3, { icon, iconDir, gap: "xxs", children: label ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
38368
+ label,
38369
+ description && /* @__PURE__ */ jsxRuntime.jsx(SelectItemDescription, { children: description })
38370
+ ] }) : children })
38371
+ ] }) }),
38391
38372
  separator && /* @__PURE__ */ jsxRuntime.jsx(Separator, { size: "sm" })
38392
38373
  ] });
38393
38374
  });
38394
38375
  MultiSelectCheckboxItem.displayName = "Select.Item";
38376
+ const SelectItemDescription = React.forwardRef(({
38377
+ children,
38378
+ ...props
38379
+ }) => {
38380
+ return /* @__PURE__ */ jsxRuntime.jsx(Text, { component: SelectItemDescriptionText, color: "muted", ...props, children });
38381
+ });
38382
+ SelectItemDescription.displayName = "Select.ItemDescription";
38395
38383
  const Select = ({
38396
38384
  value: valueProp,
38397
38385
  defaultValue,
@@ -38439,6 +38427,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38439
38427
  };
38440
38428
  Select.Group = SelectGroup;
38441
38429
  Select.Item = SelectItem;
38430
+ Select.ItemDescription = SelectItemDescription;
38442
38431
  const MultiSelect = ({
38443
38432
  value: valueProp,
38444
38433
  defaultValue,
@@ -38484,6 +38473,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38484
38473
  };
38485
38474
  MultiSelect.Group = SelectGroup;
38486
38475
  MultiSelect.Item = SelectItem;
38476
+ MultiSelect.ItemDescription = SelectItemDescription;
38487
38477
  const CheckboxMultiSelect = ({
38488
38478
  value: valueProp,
38489
38479
  defaultValue,
@@ -38530,6 +38520,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
38530
38520
  };
38531
38521
  CheckboxMultiSelect.Group = SelectGroup;
38532
38522
  CheckboxMultiSelect.Item = MultiSelectCheckboxItem;
38523
+ CheckboxMultiSelect.ItemDescription = SelectItemDescription;
38533
38524
  const $89eedd556c436f6a$var$DEFAULT_ORIENTATION = "horizontal";
38534
38525
  const $89eedd556c436f6a$var$ORIENTATIONS = [
38535
38526
  "horizontal",
@@ -41262,7 +41253,7 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
41262
41253
  `);
41263
41254
  const ToastDescriptionContainer = styled.styled.div.withConfig({
41264
41255
  componentId: "sc-tmc8vl-3"
41265
- })(["display:flex;justify-content:space-between;width:100%;align-items:flex-end;gap:inherit;", ""], ({
41256
+ })(["display:flex;flex-direction:column;justify-content:space-between;width:100%;align-items:flex-end;gap:inherit;", ""], ({
41266
41257
  theme: theme2
41267
41258
  }) => `
41268
41259
  font: ${theme2.click.toast.typography.title.default};
@@ -41306,28 +41297,46 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
41306
41297
  actions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ToastDescriptionContent, { children: actions.map(({
41307
41298
  altText,
41308
41299
  ...btnProps
41309
- }) => /* @__PURE__ */ jsxRuntime.jsx($054eb8030ebde76e$export$e19cd5f9376f8cee, { altText, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...btnProps }) })) })
41300
+ }) => /* @__PURE__ */ jsxRuntime.jsx($054eb8030ebde76e$export$e19cd5f9376f8cee, { altText, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ...btnProps }) }) }, altText)) })
41310
41301
  ] })
41311
41302
  ] });
41312
41303
  };
41313
41304
  const Viewport = styled.styled($054eb8030ebde76e$export$d5c6c08dc2d3ca7).withConfig({
41314
41305
  componentId: "sc-tmc8vl-6"
41315
- })(["--viewport-padding:25px;position:fixed;bottom:0;right:0;display:flex;flex-direction:column;padding:var(--viewport-padding);gap:", ";width:", ";max-width:100vw;margin:0;list-style:none;z-index:2147483647;outline:none;"], ({
41306
+ })(["--viewport-padding:25px;position:fixed;bottom:0;", ";display:flex;flex-direction:column;padding:var(--viewport-padding);gap:", ";width:", ";max-width:100vw;margin:0;list-style:none;z-index:2147483647;outline:none;"], ({
41307
+ $align
41308
+ }) => {
41309
+ if ($align === "start") {
41310
+ return "left: 0";
41311
+ }
41312
+ return `
41313
+ right: 0;
41314
+ `;
41315
+ }, ({
41316
41316
  theme: theme2
41317
41317
  }) => theme2.click.toast.space.gap, ({
41318
41318
  theme: theme2
41319
41319
  }) => theme2.click.toast.size.width);
41320
41320
  const ToastProvider = ({
41321
41321
  children,
41322
+ align = "end",
41322
41323
  ...props
41323
41324
  }) => {
41324
- const [toasts, setToasts] = React.useState(/* @__PURE__ */ new Map());
41325
+ const [toasts, setToasts] = React.useState({
41326
+ start: /* @__PURE__ */ new Map(),
41327
+ end: /* @__PURE__ */ new Map()
41328
+ });
41325
41329
  React.useEffect(() => {
41326
41330
  const listener = (toast) => {
41327
41331
  setToasts((currentToasts) => {
41328
- const newMap = new Map(currentToasts);
41329
- newMap.set((toast == null ? void 0 : toast.id) ?? String(Date.now()), toast);
41330
- return newMap;
41332
+ const alignment = toast.align ?? "end";
41333
+ const newToasts = {
41334
+ ...currentToasts
41335
+ };
41336
+ const map2 = new Map(newToasts[alignment]);
41337
+ map2.set((toast == null ? void 0 : toast.id) ?? String(Date.now()), toast);
41338
+ newToasts[alignment] = map2;
41339
+ return newToasts;
41331
41340
  });
41332
41341
  };
41333
41342
  toastsEventEmitter.on(listener);
@@ -41336,28 +41345,36 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
41336
41345
  const onClose = (id) => (open2) => {
41337
41346
  if (!open2) {
41338
41347
  setToasts((currentToasts) => {
41339
- const newMap = new Map(currentToasts);
41340
- newMap.delete(id);
41341
- return newMap;
41348
+ const newToasts = {
41349
+ ...currentToasts
41350
+ };
41351
+ const map2 = new Map(newToasts[align]);
41352
+ map2.delete(id);
41353
+ newToasts[align] = map2;
41354
+ return newToasts;
41342
41355
  });
41343
41356
  }
41344
41357
  };
41345
41358
  const value = {
41346
- createToast: (toast) => {
41359
+ createToast: (toast, toastAlign = align) => {
41347
41360
  setToasts((currentToasts) => {
41348
- const newMap = new Map(currentToasts);
41349
- newMap.set((toast == null ? void 0 : toast.id) ?? String(Date.now()), toast);
41350
- return newMap;
41361
+ const newToasts = {
41362
+ ...currentToasts
41363
+ };
41364
+ const map2 = new Map(newToasts[toastAlign]);
41365
+ map2.set((toast == null ? void 0 : toast.id) ?? String(Date.now()), toast);
41366
+ newToasts[toastAlign] = map2;
41367
+ return newToasts;
41351
41368
  });
41352
41369
  }
41353
41370
  };
41354
- return /* @__PURE__ */ jsxRuntime.jsxs($054eb8030ebde76e$export$2881499e37b75b9a, { swipeDirection: "right", ...props, children: [
41371
+ return /* @__PURE__ */ jsxRuntime.jsxs($054eb8030ebde76e$export$2881499e37b75b9a, { swipeDirection: align === "start" ? "left" : "right", ...props, children: [
41355
41372
  /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
41356
41373
  children,
41357
- Array.from(toasts).map(([id, toast]) => /* @__PURE__ */ jsxRuntime.jsx(Toast, { ...toast, onClose: onClose(id) }, id))
41374
+ Array.from(toasts[align]).map(([id, toast]) => /* @__PURE__ */ jsxRuntime.jsx(Toast, { ...toast, onClose: onClose(id) }, id))
41358
41375
  ] }),
41359
- /* @__PURE__ */ jsxRuntime.jsx(Viewport, {})
41360
- ] });
41376
+ /* @__PURE__ */ jsxRuntime.jsx(Viewport, { $align: align })
41377
+ ] }, `toast-provider-${align}`);
41361
41378
  };
41362
41379
  function listCacheClear$1() {
41363
41380
  this.__data__ = [];
@@ -50889,6 +50906,8 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
50889
50906
  exports2.TextAreaField = TextAreaField;
50890
50907
  exports2.TextField = TextField;
50891
50908
  exports2.Title = Title$2;
50909
+ exports2.Toast = Toast;
50910
+ exports2.ToastProvider = ToastProvider;
50892
50911
  exports2.Tooltip = Tooltip;
50893
50912
  exports2.VerticalStepper = VerticalStepper;
50894
50913
  exports2.WarningAlert = WarningAlert;
@@ -1,12 +1,12 @@
1
1
  import { TooltipProviderProps } from '@radix-ui/react-tooltip';
2
- import { ToastProps } from '@radix-ui/react-toast';
2
+ import { ToastProviderProps } from '../Toast/Toast';
3
3
  import { ThemeName } from '../../theme';
4
4
  import { ReactNode } from 'react';
5
5
 
6
6
  interface Props {
7
7
  config?: {
8
8
  tooltip?: Omit<TooltipProviderProps, "children">;
9
- toast?: Omit<ToastProps, "children">;
9
+ toast?: Omit<ToastProviderProps, "children">;
10
10
  };
11
11
  theme: ThemeName;
12
12
  children: ReactNode;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { HorizontalDirection, IconName } from '..';
3
+ import { GapOptions } from '../Container/Container';
3
4
  import { IconSize } from '../Icon/types';
4
5
 
5
6
  interface IconWrapperProps {
@@ -10,6 +11,7 @@ interface IconWrapperProps {
10
11
  height?: number | string;
11
12
  children: ReactNode;
12
13
  ellipsisContent?: boolean;
14
+ gap?: GapOptions;
13
15
  }
14
- declare const IconWrapper: ({ icon, iconDir, size, width, height, children, ellipsisContent, ...props }: IconWrapperProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const IconWrapper: ({ icon, iconDir, size, width, height, children, ellipsisContent, gap, ...props }: IconWrapperProps) => import("react/jsx-runtime").JSX.Element;
15
17
  export default IconWrapper;
@@ -7,4 +7,5 @@ export declare const CheckboxMultiSelect: {
7
7
  ({ value: valueProp, defaultValue, onSelect: onSelectProp, options, children, onOpenChange: onOpenChangeProp, selectLabel, ...props }: CheckboxMultiSelectProps): import("react/jsx-runtime").JSX.Element;
8
8
  Group: import('react').ForwardRefExoticComponent<import('./common/types').SelectGroupProps & import('react').RefAttributes<HTMLDivElement>>;
9
9
  Item: import('react').ForwardRefExoticComponent<import('./common/InternalSelect').MultiSelectCheckboxItemProps & import('react').RefAttributes<HTMLDivElement>>;
10
+ ItemDescription: import('react').ForwardRefExoticComponent<import('..').TextProps<"p"> & import('react').RefAttributes<HTMLDivElement>>;
10
11
  };
@@ -12,4 +12,5 @@ export declare const MultiSelect: {
12
12
  ({ value: valueProp, defaultValue, onSelect: onSelectProp, options, children, onOpenChange: onOpenChangeProp, ...props }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
13
13
  Group: import('react').ForwardRefExoticComponent<import('./common/types').SelectGroupProps & import('react').RefAttributes<HTMLDivElement>>;
14
14
  Item: import('react').ForwardRefExoticComponent<import('./common/types').SelectItemProps & import('react').RefAttributes<HTMLDivElement>>;
15
+ ItemDescription: import('react').ForwardRefExoticComponent<import('..').TextProps<"p"> & import('react').RefAttributes<HTMLDivElement>>;
15
16
  };
@@ -14,4 +14,5 @@ export declare const Select: {
14
14
  ({ value: valueProp, defaultValue, onSelect: onSelectProp, options, children, onOpenChange: onOpenChangeProp, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
15
15
  Group: import('react').ForwardRefExoticComponent<import('./common/types').SelectGroupProps & import('react').RefAttributes<HTMLDivElement>>;
16
16
  Item: import('react').ForwardRefExoticComponent<import('./common/types').SelectItemProps & import('react').RefAttributes<HTMLDivElement>>;
17
+ ItemDescription: import('react').ForwardRefExoticComponent<import('..').TextProps<"p"> & import('react').RefAttributes<HTMLDivElement>>;
17
18
  };
@@ -1,5 +1,5 @@
1
1
  import { SelectContainerProps, SelectGroupProps, SelectItemProps } from './types';
2
- import { CheckboxVariants } from '../..';
2
+ import { CheckboxVariants, TextProps } from '../..';
3
3
 
4
4
  export declare const InternalSelect: ({ label, children, orientation, dir, disabled, id, error, value: selectedValues, onChange, onSelect, open, onOpenChange, name, form, allowCreateOption, customText, options, sortable, placeholder, multiple, checkbox, selectLabel, showSearch, container, useFullWidthItems, itemCharacterLimit, ...props }: SelectContainerProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export declare const SelectGroup: import('react').ForwardRefExoticComponent<SelectGroupProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -8,3 +8,4 @@ export type MultiSelectCheckboxItemProps = SelectItemProps & {
8
8
  variant?: CheckboxVariants;
9
9
  };
10
10
  export declare const MultiSelectCheckboxItem: import('react').ForwardRefExoticComponent<MultiSelectCheckboxItemProps & import('react').RefAttributes<HTMLDivElement>>;
11
+ export declare const SelectItemDescription: import('react').ForwardRefExoticComponent<TextProps<"p"> & import('react').RefAttributes<HTMLDivElement>>;
@@ -29,3 +29,4 @@ export declare const SelectGroupContent: import('styled-components/dist/types').
29
29
  export declare const SelectNoDataContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
30
30
  $clickable: boolean;
31
31
  }>> & string;
32
+ export declare const SelectItemDescriptionText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;