@loomhq/lens 11.28.1 → 11.30.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.
package/dist/cjs/index.js CHANGED
@@ -715,7 +715,6 @@ var import_styled = __toESM(require("@emotion/styled"));
715
715
  // src/console-messages.js
716
716
  var textIsDimmedDeprecated = `Lens: Text prop 'isDimmed' is deprecated, use color="bodyDimmed" instead.`;
717
717
  var customStylesWarning = `Lens: don't apply custom styles to components, learn more: https://lens.loom.dev/guides/development-best-practices/the-risk-of-modifying-components-with-custom-styles.`;
718
- var splitComponentChildren = `Lens: Split component direct children should only be SplitSection components.`;
719
718
  var distributeDeprecatedWarning = `Lens: Distribute component is deprecated. Use Arrange or Split.`;
720
719
  var layoutDeprecatedWarning = `Lens: Layout component is deprecated. Use Arrange or Split.`;
721
720
 
@@ -5957,17 +5956,15 @@ var SplitWrapper = import_styled38.default.div`
5957
5956
  ${(props) => props.alignContent && getResponsiveOneOf("align-content", props.alignContent)};
5958
5957
  ${(props) => getResponsiveOneOf("flex-wrap", props.wrap)};
5959
5958
  ${(props) => props.direction && getResponsiveOneOf("flex-direction", props.direction)};
5960
- ${(props) => props.gap && getSize("--gap", props.gap)};
5961
- margin-right: calc(-1 * var(--gap));
5962
- margin-bottom: calc(-1 * var(--gap));
5959
+ ${(props) => props.gap && getSize("gap", props.gap)};
5960
+ ${(props) => props.rowGap && getSize("row-gap", props.rowGap)};
5961
+ ${(props) => props.columnGap && getSize("column-gap", props.columnGap)};
5963
5962
  ${(props) => getSizeStyles(props)};
5964
5963
  `;
5965
5964
  var SplitSectionWrapper = import_styled38.default.div`
5966
5965
  ${(props) => getResponsiveNumber("flex-grow", props.grow)};
5967
5966
  ${(props) => getResponsiveNumber("flex-shrink", props.shrink)};
5968
5967
  ${(props) => props.basis && getSize("flex-basis", props.basis)};
5969
- margin-right: var(--gap);
5970
- margin-bottom: var(--gap);
5971
5968
  ${(props) => getSizeStyles(props)};
5972
5969
  `;
5973
5970
  var SplitSection = (_a) => {
@@ -6021,6 +6018,8 @@ var Split = (_a) => {
6021
6018
  var _b = _a, {
6022
6019
  children,
6023
6020
  gap = "initial",
6021
+ rowGap,
6022
+ columnGap,
6024
6023
  alignItems = "center",
6025
6024
  justifyContent,
6026
6025
  alignContent,
@@ -6036,6 +6035,8 @@ var Split = (_a) => {
6036
6035
  } = _b, props = __objRest(_b, [
6037
6036
  "children",
6038
6037
  "gap",
6038
+ "rowGap",
6039
+ "columnGap",
6039
6040
  "alignItems",
6040
6041
  "justifyContent",
6041
6042
  "alignContent",
@@ -6049,11 +6050,6 @@ var Split = (_a) => {
6049
6050
  "className",
6050
6051
  "style"
6051
6052
  ]);
6052
- import_react45.default.Children.forEach(children, (child) => {
6053
- if (child && !import_react45.default.isValidElement(child) || import_react45.default.isValidElement(child) && child.type !== SplitSection) {
6054
- throw new Error(splitComponentChildren);
6055
- }
6056
- });
6057
6053
  if (className || style) {
6058
6054
  console.warn(customStylesWarning);
6059
6055
  }
@@ -6061,6 +6057,8 @@ var Split = (_a) => {
6061
6057
  SplitWrapper,
6062
6058
  __spreadValues({
6063
6059
  gap,
6060
+ rowGap,
6061
+ columnGap,
6064
6062
  alignItems,
6065
6063
  justifyContent,
6066
6064
  alignContent,
package/dist/esm/index.js CHANGED
@@ -496,7 +496,6 @@ import styled from "@emotion/styled";
496
496
  // src/console-messages.js
497
497
  var textIsDimmedDeprecated = `Lens: Text prop 'isDimmed' is deprecated, use color="bodyDimmed" instead.`;
498
498
  var customStylesWarning = `Lens: don't apply custom styles to components, learn more: https://lens.loom.dev/guides/development-best-practices/the-risk-of-modifying-components-with-custom-styles.`;
499
- var splitComponentChildren = `Lens: Split component direct children should only be SplitSection components.`;
500
499
  var distributeDeprecatedWarning = `Lens: Distribute component is deprecated. Use Arrange or Split.`;
501
500
  var layoutDeprecatedWarning = `Lens: Layout component is deprecated. Use Arrange or Split.`;
502
501
 
@@ -5745,17 +5744,15 @@ var SplitWrapper = styled38.div`
5745
5744
  ${(props) => props.alignContent && getResponsiveOneOf("align-content", props.alignContent)};
5746
5745
  ${(props) => getResponsiveOneOf("flex-wrap", props.wrap)};
5747
5746
  ${(props) => props.direction && getResponsiveOneOf("flex-direction", props.direction)};
5748
- ${(props) => props.gap && getSize("--gap", props.gap)};
5749
- margin-right: calc(-1 * var(--gap));
5750
- margin-bottom: calc(-1 * var(--gap));
5747
+ ${(props) => props.gap && getSize("gap", props.gap)};
5748
+ ${(props) => props.rowGap && getSize("row-gap", props.rowGap)};
5749
+ ${(props) => props.columnGap && getSize("column-gap", props.columnGap)};
5751
5750
  ${(props) => getSizeStyles(props)};
5752
5751
  `;
5753
5752
  var SplitSectionWrapper = styled38.div`
5754
5753
  ${(props) => getResponsiveNumber("flex-grow", props.grow)};
5755
5754
  ${(props) => getResponsiveNumber("flex-shrink", props.shrink)};
5756
5755
  ${(props) => props.basis && getSize("flex-basis", props.basis)};
5757
- margin-right: var(--gap);
5758
- margin-bottom: var(--gap);
5759
5756
  ${(props) => getSizeStyles(props)};
5760
5757
  `;
5761
5758
  var SplitSection = (_a) => {
@@ -5809,6 +5806,8 @@ var Split = (_a) => {
5809
5806
  var _b = _a, {
5810
5807
  children,
5811
5808
  gap = "initial",
5809
+ rowGap,
5810
+ columnGap,
5812
5811
  alignItems = "center",
5813
5812
  justifyContent,
5814
5813
  alignContent,
@@ -5824,6 +5823,8 @@ var Split = (_a) => {
5824
5823
  } = _b, props = __objRest(_b, [
5825
5824
  "children",
5826
5825
  "gap",
5826
+ "rowGap",
5827
+ "columnGap",
5827
5828
  "alignItems",
5828
5829
  "justifyContent",
5829
5830
  "alignContent",
@@ -5837,11 +5838,6 @@ var Split = (_a) => {
5837
5838
  "className",
5838
5839
  "style"
5839
5840
  ]);
5840
- React47.Children.forEach(children, (child) => {
5841
- if (child && !React47.isValidElement(child) || React47.isValidElement(child) && child.type !== SplitSection) {
5842
- throw new Error(splitComponentChildren);
5843
- }
5844
- });
5845
5841
  if (className || style) {
5846
5842
  console.warn(customStylesWarning);
5847
5843
  }
@@ -5849,6 +5845,8 @@ var Split = (_a) => {
5849
5845
  SplitWrapper,
5850
5846
  __spreadValues({
5851
5847
  gap,
5848
+ rowGap,
5849
+ columnGap,
5852
5850
  alignItems,
5853
5851
  justifyContent,
5854
5852
  alignContent,
@@ -3,7 +3,7 @@ import { ResponsiveType } from '../../types';
3
3
  declare const SplitWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SplitProps, object>;
4
4
  declare const SplitSectionWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SplitSectionProps, object>;
5
5
  export declare const SplitSection: ({ children, grow, shrink, basis, width, height, minWidth, minHeight, maxWidth, maxHeight, className, style, ...props }: SplitSectionProps & React.ComponentProps<typeof SplitSectionWrapper>) => React.JSX.Element;
6
- declare const Split: ({ children, gap, alignItems, justifyContent, alignContent, wrap, width, height, minWidth, minHeight, maxWidth, maxHeight, className, style, ...props }: SplitProps & React.ComponentProps<typeof SplitWrapper>) => React.JSX.Element;
6
+ declare const Split: ({ children, gap, rowGap, columnGap, alignItems, justifyContent, alignContent, wrap, width, height, minWidth, minHeight, maxWidth, maxHeight, className, style, ...props }: SplitProps & React.ComponentProps<typeof SplitWrapper>) => React.JSX.Element;
7
7
  interface SharedProps {
8
8
  width?: ResponsiveType<number | string>;
9
9
  height?: ResponsiveType<number | string>;
@@ -19,6 +19,8 @@ interface SplitProps extends SharedProps {
19
19
  alignContent?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'start' | 'end' | 'baseline';
20
20
  wrap?: ResponsiveType<'nowrap' | 'wrap' | 'wrap-reverse'>;
21
21
  gap?: ResponsiveType<number | string>;
22
+ rowGap?: ResponsiveType<number | string>;
23
+ columnGap?: ResponsiveType<number | string>;
22
24
  direction?: ResponsiveType<'column' | 'column-reverse' | 'row' | 'row-reverse'>;
23
25
  className?: never;
24
26
  style?: never;
@@ -1,5 +1,4 @@
1
1
  export const textIsDimmedDeprecated: "Lens: Text prop 'isDimmed' is deprecated, use color=\"bodyDimmed\" instead.";
2
2
  export const customStylesWarning: "Lens: don't apply custom styles to components, learn more: https://lens.loom.dev/guides/development-best-practices/the-risk-of-modifying-components-with-custom-styles.";
3
- export const splitComponentChildren: "Lens: Split component direct children should only be SplitSection components.";
4
3
  export const distributeDeprecatedWarning: "Lens: Distribute component is deprecated. Use Arrange or Split.";
5
4
  export const layoutDeprecatedWarning: "Lens: Layout component is deprecated. Use Arrange or Split.";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "11.28.1",
3
+ "version": "11.30.0",
4
4
  "packageManager": "pnpm@9.8.0",
5
5
  "scripts": {
6
6
  "preinstall": "npx only-allow pnpm",