@purpurds/drawer 8.6.0 → 8.8.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpurds/drawer",
3
- "version": "8.6.0",
3
+ "version": "8.8.0",
4
4
  "license": "AGPL-3.0-only",
5
5
  "main": "./dist/drawer.cjs.js",
6
6
  "types": "./dist/drawer.d.ts",
@@ -18,13 +18,13 @@
18
18
  "@radix-ui/react-dialog": "~1.1.6",
19
19
  "@radix-ui/react-scroll-area": "~1.2.3",
20
20
  "classnames": "~2.5.0",
21
- "@purpurds/button": "8.6.0",
22
- "@purpurds/icon": "8.6.0",
23
- "@purpurds/common-types": "8.6.0",
24
- "@purpurds/tokens": "8.6.0",
25
- "@purpurds/paragraph": "8.6.0",
26
- "@purpurds/visually-hidden": "8.6.0",
27
- "@purpurds/heading": "8.6.0"
21
+ "@purpurds/common-types": "8.8.0",
22
+ "@purpurds/heading": "8.8.0",
23
+ "@purpurds/tokens": "8.8.0",
24
+ "@purpurds/button": "8.8.0",
25
+ "@purpurds/visually-hidden": "8.8.0",
26
+ "@purpurds/icon": "8.8.0",
27
+ "@purpurds/paragraph": "8.8.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@storybook/react-vite": "^9.0.18",
@@ -27,14 +27,12 @@ export const DrawerContainer = forwardRef<HTMLDivElement, DrawerContainerProps>(
27
27
  ref
28
28
  ) => {
29
29
  const classes = cx([
30
- className,
31
30
  rootClassName,
32
31
  {
33
32
  [`${rootClassName}--${variant}`]: variant,
34
- },
35
- {
36
33
  [`${rootClassName}--sticky`]: stickyFooter,
37
34
  },
35
+ className,
38
36
  ]);
39
37
 
40
38
  return (
@@ -69,11 +69,13 @@ export const DrawerContent = forwardRef<HTMLDivElement, DrawerContentProps>(
69
69
  ref
70
70
  ) => {
71
71
  const classes = cx([
72
- className,
73
72
  rootClassName,
74
- { [`${rootClassName}--fit-to-content`]: fitToContent },
75
- { [`${rootClassName}--left`]: position === "left" },
76
- { [`${rootClassName}--right`]: position === "right" },
73
+ {
74
+ [`${rootClassName}--fit-to-content`]: fitToContent,
75
+ [`${rootClassName}--left`]: position === "left",
76
+ [`${rootClassName}--right`]: position === "right",
77
+ },
78
+ className,
77
79
  ]);
78
80
 
79
81
  const drawerFrameRef = useRef<HTMLDivElement>(null);
@@ -59,7 +59,6 @@ export const DrawerFrame = forwardRef<HTMLDivElement, DrawerFrameProps>(
59
59
  ) => {
60
60
  const hasBackButton = !!(backButton && backButtonText && onBackButtonClick);
61
61
  const classes = cx([
62
- className,
63
62
  rootClassName,
64
63
  {
65
64
  [`${rootClassName}--fit-to-content`]: fitToContent,
@@ -69,6 +68,7 @@ export const DrawerFrame = forwardRef<HTMLDivElement, DrawerFrameProps>(
69
68
  [`${rootClassName}--without-back-button`]: !hasBackButton,
70
69
  [`${rootClassName}--with-back-button`]: hasBackButton,
71
70
  },
71
+ className,
72
72
  ]);
73
73
 
74
74
  return (
@@ -30,7 +30,7 @@ export const DrawerHandle = forwardRef<HTMLDivElement, DrawerHandleProps>(
30
30
  },
31
31
  ref
32
32
  ) => {
33
- const classes = cx([className, rootClassName]);
33
+ const classes = cx([rootClassName, className]);
34
34
  const pointerStartRef = React.useRef<{ y: number } | null>(null);
35
35
  const swipeDeltaRef = React.useRef<{ y: number } | null>(null);
36
36
  const { onPointerDown, onPointerMove, onPointerUp } = useSwipeTracking(
@@ -1,8 +1,8 @@
1
1
  import React, { forwardRef } from "react";
2
2
  import { Button, BUTTON_VARIANT } from "@purpurds/button";
3
3
  import type { BaseProps } from "@purpurds/common-types";
4
- import { Heading, TitleVariant } from "@purpurds/heading";
5
- import { IconArrowLeft } from "@purpurds/icon/arrow-left";
4
+ import { DisplayVariant, Heading } from "@purpurds/heading";
5
+ import { IconChevronLeft } from "@purpurds/icon/chevron-left";
6
6
  import { IconClose } from "@purpurds/icon/close";
7
7
  import { VisuallyHidden } from "@purpurds/visually-hidden";
8
8
  import * as RadixDialog from "@radix-ui/react-dialog";
@@ -40,7 +40,7 @@ export const DrawerHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(
40
40
  },
41
41
  ref
42
42
  ) => {
43
- const classes = cx([className, rootClassName]);
43
+ const classes = cx([rootClassName, className]);
44
44
  const hasBackButton = !!(backButton && backButtonText && onBackButtonClick);
45
45
 
46
46
  return (
@@ -70,7 +70,7 @@ export const DrawerHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(
70
70
  size="sm"
71
71
  variant={backButtonOnlyIcon ? BUTTON_VARIANT.TERTIARY_PURPLE : BUTTON_VARIANT.TEXT}
72
72
  >
73
- <IconArrowLeft size="sm" />
73
+ <IconChevronLeft size="sm" />
74
74
  {!backButtonOnlyIcon && backButtonText}
75
75
  </Button>
76
76
  ) : headerContent ? (
@@ -85,7 +85,7 @@ export const DrawerHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(
85
85
  <Heading
86
86
  data-testid={`${dataTestId}-title`}
87
87
  tag="h2"
88
- variant={TitleVariant.TITLE200}
88
+ variant={DisplayVariant.DISPLAY10}
89
89
  tabIndex={-1}
90
90
  >
91
91
  {title}
@@ -122,7 +122,7 @@ export const DrawerHeader = forwardRef<HTMLDivElement, DrawerHeaderProps>(
122
122
  data-testid={`${dataTestId}-title-with-back-button`}
123
123
  tag="h2"
124
124
  tabIndex={-1}
125
- variant={TitleVariant.TITLE200}
125
+ variant={DisplayVariant.DISPLAY10}
126
126
  >
127
127
  {title}
128
128
  </Heading>
@@ -25,7 +25,7 @@ export const DrawerScrollArea = forwardRef<HTMLDivElement, DrawerScrollAreaProps
25
25
  },
26
26
  ref
27
27
  ) => {
28
- const classes = cx([className, rootClassName]);
28
+ const classes = cx([rootClassName, className]);
29
29
  return (
30
30
  <div className={classes} data-testid={dataTestId} ref={ref} {...props}>
31
31
  <RadixScrollArea.Root