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
package/src/Pog.tsx
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import {Box} from "./Box";
|
|
5
|
+
import {AllColors, IconPrefix, IconSize} from "./Common";
|
|
6
|
+
import {Icon} from "./Icon";
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
Originally based on https://github.com/pinterest/gestalt
|
|
10
|
+
Forked, added type definitions, and added features.
|
|
11
|
+
*/
|
|
12
|
+
// TOOD: create styles
|
|
13
|
+
// :root {
|
|
14
|
+
// --lightGray: #efefef;
|
|
15
|
+
// --gray: #8e8e8e;
|
|
16
|
+
// --darkGray: #111;
|
|
17
|
+
// }
|
|
18
|
+
|
|
19
|
+
// .pog {
|
|
20
|
+
// composes: circle from "./Borders.module.css";
|
|
21
|
+
// composes: flex from "./Layout.module.css";
|
|
22
|
+
// composes: itemsCenter from "./Layout.module.css";
|
|
23
|
+
// composes: justifyCenter from "./Layout.module.css";
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
// .focused {
|
|
27
|
+
// composes: accessibilityOutlineFocus from "./Focus.module.css";
|
|
28
|
+
// }
|
|
29
|
+
|
|
30
|
+
// .selected {
|
|
31
|
+
// composes: darkGrayBg from "./Colors.module.css";
|
|
32
|
+
// }
|
|
33
|
+
|
|
34
|
+
// .transparent {
|
|
35
|
+
// composes: transparentBg from "./Colors.module.css";
|
|
36
|
+
// }
|
|
37
|
+
|
|
38
|
+
// .transparentDarkGray {
|
|
39
|
+
// composes: transparentDarkGrayBg from "./Colors.module.css";
|
|
40
|
+
// }
|
|
41
|
+
|
|
42
|
+
// .transparent.hovered,
|
|
43
|
+
// .transparent.focused,
|
|
44
|
+
// .white.hovered,
|
|
45
|
+
// .white.focused {
|
|
46
|
+
// background-color: rgba(0, 0, 0, 0.06);
|
|
47
|
+
// }
|
|
48
|
+
|
|
49
|
+
// .transparent.active,
|
|
50
|
+
// .white.active {
|
|
51
|
+
// background-color: rgba(0, 0, 0, 0.1);
|
|
52
|
+
// }
|
|
53
|
+
|
|
54
|
+
// .transparentDarkGray.hovered,
|
|
55
|
+
// .transparentDarkGray.focused {
|
|
56
|
+
// background-color: var(--darkGray);
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
// .transparentDarkGray.active {
|
|
60
|
+
// background-color: var(--darkGray);
|
|
61
|
+
// }
|
|
62
|
+
|
|
63
|
+
// .white {
|
|
64
|
+
// composes: whiteBg from "./Colors.module.css";
|
|
65
|
+
// }
|
|
66
|
+
|
|
67
|
+
// .white.hovered,
|
|
68
|
+
// .white.focused {
|
|
69
|
+
// background-color: #f0f0f0;
|
|
70
|
+
// }
|
|
71
|
+
|
|
72
|
+
// .white.active {
|
|
73
|
+
// background-color: #e5e5e5;
|
|
74
|
+
// }
|
|
75
|
+
|
|
76
|
+
// .lightGray {
|
|
77
|
+
// composes: lightGrayBg from "./Colors.module.css";
|
|
78
|
+
// }
|
|
79
|
+
|
|
80
|
+
// .lightGray.hovered,
|
|
81
|
+
// .lightGray.focused {
|
|
82
|
+
// background-color: #e2e2e2;
|
|
83
|
+
// }
|
|
84
|
+
|
|
85
|
+
// .lightGray.active {
|
|
86
|
+
// background-color: #dadada;
|
|
87
|
+
// }
|
|
88
|
+
|
|
89
|
+
// .gray {
|
|
90
|
+
// composes: grayBg from "./Colors.module.css";
|
|
91
|
+
// }
|
|
92
|
+
|
|
93
|
+
// .gray.hovered,
|
|
94
|
+
// .gray.focused {
|
|
95
|
+
// background-color: #878787;
|
|
96
|
+
// }
|
|
97
|
+
|
|
98
|
+
// .gray.active {
|
|
99
|
+
// background-color: #828282;
|
|
100
|
+
// }
|
|
101
|
+
|
|
102
|
+
// .darkGray {
|
|
103
|
+
// composes: darkGrayBg from "./Colors.module.css";
|
|
104
|
+
// }
|
|
105
|
+
|
|
106
|
+
// .blue {
|
|
107
|
+
// composes: blueBg from "./Colors.module.css";
|
|
108
|
+
// }
|
|
109
|
+
|
|
110
|
+
// .blue.hovered,
|
|
111
|
+
// .blue.focused {
|
|
112
|
+
// background-color: #4a8ad4;
|
|
113
|
+
// }
|
|
114
|
+
|
|
115
|
+
// .blue.active {
|
|
116
|
+
// background-color: #4a85c9;
|
|
117
|
+
// }
|
|
118
|
+
|
|
119
|
+
const styles = {
|
|
120
|
+
pog: "",
|
|
121
|
+
selected: "",
|
|
122
|
+
active: "",
|
|
123
|
+
focused: "",
|
|
124
|
+
hovered: "",
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const SIZE_NAME_TO_PIXEL = {
|
|
128
|
+
xs: 24,
|
|
129
|
+
sm: 32,
|
|
130
|
+
md: 40,
|
|
131
|
+
lg: 48,
|
|
132
|
+
xl: 56,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
// type PogColor = "gray" | "darkGray" | "red" | "blue" | "white" | "orange";
|
|
136
|
+
interface Props {
|
|
137
|
+
active?: boolean;
|
|
138
|
+
bgColor?: "transparent" | "transparentDarkGray" | "gray" | "lightGray" | "white" | "blue";
|
|
139
|
+
focused?: boolean;
|
|
140
|
+
hovered?: boolean;
|
|
141
|
+
selected?: boolean;
|
|
142
|
+
iconColor?: AllColors;
|
|
143
|
+
icon: string;
|
|
144
|
+
iconPrefix?: IconPrefix;
|
|
145
|
+
size?: IconSize;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const defaultIconButtonIconColors = {
|
|
149
|
+
blue: "white",
|
|
150
|
+
darkGray: "white",
|
|
151
|
+
gray: "white",
|
|
152
|
+
lightGray: "gray",
|
|
153
|
+
transparent: "gray",
|
|
154
|
+
transparentDarkGray: "white",
|
|
155
|
+
white: "gray",
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export default function Pog(props: Props) {
|
|
159
|
+
const {
|
|
160
|
+
active = false,
|
|
161
|
+
bgColor = "transparent",
|
|
162
|
+
focused = false,
|
|
163
|
+
hovered = false,
|
|
164
|
+
iconColor,
|
|
165
|
+
icon,
|
|
166
|
+
iconPrefix = "fas",
|
|
167
|
+
selected = false,
|
|
168
|
+
size = "md",
|
|
169
|
+
} = props;
|
|
170
|
+
|
|
171
|
+
const iconSize = SIZE_NAME_TO_PIXEL[size] / 2;
|
|
172
|
+
const color =
|
|
173
|
+
(selected && "white") ||
|
|
174
|
+
iconColor ||
|
|
175
|
+
(defaultIconButtonIconColors[bgColor] as AllColors) ||
|
|
176
|
+
"white";
|
|
177
|
+
|
|
178
|
+
const inlineStyle = {
|
|
179
|
+
height: SIZE_NAME_TO_PIXEL[size],
|
|
180
|
+
width: SIZE_NAME_TO_PIXEL[size],
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// const classes = classnames(styles.pog, {
|
|
184
|
+
// [styles[bgColor]]: !selected,
|
|
185
|
+
// [styles.selected]: selected,
|
|
186
|
+
// [styles.active]: active,
|
|
187
|
+
// [styles.focused]: focused,
|
|
188
|
+
// [styles.hovered]: hovered && !focused && !active,
|
|
189
|
+
// });
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<div style={inlineStyle}>
|
|
193
|
+
<Box rounding="circle">
|
|
194
|
+
{/*
|
|
195
|
+
We're explicitly setting an empty string as a label on the Icon since we
|
|
196
|
+
already have an aria-label on the button container.
|
|
197
|
+
This is similar to having empty `alt` attributes:
|
|
198
|
+
https://davidwalsh.name/accessibility-tip-empty-alt-attributes
|
|
199
|
+
*/}
|
|
200
|
+
<Icon
|
|
201
|
+
// accessibilityLabel=""
|
|
202
|
+
color={color}
|
|
203
|
+
// dangerouslySetSvgPath={dangerouslySetSvgPath}
|
|
204
|
+
name={icon}
|
|
205
|
+
prefix={iconPrefix}
|
|
206
|
+
size={iconSize}
|
|
207
|
+
/>
|
|
208
|
+
</Box>
|
|
209
|
+
</div>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {View} from "react-native";
|
|
3
|
+
|
|
4
|
+
import {ProgressBarProps} from "./Common";
|
|
5
|
+
import {Unifier} from "./Unifier";
|
|
6
|
+
|
|
7
|
+
interface ProgressBarState {}
|
|
8
|
+
|
|
9
|
+
export class ProgressBar extends React.Component<ProgressBarProps, ProgressBarState> {
|
|
10
|
+
constructor(props: ProgressBarProps) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.state = {};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
render() {
|
|
16
|
+
// console.log("PROGRESS", Unifier.theme[this.props.color], `${this.props.completed / 100}%`);
|
|
17
|
+
return (
|
|
18
|
+
<View
|
|
19
|
+
style={{
|
|
20
|
+
width: "100%",
|
|
21
|
+
height: 6,
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
<View
|
|
25
|
+
style={{
|
|
26
|
+
width: "100%",
|
|
27
|
+
position: "absolute",
|
|
28
|
+
top: 0,
|
|
29
|
+
left: 0,
|
|
30
|
+
height: 6,
|
|
31
|
+
borderRadius: 6,
|
|
32
|
+
borderWidth: 1,
|
|
33
|
+
borderColor: Unifier.theme[this.props.color],
|
|
34
|
+
backgroundColor: Unifier.theme[this.props.color],
|
|
35
|
+
opacity: 0.3,
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
<View
|
|
39
|
+
style={{
|
|
40
|
+
width: `${Math.min(this.props.completed / 100, 1) * 100}%`,
|
|
41
|
+
position: "absolute",
|
|
42
|
+
top: 0,
|
|
43
|
+
left: 0,
|
|
44
|
+
height: 6,
|
|
45
|
+
borderRadius: 6,
|
|
46
|
+
borderWidth: 1,
|
|
47
|
+
borderColor: Unifier.theme[this.props.color],
|
|
48
|
+
backgroundColor: Unifier.theme[this.props.color],
|
|
49
|
+
opacity: 1,
|
|
50
|
+
}}
|
|
51
|
+
/>
|
|
52
|
+
</View>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {Box} from "./Box";
|
|
4
|
+
import {SegmentedControlProps} from "./Common";
|
|
5
|
+
import {Text} from "./Text";
|
|
6
|
+
|
|
7
|
+
export class SegmentedControl extends React.Component<SegmentedControlProps, {}> {
|
|
8
|
+
renderItem(item: string | React.ReactNode) {
|
|
9
|
+
return <Text weight="bold">{item}</Text>;
|
|
10
|
+
// if (typeof item === "string") {
|
|
11
|
+
// return <Text weight="bold">{item}</Text>;
|
|
12
|
+
// } else {
|
|
13
|
+
// return item;
|
|
14
|
+
// }
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
return (
|
|
19
|
+
<Box
|
|
20
|
+
color="lightGray"
|
|
21
|
+
direction="row"
|
|
22
|
+
display="flex"
|
|
23
|
+
height={40}
|
|
24
|
+
padding={1}
|
|
25
|
+
rounding={3}
|
|
26
|
+
width="100%"
|
|
27
|
+
>
|
|
28
|
+
{this.props.items.map((item, index) => (
|
|
29
|
+
<Box
|
|
30
|
+
key={index}
|
|
31
|
+
color={this.props.selectedItemIndex === index ? "white" : "lightGray"}
|
|
32
|
+
height="100%"
|
|
33
|
+
rounding={3}
|
|
34
|
+
width={`${100 / this.props.items.length}%`}
|
|
35
|
+
>
|
|
36
|
+
<Box
|
|
37
|
+
alignItems="center"
|
|
38
|
+
display="flex"
|
|
39
|
+
height="100%"
|
|
40
|
+
justifyContent="center"
|
|
41
|
+
width="100%"
|
|
42
|
+
onClick={() => this.props.onChange({activeIndex: index})}
|
|
43
|
+
>
|
|
44
|
+
{this.renderItem(item)}
|
|
45
|
+
</Box>
|
|
46
|
+
</Box>
|
|
47
|
+
))}
|
|
48
|
+
</Box>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {FieldWithLabelsProps} from "./Common";
|
|
4
|
+
import RNPickerSelect from "./PickerSelect";
|
|
5
|
+
import {Unifier} from "./Unifier";
|
|
6
|
+
|
|
7
|
+
export type SelectListOptions = {label: string; value: string | undefined}[];
|
|
8
|
+
export interface SelectListProps extends FieldWithLabelsProps {
|
|
9
|
+
id?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
options: SelectListOptions;
|
|
12
|
+
onChange: (value: string) => void;
|
|
13
|
+
value?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
size?: "md" | "lg";
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class SelectList extends React.Component<SelectListProps, {}> {
|
|
20
|
+
state = {showing: false};
|
|
21
|
+
|
|
22
|
+
render() {
|
|
23
|
+
return (
|
|
24
|
+
<RNPickerSelect
|
|
25
|
+
items={this.props.options}
|
|
26
|
+
placeholder={{}}
|
|
27
|
+
style={{
|
|
28
|
+
viewContainer: {
|
|
29
|
+
flexDirection: "row",
|
|
30
|
+
justifyContent: "center",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
minHeight: 50,
|
|
33
|
+
width: "100%",
|
|
34
|
+
// Add padding so the border doesn't mess up layouts
|
|
35
|
+
paddingHorizontal: 6,
|
|
36
|
+
paddingVertical: 4,
|
|
37
|
+
borderColor: Unifier.theme.gray,
|
|
38
|
+
borderWidth: 1,
|
|
39
|
+
borderRadius: 5,
|
|
40
|
+
backgroundColor: Unifier.theme.white,
|
|
41
|
+
},
|
|
42
|
+
}}
|
|
43
|
+
value={this.props.value}
|
|
44
|
+
onValueChange={this.props.onChange}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/Spinner.tsx
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {ActivityIndicator, View} from "react-native";
|
|
3
|
+
|
|
4
|
+
import {SpinnerProps} from "./Common";
|
|
5
|
+
import {Unifier} from "./Unifier";
|
|
6
|
+
|
|
7
|
+
export class LoadingOverlay extends React.Component<SpinnerProps, {}> {
|
|
8
|
+
componentId?: string = undefined;
|
|
9
|
+
|
|
10
|
+
async showHide() {
|
|
11
|
+
if (this.componentId) {
|
|
12
|
+
try {
|
|
13
|
+
await Unifier.navigation.dismissOverlay();
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.debug(`[spinner] could not dismiss spinner overlay`, e);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
componentDidMount() {
|
|
21
|
+
this.showHide();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
componentDidUpdate() {
|
|
25
|
+
this.showHide();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
componentWillUnmount() {
|
|
29
|
+
this.showHide();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
render() {
|
|
33
|
+
return (
|
|
34
|
+
<View
|
|
35
|
+
style={{
|
|
36
|
+
width: "100%",
|
|
37
|
+
height: "100%",
|
|
38
|
+
flex: 1,
|
|
39
|
+
justifyContent: "center",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
backgroundColor: Unifier.theme.white,
|
|
42
|
+
opacity: 0.5,
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<Spinner />
|
|
46
|
+
</View>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface SpinnerState {
|
|
52
|
+
show: boolean;
|
|
53
|
+
}
|
|
54
|
+
export class Spinner extends React.Component<SpinnerProps, SpinnerState> {
|
|
55
|
+
state = {show: false};
|
|
56
|
+
|
|
57
|
+
// The delay is for perceived performance so you should rarely need to remove it.
|
|
58
|
+
componentDidMount() {
|
|
59
|
+
setTimeout(() => this.setState({show: true}), 300);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
render() {
|
|
63
|
+
if (!this.state.show) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
const size: "small" | "large" = this.props.size === "sm" ? "small" : "large";
|
|
67
|
+
return <ActivityIndicator color={this.props.color || "darkGray"} size={size} />;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {ListRenderItemInfo, View} from "react-native";
|
|
3
|
+
|
|
4
|
+
import {Box} from "./Box";
|
|
5
|
+
import {Color} from "./Common";
|
|
6
|
+
import {ErrorBoundary} from "./ErrorBoundary";
|
|
7
|
+
import {FlatList} from "./FlatList";
|
|
8
|
+
import {Icon} from "./Icon";
|
|
9
|
+
import {IconButton} from "./IconButton";
|
|
10
|
+
import {mediaQueryLargerThan} from "./MediaQuery";
|
|
11
|
+
import {Spinner} from "./Spinner";
|
|
12
|
+
import {Unifier} from "./Unifier";
|
|
13
|
+
|
|
14
|
+
interface SplitPageProps {
|
|
15
|
+
// TODO: figure out navigation
|
|
16
|
+
navigation: any;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
color?: Color;
|
|
19
|
+
keyboardOffset?: number;
|
|
20
|
+
rightButton?: string;
|
|
21
|
+
rightButtonOnClick?: () => void;
|
|
22
|
+
renderListViewItem: (itemInfo: ListRenderItemInfo<any>) => React.ReactElement | null;
|
|
23
|
+
renderListViewHeader?: () => React.ReactElement | null;
|
|
24
|
+
renderContent: (index?: number) => React.ReactElement | null;
|
|
25
|
+
listViewData: any[];
|
|
26
|
+
listViewExtraData?: any;
|
|
27
|
+
listViewWidth?: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface SplitPageState {
|
|
31
|
+
selectedId?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// A component for rendering a list on one side and a details view on the right for large screens,
|
|
35
|
+
// and a scrollable list where clicking an item takes you the details view.
|
|
36
|
+
export class SplitPage extends React.Component<SplitPageProps, SplitPageState> {
|
|
37
|
+
state = {selectedId: undefined};
|
|
38
|
+
|
|
39
|
+
actionSheetRef: React.RefObject<any> = React.createRef();
|
|
40
|
+
|
|
41
|
+
renderItem = (itemInfo: ListRenderItemInfo<any>) => {
|
|
42
|
+
return (
|
|
43
|
+
<Box
|
|
44
|
+
onClick={() => {
|
|
45
|
+
this.setState({selectedId: itemInfo.index});
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
{this.props.renderListViewItem(itemInfo)}
|
|
49
|
+
</Box>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
renderList = () => {
|
|
54
|
+
if (!mediaQueryLargerThan("sm") && this.state.selectedId) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return (
|
|
58
|
+
<View
|
|
59
|
+
style={{
|
|
60
|
+
width: mediaQueryLargerThan("sm") ? this.props.listViewWidth ?? 300 : "100%",
|
|
61
|
+
maxWidth: mediaQueryLargerThan("sm") ? this.props.listViewWidth ?? 300 : "100%",
|
|
62
|
+
flexGrow: 1,
|
|
63
|
+
flexShrink: 0,
|
|
64
|
+
display: "flex",
|
|
65
|
+
flexDirection: "column",
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{this.props.renderListViewHeader && this.props.renderListViewHeader()}
|
|
69
|
+
<FlatList
|
|
70
|
+
data={this.props.listViewData}
|
|
71
|
+
extraData={this.props.listViewExtraData}
|
|
72
|
+
keyExtractor={(item) => item.id}
|
|
73
|
+
renderItem={this.renderItem}
|
|
74
|
+
/>
|
|
75
|
+
</View>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
renderListContent = () => {
|
|
80
|
+
return (
|
|
81
|
+
<Box flex="grow" padding={2}>
|
|
82
|
+
{!mediaQueryLargerThan("sm") && (
|
|
83
|
+
<Box width="100%">
|
|
84
|
+
<IconButton
|
|
85
|
+
accessibilityLabel="close"
|
|
86
|
+
icon="times"
|
|
87
|
+
iconColor="darkGray"
|
|
88
|
+
onClick={() => this.setState({selectedId: undefined})}
|
|
89
|
+
/>
|
|
90
|
+
</Box>
|
|
91
|
+
)}
|
|
92
|
+
{this.props.renderContent(this.state.selectedId)}
|
|
93
|
+
</Box>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
render() {
|
|
98
|
+
return (
|
|
99
|
+
<Box
|
|
100
|
+
avoidKeyboard
|
|
101
|
+
color={this.props.color || "lightGray"}
|
|
102
|
+
direction="row"
|
|
103
|
+
display="flex"
|
|
104
|
+
flex="grow"
|
|
105
|
+
height="100%"
|
|
106
|
+
keyboardOffset={this.props.keyboardOffset}
|
|
107
|
+
width="100%"
|
|
108
|
+
>
|
|
109
|
+
{this.props.loading === true && <Spinner color={Unifier.theme.darkGray as any} size="md" />}
|
|
110
|
+
{this.renderList()}
|
|
111
|
+
{this.renderListContent()}
|
|
112
|
+
</Box>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
}
|
package/src/Switch.tsx
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {Switch as NativeSwitch} from "react-native";
|
|
3
|
+
|
|
4
|
+
import {SwitchProps} from "./Common";
|
|
5
|
+
import {WithLabel} from "./WithLabel";
|
|
6
|
+
|
|
7
|
+
export class Switch extends React.Component<SwitchProps, {}> {
|
|
8
|
+
render() {
|
|
9
|
+
return (
|
|
10
|
+
<WithLabel labelInline labelJustifyContent="between" {...this.props}>
|
|
11
|
+
<NativeSwitch
|
|
12
|
+
disabled={this.props.disabled}
|
|
13
|
+
value={this.props.switched}
|
|
14
|
+
onValueChange={this.props.onChange}
|
|
15
|
+
/>
|
|
16
|
+
</WithLabel>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import {Box} from "./Box";
|
|
4
|
+
import {Button} from "./Button";
|
|
5
|
+
import {TextFieldProps} from "./Common";
|
|
6
|
+
import {Icon} from "./Icon";
|
|
7
|
+
import {Text} from "./Text";
|
|
8
|
+
import {TextField} from "./TextField";
|
|
9
|
+
|
|
10
|
+
interface TapToEditState {
|
|
11
|
+
showEdit: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class TapToEdit extends React.Component<TextFieldProps, TapToEditState> {
|
|
15
|
+
state = {showEdit: false};
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
if (!this.state.showEdit) {
|
|
19
|
+
return (
|
|
20
|
+
<Box direction="row" display="flex" onClick={() => this.setState({showEdit: true})}>
|
|
21
|
+
<Box marginRight={2}>
|
|
22
|
+
<Icon color="primaryDark" name="edit" prefix="far" size={20} />
|
|
23
|
+
</Box>
|
|
24
|
+
<Text>{this.props.children}</Text>
|
|
25
|
+
</Box>
|
|
26
|
+
);
|
|
27
|
+
} else {
|
|
28
|
+
return (
|
|
29
|
+
<Box>
|
|
30
|
+
<TextField {...this.props} />
|
|
31
|
+
<Box paddingY={1} width={100}>
|
|
32
|
+
<Button
|
|
33
|
+
color="primary"
|
|
34
|
+
inline
|
|
35
|
+
text="Save"
|
|
36
|
+
onClick={() => {
|
|
37
|
+
this.setState({showEdit: false});
|
|
38
|
+
if (this.props.onSubmitEditing) {
|
|
39
|
+
this.props.onSubmitEditing();
|
|
40
|
+
}
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
</Box>
|
|
44
|
+
</Box>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|