@knapsack/sandbox-components 4.65.3 → 4.65.4--canary.4268.407e957.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/css/ks-sandbox-styles.css +13 -30
- package/dist/react/grid.d.ts +2 -0
- package/dist/react/grid.d.ts.map +1 -1
- package/dist/react/grid.js +3 -2
- package/dist/react/grid.js.map +1 -1
- package/package.json +7 -7
- package/src/css/card.css +0 -1
- package/src/css/grid.css +13 -24
- package/src/react/grid.tsx +10 -1
@@ -1264,7 +1264,6 @@ body {
|
|
1264
1264
|
background: var(--background-content);
|
1265
1265
|
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
|
1266
1266
|
box-shadow: var(--shadow-1);
|
1267
|
-
min-width: 20rem;
|
1268
1267
|
margin: 8px;
|
1269
1268
|
margin: var(--spacing-small);
|
1270
1269
|
}
|
@@ -1301,15 +1300,9 @@ body {
|
|
1301
1300
|
|
1302
1301
|
.grid {
|
1303
1302
|
display: grid;
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
grid-template-columns: repeat(2, 1fr);
|
1308
|
-
grid-template-rows: repeat(2, 1fr);
|
1309
|
-
grid-gap: 12px;
|
1310
|
-
grid-gap: var(--spacing-medium, 10px);
|
1311
|
-
gap: 12px;
|
1312
|
-
gap: var(--spacing-medium, 10px);
|
1303
|
+
grid-template-columns: 1fr;
|
1304
|
+
margin-left: auto;
|
1305
|
+
margin-right: auto;
|
1313
1306
|
}
|
1314
1307
|
|
1315
1308
|
.grid--gap-small {
|
@@ -1327,26 +1320,16 @@ body {
|
|
1327
1320
|
gap: var(--spacing-large, 20px);
|
1328
1321
|
}
|
1329
1322
|
|
1330
|
-
@media (
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
grid-template-rows: repeat(4, 1fr);
|
1341
|
-
}
|
1342
|
-
}
|
1343
|
-
|
1344
|
-
@media (max-width: 480px) {
|
1345
|
-
.grid {
|
1346
|
-
grid-template-columns: 1fr;
|
1347
|
-
grid-template-rows: repeat(4, 1fr);
|
1348
|
-
padding: 2rem;
|
1349
|
-
}
|
1323
|
+
@media (min-width: 768px) {
|
1324
|
+
.grid--columns--2 {
|
1325
|
+
grid-template-columns: repeat(2, 1fr);
|
1326
|
+
}
|
1327
|
+
.grid--columns--3 {
|
1328
|
+
grid-template-columns: repeat(3, 1fr);
|
1329
|
+
}
|
1330
|
+
.grid--columns--4 {
|
1331
|
+
grid-template-columns: repeat(4, 1fr);
|
1332
|
+
}
|
1350
1333
|
}
|
1351
1334
|
|
1352
1335
|
.header {
|
package/dist/react/grid.d.ts
CHANGED
package/dist/react/grid.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/react/grid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,aAAa;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/react/grid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,aAAa;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkBxC,CAAC"}
|
package/dist/react/grid.js
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import clsx from 'clsx';
|
3
|
-
export const Grid = ({ children, gap = 'medium' }) => {
|
3
|
+
export const Grid = ({ children, columns = 2, gap = 'medium', maxWidth, }) => {
|
4
4
|
return (_jsx("div", { className: clsx({
|
5
5
|
grid: true,
|
6
|
+
[`grid--columns--${columns}`]: columns,
|
6
7
|
[`grid--gap-${gap}`]: gap,
|
7
|
-
}), children: children }));
|
8
|
+
}), style: { maxWidth }, children: children }));
|
8
9
|
};
|
9
10
|
//# sourceMappingURL=grid.js.map
|
package/dist/react/grid.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/react/grid.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;
|
1
|
+
{"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/react/grid.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,MAAM,CAAC,MAAM,IAAI,GAA4B,CAAC,EAC5C,QAAQ,EACR,OAAO,GAAG,CAAC,EACX,GAAG,GAAG,QAAQ,EACd,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,cACE,SAAS,EAAE,IAAI,CAAC;YACd,IAAI,EAAE,IAAI;YACV,CAAC,kBAAkB,OAAO,EAAE,CAAC,EAAE,OAAO;YACtC,CAAC,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG;SAC1B,CAAC,EACF,KAAK,EAAE,EAAE,QAAQ,EAAE,YAElB,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@knapsack/sandbox-components",
|
3
3
|
"description": "",
|
4
|
-
"version": "4.65.
|
4
|
+
"version": "4.65.4--canary.4268.407e957.0",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
7
7
|
"./css": "./dist/css/ks-sandbox-styles.css",
|
@@ -37,11 +37,11 @@
|
|
37
37
|
"vue": "^3.4.27"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
-
"@knapsack/eslint-config-starter": "4.65.
|
41
|
-
"@knapsack/postcss-config-starter": "4.65.
|
42
|
-
"@knapsack/prettier-config": "4.65.
|
43
|
-
"@knapsack/sandbox-tokens": "4.65.
|
44
|
-
"@knapsack/typescript-config-starter": "4.65.
|
40
|
+
"@knapsack/eslint-config-starter": "4.65.4--canary.4268.407e957.0",
|
41
|
+
"@knapsack/postcss-config-starter": "4.65.4--canary.4268.407e957.0",
|
42
|
+
"@knapsack/prettier-config": "4.65.4--canary.4268.407e957.0",
|
43
|
+
"@knapsack/sandbox-tokens": "4.65.4--canary.4268.407e957.0",
|
44
|
+
"@knapsack/typescript-config-starter": "4.65.4--canary.4268.407e957.0",
|
45
45
|
"@types/node": "^20.12.12",
|
46
46
|
"@types/react": "^18.3.3",
|
47
47
|
"eslint": "^8.57.0",
|
@@ -59,5 +59,5 @@
|
|
59
59
|
"directory": "apps/ui/libs/sandbox-components",
|
60
60
|
"type": "git"
|
61
61
|
},
|
62
|
-
"gitHead": "
|
62
|
+
"gitHead": "407e9570237698534e52627eb1c38ebeb73e39b3"
|
63
63
|
}
|
package/src/css/card.css
CHANGED
package/src/css/grid.css
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
.grid {
|
2
2
|
display: grid;
|
3
|
-
|
4
|
-
|
5
|
-
grid-template-columns: repeat(2, 1fr);
|
6
|
-
grid-template-rows: repeat(2, 1fr);
|
7
|
-
gap: var(--spacing-medium, 10px);
|
3
|
+
grid-template-columns: 1fr;
|
4
|
+
margin-inline: auto;
|
8
5
|
}
|
9
6
|
|
10
7
|
.grid--gap {
|
@@ -19,24 +16,16 @@
|
|
19
16
|
}
|
20
17
|
}
|
21
18
|
|
22
|
-
@media (
|
23
|
-
.grid {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
@media (max-width: 480px) {
|
37
|
-
.grid {
|
38
|
-
grid-template-columns: 1fr;
|
39
|
-
grid-template-rows: repeat(4, 1fr);
|
40
|
-
padding: 2rem;
|
19
|
+
@media (min-width: 768px) {
|
20
|
+
.grid--columns {
|
21
|
+
&--2 {
|
22
|
+
grid-template-columns: repeat(2, 1fr);
|
23
|
+
}
|
24
|
+
&--3 {
|
25
|
+
grid-template-columns: repeat(3, 1fr);
|
26
|
+
}
|
27
|
+
&--4 {
|
28
|
+
grid-template-columns: repeat(4, 1fr);
|
29
|
+
}
|
41
30
|
}
|
42
31
|
}
|
package/src/react/grid.tsx
CHANGED
@@ -3,16 +3,25 @@ import React from 'react';
|
|
3
3
|
|
4
4
|
interface GridItemProps {
|
5
5
|
children: React.ReactNode;
|
6
|
+
columns?: 1 | 2 | 3 | 4;
|
6
7
|
gap?: 'small' | 'medium' | 'large';
|
8
|
+
maxWidth?: string;
|
7
9
|
}
|
8
10
|
|
9
|
-
export const Grid: React.FC<GridItemProps> = ({
|
11
|
+
export const Grid: React.FC<GridItemProps> = ({
|
12
|
+
children,
|
13
|
+
columns = 2,
|
14
|
+
gap = 'medium',
|
15
|
+
maxWidth,
|
16
|
+
}) => {
|
10
17
|
return (
|
11
18
|
<div
|
12
19
|
className={clsx({
|
13
20
|
grid: true,
|
21
|
+
[`grid--columns--${columns}`]: columns,
|
14
22
|
[`grid--gap-${gap}`]: gap,
|
15
23
|
})}
|
24
|
+
style={{ maxWidth }}
|
16
25
|
>
|
17
26
|
{children}
|
18
27
|
</div>
|