@sproutsocial/seeds-react-stack 1.0.22 → 1.0.24
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/dist/esm/index.js +125 -50
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +126 -51
- package/dist/index.js.map +1 -1
- package/dist/stack.css +99 -0
- package/package.json +17 -6
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -4
- package/.turbo/turbo-build.log +0 -21
- package/CHANGELOG.md +0 -187
- package/jest.config.js +0 -9
- package/src/Stack.stories.tsx +0 -102
- package/src/Stack.tsx +0 -116
- package/src/StackTypes.ts +0 -32
- package/src/__tests__/Stack.test.tsx +0 -26
- package/src/__tests__/Stack.typetest.tsx +0 -18
- package/src/index.ts +0 -5
- package/src/styled.d.ts +0 -7
- package/src/utils.ts +0 -42
- package/tsconfig.json +0 -15
- package/tsup.config.ts +0 -12
package/src/utils.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { theme } from "@sproutsocial/seeds-react-theme";
|
|
2
|
-
|
|
3
|
-
import type { TypeResponsive } from "@sproutsocial/seeds-react-system-props";
|
|
4
|
-
|
|
5
|
-
const breakpoints = theme.breakpoints;
|
|
6
|
-
const LENGTH = breakpoints.length + 1;
|
|
7
|
-
|
|
8
|
-
export const normalizeResponsiveProp = (
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
value: TypeResponsive<any>
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
|
-
): TypeResponsive<any> => {
|
|
13
|
-
if (["string", "number"].includes(typeof value)) {
|
|
14
|
-
return Array(LENGTH).fill(value);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (value.length) {
|
|
18
|
-
switch (value.length) {
|
|
19
|
-
case 1:
|
|
20
|
-
return Array(LENGTH).fill(value[0]);
|
|
21
|
-
case 2:
|
|
22
|
-
return [value[0], ...Array(LENGTH - 1).fill(value[1])];
|
|
23
|
-
case 3:
|
|
24
|
-
return [value[0], value[1], ...Array(LENGTH - 2).fill(value[2])];
|
|
25
|
-
case 4:
|
|
26
|
-
return [
|
|
27
|
-
value[0],
|
|
28
|
-
value[1],
|
|
29
|
-
value[2],
|
|
30
|
-
...Array(LENGTH - 3).fill(value[3]),
|
|
31
|
-
];
|
|
32
|
-
case 5:
|
|
33
|
-
return value;
|
|
34
|
-
default:
|
|
35
|
-
throw new Error(
|
|
36
|
-
`Invalid responsive prop length: ${JSON.stringify(value)}`
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
throw new Error(`Invalid responsive prop type: ${JSON.stringify(value)}`);
|
|
41
|
-
}
|
|
42
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "@sproutsocial/seeds-tsconfig/bundler/dom/library-monorepo",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"jsx": "react-jsx",
|
|
5
|
-
"module": "esnext"
|
|
6
|
-
},
|
|
7
|
-
"include": ["src/**/*"],
|
|
8
|
-
"exclude": [
|
|
9
|
-
"node_modules",
|
|
10
|
-
"dist",
|
|
11
|
-
"coverage",
|
|
12
|
-
"**/*.stories.tsx",
|
|
13
|
-
"**/*.stories.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "tsup";
|
|
2
|
-
|
|
3
|
-
export default defineConfig((options) => ({
|
|
4
|
-
entry: ["src/index.ts"],
|
|
5
|
-
format: ["cjs", "esm"],
|
|
6
|
-
clean: true,
|
|
7
|
-
legacyOutput: true,
|
|
8
|
-
dts: options.dts,
|
|
9
|
-
external: ["react"],
|
|
10
|
-
sourcemap: true,
|
|
11
|
-
metafile: options.metafile,
|
|
12
|
-
}));
|