@clickhouse/click-ui 0.0.141 → 0.0.143

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.
@@ -2281,7 +2281,7 @@ const FormElementContainer = styled.div.withConfig({
2281
2281
  })(["display:flex;flex-direction:column;align-items:flex-start;width:100%;width:-webkit-fill-available;width:fill-available;width:stretch;gap:", ";"], ({
2282
2282
  theme: theme2
2283
2283
  }) => theme2.click.field.space.gap);
2284
- const EllipsisContainer$2 = styled.span.withConfig({
2284
+ styled.span.withConfig({
2285
2285
  componentId: "sc-1sddmxu-8"
2286
2286
  })(["display:flex;white-space:nowrap;overflow:hidden;justify-content:flex-end;gap:inherit;& > *:not(button){overflow:hidden;text-overflow:ellipsis;}"]);
2287
2287
  const FlagList = {
@@ -9903,7 +9903,7 @@ const SvgContainer = styled.svg.withConfig({
9903
9903
  height: ${theme2.click.badge.icon[$size].size.height};
9904
9904
  width: ${theme2.click.badge.icon[$size].size.width};
9905
9905
  `);
9906
- const BadgeContent = styled(EllipsisContainer$2).withConfig({
9906
+ const BadgeContent = styled.div.withConfig({
9907
9907
  componentId: "sc-471xo0-3"
9908
9908
  })(["width:auto;overflow:hidden;svg{", "}"], ({
9909
9909
  $state = "default",
@@ -10291,7 +10291,101 @@ const CardSecondary = ({
10291
10291
  ] })
10292
10292
  ] });
10293
10293
  };
10294
+ const _Container = ({
10295
+ component,
10296
+ alignItems,
10297
+ children,
10298
+ fillWidth = true,
10299
+ gap = "none",
10300
+ grow,
10301
+ shrink,
10302
+ isResponsive,
10303
+ justifyContent = "start",
10304
+ maxWidth,
10305
+ minWidth,
10306
+ orientation = "horizontal",
10307
+ padding = "none",
10308
+ wrap = "nowrap",
10309
+ fillHeight,
10310
+ maxHeight,
10311
+ minHeight,
10312
+ overflow,
10313
+ ...props
10314
+ }, ref) => {
10315
+ return /* @__PURE__ */ jsxRuntimeExports.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 });
10316
+ };
10294
10317
  const Wrapper$9 = styled.div.withConfig({
10318
+ componentId: "sc-bcplth-0"
10319
+ })(["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:", ";}"], ({
10320
+ $grow,
10321
+ $shrink
10322
+ }) => `
10323
+ ${$grow && `flex: ${$grow}`};
10324
+ ${$shrink && `flex-shrink: ${$shrink}`};
10325
+ `, ({
10326
+ $fillHeight,
10327
+ $maxHeight,
10328
+ $minHeight
10329
+ }) => `
10330
+ ${$fillHeight && "height: 100%"};
10331
+ ${$maxHeight && `max-height: ${$maxHeight}`};
10332
+ ${$minHeight && `min-height: ${$minHeight}`};
10333
+ `, ({
10334
+ $overflow
10335
+ }) => `
10336
+ ${$overflow && `overflow: ${$overflow}`};
10337
+ `, ({
10338
+ $wrap = "nowrap"
10339
+ }) => $wrap, ({
10340
+ theme: theme2,
10341
+ $gapSize
10342
+ }) => theme2.click.container.gap[$gapSize], ({
10343
+ $maxWidth
10344
+ }) => $maxWidth ?? "none", ({
10345
+ $minWidth
10346
+ }) => $minWidth ?? "none", ({
10347
+ theme: theme2,
10348
+ $paddingSize
10349
+ }) => theme2.click.container.space[$paddingSize], ({
10350
+ $fillWidth = true
10351
+ }) => $fillWidth === true ? "100%" : "auto", ({
10352
+ $orientation = "horizontal"
10353
+ }) => $orientation === "horizontal" ? "row" : "column", ({
10354
+ $alignItems = "center"
10355
+ }) => $alignItems, ({
10356
+ $justifyContent = "left"
10357
+ }) => $justifyContent === "start" ? "start" : `${$justifyContent}`, ({
10358
+ theme: theme2
10359
+ }) => theme2.breakpoint.sizes.md, ({
10360
+ $isResponsive = true,
10361
+ $fillWidth = true
10362
+ }) => $isResponsive === true ? "100%" : $fillWidth === true ? "100%" : "auto", ({
10363
+ $isResponsive = true
10364
+ }) => $isResponsive === true ? "none" : "auto", ({
10365
+ $isResponsive = true
10366
+ }) => $isResponsive === true ? "column" : "auto");
10367
+ const Container = forwardRef(_Container);
10368
+ const TopBadgeWrapper = styled(Container).withConfig({
10369
+ componentId: "sc-1d5pqpo-0"
10370
+ })(["position:relative;"]);
10371
+ const CardPrimaryTopBadge = styled(Badge).withConfig({
10372
+ componentId: "sc-1d5pqpo-1"
10373
+ })(["position:absolute;top:0;left:50%;transform:translate(-50%,-50%);", " div:active + &{border-color:", ";}"], ({
10374
+ $isSelected,
10375
+ theme: theme2
10376
+ }) => $isSelected ? `border-color: ${theme2.click.button.basic.color.primary.stroke.active};` : "", ({
10377
+ theme: theme2
10378
+ }) => theme2.click.button.basic.color.primary.stroke.active);
10379
+ const withTopBadge = (Component2) => ({
10380
+ topBadgeText,
10381
+ ...props
10382
+ }) => {
10383
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(TopBadgeWrapper, { alignItems: "stretch", fillWidth: true, children: [
10384
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Component2, { ...props }),
10385
+ topBadgeText && /* @__PURE__ */ jsxRuntimeExports.jsx(CardPrimaryTopBadge, { "data-testid": "card-top-badge", text: topBadgeText, $isSelected: props.isSelected || false })
10386
+ ] });
10387
+ };
10388
+ const Wrapper$8 = styled.div.withConfig({
10295
10389
  componentId: "sc-2dguvi-0"
10296
10390
  })(["background-color:", ";border-radius:", ";border:", ";display:flex;width:100%;max-width:100%;text-align:", ";flex-direction:column;padding:", ";gap:", ";box-shadow:", ";&:hover,&:focus{background-color:", ";cursor:pointer;button{background-color:", ";border-color:", ";&:active{background-color:", ";border-color:", ";}}}&:active{border-color:", ';}&[aria-disabled="true"],&[aria-disabled="true"]:hover,&[aria-disabled="true"]:focus,&[aria-disabled="true"]:active{', "}", ""], ({
10297
10391
  theme: theme2
@@ -10372,7 +10466,7 @@ const convertCardAlignToTextAlign = (align) => {
10372
10466
  }
10373
10467
  return align === "start" ? "left" : "right";
10374
10468
  };
10375
- const CardPrimary = ({
10469
+ const Card = ({
10376
10470
  alignContent,
10377
10471
  title,
10378
10472
  icon,
@@ -10396,7 +10490,7 @@ const CardPrimary = ({
10396
10490
  }
10397
10491
  };
10398
10492
  const Component2 = !!infoUrl || typeof onButtonClick === "function" ? Button : "div";
10399
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$9, { $alignContent: alignContent, $hasShadow: hasShadow, $size: size2, "aria-disabled": disabled, $isSelected: isSelected, tabIndex: 0, ...props, children: [
10493
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$8, { $alignContent: alignContent, $hasShadow: hasShadow, $size: size2, "aria-disabled": disabled, $isSelected: isSelected, tabIndex: 0, ...props, children: [
10400
10494
  (icon || title) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Header$3, { $size: size2, $disabled: disabled, $alignContent: alignContent, children: [
10401
10495
  icon && /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: icon, "aria-hidden": true }),
10402
10496
  title && /* @__PURE__ */ jsxRuntimeExports.jsx(Title$2, { type: "h3", children: title })
@@ -10409,6 +10503,7 @@ const CardPrimary = ({
10409
10503
  infoText && /* @__PURE__ */ jsxRuntimeExports.jsx(Component2, { onClick: handleClick, disabled, children: infoText })
10410
10504
  ] });
10411
10505
  };
10506
+ const CardPrimary = withTopBadge(Card);
10412
10507
  const Header$2 = styled.div.withConfig({
10413
10508
  componentId: "sc-1qnbjoa-0"
10414
10509
  })(["display:flex;flex-direction:column;align-items:center;width:fit-content;max-width:100%;gap:inherit;"]);
@@ -10417,7 +10512,7 @@ const Description = styled.div.withConfig({
10417
10512
  })(["display:flex;flex-direction:column;align-self:center;gap:", ";flex:1;"], ({
10418
10513
  theme: theme2
10419
10514
  }) => theme2.click.card.horizontal.space.gap);
10420
- const Wrapper$8 = styled.div.withConfig({
10515
+ const Wrapper$7 = styled.div.withConfig({
10421
10516
  componentId: "sc-1qnbjoa-2"
10422
10517
  })(["display:inline-flex;width:100%;max-width:100%;align-items:center;justify-content:flex-start;", ""], ({
10423
10518
  theme: theme2,
@@ -10496,7 +10591,7 @@ const CardHorizontal = ({
10496
10591
  color = "default",
10497
10592
  ...props
10498
10593
  }) => {
10499
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$8, { $disabled: disabled, $isSelected: isSelected, $color: color, tabIndex: 0, ...props, children: [
10594
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$7, { $disabled: disabled, $isSelected: isSelected, $color: color, tabIndex: 0, ...props, children: [
10500
10595
  icon && /* @__PURE__ */ jsxRuntimeExports.jsx(CardIcon$1, { name: icon, "aria-hidden": true }),
10501
10596
  /* @__PURE__ */ jsxRuntimeExports.jsxs(ContentWrapper, { children: [
10502
10597
  title && /* @__PURE__ */ jsxRuntimeExports.jsx(Header$2, { children: title }),
@@ -10520,7 +10615,7 @@ const Background = styled.div.withConfig({
10520
10615
  background: ${theme2.click.card.promotion.color.stroke.focus};
10521
10616
  }
10522
10617
  `);
10523
- const Wrapper$7 = styled.div.withConfig({
10618
+ const Wrapper$6 = styled.div.withConfig({
10524
10619
  componentId: "sc-6jamj6-1"
10525
10620
  })(["display:flex;width:100%;align-items:center;justify-content:flex-start;cursor:pointer;", ""], ({
10526
10621
  theme: theme2
@@ -10561,7 +10656,7 @@ const CardPromotion = ({
10561
10656
  ...props
10562
10657
  }) => {
10563
10658
  const [isVisible, setIsVisible] = useState(true);
10564
- return isVisible ? /* @__PURE__ */ jsxRuntimeExports.jsx(Background, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$7, { $dismissible: dismissible, ...props, children: [
10659
+ return isVisible ? /* @__PURE__ */ jsxRuntimeExports.jsx(Background, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$6, { $dismissible: dismissible, ...props, children: [
10565
10660
  /* @__PURE__ */ jsxRuntimeExports.jsx(CardIcon, { name: icon, "aria-hidden": true }),
10566
10661
  /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { children: label }),
10567
10662
  dismissible && /* @__PURE__ */ jsxRuntimeExports.jsx(DismissWrapper, { "data-testid": "click-alert-dismiss-button", onClick: () => setIsVisible(false), children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: "cross", "aria-label": "close" }) })
@@ -10718,7 +10813,7 @@ function $e698a72e93240346$var$getState(checked) {
10718
10813
  }
10719
10814
  const $e698a72e93240346$export$be92b6f5f03c0fe9 = $e698a72e93240346$export$48513f6b9f8ce62d;
10720
10815
  const $e698a72e93240346$export$adb584737d712b70 = $e698a72e93240346$export$59aad738f51d1c05;
10721
- const Wrapper$6 = styled(FormRoot).withConfig({
10816
+ const Wrapper$5 = styled(FormRoot).withConfig({
10722
10817
  componentId: "sc-1sck1ja-0"
10723
10818
  })(["align-items:center;max-width:fit-content;"]);
10724
10819
  const Checkbox = ({
@@ -10730,7 +10825,7 @@ const Checkbox = ({
10730
10825
  ...delegated
10731
10826
  }) => {
10732
10827
  const defaultId = useId();
10733
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$6, { $orientation: orientation ?? "horizontal", $dir: dir ?? "end", children: [
10828
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$5, { $orientation: orientation ?? "horizontal", $dir: dir ?? "end", children: [
10734
10829
  /* @__PURE__ */ jsxRuntimeExports.jsx(CheckInput, { id: id ?? defaultId, "data-testid": "checkbox", disabled, "aria-label": `${label}`, ...delegated, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CheckIconWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: "check", size: "sm" }) }) }),
10735
10830
  label && /* @__PURE__ */ jsxRuntimeExports.jsx(GenericLabel, { htmlFor: id ?? defaultId, disabled, children: label })
10736
10831
  ] });
@@ -14278,80 +14373,6 @@ const CodeBlock = ({
14278
14373
  }, showLineNumbers, wrapLines: wrap || wrapLines, wrapLongLines: wrap || wrapLines, children })
14279
14374
  ] });
14280
14375
  };
14281
- const _Container = ({
14282
- component,
14283
- alignItems,
14284
- children,
14285
- fillWidth = true,
14286
- gap = "none",
14287
- grow,
14288
- shrink,
14289
- isResponsive,
14290
- justifyContent = "start",
14291
- maxWidth,
14292
- minWidth,
14293
- orientation = "horizontal",
14294
- padding = "none",
14295
- wrap = "nowrap",
14296
- fillHeight,
14297
- maxHeight,
14298
- minHeight,
14299
- overflow,
14300
- ...props
14301
- }, ref) => {
14302
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Wrapper$5, { 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 });
14303
- };
14304
- const Wrapper$5 = styled.div.withConfig({
14305
- componentId: "sc-bcplth-0"
14306
- })(["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:", ";}"], ({
14307
- $grow,
14308
- $shrink
14309
- }) => `
14310
- ${$grow && `flex: ${$grow}`};
14311
- ${$shrink && `flex-shrink: ${$shrink}`};
14312
- `, ({
14313
- $fillHeight,
14314
- $maxHeight,
14315
- $minHeight
14316
- }) => `
14317
- ${$fillHeight && "height: 100%"};
14318
- ${$maxHeight && `max-height: ${$maxHeight}`};
14319
- ${$minHeight && `min-height: ${$minHeight}`};
14320
- `, ({
14321
- $overflow
14322
- }) => `
14323
- ${$overflow && `overflow: ${$overflow}`};
14324
- `, ({
14325
- $wrap = "nowrap"
14326
- }) => $wrap, ({
14327
- theme: theme2,
14328
- $gapSize
14329
- }) => theme2.click.container.gap[$gapSize], ({
14330
- $maxWidth
14331
- }) => $maxWidth ?? "none", ({
14332
- $minWidth
14333
- }) => $minWidth ?? "none", ({
14334
- theme: theme2,
14335
- $paddingSize
14336
- }) => theme2.click.container.space[$paddingSize], ({
14337
- $fillWidth = true
14338
- }) => $fillWidth === true ? "100%" : "auto", ({
14339
- $orientation = "horizontal"
14340
- }) => $orientation === "horizontal" ? "row" : "column", ({
14341
- $alignItems = "center"
14342
- }) => $alignItems, ({
14343
- $justifyContent = "left"
14344
- }) => $justifyContent === "start" ? "start" : `${$justifyContent}`, ({
14345
- theme: theme2
14346
- }) => theme2.breakpoint.sizes.md, ({
14347
- $isResponsive = true,
14348
- $fillWidth = true
14349
- }) => $isResponsive === true ? "100%" : $fillWidth === true ? "100%" : "auto", ({
14350
- $isResponsive = true
14351
- }) => $isResponsive === true ? "none" : "auto", ({
14352
- $isResponsive = true
14353
- }) => $isResponsive === true ? "column" : "auto");
14354
- const Container = forwardRef(_Container);
14355
14376
  const $5d3850c4d0b4e6c7$var$DIALOG_NAME = "Dialog";
14356
14377
  const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
14357
14378
  const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
@@ -2298,7 +2298,7 @@ var __publicField = (obj, key, value) => {
2298
2298
  })(["display:flex;flex-direction:column;align-items:flex-start;width:100%;width:-webkit-fill-available;width:fill-available;width:stretch;gap:", ";"], ({
2299
2299
  theme: theme2
2300
2300
  }) => theme2.click.field.space.gap);
2301
- const EllipsisContainer$2 = styled.span.withConfig({
2301
+ styled.span.withConfig({
2302
2302
  componentId: "sc-1sddmxu-8"
2303
2303
  })(["display:flex;white-space:nowrap;overflow:hidden;justify-content:flex-end;gap:inherit;& > *:not(button){overflow:hidden;text-overflow:ellipsis;}"]);
2304
2304
  const FlagList = {
@@ -9920,7 +9920,7 @@ var __publicField = (obj, key, value) => {
9920
9920
  height: ${theme2.click.badge.icon[$size].size.height};
9921
9921
  width: ${theme2.click.badge.icon[$size].size.width};
9922
9922
  `);
9923
- const BadgeContent = styled(EllipsisContainer$2).withConfig({
9923
+ const BadgeContent = styled.div.withConfig({
9924
9924
  componentId: "sc-471xo0-3"
9925
9925
  })(["width:auto;overflow:hidden;svg{", "}"], ({
9926
9926
  $state = "default",
@@ -10308,7 +10308,101 @@ var __publicField = (obj, key, value) => {
10308
10308
  ] })
10309
10309
  ] });
10310
10310
  };
10311
+ const _Container = ({
10312
+ component,
10313
+ alignItems,
10314
+ children,
10315
+ fillWidth = true,
10316
+ gap = "none",
10317
+ grow,
10318
+ shrink,
10319
+ isResponsive,
10320
+ justifyContent = "start",
10321
+ maxWidth,
10322
+ minWidth,
10323
+ orientation = "horizontal",
10324
+ padding = "none",
10325
+ wrap = "nowrap",
10326
+ fillHeight,
10327
+ maxHeight,
10328
+ minHeight,
10329
+ overflow,
10330
+ ...props
10331
+ }, ref) => {
10332
+ return /* @__PURE__ */ jsxRuntimeExports.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 });
10333
+ };
10311
10334
  const Wrapper$9 = styled.div.withConfig({
10335
+ componentId: "sc-bcplth-0"
10336
+ })(["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:", ";}"], ({
10337
+ $grow,
10338
+ $shrink
10339
+ }) => `
10340
+ ${$grow && `flex: ${$grow}`};
10341
+ ${$shrink && `flex-shrink: ${$shrink}`};
10342
+ `, ({
10343
+ $fillHeight,
10344
+ $maxHeight,
10345
+ $minHeight
10346
+ }) => `
10347
+ ${$fillHeight && "height: 100%"};
10348
+ ${$maxHeight && `max-height: ${$maxHeight}`};
10349
+ ${$minHeight && `min-height: ${$minHeight}`};
10350
+ `, ({
10351
+ $overflow
10352
+ }) => `
10353
+ ${$overflow && `overflow: ${$overflow}`};
10354
+ `, ({
10355
+ $wrap = "nowrap"
10356
+ }) => $wrap, ({
10357
+ theme: theme2,
10358
+ $gapSize
10359
+ }) => theme2.click.container.gap[$gapSize], ({
10360
+ $maxWidth
10361
+ }) => $maxWidth ?? "none", ({
10362
+ $minWidth
10363
+ }) => $minWidth ?? "none", ({
10364
+ theme: theme2,
10365
+ $paddingSize
10366
+ }) => theme2.click.container.space[$paddingSize], ({
10367
+ $fillWidth = true
10368
+ }) => $fillWidth === true ? "100%" : "auto", ({
10369
+ $orientation = "horizontal"
10370
+ }) => $orientation === "horizontal" ? "row" : "column", ({
10371
+ $alignItems = "center"
10372
+ }) => $alignItems, ({
10373
+ $justifyContent = "left"
10374
+ }) => $justifyContent === "start" ? "start" : `${$justifyContent}`, ({
10375
+ theme: theme2
10376
+ }) => theme2.breakpoint.sizes.md, ({
10377
+ $isResponsive = true,
10378
+ $fillWidth = true
10379
+ }) => $isResponsive === true ? "100%" : $fillWidth === true ? "100%" : "auto", ({
10380
+ $isResponsive = true
10381
+ }) => $isResponsive === true ? "none" : "auto", ({
10382
+ $isResponsive = true
10383
+ }) => $isResponsive === true ? "column" : "auto");
10384
+ const Container = React.forwardRef(_Container);
10385
+ const TopBadgeWrapper = styled(Container).withConfig({
10386
+ componentId: "sc-1d5pqpo-0"
10387
+ })(["position:relative;"]);
10388
+ const CardPrimaryTopBadge = styled(Badge).withConfig({
10389
+ componentId: "sc-1d5pqpo-1"
10390
+ })(["position:absolute;top:0;left:50%;transform:translate(-50%,-50%);", " div:active + &{border-color:", ";}"], ({
10391
+ $isSelected,
10392
+ theme: theme2
10393
+ }) => $isSelected ? `border-color: ${theme2.click.button.basic.color.primary.stroke.active};` : "", ({
10394
+ theme: theme2
10395
+ }) => theme2.click.button.basic.color.primary.stroke.active);
10396
+ const withTopBadge = (Component) => ({
10397
+ topBadgeText,
10398
+ ...props
10399
+ }) => {
10400
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(TopBadgeWrapper, { alignItems: "stretch", fillWidth: true, children: [
10401
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { ...props }),
10402
+ topBadgeText && /* @__PURE__ */ jsxRuntimeExports.jsx(CardPrimaryTopBadge, { "data-testid": "card-top-badge", text: topBadgeText, $isSelected: props.isSelected || false })
10403
+ ] });
10404
+ };
10405
+ const Wrapper$8 = styled.div.withConfig({
10312
10406
  componentId: "sc-2dguvi-0"
10313
10407
  })(["background-color:", ";border-radius:", ";border:", ";display:flex;width:100%;max-width:100%;text-align:", ";flex-direction:column;padding:", ";gap:", ";box-shadow:", ";&:hover,&:focus{background-color:", ";cursor:pointer;button{background-color:", ";border-color:", ";&:active{background-color:", ";border-color:", ";}}}&:active{border-color:", ';}&[aria-disabled="true"],&[aria-disabled="true"]:hover,&[aria-disabled="true"]:focus,&[aria-disabled="true"]:active{', "}", ""], ({
10314
10408
  theme: theme2
@@ -10389,7 +10483,7 @@ var __publicField = (obj, key, value) => {
10389
10483
  }
10390
10484
  return align === "start" ? "left" : "right";
10391
10485
  };
10392
- const CardPrimary = ({
10486
+ const Card = ({
10393
10487
  alignContent,
10394
10488
  title,
10395
10489
  icon,
@@ -10413,7 +10507,7 @@ var __publicField = (obj, key, value) => {
10413
10507
  }
10414
10508
  };
10415
10509
  const Component = !!infoUrl || typeof onButtonClick === "function" ? Button : "div";
10416
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$9, { $alignContent: alignContent, $hasShadow: hasShadow, $size: size2, "aria-disabled": disabled, $isSelected: isSelected, tabIndex: 0, ...props, children: [
10510
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$8, { $alignContent: alignContent, $hasShadow: hasShadow, $size: size2, "aria-disabled": disabled, $isSelected: isSelected, tabIndex: 0, ...props, children: [
10417
10511
  (icon || title) && /* @__PURE__ */ jsxRuntimeExports.jsxs(Header$3, { $size: size2, $disabled: disabled, $alignContent: alignContent, children: [
10418
10512
  icon && /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: icon, "aria-hidden": true }),
10419
10513
  title && /* @__PURE__ */ jsxRuntimeExports.jsx(Title$2, { type: "h3", children: title })
@@ -10426,6 +10520,7 @@ var __publicField = (obj, key, value) => {
10426
10520
  infoText && /* @__PURE__ */ jsxRuntimeExports.jsx(Component, { onClick: handleClick, disabled, children: infoText })
10427
10521
  ] });
10428
10522
  };
10523
+ const CardPrimary = withTopBadge(Card);
10429
10524
  const Header$2 = styled.div.withConfig({
10430
10525
  componentId: "sc-1qnbjoa-0"
10431
10526
  })(["display:flex;flex-direction:column;align-items:center;width:fit-content;max-width:100%;gap:inherit;"]);
@@ -10434,7 +10529,7 @@ var __publicField = (obj, key, value) => {
10434
10529
  })(["display:flex;flex-direction:column;align-self:center;gap:", ";flex:1;"], ({
10435
10530
  theme: theme2
10436
10531
  }) => theme2.click.card.horizontal.space.gap);
10437
- const Wrapper$8 = styled.div.withConfig({
10532
+ const Wrapper$7 = styled.div.withConfig({
10438
10533
  componentId: "sc-1qnbjoa-2"
10439
10534
  })(["display:inline-flex;width:100%;max-width:100%;align-items:center;justify-content:flex-start;", ""], ({
10440
10535
  theme: theme2,
@@ -10513,7 +10608,7 @@ var __publicField = (obj, key, value) => {
10513
10608
  color = "default",
10514
10609
  ...props
10515
10610
  }) => {
10516
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$8, { $disabled: disabled, $isSelected: isSelected, $color: color, tabIndex: 0, ...props, children: [
10611
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$7, { $disabled: disabled, $isSelected: isSelected, $color: color, tabIndex: 0, ...props, children: [
10517
10612
  icon && /* @__PURE__ */ jsxRuntimeExports.jsx(CardIcon$1, { name: icon, "aria-hidden": true }),
10518
10613
  /* @__PURE__ */ jsxRuntimeExports.jsxs(ContentWrapper, { children: [
10519
10614
  title && /* @__PURE__ */ jsxRuntimeExports.jsx(Header$2, { children: title }),
@@ -10537,7 +10632,7 @@ var __publicField = (obj, key, value) => {
10537
10632
  background: ${theme2.click.card.promotion.color.stroke.focus};
10538
10633
  }
10539
10634
  `);
10540
- const Wrapper$7 = styled.div.withConfig({
10635
+ const Wrapper$6 = styled.div.withConfig({
10541
10636
  componentId: "sc-6jamj6-1"
10542
10637
  })(["display:flex;width:100%;align-items:center;justify-content:flex-start;cursor:pointer;", ""], ({
10543
10638
  theme: theme2
@@ -10578,7 +10673,7 @@ var __publicField = (obj, key, value) => {
10578
10673
  ...props
10579
10674
  }) => {
10580
10675
  const [isVisible, setIsVisible] = React.useState(true);
10581
- return isVisible ? /* @__PURE__ */ jsxRuntimeExports.jsx(Background, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$7, { $dismissible: dismissible, ...props, children: [
10676
+ return isVisible ? /* @__PURE__ */ jsxRuntimeExports.jsx(Background, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$6, { $dismissible: dismissible, ...props, children: [
10582
10677
  /* @__PURE__ */ jsxRuntimeExports.jsx(CardIcon, { name: icon, "aria-hidden": true }),
10583
10678
  /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { children: label }),
10584
10679
  dismissible && /* @__PURE__ */ jsxRuntimeExports.jsx(DismissWrapper, { "data-testid": "click-alert-dismiss-button", onClick: () => setIsVisible(false), children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: "cross", "aria-label": "close" }) })
@@ -10735,7 +10830,7 @@ var __publicField = (obj, key, value) => {
10735
10830
  }
10736
10831
  const $e698a72e93240346$export$be92b6f5f03c0fe9 = $e698a72e93240346$export$48513f6b9f8ce62d;
10737
10832
  const $e698a72e93240346$export$adb584737d712b70 = $e698a72e93240346$export$59aad738f51d1c05;
10738
- const Wrapper$6 = styled(FormRoot).withConfig({
10833
+ const Wrapper$5 = styled(FormRoot).withConfig({
10739
10834
  componentId: "sc-1sck1ja-0"
10740
10835
  })(["align-items:center;max-width:fit-content;"]);
10741
10836
  const Checkbox = ({
@@ -10747,7 +10842,7 @@ var __publicField = (obj, key, value) => {
10747
10842
  ...delegated
10748
10843
  }) => {
10749
10844
  const defaultId = React.useId();
10750
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$6, { $orientation: orientation ?? "horizontal", $dir: dir ?? "end", children: [
10845
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$5, { $orientation: orientation ?? "horizontal", $dir: dir ?? "end", children: [
10751
10846
  /* @__PURE__ */ jsxRuntimeExports.jsx(CheckInput, { id: id ?? defaultId, "data-testid": "checkbox", disabled, "aria-label": `${label}`, ...delegated, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CheckIconWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: "check", size: "sm" }) }) }),
10752
10847
  label && /* @__PURE__ */ jsxRuntimeExports.jsx(GenericLabel, { htmlFor: id ?? defaultId, disabled, children: label })
10753
10848
  ] });
@@ -14295,80 +14390,6 @@ var __publicField = (obj, key, value) => {
14295
14390
  }, showLineNumbers, wrapLines: wrap || wrapLines, wrapLongLines: wrap || wrapLines, children })
14296
14391
  ] });
14297
14392
  };
14298
- const _Container = ({
14299
- component,
14300
- alignItems,
14301
- children,
14302
- fillWidth = true,
14303
- gap = "none",
14304
- grow,
14305
- shrink,
14306
- isResponsive,
14307
- justifyContent = "start",
14308
- maxWidth,
14309
- minWidth,
14310
- orientation = "horizontal",
14311
- padding = "none",
14312
- wrap = "nowrap",
14313
- fillHeight,
14314
- maxHeight,
14315
- minHeight,
14316
- overflow,
14317
- ...props
14318
- }, ref) => {
14319
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Wrapper$5, { 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 });
14320
- };
14321
- const Wrapper$5 = styled.div.withConfig({
14322
- componentId: "sc-bcplth-0"
14323
- })(["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:", ";}"], ({
14324
- $grow,
14325
- $shrink
14326
- }) => `
14327
- ${$grow && `flex: ${$grow}`};
14328
- ${$shrink && `flex-shrink: ${$shrink}`};
14329
- `, ({
14330
- $fillHeight,
14331
- $maxHeight,
14332
- $minHeight
14333
- }) => `
14334
- ${$fillHeight && "height: 100%"};
14335
- ${$maxHeight && `max-height: ${$maxHeight}`};
14336
- ${$minHeight && `min-height: ${$minHeight}`};
14337
- `, ({
14338
- $overflow
14339
- }) => `
14340
- ${$overflow && `overflow: ${$overflow}`};
14341
- `, ({
14342
- $wrap = "nowrap"
14343
- }) => $wrap, ({
14344
- theme: theme2,
14345
- $gapSize
14346
- }) => theme2.click.container.gap[$gapSize], ({
14347
- $maxWidth
14348
- }) => $maxWidth ?? "none", ({
14349
- $minWidth
14350
- }) => $minWidth ?? "none", ({
14351
- theme: theme2,
14352
- $paddingSize
14353
- }) => theme2.click.container.space[$paddingSize], ({
14354
- $fillWidth = true
14355
- }) => $fillWidth === true ? "100%" : "auto", ({
14356
- $orientation = "horizontal"
14357
- }) => $orientation === "horizontal" ? "row" : "column", ({
14358
- $alignItems = "center"
14359
- }) => $alignItems, ({
14360
- $justifyContent = "left"
14361
- }) => $justifyContent === "start" ? "start" : `${$justifyContent}`, ({
14362
- theme: theme2
14363
- }) => theme2.breakpoint.sizes.md, ({
14364
- $isResponsive = true,
14365
- $fillWidth = true
14366
- }) => $isResponsive === true ? "100%" : $fillWidth === true ? "100%" : "auto", ({
14367
- $isResponsive = true
14368
- }) => $isResponsive === true ? "none" : "auto", ({
14369
- $isResponsive = true
14370
- }) => $isResponsive === true ? "column" : "auto");
14371
- const Container = React.forwardRef(_Container);
14372
14393
  const $5d3850c4d0b4e6c7$var$DIALOG_NAME = "Dialog";
14373
14394
  const [$5d3850c4d0b4e6c7$var$createDialogContext, $5d3850c4d0b4e6c7$export$cc702773b8ea3e41] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($5d3850c4d0b4e6c7$var$DIALOG_NAME);
14374
14395
  const [$5d3850c4d0b4e6c7$var$DialogProvider, $5d3850c4d0b4e6c7$var$useDialogContext] = $5d3850c4d0b4e6c7$var$createDialogContext($5d3850c4d0b4e6c7$var$DIALOG_NAME);
@@ -1,5 +1,6 @@
1
- import { HorizontalDirection, IconName } from '..';
1
+ import { HorizontalDirection } from '..';
2
2
  import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
3
+ import { IconName } from '../Icon/types';
3
4
 
4
5
  export type BadgeState = "default" | "success" | "neutral" | "danger" | "disabled" | "warning" | "info";
5
6
  export type BadgeSize = "sm" | "md";
@@ -1,9 +1,10 @@
1
1
  import { IconName } from '..';
2
2
  import { HTMLAttributes, MouseEventHandler, ReactNode } from 'react';
3
+ import { WithTopBadgeProps } from './withTopBadge';
3
4
 
4
5
  export type CardPrimarySize = "sm" | "md";
5
6
  type ContentAlignment = "start" | "center" | "end";
6
- export interface CardPrimaryProps extends HTMLAttributes<HTMLDivElement> {
7
+ export interface CardPrimaryProps extends HTMLAttributes<HTMLDivElement>, WithTopBadgeProps {
7
8
  title?: string;
8
9
  icon?: IconName;
9
10
  hasShadow?: boolean;
@@ -17,5 +18,5 @@ export interface CardPrimaryProps extends HTMLAttributes<HTMLDivElement> {
17
18
  alignContent?: ContentAlignment;
18
19
  onButtonClick?: MouseEventHandler<HTMLElement>;
19
20
  }
20
- export declare const CardPrimary: ({ alignContent, title, icon, hasShadow, description, infoUrl, infoText, size, disabled, onButtonClick, isSelected, children, ...props }: CardPrimaryProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const CardPrimary: import('react').FC<CardPrimaryProps & WithTopBadgeProps>;
21
22
  export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare const TopBadgeWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<any, never> & import('../Container/Container').ContainerProps<import('react').ElementType>, never>> & string & Omit<(<T extends import('react').ElementType = "div">(props: Omit<import('react').ComponentProps<T>, keyof T> & import('../Container/Container').ContainerProps<T>) => import('react').ReactNode), keyof import('react').Component<any, {}, any>>;
3
+ export declare const CardPrimaryTopBadge: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('../Badge/Badge').DismissibleBadge | import('../Badge/Badge').NonDismissibleBadge, {
4
+ $isSelected?: boolean | undefined;
5
+ }>> & string & Omit<({ icon, iconDir, text, state, size, dismissible, onClose, ...props }: import('../Badge/Badge').BadgeProps) => import("react/jsx-runtime").JSX.Element, keyof import('react').Component<any, {}, any>>;
@@ -0,0 +1,7 @@
1
+ import { ComponentType, FC } from 'react';
2
+
3
+ export interface WithTopBadgeProps {
4
+ topBadgeText?: string;
5
+ isSelected?: boolean;
6
+ }
7
+ export declare const withTopBadge: <P extends object>(Component: ComponentType<P>) => FC<P & WithTopBadgeProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.141",
3
+ "version": "0.0.143",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",