@navikt/ds-react 2.1.6 → 2.2.0
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/README.md +4 -5
- package/_docs.json +316 -295
- package/cjs/accordion/AccordionContent.js +2 -2
- package/cjs/accordion/AccordionHeader.js +2 -2
- package/cjs/alert/Alert.js +2 -2
- package/cjs/chat/Chat.js +3 -3
- package/cjs/date/hooks/useRangeDatepicker.js +1 -1
- package/cjs/toggle-group/ToggleGroup.js +2 -2
- package/esm/accordion/AccordionContent.js +1 -1
- package/esm/accordion/AccordionContent.js.map +1 -1
- package/esm/accordion/AccordionHeader.js +1 -1
- package/esm/accordion/AccordionHeader.js.map +1 -1
- package/esm/accordion/index.d.ts +1 -1
- package/esm/accordion/index.js.map +1 -1
- package/esm/alert/Alert.js +1 -1
- package/esm/alert/Alert.js.map +1 -1
- package/esm/alert/index.d.ts +1 -1
- package/esm/button/Button.d.ts +1 -1
- package/esm/button/Button.js.map +1 -1
- package/esm/button/index.d.ts +1 -1
- package/esm/chat/Chat.js +1 -1
- package/esm/chat/Chat.js.map +1 -1
- package/esm/chat/index.d.ts +1 -1
- package/esm/chat/index.js.map +1 -1
- package/esm/chips/Removable.d.ts +1 -1
- package/esm/chips/Toggle.d.ts +1 -1
- package/esm/chips/index.d.ts +1 -1
- package/esm/chips/index.js.map +1 -1
- package/esm/date/hooks/useRangeDatepicker.js +1 -1
- package/esm/date/hooks/useRangeDatepicker.js.map +1 -1
- package/esm/date/index.d.ts +6 -6
- package/esm/date/utils/index.d.ts +1 -1
- package/esm/date/utils/index.js.map +1 -1
- package/esm/form/Fieldset/index.d.ts +1 -1
- package/esm/form/checkbox/index.d.ts +2 -2
- package/esm/form/checkbox/index.js +1 -1
- package/esm/form/checkbox/index.js.map +1 -1
- package/esm/form/error-summary/index.d.ts +1 -1
- package/esm/form/index.d.ts +10 -10
- package/esm/form/index.js +1 -1
- package/esm/form/index.js.map +1 -1
- package/esm/form/radio/index.d.ts +2 -2
- package/esm/form/radio/index.js.map +1 -1
- package/esm/form/search/index.d.ts +1 -1
- package/esm/form/search/index.js +1 -1
- package/esm/form/search/index.js.map +1 -1
- package/esm/grid/index.d.ts +3 -3
- package/esm/grid/index.js.map +1 -1
- package/esm/guide-panel/index.d.ts +2 -2
- package/esm/guide-panel/index.js.map +1 -1
- package/esm/help-text/index.d.ts +1 -1
- package/esm/link/Link.d.ts +1 -1
- package/esm/link/index.d.ts +1 -1
- package/esm/link-panel/LinkPanelTitle.d.ts +1 -1
- package/esm/link-panel/index.d.ts +1 -1
- package/esm/loader/index.d.ts +1 -1
- package/esm/modal/index.d.ts +2 -2
- package/esm/modal/index.js.map +1 -1
- package/esm/pagination/index.d.ts +1 -1
- package/esm/pagination/index.js.map +1 -1
- package/esm/panel/Panel.d.ts +1 -1
- package/esm/panel/index.d.ts +1 -1
- package/esm/popover/index.d.ts +2 -2
- package/esm/popover/index.js.map +1 -1
- package/esm/read-more/index.d.ts +1 -1
- package/esm/stepper/index.d.ts +1 -1
- package/esm/stepper/index.js.map +1 -1
- package/esm/table/index.d.ts +8 -8
- package/esm/table/index.js.map +1 -1
- package/esm/tabs/index.d.ts +4 -4
- package/esm/tabs/index.js.map +1 -1
- package/esm/tag/index.d.ts +1 -1
- package/esm/tag/index.js.map +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +5 -0
- package/esm/toggle-group/ToggleGroup.js +2 -2
- package/esm/toggle-group/ToggleGroup.js.map +1 -1
- package/esm/toggle-group/index.d.ts +2 -2
- package/esm/toggle-group/index.js.map +1 -1
- package/esm/tooltip/index.d.ts +1 -1
- package/esm/tooltip/index.js.map +1 -1
- package/esm/typography/BodyLong.d.ts +1 -1
- package/esm/typography/BodyShort.d.ts +1 -1
- package/esm/typography/Detail.d.ts +1 -1
- package/esm/typography/ErrorMessage.d.ts +1 -1
- package/esm/typography/Heading.d.ts +1 -1
- package/esm/typography/Ingress.d.ts +1 -1
- package/esm/typography/Label.d.ts +1 -1
- package/esm/typography/index.d.ts +7 -7
- package/esm/typography/index.js +1 -1
- package/esm/typography/index.js.map +1 -1
- package/package.json +3 -3
- package/src/accordion/AccordionContent.tsx +1 -1
- package/src/accordion/AccordionHeader.tsx +1 -1
- package/src/accordion/accordion.stories.tsx +16 -14
- package/src/accordion/index.ts +1 -1
- package/src/alert/Alert.tsx +1 -1
- package/src/alert/alert.stories.tsx +48 -28
- package/src/alert/index.ts +1 -1
- package/src/button/Button.tsx +8 -1
- package/src/button/button.stories.tsx +118 -84
- package/src/button/index.ts +1 -1
- package/src/chat/Chat.tsx +1 -1
- package/src/chat/chat.stories.tsx +27 -25
- package/src/chat/index.ts +1 -1
- package/src/chips/Removable.tsx +1 -1
- package/src/chips/Toggle.tsx +1 -1
- package/src/chips/chips.stories.tsx +32 -29
- package/src/chips/index.ts +1 -1
- package/src/date/datepicker/datepicker.stories.tsx +87 -81
- package/src/date/hooks/useRangeDatepicker.tsx +1 -1
- package/src/date/index.ts +8 -8
- package/src/date/monthpicker/monthpicker.stories.tsx +13 -11
- package/src/date/utils/index.ts +1 -1
- package/src/form/Fieldset/index.ts +1 -1
- package/src/form/checkbox/checkbox.stories.tsx +66 -61
- package/src/form/checkbox/index.ts +5 -2
- package/src/form/error-summary/error-summary.stories.tsx +16 -14
- package/src/form/error-summary/index.ts +1 -1
- package/src/form/index.ts +16 -11
- package/src/form/radio/index.ts +2 -2
- package/src/form/radio/radio.stories.tsx +39 -34
- package/src/form/search/index.ts +5 -1
- package/src/form/search/search.stories.tsx +26 -23
- package/src/form/stories/confirmation-panel.stories.tsx +19 -17
- package/src/form/stories/fieldset.stories.tsx +13 -11
- package/src/form/stories/select.stories.tsx +12 -10
- package/src/form/stories/switch.stories.tsx +9 -7
- package/src/form/stories/text-field.stories.tsx +8 -6
- package/src/form/stories/textarea.stories.tsx +16 -14
- package/src/grid/index.ts +3 -3
- package/src/guide-panel/guidepanel.stories.tsx +21 -19
- package/src/guide-panel/index.ts +2 -2
- package/src/help-text/help-text.stories.tsx +11 -9
- package/src/help-text/index.ts +1 -1
- package/src/link/Link.tsx +1 -1
- package/src/link/index.ts +1 -1
- package/src/link/link.stories.tsx +24 -22
- package/src/link-panel/LinkPanelTitle.tsx +1 -1
- package/src/link-panel/index.ts +1 -1
- package/src/link-panel/link-panel.stories.tsx +19 -17
- package/src/loader/index.ts +1 -1
- package/src/loader/loader.stories.tsx +8 -6
- package/src/modal/index.ts +2 -2
- package/src/modal/modal.stories.tsx +35 -30
- package/src/pagination/index.ts +1 -1
- package/src/pagination/pagination.stories.tsx +41 -36
- package/src/panel/Panel.tsx +1 -1
- package/src/panel/index.ts +1 -1
- package/src/panel/panel.stories.tsx +17 -15
- package/src/popover/index.ts +2 -2
- package/src/popover/popover.stories.tsx +25 -19
- package/src/read-more/index.ts +1 -1
- package/src/read-more/readmore.stories.tsx +20 -17
- package/src/stepper/index.ts +1 -1
- package/src/stepper/stepper.stories.tsx +44 -41
- package/src/table/index.ts +8 -8
- package/src/tabs/Tabs.stories.tsx +24 -22
- package/src/tabs/index.ts +4 -4
- package/src/tag/index.ts +1 -1
- package/src/tag/tag.stories.tsx +10 -7
- package/src/toggle-group/ToggleGroup.stories.tsx +50 -18
- package/src/toggle-group/ToggleGroup.tsx +11 -1
- package/src/toggle-group/index.ts +2 -2
- package/src/tooltip/index.ts +1 -1
- package/src/tooltip/tooltip.stories.tsx +22 -20
- 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/typography/heading.stories.tsx +5 -3
- package/src/typography/index.ts +10 -7
- package/src/typography/typography.stories.tsx +0 -44
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Meta } from "@storybook/react
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Textarea } from "../index";
|
|
4
4
|
export default {
|
|
5
|
-
title: "ds-react/
|
|
5
|
+
title: "ds-react/Textarea",
|
|
6
6
|
component: Textarea,
|
|
7
7
|
argTypes: {
|
|
8
8
|
size: {
|
|
@@ -32,19 +32,21 @@ export default {
|
|
|
32
32
|
},
|
|
33
33
|
} as Meta;
|
|
34
34
|
|
|
35
|
-
export const Default =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
export const Default = {
|
|
36
|
+
render: (props) => {
|
|
37
|
+
return (
|
|
38
|
+
<Textarea
|
|
39
|
+
{...props}
|
|
40
|
+
maxLength={props?.maxLength ?? 100}
|
|
41
|
+
label="Ipsum enim quis culpa"
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
args: {
|
|
47
|
+
maxLength: 100,
|
|
48
|
+
resize: false,
|
|
49
|
+
},
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
export const Small = () => {
|
package/src/grid/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as Cell, CellProps } from "./Cell";
|
|
2
|
-
export { default as Grid, GridProps } from "./Grid";
|
|
1
|
+
export { default as Cell, type CellProps } from "./Cell";
|
|
2
|
+
export { default as Grid, type GridProps } from "./Grid";
|
|
3
3
|
export {
|
|
4
4
|
default as ContentContainer,
|
|
5
|
-
ContentContainerProps,
|
|
5
|
+
type ContentContainerProps,
|
|
6
6
|
} from "./ContentContainer";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BodyLong, GuidePanel } from "../index";
|
|
3
|
-
import { Meta } from "@storybook/react
|
|
3
|
+
import { Meta } from "@storybook/react";
|
|
4
4
|
export default {
|
|
5
5
|
title: "ds-react/GuidePanel",
|
|
6
6
|
component: GuidePanel,
|
|
@@ -11,26 +11,28 @@ adipisicing proident. Tempor ipsum ea cupidatat qui esse do veniam
|
|
|
11
11
|
cupidatat. Excepteur irure reprehenderit esse tempor nisi duis qui ea
|
|
12
12
|
enim id.`;
|
|
13
13
|
|
|
14
|
-
export const Default =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: (props) => {
|
|
16
|
+
const newProps = props?.colorOverride
|
|
17
|
+
? {
|
|
18
|
+
style: {
|
|
19
|
+
["--ac-guide-panel-illustration-bg" as any]: "var(--a-purple-200)",
|
|
20
|
+
["--ac-guide-panel-border" as any]: "var(--a-purple-400)",
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
: {};
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
25
|
+
return (
|
|
26
|
+
<GuidePanel {...newProps} poster={props?.poster}>
|
|
27
|
+
{panelText}
|
|
28
|
+
</GuidePanel>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
args: {
|
|
33
|
+
poster: false,
|
|
34
|
+
colorOverride: false,
|
|
35
|
+
},
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
export const Poster = () => <GuidePanel poster>{panelText}</GuidePanel>;
|
package/src/guide-panel/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as GuidePanel, GuidePanelProps } from "./GuidePanel";
|
|
2
|
-
export { GuideProps } from "./Guide";
|
|
1
|
+
export { default as GuidePanel, type GuidePanelProps } from "./GuidePanel";
|
|
2
|
+
export { type GuideProps } from "./Guide";
|
|
3
3
|
export { DefaultIllustration as GuideDefaultIllustration } from "./Illustration";
|
|
@@ -36,16 +36,18 @@ export default {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
export const Default =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
export const Default = {
|
|
40
|
+
render: (props: any) => {
|
|
41
|
+
return (
|
|
42
|
+
<HelpText title="show tooltip" strategy="fixed" {...props}>
|
|
43
|
+
Id ullamco excepteur elit fugiat labore.
|
|
44
|
+
</HelpText>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
args: {
|
|
49
|
+
title: "show tooltip",
|
|
50
|
+
},
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
export const Open = () => {
|
package/src/help-text/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as HelpText } from "./HelpText";
|
|
2
|
-
export { HelpTextProps } from "./HelpText";
|
|
2
|
+
export { type HelpTextProps } from "./HelpText";
|
package/src/link/Link.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import cl from "clsx";
|
|
3
|
-
import { OverridableComponent } from "
|
|
3
|
+
import { OverridableComponent } from "../util/OverridableComponent";
|
|
4
4
|
|
|
5
5
|
export interface LinkProps
|
|
6
6
|
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
package/src/link/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Link } from "./Link";
|
|
2
|
-
export { LinkProps } from "./Link";
|
|
2
|
+
export { type LinkProps } from "./Link";
|
|
@@ -11,30 +11,32 @@ export default {
|
|
|
11
11
|
component: Link,
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
export const Default =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (props.inline) {
|
|
22
|
-
return (
|
|
23
|
-
<BodyLong>
|
|
24
|
-
Incididunt laborum nisi nisi Lorem <LinkD /> in. Laborum aute fugiat
|
|
25
|
-
officia adipisicing non veniam dolor nulla non ex consectetur fugiat
|
|
26
|
-
eiusmod aute. Culpa sit aute est duis minim in in voluptate velit
|
|
27
|
-
fugiat. Laboris est id deserunt ut ea Lorem eu. Esse elit laboris aute
|
|
28
|
-
commodo sint laborum fugiat aliqua.
|
|
29
|
-
</BodyLong>
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: (props) => {
|
|
16
|
+
const LinkD = () => (
|
|
17
|
+
<Link href="#">
|
|
18
|
+
{props.icon && <Add />}Ex aliqua incididunt {props.icon && <Add />}
|
|
19
|
+
</Link>
|
|
30
20
|
);
|
|
31
|
-
}
|
|
32
|
-
return <LinkD />;
|
|
33
|
-
};
|
|
34
21
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
if (props.inline) {
|
|
23
|
+
return (
|
|
24
|
+
<BodyLong>
|
|
25
|
+
Incididunt laborum nisi nisi Lorem <LinkD /> in. Laborum aute fugiat
|
|
26
|
+
officia adipisicing non veniam dolor nulla non ex consectetur fugiat
|
|
27
|
+
eiusmod aute. Culpa sit aute est duis minim in in voluptate velit
|
|
28
|
+
fugiat. Laboris est id deserunt ut ea Lorem eu. Esse elit laboris aute
|
|
29
|
+
commodo sint laborum fugiat aliqua.
|
|
30
|
+
</BodyLong>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
return <LinkD />;
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
args: {
|
|
37
|
+
icon: false,
|
|
38
|
+
inline: false,
|
|
39
|
+
},
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
const DemoLink = () => (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from "react";
|
|
2
2
|
import cl from "clsx";
|
|
3
|
-
import { OverridableComponent } from "
|
|
3
|
+
import { OverridableComponent } from "../util/OverridableComponent";
|
|
4
4
|
|
|
5
5
|
interface LinkPanelTitleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
children: React.ReactNode;
|
package/src/link-panel/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as LinkPanel } from "./LinkPanel";
|
|
2
|
-
export { LinkPanelProps } from "./LinkPanel";
|
|
2
|
+
export { type LinkPanelProps } from "./LinkPanel";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta } from "@storybook/react
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { LinkPanel } from "..";
|
|
4
4
|
|
|
@@ -14,23 +14,25 @@ export default {
|
|
|
14
14
|
},
|
|
15
15
|
} as Meta;
|
|
16
16
|
|
|
17
|
-
export const Default =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<LinkPanel
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
export const Default = {
|
|
18
|
+
render: (props: any) => {
|
|
19
|
+
return (
|
|
20
|
+
<LinkPanel href="#" border={props?.border}>
|
|
21
|
+
<LinkPanel.Title>
|
|
22
|
+
Consectetur eu duis aliqua eu irure fugiat fugiat eu.
|
|
23
|
+
</LinkPanel.Title>
|
|
24
|
+
{props.description && (
|
|
25
|
+
<LinkPanel.Description>
|
|
26
|
+
Aliqua id aliquip Lorem esse
|
|
27
|
+
</LinkPanel.Description>
|
|
28
|
+
)}
|
|
29
|
+
</LinkPanel>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
args: {
|
|
34
|
+
description: false,
|
|
35
|
+
},
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
export const Description = () => {
|
package/src/loader/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Loader } from "./Loader";
|
|
2
|
-
export { LoaderProps } from "./Loader";
|
|
2
|
+
export { type LoaderProps } from "./Loader";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Loader } from "..";
|
|
3
|
-
import { Meta } from "@storybook/react
|
|
3
|
+
import { Meta } from "@storybook/react";
|
|
4
4
|
export default {
|
|
5
5
|
title: "ds-react/Loader",
|
|
6
6
|
component: Loader,
|
|
@@ -28,12 +28,14 @@ export default {
|
|
|
28
28
|
},
|
|
29
29
|
} as Meta;
|
|
30
30
|
|
|
31
|
-
export const Default =
|
|
32
|
-
|
|
33
|
-
}
|
|
31
|
+
export const Default = {
|
|
32
|
+
render: (props: any) => {
|
|
33
|
+
return <Loader {...props} />;
|
|
34
|
+
},
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
args: {
|
|
37
|
+
transparent: false,
|
|
38
|
+
},
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
export const Size = () => (
|
package/src/modal/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Modal, ModalProps } from "./Modal";
|
|
2
|
-
export { ModalContentProps } from "./ModalContent";
|
|
1
|
+
export { default as Modal, type ModalProps } from "./Modal";
|
|
2
|
+
export { type ModalContentProps } from "./ModalContent";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
import React, { useEffect, useState } from "react";
|
|
2
3
|
import { BodyLong, Button, Heading } from "..";
|
|
3
4
|
import Modal from "./Modal";
|
|
@@ -10,39 +11,43 @@ export default {
|
|
|
10
11
|
},
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
export const Default =
|
|
14
|
-
|
|
14
|
+
export const Default = {
|
|
15
|
+
render: (props) => {
|
|
16
|
+
const [open, setOpen] = useState(false);
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
Modal.setAppElement?.("#root");
|
|
20
|
+
}, []);
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<Button onClick={() => setOpen(true)}>Open Modal</Button>
|
|
25
|
+
<Modal
|
|
26
|
+
open={open}
|
|
27
|
+
onClose={() => setOpen(false)}
|
|
28
|
+
aria-labelledby="header123"
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
<Modal.Content>
|
|
32
|
+
<Heading spacing id="header123" level="1" size="large">
|
|
33
|
+
Header
|
|
34
|
+
</Heading>
|
|
35
|
+
<Heading spacing level="2" size="medium">
|
|
36
|
+
Header
|
|
37
|
+
</Heading>
|
|
38
|
+
<BodyLong>
|
|
39
|
+
Voluptate laboris mollit dolore qui. Magna elit.
|
|
40
|
+
</BodyLong>
|
|
41
|
+
</Modal.Content>
|
|
42
|
+
</Modal>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
},
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
args: {
|
|
48
|
+
shouldCloseOnOverlayClick: true,
|
|
49
|
+
closeButton: true,
|
|
50
|
+
},
|
|
46
51
|
};
|
|
47
52
|
|
|
48
53
|
export const ParentSelector = () => {
|
package/src/pagination/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Pagination, PaginationProps } from "./Pagination";
|
|
1
|
+
export { default as Pagination, type PaginationProps } from "./Pagination";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
import React, { useState } from "react";
|
|
2
3
|
import { Link, HashRouter as Router } from "react-router-dom";
|
|
3
4
|
import Pagination from "./Pagination";
|
|
@@ -15,17 +16,19 @@ export default {
|
|
|
15
16
|
},
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
export const Default =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
19
|
+
export const Default = {
|
|
20
|
+
render: (props: any) => {
|
|
21
|
+
const [page, setPage] = useState(props.page);
|
|
22
|
+
return <Pagination {...props} page={page} onPageChange={setPage} />;
|
|
23
|
+
},
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
args: {
|
|
26
|
+
page: 2,
|
|
27
|
+
count: 8,
|
|
28
|
+
siblingCount: 1,
|
|
29
|
+
boundaryCount: 1,
|
|
30
|
+
prevNextTexts: false,
|
|
31
|
+
},
|
|
29
32
|
};
|
|
30
33
|
|
|
31
34
|
export const PrevNextText = () => {
|
|
@@ -83,30 +86,32 @@ export const XSmall = () => {
|
|
|
83
86
|
);
|
|
84
87
|
};
|
|
85
88
|
|
|
86
|
-
export const AsLink =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
89
|
+
export const AsLink = {
|
|
90
|
+
render: () => {
|
|
91
|
+
const [page, setPage] = useState(1);
|
|
92
|
+
const props = {
|
|
93
|
+
page: 1,
|
|
94
|
+
count: 8,
|
|
95
|
+
siblingCount: 1,
|
|
96
|
+
boundaryCount: 1,
|
|
97
|
+
};
|
|
98
|
+
return (
|
|
99
|
+
<Pagination
|
|
100
|
+
{...props}
|
|
101
|
+
page={page}
|
|
102
|
+
onPageChange={setPage}
|
|
103
|
+
renderItem={(item) => (
|
|
104
|
+
<Pagination.Item {...item} as={Link} to={`?page=${item.page}`} />
|
|
105
|
+
)}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
},
|
|
105
109
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
]
|
|
110
|
+
decorators: [
|
|
111
|
+
(Story) => (
|
|
112
|
+
<Router>
|
|
113
|
+
<Story />
|
|
114
|
+
</Router>
|
|
115
|
+
),
|
|
116
|
+
],
|
|
117
|
+
};
|
package/src/panel/Panel.tsx
CHANGED
package/src/panel/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as Panel } from "./Panel";
|
|
2
|
-
export { PanelProps } from "./Panel";
|
|
2
|
+
export { type PanelProps } from "./Panel";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Panel } from "../index";
|
|
3
|
-
import { Meta } from "@storybook/react
|
|
3
|
+
import { Meta } from "@storybook/react";
|
|
4
4
|
export default {
|
|
5
5
|
title: "ds-react/Panel",
|
|
6
6
|
component: Panel,
|
|
@@ -14,20 +14,22 @@ export default {
|
|
|
14
14
|
},
|
|
15
15
|
} as Meta;
|
|
16
16
|
|
|
17
|
-
export const Default =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
export const Default = {
|
|
18
|
+
render: (props) => {
|
|
19
|
+
return (
|
|
20
|
+
<Panel {...props}>
|
|
21
|
+
Eu quis exercitation voluptate ex. Aute irure esse occaecat minim
|
|
22
|
+
cupidatat velit minim duis sint culpa anim laboris. Consectetur nulla eu
|
|
23
|
+
commodo ea culpa velit commodo incididunt sunt ipsum. Amet anim
|
|
24
|
+
adipisicing minim ipsum do. Non laborum culpa reprehenderit est sint
|
|
25
|
+
officia quis excepteur. Fugiat eiusmod eiusmod commodo incididunt nisi
|
|
26
|
+
minim ex eu cupidatat quis ex. Lorem irure ea ea enim consectetur ea
|
|
27
|
+
aliqua cupidatat. Officia aute veniam aute exercitation ipsum aliqua
|
|
28
|
+
adipisicing. Est aliqua ad ullamco aute nostrud amet ea adipisicing
|
|
29
|
+
consequat id officia irure pariatur. Eu mollit amet culpa culpa velit.
|
|
30
|
+
</Panel>
|
|
31
|
+
);
|
|
32
|
+
},
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
export const Border = () => {
|
package/src/popover/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as Popover, PopoverProps } from "./Popover";
|
|
2
|
-
export { PopoverContentProps } from "./PopoverContent";
|
|
1
|
+
export { default as Popover, type PopoverProps } from "./Popover";
|
|
2
|
+
export { type PopoverContentProps } from "./PopoverContent";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
1
2
|
import React, { useState } from "react";
|
|
2
3
|
import { Popover } from "../index";
|
|
3
4
|
import { Button } from "../button";
|
|
@@ -55,28 +56,33 @@ export default {
|
|
|
55
56
|
},
|
|
56
57
|
};
|
|
57
58
|
|
|
58
|
-
export const Default =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
59
|
+
export const Default = {
|
|
60
|
+
render: (props: any) => {
|
|
61
|
+
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>();
|
|
62
|
+
const [open, setOpen] = useState<boolean>(false);
|
|
63
|
+
return (
|
|
64
|
+
<div>
|
|
65
|
+
<Button
|
|
66
|
+
ref={(el) => setAnchorEl(el)}
|
|
67
|
+
onClick={() => setOpen((x) => !x)}
|
|
68
|
+
>
|
|
69
|
+
Open
|
|
70
|
+
</Button>
|
|
71
|
+
<Popover
|
|
72
|
+
{...props}
|
|
73
|
+
open={props.open ?? open}
|
|
74
|
+
anchorEl={anchorEl}
|
|
75
|
+
onClose={(e) => setOpen(e)}
|
|
76
|
+
>
|
|
77
|
+
<Popover.Content>Velit in consequat</Popover.Content>
|
|
78
|
+
</Popover>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
},
|
|
76
82
|
};
|
|
77
83
|
|
|
78
84
|
const Template = (props) => {
|
|
79
|
-
const [anchorEl, setAnchorEl] = useState(null);
|
|
85
|
+
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
|
|
80
86
|
|
|
81
87
|
return (
|
|
82
88
|
<>
|
package/src/read-more/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as ReadMore } from "./ReadMore";
|
|
2
|
-
export { ReadMoreProps } from "./ReadMore";
|
|
2
|
+
export { type ReadMoreProps } from "./ReadMore";
|