@knapsack/sandbox-components 4.65.4--canary.8f8d6aa.0 → 4.65.4--canary.4280.dc8fff9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- background-color: #d9d9d9;
1305
- padding: 5rem;
1306
- padding: var(--spacing-scale-xl, 5rem);
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 (max-width: 1200px) {
1331
- .grid {
1332
- grid-template-columns: repeat(2, 1fr);
1333
- grid-template-rows: repeat(2, 1fr);
1334
- }
1335
- }
1336
-
1337
- @media (max-width: 768px) {
1338
- .grid {
1339
- grid-template-columns: 1fr;
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 {
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  interface GridItemProps {
3
3
  children: React.ReactNode;
4
+ columns?: 1 | 2 | 3 | 4;
4
5
  gap?: 'small' | 'medium' | 'large';
6
+ maxWidth?: string;
5
7
  }
6
8
  export declare const Grid: React.FC<GridItemProps>;
7
9
  export {};
@@ -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;CACpC;AAED,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAWxC,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"}
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../src/react/grid.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB,MAAM,CAAC,MAAM,IAAI,GAA4B,CAAC,EAAE,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,EAAE,EAAE;IAC5E,OAAO,CACL,cACE,SAAS,EAAE,IAAI,CAAC;YACd,IAAI,EAAE,IAAI;YACV,CAAC,aAAa,GAAG,EAAE,CAAC,EAAE,GAAG;SAC1B,CAAC,YAED,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,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,9 +1,8 @@
1
1
  {
2
2
  "name": "@knapsack/sandbox-components",
3
3
  "description": "",
4
- "version": "4.65.4--canary.8f8d6aa.0",
4
+ "version": "4.65.4--canary.4280.dc8fff9.0",
5
5
  "type": "module",
6
- "module": "./dist/react/index.js",
7
6
  "exports": {
8
7
  "./css": "./dist/css/ks-sandbox-styles.css",
9
8
  "./hbs/*": "./src/hbs/*",
@@ -38,11 +37,11 @@
38
37
  "vue": "^3.4.27"
39
38
  },
40
39
  "devDependencies": {
41
- "@knapsack/eslint-config-starter": "4.65.4--canary.8f8d6aa.0",
42
- "@knapsack/postcss-config-starter": "4.65.4--canary.8f8d6aa.0",
43
- "@knapsack/prettier-config": "4.65.4--canary.8f8d6aa.0",
44
- "@knapsack/sandbox-tokens": "4.65.4--canary.8f8d6aa.0",
45
- "@knapsack/typescript-config-starter": "4.65.4--canary.8f8d6aa.0",
40
+ "@knapsack/eslint-config-starter": "4.65.4--canary.4280.dc8fff9.0",
41
+ "@knapsack/postcss-config-starter": "4.65.4--canary.4280.dc8fff9.0",
42
+ "@knapsack/prettier-config": "4.65.4--canary.4280.dc8fff9.0",
43
+ "@knapsack/sandbox-tokens": "4.65.4--canary.4280.dc8fff9.0",
44
+ "@knapsack/typescript-config-starter": "4.65.4--canary.4280.dc8fff9.0",
46
45
  "@types/node": "^20.12.12",
47
46
  "@types/react": "^18.3.3",
48
47
  "eslint": "^8.57.0",
@@ -60,5 +59,5 @@
60
59
  "directory": "apps/ui/libs/sandbox-components",
61
60
  "type": "git"
62
61
  },
63
- "gitHead": "8f8d6aa5a1c3ca28651e67eed5980fc318ed736d"
62
+ "gitHead": "dc8fff95a6d831230e572f42d6ab6e2096642cb5"
64
63
  }
package/src/css/card.css CHANGED
@@ -3,7 +3,6 @@
3
3
  border-radius: var(--radius-medium, 0.5rem);
4
4
  background: var(--background-content);
5
5
  box-shadow: var(--shadow-1);
6
- min-width: 20rem;
7
6
  margin: var(--spacing-small);
8
7
  }
9
8
 
package/src/css/grid.css CHANGED
@@ -1,10 +1,7 @@
1
1
  .grid {
2
2
  display: grid;
3
- background-color: #d9d9d9;
4
- padding: var(--spacing-scale-xl, 5rem);
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 (max-width: 1200px) {
23
- .grid {
24
- grid-template-columns: repeat(2, 1fr);
25
- grid-template-rows: repeat(2, 1fr);
26
- }
27
- }
28
-
29
- @media (max-width: 768px) {
30
- .grid {
31
- grid-template-columns: 1fr;
32
- grid-template-rows: repeat(4, 1fr);
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
  }
@@ -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> = ({ children, gap = 'medium' }) => {
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>