@soul-refiner/design-system 1.7.22 → 2.0.0-alpha.1
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/dist/components/editor/plugins/blocks/plate-button.d.ts +2 -2
- package/dist/components/editor/plugins/blocks/separator.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +48153 -5
- package/package.json +15 -14
- package/dist/common/colors.js +0 -135
- package/dist/common/date.js +0 -28
- package/dist/common/index.js +0 -3
- package/dist/common/styles.js +0 -63
- package/dist/components/actions/button/button.js +0 -318
- package/dist/components/actions/button/index.js +0 -1
- package/dist/components/actions/dropdown/dropdown.js +0 -227
- package/dist/components/actions/dropdown/index.js +0 -1
- package/dist/components/actions/index.js +0 -6
- package/dist/components/actions/rate/index.js +0 -1
- package/dist/components/actions/rate/rate.js +0 -47
- package/dist/components/actions/switch/index.js +0 -1
- package/dist/components/actions/switch/switch.js +0 -72
- package/dist/components/actions/toggle/index.js +0 -1
- package/dist/components/actions/toggle/toggle.js +0 -57
- package/dist/components/actions/upload/index.js +0 -1
- package/dist/components/actions/upload/upload.js +0 -156
- package/dist/components/atoms/box/box.js +0 -16
- package/dist/components/atoms/box/index.js +0 -1
- package/dist/components/atoms/colors/colors.js +0 -35
- package/dist/components/atoms/colors/index.js +0 -1
- package/dist/components/atoms/hide/hide.js +0 -9
- package/dist/components/atoms/hide/index.js +0 -1
- package/dist/components/atoms/index.js +0 -5
- package/dist/components/atoms/seconds_to_duration/index.js +0 -1
- package/dist/components/atoms/seconds_to_duration/seconds_to_duration.js +0 -27
- package/dist/components/atoms/time_ago/index.js +0 -1
- package/dist/components/atoms/time_ago/time_ago.js +0 -31
- package/dist/components/atoms/typography/display.js +0 -10
- package/dist/components/atoms/typography/heading.js +0 -35
- package/dist/components/atoms/typography/index.js +0 -4
- package/dist/components/atoms/typography/paragraph.js +0 -18
- package/dist/components/atoms/typography/typography.js +0 -12
- package/dist/components/card/action/action.js +0 -72
- package/dist/components/card/action/index.js +0 -1
- package/dist/components/card/audio/audio.js +0 -130
- package/dist/components/card/audio/index.js +0 -1
- package/dist/components/card/card.js +0 -35
- package/dist/components/card/feature/feature.js +0 -188
- package/dist/components/card/feature/index.js +0 -1
- package/dist/components/card/index.js +0 -1
- package/dist/components/card/meeting/index.js +0 -1
- package/dist/components/card/meeting/meeting.js +0 -130
- package/dist/components/card/person/index.js +0 -1
- package/dist/components/card/person/person.js +0 -69
- package/dist/components/card/price/index.js +0 -1
- package/dist/components/card/price/price.js +0 -75
- package/dist/components/card/regular/index.js +0 -1
- package/dist/components/card/regular/regular.js +0 -33
- package/dist/components/card/video/index.js +0 -1
- package/dist/components/card/video/video.js +0 -127
- package/dist/components/card/written/index.js +0 -1
- package/dist/components/card/written/written.js +0 -130
- package/dist/components/custom/courses_selection/courses_selection.js +0 -127
- package/dist/components/custom/courses_selection/index.js +0 -1
- package/dist/components/custom/index.js +0 -2
- package/dist/components/custom/users_selection/index.js +0 -1
- package/dist/components/custom/users_selection/users_selection.js +0 -120
- package/dist/components/editor/constants.js +0 -49
- package/dist/components/editor/context.js +0 -8
- package/dist/components/editor/editor.js +0 -102
- package/dist/components/editor/icons/border-all.js +0 -3
- package/dist/components/editor/icons/border-bottom.js +0 -3
- package/dist/components/editor/icons/border-left.js +0 -3
- package/dist/components/editor/icons/border-none.js +0 -3
- package/dist/components/editor/icons/border-right.js +0 -3
- package/dist/components/editor/icons/border-top.js +0 -3
- package/dist/components/editor/icons/index.js +0 -6
- package/dist/components/editor/index.js +0 -2
- package/dist/components/editor/navbar/alignment_dropdown.js +0 -97
- package/dist/components/editor/navbar/button_modal.js +0 -55
- package/dist/components/editor/navbar/index.js +0 -1
- package/dist/components/editor/navbar/navbar.js +0 -201
- package/dist/components/editor/navbar/style_dropdown.js +0 -65
- package/dist/components/editor/plugins/blocks/blockquote.js +0 -8
- package/dist/components/editor/plugins/blocks/blocks.js +0 -50
- package/dist/components/editor/plugins/blocks/buttons.js +0 -81
- package/dist/components/editor/plugins/blocks/dropdown-menu.js +0 -62
- package/dist/components/editor/plugins/blocks/image.js +0 -51
- package/dist/components/editor/plugins/blocks/index.js +0 -1
- package/dist/components/editor/plugins/blocks/list.js +0 -17
- package/dist/components/editor/plugins/blocks/media-popover.js +0 -32
- package/dist/components/editor/plugins/blocks/plate-button.js +0 -37
- package/dist/components/editor/plugins/blocks/popover.js +0 -11
- package/dist/components/editor/plugins/blocks/qa.js +0 -45
- package/dist/components/editor/plugins/blocks/resizable.js +0 -37
- package/dist/components/editor/plugins/blocks/separator.js +0 -19
- package/dist/components/editor/plugins/blocks/table-cell.js +0 -38
- package/dist/components/editor/plugins/blocks/table-row.js +0 -7
- package/dist/components/editor/plugins/blocks/table.js +0 -82
- package/dist/components/editor/plugins/blocks/text.js +0 -82
- package/dist/components/editor/plugins/blocks/video.js +0 -32
- package/dist/components/editor/plugins/index.js +0 -4
- package/dist/components/editor/plugins/leafs/index.js +0 -1
- package/dist/components/editor/plugins/leafs/leafs.js +0 -33
- package/dist/components/editor/plugins/leafs/link.js +0 -74
- package/dist/components/editor/plugins/marks/index.js +0 -1
- package/dist/components/editor/plugins/marks/marks.js +0 -12
- package/dist/components/editor/plugins/plate.js +0 -37
- package/dist/components/editor/plugins/utils/exitBreak.js +0 -31
- package/dist/components/editor/plugins/utils/index.js +0 -1
- package/dist/components/editor/plugins/utils/resetBlockType.js +0 -22
- package/dist/components/editor/plugins/utils/selectOnBackspace.js +0 -6
- package/dist/components/editor/plugins/utils/softBreak.js +0 -14
- package/dist/components/editor/plugins/utils/utils.js +0 -12
- package/dist/components/editor/simple_editor/index.js +0 -1
- package/dist/components/editor/simple_editor/navbar.js +0 -140
- package/dist/components/editor/simple_editor/plugins.js +0 -89
- package/dist/components/editor/simple_editor/simple_editor.js +0 -89
- package/dist/components/feedback/animated_toast/animated_toast.js +0 -55
- package/dist/components/feedback/animated_toast/index.js +0 -1
- package/dist/components/feedback/badge/badge.js +0 -66
- package/dist/components/feedback/badge/index.js +0 -1
- package/dist/components/feedback/banner/banner.js +0 -80
- package/dist/components/feedback/banner/index.js +0 -1
- package/dist/components/feedback/chip/chip.js +0 -94
- package/dist/components/feedback/chip/index.js +0 -1
- package/dist/components/feedback/index.js +0 -8
- package/dist/components/feedback/loader/index.js +0 -1
- package/dist/components/feedback/loader/loader.js +0 -34
- package/dist/components/feedback/notification/index.js +0 -1
- package/dist/components/feedback/notification/notification.js +0 -72
- package/dist/components/feedback/progress/index.js +0 -1
- package/dist/components/feedback/progress/progress.js +0 -87
- package/dist/components/feedback/toast/index.js +0 -1
- package/dist/components/feedback/toast/toast.js +0 -112
- package/dist/components/feedback/tooltip/index.js +0 -1
- package/dist/components/feedback/tooltip/tooltip.js +0 -26
- package/dist/components/iconography/avatar/avatar.js +0 -171
- package/dist/components/iconography/avatar/icons/approved.js +0 -5
- package/dist/components/iconography/avatar/icons/busy.js +0 -5
- package/dist/components/iconography/avatar/icons/declined.js +0 -5
- package/dist/components/iconography/avatar/icons/default.js +0 -4
- package/dist/components/iconography/avatar/icons/focus.js +0 -5
- package/dist/components/iconography/avatar/icons/index.js +0 -9
- package/dist/components/iconography/avatar/icons/locked.js +0 -5
- package/dist/components/iconography/avatar/icons/offline.js +0 -5
- package/dist/components/iconography/avatar/icons/online.js +0 -4
- package/dist/components/iconography/avatar/icons/subscribed.js +0 -9
- package/dist/components/iconography/avatar/index.js +0 -1
- package/dist/components/iconography/icon/icon.js +0 -10
- package/dist/components/iconography/icon/index.js +0 -1
- package/dist/components/iconography/index.js +0 -2
- package/dist/components/index.js +0 -12
- package/dist/components/input/calendar/calendar.js +0 -255
- package/dist/components/input/calendar/index.js +0 -1
- package/dist/components/input/checkbox/checkbox.js +0 -23
- package/dist/components/input/checkbox/index.js +0 -1
- package/dist/components/input/date/date.js +0 -517
- package/dist/components/input/date/index.js +0 -1
- package/dist/components/input/filter/filter.js +0 -319
- package/dist/components/input/filter/filter_option.js +0 -70
- package/dist/components/input/filter/index.js +0 -1
- package/dist/components/input/index.js +0 -10
- package/dist/components/input/radio/index.js +0 -1
- package/dist/components/input/radio/radio.js +0 -83
- package/dist/components/input/search/index.js +0 -1
- package/dist/components/input/search/search.js +0 -138
- package/dist/components/input/select/index.js +0 -1
- package/dist/components/input/select/select.js +0 -47
- package/dist/components/input/text_area/index.js +0 -1
- package/dist/components/input/text_area/text_area.js +0 -110
- package/dist/components/input/text_input/index.js +0 -1
- package/dist/components/input/text_input/text_input.js +0 -147
- package/dist/components/input/time/index.js +0 -1
- package/dist/components/input/time/time.js +0 -71
- package/dist/components/media/common.js +0 -1
- package/dist/components/media/index.js +0 -2
- package/dist/components/media/video/index.js +0 -1
- package/dist/components/media/video/video.js +0 -31
- package/dist/components/media/video-player/index.js +0 -1
- package/dist/components/media/video-player/playlist-item.js +0 -37
- package/dist/components/media/video-player/video.js +0 -197
- package/dist/components/navigation/breadcrumb/breadcrumb.js +0 -109
- package/dist/components/navigation/breadcrumb/index.js +0 -1
- package/dist/components/navigation/index.js +0 -3
- package/dist/components/navigation/inner/index.js +0 -1
- package/dist/components/navigation/inner/inner.js +0 -187
- package/dist/components/navigation/tabs/index.js +0 -1
- package/dist/components/navigation/tabs/tabs.js +0 -150
- package/dist/components/surfaces/accordion/accordion.js +0 -47
- package/dist/components/surfaces/accordion/index.js +0 -1
- package/dist/components/surfaces/calendar_date/calendar_date.js +0 -45
- package/dist/components/surfaces/calendar_date/index.js +0 -1
- package/dist/components/surfaces/carousel/card/card.js +0 -96
- package/dist/components/surfaces/carousel/card/index.js +0 -1
- package/dist/components/surfaces/carousel/index.js +0 -1
- package/dist/components/surfaces/comment/comment.js +0 -188
- package/dist/components/surfaces/comment/helpers.js +0 -26
- package/dist/components/surfaces/comment/index.js +0 -1
- package/dist/components/surfaces/drawer/drawer.js +0 -130
- package/dist/components/surfaces/drawer/index.js +0 -1
- package/dist/components/surfaces/index.js +0 -9
- package/dist/components/surfaces/message/index.js +0 -1
- package/dist/components/surfaces/message/message.js +0 -44
- package/dist/components/surfaces/modal/index.js +0 -1
- package/dist/components/surfaces/modal/modal.js +0 -127
- package/dist/components/surfaces/portal/index.js +0 -1
- package/dist/components/surfaces/portal/portal.js +0 -26
- package/dist/components/surfaces/post/index.js +0 -1
- package/dist/components/surfaces/post/post.js +0 -230
- package/dist/components/table/index.js +0 -1
- package/dist/components/table/table/index.js +0 -1
- package/dist/components/table/table/table.js +0 -184
- package/dist/emoji/emojis.json +0 -17577
- package/dist/icons/arrow/arrow_all.js +0 -6
- package/dist/icons/arrow/arrow_all_diagonal.js +0 -6
- package/dist/icons/arrow/arrow_both_downwards.js +0 -6
- package/dist/icons/arrow/arrow_both_upwards.js +0 -6
- package/dist/icons/arrow/arrow_circle_left.js +0 -6
- package/dist/icons/arrow/arrow_circle_left_double.js +0 -6
- package/dist/icons/arrow/arrow_circle_left_double_alert.js +0 -8
- package/dist/icons/arrow/arrow_circle_right.js +0 -6
- package/dist/icons/arrow/arrow_circle_right_double.js +0 -6
- package/dist/icons/arrow/arrow_circle_right_double_alert.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_down_left.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_down_left_circle.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_down_right.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_down_right_circle.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_up_left.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_up_left_circle.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_up_right.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_up_right_circle.js +0 -6
- package/dist/icons/arrow/arrow_down.js +0 -6
- package/dist/icons/arrow/arrow_down_bold.js +0 -6
- package/dist/icons/arrow/arrow_down_circle.js +0 -6
- package/dist/icons/arrow/arrow_left.js +0 -6
- package/dist/icons/arrow/arrow_left_bold.js +0 -6
- package/dist/icons/arrow/arrow_left_circle.js +0 -6
- package/dist/icons/arrow/arrow_left_curved.js +0 -6
- package/dist/icons/arrow/arrow_left_curved_circle.js +0 -6
- package/dist/icons/arrow/arrow_right.js +0 -6
- package/dist/icons/arrow/arrow_right_bold.js +0 -6
- package/dist/icons/arrow/arrow_right_circle.js +0 -6
- package/dist/icons/arrow/arrow_right_curved.js +0 -6
- package/dist/icons/arrow/arrow_right_curved_circle.js +0 -6
- package/dist/icons/arrow/arrow_up.js +0 -6
- package/dist/icons/arrow/arrow_up_bold.js +0 -6
- package/dist/icons/arrow/arrow_up_circle.js +0 -6
- package/dist/icons/arrow/chevron_down.js +0 -6
- package/dist/icons/arrow/chevron_down_circle.js +0 -6
- package/dist/icons/arrow/chevron_down_double.js +0 -6
- package/dist/icons/arrow/chevron_down_double_circle.js +0 -6
- package/dist/icons/arrow/chevron_left.js +0 -6
- package/dist/icons/arrow/chevron_left_circle.js +0 -6
- package/dist/icons/arrow/chevron_left_double.js +0 -6
- package/dist/icons/arrow/chevron_left_double_circle.js +0 -6
- package/dist/icons/arrow/chevron_right.js +0 -6
- package/dist/icons/arrow/chevron_right_circle.js +0 -6
- package/dist/icons/arrow/chevron_right_double.js +0 -6
- package/dist/icons/arrow/chevron_right_double_circle.js +0 -6
- package/dist/icons/arrow/chevron_scroll.js +0 -6
- package/dist/icons/arrow/chevron_up.js +0 -6
- package/dist/icons/arrow/chevron_up_circle.js +0 -6
- package/dist/icons/arrow/chevron_up_double.js +0 -6
- package/dist/icons/arrow/chevron_up_double_circle.js +0 -6
- package/dist/icons/arrow/forward_all.js +0 -6
- package/dist/icons/arrow/forward_all_bold.js +0 -6
- package/dist/icons/arrow/forward_bold.js +0 -6
- package/dist/icons/arrow/index.js +0 -62
- package/dist/icons/arrow/redo.js +0 -6
- package/dist/icons/arrow/redo_bold.js +0 -6
- package/dist/icons/arrow/reply.js +0 -6
- package/dist/icons/arrow/reply_all.js +0 -6
- package/dist/icons/arrow/reply_all_bold.js +0 -6
- package/dist/icons/arrow/reply_bold.js +0 -6
- package/dist/icons/arrow/undo.js +0 -6
- package/dist/icons/arrow/undo_bold.js +0 -6
- package/dist/icons/audio_video/drag_indicator.js +0 -6
- package/dist/icons/audio_video/eject.js +0 -6
- package/dist/icons/audio_video/equalizer.js +0 -6
- package/dist/icons/audio_video/fast_forward.js +0 -6
- package/dist/icons/audio_video/fast_forward_30.js +0 -6
- package/dist/icons/audio_video/fullscreen.js +0 -6
- package/dist/icons/audio_video/headphones.js +0 -6
- package/dist/icons/audio_video/index.js +0 -38
- package/dist/icons/audio_video/library_add.js +0 -6
- package/dist/icons/audio_video/library_delay.js +0 -6
- package/dist/icons/audio_video/library_music.js +0 -6
- package/dist/icons/audio_video/library_queue.js +0 -6
- package/dist/icons/audio_video/microphone.js +0 -6
- package/dist/icons/audio_video/musical_note.js +0 -6
- package/dist/icons/audio_video/next.js +0 -6
- package/dist/icons/audio_video/pause.js +0 -6
- package/dist/icons/audio_video/pause_circle.js +0 -6
- package/dist/icons/audio_video/play.js +0 -6
- package/dist/icons/audio_video/play_circle.js +0 -6
- package/dist/icons/audio_video/play_display.js +0 -6
- package/dist/icons/audio_video/play_pause.js +0 -6
- package/dist/icons/audio_video/play_solid.js +0 -6
- package/dist/icons/audio_video/player_list.js +0 -6
- package/dist/icons/audio_video/player_list_add.js +0 -6
- package/dist/icons/audio_video/player_list_play.js +0 -6
- package/dist/icons/audio_video/previous.js +0 -6
- package/dist/icons/audio_video/radio.js +0 -6
- package/dist/icons/audio_video/record.js +0 -6
- package/dist/icons/audio_video/repeat.js +0 -6
- package/dist/icons/audio_video/rewind.js +0 -6
- package/dist/icons/audio_video/rewind_30.js +0 -6
- package/dist/icons/audio_video/shuffle.js +0 -6
- package/dist/icons/audio_video/sound_wave.js +0 -6
- package/dist/icons/audio_video/stop.js +0 -6
- package/dist/icons/audio_video/stop_circle.js +0 -6
- package/dist/icons/audio_video/subscriptions.js +0 -6
- package/dist/icons/audio_video/tuner.js +0 -6
- package/dist/icons/audio_video/volume.js +0 -6
- package/dist/icons/audio_video/volume_high.js +0 -6
- package/dist/icons/audio_video/volume_low.js +0 -6
- package/dist/icons/audio_video/volume_slash.js +0 -6
- package/dist/icons/basic/aa_sansserif.js +0 -7
- package/dist/icons/basic/aa_serif.js +0 -7
- package/dist/icons/basic/anchor.js +0 -8
- package/dist/icons/basic/bible.js +0 -6
- package/dist/icons/basic/bold.js +0 -6
- package/dist/icons/basic/book.js +0 -6
- package/dist/icons/basic/book_open.js +0 -6
- package/dist/icons/basic/bookmark.js +0 -6
- package/dist/icons/basic/bookmark_add.js +0 -6
- package/dist/icons/basic/bookmark_slash.js +0 -6
- package/dist/icons/basic/bookmarks.js +0 -6
- package/dist/icons/basic/books.js +0 -9
- package/dist/icons/basic/box.js +0 -6
- package/dist/icons/basic/briefcase.js +0 -6
- package/dist/icons/basic/browse_activity.js +0 -6
- package/dist/icons/basic/browser.js +0 -6
- package/dist/icons/basic/browser_slash.js +0 -6
- package/dist/icons/basic/calculator.js +0 -6
- package/dist/icons/basic/camera.js +0 -6
- package/dist/icons/basic/camera_add.js +0 -6
- package/dist/icons/basic/camera_slash.js +0 -6
- package/dist/icons/basic/checkmark.js +0 -6
- package/dist/icons/basic/checkmark_circle.js +0 -8
- package/dist/icons/basic/checkmark_filled.js +0 -6
- package/dist/icons/basic/checkmarks.js +0 -6
- package/dist/icons/basic/circle.js +0 -6
- package/dist/icons/basic/circle_slash.js +0 -8
- package/dist/icons/basic/clear_text_style.js +0 -6
- package/dist/icons/basic/close.js +0 -6
- package/dist/icons/basic/close_circle.js +0 -6
- package/dist/icons/basic/close_filled.js +0 -6
- package/dist/icons/basic/copy.js +0 -6
- package/dist/icons/basic/delete.js +0 -6
- package/dist/icons/basic/detail.js +0 -6
- package/dist/icons/basic/dot.js +0 -6
- package/dist/icons/basic/download.js +0 -6
- package/dist/icons/basic/download_arrow.js +0 -6
- package/dist/icons/basic/droplet.js +0 -8
- package/dist/icons/basic/ellipsis_horizontal.js +0 -6
- package/dist/icons/basic/ellipsis_horizontal_circle.js +0 -6
- package/dist/icons/basic/ellipsis_vertical.js +0 -6
- package/dist/icons/basic/ellipsis_vertical_circle.js +0 -6
- package/dist/icons/basic/eye.js +0 -6
- package/dist/icons/basic/eye_slash.js +0 -6
- package/dist/icons/basic/fingerprint.js +0 -6
- package/dist/icons/basic/flag.js +0 -6
- package/dist/icons/basic/flag_wave.js +0 -6
- package/dist/icons/basic/flag_wave_filled.js +0 -6
- package/dist/icons/basic/flame.js +0 -6
- package/dist/icons/basic/gauge.js +0 -6
- package/dist/icons/basic/glasses.js +0 -6
- package/dist/icons/basic/graduation_cap.js +0 -6
- package/dist/icons/basic/hashmark.js +0 -6
- package/dist/icons/basic/heart.js +0 -6
- package/dist/icons/basic/heart_slash.js +0 -6
- package/dist/icons/basic/highlighter.js +0 -6
- package/dist/icons/basic/home.js +0 -6
- package/dist/icons/basic/image.js +0 -6
- package/dist/icons/basic/inbox.js +0 -6
- package/dist/icons/basic/index.js +0 -131
- package/dist/icons/basic/italic.js +0 -6
- package/dist/icons/basic/layers.js +0 -6
- package/dist/icons/basic/lightening.js +0 -6
- package/dist/icons/basic/lightening_slash.js +0 -6
- package/dist/icons/basic/link.js +0 -6
- package/dist/icons/basic/link_slash.js +0 -6
- package/dist/icons/basic/loudspeaker.js +0 -6
- package/dist/icons/basic/maximize.js +0 -6
- package/dist/icons/basic/menu.js +0 -6
- package/dist/icons/basic/menu_circle.js +0 -6
- package/dist/icons/basic/menu_dots.js +0 -6
- package/dist/icons/basic/microphone_slash.js +0 -6
- package/dist/icons/basic/minimize.js +0 -6
- package/dist/icons/basic/minus.js +0 -6
- package/dist/icons/basic/minus_circle.js +0 -6
- package/dist/icons/basic/move_item.js +0 -6
- package/dist/icons/basic/new.js +0 -6
- package/dist/icons/basic/newspaper.js +0 -6
- package/dist/icons/basic/node.js +0 -6
- package/dist/icons/basic/note_pad.js +0 -7
- package/dist/icons/basic/options.js +0 -6
- package/dist/icons/basic/paint_brush.js +0 -6
- package/dist/icons/basic/paperclip.js +0 -6
- package/dist/icons/basic/paperclip_slash.js +0 -6
- package/dist/icons/basic/pencil.js +0 -6
- package/dist/icons/basic/pencil_pad.js +0 -6
- package/dist/icons/basic/plus.js +0 -6
- package/dist/icons/basic/plus_circle.js +0 -6
- package/dist/icons/basic/presentation.js +0 -6
- package/dist/icons/basic/printer.js +0 -6
- package/dist/icons/basic/profile.js +0 -6
- package/dist/icons/basic/profile_check.js +0 -6
- package/dist/icons/basic/pulse.js +0 -6
- package/dist/icons/basic/qr_code.js +0 -6
- package/dist/icons/basic/resize.js +0 -8
- package/dist/icons/basic/scan.js +0 -6
- package/dist/icons/basic/scissors.js +0 -6
- package/dist/icons/basic/screenshot.js +0 -6
- package/dist/icons/basic/search.js +0 -6
- package/dist/icons/basic/select_item.js +0 -7
- package/dist/icons/basic/settings.js +0 -6
- package/dist/icons/basic/share.js +0 -6
- package/dist/icons/basic/share_external.js +0 -6
- package/dist/icons/basic/square.js +0 -6
- package/dist/icons/basic/star.js +0 -6
- package/dist/icons/basic/star_circle.js +0 -6
- package/dist/icons/basic/star_filled.js +0 -6
- package/dist/icons/basic/star_filled_half.js +0 -6
- package/dist/icons/basic/star_slash.js +0 -6
- package/dist/icons/basic/sticker.js +0 -6
- package/dist/icons/basic/strikethrough.js +0 -6
- package/dist/icons/basic/subtask.js +0 -7
- package/dist/icons/basic/tax.js +0 -9
- package/dist/icons/basic/text_bg_color.js +0 -6
- package/dist/icons/basic/text_color.js +0 -6
- package/dist/icons/basic/textbox.js +0 -6
- package/dist/icons/basic/thumbs_down.js +0 -6
- package/dist/icons/basic/thumbs_up.js +0 -6
- package/dist/icons/basic/thumbs_up_filled.js +0 -6
- package/dist/icons/basic/toggle_left.js +0 -6
- package/dist/icons/basic/toggle_right.js +0 -6
- package/dist/icons/basic/translate.js +0 -6
- package/dist/icons/basic/trash.js +0 -6
- package/dist/icons/basic/trash_slash.js +0 -6
- package/dist/icons/basic/underline.js +0 -6
- package/dist/icons/basic/upload.js +0 -6
- package/dist/icons/basic/video.js +0 -6
- package/dist/icons/basic/video_add.js +0 -7
- package/dist/icons/basic/video_slash.js +0 -6
- package/dist/icons/basic/wrench.js +0 -6
- package/dist/icons/basic/zoom_in.js +0 -6
- package/dist/icons/basic/zoom_out.js +0 -6
- package/dist/icons/data/bar_chart.js +0 -6
- package/dist/icons/data/bar_chart_downward.js +0 -6
- package/dist/icons/data/bar_chart_downward_outline.js +0 -6
- package/dist/icons/data/bar_chart_upward.js +0 -6
- package/dist/icons/data/bar_chart_upward_outline.js +0 -6
- package/dist/icons/data/candlestick_chart.js +0 -6
- package/dist/icons/data/four_circles.js +0 -6
- package/dist/icons/data/index.js +0 -20
- package/dist/icons/data/legend_toggle.js +0 -6
- package/dist/icons/data/line_chart.js +0 -6
- package/dist/icons/data/line_chart_area.js +0 -6
- package/dist/icons/data/line_chart_area_shaded.js +0 -6
- package/dist/icons/data/line_chart_double.js +0 -6
- package/dist/icons/data/line_chart_downward.js +0 -6
- package/dist/icons/data/line_chart_node.js +0 -6
- package/dist/icons/data/line_chart_outline.js +0 -6
- package/dist/icons/data/line_chart_search.js +0 -6
- package/dist/icons/data/line_chart_stars.js +0 -6
- package/dist/icons/data/line_chart_upward.js +0 -6
- package/dist/icons/data/pie_chart.js +0 -7
- package/dist/icons/data/tree.js +0 -6
- package/dist/icons/email/index.js +0 -8
- package/dist/icons/email/mail.js +0 -6
- package/dist/icons/email/mail_check.js +0 -6
- package/dist/icons/email/mail_minus.js +0 -6
- package/dist/icons/email/mail_send.js +0 -6
- package/dist/icons/email/send.js +0 -6
- package/dist/icons/email/send_close.js +0 -6
- package/dist/icons/email/send_schedule.js +0 -6
- package/dist/icons/email/send_text.js +0 -6
- package/dist/icons/emoji/emoji_add.js +0 -6
- package/dist/icons/emoji/index.js +0 -6
- package/dist/icons/emoji/laughing.js +0 -6
- package/dist/icons/emoji/neutral.js +0 -6
- package/dist/icons/emoji/sad.js +0 -6
- package/dist/icons/emoji/shocked.js +0 -6
- package/dist/icons/emoji/smile.js +0 -6
- package/dist/icons/file/clipboard.js +0 -6
- package/dist/icons/file/clipboard_check.js +0 -6
- package/dist/icons/file/clipboard_close.js +0 -6
- package/dist/icons/file/clipboard_minus.js +0 -6
- package/dist/icons/file/clipboard_plus.js +0 -6
- package/dist/icons/file/clipboard_text.js +0 -6
- package/dist/icons/file/file.js +0 -6
- package/dist/icons/file/file_add.js +0 -6
- package/dist/icons/file/file_check.js +0 -6
- package/dist/icons/file/file_close.js +0 -6
- package/dist/icons/file/file_code.js +0 -6
- package/dist/icons/file/file_download.js +0 -6
- package/dist/icons/file/file_draft.js +0 -6
- package/dist/icons/file/file_gear.js +0 -7
- package/dist/icons/file/file_minus.js +0 -6
- package/dist/icons/file/file_plus.js +0 -6
- package/dist/icons/file/file_scan.js +0 -6
- package/dist/icons/file/file_shred.js +0 -6
- package/dist/icons/file/file_text.js +0 -6
- package/dist/icons/file/file_upload.js +0 -6
- package/dist/icons/file/folder.js +0 -6
- package/dist/icons/file/folder_add.js +0 -6
- package/dist/icons/file/folder_arrow.js +0 -6
- package/dist/icons/file/folder_check.js +0 -6
- package/dist/icons/file/folder_close.js +0 -6
- package/dist/icons/file/folder_cloud.js +0 -6
- package/dist/icons/file/folder_gear.js +0 -7
- package/dist/icons/file/folder_minus.js +0 -6
- package/dist/icons/file/folder_music.js +0 -6
- package/dist/icons/file/folder_open.js +0 -6
- package/dist/icons/file/folder_plus.js +0 -6
- package/dist/icons/file/folder_zip.js +0 -6
- package/dist/icons/file/index.js +0 -36
- package/dist/icons/file/note.js +0 -6
- package/dist/icons/file/note_text.js +0 -6
- package/dist/icons/file/pdf.js +0 -6
- package/dist/icons/file/photo.js +0 -6
- package/dist/icons/finance/bitcoin.js +0 -6
- package/dist/icons/finance/coins.js +0 -10
- package/dist/icons/finance/credit_card.js +0 -6
- package/dist/icons/finance/credit_card_add.js +0 -6
- package/dist/icons/finance/credit_card_face.js +0 -6
- package/dist/icons/finance/credit_card_member.js +0 -6
- package/dist/icons/finance/credit_card_outcome.js +0 -6
- package/dist/icons/finance/credit_card_scan.js +0 -6
- package/dist/icons/finance/credit_card_share.js +0 -6
- package/dist/icons/finance/credit_card_slash.js +0 -6
- package/dist/icons/finance/currency_exchange.js +0 -6
- package/dist/icons/finance/dollar.js +0 -6
- package/dist/icons/finance/ethereum.js +0 -6
- package/dist/icons/finance/index.js +0 -16
- package/dist/icons/finance/paypass.js +0 -6
- package/dist/icons/finance/strongbox.js +0 -6
- package/dist/icons/finance/wallet.js +0 -6
- package/dist/icons/index.js +0 -22
- package/dist/icons/layout/block_align_bottom.js +0 -6
- package/dist/icons/layout/block_align_center.js +0 -6
- package/dist/icons/layout/block_align_left.js +0 -6
- package/dist/icons/layout/block_align_middle.js +0 -6
- package/dist/icons/layout/block_align_right.js +0 -6
- package/dist/icons/layout/block_align_top.js +0 -6
- package/dist/icons/layout/block_horizontal.js +0 -6
- package/dist/icons/layout/block_vertical.js +0 -6
- package/dist/icons/layout/edit_shape.js +0 -6
- package/dist/icons/layout/elements.js +0 -6
- package/dist/icons/layout/elements_add.js +0 -6
- package/dist/icons/layout/elements_filled.js +0 -6
- package/dist/icons/layout/elements_masonry.js +0 -6
- package/dist/icons/layout/frame.js +0 -6
- package/dist/icons/layout/frame_stack.js +0 -6
- package/dist/icons/layout/grid.js +0 -6
- package/dist/icons/layout/grid_column_three.js +0 -6
- package/dist/icons/layout/grid_column_two.js +0 -6
- package/dist/icons/layout/grid_dynamic.js +0 -6
- package/dist/icons/layout/grid_frame.js +0 -6
- package/dist/icons/layout/grid_row_three.js +0 -6
- package/dist/icons/layout/grid_row_two.js +0 -6
- package/dist/icons/layout/grid_six.js +0 -6
- package/dist/icons/layout/grid_small.js +0 -6
- package/dist/icons/layout/iframe.js +0 -6
- package/dist/icons/layout/index.js +0 -44
- package/dist/icons/layout/kanban.js +0 -6
- package/dist/icons/layout/layout.js +0 -6
- package/dist/icons/layout/list.js +0 -6
- package/dist/icons/layout/list_filled.js +0 -11
- package/dist/icons/layout/padding.js +0 -6
- package/dist/icons/layout/page_break.js +0 -6
- package/dist/icons/layout/rotate_left.js +0 -6
- package/dist/icons/layout/rotate_right.js +0 -6
- package/dist/icons/layout/ruler.js +0 -6
- package/dist/icons/layout/segment.js +0 -6
- package/dist/icons/layout/select_area.js +0 -6
- package/dist/icons/layout/select_boundary.js +0 -6
- package/dist/icons/layout/sidebar_left.js +0 -6
- package/dist/icons/layout/sidebar_right.js +0 -6
- package/dist/icons/layout/slides.js +0 -6
- package/dist/icons/layout/slides_horizontal.js +0 -6
- package/dist/icons/layout/slides_vertical.js +0 -11
- package/dist/icons/layout/stack.js +0 -6
- package/dist/icons/layout/text.js +0 -6
- package/dist/icons/maps/atlas.js +0 -6
- package/dist/icons/maps/compass.js +0 -6
- package/dist/icons/maps/direction.js +0 -6
- package/dist/icons/maps/direction_angled.js +0 -6
- package/dist/icons/maps/globe.js +0 -6
- package/dist/icons/maps/globe_slash.js +0 -6
- package/dist/icons/maps/index.js +0 -22
- package/dist/icons/maps/location.js +0 -6
- package/dist/icons/maps/location_slash.js +0 -6
- package/dist/icons/maps/map.js +0 -6
- package/dist/icons/maps/marker.js +0 -6
- package/dist/icons/maps/panorama.js +0 -6
- package/dist/icons/maps/pin.js +0 -6
- package/dist/icons/maps/pin_arrow.js +0 -6
- package/dist/icons/maps/pin_location.js +0 -6
- package/dist/icons/maps/pin_plus.js +0 -6
- package/dist/icons/maps/pin_question.js +0 -6
- package/dist/icons/maps/pin_slash.js +0 -6
- package/dist/icons/maps/push_pin.js +0 -6
- package/dist/icons/maps/push_pin_filled.js +0 -6
- package/dist/icons/maps/push_pin_slash.js +0 -6
- package/dist/icons/maps/radar.js +0 -6
- package/dist/icons/maps/route.js +0 -6
- package/dist/icons/message/bubble.js +0 -6
- package/dist/icons/message/bubble_question.js +0 -6
- package/dist/icons/message/comment.js +0 -6
- package/dist/icons/message/comment_add.js +0 -6
- package/dist/icons/message/comment_check.js +0 -6
- package/dist/icons/message/comment_close.js +0 -6
- package/dist/icons/message/comment_minus.js +0 -6
- package/dist/icons/message/comment_text.js +0 -6
- package/dist/icons/message/index.js +0 -8
- package/dist/icons/misc/advertisement.js +0 -6
- package/dist/icons/misc/atom.js +0 -6
- package/dist/icons/misc/bone.js +0 -6
- package/dist/icons/misc/brightness_high.js +0 -6
- package/dist/icons/misc/brightness_low.js +0 -6
- package/dist/icons/misc/contrast.js +0 -6
- package/dist/icons/misc/crosshairs.js +0 -6
- package/dist/icons/misc/crown.js +0 -6
- package/dist/icons/misc/footprint.js +0 -6
- package/dist/icons/misc/form.js +0 -6
- package/dist/icons/misc/funnel.js +0 -6
- package/dist/icons/misc/index.js +0 -25
- package/dist/icons/misc/infinite.js +0 -6
- package/dist/icons/misc/insert_button.js +0 -6
- package/dist/icons/misc/light_bulb.js +0 -6
- package/dist/icons/misc/moon.js +0 -6
- package/dist/icons/misc/nut.js +0 -6
- package/dist/icons/misc/planet.js +0 -6
- package/dist/icons/misc/plus_thick.js +0 -6
- package/dist/icons/misc/pocket.js +0 -6
- package/dist/icons/misc/rocket.js +0 -6
- package/dist/icons/misc/soup.js +0 -10
- package/dist/icons/misc/sun.js +0 -6
- package/dist/icons/misc/toy_horse.js +0 -6
- package/dist/icons/misc/trophy.js +0 -6
- package/dist/icons/misc/watercloset.js +0 -6
- package/dist/icons/notifications/alert_circle.js +0 -6
- package/dist/icons/notifications/alert_octogon.js +0 -6
- package/dist/icons/notifications/alert_triangle.js +0 -6
- package/dist/icons/notifications/app_notification.js +0 -6
- package/dist/icons/notifications/bell.js +0 -6
- package/dist/icons/notifications/bell_alert.js +0 -6
- package/dist/icons/notifications/bell_checkmark.js +0 -6
- package/dist/icons/notifications/bell_minus.js +0 -6
- package/dist/icons/notifications/bell_plus.js +0 -6
- package/dist/icons/notifications/bell_ring.js +0 -8
- package/dist/icons/notifications/bell_slash.js +0 -6
- package/dist/icons/notifications/close_octogon.js +0 -6
- package/dist/icons/notifications/index.js +0 -14
- package/dist/icons/notifications/information.js +0 -6
- package/dist/icons/notifications/minus_octogon.js +0 -6
- package/dist/icons/notifications/question_circle.js +0 -6
- package/dist/icons/people/group.js +0 -6
- package/dist/icons/people/group_add.js +0 -6
- package/dist/icons/people/group_chat.js +0 -8
- package/dist/icons/people/group_remove.js +0 -6
- package/dist/icons/people/group_send.js +0 -7
- package/dist/icons/people/groups.js +0 -6
- package/dist/icons/people/index.js +0 -13
- package/dist/icons/people/person.js +0 -6
- package/dist/icons/people/person_add.js +0 -6
- package/dist/icons/people/person_checkmark.js +0 -6
- package/dist/icons/people/person_circle.js +0 -8
- package/dist/icons/people/person_close.js +0 -8
- package/dist/icons/people/person_remove.js +0 -6
- package/dist/icons/people/person_slash.js +0 -8
- package/dist/icons/phone/index.js +0 -14
- package/dist/icons/phone/keypad.js +0 -6
- package/dist/icons/phone/phone.js +0 -6
- package/dist/icons/phone/phone_add.js +0 -6
- package/dist/icons/phone/phone_calling.js +0 -6
- package/dist/icons/phone/phone_check.js +0 -6
- package/dist/icons/phone/phone_close.js +0 -6
- package/dist/icons/phone/phone_decline.js +0 -6
- package/dist/icons/phone/phone_end.js +0 -6
- package/dist/icons/phone/phone_forwarded.js +0 -6
- package/dist/icons/phone/phone_hash.js +0 -6
- package/dist/icons/phone/phone_incoming.js +0 -6
- package/dist/icons/phone/phone_missed.js +0 -6
- package/dist/icons/phone/phone_outgoing.js +0 -6
- package/dist/icons/phone/phone_pause.js +0 -6
- package/dist/icons/phone/phone_slash.js +0 -6
- package/dist/icons/phone/voicemail.js +0 -6
- package/dist/icons/security/index.js +0 -11
- package/dist/icons/security/key.js +0 -6
- package/dist/icons/security/key_slash.js +0 -6
- package/dist/icons/security/lock.js +0 -6
- package/dist/icons/security/lock_circle.js +0 -6
- package/dist/icons/security/lock_open.js +0 -6
- package/dist/icons/security/lock_slash.js +0 -6
- package/dist/icons/security/shield.js +0 -6
- package/dist/icons/security/shield_checkmark.js +0 -6
- package/dist/icons/security/shield_lock.js +0 -6
- package/dist/icons/security/shield_slash.js +0 -6
- package/dist/icons/security/verified.js +0 -6
- package/dist/icons/shopping/basket.js +0 -6
- package/dist/icons/shopping/cart.js +0 -6
- package/dist/icons/shopping/cart_filled.js +0 -6
- package/dist/icons/shopping/coupon.js +0 -6
- package/dist/icons/shopping/coupon_cut.js +0 -6
- package/dist/icons/shopping/delivery.js +0 -6
- package/dist/icons/shopping/discount.js +0 -6
- package/dist/icons/shopping/gift.js +0 -6
- package/dist/icons/shopping/gift_bag.js +0 -6
- package/dist/icons/shopping/index.js +0 -15
- package/dist/icons/shopping/inventory.js +0 -6
- package/dist/icons/shopping/point_of_sale.js +0 -6
- package/dist/icons/shopping/shirt.js +0 -6
- package/dist/icons/shopping/tag.js +0 -6
- package/dist/icons/shopping/tag_diagonal.js +0 -6
- package/dist/icons/shopping/tote.js +0 -6
- package/dist/icons/special/index.js +0 -4
- package/dist/icons/special/upload_audio.js +0 -11
- package/dist/icons/special/upload_file.js +0 -6
- package/dist/icons/special/upload_image.js +0 -8
- package/dist/icons/special/upload_video.js +0 -9
- package/dist/icons/symbols/at.js +0 -6
- package/dist/icons/symbols/cc.js +0 -6
- package/dist/icons/symbols/cmd.js +0 -6
- package/dist/icons/symbols/facebook.js +0 -6
- package/dist/icons/symbols/google.js +0 -9
- package/dist/icons/symbols/hash.js +0 -6
- package/dist/icons/symbols/index.js +0 -9
- package/dist/icons/symbols/instagram.js +0 -18
- package/dist/icons/symbols/messenger.js +0 -12
- package/dist/icons/symbols/twitter.js +0 -6
- package/dist/icons/technology/battery.js +0 -6
- package/dist/icons/technology/battery_100.js +0 -6
- package/dist/icons/technology/battery_20.js +0 -6
- package/dist/icons/technology/battery_40.js +0 -6
- package/dist/icons/technology/battery_60.js +0 -6
- package/dist/icons/technology/battery_80.js +0 -6
- package/dist/icons/technology/battery_charging.js +0 -6
- package/dist/icons/technology/battery_slash.js +0 -6
- package/dist/icons/technology/devices.js +0 -6
- package/dist/icons/technology/floppy_disk.js +0 -6
- package/dist/icons/technology/index.js +0 -17
- package/dist/icons/technology/iphone.js +0 -6
- package/dist/icons/technology/laptop.js +0 -6
- package/dist/icons/technology/mobile.js +0 -6
- package/dist/icons/technology/monitor.js +0 -6
- package/dist/icons/technology/server.js +0 -6
- package/dist/icons/technology/sim_card.js +0 -6
- package/dist/icons/technology/usb_stick.js +0 -6
- package/dist/icons/text/align_center.js +0 -6
- package/dist/icons/text/align_justified.js +0 -6
- package/dist/icons/text/align_left.js +0 -6
- package/dist/icons/text/align_right.js +0 -6
- package/dist/icons/text/code_block.js +0 -6
- package/dist/icons/text/divider.js +0 -6
- package/dist/icons/text/footnote.js +0 -8
- package/dist/icons/text/indent_decrease.js +0 -6
- package/dist/icons/text/indent_increase.js +0 -6
- package/dist/icons/text/index.js +0 -13
- package/dist/icons/text/list_ordered.js +0 -6
- package/dist/icons/text/list_unordered.js +0 -6
- package/dist/icons/text/quote.js +0 -6
- package/dist/icons/text/table.js +0 -6
- package/dist/icons/time/alarm.js +0 -6
- package/dist/icons/time/alarm_checkmark.js +0 -6
- package/dist/icons/time/alarm_minus.js +0 -6
- package/dist/icons/time/alarm_plus.js +0 -6
- package/dist/icons/time/alarm_slash.js +0 -6
- package/dist/icons/time/alarm_snooze.js +0 -6
- package/dist/icons/time/calendar.js +0 -6
- package/dist/icons/time/calendar_add.js +0 -6
- package/dist/icons/time/calendar_checkmark.js +0 -6
- package/dist/icons/time/calendar_close.js +0 -6
- package/dist/icons/time/calendar_dates.js +0 -6
- package/dist/icons/time/calendar_minus.js +0 -6
- package/dist/icons/time/calendar_plus.js +0 -6
- package/dist/icons/time/calendar_scroll.js +0 -8
- package/dist/icons/time/clock.js +0 -6
- package/dist/icons/time/clock_history.js +0 -6
- package/dist/icons/time/index.js +0 -19
- package/dist/icons/time/stopwatch.js +0 -6
- package/dist/icons/time/timer.js +0 -6
- package/dist/icons/time/watch.js +0 -6
- package/dist/styles/output.css +0 -1771
- package/dist/types/attributes.js +0 -1
- package/dist/types/index.js +0 -1
- package/dist/utils/date.js +0 -98
- package/dist/utils/function.js +0 -1
- package/dist/utils/index.js +0 -2
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import Picker from '@emoji-mart/react';
|
|
5
|
-
import { Avatar, Box, P, TextInput } from '../../';
|
|
6
|
-
import { Button } from '../../actions/button';
|
|
7
|
-
import { Portal } from '../portal';
|
|
8
|
-
import emojis from '../../../emoji/emojis.json';
|
|
9
|
-
import { Styles } from '../../../common';
|
|
10
|
-
import { ThumbsUp, Comment as CommentIcon } from '../../../icons';
|
|
11
|
-
import { abbrTimeBeforeDate } from './helpers';
|
|
12
|
-
const MAX_REACTIONS_SHOWN = 5;
|
|
13
|
-
export const Comment = ({ avatarTooltipContent, avatarTooltipSx, content, createdDate, hasMoreReplies, id, onComment, onReact, onShowReplies, reactionModal, reactions, replies, userImageUri, userName, userReactions, userProfileUri, }) => {
|
|
14
|
-
const [showPicker, setShowPicker] = React.useState(false);
|
|
15
|
-
const [pickerTriggerLoc, setPickerTriggerLoc] = React.useState({
|
|
16
|
-
x: 0,
|
|
17
|
-
y: 0,
|
|
18
|
-
});
|
|
19
|
-
const [pickerOrientation, setPickerOrientation] = React.useState('up');
|
|
20
|
-
const [toggleShowCommentInput, setShowCommentInput] = React.useState(false);
|
|
21
|
-
const [toggleShowReplies, setShowReplies] = React.useState(false);
|
|
22
|
-
const [comment, setComment] = React.useState('');
|
|
23
|
-
const _replies = React.Children.toArray(replies);
|
|
24
|
-
const handleCommentChange = (event) => {
|
|
25
|
-
setComment(event.target.value);
|
|
26
|
-
};
|
|
27
|
-
const handleCommentSubmit = (event) => {
|
|
28
|
-
event.stopPropagation();
|
|
29
|
-
event.preventDefault();
|
|
30
|
-
onComment(comment);
|
|
31
|
-
setComment('');
|
|
32
|
-
};
|
|
33
|
-
const handleReaction = ({ native }) => {
|
|
34
|
-
onReact(native);
|
|
35
|
-
setShowPicker(false);
|
|
36
|
-
};
|
|
37
|
-
const handlePicker = (event) => {
|
|
38
|
-
event.stopPropagation();
|
|
39
|
-
setShowPicker((prev) => !prev);
|
|
40
|
-
setPickerTriggerLoc({ y: event.clientY, x: event.clientX });
|
|
41
|
-
setPickerOrientation(event.clientY > 400 ? 'up' : 'down');
|
|
42
|
-
};
|
|
43
|
-
const handlePickerBlur = () => setShowPicker(false);
|
|
44
|
-
const handleToggleCommentInput = () => setShowCommentInput((prev) => !prev);
|
|
45
|
-
const handleToggleReplies = () => {
|
|
46
|
-
onShowReplies && onShowReplies();
|
|
47
|
-
setShowReplies(true);
|
|
48
|
-
};
|
|
49
|
-
const createdTime = abbrTimeBeforeDate(createdDate);
|
|
50
|
-
const reactionElements = reactions &&
|
|
51
|
-
Object.entries(reactions)
|
|
52
|
-
.slice(0, MAX_REACTIONS_SHOWN)
|
|
53
|
-
.sort((a, b) => (a[1] < b[1] ? 1 : -1))
|
|
54
|
-
.map((reaction) => (React.createElement(Reaction, { key: id + reaction[0], onClick: () => onReact(reaction[0]), "$align": "center", "$dir": "row", "$gap": 5, "$userSelected": userReactions?.includes(reaction[0]) },
|
|
55
|
-
reaction[0],
|
|
56
|
-
React.createElement(P, { "$bold": true, "$fontSize": 10, "$lineHeight": 14 }, reaction[1]))));
|
|
57
|
-
const hasReplies = !!_replies?.length && _replies.length > 0;
|
|
58
|
-
const replyElements = hasReplies &&
|
|
59
|
-
_replies.map((reply, index) => {
|
|
60
|
-
if (!React.isValidElement(reply))
|
|
61
|
-
return null;
|
|
62
|
-
const key = reply.props?.id;
|
|
63
|
-
const hasLine = index !== _replies.length - 1 || hasMoreReplies;
|
|
64
|
-
return (React.createElement(ReplyWrapper, { "$hasLine": hasLine, key: key },
|
|
65
|
-
reply,
|
|
66
|
-
React.createElement(ReplyIndicator, null)));
|
|
67
|
-
});
|
|
68
|
-
return (React.createElement(Wrapper, { id: id },
|
|
69
|
-
React.createElement(Avatar, { href: userProfileUri, image: userImageUri, size: 32, tooltipContent: avatarTooltipContent, tooltipSx: avatarTooltipSx }),
|
|
70
|
-
React.createElement(Box, { "$flex": 1, "$dir": "column" },
|
|
71
|
-
React.createElement(ContentWrapper, { "$hasReplies": hasReplies || !!hasMoreReplies },
|
|
72
|
-
React.createElement(CommentBox, null,
|
|
73
|
-
React.createElement(P, { "$bold": true, "$color": "grey-2", "$fontSize": 14, "$lineHeight": 20 }, userName),
|
|
74
|
-
React.createElement(P, { sx: "letter-spacing: -0.176px;" }, content)),
|
|
75
|
-
React.createElement(Box, { "$align": "flex-start", "$dir": "row", "$display": "flex", "$gap": 16, sx: "margin: 8px 0px; position: relative;" },
|
|
76
|
-
React.createElement(ThumbsUp, { color: "primary-blue-2", onClick: handlePicker, size: 24, sx: "border-radius: 50%; cursor: pointer; flex-shrink: 0;" }),
|
|
77
|
-
React.createElement(CommentIcon, { color: "primary-blue-2", onClick: handleToggleCommentInput, size: 24, sx: "border-radius: 50%; cursor: pointer; flex-shrink: 0;" }),
|
|
78
|
-
React.createElement(P, { "$color": "grey-7" }, "\u2022"),
|
|
79
|
-
React.createElement(P, { "$color": "grey-4", "$fontSize": 12, "$lineHeight": 24, sx: "flex-shrink: 0;" }, createdTime),
|
|
80
|
-
React.createElement(Box, { "$display": "flex", "$flow": "row wrap", "$gap": 6, sx: "max-width: calc(100% - 190px); margin-left: auto;" },
|
|
81
|
-
reactionElements,
|
|
82
|
-
reactionModal),
|
|
83
|
-
showPicker && (React.createElement(Portal, null,
|
|
84
|
-
React.createElement(PickerWrapper, { "$pickerOrientation": pickerOrientation, "$top": pickerTriggerLoc.y, "$left": pickerTriggerLoc.x },
|
|
85
|
-
React.createElement(Picker, { data: emojis, onEmojiSelect: handleReaction, onClickOutside: handlePickerBlur, maxFrequentRows: 1, navPosition: "none", previewPosition: "none", perLine: 9, theme: "auto" })))))),
|
|
86
|
-
hasReplies && toggleShowReplies && (React.createElement(RepliesWrapper, null, replyElements)),
|
|
87
|
-
!toggleShowReplies && !hasMoreReplies && hasReplies && (React.createElement(RepliesWrapper, null,
|
|
88
|
-
React.createElement(ReplyWrapper, { "$hasLine": false },
|
|
89
|
-
React.createElement(Button, { onClick: handleToggleReplies, size: "small", sx: "color: var(--color-grey-3);", type: "text" }, "show replies"),
|
|
90
|
-
React.createElement(ReplyIndicator, null)))),
|
|
91
|
-
hasMoreReplies && (React.createElement(RepliesWrapper, null,
|
|
92
|
-
React.createElement(ReplyWrapper, { "$hasLine": false },
|
|
93
|
-
React.createElement(Button, { onClick: handleToggleReplies, size: "small", sx: "color: var(--color-grey-3);", type: "text" }, "show more replies"),
|
|
94
|
-
React.createElement(ReplyIndicator, null)))),
|
|
95
|
-
toggleShowCommentInput && (React.createElement(CommentWrapper, { onSubmit: handleCommentSubmit },
|
|
96
|
-
React.createElement(TextInput, { bg: "var(--color-grey-10)", placeholder: "Write a reply", onChange: handleCommentChange, value: comment }))))));
|
|
97
|
-
};
|
|
98
|
-
const Wrapper = styled.div `
|
|
99
|
-
max-width: 700px;
|
|
100
|
-
display: flex;
|
|
101
|
-
flex-direction: row;
|
|
102
|
-
align-items: flex-start;
|
|
103
|
-
gap: 12px;
|
|
104
|
-
justify-content: space-between;
|
|
105
|
-
position: relative;
|
|
106
|
-
`;
|
|
107
|
-
const ContentWrapper = styled.div `
|
|
108
|
-
display: flex;
|
|
109
|
-
flex-direction: column;
|
|
110
|
-
${({ $hasReplies }) => $hasReplies
|
|
111
|
-
? `
|
|
112
|
-
position: relative;
|
|
113
|
-
|
|
114
|
-
&::before {
|
|
115
|
-
content: "";
|
|
116
|
-
position: absolute;
|
|
117
|
-
top: 32px;
|
|
118
|
-
left: -28px;
|
|
119
|
-
height: calc(100% - 12px);
|
|
120
|
-
border-left: 2px solid var(--color-grey-9);
|
|
121
|
-
}`
|
|
122
|
-
: ''}
|
|
123
|
-
`;
|
|
124
|
-
const CommentBox = styled.div `
|
|
125
|
-
padding: 16px;
|
|
126
|
-
display: flex;
|
|
127
|
-
flex-direction: column;
|
|
128
|
-
gap: 8px;
|
|
129
|
-
background-color: var(--color-grey-10);
|
|
130
|
-
border-radius: 16px;
|
|
131
|
-
`;
|
|
132
|
-
const PickerWrapper = styled.div `
|
|
133
|
-
position: absolute;
|
|
134
|
-
z-index: 1000;
|
|
135
|
-
|
|
136
|
-
${({ $pickerOrientation }) => $pickerOrientation === 'up' ? 'transform: translateY(-345px);' : ''}
|
|
137
|
-
top: ${({ $top }) => $top}px;
|
|
138
|
-
left: ${({ $left }) => $left}px;
|
|
139
|
-
`;
|
|
140
|
-
const Reaction = styled.div `
|
|
141
|
-
${Styles.flex}
|
|
142
|
-
display: flex;
|
|
143
|
-
padding: 2px 6px;
|
|
144
|
-
border-radius: 12px;
|
|
145
|
-
cursor: pointer;
|
|
146
|
-
${({ $userSelected }) => $userSelected
|
|
147
|
-
? `
|
|
148
|
-
background-color: var(--color-primary-blue-4);
|
|
149
|
-
border: 1px solid var(--color-primary-blue-3);
|
|
150
|
-
`
|
|
151
|
-
: ''}
|
|
152
|
-
`;
|
|
153
|
-
const RepliesWrapper = styled.div `
|
|
154
|
-
padding-top: 12px;
|
|
155
|
-
`;
|
|
156
|
-
const ReplyWrapper = styled.div `
|
|
157
|
-
position: relative;
|
|
158
|
-
${({ $hasLine }) => $hasLine
|
|
159
|
-
? `
|
|
160
|
-
&::before {
|
|
161
|
-
content: "";
|
|
162
|
-
position: absolute;
|
|
163
|
-
left: -28px;
|
|
164
|
-
height: 100%;
|
|
165
|
-
border-left: 2px solid var(--color-grey-9);
|
|
166
|
-
}`
|
|
167
|
-
: ''}
|
|
168
|
-
`;
|
|
169
|
-
const ReplyIndicator = styled.div `
|
|
170
|
-
position: absolute;
|
|
171
|
-
top: -12px;
|
|
172
|
-
left: -28px;
|
|
173
|
-
width: 28px;
|
|
174
|
-
height: 32px;
|
|
175
|
-
border-bottom-left-radius: 16px;
|
|
176
|
-
border: 2px solid var(--color-grey-9);
|
|
177
|
-
border-top: none;
|
|
178
|
-
border-right: none;
|
|
179
|
-
`;
|
|
180
|
-
const CommentWrapper = styled.form `
|
|
181
|
-
label {
|
|
182
|
-
margin-bottom: 16px;
|
|
183
|
-
}
|
|
184
|
-
label > div {
|
|
185
|
-
box-shadow: var(--elevation-6);
|
|
186
|
-
border-radius: 16px;
|
|
187
|
-
}
|
|
188
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const abbrTimeBeforeDate = (date) => {
|
|
2
|
-
const now = new Date();
|
|
3
|
-
const diff = now.getTime() - date.getTime();
|
|
4
|
-
if (diff < 60000) {
|
|
5
|
-
// under 1 min
|
|
6
|
-
return 'Now';
|
|
7
|
-
}
|
|
8
|
-
else if (diff < 3600000) {
|
|
9
|
-
// under one hour
|
|
10
|
-
const minutes = Math.floor(diff / 60000);
|
|
11
|
-
return `${minutes}m`;
|
|
12
|
-
}
|
|
13
|
-
else if (diff < 86400000) {
|
|
14
|
-
// under one day
|
|
15
|
-
const hours = Math.floor(diff / 3600000);
|
|
16
|
-
return `${hours}h`;
|
|
17
|
-
}
|
|
18
|
-
else if (diff < 604800000) {
|
|
19
|
-
// under one week
|
|
20
|
-
const days = Math.floor(diff / 86400000);
|
|
21
|
-
return `${days}d`;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return `${Math.floor(diff / 604800000)}w`;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Comment } from './comment';
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { callAll } from '../../../utils';
|
|
5
|
-
const DrawerContext = React.createContext([false, (() => undefined)]);
|
|
6
|
-
export const Drawer = ({ children, controlledOpen, onOpenChange, }) => {
|
|
7
|
-
const [open, setOpen] = React.useState(controlledOpen || false);
|
|
8
|
-
React.useEffect(() => {
|
|
9
|
-
if (controlledOpen !== undefined) {
|
|
10
|
-
setOpen(controlledOpen);
|
|
11
|
-
}
|
|
12
|
-
}, [controlledOpen]);
|
|
13
|
-
const _children = React.Children.toArray(children);
|
|
14
|
-
const triggers = [];
|
|
15
|
-
const content = [];
|
|
16
|
-
let footer = null;
|
|
17
|
-
let header = null;
|
|
18
|
-
for (const child of _children) {
|
|
19
|
-
if (React.isValidElement(child)) {
|
|
20
|
-
const type = child.type?.displayName;
|
|
21
|
-
if (type === 'Drawer.Trigger')
|
|
22
|
-
triggers.push(child);
|
|
23
|
-
else if (type === 'Drawer.Header')
|
|
24
|
-
header = child;
|
|
25
|
-
else if (type === 'Drawer.Footer')
|
|
26
|
-
footer = child;
|
|
27
|
-
else
|
|
28
|
-
content.push(child);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return (React.createElement(DrawerContext.Provider, { value: [open, setOpen] },
|
|
32
|
-
triggers,
|
|
33
|
-
open && (React.createElement(Background, { onClick: callAll(() => setOpen(false), () => onOpenChange && onOpenChange()) })),
|
|
34
|
-
React.createElement(Component, { "$open": open },
|
|
35
|
-
header && React.createElement(HeaderWrapper, null, header),
|
|
36
|
-
React.createElement(ContentWrapper, null, content),
|
|
37
|
-
footer && React.createElement(FooterWrapper, null, footer))));
|
|
38
|
-
};
|
|
39
|
-
const Background = styled.div `
|
|
40
|
-
position: fixed;
|
|
41
|
-
height: 100vh;
|
|
42
|
-
width: 100vw;
|
|
43
|
-
top: 0;
|
|
44
|
-
left: 0;
|
|
45
|
-
right: 0;
|
|
46
|
-
z-index: 149;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
background: #000000;
|
|
49
|
-
opacity: 0.5;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
`;
|
|
52
|
-
const Component = styled.div `
|
|
53
|
-
position: fixed;
|
|
54
|
-
top: 0;
|
|
55
|
-
right: 0;
|
|
56
|
-
height: 100vh;
|
|
57
|
-
max-width: 880px;
|
|
58
|
-
width: 100%;
|
|
59
|
-
z-index: 150;
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-flow: column nowrap;
|
|
62
|
-
border-radius: 16px 0px 0px 16px;
|
|
63
|
-
background-color: var(--background-color);
|
|
64
|
-
margin-right: -100vw;
|
|
65
|
-
transition: margin-right 0.5s;
|
|
66
|
-
background-color: var(--color-grey-10);
|
|
67
|
-
|
|
68
|
-
${({ $open }) => ($open ? 'margin-right: 0px;' : '')}
|
|
69
|
-
`;
|
|
70
|
-
const HeaderWrapper = styled.div `
|
|
71
|
-
background-color: var(--color-white);
|
|
72
|
-
box-shadow: var(--elevation-2);
|
|
73
|
-
position: -webkit-sticky;
|
|
74
|
-
position: sticky;
|
|
75
|
-
top: 0;
|
|
76
|
-
border-radius: 16px 0px 0px 0px;
|
|
77
|
-
`;
|
|
78
|
-
const ContentWrapper = styled.div `
|
|
79
|
-
height: calc(100vh - 224px);
|
|
80
|
-
position: relative;
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-flow: column nowrap;
|
|
83
|
-
padding: 24px 16px 24px 24px;
|
|
84
|
-
margin-right: 8px;
|
|
85
|
-
overflow-y: auto;
|
|
86
|
-
flex: 1;
|
|
87
|
-
|
|
88
|
-
&::-webkit-scrollbar-track {
|
|
89
|
-
box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
90
|
-
-webkit-box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
91
|
-
border-radius: 4px;
|
|
92
|
-
background-color: var(--color-white);
|
|
93
|
-
margin: 40px 0px 15px 0px;
|
|
94
|
-
}
|
|
95
|
-
&::-webkit-scrollbar {
|
|
96
|
-
width: 8px;
|
|
97
|
-
border-radius: 4px;
|
|
98
|
-
}
|
|
99
|
-
&::-webkit-scrollbar-thumb {
|
|
100
|
-
border-radius: 4px;
|
|
101
|
-
background-color: var(--color-grey-6);
|
|
102
|
-
opacity: 30%;
|
|
103
|
-
}
|
|
104
|
-
`;
|
|
105
|
-
const FooterWrapper = styled.div `
|
|
106
|
-
background-color: var(--color-white);
|
|
107
|
-
box-shadow: var(--elevation-1);
|
|
108
|
-
position: -webkit-sticky;
|
|
109
|
-
position: sticky;
|
|
110
|
-
bottom: 0;
|
|
111
|
-
border-radius: 0px 0px 0px 16px;
|
|
112
|
-
`;
|
|
113
|
-
const DrawerTrigger = ({ children: child, }) => {
|
|
114
|
-
const [, setOpen] = React.useContext(DrawerContext);
|
|
115
|
-
return (child &&
|
|
116
|
-
React.cloneElement(child, {
|
|
117
|
-
onClick: callAll(() => setOpen((prev) => !prev), child.props.onClick),
|
|
118
|
-
}));
|
|
119
|
-
};
|
|
120
|
-
DrawerTrigger.displayName = 'Drawer.Trigger';
|
|
121
|
-
Drawer.Trigger = DrawerTrigger;
|
|
122
|
-
const DrawerHeader = ({ children }) => (React.createElement("div", null, children));
|
|
123
|
-
DrawerHeader.displayName = 'Drawer.Header';
|
|
124
|
-
Drawer.Header = DrawerHeader;
|
|
125
|
-
const DrawerContent = ({ children }) => (React.createElement("div", null, children));
|
|
126
|
-
DrawerContent.displayName = 'Drawer.Content';
|
|
127
|
-
Drawer.Content = DrawerContent;
|
|
128
|
-
const DrawerFooter = ({ children }) => (React.createElement("div", null, children));
|
|
129
|
-
DrawerFooter.displayName = 'Drawer.Footer';
|
|
130
|
-
Drawer.Footer = DrawerFooter;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Drawer } from './drawer';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { Accordion } from './accordion';
|
|
2
|
-
export { CardCarousel } from './carousel';
|
|
3
|
-
export { Comment } from './comment';
|
|
4
|
-
export { Drawer } from './drawer';
|
|
5
|
-
export { Message } from './message';
|
|
6
|
-
export { Modal } from './modal';
|
|
7
|
-
export { Portal } from './portal';
|
|
8
|
-
export { Post } from './post';
|
|
9
|
-
export { CalendarDate } from './calendar_date';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Message } from './message';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Avatar, Box, P, H } from '../../';
|
|
5
|
-
export const Message = ({ messages, userId }) => {
|
|
6
|
-
const id = React.useId();
|
|
7
|
-
return (React.createElement(Box, { "$display": "flex", "$dir": "column", "$gap": 16 }, messages.map(({ content, createdDate, senderAvatarURI, senderHref, senderId, senderName, }, index) => {
|
|
8
|
-
const isSelf = senderId === userId;
|
|
9
|
-
const isFirstMessageBySender = messages?.[index - 1]?.senderId !== senderId;
|
|
10
|
-
if (isSelf) {
|
|
11
|
-
return (React.createElement(React.Fragment, { key: id + index },
|
|
12
|
-
isFirstMessageBySender && (React.createElement(P, { "$color": "grey-4", "$fontSize": 12, "$lineHeight": 16, sx: "margin-top: 40px; margin-left: auto;" },
|
|
13
|
-
createdDate.toLocaleDateString(),
|
|
14
|
-
' ',
|
|
15
|
-
createdDate.toLocaleTimeString())),
|
|
16
|
-
React.createElement(Wrapper, { "$isSelf": isSelf }, content)));
|
|
17
|
-
}
|
|
18
|
-
return (React.createElement(React.Fragment, { key: id + index },
|
|
19
|
-
isFirstMessageBySender && (React.createElement(Avatar, { image: senderAvatarURI, href: senderHref, subtitle: React.createElement(P, { as: "span", "$color": "blue-2", "$fontSize": 12, "$lineHeight": 16, sx: "vertical-align: top;" }, createdDate.toLocaleTimeString()), size: 56, sx: "margin-top: 40px;", textPosition: "right", title: React.createElement(H, { as: "span", "$color": "blue-2", "$fontSize": 18, "$lineHeight": 26, "$mediumBold": true }, senderName) })),
|
|
20
|
-
React.createElement(Wrapper, { "$isSelf": isSelf }, content)));
|
|
21
|
-
})));
|
|
22
|
-
};
|
|
23
|
-
const Wrapper = styled.div `
|
|
24
|
-
max-width: 552px;
|
|
25
|
-
padding: 16px;
|
|
26
|
-
border-radius: 16px;
|
|
27
|
-
font-family: var(--font-inter);
|
|
28
|
-
font-size: 14px;
|
|
29
|
-
line-height: 20px;
|
|
30
|
-
letter-spacing: -0.006em;
|
|
31
|
-
|
|
32
|
-
${({ $isSelf }) => $isSelf
|
|
33
|
-
? `
|
|
34
|
-
margin-left: auto;
|
|
35
|
-
color: var(--color-white);
|
|
36
|
-
background-color: var(--color-primary-blue-2);
|
|
37
|
-
border-top-right-radius: 0px;`
|
|
38
|
-
: `
|
|
39
|
-
margin-left: 68px;
|
|
40
|
-
margin-right: auto;
|
|
41
|
-
color: var(--color-grey-3);
|
|
42
|
-
background-color: var(--color-grey-9);
|
|
43
|
-
border-top-left-radius: 0px;`}
|
|
44
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Modal } from './modal';
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Button } from '../../';
|
|
5
|
-
import { Close } from '../../../icons';
|
|
6
|
-
import { callAll } from '../../../utils';
|
|
7
|
-
const ModalContext = React.createContext([false, (() => undefined)]);
|
|
8
|
-
const Modal = ({ alwaysRender = true, controlledOpen, onChange, children, ...props }) => {
|
|
9
|
-
const [open, setOpen] = React.useState(controlledOpen || false);
|
|
10
|
-
React.useEffect(() => {
|
|
11
|
-
if (controlledOpen !== undefined) {
|
|
12
|
-
setOpen(controlledOpen);
|
|
13
|
-
}
|
|
14
|
-
}, [controlledOpen]);
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
onChange && onChange(open);
|
|
17
|
-
}, [open]);
|
|
18
|
-
let trigger;
|
|
19
|
-
const rest = [];
|
|
20
|
-
React.Children.forEach(children, (child) => {
|
|
21
|
-
const type = React.isValidElement(child) && child.type?.displayName;
|
|
22
|
-
if (type && type.toLowerCase().includes('trigger')) {
|
|
23
|
-
trigger = child;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
rest.push(child);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return (React.createElement(ModalContext.Provider, { value: [open, setOpen], ...props },
|
|
30
|
-
trigger,
|
|
31
|
-
(open || alwaysRender) && rest));
|
|
32
|
-
};
|
|
33
|
-
const ModalTrigger = ({ children: child, }) => {
|
|
34
|
-
const [, setOpen] = React.useContext(ModalContext);
|
|
35
|
-
return (child &&
|
|
36
|
-
React.cloneElement(child, {
|
|
37
|
-
onClick: callAll(() => setOpen(true), child.props.onClick, (event) => {
|
|
38
|
-
event?.stopPropagation();
|
|
39
|
-
event?.preventDefault();
|
|
40
|
-
}),
|
|
41
|
-
}));
|
|
42
|
-
};
|
|
43
|
-
ModalTrigger.displayName = 'Modal.Trigger';
|
|
44
|
-
Modal.Trigger = ModalTrigger;
|
|
45
|
-
const ModalDismiss = ({ children: child, setClosed, }) => {
|
|
46
|
-
const [, setOpen] = React.useContext(ModalContext);
|
|
47
|
-
return (child &&
|
|
48
|
-
React.cloneElement(child, {
|
|
49
|
-
onClick: callAll(() => setOpen(false), child.props.onClick, (event) => {
|
|
50
|
-
setClosed && setClosed();
|
|
51
|
-
event?.stopPropagation();
|
|
52
|
-
event?.preventDefault();
|
|
53
|
-
}),
|
|
54
|
-
}));
|
|
55
|
-
};
|
|
56
|
-
ModalDismiss.displayName = 'Modal.Dismiss';
|
|
57
|
-
Modal.Dismiss = ModalDismiss;
|
|
58
|
-
const ModalContent = ({ backgroundDark = true, children, footer, header, setClosed, sx, ...props }) => {
|
|
59
|
-
const [open, setOpen] = React.useContext(ModalContext);
|
|
60
|
-
const handleOutsideClick = (event) => {
|
|
61
|
-
if (event.currentTarget != event.target)
|
|
62
|
-
return;
|
|
63
|
-
event.preventDefault();
|
|
64
|
-
event.stopPropagation();
|
|
65
|
-
event.preventDefault();
|
|
66
|
-
setClosed ? setClosed() : setOpen(false);
|
|
67
|
-
};
|
|
68
|
-
return (React.createElement(Wrapper, { "$backgroundDark": backgroundDark, "$open": open, onClick: handleOutsideClick },
|
|
69
|
-
React.createElement(Content, { ...props, "$sx": sx },
|
|
70
|
-
header && (React.createElement("div", { className: "header" },
|
|
71
|
-
React.createElement("div", null, header),
|
|
72
|
-
React.createElement(Modal.Dismiss, { setClosed: setClosed },
|
|
73
|
-
React.createElement(Button, { icon: React.createElement(Close, null), type: "special" })))),
|
|
74
|
-
children,
|
|
75
|
-
footer && React.createElement("div", { className: "footer" }, footer))));
|
|
76
|
-
};
|
|
77
|
-
ModalContent.displayName = 'Modal.Content';
|
|
78
|
-
Modal.Content = ModalContent;
|
|
79
|
-
export { Modal };
|
|
80
|
-
const Wrapper = styled.div `
|
|
81
|
-
${({ $open }) => $open
|
|
82
|
-
? `display: flex;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
align-items: center;
|
|
85
|
-
justify-content: center;`
|
|
86
|
-
: 'display: none;'}
|
|
87
|
-
${({ $backgroundDark }) => $backgroundDark
|
|
88
|
-
? `background: rgba(0, 0, 0, 0.5);
|
|
89
|
-
cursor: pointer;`
|
|
90
|
-
: ''}
|
|
91
|
-
position: fixed;
|
|
92
|
-
top: 0;
|
|
93
|
-
left: 0;
|
|
94
|
-
z-index: 100;
|
|
95
|
-
width: 100vw;
|
|
96
|
-
height: 100vh;
|
|
97
|
-
padding: 0px;
|
|
98
|
-
margin: 0px;
|
|
99
|
-
overflow: hidden;
|
|
100
|
-
`;
|
|
101
|
-
const Content = styled.div `
|
|
102
|
-
position: absolute;
|
|
103
|
-
z-index: 101;
|
|
104
|
-
background-color: var(--color-white);
|
|
105
|
-
box-shadow: var(--elevation-2);
|
|
106
|
-
border-radius: var(--small);
|
|
107
|
-
cursor: initial;
|
|
108
|
-
padding: 24px;
|
|
109
|
-
display: flex;
|
|
110
|
-
flex-direction: column;
|
|
111
|
-
gap: 24px;
|
|
112
|
-
|
|
113
|
-
[class~='header'] {
|
|
114
|
-
display: flex;
|
|
115
|
-
align-items: center;
|
|
116
|
-
|
|
117
|
-
div:first-child {
|
|
118
|
-
flex: 1;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
[class~='footer'] {
|
|
123
|
-
position: relative;
|
|
124
|
-
padding-top: 16px;
|
|
125
|
-
}
|
|
126
|
-
${({ $sx }) => ($sx ? $sx : '')}
|
|
127
|
-
`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Portal } from './portal';
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
|
-
export const Portal = ({ children, wrapperId = 'root-portal-wrapper', }) => {
|
|
5
|
-
const [wrapper, setWrapper] = React.useState(null);
|
|
6
|
-
React.useEffect(() => {
|
|
7
|
-
let element = document.getElementById(wrapperId);
|
|
8
|
-
let portalCreated = false;
|
|
9
|
-
if (!element) {
|
|
10
|
-
portalCreated = true;
|
|
11
|
-
element = document.createElement('div');
|
|
12
|
-
element.setAttribute('id', wrapperId);
|
|
13
|
-
document.body.appendChild(element);
|
|
14
|
-
}
|
|
15
|
-
setWrapper(element);
|
|
16
|
-
return () => {
|
|
17
|
-
if (portalCreated && element?.parentNode) {
|
|
18
|
-
element.parentNode.removeChild(element);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}, [wrapperId]);
|
|
22
|
-
if (!wrapper) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return ReactDOM.createPortal(children, wrapper);
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Post } from './post';
|