@tcn/ui 0.0.3 → 0.1.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/actions/button/base_button/base_button.d.ts.map +1 -1
- package/dist/actions/button/base_button/base_button.js +20 -15
- package/dist/actions/button/base_button/base_button.js.map +1 -1
- package/dist/actions/button/button/button.d.ts.map +1 -1
- package/dist/actions/button/button/button.js +7 -7
- package/dist/actions/button/button/button.js.map +1 -1
- package/dist/actions/button/button_group/button_group.d.ts.map +1 -1
- package/dist/actions/button/button_group/button_group.js +2 -5
- package/dist/actions/button/button_group/button_group.js.map +1 -1
- package/dist/actions/button/select_group/select_group.js +7 -7
- package/dist/actions/button/select_group/select_group.js.map +1 -1
- package/dist/actions/button/slim_button/slim_button.d.ts.map +1 -1
- package/dist/actions/button/slim_button/slim_button.js +5 -5
- package/dist/actions/button/slim_button/slim_button.js.map +1 -1
- package/dist/button.css +1 -1
- package/dist/feedback/progress/progress_bar.js +1 -1
- package/dist/footer.css +1 -1
- package/dist/form/field/common/field_control/field_control.js +6 -6
- package/dist/form/field/common/field_control/field_control.js.map +1 -1
- package/dist/form/field/common/field_description.js +1 -1
- package/dist/form/field/common/field_error.js +2 -2
- package/dist/form/field/common/field_header.js +8 -8
- package/dist/form/field/common/field_header.js.map +1 -1
- package/dist/form/field/common/field_label.js +1 -1
- package/dist/form/field/common/status_input/status_input.d.ts.map +1 -1
- package/dist/form/field/common/status_input/status_input.js +9 -15
- package/dist/form/field/common/status_input/status_input.js.map +1 -1
- package/dist/form/field/h_field/h_field.js +9 -9
- package/dist/form/field/h_field/h_field.js.map +1 -1
- package/dist/form/field/v_field/v_field.js +8 -8
- package/dist/form/field/v_field/v_field.js.map +1 -1
- package/dist/form/field_set/field_set.d.ts.map +1 -1
- package/dist/form/field_set/field_set.js +12 -19
- package/dist/form/field_set/field_set.js.map +1 -1
- package/dist/inputs/checkbox/checkbox.js +12 -12
- package/dist/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/inputs/color_input/color_input.d.ts.map +1 -1
- package/dist/inputs/color_input/color_input.js +13 -17
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/color_input/color_picker.js +6 -6
- package/dist/inputs/color_input/color_picker.js.map +1 -1
- package/dist/inputs/combo_box/combo_box.js +15 -15
- package/dist/inputs/combo_box/combo_box.js.map +1 -1
- package/dist/inputs/date_picker/date_picker.js +6 -6
- package/dist/inputs/date_picker/date_picker.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_date.js +13 -13
- package/dist/inputs/date_picker/date_picker_date.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_day.js +1 -1
- package/dist/inputs/date_picker/date_picker_header.js +24 -24
- package/dist/inputs/date_picker/date_picker_header.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_input.js +19 -19
- package/dist/inputs/date_picker/date_picker_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_time_selector.d.ts.map +1 -1
- package/dist/inputs/date_picker/date_picker_time_selector.js +6 -9
- package/dist/inputs/date_picker/date_picker_time_selector.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_input.js +3 -3
- package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.d.ts.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.js +18 -24
- package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
- package/dist/inputs/input/input.d.ts +2 -2
- package/dist/inputs/input/input.d.ts.map +1 -1
- package/dist/inputs/input/input.js +4 -4
- package/dist/inputs/input/input.js.map +1 -1
- package/dist/inputs/multi_combo_box/multi_combo_box.js +1 -1
- package/dist/inputs/multi_combo_box/multi_combo_box.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_values.js +8 -8
- package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
- package/dist/inputs/options/option.d.ts +1 -0
- package/dist/inputs/options/option.d.ts.map +1 -1
- package/dist/inputs/options/option.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.d.ts +6 -1
- package/dist/inputs/phone_number_input/phone_number_input.d.ts.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input.js +169 -128
- package/dist/inputs/phone_number_input/phone_number_input.js.map +1 -1
- package/dist/inputs/radio/radio.js +14 -14
- package/dist/inputs/radio/radio.js.map +1 -1
- package/dist/inputs/select/select.js +16 -16
- package/dist/inputs/select/select.js.map +1 -1
- package/dist/inputs/slider/slider.js +7 -7
- package/dist/inputs/slider/slider.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_item.d.ts +1 -1
- package/dist/inputs/suggestions/suggestion_item.d.ts.map +1 -1
- package/dist/inputs/suggestions/suggestion_item.js +23 -18
- package/dist/inputs/suggestions/suggestion_item.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts +1 -1
- package/dist/inputs/suggestions/suggestion_list.d.ts.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +105 -95
- package/dist/inputs/suggestions/suggestion_list.js.map +1 -1
- package/dist/inputs/switch/switch.js +14 -14
- package/dist/inputs/switch/switch.js.map +1 -1
- package/dist/inputs/textarea/textarea.js +6 -6
- package/dist/inputs/textarea/textarea.js.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +5 -5
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/layouts/body/h_body.js +10 -10
- package/dist/layouts/body/h_body.js.map +1 -1
- package/dist/layouts/body/v_body.js +8 -8
- package/dist/layouts/body/v_body.js.map +1 -1
- package/dist/layouts/column/column.js +16 -16
- package/dist/layouts/column/column.js.map +1 -1
- package/dist/layouts/divider/divider.js +9 -9
- package/dist/layouts/divider/divider.js.map +1 -1
- package/dist/layouts/footer/footer.js +6 -6
- package/dist/layouts/footer/footer.js.map +1 -1
- package/dist/layouts/grid/grid.d.ts.map +1 -1
- package/dist/layouts/grid/grid.js +22 -31
- package/dist/layouts/grid/grid.js.map +1 -1
- package/dist/layouts/header/header.js +11 -11
- package/dist/layouts/header/header.js.map +1 -1
- package/dist/layouts/index.d.ts +3 -2
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +26 -24
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/list/item.d.ts +1 -0
- package/dist/layouts/list/item.d.ts.map +1 -1
- package/dist/layouts/list/item.js +18 -7
- package/dist/layouts/list/item.js.map +1 -1
- package/dist/layouts/list/list.js +12 -12
- package/dist/layouts/list/list.js.map +1 -1
- package/dist/layouts/sidebar_end/sidebar_end.js +15 -15
- package/dist/layouts/sidebar_end/sidebar_end.js.map +1 -1
- package/dist/layouts/sidebar_start/sidebar_start.js +16 -16
- package/dist/layouts/sidebar_start/sidebar_start.js.map +1 -1
- package/dist/layouts/utility_bar/utility_bar.js +14 -14
- package/dist/layouts/utility_bar/utility_bar.js.map +1 -1
- package/dist/modal.css +1 -1
- package/dist/overlay/context_menu/context_menu.js +4 -4
- package/dist/overlay/index.js +3 -3
- package/dist/overlay/menu/menu.js +8 -8
- package/dist/overlay/menu/menu.js.map +1 -1
- package/dist/overlay/popper/popper.js +12 -12
- package/dist/{portal-qqIp4SIl.js → overlay/portal/portal.js} +3 -3
- package/dist/overlay/portal/portal.js.map +1 -0
- package/dist/overlay/portal/portal_platform.js +3 -4
- package/dist/overlay/portal/portal_platform.js.map +1 -1
- package/dist/overlay/tooltip/tooltip.js +10 -10
- package/dist/overlay/tooltip/tooltip.js.map +1 -1
- package/dist/phone_number_input.css +1 -1
- package/dist/slim_button.css +1 -1
- package/dist/stacks/box/bottom_resize_handle.js +9 -9
- package/dist/stacks/box/bottom_resize_handle.js.map +1 -1
- package/dist/stacks/box/box.js +42 -42
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.js +6 -6
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/left_resize_handle.js +3 -3
- package/dist/stacks/box/left_resize_handle.js.map +1 -1
- package/dist/stacks/box/right_resize_handle.js +8 -8
- package/dist/stacks/box/right_resize_handle.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.js +7 -7
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/top_resize_handle.js +8 -8
- package/dist/stacks/box/top_resize_handle.js.map +1 -1
- package/dist/stacks/h_collapsible_box.js +5 -5
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/h_stack.js +26 -26
- package/dist/stacks/h_stack.js.map +1 -1
- package/dist/stacks/spacer.js +5 -5
- package/dist/stacks/spacer.js.map +1 -1
- package/dist/stacks/story_components/circle.js +6 -6
- package/dist/stacks/story_components/circle.js.map +1 -1
- package/dist/stacks/story_components/picture_placeholder.js +8 -8
- package/dist/stacks/story_components/picture_placeholder.js.map +1 -1
- package/dist/stacks/story_components/rect.js +11 -11
- package/dist/stacks/story_components/rect.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +8 -8
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/stacks/v_stack.js +35 -35
- package/dist/stacks/v_stack.js.map +1 -1
- package/dist/stacks/z_stack.js +34 -34
- package/dist/stacks/z_stack.js.map +1 -1
- package/dist/surfaces/alert/alert.js +8 -8
- package/dist/surfaces/alert/alert.js.map +1 -1
- package/dist/surfaces/card/card.d.ts.map +1 -1
- package/dist/surfaces/card/card.js +6 -15
- package/dist/surfaces/card/card.js.map +1 -1
- package/dist/surfaces/confirm/confirm.d.ts.map +1 -1
- package/dist/surfaces/confirm/confirm.js +17 -24
- package/dist/surfaces/confirm/confirm.js.map +1 -1
- package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.js +5 -5
- package/dist/surfaces/drawers/drawer_bottom/drawer_bottom.js.map +1 -1
- package/dist/surfaces/drawers/drawer_end/drawer_end.js +8 -8
- package/dist/surfaces/drawers/drawer_end/drawer_end.js.map +1 -1
- package/dist/surfaces/drawers/drawer_start/drawer_start.js +4 -4
- package/dist/surfaces/drawers/drawer_start/drawer_start.js.map +1 -1
- package/dist/surfaces/drawers/drawer_top/drawer_top.js +4 -4
- package/dist/surfaces/drawers/drawer_top/drawer_top.js.map +1 -1
- package/dist/surfaces/modal/modal.d.ts +2 -4
- package/dist/surfaces/modal/modal.d.ts.map +1 -1
- package/dist/surfaces/modal/modal.js +16 -7
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/page/h_page.js +6 -6
- package/dist/surfaces/page/h_page.js.map +1 -1
- package/dist/surfaces/page/v_page.js +9 -9
- package/dist/surfaces/page/v_page.js.map +1 -1
- package/dist/surfaces/panel/h_panel.d.ts.map +1 -1
- package/dist/surfaces/panel/h_panel.js +18 -24
- package/dist/surfaces/panel/h_panel.js.map +1 -1
- package/dist/surfaces/panel/v_panel.js +9 -9
- package/dist/surfaces/panel/v_panel.js.map +1 -1
- package/dist/surfaces/popover/popover.js +34 -34
- package/dist/surfaces/popover/popover.js.map +1 -1
- package/dist/surfaces/window/window.d.ts.map +1 -1
- package/dist/surfaces/window/window.js +6 -14
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/themes/index.d.ts +0 -2
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +6 -402
- package/dist/themes/index.js.map +1 -1
- package/dist/themes/stylesheets/reset.js +140 -0
- package/dist/themes/stylesheets/reset.js.map +1 -0
- package/dist/themes/themes/ergo/ergo_theme.js +595 -0
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -0
- package/dist/tokens/badge/badge.js +13 -13
- package/dist/tokens/badge/badge.js.map +1 -1
- package/dist/tokens/bubble/bubble.js +11 -11
- package/dist/tokens/bubble/bubble.js.map +1 -1
- package/dist/tokens/chip/chip.js +11 -11
- package/dist/tokens/chip/chip.js.map +1 -1
- package/dist/typography/body_text/body_text.js +21 -21
- package/dist/typography/body_text/body_text.js.map +1 -1
- package/dist/typography/callout/callout.js +16 -16
- package/dist/typography/callout/callout.js.map +1 -1
- package/dist/typography/caption/caption.js +13 -13
- package/dist/typography/caption/caption.js.map +1 -1
- package/dist/typography/footnote/footnote.js +14 -14
- package/dist/typography/footnote/footnote.js.map +1 -1
- package/dist/typography/headline/headline.js +12 -12
- package/dist/typography/headline/headline.js.map +1 -1
- package/dist/typography/subheadline/subheadline.js +13 -13
- package/dist/typography/subheadline/subheadline.js.map +1 -1
- package/dist/typography/title/title.js +17 -17
- package/dist/typography/title/title.js.map +1 -1
- package/package.json +23 -4
- package/src/actions/button/__stories__/button.stories.tsx +1 -1
- package/src/actions/button/__stories__/button_group.stories.tsx +1 -1
- package/src/actions/button/__stories__/select_group.stories.tsx +1 -1
- package/src/actions/button/__stories__/slim_button.stories.tsx +1 -1
- package/src/actions/button/base_button/base_button.tsx +8 -3
- package/src/actions/button/button/button.module.css +0 -78
- package/src/actions/button/button/button.tsx +3 -5
- package/src/actions/button/button_group/button_group.tsx +4 -7
- package/src/actions/button/select_group/select_group.tsx +3 -3
- package/src/actions/button/slim_button/slim_button.module.css +0 -26
- package/src/actions/button/slim_button/slim_button.tsx +3 -2
- package/src/feedback/lazy/lazy.stories.tsx +1 -1
- package/src/feedback/loading/__storybook__/loading.stories.tsx +1 -1
- package/src/feedback/progress/progress_bar.stories.tsx +1 -1
- package/src/form/field/common/field_control/field_control.tsx +2 -2
- package/src/form/field/common/field_header.tsx +2 -2
- package/src/form/field/common/status_input/status_input.tsx +3 -6
- package/src/form/field/field.stories.tsx +2 -1
- package/src/form/field/h_field/h_field.stories.tsx +10 -1
- package/src/form/field/h_field/h_field.tsx +2 -2
- package/src/form/field/v_field/v_field.stories.tsx +10 -1
- package/src/form/field/v_field/v_field.tsx +2 -2
- package/src/form/field_set/field_set.stories.tsx +9 -1
- package/src/form/field_set/field_set.tsx +4 -7
- package/src/inputs/checkbox/checkbox.stories.tsx +9 -1
- package/src/inputs/checkbox/checkbox.tsx +2 -2
- package/src/inputs/color_input/color_input.stories.tsx +9 -1
- package/src/inputs/color_input/color_input.tsx +2 -6
- package/src/inputs/color_input/color_picker.tsx +2 -2
- package/src/inputs/combo_box/combo_box.stories.tsx +14 -5
- package/src/inputs/combo_box/combo_box.tsx +2 -2
- package/src/inputs/date_picker/date_picker.stories.tsx +18 -10
- package/src/inputs/date_picker/date_picker.tsx +3 -3
- package/src/inputs/date_picker/date_picker_date.tsx +3 -3
- package/src/inputs/date_picker/date_picker_header.tsx +2 -2
- package/src/inputs/date_picker/date_picker_input.stories.tsx +15 -7
- package/src/inputs/date_picker/date_picker_input.tsx +3 -3
- package/src/inputs/date_picker/date_picker_time_selector.tsx +5 -8
- package/src/inputs/date_picker/date_picker_year_input.tsx +2 -2
- package/src/inputs/date_picker/date_picker_year_selector.tsx +3 -9
- package/src/inputs/input/input.stories.tsx +9 -1
- package/src/inputs/input/input.tsx +5 -4
- package/src/inputs/mask_input/key_capture_input.stories.tsx +9 -1
- package/src/inputs/mask_input/mask_input.stories.tsx +10 -1
- package/src/inputs/multi_combo_box/multi_combo_box.stories.tsx +10 -1
- package/src/inputs/multi_combo_box/multi_combo_box.tsx +2 -2
- package/src/inputs/multiselect/multiselect_values.tsx +2 -2
- package/src/inputs/multiselect/mutliselect.stories.tsx +10 -1
- package/src/inputs/options/option.tsx +1 -0
- package/src/inputs/phone_number_input/phone_number_input.module.css +12 -0
- package/src/inputs/phone_number_input/phone_number_input.stories.tsx +18 -1
- package/src/inputs/phone_number_input/phone_number_input.tsx +104 -29
- package/src/inputs/radio/radio.stories.tsx +14 -6
- package/src/inputs/radio/radio.tsx +2 -2
- package/src/inputs/select/select.stories.tsx +18 -9
- package/src/inputs/select/select.tsx +2 -2
- package/src/inputs/slider/slider.stories.tsx +9 -1
- package/src/inputs/slider/slider.tsx +2 -2
- package/src/inputs/suggestions/suggestion_item.tsx +14 -4
- package/src/inputs/suggestions/suggestion_list.stories.tsx +21 -12
- package/src/inputs/suggestions/suggestion_list.tsx +25 -6
- package/src/inputs/switch/switch.stories.tsx +9 -1
- package/src/inputs/switch/switch.tsx +4 -4
- package/src/inputs/textarea/textarea.stories.tsx +9 -1
- package/src/inputs/textarea/textarea.tsx +2 -2
- package/src/inputs/unit_input/unit_input.stories.tsx +9 -1
- package/src/inputs/unit_input/unit_input.tsx +4 -4
- package/src/layouts/body/h_body.tsx +2 -2
- package/src/layouts/body/v_body.tsx +2 -2
- package/src/layouts/column/column.tsx +3 -3
- package/src/layouts/divider/__stories__/divider.stories.tsx +59 -19
- package/src/layouts/divider/divider.tsx +3 -3
- package/src/layouts/footer/footer.module.css +0 -1
- package/src/layouts/footer/footer.tsx +2 -2
- package/src/layouts/grid/grid.stories.tsx +42 -34
- package/src/layouts/grid/grid.tsx +2 -7
- package/src/layouts/header/header.tsx +2 -2
- package/src/layouts/index.ts +3 -2
- package/src/layouts/list/item.tsx +11 -3
- package/src/layouts/list/list.tsx +3 -3
- package/src/layouts/sidebar_end/sidebar_end.tsx +2 -2
- package/src/layouts/sidebar_start/sidebar_start.tsx +2 -2
- package/src/layouts/utility_bar/utility_bar.tsx +2 -2
- package/src/overlay/context_menu/context_menu.stories.tsx +13 -5
- package/src/overlay/menu/menu.stories.tsx +22 -14
- package/src/overlay/menu/menu.tsx +3 -3
- package/src/overlay/popper/popper.stories.tsx +43 -22
- package/src/overlay/portal/portal.stories.tsx +10 -1
- package/src/overlay/tooltip/tooltip.stories.tsx +9 -2
- package/src/overlay/tooltip/tooltip.tsx +2 -2
- package/src/stacks/box/bottom_resize_handle.tsx +2 -2
- package/src/stacks/box/box.tsx +2 -2
- package/src/stacks/box/end_resize_handle.tsx +2 -2
- package/src/stacks/box/left_resize_handle.tsx +2 -2
- package/src/stacks/box/right_resize_handle.tsx +2 -2
- package/src/stacks/box/start_resize_handle.tsx +2 -2
- package/src/stacks/box/top_resize_handle.tsx +2 -2
- package/src/stacks/collapsible_box.stories.tsx +10 -1
- package/src/stacks/h_collapsible_box.tsx +2 -2
- package/src/stacks/h_stack.stories.tsx +104 -59
- package/src/stacks/h_stack.tsx +2 -2
- package/src/stacks/spacer.tsx +2 -2
- package/src/stacks/story_components/circle.tsx +2 -2
- package/src/stacks/story_components/picture_placeholder.tsx +2 -2
- package/src/stacks/story_components/rect.tsx +2 -2
- package/src/stacks/v_collapsible_box.tsx +2 -2
- package/src/stacks/v_stack.stories.tsx +91 -10
- package/src/stacks/v_stack.tsx +2 -2
- package/src/stacks/z_stack.stories.tsx +9 -1
- package/src/stacks/z_stack.tsx +2 -2
- package/src/surfaces/alert/alert.stories.tsx +4 -4
- package/src/surfaces/alert/alert.tsx +2 -2
- package/src/surfaces/card/card.tsx +3 -9
- package/src/surfaces/confirm/confirm.stories.tsx +4 -4
- package/src/surfaces/confirm/confirm.tsx +3 -6
- package/src/surfaces/drawers/__stories__/drawers.stories.tsx +1 -1
- package/src/surfaces/drawers/drawer_bottom/drawer_bottom.tsx +2 -2
- package/src/surfaces/drawers/drawer_end/drawer_end.tsx +2 -2
- package/src/surfaces/drawers/drawer_start/drawer_start.tsx +2 -2
- package/src/surfaces/drawers/drawer_top/drawer_top.tsx +2 -2
- package/src/surfaces/modal/__stories__/modal.stories.tsx +54 -0
- package/src/surfaces/modal/modal.module.css +2 -1
- package/src/surfaces/modal/modal.tsx +9 -6
- package/src/surfaces/page/h_page.tsx +2 -2
- package/src/surfaces/page/v_page.tsx +2 -2
- package/src/surfaces/panel/__stories__/panel.stories.tsx +13 -12
- package/src/surfaces/panel/h_panel.tsx +3 -9
- package/src/surfaces/panel/v_panel.tsx +3 -3
- package/src/surfaces/popover/popover.tsx +2 -2
- package/src/surfaces/window/window.stories.tsx +1 -1
- package/src/surfaces/window/window.tsx +2 -6
- package/src/themes/index.ts +0 -2
- package/src/themes/stories/themes.stories.tsx +1 -1
- package/src/themes/themes/ergo/__stories__/components/material_picker/sb_inverted_materials.module.css +34 -0
- package/src/themes/themes/ergo/__stories__/components/material_picker/sb_material_picker.tsx +52 -0
- package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_card.module.css +5 -0
- package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_card.tsx +40 -0
- package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_picker.tsx +83 -0
- package/src/themes/themes/ergo/__stories__/components/tone_picker/types.ts +7 -0
- package/src/themes/themes/ergo/__stories__/material.stories.tsx +154 -0
- package/src/themes/themes/ergo/__stories__/sb_materials.module.css +110 -0
- package/src/themes/themes/ergo/__stories__/utils.ts +92 -0
- package/src/themes/themes/ergo/ergo_theme.css +348 -15
- package/src/tokens/badge/badge.stories.tsx +6 -6
- package/src/tokens/badge/badge.tsx +3 -3
- package/src/tokens/bubble/bubble.stories.tsx +16 -9
- package/src/tokens/bubble/bubble.tsx +2 -2
- package/src/tokens/chip/chip.stories.tsx +1 -1
- package/src/tokens/chip/chip.tsx +2 -2
- package/src/typography/body_text/body_text.tsx +2 -2
- package/src/typography/callout/callout.tsx +2 -2
- package/src/typography/caption/caption.tsx +2 -2
- package/src/typography/footnote/footnote.tsx +2 -2
- package/src/typography/headline/headline.tsx +2 -2
- package/src/typography/subheadline/subheadline.tsx +2 -2
- package/src/typography/title/title.tsx +2 -2
- package/src/typography/typography-showcase.stories.tsx +2 -2
- package/src/utils/click_away_listener.stories.tsx +21 -11
- package/src/utils/responsive/responsive_renderer.stories.tsx +7 -7
- package/src/utils/scroll_away_listener.stories.tsx +11 -1
- package/tsconfig.json +0 -3
- package/dist/card.css +0 -1
- package/dist/portal-qqIp4SIl.js.map +0 -1
- package/dist/themes/stylesheets/reset.css +0 -1
- package/dist/themes/themes/ergo/ergo_theme.css +0 -1
- package/dist/themes/themes/windows_98/windows_98.css +0 -1
- package/src/surfaces/card/card.module.css +0 -5
- package/src/surfaces/modal/modal.stories.tsx +0 -15
- /package/dist/{overlay/portal/portal.css → portal_platform.css} +0 -0
|
@@ -5,7 +5,7 @@ import "../../utils/scroll_away_listener.js";
|
|
|
5
5
|
import w, { useRef as c, useState as L } from "react";
|
|
6
6
|
import { useForkRef as H } from "../../utils/hooks/use_fork_ref.js";
|
|
7
7
|
import "../../utils/hooks/use_resize_observer.js";
|
|
8
|
-
import J from "
|
|
8
|
+
import { clsx as J } from "clsx";
|
|
9
9
|
import { SuggestionList as Q } from "../suggestions/suggestion_list.js";
|
|
10
10
|
import "../../actions/button/base_button/base_button.js";
|
|
11
11
|
import "../../actions/button/button_group/button_group.js";
|
|
@@ -23,30 +23,30 @@ const pe = w.forwardRef(function({
|
|
|
23
23
|
onKeyUp: f,
|
|
24
24
|
value: m,
|
|
25
25
|
placeholder: _ = "-- Select --",
|
|
26
|
-
noOptionMatchedMessage:
|
|
27
|
-
trimCustomInput:
|
|
28
|
-
className:
|
|
26
|
+
noOptionMatchedMessage: x,
|
|
27
|
+
trimCustomInput: C = !1,
|
|
28
|
+
className: E,
|
|
29
29
|
onMouseDown: p,
|
|
30
30
|
onMouseUp: d,
|
|
31
31
|
onChange: g,
|
|
32
|
-
...
|
|
32
|
+
...T
|
|
33
33
|
}, D) {
|
|
34
34
|
const K = w.Children.toArray(
|
|
35
35
|
t
|
|
36
|
-
), l = c(""), M = c(!1), h = c(!1), [
|
|
36
|
+
), l = c(""), M = c(!1), h = c(!1), [j, S] = L(null), i = c(null), [y, b] = L(!1), q = H(D, i), R = Z(K, m || ""), k = R == null ? _ || "" : R.props.label;
|
|
37
37
|
function A() {
|
|
38
38
|
b(!0);
|
|
39
39
|
}
|
|
40
40
|
function o() {
|
|
41
41
|
b(!1);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function B() {
|
|
44
44
|
const e = i.current;
|
|
45
45
|
e != null && requestAnimationFrame(() => {
|
|
46
46
|
e.focus();
|
|
47
47
|
}), o();
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function N(e, s, r) {
|
|
50
50
|
const F = i.current;
|
|
51
51
|
F != null && requestAnimationFrame(() => {
|
|
52
52
|
r && g && g(e), F.focus();
|
|
@@ -73,10 +73,10 @@ const pe = w.forwardRef(function({
|
|
|
73
73
|
/* @__PURE__ */ u(
|
|
74
74
|
W,
|
|
75
75
|
{
|
|
76
|
-
ref:
|
|
77
|
-
className: J(
|
|
76
|
+
ref: q,
|
|
77
|
+
className: J(E, "select", O.select),
|
|
78
78
|
width: "100%",
|
|
79
|
-
...
|
|
79
|
+
...T,
|
|
80
80
|
hAlign: "start",
|
|
81
81
|
value: k,
|
|
82
82
|
onKeyDown: U,
|
|
@@ -89,13 +89,13 @@ const pe = w.forwardRef(function({
|
|
|
89
89
|
y && /* @__PURE__ */ u(
|
|
90
90
|
Q,
|
|
91
91
|
{
|
|
92
|
-
anchorElement:
|
|
93
|
-
onClose:
|
|
92
|
+
anchorElement: j,
|
|
93
|
+
onClose: B,
|
|
94
94
|
value: "",
|
|
95
95
|
scrollToValue: m || "",
|
|
96
|
-
trimCustomInput:
|
|
97
|
-
onOptionSelect:
|
|
98
|
-
noSuggestionMessage:
|
|
96
|
+
trimCustomInput: C,
|
|
97
|
+
onOptionSelect: N,
|
|
98
|
+
noSuggestionMessage: x,
|
|
99
99
|
children: t
|
|
100
100
|
}
|
|
101
101
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../../../src/inputs/select/select.tsx"],"sourcesContent":["import { useForkRef } from '../../utils/index.js';\nimport
|
|
1
|
+
{"version":3,"file":"select.js","sources":["../../../src/inputs/select/select.tsx"],"sourcesContent":["import { useForkRef } from '../../utils/index.js';\nimport { clsx } from 'clsx';\nimport React, { useRef, useState } from 'react';\nimport { SuggestionList } from '../suggestions/suggestion_list.js';\nimport { OptionProps } from '../options/option.js';\nimport { Button, type ButtonProps } from '../../actions/index.js';\nimport styles from './select.module.css';\n\nfunction findOptionFromValue(options: React.ReactElement<OptionProps>[], value: string) {\n return options.find(option => option.props.value === value);\n}\n\nexport interface SelectProps\n extends Omit<ButtonProps, 'children' | 'onChange' | 'value'> {\n children?: React.ReactElement<OptionProps>[] | React.ReactElement<OptionProps>;\n onChange?: (value: string) => void;\n value?: string | null;\n placeholder?: string;\n noOptionMatchedMessage?: React.ReactNode;\n trimCustomInput?: boolean;\n}\n\nexport const Select = React.forwardRef(function Select(\n {\n children = [],\n onKeyDown,\n onKeyUp,\n value,\n placeholder = '-- Select --',\n noOptionMatchedMessage,\n trimCustomInput = false,\n className,\n onMouseDown,\n onMouseUp,\n onChange,\n ...props\n }: SelectProps,\n ref: React.Ref<HTMLButtonElement>\n) {\n const safeChildren = React.Children.toArray(\n children\n ) as React.ReactElement<OptionProps>[];\n const keyPressedDownRef = useRef('');\n const isAlreadyFocusedRef = useRef(false);\n const isClosingRef = useRef(false);\n const [anchorElement, setAnchorElement] = useState<HTMLButtonElement | null>(null);\n const internalButtonRef = useRef<HTMLButtonElement | null>(null);\n const [isSuggestionsOpen, setIsSuggestionsOpen] = useState(false);\n const forkedRef = useForkRef(ref, internalButtonRef);\n const selectedOption = findOptionFromValue(safeChildren, value || '');\n const selectedLabel =\n selectedOption == null ? placeholder || '' : selectedOption.props.label;\n\n function openSuggestions() {\n setIsSuggestionsOpen(true);\n }\n\n function closeSuggestions() {\n setIsSuggestionsOpen(false);\n }\n\n function handleClose() {\n const button = internalButtonRef.current;\n\n if (button != null) {\n requestAnimationFrame(() => {\n button.focus();\n });\n }\n\n closeSuggestions();\n }\n\n function handleSelection(value: string, _: string | undefined, isSuggestion: boolean) {\n const button = internalButtonRef.current;\n\n if (button != null) {\n requestAnimationFrame(() => {\n if (isSuggestion) {\n onChange && onChange(value);\n }\n button.focus();\n });\n }\n\n closeSuggestions();\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLButtonElement>) {\n const key = event.key;\n keyPressedDownRef.current = key;\n onKeyDown && onKeyDown(event);\n }\n\n function handleKeyUp(event: React.KeyboardEvent<HTMLButtonElement>) {\n setAnchorElement(event.currentTarget);\n const isSameKey = (keyPressedDownRef.current = event.key);\n\n keyPressedDownRef.current = '';\n const key = event.key;\n\n if (isSameKey && (key === 'Enter' || key === ' ')) {\n if (isSuggestionsOpen) {\n closeSuggestions();\n } else {\n openSuggestions();\n }\n }\n\n onKeyUp && onKeyUp(event);\n }\n\n function handlMouseDown(event: React.MouseEvent<HTMLButtonElement>) {\n setAnchorElement(event.currentTarget);\n isAlreadyFocusedRef.current = document.activeElement === event.currentTarget;\n onMouseDown && onMouseDown(event);\n }\n\n function handleMouseUp(event: React.MouseEvent<HTMLButtonElement>) {\n if (isClosingRef.current) {\n isClosingRef.current = false;\n closeSuggestions();\n }\n\n openSuggestions();\n onMouseUp && onMouseUp(event);\n }\n\n return (\n <>\n <Button\n ref={forkedRef}\n className={clsx(className, 'select', styles.select)}\n width=\"100%\"\n {...props}\n hAlign=\"start\"\n value={selectedLabel}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n onMouseDown={handlMouseDown}\n onMouseUp={handleMouseUp}\n >\n <span className={styles.selectedLabel}>{selectedLabel}</span>\n </Button>\n {isSuggestionsOpen && (\n <SuggestionList\n anchorElement={anchorElement}\n onClose={handleClose}\n value={''}\n scrollToValue={value || ''}\n trimCustomInput={trimCustomInput}\n onOptionSelect={handleSelection}\n noSuggestionMessage={noOptionMatchedMessage}\n >\n {children}\n </SuggestionList>\n )}\n </>\n );\n});\n"],"names":["findOptionFromValue","options","value","option","Select","React","children","onKeyDown","onKeyUp","placeholder","noOptionMatchedMessage","trimCustomInput","className","onMouseDown","onMouseUp","onChange","props","ref","safeChildren","keyPressedDownRef","useRef","isAlreadyFocusedRef","isClosingRef","anchorElement","setAnchorElement","useState","internalButtonRef","isSuggestionsOpen","setIsSuggestionsOpen","forkedRef","useForkRef","selectedOption","selectedLabel","openSuggestions","closeSuggestions","handleClose","button","handleSelection","_","isSuggestion","handleKeyDown","event","key","handleKeyUp","isSameKey","handlMouseDown","handleMouseUp","jsxs","Fragment","jsx","Button","clsx","styles","SuggestionList"],"mappings":"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"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import m from "
|
|
2
|
+
import { clsx as m } from "clsx";
|
|
3
3
|
import g, { useRef as v, useLayoutEffect as y } from "react";
|
|
4
4
|
import "../../utils/focus_redirect.js";
|
|
5
5
|
import "../../utils/click_away_listener.js";
|
|
6
6
|
import "../../utils/scroll_away_listener.js";
|
|
7
7
|
import { useForkRef as R } from "../../utils/hooks/use_fork_ref.js";
|
|
8
8
|
import "../../utils/hooks/use_resize_observer.js";
|
|
9
|
-
import '../../slider.css';const S = "_slider_eb84151", b = { slider: S },
|
|
10
|
-
const
|
|
9
|
+
import '../../slider.css';const S = "_slider_eb84151", b = { slider: S }, N = g.forwardRef(function({ style: l, className: a, width: u, min: r = 0, max: t = 100, onChange: o, ...n }, c) {
|
|
10
|
+
const i = v(null), d = R(c, i);
|
|
11
11
|
return y(() => {
|
|
12
|
-
const e =
|
|
12
|
+
const e = i.current;
|
|
13
13
|
if (e == null) return;
|
|
14
14
|
const s = () => {
|
|
15
15
|
const f = (parseFloat(e.value) - r) / (t - r) * 100;
|
|
@@ -22,7 +22,7 @@ import '../../slider.css';const S = "_slider_eb84151", b = { slider: S }, x = g.
|
|
|
22
22
|
"input",
|
|
23
23
|
{
|
|
24
24
|
type: "range",
|
|
25
|
-
className: m(
|
|
25
|
+
className: m(a, b.slider, "slider"),
|
|
26
26
|
"data-is-disabled": n.disabled || !1,
|
|
27
27
|
ref: d,
|
|
28
28
|
onChange: (e) => {
|
|
@@ -32,11 +32,11 @@ import '../../slider.css';const S = "_slider_eb84151", b = { slider: S }, x = g.
|
|
|
32
32
|
min: String(r),
|
|
33
33
|
max: String(t),
|
|
34
34
|
"data-width": "100%",
|
|
35
|
-
style: { width: u, ...
|
|
35
|
+
style: { width: u, ...l }
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
});
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
N as Slider
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=slider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.js","sources":["../../../src/inputs/slider/slider.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"slider.js","sources":["../../../src/inputs/slider/slider.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { useLayoutEffect, useRef } from 'react';\nimport { HTMLAttributes } from 'react';\nimport styles from './slider.module.css';\nimport { useForkRef } from '../../utils/index.js';\n\nexport interface SliderProps extends Omit<HTMLAttributes<HTMLInputElement>, 'onChange'> {\n width?: string;\n disabled?: boolean;\n min?: number;\n max?: number;\n value?: string;\n list?: string;\n onChange?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport const Slider = React.forwardRef(function Slider(\n { style, className, width, min = 0, max = 100, onChange, ...props }: SliderProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const localRef = useRef<HTMLInputElement>(null);\n const forkedRef = useForkRef(ref, localRef);\n\n useLayoutEffect(() => {\n const range = localRef.current;\n if (range == null) return;\n const updateProgress = () => {\n const value = parseFloat(range.value);\n const percent = ((value - min) / (max - min)) * 100;\n range.style.setProperty('--progress', `${percent}%`);\n };\n\n range.addEventListener('input', updateProgress);\n updateProgress();\n\n return () => {\n range.removeEventListener('input', updateProgress);\n };\n }, [min, max]);\n\n return (\n <input\n type=\"range\"\n className={clsx(className, styles.slider, 'slider')}\n data-is-disabled={props.disabled || false}\n ref={forkedRef}\n onChange={e => {\n onChange && onChange(e.currentTarget.value, e);\n }}\n {...props}\n min={String(min)}\n max={String(max)}\n data-width=\"100%\"\n style={{ width, ...style }}\n />\n );\n});\n"],"names":["Slider","React","style","className","width","min","max","onChange","props","ref","localRef","useRef","forkedRef","useForkRef","useLayoutEffect","range","updateProgress","percent","jsx","clsx","styles"],"mappings":";;;;;;;;gDAgBaA,IAASC,EAAM,WAAW,SACrC,EAAE,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,KAAAC,IAAM,GAAG,KAAAC,IAAM,KAAK,UAAAC,GAAU,GAAGC,EAAA,GAC5DC,GACA;AACA,QAAMC,IAAWC,EAAyB,IAAI,GACxCC,IAAYC,EAAWJ,GAAKC,CAAQ;AAE1C,SAAAI,EAAgB,MAAM;AACpB,UAAMC,IAAQL,EAAS;AACvB,QAAIK,KAAS,KAAM;AACnB,UAAMC,IAAiB,MAAM;AAE3B,YAAMC,KADQ,WAAWF,EAAM,KAAK,IACVV,MAAQC,IAAMD,KAAQ;AAChD,MAAAU,EAAM,MAAM,YAAY,cAAc,GAAGE,CAAO,GAAG;AAAA,IACrD;AAEA,WAAAF,EAAM,iBAAiB,SAASC,CAAc,GAC9CA,EAAA,GAEO,MAAM;AACX,MAAAD,EAAM,oBAAoB,SAASC,CAAc;AAAA,IACnD;AAAA,EACF,GAAG,CAACX,GAAKC,CAAG,CAAC,GAGX,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAWC,EAAKhB,GAAWiB,EAAO,QAAQ,QAAQ;AAAA,MAClD,oBAAkBZ,EAAM,YAAY;AAAA,MACpC,KAAKI;AAAA,MACL,UAAU,CAAA,MAAK;AACb,QAAAL,KAAYA,EAAS,EAAE,cAAc,OAAO,CAAC;AAAA,MAC/C;AAAA,MACC,GAAGC;AAAA,MACJ,KAAK,OAAOH,CAAG;AAAA,MACf,KAAK,OAAOC,CAAG;AAAA,MACf,cAAW;AAAA,MACX,OAAO,EAAE,OAAAF,GAAO,GAAGF,EAAA;AAAA,IAAM;AAAA,EAAA;AAG/B,CAAC;"}
|
|
@@ -3,7 +3,7 @@ export interface SuggestionItemProps {
|
|
|
3
3
|
isFocused: boolean;
|
|
4
4
|
isSelected: boolean;
|
|
5
5
|
option: React.ReactElement;
|
|
6
|
-
onClick?: (value: string, label: string, isSuggestion: boolean) => void;
|
|
6
|
+
onClick?: (value: string, label: string, isSuggestion: boolean, obfuscate: boolean) => void;
|
|
7
7
|
}
|
|
8
8
|
export declare function SuggestionItem({ isFocused, isSelected, option, onClick, }: SuggestionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
//# sourceMappingURL=suggestion_item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion_item.d.ts","sourceRoot":"","sources":["../../../src/inputs/suggestions/suggestion_item.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"suggestion_item.d.ts","sourceRoot":"","sources":["../../../src/inputs/suggestions/suggestion_item.tsx"],"names":[],"mappings":"AACA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC;IAC3B,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,OAAO,KACf,IAAI,CAAC;CACX;AAED,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,UAAU,EACV,MAAM,EACN,OAAO,GACR,EAAE,mBAAmB,2CAyCrB"}
|
|
@@ -1,34 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import a from "
|
|
3
|
-
import { useRef as c, useEffect as
|
|
4
|
-
import '../../suggestion_item.css';const
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as a } from "clsx";
|
|
3
|
+
import { useRef as c, useEffect as u } from "react";
|
|
4
|
+
import '../../suggestion_item.css';const f = "_suggestion-item_6b60309", b = { "suggestion-item": f };
|
|
5
5
|
function p({
|
|
6
6
|
isFocused: e,
|
|
7
|
-
isSelected:
|
|
8
|
-
option:
|
|
7
|
+
isSelected: o,
|
|
8
|
+
option: t,
|
|
9
9
|
onClick: l
|
|
10
10
|
}) {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
}, [
|
|
16
|
-
const
|
|
17
|
-
e &&
|
|
18
|
-
}, [e]), /* @__PURE__ */
|
|
11
|
+
const n = c(null), r = t.props.disabled;
|
|
12
|
+
return u(() => {
|
|
13
|
+
const s = n.current;
|
|
14
|
+
o && s != null && s.scrollIntoView({ block: "start" });
|
|
15
|
+
}, [o]), u(() => {
|
|
16
|
+
const s = n.current;
|
|
17
|
+
e && s != null && s.scrollIntoView({ block: "center" });
|
|
18
|
+
}, [e]), /* @__PURE__ */ i(
|
|
19
19
|
"button",
|
|
20
20
|
{
|
|
21
21
|
tabIndex: -1,
|
|
22
|
-
ref:
|
|
22
|
+
ref: n,
|
|
23
23
|
className: a(b["suggestion-item"], "suggestion-item"),
|
|
24
|
-
"data-is-selected":
|
|
24
|
+
"data-is-selected": o,
|
|
25
25
|
"data-is-focused": e,
|
|
26
26
|
"data-disabled": r,
|
|
27
27
|
disabled: r,
|
|
28
28
|
onClick: () => {
|
|
29
|
-
!r && l && l(
|
|
29
|
+
!r && l && l(
|
|
30
|
+
t.props.value,
|
|
31
|
+
t.props.label,
|
|
32
|
+
!0,
|
|
33
|
+
t.props.obfuscate ?? !1
|
|
34
|
+
);
|
|
30
35
|
},
|
|
31
|
-
children:
|
|
36
|
+
children: t
|
|
32
37
|
}
|
|
33
38
|
);
|
|
34
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion_item.js","sources":["../../../src/inputs/suggestions/suggestion_item.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"suggestion_item.js","sources":["../../../src/inputs/suggestions/suggestion_item.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport React, { useEffect, useRef } from 'react';\nimport styles from './suggestion_item.module.css';\n\nexport interface SuggestionItemProps {\n isFocused: boolean;\n isSelected: boolean;\n option: React.ReactElement;\n onClick?: (\n value: string,\n label: string,\n isSuggestion: boolean,\n obfuscate: boolean\n ) => void;\n}\n\nexport function SuggestionItem({\n isFocused,\n isSelected,\n option,\n onClick,\n}: SuggestionItemProps) {\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n const isDisabled = option.props.disabled;\n\n useEffect(() => {\n const button = buttonRef.current;\n if (isSelected && button != null) {\n button.scrollIntoView({ block: 'start' });\n }\n }, [isSelected]);\n\n useEffect(() => {\n const button = buttonRef.current;\n if (isFocused && button != null) {\n button.scrollIntoView({ block: 'center' });\n }\n }, [isFocused]);\n\n return (\n <button\n tabIndex={-1}\n ref={buttonRef}\n className={clsx(styles['suggestion-item'], 'suggestion-item')}\n data-is-selected={isSelected}\n data-is-focused={isFocused}\n data-disabled={isDisabled}\n disabled={isDisabled}\n onClick={() => {\n if (!isDisabled && onClick) {\n onClick(\n option.props.value,\n option.props.label,\n true,\n option.props.obfuscate ?? false\n );\n }\n }}\n >\n {option}\n </button>\n );\n}\n"],"names":["SuggestionItem","isFocused","isSelected","option","onClick","buttonRef","useRef","isDisabled","useEffect","button","jsx","clsx","styles"],"mappings":";;;;AAgBO,SAASA,EAAe;AAAA,EAC7B,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AACF,GAAwB;AACtB,QAAMC,IAAYC,EAAiC,IAAI,GACjDC,IAAaJ,EAAO,MAAM;AAEhC,SAAAK,EAAU,MAAM;AACd,UAAMC,IAASJ,EAAU;AACzB,IAAIH,KAAcO,KAAU,QAC1BA,EAAO,eAAe,EAAE,OAAO,QAAA,CAAS;AAAA,EAE5C,GAAG,CAACP,CAAU,CAAC,GAEfM,EAAU,MAAM;AACd,UAAMC,IAASJ,EAAU;AACzB,IAAIJ,KAAaQ,KAAU,QACzBA,EAAO,eAAe,EAAE,OAAO,SAAA,CAAU;AAAA,EAE7C,GAAG,CAACR,CAAS,CAAC,GAGZ,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,UAAU;AAAA,MACV,KAAKL;AAAA,MACL,WAAWM,EAAKC,EAAO,iBAAiB,GAAG,iBAAiB;AAAA,MAC5D,oBAAkBV;AAAA,MAClB,mBAAiBD;AAAA,MACjB,iBAAeM;AAAA,MACf,UAAUA;AAAA,MACV,SAAS,MAAM;AACb,QAAI,CAACA,KAAcH,KACjBA;AAAA,UACED,EAAO,MAAM;AAAA,UACbA,EAAO,MAAM;AAAA,UACb;AAAA,UACAA,EAAO,MAAM,aAAa;AAAA,QAAA;AAAA,MAGhC;AAAA,MAEC,UAAAA;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -5,7 +5,7 @@ export interface SuggestionListProps extends Omit<React.HTMLAttributes<HTMLInput
|
|
|
5
5
|
anchorElement: HTMLElement | null;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
onChange?: (value: string) => void;
|
|
8
|
-
onOptionSelect?: (value: string, label: string | undefined, isSuggestion: boolean) => void;
|
|
8
|
+
onOptionSelect?: (value: string, label: string | undefined, isSuggestion: boolean, obfuscate: boolean) => void;
|
|
9
9
|
noSuggestionMessage?: React.ReactNode;
|
|
10
10
|
trimCustomInput?: boolean;
|
|
11
11
|
haveValueAsOption?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestion_list.d.ts","sourceRoot":"","sources":["../../../src/inputs/suggestions/suggestion_list.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAazE,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,YAAY,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"suggestion_list.d.ts","sourceRoot":"","sources":["../../../src/inputs/suggestions/suggestion_list.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAazE,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,OAAO,KACf,IAAI,CAAC;IACV,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,CACR,UAAU,EAAE,MAAM,EAClB,mBAAmB,EAAE,MAAM,GAAG,IAAI,EAClC,iBAAiB,EAAE,MAAM,GAAG,IAAI,KAC7B,IAAI,CAAC;CACX;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAU,EACV,aAAa,EACb,aAAa,EACb,QAAQ,EACR,cAAc,EACd,mBAAwC,EACxC,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,eAAuB,EACvB,iBAAyB,EACzB,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAuXrB"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as K, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import { BodyText as ae } from "../../typography/body_text/body_text.js";
|
|
3
|
-
import
|
|
3
|
+
import { clsx as N } from "clsx";
|
|
4
4
|
import "../../callout.module-D8ECmxpO.js";
|
|
5
5
|
import "../../caption.module-DDq0H4xZ.js";
|
|
6
6
|
import "../../footnote.module-DEyFuqOr.js";
|
|
7
7
|
import "../../headline.module-BiwHBtGf.js";
|
|
8
8
|
import "../../subheadline.module-C-v7zMkQ.js";
|
|
9
9
|
import "../../title.module-B16de2jd.js";
|
|
10
|
-
import { VStack as
|
|
10
|
+
import { VStack as O } from "../../stacks/v_stack.js";
|
|
11
11
|
import { ZStack as ue } from "../../stacks/z_stack.js";
|
|
12
|
-
import { Children as pe, isValidElement as de, useState as
|
|
12
|
+
import { Children as pe, isValidElement as de, useState as a, useRef as T, useLayoutEffect as S } from "react";
|
|
13
13
|
import { FocusRedirect as fe } from "../../utils/focus_redirect.js";
|
|
14
14
|
import "../../utils/click_away_listener.js";
|
|
15
15
|
import "../../utils/scroll_away_listener.js";
|
|
16
16
|
import "../../utils/hooks/use_resize_observer.js";
|
|
17
17
|
import { SuggestionItem as ge } from "./suggestion_item.js";
|
|
18
|
-
import { Option as
|
|
18
|
+
import { Option as U } from "../options/option.js";
|
|
19
19
|
import "../../actions/button/base_button/base_button.js";
|
|
20
20
|
import "../../actions/button/button_group/button_group.js";
|
|
21
21
|
import "../../actions/button/slim_button/slim_button.js";
|
|
@@ -26,68 +26,78 @@ import { Popper as me } from "../../overlay/popper/popper.js";
|
|
|
26
26
|
import '../../suggestion_list.css';const we = "_suggestion-list_711fb17", be = "_input_a0df060", R = { "suggestion-list": we, input: be }, I = 50, xe = 50;
|
|
27
27
|
function je({
|
|
28
28
|
value: A = "",
|
|
29
|
-
scrollToValue:
|
|
30
|
-
anchorElement:
|
|
31
|
-
children:
|
|
32
|
-
onOptionSelect:
|
|
33
|
-
noSuggestionMessage:
|
|
34
|
-
onClose:
|
|
29
|
+
scrollToValue: g,
|
|
30
|
+
anchorElement: l,
|
|
31
|
+
children: V,
|
|
32
|
+
onOptionSelect: h,
|
|
33
|
+
noSuggestionMessage: P = "-- No Matches --",
|
|
34
|
+
onClose: b,
|
|
35
35
|
onChange: D,
|
|
36
36
|
onKeyUp: F,
|
|
37
37
|
onKeyDown: H,
|
|
38
|
-
trimCustomInput:
|
|
39
|
-
haveValueAsOption:
|
|
40
|
-
|
|
38
|
+
trimCustomInput: W = !1,
|
|
39
|
+
haveValueAsOption: $ = !1,
|
|
40
|
+
...j
|
|
41
41
|
}) {
|
|
42
|
-
const
|
|
43
|
-
(e) => de(e) && e.type ===
|
|
44
|
-
), [
|
|
45
|
-
if (
|
|
46
|
-
const e =
|
|
42
|
+
const x = pe.toArray(V).filter(
|
|
43
|
+
(e) => de(e) && e.type === U
|
|
44
|
+
), [L, q] = a(() => {
|
|
45
|
+
if (g != null) {
|
|
46
|
+
const e = x.findIndex((o) => o.props.value === g);
|
|
47
47
|
if (e !== -1)
|
|
48
48
|
return e;
|
|
49
49
|
}
|
|
50
50
|
return -1;
|
|
51
|
-
}), M =
|
|
51
|
+
}), M = T(""), [Z, _] = a(I), [f, k] = a(L), [m, X] = a(A), c = T(null), [z, G] = a(x.length), [n, B] = a(
|
|
52
52
|
() => C(A, I)
|
|
53
|
-
), [
|
|
54
|
-
function
|
|
55
|
-
const
|
|
53
|
+
), [J, Q] = a(), [Y, ee] = a();
|
|
54
|
+
function te(e) {
|
|
55
|
+
const o = e.key, t = e.currentTarget, s = M.current = o;
|
|
56
56
|
if (M.current = "", s)
|
|
57
|
-
switch (
|
|
57
|
+
switch (o) {
|
|
58
58
|
case "Enter": {
|
|
59
|
-
if (n[
|
|
60
|
-
const p =
|
|
59
|
+
if (n[f] == null) {
|
|
60
|
+
const p = W ? t.value.trim() : t.value;
|
|
61
61
|
if (p === "")
|
|
62
62
|
return;
|
|
63
|
-
const y = p.toLocaleLowerCase(),
|
|
63
|
+
const y = p.toLocaleLowerCase(), i = x.find(
|
|
64
64
|
(v) => v.props.value.toLocaleLowerCase() === y || v.props.label != null && v.props.label.toLocaleLowerCase() === y
|
|
65
|
-
),
|
|
65
|
+
), E = i != null, d = i?.props.label || p, le = i?.props.value || p;
|
|
66
66
|
requestAnimationFrame(() => {
|
|
67
|
-
|
|
67
|
+
h && h(
|
|
68
|
+
le,
|
|
69
|
+
d,
|
|
70
|
+
E,
|
|
71
|
+
i?.props.obfuscate ?? !1
|
|
72
|
+
);
|
|
68
73
|
});
|
|
69
74
|
break;
|
|
70
75
|
}
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
76
|
+
const u = n[f].props;
|
|
77
|
+
if (u.disabled)
|
|
73
78
|
break;
|
|
74
79
|
requestAnimationFrame(() => {
|
|
75
|
-
|
|
80
|
+
h && h(
|
|
81
|
+
u.value,
|
|
82
|
+
u.label,
|
|
83
|
+
!0,
|
|
84
|
+
u.obfuscate ?? !1
|
|
85
|
+
);
|
|
76
86
|
});
|
|
77
87
|
break;
|
|
78
88
|
}
|
|
79
89
|
case "Escape": {
|
|
80
|
-
|
|
90
|
+
b && b(t.value, t.selectionStart, t.selectionEnd);
|
|
81
91
|
break;
|
|
82
92
|
}
|
|
83
93
|
}
|
|
84
94
|
F && F(e);
|
|
85
95
|
}
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
switch (M.current =
|
|
96
|
+
function se(e) {
|
|
97
|
+
const o = e.key;
|
|
98
|
+
switch (M.current = o, o) {
|
|
89
99
|
case "ArrowDown": {
|
|
90
|
-
let t =
|
|
100
|
+
let t = f + 1;
|
|
91
101
|
for (; t < n.length && n[t]?.props.disabled; )
|
|
92
102
|
t++;
|
|
93
103
|
if (t === n.length) {
|
|
@@ -95,13 +105,13 @@ function je({
|
|
|
95
105
|
t++;
|
|
96
106
|
t === n.length && (t = -1);
|
|
97
107
|
}
|
|
98
|
-
|
|
108
|
+
k(t), e.preventDefault();
|
|
99
109
|
break;
|
|
100
110
|
}
|
|
101
111
|
case "Tab": {
|
|
102
112
|
let t = 1;
|
|
103
113
|
e.shiftKey && (t = -1);
|
|
104
|
-
let s =
|
|
114
|
+
let s = f + t;
|
|
105
115
|
if (t > 0)
|
|
106
116
|
for (; s < n.length && n[s]?.props.disabled; )
|
|
107
117
|
s++;
|
|
@@ -117,11 +127,11 @@ function je({
|
|
|
117
127
|
s--;
|
|
118
128
|
s === -1 && (s = -1);
|
|
119
129
|
}
|
|
120
|
-
|
|
130
|
+
k(s), e.preventDefault();
|
|
121
131
|
break;
|
|
122
132
|
}
|
|
123
133
|
case "ArrowUp": {
|
|
124
|
-
let t =
|
|
134
|
+
let t = f - 1;
|
|
125
135
|
for (; t >= 0 && n[t]?.props.disabled; )
|
|
126
136
|
t--;
|
|
127
137
|
if (t === -1) {
|
|
@@ -129,105 +139,105 @@ function je({
|
|
|
129
139
|
t--;
|
|
130
140
|
t === -1 && (t = -1);
|
|
131
141
|
}
|
|
132
|
-
|
|
142
|
+
k(t), e.preventDefault();
|
|
133
143
|
break;
|
|
134
144
|
}
|
|
135
145
|
}
|
|
136
146
|
H && H(e);
|
|
137
147
|
}
|
|
138
|
-
function C(e,
|
|
139
|
-
const t =
|
|
140
|
-
const
|
|
141
|
-
return
|
|
148
|
+
function C(e, o) {
|
|
149
|
+
const t = x.filter((s) => {
|
|
150
|
+
const w = s.props, u = String(w.label).toLocaleLowerCase(), p = w.keywords?.map((d) => d.toLocaleLowerCase()) || [], y = String(w.value).toLocaleLowerCase(), i = e.toLocaleLowerCase();
|
|
151
|
+
return w.obfuscate ?? !1 ? u.includes(i) || p.some((d) => d.includes(i)) : u.includes(i) || p.some((d) => d.includes(i)) || y.includes(i);
|
|
142
152
|
});
|
|
143
|
-
return
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
),
|
|
153
|
+
return $ && e.trim().length > 0 && !t.some((s) => s.props.value === e) && t.unshift(
|
|
154
|
+
/* @__PURE__ */ r(U, { value: e, label: e, keywords: [e], children: e }, "value")
|
|
155
|
+
), G(t.length), t.slice(0, o);
|
|
146
156
|
}
|
|
147
|
-
function
|
|
148
|
-
const e =
|
|
157
|
+
function ne() {
|
|
158
|
+
const e = c.current;
|
|
149
159
|
e?.focus();
|
|
150
160
|
}
|
|
151
|
-
function
|
|
152
|
-
const e =
|
|
153
|
-
e != null &&
|
|
161
|
+
function oe() {
|
|
162
|
+
const e = c.current;
|
|
163
|
+
e != null && b && b(e.value, e.selectionStart, e.selectionEnd);
|
|
154
164
|
}
|
|
155
165
|
function ie(e) {
|
|
156
|
-
const
|
|
157
|
-
_(I),
|
|
158
|
-
const t = C(
|
|
166
|
+
const o = e.currentTarget;
|
|
167
|
+
_(I), X(e.target.value);
|
|
168
|
+
const t = C(o.value, I);
|
|
159
169
|
B(t), D && D(e.target.value);
|
|
160
170
|
}
|
|
161
|
-
function
|
|
162
|
-
const e =
|
|
171
|
+
function re() {
|
|
172
|
+
const e = Z + xe;
|
|
163
173
|
_(e);
|
|
164
|
-
const
|
|
165
|
-
B(
|
|
174
|
+
const o = C(m, e);
|
|
175
|
+
B(o);
|
|
166
176
|
}
|
|
167
177
|
return S(() => {
|
|
168
|
-
const e =
|
|
178
|
+
const e = c.current;
|
|
169
179
|
e != null && e.value.length > 0 ? e.select() : e?.focus();
|
|
170
180
|
}, []), S(() => {
|
|
171
|
-
if (
|
|
172
|
-
const e =
|
|
173
|
-
|
|
181
|
+
if (l != null) {
|
|
182
|
+
const e = l.getBoundingClientRect();
|
|
183
|
+
Q(`${e.width}px`), ee(`${e.height}px`), c.current != null && l instanceof HTMLInputElement && (c.current.value = l.value, c.current.selectionStart = l.selectionStart, c.current.selectionEnd = l.selectionEnd);
|
|
174
184
|
}
|
|
175
|
-
}, [
|
|
176
|
-
if (
|
|
185
|
+
}, [l]), S(() => {
|
|
186
|
+
if (g != null) {
|
|
177
187
|
const e = n.findIndex(
|
|
178
|
-
(
|
|
188
|
+
(o) => o.props.value === g
|
|
179
189
|
);
|
|
180
|
-
|
|
190
|
+
q(e);
|
|
181
191
|
}
|
|
182
|
-
}, [n,
|
|
183
|
-
|
|
184
|
-
}, [
|
|
192
|
+
}, [n, g]), S(() => {
|
|
193
|
+
k(m === "" ? L : -1);
|
|
194
|
+
}, [m, L]), /* @__PURE__ */ r(
|
|
185
195
|
me,
|
|
186
196
|
{
|
|
187
197
|
open: !0,
|
|
188
|
-
anchorElement:
|
|
189
|
-
onClose:
|
|
198
|
+
anchorElement: l,
|
|
199
|
+
onClose: oe,
|
|
190
200
|
verticalAnchor: "top",
|
|
191
201
|
verticalOrigin: "top",
|
|
192
202
|
verticalOffset: -4,
|
|
193
|
-
children: /* @__PURE__ */
|
|
194
|
-
|
|
203
|
+
children: /* @__PURE__ */ K(
|
|
204
|
+
O,
|
|
195
205
|
{
|
|
196
|
-
minHeight: `calc(${
|
|
206
|
+
minHeight: `calc(${Y}, 8px)`,
|
|
197
207
|
maxHeight: "300px",
|
|
198
|
-
minWidth:
|
|
208
|
+
minWidth: J,
|
|
199
209
|
width: "auto",
|
|
200
210
|
hAlign: "start",
|
|
201
|
-
className:
|
|
211
|
+
className: N(R["suggestion-list"], "suggestion-list"),
|
|
202
212
|
children: [
|
|
203
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ r(
|
|
204
214
|
"input",
|
|
205
215
|
{
|
|
206
|
-
ref:
|
|
207
|
-
value:
|
|
208
|
-
onKeyUp:
|
|
209
|
-
onKeyDown:
|
|
216
|
+
ref: c,
|
|
217
|
+
value: m,
|
|
218
|
+
onKeyUp: te,
|
|
219
|
+
onKeyDown: se,
|
|
210
220
|
onChange: ie,
|
|
211
|
-
className:
|
|
212
|
-
|
|
221
|
+
className: N(R.input, "suggestion-list-search-input"),
|
|
222
|
+
...j
|
|
213
223
|
},
|
|
214
224
|
-1
|
|
215
225
|
),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
n.map((e,
|
|
226
|
+
/* @__PURE__ */ K(O, { children: [
|
|
227
|
+
n.map((e, o) => /* @__PURE__ */ r(
|
|
218
228
|
ge,
|
|
219
229
|
{
|
|
220
230
|
option: e,
|
|
221
|
-
isSelected:
|
|
222
|
-
isFocused:
|
|
223
|
-
onClick:
|
|
231
|
+
isSelected: o === L && m !== "",
|
|
232
|
+
isFocused: o === f,
|
|
233
|
+
onClick: h
|
|
224
234
|
},
|
|
225
|
-
|
|
235
|
+
o
|
|
226
236
|
)),
|
|
227
|
-
|
|
237
|
+
z > n.length && /* @__PURE__ */ r(ce, { children: /* @__PURE__ */ r(he, { marginBlock: "8px", hierarchy: "tertiary", onClick: re, children: "Show More" }) })
|
|
228
238
|
] }),
|
|
229
|
-
n.length === 0 && /* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
239
|
+
n.length === 0 && /* @__PURE__ */ r(ue, { padding: "8px", className: R["no-results"], children: /* @__PURE__ */ r(ae, { children: P }) }),
|
|
240
|
+
/* @__PURE__ */ r(fe, { onRedirect: ne }, n.length + 1)
|
|
231
241
|
]
|
|
232
242
|
}
|
|
233
243
|
)
|