@hellobetterdigitalnz/selwynui 0.0.1-8 → 0.0.1-80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -1
- package/src/Components/DataDisplay/Accordion/Accordion.stories.tsx +9 -17
- package/src/Components/DataDisplay/Accordion/Accordion.tsx +29 -26
- package/src/Components/DataDisplay/Accordion/AccordionItem.tsx +2 -2
- package/src/Components/DataDisplay/Accordion/AccordionProps.tsx +2 -1
- package/src/Components/DataDisplay/Accordion/accordion-bg-design.tsx +5 -5
- package/src/Components/DataDisplay/Accordion/accordion.module.scss +94 -42
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderTool.stories.tsx +53 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderTool.tsx +23 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolMain/BrandBuilderToolMain.tsx +13 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolMain/BrandBuilderToolMainProps.tsx +7 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolProps.tsx +9 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateItem.tsx +15 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateItemProps.tsx +10 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateSelector.tsx +29 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolTemplate/BrandBuilderToolTemplateSelectorProps.tsx +8 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolUploader/BrandBuilderToolUploader.tsx +33 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolUploader/BrandBuilderToolUploaderProps.tsx +8 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolWrapper/BrandBuilderToolWrapper.tsx +17 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandBuilderToolWrapper/BrandBuilderToolWrapperProps.tsx +8 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandbuilderToolPreview/BrandBuilderToolPreview.tsx +25 -0
- package/src/Components/DataDisplay/BrandBuilderTool/BrandbuilderToolPreview/BrandBuilderToolPreviewProps.tsx +8 -0
- package/src/Components/DataDisplay/BrandBuilderTool/brandBuilder.module.scss +215 -0
- package/src/Components/DataDisplay/CallToActionBlock/CallToActionBlock.stories.tsx +92 -0
- package/src/Components/DataDisplay/CallToActionBlock/CallToActionBlock.tsx +80 -0
- package/src/Components/DataDisplay/CallToActionBlock/CallToActionBlockProps.tsx +18 -0
- package/src/Components/DataDisplay/CallToActionBlock/callToAction.module.scss +79 -0
- package/src/Components/DataDisplay/CallToActionBlock/callToAction.module.scss~ +78 -0
- package/src/Components/DataDisplay/CarouselBlock/CarouselBlock.stories.tsx +77 -0
- package/src/Components/DataDisplay/CarouselBlock/CarouselBlock.tsx +73 -0
- package/src/Components/DataDisplay/CarouselBlock/CarouselBlockProps.tsx +23 -0
- package/src/Components/DataDisplay/CarouselBlock/carouselBlock.module.scss +60 -0
- package/src/Components/DataDisplay/ChatItenaryBlock/ChatItenaryBlock.stories.tsx +128 -0
- package/src/Components/DataDisplay/ChatItenaryBlock/ChatItenaryBlock.tsx +257 -0
- package/src/Components/DataDisplay/ChatItenaryBlock/ChatItenaryBlockProps.tsx +44 -0
- package/src/Components/DataDisplay/ChatItenaryBlock/chatItenaryBlock.module.scss +777 -0
- package/src/Components/DataDisplay/ContactsBlock/ContactItem.tsx +47 -0
- package/src/Components/DataDisplay/ContactsBlock/ContactItemProps.tsx +10 -0
- package/src/Components/DataDisplay/ContactsBlock/ContactsBlock.stories.tsx +59 -0
- package/src/Components/DataDisplay/ContactsBlock/ContactsBlock.tsx +24 -0
- package/src/Components/DataDisplay/ContactsBlock/ContactsBlockProps.tsx +8 -0
- package/src/Components/DataDisplay/ContactsBlock/contactsBlock.module.scss +165 -0
- package/src/Components/DataDisplay/ContentBlock/ContentBlock.stories.tsx +107 -0
- package/src/Components/DataDisplay/ContentBlock/ContentBlock.tsx +36 -0
- package/src/Components/DataDisplay/ContentBlock/ContentBlockProps.tsx +11 -0
- package/src/Components/DataDisplay/ContentBlock/contentBlock.module.scss +76 -0
- package/src/Components/DataDisplay/DetailsCard/DetailsCard.tsx +8 -10
- package/src/Components/DataDisplay/DetailsCard/DetailsCardProps.tsx +0 -1
- package/src/Components/DataDisplay/DetailsCard/detailsCard.module.scss +3 -1
- package/src/Components/DataDisplay/ImageContent/ImageContent.stories.tsx +5 -11
- package/src/Components/DataDisplay/ImageContent/ImageContent.tsx +10 -9
- package/src/Components/DataDisplay/ImageContent/ImageContentProps.tsx +4 -0
- package/src/Components/DataDisplay/ImageContent/imageContent.module.scss +30 -14
- package/src/Components/DataDisplay/IntroBlock/IntroBlock.stories.tsx +1 -1
- package/src/Components/DataDisplay/IntroBlock/introBlock.module.scss +27 -3
- package/src/Components/DataDisplay/KPIBlock/KPIBlock.stories.tsx +3 -4
- package/src/Components/DataDisplay/KPIBlock/KPIBlock.tsx +14 -7
- package/src/Components/DataDisplay/KPIBlock/KPIBlockProps.tsx +6 -2
- package/src/Components/DataDisplay/KPIBlock/kpiBlock.module.scss +179 -16
- package/src/Components/DataDisplay/{Pathway/Pathway.stories.tsx → ListBlock/ListBlock.stories.tsx} +20 -18
- package/src/Components/DataDisplay/ListBlock/ListBlock.tsx +133 -0
- package/src/Components/DataDisplay/ListBlock/ListBlockProps.tsx +28 -0
- package/src/Components/DataDisplay/{Pathway/pathway.module.scss → ListBlock/listBlock.module.scss} +30 -6
- package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.stories.tsx +93 -0
- package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlock.tsx +74 -0
- package/src/Components/DataDisplay/ListingDetailBlock/ListingDetailBlockProps.tsx +23 -0
- package/src/Components/DataDisplay/ListingDetailBlock/listingDetailBlock.module.scss +265 -0
- package/src/Components/DataDisplay/Media/Media.stories.tsx +36 -0
- package/src/Components/DataDisplay/Media/Media.tsx +158 -0
- package/src/Components/DataDisplay/Media/MediaProps.tsx +8 -0
- package/src/Components/DataDisplay/Media/media.module.scss +16 -0
- package/src/Components/DataDisplay/Media/mediaVideo.scss +88 -0
- package/src/Components/DataDisplay/Modal/Modal.stories.tsx +89 -0
- package/src/Components/DataDisplay/Modal/Modal.tsx +16 -0
- package/src/Components/DataDisplay/Modal/ModalActions.tsx +14 -0
- package/src/Components/DataDisplay/Modal/ModalActionsLeft.tsx +13 -0
- package/src/Components/DataDisplay/Modal/ModalActionsLeftProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalActionsProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalActionsRight.tsx +14 -0
- package/src/Components/DataDisplay/Modal/ModalActionsRightProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalBody.tsx +14 -0
- package/src/Components/DataDisplay/Modal/ModalBodyProps.tsx +8 -0
- package/src/Components/DataDisplay/Modal/ModalCurtain.tsx +6 -0
- package/src/Components/DataDisplay/Modal/ModalHeader.tsx +55 -0
- package/src/Components/DataDisplay/Modal/ModalHeaderProps.tsx +10 -0
- package/src/Components/DataDisplay/Modal/ModalProps.tsx +9 -0
- package/src/Components/DataDisplay/Modal/modal.module.scss +178 -0
- package/src/Components/DataDisplay/PathwayBlock/PathwayBlock.stories.tsx +27 -13
- package/src/Components/DataDisplay/PathwayBlock/PathwayBlock.tsx +8 -8
- package/src/Components/DataDisplay/PathwayBlock/PathwayBlockProps.tsx +10 -4
- package/src/Components/DataDisplay/PathwayBlock/pathwayBlock.module.scss +27 -23
- package/src/Components/DataDisplay/PromoBannerBlock/PromoBanner.stories.tsx +3 -4
- package/src/Components/DataDisplay/PromoBannerBlock/PromoBannerBlock.tsx +2 -6
- package/src/Components/DataDisplay/PromoBannerBlock/promoBanner.module.scss +12 -15
- package/src/Components/DataDisplay/TestimonyCard/TestimonyCard.stories.tsx +11 -5
- package/src/Components/DataDisplay/TestimonyCard/TestimonyCard.tsx +70 -54
- package/src/Components/DataDisplay/TestimonyCard/testimonyCard.module.scss +139 -70
- package/src/Components/DataDisplay/index.ts +87 -4
- package/src/Components/DataDisplay/slider.scss +43 -0
- package/src/Components/Form/Button/ButtonProps.tsx +1 -1
- package/src/Components/Form/Button/button.module.scss +2 -0
- package/src/Components/Form/Checkbox/Checkbox.stories.tsx +51 -0
- package/src/Components/Form/Checkbox/Checkbox.tsx +111 -0
- package/src/Components/Form/Checkbox/CheckboxProps.tsx +24 -0
- package/src/Components/Form/Checkbox/checkbox.module.scss +105 -0
- package/src/Components/Form/CheckboxSelect/CheckboxSelect.tsx +5 -0
- package/src/Components/Form/CheckboxSelect/CheckboxSelectItem.tsx +5 -0
- package/src/Components/Form/CheckboxSet/CheckboxSet.stories.tsx +100 -0
- package/src/Components/Form/CheckboxSet/CheckboxSet.tsx +14 -0
- package/src/Components/Form/CheckboxSet/CheckboxSetItem.tsx +109 -0
- package/src/Components/Form/CheckboxSet/CheckboxSetProps.tsx +9 -0
- package/src/Components/Form/CheckboxSet/checkboxSet.module.scss +19 -0
- package/src/Components/Form/CurrencyField/CurrencyField.stories.tsx +23 -0
- package/src/Components/Form/CurrencyField/CurrencyField.tsx +105 -0
- package/src/Components/Form/CurrencyField/CurrencyFieldProps.tsx +10 -0
- package/src/Components/Form/DateField/DateField.stories.tsx +22 -0
- package/src/Components/Form/DateField/DateField.tsx +61 -0
- package/src/Components/Form/DropdownBadge/DropdownBadge.stories.tsx +54 -0
- package/src/Components/Form/DropdownBadge/DropdownBadge.tsx +303 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeItem.tsx +54 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeItemProps.tsx +11 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeProps.tsx +34 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeSelector.tsx +17 -0
- package/src/Components/Form/DropdownBadge/DropdownBadgeSelectorProps.tsx +10 -0
- package/src/Components/Form/DropdownBadge/dropdownBadge.module.scss +195 -0
- package/src/Components/Form/DropdownField/CountryDropdownField/CountryDropdownField.stories.tsx +36 -0
- package/src/Components/Form/DropdownField/CountryDropdownField/CountryDropdownField.tsx +426 -0
- package/src/Components/Form/DropdownField/CountryDropdownField/CountryDropdownFieldProps.tsx +30 -0
- package/src/Components/Form/DropdownField/DropdownField.stories.tsx +55 -0
- package/src/Components/Form/DropdownField/DropdownField.tsx +245 -0
- package/src/Components/Form/DropdownField/DropdownFieldItem.tsx +33 -0
- package/src/Components/Form/DropdownField/DropdownFieldItemProps.tsx +10 -0
- package/src/Components/Form/DropdownField/DropdownFieldProps.tsx +39 -0
- package/src/Components/Form/DropdownField/DropdownFieldSelector.tsx +23 -0
- package/src/Components/Form/DropdownField/DropdownFieldSelectorProps.tsx +8 -0
- package/src/Components/Form/DropdownField/dropdown.module.scss +144 -0
- package/src/Components/Form/EmailField/EmailField.stories.ts +23 -0
- package/src/Components/Form/EmailField/EmailField.tsx +56 -0
- package/src/Components/Form/ErrorMessage/ErrorMessage.tsx +5 -0
- package/src/Components/Form/FormFieldHolder/FormFieldHolder.stories.tsx +31 -0
- package/src/Components/Form/FormFieldHolder/FormFieldHolder.tsx +57 -0
- package/src/Components/Form/FormFieldHolder/FormFieldHolderProps.tsx +16 -0
- package/src/Components/Form/FormFieldHolder/formHolder.module.scss +71 -0
- package/src/Components/Form/IconButton/IconButton.stories.tsx +45 -0
- package/src/Components/Form/IconButton/IconButton.tsx +65 -0
- package/src/Components/Form/IconButton/IconButtonProps.tsx +16 -0
- package/src/Components/Form/IconButton/iconButton.module.scss +157 -0
- package/src/Components/Form/InputProps.tsx +30 -0
- package/src/Components/Form/LandingPageForm/LandingPageForm.stories.tsx +110 -0
- package/src/Components/Form/LandingPageForm/LandingPageForm.tsx +24 -0
- package/src/Components/Form/LandingPageForm/LandingPageFormLeft.tsx +51 -0
- package/src/Components/Form/LandingPageForm/LandingPageFormLeftProps.tsx +13 -0
- package/src/Components/Form/LandingPageForm/LandingPageFormProps.tsx +9 -0
- package/src/Components/Form/LandingPageForm/LandingPageFormRight.tsx +49 -0
- package/src/Components/Form/LandingPageForm/LandingPageFormRightProps.tsx +14 -0
- package/src/Components/Form/LandingPageForm/landingPageForm.module.scss +190 -0
- package/src/Components/Form/LoadingInput/LoadingInput.tsx +12 -0
- package/src/Components/Form/LoadingInput/loadingInput.module.scss +15 -0
- package/src/Components/Form/MicroForm/MicroForm.stories.tsx +28 -0
- package/src/Components/Form/MicroForm/MicroForm.tsx +22 -0
- package/src/Components/Form/MicroForm/MicroFormProps.tsx +12 -0
- package/src/Components/Form/MicroForm/microForm.module.scss +64 -0
- package/src/Components/Form/MultiSelectField/MultiSelectField.stories.tsx +39 -0
- package/src/Components/Form/MultiSelectField/MultiSelectField.tsx +439 -0
- package/src/Components/Form/MultiSelectField/MultiSelectFieldItem.tsx +36 -0
- package/src/Components/Form/MultiSelectField/MultiSelectFieldItemProps.tsx +12 -0
- package/src/Components/Form/MultiSelectField/MultiSelectFieldProps.tsx +36 -0
- package/src/Components/Form/MultiSelectField/MultiSelectFieldTag.tsx +24 -0
- package/src/Components/Form/MultiSelectField/MultiSelectFieldTagProps.tsx +6 -0
- package/src/Components/Form/MultiSelectField/multiSelectField.module.scss +205 -0
- package/src/Components/Form/NumberField/NumberField.stories.ts +23 -0
- package/src/Components/Form/NumberField/NumberField.tsx +137 -0
- package/src/Components/Form/NumberField/NumberFieldProps.tsx +10 -0
- package/src/Components/Form/PasswordField/PasswordField.stories.tsx +22 -0
- package/src/Components/Form/PasswordField/PasswordField.tsx +73 -0
- package/src/Components/Form/PhoneField/PhoneField.stories.ts +21 -0
- package/src/Components/Form/PhoneField/PhoneField.tsx +55 -0
- package/src/Components/Form/RadioButtons/RadioButton.tsx +100 -0
- package/src/Components/Form/RadioButtons/RadioButtonProps.tsx +25 -0
- package/src/Components/Form/RadioButtons/RadioButtons.stories.tsx +92 -0
- package/src/Components/Form/RadioButtons/RadioButtons.tsx +18 -0
- package/src/Components/Form/RadioButtons/RadioButtonsProps.tsx +10 -0
- package/src/Components/Form/RadioButtons/radioButton.stories.scss +3 -0
- package/src/Components/Form/RadioButtons/radiobutton.module.scss +188 -0
- package/src/Components/Form/RichTextEditor/RichTextEditor.stories.ts +41 -0
- package/src/Components/Form/RichTextEditor/RichTextEditor.tsx +115 -0
- package/src/Components/Form/RichTextEditor/RichTextEditorProps.tsx +25 -0
- package/src/Components/Form/RichTextEditor/richTextEditor.module.scss +10 -0
- package/src/Components/Form/SimpleForm/SimpleForm.stories.tsx +55 -0
- package/src/Components/Form/SimpleForm/SimpleForm.tsx +63 -0
- package/src/Components/Form/SimpleForm/SimpleFormProps.tsx +13 -0
- package/src/Components/Form/SimpleForm/simple-form-bg-design.tsx +21 -0
- package/src/Components/Form/SimpleForm/simpleForm.module.scss +72 -0
- package/src/Components/Form/TextField/TextField.stories.ts +22 -0
- package/src/Components/Form/TextField/TextField.tsx +62 -0
- package/src/Components/Form/TextField/TextFieldProps.tsx +8 -0
- package/src/Components/Form/Textarea/Textarea.stories.ts +31 -0
- package/src/Components/Form/Textarea/Textarea.tsx +74 -0
- package/src/Components/Form/Textarea/TextareaProps.tsx +28 -0
- package/src/Components/Form/Textarea/textarea.module.scss +48 -0
- package/src/Components/Form/TimeField/TimeField.stories.tsx +22 -0
- package/src/Components/Form/TimeField/TimeField.tsx +58 -0
- package/src/Components/Form/ToggleSwitch/ToggleSwitch.stories.tsx +50 -0
- package/src/Components/Form/ToggleSwitch/ToggleSwitch.tsx +87 -0
- package/src/Components/Form/ToggleSwitch/ToggleSwitchProps.tsx +22 -0
- package/src/Components/Form/ToggleSwitch/toggleSwitch.module.scss +84 -0
- package/src/Components/Form/TypableDropdownField/TypableDropdownField.stories.tsx +55 -0
- package/src/Components/Form/TypableDropdownField/TypableDropdownField.tsx +313 -0
- package/src/Components/Form/TypableDropdownField/TypableDropdownFieldItem.tsx +27 -0
- package/src/Components/Form/TypableDropdownField/TypableDropdownFieldItemProps.tsx +9 -0
- package/src/Components/Form/TypableDropdownField/TypableDropdownFieldProps.tsx +38 -0
- package/src/Components/Form/TypableDropdownField/TypableDropdownFieldSelector.tsx +16 -0
- package/src/Components/Form/TypableDropdownField/TypableDropdownFieldSelectorProps.tsx +8 -0
- package/src/Components/Form/TypableDropdownField/typableDropdown.module.scss +185 -0
- package/src/Components/Form/UnitInput/UnitField.stories.ts +22 -0
- package/src/Components/Form/UnitInput/UnitField.tsx +129 -0
- package/src/Components/Form/UnitInput/UnitFieldProps.tsx +9 -0
- package/src/Components/Form/index.ts +42 -1
- package/src/Components/Form/inputs.module.scss +172 -0
- package/src/Components/Icons/Communication/PaperPlaneTilt/PaperPlaneTilt.tsx +37 -0
- package/src/Components/Icons/OfficeAndEditing/Paperclip/Paperclip.tsx +37 -0
- package/src/Components/Icons/SystemAndDevice/CheckCircle/CheckCircle.tsx +35 -0
- package/src/Components/Icons/index.ts +5 -1
- package/src/Components/Layout/Footer/Footer.stories.tsx +5 -7
- package/src/Components/Layout/Footer/Footer.tsx +1 -2
- package/src/Components/Layout/Footer/FooterBottom.tsx +83 -10
- package/src/Components/Layout/Footer/FooterBottomLeft.tsx +36 -1
- package/src/Components/Layout/Footer/FooterBottomLeftProps.tsx +4 -0
- package/src/Components/Layout/Footer/FooterBottomProps.tsx +13 -0
- package/src/Components/Layout/Footer/FooterMiddle.tsx +0 -4
- package/src/Components/Layout/Footer/FooterProps.tsx +1 -1
- package/src/Components/Layout/Footer/FooterTop.tsx +2 -2
- package/src/Components/Layout/Footer/footer.module.scss +211 -123
- package/src/Components/Layout/Header/Header.stories.tsx +8 -6
- package/src/Components/Layout/Header/Header.tsx +3 -3
- package/src/Components/Layout/Header/HeaderProps.tsx +1 -0
- package/src/Components/Layout/Header/MegaMenu/MegaMenu.tsx +156 -83
- package/src/Components/Layout/Header/MegaMenu/MegaMenuProps.tsx +22 -9
- package/src/Components/Layout/Header/MegaMenu/megaMenu.module.scss +4 -2
- package/src/Components/Layout/Header/MobileNavigation/MobileNavigation.tsx +4 -3
- package/src/Components/Layout/Header/MobileNavigation/MobileNavigationItem.tsx +7 -3
- package/src/Components/Layout/Header/MobileNavigation/MobileNavigationItemProps.tsx +3 -0
- package/src/Components/Layout/Header/MobileNavigation/MobileNavigationProps.tsx +1 -0
- package/src/Components/Layout/Header/MobileNavigation/MobileSubNavigation/MobileSubNavigation.tsx +10 -5
- package/src/Components/Layout/Header/MobileNavigation/MobileSubNavigation/MobileSubNavigationItem.tsx +8 -9
- package/src/Components/Layout/Header/MobileNavigation/MobileSubNavigation/MobileSubNavigationItemProps.tsx +2 -2
- package/src/Components/Layout/Header/MobileNavigation/MobileSubNavigation/MobileSubNavigationProps.tsx +1 -0
- package/src/Components/Layout/Header/MobileNavigation/mobileNavigation.module.scss +14 -1
- package/src/Components/Layout/Header/header.module.scss +17 -19
- package/src/Components/Layout/Header/header.scss +8 -0
- package/src/Components/Layout/HeroBanner/HeroBanner.tsx +6 -6
- package/src/Components/Layout/HeroBanner/heroBanner.module.scss +42 -6
- package/src/Components/Layout/index.ts +11 -2
- package/src/Components/SelwynUIProvider/SelwynUIContext.tsx +16 -0
- package/src/Components/SelwynUIProvider/SelwynUIProvider.tsx +46 -0
- package/src/Components/SelwynUIProvider/index.ts +2 -0
- package/src/Components/Shared/Container/Container.tsx +19 -9
- package/src/Components/Shared/Container/ContainerProps.tsx +7 -2
- package/src/Components/Shared/Container/container.module.scss +59 -7
- package/src/Components/Shared/ElementHolder/ElementHolderProps.tsx +1 -1
- package/src/Components/Shared/ElementHolder/elementHolder.module.scss +10 -5
- package/src/Components/Shared/PillarIcon/PillarIcon.tsx +14 -5
- package/src/Components/Shared/PillarLogo/PillarLogo.tsx +2 -2
- package/src/Components/index.ts +1 -0
- package/dist/App.d.ts +0 -2
- package/dist/Components/DataDisplay/DetailsCard/DetailsCard.d.ts +0 -3
- package/dist/Components/DataDisplay/DetailsCard/DetailsCardProps.d.ts +0 -10
- package/dist/Components/DataDisplay/ImageContent/ImageContent.d.ts +0 -3
- package/dist/Components/DataDisplay/ImageContent/ImageContentMaskingImages.d.ts +0 -2
- package/dist/Components/DataDisplay/ImageContent/ImageContentProps.d.ts +0 -27
- package/dist/Components/DataDisplay/IntroBlock/IntroBlock.d.ts +0 -3
- package/dist/Components/DataDisplay/IntroBlock/IntroBlockProps.d.ts +0 -8
- package/dist/Components/DataDisplay/KPIBlock/KPIBlock.d.ts +0 -3
- package/dist/Components/DataDisplay/KPIBlock/KPIBlockProps.d.ts +0 -11
- package/dist/Components/DataDisplay/Pathway/Pathway.d.ts +0 -3
- package/dist/Components/DataDisplay/Pathway/PathwayProps.d.ts +0 -15
- package/dist/Components/DataDisplay/PromoBannerBlock/PromoBannerBlock.d.ts +0 -3
- package/dist/Components/DataDisplay/PromoBannerBlock/PromoBannerBlockProps.d.ts +0 -14
- package/dist/Components/DataDisplay/PromoBannerBlock/promo-banner-bg-design.d.ts +0 -2
- package/dist/Components/DataDisplay/index.d.ts +0 -10
- package/dist/Components/Form/Button/Button.d.ts +0 -3
- package/dist/Components/Form/Button/ButtonProps.d.ts +0 -14
- package/dist/Components/Form/index.d.ts +0 -2
- package/dist/Components/Icons/Arrows/ArrowLeft/ArrowLeft.d.ts +0 -3
- package/dist/Components/Icons/Arrows/ArrowRight/ArrowRight.d.ts +0 -3
- package/dist/Components/Icons/Arrows/ArrowSquareOut/ArrowSquareOut.d.ts +0 -3
- package/dist/Components/Icons/Arrows/ArrowsDownUp/ArrowsDownUp.d.ts +0 -3
- package/dist/Components/Icons/Arrows/ArrowsOutCardinal/ArrowsOutCardinal.d.ts +0 -3
- package/dist/Components/Icons/Arrows/CaretCircleRight/CaretCircleRight.d.ts +0 -3
- package/dist/Components/Icons/Arrows/CaretDown/CaretDown.d.ts +0 -3
- package/dist/Components/Icons/Arrows/CaretLeft/CaretLeft.d.ts +0 -3
- package/dist/Components/Icons/Arrows/CaretRight/CaretRight.d.ts +0 -3
- package/dist/Components/Icons/Arrows/CaretUp/CaretUp.d.ts +0 -3
- package/dist/Components/Icons/Arrows/CaretUpDown/CaretUpDown.d.ts +0 -3
- package/dist/Components/Icons/Brands/FacebookLogo/FacebookLogo.d.ts +0 -3
- package/dist/Components/Icons/Brands/InstagramLogo/InstagramLogo.d.ts +0 -3
- package/dist/Components/Icons/Brands/LinkedinLogo/LinkedinLogo.d.ts +0 -3
- package/dist/Components/Icons/Brands/WindowsLogo/WindowsLogo.d.ts +0 -3
- package/dist/Components/Icons/Commerce/Backpack/Backpack.d.ts +0 -3
- package/dist/Components/Icons/Commerce/BowlSteam/BowlSteam.d.ts +0 -3
- package/dist/Components/Icons/Commerce/Bread/Bread.d.ts +0 -3
- package/dist/Components/Icons/Commerce/Cheers/Cheers.d.ts +0 -3
- package/dist/Components/Icons/Commerce/ChefHat/ChefHat.d.ts +0 -3
- package/dist/Components/Icons/Commerce/Coffee/Coffee.d.ts +0 -3
- package/dist/Components/Icons/Commerce/CreditCard/CreditCard.d.ts +0 -3
- package/dist/Components/Icons/Commerce/CurrencyDollarSimple/CurrencyDollarSimple.d.ts +0 -3
- package/dist/Components/Icons/Commerce/Grains/Grains.d.ts +0 -3
- package/dist/Components/Icons/Commerce/Scale/Scale.d.ts +0 -3
- package/dist/Components/Icons/Commerce/StoreFront/StoreFront.d.ts +0 -3
- package/dist/Components/Icons/Communication/AddressBook/AddressBook.d.ts +0 -3
- package/dist/Components/Icons/Communication/AddressBook/AddressBook.stories.d.ts +0 -21
- package/dist/Components/Icons/Communication/AsterickSimple/AsteriskSimple.d.ts +0 -3
- package/dist/Components/Icons/Communication/AsterickSimple/AsteriskSimple.stories.d.ts +0 -21
- package/dist/Components/Icons/Communication/Asterisk/Asterisk.d.ts +0 -3
- package/dist/Components/Icons/Communication/Asterisk/Asterisk.stories.d.ts +0 -21
- package/dist/Components/Icons/Communication/At/At.d.ts +0 -3
- package/dist/Components/Icons/Communication/At/At.stories.d.ts +0 -21
- package/dist/Components/Icons/Communication/Broadcast/Broadcast.d.ts +0 -3
- package/dist/Components/Icons/Communication/Broadcast/Broadcast.stories.d.ts +0 -21
- package/dist/Components/Icons/Communication/Chat/Chat.d.ts +0 -3
- package/dist/Components/Icons/Communication/Chat/Chat.stories.d.ts +0 -21
- package/dist/Components/Icons/Communication/ChatCircleText/ChatCircleText.d.ts +0 -3
- package/dist/Components/Icons/Communication/EnvelopeSimple/EnvelopeSimple.d.ts +0 -3
- package/dist/Components/Icons/Communication/Export/Export.d.ts +0 -3
- package/dist/Components/Icons/Communication/Phone/Phone.d.ts +0 -3
- package/dist/Components/Icons/Communication/ThumbsUp/ThumbsUp.d.ts +0 -3
- package/dist/Components/Icons/Communication/Translate/Translate.d.ts +0 -3
- package/dist/Components/Icons/Design/DropHalfBottom/DropHalfBottom.d.ts +0 -3
- package/dist/Components/Icons/Design/Eye/Eye.d.ts +0 -3
- package/dist/Components/Icons/Design/EyeSlash/EyeSlash.d.ts +0 -3
- package/dist/Components/Icons/Design/GearFine/GearFine.d.ts +0 -3
- package/dist/Components/Icons/Design/PencilLine/PencilLine.d.ts +0 -3
- package/dist/Components/Icons/Design/PencilSimple/PencilSimple.d.ts +0 -3
- package/dist/Components/Icons/Design/Ruler/Ruler.d.ts +0 -3
- package/dist/Components/Icons/Design/SquaresFour/SquaresFour.d.ts +0 -3
- package/dist/Components/Icons/Education/BookOpenText/BookOpenText.d.ts +0 -3
- package/dist/Components/Icons/Education/BookmarkSimple/BookmarkSimple.d.ts +0 -3
- package/dist/Components/Icons/Education/Certificate/Certificate.d.ts +0 -3
- package/dist/Components/Icons/Education/GraduationCap/GraduationCap.d.ts +0 -3
- package/dist/Components/Icons/Games/Cricket/Cricket.d.ts +0 -3
- package/dist/Components/Icons/Games/Football/Football.d.ts +0 -3
- package/dist/Components/Icons/Games/Golf/Golf.d.ts +0 -3
- package/dist/Components/Icons/HealthAndWellness/Barbell/Barbell.d.ts +0 -3
- package/dist/Components/Icons/IconProps.d.ts +0 -4
- package/dist/Components/Icons/MapAndTravel/Barn/Barn.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Bicycle/Bicycle.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Bus/Bus.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Car/Car.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/ChargingStation/ChargingStation.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Farm/Farm.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Globe/Globe.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Goggles/Goggles.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/House/House.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/HouseSimple/HouseSimple.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/MapPin/MapPin.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/MapTriFold/MapTriFold.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Path/Path.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/RoadHorizon/RoadHorizon.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/SteeringWheel/SteeringWheel.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/SwimmingPool/SwimmingPool.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Tram/Tram.d.ts +0 -3
- package/dist/Components/Icons/MapAndTravel/Van/Van.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/Calculator/Calculator.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/ChartBar/ChartBar.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/ChartBarHorizontal/ChartBarHorizontal.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/ChartLine/ChartLine.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/ChartLineUp/ChartLineUp.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/ChartPie/ChartPie.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/Minus/Minus.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/MinusCircle/MinusCircle.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/NumberSquareThree/NumberSquareThree.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/Plus/Plus.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/PlusCircle/PlusCircle.d.ts +0 -3
- package/dist/Components/Icons/MathsAndFinance/XIcon/XIcon.d.ts +0 -3
- package/dist/Components/Icons/Media/Camera/Camera.d.ts +0 -3
- package/dist/Components/Icons/Media/DiscoBall/DiscoBall.d.ts +0 -3
- package/dist/Components/Icons/Media/FilmStrip/FilmStrip.d.ts +0 -3
- package/dist/Components/Icons/Media/Microphone/Microphone.d.ts +0 -3
- package/dist/Components/Icons/Media/MusicNotes/MusicNotes.d.ts +0 -3
- package/dist/Components/Icons/Media/PlayCircle/PlayCircle.d.ts +0 -3
- package/dist/Components/Icons/Media/SlidersHorizontal/SlidersHorizontal.d.ts +0 -3
- package/dist/Components/Icons/Media/StopCircle/StopCircle.d.ts +0 -3
- package/dist/Components/Icons/Media/VideoCamera/VideoCamera.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/BuildinfOffice/BuildingOffice.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/Copy/Copy.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/FileText/FileText.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/Files/Files.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/FloppyDisk/FloppyDisk.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/Folder/Folder.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/FolderSimplePlus/FolderSimplePlus.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/Folders/Folders.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/List/List.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/ListBullets/ListBullets.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/ListDashes/ListDashes.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/Printer/Printer.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/TextAa/TextAa.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/TextColumns/TextColumns.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/Trash/Trash.d.ts +0 -3
- package/dist/Components/Icons/OfficeAndEditing/TrashSimple/TrashSimple.d.ts +0 -3
- package/dist/Components/Icons/People/Person/Person.d.ts +0 -3
- package/dist/Components/Icons/People/PersonArmsSpread/PersonArmsSpread.d.ts +0 -3
- package/dist/Components/Icons/People/PersonSimpleBike/PersonSimpleBike.d.ts +0 -3
- package/dist/Components/Icons/People/PersonSimpleSki/PersonSimpleSki.d.ts +0 -3
- package/dist/Components/Icons/People/PersonSimpleWalk/PersonSimpleWalk.d.ts +0 -3
- package/dist/Components/Icons/People/User/User.d.ts +0 -3
- package/dist/Components/Icons/People/UserCircle/UserCircle.d.ts +0 -3
- package/dist/Components/Icons/People/UserSwitch/UserSwitch.d.ts +0 -3
- package/dist/Components/Icons/People/Users/Users.d.ts +0 -3
- package/dist/Components/Icons/SecurityAndWarnings/Info/Info.d.ts +0 -3
- package/dist/Components/Icons/SecurityAndWarnings/Key/Key.d.ts +0 -3
- package/dist/Components/Icons/SecurityAndWarnings/LockKeyOpen/LockKeyOpen.d.ts +0 -3
- package/dist/Components/Icons/SecurityAndWarnings/LockSimple/LockSimple.d.ts +0 -3
- package/dist/Components/Icons/SecurityAndWarnings/Question/Question.d.ts +0 -3
- package/dist/Components/Icons/SecurityAndWarnings/ShieldCheck/ShieldCheck.d.ts +0 -3
- package/dist/Components/Icons/SecurityAndWarnings/WarningCircle/WarningCircle.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/Bell/Bell.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/Check/Check.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/CheckSquare/CheckSquare.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/CloudCheck/CloudCheck.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/Desktop/Desktop.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/DeviceMobile/DeviceMobile.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/DotSixVertical/DotSixVertical.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/DotsSix/DotsSix.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/DotsThree/DotsThree.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/DotsThreeVertical/DotsThreeVertical.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/DownloadSimple/DownloadSimple.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/Gear/Gear.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/Link/Link.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/MagnifyingGlass/MagnifyingGlass.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/RadioButtonIcon/RadioButtonIcon.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/SignIn/SignIn.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/SignOut/SignOut.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/ToggleLeft/ToggleLeft.d.ts +0 -3
- package/dist/Components/Icons/SystemAndDevice/ToggleRight/ToggleRight.d.ts +0 -3
- package/dist/Components/Icons/Time/Calendar/Calendar.d.ts +0 -3
- package/dist/Components/Icons/Time/CalendarBank/CalendarBank.d.ts +0 -3
- package/dist/Components/Icons/Time/CalendarCheck/CalendarCheck.d.ts +0 -3
- package/dist/Components/Icons/Time/CalendarDots/CalendarDots.d.ts +0 -3
- package/dist/Components/Icons/Time/Clock/Clock.d.ts +0 -3
- package/dist/Components/Icons/Time/ClockCounterClockwise/ClockCounterClockwise.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Bird/Bird.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Campfire/Campfire.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/CloudSun/CloudSun.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Cow/Cow.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Dog/Dog.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/FishSimple/FishSimple.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Flower/Flower.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Moon/Moon.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Mountains/Mountains.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Plant/Plant.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Snowflake/Snowflake.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Sparkle/Sparkle.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Sun/Sun.d.ts +0 -3
- package/dist/Components/Icons/WeatherAndNature/Tree/Tree.d.ts +0 -3
- package/dist/Components/Icons/index.d.ts +0 -123
- package/dist/Components/Layout/Footer/Footer.d.ts +0 -3
- package/dist/Components/Layout/Footer/FooterBottom.d.ts +0 -3
- package/dist/Components/Layout/Footer/FooterBottomLeft.d.ts +0 -3
- package/dist/Components/Layout/Footer/FooterBottomLeftProps.d.ts +0 -11
- package/dist/Components/Layout/Footer/FooterBottomProps.d.ts +0 -5
- package/dist/Components/Layout/Footer/FooterBottomRight.d.ts +0 -3
- package/dist/Components/Layout/Footer/FooterBottomRightProps.d.ts +0 -6
- package/dist/Components/Layout/Footer/FooterItem.d.ts +0 -3
- package/dist/Components/Layout/Footer/FooterItemProps.d.ts +0 -6
- package/dist/Components/Layout/Footer/FooterMiddle.d.ts +0 -3
- package/dist/Components/Layout/Footer/FooterMiddleProps.d.ts +0 -6
- package/dist/Components/Layout/Footer/FooterProps.d.ts +0 -9
- package/dist/Components/Layout/Footer/FooterTop.d.ts +0 -3
- package/dist/Components/Layout/Footer/FooterTopProps.d.ts +0 -7
- package/dist/Components/Layout/Footer/footer-bg-design.d.ts +0 -2
- package/dist/Components/Layout/Header/Header.d.ts +0 -3
- package/dist/Components/Layout/Header/HeaderProps.d.ts +0 -7
- package/dist/Components/Layout/Header/HeaderRight.d.ts +0 -3
- package/dist/Components/Layout/Header/HeaderRightItem.d.ts +0 -3
- package/dist/Components/Layout/Header/HeaderRightItemProps.d.ts +0 -11
- package/dist/Components/Layout/Header/HeaderRightProps.d.ts +0 -5
- package/dist/Components/Layout/Header/MagnifyingGlass/MagnifyingGlass.d.ts +0 -2
- package/dist/Components/Layout/Header/MegaMenu/MegaMenu.d.ts +0 -2
- package/dist/Components/Layout/Header/MegaMenu/MegaMenuProps.d.ts +0 -4
- package/dist/Components/Layout/HeroBanner/HeroBanner.d.ts +0 -3
- package/dist/Components/Layout/HeroBanner/HeroBannerProps.d.ts +0 -9
- package/dist/Components/Layout/HeroBanner/LargeHeroIcon.d.ts +0 -2
- package/dist/Components/Layout/index.d.ts +0 -22
- package/dist/Components/Shared/Container/Container.d.ts +0 -3
- package/dist/Components/Shared/Container/ContainerProps.d.ts +0 -6
- package/dist/Components/Shared/ElementHolder/ElementHolder.d.ts +0 -3
- package/dist/Components/Shared/ElementHolder/ElementHolderProps.d.ts +0 -15
- package/dist/Components/Shared/index.d.ts +0 -4
- package/dist/img/card-one.png +0 -0
- package/dist/img/card-three.png +0 -0
- package/dist/img/card-two.png +0 -0
- package/dist/img/footer-bg-design.svg +0 -14
- package/dist/img/footer-logo.svg +0 -9
- package/dist/img/promo-banner-image.svg +0 -9
- package/dist/img/visit-brand-piller.svg +0 -6
- package/dist/img/waikirikiri-full-logo.svg +0 -23
- package/dist/index.cjs.js +0 -14
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.es.d.ts +0 -2
- package/dist/index.es.js +0 -6787
- package/dist/index.es.js.map +0 -1
- package/dist/main.d.ts +0 -0
- package/dist/selwynui.css +0 -1
- package/dist/tsconfig.app.tsbuildinfo +0 -1
- package/dist/vite.svg +0 -1
- package/src/Components/DataDisplay/Pathway/Pathway.tsx +0 -94
- package/src/Components/DataDisplay/Pathway/PathwayProps.tsx +0 -17
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
.dropdown {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
&.lock {
|
|
5
|
+
.control {
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.control {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 24px;
|
|
16
|
+
padding: 0 var(--spacing-1\/2);
|
|
17
|
+
border: 1px solid var(--color-gray-300);
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
font-family: var(--font);
|
|
20
|
+
font-size: var(--font-size-body-sm);
|
|
21
|
+
line-height: var(--line-height-body-sm);
|
|
22
|
+
font-weight: var(--font-weight-body-sm);
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
background: white;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.disabled {
|
|
28
|
+
cursor: not-allowed;
|
|
29
|
+
opacity: 0.3;
|
|
30
|
+
pointer-events: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.loading {
|
|
34
|
+
.labelWrapper {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.control {
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.customLoader {
|
|
44
|
+
width: 12px;
|
|
45
|
+
height: 12px;
|
|
46
|
+
border-radius: 100%;
|
|
47
|
+
position: relative;
|
|
48
|
+
border: 2px solid transparent;
|
|
49
|
+
border-top-color: var(--color-gray-400);
|
|
50
|
+
border-bottom-color: var(--color-gray-400);
|
|
51
|
+
border-left-color: var(--color-gray-400);
|
|
52
|
+
animation: rotate-ring 1s infinite linear;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes rotate-ring {
|
|
56
|
+
100% {
|
|
57
|
+
transform: rotate(360deg);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.labelWrapper {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.label {
|
|
67
|
+
flex-grow: 1;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
text-overflow: ellipsis;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
padding-right: calc(var(--space-unit) * 2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.chevron {
|
|
75
|
+
width: 12px;
|
|
76
|
+
height: 12px;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
flex-shrink: 0;
|
|
81
|
+
margin-left: calc(var(--space-unit) * 2);
|
|
82
|
+
|
|
83
|
+
svg {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: auto;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[dir="rtl"] {
|
|
91
|
+
.dropdown {
|
|
92
|
+
.chevron {
|
|
93
|
+
margin-left: 0px;
|
|
94
|
+
margin-right: calc(var(--space-unit) * 2);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.dropdownSelector {
|
|
100
|
+
width: 100%;
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
position: absolute;
|
|
104
|
+
padding: calc(var(--space-unit) * 2) 0;
|
|
105
|
+
border-radius: 4px;
|
|
106
|
+
background-color: var(--color-white);
|
|
107
|
+
box-shadow: var(--drop-shadow-default);
|
|
108
|
+
margin-top: var(--space-unit);
|
|
109
|
+
z-index: 10;
|
|
110
|
+
overflow: auto;
|
|
111
|
+
max-height: 108px;
|
|
112
|
+
//min-width: 130px;
|
|
113
|
+
|
|
114
|
+
&::-webkit-scrollbar {
|
|
115
|
+
width: 4px;
|
|
116
|
+
height: 4px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&::-webkit-scrollbar-track {
|
|
120
|
+
background: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&::-webkit-scrollbar-thumb {
|
|
124
|
+
border-radius: 2px;
|
|
125
|
+
background: rgba(0, 0, 0, 0.1);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
129
|
+
background: rgba(0, 0, 0, 0.15);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.dropdownItem {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
padding: calc(var(--space-unit) * 1.5);
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
font-size: 11px;
|
|
140
|
+
line-height: var(--line-height-body-sm);
|
|
141
|
+
font-weight: var(--font-weight-body-sm);
|
|
142
|
+
|
|
143
|
+
&.active,
|
|
144
|
+
&:hover {
|
|
145
|
+
background-color: var(--color-gray-50);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.circle {
|
|
150
|
+
width: 12px;
|
|
151
|
+
height: 12px;
|
|
152
|
+
border-radius: 100%;
|
|
153
|
+
flex-shrink: 0;
|
|
154
|
+
margin-right: 6px;
|
|
155
|
+
|
|
156
|
+
&.dropdowncircleItem{
|
|
157
|
+
width: 10px;
|
|
158
|
+
height: 10px;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&Draft {
|
|
162
|
+
background: var(--color-draft);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&Custom {
|
|
166
|
+
background: var(--color-custom);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&Pending {
|
|
170
|
+
background: var(--color-pending);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&InProgress {
|
|
174
|
+
background: var(--color-inprogress);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&Complete {
|
|
178
|
+
background: var(--color-success);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
[dir="rtl"] {
|
|
183
|
+
.circle {
|
|
184
|
+
margin-left: 6px;
|
|
185
|
+
margin-right: 0px;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.divider {
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: stretch;
|
|
192
|
+
height: 100%;
|
|
193
|
+
width: 1px;
|
|
194
|
+
background: var(--color-gray-300);
|
|
195
|
+
}
|
package/src/Components/Form/DropdownField/CountryDropdownField/CountryDropdownField.stories.tsx
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import CountryDropdownField from "./CountryDropdownField";
|
|
4
|
+
|
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Form / CountryDropdownField',
|
|
8
|
+
component: CountryDropdownField,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
} satisfies Meta<typeof CountryDropdownField>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof CountryDropdownField>;
|
|
17
|
+
|
|
18
|
+
// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
|
|
19
|
+
|
|
20
|
+
const CountryDropdownFieldTemplate: Story = {
|
|
21
|
+
render: () => {
|
|
22
|
+
return (
|
|
23
|
+
<CountryDropdownField
|
|
24
|
+
placeholder={''}
|
|
25
|
+
onChange={(_e :any, value)=>{
|
|
26
|
+
console.log(value)
|
|
27
|
+
}}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Example = {
|
|
34
|
+
...CountryDropdownFieldTemplate,
|
|
35
|
+
};
|
|
36
|
+
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import cx from "classnames";
|
|
2
|
+
import styles from "../dropdown.module.scss";
|
|
3
|
+
import { MouseEvent, useEffect, useRef, useState } from "react";
|
|
4
|
+
import CaretDown from "../../../Icons/Arrows/CaretDown/CaretDown.tsx";
|
|
5
|
+
import CaretUp from "../../../Icons/Arrows/CaretUp/CaretUp.tsx";
|
|
6
|
+
import DropdownFieldSelector from "../DropdownFieldSelector.tsx";
|
|
7
|
+
import DropdownFieldItem from "../DropdownFieldItem.tsx";
|
|
8
|
+
import LoadingInput from "../../LoadingInput/LoadingInput.tsx";
|
|
9
|
+
import CountryDropdownFieldProps from "./CountryDropdownFieldProps.tsx";
|
|
10
|
+
|
|
11
|
+
const CountryDropdownField = (props: CountryDropdownFieldProps) => {
|
|
12
|
+
const {
|
|
13
|
+
name,
|
|
14
|
+
id,
|
|
15
|
+
value,
|
|
16
|
+
placeholder,
|
|
17
|
+
extraClass,
|
|
18
|
+
disabled = false,
|
|
19
|
+
readonly = false,
|
|
20
|
+
error,
|
|
21
|
+
ariaLabel,
|
|
22
|
+
required,
|
|
23
|
+
emptyString,
|
|
24
|
+
commentInDropdown,
|
|
25
|
+
loading,
|
|
26
|
+
onChange,
|
|
27
|
+
allows,
|
|
28
|
+
denys
|
|
29
|
+
} = props;
|
|
30
|
+
|
|
31
|
+
const [opened, setOpened] = useState(false);
|
|
32
|
+
const [selected, setSelected] = useState<string | number | undefined | null | boolean>();
|
|
33
|
+
const [label, setLabel] = useState("");
|
|
34
|
+
const [dropdownStyles, setDropdownStyles] = useState<React.CSSProperties>({});
|
|
35
|
+
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
36
|
+
const dropdownSelectorRef = useRef<HTMLDivElement>(null);
|
|
37
|
+
const controlRef = useRef<HTMLDivElement>(null);
|
|
38
|
+
|
|
39
|
+
const [allowCountries, setAllowCountries] = useState<Record<string, string>>({});
|
|
40
|
+
const [denyCountries, setDenyCountries] = useState<Record<string, string>>({});
|
|
41
|
+
|
|
42
|
+
const countryCodes: any = {
|
|
43
|
+
AF: "Afghanistan",
|
|
44
|
+
AL: "Albania",
|
|
45
|
+
DZ: "Algeria",
|
|
46
|
+
AD: "Andorra",
|
|
47
|
+
AO: "Angola",
|
|
48
|
+
AG: "Antigua and Barbuda",
|
|
49
|
+
AR: "Argentina",
|
|
50
|
+
AM: "Armenia",
|
|
51
|
+
AU: "Australia",
|
|
52
|
+
AT: "Austria",
|
|
53
|
+
AZ: "Azerbaijan",
|
|
54
|
+
BS: "Bahamas",
|
|
55
|
+
BH: "Bahrain",
|
|
56
|
+
BD: "Bangladesh",
|
|
57
|
+
BB: "Barbados",
|
|
58
|
+
BY: "Belarus",
|
|
59
|
+
BE: "Belgium",
|
|
60
|
+
BZ: "Belize",
|
|
61
|
+
BJ: "Benin",
|
|
62
|
+
BT: "Bhutan",
|
|
63
|
+
BO: "Bolivia",
|
|
64
|
+
BA: "Bosnia and Herzegovina",
|
|
65
|
+
BW: "Botswana",
|
|
66
|
+
BR: "Brazil",
|
|
67
|
+
BN: "Brunei",
|
|
68
|
+
BG: "Bulgaria",
|
|
69
|
+
BF: "Burkina Faso",
|
|
70
|
+
BI: "Burundi",
|
|
71
|
+
KH: "Cambodia",
|
|
72
|
+
CM: "Cameroon",
|
|
73
|
+
CA: "Canada",
|
|
74
|
+
CV: "Cape Verde",
|
|
75
|
+
CF: "Central African Republic",
|
|
76
|
+
TD: "Chad",
|
|
77
|
+
CL: "Chile",
|
|
78
|
+
CN: "China",
|
|
79
|
+
CO: "Colombia",
|
|
80
|
+
KM: "Comoros",
|
|
81
|
+
CG: "Congo (Brazzaville)",
|
|
82
|
+
CD: "Congo (Kinshasa)",
|
|
83
|
+
CR: "Costa Rica",
|
|
84
|
+
CI: "Cote d'Ivoire",
|
|
85
|
+
HR: "Croatia",
|
|
86
|
+
CU: "Cuba",
|
|
87
|
+
CY: "Cyprus",
|
|
88
|
+
CZ: "Czech Republic",
|
|
89
|
+
DK: "Denmark",
|
|
90
|
+
DJ: "Djibouti",
|
|
91
|
+
DM: "Dominica",
|
|
92
|
+
DO: "Dominican Republic",
|
|
93
|
+
TL: "East Timor",
|
|
94
|
+
EC: "Ecuador",
|
|
95
|
+
EG: "Egypt",
|
|
96
|
+
SV: "El Salvador",
|
|
97
|
+
GQ: "Equatorial Guinea",
|
|
98
|
+
ER: "Eritrea",
|
|
99
|
+
EE: "Estonia",
|
|
100
|
+
ET: "Ethiopia",
|
|
101
|
+
FJ: "Fiji",
|
|
102
|
+
FI: "Finland",
|
|
103
|
+
FR: "France",
|
|
104
|
+
GA: "Gabon",
|
|
105
|
+
GM: "Gambia, The",
|
|
106
|
+
GE: "Georgia",
|
|
107
|
+
DE: "Germany",
|
|
108
|
+
GH: "Ghana",
|
|
109
|
+
GR: "Greece",
|
|
110
|
+
GD: "Grenada",
|
|
111
|
+
GT: "Guatemala",
|
|
112
|
+
GN: "Guinea",
|
|
113
|
+
GW: "Guinea-Bissau",
|
|
114
|
+
GY: "Guyana",
|
|
115
|
+
HT: "Haiti",
|
|
116
|
+
HN: "Honduras",
|
|
117
|
+
HU: "Hungary",
|
|
118
|
+
IS: "Iceland",
|
|
119
|
+
IN: "India",
|
|
120
|
+
ID: "Indonesia",
|
|
121
|
+
IR: "Iran",
|
|
122
|
+
IQ: "Iraq",
|
|
123
|
+
IE: "Ireland",
|
|
124
|
+
IL: "Israel",
|
|
125
|
+
IT: "Italy",
|
|
126
|
+
JM: "Jamaica",
|
|
127
|
+
JP: "Japan",
|
|
128
|
+
JO: "Jordan",
|
|
129
|
+
KZ: "Kazakhstan",
|
|
130
|
+
KE: "Kenya",
|
|
131
|
+
KI: "Kiribati",
|
|
132
|
+
KP: "Korea, North",
|
|
133
|
+
KR: "Korea, South",
|
|
134
|
+
KW: "Kuwait",
|
|
135
|
+
KG: "Kyrgyzstan",
|
|
136
|
+
LA: "Laos",
|
|
137
|
+
LV: "Latvia",
|
|
138
|
+
LB: "Lebanon",
|
|
139
|
+
LS: "Lesotho",
|
|
140
|
+
LR: "Liberia",
|
|
141
|
+
LY: "Libya",
|
|
142
|
+
LI: "Liechtenstein",
|
|
143
|
+
LT: "Lithuania",
|
|
144
|
+
LU: "Luxembourg",
|
|
145
|
+
MK: "Macedonia",
|
|
146
|
+
MG: "Madagascar",
|
|
147
|
+
MW: "Malawi",
|
|
148
|
+
MY: "Malaysia",
|
|
149
|
+
MV: "Maldives",
|
|
150
|
+
ML: "Mali",
|
|
151
|
+
MT: "Malta",
|
|
152
|
+
MH: "Marshall Islands",
|
|
153
|
+
MR: "Mauritania",
|
|
154
|
+
MU: "Mauritius",
|
|
155
|
+
MX: "Mexico",
|
|
156
|
+
FM: "Micronesia",
|
|
157
|
+
MD: "Moldova",
|
|
158
|
+
MC: "Monaco",
|
|
159
|
+
MN: "Mongolia",
|
|
160
|
+
ME: "Montenegro",
|
|
161
|
+
MA: "Morocco",
|
|
162
|
+
MZ: "Mozambique",
|
|
163
|
+
MM: "Myanmar (Burma)",
|
|
164
|
+
NA: "Namibia",
|
|
165
|
+
NR: "Nauru",
|
|
166
|
+
NP: "Nepal",
|
|
167
|
+
NL: "Netherlands",
|
|
168
|
+
NZ: "New Zealand",
|
|
169
|
+
NI: "Nicaragua",
|
|
170
|
+
NE: "Niger",
|
|
171
|
+
NG: "Nigeria",
|
|
172
|
+
NO: "Norway",
|
|
173
|
+
OM: "Oman",
|
|
174
|
+
PK: "Pakistan",
|
|
175
|
+
PW: "Palau",
|
|
176
|
+
PA: "Panama",
|
|
177
|
+
PG: "Papua New Guinea",
|
|
178
|
+
PY: "Paraguay",
|
|
179
|
+
PE: "Peru",
|
|
180
|
+
PH: "Philippines",
|
|
181
|
+
PL: "Poland",
|
|
182
|
+
PT: "Portugal",
|
|
183
|
+
QA: "Qatar",
|
|
184
|
+
RO: "Romania",
|
|
185
|
+
RU: "Russia",
|
|
186
|
+
RW: "Rwanda",
|
|
187
|
+
KN: "Saint Kitts and Nevis",
|
|
188
|
+
LC: "Saint Lucia",
|
|
189
|
+
VC: "Saint Vincent and the Grenadines",
|
|
190
|
+
WS: "Samoa",
|
|
191
|
+
SM: "San Marino",
|
|
192
|
+
ST: "Sao Tome and Principe",
|
|
193
|
+
SA: "Saudi Arabia",
|
|
194
|
+
SN: "Senegal",
|
|
195
|
+
RS: "Serbia",
|
|
196
|
+
SC: "Seychelles",
|
|
197
|
+
SL: "Sierra Leone",
|
|
198
|
+
SG: "Singapore",
|
|
199
|
+
SK: "Slovakia",
|
|
200
|
+
SI: "Slovenia",
|
|
201
|
+
SB: "Solomon Islands",
|
|
202
|
+
SO: "Somalia",
|
|
203
|
+
ZA: "South Africa",
|
|
204
|
+
SS: "South Sudan",
|
|
205
|
+
ES: "Spain",
|
|
206
|
+
LK: "Sri Lanka",
|
|
207
|
+
SD: "Sudan",
|
|
208
|
+
SR: "Suriname",
|
|
209
|
+
SZ: "Swaziland",
|
|
210
|
+
SE: "Sweden",
|
|
211
|
+
CH: "Switzerland",
|
|
212
|
+
SY: "Syria",
|
|
213
|
+
TW: "Taiwan",
|
|
214
|
+
TJ: "Tajikistan",
|
|
215
|
+
TZ: "Tanzania",
|
|
216
|
+
TH: "Thailand",
|
|
217
|
+
TG: "Togo",
|
|
218
|
+
TO: "Tonga",
|
|
219
|
+
TT: "Trinidad and Tobago",
|
|
220
|
+
TN: "Tunisia",
|
|
221
|
+
TR: "Turkey",
|
|
222
|
+
TM: "Turkmenistan",
|
|
223
|
+
TV: "Tuvalu",
|
|
224
|
+
UG: "Uganda",
|
|
225
|
+
UA: "Ukraine",
|
|
226
|
+
AE: "United Arab Emirates",
|
|
227
|
+
GB: "United Kingdom",
|
|
228
|
+
US: "United States",
|
|
229
|
+
UY: "Uruguay",
|
|
230
|
+
UZ: "Uzbekistan",
|
|
231
|
+
VU: "Vanuatu",
|
|
232
|
+
VA: "Vatican City",
|
|
233
|
+
VE: "Venezuela",
|
|
234
|
+
VN: "Vietnam",
|
|
235
|
+
YE: "Yemen",
|
|
236
|
+
ZM: "Zambia",
|
|
237
|
+
ZW: "Zimbabwe"
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const manageAllowCountries = (allows: string[]) => {
|
|
241
|
+
const upperCaseAllows = allows.map((code) => code.toUpperCase());
|
|
242
|
+
const filteredCountryCodes = Object.fromEntries(
|
|
243
|
+
Object.entries(countryCodes).filter(([code]) =>
|
|
244
|
+
upperCaseAllows.includes(code)
|
|
245
|
+
)
|
|
246
|
+
);
|
|
247
|
+
// @ts-ignore
|
|
248
|
+
setAllowCountries(filteredCountryCodes);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const manageDenyCountries = (denys: string[]) => {
|
|
252
|
+
const upperCaseDenys = denys.map((code) => code.toUpperCase());
|
|
253
|
+
const filteredCountryCodes = Object.fromEntries(
|
|
254
|
+
Object.entries(countryCodes).filter(([code]) =>
|
|
255
|
+
!upperCaseDenys.includes(code)
|
|
256
|
+
)
|
|
257
|
+
);
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
setDenyCountries(filteredCountryCodes);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
useEffect(() => {
|
|
263
|
+
if (allows) {
|
|
264
|
+
manageAllowCountries(allows);
|
|
265
|
+
} else if (denys) {
|
|
266
|
+
manageDenyCountries(denys);
|
|
267
|
+
}
|
|
268
|
+
}, [allows, denys]);
|
|
269
|
+
|
|
270
|
+
useEffect(() => {
|
|
271
|
+
setSelected(value);
|
|
272
|
+
}, [value]);
|
|
273
|
+
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
if (selected) {
|
|
276
|
+
setLabel(countryCodes[selected as keyof typeof countryCodes] || "");
|
|
277
|
+
} else {
|
|
278
|
+
setLabel(placeholder || "");
|
|
279
|
+
}
|
|
280
|
+
}, [selected, placeholder]);
|
|
281
|
+
|
|
282
|
+
const updateDropdownPosition = () => {
|
|
283
|
+
if (opened && controlRef.current && dropdownSelectorRef.current) {
|
|
284
|
+
const rect = controlRef.current.getBoundingClientRect();
|
|
285
|
+
const dropdownHeight = dropdownSelectorRef.current.offsetHeight;
|
|
286
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
287
|
+
|
|
288
|
+
const dropdownTop = spaceBelow < dropdownHeight ? rect.top - dropdownHeight : rect.bottom;
|
|
289
|
+
|
|
290
|
+
setDropdownStyles({
|
|
291
|
+
top: `${dropdownTop}px`,
|
|
292
|
+
left: `${rect.left}px`,
|
|
293
|
+
width: `${rect.width}px`,
|
|
294
|
+
position: "fixed",
|
|
295
|
+
zIndex: 100
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
useEffect(() => {
|
|
301
|
+
if (!controlRef.current) return;
|
|
302
|
+
|
|
303
|
+
let initialPosition = controlRef.current.getBoundingClientRect();
|
|
304
|
+
|
|
305
|
+
const handleResizeOrScroll = () => {
|
|
306
|
+
updateDropdownPosition();
|
|
307
|
+
|
|
308
|
+
if (!controlRef.current) return;
|
|
309
|
+
|
|
310
|
+
const currentPosition = controlRef.current.getBoundingClientRect();
|
|
311
|
+
|
|
312
|
+
if (
|
|
313
|
+
initialPosition.top !== currentPosition.top ||
|
|
314
|
+
initialPosition.left !== currentPosition.left
|
|
315
|
+
) {
|
|
316
|
+
setOpened(false);
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
if (opened) {
|
|
321
|
+
window.addEventListener("resize", handleResizeOrScroll);
|
|
322
|
+
window.addEventListener("scroll", handleResizeOrScroll, true);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return () => {
|
|
326
|
+
window.removeEventListener("resize", handleResizeOrScroll);
|
|
327
|
+
window.removeEventListener("scroll", handleResizeOrScroll, true);
|
|
328
|
+
};
|
|
329
|
+
}, [opened]);
|
|
330
|
+
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
updateDropdownPosition();
|
|
333
|
+
}, [opened]);
|
|
334
|
+
|
|
335
|
+
useEffect(() => {
|
|
336
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
337
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) {
|
|
338
|
+
setOpened(false);
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
// @ts-ignore
|
|
343
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
344
|
+
|
|
345
|
+
return () => {
|
|
346
|
+
// @ts-ignore
|
|
347
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
348
|
+
};
|
|
349
|
+
}, []);
|
|
350
|
+
|
|
351
|
+
const handleOpenClose = () => {
|
|
352
|
+
if (disabled || readonly) return;
|
|
353
|
+
setOpened(!opened);
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
const handleSelect = (e: MouseEvent, value: string | number | undefined | null | boolean) => {
|
|
357
|
+
setSelected(value);
|
|
358
|
+
setOpened(false);
|
|
359
|
+
if (onChange) {
|
|
360
|
+
onChange(e, value);
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
const classNames = [styles.dropdown];
|
|
365
|
+
|
|
366
|
+
if (error) {
|
|
367
|
+
classNames.push(styles.error);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
if (extraClass) {
|
|
371
|
+
classNames.push(extraClass);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if (disabled) {
|
|
375
|
+
classNames.push(styles.disabled);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return (
|
|
379
|
+
<div ref={dropdownRef} className={cx(classNames)}>
|
|
380
|
+
{loading && <LoadingInput />}
|
|
381
|
+
<div ref={controlRef} className={styles.control} onClick={handleOpenClose}>
|
|
382
|
+
{!selected && placeholder && (
|
|
383
|
+
<div className={styles.placeholder} aria-label={ariaLabel}>
|
|
384
|
+
{placeholder}
|
|
385
|
+
</div>
|
|
386
|
+
)}
|
|
387
|
+
{(selected || !placeholder) && (
|
|
388
|
+
<div className={styles.label} aria-label={ariaLabel}>
|
|
389
|
+
{label}
|
|
390
|
+
{!!selected && <div className={styles.reset}></div>}
|
|
391
|
+
</div>
|
|
392
|
+
)}
|
|
393
|
+
<div className={styles.chevron}>
|
|
394
|
+
{!opened && <CaretDown />}
|
|
395
|
+
{!!opened && <CaretUp />}
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
|
|
399
|
+
{opened && !readonly && !disabled && (
|
|
400
|
+
<DropdownFieldSelector ref={dropdownSelectorRef} style={dropdownStyles}>
|
|
401
|
+
{commentInDropdown && <div className={styles.message}>{commentInDropdown}</div>}
|
|
402
|
+
{emptyString && <DropdownFieldItem label={emptyString} value="" handleSelect={handleSelect} />}
|
|
403
|
+
{allows && Object.keys(allowCountries).map((code) => (
|
|
404
|
+
<DropdownFieldItem key={code} label={allowCountries[code]} value={code} handleSelect={handleSelect} />
|
|
405
|
+
))}
|
|
406
|
+
{denys && Object.keys(denyCountries).map((code) => (
|
|
407
|
+
<DropdownFieldItem key={code} label={denyCountries[code]} value={code} handleSelect={handleSelect} />
|
|
408
|
+
))}
|
|
409
|
+
{!allows && !denys && Object.keys(countryCodes)?.map((code: string) => (
|
|
410
|
+
<DropdownFieldItem key={code} label={countryCodes[code]} value={code} handleSelect={handleSelect} />
|
|
411
|
+
))}
|
|
412
|
+
</DropdownFieldSelector>
|
|
413
|
+
)}
|
|
414
|
+
|
|
415
|
+
<input
|
|
416
|
+
name={name}
|
|
417
|
+
value={selected ? selected.toString() : ""}
|
|
418
|
+
id={id} type="hidden"
|
|
419
|
+
required={required}
|
|
420
|
+
disabled={disabled}
|
|
421
|
+
readOnly={readonly} />
|
|
422
|
+
</div>
|
|
423
|
+
);
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export default CountryDropdownField;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FocusEvent, MouseEvent } from "react";
|
|
2
|
+
|
|
3
|
+
interface CountryDropdownFieldProps {
|
|
4
|
+
name?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
extraClass?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
emptyString?: string;
|
|
10
|
+
commentInDropdown?: string;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
disabled?:boolean;
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
autoComplete?: boolean;
|
|
15
|
+
minLength?: number;
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
ariaLabeledby?: string;
|
|
20
|
+
ariaDescribedby?: string;
|
|
21
|
+
onClick?: (e: MouseEvent) => void;
|
|
22
|
+
onChange?: (e: React.MouseEvent, value: string |number|undefined|null|boolean) => void;
|
|
23
|
+
onFocus?: (e: FocusEvent) => void;
|
|
24
|
+
onBlur?: (e: FocusEvent) => void;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
allows?: string[];
|
|
27
|
+
denys?: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default CountryDropdownFieldProps
|