@soul-refiner/design-system 1.6.1-alpha.3 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/colors.d.ts +1 -1
- package/dist/common/colors.js +135 -0
- package/dist/common/date.js +28 -0
- package/dist/common/index.js +3 -0
- package/dist/common/styles.js +63 -0
- package/dist/components/actions/button/button.d.ts +1 -1
- package/dist/components/actions/button/button.js +280 -0
- package/dist/components/actions/button/index.js +1 -0
- package/dist/components/actions/dropdown/dropdown.js +227 -0
- package/dist/components/actions/dropdown/index.js +1 -0
- package/dist/components/actions/index.js +6 -0
- package/dist/components/actions/rate/index.js +1 -0
- package/dist/components/actions/rate/rate.js +46 -0
- package/dist/components/actions/switch/index.js +1 -0
- package/dist/components/actions/switch/switch.js +72 -0
- package/dist/components/actions/toggle/index.js +1 -0
- package/dist/components/actions/toggle/toggle.js +57 -0
- package/dist/components/actions/upload/index.js +1 -0
- package/dist/components/actions/upload/upload.js +156 -0
- package/dist/components/atoms/box/box.js +16 -0
- package/dist/components/atoms/box/index.js +1 -0
- package/dist/components/atoms/colors/colors.js +35 -0
- package/dist/components/atoms/colors/index.js +1 -0
- package/dist/components/atoms/hide/hide.js +9 -0
- package/dist/components/atoms/hide/index.js +1 -0
- package/dist/components/atoms/index.js +5 -0
- package/dist/components/atoms/seconds_to_duration/index.js +1 -0
- package/dist/components/atoms/seconds_to_duration/seconds_to_duration.js +27 -0
- package/dist/components/atoms/time_ago/index.js +1 -0
- package/dist/components/atoms/time_ago/time_ago.js +31 -0
- package/dist/components/atoms/typography/display.js +10 -0
- package/dist/components/atoms/typography/heading.js +35 -0
- package/dist/components/atoms/typography/index.js +4 -0
- package/dist/components/atoms/typography/paragraph.js +18 -0
- package/dist/components/atoms/typography/typography.js +12 -0
- package/dist/components/card/action/action.js +65 -0
- package/dist/components/card/action/index.js +1 -0
- package/dist/components/card/audio/audio.js +113 -0
- package/dist/components/card/audio/index.js +1 -0
- package/dist/components/card/card.js +25 -0
- package/dist/components/card/feature/feature.js +187 -0
- package/dist/components/card/feature/index.js +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/card/meeting/index.js +1 -0
- package/dist/components/card/meeting/meeting.js +130 -0
- package/dist/components/card/person/index.js +1 -0
- package/dist/components/card/person/person.js +68 -0
- package/dist/components/card/price/index.js +1 -0
- package/dist/components/card/price/price.js +75 -0
- package/dist/components/card/regular/index.js +1 -0
- package/dist/components/card/regular/regular.js +32 -0
- package/dist/components/card/video/index.js +1 -0
- package/dist/components/card/video/video.js +111 -0
- package/dist/components/card/written/index.js +1 -0
- package/dist/components/card/written/written.js +114 -0
- package/dist/components/custom/courses_selection/courses_selection.js +129 -0
- package/dist/components/custom/courses_selection/index.js +1 -0
- package/dist/components/custom/index.js +2 -0
- package/dist/components/custom/users_selection/index.js +1 -0
- package/dist/components/custom/users_selection/users_selection.js +120 -0
- package/dist/components/editor/constants.js +49 -0
- package/dist/components/editor/context.js +8 -0
- package/dist/components/editor/editor.js +102 -0
- package/dist/components/editor/icons/border-all.js +3 -0
- package/dist/components/editor/icons/border-bottom.js +3 -0
- package/dist/components/editor/icons/border-left.js +3 -0
- package/dist/components/editor/icons/border-none.js +3 -0
- package/dist/components/editor/icons/border-right.js +3 -0
- package/dist/components/editor/icons/border-top.js +3 -0
- package/dist/components/editor/icons/index.js +6 -0
- package/dist/components/editor/index.js +2 -0
- package/dist/components/editor/navbar/alignment_dropdown.js +97 -0
- package/dist/components/editor/navbar/button_modal.js +55 -0
- package/dist/components/editor/navbar/index.js +1 -0
- package/dist/components/editor/navbar/navbar.js +201 -0
- package/dist/components/editor/navbar/style_dropdown.js +65 -0
- package/dist/components/editor/plugins/blocks/blockquote.js +8 -0
- package/dist/components/editor/plugins/blocks/blocks.d.ts +1 -1
- package/dist/components/editor/plugins/blocks/blocks.js +50 -0
- package/dist/components/editor/plugins/blocks/buttons.js +81 -0
- package/dist/components/editor/plugins/blocks/dropdown-menu.js +62 -0
- package/dist/components/editor/plugins/blocks/image.js +36 -0
- package/dist/components/editor/plugins/blocks/index.js +1 -0
- package/dist/components/editor/plugins/blocks/list.js +17 -0
- package/dist/components/editor/plugins/blocks/media-popover.js +32 -0
- package/dist/components/editor/plugins/blocks/plate-button.d.ts +2 -2
- package/dist/components/editor/plugins/blocks/plate-button.js +37 -0
- package/dist/components/editor/plugins/blocks/popover.js +11 -0
- package/dist/components/editor/plugins/blocks/qa.js +45 -0
- package/dist/components/editor/plugins/blocks/resizable.d.ts +2 -2
- package/dist/components/editor/plugins/blocks/resizable.js +37 -0
- package/dist/components/editor/plugins/blocks/separator.js +19 -0
- package/dist/components/editor/plugins/blocks/table-cell.js +38 -0
- package/dist/components/editor/plugins/blocks/table-row.js +7 -0
- package/dist/components/editor/plugins/blocks/table.js +82 -0
- package/dist/components/editor/plugins/blocks/text.js +82 -0
- package/dist/components/editor/plugins/blocks/video.js +32 -0
- package/dist/components/editor/plugins/index.js +4 -0
- package/dist/components/editor/plugins/leafs/index.js +1 -0
- package/dist/components/editor/plugins/leafs/leafs.js +33 -0
- package/dist/components/editor/plugins/leafs/link.js +74 -0
- package/dist/components/editor/plugins/marks/index.js +1 -0
- package/dist/components/editor/plugins/marks/marks.js +12 -0
- package/dist/components/editor/plugins/plate.js +37 -0
- package/dist/components/editor/plugins/utils/exitBreak.js +31 -0
- package/dist/components/editor/plugins/utils/index.js +1 -0
- package/dist/components/editor/plugins/utils/resetBlockType.js +22 -0
- package/dist/components/editor/plugins/utils/selectOnBackspace.js +6 -0
- package/dist/components/editor/plugins/utils/softBreak.js +14 -0
- package/dist/components/editor/plugins/utils/utils.js +12 -0
- package/dist/components/editor/simple_editor/index.js +1 -0
- package/dist/components/editor/simple_editor/navbar.js +136 -0
- package/dist/components/editor/simple_editor/plugins.js +89 -0
- package/dist/components/editor/simple_editor/simple_editor.js +89 -0
- package/dist/components/feedback/animated_toast/animated_toast.js +55 -0
- package/dist/components/feedback/animated_toast/index.js +1 -0
- package/dist/components/feedback/badge/badge.js +66 -0
- package/dist/components/feedback/badge/index.js +1 -0
- package/dist/components/feedback/banner/banner.js +80 -0
- package/dist/components/feedback/banner/index.js +1 -0
- package/dist/components/feedback/chip/chip.js +94 -0
- package/dist/components/feedback/chip/index.js +1 -0
- package/dist/components/feedback/index.js +8 -0
- package/dist/components/feedback/loader/index.js +1 -0
- package/dist/components/feedback/loader/loader.js +34 -0
- package/dist/components/feedback/notification/index.js +1 -0
- package/dist/components/feedback/notification/notification.js +72 -0
- package/dist/components/feedback/progress/index.js +1 -0
- package/dist/components/feedback/progress/progress.js +87 -0
- package/dist/components/feedback/toast/index.js +1 -0
- package/dist/components/feedback/toast/toast.js +112 -0
- package/dist/components/feedback/tooltip/index.js +1 -0
- package/dist/components/feedback/tooltip/tooltip.js +26 -0
- package/dist/components/iconography/avatar/avatar.d.ts +1 -2
- package/dist/components/iconography/avatar/avatar.js +169 -0
- package/dist/components/iconography/avatar/icons/approved.js +5 -0
- package/dist/components/iconography/avatar/icons/busy.js +5 -0
- package/dist/components/iconography/avatar/icons/declined.js +5 -0
- package/dist/components/iconography/avatar/icons/default.js +4 -0
- package/dist/components/iconography/avatar/icons/focus.js +5 -0
- package/dist/components/iconography/avatar/icons/index.js +9 -0
- package/dist/components/iconography/avatar/icons/locked.js +5 -0
- package/dist/components/iconography/avatar/icons/offline.js +5 -0
- package/dist/components/iconography/avatar/icons/online.js +4 -0
- package/dist/components/iconography/avatar/icons/subscribed.js +9 -0
- package/dist/components/iconography/avatar/index.js +1 -0
- package/dist/components/iconography/icon/icon.js +10 -0
- package/dist/components/iconography/icon/index.js +1 -0
- package/dist/components/iconography/index.js +2 -0
- package/dist/components/index.js +12 -0
- package/dist/components/input/calendar/calendar.js +249 -0
- package/dist/components/input/calendar/index.js +1 -0
- package/dist/components/input/checkbox/checkbox.js +23 -0
- package/dist/components/input/checkbox/index.js +1 -0
- package/dist/components/input/date/date.js +517 -0
- package/dist/components/input/date/index.js +1 -0
- package/dist/components/input/filter/filter.js +304 -0
- package/dist/components/input/filter/filter_option.js +70 -0
- package/dist/components/input/filter/index.js +1 -0
- package/dist/components/input/index.js +10 -0
- package/dist/components/input/radio/index.js +1 -0
- package/dist/components/input/radio/radio.js +78 -0
- package/dist/components/input/search/index.js +1 -0
- package/dist/components/input/search/search.js +138 -0
- package/dist/components/input/select/index.js +1 -0
- package/dist/components/input/select/select.js +47 -0
- package/dist/components/input/text_area/index.js +1 -0
- package/dist/components/input/text_area/text_area.js +110 -0
- package/dist/components/input/text_input/index.js +1 -0
- package/dist/components/input/text_input/text_input.d.ts +0 -1
- package/dist/components/input/text_input/text_input.js +147 -0
- package/dist/components/input/time/index.js +1 -0
- package/dist/components/input/time/time.js +69 -0
- package/dist/components/media/common.js +1 -0
- package/dist/components/media/index.js +2 -0
- package/dist/components/media/video/index.js +1 -0
- package/dist/components/media/video/video.js +31 -0
- package/dist/components/media/video-player/index.js +1 -0
- package/dist/components/media/video-player/playlist-item.d.ts +2 -2
- package/dist/components/media/video-player/playlist-item.js +37 -0
- package/dist/components/media/video-player/video.d.ts +3 -13
- package/dist/components/media/video-player/video.js +178 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.js +109 -0
- package/dist/components/navigation/breadcrumb/index.js +1 -0
- package/dist/components/navigation/index.js +3 -0
- package/dist/components/navigation/inner/index.js +1 -0
- package/dist/components/navigation/inner/inner.js +185 -0
- package/dist/components/navigation/tabs/index.js +1 -0
- package/dist/components/navigation/tabs/tabs.js +150 -0
- package/dist/components/surfaces/accordion/accordion.js +47 -0
- package/dist/components/surfaces/accordion/index.js +1 -0
- package/dist/components/surfaces/calendar_date/calendar_date.js +45 -0
- package/dist/components/surfaces/calendar_date/index.js +1 -0
- package/dist/components/surfaces/carousel/card/card.js +96 -0
- package/dist/components/surfaces/carousel/card/index.js +1 -0
- package/dist/components/surfaces/carousel/index.js +1 -0
- package/dist/components/surfaces/comment/comment.js +188 -0
- package/dist/components/surfaces/comment/helpers.js +26 -0
- package/dist/components/surfaces/comment/index.js +1 -0
- package/dist/components/surfaces/drawer/drawer.js +130 -0
- package/dist/components/surfaces/drawer/index.js +1 -0
- package/dist/components/surfaces/index.js +9 -0
- package/dist/components/surfaces/message/index.js +1 -0
- package/dist/components/surfaces/message/message.js +44 -0
- package/dist/components/surfaces/modal/index.js +1 -0
- package/dist/components/surfaces/modal/modal.js +127 -0
- package/dist/components/surfaces/portal/index.js +1 -0
- package/dist/components/surfaces/portal/portal.js +26 -0
- package/dist/components/surfaces/post/index.js +1 -0
- package/dist/components/surfaces/post/post.js +129 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/table/index.js +1 -0
- package/dist/components/table/table/table.js +184 -0
- package/dist/emoji/emojis.json +17577 -0
- package/dist/icons/arrow/arrow_all.js +6 -0
- package/dist/icons/arrow/arrow_all_diagonal.js +6 -0
- package/dist/icons/arrow/arrow_both_downwards.js +6 -0
- package/dist/icons/arrow/arrow_both_upwards.js +6 -0
- package/dist/icons/arrow/arrow_circle_left.js +6 -0
- package/dist/icons/arrow/arrow_circle_left_double.js +6 -0
- package/dist/icons/arrow/arrow_circle_left_double_alert.js +8 -0
- package/dist/icons/arrow/arrow_circle_right.js +6 -0
- package/dist/icons/arrow/arrow_circle_right_double.js +6 -0
- package/dist/icons/arrow/arrow_circle_right_double_alert.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_down_left.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_down_left_circle.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_down_right.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_down_right_circle.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_up_left.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_up_left_circle.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_up_right.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_up_right_circle.js +6 -0
- package/dist/icons/arrow/arrow_down.js +6 -0
- package/dist/icons/arrow/arrow_down_bold.js +6 -0
- package/dist/icons/arrow/arrow_down_circle.js +6 -0
- package/dist/icons/arrow/arrow_left.js +6 -0
- package/dist/icons/arrow/arrow_left_bold.js +6 -0
- package/dist/icons/arrow/arrow_left_circle.js +6 -0
- package/dist/icons/arrow/arrow_left_curved.js +6 -0
- package/dist/icons/arrow/arrow_left_curved_circle.js +6 -0
- package/dist/icons/arrow/arrow_right.js +6 -0
- package/dist/icons/arrow/arrow_right_bold.js +6 -0
- package/dist/icons/arrow/arrow_right_circle.js +6 -0
- package/dist/icons/arrow/arrow_right_curved.js +6 -0
- package/dist/icons/arrow/arrow_right_curved_circle.js +6 -0
- package/dist/icons/arrow/arrow_up.js +6 -0
- package/dist/icons/arrow/arrow_up_bold.js +6 -0
- package/dist/icons/arrow/arrow_up_circle.js +6 -0
- package/dist/icons/arrow/chevron_down.js +6 -0
- package/dist/icons/arrow/chevron_down_circle.js +6 -0
- package/dist/icons/arrow/chevron_down_double.js +6 -0
- package/dist/icons/arrow/chevron_down_double_circle.js +6 -0
- package/dist/icons/arrow/chevron_left.js +6 -0
- package/dist/icons/arrow/chevron_left_circle.js +6 -0
- package/dist/icons/arrow/chevron_left_double.js +6 -0
- package/dist/icons/arrow/chevron_left_double_circle.js +6 -0
- package/dist/icons/arrow/chevron_right.js +6 -0
- package/dist/icons/arrow/chevron_right_circle.js +6 -0
- package/dist/icons/arrow/chevron_right_double.js +6 -0
- package/dist/icons/arrow/chevron_right_double_circle.js +6 -0
- package/dist/icons/arrow/chevron_scroll.js +6 -0
- package/dist/icons/arrow/chevron_up.js +6 -0
- package/dist/icons/arrow/chevron_up_circle.js +6 -0
- package/dist/icons/arrow/chevron_up_double.js +6 -0
- package/dist/icons/arrow/chevron_up_double_circle.js +6 -0
- package/dist/icons/arrow/forward_all.js +6 -0
- package/dist/icons/arrow/forward_all_bold.js +6 -0
- package/dist/icons/arrow/forward_bold.js +6 -0
- package/dist/icons/arrow/index.js +62 -0
- package/dist/icons/arrow/redo.js +6 -0
- package/dist/icons/arrow/redo_bold.js +6 -0
- package/dist/icons/arrow/reply.js +6 -0
- package/dist/icons/arrow/reply_all.js +6 -0
- package/dist/icons/arrow/reply_all_bold.js +6 -0
- package/dist/icons/arrow/reply_bold.js +6 -0
- package/dist/icons/arrow/undo.js +6 -0
- package/dist/icons/arrow/undo_bold.js +6 -0
- package/dist/icons/audio_video/drag_indicator.js +6 -0
- package/dist/icons/audio_video/eject.js +6 -0
- package/dist/icons/audio_video/equalizer.js +6 -0
- package/dist/icons/audio_video/fast_forward.js +6 -0
- package/dist/icons/audio_video/fast_forward_30.js +6 -0
- package/dist/icons/audio_video/fullscreen.js +6 -0
- package/dist/icons/audio_video/headphones.js +6 -0
- package/dist/icons/audio_video/index.js +38 -0
- package/dist/icons/audio_video/library_add.js +6 -0
- package/dist/icons/audio_video/library_delay.js +6 -0
- package/dist/icons/audio_video/library_music.js +6 -0
- package/dist/icons/audio_video/library_queue.js +6 -0
- package/dist/icons/audio_video/microphone.js +6 -0
- package/dist/icons/audio_video/musical_note.js +6 -0
- package/dist/icons/audio_video/next.js +6 -0
- package/dist/icons/audio_video/pause.js +6 -0
- package/dist/icons/audio_video/pause_circle.js +6 -0
- package/dist/icons/audio_video/play.js +6 -0
- package/dist/icons/audio_video/play_circle.js +6 -0
- package/dist/icons/audio_video/play_display.js +6 -0
- package/dist/icons/audio_video/play_pause.js +6 -0
- package/dist/icons/audio_video/play_solid.js +6 -0
- package/dist/icons/audio_video/player_list.js +6 -0
- package/dist/icons/audio_video/player_list_add.js +6 -0
- package/dist/icons/audio_video/player_list_play.js +6 -0
- package/dist/icons/audio_video/previous.js +6 -0
- package/dist/icons/audio_video/radio.js +6 -0
- package/dist/icons/audio_video/record.js +6 -0
- package/dist/icons/audio_video/repeat.js +6 -0
- package/dist/icons/audio_video/rewind.js +6 -0
- package/dist/icons/audio_video/rewind_30.js +6 -0
- package/dist/icons/audio_video/shuffle.js +6 -0
- package/dist/icons/audio_video/sound_wave.js +6 -0
- package/dist/icons/audio_video/stop.js +6 -0
- package/dist/icons/audio_video/stop_circle.js +6 -0
- package/dist/icons/audio_video/subscriptions.js +6 -0
- package/dist/icons/audio_video/tuner.js +6 -0
- package/dist/icons/audio_video/volume.js +6 -0
- package/dist/icons/audio_video/volume_high.js +6 -0
- package/dist/icons/audio_video/volume_low.js +6 -0
- package/dist/icons/audio_video/volume_slash.js +6 -0
- package/dist/icons/basic/aa_sansserif.js +7 -0
- package/dist/icons/basic/aa_serif.js +7 -0
- package/dist/icons/basic/anchor.js +8 -0
- package/dist/icons/basic/bible.js +6 -0
- package/dist/icons/basic/bold.js +6 -0
- package/dist/icons/basic/book.js +6 -0
- package/dist/icons/basic/book_open.js +6 -0
- package/dist/icons/basic/bookmark.js +6 -0
- package/dist/icons/basic/bookmark_add.js +6 -0
- package/dist/icons/basic/bookmark_slash.js +6 -0
- package/dist/icons/basic/bookmarks.js +6 -0
- package/dist/icons/basic/books.js +9 -0
- package/dist/icons/basic/box.js +6 -0
- package/dist/icons/basic/briefcase.js +6 -0
- package/dist/icons/basic/browse_activity.js +6 -0
- package/dist/icons/basic/browser.js +6 -0
- package/dist/icons/basic/browser_slash.js +6 -0
- package/dist/icons/basic/calculator.js +6 -0
- package/dist/icons/basic/camera.js +6 -0
- package/dist/icons/basic/camera_add.js +6 -0
- package/dist/icons/basic/camera_slash.js +6 -0
- package/dist/icons/basic/checkmark.js +6 -0
- package/dist/icons/basic/checkmark_circle.js +8 -0
- package/dist/icons/basic/checkmark_filled.js +6 -0
- package/dist/icons/basic/checkmarks.js +6 -0
- package/dist/icons/basic/circle.js +6 -0
- package/dist/icons/basic/circle_slash.js +8 -0
- package/dist/icons/basic/clear_text_style.js +6 -0
- package/dist/icons/basic/close.js +6 -0
- package/dist/icons/basic/close_circle.js +6 -0
- package/dist/icons/basic/close_filled.js +6 -0
- package/dist/icons/basic/copy.js +6 -0
- package/dist/icons/basic/delete.js +6 -0
- package/dist/icons/basic/detail.js +6 -0
- package/dist/icons/basic/dot.js +6 -0
- package/dist/icons/basic/download.js +6 -0
- package/dist/icons/basic/download_arrow.js +6 -0
- package/dist/icons/basic/droplet.js +8 -0
- package/dist/icons/basic/ellipsis_horizontal.js +6 -0
- package/dist/icons/basic/ellipsis_horizontal_circle.js +6 -0
- package/dist/icons/basic/ellipsis_vertical.js +6 -0
- package/dist/icons/basic/ellipsis_vertical_circle.js +6 -0
- package/dist/icons/basic/eye.js +6 -0
- package/dist/icons/basic/eye_slash.js +6 -0
- package/dist/icons/basic/fingerprint.js +6 -0
- package/dist/icons/basic/flag.js +6 -0
- package/dist/icons/basic/flag_wave.js +6 -0
- package/dist/icons/basic/flag_wave_filled.js +6 -0
- package/dist/icons/basic/flame.js +6 -0
- package/dist/icons/basic/gauge.js +6 -0
- package/dist/icons/basic/glasses.js +6 -0
- package/dist/icons/basic/graduation_cap.js +6 -0
- package/dist/icons/basic/hashmark.js +6 -0
- package/dist/icons/basic/heart.js +6 -0
- package/dist/icons/basic/heart_slash.js +6 -0
- package/dist/icons/basic/highlighter.js +6 -0
- package/dist/icons/basic/home.js +6 -0
- package/dist/icons/basic/image.js +6 -0
- package/dist/icons/basic/inbox.js +6 -0
- package/dist/icons/basic/index.js +131 -0
- package/dist/icons/basic/italic.js +6 -0
- package/dist/icons/basic/layers.js +6 -0
- package/dist/icons/basic/lightening.js +6 -0
- package/dist/icons/basic/lightening_slash.js +6 -0
- package/dist/icons/basic/link.js +6 -0
- package/dist/icons/basic/link_slash.js +6 -0
- package/dist/icons/basic/loudspeaker.js +6 -0
- package/dist/icons/basic/maximize.js +6 -0
- package/dist/icons/basic/menu.js +6 -0
- package/dist/icons/basic/menu_circle.js +6 -0
- package/dist/icons/basic/menu_dots.js +6 -0
- package/dist/icons/basic/microphone_slash.js +6 -0
- package/dist/icons/basic/minimize.js +6 -0
- package/dist/icons/basic/minus.js +6 -0
- package/dist/icons/basic/minus_circle.js +6 -0
- package/dist/icons/basic/move_item.js +6 -0
- package/dist/icons/basic/new.js +6 -0
- package/dist/icons/basic/newspaper.js +6 -0
- package/dist/icons/basic/node.js +6 -0
- package/dist/icons/basic/note_pad.js +7 -0
- package/dist/icons/basic/options.js +6 -0
- package/dist/icons/basic/paint_brush.js +6 -0
- package/dist/icons/basic/paperclip.js +6 -0
- package/dist/icons/basic/paperclip_slash.js +6 -0
- package/dist/icons/basic/pencil.js +6 -0
- package/dist/icons/basic/pencil_pad.js +6 -0
- package/dist/icons/basic/plus.js +6 -0
- package/dist/icons/basic/plus_circle.js +6 -0
- package/dist/icons/basic/presentation.js +6 -0
- package/dist/icons/basic/printer.js +6 -0
- package/dist/icons/basic/profile.js +6 -0
- package/dist/icons/basic/profile_check.js +6 -0
- package/dist/icons/basic/pulse.js +6 -0
- package/dist/icons/basic/qr_code.js +6 -0
- package/dist/icons/basic/resize.js +8 -0
- package/dist/icons/basic/scan.js +6 -0
- package/dist/icons/basic/scissors.js +6 -0
- package/dist/icons/basic/screenshot.js +6 -0
- package/dist/icons/basic/search.js +6 -0
- package/dist/icons/basic/select_item.js +7 -0
- package/dist/icons/basic/settings.js +6 -0
- package/dist/icons/basic/share.js +6 -0
- package/dist/icons/basic/share_external.js +6 -0
- package/dist/icons/basic/square.js +6 -0
- package/dist/icons/basic/star.js +6 -0
- package/dist/icons/basic/star_circle.js +6 -0
- package/dist/icons/basic/star_filled.js +6 -0
- package/dist/icons/basic/star_filled_half.js +6 -0
- package/dist/icons/basic/star_slash.js +6 -0
- package/dist/icons/basic/sticker.js +6 -0
- package/dist/icons/basic/strikethrough.js +6 -0
- package/dist/icons/basic/subtask.js +7 -0
- package/dist/icons/basic/tax.js +9 -0
- package/dist/icons/basic/text_bg_color.js +6 -0
- package/dist/icons/basic/text_color.js +6 -0
- package/dist/icons/basic/textbox.js +6 -0
- package/dist/icons/basic/thumbs_down.js +6 -0
- package/dist/icons/basic/thumbs_up.js +6 -0
- package/dist/icons/basic/thumbs_up_filled.js +6 -0
- package/dist/icons/basic/toggle_left.js +6 -0
- package/dist/icons/basic/toggle_right.js +6 -0
- package/dist/icons/basic/translate.js +6 -0
- package/dist/icons/basic/trash.js +6 -0
- package/dist/icons/basic/trash_slash.js +6 -0
- package/dist/icons/basic/underline.js +6 -0
- package/dist/icons/basic/upload.js +6 -0
- package/dist/icons/basic/video.js +6 -0
- package/dist/icons/basic/video_add.js +7 -0
- package/dist/icons/basic/video_slash.js +6 -0
- package/dist/icons/basic/wrench.js +6 -0
- package/dist/icons/basic/zoom_in.js +6 -0
- package/dist/icons/basic/zoom_out.js +6 -0
- package/dist/icons/data/bar_chart.js +6 -0
- package/dist/icons/data/bar_chart_downward.js +6 -0
- package/dist/icons/data/bar_chart_downward_outline.js +6 -0
- package/dist/icons/data/bar_chart_upward.js +6 -0
- package/dist/icons/data/bar_chart_upward_outline.js +6 -0
- package/dist/icons/data/candlestick_chart.js +6 -0
- package/dist/icons/data/four_circles.js +6 -0
- package/dist/icons/data/index.js +20 -0
- package/dist/icons/data/legend_toggle.js +6 -0
- package/dist/icons/data/line_chart.js +6 -0
- package/dist/icons/data/line_chart_area.js +6 -0
- package/dist/icons/data/line_chart_area_shaded.js +6 -0
- package/dist/icons/data/line_chart_double.js +6 -0
- package/dist/icons/data/line_chart_downward.js +6 -0
- package/dist/icons/data/line_chart_node.js +6 -0
- package/dist/icons/data/line_chart_outline.js +6 -0
- package/dist/icons/data/line_chart_search.js +6 -0
- package/dist/icons/data/line_chart_stars.js +6 -0
- package/dist/icons/data/line_chart_upward.js +6 -0
- package/dist/icons/data/pie_chart.js +7 -0
- package/dist/icons/data/tree.js +6 -0
- package/dist/icons/email/index.js +8 -0
- package/dist/icons/email/mail.js +6 -0
- package/dist/icons/email/mail_check.js +6 -0
- package/dist/icons/email/mail_minus.js +6 -0
- package/dist/icons/email/mail_send.js +6 -0
- package/dist/icons/email/send.js +6 -0
- package/dist/icons/email/send_close.js +6 -0
- package/dist/icons/email/send_schedule.js +6 -0
- package/dist/icons/email/send_text.js +6 -0
- package/dist/icons/emoji/emoji_add.js +6 -0
- package/dist/icons/emoji/index.js +6 -0
- package/dist/icons/emoji/laughing.js +6 -0
- package/dist/icons/emoji/neutral.js +6 -0
- package/dist/icons/emoji/sad.js +6 -0
- package/dist/icons/emoji/shocked.js +6 -0
- package/dist/icons/emoji/smile.js +6 -0
- package/dist/icons/file/clipboard.js +6 -0
- package/dist/icons/file/clipboard_check.js +6 -0
- package/dist/icons/file/clipboard_close.js +6 -0
- package/dist/icons/file/clipboard_minus.js +6 -0
- package/dist/icons/file/clipboard_plus.js +6 -0
- package/dist/icons/file/clipboard_text.js +6 -0
- package/dist/icons/file/file.js +6 -0
- package/dist/icons/file/file_add.js +6 -0
- package/dist/icons/file/file_check.js +6 -0
- package/dist/icons/file/file_close.js +6 -0
- package/dist/icons/file/file_code.js +6 -0
- package/dist/icons/file/file_download.js +6 -0
- package/dist/icons/file/file_draft.js +6 -0
- package/dist/icons/file/file_gear.js +7 -0
- package/dist/icons/file/file_minus.js +6 -0
- package/dist/icons/file/file_plus.js +6 -0
- package/dist/icons/file/file_scan.js +6 -0
- package/dist/icons/file/file_shred.js +6 -0
- package/dist/icons/file/file_text.js +6 -0
- package/dist/icons/file/file_upload.js +6 -0
- package/dist/icons/file/folder.js +6 -0
- package/dist/icons/file/folder_add.js +6 -0
- package/dist/icons/file/folder_arrow.js +6 -0
- package/dist/icons/file/folder_check.js +6 -0
- package/dist/icons/file/folder_close.js +6 -0
- package/dist/icons/file/folder_cloud.js +6 -0
- package/dist/icons/file/folder_gear.js +7 -0
- package/dist/icons/file/folder_minus.js +6 -0
- package/dist/icons/file/folder_music.js +6 -0
- package/dist/icons/file/folder_open.js +6 -0
- package/dist/icons/file/folder_plus.js +6 -0
- package/dist/icons/file/folder_zip.js +6 -0
- package/dist/icons/file/index.js +36 -0
- package/dist/icons/file/note.js +6 -0
- package/dist/icons/file/note_text.js +6 -0
- package/dist/icons/file/pdf.js +6 -0
- package/dist/icons/file/photo.js +6 -0
- package/dist/icons/finance/bitcoin.js +6 -0
- package/dist/icons/finance/coins.js +10 -0
- package/dist/icons/finance/credit_card.js +6 -0
- package/dist/icons/finance/credit_card_add.js +6 -0
- package/dist/icons/finance/credit_card_face.js +6 -0
- package/dist/icons/finance/credit_card_member.js +6 -0
- package/dist/icons/finance/credit_card_outcome.js +6 -0
- package/dist/icons/finance/credit_card_scan.js +6 -0
- package/dist/icons/finance/credit_card_share.js +6 -0
- package/dist/icons/finance/credit_card_slash.js +6 -0
- package/dist/icons/finance/currency_exchange.js +6 -0
- package/dist/icons/finance/dollar.js +6 -0
- package/dist/icons/finance/ethereum.js +6 -0
- package/dist/icons/finance/index.js +16 -0
- package/dist/icons/finance/paypass.js +6 -0
- package/dist/icons/finance/strongbox.js +6 -0
- package/dist/icons/finance/wallet.js +6 -0
- package/dist/icons/index.js +22 -0
- package/dist/icons/layout/block_align_bottom.js +6 -0
- package/dist/icons/layout/block_align_center.js +6 -0
- package/dist/icons/layout/block_align_left.js +6 -0
- package/dist/icons/layout/block_align_middle.js +6 -0
- package/dist/icons/layout/block_align_right.js +6 -0
- package/dist/icons/layout/block_align_top.js +6 -0
- package/dist/icons/layout/block_horizontal.js +6 -0
- package/dist/icons/layout/block_vertical.js +6 -0
- package/dist/icons/layout/edit_shape.js +6 -0
- package/dist/icons/layout/elements.js +6 -0
- package/dist/icons/layout/elements_add.js +6 -0
- package/dist/icons/layout/elements_filled.js +6 -0
- package/dist/icons/layout/elements_masonry.js +6 -0
- package/dist/icons/layout/frame.js +6 -0
- package/dist/icons/layout/frame_stack.js +6 -0
- package/dist/icons/layout/grid.js +6 -0
- package/dist/icons/layout/grid_column_three.js +6 -0
- package/dist/icons/layout/grid_column_two.js +6 -0
- package/dist/icons/layout/grid_dynamic.js +6 -0
- package/dist/icons/layout/grid_frame.js +6 -0
- package/dist/icons/layout/grid_row_three.js +6 -0
- package/dist/icons/layout/grid_row_two.js +6 -0
- package/dist/icons/layout/grid_six.js +6 -0
- package/dist/icons/layout/grid_small.js +6 -0
- package/dist/icons/layout/iframe.js +6 -0
- package/dist/icons/layout/index.js +44 -0
- package/dist/icons/layout/kanban.js +6 -0
- package/dist/icons/layout/layout.js +6 -0
- package/dist/icons/layout/list.js +6 -0
- package/dist/icons/layout/list_filled.js +11 -0
- package/dist/icons/layout/padding.js +6 -0
- package/dist/icons/layout/page_break.js +6 -0
- package/dist/icons/layout/rotate_left.js +6 -0
- package/dist/icons/layout/rotate_right.js +6 -0
- package/dist/icons/layout/ruler.js +6 -0
- package/dist/icons/layout/segment.js +6 -0
- package/dist/icons/layout/select_area.js +6 -0
- package/dist/icons/layout/select_boundary.js +6 -0
- package/dist/icons/layout/sidebar_left.js +6 -0
- package/dist/icons/layout/sidebar_right.js +6 -0
- package/dist/icons/layout/slides.js +6 -0
- package/dist/icons/layout/slides_horizontal.js +6 -0
- package/dist/icons/layout/slides_vertical.js +11 -0
- package/dist/icons/layout/stack.js +6 -0
- package/dist/icons/layout/text.js +6 -0
- package/dist/icons/maps/atlas.js +6 -0
- package/dist/icons/maps/compass.js +6 -0
- package/dist/icons/maps/direction.js +6 -0
- package/dist/icons/maps/direction_angled.js +6 -0
- package/dist/icons/maps/globe.js +6 -0
- package/dist/icons/maps/globe_slash.js +6 -0
- package/dist/icons/maps/index.js +22 -0
- package/dist/icons/maps/location.js +6 -0
- package/dist/icons/maps/location_slash.js +6 -0
- package/dist/icons/maps/map.js +6 -0
- package/dist/icons/maps/marker.js +6 -0
- package/dist/icons/maps/panorama.js +6 -0
- package/dist/icons/maps/pin.js +6 -0
- package/dist/icons/maps/pin_arrow.js +6 -0
- package/dist/icons/maps/pin_location.js +6 -0
- package/dist/icons/maps/pin_plus.js +6 -0
- package/dist/icons/maps/pin_question.js +6 -0
- package/dist/icons/maps/pin_slash.js +6 -0
- package/dist/icons/maps/push_pin.js +6 -0
- package/dist/icons/maps/push_pin_filled.js +6 -0
- package/dist/icons/maps/push_pin_slash.js +6 -0
- package/dist/icons/maps/radar.js +6 -0
- package/dist/icons/maps/route.js +6 -0
- package/dist/icons/message/bubble.js +6 -0
- package/dist/icons/message/bubble_question.js +6 -0
- package/dist/icons/message/comment.js +6 -0
- package/dist/icons/message/comment_add.js +6 -0
- package/dist/icons/message/comment_check.js +6 -0
- package/dist/icons/message/comment_close.js +6 -0
- package/dist/icons/message/comment_minus.js +6 -0
- package/dist/icons/message/comment_text.js +6 -0
- package/dist/icons/message/index.js +8 -0
- package/dist/icons/misc/advertisement.js +6 -0
- package/dist/icons/misc/atom.js +6 -0
- package/dist/icons/misc/bone.js +6 -0
- package/dist/icons/misc/brightness_high.js +6 -0
- package/dist/icons/misc/brightness_low.js +6 -0
- package/dist/icons/misc/contrast.js +6 -0
- package/dist/icons/misc/crosshairs.js +6 -0
- package/dist/icons/misc/crown.js +6 -0
- package/dist/icons/misc/footprint.js +6 -0
- package/dist/icons/misc/form.js +6 -0
- package/dist/icons/misc/funnel.js +6 -0
- package/dist/icons/misc/index.js +25 -0
- package/dist/icons/misc/infinite.js +6 -0
- package/dist/icons/misc/insert_button.js +6 -0
- package/dist/icons/misc/light_bulb.js +6 -0
- package/dist/icons/misc/moon.js +6 -0
- package/dist/icons/misc/nut.js +6 -0
- package/dist/icons/misc/planet.js +6 -0
- package/dist/icons/misc/plus_thick.js +6 -0
- package/dist/icons/misc/pocket.js +6 -0
- package/dist/icons/misc/rocket.js +6 -0
- package/dist/icons/misc/soup.js +10 -0
- package/dist/icons/misc/sun.js +6 -0
- package/dist/icons/misc/toy_horse.js +6 -0
- package/dist/icons/misc/trophy.js +6 -0
- package/dist/icons/misc/watercloset.js +6 -0
- package/dist/icons/notifications/alert_circle.js +6 -0
- package/dist/icons/notifications/alert_octogon.js +6 -0
- package/dist/icons/notifications/alert_triangle.js +6 -0
- package/dist/icons/notifications/app_notification.js +6 -0
- package/dist/icons/notifications/bell.js +6 -0
- package/dist/icons/notifications/bell_alert.js +6 -0
- package/dist/icons/notifications/bell_checkmark.js +6 -0
- package/dist/icons/notifications/bell_minus.js +6 -0
- package/dist/icons/notifications/bell_plus.js +6 -0
- package/dist/icons/notifications/bell_ring.js +8 -0
- package/dist/icons/notifications/bell_slash.js +6 -0
- package/dist/icons/notifications/close_octogon.js +6 -0
- package/dist/icons/notifications/index.js +14 -0
- package/dist/icons/notifications/information.js +6 -0
- package/dist/icons/notifications/minus_octogon.js +6 -0
- package/dist/icons/notifications/question_circle.js +6 -0
- package/dist/icons/people/group.js +6 -0
- package/dist/icons/people/group_add.js +6 -0
- package/dist/icons/people/group_chat.js +8 -0
- package/dist/icons/people/group_remove.js +6 -0
- package/dist/icons/people/group_send.js +7 -0
- package/dist/icons/people/groups.js +6 -0
- package/dist/icons/people/index.js +13 -0
- package/dist/icons/people/person.js +6 -0
- package/dist/icons/people/person_add.js +6 -0
- package/dist/icons/people/person_checkmark.js +6 -0
- package/dist/icons/people/person_circle.js +8 -0
- package/dist/icons/people/person_close.js +8 -0
- package/dist/icons/people/person_remove.js +6 -0
- package/dist/icons/people/person_slash.js +8 -0
- package/dist/icons/phone/index.js +14 -0
- package/dist/icons/phone/keypad.js +6 -0
- package/dist/icons/phone/phone.js +6 -0
- package/dist/icons/phone/phone_add.js +6 -0
- package/dist/icons/phone/phone_calling.js +6 -0
- package/dist/icons/phone/phone_check.js +6 -0
- package/dist/icons/phone/phone_close.js +6 -0
- package/dist/icons/phone/phone_decline.js +6 -0
- package/dist/icons/phone/phone_end.js +6 -0
- package/dist/icons/phone/phone_forwarded.js +6 -0
- package/dist/icons/phone/phone_hash.js +6 -0
- package/dist/icons/phone/phone_incoming.js +6 -0
- package/dist/icons/phone/phone_missed.js +6 -0
- package/dist/icons/phone/phone_outgoing.js +6 -0
- package/dist/icons/phone/phone_pause.js +6 -0
- package/dist/icons/phone/phone_slash.js +6 -0
- package/dist/icons/phone/voicemail.js +6 -0
- package/dist/icons/security/index.js +11 -0
- package/dist/icons/security/key.js +6 -0
- package/dist/icons/security/key_slash.js +6 -0
- package/dist/icons/security/lock.js +6 -0
- package/dist/icons/security/lock_circle.js +6 -0
- package/dist/icons/security/lock_open.js +6 -0
- package/dist/icons/security/lock_slash.js +6 -0
- package/dist/icons/security/shield.js +6 -0
- package/dist/icons/security/shield_checkmark.js +6 -0
- package/dist/icons/security/shield_lock.js +6 -0
- package/dist/icons/security/shield_slash.js +6 -0
- package/dist/icons/security/verified.js +6 -0
- package/dist/icons/shopping/basket.js +6 -0
- package/dist/icons/shopping/cart.js +6 -0
- package/dist/icons/shopping/cart_filled.js +6 -0
- package/dist/icons/shopping/coupon.js +6 -0
- package/dist/icons/shopping/coupon_cut.js +6 -0
- package/dist/icons/shopping/delivery.js +6 -0
- package/dist/icons/shopping/discount.js +6 -0
- package/dist/icons/shopping/gift.js +6 -0
- package/dist/icons/shopping/gift_bag.js +6 -0
- package/dist/icons/shopping/index.js +15 -0
- package/dist/icons/shopping/inventory.js +6 -0
- package/dist/icons/shopping/point_of_sale.js +6 -0
- package/dist/icons/shopping/shirt.js +6 -0
- package/dist/icons/shopping/tag.js +6 -0
- package/dist/icons/shopping/tag_diagonal.js +6 -0
- package/dist/icons/shopping/tote.js +6 -0
- package/dist/icons/special/index.js +4 -0
- package/dist/icons/special/upload_audio.js +11 -0
- package/dist/icons/special/upload_file.js +6 -0
- package/dist/icons/special/upload_image.js +8 -0
- package/dist/icons/special/upload_video.js +9 -0
- package/dist/icons/symbols/at.js +6 -0
- package/dist/icons/symbols/cc.js +6 -0
- package/dist/icons/symbols/cmd.js +6 -0
- package/dist/icons/symbols/facebook.js +6 -0
- package/dist/icons/symbols/google.js +9 -0
- package/dist/icons/symbols/hash.js +6 -0
- package/dist/icons/symbols/index.js +9 -0
- package/dist/icons/symbols/instagram.js +18 -0
- package/dist/icons/symbols/messenger.js +12 -0
- package/dist/icons/symbols/twitter.js +6 -0
- package/dist/icons/technology/battery.js +6 -0
- package/dist/icons/technology/battery_100.js +6 -0
- package/dist/icons/technology/battery_20.js +6 -0
- package/dist/icons/technology/battery_40.js +6 -0
- package/dist/icons/technology/battery_60.js +6 -0
- package/dist/icons/technology/battery_80.js +6 -0
- package/dist/icons/technology/battery_charging.js +6 -0
- package/dist/icons/technology/battery_slash.js +6 -0
- package/dist/icons/technology/devices.js +6 -0
- package/dist/icons/technology/floppy_disk.js +6 -0
- package/dist/icons/technology/index.js +17 -0
- package/dist/icons/technology/iphone.js +6 -0
- package/dist/icons/technology/laptop.js +6 -0
- package/dist/icons/technology/mobile.js +6 -0
- package/dist/icons/technology/monitor.js +6 -0
- package/dist/icons/technology/server.js +6 -0
- package/dist/icons/technology/sim_card.js +6 -0
- package/dist/icons/technology/usb_stick.js +6 -0
- package/dist/icons/text/align_center.js +6 -0
- package/dist/icons/text/align_justified.js +6 -0
- package/dist/icons/text/align_left.js +6 -0
- package/dist/icons/text/align_right.js +6 -0
- package/dist/icons/text/code_block.js +6 -0
- package/dist/icons/text/divider.js +6 -0
- package/dist/icons/text/footnote.js +8 -0
- package/dist/icons/text/indent_decrease.js +6 -0
- package/dist/icons/text/indent_increase.js +6 -0
- package/dist/icons/text/index.js +13 -0
- package/dist/icons/text/list_ordered.js +6 -0
- package/dist/icons/text/list_unordered.js +6 -0
- package/dist/icons/text/quote.js +6 -0
- package/dist/icons/text/table.js +6 -0
- package/dist/icons/time/alarm.js +6 -0
- package/dist/icons/time/alarm_checkmark.js +6 -0
- package/dist/icons/time/alarm_minus.js +6 -0
- package/dist/icons/time/alarm_plus.js +6 -0
- package/dist/icons/time/alarm_slash.js +6 -0
- package/dist/icons/time/alarm_snooze.js +6 -0
- package/dist/icons/time/calendar.js +6 -0
- package/dist/icons/time/calendar_add.js +6 -0
- package/dist/icons/time/calendar_checkmark.js +6 -0
- package/dist/icons/time/calendar_close.js +6 -0
- package/dist/icons/time/calendar_dates.js +6 -0
- package/dist/icons/time/calendar_minus.js +6 -0
- package/dist/icons/time/calendar_plus.js +6 -0
- package/dist/icons/time/calendar_scroll.js +8 -0
- package/dist/icons/time/clock.js +6 -0
- package/dist/icons/time/clock_history.js +6 -0
- package/dist/icons/time/index.js +19 -0
- package/dist/icons/time/stopwatch.js +6 -0
- package/dist/icons/time/timer.js +6 -0
- package/dist/icons/time/watch.js +6 -0
- package/dist/index.js +5 -2
- package/dist/styles/output.css +1771 -0
- package/dist/types/attributes.js +1 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.js +98 -0
- package/dist/utils/function.js +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +2 -5
- package/dist/components/actions/dropdown/dropdown.stories.d.ts +0 -5
- package/dist/components/custom/courses_selection/courses_selection.stories.d.ts +0 -5
- package/dist/components/custom/users_selection/users_selection.stories.d.ts +0 -5
- package/dist/components/editor/editor.stories.d.ts +0 -6
- package/dist/components/iconography/avatar/avatar.stories.d.ts +0 -7
- package/dist/components/media/video-player/video.stories.d.ts +0 -6
- package/dist/main.js.LICENSE.txt +0 -90
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { insertImage, useLinkToolbarButton, useLinkToolbarButtonState, useListToolbarButton, useListToolbarButtonState, useMarkToolbarButton, useMarkToolbarButtonState, useEditorRef, } from '@udecode/plate';
|
|
4
|
+
import { Tooltip } from '../../';
|
|
5
|
+
import { AlignmentDropdown } from '../navbar/alignment_dropdown';
|
|
6
|
+
import { StyleDropdown } from '../navbar/style_dropdown';
|
|
7
|
+
import { Bold, Image, Italic, Link, ListOrdered, ListUnordered, Redo, Underline, Undo, } from '../../../icons';
|
|
8
|
+
import { ELEMENT_OL, ELEMENT_UL, MARK_BOLD, MARK_ITALIC, MARK_UNDERLINE, } from '../constants';
|
|
9
|
+
export const EditorBar = ({ handleUploadImage }) => {
|
|
10
|
+
const editorRef = useEditorRef('main');
|
|
11
|
+
const imageRef = React.useRef(null);
|
|
12
|
+
const boldState = useMarkToolbarButtonState({ nodeType: MARK_BOLD });
|
|
13
|
+
const { props: { pressed: currBold, onClick: handleBold }, } = useMarkToolbarButton(boldState);
|
|
14
|
+
const italicState = useMarkToolbarButtonState({ nodeType: MARK_ITALIC });
|
|
15
|
+
const { props: { pressed: currItalic, onClick: handleItalic }, } = useMarkToolbarButton(italicState);
|
|
16
|
+
const underlineState = useMarkToolbarButtonState({
|
|
17
|
+
nodeType: MARK_UNDERLINE,
|
|
18
|
+
});
|
|
19
|
+
const { props: { pressed: currUnderline, onClick: handleUnderline }, } = useMarkToolbarButton(underlineState);
|
|
20
|
+
const linkState = useLinkToolbarButtonState();
|
|
21
|
+
const { props: { pressed: currLink, onClick: handleLink }, } = useLinkToolbarButton(linkState);
|
|
22
|
+
const orderedListState = useListToolbarButtonState({ nodeType: ELEMENT_OL });
|
|
23
|
+
const { props: { pressed: currOrderedList, onClick: handleOrderedList }, } = useListToolbarButton(orderedListState);
|
|
24
|
+
const unorderedListState = useListToolbarButtonState({
|
|
25
|
+
nodeType: ELEMENT_UL,
|
|
26
|
+
});
|
|
27
|
+
const { props: { pressed: currUnorderedList, onClick: handleUnorderedList }, } = useListToolbarButton(unorderedListState);
|
|
28
|
+
const handleImageChange = async () => {
|
|
29
|
+
const files = imageRef.current?.files;
|
|
30
|
+
if (!files)
|
|
31
|
+
return;
|
|
32
|
+
const imageurl = await handleUploadImage(files);
|
|
33
|
+
if (imageurl) {
|
|
34
|
+
insertImage(editorRef, imageurl);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const handleRedo = () => editorRef.redo();
|
|
38
|
+
const handleUndo = () => editorRef.undo();
|
|
39
|
+
return (React.createElement(Menu, { "aria-label": "editor-navigation" },
|
|
40
|
+
React.createElement(MenuSection, null,
|
|
41
|
+
React.createElement(Tooltip, { content: "Undo", place: "top" },
|
|
42
|
+
React.createElement(MenuButton, { "$active": false, onClick: handleUndo },
|
|
43
|
+
React.createElement(Undo, { size: 24, color: "grey-5" }))),
|
|
44
|
+
React.createElement(Tooltip, { content: "Redo", place: "top" },
|
|
45
|
+
React.createElement(MenuButton, { "$active": false, onClick: handleRedo },
|
|
46
|
+
React.createElement(Redo, { size: 24, color: "grey-5" })))),
|
|
47
|
+
React.createElement(Divider, null),
|
|
48
|
+
React.createElement(MenuSection, null,
|
|
49
|
+
React.createElement(StyleDropdown, { editorRef: editorRef })),
|
|
50
|
+
React.createElement(Divider, null),
|
|
51
|
+
React.createElement(MenuSection, null,
|
|
52
|
+
React.createElement(MenuButton, { "$active": false, as: "div" },
|
|
53
|
+
React.createElement(AlignmentDropdown, { editorRef: editorRef }))),
|
|
54
|
+
React.createElement(Divider, null),
|
|
55
|
+
React.createElement(MenuSection, null,
|
|
56
|
+
React.createElement(Tooltip, { content: "Bold", place: "top" },
|
|
57
|
+
React.createElement(MenuButton, { "$active": currBold, onClick: handleBold },
|
|
58
|
+
React.createElement(Bold, { size: 24, color: "grey-5" }))),
|
|
59
|
+
React.createElement(Tooltip, { content: "Italic", place: "top" },
|
|
60
|
+
React.createElement(MenuButton, { "$active": currItalic, onClick: handleItalic },
|
|
61
|
+
React.createElement(Italic, { size: 24, color: "grey-5" }))),
|
|
62
|
+
React.createElement(Tooltip, { content: "Underline", place: "top" },
|
|
63
|
+
React.createElement(MenuButton, { "$active": currUnderline, onClick: handleUnderline },
|
|
64
|
+
React.createElement(Underline, { size: 24, color: "grey-5" })))),
|
|
65
|
+
React.createElement(Divider, null),
|
|
66
|
+
React.createElement(MenuSection, null,
|
|
67
|
+
React.createElement(Tooltip, { content: "Link", place: "top" },
|
|
68
|
+
React.createElement(MenuButton, { "$active": currLink, onClick: handleLink },
|
|
69
|
+
React.createElement(Link, { size: 24, color: "grey-5" }))),
|
|
70
|
+
React.createElement(Tooltip, { content: "Image", place: "top" },
|
|
71
|
+
React.createElement(MenuButton, { "$active": false, as: "label", onChange: handleImageChange },
|
|
72
|
+
React.createElement("div", { onClick: () => imageRef.current?.click() },
|
|
73
|
+
React.createElement("input", { accept: "image/*", ref: imageRef, style: { display: 'none' }, type: "file" }),
|
|
74
|
+
React.createElement(Image, { size: 24, color: "grey-5" }))))),
|
|
75
|
+
React.createElement(Divider, null),
|
|
76
|
+
React.createElement(MenuSection, null,
|
|
77
|
+
React.createElement(Tooltip, { content: "Unordered List", place: "top" },
|
|
78
|
+
React.createElement(MenuButton, { "$active": currUnorderedList, onClick: handleUnorderedList },
|
|
79
|
+
React.createElement(ListUnordered, { size: 24, color: "grey-5" }))),
|
|
80
|
+
React.createElement(Tooltip, { content: "Ordered List", place: "top" },
|
|
81
|
+
React.createElement(MenuButton, { "$active": currOrderedList, onClick: handleOrderedList },
|
|
82
|
+
React.createElement(ListOrdered, { size: 24, color: "grey-5" }))))));
|
|
83
|
+
};
|
|
84
|
+
const Menu = styled.nav `
|
|
85
|
+
display: flex;
|
|
86
|
+
gap: 12px;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
max-width: 1200px;
|
|
89
|
+
margin: 0;
|
|
90
|
+
padding: 14px 24px;
|
|
91
|
+
background-color: var(--color-white);
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
border-radius: 8px 8px 0px 0px;
|
|
94
|
+
box-shadow: var(--elevation-1);
|
|
95
|
+
`;
|
|
96
|
+
const MenuSection = styled.div `
|
|
97
|
+
display: flex;
|
|
98
|
+
gap: 16px;
|
|
99
|
+
align-items: center;
|
|
100
|
+
width: fit-content;
|
|
101
|
+
flex-shrink: 0;
|
|
102
|
+
`;
|
|
103
|
+
export const MenuButton = styled.button `
|
|
104
|
+
padding: 2px;
|
|
105
|
+
border: none;
|
|
106
|
+
outline: none;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
box-sizing: border-box;
|
|
109
|
+
height: 28px;
|
|
110
|
+
width: 28px;
|
|
111
|
+
border-radius: 2px;
|
|
112
|
+
|
|
113
|
+
&:hover:not(:disabled) {
|
|
114
|
+
padding: 1px;
|
|
115
|
+
border: 1px solid var(--color-grey-8);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&:active:not(:disabled) {
|
|
119
|
+
background-color: var(--color-grey-9);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:disabled {
|
|
123
|
+
background-color: var(--color-white) !important;
|
|
124
|
+
cursor: initial;
|
|
125
|
+
svg {
|
|
126
|
+
fill: var(--color-grey-7) !important;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
background-color: ${({ $active }) => $active ? 'var(--color-grey-9)' : 'transparent'};
|
|
131
|
+
`;
|
|
132
|
+
const Divider = styled.div `
|
|
133
|
+
width: 1px;
|
|
134
|
+
height: 28px;
|
|
135
|
+
background-color: var(--color-grey-9);
|
|
136
|
+
`;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createPlugins, createHeadingPlugin, createIndentListPlugin, createImagePlugin, createTextIndentPlugin, createListPlugin, createMediaEmbedPlugin, createResetNodePlugin, createBoldPlugin, createCodePlugin, createFontBackgroundColorPlugin, createFontSizePlugin, createFontFamilyPlugin, createItalicPlugin, createStrikethroughPlugin, createSubscriptPlugin, createSuperscriptPlugin, createUnderlinePlugin, createAlignPlugin, createIndentPlugin, createLineHeightPlugin, createLinkPlugin, createExitBreakPlugin, createHistoryPlugin, createSelectOnBackspacePlugin, createSoftBreakPlugin, } from '@udecode/plate';
|
|
2
|
+
import { createParagraphPlugin, createHOnePlugin, createHTwoPlugin, createHThreePlugin, createHFourPlugin, createHFivePlugin, createHSixPlugin, } from '../plugins/blocks/text';
|
|
3
|
+
import { ELEMENT_PARAGRAPH, ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_OL, ELEMENT_UL, } from '../constants';
|
|
4
|
+
import { exitBreakPlugin } from '../plugins/utils/exitBreak';
|
|
5
|
+
import { LinkFloatingMenu } from '../plugins/leafs/link';
|
|
6
|
+
import { resetBlockTypePlugin } from '../plugins/utils/resetBlockType';
|
|
7
|
+
import { selectOnBackspace } from '../plugins/utils/selectOnBackspace';
|
|
8
|
+
import { softBreakPlugin } from '../plugins/utils/softBreak';
|
|
9
|
+
import { plateUI } from '../plugins/plate';
|
|
10
|
+
export const plugins = createPlugins([
|
|
11
|
+
createHeadingPlugin(),
|
|
12
|
+
createImagePlugin({
|
|
13
|
+
options: {
|
|
14
|
+
disableUploadInsert: true,
|
|
15
|
+
disableEmbedInsert: true,
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
createTextIndentPlugin(),
|
|
19
|
+
createIndentListPlugin({
|
|
20
|
+
inject: {
|
|
21
|
+
props: {
|
|
22
|
+
validTypes: [
|
|
23
|
+
ELEMENT_PARAGRAPH,
|
|
24
|
+
ELEMENT_H1,
|
|
25
|
+
ELEMENT_H2,
|
|
26
|
+
ELEMENT_H3,
|
|
27
|
+
ELEMENT_H4,
|
|
28
|
+
ELEMENT_H5,
|
|
29
|
+
ELEMENT_H6,
|
|
30
|
+
ELEMENT_OL,
|
|
31
|
+
ELEMENT_UL,
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
createListPlugin(),
|
|
37
|
+
createMediaEmbedPlugin(),
|
|
38
|
+
createParagraphPlugin(),
|
|
39
|
+
createHOnePlugin(),
|
|
40
|
+
createHTwoPlugin(),
|
|
41
|
+
createHThreePlugin(),
|
|
42
|
+
createHFourPlugin(),
|
|
43
|
+
createHFivePlugin(),
|
|
44
|
+
createHSixPlugin(),
|
|
45
|
+
createResetNodePlugin(),
|
|
46
|
+
createBoldPlugin(),
|
|
47
|
+
createCodePlugin(),
|
|
48
|
+
createFontBackgroundColorPlugin(),
|
|
49
|
+
createFontSizePlugin(),
|
|
50
|
+
createFontFamilyPlugin(),
|
|
51
|
+
createItalicPlugin(),
|
|
52
|
+
createStrikethroughPlugin(),
|
|
53
|
+
createSubscriptPlugin(),
|
|
54
|
+
createSuperscriptPlugin(),
|
|
55
|
+
createUnderlinePlugin(),
|
|
56
|
+
createAlignPlugin({
|
|
57
|
+
inject: {
|
|
58
|
+
props: {
|
|
59
|
+
validTypes: [
|
|
60
|
+
ELEMENT_PARAGRAPH,
|
|
61
|
+
ELEMENT_H1,
|
|
62
|
+
ELEMENT_H2,
|
|
63
|
+
ELEMENT_H3,
|
|
64
|
+
ELEMENT_H4,
|
|
65
|
+
ELEMENT_H5,
|
|
66
|
+
ELEMENT_H6,
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
createIndentPlugin({
|
|
72
|
+
inject: {
|
|
73
|
+
props: {
|
|
74
|
+
validTypes: [ELEMENT_PARAGRAPH, ELEMENT_H1],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
}),
|
|
78
|
+
createLineHeightPlugin(),
|
|
79
|
+
createLinkPlugin({
|
|
80
|
+
renderAfterEditable: LinkFloatingMenu,
|
|
81
|
+
}),
|
|
82
|
+
createExitBreakPlugin(exitBreakPlugin),
|
|
83
|
+
createHistoryPlugin(),
|
|
84
|
+
createResetNodePlugin(resetBlockTypePlugin),
|
|
85
|
+
createSelectOnBackspacePlugin(selectOnBackspace),
|
|
86
|
+
createSoftBreakPlugin(softBreakPlugin),
|
|
87
|
+
], {
|
|
88
|
+
components: plateUI,
|
|
89
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Plate, PlateContent } from '@udecode/plate';
|
|
5
|
+
import { plugins } from './plugins';
|
|
6
|
+
import { EditorBar } from './navbar';
|
|
7
|
+
export const SimpleEditor = ({ editable, handleUploadImage, onChange, placeholder = '', previousContent = [
|
|
8
|
+
{
|
|
9
|
+
type: 'p',
|
|
10
|
+
children: [
|
|
11
|
+
{
|
|
12
|
+
text: '',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
], }) => {
|
|
17
|
+
return (React.createElement(Plate, { id: "main", initialValue: previousContent, onChange: onChange, plugins: plugins },
|
|
18
|
+
React.createElement(Wrapper, null,
|
|
19
|
+
editable && React.createElement(EditorBar, { handleUploadImage: handleUploadImage }),
|
|
20
|
+
React.createElement(InnerWrapper, null,
|
|
21
|
+
React.createElement(PlateContent, { id: "main", autoFocus: true, placeholder: placeholder, readOnly: !editable, spellCheck: true })))));
|
|
22
|
+
};
|
|
23
|
+
const InnerWrapper = styled.div `
|
|
24
|
+
& > div {
|
|
25
|
+
padding: 24px;
|
|
26
|
+
min-height: 224px;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
|
|
29
|
+
& > div {
|
|
30
|
+
margin: 24px 0px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
const Wrapper = styled.div `
|
|
35
|
+
position: relative;
|
|
36
|
+
max-width: 1200px;
|
|
37
|
+
width: 100%;
|
|
38
|
+
min-height: 224px;
|
|
39
|
+
border: 1px solid var(--color-grey-8);
|
|
40
|
+
border-radius: 8px;
|
|
41
|
+
background-color: var(--color-white);
|
|
42
|
+
|
|
43
|
+
* {
|
|
44
|
+
font-family: var(--font-inter);
|
|
45
|
+
outline: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.slate-bold {
|
|
49
|
+
font-weight: 700;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.slate-italic {
|
|
53
|
+
font-style: italic;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.slate-strikethrough {
|
|
57
|
+
text-decoration: line-through;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.slate-underline {
|
|
61
|
+
text-decoration: underline;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
li {
|
|
65
|
+
margin: 8px 0px;
|
|
66
|
+
color: var(--color-grey-3);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.slate-code {
|
|
70
|
+
& > * {
|
|
71
|
+
font-family: 'Roboto Mono';
|
|
72
|
+
& > * {
|
|
73
|
+
font-family: 'Roboto Mono';
|
|
74
|
+
& > * {
|
|
75
|
+
font-family: 'Roboto Mono';
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
background-color: var(--color-grey-9);
|
|
81
|
+
padding: 0.4em 0.4em;
|
|
82
|
+
font-size: 0.8em;
|
|
83
|
+
line-height: 0.8em;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
& > [data-slate-editor='true'] > * {
|
|
87
|
+
margin: 24px 0px;
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { styled } from 'styled-components';
|
|
4
|
+
import { Toast } from '../toast';
|
|
5
|
+
export const AnimatedToast = ({ message, type, onClose, animationDuration = 4, }) => {
|
|
6
|
+
const [toastIsClosed, setToastIsClosed] = React.useState(false);
|
|
7
|
+
const timer = React.useRef(null);
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
timer.current = setTimeout(() => {
|
|
10
|
+
setToastIsClosed(true);
|
|
11
|
+
!!onClose && onClose();
|
|
12
|
+
}, animationDuration * 1000);
|
|
13
|
+
return () => {
|
|
14
|
+
clearTimeout(timer.current);
|
|
15
|
+
};
|
|
16
|
+
}, [animationDuration, onClose]);
|
|
17
|
+
return (React.createElement(Container, null,
|
|
18
|
+
React.createElement(ToastAnimation, { className: `${toastIsClosed ? 'toast-closed' : ''}` },
|
|
19
|
+
React.createElement(Toast, { content: message, type: type, isAnimated: true, animationDuration: animationDuration }))));
|
|
20
|
+
};
|
|
21
|
+
const Container = styled.div `
|
|
22
|
+
position: fixed;
|
|
23
|
+
z-index: 9999;
|
|
24
|
+
bottom: 16px;
|
|
25
|
+
right: 16px;
|
|
26
|
+
`;
|
|
27
|
+
const ToastAnimation = styled.div `
|
|
28
|
+
animation: slide-in 0.4s ease-in-out forwards;
|
|
29
|
+
|
|
30
|
+
&.toast-closed {
|
|
31
|
+
animation: slide-out 0.4s ease-in-out forwards;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@keyframes slide-out {
|
|
35
|
+
0% {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
transform: translateX(0%);
|
|
38
|
+
}
|
|
39
|
+
100% {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: translateX(100%);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@keyframes slide-in {
|
|
46
|
+
0% {
|
|
47
|
+
opacity: 0;
|
|
48
|
+
transform: translateX(100%);
|
|
49
|
+
}
|
|
50
|
+
100% {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
transform: translateX(0%);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AnimatedToast } from './animated_toast';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Close } from '../../../icons';
|
|
5
|
+
const colorLookup = {
|
|
6
|
+
blue: {
|
|
7
|
+
primary: 'var(--color-hue-blue-1)',
|
|
8
|
+
secondary: 'var(--color-hue-blue-2)',
|
|
9
|
+
bg: 'var(--color-hue-blue-3)',
|
|
10
|
+
},
|
|
11
|
+
green: {
|
|
12
|
+
primary: 'var(--color-green-3)',
|
|
13
|
+
secondary: 'var(--color-green-8)',
|
|
14
|
+
bg: 'var(--color-green-10)',
|
|
15
|
+
},
|
|
16
|
+
orange: {
|
|
17
|
+
primary: 'var(--color-hue-orange-1)',
|
|
18
|
+
secondary: 'var(--color-hue-orange-2)',
|
|
19
|
+
bg: 'var(--color-hue-orange-3)',
|
|
20
|
+
},
|
|
21
|
+
purple: {
|
|
22
|
+
primary: 'var(--color-hue-purple-1)',
|
|
23
|
+
secondary: 'var(--color-hue-purple-2)',
|
|
24
|
+
bg: 'var(--color-hue-purple-3)',
|
|
25
|
+
},
|
|
26
|
+
red: {
|
|
27
|
+
primary: 'var(--color-red-4)',
|
|
28
|
+
secondary: 'var(--color-red-9)',
|
|
29
|
+
bg: 'var(--color-red-10)',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export const Badge = ({ children, color, dot, onDismiss }) => {
|
|
33
|
+
const bgColor = colorLookup[color].bg;
|
|
34
|
+
const textColor = colorLookup[color].primary;
|
|
35
|
+
const borderColor = colorLookup[color].secondary;
|
|
36
|
+
return (React.createElement(Component, { "$bgColor": bgColor, "$borderColor": borderColor, "$textColor": textColor },
|
|
37
|
+
dot && React.createElement(Dot, { "$secondaryColor": textColor }),
|
|
38
|
+
children,
|
|
39
|
+
onDismiss && React.createElement(Close, { size: 16 })));
|
|
40
|
+
};
|
|
41
|
+
const Component = styled.div `
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
gap: 8px;
|
|
45
|
+
padding: 1px 7px;
|
|
46
|
+
border-radius: 32px;
|
|
47
|
+
background-color: ${({ $bgColor }) => $bgColor};
|
|
48
|
+
color: ${({ $textColor }) => $textColor};
|
|
49
|
+
border: 1px solid ${({ $borderColor }) => $borderColor};
|
|
50
|
+
font-family: var(--font-inter);
|
|
51
|
+
font-size: 12px;
|
|
52
|
+
font-weight: 500;
|
|
53
|
+
line-height: 16px;
|
|
54
|
+
user-select: none;
|
|
55
|
+
|
|
56
|
+
svg {
|
|
57
|
+
fill: currentColor;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
const Dot = styled.div `
|
|
62
|
+
width: 8px;
|
|
63
|
+
height: 8px;
|
|
64
|
+
border-radius: 50%;
|
|
65
|
+
background-color: ${({ $secondaryColor }) => $secondaryColor};
|
|
66
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge } from './badge';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Styles } from '../../../common';
|
|
5
|
+
import { Box, Button, P } from '../../';
|
|
6
|
+
import { AlertCircle, AlertOctogon, AlertTriangle, Close, Information, } from '../../../icons';
|
|
7
|
+
export const Banner = ({ content, href, onClose, title, type, setContentInNewLine = false, additionalContent, sx, }) => {
|
|
8
|
+
const iconLookup = {
|
|
9
|
+
error: React.createElement(AlertOctogon, { size: 24 }),
|
|
10
|
+
info: React.createElement(Information, { size: 24 }),
|
|
11
|
+
success: React.createElement(AlertCircle, { size: 24 }),
|
|
12
|
+
warning: React.createElement(AlertTriangle, { size: 24 }),
|
|
13
|
+
};
|
|
14
|
+
return (React.createElement(Wrapper, { as: "output", "$dir": "row", "$gap": 8, "$type": type, "$sx": sx },
|
|
15
|
+
iconLookup[type],
|
|
16
|
+
React.createElement(Box, { "$dir": setContentInNewLine ? 'column' : 'row', "$gap": 4 },
|
|
17
|
+
React.createElement(P, { as: "span", "$semiBold": true }, title),
|
|
18
|
+
React.createElement(P, { as: "span", sx: setContentInNewLine ? 'margin-top: 12px;' : '' }, content),
|
|
19
|
+
additionalContent && React.createElement(P, { as: "span" }, additionalContent),
|
|
20
|
+
href && (React.createElement(P, { as: "a", href: href, "$color": "primary-blue-2" }, "Read more"))),
|
|
21
|
+
onClose && (React.createElement(Button, { icon: React.createElement(Close, { size: 24 }), onClick: onClose, type: "special" }))));
|
|
22
|
+
};
|
|
23
|
+
const Wrapper = styled.output `
|
|
24
|
+
width: 100%;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
padding: 12px 16px;
|
|
27
|
+
display: flex;
|
|
28
|
+
background-color: ${({ $type }) => $type === 'error'
|
|
29
|
+
? 'var(--color-red-9)'
|
|
30
|
+
: $type === 'info'
|
|
31
|
+
? 'var(--color-blue-9)'
|
|
32
|
+
: $type === 'success'
|
|
33
|
+
? 'var(--color-green-9)'
|
|
34
|
+
: 'var(--color-orange-9)'};
|
|
35
|
+
border-bottom: 1px solid
|
|
36
|
+
${({ $type }) => $type === 'error'
|
|
37
|
+
? 'var(--color-red-4)'
|
|
38
|
+
: $type === 'info'
|
|
39
|
+
? 'var(--color-blue-4)'
|
|
40
|
+
: $type === 'success'
|
|
41
|
+
? 'var(--color-green-3)'
|
|
42
|
+
: 'var(--color-orange-5)'};
|
|
43
|
+
box-shadow: var(--elevation-2);
|
|
44
|
+
border-radius: var(--small);
|
|
45
|
+
|
|
46
|
+
& > svg {
|
|
47
|
+
fill: ${({ $type }) => $type === 'error'
|
|
48
|
+
? 'var(--color-red-4)'
|
|
49
|
+
: $type === 'info'
|
|
50
|
+
? 'var(--color-blue-4)'
|
|
51
|
+
: $type === 'success'
|
|
52
|
+
? 'var(--color-green-3)'
|
|
53
|
+
: 'var(--color-orange-5)'};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
a {
|
|
57
|
+
position: relative;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
|
|
60
|
+
&::after {
|
|
61
|
+
position: absolute;
|
|
62
|
+
content: '';
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 1px;
|
|
65
|
+
right: 0px;
|
|
66
|
+
left: 0px;
|
|
67
|
+
bottom: 0px;
|
|
68
|
+
background-color: var(--color-primary-blue-2);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
button {
|
|
73
|
+
padding: 0px;
|
|
74
|
+
margin-left: auto;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
${Styles.flex}
|
|
78
|
+
|
|
79
|
+
${({ $sx }) => ($sx ? $sx : '')}
|
|
80
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Banner } from './banner';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Close } from '../../../icons';
|
|
5
|
+
const colorLookup = {
|
|
6
|
+
'primary-blue': {
|
|
7
|
+
primary: 'var(--color-primary-blue-2)',
|
|
8
|
+
secondary: 'var(--color-white)',
|
|
9
|
+
text: 'var(--color-white)',
|
|
10
|
+
},
|
|
11
|
+
blue: {
|
|
12
|
+
primary: 'var(--color-blue-9)',
|
|
13
|
+
secondary: 'var(--color-blue-5)',
|
|
14
|
+
text: 'var(--color-grey-4)',
|
|
15
|
+
},
|
|
16
|
+
green: {
|
|
17
|
+
primary: 'var(--color-green-9)',
|
|
18
|
+
secondary: 'var(--color-green-5)',
|
|
19
|
+
text: 'var(--color-grey-4)',
|
|
20
|
+
},
|
|
21
|
+
grey: {
|
|
22
|
+
primary: 'var(--color-grey-9)',
|
|
23
|
+
secondary: 'var(--color-grey-4)',
|
|
24
|
+
text: 'var(--color-grey-4)',
|
|
25
|
+
},
|
|
26
|
+
orange: {
|
|
27
|
+
primary: 'var(--color-orange-9)',
|
|
28
|
+
secondary: 'var(--color-orange-5)',
|
|
29
|
+
text: 'var(--color-grey-4)',
|
|
30
|
+
},
|
|
31
|
+
purple: {
|
|
32
|
+
primary: 'var(--color-purple-9)',
|
|
33
|
+
secondary: 'var(--color-purple-5)',
|
|
34
|
+
text: 'var(--color-grey-4)',
|
|
35
|
+
},
|
|
36
|
+
red: {
|
|
37
|
+
primary: 'var(--color-red-9)',
|
|
38
|
+
secondary: 'var(--color-red-5)',
|
|
39
|
+
text: 'var(--color-grey-4)',
|
|
40
|
+
},
|
|
41
|
+
turquoise: {
|
|
42
|
+
primary: 'var(--color-turquoise-9)',
|
|
43
|
+
secondary: 'var(--color-turquoise-5)',
|
|
44
|
+
text: 'var(--color-grey-4)',
|
|
45
|
+
},
|
|
46
|
+
yellow: {
|
|
47
|
+
primary: 'var(--color-yellow-9)',
|
|
48
|
+
secondary: 'var(--color-yellow-9)',
|
|
49
|
+
text: 'var(--color-grey-4)',
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export const Chip = ({ children, color, dot, onDismiss, size }) => {
|
|
53
|
+
const bgColor = colorLookup[color].primary;
|
|
54
|
+
const textColor = colorLookup[color].text;
|
|
55
|
+
const dotColor = colorLookup[color].secondary;
|
|
56
|
+
return (React.createElement(Component, { "$bgColor": bgColor, "$size": size, "$textColor": textColor },
|
|
57
|
+
dot && React.createElement(Dot, { "$secondaryColor": dotColor }),
|
|
58
|
+
children,
|
|
59
|
+
onDismiss && React.createElement(Close, { size: 16, onClick: onDismiss })));
|
|
60
|
+
};
|
|
61
|
+
const Component = styled.div `
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
border-radius: 32px;
|
|
66
|
+
background-color: ${({ $bgColor }) => $bgColor};
|
|
67
|
+
color: ${({ $textColor }) => $textColor};
|
|
68
|
+
font-family: var(--font-inter);
|
|
69
|
+
user-select: none;
|
|
70
|
+
|
|
71
|
+
svg {
|
|
72
|
+
fill: currentColor;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
${({ $size }) => $size === 'small'
|
|
76
|
+
? // small
|
|
77
|
+
`
|
|
78
|
+
padding: 4px 16px;
|
|
79
|
+
font-size: 12px;
|
|
80
|
+
line-height: 16px;
|
|
81
|
+
font-weight: 500;`
|
|
82
|
+
: // large
|
|
83
|
+
`
|
|
84
|
+
padding: 8px 16px;
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
line-height: 20px;
|
|
87
|
+
font-weight: 600;`}
|
|
88
|
+
`;
|
|
89
|
+
const Dot = styled.div `
|
|
90
|
+
width: 8px;
|
|
91
|
+
height: 8px;
|
|
92
|
+
border-radius: 50%;
|
|
93
|
+
background-color: ${({ $secondaryColor }) => $secondaryColor};
|
|
94
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Chip } from './chip';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Badge } from './badge';
|
|
2
|
+
export { Banner } from './banner';
|
|
3
|
+
export { Loader } from './loader';
|
|
4
|
+
export { Notification } from './notification';
|
|
5
|
+
export { Progress } from './progress';
|
|
6
|
+
export { Toast } from './toast';
|
|
7
|
+
export { Tooltip } from './tooltip';
|
|
8
|
+
export { AnimatedToast } from './animated_toast';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loader } from './loader';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled, { keyframes } from 'styled-components';
|
|
4
|
+
import { colorReference } from '../../../common';
|
|
5
|
+
export const Loader = ({ color = 'grey-1', inline, size = 16, sx, }) => {
|
|
6
|
+
let borderWidth = 3;
|
|
7
|
+
if (size > 96)
|
|
8
|
+
borderWidth = 10;
|
|
9
|
+
else if (size > 47)
|
|
10
|
+
borderWidth = 5;
|
|
11
|
+
else if (size > 23)
|
|
12
|
+
borderWidth = 4;
|
|
13
|
+
return (React.createElement(Component, { "$borderWidth": borderWidth, "$color": color, "$inline": !!inline, "$size": size, "$sx": sx }));
|
|
14
|
+
};
|
|
15
|
+
const spin = keyframes `
|
|
16
|
+
0% { transform: rotate(0deg); }
|
|
17
|
+
100% { transform: rotate(360deg); }
|
|
18
|
+
`;
|
|
19
|
+
const Component = styled.div `
|
|
20
|
+
border: 2px solid transparent;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
animation: ${spin} 0.8s linear infinite;
|
|
23
|
+
|
|
24
|
+
border-width: ${({ $borderWidth }) => `${$borderWidth}px`};
|
|
25
|
+
border-color: ${({ $color }) => colorReference[$color]};
|
|
26
|
+
border-top-color: transparent;
|
|
27
|
+
|
|
28
|
+
${({ $size }) => `
|
|
29
|
+
height: ${$size}px;
|
|
30
|
+
width: ${$size}px;
|
|
31
|
+
`}
|
|
32
|
+
|
|
33
|
+
${({ $sx }) => ($sx ? $sx : '')};
|
|
34
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Notification } from './notification';
|