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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SplitPage } from "./SplitPage";
|
|
3
|
+
import { Text } from "./Text";
|
|
4
|
+
import { storiesOf } from "@storybook/react-native";
|
|
5
|
+
import { Box } from "./Box";
|
|
6
|
+
storiesOf("Split Page", module).add("Split", () => (React.createElement(SplitPage, { navigation: {}, listViewWidth: 250, renderListViewItem: (item) => (React.createElement(Box, { color: "blue", padding: 2 },
|
|
7
|
+
React.createElement(Text, null,
|
|
8
|
+
"name: ",
|
|
9
|
+
item.item.name))), renderListViewHeader: () => (React.createElement(Box, { padding: 2, color: "red" },
|
|
10
|
+
React.createElement(Text, { weight: "bold" }, "Users:"))), listViewData: Array.from(Array(100).keys()).map((i) => ({ name: `user${i}` })), renderContent: (index) => (React.createElement(Box, { padding: 2, color: "lightGray" },
|
|
11
|
+
index === undefined && React.createElement(Text, { weight: "bold" }, "Nothing selected"),
|
|
12
|
+
index !== undefined && React.createElement(Text, { weight: "bold" },
|
|
13
|
+
"User ",
|
|
14
|
+
index))) })));
|
|
15
|
+
//# sourceMappingURL=SplitPage.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplitPage.stories.js","sourceRoot":"","sources":["../unifier/SplitPage.stories.tsx"],"names":[],"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K,CAAQ,CAC3D,CACP,GACD,CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Box } from "./Box";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export class StorybookContainer extends React.Component {
|
|
4
|
+
render() {
|
|
5
|
+
return (React.createElement(Box, { width: "100%", height: "100%", display: "flex", direction: "column", padding: 8, scroll: true }, this.props.children));
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=StorybookContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorybookContainer.js","sourceRoot":"","sources":["../src/StorybookContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,OAAO,kBAAmB,SAAQ,KAAK,CAAC,SAAmB;IAC/D,MAAM;QACJ,OAAO,CACL,oBAAC,GAAG,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,IACvF,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACP,CAAC;IACJ,CAAC;CACF"}
|
package/dist/Switch.d.ts
ADDED
package/dist/Switch.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Switch as NativeSwitch } from "react-native";
|
|
3
|
+
import { WithLabel } from "./WithLabel";
|
|
4
|
+
export class Switch extends React.Component {
|
|
5
|
+
render() {
|
|
6
|
+
return (React.createElement(WithLabel, Object.assign({ labelInline: true, labelJustifyContent: "between" }, this.props),
|
|
7
|
+
React.createElement(NativeSwitch, { disabled: this.props.disabled, value: this.props.switched, onValueChange: this.props.onChange })));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.js","sourceRoot":"","sources":["../src/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,MAAM,OAAO,MAAO,SAAQ,KAAK,CAAC,SAA0B;IAC1D,MAAM;QACJ,OAAO,CACL,oBAAC,SAAS,kBAAC,WAAW,QAAC,mBAAmB,EAAC,SAAS,IAAK,IAAI,CAAC,KAAK;YACjE,oBAAC,YAAY,IACX,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAC1B,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAClC,CACQ,CACb,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Switch } from "./Switch";
|
|
2
|
+
import { storiesOf } from "@storybook/react-native";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Box } from "./Box";
|
|
5
|
+
import { WithLabel } from "./WithLabel";
|
|
6
|
+
import { StorybookContainer } from "./StorybookContainer";
|
|
7
|
+
class SwitchForms extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
this.state = {
|
|
11
|
+
boolean: false,
|
|
12
|
+
withLabel: false,
|
|
13
|
+
primary: false,
|
|
14
|
+
small: false,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
return (React.createElement(StorybookContainer, null,
|
|
19
|
+
React.createElement(Box, { width: "100%", height: "100%", display: "flex", direction: "column" },
|
|
20
|
+
React.createElement(Switch, { id: "check", switched: this.state.boolean, onChange: (result) => this.setState({ boolean: result }) }),
|
|
21
|
+
React.createElement(WithLabel, { label: "With A Label" },
|
|
22
|
+
React.createElement(Switch, { id: "withLabel", switched: this.state.withLabel, onChange: (result) => this.setState({ withLabel: result }) })),
|
|
23
|
+
React.createElement(WithLabel, { label: "Primary Color" },
|
|
24
|
+
React.createElement(Switch, { id: "primary", switched: this.state.primary, label: "Primary Color",
|
|
25
|
+
// color="primary"
|
|
26
|
+
labelColor: "primary", onChange: (result) => this.setState({ primary: result }) })),
|
|
27
|
+
React.createElement(WithLabel, { label: "Small" },
|
|
28
|
+
React.createElement(Switch, { id: "small", switched: this.state.small, label: "Small",
|
|
29
|
+
// size="sm"
|
|
30
|
+
onChange: (result) => this.setState({ small: result }) })))));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
storiesOf("Switch", module).add("Switch", () => React.createElement(SwitchForms, null));
|
|
34
|
+
//# sourceMappingURL=Switch.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.stories.js","sourceRoot":"","sources":["../unifier/Switch.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AASxD,MAAM,WAAY,SAAQ,KAAK,CAAC,SAAoB;IAClD,YAAY,KAAU;QACpB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACX,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,KAAK;YAChB,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK;SACb,CAAC;IACJ,CAAC;IAED,MAAM;QACJ,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,CACQ,CACR,CACa,CACtB,CAAC;IACJ,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,oBAAC,WAAW,OAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextFieldProps } from "./Common";
|
|
3
|
+
interface TapToEditState {
|
|
4
|
+
showEdit: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class TapToEdit extends React.Component<TextFieldProps, TapToEditState> {
|
|
7
|
+
state: {
|
|
8
|
+
showEdit: boolean;
|
|
9
|
+
};
|
|
10
|
+
render(): JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box } from "./Box";
|
|
3
|
+
import { Button } from "./Button";
|
|
4
|
+
import { Icon } from "./Icon";
|
|
5
|
+
import { Text } from "./Text";
|
|
6
|
+
import { TextField } from "./TextField";
|
|
7
|
+
export class TapToEdit extends React.Component {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.state = { showEdit: false };
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
13
|
+
if (!this.state.showEdit) {
|
|
14
|
+
return (React.createElement(Box, { direction: "row", display: "flex", onClick: () => this.setState({ showEdit: true }) },
|
|
15
|
+
React.createElement(Box, { marginRight: 2 },
|
|
16
|
+
React.createElement(Icon, { color: "primaryDark", name: "edit", prefix: "far", size: 20 })),
|
|
17
|
+
React.createElement(Text, null, this.props.children)));
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return (React.createElement(Box, null,
|
|
21
|
+
React.createElement(TextField, Object.assign({}, this.props)),
|
|
22
|
+
React.createElement(Box, { paddingY: 1, width: 100 },
|
|
23
|
+
React.createElement(Button, { color: "primary", inline: true, text: "Save", onClick: () => {
|
|
24
|
+
this.setState({ showEdit: false });
|
|
25
|
+
if (this.props.onSubmitEditing) {
|
|
26
|
+
this.props.onSubmitEditing();
|
|
27
|
+
}
|
|
28
|
+
} }))));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=TapToEdit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TapToEdit.js","sourceRoot":"","sources":["../src/TapToEdit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAMtC,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,SAAyC;IAA9E;;QACE,UAAK,GAAG,EAAC,QAAQ,EAAE,KAAK,EAAC,CAAC;IAiC5B,CAAC;IA/BC,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACxB,OAAO,CACL,oBAAC,GAAG,IAAC,SAAS,EAAC,KAAK,EAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;gBAChF,oBAAC,GAAG,IAAC,WAAW,EAAE,CAAC;oBACjB,oBAAC,IAAI,IAAC,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,IAAI,EAAE,EAAE,GAAI,CAC3D;gBACN,oBAAC,IAAI,QAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAQ,CAC9B,CACP,CAAC;SACH;aAAM;YACL,OAAO,CACL,oBAAC,GAAG;gBACF,oBAAC,SAAS,oBAAK,IAAI,CAAC,KAAK,EAAI;gBAC7B,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG;oBAC1B,oBAAC,MAAM,IACL,KAAK,EAAC,SAAS,EACf,MAAM,QACN,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,GAAG,EAAE;4BACZ,IAAI,CAAC,QAAQ,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAC;4BACjC,IAAI,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;gCAC9B,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;6BAC9B;wBACH,CAAC,GACD,CACE,CACF,CACP,CAAC;SACH;IACH,CAAC;CACF"}
|
package/dist/Text.d.ts
ADDED
package/dist/Text.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Text as NativeText } from "react-native";
|
|
3
|
+
import Hyperlink from "react-native-hyperlink";
|
|
4
|
+
import { Unifier } from "./Unifier";
|
|
5
|
+
export class Text extends React.Component {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.fontSizes = {
|
|
9
|
+
sm: 12,
|
|
10
|
+
md: 14,
|
|
11
|
+
lg: 16,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
propsToStyle() {
|
|
15
|
+
const style = {};
|
|
16
|
+
let font = "primaryFont";
|
|
17
|
+
if (this.props.font === "primary") {
|
|
18
|
+
if (this.props.weight === "bold") {
|
|
19
|
+
font = "primaryBoldFont";
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
font = "primaryFont";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
else if (this.props.font === "secondary") {
|
|
26
|
+
if (this.props.weight === "bold") {
|
|
27
|
+
font = "secondaryBoldFont";
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
font = "secondaryFont";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else if (this.props.font === "button") {
|
|
34
|
+
font = "buttonFont";
|
|
35
|
+
}
|
|
36
|
+
else if (this.props.font === "title") {
|
|
37
|
+
font = "titleFont";
|
|
38
|
+
}
|
|
39
|
+
else if (this.props.font === "accent") {
|
|
40
|
+
if (this.props.weight === "bold") {
|
|
41
|
+
font = "accentBoldFont";
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
font = "accentFont";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
style.fontFamily = Unifier.theme[font];
|
|
48
|
+
style.fontSize = this.fontSizes[this.props.size || "md"];
|
|
49
|
+
if (this.props.align) {
|
|
50
|
+
style.textAlign = this.props.align;
|
|
51
|
+
}
|
|
52
|
+
if (this.props.color) {
|
|
53
|
+
style.color = Unifier.theme[this.props.color];
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
style.color = Unifier.theme.darkGray;
|
|
57
|
+
}
|
|
58
|
+
// TODO: might be useful for wrapping/truncating
|
|
59
|
+
// if (this.props.numberOfLines !== 1 && !this.props.inline) {
|
|
60
|
+
// style.flexWrap = "wrap";
|
|
61
|
+
// }
|
|
62
|
+
return style;
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
let lines = 0;
|
|
66
|
+
if (this.props.numberOfLines) {
|
|
67
|
+
lines = this.props.numberOfLines;
|
|
68
|
+
}
|
|
69
|
+
else if (this.props.inline) {
|
|
70
|
+
lines = 1;
|
|
71
|
+
}
|
|
72
|
+
const inner = (React.createElement(NativeText, { numberOfLines: lines, style: this.propsToStyle() }, this.props.children));
|
|
73
|
+
if (this.props.skipLinking) {
|
|
74
|
+
return inner;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return (
|
|
78
|
+
// <Hyperlink linkDefault={true} linkStyle={{textDecorationLine: "underline"}}>
|
|
79
|
+
// {inner}
|
|
80
|
+
// </Hyperlink>
|
|
81
|
+
React.createElement(Hyperlink, { linkDefault: true }, inner));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=Text.js.map
|
package/dist/Text.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../src/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,IAAI,UAAU,EAAC,MAAM,cAAc,CAAC;AAChD,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAG/C,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,MAAM,OAAO,IAAK,SAAQ,KAAK,CAAC,SAAwB;IAAxD;;QACE,cAAS,GAAG;YACV,EAAE,EAAE,EAAE;YACN,EAAE,EAAE,EAAE;YACN,EAAE,EAAE,EAAE;SACP,CAAC;IA+EJ,CAAC;IA7EC,YAAY;QACV,MAAM,KAAK,GAAQ,EAAE,CAAC;QAEtB,IAAI,IAAI,GAQU,aAAa,CAAC;QAChC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE;YACjC,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,EAAE;gBAChC,IAAI,GAAG,iBAAiB,CAAC;aAC1B;iBAAM;gBACL,IAAI,GAAG,aAAa,CAAC;aACtB;SACF;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE;YAC1C,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,EAAE;gBAChC,IAAI,GAAG,mBAAmB,CAAC;aAC5B;iBAAM;gBACL,IAAI,GAAG,eAAe,CAAC;aACxB;SACF;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACvC,IAAI,GAAG,YAAY,CAAC;SACrB;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK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D,IAAI,CAAC,KAAK,CAAC,QAAQ,CACT,CACd,CAAC;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YAC1B,OAAO,KAAK,CAAC;SACd;aAAM;YACL,OAAO;YACL,+EAA+E;YAC/E,YAAY;YACZ,eAAe;YACf,oBAAC,SAAS,IAAC,WAAW,UAAE,KAAK,CAAa,CAC3C,CAAC;SACH;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box } from "./Box";
|
|
3
|
+
import { Text } from "./Text";
|
|
4
|
+
import { storiesOf } from "@storybook/react-native";
|
|
5
|
+
import { StorybookContainer } from "./StorybookContainer";
|
|
6
|
+
function renderText(text, props) {
|
|
7
|
+
return (React.createElement(Box, { width: "100%", paddingY: 1 },
|
|
8
|
+
React.createElement(Text, Object.assign({}, props), text)));
|
|
9
|
+
}
|
|
10
|
+
storiesOf("Text", module)
|
|
11
|
+
.add("Texts", () => (React.createElement(StorybookContainer, null,
|
|
12
|
+
React.createElement(Box, { width: "100%", height: "100%", display: "flex", direction: "column" },
|
|
13
|
+
renderText("default", {}),
|
|
14
|
+
renderText("small", { size: "sm" }),
|
|
15
|
+
renderText("large", { size: "lg" }),
|
|
16
|
+
renderText("gray", { color: "gray" }),
|
|
17
|
+
renderText("lightGray", { color: "lightGray" }),
|
|
18
|
+
renderText("primary", { color: "primary" }),
|
|
19
|
+
renderText("secondary", { color: "secondary" }),
|
|
20
|
+
renderText("tertiary", { color: "tertiary" }),
|
|
21
|
+
renderText("accent", { color: "accent" }),
|
|
22
|
+
renderText("red", { color: "red" }),
|
|
23
|
+
renderText("bold", { weight: "bold" }),
|
|
24
|
+
renderText("italic", { italic: true }),
|
|
25
|
+
renderText("center", { align: "center" })))))
|
|
26
|
+
.add("Truncate", () => (React.createElement(StorybookContainer, null,
|
|
27
|
+
React.createElement(Box, { maxWidth: 160 },
|
|
28
|
+
React.createElement(Box, { marginBottom: 2 },
|
|
29
|
+
React.createElement(Text, { weight: "bold" }, "normal:"),
|
|
30
|
+
React.createElement(Text, { overflow: "normal" }, "This is a long and Supercalifragilisticexpialidocious sentence. \u6B21\u306E\u5358\u8A9E\u30B0\u30EC\u30FC\u30C8\u30D6\u30EA\u30C6\u30F3\u304A\u3088\u3073\u5317\u30A2\u30A4\u30EB\u30E9\u30F3\u30C9\u9023\u5408\u738B\u56FD\u3067\u672C\u5F53\u306B\u5927\u304D\u306A\u8A00\u8449'")),
|
|
31
|
+
React.createElement(Box, { marginBottom: 2 },
|
|
32
|
+
React.createElement(Text, { weight: "bold" }, "breakWord:"),
|
|
33
|
+
React.createElement(Text, { overflow: "breakWord" }, "This is a long and Supercalifragilisticexpialidocious sentence. \u6B21\u306E\u5358\u8A9E\u30B0\u30EC\u30FC\u30C8\u30D6\u30EA\u30C6\u30F3\u304A\u3088\u3073\u5317\u30A2\u30A4\u30EB\u30E9\u30F3\u30C9\u9023\u5408\u738B\u56FD\u3067\u672C\u5F53\u306B\u5927\u304D\u306A\u8A00\u8449 \uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57'")),
|
|
34
|
+
React.createElement(Box, { marginBottom: 2 },
|
|
35
|
+
React.createElement(Text, { weight: "bold" }, "truncate:"),
|
|
36
|
+
React.createElement(Text, { truncate: true }, "This is a long and Supercalifragilisticexpialidocious sentence. \u6B21\u306E\u5358\u8A9E\u30B0\u30EC\u30FC\u30C8\u30D6\u30EA\u30C6\u30F3\u304A\u3088\u3073\u5317\u30A2\u30A4\u30EB\u30E9\u30F3\u30C9\u9023\u5408\u738B\u56FD\u3067\u672C\u5F53\u306B\u5927\u304D\u306A\u8A00\u8449 \uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57\uFF57'"))))));
|
|
37
|
+
//# sourceMappingURL=Text.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.stories.js","sourceRoot":"","sources":["../unifier/Text.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AACxD,SAAS,UAAU,CAAC,IAAY,EAAE,KAAyB;IACzD,OAAO,CACL,oBAAC,GAAG,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAE,CAAC;QAC3B,oBAAC,IAAI,oBAAK,KAAK,GAAG,IAAI,CAAQ,CAC1B,CACP,CAAC;AACJ,CAAC;AACD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;KACtB,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAClB,oBAAC,kBAAkB;IACjB,oBAAC,GAAG,IAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,OAAO,EAAC,MAAM,EAAC,SAAS,EAAC,QAAQ;QAC9D,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC;QACzB,UAAU,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC;QACjC,UAAU,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC;QACjC,UAAU,CAAC,MAAM,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,CAAC;QACnC,UAAU,CAAC,WAAW,EAAE,EAAC,KAAK,EAAE,WA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import React from "react";
|
|
2
|
+
import { TextField } from "./TextField";
|
|
3
|
+
export class TextArea extends React.Component {
|
|
4
|
+
constructor(props) {
|
|
5
|
+
super(props);
|
|
6
|
+
this.state = {};
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
return React.createElement(TextField, Object.assign({}, this.props, { height: 100, multiline: true, rows: 4 }));
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=TextArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../src/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC,MAAM,OAAO,QAAS,SAAQ,KAAK,CAAC,SAA4B;IAC9D,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,MAAM;QACJ,OAAO,oBAAC,SAAS,oBAAK,IAAI,CAAC,KAAK,IAAE,MAAM,EAAE,GAAG,EAAE,SAAS,QAAC,IAAI,EAAE,CAAC,IAAI,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TextArea } from "./TextArea";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: typeof TextArea;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const TextAreas: () => JSX.Element;
|
|
8
|
+
export declare const WithLabelTextArea: () => JSX.Element;
|
|
9
|
+
export declare const TextAreaDisabled: () => JSX.Element;
|
|
10
|
+
export declare const TextAreaErrored: () => JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextArea } from "./TextArea";
|
|
3
|
+
import { StorybookContainer } from "./StorybookContainer";
|
|
4
|
+
export default {
|
|
5
|
+
title: "TextArea",
|
|
6
|
+
component: TextArea,
|
|
7
|
+
};
|
|
8
|
+
export const TextAreas = () => {
|
|
9
|
+
return (React.createElement(StorybookContainer, null,
|
|
10
|
+
React.createElement(TextArea, { id: "none", onChange: () => { }, placeholder: "Here's some placeholder text." })));
|
|
11
|
+
};
|
|
12
|
+
export const WithLabelTextArea = () => {
|
|
13
|
+
return (React.createElement(StorybookContainer, null,
|
|
14
|
+
React.createElement(TextArea, { label: "Enter a bunch of text", helperText: "And some subtext", id: "none", onChange: () => { } })));
|
|
15
|
+
};
|
|
16
|
+
export const TextAreaDisabled = () => {
|
|
17
|
+
return (React.createElement(StorybookContainer, null,
|
|
18
|
+
React.createElement(TextArea, { id: "none", onChange: () => { }, disabled: true, placeholder: "This is disabled" })));
|
|
19
|
+
};
|
|
20
|
+
export const TextAreaErrored = () => {
|
|
21
|
+
return (React.createElement(StorybookContainer, null,
|
|
22
|
+
React.createElement(TextArea, { label: "Enter a bunch of text", helperText: "And some subtext", errorMessage: "There's been an error", id: "none", onChange: () => { } })));
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=TextArea.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextArea.stories.js","sourceRoot":"","sources":["../unifier/TextArea.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;AAExD,eAAe;IACb,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,QAAQ;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,CACL,oBAAC,kBAAkB;QACjB,oBAAC,QAAQ,IAAC,EAAE,EAAC,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,WAAW,EAAC,+BAA+B,GAAG,CACnE,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,CACL,oBAAC,kBAAkB;QACjB,oBAAC,QAAQ,IACP,KAAK,EAAC,uBAAuB,EAC7B,UAAU,EAAC,kBAAkB,EAC7B,EAAE,EAAC,MAAM,EACT,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,GAClB,CACiB,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE;IACnC,OAAO,CACL,oBAAC,kBAAkB;QACjB,oBAAC,QAAQ,IAAC,EAAE,EAAC,MAAM,EAAC,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAC,kBAAkB,GAAG,CACtE,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,OAAO,CACL,oBAAC,kBAAkB;QACjB,oBAAC,QAAQ,IACP,KAAK,EAAC,uBAAuB,EAC7B,UAAU,EAAC,kBAAkB,EAC7B,YAAY,EAAC,uBAAuB,EACpC,EAAE,EAAC,MAAM,EACT,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,GAClB,CACiB,CACtB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextFieldProps } from "./Common";
|
|
3
|
+
interface TextFieldState {
|
|
4
|
+
focused: boolean;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class TextField extends React.Component<TextFieldProps, TextFieldState> {
|
|
8
|
+
dateActionSheetRef: React.RefObject<any>;
|
|
9
|
+
numberRangeActionSheetRef: React.RefObject<any>;
|
|
10
|
+
decimalRangeActionSheetRef: React.RefObject<any>;
|
|
11
|
+
weightActionSheetRef: React.RefObject<any>;
|
|
12
|
+
constructor(props: TextFieldProps);
|
|
13
|
+
keyboardMap: {
|
|
14
|
+
date: string;
|
|
15
|
+
email: string;
|
|
16
|
+
number: string;
|
|
17
|
+
numberRange: string;
|
|
18
|
+
decimalRange: string;
|
|
19
|
+
decimal: string;
|
|
20
|
+
height: string;
|
|
21
|
+
password: string;
|
|
22
|
+
search: string;
|
|
23
|
+
text: string;
|
|
24
|
+
url: string | undefined;
|
|
25
|
+
username: string;
|
|
26
|
+
};
|
|
27
|
+
textContentMap: {
|
|
28
|
+
date: string;
|
|
29
|
+
email: string;
|
|
30
|
+
number: string;
|
|
31
|
+
decimal: string;
|
|
32
|
+
decimalRange: string;
|
|
33
|
+
height: string;
|
|
34
|
+
password: string;
|
|
35
|
+
search: string;
|
|
36
|
+
text: string;
|
|
37
|
+
url: string | undefined;
|
|
38
|
+
username: string;
|
|
39
|
+
};
|
|
40
|
+
renderIcon(): JSX.Element | null;
|
|
41
|
+
getBorderColor: () => string;
|
|
42
|
+
getHeight: () => number | "100%";
|
|
43
|
+
focus(): void;
|
|
44
|
+
isEditable(): boolean;
|
|
45
|
+
isHandledByModal: () => boolean;
|
|
46
|
+
render(): JSX.Element;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import moment from "moment-timezone";
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { ActivityIndicator, Platform, TextInput, View } from "react-native";
|
|
15
|
+
import { Box } from "./Box";
|
|
16
|
+
import { DateTimeActionSheet } from "./DateTimeActionSheet";
|
|
17
|
+
import { DecimalRangeActionSheet } from "./DecimalRangeActionSheet";
|
|
18
|
+
import { HeightActionSheet } from "./HeightActionSheet";
|
|
19
|
+
import { Icon } from "./Icon";
|
|
20
|
+
import { NumberPickerActionSheet } from "./NumberPickerActionSheet";
|
|
21
|
+
import { Unifier } from "./Unifier";
|
|
22
|
+
import { WithLabel } from "./WithLabel";
|
|
23
|
+
export class TextField extends React.Component {
|
|
24
|
+
constructor(props) {
|
|
25
|
+
super(props);
|
|
26
|
+
this.dateActionSheetRef = React.createRef();
|
|
27
|
+
this.numberRangeActionSheetRef = React.createRef();
|
|
28
|
+
this.decimalRangeActionSheetRef = React.createRef();
|
|
29
|
+
this.weightActionSheetRef = React.createRef();
|
|
30
|
+
this.keyboardMap = {
|
|
31
|
+
date: "default",
|
|
32
|
+
email: "email-address",
|
|
33
|
+
number: "number-pad",
|
|
34
|
+
numberRange: "number-pad",
|
|
35
|
+
decimalRange: "decimal-pad",
|
|
36
|
+
decimal: "decimal-pad",
|
|
37
|
+
height: "default",
|
|
38
|
+
password: "default",
|
|
39
|
+
search: "default",
|
|
40
|
+
text: "default",
|
|
41
|
+
url: Platform.select({
|
|
42
|
+
ios: "url",
|
|
43
|
+
android: "default",
|
|
44
|
+
}),
|
|
45
|
+
username: "default",
|
|
46
|
+
};
|
|
47
|
+
this.textContentMap = {
|
|
48
|
+
date: "none",
|
|
49
|
+
email: "emailAddress",
|
|
50
|
+
number: "none",
|
|
51
|
+
decimal: "none",
|
|
52
|
+
decimalRange: "none",
|
|
53
|
+
height: "none",
|
|
54
|
+
password: "password",
|
|
55
|
+
search: "none",
|
|
56
|
+
text: "none",
|
|
57
|
+
url: Platform.select({
|
|
58
|
+
ios: "URL",
|
|
59
|
+
android: "none",
|
|
60
|
+
}),
|
|
61
|
+
username: "username",
|
|
62
|
+
};
|
|
63
|
+
this.getBorderColor = () => {
|
|
64
|
+
if (this.props.errorMessage) {
|
|
65
|
+
return Unifier.theme.red;
|
|
66
|
+
}
|
|
67
|
+
else if (this.state.focused) {
|
|
68
|
+
return Unifier.theme.blue;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return Unifier.theme.gray;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
this.getHeight = () => {
|
|
75
|
+
if (this.props.grow) {
|
|
76
|
+
return Math.max(40, this.state.height);
|
|
77
|
+
}
|
|
78
|
+
else if (this.props.multiline) {
|
|
79
|
+
return this.props.height || "100%";
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
return 40;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
this.isHandledByModal = () => {
|
|
86
|
+
return (this.props.type === "date" ||
|
|
87
|
+
this.props.type === "numberRange" ||
|
|
88
|
+
this.props.type === "decimalRange" ||
|
|
89
|
+
this.props.type === "height");
|
|
90
|
+
};
|
|
91
|
+
this.state = { focused: false, height: props.height || 40 };
|
|
92
|
+
}
|
|
93
|
+
renderIcon() {
|
|
94
|
+
if (this.props.type !== "search") {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
if (this.props.searching === true) {
|
|
98
|
+
return (React.createElement(Box, { marginRight: 4 },
|
|
99
|
+
React.createElement(ActivityIndicator, { color: Unifier.theme.primary, size: "small" })));
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
return (React.createElement(Box, { marginRight: 2 },
|
|
103
|
+
React.createElement(Icon, { name: "search", prefix: "far", size: 14 })));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
focus() {
|
|
107
|
+
// Empty
|
|
108
|
+
}
|
|
109
|
+
isEditable() {
|
|
110
|
+
return !this.props.disabled && !this.isHandledByModal();
|
|
111
|
+
}
|
|
112
|
+
render() {
|
|
113
|
+
const type = this.props.type || "text";
|
|
114
|
+
const keyboardType = this.keyboardMap[type];
|
|
115
|
+
// let textContentType = this.textContentMap[this.props.type || "text"];
|
|
116
|
+
const _a = this.props, { errorMessage } = _a, props = __rest(_a, ["errorMessage"]);
|
|
117
|
+
let value = this.props.value;
|
|
118
|
+
if (this.props.type === "date") {
|
|
119
|
+
value = moment(this.props.value).format("MM/DD/YYYY");
|
|
120
|
+
}
|
|
121
|
+
else if (this.props.type === "height") {
|
|
122
|
+
value = `${Math.floor(Number(this.props.value) / 12)} ft, ${Number(this.props.value) % 12} in`;
|
|
123
|
+
}
|
|
124
|
+
return (React.createElement(React.Fragment, null,
|
|
125
|
+
React.createElement(WithLabel, { label: errorMessage, labelColor: this.props.errorMessageColor || "red", labelPlacement: "after", labelSize: "sm" },
|
|
126
|
+
React.createElement(WithLabel, Object.assign({}, props),
|
|
127
|
+
React.createElement(View, { style: {
|
|
128
|
+
flexDirection: "row",
|
|
129
|
+
justifyContent: "center",
|
|
130
|
+
alignItems: "center",
|
|
131
|
+
// height: 40,
|
|
132
|
+
// minHeight: this.getHeight(),
|
|
133
|
+
minHeight: this.getHeight(),
|
|
134
|
+
width: "100%",
|
|
135
|
+
// Add padding so the border doesn't mess up layouts
|
|
136
|
+
paddingHorizontal: this.props.paddingX || this.state.focused ? 10 : 14,
|
|
137
|
+
paddingVertical: this.props.paddingY || this.state.focused ? 0 : 4,
|
|
138
|
+
borderColor: this.getBorderColor(),
|
|
139
|
+
borderWidth: this.state.focused && !this.props.errorMessage ? 5 : 1,
|
|
140
|
+
borderRadius: 16,
|
|
141
|
+
backgroundColor: this.props.disabled ? Unifier.theme.gray : Unifier.theme.white,
|
|
142
|
+
overflow: "hidden",
|
|
143
|
+
}, onTouchEnd: () => {
|
|
144
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
145
|
+
if (this.props.type === "date") {
|
|
146
|
+
(_b = (_a = this.dateActionSheetRef) === null || _a === void 0 ? void 0 : _a.current) === null || _b === void 0 ? void 0 : _b.setModalVisible(true);
|
|
147
|
+
}
|
|
148
|
+
else if (this.props.type === "numberRange") {
|
|
149
|
+
(_d = (_c = this.numberRangeActionSheetRef) === null || _c === void 0 ? void 0 : _c.current) === null || _d === void 0 ? void 0 : _d.setModalVisible(true);
|
|
150
|
+
}
|
|
151
|
+
else if (this.props.type === "decimalRange") {
|
|
152
|
+
(_f = (_e = this.decimalRangeActionSheetRef) === null || _e === void 0 ? void 0 : _e.current) === null || _f === void 0 ? void 0 : _f.setModalVisible(true);
|
|
153
|
+
}
|
|
154
|
+
else if (this.props.type === "height") {
|
|
155
|
+
(_h = (_g = this.weightActionSheetRef) === null || _g === void 0 ? void 0 : _g.current) === null || _h === void 0 ? void 0 : _h.setModalVisible(true);
|
|
156
|
+
}
|
|
157
|
+
} },
|
|
158
|
+
this.renderIcon(),
|
|
159
|
+
React.createElement(TextInput, { ref: (ref) => {
|
|
160
|
+
if (this.props.inputRef) {
|
|
161
|
+
this.props.inputRef(ref);
|
|
162
|
+
}
|
|
163
|
+
}, autoCapitalize: type === "text" ? "sentences" : "none", autoFocus: this.props.autoFocus, blurOnSubmit: true,
|
|
164
|
+
// TODO: uncomment with upgrade to React 0.56.
|
|
165
|
+
// textContentType={textContentType}
|
|
166
|
+
editable: this.isEditable(), keyboardType: keyboardType, multiline: this.props.multiline, numberOfLines: this.props.rows || 4, placeholder: this.props.placeholder, placeholderTextColor: Unifier.theme.gray, returnKeyType: type === "number" || type === "decimal" ? "done" : this.props.returnKeyType, secureTextEntry: type === "password",
|
|
167
|
+
// For react-native-autofocus
|
|
168
|
+
style: Object.assign({ flex: 1, paddingTop: 10, paddingRight: 10, paddingBottom: 10, paddingLeft: 0, height: this.getHeight(), width: "100%", color: Unifier.theme.darkGray, fontFamily: Unifier.theme.primaryFont,
|
|
169
|
+
// Remove border in web.
|
|
170
|
+
outlineWidth: 0 }, this.props.style), underlineColorAndroid: "transparent", value: value, onBlur: () => {
|
|
171
|
+
if (!this.isHandledByModal()) {
|
|
172
|
+
this.setState({ focused: false });
|
|
173
|
+
}
|
|
174
|
+
if (this.props.onBlur && this.props.value) {
|
|
175
|
+
this.props.onBlur({ value: this.props.value });
|
|
176
|
+
}
|
|
177
|
+
// if (this.props.type === "date") {
|
|
178
|
+
// this.actionSheetRef?.current?.setModalVisible(false);
|
|
179
|
+
// }
|
|
180
|
+
}, onChangeText: (text) => {
|
|
181
|
+
this.props.onChange({ value: text });
|
|
182
|
+
}, onContentSizeChange: (event) => {
|
|
183
|
+
if (!this.props.grow) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
this.setState({ height: event.nativeEvent.contentSize.height });
|
|
187
|
+
}, onFocus: () => {
|
|
188
|
+
if (!this.isHandledByModal()) {
|
|
189
|
+
this.setState({ focused: true });
|
|
190
|
+
}
|
|
191
|
+
}, onSubmitEditing: () => {
|
|
192
|
+
if (this.props.onEnter) {
|
|
193
|
+
this.props.onEnter();
|
|
194
|
+
}
|
|
195
|
+
if (this.props.onSubmitEditing) {
|
|
196
|
+
this.props.onSubmitEditing();
|
|
197
|
+
}
|
|
198
|
+
} })))),
|
|
199
|
+
this.props.type === "date" && (React.createElement(DateTimeActionSheet, { actionSheetRef: this.dateActionSheetRef, mode: "date", value: this.props.value, onChange: (result) => this.props.onChange(result) })),
|
|
200
|
+
this.props.type === "numberRange" && this.props.value && (React.createElement(NumberPickerActionSheet, { actionSheetRef: this.numberRangeActionSheetRef, max: this.props.max || (this.props.min || 0) + 100, min: this.props.min || 0, value: this.props.value, onChange: (result) => this.props.onChange(result) })),
|
|
201
|
+
this.props.type === "decimalRange" && this.props.value && (React.createElement(DecimalRangeActionSheet, { actionSheetRef: this.decimalRangeActionSheetRef, max: this.props.max || (this.props.min || 0) + 100, min: this.props.min || 0, value: this.props.value, onChange: (result) => this.props.onChange(result) })),
|
|
202
|
+
this.props.type === "height" && (React.createElement(HeightActionSheet, { actionSheetRef: this.weightActionSheetRef, value: this.props.value, onChange: (result) => {
|
|
203
|
+
this.props.onChange(result);
|
|
204
|
+
} }))));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=TextField.js.map
|