@clickhouse/click-ui 0.0.151 → 0.0.153

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.
@@ -10094,16 +10094,22 @@ const Button = ({
10094
10094
  label,
10095
10095
  loading = false,
10096
10096
  disabled,
10097
+ showLabelWithLoading = false,
10097
10098
  ...delegated
10098
10099
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(StyledButton, { $styleType: type, $align: align, $fillWidth: fillWidth, disabled: disabled || loading, role: "button", ...delegated, children: [
10099
- iconLeft && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { name: iconLeft, "aria-hidden": true, size: "sm" }),
10100
- label ?? children,
10101
- iconRight && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { name: iconRight, "aria-hidden": true, size: "sm" }),
10102
- loading && /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIconWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: "loading-animated", "data-testid": "click-ui-loading-icon", "aria-label": "loading" }) })
10100
+ !loading && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10101
+ iconLeft && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { name: iconLeft, "aria-hidden": true, size: "sm" }),
10102
+ label ?? children,
10103
+ iconRight && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { name: iconRight, "aria-hidden": true, size: "sm" })
10104
+ ] }),
10105
+ loading && /* @__PURE__ */ jsxRuntimeExports.jsxs(LoadingIconWrapper, { "data-testid": "click-ui-loading-icon-wrapper", children: [
10106
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: "loading-animated", "data-testid": "click-ui-loading-icon", "aria-label": "loading" }),
10107
+ showLabelWithLoading ? label ?? children : ""
10108
+ ] })
10103
10109
  ] });
10104
10110
  const LoadingIconWrapper = styled.div.withConfig({
10105
10111
  componentId: "sc-1k4tz4c-0"
10106
- })(["position:absolute;background-color:inherit;top:0;left:0;bottom:0;right:0;display:flex;align-content:center;justify-content:center;"]);
10112
+ })(["background-color:inherit;top:0;left:0;bottom:0;right:0;display:flex;align-content:center;justify-content:center;align-items:center;gap:0.5rem;"]);
10107
10113
  const StyledButton = styled(BaseButton).withConfig({
10108
10114
  componentId: "sc-1k4tz4c-1"
10109
10115
  })(["width:", ";color:", ";background-color:", ";border:", " solid ", ";font:", ";position:relative;display:flex;align-items:center;justify-content:", ";white-space:nowrap;&:hover{background-color:", ";border:", " solid ", ";transition:", ";font:", ";}&:active,&:focus{background-color:", ";border:1px solid ", ";font:", ";}&:disabled,&:disabled:hover,&:disabled:active{background-color:", ";color:", ";border:", " solid ", ";font:", ";}"], ({
@@ -10244,10 +10250,12 @@ const CustomIcon = styled.img.withConfig({
10244
10250
  }) => theme2.click.image.lg.size.width);
10245
10251
  const InfoLink = styled.a.withConfig({
10246
10252
  componentId: "sc-1drx130-4"
10247
- })(["display:flex;align-items:center;color:", ";text-decoration:none;"], ({
10253
+ })(["display:flex;align-items:center;color:", ";gap:", ";text-decoration:none;"], ({
10248
10254
  theme: theme2
10249
- }) => theme2.click.card.secondary.color.link.default);
10250
- const ArrowContainer = styled(SvgImage).withConfig({
10255
+ }) => theme2.click.card.secondary.color.link.default, ({
10256
+ theme: theme2
10257
+ }) => theme2.click.card.secondary.space.link.gap);
10258
+ const LinkIconContainer = styled(SvgImage).withConfig({
10251
10259
  componentId: "sc-1drx130-5"
10252
10260
  })(["color:", ";height:", ";width:", ";"], ({
10253
10261
  theme: theme2
@@ -10259,7 +10267,7 @@ const ArrowContainer = styled(SvgImage).withConfig({
10259
10267
  const LinkText = styled(Text).withConfig({
10260
10268
  componentId: "sc-1drx130-6"
10261
10269
  })([""]);
10262
- const LinkArrow = styled(ArrowContainer).withConfig({
10270
+ const LinkIcon = styled(LinkIconContainer).withConfig({
10263
10271
  componentId: "sc-1drx130-7"
10264
10272
  })([""]);
10265
10273
  const Wrapper$a = styled.div.withConfig({
@@ -10279,7 +10287,7 @@ const Wrapper$a = styled.div.withConfig({
10279
10287
  theme: theme2
10280
10288
  }) => $hasShadow ? theme2.shadow[1] : "none", ({
10281
10289
  theme: theme2
10282
- }) => theme2.click.card.secondary.color.background.hover, LinkText, LinkArrow, ({
10290
+ }) => theme2.click.card.secondary.color.background.hover, LinkText, LinkIcon, ({
10283
10291
  theme: theme2
10284
10292
  }) => theme2.click.card.secondary.color.link.hover, ({
10285
10293
  theme: theme2
@@ -10290,7 +10298,7 @@ const Wrapper$a = styled.div.withConfig({
10290
10298
  cursor: not-allowed;
10291
10299
 
10292
10300
  ${LinkText},
10293
- ${LinkArrow} {
10301
+ ${LinkIcon} {
10294
10302
  color: ${theme2.click.card.secondary.color.link.disabled};
10295
10303
  }
10296
10304
  `);
@@ -10305,6 +10313,8 @@ const CardSecondary = ({
10305
10313
  description,
10306
10314
  infoUrl,
10307
10315
  infoText,
10316
+ infoIcon = "chevron-right",
10317
+ infoIconSize = "md",
10308
10318
  ...props
10309
10319
  }) => {
10310
10320
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$a, { "aria-disabled": disabled, tabIndex: 0, $hasShadow: hasShadow, ...props, children: [
@@ -10318,7 +10328,7 @@ const CardSecondary = ({
10318
10328
  /* @__PURE__ */ jsxRuntimeExports.jsx(Content$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { color: "muted", children: description }) }),
10319
10329
  (infoUrl || infoText) && /* @__PURE__ */ jsxRuntimeExports.jsxs(InfoLink, { href: disabled ? void 0 : infoUrl, as: disabled || !infoUrl || infoUrl.length === 0 ? "div" : "a", children: [
10320
10330
  /* @__PURE__ */ jsxRuntimeExports.jsx(LinkText, { children: infoText }),
10321
- /* @__PURE__ */ jsxRuntimeExports.jsx(LinkArrow, { name: "chevron-right" })
10331
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LinkIcon, { size: infoIconSize, name: infoIcon })
10322
10332
  ] })
10323
10333
  ] });
10324
10334
  };
@@ -45596,7 +45606,10 @@ const click = {
45596
45606
  secondary: {
45597
45607
  space: {
45598
45608
  all: "1rem",
45599
- gap: "1rem"
45609
+ gap: "1rem",
45610
+ link: {
45611
+ gap: "0.5rem"
45612
+ }
45600
45613
  },
45601
45614
  radii: {
45602
45615
  all: "0.25rem"
@@ -10111,16 +10111,22 @@ var __publicField = (obj, key, value) => {
10111
10111
  label,
10112
10112
  loading = false,
10113
10113
  disabled,
10114
+ showLabelWithLoading = false,
10114
10115
  ...delegated
10115
10116
  }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(StyledButton, { $styleType: type, $align: align, $fillWidth: fillWidth, disabled: disabled || loading, role: "button", ...delegated, children: [
10116
- iconLeft && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { name: iconLeft, "aria-hidden": true, size: "sm" }),
10117
- label ?? children,
10118
- iconRight && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { name: iconRight, "aria-hidden": true, size: "sm" }),
10119
- loading && /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingIconWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: "loading-animated", "data-testid": "click-ui-loading-icon", "aria-label": "loading" }) })
10117
+ !loading && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10118
+ iconLeft && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { name: iconLeft, "aria-hidden": true, size: "sm" }),
10119
+ label ?? children,
10120
+ iconRight && /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonIcon, { name: iconRight, "aria-hidden": true, size: "sm" })
10121
+ ] }),
10122
+ loading && /* @__PURE__ */ jsxRuntimeExports.jsxs(LoadingIconWrapper, { "data-testid": "click-ui-loading-icon-wrapper", children: [
10123
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SvgImage, { name: "loading-animated", "data-testid": "click-ui-loading-icon", "aria-label": "loading" }),
10124
+ showLabelWithLoading ? label ?? children : ""
10125
+ ] })
10120
10126
  ] });
10121
10127
  const LoadingIconWrapper = styled.div.withConfig({
10122
10128
  componentId: "sc-1k4tz4c-0"
10123
- })(["position:absolute;background-color:inherit;top:0;left:0;bottom:0;right:0;display:flex;align-content:center;justify-content:center;"]);
10129
+ })(["background-color:inherit;top:0;left:0;bottom:0;right:0;display:flex;align-content:center;justify-content:center;align-items:center;gap:0.5rem;"]);
10124
10130
  const StyledButton = styled(BaseButton).withConfig({
10125
10131
  componentId: "sc-1k4tz4c-1"
10126
10132
  })(["width:", ";color:", ";background-color:", ";border:", " solid ", ";font:", ";position:relative;display:flex;align-items:center;justify-content:", ";white-space:nowrap;&:hover{background-color:", ";border:", " solid ", ";transition:", ";font:", ";}&:active,&:focus{background-color:", ";border:1px solid ", ";font:", ";}&:disabled,&:disabled:hover,&:disabled:active{background-color:", ";color:", ";border:", " solid ", ";font:", ";}"], ({
@@ -10261,10 +10267,12 @@ var __publicField = (obj, key, value) => {
10261
10267
  }) => theme2.click.image.lg.size.width);
10262
10268
  const InfoLink = styled.a.withConfig({
10263
10269
  componentId: "sc-1drx130-4"
10264
- })(["display:flex;align-items:center;color:", ";text-decoration:none;"], ({
10270
+ })(["display:flex;align-items:center;color:", ";gap:", ";text-decoration:none;"], ({
10265
10271
  theme: theme2
10266
- }) => theme2.click.card.secondary.color.link.default);
10267
- const ArrowContainer = styled(SvgImage).withConfig({
10272
+ }) => theme2.click.card.secondary.color.link.default, ({
10273
+ theme: theme2
10274
+ }) => theme2.click.card.secondary.space.link.gap);
10275
+ const LinkIconContainer = styled(SvgImage).withConfig({
10268
10276
  componentId: "sc-1drx130-5"
10269
10277
  })(["color:", ";height:", ";width:", ";"], ({
10270
10278
  theme: theme2
@@ -10276,7 +10284,7 @@ var __publicField = (obj, key, value) => {
10276
10284
  const LinkText = styled(Text).withConfig({
10277
10285
  componentId: "sc-1drx130-6"
10278
10286
  })([""]);
10279
- const LinkArrow = styled(ArrowContainer).withConfig({
10287
+ const LinkIcon = styled(LinkIconContainer).withConfig({
10280
10288
  componentId: "sc-1drx130-7"
10281
10289
  })([""]);
10282
10290
  const Wrapper$a = styled.div.withConfig({
@@ -10296,7 +10304,7 @@ var __publicField = (obj, key, value) => {
10296
10304
  theme: theme2
10297
10305
  }) => $hasShadow ? theme2.shadow[1] : "none", ({
10298
10306
  theme: theme2
10299
- }) => theme2.click.card.secondary.color.background.hover, LinkText, LinkArrow, ({
10307
+ }) => theme2.click.card.secondary.color.background.hover, LinkText, LinkIcon, ({
10300
10308
  theme: theme2
10301
10309
  }) => theme2.click.card.secondary.color.link.hover, ({
10302
10310
  theme: theme2
@@ -10307,7 +10315,7 @@ var __publicField = (obj, key, value) => {
10307
10315
  cursor: not-allowed;
10308
10316
 
10309
10317
  ${LinkText},
10310
- ${LinkArrow} {
10318
+ ${LinkIcon} {
10311
10319
  color: ${theme2.click.card.secondary.color.link.disabled};
10312
10320
  }
10313
10321
  `);
@@ -10322,6 +10330,8 @@ var __publicField = (obj, key, value) => {
10322
10330
  description,
10323
10331
  infoUrl,
10324
10332
  infoText,
10333
+ infoIcon = "chevron-right",
10334
+ infoIconSize = "md",
10325
10335
  ...props
10326
10336
  }) => {
10327
10337
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Wrapper$a, { "aria-disabled": disabled, tabIndex: 0, $hasShadow: hasShadow, ...props, children: [
@@ -10335,7 +10345,7 @@ var __publicField = (obj, key, value) => {
10335
10345
  /* @__PURE__ */ jsxRuntimeExports.jsx(Content$3, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { color: "muted", children: description }) }),
10336
10346
  (infoUrl || infoText) && /* @__PURE__ */ jsxRuntimeExports.jsxs(InfoLink, { href: disabled ? void 0 : infoUrl, as: disabled || !infoUrl || infoUrl.length === 0 ? "div" : "a", children: [
10337
10347
  /* @__PURE__ */ jsxRuntimeExports.jsx(LinkText, { children: infoText }),
10338
- /* @__PURE__ */ jsxRuntimeExports.jsx(LinkArrow, { name: "chevron-right" })
10348
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LinkIcon, { size: infoIconSize, name: infoIcon })
10339
10349
  ] })
10340
10350
  ] });
10341
10351
  };
@@ -45613,7 +45623,10 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
45613
45623
  secondary: {
45614
45624
  space: {
45615
45625
  all: "1rem",
45616
- gap: "1rem"
45626
+ gap: "1rem",
45627
+ link: {
45628
+ gap: "0.5rem"
45629
+ }
45617
45630
  },
45618
45631
  radii: {
45619
45632
  all: "0.25rem"
@@ -13,6 +13,7 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
13
13
  fillWidth?: boolean;
14
14
  loading?: boolean;
15
15
  autoFocus?: boolean;
16
+ showLabelWithLoading?: boolean;
16
17
  }
17
- export declare const Button: ({ type, iconLeft, iconRight, align, children, fillWidth, label, loading, disabled, ...delegated }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const Button: ({ type, iconLeft, iconRight, align, children, fillWidth, label, loading, disabled, showLabelWithLoading, ...delegated }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
18
19
  export {};
@@ -1,4 +1,5 @@
1
1
  import { IconName } from '..';
2
+ import { IconSize } from '../Icon/types';
2
3
  import { HTMLAttributes, ReactNode } from 'react';
3
4
 
4
5
  export type BadgeState = "default" | "success" | "neutral" | "danger" | "disabled" | "warning" | "info";
@@ -13,5 +14,7 @@ export interface CardSecondaryProps extends HTMLAttributes<HTMLDivElement> {
13
14
  description: ReactNode;
14
15
  infoUrl?: string;
15
16
  infoText?: string;
17
+ infoIcon?: IconName;
18
+ infoIconSize?: IconSize;
16
19
  }
17
- export declare const CardSecondary: ({ title, icon, iconUrl, badgeState, badgeText, hasShadow, disabled, description, infoUrl, infoText, ...props }: CardSecondaryProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const CardSecondary: ({ title, icon, iconUrl, badgeState, badgeText, hasShadow, disabled, description, infoUrl, infoText, infoIcon, infoIconSize, ...props }: CardSecondaryProps) => import("react/jsx-runtime").JSX.Element;
@@ -786,6 +786,9 @@ export interface Theme {
786
786
  "space": {
787
787
  "all": string;
788
788
  "gap": string;
789
+ "link": {
790
+ "gap": string;
791
+ };
789
792
  };
790
793
  "radii": {
791
794
  "all": string;
@@ -785,7 +785,10 @@ declare const _default: {
785
785
  "secondary": {
786
786
  "space": {
787
787
  "all": "1rem",
788
- "gap": "1rem"
788
+ "gap": "1rem",
789
+ "link": {
790
+ "gap": "0.5rem"
791
+ }
789
792
  },
790
793
  "radii": {
791
794
  "all": "0.25rem"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.151",
3
+ "version": "0.0.153",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",