reshaped 2.7.5-beta.0 → 2.8.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/CHANGELOG.md +8 -3
- package/bundle.css +1 -1
- package/bundle.js +15 -15
- package/components/Actionable/Actionable.module.css +1 -1
- package/components/Button/Button.module.css +1 -1
- package/components/Button/tests/Button.stories.d.ts +1 -0
- package/components/Button/tests/Button.stories.js +11 -0
- package/components/Card/Card.d.ts +1 -1
- package/components/Carousel/Carousel.module.css +1 -1
- package/components/Checkbox/Checkbox.module.css +1 -1
- package/components/FormControl/FormControl.context.d.ts +0 -1
- package/components/HiddenVisually/HiddenVisually.module.css +1 -1
- package/components/MenuItem/MenuItem.module.css +1 -1
- package/components/Overlay/Overlay.module.css +1 -1
- package/components/Radio/Radio.module.css +1 -1
- package/components/Slider/Slider.module.css +1 -1
- package/components/Switch/Switch.module.css +1 -1
- package/components/Tabs/Tabs.module.css +1 -1
- package/components/Text/Text.module.css +1 -1
- package/components/TextField/TextField.module.css +1 -1
- package/components/View/View.js +7 -3
- package/components/View/View.module.css +1 -1
- package/components/View/View.types.d.ts +3 -1
- package/components/View/tests/View.stories.d.ts +1 -0
- package/components/View/tests/View.stories.js +15 -0
- package/package.json +32 -36
- package/styles/bleed/bleed.module.css +1 -1
- package/styles/minHeight/index.d.ts +3 -0
- package/styles/minHeight/index.js +10 -0
- package/styles/minHeight/minHeight.module.css +1 -0
- package/styles/padding/padding.module.css +1 -1
- package/themes/_generator/tests/themes.stories.js +24 -1
- package/themes/_generator/utilities/generateColors.js +3 -3
@@ -17,6 +17,8 @@ export type Props<TagName extends keyof JSX.IntrinsicElements = "div"> = {
|
|
17
17
|
aspectRatio?: G.Responsive<number>;
|
18
18
|
maxHeight?: G.Responsive<string | number>;
|
19
19
|
maxWidth?: G.Responsive<string | number>;
|
20
|
+
minHeight?: G.Responsive<string | number>;
|
21
|
+
minWidth?: G.Responsive<string | number>;
|
20
22
|
padding?: G.Responsive<number>;
|
21
23
|
paddingTop?: G.Responsive<number>;
|
22
24
|
paddingBottom?: G.Responsive<number>;
|
@@ -37,7 +39,7 @@ export type Props<TagName extends keyof JSX.IntrinsicElements = "div"> = {
|
|
37
39
|
insetBottom?: G.Responsive<number>;
|
38
40
|
zIndex?: number;
|
39
41
|
shadow?: "raised" | "overlay";
|
40
|
-
overflow?: "hidden";
|
42
|
+
overflow?: "hidden" | "auto";
|
41
43
|
animated?: boolean;
|
42
44
|
className?: G.ClassName;
|
43
45
|
attributes?: G.Attributes<TagName>;
|
@@ -15,6 +15,7 @@ export declare const textAlign: () => React.JSX.Element;
|
|
15
15
|
export declare const size: () => React.JSX.Element;
|
16
16
|
export declare const ratio: () => React.JSX.Element;
|
17
17
|
export declare const maxSize: () => React.JSX.Element;
|
18
|
+
export declare const minSize: () => React.JSX.Element;
|
18
19
|
export declare const background: () => React.JSX.Element;
|
19
20
|
export declare const border: () => React.JSX.Element;
|
20
21
|
export declare const radius: () => React.JSX.Element;
|
@@ -380,6 +380,21 @@ export const maxSize = () => (<Example>
|
|
380
380
|
<View backgroundColor="neutral-faded" maxHeight={{ s: 25, m: "200px" }} maxWidth={{ s: 25, m: "200px" }} height="300px"/>
|
381
381
|
</Example.Item>
|
382
382
|
</Example>);
|
383
|
+
export const minSize = () => (<Example>
|
384
|
+
<Example.Item title="minHeight: 150px, minWidth: 150px, height: 50px, width: 50px">
|
385
|
+
<View backgroundColor="neutral-faded" minHeight="150px" minWidth="150px" height="50px" width="50px"/>
|
386
|
+
</Example.Item>
|
387
|
+
<Example.Item title="minHeight: 25, minWidth: 25, height: 5, width: 5">
|
388
|
+
<View backgroundColor="neutral-faded" minHeight={25} minWidth={25} height={5} width={5}/>
|
389
|
+
</Example.Item>
|
390
|
+
<Example.Item title={[
|
391
|
+
"responsive minHeight and minWidth, height: 50px, width: 50px",
|
392
|
+
"[s] minHeight: 25, minWidth: 25",
|
393
|
+
"[m+] minHeight: 200px, minWidth: 200px",
|
394
|
+
]}>
|
395
|
+
<View backgroundColor="neutral-faded" minHeight={{ s: 25, m: "200px" }} minWidth={{ s: 25, m: "200px" }} height="50px" width="50px"/>
|
396
|
+
</Example.Item>
|
397
|
+
</Example>);
|
383
398
|
export const background = () => (<Example title="border is used to highlight the backround value when it's similar to the page background, text color changes based on the background">
|
384
399
|
<Example.Item title="bg: page">
|
385
400
|
<View backgroundColor="page" borderColor="neutral" padding={4}>
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "reshaped",
|
3
3
|
"description": "Professionally crafted design system in React & Figma for building products of any scale and complexity",
|
4
|
-
"version": "2.
|
4
|
+
"version": "2.8.0",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
6
6
|
"email": "hello@reshaped.so",
|
7
7
|
"homepage": "https://reshaped.so",
|
@@ -80,60 +80,56 @@
|
|
80
80
|
"defaults and not IE 11"
|
81
81
|
],
|
82
82
|
"devDependencies": {
|
83
|
-
"@commitlint/cli": "18.4.
|
84
|
-
"@commitlint/config-conventional": "18.4.
|
85
|
-
"@commitlint/types": "18.4.
|
86
|
-
"@
|
87
|
-
"@
|
88
|
-
"@
|
89
|
-
"@storybook/
|
90
|
-
"@
|
91
|
-
"@storybook/react-vite": "7.6.3",
|
92
|
-
"@testing-library/jest-dom": "6.1.4",
|
83
|
+
"@commitlint/cli": "18.4.3",
|
84
|
+
"@commitlint/config-conventional": "18.4.3",
|
85
|
+
"@commitlint/types": "18.4.3",
|
86
|
+
"@size-limit/preset-big-lib": "11.0.1",
|
87
|
+
"@storybook/addon-a11y": "7.6.6",
|
88
|
+
"@storybook/react": "7.6.6",
|
89
|
+
"@storybook/react-vite": "7.6.6",
|
90
|
+
"@testing-library/jest-dom": "6.1.6",
|
93
91
|
"@testing-library/react": "14.1.2",
|
94
|
-
"@testing-library/user-event": "14.5.
|
92
|
+
"@testing-library/user-event": "14.5.2",
|
95
93
|
"@types/events": "3.0.3",
|
96
|
-
"@types/jest": "29.5.
|
97
|
-
"@types/node": "20.
|
98
|
-
"@types/react": "18.2.
|
99
|
-
"@types/react-dom": "18.2.
|
100
|
-
"@typescript-eslint/eslint-plugin": "6.
|
101
|
-
"@typescript-eslint/parser": "6.
|
102
|
-
"@vitejs/plugin-react": "4.2.
|
103
|
-
"chromatic": "
|
94
|
+
"@types/jest": "29.5.11",
|
95
|
+
"@types/node": "20.10.6",
|
96
|
+
"@types/react": "18.2.46",
|
97
|
+
"@types/react-dom": "18.2.18",
|
98
|
+
"@typescript-eslint/eslint-plugin": "6.16.0",
|
99
|
+
"@typescript-eslint/parser": "6.16.0",
|
100
|
+
"@vitejs/plugin-react": "4.2.1",
|
101
|
+
"chromatic": "10.2.0",
|
104
102
|
"cz-conventional-changelog": "3.3.0",
|
105
|
-
"eslint": "8.
|
103
|
+
"eslint": "8.56.0",
|
106
104
|
"eslint-config-airbnb-typescript": "17.1.0",
|
107
|
-
"eslint-config-prettier": "9.
|
108
|
-
"eslint-plugin-import": "2.29.
|
105
|
+
"eslint-config-prettier": "9.1.0",
|
106
|
+
"eslint-plugin-import": "2.29.1",
|
109
107
|
"eslint-plugin-jsx-a11y": "6.8.0",
|
110
|
-
"eslint-plugin-prettier": "5.
|
108
|
+
"eslint-plugin-prettier": "5.1.2",
|
111
109
|
"eslint-plugin-react": "7.33.2",
|
112
110
|
"eslint-plugin-react-hooks": "4.6.0",
|
113
111
|
"identity-obj-proxy": "3.0.0",
|
114
112
|
"jest": "29.7.0",
|
115
113
|
"jest-environment-jsdom": "29.7.0",
|
116
114
|
"jest-matchmedia-mock": "1.1.0",
|
117
|
-
"lefthook": "1.5.
|
118
|
-
"postcss": "8.4.
|
119
|
-
"postcss-cli": "
|
115
|
+
"lefthook": "1.5.5",
|
116
|
+
"postcss": "8.4.32",
|
117
|
+
"postcss-cli": "11.0.0",
|
120
118
|
"postcss-each": "1.1.0",
|
121
|
-
"postcss-import": "15.1.0",
|
122
119
|
"postcss-nested": "6.0.1",
|
123
|
-
"prettier": "3.1.
|
120
|
+
"prettier": "3.1.1",
|
124
121
|
"react": "18.2.0",
|
125
122
|
"react-dom": "18.2.0",
|
126
123
|
"resolve-tspaths": "0.8.17",
|
127
|
-
"
|
128
|
-
"
|
129
|
-
"storybook": "7.6.3",
|
124
|
+
"size-limit": "11.0.1",
|
125
|
+
"storybook": "7.6.6",
|
130
126
|
"stylelint": "15.11.0",
|
131
127
|
"stylelint-config-prettier": "9.0.5",
|
132
128
|
"stylelint-config-standard": "34.0.0",
|
133
129
|
"ts-jest": "29.1.1",
|
134
|
-
"typescript": "5.
|
135
|
-
"vite": "
|
136
|
-
"vite-tsconfig-paths": "4.2.
|
130
|
+
"typescript": "5.3.3",
|
131
|
+
"vite": "5.0.10",
|
132
|
+
"vite-tsconfig-paths": "4.2.3"
|
137
133
|
},
|
138
134
|
"peerDependencies": {
|
139
135
|
"postcss": "^8.0.0",
|
@@ -144,7 +140,7 @@
|
|
144
140
|
"@csstools/postcss-global-data": "2.1.1",
|
145
141
|
"chalk": "4.1.2",
|
146
142
|
"commander": "11.1.0",
|
147
|
-
"cssnano": "6.0.
|
143
|
+
"cssnano": "6.0.2",
|
148
144
|
"postcss-custom-media": "10.0.2"
|
149
145
|
},
|
150
146
|
"resolutions": {
|
@@ -1 +1 @@
|
|
1
|
-
.root{
|
1
|
+
.root{margin-left:calc(var(--rs-unit-x1) * var(--rs-bleed) * -1);margin-right:calc(var(--rs-unit-x1) * var(--rs-bleed) * -1);--rs-bleed-s:0;--rs-bleed-m:var(--rs-bleed-s);--rs-bleed-l:var(--rs-bleed-m);--rs-bleed-xl:var(--rs-bleed-l);--rs-bleed:var(--rs-bleed-s)}.--bleed{border-left-style:none!important;border-radius:0;border-right-style:none!important}@media (--rs-viewport-m ){.root{--rs-bleed:var(--rs-bleed-m)}.--bleed-true--m{border-left-style:none!important;border-radius:0;border-right-style:none!important}.--bleed-false--m{border-left-style:solid!important;border-radius:var(--rs-radius);border-right-style:solid!important}}@media (--rs-viewport-l ){.root{--rs-bleed:var(--rs-bleed-l)}.--bleed-true--l{border-left-style:none!important;border-radius:0;border-right-style:none!important}.--bleed-false--l{border-left-style:solid!important;border-radius:var(--rs-radius);border-right-style:solid!important}}@media (--rs-viewport-xl ){.root{--rs-bleed:var(--rs-bleed-xl)}.--bleed-true--xl{border-left-style:none!important;border-radius:0;border-right-style:none!important}.--bleed-false--xl{border-left-style:solid!important;border-radius:var(--rs-radius);border-right-style:solid!important}}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { responsiveClassNames, responsiveVariables } from "../../utilities/helpers.js";
|
2
|
+
import s from "./minHeight.module.css";
|
3
|
+
const getMinWidthStyles = (value) => {
|
4
|
+
if (!value)
|
5
|
+
return null;
|
6
|
+
const variables = responsiveVariables("--rs-min-h", value);
|
7
|
+
const classNames = responsiveClassNames(s, (value) => (typeof value === "number" ? "unit" : "literal"), value, { excludeValueFromClassName: true });
|
8
|
+
return { classNames, variables };
|
9
|
+
};
|
10
|
+
export default getMinWidthStyles;
|
@@ -0,0 +1 @@
|
|
1
|
+
.literal{min-height:var(--rs-min-h-s,auto)}.unit{min-height:calc(var(--rs-min-h-s) * var(--rs-unit-x1))}@media (--rs-viewport-m ){.literal--m{min-height:var(--rs-min-h-m)}.unit--m{min-height:calc(var(--rs-min-h-m) * var(--rs-unit-x1))}}@media (--rs-viewport-l ){.literal--l{min-height:var(--rs-min-h-l)}.unit--l{min-height:calc(var(--rs-min-h-l) * var(--rs-unit-x1))}}@media (--rs-viewport-xl ){.literal--xl{min-height:var(--rs-min-h-xl)}.unit--xl{min-height:calc(var(--rs-min-h-xl) * var(--rs-unit-x1))}}
|
@@ -1 +1 @@
|
|
1
|
-
.root{--rs-p-s:0;--rs-p-m:var(--rs-p-s);--rs-p-l:var(--rs-p-m);--rs-p-xl:var(--rs-p-l);--rs-p:var(--rs-p-s)
|
1
|
+
.root{padding:calc(var(--rs-p) * var(--rs-unit-x1));--rs-p-s:0;--rs-p-m:var(--rs-p-s);--rs-p-l:var(--rs-p-m);--rs-p-xl:var(--rs-p-l);--rs-p:var(--rs-p-s)}@media (--rs-viewport-m ){.root{--rs-p:var(--rs-p-m)}}@media (--rs-viewport-l ){.root{--rs-p:var(--rs-p-l)}}@media (--rs-viewport-xl ){.root{--rs-p:var(--rs-p-xl)}}
|
@@ -52,7 +52,7 @@ const componentExamples = (<View gap={4}>
|
|
52
52
|
<Alert color="critical">Critical</Alert>
|
53
53
|
</View.Item>
|
54
54
|
<View.Item columns={6}>
|
55
|
-
<Alert color="warning">
|
55
|
+
<Alert color="warning">Warning</Alert>
|
56
56
|
</View.Item>
|
57
57
|
<View.Item columns={6}>
|
58
58
|
<Alert color="positive">Positive</Alert>
|
@@ -80,6 +80,29 @@ const componentExamples = (<View gap={4}>
|
|
80
80
|
<Badge color="warning">Warning</Badge>
|
81
81
|
</View>
|
82
82
|
</View.Item>
|
83
|
+
<View.Item columns={12}>
|
84
|
+
<View direction="row">
|
85
|
+
<View padding={4} gap={4} backgroundColor="page">
|
86
|
+
Page
|
87
|
+
<View backgroundColor="neutral" padding={4}>
|
88
|
+
Neutral
|
89
|
+
</View>
|
90
|
+
<View backgroundColor="neutral-faded" padding={4}>
|
91
|
+
Neutral faded
|
92
|
+
</View>
|
93
|
+
</View>
|
94
|
+
|
95
|
+
<View padding={4} gap={4} backgroundColor="page-faded">
|
96
|
+
Page faded
|
97
|
+
<View backgroundColor="neutral" padding={4}>
|
98
|
+
Neutral
|
99
|
+
</View>
|
100
|
+
<View backgroundColor="neutral-faded" padding={4}>
|
101
|
+
Neutral faded
|
102
|
+
</View>
|
103
|
+
</View>
|
104
|
+
</View>
|
105
|
+
</View.Item>
|
83
106
|
<View.Item columns={6}>
|
84
107
|
<Card>
|
85
108
|
<View gap={2} align="start">
|
@@ -23,15 +23,15 @@ const generateColorValues = (args) => {
|
|
23
23
|
const fgHsluvDark = Object.assign(Object.assign({}, hsluv), { l: key === "neutral" ? 80 : FG_L_DARK });
|
24
24
|
const fgHex = (0, color_1.hsluvToHex)(fgHsluv);
|
25
25
|
const fgHexDark = (0, color_1.hsluvToHex)(fgHsluvDark);
|
26
|
-
const
|
27
|
-
const bgFadedHex = (0, color_1.rgbToHex)((0, color_1.hslToRgb)(Object.assign(Object.assign({}, hsl), { l: 98 -
|
26
|
+
const saturationModifier = hsl.s / 40;
|
27
|
+
const bgFadedHex = (0, color_1.rgbToHex)((0, color_1.hslToRgb)(Object.assign(Object.assign({}, hsl), { l: 98 - saturationModifier - (key === "neutral" ? 2 : 0) })));
|
28
28
|
const bgFadedHsluv = (0, color_1.hexToHsluv)(bgFadedHex);
|
29
29
|
const bgFadedHsluvDark = Object.assign(Object.assign({}, hsluv), { l: 16, s: 32 });
|
30
30
|
const bgFadedHexDark = (0, color_1.hsluvToHex)(bgFadedHsluvDark);
|
31
31
|
const fadedLuminance = (0, color_1.getRgbLuminance)((0, color_1.hexToRgb)(bgFadedHex));
|
32
32
|
const fadedLuminanceDark = (0, color_1.getRgbLuminance)((0, color_1.hexToRgb)(bgFadedHexDark));
|
33
33
|
const fadedLuminanceDeltaDark = (0, color_1.getLuminanceDelta)(fadedLuminanceDark);
|
34
|
-
const bdFadedHex = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, bgFadedHsluv), { s: Math.max(0, bgFadedHsluv.s - 6 - Math.max(0, fadedLuminance - 98) * 20), l: bgFadedHsluv.l - 7 +
|
34
|
+
const bdFadedHex = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, bgFadedHsluv), { s: Math.max(0, bgFadedHsluv.s - 6 - Math.max(0, fadedLuminance - 98) * 20), l: bgFadedHsluv.l - 7 + saturationModifier }));
|
35
35
|
const bdFadedHexDark = (0, color_1.hsluvToHex)(Object.assign(Object.assign({}, bgFadedHsluvDark), { s: 40, l: bgFadedHsluvDark.l + 7 - fadedLuminanceDeltaDark }));
|
36
36
|
const output = {
|
37
37
|
[`background${capitalizedKey}`]: {
|