reshaped 2.2.0 → 2.2.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/CHANGELOG.md +4 -12
- package/LICENSE-SOURCE.md +40 -0
- package/LICENSE.md +21 -37
- package/bin/clean.sh +1 -0
- package/bin/release-source.sh +7 -0
- package/bundle.css +1 -1
- package/bundle.js +8 -8
- package/components/Actionable/Actionable.module.css +1 -1
- package/components/Checkbox/Checkbox.module.css +1 -1
- package/components/DropdownMenu/DropdownMenu.js +1 -1
- package/components/Radio/Radio.module.css +1 -1
- package/components/Select/Select.js +1 -1
- package/components/Slider/Slider.module.css +1 -1
- package/components/Switch/Switch.module.css +1 -1
- package/components/_private/Flyout/Flyout.types.d.ts +2 -0
- package/components/_private/Flyout/FlyoutContent.js +4 -2
- package/components/_private/Flyout/FlyoutControlled.js +8 -1
- package/config/next.d.ts +4 -5
- package/config/next.js +21 -7
- package/package.json +8 -8
- package/cli/theming/definitions/minimal.d.ts +0 -3
- package/cli/theming/definitions/minimal.js +0 -80
- package/styles/aspectRatio/index.test.d.ts +0 -1
- package/styles/aspectRatio/index.test.js +0 -24
- package/styles/bleed/index.test.d.ts +0 -1
- package/styles/bleed/index.test.js +0 -24
- package/styles/height/index.test.d.ts +0 -1
- package/styles/height/index.test.js +0 -27
- package/styles/inset/index.test.d.ts +0 -1
- package/styles/inset/index.test.js +0 -27
- package/styles/maxHeight/index.test.d.ts +0 -1
- package/styles/maxHeight/index.test.js +0 -27
- package/styles/maxWidth/index.test.d.ts +0 -1
- package/styles/maxWidth/index.test.js +0 -27
- package/styles/padding/index.test.d.ts +0 -1
- package/styles/padding/index.test.js +0 -24
- package/styles/position/index.test.d.ts +0 -1
- package/styles/position/index.test.js +0 -21
- package/styles/radius/index.test.d.ts +0 -1
- package/styles/radius/index.test.js +0 -24
- package/styles/width/index.test.d.ts +0 -1
- package/styles/width/index.test.js +0 -27
- package/themes/minimal/theme.css +0 -1
- package/utilities/testPresets.d.ts +0 -25
- package/utilities/testPresets.js +0 -76
- package/utilities/tests/Chain.test.d.ts +0 -1
- package/utilities/tests/Chain.test.js +0 -45
- /package/bin/{copy-release.sh → release-copy.sh} +0 -0
package/themes/minimal/theme.css
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
[data-rs-theme=minimal][data-rs-color-mode=dark],[data-rs-theme=minimal][data-rs-color-mode=light]{--rs-font-family-title:Inter,BlinkMacSystemFont,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;--rs-font-family-body:Inter,BlinkMacSystemFont,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;--rs-font-weight-regular:400;--rs-font-weight-medium:500;--rs-font-weight-semibold:600;--rs-font-weight-bold:700;--rs-font-weight-heavy:800;--rs-font-weight-black:900;--rs-font-size-title-1:96px;--rs-line-height-title-1:100px;--rs-font-family-title-1:var(--rs-font-family-title);--rs-font-weight-title-1:var(--rs-font-weight-heavy);--rs-font-size-title-2:80px;--rs-line-height-title-2:84px;--rs-font-family-title-2:var(--rs-font-family-title);--rs-font-weight-title-2:var(--rs-font-weight-heavy);--rs-font-size-title-3:64px;--rs-line-height-title-3:68px;--rs-font-family-title-3:var(--rs-font-family-title);--rs-font-weight-title-3:var(--rs-font-weight-heavy);--rs-font-size-title-4:56px;--rs-line-height-title-4:60px;--rs-font-family-title-4:var(--rs-font-family-title);--rs-font-weight-title-4:var(--rs-font-weight-bold);--rs-font-size-title-5:48px;--rs-line-height-title-5:52px;--rs-font-family-title-5:var(--rs-font-family-title);--rs-font-weight-title-5:var(--rs-font-weight-bold);--rs-font-size-title-6:36px;--rs-line-height-title-6:40px;--rs-font-family-title-6:var(--rs-font-family-title);--rs-font-weight-title-6:var(--rs-font-weight-bold);--rs-font-size-featured-1:32px;--rs-line-height-featured-1:40px;--rs-font-family-featured-1:var(--rs-font-family-body);--rs-font-size-featured-2:24px;--rs-line-height-featured-2:32px;--rs-font-family-featured-2:var(--rs-font-family-body);--rs-font-size-featured-3:20px;--rs-line-height-featured-3:28px;--rs-font-family-featured-3:var(--rs-font-family-body);--rs-font-size-body-1:18px;--rs-line-height-body-1:24px;--rs-font-family-body-1:var(--rs-font-family-body);--rs-font-size-body-2:16px;--rs-line-height-body-2:24px;--rs-font-family-body-2:var(--rs-font-family-body);--rs-font-size-body-3:14px;--rs-line-height-body-3:20px;--rs-font-family-body-3:var(--rs-font-family-body);--rs-font-size-caption-1:12px;--rs-line-height-caption-1:16px;--rs-font-family-caption-1:var(--rs-font-family-body);--rs-font-size-caption-2:10px;--rs-line-height-caption-2:12px;--rs-font-family-caption-2:var(--rs-font-family-body);--rs-unit-base:4px;--rs-unit-radius-small:2px;--rs-unit-radius-medium:4px;--rs-unit-radius-large:6px;--rs-unit-x1:4px;--rs-unit-x2:8px;--rs-unit-x3:12px;--rs-unit-x4:16px;--rs-unit-x5:20px;--rs-unit-x6:24px;--rs-unit-x7:28px;--rs-unit-x8:32px;--rs-unit-x9:36px;--rs-unit-x10:40px;--rs-color-black:#000;--rs-color-white:#fff;--rs-color-on-background-primary:#fff;--rs-color-on-background-positive:#fff;--rs-color-on-background-critical:#fff;--rs-color-rgb-black:0,0,0;--rs-color-rgb-white:255,255,255;--rs-duration-fast:200ms;--rs-duration-medium:300ms;--rs-duration-slow:400ms;--rs-easing-standard:cubic-bezier(0.4,0,0.2,1);--rs-easing-accelerate:cubic-bezier(0.4,0,1,1);--rs-easing-decelerate:cubic-bezier(0,0,0.2,1);--rs-shadow-raised:0px 2px 3px rgba(0,0,0,.1),0px 1px 2px -1px rgba(0,0,0,.1);--rs-shadow-overlay:0px 5px 10px rgba(0,0,0,.05),0px 15px 25px rgba(0,0,0,.07)}[data-rs-theme=minimal][data-rs-color-mode=light]{--rs-color-foreground-neutral:#161a26;--rs-color-foreground-neutral-faded:#717787;--rs-color-foreground-disabled:#d4d0d0;--rs-color-foreground-primary:#2383e2;--rs-color-foreground-positive:#05751f;--rs-color-foreground-critical:#cb101d;--rs-color-background-neutral:#e3e3e5;--rs-color-background-neutral-faded:#f2f3f5;--rs-color-background-neutral-highlighted:#dedee1;--rs-color-background-disabled:#eceef3;--rs-color-background-disabled-faded:#f4f5f7;--rs-color-background-primary:#2383e2;--rs-color-background-primary-highlighted:#3273cc;--rs-color-background-primary-faded:#d6ebf6;--rs-color-background-positive:#118850;--rs-color-background-positive-faded:#ebfef6;--rs-color-background-positive-highlighted:#009950;--rs-color-background-critical:#e22c2c;--rs-color-background-critical-faded:#fef1f2;--rs-color-background-critical-highlighted:#eb4747;--rs-color-border-neutral:#d2d2d2;--rs-color-border-neutral-faded:#e2e2e2;--rs-color-border-disabled:#e2e2e2;--rs-color-border-primary:#3d76c7;--rs-color-border-primary-faded:#508de4;--rs-color-border-positive:#05751f;--rs-color-border-positive-faded:#cdedd5;--rs-color-border-critical:#cb101d;--rs-color-border-critical-faded:#fbd5d8;--rs-color-background-page:#fff;--rs-color-background-page-faded:#f7f7f5;--rs-color-background-elevation-base:#fff;--rs-color-background-elevation-raised:#fff;--rs-color-background-elevation-overlay:#fff;--rs-color-on-background-neutral:#000;--rs-color-rgb-background-neutral:227,227,229;--rs-color-rgb-background-neutral-faded:242,243,245;--rs-color-rgb-background-neutral-highlighted:222,222,225;--rs-color-rgb-background-disabled:236,238,243;--rs-color-rgb-background-disabled-faded:244,245,247;--rs-color-rgb-background-primary:35,131,226;--rs-color-rgb-background-primary-highlighted:50,115,204;--rs-color-rgb-background-primary-faded:214,235,246;--rs-color-rgb-background-positive:17,136,80;--rs-color-rgb-background-positive-faded:235,254,246;--rs-color-rgb-background-positive-highlighted:0,153,80;--rs-color-rgb-background-critical:226,44,44;--rs-color-rgb-background-critical-faded:254,241,242;--rs-color-rgb-background-critical-highlighted:235,71,71;--rs-color-rgb-background-page:255,255,255;--rs-color-rgb-background-page-faded:247,247,245;--rs-color-rgb-background-elevation-base:255,255,255;--rs-color-rgb-background-elevation-raised:255,255,255;--rs-color-rgb-background-elevation-overlay:255,255,255}[data-rs-theme=minimal][data-rs-color-mode=dark]{--rs-color-foreground-neutral:#f2f3f5;--rs-color-foreground-neutral-faded:#9f9e9e;--rs-color-foreground-disabled:#656565;--rs-color-foreground-primary:#5098ff;--rs-color-foreground-positive:#03ab5f;--rs-color-foreground-critical:#eb6666;--rs-color-background-neutral:#4f5155;--rs-color-background-neutral-faded:#34363f;--rs-color-background-neutral-highlighted:#595c60;--rs-color-background-disabled:#313131;--rs-color-background-disabled-faded:#262626;--rs-color-background-primary:#4281db;--rs-color-background-primary-highlighted:#3273cc;--rs-color-background-primary-faded:#1e2c45;--rs-color-background-positive:#06743f;--rs-color-background-positive-faded:#0f2921;--rs-color-background-positive-highlighted:#008545;--rs-color-background-critical:#ab1717;--rs-color-background-critical-faded:#2f1e1f;--rs-color-background-critical-highlighted:#c11515;--rs-color-border-neutral:#414141;--rs-color-border-neutral-faded:#464646;--rs-color-border-disabled:#404040;--rs-color-border-primary:#5a91e0;--rs-color-border-primary-faded:#163a6a;--rs-color-border-positive:#03a059;--rs-color-border-positive-faded:#163c30;--rs-color-border-critical:#e95454;--rs-color-border-critical-faded:#412a2b;--rs-color-background-page:#191919;--rs-color-background-page-faded:#202020;--rs-color-background-elevation-base:#232323;--rs-color-background-elevation-raised:#262626;--rs-color-background-elevation-overlay:#292929;--rs-color-on-background-neutral:#fff;--rs-color-rgb-background-neutral:79,81,85;--rs-color-rgb-background-neutral-faded:52,54,63;--rs-color-rgb-background-neutral-highlighted:89,92,96;--rs-color-rgb-background-disabled:49,49,49;--rs-color-rgb-background-disabled-faded:38,38,38;--rs-color-rgb-background-primary:66,129,219;--rs-color-rgb-background-primary-highlighted:50,115,204;--rs-color-rgb-background-primary-faded:30,44,69;--rs-color-rgb-background-positive:6,116,63;--rs-color-rgb-background-positive-faded:15,41,33;--rs-color-rgb-background-positive-highlighted:0,133,69;--rs-color-rgb-background-critical:171,23,23;--rs-color-rgb-background-critical-faded:47,30,31;--rs-color-rgb-background-critical-highlighted:193,21,21;--rs-color-rgb-background-page:25,25,25;--rs-color-rgb-background-page-faded:32,32,32;--rs-color-rgb-background-elevation-base:35,35,35;--rs-color-rgb-background-elevation-raised:38,38,38;--rs-color-rgb-background-elevation-overlay:41,41,41}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import React from "react";
|
2
|
-
type Renderer<P> = (props: P) => React.ReactElement;
|
3
|
-
export declare const testChildren: (renderer: Renderer<{
|
4
|
-
children: React.ReactNode;
|
5
|
-
}>) => void;
|
6
|
-
export declare const testLinkBehavior: (renderer: Renderer<{
|
7
|
-
href: string;
|
8
|
-
}>) => void;
|
9
|
-
export declare const testLinkButtonBehavior: (renderer: Renderer<{
|
10
|
-
href: string;
|
11
|
-
onClick: () => void;
|
12
|
-
}>) => void;
|
13
|
-
export declare const testButtonBehavior: (renderer: Renderer<{
|
14
|
-
onClick: () => void;
|
15
|
-
}>) => void;
|
16
|
-
export declare const testButtonType: (renderer: Renderer<{
|
17
|
-
type: string;
|
18
|
-
}>) => void;
|
19
|
-
export declare const testDisabledButton: (renderer: Renderer<{
|
20
|
-
onClick: () => void;
|
21
|
-
}>) => void;
|
22
|
-
export declare const testAriaLabel: (renderer: Renderer<{
|
23
|
-
ariaLabel: string;
|
24
|
-
}>) => void;
|
25
|
-
export {};
|
package/utilities/testPresets.js
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
8
|
-
});
|
9
|
-
};
|
10
|
-
import React from "react";
|
11
|
-
import { render, screen } from "@testing-library/react";
|
12
|
-
import userEvent from "@testing-library/user-event";
|
13
|
-
export const testChildren = (renderer) => {
|
14
|
-
test("renders children", () => {
|
15
|
-
render(renderer({ children: "Children" }));
|
16
|
-
expect(screen.getByText("Children")).toBeInTheDocument();
|
17
|
-
});
|
18
|
-
};
|
19
|
-
export const testLinkBehavior = (renderer) => {
|
20
|
-
test("works as a link", () => {
|
21
|
-
render(renderer({ href: "https://reshaped.so" }));
|
22
|
-
const link = screen.getByRole("link");
|
23
|
-
expect(link).toBeInTheDocument();
|
24
|
-
expect(link.getAttribute("href")).toBe("https://reshaped.so");
|
25
|
-
});
|
26
|
-
};
|
27
|
-
export const testLinkButtonBehavior = (renderer) => {
|
28
|
-
test("works as a button with href", () => __awaiter(void 0, void 0, void 0, function* () {
|
29
|
-
const noop = jest.fn();
|
30
|
-
render(renderer({ onClick: noop, href: "https://reshaped.so" }));
|
31
|
-
const button = screen.getByRole("link");
|
32
|
-
button.addEventListener("click", (e) => e.preventDefault());
|
33
|
-
expect(button).toBeInTheDocument();
|
34
|
-
yield userEvent.click(button);
|
35
|
-
expect(noop).toBeCalledTimes(1);
|
36
|
-
}));
|
37
|
-
};
|
38
|
-
export const testButtonBehavior = (renderer) => {
|
39
|
-
test("works as a button", () => __awaiter(void 0, void 0, void 0, function* () {
|
40
|
-
const noop = jest.fn();
|
41
|
-
render(renderer({ onClick: noop }));
|
42
|
-
const button = screen.getByRole("button");
|
43
|
-
expect(button).toBeInTheDocument();
|
44
|
-
yield userEvent.click(button);
|
45
|
-
expect(noop).toBeCalledTimes(1);
|
46
|
-
// fireEvent.keyDown(button, { key: "Enter" });
|
47
|
-
// expect(noop).toBeCalledTimes(2);
|
48
|
-
// fireEvent.keyDown(button, { key: " " });
|
49
|
-
// expect(noop).toBeCalledTimes(3);
|
50
|
-
}));
|
51
|
-
};
|
52
|
-
export const testButtonType = (renderer) => {
|
53
|
-
test("applies correct button type", () => __awaiter(void 0, void 0, void 0, function* () {
|
54
|
-
const noop = jest.fn();
|
55
|
-
render(React.createElement("form", { onSubmit: noop }, renderer({ type: "button" })));
|
56
|
-
const button = screen.getByRole("button");
|
57
|
-
yield userEvent.click(button);
|
58
|
-
expect(noop).not.toBeCalled();
|
59
|
-
}));
|
60
|
-
};
|
61
|
-
export const testDisabledButton = (renderer) => {
|
62
|
-
test("disables the button", () => __awaiter(void 0, void 0, void 0, function* () {
|
63
|
-
const noop = jest.fn();
|
64
|
-
render(renderer({ onClick: noop }));
|
65
|
-
const button = screen.getByRole("button");
|
66
|
-
yield userEvent.click(button);
|
67
|
-
expect(noop).not.toBeCalled();
|
68
|
-
}));
|
69
|
-
};
|
70
|
-
export const testAriaLabel = (renderer) => {
|
71
|
-
test("renders aria-label", () => {
|
72
|
-
render(renderer({ ariaLabel: "Hey" }));
|
73
|
-
const button = screen.getByRole("button");
|
74
|
-
expect(button.getAttribute("aria-label")).toBeDefined();
|
75
|
-
});
|
76
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import Chain from "../Chain.js";
|
2
|
-
describe("Chain", () => {
|
3
|
-
test("gets an item", () => {
|
4
|
-
const chain = new Chain();
|
5
|
-
const id = chain.add("Test");
|
6
|
-
expect(chain.get(id).data).toBe("Test");
|
7
|
-
});
|
8
|
-
test("validates last item", () => {
|
9
|
-
const chain = new Chain();
|
10
|
-
const firstId = chain.add("Test");
|
11
|
-
const lastId = chain.add("Test 2");
|
12
|
-
expect(chain.isLast(firstId)).toBe(false);
|
13
|
-
expect(chain.isLast(lastId)).toBe(true);
|
14
|
-
});
|
15
|
-
test("adds items", () => {
|
16
|
-
const chain = new Chain();
|
17
|
-
chain.add("Test");
|
18
|
-
expect(chain.getAll()).toMatchSnapshot();
|
19
|
-
});
|
20
|
-
test("removes item in the middle", () => {
|
21
|
-
const chain = new Chain();
|
22
|
-
chain.add("Test");
|
23
|
-
const id = chain.add("Test 2");
|
24
|
-
chain.add("Test 3");
|
25
|
-
chain.remove(id);
|
26
|
-
expect(chain.getAll()).toMatchSnapshot();
|
27
|
-
});
|
28
|
-
test("removes side items", () => {
|
29
|
-
const chain = new Chain();
|
30
|
-
const idFirst = chain.add("Test");
|
31
|
-
chain.add("Test 2");
|
32
|
-
const idLast = chain.add("Test 3");
|
33
|
-
chain.remove(idFirst);
|
34
|
-
chain.remove(idLast);
|
35
|
-
expect(chain.getAll()).toMatchSnapshot();
|
36
|
-
});
|
37
|
-
test("removes previous elements till condition is true", () => {
|
38
|
-
const chain = new Chain();
|
39
|
-
chain.add("Test");
|
40
|
-
chain.add("Test 2");
|
41
|
-
const id = chain.add("Test 3");
|
42
|
-
chain.removePreviousTill(id, (item) => item.data === "Test 2");
|
43
|
-
expect(chain.getAll()).toMatchSnapshot();
|
44
|
-
});
|
45
|
-
});
|
File without changes
|