@economic/taco 2.47.0-server.4 → 2.47.0-server.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Icon/components/Autopay.d.ts +3 -0
- package/dist/components/Icon/components/AutopayPaused.d.ts +3 -0
- package/dist/components/Icon/components/Person.d.ts +3 -0
- package/dist/components/Icon/components/PersonSolid.d.ts +3 -0
- package/dist/components/Icon/components/Wallet.d.ts +3 -0
- package/dist/components/Icon/components/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Menu/components/Item.d.ts +1 -1
- package/dist/components/Menu/components/Link.d.ts +1 -1
- package/dist/components/Navigation2/components/Link.d.ts +1 -1
- package/dist/components/Select2/components/Option.d.ts +2 -2
- package/dist/components/Select2/components/Search.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +1 -1
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +32 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -0
- package/dist/esm/packages/taco/src/charts/components/Area/AreaChart.js +32 -24
- package/dist/esm/packages/taco/src/charts/components/Area/AreaChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Bar/BarChart.js +84 -61
- package/dist/esm/packages/taco/src/charts/components/Bar/BarChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/ActiveShape.js +16 -15
- package/dist/esm/packages/taco/src/charts/components/Donut/ActiveShape.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/CenteredLabel.js +12 -13
- package/dist/esm/packages/taco/src/charts/components/Donut/CenteredLabel.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/DonutChart.js +104 -68
- package/dist/esm/packages/taco/src/charts/components/Donut/DonutChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js +38 -29
- package/dist/esm/packages/taco/src/charts/components/Donut/Legend.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Donut/util.js +2 -2
- package/dist/esm/packages/taco/src/charts/components/Donut/util.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Legend.js +45 -37
- package/dist/esm/packages/taco/src/charts/components/Legend.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Line/LineChart.js +32 -24
- package/dist/esm/packages/taco/src/charts/components/Line/LineChart.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/ResponsiveContainer.js +5 -3
- package/dist/esm/packages/taco/src/charts/components/ResponsiveContainer.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/components/Tooltip.js +26 -25
- package/dist/esm/packages/taco/src/charts/components/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/utils/color.js +13 -12
- package/dist/esm/packages/taco/src/charts/utils/color.js.map +1 -1
- package/dist/esm/packages/taco/src/charts/utils/common.js +39 -26
- package/dist/esm/packages/taco/src/charts/utils/common.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js +30 -31
- package/dist/esm/packages/taco/src/components/Accordion/Accordion.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Alert/Alert.js +7 -9
- package/dist/esm/packages/taco/src/components/Alert/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js +14 -13
- package/dist/esm/packages/taco/src/components/AlertDialog/AlertDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/Context.js +2 -2
- package/dist/esm/packages/taco/src/components/AlertDialog/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js +10 -9
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js +4 -4
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js +5 -6
- package/dist/esm/packages/taco/src/components/AlertDialog/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js +2 -2
- package/dist/esm/packages/taco/src/components/Backdrop/Backdrop.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Badge/Badge.js +21 -25
- package/dist/esm/packages/taco/src/components/Badge/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js +12 -14
- package/dist/esm/packages/taco/src/components/BadgeIcon/BadgeIcon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Banner/Banner.js +7 -10
- package/dist/esm/packages/taco/src/components/Banner/Banner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Banner/util.js +3 -3
- package/dist/esm/packages/taco/src/components/Banner/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/Button.js +28 -29
- package/dist/esm/packages/taco/src/components/Button/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Button/util.js +25 -24
- package/dist/esm/packages/taco/src/components/Button/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js +75 -71
- package/dist/esm/packages/taco/src/components/Calendar/Calendar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Card/Card.js +14 -15
- package/dist/esm/packages/taco/src/components/Card/Card.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js +24 -22
- package/dist/esm/packages/taco/src/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js +21 -23
- package/dist/esm/packages/taco/src/components/Combobox/Combobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js +76 -64
- package/dist/esm/packages/taco/src/components/Combobox/useCombobox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js +60 -57
- package/dist/esm/packages/taco/src/components/Datepicker/Datepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js +27 -28
- package/dist/esm/packages/taco/src/components/Datepicker/useDatepicker.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/Context.js +4 -4
- package/dist/esm/packages/taco/src/components/Dialog/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js +54 -39
- package/dist/esm/packages/taco/src/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js +36 -38
- package/dist/esm/packages/taco/src/components/Dialog/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js +3 -3
- package/dist/esm/packages/taco/src/components/Dialog/components/DialogDrawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js +2 -2
- package/dist/esm/packages/taco/src/components/Dialog/components/Extra.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js +5 -6
- package/dist/esm/packages/taco/src/components/Dialog/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Dialog/util.js +7 -3
- package/dist/esm/packages/taco/src/components/Dialog/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Context.js +5 -5
- package/dist/esm/packages/taco/src/components/Drawer/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js +61 -51
- package/dist/esm/packages/taco/src/components/Drawer/Drawer.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js +134 -145
- package/dist/esm/packages/taco/src/components/Drawer/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Drawer/util.js +5 -5
- package/dist/esm/packages/taco/src/components/Drawer/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Field/Field.js +14 -12
- package/dist/esm/packages/taco/src/components/Field/Field.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Form/Form.js +7 -6
- package/dist/esm/packages/taco/src/components/Form/Form.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Group/Group.js +9 -7
- package/dist/esm/packages/taco/src/components/Group/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js +37 -36
- package/dist/esm/packages/taco/src/components/Hanger/Hanger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/Header.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js +14 -10
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Avatar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js +5 -4
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Badge.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js +7 -9
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Display.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js +9 -9
- package/dist/esm/packages/taco/src/components/Header/components/Agreement/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js +66 -46
- package/dist/esm/packages/taco/src/components/Header/components/AgreementSelector.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Button.js +12 -8
- package/dist/esm/packages/taco/src/components/Header/components/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Link.js +22 -18
- package/dist/esm/packages/taco/src/components/Header/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/Logo.js +4 -4
- package/dist/esm/packages/taco/src/components/Header/components/Logo.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/MenuButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js +10 -9
- package/dist/esm/packages/taco/src/components/Header/components/PrimaryNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js +2 -2
- package/dist/esm/packages/taco/src/components/Header/components/SecondaryNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js +5 -7
- package/dist/esm/packages/taco/src/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js +1 -1
- package/dist/esm/packages/taco/src/components/HoverCard/Primitives.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/Icon.js +7 -7
- package/dist/esm/packages/taco/src/components/Icon/Icon.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Icon/components/Autopay.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Autopay.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/AutopayPaused.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/AutopayPaused.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Person.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Person.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/PersonSolid.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/PersonSolid.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Wallet.js +19 -0
- package/dist/esm/packages/taco/src/components/Icon/components/Wallet.js.map +1 -0
- package/dist/esm/packages/taco/src/components/Icon/components/index.js +14 -4
- package/dist/esm/packages/taco/src/components/Icon/components/index.js.map +1 -1
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js +22 -23
- package/dist/esm/packages/taco/src/components/IconButton/IconButton.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/Input.js +45 -44
- package/dist/esm/packages/taco/src/components/Input/Input.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Input/util.js +8 -5
- package/dist/esm/packages/taco/src/components/Input/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/Layout.js +7 -5
- package/dist/esm/packages/taco/src/components/Layout/Layout.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Content.js +2 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Page.js +2 -2
- package/dist/esm/packages/taco/src/components/Layout/components/Page.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js +34 -27
- package/dist/esm/packages/taco/src/components/Layout/components/Sidebar.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Layout/components/Top.js +9 -6
- package/dist/esm/packages/taco/src/components/Layout/components/Top.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Button.js +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Collapsible.js +10 -7
- package/dist/esm/packages/taco/src/components/List/components/Collapsible.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Group.js +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Item.js +15 -13
- package/dist/esm/packages/taco/src/components/List/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Link.js +3 -3
- package/dist/esm/packages/taco/src/components/List/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js +29 -27
- package/dist/esm/packages/taco/src/components/List/components/Toggle.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/Listbox.js +21 -26
- package/dist/esm/packages/taco/src/components/Listbox/Listbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js +82 -70
- package/dist/esm/packages/taco/src/components/Listbox/ScrollableList.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useListbox.js +56 -51
- package/dist/esm/packages/taco/src/components/Listbox/useListbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js +83 -65
- package/dist/esm/packages/taco/src/components/Listbox/useMultiListbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/useTypeahead.js +9 -10
- package/dist/esm/packages/taco/src/components/Listbox/useTypeahead.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Listbox/util.js +78 -48
- package/dist/esm/packages/taco/src/components/Listbox/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Context.js +2 -2
- package/dist/esm/packages/taco/src/components/Menu/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/Menu.js +42 -26
- package/dist/esm/packages/taco/src/components/Menu/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js +8 -8
- package/dist/esm/packages/taco/src/components/Menu/components/Checkbox.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js +27 -21
- package/dist/esm/packages/taco/src/components/Menu/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Header.js +3 -3
- package/dist/esm/packages/taco/src/components/Menu/components/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js +32 -32
- package/dist/esm/packages/taco/src/components/Menu/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Link.js +10 -10
- package/dist/esm/packages/taco/src/components/Menu/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js +15 -16
- package/dist/esm/packages/taco/src/components/Menu/components/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Separator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js +7 -7
- package/dist/esm/packages/taco/src/components/Menu/components/SubMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js +5 -5
- package/dist/esm/packages/taco/src/components/Menu/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js +6 -6
- package/dist/esm/packages/taco/src/components/ModeSwitch/ModeSwitch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js +41 -36
- package/dist/esm/packages/taco/src/components/Navigation/Navigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js +6 -6
- package/dist/esm/packages/taco/src/components/Navigation2/Navigation2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js +6 -6
- package/dist/esm/packages/taco/src/components/Navigation2/components/Content.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js +14 -11
- package/dist/esm/packages/taco/src/components/Navigation2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js +31 -24
- package/dist/esm/packages/taco/src/components/Navigation2/components/Link.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js +7 -7
- package/dist/esm/packages/taco/src/components/Navigation2/components/Section.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js +9 -7
- package/dist/esm/packages/taco/src/components/Navigation2/components/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js +48 -51
- package/dist/esm/packages/taco/src/components/OverflowGroup/OverflowGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js +26 -23
- package/dist/esm/packages/taco/src/components/Pagination/PageNumbers.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js +53 -39
- package/dist/esm/packages/taco/src/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/usePagination.js +17 -7
- package/dist/esm/packages/taco/src/components/Pagination/usePagination.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Pagination/usePaginationShortcuts.js +8 -9
- package/dist/esm/packages/taco/src/components/Pagination/usePaginationShortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Popover.js +45 -43
- package/dist/esm/packages/taco/src/components/Popover/Popover.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Primitives.js +1 -1
- package/dist/esm/packages/taco/src/components/Popover/Primitives.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Popover/util.js +3 -1
- package/dist/esm/packages/taco/src/components/Popover/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Progress/Progress.js +13 -11
- package/dist/esm/packages/taco/src/components/Progress/Progress.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Localization.js +13 -12
- package/dist/esm/packages/taco/src/components/Provider/Localization.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Provider/Provider.js +8 -8
- package/dist/esm/packages/taco/src/components/Provider/Provider.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js +54 -47
- package/dist/esm/packages/taco/src/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/util.js +7 -1
- package/dist/esm/packages/taco/src/components/RadioGroup/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/Report.js +7 -5
- package/dist/esm/packages/taco/src/components/Report/Report.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Report/useReport.js +1 -1
- package/dist/esm/packages/taco/src/components/Report/useReport.js.map +1 -1
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js +17 -13
- package/dist/esm/packages/taco/src/components/ScrollArea/ScrollArea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js +11 -11
- package/dist/esm/packages/taco/src/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js +44 -39
- package/dist/esm/packages/taco/src/components/SearchInput2/SearchInput2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/Select.js +28 -31
- package/dist/esm/packages/taco/src/components/Select/Select.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select/useSelect.js +79 -70
- package/dist/esm/packages/taco/src/components/Select/useSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/Select2.js +154 -121
- package/dist/esm/packages/taco/src/components/Select2/Select2.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Collection.js +2 -4
- package/dist/esm/packages/taco/src/components/Select2/components/Collection.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js +45 -41
- package/dist/esm/packages/taco/src/components/Select2/components/Create.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js +145 -129
- package/dist/esm/packages/taco/src/components/Select2/components/Edit.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js +8 -8
- package/dist/esm/packages/taco/src/components/Select2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js +29 -30
- package/dist/esm/packages/taco/src/components/Select2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js +9 -10
- package/dist/esm/packages/taco/src/components/Select2/components/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Title.js +2 -2
- package/dist/esm/packages/taco/src/components/Select2/components/Title.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js +136 -128
- package/dist/esm/packages/taco/src/components/Select2/components/Trigger.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js +32 -23
- package/dist/esm/packages/taco/src/components/Select2/hooks/useChildren.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Select2/utilities.js +13 -6
- package/dist/esm/packages/taco/src/components/Select2/utilities.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js +16 -13
- package/dist/esm/packages/taco/src/components/Shortcut/Shortcut.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Spinner/Spinner.js +17 -12
- package/dist/esm/packages/taco/src/components/Spinner/Spinner.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Switch/Switch.js +14 -14
- package/dist/esm/packages/taco/src/components/Switch/Switch.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js +28 -23
- package/dist/esm/packages/taco/src/components/Table/components/BaseTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js +7 -3
- package/dist/esm/packages/taco/src/components/Table/components/PaginatedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/Table.js +22 -18
- package/dist/esm/packages/taco/src/components/Table/components/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js +100 -92
- package/dist/esm/packages/taco/src/components/Table/components/WindowedTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js +136 -118
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowDraggable.js +55 -55
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowDraggable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js +35 -41
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js +77 -71
- package/dist/esm/packages/taco/src/components/Table/hooks/plugins/useRowSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js +56 -30
- package/dist/esm/packages/taco/src/components/Table/hooks/useRowCreation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js +151 -142
- package/dist/esm/packages/taco/src/components/Table/hooks/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js +22 -20
- package/dist/esm/packages/taco/src/components/Table/hooks/useTableKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js +9 -12
- package/dist/esm/packages/taco/src/components/Table/util/renderColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js +41 -41
- package/dist/esm/packages/taco/src/components/Table/util/renderRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js +16 -14
- package/dist/esm/packages/taco/src/components/Table/util/rowIndexPath.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js +32 -26
- package/dist/esm/packages/taco/src/components/Table/util/sortTypes.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table/util.js +37 -30
- package/dist/esm/packages/taco/src/components/Table/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/Table3.js +12 -10
- package/dist/esm/packages/taco/src/components/Table3/Table3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js +13 -14
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js +21 -23
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/RowMoveIndicator.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js +20 -17
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/Editing/TextareaWithAutosizing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js +67 -73
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingControlCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js +2 -2
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/EditingDisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js +19 -20
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Cell/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js +26 -25
- package/dist/esm/packages/taco/src/components/Table3/components/Columns/Internal/EditingActionsMenu.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js +45 -40
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/Alert.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js +7 -8
- package/dist/esm/packages/taco/src/components/Table3/components/Editing/DiscardChangesConfirmationDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js +18 -19
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/CreateNewRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js +7 -10
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/SaveStatus.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js +38 -36
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Editing/TemporaryRow.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js +15 -15
- package/dist/esm/packages/taco/src/components/Table3/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js +8 -11
- package/dist/esm/packages/taco/src/components/Table3/components/Toolbar/Editing/Editing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js +164 -201
- package/dist/esm/packages/taco/src/components/Table3/features/useEditingState.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js +40 -27
- package/dist/esm/packages/taco/src/components/Table3/features/useTableEditing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js +18 -16
- package/dist/esm/packages/taco/src/components/Table3/listeners/useTableEditingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js +25 -19
- package/dist/esm/packages/taco/src/components/Table3/useTable3.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js +29 -35
- package/dist/esm/packages/taco/src/components/Table3/util/editing.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js +34 -35
- package/dist/esm/packages/taco/src/components/Tabs/Tabs.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tag/Tag.js +12 -12
- package/dist/esm/packages/taco/src/components/Tag/Tag.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js +8 -11
- package/dist/esm/packages/taco/src/components/Textarea/Textarea.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toast.js +19 -20
- package/dist/esm/packages/taco/src/components/Toast/Toast.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js +117 -96
- package/dist/esm/packages/taco/src/components/Toast/Toaster.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Toast/util.js +6 -4
- package/dist/esm/packages/taco/src/components/Toast/util.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js +10 -9
- package/dist/esm/packages/taco/src/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Tour/Tour.js +49 -46
- package/dist/esm/packages/taco/src/components/Tour/Tour.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js +33 -27
- package/dist/esm/packages/taco/src/components/Treeview/Treeview.js.map +1 -1
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js +15 -13
- package/dist/esm/packages/taco/src/components/Truncate/Truncate.js.map +1 -1
- package/dist/esm/packages/taco/src/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/packages/taco/src/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js +11 -6
- package/dist/esm/packages/taco/src/hooks/useBoundaryOverflowDetection.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js +19 -13
- package/dist/esm/packages/taco/src/hooks/useBoundingClientRectListener.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js +4 -4
- package/dist/esm/packages/taco/src/hooks/useGlobalKeyDown.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useId.js +4 -2
- package/dist/esm/packages/taco/src/hooks/useId.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js +20 -18
- package/dist/esm/packages/taco/src/hooks/useIntersectionObserver.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js +7 -5
- package/dist/esm/packages/taco/src/hooks/useIsFormControl.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js +9 -5
- package/dist/esm/packages/taco/src/hooks/useIsHoverStatePaused.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js +3 -1
- package/dist/esm/packages/taco/src/hooks/useIsLargeScreen.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useLazyEffect.js +2 -2
- package/dist/esm/packages/taco/src/hooks/useLazyEffect.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useLocalStorage.js +24 -22
- package/dist/esm/packages/taco/src/hooks/useLocalStorage.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useMatchMedia.js +13 -6
- package/dist/esm/packages/taco/src/hooks/useMatchMedia.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/useMergedRef.js +3 -3
- package/dist/esm/packages/taco/src/hooks/useMergedRef.js.map +1 -1
- package/dist/esm/packages/taco/src/hooks/usePrevious.js +2 -2
- package/dist/esm/packages/taco/src/hooks/usePrevious.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/BubbleSelect.js +14 -14
- package/dist/esm/packages/taco/src/primitives/BubbleSelect.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Button.js +16 -13
- package/dist/esm/packages/taco/src/primitives/Button.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js +50 -44
- package/dist/esm/packages/taco/src/primitives/Collection/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js +4 -2
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Context.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js +9 -5
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Group.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js +16 -18
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Option.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js +47 -40
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Root.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js +9 -10
- package/dist/esm/packages/taco/src/primitives/Listbox2/components/Title.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js +22 -20
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Container.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js +24 -27
- package/dist/esm/packages/taco/src/primitives/Sortable/components/Item.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Sortable/components/List.js +11 -10
- package/dist/esm/packages/taco/src/primitives/Sortable/components/List.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js +22 -19
- package/dist/esm/packages/taco/src/primitives/Table/Core/Table.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js +25 -22
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/Body.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/EmptyStateBody.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js +30 -14
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Body/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js +18 -19
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/DisplayCell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js +34 -34
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/BuiltIns/GroupedCell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js +10 -12
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/Cell.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js +19 -18
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Cell/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js +42 -40
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Actions.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js +5 -7
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Drag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js +19 -24
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Expansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js +56 -55
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Columns/Internal/Selection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js +27 -23
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Footer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js +13 -16
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Footer/Summary.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js +86 -87
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/Header.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js +14 -11
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Goto.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js +85 -58
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Menu.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js +18 -20
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/Resizer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/components/SortIndicator.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js +11 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Header/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js +58 -49
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/DisplayRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js +28 -32
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/BuiltIns/SkeletonRow.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js +34 -29
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/Row.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Row/RowContext.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js +11 -11
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js +23 -22
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/Filters.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js +54 -39
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/ManageFiltersPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js +39 -37
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js +20 -16
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js +16 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterComparator.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js +50 -41
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterValue.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js +13 -9
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/util.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js +57 -51
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/Print.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js +71 -67
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Print/PrintDialog.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js +40 -37
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Search/Search.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js +64 -44
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/HideOrOrderPopover.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js +62 -51
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Settings/Settings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableGlobalShortcuts.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js +13 -5
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRef.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js +93 -77
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableRenderer.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js +15 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyle.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js +31 -41
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js +31 -30
- package/dist/esm/packages/taco/src/primitives/Table/Core/features/useTableStyleGrid.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/Core/listeners/useTableRowActiveListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js +14 -15
- package/dist/esm/packages/taco/src/primitives/Table/Core/useTable.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/Core/util/rows.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js +42 -36
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js +67 -74
- package/dist/esm/packages/taco/src/primitives/Table/useTableDataLoader2.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnFreezing.js +11 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnFreezing.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableColumnOrdering.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js +15 -5
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFontSize.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableFooter.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js +26 -16
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTablePrinting.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js +9 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActions.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js +42 -23
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowActive.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js +9 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowClick.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js +9 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrag.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowDrop.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js +9 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowExpansion.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js +5 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGoto.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowGroups.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js +15 -5
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowHeight.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js +14 -9
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableRowSelection.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js +25 -13
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSearch.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js +43 -24
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableServerLoading.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js +34 -24
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/features/useTableSettings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableDataListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js +3 -3
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFilterListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js +18 -16
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableFontSizeListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowHeightListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js +6 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableRowSelectionListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js +8 -8
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSearchListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js +6 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableServerLoadingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js +8 -6
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSettingsListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js +17 -17
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableShortcutsListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js +2 -2
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/listeners/useTableSortingListener.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js +55 -55
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/useTableManager.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js +59 -30
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/columns.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js +4 -4
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/dataTypes.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js +33 -19
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/filtering.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js +11 -11
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/presets.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js +21 -19
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/search.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js +6 -7
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/settings.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js +138 -106
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/setup.js.map +1 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js +3 -1
- package/dist/esm/packages/taco/src/primitives/Table/useTableManager/util/sorting.js.map +1 -1
- package/dist/esm/packages/taco/src/types.js +1 -1
- package/dist/esm/packages/taco/src/types.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/aria.js +2 -2
- package/dist/esm/packages/taco/src/utils/aria.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/date.js +47 -23
- package/dist/esm/packages/taco/src/utils/date.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/debounce.js +10 -4
- package/dist/esm/packages/taco/src/utils/debounce.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/device.js +4 -2
- package/dist/esm/packages/taco/src/utils/device.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/dom.js +26 -20
- package/dist/esm/packages/taco/src/utils/dom.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js +40 -38
- package/dist/esm/packages/taco/src/utils/hooks/useDraggable.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js +9 -7
- package/dist/esm/packages/taco/src/utils/hooks/useDropTarget.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js +20 -9
- package/dist/esm/packages/taco/src/utils/hooks/useListKeyboardNavigation.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js +9 -9
- package/dist/esm/packages/taco/src/utils/hooks/useListScrollTo.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js +8 -6
- package/dist/esm/packages/taco/src/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTimer.js +16 -11
- package/dist/esm/packages/taco/src/utils/hooks/useTimer.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js +11 -6
- package/dist/esm/packages/taco/src/utils/hooks/useTruncated.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/input.js +10 -7
- package/dist/esm/packages/taco/src/utils/input.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/keyboard.js +8 -5
- package/dist/esm/packages/taco/src/utils/keyboard.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/mergeRefs.js +2 -2
- package/dist/esm/packages/taco/src/utils/mergeRefs.js.map +1 -1
- package/dist/esm/packages/taco/src/utils/tailwind.js +5 -5
- package/dist/esm/packages/taco/src/utils/tailwind.js.map +1 -1
- package/dist/esm/packages/taco/tailwind.colors.js +1 -1
- package/dist/esm/packages/taco/tailwind.colors.js.map +1 -1
- package/dist/taco.cjs.development.js +7857 -6877
- package/dist/taco.cjs.development.js.map +1 -1
- package/dist/taco.cjs.production.min.js +1 -1
- package/dist/taco.cjs.production.min.js.map +1 -1
- package/package.json +1 -1
@@ -1,43 +1,56 @@
|
|
1
1
|
import { useState, useCallback, useEffect, createElement, useContext, createContext } from 'react';
|
2
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose, extends as _extends } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
3
|
import { v4 } from 'uuid';
|
3
4
|
import { AnimatePresence, motion } from 'framer-motion';
|
4
5
|
import { Portal } from '@radix-ui/react-portal';
|
5
6
|
import { Toast } from './Toast.js';
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
var _excluded = ["children"];
|
9
|
+
var DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;
|
10
|
+
var ToastContext = /*#__PURE__*/createContext({});
|
11
|
+
var insertToastWithoutDuplicates = function insertToastWithoutDuplicates(currentToasts, id, content, options, close) {
|
12
|
+
var nextToasts = [].concat(currentToasts);
|
13
|
+
var existingToastIndex = currentToasts.findIndex(function (toast) {
|
14
|
+
return JSON.stringify(toast.content) === JSON.stringify(content);
|
15
|
+
});
|
12
16
|
if (existingToastIndex > -1) {
|
13
17
|
nextToasts[existingToastIndex].lastDuplicateId = id;
|
14
18
|
nextToasts[existingToastIndex].lastUpdated = Date.now();
|
15
19
|
} else {
|
16
20
|
nextToasts.push({
|
17
|
-
id,
|
21
|
+
id: id,
|
18
22
|
content: typeof content === 'function' ? content(close) : content,
|
19
|
-
options
|
23
|
+
options: options
|
20
24
|
});
|
21
25
|
}
|
22
26
|
return nextToasts;
|
23
27
|
};
|
24
|
-
|
25
|
-
children,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
var ToastProvider = function ToastProvider(_ref) {
|
29
|
+
var children = _ref.children,
|
30
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
31
|
+
var _React$useState = useState([]),
|
32
|
+
toasts = _React$useState[0],
|
33
|
+
setToasts = _React$useState[1];
|
34
|
+
var handleClose = function handleClose(id) {
|
35
|
+
setToasts(function (currentToasts) {
|
36
|
+
return currentToasts.filter(function (toast) {
|
37
|
+
return toast.id !== id;
|
38
|
+
});
|
39
|
+
});
|
31
40
|
};
|
32
41
|
// memoize (useCallback) this function,
|
33
42
|
// it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
43
|
+
var toaster = useCallback(function (content, options) {
|
44
|
+
var id = v4();
|
45
|
+
var close = function close() {
|
46
|
+
return handleClose(id);
|
47
|
+
};
|
48
|
+
setToasts(function (currentToasts) {
|
49
|
+
return insertToastWithoutDuplicates(currentToasts, id, content, options, close);
|
50
|
+
});
|
51
|
+
var update = function update(content, options) {
|
52
|
+
setToasts(function (currentToasts) {
|
53
|
+
var nextToasts = currentToasts.filter(function (toast) {
|
41
54
|
if (toast.lastDuplicateId) {
|
42
55
|
return toast.lastDuplicateId !== id;
|
43
56
|
}
|
@@ -46,69 +59,71 @@ const ToastProvider = ({
|
|
46
59
|
return insertToastWithoutDuplicates(nextToasts, v4(), content, options, close);
|
47
60
|
});
|
48
61
|
};
|
49
|
-
|
50
|
-
update(content, {
|
51
|
-
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
52
|
-
|
62
|
+
var success = function success(content, options) {
|
63
|
+
update(content, _extends({
|
64
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
65
|
+
}, options, {
|
53
66
|
type: 'success'
|
54
|
-
});
|
67
|
+
}));
|
55
68
|
};
|
56
|
-
|
57
|
-
update(content, {
|
58
|
-
...options,
|
69
|
+
var error = function error(content, options) {
|
70
|
+
update(content, _extends({}, options, {
|
59
71
|
type: 'error'
|
60
|
-
});
|
72
|
+
}));
|
61
73
|
};
|
62
|
-
|
63
|
-
update(content, {
|
64
|
-
...options,
|
74
|
+
var warning = function warning(content, options) {
|
75
|
+
update(content, _extends({}, options, {
|
65
76
|
type: 'warning'
|
66
|
-
});
|
77
|
+
}));
|
67
78
|
};
|
68
|
-
|
69
|
-
update(content, {
|
70
|
-
...options,
|
79
|
+
var information = function information(content, options) {
|
80
|
+
update(content, _extends({}, options, {
|
71
81
|
type: 'information'
|
72
|
-
});
|
82
|
+
}));
|
73
83
|
};
|
74
|
-
|
75
|
-
update(content, {
|
76
|
-
...options,
|
84
|
+
var loading = function loading(content, options) {
|
85
|
+
update(content, _extends({}, options, {
|
77
86
|
type: 'loading'
|
78
|
-
});
|
87
|
+
}));
|
79
88
|
};
|
80
89
|
return {
|
81
|
-
success,
|
82
|
-
error,
|
83
|
-
warning,
|
84
|
-
information,
|
85
|
-
loading,
|
86
|
-
close
|
90
|
+
success: success,
|
91
|
+
error: error,
|
92
|
+
warning: warning,
|
93
|
+
information: information,
|
94
|
+
loading: loading,
|
95
|
+
close: close
|
87
96
|
};
|
88
97
|
}, []);
|
89
98
|
// no need to rebind these every render, do them once in an effect
|
90
|
-
useEffect(()
|
91
|
-
toaster.success = (content, options)
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
}
|
108
|
-
toaster.
|
109
|
-
|
110
|
-
|
111
|
-
|
99
|
+
useEffect(function () {
|
100
|
+
toaster.success = function (content, options) {
|
101
|
+
return toaster(content, _extends({
|
102
|
+
autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT
|
103
|
+
}, options, {
|
104
|
+
type: 'success'
|
105
|
+
}));
|
106
|
+
};
|
107
|
+
toaster.error = function (content, options) {
|
108
|
+
return toaster(content, _extends({}, options, {
|
109
|
+
type: 'error'
|
110
|
+
}));
|
111
|
+
};
|
112
|
+
toaster.warning = function (content, options) {
|
113
|
+
return toaster(content, _extends({}, options, {
|
114
|
+
type: 'warning'
|
115
|
+
}));
|
116
|
+
};
|
117
|
+
toaster.information = function (content, options) {
|
118
|
+
return toaster(content, _extends({}, options, {
|
119
|
+
type: 'information'
|
120
|
+
}));
|
121
|
+
};
|
122
|
+
toaster.loading = function (content, options) {
|
123
|
+
return toaster(content, _extends({}, options, {
|
124
|
+
type: 'loading'
|
125
|
+
}));
|
126
|
+
};
|
112
127
|
}, []);
|
113
128
|
return /*#__PURE__*/createElement(ToastContext.Provider, Object.assign({}, props, {
|
114
129
|
value: toaster
|
@@ -118,35 +133,41 @@ const ToastProvider = ({
|
|
118
133
|
role: "log"
|
119
134
|
}, /*#__PURE__*/createElement(AnimatePresence, {
|
120
135
|
initial: false
|
121
|
-
}, toasts.map(
|
122
|
-
|
123
|
-
|
124
|
-
type: 'spring',
|
125
|
-
damping: 20,
|
126
|
-
stiffness: 300
|
127
|
-
},
|
128
|
-
initial: {
|
129
|
-
opacity: 0,
|
130
|
-
y: 10,
|
131
|
-
scale: 0.5
|
132
|
-
},
|
133
|
-
animate: {
|
134
|
-
opacity: 1,
|
135
|
-
y: 0,
|
136
|
-
scale: 1
|
137
|
-
},
|
138
|
-
exit: {
|
139
|
-
opacity: 0,
|
140
|
-
scale: 0.5,
|
136
|
+
}, toasts.map(function (toast) {
|
137
|
+
return /*#__PURE__*/createElement(motion.div, {
|
138
|
+
key: toast.id,
|
141
139
|
transition: {
|
142
|
-
|
140
|
+
type: 'spring',
|
141
|
+
damping: 20,
|
142
|
+
stiffness: 300
|
143
|
+
},
|
144
|
+
initial: {
|
145
|
+
opacity: 0,
|
146
|
+
y: 10,
|
147
|
+
scale: 0.5
|
148
|
+
},
|
149
|
+
animate: {
|
150
|
+
opacity: 1,
|
151
|
+
y: 0,
|
152
|
+
scale: 1
|
153
|
+
},
|
154
|
+
exit: {
|
155
|
+
opacity: 0,
|
156
|
+
scale: 0.5,
|
157
|
+
transition: {
|
158
|
+
duration: 0.2
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}, /*#__PURE__*/createElement(Toast, Object.assign({}, toast, {
|
162
|
+
onClose: function onClose() {
|
163
|
+
return handleClose(toast.id);
|
143
164
|
}
|
144
|
-
}
|
145
|
-
}
|
146
|
-
|
147
|
-
|
165
|
+
})));
|
166
|
+
})))));
|
167
|
+
};
|
168
|
+
var useToast = function useToast() {
|
169
|
+
return useContext(ToastContext);
|
148
170
|
};
|
149
|
-
const useToast = () => useContext(ToastContext);
|
150
171
|
|
151
172
|
export { ToastProvider, useToast };
|
152
173
|
//# sourceMappingURL=Toaster.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Toaster.js","sources":["../../../../../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["import * as React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport { Portal } from '@radix-ui/react-portal';\n\nimport { ToastOptions, Toast, ToastProps, ToastContent } from './Toast';\nimport './Toast.css';\n\nconst DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;\n\ntype ToastCreator<T> = (content: ToastContent | ((close: () => void) => ToastContent), options?: ToastOptions) => T;\n\nexport interface Toaster<T> extends ToastCreator<T> {\n success: ToastCreator<T>;\n error: ToastCreator<T>;\n warning: ToastCreator<T>;\n information: ToastCreator<T>;\n loading: ToastCreator<T>;\n}\n\nexport interface ToastReference {\n /** Show a success toast */\n success: ToastCreator<void>;\n /** Show an error toast */\n error: ToastCreator<void>;\n /** Show a warning toast */\n warning: ToastCreator<void>;\n /** Show an information toast */\n information: ToastCreator<void>;\n /** Show a loading toast */\n loading: ToastCreator<void>;\n /**\n * Close an existing toast.\n * The toast function returns a reference to the active toast,\n * allowing you to programmatically close it when needed\n */\n close: () => void;\n}\n\nconst ToastContext = React.createContext<Toaster<ToastReference>>({} as Toaster<ToastReference>);\n\nexport interface ToastProviderProps {\n children: React.ReactNode;\n}\n\ntype InternalToast = Omit<ToastProps, 'onClose'>;\n\nconst insertToastWithoutDuplicates = (\n currentToasts: InternalToast[],\n id: string,\n content: ToastContent,\n options: ToastOptions,\n close: () => void\n): InternalToast[] => {\n const nextToasts = [...currentToasts];\n const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));\n\n if (existingToastIndex > -1) {\n nextToasts[existingToastIndex].lastDuplicateId = id;\n nextToasts[existingToastIndex].lastUpdated = Date.now();\n } else {\n nextToasts.push({\n id,\n content: typeof content === 'function' ? content(close) : content,\n options,\n });\n }\n\n return nextToasts;\n};\n\nexport const ToastProvider = ({ children, ...props }: ToastProviderProps): JSX.Element => {\n const [toasts, setToasts] = React.useState<InternalToast[]>([]);\n\n const handleClose = (id: string): void => {\n setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));\n };\n\n // memoize (useCallback) this function,\n // it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children\n const toaster = React.useCallback((content: ToastContent, options: ToastOptions): ToastReference => {\n const id = uuid();\n const close = (): void => handleClose(id);\n\n setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));\n\n const update = (content: ToastContent, options: ToastOptions): void => {\n setToasts(currentToasts => {\n const nextToasts = currentToasts.filter(toast => {\n if (toast.lastDuplicateId) {\n return toast.lastDuplicateId !== id;\n }\n\n return toast.id !== id;\n });\n return insertToastWithoutDuplicates(nextToasts, uuid(), content, options, close);\n });\n };\n\n const success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n };\n const error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'error' });\n };\n const warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'warning' });\n };\n const information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'information' });\n };\n const loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'loading' });\n };\n\n return {\n success,\n error,\n warning,\n information,\n loading,\n close,\n };\n }, []) as Toaster<ToastReference>;\n\n // no need to rebind these every render, do them once in an effect\n React.useEffect(() => {\n toaster.success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n toaster.error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'error' });\n toaster.warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'warning' });\n toaster.information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'information' });\n toaster.loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'loading' });\n }, []);\n\n return (\n <ToastContext.Provider {...props} value={toaster}>\n {children}\n <Portal>\n <div\n id=\"yt-toast__container\"\n className=\"pointer-events-all absolute !left-auto bottom-0 right-0 z-[1000] mb-4 mr-4 flex max-w-md flex-col items-end justify-end\"\n role=\"log\">\n <AnimatePresence initial={false}>\n {toasts.map((toast: InternalToast) => (\n <motion.div\n key={toast.id}\n transition={{\n type: 'spring',\n damping: 20,\n stiffness: 300,\n }}\n initial={{ opacity: 0, y: 10, scale: 0.5 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }}>\n <Toast {...toast} onClose={() => handleClose(toast.id)} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </Portal>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = (): Toaster<ToastReference> => React.useContext(ToastContext);\n"],"names":["DEFAULT_AUTO_CLOSE_TIMEOUT","ToastContext","React","insertToastWithoutDuplicates","currentToasts","id","content","options","close","nextToasts","existingToastIndex","findIndex","toast","JSON","stringify","lastDuplicateId","lastUpdated","Date","now","push","ToastProvider","children","props","toasts","setToasts","handleClose","filter","toaster","uuid","update","success","autoClose","type","error","warning","information","loading","Provider","value","Portal","className","role","AnimatePresence","initial","map","motion","div","key","transition","damping","stiffness","opacity","y","scale","animate","exit","duration","Toast","onClose","useToast"],"mappings":";;;;;;AAQA,MAAMA,0BAA0B,GAAG,IAAI;AA+BvC,MAAMC,YAAY,gBAAGC,aAAmB,CAA0B,EAA6B,CAAC;AAQhG,MAAMC,4BAA4B,GAAGA,CACjCC,aAA8B,EAC9BC,EAAU,EACVC,OAAqB,EACrBC,OAAqB,EACrBC,KAAiB;EAEjB,MAAMC,UAAU,GAAG,CAAC,GAAGL,aAAa,CAAC;EACrC,MAAMM,kBAAkB,GAAGN,aAAa,CAACO,SAAS,CAACC,KAAK,IAAIC,IAAI,CAACC,SAAS,CAACF,KAAK,CAACN,OAAO,CAAC,KAAKO,IAAI,CAACC,SAAS,CAACR,OAAO,CAAC,CAAC;EAEtH,IAAII,kBAAkB,GAAG,CAAC,CAAC,EAAE;IACzBD,UAAU,CAACC,kBAAkB,CAAC,CAACK,eAAe,GAAGV,EAAE;IACnDI,UAAU,CAACC,kBAAkB,CAAC,CAACM,WAAW,GAAGC,IAAI,CAACC,GAAG,EAAE;GAC1D,MAAM;IACHT,UAAU,CAACU,IAAI,CAAC;MACZd,EAAE;MACFC,OAAO,EAAE,OAAOA,OAAO,KAAK,UAAU,GAAGA,OAAO,CAACE,KAAK,CAAC,GAAGF,OAAO;MACjEC;KACH,CAAC;;EAGN,OAAOE,UAAU;AACrB,CAAC;MAEYW,aAAa,GAAGA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;CAA2B;EACpE,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGtB,QAAc,CAAkB,EAAE,CAAC;EAE/D,MAAMuB,WAAW,GAAIpB,EAAU;IAC3BmB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E;KAAW,CAAC;GACxD,EAAE,EAAE,CAAC;EAEN,oBACI9B,cAACD,YAAY,CAACoC,QAAQ,oBAAKf,KAAK;IAAEgB,KAAK,EAAEX;MACpCN,QAAQ,eACTnB,cAACqC,MAAM,qBACHrC;IACIG,EAAE,EAAC,qBAAqB;IACxBmC,SAAS,EAAC,yHAAyH;IACnIC,IAAI,EAAC;kBACLvC,cAACwC,eAAe;IAACC,OAAO,EAAE;KACrBpB,MAAM,CAACqB,GAAG,CAAEhC,KAAoB,kBAC7BV,cAAC2C,MAAM,CAACC,GAAG;IACPC,GAAG,EAAEnC,KAAK,CAACP,EAAE;IACb2C,UAAU,EAAE;MACRhB,IAAI,EAAE,QAAQ;MACdiB,OAAO,EAAE,EAAE;MACXC,SAAS,EAAE;KACd;IACDP,OAAO,EAAE;MAAEQ,OAAO,EAAE,CAAC;MAAEC,CAAC,EAAE,EAAE;MAAEC,KAAK,EAAE;KAAK;IAC1CC,OAAO,EAAE;MAAEH,OAAO,EAAE,CAAC;MAAEC,CAAC,EAAE,CAAC;MAAEC,KAAK,EAAE;KAAG;IACvCE,IAAI,EAAE;MAAEJ,OAAO,EAAE,CAAC;MAAEE,KAAK,EAAE,GAAG;MAAEL,UAAU,EAAE;QAAEQ,QAAQ,EAAE;;;kBACxDtD,cAACuD,KAAK,oBAAK7C,KAAK;IAAE8C,OAAO,EAAEA,MAAMjC,WAAW,CAACb,KAAK,CAACP,EAAE;KAAK,CACjD,CAChB,CAAC,CACY,CAChB,CACD,CACW;AAEhC;MAEasD,QAAQ,GAAGA,MAA+BzD,UAAgB,CAACD,YAAY;;;;"}
|
1
|
+
{"version":3,"file":"Toaster.js","sources":["../../../../../../../src/components/Toast/Toaster.tsx"],"sourcesContent":["import * as React from 'react';\nimport { v4 as uuid } from 'uuid';\nimport { AnimatePresence, motion } from 'framer-motion';\nimport { Portal } from '@radix-ui/react-portal';\n\nimport { ToastOptions, Toast, ToastProps, ToastContent } from './Toast';\nimport './Toast.css';\n\nconst DEFAULT_AUTO_CLOSE_TIMEOUT = 7500;\n\ntype ToastCreator<T> = (content: ToastContent | ((close: () => void) => ToastContent), options?: ToastOptions) => T;\n\nexport interface Toaster<T> extends ToastCreator<T> {\n success: ToastCreator<T>;\n error: ToastCreator<T>;\n warning: ToastCreator<T>;\n information: ToastCreator<T>;\n loading: ToastCreator<T>;\n}\n\nexport interface ToastReference {\n /** Show a success toast */\n success: ToastCreator<void>;\n /** Show an error toast */\n error: ToastCreator<void>;\n /** Show a warning toast */\n warning: ToastCreator<void>;\n /** Show an information toast */\n information: ToastCreator<void>;\n /** Show a loading toast */\n loading: ToastCreator<void>;\n /**\n * Close an existing toast.\n * The toast function returns a reference to the active toast,\n * allowing you to programmatically close it when needed\n */\n close: () => void;\n}\n\nconst ToastContext = React.createContext<Toaster<ToastReference>>({} as Toaster<ToastReference>);\n\nexport interface ToastProviderProps {\n children: React.ReactNode;\n}\n\ntype InternalToast = Omit<ToastProps, 'onClose'>;\n\nconst insertToastWithoutDuplicates = (\n currentToasts: InternalToast[],\n id: string,\n content: ToastContent,\n options: ToastOptions,\n close: () => void\n): InternalToast[] => {\n const nextToasts = [...currentToasts];\n const existingToastIndex = currentToasts.findIndex(toast => JSON.stringify(toast.content) === JSON.stringify(content));\n\n if (existingToastIndex > -1) {\n nextToasts[existingToastIndex].lastDuplicateId = id;\n nextToasts[existingToastIndex].lastUpdated = Date.now();\n } else {\n nextToasts.push({\n id,\n content: typeof content === 'function' ? content(close) : content,\n options,\n });\n }\n\n return nextToasts;\n};\n\nexport const ToastProvider = ({ children, ...props }: ToastProviderProps): JSX.Element => {\n const [toasts, setToasts] = React.useState<InternalToast[]>([]);\n\n const handleClose = (id: string): void => {\n setToasts(currentToasts => currentToasts.filter(toast => toast.id !== id));\n };\n\n // memoize (useCallback) this function,\n // it is the value of the context provider and we don't want it to trigger state tree re-renders on provider children\n const toaster = React.useCallback((content: ToastContent, options: ToastOptions): ToastReference => {\n const id = uuid();\n const close = (): void => handleClose(id);\n\n setToasts(currentToasts => insertToastWithoutDuplicates(currentToasts, id, content, options, close));\n\n const update = (content: ToastContent, options: ToastOptions): void => {\n setToasts(currentToasts => {\n const nextToasts = currentToasts.filter(toast => {\n if (toast.lastDuplicateId) {\n return toast.lastDuplicateId !== id;\n }\n\n return toast.id !== id;\n });\n return insertToastWithoutDuplicates(nextToasts, uuid(), content, options, close);\n });\n };\n\n const success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n };\n const error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'error' });\n };\n const warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'warning' });\n };\n const information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'information' });\n };\n const loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): void => {\n update(content, { ...options, type: 'loading' });\n };\n\n return {\n success,\n error,\n warning,\n information,\n loading,\n close,\n };\n }, []) as Toaster<ToastReference>;\n\n // no need to rebind these every render, do them once in an effect\n React.useEffect(() => {\n toaster.success = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { autoClose: DEFAULT_AUTO_CLOSE_TIMEOUT, ...options, type: 'success' });\n toaster.error = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'error' });\n toaster.warning = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'warning' });\n toaster.information = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'information' });\n toaster.loading = (content: ToastContent, options?: Omit<ToastOptions, 'type'>): ToastReference =>\n toaster(content, { ...options, type: 'loading' });\n }, []);\n\n return (\n <ToastContext.Provider {...props} value={toaster}>\n {children}\n <Portal>\n <div\n id=\"yt-toast__container\"\n className=\"pointer-events-all absolute !left-auto bottom-0 right-0 z-[1000] mb-4 mr-4 flex max-w-md flex-col items-end justify-end\"\n role=\"log\">\n <AnimatePresence initial={false}>\n {toasts.map((toast: InternalToast) => (\n <motion.div\n key={toast.id}\n transition={{\n type: 'spring',\n damping: 20,\n stiffness: 300,\n }}\n initial={{ opacity: 0, y: 10, scale: 0.5 }}\n animate={{ opacity: 1, y: 0, scale: 1 }}\n exit={{ opacity: 0, scale: 0.5, transition: { duration: 0.2 } }}>\n <Toast {...toast} onClose={() => handleClose(toast.id)} />\n </motion.div>\n ))}\n </AnimatePresence>\n </div>\n </Portal>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = (): Toaster<ToastReference> => React.useContext(ToastContext);\n"],"names":["DEFAULT_AUTO_CLOSE_TIMEOUT","ToastContext","React","insertToastWithoutDuplicates","currentToasts","id","content","options","close","nextToasts","concat","existingToastIndex","findIndex","toast","JSON","stringify","lastDuplicateId","lastUpdated","Date","now","push","ToastProvider","_ref","children","props","_objectWithoutPropertiesLoose","_excluded","_React$useState","toasts","setToasts","handleClose","filter","toaster","uuid","update","success","_extends","autoClose","type","error","warning","information","loading","Provider","value","Portal","className","role","AnimatePresence","initial","map","motion","div","key","transition","damping","stiffness","opacity","y","scale","animate","exit","duration","Toast","onClose","useToast"],"mappings":";;;;;;;;AAQA,IAAMA,0BAA0B,GAAG,IAAI;AA+BvC,IAAMC,YAAY,gBAAGC,aAAmB,CAA0B,EAA6B,CAAC;AAQhG,IAAMC,4BAA4B,GAAG,SAA/BA,4BAA4BA,CAC9BC,aAA8B,EAC9BC,EAAU,EACVC,OAAqB,EACrBC,OAAqB,EACrBC,KAAiB;EAEjB,IAAMC,UAAU,MAAAC,MAAA,CAAON,aAAa,CAAC;EACrC,IAAMO,kBAAkB,GAAGP,aAAa,CAACQ,SAAS,CAAC,UAAAC,KAAK;IAAA,OAAIC,IAAI,CAACC,SAAS,CAACF,KAAK,CAACP,OAAO,CAAC,K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EAAE,EAAC,qBAAqB;IACxByC,SAAS,EAAC,yHAAyH;IACnIC,IAAI,EAAC;kBACL7C,cAAC8C,eAAe;IAACC,OAAO,EAAE;KACrBrB,MAAM,CAACsB,GAAG,CAAC,UAACrC,KAAoB;IAAA,oBAC7BX,cAACiD,MAAM,CAACC,GAAG;MACPC,GAAG,EAAExC,KAAK,CAACR,EAAE;MACbiD,UAAU,EAAE;QACRhB,IAAI,EAAE,QAAQ;QACdiB,OAAO,EAAE,EAAE;QACXC,SAAS,EAAE;OACd;MACDP,OAAO,EAAE;QAAEQ,OAAO,EAAE,CAAC;QAAEC,CAAC,EAAE,EAAE;QAAEC,KAAK,EAAE;OAAK;MAC1CC,OAAO,EAAE;QAAEH,OAAO,EAAE,CAAC;QAAEC,CAAC,EAAE,CAAC;QAAEC,KAAK,EAAE;OAAG;MACvCE,IAAI,EAAE;QAAEJ,OAAO,EAAE,CAAC;QAAEE,KAAK,EAAE,GAAG;QAAEL,UAAU,EAAE;UAAEQ,QAAQ,EAAE;;;oBACxD5D,cAAC6D,KAAK,oBAAKlD,KAAK;MAAEmD,OAAO,EAAE,SAAAA;QAAA,OAAMlC,WAAW,CAACjB,KAAK,CAACR,EAAE,CAAC;;OAAI,CACjD;GAChB,CAAC,CACY,CAChB,CACD,CACW;AAEhC;IAEa4D,QAAQ,GAAG,SAAXA,QAAQA;EAAA,OAAkC/D,UAAgB,CAACD,YAAY,CAAC;AAAA;;;;"}
|
@@ -2,10 +2,10 @@ import React__default from 'react';
|
|
2
2
|
import { BadgeIcon } from '../BadgeIcon/BadgeIcon.js';
|
3
3
|
import { Spinner } from '../Spinner/Spinner.js';
|
4
4
|
|
5
|
-
|
5
|
+
var getBadgeIcon = function getBadgeIcon(type) {
|
6
6
|
return /*#__PURE__*/React__default.createElement("div", {
|
7
7
|
className: "mr-2 mt-[5px] flex-shrink-0 self-start"
|
8
|
-
}, (
|
8
|
+
}, function () {
|
9
9
|
switch (type) {
|
10
10
|
case 'success':
|
11
11
|
return /*#__PURE__*/React__default.createElement(BadgeIcon, {
|
@@ -35,9 +35,11 @@ const getBadgeIcon = type => {
|
|
35
35
|
default:
|
36
36
|
return null;
|
37
37
|
}
|
38
|
-
}
|
38
|
+
}());
|
39
|
+
};
|
40
|
+
var getToastEmptyContentWarning = function getToastEmptyContentWarning(content) {
|
41
|
+
return "Toast requires 'content' property, which can't be empty string, null or undefined. Current content value is set to " + (content === '' ? 'empty string' : content) + ".";
|
39
42
|
};
|
40
|
-
const getToastEmptyContentWarning = content => `Toast requires 'content' property, which can't be empty string, null or undefined. Current content value is set to ${content === '' ? 'empty string' : content}.`;
|
41
43
|
|
42
44
|
export { getBadgeIcon, getToastEmptyContentWarning };
|
43
45
|
//# sourceMappingURL=util.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Toast/util.tsx"],"sourcesContent":["import React from 'react';\nimport { Spinner } from '../Spinner/Spinner';\nimport { ToastContent, ToastType } from './Toast';\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\n\nexport const getBadgeIcon = (type: ToastType): JSX.Element | null => {\n return (\n <div className=\"mr-2 mt-[5px] flex-shrink-0 self-start\">\n {(() => {\n switch (type) {\n case 'success':\n return <BadgeIcon icon=\"tick\" color=\"green\" />;\n case 'error':\n return <BadgeIcon icon=\"close\" color=\"red\" />;\n case 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n case 'loading':\n return <Spinner delay={0} className=\"h-5 w-5\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n\nexport const getToastEmptyContentWarning = (content?: ToastContent) =>\n `Toast requires 'content' property, which can't be empty string, null or undefined. Current content value is set to ${\n content === '' ? 'empty string' : content\n }.`;\n"],"names":["getBadgeIcon","type","React","className","BadgeIcon","icon","color","Spinner","delay","getToastEmptyContentWarning","content"],"mappings":";;;;
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Toast/util.tsx"],"sourcesContent":["import React from 'react';\nimport { Spinner } from '../Spinner/Spinner';\nimport { ToastContent, ToastType } from './Toast';\nimport { BadgeIcon } from '../BadgeIcon/BadgeIcon';\n\nexport const getBadgeIcon = (type: ToastType): JSX.Element | null => {\n return (\n <div className=\"mr-2 mt-[5px] flex-shrink-0 self-start\">\n {(() => {\n switch (type) {\n case 'success':\n return <BadgeIcon icon=\"tick\" color=\"green\" />;\n case 'error':\n return <BadgeIcon icon=\"close\" color=\"red\" />;\n case 'warning':\n return <BadgeIcon icon=\"warning\" color=\"yellow\" />;\n case 'information':\n return <BadgeIcon icon=\"info\" color=\"blue\" />;\n case 'loading':\n return <Spinner delay={0} className=\"h-5 w-5\" />;\n default:\n return null;\n }\n })()}\n </div>\n );\n};\n\nexport const getToastEmptyContentWarning = (content?: ToastContent) =>\n `Toast requires 'content' property, which can't be empty string, null or undefined. Current content value is set to ${\n content === '' ? 'empty string' : content\n }.`;\n"],"names":["getBadgeIcon","type","React","className","BadgeIcon","icon","color","Spinner","delay","getToastEmptyContentWarning","content"],"mappings":";;;;IAKaA,YAAY,GAAG,SAAfA,YAAYA,CAAIC,IAAe;EACxC,oBACIC;IAAKC,SAAS,EAAC;KACT;IACE,QAAQF,IAAI;MACR,KAAK,SAAS;QACV,oBAAOC,6BAACE,SAAS;UAACC,IAAI,EAAC,MAAM;UAACC,KAAK,EAAC;UAAU;MAClD,KAAK,OAAO;QACR,oBAAOJ,6BAACE,SAAS;UAACC,IAAI,EAAC,OAAO;UAACC,KAAK,EAAC;UAAQ;MACjD,KAAK,SAAS;QACV,oBAAOJ,6BAACE,SAAS;UAACC,IAAI,EAAC,SAAS;UAACC,KAAK,EAAC;UAAW;MACtD,KAAK,aAAa;QACd,oBAAOJ,6BAACE,SAAS;UAACC,IAAI,EAAC,MAAM;UAACC,KAAK,EAAC;UAAS;MACjD,KAAK,SAAS;QACV,oBAAOJ,6BAACK,OAAO;UAACC,KAAK,EAAE,CAAC;UAAEL,SAAS,EAAC;UAAY;MACpD;QACI,OAAO,IAAI;;GAEtB,EAAG,CACF;AAEd;IAEaM,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,OAAsB;EAAA,gIAE1DA,OAAO,KAAK,EAAE,GAAG,cAAc,GAAGA,OACtC;AAAA;;;;"}
|
@@ -1,16 +1,17 @@
|
|
1
1
|
import { forwardRef, createElement } from 'react';
|
2
2
|
import cn from 'clsx';
|
3
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
3
4
|
import { Root, Trigger, Portal, Content, Arrow } from '@radix-ui/react-tooltip';
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
children,
|
9
|
-
placement,
|
10
|
-
hide =
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
var _excluded = ["title", "children", "placement", "hide"];
|
7
|
+
var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(props, ref) {
|
8
|
+
var title = props.title,
|
9
|
+
children = props.children,
|
10
|
+
placement = props.placement,
|
11
|
+
_props$hide = props.hide,
|
12
|
+
hide = _props$hide === void 0 ? false : _props$hide,
|
13
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
14
|
+
var className = cn('break-words', otherProps.className);
|
14
15
|
if (hide) {
|
15
16
|
return children;
|
16
17
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport cn from 'clsx';\n\nexport type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** The element which activates the tooltip when hovered. Should be a single React/HTML element */\n children: React.ReactElement | any;\n /** Use this value to hide tooltip conditionally */\n hide?: boolean;\n /** Text displayed in the tooltip */\n title: string | JSX.Element;\n /**\n * Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs\n * @defaultValue bottom\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n};\n\nexport const Tooltip = React.forwardRef(function Tooltip(props: TooltipProps, ref: React.Ref<HTMLElement>) {\n const { title, children, placement, hide = false, ...otherProps } = props;\n const className = cn('break-words', otherProps.className);\n\n if (hide) {\n return children;\n }\n\n return (\n <TooltipPrimitive.Root delayDuration={250}>\n <TooltipPrimitive.Trigger asChild ref={ref as any}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content {...otherProps} asChild className={className} side={placement} sideOffset={3}>\n <div\n className=\"xs:max-w-[theme(spacing.56)] max-w-[theme(spacing.32)] animate-[fade-in_150ms] rounded-sm bg-blue-900 px-2 py-1 text-xs font-bold text-white print:hidden\"\n data-taco=\"tooltip\"\n style={{\n transformOrigin: 'var(--radix-tooltip-content-transform-origin)',\n }}>\n <TooltipPrimitive.Arrow className=\"-mt-px fill-blue-900/90 stroke-blue-900/90\" />\n {title}\n </div>\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n});\n"],"names":["Tooltip","React","props","ref","title","children","placement","hide","otherProps","className","cn","TooltipPrimitive","delayDuration","asChild","side","sideOffset","style","transformOrigin"],"mappings":"
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../../../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport cn from 'clsx';\n\nexport type TooltipProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> & {\n /** The element which activates the tooltip when hovered. Should be a single React/HTML element */\n children: React.ReactElement | any;\n /** Use this value to hide tooltip conditionally */\n hide?: boolean;\n /** Text displayed in the tooltip */\n title: string | JSX.Element;\n /**\n * Placement of the tooltip relative to the reference element. Placement will be reversed if a collision occurs\n * @defaultValue bottom\n */\n placement?: 'top' | 'right' | 'bottom' | 'left';\n};\n\nexport const Tooltip = React.forwardRef(function Tooltip(props: TooltipProps, ref: React.Ref<HTMLElement>) {\n const { title, children, placement, hide = false, ...otherProps } = props;\n const className = cn('break-words', otherProps.className);\n\n if (hide) {\n return children;\n }\n\n return (\n <TooltipPrimitive.Root delayDuration={250}>\n <TooltipPrimitive.Trigger asChild ref={ref as any}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content {...otherProps} asChild className={className} side={placement} sideOffset={3}>\n <div\n className=\"xs:max-w-[theme(spacing.56)] max-w-[theme(spacing.32)] animate-[fade-in_150ms] rounded-sm bg-blue-900 px-2 py-1 text-xs font-bold text-white print:hidden\"\n data-taco=\"tooltip\"\n style={{\n transformOrigin: 'var(--radix-tooltip-content-transform-origin)',\n }}>\n <TooltipPrimitive.Arrow className=\"-mt-px fill-blue-900/90 stroke-blue-900/90\" />\n {title}\n </div>\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n});\n"],"names":["Tooltip","React","props","ref","title","children","placement","_props$hide","hide","otherProps","_objectWithoutPropertiesLoose","_excluded","className","cn","TooltipPrimitive","delayDuration","asChild","side","sideOffset","style","transformOrigin"],"mappings":";;;;;;IAkBaA,OAAO,gBAAGC,UAAgB,CAAC,SAASD,OAAOA,CAACE,KAAmB,EAAEC,GAA2B;EACrG,IAAQC,KAAK,GAAuDF,KAAK,CAAjEE,KAAK;IAAEC,QAAQ,GAA6CH,KAAK,CAA1DG,QAAQ;IAAEC,SAAS,GAAkCJ,KAAK,CAAhDI,SAAS;IAAAC,WAAA,GAAkCL,KAAK,CAArCM,IAAI;IAAJA,IAAI,GAAAD,WAAA,cAAG,KAAK,GAAAA,WAAA;IAAKE,UAAU,GAAAC,6BAAA,CAAKR,KAAK,EAAAS,SAAA;EACzE,IAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEJ,UAAU,CAACG,SAAS,CAAC;EAEzD,IAAIJ,IAAI,EAAE;IACN,OAAOH,QAAQ;;EAGnB,oBACIJ,cAACa,IAAqB;IAACC,aAAa,EAAE;kBAClCd,cAACa,OAAwB;IAACE,OAAO;IAACb,GAAG,EAAEA;KAClCE,QAAQ,CACc,eAC3BJ,cAACa,MAAuB,qBACpBb,cAACa,OAAwB,oBAAKL,UAAU;IAAEO,OAAO;IAACJ,SAAS,EAAEA,SAAS;IAAEK,IAAI,EAAEX,SAAS;IAAEY,UAAU,EAAE;mBACjGjB;IACIW,SAAS,EAAC,2JAA2J;iBAC3J,SAAS;IACnBO,KAAK,EAAE;MACHC,eAAe,EAAE;;kBAErBnB,cAACa,KAAsB;IAACF,SAAS,EAAC;IAA+C,EAChFR,KAAK,CACJ,CACiB,CACL,CACN;AAEhC,CAAC;;;;"}
|
@@ -1,26 +1,27 @@
|
|
1
1
|
import { useMemo, Children, useCallback, createElement, useRef, useEffect } from 'react';
|
2
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
2
3
|
import { IconButton } from '../IconButton/IconButton.js';
|
3
4
|
import { useLocalization } from '../Provider/Localization.js';
|
4
5
|
import { Button } from '../Button/Button.js';
|
5
6
|
import { Group } from '../Group/Group.js';
|
6
7
|
import Joyride, { ACTIONS, LIFECYCLE, EVENTS } from 'react-joyride';
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
useEffect(()
|
23
|
-
|
9
|
+
var _excluded = ["autoStart", "onComplete", "onClose", "onReady", "spotlightClicks", "disableCloseOnEsc", "disableScrollParentFix", "scrollOffset"];
|
10
|
+
var Tooltip = function Tooltip(_ref) {
|
11
|
+
var continuous = _ref.continuous,
|
12
|
+
index = _ref.index,
|
13
|
+
isLastStep = _ref.isLastStep,
|
14
|
+
step = _ref.step,
|
15
|
+
backProps = _ref.backProps,
|
16
|
+
primaryProps = _ref.primaryProps,
|
17
|
+
skipProps = _ref.skipProps,
|
18
|
+
tooltipProps = _ref.tooltipProps,
|
19
|
+
size = _ref.size,
|
20
|
+
locale = _ref.locale,
|
21
|
+
disableTourSkipOnEsc = _ref.disableTourSkipOnEsc;
|
22
|
+
var skipButtonRef = useRef(null);
|
23
|
+
useEffect(function () {
|
24
|
+
var onWindowKeyDown = function onWindowKeyDown(event) {
|
24
25
|
if (!disableTourSkipOnEsc) {
|
25
26
|
if (event.key === 'Escape' && skipButtonRef.current !== null) {
|
26
27
|
event.preventDefault();
|
@@ -30,7 +31,7 @@ const Tooltip = ({
|
|
30
31
|
}
|
31
32
|
};
|
32
33
|
window.addEventListener('keydown', onWindowKeyDown);
|
33
|
-
return ()
|
34
|
+
return function () {
|
34
35
|
window.removeEventListener('keydown', onWindowKeyDown);
|
35
36
|
};
|
36
37
|
}, []);
|
@@ -49,30 +50,28 @@ const Tooltip = ({
|
|
49
50
|
appearance: "discrete"
|
50
51
|
}), locale.back)), /*#__PURE__*/createElement(Button, Object.assign({}, primaryProps, {
|
51
52
|
appearance: "primary"
|
52
|
-
}), continuous ? isLastStep ?
|
53
|
+
}), continuous ? isLastStep ? locale.last + " (" + (index + 1) + "/" + size + ")" : locale.next + " (" + (index + 1) + "/" + size + ")" : locale.close)));
|
53
54
|
};
|
54
55
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
return Children.map(props.children, child => {
|
75
|
-
const step = {
|
56
|
+
var TourStep = function TourStep(_props) {
|
57
|
+
return null;
|
58
|
+
};
|
59
|
+
var Tour = function Tour(props) {
|
60
|
+
var _useLocalization = useLocalization(),
|
61
|
+
tour = _useLocalization.texts.tour;
|
62
|
+
var run = props.autoStart,
|
63
|
+
onComplete = props.onComplete,
|
64
|
+
onClose = props.onClose,
|
65
|
+
onReady = props.onReady,
|
66
|
+
spotlightClicks = props.spotlightClicks,
|
67
|
+
disableTourSkipOnEsc = props.disableCloseOnEsc,
|
68
|
+
_props$disableScrollP = props.disableScrollParentFix,
|
69
|
+
disableScrollParentFix = _props$disableScrollP === void 0 ? false : _props$disableScrollP,
|
70
|
+
scrollOffset = props.scrollOffset,
|
71
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
72
|
+
var steps = useMemo(function () {
|
73
|
+
return Children.map(props.children, function (child) {
|
74
|
+
var step = {
|
76
75
|
disableBeacon: !child.props.showBeacon,
|
77
76
|
target: child.props.selector,
|
78
77
|
placement: child.props.position,
|
@@ -82,11 +81,13 @@ const Tour = props => {
|
|
82
81
|
return step;
|
83
82
|
});
|
84
83
|
}, [props.children]);
|
85
|
-
|
84
|
+
var getStep = useCallback(function (selector) {
|
86
85
|
var _props$children$find;
|
87
|
-
return (_props$children$find = props.children.find(
|
86
|
+
return (_props$children$find = props.children.find(function (child) {
|
87
|
+
return child.props.selector === selector;
|
88
|
+
})) === null || _props$children$find === void 0 ? void 0 : _props$children$find.props;
|
88
89
|
}, [props.children]);
|
89
|
-
|
90
|
+
var callback = function callback(state) {
|
90
91
|
if (state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {
|
91
92
|
if (onClose) {
|
92
93
|
onClose(getStep(state.step.target));
|
@@ -110,10 +111,12 @@ const Tour = props => {
|
|
110
111
|
floaterProps: {
|
111
112
|
disableAnimation: true
|
112
113
|
},
|
113
|
-
tooltipComponent:
|
114
|
-
|
115
|
-
|
116
|
-
|
114
|
+
tooltipComponent: function tooltipComponent(tooltipProps) {
|
115
|
+
return /*#__PURE__*/createElement(Tooltip, Object.assign({}, tooltipProps, {
|
116
|
+
locale: tour,
|
117
|
+
disableTourSkipOnEsc: disableTourSkipOnEsc
|
118
|
+
}));
|
119
|
+
},
|
117
120
|
locale: tour,
|
118
121
|
spotlightPadding: 8,
|
119
122
|
spotlightClicks: spotlightClicks,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tour.js","sources":["../../../../../../../src/components/Tour/Tour.tsx"],"sourcesContent":["import * as React from 'react';\nimport Joyride, { Step, CallBackProps, ACTIONS, LIFECYCLE, Placement, EVENTS, TooltipRenderProps } from 'react-joyride';\n\nimport { Button } from '../Button/Button';\nimport { Group } from '../Group/Group';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nexport type TourTexts = {\n /** Text for back action button */\n back: string;\n /**\n * Text for close button.\n * This button is displayed if tour is not continuous - replacing the `Next` button.\n * It will pause the flow of the tour and close the tooltip\n */\n close: string;\n /**\n * Aria-label and title for close icon button in each step.\n * This button skips and completes the flow entirely\n */\n skip: string;\n /**\n * Text for last action button.\n * This button is displayed when user is on the last step of the tour\n */\n last: string;\n /**\n * Text for next action button.\n * This button is displayed if tour has more than one steps and is continuous\n */\n next: string;\n /** Aria label and title for beacon that will open the tour step */\n open: string;\n};\n\nexport type TourStepProps = {\n /** Content can be any valid react node, for e.g. a `div` */\n children: React.ReactNode;\n /** Define the position of the tour's popup relative to the element is presenting */\n position?: Placement;\n /** The css selector of the html element you want to include in a tour */\n selector: string;\n /**\n * Show beacon for step.\n * A beacon is a styled component which indicates the current element to be presented.\n * For more informations about how to create a beacon, read [Joyride](https://docs.react-joyride.com) docs\n */\n showBeacon?: boolean;\n /** Text displayed above the children/content of the popup */\n title: string;\n};\n\nconst Tooltip = ({\n continuous,\n index,\n isLastStep,\n step,\n backProps,\n primaryProps,\n skipProps,\n tooltipProps,\n size,\n locale,\n disableTourSkipOnEsc,\n}: TooltipRenderProps & { locale: TourTexts; disableTourSkipOnEsc?: boolean }) => {\n const skipButtonRef = React.useRef<HTMLButtonElement>(null);\n\n React.useEffect(() => {\n const onWindowKeyDown = (event: KeyboardEvent): void => {\n if (!disableTourSkipOnEsc) {\n if (event.key === 'Escape' && skipButtonRef.current !== null) {\n event.preventDefault();\n skipButtonRef.current.click();\n return;\n }\n }\n };\n\n window.addEventListener('keydown', onWindowKeyDown);\n\n return () => {\n window.removeEventListener('keydown', onWindowKeyDown);\n };\n }, []);\n\n return (\n <div {...tooltipProps} className=\"yt-tour__step w-88 relative rounded bg-white p-4\">\n <IconButton\n {...skipProps}\n ref={skipButtonRef}\n appearance=\"discrete\"\n icon=\"close\"\n title={locale.skip}\n aria-label={locale.skip}\n className=\"absolute top-0 right-0 mt-1 mr-1\"\n />\n {step.title && <h5>{step.title}</h5>}\n {step.content}\n <Group className=\"mt-4 justify-end\">\n {index > 0 && (\n <Button {...backProps} appearance=\"discrete\">\n {locale.back}\n </Button>\n )}\n <Button {...primaryProps} appearance=\"primary\">\n {continuous\n ? isLastStep\n ? `${locale.last} (${index + 1}/${size})`\n : `${locale.next} (${index + 1}/${size})`\n : locale.close}\n </Button>\n </Group>\n </div>\n );\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const TourStep = (_props: TourStepProps): null => null;\n\nexport type TourProps = {\n /** Controls if [Joyride](https://docs.react-joyride.com) is active */\n autoStart?: boolean;\n /** Children should be one or more `Tour.Step` components */\n children: any;\n /** Are there more than one steps and should you be able to navigate between them using `Next` and `Previous` buttons */\n continuous?: boolean;\n /** Disable closing of tour when click on `Escape` */\n disableCloseOnEsc?: boolean;\n /** Don't close the presenting popup of the tour step when clicking outside it */\n disableOverlayClose?: boolean;\n /** Allows user to interact with the presented components (mouse and touch events) when the popup is visible */\n disableScrolling?: boolean;\n /* When user clicks on the close icon button, which will close the tour and complete the flow */\n onClose?: (step: TourStepProps) => void;\n /* When user completes the entire flow */\n onComplete?: Function;\n /** When step is ready */\n onReady?: (step: TourStepProps) => void;\n /* Allow mouse and touch events through the spotlight */\n spotlightClicks?: boolean;\n /* Stops the injection of custom overflow styles on parent container. Can be used to prevent remaining overflow styles after tour is done. */\n disableScrollParentFix?: boolean;\n /** The scroll distance from the element scrollTop value. */\n scrollOffset?: number;\n};\n\nexport const Tour = (props: TourProps) => {\n const {\n texts: { tour },\n } = useLocalization();\n\n const {\n autoStart: run,\n onComplete,\n onClose,\n onReady,\n spotlightClicks,\n disableCloseOnEsc: disableTourSkipOnEsc,\n disableScrollParentFix = false,\n scrollOffset,\n ...rest\n } = props;\n\n const steps = React.useMemo(() => {\n return React.Children.map(props.children, child => {\n const step: Step = {\n disableBeacon: !child.props.showBeacon,\n target: child.props.selector,\n placement: child.props.position,\n title: child.props.title,\n content: child.props.children,\n };\n return step;\n });\n }, [props.children]);\n\n const getStep = React.useCallback(\n (selector: string | HTMLElement) => props.children.find((child: any) => child.props.selector === selector)?.props,\n [props.children]\n );\n\n const callback = (state: CallBackProps) => {\n if (state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {\n if (onClose) {\n onClose(getStep(state.step.target));\n }\n }\n\n if (state.type === EVENTS.TOUR_END) {\n if (onComplete) {\n onComplete();\n }\n }\n\n if (state.lifecycle === LIFECYCLE.READY) {\n if (onReady) {\n onReady(getStep(state.step.target));\n }\n }\n };\n\n return (\n <Joyride\n {...rest}\n run={run}\n steps={steps}\n showProgress\n floaterProps={{\n disableAnimation: true,\n }}\n tooltipComponent={tooltipProps => (\n <Tooltip {...tooltipProps} locale={tour} disableTourSkipOnEsc={disableTourSkipOnEsc} />\n )}\n locale={tour}\n spotlightPadding={8}\n spotlightClicks={spotlightClicks}\n disableScrollParentFix={disableScrollParentFix}\n callback={callback}\n scrollOffset={scrollOffset}\n styles={{\n /** style beacon */\n options: {\n // tailwind.theme.colors.blue.300\n primaryColor: '#6ba4ff',\n },\n }}\n disableCloseOnEsc\n />\n );\n};\n\nTour.Step = TourStep;\n"],"names":["Tooltip","continuous","index","isLastStep","step","backProps","primaryProps","skipProps","tooltipProps","size","locale","disableTourSkipOnEsc","skipButtonRef","React","onWindowKeyDown","event","key","current","preventDefault","click","window","addEventListener","removeEventListener","className","IconButton","ref","appearance","icon","title","skip","content","Group","Button","back","last","next","close","TourStep","_props","Tour","props","texts","tour","useLocalization","autoStart","run","onComplete","onClose","onReady","spotlightClicks","disableCloseOnEsc","disableScrollParentFix","scrollOffset","rest","steps","map","children","child","disableBeacon","showBeacon","target","selector","placement","position","getStep","_props$children$find","find","callback","state","action","ACTIONS","SKIP","lifecycle","LIFECYCLE","COMPLETE","type","EVENTS","TOUR_END","READY","Joyride","showProgress","floaterProps","disableAnimation","tooltipComponent","spotlightPadding","styles","options","primaryColor","Step"],"mappings":";;;;;;;AAqDA,MAAMA,OAAO,GAAGA,CAAC;EACbC,UAAU;EACVC,KAAK;EACLC,UAAU;EACVC,IAAI;EACJC,SAAS;EACTC,YAAY;EACZC,SAAS;EACTC,YAAY;EACZC,IAAI;EACJC,MAAM;EACNC;CACyE;EACzE,MAAMC,aAAa,GAAGC,MAAY,CAAoB,IAAI,CAAC;EAE3DA,SAAe,CAAC;IACZ,MAAMC,eAAe,GAAIC,KAAoB;MACzC,IAAI,CAACJ,oBAAoB,EAAE;QACvB,IAAII,KAAK,CAACC,GAAG,KAAK,QAAQ,IAAIJ,aAAa,CAACK,OAAO,KAAK,IAAI,EAAE;UAC1DF,KAAK,CAACG,cAAc,EAAE;UACtBN,aAAa,CAACK,OAAO,CAACE,KAAK,EAAE;UAC7B;;;KAGX;IAEDC,MAAM,CAACC,gBAAgB,CAAC,SAAS,EAAEP,eAAe,CAAC;IAEnD,OAAO;MACHM,MAAM,CAACE,mBAAmB,CAAC,SAAS,EAAER,eAAe,CAAC;KACzD;GACJ,EAAE,EAAE,CAAC;EAEN,oBACID,uCAASL,YAAY;IAAEe,SAAS,EAAC;mBAC7BV,cAACW,UAAU,oBACHjB,SAAS;IACbkB,GAAG,EAAEb,aAAa;IAClBc,UAAU,EAAC,UAAU;IACrBC,IAAI,EAAC,OAAO;IACZC,KAAK,EAAElB,MAAM,CAACmB,IAAI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,OAAO,oBAAKQ,YAAY;MAAEE,MAAM,EAAEgC,IAAI;MAAE/B,oBAAoB,EAAEA;OAAwB,CAC1F;IACDD,MAAM,EAAEgC,IAAI;IACZ0C,gBAAgB,EAAE,CAAC;IACnBnC,eAAe,EAAEA,eAAe;IAChCE,sBAAsB,EAAEA,sBAAsB;IAC9CgB,QAAQ,EAAEA,QAAQ;IAClBf,YAAY,EAAEA,YAAY;IAC1BiC,MAAM,EAAE;;MAEJC,OAAO,EAAE;;QAELC,YAAY,EAAE;;KAErB;IACDrC,iBAAiB;KACnB;AAEV;AAEAX,IAAI,CAACiD,IAAI,GAAGnD,QAAQ;;;;"}
|
1
|
+
{"version":3,"file":"Tour.js","sources":["../../../../../../../src/components/Tour/Tour.tsx"],"sourcesContent":["import * as React from 'react';\nimport Joyride, { Step, CallBackProps, ACTIONS, LIFECYCLE, Placement, EVENTS, TooltipRenderProps } from 'react-joyride';\n\nimport { Button } from '../Button/Button';\nimport { Group } from '../Group/Group';\nimport { IconButton } from '../IconButton/IconButton';\nimport { useLocalization } from '../Provider/Localization';\n\nexport type TourTexts = {\n /** Text for back action button */\n back: string;\n /**\n * Text for close button.\n * This button is displayed if tour is not continuous - replacing the `Next` button.\n * It will pause the flow of the tour and close the tooltip\n */\n close: string;\n /**\n * Aria-label and title for close icon button in each step.\n * This button skips and completes the flow entirely\n */\n skip: string;\n /**\n * Text for last action button.\n * This button is displayed when user is on the last step of the tour\n */\n last: string;\n /**\n * Text for next action button.\n * This button is displayed if tour has more than one steps and is continuous\n */\n next: string;\n /** Aria label and title for beacon that will open the tour step */\n open: string;\n};\n\nexport type TourStepProps = {\n /** Content can be any valid react node, for e.g. a `div` */\n children: React.ReactNode;\n /** Define the position of the tour's popup relative to the element is presenting */\n position?: Placement;\n /** The css selector of the html element you want to include in a tour */\n selector: string;\n /**\n * Show beacon for step.\n * A beacon is a styled component which indicates the current element to be presented.\n * For more informations about how to create a beacon, read [Joyride](https://docs.react-joyride.com) docs\n */\n showBeacon?: boolean;\n /** Text displayed above the children/content of the popup */\n title: string;\n};\n\nconst Tooltip = ({\n continuous,\n index,\n isLastStep,\n step,\n backProps,\n primaryProps,\n skipProps,\n tooltipProps,\n size,\n locale,\n disableTourSkipOnEsc,\n}: TooltipRenderProps & { locale: TourTexts; disableTourSkipOnEsc?: boolean }) => {\n const skipButtonRef = React.useRef<HTMLButtonElement>(null);\n\n React.useEffect(() => {\n const onWindowKeyDown = (event: KeyboardEvent): void => {\n if (!disableTourSkipOnEsc) {\n if (event.key === 'Escape' && skipButtonRef.current !== null) {\n event.preventDefault();\n skipButtonRef.current.click();\n return;\n }\n }\n };\n\n window.addEventListener('keydown', onWindowKeyDown);\n\n return () => {\n window.removeEventListener('keydown', onWindowKeyDown);\n };\n }, []);\n\n return (\n <div {...tooltipProps} className=\"yt-tour__step w-88 relative rounded bg-white p-4\">\n <IconButton\n {...skipProps}\n ref={skipButtonRef}\n appearance=\"discrete\"\n icon=\"close\"\n title={locale.skip}\n aria-label={locale.skip}\n className=\"absolute top-0 right-0 mt-1 mr-1\"\n />\n {step.title && <h5>{step.title}</h5>}\n {step.content}\n <Group className=\"mt-4 justify-end\">\n {index > 0 && (\n <Button {...backProps} appearance=\"discrete\">\n {locale.back}\n </Button>\n )}\n <Button {...primaryProps} appearance=\"primary\">\n {continuous\n ? isLastStep\n ? `${locale.last} (${index + 1}/${size})`\n : `${locale.next} (${index + 1}/${size})`\n : locale.close}\n </Button>\n </Group>\n </div>\n );\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport const TourStep = (_props: TourStepProps): null => null;\n\nexport type TourProps = {\n /** Controls if [Joyride](https://docs.react-joyride.com) is active */\n autoStart?: boolean;\n /** Children should be one or more `Tour.Step` components */\n children: any;\n /** Are there more than one steps and should you be able to navigate between them using `Next` and `Previous` buttons */\n continuous?: boolean;\n /** Disable closing of tour when click on `Escape` */\n disableCloseOnEsc?: boolean;\n /** Don't close the presenting popup of the tour step when clicking outside it */\n disableOverlayClose?: boolean;\n /** Allows user to interact with the presented components (mouse and touch events) when the popup is visible */\n disableScrolling?: boolean;\n /* When user clicks on the close icon button, which will close the tour and complete the flow */\n onClose?: (step: TourStepProps) => void;\n /* When user completes the entire flow */\n onComplete?: Function;\n /** When step is ready */\n onReady?: (step: TourStepProps) => void;\n /* Allow mouse and touch events through the spotlight */\n spotlightClicks?: boolean;\n /* Stops the injection of custom overflow styles on parent container. Can be used to prevent remaining overflow styles after tour is done. */\n disableScrollParentFix?: boolean;\n /** The scroll distance from the element scrollTop value. */\n scrollOffset?: number;\n};\n\nexport const Tour = (props: TourProps) => {\n const {\n texts: { tour },\n } = useLocalization();\n\n const {\n autoStart: run,\n onComplete,\n onClose,\n onReady,\n spotlightClicks,\n disableCloseOnEsc: disableTourSkipOnEsc,\n disableScrollParentFix = false,\n scrollOffset,\n ...rest\n } = props;\n\n const steps = React.useMemo(() => {\n return React.Children.map(props.children, child => {\n const step: Step = {\n disableBeacon: !child.props.showBeacon,\n target: child.props.selector,\n placement: child.props.position,\n title: child.props.title,\n content: child.props.children,\n };\n return step;\n });\n }, [props.children]);\n\n const getStep = React.useCallback(\n (selector: string | HTMLElement) => props.children.find((child: any) => child.props.selector === selector)?.props,\n [props.children]\n );\n\n const callback = (state: CallBackProps) => {\n if (state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {\n if (onClose) {\n onClose(getStep(state.step.target));\n }\n }\n\n if (state.type === EVENTS.TOUR_END) {\n if (onComplete) {\n onComplete();\n }\n }\n\n if (state.lifecycle === LIFECYCLE.READY) {\n if (onReady) {\n onReady(getStep(state.step.target));\n }\n }\n };\n\n return (\n <Joyride\n {...rest}\n run={run}\n steps={steps}\n showProgress\n floaterProps={{\n disableAnimation: true,\n }}\n tooltipComponent={tooltipProps => (\n <Tooltip {...tooltipProps} locale={tour} disableTourSkipOnEsc={disableTourSkipOnEsc} />\n )}\n locale={tour}\n spotlightPadding={8}\n spotlightClicks={spotlightClicks}\n disableScrollParentFix={disableScrollParentFix}\n callback={callback}\n scrollOffset={scrollOffset}\n styles={{\n /** style beacon */\n options: {\n // tailwind.theme.colors.blue.300\n primaryColor: '#6ba4ff',\n },\n }}\n disableCloseOnEsc\n />\n );\n};\n\nTour.Step = TourStep;\n"],"names":["Tooltip","_ref","continuous","index","isLastStep","step","backProps","primaryProps","skipProps","tooltipProps","size","locale","disableTourSkipOnEsc","skipButtonRef","React","onWindowKeyDown","event","key","current","preventDefault","click","window","addEventListener","removeEventListener","className","IconButton","ref","appearance","icon","title","skip","content","Group","Button","back","last","next","close","TourStep","_props","Tour","props","_useLocalization","useLocalization","tour","texts","run","autoStart","onComplete","onClose","onReady","spotlightClicks","disableCloseOnEsc","_props$disableScrollP","disableScrollParentFix","scrollOffset","rest","_objectWithoutPropertiesLoose","_excluded","steps","map","children","child","disableBeacon","showBeacon","target","selector","placement","position","getStep","_props$children$find","find","callback","state","action","ACTIONS","SKIP","lifecycle","LIFECYCLE","COMPLETE","type","EVENTS","TOUR_END","READY","Joyride","showProgress","floaterProps","disableAnimation","tooltipComponent","spotlightPadding","styles","options","primaryColor","Step"],"mappings":";;;;;;;;;AAqDA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA;MACTC,UAAU,GAAAD,IAAA,CAAVC,UAAU;IACVC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IACJC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,YAAY,GAAAN,IAAA,CAAZM,YAAY;IACZC,SAAS,GAAAP,IAAA,CAATO,SAAS;IACTC,YAAY,GAAAR,IAAA,CAAZQ,YAAY;IACZC,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJC,MAAM,GAAAV,IAAA,CAANU,MAAM;IACNC,oBAAoB,GAAAX,IAAA,CAApBW,oBAAoB;EAEpB,IAAMC,aAAa,GAAGC,MAAY,CAAoB,IAAI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