@jobber/components 4.15.2 → 4.15.3-JOB-68798.4
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/Grid/Grid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactElement } from "react";
|
|
2
|
-
import {
|
|
1
|
+
import { PropsWithChildren, ReactElement } from "react";
|
|
2
|
+
import { GridCellProps } from "./InternalGridCell";
|
|
3
3
|
import alignments from "./GridAlign.css";
|
|
4
4
|
interface GridProps {
|
|
5
5
|
/**
|
|
@@ -22,4 +22,5 @@ export declare function Grid({ alignItems, gap, children, }: GridProps): JSX.Ele
|
|
|
22
22
|
export declare namespace Grid {
|
|
23
23
|
var Cell: typeof GridCell;
|
|
24
24
|
}
|
|
25
|
+
declare function GridCell(props: PropsWithChildren<GridCellProps>): JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -18,5 +18,5 @@ export interface GridCellProps {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
export declare const GRID_CELL_TEST_ID = "ATL-Grid-GridCell";
|
|
21
|
-
export declare function
|
|
21
|
+
export declare function InternalGridCell({ size, children, }: PropsWithChildren<GridCellProps>): JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./InternalGridCell";
|
package/dist/Grid/index.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var classnames = require('classnames');
|
|
7
|
+
var useAssert = require('@jobber/hooks/useAssert');
|
|
7
8
|
var styleInject_es = require('../style-inject.es-9d2f5f4e.js');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -11,8 +12,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
13
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
13
14
|
|
|
14
|
-
var css_248z$2 = ".
|
|
15
|
-
var styles$1 = {"gridCell":"
|
|
15
|
+
var css_248z$2 = ".YJHtDDKq6WI- {\n grid-column: initial;\n grid-column-end: span var(--gridCell--size-xs);\n}@media (min-width:490px) {.YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-sm);\n}\n }@media (--small-screens-and-up) {.YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-sm);\n}\n }@media (min-width: 640px) {.YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-md);\n}\n }@media (--medium-screens) {.YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-md);\n}\n }@media (min-width:1440px) {.YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-lg);\n}\n }@media (--large-screens-and-up) {.YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-lg);\n}\n }@media (min-width:1680px) {.YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-xl);\n}\n }@media (--extra-large-screens-and-up) {.YJHtDDKq6WI- {\n grid-column-end: span var(--gridCell--size-xl);\n}\n }\n";
|
|
16
|
+
var styles$1 = {"gridCell":"YJHtDDKq6WI-"};
|
|
16
17
|
styleInject_es.styleInject(css_248z$2);
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -21,7 +22,7 @@ styleInject_es.styleInject(css_248z$2);
|
|
|
21
22
|
const breakpoints = ["xs", "sm", "md", "lg", "xl"];
|
|
22
23
|
const MAX_COLUMNS = 12;
|
|
23
24
|
const GRID_CELL_TEST_ID = "ATL-Grid-GridCell";
|
|
24
|
-
function
|
|
25
|
+
function InternalGridCell({ size, children, }) {
|
|
25
26
|
/**
|
|
26
27
|
* Build CSS variables for column sizes for all possible breakpoints to size
|
|
27
28
|
* the column
|
|
@@ -57,7 +58,16 @@ function Grid({ alignItems = "start", gap = true, children, }) {
|
|
|
57
58
|
const classnames = classnames__default["default"](styles.grid, alignments[alignItems], {
|
|
58
59
|
[styles.gap]: gap,
|
|
59
60
|
});
|
|
60
|
-
return (React__default["default"].createElement("div", { "data-testid": GRID_TEST_ID, className: classnames }, children
|
|
61
|
+
return (React__default["default"].createElement("div", { "data-testid": GRID_TEST_ID, className: classnames }, React__default["default"].Children.map(children, gridCell => {
|
|
62
|
+
return React__default["default"].createElement(InternalGridCell, Object.assign({}, gridCell.props));
|
|
63
|
+
})));
|
|
64
|
+
}
|
|
65
|
+
// Only need the component to pass in the data as a react children
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
|
+
function GridCell(props) {
|
|
68
|
+
// Throw error when <Chip /> gets used outside of the <Chips />
|
|
69
|
+
useAssert.useAssert(true, "`<Grid.Cell>` can only be used inside of a `<Grid>` component!");
|
|
70
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
61
71
|
}
|
|
62
72
|
Grid.Cell = GridCell;
|
|
63
73
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.3-JOB-68798.4+5073aba6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@jobber/design": "^0.39.0",
|
|
23
|
-
"@jobber/formatters": "
|
|
23
|
+
"@jobber/formatters": "^0.2.2",
|
|
24
24
|
"@jobber/hooks": "^2.1.2",
|
|
25
25
|
"@popperjs/core": "^2.0.6",
|
|
26
26
|
"@std-proposal/temporal": "0.0.1",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"> 1%",
|
|
84
84
|
"IE 10"
|
|
85
85
|
],
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "5073aba6a5928aa13deab513e3cd6aeac70db1f7"
|
|
87
87
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./GridCell";
|