@draftbit/core 49.5.1-99e063.2 → 49.5.1-eb936e.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/HeadlessAudioPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/AudioPlayer/index.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
- package/lib/commonjs/components/Picker/NativePicker.js +1 -1
- package/lib/commonjs/components/Picker/PickerCommon.js +1 -1
- package/lib/commonjs/components/Picker/dropdown/DropDownModalPicker.js +1 -0
- 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/commonjs/styles/DarkTheme.js +1 -0
- package/lib/commonjs/styles/DefaultTheme.js +1 -0
- package/lib/commonjs/styles/fonts.js +1 -0
- package/lib/commonjs/styles/overlay.js +1 -0
- package/lib/commonjs/styles/shadow.js +1 -0
- package/lib/commonjs/theming.js +1 -0
- package/lib/typescript/src/Provider.d.ts +5 -7
- 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 +5 -3
- 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 +5 -3
- 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 +10 -11
- 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 +2 -4
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js +3 -4
- package/lib/typescript/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +5 -3
- package/lib/typescript/src/components/DatePicker/DatePicker.js +23 -24
- package/lib/typescript/src/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.d.ts +5010 -4
- package/lib/typescript/src/components/DatePicker/DatePickerComponent.web.js +6 -8
- 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 +5 -3
- 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 +5 -3
- 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 +5 -3
- package/lib/typescript/src/components/Elevation.js +4 -3
- package/lib/typescript/src/components/Elevation.js.map +1 -1
- package/lib/typescript/src/components/FormRow.d.ts +2 -1
- package/lib/typescript/src/components/FormRow.js.map +1 -1
- package/lib/typescript/src/components/IconButton.d.ts +5 -3
- 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 +2 -0
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.d.ts +4 -5
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +13 -10
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +3 -25
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.d.ts +4 -2
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.js +3 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.d.ts +6 -0
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js +43 -0
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +11 -3
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/lib/typescript/src/components/Picker/NativePicker.d.ts +3 -1
- package/lib/typescript/src/components/Picker/NativePicker.js +2 -5
- package/lib/typescript/src/components/Picker/NativePicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/PickerCommon.d.ts +8 -2
- package/lib/typescript/src/components/Picker/PickerCommon.js +11 -0
- package/lib/typescript/src/components/Picker/PickerCommon.js.map +1 -1
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.d.ts +6 -0
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js +70 -0
- package/lib/typescript/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -0
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.d.ts +3 -1
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js +5 -11
- package/lib/typescript/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/lib/typescript/src/components/Picker/dropdown/MultiSelectPicker.d.ts +3 -1
- 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 +6 -4
- package/lib/typescript/src/components/Picker/index.js +5 -1
- package/lib/typescript/src/components/Picker/index.js.map +1 -1
- package/lib/typescript/src/components/PinInput/PinInput.d.ts +5 -3
- 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 +5 -3
- 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 +9 -1
- package/lib/typescript/src/components/Portal/Portal.js +5 -3
- 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 +3 -1
- 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 +3 -1
- 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 +13 -10
- 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 +2 -4
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.js +3 -4
- package/lib/typescript/src/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/lib/typescript/src/components/Row.d.ts +5 -3
- 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 +6 -3
- package/lib/typescript/src/components/ScreenContainer.js +2 -3
- package/lib/typescript/src/components/ScreenContainer.js.map +1 -1
- package/lib/typescript/src/components/SectionList/SectionHeader.d.ts +5 -3
- 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 +6 -3
- 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 +5 -3
- 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 +5 -3
- package/lib/typescript/src/components/Stepper.js +2 -3
- package/lib/typescript/src/components/Stepper.js.map +1 -1
- package/lib/typescript/src/components/Surface.d.ts +5 -3
- package/lib/typescript/src/components/Surface.js +10 -3
- package/lib/typescript/src/components/Surface.js.map +1 -1
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.d.ts +5 -3
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js +5 -10
- package/lib/typescript/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
- package/lib/typescript/src/components/Swiper/Swiper.d.ts +2 -4
- package/lib/typescript/src/components/Swiper/Swiper.js +2 -3
- package/lib/typescript/src/components/Swiper/Swiper.js.map +1 -1
- package/lib/typescript/src/components/Switch.d.ts +24 -7
- package/lib/typescript/src/components/Switch.js +4 -3
- package/lib/typescript/src/components/Switch.js.map +1 -1
- package/lib/typescript/src/components/TabView/TabView.d.ts +5 -3
- 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 +5 -3
- 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 +5 -3
- package/lib/typescript/src/components/Table/TableRow.js +2 -4
- package/lib/typescript/src/components/Table/TableRow.js.map +1 -1
- package/lib/typescript/src/components/Text.d.ts +9 -3
- 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 +41 -4
- package/lib/typescript/src/components/TextField.js +20 -22
- package/lib/typescript/src/components/TextField.js.map +1 -1
- package/lib/typescript/src/components/TextInput.js +0 -3
- package/lib/typescript/src/components/TextInput.js.map +1 -1
- package/lib/typescript/src/components/Typography.d.ts +11 -5
- 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 +5 -3
- 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 +5 -3
- 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 +5 -3
- package/lib/typescript/src/deprecated-components/Banner.js +5 -4
- package/lib/typescript/src/deprecated-components/Banner.js.map +1 -1
- package/lib/typescript/src/deprecated-components/Card.d.ts +18 -6
- 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 +5 -3
- 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 +5 -3
- 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 +5 -3
- 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 +5 -3
- 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 +8 -3
- 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 +5 -3
- 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 +8 -5
- 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 +3 -1
- 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 +5 -3
- 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 +5 -3
- 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 +5 -3
- 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 +9 -6
- 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 +2 -0
- package/lib/typescript/src/index.js +2 -0
- package/lib/typescript/src/index.js.map +1 -1
- package/lib/typescript/src/styles/DarkTheme.d.ts +3 -0
- package/lib/typescript/src/styles/DarkTheme.js +27 -0
- package/lib/typescript/src/styles/DarkTheme.js.map +1 -0
- package/lib/typescript/src/styles/DefaultTheme.d.ts +1670 -0
- package/lib/typescript/src/styles/DefaultTheme.js +112 -0
- package/lib/typescript/src/styles/DefaultTheme.js.map +1 -0
- package/lib/typescript/src/styles/fonts.d.ts +5 -0
- package/lib/typescript/src/styles/fonts.js +63 -0
- package/lib/typescript/src/styles/fonts.js.map +1 -0
- package/lib/typescript/src/styles/overlay.d.ts +2 -0
- package/lib/typescript/src/styles/overlay.js +61 -0
- package/lib/typescript/src/styles/overlay.js.map +1 -0
- package/lib/typescript/src/styles/shadow.d.ts +23 -0
- package/lib/typescript/src/styles/shadow.js +52 -0
- package/lib/typescript/src/styles/shadow.js.map +1 -0
- package/lib/typescript/src/theming.d.ts +8 -0
- package/lib/typescript/src/theming.js +4 -0
- package/lib/typescript/src/theming.js.map +1 -0
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -5
- package/src/Provider.js +4 -4
- package/src/Provider.js.map +1 -1
- package/src/Provider.tsx +12 -15
- 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 +10 -11
- package/src/components/Button.js.map +1 -1
- package/src/components/Button.tsx +24 -12
- 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 +3 -4
- package/src/components/Checkbox/CheckboxRow.js.map +1 -1
- package/src/components/Checkbox/CheckboxRow.tsx +2 -9
- package/src/components/DatePicker/DatePicker.js +23 -24
- package/src/components/DatePicker/DatePicker.js.map +1 -1
- package/src/components/DatePicker/DatePicker.tsx +24 -25
- package/src/components/DatePicker/DatePickerComponent.web.js +6 -8
- package/src/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/src/components/DatePicker/DatePickerComponent.web.tsx +8 -15
- package/src/components/DatePicker/DatePickerComponentType.ts +3 -2
- 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 +4 -3
- package/src/components/Elevation.js.map +1 -1
- package/src/components/Elevation.tsx +6 -5
- package/src/components/FormRow.js.map +1 -1
- package/src/components/FormRow.tsx +2 -1
- 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 +2 -0
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js +13 -10
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx +19 -19
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +3 -25
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx +8 -31
- package/src/components/MediaPlayer/AudioPlayer/index.js +3 -1
- package/src/components/MediaPlayer/AudioPlayer/index.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/index.tsx +3 -1
- package/src/components/MediaPlayer/MediaPlayerCommon.js +43 -0
- package/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/src/components/MediaPlayer/MediaPlayerCommon.ts +56 -0
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +11 -3
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx +18 -1
- package/src/components/Picker/NativePicker.js +2 -5
- package/src/components/Picker/NativePicker.js.map +1 -1
- package/src/components/Picker/NativePicker.tsx +2 -5
- package/src/components/Picker/PickerCommon.js +11 -0
- package/src/components/Picker/PickerCommon.js.map +1 -1
- package/src/components/Picker/PickerCommon.ts +24 -2
- package/src/components/Picker/dropdown/DropDownModalPicker.js +70 -0
- package/src/components/Picker/dropdown/DropDownModalPicker.js.map +1 -0
- package/src/components/Picker/dropdown/DropDownModalPicker.tsx +155 -0
- package/src/components/Picker/dropdown/DropDownPicker.js +5 -11
- package/src/components/Picker/dropdown/DropDownPicker.js.map +1 -1
- package/src/components/Picker/dropdown/DropDownPicker.tsx +8 -21
- 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 +5 -1
- package/src/components/Picker/index.js.map +1 -1
- package/src/components/Picker/index.tsx +15 -4
- 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 +5 -3
- package/src/components/Portal/Portal.js.map +1 -1
- package/src/components/Portal/Portal.tsx +10 -3
- 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 +11 -10
- package/src/components/RadioButton/RadioButtonGroup.tsx +2 -2
- package/src/components/RadioButton/RadioButtonRow.js +3 -4
- package/src/components/RadioButton/RadioButtonRow.js.map +1 -1
- package/src/components/RadioButton/RadioButtonRow.tsx +2 -9
- 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 -3
- package/src/components/ScreenContainer.js.map +1 -1
- package/src/components/ScreenContainer.tsx +4 -5
- 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 +2 -3
- package/src/components/Stepper.js.map +1 -1
- package/src/components/Stepper.tsx +4 -5
- package/src/components/Surface.js +10 -3
- package/src/components/Surface.js.map +1 -1
- package/src/components/Surface.tsx +12 -5
- package/src/components/SwipeableItem/SwipeableItem.js +5 -10
- package/src/components/SwipeableItem/SwipeableItem.js.map +1 -1
- package/src/components/SwipeableItem/SwipeableItem.tsx +7 -13
- package/src/components/Swiper/Swiper.js +2 -3
- package/src/components/Swiper/Swiper.js.map +1 -1
- package/src/components/Swiper/Swiper.tsx +3 -6
- package/src/components/Switch.js +4 -3
- 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 +2 -4
- package/src/components/Table/TableRow.js.map +1 -1
- package/src/components/Table/TableRow.tsx +4 -6
- 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 +20 -22
- package/src/components/TextField.js.map +1 -1
- package/src/components/TextField.tsx +23 -26
- package/src/components/TextInput.js +0 -3
- package/src/components/TextInput.js.map +1 -1
- package/src/components/TextInput.tsx +0 -3
- 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 +5 -4
- package/src/deprecated-components/Banner.js.map +1 -1
- package/src/deprecated-components/Banner.tsx +10 -6
- package/src/deprecated-components/Card.js +3 -3
- package/src/deprecated-components/Card.js.map +1 -1
- package/src/deprecated-components/Card.tsx +6 -10
- 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 +8 -7
- 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 +11 -12
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/index.tsx +2 -0
- package/src/styles/DarkTheme.js +27 -0
- package/src/styles/DarkTheme.js.map +1 -0
- package/src/styles/DarkTheme.tsx +30 -0
- package/src/styles/DefaultTheme.js +112 -0
- package/src/styles/DefaultTheme.js.map +1 -0
- package/src/styles/DefaultTheme.tsx +114 -0
- package/src/styles/fonts.js +63 -0
- package/src/styles/fonts.js.map +1 -0
- package/src/styles/fonts.tsx +67 -0
- package/src/styles/overlay.js +61 -0
- package/src/styles/overlay.js.map +1 -0
- package/src/styles/overlay.tsx +69 -0
- package/src/styles/shadow.js +52 -0
- package/src/styles/shadow.js.map +1 -0
- package/src/styles/shadow.tsx +55 -0
- package/src/theming.js +4 -0
- package/src/theming.js.map +1 -0
- package/src/theming.tsx +6 -0
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import DateFnsUtils from "@date-io/date-fns";
|
|
3
3
|
import { MuiPickersUtilsProvider, DatePicker, TimePicker, DateTimePicker, } from "@material-ui/pickers";
|
|
4
|
-
import { createMuiTheme, ThemeProvider
|
|
5
|
-
import { withTheme
|
|
4
|
+
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
|
|
5
|
+
import { withTheme } from "../../theming";
|
|
6
|
+
import Theme from "../../styles/DefaultTheme";
|
|
6
7
|
const DatePickerComponent = ({ value, onChange, mode, toggleVisibility, isVisible, minimumDate, maximumDate, theme, }) => {
|
|
7
|
-
var _a, _b;
|
|
8
8
|
const internalTheme = createMuiTheme({
|
|
9
9
|
palette: {
|
|
10
10
|
primary: {
|
|
11
|
-
main: theme.colors.
|
|
12
|
-
((_a = DefaultTheme.colors.branding) === null || _a === void 0 ? void 0 : _a.primary),
|
|
11
|
+
main: theme.colors.primary || Theme.colors.primary,
|
|
13
12
|
},
|
|
14
13
|
secondary: {
|
|
15
|
-
main: theme.colors.
|
|
16
|
-
((_b = DefaultTheme.colors.branding) === null || _b === void 0 ? void 0 : _b.secondary),
|
|
14
|
+
main: theme.colors.secondary || Theme.colors.secondary,
|
|
17
15
|
},
|
|
18
16
|
},
|
|
19
17
|
});
|
|
@@ -23,7 +21,7 @@ const DatePickerComponent = ({ value, onChange, mode, toggleVisibility, isVisibl
|
|
|
23
21
|
? TimePicker
|
|
24
22
|
: DateTimePicker;
|
|
25
23
|
return (React.createElement(MuiPickersUtilsProvider, { utils: DateFnsUtils },
|
|
26
|
-
React.createElement(
|
|
24
|
+
React.createElement(ThemeProvider, { theme: internalTheme },
|
|
27
25
|
React.createElement(Picker, { value: value, open: isVisible, onChange: (d) => {
|
|
28
26
|
toggleVisibility();
|
|
29
27
|
onChange(null, d);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerComponent.web.js","sourceRoot":"","sources":["../../../../../src/components/DatePicker/DatePickerComponent.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"DatePickerComponent.web.js","sourceRoot":"","sources":["../../../../../src/components/DatePicker/DatePickerComponent.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,uBAAuB,EACvB,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,2BAA2B,CAAC;AAE9C,MAAM,mBAAmB,GAA8C,CAAC,EACtE,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,WAAW,EACX,KAAK,GACN,EAAE,EAAE;IACH,MAAM,aAAa,GAAG,cAAc,CAAC;QACnC,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO;aACnD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS;aACvD;SACF;KACF,CAAC,CAAC;IAEH,MAAM,MAAM,GACV,IAAI,KAAK,MAAM;QACb,CAAC,CAAC,UAAU;QACZ,CAAC,CAAC,IAAI,KAAK,MAAM;YACjB,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,cAAc,CAAC;IAErB,OAAO,CACL,oBAAC,uBAAuB,IAAC,KAAK,EAAE,YAAY;QAC1C,oBAAC,aAAa,IAAC,KAAK,EAAE,aAAa;YACjC,oBAAC,MAAM,IACL,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;oBACd,gBAAgB,EAAE,CAAC;oBACnB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;gBACpB,CAAC,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE,EACjC,OAAO,EAAC,QAAQ,EAChB,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI,EAC9B,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,WAAW,GACpB,CACY,CACQ,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import theme from "../../styles/DefaultTheme";
|
|
2
2
|
export interface DatePickerComponentProps {
|
|
3
3
|
value: Date;
|
|
4
4
|
onChange: (e: any, data?: any) => void;
|
|
@@ -7,5 +7,5 @@ export interface DatePickerComponentProps {
|
|
|
7
7
|
isVisible?: boolean;
|
|
8
8
|
minimumDate?: Date;
|
|
9
9
|
maximumDate?: Date;
|
|
10
|
-
theme?:
|
|
10
|
+
theme?: typeof theme;
|
|
11
11
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Theme } from "../../styles/DefaultTheme";
|
|
4
4
|
export interface DeckSwiperCardProps {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
-
theme:
|
|
6
|
+
theme: Theme;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: React.ComponentType<
|
|
8
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<DeckSwiperCardProps>, "theme"> & {
|
|
9
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
10
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<DeckSwiperCardProps>> & React.FC<React.PropsWithChildren<DeckSwiperCardProps>>, {}>;
|
|
9
11
|
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleSheet } from "react-native";
|
|
3
|
-
import { withTheme } from "
|
|
3
|
+
import { withTheme } from "../../theming";
|
|
4
4
|
const DeckSwiperCard = ({ style, children, theme }) => (React.createElement(View, { style: [
|
|
5
5
|
styles.card,
|
|
6
6
|
{
|
|
7
|
-
backgroundColor: theme.colors.background
|
|
8
|
-
borderColor: theme.colors.
|
|
7
|
+
backgroundColor: theme.colors.background,
|
|
8
|
+
borderColor: theme.colors.divider,
|
|
9
9
|
},
|
|
10
10
|
style,
|
|
11
11
|
] }, children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeckSwiperCard.js","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiperCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"DeckSwiperCard.js","sourceRoot":"","sources":["../../../../../src/components/DeckSwiper/DeckSwiperCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAO1C,MAAM,cAAc,GAEhB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAClC,oBAAC,IAAI,IACH,KAAK,EAAE;QACL,MAAM,CAAC,IAAI;QACX;YACE,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU;YACxC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;SAClC;QACD,KAAK;KACN,IAEA,QAAQ,CACJ,CACR,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,CAAC;KACf;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import
|
|
3
|
+
import theme from "../styles/DefaultTheme";
|
|
4
4
|
declare type Props = {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
6
|
color?: string;
|
|
7
|
-
theme:
|
|
7
|
+
theme: typeof theme;
|
|
8
8
|
};
|
|
9
|
-
declare const _default: React.ComponentType<
|
|
9
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
|
|
10
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
11
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
10
12
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
|
-
import { withTheme } from "
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
4
|
const Divider = ({ style, color, theme: { colors }, ...rest }) => {
|
|
5
5
|
return (React.createElement(View, { style: [
|
|
6
6
|
{
|
|
7
|
-
backgroundColor: color || colors.
|
|
7
|
+
backgroundColor: color || colors.divider,
|
|
8
8
|
height: StyleSheet.hairlineWidth,
|
|
9
9
|
},
|
|
10
10
|
style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../../src/components/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../../../../src/components/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AASvC,MAAM,OAAO,GAA6C,CAAC,EACzD,KAAK,EACL,KAAK,EACL,KAAK,EAAE,EAAE,MAAM,EAAE,EACjB,GAAG,IAAI,EACR,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,IAAI,IACH,KAAK,EAAE;YACL;gBACE,eAAe,EAAE,KAAK,IAAI,MAAM,CAAC,OAAO;gBACxC,MAAM,EAAE,UAAU,CAAC,aAAa;aACjC;YACD,KAAK;SACN,KACG,IAAI,GACR,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ViewProps, StyleProp, ViewStyle } from "react-native";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Theme } from "../styles/DefaultTheme";
|
|
4
4
|
declare type Props = {
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
|
-
theme:
|
|
6
|
+
theme: Theme;
|
|
7
7
|
} & ViewProps;
|
|
8
|
-
declare const _default: React.ComponentType<
|
|
8
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
|
|
9
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
10
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
9
11
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Animated, StyleSheet, View, } from "react-native";
|
|
3
|
-
import
|
|
3
|
+
import shadow from "../styles/shadow";
|
|
4
|
+
import { withTheme } from "../theming";
|
|
4
5
|
/* directly copied from https://github.com/callstack/react-native-paper/blob/main/src/components/Surface.tsx#L62 */
|
|
5
6
|
const Elevation = ({ style, theme, children, ...rest }) => {
|
|
6
7
|
const { elevation = 4, borderRadius: radius } = StyleSheet.flatten(style) || {};
|
|
@@ -9,9 +10,9 @@ const Elevation = ({ style, theme, children, ...rest }) => {
|
|
|
9
10
|
return (React.createElement(Animated.View, { ...rest, style: [
|
|
10
11
|
{
|
|
11
12
|
borderRadius,
|
|
12
|
-
backgroundColor: colors.
|
|
13
|
+
backgroundColor: colors.surface,
|
|
13
14
|
},
|
|
14
|
-
elevation ?
|
|
15
|
+
elevation ? shadow(elevation) : null,
|
|
15
16
|
style,
|
|
16
17
|
] },
|
|
17
18
|
React.createElement(View, { style: { overflow: "hidden", borderRadius } }, children)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Elevation.js","sourceRoot":"","sources":["../../../../src/components/Elevation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,UAAU,EAIV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Elevation.js","sourceRoot":"","sources":["../../../../src/components/Elevation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,QAAQ,EACR,UAAU,EAIV,IAAI,GACL,MAAM,cAAc,CAAC;AACtB,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQvC,mHAAmH;AACnH,MAAM,SAAS,GAA6C,CAAC,EAC3D,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,EAAE,SAAS,GAAG,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,GAC3C,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAClC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,YAAY,GAAG,MAAM,CAAC;IAE5B,OAAO,CACL,oBAAC,QAAQ,CAAC,IAAI,OACR,IAAI,EACR,KAAK,EAAE;YACL;gBACE,YAAY;gBACZ,eAAe,EAAE,MAAM,CAAC,OAAO;aAChC;YACD,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;YACpC,KAAK;SACN;QAED,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAG,QAAQ,CAAQ,CACtD,CACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import { RowDirection } from "@draftbit/types";
|
|
3
4
|
declare type Props = {
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
label: string;
|
|
6
|
-
direction:
|
|
7
|
+
direction: RowDirection;
|
|
7
8
|
children: React.ReactNode;
|
|
8
9
|
style?: StyleProp<ViewStyle>;
|
|
9
10
|
onPress: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRow.js","sourceRoot":"","sources":["../../../../src/components/FormRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAwB,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"FormRow.js","sourceRoot":"","sources":["../../../../src/components/FormRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAwB,UAAU,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,SAAS,MAAM,aAAa,CAAC;AAWpC,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,KAAK,EACL,KAAK,EACL,OAAO,EACP,GAAG,IAAI,EACD;IACN,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO,CACL,oBAAC,SAAS,IACR,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,KACzD,IAAI;QAER,oBAAC,IAAI,IAAC,KAAK,EAAE,UAAU,IAAG,KAAK,CAAQ;QACtC,QAAQ,CACC,CACb,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,GAAG,EAAE;QACH,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;QAC/B,UAAU,EAAE,QAAQ;KACrB;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, PressableProps } from "react-native";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Theme } from "../styles/DefaultTheme";
|
|
4
4
|
import type { IconSlot } from "../interfaces/Icon";
|
|
5
5
|
declare type Props = {
|
|
6
6
|
icon?: string;
|
|
@@ -9,10 +9,12 @@ declare type Props = {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
onPress: () => void;
|
|
12
|
-
theme:
|
|
12
|
+
theme: Theme;
|
|
13
13
|
style?: StyleProp<ViewStyle>;
|
|
14
14
|
activeOpacity?: number;
|
|
15
15
|
disabledOpacity?: number;
|
|
16
16
|
} & PressableProps & IconSlot;
|
|
17
|
-
declare const _default: React.ComponentType<
|
|
17
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<React.PropsWithChildren<Props>, "theme"> & {
|
|
18
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
19
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<React.PropsWithChildren<Props>> & React.FC<React.PropsWithChildren<Props>>, {}>;
|
|
18
20
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { View, StyleSheet, ActivityIndicator, Pressable, Platform, } from "react-native";
|
|
3
|
-
import { withTheme } from "
|
|
3
|
+
import { withTheme } from "../theming";
|
|
4
4
|
const IconButton = ({ Icon, icon, color: customColor, size = 32, disabled, loading = false, onPress, theme, style, activeOpacity = 0.8, disabledOpacity = 0.8, ...props }) => {
|
|
5
|
-
const iconColor = customColor || theme.colors.
|
|
5
|
+
const iconColor = customColor || theme.colors.primary;
|
|
6
6
|
return (React.createElement(Pressable, { onPress: onPress, disabled: disabled || loading, style: ({ pressed }) => {
|
|
7
7
|
return [
|
|
8
8
|
styles.container,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EACJ,UAAU,EACV,iBAAiB,EAGjB,SAAS,EAET,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EACJ,UAAU,EACV,iBAAiB,EAGjB,SAAS,EAET,QAAQ,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAkBvC,MAAM,UAAU,GAA6C,CAAC,EAC5D,IAAI,EACJ,IAAI,EACJ,KAAK,EAAE,WAAW,EAClB,IAAI,GAAG,EAAE,EACT,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,OAAO,EACP,KAAK,EACL,KAAK,EACL,aAAa,GAAG,GAAG,EACnB,eAAe,GAAG,GAAG,EACrB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,WAAW,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;IAEtD,OAAO,CACL,oBAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAC7B,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACrB,OAAO;gBACL,MAAM,CAAC,SAAS;gBAChB;oBACE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;oBACjE,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,IAAI;oBACZ,UAAU,EAAE,QAAQ;oBACpB,cAAc,EAAE,QAAQ;iBACzB;gBACD,KAAK;aACN,CAAC;QACJ,CAAC,KACG,KAAK;QAET,oBAAC,IAAI;YACF,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,oBAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,GAAI,CACvD,CAAC,CAAC,CAAC,IAAI;YACP,OAAO,CAAC,CAAC,CAAC,oBAAC,iBAAiB,IAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,SAAS,GAAI,CAAC,CAAC,CAAC,IAAI,CACjE,CACG,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,GAAG,QAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,MAAM,EAAE,SAAS;gBACjB,UAAU,EAAE,MAAM;aACnB;SACF,CAAC;KACH;CACF,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
|
2
|
+
import type { Theme } from "../../../styles/DefaultTheme";
|
|
2
3
|
import { MediaPlayerProps } from "../MediaPlayerCommon";
|
|
3
4
|
export declare type AudioInterruptionMode = "lower volume" | "stop";
|
|
4
5
|
export interface HeadlessAudioPlayerProps extends MediaPlayerProps {
|
|
@@ -17,4 +18,5 @@ export interface AudioPlayerInterfaceProps {
|
|
|
17
18
|
hidePlaybackIcon?: boolean;
|
|
18
19
|
hideDuration?: boolean;
|
|
19
20
|
hideSlider?: boolean;
|
|
21
|
+
theme: Theme;
|
|
20
22
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { AudioPlayerInterfaceProps, HeadlessAudioPlayerProps } from "./AudioPlayerCommon";
|
|
3
3
|
import type { MediaPlayerRef } from "../MediaPlayerCommon";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export default AudioPlayerWithInterface;
|
|
4
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>, "theme"> & {
|
|
5
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
6
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>> & React.ForwardRefExoticComponent<AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>>, {}>;
|
|
7
|
+
export default _default;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Text, View, StyleSheet } from "react-native";
|
|
3
3
|
import { AntDesign } from "@expo/vector-icons";
|
|
4
|
-
import {
|
|
4
|
+
import { withTheme } from "../../../theming";
|
|
5
5
|
import Slider from "@react-native-community/slider";
|
|
6
6
|
import HeadlessAudioPlayer from "./HeadlessAudioPlayer";
|
|
7
7
|
import Pressable from "../../Pressable";
|
|
8
8
|
/**
|
|
9
9
|
* Built on top of HeadlessAudioPlayer to provide a simple interface for playing audio
|
|
10
10
|
*/
|
|
11
|
-
const AudioPlayerWithInterface = React.forwardRef(({ style, thumbColor, completedTrackColor, remainingTrackColor, togglePlaybackIconSize = 24, togglePlaybackIconColor, onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish: onPlaybackFinishProp, hidePlaybackIcon = false, hideDuration = false, hideSlider = false, ...rest }, ref) => {
|
|
11
|
+
const AudioPlayerWithInterface = React.forwardRef(({ style, theme, thumbColor = theme.colors.primary, completedTrackColor = theme.colors.primary, remainingTrackColor = theme.colors.divider, togglePlaybackIconSize = 24, togglePlaybackIconColor = theme.colors.primary, onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish: onPlaybackFinishProp, hidePlaybackIcon = false, hideDuration = false, hideSlider = false, ...rest }, ref) => {
|
|
12
12
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
13
13
|
const [isLoading, setIsLoading] = React.useState(false);
|
|
14
14
|
const [durationMillis, setDurationMillis] = React.useState(1);
|
|
15
15
|
const [isDraggingSlider, setIsDraggingSlider] = React.useState(false);
|
|
16
16
|
const [sliderPositionMillis, setSliderPositionMillis] = React.useState(0);
|
|
17
17
|
const newHeadlessAudioPlayerRef = React.useRef(null);
|
|
18
|
-
const theme = useTheme();
|
|
19
18
|
// Use the provided ref or default to new ref when not provided
|
|
20
19
|
const headlessAudioPlayerRef = ref
|
|
21
20
|
? ref
|
|
22
21
|
: newHeadlessAudioPlayerRef;
|
|
23
|
-
const { color
|
|
22
|
+
const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...viewStyles } = StyleSheet.flatten(style || {});
|
|
24
23
|
const textStyles = {
|
|
25
24
|
color,
|
|
26
25
|
fontFamily,
|
|
@@ -75,20 +74,24 @@ const AudioPlayerWithInterface = React.forwardRef(({ style, thumbColor, complete
|
|
|
75
74
|
React.createElement(HeadlessAudioPlayer, { ...rest, ref: headlessAudioPlayerRef, onPlaybackStatusUpdate: onPlaybackStatusUpdate, onPlaybackFinish: onPlaybackFinish }),
|
|
76
75
|
React.createElement(View, { testID: "audio-player-interface", style: [
|
|
77
76
|
{
|
|
78
|
-
backgroundColor: theme.colors.background
|
|
79
|
-
borderColor: theme.colors.
|
|
77
|
+
backgroundColor: theme.colors.background,
|
|
78
|
+
borderColor: theme.colors.divider,
|
|
80
79
|
},
|
|
81
80
|
styles.container,
|
|
82
81
|
viewStyles,
|
|
83
82
|
] },
|
|
84
83
|
!hidePlaybackIcon && (React.createElement(Pressable, { testID: "audio-player-playback-icon", onPress: () => { var _a; return (_a = headlessAudioPlayerRef.current) === null || _a === void 0 ? void 0 : _a.togglePlayback(); }, style: styles.spacingEnd },
|
|
85
|
-
React.createElement(AntDesign, { name: iconName, size: togglePlaybackIconSize, color: togglePlaybackIconColor
|
|
86
|
-
!hideDuration && (React.createElement(Text, { testID: "audio-player-duration", style: [
|
|
84
|
+
React.createElement(AntDesign, { name: iconName, size: togglePlaybackIconSize, color: togglePlaybackIconColor }))),
|
|
85
|
+
!hideDuration && (React.createElement(Text, { testID: "audio-player-duration", style: [
|
|
86
|
+
{ color: theme.colors.strong },
|
|
87
|
+
styles.spacingEnd,
|
|
88
|
+
{ ...textStyles },
|
|
89
|
+
] },
|
|
87
90
|
formatDuration(sliderPositionMillis !== null && sliderPositionMillis !== void 0 ? sliderPositionMillis : 0),
|
|
88
91
|
" /",
|
|
89
92
|
" ",
|
|
90
93
|
formatDuration(durationMillis || 0))),
|
|
91
|
-
!hideSlider && (React.createElement(Slider, { testID: "audio-player-slider", style: styles.slider, minimumTrackTintColor: completedTrackColor
|
|
94
|
+
!hideSlider && (React.createElement(Slider, { testID: "audio-player-slider", style: styles.slider, minimumTrackTintColor: completedTrackColor, maximumTrackTintColor: remainingTrackColor, thumbTintColor: thumbColor, minimumValue: 0, value: sliderPositionMillis, maximumValue: durationMillis, onValueChange: onSliderChange, onSlidingComplete: onSlidingComplete })))));
|
|
92
95
|
});
|
|
93
96
|
const styles = StyleSheet.create({
|
|
94
97
|
container: {
|
|
@@ -119,5 +122,5 @@ function formatDuration(duration) {
|
|
|
119
122
|
}
|
|
120
123
|
return renderedMinutes + ":" + renderedSeconds;
|
|
121
124
|
}
|
|
122
|
-
export default AudioPlayerWithInterface;
|
|
125
|
+
export default withTheme(AudioPlayerWithInterface);
|
|
123
126
|
//# sourceMappingURL=AudioPlayerWithInterface.js.map
|
package/lib/typescript/src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioPlayerWithInterface.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AudioPlayerWithInterface.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/AudioPlayerWithInterface.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,gCAAgC,CAAC;AACpD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAKxD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAGxC;;GAEG;AACH,MAAM,wBAAwB,GAAG,KAAK,CAAC,UAAU,CAI/C,CACE,EACE,KAAK,EACL,KAAK,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,eAAe,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/D,MAAM,eAAe,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAE/D,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,OAAO,aAAa,GAAG,GAAG,GAAG,eAAe,GAAG,GAAG,GAAG,eAAe,CAAC;KACtE;IAED,OAAO,eAAe,GAAG,GAAG,GAAG,eAAe,CAAC;AACjD,CAAC;AAED,eAAe,SAAS,CAAC,wBAAwB,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Audio, InterruptionModeIOS, InterruptionModeAndroid, } from "expo-av";
|
|
3
|
-
import { mapToMediaPlayerStatus } from "../MediaPlayerCommon";
|
|
3
|
+
import { mapToMediaPlayerStatus, normalizeBase64Source, useSourceDeepCompareEffect, } from "../MediaPlayerCommon";
|
|
4
4
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
5
5
|
/**
|
|
6
6
|
* Audio Player component without an interface (UI).
|
|
@@ -56,7 +56,8 @@ const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lowe
|
|
|
56
56
|
bufferedDurationMillis: 0,
|
|
57
57
|
isError: false,
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
let finalSource = await normalizeBase64Source(source);
|
|
60
|
+
const { sound } = await Audio.Sound.createAsync(finalSource);
|
|
60
61
|
setCurrentSound(sound);
|
|
61
62
|
sound.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate);
|
|
62
63
|
};
|
|
@@ -66,28 +67,5 @@ const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lowe
|
|
|
66
67
|
}, [source]);
|
|
67
68
|
return (React.createElement(MediaPlaybackWrapper, { ref: ref, isPlaying: isPlaying, media: currentSound, onTogglePlayback: onTogglePlayback }));
|
|
68
69
|
});
|
|
69
|
-
// The source provided into the AudioPlayer can be of type {uri: "some uri"}
|
|
70
|
-
// In the case that this object is created inline, each rerender provides a new source object because a new object is initialized everytime
|
|
71
|
-
// This creates an issue with being a useEffect dependency
|
|
72
|
-
//
|
|
73
|
-
// This creates variants of useEffect that checks deep equality of 'uri' to determine if dependency changed or not
|
|
74
|
-
// Follows: https://stackoverflow.com/a/54096391
|
|
75
|
-
function sourceDeepCompareEquals(a, b) {
|
|
76
|
-
if ((a === null || a === void 0 ? void 0 : a.uri) && (b === null || b === void 0 ? void 0 : b.uri)) {
|
|
77
|
-
return a.uri === b.uri;
|
|
78
|
-
}
|
|
79
|
-
return a === b;
|
|
80
|
-
}
|
|
81
|
-
function useSourceDeepCompareMemoize(value) {
|
|
82
|
-
const ref = React.useRef();
|
|
83
|
-
if (!sourceDeepCompareEquals(value, ref.current)) {
|
|
84
|
-
ref.current = value;
|
|
85
|
-
}
|
|
86
|
-
return ref.current;
|
|
87
|
-
}
|
|
88
|
-
function useSourceDeepCompareEffect(callback, dependencies) {
|
|
89
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
|
-
React.useEffect(callback, dependencies.map(useSourceDeepCompareMemoize));
|
|
91
|
-
}
|
|
92
70
|
export default HeadlessAudioPlayer;
|
|
93
71
|
//# sourceMappingURL=HeadlessAudioPlayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeadlessAudioPlayer.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,EAEL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,
|
|
1
|
+
{"version":3,"file":"HeadlessAudioPlayer.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPl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AAiC;IACnC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,CACL,oBAAC,oBAAoB,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,YAAY,EACnB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -4,6 +4,8 @@ import type { MediaPlayerRef } from "../MediaPlayerCommon";
|
|
|
4
4
|
interface AudioPlayerProps {
|
|
5
5
|
mode?: "interface" | "headless";
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
8
|
-
|
|
7
|
+
declare const _default: React.ComponentType<import("@draftbit/react-theme-provider").$Without<AudioPlayerProps & AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>, "theme"> & {
|
|
8
|
+
theme?: import("@draftbit/react-theme-provider").$DeepPartial<any> | undefined;
|
|
9
|
+
}> & import("@draftbit/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<AudioPlayerProps & AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>> & React.ForwardRefExoticComponent<AudioPlayerProps & AudioPlayerInterfaceProps & HeadlessAudioPlayerProps & React.RefAttributes<MediaPlayerRef>>, {}>;
|
|
10
|
+
export default _default;
|
|
9
11
|
export type { MediaPlayerRef as AudioPlayerRef } from "../MediaPlayerCommon";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { withTheme } from "../../../theming";
|
|
2
3
|
import HeadlessAudioPlayer from "./HeadlessAudioPlayer";
|
|
3
4
|
import AudioPlayerWithInterface from "./AudioPlayerWithInterface";
|
|
4
5
|
const AudioPlayer = React.forwardRef(({ mode = "interface", ...rest }, ref) => {
|
|
@@ -6,8 +7,9 @@ const AudioPlayer = React.forwardRef(({ mode = "interface", ...rest }, ref) => {
|
|
|
6
7
|
case "headless":
|
|
7
8
|
return React.createElement(HeadlessAudioPlayer, { ref: ref, ...rest });
|
|
8
9
|
case "interface":
|
|
10
|
+
//@ts-ignore Typescript unable to handle nested passing of theme
|
|
9
11
|
return React.createElement(AudioPlayerWithInterface, { ref: ref, ...rest });
|
|
10
12
|
}
|
|
11
13
|
});
|
|
12
|
-
export default AudioPlayer;
|
|
14
|
+
export default withTheme(AudioPlayer);
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAK7C,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAOlE,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAGlC,CAAC,EAAE,IAAI,GAAG,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IACzC,QAAQ,IAAI,EAAE;QACZ,KAAK,UAAU;YACb,OAAO,oBAAC,mBAAmB,IAAC,GAAG,EAAE,GAAG,KAAM,IAAI,GAAI,CAAC;QACrD,KAAK,WAAW;YACd,gEAAgE;YAChE,OAAO,oBAAC,wBAAwB,IAAC,GAAG,EAAE,GAAG,KAAM,IAAI,GAAI,CAAC;KAC3D;AACH,CAAC,CAAC,CAAC;AAEH,eAAe,SAAS,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AVPlaybackSource, AVPlaybackStatus } from "expo-av";
|
|
2
|
+
import React from "react";
|
|
2
3
|
export interface MediaPlayerStatus {
|
|
3
4
|
isPlaying: boolean;
|
|
4
5
|
isLoading: boolean;
|
|
@@ -21,3 +22,8 @@ export interface MediaPlayerProps {
|
|
|
21
22
|
source: AVPlaybackSource;
|
|
22
23
|
}
|
|
23
24
|
export declare function mapToMediaPlayerStatus(status: AVPlaybackStatus): MediaPlayerStatus;
|
|
25
|
+
/**
|
|
26
|
+
* Base64 strings are not playable on iOS and needs to be saved to a file before playing
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizeBase64Source(source: AVPlaybackSource): Promise<AVPlaybackSource>;
|
|
29
|
+
export declare function useSourceDeepCompareEffect(callback: React.EffectCallback, dependencies: React.DependencyList): void;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as FileSystem from "expo-file-system";
|
|
2
|
+
import { v4 as uuid } from "uuid";
|
|
3
|
+
import { Platform } from "react-native";
|
|
4
|
+
import React from "react";
|
|
1
5
|
export function mapToMediaPlayerStatus(status) {
|
|
2
6
|
if (status.isLoaded) {
|
|
3
7
|
return {
|
|
@@ -21,4 +25,43 @@ export function mapToMediaPlayerStatus(status) {
|
|
|
21
25
|
error: status.error,
|
|
22
26
|
};
|
|
23
27
|
}
|
|
28
|
+
// https://stackoverflow.com/a/7874175/8805150
|
|
29
|
+
const BASE_64_REGEX = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
30
|
+
/**
|
|
31
|
+
* Base64 strings are not playable on iOS and needs to be saved to a file before playing
|
|
32
|
+
*/
|
|
33
|
+
export async function normalizeBase64Source(source) {
|
|
34
|
+
const uri = source === null || source === void 0 ? void 0 : source.uri;
|
|
35
|
+
if (Platform.OS === "ios" && uri && uri.match(BASE_64_REGEX)) {
|
|
36
|
+
const fileName = `${FileSystem.cacheDirectory}${uuid()}`;
|
|
37
|
+
await FileSystem.writeAsStringAsync(fileName, uri, {
|
|
38
|
+
encoding: FileSystem.EncodingType.Base64,
|
|
39
|
+
});
|
|
40
|
+
return { uri: fileName };
|
|
41
|
+
}
|
|
42
|
+
return source;
|
|
43
|
+
}
|
|
44
|
+
// The source provided into the AudioPlayer can be of type {uri: "some uri"}
|
|
45
|
+
// In the case that this object is created inline, each rerender provides a new source object because a new object is initialized everytime
|
|
46
|
+
// This creates an issue with being a useEffect dependency
|
|
47
|
+
//
|
|
48
|
+
// This creates variants of useEffect that checks deep equality of 'uri' to determine if dependency changed or not
|
|
49
|
+
// Follows: https://stackoverflow.com/a/54096391
|
|
50
|
+
function sourceDeepCompareEquals(a, b) {
|
|
51
|
+
if ((a === null || a === void 0 ? void 0 : a.uri) && (b === null || b === void 0 ? void 0 : b.uri)) {
|
|
52
|
+
return a.uri === b.uri;
|
|
53
|
+
}
|
|
54
|
+
return a === b;
|
|
55
|
+
}
|
|
56
|
+
function useSourceDeepCompareMemoize(value) {
|
|
57
|
+
const ref = React.useRef();
|
|
58
|
+
if (!sourceDeepCompareEquals(value, ref.current)) {
|
|
59
|
+
ref.current = value;
|
|
60
|
+
}
|
|
61
|
+
return ref.current;
|
|
62
|
+
}
|
|
63
|
+
export function useSourceDeepCompareEffect(callback, dependencies) {
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
+
React.useEffect(callback, dependencies.map(useSourceDeepCompareMemoize));
|
|
66
|
+
}
|
|
24
67
|
//# sourceMappingURL=MediaPlayerCommon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaPlayerCommon.js","sourceRoot":"","sources":["../../../../../src/components/MediaPlayer/MediaPlayerCommon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaPlayerCommon.js","sourceRoot":"","sources":["../../../../../src/components/MediaPlayer/MediaPlayerCommon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,EAAE,IAAI,I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,CAAC,CAAC;QACH,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;KAC1B;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4EAA4E;AAC5E,2IAA2I;AAC3I,0DAA0D;AAC1D,EAAE;AACF,kHAAkH;AAClH,gDAAgD;AAChD,SAAS,uBAAuB,CAAC,CAAM,EAAE,CAAM;IAC7C,IAAI,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,GAAG,MAAI,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,GAAG,CAAA,EAAE;QACpB,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC;KACxB;IACD,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAU;IAC7C,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;IAC3B,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QAChD,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;KACrB;IACD,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,QAA8B,EAC9B,YAAkC;IAElC,uDAAuD;IACvD,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -2,11 +2,12 @@ import React from "react";
|
|
|
2
2
|
import { Video as VideoPlayerComponent, ResizeMode as ExpoResizeMode, VideoFullscreenUpdate, } from "expo-av";
|
|
3
3
|
import { extractSizeStyles } from "../../../utilities";
|
|
4
4
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
5
|
-
import { mapToMediaPlayerStatus } from "../MediaPlayerCommon";
|
|
6
|
-
const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterResizeMode = "cover", onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish, ...rest }, ref) => {
|
|
5
|
+
import { mapToMediaPlayerStatus, normalizeBase64Source, useSourceDeepCompareEffect, } from "../MediaPlayerCommon";
|
|
6
|
+
const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterResizeMode = "cover", onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish, source, ...rest }, ref) => {
|
|
7
7
|
const [videoMediaObject, setVideoMediaObject] = React.useState();
|
|
8
8
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
9
9
|
const [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
10
|
+
const [currentSource, setCurrentSource] = React.useState();
|
|
10
11
|
const mediaPlaybackWrapperRef = React.useRef(null);
|
|
11
12
|
const sizeStyles = extractSizeStyles(style);
|
|
12
13
|
let mappedResizeMode;
|
|
@@ -64,12 +65,19 @@ const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterRes
|
|
|
64
65
|
// Include 'isPlaying' as dependency because 'togglePlayback' changes when it changes
|
|
65
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
67
|
[toggleFullscreen, isPlaying]);
|
|
68
|
+
useSourceDeepCompareEffect(() => {
|
|
69
|
+
const updateSource = async () => {
|
|
70
|
+
const finalSource = await normalizeBase64Source(source);
|
|
71
|
+
setCurrentSource(finalSource);
|
|
72
|
+
};
|
|
73
|
+
updateSource();
|
|
74
|
+
}, [source]);
|
|
67
75
|
return (React.createElement(MediaPlaybackWrapper, { media: videoMediaObject, isPlaying: isPlaying, ref: mediaPlaybackWrapperRef },
|
|
68
76
|
React.createElement(VideoPlayerComponent
|
|
69
77
|
// https://docs.expo.dev/versions/latest/sdk/av/#example-video to see why ref is handled this way
|
|
70
78
|
, {
|
|
71
79
|
// https://docs.expo.dev/versions/latest/sdk/av/#example-video to see why ref is handled this way
|
|
72
|
-
ref: (component) => setVideoMediaObject(component), style: style, videoStyle: sizeStyles, resizeMode: mappedResizeMode, posterStyle: [sizeStyles, { resizeMode: posterResizeMode }], onPlaybackStatusUpdate: onPlaybackStatusUpdate, onFullscreenUpdate: (e) => onFullscreenUpdate(e.fullscreenUpdate), ...rest })));
|
|
80
|
+
ref: (component) => setVideoMediaObject(component), style: style, videoStyle: sizeStyles, resizeMode: mappedResizeMode, posterStyle: [sizeStyles, { resizeMode: posterResizeMode }], onPlaybackStatusUpdate: onPlaybackStatusUpdate, onFullscreenUpdate: (e) => onFullscreenUpdate(e.fullscreenUpdate), source: currentSource, ...rest })));
|
|
73
81
|
});
|
|
74
82
|
export default VideoPlayer;
|
|
75
83
|
//# sourceMappingURL=VideoPlayer.js.map
|