@neo4j-ndl/react 4.4.0 → 4.4.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/lib/cjs/_common/types.js.map +1 -1
- package/lib/cjs/_common/utils.js +4 -4
- package/lib/cjs/_common/utils.js.map +1 -1
- package/lib/cjs/accordion/Accordion.js +5 -5
- package/lib/cjs/accordion/Accordion.js.map +1 -1
- package/lib/cjs/accordion/accordion-context.js +1 -1
- package/lib/cjs/accordion/accordion-context.js.map +1 -1
- package/lib/cjs/accordion/stories/accordion.stories.js +20 -20
- package/lib/cjs/accordion/stories/accordion.stories.js.map +1 -1
- package/lib/cjs/avatar/stories/avatar.stories.js +18 -18
- package/lib/cjs/avatar/stories/avatar.stories.js.map +1 -1
- package/lib/cjs/breadcrumbs/stories/breadcrumbs.stories.js +1 -1
- package/lib/cjs/breadcrumbs/stories/breadcrumbs.stories.js.map +1 -1
- package/lib/cjs/checkbox/stories/checkbox-full.story.js +2 -2
- package/lib/cjs/checkbox/stories/checkbox-full.story.js.map +1 -1
- package/lib/cjs/checkbox/stories/checkbox.stories.js +19 -19
- package/lib/cjs/checkbox/stories/checkbox.stories.js.map +1 -1
- package/lib/cjs/clean-icon-button/stories/clean-icon-button.stories.js +11 -11
- package/lib/cjs/clean-icon-button/stories/clean-icon-button.stories.js.map +1 -1
- package/lib/cjs/code-block/stories/code-disabled.story.js +2 -2
- package/lib/cjs/code-block/stories/code-disabled.story.js.map +1 -1
- package/lib/cjs/code-block/stories/code-full.story.js +2 -2
- package/lib/cjs/code-block/stories/code-full.story.js.map +1 -1
- package/lib/cjs/code-block/stories/code-with-actions.story.js +2 -2
- package/lib/cjs/code-block/stories/code-with-actions.story.js.map +1 -1
- package/lib/cjs/code-block/themes/ndl-code-dark.js +64 -64
- package/lib/cjs/code-block/themes/ndl-code-dark.js.map +1 -1
- package/lib/cjs/code-block/themes/ndl-code-light.js +64 -64
- package/lib/cjs/code-block/themes/ndl-code-light.js.map +1 -1
- package/lib/cjs/color-picker/ColorPicker.js +1 -1
- package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
- package/lib/cjs/color-picker/stories/color-picker.stories.js +4 -4
- package/lib/cjs/color-picker/stories/color-picker.stories.js.map +1 -1
- package/lib/cjs/data-grid/Components.js +13 -11
- package/lib/cjs/data-grid/Components.js.map +1 -1
- package/lib/cjs/data-grid/DataGrid.js.map +1 -1
- package/lib/cjs/data-grid/data-grid-context.js +1 -1
- package/lib/cjs/data-grid/data-grid-context.js.map +1 -1
- package/lib/cjs/data-grid/data-grid-nav/index.js +1 -1
- package/lib/cjs/data-grid/data-grid-nav/index.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js +1 -1
- package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
- package/lib/cjs/date-picker/stories/date-picker-full.story.js +9 -9
- package/lib/cjs/date-picker/stories/date-picker-full.story.js.map +1 -1
- package/lib/cjs/divider/stories/divider-horizontal.story.js +1 -1
- package/lib/cjs/divider/stories/divider-horizontal.story.js.map +1 -1
- package/lib/cjs/divider/stories/divider-vertical.story.js +1 -1
- package/lib/cjs/divider/stories/divider-vertical.story.js.map +1 -1
- package/lib/cjs/drawer/stories/drawer.stories.js +19 -19
- package/lib/cjs/drawer/stories/drawer.stories.js.map +1 -1
- package/lib/cjs/dropdown-button/stories/dropdown-button.stories.js +18 -18
- package/lib/cjs/dropdown-button/stories/dropdown-button.stories.js.map +1 -1
- package/lib/cjs/dropzone/stories/dropzone-disabled.story.js +1 -1
- package/lib/cjs/dropzone/stories/dropzone-disabled.story.js.map +1 -1
- package/lib/cjs/dropzone/stories/dropzone-full.story.js +11 -11
- package/lib/cjs/dropzone/stories/dropzone-full.story.js.map +1 -1
- package/lib/cjs/dropzone/stories/dropzone.stories.js +10 -10
- package/lib/cjs/dropzone/stories/dropzone.stories.js.map +1 -1
- package/lib/cjs/flex/Flex.js +4 -4
- package/lib/cjs/flex/Flex.js.map +1 -1
- package/lib/cjs/graph-label/stories/graph-label.stories.js +20 -20
- package/lib/cjs/graph-label/stories/graph-label.stories.js.map +1 -1
- package/lib/cjs/hooks/index.js +3 -3
- package/lib/cjs/hooks/index.js.map +1 -1
- package/lib/cjs/icon-button/stories/icon-button.stories.js +12 -12
- package/lib/cjs/icon-button/stories/icon-button.stories.js.map +1 -1
- package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js +16 -16
- package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
- package/lib/cjs/icons/wrapIcon.js +1 -1
- package/lib/cjs/icons/wrapIcon.js.map +1 -1
- package/lib/cjs/kbd/stories/kbd.stories.js +7 -7
- package/lib/cjs/kbd/stories/kbd.stories.js.map +1 -1
- package/lib/cjs/loading-spinner/LoadingSpinner.js +2 -2
- package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/cjs/loading-spinner/stories/loading-spinner.stories.js +10 -10
- package/lib/cjs/loading-spinner/stories/loading-spinner.stories.js.map +1 -1
- package/lib/cjs/logo/Logo.js +6 -6
- package/lib/cjs/logo/Logo.js.map +1 -1
- package/lib/cjs/logo/stories/logo.stories.js +9 -9
- package/lib/cjs/logo/stories/logo.stories.js.map +1 -1
- package/lib/cjs/menu/Menu.js +3 -3
- package/lib/cjs/menu/Menu.js.map +1 -1
- package/lib/cjs/popover/Popover.js +15 -15
- package/lib/cjs/popover/Popover.js.map +1 -1
- package/lib/cjs/popover/use-popover.js +9 -9
- package/lib/cjs/popover/use-popover.js.map +1 -1
- package/lib/cjs/progress-bar/stories/progress-bar.stories.js +3 -3
- package/lib/cjs/progress-bar/stories/progress-bar.stories.js.map +1 -1
- package/lib/cjs/segmented-control/SegmentedControl.js +1 -1
- package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/cjs/select/Overrides.js +41 -41
- package/lib/cjs/select/Overrides.js.map +1 -1
- package/lib/cjs/select/stories/select-async.story.js +4 -4
- package/lib/cjs/select/stories/select-async.story.js.map +1 -1
- package/lib/cjs/select/stories/select-controlled.story.js +4 -4
- package/lib/cjs/select/stories/select-controlled.story.js.map +1 -1
- package/lib/cjs/select/stories/select-creatable.story.js +1 -1
- package/lib/cjs/select/stories/select-creatable.story.js.map +1 -1
- package/lib/cjs/select/stories/select-custom-label.story.js +1 -1
- package/lib/cjs/select/stories/select-custom-label.story.js.map +1 -1
- package/lib/cjs/select/stories/select-disabled.story.js +1 -1
- package/lib/cjs/select/stories/select-disabled.story.js.map +1 -1
- package/lib/cjs/select/stories/select-inside-dialog.story.js +1 -1
- package/lib/cjs/select/stories/select-inside-dialog.story.js.map +1 -1
- package/lib/cjs/side-navigation/stories/side-nav.stories.js +1 -1
- package/lib/cjs/side-navigation/stories/side-nav.stories.js.map +1 -1
- package/lib/cjs/skeleton/stories/skeleton.stories.js +28 -28
- package/lib/cjs/skeleton/stories/skeleton.stories.js.map +1 -1
- package/lib/cjs/slider/Slider.js +2 -1
- package/lib/cjs/slider/Slider.js.map +1 -1
- package/lib/cjs/status-indicator/stories/status-indicator.stories.js +2 -2
- package/lib/cjs/status-indicator/stories/status-indicator.stories.js.map +1 -1
- package/lib/cjs/switch/stories/switch.stories.js +7 -7
- package/lib/cjs/switch/stories/switch.stories.js.map +1 -1
- package/lib/cjs/tabs/Tabs.js +1 -1
- package/lib/cjs/tabs/Tabs.js.map +1 -1
- package/lib/cjs/tag/Tag.js +2 -2
- package/lib/cjs/tag/Tag.js.map +1 -1
- package/lib/cjs/tag/stories/tag.stories.js +10 -10
- package/lib/cjs/tag/stories/tag.stories.js.map +1 -1
- package/lib/cjs/text-area/TextArea.js +5 -5
- package/lib/cjs/text-area/TextArea.js.map +1 -1
- package/lib/cjs/text-area/stories/text-area.stories.js +25 -25
- package/lib/cjs/text-area/stories/text-area.stories.js.map +1 -1
- package/lib/cjs/text-input/stories/text-input-number.story.js +2 -2
- package/lib/cjs/text-input/stories/text-input-number.story.js.map +1 -1
- package/lib/cjs/text-link/stories/text-link.stories.js +11 -11
- package/lib/cjs/text-link/stories/text-link.stories.js.map +1 -1
- package/lib/cjs/text-overflow/stories/text-overflow.stories.js +1 -1
- package/lib/cjs/text-overflow/stories/text-overflow.stories.js.map +1 -1
- package/lib/cjs/theme/ThemeProvider.js.map +1 -1
- package/lib/cjs/theme/agnostic.js +1 -1
- package/lib/cjs/theme/agnostic.js.map +1 -1
- package/lib/cjs/time-picker/TimePicker.js +4 -4
- package/lib/cjs/time-picker/TimePicker.js.map +1 -1
- package/lib/cjs/time-picker/time-picker-hooks.js +1 -1
- package/lib/cjs/time-picker/time-picker-hooks.js.map +1 -1
- package/lib/cjs/timezone-picker/TimeZonePicker.js +5 -5
- package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js +7 -7
- package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
- package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
- package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
- package/lib/cjs/toast/Toast.js +12 -12
- package/lib/cjs/toast/Toast.js.map +1 -1
- package/lib/cjs/toast/stories/toast-action-story.js +1 -1
- package/lib/cjs/toast/stories/toast-action-story.js.map +1 -1
- package/lib/cjs/toast/stories/toast-controlled-story.js +2 -2
- package/lib/cjs/toast/stories/toast-controlled-story.js.map +1 -1
- package/lib/cjs/toast/stories/toast-progress-bar.js +1 -1
- package/lib/cjs/toast/stories/toast-progress-bar.js.map +1 -1
- package/lib/cjs/toast/stories/toast.stories.js +18 -18
- package/lib/cjs/toast/stories/toast.stories.js.map +1 -1
- package/lib/cjs/tooltip/Tooltip.js +1 -1
- package/lib/cjs/tooltip/Tooltip.js.map +1 -1
- package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js +1 -1
- package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js.map +1 -1
- package/lib/cjs/tooltip/stories/tooltip-placements.story.js +8 -8
- package/lib/cjs/tooltip/stories/tooltip-placements.story.js.map +1 -1
- package/lib/cjs/tooltip/stories/tooltip.stories.js +29 -29
- package/lib/cjs/tooltip/stories/tooltip.stories.js.map +1 -1
- package/lib/cjs/tooltip/use-tooltip.js +10 -10
- package/lib/cjs/tooltip/use-tooltip.js.map +1 -1
- package/lib/cjs/tree-view/TreeItemWrapper.js +2 -2
- package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
- package/lib/cjs/tree-view/TreeView.js +12 -12
- package/lib/cjs/tree-view/TreeView.js.map +1 -1
- package/lib/cjs/tree-view/TreeViewItem.js +1 -1
- package/lib/cjs/tree-view/TreeViewItem.js.map +1 -1
- package/lib/cjs/tree-view/TreeViewTextItem.js +1 -1
- package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
- package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js +2 -2
- package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
- package/lib/cjs/wizard/Wizard.js +2 -2
- package/lib/cjs/wizard/Wizard.js.map +1 -1
- package/lib/cjs/wizard/stories/wizard.stories.js +14 -14
- package/lib/cjs/wizard/stories/wizard.stories.js.map +1 -1
- package/lib/esm/_common/types.js.map +1 -1
- package/lib/esm/_common/utils.js +4 -4
- package/lib/esm/_common/utils.js.map +1 -1
- package/lib/esm/accordion/Accordion.js +5 -5
- package/lib/esm/accordion/Accordion.js.map +1 -1
- package/lib/esm/accordion/accordion-context.js +1 -1
- package/lib/esm/accordion/accordion-context.js.map +1 -1
- package/lib/esm/accordion/stories/accordion.stories.js +20 -20
- package/lib/esm/accordion/stories/accordion.stories.js.map +1 -1
- package/lib/esm/avatar/stories/avatar.stories.js +18 -18
- package/lib/esm/avatar/stories/avatar.stories.js.map +1 -1
- package/lib/esm/breadcrumbs/stories/breadcrumbs.stories.js +1 -1
- package/lib/esm/breadcrumbs/stories/breadcrumbs.stories.js.map +1 -1
- package/lib/esm/checkbox/stories/checkbox-full.story.js +2 -2
- package/lib/esm/checkbox/stories/checkbox-full.story.js.map +1 -1
- package/lib/esm/checkbox/stories/checkbox.stories.js +19 -19
- package/lib/esm/checkbox/stories/checkbox.stories.js.map +1 -1
- package/lib/esm/clean-icon-button/stories/clean-icon-button.stories.js +11 -11
- package/lib/esm/clean-icon-button/stories/clean-icon-button.stories.js.map +1 -1
- package/lib/esm/code-block/stories/code-disabled.story.js +2 -2
- package/lib/esm/code-block/stories/code-disabled.story.js.map +1 -1
- package/lib/esm/code-block/stories/code-full.story.js +2 -2
- package/lib/esm/code-block/stories/code-full.story.js.map +1 -1
- package/lib/esm/code-block/stories/code-with-actions.story.js +2 -2
- package/lib/esm/code-block/stories/code-with-actions.story.js.map +1 -1
- package/lib/esm/code-block/themes/ndl-code-dark.js +64 -64
- package/lib/esm/code-block/themes/ndl-code-dark.js.map +1 -1
- package/lib/esm/code-block/themes/ndl-code-light.js +64 -64
- package/lib/esm/code-block/themes/ndl-code-light.js.map +1 -1
- package/lib/esm/color-picker/ColorPicker.js +1 -1
- package/lib/esm/color-picker/ColorPicker.js.map +1 -1
- package/lib/esm/color-picker/stories/color-picker.stories.js +4 -4
- package/lib/esm/color-picker/stories/color-picker.stories.js.map +1 -1
- package/lib/esm/data-grid/Components.js +13 -11
- package/lib/esm/data-grid/Components.js.map +1 -1
- package/lib/esm/data-grid/DataGrid.js.map +1 -1
- package/lib/esm/data-grid/data-grid-context.js +1 -1
- package/lib/esm/data-grid/data-grid-context.js.map +1 -1
- package/lib/esm/data-grid/data-grid-nav/index.js +1 -1
- package/lib/esm/data-grid/data-grid-nav/index.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js +1 -1
- package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
- package/lib/esm/date-picker/stories/date-picker-full.story.js +9 -9
- package/lib/esm/date-picker/stories/date-picker-full.story.js.map +1 -1
- package/lib/esm/divider/stories/divider-horizontal.story.js +1 -1
- package/lib/esm/divider/stories/divider-horizontal.story.js.map +1 -1
- package/lib/esm/divider/stories/divider-vertical.story.js +1 -1
- package/lib/esm/divider/stories/divider-vertical.story.js.map +1 -1
- package/lib/esm/drawer/stories/drawer.stories.js +19 -19
- package/lib/esm/drawer/stories/drawer.stories.js.map +1 -1
- package/lib/esm/dropdown-button/stories/dropdown-button.stories.js +18 -18
- package/lib/esm/dropdown-button/stories/dropdown-button.stories.js.map +1 -1
- package/lib/esm/dropzone/stories/dropzone-disabled.story.js +1 -1
- package/lib/esm/dropzone/stories/dropzone-disabled.story.js.map +1 -1
- package/lib/esm/dropzone/stories/dropzone-full.story.js +11 -11
- package/lib/esm/dropzone/stories/dropzone-full.story.js.map +1 -1
- package/lib/esm/dropzone/stories/dropzone.stories.js +10 -10
- package/lib/esm/dropzone/stories/dropzone.stories.js.map +1 -1
- package/lib/esm/flex/Flex.js +4 -4
- package/lib/esm/flex/Flex.js.map +1 -1
- package/lib/esm/graph-label/stories/graph-label.stories.js +20 -20
- package/lib/esm/graph-label/stories/graph-label.stories.js.map +1 -1
- package/lib/esm/hooks/index.js +3 -3
- package/lib/esm/hooks/index.js.map +1 -1
- package/lib/esm/icon-button/stories/icon-button.stories.js +12 -12
- package/lib/esm/icon-button/stories/icon-button.stories.js.map +1 -1
- package/lib/esm/icon-button-array/stories/icon-button-array.stories.js +16 -16
- package/lib/esm/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
- package/lib/esm/icons/wrapIcon.js +1 -1
- package/lib/esm/icons/wrapIcon.js.map +1 -1
- package/lib/esm/kbd/stories/kbd.stories.js +7 -7
- package/lib/esm/kbd/stories/kbd.stories.js.map +1 -1
- package/lib/esm/loading-spinner/LoadingSpinner.js +2 -2
- package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/esm/loading-spinner/stories/loading-spinner.stories.js +10 -10
- package/lib/esm/loading-spinner/stories/loading-spinner.stories.js.map +1 -1
- package/lib/esm/logo/Logo.js +6 -6
- package/lib/esm/logo/Logo.js.map +1 -1
- package/lib/esm/logo/stories/logo.stories.js +9 -9
- package/lib/esm/logo/stories/logo.stories.js.map +1 -1
- package/lib/esm/menu/Menu.js +3 -3
- package/lib/esm/menu/Menu.js.map +1 -1
- package/lib/esm/popover/Popover.js +15 -15
- package/lib/esm/popover/Popover.js.map +1 -1
- package/lib/esm/popover/use-popover.js +9 -9
- package/lib/esm/popover/use-popover.js.map +1 -1
- package/lib/esm/progress-bar/stories/progress-bar.stories.js +3 -3
- package/lib/esm/progress-bar/stories/progress-bar.stories.js.map +1 -1
- package/lib/esm/segmented-control/SegmentedControl.js +1 -1
- package/lib/esm/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/esm/select/Overrides.js +41 -41
- package/lib/esm/select/Overrides.js.map +1 -1
- package/lib/esm/select/stories/select-async.story.js +4 -4
- package/lib/esm/select/stories/select-async.story.js.map +1 -1
- package/lib/esm/select/stories/select-controlled.story.js +4 -4
- package/lib/esm/select/stories/select-controlled.story.js.map +1 -1
- package/lib/esm/select/stories/select-creatable.story.js +1 -1
- package/lib/esm/select/stories/select-creatable.story.js.map +1 -1
- package/lib/esm/select/stories/select-custom-label.story.js +1 -1
- package/lib/esm/select/stories/select-custom-label.story.js.map +1 -1
- package/lib/esm/select/stories/select-disabled.story.js +1 -1
- package/lib/esm/select/stories/select-disabled.story.js.map +1 -1
- package/lib/esm/select/stories/select-inside-dialog.story.js +1 -1
- package/lib/esm/select/stories/select-inside-dialog.story.js.map +1 -1
- package/lib/esm/side-navigation/stories/side-nav.stories.js +1 -1
- package/lib/esm/side-navigation/stories/side-nav.stories.js.map +1 -1
- package/lib/esm/skeleton/stories/skeleton.stories.js +28 -28
- package/lib/esm/skeleton/stories/skeleton.stories.js.map +1 -1
- package/lib/esm/slider/Slider.js +2 -1
- package/lib/esm/slider/Slider.js.map +1 -1
- package/lib/esm/status-indicator/stories/status-indicator.stories.js +2 -2
- package/lib/esm/status-indicator/stories/status-indicator.stories.js.map +1 -1
- package/lib/esm/switch/stories/switch.stories.js +7 -7
- package/lib/esm/switch/stories/switch.stories.js.map +1 -1
- package/lib/esm/tabs/Tabs.js +1 -1
- package/lib/esm/tabs/Tabs.js.map +1 -1
- package/lib/esm/tag/Tag.js +2 -2
- package/lib/esm/tag/Tag.js.map +1 -1
- package/lib/esm/tag/stories/tag.stories.js +10 -10
- package/lib/esm/tag/stories/tag.stories.js.map +1 -1
- package/lib/esm/text-area/TextArea.js +5 -5
- package/lib/esm/text-area/TextArea.js.map +1 -1
- package/lib/esm/text-area/stories/text-area.stories.js +25 -25
- package/lib/esm/text-area/stories/text-area.stories.js.map +1 -1
- package/lib/esm/text-input/stories/text-input-number.story.js +2 -2
- package/lib/esm/text-input/stories/text-input-number.story.js.map +1 -1
- package/lib/esm/text-link/stories/text-link.stories.js +11 -11
- package/lib/esm/text-link/stories/text-link.stories.js.map +1 -1
- package/lib/esm/text-overflow/stories/text-overflow.stories.js +1 -1
- package/lib/esm/text-overflow/stories/text-overflow.stories.js.map +1 -1
- package/lib/esm/theme/ThemeProvider.js.map +1 -1
- package/lib/esm/theme/agnostic.js +1 -1
- package/lib/esm/theme/agnostic.js.map +1 -1
- package/lib/esm/time-picker/TimePicker.js +4 -4
- package/lib/esm/time-picker/TimePicker.js.map +1 -1
- package/lib/esm/time-picker/time-picker-hooks.js +1 -1
- package/lib/esm/time-picker/time-picker-hooks.js.map +1 -1
- package/lib/esm/timezone-picker/TimeZonePicker.js +5 -5
- package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js +7 -7
- package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
- package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
- package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
- package/lib/esm/toast/Toast.js +12 -12
- package/lib/esm/toast/Toast.js.map +1 -1
- package/lib/esm/toast/stories/toast-action-story.js +1 -1
- package/lib/esm/toast/stories/toast-action-story.js.map +1 -1
- package/lib/esm/toast/stories/toast-controlled-story.js +2 -2
- package/lib/esm/toast/stories/toast-controlled-story.js.map +1 -1
- package/lib/esm/toast/stories/toast-progress-bar.js +1 -1
- package/lib/esm/toast/stories/toast-progress-bar.js.map +1 -1
- package/lib/esm/toast/stories/toast.stories.js +18 -18
- package/lib/esm/toast/stories/toast.stories.js.map +1 -1
- package/lib/esm/tooltip/Tooltip.js +1 -1
- package/lib/esm/tooltip/Tooltip.js.map +1 -1
- package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js +1 -1
- package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js.map +1 -1
- package/lib/esm/tooltip/stories/tooltip-placements.story.js +8 -8
- package/lib/esm/tooltip/stories/tooltip-placements.story.js.map +1 -1
- package/lib/esm/tooltip/stories/tooltip.stories.js +29 -29
- package/lib/esm/tooltip/stories/tooltip.stories.js.map +1 -1
- package/lib/esm/tooltip/use-tooltip.js +10 -10
- package/lib/esm/tooltip/use-tooltip.js.map +1 -1
- package/lib/esm/tree-view/TreeItemWrapper.js +2 -2
- package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
- package/lib/esm/tree-view/TreeView.js +12 -12
- package/lib/esm/tree-view/TreeView.js.map +1 -1
- package/lib/esm/tree-view/TreeViewItem.js +1 -1
- package/lib/esm/tree-view/TreeViewItem.js.map +1 -1
- package/lib/esm/tree-view/TreeViewTextItem.js +1 -1
- package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
- package/lib/esm/tree-view/tree-view-keyboard-coordinates.js +2 -2
- package/lib/esm/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
- package/lib/esm/wizard/Wizard.js +2 -2
- package/lib/esm/wizard/Wizard.js.map +1 -1
- package/lib/esm/wizard/stories/wizard.stories.js +14 -14
- package/lib/esm/wizard/stories/wizard.stories.js.map +1 -1
- package/lib/types/accordion/stories/accordion.stories.d.ts +3 -3
- package/lib/types/breadcrumbs/stories/breadcrumbs.stories.d.ts +1 -1
- package/lib/types/data-grid/Components.d.ts.map +1 -1
- package/lib/types/logo/stories/logo.stories.d.ts +3 -3
- package/lib/types/side-navigation/stories/side-nav.stories.d.ts +1 -1
- package/lib/types/skeleton/stories/skeleton.stories.d.ts +3 -3
- package/lib/types/slider/Slider.d.ts.map +1 -1
- package/lib/types/time-picker/time-picker-hooks.d.ts +1 -1
- package/lib/types/time-picker/time-picker-hooks.d.ts.map +1 -1
- package/lib/types/toast/stories/toast.stories.d.ts +2 -2
- package/package.json +1 -1
|
@@ -27,10 +27,10 @@ const Component = () => {
|
|
|
27
27
|
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-row n-justify-center", children: [(0, jsx_runtime_1.jsx)(react_1.Toaster, {}), (0, jsx_runtime_1.jsx)(react_1.FilledButton, { onClick: () => {
|
|
28
28
|
react_1.toast.neutral('Hello', {
|
|
29
29
|
actionLabel: 'Action',
|
|
30
|
-
shouldCloseOnAction: true,
|
|
31
30
|
onAction: () => {
|
|
32
31
|
console.info('action');
|
|
33
32
|
},
|
|
33
|
+
shouldCloseOnAction: true,
|
|
34
34
|
});
|
|
35
35
|
}, children: "Press to show a Toast" })] }));
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-action-story.js","sourceRoot":"","sources":["../../../../src/toast/stories/toast-action-story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgE;AAEhE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,oCAAoC,aAEjD,uBAAC,eAAO,KAAG,EACX,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE;oBACZ,aAAK,CAAC,OAAO,CAAC,OAAO,EAAE;wBACrB,WAAW,EAAE,QAAQ;wBACrB,
|
|
1
|
+
{"version":3,"file":"toast-action-story.js","sourceRoot":"","sources":["../../../../src/toast/stories/toast-action-story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgE;AAEhE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,oCAAoC,aAEjD,uBAAC,eAAO,KAAG,EACX,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE;oBACZ,aAAK,CAAC,OAAO,CAAC,OAAO,EAAE;wBACrB,WAAW,EAAE,QAAQ;wBACrB,QAAQ,EAAE,GAAG,EAAE;4BACb,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;wBACzB,CAAC;wBACD,mBAAmB,EAAE,IAAI;qBAC1B,CAAC,CAAC;gBACL,CAAC,sCAGY,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, toast, Toaster } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-row n-justify-center\">\n {/* Toaster should be at the root of the app */}\n <Toaster />\n <FilledButton\n onClick={() => {\n toast.neutral('Hello', {\n actionLabel: 'Action',\n onAction: () => {\n console.info('action');\n },\n shouldCloseOnAction: true,\n });\n }}\n >\n Press to show a Toast\n </FilledButton>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -31,11 +31,11 @@ const Component = () => {
|
|
|
31
31
|
...toasts,
|
|
32
32
|
{
|
|
33
33
|
id: '1',
|
|
34
|
-
text: 'Hi there!',
|
|
35
|
-
variant: 'neutral',
|
|
36
34
|
onClose: () => {
|
|
37
35
|
setToasts(toasts.filter((toast) => toast.id !== '1'));
|
|
38
36
|
},
|
|
37
|
+
text: 'Hi there!',
|
|
38
|
+
variant: 'neutral',
|
|
39
39
|
},
|
|
40
40
|
]);
|
|
41
41
|
}, children: "Press to show a Toast" })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-controlled-story.js","sourceRoot":"","sources":["../../../../src/toast/stories/toast-controlled-story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAmE;AACnE,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAElC,EAAE,CAAC,CAAC;IAEN,OAAO,CACL,iCAAK,SAAS,EAAC,yBAAyB,aAEtC,uBAAC,yBAAiB,IAAC,MAAM,EAAE,MAAM,GAAI,EACrC,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE;oBACZ,SAAS,CAAC;wBACR,GAAG,MAAM;wBACT;4BACE,EAAE,EAAE,GAAG;4BACP,
|
|
1
|
+
{"version":3,"file":"toast-controlled-story.js","sourceRoot":"","sources":["../../../../src/toast/stories/toast-controlled-story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAmE;AACnE,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAElC,EAAE,CAAC,CAAC;IAEN,OAAO,CACL,iCAAK,SAAS,EAAC,yBAAyB,aAEtC,uBAAC,yBAAiB,IAAC,MAAM,EAAE,MAAM,GAAI,EACrC,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE;oBACZ,SAAS,CAAC;wBACR,GAAG,MAAM;wBACT;4BACE,EAAE,EAAE,GAAG;4BACP,OAAO,EAAE,GAAG,EAAE;gCACZ,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;4BACxD,CAAC;4BACD,IAAI,EAAE,WAAW;4BACjB,OAAO,EAAE,SAAS;yBACnB;qBACF,CAAC,CAAC;gBACL,CAAC,sCAGY,IACX,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, ToasterControlled } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [toasts, setToasts] = useState<\n React.ComponentProps<typeof ToasterControlled>['toasts']\n >([]);\n\n return (\n <div className=\"n-flex n-justify-center\">\n {/* Toaster should be at the root of the app */}\n <ToasterControlled toasts={toasts} />\n <FilledButton\n onClick={() => {\n setToasts([\n ...toasts,\n {\n id: '1',\n onClose: () => {\n setToasts(toasts.filter((toast) => toast.id !== '1'));\n },\n text: 'Hi there!',\n variant: 'neutral',\n },\n ]);\n }}\n >\n Press to show a Toast\n </FilledButton>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -31,12 +31,12 @@ const Component = () => {
|
|
|
31
31
|
const id = react_1.toast.progressBar('Hello', {
|
|
32
32
|
icon: (0, jsx_runtime_1.jsx)(icons_1.CloudArrowDownIconSolid, {}),
|
|
33
33
|
isCloseable: true,
|
|
34
|
-
shouldCloseOnAction: true,
|
|
35
34
|
onClose: () => {
|
|
36
35
|
setProgressBarId(null);
|
|
37
36
|
console.info('close');
|
|
38
37
|
},
|
|
39
38
|
shouldAutoClose: false,
|
|
39
|
+
shouldCloseOnAction: true,
|
|
40
40
|
});
|
|
41
41
|
setProgressBarId(id);
|
|
42
42
|
}, children: "Press to show a Toast" }), (0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast-progress-bar.js","sourceRoot":"","sources":["../../../../src/toast/stories/toast-progress-bar.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgF;AAChF,kDAAiE;AACjE,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAChD,IAAI,CACL,CAAC;IACF,OAAO,CACL,iCAAK,SAAS,EAAC,iCAAiC,aAE9C,uBAAC,eAAO,KAAG,EACX,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE;oBACZ,MAAM,EAAE,GAAG,aAAK,CAAC,WAAW,CAAC,OAAO,EAAE;wBACpC,IAAI,EAAE,uBAAC,+BAAuB,KAAG;wBACjC,WAAW,EAAE,IAAI;wBACjB,
|
|
1
|
+
{"version":3,"file":"toast-progress-bar.js","sourceRoot":"","sources":["../../../../src/toast/stories/toast-progress-bar.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAgF;AAChF,kDAAiE;AACjE,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,IAAA,gBAAQ,EAChD,IAAI,CACL,CAAC;IACF,OAAO,CACL,iCAAK,SAAS,EAAC,iCAAiC,aAE9C,uBAAC,eAAO,KAAG,EACX,uBAAC,oBAAY,IACX,OAAO,EAAE,GAAG,EAAE;oBACZ,MAAM,EAAE,GAAG,aAAK,CAAC,WAAW,CAAC,OAAO,EAAE;wBACpC,IAAI,EAAE,uBAAC,+BAAuB,KAAG;wBACjC,WAAW,EAAE,IAAI;wBACjB,OAAO,EAAE,GAAG,EAAE;4BACZ,gBAAgB,CAAC,IAAI,CAAC,CAAC;4BACvB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;wBACxB,CAAC;wBACD,eAAe,EAAE,KAAK;wBACtB,mBAAmB,EAAE,IAAI;qBAC1B,CAAC,CAAC;oBACH,gBAAgB,CAAC,EAAE,CAAC,CAAC;gBACvB,CAAC,sCAGY,EACf,uBAAC,sBAAc,IACb,OAAO,EAAE,GAAG,EAAE;oBACZ,IAAI,aAAa,EAAE,CAAC;wBAClB,aAAK,CAAC,sBAAsB,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;oBAClD,CAAC;gBACH,CAAC,oCAGc,IACb,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, OutlinedButton, toast, Toaster } from '@neo4j-ndl/react';\nimport { CloudArrowDownIconSolid } from '@neo4j-ndl/react/icons';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [progressBarId, setProgressBarId] = useState<string | number | null>(\n null,\n );\n return (\n <div className=\"n-flex n-justify-center n-gap-4\">\n {/* Toaster should be at the root of the app */}\n <Toaster />\n <FilledButton\n onClick={() => {\n const id = toast.progressBar('Hello', {\n icon: <CloudArrowDownIconSolid />,\n isCloseable: true,\n onClose: () => {\n setProgressBarId(null);\n console.info('close');\n },\n shouldAutoClose: false,\n shouldCloseOnAction: true,\n });\n setProgressBarId(id);\n }}\n >\n Press to show a Toast\n </FilledButton>\n <OutlinedButton\n onClick={() => {\n if (progressBarId) {\n toast.updateProgressBarValue(progressBarId, 50);\n }\n }}\n >\n Update progress bar\n </OutlinedButton>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -24,114 +24,114 @@ exports.Controlled = exports.Custom = exports.ProgressBar = exports.Closeable =
|
|
|
24
24
|
const react_1 = require("@neo4j-ndl/react");
|
|
25
25
|
const _1 = require(".");
|
|
26
26
|
const componentMeta = {
|
|
27
|
-
title: 'Components/Toast',
|
|
28
|
-
id: 'components-toast',
|
|
29
27
|
component: react_1.Toaster,
|
|
28
|
+
id: 'components-toast',
|
|
30
29
|
tags: ['docsPage'],
|
|
30
|
+
title: 'Components/Toast',
|
|
31
31
|
};
|
|
32
32
|
exports.default = componentMeta;
|
|
33
33
|
exports.Neutral = {
|
|
34
34
|
args: {},
|
|
35
|
-
render: _1.ToastNeutral,
|
|
36
35
|
parameters: {
|
|
37
36
|
docs: {
|
|
38
37
|
source: {
|
|
38
|
+
code: _1.ToastNeutralSrc,
|
|
39
39
|
language: 'tsx',
|
|
40
40
|
type: 'code',
|
|
41
|
-
code: _1.ToastNeutralSrc,
|
|
42
41
|
},
|
|
43
42
|
},
|
|
44
43
|
},
|
|
44
|
+
render: _1.ToastNeutral,
|
|
45
45
|
};
|
|
46
46
|
exports.Success = {
|
|
47
47
|
args: {},
|
|
48
|
-
render: _1.ToastSuccess,
|
|
49
48
|
parameters: {
|
|
50
49
|
docs: {
|
|
51
50
|
source: {
|
|
51
|
+
code: _1.ToastSuccessSrc,
|
|
52
52
|
language: 'tsx',
|
|
53
53
|
type: 'code',
|
|
54
|
-
code: _1.ToastSuccessSrc,
|
|
55
54
|
},
|
|
56
55
|
},
|
|
57
56
|
},
|
|
57
|
+
render: _1.ToastSuccess,
|
|
58
58
|
};
|
|
59
59
|
exports.Error = {
|
|
60
60
|
args: {},
|
|
61
|
-
render: _1.ToastDanger,
|
|
62
61
|
parameters: {
|
|
63
62
|
docs: {
|
|
64
63
|
source: {
|
|
64
|
+
code: _1.ToastDangerSrc,
|
|
65
65
|
language: 'tsx',
|
|
66
66
|
type: 'code',
|
|
67
|
-
code: _1.ToastDangerSrc,
|
|
68
67
|
},
|
|
69
68
|
},
|
|
70
69
|
},
|
|
70
|
+
render: _1.ToastDanger,
|
|
71
71
|
};
|
|
72
72
|
exports.Action = {
|
|
73
73
|
args: {},
|
|
74
|
-
render: _1.ToastAction,
|
|
75
74
|
parameters: {
|
|
76
75
|
docs: {
|
|
77
76
|
source: {
|
|
77
|
+
code: _1.ToastActionSrc,
|
|
78
78
|
language: 'tsx',
|
|
79
79
|
type: 'code',
|
|
80
|
-
code: _1.ToastActionSrc,
|
|
81
80
|
},
|
|
82
81
|
},
|
|
83
82
|
},
|
|
83
|
+
render: _1.ToastAction,
|
|
84
84
|
};
|
|
85
85
|
exports.Closeable = {
|
|
86
86
|
args: {},
|
|
87
|
-
render: _1.ToastCloseable,
|
|
88
87
|
parameters: {
|
|
89
88
|
docs: {
|
|
90
89
|
source: {
|
|
90
|
+
code: _1.ToastCloseableSrc,
|
|
91
91
|
language: 'tsx',
|
|
92
92
|
type: 'code',
|
|
93
|
-
code: _1.ToastCloseableSrc,
|
|
94
93
|
},
|
|
95
94
|
},
|
|
96
95
|
},
|
|
96
|
+
render: _1.ToastCloseable,
|
|
97
97
|
};
|
|
98
98
|
exports.ProgressBar = {
|
|
99
99
|
args: {},
|
|
100
|
-
render: _1.ToastProgressBar,
|
|
101
100
|
parameters: {
|
|
102
101
|
docs: {
|
|
103
102
|
source: {
|
|
103
|
+
code: _1.ToastProgressBarSrc,
|
|
104
104
|
language: 'tsx',
|
|
105
105
|
type: 'code',
|
|
106
|
-
code: _1.ToastProgressBarSrc,
|
|
107
106
|
},
|
|
108
107
|
},
|
|
109
108
|
},
|
|
109
|
+
render: _1.ToastProgressBar,
|
|
110
110
|
};
|
|
111
111
|
exports.Custom = {
|
|
112
112
|
args: {},
|
|
113
|
-
render: _1.ToastCustom,
|
|
114
113
|
parameters: {
|
|
115
114
|
docs: {
|
|
116
115
|
source: {
|
|
116
|
+
code: _1.ToastCustomSrc,
|
|
117
117
|
language: 'tsx',
|
|
118
118
|
type: 'code',
|
|
119
|
-
code: _1.ToastCustomSrc,
|
|
120
119
|
},
|
|
121
120
|
},
|
|
122
121
|
},
|
|
122
|
+
render: _1.ToastCustom,
|
|
123
123
|
};
|
|
124
124
|
exports.Controlled = {
|
|
125
125
|
args: {},
|
|
126
|
-
render: _1.ToastControlled,
|
|
127
126
|
parameters: {
|
|
128
127
|
docs: {
|
|
129
128
|
source: {
|
|
129
|
+
code: _1.ToastControlledSrc,
|
|
130
130
|
language: 'tsx',
|
|
131
131
|
type: 'code',
|
|
132
|
-
code: _1.ToastControlledSrc,
|
|
133
132
|
},
|
|
134
133
|
},
|
|
135
134
|
},
|
|
135
|
+
render: _1.ToastControlled,
|
|
136
136
|
};
|
|
137
137
|
//# sourceMappingURL=toast.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.stories.js","sourceRoot":"","sources":["../../../../src/toast/stories/toast.stories.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA2C;AAG3C,wBAiBW;AAEX,MAAM,aAAa,GAAG;IACpB,
|
|
1
|
+
{"version":3,"file":"toast.stories.js","sourceRoot":"","sources":["../../../../src/toast/stories/toast.stories.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,4CAA2C;AAG3C,wBAiBW;AAEX,MAAM,aAAa,GAAG;IACpB,SAAS,EAAE,eAAO;IAClB,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,KAAK,EAAE,kBAAkB;CACK,CAAC;AAEjC,kBAAe,aAAa,CAAC;AAGhB,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,kBAAe;gBACrB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,eAAY;CACrB,CAAC;AAEW,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,kBAAe;gBACrB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,eAAY;CACrB,CAAC;AAEW,QAAA,KAAK,GAAU;IAC1B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,iBAAc;gBACpB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,cAAW;CACpB,CAAC;AAEW,QAAA,MAAM,GAAU;IAC3B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,iBAAc;gBACpB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,cAAW;CACpB,CAAC;AAEW,QAAA,SAAS,GAAU;IAC9B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,oBAAiB;gBACvB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,iBAAc;CACvB,CAAC;AAEW,QAAA,WAAW,GAAU;IAChC,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,sBAAmB;gBACzB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,mBAAgB;CACzB,CAAC;AAEW,QAAA,MAAM,GAAU;IAC3B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,iBAAc;gBACpB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,cAAW;CACpB,CAAC;AAEW,QAAA,UAAU,GAAU;IAC/B,IAAI,EAAE,EAAE;IACR,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,qBAAkB;gBACxB,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,MAAM;aACb;SACF;KACF;IACD,MAAM,EAAE,kBAAe;CACxB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { Toaster } from '@neo4j-ndl/react';\nimport { type Meta, type StoryObj } from '@storybook/react-vite';\n\nimport {\n ToastAction,\n ToastActionSrc,\n ToastCloseable,\n ToastCloseableSrc,\n ToastControlled,\n ToastControlledSrc,\n ToastCustom,\n ToastCustomSrc,\n ToastDanger,\n ToastDangerSrc,\n ToastNeutral,\n ToastNeutralSrc,\n ToastProgressBar,\n ToastProgressBarSrc,\n ToastSuccess,\n ToastSuccessSrc,\n} from '.';\n\nconst componentMeta = {\n component: Toaster,\n id: 'components-toast',\n tags: ['docsPage'],\n title: 'Components/Toast',\n} satisfies Meta<typeof Toaster>;\n\nexport default componentMeta;\ntype Story = StoryObj<typeof componentMeta>;\n\nexport const Neutral: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ToastNeutralSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ToastNeutral,\n};\n\nexport const Success: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ToastSuccessSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ToastSuccess,\n};\n\nexport const Error: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ToastDangerSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ToastDanger,\n};\n\nexport const Action: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ToastActionSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ToastAction,\n};\n\nexport const Closeable: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ToastCloseableSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ToastCloseable,\n};\n\nexport const ProgressBar: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ToastProgressBarSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ToastProgressBar,\n};\n\nexport const Custom: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ToastCustomSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ToastCustom,\n};\n\nexport const Controlled: Story = {\n args: {},\n parameters: {\n docs: {\n source: {\n code: ToastControlledSrc,\n language: 'tsx',\n type: 'code',\n },\n },\n },\n render: ToastControlled,\n};\n"]}
|
|
@@ -68,7 +68,7 @@ const TooltipTrigger = (_a) => {
|
|
|
68
68
|
var { children, hasButtonWrapper = false, htmlAttributes, className, style, ref } = _a, restProps = __rest(_a, ["children", "hasButtonWrapper", "htmlAttributes", "className", "style", "ref"]);
|
|
69
69
|
const context = (0, use_tooltip_1.useTooltipContext)();
|
|
70
70
|
// Example from floating-ui
|
|
71
|
-
//
|
|
71
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
72
|
const childrenProps = children.props;
|
|
73
73
|
const mergedRefs = (0, react_1.useMergeRefs)([
|
|
74
74
|
context.refs.setReference,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAO4B;AAC5B,4DAAoC;AAEpC,iCAAqD;AAGrD,0DAAsD;AACtD,6DAA6D;AAC7D,oCAA0C;AAC1C,8CAAoE;AACpE,+CAA8E;AA+B9E,MAAM,gBAAgB,GAAG,CAAC,EACxB,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,aAAa,EACb,SAAS,EACT,MAAM,EACN,YAAY,EACZ,UAAU,EAAE,cAAc,EAC1B,gBAAgB,EAAE,YAAY,EAC9B,UAAU,EACV,2BAA2B,EAC3B,iBAAiB,GACJ,EAAE,EAA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,GAAG,IAAA,oBAAY,EAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;IAEjE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;IAE7D,OAAO,CACL,8CACE,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;IAC9C,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,cAAc;CACxB,CAAC,CAAC;AAEM,0BAAO","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type AutoUpdateOptions,\n FloatingFocusManager,\n FloatingPortal,\n type Placement,\n type UseFloatingOptions,\n useMergeRefs,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { cloneElement, isValidElement } from 'react';\n\nimport { type CommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { useNeedleTheme } from '../theme';\nimport { Typography, type TypographyVariants } from '../typography';\nimport { TooltipContext, useTooltip, useTooltipContext } from './use-tooltip';\n\nexport type TooltipProps = {\n /** Content displayed inside the tooltip. Wraps `Tooltip.Trigger`, `Tooltip.Content`, and optional parts */\n children: React.ReactNode;\n /** Whether the tooltip is disabled */\n isDisabled?: boolean;\n /** Whether the tooltip should be open on first render */\n isInitialOpen?: boolean;\n /** Placement of the tooltip content relative to the trigger */\n placement?: Placement;\n /** Controls the open state . If omitted, the tooltip manages its own state */\n isOpen?: boolean;\n /** Visual style of the tooltip content. `simple` renders plain text, `rich` renders a composable panel */\n type: 'simple' | 'rich';\n /** Whether the content is rendered in a portal. */\n isPortaled?: boolean;\n /** Callback fired when the open state changes, if omitted, the tooltip manages its own state using internal hooks */\n onOpenChange?: UseFloatingOptions['onOpenChange'];\n /** Positioning strategy of the tooltip. Defaults to `fixed` when inside a dialog, otherwise `absolute` */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Hover open/close delays in milliseconds */\n hoverDelay?: {\n open: number;\n close: number;\n };\n /** Whether the tooltip should close when the reference element is clicked. Useful when the trigger moves after click. */\n shouldCloseOnReferenceClick?: boolean;\n autoUpdateOptions?: AutoUpdateOptions;\n};\n\nconst TooltipComponent = ({\n children,\n isDisabled = false,\n type,\n isInitialOpen,\n placement,\n isOpen,\n onOpenChange,\n isPortaled: isPortaledProp,\n floatingStrategy: strategyProp,\n hoverDelay,\n shouldCloseOnReferenceClick,\n autoUpdateOptions,\n}: TooltipProps) => {\n const isInsideDialog = useIsInsideDialog();\n const strategy = isInsideDialog ? 'fixed' : 'absolute';\n const isPortaled = !isInsideDialog;\n\n const tooltip = useTooltip({\n autoUpdateOptions,\n hoverDelay,\n isInitialOpen,\n // if isDisabled is true tooltip will not open otherwise either controlled or uncontrolled depending on if isOpen is passed\n isOpen: isDisabled === true ? false : isOpen,\n isPortaled: isPortaledProp ?? isPortaled,\n onOpenChange,\n placement,\n shouldCloseOnReferenceClick,\n strategy: strategyProp ?? strategy,\n type,\n });\n\n return (\n <TooltipContext.Provider value={tooltip}>\n {children}\n </TooltipContext.Provider>\n );\n};\n\nTooltipComponent.displayName = 'Tooltip';\n\ntype TooltipTriggerProps = {\n /** Content displayed inside the trigger element */\n children: React.ReactNode;\n /** Whether the trigger element can be any element without an extra button wrapper. The child element will be cloned with the necessary trigger props and merged refs */\n hasButtonWrapper?: boolean;\n};\n\nconst TooltipTrigger = ({\n children,\n hasButtonWrapper = false,\n htmlAttributes,\n className,\n style,\n ref,\n ...restProps\n}: CommonProps<'button', TooltipTriggerProps>) => {\n const context = useTooltipContext();\n\n // Example from floating-ui\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const childrenProps = (children as any).props;\n const mergedRefs = useMergeRefs([\n context.refs.setReference,\n ref,\n childrenProps?.ref,\n ]);\n\n const triggerClasses = classNames(\n {\n 'ndl-closed': !context.isOpen,\n 'ndl-open': context.isOpen,\n },\n 'ndl-tooltip-trigger',\n className,\n );\n\n // `hasButtonWrapper=true` allows the user to pass any element as the anchor\n if (hasButtonWrapper && isValidElement(children)) {\n const props: Record<string, unknown> = {\n className: triggerClasses,\n ...htmlAttributes,\n ...childrenProps,\n ref: mergedRefs,\n };\n return cloneElement(children, context.getReferenceProps(props));\n }\n\n return (\n <button\n className={triggerClasses}\n style={style}\n ref={mergedRefs}\n {...context.getReferenceProps(htmlAttributes)}\n {...restProps}\n >\n {children}\n </button>\n );\n};\n\ntype TooltipContentProps = {\n /** Content displayed inside the tooltip */\n children: React.ReactNode;\n};\n\nconst TooltipContent = ({\n children,\n style,\n htmlAttributes,\n className,\n ref,\n ...restProps\n}: CommonProps<'div', TooltipContentProps>) => {\n const context = useTooltipContext();\n const mergedRef = useMergeRefs([context.refs.setFloating, ref]);\n const { themeClassName } = useNeedleTheme();\n if (!context.isOpen) {\n return null;\n }\n\n const classes = classNames('ndl-tooltip-content', themeClassName, className, {\n 'ndl-tooltip-content-rich': context.type === 'rich',\n 'ndl-tooltip-content-simple': context.type === 'simple',\n });\n\n if (context.type === 'simple') {\n return (\n <ConditionalWrap\n shouldWrap={context.isPortaled}\n wrap={(wrapChildren) => <FloatingPortal>{wrapChildren}</FloatingPortal>}\n >\n <div\n ref={mergedRef}\n className={classes}\n style={{\n ...context.floatingStyles,\n ...style,\n }}\n {...restProps}\n {...context.getFloatingProps(htmlAttributes)}\n >\n <Typography variant=\"body-medium\">{children}</Typography>\n </div>\n </ConditionalWrap>\n );\n }\n\n return (\n <ConditionalWrap\n shouldWrap={context.isPortaled}\n wrap={(wrapChildren) => <FloatingPortal>{wrapChildren}</FloatingPortal>}\n >\n <FloatingFocusManager\n context={context.context}\n returnFocus={true}\n modal={false}\n initialFocus={-1}\n closeOnFocusOut\n >\n <div\n ref={mergedRef}\n className={classes}\n style={{\n ...context.floatingStyles,\n ...style,\n }}\n {...restProps}\n {...context.getFloatingProps(htmlAttributes)}\n >\n {children}\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n );\n};\n\ntype TooltipHeaderProps = {\n /** Content displayed inside the header */\n children: React.ReactNode;\n /** @deprecated Use `typographyVariant` instead */\n passThroughProps?: Partial<React.ComponentPropsWithoutRef<typeof Typography>>;\n typographyVariant?: TypographyVariants;\n};\n\nconst TooltipHeader = ({\n children,\n passThroughProps,\n typographyVariant = 'subheading-medium',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'span', TooltipHeaderProps>) => {\n const context = useTooltipContext();\n\n const classes = classNames('ndl-tooltip-header', className);\n\n if (!context.isOpen) {\n return null;\n }\n\n return (\n <Typography\n ref={ref}\n variant={typographyVariant}\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...passThroughProps}\n {...restProps}\n >\n {children}\n </Typography>\n );\n};\n\nexport type TooltipBodyProps = {\n /** Content displayed inside the body */\n children: React.ReactNode;\n /** Additional props to pass to the Typography component */\n // TODO v5: Deprecate passThroughProps and use restProps instead\n passThroughProps?: Partial<React.ComponentPropsWithoutRef<typeof Typography>>;\n};\n\nconst TooltipBody = ({\n children,\n className,\n style,\n htmlAttributes,\n passThroughProps,\n ref,\n ...restProps\n}: CommonProps<'span', TooltipBodyProps>) => {\n const context = useTooltipContext();\n\n const classes = classNames('ndl-tooltip-body', className);\n if (!context.isOpen) {\n return null;\n }\n\n return (\n <Typography\n ref={ref}\n variant=\"body-medium\"\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...passThroughProps}\n {...restProps}\n >\n {children}\n </Typography>\n );\n};\n\ntype ToolTipActionsProps = {\n /** Content displayed inside the actions container */\n children: React.ReactNode;\n};\n\nconst Actions = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ToolTipActionsProps>) => {\n const context = useTooltipContext();\n const mergedRefs = useMergeRefs([context.refs.setFloating, ref]);\n\n if (!context.isOpen) {\n return null;\n }\n\n const classes = classNames('ndl-tooltip-actions', className);\n\n return (\n <div\n className={classes}\n ref={mergedRefs}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nconst Tooltip = Object.assign(TooltipComponent, {\n Actions: Actions,\n Body: TooltipBody,\n Content: TooltipContent,\n Header: TooltipHeader,\n Trigger: TooltipTrigger,\n});\n\nexport { Tooltip };\n"]}
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/tooltip/Tooltip.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAO4B;AAC5B,4DAAoC;AAEpC,iCAAqD;AAGrD,0DAAsD;AACtD,6DAA6D;AAC7D,oCAA0C;AAC1C,8CAAoE;AACpE,+CAA8E;AA+B9E,MAAM,gBAAgB,GAAG,CAAC,EACxB,QAAQ,EACR,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,aAAa,EACb,SAAS,EACT,MAAM,EACN,YAAY,EACZ,UAAU,EAAE,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AAS,cANG,2DAOhB,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,+BAAiB,GAAE,CAAC;IACpC,MAAM,UAAU,GAAG,IAAA,oBAAY,EAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;IAEjE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;IAE7D,OAAO,CACL,8CACE,SAAS,EAAE,OAAO,EAClB,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,KAAK,IACR,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE;IAC9C,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,cAAc;CACxB,CAAC,CAAC;AAEM,0BAAO","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type AutoUpdateOptions,\n FloatingFocusManager,\n FloatingPortal,\n type Placement,\n type UseFloatingOptions,\n useMergeRefs,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { cloneElement, isValidElement } from 'react';\n\nimport { type CommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { useNeedleTheme } from '../theme';\nimport { Typography, type TypographyVariants } from '../typography';\nimport { TooltipContext, useTooltip, useTooltipContext } from './use-tooltip';\n\nexport type TooltipProps = {\n /** Content displayed inside the tooltip. Wraps `Tooltip.Trigger`, `Tooltip.Content`, and optional parts */\n children: React.ReactNode;\n /** Whether the tooltip is disabled */\n isDisabled?: boolean;\n /** Whether the tooltip should be open on first render */\n isInitialOpen?: boolean;\n /** Placement of the tooltip content relative to the trigger */\n placement?: Placement;\n /** Controls the open state . If omitted, the tooltip manages its own state */\n isOpen?: boolean;\n /** Visual style of the tooltip content. `simple` renders plain text, `rich` renders a composable panel */\n type: 'simple' | 'rich';\n /** Whether the content is rendered in a portal. */\n isPortaled?: boolean;\n /** Callback fired when the open state changes, if omitted, the tooltip manages its own state using internal hooks */\n onOpenChange?: UseFloatingOptions['onOpenChange'];\n /** Positioning strategy of the tooltip. Defaults to `fixed` when inside a dialog, otherwise `absolute` */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Hover open/close delays in milliseconds */\n hoverDelay?: {\n open: number;\n close: number;\n };\n /** Whether the tooltip should close when the reference element is clicked. Useful when the trigger moves after click. */\n shouldCloseOnReferenceClick?: boolean;\n autoUpdateOptions?: AutoUpdateOptions;\n};\n\nconst TooltipComponent = ({\n children,\n isDisabled = false,\n type,\n isInitialOpen,\n placement,\n isOpen,\n onOpenChange,\n isPortaled: isPortaledProp,\n floatingStrategy: strategyProp,\n hoverDelay,\n shouldCloseOnReferenceClick,\n autoUpdateOptions,\n}: TooltipProps) => {\n const isInsideDialog = useIsInsideDialog();\n const strategy = isInsideDialog ? 'fixed' : 'absolute';\n const isPortaled = !isInsideDialog;\n\n const tooltip = useTooltip({\n autoUpdateOptions,\n hoverDelay,\n isInitialOpen,\n // if isDisabled is true tooltip will not open otherwise either controlled or uncontrolled depending on if isOpen is passed\n isOpen: isDisabled === true ? false : isOpen,\n isPortaled: isPortaledProp ?? isPortaled,\n onOpenChange,\n placement,\n shouldCloseOnReferenceClick,\n strategy: strategyProp ?? strategy,\n type,\n });\n\n return (\n <TooltipContext.Provider value={tooltip}>\n {children}\n </TooltipContext.Provider>\n );\n};\n\nTooltipComponent.displayName = 'Tooltip';\n\ntype TooltipTriggerProps = {\n /** Content displayed inside the trigger element */\n children: React.ReactNode;\n /** Whether the trigger element can be any element without an extra button wrapper. The child element will be cloned with the necessary trigger props and merged refs */\n hasButtonWrapper?: boolean;\n};\n\nconst TooltipTrigger = ({\n children,\n hasButtonWrapper = false,\n htmlAttributes,\n className,\n style,\n ref,\n ...restProps\n}: CommonProps<'button', TooltipTriggerProps>) => {\n const context = useTooltipContext();\n\n // Example from floating-ui\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n const childrenProps = (children as any).props;\n const mergedRefs = useMergeRefs([\n context.refs.setReference,\n ref,\n childrenProps?.ref,\n ]);\n\n const triggerClasses = classNames(\n {\n 'ndl-closed': !context.isOpen,\n 'ndl-open': context.isOpen,\n },\n 'ndl-tooltip-trigger',\n className,\n );\n\n // `hasButtonWrapper=true` allows the user to pass any element as the anchor\n if (hasButtonWrapper && isValidElement(children)) {\n const props: Record<string, unknown> = {\n className: triggerClasses,\n ...htmlAttributes,\n ...childrenProps,\n ref: mergedRefs,\n };\n return cloneElement(children, context.getReferenceProps(props));\n }\n\n return (\n <button\n className={triggerClasses}\n style={style}\n ref={mergedRefs}\n {...context.getReferenceProps(htmlAttributes)}\n {...restProps}\n >\n {children}\n </button>\n );\n};\n\ntype TooltipContentProps = {\n /** Content displayed inside the tooltip */\n children: React.ReactNode;\n};\n\nconst TooltipContent = ({\n children,\n style,\n htmlAttributes,\n className,\n ref,\n ...restProps\n}: CommonProps<'div', TooltipContentProps>) => {\n const context = useTooltipContext();\n const mergedRef = useMergeRefs([context.refs.setFloating, ref]);\n const { themeClassName } = useNeedleTheme();\n if (!context.isOpen) {\n return null;\n }\n\n const classes = classNames('ndl-tooltip-content', themeClassName, className, {\n 'ndl-tooltip-content-rich': context.type === 'rich',\n 'ndl-tooltip-content-simple': context.type === 'simple',\n });\n\n if (context.type === 'simple') {\n return (\n <ConditionalWrap\n shouldWrap={context.isPortaled}\n wrap={(wrapChildren) => <FloatingPortal>{wrapChildren}</FloatingPortal>}\n >\n <div\n ref={mergedRef}\n className={classes}\n style={{\n ...context.floatingStyles,\n ...style,\n }}\n {...restProps}\n {...context.getFloatingProps(htmlAttributes)}\n >\n <Typography variant=\"body-medium\">{children}</Typography>\n </div>\n </ConditionalWrap>\n );\n }\n\n return (\n <ConditionalWrap\n shouldWrap={context.isPortaled}\n wrap={(wrapChildren) => <FloatingPortal>{wrapChildren}</FloatingPortal>}\n >\n <FloatingFocusManager\n context={context.context}\n returnFocus={true}\n modal={false}\n initialFocus={-1}\n closeOnFocusOut\n >\n <div\n ref={mergedRef}\n className={classes}\n style={{\n ...context.floatingStyles,\n ...style,\n }}\n {...restProps}\n {...context.getFloatingProps(htmlAttributes)}\n >\n {children}\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n );\n};\n\ntype TooltipHeaderProps = {\n /** Content displayed inside the header */\n children: React.ReactNode;\n /** @deprecated Use `typographyVariant` instead */\n passThroughProps?: Partial<React.ComponentPropsWithoutRef<typeof Typography>>;\n typographyVariant?: TypographyVariants;\n};\n\nconst TooltipHeader = ({\n children,\n passThroughProps,\n typographyVariant = 'subheading-medium',\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'span', TooltipHeaderProps>) => {\n const context = useTooltipContext();\n\n const classes = classNames('ndl-tooltip-header', className);\n\n if (!context.isOpen) {\n return null;\n }\n\n return (\n <Typography\n ref={ref}\n variant={typographyVariant}\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...passThroughProps}\n {...restProps}\n >\n {children}\n </Typography>\n );\n};\n\nexport type TooltipBodyProps = {\n /** Content displayed inside the body */\n children: React.ReactNode;\n /** Additional props to pass to the Typography component */\n // TODO v5: Deprecate passThroughProps and use restProps instead\n passThroughProps?: Partial<React.ComponentPropsWithoutRef<typeof Typography>>;\n};\n\nconst TooltipBody = ({\n children,\n className,\n style,\n htmlAttributes,\n passThroughProps,\n ref,\n ...restProps\n}: CommonProps<'span', TooltipBodyProps>) => {\n const context = useTooltipContext();\n\n const classes = classNames('ndl-tooltip-body', className);\n if (!context.isOpen) {\n return null;\n }\n\n return (\n <Typography\n ref={ref}\n variant=\"body-medium\"\n className={classes}\n style={style}\n htmlAttributes={htmlAttributes}\n {...passThroughProps}\n {...restProps}\n >\n {children}\n </Typography>\n );\n};\n\ntype ToolTipActionsProps = {\n /** Content displayed inside the actions container */\n children: React.ReactNode;\n};\n\nconst Actions = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ToolTipActionsProps>) => {\n const context = useTooltipContext();\n const mergedRefs = useMergeRefs([context.refs.setFloating, ref]);\n\n if (!context.isOpen) {\n return null;\n }\n\n const classes = classNames('ndl-tooltip-actions', className);\n\n return (\n <div\n className={classes}\n ref={mergedRefs}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nconst Tooltip = Object.assign(TooltipComponent, {\n Actions: Actions,\n Body: TooltipBody,\n Content: TooltipContent,\n Header: TooltipHeader,\n Trigger: TooltipTrigger,\n});\n\nexport { Tooltip };\n"]}
|
|
@@ -24,7 +24,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
24
24
|
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
26
|
const Component = () => {
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Tooltip, { type: "simple", hoverDelay: {
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Tooltip, { type: "simple", hoverDelay: { close: 200, open: 200 }, children: [(0, jsx_runtime_1.jsx)(react_1.Tooltip.Trigger, { children: "Hover me!" }), (0, jsx_runtime_1.jsx)(react_1.Tooltip.Content, { children: "This is a tooltip!" })] }));
|
|
28
28
|
};
|
|
29
29
|
exports.default = Component;
|
|
30
30
|
//# sourceMappingURL=tooltip-hover-delay.story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-hover-delay.story.js","sourceRoot":"","sources":["../../../../src/tooltip/stories/tooltip-hover-delay.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA2C;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,wBAAC,eAAO,IAAC,IAAI,EAAC,QAAQ,EAAC,UAAU,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"tooltip-hover-delay.story.js","sourceRoot":"","sources":["../../../../src/tooltip/stories/tooltip-hover-delay.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA2C;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,wBAAC,eAAO,IAAC,IAAI,EAAC,QAAQ,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,aAC1D,uBAAC,eAAO,CAAC,OAAO,4BAA4B,EAC5C,uBAAC,eAAO,CAAC,OAAO,qCAAqC,IAC7C,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Tooltip } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <Tooltip type=\"simple\" hoverDelay={{ close: 200, open: 200 }}>\n <Tooltip.Trigger>Hover me!</Tooltip.Trigger>\n <Tooltip.Content>This is a tooltip!</Tooltip.Content>\n </Tooltip>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -25,14 +25,14 @@ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
|
25
25
|
const react_1 = require("@neo4j-ndl/react");
|
|
26
26
|
const Component = () => {
|
|
27
27
|
const placements = [
|
|
28
|
-
{
|
|
29
|
-
{
|
|
30
|
-
{
|
|
31
|
-
{
|
|
32
|
-
{
|
|
33
|
-
{
|
|
34
|
-
{
|
|
35
|
-
{
|
|
28
|
+
{ label: 'Top', placement: 'top' },
|
|
29
|
+
{ label: 'Bottom', placement: 'bottom' },
|
|
30
|
+
{ label: 'Left', placement: 'left' },
|
|
31
|
+
{ label: 'Right', placement: 'right' },
|
|
32
|
+
{ label: 'Top Start', placement: 'top-start' },
|
|
33
|
+
{ label: 'Top End', placement: 'top-end' },
|
|
34
|
+
{ label: 'Bottom Start', placement: 'bottom-start' },
|
|
35
|
+
{ label: 'Bottom End', placement: 'bottom-end' },
|
|
36
36
|
];
|
|
37
37
|
return ((0, jsx_runtime_1.jsx)("div", { className: "n-grid n-grid-cols-4 n-gap-token-16 n-p-token-16 n-place-items-center", children: placements.map(({ placement, label }) => ((0, jsx_runtime_1.jsxs)(react_1.Tooltip, { type: "simple", placement: placement, children: [(0, jsx_runtime_1.jsx)(react_1.Tooltip.Trigger, { hasButtonWrapper: true, children: (0, jsx_runtime_1.jsx)(react_1.FilledButton, { size: "small", children: label }) }), (0, jsx_runtime_1.jsxs)(react_1.Tooltip.Content, { children: ["Tooltip on ", label.toLowerCase()] })] }, placement))) }));
|
|
38
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip-placements.story.js","sourceRoot":"","sources":["../../../../src/tooltip/stories/tooltip-placements.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAyD;AAEzD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,UAAU,GAAG;QACjB,EAAE,
|
|
1
|
+
{"version":3,"file":"tooltip-placements.story.js","sourceRoot":"","sources":["../../../../src/tooltip/stories/tooltip-placements.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAyD;AAEzD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,UAAU,GAAG;QACjB,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAc,EAAE;QAC3C,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAiB,EAAE;QACjD,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAe,EAAE;QAC7C,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,OAAgB,EAAE;QAC/C,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAoB,EAAE;QACvD,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAkB,EAAE;QACnD,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,cAAuB,EAAE;QAC7D,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,YAAqB,EAAE;KAC1D,CAAC;IAEF,OAAO,CACL,gCAAK,SAAS,EAAC,uEAAuE,YACnF,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CACxC,wBAAC,eAAO,IAAiB,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,SAAS,aACzD,uBAAC,eAAO,CAAC,OAAO,IAAC,gBAAgB,kBAC/B,uBAAC,oBAAY,IAAC,IAAI,EAAC,OAAO,YAAE,KAAK,GAAgB,GACjC,EAClB,wBAAC,eAAO,CAAC,OAAO,8BAAa,KAAK,CAAC,WAAW,EAAE,IAAmB,KAJvD,SAAS,CAKb,CACX,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { FilledButton, Tooltip } from '@neo4j-ndl/react';\n\nconst Component = () => {\n const placements = [\n { label: 'Top', placement: 'top' as const },\n { label: 'Bottom', placement: 'bottom' as const },\n { label: 'Left', placement: 'left' as const },\n { label: 'Right', placement: 'right' as const },\n { label: 'Top Start', placement: 'top-start' as const },\n { label: 'Top End', placement: 'top-end' as const },\n { label: 'Bottom Start', placement: 'bottom-start' as const },\n { label: 'Bottom End', placement: 'bottom-end' as const },\n ];\n\n return (\n <div className=\"n-grid n-grid-cols-4 n-gap-token-16 n-p-token-16 n-place-items-center\">\n {placements.map(({ placement, label }) => (\n <Tooltip key={placement} type=\"simple\" placement={placement}>\n <Tooltip.Trigger hasButtonWrapper>\n <FilledButton size=\"small\">{label}</FilledButton>\n </Tooltip.Trigger>\n <Tooltip.Content>Tooltip on {label.toLowerCase()}</Tooltip.Content>\n </Tooltip>\n ))}\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -30,160 +30,160 @@ const isChromatic_1 = __importDefault(require("chromatic/isChromatic"));
|
|
|
30
30
|
const index_1 = require("../../index");
|
|
31
31
|
const _1 = require(".");
|
|
32
32
|
const componentMeta = {
|
|
33
|
-
title: 'Components/Tooltip',
|
|
34
|
-
id: 'components-tooltip',
|
|
35
33
|
component: index_1.Tooltip,
|
|
36
|
-
tags: ['docsPage'],
|
|
37
|
-
parameters: {
|
|
38
|
-
controls: { disable: true },
|
|
39
|
-
chromatic: { delay: 1000 },
|
|
40
|
-
},
|
|
41
34
|
decorators: [
|
|
42
35
|
(Story) => ((0, jsx_runtime_1.jsx)("div", { className: "n-flex n-justify-center ", children: (0, jsx_runtime_1.jsx)(Story, {}) })),
|
|
43
36
|
],
|
|
37
|
+
id: 'components-tooltip',
|
|
38
|
+
parameters: {
|
|
39
|
+
chromatic: { delay: 1000 },
|
|
40
|
+
controls: { disable: true },
|
|
41
|
+
},
|
|
42
|
+
tags: ['docsPage'],
|
|
43
|
+
title: 'Components/Tooltip',
|
|
44
44
|
};
|
|
45
45
|
exports.default = componentMeta;
|
|
46
46
|
exports.Default = {
|
|
47
47
|
args: { isOpen: (0, isChromatic_1.default)() },
|
|
48
|
-
render: _1.TooltipDefault,
|
|
49
48
|
parameters: {
|
|
50
49
|
docs: {
|
|
51
50
|
source: {
|
|
51
|
+
code: _1.TooltipDefaultSource,
|
|
52
52
|
language: 'tsx',
|
|
53
53
|
type: 'code',
|
|
54
|
-
code: _1.TooltipDefaultSource,
|
|
55
54
|
},
|
|
56
55
|
},
|
|
57
56
|
},
|
|
57
|
+
render: _1.TooltipDefault,
|
|
58
58
|
};
|
|
59
59
|
exports.Disabled = {
|
|
60
60
|
args: {},
|
|
61
|
-
render: _1.TooltipDisabled,
|
|
62
61
|
parameters: {
|
|
63
62
|
docs: {
|
|
64
63
|
source: {
|
|
64
|
+
code: _1.TooltipDisabledSource,
|
|
65
65
|
language: 'tsx',
|
|
66
66
|
type: 'code',
|
|
67
|
-
code: _1.TooltipDisabledSource,
|
|
68
67
|
},
|
|
69
68
|
},
|
|
70
69
|
},
|
|
70
|
+
render: _1.TooltipDisabled,
|
|
71
71
|
};
|
|
72
72
|
exports.InitialOpen = {
|
|
73
73
|
args: {},
|
|
74
|
-
render: _1.TooltipInitialOpen,
|
|
75
74
|
parameters: {
|
|
76
75
|
docs: {
|
|
77
76
|
source: {
|
|
77
|
+
code: _1.TooltipInitialOpenSource,
|
|
78
78
|
language: 'tsx',
|
|
79
79
|
type: 'code',
|
|
80
|
-
code: _1.TooltipInitialOpenSource,
|
|
81
80
|
},
|
|
82
81
|
},
|
|
83
82
|
},
|
|
83
|
+
render: _1.TooltipInitialOpen,
|
|
84
84
|
};
|
|
85
85
|
exports.HoverDelay = {
|
|
86
86
|
args: {},
|
|
87
|
-
render: _1.TooltipHoverDelay,
|
|
88
87
|
parameters: {
|
|
89
88
|
docs: {
|
|
90
89
|
source: {
|
|
90
|
+
code: _1.TooltipHoverDelaySource,
|
|
91
91
|
language: 'tsx',
|
|
92
92
|
type: 'code',
|
|
93
|
-
code: _1.TooltipHoverDelaySource,
|
|
94
93
|
},
|
|
95
94
|
},
|
|
96
95
|
},
|
|
96
|
+
render: _1.TooltipHoverDelay,
|
|
97
97
|
};
|
|
98
98
|
exports.TriggerButtonWrapper = {
|
|
99
99
|
args: {},
|
|
100
|
-
render: _1.TooltipTriggerButtonWrapper,
|
|
101
100
|
parameters: {
|
|
102
101
|
docs: {
|
|
103
102
|
source: {
|
|
103
|
+
code: _1.TooltipTriggerButtonWrapperSource,
|
|
104
104
|
language: 'tsx',
|
|
105
105
|
type: 'code',
|
|
106
|
-
code: _1.TooltipTriggerButtonWrapperSource,
|
|
107
106
|
},
|
|
108
107
|
},
|
|
109
108
|
},
|
|
109
|
+
render: _1.TooltipTriggerButtonWrapper,
|
|
110
110
|
};
|
|
111
111
|
exports.Controlled = {
|
|
112
112
|
args: { isOpen: (0, isChromatic_1.default)() },
|
|
113
|
-
render: _1.TooltipControlled,
|
|
114
113
|
parameters: {
|
|
115
114
|
docs: {
|
|
116
115
|
source: {
|
|
116
|
+
code: _1.TooltipControlledSource,
|
|
117
117
|
language: 'tsx',
|
|
118
118
|
type: 'code',
|
|
119
|
-
code: _1.TooltipControlledSource,
|
|
120
119
|
},
|
|
121
120
|
},
|
|
122
121
|
},
|
|
122
|
+
render: _1.TooltipControlled,
|
|
123
123
|
};
|
|
124
124
|
exports.Placements = {
|
|
125
125
|
args: {},
|
|
126
|
-
render: _1.TooltipPlacements,
|
|
127
126
|
parameters: {
|
|
128
127
|
docs: {
|
|
129
128
|
source: {
|
|
129
|
+
code: _1.TooltipPlacementsSource,
|
|
130
130
|
language: 'tsx',
|
|
131
131
|
type: 'code',
|
|
132
|
-
code: _1.TooltipPlacementsSource,
|
|
133
132
|
},
|
|
134
133
|
},
|
|
135
134
|
},
|
|
135
|
+
render: _1.TooltipPlacements,
|
|
136
136
|
};
|
|
137
137
|
exports.InDialog = {
|
|
138
138
|
args: { isOpen: (0, isChromatic_1.default)() },
|
|
139
|
-
render: _1.TooltipInDialog,
|
|
140
139
|
parameters: {
|
|
141
140
|
docs: {
|
|
142
141
|
source: {
|
|
142
|
+
code: _1.TooltipInDialogSource,
|
|
143
143
|
language: 'tsx',
|
|
144
144
|
type: 'code',
|
|
145
|
-
code: _1.TooltipInDialogSource,
|
|
146
145
|
},
|
|
147
146
|
},
|
|
148
147
|
},
|
|
148
|
+
render: _1.TooltipInDialog,
|
|
149
149
|
};
|
|
150
150
|
exports.Rich = {
|
|
151
151
|
args: {},
|
|
152
|
-
render: _1.TooltipRich,
|
|
153
152
|
parameters: {
|
|
154
153
|
docs: {
|
|
155
154
|
source: {
|
|
155
|
+
code: _1.TooltipRichSource,
|
|
156
156
|
language: 'tsx',
|
|
157
157
|
type: 'code',
|
|
158
|
-
code: _1.TooltipRichSource,
|
|
159
158
|
},
|
|
160
159
|
},
|
|
161
160
|
},
|
|
161
|
+
render: _1.TooltipRich,
|
|
162
162
|
};
|
|
163
163
|
exports.RichWithLink = {
|
|
164
164
|
args: {},
|
|
165
|
-
render: _1.TooltipRichLink,
|
|
166
165
|
parameters: {
|
|
167
166
|
docs: {
|
|
168
167
|
source: {
|
|
168
|
+
code: _1.TooltipRichLinkSource,
|
|
169
169
|
language: 'tsx',
|
|
170
170
|
type: 'code',
|
|
171
|
-
code: _1.TooltipRichLinkSource,
|
|
172
171
|
},
|
|
173
172
|
},
|
|
174
173
|
},
|
|
174
|
+
render: _1.TooltipRichLink,
|
|
175
175
|
};
|
|
176
176
|
exports.WithKeyboardShortcut = {
|
|
177
177
|
args: {},
|
|
178
|
-
render: _1.TooltipWithKeyboardShortcut,
|
|
179
178
|
parameters: {
|
|
180
179
|
docs: {
|
|
181
180
|
source: {
|
|
181
|
+
code: _1.TooltipWithKeyboardShortcutSource,
|
|
182
182
|
language: 'tsx',
|
|
183
183
|
type: 'code',
|
|
184
|
-
code: _1.TooltipWithKeyboardShortcutSource,
|
|
185
184
|
},
|
|
186
185
|
},
|
|
187
186
|
},
|
|
187
|
+
render: _1.TooltipWithKeyboardShortcut,
|
|
188
188
|
};
|
|
189
189
|
//# sourceMappingURL=tooltip.stories.js.map
|