@jobber/components 6.84.0 → 6.85.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.
@@ -1,6 +1,6 @@
1
1
  export type ColumnKeys = "shrink" | "grow";
2
2
  export type Direction = "row" | "column";
3
- export declare const spacing: readonly ["none", "smallest", "smaller", "small", "base", "large"];
3
+ export declare const spacing: readonly ["none", "minuscule", "smallest", "smaller", "small", "slim", "base", "large", "larger", "largest", "extravagant"];
4
4
  type ValuesOfSpacing<T extends typeof spacing> = T[number];
5
5
  export type Spacing = ValuesOfSpacing<typeof spacing>;
6
6
  export {};
package/dist/Flex-cjs.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var React = require('react');
4
4
  var classnames = require('classnames');
5
5
 
6
- var styles = {"flexible":"pEdV7Oo29SE-","smallestGap":"ftl4BEGpmyA-","smallerGap":"ikaEWOhu3ZI-","smallGap":"V9xi4msiJlM-","baseGap":"Jzbdj1Ja38E-","largeGap":"cLrQOLCo-z8-","noneGap":"VZokN5bjMl0-","startAlign":"_9CW5WRJdMFo-","centerAlign":"zVzX2gVWEGw-","endAlign":"cnhrFSJxBCo-","spinning":"WKqP-JY0YEw-"};
6
+ var styles = {"flexible":"pEdV7Oo29SE-","minusculeGap":"Zm7CagsL-WU-","smallestGap":"ftl4BEGpmyA-","smallerGap":"ikaEWOhu3ZI-","smallGap":"V9xi4msiJlM-","slimGap":"odJ-gd44AYY-","baseGap":"Jzbdj1Ja38E-","largeGap":"cLrQOLCo-z8-","largerGap":"l-DqnL94mmw-","largestGap":"_4bEByMh7pHI-","extravagantGap":"pdH9lzFTcIc-","noneGap":"VZokN5bjMl0-","startAlign":"_9CW5WRJdMFo-","centerAlign":"zVzX2gVWEGw-","endAlign":"cnhrFSJxBCo-","spinning":"WKqP-JY0YEw-"};
7
7
 
8
8
  function Flex({ align = "center", children, direction = "row", gap = "base", template, }) {
9
9
  return (React.createElement("div", { className: classnames(styles.flexible, {
package/dist/Flex-es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import classnames from 'classnames';
3
3
 
4
- var styles = {"flexible":"pEdV7Oo29SE-","smallestGap":"ftl4BEGpmyA-","smallerGap":"ikaEWOhu3ZI-","smallGap":"V9xi4msiJlM-","baseGap":"Jzbdj1Ja38E-","largeGap":"cLrQOLCo-z8-","noneGap":"VZokN5bjMl0-","startAlign":"_9CW5WRJdMFo-","centerAlign":"zVzX2gVWEGw-","endAlign":"cnhrFSJxBCo-","spinning":"WKqP-JY0YEw-"};
4
+ var styles = {"flexible":"pEdV7Oo29SE-","minusculeGap":"Zm7CagsL-WU-","smallestGap":"ftl4BEGpmyA-","smallerGap":"ikaEWOhu3ZI-","smallGap":"V9xi4msiJlM-","slimGap":"odJ-gd44AYY-","baseGap":"Jzbdj1Ja38E-","largeGap":"cLrQOLCo-z8-","largerGap":"l-DqnL94mmw-","largestGap":"_4bEByMh7pHI-","extravagantGap":"pdH9lzFTcIc-","noneGap":"VZokN5bjMl0-","startAlign":"_9CW5WRJdMFo-","centerAlign":"zVzX2gVWEGw-","endAlign":"cnhrFSJxBCo-","spinning":"WKqP-JY0YEw-"};
5
5
 
6
6
  function Flex({ align = "center", children, direction = "row", gap = "base", template, }) {
7
7
  return (React__default.createElement("div", { className: classnames(styles.flexible, {
@@ -2,11 +2,18 @@ import type { ReactNode } from "react";
2
2
  import React from "react";
3
3
  import alignments from "./GridAlign.module.css";
4
4
  import { GridCell } from "./GridCell";
5
- interface GridProps {
5
+ import type { GapSpacing } from "../sharedHelpers/types";
6
+ export interface GridProps {
6
7
  /**
7
- * Add spacing between elements.
8
+ * Add spacing between elements. Can be a boolean for default spacing,
9
+ * or a semantic token for custom spacing.
10
+ * @default true
11
+ *
12
+ * @deprecated The boolean type for the 'gap' prop is deprecated and will be removed in a future version.
13
+ * Please use a GapSpacing token (e.g., 'small', 'base', 'large') for fixed spacing.
14
+ * Using 'true' applies default responsive spacing. Using 'false' results in no gap.
8
15
  */
9
- readonly gap?: boolean;
16
+ readonly gap?: boolean | GapSpacing;
10
17
  /**
11
18
  * Adjust the alignment of columns. We only support a few select properties
12
19
  * from `align-items` due to the nature of the other properties acting the
@@ -23,4 +30,3 @@ export declare function Grid({ alignItems, gap, children, }: GridProps): React.J
23
30
  export declare namespace Grid {
24
31
  var Cell: typeof GridCell;
25
32
  }
26
- export {};
@@ -4,6 +4,7 @@ var Grid = require('../Grid-cjs.js');
4
4
  require('react');
5
5
  require('classnames');
6
6
  require('../GridCell-cjs.js');
7
+ require('../getMappedAtlantisSpaceToken-cjs.js');
7
8
 
8
9
 
9
10
 
@@ -2,3 +2,4 @@ export { G as GRID_TEST_ID, a as Grid } from '../Grid-es.js';
2
2
  import 'react';
3
3
  import 'classnames';
4
4
  import '../GridCell-es.js';
5
+ import '../getMappedAtlantisSpaceToken-es.js';
package/dist/Grid-cjs.js CHANGED
@@ -3,17 +3,29 @@
3
3
  var React = require('react');
4
4
  var classnames = require('classnames');
5
5
  var GridCell = require('./GridCell-cjs.js');
6
+ var getMappedAtlantisSpaceToken = require('./getMappedAtlantisSpaceToken-cjs.js');
6
7
 
7
8
  var styles = {"grid":"_0X4jj5NERa4-","gap":"d3vl57tdCWA-","spinning":"Y--XfgJk5Fw-"};
8
9
 
9
10
  var alignments = {"center":"V-24AGDyie4-","start":"H0zdYNTapmM-","end":"O5VtcGWRV3M-","stretch":"wVv5gaWrouI-","spinning":"DcsVgHCowbg-"};
10
11
 
11
12
  const GRID_TEST_ID = "ATL-Grid";
13
+ function getGapStyles(gap) {
14
+ if (typeof gap === "boolean") {
15
+ if (gap === true) {
16
+ return { className: styles.gap };
17
+ }
18
+ return {};
19
+ }
20
+ const gapValue = getMappedAtlantisSpaceToken.getMappedAtlantisSpaceToken(gap);
21
+ if (gapValue) {
22
+ return { style: { gap: gapValue } };
23
+ }
24
+ return {};
25
+ }
12
26
  function Grid({ alignItems = "start", gap = true, children, }) {
13
- const classnames$1 = classnames(styles.grid, alignments[alignItems], {
14
- [styles.gap]: gap,
15
- });
16
- return (React.createElement("div", { "data-testid": GRID_TEST_ID, className: classnames$1 }, children));
27
+ const { className: gapClass, style: gapStyle } = getGapStyles(gap);
28
+ return (React.createElement("div", { "data-testid": GRID_TEST_ID, className: classnames(styles.grid, alignments[alignItems], gapClass), style: gapStyle }, children));
17
29
  }
18
30
  Grid.Cell = GridCell.GridCell;
19
31
 
package/dist/Grid-es.js CHANGED
@@ -1,17 +1,29 @@
1
1
  import React__default from 'react';
2
2
  import classnames from 'classnames';
3
3
  import { a as GridCell } from './GridCell-es.js';
4
+ import { g as getMappedAtlantisSpaceToken } from './getMappedAtlantisSpaceToken-es.js';
4
5
 
5
6
  var styles = {"grid":"_0X4jj5NERa4-","gap":"d3vl57tdCWA-","spinning":"Y--XfgJk5Fw-"};
6
7
 
7
8
  var alignments = {"center":"V-24AGDyie4-","start":"H0zdYNTapmM-","end":"O5VtcGWRV3M-","stretch":"wVv5gaWrouI-","spinning":"DcsVgHCowbg-"};
8
9
 
9
10
  const GRID_TEST_ID = "ATL-Grid";
11
+ function getGapStyles(gap) {
12
+ if (typeof gap === "boolean") {
13
+ if (gap === true) {
14
+ return { className: styles.gap };
15
+ }
16
+ return {};
17
+ }
18
+ const gapValue = getMappedAtlantisSpaceToken(gap);
19
+ if (gapValue) {
20
+ return { style: { gap: gapValue } };
21
+ }
22
+ return {};
23
+ }
10
24
  function Grid({ alignItems = "start", gap = true, children, }) {
11
- const classnames$1 = classnames(styles.grid, alignments[alignItems], {
12
- [styles.gap]: gap,
13
- });
14
- return (React__default.createElement("div", { "data-testid": GRID_TEST_ID, className: classnames$1 }, children));
25
+ const { className: gapClass, style: gapStyle } = getGapStyles(gap);
26
+ return (React__default.createElement("div", { "data-testid": GRID_TEST_ID, className: classnames(styles.grid, alignments[alignItems], gapClass), style: gapStyle }, children));
15
27
  }
16
28
  Grid.Cell = GridCell;
17
29
 
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const spaceTokens = {
4
+ none: "0px",
4
5
  minuscule: "var(--space-minuscule)",
5
6
  slim: "var(--space-slim)",
6
7
  smallest: "var(--space-smallest)",
@@ -1,4 +1,5 @@
1
1
  const spaceTokens = {
2
+ none: "0px",
2
3
  minuscule: "var(--space-minuscule)",
3
4
  slim: "var(--space-slim)",
4
5
  smallest: "var(--space-smallest)",
@@ -13,5 +13,5 @@ export interface CommonAtlantisProps {
13
13
  /** Represents a day of the week as a number where 0 = Sunday, 1 = Monday, etc. */
14
14
  export type DayOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;
15
15
  export type CommonAllowedElements = "section" | "p" | "article" | "ul" | "li" | "div" | "span" | "dl" | "dd" | "dt";
16
- export type Spaces = "minuscule" | "slim" | "smallest" | "smaller" | "small" | "base" | "large" | "larger" | "largest" | "extravagant";
16
+ export type Spaces = "none" | "minuscule" | "slim" | "smallest" | "smaller" | "small" | "base" | "large" | "larger" | "largest" | "extravagant";
17
17
  export type GapSpacing = Spaces | (string & NonNullable<unknown>);
package/dist/styles.css CHANGED
@@ -4092,6 +4092,11 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
4092
4092
  flex: 1;
4093
4093
  }
4094
4094
 
4095
+ .Zm7CagsL-WU- {
4096
+ gap: 1px;
4097
+ gap: var(--space-minuscule);
4098
+ }
4099
+
4095
4100
  .ftl4BEGpmyA- {
4096
4101
  gap: 2px;
4097
4102
  gap: var(--space-smallest);
@@ -4107,6 +4112,11 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
4107
4112
  gap: var(--space-small);
4108
4113
  }
4109
4114
 
4115
+ .odJ-gd44AYY- {
4116
+ gap: 12px;
4117
+ gap: var(--space-slim);
4118
+ }
4119
+
4110
4120
  .Jzbdj1Ja38E- {
4111
4121
  gap: 16px;
4112
4122
  gap: var(--space-base);
@@ -4117,6 +4127,21 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
4117
4127
  gap: var(--space-large);
4118
4128
  }
4119
4129
 
4130
+ .l-DqnL94mmw- {
4131
+ gap: 32px;
4132
+ gap: var(--space-larger);
4133
+ }
4134
+
4135
+ ._4bEByMh7pHI- {
4136
+ gap: 48px;
4137
+ gap: var(--space-largest);
4138
+ }
4139
+
4140
+ .pdH9lzFTcIc- {
4141
+ gap: 64px;
4142
+ gap: var(--space-extravagant);
4143
+ }
4144
+
4120
4145
  .VZokN5bjMl0- {
4121
4146
  gap: 0;
4122
4147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jobber/components",
3
- "version": "6.84.0",
3
+ "version": "6.85.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -547,5 +547,5 @@
547
547
  "> 1%",
548
548
  "IE 10"
549
549
  ],
550
- "gitHead": "6800733d34b235bdbf4d4155d412df1d1efff94b"
550
+ "gitHead": "d1e41d8cd060ab3c9bdc2a4419228cf8e3fe3242"
551
551
  }