@loomhq/lens 11.31.0 → 11.32.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
|
@@ -185,6 +185,7 @@ __export(src_exports, {
|
|
|
185
185
|
getCssVarsFromObject: () => getCssVarsFromObject,
|
|
186
186
|
getFocusRing: () => getFocusRing,
|
|
187
187
|
getFontWeight: () => getFontWeight,
|
|
188
|
+
getListContainer: () => getListContainer,
|
|
188
189
|
getMediaCss: () => getMediaCss,
|
|
189
190
|
getPlacement: () => getPlacement,
|
|
190
191
|
getRadius: () => getRadius,
|
|
@@ -596,6 +597,15 @@ var getFocusRing = (color, position) => {
|
|
|
596
597
|
const focusColor = color ? color : getColorValue("focusRing");
|
|
597
598
|
return `box-shadow:${position ? position : ""} 0 0 0 2px ${focusColor};`;
|
|
598
599
|
};
|
|
600
|
+
var getListContainer = (tag) => {
|
|
601
|
+
if (tag === "ol" || tag === "ul") {
|
|
602
|
+
return `
|
|
603
|
+
list-style-type: none;
|
|
604
|
+
margin: 0;
|
|
605
|
+
padding: 0
|
|
606
|
+
`;
|
|
607
|
+
}
|
|
608
|
+
};
|
|
599
609
|
var getPlacement = (maxHeight, placement) => {
|
|
600
610
|
const placementStyles = {
|
|
601
611
|
center: {
|
|
@@ -2568,6 +2578,7 @@ var ArrangeWrapper = import_styled10.default.div`
|
|
|
2568
2578
|
|
|
2569
2579
|
${(props) => props.autoFlow && getResponsiveOneOf("grid-auto-flow", props.autoFlow)};
|
|
2570
2580
|
${(props) => props.columns && props.autoFlow && getResponsiveOneOf("grid-auto-flow", props.autoFlow)};
|
|
2581
|
+
${(props) => getListContainer(props.as)};
|
|
2571
2582
|
`;
|
|
2572
2583
|
var Arrange = (_a) => {
|
|
2573
2584
|
var _b = _a, {
|
|
@@ -2586,6 +2597,7 @@ var Arrange = (_a) => {
|
|
|
2586
2597
|
justifyItems,
|
|
2587
2598
|
alignContent,
|
|
2588
2599
|
autoFlow,
|
|
2600
|
+
htmlTag = "div",
|
|
2589
2601
|
className,
|
|
2590
2602
|
style
|
|
2591
2603
|
} = _b, props = __objRest(_b, [
|
|
@@ -2604,6 +2616,7 @@ var Arrange = (_a) => {
|
|
|
2604
2616
|
"justifyItems",
|
|
2605
2617
|
"alignContent",
|
|
2606
2618
|
"autoFlow",
|
|
2619
|
+
"htmlTag",
|
|
2607
2620
|
"className",
|
|
2608
2621
|
"style"
|
|
2609
2622
|
]);
|
|
@@ -2614,6 +2627,7 @@ var Arrange = (_a) => {
|
|
|
2614
2627
|
ArrangeWrapper,
|
|
2615
2628
|
__spreadValues({
|
|
2616
2629
|
alignItems,
|
|
2630
|
+
as: htmlTag,
|
|
2617
2631
|
justifyContent,
|
|
2618
2632
|
justifyItems,
|
|
2619
2633
|
alignContent,
|
|
@@ -5974,6 +5988,7 @@ var SplitWrapper = import_styled38.default.div`
|
|
|
5974
5988
|
${(props) => props.rowGap && getSize("row-gap", props.rowGap)};
|
|
5975
5989
|
${(props) => props.columnGap && getSize("column-gap", props.columnGap)};
|
|
5976
5990
|
${(props) => getSizeStyles(props)};
|
|
5991
|
+
${(props) => getListContainer(props.as)};
|
|
5977
5992
|
`;
|
|
5978
5993
|
var SplitSectionWrapper = import_styled38.default.div`
|
|
5979
5994
|
${(props) => getResponsiveNumber("flex-grow", props.grow)};
|
|
@@ -5993,6 +6008,7 @@ var SplitSection = (_a) => {
|
|
|
5993
6008
|
minHeight,
|
|
5994
6009
|
maxWidth,
|
|
5995
6010
|
maxHeight,
|
|
6011
|
+
htmlTag = "div",
|
|
5996
6012
|
className,
|
|
5997
6013
|
style
|
|
5998
6014
|
} = _b, props = __objRest(_b, [
|
|
@@ -6006,6 +6022,7 @@ var SplitSection = (_a) => {
|
|
|
6006
6022
|
"minHeight",
|
|
6007
6023
|
"maxWidth",
|
|
6008
6024
|
"maxHeight",
|
|
6025
|
+
"htmlTag",
|
|
6009
6026
|
"className",
|
|
6010
6027
|
"style"
|
|
6011
6028
|
]);
|
|
@@ -6015,6 +6032,7 @@ var SplitSection = (_a) => {
|
|
|
6015
6032
|
return /* @__PURE__ */ import_react45.default.createElement(
|
|
6016
6033
|
SplitSectionWrapper,
|
|
6017
6034
|
__spreadValues({
|
|
6035
|
+
as: htmlTag,
|
|
6018
6036
|
grow,
|
|
6019
6037
|
shrink,
|
|
6020
6038
|
basis,
|
|
@@ -6044,6 +6062,7 @@ var Split = (_a) => {
|
|
|
6044
6062
|
minHeight,
|
|
6045
6063
|
maxWidth,
|
|
6046
6064
|
maxHeight,
|
|
6065
|
+
htmlTag = "div",
|
|
6047
6066
|
className,
|
|
6048
6067
|
style
|
|
6049
6068
|
} = _b, props = __objRest(_b, [
|
|
@@ -6061,6 +6080,7 @@ var Split = (_a) => {
|
|
|
6061
6080
|
"minHeight",
|
|
6062
6081
|
"maxWidth",
|
|
6063
6082
|
"maxHeight",
|
|
6083
|
+
"htmlTag",
|
|
6064
6084
|
"className",
|
|
6065
6085
|
"style"
|
|
6066
6086
|
]);
|
|
@@ -6070,6 +6090,7 @@ var Split = (_a) => {
|
|
|
6070
6090
|
return /* @__PURE__ */ import_react45.default.createElement(
|
|
6071
6091
|
SplitWrapper,
|
|
6072
6092
|
__spreadValues({
|
|
6093
|
+
as: htmlTag,
|
|
6073
6094
|
gap,
|
|
6074
6095
|
rowGap,
|
|
6075
6096
|
columnGap,
|
|
@@ -6084,7 +6105,12 @@ var Split = (_a) => {
|
|
|
6084
6105
|
maxWidth,
|
|
6085
6106
|
maxHeight
|
|
6086
6107
|
}, props),
|
|
6087
|
-
children
|
|
6108
|
+
htmlTag === "ul" || htmlTag === "ol" ? import_react45.Children.map(children, (child) => {
|
|
6109
|
+
if (child.type === SplitSection || child.type === Split) {
|
|
6110
|
+
return (0, import_react45.cloneElement)(child, { htmlTag: "li" });
|
|
6111
|
+
}
|
|
6112
|
+
return child;
|
|
6113
|
+
}) : children
|
|
6088
6114
|
);
|
|
6089
6115
|
};
|
|
6090
6116
|
var split_default = Split;
|
package/dist/esm/index.js
CHANGED
|
@@ -377,6 +377,15 @@ var getFocusRing = (color, position) => {
|
|
|
377
377
|
const focusColor = color ? color : getColorValue("focusRing");
|
|
378
378
|
return `box-shadow:${position ? position : ""} 0 0 0 2px ${focusColor};`;
|
|
379
379
|
};
|
|
380
|
+
var getListContainer = (tag) => {
|
|
381
|
+
if (tag === "ol" || tag === "ul") {
|
|
382
|
+
return `
|
|
383
|
+
list-style-type: none;
|
|
384
|
+
margin: 0;
|
|
385
|
+
padding: 0
|
|
386
|
+
`;
|
|
387
|
+
}
|
|
388
|
+
};
|
|
380
389
|
var getPlacement = (maxHeight, placement) => {
|
|
381
390
|
const placementStyles = {
|
|
382
391
|
center: {
|
|
@@ -2349,6 +2358,7 @@ var ArrangeWrapper = styled10.div`
|
|
|
2349
2358
|
|
|
2350
2359
|
${(props) => props.autoFlow && getResponsiveOneOf("grid-auto-flow", props.autoFlow)};
|
|
2351
2360
|
${(props) => props.columns && props.autoFlow && getResponsiveOneOf("grid-auto-flow", props.autoFlow)};
|
|
2361
|
+
${(props) => getListContainer(props.as)};
|
|
2352
2362
|
`;
|
|
2353
2363
|
var Arrange = (_a) => {
|
|
2354
2364
|
var _b = _a, {
|
|
@@ -2367,6 +2377,7 @@ var Arrange = (_a) => {
|
|
|
2367
2377
|
justifyItems,
|
|
2368
2378
|
alignContent,
|
|
2369
2379
|
autoFlow,
|
|
2380
|
+
htmlTag = "div",
|
|
2370
2381
|
className,
|
|
2371
2382
|
style
|
|
2372
2383
|
} = _b, props = __objRest(_b, [
|
|
@@ -2385,6 +2396,7 @@ var Arrange = (_a) => {
|
|
|
2385
2396
|
"justifyItems",
|
|
2386
2397
|
"alignContent",
|
|
2387
2398
|
"autoFlow",
|
|
2399
|
+
"htmlTag",
|
|
2388
2400
|
"className",
|
|
2389
2401
|
"style"
|
|
2390
2402
|
]);
|
|
@@ -2395,6 +2407,7 @@ var Arrange = (_a) => {
|
|
|
2395
2407
|
ArrangeWrapper,
|
|
2396
2408
|
__spreadValues({
|
|
2397
2409
|
alignItems,
|
|
2410
|
+
as: htmlTag,
|
|
2398
2411
|
justifyContent,
|
|
2399
2412
|
justifyItems,
|
|
2400
2413
|
alignContent,
|
|
@@ -5740,7 +5753,7 @@ var Illustration = (_a) => {
|
|
|
5740
5753
|
var illustration_default = Illustration;
|
|
5741
5754
|
|
|
5742
5755
|
// src/components/split/split.tsx
|
|
5743
|
-
import React47 from "react";
|
|
5756
|
+
import React47, { Children, cloneElement } from "react";
|
|
5744
5757
|
import { css as css5 } from "@emotion/core";
|
|
5745
5758
|
import styled38 from "@emotion/styled";
|
|
5746
5759
|
var getSizeStyles = (props) => css5`
|
|
@@ -5762,6 +5775,7 @@ var SplitWrapper = styled38.div`
|
|
|
5762
5775
|
${(props) => props.rowGap && getSize("row-gap", props.rowGap)};
|
|
5763
5776
|
${(props) => props.columnGap && getSize("column-gap", props.columnGap)};
|
|
5764
5777
|
${(props) => getSizeStyles(props)};
|
|
5778
|
+
${(props) => getListContainer(props.as)};
|
|
5765
5779
|
`;
|
|
5766
5780
|
var SplitSectionWrapper = styled38.div`
|
|
5767
5781
|
${(props) => getResponsiveNumber("flex-grow", props.grow)};
|
|
@@ -5781,6 +5795,7 @@ var SplitSection = (_a) => {
|
|
|
5781
5795
|
minHeight,
|
|
5782
5796
|
maxWidth,
|
|
5783
5797
|
maxHeight,
|
|
5798
|
+
htmlTag = "div",
|
|
5784
5799
|
className,
|
|
5785
5800
|
style
|
|
5786
5801
|
} = _b, props = __objRest(_b, [
|
|
@@ -5794,6 +5809,7 @@ var SplitSection = (_a) => {
|
|
|
5794
5809
|
"minHeight",
|
|
5795
5810
|
"maxWidth",
|
|
5796
5811
|
"maxHeight",
|
|
5812
|
+
"htmlTag",
|
|
5797
5813
|
"className",
|
|
5798
5814
|
"style"
|
|
5799
5815
|
]);
|
|
@@ -5803,6 +5819,7 @@ var SplitSection = (_a) => {
|
|
|
5803
5819
|
return /* @__PURE__ */ React47.createElement(
|
|
5804
5820
|
SplitSectionWrapper,
|
|
5805
5821
|
__spreadValues({
|
|
5822
|
+
as: htmlTag,
|
|
5806
5823
|
grow,
|
|
5807
5824
|
shrink,
|
|
5808
5825
|
basis,
|
|
@@ -5832,6 +5849,7 @@ var Split = (_a) => {
|
|
|
5832
5849
|
minHeight,
|
|
5833
5850
|
maxWidth,
|
|
5834
5851
|
maxHeight,
|
|
5852
|
+
htmlTag = "div",
|
|
5835
5853
|
className,
|
|
5836
5854
|
style
|
|
5837
5855
|
} = _b, props = __objRest(_b, [
|
|
@@ -5849,6 +5867,7 @@ var Split = (_a) => {
|
|
|
5849
5867
|
"minHeight",
|
|
5850
5868
|
"maxWidth",
|
|
5851
5869
|
"maxHeight",
|
|
5870
|
+
"htmlTag",
|
|
5852
5871
|
"className",
|
|
5853
5872
|
"style"
|
|
5854
5873
|
]);
|
|
@@ -5858,6 +5877,7 @@ var Split = (_a) => {
|
|
|
5858
5877
|
return /* @__PURE__ */ React47.createElement(
|
|
5859
5878
|
SplitWrapper,
|
|
5860
5879
|
__spreadValues({
|
|
5880
|
+
as: htmlTag,
|
|
5861
5881
|
gap,
|
|
5862
5882
|
rowGap,
|
|
5863
5883
|
columnGap,
|
|
@@ -5872,7 +5892,12 @@ var Split = (_a) => {
|
|
|
5872
5892
|
maxWidth,
|
|
5873
5893
|
maxHeight
|
|
5874
5894
|
}, props),
|
|
5875
|
-
children
|
|
5895
|
+
htmlTag === "ul" || htmlTag === "ol" ? Children.map(children, (child) => {
|
|
5896
|
+
if (child.type === SplitSection || child.type === Split) {
|
|
5897
|
+
return cloneElement(child, { htmlTag: "li" });
|
|
5898
|
+
}
|
|
5899
|
+
return child;
|
|
5900
|
+
}) : children
|
|
5876
5901
|
);
|
|
5877
5902
|
};
|
|
5878
5903
|
var split_default = Split;
|
|
@@ -7559,6 +7584,7 @@ export {
|
|
|
7559
7584
|
getCssVarsFromObject,
|
|
7560
7585
|
getFocusRing,
|
|
7561
7586
|
getFontWeight,
|
|
7587
|
+
getListContainer,
|
|
7562
7588
|
getMediaCss,
|
|
7563
7589
|
getPlacement,
|
|
7564
7590
|
getRadius,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { LensDivProps, ResponsiveGridSections, ResponsiveType } from '../../types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
declare const ArrangeWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
4
|
-
|
|
3
|
+
declare const ArrangeWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ArrangeWrapperProps, object>;
|
|
4
|
+
declare const Arrange: ({ children, width, height, minWidth, minHeight, maxWidth, maxHeight, gap, columns, rows, alignItems, justifyContent, justifyItems, alignContent, autoFlow, htmlTag, className, style, ...props }: ArrangeProps & React.ComponentProps<typeof ArrangeWrapper> & Omit<LensDivProps, keyof ArrangeProps & React.ComponentProps<typeof ArrangeWrapper>>) => React.JSX.Element;
|
|
5
|
+
interface SharedProps {
|
|
5
6
|
children?: React.ReactNode;
|
|
6
7
|
width?: ResponsiveType<string | number>;
|
|
7
8
|
height?: ResponsiveType<string | number>;
|
|
@@ -17,6 +18,11 @@ type ArrangeProps = {
|
|
|
17
18
|
autoFlow?: ResponsiveType<'column' | 'row'>;
|
|
18
19
|
columns?: ResponsiveGridSections;
|
|
19
20
|
rows?: ResponsiveGridSections;
|
|
20
|
-
}
|
|
21
|
-
|
|
21
|
+
}
|
|
22
|
+
interface ArrangeProps extends SharedProps {
|
|
23
|
+
htmlTag?: 'div' | 'ul' | 'ol' | 'li';
|
|
24
|
+
}
|
|
25
|
+
interface ArrangeWrapperProps extends SharedProps {
|
|
26
|
+
as?: string;
|
|
27
|
+
}
|
|
22
28
|
export default Arrange;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ResponsiveType } from '../../types';
|
|
3
|
-
declare const SplitWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
4
|
-
declare const SplitSectionWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
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, rowGap, columnGap, alignItems, justifyContent, alignContent, wrap, width, height, minWidth, minHeight, maxWidth, maxHeight, className, style, ...props }: SplitProps & React.ComponentProps<typeof SplitWrapper>) => React.JSX.Element;
|
|
3
|
+
declare const SplitWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SplitWrapperProps, object>;
|
|
4
|
+
declare const SplitSectionWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SplitSectionWrapperProps, object>;
|
|
5
|
+
export declare const SplitSection: ({ children, grow, shrink, basis, width, height, minWidth, minHeight, maxWidth, maxHeight, htmlTag, className, style, ...props }: SplitSectionProps & React.ComponentProps<typeof SplitSectionWrapper>) => React.JSX.Element;
|
|
6
|
+
declare const Split: ({ children, gap, rowGap, columnGap, alignItems, justifyContent, alignContent, wrap, width, height, minWidth, minHeight, maxWidth, maxHeight, htmlTag, 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>;
|
|
@@ -18,6 +18,7 @@ interface SplitProps extends SharedProps {
|
|
|
18
18
|
justifyContent?: ResponsiveType<'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly'>;
|
|
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
|
+
htmlTag?: 'div' | 'ul' | 'ol' | 'li';
|
|
21
22
|
gap?: ResponsiveType<number | string>;
|
|
22
23
|
rowGap?: ResponsiveType<number | string>;
|
|
23
24
|
columnGap?: ResponsiveType<number | string>;
|
|
@@ -25,11 +26,18 @@ interface SplitProps extends SharedProps {
|
|
|
25
26
|
className?: never;
|
|
26
27
|
style?: never;
|
|
27
28
|
}
|
|
29
|
+
interface SplitWrapperProps extends SplitProps {
|
|
30
|
+
as?: string;
|
|
31
|
+
}
|
|
28
32
|
interface SplitSectionProps extends SharedProps {
|
|
29
33
|
grow?: ResponsiveType<number | string>;
|
|
30
34
|
shrink?: ResponsiveType<number | string>;
|
|
31
35
|
basis?: ResponsiveType<number | string>;
|
|
32
36
|
className?: never;
|
|
33
37
|
style?: never;
|
|
38
|
+
htmlTag?: 'div' | 'li';
|
|
39
|
+
}
|
|
40
|
+
interface SplitSectionWrapperProps extends SplitSectionProps {
|
|
41
|
+
as?: string;
|
|
34
42
|
}
|
|
35
43
|
export default Split;
|
|
@@ -3,4 +3,5 @@ export function getRadius(size: any): string;
|
|
|
3
3
|
export function getFontWeight(fontWeight: any): string;
|
|
4
4
|
export function getShadow(size: any): string;
|
|
5
5
|
export function getFocusRing(color: any, position: any): string;
|
|
6
|
+
export function getListContainer(tag: any): string;
|
|
6
7
|
export function getPlacement(maxHeight: any, placement: any): any;
|