ferns-ui 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -0
- package/README.md +22 -0
- package/dist/ActionSheet.d.ts +490 -0
- package/dist/ActionSheet.js +647 -0
- package/dist/ActionSheet.js.map +1 -0
- package/dist/Banner.d.ts +27 -0
- package/dist/Banner.js +56 -0
- package/dist/Banner.js.map +1 -0
- package/dist/Banner.stories.d.ts +1 -0
- package/dist/Banner.stories.js +13 -0
- package/dist/Banner.stories.js.map +1 -0
- package/dist/BlurBox.d.ts +5 -0
- package/dist/BlurBox.js +28 -0
- package/dist/BlurBox.js.map +1 -0
- package/dist/BlurBox.native.d.ts +6 -0
- package/dist/BlurBox.native.js +30 -0
- package/dist/BlurBox.native.js.map +1 -0
- package/dist/Body.d.ts +6 -0
- package/dist/Body.js +21 -0
- package/dist/Body.js.map +1 -0
- package/dist/Box.d.ts +18 -0
- package/dist/Box.js +228 -0
- package/dist/Box.js.map +1 -0
- package/dist/Box.stories.d.ts +1 -0
- package/dist/Box.stories.js +45 -0
- package/dist/Box.stories.js.map +1 -0
- package/dist/Button.d.ts +20 -0
- package/dist/Button.js +103 -0
- package/dist/Button.js.map +1 -0
- package/dist/Button.stories.d.ts +1 -0
- package/dist/Button.stories.js +41 -0
- package/dist/Button.stories.js.map +1 -0
- package/dist/Card.d.ts +5 -0
- package/dist/Card.js +8 -0
- package/dist/Card.js.map +1 -0
- package/dist/Card.stories.d.ts +6 -0
- package/dist/Card.stories.js +18 -0
- package/dist/Card.stories.js.map +1 -0
- package/dist/CheckBox.d.ts +6 -0
- package/dist/CheckBox.js +27 -0
- package/dist/CheckBox.js.map +1 -0
- package/dist/CheckBox.stories.d.ts +1 -0
- package/dist/CheckBox.stories.js +28 -0
- package/dist/CheckBox.stories.js.map +1 -0
- package/dist/Common.d.ts +868 -0
- package/dist/Common.js +46 -0
- package/dist/Common.js.map +1 -0
- package/dist/DateTimeActionSheet.d.ts +15 -0
- package/dist/DateTimeActionSheet.js +28 -0
- package/dist/DateTimeActionSheet.js.map +1 -0
- package/dist/DecimalRangeActionSheet.d.ts +18 -0
- package/dist/DecimalRangeActionSheet.js +65 -0
- package/dist/DecimalRangeActionSheet.js.map +1 -0
- package/dist/ErrorBoundary.d.ts +19 -0
- package/dist/ErrorBoundary.js +31 -0
- package/dist/ErrorBoundary.js.map +1 -0
- package/dist/ErrorPage.d.ts +10 -0
- package/dist/ErrorPage.js +20 -0
- package/dist/ErrorPage.js.map +1 -0
- package/dist/Field.d.ts +15 -0
- package/dist/Field.js +136 -0
- package/dist/Field.js.map +1 -0
- package/dist/Field.stories.d.ts +6 -0
- package/dist/Field.stories.js +38 -0
- package/dist/Field.stories.js.map +1 -0
- package/dist/FieldWithLabels.d.ts +3 -0
- package/dist/FieldWithLabels.js +8 -0
- package/dist/FieldWithLabels.js.map +1 -0
- package/dist/FlatList.d.ts +2 -0
- package/dist/FlatList.js +3 -0
- package/dist/FlatList.js.map +1 -0
- package/dist/Form.d.ts +22 -0
- package/dist/Form.js +89 -0
- package/dist/Form.js.map +1 -0
- package/dist/Form.stories.d.ts +6 -0
- package/dist/Form.stories.js +36 -0
- package/dist/Form.stories.js.map +1 -0
- package/dist/HeaderButtons.d.ts +31 -0
- package/dist/HeaderButtons.js +53 -0
- package/dist/HeaderButtons.js.map +1 -0
- package/dist/HeaderButtons.stories.d.ts +6 -0
- package/dist/HeaderButtons.stories.js +6 -0
- package/dist/HeaderButtons.stories.js.map +1 -0
- package/dist/Heading.d.ts +11 -0
- package/dist/Heading.js +46 -0
- package/dist/Heading.js.map +1 -0
- package/dist/Heading.stories.d.ts +1 -0
- package/dist/Heading.stories.js +22 -0
- package/dist/Heading.stories.js.map +1 -0
- package/dist/HeightActionSheet.d.ts +16 -0
- package/dist/HeightActionSheet.js +58 -0
- package/dist/HeightActionSheet.js.map +1 -0
- package/dist/Icon.d.ts +9 -0
- package/dist/Icon.js +125 -0
- package/dist/Icon.js.map +1 -0
- package/dist/Icon.stories.d.ts +1 -0
- package/dist/Icon.stories.js +30 -0
- package/dist/Icon.stories.js.map +1 -0
- package/dist/IconButton.d.ts +5 -0
- package/dist/IconButton.js +41 -0
- package/dist/IconButton.js.map +1 -0
- package/dist/IconButton.stories.d.ts +1 -0
- package/dist/IconButton.stories.js +16 -0
- package/dist/IconButton.stories.js.map +1 -0
- package/dist/Image.d.ts +8 -0
- package/dist/Image.js +37 -0
- package/dist/Image.js.map +1 -0
- package/dist/ImageBackground.d.ts +9 -0
- package/dist/ImageBackground.js +8 -0
- package/dist/ImageBackground.js.map +1 -0
- package/dist/Layer.d.ts +9 -0
- package/dist/Layer.js +12 -0
- package/dist/Layer.js.map +1 -0
- package/dist/Link.d.ts +9 -0
- package/dist/Link.js +12 -0
- package/dist/Link.js.map +1 -0
- package/dist/Link.stories.d.ts +1 -0
- package/dist/Link.stories.js +18 -0
- package/dist/Link.stories.js.map +1 -0
- package/dist/Mask.d.ts +5 -0
- package/dist/Mask.js +22 -0
- package/dist/Mask.js.map +1 -0
- package/dist/Mask.stories.d.ts +1 -0
- package/dist/Mask.stories.js +28 -0
- package/dist/Mask.stories.js.map +1 -0
- package/dist/MediaQuery.d.ts +2 -0
- package/dist/MediaQuery.js +33 -0
- package/dist/MediaQuery.js.map +1 -0
- package/dist/Meta.d.ts +5 -0
- package/dist/Meta.js +7 -0
- package/dist/Meta.js.map +1 -0
- package/dist/ModalSheet.d.ts +7 -0
- package/dist/ModalSheet.js +42 -0
- package/dist/ModalSheet.js.map +1 -0
- package/dist/NumberPickerActionSheet.d.ts +16 -0
- package/dist/NumberPickerActionSheet.js +29 -0
- package/dist/NumberPickerActionSheet.js.map +1 -0
- package/dist/Page.d.ts +26 -0
- package/dist/Page.js +38 -0
- package/dist/Page.js.map +1 -0
- package/dist/Permissions.d.ts +2 -0
- package/dist/Permissions.js +35 -0
- package/dist/Permissions.js.map +1 -0
- package/dist/PickerSelect.d.ts +174 -0
- package/dist/PickerSelect.js +426 -0
- package/dist/PickerSelect.js.map +1 -0
- package/dist/Pill.d.ts +5 -0
- package/dist/Pill.js +10 -0
- package/dist/Pill.js.map +1 -0
- package/dist/Pill.stories.d.ts +1 -0
- package/dist/Pill.stories.js +38 -0
- package/dist/Pill.stories.js.map +1 -0
- package/dist/Pog.d.ts +15 -0
- package/dist/Pog.js +144 -0
- package/dist/Pog.js.map +1 -0
- package/dist/ProgressBar.d.ts +9 -0
- package/dist/ProgressBar.js +41 -0
- package/dist/ProgressBar.js.map +1 -0
- package/dist/ScrollView.d.ts +2 -0
- package/dist/ScrollView.js +3 -0
- package/dist/ScrollView.js.map +1 -0
- package/dist/SegmentedControl.d.ts +6 -0
- package/dist/SegmentedControl.js +18 -0
- package/dist/SegmentedControl.js.map +1 -0
- package/dist/SegmentedControl.stories.d.ts +1 -0
- package/dist/SegmentedControl.stories.js +31 -0
- package/dist/SegmentedControl.stories.js.map +1 -0
- package/dist/SelectList.d.ts +22 -0
- package/dist/SelectList.js +28 -0
- package/dist/SelectList.js.map +1 -0
- package/dist/SelectList.stories.d.ts +1 -0
- package/dist/SelectList.stories.js +26 -0
- package/dist/SelectList.stories.js.map +1 -0
- package/dist/Spinner.d.ts +21 -0
- package/dist/Spinner.js +58 -0
- package/dist/Spinner.js.map +1 -0
- package/dist/Spinner.stories.d.ts +1 -0
- package/dist/Spinner.stories.js +12 -0
- package/dist/Spinner.stories.js.map +1 -0
- package/dist/SplitPage.d.ts +31 -0
- package/dist/SplitPage.js +51 -0
- package/dist/SplitPage.js.map +1 -0
- package/dist/SplitPage.stories.d.ts +1 -0
- package/dist/SplitPage.stories.js +15 -0
- package/dist/SplitPage.stories.js.map +1 -0
- package/dist/StorybookContainer.d.ts +4 -0
- package/dist/StorybookContainer.js +8 -0
- package/dist/StorybookContainer.js.map +1 -0
- package/dist/Switch.d.ts +5 -0
- package/dist/Switch.js +10 -0
- package/dist/Switch.js.map +1 -0
- package/dist/Switch.stories.d.ts +1 -0
- package/dist/Switch.stories.js +34 -0
- package/dist/Switch.stories.js.map +1 -0
- package/dist/TapToEdit.d.ts +12 -0
- package/dist/TapToEdit.js +32 -0
- package/dist/TapToEdit.js.map +1 -0
- package/dist/Text.d.ts +11 -0
- package/dist/Text.js +85 -0
- package/dist/Text.js.map +1 -0
- package/dist/Text.stories.d.ts +1 -0
- package/dist/Text.stories.js +37 -0
- package/dist/Text.stories.js.map +1 -0
- package/dist/TextArea.d.ts +6 -0
- package/dist/TextArea.js +12 -0
- package/dist/TextArea.js.map +1 -0
- package/dist/TextArea.stories.d.ts +10 -0
- package/dist/TextArea.stories.js +24 -0
- package/dist/TextArea.stories.js.map +1 -0
- package/dist/TextField.d.ts +48 -0
- package/dist/TextField.js +207 -0
- package/dist/TextField.js.map +1 -0
- package/dist/TextField.stories.d.ts +6 -0
- package/dist/TextField.stories.js +18 -0
- package/dist/TextField.stories.js.map +1 -0
- package/dist/TextFieldNumberActionSheet.d.ts +15 -0
- package/dist/TextFieldNumberActionSheet.js +28 -0
- package/dist/TextFieldNumberActionSheet.js.map +1 -0
- package/dist/UnifiedScreens.d.ts +9 -0
- package/dist/UnifiedScreens.js +25 -0
- package/dist/UnifiedScreens.js.map +1 -0
- package/dist/Unifier.d.ts +40 -0
- package/dist/Unifier.js +203 -0
- package/dist/Unifier.js.map +1 -0
- package/dist/Utilities.d.ts +31 -0
- package/dist/Utilities.js +74 -0
- package/dist/Utilities.js.map +1 -0
- package/dist/WithLabel.d.ts +5 -0
- package/dist/WithLabel.js +27 -0
- package/dist/WithLabel.js.map +1 -0
- package/dist/dist/ActionSheet.d.ts +139 -0
- package/dist/dist/ActionSheet.js +637 -0
- package/dist/dist/ActionSheet.js.map +1 -0
- package/dist/dist/Banner.d.ts +12 -0
- package/dist/dist/Banner.js +49 -0
- package/dist/dist/Banner.js.map +1 -0
- package/dist/dist/Banner.stories.d.ts +1 -0
- package/dist/dist/Banner.stories.js +9 -0
- package/dist/dist/Banner.stories.js.map +1 -0
- package/dist/dist/BlurBox.d.ts +7 -0
- package/dist/dist/BlurBox.js +29 -0
- package/dist/dist/BlurBox.js.map +1 -0
- package/dist/dist/BlurBox.native.d.ts +9 -0
- package/dist/dist/BlurBox.native.js +32 -0
- package/dist/dist/BlurBox.native.js.map +1 -0
- package/dist/dist/Body.d.ts +12 -0
- package/dist/dist/Body.js +19 -0
- package/dist/dist/Body.js.map +1 -0
- package/dist/dist/Box.d.ts +205 -0
- package/dist/dist/Box.js +229 -0
- package/dist/dist/Box.js.map +1 -0
- package/dist/dist/Box.stories.d.ts +1 -0
- package/dist/dist/Box.stories.js +37 -0
- package/dist/dist/Box.stories.js.map +1 -0
- package/dist/dist/Button.d.ts +16 -0
- package/dist/dist/Button.js +98 -0
- package/dist/dist/Button.js.map +1 -0
- package/dist/dist/Button.stories.d.ts +13 -0
- package/dist/dist/Button.stories.js +26 -0
- package/dist/dist/Button.stories.js.map +1 -0
- package/dist/dist/Card.d.ts +6 -0
- package/dist/dist/Card.js +9 -0
- package/dist/dist/Card.js.map +1 -0
- package/dist/dist/Card.stories.d.ts +6 -0
- package/dist/dist/Card.stories.js +11 -0
- package/dist/dist/Card.stories.js.map +1 -0
- package/dist/dist/CheckBox.d.ts +8 -0
- package/dist/dist/CheckBox.js +23 -0
- package/dist/dist/CheckBox.js.map +1 -0
- package/dist/dist/CheckBox.stories.d.ts +1 -0
- package/dist/dist/CheckBox.stories.js +22 -0
- package/dist/dist/CheckBox.stories.js.map +1 -0
- package/dist/dist/Common.d.ts +5 -0
- package/dist/dist/Common.js +47 -0
- package/dist/dist/Common.js.map +1 -0
- package/dist/dist/DateTimeActionSheet.d.ts +5 -0
- package/dist/dist/DateTimeActionSheet.js +24 -0
- package/dist/dist/DateTimeActionSheet.js.map +1 -0
- package/dist/dist/DecimalRangeActionSheet.d.ts +9 -0
- package/dist/dist/DecimalRangeActionSheet.js +57 -0
- package/dist/dist/DecimalRangeActionSheet.js.map +1 -0
- package/dist/dist/ErrorBoundary.d.ts +12 -0
- package/dist/dist/ErrorBoundary.js +32 -0
- package/dist/dist/ErrorBoundary.js.map +1 -0
- package/dist/dist/ErrorPage.d.ts +7 -0
- package/dist/dist/ErrorPage.js +15 -0
- package/dist/dist/ErrorPage.js.map +1 -0
- package/dist/dist/Field.d.ts +17 -0
- package/dist/dist/Field.js +136 -0
- package/dist/dist/Field.js.map +1 -0
- package/dist/dist/Field.stories.d.ts +6 -0
- package/dist/dist/Field.stories.js +25 -0
- package/dist/dist/Field.stories.js.map +1 -0
- package/dist/dist/FieldWithLabels.d.ts +10 -0
- package/dist/dist/FieldWithLabels.js +7 -0
- package/dist/dist/FieldWithLabels.js.map +1 -0
- package/dist/dist/FlatList.d.ts +1 -0
- package/dist/dist/FlatList.js +4 -0
- package/dist/dist/FlatList.js.map +1 -0
- package/dist/dist/Form.d.ts +15 -0
- package/dist/dist/Form.js +56 -0
- package/dist/dist/Form.js.map +1 -0
- package/dist/dist/Form.stories.d.ts +6 -0
- package/dist/dist/Form.stories.js +27 -0
- package/dist/dist/Form.stories.js.map +1 -0
- package/dist/dist/HeaderButtons.d.ts +39 -0
- package/dist/dist/HeaderButtons.js +50 -0
- package/dist/dist/HeaderButtons.js.map +1 -0
- package/dist/dist/HeaderButtons.stories.d.ts +6 -0
- package/dist/dist/HeaderButtons.stories.js +7 -0
- package/dist/dist/HeaderButtons.stories.js.map +1 -0
- package/dist/dist/Heading.d.ts +32 -0
- package/dist/dist/Heading.js +47 -0
- package/dist/dist/Heading.js.map +1 -0
- package/dist/dist/Heading.stories.d.ts +1 -0
- package/dist/dist/Heading.stories.js +11 -0
- package/dist/dist/Heading.stories.js.map +1 -0
- package/dist/dist/HeightActionSheet.d.ts +9 -0
- package/dist/dist/HeightActionSheet.js +50 -0
- package/dist/dist/HeightActionSheet.js.map +1 -0
- package/dist/dist/Icon.d.ts +12 -0
- package/dist/dist/Icon.js +126 -0
- package/dist/dist/Icon.js.map +1 -0
- package/dist/dist/Icon.stories.d.ts +1 -0
- package/dist/dist/Icon.stories.js +11 -0
- package/dist/dist/Icon.stories.js.map +1 -0
- package/dist/dist/IconButton.d.ts +42 -0
- package/dist/dist/IconButton.js +41 -0
- package/dist/dist/IconButton.js.map +1 -0
- package/dist/dist/IconButton.stories.d.ts +1 -0
- package/dist/dist/IconButton.stories.js +8 -0
- package/dist/dist/IconButton.stories.js.map +1 -0
- package/dist/dist/Image.d.ts +9 -0
- package/dist/dist/Image.js +37 -0
- package/dist/dist/Image.js.map +1 -0
- package/dist/dist/ImageBackground.d.ts +6 -0
- package/dist/dist/ImageBackground.js +9 -0
- package/dist/dist/ImageBackground.js.map +1 -0
- package/dist/dist/Layer.d.ts +5 -0
- package/dist/dist/Layer.js +13 -0
- package/dist/dist/Layer.js.map +1 -0
- package/dist/dist/Link.d.ts +7 -0
- package/dist/dist/Link.js +13 -0
- package/dist/dist/Link.js.map +1 -0
- package/dist/dist/Link.stories.d.ts +1 -0
- package/dist/dist/Link.stories.js +8 -0
- package/dist/dist/Link.stories.js.map +1 -0
- package/dist/dist/Mask.d.ts +5 -0
- package/dist/dist/Mask.js +23 -0
- package/dist/dist/Mask.js.map +1 -0
- package/dist/dist/Mask.stories.d.ts +1 -0
- package/dist/dist/Mask.stories.js +13 -0
- package/dist/dist/Mask.stories.js.map +1 -0
- package/dist/dist/MediaQuery.d.ts +2 -0
- package/dist/dist/MediaQuery.js +34 -0
- package/dist/dist/MediaQuery.js.map +1 -0
- package/dist/dist/Meta.d.ts +6 -0
- package/dist/dist/Meta.js +8 -0
- package/dist/dist/Meta.js.map +1 -0
- package/dist/dist/ModalSheet.d.ts +3 -0
- package/dist/dist/ModalSheet.js +43 -0
- package/dist/dist/ModalSheet.js.map +1 -0
- package/dist/dist/NumberPickerActionSheet.d.ts +5 -0
- package/dist/dist/NumberPickerActionSheet.js +25 -0
- package/dist/dist/NumberPickerActionSheet.js.map +1 -0
- package/dist/dist/Page.d.ts +9 -0
- package/dist/dist/Page.js +26 -0
- package/dist/dist/Page.js.map +1 -0
- package/dist/dist/Permissions.d.ts +1 -0
- package/dist/dist/Permissions.js +36 -0
- package/dist/dist/Permissions.js.map +1 -0
- package/dist/dist/PickerSelect.d.ts +172 -0
- package/dist/dist/PickerSelect.js +403 -0
- package/dist/dist/PickerSelect.js.map +1 -0
- package/dist/dist/Pill.d.ts +7 -0
- package/dist/dist/Pill.js +10 -0
- package/dist/dist/Pill.js.map +1 -0
- package/dist/dist/Pill.stories.d.ts +1 -0
- package/dist/dist/Pill.stories.js +36 -0
- package/dist/dist/Pill.stories.js.map +1 -0
- package/dist/dist/Pog.d.ts +7 -0
- package/dist/dist/Pog.js +144 -0
- package/dist/dist/Pog.js.map +1 -0
- package/dist/dist/ProgressBar.d.ts +16 -0
- package/dist/dist/ProgressBar.js +40 -0
- package/dist/dist/ProgressBar.js.map +1 -0
- package/dist/dist/ScrollView.d.ts +1 -0
- package/dist/dist/ScrollView.js +4 -0
- package/dist/dist/ScrollView.js.map +1 -0
- package/dist/dist/SegmentedControl.d.ts +9 -0
- package/dist/dist/SegmentedControl.js +18 -0
- package/dist/dist/SegmentedControl.js.map +1 -0
- package/dist/dist/SegmentedControl.stories.d.ts +1 -0
- package/dist/dist/SegmentedControl.stories.js +32 -0
- package/dist/dist/SegmentedControl.stories.js.map +1 -0
- package/dist/dist/SelectList.d.ts +9 -0
- package/dist/dist/SelectList.js +29 -0
- package/dist/dist/SelectList.js.map +1 -0
- package/dist/dist/SelectList.stories.d.ts +1 -0
- package/dist/dist/SelectList.stories.js +24 -0
- package/dist/dist/SelectList.stories.js.map +1 -0
- package/dist/dist/Spinner.d.ts +44 -0
- package/dist/dist/Spinner.js +58 -0
- package/dist/dist/Spinner.js.map +1 -0
- package/dist/dist/Spinner.stories.d.ts +1 -0
- package/dist/dist/Spinner.stories.js +10 -0
- package/dist/dist/Spinner.stories.js.map +1 -0
- package/dist/dist/SplitPage.d.ts +7 -0
- package/dist/dist/SplitPage.js +20 -0
- package/dist/dist/SplitPage.js.map +1 -0
- package/dist/dist/SplitPage.stories.d.ts +1 -0
- package/dist/dist/SplitPage.stories.js +7 -0
- package/dist/dist/SplitPage.stories.js.map +1 -0
- package/dist/dist/StorybookContainer.d.ts +7 -0
- package/dist/dist/StorybookContainer.js +9 -0
- package/dist/dist/StorybookContainer.js.map +1 -0
- package/dist/dist/Switch.d.ts +6 -0
- package/dist/dist/Switch.js +10 -0
- package/dist/dist/Switch.js.map +1 -0
- package/dist/dist/Switch.stories.d.ts +1 -0
- package/dist/dist/Switch.stories.js +27 -0
- package/dist/dist/Switch.stories.js.map +1 -0
- package/dist/dist/TapToEdit.d.ts +9 -0
- package/dist/dist/TapToEdit.js +27 -0
- package/dist/dist/TapToEdit.js.map +1 -0
- package/dist/dist/Text.d.ts +36 -0
- package/dist/dist/Text.js +86 -0
- package/dist/dist/Text.js.map +1 -0
- package/dist/dist/Text.stories.d.ts +1 -0
- package/dist/dist/Text.stories.js +13 -0
- package/dist/dist/Text.stories.js.map +1 -0
- package/dist/dist/TextArea.d.ts +6 -0
- package/dist/dist/TextArea.js +13 -0
- package/dist/dist/TextArea.js.map +1 -0
- package/dist/dist/TextArea.stories.d.ts +12 -0
- package/dist/dist/TextArea.stories.js +21 -0
- package/dist/dist/TextArea.stories.js.map +1 -0
- package/dist/dist/TextField.d.ts +47 -0
- package/dist/dist/TextField.js +199 -0
- package/dist/dist/TextField.js.map +1 -0
- package/dist/dist/TextField.stories.d.ts +6 -0
- package/dist/dist/TextField.stories.js +15 -0
- package/dist/dist/TextField.stories.js.map +1 -0
- package/dist/dist/TextFieldNumberActionSheet.d.ts +5 -0
- package/dist/dist/TextFieldNumberActionSheet.js +24 -0
- package/dist/dist/TextFieldNumberActionSheet.js.map +1 -0
- package/dist/dist/UnifiedScreens.d.ts +2 -0
- package/dist/dist/UnifiedScreens.js +26 -0
- package/dist/dist/UnifiedScreens.js.map +1 -0
- package/dist/dist/Unifier.d.ts +131 -0
- package/dist/dist/Unifier.js +198 -0
- package/dist/dist/Unifier.js.map +1 -0
- package/dist/dist/Utilities.d.ts +51 -0
- package/dist/dist/Utilities.js +77 -0
- package/dist/dist/Utilities.js.map +1 -0
- package/dist/dist/WithLabel.d.ts +6 -0
- package/dist/dist/WithLabel.js +23 -0
- package/dist/dist/WithLabel.js.map +1 -0
- package/dist/dist/index.d.ts +43 -0
- package/dist/dist/index.js +49 -0
- package/dist/dist/index.js.map +1 -0
- package/dist/index.d.ts +1284 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/package.json +197 -0
- package/src/ActionSheet.tsx +1234 -0
- package/src/Banner.tsx +124 -0
- package/src/BlurBox.native.tsx +40 -0
- package/src/BlurBox.tsx +31 -0
- package/src/Body.tsx +32 -0
- package/src/Box.tsx +277 -0
- package/src/Button.tsx +139 -0
- package/src/Card.tsx +23 -0
- package/src/CheckBox.tsx +93 -0
- package/src/Common.ts +1376 -0
- package/src/DateTimeActionSheet.tsx +61 -0
- package/src/DecimalRangeActionSheet.tsx +113 -0
- package/src/ErrorBoundary.tsx +39 -0
- package/src/ErrorPage.tsx +44 -0
- package/src/Field.tsx +194 -0
- package/src/FieldWithLabels.tsx +36 -0
- package/src/FlatList.tsx +2 -0
- package/src/Form.tsx +182 -0
- package/src/HeaderButtons.tsx +107 -0
- package/src/Heading.tsx +53 -0
- package/src/HeightActionSheet.tsx +104 -0
- package/src/Icon.tsx +139 -0
- package/src/IconButton.tsx +52 -0
- package/src/Image.tsx +50 -0
- package/src/ImageBackground.tsx +13 -0
- package/src/Layer.tsx +17 -0
- package/src/Link.tsx +17 -0
- package/src/Mask.tsx +24 -0
- package/src/MediaQuery.ts +28 -0
- package/src/Meta.tsx +9 -0
- package/src/ModalSheet.tsx +58 -0
- package/src/NumberPickerActionSheet.tsx +66 -0
- package/src/Page.tsx +134 -0
- package/src/Permissions.ts +44 -0
- package/src/PickerSelect.tsx +673 -0
- package/src/Pill.tsx +24 -0
- package/src/Pog.tsx +211 -0
- package/src/ProgressBar.tsx +55 -0
- package/src/ScrollView.tsx +2 -0
- package/src/SegmentedControl.tsx +51 -0
- package/src/SelectList.tsx +48 -0
- package/src/Spinner.tsx +69 -0
- package/src/SplitPage.tsx +115 -0
- package/src/Switch.tsx +19 -0
- package/src/TapToEdit.tsx +48 -0
- package/src/Text.tsx +92 -0
- package/src/TextArea.tsx +15 -0
- package/src/TextField.tsx +291 -0
- package/src/TextFieldNumberActionSheet.tsx +61 -0
- package/src/UnifiedScreens.ts +24 -0
- package/src/Unifier.ts +268 -0
- package/src/Utilities.tsx +161 -0
- package/src/WithLabel.tsx +46 -0
- package/src/index.tsx +1332 -0
- package/src/polyfill.d.ts +11 -0
- package/tsconfig.json +29 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {Box} from "./Box";
|
|
4
|
+
import {Button} from "./Button";
|
|
5
|
+
import {BackButtonInterface, SearchButtonProps} from "./Common";
|
|
6
|
+
import {IconButton} from "./IconButton";
|
|
7
|
+
import {Text} from "./Text";
|
|
8
|
+
import {Unifier} from "./Unifier";
|
|
9
|
+
|
|
10
|
+
interface HeaderButtonProps {
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
text: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface HeaderButtonState {}
|
|
16
|
+
|
|
17
|
+
export class HeaderButton extends React.Component<HeaderButtonProps, HeaderButtonState> {
|
|
18
|
+
constructor(props: HeaderButtonProps) {
|
|
19
|
+
super(props);
|
|
20
|
+
this.state = {};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
render() {
|
|
24
|
+
return (
|
|
25
|
+
<Box marginRight={2}>
|
|
26
|
+
<Button color="primary" text={this.props.text} type="ghost" onClick={this.props.onClick} />
|
|
27
|
+
</Box>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class SearchButton extends React.Component<SearchButtonProps, {}> {
|
|
33
|
+
render() {
|
|
34
|
+
return (
|
|
35
|
+
<Box>
|
|
36
|
+
<IconButton
|
|
37
|
+
accessibilityLabel="search"
|
|
38
|
+
icon="search"
|
|
39
|
+
iconColor={this.props.color || "white"}
|
|
40
|
+
prefix="fas"
|
|
41
|
+
onClick={this.props.onClick}
|
|
42
|
+
/>
|
|
43
|
+
</Box>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export class BackButton extends React.Component<BackButtonInterface, {}> {
|
|
49
|
+
render() {
|
|
50
|
+
return (
|
|
51
|
+
<Box alignItems="center" justifyContent="center" paddingX={3} width={50}>
|
|
52
|
+
<IconButton
|
|
53
|
+
accessibilityLabel=""
|
|
54
|
+
icon="chevron-left"
|
|
55
|
+
iconColor="white"
|
|
56
|
+
prefix="fas"
|
|
57
|
+
size="md"
|
|
58
|
+
onClick={() => this.props.onBack && this.props.onBack()}
|
|
59
|
+
/>
|
|
60
|
+
</Box>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class FilterButton extends React.Component<SearchButtonProps, {}> {
|
|
66
|
+
render() {
|
|
67
|
+
return <Button color="white" text="Filter" type="ghost" onClick={this.props.onClick} />;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class EditButton extends React.Component<SearchButtonProps, {}> {
|
|
72
|
+
render() {
|
|
73
|
+
return (
|
|
74
|
+
<IconButton
|
|
75
|
+
accessibilityLabel="edit"
|
|
76
|
+
icon="pen"
|
|
77
|
+
iconColor={this.props.color}
|
|
78
|
+
prefix="fas"
|
|
79
|
+
onClick={this.props.onClick}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class UseButton extends React.Component<SearchButtonProps, {}> {
|
|
86
|
+
render() {
|
|
87
|
+
return (
|
|
88
|
+
<Button
|
|
89
|
+
text="Use"
|
|
90
|
+
onClick={() => {
|
|
91
|
+
Unifier.utils.haptic();
|
|
92
|
+
this.props.onClick();
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export class AddTabButton extends React.Component<SearchButtonProps, {}> {
|
|
100
|
+
render() {
|
|
101
|
+
return (
|
|
102
|
+
<Box color="blue" height={62} width={62} onClick={this.props.onClick}>
|
|
103
|
+
<Text color="darkGray">Add</Text>
|
|
104
|
+
</Box>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
}
|
package/src/Heading.tsx
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Text as NativeText} from "react-native";
|
|
3
|
+
|
|
4
|
+
import {HeadingProps} from "./Common";
|
|
5
|
+
import {Unifier} from "./Unifier";
|
|
6
|
+
|
|
7
|
+
export class Heading extends React.Component<HeadingProps, {}> {
|
|
8
|
+
fontSizes = {
|
|
9
|
+
sm: 20,
|
|
10
|
+
md: 28,
|
|
11
|
+
lg: 36,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
propsToStyle(): any {
|
|
15
|
+
const style: any = {};
|
|
16
|
+
|
|
17
|
+
// let font = this.props.font || "primary";
|
|
18
|
+
// if (this.props.bold) {
|
|
19
|
+
// font += "Bold";
|
|
20
|
+
// }
|
|
21
|
+
style.fontFamily = Unifier.theme.primaryBoldFont;
|
|
22
|
+
|
|
23
|
+
style.fontSize = this.fontSizes[this.props.size || "md"];
|
|
24
|
+
if (this.props.align) {
|
|
25
|
+
style.textAlign = this.props.align;
|
|
26
|
+
}
|
|
27
|
+
if (this.props.color) {
|
|
28
|
+
style.color = Unifier.theme[this.props.color];
|
|
29
|
+
} else {
|
|
30
|
+
style.color = Unifier.theme.darkGray;
|
|
31
|
+
}
|
|
32
|
+
// TODO: might be useful for wrapping/truncating
|
|
33
|
+
// if (this.props.numberOfLines !== 1 && !this.props.inline) {
|
|
34
|
+
// style.flexWrap = "wrap";
|
|
35
|
+
// }
|
|
36
|
+
|
|
37
|
+
return style;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render() {
|
|
41
|
+
const lines = 0;
|
|
42
|
+
// if (this.props.numberOfLines) {
|
|
43
|
+
// lines = this.props.numberOfLines;
|
|
44
|
+
// } else if (this.props.inline) {
|
|
45
|
+
// lines = 1;
|
|
46
|
+
// }
|
|
47
|
+
return (
|
|
48
|
+
<NativeText numberOfLines={lines} style={this.propsToStyle()}>
|
|
49
|
+
{this.props.children}
|
|
50
|
+
</NativeText>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {Picker} from "@react-native-picker/picker";
|
|
2
|
+
import range from "lodash/range";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
import {ActionSheet} from "./ActionSheet";
|
|
6
|
+
import {Box} from "./Box";
|
|
7
|
+
import {Button} from "./Button";
|
|
8
|
+
import {OnChangeCallback} from "./Common";
|
|
9
|
+
|
|
10
|
+
const PICKER_HEIGHT = 104;
|
|
11
|
+
|
|
12
|
+
interface HeightActionSheetProps {
|
|
13
|
+
value?: string;
|
|
14
|
+
onChange: OnChangeCallback;
|
|
15
|
+
actionSheetRef: React.RefObject<any>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface HeightActionSheetState {
|
|
19
|
+
feet: string;
|
|
20
|
+
inches: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class HeightActionSheet extends React.Component<
|
|
24
|
+
HeightActionSheetProps,
|
|
25
|
+
HeightActionSheetState
|
|
26
|
+
> {
|
|
27
|
+
constructor(props: HeightActionSheetProps) {
|
|
28
|
+
super(props);
|
|
29
|
+
this.state = {
|
|
30
|
+
feet: String(Math.floor(Number(props.value) / 12)),
|
|
31
|
+
inches: String(Number(props.value) % 12),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
return (
|
|
37
|
+
<ActionSheet ref={this.props.actionSheetRef} bounceOnOpen gestureEnabled>
|
|
38
|
+
<Box marginBottom={8} paddingX={4} width="100%">
|
|
39
|
+
<Box alignItems="end" display="flex" width="100%">
|
|
40
|
+
<Box width="33%">
|
|
41
|
+
<Button
|
|
42
|
+
color="blue"
|
|
43
|
+
size="lg"
|
|
44
|
+
text="Close"
|
|
45
|
+
type="ghost"
|
|
46
|
+
onClick={() => {
|
|
47
|
+
this.props.actionSheetRef?.current?.setModalVisible(false);
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
</Box>
|
|
51
|
+
</Box>
|
|
52
|
+
<Box direction="row" width="100%">
|
|
53
|
+
<Box width="50%">
|
|
54
|
+
<Picker
|
|
55
|
+
itemStyle={{
|
|
56
|
+
height: PICKER_HEIGHT,
|
|
57
|
+
}}
|
|
58
|
+
selectedValue={this.state.feet}
|
|
59
|
+
style={{
|
|
60
|
+
height: PICKER_HEIGHT,
|
|
61
|
+
backgroundColor: "#FFFFFF",
|
|
62
|
+
}}
|
|
63
|
+
onValueChange={(feet) => {
|
|
64
|
+
this.setState({feet: String(feet)});
|
|
65
|
+
this.props.onChange({
|
|
66
|
+
value: String(Number(feet) * 12 + Number(this.state.inches)),
|
|
67
|
+
});
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{range(4, 8).map((n) => {
|
|
71
|
+
// console.log("FIRST", String(n));
|
|
72
|
+
return <Picker.Item key={String(n)} label={`${String(n)}ft`} value={String(n)} />;
|
|
73
|
+
})}
|
|
74
|
+
</Picker>
|
|
75
|
+
</Box>
|
|
76
|
+
<Box width="50%">
|
|
77
|
+
<Picker
|
|
78
|
+
itemStyle={{
|
|
79
|
+
height: PICKER_HEIGHT,
|
|
80
|
+
}}
|
|
81
|
+
selectedValue={this.state.inches}
|
|
82
|
+
style={{
|
|
83
|
+
height: PICKER_HEIGHT,
|
|
84
|
+
backgroundColor: "#FFFFFF",
|
|
85
|
+
}}
|
|
86
|
+
onValueChange={(inches) => {
|
|
87
|
+
this.setState({inches: String(inches)});
|
|
88
|
+
this.props.onChange({
|
|
89
|
+
value: String(Number(this.state.feet) * 12 + Number(inches)),
|
|
90
|
+
});
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
{range(0, 12).map((n) => {
|
|
94
|
+
// console.log("N", n);
|
|
95
|
+
return <Picker.Item key={String(n)} label={`${String(n)}in`} value={String(n)} />;
|
|
96
|
+
})}
|
|
97
|
+
</Picker>
|
|
98
|
+
</Box>
|
|
99
|
+
</Box>
|
|
100
|
+
</Box>
|
|
101
|
+
</ActionSheet>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
}
|
package/src/Icon.tsx
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import {FontAwesome} from "@expo/vector-icons";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import {iconNumberToSize, IconProps, iconSizeToNumber} from "./Common";
|
|
5
|
+
// import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
|
6
|
+
// // import {library} from "@fortawesome/fontawesome-svg-core";
|
|
7
|
+
// import {library} from "@fortawesome/fontawesome-svg-core";
|
|
8
|
+
// // import {fal as proFal} from "@fortawesome/pro-light-svg-icons";
|
|
9
|
+
// import {
|
|
10
|
+
// faHeart as farHeart,
|
|
11
|
+
// // faPlus as farPlus,
|
|
12
|
+
// faEdit as farEdit,
|
|
13
|
+
// faNewspaper as farNewspaper,
|
|
14
|
+
// } from "@fortawesome/free-regular-svg-icons";
|
|
15
|
+
// import {
|
|
16
|
+
// faChevronLeft,
|
|
17
|
+
// faEnvelopeOpen,
|
|
18
|
+
// faCarrot,
|
|
19
|
+
// faComment,
|
|
20
|
+
// faUserCircle,
|
|
21
|
+
// faSearch,
|
|
22
|
+
// faChevronRight,
|
|
23
|
+
// faEllipsisV,
|
|
24
|
+
// faPaperPlane,
|
|
25
|
+
// faExclamationCircle,
|
|
26
|
+
// faMailBulk,
|
|
27
|
+
// faTrashAlt,
|
|
28
|
+
// faTrashRestoreAlt,
|
|
29
|
+
// faEnvelope,
|
|
30
|
+
// faSpinner,
|
|
31
|
+
// } from "@fortawesome/free-solid-svg-icons";
|
|
32
|
+
import {Unifier} from "./Unifier";
|
|
33
|
+
// library.add(
|
|
34
|
+
// farHeart,
|
|
35
|
+
// // farPlus,
|
|
36
|
+
// farEdit,
|
|
37
|
+
// farNewspaper,
|
|
38
|
+
// faChevronLeft,
|
|
39
|
+
// faCarrot,
|
|
40
|
+
// faComment,
|
|
41
|
+
// faUserCircle,
|
|
42
|
+
// faEnvelopeOpen,
|
|
43
|
+
// faSearch,
|
|
44
|
+
// faChevronRight,
|
|
45
|
+
// faEllipsisV,
|
|
46
|
+
// faPaperPlane,
|
|
47
|
+
// faExclamationCircle,
|
|
48
|
+
// faMailBulk,
|
|
49
|
+
// faTrashAlt,
|
|
50
|
+
// faTrashRestoreAlt,
|
|
51
|
+
// faEnvelope,
|
|
52
|
+
// faSpinner
|
|
53
|
+
// );
|
|
54
|
+
|
|
55
|
+
export function initIcons() {
|
|
56
|
+
console.debug("Initializing icons");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const iconSet = new Set();
|
|
60
|
+
|
|
61
|
+
function addIcon(icon: string, prefix = "far") {
|
|
62
|
+
const prev = new Set(iconSet);
|
|
63
|
+
iconSet.add(`${prefix}-${icon}`);
|
|
64
|
+
if (
|
|
65
|
+
prev.size !== iconSet.size &&
|
|
66
|
+
(!process.env.NODE_ENV || process.env.NODE_ENV === "development")
|
|
67
|
+
) {
|
|
68
|
+
console.debug("[Icon] current icon set:", iconSet);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class Icon extends React.Component<IconProps, {}> {
|
|
73
|
+
render() {
|
|
74
|
+
addIcon(this.props.name, this.props.prefix);
|
|
75
|
+
const color = Unifier.theme[this.props.color || "primary"];
|
|
76
|
+
let size: string = iconNumberToSize(this.props.size);
|
|
77
|
+
if (size === "xl") {
|
|
78
|
+
size = "2x";
|
|
79
|
+
} else if (size === "md") {
|
|
80
|
+
size = "1x";
|
|
81
|
+
}
|
|
82
|
+
return <FontAwesome color={color} icon={this.props.name as any} size={size as any} />;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export class IconExpo extends React.Component<IconProps, {}> {
|
|
87
|
+
render() {
|
|
88
|
+
const color = Unifier.theme[this.props.color || "primary"];
|
|
89
|
+
// Standardize the size (pretty hacky..)
|
|
90
|
+
const size = iconSizeToNumber(iconNumberToSize(this.props.size));
|
|
91
|
+
return (
|
|
92
|
+
<FontAwesome
|
|
93
|
+
color={color}
|
|
94
|
+
icon={[this.props.prefix || "far", this.props.name as any]}
|
|
95
|
+
size={size}
|
|
96
|
+
/>
|
|
97
|
+
);
|
|
98
|
+
// const {name, prefix} = this.props;
|
|
99
|
+
// const color = Unifier.theme[this.props.color || "primary"];
|
|
100
|
+
// const size = this.props.size;
|
|
101
|
+
|
|
102
|
+
// const map = {
|
|
103
|
+
// fapro: FAPro,
|
|
104
|
+
// fas: FAIcon,
|
|
105
|
+
// fa: FAIcon,
|
|
106
|
+
// fal: FAIcon,
|
|
107
|
+
// "fa-brand": FAIcon,
|
|
108
|
+
// ant: AntDesignIcon,
|
|
109
|
+
// entypo: EntypoIcon,
|
|
110
|
+
// evil: EvilIcons,
|
|
111
|
+
// material: MaterialIcons,
|
|
112
|
+
// "material-community": MaterialCommunityIcons,
|
|
113
|
+
// ionicon: Ionicons,
|
|
114
|
+
// octicon: Octicons,
|
|
115
|
+
// zocial: Zocial,
|
|
116
|
+
// "simple-line": SimpleLineIcons,
|
|
117
|
+
// feather: Feather,
|
|
118
|
+
// };
|
|
119
|
+
// const Component: any = map[prefix];
|
|
120
|
+
// if (!Component) {
|
|
121
|
+
// console.warn(`[icons] could not find icon: ${prefix}:${name}`);
|
|
122
|
+
// return null;
|
|
123
|
+
// }
|
|
124
|
+
|
|
125
|
+
// if (["fapro", "fal", "fa", "fas", "fa-brand"].indexOf(this.props.prefix) > -1) {
|
|
126
|
+
// return (
|
|
127
|
+
// <Component
|
|
128
|
+
// solid={this.props.prefix === "fas"}
|
|
129
|
+
// light={this.props.prefix === "fal"}
|
|
130
|
+
// brand={this.props.prefix === "fa-brand"}
|
|
131
|
+
// name={name}
|
|
132
|
+
// color={color}
|
|
133
|
+
// size={size}
|
|
134
|
+
// />
|
|
135
|
+
// );
|
|
136
|
+
// }
|
|
137
|
+
// return <Component name={name} color={color} size={size} />;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {TouchableOpacity} from "react-native";
|
|
3
|
+
|
|
4
|
+
import {IconButtonProps, iconSizeToNumber} from "./Common";
|
|
5
|
+
import {Icon} from "./Icon";
|
|
6
|
+
import {Unifier} from "./Unifier";
|
|
7
|
+
|
|
8
|
+
export class IconButton extends React.Component<IconButtonProps, {}> {
|
|
9
|
+
render() {
|
|
10
|
+
let opacity = 1;
|
|
11
|
+
let color;
|
|
12
|
+
if (this.props.bgColor === "transparentDarkGray") {
|
|
13
|
+
opacity = 0.8;
|
|
14
|
+
color = Unifier.theme.darkGray;
|
|
15
|
+
} else if (this.props.bgColor === "transparent" || !this.props.bgColor) {
|
|
16
|
+
opacity = 0.0;
|
|
17
|
+
color = Unifier.theme.white;
|
|
18
|
+
} else {
|
|
19
|
+
color = Unifier.theme[this.props.bgColor];
|
|
20
|
+
}
|
|
21
|
+
return (
|
|
22
|
+
<TouchableOpacity
|
|
23
|
+
hitSlop={{top: 10, left: 10, bottom: 10, right: 10}}
|
|
24
|
+
style={{
|
|
25
|
+
opacity,
|
|
26
|
+
backgroundColor: color,
|
|
27
|
+
borderRadius: 100,
|
|
28
|
+
// paddingBottom: iconSizeToNumber(this.props.size) / 4,
|
|
29
|
+
// paddingTop: iconSizeToNumber(this.props.size) / 4,
|
|
30
|
+
// paddingLeft: iconSizeToNumber(this.props.size) / 2,
|
|
31
|
+
// paddingRight: iconSizeToNumber(this.props.size) / 2,
|
|
32
|
+
width: iconSizeToNumber(this.props.size) * 2.5,
|
|
33
|
+
height: iconSizeToNumber(this.props.size) * 2.5,
|
|
34
|
+
display: "flex",
|
|
35
|
+
justifyContent: "center",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
}}
|
|
38
|
+
onPress={() => {
|
|
39
|
+
Unifier.utils.haptic();
|
|
40
|
+
this.props.onClick();
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<Icon
|
|
44
|
+
color={this.props.iconColor}
|
|
45
|
+
name={this.props.icon}
|
|
46
|
+
prefix={this.props.prefix || "fas"}
|
|
47
|
+
size={iconSizeToNumber(this.props.size)}
|
|
48
|
+
/>
|
|
49
|
+
</TouchableOpacity>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
package/src/Image.tsx
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Dimensions, Image as NativeImage} from "react-native";
|
|
3
|
+
|
|
4
|
+
import {Box} from "./Box";
|
|
5
|
+
import {ImageProps} from "./Common";
|
|
6
|
+
const {width: DEVICE_WIDTH} = Dimensions.get("window");
|
|
7
|
+
|
|
8
|
+
export class Image extends React.Component<ImageProps, {}> {
|
|
9
|
+
resizeMode = (fit?: "cover" | "contain" | "none") => {
|
|
10
|
+
if (!fit || fit === "none") {
|
|
11
|
+
return undefined;
|
|
12
|
+
} else {
|
|
13
|
+
return fit;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
width = () => {
|
|
18
|
+
if (this.props.naturalWidth) {
|
|
19
|
+
return this.props.naturalWidth;
|
|
20
|
+
} else if (this.props.fullWidth) {
|
|
21
|
+
return DEVICE_WIDTH;
|
|
22
|
+
}
|
|
23
|
+
throw new Error("Width required for Image");
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
height = () => {
|
|
27
|
+
if (this.props.naturalWidth) {
|
|
28
|
+
return this.props.naturalWidth;
|
|
29
|
+
}
|
|
30
|
+
return this.width() * (9 / 16);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
render() {
|
|
34
|
+
return (
|
|
35
|
+
<Box color={this.props.color}>
|
|
36
|
+
<NativeImage
|
|
37
|
+
resizeMode={this.resizeMode(this.props.fit)}
|
|
38
|
+
source={{uri: this.props.src, cache: "force-cache"}}
|
|
39
|
+
style={{
|
|
40
|
+
height: this.height(),
|
|
41
|
+
width: this.width(),
|
|
42
|
+
maxHeight: this.props.maxHeight,
|
|
43
|
+
maxWidth: this.props.maxWidth,
|
|
44
|
+
...this.props.style,
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
</Box>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {ImageBackground as ImageBackgroundNative} from "react-native";
|
|
3
|
+
|
|
4
|
+
interface ImageBackgroundProps {
|
|
5
|
+
style?: any;
|
|
6
|
+
source: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export class ImageBackground extends React.Component<ImageBackgroundProps, {}> {
|
|
10
|
+
render() {
|
|
11
|
+
return <ImageBackgroundNative {...this.props} />;
|
|
12
|
+
}
|
|
13
|
+
}
|
package/src/Layer.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {LayerProps} from "./Common";
|
|
4
|
+
|
|
5
|
+
interface LayerState {}
|
|
6
|
+
|
|
7
|
+
// TODO: Flesh out for native.
|
|
8
|
+
export class Layer extends React.Component<LayerProps, LayerState> {
|
|
9
|
+
constructor(props: LayerProps) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
render() {
|
|
15
|
+
return this.props.children;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/Link.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {LinkProps} from "./Common";
|
|
4
|
+
import {Text} from "./Text";
|
|
5
|
+
|
|
6
|
+
interface LinkState {}
|
|
7
|
+
|
|
8
|
+
export class Link extends React.Component<LinkProps, LinkState> {
|
|
9
|
+
constructor(props: LinkProps) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
render() {
|
|
15
|
+
return <Text>{this.props.children}</Text>;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/Mask.tsx
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {MaskProps} from "./Common";
|
|
4
|
+
|
|
5
|
+
export class Mask extends React.Component<MaskProps, {}> {
|
|
6
|
+
render() {
|
|
7
|
+
// if (this.props.shape === "rounded") {
|
|
8
|
+
// return <Box style={{overflow: "hidden", borderRadius: 12}}>{this.props.children}</Box>;
|
|
9
|
+
// } else if (this.props.shape === "circle") {
|
|
10
|
+
// return <Box style={{overflow: "hidden", borderRadius: 1000}}>{this.props.children}</Box>;
|
|
11
|
+
// }
|
|
12
|
+
// if (this.props.rounding) {
|
|
13
|
+
// let rounding = this.props.rounding === "circle" ? 100 : this.props.rounding;
|
|
14
|
+
// // Subtract 1 from rounding because of some very odd rendering.
|
|
15
|
+
// return (
|
|
16
|
+
// // <View style={{borderRadius: (rounding - 1) * 4, overflow: "visible"}}>
|
|
17
|
+
// <View>{this.props.children}</View>
|
|
18
|
+
// // </View>
|
|
19
|
+
// );
|
|
20
|
+
// } else {
|
|
21
|
+
return this.props.children;
|
|
22
|
+
// }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {Dimensions} from "react-native";
|
|
2
|
+
|
|
3
|
+
export function mediaQuery(): "xs" | "sm" | "md" | "lg" {
|
|
4
|
+
const width = Dimensions.get("window").width;
|
|
5
|
+
if (width < 576) {
|
|
6
|
+
return "xs";
|
|
7
|
+
} else if (width < 768) {
|
|
8
|
+
return "sm";
|
|
9
|
+
} else if (width < 1312) {
|
|
10
|
+
return "md";
|
|
11
|
+
} else {
|
|
12
|
+
return "lg";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function mediaQueryLargerThan(size: "xs" | "sm" | "md" | "lg"): boolean {
|
|
17
|
+
const media = mediaQuery();
|
|
18
|
+
if (size === "xs") {
|
|
19
|
+
return true;
|
|
20
|
+
} else if (size === "sm") {
|
|
21
|
+
return ["sm", "md", "lg"].includes(media);
|
|
22
|
+
} else if (size === "md") {
|
|
23
|
+
return ["md", "lg"].includes(media);
|
|
24
|
+
} else if (size === "lg") {
|
|
25
|
+
return ["lg"].includes(media);
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
package/src/Meta.tsx
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* eslint-disable react/display-name */
|
|
2
|
+
import React, {forwardRef, useEffect, useRef} from "react";
|
|
3
|
+
import {Animated} from "react-native";
|
|
4
|
+
import {Modalize} from "react-native-modalize";
|
|
5
|
+
import {Portal} from "react-native-portalize";
|
|
6
|
+
|
|
7
|
+
export const useCombinedRefs = (...refs: any) => {
|
|
8
|
+
const targetRef = useRef();
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
refs.forEach((ref: any) => {
|
|
12
|
+
if (!ref) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (typeof ref === "function") {
|
|
17
|
+
ref(targetRef.current);
|
|
18
|
+
} else {
|
|
19
|
+
ref.current = targetRef.current;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}, [refs]);
|
|
23
|
+
|
|
24
|
+
return targetRef;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
interface Props {
|
|
28
|
+
children: any;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const SimpleContent = forwardRef((props: Props, ref) => {
|
|
32
|
+
const modalizeRef = useRef(null);
|
|
33
|
+
const combinedRef = useCombinedRefs(ref, modalizeRef);
|
|
34
|
+
const animated = useRef(new Animated.Value(0)).current;
|
|
35
|
+
|
|
36
|
+
// const renderHeader = () => (
|
|
37
|
+
// <Box paddingY={4} marginTop={4} marginBottom={4}>
|
|
38
|
+
// <Text>50 users online</Text>
|
|
39
|
+
// </Box>
|
|
40
|
+
// );
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Portal>
|
|
44
|
+
<Modalize
|
|
45
|
+
// HeaderComponent={renderHeader}
|
|
46
|
+
ref={combinedRef}
|
|
47
|
+
adjustToContentHeight
|
|
48
|
+
panGestureAnimatedValue={animated}
|
|
49
|
+
scrollViewProps={{
|
|
50
|
+
showsVerticalScrollIndicator: false,
|
|
51
|
+
stickyHeaderIndices: [0],
|
|
52
|
+
}}
|
|
53
|
+
>
|
|
54
|
+
{props.children}
|
|
55
|
+
</Modalize>
|
|
56
|
+
</Portal>
|
|
57
|
+
);
|
|
58
|
+
});
|