@navikt/ds-react 0.19.18 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_docs.json +354 -491
- package/cjs/accordion/Accordion.js +2 -2
- package/cjs/accordion/AccordionContent.js +2 -2
- package/cjs/accordion/AccordionHeader.js +6 -5
- package/cjs/accordion/AccordionItem.js +2 -2
- package/cjs/alert/Alert.js +2 -2
- package/cjs/button/Button.js +3 -4
- package/cjs/{speech-bubble → chat}/Bubble.js +7 -4
- package/cjs/{speech-bubble/SpeechBubble.js → chat/Chat.js} +11 -10
- package/cjs/{menu → chat}/index.js +3 -3
- package/cjs/chat/package.json +6 -0
- package/cjs/form/ConfirmationPanel.js +2 -2
- package/cjs/form/Fieldset/Fieldset.js +6 -6
- package/cjs/form/Select.js +6 -6
- package/cjs/form/Switch.js +4 -4
- package/cjs/form/TextField.js +6 -6
- package/cjs/form/Textarea.js +14 -14
- package/cjs/form/checkbox/Checkbox.js +3 -3
- package/cjs/form/checkbox/CheckboxGroup.js +2 -2
- package/cjs/form/error-summary/ErrorSummary.js +3 -3
- package/cjs/form/error-summary/ErrorSummaryItem.js +2 -2
- package/cjs/form/radio/Radio.js +2 -2
- package/cjs/form/radio/RadioGroup.js +2 -2
- package/cjs/form/search/Search.js +6 -7
- package/cjs/form/search/SearchButton.js +2 -2
- package/cjs/form/useFormField.js +2 -2
- package/cjs/grid/Cell.js +2 -2
- package/cjs/grid/ContentContainer.js +2 -2
- package/cjs/grid/Grid.js +2 -2
- package/cjs/guide-panel/Guide.js +3 -3
- package/cjs/guide-panel/GuidePanel.js +2 -2
- package/cjs/help-text/HelpText.js +5 -5
- package/cjs/index.js +1 -6
- package/cjs/link/Link.js +2 -2
- package/cjs/link-panel/LinkPanel.js +2 -2
- package/cjs/link-panel/LinkPanelDescription.js +2 -2
- package/cjs/link-panel/LinkPanelTitle.js +2 -2
- package/cjs/loader/Loader.js +2 -2
- package/cjs/modal/Modal.js +4 -5
- package/cjs/modal/ModalContent.js +2 -2
- package/cjs/pagination/Pagination.js +18 -23
- package/cjs/{menu/MenuItem.js → pagination/PaginationItem.js} +5 -4
- package/cjs/panel/Panel.js +2 -2
- package/cjs/popover/Popover.js +55 -45
- package/cjs/popover/PopoverContent.js +2 -2
- package/cjs/read-more/ReadMore.js +2 -2
- package/cjs/stepper/Step.js +2 -2
- package/cjs/stepper/Stepper.js +3 -3
- package/cjs/table/Body.js +2 -2
- package/cjs/table/DataCell.js +2 -2
- package/cjs/table/ExpandableRow.js +4 -4
- package/cjs/table/Header.js +2 -2
- package/cjs/table/HeaderCell.js +2 -2
- package/cjs/table/Row.js +2 -2
- package/cjs/table/Table.js +2 -2
- package/cjs/tabs/Tab.js +3 -3
- package/cjs/tabs/TabList.js +8 -7
- package/cjs/tabs/TabPanel.js +2 -2
- package/cjs/tabs/Tabs.js +5 -3
- package/cjs/tag/Tag.js +2 -2
- package/cjs/toggle-group/ToggleGroup.js +5 -5
- package/cjs/toggle-group/ToggleItem.js +2 -2
- package/cjs/tooltip/Tooltip.js +45 -92
- package/cjs/typography/BodyLong.js +2 -2
- package/cjs/typography/BodyShort.js +2 -2
- package/cjs/typography/Detail.js +2 -2
- package/cjs/typography/ErrorMessage.js +2 -2
- package/cjs/typography/Heading.js +2 -2
- package/cjs/typography/Ingress.js +2 -2
- package/cjs/typography/Label.js +2 -2
- package/cjs/util/TextareaAutoSize.js +174 -0
- package/cjs/util/debounce.js +18 -0
- package/cjs/util/index.js +14 -1
- package/cjs/util/mergeRefs.js +16 -0
- package/cjs/util/useId.js +60 -17
- package/esm/accordion/Accordion.js +1 -1
- package/esm/accordion/Accordion.js.map +1 -1
- package/esm/accordion/AccordionContent.js +1 -1
- package/esm/accordion/AccordionContent.js.map +1 -1
- package/esm/accordion/AccordionHeader.js +3 -2
- package/esm/accordion/AccordionHeader.js.map +1 -1
- package/esm/accordion/AccordionItem.js +1 -1
- package/esm/accordion/AccordionItem.js.map +1 -1
- package/esm/alert/Alert.d.ts +1 -1
- package/esm/alert/Alert.js +1 -1
- package/esm/alert/Alert.js.map +1 -1
- package/esm/button/Button.js +4 -5
- package/esm/button/Button.js.map +1 -1
- package/esm/{speech-bubble → chat}/Bubble.d.ts +7 -3
- package/esm/{speech-bubble → chat}/Bubble.js +7 -4
- package/esm/chat/Bubble.js.map +1 -0
- package/esm/chat/Chat.d.ts +38 -0
- package/esm/chat/Chat.js +28 -0
- package/esm/chat/Chat.js.map +1 -0
- package/esm/chat/index.d.ts +1 -0
- package/esm/chat/index.js +2 -0
- package/esm/chat/index.js.map +1 -0
- package/esm/form/ConfirmationPanel.js +1 -1
- package/esm/form/ConfirmationPanel.js.map +1 -1
- package/esm/form/Fieldset/Fieldset.js +1 -1
- package/esm/form/Fieldset/Fieldset.js.map +1 -1
- package/esm/form/Select.js +1 -1
- package/esm/form/Select.js.map +1 -1
- package/esm/form/Switch.js +1 -1
- package/esm/form/Switch.js.map +1 -1
- package/esm/form/TextField.js +1 -1
- package/esm/form/TextField.js.map +1 -1
- package/esm/form/Textarea.js +6 -6
- package/esm/form/Textarea.js.map +1 -1
- package/esm/form/checkbox/Checkbox.js +1 -1
- package/esm/form/checkbox/Checkbox.js.map +1 -1
- package/esm/form/checkbox/CheckboxGroup.js +1 -1
- package/esm/form/checkbox/CheckboxGroup.js.map +1 -1
- package/esm/form/error-summary/ErrorSummary.js +3 -3
- package/esm/form/error-summary/ErrorSummary.js.map +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.js +1 -1
- package/esm/form/error-summary/ErrorSummaryItem.js.map +1 -1
- package/esm/form/radio/Radio.js +1 -1
- package/esm/form/radio/Radio.js.map +1 -1
- package/esm/form/radio/RadioGroup.js +1 -1
- package/esm/form/radio/RadioGroup.js.map +1 -1
- package/esm/form/search/Search.js +4 -5
- package/esm/form/search/Search.js.map +1 -1
- package/esm/form/search/SearchButton.js +1 -1
- package/esm/form/search/SearchButton.js.map +1 -1
- package/esm/form/useFormField.js +1 -1
- package/esm/form/useFormField.js.map +1 -1
- package/esm/grid/Cell.js +1 -1
- package/esm/grid/Cell.js.map +1 -1
- package/esm/grid/ContentContainer.js +1 -1
- package/esm/grid/ContentContainer.js.map +1 -1
- package/esm/grid/Grid.js +1 -1
- package/esm/grid/Grid.js.map +1 -1
- package/esm/guide-panel/Guide.js +1 -1
- package/esm/guide-panel/Guide.js.map +1 -1
- package/esm/guide-panel/GuidePanel.js +1 -1
- package/esm/guide-panel/GuidePanel.js.map +1 -1
- package/esm/help-text/HelpText.d.ts +1 -2
- package/esm/help-text/HelpText.js +7 -7
- package/esm/help-text/HelpText.js.map +1 -1
- package/esm/index.d.ts +1 -5
- package/esm/index.js +1 -6
- package/esm/index.js.map +1 -1
- package/esm/link/Link.js +1 -1
- package/esm/link/Link.js.map +1 -1
- package/esm/link-panel/LinkPanel.js +1 -1
- package/esm/link-panel/LinkPanel.js.map +1 -1
- package/esm/link-panel/LinkPanelDescription.js +1 -1
- package/esm/link-panel/LinkPanelDescription.js.map +1 -1
- package/esm/link-panel/LinkPanelTitle.js +1 -1
- package/esm/link-panel/LinkPanelTitle.js.map +1 -1
- package/esm/loader/Loader.js +1 -1
- package/esm/loader/Loader.js.map +1 -1
- package/esm/modal/Modal.js +4 -5
- package/esm/modal/Modal.js.map +1 -1
- package/esm/modal/ModalContent.js +1 -1
- package/esm/modal/ModalContent.js.map +1 -1
- package/esm/pagination/Pagination.d.ts +12 -3
- package/esm/pagination/Pagination.js +17 -22
- package/esm/pagination/Pagination.js.map +1 -1
- package/esm/pagination/PaginationItem.d.ts +22 -0
- package/esm/{menu/MenuItem.js → pagination/PaginationItem.js} +6 -5
- package/esm/pagination/PaginationItem.js.map +1 -0
- package/esm/pagination/index.d.ts +1 -2
- package/esm/pagination/index.js.map +1 -1
- package/esm/panel/Panel.js +1 -1
- package/esm/panel/Panel.js.map +1 -1
- package/esm/popover/Popover.d.ts +2 -3
- package/esm/popover/Popover.js +56 -46
- package/esm/popover/Popover.js.map +1 -1
- package/esm/popover/PopoverContent.js +1 -1
- package/esm/popover/PopoverContent.js.map +1 -1
- package/esm/read-more/ReadMore.js +1 -1
- package/esm/read-more/ReadMore.js.map +1 -1
- package/esm/stepper/Step.js +1 -1
- package/esm/stepper/Step.js.map +1 -1
- package/esm/stepper/Stepper.js +1 -1
- package/esm/stepper/Stepper.js.map +1 -1
- package/esm/table/Body.js +1 -1
- package/esm/table/Body.js.map +1 -1
- package/esm/table/DataCell.js +1 -1
- package/esm/table/DataCell.js.map +1 -1
- package/esm/table/ExpandableRow.js +2 -2
- package/esm/table/ExpandableRow.js.map +1 -1
- package/esm/table/Header.js +1 -1
- package/esm/table/Header.js.map +1 -1
- package/esm/table/HeaderCell.js +1 -1
- package/esm/table/HeaderCell.js.map +1 -1
- package/esm/table/Row.js +1 -1
- package/esm/table/Row.js.map +1 -1
- package/esm/table/Table.js +1 -1
- package/esm/table/Table.js.map +1 -1
- package/esm/tabs/Tab.d.ts +0 -5
- package/esm/tabs/Tab.js +4 -4
- package/esm/tabs/Tab.js.map +1 -1
- package/esm/tabs/TabList.d.ts +0 -4
- package/esm/tabs/TabList.js +7 -6
- package/esm/tabs/TabList.js.map +1 -1
- package/esm/tabs/TabPanel.js +1 -1
- package/esm/tabs/TabPanel.js.map +1 -1
- package/esm/tabs/Tabs.d.ts +12 -0
- package/esm/tabs/Tabs.js +4 -2
- package/esm/tabs/Tabs.js.map +1 -1
- package/esm/tag/Tag.js +1 -1
- package/esm/tag/Tag.js.map +1 -1
- package/esm/toggle-group/ToggleGroup.js +3 -3
- package/esm/toggle-group/ToggleGroup.js.map +1 -1
- package/esm/toggle-group/ToggleItem.js +1 -1
- package/esm/toggle-group/ToggleItem.js.map +1 -1
- package/esm/tooltip/Tooltip.js +44 -91
- package/esm/tooltip/Tooltip.js.map +1 -1
- package/esm/typography/BodyLong.js +1 -1
- package/esm/typography/BodyLong.js.map +1 -1
- package/esm/typography/BodyShort.js +1 -1
- package/esm/typography/BodyShort.js.map +1 -1
- package/esm/typography/Detail.js +1 -1
- package/esm/typography/Detail.js.map +1 -1
- package/esm/typography/ErrorMessage.js +1 -1
- package/esm/typography/ErrorMessage.js.map +1 -1
- package/esm/typography/Heading.js +1 -1
- package/esm/typography/Heading.js.map +1 -1
- package/esm/typography/Ingress.js +1 -1
- package/esm/typography/Ingress.js.map +1 -1
- package/esm/typography/Label.js +1 -1
- package/esm/typography/Label.js.map +1 -1
- package/esm/util/TextareaAutoSize.d.ts +14 -0
- package/esm/util/TextareaAutoSize.js +150 -0
- package/esm/util/TextareaAutoSize.js.map +1 -0
- package/esm/util/debounce.d.ts +4 -0
- package/esm/util/debounce.js +16 -0
- package/esm/util/debounce.js.map +1 -0
- package/esm/util/index.d.ts +4 -0
- package/esm/util/index.js +9 -1
- package/esm/util/index.js.map +1 -1
- package/esm/util/mergeRefs.d.ts +2 -0
- package/esm/util/mergeRefs.js +14 -0
- package/esm/util/mergeRefs.js.map +1 -0
- package/esm/util/useId.d.ts +7 -3
- package/esm/util/useId.js +36 -16
- package/esm/util/useId.js.map +1 -1
- package/package.json +13 -14
- package/src/accordion/Accordion.tsx +1 -1
- package/src/accordion/AccordionContent.tsx +1 -1
- package/src/accordion/AccordionHeader.tsx +2 -2
- package/src/accordion/AccordionItem.tsx +1 -1
- package/src/alert/Alert.tsx +2 -2
- package/src/alert/alert.stories.tsx +7 -0
- package/src/button/Button.tsx +5 -5
- package/src/chat/Bubble.tsx +52 -0
- package/src/chat/Chat.tsx +96 -0
- package/src/chat/chat.stories.tsx +202 -0
- package/src/chat/index.ts +1 -0
- package/src/form/ConfirmationPanel.tsx +1 -1
- package/src/form/Fieldset/Fieldset.tsx +1 -1
- package/src/form/Select.tsx +1 -1
- package/src/form/Switch.tsx +1 -1
- package/src/form/TextField.tsx +1 -1
- package/src/form/Textarea.tsx +6 -6
- package/src/form/checkbox/Checkbox.test.tsx +20 -17
- package/src/form/checkbox/Checkbox.tsx +1 -1
- package/src/form/checkbox/CheckboxGroup.tsx +1 -1
- package/src/form/error-summary/ErrorSummary.tsx +3 -3
- package/src/form/error-summary/ErrorSummaryItem.tsx +1 -1
- package/src/form/radio/Radio.tsx +1 -1
- package/src/form/radio/RadioGroup.tsx +1 -1
- package/src/form/search/Search.tsx +11 -4
- package/src/form/search/SearchButton.tsx +1 -1
- package/src/form/useFormField.ts +1 -1
- package/src/grid/Cell.tsx +1 -1
- package/src/grid/ContentContainer.tsx +1 -1
- package/src/grid/Grid.tsx +1 -1
- package/src/grid/grid.stories.tsx +68 -0
- package/src/guide-panel/Guide.tsx +1 -1
- package/src/guide-panel/GuidePanel.tsx +1 -1
- package/src/help-text/HelpText.tsx +22 -8
- package/src/help-text/help-text.stories.tsx +12 -16
- package/src/index.ts +1 -7
- package/src/link/Link.tsx +1 -1
- package/src/link-panel/LinkPanel.tsx +1 -1
- package/src/link-panel/LinkPanelDescription.tsx +1 -1
- package/src/link-panel/LinkPanelTitle.tsx +1 -1
- package/src/loader/Loader.tsx +1 -1
- package/src/modal/Modal.tsx +4 -5
- package/src/modal/ModalContent.tsx +1 -1
- package/src/pagination/Pagination.tsx +84 -78
- package/src/pagination/PaginationItem.tsx +57 -0
- package/src/pagination/index.ts +1 -2
- package/src/pagination/pagination.stories.tsx +90 -16
- package/src/panel/Panel.tsx +1 -1
- package/src/popover/Popover.test.tsx +143 -0
- package/src/popover/Popover.tsx +107 -73
- package/src/popover/PopoverContent.tsx +1 -1
- package/src/popover/popover.stories.tsx +22 -27
- package/src/read-more/ReadMore.tsx +1 -1
- package/src/stepper/Step.tsx +1 -1
- package/src/stepper/Stepper.tsx +1 -1
- package/src/table/Body.tsx +1 -1
- package/src/table/DataCell.tsx +1 -1
- package/src/table/ExpandableRow.tsx +2 -2
- package/src/table/Header.tsx +1 -1
- package/src/table/HeaderCell.tsx +1 -1
- package/src/table/Row.tsx +1 -1
- package/src/table/Table.tsx +1 -1
- package/src/tabs/Tab.tsx +5 -10
- package/src/tabs/TabList.tsx +14 -9
- package/src/tabs/TabPanel.tsx +1 -1
- package/src/tabs/Tabs.stories.tsx +94 -117
- package/src/tabs/Tabs.tsx +17 -1
- package/src/tag/Tag.tsx +1 -1
- package/src/toggle-group/ToggleGroup.tsx +3 -3
- package/src/toggle-group/ToggleItem.tsx +1 -1
- package/src/tooltip/Tooltip.test.tsx +167 -0
- package/src/tooltip/Tooltip.tsx +106 -173
- package/src/tooltip/tooltip.stories.tsx +15 -1
- package/src/typography/BodyLong.tsx +1 -1
- package/src/typography/BodyShort.tsx +1 -1
- package/src/typography/Detail.tsx +1 -1
- package/src/typography/ErrorMessage.tsx +1 -1
- package/src/typography/Heading.tsx +1 -1
- package/src/typography/Ingress.tsx +1 -1
- package/src/typography/Label.tsx +1 -1
- package/src/util/TextareaAutoSize.tsx +224 -0
- package/src/util/debounce.ts +17 -0
- package/src/util/index.ts +14 -2
- package/src/util/mergeRefs.tsx +14 -0
- package/src/util/useId.ts +37 -20
- package/cjs/card/MicroCard.js +0 -47
- package/cjs/card/index.js +0 -8
- package/cjs/card/package.json +0 -6
- package/cjs/menu/Menu.js +0 -53
- package/cjs/menu/MenuCollapse.js +0 -65
- package/cjs/menu/MenuItems.js +0 -23
- package/cjs/menu/package.json +0 -6
- package/cjs/page-header/PageHeader.js +0 -51
- package/cjs/page-header/index.js +0 -8
- package/cjs/page-header/package.json +0 -6
- package/cjs/speech-bubble/index.js +0 -8
- package/cjs/speech-bubble/package.json +0 -6
- package/cjs/step-indicator/Step.js +0 -67
- package/cjs/step-indicator/StepIndicator.js +0 -80
- package/cjs/step-indicator/index.js +0 -8
- package/cjs/step-indicator/package.json +0 -6
- package/esm/card/MicroCard.d.ts +0 -10
- package/esm/card/MicroCard.js +0 -19
- package/esm/card/MicroCard.js.map +0 -1
- package/esm/card/index.d.ts +0 -2
- package/esm/card/index.js +0 -2
- package/esm/card/index.js.map +0 -1
- package/esm/menu/Menu.d.ts +0 -12
- package/esm/menu/Menu.js +0 -25
- package/esm/menu/Menu.js.map +0 -1
- package/esm/menu/MenuCollapse.d.ts +0 -12
- package/esm/menu/MenuCollapse.js +0 -37
- package/esm/menu/MenuCollapse.js.map +0 -1
- package/esm/menu/MenuItem.d.ts +0 -13
- package/esm/menu/MenuItem.js.map +0 -1
- package/esm/menu/MenuItems.d.ts +0 -6
- package/esm/menu/MenuItems.js +0 -19
- package/esm/menu/MenuItems.js.map +0 -1
- package/esm/menu/index.d.ts +0 -3
- package/esm/menu/index.js +0 -2
- package/esm/menu/index.js.map +0 -1
- package/esm/page-header/PageHeader.d.ts +0 -27
- package/esm/page-header/PageHeader.js +0 -24
- package/esm/page-header/PageHeader.js.map +0 -1
- package/esm/page-header/index.d.ts +0 -2
- package/esm/page-header/index.js +0 -2
- package/esm/page-header/index.js.map +0 -1
- package/esm/speech-bubble/Bubble.js.map +0 -1
- package/esm/speech-bubble/SpeechBubble.d.ts +0 -34
- package/esm/speech-bubble/SpeechBubble.js +0 -27
- package/esm/speech-bubble/SpeechBubble.js.map +0 -1
- package/esm/speech-bubble/index.d.ts +0 -1
- package/esm/speech-bubble/index.js +0 -2
- package/esm/speech-bubble/index.js.map +0 -1
- package/esm/step-indicator/Step.d.ts +0 -23
- package/esm/step-indicator/Step.js +0 -39
- package/esm/step-indicator/Step.js.map +0 -1
- package/esm/step-indicator/StepIndicator.d.ts +0 -41
- package/esm/step-indicator/StepIndicator.js +0 -52
- package/esm/step-indicator/StepIndicator.js.map +0 -1
- package/esm/step-indicator/index.d.ts +0 -1
- package/esm/step-indicator/index.js +0 -2
- package/esm/step-indicator/index.js.map +0 -1
- package/src/card/MicroCard.tsx +0 -32
- package/src/card/index.ts +0 -2
- package/src/card/stories/card.stories.mdx +0 -26
- package/src/card/stories/card.stories.tsx +0 -16
- package/src/grid/stories/grid.stories.mdx +0 -79
- package/src/grid/stories/grid.stories.tsx +0 -51
- package/src/grid/stories/styles.css +0 -21
- package/src/menu/Menu.tsx +0 -36
- package/src/menu/MenuCollapse.tsx +0 -80
- package/src/menu/MenuItem.tsx +0 -39
- package/src/menu/MenuItems.tsx +0 -21
- package/src/menu/index.ts +0 -3
- package/src/menu/stories/menu.stories.mdx +0 -93
- package/src/menu/stories/menu.stories.tsx +0 -139
- package/src/page-header/PageHeader.tsx +0 -72
- package/src/page-header/index.ts +0 -2
- package/src/page-header/stories/header.stories.mdx +0 -81
- package/src/page-header/stories/header.stories.tsx +0 -61
- package/src/page-header/stories/pictogram.tsx +0 -14
- package/src/speech-bubble/Bubble.tsx +0 -48
- package/src/speech-bubble/SpeechBubble.tsx +0 -93
- package/src/speech-bubble/index.ts +0 -1
- package/src/speech-bubble/stories/illustration.tsx +0 -66
- package/src/speech-bubble/stories/speechbubble.stories.mdx +0 -184
- package/src/speech-bubble/stories/speechbubble.stories.tsx +0 -104
- package/src/step-indicator/Step.tsx +0 -81
- package/src/step-indicator/StepIndicator.tsx +0 -148
- package/src/step-indicator/index.ts +0 -1
- package/src/step-indicator/stories/Example.tsx +0 -23
- package/src/step-indicator/stories/step-indicator.stories.mdx +0 -122
- package/src/step-indicator/stories/step-indicator.stories.tsx +0 -104
|
@@ -1,38 +1,112 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
+
import { Link, HashRouter as Router } from "react-router-dom";
|
|
2
3
|
import Pagination from "./Pagination";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
|
-
title: "ds-react/
|
|
6
|
+
title: "ds-react/Pagination",
|
|
6
7
|
component: Pagination,
|
|
8
|
+
argTypes: {
|
|
9
|
+
size: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "radio",
|
|
12
|
+
options: ["medium", "small", "xsmall"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
7
16
|
};
|
|
8
17
|
|
|
9
|
-
export const
|
|
18
|
+
export const Default = (props: any) => {
|
|
10
19
|
const [page, setPage] = useState(props.page);
|
|
11
|
-
return
|
|
12
|
-
|
|
13
|
-
<h2>Pagination</h2>
|
|
14
|
-
<Pagination {...props} page={page} onPageChange={setPage} />
|
|
20
|
+
return <Pagination {...props} page={page} onPageChange={setPage} />;
|
|
21
|
+
};
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
23
|
+
Default.args = {
|
|
24
|
+
page: 2,
|
|
25
|
+
count: 8,
|
|
26
|
+
siblingCount: 1,
|
|
27
|
+
boundaryCount: 1,
|
|
28
|
+
prevNextTexts: false,
|
|
29
|
+
};
|
|
18
30
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
export const PrevNextText = () => {
|
|
32
|
+
const [page, setPage] = useState(1);
|
|
33
|
+
const props = {
|
|
34
|
+
page: 1,
|
|
35
|
+
count: 8,
|
|
36
|
+
siblingCount: 1,
|
|
37
|
+
boundaryCount: 1,
|
|
38
|
+
};
|
|
39
|
+
return (
|
|
40
|
+
<div className="colgap" style={{ alignItems: "center" }}>
|
|
41
|
+
<Pagination {...props} page={page} onPageChange={setPage} prevNextTexts />
|
|
22
42
|
<Pagination
|
|
43
|
+
{...props}
|
|
44
|
+
page={page}
|
|
45
|
+
onPageChange={setPage}
|
|
23
46
|
prevNextTexts
|
|
24
47
|
size="small"
|
|
48
|
+
/>
|
|
49
|
+
<Pagination
|
|
25
50
|
{...props}
|
|
26
51
|
page={page}
|
|
27
52
|
onPageChange={setPage}
|
|
53
|
+
prevNextTexts
|
|
54
|
+
size="xsmall"
|
|
28
55
|
/>
|
|
29
56
|
</div>
|
|
30
57
|
);
|
|
31
58
|
};
|
|
32
59
|
|
|
33
|
-
|
|
34
|
-
page
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
export const Small = () => {
|
|
61
|
+
const [page, setPage] = useState(1);
|
|
62
|
+
const props = {
|
|
63
|
+
page: 1,
|
|
64
|
+
count: 8,
|
|
65
|
+
siblingCount: 1,
|
|
66
|
+
boundaryCount: 1,
|
|
67
|
+
};
|
|
68
|
+
return (
|
|
69
|
+
<Pagination {...props} page={page} onPageChange={setPage} size="small" />
|
|
70
|
+
);
|
|
38
71
|
};
|
|
72
|
+
|
|
73
|
+
export const XSmall = () => {
|
|
74
|
+
const [page, setPage] = useState(1);
|
|
75
|
+
const props = {
|
|
76
|
+
page: 1,
|
|
77
|
+
count: 8,
|
|
78
|
+
siblingCount: 1,
|
|
79
|
+
boundaryCount: 1,
|
|
80
|
+
};
|
|
81
|
+
return (
|
|
82
|
+
<Pagination {...props} page={page} onPageChange={setPage} size="xsmall" />
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const AsLink = () => {
|
|
87
|
+
const [page, setPage] = useState(1);
|
|
88
|
+
const props = {
|
|
89
|
+
page: 1,
|
|
90
|
+
count: 8,
|
|
91
|
+
siblingCount: 1,
|
|
92
|
+
boundaryCount: 1,
|
|
93
|
+
};
|
|
94
|
+
return (
|
|
95
|
+
<Pagination
|
|
96
|
+
{...props}
|
|
97
|
+
page={page}
|
|
98
|
+
onPageChange={setPage}
|
|
99
|
+
renderItem={(item) => (
|
|
100
|
+
<Pagination.Item {...item} as={Link} to={`?page=${item.page}`} />
|
|
101
|
+
)}
|
|
102
|
+
/>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
AsLink.decorators = [
|
|
107
|
+
(Story) => (
|
|
108
|
+
<Router>
|
|
109
|
+
<Story />
|
|
110
|
+
</Router>
|
|
111
|
+
),
|
|
112
|
+
];
|
package/src/panel/Panel.tsx
CHANGED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { act, cleanup, fireEvent } from "@testing-library/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { renderWithStyles as render } from "../../tests/utils";
|
|
4
|
+
import Popover from "./Popover";
|
|
5
|
+
|
|
6
|
+
describe("Popover", () => {
|
|
7
|
+
test("open", () => {
|
|
8
|
+
const { getByTestId } = render(
|
|
9
|
+
<Popover
|
|
10
|
+
open
|
|
11
|
+
anchorEl={document.createElement("div")}
|
|
12
|
+
onClose={() => null}
|
|
13
|
+
data-testid="popover-id"
|
|
14
|
+
>
|
|
15
|
+
<div />
|
|
16
|
+
</Popover>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
expect(getByTestId("popover-id")).toBeVisible();
|
|
20
|
+
cleanup();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("should be hidden", () => {
|
|
24
|
+
const { getByTestId } = render(
|
|
25
|
+
<Popover
|
|
26
|
+
open={false}
|
|
27
|
+
anchorEl={document.createElement("div")}
|
|
28
|
+
onClose={() => null}
|
|
29
|
+
data-testid="popover-id"
|
|
30
|
+
>
|
|
31
|
+
<div />
|
|
32
|
+
</Popover>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
expect(getByTestId("popover-id")).not.toBeVisible();
|
|
36
|
+
cleanup();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("outsideClick", async () => {
|
|
40
|
+
const fn = jest.fn();
|
|
41
|
+
const { getByRole, getByTestId } = render(
|
|
42
|
+
<div>
|
|
43
|
+
<Popover
|
|
44
|
+
open={true}
|
|
45
|
+
anchorEl={document.createElement("div")}
|
|
46
|
+
onClose={fn}
|
|
47
|
+
data-testid="popover-id"
|
|
48
|
+
>
|
|
49
|
+
<div />
|
|
50
|
+
</Popover>
|
|
51
|
+
<a href="/#">link</a>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
await act(async () => {
|
|
56
|
+
expect(getByTestId("popover-id")).toBeVisible();
|
|
57
|
+
getByRole("link").focus();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
expect(fn).toHaveBeenCalled();
|
|
61
|
+
|
|
62
|
+
cleanup();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("escape", async () => {
|
|
66
|
+
const fn = jest.fn();
|
|
67
|
+
const { container, getByTestId } = render(
|
|
68
|
+
<div>
|
|
69
|
+
<Popover
|
|
70
|
+
open={true}
|
|
71
|
+
anchorEl={document.createElement("div")}
|
|
72
|
+
onClose={fn}
|
|
73
|
+
data-testid="popover-id"
|
|
74
|
+
>
|
|
75
|
+
<div />
|
|
76
|
+
</Popover>
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
await act(async () => {
|
|
81
|
+
expect(getByTestId("popover-id")).toBeVisible();
|
|
82
|
+
fireEvent.keyDown(
|
|
83
|
+
// Should work anywhere
|
|
84
|
+
container,
|
|
85
|
+
{ key: "Escape" }
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
expect(fn).toHaveBeenCalled();
|
|
90
|
+
|
|
91
|
+
cleanup();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("keep open on popover-focus", async () => {
|
|
95
|
+
const fn = jest.fn();
|
|
96
|
+
const { getByTestId } = render(
|
|
97
|
+
<div>
|
|
98
|
+
<Popover
|
|
99
|
+
open={true}
|
|
100
|
+
anchorEl={document.createElement("div")}
|
|
101
|
+
onClose={fn}
|
|
102
|
+
data-testid="popover-id"
|
|
103
|
+
>
|
|
104
|
+
<div />
|
|
105
|
+
</Popover>
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
await act(async () => {
|
|
110
|
+
expect(getByTestId("popover-id")).toBeVisible();
|
|
111
|
+
getByTestId("popover-id").focus();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
expect(fn).toHaveBeenCalledTimes(0);
|
|
115
|
+
|
|
116
|
+
cleanup();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("keep open on popover-click", async () => {
|
|
120
|
+
const fn = jest.fn();
|
|
121
|
+
const { getByTestId } = render(
|
|
122
|
+
<div>
|
|
123
|
+
<Popover
|
|
124
|
+
open={true}
|
|
125
|
+
anchorEl={document.createElement("div")}
|
|
126
|
+
onClose={fn}
|
|
127
|
+
data-testid="popover-id"
|
|
128
|
+
>
|
|
129
|
+
<div />
|
|
130
|
+
</Popover>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
await act(async () => {
|
|
135
|
+
expect(getByTestId("popover-id")).toBeVisible();
|
|
136
|
+
fireEvent.click(getByTestId("popover-id"));
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
expect(fn).toHaveBeenCalledTimes(0);
|
|
140
|
+
|
|
141
|
+
cleanup();
|
|
142
|
+
});
|
|
143
|
+
});
|
package/src/popover/Popover.tsx
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
arrow as flArrow,
|
|
3
|
+
autoUpdate,
|
|
4
|
+
flip,
|
|
5
|
+
offset as flOffset,
|
|
6
|
+
shift,
|
|
7
|
+
useClick,
|
|
8
|
+
useDismiss,
|
|
9
|
+
useFloating,
|
|
10
|
+
useInteractions,
|
|
11
|
+
} from "@floating-ui/react-dom-interactions";
|
|
12
|
+
import cl from "clsx";
|
|
3
13
|
import React, {
|
|
4
14
|
forwardRef,
|
|
5
15
|
HTMLAttributes,
|
|
6
16
|
useCallback,
|
|
7
17
|
useEffect,
|
|
18
|
+
useMemo,
|
|
8
19
|
useRef,
|
|
9
20
|
} from "react";
|
|
10
|
-
import mergeRefs from "
|
|
11
|
-
import {
|
|
12
|
-
import { useClientLayoutEffect } from "..";
|
|
21
|
+
import { mergeRefs } from "..";
|
|
22
|
+
import { useClientLayoutEffect, useEventListener } from "../util";
|
|
13
23
|
import PopoverContent, { PopoverContentType } from "./PopoverContent";
|
|
14
24
|
|
|
15
25
|
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -32,9 +42,21 @@ export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
32
42
|
/**
|
|
33
43
|
* Orientation for popover
|
|
34
44
|
* @note Try to keep general usage to "top", "bottom", "left", "right"
|
|
35
|
-
* @default "
|
|
45
|
+
* @default "top"
|
|
36
46
|
*/
|
|
37
|
-
placement?:
|
|
47
|
+
placement?:
|
|
48
|
+
| "top"
|
|
49
|
+
| "bottom"
|
|
50
|
+
| "right"
|
|
51
|
+
| "left"
|
|
52
|
+
| "top-start"
|
|
53
|
+
| "top-end"
|
|
54
|
+
| "bottom-start"
|
|
55
|
+
| "bottom-end"
|
|
56
|
+
| "right-start"
|
|
57
|
+
| "right-end"
|
|
58
|
+
| "left-start"
|
|
59
|
+
| "left-end";
|
|
38
60
|
/**
|
|
39
61
|
* Adds a arrow from dialog to anchor when true
|
|
40
62
|
* @default true
|
|
@@ -53,14 +75,6 @@ export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
53
75
|
strategy?: "absolute" | "fixed";
|
|
54
76
|
}
|
|
55
77
|
|
|
56
|
-
const useEventLister = (event: string, callback) =>
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
document.addEventListener(event, callback);
|
|
59
|
-
return () => {
|
|
60
|
-
document.removeEventListener(event, callback);
|
|
61
|
-
};
|
|
62
|
-
}, [event, callback]);
|
|
63
|
-
|
|
64
78
|
interface PopoverComponent
|
|
65
79
|
extends React.ForwardRefExoticComponent<
|
|
66
80
|
PopoverProps & React.RefAttributes<HTMLDivElement>
|
|
@@ -77,99 +91,119 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
|
|
|
77
91
|
arrow = true,
|
|
78
92
|
open,
|
|
79
93
|
onClose,
|
|
80
|
-
placement = "
|
|
94
|
+
placement = "top",
|
|
81
95
|
offset,
|
|
82
|
-
strategy = "absolute",
|
|
96
|
+
strategy: userStrategy = "absolute",
|
|
83
97
|
...rest
|
|
84
98
|
},
|
|
85
99
|
ref
|
|
86
100
|
) => {
|
|
87
|
-
const
|
|
88
|
-
const mergedRef = mergeRefs([popoverRef, ref]);
|
|
101
|
+
const arrowRef = useRef<HTMLDivElement | null>(null);
|
|
89
102
|
|
|
90
|
-
const
|
|
103
|
+
const {
|
|
104
|
+
x,
|
|
105
|
+
y,
|
|
106
|
+
reference,
|
|
107
|
+
floating,
|
|
108
|
+
strategy,
|
|
109
|
+
context,
|
|
110
|
+
update,
|
|
111
|
+
refs,
|
|
112
|
+
placement: flPlacement,
|
|
113
|
+
middlewareData: { arrow: { x: arrowX, y: arrowY } = {} },
|
|
114
|
+
} = useFloating({
|
|
115
|
+
strategy: userStrategy,
|
|
116
|
+
placement,
|
|
117
|
+
open: open,
|
|
118
|
+
onOpenChange: onClose,
|
|
119
|
+
middleware: [
|
|
120
|
+
flOffset(offset ?? (arrow ? 16 : 4)),
|
|
121
|
+
shift(),
|
|
122
|
+
flip({ padding: 5, fallbackPlacements: ["bottom", "top"] }),
|
|
123
|
+
flArrow({ element: arrowRef, padding: 8 }),
|
|
124
|
+
],
|
|
125
|
+
});
|
|
91
126
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
) {
|
|
101
|
-
close();
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
[anchorEl, close]
|
|
105
|
-
)
|
|
106
|
-
);
|
|
127
|
+
const { getFloatingProps } = useInteractions([
|
|
128
|
+
useClick(context),
|
|
129
|
+
useDismiss(context),
|
|
130
|
+
]);
|
|
131
|
+
|
|
132
|
+
useClientLayoutEffect(() => {
|
|
133
|
+
reference(anchorEl);
|
|
134
|
+
}, [anchorEl]);
|
|
107
135
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
136
|
+
const floatingRef = useMemo(
|
|
137
|
+
() => mergeRefs([floating, ref]),
|
|
138
|
+
[floating, ref]
|
|
111
139
|
);
|
|
112
140
|
|
|
113
|
-
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
update();
|
|
143
|
+
}, [open, update, anchorEl]);
|
|
144
|
+
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
if (!refs.reference.current || !refs.floating.current || !open) return;
|
|
147
|
+
const cleanup = autoUpdate(
|
|
148
|
+
refs.reference.current,
|
|
149
|
+
refs.floating.current,
|
|
150
|
+
update
|
|
151
|
+
);
|
|
152
|
+
return () => cleanup();
|
|
153
|
+
}, [refs.floating, refs.reference, update, open, anchorEl]);
|
|
154
|
+
|
|
155
|
+
useEventListener(
|
|
114
156
|
"focusin",
|
|
115
157
|
useCallback(
|
|
116
158
|
(e: FocusEvent) => {
|
|
117
159
|
if (
|
|
118
|
-
![anchorEl,
|
|
160
|
+
![anchorEl, refs?.floating?.current].some((element) =>
|
|
119
161
|
element?.contains(e.target as Node)
|
|
120
162
|
)
|
|
121
163
|
) {
|
|
122
|
-
|
|
164
|
+
open && onClose();
|
|
123
165
|
}
|
|
124
166
|
},
|
|
125
|
-
[anchorEl,
|
|
167
|
+
[anchorEl, refs, open, onClose]
|
|
126
168
|
)
|
|
127
169
|
);
|
|
128
170
|
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
{
|
|
136
|
-
name: "offset",
|
|
137
|
-
options: {
|
|
138
|
-
offset: [0, offset ?? (arrow ? 16 : 4)],
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
name: "arrow",
|
|
143
|
-
options: {
|
|
144
|
-
padding: 8,
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
],
|
|
148
|
-
strategy,
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
useClientLayoutEffect(() => {
|
|
153
|
-
open && update && update();
|
|
154
|
-
}, [open, update]);
|
|
171
|
+
const staticSide = {
|
|
172
|
+
top: "bottom",
|
|
173
|
+
right: "left",
|
|
174
|
+
bottom: "top",
|
|
175
|
+
left: "right",
|
|
176
|
+
}[flPlacement.split("-")[0]];
|
|
155
177
|
|
|
156
178
|
return (
|
|
157
179
|
<div
|
|
158
|
-
ref={mergedRef}
|
|
159
180
|
className={cl("navds-popover", className, {
|
|
160
181
|
"navds-popover--hidden": !open || !anchorEl,
|
|
161
182
|
})}
|
|
183
|
+
data-placement={flPlacement}
|
|
162
184
|
aria-hidden={!open || !anchorEl}
|
|
163
185
|
tabIndex={-1}
|
|
164
|
-
{...
|
|
186
|
+
{...getFloatingProps({
|
|
187
|
+
ref: floatingRef,
|
|
188
|
+
style: {
|
|
189
|
+
position: strategy,
|
|
190
|
+
top: y ?? 0,
|
|
191
|
+
left: x ?? 0,
|
|
192
|
+
},
|
|
193
|
+
})}
|
|
165
194
|
{...rest}
|
|
166
|
-
style={styles.popper}
|
|
167
195
|
>
|
|
168
196
|
{children}
|
|
169
197
|
{arrow && (
|
|
170
198
|
<div
|
|
171
|
-
|
|
172
|
-
|
|
199
|
+
ref={(node) => {
|
|
200
|
+
arrowRef.current = node;
|
|
201
|
+
}}
|
|
202
|
+
style={{
|
|
203
|
+
...(arrowX != null ? { left: arrowX } : {}),
|
|
204
|
+
...(arrowY != null ? { top: arrowY } : {}),
|
|
205
|
+
...(staticSide ? { [staticSide]: "-0.5rem" } : {}),
|
|
206
|
+
}}
|
|
173
207
|
className="navds-popover__arrow"
|
|
174
208
|
/>
|
|
175
209
|
)}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { Popover } from "../index";
|
|
3
|
-
import { placements } from "@popperjs/core";
|
|
4
3
|
import { Button } from "../button";
|
|
5
4
|
|
|
5
|
+
const placements = [
|
|
6
|
+
"top",
|
|
7
|
+
"bottom",
|
|
8
|
+
"right",
|
|
9
|
+
"left",
|
|
10
|
+
"top-start",
|
|
11
|
+
"top-end",
|
|
12
|
+
"bottom-start",
|
|
13
|
+
"bottom-end",
|
|
14
|
+
"right-start",
|
|
15
|
+
"right-end",
|
|
16
|
+
"left-start",
|
|
17
|
+
"left-end",
|
|
18
|
+
];
|
|
6
19
|
export default {
|
|
7
20
|
title: "ds-react/Popover",
|
|
8
21
|
component: Popover,
|
|
@@ -26,32 +39,17 @@ export default {
|
|
|
26
39
|
},
|
|
27
40
|
},
|
|
28
41
|
strategy: {
|
|
29
|
-
defaultValue: "
|
|
42
|
+
defaultValue: "absolute",
|
|
30
43
|
control: {
|
|
31
44
|
type: "radio",
|
|
32
45
|
options: ["fixed", "absolute"],
|
|
33
46
|
},
|
|
34
47
|
},
|
|
35
48
|
placement: {
|
|
36
|
-
defaultValue: "
|
|
49
|
+
defaultValue: "right",
|
|
37
50
|
control: {
|
|
38
51
|
type: "radio",
|
|
39
|
-
options:
|
|
40
|
-
"bottom",
|
|
41
|
-
"right",
|
|
42
|
-
"left",
|
|
43
|
-
"top-start",
|
|
44
|
-
"top-end",
|
|
45
|
-
"bottom-start",
|
|
46
|
-
"bottom-end",
|
|
47
|
-
"right-start",
|
|
48
|
-
"right-end",
|
|
49
|
-
"left-start",
|
|
50
|
-
"left-end",
|
|
51
|
-
"auto",
|
|
52
|
-
"auto-start",
|
|
53
|
-
"auto-end",
|
|
54
|
-
],
|
|
52
|
+
options: placements,
|
|
55
53
|
},
|
|
56
54
|
},
|
|
57
55
|
},
|
|
@@ -61,7 +59,7 @@ export const Default = (props: any) => {
|
|
|
61
59
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
62
60
|
const [open, setOpen] = useState<boolean>(false);
|
|
63
61
|
return (
|
|
64
|
-
|
|
62
|
+
<div>
|
|
65
63
|
<Button ref={(el) => setAnchorEl(el)} onClick={() => setOpen((x) => !x)}>
|
|
66
64
|
Open
|
|
67
65
|
</Button>
|
|
@@ -69,14 +67,11 @@ export const Default = (props: any) => {
|
|
|
69
67
|
{...props}
|
|
70
68
|
open={props.open ?? open}
|
|
71
69
|
anchorEl={anchorEl}
|
|
72
|
-
onClose={() => setOpen(
|
|
70
|
+
onClose={(e) => setOpen(e)}
|
|
73
71
|
>
|
|
74
|
-
<Popover.Content>
|
|
75
|
-
Velit in consequat Lorem sunt ut deserunt nostrud enim enim sint
|
|
76
|
-
cillum ad veniam.
|
|
77
|
-
</Popover.Content>
|
|
72
|
+
<Popover.Content>Velit in consequat</Popover.Content>
|
|
78
73
|
</Popover>
|
|
79
|
-
|
|
74
|
+
</div>
|
|
80
75
|
);
|
|
81
76
|
};
|
|
82
77
|
|
|
@@ -90,7 +85,7 @@ const Template = (props) => {
|
|
|
90
85
|
<Popover.Content>
|
|
91
86
|
Velit in consequat Lorem
|
|
92
87
|
<br />
|
|
93
|
-
|
|
88
|
+
{props.placement}
|
|
94
89
|
</Popover.Content>
|
|
95
90
|
</Popover>
|
|
96
91
|
</>
|
package/src/stepper/Step.tsx
CHANGED
package/src/stepper/Stepper.tsx
CHANGED
package/src/table/Body.tsx
CHANGED
package/src/table/DataCell.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef, useState } from "react";
|
|
2
|
-
import cl from "
|
|
2
|
+
import cl from "clsx";
|
|
3
3
|
import Row, { RowProps } from "./Row";
|
|
4
4
|
import DataCell from "./DataCell";
|
|
5
5
|
import { UnmountClosed } from "react-collapse";
|
|
@@ -58,7 +58,7 @@ export const ExpandableRow: ExpandableRowType = forwardRef(
|
|
|
58
58
|
ref
|
|
59
59
|
) => {
|
|
60
60
|
const [internalOpen, setInternalOpen] = useState<boolean>(defaultOpen);
|
|
61
|
-
const id =
|
|
61
|
+
const id = useId();
|
|
62
62
|
|
|
63
63
|
const isOpen = open ?? internalOpen;
|
|
64
64
|
|
package/src/table/Header.tsx
CHANGED