@soul-refiner/design-system 0.1.27 → 0.1.29
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 +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.js +233 -0
- package/dist/components/actions/button/button.stories.js +58 -0
- package/dist/components/actions/button/index.js +1 -0
- package/dist/components/actions/dropdown/dropdown.js +202 -0
- package/dist/components/actions/dropdown/dropdown.stories.js +99 -0
- package/dist/components/actions/dropdown/index.js +1 -0
- package/dist/components/actions/index.js +5 -0
- package/dist/components/actions/rate/index.js +1 -0
- package/dist/components/actions/rate/rate.js +45 -0
- package/dist/components/actions/rate/rate.stories.js +29 -0
- package/dist/components/actions/switch/index.js +1 -0
- package/dist/components/actions/switch/switch.js +71 -0
- package/dist/components/actions/switch/switch.stories.js +25 -0
- package/dist/components/actions/toggle/index.js +1 -0
- package/dist/components/actions/toggle/toggle.js +56 -0
- package/dist/components/actions/toggle/toggle.stories.js +20 -0
- package/dist/components/actions/upload/index.js +1 -0
- package/dist/components/actions/upload/upload.js +155 -0
- package/dist/components/actions/upload/upload.stories.js +58 -0
- package/dist/components/atoms/box/box.js +15 -0
- package/dist/components/atoms/box/box.stories.js +85 -0
- package/dist/components/atoms/box/index.js +1 -0
- package/dist/components/atoms/colors/colors.js +34 -0
- package/dist/components/atoms/colors/colors.stories.js +75 -0
- package/dist/components/atoms/colors/index.js +1 -0
- package/dist/components/atoms/index.js +2 -0
- package/dist/components/atoms/typography/display.js +9 -0
- package/dist/components/atoms/typography/heading.js +33 -0
- package/dist/components/atoms/typography/index.js +4 -0
- package/dist/components/atoms/typography/paragraph.js +16 -0
- package/dist/components/atoms/typography/typography.js +11 -0
- package/dist/components/atoms/typography/typography.stories.js +96 -0
- package/dist/components/card/action/action.js +51 -0
- package/dist/components/card/action/index.js +1 -0
- package/dist/components/card/audio/audio.js +100 -0
- package/dist/components/card/audio/index.js +1 -0
- package/dist/components/card/card.js +22 -0
- package/dist/components/card/card.stories.js +284 -0
- package/dist/components/card/feature/feature.js +168 -0
- package/dist/components/card/feature/index.js +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/card/person/index.js +1 -0
- package/dist/components/card/person/person.js +57 -0
- package/dist/components/card/price/index.js +1 -0
- package/dist/components/card/price/price.js +45 -0
- package/dist/components/card/regular/index.js +1 -0
- package/dist/components/card/regular/regular.js +30 -0
- package/dist/components/card/video/index.js +1 -0
- package/dist/components/card/video/video.js +92 -0
- package/dist/components/card/written/index.js +1 -0
- package/dist/components/card/written/written.js +101 -0
- package/dist/components/editor/constants.js +133 -0
- package/dist/components/editor/editor.js +73 -0
- package/dist/components/editor/editor.stories.js +16 -0
- package/dist/components/editor/index.js +1 -0
- package/dist/components/editor/navbar/alignment_dropdown.js +93 -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 +205 -0
- package/dist/components/editor/navbar/style_dropdown.js +65 -0
- package/dist/components/editor/plate.js +27 -0
- package/dist/components/editor/plugins/blockquote.js +8 -0
- package/dist/components/editor/plugins/buttons.js +81 -0
- package/dist/components/editor/plugins/exitBreak.js +31 -0
- package/dist/components/editor/plugins/image.js +47 -0
- package/dist/components/editor/plugins/index.js +111 -0
- package/dist/components/editor/plugins/link.js +74 -0
- package/dist/components/editor/plugins/list.js +17 -0
- package/dist/components/editor/plugins/resetBlockType.js +22 -0
- package/dist/components/editor/plugins/selectOnBackspace.js +6 -0
- package/dist/components/editor/plugins/softBreak.js +14 -0
- package/dist/components/editor/plugins/text.js +81 -0
- package/dist/components/feedback/badge/badge.js +65 -0
- package/dist/components/feedback/badge/badge.stories.js +25 -0
- package/dist/components/feedback/badge/index.js +1 -0
- package/dist/components/feedback/banner/banner.js +76 -0
- package/dist/components/feedback/banner/banner.stories.js +33 -0
- package/dist/components/feedback/banner/index.js +1 -0
- package/dist/components/feedback/chip/chip.js +93 -0
- package/dist/components/feedback/chip/chip.stories.js +39 -0
- package/dist/components/feedback/chip/index.js +1 -0
- package/dist/components/feedback/index.js +7 -0
- package/dist/components/feedback/loader/index.js +1 -0
- package/dist/components/feedback/loader/loader.js +33 -0
- package/dist/components/feedback/loader/loader.stories.js +29 -0
- package/dist/components/feedback/notification/index.js +1 -0
- package/dist/components/feedback/notification/notification.js +71 -0
- package/dist/components/feedback/notification/notificition.stories.js +30 -0
- package/dist/components/feedback/progress/index.js +1 -0
- package/dist/components/feedback/progress/progress.js +86 -0
- package/dist/components/feedback/progress/progress.stories.js +32 -0
- package/dist/components/feedback/toast/index.js +1 -0
- package/dist/components/feedback/toast/toast.js +70 -0
- package/dist/components/feedback/toast/toast.stories.js +26 -0
- package/dist/components/feedback/tooltip/index.js +1 -0
- package/dist/components/feedback/tooltip/tooltip.js +25 -0
- package/dist/components/feedback/tooltip/tooltip.stories.js +43 -0
- package/dist/components/iconography/avatar/avatar.js +148 -0
- package/dist/components/iconography/avatar/avatar.stories.js +55 -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 +3 -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 +9 -0
- package/dist/components/iconography/icon/icon.stories.js +113 -0
- package/dist/components/iconography/icon/index.js +1 -0
- package/dist/components/iconography/index.js +2 -0
- package/dist/components/index.js +9 -0
- package/dist/components/input/checkbox/checkbox.js +21 -0
- package/dist/components/input/checkbox/checkbox.stories.js +19 -0
- package/dist/components/input/checkbox/index.js +1 -0
- package/dist/components/input/date/date.js +516 -0
- package/dist/components/input/date/date.stories.js +30 -0
- package/dist/components/input/date/index.js +1 -0
- package/dist/components/input/filter/filter.js +194 -0
- package/dist/components/input/filter/filter.stories.js +30 -0
- package/dist/components/input/filter/index.js +1 -0
- package/dist/components/input/index.js +5 -0
- package/dist/components/input/radio/index.js +1 -0
- package/dist/components/input/radio/radio.js +77 -0
- package/dist/components/input/radio/radio.stories.js +34 -0
- package/dist/components/input/search/index.js +1 -0
- package/dist/components/input/search/search.js +136 -0
- package/dist/components/input/search/search.stories.js +50 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.js +105 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.stories.js +37 -0
- package/dist/components/navigation/breadcrumb/index.js +1 -0
- package/dist/components/navigation/index.js +2 -0
- package/dist/components/navigation/tabs/index.js +1 -0
- package/dist/components/navigation/tabs/tabs.js +144 -0
- package/dist/components/navigation/tabs/tabs.stories.js +88 -0
- package/dist/components/surfaces/accordion/accordion.js +45 -0
- package/dist/components/surfaces/accordion/accordion.stories.js +16 -0
- package/dist/components/surfaces/accordion/index.js +1 -0
- package/dist/components/surfaces/comment/comment.js +126 -0
- package/dist/components/surfaces/comment/comment.stories.js +82 -0
- package/dist/components/surfaces/comment/helpers.js +38 -0
- package/dist/components/surfaces/comment/index.js +1 -0
- package/dist/components/surfaces/drawer/drawer.js +124 -0
- package/dist/components/surfaces/drawer/drawer.stories.js +77 -0
- package/dist/components/surfaces/drawer/index.js +1 -0
- package/dist/components/surfaces/index.js +5 -0
- package/dist/components/surfaces/message/index.js +1 -0
- package/dist/components/surfaces/message/message.js +43 -0
- package/dist/components/surfaces/message/message.stories.js +71 -0
- package/dist/components/surfaces/modal/index.js +1 -0
- package/dist/components/surfaces/modal/modal.js +100 -0
- package/dist/components/surfaces/modal/modal.stories.js +18 -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 +183 -0
- package/dist/components/table/table/table.stories.js +45 -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 +128 -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/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/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/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/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_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_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 +34 -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/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_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 +14 -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 +21 -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_remove.js +6 -0
- package/dist/icons/people/groups.js +6 -0
- package/dist/icons/people/index.js +9 -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_remove.js +6 -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/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 +14 -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/indent_decrease.js +6 -0
- package/dist/icons/text/indent_increase.js +6 -0
- package/dist/icons/text/index.js +10 -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 +3 -0
- package/dist/types/attributes.js +1 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/date.js +98 -0
- package/dist/utils/function.js +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +5 -4
- package/src/components/editor/editor.tsx +4 -0
- package/src/components/editor/plugins/text.tsx +16 -7
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { callAll } from 'utils';
|
|
4
|
+
const DrawerContext = React.createContext([false, (() => undefined)]);
|
|
5
|
+
export const Drawer = ({ children, controlledOpen, onOpenChange, }) => {
|
|
6
|
+
const [open, setOpen] = React.useState(controlledOpen || false);
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
if (controlledOpen !== undefined) {
|
|
9
|
+
setOpen(controlledOpen);
|
|
10
|
+
}
|
|
11
|
+
}, [controlledOpen]);
|
|
12
|
+
const _children = React.Children.toArray(children);
|
|
13
|
+
const triggers = [];
|
|
14
|
+
const content = [];
|
|
15
|
+
let footer = null;
|
|
16
|
+
let header = null;
|
|
17
|
+
for (const child of _children) {
|
|
18
|
+
if (React.isValidElement(child)) {
|
|
19
|
+
const type = child.type?.displayName;
|
|
20
|
+
if (type === 'Drawer.Trigger')
|
|
21
|
+
triggers.push(child);
|
|
22
|
+
else if (type === 'Drawer.Header')
|
|
23
|
+
header = child;
|
|
24
|
+
else if (type === 'Drawer.Footer')
|
|
25
|
+
footer = child;
|
|
26
|
+
else
|
|
27
|
+
content.push(child);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return (React.createElement(DrawerContext.Provider, { value: [open, setOpen] },
|
|
31
|
+
triggers,
|
|
32
|
+
open && (React.createElement(Background, { onClick: callAll(() => setOpen(false), () => onOpenChange && onOpenChange()) })),
|
|
33
|
+
React.createElement(Component, { "$open": open },
|
|
34
|
+
header && React.createElement(HeaderWrapper, null, header),
|
|
35
|
+
React.createElement(ContentWrapper, null, content),
|
|
36
|
+
footer && React.createElement(FooterWrapper, null, footer))));
|
|
37
|
+
};
|
|
38
|
+
const Background = styled.div `
|
|
39
|
+
position: fixed;
|
|
40
|
+
height: 100vh;
|
|
41
|
+
width: 100vw;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
right: 0;
|
|
45
|
+
z-index: 149;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
background: #000000;
|
|
48
|
+
opacity: 0.5;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
`;
|
|
51
|
+
const Component = styled.div `
|
|
52
|
+
position: fixed;
|
|
53
|
+
top: 0;
|
|
54
|
+
right: 0;
|
|
55
|
+
height: 100vh;
|
|
56
|
+
max-width: 880px;
|
|
57
|
+
width: 100%;
|
|
58
|
+
z-index: 150;
|
|
59
|
+
border-radius: 16px 0px 0px 16px;
|
|
60
|
+
background-color: var(--background-color);
|
|
61
|
+
margin-right: -100vw;
|
|
62
|
+
transition: margin-right 0.5s;
|
|
63
|
+
background-color: var(--color-grey-10);
|
|
64
|
+
|
|
65
|
+
${({ $open }) => ($open ? 'margin-right: 0px;' : '')}
|
|
66
|
+
`;
|
|
67
|
+
const HeaderWrapper = styled.div `
|
|
68
|
+
background-color: var(--color-white);
|
|
69
|
+
box-shadow: var(--elevation-2);
|
|
70
|
+
position: -webkit-sticky; /* Safari */
|
|
71
|
+
position: sticky;
|
|
72
|
+
top: 0;
|
|
73
|
+
`;
|
|
74
|
+
const ContentWrapper = styled.div `
|
|
75
|
+
height: calc(100vh - 224px);
|
|
76
|
+
position: relative;
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-flow: column nowrap;
|
|
79
|
+
padding: 24px 16px 24px 24px;
|
|
80
|
+
margin-right: 8px;
|
|
81
|
+
overflow-y: auto;
|
|
82
|
+
|
|
83
|
+
&::-webkit-scrollbar-track {
|
|
84
|
+
box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
85
|
+
-webkit-box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.15);
|
|
86
|
+
border-radius: 4px;
|
|
87
|
+
background-color: var(--color-white);
|
|
88
|
+
margin: 40px 0px 15px 0px;
|
|
89
|
+
}
|
|
90
|
+
&::-webkit-scrollbar {
|
|
91
|
+
width: 8px;
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
}
|
|
94
|
+
&::-webkit-scrollbar-thumb {
|
|
95
|
+
border-radius: 4px;
|
|
96
|
+
background-color: var(--color-grey-6);
|
|
97
|
+
opacity: 30%;
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
const FooterWrapper = styled.div `
|
|
101
|
+
background-color: var(--color-white);
|
|
102
|
+
box-shadow: var(--elevation-1);
|
|
103
|
+
position: -webkit-sticky; /* Safari */
|
|
104
|
+
position: sticky;
|
|
105
|
+
bottom: 0;
|
|
106
|
+
`;
|
|
107
|
+
const DrawerTrigger = ({ children: child, }) => {
|
|
108
|
+
const [, setOpen] = React.useContext(DrawerContext);
|
|
109
|
+
return (child &&
|
|
110
|
+
React.cloneElement(child, {
|
|
111
|
+
onClick: callAll(() => setOpen((prev) => !prev), child.props.onClick),
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
DrawerTrigger.displayName = 'Drawer.Trigger';
|
|
115
|
+
Drawer.Trigger = DrawerTrigger;
|
|
116
|
+
const DrawerHeader = ({ children }) => (React.createElement("div", null, children));
|
|
117
|
+
DrawerHeader.displayName = 'Drawer.Header';
|
|
118
|
+
Drawer.Header = DrawerHeader;
|
|
119
|
+
const DrawerContent = ({ children }) => (React.createElement("div", null, children));
|
|
120
|
+
DrawerContent.displayName = 'Drawer.Content';
|
|
121
|
+
Drawer.Content = DrawerContent;
|
|
122
|
+
const DrawerFooter = ({ children }) => (React.createElement("div", null, children));
|
|
123
|
+
DrawerFooter.displayName = 'Drawer.Footer';
|
|
124
|
+
Drawer.Footer = DrawerFooter;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Button, H, P } from 'components';
|
|
4
|
+
import { Drawer } from './drawer';
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Surfaces/Drawer',
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
const Header = styled.div `
|
|
12
|
+
height: 60px;
|
|
13
|
+
padding: 16px 24px;
|
|
14
|
+
`;
|
|
15
|
+
const Footer = styled.div `
|
|
16
|
+
height: 60px;
|
|
17
|
+
padding: 16px 24px;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 8px;
|
|
22
|
+
`;
|
|
23
|
+
const Content = styled.div `
|
|
24
|
+
margin: 32px 0px;
|
|
25
|
+
padding: 16px;
|
|
26
|
+
border-radius: 8px;
|
|
27
|
+
background-color: var(--color-white);
|
|
28
|
+
`;
|
|
29
|
+
const Story = (args) => (React.createElement(Drawer, { ...args },
|
|
30
|
+
React.createElement(Drawer.Trigger, null,
|
|
31
|
+
React.createElement(Button, null, "Open Drawer")),
|
|
32
|
+
React.createElement(Drawer.Header, null,
|
|
33
|
+
React.createElement(Header, null,
|
|
34
|
+
React.createElement(H.Six, { "$bold": true }, "Let\u2019s setup your community!"),
|
|
35
|
+
React.createElement(P, null, "This just takes a few minutes."))),
|
|
36
|
+
React.createElement(Drawer.Content, null,
|
|
37
|
+
React.createElement(Content, null,
|
|
38
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
39
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
40
|
+
React.createElement(Content, null,
|
|
41
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
42
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
43
|
+
React.createElement(Content, null,
|
|
44
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
45
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
46
|
+
React.createElement(Content, null,
|
|
47
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
48
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
49
|
+
React.createElement(Content, null,
|
|
50
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
51
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
52
|
+
React.createElement(Content, null,
|
|
53
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
54
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
55
|
+
React.createElement(Content, null,
|
|
56
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
57
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
58
|
+
React.createElement(Content, null,
|
|
59
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
60
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
61
|
+
React.createElement(Content, null,
|
|
62
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
63
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
64
|
+
React.createElement(Content, null,
|
|
65
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
66
|
+
React.createElement(P, null, "This just takes a few minutes.")),
|
|
67
|
+
React.createElement(Content, null,
|
|
68
|
+
React.createElement(P, null, "This just takes a few minutes."),
|
|
69
|
+
React.createElement(P, null, "This just takes a few minutes."))),
|
|
70
|
+
React.createElement(Drawer.Footer, null,
|
|
71
|
+
React.createElement(Footer, null,
|
|
72
|
+
React.createElement(Drawer.Trigger, null,
|
|
73
|
+
React.createElement(Button, { size: "small", type: "outlined" }, "Cancel")),
|
|
74
|
+
React.createElement(Button, { size: "small" }, "Create")))));
|
|
75
|
+
export const Default = Story.bind({});
|
|
76
|
+
Default.args = {};
|
|
77
|
+
export default meta;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Drawer } from './drawer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Message } from './message';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Avatar, Box, P, H } from 'components';
|
|
4
|
+
export const Message = ({ messages, userId }) => {
|
|
5
|
+
const id = React.useId();
|
|
6
|
+
return (React.createElement(Box, { "$display": "flex", "$dir": "column", "$gap": 16 }, messages.map(({ content, createdDate, senderAvatarURI, senderHref, senderId, senderName, }, index) => {
|
|
7
|
+
const isSelf = senderId === userId;
|
|
8
|
+
const isFirstMessageBySender = messages?.[index - 1]?.senderId !== senderId;
|
|
9
|
+
if (isSelf) {
|
|
10
|
+
return (React.createElement(React.Fragment, { key: id + index },
|
|
11
|
+
isFirstMessageBySender && (React.createElement(P, { "$color": "grey-4", "$fontSize": 12, "$lineHeight": 16, sx: "margin-top: 40px; margin-left: auto;" },
|
|
12
|
+
createdDate.toLocaleDateString(),
|
|
13
|
+
' ',
|
|
14
|
+
createdDate.toLocaleTimeString())),
|
|
15
|
+
React.createElement(Wrapper, { "$isSelf": isSelf }, content)));
|
|
16
|
+
}
|
|
17
|
+
return (React.createElement(React.Fragment, { key: id + index },
|
|
18
|
+
isFirstMessageBySender && (React.createElement(Avatar, { image: senderAvatarURI, href: senderHref, subtitle: React.createElement(P, { as: "span", "$color": "blue-2", "$fontSize": 12, "$lineHeight": 16, sx: "vertical-align: top;" }, createdDate.toLocaleTimeString()), size: 56, sx: "margin-top: 40px;", textPosition: "right", title: React.createElement(H, { as: "span", "$color": "blue-2", "$fontSize": 18, "$lineHeight": 26, "$mediumBold": true }, senderName) })),
|
|
19
|
+
React.createElement(Wrapper, { "$isSelf": isSelf }, content)));
|
|
20
|
+
})));
|
|
21
|
+
};
|
|
22
|
+
const Wrapper = styled.div `
|
|
23
|
+
max-width: 552px;
|
|
24
|
+
padding: 16px;
|
|
25
|
+
border-radius: 16px;
|
|
26
|
+
font-family: Inter;
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
line-height: 20px;
|
|
29
|
+
letter-spacing: -0.006em;
|
|
30
|
+
|
|
31
|
+
${({ $isSelf }) => $isSelf
|
|
32
|
+
? `
|
|
33
|
+
margin-left: auto;
|
|
34
|
+
color: var(--color-white);
|
|
35
|
+
background-color: var(--color-primary-blue-2);
|
|
36
|
+
border-top-right-radius: 0px;`
|
|
37
|
+
: `
|
|
38
|
+
margin-left: 68px;
|
|
39
|
+
margin-right: auto;
|
|
40
|
+
color: var(--color-grey-3);
|
|
41
|
+
background-color: var(--color-grey-9);
|
|
42
|
+
border-top-left-radius: 0px;`}
|
|
43
|
+
`;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Message } from './message';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Surfaces/Message',
|
|
6
|
+
};
|
|
7
|
+
const Wrapper = styled.div `
|
|
8
|
+
max-width: 1200px;
|
|
9
|
+
margin: 0px auto;
|
|
10
|
+
`;
|
|
11
|
+
const Story = () => (React.createElement(Wrapper, null,
|
|
12
|
+
React.createElement(Message, { messages: [
|
|
13
|
+
{
|
|
14
|
+
content: 'There should be a max quote bubble of 330 px, then it should wrap to the next line like this. And then if you type more it should just keep wrapping.',
|
|
15
|
+
createdDate: new Date('16 June 2023'),
|
|
16
|
+
senderAvatarURI: '',
|
|
17
|
+
senderHref: '#',
|
|
18
|
+
senderId: 'user1',
|
|
19
|
+
senderName: 'You',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
content: 'There should be a max quote bubble of 330 px, then it should wrap to the next line like this. And then if you type more it should just keep wrapping.',
|
|
23
|
+
createdDate: new Date('16 June 2023'),
|
|
24
|
+
senderAvatarURI: '',
|
|
25
|
+
senderHref: '#',
|
|
26
|
+
senderId: 'user1',
|
|
27
|
+
senderName: 'You',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
content: 'A shorter response.',
|
|
31
|
+
createdDate: new Date('16 June 2023'),
|
|
32
|
+
senderAvatarURI: 'https://f005.backblazeb2.com/file/sr-platform/avatar.jpg',
|
|
33
|
+
senderHref: '#',
|
|
34
|
+
senderId: 'user2',
|
|
35
|
+
senderName: 'Ben Merritt',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
content: 'There should be a max quote bubble of 330 px, then it should wrap to the next line like this. And then if you type more it should just keep wrapping.',
|
|
39
|
+
createdDate: new Date('16 June 2023'),
|
|
40
|
+
senderAvatarURI: 'https://f005.backblazeb2.com/file/sr-platform/avatar.jpg',
|
|
41
|
+
senderHref: '#',
|
|
42
|
+
senderId: 'user2',
|
|
43
|
+
senderName: 'Ben Merritt',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
content: 'ok',
|
|
47
|
+
createdDate: new Date('16 June 2023'),
|
|
48
|
+
senderAvatarURI: 'https://f005.backblazeb2.com/file/sr-platform/avatar.jpg',
|
|
49
|
+
senderHref: '#',
|
|
50
|
+
senderId: 'user2',
|
|
51
|
+
senderName: 'Ben Merritt',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
content: 'There should be a max quote bubble of 330 px, then it should wrap to the next line like this. And then if you type more it should just keep wrapping.',
|
|
55
|
+
createdDate: new Date('16 June 2023'),
|
|
56
|
+
senderAvatarURI: '',
|
|
57
|
+
senderHref: '#',
|
|
58
|
+
senderId: 'user1',
|
|
59
|
+
senderName: 'You',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
content: 'There should be a max quote bubble of 330 px, then it should wrap to the next line like this. And then if you type more it should just keep wrapping.',
|
|
63
|
+
createdDate: new Date('16 June 2023'),
|
|
64
|
+
senderAvatarURI: '',
|
|
65
|
+
senderHref: '#',
|
|
66
|
+
senderId: 'user1',
|
|
67
|
+
senderName: 'You',
|
|
68
|
+
},
|
|
69
|
+
], userId: "user1" })));
|
|
70
|
+
export const Default = Story.bind({});
|
|
71
|
+
export default meta;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Modal } from './modal';
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Button } from 'components';
|
|
4
|
+
import { Close } from 'icons';
|
|
5
|
+
import { callAll } from 'utils';
|
|
6
|
+
const ModalContext = React.createContext([false, (() => undefined)]);
|
|
7
|
+
const Modal = ({ controlledOpen, ...props }) => {
|
|
8
|
+
const [open, setOpen] = React.useState(controlledOpen || false);
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
if (controlledOpen !== undefined) {
|
|
11
|
+
setOpen(controlledOpen);
|
|
12
|
+
}
|
|
13
|
+
}, [controlledOpen]);
|
|
14
|
+
return React.createElement(ModalContext.Provider, { value: [open, setOpen], ...props });
|
|
15
|
+
};
|
|
16
|
+
const ModalTrigger = ({ children: child, }) => {
|
|
17
|
+
const [, setOpen] = React.useContext(ModalContext);
|
|
18
|
+
return (child &&
|
|
19
|
+
React.cloneElement(child, {
|
|
20
|
+
onClick: callAll(() => setOpen(true), child.props.onClick),
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
ModalTrigger.displayName = 'Modal.Trigger';
|
|
24
|
+
Modal.Trigger = ModalTrigger;
|
|
25
|
+
const ModalDismiss = ({ children: child, setClosed, }) => {
|
|
26
|
+
const [, setOpen] = React.useContext(ModalContext);
|
|
27
|
+
return (child &&
|
|
28
|
+
React.cloneElement(child, {
|
|
29
|
+
onClick: callAll(() => setOpen(false), child.props.onClick, () => setClosed && setClosed()),
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
ModalDismiss.displayName = 'Modal.Dismiss';
|
|
33
|
+
Modal.Dismiss = ModalDismiss;
|
|
34
|
+
const ModalContent = ({ backgroundDark = true, children, footer, header, setClosed, sx, ...props }) => {
|
|
35
|
+
const [open, setOpen] = React.useContext(ModalContext);
|
|
36
|
+
const handleOutsideClick = (event) => {
|
|
37
|
+
if (event.currentTarget != event.target)
|
|
38
|
+
return;
|
|
39
|
+
setClosed ? setClosed() : setOpen(false);
|
|
40
|
+
};
|
|
41
|
+
return (React.createElement(Wrapper, { "$backgroundDark": backgroundDark, "$open": open, onClick: handleOutsideClick },
|
|
42
|
+
React.createElement(Content, { ...props, "$sx": sx },
|
|
43
|
+
header && (React.createElement("div", { className: "header" },
|
|
44
|
+
React.createElement("div", null, header),
|
|
45
|
+
React.createElement(Modal.Dismiss, { setClosed: setClosed },
|
|
46
|
+
React.createElement(Button, { icon: React.createElement(Close, null), type: "special" })))),
|
|
47
|
+
children,
|
|
48
|
+
footer && React.createElement("div", { className: "footer" }, footer))));
|
|
49
|
+
};
|
|
50
|
+
ModalContent.displayName = 'Modal.Content';
|
|
51
|
+
Modal.Content = ModalContent;
|
|
52
|
+
export { Modal };
|
|
53
|
+
const Wrapper = styled.div `
|
|
54
|
+
${({ $open }) => $open
|
|
55
|
+
? `display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
align-items: center;
|
|
58
|
+
justify-content: center;`
|
|
59
|
+
: 'display: none;'}
|
|
60
|
+
${({ $backgroundDark }) => $backgroundDark
|
|
61
|
+
? `background: rgba(0, 0, 0, 0.5);
|
|
62
|
+
cursor: pointer;`
|
|
63
|
+
: ''}
|
|
64
|
+
position: fixed;
|
|
65
|
+
top: 0;
|
|
66
|
+
left: 0;
|
|
67
|
+
z-index: 100;
|
|
68
|
+
width: 100vw;
|
|
69
|
+
height: 100vh;
|
|
70
|
+
padding: 0px;
|
|
71
|
+
margin: 0px;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
`;
|
|
74
|
+
const Content = styled.div `
|
|
75
|
+
position: absolute;
|
|
76
|
+
z-index: 101;
|
|
77
|
+
background-color: var(--color-white);
|
|
78
|
+
box-shadow: var(--elevation-2);
|
|
79
|
+
border-radius: var(--small);
|
|
80
|
+
cursor: initial;
|
|
81
|
+
padding: 24px;
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: 24px;
|
|
85
|
+
|
|
86
|
+
[class~='header'] {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
|
|
90
|
+
div:first-child {
|
|
91
|
+
flex: 1;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[class~='footer'] {
|
|
96
|
+
position: relative;
|
|
97
|
+
padding-top: 16px;
|
|
98
|
+
}
|
|
99
|
+
${({ $sx }) => ($sx ? $sx : '')}
|
|
100
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Button, H, P } from 'components';
|
|
3
|
+
import { Modal } from './modal';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Surfaces/Modal',
|
|
6
|
+
};
|
|
7
|
+
const Story = (args) => (React.createElement(Modal, { ...args },
|
|
8
|
+
React.createElement(Modal.Trigger, null,
|
|
9
|
+
React.createElement(Button, null, "Open Modal")),
|
|
10
|
+
React.createElement(Modal.Content, { footer: React.createElement(Box, { "$display": "flex", "$justify": "center", "$gap": 16, sx: "position: relative; width: 100%;" },
|
|
11
|
+
React.createElement(Button, { fluid: true, size: "small", type: "outlined" }, "Action 1"),
|
|
12
|
+
React.createElement(Button, { fluid: true, size: "small" }, "Action 2")), header: React.createElement(H, { "$bold": true, "$color": "grey-2", "$fontSize": 20 }, "This is a header") },
|
|
13
|
+
React.createElement(Box, { "$align": "flex-start", "$display": "flex", "$dir": "column", "$gap": 32, sx: "width: 500px" },
|
|
14
|
+
React.createElement(P, { "$textClampLines": 10 }, "Assertively synthesize diverse value after enterprise data. Authoritatively embrace enterprise \"outside the box\" thinking without excellent imperatives. Rapidiously scale multidisciplinary innovation before proactive total linkage"),
|
|
15
|
+
React.createElement(Modal.Dismiss, null,
|
|
16
|
+
React.createElement(Button, null, "Dismiss"))))));
|
|
17
|
+
export const Default = Story.bind({});
|
|
18
|
+
export default meta;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from './table';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from './table';
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Box } from 'components';
|
|
4
|
+
const Table = ({ border = true, children, compact, footer, header, separated, striped, sx, }) => {
|
|
5
|
+
return (React.createElement(Box, { "$backgroundColor": "white", "$borderRadius": "large", "$display": "flex", "$dir": "column", "$gap": 32, "$padding": 32, sx: compact ? 'width: fit-content;' : '' },
|
|
6
|
+
!!header && header,
|
|
7
|
+
React.createElement(Box, { "$borderRadius": "small", sx: border ? 'border: 1px solid var(--color-grey-8);' : '' },
|
|
8
|
+
React.createElement(TableElement, { "$compact": compact, "$separated": separated, "$striped": striped, "$sx": sx }, children)),
|
|
9
|
+
!!footer && footer));
|
|
10
|
+
};
|
|
11
|
+
const TableElement = styled.table `
|
|
12
|
+
width: 100%;
|
|
13
|
+
border-collapse: collapse;
|
|
14
|
+
border-spacing: 0;
|
|
15
|
+
${({ $compact }) => ($compact ? 'width: fit-content;' : '')}
|
|
16
|
+
${({ $separated }) => $separated
|
|
17
|
+
? `
|
|
18
|
+
& > tbody > * {
|
|
19
|
+
border-bottom: 1px solid var(--color-grey-9);
|
|
20
|
+
&:last-child {
|
|
21
|
+
border-bottom: none;
|
|
22
|
+
}
|
|
23
|
+
}`
|
|
24
|
+
: ''}
|
|
25
|
+
${({ $striped }) => $striped
|
|
26
|
+
? `
|
|
27
|
+
& > tbody > *:nth-of-type(even) {
|
|
28
|
+
background-color: var(--color-grey-10);
|
|
29
|
+
}`
|
|
30
|
+
: ''}
|
|
31
|
+
${({ $sx }) => ($sx ? $sx : '')}
|
|
32
|
+
`;
|
|
33
|
+
/********************************************************
|
|
34
|
+
* Table Head
|
|
35
|
+
*/
|
|
36
|
+
const Head = ({ children, ...rest }) => {
|
|
37
|
+
return React.createElement(HeadElement, { ...rest }, children);
|
|
38
|
+
};
|
|
39
|
+
const HeadElement = styled.thead `
|
|
40
|
+
tr {
|
|
41
|
+
background-color: var(--color-grey-10);
|
|
42
|
+
border-top-left-radius: 8px;
|
|
43
|
+
border-top-right-radius: 8px;
|
|
44
|
+
|
|
45
|
+
& > *:first-of-type {
|
|
46
|
+
border-top-left-radius: 8px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
& > *:last-of-type {
|
|
50
|
+
border-top-right-radius: 8px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
Head.displayName = 'Table.Head';
|
|
55
|
+
Table.Head = Head;
|
|
56
|
+
/********************************************************
|
|
57
|
+
* Table Body
|
|
58
|
+
*/
|
|
59
|
+
const Body = ({ children, ...rest }) => {
|
|
60
|
+
return React.createElement(BodyElement, { ...rest }, children);
|
|
61
|
+
};
|
|
62
|
+
const BodyElement = styled.tbody `
|
|
63
|
+
& > tr:last-of-type {
|
|
64
|
+
& > *:first-child {
|
|
65
|
+
border-bottom-left-radius: 8px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
& > *:last-child {
|
|
69
|
+
border-bottom-right-radius: 8px;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
Body.displayName = 'Table.Body';
|
|
74
|
+
Table.Body = Body;
|
|
75
|
+
/********************************************************
|
|
76
|
+
* Table Foot
|
|
77
|
+
*/
|
|
78
|
+
const Foot = ({ children, ...rest }) => {
|
|
79
|
+
return React.createElement("tfoot", { ...rest }, children);
|
|
80
|
+
};
|
|
81
|
+
Foot.displayName = 'Table.Foot';
|
|
82
|
+
Table.Footer = Foot;
|
|
83
|
+
const Row = ({ children, disabled, href, hoverable = false, onClick, selected, sx, ...rest }) => {
|
|
84
|
+
const handleClick = href
|
|
85
|
+
? (event) => {
|
|
86
|
+
if (event.metaKey || event.ctrlKey) {
|
|
87
|
+
const win = window.open(href, '_blank');
|
|
88
|
+
win?.focus();
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
window.location.href = href;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
: onClick
|
|
95
|
+
? (event) => {
|
|
96
|
+
onClick(event);
|
|
97
|
+
}
|
|
98
|
+
: undefined;
|
|
99
|
+
return (React.createElement(RowElement, { onClick: handleClick, "$disabled": disabled, "$hoverable": hoverable, "$isAnchor": !!href, "$selected": selected, "$sx": sx, ...rest }, children));
|
|
100
|
+
};
|
|
101
|
+
const RowElement = styled.tr `
|
|
102
|
+
display: table-row;
|
|
103
|
+
|
|
104
|
+
${({ $disabled }) => $disabled
|
|
105
|
+
? `
|
|
106
|
+
background-color: var(--color-grey-9) !important;
|
|
107
|
+
color: var(--color-grey-7);
|
|
108
|
+
& > * {
|
|
109
|
+
color: var(--color-grey-7) !important;
|
|
110
|
+
}`
|
|
111
|
+
: ''}
|
|
112
|
+
|
|
113
|
+
${({ $disabled, $hoverable }) => !$disabled && $hoverable ? 'background-color: var(--color-grey-9);' : ''}
|
|
114
|
+
|
|
115
|
+
${({ $disabled, $selected }) => !$disabled && $selected ? 'background-color: var(--color-grey-8;' : ''}
|
|
116
|
+
|
|
117
|
+
${({ $disabled, $isAnchor }) => !$disabled && $isAnchor
|
|
118
|
+
? `
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
padding-right: 24px;
|
|
121
|
+
|
|
122
|
+
&:hover {
|
|
123
|
+
background-color: var(--color-grey-10);
|
|
124
|
+
|
|
125
|
+
& > td:last-child {
|
|
126
|
+
position: relative;
|
|
127
|
+
}
|
|
128
|
+
& > td:last-child::after {
|
|
129
|
+
content: "❯";
|
|
130
|
+
color: var(--color-blue-3);
|
|
131
|
+
position: absolute;
|
|
132
|
+
right: 12px;
|
|
133
|
+
top: calc(50% - 11px);
|
|
134
|
+
}
|
|
135
|
+
}`
|
|
136
|
+
: ''}
|
|
137
|
+
${({ $sx }) => ($sx ? $sx : '')}
|
|
138
|
+
`;
|
|
139
|
+
Row.displayName = 'Table.Row';
|
|
140
|
+
Table.Row = Row;
|
|
141
|
+
const Cell = ({ children, lines, padding = '16px 24px', sx, textAlign = 'left', verticalAlign = 'middle', width, }) => {
|
|
142
|
+
const percentageWidth = width ? width * (1 / 16) + '%' : undefined;
|
|
143
|
+
return (React.createElement(CellElement, { "$clamp": lines, "$padding": padding, "$sx": sx, "$textAlign": textAlign, "$verticalAlign": verticalAlign, "$width": percentageWidth ? percentageWidth : 'fit-content' },
|
|
144
|
+
React.createElement("div", null, children)));
|
|
145
|
+
};
|
|
146
|
+
const CellElement = styled.td `
|
|
147
|
+
width: ${({ $width }) => $width};
|
|
148
|
+
height: 20px;
|
|
149
|
+
font-family: Inter;
|
|
150
|
+
font-size: 14px;
|
|
151
|
+
font-weight: 400;
|
|
152
|
+
line-height: 20px;
|
|
153
|
+
color: var(--color-grey-3);
|
|
154
|
+
vertical-align: ${({ $verticalAlign }) => $verticalAlign ? $verticalAlign : ''};
|
|
155
|
+
text-align: ${({ $textAlign }) => ($textAlign ? $textAlign : '')};
|
|
156
|
+
padding: ${({ $padding }) => $padding};
|
|
157
|
+
${({ $clamp }) => $clamp
|
|
158
|
+
? `
|
|
159
|
+
& > div {
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
text-overflow: ellipsis;
|
|
162
|
+
display: -webkit-box;
|
|
163
|
+
line-clamp: ${$clamp};
|
|
164
|
+
-webkit-line-clamp: ${$clamp};
|
|
165
|
+
-webkit-box-orient: vertical;
|
|
166
|
+
}`
|
|
167
|
+
: ''}
|
|
168
|
+
${({ $sx }) => ($sx ? $sx : '')}
|
|
169
|
+
`;
|
|
170
|
+
Cell.displayName = 'Table.Cell';
|
|
171
|
+
Table.Cell = Cell;
|
|
172
|
+
export { Table };
|
|
173
|
+
const HeaderCell = ({ children, lines, padding = '16px 24px', sx, textAlign = 'left', verticalAlign = 'middle', width, }) => {
|
|
174
|
+
const percentageWidth = width ? width * (100 / 16) + '%' : undefined;
|
|
175
|
+
return (React.createElement(HeadCellElement, { as: "th", "$clamp": lines, "$padding": padding, "$sx": sx, "$textAlign": textAlign, "$verticalAlign": verticalAlign, "$width": percentageWidth ? percentageWidth : 'fit-content' }, children));
|
|
176
|
+
};
|
|
177
|
+
const HeadCellElement = styled(CellElement) `
|
|
178
|
+
font-size: 16px;
|
|
179
|
+
font-weight: 700;
|
|
180
|
+
line-height: 24px;
|
|
181
|
+
`;
|
|
182
|
+
HeaderCell.displayName = 'Table.HeaderCell';
|
|
183
|
+
Table.HeaderCell = HeaderCell;
|