diff --git a/lib/rollup.config.js b/lib/rollup.config.js index d47bd9d9a..c51148325 100644 --- a/lib/rollup.config.js +++ b/lib/rollup.config.js @@ -16,6 +16,8 @@ const defaults = { external: [...Object.keys(pkg.peerDependencies || {}), ...Object.keys(pkg.dependencies || {}), ...Object.keys(commonPkg.dependencies || {})], }; +const resolveOnly = [new RegExp(`^((?!${defaults.external.map((item) => `(${item})`).join("|")}).)*$`, "g")]; + export default [ { ...defaults, @@ -32,7 +34,7 @@ export default [ }, ], }), - resolve(), + resolve({ resolveOnly }), commonjs(), ], output: { @@ -61,7 +63,7 @@ export default [ ], }), typescript({ compilerOptions: { declarationDir: "dist/esm", outDir: "dist/esm" } }), - resolve(), + resolve({ resolveOnly }), commonjs(), ], output: { diff --git a/lib/src/Accordion/Accordion.tsx b/lib/src/Accordion/Accordion.tsx index f3615adc9..b91af331a 100644 --- a/lib/src/Accordion/Accordion.tsx +++ b/lib/src/Accordion/Accordion.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import classnames from "classnames"; import { AccordionItemProps } from "./AccordionItem"; import "./accordion.scss"; diff --git a/lib/src/Accordion/AccordionItem.tsx b/lib/src/Accordion/AccordionItem.tsx index e09f92871..6e2a744f7 100644 --- a/lib/src/Accordion/AccordionItem.tsx +++ b/lib/src/Accordion/AccordionItem.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Collapse } from "../Collapse/Collapse"; import classnames from "classnames"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; export type AccordionItemProps = JSX.IntrinsicElements["div"] & { /** The header of the accordion item */ diff --git a/lib/src/Carousel/Carousel.tsx b/lib/src/Carousel/Carousel.tsx index 612fbbe3a..8018c929d 100644 --- a/lib/src/Carousel/Carousel.tsx +++ b/lib/src/Carousel/Carousel.tsx @@ -1,6 +1,6 @@ import React from "react"; import classnames from "classnames"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import { CarouselItemProps, AfterSlideEvent } from "./CarouselItem"; import { CarouselIndicators } from "./CarouselIndicators"; import { CarouselNavs } from "./CarouselNavs"; diff --git a/lib/src/Carousel/CarouselIndicators.test.tsx b/lib/src/Carousel/CarouselIndicators.test.tsx index c5b50dd36..9ab17dbc7 100644 --- a/lib/src/Carousel/CarouselIndicators.test.tsx +++ b/lib/src/Carousel/CarouselIndicators.test.tsx @@ -2,7 +2,7 @@ import React from "react"; import { act } from "react-dom/test-utils"; import { unmountComponentAtNode, render } from "react-dom"; import { CarouselIndicators } from "./CarouselIndicators"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; describe("Component: Carousel", () => { let container: HTMLDivElement = null; diff --git a/lib/src/Carousel/CarouselNavs.test.tsx b/lib/src/Carousel/CarouselNavs.test.tsx index dce73f154..8de6d45b6 100644 --- a/lib/src/Carousel/CarouselNavs.test.tsx +++ b/lib/src/Carousel/CarouselNavs.test.tsx @@ -2,7 +2,7 @@ import React from "react"; import { act, Simulate } from "react-dom/test-utils"; import { unmountComponentAtNode, render } from "react-dom"; import { CarouselNavs, CarouselNavsProps } from "./CarouselNavs"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; describe("Component: Carousel", () => { let container: HTMLDivElement = null; diff --git a/lib/src/Checkbox/Checkbox.tsx b/lib/src/Checkbox/Checkbox.tsx index f367578cd..8eaeb7d77 100644 --- a/lib/src/Checkbox/Checkbox.tsx +++ b/lib/src/Checkbox/Checkbox.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import classnames from "classnames"; import { FeedbackIndicator, Indicator } from "../FeedbackIndicator/FeedbackIndicator"; import "./checkbox.scss"; diff --git a/lib/src/Dropdown/CustomDropdownItem.tsx b/lib/src/Dropdown/CustomDropdownItem.tsx index 4f71e29ef..7f2c54696 100644 --- a/lib/src/Dropdown/CustomDropdownItem.tsx +++ b/lib/src/Dropdown/CustomDropdownItem.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import classnames from "classnames"; export type CustomDropdownItemProps = JSX.IntrinsicElements["input"] & { diff --git a/lib/src/Dropdown/Dropdown.tsx b/lib/src/Dropdown/Dropdown.tsx index e242794b5..acfe37756 100644 --- a/lib/src/Dropdown/Dropdown.tsx +++ b/lib/src/Dropdown/Dropdown.tsx @@ -1,10 +1,10 @@ import React from "react"; import { createPortal } from "react-dom"; import classnames from "classnames"; -import { useCombinedRefs } from "../hooks"; +import { useCombinedRefs } from "../hooks/useCombinedRef"; import { CloseButton } from "../CloseButton"; import { CustomDropdownItem } from "./CustomDropdownItem"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import "./dropdown.scss"; export interface DropdownText { diff --git a/lib/src/RadioButton/RadioButton.tsx b/lib/src/RadioButton/RadioButton.tsx index 144e69c01..bd1cdd29a 100644 --- a/lib/src/RadioButton/RadioButton.tsx +++ b/lib/src/RadioButton/RadioButton.tsx @@ -1,6 +1,6 @@ import React from "react"; import classnames from "classnames"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import { FeedbackIndicator, Indicator } from "../FeedbackIndicator"; import "./radio-button.scss"; diff --git a/lib/src/Stepper/Stepper.tsx b/lib/src/Stepper/Stepper.tsx index 0696df3b8..d1e41f180 100644 --- a/lib/src/Stepper/Stepper.tsx +++ b/lib/src/Stepper/Stepper.tsx @@ -1,6 +1,6 @@ import React from "react"; import classnames from "classnames"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import { FeedbackIndicator, Indicator } from "../FeedbackIndicator"; import "./stepper.scss"; diff --git a/lib/src/Table/parts/TableRow.tsx b/lib/src/Table/parts/TableRow.tsx index 7db422f7a..87d9e065a 100644 --- a/lib/src/Table/parts/TableRow.tsx +++ b/lib/src/Table/parts/TableRow.tsx @@ -4,7 +4,7 @@ import { Checkbox } from "../../Checkbox"; import { TableContext } from "../TableContextProvider"; import { TableHeaderCell, TableHeaderCellProps } from "./TableHeaderCell"; import { TableCell, TableCellProps } from "./TableCell"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; export type TableRowProps = JSX.IntrinsicElements["tr"] & { checked?: boolean; diff --git a/lib/src/Textarea/Textarea.tsx b/lib/src/Textarea/Textarea.tsx index 8d60b8b37..f35b69738 100644 --- a/lib/src/Textarea/Textarea.tsx +++ b/lib/src/Textarea/Textarea.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import classnames from "classnames"; import { FeedbackIndicator, Indicator } from "../FeedbackIndicator"; import "./textarea.scss"; diff --git a/lib/src/Textbox/Textbox.tsx b/lib/src/Textbox/Textbox.tsx index 84c951f49..15f115870 100644 --- a/lib/src/Textbox/Textbox.tsx +++ b/lib/src/Textbox/Textbox.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import classnames from "classnames"; import { FeedbackIndicator, Indicator } from "../FeedbackIndicator"; import "./textbox.scss"; diff --git a/lib/src/Toggle/Toggle.tsx b/lib/src/Toggle/Toggle.tsx index fe1b1bbd7..b1527d576 100644 --- a/lib/src/Toggle/Toggle.tsx +++ b/lib/src/Toggle/Toggle.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import classnames from "classnames"; import "./toggle.scss"; diff --git a/lib/src/ToggleSelector/ToggleSelector.tsx b/lib/src/ToggleSelector/ToggleSelector.tsx index de1fd5d07..ec3a9fb8f 100644 --- a/lib/src/ToggleSelector/ToggleSelector.tsx +++ b/lib/src/ToggleSelector/ToggleSelector.tsx @@ -2,7 +2,7 @@ import React from "react"; import classnames from "classnames"; import { ToggleSelectorItemProps } from "./ToggleSelectorItem"; import { FeedbackIndicator, Indicator } from "../FeedbackIndicator"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import "./toggle-selector.scss"; interface ToggleSelectorSingleProps { diff --git a/lib/src/ToggleSelector/ToggleSelectorItem.tsx b/lib/src/ToggleSelector/ToggleSelectorItem.tsx index 392bef1f0..811ae3f9e 100644 --- a/lib/src/ToggleSelector/ToggleSelectorItem.tsx +++ b/lib/src/ToggleSelector/ToggleSelectorItem.tsx @@ -1,6 +1,6 @@ import React from "react"; import classnames from "classnames"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import "./toggle-selector-item.scss"; export type ToggleSelectorItemProps = JSX.IntrinsicElements["input"] & { diff --git a/lib/src/Tooltip/Tooltip.tsx b/lib/src/Tooltip/Tooltip.tsx index 0b40f56ca..56954ab0c 100644 --- a/lib/src/Tooltip/Tooltip.tsx +++ b/lib/src/Tooltip/Tooltip.tsx @@ -1,6 +1,6 @@ -import React, { Children } from "react"; +import React from "react"; import { ElementPosition } from "./placement"; -import { randomId } from "@sebgroup/frontend-tools"; +import { randomId } from "@sebgroup/frontend-tools/randomId"; import { Overlay } from "./Overlay"; import classnames from "classnames"; import "./tooltip.scss"; diff --git a/lib/src/hooks/useDynamicForm.tsx b/lib/src/hooks/useDynamicForm.tsx index cd1e3ea2b..c0450e933 100644 --- a/lib/src/hooks/useDynamicForm.tsx +++ b/lib/src/hooks/useDynamicForm.tsx @@ -1,4 +1,4 @@ -import React, { useState, ReactNode, useMemo, useCallback } from "react"; +import React, { useState, ReactNode, useCallback } from "react"; import classnames from "classnames"; import { Checkbox } from "../Checkbox";