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