@dscout/particle 1.0.0-alpha.21 → 1.0.0-alpha.23
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/README.md +45 -76
- package/lib/cjs/components/advanced_options.d.ts +3 -3
- package/lib/cjs/components/advanced_options.js +14 -13
- package/lib/cjs/components/advanced_options.js.map +1 -1
- package/lib/cjs/components/attribute_input.d.ts +4 -3
- package/lib/cjs/components/attribute_input.js +4 -3
- package/lib/cjs/components/attribute_input.js.map +1 -1
- package/lib/cjs/components/attribute_selector.d.ts +4 -3
- package/lib/cjs/components/attribute_selector.js +4 -3
- package/lib/cjs/components/attribute_selector.js.map +1 -1
- package/lib/cjs/components/avatar.d.ts +3 -3
- package/lib/cjs/components/avatar.js +3 -2
- package/lib/cjs/components/avatar.js.map +1 -1
- package/lib/cjs/components/blitz.d.ts +2 -2
- package/lib/cjs/components/blitz.js +28 -4
- package/lib/cjs/components/blitz.js.map +1 -1
- package/lib/cjs/components/button.d.ts +3 -3
- package/lib/cjs/components/button.js +3 -2
- package/lib/cjs/components/button.js.map +1 -1
- package/lib/cjs/components/button_control.d.ts +3 -3
- package/lib/cjs/components/button_control.js +3 -2
- package/lib/cjs/components/button_control.js.map +1 -1
- package/lib/cjs/components/button_icon.d.ts +10 -10
- package/lib/cjs/components/button_icon.js +3 -2
- package/lib/cjs/components/button_icon.js.map +1 -1
- package/lib/cjs/components/button_mode.d.ts +3 -3
- package/lib/cjs/components/button_mode.js +3 -2
- package/lib/cjs/components/button_mode.js.map +1 -1
- package/lib/cjs/components/button_plain.d.ts +3 -3
- package/lib/cjs/components/button_plain.js +3 -2
- package/lib/cjs/components/button_plain.js.map +1 -1
- package/lib/cjs/components/card.d.ts +3 -3
- package/lib/cjs/components/card.js +3 -2
- package/lib/cjs/components/card.js.map +1 -1
- package/lib/cjs/components/card_body.d.ts +3 -3
- package/lib/cjs/components/card_body.js +3 -2
- package/lib/cjs/components/card_body.js.map +1 -1
- package/lib/cjs/components/card_footer.d.ts +3 -3
- package/lib/cjs/components/card_footer.js +3 -2
- package/lib/cjs/components/card_footer.js.map +1 -1
- package/lib/cjs/components/cards.d.ts +3 -3
- package/lib/cjs/components/cards.js +3 -2
- package/lib/cjs/components/cards.js.map +1 -1
- package/lib/cjs/components/checkbox_input.d.ts +5 -3
- package/lib/cjs/components/checkbox_input.js +4 -3
- package/lib/cjs/components/checkbox_input.js.map +1 -1
- package/lib/cjs/components/chip.d.ts +3 -3
- package/lib/cjs/components/chip.js +3 -2
- package/lib/cjs/components/chip.js.map +1 -1
- package/lib/cjs/components/collapsible_content.d.ts +3 -3
- package/lib/cjs/components/collapsible_content.js +11 -3
- package/lib/cjs/components/collapsible_content.js.map +1 -1
- package/lib/cjs/components/collapsing_menu.d.ts +3 -3
- package/lib/cjs/components/collapsing_menu.js +39 -16
- package/lib/cjs/components/collapsing_menu.js.map +1 -1
- package/lib/cjs/components/column.d.ts +2 -2
- package/lib/cjs/components/common_input.d.ts +3 -3
- package/lib/cjs/components/common_input.js +4 -2
- package/lib/cjs/components/common_input.js.map +1 -1
- package/lib/cjs/components/common_menu_item.d.ts +3 -3
- package/lib/cjs/components/common_menu_item.js +2 -2
- package/lib/cjs/components/common_menu_item.js.map +1 -1
- package/lib/cjs/components/container.d.ts +4 -3
- package/lib/cjs/components/container.js +8 -3
- package/lib/cjs/components/container.js.map +1 -1
- package/lib/cjs/components/container_header.d.ts +2 -2
- package/lib/cjs/components/date_input.d.ts +3 -3
- package/lib/cjs/components/date_input.js +2 -2
- package/lib/cjs/components/date_input.js.map +1 -1
- package/lib/cjs/components/drag_and_drop.d.ts +5 -3
- package/lib/cjs/components/drag_and_drop.js +4 -3
- package/lib/cjs/components/drag_and_drop.js.map +1 -1
- package/lib/cjs/components/dropdown.d.ts +2 -2
- package/lib/cjs/components/dropdown.js +3 -2
- package/lib/cjs/components/dropdown.js.map +1 -1
- package/lib/cjs/components/dropdown_input_toggle.d.ts +3 -3
- package/lib/cjs/components/dropdown_input_toggle.js +3 -2
- package/lib/cjs/components/dropdown_input_toggle.js.map +1 -1
- package/lib/cjs/components/editing_container.d.ts +2 -2
- package/lib/cjs/components/editing_container.js +8 -3
- package/lib/cjs/components/editing_container.js.map +1 -1
- package/lib/cjs/components/email_input.d.ts +3 -3
- package/lib/cjs/components/email_input.js +2 -2
- package/lib/cjs/components/email_input.js.map +1 -1
- package/lib/cjs/components/file_input.d.ts +5 -3
- package/lib/cjs/components/file_input.js +6 -4
- package/lib/cjs/components/file_input.js.map +1 -1
- package/lib/cjs/components/flex.d.ts +11 -4
- package/lib/cjs/components/flex.js +17 -11
- package/lib/cjs/components/flex.js.map +1 -1
- package/lib/cjs/components/focus_trap.d.ts +1 -1
- package/lib/cjs/components/footnote.d.ts +3 -3
- package/lib/cjs/components/footnote.js +3 -2
- package/lib/cjs/components/footnote.js.map +1 -1
- package/lib/cjs/components/heading.d.ts +3 -3
- package/lib/cjs/components/heading.js +4 -3
- package/lib/cjs/components/heading.js.map +1 -1
- package/lib/cjs/components/input_addon.js +1 -1
- package/lib/cjs/components/input_addon.js.map +1 -1
- package/lib/cjs/components/input_group.d.ts +3 -3
- package/lib/cjs/components/input_group.js +3 -2
- package/lib/cjs/components/input_group.js.map +1 -1
- package/lib/cjs/components/input_group_item.js +1 -1
- package/lib/cjs/components/input_group_item.js.map +1 -1
- package/lib/cjs/components/link_text.d.ts +3 -3
- package/lib/cjs/components/link_text.js +3 -2
- package/lib/cjs/components/link_text.js.map +1 -1
- package/lib/cjs/components/list.d.ts +3 -3
- package/lib/cjs/components/list.js +4 -3
- package/lib/cjs/components/list.js.map +1 -1
- package/lib/cjs/components/list_inline.d.ts +3 -3
- package/lib/cjs/components/list_inline.js +4 -3
- package/lib/cjs/components/list_inline.js.map +1 -1
- package/lib/cjs/components/menu.d.ts +3 -3
- package/lib/cjs/components/menu.js +3 -2
- package/lib/cjs/components/menu.js.map +1 -1
- package/lib/cjs/components/menu_item.d.ts +3 -3
- package/lib/cjs/components/menu_item.js +2 -2
- package/lib/cjs/components/menu_item.js.map +1 -1
- package/lib/cjs/components/menu_item_li.d.ts +2 -2
- package/lib/cjs/components/menu_item_li.js +2 -2
- package/lib/cjs/components/menu_item_li.js.map +1 -1
- package/lib/cjs/components/menu_link.d.ts +3 -3
- package/lib/cjs/components/menu_link.js +2 -2
- package/lib/cjs/components/menu_link.js.map +1 -1
- package/lib/cjs/components/menu_list.d.ts +3 -3
- package/lib/cjs/components/menu_list.js +3 -2
- package/lib/cjs/components/menu_list.js.map +1 -1
- package/lib/cjs/components/menu_section.d.ts +3 -3
- package/lib/cjs/components/menu_section.js +3 -2
- package/lib/cjs/components/menu_section.js.map +1 -1
- package/lib/cjs/components/menu_title.d.ts +3 -3
- package/lib/cjs/components/menu_title.js +3 -2
- package/lib/cjs/components/menu_title.js.map +1 -1
- package/lib/cjs/components/modal.d.ts +5 -3
- package/lib/cjs/components/modal.js +3 -3
- package/lib/cjs/components/modal.js.map +1 -1
- package/lib/cjs/components/modifier.d.ts +13 -13
- package/lib/cjs/components/modifier.js +3 -43
- package/lib/cjs/components/modifier.js.map +1 -1
- package/lib/cjs/components/number_input.d.ts +3 -3
- package/lib/cjs/components/number_input.js +2 -2
- package/lib/cjs/components/number_input.js.map +1 -1
- package/lib/cjs/components/password_input.d.ts +3 -3
- package/lib/cjs/components/password_input.js +2 -2
- package/lib/cjs/components/password_input.js.map +1 -1
- package/lib/cjs/components/pill.d.ts +3 -3
- package/lib/cjs/components/pill.js +3 -2
- package/lib/cjs/components/pill.js.map +1 -1
- package/lib/cjs/components/radio_input.d.ts +4 -3
- package/lib/cjs/components/radio_input.js +4 -3
- package/lib/cjs/components/radio_input.js.map +1 -1
- package/lib/cjs/components/range_input.d.ts +4 -3
- package/lib/cjs/components/range_input.js +5 -3
- package/lib/cjs/components/range_input.js.map +1 -1
- package/lib/cjs/components/row.d.ts +3 -3
- package/lib/cjs/components/row.js +3 -2
- package/lib/cjs/components/row.js.map +1 -1
- package/lib/cjs/components/search_input.d.ts +3 -3
- package/lib/cjs/components/search_input.js +2 -2
- package/lib/cjs/components/search_input.js.map +1 -1
- package/lib/cjs/components/segmented_controls.d.ts +3 -3
- package/lib/cjs/components/segmented_controls.js +3 -2
- package/lib/cjs/components/segmented_controls.js.map +1 -1
- package/lib/cjs/components/select_input.d.ts +5 -3
- package/lib/cjs/components/select_input.js +6 -4
- package/lib/cjs/components/select_input.js.map +1 -1
- package/lib/cjs/components/separator.d.ts +2 -2
- package/lib/cjs/components/speech_bubble.d.ts +3 -3
- package/lib/cjs/components/speech_bubble.js +3 -2
- package/lib/cjs/components/speech_bubble.js.map +1 -1
- package/lib/cjs/components/tags_input.d.ts +2 -2
- package/lib/cjs/components/tags_input.js +3 -2
- package/lib/cjs/components/tags_input.js.map +1 -1
- package/lib/cjs/components/text_input.d.ts +3 -3
- package/lib/cjs/components/text_input.js +2 -2
- package/lib/cjs/components/text_input.js.map +1 -1
- package/lib/cjs/components/textarea.d.ts +5 -3
- package/lib/cjs/components/textarea.js +5 -4
- package/lib/cjs/components/textarea.js.map +1 -1
- package/lib/cjs/components/theme_provider.d.ts +29 -1
- package/lib/cjs/components/theme_provider.js +28 -28
- package/lib/cjs/components/theme_provider.js.map +1 -1
- package/lib/cjs/components/thumbnail.d.ts +3 -3
- package/lib/cjs/components/thumbnail.js +3 -2
- package/lib/cjs/components/thumbnail.js.map +1 -1
- package/lib/cjs/components/togglable_fieldset.d.ts +3 -3
- package/lib/cjs/components/togglable_fieldset.js +7 -7
- package/lib/cjs/components/togglable_fieldset.js.map +1 -1
- package/lib/cjs/components/toggle.d.ts +5 -3
- package/lib/cjs/components/toggle.js +4 -3
- package/lib/cjs/components/toggle.js.map +1 -1
- package/lib/cjs/components/tooltip.d.ts +2 -2
- package/lib/cjs/components/tooltip_container.d.ts +3 -3
- package/lib/cjs/components/tooltip_container.js +3 -2
- package/lib/cjs/components/tooltip_container.js.map +1 -1
- package/lib/cjs/components/with_addons.d.ts +3 -3
- package/lib/cjs/components/with_addons.js +2 -2
- package/lib/cjs/components/with_addons.js.map +1 -1
- package/lib/cjs/index.d.ts +0 -1
- package/lib/cjs/index.js +5 -7
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types.d.ts +17 -4
- package/lib/cjs/utils/dom.d.ts +1 -1
- package/lib/cjs/utils/modifier_classes.d.ts +6 -0
- package/lib/cjs/utils/modifier_classes.js +57 -0
- package/lib/cjs/utils/modifier_classes.js.map +1 -0
- package/lib/cjs/utils/strings.d.ts +0 -2
- package/lib/cjs/utils/strings.js +1 -8
- package/lib/cjs/utils/strings.js.map +1 -1
- package/lib/esm/components/advanced_options.d.ts +3 -3
- package/lib/esm/components/advanced_options.js +15 -14
- package/lib/esm/components/advanced_options.js.map +1 -1
- package/lib/esm/components/attribute_input.d.ts +4 -3
- package/lib/esm/components/attribute_input.js +4 -3
- package/lib/esm/components/attribute_input.js.map +1 -1
- package/lib/esm/components/attribute_selector.d.ts +4 -3
- package/lib/esm/components/attribute_selector.js +4 -3
- package/lib/esm/components/attribute_selector.js.map +1 -1
- package/lib/esm/components/avatar.d.ts +3 -3
- package/lib/esm/components/avatar.js +3 -2
- package/lib/esm/components/avatar.js.map +1 -1
- package/lib/esm/components/blitz.d.ts +2 -2
- package/lib/esm/components/blitz.js +5 -4
- package/lib/esm/components/blitz.js.map +1 -1
- package/lib/esm/components/button.d.ts +3 -3
- package/lib/esm/components/button.js +3 -2
- package/lib/esm/components/button.js.map +1 -1
- package/lib/esm/components/button_control.d.ts +3 -3
- package/lib/esm/components/button_control.js +3 -2
- package/lib/esm/components/button_control.js.map +1 -1
- package/lib/esm/components/button_icon.d.ts +10 -10
- package/lib/esm/components/button_icon.js +3 -2
- package/lib/esm/components/button_icon.js.map +1 -1
- package/lib/esm/components/button_mode.d.ts +3 -3
- package/lib/esm/components/button_mode.js +3 -2
- package/lib/esm/components/button_mode.js.map +1 -1
- package/lib/esm/components/button_plain.d.ts +3 -3
- package/lib/esm/components/button_plain.js +3 -2
- package/lib/esm/components/button_plain.js.map +1 -1
- package/lib/esm/components/card.d.ts +3 -3
- package/lib/esm/components/card.js +3 -2
- package/lib/esm/components/card.js.map +1 -1
- package/lib/esm/components/card_body.d.ts +3 -3
- package/lib/esm/components/card_body.js +3 -2
- package/lib/esm/components/card_body.js.map +1 -1
- package/lib/esm/components/card_footer.d.ts +3 -3
- package/lib/esm/components/card_footer.js +3 -2
- package/lib/esm/components/card_footer.js.map +1 -1
- package/lib/esm/components/cards.d.ts +3 -3
- package/lib/esm/components/cards.js +3 -2
- package/lib/esm/components/cards.js.map +1 -1
- package/lib/esm/components/checkbox_input.d.ts +5 -3
- package/lib/esm/components/checkbox_input.js +4 -3
- package/lib/esm/components/checkbox_input.js.map +1 -1
- package/lib/esm/components/chip.d.ts +3 -3
- package/lib/esm/components/chip.js +3 -2
- package/lib/esm/components/chip.js.map +1 -1
- package/lib/esm/components/collapsible_content.d.ts +3 -3
- package/lib/esm/components/collapsible_content.js +11 -3
- package/lib/esm/components/collapsible_content.js.map +1 -1
- package/lib/esm/components/collapsing_menu.d.ts +3 -3
- package/lib/esm/components/collapsing_menu.js +16 -16
- package/lib/esm/components/collapsing_menu.js.map +1 -1
- package/lib/esm/components/column.d.ts +2 -2
- package/lib/esm/components/common_input.d.ts +3 -3
- package/lib/esm/components/common_input.js +4 -2
- package/lib/esm/components/common_input.js.map +1 -1
- package/lib/esm/components/common_menu_item.d.ts +3 -3
- package/lib/esm/components/common_menu_item.js +2 -2
- package/lib/esm/components/common_menu_item.js.map +1 -1
- package/lib/esm/components/container.d.ts +4 -3
- package/lib/esm/components/container.js +8 -3
- package/lib/esm/components/container.js.map +1 -1
- package/lib/esm/components/container_header.d.ts +2 -2
- package/lib/esm/components/date_input.d.ts +3 -3
- package/lib/esm/components/date_input.js +2 -2
- package/lib/esm/components/date_input.js.map +1 -1
- package/lib/esm/components/drag_and_drop.d.ts +5 -3
- package/lib/esm/components/drag_and_drop.js +4 -3
- package/lib/esm/components/drag_and_drop.js.map +1 -1
- package/lib/esm/components/dropdown.d.ts +2 -2
- package/lib/esm/components/dropdown.js +3 -2
- package/lib/esm/components/dropdown.js.map +1 -1
- package/lib/esm/components/dropdown_input_toggle.d.ts +3 -3
- package/lib/esm/components/dropdown_input_toggle.js +3 -2
- package/lib/esm/components/dropdown_input_toggle.js.map +1 -1
- package/lib/esm/components/editing_container.d.ts +2 -2
- package/lib/esm/components/editing_container.js +8 -3
- package/lib/esm/components/editing_container.js.map +1 -1
- package/lib/esm/components/email_input.d.ts +3 -3
- package/lib/esm/components/email_input.js +2 -2
- package/lib/esm/components/email_input.js.map +1 -1
- package/lib/esm/components/file_input.d.ts +5 -3
- package/lib/esm/components/file_input.js +6 -4
- package/lib/esm/components/file_input.js.map +1 -1
- package/lib/esm/components/flex.d.ts +11 -4
- package/lib/esm/components/flex.js +17 -11
- package/lib/esm/components/flex.js.map +1 -1
- package/lib/esm/components/focus_trap.d.ts +1 -1
- package/lib/esm/components/footnote.d.ts +3 -3
- package/lib/esm/components/footnote.js +3 -2
- package/lib/esm/components/footnote.js.map +1 -1
- package/lib/esm/components/heading.d.ts +3 -3
- package/lib/esm/components/heading.js +4 -3
- package/lib/esm/components/heading.js.map +1 -1
- package/lib/esm/components/input_addon.js +1 -1
- package/lib/esm/components/input_addon.js.map +1 -1
- package/lib/esm/components/input_group.d.ts +3 -3
- package/lib/esm/components/input_group.js +3 -2
- package/lib/esm/components/input_group.js.map +1 -1
- package/lib/esm/components/input_group_item.js +1 -1
- package/lib/esm/components/input_group_item.js.map +1 -1
- package/lib/esm/components/link_text.d.ts +3 -3
- package/lib/esm/components/link_text.js +3 -2
- package/lib/esm/components/link_text.js.map +1 -1
- package/lib/esm/components/list.d.ts +3 -3
- package/lib/esm/components/list.js +4 -3
- package/lib/esm/components/list.js.map +1 -1
- package/lib/esm/components/list_inline.d.ts +3 -3
- package/lib/esm/components/list_inline.js +4 -3
- package/lib/esm/components/list_inline.js.map +1 -1
- package/lib/esm/components/menu.d.ts +3 -3
- package/lib/esm/components/menu.js +3 -2
- package/lib/esm/components/menu.js.map +1 -1
- package/lib/esm/components/menu_item.d.ts +3 -3
- package/lib/esm/components/menu_item.js +2 -2
- package/lib/esm/components/menu_item.js.map +1 -1
- package/lib/esm/components/menu_item_li.d.ts +2 -2
- package/lib/esm/components/menu_item_li.js +2 -2
- package/lib/esm/components/menu_item_li.js.map +1 -1
- package/lib/esm/components/menu_link.d.ts +3 -3
- package/lib/esm/components/menu_link.js +2 -2
- package/lib/esm/components/menu_link.js.map +1 -1
- package/lib/esm/components/menu_list.d.ts +3 -3
- package/lib/esm/components/menu_list.js +3 -2
- package/lib/esm/components/menu_list.js.map +1 -1
- package/lib/esm/components/menu_section.d.ts +3 -3
- package/lib/esm/components/menu_section.js +3 -2
- package/lib/esm/components/menu_section.js.map +1 -1
- package/lib/esm/components/menu_title.d.ts +3 -3
- package/lib/esm/components/menu_title.js +3 -2
- package/lib/esm/components/menu_title.js.map +1 -1
- package/lib/esm/components/modal.d.ts +5 -3
- package/lib/esm/components/modal.js +3 -3
- package/lib/esm/components/modal.js.map +1 -1
- package/lib/esm/components/modifier.d.ts +13 -13
- package/lib/esm/components/modifier.js +3 -43
- package/lib/esm/components/modifier.js.map +1 -1
- package/lib/esm/components/number_input.d.ts +3 -3
- package/lib/esm/components/number_input.js +2 -2
- package/lib/esm/components/number_input.js.map +1 -1
- package/lib/esm/components/password_input.d.ts +3 -3
- package/lib/esm/components/password_input.js +2 -2
- package/lib/esm/components/password_input.js.map +1 -1
- package/lib/esm/components/pill.d.ts +3 -3
- package/lib/esm/components/pill.js +3 -2
- package/lib/esm/components/pill.js.map +1 -1
- package/lib/esm/components/radio_input.d.ts +4 -3
- package/lib/esm/components/radio_input.js +4 -3
- package/lib/esm/components/radio_input.js.map +1 -1
- package/lib/esm/components/range_input.d.ts +4 -3
- package/lib/esm/components/range_input.js +5 -3
- package/lib/esm/components/range_input.js.map +1 -1
- package/lib/esm/components/row.d.ts +3 -3
- package/lib/esm/components/row.js +3 -2
- package/lib/esm/components/row.js.map +1 -1
- package/lib/esm/components/search_input.d.ts +3 -3
- package/lib/esm/components/search_input.js +2 -2
- package/lib/esm/components/search_input.js.map +1 -1
- package/lib/esm/components/segmented_controls.d.ts +3 -3
- package/lib/esm/components/segmented_controls.js +3 -2
- package/lib/esm/components/segmented_controls.js.map +1 -1
- package/lib/esm/components/select_input.d.ts +5 -3
- package/lib/esm/components/select_input.js +6 -4
- package/lib/esm/components/select_input.js.map +1 -1
- package/lib/esm/components/separator.d.ts +2 -2
- package/lib/esm/components/speech_bubble.d.ts +3 -3
- package/lib/esm/components/speech_bubble.js +3 -2
- package/lib/esm/components/speech_bubble.js.map +1 -1
- package/lib/esm/components/tags_input.d.ts +2 -2
- package/lib/esm/components/tags_input.js +3 -2
- package/lib/esm/components/tags_input.js.map +1 -1
- package/lib/esm/components/text_input.d.ts +3 -3
- package/lib/esm/components/text_input.js +2 -2
- package/lib/esm/components/text_input.js.map +1 -1
- package/lib/esm/components/textarea.d.ts +5 -3
- package/lib/esm/components/textarea.js +5 -4
- package/lib/esm/components/textarea.js.map +1 -1
- package/lib/esm/components/theme_provider.d.ts +29 -1
- package/lib/esm/components/theme_provider.js +28 -28
- package/lib/esm/components/theme_provider.js.map +1 -1
- package/lib/esm/components/thumbnail.d.ts +3 -3
- package/lib/esm/components/thumbnail.js +3 -2
- package/lib/esm/components/thumbnail.js.map +1 -1
- package/lib/esm/components/togglable_fieldset.d.ts +3 -3
- package/lib/esm/components/togglable_fieldset.js +7 -7
- package/lib/esm/components/togglable_fieldset.js.map +1 -1
- package/lib/esm/components/toggle.d.ts +5 -3
- package/lib/esm/components/toggle.js +4 -3
- package/lib/esm/components/toggle.js.map +1 -1
- package/lib/esm/components/tooltip.d.ts +2 -2
- package/lib/esm/components/tooltip_container.d.ts +3 -3
- package/lib/esm/components/tooltip_container.js +3 -2
- package/lib/esm/components/tooltip_container.js.map +1 -1
- package/lib/esm/components/with_addons.d.ts +3 -3
- package/lib/esm/components/with_addons.js +2 -2
- package/lib/esm/components/with_addons.js.map +1 -1
- package/lib/esm/index.d.ts +0 -1
- package/lib/esm/index.js +0 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.d.ts +17 -4
- package/lib/esm/utils/dom.d.ts +1 -1
- package/lib/esm/utils/modifier_classes.d.ts +6 -0
- package/lib/esm/utils/modifier_classes.js +46 -0
- package/lib/esm/utils/modifier_classes.js.map +1 -0
- package/lib/esm/utils/strings.d.ts +0 -2
- package/lib/esm/utils/strings.js +0 -6
- package/lib/esm/utils/strings.js.map +1 -1
- package/lib/stylesheets/particle.css +188 -156
- package/lib/stylesheets/particle.css.map +1 -1
- package/lib/stylesheets/particle.min.css +1 -1
- package/lib/stylesheets/particle.min.css.gz +0 -0
- package/package.json +1 -1
- package/styles/color_schemes/_base_colors.scss +1 -1
- package/styles/components/collapsible/_base.scss +11 -3
- package/styles/components/container/_base.scss +32 -5
- package/styles/components/container/themes/_theme_builder.scss +12 -6
- package/styles/components/drag_and_drop/themes/_theme_builder.scss +3 -3
- package/styles/utilities/_shadows.scss +4 -0
- package/styles/utilities/_spacing.scss +59 -39
- package/lib/cjs/components/collapsible.d.ts +0 -10
- package/lib/cjs/components/collapsible.js +0 -17
- package/lib/cjs/components/collapsible.js.map +0 -1
- package/lib/cjs/components/focus_intent.d.ts +0 -23
- package/lib/cjs/components/focus_intent.js +0 -92
- package/lib/cjs/components/focus_intent.js.map +0 -1
- package/lib/esm/components/collapsible.d.ts +0 -10
- package/lib/esm/components/collapsible.js +0 -13
- package/lib/esm/components/collapsible.js.map +0 -1
- package/lib/esm/components/focus_intent.d.ts +0 -23
- package/lib/esm/components/focus_intent.js +0 -66
- package/lib/esm/components/focus_intent.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Particle
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A CSS framework and React component library for building dscout user interfaces. Visit the [documentation site] to learn more.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
4
6
|
|
|
5
7
|
Install particle using [yarn] or [npm]:
|
|
6
8
|
|
|
7
|
-
```
|
|
9
|
+
```bash
|
|
8
10
|
$ yarn add @dscout/particle
|
|
9
11
|
$ npm install --save @dscout/particle
|
|
10
12
|
```
|
|
11
13
|
|
|
12
|
-
Visit the [demo site] to see example code of the components.
|
|
13
14
|
Everything is a named export on the namespace "@dscout/particle," for example:
|
|
14
15
|
|
|
15
16
|
```javascript
|
|
16
|
-
import React from 'react'
|
|
17
|
-
import { Container,
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { Container, Heading } from '@dscout/particle';
|
|
18
19
|
|
|
19
20
|
export default function Announcement() {
|
|
20
21
|
return (
|
|
21
22
|
<Container>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
<p>Make sure to eat your vegetables.</p>
|
|
25
|
-
</ContainerInner>
|
|
23
|
+
<Heading level="2">Important!</Heading>
|
|
24
|
+
<p>Make sure to eat your vegetables.</p>
|
|
26
25
|
</Container>
|
|
27
|
-
)
|
|
26
|
+
);
|
|
28
27
|
}
|
|
29
28
|
```
|
|
30
29
|
|
|
@@ -43,106 +42,76 @@ To import into a plain CSS file:
|
|
|
43
42
|
The source `scss` file is located in the `styles` directory.
|
|
44
43
|
You can import it into your own `scss` file like so:
|
|
45
44
|
|
|
46
|
-
```
|
|
47
|
-
@import '
|
|
45
|
+
```scss
|
|
46
|
+
@import '@dscout/particle/styles/particle.scss';
|
|
48
47
|
```
|
|
49
48
|
|
|
50
49
|
## Developing with Storybook
|
|
51
|
-
Particle uses asdf to manage the node dependencies. To develop locally first
|
|
52
|
-
install asdf with:
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
$ brew install asdf
|
|
56
|
-
```
|
|
51
|
+
Storybook provides an isolated development environment for Particle components as well as a published static site that serves as a playground and documentation.
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
### Install dependencies
|
|
59
54
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
Particle uses asdf to manage the node dependencies. To develop locally first
|
|
56
|
+
install asdf with:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
brew install asdf
|
|
63
60
|
```
|
|
64
61
|
|
|
65
|
-
|
|
62
|
+
Then install nodejs. If you don't already have nodejs set up on your machine you may first need install its dependencies and OpenPGP keys:
|
|
66
63
|
|
|
67
|
-
```
|
|
68
|
-
|
|
64
|
+
```bash
|
|
65
|
+
brew install coreutils
|
|
66
|
+
brew install gpg
|
|
67
|
+
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
|
|
69
68
|
```
|
|
70
69
|
|
|
71
70
|
Install asdf dependencies
|
|
72
71
|
|
|
73
|
-
```
|
|
74
|
-
|
|
72
|
+
```bash
|
|
73
|
+
asdf install
|
|
75
74
|
```
|
|
76
75
|
|
|
77
|
-
Install dependencies with [yarn]:
|
|
76
|
+
Install NPM dependencies with [yarn]:
|
|
78
77
|
|
|
78
|
+
```bash
|
|
79
|
+
yarn install
|
|
79
80
|
```
|
|
80
|
-
$ yarn install
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Storybook
|
|
84
81
|
|
|
85
|
-
|
|
86
|
-
Start up the development server with `yarn start` and open your
|
|
87
|
-
browser to `http://localhost:6006`.
|
|
82
|
+
### Start Storybook
|
|
88
83
|
|
|
89
|
-
|
|
84
|
+
Run Storybook locally:
|
|
90
85
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
```bash
|
|
87
|
+
yarn start
|
|
88
|
+
```
|
|
94
89
|
|
|
95
90
|
## Scripts
|
|
96
91
|
|
|
97
92
|
A variety of scripts are provided for running common tasks.
|
|
98
93
|
|
|
99
|
-
Lint with ESLint:
|
|
100
|
-
```
|
|
101
|
-
$ yarn lint
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Watch the tests with Karma:
|
|
105
|
-
```
|
|
106
|
-
$ yarn test
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Lint, then run the test suite:
|
|
110
|
-
```
|
|
111
|
-
$ yarn ci
|
|
112
|
-
```
|
|
94
|
+
Lint with ESLint and run typechecker:
|
|
113
95
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
$ yarn clean
|
|
96
|
+
```bash
|
|
97
|
+
yarn lint
|
|
117
98
|
```
|
|
118
99
|
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
$ yarn build
|
|
122
|
-
```
|
|
100
|
+
Start the Vitest test runner in watch mode:
|
|
123
101
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
$ yarn nano
|
|
102
|
+
```bash
|
|
103
|
+
yarn test
|
|
127
104
|
```
|
|
128
105
|
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
$ yarn release
|
|
132
|
-
```
|
|
106
|
+
## Contributing
|
|
133
107
|
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
$ yarn build-docs
|
|
137
|
-
```
|
|
108
|
+
[See the wiki](https://github.com/dscout/particle/wiki/Development-and-QA-workflow) for details on how to contribute to Particle.
|
|
138
109
|
|
|
139
110
|
## Releasing a new version
|
|
140
111
|
|
|
141
|
-
|
|
142
112
|
Instructions for preparing a new release and submitting it to npm can be found [here](https://github.com/dscout/particle/wiki/Versioning-&-Releases).
|
|
143
113
|
|
|
144
|
-
[
|
|
145
|
-
[npm]:
|
|
146
|
-
[React]: https://facebook.github.io/react/
|
|
114
|
+
[documentation site]: https://dscout.github.io/particle/
|
|
115
|
+
[npm]: https://www.npmjs.com/
|
|
147
116
|
[Storybook]: https://getstorybook.io/
|
|
148
|
-
[yarn]:
|
|
117
|
+
[yarn]: https://yarnpkg.com/en/docs/install
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CommonComponentProps,
|
|
2
|
+
import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
|
-
interface AdvancedOptionsProps extends CommonComponentProps,
|
|
4
|
+
interface AdvancedOptionsProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
getRef?: GetRef<HTMLDivElement>;
|
|
@@ -10,5 +10,5 @@ interface AdvancedOptionsProps extends CommonComponentProps, ModifierProps {
|
|
|
10
10
|
name?: string;
|
|
11
11
|
title: React.ReactNode;
|
|
12
12
|
}
|
|
13
|
-
export declare function AdvancedOptions({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, initialCollapsed, name, title, ...rest }: AdvancedOptionsProps): React.JSX.Element;
|
|
13
|
+
export declare function AdvancedOptions({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, initialCollapsed, margin, name, title, ...rest }: AdvancedOptionsProps): React.JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -52,26 +52,27 @@ exports.AdvancedOptions = void 0;
|
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
53
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
54
54
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
55
|
+
var modifier_classes_1 = require("../utils/modifier_classes");
|
|
55
56
|
var button_plain_1 = require("./button_plain");
|
|
56
57
|
var collapsible_content_1 = require("./collapsible_content");
|
|
57
58
|
var triangle_inverted_1 = require("../icons/triangle_inverted");
|
|
58
59
|
var flex_1 = require("./flex");
|
|
59
60
|
var modifier_1 = require("./modifier");
|
|
60
|
-
var collapsible_1 = require("./collapsible");
|
|
61
61
|
function AdvancedOptions(_a) {
|
|
62
|
-
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? true : _b, name = _a.name, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "disabled", "getRef", "id", "initialCollapsed", "name", "title"]);
|
|
62
|
+
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, _b = _a.initialCollapsed, initialCollapsed = _b === void 0 ? true : _b, margin = _a.margin, name = _a.name, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "children", "disabled", "getRef", "id", "initialCollapsed", "margin", "name", "title"]);
|
|
63
|
+
var _c = (0, react_1.useState)(initialCollapsed), isCollapsed = _c[0], setIsCollapsed = _c[1];
|
|
63
64
|
var collapsibleContentId = (0, react_1.useId)();
|
|
64
|
-
return (react_1.default.createElement(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
return (react_1.default.createElement("div", { className: (0, class_names_1.default)((0, modifier_classes_1.getMarginClass)(margin), _modifierClass), ref: getRef },
|
|
66
|
+
react_1.default.createElement(modifier_1.Modifier, { margin: { bottom: 'none' } },
|
|
67
|
+
react_1.default.createElement(button_plain_1.ButtonPlain, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": collapsibleContentId, "aria-expanded": !isCollapsed, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, disabled: disabled, id: id, onClick: function () {
|
|
68
|
+
setIsCollapsed(function (prevCollapsed) { return !prevCollapsed; });
|
|
69
|
+
}, name: name || (typeof title === 'string' ? title : undefined) }),
|
|
70
|
+
react_1.default.createElement(flex_1.Flex, null,
|
|
71
|
+
title,
|
|
72
|
+
' ',
|
|
73
|
+
react_1.default.createElement(triangle_inverted_1.IconTriangleInverted, { direction: isCollapsed ? 'right' : 'down' })))),
|
|
74
|
+
react_1.default.createElement(collapsible_content_1.CollapsibleContent, { collapsed: isCollapsed, id: collapsibleContentId },
|
|
75
|
+
react_1.default.createElement("div", { className: "margin-t--0.75" }, children))));
|
|
75
76
|
}
|
|
76
77
|
exports.AdvancedOptions = AdvancedOptions;
|
|
77
78
|
//# sourceMappingURL=advanced_options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced_options.js","sourceRoot":"","sources":["../../../src/components/advanced_options.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"advanced_options.js","sourceRoot":"","sources":["../../../src/components/advanced_options.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+C;AAS/C,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA2D;AAE3D,+CAA6C;AAC7C,6DAA2D;AAC3D,gEAAkE;AAClE,+BAA8B;AAC9B,uCAAsC;AAetC,SAAgB,eAAe,CAAC,EAcT;IAbrB,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,wBAAuB,EAAvB,gBAAgB,mBAAG,IAAI,KAAA,EACvB,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,KAAK,WAAA,EACF,IAAI,cAbuB,8JAc/B,CADQ;IAED,IAAA,KAAgC,IAAA,gBAAQ,EAAC,gBAAgB,CAAC,EAAzD,WAAW,QAAA,EAAE,cAAc,QAA8B,CAAC;IACjE,IAAM,oBAAoB,GAAG,IAAA,aAAK,GAAE,CAAC;IAErC,OAAO,CACL,uCACE,SAAS,EAAE,IAAA,qBAAU,EAAC,IAAA,iCAAc,EAAC,MAAM,CAAC,EAAE,cAAc,CAAC,EAC7D,GAAG,EAAE,MAAM;QAEX,8BAAC,mBAAQ,IAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;YAClC,8BAAC,0BAAW,eACN,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,oBAAoB,mBACpB,CAAC,WAAW,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAAE,EACN,OAAO,EAAE;oBACP,cAAc,CAAC,UAAC,aAAa,IAAK,OAAA,CAAC,aAAa,EAAd,CAAc,CAAC,CAAC;gBACpD,CAAC,EACD,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;gBAE7D,8BAAC,WAAI;oBACF,KAAK;oBAAE,GAAG;oBACX,8BAAC,wCAAoB,IAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,GAAI,CAC9D,CACK,CACL;QACX,8BAAC,wCAAkB,IAAC,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE,oBAAoB;YAClE,uCAAK,SAAS,EAAC,gBAAgB,IAAE,QAAQ,CAAO,CAC7B,CACjB,CACP,CAAC;AACJ,CAAC;AAjDD,0CAiDC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CommonComponentProps,
|
|
2
|
+
import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
|
-
interface AttributeInputProps extends CommonComponentProps,
|
|
4
|
+
interface AttributeInputProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
5
5
|
'aria-invalid'?: React.AriaAttributes['aria-invalid'];
|
|
6
6
|
checked?: boolean;
|
|
7
7
|
defaultChecked?: boolean;
|
|
@@ -12,8 +12,9 @@ interface AttributeInputProps extends CommonComponentProps, ModifierProps {
|
|
|
12
12
|
name?: string;
|
|
13
13
|
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
14
14
|
readOnly?: boolean;
|
|
15
|
+
required?: boolean;
|
|
15
16
|
tabIndex?: number;
|
|
16
17
|
value: number | string;
|
|
17
18
|
}
|
|
18
|
-
export declare function AttributeInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, defaultChecked, checked, disabled, getRef, id, label, name, value, onChange, readOnly, tabIndex, ...rest }: AttributeInputProps): React.JSX.Element;
|
|
19
|
+
export declare function AttributeInput({ _modifierClass, 'aria-describedby': ariaDescribedby, 'aria-invalid': ariaInvalid, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, defaultChecked, checked, disabled, getRef, id, label, margin, name, value, onChange, readOnly, required, tabIndex, ...rest }: AttributeInputProps): React.JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -29,16 +29,17 @@ exports.AttributeInput = void 0;
|
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
31
31
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
32
|
+
var modifier_classes_1 = require("../utils/modifier_classes");
|
|
32
33
|
var shared_hooks_1 = require("./shared_hooks");
|
|
33
34
|
function AttributeInput(_a) {
|
|
34
|
-
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], defaultChecked = _a.defaultChecked, checked = _a.checked, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, label = _a.label, name = _a.name, value = _a.value, onChange = _a.onChange, readOnly = _a.readOnly, tabIndex = _a.tabIndex, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "defaultChecked", "checked", "disabled", "getRef", "id", "label", "name", "value", "onChange", "readOnly", "tabIndex"]);
|
|
35
|
+
var _modifierClass = _a._modifierClass, ariaDescribedby = _a["aria-describedby"], ariaInvalid = _a["aria-invalid"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], defaultChecked = _a.defaultChecked, checked = _a.checked, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, label = _a.label, margin = _a.margin, name = _a.name, value = _a.value, onChange = _a.onChange, readOnly = _a.readOnly, required = _a.required, tabIndex = _a.tabIndex, rest = __rest(_a, ["_modifierClass", 'aria-describedby', 'aria-invalid', 'aria-label', 'aria-labelledby', "defaultChecked", "checked", "disabled", "getRef", "id", "label", "margin", "name", "value", "onChange", "readOnly", "required", "tabIndex"]);
|
|
35
36
|
var attributeId = (0, shared_hooks_1.useFallbackId)(id);
|
|
36
|
-
var selectorClassName = (0, class_names_1.default)('Attribute', _modifierClass);
|
|
37
|
+
var selectorClassName = (0, class_names_1.default)('Attribute', (0, modifier_classes_1.getMarginClass)(margin), _modifierClass);
|
|
37
38
|
var labelClassName = (0, class_names_1.default)('Attribute__Label', {
|
|
38
39
|
'Attribute__Label--read-only': readOnly
|
|
39
40
|
});
|
|
40
41
|
return (react_1.default.createElement("div", { className: selectorClassName },
|
|
41
|
-
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { id: attributeId, name: name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, ref: getRef, checked: checked, defaultChecked: defaultChecked, className: "Attribute__Input", onChange: readOnly ? undefined : onChange, type: "radio", value: value, tabIndex: tabIndex, readOnly: readOnly, disabled: disabled })),
|
|
42
|
+
react_1.default.createElement("input", __assign({}, (0, data_attributes_1.default)(rest), { id: attributeId, name: name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, ref: getRef, checked: checked, defaultChecked: defaultChecked, className: "Attribute__Input", onChange: readOnly ? undefined : onChange, type: "radio", value: value, tabIndex: tabIndex, readOnly: readOnly, required: required, disabled: disabled })),
|
|
42
43
|
react_1.default.createElement("label", { className: labelClassName, htmlFor: attributeId },
|
|
43
44
|
react_1.default.createElement("span", { className: "Attribute__Label__Content" }, label))));
|
|
44
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attribute_input.js","sourceRoot":"","sources":["../../../src/components/attribute_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;
|
|
1
|
+
{"version":3,"file":"attribute_input.js","sourceRoot":"","sources":["../../../src/components/attribute_input.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA2D;AAE3D,+CAA+C;AAqB/C,SAAgB,cAAc,CAAC,EAoBT;IAnBpB,IAAA,cAAc,oBAAA,EACM,eAAe,yBAAA,EACnB,WAAW,qBAAA,EACb,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACjC,cAAc,oBAAA,EACd,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,KAAK,WAAA,EACL,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,QAAQ,cAAA,EACL,IAAI,cAnBsB,oOAoB9B,CADQ;IAEP,IAAM,WAAW,GAAG,IAAA,4BAAa,EAAC,EAAE,CAAC,CAAC;IAEtC,IAAM,iBAAiB,GAAG,IAAA,qBAAU,EAClC,WAAW,EACX,IAAA,iCAAc,EAAC,MAAM,CAAC,EACtB,cAAc,CACf,CAAC;IACF,IAAM,cAAc,GAAG,IAAA,qBAAU,EAAC,kBAAkB,EAAE;QACpD,6BAA6B,EAAE,QAAQ;KACxC,CAAC,CAAC;IAEH,OAAO,CACL,uCAAK,SAAS,EAAE,iBAAiB;QAE/B,oDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAC3B,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,IAAI,gBACE,SAAS,qBACJ,cAAc,kBACjB,WAAW,sBACP,eAAe,EACjC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAC,kBAAkB,EAC5B,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACzC,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,IAClB;QACF,yCAAO,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW;YACpD,wCAAM,SAAS,EAAC,2BAA2B,IAAE,KAAK,CAAQ,CACpD,CACJ,CACP,CAAC;AACJ,CAAC;AA5DD,wCA4DC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CommonComponentProps,
|
|
2
|
+
import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
4
|
type AttributesMap = {
|
|
5
5
|
[name: string]: string;
|
|
6
6
|
};
|
|
7
|
-
interface AttributeSelectorProps extends CommonComponentProps,
|
|
7
|
+
interface AttributeSelectorProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
8
8
|
/**
|
|
9
9
|
* A mapping of each inputs `value` to is `<label>` text.
|
|
10
10
|
*/
|
|
@@ -15,7 +15,8 @@ interface AttributeSelectorProps extends CommonComponentProps, ModifierProps {
|
|
|
15
15
|
name?: string;
|
|
16
16
|
onClick: (value: string) => void;
|
|
17
17
|
readOnly?: boolean;
|
|
18
|
+
required?: boolean;
|
|
18
19
|
selected?: keyof AttributesMap;
|
|
19
20
|
}
|
|
20
|
-
export declare function AttributeSelector({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, attributes, disabled, getRef, id, name, onClick, readOnly, selected, ...rest }: AttributeSelectorProps): React.JSX.Element;
|
|
21
|
+
export declare function AttributeSelector({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, attributes, disabled, getRef, id, margin, name, onClick, readOnly, required, selected, ...rest }: AttributeSelectorProps): React.JSX.Element;
|
|
21
22
|
export {};
|
|
@@ -29,18 +29,19 @@ exports.AttributeSelector = void 0;
|
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
31
31
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
32
|
+
var modifier_classes_1 = require("../utils/modifier_classes");
|
|
32
33
|
var attribute_input_1 = require("./attribute_input");
|
|
33
34
|
function AttributeSelector(_a) {
|
|
34
|
-
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], attributes = _a.attributes, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, name = _a.name, onClick = _a.onClick, readOnly = _a.readOnly, selected = _a.selected, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "attributes", "disabled", "getRef", "id", "name", "onClick", "readOnly", "selected"]);
|
|
35
|
+
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], attributes = _a.attributes, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, margin = _a.margin, name = _a.name, onClick = _a.onClick, readOnly = _a.readOnly, required = _a.required, selected = _a.selected, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "attributes", "disabled", "getRef", "id", "margin", "name", "onClick", "readOnly", "required", "selected"]);
|
|
35
36
|
function handleAttributeSelected(_a) {
|
|
36
37
|
var target = _a.target;
|
|
37
38
|
if (onClick)
|
|
38
39
|
onClick(target.value);
|
|
39
40
|
}
|
|
40
41
|
function renderAttribute(attribute) {
|
|
41
|
-
return (react_1.default.createElement(attribute_input_1.AttributeInput, { checked: selected !== undefined ? attribute === selected : undefined, disabled: disabled, id: "".concat(name, "[").concat(attribute, "]"), key: attribute, label: attributes[attribute], name: name, onChange: handleAttributeSelected, readOnly: readOnly, value: attribute }));
|
|
42
|
+
return (react_1.default.createElement(attribute_input_1.AttributeInput, { checked: selected !== undefined ? attribute === selected : undefined, disabled: disabled, id: "".concat(name, "[").concat(attribute, "]"), key: attribute, label: attributes[attribute], name: name, onChange: handleAttributeSelected, readOnly: readOnly, required: required, value: attribute }));
|
|
42
43
|
}
|
|
43
|
-
return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: (0, class_names_1.default)('Attribute__Selector spacing-h--0.25', _modifierClass), id: id, ref: getRef }), Object.keys(attributes).map(renderAttribute)));
|
|
44
|
+
return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: (0, class_names_1.default)('Attribute__Selector spacing-h--0.25', (0, modifier_classes_1.getMarginClass)(margin), _modifierClass), id: id, ref: getRef }), Object.keys(attributes).map(renderAttribute)));
|
|
44
45
|
}
|
|
45
46
|
exports.AttributeSelector = AttributeSelector;
|
|
46
47
|
//# sourceMappingURL=attribute_selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attribute_selector.js","sourceRoot":"","sources":["../../../src/components/attribute_selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;
|
|
1
|
+
{"version":3,"file":"attribute_selector.js","sourceRoot":"","sources":["../../../src/components/attribute_selector.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA2D;AAE3D,qDAAmD;AAwBnD,SAAgB,iBAAiB,CAAC,EAgBT;IAfvB,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,UAAU,gBAAA,EACV,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,QAAQ,cAAA,EACL,IAAI,cAfyB,kLAgBjC,CADQ;IAEP,SAAS,uBAAuB,CAAC,EAEK;YADpC,MAAM,YAAA;QAEN,IAAI,OAAO;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,SAAS,eAAe,CAAC,SAA8B;QACrD,OAAO,CACL,8BAAC,gCAAc,IACb,OAAO,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,EACpE,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,UAAG,IAAI,cAAI,SAAS,MAAG,EAC3B,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,EAC5B,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,uBAAuB,EACjC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,SAAS,GAChB,CACH,CAAC;IACJ,CAAC;IAED,OAAO,CACL,kDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,kBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,IAAA,qBAAU,EACnB,qCAAqC,EACrC,IAAA,iCAAc,EAAC,MAAM,CAAC,EACtB,cAAc,CACf,EACD,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,MAAM,KAEV,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CACzC,CACP,CAAC;AACJ,CAAC;AAzDD,8CAyDC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Colors, CommonComponentProps,
|
|
2
|
+
import type { Colors, CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
|
-
interface AvatarProps extends CommonComponentProps,
|
|
4
|
+
interface AvatarProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
5
5
|
active?: boolean;
|
|
6
6
|
avatarUrl: string | null;
|
|
7
7
|
backgroundColor?: Colors;
|
|
@@ -13,5 +13,5 @@ interface AvatarProps extends CommonComponentProps, ModifierProps {
|
|
|
13
13
|
textColor?: Colors;
|
|
14
14
|
title?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare function Avatar({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, active, avatarUrl, backgroundColor, getRef, id, name, outlineColor, size, textColor, title, ...rest }: AvatarProps): React.JSX.Element;
|
|
16
|
+
export declare function Avatar({ _modifierClass, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, active, avatarUrl, backgroundColor, getRef, id, margin, name, outlineColor, size, textColor, title, ...rest }: AvatarProps): React.JSX.Element;
|
|
17
17
|
export {};
|
|
@@ -53,6 +53,7 @@ var react_1 = __importStar(require("react"));
|
|
|
53
53
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
54
54
|
var strings_1 = require("../utils/strings");
|
|
55
55
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
56
|
+
var modifier_classes_1 = require("../utils/modifier_classes");
|
|
56
57
|
var FONT_SIZE_RATIO = 0.375;
|
|
57
58
|
function fontSizeStyle(size) {
|
|
58
59
|
var calculatedSize = typeof size === 'number' ? "".concat(size, "px") : size;
|
|
@@ -60,7 +61,7 @@ function fontSizeStyle(size) {
|
|
|
60
61
|
}
|
|
61
62
|
function Avatar(_a) {
|
|
62
63
|
var _b;
|
|
63
|
-
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], _c = _a.active, active = _c === void 0 ? false : _c, avatarUrl = _a.avatarUrl, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'dscout' : _d, getRef = _a.getRef, id = _a.id, name = _a.name, _e = _a.outlineColor, outlineColor = _e === void 0 ? 'dscout' : _e, size = _a.size, _f = _a.textColor, textColor = _f === void 0 ? 'invert' : _f, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "active", "avatarUrl", "backgroundColor", "getRef", "id", "name", "outlineColor", "size", "textColor", "title"]);
|
|
64
|
+
var _modifierClass = _a._modifierClass, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], _c = _a.active, active = _c === void 0 ? false : _c, avatarUrl = _a.avatarUrl, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'dscout' : _d, getRef = _a.getRef, id = _a.id, margin = _a.margin, name = _a.name, _e = _a.outlineColor, outlineColor = _e === void 0 ? 'dscout' : _e, size = _a.size, _f = _a.textColor, textColor = _f === void 0 ? 'invert' : _f, title = _a.title, rest = __rest(_a, ["_modifierClass", 'aria-label', 'aria-labelledby', 'aria-describedby', "active", "avatarUrl", "backgroundColor", "getRef", "id", "margin", "name", "outlineColor", "size", "textColor", "title"]);
|
|
64
65
|
var _g = (0, react_1.useState)(false), loaded = _g[0], setLoaded = _g[1];
|
|
65
66
|
(0, react_1.useEffect)(function () {
|
|
66
67
|
setLoaded(false);
|
|
@@ -73,7 +74,7 @@ function Avatar(_a) {
|
|
|
73
74
|
};
|
|
74
75
|
img.src = avatarUrl;
|
|
75
76
|
}, [avatarUrl]);
|
|
76
|
-
var className = (0, class_names_1.default)('Avatar', _modifierClass, (_b = {
|
|
77
|
+
var className = (0, class_names_1.default)('Avatar', _modifierClass, (0, modifier_classes_1.getMarginClass)(margin), (_b = {
|
|
77
78
|
'Avatar--loaded': loaded,
|
|
78
79
|
'Avatar--active': active
|
|
79
80
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/components/avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAmD;
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/components/avatar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAmD;AAUnD,qEAA8C;AAC9C,4CAA+C;AAC/C,6EAAyD;AACzD,8DAA2D;AAkB3D,IAAM,eAAe,GAAG,KAAK,CAAC;AAE9B,SAAS,aAAa,CAAC,IAAqB;IAC1C,IAAM,cAAc,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAG,IAAI,OAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAErE,OAAO,EAAE,QAAQ,EAAE,eAAQ,cAAc,gBAAM,eAAe,MAAG,EAAE,CAAC;AACtE,CAAC;AAED,SAAgB,MAAM,CAAC,EAiBT;;IAhBZ,IAAA,cAAc,oBAAA,EACA,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,cAAc,EAAd,MAAM,mBAAG,KAAK,KAAA,EACd,SAAS,eAAA,EACT,uBAA0B,EAA1B,eAAe,mBAAG,QAAQ,KAAA,EAC1B,MAAM,YAAA,EACN,EAAE,QAAA,EACF,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,oBAAuB,EAAvB,YAAY,mBAAG,QAAQ,KAAA,EACvB,IAAI,UAAA,EACJ,iBAAoB,EAApB,SAAS,mBAAG,QAAQ,KAAA,EACpB,KAAK,WAAA,EACF,IAAI,cAhBc,iMAiBtB,CADQ;IAED,IAAA,KAAsB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAApC,MAAM,QAAA,EAAE,SAAS,QAAmB,CAAC;IAE5C,IAAA,iBAAS,EAAC;QACR,SAAS,CAAC,KAAK,CAAC,CAAC;QAEjB,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB,IAAI,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;QAEtB,GAAG,CAAC,MAAM,GAAG;YACX,SAAS,CAAC,IAAI,CAAC,CAAC;YAChB,GAAG,GAAG,IAAI,CAAC;QACb,CAAC,CAAC;QACF,GAAG,CAAC,GAAG,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,IAAM,SAAS,GAAG,IAAA,qBAAU,EAC1B,QAAQ,EACR,cAAc,EACd,IAAA,iCAAc,EAAC,MAAM,CAAC;YAEpB,gBAAgB,EAAE,MAAM;YACxB,gBAAgB,EAAE,MAAM;;QACxB,GAAC,oBAAa,eAAe,CAAE,IAAG,eAAe;QACjD,GAAC,iBAAU,SAAS,CAAE,IAAG,SAAS;YAErC,CAAC;IACF,IAAM,KAAK,GAAG;QACZ,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,eAAQ,SAAS,OAAI,CAAC,CAAC,CAAC,SAAS;QAC3D,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,uBAAgB,YAAY,MAAG;QAC7C,KAAK,EAAE,IAAI;KACZ,CAAC;IAEF,OAAO,CACL,kDACM,IAAA,yBAAiB,EAAC,IAAI,CAAC,kBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,EACjC,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,IAAI,IAAI,KAEnB,CAAC,MAAM,IAAI,CACV,wCACE,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAEvC,IAAA,qBAAW,EAAC,IAAI,CAAC,CACb,CACR,CACG,CACP,CAAC;AACJ,CAAC;AA1ED,wBA0EC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { type RefObject } from 'react';
|
|
2
2
|
import type { CommonComponentProps } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
4
|
interface BlitzProps extends CommonComponentProps {
|
|
@@ -6,7 +6,7 @@ interface BlitzProps extends CommonComponentProps {
|
|
|
6
6
|
closeButtonTitle?: string;
|
|
7
7
|
getRef?: GetRef<HTMLDivElement>;
|
|
8
8
|
id?: string;
|
|
9
|
-
initialFocusOn?: Element | string;
|
|
9
|
+
initialFocusOn?: RefObject<Element> | Element | string;
|
|
10
10
|
isVisible?: boolean;
|
|
11
11
|
requestClose?: () => void;
|
|
12
12
|
type?: 'alert' | 'notification' | 'coaching';
|
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
37
|
var t = {};
|
|
15
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -26,7 +49,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
49
|
};
|
|
27
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
51
|
exports.Blitz = void 0;
|
|
29
|
-
var react_1 =
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
30
53
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
31
54
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
32
55
|
var button_plain_1 = require("./button_plain");
|
|
@@ -37,17 +60,18 @@ var CLOSE_BUTTON_NAME = 'close';
|
|
|
37
60
|
var DEFAULT_FOCUS_SELECTOR = "button[name=\"".concat(CLOSE_BUTTON_NAME, "\"]");
|
|
38
61
|
function Blitz(_a) {
|
|
39
62
|
var ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], children = _a.children, _b = _a.closeButtonTitle, closeButtonTitle = _b === void 0 ? 'Close' : _b, getRef = _a.getRef, id = _a.id, initialFocusOn = _a.initialFocusOn, isVisible = _a.isVisible, requestClose = _a.requestClose, _c = _a.type, type = _c === void 0 ? 'notification' : _c, rest = __rest(_a, ['aria-label', 'aria-labelledby', 'aria-describedby', "children", "closeButtonTitle", "getRef", "id", "initialFocusOn", "isVisible", "requestClose", "type"]);
|
|
63
|
+
var labelId = (0, react_1.useId)();
|
|
40
64
|
var wrapperClassName = (0, class_names_1.default)('Blitz__Wrapper', {
|
|
41
65
|
'Blitz__Wrapper--show': isVisible
|
|
42
66
|
});
|
|
43
|
-
var alertClassName = (0, class_names_1.default)('Blitz', 'flex', {
|
|
67
|
+
var alertClassName = (0, class_names_1.default)('Blitz', 'flex', 'color--invert', {
|
|
44
68
|
'bg-color--dscout': type === 'notification',
|
|
45
69
|
'bg-color--alert': type === 'alert',
|
|
46
70
|
'bg-color--coachmark': type === 'coaching'
|
|
47
71
|
});
|
|
48
72
|
return (react_1.default.createElement("div", __assign({}, (0, data_attributes_1.default)(rest), { className: wrapperClassName }),
|
|
49
|
-
react_1.default.createElement(focus_trap_1.FocusTrap, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, className: alertClassName, fallbackFocusOn: DEFAULT_FOCUS_SELECTOR, getRef: getRef, id: id, initialFocusOn: initialFocusOn, role: "alertdialog", setInitialFocus: isVisible },
|
|
50
|
-
children,
|
|
73
|
+
react_1.default.createElement(focus_trap_1.FocusTrap, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby || labelId, "aria-describedby": ariaDescribedby, className: alertClassName, fallbackFocusOn: DEFAULT_FOCUS_SELECTOR, getRef: getRef, id: id, initialFocusOn: initialFocusOn, role: "alertdialog", setInitialFocus: isVisible },
|
|
74
|
+
react_1.default.createElement("span", { className: "flex", id: labelId }, children),
|
|
51
75
|
react_1.default.createElement(modifier_1.Modifier, { margin: { left: '1' } },
|
|
52
76
|
react_1.default.createElement(button_plain_1.ButtonPlain, { "aria-label": closeButtonTitle, name: CLOSE_BUTTON_NAME, onClick: requestClose, title: closeButtonTitle },
|
|
53
77
|
react_1.default.createElement(x_1.IconX, { "aria-hidden": true }))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blitz.js","sourceRoot":"","sources":["../../../src/components/blitz.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blitz.js","sourceRoot":"","sources":["../../../src/components/blitz.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAqD;AAKrD,qEAAsC;AACtC,6EAAyD;AAEzD,+CAA6C;AAC7C,2CAAyC;AACzC,gCAAmC;AACnC,uCAAsC;AAatC,IAAM,iBAAiB,GAAG,OAAO,CAAC;AAClC,IAAM,sBAAsB,GAAG,wBAAgB,iBAAiB,QAAI,CAAC;AAErE,SAAgB,KAAK,CAAC,EAaT;IAZX,IAAc,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnC,QAAQ,cAAA,EACR,wBAA0B,EAA1B,gBAAgB,mBAAG,OAAO,KAAA,EAC1B,MAAM,YAAA,EACN,EAAE,QAAA,EACF,cAAc,oBAAA,EACd,SAAS,eAAA,EACT,YAAY,kBAAA,EACZ,YAAqB,EAArB,IAAI,mBAAG,cAAc,KAAA,EAClB,IAAI,cAZa,4JAarB,CADQ;IAEP,IAAM,OAAO,GAAG,IAAA,aAAK,GAAE,CAAC;IAExB,IAAM,gBAAgB,GAAG,IAAA,qBAAE,EAAC,gBAAgB,EAAE;QAC5C,sBAAsB,EAAE,SAAS;KAClC,CAAC,CAAC;IAEH,IAAM,cAAc,GAAG,IAAA,qBAAE,EAAC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE;QAC1D,kBAAkB,EAAE,IAAI,KAAK,cAAc;QAC3C,iBAAiB,EAAE,IAAI,KAAK,OAAO;QACnC,qBAAqB,EAAE,IAAI,KAAK,UAAU;KAC3C,CAAC,CAAC;IAEH,OAAO,CACL,kDAAS,IAAA,yBAAiB,EAAC,IAAI,CAAC,IAAE,SAAS,EAAE,gBAAgB;QAC3D,8BAAC,sBAAS,kBACI,SAAS,qBACJ,cAAc,IAAI,OAAO,sBACxB,eAAe,EACjC,SAAS,EAAE,cAAc,EACzB,eAAe,EAAE,sBAAsB,EACvC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAC,aAAa,EAClB,eAAe,EAAE,SAAS;YAE1B,wCAAM,SAAS,EAAC,MAAM,EAAC,EAAE,EAAE,OAAO,IAC/B,QAAQ,CACJ;YACP,8BAAC,mBAAQ,IAAC,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;gBAC7B,8BAAC,0BAAW,kBACE,gBAAgB,EAC5B,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,gBAAgB;oBAEvB,8BAAC,SAAK,0BAAe,CACT,CACL,CACD,CACR,CACP,CAAC;AACJ,CAAC;AAxDD,sBAwDC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { CommonComponentProps,
|
|
2
|
+
import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
|
|
3
3
|
import type { GetRef } from '../utils/refs';
|
|
4
4
|
declare const COLORS: readonly ["alert", "close", "coachmark", "dscout", "archive", "none", "success", "note", "screener", "live", "diary", "test", "invert", "black", "white"];
|
|
5
5
|
declare const SIZES: readonly ["tiny", "small", "big"];
|
|
@@ -9,7 +9,7 @@ type Colors = (typeof COLORS)[number];
|
|
|
9
9
|
type Sizes = (typeof SIZES)[number];
|
|
10
10
|
type Widths = (typeof WIDTHS)[number];
|
|
11
11
|
type Variants = (typeof VARIANTS)[number];
|
|
12
|
-
interface ButtonProps extends CommonComponentProps,
|
|
12
|
+
interface ButtonProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
13
13
|
'aria-controls'?: string;
|
|
14
14
|
'aria-expanded'?: React.AriaAttributes['aria-expanded'];
|
|
15
15
|
'aria-pressed'?: boolean;
|
|
@@ -32,5 +32,5 @@ interface ButtonProps extends CommonComponentProps, ModifierProps {
|
|
|
32
32
|
width?: Widths;
|
|
33
33
|
variant?: Variants;
|
|
34
34
|
}
|
|
35
|
-
export declare function Button({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, children, color, disabled, getRef, id, linkComponent, linkProps, name, onClick, onMouseUp, onMouseDown, refProp, size, tabIndex, title, type, width, variant, ...rest }: ButtonProps): React.JSX.Element;
|
|
35
|
+
export declare function Button({ _modifierClass, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, 'aria-pressed': ariaPressed, children, color, disabled, getRef, id, linkComponent, linkProps, margin, name, onClick, onMouseUp, onMouseDown, refProp, size, tabIndex, title, type, width, variant, ...rest }: ButtonProps): React.JSX.Element;
|
|
36
36
|
export {};
|
|
@@ -29,6 +29,7 @@ exports.Button = void 0;
|
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var class_names_1 = __importDefault(require("../utils/class_names"));
|
|
31
31
|
var data_attributes_1 = __importDefault(require("../utils/data_attributes"));
|
|
32
|
+
var modifier_classes_1 = require("../utils/modifier_classes");
|
|
32
33
|
var common_button_1 = require("./common_button");
|
|
33
34
|
var COLORS = [
|
|
34
35
|
'alert',
|
|
@@ -66,8 +67,8 @@ function supportedClassFor(type, value) {
|
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
function Button(_a) {
|
|
69
|
-
var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], children = _a.children, color = _a.color, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, name = _a.name, onClick = _a.onClick, onMouseUp = _a.onMouseUp, onMouseDown = _a.onMouseDown, refProp = _a.refProp, size = _a.size, tabIndex = _a.tabIndex, title = _a.title, type = _a.type, width = _a.width, variant = _a.variant, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "children", "color", "disabled", "getRef", "id", "linkComponent", "linkProps", "name", "onClick", "onMouseUp", "onMouseDown", "refProp", "size", "tabIndex", "title", "type", "width", "variant"]);
|
|
70
|
-
var className = (0, class_names_1.default)('Button', supportedClassFor('size', size), supportedClassFor('width', width), supportedClassFor('variant', variant), supportedClassFor('color', color), _modifierClass);
|
|
70
|
+
var _modifierClass = _a._modifierClass, ariaControls = _a["aria-controls"], ariaExpanded = _a["aria-expanded"], ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], ariaDescribedby = _a["aria-describedby"], ariaPressed = _a["aria-pressed"], children = _a.children, color = _a.color, disabled = _a.disabled, getRef = _a.getRef, id = _a.id, linkComponent = _a.linkComponent, linkProps = _a.linkProps, margin = _a.margin, name = _a.name, onClick = _a.onClick, onMouseUp = _a.onMouseUp, onMouseDown = _a.onMouseDown, refProp = _a.refProp, size = _a.size, tabIndex = _a.tabIndex, title = _a.title, type = _a.type, width = _a.width, variant = _a.variant, rest = __rest(_a, ["_modifierClass", 'aria-controls', 'aria-expanded', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-pressed', "children", "color", "disabled", "getRef", "id", "linkComponent", "linkProps", "margin", "name", "onClick", "onMouseUp", "onMouseDown", "refProp", "size", "tabIndex", "title", "type", "width", "variant"]);
|
|
71
|
+
var className = (0, class_names_1.default)('Button', supportedClassFor('size', size), supportedClassFor('width', width), supportedClassFor('variant', variant), supportedClassFor('color', color), _modifierClass, (0, modifier_classes_1.getMarginClass)(margin));
|
|
71
72
|
return (react_1.default.createElement(common_button_1.CommonButton, __assign({}, (0, data_attributes_1.default)(rest), { "aria-controls": ariaControls, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-pressed": ariaPressed, className: className, disabled: disabled, getRef: getRef, id: id, linkComponent: linkComponent, linkProps: linkProps, name: name, onClick: onClick, onMouseUp: onMouseUp, onMouseDown: onMouseDown, refProp: refProp, tabIndex: tabIndex, title: title, type: type }), children));
|
|
72
73
|
}
|
|
73
74
|
exports.Button = Button;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAS1B,qEAA8C;AAC9C,6EAAyD;AACzD,8DAA2D;AAE3D,iDAA+C;AAE/C,IAAM,MAAM,GAAG;IACb,OAAO;IACP,OAAO;IACP,WAAW;IACX,QAAQ;IACR,SAAS;IACT,MAAM;IACN,SAAS;IACT,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;CACC,CAAC;AAEX,IAAM,KAAK,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAU,CAAC;AAEhD,IAAM,MAAM,GAAG,CAAC,WAAW,EAAE,OAAO,CAAU,CAAC;AAE/C,IAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AAE/C,IAAM,KAAK,GAAG;IACZ,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,QAAQ;CAClB,CAAC;AAkCF,IAAM,SAAS,GAA2B;IACxC,IAAI,EAAE,OAAO;CACd,CAAC;AAEF,SAAS,iBAAiB,CAAC,IAAwB,EAAE,KAAa;IAChE,IAAM,WAAW,GAAG,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC;IAErE,IAAK,KAAK,CAAC,IAAI,CAA2B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAC1D,OAAO,UAAG,WAAW,SAAG,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,CAAE,CAAC;KACrD;AACH,CAAC;AAED,SAAgB,MAAM,CAAC,EA4BT;IA3BZ,IAAA,cAAc,oBAAA,EACG,YAAY,sBAAA,EACZ,YAAY,sBAAA,EACf,SAAS,mBAAA,EACJ,cAAc,wBAAA,EACb,eAAe,yBAAA,EACnB,WAAW,qBAAA,EAC3B,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,EAAE,QAAA,EACF,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,OAAO,aAAA,EACP,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,OAAO,aAAA,EACP,IAAI,UAAA,EACJ,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,IAAI,UAAA,EACJ,KAAK,WAAA,EACL,OAAO,aAAA,EACJ,IAAI,cA3Bc,qUA4BtB,CADQ;IAEP,IAAM,SAAS,GAAG,IAAA,qBAAU,EAC1B,QAAQ,EACR,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,EAC/B,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,EACjC,iBAAiB,CAAC,SAAS,EAAE,OAAO,CAAC,EACrC,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,EACjC,cAAc,EACd,IAAA,iCAAc,EAAC,MAAM,CAAC,CACvB,CAAC;IAEF,OAAO,CACL,8BAAC,4BAAY,eACP,IAAA,yBAAiB,EAAC,IAAI,CAAC,qBACZ,YAAY,mBACZ,YAAY,gBACf,SAAS,qBACJ,cAAc,sBACb,eAAe,kBACnB,WAAW,EACzB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,KAET,QAAQ,CACI,CAChB,CAAC;AACJ,CAAC;AAlED,wBAkEC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { GetRef } from '../utils/refs';
|
|
3
|
-
import type { CommonComponentProps,
|
|
4
|
-
interface ButtonControlProps extends CommonComponentProps,
|
|
3
|
+
import type { CommonComponentProps, MarginModifierProp, ModifierClassProp } from '../types';
|
|
4
|
+
interface ButtonControlProps extends CommonComponentProps, MarginModifierProp, ModifierClassProp {
|
|
5
5
|
active?: boolean;
|
|
6
6
|
'aria-controls'?: string;
|
|
7
7
|
'aria-expanded'?: React.AriaAttributes['aria-expanded'];
|
|
@@ -13,5 +13,5 @@ interface ButtonControlProps extends CommonComponentProps, ModifierProps {
|
|
|
13
13
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
14
14
|
title?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare function ButtonControl({ _modifierClass, active, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, name, onClick, title, ...rest }: ButtonControlProps): React.JSX.Element;
|
|
16
|
+
export declare function ButtonControl({ _modifierClass, active, 'aria-controls': ariaControls, 'aria-expanded': ariaExpanded, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, children, disabled, getRef, id, margin, name, onClick, title, ...rest }: ButtonControlProps): React.JSX.Element;
|
|
17
17
|
export {};
|