@szymonpiatek/designsystem 0.0.14 → 0.0.15

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.cjs CHANGED
@@ -699,25 +699,28 @@ var Button = react.forwardRef(
699
699
  )
700
700
  );
701
701
  Button.displayName = "Button";
702
- var StyledButton2 = styles.styled(Button)(({ theme }) => ({
702
+ var StyledButton2 = styles.styled(Button)(({ theme, $variant }) => ({
703
703
  border: "none",
704
704
  borderRadius: "0.375rem",
705
- color: theme.palette.text.secondary,
706
- "&:hover:not(:disabled)": {
707
- backgroundColor: theme.palette.action.hover,
708
- color: theme.palette.text.primary
709
- },
710
- "&:active:not(:disabled)": {
711
- filter: "none",
712
- backgroundColor: theme.palette.action.selected
713
- }
705
+ ...$variant === "ghost" || $variant === "text" ? {
706
+ color: theme.palette.text.secondary,
707
+ "&:hover:not(:disabled)": {
708
+ backgroundColor: theme.palette.action.hover,
709
+ color: theme.palette.text.primary
710
+ },
711
+ "&:active:not(:disabled)": {
712
+ filter: "none",
713
+ backgroundColor: theme.palette.action.selected
714
+ }
715
+ } : {}
714
716
  }));
715
717
  var CloseButton = react.forwardRef(
716
- ({ "aria-label": ariaLabel = "Zamknij", size = "sm", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
718
+ ({ "aria-label": ariaLabel = "Zamknij", size = "sm", variant = "ghost", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
717
719
  StyledButton2,
718
720
  {
719
721
  ref,
720
- variant: "ghost",
722
+ variant,
723
+ $variant: variant,
721
724
  shape: "square",
722
725
  size,
723
726
  startIcon: /* @__PURE__ */ jsxRuntime.jsx(CloseIcon__default.default, { "aria-hidden": true, style: { fontSize: "inherit" } }),
@@ -9795,41 +9798,80 @@ var sizeOverrides = {
9795
9798
  lg: { minWidth: "2.5rem", height: "2.5rem" },
9796
9799
  xl: { minWidth: "3rem", height: "3rem" }
9797
9800
  };
9798
- var activeStyles = (theme) => ({
9799
- backgroundColor: theme.palette.primary.main,
9800
- color: theme.palette.primary.contrastText,
9801
- fontWeight: 700,
9802
- "&:hover:not(:disabled)": { backgroundColor: theme.palette.primary.dark },
9803
- "&:active:not(:disabled)": { filter: "none" }
9804
- });
9805
- var idleStyles = (theme) => ({
9806
- backgroundColor: "transparent",
9807
- color: theme.palette.text.primary,
9808
- fontWeight: 400,
9809
- "&:hover:not(:disabled)": { backgroundColor: styles.alpha(theme.palette.primary.main, 0.08) },
9810
- "&:active:not(:disabled)": { backgroundColor: styles.alpha(theme.palette.primary.main, 0.16) }
9811
- });
9812
- var StyledButton3 = styles.styled(Button)(
9813
- ({ theme, $isActive, $btnSize }) => ({
9801
+ var activeStyles = (theme, variant) => {
9802
+ if (variant === "secondary") {
9803
+ return {
9804
+ backgroundColor: theme.palette.secondary.main,
9805
+ color: theme.palette.secondary.contrastText,
9806
+ fontWeight: 700,
9807
+ "&:hover:not(:disabled)": { backgroundColor: theme.palette.secondary.dark },
9808
+ "&:active:not(:disabled)": { filter: "none" }
9809
+ };
9810
+ }
9811
+ if (variant === "danger") {
9812
+ return {
9813
+ backgroundColor: theme.palette.error.main,
9814
+ color: theme.palette.error.contrastText,
9815
+ fontWeight: 700,
9816
+ "&:hover:not(:disabled)": { backgroundColor: theme.palette.error.dark },
9817
+ "&:active:not(:disabled)": { filter: "none" }
9818
+ };
9819
+ }
9820
+ if (variant === "primary") {
9821
+ return {
9822
+ fontWeight: 700,
9823
+ "&:active:not(:disabled)": { filter: "none" }
9824
+ };
9825
+ }
9826
+ return {
9827
+ backgroundColor: theme.palette.primary.main,
9828
+ color: theme.palette.primary.contrastText,
9829
+ fontWeight: 700,
9830
+ "&:hover:not(:disabled)": { backgroundColor: theme.palette.primary.dark },
9831
+ "&:active:not(:disabled)": { filter: "none" }
9832
+ };
9833
+ };
9834
+ var idleStyles = (theme, variant) => {
9835
+ if (variant !== "ghost" && variant !== "text") {
9836
+ return {};
9837
+ }
9838
+ return {
9839
+ backgroundColor: "transparent",
9840
+ color: theme.palette.text.primary,
9814
9841
  border: "none",
9815
- borderRadius: theme.shape.borderRadius,
9816
- padding: "0 0.25rem",
9817
- lineHeight: 1,
9818
- ...sizeOverrides[$btnSize],
9819
- ...$isActive ? activeStyles(theme) : idleStyles(theme)
9820
- })
9821
- );
9842
+ fontWeight: 400,
9843
+ "&:hover:not(:disabled)": { backgroundColor: styles.alpha(theme.palette.primary.main, 0.08) },
9844
+ "&:active:not(:disabled)": { backgroundColor: styles.alpha(theme.palette.primary.main, 0.16) }
9845
+ };
9846
+ };
9847
+ var StyledButton3 = styles.styled(Button)(({ theme, $isActive, $btnSize, $variant }) => ({
9848
+ border: "none",
9849
+ borderRadius: theme.shape.borderRadius,
9850
+ padding: "0 0.25rem",
9851
+ lineHeight: 1,
9852
+ ...sizeOverrides[$btnSize],
9853
+ ...$isActive ? activeStyles(theme, $variant) : idleStyles(theme, $variant)
9854
+ }));
9822
9855
  var PaginationButton = react.forwardRef(
9823
- ({ onClick, isActive = false, disabled = false, size = "md", children, "aria-label": ariaLabel }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
9856
+ ({
9857
+ onClick,
9858
+ isActive = false,
9859
+ disabled = false,
9860
+ size = "md",
9861
+ variant = "ghost",
9862
+ children,
9863
+ "aria-label": ariaLabel
9864
+ }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
9824
9865
  StyledButton3,
9825
9866
  {
9826
9867
  ref,
9827
- variant: "ghost",
9868
+ variant,
9828
9869
  size,
9829
9870
  disabled,
9830
9871
  onClick,
9831
9872
  $isActive: isActive,
9832
9873
  $btnSize: size,
9874
+ $variant: variant,
9833
9875
  "aria-label": ariaLabel,
9834
9876
  "aria-current": isActive ? "page" : void 0,
9835
9877
  children
@@ -10308,12 +10350,22 @@ var Badge2 = styles.styled("span")(({ theme }) => ({
10308
10350
  lineHeight: 1
10309
10351
  }));
10310
10352
  var CartButton = react.forwardRef(
10311
- ({ count, size = "sm", shape, label = "Koszyk", disabled, onClick, className, "aria-label": ariaLabel }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(Root36, { className, children: [
10353
+ ({
10354
+ count,
10355
+ size = "sm",
10356
+ shape,
10357
+ variant = "ghost",
10358
+ label = "Koszyk",
10359
+ disabled,
10360
+ onClick,
10361
+ className,
10362
+ "aria-label": ariaLabel
10363
+ }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(Root36, { className, children: [
10312
10364
  /* @__PURE__ */ jsxRuntime.jsx(
10313
10365
  Button,
10314
10366
  {
10315
10367
  ref,
10316
- variant: "ghost",
10368
+ variant,
10317
10369
  size,
10318
10370
  shape,
10319
10371
  disabled,
@@ -12575,23 +12627,34 @@ var VoucherCard = react.forwardRef(
12575
12627
  ] })
12576
12628
  );
12577
12629
  VoucherCard.displayName = "VoucherCard";
12578
- var StyledButton4 = styles.styled(Button)(({ theme, $active }) => ({
12579
- border: `1px solid ${$active ? theme.palette.error.main : theme.palette.divider}`,
12580
- background: $active ? `${theme.palette.error.main}14` : "transparent",
12581
- color: $active ? theme.palette.error.main : theme.palette.text.secondary,
12582
- "&:hover:not(:disabled)": {
12583
- color: theme.palette.error.main,
12584
- borderColor: theme.palette.error.main,
12585
- backgroundColor: `${theme.palette.error.main}14`
12630
+ var StyledButton4 = styles.styled(Button)(({
12631
+ theme,
12632
+ $active,
12633
+ $variant
12634
+ }) => {
12635
+ if ($variant !== "ghost" && $variant !== "text") {
12636
+ return {};
12586
12637
  }
12587
- }));
12638
+ return {
12639
+ border: $variant === "ghost" ? `1px solid ${$active ? theme.palette.error.main : theme.palette.divider}` : "none",
12640
+ background: $active ? `${theme.palette.error.main}14` : "transparent",
12641
+ color: $active ? theme.palette.error.main : theme.palette.text.secondary,
12642
+ "&:hover:not(:disabled)": {
12643
+ color: theme.palette.error.main,
12644
+ borderColor: $variant === "ghost" ? theme.palette.error.main : void 0,
12645
+ backgroundColor: `${theme.palette.error.main}14`
12646
+ }
12647
+ };
12648
+ });
12588
12649
  var WishlistButton = react.forwardRef(
12589
- ({ active = false, size = "md", label, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
12650
+ ({ active = false, size = "md", variant = "ghost", label, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
12590
12651
  StyledButton4,
12591
12652
  {
12592
12653
  ref,
12654
+ variant,
12593
12655
  shape: "circle",
12594
12656
  size,
12657
+ $variant: variant,
12595
12658
  startIcon: active ? /* @__PURE__ */ jsxRuntime.jsx(FavoriteIcon__default.default, { "aria-hidden": true, style: { fontSize: "inherit" } }) : /* @__PURE__ */ jsxRuntime.jsx(FavoriteBorderIcon__default.default, { "aria-hidden": true, style: { fontSize: "inherit" } }),
12596
12659
  "aria-label": label ?? (active ? "Usu\u0144 z listy \u017Cycze\u0144" : "Dodaj do listy \u017Cycze\u0144"),
12597
12660
  $active: active,