@coopdigital/react 1.12.0 → 1.13.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.
- package/dist/components/AlertBanner/AlertBanner.d.ts +29 -28
- package/dist/components/AlertBanner/AlertBanner.js +16 -12
- package/dist/components/AlertBanner/index.d.ts +2 -4
- package/dist/components/AlertBanner/index.js +5 -0
- package/dist/components/Author/Author.d.ts +25 -23
- package/dist/components/Author/Author.js +24 -17
- package/dist/components/Author/index.d.ts +2 -4
- package/dist/components/Author/index.js +5 -0
- package/dist/components/Button/Button.d.ts +33 -33
- package/dist/components/Button/Button.js +34 -33
- package/dist/components/Button/index.d.ts +2 -4
- package/dist/components/Button/index.js +5 -0
- package/dist/components/Card/Card.d.ts +91 -90
- package/dist/components/Card/Card.js +76 -43
- package/dist/components/Card/index.d.ts +2 -4
- package/dist/components/Card/index.js +5 -0
- package/dist/components/Checkbox/Checkbox.d.ts +26 -25
- package/dist/components/Checkbox/Checkbox.js +20 -20
- package/dist/components/Checkbox/index.d.ts +2 -4
- package/dist/components/Checkbox/index.js +5 -0
- package/dist/components/DatePicker/DatePicker.d.ts +63 -62
- package/dist/components/DatePicker/DatePicker.js +237 -136
- package/dist/components/DatePicker/datepicker-utils.d.ts +6 -66
- package/dist/components/DatePicker/datepicker-utils.js +164 -175
- package/dist/components/DatePicker/index.d.ts +2 -4
- package/dist/components/DatePicker/index.js +5 -0
- package/dist/components/Dialog/Dialog.d.ts +81 -80
- package/dist/components/Dialog/Dialog.js +98 -94
- package/dist/components/Dialog/index.d.ts +2 -4
- package/dist/components/Dialog/index.js +5 -0
- package/dist/components/Expandable/Expandable.d.ts +40 -39
- package/dist/components/Expandable/Expandable.js +30 -22
- package/dist/components/Expandable/index.d.ts +2 -4
- package/dist/components/Expandable/index.js +5 -0
- package/dist/components/Field/Field.context.js +6 -8
- package/dist/components/Field/Field.d.ts +51 -51
- package/dist/components/Field/Field.js +80 -57
- package/dist/components/Field/index.d.ts +2 -4
- package/dist/components/Field/index.js +5 -6
- package/dist/components/FieldMarkers/Error.d.ts +11 -10
- package/dist/components/FieldMarkers/Error.js +11 -10
- package/dist/components/FieldMarkers/Hint.d.ts +11 -10
- package/dist/components/FieldMarkers/Hint.js +11 -10
- package/dist/components/FieldMarkers/Label.d.ts +12 -11
- package/dist/components/FieldMarkers/Label.js +14 -14
- package/dist/components/FieldMarkers/Legend.d.ts +12 -11
- package/dist/components/FieldMarkers/Legend.js +18 -11
- package/dist/components/Fieldset/Fieldset.d.ts +72 -71
- package/dist/components/Fieldset/Fieldset.js +29 -28
- package/dist/components/Fieldset/index.d.ts +2 -4
- package/dist/components/Fieldset/index.js +5 -0
- package/dist/components/Flourish/Flourish.d.ts +18 -17
- package/dist/components/Flourish/Flourish.js +15 -10
- package/dist/components/Flourish/index.d.ts +2 -4
- package/dist/components/Flourish/index.js +5 -0
- package/dist/components/Form/Form.d.ts +15 -14
- package/dist/components/Form/Form.js +10 -9
- package/dist/components/Form/index.d.ts +2 -4
- package/dist/components/Form/index.js +5 -0
- package/dist/components/Image/Image.d.ts +21 -20
- package/dist/components/Image/Image.js +37 -31
- package/dist/components/Image/index.d.ts +2 -4
- package/dist/components/Image/index.js +5 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +14 -12
- package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
- package/dist/components/LoadingSpinner/index.d.ts +2 -4
- package/dist/components/LoadingSpinner/index.js +5 -0
- package/dist/components/Logo/Logo.d.ts +18 -16
- package/dist/components/Logo/Logo.js +20 -0
- package/dist/components/Logo/index.d.ts +2 -4
- package/dist/components/Logo/index.js +5 -0
- package/dist/components/Pill/Pill.d.ts +34 -34
- package/dist/components/Pill/Pill.js +26 -20
- package/dist/components/Pill/index.d.ts +2 -4
- package/dist/components/Pill/index.js +5 -0
- package/dist/components/Popover/Popover.d.ts +91 -90
- package/dist/components/Popover/Popover.js +64 -55
- package/dist/components/Popover/index.d.ts +2 -4
- package/dist/components/Popover/index.js +5 -0
- package/dist/components/Radio/Radio.d.ts +26 -25
- package/dist/components/Radio/Radio.js +20 -21
- package/dist/components/Radio/index.d.ts +2 -4
- package/dist/components/Radio/index.js +5 -0
- package/dist/components/RootSVG/RootSVG.d.ts +7 -6
- package/dist/components/RootSVG/RootSVG.js +19 -9
- package/dist/components/RootSVG/index.d.ts +2 -4
- package/dist/components/RootSVG/index.js +5 -0
- package/dist/components/Searchbox/Searchbox.context.js +6 -7
- package/dist/components/Searchbox/Searchbox.d.ts +49 -47
- package/dist/components/Searchbox/Searchbox.js +85 -60
- package/dist/components/Searchbox/index.d.ts +2 -4
- package/dist/components/Searchbox/index.js +5 -0
- package/dist/components/Select/Select.d.ts +58 -52
- package/dist/components/Select/Select.js +29 -20
- package/dist/components/Select/index.d.ts +2 -4
- package/dist/components/Select/index.js +5 -0
- package/dist/components/Signpost/Signpost.d.ts +25 -24
- package/dist/components/Signpost/Signpost.js +25 -13
- package/dist/components/Signpost/index.d.ts +2 -4
- package/dist/components/Signpost/index.js +5 -0
- package/dist/components/SkipNav/SkipNav.d.ts +20 -19
- package/dist/components/SkipNav/SkipNav.js +25 -18
- package/dist/components/SkipNav/index.d.ts +2 -4
- package/dist/components/SkipNav/index.js +5 -0
- package/dist/components/Squircle/Squircle.d.ts +17 -16
- package/dist/components/Squircle/Squircle.js +12 -11
- package/dist/components/Squircle/index.d.ts +2 -4
- package/dist/components/Squircle/index.js +5 -0
- package/dist/components/Tag/Tag.d.ts +21 -21
- package/dist/components/Tag/Tag.js +16 -13
- package/dist/components/Tag/index.d.ts +2 -4
- package/dist/components/Tag/index.js +5 -0
- package/dist/components/TextInput/TextInput.d.ts +41 -35
- package/dist/components/TextInput/TextInput.js +45 -28
- package/dist/components/TextInput/index.d.ts +2 -4
- package/dist/components/TextInput/index.js +5 -5
- package/dist/components/Textarea/Textarea.d.ts +44 -38
- package/dist/components/Textarea/Textarea.js +49 -35
- package/dist/components/Textarea/index.d.ts +2 -4
- package/dist/components/Textarea/index.js +5 -0
- package/dist/components/ValidationSummary/ValidationSummary.d.ts +73 -73
- package/dist/components/ValidationSummary/ValidationSummary.js +72 -62
- package/dist/components/ValidationSummary/index.d.ts +2 -4
- package/dist/components/ValidationSummary/index.js +5 -0
- package/dist/components/ValidationSummary/validationsummary-utils.js +7 -10
- package/dist/components/icons/AccountCircleFilledIcon.d.ts +6 -4
- package/dist/components/icons/AccountCircleFilledIcon.js +21 -17
- package/dist/components/icons/AccountCircleIcon.d.ts +6 -4
- package/dist/components/icons/AccountCircleIcon.js +21 -17
- package/dist/components/icons/AccountFilledIcon.d.ts +6 -4
- package/dist/components/icons/AccountFilledIcon.js +21 -17
- package/dist/components/icons/AccountIcon.d.ts +6 -4
- package/dist/components/icons/AccountIcon.js +21 -17
- package/dist/components/icons/AddIcon.d.ts +6 -4
- package/dist/components/icons/AddIcon.js +21 -17
- package/dist/components/icons/AppsFilledIcon.d.ts +6 -4
- package/dist/components/icons/AppsFilledIcon.js +21 -17
- package/dist/components/icons/AppsIcon.d.ts +6 -4
- package/dist/components/icons/AppsIcon.js +21 -17
- package/dist/components/icons/ArrowDownIcon.d.ts +6 -4
- package/dist/components/icons/ArrowDownIcon.js +21 -17
- package/dist/components/icons/ArrowLeftIcon.d.ts +6 -4
- package/dist/components/icons/ArrowLeftIcon.js +21 -17
- package/dist/components/icons/ArrowRightIcon.d.ts +6 -4
- package/dist/components/icons/ArrowRightIcon.js +21 -17
- package/dist/components/icons/ArrowUpIcon.d.ts +6 -4
- package/dist/components/icons/ArrowUpIcon.js +21 -17
- package/dist/components/icons/BackspaceFilledIcon.d.ts +6 -4
- package/dist/components/icons/BackspaceFilledIcon.js +21 -17
- package/dist/components/icons/BackspaceIcon.d.ts +6 -4
- package/dist/components/icons/BackspaceIcon.js +21 -17
- package/dist/components/icons/BasketFilledIcon.d.ts +6 -4
- package/dist/components/icons/BasketFilledIcon.js +21 -17
- package/dist/components/icons/BasketIcon.d.ts +6 -4
- package/dist/components/icons/BasketIcon.js +21 -17
- package/dist/components/icons/BellFilledIcon.d.ts +6 -4
- package/dist/components/icons/BellFilledIcon.js +28 -17
- package/dist/components/icons/BellIcon.d.ts +6 -4
- package/dist/components/icons/BellIcon.js +21 -17
- package/dist/components/icons/BroomIcon.d.ts +6 -4
- package/dist/components/icons/BroomIcon.js +21 -17
- package/dist/components/icons/CalendarFilledIcon.d.ts +6 -4
- package/dist/components/icons/CalendarFilledIcon.js +21 -17
- package/dist/components/icons/CalendarIcon.d.ts +6 -4
- package/dist/components/icons/CalendarIcon.js +21 -17
- package/dist/components/icons/CashFilledIcon.d.ts +6 -4
- package/dist/components/icons/CashFilledIcon.js +21 -17
- package/dist/components/icons/CashIcon.d.ts +6 -4
- package/dist/components/icons/CashIcon.js +29 -17
- package/dist/components/icons/ChevronDownIcon.d.ts +6 -4
- package/dist/components/icons/ChevronDownIcon.js +21 -17
- package/dist/components/icons/ChevronLeftIcon.d.ts +6 -4
- package/dist/components/icons/ChevronLeftIcon.js +21 -17
- package/dist/components/icons/ChevronRightIcon.d.ts +6 -4
- package/dist/components/icons/ChevronRightIcon.js +21 -17
- package/dist/components/icons/ChevronUpIcon.d.ts +6 -4
- package/dist/components/icons/ChevronUpIcon.js +21 -17
- package/dist/components/icons/CircleBurgerFilledIcon.d.ts +6 -4
- package/dist/components/icons/CircleBurgerFilledIcon.js +21 -17
- package/dist/components/icons/CircleBurgerIcon.d.ts +6 -4
- package/dist/components/icons/CircleBurgerIcon.js +21 -17
- package/dist/components/icons/ClipboardFilledIcon.d.ts +6 -4
- package/dist/components/icons/ClipboardFilledIcon.js +21 -17
- package/dist/components/icons/ClipboardIcon.d.ts +6 -4
- package/dist/components/icons/ClipboardIcon.js +21 -17
- package/dist/components/icons/ClockFilledIcon.d.ts +6 -4
- package/dist/components/icons/ClockFilledIcon.js +25 -17
- package/dist/components/icons/ClockIcon.d.ts +6 -4
- package/dist/components/icons/ClockIcon.js +21 -17
- package/dist/components/icons/CloseAltFilledIcon.d.ts +6 -4
- package/dist/components/icons/CloseAltFilledIcon.js +25 -17
- package/dist/components/icons/CloseAltIcon.d.ts +6 -4
- package/dist/components/icons/CloseAltIcon.js +21 -17
- package/dist/components/icons/CogIcon.d.ts +6 -4
- package/dist/components/icons/CogIcon.js +21 -17
- package/dist/components/icons/CommunityFilledIcon.d.ts +6 -4
- package/dist/components/icons/CommunityFilledIcon.js +21 -17
- package/dist/components/icons/CommunityIcon.d.ts +6 -4
- package/dist/components/icons/CommunityIcon.js +21 -17
- package/dist/components/icons/ComputerIcon.d.ts +6 -4
- package/dist/components/icons/ComputerIcon.js +21 -17
- package/dist/components/icons/ContactFilledIcon.d.ts +6 -4
- package/dist/components/icons/ContactFilledIcon.js +21 -17
- package/dist/components/icons/ContactIcon.d.ts +6 -4
- package/dist/components/icons/ContactIcon.js +21 -17
- package/dist/components/icons/ContactlessFilledIcon.d.ts +6 -4
- package/dist/components/icons/ContactlessFilledIcon.js +21 -17
- package/dist/components/icons/ContactlessIcon.d.ts +6 -4
- package/dist/components/icons/ContactlessIcon.js +21 -17
- package/dist/components/icons/CoopLiveIcon.d.ts +6 -4
- package/dist/components/icons/CoopLiveIcon.js +25 -17
- package/dist/components/icons/CoopLocationFilledIcon.d.ts +6 -4
- package/dist/components/icons/CoopLocationFilledIcon.js +26 -17
- package/dist/components/icons/CoopLogoIcon.d.ts +6 -4
- package/dist/components/icons/CoopLogoIcon.js +21 -17
- package/dist/components/icons/CoopMembershipCardFilledIcon.d.ts +6 -4
- package/dist/components/icons/CoopMembershipCardFilledIcon.js +29 -17
- package/dist/components/icons/CreditCardFilledIcon.d.ts +6 -4
- package/dist/components/icons/CreditCardFilledIcon.js +25 -17
- package/dist/components/icons/CreditCardIcon.d.ts +6 -4
- package/dist/components/icons/CreditCardIcon.js +21 -17
- package/dist/components/icons/CrossIcon.d.ts +6 -4
- package/dist/components/icons/CrossIcon.js +21 -17
- package/dist/components/icons/DocumentIcon.d.ts +6 -4
- package/dist/components/icons/DocumentIcon.js +21 -17
- package/dist/components/icons/DownloadIcon.d.ts +6 -4
- package/dist/components/icons/DownloadIcon.js +21 -17
- package/dist/components/icons/EnterStoreIcon.d.ts +6 -4
- package/dist/components/icons/EnterStoreIcon.js +21 -17
- package/dist/components/icons/ExitStoreIcon.d.ts +6 -4
- package/dist/components/icons/ExitStoreIcon.js +21 -17
- package/dist/components/icons/EyeFilledIcon.d.ts +6 -4
- package/dist/components/icons/EyeFilledIcon.js +21 -17
- package/dist/components/icons/EyeIcon.d.ts +6 -4
- package/dist/components/icons/EyeIcon.js +21 -17
- package/dist/components/icons/EyeStrikeFilledIcon.d.ts +6 -4
- package/dist/components/icons/EyeStrikeFilledIcon.js +21 -17
- package/dist/components/icons/EyeStrikeIcon.d.ts +6 -4
- package/dist/components/icons/EyeStrikeIcon.js +21 -17
- package/dist/components/icons/FeedbackFilledIcon.d.ts +6 -4
- package/dist/components/icons/FeedbackFilledIcon.js +24 -17
- package/dist/components/icons/FeedbackIcon.d.ts +6 -4
- package/dist/components/icons/FeedbackIcon.js +21 -17
- package/dist/components/icons/FilterIcon.d.ts +6 -4
- package/dist/components/icons/FilterIcon.js +21 -17
- package/dist/components/icons/GiftCardFilledIcon.d.ts +6 -4
- package/dist/components/icons/GiftCardFilledIcon.js +21 -17
- package/dist/components/icons/GiftCardIcon.d.ts +6 -4
- package/dist/components/icons/GiftCardIcon.js +21 -17
- package/dist/components/icons/GiftFilledIcon.d.ts +6 -4
- package/dist/components/icons/GiftFilledIcon.js +21 -17
- package/dist/components/icons/GiftIcon.d.ts +6 -4
- package/dist/components/icons/GiftIcon.js +21 -17
- package/dist/components/icons/HelpFilledIcon.d.ts +6 -4
- package/dist/components/icons/HelpFilledIcon.js +21 -17
- package/dist/components/icons/HelpIcon.d.ts +6 -4
- package/dist/components/icons/HelpIcon.js +21 -17
- package/dist/components/icons/HomeFilledIcon.d.ts +6 -4
- package/dist/components/icons/HomeFilledIcon.js +21 -17
- package/dist/components/icons/HomeIcon.d.ts +6 -4
- package/dist/components/icons/HomeIcon.js +21 -17
- package/dist/components/icons/HowDoIAssistantIcon.d.ts +6 -4
- package/dist/components/icons/HowDoIAssistantIcon.js +21 -17
- package/dist/components/icons/InfoIcon.d.ts +6 -4
- package/dist/components/icons/InfoIcon.js +21 -17
- package/dist/components/icons/KebabIcon.d.ts +6 -4
- package/dist/components/icons/KebabIcon.js +21 -17
- package/dist/components/icons/LoadingIcon.d.ts +6 -4
- package/dist/components/icons/LoadingIcon.js +21 -17
- package/dist/components/icons/LocationFilledIcon.d.ts +6 -4
- package/dist/components/icons/LocationFilledIcon.js +21 -17
- package/dist/components/icons/LocationIcon.d.ts +6 -4
- package/dist/components/icons/LocationIcon.js +21 -17
- package/dist/components/icons/LogoutIcon.d.ts +6 -4
- package/dist/components/icons/LogoutIcon.js +21 -17
- package/dist/components/icons/MailIcon.d.ts +6 -4
- package/dist/components/icons/MailIcon.js +21 -17
- package/dist/components/icons/MenuIcon.d.ts +6 -4
- package/dist/components/icons/MenuIcon.js +21 -17
- package/dist/components/icons/MessageIcon.d.ts +6 -4
- package/dist/components/icons/MessageIcon.js +21 -17
- package/dist/components/icons/MinusIcon.d.ts +6 -4
- package/dist/components/icons/MinusIcon.js +21 -17
- package/dist/components/icons/NotesFilledIcon.d.ts +6 -4
- package/dist/components/icons/NotesFilledIcon.js +21 -17
- package/dist/components/icons/NotesIcon.d.ts +6 -4
- package/dist/components/icons/NotesIcon.js +21 -17
- package/dist/components/icons/OpenNewIcon.d.ts +6 -4
- package/dist/components/icons/OpenNewIcon.js +25 -17
- package/dist/components/icons/OwnBagIcon.d.ts +6 -4
- package/dist/components/icons/OwnBagIcon.js +21 -17
- package/dist/components/icons/PadlockIcon.d.ts +6 -4
- package/dist/components/icons/PadlockIcon.js +21 -17
- package/dist/components/icons/PencilIcon.d.ts +6 -4
- package/dist/components/icons/PencilIcon.js +21 -17
- package/dist/components/icons/PhoneIcon.d.ts +6 -4
- package/dist/components/icons/PhoneIcon.js +21 -17
- package/dist/components/icons/PowerIcon.d.ts +6 -4
- package/dist/components/icons/PowerIcon.js +21 -17
- package/dist/components/icons/SaveFilledIcon.d.ts +6 -4
- package/dist/components/icons/SaveFilledIcon.js +21 -17
- package/dist/components/icons/SaveIcon.d.ts +6 -4
- package/dist/components/icons/SaveIcon.js +21 -17
- package/dist/components/icons/ScooterIcon.d.ts +6 -4
- package/dist/components/icons/ScooterIcon.js +21 -17
- package/dist/components/icons/SearchFilledIcon.d.ts +6 -4
- package/dist/components/icons/SearchFilledIcon.js +21 -17
- package/dist/components/icons/SearchIcon.d.ts +6 -4
- package/dist/components/icons/SearchIcon.js +21 -17
- package/dist/components/icons/SendIcon.d.ts +6 -4
- package/dist/components/icons/SendIcon.js +21 -17
- package/dist/components/icons/SpannerIcon.d.ts +6 -4
- package/dist/components/icons/SpannerIcon.js +21 -17
- package/dist/components/icons/StarFilledIcon.d.ts +6 -4
- package/dist/components/icons/StarFilledIcon.js +24 -17
- package/dist/components/icons/StarIcon.d.ts +6 -4
- package/dist/components/icons/StarIcon.js +21 -17
- package/dist/components/icons/TickAltFilledIcon.d.ts +6 -4
- package/dist/components/icons/TickAltFilledIcon.js +25 -17
- package/dist/components/icons/TickAltIcon.d.ts +6 -4
- package/dist/components/icons/TickAltIcon.js +21 -17
- package/dist/components/icons/TickIcon.d.ts +6 -4
- package/dist/components/icons/TickIcon.js +21 -17
- package/dist/components/icons/TruckIcon.d.ts +6 -4
- package/dist/components/icons/TruckIcon.js +21 -17
- package/dist/components/icons/UserWipeIcon.d.ts +6 -4
- package/dist/components/icons/UserWipeIcon.js +21 -17
- package/dist/components/icons/VoucherFilledIcon.d.ts +6 -4
- package/dist/components/icons/VoucherFilledIcon.js +21 -17
- package/dist/components/icons/VoucherIcon.d.ts +6 -4
- package/dist/components/icons/VoucherIcon.js +21 -17
- package/dist/components/icons/WarningCircleFilledIcon.d.ts +6 -4
- package/dist/components/icons/WarningCircleFilledIcon.js +25 -17
- package/dist/components/icons/WarningCircleIcon.d.ts +6 -4
- package/dist/components/icons/WarningCircleIcon.js +29 -17
- package/dist/components/icons/WarningFilledIcon.d.ts +6 -4
- package/dist/components/icons/WarningFilledIcon.js +21 -17
- package/dist/components/icons/WarningIcon.d.ts +6 -4
- package/dist/components/icons/WarningIcon.js +21 -17
- package/dist/components/icons/WifiIcon.d.ts +6 -4
- package/dist/components/icons/WifiIcon.js +21 -17
- package/dist/components/icons/WriteIcon.d.ts +6 -4
- package/dist/components/icons/WriteIcon.js +27 -17
- package/dist/components/icons/index.d.ts +110 -109
- package/dist/components/icons/index.js +110 -109
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/useDebounce.d.ts +4 -1
- package/dist/hooks/useDebounce.js +13 -13
- package/dist/hooks/useId.d.ts +5 -2
- package/dist/hooks/useId.js +7 -7
- package/dist/hooks/useSlots.d.ts +5 -8
- package/dist/hooks/useSlots.js +30 -50
- package/dist/index.d.ts +28 -27
- package/dist/index.js +28 -27
- package/dist/types/colors.d.ts +10 -10
- package/dist/types/index.d.ts +4 -16
- package/dist/utils/index.d.ts +8 -5
- package/dist/utils/index.js +9 -13
- package/package.json +12 -11
- package/src/components/Select/Select.tsx +7 -0
- package/src/components/TextInput/TextInput.tsx +7 -0
- package/src/components/Textarea/Textarea.tsx +7 -0
- package/src/hooks/index.ts +3 -0
- package/src/index.ts +27 -27
- package/dist/components/Field/Field.context.d.ts +0 -14
- package/dist/components/Searchbox/Searchbox.context.d.ts +0 -13
- package/dist/components/ValidationSummary/validationsummary-utils.d.ts +0 -2
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { StandardSizes } from "../../types";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { ButtonProps } from "../Button/Button.js";
|
|
2
|
+
import "../Button/index.js";
|
|
3
|
+
import { StandardSizes } from "../../types/index.js";
|
|
4
|
+
import { TextInputProps } from "../TextInput/TextInput.js";
|
|
5
|
+
import "../TextInput/index.js";
|
|
6
|
+
import React, { FormHTMLAttributes, JSX, RefObject } from "react";
|
|
7
|
+
//#region src/components/Searchbox/Searchbox.d.ts
|
|
8
|
+
interface SearchboxProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
9
|
+
/** **(Optional)** Specify a server endpoint to submit the form. Will be ignored if onSubmit is also set. */
|
|
10
|
+
action?: string;
|
|
11
|
+
/** **(Optional)** Specify props to forward to the Button element. Use `label` to set Button text. */
|
|
12
|
+
button?: Pick<ButtonProps, "className" | "loadingText"> & {
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
/** **(Optional)** Specify additional CSS classes to be applied to the component. */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** **(Optional)** Specify the TextInput id. Will be auto-generated if not set. */
|
|
18
|
+
id?: string;
|
|
19
|
+
/** Specify the label displayed above the search field. Hidden by default, but visible to screen readers. */
|
|
20
|
+
label: string;
|
|
21
|
+
/** **(Optional)** Specify whether the label should be visible to humans or screenreaders. */
|
|
22
|
+
labelVisible?: boolean;
|
|
23
|
+
/** **(Optional)** Specify the TextInput name, also used as the URL search parameter. Defaults to `query`. */
|
|
24
|
+
name?: string;
|
|
25
|
+
/** **(Optional)** Callback to run when the form is submitted. If this is an async function, it will be awaited and the Searchbox will be in a pending state until the promise is resolved. */
|
|
26
|
+
onSubmit?: React.SubmitEventHandler<HTMLElement> | undefined;
|
|
27
|
+
/** **(Optional)** Specify the TextInput placeholder text Do not use in place of a form label. */
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
/** **(Optional)** Specify a custom React ref for this component. */
|
|
30
|
+
ref?: RefObject<HTMLFormElement | null>;
|
|
31
|
+
/** **(Optional)** Specify the Searchbox size. */
|
|
32
|
+
size?: StandardSizes;
|
|
33
|
+
/** **(Optional)** Specify the Searchbox variant. */
|
|
34
|
+
variant?: "solid" | "ghost";
|
|
33
35
|
}
|
|
34
36
|
declare const Searchbox: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
({ children, ...props }: ButtonProps): JSX.Element;
|
|
38
|
-
displayName: string;
|
|
39
|
-
};
|
|
40
|
-
Input: {
|
|
41
|
-
(props: TextInputProps): JSX.Element;
|
|
42
|
-
displayName: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
declare const SearchboxButton: {
|
|
37
|
+
({ action, children, className, id, label, labelVisible, onSubmit, ref, size, variant, ...props }: SearchboxProps): JSX.Element;
|
|
38
|
+
Button: {
|
|
46
39
|
({ children, ...props }: ButtonProps): JSX.Element;
|
|
47
40
|
displayName: string;
|
|
48
|
-
};
|
|
49
|
-
|
|
41
|
+
};
|
|
42
|
+
Input: {
|
|
50
43
|
(props: TextInputProps): JSX.Element;
|
|
51
44
|
displayName: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
declare const SearchboxButton: {
|
|
48
|
+
({ children, ...props }: ButtonProps): JSX.Element;
|
|
49
|
+
displayName: string;
|
|
50
|
+
};
|
|
51
|
+
declare const SearchboxInput: {
|
|
52
|
+
(props: TextInputProps): JSX.Element;
|
|
53
|
+
displayName: string;
|
|
52
54
|
};
|
|
53
|
-
|
|
54
|
-
export { Searchbox, SearchboxButton, SearchboxInput };
|
|
55
|
+
//#endregion
|
|
56
|
+
export { Searchbox, Searchbox as default, SearchboxButton, SearchboxInput, SearchboxProps };
|
|
@@ -1,73 +1,98 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useSlots } from
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
|
|
2
|
+
import { getSlotProp, hasUserBorder } from "../../utils/index.js";
|
|
3
|
+
import { useId as useId$1 } from "../../hooks/useId.js";
|
|
4
|
+
import { SearchIcon } from "../icons/SearchIcon.js";
|
|
5
|
+
import { Button } from "../Button/Button.js";
|
|
6
|
+
import { useSlots } from "../../hooks/useSlots.js";
|
|
7
|
+
import TextInput_default from "../TextInput/index.js";
|
|
8
|
+
import { FieldLabel } from "../Field/Field.js";
|
|
9
|
+
import Field_default from "../Field/index.js";
|
|
10
|
+
import { SearchboxContext, useSearchbox } from "./Searchbox.context.js";
|
|
11
|
+
import clsx from "clsx";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useCallback, useState } from "react";
|
|
14
|
+
//#region src/components/Searchbox/Searchbox.tsx
|
|
14
15
|
const componentSlots = {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
SearchboxButton: null,
|
|
17
|
+
SearchboxInput: null
|
|
17
18
|
};
|
|
18
19
|
const Searchbox = ({ action, children, className, id, label, labelVisible = false, onSubmit, ref, size, variant = "solid", ...props }) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
20
|
+
const slots = useSlots(componentSlots, children);
|
|
21
|
+
const uid = useId$1(id);
|
|
22
|
+
const [isPending, setIsPending] = useState(false);
|
|
23
|
+
const inputId = getSlotProp(slots.SearchboxInput, "id") ?? uid + "__input";
|
|
24
|
+
const buttonId = getSlotProp(slots.SearchboxButton, "id") ?? uid + "__button";
|
|
25
|
+
const handleSubmit = useCallback(async (event) => {
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
if (isPending || !onSubmit) return;
|
|
28
|
+
setIsPending(true);
|
|
29
|
+
try {
|
|
30
|
+
await Promise.resolve(onSubmit(event));
|
|
31
|
+
} finally {
|
|
32
|
+
setIsPending(false);
|
|
33
|
+
}
|
|
34
|
+
}, [onSubmit, isPending]);
|
|
35
|
+
let borderClass = "";
|
|
36
|
+
if (!hasUserBorder(className)) borderClass = variant === "ghost" ? "border-teal" : "border-grey";
|
|
37
|
+
const formProps = {
|
|
38
|
+
action: action ?? void 0,
|
|
39
|
+
className: clsx("coop-searchbox", borderClass, className),
|
|
40
|
+
"data-size": size ?? void 0,
|
|
41
|
+
"data-variant": variant.length && variant !== "solid" ? variant : void 0,
|
|
42
|
+
id: id ?? void 0,
|
|
43
|
+
onSubmit: onSubmit ? handleSubmit : void 0,
|
|
44
|
+
...props
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ jsx(SearchboxContext.Provider, {
|
|
47
|
+
value: {
|
|
48
|
+
buttonId,
|
|
49
|
+
inputId,
|
|
50
|
+
isLoading: isPending,
|
|
51
|
+
ref,
|
|
52
|
+
size
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
55
|
+
...formProps,
|
|
56
|
+
ref,
|
|
57
|
+
children: [label && /* @__PURE__ */ jsx(FieldLabel, {
|
|
58
|
+
htmlFor: inputId ?? uid,
|
|
59
|
+
isVisible: labelVisible,
|
|
60
|
+
children: label
|
|
61
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: clsx("coop-searchbox--inner"),
|
|
63
|
+
children: [/* @__PURE__ */ jsx(Field_default, { children: slots.SearchboxInput }), slots.SearchboxButton]
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
});
|
|
51
67
|
};
|
|
52
68
|
const SearchboxButton = ({ children, ...props }) => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
const searchbox = useSearchbox();
|
|
70
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
71
|
+
children: children ?? /* @__PURE__ */ jsx(SearchIcon, {
|
|
72
|
+
alt: "Search",
|
|
73
|
+
id: searchbox.buttonId + "__icon",
|
|
74
|
+
stroke: "currentColor",
|
|
75
|
+
width: "24"
|
|
76
|
+
}),
|
|
77
|
+
id: searchbox.buttonId,
|
|
78
|
+
isLoading: searchbox.isLoading,
|
|
79
|
+
size: searchbox.size,
|
|
80
|
+
...props
|
|
81
|
+
});
|
|
63
82
|
};
|
|
64
83
|
SearchboxButton.displayName = "Searchbox.Button";
|
|
65
84
|
const SearchboxInput = (props) => {
|
|
66
|
-
|
|
67
|
-
|
|
85
|
+
const searchbox = useSearchbox();
|
|
86
|
+
return /* @__PURE__ */ jsx(TextInput_default, {
|
|
87
|
+
autoCapitalize: "off",
|
|
88
|
+
id: searchbox.inputId,
|
|
89
|
+
size: searchbox.size,
|
|
90
|
+
type: "search",
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
68
93
|
};
|
|
69
94
|
SearchboxInput.displayName = "Searchbox.Input";
|
|
70
95
|
Searchbox.Button = SearchboxButton;
|
|
71
96
|
Searchbox.Input = SearchboxInput;
|
|
72
|
-
|
|
73
|
-
export { Searchbox,
|
|
97
|
+
//#endregion
|
|
98
|
+
export { Searchbox, Searchbox as default, SearchboxButton, SearchboxInput };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import Searchbox from "./Searchbox";
|
|
2
|
-
export default
|
|
3
|
-
export { Searchbox };
|
|
4
|
-
export * from "./Searchbox";
|
|
1
|
+
import { Searchbox, SearchboxButton, SearchboxInput, SearchboxProps } from "./Searchbox.js";
|
|
2
|
+
export { Searchbox, Searchbox as default, SearchboxButton, SearchboxInput, SearchboxProps };
|
|
@@ -1,66 +1,72 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { StandardSizes } from "../../types/index.js";
|
|
2
|
+
import { JSX, OptgroupHTMLAttributes, OptionHTMLAttributes, ReactNode, Ref, SelectHTMLAttributes } from "react";
|
|
3
|
+
//#region src/components/Select/Select.d.ts
|
|
4
|
+
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size"> {
|
|
5
|
+
/** **(Optional)** Options inside the Select. This should be a set of `Select.Option` or `Select.OptionGroup` components. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** **(Optional)** Specify additional CSS classes to be applied to the component. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** **(Optional)** Specify whether the Select should be disabled. Refer to Experience Library guidance on disabled form controls and accessibility. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** **(Optional)** Specify the Select error state. */
|
|
12
|
+
error?: boolean;
|
|
13
|
+
/** **(Optional)** Specify the wrapper behaviour. When true, width is fit-content, otherwise it expands to 100%.
|
|
14
|
+
*
|
|
15
|
+
* Default: false
|
|
16
|
+
*/
|
|
17
|
+
fit?: boolean;
|
|
18
|
+
/** **(Optional)** Specify the Select id. Will be auto-generated if not set. */
|
|
19
|
+
id?: string;
|
|
20
|
+
/** Specify the Select name. */
|
|
21
|
+
name: string;
|
|
22
|
+
/** **(Optional)** Specify a custom React ref for this component. */
|
|
23
|
+
ref?: Ref<HTMLSelectElement>;
|
|
24
|
+
/** **(Optional)** Specify the Select size. */
|
|
25
|
+
size?: StandardSizes;
|
|
20
26
|
}
|
|
21
27
|
interface SelectOptionGroupProps extends OptgroupHTMLAttributes<HTMLOptGroupElement> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
/** **(Optional)** Main content inside the Select option. It can be any valid JSX or string. */
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
/** Specify the Select option group label. */
|
|
31
|
+
label: string;
|
|
26
32
|
}
|
|
27
33
|
interface SelectOptionProps extends OptionHTMLAttributes<HTMLOptionElement> {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
/** **(Optional)** Main content inside the Select option. It can be any valid JSX or string. */
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
/** **(Optional)** Specify additional CSS classes to be applied to the Select option. */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** Value of Select option. */
|
|
39
|
+
value: string;
|
|
34
40
|
}
|
|
35
41
|
declare const Select: {
|
|
36
|
-
|
|
42
|
+
({ children, className, disabled, error, fit, id, name, ref, size, ...props }: SelectProps): JSX.Element;
|
|
43
|
+
slot: {
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
46
|
+
OptionGroup: {
|
|
47
|
+
({ children, ...props }: SelectOptionGroupProps): JSX.Element;
|
|
37
48
|
slot: {
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
OptionGroup: {
|
|
41
|
-
({ children, ...props }: SelectOptionGroupProps): JSX.Element;
|
|
42
|
-
slot: {
|
|
43
|
-
name: string;
|
|
44
|
-
};
|
|
49
|
+
name: string;
|
|
45
50
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
};
|
|
52
|
+
Option: {
|
|
53
|
+
({ children, className, ...props }: SelectOptionProps): JSX.Element;
|
|
54
|
+
slot: {
|
|
55
|
+
name: string;
|
|
51
56
|
};
|
|
57
|
+
};
|
|
52
58
|
};
|
|
53
59
|
declare const SelectOptionGroup: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
({ children, ...props }: SelectOptionGroupProps): JSX.Element;
|
|
61
|
+
slot: {
|
|
62
|
+
name: string;
|
|
63
|
+
};
|
|
58
64
|
};
|
|
59
65
|
declare const SelectOption: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
({ children, className, ...props }: SelectOptionProps): JSX.Element;
|
|
67
|
+
slot: {
|
|
68
|
+
name: string;
|
|
69
|
+
};
|
|
64
70
|
};
|
|
65
|
-
|
|
66
|
-
export { Select, SelectOption, SelectOptionGroup };
|
|
71
|
+
//#endregion
|
|
72
|
+
export { Select, Select as default, SelectOption, SelectOptionGroup, SelectProps };
|
|
@@ -1,31 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import clsx from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const Select = ({ children, className, disabled, error, id, name, ref, size, ...props }) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
import { useField } from "../Field/Field.context.js";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Select/Select.tsx
|
|
6
|
+
const Select = ({ children, className, disabled, error, fit = false, id, name, ref, size, ...props }) => {
|
|
7
|
+
const field = useField();
|
|
8
|
+
return /* @__PURE__ */ jsx("select", {
|
|
9
|
+
className: clsx("coop-select", "coop-field-element", className),
|
|
10
|
+
"data-error": error ?? void 0,
|
|
11
|
+
"data-fit": fit || void 0,
|
|
12
|
+
"data-size": size ?? void 0,
|
|
13
|
+
disabled,
|
|
14
|
+
id: id ?? field?.id,
|
|
15
|
+
name,
|
|
16
|
+
...props,
|
|
17
|
+
ref,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
18
20
|
};
|
|
19
21
|
const SelectOptionGroup = ({ children, ...props }) => {
|
|
20
|
-
|
|
22
|
+
return /* @__PURE__ */ jsx("optgroup", {
|
|
23
|
+
...props,
|
|
24
|
+
children
|
|
25
|
+
});
|
|
21
26
|
};
|
|
22
27
|
const SelectOption = ({ children, className, ...props }) => {
|
|
23
|
-
|
|
28
|
+
return /* @__PURE__ */ jsx("option", {
|
|
29
|
+
className: clsx("coop-select--option", className),
|
|
30
|
+
...props,
|
|
31
|
+
children
|
|
32
|
+
});
|
|
24
33
|
};
|
|
25
34
|
Select.slot = { name: "Select" };
|
|
26
35
|
SelectOption.slot = { name: "SelectOption" };
|
|
27
36
|
SelectOptionGroup.slot = { name: "SelectOptionGroup" };
|
|
28
37
|
Select.OptionGroup = SelectOptionGroup;
|
|
29
38
|
Select.Option = SelectOption;
|
|
30
|
-
|
|
31
|
-
export { Select,
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Select, Select as default, SelectOption, SelectOptionGroup };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import Select from "./Select";
|
|
2
|
-
export default
|
|
3
|
-
export { Select };
|
|
4
|
-
export * from "./Select";
|
|
1
|
+
import { Select, SelectOption, SelectOptionGroup, SelectProps } from "./Select.js";
|
|
2
|
+
export { Select, Select as default, SelectOption, SelectOptionGroup, SelectProps };
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { ImageProps } from "../Image/Image.js";
|
|
2
|
+
import "../Image/index.js";
|
|
3
|
+
import React, { ForwardRefExoticComponent, HTMLAttributes, JSX, Ref } from "react";
|
|
4
|
+
//#region src/components/Signpost/Signpost.d.ts
|
|
5
|
+
interface SignpostProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** **(Optional)** Specify a custom element to override default `a`. */
|
|
7
|
+
as?: React.FC<any> | ForwardRefExoticComponent<any> | string;
|
|
8
|
+
/** Main content inside the component. It can be any valid JSX or string. */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/** **(Optional)** Specify additional CSS classes to be applied to the component. */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** **(Optional)** Specify the level of the Signpost heading. */
|
|
13
|
+
headingLevel?: "h2" | "h3" | "h4" | "h5" | "h6";
|
|
14
|
+
/** Specify the URL that the Signpost component will link to when clicked. */
|
|
15
|
+
href?: string;
|
|
16
|
+
/** **(Optional)** Specify properties of the Signpost Image. */
|
|
17
|
+
image?: ImageProps;
|
|
18
|
+
/** **(Optional)** Specify a custom React ref for this component. */
|
|
19
|
+
ref?: Ref<HTMLDivElement>;
|
|
19
20
|
}
|
|
20
21
|
declare const Signpost: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
({ as, children, className, headingLevel, href, image, ref, ...props }: SignpostProps): JSX.Element;
|
|
23
|
+
slot: {
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
-
export { Signpost };
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Signpost, Signpost as default, SignpostProps };
|
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { Image } from "../Image/Image.js";
|
|
2
|
+
import { ChevronRightIcon } from "../icons/ChevronRightIcon.js";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import React from "react";
|
|
6
|
+
//#region src/components/Signpost/Signpost.tsx
|
|
7
7
|
const Signpost = ({ as, children, className, headingLevel = "h3", href, image, ref, ...props }) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const element = as ?? "a";
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: clsx("coop-signpost", className),
|
|
11
|
+
...props,
|
|
12
|
+
ref,
|
|
13
|
+
children: [image && /* @__PURE__ */ jsx(Image, {
|
|
14
|
+
crop: "wide",
|
|
15
|
+
...image
|
|
16
|
+
}), React.createElement(element, { href }, /* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "coop-signpost--content",
|
|
18
|
+
children: [React.createElement(headingLevel, { className: "coop-signpost--heading" }, children), /* @__PURE__ */ jsx("span", {
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
className: "coop-signpost--icon",
|
|
21
|
+
role: "presentation",
|
|
22
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
23
|
+
})]
|
|
24
|
+
}))]
|
|
25
|
+
});
|
|
14
26
|
};
|
|
15
27
|
Signpost.slot = { name: "Signpost" };
|
|
16
|
-
|
|
28
|
+
//#endregion
|
|
17
29
|
export { Signpost, Signpost as default };
|