@vygruppen/spor-react 12.24.16 → 13.0.1

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.
Files changed (85) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/.turbo/turbo-postinstall.log +2 -2
  3. package/CHANGELOG.md +24 -0
  4. package/dist/index.cjs +2753 -2646
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +887 -601
  7. package/dist/index.d.ts +887 -601
  8. package/dist/index.mjs +2712 -2605
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +10 -10
  11. package/src/accordion/Accordion.tsx +34 -29
  12. package/src/accordion/Expandable.tsx +20 -21
  13. package/src/alert/Alert.tsx +7 -5
  14. package/src/alert/AlertIcon.tsx +19 -20
  15. package/src/alert/ExpandableAlert.tsx +65 -64
  16. package/src/alert/ServiceAlert.tsx +78 -78
  17. package/src/breadcrumb/Breadcrumb.tsx +37 -34
  18. package/src/button/Button.tsx +64 -57
  19. package/src/button/ButtonGroup.tsx +12 -10
  20. package/src/button/Clipboard.tsx +21 -18
  21. package/src/button/CloseButton.tsx +19 -17
  22. package/src/button/FloatingActionButton.tsx +41 -47
  23. package/src/button/IconButton.tsx +20 -18
  24. package/src/calendar/CalendarContext.tsx +1 -1
  25. package/src/color-mode/color-mode.tsx +7 -5
  26. package/src/datepicker/CalendarTriggerButton.tsx +11 -7
  27. package/src/datepicker/DateField.tsx +53 -51
  28. package/src/datepicker/DatePicker.tsx +127 -134
  29. package/src/datepicker/DateTimeSegment.tsx +44 -40
  30. package/src/datepicker/StyledField.tsx +39 -36
  31. package/src/dialog/Dialog.tsx +14 -11
  32. package/src/dialog/Drawer.tsx +74 -67
  33. package/src/input/AttachedInputs.tsx +35 -41
  34. package/src/input/Autocomplete.tsx +118 -129
  35. package/src/input/CardSelect.tsx +67 -65
  36. package/src/input/Checkbox.tsx +19 -17
  37. package/src/input/CheckboxGroup.tsx +0 -2
  38. package/src/input/ChoiceChip.tsx +42 -38
  39. package/src/input/Combobox.tsx +4 -4
  40. package/src/input/CountryCodeSelect.tsx +8 -8
  41. package/src/input/Field.tsx +78 -75
  42. package/src/input/FloatingLabel.tsx +6 -8
  43. package/src/input/Input.tsx +87 -92
  44. package/src/input/ListBox.tsx +3 -4
  45. package/src/input/Menu.tsx +149 -142
  46. package/src/input/NativeSelect.tsx +7 -5
  47. package/src/input/NumericStepper.tsx +15 -12
  48. package/src/input/PasswordInput.tsx +65 -61
  49. package/src/input/PhoneNumberInput.tsx +7 -7
  50. package/src/input/Popover.tsx +52 -55
  51. package/src/input/Radio.tsx +16 -11
  52. package/src/input/SearchInput.tsx +32 -31
  53. package/src/input/Select.tsx +106 -96
  54. package/src/input/Switch.tsx +43 -41
  55. package/src/input/Textarea.tsx +68 -66
  56. package/src/input/useFLoatingInputState.tsx +1 -1
  57. package/src/layout/PressableCard.tsx +11 -10
  58. package/src/layout/RadioCard.tsx +57 -53
  59. package/src/layout/Separator.tsx +8 -7
  60. package/src/layout/StaticCard.tsx +11 -10
  61. package/src/linjetag/LineIcon.tsx +48 -54
  62. package/src/linjetag/TravelTag.tsx +57 -59
  63. package/src/link/TextLink.tsx +50 -40
  64. package/src/loader/ProgressBar.tsx +41 -46
  65. package/src/loader/ProgressLoader.tsx +83 -86
  66. package/src/loader/Skeleton.tsx +56 -48
  67. package/src/logo/CargonetLogo.tsx +88 -87
  68. package/src/logo/VyLogo.tsx +80 -77
  69. package/src/logo/VyLogoPride.tsx +137 -135
  70. package/src/media-controller/JumpButton.tsx +30 -28
  71. package/src/media-controller/PlayPauseButton.tsx +8 -7
  72. package/src/media-controller/SkipButton.tsx +28 -26
  73. package/src/nudge/Nudge.tsx +66 -70
  74. package/src/pagination/Pagination.tsx +52 -46
  75. package/src/popover/index.tsx +46 -41
  76. package/src/progress-indicator/ProgressIndicator.tsx +10 -7
  77. package/src/stepper/Stepper.tsx +84 -81
  78. package/src/tab/Tabs.tsx +8 -4
  79. package/src/table/Table.tsx +89 -109
  80. package/src/tooltip.tsx +26 -22
  81. package/src/typography/Badge.tsx +8 -5
  82. package/src/typography/Code.tsx +8 -5
  83. package/src/typography/Heading.tsx +22 -23
  84. package/src/typography/Text.tsx +11 -9
  85. package/tsconfig.json +1 -0
@@ -2,7 +2,7 @@
2
2
  import { Box, Field, Flex, useSlotRecipe } from "@chakra-ui/react";
3
3
  import { DateValue, GregorianCalendar } from "@internationalized/date";
4
4
  import { DOMAttributes, FocusableElement } from "@react-types/shared";
5
- import React, { forwardRef, PropsWithChildren, RefObject, useRef } from "react";
5
+ import React, { PropsWithChildren, RefObject, useRef } from "react";
6
6
  import { AriaDateFieldProps, useDateField } from "react-aria";
7
7
  import { DateSegment, useDateFieldState } from "react-stately";
8
8
 
@@ -30,60 +30,62 @@ type DateFieldProps = AriaDateFieldProps<DateValue> &
30
30
  labelProps?: DOMAttributes<FocusableElement>;
31
31
  name?: string;
32
32
  };
33
- export const DateField = forwardRef<HTMLDivElement, DateFieldProps>(
34
- (props, externalRef) => {
35
- const locale = useCurrentLocale();
33
+ export const DateField = ({
34
+ ref: externalRef,
35
+ ...props
36
+ }: DateFieldProps & {
37
+ ref?: React.Ref<HTMLDivElement>;
38
+ }) => {
39
+ const locale = useCurrentLocale();
36
40
 
37
- const recipe = useSlotRecipe({
38
- key: "datePicker",
39
- });
40
- const styles = recipe({});
41
- const state = useDateFieldState({
42
- ...props,
43
- locale,
44
- createCalendar,
45
- });
41
+ const recipe = useSlotRecipe({
42
+ key: "datePicker",
43
+ });
44
+ const styles = recipe({});
45
+ const state = useDateFieldState({
46
+ ...props,
47
+ locale,
48
+ createCalendar,
49
+ });
46
50
 
47
- const { t } = useTranslation();
51
+ const { t } = useTranslation();
48
52
 
49
- const internalRef = useRef(null);
50
- const ref = externalRef ?? internalRef;
51
- const { fieldProps } = useDateField(
52
- props,
53
- state,
54
- ref as RefObject<HTMLDivElement>,
55
- );
53
+ const internalRef = useRef(null);
54
+ const ref = externalRef ?? internalRef;
55
+ const { fieldProps } = useDateField(
56
+ props,
57
+ state,
58
+ ref as RefObject<HTMLDivElement>,
59
+ );
56
60
 
57
- return (
58
- <Box minWidth="6rem" width="100%">
59
- {props.label && (
60
- <Box css={styles.inputLabel} position="absolute" paddingTop="2px">
61
- <Label padding="0" {...props.labelProps}>
62
- {props.label} <Field.RequiredIndicator />
63
- </Label>
64
- </Box>
65
- )}
66
- <Flex {...fieldProps} ref={ref} paddingTop="3" paddingBottom="0.5">
67
- {state.segments.map((segment, index) => (
68
- <DateTimeSegment
69
- key={index}
70
- segment={segment}
71
- ariaDescription={t(getAriaLabel(segment.type))}
72
- state={state}
73
- />
74
- ))}
75
- </Flex>
76
- <input
77
- type="hidden"
78
- value={state.value?.toString() ?? ""}
79
- name={props.name}
80
- id={props.id}
81
- />
82
- </Box>
83
- );
84
- },
85
- );
86
- DateField.displayName = "DateField";
61
+ return (
62
+ <Box minWidth="6rem" width="100%">
63
+ {props.label && (
64
+ <Box css={styles.inputLabel} position="absolute" paddingTop="2px">
65
+ <Label padding="0" {...props.labelProps}>
66
+ {props.label} <Field.RequiredIndicator />
67
+ </Label>
68
+ </Box>
69
+ )}
70
+ <Flex {...fieldProps} ref={ref} paddingTop="3" paddingBottom="0.5">
71
+ {state.segments.map((segment, index) => (
72
+ <DateTimeSegment
73
+ key={index}
74
+ segment={segment}
75
+ ariaDescription={t(getAriaLabel(segment.type))}
76
+ state={state}
77
+ />
78
+ ))}
79
+ </Flex>
80
+ <input
81
+ type="hidden"
82
+ value={state.value?.toString() ?? ""}
83
+ name={props.name}
84
+ id={props.id}
85
+ />
86
+ </Box>
87
+ );
88
+ };
87
89
 
88
90
  const texts = createTexts({
89
91
  day: {
@@ -12,7 +12,7 @@ import {
12
12
  useSlotRecipe,
13
13
  } from "@chakra-ui/react";
14
14
  import { CalendarOutline24Icon } from "@vygruppen/spor-icon-react";
15
- import React, { forwardRef, PropsWithChildren, useId, useRef } from "react";
15
+ import React, { PropsWithChildren, useId, useRef } from "react";
16
16
  import {
17
17
  AriaDatePickerProps,
18
18
  DateValue,
@@ -62,136 +62,129 @@ type DatePickerProps = Omit<AriaDatePickerProps<DateValue>, "onChange"> &
62
62
  * ```
63
63
  */
64
64
 
65
- export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
66
- (
67
- {
68
- variant,
69
- errorText,
70
- minHeight,
71
- showYearNavigation,
72
- withPortal = true,
73
- width = "auto",
74
- invalid = false,
75
- helperText,
76
- positioning,
77
- css,
78
- ...props
79
- },
80
- externalRef,
81
- ) => {
82
- const chakraFieldProps = useFieldContext();
83
- const state = useDatePickerState({
84
- ...props,
85
- shouldCloseOnSelect: true,
86
- onChange: props.onValueChange,
87
- errorMessage: errorText,
88
- isRequired: props.isRequired ?? chakraFieldProps?.required,
89
- validationState: chakraFieldProps?.invalid ? "invalid" : "valid",
90
- });
91
-
92
- const internalRef = useRef<HTMLDivElement>(null);
93
- const ref = externalRef ?? internalRef;
94
- const { labelProps, fieldProps, buttonProps, dialogProps, calendarProps } =
95
- useDatePicker(
96
- props,
97
- state,
98
- ref as React.MutableRefObject<HTMLDivElement>,
99
- );
100
-
101
- const inputGroupId = `input-group-${useId()}`;
102
-
103
- const recipe = useSlotRecipe({
104
- key: "datePicker",
105
- });
106
-
107
- const styles = recipe({ variant });
108
- const locale = useCurrentLocale();
109
-
110
- const shouldShowCalendar =
111
- state.isOpen && !props.isDisabled && !props.noCalendar;
112
-
113
- const onFieldClick = () => {
114
- if (!props.noCalendar) {
115
- state.setOpen(true);
116
- }
117
- props.onClick?.();
118
- };
119
-
120
- const popoverContent = (
121
- <ChakraPopover.Positioner>
122
- <ChakraPopover.Content css={styles.calendarPopover}>
123
- <ChakraPopover.Body minWidth="20rem">
124
- <Calendar
125
- {...calendarProps}
126
- variant={variant}
127
- showYearNavigation={showYearNavigation}
128
- css={css}
129
- />
130
- </ChakraPopover.Body>
131
- </ChakraPopover.Content>
132
- </ChakraPopover.Positioner>
133
- );
134
-
135
- return (
136
- <I18nProvider locale={locale}>
137
- <Box
138
- position="relative"
139
- display="inline-flex"
140
- flexDirection="column"
141
- width={width}
142
- css={css}
143
- >
144
- <ChakraPopover.Root {...dialogProps} positioning={positioning}>
145
- <Field
146
- display="inline-flex"
147
- id={inputGroupId}
148
- errorText={errorText}
149
- invalid={invalid}
150
- helperText={helperText}
151
- required={props.required}
152
- >
153
- <PopoverAnchor>
154
- <StyledField
155
- variant={variant}
156
- onClick={onFieldClick}
157
- paddingX={3}
158
- minHeight={minHeight}
159
- isDisabled={props.isDisabled}
160
- isActive={props.isActive}
161
- overrideBorderColor={props.overrideBorderColor}
162
- >
163
- {props.noCalendar ? (
164
- <Box pr={3} pl={0.5} mr={0.5}>
165
- <CalendarOutline24Icon />
166
- </Box>
167
- ) : (
168
- <ChakraPopover.Trigger asChild>
169
- <CalendarTriggerButton
170
- paddingLeft={1}
171
- paddingRight={1}
172
- variant={variant}
173
- ref={ref}
174
- {...buttonProps}
175
- />
176
- </ChakraPopover.Trigger>
177
- )}
178
-
179
- <DateField
180
- label={props.label}
181
- labelProps={labelProps}
182
- name={props.name}
183
- {...fieldProps}
184
- />
185
- </StyledField>
186
- </PopoverAnchor>
187
- </Field>
188
-
189
- {shouldShowCalendar &&
190
- (withPortal ? <Portal>{popoverContent}</Portal> : popoverContent)}
191
- </ChakraPopover.Root>
192
- </Box>
193
- </I18nProvider>
194
- );
195
- },
196
- );
197
- DatePicker.displayName = "DatePicker";
65
+ export const DatePicker = ({
66
+ ref: externalRef,
67
+ variant,
68
+ errorText,
69
+ minHeight,
70
+ showYearNavigation,
71
+ withPortal = true,
72
+ width = "auto",
73
+ invalid = false,
74
+ helperText,
75
+ positioning,
76
+ css,
77
+ ...props
78
+ }: DatePickerProps & {
79
+ ref?: React.Ref<HTMLDivElement>;
80
+ }) => {
81
+ const chakraFieldProps = useFieldContext();
82
+ const state = useDatePickerState({
83
+ ...props,
84
+ shouldCloseOnSelect: true,
85
+ onChange: props.onValueChange,
86
+ errorMessage: errorText,
87
+ isRequired: props.isRequired ?? chakraFieldProps?.required,
88
+ validationState: chakraFieldProps?.invalid ? "invalid" : "valid",
89
+ });
90
+
91
+ const internalRef = useRef<HTMLDivElement>(null);
92
+ const ref = externalRef ?? internalRef;
93
+ const { labelProps, fieldProps, buttonProps, dialogProps, calendarProps } =
94
+ useDatePicker(props, state, ref as React.MutableRefObject<HTMLDivElement>);
95
+
96
+ const inputGroupId = `input-group-${useId()}`;
97
+
98
+ const recipe = useSlotRecipe({
99
+ key: "datePicker",
100
+ });
101
+
102
+ const styles = recipe({ variant });
103
+ const locale = useCurrentLocale();
104
+
105
+ const shouldShowCalendar =
106
+ state.isOpen && !props.isDisabled && !props.noCalendar;
107
+
108
+ const onFieldClick = () => {
109
+ if (!props.noCalendar) {
110
+ state.setOpen(true);
111
+ }
112
+ props.onClick?.();
113
+ };
114
+
115
+ const popoverContent = (
116
+ <ChakraPopover.Positioner>
117
+ <ChakraPopover.Content css={styles.calendarPopover}>
118
+ <ChakraPopover.Body minWidth="20rem">
119
+ <Calendar
120
+ {...calendarProps}
121
+ variant={variant}
122
+ showYearNavigation={showYearNavigation}
123
+ css={css}
124
+ />
125
+ </ChakraPopover.Body>
126
+ </ChakraPopover.Content>
127
+ </ChakraPopover.Positioner>
128
+ );
129
+
130
+ return (
131
+ <I18nProvider locale={locale}>
132
+ <Box
133
+ position="relative"
134
+ display="inline-flex"
135
+ flexDirection="column"
136
+ width={width}
137
+ css={css}
138
+ >
139
+ <ChakraPopover.Root {...dialogProps} positioning={positioning}>
140
+ <Field
141
+ display="inline-flex"
142
+ id={inputGroupId}
143
+ errorText={errorText}
144
+ invalid={invalid}
145
+ helperText={helperText}
146
+ required={props.required}
147
+ >
148
+ <PopoverAnchor>
149
+ <StyledField
150
+ variant={variant}
151
+ onClick={onFieldClick}
152
+ paddingX={3}
153
+ minHeight={minHeight}
154
+ isDisabled={props.isDisabled}
155
+ isActive={props.isActive}
156
+ overrideBorderColor={props.overrideBorderColor}
157
+ >
158
+ {props.noCalendar ? (
159
+ <Box pr={3} pl={0.5} mr={0.5}>
160
+ <CalendarOutline24Icon />
161
+ </Box>
162
+ ) : (
163
+ <ChakraPopover.Trigger asChild>
164
+ <CalendarTriggerButton
165
+ paddingLeft={1}
166
+ paddingRight={1}
167
+ variant={variant}
168
+ ref={ref}
169
+ {...buttonProps}
170
+ />
171
+ </ChakraPopover.Trigger>
172
+ )}
173
+
174
+ <DateField
175
+ label={props.label}
176
+ labelProps={labelProps}
177
+ name={props.name}
178
+ {...fieldProps}
179
+ />
180
+ </StyledField>
181
+ </PopoverAnchor>
182
+ </Field>
183
+
184
+ {shouldShowCalendar &&
185
+ (withPortal ? <Portal>{popoverContent}</Portal> : popoverContent)}
186
+ </ChakraPopover.Root>
187
+ </Box>
188
+ </I18nProvider>
189
+ );
190
+ };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { Box, useSlotRecipe } from "@chakra-ui/react";
3
- import { forwardRef, PropsWithChildren, RefObject, useRef } from "react";
3
+ import { PropsWithChildren, RefObject, useRef } from "react";
4
4
  import { useDateSegment } from "react-aria";
5
5
  import { DateFieldState, DateSegment } from "react-stately";
6
6
 
@@ -19,49 +19,53 @@ type DateTimeSegmentProps = PropsWithChildren<DatePickerVariantProps> & {
19
19
  *
20
20
  * This component should be used with the react-aria library, and is not meant to be used directly.
21
21
  * */
22
- export const DateTimeSegment = forwardRef<HTMLDivElement, DateTimeSegmentProps>(
23
- ({ segment, state, ariaLabel, ariaDescription, variant }, externalRef) => {
24
- const internalRef = useRef(null);
25
- const ref = externalRef ?? internalRef;
22
+ export const DateTimeSegment = ({
23
+ ref: externalRef,
24
+ segment,
25
+ state,
26
+ ariaLabel,
27
+ ariaDescription,
28
+ variant,
29
+ }: DateTimeSegmentProps & {
30
+ ref?: React.Ref<HTMLDivElement>;
31
+ }) => {
32
+ const internalRef = useRef(null);
33
+ const ref = externalRef ?? internalRef;
26
34
 
27
- const { segmentProps } = useDateSegment(
28
- segment,
29
- state,
30
- ref as RefObject<HTMLDivElement>,
31
- );
35
+ const { segmentProps } = useDateSegment(
36
+ segment,
37
+ state,
38
+ ref as RefObject<HTMLDivElement>,
39
+ );
32
40
 
33
- const recipe = useSlotRecipe({
34
- key: "datePicker",
35
- });
41
+ const recipe = useSlotRecipe({
42
+ key: "datePicker",
43
+ });
36
44
 
37
- const styles = recipe({
38
- variant,
39
- });
45
+ const styles = recipe({
46
+ variant,
47
+ });
40
48
 
41
- return (
42
- <Box
43
- {...segmentProps}
44
- ref={ref}
45
- style={{
46
- ...segmentProps.style,
47
- boxSizing: "content-box",
48
- }}
49
- textAlign="center"
50
- outline="none"
51
- borderRadius="xs"
52
- fontSize={["mobile.sm", "desktop.sm"]}
53
- css={styles.dateTimeSegment}
54
- aria-label={ariaDescription}
55
- aria-labelledby={ariaLabel}
56
- >
57
- {isPaddable(segment.type)
58
- ? segment.text.padStart(2, "0")
59
- : segment.text}
60
- </Box>
61
- );
62
- },
63
- );
64
- DateTimeSegment.displayName = "DateTimeSegment";
49
+ return (
50
+ <Box
51
+ {...segmentProps}
52
+ ref={ref}
53
+ style={{
54
+ ...segmentProps.style,
55
+ boxSizing: "content-box",
56
+ }}
57
+ textAlign="center"
58
+ outline="none"
59
+ borderRadius="xs"
60
+ fontSize={["mobile.sm", "desktop.sm"]}
61
+ css={styles.dateTimeSegment}
62
+ aria-label={ariaDescription}
63
+ aria-labelledby={ariaLabel}
64
+ >
65
+ {isPaddable(segment.type) ? segment.text.padStart(2, "0") : segment.text}
66
+ </Box>
67
+ );
68
+ };
65
69
 
66
70
  const isPaddable = (segmentType: DateSegment["type"]) =>
67
71
  segmentType === "month" ||
@@ -5,7 +5,7 @@ import {
5
5
  useFieldContext,
6
6
  useSlotRecipe,
7
7
  } from "@chakra-ui/react";
8
- import { forwardRef, PropsWithChildren } from "react";
8
+ import { PropsWithChildren } from "react";
9
9
 
10
10
  import { DatePickerVariantProps } from "./DatePicker";
11
11
  import { CalendarVariants } from "./types";
@@ -17,40 +17,43 @@ type StyledFieldProps = BoxProps &
17
17
  isActive?: boolean;
18
18
  overrideBorderColor?: string;
19
19
  };
20
- export const StyledField = forwardRef<HTMLDivElement, StyledFieldProps>(
21
- function StyledField(props, ref) {
22
- const {
23
- children,
24
- variant,
25
- isDisabled,
26
- isActive,
27
- overrideBorderColor,
28
- ...otherProps
29
- } = props;
30
- const { invalid } = useFieldContext() ?? {
31
- isInvalid: false,
32
- };
20
+ export const StyledField = function StyledField({
21
+ ref,
22
+ ...props
23
+ }: StyledFieldProps & {
24
+ ref?: React.Ref<HTMLDivElement>;
25
+ }) {
26
+ const {
27
+ children,
28
+ variant,
29
+ isDisabled,
30
+ isActive,
31
+ overrideBorderColor,
32
+ ...otherProps
33
+ } = props;
34
+ const { invalid } = useFieldContext() ?? {
35
+ isInvalid: false,
36
+ };
33
37
 
34
- const recipe = useSlotRecipe({
35
- key: "datePicker",
36
- });
37
- const styles = recipe({ variant });
38
+ const recipe = useSlotRecipe({
39
+ key: "datePicker",
40
+ });
41
+ const styles = recipe({ variant });
38
42
 
39
- return (
40
- <Box
41
- {...otherProps}
42
- css={{
43
- ...styles.wrapper,
44
- outlineColor: overrideBorderColor || undefined,
45
- }}
46
- data-active={isActive ? "" : undefined}
47
- ref={ref}
48
- aria-invalid={invalid}
49
- aria-disabled={isDisabled}
50
- fontSize={["mobile.md", "desktop.md"]}
51
- >
52
- {children}
53
- </Box>
54
- );
55
- },
56
- );
43
+ return (
44
+ <Box
45
+ {...otherProps}
46
+ css={{
47
+ ...styles.wrapper,
48
+ outlineColor: overrideBorderColor || undefined,
49
+ }}
50
+ data-active={isActive ? "" : undefined}
51
+ ref={ref}
52
+ aria-invalid={invalid}
53
+ aria-disabled={isDisabled}
54
+ fontSize={["mobile.md", "desktop.md"]}
55
+ >
56
+ {children}
57
+ </Box>
58
+ );
59
+ };
@@ -11,10 +11,12 @@ interface DialogContentProps extends ChakraDialog.ContentProps {
11
11
  children?: React.ReactNode;
12
12
  }
13
13
 
14
- export const DialogContent = React.forwardRef<
15
- HTMLDivElement,
16
- DialogContentProps
17
- >((props, ref) => {
14
+ export const DialogContent = ({
15
+ ref,
16
+ ...props
17
+ }: DialogContentProps & {
18
+ ref?: React.Ref<HTMLDivElement>;
19
+ }) => {
18
20
  const {
19
21
  children,
20
22
  portalled = true,
@@ -33,19 +35,20 @@ export const DialogContent = React.forwardRef<
33
35
  </ChakraDialog.Positioner>
34
36
  </Portal>
35
37
  );
36
- });
37
- DialogContent.displayName = "DialogContent";
38
+ };
38
39
 
39
- export const DialogCloseTrigger = React.forwardRef<
40
- HTMLButtonElement,
41
- ChakraDialog.CloseTriggerProps
42
- >(function DialogCloseTrigger(props, ref) {
40
+ export const DialogCloseTrigger = function DialogCloseTrigger({
41
+ ref,
42
+ ...props
43
+ }: ChakraDialog.CloseTriggerProps & {
44
+ ref?: React.Ref<HTMLButtonElement>;
45
+ }) {
43
46
  return (
44
47
  <ChakraDialog.CloseTrigger ref={ref} position="absolute" {...props} asChild>
45
48
  <CloseButton size="md" />
46
49
  </ChakraDialog.CloseTrigger>
47
50
  );
48
- });
51
+ };
49
52
 
50
53
  export const DialogRoot = ChakraDialog.Root;
51
54
  export const DialogFooter = ChakraDialog.Footer;