@nulogy/components 15.2.0 → 15.2.2
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 +3 -3
- package/dist/main.js +5735 -5628
- package/dist/main.module.js +5731 -5624
- package/dist/src/Alert/Alert.story.d.ts +15 -19
- package/dist/src/Alert/Alert.story.js +25 -14
- package/dist/src/BrandedNavBar/NavBar.story.d.ts +4 -6
- package/dist/src/BrandedNavBar/NavBar.story.js +11 -3
- package/dist/src/BrandedNavBar/SmallNavBar.story.d.ts +5 -2
- package/dist/src/BrandedNavBar/SmallNavBar.story.js +26 -5
- package/dist/src/DatePickers/stories/DatePicker.story.d.ts +7 -3
- package/dist/src/DatePickers/stories/DatePicker.story.js +54 -22
- package/dist/src/DescriptionList/lib/utils.js +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.column.story.js +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.group-min-width.story.d.ts +7 -8
- package/dist/src/DescriptionList/stories/DescriptionList.group-min-width.story.js +15 -12
- package/dist/src/DescriptionList/stories/DescriptionList.layout.story.js +1 -1
- package/dist/src/DescriptionList/stories/DescriptionList.playground.story.d.ts +7 -8
- package/dist/src/DescriptionList/stories/DescriptionList.playground.story.js +200 -195
- package/dist/src/Layout/Header.d.ts +1 -1
- package/dist/src/Layout/Header.story.d.ts +10 -9
- package/dist/src/Layout/Header.story.js +9 -8
- package/dist/src/Layout/Sidebar.story.d.ts +4 -1
- package/dist/src/Layout/Sidebar.story.js +10 -3
- package/dist/src/Modal/Modal.story.d.ts +39 -61
- package/dist/src/Modal/Modal.story.js +110 -85
- package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.d.ts +2 -1
- package/dist/src/Radio/Radio.story.d.ts +316 -32
- package/dist/src/Radio/Radio.story.js +36 -22
- package/dist/src/Select/MenuList.js +1 -1
- package/dist/src/Select/Select.d.ts +1 -1
- package/dist/src/Select/Select.spec-utils.js +1 -0
- package/dist/src/Select/Select.story.d.ts +5 -1
- package/dist/src/Select/Select.story.js +93 -2
- package/dist/src/Table/stories/BaseTable.story.d.ts +11 -7
- package/dist/src/Table/stories/BaseTable.story.js +156 -34
- package/dist/src/Table/stories/SortingColumnHeader.story.d.ts +5 -2
- package/dist/src/Table/stories/SortingColumnHeader.story.js +20 -3
- package/dist/src/Table/stories/Table.story.d.ts +7 -14
- package/dist/src/Table/stories/Table.story.js +172 -127
- package/dist/src/Toggle/ToggleButton.js +1 -1
- package/dist/src/Tooltip/Tooltip.story.d.ts +15 -52
- package/dist/src/Tooltip/Tooltip.story.js +79 -71
- package/dist/src/testing/matchers/toHaveStyle.d.ts +15 -0
- package/dist/src/testing/matchers/toHaveStyle.js +50 -0
- package/dist/src/testing/matchers/toMatchDate.d.ts +1 -0
- package/dist/src/testing/matchers/toMatchDate.js +1 -1
- package/dist/src/utils/DetectOutsideClick.d.ts +3 -0
- package/dist/src/utils/DetectOutsideClick.js +3 -0
- package/dist/src/utils/ScrollIndicators.js +1 -1
- package/dist/src/utils/generateId.d.ts +5 -0
- package/dist/src/utils/generateId.js +5 -0
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/index.js +0 -1
- package/dist/src/utils/numberFromDimension/numberFromDimension.spec.js +1 -0
- package/dist/vitest.config.d.ts +2 -0
- package/dist/vitest.config.js +11 -0
- package/package.json +24 -61
- package/dist/src/NDSProvider/mountWithNDSProvider.spec-utils.d.ts +0 -1
- package/dist/src/NDSProvider/mountWithNDSProvider.spec-utils.js +0 -4
- package/dist/src/utils/withWindowDimensions.d.ts +0 -3
- package/dist/src/utils/withWindowDimensions.js +0 -28
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { StoryObj } from "@storybook/react";
|
|
2
|
+
import { Tooltip } from "../index";
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
5
|
+
component: typeof Tooltip;
|
|
4
6
|
parameters: {
|
|
5
7
|
chromatic: {
|
|
6
8
|
disable: boolean;
|
|
@@ -8,54 +10,15 @@ declare const _default: {
|
|
|
8
10
|
};
|
|
9
11
|
};
|
|
10
12
|
export default _default;
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
export declare const WithPlacement: {
|
|
25
|
-
(): React.JSX.Element;
|
|
26
|
-
story: {
|
|
27
|
-
name: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export declare const WithLinkPassedIn: {
|
|
31
|
-
(): React.JSX.Element;
|
|
32
|
-
story: {
|
|
33
|
-
name: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export declare const WithButtonPassedIn: {
|
|
37
|
-
(): React.JSX.Element;
|
|
38
|
-
story: {
|
|
39
|
-
name: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export declare const WithCustomShowDelay: {
|
|
43
|
-
(): React.JSX.Element;
|
|
44
|
-
story: {
|
|
45
|
-
name: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export declare const WithOtherFocusableElements: {
|
|
49
|
-
(): React.JSX.Element;
|
|
50
|
-
story: {
|
|
51
|
-
name: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
export declare const OpenByDefault: {
|
|
55
|
-
(): React.JSX.Element;
|
|
56
|
-
story: {
|
|
57
|
-
name: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export declare const WithCustomComponent: () => React.JSX.Element;
|
|
61
|
-
export declare const WithCustomTooltip: () => React.JSX.Element;
|
|
13
|
+
type Story = StoryObj<typeof Tooltip>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const WithWrappedText: Story;
|
|
16
|
+
export declare const WithCustomMaxWidth: Story;
|
|
17
|
+
export declare const WithPlacement: Story;
|
|
18
|
+
export declare const WithLinkPassedIn: Story;
|
|
19
|
+
export declare const WithButtonPassedIn: Story;
|
|
20
|
+
export declare const WithCustomShowDelay: Story;
|
|
21
|
+
export declare const WithOtherFocusableElements: Story;
|
|
22
|
+
export declare const OpenByDefault: Story;
|
|
23
|
+
export declare const WithCustomComponent: Story;
|
|
24
|
+
export declare const WithCustomTooltip: Story;
|
|
@@ -2,93 +2,98 @@ import React from "react";
|
|
|
2
2
|
import { Box, Button, DescriptionDetails, DescriptionList, DescriptionTerm, Divider, Flex, Icon, Link, StatusIndicator, Text, Tooltip, } from "../index";
|
|
3
3
|
export default {
|
|
4
4
|
title: "Components/Tooltip",
|
|
5
|
+
component: Tooltip,
|
|
5
6
|
parameters: {
|
|
6
7
|
chromatic: { disable: true },
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
|
-
export const
|
|
10
|
-
React.createElement(
|
|
11
|
-
React.createElement(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: () => (React.createElement(Flex, { p: "x8" },
|
|
12
|
+
React.createElement(Tooltip, { tooltip: "I am a Tooltip!" },
|
|
13
|
+
React.createElement(Button, { "data-testid": "tooltip-trigger" }, "Button")))),
|
|
14
|
+
};
|
|
15
|
+
export const WithWrappedText = {
|
|
16
|
+
render: () => (React.createElement(Flex, { p: "x8" },
|
|
17
|
+
React.createElement(Tooltip, { placement: "bottom", tooltip: "I am a Tooltip! I have very long text, and my default max-width is 24em (based on 14px font-size), which is equal to 336px, or approximately 45 characters.", defaultOpen: true },
|
|
18
|
+
React.createElement(Button, null, " Button ")))),
|
|
16
19
|
name: "with wrapped text",
|
|
17
20
|
};
|
|
18
|
-
export const WithCustomMaxWidth =
|
|
19
|
-
React.createElement(
|
|
20
|
-
React.createElement(
|
|
21
|
-
|
|
21
|
+
export const WithCustomMaxWidth = {
|
|
22
|
+
render: (args) => (React.createElement(Flex, { p: "x8" },
|
|
23
|
+
React.createElement(Tooltip, Object.assign({}, args, { placement: "bottom", tooltip: "I am a Tooltip! I have very long text, but I have a smaller maxWidth prop that causes me to wrap frequently.", maxWidth: "128px", defaultOpen: true }),
|
|
24
|
+
React.createElement(Button, null, " Button ")))),
|
|
22
25
|
name: "with custom maxWidth",
|
|
23
26
|
};
|
|
24
|
-
export const WithPlacement =
|
|
25
|
-
React.createElement(
|
|
26
|
-
React.createElement(
|
|
27
|
-
React.createElement(
|
|
28
|
-
|
|
29
|
-
React.createElement(
|
|
30
|
-
|
|
31
|
-
React.createElement(
|
|
32
|
-
|
|
33
|
-
React.createElement(
|
|
34
|
-
React.createElement(
|
|
35
|
-
|
|
36
|
-
React.createElement(
|
|
37
|
-
|
|
38
|
-
React.createElement(
|
|
39
|
-
|
|
40
|
-
React.createElement(
|
|
41
|
-
React.createElement(
|
|
42
|
-
|
|
43
|
-
React.createElement(
|
|
44
|
-
|
|
45
|
-
React.createElement(
|
|
46
|
-
|
|
47
|
-
React.createElement(
|
|
48
|
-
React.createElement(
|
|
49
|
-
|
|
50
|
-
React.createElement(
|
|
51
|
-
|
|
52
|
-
React.createElement(
|
|
53
|
-
|
|
27
|
+
export const WithPlacement = {
|
|
28
|
+
render: () => (React.createElement(React.Fragment, null,
|
|
29
|
+
React.createElement(Flex, { my: "x6", mx: "x8", justifyContent: "space-around" },
|
|
30
|
+
React.createElement(Tooltip, { placement: "top-start", tooltip: "top-start", defaultOpen: true },
|
|
31
|
+
React.createElement(Button, null, "Tooltip trigger")),
|
|
32
|
+
React.createElement(Tooltip, { placement: "top", tooltip: "top", defaultOpen: true },
|
|
33
|
+
React.createElement(Button, null, "Tooltip trigger")),
|
|
34
|
+
React.createElement(Tooltip, { placement: "top-end", tooltip: "top-end", defaultOpen: true },
|
|
35
|
+
React.createElement(Button, null, "Tooltip trigger"))),
|
|
36
|
+
React.createElement(Flex, { my: "x6", mx: "x8", justifyContent: "space-around" },
|
|
37
|
+
React.createElement(Tooltip, { placement: "left-start", tooltip: "left-start", defaultOpen: true },
|
|
38
|
+
React.createElement(Button, null, "Tooltip trigger")),
|
|
39
|
+
React.createElement(Tooltip, { placement: "left", tooltip: "left", defaultOpen: true },
|
|
40
|
+
React.createElement(Button, null, "Tooltip trigger")),
|
|
41
|
+
React.createElement(Tooltip, { placement: "left-end", tooltip: "left-end", defaultOpen: true },
|
|
42
|
+
React.createElement(Button, null, "Tooltip trigger"))),
|
|
43
|
+
React.createElement(Flex, { my: "x6", mx: "x8", justifyContent: "space-around" },
|
|
44
|
+
React.createElement(Tooltip, { placement: "right-start", tooltip: "right-start", defaultOpen: true },
|
|
45
|
+
React.createElement(Button, null, "Tooltip trigger")),
|
|
46
|
+
React.createElement(Tooltip, { placement: "right", tooltip: "right", defaultOpen: true },
|
|
47
|
+
React.createElement(Button, null, "Tooltip trigger")),
|
|
48
|
+
React.createElement(Tooltip, { placement: "right-end", tooltip: "right-end", defaultOpen: true },
|
|
49
|
+
React.createElement(Button, null, "Tooltip trigger"))),
|
|
50
|
+
React.createElement(Flex, { my: "x6", mx: "x8", justifyContent: "space-around" },
|
|
51
|
+
React.createElement(Tooltip, { placement: "bottom-start", tooltip: "bottom-start", defaultOpen: true },
|
|
52
|
+
React.createElement(Button, null, "Tooltip trigger")),
|
|
53
|
+
React.createElement(Tooltip, { placement: "bottom", tooltip: "bottom", defaultOpen: true },
|
|
54
|
+
React.createElement(Button, null, "Tooltip trigger")),
|
|
55
|
+
React.createElement(Tooltip, { placement: "bottom-end", tooltip: "bottom-end", defaultOpen: true },
|
|
56
|
+
React.createElement(Button, null, "Tooltip trigger"))))),
|
|
54
57
|
name: "with placement",
|
|
55
58
|
};
|
|
56
|
-
export const WithLinkPassedIn =
|
|
57
|
-
React.createElement(
|
|
58
|
-
|
|
59
|
+
export const WithLinkPassedIn = {
|
|
60
|
+
render: (args) => (React.createElement(Tooltip, Object.assign({}, args, { placement: "bottom", tooltip: React.createElement(Link, { href: "/" }, " Link "), defaultOpen: true }),
|
|
61
|
+
React.createElement(Button, null, " Button "))),
|
|
59
62
|
name: "with Link passed in",
|
|
60
63
|
};
|
|
61
|
-
export const WithButtonPassedIn =
|
|
62
|
-
React.createElement(Button,
|
|
63
|
-
|
|
64
|
+
export const WithButtonPassedIn = {
|
|
65
|
+
render: (args) => (React.createElement(Tooltip, Object.assign({}, args, { placement: "bottom", tooltip: React.createElement(Button, { href: "/" }, " Button "), defaultOpen: true }),
|
|
66
|
+
React.createElement(Button, null, " Button "))),
|
|
64
67
|
name: "with Button passed in",
|
|
65
68
|
};
|
|
66
|
-
export const WithCustomShowDelay =
|
|
67
|
-
React.createElement(
|
|
68
|
-
|
|
69
|
+
export const WithCustomShowDelay = {
|
|
70
|
+
render: (args) => (React.createElement(Tooltip, Object.assign({}, args, { placement: "bottom", tooltip: "Tooltip", showDelay: "1000" }),
|
|
71
|
+
React.createElement(Button, null, " Button "))),
|
|
69
72
|
name: "with custom showDelay",
|
|
70
73
|
};
|
|
71
|
-
export const WithOtherFocusableElements =
|
|
72
|
-
React.createElement(
|
|
73
|
-
React.createElement(
|
|
74
|
-
|
|
75
|
-
React.createElement(
|
|
76
|
-
|
|
77
|
-
React.createElement(
|
|
78
|
-
|
|
79
|
-
React.createElement(
|
|
80
|
-
|
|
81
|
-
React.createElement(
|
|
82
|
-
|
|
74
|
+
export const WithOtherFocusableElements = {
|
|
75
|
+
render: () => (React.createElement(React.Fragment, null,
|
|
76
|
+
React.createElement(Tooltip, { placement: "bottom", tooltip: "Tooltip" },
|
|
77
|
+
React.createElement(Button, null, " Button ")),
|
|
78
|
+
React.createElement(Tooltip, { placement: "bottom", tooltip: "Tooltip" },
|
|
79
|
+
React.createElement(Link, { href: "/" }, " Link ")),
|
|
80
|
+
React.createElement(Tooltip, { placement: "bottom", tooltip: "Tooltip" },
|
|
81
|
+
React.createElement(Text, { mr: "x2", inline: true, bg: "blue" }, "Inline Text")),
|
|
82
|
+
React.createElement(Tooltip, { placement: "bottom", tooltip: "Tooltip" },
|
|
83
|
+
React.createElement(Box, { width: "200px", bg: "blue" }, "Box width 200px")),
|
|
84
|
+
React.createElement(Tooltip, { placement: "bottom", tooltip: "Tooltip" },
|
|
85
|
+
React.createElement(Box, { bg: "blue" }, "Box")))),
|
|
83
86
|
name: "with other focusable elements",
|
|
84
87
|
};
|
|
85
|
-
export const OpenByDefault =
|
|
86
|
-
React.createElement(
|
|
87
|
-
|
|
88
|
+
export const OpenByDefault = {
|
|
89
|
+
render: (args) => (React.createElement(Tooltip, Object.assign({}, args, { tooltip: "I am an open Tooltip!", defaultOpen: true }),
|
|
90
|
+
React.createElement(Button, null, "Hover me"))),
|
|
88
91
|
name: "open by default",
|
|
89
92
|
};
|
|
90
|
-
export const WithCustomComponent =
|
|
91
|
-
React.createElement(
|
|
93
|
+
export const WithCustomComponent = {
|
|
94
|
+
render: (args) => (React.createElement(Tooltip, Object.assign({}, args, { tooltip: "See me on hover!", defaultOpen: true }),
|
|
95
|
+
React.createElement(CustomComponent, null))),
|
|
96
|
+
};
|
|
92
97
|
const CustomComponent = React.forwardRef((props, forwardedRef) => (React.createElement("span", Object.assign({ ref: forwardedRef }, props),
|
|
93
98
|
React.createElement(Text, { inline: true }, "This component uses the forwardedRef from the Tooltip wrapping it"))));
|
|
94
99
|
const CustomTooltip = () => (React.createElement(Flex, { flexDirection: "column", width: "320px", p: "x1_5" },
|
|
@@ -115,7 +120,10 @@ const CustomTooltip = () => (React.createElement(Flex, { flexDirection: "column"
|
|
|
115
120
|
"US $202.12 ",
|
|
116
121
|
React.createElement(Icon, { icon: "arrowForward", color: "midGrey" }),
|
|
117
122
|
" CA $287.43")))));
|
|
118
|
-
export const WithCustomTooltip =
|
|
119
|
-
React.createElement(
|
|
120
|
-
|
|
121
|
-
React.createElement(
|
|
123
|
+
export const WithCustomTooltip = {
|
|
124
|
+
render: () => (React.createElement(Flex, { alignItems: "center", gap: "half" },
|
|
125
|
+
React.createElement(Text, { fontSize: "small", color: "darkGrey" }, "You can embed custom components in the tooltip"),
|
|
126
|
+
React.createElement(Tooltip, { maxWidth: "340px", tooltip: React.createElement(CustomTooltip, null), defaultOpen: true },
|
|
127
|
+
React.createElement(Icon, { icon: "info", size: "x3", color: "darkGrey" })))),
|
|
128
|
+
name: "with custom tooltip",
|
|
129
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to check if an element has a specific computed style.
|
|
3
|
+
* @param element - The DOM element to check
|
|
4
|
+
* @param styleString - CSS style string in the format "property: value" (e.g., "opacity: 0", "z-index: 1001")
|
|
5
|
+
* @returns true if the computed style matches, false otherwise
|
|
6
|
+
*/
|
|
7
|
+
export declare function hasComputedStyle(element: HTMLElement | null, styleString: string): boolean;
|
|
8
|
+
declare module "vitest" {
|
|
9
|
+
interface Assertion {
|
|
10
|
+
toHaveComputedStyle(styleString: string): void;
|
|
11
|
+
}
|
|
12
|
+
interface AsymmetricMatchersContaining {
|
|
13
|
+
toHaveComputedStyle(styleString: string): void;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { expect } from "vitest";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to check if an element has a specific computed style.
|
|
4
|
+
* @param element - The DOM element to check
|
|
5
|
+
* @param styleString - CSS style string in the format "property: value" (e.g., "opacity: 0", "z-index: 1001")
|
|
6
|
+
* @returns true if the computed style matches, false otherwise
|
|
7
|
+
*/
|
|
8
|
+
export function hasComputedStyle(element, styleString) {
|
|
9
|
+
if (!element) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
const [property, value] = styleString.split(":").map((s) => s.trim());
|
|
13
|
+
const computedStyle = window.getComputedStyle(element);
|
|
14
|
+
const actualValue = computedStyle.getPropertyValue(property);
|
|
15
|
+
// Normalize values for comparison
|
|
16
|
+
// Handle numeric values (e.g., "0" vs "0px" for opacity, "1001" vs "1001px" for z-index)
|
|
17
|
+
const normalizedExpected = value.trim();
|
|
18
|
+
const normalizedActual = actualValue.trim();
|
|
19
|
+
// For numeric values, compare as numbers
|
|
20
|
+
const expectedNum = parseFloat(normalizedExpected);
|
|
21
|
+
const actualNum = parseFloat(normalizedActual);
|
|
22
|
+
if (!isNaN(expectedNum) && !isNaN(actualNum)) {
|
|
23
|
+
return expectedNum === actualNum;
|
|
24
|
+
}
|
|
25
|
+
// For non-numeric values, do exact string comparison
|
|
26
|
+
return normalizedExpected === normalizedActual;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Custom Vitest matcher to check computed styles.
|
|
30
|
+
* Usage: expect(element).toHaveComputedStyle("opacity: 0")
|
|
31
|
+
*/
|
|
32
|
+
expect.extend({
|
|
33
|
+
toHaveComputedStyle(received, styleString) {
|
|
34
|
+
const pass = hasComputedStyle(received, styleString);
|
|
35
|
+
const [property, value] = styleString.split(":").map((s) => s.trim());
|
|
36
|
+
if (pass) {
|
|
37
|
+
return {
|
|
38
|
+
message: () => `expected element not to have computed style ${property}: ${value}`,
|
|
39
|
+
pass: true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
const actualValue = received ? window.getComputedStyle(received).getPropertyValue(property) : "element is null";
|
|
44
|
+
return {
|
|
45
|
+
message: () => `expected element to have computed style ${property}: ${value}, but got ${actualValue}`,
|
|
46
|
+
pass: false,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Icon } from "../Icon";
|
|
3
2
|
import styled from "styled-components";
|
|
4
3
|
import { position } from "styled-system";
|
|
4
|
+
import { Icon } from "../Icon";
|
|
5
5
|
const ScrollIndicatorWrapper = styled.div(({ theme }) => ({
|
|
6
6
|
position: "absolute",
|
|
7
7
|
left: `calc(50% - ${theme.space.x3})`,
|
|
@@ -2,7 +2,6 @@ export { default as ClickInputLabel } from "./ClickInputLabel";
|
|
|
2
2
|
export { default as omit } from "./omit";
|
|
3
3
|
export { default as subPx } from "./subPx";
|
|
4
4
|
export { default as generateId } from "./generateId";
|
|
5
|
-
export { default as withWindowDimensions } from "./withWindowDimensions";
|
|
6
5
|
export { default as DetectOutsideClick } from "./DetectOutsideClick";
|
|
7
6
|
export { default as PopperArrow } from "./PopperArrow";
|
|
8
7
|
export { default as ScrollIndicators } from "./ScrollIndicators";
|
package/dist/src/utils/index.js
CHANGED
|
@@ -2,7 +2,6 @@ export { default as ClickInputLabel } from "./ClickInputLabel";
|
|
|
2
2
|
export { default as omit } from "./omit";
|
|
3
3
|
export { default as subPx } from "./subPx";
|
|
4
4
|
export { default as generateId } from "./generateId";
|
|
5
|
-
export { default as withWindowDimensions } from "./withWindowDimensions";
|
|
6
5
|
export { default as DetectOutsideClick } from "./DetectOutsideClick";
|
|
7
6
|
export { default as PopperArrow } from "./PopperArrow";
|
|
8
7
|
export { default as ScrollIndicators } from "./ScrollIndicators";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { resolve } from "path";
|
|
2
|
+
import { defineConfig } from "vitest/config";
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
environment: "jsdom",
|
|
6
|
+
globals: false,
|
|
7
|
+
include: ["**/*.spec.tsx", "**/*.spec.ts"],
|
|
8
|
+
exclude: ["**/node_modules/**", "**/cypress/**", "**/dist/**"],
|
|
9
|
+
setupFiles: [resolve(__dirname, "spec/support/vitestAutoCleanup.ts")],
|
|
10
|
+
},
|
|
11
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nulogy/components",
|
|
3
|
-
"version": "15.2.
|
|
3
|
+
"version": "15.2.2",
|
|
4
4
|
"description": "Component library for the Nulogy Design System - http://nulogy.design",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"start-server": "yarn build:storybook && yarn http-server -p 9999 ./storybook-static",
|
|
13
13
|
"start": "concurrently \"yarn build:watch\" \"yarn start:storybook\"",
|
|
14
14
|
"start:cypress": "start-server-and-test start 9999 'cypress open'",
|
|
15
|
-
"start:storybook": "
|
|
15
|
+
"start:storybook": "storybook dev -p 9999",
|
|
16
16
|
"clean:storybook": "rm -rf node_modules/.cache/storybook && rm -rf ./storybook-static",
|
|
17
17
|
"build": "rollup -c",
|
|
18
18
|
"build:watch": "rollup -c --watch",
|
|
19
|
-
"build:storybook": "build
|
|
19
|
+
"build:storybook": "storybook build",
|
|
20
20
|
"warn:prepush": "echo \"Make sure you also run all the other CI steps before pushing by running 'yarn ci'\"",
|
|
21
21
|
"check": "yarn warn:prepush && yarn check:types && yarn check:lint && yarn check:format",
|
|
22
22
|
"check:types": "tsc && cd cypress && tsc --noEmit",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"fix:lint": "yarn check:lint --fix",
|
|
27
27
|
"fix:format": "prettier -w .",
|
|
28
28
|
"test": "yarn test:components && yarn run test:cypress",
|
|
29
|
-
"test:components": "
|
|
29
|
+
"test:components": "vitest run",
|
|
30
|
+
"test:components:watch": "vitest",
|
|
30
31
|
"test:cypress": "start-server-and-test start-server 9999 'cypress run'",
|
|
31
32
|
"test:visual": "npx chromatic --project-token $CHROMATIC_TOKEN --exit-zero-on-changes",
|
|
32
33
|
"prepare": "husky"
|
|
@@ -64,13 +65,11 @@
|
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@apollo/client": "^3.11.8",
|
|
67
|
-
"@babel/
|
|
68
|
-
"@babel/
|
|
69
|
-
"@babel/plugin-
|
|
70
|
-
"@babel/
|
|
71
|
-
"@babel/
|
|
72
|
-
"@babel/preset-env": "7.3.1",
|
|
73
|
-
"@babel/preset-typescript": "^7.10.4",
|
|
68
|
+
"@babel/cli": "^7.28.3",
|
|
69
|
+
"@babel/core": "^7.28.5",
|
|
70
|
+
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
71
|
+
"@babel/preset-env": "^7.28.5",
|
|
72
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
74
73
|
"@nulogy/eslint-config-nulogy": "^1.0.0",
|
|
75
74
|
"@nulogy/icons": "^4.37.2",
|
|
76
75
|
"@rollup/plugin-babel": "^5.0.0",
|
|
@@ -81,53 +80,45 @@
|
|
|
81
80
|
"@semantic-release/github": "^8.0.7",
|
|
82
81
|
"@semantic-release/npm": "^9.0.0",
|
|
83
82
|
"@semantic-release/release-notes-generator": "^10.0.3",
|
|
84
|
-
"@storybook/addon-a11y": "
|
|
85
|
-
"@storybook/addon-actions": "
|
|
86
|
-
"@storybook/addon-docs": "6.
|
|
87
|
-
"@storybook/addon-
|
|
88
|
-
"@storybook/addon-
|
|
89
|
-
"@storybook/addon-
|
|
90
|
-
"@storybook/
|
|
91
|
-
"@storybook/
|
|
92
|
-
"@storybook/react": "6.
|
|
93
|
-
"@storybook/theming": "
|
|
94
|
-
"@testing-library/jest-dom": "5.11.5",
|
|
83
|
+
"@storybook/addon-a11y": "7.6.20",
|
|
84
|
+
"@storybook/addon-actions": "7.6.20",
|
|
85
|
+
"@storybook/addon-docs": "7.6.20",
|
|
86
|
+
"@storybook/addon-storysource": "7.6.20",
|
|
87
|
+
"@storybook/addon-toolbars": "7.6.20",
|
|
88
|
+
"@storybook/addon-viewport": "7.6.20",
|
|
89
|
+
"@storybook/codemod": "7.6.20",
|
|
90
|
+
"@storybook/react": "7.6.20",
|
|
91
|
+
"@storybook/react-webpack5": "7.6.20",
|
|
92
|
+
"@storybook/theming": "7.6.20",
|
|
95
93
|
"@testing-library/react": "^12.1.5",
|
|
96
94
|
"@types/css-mediaquery": "^0.1.4",
|
|
97
95
|
"@types/deep-equal": "^1.0.4",
|
|
98
|
-
"@types/jest": "^29.5.1",
|
|
99
96
|
"@types/node": "^14.0.14",
|
|
100
97
|
"@types/react": "^17.0.39",
|
|
101
98
|
"@types/react-dom": "^17.0.20",
|
|
102
99
|
"@types/react-router-dom": "5.3.0",
|
|
103
100
|
"@typescript-eslint/eslint-plugin": "^4.0.0",
|
|
104
101
|
"@typescript-eslint/parser": "^5.30.5",
|
|
105
|
-
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
106
102
|
"awesome-typescript-loader": "^5.2.1",
|
|
107
103
|
"babel-eslint": "^10.0.3",
|
|
108
|
-
"babel-jest": "29.5.0",
|
|
109
104
|
"babel-loader": "8.0.6",
|
|
110
105
|
"babel-plugin-inline-json-import": "^0.3.2",
|
|
111
106
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
112
107
|
"babel-plugin-styled-components": "2.1.3",
|
|
113
108
|
"babel-preset-react": "6.24.1",
|
|
114
|
-
"chromatic": "^
|
|
109
|
+
"chromatic": "^13.3.3",
|
|
115
110
|
"concurrently": "^9.2.0",
|
|
116
111
|
"css-mediaquery": "^0.1.2",
|
|
117
112
|
"cypress": "^13.2.0",
|
|
118
113
|
"cypress-enter-plugin": "^1.0.1",
|
|
119
114
|
"cypress-plugin-tab": "^1.0.1",
|
|
120
115
|
"cypress-real-events": "^1.14.0",
|
|
121
|
-
"enzyme": "3.11.0",
|
|
122
|
-
"enzyme-to-json": "3.4.4",
|
|
123
116
|
"eslint": "6.8.0",
|
|
124
117
|
"eslint-plugin-prettier": "^3.1.4",
|
|
125
118
|
"graphql": "15.8.0",
|
|
126
119
|
"http-server": "^14.0.0",
|
|
127
120
|
"husky": "^9.1.7",
|
|
128
|
-
"
|
|
129
|
-
"jest-environment-jsdom": "^29.5.0",
|
|
130
|
-
"jest-styled-components": "7",
|
|
121
|
+
"jsdom": "^24.0.0",
|
|
131
122
|
"mockdate": "^3.0.2",
|
|
132
123
|
"plop": "^2.4.0",
|
|
133
124
|
"prettier": "^3.4.2",
|
|
@@ -145,11 +136,11 @@
|
|
|
145
136
|
"semantic-release": "^24.2.5",
|
|
146
137
|
"source-map-loader": "^1.0.1",
|
|
147
138
|
"start-server-and-test": "^2.0.12",
|
|
148
|
-
"storybook
|
|
139
|
+
"storybook": "7.6.20",
|
|
149
140
|
"styled-components": "^6.0.0",
|
|
150
141
|
"svg-sprite-loader": "^6.0.11",
|
|
151
|
-
"ts-jest": "^26.1.1",
|
|
152
142
|
"typescript": "4.9.5",
|
|
143
|
+
"vitest": "^2.0.0",
|
|
153
144
|
"typescript-eslint": "^0.0.1-alpha.0"
|
|
154
145
|
},
|
|
155
146
|
"dependencies": {
|
|
@@ -183,33 +174,5 @@
|
|
|
183
174
|
"smoothscroll-polyfill": "^0.4.4",
|
|
184
175
|
"styled-system": "^5.1.4",
|
|
185
176
|
"stylis": "^4.0.0"
|
|
186
|
-
},
|
|
187
|
-
"jest": {
|
|
188
|
-
"testEnvironment": "jsdom",
|
|
189
|
-
"transform": {
|
|
190
|
-
"^.+\\.jsx?$": "babel-jest",
|
|
191
|
-
"^.+\\.js?$": "babel-jest",
|
|
192
|
-
"^.+\\.ts?$": "babel-jest",
|
|
193
|
-
"^.+\\.tsx?$": "babel-jest"
|
|
194
|
-
},
|
|
195
|
-
"transformIgnorePatterns": [
|
|
196
|
-
"node_modules/(?!(@nulogy|storybook-addon-performance))"
|
|
197
|
-
],
|
|
198
|
-
"testPathIgnorePatterns": [
|
|
199
|
-
"<rootDir>/cypress"
|
|
200
|
-
],
|
|
201
|
-
"testMatch": [
|
|
202
|
-
"**/*.spec.tsx",
|
|
203
|
-
"**/*.spec.ts"
|
|
204
|
-
],
|
|
205
|
-
"setupFiles": [
|
|
206
|
-
"<rootDir>/spec/support/registerContext.js"
|
|
207
|
-
],
|
|
208
|
-
"setupFilesAfterEnv": [
|
|
209
|
-
"<rootDir>/spec/support/specHelper.js"
|
|
210
|
-
],
|
|
211
|
-
"snapshotSerializers": [
|
|
212
|
-
"enzyme-to-json/serializer"
|
|
213
|
-
]
|
|
214
177
|
}
|
|
215
178
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const mountWithNDSProvider: (component: any, locale?: string) => any;
|