@draftbit/core 50.1.2 → 50.1.3-46a10c.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Provider.js +1 -1
- package/lib/commonjs/components/AccordionGroup.js +1 -1
- package/lib/commonjs/components/BottomSheet/BottomSheet.js +1 -1
- package/lib/commonjs/components/Button.js +1 -1
- package/lib/commonjs/components/Checkbox/Checkbox.js +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePicker.js +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js +1 -1
- package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +1 -1
- package/lib/commonjs/components/Divider.js +1 -1
- package/lib/commonjs/components/Elevation.js +1 -1
- package/lib/commonjs/components/IconButton.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/index.js +1 -1
- package/lib/commonjs/components/Picker/NativePicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownModalPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownPicker.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/lib/commonjs/components/Picker/index.js +1 -1
- package/lib/commonjs/components/PinInput/PinInput.js +1 -1
- package/lib/commonjs/components/PinInput/PinInputText.js +1 -1
- package/lib/commonjs/components/Portal/Portal.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/lib/commonjs/components/Progress/CircularProgress/index.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/commonjs/components/Progress/LinearProgress/index.js +1 -1
- package/lib/commonjs/components/ProgressIndicator.js +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonRow.js +1 -1
- package/lib/commonjs/components/Row.js +1 -1
- package/lib/commonjs/components/ScreenContainer.js +1 -1
- package/lib/commonjs/components/SectionList/SectionHeader.js +1 -1
- package/lib/commonjs/components/Slider.js +1 -1
- package/lib/commonjs/components/StarRating.js +1 -1
- package/lib/commonjs/components/Stepper.js +1 -1
- package/lib/commonjs/components/Surface.js +1 -1
- package/lib/commonjs/components/SwipeableItem/SwipeableItem.js +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js +1 -1
- package/lib/commonjs/components/Switch.js +1 -1
- package/lib/commonjs/components/TabView/TabView.js +1 -1
- package/lib/commonjs/components/Table/Table.js +1 -1
- package/lib/commonjs/components/Table/TableRow.js +1 -1
- package/lib/commonjs/components/Text.js +1 -1
- package/lib/commonjs/components/TextField.js +1 -1
- package/lib/commonjs/components/TextInput.js +1 -1
- package/lib/commonjs/components/Typography.js +1 -1
- package/lib/commonjs/deprecated-components/AccordionItem.js +1 -1
- package/lib/commonjs/deprecated-components/AvatarEdit.js +1 -1
- package/lib/commonjs/deprecated-components/Banner.js +1 -1
- package/lib/commonjs/deprecated-components/Card.js +1 -1
- package/lib/commonjs/deprecated-components/Container.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedButton.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/lib/commonjs/deprecated-components/DeprecatedFAB.js +1 -1
- package/lib/commonjs/deprecated-components/FAB.js +1 -1
- package/lib/commonjs/deprecated-components/FieldSearchBarFull.js +1 -1
- package/lib/commonjs/deprecated-components/ProgressCircle.js +1 -1
- package/lib/commonjs/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/lib/commonjs/deprecated-components/RowBodyIcon.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageCaption.js +1 -1
- package/lib/commonjs/deprecated-components/RowHeadlineImageIcon.js +1 -1
- package/lib/commonjs/deprecated-components/ToggleButton.js +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/typescript/src/Provider.d.ts +7 -5
- package/lib/typescript/src/Provider.js +4 -4
- package/lib/typescript/src/Provider.js.map +1 -1
- package/lib/typescript/src/components/AccordionGroup.d.ts +3 -5
- package/lib/typescript/src/components/AccordionGroup.js +3 -3
- package/lib/typescript/src/components/AccordionGroup.js.map +1 -1
- package/lib/typescript/src/components/BottomSheet/BottomSheet.d.ts +3 -5
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js +4 -4
- package/lib/typescript/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/typescript/src/components/Button.js +8 -6
- package/lib/typescript/src/components/Button.js.map +1 -1
- package/lib/typescript/src/components/Checkbox/Checkbox.js +3 -3
- package/lib/typescript/src/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/typescript/src/components/Checkbox/CheckboxRow.d.ts +4 -2
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js +4 -3
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +3 -5
- package/lib/typescript/src/components/DatePicker/DatePicker.js +24 -23
- package/lib/typescript/src/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts +4 -12654
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.js +8 -6
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponentType.d.ts +2 -2
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +3 -5
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js +3 -3
- package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/lib/typescript/src/components/Divider.d.ts +3 -5
- package/lib/typescript/src/components/Divider.js +2 -2
- package/lib/typescript/src/components/Divider.js.map +1 -1
- package/lib/typescript/src/components/Elevation.d.ts +3 -5
- package/lib/typescript/src/components/Elevation.js +3 -4
- package/lib/typescript/src/components/Elevation.js.map +1 -1
- package/lib/typescript/src/components/FormRow.d.ts +1 -2
- package/lib/typescript/src/components/FormRow.js.map +1 -1
- package/lib/typescript/src/components/IconButton.d.ts +3 -5
- package/lib/typescript/src/components/IconButton.js +2 -2
- package/lib/typescript/src/components/IconButton.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.d.ts +0 -2
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.d.ts +5 -4
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +10 -13
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.d.ts +2 -4
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.js +1 -3
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -1
- package/lib/typescript/src/components/Picker/NativePicker.d.ts +1 -3
- package/lib/typescript/src/components/Picker/NativePicker.js +5 -2
- package/lib/typescript/src/components/Picker/NativePicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/PickerCommon.d.ts +2 -2
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.d.ts +1 -3
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js +2 -2
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.d.ts +1 -3
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js +2 -2
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.d.ts +1 -3
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/index.d.ts +1 -3
- package/lib/typescript/src/components/Picker/index.js +1 -1
- package/lib/typescript/src/components/Picker/index.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInput.d.ts +3 -5
- package/lib/typescript/src/components/PinInput/PinInput.js +4 -4
- package/lib/typescript/src/components/PinInput/PinInput.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInputText.d.ts +3 -5
- package/lib/typescript/src/components/PinInput/PinInputText.js +2 -2
- package/lib/typescript/src/components/PinInput/PinInputText.js.map +1 -1
- package/lib/typescript/src/components/Portal/Portal.d.ts +1 -9
- package/lib/typescript/src/components/Portal/Portal.js +3 -5
- package/lib/typescript/src/components/Portal/Portal.js.map +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/index.d.ts +1 -3
- package/lib/typescript/src/components/Progress/CircularProgress/index.js +1 -1
- package/lib/typescript/src/components/Progress/CircularProgress/index.js.map +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/index.d.ts +1 -3
- package/lib/typescript/src/components/Progress/LinearProgress/index.js +1 -1
- package/lib/typescript/src/components/Progress/LinearProgress/index.js.map +1 -1
- package/lib/typescript/src/components/Progress/ProgressCommon.d.ts +2 -2
- package/lib/typescript/src/components/ProgressIndicator.d.ts +10 -13
- package/lib/typescript/src/components/ProgressIndicator.js +1 -1
- package/lib/typescript/src/components/ProgressIndicator.js.map +1 -1
- package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +2 -2
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.d.ts +4 -2
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.js +4 -3
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/typescript/src/components/Row.d.ts +3 -5
- package/lib/typescript/src/components/Row.js +1 -1
- package/lib/typescript/src/components/Row.js.map +1 -1
- package/lib/typescript/src/components/ScreenContainer.d.ts +3 -6
- package/lib/typescript/src/components/ScreenContainer.js +2 -2
- package/lib/typescript/src/components/ScreenContainer.js.map +1 -1
- package/lib/typescript/src/components/SectionList/SectionHeader.d.ts +3 -5
- package/lib/typescript/src/components/SectionList/SectionHeader.js +3 -3
- package/lib/typescript/src/components/SectionList/SectionHeader.js.map +1 -1
- package/lib/typescript/src/components/Slider.d.ts +3 -6
- package/lib/typescript/src/components/Slider.js +6 -6
- package/lib/typescript/src/components/Slider.js.map +1 -1
- package/lib/typescript/src/components/StarRating.d.ts +3 -5
- package/lib/typescript/src/components/StarRating.js +1 -1
- package/lib/typescript/src/components/StarRating.js.map +1 -1
- package/lib/typescript/src/components/Stepper.d.ts +3 -5
- package/lib/typescript/src/components/Stepper.js +3 -2
- package/lib/typescript/src/components/Stepper.js.map +1 -1
- package/lib/typescript/src/components/Surface.d.ts +3 -5
- package/lib/typescript/src/components/Surface.js +3 -10
- package/lib/typescript/src/components/Surface.js.map +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.d.ts +3 -5
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js +10 -5
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +4 -2
- package/lib/typescript/src/components/Swiper/Swiper.js +3 -2
- package/lib/typescript/src/components/Swiper/Swiper.js.map +1 -1
- package/lib/typescript/src/components/Switch.d.ts +7 -24
- package/lib/typescript/src/components/Switch.js +3 -4
- package/lib/typescript/src/components/Switch.js.map +1 -1
- package/lib/typescript/src/components/TabView/TabView.d.ts +3 -5
- package/lib/typescript/src/components/TabView/TabView.js +4 -4
- package/lib/typescript/src/components/TabView/TabView.js.map +1 -1
- package/lib/typescript/src/components/Table/Table.d.ts +3 -5
- package/lib/typescript/src/components/Table/Table.js +2 -2
- package/lib/typescript/src/components/Table/Table.js.map +1 -1
- package/lib/typescript/src/components/Table/TableRow.d.ts +3 -5
- package/lib/typescript/src/components/Table/TableRow.js +4 -2
- package/lib/typescript/src/components/Table/TableRow.js.map +1 -1
- package/lib/typescript/src/components/Text.d.ts +3 -9
- package/lib/typescript/src/components/Text.js +2 -2
- package/lib/typescript/src/components/Text.js.map +1 -1
- package/lib/typescript/src/components/TextField.d.ts +4 -41
- package/lib/typescript/src/components/TextField.js +22 -20
- package/lib/typescript/src/components/TextField.js.map +1 -1
- package/lib/typescript/src/components/TextInput.js +3 -0
- package/lib/typescript/src/components/TextInput.js.map +1 -1
- package/lib/typescript/src/components/Typography.d.ts +5 -11
- package/lib/typescript/src/components/Typography.js +4 -4
- package/lib/typescript/src/components/Typography.js.map +1 -1
- package/lib/typescript/src/deprecated-components/AccordionItem.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/AccordionItem.js +2 -2
- package/lib/typescript/src/deprecated-components/AccordionItem.js.map +1 -1
- package/lib/typescript/src/deprecated-components/AvatarEdit.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/AvatarEdit.js +4 -4
- package/lib/typescript/src/deprecated-components/AvatarEdit.js.map +1 -1
- package/lib/typescript/src/deprecated-components/Banner.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/Banner.js +4 -5
- package/lib/typescript/src/deprecated-components/Banner.js.map +1 -1
- package/lib/typescript/src/deprecated-components/Card.d.ts +6 -18
- package/lib/typescript/src/deprecated-components/Card.js +3 -3
- package/lib/typescript/src/deprecated-components/Card.js.map +1 -1
- package/lib/typescript/src/deprecated-components/CheckboxGroup.d.ts +2 -2
- package/lib/typescript/src/deprecated-components/Container.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/Container.js +1 -1
- package/lib/typescript/src/deprecated-components/Container.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedButton.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/DeprecatedButton.js +8 -8
- package/lib/typescript/src/deprecated-components/DeprecatedButton.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.js +8 -8
- package/lib/typescript/src/deprecated-components/DeprecatedFAB.js.map +1 -1
- package/lib/typescript/src/deprecated-components/FAB.d.ts +3 -8
- package/lib/typescript/src/deprecated-components/FAB.js +2 -2
- package/lib/typescript/src/deprecated-components/FAB.js.map +1 -1
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.js +4 -4
- package/lib/typescript/src/deprecated-components/FieldSearchBarFull.js.map +1 -1
- package/lib/typescript/src/deprecated-components/ProgressCircle.d.ts +5 -8
- package/lib/typescript/src/deprecated-components/ProgressCircle.js +3 -3
- package/lib/typescript/src/deprecated-components/ProgressCircle.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.d.ts +1 -3
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/lib/typescript/src/deprecated-components/RadioButtonFieldGroup.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowBodyIcon.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/RowBodyIcon.js +2 -2
- package/lib/typescript/src/deprecated-components/RowBodyIcon.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.js +3 -3
- package/lib/typescript/src/deprecated-components/RowHeadlineImageCaption.js.map +1 -1
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.d.ts +3 -5
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.js +3 -3
- package/lib/typescript/src/deprecated-components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/typescript/src/deprecated-components/ToggleButton.d.ts +6 -9
- package/lib/typescript/src/deprecated-components/ToggleButton.js +5 -5
- package/lib/typescript/src/deprecated-components/ToggleButton.js.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -2
- package/lib/typescript/src/index.js +0 -2
- package/lib/typescript/src/index.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/Provider.js +4 -4
- package/src/Provider.js.map +1 -1
- package/src/Provider.tsx +15 -12
- package/src/components/AccordionGroup.js +3 -3
- package/src/components/AccordionGroup.js.map +1 -1
- package/src/components/AccordionGroup.tsx +5 -5
- package/src/components/BottomSheet/BottomSheet.js +4 -4
- package/src/components/BottomSheet/BottomSheet.js.map +1 -1
- package/src/components/BottomSheet/BottomSheet.tsx +7 -7
- package/src/components/Button.js +8 -6
- package/src/components/Button.js.map +1 -1
- package/src/components/Button.tsx +10 -10
- package/src/components/Checkbox/Checkbox.js +3 -3
- package/src/components/Checkbox/Checkbox.js.map +1 -1
- package/src/components/Checkbox/Checkbox.tsx +3 -3
- package/src/components/Checkbox/CheckboxRow.js +4 -3
- package/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/src/components/Checkbox/CheckboxRow.tsx +9 -2
- package/src/components/DatePicker/DatePicker.js +24 -23
- package/src/components/DatePicker/DatePicker.js.map +1 -1
- package/src/components/DatePicker/DatePicker.tsx +25 -24
- package/src/components/DatePicker/DatePickerComponent.web.js +8 -6
- package/src/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/src/components/DatePicker/DatePickerComponent.web.tsx +15 -8
- package/src/components/DatePicker/DatePickerComponentType.ts +2 -3
- package/src/components/DeckSwiper/DeckSwiperCard.js +3 -3
- package/src/components/DeckSwiper/DeckSwiperCard.js.map +1 -1
- package/src/components/DeckSwiper/DeckSwiperCard.tsx +5 -5
- package/src/components/Divider.js +2 -2
- package/src/components/Divider.js.map +1 -1
- package/src/components/Divider.tsx +4 -4
- package/src/components/Elevation.js +3 -4
- package/src/components/Elevation.js.map +1 -1
- package/src/components/Elevation.tsx +5 -6
- package/src/components/FormRow.js.map +1 -1
- package/src/components/FormRow.tsx +1 -2
- package/src/components/IconButton.js +2 -2
- package/src/components/IconButton.js.map +1 -1
- package/src/components/IconButton.tsx +4 -4
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerCommon.ts +0 -2
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +10 -13
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx +19 -19
- package/src/components/MediaPlayer/AudioPlayer/index.js +1 -3
- package/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/index.tsx +1 -3
- package/src/components/Picker/NativePicker.js +5 -2
- package/src/components/Picker/NativePicker.js.map +1 -1
- package/src/components/Picker/NativePicker.tsx +5 -2
- package/src/components/Picker/PickerCommon.ts +2 -2
- package/src/components/Picker/dropdown/DropDownModalPicker.js +2 -2
- package/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -1
- package/src/components/Picker/dropdown/DropDownModalPicker.tsx +5 -5
- package/src/components/Picker/dropdown/DropDownPicker.js +2 -2
- package/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/src/components/Picker/dropdown/DropDownPicker.tsx +5 -5
- package/src/components/Picker/dropdown/MultiSelectPicker.js +1 -1
- package/src/components/Picker/dropdown/MultiSelectPicker.js.map +1 -1
- package/src/components/Picker/dropdown/MultiSelectPicker.tsx +1 -1
- package/src/components/Picker/index.js +1 -1
- package/src/components/Picker/index.js.map +1 -1
- package/src/components/Picker/index.tsx +1 -1
- package/src/components/PinInput/PinInput.js +4 -4
- package/src/components/PinInput/PinInput.js.map +1 -1
- package/src/components/PinInput/PinInput.tsx +6 -6
- package/src/components/PinInput/PinInputText.js +2 -2
- package/src/components/PinInput/PinInputText.js.map +1 -1
- package/src/components/PinInput/PinInputText.tsx +4 -4
- package/src/components/Portal/Portal.js +3 -5
- package/src/components/Portal/Portal.js.map +1 -1
- package/src/components/Portal/Portal.tsx +3 -10
- package/src/components/Progress/CircularProgress/CircularProgress.js +1 -1
- package/src/components/Progress/CircularProgress/CircularProgress.js.map +1 -1
- package/src/components/Progress/CircularProgress/CircularProgress.tsx +2 -2
- package/src/components/Progress/CircularProgress/index.js +1 -1
- package/src/components/Progress/CircularProgress/index.js.map +1 -1
- package/src/components/Progress/CircularProgress/index.tsx +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.js +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.js.map +1 -1
- package/src/components/Progress/LinearProgress/LinearProgress.tsx +2 -2
- package/src/components/Progress/LinearProgress/index.js +1 -1
- package/src/components/Progress/LinearProgress/index.js.map +1 -1
- package/src/components/Progress/LinearProgress/index.tsx +1 -1
- package/src/components/Progress/ProgressCommon.ts +2 -2
- package/src/components/ProgressIndicator.js +1 -1
- package/src/components/ProgressIndicator.js.map +1 -1
- package/src/components/ProgressIndicator.tsx +10 -11
- package/src/components/RadioButton/RadioButtonGroup.tsx +2 -2
- package/src/components/RadioButton/RadioButtonRow.js +4 -3
- package/src/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/src/components/RadioButton/RadioButtonRow.tsx +9 -2
- package/src/components/Row.js +1 -1
- package/src/components/Row.js.map +1 -1
- package/src/components/Row.tsx +3 -3
- package/src/components/ScreenContainer.js +2 -2
- package/src/components/ScreenContainer.js.map +1 -1
- package/src/components/ScreenContainer.tsx +4 -4
- package/src/components/SectionList/SectionHeader.js +3 -3
- package/src/components/SectionList/SectionHeader.js.map +1 -1
- package/src/components/SectionList/SectionHeader.tsx +5 -5
- package/src/components/Slider.js +6 -6
- package/src/components/Slider.js.map +1 -1
- package/src/components/Slider.tsx +8 -8
- package/src/components/StarRating.js +1 -1
- package/src/components/StarRating.js.map +1 -1
- package/src/components/StarRating.tsx +3 -3
- package/src/components/Stepper.js +3 -2
- package/src/components/Stepper.js.map +1 -1
- package/src/components/Stepper.tsx +5 -4
- package/src/components/Surface.js +3 -10
- package/src/components/Surface.js.map +1 -1
- package/src/components/Surface.tsx +5 -12
- package/src/components/SwipeableItem/SwipeableItem.js +10 -5
- package/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
- package/src/components/SwipeableItem/SwipeableItem.tsx +13 -7
- package/src/components/Swiper/Swiper.js +3 -2
- package/src/components/Swiper/Swiper.js.map +1 -1
- package/src/components/Swiper/Swiper.tsx +6 -3
- package/src/components/Switch.js +3 -4
- package/src/components/Switch.js.map +1 -1
- package/src/components/Switch.tsx +7 -7
- package/src/components/TabView/TabView.js +4 -4
- package/src/components/TabView/TabView.js.map +1 -1
- package/src/components/TabView/TabView.tsx +7 -7
- package/src/components/Table/Table.js +2 -2
- package/src/components/Table/Table.js.map +1 -1
- package/src/components/Table/Table.tsx +4 -4
- package/src/components/Table/TableRow.js +4 -2
- package/src/components/Table/TableRow.js.map +1 -1
- package/src/components/Table/TableRow.tsx +6 -4
- package/src/components/Text.js +2 -2
- package/src/components/Text.js.map +1 -1
- package/src/components/Text.tsx +4 -4
- package/src/components/TextField.js +22 -20
- package/src/components/TextField.js.map +1 -1
- package/src/components/TextField.tsx +26 -23
- package/src/components/TextInput.js +3 -0
- package/src/components/TextInput.js.map +1 -1
- package/src/components/TextInput.tsx +3 -0
- package/src/components/Typography.js +4 -4
- package/src/components/Typography.js.map +1 -1
- package/src/components/Typography.tsx +6 -6
- package/src/deprecated-components/AccordionItem.js +2 -2
- package/src/deprecated-components/AccordionItem.js.map +1 -1
- package/src/deprecated-components/AccordionItem.tsx +4 -4
- package/src/deprecated-components/AvatarEdit.js +4 -4
- package/src/deprecated-components/AvatarEdit.js.map +1 -1
- package/src/deprecated-components/AvatarEdit.tsx +6 -6
- package/src/deprecated-components/Banner.js +4 -5
- package/src/deprecated-components/Banner.js.map +1 -1
- package/src/deprecated-components/Banner.tsx +6 -10
- package/src/deprecated-components/Card.js +3 -3
- package/src/deprecated-components/Card.js.map +1 -1
- package/src/deprecated-components/Card.tsx +10 -6
- package/src/deprecated-components/CheckboxGroup.tsx +2 -2
- package/src/deprecated-components/Container.js +1 -1
- package/src/deprecated-components/Container.js.map +1 -1
- package/src/deprecated-components/Container.tsx +3 -3
- package/src/deprecated-components/DeprecatedButton.js +8 -8
- package/src/deprecated-components/DeprecatedButton.js.map +1 -1
- package/src/deprecated-components/DeprecatedButton.tsx +10 -10
- package/src/deprecated-components/DeprecatedCardWrapper.js +1 -1
- package/src/deprecated-components/DeprecatedCardWrapper.js.map +1 -1
- package/src/deprecated-components/DeprecatedCardWrapper.tsx +3 -3
- package/src/deprecated-components/DeprecatedFAB.js +8 -8
- package/src/deprecated-components/DeprecatedFAB.js.map +1 -1
- package/src/deprecated-components/DeprecatedFAB.tsx +10 -10
- package/src/deprecated-components/FAB.js +2 -2
- package/src/deprecated-components/FAB.js.map +1 -1
- package/src/deprecated-components/FAB.tsx +4 -4
- package/src/deprecated-components/FieldSearchBarFull.js +4 -4
- package/src/deprecated-components/FieldSearchBarFull.js.map +1 -1
- package/src/deprecated-components/FieldSearchBarFull.tsx +6 -6
- package/src/deprecated-components/ProgressCircle.js +3 -3
- package/src/deprecated-components/ProgressCircle.js.map +1 -1
- package/src/deprecated-components/ProgressCircle.tsx +7 -8
- package/src/deprecated-components/RadioButtonFieldGroup.js +1 -1
- package/src/deprecated-components/RadioButtonFieldGroup.js.map +1 -1
- package/src/deprecated-components/RadioButtonFieldGroup.tsx +1 -1
- package/src/deprecated-components/RowBodyIcon.js +2 -2
- package/src/deprecated-components/RowBodyIcon.js.map +1 -1
- package/src/deprecated-components/RowBodyIcon.tsx +6 -6
- package/src/deprecated-components/RowHeadlineImageCaption.js +3 -3
- package/src/deprecated-components/RowHeadlineImageCaption.js.map +1 -1
- package/src/deprecated-components/RowHeadlineImageCaption.tsx +6 -6
- package/src/deprecated-components/RowHeadlineImageIcon.js +3 -3
- package/src/deprecated-components/RowHeadlineImageIcon.js.map +1 -1
- package/src/deprecated-components/RowHeadlineImageIcon.tsx +6 -6
- package/src/deprecated-components/ToggleButton.js +5 -5
- package/src/deprecated-components/ToggleButton.js.map +1 -1
- package/src/deprecated-components/ToggleButton.tsx +12 -11
- package/src/index.js +0 -2
- package/src/index.js.map +1 -1
- package/src/index.tsx +0 -2
- package/lib/commonjs/styles/DarkTheme.js +0 -1
- package/lib/commonjs/styles/DefaultTheme.js +0 -1
- package/lib/commonjs/styles/fonts.js +0 -1
- package/lib/commonjs/styles/overlay.js +0 -1
- package/lib/commonjs/styles/shadow.js +0 -1
- package/lib/commonjs/theming.js +0 -1
- package/lib/typescript/src/styles/DarkTheme.d.ts +0 -3
- package/lib/typescript/src/styles/DarkTheme.js +0 -27
- package/lib/typescript/src/styles/DarkTheme.js.map +0 -1
- package/lib/typescript/src/styles/DefaultTheme.d.ts +0 -4218
- package/lib/typescript/src/styles/DefaultTheme.js +0 -112
- package/lib/typescript/src/styles/DefaultTheme.js.map +0 -1
- package/lib/typescript/src/styles/fonts.d.ts +0 -5
- package/lib/typescript/src/styles/fonts.js +0 -63
- package/lib/typescript/src/styles/fonts.js.map +0 -1
- package/lib/typescript/src/styles/overlay.d.ts +0 -2
- package/lib/typescript/src/styles/overlay.js +0 -61
- package/lib/typescript/src/styles/overlay.js.map +0 -1
- package/lib/typescript/src/styles/shadow.d.ts +0 -23
- package/lib/typescript/src/styles/shadow.js +0 -52
- package/lib/typescript/src/styles/shadow.js.map +0 -1
- package/lib/typescript/src/theming.d.ts +0 -8
- package/lib/typescript/src/theming.js +0 -4
- package/lib/typescript/src/theming.js.map +0 -1
- package/src/styles/DarkTheme.js +0 -27
- package/src/styles/DarkTheme.js.map +0 -1
- package/src/styles/DarkTheme.tsx +0 -30
- package/src/styles/DefaultTheme.js +0 -112
- package/src/styles/DefaultTheme.js.map +0 -1
- package/src/styles/DefaultTheme.tsx +0 -114
- package/src/styles/fonts.js +0 -63
- package/src/styles/fonts.js.map +0 -1
- package/src/styles/fonts.tsx +0 -67
- package/src/styles/overlay.js +0 -61
- package/src/styles/overlay.js.map +0 -1
- package/src/styles/overlay.tsx +0 -69
- package/src/styles/shadow.js +0 -52
- package/src/styles/shadow.js.map +0 -1
- package/src/styles/shadow.tsx +0 -55
- package/src/theming.js +0 -4
- package/src/theming.js.map +0 -1
- package/src/theming.tsx +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Row.tsx";import*as React from"react";import{View,Text,Image,StyleSheet}from"react-native";import{withTheme}from"
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Row.tsx";import*as React from"react";import{View,Text,Image,StyleSheet}from"react-native";import{withTheme}from"@draftbit/theme";import Config from"./Config";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var Row=function Row(_ref){var titleTypeStyle=_ref.titleTypeStyle,titleColor=_ref.titleColor,subtitleTypeStyle=_ref.subtitleTypeStyle,subtitleColor=_ref.subtitleColor,title=_ref.title,subtitle=_ref.subtitle,multilineSubtitle=_ref.multilineSubtitle,image=_ref.image,right=_ref.right,style=_ref.style;return _jsxs(View,{style:[styles.container,{padding:16},style],children:[_jsxs(View,{style:styles.leftContainer,children:[image&&_jsx(Image,{source:typeof image==="string"?{uri:image}:image,style:{marginRight:12,width:subtitle?Config.rowMultiLineImageSize:Config.rowSingleLineImageSize,height:subtitle?Config.rowMultiLineImageSize:Config.rowSingleLineImageSize}}),_jsxs(View,{style:styles.textContainer,children:[_jsx(Text,{style:[titleTypeStyle,{color:titleColor}],numberOfLines:1,children:title}),subtitle?_jsx(Text,{style:[subtitleTypeStyle,{color:subtitleColor,marginTop:4}],numberOfLines:multilineSubtitle?undefined:1,children:subtitle}):null]})]}),right&&right()]});};var styles=StyleSheet.create({leftContainer:{flexDirection:"row",flex:1},container:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},textContainer:{flex:1,justifyContent:"center"}});export default withTheme(Row);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ScreenContainer.tsx";var _excluded=["scrollable","hasSafeArea","hasBottomSafeArea","hasTopSafeArea","hasLeftSafeArea","hasRightSafeArea","theme","style","children"];import*as React from"react";import{StyleSheet,ScrollView,View}from"react-native";import{SafeAreaView}from"react-native-safe-area-context";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/ScreenContainer.tsx";var _excluded=["scrollable","hasSafeArea","hasBottomSafeArea","hasTopSafeArea","hasLeftSafeArea","hasRightSafeArea","theme","style","children"];import*as React from"react";import{StyleSheet,ScrollView,View}from"react-native";import{SafeAreaView}from"react-native-safe-area-context";import{withTheme}from"@draftbit/theme";import{jsx as _jsx}from"react/jsx-runtime";function ScreenContainer(_ref){var _StyleSheet$flatten;var _ref$scrollable=_ref.scrollable,scrollable=_ref$scrollable===void 0?false:_ref$scrollable,_ref$hasSafeArea=_ref.hasSafeArea,hasSafeArea=_ref$hasSafeArea===void 0?false:_ref$hasSafeArea,_ref$hasBottomSafeAre=_ref.hasBottomSafeArea,hasBottomSafeArea=_ref$hasBottomSafeAre===void 0?false:_ref$hasBottomSafeAre,_ref$hasTopSafeArea=_ref.hasTopSafeArea,hasTopSafeArea=_ref$hasTopSafeArea===void 0?false:_ref$hasTopSafeArea,_ref$hasLeftSafeArea=_ref.hasLeftSafeArea,hasLeftSafeArea=_ref$hasLeftSafeArea===void 0?true:_ref$hasLeftSafeArea,_ref$hasRightSafeArea=_ref.hasRightSafeArea,hasRightSafeArea=_ref$hasRightSafeArea===void 0?true:_ref$hasRightSafeArea,theme=_ref.theme,style=_ref.style,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor=((_StyleSheet$flatten=StyleSheet.flatten(style))==null?void 0:_StyleSheet$flatten.backgroundColor)||theme.colors.background.brand;var edges=[];if(hasSafeArea||hasTopSafeArea){edges.push("top");}if(hasSafeArea||hasBottomSafeArea){edges.push("bottom");}if(hasSafeArea||hasLeftSafeArea){edges.push("left");}if(hasSafeArea||hasRightSafeArea){edges.push("right");}return _jsx(SafeAreaView,Object.assign({edges:edges,style:[styles.container,{backgroundColor:backgroundColor}]},rest,{children:scrollable?_jsx(ScrollView,{contentContainerStyle:[styles.scrollViewContainer,{backgroundColor:backgroundColor},style],children:children}):_jsx(View,{style:[styles.container,{backgroundColor:backgroundColor},style],children:children})}));}var styles=StyleSheet.create({container:{flex:1},scrollViewContainer:{flexGrow:1,flex:undefined}});export default withTheme(ScreenContainer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SectionList/SectionHeader.tsx";import React from"react";import{View,Text}from"react-native";import{withTheme}from"
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SectionList/SectionHeader.tsx";import React from"react";import{View,Text}from"react-native";import{withTheme}from"@draftbit/theme";import{jsx as _jsx}from"react/jsx-runtime";var SectionHeader=function SectionHeader(_ref){var style=_ref.style,children=_ref.children;return _jsx(View,{style:[style],children:children});};export var DefaultSectionHeader=withTheme(function(_ref2){var title=_ref2.title,theme=_ref2.theme;return _jsx(Text,{testID:"default-section-header",style:{color:theme.colors.background.brand,backgroundColor:theme.colors.branding.primary,fontSize:16,padding:10},children:title});});export default SectionHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Slider.tsx";var _excluded=["Icon","leftIcon","rightIcon","leftIconColor","rightIconColor","value","defaultValue","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","minimumValue","maximumValue","tapToSeek","step","onValueChange","style","theme"];import*as React from"react";import{View,StyleSheet,Platform}from"react-native";import NativeSlider from"@react-native-community/slider";import isNumber from"lodash.isnumber";import toNumber from"lodash.tonumber";import{withTheme}from"
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Slider.tsx";var _excluded=["Icon","leftIcon","rightIcon","leftIconColor","rightIconColor","value","defaultValue","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","minimumValue","maximumValue","tapToSeek","step","onValueChange","style","theme"];import*as React from"react";import{View,StyleSheet,Platform}from"react-native";import NativeSlider from"@react-native-community/slider";import isNumber from"lodash.isnumber";import toNumber from"lodash.tonumber";import{withTheme}from"@draftbit/theme";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function maybeParseValue(value){if(value===undefined){return undefined;}if(isNumber(value)){return value;}try{var maybe=toNumber(value);if(isNumber(maybe)){return maybe;}}catch(_unused){return undefined;}return undefined;}function Slider(_ref){var Icon=_ref.Icon,leftIcon=_ref.leftIcon,rightIcon=_ref.rightIcon,leftIconColor=_ref.leftIconColor,rightIconColor=_ref.rightIconColor,value=_ref.value,defaultValue=_ref.defaultValue,minimumTrackTintColor=_ref.minimumTrackTintColor,maximumTrackTintColor=_ref.maximumTrackTintColor,thumbTintColor=_ref.thumbTintColor,_ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?100:_ref$maximumValue,tapToSeek=_ref.tapToSeek,_ref$step=_ref.step,step=_ref$step===void 0?1:_ref$step,_ref$onValueChange=_ref.onValueChange,onValueChange=_ref$onValueChange===void 0?function(){}:_ref$onValueChange,style=_ref.style,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(value||defaultValue),_React$useState2=_slicedToArray(_React$useState,2),internalValue=_React$useState2[0],setInternalValue=_React$useState2[1];var _React$useState3=React.useState({width:0,height:0}),_React$useState4=_slicedToArray(_React$useState3,2),tempThumbStyle=_React$useState4[0],setTempThumbStyle=_React$useState4[1];React.useEffect(function(){setTempThumbStyle({width:undefined,height:undefined});},[]);React.useEffect(function(){if(value!=null){setInternalValue(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setInternalValue(defaultValue);}},[defaultValue]);var minTrackColor=minimumTrackTintColor||theme.colors.branding.primary;var maxTrackColor=maximumTrackTintColor||theme.colors.foreground.light;var thumbColor=thumbTintColor||theme.colors.branding.primary;var leftIconThemeColor=leftIconColor||theme.colors.text.light;var rightIconThemeColor=rightIconColor||theme.colors.text.light;var parsedValue=maybeParseValue(internalValue);var handleSlidingComplete=function handleSlidingComplete(newValue){setInternalValue(newValue);onValueChange(newValue);};return _jsxs(View,Object.assign({style:[styles.container,style]},rest,{children:[leftIcon?_jsx(Icon,{color:leftIconThemeColor,name:leftIcon,size:24}):null,_jsx(NativeSlider,{value:parsedValue,step:step,minimumValue:minimumValue,maximumValue:maximumValue,tapToSeek:tapToSeek,minimumTrackTintColor:minTrackColor,maximumTrackTintColor:maxTrackColor,thumbTintColor:thumbColor,onSlidingComplete:handleSlidingComplete,style:styles.slider,thumbStyle:Platform.OS==="web"?tempThumbStyle:undefined}),rightIcon?_jsx(Icon,{color:rightIconThemeColor,name:rightIcon,size:24}):null]}));}var styles=StyleSheet.create({container:{height:40,flexDirection:"row",alignItems:"center"},slider:{flex:1,marginHorizontal:12}});export default withTheme(Slider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/StarRating.tsx";import*as React from"react";import{View,StyleSheet,Pressable}from"react-native";import{withTheme}from"
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","starSize","maxStars","rating","defaultValue","isEditable","activeColor","inactiveColor","style","onPress"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/StarRating.tsx";import*as React from"react";import{View,StyleSheet,Pressable}from"react-native";import{withTheme}from"@draftbit/theme";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var StarRating=function StarRating(_ref){var Icon=_ref.Icon,_ref$starSize=_ref.starSize,starSize=_ref$starSize===void 0?16:_ref$starSize,_ref$maxStars=_ref.maxStars,maxStars=_ref$maxStars===void 0?5:_ref$maxStars,_ref$rating=_ref.rating,rating=_ref$rating===void 0?0:_ref$rating,defaultValue=_ref.defaultValue,_ref$isEditable=_ref.isEditable,isEditable=_ref$isEditable===void 0?false:_ref$isEditable,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,style=_ref.style,onPress=_ref.onPress,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(rating||defaultValue||0),_React$useState2=_slicedToArray(_React$useState,2),localRating=_React$useState2[0],setLocalRating=_React$useState2[1];React.useEffect(function(){if(rating!=null){setLocalRating(rating);}},[rating]);React.useEffect(function(){if(defaultValue!=null){setLocalRating(defaultValue);}},[defaultValue]);var ratingHandler=React.useCallback(function(r){setLocalRating(r);!!onPress&&onPress(r);},[onPress]);var ratingRounded=Math.round(localRating*2)/2;return _jsx(View,Object.assign({style:[styles.container,style]},rest,{children:_toConsumableArray(Array(maxStars)).map(function(_,i){return _jsxs(View,{style:{display:"flex"},children:[_jsx(Icon,{name:ratingRounded-i===0.5?"MaterialIcons/star-half":"MaterialIcons/star",size:starSize,color:ratingRounded>i?activeColor:inactiveColor}),isEditable&&_jsxs(View,{style:styles.touchContainer,children:[_jsx(Pressable,{style:styles.pressable,onPress:function onPress(){return ratingHandler(i+0.5);}}),_jsx(Pressable,{style:styles.pressable,onPress:function onPress(){return ratingHandler(i+1);}})]})]},i);})}));};var styles=StyleSheet.create({container:{flexDirection:"row",alignItems:"center"},touchContainer:{display:"flex",flexDirection:"row",position:"absolute",top:0,right:0,left:0,bottom:0,zIndex:1},pressable:{flex:1,height:"100%",width:"50%"}});export default withTheme(StarRating);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Stepper.tsx";import React,{useEffect,useState}from"react";import{View,Text}from"react-native";import{isNumber}from"lodash";import{withTheme}from"
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Stepper.tsx";import React,{useEffect,useState}from"react";import{View,Text}from"react-native";import{isNumber}from"lodash";import{withTheme}from"@draftbit/theme";import IconButton from"./IconButton";import{extractStyles}from"../utilities";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var Stepper=function Stepper(_ref){var _ref$min=_ref.min,min=_ref$min===void 0?-Infinity:_ref$min,_ref$max=_ref.max,max=_ref$max===void 0?Infinity:_ref$max,valueProp=_ref.value,defaultValue=_ref.defaultValue,style=_ref.style,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?24:_ref$iconSize,iconColor=_ref.iconColor,onChange=_ref.onChange,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,Icon=_ref.Icon;var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles,textStyles=_extractStyles.textStyles;var _useState=useState(defaultValue!=null?defaultValue:0),_useState2=_slicedToArray(_useState,2),value=_useState2[0],setValue=_useState2[1];var isValidValue=function isValidValue(valueArg){return valueArg>=min&&valueArg<=max;};var handlePlusOrMinus=function handlePlusOrMinus(type){var newValue=type==="plus"?value+1:value-1;if(isValidValue(newValue)){setValue(newValue);onChange==null?void 0:onChange(newValue);}};useEffect(function(){if(valueProp!=null&&isNumber(valueProp)&&valueProp!==value&&isValidValue(valueProp)){setValue(valueProp);}},[valueProp]);return _jsxs(View,{style:[{flexDirection:"row"},viewStyles],children:[_jsx(IconButton,{Icon:Icon,icon:"MaterialIcons/remove",onPress:function onPress(){return handlePlusOrMinus("minus");},size:iconSize,color:iconColor,disabled:value===min,style:{opacity:value===min?0.5:1}}),_jsx(Text,{style:[{color:colors.text.strong},typography.body1,{textAlign:"center",alignSelf:"center",color:colors.text.medium,marginHorizontal:8},textStyles],children:value}),_jsx(IconButton,{Icon:Icon,icon:"MaterialIcons/add",onPress:function onPress(){return handlePlusOrMinus("plus");},size:iconSize,color:iconColor,disabled:value===max,style:{opacity:value===max?0.5:1}})]});};export default withTheme(Stepper);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["elevation","style","theme","children"],_excluded2=["elevation","backgroundColor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Surface.tsx";import*as React from"react";import{Animated,StyleSheet}from"react-native";import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["elevation","style","theme","children"],_excluded2=["elevation","backgroundColor"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Surface.tsx";import*as React from"react";import{Animated,StyleSheet}from"react-native";import{withTheme}from"@draftbit/theme";import{jsx as _jsx}from"react/jsx-runtime";var Surface=function Surface(_ref){var propElevation=_ref.elevation,style=_ref.style,theme=_ref.theme,children=_ref.children,rest=_objectWithoutProperties(_ref,_excluded);var _ref2=StyleSheet.flatten(style)||{},_ref2$elevation=_ref2.elevation,styleElevation=_ref2$elevation===void 0?3:_ref2$elevation,backgroundColor=_ref2.backgroundColor,restStyle=_objectWithoutProperties(_ref2,_excluded2);var colors=theme.colors;var elevation=propElevation!=null?propElevation:styleElevation;var getBackgroundColor=function getBackgroundColor(){if(backgroundColor){return backgroundColor;}else{return colors.background.brand;}};return _jsx(Animated.View,Object.assign({},rest,{style:[Object.assign({backgroundColor:getBackgroundColor(),elevation:elevation},restStyle)],children:children}));};export default withTheme(Surface);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","style","children","Icon","closeOnPress","leftOpenValue","rightOpenValue","leftActivationValue","rightActivationValue","swipeActivationPercentage","stopLeftSwipe","stopRightSwipe","friction","disableLeftSwipe","disableRightSwipe"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableItem.tsx";import React from"react";import{View,StyleSheet,Text}from"react-native";import Pressable from"../Pressable";import{extractBorderAndMarginStyles,extractEffectStyles,extractFlexItemStyles,extractPositionStyles,extractSizeStyles,extractStyles,flattenReactFragments}from"../../utilities";import{SwipeRow}from"react-native-swipe-list-view";import{withTheme}from"
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","style","children","Icon","closeOnPress","leftOpenValue","rightOpenValue","leftActivationValue","rightActivationValue","swipeActivationPercentage","stopLeftSwipe","stopRightSwipe","friction","disableLeftSwipe","disableRightSwipe"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/SwipeableItem/SwipeableItem.tsx";import React from"react";import{View,StyleSheet,Text}from"react-native";import Pressable from"../Pressable";import{extractBorderAndMarginStyles,extractEffectStyles,extractFlexItemStyles,extractPositionStyles,extractSizeStyles,extractStyles,flattenReactFragments}from"../../utilities";import{SwipeRow}from"react-native-swipe-list-view";import{withTheme}from"@draftbit/theme";import SwipeableItemButton from"./SwipeableItemButton";import{SwipeableListContext}from"./SwipeableList";import{leftSwipeToSwipeableItemBehindItem,rightSwipeToSwipeableItemBehindItem,extractLeftSwipeProps,extractRightSwipeProps}from"./SwipeableItemCommon";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var SwipeableItem=function SwipeableItem(_ref){var theme=_ref.theme,style=_ref.style,childrenProp=_ref.children,Icon=_ref.Icon,closeOnPress=_ref.closeOnPress,leftOpenValue=_ref.leftOpenValue,rightOpenValue=_ref.rightOpenValue,leftActivationValue=_ref.leftActivationValue,rightActivationValue=_ref.rightActivationValue,_ref$swipeActivationP=_ref.swipeActivationPercentage,swipeActivationPercentage=_ref$swipeActivationP===void 0?80:_ref$swipeActivationP,stopLeftSwipe=_ref.stopLeftSwipe,stopRightSwipe=_ref.stopRightSwipe,_ref$friction=_ref.friction,friction=_ref$friction===void 0?20:_ref$friction,disableLeftSwipe=_ref.disableLeftSwipe,disableRightSwipe=_ref.disableRightSwipe,rest=_objectWithoutProperties(_ref,_excluded);var isEmptyObject=function isEmptyObject(object){return Object.keys(object).length===0;};var _React$useContext=React.useContext(SwipeableListContext),onStartSwiping=_React$useContext.onStartSwiping,onStopSwiping=_React$useContext.onStopSwiping;var swipeableRef=React.useRef(null);var _extractStyles=extractStyles(style),viewStyles=_extractStyles.viewStyles,textStyles=_extractStyles.textStyles;var _extractBorderAndMarg=extractBorderAndMarginStyles(viewStyles),borderStyles=_extractBorderAndMarg.borderStyles,marginStyles=_extractBorderAndMarg.marginStyles;var sizeStyles=extractSizeStyles(viewStyles);var parentContainerStyles=StyleSheet.flatten([borderStyles,marginStyles,extractFlexItemStyles(viewStyles),extractPositionStyles(viewStyles),extractEffectStyles(viewStyles),sizeStyles]);Object.keys(parentContainerStyles).forEach(function(key){return delete viewStyles[key];});var surfaceContainerStyles=StyleSheet.flatten([viewStyles,sizeStyles]);var _React$useState=React.useState(null),_React$useState2=_slicedToArray(_React$useState,2),componentWidth=_React$useState2[0],setComponentWidth=_React$useState2[1];var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp));},[childrenProp]);var leftSwipeButtons=React.useMemo(function(){return children.filter(function(child){return React.isValidElement(child)&&child.type===SwipeableItemButton&&child.props.revealSwipeDirection==="left";});},[children]);var rightSwipeButtons=React.useMemo(function(){return children.filter(function(child){return React.isValidElement(child)&&child.type===SwipeableItemButton&&child.props.revealSwipeDirection==="right";});},[children]);var remainingChildren=React.useMemo(function(){return React.Children.toArray(children).filter(function(child){return React.isValidElement(child)&&child.type!==SwipeableItemButton;});},[children]);var leftSwipe=extractLeftSwipeProps(rest);var rightSwipe=extractRightSwipeProps(rest);var isLeftSwipeHandled=!isEmptyObject(leftSwipe);var isRightSwipeHandled=!isEmptyObject(rightSwipe);if(leftSwipeButtons.length>2||rightSwipeButtons.length>2){throw Error("Cannot have more than 2 SwipeableItemButton(s) per side");}if(leftSwipeButtons.length&&isLeftSwipeHandled||rightSwipeButtons.length&&isRightSwipeHandled){throw Error("Colliding configuration in SwipeableItem. You cannot have SwipeableItemButton(s) on the swipe direction where swipe handling is configured. Either reset swipe configuration or remove the button(s).");}var renderBehindItem=function renderBehindItem(item,index){return _jsxs(Pressable,{testID:"swipeable-behind-item",onPress:function onPress(){item.onPress==null?void 0:item.onPress();if(item.closeOnPress!==false){var _swipeableRef$current;(_swipeableRef$current=swipeableRef.current)==null?void 0:_swipeableRef$current.closeRow();}},style:[styles.buttonContainer,{backgroundColor:item.backgroundColor||theme.colors.branding.primary}],children:[item.icon&&_jsx(Icon,{name:item.icon,size:item.iconSize||25,color:item.color||theme.colors.background.brand}),item.title&&_jsx(Text,{style:[textStyles,{color:item.color||theme.colors.background.brand}],children:item.title})]},index.toString());};var defaultLeftOpenValue=componentWidth?componentWidth/2:0;var defaultRightOpenValue=componentWidth?-componentWidth/2:0;return _jsx(View,{onLayout:function onLayout(event){setComponentWidth(event.nativeEvent.layout.width);},style:[styles.parentContainer,parentContainerStyles],children:_jsxs(SwipeRow,Object.assign({ref:swipeableRef,leftOpenValue:isRightSwipeHandled?0:leftOpenValue||defaultLeftOpenValue,rightOpenValue:isLeftSwipeHandled?0:rightOpenValue||defaultRightOpenValue,leftActivationValue:leftActivationValue||isRightSwipeHandled?defaultLeftOpenValue*(swipeActivationPercentage/100):defaultLeftOpenValue,rightActivationValue:rightActivationValue||isLeftSwipeHandled?defaultRightOpenValue*(swipeActivationPercentage/100):defaultRightOpenValue,stopLeftSwipe:stopRightSwipe||defaultLeftOpenValue,stopRightSwipe:stopLeftSwipe||defaultRightOpenValue,onLeftAction:isRightSwipeHandled?function(){return rightSwipe.onSwipedRight==null?void 0:rightSwipe.onSwipedRight();}:undefined,onRightAction:isLeftSwipeHandled?function(){return leftSwipe.onSwipedLeft==null?void 0:leftSwipe.onSwipedLeft();}:undefined,swipeGestureBegan:onStartSwiping,swipeGestureEnded:onStopSwiping,closeOnRowPress:closeOnPress,friction:friction,disableLeftSwipe:disableRightSwipe,disableRightSwipe:disableLeftSwipe},rest,{children:[_jsxs(View,{style:styles.behindContainer,children:[_jsx(View,{style:styles.behindContainerItem,children:isRightSwipeHandled?renderBehindItem(rightSwipeToSwipeableItemBehindItem(rightSwipe),0):rightSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})}),_jsx(View,{style:styles.behindContainerItem,children:isLeftSwipeHandled?renderBehindItem(leftSwipeToSwipeableItemBehindItem(leftSwipe),0):leftSwipeButtons.map(function(item,index){return renderBehindItem(item.props,index);})})]}),_jsx(View,{style:[styles.surfaceContainer,{backgroundColor:theme.colors.background.brand},surfaceContainerStyles],children:remainingChildren})]}))});};var styles=StyleSheet.create({parentContainer:{overflow:"hidden",minHeight:50},behindContainer:{flex:1,width:"100%",height:"100%",flexDirection:"row"},behindContainerItem:{flex:1,flexDirection:"row"},buttonContainer:{flex:1,alignItems:"center",justifyContent:"center"},surfaceContainer:{width:"100%",minHeight:50,overflow:"hidden"}});export default withTheme(SwipeableItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Swiper/Swiper.tsx";import React from"react";import{View}from"react-native";import SwiperComponent from"react-native-web-swiper";import{jsx as _jsx}from"react/jsx-runtime";var Swiper=function Swiper(_ref){var _data$length;var _ref$vertical=_ref.vertical,vertical=_ref$vertical===void 0?false:_ref$vertical,_ref$loop=_ref.loop,loop=_ref$loop===void 0?false:_ref$loop,_ref$timeout=_ref.timeout,timeout=_ref$timeout===void 0?0:_ref$timeout,_ref$from=_ref.from,from=_ref$from===void 0?0:_ref$from,_ref$prevTitle=_ref.prevTitle,prevTitle=_ref$prevTitle===void 0?"":_ref$prevTitle,_ref$nextTitle=_ref.nextTitle,nextTitle=_ref$nextTitle===void 0?"":_ref$nextTitle,prevTitleColor=_ref.prevTitleColor,nextTitleColor=_ref.nextTitleColor,_ref$dotsTouchable=_ref.dotsTouchable,dotsTouchable=_ref$dotsTouchable===void 0?true:_ref$dotsTouchable,dotColor=_ref.dotColor,dotActiveColor=_ref.dotActiveColor,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,onIndexChangedProp=_ref.onIndexChanged,onSwipe=_ref.onSwipe,onSwipedNext=_ref.onSwipedNext,onSwipedPrevious=_ref.onSwipedPrevious,minDistanceForAction=_ref.minDistanceForAction,minDistanceToCapture=_ref.minDistanceToCapture,style=_ref.style;var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),currentIndex=_React$useState2[0],setCurrentIndex=_React$useState2[1];var numberOfItems=(_data$length=data==null?void 0:data.length)!=null?_data$length:React.Children.count(childrenProp);var swiperRef=React.useRef(null);var onIndexChanged=function onIndexChanged(index){var previous=currentIndex;var current=index;onIndexChangedProp==null?void 0:onIndexChangedProp(index);setCurrentIndex(index);if(previous===numberOfItems-1&¤t===0){onSwipedNext==null?void 0:onSwipedNext(previous);}else if(previous===0&¤t===numberOfItems-1){onSwipedPrevious==null?void 0:onSwipedPrevious(previous);}else if(current>previous){onSwipedNext==null?void 0:onSwipedNext(previous);}else if(current<previous){onSwipedPrevious==null?void 0:onSwipedPrevious(previous);}onSwipe==null?void 0:onSwipe(previous);};var children=React.useMemo(function(){return Array.isArray(data)&&renderItem?data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index;return React.cloneElement(component,{key:key});}):childrenProp;},[childrenProp,data,renderItem,keyExtractor]);React.useEffect(function(){var _swiperRef$current,_swiperRef$current$pr;var childrenArray=React.Children.toArray((_swiperRef$current=swiperRef.current)==null?void 0:(_swiperRef$current$pr=_swiperRef$current.props)==null?void 0:_swiperRef$current$pr.children);if(swiperRef.current){swiperRef.current.children=childrenArray;swiperRef.current.count=childrenArray.length;swiperRef.current.forceUpdate();}},[children]);return _jsx(View,{style:style,children:_jsx(SwiperComponent,{ref:swiperRef,from:from,loop:loop,timeout:timeout,vertical:vertical,onIndexChanged:onIndexChanged,minDistanceForAction:minDistanceForAction,minDistanceToCapture:minDistanceToCapture,controlsProps:Object.assign({prevTitle:prevTitle,nextTitle:nextTitle,prevTitleStyle:{color:prevTitleColor},nextTitleStyle:{color:nextTitleColor},dotsTouchable:dotsTouchable},dotColor?{dotProps:{badgeStyle:{backgroundColor:dotColor}}}:{},dotActiveColor?{dotActiveStyle:{backgroundColor:dotActiveColor}}:{}),children:children})});};export default Swiper;
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Swiper/Swiper.tsx";import{withTheme}from"@draftbit/theme";import React from"react";import{View}from"react-native";import SwiperComponent from"react-native-web-swiper";import{jsx as _jsx}from"react/jsx-runtime";var Swiper=function Swiper(_ref){var _data$length;var theme=_ref.theme,_ref$vertical=_ref.vertical,vertical=_ref$vertical===void 0?false:_ref$vertical,_ref$loop=_ref.loop,loop=_ref$loop===void 0?false:_ref$loop,_ref$timeout=_ref.timeout,timeout=_ref$timeout===void 0?0:_ref$timeout,_ref$from=_ref.from,from=_ref$from===void 0?0:_ref$from,_ref$prevTitle=_ref.prevTitle,prevTitle=_ref$prevTitle===void 0?"":_ref$prevTitle,_ref$nextTitle=_ref.nextTitle,nextTitle=_ref$nextTitle===void 0?"":_ref$nextTitle,prevTitleColor=_ref.prevTitleColor,nextTitleColor=_ref.nextTitleColor,_ref$dotsTouchable=_ref.dotsTouchable,dotsTouchable=_ref$dotsTouchable===void 0?true:_ref$dotsTouchable,_ref$dotColor=_ref.dotColor,dotColor=_ref$dotColor===void 0?theme.colors.foreground.brand:_ref$dotColor,_ref$dotActiveColor=_ref.dotActiveColor,dotActiveColor=_ref$dotActiveColor===void 0?theme.colors.branding.primary:_ref$dotActiveColor,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,onIndexChangedProp=_ref.onIndexChanged,onSwipe=_ref.onSwipe,onSwipedNext=_ref.onSwipedNext,onSwipedPrevious=_ref.onSwipedPrevious,minDistanceForAction=_ref.minDistanceForAction,minDistanceToCapture=_ref.minDistanceToCapture,style=_ref.style;var _React$useState=React.useState(0),_React$useState2=_slicedToArray(_React$useState,2),currentIndex=_React$useState2[0],setCurrentIndex=_React$useState2[1];var numberOfItems=(_data$length=data==null?void 0:data.length)!=null?_data$length:React.Children.count(childrenProp);var swiperRef=React.useRef(null);var onIndexChanged=function onIndexChanged(index){var previous=currentIndex;var current=index;onIndexChangedProp==null?void 0:onIndexChangedProp(index);setCurrentIndex(index);if(previous===numberOfItems-1&¤t===0){onSwipedNext==null?void 0:onSwipedNext(previous);}else if(previous===0&¤t===numberOfItems-1){onSwipedPrevious==null?void 0:onSwipedPrevious(previous);}else if(current>previous){onSwipedNext==null?void 0:onSwipedNext(previous);}else if(current<previous){onSwipedPrevious==null?void 0:onSwipedPrevious(previous);}onSwipe==null?void 0:onSwipe(previous);};var children=React.useMemo(function(){return Array.isArray(data)&&renderItem?data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index;return React.cloneElement(component,{key:key});}):childrenProp;},[childrenProp,data,renderItem,keyExtractor]);React.useEffect(function(){var _swiperRef$current,_swiperRef$current$pr;var childrenArray=React.Children.toArray((_swiperRef$current=swiperRef.current)==null?void 0:(_swiperRef$current$pr=_swiperRef$current.props)==null?void 0:_swiperRef$current$pr.children);if(swiperRef.current){swiperRef.current.children=childrenArray;swiperRef.current.count=childrenArray.length;swiperRef.current.forceUpdate();}},[children]);return _jsx(View,{style:style,children:_jsx(SwiperComponent,{ref:swiperRef,from:from,loop:loop,timeout:timeout,vertical:vertical,onIndexChanged:onIndexChanged,minDistanceForAction:minDistanceForAction,minDistanceToCapture:minDistanceToCapture,controlsProps:Object.assign({prevTitle:prevTitle,nextTitle:nextTitle,prevTitleStyle:{color:prevTitleColor},nextTitleStyle:{color:nextTitleColor},dotsTouchable:dotsTouchable},dotColor?{dotProps:{badgeStyle:{backgroundColor:dotColor}}}:{},dotActiveColor?{dotActiveStyle:{backgroundColor:dotActiveColor}}:{}),children:children})});};export default withTheme(Swiper);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Switch.tsx";var _excluded=["value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme","style"],_excluded2=["label","direction","style","value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme"];import*as React from"react";import{Switch as NativeSwitch}from"react-native";import{withTheme}from"
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Switch.tsx";var _excluded=["value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme","style"],_excluded2=["label","direction","style","value","defaultValue","disabled","onValueChange","activeTrackColor","inactiveTrackColor","activeThumbColor","inactiveThumbColor","theme"];import*as React from"react";import{Switch as NativeSwitch}from"react-native";import{withTheme}from"@draftbit/theme";import FormRow from"./FormRow";import{usePrevious}from"../hooks";import{jsx as _jsx}from"react/jsx-runtime";function Switch(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,disabled=_ref.disabled,_onValueChange=_ref.onValueChange,activeTrackColor=_ref.activeTrackColor,inactiveTrackColor=_ref.inactiveTrackColor,activeThumbColor=_ref.activeThumbColor,inactiveThumbColor=_ref.inactiveThumbColor,theme=_ref.theme,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var activeTrackThemeColor=activeTrackColor||theme.colors.branding.primary;var inactiveTrackThemeColor=inactiveTrackColor||"#EEE";var activeThumbThemeColor=activeThumbColor||"#FFF";var inactiveThumbThemeColor=inactiveThumbColor||"#FFF";var _React$useState=React.useState(value||defaultValue),_React$useState2=_slicedToArray(_React$useState,2),checked=_React$useState2[0],setChecked=_React$useState2[1];React.useEffect(function(){if(value!=null&&value!==checked){setChecked(value);}},[value,checked]);var previousDefaultValue=usePrevious(defaultValue);React.useEffect(function(){if(defaultValue!==previousDefaultValue){setChecked(Boolean(defaultValue));}},[defaultValue,previousDefaultValue]);return _jsx(NativeSwitch,Object.assign({value:checked,disabled:disabled,trackColor:{false:inactiveTrackThemeColor,true:activeTrackThemeColor},thumbColor:value?activeThumbThemeColor:inactiveThumbThemeColor,activeThumbColor:activeThumbThemeColor,ios_backgroundColor:inactiveTrackThemeColor,style:style,onValueChange:function onValueChange(bool){setChecked(bool);_onValueChange&&_onValueChange(bool);}},rest));}function Row(_ref2){var _ref2$label=_ref2.label,label=_ref2$label===void 0?"Label":_ref2$label,_ref2$direction=_ref2.direction,direction=_ref2$direction===void 0?"row":_ref2$direction,style=_ref2.style,value=_ref2.value,defaultValue=_ref2.defaultValue,disabled=_ref2.disabled,onValueChange=_ref2.onValueChange,activeTrackColor=_ref2.activeTrackColor,inactiveTrackColor=_ref2.inactiveTrackColor,activeThumbColor=_ref2.activeThumbColor,inactiveThumbColor=_ref2.inactiveThumbColor,theme=_ref2.theme,rest=_objectWithoutProperties(_ref2,_excluded2);var _React$useState3=React.useState(value!=null?value:defaultValue),_React$useState4=_slicedToArray(_React$useState3,2),checked=_React$useState4[0],setChecked=_React$useState4[1];React.useEffect(function(){if(value!=null){setChecked(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setChecked(defaultValue);}},[defaultValue]);return _jsx(FormRow,Object.assign({disabled:disabled,onPress:function onPress(){setChecked(!checked);onValueChange&&onValueChange(!checked);},label:label,direction:direction,style:style},rest,{children:_jsx(Switch,{theme:theme,value:checked,disabled:disabled,onValueChange:onValueChange,activeTrackColor:activeTrackColor,inactiveTrackColor:inactiveTrackColor,activeThumbColor:activeThumbColor,inactiveThumbColor:inactiveThumbColor})}));}var SwitchRow=withTheme(Row);export{SwitchRow};export default withTheme(Switch);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabView.tsx";import*as React from"react";import{TabView,TabBar}from"react-native-tab-view";import TabViewItem from"./TabViewItem";import{withTheme}from"
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TabView/TabView.tsx";import*as React from"react";import{TabView,TabBar}from"react-native-tab-view";import TabViewItem from"./TabViewItem";import{withTheme}from"@draftbit/theme";import{flattenReactFragments,extractStyles}from"../../utilities";import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";var TabViewComponent=function TabViewComponent(_ref){var Icon=_ref.Icon,onIndexChanged=_ref.onIndexChanged,onEndReached=_ref.onEndReached,_ref$initialTabIndex=_ref.initialTabIndex,initialTabIndex=_ref$initialTabIndex===void 0?0:_ref$initialTabIndex,tabBarPosition=_ref.tabBarPosition,keyboardDismissMode=_ref.keyboardDismissMode,swipeEnabled=_ref.swipeEnabled,scrollEnabled=_ref.scrollEnabled,activeColor=_ref.activeColor,inactiveColor=_ref.inactiveColor,pressColor=_ref.pressColor,indicatorColor=_ref.indicatorColor,tabsBackgroundColor=_ref.tabsBackgroundColor,_ref$iconSize=_ref.iconSize,iconSize=_ref$iconSize===void 0?16:_ref$iconSize,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?"top":_ref$iconPosition,style=_ref.style,theme=_ref.theme,childrenProp=_ref.children;var _React$useState=React.useState(initialTabIndex),_React$useState2=_slicedToArray(_React$useState,2),index=_React$useState2[0],setIndex=_React$useState2[1];var _React$useState3=React.useState([]),_React$useState4=_slicedToArray(_React$useState3,2),routes=_React$useState4[0],setRoutes=_React$useState4[1];var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;var children=React.useMemo(function(){return flattenReactFragments(React.Children.toArray(childrenProp)).filter(function(child){return React.isValidElement(child)&&child.type===TabViewItem;});},[childrenProp]);React.useEffect(function(){var newRoutes=[];children.forEach(function(item,idx){var child=item;newRoutes.push({key:idx.toString(),title:child.props.title,icon:child.props.icon,accessibilityLabel:child.props.accessibilityLabel});});setRoutes(newRoutes);},[children]);var indexChangeHandler=function indexChangeHandler(i){setIndex(i);onIndexChanged==null?void 0:onIndexChanged(i);if(i===routes.length){onEndReached==null?void 0:onEndReached();}};var renderTabBar=function renderTabBar(props){var tabFlexDirection;switch(iconPosition){case"top":tabFlexDirection="column";break;case"bottom":tabFlexDirection="column-reverse";break;case"left":tabFlexDirection="row";break;case"right":tabFlexDirection="row-reverse";break;}return _jsx(TabBar,Object.assign({},props,{activeColor:activeColor||theme.colors.branding.primary,inactiveColor:inactiveColor||"rgb(200,200,200)",pressColor:pressColor||theme.colors.branding.primary,scrollEnabled:scrollEnabled,indicatorStyle:{backgroundColor:indicatorColor||theme.colors.branding.primary},labelStyle:[{textTransform:"none"},textStyles],tabStyle:{flexDirection:tabFlexDirection},renderIcon:function renderIcon(_ref2){var route=_ref2.route,color=_ref2.color;return route!=null&&route.icon?_jsx(Icon,{name:route.icon,color:color,size:iconSize}):null;},style:{backgroundColor:tabsBackgroundColor||theme.colors.background.brand}}));};var renderScene=function renderScene(_ref3){var route=_ref3.route;var index=Number(route.key);return children[index];};if(!routes.length){return _jsx(_Fragment,{});}return _jsx(TabView,{style:viewStyles,navigationState:{index:index,routes:routes},renderScene:renderScene,renderTabBar:renderTabBar,onIndexChange:indexChangeHandler,tabBarPosition:tabBarPosition,keyboardDismissMode:keyboardDismissMode,swipeEnabled:swipeEnabled});};export default withTheme(TabViewComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","borderWidth","borderColor","borderStyle","drawTopBorder","drawBottomBorder","drawStartBorder","drawEndBorder","cellVerticalPadding","cellHorizontalPadding","data","keyExtractor","renderItem","children","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/Table.tsx";import React from"react";import{ScrollView,View,StyleSheet}from"react-native";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["theme","borderWidth","borderColor","borderStyle","drawTopBorder","drawBottomBorder","drawStartBorder","drawEndBorder","cellVerticalPadding","cellHorizontalPadding","data","keyExtractor","renderItem","children","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/Table.tsx";import React from"react";import{ScrollView,View,StyleSheet}from"react-native";import{withTheme}from"@draftbit/theme";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{Fragment as _Fragment,jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var Table=function Table(_ref){var theme=_ref.theme,_ref$borderWidth=_ref.borderWidth,borderWidth=_ref$borderWidth===void 0?1:_ref$borderWidth,_ref$borderColor=_ref.borderColor,borderColor=_ref$borderColor===void 0?theme.colors.border.brand:_ref$borderColor,_ref$borderStyle=_ref.borderStyle,borderStyle=_ref$borderStyle===void 0?"solid":_ref$borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?true:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?false:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?false:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,_ref$cellVerticalPadd=_ref.cellVerticalPadding,cellVerticalPadding=_ref$cellVerticalPadd===void 0?10:_ref$cellVerticalPadd,_ref$cellHorizontalPa=_ref.cellHorizontalPadding,cellHorizontalPadding=_ref$cellHorizontalPa===void 0?10:_ref$cellHorizontalPa,data=_ref.data,keyExtractor=_ref.keyExtractor,renderItem=_ref.renderItem,childrenProp=_ref.children,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);if(data&&!renderItem||renderItem&&!data){throw new Error("'renderItem' and 'data' need to both be provided to render from 'data'. Either remove them entirley or include both");}if(data&&renderItem&&childrenProp){console.warn("'children' of Table ignored due to usage of 'data' and 'renderItem'");}var isTableHeader=React.useCallback(function(object){return object.isTableHeader;},[]);var isRenderItem=Array.isArray(data)&&renderItem;var dataAsChildren=React.useMemo(function(){if(!isRenderItem)return[];return data.map(function(item,index){var component=renderItem({item:item,index:index});if(!component){return null;}var key=keyExtractor?keyExtractor(item,index):index.toString();return React.cloneElement(component,{key:key});});},[data,renderItem,keyExtractor,isRenderItem]);var children=isRenderItem?dataAsChildren:React.Children.toArray(childrenProp);var validChildren=React.useMemo(function(){return children.filter(function(item){return React.isValidElement(item);});},[children]);var childrenWithoutHeader=React.useMemo(function(){var flattenedWithoutNestedHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return React.cloneElement(item,{children:nestedChildren.filter(function(child){return!isTableHeader(child.props);})});}return item;});return flattenedWithoutNestedHeaders.filter(function(item){return!isTableHeader(item.props);});},[validChildren,isTableHeader]);var header=React.useMemo(function(){var flattenedPossibleHeaders=validChildren.map(function(item){var nestedChildren=React.Children.toArray(item.props.children);var nestedHeaders=nestedChildren.filter(function(child){return isTableHeader(child.props);});if(nestedHeaders!=null&&nestedHeaders.length){return nestedHeaders[0];}return item;});var allHeaders=flattenedPossibleHeaders.filter(function(item){return isTableHeader(item.props);});if(allHeaders.length){return allHeaders[0];}return null;},[validChildren,isTableHeader]);var contextValue={borderColor:borderColor,borderStyle:borderStyle,borderWidth:borderWidth,cellHorizontalPadding:cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding};var borderViewStyle=generateBorderStyles({borderColor:borderColor,borderWidth:borderWidth,borderStyle:borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});return _jsx(TableStyleContext.Provider,{value:contextValue,children:_jsxs(View,{style:[styles.container,borderViewStyle,style],children:[_jsx(_Fragment,{children:header}),_jsx(ScrollView,Object.assign({},rest,{children:childrenWithoutHeader}))]})});};var styles=StyleSheet.create({container:{flex:1}});export default withTheme(Table);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/TableRow.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{withTheme}from"
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Table/TableRow.tsx";import React from"react";import{View,StyleSheet}from"react-native";import{generateBorderStyles,TableStyleContext}from"./TableCommon";import{withTheme}from"@draftbit/theme";import Pressable from"../Pressable";import{jsx as _jsx}from"react/jsx-runtime";var TableRow=function TableRow(_ref){var borderWidth=_ref.borderWidth,borderColor=_ref.borderColor,borderStyle=_ref.borderStyle,_ref$drawTopBorder=_ref.drawTopBorder,drawTopBorder=_ref$drawTopBorder===void 0?false:_ref$drawTopBorder,_ref$drawBottomBorder=_ref.drawBottomBorder,drawBottomBorder=_ref$drawBottomBorder===void 0?true:_ref$drawBottomBorder,_ref$drawStartBorder=_ref.drawStartBorder,drawStartBorder=_ref$drawStartBorder===void 0?true:_ref$drawStartBorder,_ref$drawEndBorder=_ref.drawEndBorder,drawEndBorder=_ref$drawEndBorder===void 0?false:_ref$drawEndBorder,cellVerticalPadding=_ref.cellVerticalPadding,cellHorizontalPadding=_ref.cellHorizontalPadding,_ref$isTableHeader=_ref.isTableHeader,isTableHeader=_ref$isTableHeader===void 0?false:_ref$isTableHeader,children=_ref.children,onPress=_ref.onPress,style=_ref.style,theme=_ref.theme;var parentContextValue=React.useContext(TableStyleContext);var contextValue={borderColor:borderColor||parentContextValue.borderColor,borderStyle:borderStyle||parentContextValue.borderStyle,borderWidth:borderWidth||parentContextValue.borderWidth,cellHorizontalPadding:cellHorizontalPadding||parentContextValue.cellHorizontalPadding,cellVerticalPadding:cellVerticalPadding||parentContextValue.cellVerticalPadding};var borderViewStyle=generateBorderStyles({borderColor:contextValue.borderColor,borderWidth:contextValue.borderWidth,borderStyle:contextValue.borderStyle,drawTopBorder:drawTopBorder,drawBottomBorder:drawBottomBorder,drawStartBorder:drawStartBorder,drawEndBorder:drawEndBorder});var ContainerComponent=onPress?Pressable:View;return _jsx(TableStyleContext.Provider,{value:contextValue,children:_jsx(ContainerComponent,{onPress:onPress,style:[borderViewStyle,isTableHeader?{backgroundColor:theme.colors.branding.primary}:{},style,styles.cellsContainer],children:children})});};var styles=StyleSheet.create({cellsContainer:{flexDirection:"row"}});export default withTheme(TableRow);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Text.tsx",_this2=this;var _excluded=["style"],_excluded2=["style","theme","title"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{Text as NativeText,I18nManager}from"react-native";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Text.tsx",_this2=this;var _excluded=["style"],_excluded2=["style","theme","title"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{Text as NativeText,I18nManager}from"react-native";import{withTheme}from"@draftbit/theme";import{jsx as _jsx}from"react/jsx-runtime";var Text=function(_React$Component){_inherits(Text,_React$Component);var _super=_createSuper(Text);function Text(){_classCallCheck(this,Text);return _super.apply(this,arguments);}_createClass(Text,[{key:"render",value:function render(){var _this=this;var _this$props=this.props,style=_this$props.style,rest=_objectWithoutProperties(_this$props,_excluded);var writingDirection=I18nManager.isRTL?"rtl":"ltr";return _jsx(NativeText,Object.assign({},rest,{ref:function ref(c){_this._root=c;},style:[{textAlign:"left",writingDirection:writingDirection},style]}));}}]);return Text;}(React.Component);export var BaseLink=function BaseLink(_ref){var style=_ref.style,theme=_ref.theme,title=_ref.title,props=_objectWithoutProperties(_ref,_excluded2);return _jsx(Text,Object.assign({hitSlop:8,style:[{color:theme.colors.branding.primary},style],theme:theme},props,{children:title}));};var Link=withTheme(BaseLink);export{Link};export default withTheme(Text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextField.tsx";var _excluded=["theme","Icon","type","disabled","editable","label","error","leftIconName","leftIconMode","rightIconName","iconColor","iconSize","assistiveText","underlineColor","activeBorderColor","multiline","numberOfLines","style","render"],_excluded2=["lineHeight"],_excluded3=["backgroundColor","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{View,Animated,StyleSheet,Text,I18nManager,Platform}from"react-native";import{withTheme}from"../theming";import{applyStyles,extractStyles}from"../utilities";import TextInput from"./TextInput";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var AnimatedText=Animated.createAnimatedComponent(Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var TextField=function(_React$Component){_inherits(TextField,_React$Component);var _super=_createSuper(TextField);function TextField(){var _this;_classCallCheck(this,TextField);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={labeled:new Animated.Value(_this.props.value||_this.props.error?0:1),focused:false,placeholder:_this.props.error?_this.props.placeholder:"",labelLayout:{measured:false,width:0}};_this._timer=setTimeout(function(){},0);_this._showPlaceholder=function(){clearTimeout(_this._timer);_this._timer=setTimeout(function(){return _this.setState({placeholder:_this.props.placeholder});},50);};_this._hidePlaceholder=function(){return _this.setState({placeholder:""});};_this._restoreLabel=function(){return Animated.timing(_this.state.labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._minmizeLabel=function(){return Animated.timing(_this.state.labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._handleFocus=function(){if(_this.props.disabled){return;}_this.setState({focused:true});};_this._handleBlur=function(){if(_this.props.disabled){return;}_this.setState({focused:false});};_this._handleChangeText=function(value){if(_this.props.disabled){return;}if(typeof value==="string"){_this.setState({value:value});_this.props.onChangeText&&_this.props.onChangeText(value);}else{_this.setState({value:value.nativeEvent.text});_this.props.onChangeText&&_this.props.onChangeText(value.nativeEvent.text);}};_this._root=undefined;return _this;}_createClass(TextField,[{key:"componentDidMount",value:function componentDidMount(){if(this.props.defaultValue){this._handleChangeText(this.props.defaultValue);}if(this.props.placeholder){this._minmizeLabel();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(prevState.focused!==this.state.focused||prevState.value!==this.state.value){if(this.state.value||this.state.focused||this.props.error||this.props.placeholder){this._minmizeLabel();}else{this._restoreLabel();}}if(prevState.focused!==this.state.focused||prevProps.label!==this.props.label){if(this.state.focused||this.props.error||!this.props.label){this._showPlaceholder();}else{this._hidePlaceholder();}}}},{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this._timer);}},{key:"toggleFocus",value:function toggleFocus(){this.setState(function(prevState){return{focused:!prevState.focused};});}},{key:"isFocused",value:function isFocused(){return this._root&&this._root.isFocused();}},{key:"clear",value:function clear(){return this._root&&this._root.clear();}},{key:"focus",value:function focus(){return this._root&&this._root.focus();}},{key:"blur",value:function blur(){return this._root&&this._root.blur();}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,_this$props$theme=_this$props.theme,colors=_this$props$theme.colors,typography=_this$props$theme.typography,roundness=_this$props$theme.roundness,disabledOpacity=_this$props$theme.disabledOpacity,Icon=_this$props.Icon,_this$props$type=_this$props.type,type=_this$props$type===void 0?"underline":_this$props$type,_this$props$disabled=_this$props.disabled,disabled=_this$props$disabled===void 0?false:_this$props$disabled,_this$props$editable=_this$props.editable,editable=_this$props$editable===void 0?true:_this$props$editable,label=_this$props.label,_this$props$error=_this$props.error,error=_this$props$error===void 0?false:_this$props$error,leftIconName=_this$props.leftIconName,leftIconMode=_this$props.leftIconMode,rightIconName=_this$props.rightIconName,iconColor=_this$props.iconColor,iconSize=_this$props.iconSize,assistiveText=_this$props.assistiveText,underlineColorProp=_this$props.underlineColor,_this$props$activeBor=_this$props.activeBorderColor,activeBorderColorProp=_this$props$activeBor===void 0?colors.primary:_this$props$activeBor,_this$props$multiline=_this$props.multiline,multiline=_this$props$multiline===void 0?false:_this$props$multiline,_this$props$numberOfL=_this$props.numberOfLines,numberOfLines=_this$props$numberOfL===void 0?4:_this$props$numberOfL,style=_this$props.style,_this$props$render=_this$props.render,render=_this$props$render===void 0?function(props){return _jsx(TextInput,Object.assign({},props));}:_this$props$render,rest=_objectWithoutProperties(_this$props,_excluded);var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=typography.caption.fontSize;var hasActiveOutline=this.state.focused||error;var inputTextColor,activeColor,underlineColor,borderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.strong;if(disabled){activeColor=colors.light;placeholderColor=colors.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.divider;}else{activeColor=error?colors.error:activeBorderColorProp;placeholderColor=borderColor=colors.light;underlineColor=underlineColorProp||colors.light;backgroundColor=colors.background;}if(rest.placeholderTextColor){placeholderColor=rest.placeholderTextColor;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=_objectWithoutProperties(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1);if(!multiline){inputStyle.height=lineHeight;}var assistiveTextLeftMargin;if(type==="underline"){containerStyle={borderTopLeftRadius:roundness,borderTopRightRadius:roundness,paddingBottom:12,marginTop:16};if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8;}else{assistiveTextLeftMargin=0;}}else{containerStyle={borderRadius:roundness,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:1,paddingTop:label?16*1.5:16,paddingBottom:label?16*0.5:16,opacity:disabled?disabledOpacity:1,backgroundColor:backgroundColor};if(leftIconName&&leftIconMode==="inset"){assistiveTextLeftMargin=16+4;}else if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8+12;}else{assistiveTextLeftMargin=12;}}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(iconColor){leftIconColor=iconColor;}else if(error){leftIconColor=colors.error;}else if(this.state.focused){leftIconColor=colors.primary;}else{leftIconColor=colors.light;}var labelStyle=Object.assign({},typography.subtitle1,type==="solid"?{marginHorizontal:12}:{},{top:type==="solid"?16:0,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,transform:[{translateY:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(this.state.labelLayout.width/2),0]})}]});var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles;var inputStyles=applyStyles([styles.input,inputStyle,type==="solid"?{marginHorizontal:16}:{marginHorizontal:6}],textStyles);var _ref=StyleSheet.flatten(style||{}),bgColor=_ref.backgroundColor,padding=_ref.padding,paddingTop=_ref.paddingTop,paddingBottom=_ref.paddingBottom,paddingLeft=_ref.paddingLeft,paddingRight=_ref.paddingRight,borderRadius=_ref.borderRadius,borderWidth=_ref.borderWidth,borderTopWidth=_ref.borderTopWidth,borderRightWidth=_ref.borderRightWidth,borderBottomWidth=_ref.borderBottomWidth,borderLeftWidth=_ref.borderLeftWidth,borderCol=_ref.borderColor,styleProp=_objectWithoutProperties(_ref,_excluded3);return _jsxs(View,{style:[styles.container,styleProp],children:[_jsxs(View,{style:applyStyles([containerStyle],{height:styleProp.height,backgroundColor:bgColor,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,borderRadius:borderRadius,borderWidth:borderWidth,borderTopWidth:borderTopWidth,borderRightWidth:borderRightWidth,borderBottomWidth:borderBottomWidth,borderLeftWidth:borderLeftWidth,borderColor:borderCol}),children:[type==="underline"?_jsx(Animated.View,{style:[styles.underline,{backgroundColor:bgColor||(error?colors.error:this.state.focused?activeColor:underlineColor),transform:[{scaleY:this.state.focused?1:0.5}]}]}):null,label?_jsxs(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{opacity:this.state.value||this.state.focused?this.state.labelLayout.measured?1:0:1}],children:[_jsx(AnimatedText,{onLayout:function onLayout(e){return _this2.setState({labelLayout:{width:e.nativeEvent.layout.width,measured:true}});},style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),_jsx(AnimatedText,{style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:hasActiveOutline?this.state.labeled:1}],numberOfLines:1,children:label})]}):null,render(Object.assign({ref:function ref(c){_this2._root=c;},onChange:this._handleChangeText,placeholder:label?this.state.placeholder:this.props.placeholder,placeholderTextColor:placeholderColor,editable:!disabled&&editable,selectionColor:activeColor,multiline:multiline,numberOfLines:numberOfLines,onFocus:this._handleFocus,onBlur:this._handleBlur,underlineColorAndroid:"transparent",style:inputStyles},rest,{value:this.state.value}))]}),leftIconName?_jsx(Icon,{size:iconSize||ICON_SIZE,color:leftIconColor||colors.light,name:leftIconName,style:{position:"absolute",left:leftIconMode==="inset"&&type==="solid"?16:0,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,rightIconName?_jsx(Icon,{name:rightIconName,size:iconSize||ICON_SIZE,color:iconColor||colors.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,assistiveText?_jsx(Text,{style:[{color:error?colors.error:colors.light,marginTop:8,marginLeft:assistiveTextLeftMargin}],children:assistiveText}):null]});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){return{value:typeof nextProps.value!=="undefined"?nextProps.value:prevState.value};}}]);return TextField;}(React.Component);export default withTheme(TextField);var styles=StyleSheet.create({container:{alignSelf:"stretch"},placeholder:{position:"absolute",left:0},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:I18nManager.isRTL?"right":"left"}});
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";var _jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextField.tsx";var _excluded=["theme","Icon","type","disabled","editable","label","error","leftIconName","leftIconMode","rightIconName","iconColor","iconSize","assistiveText","underlineColor","activeBorderColor","multiline","numberOfLines","style","render"],_excluded2=["lineHeight"],_excluded3=["backgroundColor","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","borderRadius","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor"];function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}import*as React from"react";import{View,Animated,StyleSheet,Text,I18nManager,Platform}from"react-native";import{withTheme}from"@draftbit/theme";import{applyStyles,extractStyles}from"../utilities";import TextInput from"./TextInput";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var AnimatedText=Animated.createAnimatedComponent(Text);var FOCUS_ANIMATION_DURATION=150;var BLUR_ANIMATION_DURATION=180;var ICON_SIZE=24;var TextField=function(_React$Component){_inherits(TextField,_React$Component);var _super=_createSuper(TextField);function TextField(){var _this;_classCallCheck(this,TextField);for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this=_super.call.apply(_super,[this].concat(args));_this.state={labeled:new Animated.Value(_this.props.value||_this.props.error?0:1),focused:false,placeholder:_this.props.error?_this.props.placeholder:"",labelLayout:{measured:false,width:0}};_this._timer=setTimeout(function(){},0);_this._showPlaceholder=function(){clearTimeout(_this._timer);_this._timer=setTimeout(function(){return _this.setState({placeholder:_this.props.placeholder});},50);};_this._hidePlaceholder=function(){return _this.setState({placeholder:""});};_this._restoreLabel=function(){return Animated.timing(_this.state.labeled,{toValue:1,duration:FOCUS_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._minmizeLabel=function(){return Animated.timing(_this.state.labeled,{toValue:0,duration:BLUR_ANIMATION_DURATION,useNativeDriver:Platform.OS!=="web"}).start();};_this._handleFocus=function(){if(_this.props.disabled){return;}_this.setState({focused:true});};_this._handleBlur=function(){if(_this.props.disabled){return;}_this.setState({focused:false});};_this._handleChangeText=function(value){if(_this.props.disabled){return;}if(typeof value==="string"){_this.setState({value:value});_this.props.onChangeText&&_this.props.onChangeText(value);}else{_this.setState({value:value.nativeEvent.text});_this.props.onChangeText&&_this.props.onChangeText(value.nativeEvent.text);}};_this._root=undefined;return _this;}_createClass(TextField,[{key:"componentDidMount",value:function componentDidMount(){if(this.props.defaultValue){this._handleChangeText(this.props.defaultValue);}if(this.props.placeholder){this._minmizeLabel();}}},{key:"componentDidUpdate",value:function componentDidUpdate(prevProps,prevState){if(prevState.focused!==this.state.focused||prevState.value!==this.state.value){if(this.state.value||this.state.focused||this.props.error||this.props.placeholder){this._minmizeLabel();}else{this._restoreLabel();}}if(prevState.focused!==this.state.focused||prevProps.label!==this.props.label){if(this.state.focused||this.props.error||!this.props.label){this._showPlaceholder();}else{this._hidePlaceholder();}}}},{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this._timer);}},{key:"toggleFocus",value:function toggleFocus(){this.setState(function(prevState){return{focused:!prevState.focused};});}},{key:"isFocused",value:function isFocused(){return this._root&&this._root.isFocused();}},{key:"clear",value:function clear(){return this._root&&this._root.clear();}},{key:"focus",value:function focus(){return this._root&&this._root.focus();}},{key:"blur",value:function blur(){return this._root&&this._root.blur();}},{key:"render",value:function render(){var _this2=this;var _this$props=this.props,theme=_this$props.theme,Icon=_this$props.Icon,_this$props$type=_this$props.type,type=_this$props$type===void 0?"underline":_this$props$type,_this$props$disabled=_this$props.disabled,disabled=_this$props$disabled===void 0?false:_this$props$disabled,_this$props$editable=_this$props.editable,editable=_this$props$editable===void 0?true:_this$props$editable,label=_this$props.label,_this$props$error=_this$props.error,error=_this$props$error===void 0?false:_this$props$error,leftIconName=_this$props.leftIconName,leftIconMode=_this$props.leftIconMode,rightIconName=_this$props.rightIconName,iconColor=_this$props.iconColor,iconSize=_this$props.iconSize,assistiveText=_this$props.assistiveText,underlineColorProp=_this$props.underlineColor,_this$props$activeBor=_this$props.activeBorderColor,activeBorderColorProp=_this$props$activeBor===void 0?theme.colors.branding.primary:_this$props$activeBor,_this$props$multiline=_this$props.multiline,multiline=_this$props$multiline===void 0?false:_this$props$multiline,_this$props$numberOfL=_this$props.numberOfLines,numberOfLines=_this$props$numberOfL===void 0?4:_this$props$numberOfL,style=_this$props.style,_this$props$render=_this$props.render,render=_this$props$render===void 0?function(props){return _jsx(TextInput,Object.assign({},props));}:_this$props$render,rest=_objectWithoutProperties(_this$props,_excluded);var colors=theme.colors,typography=theme.typography;var MINIMIZED_LABEL_Y_OFFSET=-(typography.caption.lineHeight+4);var OUTLINE_MINIMIZED_LABEL_Y_OFFSET=-(16*0.5+4);var MAXIMIZED_LABEL_FONT_SIZE=typography.subtitle1.fontSize;var MINIMIZED_LABEL_FONT_SIZE=typography.caption.fontSize;var hasActiveOutline=this.state.focused||error;var inputTextColor,activeColor,underlineColor,borderColor,placeholderColor,containerStyle,backgroundColor,inputStyle;inputTextColor=colors.text.strong;if(disabled){activeColor=colors.text.light;placeholderColor=colors.text.light;borderColor="transparent";underlineColor="transparent";backgroundColor=colors.border.brand;}else{activeColor=error?colors.text.danger:activeBorderColorProp;placeholderColor=borderColor=colors.text.light;underlineColor=underlineColorProp||colors.text.light;backgroundColor=colors.background;}if(rest.placeholderTextColor){placeholderColor=rest.placeholderTextColor;}var _typography$subtitle=typography.subtitle1,lineHeight=_typography$subtitle.lineHeight,subtitle1=_objectWithoutProperties(_typography$subtitle,_excluded2);inputStyle=Object.assign({paddingVertical:0,color:inputTextColor,paddingLeft:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,paddingRight:rightIconName?ICON_SIZE+16+4:12},subtitle1);if(!multiline){inputStyle.height=lineHeight;}var assistiveTextLeftMargin;if(type==="underline"){containerStyle={borderTopLeftRadius:8,borderTopRightRadius:8,paddingBottom:12,marginTop:16};if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8;}else{assistiveTextLeftMargin=0;}}else{containerStyle={borderRadius:8,borderColor:hasActiveOutline?activeColor:borderColor,borderWidth:1,paddingTop:label?16*1.5:16,paddingBottom:label?16*0.5:16,opacity:disabled?0.5:1,backgroundColor:backgroundColor};if(leftIconName&&leftIconMode==="inset"){assistiveTextLeftMargin=16+4;}else if(leftIconName&&leftIconMode==="outset"){assistiveTextLeftMargin=ICON_SIZE+8+12;}else{assistiveTextLeftMargin=12;}}if(leftIconName&&leftIconMode==="outset"){containerStyle.marginLeft=ICON_SIZE+8;}var leftIconColor;if(iconColor){leftIconColor=iconColor;}else if(error){leftIconColor=colors.text.danger;}else if(this.state.focused){leftIconColor=colors.branding.primary;}else{leftIconColor=colors.text.light;}var labelStyle=Object.assign({},typography.subtitle1,type==="solid"?{marginHorizontal:12}:{},{top:type==="solid"?16:0,left:leftIconName&&leftIconMode==="inset"?ICON_SIZE+12:0,transform:[{translateY:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[type==="solid"?OUTLINE_MINIMIZED_LABEL_Y_OFFSET:MINIMIZED_LABEL_Y_OFFSET,0]})},{scale:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE,1]})},{translateX:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[-(1-MINIMIZED_LABEL_FONT_SIZE/MAXIMIZED_LABEL_FONT_SIZE)*(this.state.labelLayout.width/2),0]})}]});var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles;var inputStyles=applyStyles([styles.input,inputStyle,type==="solid"?{marginHorizontal:16}:{marginHorizontal:6}],textStyles);var _ref=StyleSheet.flatten(style||{}),bgColor=_ref.backgroundColor,padding=_ref.padding,paddingTop=_ref.paddingTop,paddingBottom=_ref.paddingBottom,paddingLeft=_ref.paddingLeft,paddingRight=_ref.paddingRight,borderRadius=_ref.borderRadius,borderWidth=_ref.borderWidth,borderTopWidth=_ref.borderTopWidth,borderRightWidth=_ref.borderRightWidth,borderBottomWidth=_ref.borderBottomWidth,borderLeftWidth=_ref.borderLeftWidth,borderCol=_ref.borderColor,styleProp=_objectWithoutProperties(_ref,_excluded3);return _jsxs(View,{style:[styles.container,styleProp],children:[_jsxs(View,{style:applyStyles([containerStyle],{height:styleProp.height,backgroundColor:bgColor,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,borderRadius:borderRadius,borderWidth:borderWidth,borderTopWidth:borderTopWidth,borderRightWidth:borderRightWidth,borderBottomWidth:borderBottomWidth,borderLeftWidth:borderLeftWidth,borderColor:borderCol}),children:[type==="underline"?_jsx(Animated.View,{style:[styles.underline,{backgroundColor:bgColor||(error?colors.background.danger:this.state.focused?activeColor:underlineColor),transform:[{scaleY:this.state.focused?1:0.5}]}]}):null,label?_jsxs(View,{pointerEvents:"none",style:[StyleSheet.absoluteFill,{opacity:this.state.value||this.state.focused?this.state.labelLayout.measured?1:0:1}],children:[_jsx(AnimatedText,{onLayout:function onLayout(e){return _this2.setState({labelLayout:{width:e.nativeEvent.layout.width,measured:true}});},style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:this.state.labeled.interpolate({inputRange:[0,1],outputRange:[hasActiveOutline?1:0,0]})}],numberOfLines:1,children:label}),_jsx(AnimatedText,{style:[styles.placeholder,labelStyle,{color:placeholderColor,opacity:hasActiveOutline?this.state.labeled:1}],numberOfLines:1,children:label})]}):null,render(Object.assign({ref:function ref(c){_this2._root=c;},onChange:this._handleChangeText,placeholder:label?this.state.placeholder:this.props.placeholder,placeholderTextColor:placeholderColor,editable:!disabled&&editable,selectionColor:activeColor,multiline:multiline,numberOfLines:numberOfLines,onFocus:this._handleFocus,onBlur:this._handleBlur,underlineColorAndroid:"transparent",style:inputStyles},rest,{value:this.state.value}))]}),leftIconName?_jsx(Icon,{size:iconSize||ICON_SIZE,color:leftIconColor||colors.text.light,name:leftIconName,style:{position:"absolute",left:leftIconMode==="inset"&&type==="solid"?16:0,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,rightIconName?_jsx(Icon,{name:rightIconName,size:iconSize||ICON_SIZE,color:iconColor||colors.text.light,style:{position:"absolute",right:16,marginTop:type==="solid"?MINIMIZED_LABEL_FONT_SIZE+4:16}}):null,assistiveText?_jsx(Text,{style:[{color:error?colors.text.danger:colors.text.light,marginTop:8,marginLeft:assistiveTextLeftMargin}],children:assistiveText}):null]});}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(nextProps,prevState){return{value:typeof nextProps.value!=="undefined"?nextProps.value:prevState.value};}}]);return TextField;}(React.Component);export default withTheme(TextField);var styles=StyleSheet.create({container:{alignSelf:"stretch"},placeholder:{position:"absolute",left:0},underline:{position:"absolute",left:0,right:0,bottom:0,height:2},input:{flexGrow:1,justifyContent:"center",textAlignVertical:"center",margin:0,textAlign:I18nManager.isRTL?"right":"left"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onChangeTextDelayed","changeTextDelay","webShowOutline","style","disabled","editable","value"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextInput.tsx";import React from"react";import{TextInput as NativeTextInput,Platform}from"react-native";import{useDebounce,useOnUpdate}from"../hooks";import{jsx as _jsx}from"react/jsx-runtime";var TextInput=React.forwardRef(function(_ref,ref){var onChangeTextDelayed=_ref.onChangeTextDelayed,_ref$changeTextDelay=_ref.changeTextDelay,changeTextDelay=_ref$changeTextDelay===void 0?500:_ref$changeTextDelay,_ref$webShowOutline=_ref.webShowOutline,webShowOutline=_ref$webShowOutline===void 0?true:_ref$webShowOutline,style=_ref.style,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$editable=_ref.editable,editable=_ref$editable===void 0?true:_ref$editable,value=_ref.value,rest=_objectWithoutProperties(_ref,_excluded);var delayedValue=useDebounce(value,changeTextDelay);useOnUpdate(function(){if(delayedValue!==undefined){onChangeTextDelayed==null?void 0:onChangeTextDelayed(delayedValue);}},[delayedValue]);return _jsx(NativeTextInput,Object.assign({testID:"native-text-input",ref:ref,value:value,editable:!disabled&&editable,style:[Platform.OS==="web"&&!webShowOutline?{outlineWidth:0}:{},style]},rest));});export default TextInput;
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onChangeTextDelayed","changeTextDelay","webShowOutline","style","disabled","editable","value"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/TextInput.tsx";import React from"react";import{TextInput as NativeTextInput,Platform}from"react-native";import{useDebounce,useOnUpdate}from"../hooks";import{useTheme}from"@draftbit/theme";import{jsx as _jsx}from"react/jsx-runtime";var TextInput=React.forwardRef(function(_ref,ref){var onChangeTextDelayed=_ref.onChangeTextDelayed,_ref$changeTextDelay=_ref.changeTextDelay,changeTextDelay=_ref$changeTextDelay===void 0?500:_ref$changeTextDelay,_ref$webShowOutline=_ref.webShowOutline,webShowOutline=_ref$webShowOutline===void 0?true:_ref$webShowOutline,style=_ref.style,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$editable=_ref.editable,editable=_ref$editable===void 0?true:_ref$editable,value=_ref.value,rest=_objectWithoutProperties(_ref,_excluded);var theme=useTheme();var delayedValue=useDebounce(value,changeTextDelay);useOnUpdate(function(){if(delayedValue!==undefined){onChangeTextDelayed==null?void 0:onChangeTextDelayed(delayedValue);}},[delayedValue]);return _jsx(NativeTextInput,Object.assign({testID:"native-text-input",ref:ref,value:value,editable:!disabled&&editable,style:[Platform.OS==="web"&&!webShowOutline?{outlineWidth:0}:{},{color:theme.colors.text.strong},style]},rest));});export default TextInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Typography.tsx";import React from"react";import{Text}from"react-native";import{withTheme}from"
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Typography.tsx";import React from"react";import{Text}from"react-native";import{withTheme}from"@draftbit/theme";import{jsx as _jsx}from"react/jsx-runtime";export var Title=withTheme(function(_ref){var text=_ref.text,theme=_ref.theme,style=_ref.style;return _jsx(Text,{style:[{fontSize:20,letterSpacing:0,lineHeight:26,color:theme.colors.text.normal},style],children:text});});export var Subtitle=withTheme(function(_ref2){var text=_ref2.text,theme=_ref2.theme,style=_ref2.style;return _jsx(Text,{style:[{fontSize:14,letterSpacing:0,lineHeight:16,color:theme.colors.text.medium},style],children:text});});export var Caption=withTheme(function(_ref3){var text=_ref3.text,theme=_ref3.theme,style=_ref3.style;return _jsx(Text,{style:[{fontSize:12,letterSpacing:0,lineHeight:14,color:theme.colors.text.light},style],children:text});});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","label","style","iconColor","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AccordionItem.tsx";import*as React from"react";import{Pressable,StyleSheet,View}from"react-native";import Text from"../components/Text";import{extractStyles}from"../utilities";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","label","style","iconColor","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AccordionItem.tsx";import*as React from"react";import{Pressable,StyleSheet,View}from"react-native";import Text from"../components/Text";import{extractStyles}from"../utilities";import{withTheme}from"@draftbit/theme";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function AccordionItem(_ref){var Icon=_ref.Icon,icon=_ref.icon,label=_ref.label,style=_ref.style,iconColor=_ref.iconColor,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _extractStyles=extractStyles(style),textStyles=_extractStyles.textStyles,viewStyles=_extractStyles.viewStyles;return _jsx(Pressable,Object.assign({style:[styles.container,viewStyles]},rest,{children:_jsxs(View,{style:styles.row,children:[icon?_jsx(Icon,{name:icon,size:24,color:iconColor||theme.colors.branding.primary}):null,_jsx(View,{style:[styles.item,styles.content],children:_jsx(Text,{selectable:false,style:textStyles,children:label})})]})}));};var styles=StyleSheet.create({container:{padding:8},row:{flexDirection:"row",alignItems:"center",paddingLeft:8},item:{marginVertical:6,paddingLeft:8},content:{flex:1,justifyContent:"center"}});export default withTheme(AccordionItem);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","image","size","onPress","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvatarEdit.tsx";import*as React from"react";import{View}from"react-native";import Touchable from"../components/Touchable";import CircleImage from"./CircleImage";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","image","size","onPress","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/AvatarEdit.tsx";import*as React from"react";import{View}from"react-native";import Touchable from"../components/Touchable";import CircleImage from"./CircleImage";import{withTheme}from"@draftbit/theme";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var AvatarEdit=function AvatarEdit(_ref){var Icon=_ref.Icon,image=_ref.image,_ref$size=_ref.size,size=_ref$size===void 0?80:_ref$size,_ref$onPress=_ref.onPress,onPress=_ref$onPress===void 0?function(){}:_ref$onPress,style=_ref.style,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var colorStyles={editBackgroundColor:theme.colors.branding.primary,editIconColor:theme.colors.background.brand,editBorderColor:theme.colors.background.brand};var dimensions={width:size,height:size};return _jsx(View,Object.assign({style:[style,dimensions]},rest,{children:_jsxs(Touchable,{onPress:onPress,children:[_jsx(CircleImage,{source:image,size:size}),_jsx(View,{style:{position:"absolute",top:-3,right:-3,borderColor:colorStyles.editBorderColor,backgroundColor:colorStyles.editBackgroundColor,borderRadius:size*(3/16),padding:size*(3/32)},children:_jsx(Icon,{name:"MaterialIcons/edit",color:colorStyles.editIconColor,size:size*(3/16)})})]})}));};export default withTheme(AvatarEdit);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Banner.tsx";import*as React from"react";import{Button,Text,View,StyleSheet,Animated}from"react-native";import Surface from"../components/Surface";import
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["initiallyVisible","dismissable","icon","buttonColor","content","contentStyle","style","theme","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Banner.tsx";import*as React from"react";import{Button,Text,View,StyleSheet,Animated}from"react-native";import Surface from"../components/Surface";import{withTheme}from"@draftbit/theme";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var ELEVATION=1;var DEFAULT_MAX_WIDTH=960;var Banner=function Banner(_ref){var _ref$initiallyVisible=_ref.initiallyVisible,initiallyVisible=_ref$initiallyVisible===void 0?true:_ref$initiallyVisible,_ref$dismissable=_ref.dismissable,dismissable=_ref$dismissable===void 0?true:_ref$dismissable,icon=_ref.icon,buttonColor=_ref.buttonColor,content=_ref.content,contentStyle=_ref.contentStyle,style=_ref.style,theme=_ref.theme,Icon=_ref.Icon,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(initiallyVisible),_React$useState2=_slicedToArray(_React$useState,2),visible=_React$useState2[0],setVisible=_React$useState2[1];React.useEffect(function(){if(initiallyVisible){setVisible(true);}},[initiallyVisible]);var _React$useRef=React.useRef(new Animated.Value(visible?1:0)),position=_React$useRef.current;var _React$useState3=React.useState({height:0,measured:false}),_React$useState4=_slicedToArray(_React$useState3,2),layout=_React$useState4[0],setLayout=_React$useState4[1];React.useEffect(function(){if(visible){Animated.timing(position,{duration:250,toValue:1,useNativeDriver:false}).start();}else{Animated.timing(position,{duration:200,toValue:0,useNativeDriver:false}).start();}},[visible,position]);var handleLayout=function handleLayout(_ref2){var nativeEvent=_ref2.nativeEvent;var height=nativeEvent.layout.height;setLayout({height:height,measured:true});};var height=Animated.multiply(position,layout.height);var translateY=Animated.multiply(Animated.add(position,-1),layout.height);return _jsx(Surface,Object.assign({},rest,{style:[styles.container,style],children:_jsxs(View,{style:[styles.wrapper,contentStyle],children:[_jsx(Animated.View,{style:{height:height}}),_jsxs(Animated.View,{onLayout:handleLayout,style:[layout.measured||!visible?[styles.absolute,{transform:[{translateY:translateY}]}]:null,!layout.measured&&!visible?{opacity:0}:null],children:[_jsxs(View,{style:[styles.content,{marginBottom:dismissable?0:16}],children:[icon?_jsx(View,{style:styles.icon,children:_jsx(Icon,{name:icon,size:40})}):null,_jsx(Text,{style:[styles.message,{color:theme.colors.text.normal}],accessibilityLiveRegion:visible?"polite":"none",accessibilityRole:"alert",children:content})]}),dismissable?_jsx(View,{style:styles.actions,children:_jsx(Button,{color:buttonColor||theme.colors.branding.primary,title:"Close",onPress:function onPress(){return setVisible(false);}})}):null]})]})}));};var styles=StyleSheet.create({container:{elevation:ELEVATION},wrapper:{overflow:"hidden",alignSelf:"center",width:"100%",maxWidth:DEFAULT_MAX_WIDTH},absolute:{position:"absolute",top:0,width:"100%"},content:{flexDirection:"row",justifyContent:"flex-start",marginHorizontal:8,marginTop:16,marginBottom:0},icon:{margin:8},message:{flex:1,margin:8},actions:{flexDirection:"row",justifyContent:"flex-end",margin:8}});export default withTheme(Banner);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["backgroundColor","padding"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Card.tsx";import React from"react";import{StyleSheet,View,Pressable}from"react-native";import Image from"../components/Image";import Surface from"../components/Surface";import{Title,Subtitle,Caption}from"../components/Typography";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["backgroundColor","padding"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Card.tsx";import React from"react";import{StyleSheet,View,Pressable}from"react-native";import Image from"../components/Image";import Surface from"../components/Surface";import{Title,Subtitle,Caption}from"../components/Typography";import{withTheme}from"@draftbit/theme";import Config from"../components/Config";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var ICON_SIZE=Config.cardIconSize;var ICON_CONTAINER_SIZE=Config.cardIconSize*2;var ICON_CONTAINER_PADDING=Config.cardIconSize/2-1;var ICON_ELEVATION=Config.cardIconElevation;export var TopRightCircleIcon=withTheme(function(_ref){var Icon=_ref.Icon,icon=_ref.icon,theme=_ref.theme,onPress=_ref.onPress;return _jsx(Surface,{style:{justifyContent:"center",alignItems:"center",elevation:ICON_ELEVATION,position:"absolute",top:12,right:12,width:ICON_CONTAINER_SIZE,height:ICON_CONTAINER_SIZE,padding:ICON_CONTAINER_PADDING,borderRadius:ICON_CONTAINER_SIZE,backgroundColor:"rgba(0, 0, 0, 0.1)"},children:_jsx(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref2){var pressed=_ref2.pressed;return[{opacity:pressed?0.8:1}];},children:_jsx(Icon,{name:icon,size:ICON_SIZE,color:theme.colors.background.brand})})});});var Card=function Card(_ref3){var Icon=_ref3.Icon,_ref3$image=_ref3.image,image=_ref3$image===void 0?Config.cardImageUrl:_ref3$image,title=_ref3.title,subtitle=_ref3.subtitle,description=_ref3.description,textCentered=_ref3.textCentered,icon=_ref3.icon,_ref3$aspectRatio=_ref3.aspectRatio,aspectRatio=_ref3$aspectRatio===void 0?1.5:_ref3$aspectRatio,_ref3$elevation=_ref3.elevation,elevation=_ref3$elevation===void 0?2:_ref3$elevation,style=_ref3.style,onPress=_ref3.onPress,onPressIcon=_ref3.onPressIcon,titleStyle=_ref3.titleStyle,subtitleStyle=_ref3.subtitleStyle,descriptionStyle=_ref3.descriptionStyle,theme=_ref3.theme,children=_ref3.children;var _StyleSheet$flatten=StyleSheet.flatten(style||{}),bgColor=_StyleSheet$flatten.backgroundColor,padding=_StyleSheet$flatten.padding,styles=_objectWithoutProperties(_StyleSheet$flatten,_excluded);var backgroundColor=bgColor?bgColor:theme.colors.background.brand;var innerPadding=padding?padding:12;return _jsx(Surface,{style:[{elevation:elevation,backgroundColor:backgroundColor},styles],children:_jsxs(Pressable,{disabled:!onPress,onPress:onPress,style:function style(_ref4){var pressed=_ref4.pressed;return[{opacity:pressed?0.8:1}];},children:[_jsx(Image,{style:{aspectRatio:aspectRatio},source:typeof image==="string"?{uri:image}:image,resizeMode:"cover"}),_jsx(View,{style:{padding:innerPadding},children:_jsxs(View,{style:{alignItems:textCentered?"center":"flex-start"},children:[title||title&&title!==""?_jsx(Title,{text:title,style:titleStyle}):null,subtitle||subtitle&&subtitle!==""?_jsx(Subtitle,{text:subtitle,style:subtitleStyle}):null,description||description&&description!==""?_jsx(View,{style:{marginTop:4},children:_jsx(Caption,{text:description,style:descriptionStyle})}):null,children]})}),icon?_jsx(TopRightCircleIcon,{Icon:Icon,icon:icon,onPress:onPressIcon}):null]})});};export default withTheme(Card);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["useThemeGutterPadding","borderColor","borderWidth","backgroundColor","backgroundImage","backgroundImageResizeMode","elevation","style","children","theme"],_excluded2=["flex","flexGrow","flexWrap","flexBasis","flexShrink","flexDirection","alignContent","justifyContent","alignItems","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","paddingVertical","paddingHorizontal"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Container.tsx";import*as React from"react";import{View,ImageBackground,StyleSheet}from"react-native";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["useThemeGutterPadding","borderColor","borderWidth","backgroundColor","backgroundImage","backgroundImageResizeMode","elevation","style","children","theme"],_excluded2=["flex","flexGrow","flexWrap","flexBasis","flexShrink","flexDirection","alignContent","justifyContent","alignItems","padding","paddingTop","paddingBottom","paddingLeft","paddingRight","paddingVertical","paddingHorizontal"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/Container.tsx";import*as React from"react";import{View,ImageBackground,StyleSheet}from"react-native";import{withTheme}from"@draftbit/theme";import Elevation from"../components/Elevation";import{jsx as _jsx}from"react/jsx-runtime";var Container=function Container(_ref){var useThemeGutterPadding=_ref.useThemeGutterPadding,borderColor=_ref.borderColor,borderWidth=_ref.borderWidth,backgroundColor=_ref.backgroundColor,backgroundImage=_ref.backgroundImage,backgroundImageResizeMode=_ref.backgroundImageResizeMode,elevation=_ref.elevation,style=_ref.style,children=_ref.children,theme=_ref.theme,rest=_objectWithoutProperties(_ref,_excluded);var _ref2=StyleSheet.flatten(style)||{},flex=_ref2.flex,flexGrow=_ref2.flexGrow,flexWrap=_ref2.flexWrap,flexBasis=_ref2.flexBasis,flexShrink=_ref2.flexShrink,flexDirection=_ref2.flexDirection,alignContent=_ref2.alignContent,justifyContent=_ref2.justifyContent,alignItems=_ref2.alignItems,padding=_ref2.padding,paddingTop=_ref2.paddingTop,paddingBottom=_ref2.paddingBottom,paddingLeft=_ref2.paddingLeft,paddingRight=_ref2.paddingRight,paddingVertical=_ref2.paddingVertical,paddingHorizontal=_ref2.paddingHorizontal,styleProp=_objectWithoutProperties(_ref2,_excluded2);var containerStyle=Object.assign({backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,width:"100%"},styleProp);var innerStyle={flex:flex,flexGrow:flexGrow,flexWrap:flexWrap,flexBasis:flexBasis,flexShrink:flexShrink,flexDirection:flexDirection,alignContent:alignContent,justifyContent:justifyContent,alignItems:alignItems,padding:padding,paddingTop:paddingTop,paddingBottom:paddingBottom,paddingLeft:paddingLeft,paddingRight:paddingRight,paddingVertical:paddingVertical,paddingHorizontal:paddingHorizontal||useThemeGutterPadding?16:0};var Wrap=elevation?Elevation:View;if(elevation)containerStyle.elevation=elevation;return _jsx(Wrap,Object.assign({style:[containerStyle,style]},rest,{children:backgroundImage?_jsx(ImageBackground,{source:typeof backgroundImage==="string"?{uri:backgroundImage}:backgroundImage,resizeMode:backgroundImageResizeMode,style:{flex:1},children:_jsx(View,{style:innerStyle,children:children})}):_jsx(View,{style:innerStyle,children:children})}));};export default withTheme(Container);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","labelColor","color","children","onPress","elevation","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedButton.tsx";import*as React from"react";import{ActivityIndicator,View,Text,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Elevation from"../components/Elevation";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","labelColor","color","children","onPress","elevation","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedButton.tsx";import*as React from"react";import{ActivityIndicator,View,Text,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Elevation from"../components/Elevation";import{withTheme}from"@draftbit/theme";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var Button=function Button(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$type=_ref.type,type=_ref$type===void 0?"solid":_ref$type,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,labelColor=_ref.labelColor,colorOverride=_ref.color,children=_ref.children,onPress=_ref.onPress,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?0:_ref$elevation,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor,borderColor,textColor,borderWidth;var buttonColor=colorOverride||colors.branding.primary;if(type==="solid"){backgroundColor=buttonColor;if(disabled){textColor=color(colors.background.brand).alpha(0.5).rgb().string();}else{textColor=labelColor||colors.background.brand;}}else{backgroundColor="transparent";if(disabled){textColor=color(buttonColor).alpha(0.5).rgb().string();}else{textColor=labelColor||buttonColor;}}if(type==="outline"){if(disabled){borderColor=color(buttonColor).alpha(0.5).rgb().string();}else{borderColor=buttonColor;}borderWidth=StyleSheet.hairlineWidth;}else{borderColor="transparent";borderWidth=0;}var buttonStyle={backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,borderRadius:8};var textStyle={textAlign:"center",color:textColor,marginVertical:16,marginHorizontal:16};var iconStyle=[styles.icon,{marginLeft:16,marginRight:-8,width:Config.buttonIconSize}];return _jsx(Elevation,{style:{elevation:elevation,alignSelf:"stretch"},children:_jsx(Pressable,Object.assign({},rest,{onPress:onPress,accessibilityState:{disabled:disabled},accessibilityRole:"button",disabled:disabled||loading,style:[styles.button,buttonStyle],children:_jsxs(View,{style:styles.content,children:[icon&&loading!==true?_jsx(View,{style:iconStyle,children:_jsx(Icon,{name:icon,size:Config.buttonIconSize,color:textColor})}):null,loading?_jsx(ActivityIndicator,{size:"small",color:textColor,style:iconStyle}):null,_jsx(Text,{numberOfLines:1,style:[textStyle,typography.button],children:children})]})}))});};var styles=StyleSheet.create({button:{minWidth:64,borderStyle:"solid"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},icon:{width:Config.buttonIconSize}});export default withTheme(Button);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["numColumns","children","onPress","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedCardWrapper.tsx";import React from"react";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["numColumns","children","onPress","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedCardWrapper.tsx";import React from"react";import{withTheme}from"@draftbit/theme";import Touchable from"../components/Touchable";import{jsx as _jsx}from"react/jsx-runtime";var getWidth=function getWidth(numColumns){switch(numColumns){case 1:return"33%";case 2:return"50%";default:return"100%";}};var Card=function Card(_ref){var _ref$numColumns=_ref.numColumns,numColumns=_ref$numColumns===void 0?3:_ref$numColumns,children=_ref.children,onPress=_ref.onPress,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);var width=getWidth(numColumns);return _jsx(Touchable,Object.assign({disabled:!onPress,onPress:onPress,style:[style,{width:width}]},rest,{children:children}));};export default withTheme(Card);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","color","label","onPress","elevation","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedFAB.tsx";import*as React from"react";import{ActivityIndicator,View,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Text from"../components/Text";import Elevation from"../components/Elevation";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["Icon","icon","disabled","type","loading","color","label","onPress","elevation","style","theme"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/DeprecatedFAB.tsx";import*as React from"react";import{ActivityIndicator,View,StyleSheet,Pressable}from"react-native";import color from"color";import Config from"../components/Config";import Text from"../components/Text";import Elevation from"../components/Elevation";import{withTheme}from"@draftbit/theme";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var FAB=function FAB(_ref){var Icon=_ref.Icon,icon=_ref.icon,_ref$disabled=_ref.disabled,disabled=_ref$disabled===void 0?false:_ref$disabled,_ref$type=_ref.type,type=_ref$type===void 0?"solid":_ref$type,_ref$loading=_ref.loading,loading=_ref$loading===void 0?false:_ref$loading,colorOverride=_ref.color,label=_ref.label,onPress=_ref.onPress,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?0:_ref$elevation,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,rest=_objectWithoutProperties(_ref,_excluded);var backgroundColor,borderColor,textColor,borderWidth;var buttonColor=colorOverride||colors.branding.primary;if(type==="standard"||type==="extended"||type==="fixed"){backgroundColor=buttonColor;if(disabled){textColor=color(colors.background.brand).alpha(0.5).rgb().string();}else{textColor=colors.background.brand;}}else{backgroundColor="transparent";if(disabled){textColor=color(buttonColor).alpha(0.5).rgb().string();}else{textColor=buttonColor;}}if(type==="outline"){if(disabled){borderColor=color(buttonColor).alpha(0.5).rgb().string();}else{borderColor=buttonColor;}borderWidth=StyleSheet.hairlineWidth;}else{borderColor="transparent";borderWidth=0;}var buttonStyle={backgroundColor:backgroundColor,borderColor:borderColor,borderWidth:borderWidth,borderRadius:8,alignItems:"center",justifyContent:"center"};var buttonStyles=[styles.button,buttonStyle];var contentStyle=[styles.content];var textStyle={textAlign:"center",color:textColor};var iconStyle=[styles.icon,{width:Config.buttonIconSize}];if(type==="standard"||type==="outline"){buttonStyle.width=Config.FABSize;buttonStyle.height=Config.FABSize;buttonStyle.borderRadius=Config.FABBorderRadius;contentStyle.push({width:Config.FABSize,height:Config.FABSize});}if(type==="extended"||type==="fixed"){iconStyle.push({marginLeft:16,marginRight:-8});textStyle.margin=16;}if(type==="fixed"){buttonStyles.push({height:Config.FABFixedHeight,alignSelf:"stretch"});}return _jsx(Elevation,{style:[{elevation:elevation},style],children:_jsx(Pressable,Object.assign({},rest,{onPress:onPress,accessibilityState:{disabled:disabled},accessibilityRole:"button",disabled:disabled||loading,style:buttonStyles,children:_jsxs(View,{style:styles.content,children:[icon&&loading!==true?_jsx(View,{style:iconStyle,children:_jsx(Icon,{name:icon,size:Config.buttonIconSize,color:textColor})}):null,loading?_jsx(ActivityIndicator,{size:"small",color:textColor,style:iconStyle}):null,label?_jsx(Text,{numberOfLines:1,style:[textStyle,typography.button],children:label}):null]})}))});};var styles=StyleSheet.create({button:{borderStyle:"solid"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},icon:{alignItems:"center",justifyContent:"center",width:Config.buttonIconSize},fixed:{left:0,right:0,bottom:0,height:64,borderRadius:0}});export default withTheme(FAB);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onPress","disabled","loading","iconName","style","theme","iconColor","bgColor","size","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/FAB.tsx";import*as React from"react";import{View,StyleSheet,Pressable,ActivityIndicator,Platform}from"react-native";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["onPress","disabled","loading","iconName","style","theme","iconColor","bgColor","size","Icon"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/FAB.tsx";import*as React from"react";import{View,StyleSheet,Pressable,ActivityIndicator,Platform}from"react-native";import{withTheme}from"@draftbit/theme";import{jsx as _jsx}from"react/jsx-runtime";var FAB=function FAB(_ref){var onPress=_ref.onPress,disabled=_ref.disabled,loading=_ref.loading,_ref$iconName=_ref.iconName,iconName=_ref$iconName===void 0?"MaterialIcons/add":_ref$iconName,style=_ref.style,theme=_ref.theme,iconColor=_ref.iconColor,bgColor=_ref.bgColor,_ref$size=_ref.size,size=_ref$size===void 0?50:_ref$size,Icon=_ref.Icon,props=_objectWithoutProperties(_ref,_excluded);var backgroundColor=bgColor||theme.colors.branding.primary;var color=iconColor||"#FFF";return _jsx(View,{style:[{width:size,height:size,borderRadius:size/2,overflow:"hidden"},style],children:_jsx(Pressable,Object.assign({onPress:onPress,disabled:loading||disabled,android_ripple:{color:"#333",radius:size/4},style:function style(_ref2){var pressed=_ref2.pressed;return[styles.button,{opacity:pressed||disabled?0.75:1,width:size,height:size,borderRadius:size/2,backgroundColor:backgroundColor}];}},props,{children:_jsx(View,{children:loading?_jsx(ActivityIndicator,{style:size>50?{marginTop:2,marginLeft:2}:undefined,size:size<=50?"small":"large",color:color}):_jsx(Icon,{name:iconName,size:size,color:color})})}))});};var styles=StyleSheet.create({button:Object.assign({backgroundColor:"#5a45ff",justifyContent:"center",alignItems:"center"},Platform.select({web:{cursor:"pointer",userSelect:"none"}}))});export default withTheme(FAB);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["lineHeight"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/FieldSearchBarFull.tsx";import*as React from"react";import{View,TextInput,StyleSheet}from"react-native";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _excluded=["lineHeight"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/FieldSearchBarFull.tsx";import*as React from"react";import{View,TextInput,StyleSheet}from"react-native";import{withTheme}from"@draftbit/theme";import Config from"../components/Config";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var FieldSearchBarFull=function FieldSearchBarFull(_ref){var showIcon=_ref.showIcon,Icon=_ref.Icon,_ref$icon=_ref.icon,icon=_ref$icon===void 0?"search":_ref$icon,_ref$placeholder=_ref.placeholder,placeholder=_ref$placeholder===void 0?"":_ref$placeholder,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography,changeOverride=_ref.onChange,submitOverride=_ref.onSubmit,value=_ref.value,defaultValue=_ref.defaultValue;var _React$useState=React.useState(false),_React$useState2=_slicedToArray(_React$useState,2),focused=_React$useState2[0],setIsFocused=_React$useState2[1];var onBlur=function onBlur(){setIsFocused(false);};var _React$useState3=React.useState(value||defaultValue),_React$useState4=_slicedToArray(_React$useState3,2),internalValue=_React$useState4[0],setInternalValue=_React$useState4[1];React.useEffect(function(){if(value!=null){setInternalValue(value);}},[value]);React.useEffect(function(){if(defaultValue!=null){setInternalValue(defaultValue);}},[defaultValue]);var onChange=React.useCallback(function(text){changeOverride&&changeOverride(text);},[changeOverride]);var onFocus=function onFocus(){setIsFocused(true);};var onSubmit=function onSubmit(e){submitOverride&&submitOverride(e);};var _typography$body=typography.body2,lineHeight=_typography$body.lineHeight,typeStyles=_objectWithoutProperties(_typography$body,_excluded);var handleChangeText=function handleChangeText(newValue){setInternalValue(newValue);if(onChange){onChange(newValue);}};return _jsxs(View,{style:[styles.container,style],children:[showIcon&&_jsx(Icon,{name:icon,size:Config.fieldSearchBarFullIconSize,color:focused?colors.branding.primary:colors.foreground.brand}),_jsx(View,{style:{marginLeft:showIcon?12:0,flex:1},children:_jsx(TextInput,{clearButtonMode:"while-editing",placeholder:placeholder,value:internalValue,onBlur:onBlur,onFocus:onFocus,onChangeText:handleChangeText,onSubmitEditing:onSubmit,placeholderTextColor:colors.foreground.brand,style:[{color:colors.text.medium},typeStyles]})})]});};var styles=StyleSheet.create({container:{flexDirection:"row",alignItems:"center"}});export default withTheme(FieldSearchBarFull);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/ProgressCircle.tsx";import*as React from"react";import{Text}from"react-native";import AnimatedCircularProgress from"./AnimatedCircularProgress";import{withTheme}from"
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/ProgressCircle.tsx";import*as React from"react";import{Text}from"react-native";import AnimatedCircularProgress from"./AnimatedCircularProgress";import{withTheme}from"@draftbit/theme";import{jsxs as _jsxs,jsx as _jsx}from"react/jsx-runtime";var ProgressCircle=function ProgressCircle(_ref){var _ref$progress=_ref.progress,progress=_ref$progress===void 0?0.5:_ref$progress,style=_ref.style,_ref$color=_ref.color,color=_ref$color===void 0?"primary":_ref$color,_ref$size=_ref.size,size=_ref$size===void 0?100:_ref$size,_ref$showsText=_ref.showsText,showsText=_ref$showsText===void 0?true:_ref$showsText,unfilledColor=_ref.unfilledColor,_ref$strokeCap=_ref.strokeCap,strokeCap=_ref$strokeCap===void 0?"butt":_ref$strokeCap,textStyle=_ref.textStyle,_ref$thickness=_ref.thickness,thickness=_ref$thickness===void 0?1:_ref$thickness,theme=_ref.theme;var progressNum=Math.round(progress*100);var tintColor=color||theme.colors.branding.primary;var backgroundColor=unfilledColor||theme.colors.branding.secondary;return _jsx(AnimatedCircularProgress,{size:size,width:thickness,backgroundWidth:thickness,fill:progressNum,tintColor:tintColor,backgroundColor:backgroundColor,rotation:0,lineCap:strokeCap,style:style,children:function children(fill){return showsText?_jsxs(Text,{style:[{fontSize:size*0.275,color:tintColor},textStyle],children:[Math.round(fill),"%"]}):null;}});};export default withTheme(ProgressCircle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","children","theme","labelStyle","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RadioButtonFieldGroup.tsx";import React from"react";import{View}from"react-native";import Text from"../components/Text";import{withTheme}from"
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","children","theme","labelStyle","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RadioButtonFieldGroup.tsx";import React from"react";import{View}from"react-native";import Text from"../components/Text";import{withTheme}from"@draftbit/theme";import RadioButtonGroup from"../components/RadioButton/RadioButtonGroup";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var RadioButtonFieldGroup=function RadioButtonFieldGroup(_ref){var label=_ref.label,children=_ref.children,theme=_ref.theme,labelStyle=_ref.labelStyle,style=_ref.style,rest=_objectWithoutProperties(_ref,_excluded);return _jsxs(View,{style:style,children:[_jsx(Text,{style:[{fontSize:theme.typography.headline4.fontSize,color:theme.typography.headline4.color},labelStyle],children:label}),_jsx(RadioButtonGroup,Object.assign({theme:theme},rest,{children:children}))]});};export default withTheme(RadioButtonFieldGroup);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RowBodyIcon.tsx";import*as React from"react";import{withTheme}from"
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RowBodyIcon.tsx";import*as React from"react";import{withTheme}from"@draftbit/theme";import Row from"../components/Row";import Config from"../components/Config";import{jsx as _jsx}from"react/jsx-runtime";var RowBodyIcon=function RowBodyIcon(_ref){var Icon=_ref.Icon,title=_ref.title,subtitle=_ref.subtitle,icon=_ref.icon,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography;return _jsx(Row,{titleTypeStyle:typography.body1,titleColor:colors.text.medium,subtitleTypeStyle:typography.subtitle2,subtitleColor:colors.foreground.brand,title:title,subtitle:subtitle,right:function right(){return _jsx(Icon,{name:icon,size:Config.rowSingleLineIconSize,color:colors.foreground.brand,style:{marginLeft:16}});},style:style});};export default withTheme(RowBodyIcon);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RowHeadlineImageCaption.tsx";import*as React from"react";import{Text}from"react-native";import{withTheme}from"
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RowHeadlineImageCaption.tsx";import*as React from"react";import{Text}from"react-native";import{withTheme}from"@draftbit/theme";import Row from"../components/Row";import{jsx as _jsx}from"react/jsx-runtime";var RowHeadlineImageCaption=function RowHeadlineImageCaption(_ref){var title=_ref.title,subtitle=_ref.subtitle,caption=_ref.caption,image=_ref.image,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography;return _jsx(Row,{titleTypeStyle:typography.headline6,titleColor:colors.text.strong,subtitleTypeStyle:typography.body2,subtitleColor:colors.text.medium,title:title,subtitle:subtitle,image:image,right:function right(){return _jsx(Text,{style:Object.assign({},typography.caption,{color:colors.text.strong,marginLeft:16}),children:caption});},style:style});};export default withTheme(RowHeadlineImageCaption);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RowHeadlineImageIcon.tsx";import*as React from"react";import{withTheme}from"
|
|
1
|
+
var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/deprecated-components/RowHeadlineImageIcon.tsx";import*as React from"react";import{withTheme}from"@draftbit/theme";import Row from"../components/Row";import Config from"../components/Config";import{jsx as _jsx}from"react/jsx-runtime";var RowHeadlineImageIcon=function RowHeadlineImageIcon(_ref){var Icon=_ref.Icon,icon=_ref.icon,title=_ref.title,image=_ref.image,subtitle=_ref.subtitle,_ref$multilineSubtitl=_ref.multilineSubtitle,multilineSubtitle=_ref$multilineSubtitl===void 0?false:_ref$multilineSubtitl,style=_ref.style,_ref$theme=_ref.theme,colors=_ref$theme.colors,typography=_ref$theme.typography;return _jsx(Row,{titleTypeStyle:typography.headline6,titleColor:colors.text.strong,subtitleTypeStyle:typography.body2,subtitleColor:colors.text.medium,title:title,subtitle:subtitle,multilineSubtitle:multilineSubtitle,image:image,right:function right(){return _jsx(Icon,{name:icon,size:multilineSubtitle?Config.rowMultiLineIconSize:Config.rowSingleLineIconSize,color:colors.text.light,style:{marginLeft:16,alignSelf:multilineSubtitle?"flex-start":"center",marginTop:multilineSubtitle?4:0}});},style:style});};export default withTheme(RowHeadlineImageIcon);
|