@soul-refiner/design-system 2.0.4 → 2.1.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/colors.js +1 -140
- package/dist/common/date.js +1 -34
- package/dist/common/styles.js +30 -62
- package/dist/components/actions/button/button.js +21 -111
- package/dist/components/actions/dropdown/dropdown.js +21 -176
- package/dist/components/actions/rate/rate.js +4 -55
- package/dist/components/actions/switch/switch.js +5 -39
- package/dist/components/actions/toggle/toggle.js +6 -33
- package/dist/components/actions/upload/upload.js +9 -167
- package/dist/components/atoms/box/box.js +4 -18
- package/dist/components/atoms/hide/hide.js +1 -18
- package/dist/components/atoms/seconds_to_duration/seconds_to_duration.js +1 -36
- package/dist/components/atoms/time_ago/time_ago.js +1 -39
- package/dist/components/atoms/typography/display.js +5 -18
- package/dist/components/atoms/typography/heading.js +6 -43
- package/dist/components/atoms/typography/paragraph.js +7 -20
- package/dist/components/atoms/typography/typography.js +3 -10
- package/dist/components/card/action/action.js +8 -41
- package/dist/components/card/audio/audio.js +7 -57
- package/dist/components/card/card.js +1 -33
- package/dist/components/card/feature/feature.js +14 -86
- package/dist/components/card/meeting/meeting.js +8 -102
- package/dist/components/card/person/person.js +6 -39
- package/dist/components/card/price/price.js +7 -49
- package/dist/components/card/regular/regular.js +5 -26
- package/dist/components/card/styles.js +2 -9
- package/dist/components/card/video/video.js +7 -57
- package/dist/components/card/written/written.js +7 -57
- package/dist/components/custom/courses_selection/courses_selection.js +12 -104
- package/dist/components/custom/users_selection/users_selection.js +12 -86
- package/dist/components/editor/constants.js +1 -195
- package/dist/components/editor/context.js +1 -17
- package/dist/components/editor/editor.js +5 -45
- package/dist/components/editor/icons/border-all.js +1 -12
- package/dist/components/editor/icons/border-bottom.js +1 -12
- package/dist/components/editor/icons/border-left.js +1 -12
- package/dist/components/editor/icons/border-none.js +1 -12
- package/dist/components/editor/icons/border-right.js +1 -12
- package/dist/components/editor/icons/border-top.js +1 -12
- package/dist/components/editor/navbar/alignment_dropdown.js +1 -106
- package/dist/components/editor/navbar/button_modal.js +3 -60
- package/dist/components/editor/navbar/navbar.js +7 -178
- package/dist/components/editor/navbar/style_dropdown.js +1 -74
- package/dist/components/editor/plugins/blocks/blockquote.js +1 -17
- package/dist/components/editor/plugins/blocks/blocks.js +1 -54
- package/dist/components/editor/plugins/blocks/buttons.js +8 -70
- package/dist/components/editor/plugins/blocks/dropdown-menu.js +1 -77
- package/dist/components/editor/plugins/blocks/image.js +1 -60
- package/dist/components/editor/plugins/blocks/list.js +2 -20
- package/dist/components/editor/plugins/blocks/media-popover.js +1 -41
- package/dist/components/editor/plugins/blocks/plate-button.js +1 -63
- package/dist/components/editor/plugins/blocks/popover.js +1 -38
- package/dist/components/editor/plugins/blocks/qa.js +3 -45
- package/dist/components/editor/plugins/blocks/resizable.js +1 -47
- package/dist/components/editor/plugins/blocks/separator.js +1 -43
- package/dist/components/editor/plugins/blocks/table-cell.js +1 -48
- package/dist/components/editor/plugins/blocks/table-row.js +1 -16
- package/dist/components/editor/plugins/blocks/table.js +1 -98
- package/dist/components/editor/plugins/blocks/text.js +1 -103
- package/dist/components/editor/plugins/blocks/video.js +1 -42
- package/dist/components/editor/plugins/leafs/leafs.js +1 -37
- package/dist/components/editor/plugins/leafs/link.js +4 -55
- package/dist/components/editor/plugins/marks/marks.js +1 -17
- package/dist/components/editor/plugins/plate.js +1 -43
- package/dist/components/editor/plugins/utils/exitBreak.js +1 -36
- package/dist/components/editor/plugins/utils/resetBlockType.js +1 -26
- package/dist/components/editor/plugins/utils/selectOnBackspace.js +1 -11
- package/dist/components/editor/plugins/utils/softBreak.js +1 -19
- package/dist/components/editor/plugins/utils/utils.js +1 -17
- package/dist/components/editor/simple_editor/navbar.js +4 -110
- package/dist/components/editor/simple_editor/plugins.js +1 -93
- package/dist/components/editor/simple_editor/simple_editor.js +3 -34
- package/dist/components/editor/styles/menu_button.js +3 -9
- package/dist/components/feedback/animated_toast/animated_toast.js +3 -32
- package/dist/components/feedback/badge/badge.js +7 -56
- package/dist/components/feedback/banner/banner.js +6 -60
- package/dist/components/feedback/chip/chip.js +8 -81
- package/dist/components/feedback/loader/loader.js +9 -33
- package/dist/components/feedback/notification/notification.js +6 -59
- package/dist/components/feedback/progress/progress.js +14 -76
- package/dist/components/feedback/toast/toast.js +7 -55
- package/dist/components/feedback/tooltip/tooltip.js +1 -34
- package/dist/components/iconography/avatar/avatar.js +22 -141
- package/dist/components/iconography/avatar/icons/approved.js +1 -14
- package/dist/components/iconography/avatar/icons/busy.js +1 -14
- package/dist/components/iconography/avatar/icons/declined.js +1 -14
- package/dist/components/iconography/avatar/icons/default.js +1 -13
- package/dist/components/iconography/avatar/icons/focus.js +1 -14
- package/dist/components/iconography/avatar/icons/locked.js +1 -14
- package/dist/components/iconography/avatar/icons/offline.js +1 -14
- package/dist/components/iconography/avatar/icons/online.js +1 -13
- package/dist/components/iconography/avatar/icons/subscribed.js +1 -18
- package/dist/components/iconography/icon/icon.js +3 -18
- package/dist/components/input/calendar/calendar.js +13 -139
- package/dist/components/input/checkbox/checkbox.js +5 -23
- package/dist/components/input/date/date.js +13 -241
- package/dist/components/input/filter/filter.js +13 -212
- package/dist/components/input/filter/filter_option.js +9 -50
- package/dist/components/input/radio/radio.js +7 -45
- package/dist/components/input/search/search.js +17 -83
- package/dist/components/input/select/select.js +6 -27
- package/dist/components/input/text_area/text_area.js +15 -60
- package/dist/components/input/text_input/text_input.js +21 -102
- package/dist/components/input/time/time.js +3 -47
- package/dist/components/media/video/video.js +1 -42
- package/dist/components/media/video-player/playlist-item.js +4 -37
- package/dist/components/media/video-player/video.js +13 -121
- package/dist/components/navigation/breadcrumb/breadcrumb.js +11 -66
- package/dist/components/navigation/inner/inner.js +14 -130
- package/dist/components/navigation/tabs/tabs.js +15 -101
- package/dist/components/surfaces/accordion/accordion.js +5 -46
- package/dist/components/surfaces/calendar_date/calendar_date.js +10 -39
- package/dist/components/surfaces/carousel/card/card.js +7 -55
- package/dist/components/surfaces/comment/comment.js +19 -152
- package/dist/components/surfaces/comment/helpers.js +1 -30
- package/dist/components/surfaces/drawer/drawer.js +7 -75
- package/dist/components/surfaces/message/message.js +4 -39
- package/dist/components/surfaces/modal/modal.js +8 -99
- package/dist/components/surfaces/portal/portal.js +1 -35
- package/dist/components/surfaces/post/post.js +19 -161
- package/dist/components/table/table/table.js +29 -120
- package/dist/emoji/emojis.json.js +1 -36331
- package/dist/icons/arrow/arrow_all.js +1 -15
- package/dist/icons/arrow/arrow_all_diagonal.js +1 -15
- package/dist/icons/arrow/arrow_both_downwards.js +1 -15
- package/dist/icons/arrow/arrow_both_upwards.js +1 -15
- package/dist/icons/arrow/arrow_circle_left.js +1 -15
- package/dist/icons/arrow/arrow_circle_left_double.js +1 -15
- package/dist/icons/arrow/arrow_circle_left_double_alert.js +1 -17
- package/dist/icons/arrow/arrow_circle_right.js +1 -15
- package/dist/icons/arrow/arrow_circle_right_double.js +1 -15
- package/dist/icons/arrow/arrow_circle_right_double_alert.js +1 -15
- package/dist/icons/arrow/arrow_diagonal_down_left.js +1 -15
- package/dist/icons/arrow/arrow_diagonal_down_left_circle.js +1 -15
- package/dist/icons/arrow/arrow_diagonal_down_right.js +1 -15
- package/dist/icons/arrow/arrow_diagonal_down_right_circle.js +1 -15
- package/dist/icons/arrow/arrow_diagonal_up_left.js +1 -15
- package/dist/icons/arrow/arrow_diagonal_up_left_circle.js +1 -15
- package/dist/icons/arrow/arrow_diagonal_up_right.js +1 -15
- package/dist/icons/arrow/arrow_diagonal_up_right_circle.js +1 -15
- package/dist/icons/arrow/arrow_down.js +1 -15
- package/dist/icons/arrow/arrow_down_bold.js +1 -15
- package/dist/icons/arrow/arrow_down_circle.js +1 -15
- package/dist/icons/arrow/arrow_left.js +1 -15
- package/dist/icons/arrow/arrow_left_bold.js +1 -15
- package/dist/icons/arrow/arrow_left_circle.js +1 -15
- package/dist/icons/arrow/arrow_left_curved.js +1 -15
- package/dist/icons/arrow/arrow_left_curved_circle.js +1 -15
- package/dist/icons/arrow/arrow_right.js +1 -15
- package/dist/icons/arrow/arrow_right_bold.js +1 -15
- package/dist/icons/arrow/arrow_right_circle.js +1 -15
- package/dist/icons/arrow/arrow_right_curved.js +1 -15
- package/dist/icons/arrow/arrow_right_curved_circle.js +1 -15
- package/dist/icons/arrow/arrow_up.js +1 -15
- package/dist/icons/arrow/arrow_up_bold.js +1 -15
- package/dist/icons/arrow/arrow_up_circle.js +1 -15
- package/dist/icons/arrow/chevron_down.js +1 -15
- package/dist/icons/arrow/chevron_down_circle.js +1 -15
- package/dist/icons/arrow/chevron_down_double.js +1 -15
- package/dist/icons/arrow/chevron_down_double_circle.js +1 -15
- package/dist/icons/arrow/chevron_left.js +1 -15
- package/dist/icons/arrow/chevron_left_circle.js +1 -15
- package/dist/icons/arrow/chevron_left_double.js +1 -15
- package/dist/icons/arrow/chevron_left_double_circle.js +1 -15
- package/dist/icons/arrow/chevron_right.js +1 -15
- package/dist/icons/arrow/chevron_right_circle.js +1 -15
- package/dist/icons/arrow/chevron_right_double.js +1 -15
- package/dist/icons/arrow/chevron_right_double_circle.js +1 -15
- package/dist/icons/arrow/chevron_scroll.js +1 -15
- package/dist/icons/arrow/chevron_up.js +1 -15
- package/dist/icons/arrow/chevron_up_circle.js +1 -15
- package/dist/icons/arrow/chevron_up_double.js +1 -15
- package/dist/icons/arrow/chevron_up_double_circle.js +1 -15
- package/dist/icons/arrow/forward_all.js +1 -15
- package/dist/icons/arrow/forward_all_bold.js +1 -15
- package/dist/icons/arrow/forward_bold.js +1 -15
- package/dist/icons/arrow/redo.js +1 -15
- package/dist/icons/arrow/redo_bold.js +1 -15
- package/dist/icons/arrow/reply.js +1 -15
- package/dist/icons/arrow/reply_all.js +1 -15
- package/dist/icons/arrow/reply_all_bold.js +1 -15
- package/dist/icons/arrow/reply_bold.js +1 -15
- package/dist/icons/arrow/undo.js +1 -15
- package/dist/icons/arrow/undo_bold.js +1 -15
- package/dist/icons/audio_video/drag_indicator.js +1 -15
- package/dist/icons/audio_video/eject.js +1 -15
- package/dist/icons/audio_video/equalizer.js +1 -15
- package/dist/icons/audio_video/fast_forward.js +1 -15
- package/dist/icons/audio_video/fast_forward_30.js +1 -15
- package/dist/icons/audio_video/fullscreen.js +1 -15
- package/dist/icons/audio_video/headphones.js +1 -15
- package/dist/icons/audio_video/library_add.js +1 -15
- package/dist/icons/audio_video/library_music.js +1 -15
- package/dist/icons/audio_video/microphone.js +1 -15
- package/dist/icons/audio_video/musical_note.js +1 -15
- package/dist/icons/audio_video/next.js +1 -15
- package/dist/icons/audio_video/pause.js +1 -15
- package/dist/icons/audio_video/pause_circle.js +1 -15
- package/dist/icons/audio_video/play.js +1 -15
- package/dist/icons/audio_video/play_circle.js +1 -15
- package/dist/icons/audio_video/play_display.js +1 -15
- package/dist/icons/audio_video/play_pause.js +1 -15
- package/dist/icons/audio_video/play_solid.js +1 -15
- package/dist/icons/audio_video/player_list.js +1 -15
- package/dist/icons/audio_video/player_list_add.js +1 -15
- package/dist/icons/audio_video/player_list_play.js +1 -15
- package/dist/icons/audio_video/previous.js +1 -15
- package/dist/icons/audio_video/radio.js +1 -15
- package/dist/icons/audio_video/record.js +1 -15
- package/dist/icons/audio_video/repeat.js +1 -15
- package/dist/icons/audio_video/rewind.js +1 -15
- package/dist/icons/audio_video/rewind_30.js +1 -15
- package/dist/icons/audio_video/shuffle.js +1 -15
- package/dist/icons/audio_video/sound_wave.js +1 -15
- package/dist/icons/audio_video/stop.js +1 -15
- package/dist/icons/audio_video/stop_circle.js +1 -15
- package/dist/icons/audio_video/subscriptions.js +1 -15
- package/dist/icons/audio_video/tuner.js +1 -15
- package/dist/icons/audio_video/volume.js +1 -15
- package/dist/icons/audio_video/volume_high.js +1 -15
- package/dist/icons/audio_video/volume_low.js +1 -15
- package/dist/icons/audio_video/volume_slash.js +1 -15
- package/dist/icons/basic/aa_sansserif.js +1 -16
- package/dist/icons/basic/aa_serif.js +1 -16
- package/dist/icons/basic/anchor.js +1 -17
- package/dist/icons/basic/bible.js +1 -15
- package/dist/icons/basic/bold.js +1 -15
- package/dist/icons/basic/book.js +1 -15
- package/dist/icons/basic/book_open.js +1 -15
- package/dist/icons/basic/bookmark.js +1 -15
- package/dist/icons/basic/bookmark_add.js +1 -15
- package/dist/icons/basic/bookmark_slash.js +1 -15
- package/dist/icons/basic/bookmarks.js +1 -15
- package/dist/icons/basic/books.js +1 -18
- package/dist/icons/basic/box.js +1 -15
- package/dist/icons/basic/briefcase.js +1 -15
- package/dist/icons/basic/browse_activity.js +1 -15
- package/dist/icons/basic/browser.js +1 -15
- package/dist/icons/basic/browser_slash.js +1 -15
- package/dist/icons/basic/calculator.js +1 -15
- package/dist/icons/basic/camera.js +1 -15
- package/dist/icons/basic/camera_add.js +1 -15
- package/dist/icons/basic/camera_slash.js +1 -15
- package/dist/icons/basic/checkmark.js +1 -15
- package/dist/icons/basic/checkmark_circle.js +1 -17
- package/dist/icons/basic/checkmark_filled.js +1 -15
- package/dist/icons/basic/checkmarks.js +1 -15
- package/dist/icons/basic/circle.js +1 -15
- package/dist/icons/basic/circle_slash.js +1 -17
- package/dist/icons/basic/clear_text_style.js +1 -15
- package/dist/icons/basic/close.js +1 -15
- package/dist/icons/basic/close_circle.js +1 -15
- package/dist/icons/basic/close_filled.js +1 -15
- package/dist/icons/basic/copy.js +1 -15
- package/dist/icons/basic/delete.js +1 -15
- package/dist/icons/basic/detail.js +1 -15
- package/dist/icons/basic/dot.js +1 -15
- package/dist/icons/basic/download.js +1 -15
- package/dist/icons/basic/download_arrow.js +1 -15
- package/dist/icons/basic/droplet.js +1 -17
- package/dist/icons/basic/ellipsis_horizontal.js +1 -15
- package/dist/icons/basic/ellipsis_horizontal_circle.js +1 -15
- package/dist/icons/basic/ellipsis_vertical.js +1 -15
- package/dist/icons/basic/ellipsis_vertical_circle.js +1 -15
- package/dist/icons/basic/eye.js +1 -15
- package/dist/icons/basic/eye_slash.js +1 -15
- package/dist/icons/basic/fingerprint.js +1 -15
- package/dist/icons/basic/flag.js +1 -15
- package/dist/icons/basic/flag_wave.js +1 -15
- package/dist/icons/basic/flag_wave_filled.js +1 -15
- package/dist/icons/basic/flame.js +1 -15
- package/dist/icons/basic/gauge.js +1 -15
- package/dist/icons/basic/glasses.js +1 -15
- package/dist/icons/basic/graduation_cap.js +1 -15
- package/dist/icons/basic/hashmark.js +1 -15
- package/dist/icons/basic/heart.js +1 -15
- package/dist/icons/basic/heart_slash.js +1 -15
- package/dist/icons/basic/highlighter.js +1 -15
- package/dist/icons/basic/home.js +1 -15
- package/dist/icons/basic/image.js +1 -15
- package/dist/icons/basic/inbox.js +1 -15
- package/dist/icons/basic/italic.js +1 -15
- package/dist/icons/basic/layers.js +1 -15
- package/dist/icons/basic/lightening.js +1 -15
- package/dist/icons/basic/lightening_slash.js +1 -15
- package/dist/icons/basic/link.js +1 -15
- package/dist/icons/basic/link_slash.js +1 -15
- package/dist/icons/basic/loudspeaker.js +1 -15
- package/dist/icons/basic/maximize.js +1 -15
- package/dist/icons/basic/menu.js +1 -15
- package/dist/icons/basic/menu_circle.js +1 -15
- package/dist/icons/basic/menu_dots.js +1 -15
- package/dist/icons/basic/microphone_slash.js +1 -15
- package/dist/icons/basic/minimize.js +1 -15
- package/dist/icons/basic/minus.js +1 -15
- package/dist/icons/basic/minus_circle.js +1 -15
- package/dist/icons/basic/move_item.js +1 -15
- package/dist/icons/basic/new.js +1 -15
- package/dist/icons/basic/newspaper.js +1 -15
- package/dist/icons/basic/node.js +1 -15
- package/dist/icons/basic/note_pad.js +1 -16
- package/dist/icons/basic/options.js +1 -15
- package/dist/icons/basic/paint_brush.js +1 -15
- package/dist/icons/basic/paperclip.js +1 -15
- package/dist/icons/basic/paperclip_slash.js +1 -15
- package/dist/icons/basic/pencil.js +1 -15
- package/dist/icons/basic/pencil_pad.js +1 -15
- package/dist/icons/basic/plus.js +1 -15
- package/dist/icons/basic/plus_circle.js +1 -15
- package/dist/icons/basic/presentation.js +1 -15
- package/dist/icons/basic/printer.js +1 -15
- package/dist/icons/basic/profile.js +1 -15
- package/dist/icons/basic/profile_check.js +1 -15
- package/dist/icons/basic/pulse.js +1 -15
- package/dist/icons/basic/qr_code.js +1 -15
- package/dist/icons/basic/resize.js +1 -17
- package/dist/icons/basic/scan.js +1 -15
- package/dist/icons/basic/scissors.js +1 -15
- package/dist/icons/basic/screenshot.js +1 -15
- package/dist/icons/basic/search.js +1 -15
- package/dist/icons/basic/select_item.js +1 -16
- package/dist/icons/basic/settings.js +1 -15
- package/dist/icons/basic/share.js +1 -15
- package/dist/icons/basic/share_external.js +1 -15
- package/dist/icons/basic/square.js +1 -15
- package/dist/icons/basic/star.js +1 -15
- package/dist/icons/basic/star_circle.js +1 -15
- package/dist/icons/basic/star_filled.js +1 -15
- package/dist/icons/basic/star_filled_half.js +1 -15
- package/dist/icons/basic/star_slash.js +1 -15
- package/dist/icons/basic/sticker.js +1 -15
- package/dist/icons/basic/strikethrough.js +1 -15
- package/dist/icons/basic/subtask.js +1 -16
- package/dist/icons/basic/tax.js +1 -18
- package/dist/icons/basic/text_bg_color.js +1 -15
- package/dist/icons/basic/text_color.js +1 -15
- package/dist/icons/basic/textbox.js +1 -15
- package/dist/icons/basic/thumbs_down.js +1 -15
- package/dist/icons/basic/thumbs_up.js +1 -15
- package/dist/icons/basic/thumbs_up_filled.js +1 -15
- package/dist/icons/basic/toggle_left.js +1 -15
- package/dist/icons/basic/toggle_right.js +1 -15
- package/dist/icons/basic/translate.js +1 -15
- package/dist/icons/basic/trash.js +1 -15
- package/dist/icons/basic/trash_slash.js +1 -15
- package/dist/icons/basic/underline.js +1 -15
- package/dist/icons/basic/upload.js +1 -15
- package/dist/icons/basic/video.js +1 -15
- package/dist/icons/basic/video_add.js +1 -16
- package/dist/icons/basic/video_slash.js +1 -15
- package/dist/icons/basic/wrench.js +1 -15
- package/dist/icons/basic/zoom_in.js +1 -15
- package/dist/icons/basic/zoom_out.js +1 -15
- package/dist/icons/data/bar_chart.js +1 -15
- package/dist/icons/data/bar_chart_downward.js +1 -15
- package/dist/icons/data/bar_chart_downward_outline.js +1 -15
- package/dist/icons/data/bar_chart_upward.js +1 -15
- package/dist/icons/data/bar_chart_upward_outline.js +1 -15
- package/dist/icons/data/candlestick_chart.js +1 -15
- package/dist/icons/data/four_circles.js +1 -15
- package/dist/icons/data/legend_toggle.js +1 -15
- package/dist/icons/data/line_chart.js +1 -15
- package/dist/icons/data/line_chart_area.js +1 -15
- package/dist/icons/data/line_chart_area_shaded.js +1 -15
- package/dist/icons/data/line_chart_double.js +1 -15
- package/dist/icons/data/line_chart_downward.js +1 -15
- package/dist/icons/data/line_chart_node.js +1 -15
- package/dist/icons/data/line_chart_outline.js +1 -15
- package/dist/icons/data/line_chart_search.js +1 -15
- package/dist/icons/data/line_chart_stars.js +1 -15
- package/dist/icons/data/line_chart_upward.js +1 -15
- package/dist/icons/data/pie_chart.js +1 -16
- package/dist/icons/data/tree.js +1 -15
- package/dist/icons/email/mail.js +1 -15
- package/dist/icons/email/mail_check.js +1 -15
- package/dist/icons/email/mail_minus.js +1 -15
- package/dist/icons/email/mail_send.js +1 -15
- package/dist/icons/email/send.js +1 -15
- package/dist/icons/email/send_close.js +1 -15
- package/dist/icons/email/send_schedule.js +1 -15
- package/dist/icons/email/send_text.js +1 -15
- package/dist/icons/emoji/emoji_add.js +1 -15
- package/dist/icons/emoji/laughing.js +1 -15
- package/dist/icons/emoji/neutral.js +1 -15
- package/dist/icons/emoji/sad.js +1 -15
- package/dist/icons/emoji/shocked.js +1 -15
- package/dist/icons/emoji/smile.js +1 -15
- package/dist/icons/file/clipboard.js +1 -15
- package/dist/icons/file/clipboard_check.js +1 -15
- package/dist/icons/file/clipboard_close.js +1 -15
- package/dist/icons/file/clipboard_minus.js +1 -15
- package/dist/icons/file/clipboard_plus.js +1 -15
- package/dist/icons/file/clipboard_text.js +1 -15
- package/dist/icons/file/file.js +1 -15
- package/dist/icons/file/file_add.js +1 -15
- package/dist/icons/file/file_check.js +1 -15
- package/dist/icons/file/file_close.js +1 -15
- package/dist/icons/file/file_code.js +1 -15
- package/dist/icons/file/file_download.js +1 -15
- package/dist/icons/file/file_draft.js +1 -15
- package/dist/icons/file/file_gear.js +1 -16
- package/dist/icons/file/file_minus.js +1 -15
- package/dist/icons/file/file_plus.js +1 -15
- package/dist/icons/file/file_scan.js +1 -15
- package/dist/icons/file/file_shred.js +1 -15
- package/dist/icons/file/file_text.js +1 -15
- package/dist/icons/file/file_upload.js +1 -15
- package/dist/icons/file/folder.js +1 -15
- package/dist/icons/file/folder_add.js +1 -15
- package/dist/icons/file/folder_arrow.js +1 -15
- package/dist/icons/file/folder_check.js +1 -15
- package/dist/icons/file/folder_close.js +1 -15
- package/dist/icons/file/folder_cloud.js +1 -15
- package/dist/icons/file/folder_gear.js +1 -16
- package/dist/icons/file/folder_minus.js +1 -15
- package/dist/icons/file/folder_music.js +1 -15
- package/dist/icons/file/folder_open.js +1 -15
- package/dist/icons/file/folder_plus.js +1 -15
- package/dist/icons/file/folder_zip.js +1 -15
- package/dist/icons/file/note.js +1 -15
- package/dist/icons/file/note_text.js +1 -15
- package/dist/icons/file/pdf.js +1 -15
- package/dist/icons/file/photo.js +1 -15
- package/dist/icons/finance/bitcoin.js +1 -15
- package/dist/icons/finance/coins.js +1 -19
- package/dist/icons/finance/credit_card.js +1 -15
- package/dist/icons/finance/credit_card_add.js +1 -15
- package/dist/icons/finance/credit_card_face.js +1 -15
- package/dist/icons/finance/credit_card_member.js +1 -15
- package/dist/icons/finance/credit_card_outcome.js +1 -15
- package/dist/icons/finance/credit_card_scan.js +1 -15
- package/dist/icons/finance/credit_card_share.js +1 -15
- package/dist/icons/finance/credit_card_slash.js +1 -15
- package/dist/icons/finance/currency_exchange.js +1 -15
- package/dist/icons/finance/dollar.js +1 -15
- package/dist/icons/finance/ethereum.js +1 -15
- package/dist/icons/finance/paypass.js +1 -15
- package/dist/icons/finance/strongbox.js +1 -15
- package/dist/icons/finance/wallet.js +1 -15
- package/dist/icons/index.js +1 -1095
- package/dist/icons/layout/block_align_bottom.js +1 -15
- package/dist/icons/layout/block_align_center.js +1 -15
- package/dist/icons/layout/block_align_left.js +1 -15
- package/dist/icons/layout/block_align_middle.js +1 -15
- package/dist/icons/layout/block_align_right.js +1 -15
- package/dist/icons/layout/block_align_top.js +1 -15
- package/dist/icons/layout/block_horizontal.js +1 -15
- package/dist/icons/layout/block_vertical.js +1 -15
- package/dist/icons/layout/edit_shape.js +1 -15
- package/dist/icons/layout/elements.js +1 -15
- package/dist/icons/layout/elements_add.js +1 -15
- package/dist/icons/layout/elements_filled.js +1 -15
- package/dist/icons/layout/elements_masonry.js +1 -15
- package/dist/icons/layout/frame.js +1 -15
- package/dist/icons/layout/frame_stack.js +1 -15
- package/dist/icons/layout/grid.js +1 -15
- package/dist/icons/layout/grid_column_three.js +1 -15
- package/dist/icons/layout/grid_column_two.js +1 -15
- package/dist/icons/layout/grid_dynamic.js +1 -15
- package/dist/icons/layout/grid_frame.js +1 -15
- package/dist/icons/layout/grid_row_three.js +1 -15
- package/dist/icons/layout/grid_row_two.js +1 -15
- package/dist/icons/layout/grid_six.js +1 -15
- package/dist/icons/layout/grid_small.js +1 -15
- package/dist/icons/layout/iframe.js +1 -15
- package/dist/icons/layout/kanban.js +1 -15
- package/dist/icons/layout/layout.js +1 -15
- package/dist/icons/layout/list.js +1 -15
- package/dist/icons/layout/list_filled.js +1 -20
- package/dist/icons/layout/padding.js +1 -15
- package/dist/icons/layout/page_break.js +1 -15
- package/dist/icons/layout/rotate_left.js +1 -15
- package/dist/icons/layout/rotate_right.js +1 -15
- package/dist/icons/layout/ruler.js +1 -15
- package/dist/icons/layout/segment.js +1 -15
- package/dist/icons/layout/select_area.js +1 -15
- package/dist/icons/layout/select_boundary.js +1 -15
- package/dist/icons/layout/sidebar_left.js +1 -15
- package/dist/icons/layout/sidebar_right.js +1 -15
- package/dist/icons/layout/slides.js +1 -15
- package/dist/icons/layout/slides_horizontal.js +1 -15
- package/dist/icons/layout/slides_vertical.js +1 -20
- package/dist/icons/layout/stack.js +1 -15
- package/dist/icons/layout/text.js +1 -15
- package/dist/icons/maps/atlas.js +1 -15
- package/dist/icons/maps/compass.js +1 -15
- package/dist/icons/maps/direction.js +1 -15
- package/dist/icons/maps/direction_angled.js +1 -15
- package/dist/icons/maps/globe.js +1 -15
- package/dist/icons/maps/globe_slash.js +1 -15
- package/dist/icons/maps/location.js +1 -15
- package/dist/icons/maps/location_slash.js +1 -15
- package/dist/icons/maps/map.js +1 -15
- package/dist/icons/maps/marker.js +1 -15
- package/dist/icons/maps/panorama.js +1 -15
- package/dist/icons/maps/pin.js +1 -15
- package/dist/icons/maps/pin_arrow.js +1 -15
- package/dist/icons/maps/pin_location.js +1 -15
- package/dist/icons/maps/pin_plus.js +1 -15
- package/dist/icons/maps/pin_question.js +1 -15
- package/dist/icons/maps/pin_slash.js +1 -15
- package/dist/icons/maps/push_pin.js +1 -15
- package/dist/icons/maps/push_pin_filled.js +1 -15
- package/dist/icons/maps/push_pin_slash.js +1 -15
- package/dist/icons/maps/radar.js +1 -15
- package/dist/icons/maps/route.js +1 -15
- package/dist/icons/message/bubble.js +1 -15
- package/dist/icons/message/bubble_question.js +1 -15
- package/dist/icons/message/comment.js +1 -15
- package/dist/icons/message/comment_add.js +1 -15
- package/dist/icons/message/comment_check.js +1 -15
- package/dist/icons/message/comment_close.js +1 -15
- package/dist/icons/message/comment_minus.js +1 -15
- package/dist/icons/message/comment_text.js +1 -15
- package/dist/icons/misc/advertisement.js +1 -15
- package/dist/icons/misc/atom.js +1 -15
- package/dist/icons/misc/bone.js +1 -15
- package/dist/icons/misc/brightness_high.js +1 -15
- package/dist/icons/misc/brightness_low.js +1 -15
- package/dist/icons/misc/contrast.js +1 -15
- package/dist/icons/misc/crosshairs.js +1 -15
- package/dist/icons/misc/crown.js +1 -15
- package/dist/icons/misc/footprint.js +1 -15
- package/dist/icons/misc/form.js +1 -15
- package/dist/icons/misc/funnel.js +1 -15
- package/dist/icons/misc/infinite.js +1 -15
- package/dist/icons/misc/insert_button.js +1 -15
- package/dist/icons/misc/light_bulb.js +1 -15
- package/dist/icons/misc/moon.js +1 -15
- package/dist/icons/misc/nut.js +1 -15
- package/dist/icons/misc/planet.js +1 -15
- package/dist/icons/misc/plus_thick.js +1 -15
- package/dist/icons/misc/pocket.js +1 -15
- package/dist/icons/misc/rocket.js +1 -15
- package/dist/icons/misc/soup.js +1 -19
- package/dist/icons/misc/sun.js +1 -15
- package/dist/icons/misc/toy_horse.js +1 -15
- package/dist/icons/misc/trophy.js +1 -15
- package/dist/icons/misc/watercloset.js +1 -15
- package/dist/icons/notifications/alert_circle.js +1 -15
- package/dist/icons/notifications/alert_octogon.js +1 -15
- package/dist/icons/notifications/alert_triangle.js +1 -15
- package/dist/icons/notifications/app_notification.js +1 -15
- package/dist/icons/notifications/bell.js +1 -15
- package/dist/icons/notifications/bell_alert.js +1 -15
- package/dist/icons/notifications/bell_checkmark.js +1 -15
- package/dist/icons/notifications/bell_minus.js +1 -15
- package/dist/icons/notifications/bell_plus.js +1 -15
- package/dist/icons/notifications/bell_ring.js +1 -17
- package/dist/icons/notifications/bell_slash.js +1 -15
- package/dist/icons/notifications/information.js +1 -15
- package/dist/icons/notifications/minus_octogon.js +1 -15
- package/dist/icons/notifications/question_circle.js +1 -15
- package/dist/icons/people/group.js +1 -15
- package/dist/icons/people/group_add.js +1 -15
- package/dist/icons/people/group_chat.js +1 -17
- package/dist/icons/people/group_remove.js +1 -15
- package/dist/icons/people/group_send.js +1 -16
- package/dist/icons/people/groups.js +1 -15
- package/dist/icons/people/person.js +1 -15
- package/dist/icons/people/person_add.js +1 -15
- package/dist/icons/people/person_checkmark.js +1 -15
- package/dist/icons/people/person_circle.js +1 -17
- package/dist/icons/people/person_close.js +1 -17
- package/dist/icons/people/person_remove.js +1 -15
- package/dist/icons/people/person_slash.js +1 -17
- package/dist/icons/phone/keypad.js +1 -15
- package/dist/icons/phone/phone.js +1 -15
- package/dist/icons/phone/phone_add.js +1 -15
- package/dist/icons/phone/phone_calling.js +1 -15
- package/dist/icons/phone/phone_check.js +1 -15
- package/dist/icons/phone/phone_close.js +1 -15
- package/dist/icons/phone/phone_decline.js +1 -15
- package/dist/icons/phone/phone_forwarded.js +1 -15
- package/dist/icons/phone/phone_hash.js +1 -15
- package/dist/icons/phone/phone_incoming.js +1 -15
- package/dist/icons/phone/phone_outgoing.js +1 -15
- package/dist/icons/phone/phone_pause.js +1 -15
- package/dist/icons/phone/phone_slash.js +1 -15
- package/dist/icons/phone/voicemail.js +1 -15
- package/dist/icons/security/key.js +1 -15
- package/dist/icons/security/key_slash.js +1 -15
- package/dist/icons/security/lock.js +1 -15
- package/dist/icons/security/lock_circle.js +1 -15
- package/dist/icons/security/lock_open.js +1 -15
- package/dist/icons/security/lock_slash.js +1 -15
- package/dist/icons/security/shield.js +1 -15
- package/dist/icons/security/shield_checkmark.js +1 -15
- package/dist/icons/security/shield_lock.js +1 -15
- package/dist/icons/security/shield_slash.js +1 -15
- package/dist/icons/security/verified.js +1 -15
- package/dist/icons/shopping/basket.js +1 -15
- package/dist/icons/shopping/cart.js +1 -15
- package/dist/icons/shopping/cart_filled.js +1 -15
- package/dist/icons/shopping/coupon.js +1 -15
- package/dist/icons/shopping/coupon_cut.js +1 -15
- package/dist/icons/shopping/delivery.js +1 -15
- package/dist/icons/shopping/discount.js +1 -15
- package/dist/icons/shopping/gift.js +1 -15
- package/dist/icons/shopping/gift_bag.js +1 -15
- package/dist/icons/shopping/inventory.js +1 -15
- package/dist/icons/shopping/point_of_sale.js +1 -15
- package/dist/icons/shopping/shirt.js +1 -15
- package/dist/icons/shopping/tag.js +1 -15
- package/dist/icons/shopping/tag_diagonal.js +1 -15
- package/dist/icons/shopping/tote.js +1 -15
- package/dist/icons/special/upload_audio.js +1 -20
- package/dist/icons/special/upload_file.js +1 -15
- package/dist/icons/special/upload_image.js +1 -17
- package/dist/icons/special/upload_video.js +1 -18
- package/dist/icons/symbols/at.js +1 -15
- package/dist/icons/symbols/cc.js +1 -15
- package/dist/icons/symbols/cmd.js +1 -15
- package/dist/icons/symbols/facebook.js +1 -15
- package/dist/icons/symbols/google.js +1 -18
- package/dist/icons/symbols/hash.js +1 -15
- package/dist/icons/symbols/instagram.js +1 -27
- package/dist/icons/symbols/messenger.js +1 -21
- package/dist/icons/symbols/twitter.js +1 -15
- package/dist/icons/technology/battery.js +1 -15
- package/dist/icons/technology/battery_100.js +1 -15
- package/dist/icons/technology/battery_20.js +1 -15
- package/dist/icons/technology/battery_40.js +1 -15
- package/dist/icons/technology/battery_60.js +1 -15
- package/dist/icons/technology/battery_80.js +1 -15
- package/dist/icons/technology/battery_charging.js +1 -15
- package/dist/icons/technology/battery_slash.js +1 -15
- package/dist/icons/technology/devices.js +1 -15
- package/dist/icons/technology/floppy_disk.js +1 -15
- package/dist/icons/technology/iphone.js +1 -15
- package/dist/icons/technology/laptop.js +1 -15
- package/dist/icons/technology/mobile.js +1 -15
- package/dist/icons/technology/monitor.js +1 -15
- package/dist/icons/technology/server.js +1 -15
- package/dist/icons/technology/sim_card.js +1 -15
- package/dist/icons/technology/usb_stick.js +1 -15
- package/dist/icons/text/align_center.js +1 -15
- package/dist/icons/text/align_justified.js +1 -15
- package/dist/icons/text/align_left.js +1 -15
- package/dist/icons/text/align_right.js +1 -15
- package/dist/icons/text/code_block.js +1 -15
- package/dist/icons/text/divider.js +1 -15
- package/dist/icons/text/footnote.js +1 -17
- package/dist/icons/text/indent_decrease.js +1 -15
- package/dist/icons/text/indent_increase.js +1 -15
- package/dist/icons/text/list_ordered.js +1 -15
- package/dist/icons/text/list_unordered.js +1 -15
- package/dist/icons/text/quote.js +1 -15
- package/dist/icons/text/table.js +1 -15
- package/dist/icons/time/alarm.js +1 -15
- package/dist/icons/time/alarm_checkmark.js +1 -15
- package/dist/icons/time/alarm_minus.js +1 -15
- package/dist/icons/time/alarm_plus.js +1 -15
- package/dist/icons/time/alarm_slash.js +1 -15
- package/dist/icons/time/alarm_snooze.js +1 -15
- package/dist/icons/time/calendar.js +1 -15
- package/dist/icons/time/calendar_add.js +1 -15
- package/dist/icons/time/calendar_checkmark.js +1 -15
- package/dist/icons/time/calendar_close.js +1 -15
- package/dist/icons/time/calendar_dates.js +1 -15
- package/dist/icons/time/calendar_minus.js +1 -15
- package/dist/icons/time/calendar_plus.js +1 -15
- package/dist/icons/time/calendar_scroll.js +1 -17
- package/dist/icons/time/clock.js +1 -15
- package/dist/icons/time/clock_history.js +1 -15
- package/dist/icons/time/stopwatch.js +1 -15
- package/dist/icons/time/timer.js +1 -15
- package/dist/icons/time/watch.js +1 -15
- package/dist/index.js +1 -117
- package/dist/styles/output.css +1776 -0
- package/dist/utils/date.js +1 -73
- package/dist/utils/function.js +1 -5
- package/package.json +4 -3
|
@@ -1,147 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var styled = require('styled-components');
|
|
6
|
-
var box = require('../../atoms/box/box.js');
|
|
7
|
-
var button = require('../../actions/button/button.js');
|
|
8
|
-
var paragraph = require('../../atoms/typography/paragraph.js');
|
|
9
|
-
var chevron_down = require('../../../icons/arrow/chevron_down.js');
|
|
10
|
-
var chevron_up = require('../../../icons/arrow/chevron_up.js');
|
|
11
|
-
var close = require('../../../icons/basic/close.js');
|
|
12
|
-
var styles = require('../../../common/styles.js');
|
|
13
|
-
var filter_option = require('./filter_option.js');
|
|
14
|
-
|
|
15
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
|
-
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
-
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
19
|
-
|
|
20
|
-
const Filter = ({ closeOnBlur = true, disabled, graphic, graphicAlignment = 'left', resetGraphic, label = '', sx, triggerType, options, defaultValue = '', closeOnChange = true, optionOnChange, optionShowClose, checkbox, applyOnClick, resetOnClick, applyResetActions, }) => {
|
|
21
|
-
const multiple = !!checkbox;
|
|
22
|
-
const wrapperRef = React__default.default.useRef(null);
|
|
23
|
-
const optionsRef = React__default.default.useRef(null);
|
|
24
|
-
const [open, setOpen] = React__default.default.useState(false);
|
|
25
|
-
const [selected, setSelected] = React__default.default.useState(() => defaultValue ? defaultValue : multiple ? [] : '');
|
|
26
|
-
const [filterLabel, setFilterLabel] = React__default.default.useState('');
|
|
27
|
-
React__default.default.useEffect(() => {
|
|
28
|
-
if (disabled) {
|
|
29
|
-
setOpen(false);
|
|
30
|
-
}
|
|
31
|
-
}, [disabled]);
|
|
32
|
-
React__default.default.useEffect(() => {
|
|
33
|
-
if (triggerType === 'outlined' && defaultValue === undefined) {
|
|
34
|
-
setSelected(multiple
|
|
35
|
-
? [options[0]?.value]
|
|
36
|
-
: options[0]?.value);
|
|
37
|
-
}
|
|
38
|
-
}, [triggerType, defaultValue]);
|
|
39
|
-
React__default.default.useEffect(() => {
|
|
40
|
-
if (open) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (!selected.length) {
|
|
44
|
-
setFilterLabel(label);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
// not using selected[0] since it is required to show the first
|
|
48
|
-
const firstSelected = options.find((option) => typeof option !== 'string' && isSelected(option.value));
|
|
49
|
-
if (typeof selected === 'string') {
|
|
50
|
-
setFilterLabel(firstSelected.label);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
setFilterLabel(selected.length > 1
|
|
54
|
-
? `${firstSelected.label} +${selected.length - 1}`
|
|
55
|
-
: firstSelected.label);
|
|
56
|
-
}, [selected, options, open]);
|
|
57
|
-
const handleOpen = () => {
|
|
58
|
-
if (disabled) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
setOpen((prev) => !prev);
|
|
62
|
-
};
|
|
63
|
-
const handleBlur = (event) => {
|
|
64
|
-
if (closeOnBlur &&
|
|
65
|
-
wrapperRef?.current &&
|
|
66
|
-
!wrapperRef?.current?.contains(event.relatedTarget)) {
|
|
67
|
-
setOpen(false);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const handleChangeSingle = (event) => {
|
|
71
|
-
event.stopPropagation();
|
|
72
|
-
const value = event.target.getAttribute('data-value') ?? '';
|
|
73
|
-
if (selected !== value) {
|
|
74
|
-
setSelected(value);
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
setSelected('');
|
|
78
|
-
}
|
|
79
|
-
if (closeOnChange && !applyOnClick) {
|
|
80
|
-
setOpen(false);
|
|
81
|
-
}
|
|
82
|
-
if (optionOnChange)
|
|
83
|
-
optionOnChange(event);
|
|
84
|
-
};
|
|
85
|
-
const handleChangeMultiple = (event) => {
|
|
86
|
-
event.stopPropagation();
|
|
87
|
-
const value = event.target.getAttribute('data-value') ?? '';
|
|
88
|
-
if (Array.isArray(selected) && selected.includes(value)) {
|
|
89
|
-
setSelected((prev) => prev.filter((item) => item !== value));
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
setSelected((prev) => [value, ...prev]);
|
|
93
|
-
}
|
|
94
|
-
if (closeOnChange && !applyOnClick) {
|
|
95
|
-
setOpen(false);
|
|
96
|
-
}
|
|
97
|
-
if (optionOnChange)
|
|
98
|
-
optionOnChange(event);
|
|
99
|
-
};
|
|
100
|
-
const handleChange = multiple ? handleChangeMultiple : handleChangeSingle;
|
|
101
|
-
const isSelected = (value) => multiple ? selected.includes(value) : value === selected;
|
|
102
|
-
const dropdownOptions = [
|
|
103
|
-
...options.map((option, index) => {
|
|
104
|
-
if (typeof option === 'string' && option === 'break') {
|
|
105
|
-
return React__default.default.createElement(filter_option.Spacer, { key: `${React__default.default.useId()}-spacer-${index}` });
|
|
106
|
-
}
|
|
107
|
-
return (React__default.default.createElement(filter_option.Option, { key: option.value, onClick: handleChange, selected: isSelected(option.value), checkbox: checkbox, radio: !multiple && triggerType === 'pill', showClose: optionShowClose === undefined
|
|
108
|
-
? index === 0 && triggerType === 'pill'
|
|
109
|
-
: optionShowClose, onClose: () => setOpen(false), ...option }));
|
|
110
|
-
}),
|
|
111
|
-
triggerType === 'pill' && React__default.default.createElement(filter_option.Spacer, { key: `spacer-${options.length}` }),
|
|
112
|
-
];
|
|
113
|
-
const showResetGraphic = resetGraphic &&
|
|
114
|
-
(typeof selected === 'string' ? !!selected : !!selected.length);
|
|
115
|
-
return (React__default.default.createElement(Wrapper, { "$sx": sx, tabIndex: 0, ref: wrapperRef, onBlurCapture: handleBlur },
|
|
116
|
-
React__default.default.createElement(FilterTrigger, { disabled: disabled, graphic: graphic, graphicAlignment: graphicAlignment, label: label, onClick: handleOpen, onReset: resetGraphic
|
|
117
|
-
? (event) => {
|
|
118
|
-
event.stopPropagation();
|
|
119
|
-
resetOnClick && resetOnClick(event);
|
|
120
|
-
setSelected(multiple ? [] : '');
|
|
121
|
-
setOpen(false);
|
|
122
|
-
}
|
|
123
|
-
: undefined, open: open, resetGraphic: showResetGraphic, type: triggerType, value: filterLabel }),
|
|
124
|
-
open && (React__default.default.createElement(Container, { ref: optionsRef },
|
|
125
|
-
React__default.default.createElement(React__default.default.Fragment, null,
|
|
126
|
-
dropdownOptions,
|
|
127
|
-
triggerType === 'pill' && applyResetActions && (React__default.default.createElement(box.Box, { "$display": "flex", "$dir": "row", "$align": "center", "$justify": "flex-end", "$gap": 8, sx: "margin-top: 8px; padding-right: 8px; padding-bottom: 8px" },
|
|
128
|
-
React__default.default.createElement(button.Button, { onClick: (event) => {
|
|
129
|
-
resetOnClick && resetOnClick(event);
|
|
130
|
-
setSelected(multiple ? [] : '');
|
|
131
|
-
setOpen(false);
|
|
132
|
-
}, size: "small", type: "text" }, "Reset"),
|
|
133
|
-
React__default.default.createElement(button.Button, { onClick: (event) => {
|
|
134
|
-
applyOnClick && applyOnClick(event);
|
|
135
|
-
setOpen(false);
|
|
136
|
-
}, size: "small", type: "primary" }, "Apply"))))))));
|
|
137
|
-
};
|
|
138
|
-
const Wrapper = styled__default.default.div `
|
|
2
|
+
"use strict";var React=require("react"),styled=require("styled-components"),box=require("../../atoms/box/box.js"),button=require("../../actions/button/button.js"),paragraph=require("../../atoms/typography/paragraph.js"),chevron_down=require("../../../icons/arrow/chevron_down.js"),chevron_up=require("../../../icons/arrow/chevron_up.js"),close=require("../../../icons/basic/close.js"),styles=require("../../../common/styles.js"),filter_option=require("./filter_option.js");function _interopDefaultCompat(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=_interopDefaultCompat(React),styled__default=_interopDefaultCompat(styled);const Filter=({closeOnBlur:t=!0,disabled:e,graphic:a,graphicAlignment:l="left",resetGraphic:r,label:o="",sx:n,triggerType:d,options:u,defaultValue:c="",closeOnChange:i=!0,optionOnChange:s,optionShowClose:p,checkbox:f,applyOnClick:_,resetOnClick:g,applyResetActions:v})=>{const b=!!f,y=React__default.default.useRef(null);var h=React__default.default.useRef(null);const[m,x]=React__default.default.useState(!1),[R,C]=React__default.default.useState(()=>c||(b?[]:"")),[E,k]=React__default.default.useState("");React__default.default.useEffect(()=>{e&&x(!1)},[e]),React__default.default.useEffect(()=>{"outlined"===d&&void 0===c&&C(b?[u[0]?.value]:u[0]?.value)},[d,c]),React__default.default.useEffect(()=>{var e;m||(R.length?(e=u.find(e=>"string"!=typeof e&&w(e.value)),"string"==typeof R?k(e.label):k(1<R.length?e.label+" +"+(R.length-1):e.label)):k(o))},[R,u,m]);const $=b?e=>{e.stopPropagation();const t=e.target.getAttribute("data-value")??"";Array.isArray(R)&&R.includes(t)?C(e=>e.filter(e=>e!==t)):C(e=>[t,...e]),i&&!_&&x(!1),s&&s(e)}:e=>{e.stopPropagation();var t=e.target.getAttribute("data-value")??"";R!==t?C(t):C(""),i&&!_&&x(!1),s&&s(e)},w=e=>b?R.includes(e):e===R;var P=[...u.map((e,t)=>"string"==typeof e&&"break"===e?React__default.default.createElement(filter_option.Spacer,{key:React__default.default.useId()+"-spacer-"+t}):React__default.default.createElement(filter_option.Option,{key:e.value,onClick:$,selected:w(e.value),checkbox:f,radio:!b&&"pill"===d,showClose:void 0===p?0===t&&"pill"===d:p,onClose:()=>x(!1),...e})),"pill"===d&&React__default.default.createElement(filter_option.Spacer,{key:"spacer-"+u.length})],S=r&&("string"==typeof R?!!R:!!R.length);return React__default.default.createElement(Wrapper,{$sx:n,tabIndex:0,ref:y,onBlurCapture:e=>{t&&y?.current&&!y?.current?.contains(e.relatedTarget)&&x(!1)}},React__default.default.createElement(FilterTrigger,{disabled:e,graphic:a,graphicAlignment:l,label:o,onClick:()=>{e||x(e=>!e)},onReset:r?e=>{e.stopPropagation(),g&&g(e),C(b?[]:""),x(!1)}:void 0,open:m,resetGraphic:S,type:d,value:E}),m&&React__default.default.createElement(Container,{ref:h},React__default.default.createElement(React__default.default.Fragment,null,P,"pill"===d&&v&&React__default.default.createElement(box.Box,{$display:"flex",$dir:"row",$align:"center",$justify:"flex-end",$gap:8,sx:"margin-top: 8px; padding-right: 8px; padding-bottom: 8px"},React__default.default.createElement(button.Button,{onClick:e=>{g&&g(e),C(b?[]:""),x(!1)},size:"small",type:"text"},"Reset"),React__default.default.createElement(button.Button,{onClick:e=>{_&&_(e),x(!1)},size:"small",type:"primary"},"Apply")))))},Wrapper=styled__default.default.div`
|
|
139
3
|
position: relative;
|
|
140
4
|
display: block;
|
|
141
5
|
outline: none;
|
|
142
|
-
${({
|
|
143
|
-
|
|
144
|
-
const Container = styled__default.default.div `
|
|
6
|
+
${({$sx:e})=>e||""}
|
|
7
|
+
`,Container=styled__default.default.div`
|
|
145
8
|
position: absolute;
|
|
146
9
|
width: max-content;
|
|
147
10
|
z-index: 100;
|
|
@@ -158,59 +21,7 @@ const Container = styled__default.default.div `
|
|
|
158
21
|
& > div:last-of-type {
|
|
159
22
|
border-radius: 0px 0px 8px 8px;
|
|
160
23
|
}
|
|
161
|
-
|
|
162
|
-
/********************************************************
|
|
163
|
-
* Triggers
|
|
164
|
-
*/
|
|
165
|
-
const textProps = {
|
|
166
|
-
as: 'span',
|
|
167
|
-
$fontSize: 14,
|
|
168
|
-
$lineHeight: 20,
|
|
169
|
-
};
|
|
170
|
-
const wrapperProps = {
|
|
171
|
-
$align: 'center',
|
|
172
|
-
$dir: 'row',
|
|
173
|
-
$gap: 16,
|
|
174
|
-
};
|
|
175
|
-
const FilterTrigger = ({ disabled, graphic, graphicAlignment, label, onClick, resetGraphic, open, onReset, type, value, }) => {
|
|
176
|
-
if (type === 'pill') {
|
|
177
|
-
return (React__default.default.createElement(Pill, { disabled: disabled, onClick: onClick, "$labelIsDefault": value === label, ...wrapperProps },
|
|
178
|
-
graphicAlignment === 'left' ? graphic : null,
|
|
179
|
-
React__default.default.createElement(paragraph.P, { ...textProps }, value),
|
|
180
|
-
resetGraphic ? React__default.default.createElement(close.Close, { color: "blue-3", onClick: onReset }) : null,
|
|
181
|
-
graphicAlignment === 'right' ? graphic : null,
|
|
182
|
-
!graphic && !resetGraphic && (open ? React__default.default.createElement(chevron_up.ChevronUp, null) : React__default.default.createElement(chevron_down.ChevronDown, null))));
|
|
183
|
-
}
|
|
184
|
-
if (type === 'labeled') {
|
|
185
|
-
return (React__default.default.createElement(Labeled, { disabled: disabled, onClick: onClick, ...wrapperProps },
|
|
186
|
-
React__default.default.createElement(paragraph.P, { ...textProps }, label),
|
|
187
|
-
React__default.default.createElement(LabelSeparator, null),
|
|
188
|
-
React__default.default.createElement(paragraph.P, { "$color": "primary-blue-2", "$mediumBold": true, ...textProps }, value),
|
|
189
|
-
open ? React__default.default.createElement(chevron_up.ChevronUp, null) : React__default.default.createElement(chevron_down.ChevronDown, null)));
|
|
190
|
-
}
|
|
191
|
-
if (type === 'avatar') {
|
|
192
|
-
return (React__default.default.createElement(Avatar, { "$align": "center", "$dir": "row", "$gap": 8, disabled: disabled, onClick: onClick },
|
|
193
|
-
graphic,
|
|
194
|
-
open ? React__default.default.createElement(chevron_up.ChevronUp, null) : React__default.default.createElement(chevron_down.ChevronDown, null)));
|
|
195
|
-
}
|
|
196
|
-
if (type === 'text') {
|
|
197
|
-
return (React__default.default.createElement(Text, { disabled: disabled, onClick: onClick, ...wrapperProps },
|
|
198
|
-
React__default.default.createElement(paragraph.P, { "$color": "grey-4", "$semiBold": true, ...textProps },
|
|
199
|
-
label,
|
|
200
|
-
":"),
|
|
201
|
-
React__default.default.createElement(paragraph.P, { "$color": "primary-blue-2", "$semiBold": true, className: "filter-trigger-value", ...textProps }, value),
|
|
202
|
-
open ? React__default.default.createElement(chevron_up.ChevronUp, null) : React__default.default.createElement(chevron_down.ChevronDown, null)));
|
|
203
|
-
}
|
|
204
|
-
return (React__default.default.createElement(Outlined, { disabled: disabled, onClick: onClick, ...wrapperProps },
|
|
205
|
-
graphicAlignment === 'left' ? graphic : null,
|
|
206
|
-
graphic,
|
|
207
|
-
React__default.default.createElement(paragraph.P, { ...textProps }, value),
|
|
208
|
-
graphicAlignment === 'right' ? graphic : null,
|
|
209
|
-
!graphic && (open ? React__default.default.createElement(chevron_up.ChevronUp, null) : React__default.default.createElement(chevron_down.ChevronDown, null))));
|
|
210
|
-
};
|
|
211
|
-
Filter.Trigger = FilterTrigger;
|
|
212
|
-
FilterTrigger.displayName = 'Filter.Trigger';
|
|
213
|
-
const sharedStyles = styled.css `
|
|
24
|
+
`,textProps={as:"span",$fontSize:14,$lineHeight:20},wrapperProps={$align:"center",$dir:"row",$gap:16},FilterTrigger=({disabled:e,graphic:t,graphicAlignment:a,label:l,onClick:r,resetGraphic:o,open:n,onReset:d,type:u,value:c})=>"pill"===u?React__default.default.createElement(Pill,{disabled:e,onClick:r,$labelIsDefault:c===l,...wrapperProps},"left"===a?t:null,React__default.default.createElement(paragraph.P,{...textProps},c),o?React__default.default.createElement(close.Close,{color:"blue-3",onClick:d}):null,"right"===a?t:null,!t&&!o&&(n?React__default.default.createElement(chevron_up.ChevronUp,null):React__default.default.createElement(chevron_down.ChevronDown,null))):"labeled"===u?React__default.default.createElement(Labeled,{disabled:e,onClick:r,...wrapperProps},React__default.default.createElement(paragraph.P,{...textProps},l),React__default.default.createElement(LabelSeparator,null),React__default.default.createElement(paragraph.P,{$color:"primary-blue-2",$mediumBold:!0,...textProps},c),n?React__default.default.createElement(chevron_up.ChevronUp,null):React__default.default.createElement(chevron_down.ChevronDown,null)):"avatar"===u?React__default.default.createElement(Avatar,{$align:"center",$dir:"row",$gap:8,disabled:e,onClick:r},t,n?React__default.default.createElement(chevron_up.ChevronUp,null):React__default.default.createElement(chevron_down.ChevronDown,null)):"text"===u?React__default.default.createElement(Text,{disabled:e,onClick:r,...wrapperProps},React__default.default.createElement(paragraph.P,{$color:"grey-4",$semiBold:!0,...textProps},l,":"),React__default.default.createElement(paragraph.P,{$color:"primary-blue-2",$semiBold:!0,className:"filter-trigger-value",...textProps},c),n?React__default.default.createElement(chevron_up.ChevronUp,null):React__default.default.createElement(chevron_down.ChevronDown,null)):React__default.default.createElement(Outlined,{disabled:e,onClick:r,...wrapperProps},"left"===a?t:null,t,React__default.default.createElement(paragraph.P,{...textProps},c),"right"===a?t:null,!t&&(n?React__default.default.createElement(chevron_up.ChevronUp,null):React__default.default.createElement(chevron_down.ChevronDown,null))),sharedStyles=((Filter.Trigger=FilterTrigger).displayName="Filter.Trigger",styled.css`
|
|
214
25
|
display: flex;
|
|
215
26
|
padding: 10px 16px;
|
|
216
27
|
border: none;
|
|
@@ -228,8 +39,7 @@ const sharedStyles = styled.css `
|
|
|
228
39
|
fill: var(--color-grey-7);
|
|
229
40
|
}
|
|
230
41
|
}
|
|
231
|
-
|
|
232
|
-
const Outlined = styled__default.default.button `
|
|
42
|
+
`),Outlined=styled__default.default.button`
|
|
233
43
|
${sharedStyles}
|
|
234
44
|
${styles.Styles.flex}
|
|
235
45
|
border: 1px solid var(--color-grey-8);
|
|
@@ -240,8 +50,7 @@ const Outlined = styled__default.default.button `
|
|
|
240
50
|
&:hover {
|
|
241
51
|
background-color: var(--color-grey-9);
|
|
242
52
|
}
|
|
243
|
-
|
|
244
|
-
const Pill = styled__default.default.button `
|
|
53
|
+
`,Pill=styled__default.default.button`
|
|
245
54
|
${sharedStyles}
|
|
246
55
|
${styles.Styles.flex}
|
|
247
56
|
border: 1px solid var(--color-grey-8);
|
|
@@ -249,8 +58,7 @@ const Pill = styled__default.default.button `
|
|
|
249
58
|
background-color: var(--color-white);
|
|
250
59
|
font-family: var(--font-inter);
|
|
251
60
|
|
|
252
|
-
${({
|
|
253
|
-
? `
|
|
61
|
+
${({$labelIsDefault:e})=>e?"":`
|
|
254
62
|
& > * {
|
|
255
63
|
color: var(--color-primary-blue-2);
|
|
256
64
|
fill: currentColor;
|
|
@@ -264,10 +72,8 @@ const Pill = styled__default.default.button `
|
|
|
264
72
|
&:hover {
|
|
265
73
|
background-color: var(--color-primary-blue-4);
|
|
266
74
|
}
|
|
267
|
-
`
|
|
268
|
-
|
|
269
|
-
`;
|
|
270
|
-
const Labeled = styled__default.default.button `
|
|
75
|
+
`}
|
|
76
|
+
`,Labeled=styled__default.default.button`
|
|
271
77
|
${sharedStyles}
|
|
272
78
|
${styles.Styles.flex}
|
|
273
79
|
border-radius: 24px;
|
|
@@ -278,13 +84,11 @@ const Labeled = styled__default.default.button `
|
|
|
278
84
|
&:hover {
|
|
279
85
|
background-color: var(--color-grey-9);
|
|
280
86
|
}
|
|
281
|
-
|
|
282
|
-
const LabelSeparator = styled__default.default.div `
|
|
87
|
+
`,LabelSeparator=styled__default.default.div`
|
|
283
88
|
width: 1px;
|
|
284
89
|
height: 20px;
|
|
285
90
|
background-color: var(--color-grey-8);
|
|
286
|
-
|
|
287
|
-
const Avatar = styled__default.default.button `
|
|
91
|
+
`,Avatar=styled__default.default.button`
|
|
288
92
|
${sharedStyles}
|
|
289
93
|
${styles.Styles.flex}
|
|
290
94
|
padding: 4px 16px;
|
|
@@ -304,8 +108,7 @@ const Avatar = styled__default.default.button `
|
|
|
304
108
|
opacity: 0.5;
|
|
305
109
|
}
|
|
306
110
|
}
|
|
307
|
-
|
|
308
|
-
const Text = styled__default.default.button `
|
|
111
|
+
`,Text=styled__default.default.button`
|
|
309
112
|
${sharedStyles}
|
|
310
113
|
${styles.Styles.flex}
|
|
311
114
|
gap: 8px;
|
|
@@ -327,6 +130,4 @@ const Text = styled__default.default.button `
|
|
|
327
130
|
background-color: transparent;
|
|
328
131
|
border: 1px solid transparent;
|
|
329
132
|
}
|
|
330
|
-
`;
|
|
331
|
-
|
|
332
|
-
exports.Filter = Filter;
|
|
133
|
+
`;exports.Filter=Filter;
|
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var styled = require('styled-components');
|
|
6
|
-
var box = require('../../atoms/box/box.js');
|
|
7
|
-
var paragraph = require('../../atoms/typography/paragraph.js');
|
|
8
|
-
var checkbox = require('../checkbox/checkbox.js');
|
|
9
|
-
var radio = require('../radio/radio.js');
|
|
10
|
-
var close = require('../../../icons/basic/close.js');
|
|
11
|
-
|
|
12
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
-
|
|
14
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
|
-
|
|
16
|
-
const Option = ({ label, onClick, selected, sx, value, checkbox: checkbox$1, radio: radio$1 = false, showClose = false, onClose, }) => {
|
|
17
|
-
return (React__default.default.createElement(OptionWrapper, { "data-value": value, onClick: onClick, "$selected": selected, "$sx": sx, "$hasCheckbox": !!checkbox$1 },
|
|
18
|
-
checkbox$1 && React__default.default.createElement(checkbox.Checkbox, { selected: selected }),
|
|
19
|
-
radio$1 && React__default.default.createElement(radio.Radio, { checked: selected, value: value }),
|
|
20
|
-
React__default.default.createElement(box.Box, { "$dir": "column", "$display": "flex" }, label && (React__default.default.createElement(paragraph.P, { "$color": "grey-4", "$fontSize": 14, "$lineHeight": 20, "$mediumBold": true, "$textClampLines": 1 }, label))),
|
|
21
|
-
showClose && (React__default.default.createElement(close.Close, { sx: "margin-left: auto; pointer-events: auto !important;", size: 16, onClick: (event) => {
|
|
22
|
-
event.stopPropagation();
|
|
23
|
-
onClose && onClose();
|
|
24
|
-
} }))));
|
|
25
|
-
};
|
|
26
|
-
Option.displayName = 'Filter.Option';
|
|
27
|
-
const OptionWrapper = styled.styled.div `
|
|
2
|
+
"use strict";var React=require("react"),styled=require("styled-components"),box=require("../../atoms/box/box.js"),paragraph=require("../../atoms/typography/paragraph.js"),checkbox=require("../checkbox/checkbox.js"),radio=require("../radio/radio.js"),close=require("../../../icons/basic/close.js");function _interopDefaultCompat(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=_interopDefaultCompat(React);const Option=({label:e,onClick:a,selected:t,sx:r,value:o,checkbox:c,radio:l=!1,showClose:i=!1,onClose:n})=>React__default.default.createElement(OptionWrapper,{"data-value":o,onClick:a,$selected:t,$sx:r,$hasCheckbox:!!c},c&&React__default.default.createElement(checkbox.Checkbox,{selected:t}),l&&React__default.default.createElement(radio.Radio,{checked:t,value:o}),React__default.default.createElement(box.Box,{$dir:"column",$display:"flex"},e&&React__default.default.createElement(paragraph.P,{$color:"grey-4",$fontSize:14,$lineHeight:20,$mediumBold:!0,$textClampLines:1},e)),i&&React__default.default.createElement(close.Close,{sx:"margin-left: auto; pointer-events: auto !important;",size:16,onClick:e=>{e.stopPropagation(),n&&n()}})),OptionWrapper=(Option.displayName="Filter.Option",styled.styled.div`
|
|
28
3
|
position: relative;
|
|
29
4
|
z-index: 1;
|
|
30
5
|
padding: 12px 16px;
|
|
@@ -38,20 +13,13 @@ const OptionWrapper = styled.styled.div `
|
|
|
38
13
|
pointer-events: none;
|
|
39
14
|
}
|
|
40
15
|
|
|
41
|
-
${({
|
|
42
|
-
if ($selected) {
|
|
43
|
-
return `
|
|
16
|
+
${({$selected:e,$hasCheckbox:a})=>e?`
|
|
44
17
|
background-color: var(--color-grey-9);
|
|
45
18
|
&:active {
|
|
46
19
|
background-color: var(--color-grey-8);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if ($hasCheckbox) {
|
|
50
|
-
return `&:hover {
|
|
20
|
+
}`:a?`&:hover {
|
|
51
21
|
background-color: var(--color-grey-10);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return `
|
|
22
|
+
}`:`
|
|
55
23
|
&:hover {
|
|
56
24
|
background-color: var(--color-grey-10);
|
|
57
25
|
}
|
|
@@ -59,15 +27,9 @@ const OptionWrapper = styled.styled.div `
|
|
|
59
27
|
&:active {
|
|
60
28
|
background-color: var(--color-grey-8);
|
|
61
29
|
}
|
|
62
|
-
|
|
63
|
-
}}
|
|
64
|
-
|
|
65
|
-
`;
|
|
66
|
-
const Spacer = ({ sx }) => {
|
|
67
|
-
return React__default.default.createElement(SpacerWrapper, { "$sx": sx });
|
|
68
|
-
};
|
|
69
|
-
Spacer.displayName = 'Filter.Spacer';
|
|
70
|
-
const SpacerWrapper = styled.styled.div `
|
|
30
|
+
`}
|
|
31
|
+
${({$sx:e})=>e||""}
|
|
32
|
+
`),Spacer=({sx:e})=>React__default.default.createElement(SpacerWrapper,{$sx:e}),SpacerWrapper=(Spacer.displayName="Filter.Spacer",styled.styled.div`
|
|
71
33
|
width: 100%;
|
|
72
34
|
height: 1px;
|
|
73
35
|
background-color: var(--color-grey-8);
|
|
@@ -75,8 +37,5 @@ const SpacerWrapper = styled.styled.div `
|
|
|
75
37
|
&:hover {
|
|
76
38
|
appearance: none;
|
|
77
39
|
}
|
|
78
|
-
${({
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
exports.Option = Option;
|
|
82
|
-
exports.Spacer = Spacer;
|
|
40
|
+
${({$sx:e})=>e||""}
|
|
41
|
+
`);exports.Option=Option,exports.Spacer=Spacer;
|
|
@@ -1,51 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var styled = require('styled-components');
|
|
6
|
-
var box = require('../../atoms/box/box.js');
|
|
7
|
-
var paragraph = require('../../atoms/typography/paragraph.js');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
|
-
|
|
13
|
-
const Radio = ({ checked = false, disabled, label, onClick, reversed, sx, value, ...rest }) => {
|
|
14
|
-
const handleInputClick = (event) => {
|
|
15
|
-
event.stopPropagation();
|
|
16
|
-
onClick && onClick(event);
|
|
17
|
-
};
|
|
18
|
-
const handleLabelClick = (event) => {
|
|
19
|
-
event.stopPropagation();
|
|
20
|
-
event.preventDefault();
|
|
21
|
-
onClick && onClick(event);
|
|
22
|
-
};
|
|
23
|
-
return (React__default.default.createElement(Label, { "$disabled": disabled, "$reversed": reversed, "$sx": sx, onClick: handleLabelClick },
|
|
24
|
-
React__default.default.createElement(Input, { checked: checked, onClickCapture: handleInputClick, disabled: disabled, type: "radio", value: value, ...rest }),
|
|
25
|
-
React__default.default.createElement(paragraph.P, { as: "span" }, label)));
|
|
26
|
-
};
|
|
27
|
-
const Label = styled.styled.label `
|
|
2
|
+
"use strict";var React=require("react"),styled=require("styled-components"),box=require("../../atoms/box/box.js"),paragraph=require("../../atoms/typography/paragraph.js");function _interopDefaultCompat(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=_interopDefaultCompat(React);const Radio=({checked:e=!1,disabled:r,label:a,onClick:t,reversed:o,sx:l,value:d,...i})=>{return React__default.default.createElement(Label,{$disabled:r,$reversed:o,$sx:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),t&&t(e)}},React__default.default.createElement(Input,{checked:e,onClickCapture:e=>{e.stopPropagation(),t&&t(e)},disabled:r,type:"radio",value:d,...i}),React__default.default.createElement(paragraph.P,{as:"span"},a))},Label=styled.styled.label`
|
|
28
3
|
display: flex;
|
|
29
4
|
align-items: center;
|
|
30
5
|
gap: 8px;
|
|
31
6
|
user-select: none;
|
|
32
7
|
|
|
33
|
-
${({
|
|
34
|
-
? `
|
|
8
|
+
${({$disabled:e})=>e?`
|
|
35
9
|
& > * {
|
|
36
10
|
color: var(--color-grey-7);
|
|
37
|
-
}
|
|
38
|
-
: `
|
|
11
|
+
}`:`
|
|
39
12
|
cursor: pointer;
|
|
40
13
|
&:hover {
|
|
41
14
|
input {
|
|
42
15
|
border-color: var(--color-primary-blue-2);
|
|
43
16
|
}
|
|
44
17
|
}`}
|
|
45
|
-
flex-direction: ${({
|
|
46
|
-
${({
|
|
47
|
-
|
|
48
|
-
const Input = styled.styled.input `
|
|
18
|
+
flex-direction: ${({$reversed:e})=>e?"row-reverse":"row"};
|
|
19
|
+
${({$sx:e})=>e||""}
|
|
20
|
+
`,Input=styled.styled.input`
|
|
49
21
|
appearance: none;
|
|
50
22
|
position: relative;
|
|
51
23
|
height: 20px;
|
|
@@ -79,14 +51,4 @@ const Input = styled.styled.input `
|
|
|
79
51
|
}
|
|
80
52
|
}
|
|
81
53
|
}
|
|
82
|
-
|
|
83
|
-
const RadioGroup = ({ children, name, ...rest }) => {
|
|
84
|
-
return (React__default.default.createElement(box.Box, { ...rest }, React__default.default.Children.map(children, (child) => {
|
|
85
|
-
if (React__default.default.isValidElement(child))
|
|
86
|
-
return React__default.default.createElement(Radio, { key: child.key, name: name, ...child.props });
|
|
87
|
-
})));
|
|
88
|
-
};
|
|
89
|
-
Radio.Group = RadioGroup;
|
|
90
|
-
RadioGroup.displayName = 'Radio.Group';
|
|
91
|
-
|
|
92
|
-
exports.Radio = Radio;
|
|
54
|
+
`,RadioGroup=({children:e,name:r,...a})=>React__default.default.createElement(box.Box,{...a},React__default.default.Children.map(e,e=>{if(React__default.default.isValidElement(e))return React__default.default.createElement(Radio,{key:e.key,name:r,...e.props})}));(Radio.Group=RadioGroup).displayName="Radio.Group",exports.Radio=Radio;
|
|
@@ -1,61 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var styled = require('styled-components');
|
|
6
|
-
var styles = require('../../../common/styles.js');
|
|
7
|
-
var close = require('../../../icons/basic/close.js');
|
|
8
|
-
var search = require('../../../icons/basic/search.js');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
|
-
|
|
14
|
-
const Search = ({ dropdownFilter, onChange, onClearText, onSubmit, placeholder, size, sx, value, }) => {
|
|
15
|
-
const [expanded, setExpanded] = React__default.default.useState(false);
|
|
16
|
-
const [focused, setFocused] = React__default.default.useState(false);
|
|
17
|
-
const inputRef = React__default.default.useRef(null);
|
|
18
|
-
const isCollapsed = !expanded && size === 'collapsed';
|
|
19
|
-
const iconSize = isCollapsed || size === 'large' ? 24 : 16;
|
|
20
|
-
const handleExpand = () => {
|
|
21
|
-
setExpanded(true);
|
|
22
|
-
inputRef?.current?.focus();
|
|
23
|
-
};
|
|
24
|
-
const handleCollapse = () => {
|
|
25
|
-
setExpanded(false);
|
|
26
|
-
setFocused(false);
|
|
27
|
-
inputRef?.current?.blur();
|
|
28
|
-
};
|
|
29
|
-
const handleFocus = () => {
|
|
30
|
-
inputRef?.current?.focus();
|
|
31
|
-
};
|
|
32
|
-
return (React__default.default.createElement(Wrapper, { "$align": "center", "$dir": "row", "$isCollapsed": isCollapsed, "$isFocused": focused, "$borderRadius": "large", "$size": size, "$sx": sx, onClick: dropdownFilter && size === 'large'
|
|
33
|
-
? undefined
|
|
34
|
-
: isCollapsed
|
|
35
|
-
? handleExpand
|
|
36
|
-
: handleFocus },
|
|
37
|
-
React__default.default.createElement(search.Search, { color: size === 'large' ? 'blue-7' : 'grey-3', size: iconSize, onClick: isCollapsed ? undefined : handleCollapse, sx: isCollapsed || size !== 'collapsed'
|
|
38
|
-
? undefined
|
|
39
|
-
: `
|
|
2
|
+
"use strict";var React=require("react"),styled=require("styled-components"),styles=require("../../../common/styles.js"),close=require("../../../icons/basic/close.js"),search=require("../../../icons/basic/search.js");function _interopDefaultCompat(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var React__default=_interopDefaultCompat(React);const Search=({dropdownFilter:e,onChange:r,onClearText:o,onSubmit:a,placeholder:l,size:t,sx:d,value:s})=>{const[i,c]=React__default.default.useState(!1),[n,p]=React__default.default.useState(!1),u=React__default.default.useRef(null);var g=!i&&"collapsed"===t,x=g||"large"===t?24:16;return React__default.default.createElement(Wrapper,{$align:"center",$dir:"row",$isCollapsed:g,$isFocused:n,$borderRadius:"large",$size:t,$sx:d,onClick:e&&"large"===t?void 0:g?()=>{c(!0),u?.current?.focus()}:()=>{u?.current?.focus()}},React__default.default.createElement(search.Search,{color:"large"===t?"blue-7":"grey-3",size:x,onClick:g?void 0:()=>{c(!1),p(!1),u?.current?.blur()},sx:g||"collapsed"!==t?void 0:`
|
|
40
3
|
&:hover {
|
|
41
4
|
cursor: pointer;
|
|
42
5
|
background-color: var(--color-grey-10);
|
|
43
6
|
border-radius: 50%;
|
|
44
|
-
}`
|
|
45
|
-
|
|
46
|
-
!isCollapsed && onClearText && (React__default.default.createElement(close.Close, { size: 16, onClick: onClearText, sx: `
|
|
47
|
-
${value.length === 0 ? 'visibility: hidden;' : ''}
|
|
7
|
+
}`}),React__default.default.createElement(Input,{$isCollapsed:g,onBlur:()=>p(!1),onChange:r,onFocus:()=>p(!0),onSubmit:a,placeholder:l,ref:u,value:s}),!g&&o&&React__default.default.createElement(close.Close,{size:16,onClick:o,sx:`
|
|
8
|
+
${0===s.length?"visibility: hidden;":""}
|
|
48
9
|
padding: 4px;
|
|
49
10
|
&:hover {
|
|
50
11
|
cursor: pointer;
|
|
51
12
|
background-color: var(--color-grey-10);
|
|
52
13
|
border-radius: 50%;
|
|
53
|
-
}`
|
|
54
|
-
size === 'large' && dropdownFilter && (React__default.default.createElement(React__default.default.Fragment, null,
|
|
55
|
-
React__default.default.createElement(Separator, null),
|
|
56
|
-
dropdownFilter))));
|
|
57
|
-
};
|
|
58
|
-
const Wrapper = styled.styled.div `
|
|
14
|
+
}`}),"large"===t&&e&&React__default.default.createElement(React__default.default.Fragment,null,React__default.default.createElement(Separator,null),e))},Wrapper=styled.styled.div`
|
|
59
15
|
${styles.Styles.flex}
|
|
60
16
|
${styles.Styles.padding}
|
|
61
17
|
display: flex;
|
|
@@ -67,65 +23,48 @@ const Wrapper = styled.styled.div `
|
|
|
67
23
|
flex-shrink: 0;
|
|
68
24
|
}
|
|
69
25
|
|
|
70
|
-
${({
|
|
71
|
-
? `
|
|
26
|
+
${({$isCollapsed:e,$size:r})=>e?`
|
|
72
27
|
padding: 12px;
|
|
73
28
|
border-radius: 50%;
|
|
74
29
|
&:hover {
|
|
75
30
|
background-color: var(--color-grey-10);
|
|
76
31
|
cursor: pointer;
|
|
77
|
-
}
|
|
78
|
-
: `
|
|
32
|
+
}`:`
|
|
79
33
|
border-radius: 8px;
|
|
80
|
-
|
|
81
|
-
? // collapsed
|
|
82
|
-
`
|
|
34
|
+
`+("collapsed"===r?`
|
|
83
35
|
gap: 8px;
|
|
84
36
|
padding: 10px 16px;
|
|
85
37
|
border: 1px solid var(--color-grey-8);
|
|
86
38
|
|
|
87
39
|
&:hover {
|
|
88
40
|
border: 1px solid var(--color-grey-6);
|
|
89
|
-
}
|
|
90
|
-
: $size === 'small'
|
|
91
|
-
? // small
|
|
92
|
-
`
|
|
41
|
+
}`:"small"===r?`
|
|
93
42
|
gap: 12px;
|
|
94
43
|
padding: 10px 16px;
|
|
95
44
|
border: 1px solid var(--color-grey-8);
|
|
96
45
|
|
|
97
46
|
&:hover {
|
|
98
47
|
border: 1px solid var(--color-grey-6);
|
|
99
|
-
}
|
|
100
|
-
: $size === 'medium'
|
|
101
|
-
? // medium
|
|
102
|
-
`
|
|
48
|
+
}`:"medium"===r?`
|
|
103
49
|
gap: 12px;
|
|
104
50
|
padding: 14px 16px;
|
|
105
51
|
border: 1px solid var(--color-grey-8);
|
|
106
52
|
|
|
107
53
|
&:hover {
|
|
108
54
|
border: 1px solid var(--color-grey-6);
|
|
109
|
-
}
|
|
110
|
-
: // large
|
|
111
|
-
`
|
|
55
|
+
}`:`
|
|
112
56
|
gap: 16px;
|
|
113
57
|
padding: 16px;
|
|
114
58
|
box-shadow: var(--elevation-1);
|
|
115
59
|
|
|
116
60
|
&:hover {
|
|
117
61
|
border: 1px solid var(--color-grey-6);
|
|
118
|
-
}`}
|
|
62
|
+
}`)}
|
|
119
63
|
|
|
120
|
-
${({
|
|
121
|
-
? 'border: 1px solid var(--color-primary-blue-2) !important;'
|
|
122
|
-
: ''}
|
|
64
|
+
${({$isFocused:e,$isCollapsed:r})=>e&&!r?"border: 1px solid var(--color-primary-blue-2) !important;":""}
|
|
123
65
|
|
|
124
|
-
${({
|
|
125
|
-
|
|
126
|
-
const Input = styled.styled.input.attrs(({ ref }) => ({
|
|
127
|
-
ref: ref,
|
|
128
|
-
})) `
|
|
66
|
+
${({$sx:e})=>e||""}
|
|
67
|
+
`,Input=styled.styled.input.attrs(({ref:e})=>({ref:e}))`
|
|
129
68
|
flex: 1;
|
|
130
69
|
border-radius: 8px;
|
|
131
70
|
outline: none;
|
|
@@ -135,14 +74,9 @@ const Input = styled.styled.input.attrs(({ ref }) => ({
|
|
|
135
74
|
line-height: 20px;
|
|
136
75
|
color: var(--color-grey-2);
|
|
137
76
|
|
|
138
|
-
${({
|
|
139
|
-
|
|
140
|
-
: ''}
|
|
141
|
-
`;
|
|
142
|
-
const Separator = styled.styled.div `
|
|
77
|
+
${({$isCollapsed:e})=>e?"width: 0px; height: 0px; padding: 0px !important; border: none !important;":""}
|
|
78
|
+
`,Separator=styled.styled.div`
|
|
143
79
|
width: 1px;
|
|
144
80
|
height: 20px;
|
|
145
81
|
background-color: var(--color-grey-9);
|
|
146
|
-
`;
|
|
147
|
-
|
|
148
|
-
exports.Search = Search;
|
|
82
|
+
`;exports.Search=Search;
|