bootstrap-rn 0.4.8 → 0.4.10
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/lib/module/Context.js.map +1 -1
- package/lib/module/Provider.js +4 -16
- package/lib/module/Provider.js.map +1 -1
- package/lib/module/components/Body.js +3 -3
- package/lib/module/components/Body.js.map +1 -1
- package/lib/module/components/Caret.js +4 -4
- package/lib/module/components/Caret.js.map +1 -1
- package/lib/module/components/Heading.js +3 -3
- package/lib/module/components/Heading.js.map +1 -1
- package/lib/module/components/Image.js +3 -3
- package/lib/module/components/Image.js.map +1 -1
- package/lib/module/components/ImageBackground.js +3 -3
- package/lib/module/components/ImageBackground.js.map +1 -1
- package/lib/module/components/Label.js +3 -3
- package/lib/module/components/Label.js.map +1 -1
- package/lib/module/components/Link.js +6 -6
- package/lib/module/components/Link.js.map +1 -1
- package/lib/module/components/Pressable.js +6 -6
- package/lib/module/components/Pressable.js.map +1 -1
- package/lib/module/components/ScrollView.js +3 -3
- package/lib/module/components/ScrollView.js.map +1 -1
- package/lib/module/components/Text.js +3 -3
- package/lib/module/components/Text.js.map +1 -1
- package/lib/module/components/TextInput.js +3 -3
- package/lib/module/components/TextInput.js.map +1 -1
- package/lib/module/components/View.js +3 -3
- package/lib/module/components/View.js.map +1 -1
- package/lib/module/components/alert/Alert.js +5 -5
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/badge/Badge.js +3 -3
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/breadcrumb/Breadcrumb.js +3 -3
- package/lib/module/components/breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/module/components/breadcrumb/BreadcrumbItem.js +3 -3
- package/lib/module/components/breadcrumb/BreadcrumbItem.js.map +1 -1
- package/lib/module/components/button-group/ButtonGroup.js +3 -3
- package/lib/module/components/button-group/ButtonGroup.js.map +1 -1
- package/lib/module/components/button-group/ButtonToolbar.js +3 -3
- package/lib/module/components/button-group/ButtonToolbar.js.map +1 -1
- package/lib/module/components/buttons/Button.js +3 -3
- package/lib/module/components/buttons/Button.js.map +1 -1
- package/lib/module/components/card/Card.js +3 -3
- package/lib/module/components/card/Card.js.map +1 -1
- package/lib/module/components/card/CardBody.js +3 -3
- package/lib/module/components/card/CardBody.js.map +1 -1
- package/lib/module/components/card/CardFooter.js +3 -3
- package/lib/module/components/card/CardFooter.js.map +1 -1
- package/lib/module/components/card/CardHeader.js +3 -3
- package/lib/module/components/card/CardHeader.js.map +1 -1
- package/lib/module/components/close/CloseButton.js +3 -3
- package/lib/module/components/close/CloseButton.js.map +1 -1
- package/lib/module/components/collapse/Collapse.js +3 -3
- package/lib/module/components/collapse/Collapse.js.map +1 -1
- package/lib/module/components/containers/Container.js +3 -3
- package/lib/module/components/containers/Container.js.map +1 -1
- package/lib/module/components/dropdown/Dropdown.js +3 -3
- package/lib/module/components/dropdown/Dropdown.js.map +1 -1
- package/lib/module/components/dropdown/DropdownDivider.js +3 -3
- package/lib/module/components/dropdown/DropdownDivider.js.map +1 -1
- package/lib/module/components/dropdown/DropdownHeader.js +3 -3
- package/lib/module/components/dropdown/DropdownHeader.js.map +1 -1
- package/lib/module/components/dropdown/DropdownItemText.js +3 -3
- package/lib/module/components/dropdown/DropdownItemText.js.map +1 -1
- package/lib/module/components/dropdown/DropdownMenu.js +3 -3
- package/lib/module/components/dropdown/DropdownMenu.js.map +1 -1
- package/lib/module/components/dropdown/useToggleDropdown.js.map +1 -1
- package/lib/module/components/forms/Checkbox.js +3 -3
- package/lib/module/components/forms/Checkbox.js.map +1 -1
- package/lib/module/components/forms/Feedback.js +3 -3
- package/lib/module/components/forms/Feedback.js.map +1 -1
- package/lib/module/components/forms/FormCheck.js +3 -3
- package/lib/module/components/forms/FormCheck.js.map +1 -1
- package/lib/module/components/forms/FormCheckInput.js +5 -5
- package/lib/module/components/forms/FormCheckInput.js.map +1 -1
- package/lib/module/components/forms/FormCheckLabel.js +3 -3
- package/lib/module/components/forms/FormCheckLabel.js.map +1 -1
- package/lib/module/components/forms/FormLabel.js +3 -3
- package/lib/module/components/forms/FormLabel.js.map +1 -1
- package/lib/module/components/forms/FormText.js +3 -3
- package/lib/module/components/forms/FormText.js.map +1 -1
- package/lib/module/components/forms/Input.js +5 -5
- package/lib/module/components/forms/Input.js.map +1 -1
- package/lib/module/components/forms/Picker.js +5 -5
- package/lib/module/components/forms/Picker.js.map +1 -1
- package/lib/module/components/forms/PickerItem.js +3 -3
- package/lib/module/components/forms/PickerItem.js.map +1 -1
- package/lib/module/components/forms/Radio.js +3 -3
- package/lib/module/components/forms/Radio.js.map +1 -1
- package/lib/module/components/forms/RadioGroup.js +3 -3
- package/lib/module/components/forms/RadioGroup.js.map +1 -1
- package/lib/module/components/forms/Switch.js +3 -3
- package/lib/module/components/forms/Switch.js.map +1 -1
- package/lib/module/components/forms/internals/FormCheckInputNative.js +4 -4
- package/lib/module/components/forms/internals/FormCheckInputNative.js.map +1 -1
- package/lib/module/components/forms/internals/FormCheckInputWeb.js +7 -6
- package/lib/module/components/forms/internals/FormCheckInputWeb.js.map +1 -1
- package/lib/module/components/forms/internals/PickerNative.js +3 -2
- package/lib/module/components/forms/internals/PickerNative.js.map +1 -1
- package/lib/module/components/forms/internals/PickerNativeItem.js +3 -3
- package/lib/module/components/forms/internals/PickerNativeItem.js.map +1 -1
- package/lib/module/components/forms/internals/PickerWeb.js +4 -3
- package/lib/module/components/forms/internals/PickerWeb.js.map +1 -1
- package/lib/module/components/forms/internals/PickerWebItem.js +3 -3
- package/lib/module/components/forms/internals/PickerWebItem.js.map +1 -1
- package/lib/module/components/grid/Col.js +3 -3
- package/lib/module/components/grid/Col.js.map +1 -1
- package/lib/module/components/grid/Row.js +3 -3
- package/lib/module/components/grid/Row.js.map +1 -1
- package/lib/module/components/helpers/Dialog.web.js +2 -2
- package/lib/module/components/helpers/Dialog.web.js.map +1 -1
- package/lib/module/components/list-group/ListGroup.js +3 -3
- package/lib/module/components/list-group/ListGroup.js.map +1 -1
- package/lib/module/components/list-group/ListGroupItem.js +3 -3
- package/lib/module/components/list-group/ListGroupItem.js.map +1 -1
- package/lib/module/components/list-group/ListGroupItemAction.js +5 -5
- package/lib/module/components/list-group/ListGroupItemAction.js.map +1 -1
- package/lib/module/components/modal/Modal.js +3 -4
- package/lib/module/components/modal/Modal.js.map +1 -1
- package/lib/module/components/modal/ModalBody.js +3 -3
- package/lib/module/components/modal/ModalBody.js.map +1 -1
- package/lib/module/components/modal/ModalFooter.js +3 -3
- package/lib/module/components/modal/ModalFooter.js.map +1 -1
- package/lib/module/components/modal/ModalHeader.js +3 -3
- package/lib/module/components/modal/ModalHeader.js.map +1 -1
- package/lib/module/components/modal/ModalTitle.js +3 -3
- package/lib/module/components/modal/ModalTitle.js.map +1 -1
- package/lib/module/components/nav/Nav.js +3 -3
- package/lib/module/components/nav/Nav.js.map +1 -1
- package/lib/module/components/nav/NavLink.js +5 -5
- package/lib/module/components/nav/NavLink.js.map +1 -1
- package/lib/module/components/nav/TabContent.js +3 -3
- package/lib/module/components/nav/TabContent.js.map +1 -1
- package/lib/module/components/nav/TabPane.js +3 -3
- package/lib/module/components/nav/TabPane.js.map +1 -1
- package/lib/module/components/navbar/Navbar.js +3 -3
- package/lib/module/components/navbar/Navbar.js.map +1 -1
- package/lib/module/components/navbar/NavbarBrand.js +3 -3
- package/lib/module/components/navbar/NavbarBrand.js.map +1 -1
- package/lib/module/components/navbar/NavbarCollapse.js +3 -3
- package/lib/module/components/navbar/NavbarCollapse.js.map +1 -1
- package/lib/module/components/navbar/NavbarText.js +3 -3
- package/lib/module/components/navbar/NavbarText.js.map +1 -1
- package/lib/module/components/navbar/NavbarToggler.js +3 -3
- package/lib/module/components/navbar/NavbarToggler.js.map +1 -1
- package/lib/module/components/offcanvas/Offcanvas.js +3 -3
- package/lib/module/components/offcanvas/Offcanvas.js.map +1 -1
- package/lib/module/components/offcanvas/OffcanvasBody.js +3 -3
- package/lib/module/components/offcanvas/OffcanvasBody.js.map +1 -1
- package/lib/module/components/offcanvas/OffcanvasHeader.js +3 -3
- package/lib/module/components/offcanvas/OffcanvasHeader.js.map +1 -1
- package/lib/module/components/offcanvas/OffcanvasTitle.js +3 -3
- package/lib/module/components/offcanvas/OffcanvasTitle.js.map +1 -1
- package/lib/module/components/pagination/Pagination.js +3 -3
- package/lib/module/components/pagination/Pagination.js.map +1 -1
- package/lib/module/components/pagination/PaginationItem.js +3 -3
- package/lib/module/components/pagination/PaginationItem.js.map +1 -1
- package/lib/module/components/placeholders/Placeholders.js +6 -6
- package/lib/module/components/placeholders/Placeholders.js.map +1 -1
- package/lib/module/components/popover/Popover.js +3 -3
- package/lib/module/components/popover/Popover.js.map +1 -1
- package/lib/module/components/popover/PopoverArrow.js +3 -3
- package/lib/module/components/popover/PopoverArrow.js.map +1 -1
- package/lib/module/components/popover/PopoverBody.js +3 -3
- package/lib/module/components/popover/PopoverBody.js.map +1 -1
- package/lib/module/components/popover/PopoverHeader.js +3 -3
- package/lib/module/components/popover/PopoverHeader.js.map +1 -1
- package/lib/module/components/popover/injectPopover.js +3 -2
- package/lib/module/components/popover/injectPopover.js.map +1 -1
- package/lib/module/components/progress/Progress.js +3 -3
- package/lib/module/components/progress/Progress.js.map +1 -1
- package/lib/module/components/progress/ProgressBar.js +3 -3
- package/lib/module/components/progress/ProgressBar.js.map +1 -1
- package/lib/module/components/spinners/Spinner.js +3 -3
- package/lib/module/components/spinners/Spinner.js.map +1 -1
- package/lib/module/components/toasts/Toast.js +3 -3
- package/lib/module/components/toasts/Toast.js.map +1 -1
- package/lib/module/components/toasts/ToastBody.js +3 -3
- package/lib/module/components/toasts/ToastBody.js.map +1 -1
- package/lib/module/components/toasts/ToastContainer.js +3 -3
- package/lib/module/components/toasts/ToastContainer.js.map +1 -1
- package/lib/module/components/toasts/ToastHeader.js +3 -3
- package/lib/module/components/toasts/ToastHeader.js.map +1 -1
- package/lib/module/components/tooltip/Tooltip.js +3 -3
- package/lib/module/components/tooltip/Tooltip.js.map +1 -1
- package/lib/module/components/tooltip/TooltipArrow.js +3 -3
- package/lib/module/components/tooltip/TooltipArrow.js.map +1 -1
- package/lib/module/components/tooltip/TooltipInner.js +3 -3
- package/lib/module/components/tooltip/TooltipInner.js.map +1 -1
- package/lib/module/components/tooltip/injectTooltip.js +3 -2
- package/lib/module/components/tooltip/injectTooltip.js.map +1 -1
- package/lib/module/components/type/Blockquote.js +3 -3
- package/lib/module/components/type/Blockquote.js.map +1 -1
- package/lib/module/components/type/Code.js +3 -3
- package/lib/module/components/type/Code.js.map +1 -1
- package/lib/module/components/type/DisplayHeading.js +3 -2
- package/lib/module/components/type/DisplayHeading.js.map +1 -1
- package/lib/module/components/type/Paragraph.js +3 -3
- package/lib/module/components/type/Paragraph.js.map +1 -1
- package/lib/module/hooks/useAction.js +12 -5
- package/lib/module/hooks/useAction.js.map +1 -1
- package/lib/module/hooks/useFocusRing.js +1 -1
- package/lib/module/hooks/useModifier.js +7 -4
- package/lib/module/hooks/useModifier.js.map +1 -1
- package/lib/module/hooks/useScrollbarEffects.js +8 -5
- package/lib/module/hooks/useScrollbarEffects.js.map +1 -1
- package/lib/module/hooks/useScrollbarEffects.web.js +21 -19
- package/lib/module/hooks/useScrollbarEffects.web.js.map +1 -1
- package/lib/module/hooks/useScrollbarOffset.js +10 -0
- package/lib/module/hooks/useScrollbarOffset.js.map +1 -0
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/Context.d.ts +4 -9
- package/lib/typescript/Context.d.ts.map +1 -1
- package/lib/typescript/Provider.d.ts.map +1 -1
- package/lib/typescript/components/Body.d.ts +2 -2
- package/lib/typescript/components/Body.d.ts.map +1 -1
- package/lib/typescript/components/Caret.d.ts +2 -2
- package/lib/typescript/components/Caret.d.ts.map +1 -1
- package/lib/typescript/components/Heading.d.ts +2 -2
- package/lib/typescript/components/Heading.d.ts.map +1 -1
- package/lib/typescript/components/Image.d.ts +1 -1
- package/lib/typescript/components/Image.d.ts.map +1 -1
- package/lib/typescript/components/ImageBackground.d.ts +1 -1
- package/lib/typescript/components/ImageBackground.d.ts.map +1 -1
- package/lib/typescript/components/Label.d.ts +2 -2
- package/lib/typescript/components/Label.d.ts.map +1 -1
- package/lib/typescript/components/Link.d.ts +2 -2
- package/lib/typescript/components/Link.d.ts.map +1 -1
- package/lib/typescript/components/Pressable.d.ts +1 -1
- package/lib/typescript/components/Pressable.d.ts.map +1 -1
- package/lib/typescript/components/ScrollView.d.ts +1 -1
- package/lib/typescript/components/ScrollView.d.ts.map +1 -1
- package/lib/typescript/components/Text.d.ts +1 -1
- package/lib/typescript/components/Text.d.ts.map +1 -1
- package/lib/typescript/components/TextInput.d.ts +1 -1
- package/lib/typescript/components/TextInput.d.ts.map +1 -1
- package/lib/typescript/components/View.d.ts +1 -1
- package/lib/typescript/components/View.d.ts.map +1 -1
- package/lib/typescript/components/alert/Alert.d.ts +2 -2
- package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
- package/lib/typescript/components/badge/Badge.d.ts +2 -2
- package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
- package/lib/typescript/components/breadcrumb/Breadcrumb.d.ts +5 -3
- package/lib/typescript/components/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/lib/typescript/components/breadcrumb/BreadcrumbItem.d.ts +2 -2
- package/lib/typescript/components/breadcrumb/BreadcrumbItem.d.ts.map +1 -1
- package/lib/typescript/components/button-group/ButtonGroup.d.ts +2 -2
- package/lib/typescript/components/button-group/ButtonGroup.d.ts.map +1 -1
- package/lib/typescript/components/button-group/ButtonToolbar.d.ts +2 -2
- package/lib/typescript/components/button-group/ButtonToolbar.d.ts.map +1 -1
- package/lib/typescript/components/buttons/Button.d.ts +3 -2
- package/lib/typescript/components/buttons/Button.d.ts.map +1 -1
- package/lib/typescript/components/card/Card.d.ts +9 -5
- package/lib/typescript/components/card/Card.d.ts.map +1 -1
- package/lib/typescript/components/card/CardBody.d.ts +2 -2
- package/lib/typescript/components/card/CardBody.d.ts.map +1 -1
- package/lib/typescript/components/card/CardFooter.d.ts +2 -2
- package/lib/typescript/components/card/CardFooter.d.ts.map +1 -1
- package/lib/typescript/components/card/CardHeader.d.ts +2 -2
- package/lib/typescript/components/card/CardHeader.d.ts.map +1 -1
- package/lib/typescript/components/close/CloseButton.d.ts +2 -2
- package/lib/typescript/components/close/CloseButton.d.ts.map +1 -1
- package/lib/typescript/components/collapse/Collapse.d.ts +3 -2
- package/lib/typescript/components/collapse/Collapse.d.ts.map +1 -1
- package/lib/typescript/components/containers/Container.d.ts +2 -2
- package/lib/typescript/components/containers/Container.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/Dropdown.d.ts +11 -6
- package/lib/typescript/components/dropdown/Dropdown.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/DropdownDivider.d.ts +2 -2
- package/lib/typescript/components/dropdown/DropdownDivider.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/DropdownHeader.d.ts +2 -2
- package/lib/typescript/components/dropdown/DropdownHeader.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/DropdownItemText.d.ts +2 -2
- package/lib/typescript/components/dropdown/DropdownItemText.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/DropdownMenu.d.ts +2 -2
- package/lib/typescript/components/dropdown/DropdownMenu.d.ts.map +1 -1
- package/lib/typescript/components/dropdown/useToggleDropdown.d.ts +4 -3
- package/lib/typescript/components/dropdown/useToggleDropdown.d.ts.map +1 -1
- package/lib/typescript/components/forms/Checkbox.d.ts +2 -1
- package/lib/typescript/components/forms/Checkbox.d.ts.map +1 -1
- package/lib/typescript/components/forms/Feedback.d.ts +2 -2
- package/lib/typescript/components/forms/Feedback.d.ts.map +1 -1
- package/lib/typescript/components/forms/FormCheck.d.ts +5 -3
- package/lib/typescript/components/forms/FormCheck.d.ts.map +1 -1
- package/lib/typescript/components/forms/FormCheckInput.d.ts +2 -1
- package/lib/typescript/components/forms/FormCheckInput.d.ts.map +1 -1
- package/lib/typescript/components/forms/FormCheckLabel.d.ts +2 -1
- package/lib/typescript/components/forms/FormCheckLabel.d.ts.map +1 -1
- package/lib/typescript/components/forms/FormLabel.d.ts +2 -1
- package/lib/typescript/components/forms/FormLabel.d.ts.map +1 -1
- package/lib/typescript/components/forms/FormText.d.ts +2 -2
- package/lib/typescript/components/forms/FormText.d.ts.map +1 -1
- package/lib/typescript/components/forms/Input.d.ts +2 -2
- package/lib/typescript/components/forms/Input.d.ts.map +1 -1
- package/lib/typescript/components/forms/Picker.d.ts +5 -4
- package/lib/typescript/components/forms/Picker.d.ts.map +1 -1
- package/lib/typescript/components/forms/PickerItem.d.ts +2 -2
- package/lib/typescript/components/forms/PickerItem.d.ts.map +1 -1
- package/lib/typescript/components/forms/Radio.d.ts +5 -2
- package/lib/typescript/components/forms/Radio.d.ts.map +1 -1
- package/lib/typescript/components/forms/RadioGroup.d.ts +2 -2
- package/lib/typescript/components/forms/RadioGroup.d.ts.map +1 -1
- package/lib/typescript/components/forms/Switch.d.ts +2 -1
- package/lib/typescript/components/forms/Switch.d.ts.map +1 -1
- package/lib/typescript/components/forms/internals/FormCheckInputNative.d.ts +2 -1
- package/lib/typescript/components/forms/internals/FormCheckInputNative.d.ts.map +1 -1
- package/lib/typescript/components/forms/internals/FormCheckInputWeb.d.ts +2 -1
- package/lib/typescript/components/forms/internals/FormCheckInputWeb.d.ts.map +1 -1
- package/lib/typescript/components/forms/internals/PickerNative.d.ts +2 -1
- package/lib/typescript/components/forms/internals/PickerNative.d.ts.map +1 -1
- package/lib/typescript/components/forms/internals/PickerNativeItem.d.ts +2 -2
- package/lib/typescript/components/forms/internals/PickerNativeItem.d.ts.map +1 -1
- package/lib/typescript/components/forms/internals/PickerWeb.d.ts +2 -1
- package/lib/typescript/components/forms/internals/PickerWeb.d.ts.map +1 -1
- package/lib/typescript/components/forms/internals/PickerWebItem.d.ts +2 -2
- package/lib/typescript/components/forms/internals/PickerWebItem.d.ts.map +1 -1
- package/lib/typescript/components/grid/Col.d.ts +2 -2
- package/lib/typescript/components/grid/Col.d.ts.map +1 -1
- package/lib/typescript/components/grid/Row.d.ts +2 -2
- package/lib/typescript/components/grid/Row.d.ts.map +1 -1
- package/lib/typescript/components/list-group/ListGroup.d.ts +7 -4
- package/lib/typescript/components/list-group/ListGroup.d.ts.map +1 -1
- package/lib/typescript/components/list-group/ListGroupItem.d.ts +2 -2
- package/lib/typescript/components/list-group/ListGroupItem.d.ts.map +1 -1
- package/lib/typescript/components/list-group/ListGroupItemAction.d.ts +2 -2
- package/lib/typescript/components/list-group/ListGroupItemAction.d.ts.map +1 -1
- package/lib/typescript/components/modal/Modal.d.ts +13 -7
- package/lib/typescript/components/modal/Modal.d.ts.map +1 -1
- package/lib/typescript/components/modal/ModalBody.d.ts +3 -2
- package/lib/typescript/components/modal/ModalBody.d.ts.map +1 -1
- package/lib/typescript/components/modal/ModalFooter.d.ts +2 -2
- package/lib/typescript/components/modal/ModalFooter.d.ts.map +1 -1
- package/lib/typescript/components/modal/ModalHeader.d.ts +2 -2
- package/lib/typescript/components/modal/ModalHeader.d.ts.map +1 -1
- package/lib/typescript/components/modal/ModalTitle.d.ts +2 -2
- package/lib/typescript/components/modal/ModalTitle.d.ts.map +1 -1
- package/lib/typescript/components/nav/Nav.d.ts +5 -3
- package/lib/typescript/components/nav/Nav.d.ts.map +1 -1
- package/lib/typescript/components/nav/NavLink.d.ts +2 -2
- package/lib/typescript/components/nav/NavLink.d.ts.map +1 -1
- package/lib/typescript/components/nav/Tab.d.ts +4 -2
- package/lib/typescript/components/nav/Tab.d.ts.map +1 -1
- package/lib/typescript/components/nav/TabContent.d.ts +2 -2
- package/lib/typescript/components/nav/TabContent.d.ts.map +1 -1
- package/lib/typescript/components/nav/TabPane.d.ts +2 -2
- package/lib/typescript/components/nav/TabPane.d.ts.map +1 -1
- package/lib/typescript/components/navbar/Navbar.d.ts +11 -6
- package/lib/typescript/components/navbar/Navbar.d.ts.map +1 -1
- package/lib/typescript/components/navbar/NavbarBrand.d.ts +2 -2
- package/lib/typescript/components/navbar/NavbarBrand.d.ts.map +1 -1
- package/lib/typescript/components/navbar/NavbarCollapse.d.ts +2 -2
- package/lib/typescript/components/navbar/NavbarCollapse.d.ts.map +1 -1
- package/lib/typescript/components/navbar/NavbarText.d.ts +2 -2
- package/lib/typescript/components/navbar/NavbarText.d.ts.map +1 -1
- package/lib/typescript/components/navbar/NavbarToggler.d.ts +2 -1
- package/lib/typescript/components/navbar/NavbarToggler.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/Offcanvas.d.ts +10 -6
- package/lib/typescript/components/offcanvas/Offcanvas.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/OffcanvasBody.d.ts +2 -2
- package/lib/typescript/components/offcanvas/OffcanvasBody.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/OffcanvasHeader.d.ts +2 -2
- package/lib/typescript/components/offcanvas/OffcanvasHeader.d.ts.map +1 -1
- package/lib/typescript/components/offcanvas/OffcanvasTitle.d.ts +2 -2
- package/lib/typescript/components/offcanvas/OffcanvasTitle.d.ts.map +1 -1
- package/lib/typescript/components/pagination/Pagination.d.ts +5 -3
- package/lib/typescript/components/pagination/Pagination.d.ts.map +1 -1
- package/lib/typescript/components/pagination/PaginationItem.d.ts +2 -2
- package/lib/typescript/components/pagination/PaginationItem.d.ts.map +1 -1
- package/lib/typescript/components/placeholders/Placeholders.d.ts +2 -2
- package/lib/typescript/components/placeholders/Placeholders.d.ts.map +1 -1
- package/lib/typescript/components/popover/Popover.d.ts +9 -5
- package/lib/typescript/components/popover/Popover.d.ts.map +1 -1
- package/lib/typescript/components/popover/PopoverArrow.d.ts +2 -2
- package/lib/typescript/components/popover/PopoverArrow.d.ts.map +1 -1
- package/lib/typescript/components/popover/PopoverBody.d.ts +2 -2
- package/lib/typescript/components/popover/PopoverBody.d.ts.map +1 -1
- package/lib/typescript/components/popover/PopoverHeader.d.ts +2 -2
- package/lib/typescript/components/popover/PopoverHeader.d.ts.map +1 -1
- package/lib/typescript/components/popover/injectPopover.d.ts +5 -1
- package/lib/typescript/components/popover/injectPopover.d.ts.map +1 -1
- package/lib/typescript/components/progress/Progress.d.ts +5 -3
- package/lib/typescript/components/progress/Progress.d.ts.map +1 -1
- package/lib/typescript/components/progress/ProgressBar.d.ts +2 -2
- package/lib/typescript/components/progress/ProgressBar.d.ts.map +1 -1
- package/lib/typescript/components/spinners/Spinner.d.ts +2 -2
- package/lib/typescript/components/spinners/Spinner.d.ts.map +1 -1
- package/lib/typescript/components/toasts/Toast.d.ts +7 -4
- package/lib/typescript/components/toasts/Toast.d.ts.map +1 -1
- package/lib/typescript/components/toasts/ToastBody.d.ts +2 -2
- package/lib/typescript/components/toasts/ToastBody.d.ts.map +1 -1
- package/lib/typescript/components/toasts/ToastContainer.d.ts +3 -2
- package/lib/typescript/components/toasts/ToastContainer.d.ts.map +1 -1
- package/lib/typescript/components/toasts/ToastHeader.d.ts +2 -2
- package/lib/typescript/components/toasts/ToastHeader.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/Tooltip.d.ts +7 -4
- package/lib/typescript/components/tooltip/Tooltip.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/TooltipArrow.d.ts +2 -2
- package/lib/typescript/components/tooltip/TooltipArrow.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/TooltipInner.d.ts +2 -2
- package/lib/typescript/components/tooltip/TooltipInner.d.ts.map +1 -1
- package/lib/typescript/components/tooltip/injectTooltip.d.ts +5 -1
- package/lib/typescript/components/tooltip/injectTooltip.d.ts.map +1 -1
- package/lib/typescript/components/type/Blockquote.d.ts +2 -2
- package/lib/typescript/components/type/Blockquote.d.ts.map +1 -1
- package/lib/typescript/components/type/Code.d.ts +2 -2
- package/lib/typescript/components/type/Code.d.ts.map +1 -1
- package/lib/typescript/components/type/DisplayHeading.d.ts +5 -2
- package/lib/typescript/components/type/DisplayHeading.d.ts.map +1 -1
- package/lib/typescript/components/type/Paragraph.d.ts +2 -2
- package/lib/typescript/components/type/Paragraph.d.ts.map +1 -1
- package/lib/typescript/hooks/useAction.d.ts +3 -3
- package/lib/typescript/hooks/useAction.d.ts.map +1 -1
- package/lib/typescript/hooks/useModifier.d.ts +3 -1
- package/lib/typescript/hooks/useModifier.d.ts.map +1 -1
- package/lib/typescript/hooks/useScrollbarEffects.d.ts +3 -3
- package/lib/typescript/hooks/useScrollbarEffects.d.ts.map +1 -1
- package/lib/typescript/hooks/useScrollbarEffects.web.d.ts +3 -3
- package/lib/typescript/hooks/useScrollbarEffects.web.d.ts.map +1 -1
- package/lib/typescript/hooks/useScrollbarOffset.d.ts +2 -0
- package/lib/typescript/hooks/useScrollbarOffset.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -3
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/utils.d.ts +1 -1
- package/lib/typescript/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Context.ts +4 -8
- package/src/Provider.tsx +4 -21
- package/src/components/Body.tsx +66 -68
- package/src/components/Caret.tsx +109 -111
- package/src/components/Heading.tsx +47 -49
- package/src/components/Image.tsx +3 -5
- package/src/components/ImageBackground.tsx +9 -10
- package/src/components/Label.tsx +32 -34
- package/src/components/Link.tsx +101 -101
- package/src/components/Pressable.tsx +161 -167
- package/src/components/ScrollView.tsx +76 -75
- package/src/components/Text.tsx +3 -4
- package/src/components/TextInput.tsx +36 -39
- package/src/components/View.tsx +3 -5
- package/src/components/alert/Alert.tsx +79 -80
- package/src/components/badge/Badge.tsx +41 -43
- package/src/components/breadcrumb/Breadcrumb.tsx +54 -56
- package/src/components/breadcrumb/BreadcrumbItem.tsx +80 -81
- package/src/components/button-group/ButtonGroup.tsx +42 -46
- package/src/components/button-group/ButtonToolbar.tsx +32 -34
- package/src/components/buttons/Button.tsx +3 -4
- package/src/components/card/Card.tsx +44 -46
- package/src/components/card/CardBody.tsx +38 -40
- package/src/components/card/CardFooter.tsx +42 -44
- package/src/components/card/CardHeader.tsx +43 -45
- package/src/components/close/CloseButton.tsx +53 -54
- package/src/components/collapse/Collapse.tsx +29 -31
- package/src/components/containers/Container.tsx +116 -118
- package/src/components/dropdown/Dropdown.tsx +3 -4
- package/src/components/dropdown/DropdownDivider.tsx +30 -32
- package/src/components/dropdown/DropdownHeader.tsx +40 -42
- package/src/components/dropdown/DropdownItemText.tsx +35 -37
- package/src/components/dropdown/DropdownMenu.tsx +109 -112
- package/src/components/dropdown/useToggleDropdown.ts +3 -4
- package/src/components/forms/Checkbox.tsx +13 -15
- package/src/components/forms/Feedback.tsx +38 -40
- package/src/components/forms/FormCheck.tsx +68 -69
- package/src/components/forms/FormCheckInput.tsx +74 -81
- package/src/components/forms/FormCheckLabel.tsx +69 -71
- package/src/components/forms/FormLabel.tsx +41 -43
- package/src/components/forms/FormText.tsx +36 -38
- package/src/components/forms/Input.tsx +5 -6
- package/src/components/forms/Picker.tsx +5 -6
- package/src/components/forms/PickerItem.tsx +3 -5
- package/src/components/forms/Radio.tsx +7 -7
- package/src/components/forms/RadioGroup.tsx +3 -4
- package/src/components/forms/Switch.tsx +13 -15
- package/src/components/forms/internals/FormCheckInputNative.tsx +49 -51
- package/src/components/forms/internals/FormCheckInputWeb.tsx +11 -11
- package/src/components/forms/internals/PickerNative.tsx +84 -84
- package/src/components/forms/internals/PickerNativeItem.tsx +29 -31
- package/src/components/forms/internals/PickerWeb.tsx +4 -3
- package/src/components/forms/internals/PickerWebItem.tsx +15 -17
- package/src/components/grid/Col.tsx +96 -97
- package/src/components/grid/Row.tsx +32 -34
- package/src/components/helpers/Dialog.web.tsx +2 -2
- package/src/components/list-group/ListGroup.tsx +75 -77
- package/src/components/list-group/ListGroupItem.tsx +150 -151
- package/src/components/list-group/ListGroupItemAction.tsx +190 -193
- package/src/components/modal/Modal.tsx +91 -96
- package/src/components/modal/ModalBody.tsx +26 -27
- package/src/components/modal/ModalFooter.tsx +38 -42
- package/src/components/modal/ModalHeader.tsx +37 -41
- package/src/components/modal/ModalTitle.tsx +3 -5
- package/src/components/nav/Nav.tsx +104 -106
- package/src/components/nav/NavLink.tsx +266 -267
- package/src/components/nav/TabContent.tsx +12 -14
- package/src/components/nav/TabPane.tsx +50 -52
- package/src/components/navbar/Navbar.tsx +89 -90
- package/src/components/navbar/NavbarBrand.tsx +78 -80
- package/src/components/navbar/NavbarCollapse.tsx +61 -63
- package/src/components/navbar/NavbarText.tsx +43 -45
- package/src/components/navbar/NavbarToggler.tsx +34 -36
- package/src/components/offcanvas/Offcanvas.tsx +4 -5
- package/src/components/offcanvas/OffcanvasBody.tsx +28 -29
- package/src/components/offcanvas/OffcanvasHeader.tsx +53 -55
- package/src/components/offcanvas/OffcanvasTitle.tsx +21 -23
- package/src/components/pagination/Pagination.tsx +37 -39
- package/src/components/pagination/PaginationItem.tsx +42 -43
- package/src/components/placeholders/Placeholders.tsx +30 -34
- package/src/components/popover/Popover.tsx +3 -4
- package/src/components/popover/PopoverArrow.tsx +25 -29
- package/src/components/popover/PopoverBody.tsx +37 -41
- package/src/components/popover/PopoverHeader.tsx +46 -48
- package/src/components/popover/injectPopover.tsx +69 -68
- package/src/components/progress/Progress.tsx +64 -65
- package/src/components/progress/ProgressBar.tsx +62 -70
- package/src/components/spinners/Spinner.tsx +161 -156
- package/src/components/toasts/Toast.tsx +65 -67
- package/src/components/toasts/ToastBody.tsx +39 -41
- package/src/components/toasts/ToastContainer.tsx +17 -19
- package/src/components/toasts/ToastHeader.tsx +55 -59
- package/src/components/tooltip/Tooltip.tsx +3 -4
- package/src/components/tooltip/TooltipArrow.tsx +21 -25
- package/src/components/tooltip/TooltipInner.tsx +37 -41
- package/src/components/tooltip/injectTooltip.tsx +67 -66
- package/src/components/type/Blockquote.tsx +43 -45
- package/src/components/type/Code.tsx +37 -39
- package/src/components/type/DisplayHeading.tsx +38 -38
- package/src/components/type/Paragraph.tsx +40 -42
- package/src/hooks/useAction.ts +84 -78
- package/src/hooks/useFocusRing.ts +1 -1
- package/src/hooks/useModifier.ts +23 -21
- package/src/hooks/useScrollbarEffects.ts +8 -7
- package/src/hooks/useScrollbarEffects.web.ts +26 -30
- package/src/hooks/useScrollbarOffset.ts +12 -0
- package/src/index.ts +3 -3
- package/src/utils.ts +1 -1
- package/lib/module/hooks/useFixedElement.js +0 -17
- package/lib/module/hooks/useFixedElement.js.map +0 -1
- package/lib/typescript/hooks/useFixedElement.d.ts +0 -2
- package/lib/typescript/hooks/useFixedElement.d.ts.map +0 -1
- package/src/hooks/useFixedElement.ts +0 -18
|
@@ -117,127 +117,124 @@ const getAlign = (
|
|
|
117
117
|
return startIndex > endIndex ? 'start' : 'end';
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
const isStatic = Platform.OS === 'web' && display === 'static';
|
|
158
|
-
const isCollapsedNavbar =
|
|
159
|
-
navbar &&
|
|
160
|
-
!(navbar.expand && (navbar.expand === true || media.up(navbar.expand)));
|
|
161
|
-
const hasStaticStyle = isStatic && !isCollapsedNavbar;
|
|
162
|
-
|
|
163
|
-
const classes = getStyles(styles, [
|
|
164
|
-
'.dropdown-menu',
|
|
165
|
-
// Non-Popper styles
|
|
166
|
-
hasStaticStyle && '.dropdown-menu[data-bs-popper]',
|
|
167
|
-
hasStaticStyle &&
|
|
168
|
-
start &&
|
|
169
|
-
`.dropdown-menu${
|
|
170
|
-
start === true ? '' : `-${start}`
|
|
171
|
-
}-start[data-bs-popper]`,
|
|
172
|
-
hasStaticStyle &&
|
|
173
|
-
end &&
|
|
174
|
-
`.dropdown-menu${end === true ? '' : `-${end}`}-end[data-bs-popper]`,
|
|
175
|
-
hasStaticStyle &&
|
|
176
|
-
direction === 'up' &&
|
|
177
|
-
'.dropup .dropdown-menu[data-bs-popper]',
|
|
178
|
-
hasStaticStyle &&
|
|
179
|
-
direction === 'end' &&
|
|
180
|
-
'.dropend .dropdown-menu[data-bs-popper]',
|
|
181
|
-
hasStaticStyle &&
|
|
182
|
-
direction === 'start' &&
|
|
183
|
-
'.dropstart .dropdown-menu[data-bs-popper]',
|
|
184
|
-
// Navbar styles
|
|
185
|
-
navbar && '.navbar-nav .dropdown-menu',
|
|
186
|
-
navbar &&
|
|
187
|
-
navbar.expand &&
|
|
188
|
-
`.navbar-expand${
|
|
189
|
-
navbar.expand === true ? '' : `-${navbar.expand}`
|
|
190
|
-
} .navbar-nav .dropdown-menu`,
|
|
191
|
-
]);
|
|
192
|
-
const textClasses = getStyles(styles, ['.dropdown-menu --text']);
|
|
193
|
-
|
|
194
|
-
if (isStatic || isCollapsedNavbar) {
|
|
195
|
-
return (
|
|
196
|
-
<>
|
|
197
|
-
{!isCollapsedNavbar && (
|
|
198
|
-
<BackdropHandler
|
|
199
|
-
onClose={() => {
|
|
200
|
-
setVisible(false);
|
|
201
|
-
}}
|
|
202
|
-
/>
|
|
203
|
-
)}
|
|
204
|
-
<View
|
|
205
|
-
{...elementProps}
|
|
206
|
-
ref={concatRefs(content.ref, ref)}
|
|
207
|
-
aria-labelledby={identifier}
|
|
208
|
-
style={[classes, style]}
|
|
209
|
-
textStyle={[textClasses, textStyle]}
|
|
210
|
-
>
|
|
211
|
-
{children}
|
|
212
|
-
</View>
|
|
213
|
-
</>
|
|
214
|
-
);
|
|
215
|
-
}
|
|
120
|
+
function DropdownMenu(props: DropdownMenuProps & React.RefAttributes<ViewRef>) {
|
|
121
|
+
const {
|
|
122
|
+
ref,
|
|
123
|
+
children,
|
|
124
|
+
start = true,
|
|
125
|
+
end = false,
|
|
126
|
+
style,
|
|
127
|
+
textStyle,
|
|
128
|
+
...elementProps
|
|
129
|
+
} = props;
|
|
130
|
+
|
|
131
|
+
const navbar = useContext(NavbarContext);
|
|
132
|
+
const media = useMedia();
|
|
133
|
+
|
|
134
|
+
const dropdown = useForcedContext(DropdownContext);
|
|
135
|
+
|
|
136
|
+
const {
|
|
137
|
+
identifier,
|
|
138
|
+
visible,
|
|
139
|
+
setVisible,
|
|
140
|
+
setAlign,
|
|
141
|
+
direction,
|
|
142
|
+
display,
|
|
143
|
+
content,
|
|
144
|
+
} = dropdown;
|
|
145
|
+
|
|
146
|
+
// Workaround for setting start / end on DropdownMenu and not on Dropdown.
|
|
147
|
+
const align = getAlign(media, start, end);
|
|
148
|
+
|
|
149
|
+
useLayoutEffect(() => {
|
|
150
|
+
setAlign(align);
|
|
151
|
+
}, [align]);
|
|
152
|
+
|
|
153
|
+
if (!visible || !align) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
216
156
|
|
|
157
|
+
const isStatic = Platform.OS === 'web' && display === 'static';
|
|
158
|
+
const isCollapsedNavbar =
|
|
159
|
+
navbar &&
|
|
160
|
+
!(navbar.expand && (navbar.expand === true || media.up(navbar.expand)));
|
|
161
|
+
const hasStaticStyle = isStatic && !isCollapsedNavbar;
|
|
162
|
+
|
|
163
|
+
const classes = getStyles(styles, [
|
|
164
|
+
'.dropdown-menu',
|
|
165
|
+
// Non-Popper styles
|
|
166
|
+
hasStaticStyle && '.dropdown-menu[data-bs-popper]',
|
|
167
|
+
hasStaticStyle &&
|
|
168
|
+
start &&
|
|
169
|
+
`.dropdown-menu${
|
|
170
|
+
start === true ? '' : `-${start}`
|
|
171
|
+
}-start[data-bs-popper]`,
|
|
172
|
+
hasStaticStyle &&
|
|
173
|
+
end &&
|
|
174
|
+
`.dropdown-menu${end === true ? '' : `-${end}`}-end[data-bs-popper]`,
|
|
175
|
+
hasStaticStyle &&
|
|
176
|
+
direction === 'up' &&
|
|
177
|
+
'.dropup .dropdown-menu[data-bs-popper]',
|
|
178
|
+
hasStaticStyle &&
|
|
179
|
+
direction === 'end' &&
|
|
180
|
+
'.dropend .dropdown-menu[data-bs-popper]',
|
|
181
|
+
hasStaticStyle &&
|
|
182
|
+
direction === 'start' &&
|
|
183
|
+
'.dropstart .dropdown-menu[data-bs-popper]',
|
|
184
|
+
// Navbar styles
|
|
185
|
+
navbar && '.navbar-nav .dropdown-menu',
|
|
186
|
+
navbar &&
|
|
187
|
+
navbar.expand &&
|
|
188
|
+
`.navbar-expand${
|
|
189
|
+
navbar.expand === true ? '' : `-${navbar.expand}`
|
|
190
|
+
} .navbar-nav .dropdown-menu`,
|
|
191
|
+
]);
|
|
192
|
+
const textClasses = getStyles(styles, ['.dropdown-menu --text']);
|
|
193
|
+
|
|
194
|
+
if (isStatic || isCollapsedNavbar) {
|
|
217
195
|
return (
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
196
|
+
<>
|
|
197
|
+
{!isCollapsedNavbar && (
|
|
198
|
+
<BackdropHandler
|
|
199
|
+
onClose={() => {
|
|
200
|
+
setVisible(false);
|
|
201
|
+
}}
|
|
202
|
+
/>
|
|
203
|
+
)}
|
|
224
204
|
<View
|
|
225
205
|
{...elementProps}
|
|
226
|
-
{
|
|
227
|
-
ref={concatRefs(ref, content.ref)}
|
|
206
|
+
ref={concatRefs(content.ref, ref)}
|
|
228
207
|
aria-labelledby={identifier}
|
|
229
|
-
style={[classes,
|
|
208
|
+
style={[classes, style]}
|
|
230
209
|
textStyle={[textClasses, textStyle]}
|
|
231
210
|
>
|
|
232
|
-
|
|
233
|
-
{children}
|
|
234
|
-
</DropdownContext.Provider>
|
|
211
|
+
{children}
|
|
235
212
|
</View>
|
|
236
|
-
|
|
213
|
+
</>
|
|
237
214
|
);
|
|
238
|
-
}
|
|
239
|
-
);
|
|
215
|
+
}
|
|
240
216
|
|
|
241
|
-
|
|
217
|
+
return (
|
|
218
|
+
<Portal name={identifier}>
|
|
219
|
+
<BackdropHandler
|
|
220
|
+
onClose={() => {
|
|
221
|
+
setVisible(false);
|
|
222
|
+
}}
|
|
223
|
+
/>
|
|
224
|
+
<View
|
|
225
|
+
{...elementProps}
|
|
226
|
+
{...content.getProps(elementProps)}
|
|
227
|
+
ref={concatRefs(ref, content.ref)}
|
|
228
|
+
aria-labelledby={identifier}
|
|
229
|
+
style={[classes, content.style, style]}
|
|
230
|
+
textStyle={[textClasses, textStyle]}
|
|
231
|
+
>
|
|
232
|
+
<DropdownContext.Provider value={dropdown}>
|
|
233
|
+
{children}
|
|
234
|
+
</DropdownContext.Provider>
|
|
235
|
+
</View>
|
|
236
|
+
</Portal>
|
|
237
|
+
);
|
|
238
|
+
}
|
|
242
239
|
|
|
243
240
|
export default DropdownMenu;
|
|
@@ -6,14 +6,13 @@ import { CaretProps } from '../Caret';
|
|
|
6
6
|
import type { PressableRef } from '../Pressable';
|
|
7
7
|
|
|
8
8
|
export interface UseToggleDropdownProps {
|
|
9
|
-
ref?: React.RefObject<PressableRef | null>;
|
|
10
9
|
onPress?: null | ((event: GestureResponderEvent) => void);
|
|
11
10
|
caret?: boolean | CaretProps;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
export default function useToggleDropdown<
|
|
15
|
-
|
|
16
|
-
) {
|
|
13
|
+
export default function useToggleDropdown<
|
|
14
|
+
T extends { ref?: React.Ref<PressableRef> },
|
|
15
|
+
>(props: UseToggleDropdownProps & T) {
|
|
17
16
|
const context = useForcedContext(DropdownContext);
|
|
18
17
|
|
|
19
18
|
const { ref, caret, ...restProps } = props;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { PressableRef } from '../Pressable';
|
|
3
|
-
import FormCheckInput, { FormCheckInputProps } from './FormCheckInput';
|
|
4
|
-
|
|
5
|
-
export interface CheckboxProps extends Omit<FormCheckInputProps, 'type'> {}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const { ...elementProps } = props;
|
|
9
|
-
|
|
10
|
-
return <FormCheckInput {...elementProps} ref={ref} type="checkbox" />;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export default Checkbox;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PressableRef } from '../Pressable';
|
|
3
|
+
import FormCheckInput, { FormCheckInputProps } from './FormCheckInput';
|
|
4
|
+
|
|
5
|
+
export interface CheckboxProps extends Omit<FormCheckInputProps, 'type'> {}
|
|
6
|
+
|
|
7
|
+
function Checkbox(props: CheckboxProps & React.RefAttributes<PressableRef>) {
|
|
8
|
+
const { ref, ...elementProps } = props;
|
|
9
|
+
|
|
10
|
+
return <FormCheckInput {...elementProps} ref={ref} type="checkbox" />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default Checkbox;
|
|
@@ -1,40 +1,38 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import StyleSheet from '../../style/StyleSheet';
|
|
3
|
-
import css from '../../style/css';
|
|
4
|
-
import Text, { TextProps, TextRef } from '../Text';
|
|
5
|
-
import { each, getStyles } from '../../utils';
|
|
6
|
-
import { FORM_VALIDATION_STATES } from '../../theme/proxies';
|
|
7
|
-
import type { FormValidationState, ThemeVariables } from '../../types';
|
|
8
|
-
|
|
9
|
-
export interface FeedbackProps extends TextProps {
|
|
10
|
-
type?: keyof typeof FORM_VALIDATION_STATES;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const styles = StyleSheet.create({
|
|
14
|
-
...each(FORM_VALIDATION_STATES, (state, data: FormValidationState) => ({
|
|
15
|
-
[`.${state}-feedback`]: css`
|
|
16
|
-
// display: none;
|
|
17
|
-
width: 100%;
|
|
18
|
-
margin-top: $form-feedback-margin-top;
|
|
19
|
-
font-size: $form-feedback-font-size;
|
|
20
|
-
font-style: $form-feedback-font-style;
|
|
21
|
-
color: ${(t: ThemeVariables) => data(t).color};
|
|
22
|
-
`,
|
|
23
|
-
})),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const { children, type, style, ...elementProps } = props;
|
|
28
|
-
|
|
29
|
-
const classes = getStyles(styles, [`.${type}-feedback`]);
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<Text {...elementProps} ref={ref} style={[classes, style]}>
|
|
33
|
-
{children}
|
|
34
|
-
</Text>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export default Feedback;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import StyleSheet from '../../style/StyleSheet';
|
|
3
|
+
import css from '../../style/css';
|
|
4
|
+
import Text, { TextProps, TextRef } from '../Text';
|
|
5
|
+
import { each, getStyles } from '../../utils';
|
|
6
|
+
import { FORM_VALIDATION_STATES } from '../../theme/proxies';
|
|
7
|
+
import type { FormValidationState, ThemeVariables } from '../../types';
|
|
8
|
+
|
|
9
|
+
export interface FeedbackProps extends TextProps {
|
|
10
|
+
type?: keyof typeof FORM_VALIDATION_STATES;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const styles = StyleSheet.create({
|
|
14
|
+
...each(FORM_VALIDATION_STATES, (state, data: FormValidationState) => ({
|
|
15
|
+
[`.${state}-feedback`]: css`
|
|
16
|
+
// display: none;
|
|
17
|
+
width: 100%;
|
|
18
|
+
margin-top: $form-feedback-margin-top;
|
|
19
|
+
font-size: $form-feedback-font-size;
|
|
20
|
+
font-style: $form-feedback-font-style;
|
|
21
|
+
color: ${(t: ThemeVariables) => data(t).color};
|
|
22
|
+
`,
|
|
23
|
+
})),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
function Feedback(props: FeedbackProps & React.RefAttributes<TextRef>) {
|
|
27
|
+
const { ref, children, type, style, ...elementProps } = props;
|
|
28
|
+
|
|
29
|
+
const classes = getStyles(styles, [`.${type}-feedback`]);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Text {...elementProps} ref={ref} style={[classes, style]}>
|
|
33
|
+
{children}
|
|
34
|
+
</Text>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default Feedback;
|
|
@@ -1,69 +1,68 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import StyleSheet from '../../style/StyleSheet';
|
|
3
|
-
import css from '../../style/css';
|
|
4
|
-
import View, { ViewProps, ViewRef } from '../View';
|
|
5
|
-
import { getStyles } from '../../utils';
|
|
6
|
-
import FormCheckContext from './FormCheckContext';
|
|
7
|
-
import FormCheckLabel from './FormCheckLabel';
|
|
8
|
-
|
|
9
|
-
export interface FormCheckProps extends ViewProps {
|
|
10
|
-
reverse?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
valid?: boolean;
|
|
13
|
-
invalid?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const styles = StyleSheet.create({
|
|
17
|
-
'.form-check': css`
|
|
18
|
-
// display: block;
|
|
19
|
-
flex-direction: row; // added for bootstrap-rn
|
|
20
|
-
min-height: $form-check-min-height;
|
|
21
|
-
// padding-left: $form-check-padding-start;
|
|
22
|
-
margin-bottom: $form-check-margin-bottom;
|
|
23
|
-
`,
|
|
24
|
-
'.form-check-reverse': css`
|
|
25
|
-
flex-direction: row-reverse; // added for bootstrap-rn
|
|
26
|
-
// padding-right: $form-check-padding-start;
|
|
27
|
-
// padding-left: 0;
|
|
28
|
-
// text-align: right;
|
|
29
|
-
`,
|
|
30
|
-
'.form-switch.form-check': css`
|
|
31
|
-
// padding-left: $form-switch-padding-start;
|
|
32
|
-
`,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import StyleSheet from '../../style/StyleSheet';
|
|
3
|
+
import css from '../../style/css';
|
|
4
|
+
import View, { ViewProps, ViewRef } from '../View';
|
|
5
|
+
import { getStyles } from '../../utils';
|
|
6
|
+
import FormCheckContext from './FormCheckContext';
|
|
7
|
+
import FormCheckLabel from './FormCheckLabel';
|
|
8
|
+
|
|
9
|
+
export interface FormCheckProps extends ViewProps {
|
|
10
|
+
reverse?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
valid?: boolean;
|
|
13
|
+
invalid?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const styles = StyleSheet.create({
|
|
17
|
+
'.form-check': css`
|
|
18
|
+
// display: block;
|
|
19
|
+
flex-direction: row; // added for bootstrap-rn
|
|
20
|
+
min-height: $form-check-min-height;
|
|
21
|
+
// padding-left: $form-check-padding-start;
|
|
22
|
+
margin-bottom: $form-check-margin-bottom;
|
|
23
|
+
`,
|
|
24
|
+
'.form-check-reverse': css`
|
|
25
|
+
flex-direction: row-reverse; // added for bootstrap-rn
|
|
26
|
+
// padding-right: $form-check-padding-start;
|
|
27
|
+
// padding-left: 0;
|
|
28
|
+
// text-align: right;
|
|
29
|
+
`,
|
|
30
|
+
'.form-switch.form-check': css`
|
|
31
|
+
// padding-left: $form-switch-padding-start;
|
|
32
|
+
`,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function FormCheck(props: FormCheckProps & React.RefAttributes<ViewRef>) {
|
|
36
|
+
const {
|
|
37
|
+
ref,
|
|
38
|
+
children,
|
|
39
|
+
reverse = false,
|
|
40
|
+
disabled = false,
|
|
41
|
+
valid = false,
|
|
42
|
+
invalid = false,
|
|
43
|
+
style,
|
|
44
|
+
...elementProps
|
|
45
|
+
} = props;
|
|
46
|
+
|
|
47
|
+
const classes = getStyles(styles, [
|
|
48
|
+
'.form-check',
|
|
49
|
+
reverse && '.form-check-reverse',
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
const contextValue = useMemo(
|
|
53
|
+
() => ({ reverse, disabled, valid, invalid }),
|
|
54
|
+
[reverse, disabled, valid, invalid],
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<View {...elementProps} ref={ref} style={[classes, style]}>
|
|
59
|
+
<FormCheckContext.Provider value={contextValue}>
|
|
60
|
+
{children}
|
|
61
|
+
</FormCheckContext.Provider>
|
|
62
|
+
</View>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default Object.assign(FormCheck, {
|
|
67
|
+
Label: FormCheckLabel,
|
|
68
|
+
});
|
|
@@ -176,93 +176,86 @@ const styles = StyleSheet.create({
|
|
|
176
176
|
`,
|
|
177
177
|
});
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
props,
|
|
184
|
-
ref,
|
|
185
|
-
);
|
|
179
|
+
function FormCheckInput(
|
|
180
|
+
props: FormCheckInputProps & React.RefAttributes<PressableRef>,
|
|
181
|
+
) {
|
|
182
|
+
const modifierProps = useModifier('useFormField', props);
|
|
186
183
|
|
|
187
|
-
|
|
184
|
+
const context = useContext(FormCheckContext);
|
|
188
185
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
186
|
+
const {
|
|
187
|
+
ref,
|
|
188
|
+
type,
|
|
189
|
+
value,
|
|
190
|
+
onFocus = () => {},
|
|
191
|
+
onBlur = () => {},
|
|
192
|
+
disabled = context ? context.disabled : false,
|
|
193
|
+
valid = context ? context.valid : false,
|
|
194
|
+
invalid = context ? context.invalid : false,
|
|
195
|
+
useNativeComponent = false,
|
|
196
|
+
autoFocus = false,
|
|
197
|
+
style,
|
|
198
|
+
...elementProps
|
|
199
|
+
} = modifierProps;
|
|
202
200
|
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
const media = useMedia();
|
|
202
|
+
const [focused, setFocused] = useState(autoFocus);
|
|
205
203
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
type === 'switch' && value && '.form-switch .form-check-input:checked',
|
|
232
|
-
]);
|
|
204
|
+
const classes = getStyles(styles, [
|
|
205
|
+
context && '.form-check .form-check-input',
|
|
206
|
+
context?.reverse && '.form-check-reverse .form-check-input',
|
|
207
|
+
'.form-check-input',
|
|
208
|
+
type === 'checkbox' && '.form-check-input[type="checkbox"]',
|
|
209
|
+
type === 'radio' && '.form-check-input[type="radio"]',
|
|
210
|
+
value && '.form-check-input:checked',
|
|
211
|
+
type === 'checkbox' &&
|
|
212
|
+
value &&
|
|
213
|
+
'.form-check-input[type="checkbox"]:checked',
|
|
214
|
+
type === 'radio' && value && '.form-check-input[type="radio"]:checked',
|
|
215
|
+
disabled && '.form-check-input:disabled',
|
|
216
|
+
// validation
|
|
217
|
+
valid && '.form-check-input:valid',
|
|
218
|
+
valid && value && '.form-check-input:valid:checked',
|
|
219
|
+
invalid && '.form-check-input:invalid',
|
|
220
|
+
invalid && value && '.form-check-input:invalid:checked',
|
|
221
|
+
// switch
|
|
222
|
+
context && type === 'switch' && '.form-switch.form-check .form-check-input',
|
|
223
|
+
context?.reverse &&
|
|
224
|
+
type === 'switch' &&
|
|
225
|
+
'.form-switch.form-check-reverse .form-check-input',
|
|
226
|
+
type === 'switch' && '.form-switch .form-check-input',
|
|
227
|
+
type === 'switch' && value && '.form-switch .form-check-input:checked',
|
|
228
|
+
]);
|
|
233
229
|
|
|
234
|
-
|
|
230
|
+
const resolveStyle = useStyle([classes, style]);
|
|
235
231
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
const BaseFormCheckInput =
|
|
233
|
+
Platform.OS === 'web' && !useNativeComponent
|
|
234
|
+
? FormCheckInputWeb
|
|
235
|
+
: FormCheckInputNative;
|
|
240
236
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
);
|
|
265
|
-
|
|
266
|
-
FormCheckInput.displayName = 'FormCheckInput';
|
|
237
|
+
return (
|
|
238
|
+
<BaseFormCheckInput
|
|
239
|
+
{...elementProps}
|
|
240
|
+
ref={ref}
|
|
241
|
+
type={type}
|
|
242
|
+
value={value}
|
|
243
|
+
onFocus={() => {
|
|
244
|
+
setFocused(true);
|
|
245
|
+
onFocus();
|
|
246
|
+
}}
|
|
247
|
+
onBlur={() => {
|
|
248
|
+
setFocused(false);
|
|
249
|
+
onBlur();
|
|
250
|
+
}}
|
|
251
|
+
disabled={disabled}
|
|
252
|
+
autoFocus={autoFocus}
|
|
253
|
+
style={resolveStyle({
|
|
254
|
+
media,
|
|
255
|
+
interaction: { focus: focused, focusVisible: focused },
|
|
256
|
+
})}
|
|
257
|
+
/>
|
|
258
|
+
);
|
|
259
|
+
}
|
|
267
260
|
|
|
268
261
|
export default FormCheckInput;
|