@coopdigital/react 1.19.0 → 1.20.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/dist/components/AlertBanner/AlertBanner.js +5 -2
- package/dist/components/Author/Author.js +5 -2
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Card/Card.d.ts +96 -49
- package/dist/components/Card/Card.js +61 -60
- package/dist/components/Card/index.d.ts +2 -2
- package/dist/components/Card/index.js +2 -2
- package/dist/components/Checkbox/Checkbox.js +5 -2
- package/dist/components/DatePicker/DatePicker.js +5 -4
- package/dist/components/DatePicker/datepicker-utils.js +12 -11
- package/dist/components/Dialog/Dialog.js +6 -3
- package/dist/components/Expandable/Expandable.js +6 -3
- package/dist/components/Field/Field.js +1 -1
- package/dist/components/FieldMarkers/Error.js +5 -2
- package/dist/components/FieldMarkers/Hint.js +5 -2
- package/dist/components/FieldMarkers/Label.js +5 -2
- package/dist/components/Fieldset/Fieldset.js +10 -4
- package/dist/components/Flourish/Flourish.js +6 -3
- package/dist/components/Form/Form.js +5 -2
- package/dist/components/Image/Image.d.ts +3 -5
- package/dist/components/Image/Image.js +10 -7
- package/dist/components/LoadingSpinner/LoadingSpinner.js +5 -2
- package/dist/components/Logo/Logo.js +5 -2
- package/dist/components/Picture/Picture.d.ts +15 -0
- package/dist/components/Picture/Picture.js +17 -0
- package/dist/components/Picture/index.d.ts +2 -0
- package/dist/components/Picture/index.js +5 -0
- package/dist/components/Prose/Prose.js +5 -2
- package/dist/components/Radio/Radio.js +5 -2
- package/dist/components/Searchbox/Searchbox.js +6 -6
- package/dist/components/Select/Select.js +5 -2
- package/dist/components/Signpost/Signpost.js +6 -6
- package/dist/components/SkipNav/SkipNav.js +5 -2
- package/dist/components/Squircle/Squircle.js +5 -2
- package/dist/components/ValidationSummary/ValidationSummary.js +5 -2
- package/dist/components/icons/AccountCircleFilledIcon.js +5 -2
- package/dist/components/icons/AccountCircleIcon.js +5 -2
- package/dist/components/icons/AccountFilledIcon.js +5 -2
- package/dist/components/icons/AccountIcon.js +5 -2
- package/dist/components/icons/AddIcon.js +5 -2
- package/dist/components/icons/AppsFilledIcon.js +5 -2
- package/dist/components/icons/AppsIcon.js +5 -2
- package/dist/components/icons/ArrowDownIcon.js +5 -2
- package/dist/components/icons/ArrowLeftIcon.js +5 -2
- package/dist/components/icons/ArrowRightIcon.js +5 -2
- package/dist/components/icons/ArrowUpIcon.js +5 -2
- package/dist/components/icons/BackspaceFilledIcon.js +5 -2
- package/dist/components/icons/BackspaceIcon.js +5 -2
- package/dist/components/icons/BasketFilledIcon.js +5 -2
- package/dist/components/icons/BasketIcon.js +5 -2
- package/dist/components/icons/BellFilledIcon.js +5 -2
- package/dist/components/icons/BellIcon.js +5 -2
- package/dist/components/icons/BroomIcon.js +5 -2
- package/dist/components/icons/CalendarFilledIcon.js +5 -2
- package/dist/components/icons/CalendarIcon.js +5 -2
- package/dist/components/icons/CashFilledIcon.js +5 -2
- package/dist/components/icons/CashIcon.js +5 -2
- package/dist/components/icons/ChevronDownIcon.js +5 -2
- package/dist/components/icons/ChevronLeftIcon.js +5 -2
- package/dist/components/icons/ChevronRightIcon.js +5 -2
- package/dist/components/icons/ChevronUpIcon.js +5 -2
- package/dist/components/icons/CircleBurgerFilledIcon.js +5 -2
- package/dist/components/icons/CircleBurgerIcon.js +5 -2
- package/dist/components/icons/ClipboardFilledIcon.js +5 -2
- package/dist/components/icons/ClipboardIcon.js +5 -2
- package/dist/components/icons/ClockFilledIcon.js +5 -2
- package/dist/components/icons/ClockIcon.js +5 -2
- package/dist/components/icons/CloseAltFilledIcon.js +5 -2
- package/dist/components/icons/CloseAltIcon.js +5 -2
- package/dist/components/icons/CogIcon.js +5 -2
- package/dist/components/icons/CommunityFilledIcon.js +5 -2
- package/dist/components/icons/CommunityIcon.js +5 -2
- package/dist/components/icons/ComputerIcon.js +5 -2
- package/dist/components/icons/ContactFilledIcon.js +5 -2
- package/dist/components/icons/ContactIcon.js +5 -2
- package/dist/components/icons/ContactlessFilledIcon.js +5 -2
- package/dist/components/icons/ContactlessIcon.js +5 -2
- package/dist/components/icons/CoopLiveIcon.js +5 -2
- package/dist/components/icons/CoopLocationFilledIcon.js +5 -2
- package/dist/components/icons/CoopLogoIcon.js +5 -2
- package/dist/components/icons/CoopMembershipCardFilledIcon.js +5 -2
- package/dist/components/icons/CreditCardFilledIcon.js +5 -2
- package/dist/components/icons/CreditCardIcon.js +5 -2
- package/dist/components/icons/CrossIcon.js +5 -2
- package/dist/components/icons/DocumentIcon.js +5 -2
- package/dist/components/icons/DownloadIcon.js +5 -2
- package/dist/components/icons/EnterStoreIcon.js +5 -2
- package/dist/components/icons/ExitStoreIcon.js +5 -2
- package/dist/components/icons/EyeFilledIcon.js +5 -2
- package/dist/components/icons/EyeIcon.js +5 -2
- package/dist/components/icons/EyeStrikeFilledIcon.js +5 -2
- package/dist/components/icons/EyeStrikeIcon.js +5 -2
- package/dist/components/icons/FeedbackFilledIcon.js +5 -2
- package/dist/components/icons/FeedbackIcon.js +5 -2
- package/dist/components/icons/FilterIcon.js +5 -2
- package/dist/components/icons/GiftCardFilledIcon.js +5 -2
- package/dist/components/icons/GiftCardIcon.js +5 -2
- package/dist/components/icons/GiftFilledIcon.js +5 -2
- package/dist/components/icons/GiftIcon.js +5 -2
- package/dist/components/icons/HelpFilledIcon.js +5 -2
- package/dist/components/icons/HelpIcon.js +5 -2
- package/dist/components/icons/HomeFilledIcon.js +5 -2
- package/dist/components/icons/HomeIcon.js +5 -2
- package/dist/components/icons/HowDoIAssistantIcon.js +5 -2
- package/dist/components/icons/InfoIcon.js +5 -2
- package/dist/components/icons/KebabIcon.js +5 -2
- package/dist/components/icons/LoadingIcon.js +5 -2
- package/dist/components/icons/LocationFilledIcon.js +5 -2
- package/dist/components/icons/LocationIcon.js +5 -2
- package/dist/components/icons/LogoutIcon.js +5 -2
- package/dist/components/icons/MailIcon.js +5 -2
- package/dist/components/icons/MenuIcon.js +5 -2
- package/dist/components/icons/MessageIcon.js +5 -2
- package/dist/components/icons/MinusIcon.js +5 -2
- package/dist/components/icons/NotesFilledIcon.js +5 -2
- package/dist/components/icons/NotesIcon.js +5 -2
- package/dist/components/icons/OpenNewIcon.js +5 -2
- package/dist/components/icons/OwnBagIcon.js +5 -2
- package/dist/components/icons/PadlockIcon.js +5 -2
- package/dist/components/icons/PencilIcon.js +5 -2
- package/dist/components/icons/PhoneIcon.js +5 -2
- package/dist/components/icons/PowerIcon.js +5 -2
- package/dist/components/icons/SaveFilledIcon.js +5 -2
- package/dist/components/icons/SaveIcon.js +5 -2
- package/dist/components/icons/ScooterIcon.js +5 -2
- package/dist/components/icons/SearchFilledIcon.js +5 -2
- package/dist/components/icons/SearchIcon.js +5 -2
- package/dist/components/icons/SendIcon.js +5 -2
- package/dist/components/icons/SpannerIcon.js +5 -2
- package/dist/components/icons/StarFilledIcon.js +5 -2
- package/dist/components/icons/StarIcon.js +5 -2
- package/dist/components/icons/TickAltFilledIcon.js +5 -2
- package/dist/components/icons/TickAltIcon.js +5 -2
- package/dist/components/icons/TickIcon.js +5 -2
- package/dist/components/icons/TruckIcon.js +5 -2
- package/dist/components/icons/UserWipeIcon.js +5 -2
- package/dist/components/icons/VoucherFilledIcon.js +5 -2
- package/dist/components/icons/VoucherIcon.js +5 -2
- package/dist/components/icons/WarningCircleFilledIcon.js +5 -2
- package/dist/components/icons/WarningCircleIcon.js +5 -2
- package/dist/components/icons/WarningFilledIcon.js +5 -2
- package/dist/components/icons/WarningIcon.js +5 -2
- package/dist/components/icons/WifiIcon.js +5 -2
- package/dist/components/icons/WriteIcon.js +5 -2
- package/dist/hooks/useSlots.js +4 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -2
- package/package.json +11 -10
- package/src/components/Author/Author.tsx +1 -1
- package/src/components/Button/Button.tsx +2 -2
- package/src/components/Card/Card.tsx +149 -105
- package/src/components/Checkbox/Checkbox.tsx +2 -2
- package/src/components/DatePicker/DatePicker.tsx +8 -6
- package/src/components/Dialog/Dialog.tsx +2 -2
- package/src/components/Expandable/Expandable.tsx +3 -3
- package/src/components/Field/Field.tsx +7 -6
- package/src/components/FieldMarkers/Label.tsx +1 -1
- package/src/components/Fieldset/Fieldset.tsx +4 -4
- package/src/components/Flourish/Flourish.tsx +1 -1
- package/src/components/Image/Image.tsx +15 -22
- package/src/components/LoadingSpinner/LoadingSpinner.tsx +1 -1
- package/src/components/PasswordInput/PasswordInput.tsx +3 -3
- package/src/components/Picture/Picture.tsx +36 -0
- package/src/components/Picture/index.ts +5 -0
- package/src/components/Pill/Pill.tsx +3 -3
- package/src/components/Popover/Popover.tsx +2 -2
- package/src/components/Prose/Prose.tsx +1 -1
- package/src/components/Radio/Radio.tsx +2 -2
- package/src/components/Searchbox/Searchbox.context.tsx +1 -1
- package/src/components/Searchbox/Searchbox.tsx +9 -10
- package/src/components/Select/Select.tsx +2 -2
- package/src/components/Signpost/Signpost.tsx +3 -3
- package/src/components/Squircle/Squircle.tsx +2 -1
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/TextInput/TextInput.tsx +2 -2
- package/src/components/Textarea/Textarea.tsx +3 -3
- package/src/components/ValidationSummary/ValidationSummary.tsx +5 -2
- package/src/components/icons/AccountCircleFilledIcon.tsx +1 -1
- package/src/components/icons/AccountCircleIcon.tsx +1 -1
- package/src/components/icons/AccountFilledIcon.tsx +1 -1
- package/src/components/icons/AccountIcon.tsx +1 -1
- package/src/components/icons/AddIcon.tsx +1 -1
- package/src/components/icons/AppsFilledIcon.tsx +1 -1
- package/src/components/icons/AppsIcon.tsx +1 -1
- package/src/components/icons/ArrowDownIcon.tsx +1 -1
- package/src/components/icons/ArrowLeftIcon.tsx +1 -1
- package/src/components/icons/ArrowRightIcon.tsx +1 -1
- package/src/components/icons/ArrowUpIcon.tsx +1 -1
- package/src/components/icons/BackspaceFilledIcon.tsx +1 -1
- package/src/components/icons/BackspaceIcon.tsx +1 -1
- package/src/components/icons/BasketFilledIcon.tsx +1 -1
- package/src/components/icons/BasketIcon.tsx +1 -1
- package/src/components/icons/BellFilledIcon.tsx +1 -1
- package/src/components/icons/BellIcon.tsx +1 -1
- package/src/components/icons/BroomIcon.tsx +1 -1
- package/src/components/icons/CalendarFilledIcon.tsx +1 -1
- package/src/components/icons/CalendarIcon.tsx +1 -1
- package/src/components/icons/CashFilledIcon.tsx +1 -1
- package/src/components/icons/CashIcon.tsx +1 -1
- package/src/components/icons/ChevronDownIcon.tsx +1 -1
- package/src/components/icons/ChevronLeftIcon.tsx +1 -1
- package/src/components/icons/ChevronRightIcon.tsx +1 -1
- package/src/components/icons/ChevronUpIcon.tsx +1 -1
- package/src/components/icons/CircleBurgerFilledIcon.tsx +1 -1
- package/src/components/icons/CircleBurgerIcon.tsx +1 -1
- package/src/components/icons/ClipboardFilledIcon.tsx +1 -1
- package/src/components/icons/ClipboardIcon.tsx +1 -1
- package/src/components/icons/ClockFilledIcon.tsx +1 -1
- package/src/components/icons/ClockIcon.tsx +1 -1
- package/src/components/icons/CloseAltFilledIcon.tsx +1 -1
- package/src/components/icons/CloseAltIcon.tsx +1 -1
- package/src/components/icons/CogIcon.tsx +1 -1
- package/src/components/icons/CommunityFilledIcon.tsx +1 -1
- package/src/components/icons/CommunityIcon.tsx +1 -1
- package/src/components/icons/ComputerIcon.tsx +1 -1
- package/src/components/icons/ContactFilledIcon.tsx +1 -1
- package/src/components/icons/ContactIcon.tsx +1 -1
- package/src/components/icons/ContactlessFilledIcon.tsx +1 -1
- package/src/components/icons/ContactlessIcon.tsx +1 -1
- package/src/components/icons/CoopLiveIcon.tsx +1 -1
- package/src/components/icons/CoopLocationFilledIcon.tsx +1 -1
- package/src/components/icons/CoopLogoIcon.tsx +1 -1
- package/src/components/icons/CoopMembershipCardFilledIcon.tsx +1 -1
- package/src/components/icons/CreditCardFilledIcon.tsx +1 -1
- package/src/components/icons/CreditCardIcon.tsx +1 -1
- package/src/components/icons/CrossIcon.tsx +1 -1
- package/src/components/icons/DocumentIcon.tsx +1 -1
- package/src/components/icons/DownloadIcon.tsx +1 -1
- package/src/components/icons/EnterStoreIcon.tsx +1 -1
- package/src/components/icons/ExitStoreIcon.tsx +1 -1
- package/src/components/icons/EyeFilledIcon.tsx +1 -1
- package/src/components/icons/EyeIcon.tsx +1 -1
- package/src/components/icons/EyeStrikeFilledIcon.tsx +1 -1
- package/src/components/icons/EyeStrikeIcon.tsx +1 -1
- package/src/components/icons/FeedbackFilledIcon.tsx +1 -1
- package/src/components/icons/FeedbackIcon.tsx +1 -1
- package/src/components/icons/FilterIcon.tsx +1 -1
- package/src/components/icons/GiftCardFilledIcon.tsx +1 -1
- package/src/components/icons/GiftCardIcon.tsx +1 -1
- package/src/components/icons/GiftFilledIcon.tsx +1 -1
- package/src/components/icons/GiftIcon.tsx +1 -1
- package/src/components/icons/HelpFilledIcon.tsx +1 -1
- package/src/components/icons/HelpIcon.tsx +1 -1
- package/src/components/icons/HomeFilledIcon.tsx +1 -1
- package/src/components/icons/HomeIcon.tsx +1 -1
- package/src/components/icons/HowDoIAssistantIcon.tsx +1 -1
- package/src/components/icons/InfoIcon.tsx +1 -1
- package/src/components/icons/KebabIcon.tsx +1 -1
- package/src/components/icons/LoadingIcon.tsx +1 -1
- package/src/components/icons/LocationFilledIcon.tsx +1 -1
- package/src/components/icons/LocationIcon.tsx +1 -1
- package/src/components/icons/LogoutIcon.tsx +1 -1
- package/src/components/icons/MailIcon.tsx +1 -1
- package/src/components/icons/MenuIcon.tsx +1 -1
- package/src/components/icons/MessageIcon.tsx +1 -1
- package/src/components/icons/MinusIcon.tsx +1 -1
- package/src/components/icons/NotesFilledIcon.tsx +1 -1
- package/src/components/icons/NotesIcon.tsx +1 -1
- package/src/components/icons/OpenNewIcon.tsx +1 -1
- package/src/components/icons/OwnBagIcon.tsx +1 -1
- package/src/components/icons/PadlockIcon.tsx +1 -1
- package/src/components/icons/PencilIcon.tsx +1 -1
- package/src/components/icons/PhoneIcon.tsx +1 -1
- package/src/components/icons/PowerIcon.tsx +1 -1
- package/src/components/icons/SaveFilledIcon.tsx +1 -1
- package/src/components/icons/SaveIcon.tsx +1 -1
- package/src/components/icons/ScooterIcon.tsx +1 -1
- package/src/components/icons/SearchFilledIcon.tsx +1 -1
- package/src/components/icons/SearchIcon.tsx +1 -1
- package/src/components/icons/SendIcon.tsx +1 -1
- package/src/components/icons/SpannerIcon.tsx +1 -1
- package/src/components/icons/StarFilledIcon.tsx +1 -1
- package/src/components/icons/StarIcon.tsx +1 -1
- package/src/components/icons/TickAltFilledIcon.tsx +1 -1
- package/src/components/icons/TickAltIcon.tsx +1 -1
- package/src/components/icons/TickIcon.tsx +1 -1
- package/src/components/icons/TruckIcon.tsx +1 -1
- package/src/components/icons/UserWipeIcon.tsx +1 -1
- package/src/components/icons/VoucherFilledIcon.tsx +1 -1
- package/src/components/icons/VoucherIcon.tsx +1 -1
- package/src/components/icons/WarningCircleFilledIcon.tsx +1 -1
- package/src/components/icons/WarningCircleIcon.tsx +1 -1
- package/src/components/icons/WarningFilledIcon.tsx +1 -1
- package/src/components/icons/WarningIcon.tsx +1 -1
- package/src/components/icons/WifiIcon.tsx +1 -1
- package/src/components/icons/WriteIcon.tsx +1 -1
- package/src/hooks/useSlots.ts +1 -1
- package/src/index.ts +1 -0
|
@@ -1,154 +1,153 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
AnchorHTMLAttributes,
|
|
3
|
+
ForwardRefExoticComponent,
|
|
4
|
+
HTMLAttributes,
|
|
5
|
+
JSX,
|
|
6
|
+
Ref,
|
|
7
|
+
} from "react"
|
|
2
8
|
|
|
3
9
|
import clsx from "clsx"
|
|
4
10
|
import React from "react"
|
|
5
11
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
12
|
+
import { Image, ImageProps } from "@/components/Image"
|
|
13
|
+
import Picture, { PictureProps } from "@/components/Picture"
|
|
14
|
+
import { useSlots } from "@/hooks/useSlots"
|
|
15
|
+
import { StandardSizes } from "@/types"
|
|
16
|
+
import { hasUserBg } from "@/utils"
|
|
10
17
|
|
|
11
18
|
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
/** **(Optional)** Specify how the
|
|
19
|
+
/** **(Optional)** Specify how the Card behaves across screen sizes.
|
|
13
20
|
*
|
|
14
|
-
*
|
|
21
|
+
* For finer control, use utility classes or custom CSS to control flex-direction. */
|
|
22
|
+
adaptive?: "sm" | "md"
|
|
23
|
+
/** **(Optional)** Specify an element to use for the container.
|
|
15
24
|
*
|
|
16
|
-
* Default:
|
|
25
|
+
* Default: `article`
|
|
17
26
|
*/
|
|
18
|
-
|
|
19
|
-
/** **(Optional)**
|
|
20
|
-
chevron?: boolean
|
|
21
|
-
/** **(Optional)** Content inside the component. Children that are not assigned to a slot will be grouped together and rendered under the main Card content. */
|
|
27
|
+
as?: "article" | "section" | "figure" | "div"
|
|
28
|
+
/** **(Optional)** Content inside the component. */
|
|
22
29
|
children?: React.ReactNode
|
|
23
|
-
/** **(Optional)** Specify additional CSS classes
|
|
30
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
24
31
|
className?: string
|
|
25
|
-
/** **(Optional)** Specify the
|
|
26
|
-
href?: string
|
|
27
|
-
/** **(Optional)** Specify a custom element to use instead of `a`. */
|
|
28
|
-
// oxlint-disable-next-line typescript/no-explicit-any
|
|
29
|
-
hrefAs?: React.FC<any> | ForwardRefExoticComponent<any> | string
|
|
30
|
-
/** **(Optional)** Specify the orientation of the Card.
|
|
31
|
-
*
|
|
32
|
-
* Default: vertical
|
|
33
|
-
*/
|
|
32
|
+
/** **(Optional)** Specify the Card orientation. */
|
|
34
33
|
orientation?: "vertical" | "horizontal"
|
|
34
|
+
/** **(Optional)** Specify the Card padding. */
|
|
35
|
+
padding?: StandardSizes
|
|
36
|
+
/** **(Optional)** Specify the Card border radius. */
|
|
37
|
+
radius?: StandardSizes
|
|
35
38
|
/** **(Optional)** Specify a custom React ref for this component. */
|
|
36
39
|
ref?: Ref<HTMLDivElement>
|
|
37
40
|
/** **(Optional)** Enable additional styles to use the Card as a signpost.
|
|
38
41
|
*
|
|
39
|
-
* Text is vertically aligned centrally and the
|
|
42
|
+
* Text is vertically aligned centrally and the Icon is enlarged. */
|
|
40
43
|
signpost?: boolean
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
interface
|
|
44
|
-
/** **(Optional)**
|
|
46
|
+
interface CardHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
47
|
+
/** **(Optional)** Specify an element to use for the heading.
|
|
48
|
+
*
|
|
49
|
+
* Default: `h3`
|
|
50
|
+
*/
|
|
51
|
+
as?: "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div" | "strong" | "figcaption"
|
|
52
|
+
/** **(Optional)** Content inside the component. */
|
|
45
53
|
children?: React.ReactNode
|
|
46
|
-
/** **(Optional)** Specify additional CSS classes
|
|
54
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
47
55
|
className?: string
|
|
48
56
|
}
|
|
49
57
|
|
|
50
|
-
interface
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
// interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
59
|
+
// /** **(Optional)** Content inside the Body. */
|
|
60
|
+
// children?: React.ReactNode
|
|
61
|
+
// }
|
|
62
|
+
|
|
63
|
+
interface CardIconProps extends HTMLAttributes<HTMLDivElement> {
|
|
64
|
+
/** **(Optional)** Content inside the component. */
|
|
54
65
|
children?: React.ReactNode
|
|
55
|
-
/** **(Optional)** Specify additional CSS classes
|
|
66
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
56
67
|
className?: string
|
|
57
68
|
}
|
|
58
69
|
|
|
59
|
-
interface
|
|
60
|
-
/** **(Optional)** Content inside the
|
|
70
|
+
interface CardContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
71
|
+
/** **(Optional)** Content inside the component. */
|
|
61
72
|
children?: React.ReactNode
|
|
73
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
74
|
+
className?: string
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface CardLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
78
|
+
/** **(Optional)** Specify an element to use instead of native `a`. */
|
|
79
|
+
// oxlint-disable-next-line typescript/no-explicit-any
|
|
80
|
+
as?: React.FC<any> | ForwardRefExoticComponent<any> | string
|
|
81
|
+
/** **(Optional)** Content inside the component. */
|
|
82
|
+
children?: React.ReactNode
|
|
83
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
84
|
+
className?: string
|
|
62
85
|
}
|
|
63
86
|
|
|
64
87
|
interface CardBadgeProps extends HTMLAttributes<HTMLDivElement> {
|
|
65
|
-
/** **(Optional)** Specify
|
|
88
|
+
/** **(Optional)** Specify alignment relative to container.
|
|
89
|
+
*
|
|
90
|
+
* Default: `right`
|
|
91
|
+
*/
|
|
66
92
|
align?: "left" | "right"
|
|
67
|
-
/** **(Optional)** Content inside the
|
|
93
|
+
/** **(Optional)** Content inside the component. */
|
|
68
94
|
children?: React.ReactNode
|
|
69
|
-
/** **(Optional)** Specify additional CSS classes
|
|
95
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
70
96
|
className?: string
|
|
71
|
-
/** **(Optional)** Specify
|
|
97
|
+
/** **(Optional)** Specify position relative to top corner.
|
|
98
|
+
*
|
|
99
|
+
* Default: `popout`
|
|
100
|
+
*/
|
|
72
101
|
position?: "inset" | "popout"
|
|
73
102
|
}
|
|
74
103
|
|
|
75
|
-
|
|
76
|
-
/** **(Optional)** Specify on which side the
|
|
104
|
+
interface CardPictureProps extends PictureProps {
|
|
105
|
+
/** **(Optional)** Specify on which side the Picture should appear. */
|
|
77
106
|
align?: "left" | "right"
|
|
107
|
+
/** **(Optional)** Content inside the component. */
|
|
108
|
+
children?: React.ReactNode
|
|
109
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
110
|
+
className?: string
|
|
78
111
|
}
|
|
79
112
|
|
|
80
113
|
const componentSlots = {
|
|
81
114
|
CardBadge: null,
|
|
82
|
-
CardBody: null,
|
|
83
|
-
CardHeading: null,
|
|
84
|
-
CardImage: null,
|
|
85
|
-
CardLabel: null,
|
|
86
115
|
Children: null,
|
|
87
116
|
}
|
|
88
117
|
|
|
89
|
-
function getCardLinkElement(as: CardProps["hrefAs"], href?: string) {
|
|
90
|
-
return {
|
|
91
|
-
element: as ?? "a",
|
|
92
|
-
props: {
|
|
93
|
-
className: "coop-card--link",
|
|
94
|
-
href,
|
|
95
|
-
},
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
118
|
const Card = ({
|
|
100
119
|
adaptive,
|
|
101
|
-
|
|
102
|
-
chevron = false,
|
|
120
|
+
as = "article",
|
|
103
121
|
children,
|
|
104
122
|
className,
|
|
105
|
-
href,
|
|
106
|
-
hrefAs,
|
|
107
123
|
orientation,
|
|
124
|
+
padding,
|
|
125
|
+
radius,
|
|
108
126
|
ref,
|
|
109
127
|
signpost,
|
|
110
128
|
...props
|
|
111
129
|
}: CardProps): JSX.Element => {
|
|
112
|
-
const { element: linkElement, props: linkProps } = getCardLinkElement(hrefAs, href)
|
|
113
|
-
|
|
114
130
|
const slots = { ...useSlots(componentSlots, children) }
|
|
115
|
-
const hasLinkWrapper = href && !slots.CardHeading
|
|
116
131
|
|
|
117
132
|
const componentProps = {
|
|
118
133
|
className: clsx("coop-card", !hasUserBg(className) && "bg-white", className),
|
|
119
|
-
// "data-behaviour": behaviour ?? undefined,
|
|
120
134
|
"data-adaptive": adaptive ?? undefined,
|
|
121
135
|
"data-orientation": orientation ?? undefined,
|
|
136
|
+
"data-padding": padding ?? undefined,
|
|
137
|
+
"data-radius": radius ?? undefined,
|
|
122
138
|
"data-signpost": signpost ?? undefined,
|
|
123
139
|
...props,
|
|
124
140
|
}
|
|
125
141
|
|
|
126
|
-
|
|
127
|
-
slots.CardHeading = React.createElement(linkElement, linkProps, slots.CardHeading)
|
|
128
|
-
}
|
|
142
|
+
const cardContent = React.createElement(as, { ref, ...componentProps }, slots.Children)
|
|
129
143
|
|
|
130
|
-
return (
|
|
131
|
-
<
|
|
132
|
-
{
|
|
144
|
+
return slots.CardBadge ? (
|
|
145
|
+
<div className="coop-card-wrapper">
|
|
146
|
+
{cardContent}
|
|
133
147
|
{slots.CardBadge}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
? { className: "coop-card--content", href }
|
|
138
|
-
: { className: "coop-card--content" },
|
|
139
|
-
<>
|
|
140
|
-
{slots.CardLabel}
|
|
141
|
-
{slots.CardHeading}
|
|
142
|
-
{slots.CardBody}
|
|
143
|
-
{slots.Children}
|
|
144
|
-
</>
|
|
145
|
-
)}
|
|
146
|
-
{(chevron || signpost) && (
|
|
147
|
-
<span aria-hidden="true" className="coop-card--icon" role="presentation">
|
|
148
|
-
<ChevronRightIcon />
|
|
149
|
-
</span>
|
|
150
|
-
)}
|
|
151
|
-
</article>
|
|
148
|
+
</div>
|
|
149
|
+
) : (
|
|
150
|
+
cardContent
|
|
152
151
|
)
|
|
153
152
|
}
|
|
154
153
|
|
|
@@ -165,47 +164,92 @@ const CardHeading = ({
|
|
|
165
164
|
)
|
|
166
165
|
}
|
|
167
166
|
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
const CardIcon = ({ children, className, ...props }: CardIconProps): JSX.Element => {
|
|
168
|
+
const componentProps = {
|
|
169
|
+
className: clsx("coop-card--icon", className),
|
|
170
|
+
...props,
|
|
171
|
+
}
|
|
172
|
+
return <span {...componentProps}>{children}</span>
|
|
174
173
|
}
|
|
175
174
|
|
|
176
175
|
const CardBadge = ({
|
|
177
176
|
align = "right",
|
|
178
177
|
children,
|
|
178
|
+
className,
|
|
179
179
|
position = "popout",
|
|
180
180
|
...props
|
|
181
181
|
}: CardBadgeProps): JSX.Element => {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
182
|
+
const componentProps = {
|
|
183
|
+
className: clsx("coop-card--badge", className),
|
|
184
|
+
"data-align": align,
|
|
185
|
+
"data-position": position,
|
|
186
|
+
...props,
|
|
187
|
+
}
|
|
188
|
+
return <div {...componentProps}>{children}</div>
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// const CardBody = ({ children }: CardBodyProps): JSX.Element => {
|
|
192
|
+
// return <>{children}</>
|
|
193
|
+
// }
|
|
194
|
+
|
|
195
|
+
const CardPicture = ({
|
|
196
|
+
align,
|
|
197
|
+
children,
|
|
198
|
+
className,
|
|
199
|
+
crop,
|
|
200
|
+
...props
|
|
201
|
+
}: CardPictureProps): JSX.Element => {
|
|
202
|
+
const componentProps = {
|
|
203
|
+
className: clsx("coop-card--picture", className),
|
|
204
|
+
"data-align": align ?? undefined,
|
|
205
|
+
"data-crop": crop ?? "wide",
|
|
206
|
+
...props,
|
|
207
|
+
}
|
|
208
|
+
return <Picture {...componentProps}>{children}</Picture>
|
|
187
209
|
}
|
|
188
210
|
|
|
189
|
-
const
|
|
190
|
-
|
|
211
|
+
const CardImage = (props: ImageProps): JSX.Element => <Image {...props} />
|
|
212
|
+
|
|
213
|
+
const CardContent = ({ children, className, ...props }: CardContentProps): JSX.Element => {
|
|
214
|
+
const componentProps = {
|
|
215
|
+
className: clsx("coop-card--content", className),
|
|
216
|
+
...props,
|
|
217
|
+
}
|
|
218
|
+
return <div {...componentProps}>{children}</div>
|
|
191
219
|
}
|
|
192
220
|
|
|
193
|
-
const
|
|
194
|
-
|
|
221
|
+
const CardLink = ({
|
|
222
|
+
as = "a",
|
|
223
|
+
children,
|
|
224
|
+
className,
|
|
225
|
+
href,
|
|
226
|
+
...props
|
|
227
|
+
}: CardLinkProps): JSX.Element => {
|
|
228
|
+
return React.createElement(
|
|
229
|
+
as,
|
|
230
|
+
{ className: clsx("coop-card--link", className), href, ...props },
|
|
231
|
+
children
|
|
232
|
+
)
|
|
195
233
|
}
|
|
196
234
|
|
|
197
235
|
Card.slot = { name: "Card" }
|
|
198
|
-
CardLabel.slot = { name: "CardLabel" }
|
|
199
236
|
CardHeading.slot = { name: "CardHeading" }
|
|
200
237
|
CardBadge.slot = { name: "CardBadge" }
|
|
201
|
-
|
|
238
|
+
CardIcon.slot = { name: "CardIcon" }
|
|
239
|
+
CardContent.slot = { name: "CardContent" }
|
|
202
240
|
CardImage.slot = { name: "CardImage" }
|
|
241
|
+
CardLink.slot = { name: "CardLink" }
|
|
242
|
+
|
|
243
|
+
CardPicture.slot = { name: "CardPicture" }
|
|
203
244
|
|
|
204
|
-
Card.
|
|
245
|
+
Card.Link = CardLink
|
|
205
246
|
Card.Heading = CardHeading
|
|
206
247
|
Card.Badge = CardBadge
|
|
207
|
-
Card.
|
|
248
|
+
Card.Content = CardContent
|
|
249
|
+
Card.Icon = CardIcon
|
|
208
250
|
Card.Image = CardImage
|
|
209
251
|
|
|
252
|
+
Card.Picture = CardPicture
|
|
253
|
+
|
|
210
254
|
export default Card
|
|
211
|
-
export { Card, CardBadge,
|
|
255
|
+
export { Card, CardBadge, CardContent, CardHeading, CardIcon, CardImage, CardLink, CardPicture }
|
|
@@ -3,8 +3,8 @@ import type { InputHTMLAttributes, JSX, Ref } from "react"
|
|
|
3
3
|
|
|
4
4
|
import clsx from "clsx"
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useField } from "@/components/Field/Field.context"
|
|
7
|
+
import { StandardSizes } from "@/types"
|
|
8
8
|
|
|
9
9
|
export interface CheckboxProps extends Omit<
|
|
10
10
|
InputHTMLAttributes<HTMLInputElement>,
|
|
@@ -13,7 +13,14 @@ import clsx from "clsx"
|
|
|
13
13
|
import { useCallback, useMemo, useReducer } from "react"
|
|
14
14
|
import { DayPicker } from "react-day-picker"
|
|
15
15
|
|
|
16
|
-
import type { StandardSizes } from "
|
|
16
|
+
import type { StandardSizes } from "@/types"
|
|
17
|
+
|
|
18
|
+
import { Button } from "@/components/Button"
|
|
19
|
+
import { useField } from "@/components/Field/Field.context"
|
|
20
|
+
import { CalendarIcon, CrossIcon, TickIcon } from "@/components/icons"
|
|
21
|
+
import { Popover } from "@/components/Popover"
|
|
22
|
+
import { TextInput } from "@/components/TextInput"
|
|
23
|
+
|
|
17
24
|
import type {
|
|
18
25
|
DateRange,
|
|
19
26
|
DateRangeStr,
|
|
@@ -23,11 +30,6 @@ import type {
|
|
|
23
30
|
TDateSingle,
|
|
24
31
|
} from "./datepicker-utils"
|
|
25
32
|
|
|
26
|
-
import { Button } from "../Button"
|
|
27
|
-
import { useField } from "../Field/Field.context"
|
|
28
|
-
import { CalendarIcon, CrossIcon, TickIcon } from "../icons"
|
|
29
|
-
import { Popover } from "../Popover"
|
|
30
|
-
import { TextInput } from "../TextInput"
|
|
31
33
|
import {
|
|
32
34
|
getDateValues,
|
|
33
35
|
getDefaultMonth,
|
|
@@ -17,8 +17,8 @@ import React, {
|
|
|
17
17
|
useRef,
|
|
18
18
|
} from "react"
|
|
19
19
|
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { CrossIcon } from "@/components/icons"
|
|
21
|
+
import { hasUserBg } from "@/utils"
|
|
22
22
|
|
|
23
23
|
const DialogContext = createContext<{
|
|
24
24
|
ref: RefObject<HTMLDialogElement | null> | null
|
|
@@ -2,9 +2,9 @@ import type { DetailsHTMLAttributes, HTMLAttributes, JSX, Ref } from "react"
|
|
|
2
2
|
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { ChevronDownIcon } from "@/components/icons"
|
|
6
|
+
import { useSlots } from "@/hooks/useSlots"
|
|
7
|
+
import { hasUserBg } from "@/utils"
|
|
8
8
|
|
|
9
9
|
export interface ExpandableProps extends DetailsHTMLAttributes<HTMLDetailsElement> {
|
|
10
10
|
/** Main content inside the component. This should be an `Expandable.Summary` and `Expandable.Content`. */
|
|
@@ -4,12 +4,13 @@ import type { HTMLAttributes, JSX, Ref } from "react"
|
|
|
4
4
|
import clsx from "clsx"
|
|
5
5
|
import React from "react"
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
7
|
+
import { Error as BaseError, type ErrorProps } from "@/components/FieldMarkers/Error"
|
|
8
|
+
import { Hint as BaseHint, type HintProps } from "@/components/FieldMarkers/Hint"
|
|
9
|
+
import { Label as BaseLabel, type LabelProps } from "@/components/FieldMarkers/Label"
|
|
10
|
+
import { useId } from "@/hooks/useId"
|
|
11
|
+
import { SlotConfig } from "@/types"
|
|
12
|
+
import { getSlotProp } from "@/utils"
|
|
13
|
+
|
|
13
14
|
import { FieldConfig, FieldContext } from "./Field.context"
|
|
14
15
|
|
|
15
16
|
interface FieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import clsx from "clsx"
|
|
2
2
|
import { JSX, LabelHTMLAttributes, Ref } from "react"
|
|
3
3
|
|
|
4
|
-
import { useField } from "
|
|
4
|
+
import { useField } from "@/components/Field/Field.context"
|
|
5
5
|
|
|
6
6
|
export interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
7
7
|
/** **(Optional)** Main label for the form element. Accepts any valid JSX or string. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import clsx from "clsx"
|
|
2
2
|
import { type FieldsetHTMLAttributes, HTMLAttributes, type JSX, Ref } from "react"
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { Error as BaseError, type ErrorProps } from "@/components/FieldMarkers/Error"
|
|
5
|
+
import { Hint as BaseHint, type HintProps } from "@/components/FieldMarkers/Hint"
|
|
6
|
+
import { Legend as BaseLegend, type LegendProps } from "@/components/FieldMarkers/Legend"
|
|
7
|
+
import { StandardSizes } from "@/types"
|
|
8
8
|
|
|
9
9
|
export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
10
10
|
/** Form elements inside the Fieldset.
|
|
@@ -2,7 +2,7 @@ import type { JSX, ReactNode, Ref, SVGProps } from "react"
|
|
|
2
2
|
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
|
|
5
|
-
import { Black, BrandBlue, Darks, Lights, OfferRed, Tints, White } from "
|
|
5
|
+
import { Black, BrandBlue, Darks, Lights, OfferRed, Tints, White } from "@/types/colors"
|
|
6
6
|
|
|
7
7
|
export interface FlourishProps extends SVGProps<SVGSVGElement> {
|
|
8
8
|
/** Specify the text to be highlighted by the Flourish. */
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ImgHTMLAttributes, JSX, Ref } from "react"
|
|
2
2
|
|
|
3
|
-
export interface ImageProps extends
|
|
3
|
+
export interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
4
4
|
/** Specify text to describe the image. Refer to Experience Library guidelines on writing good alt text. */
|
|
5
5
|
alt: string
|
|
6
|
-
/** **(Optional)** Specify the image crop mode. */
|
|
7
|
-
crop?: "square" | "wide" | "none"
|
|
8
6
|
/** **(Optional)** Specify the height of the image. */
|
|
9
7
|
height?: string
|
|
10
8
|
/** **(Optional)** Specify a custom React ref for this component. */
|
|
@@ -15,7 +13,15 @@ export interface ImageProps extends HTMLAttributes<HTMLImageElement> {
|
|
|
15
13
|
width?: string
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
const getContentfulParams = (
|
|
16
|
+
const getContentfulParams = ({
|
|
17
|
+
height,
|
|
18
|
+
src,
|
|
19
|
+
width,
|
|
20
|
+
}: {
|
|
21
|
+
height?: string
|
|
22
|
+
src: string
|
|
23
|
+
width: string
|
|
24
|
+
}) => {
|
|
19
25
|
const url = !src.startsWith("http") ? new URL("https://" + src) : new URL(src)
|
|
20
26
|
const params = [
|
|
21
27
|
["fm", "webp"],
|
|
@@ -26,7 +32,7 @@ const getContentfulParams = (src: string, width: string, height: string | undefi
|
|
|
26
32
|
]
|
|
27
33
|
|
|
28
34
|
params.forEach(([k, v]) => {
|
|
29
|
-
if (!url.searchParams.has(k)) url.searchParams.set(k, v)
|
|
35
|
+
if (k && v && !url.searchParams.has(k)) url.searchParams.set(k, v)
|
|
30
36
|
})
|
|
31
37
|
|
|
32
38
|
return {
|
|
@@ -36,32 +42,19 @@ const getContentfulParams = (src: string, width: string, height: string | undefi
|
|
|
36
42
|
}
|
|
37
43
|
}
|
|
38
44
|
|
|
39
|
-
const Image = ({
|
|
40
|
-
alt,
|
|
41
|
-
crop,
|
|
42
|
-
height,
|
|
43
|
-
ref,
|
|
44
|
-
src,
|
|
45
|
-
width = "640",
|
|
46
|
-
...props
|
|
47
|
-
}: ImageProps): JSX.Element => {
|
|
45
|
+
const Image = ({ alt, height, ref, src, width = "640", ...props }: ImageProps): JSX.Element => {
|
|
48
46
|
let params = { height, src, width }
|
|
49
47
|
|
|
50
48
|
if (src.includes("images.ctfassets.net")) {
|
|
51
|
-
params = getContentfulParams(src, width
|
|
49
|
+
params = getContentfulParams({ height, src, width })
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
const dimensions = {
|
|
55
|
-
"data-crop": crop,
|
|
56
53
|
height: params.height,
|
|
57
54
|
width: params.width,
|
|
58
55
|
}
|
|
59
56
|
|
|
60
|
-
return
|
|
61
|
-
<picture>
|
|
62
|
-
<img alt={alt} loading="lazy" src={params.src} {...dimensions} {...props} ref={ref} />
|
|
63
|
-
</picture>
|
|
64
|
-
)
|
|
57
|
+
return <img alt={alt} loading="lazy" src={params.src} {...dimensions} {...props} ref={ref} />
|
|
65
58
|
}
|
|
66
59
|
|
|
67
60
|
Image.slot = { name: "Image" }
|
|
@@ -2,7 +2,7 @@ import type { JSX, Ref, SVGProps } from "react"
|
|
|
2
2
|
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
|
|
5
|
-
import { LoadingIcon } from "
|
|
5
|
+
import { LoadingIcon } from "@/components/icons"
|
|
6
6
|
|
|
7
7
|
export interface LoadingSpinnerProps extends SVGProps<SVGSVGElement> {
|
|
8
8
|
/** **(Optional)** Specify additional CSS classes to be applied to the component. */
|
|
@@ -3,9 +3,9 @@ import type { JSX } from "react"
|
|
|
3
3
|
|
|
4
4
|
import { useCallback, useState } from "react"
|
|
5
5
|
|
|
6
|
-
import { Button } from "
|
|
7
|
-
import { useField } from "
|
|
8
|
-
import { TextInput, type TextInputProps } from "
|
|
6
|
+
import { Button } from "@/components/Button"
|
|
7
|
+
import { useField } from "@/components/Field/Field.context"
|
|
8
|
+
import { TextInput, type TextInputProps } from "@/components/TextInput"
|
|
9
9
|
|
|
10
10
|
export interface PasswordInputProps extends Omit<
|
|
11
11
|
TextInputProps,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { HTMLAttributes, JSX, ReactNode, Ref } from "react"
|
|
2
|
+
|
|
3
|
+
import clsx from "clsx"
|
|
4
|
+
|
|
5
|
+
export interface PictureProps extends HTMLAttributes<HTMLPictureElement> {
|
|
6
|
+
/** **(Optional)** Content inside the component. */
|
|
7
|
+
children?: string | ReactNode
|
|
8
|
+
/** **(Optional)** Specify additional CSS classes. */
|
|
9
|
+
className?: string
|
|
10
|
+
/** **(Optional)** Specify the image crop mode. */
|
|
11
|
+
crop?: "square" | "wide" | "thin" | "squircle" | "none"
|
|
12
|
+
/** **(Optional)** Specify a custom React ref for this component. */
|
|
13
|
+
ref?: Ref<HTMLPictureElement>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const Picture = ({
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
crop,
|
|
20
|
+
ref,
|
|
21
|
+
...props
|
|
22
|
+
}: PictureProps): JSX.Element => {
|
|
23
|
+
const componentProps = {
|
|
24
|
+
className: clsx("coop-picture", className),
|
|
25
|
+
"data-crop": crop ?? undefined,
|
|
26
|
+
...props,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<picture {...componentProps} ref={ref}>
|
|
31
|
+
{children}
|
|
32
|
+
</picture>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default Picture
|
|
@@ -3,9 +3,9 @@ import type { ForwardRefExoticComponent, HTMLAttributes, JSX, Ref } from "react"
|
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
import React from "react"
|
|
5
5
|
|
|
6
|
-
import { useSlots } from "
|
|
7
|
-
import { StandardSizes } from "
|
|
8
|
-
import { hasUserBg } from "
|
|
6
|
+
import { useSlots } from "@/hooks/useSlots"
|
|
7
|
+
import { StandardSizes } from "@/types"
|
|
8
|
+
import { hasUserBg } from "@/utils"
|
|
9
9
|
|
|
10
10
|
export interface PillProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
11
11
|
/** **(Optional)** Specify a custom element to override default `a` or `span`. */
|
|
@@ -10,8 +10,8 @@ import type { JSX, ReactNode, Ref } from "react"
|
|
|
10
10
|
import * as RadixPopover from "@radix-ui/react-popover"
|
|
11
11
|
import clsx from "clsx"
|
|
12
12
|
|
|
13
|
-
import { useSlots } from "
|
|
14
|
-
import { bgClassToColor, hasUserBg } from "
|
|
13
|
+
import { useSlots } from "@/hooks/useSlots"
|
|
14
|
+
import { bgClassToColor, hasUserBg } from "@/utils"
|
|
15
15
|
|
|
16
16
|
export interface PopoverProps extends RadixPopoverProps {
|
|
17
17
|
/** Content inside the Popover.
|
|
@@ -2,7 +2,7 @@ import type { HTMLAttributes, JSX, ReactNode, Ref } from "react"
|
|
|
2
2
|
|
|
3
3
|
import clsx from "clsx"
|
|
4
4
|
|
|
5
|
-
import { StandardSizes } from "
|
|
5
|
+
import { StandardSizes } from "@/types"
|
|
6
6
|
|
|
7
7
|
export interface ProseProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
8
|
/** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
|