@economic/taco 2.47.0-server.3 → 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 +4 -4
- 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/index.css +11 -2
- 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 +26 -27
- 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 +36 -35
- 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 +173 -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 +23 -23
- 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 +18 -16
- 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 +44 -37
- 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 +6 -0
- package/dist/esm/packages/taco/src/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.js.map +1 -0
- 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 +59 -42
- 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 -39
- 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 +21 -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 +51 -40
- 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/types.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 -22
- 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/index.css +11 -2
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/FilterContext.d.ts +3 -0
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/Filter.d.ts +0 -1
- package/dist/primitives/Table/Core/components/Toolbar/components/Filters/components/FilterColumn.d.ts +0 -3
- package/dist/primitives/Table/types.d.ts +1 -1
- package/dist/primitives/Table/useTableManager/features/useTableServerLoading.d.ts +2 -1
- package/dist/taco.cjs.development.js +7944 -6916
- 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 -2
@@ -1,5 +1,6 @@
|
|
1
1
|
import { forwardRef, createElement } from 'react';
|
2
2
|
import cn from 'clsx';
|
3
|
+
import { extends as _extends } from '../../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
3
4
|
import { Backdrop } from '../../Backdrop/Backdrop.js';
|
4
5
|
import { getDialogPositionClassnames, getDialogSizeClassnames } from '../util.js';
|
5
6
|
import { useMergedRef } from '../../../hooks/useMergedRef.js';
|
@@ -9,22 +10,22 @@ import { Title as Title$1, Close as Close$1, Portal, Overlay, Content as Content
|
|
9
10
|
import { useCurrentDialog } from '../Context.js';
|
10
11
|
import { useDraggable } from '../../../utils/hooks/useDraggable.js';
|
11
12
|
|
12
|
-
|
13
|
-
|
13
|
+
var Title = /*#__PURE__*/forwardRef(function DialogTitle(props, ref) {
|
14
|
+
var className = cn('text-center', props.className);
|
14
15
|
return /*#__PURE__*/createElement(Title$1, Object.assign({}, props, {
|
15
16
|
className: className,
|
16
17
|
ref: ref
|
17
18
|
}));
|
18
19
|
});
|
19
|
-
|
20
|
-
|
20
|
+
var Footer = /*#__PURE__*/forwardRef(function DialogFooter(props, ref) {
|
21
|
+
var className = cn('mt-8 flex justify-end', props.className);
|
21
22
|
return /*#__PURE__*/createElement("div", Object.assign({}, props, {
|
22
23
|
className: className,
|
23
24
|
ref: ref
|
24
25
|
}), props.children);
|
25
26
|
});
|
26
|
-
|
27
|
-
|
27
|
+
var Close = /*#__PURE__*/forwardRef(function DialogClose(props, ref) {
|
28
|
+
var dialog = useCurrentDialog();
|
28
29
|
return /*#__PURE__*/createElement(Close$1, Object.assign({
|
29
30
|
onClick: dialog.onClose
|
30
31
|
}, props, {
|
@@ -32,36 +33,32 @@ const Close = /*#__PURE__*/forwardRef(function DialogClose(props, ref) {
|
|
32
33
|
asChild: true
|
33
34
|
}));
|
34
35
|
});
|
35
|
-
|
36
|
-
children,
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
const close = () => {
|
36
|
+
var RenderPropWrapper = /*#__PURE__*/forwardRef(function RenderPropWrapper(_ref, ref) {
|
37
|
+
var children = _ref.children,
|
38
|
+
onClick = _ref.onClick,
|
39
|
+
renderProps = _ref.renderProps;
|
40
|
+
var close = function close() {
|
41
41
|
onClick(new CustomEvent('close'));
|
42
42
|
};
|
43
|
-
return children({
|
44
|
-
close,
|
45
|
-
ref
|
46
|
-
|
47
|
-
});
|
43
|
+
return children(_extends({
|
44
|
+
close: close,
|
45
|
+
ref: ref
|
46
|
+
}, renderProps));
|
48
47
|
});
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
position,
|
54
|
-
dragging,
|
55
|
-
handleProps
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
const className = cn('relative bg-white animate-[fade-in_150ms] rounded', getDialogPositionClassnames(), getDialogSizeClassnames(dialog.size), 'print:w-full print:h-full print:m-0 print:overflow-visible');
|
61
|
-
const containerClassName = cn('bg-white p-6 rounded relative z-10 shadow print:p-0 print:overflow-visible print:h-full', {
|
48
|
+
var Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
49
|
+
var dialog = useCurrentDialog();
|
50
|
+
var internalRef = useMergedRef(ref);
|
51
|
+
var _useDraggable = useDraggable(internalRef),
|
52
|
+
position = _useDraggable.position,
|
53
|
+
dragging = _useDraggable.dragging,
|
54
|
+
dragHandleProps = _useDraggable.handleProps;
|
55
|
+
var _useLocalization = useLocalization(),
|
56
|
+
texts = _useLocalization.texts;
|
57
|
+
var className = cn('relative bg-white animate-[fade-in_150ms] rounded', getDialogPositionClassnames(), getDialogSizeClassnames(dialog.size), 'print:w-full print:h-full print:m-0 print:overflow-visible');
|
58
|
+
var containerClassName = cn('bg-white p-6 rounded relative z-10 shadow print:p-0 print:overflow-visible print:h-full', {
|
62
59
|
'rounded-b-none': !!dialog.elements.extra
|
63
60
|
}, props.className);
|
64
|
-
|
61
|
+
var handleEscapeKeyDown = function handleEscapeKeyDown(event) {
|
65
62
|
if (!dialog.closeOnEscape) {
|
66
63
|
event.preventDefault();
|
67
64
|
} else if (dialog.onClose) {
|
@@ -69,8 +66,10 @@ const Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
|
69
66
|
}
|
70
67
|
};
|
71
68
|
// the chosen behaviour in taco is that outside clicks do not close the dialog
|
72
|
-
|
73
|
-
|
69
|
+
var handleInteractOutside = function handleInteractOutside(event) {
|
70
|
+
return event.preventDefault();
|
71
|
+
};
|
72
|
+
var output;
|
74
73
|
if (typeof props.children === 'function') {
|
75
74
|
output = /*#__PURE__*/createElement(Close, null, /*#__PURE__*/createElement(RenderPropWrapper, {
|
76
75
|
renderProps: {
|
@@ -87,11 +86,10 @@ const Content = /*#__PURE__*/forwardRef(function DialogContent(props, ref) {
|
|
87
86
|
onEscapeKeyDown: handleEscapeKeyDown,
|
88
87
|
onInteractOutside: handleInteractOutside,
|
89
88
|
ref: internalRef,
|
90
|
-
style: {
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
}
|
89
|
+
style: _extends({}, props.style, {
|
90
|
+
left: dialog.draggable ? position.x + "px" : undefined,
|
91
|
+
top: dialog.draggable ? position.y + "px" : undefined
|
92
|
+
})
|
95
93
|
}), /*#__PURE__*/createElement("div", {
|
96
94
|
className: containerClassName,
|
97
95
|
"data-taco": "dialog"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { DialogContext, useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Localization';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { getDialogPositionClassnames, getDialogSizeClassnames } from '../util';\n\nexport type DialogContentDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogContentRenderProps = {\n close: () => void;\n drawer?: DialogContentDrawerRenderProps;\n};\n\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('text-center', props.className);\n return <DialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('mt-8 flex justify-end', props.className);\n return (\n <div {...props} className={className} ref={ref}>\n {props.children}\n </div>\n );\n});\n\nexport type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n\n return <DialogPrimitive.Close onClick={dialog.onClose} {...props} ref={ref} asChild />;\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick, renderProps }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('close'));\n };\n\n return children({ close, ref, ...renderProps });\n});\n\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': string;\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogContentRenderProps) => JSX.Element);\n onOpenAutoFocus?: DialogPrimitive.DialogContentProps['onOpenAutoFocus'];\n onCloseAutoFocus?: DialogPrimitive.DialogContentProps['onCloseAutoFocus'];\n};\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n const { position, dragging, handleProps: dragHandleProps } = useDraggable(internalRef);\n const { texts } = useLocalization();\n\n const className = cn(\n 'relative bg-white animate-[fade-in_150ms] rounded',\n getDialogPositionClassnames(),\n getDialogSizeClassnames(dialog.size),\n 'print:w-full print:h-full print:m-0 print:overflow-visible'\n );\n\n const containerClassName = cn(\n 'bg-white p-6 rounded relative z-10 shadow print:p-0 print:overflow-visible print:h-full',\n {\n 'rounded-b-none': !!dialog.elements.extra,\n },\n props.className\n );\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (!dialog.closeOnEscape) {\n event.preventDefault();\n } else if (dialog.onClose) {\n dialog.onClose();\n }\n };\n\n // the chosen behaviour in taco is that outside clicks do not close the dialog\n const handleInteractOutside = event => event.preventDefault();\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <Close>\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\n </Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay asChild>\n <Backdrop>\n <DialogPrimitive.Content\n {...props}\n className={className}\n onEscapeKeyDown={handleEscapeKeyDown}\n onInteractOutside={handleInteractOutside}\n ref={internalRef}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${position.y}px` : undefined,\n }}>\n <div className={containerClassName} data-taco=\"dialog\">\n {output}\n {dialog.draggable && (\n <div\n {...dragHandleProps}\n role=\"button\"\n draggable\n aria-grabbed={dragging}\n aria-label={texts.dialog.drag}\n className=\"yt-dialog__drag absolute-center-x bg-grey-100 top-1.5 h-3 w-24 cursor-move rounded text-center print:hidden\"\n />\n )}\n {dialog.showCloseButton ? (\n <DialogPrimitive.Close onClick={dialog.onClose} asChild>\n <IconButton\n appearance=\"discrete\"\n aria-label={texts.dialog.close}\n className=\"absolute right-0 top-0 mr-2 mt-2 print:hidden\"\n icon=\"close\"\n />\n </DialogPrimitive.Close>\n ) : null}\n </div>\n {dialog.elements.drawer}\n {dialog.elements.extra}\n </DialogPrimitive.Content>\n </Backdrop>\n </DialogPrimitive.Overlay>\n </DialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","DialogTitle","props","ref","className","cn","DialogPrimitive","Footer","DialogFooter","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","RenderPropWrapper","renderProps","close","CustomEvent","Content","DialogContent","internalRef","useMergedRef","position","dragging","handleProps","dragHandleProps","useDraggable","texts","useLocalization","getDialogPositionClassnames","getDialogSizeClassnames","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","style","left","draggable","x","undefined","top","y","role","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;MAmBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,WAAWA,CAACC,KAAuB,EAAEC,GAAkC;EAClH,MAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAAqB,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AAC/E,CAAC;MAGYI,MAAM,gBAAGP,UAAgB,CAAC,SAASQ,YAAY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AkB;iBAAY;KACzCQ,MAAM,EACN/B,MAAM,CAACsC,SAAS,kBACblD,uCACQ4B,eAAe;IACnB2B,IAAI,EAAC,QAAQ;IACbL,SAAS;oBACKxB,QAAQ;kBACVI,KAAK,CAAClB,MAAM,CAAC4C,IAAI;IAC7BpD,SAAS,EAAC;KACZ,CACL,EACAQ,MAAM,CAAC6C,eAAe,iBACnBzD,cAACM,OAAqB;IAACQ,OAAO,EAAEF,MAAM,CAACG,OAAO;IAAEC,OAAO;kBACnDhB,cAAC0D,UAAU;IACPC,UAAU,EAAC,UAAU;kBACT7B,KAAK,CAAClB,MAAM,CAACO,KAAK;IAC9Bf,SAAS,EAAC,+CAA+C;IACzDwD,IAAI,EAAC;IACP,CACkB,IACxB,IAAI,CACN,EACLhD,MAAM,CAACwB,QAAQ,CAACQ,MAAM,EACtBhC,MAAM,CAACwB,QAAQ,CAACC,KAAK,CACA,CACnB,CACW,CACL;AAEjC,CAAC;;;;"}
|
1
|
+
{"version":3,"file":"Content.js","sources":["../../../../../../../../src/components/Dialog/components/Content.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useMergedRef } from '../../../hooks/useMergedRef';\nimport { useDraggable } from '../../../utils/hooks/useDraggable';\nimport { DialogContext, useCurrentDialog } from '../Context';\nimport { useLocalization } from '../../Provider/Localization';\nimport { IconButton } from '../../IconButton/IconButton';\nimport { Backdrop } from '../../Backdrop/Backdrop';\nimport { getDialogPositionClassnames, getDialogSizeClassnames } from '../util';\n\nexport type DialogContentDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogContentRenderProps = {\n close: () => void;\n drawer?: DialogContentDrawerRenderProps;\n};\n\nexport type DialogTitleProps = React.HTMLAttributes<HTMLHeadingElement>;\nexport const Title = React.forwardRef(function DialogTitle(props: DialogTitleProps, ref: React.Ref<HTMLHeadingElement>) {\n const className = cn('text-center', props.className);\n return <DialogPrimitive.Title {...props} className={className} ref={ref} />;\n});\n\nexport type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;\nexport const Footer = React.forwardRef(function DialogFooter(props: DialogFooterProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('mt-8 flex justify-end', props.className);\n return (\n <div {...props} className={className} ref={ref}>\n {props.children}\n </div>\n );\n});\n\nexport type DialogCloseProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Close = React.forwardRef(function DialogClose(props: DialogCloseProps, ref: React.Ref<HTMLButtonElement>) {\n const dialog = useCurrentDialog();\n\n return <DialogPrimitive.Close onClick={dialog.onClose} {...props} ref={ref} asChild />;\n});\n\nconst RenderPropWrapper = React.forwardRef(function RenderPropWrapper({ children, onClick, renderProps }: any, ref) {\n const close = () => {\n onClick(new CustomEvent('close'));\n };\n\n return children({ close, ref, ...renderProps });\n});\n\nexport type DialogContentProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {\n /** An accessible label to be announced when the dialog is opened */\n 'aria-label': string;\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogContentRenderProps) => JSX.Element);\n onOpenAutoFocus?: DialogPrimitive.DialogContentProps['onOpenAutoFocus'];\n onCloseAutoFocus?: DialogPrimitive.DialogContentProps['onCloseAutoFocus'];\n};\nexport const Content = React.forwardRef(function DialogContent(props: DialogContentProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const internalRef = useMergedRef<HTMLDivElement>(ref);\n const { position, dragging, handleProps: dragHandleProps } = useDraggable(internalRef);\n const { texts } = useLocalization();\n\n const className = cn(\n 'relative bg-white animate-[fade-in_150ms] rounded',\n getDialogPositionClassnames(),\n getDialogSizeClassnames(dialog.size),\n 'print:w-full print:h-full print:m-0 print:overflow-visible'\n );\n\n const containerClassName = cn(\n 'bg-white p-6 rounded relative z-10 shadow print:p-0 print:overflow-visible print:h-full',\n {\n 'rounded-b-none': !!dialog.elements.extra,\n },\n props.className\n );\n\n const handleEscapeKeyDown = (event: KeyboardEvent) => {\n if (!dialog.closeOnEscape) {\n event.preventDefault();\n } else if (dialog.onClose) {\n dialog.onClose();\n }\n };\n\n // the chosen behaviour in taco is that outside clicks do not close the dialog\n const handleInteractOutside = event => event.preventDefault();\n\n let output;\n\n if (typeof props.children === 'function') {\n output = (\n <Close>\n <RenderPropWrapper renderProps={{ drawer: dialog.drawer }}>{props.children}</RenderPropWrapper>\n </Close>\n );\n } else {\n output = props.children;\n }\n\n return (\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay asChild>\n <Backdrop>\n <DialogPrimitive.Content\n {...props}\n className={className}\n onEscapeKeyDown={handleEscapeKeyDown}\n onInteractOutside={handleInteractOutside}\n ref={internalRef}\n style={{\n ...props.style,\n left: dialog.draggable ? `${position.x}px` : undefined,\n top: dialog.draggable ? `${position.y}px` : undefined,\n }}>\n <div className={containerClassName} data-taco=\"dialog\">\n {output}\n {dialog.draggable && (\n <div\n {...dragHandleProps}\n role=\"button\"\n draggable\n aria-grabbed={dragging}\n aria-label={texts.dialog.drag}\n className=\"yt-dialog__drag absolute-center-x bg-grey-100 top-1.5 h-3 w-24 cursor-move rounded text-center print:hidden\"\n />\n )}\n {dialog.showCloseButton ? (\n <DialogPrimitive.Close onClick={dialog.onClose} asChild>\n <IconButton\n appearance=\"discrete\"\n aria-label={texts.dialog.close}\n className=\"absolute right-0 top-0 mr-2 mt-2 print:hidden\"\n icon=\"close\"\n />\n </DialogPrimitive.Close>\n ) : null}\n </div>\n {dialog.elements.drawer}\n {dialog.elements.extra}\n </DialogPrimitive.Content>\n </Backdrop>\n </DialogPrimitive.Overlay>\n </DialogPrimitive.Portal>\n );\n});\n"],"names":["Title","React","DialogTitle","props","ref","className","cn","DialogPrimitive","Footer","DialogFooter","children","Close","DialogClose","dialog","useCurrentDialog","onClick","onClose","asChild","RenderPropWrapper","_ref","renderProps","close","CustomEvent","_extends","Content","DialogContent","internalRef","useMergedRef","_useDraggable","useDraggable","position","dragging","dragHandleProps","handleProps","_useLocalization","useLocalization","texts","getDialogPositionClassnames","getDialogSizeClassnames","size","containerClassName","elements","extra","handleEscapeKeyDown","event","closeOnEscape","preventDefault","handleInteractOutside","output","drawer","Backdrop","onEscapeKeyDown","onInteractOutside","style","left","draggable","x","undefined","top","y","role","drag","showCloseButton","IconButton","appearance","icon"],"mappings":";;;;;;;;;;;;IAmBaA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,WAAWA,CAACC,KAAuB,EAAEC,GAAkC;EAClH,IAAMC,SAAS,GAAGC,EAAE,CAAC,aAAa,EAAEH,KAAK,CAACE,SAAS,CAAC;EACpD,oBAAOJ,cAACM,OAAqB,oBAAKJ,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;KAAO;AAC/E,CAAC;IAGYI,MAAM,gBAAGP,UAAgB,CAAC,SAASQ,YAAYA,CAACN,KAAwB,EAAEC,GAA8B;EACjH,IAAMC,SAAS,GAAGC,EAAE,CAAC,uBAAuB,EAAEH,KAAK,CAACE,SAAS,CAAC;EAC9D,oBACIJ,uCAASE,KAAK;IAAEE,SAAS,EAAEA,SAAS;IAAED,GAAG,EAAEA;MACtCD,KAAK,CAACO,QAAQ,CACb;AAEd,CAAC;IAIYC,KAAK,gBAAGV,UAAgB,CAAC,SAASW,WAAWA,CAACT,KAAuB,EAAEC,GAAiC;EACjH,IAAMS,MAAM,GAAGC,gBAAgB,EAAE;EAEjC,oBAAOb,cAACM,OAAqB;IAACQ,OAAO,EAAEF,MAAM,CAACG;KAAab,KAAK;IAAEC,GAAG,EAAEA,GAAG;IAAEa,OAAO;KAAG;AAC1F,CAAC;AAED,IAAMC,iBAAiB,gBAAGjB,UAAgB,CAAC,SAASiB,iBAAiBA,CAAAC,IAAA,EAA0Cf,GAAG;MAA1CM,QAAQ,GAAAS,IAAA,CAART,QAAQ;IAAEK,OAAO,GAAAI,IAAA,CAAPJ,OAAO;IAAEK,WAAW,GAAAD,IAAA,CAAXC,WAAW;EAClG,IAAMC,KAAK,GAAG,SAARA,KAAKA;I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IACP,CACkB,IACxB,IAAI,CACN,EACLpD,MAAM,CAAC4B,QAAQ,CAACQ,MAAM,EACtBpC,MAAM,CAAC4B,QAAQ,CAACC,KAAK,CACA,CACnB,CACW,CACL;AAEjC,CAAC;;;;"}
|
@@ -3,10 +3,10 @@ import cn from 'clsx';
|
|
3
3
|
import { useCurrentDialog } from '../Context.js';
|
4
4
|
import { motion } from 'framer-motion';
|
5
5
|
|
6
|
-
|
6
|
+
var DialogDrawer = /*#__PURE__*/forwardRef(function DialogDrawer(props, ref) {
|
7
7
|
var _dialog$drawer, _dialog$drawer2;
|
8
|
-
|
9
|
-
|
8
|
+
var dialog = useCurrentDialog();
|
9
|
+
var className = cn('absolute top-0 -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left', props.className);
|
10
10
|
return /*#__PURE__*/createElement(motion.div, Object.assign({}, props, {
|
11
11
|
className: className,
|
12
12
|
"data-taco": "dialog-drawer",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DialogDrawer.js","sources":["../../../../../../../../src/components/Dialog/components/DialogDrawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { motion } from 'framer-motion';\nimport cn from 'clsx';\nimport { DialogContext, useCurrentDialog } from '../Context';\n\nexport type DialogDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n> & {\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogDrawerRenderProps) => React.ReactNode);\n};\n\nconst DialogDrawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const className = cn(\n 'absolute top-0 -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left',\n props.className\n );\n\n return (\n <motion.div\n {...props}\n className={className}\n data-taco=\"dialog-drawer\"\n aria-hidden={!dialog.drawer?.open}\n variants={{\n visible: {\n left: '100%',\n display: 'block',\n transition: { ease: 'easeOut', duration: 0.2 },\n },\n hidden: {\n left: '0%',\n transition: { ease: 'easeOut', duration: 0.2 },\n transitionEnd: {\n display: 'none',\n },\n },\n }}\n animate={dialog.drawer?.open ? 'visible' : 'hidden'}\n ref={ref}>\n {typeof props.children === 'function' ? props.children(dialog.drawer) : props.children}\n </motion.div>\n );\n});\nDialogDrawer.displayName = 'DialogDrawer';\n\nexport { DialogDrawer };\n"],"names":["DialogDrawer","React","props","ref","dialog","useCurrentDialog","className","cn","motion","div","_dialog$drawer","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate","_dialog$drawer2","children","displayName"],"mappings":";;;;;
|
1
|
+
{"version":3,"file":"DialogDrawer.js","sources":["../../../../../../../../src/components/Dialog/components/DialogDrawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { motion } from 'framer-motion';\nimport cn from 'clsx';\nimport { DialogContext, useCurrentDialog } from '../Context';\n\nexport type DialogDrawerRenderProps = DialogContext['drawer'];\n\nexport type DialogDrawerProps = Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag'\n> & {\n children: Omit<React.ReactNode, 'Function'> | ((props: DialogDrawerRenderProps) => React.ReactNode);\n};\n\nconst DialogDrawer = React.forwardRef(function DialogDrawer(props: DialogDrawerProps, ref: React.Ref<HTMLDivElement>) {\n const dialog = useCurrentDialog();\n const className = cn(\n 'absolute top-0 -ml-[4px] hidden h-full w-full overflow-y-auto rounded-r bg-white p-6 text-left',\n props.className\n );\n\n return (\n <motion.div\n {...props}\n className={className}\n data-taco=\"dialog-drawer\"\n aria-hidden={!dialog.drawer?.open}\n variants={{\n visible: {\n left: '100%',\n display: 'block',\n transition: { ease: 'easeOut', duration: 0.2 },\n },\n hidden: {\n left: '0%',\n transition: { ease: 'easeOut', duration: 0.2 },\n transitionEnd: {\n display: 'none',\n },\n },\n }}\n animate={dialog.drawer?.open ? 'visible' : 'hidden'}\n ref={ref}>\n {typeof props.children === 'function' ? props.children(dialog.drawer) : props.children}\n </motion.div>\n );\n});\nDialogDrawer.displayName = 'DialogDrawer';\n\nexport { DialogDrawer };\n"],"names":["DialogDrawer","React","props","ref","dialog","useCurrentDialog","className","cn","motion","div","_dialog$drawer","drawer","open","variants","visible","left","display","transition","ease","duration","hidden","transitionEnd","animate","_dialog$drawer2","children","displayName"],"mappings":";;;;;IAcMA,YAAY,gBAAGC,UAAgB,CAAC,SAASD,YAAYA,CAACE,KAAwB,EAAEC,GAA8B;;EAChH,IAAMC,MAAM,GAAGC,gBAAgB,EAAE;EACjC,IAAMC,SAAS,GAAGC,EAAE,CAChB,iGAAiG,EACjGL,KAAK,CAACI,SAAS,CAClB;EAED,oBACIL,cAACO,MAAM,CAACC,GAAG,oBACHP,KAAK;IACTI,SAAS,EAAEA,SAAS;iBACV,eAAe;mBACZ,GAAAI,cAAA,GAACN,MAAM,CAACO,MAAM,cAAAD,cAAA,eAAbA,cAAA,CAAeE,IAAI;IACjCC,QAAQ,EAAE;MACNC,OAAO,EAAE;QACLC,IAAI,EAAE,MAAM;QACZC,OAAO,EAAE,OAAO;QAChBC,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAS;UAAEC,QAAQ,EAAE;;OAC5C;MACDC,MAAM,EAAE;QACJL,IAAI,EAAE,IAAI;QACVE,UAAU,EAAE;UAAEC,IAAI,EAAE,SAAS;UAAEC,QAAQ,EAAE;SAAK;QAC9CE,aAAa,EAAE;UACXL,OAAO,EAAE;;;KAGpB;IACDM,OAAO,EAAE,CAAAC,eAAA,GAAAnB,MAAM,CAACO,MAAM,cAAAY,eAAA,eAAbA,eAAA,CAAeX,IAAI,GAAG,SAAS,GAAG,QAAQ;IACnDT,GAAG,EAAEA;MACJ,OAAOD,KAAK,CAACsB,QAAQ,KAAK,UAAU,GAAGtB,KAAK,CAACsB,QAAQ,CAACpB,MAAM,CAACO,MAAM,CAAC,GAAGT,KAAK,CAACsB,QAAQ,CAC7E;AAErB,CAAC;AACDxB,YAAY,CAACyB,WAAW,GAAG,cAAc;;;;"}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { forwardRef, createElement } from 'react';
|
2
2
|
import cn from 'clsx';
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
var Extra = /*#__PURE__*/forwardRef(function DialogExtra(props, ref) {
|
5
|
+
var className = cn('wcag-grey-100 absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left', props.className);
|
6
6
|
return /*#__PURE__*/createElement("div", Object.assign({}, props, {
|
7
7
|
className: className,
|
8
8
|
"data-taco": "dialog-extra",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Extra.js","sources":["../../../../../../../../src/components/Dialog/components/Extra.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\n\nexport type DialogExtraProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst Extra = React.forwardRef(function DialogExtra(props: DialogExtraProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn(\n 'wcag-grey-100 absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left',\n props.className\n );\n\n return <div {...props} className={className} data-taco=\"dialog-extra\" ref={ref} />;\n});\nExtra.displayName = 'DialogExtra';\n\nexport { Extra };\n"],"names":["Extra","React","DialogExtra","props","ref","className","cn","displayName"],"mappings":";;;
|
1
|
+
{"version":3,"file":"Extra.js","sources":["../../../../../../../../src/components/Dialog/components/Extra.tsx"],"sourcesContent":["import * as React from 'react';\nimport cn from 'clsx';\n\nexport type DialogExtraProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst Extra = React.forwardRef(function DialogExtra(props: DialogExtraProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn(\n 'wcag-grey-100 absolute top-full left-0 -mt-px w-full rounded-t-none rounded-b p-6 text-left',\n props.className\n );\n\n return <div {...props} className={className} data-taco=\"dialog-extra\" ref={ref} />;\n});\nExtra.displayName = 'DialogExtra';\n\nexport { Extra };\n"],"names":["Extra","React","DialogExtra","props","ref","className","cn","displayName"],"mappings":";;;IAKMA,KAAK,gBAAGC,UAAgB,CAAC,SAASC,WAAWA,CAACC,KAAuB,EAAEC,GAA8B;EACvG,IAAMC,SAAS,GAAGC,EAAE,CAChB,6FAA6F,EAC7FH,KAAK,CAACE,SAAS,CAClB;EAED,oBAAOJ,uCAASE,KAAK;IAAEE,SAAS,EAAEA,SAAS;iBAAY,cAAc;IAACD,GAAG,EAAEA;KAAO;AACtF,CAAC;AACDJ,KAAK,CAACO,WAAW,GAAG,aAAa;;;;"}
|
@@ -3,12 +3,11 @@ import { mergeRefs } from '../../../utils/mergeRefs.js';
|
|
3
3
|
import { Trigger as Trigger$1 } from '@radix-ui/react-dialog';
|
4
4
|
import { useCurrentDialog } from '../Context.js';
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
ref
|
9
|
-
props
|
10
|
-
|
11
|
-
const refCallback = mergeRefs([parentRef, externalRef]);
|
6
|
+
var Trigger = /*#__PURE__*/forwardRef(function DialogTrigger(props, externalRef) {
|
7
|
+
var _useCurrentDialog = useCurrentDialog(),
|
8
|
+
parentRef = _useCurrentDialog.ref,
|
9
|
+
parentProps = _useCurrentDialog.props;
|
10
|
+
var refCallback = mergeRefs([parentRef, externalRef]);
|
12
11
|
return /*#__PURE__*/createElement(Trigger$1, Object.assign({}, parentProps, props, {
|
13
12
|
ref: refCallback,
|
14
13
|
asChild: true
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Trigger.js","sources":["../../../../../../../../src/components/Dialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useCurrentDialog } from '../Context';\nimport { mergeRefs } from '../../../utils/mergeRefs';\n\nexport type DialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Trigger = React.forwardRef(function DialogTrigger(\n props: DialogTriggerProps,\n externalRef: React.Ref<HTMLButtonElement>\n) {\n const { ref: parentRef, props: parentProps } = useCurrentDialog();\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n return <DialogPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild />;\n});\n"],"names":["Trigger","React","DialogTrigger","props","externalRef","
|
1
|
+
{"version":3,"file":"Trigger.js","sources":["../../../../../../../../src/components/Dialog/components/Trigger.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { useCurrentDialog } from '../Context';\nimport { mergeRefs } from '../../../utils/mergeRefs';\n\nexport type DialogTriggerProps = React.HTMLAttributes<HTMLButtonElement>;\n\nexport const Trigger = React.forwardRef(function DialogTrigger(\n props: DialogTriggerProps,\n externalRef: React.Ref<HTMLButtonElement>\n) {\n const { ref: parentRef, props: parentProps } = useCurrentDialog();\n const refCallback = mergeRefs([parentRef, externalRef]);\n\n return <DialogPrimitive.Trigger {...parentProps} {...props} ref={refCallback} asChild />;\n});\n"],"names":["Trigger","React","DialogTrigger","props","externalRef","_useCurrentDialog","useCurrentDialog","parentRef","ref","parentProps","refCallback","mergeRefs","DialogPrimitive","asChild"],"mappings":";;;;;IAOaA,OAAO,gBAAGC,UAAgB,CAAC,SAASC,aAAaA,CAC1DC,KAAyB,EACzBC,WAAyC;EAEzC,IAAAC,iBAAA,GAA+CC,gBAAgB,EAAE;IAApDC,SAAS,GAAAF,iBAAA,CAAdG,GAAG;IAAoBC,WAAW,GAAAJ,iBAAA,CAAlBF,KAAK;EAC7B,IAAMO,WAAW,GAAGC,SAAS,CAAC,CAACJ,SAAS,EAAEH,WAAW,CAAC,CAAC;EAEvD,oBAAOH,cAACW,SAAuB,oBAAKH,WAAW,EAAMN,KAAK;IAAEK,GAAG,EAAEE,WAAW;IAAEG,OAAO;KAAG;AAC5F,CAAC;;;;"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
var getDialogSizeClassnames = function getDialogSizeClassnames(size) {
|
2
2
|
switch (size) {
|
3
3
|
case 'dialog':
|
4
4
|
return 'w-128';
|
@@ -12,8 +12,12 @@ const getDialogSizeClassnames = size => {
|
|
12
12
|
return 'w-lg';
|
13
13
|
}
|
14
14
|
};
|
15
|
-
|
16
|
-
|
15
|
+
var getDialogPositionClassnames = function getDialogPositionClassnames() {
|
16
|
+
return 'mt-16 mx-auto';
|
17
|
+
};
|
18
|
+
var getDialogStylingClassnames = function getDialogStylingClassnames() {
|
19
|
+
return 'bg-white rounded animate-[fade-in_150ms] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]';
|
20
|
+
};
|
17
21
|
|
18
22
|
export { getDialogPositionClassnames, getDialogSizeClassnames, getDialogStylingClassnames };
|
19
23
|
//# sourceMappingURL=util.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Dialog/util.ts"],"sourcesContent":["import { DialogSize } from './types';\n\nexport const getDialogSizeClassnames = (size: DialogSize) => {\n switch (size) {\n case 'dialog':\n return 'w-128';\n case 'xs':\n return 'w-xs';\n case 'sm':\n return 'w-sm';\n case 'md':\n return 'w-md';\n case 'lg':\n return 'w-lg';\n }\n};\n\nexport const getDialogPositionClassnames = () => 'mt-16 mx-auto';\n\nexport const getDialogStylingClassnames = () =>\n 'bg-white rounded animate-[fade-in_150ms] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]';\n"],"names":["getDialogSizeClassnames","size","getDialogPositionClassnames","getDialogStylingClassnames"],"mappings":"
|
1
|
+
{"version":3,"file":"util.js","sources":["../../../../../../../src/components/Dialog/util.ts"],"sourcesContent":["import { DialogSize } from './types';\n\nexport const getDialogSizeClassnames = (size: DialogSize) => {\n switch (size) {\n case 'dialog':\n return 'w-128';\n case 'xs':\n return 'w-xs';\n case 'sm':\n return 'w-sm';\n case 'md':\n return 'w-md';\n case 'lg':\n return 'w-lg';\n }\n};\n\nexport const getDialogPositionClassnames = () => 'mt-16 mx-auto';\n\nexport const getDialogStylingClassnames = () =>\n 'bg-white rounded animate-[fade-in_150ms] shadow-[0_6px_9px_0_rgba(89,85,98,0.3),0_0_1px_0_rgba(89,85,98,0.2)]';\n"],"names":["getDialogSizeClassnames","size","getDialogPositionClassnames","getDialogStylingClassnames"],"mappings":"IAEaA,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAIC,IAAgB;EACpD,QAAQA,IAAI;IACR,KAAK,QAAQ;MACT,OAAO,OAAO;IAClB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;IACjB,KAAK,IAAI;MACL,OAAO,MAAM;;AAEzB;IAEaC,2BAA2B,GAAG,SAA9BA,2BAA2BA;EAAA,OAAS,eAAe;AAAA;IAEnDC,0BAA0B,GAAG,SAA7BA,0BAA0BA;EAAA,OACnC,+GAA+G;AAAA;;;;"}
|
@@ -1,18 +1,18 @@
|
|
1
1
|
import { createContext, useContext } from 'react';
|
2
2
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
4
|
-
|
4
|
+
var DrawerContext = /*#__PURE__*/createContext({
|
5
5
|
closeOnEscape: true,
|
6
6
|
showCloseButton: true,
|
7
|
-
onClickBack: ()
|
8
|
-
onClose: ()
|
9
|
-
onResize: ()
|
7
|
+
onClickBack: function onClickBack() {},
|
8
|
+
onClose: function onClose() {},
|
9
|
+
onResize: function onResize() {},
|
10
10
|
props: {},
|
11
11
|
ref: null,
|
12
12
|
size: 'md',
|
13
13
|
variant: 'embedded'
|
14
14
|
});
|
15
|
-
|
15
|
+
var useCurrentDrawer = function useCurrentDrawer() {
|
16
16
|
return useContext(DrawerContext);
|
17
17
|
};
|
18
18
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Context.js","sources":["../../../../../../../src/components/Drawer/Context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport * as React from 'react';\nimport { DrawerSize, DrawerVariant } from './types';\n\nexport type DrawerContext = {\n closeOnEscape: boolean;\n showCloseButton: boolean;\n onClickBack?: () => void;\n onClose?: () => void;\n onResize?: (delta: number) => void;\n props: {};\n ref: React.Ref<HTMLElement>;\n size: DrawerSize;\n open?: boolean;\n setOpen?: (open: boolean) => void;\n variant: DrawerVariant;\n focusTrap?: boolean;\n outlet?: HTMLElement;\n};\n\nexport const DrawerContext = React.createContext<DrawerContext>({\n closeOnEscape: true,\n showCloseButton: true,\n onClickBack: () => {},\n onClose: () => {},\n onResize: () => {},\n props: {},\n ref: null,\n size: 'md',\n variant: 'embedded',\n});\n\nexport const useCurrentDrawer = () => {\n return React.useContext(DrawerContext);\n};\n"],"names":["DrawerContext","React","closeOnEscape","showCloseButton","onClickBack","onClose","onResize","props","ref","size","variant","useCurrentDrawer"],"mappings":";;AAAA;
|
1
|
+
{"version":3,"file":"Context.js","sources":["../../../../../../../src/components/Drawer/Context.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-empty-function */\nimport * as React from 'react';\nimport { DrawerSize, DrawerVariant } from './types';\n\nexport type DrawerContext = {\n closeOnEscape: boolean;\n showCloseButton: boolean;\n onClickBack?: () => void;\n onClose?: () => void;\n onResize?: (delta: number) => void;\n props: {};\n ref: React.Ref<HTMLElement>;\n size: DrawerSize;\n open?: boolean;\n setOpen?: (open: boolean) => void;\n variant: DrawerVariant;\n focusTrap?: boolean;\n outlet?: HTMLElement;\n};\n\nexport const DrawerContext = React.createContext<DrawerContext>({\n closeOnEscape: true,\n showCloseButton: true,\n onClickBack: () => {},\n onClose: () => {},\n onResize: () => {},\n props: {},\n ref: null,\n size: 'md',\n variant: 'embedded',\n});\n\nexport const useCurrentDrawer = () => {\n return React.useContext(DrawerContext);\n};\n"],"names":["DrawerContext","React","closeOnEscape","showCloseButton","onClickBack","onClose","onResize","props","ref","size","variant","useCurrentDrawer"],"mappings":";;AAAA;IAoBaA,aAAa,gBAAGC,aAAmB,CAAgB;EAC5DC,aAAa,EAAE,IAAI;EACnBC,eAAe,EAAE,IAAI;EACrBC,WAAW,EAAE,SAAAA,gBAAQ;EACrBC,OAAO,EAAE,SAAAA,YAAQ;EACjBC,QAAQ,EAAE,SAAAA,aAAQ;EAClBC,KAAK,EAAE,EAAE;EACTC,GAAG,EAAE,IAAI;EACTC,IAAI,EAAE,IAAI;EACVC,OAAO,EAAE;CACZ;IAEYC,gBAAgB,GAAG,SAAnBA,gBAAgBA;EACzB,OAAOV,UAAgB,CAACD,aAAa,CAAC;AAC1C;;;;"}
|
@@ -1,15 +1,17 @@
|
|
1
1
|
import { forwardRef, useState, useMemo, useCallback, useEffect, createElement } from 'react';
|
2
2
|
import cn from 'clsx';
|
3
|
+
import { objectWithoutPropertiesLoose as _objectWithoutPropertiesLoose } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
3
4
|
import { Root } from '@radix-ui/react-dialog';
|
4
5
|
import { DrawerContext } from './Context.js';
|
5
6
|
import { Content, InnerContent, Title, Footer, Close, Actions } from './components/Content.js';
|
6
7
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
7
8
|
import { Trigger } from './components/Trigger.js';
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
var _excluded = ["open", "defaultOpen", "onChange", "variant", "className", "closeOnEscape", "onResize", "onClose", "onClickBack", "size", "trigger", "children", "focusTrap", "showCloseButton", "outletName"];
|
11
|
+
var DEFAULT_OUTLET_NAME = 'default';
|
12
|
+
var Outlet = /*#__PURE__*/forwardRef(function Outlet(props, ref) {
|
11
13
|
var _props$name;
|
12
|
-
|
14
|
+
var className = cn('h-full ml-auto overflow-hidden flex-shrink-0', props.className);
|
13
15
|
return /*#__PURE__*/createElement("div", Object.assign({}, props, {
|
14
16
|
className: className,
|
15
17
|
"data-taco": "drawer-outlet",
|
@@ -18,62 +20,70 @@ const Outlet = /*#__PURE__*/forwardRef(function Outlet(props, ref) {
|
|
18
20
|
}));
|
19
21
|
});
|
20
22
|
// drawerStack getting set by previous drawer instance, to be able to close previous instance, when new instance getting opened.
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
onChange = () => {
|
23
|
+
var drawerStack;
|
24
|
+
var Drawer = /*#__PURE__*/forwardRef(function Drawer(props, ref) {
|
25
|
+
var openProp = props.open,
|
26
|
+
defaultOpenProp = props.defaultOpen,
|
27
|
+
_props$onChange = props.onChange,
|
28
|
+
onChange = _props$onChange === void 0 ? function () {
|
28
29
|
// do nothing.
|
29
|
-
},
|
30
|
-
variant =
|
31
|
-
|
32
|
-
closeOnEscape =
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
30
|
+
} : _props$onChange,
|
31
|
+
_props$variant = props.variant,
|
32
|
+
variant = _props$variant === void 0 ? 'embedded' : _props$variant,
|
33
|
+
_props$closeOnEscape = props.closeOnEscape,
|
34
|
+
closeOnEscape = _props$closeOnEscape === void 0 ? true : _props$closeOnEscape,
|
35
|
+
onResize = props.onResize,
|
36
|
+
onClose = props.onClose,
|
37
|
+
onClickBack = props.onClickBack,
|
38
|
+
_props$size = props.size,
|
39
|
+
size = _props$size === void 0 ? 'md' : _props$size,
|
40
|
+
trigger = props.trigger,
|
41
|
+
children = props.children,
|
42
|
+
_props$focusTrap = props.focusTrap,
|
43
|
+
focusTrap = _props$focusTrap === void 0 ? props.focusTrap === undefined && props.variant === 'overlay' ? true : props.focusTrap : _props$focusTrap,
|
44
|
+
_props$showCloseButto = props.showCloseButton,
|
45
|
+
showCloseButton = _props$showCloseButto === void 0 ? true : _props$showCloseButto,
|
46
|
+
outletName = props.outletName,
|
47
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
48
|
+
var _useControllableState = useControllableState({
|
49
|
+
prop: openProp,
|
50
|
+
defaultProp: defaultOpenProp,
|
51
|
+
onChange: onChange
|
52
|
+
}),
|
53
|
+
open = _useControllableState[0],
|
54
|
+
setOpen = _useControllableState[1];
|
55
|
+
var _React$useState = useState(),
|
56
|
+
outlet = _React$useState[0],
|
57
|
+
setOutlet = _React$useState[1];
|
58
|
+
var context = useMemo(function () {
|
59
|
+
return {
|
60
|
+
closeOnEscape: closeOnEscape,
|
61
|
+
onClickBack: onClickBack,
|
62
|
+
onClose: onClose,
|
63
|
+
onResize: onResize,
|
64
|
+
props: otherProps,
|
65
|
+
size: size,
|
66
|
+
ref: ref,
|
67
|
+
open: open,
|
68
|
+
setOpen: setOpen,
|
69
|
+
variant: variant,
|
70
|
+
focusTrap: focusTrap,
|
71
|
+
showCloseButton: showCloseButton,
|
72
|
+
outlet: outlet
|
73
|
+
};
|
74
|
+
}, [closeOnEscape, open, setOpen, otherProps, variant, onResize, onClose, size, focusTrap, showCloseButton, outlet, onClickBack]);
|
65
75
|
// this prevents two drawers being open at once and used when one drawer getting opened before another one got closed.
|
66
|
-
|
76
|
+
var close = useCallback(function () {
|
67
77
|
setOpen(false);
|
68
78
|
onClose && onClose();
|
69
79
|
}, []);
|
70
|
-
useEffect(()
|
80
|
+
useEffect(function () {
|
71
81
|
var _document$querySelect;
|
72
|
-
|
73
|
-
|
82
|
+
var outletSelector = "[data-taco=\"drawer-outlet\"][data-taco-outlet-name=\"" + (outletName !== null && outletName !== void 0 ? outletName : DEFAULT_OUTLET_NAME) + "\"]";
|
83
|
+
var outletElement = (_document$querySelect = document.querySelector(outletSelector)) !== null && _document$querySelect !== void 0 ? _document$querySelect : document.body;
|
74
84
|
setOutlet(outletElement);
|
75
85
|
}, [outletName]);
|
76
|
-
useEffect(()
|
86
|
+
useEffect(function () {
|
77
87
|
if (open) {
|
78
88
|
// if drawerStack is defined, this means that another drawer was opened before
|
79
89
|
if (drawerStack) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Drawer.js","sources":["../../../../../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Actions,\n Footer,\n InnerContent,\n DrawerInnerContentProps,\n DrawerFooterProps,\n DrawerTitleProps,\n Title,\n Close,\n Content,\n DrawerContentProps,\n DrawerCloseProps,\n} from './components/Content';\nimport { GroupProps } from '../Group/Group';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport cn from 'clsx';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { DrawerTriggerProps, Trigger } from './components/Trigger';\nimport { DrawerContext } from './Context';\nimport { DrawerSize, DrawerVariant } from './types';\n\nexport type DrawerTexts = {\n /**\n * Aria-label for back icon button in drawer.\n */\n back: string;\n /**\n * Aria-label for close icon button in drawer.\n */\n close: string;\n};\n\nexport type DrawerProps = Omit<DialogProps, 'draggable' | 'size'> & {\n children: React.ReactNode | React.ReactNode[];\n /** Size of the drawer. This is the recommended way to set a size for drawer component. */\n size?: DrawerSize;\n /** When `true`, pressing escape will close the drawer */\n closeOnEscape?: boolean;\n /** Set whether the drawer is open by default or not, use when not providing a trigger */\n defaultOpen?: boolean;\n /** Handles the back button click and determines its visibility */\n onClickBack?: () => void;\n /** Handler called when drawer closes by user interaction */\n onClose?: () => void;\n /** Called when the drawer opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean | undefined) => void;\n /** Control the open state of the drawer from outside the component */\n open?: boolean;\n /** A trigger to be used for the drawer, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n /** Triggers when resizing, can be throttled or debounced for better performances */\n onResize?: (delta: number) => void;\n /** Rendering variant of the drawer */\n variant?: DrawerVariant;\n /** className for children container, needed for embedded version, in cases where we might need to control children height */\n className?: string;\n /** When 'true' preventing focus from leaving drawer content */\n focusTrap?: boolean;\n /** When 'true' renders close button in topr right cornenr of drawer content */\n showCloseButton?: boolean;\n /** Target specific named outlet allowing you to render a drawer to a specific outlet */\n outletName?: string;\n};\n\nexport type OutletProps = React.HTMLAttributes<HTMLDivElement> & {\n name?: string;\n};\n\nconst DEFAULT_OUTLET_NAME = 'default';\n\nconst Outlet = React.forwardRef(function Outlet(props: OutletProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('h-full ml-auto overflow-hidden flex-shrink-0', props.className);\n return (\n <div\n {...props}\n className={className}\n data-taco=\"drawer-outlet\"\n data-taco-outlet-name={props.name ?? DEFAULT_OUTLET_NAME}\n ref={ref}\n />\n );\n});\n\n// drawerStack getting set by previous drawer instance, to be able to close previous instance, when new instance getting opened.\nlet drawerStack: undefined | (() => void);\n\nexport type ForwardedDrawerWithStatics = React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DrawerTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;\n InnerContent: React.ForwardRefExoticComponent<DrawerInnerContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<DrawerTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<DrawerFooterProps & React.RefAttributes<HTMLDivElement>>;\n Close: React.ForwardRefExoticComponent<DrawerCloseProps & React.RefAttributes<HTMLButtonElement>>;\n Actions: React.ForwardRefExoticComponent<GroupProps & React.RefAttributes<HTMLDivElement>>;\n Outlet: React.ForwardRefExoticComponent<OutletProps & React.RefAttributes<HTMLDivElement>>;\n};\n\nexport const Drawer = React.forwardRef(function Drawer(props: DrawerProps, ref: React.Ref<HTMLElement>) {\n const {\n open: openProp,\n defaultOpen: defaultOpenProp,\n // if onChange is not provided, then replace it with empty function, needed for useControllableState\n onChange = () => {\n // do nothing.\n },\n variant = 'embedded',\n className,\n closeOnEscape = true,\n onResize,\n onClose,\n onClickBack,\n size = 'md',\n trigger,\n children,\n focusTrap = props.focusTrap === undefined && props.variant === 'overlay' ? true : props.focusTrap,\n showCloseButton = true,\n outletName,\n ...otherProps\n } = props;\n\n const [open, setOpen] = useControllableState<boolean | undefined>({\n prop: openProp,\n defaultProp: defaultOpenProp,\n onChange,\n });\n\n const [outlet, setOutlet] = React.useState<HTMLElement>();\n\n const context = React.useMemo(\n () => ({\n closeOnEscape,\n onClickBack,\n onClose,\n onResize,\n props: otherProps,\n size,\n ref,\n open,\n setOpen,\n variant,\n focusTrap,\n showCloseButton,\n outlet,\n }),\n [\n closeOnEscape,\n open,\n setOpen,\n otherProps,\n variant,\n onResize,\n onClose,\n size,\n focusTrap,\n showCloseButton,\n outlet,\n onClickBack,\n ]\n );\n\n // this prevents two drawers being open at once and used when one drawer getting opened before another one got closed.\n const close = React.useCallback(() => {\n setOpen(false);\n onClose && onClose();\n }, []);\n\n React.useEffect(() => {\n const outletSelector = `[data-taco=\"drawer-outlet\"][data-taco-outlet-name=\"${outletName ?? DEFAULT_OUTLET_NAME}\"]`;\n const outletElement = document.querySelector<HTMLElement>(outletSelector) ?? document.body;\n setOutlet(outletElement);\n }, [outletName]);\n\n React.useEffect(() => {\n if (open) {\n // if drawerStack is defined, this means that another drawer was opened before\n if (drawerStack) {\n drawerStack();\n }\n drawerStack = close;\n } else {\n // if drawerStack is equal to current close callback,\n // this means that drawer getting closed completely instead of getting closed on re-open\n if (drawerStack === close) {\n drawerStack = undefined;\n }\n }\n }, [open]);\n\n return (\n <DrawerContext.Provider value={context}>\n <DialogPrimitive.Root modal={variant === 'overlay' ? true : false} open={open} onOpenChange={setOpen}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </DialogPrimitive.Root>\n </DrawerContext.Provider>\n );\n}) as ForwardedDrawerWithStatics;\n\nDrawer.Trigger = Trigger;\nDrawer.Content = Content;\nDrawer.InnerContent = InnerContent;\nDrawer.Title = Title;\nDrawer.Footer = Footer;\nDrawer.Close = Close;\nDrawer.Actions = Actions;\nDrawer.Outlet = Outlet;\n"],"names":["DEFAULT_OUTLET_NAME","Outlet","React","props","ref","className","cn","name","_props$name","drawerStack","Drawer","open","openProp","defaultOpen","defaultOpenProp","onChange","variant","closeOnEscape","onResize","onClose","onClickBack","size","trigger","children","focusTrap","undefined","showCloseButton","outletName","otherProps","setOpen","useControllableState","prop","defaultProp","outlet","setOutlet","context","close","outletSelector","outletElement","_document$querySelect","document","querySelector","body","DrawerContext","Provider","value","DialogPrimitive","modal","onOpenChange","Trigger","Content","InnerContent","Title","Footer","Close","Actions"],"mappings":";;;;;;;;AAsEA,MAAMA,mBAAmB,GAAG,SAAS;AAErC,MAAMC,MAAM,gBAAGC,UAAgB,CAAC,SAASD,MAAMA,CAACE,KAAkB,EAAEC,GAA8B;;EAC9F,MAAMC,SAAS,GAAGC,EAAE,CAAC,8CAA8C,EAAEH,KAAK,CAACE,SAAS,CAAC;EACrF,oBACIH,uCACQC,KAAK;IACTE,SAAS,EAAEA,SAAS;iBACV,eAAe;4CACFF,KAAK,CAACI,IAAI,cAAAC,WAAA,cAAAA,WAAA,GAAIR,mBAAmB;IACxDI,GAAG,EAAEA;KACP;AAEV,CAAC,CAAC;AAEF;AACA,IAAIK,WAAqC;MAa5BC,MAAM,gBAAGR,UAAgB,CAAC,SAASQ,MAAMA,CAACP,KAAkB,EAAEC,GAA2B;EAClG,MAAM;IACFO,IAAI,EAAEC,QAAQ;IACdC,WAAW,EAAEC,eAAe;;IAE5BC,QAAQ,GAAGA;;KAEV;IACDC,OAAO,GAAG,UAAU;IACpBX,SAAS;IACTY,aAAa,GAAG,IAAI;IACpBC,QAAQ;IACRC,OAAO;IACPC,WAAW;IACXC,IAAI,GAAG,IAAI;IACXC,OAAO;IACPC,QAAQ;IACRC,SAAS,GAAGrB,KAAK,CAACqB,SAAS,KAAKC,SAAS,IAAItB,KAAK,CAACa,OAAO,KAAK,S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W,EAAE;QACbA,WAAW,EAAE;;MAEjBA,WAAW,GAAG2B,KAAK;KACtB,MAAM;;;MAGH,IAAI3B,WAAW,KAAK2B,KAAK,EAAE;QACvB3B,WAAW,GAAGgB,SAAS;;;GAGlC,EAAE,CAACd,IAAI,CAAC,CAAC;EAEV,oBACIT,cAACyC,aAAa,CAACC,QAAQ;IAACC,KAAK,EAAEV;kBAC3BjC,cAAC4C,IAAoB;IAACC,KAAK,EAAE/B,OAAO,KAAK,SAAS,GAAG,IAAI,GAAG,KAAK;IAAEL,IAAI,EAAEA,IAAI;IAAEqC,YAAY,EAAEnB;KACxFP,OAAO,iBAAIpB,cAAC+C,OAAO,QAAE3B,OAAO,CAAW,EACvCC,QAAQ,CACU,CACF;AAEjC,CAAC;AAEDb,MAAM,CAACuC,OAAO,GAAGA,OAAO;AACxBvC,MAAM,CAACwC,OAAO,GAAGA,OAAO;AACxBxC,MAAM,CAACyC,YAAY,GAAGA,YAAY;AAClCzC,MAAM,CAAC0C,KAAK,GAAGA,KAAK;AACpB1C,MAAM,CAAC2C,MAAM,GAAGA,MAAM;AACtB3C,MAAM,CAAC4C,KAAK,GAAGA,KAAK;AACpB5C,MAAM,CAAC6C,OAAO,GAAGA,OAAO;AACxB7C,MAAM,CAACT,MAAM,GAAGA,MAAM;;;;"}
|
1
|
+
{"version":3,"file":"Drawer.js","sources":["../../../../../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n Actions,\n Footer,\n InnerContent,\n DrawerInnerContentProps,\n DrawerFooterProps,\n DrawerTitleProps,\n Title,\n Close,\n Content,\n DrawerContentProps,\n DrawerCloseProps,\n} from './components/Content';\nimport { GroupProps } from '../Group/Group';\nimport { DialogProps } from '../Dialog/Dialog';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport cn from 'clsx';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { DrawerTriggerProps, Trigger } from './components/Trigger';\nimport { DrawerContext } from './Context';\nimport { DrawerSize, DrawerVariant } from './types';\n\nexport type DrawerTexts = {\n /**\n * Aria-label for back icon button in drawer.\n */\n back: string;\n /**\n * Aria-label for close icon button in drawer.\n */\n close: string;\n};\n\nexport type DrawerProps = Omit<DialogProps, 'draggable' | 'size'> & {\n children: React.ReactNode | React.ReactNode[];\n /** Size of the drawer. This is the recommended way to set a size for drawer component. */\n size?: DrawerSize;\n /** When `true`, pressing escape will close the drawer */\n closeOnEscape?: boolean;\n /** Set whether the drawer is open by default or not, use when not providing a trigger */\n defaultOpen?: boolean;\n /** Handles the back button click and determines its visibility */\n onClickBack?: () => void;\n /** Handler called when drawer closes by user interaction */\n onClose?: () => void;\n /** Called when the drawer opens or closes, must be used in conjunction with open */\n onChange?: (open: boolean | undefined) => void;\n /** Control the open state of the drawer from outside the component */\n open?: boolean;\n /** A trigger to be used for the drawer, should not be set if `children` already contains a trigger */\n trigger?: JSX.Element;\n /** Triggers when resizing, can be throttled or debounced for better performances */\n onResize?: (delta: number) => void;\n /** Rendering variant of the drawer */\n variant?: DrawerVariant;\n /** className for children container, needed for embedded version, in cases where we might need to control children height */\n className?: string;\n /** When 'true' preventing focus from leaving drawer content */\n focusTrap?: boolean;\n /** When 'true' renders close button in topr right cornenr of drawer content */\n showCloseButton?: boolean;\n /** Target specific named outlet allowing you to render a drawer to a specific outlet */\n outletName?: string;\n};\n\nexport type OutletProps = React.HTMLAttributes<HTMLDivElement> & {\n name?: string;\n};\n\nconst DEFAULT_OUTLET_NAME = 'default';\n\nconst Outlet = React.forwardRef(function Outlet(props: OutletProps, ref: React.Ref<HTMLDivElement>) {\n const className = cn('h-full ml-auto overflow-hidden flex-shrink-0', props.className);\n return (\n <div\n {...props}\n className={className}\n data-taco=\"drawer-outlet\"\n data-taco-outlet-name={props.name ?? DEFAULT_OUTLET_NAME}\n ref={ref}\n />\n );\n});\n\n// drawerStack getting set by previous drawer instance, to be able to close previous instance, when new instance getting opened.\nlet drawerStack: undefined | (() => void);\n\nexport type ForwardedDrawerWithStatics = React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLElement>> & {\n Trigger: React.ForwardRefExoticComponent<DrawerTriggerProps & React.RefAttributes<HTMLButtonElement>>;\n Content: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;\n InnerContent: React.ForwardRefExoticComponent<DrawerInnerContentProps & React.RefAttributes<HTMLDivElement>>;\n Title: React.ForwardRefExoticComponent<DrawerTitleProps & React.RefAttributes<HTMLHeadingElement>>;\n Footer: React.ForwardRefExoticComponent<DrawerFooterProps & React.RefAttributes<HTMLDivElement>>;\n Close: React.ForwardRefExoticComponent<DrawerCloseProps & React.RefAttributes<HTMLButtonElement>>;\n Actions: React.ForwardRefExoticComponent<GroupProps & React.RefAttributes<HTMLDivElement>>;\n Outlet: React.ForwardRefExoticComponent<OutletProps & React.RefAttributes<HTMLDivElement>>;\n};\n\nexport const Drawer = React.forwardRef(function Drawer(props: DrawerProps, ref: React.Ref<HTMLElement>) {\n const {\n open: openProp,\n defaultOpen: defaultOpenProp,\n // if onChange is not provided, then replace it with empty function, needed for useControllableState\n onChange = () => {\n // do nothing.\n },\n variant = 'embedded',\n className,\n closeOnEscape = true,\n onResize,\n onClose,\n onClickBack,\n size = 'md',\n trigger,\n children,\n focusTrap = props.focusTrap === undefined && props.variant === 'overlay' ? true : props.focusTrap,\n showCloseButton = true,\n outletName,\n ...otherProps\n } = props;\n\n const [open, setOpen] = useControllableState<boolean | undefined>({\n prop: openProp,\n defaultProp: defaultOpenProp,\n onChange,\n });\n\n const [outlet, setOutlet] = React.useState<HTMLElement>();\n\n const context = React.useMemo(\n () => ({\n closeOnEscape,\n onClickBack,\n onClose,\n onResize,\n props: otherProps,\n size,\n ref,\n open,\n setOpen,\n variant,\n focusTrap,\n showCloseButton,\n outlet,\n }),\n [\n closeOnEscape,\n open,\n setOpen,\n otherProps,\n variant,\n onResize,\n onClose,\n size,\n focusTrap,\n showCloseButton,\n outlet,\n onClickBack,\n ]\n );\n\n // this prevents two drawers being open at once and used when one drawer getting opened before another one got closed.\n const close = React.useCallback(() => {\n setOpen(false);\n onClose && onClose();\n }, []);\n\n React.useEffect(() => {\n const outletSelector = `[data-taco=\"drawer-outlet\"][data-taco-outlet-name=\"${outletName ?? DEFAULT_OUTLET_NAME}\"]`;\n const outletElement = document.querySelector<HTMLElement>(outletSelector) ?? document.body;\n setOutlet(outletElement);\n }, [outletName]);\n\n React.useEffect(() => {\n if (open) {\n // if drawerStack is defined, this means that another drawer was opened before\n if (drawerStack) {\n drawerStack();\n }\n drawerStack = close;\n } else {\n // if drawerStack is equal to current close callback,\n // this means that drawer getting closed completely instead of getting closed on re-open\n if (drawerStack === close) {\n drawerStack = undefined;\n }\n }\n }, [open]);\n\n return (\n <DrawerContext.Provider value={context}>\n <DialogPrimitive.Root modal={variant === 'overlay' ? true : false} open={open} onOpenChange={setOpen}>\n {trigger && <Trigger>{trigger}</Trigger>}\n {children}\n </DialogPrimitive.Root>\n </DrawerContext.Provider>\n );\n}) as ForwardedDrawerWithStatics;\n\nDrawer.Trigger = Trigger;\nDrawer.Content = Content;\nDrawer.InnerContent = InnerContent;\nDrawer.Title = Title;\nDrawer.Footer = Footer;\nDrawer.Close = Close;\nDrawer.Actions = Actions;\nDrawer.Outlet = Outlet;\n"],"names":["DEFAULT_OUTLET_NAME","Outlet","React","props","ref","className","cn","name","_props$name","drawerStack","Drawer","openProp","open","defaultOpenProp","defaultOpen","_props$onChange","onChange","_props$variant","variant","_props$closeOnEscape","closeOnEscape","onResize","onClose","onClickBack","_props$size","size","trigger","children","_props$focusTrap","focusTrap","undefined","_props$showCloseButto","showCloseButton","outletName","otherProps","_objectWithoutPropertiesLoose","_excluded","_useControllableState","useControllableState","prop","defaultProp","setOpen","_React$useState","outlet","setOutlet","context","close","outletSelector","outletElement","_document$querySelect","document","querySelector","body","DrawerContext","Provider","value","DialogPrimitive","modal","onOpenChange","Trigger","Content","InnerContent","Title","Footer","Close","Actions"],"mappings":";;;;;;;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