@loomhq/lens 11.30.4 → 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,
@@ -5565,6 +5579,8 @@ var TabsNav = import_styled34.default.nav`
5565
5579
  -ms-overflow-style: none;
5566
5580
  scrollbar-width: none;
5567
5581
 
5582
+ ${(props) => props.hasBottomBorder && "border-bottom: 1px solid var(--lns-color-border)"}
5583
+
5568
5584
  ${(props) => props.scrollOffset && getSize("padding-left", props.scrollOffset)};
5569
5585
 
5570
5586
  &::-webkit-scrollbar {
@@ -5619,7 +5635,7 @@ var TabWrapper = import_styled34.default.button`
5619
5635
  appearance: none;
5620
5636
  font: inherit;
5621
5637
  background: transparent;
5622
- border: none;
5638
+ border: 0;
5623
5639
  ${getRadius("medium")};
5624
5640
  cursor: pointer;
5625
5641
  display: inline-flex;
@@ -5724,12 +5740,14 @@ var Tabs = (_a) => {
5724
5740
  children,
5725
5741
  scrollOffset,
5726
5742
  hasFullTabs,
5727
- isPilledDesign
5743
+ isPilledDesign,
5744
+ hasBottomBorder = false
5728
5745
  } = _b, props = __objRest(_b, [
5729
5746
  "children",
5730
5747
  "scrollOffset",
5731
5748
  "hasFullTabs",
5732
- "isPilledDesign"
5749
+ "isPilledDesign",
5750
+ "hasBottomBorder"
5733
5751
  ]);
5734
5752
  const tabsContent = isPilledDesign ? /* @__PURE__ */ import_react41.default.createElement(
5735
5753
  TabsNavPilled,
@@ -5738,7 +5756,15 @@ var Tabs = (_a) => {
5738
5756
  scrollOffset
5739
5757
  }, props),
5740
5758
  children
5741
- ) : /* @__PURE__ */ import_react41.default.createElement(TabsNav, __spreadValues({ hasFullTabs, scrollOffset }, props), children);
5759
+ ) : /* @__PURE__ */ import_react41.default.createElement(
5760
+ TabsNav,
5761
+ __spreadValues({
5762
+ hasFullTabs,
5763
+ scrollOffset,
5764
+ hasBottomBorder
5765
+ }, props),
5766
+ children
5767
+ );
5742
5768
  if (scrollOffset) {
5743
5769
  return /* @__PURE__ */ import_react41.default.createElement(Wrapper, { scrollOffset }, tabsContent);
5744
5770
  }
@@ -5962,6 +5988,7 @@ var SplitWrapper = import_styled38.default.div`
5962
5988
  ${(props) => props.rowGap && getSize("row-gap", props.rowGap)};
5963
5989
  ${(props) => props.columnGap && getSize("column-gap", props.columnGap)};
5964
5990
  ${(props) => getSizeStyles(props)};
5991
+ ${(props) => getListContainer(props.as)};
5965
5992
  `;
5966
5993
  var SplitSectionWrapper = import_styled38.default.div`
5967
5994
  ${(props) => getResponsiveNumber("flex-grow", props.grow)};
@@ -5981,6 +6008,7 @@ var SplitSection = (_a) => {
5981
6008
  minHeight,
5982
6009
  maxWidth,
5983
6010
  maxHeight,
6011
+ htmlTag = "div",
5984
6012
  className,
5985
6013
  style
5986
6014
  } = _b, props = __objRest(_b, [
@@ -5994,6 +6022,7 @@ var SplitSection = (_a) => {
5994
6022
  "minHeight",
5995
6023
  "maxWidth",
5996
6024
  "maxHeight",
6025
+ "htmlTag",
5997
6026
  "className",
5998
6027
  "style"
5999
6028
  ]);
@@ -6003,6 +6032,7 @@ var SplitSection = (_a) => {
6003
6032
  return /* @__PURE__ */ import_react45.default.createElement(
6004
6033
  SplitSectionWrapper,
6005
6034
  __spreadValues({
6035
+ as: htmlTag,
6006
6036
  grow,
6007
6037
  shrink,
6008
6038
  basis,
@@ -6032,6 +6062,7 @@ var Split = (_a) => {
6032
6062
  minHeight,
6033
6063
  maxWidth,
6034
6064
  maxHeight,
6065
+ htmlTag = "div",
6035
6066
  className,
6036
6067
  style
6037
6068
  } = _b, props = __objRest(_b, [
@@ -6049,6 +6080,7 @@ var Split = (_a) => {
6049
6080
  "minHeight",
6050
6081
  "maxWidth",
6051
6082
  "maxHeight",
6083
+ "htmlTag",
6052
6084
  "className",
6053
6085
  "style"
6054
6086
  ]);
@@ -6058,6 +6090,7 @@ var Split = (_a) => {
6058
6090
  return /* @__PURE__ */ import_react45.default.createElement(
6059
6091
  SplitWrapper,
6060
6092
  __spreadValues({
6093
+ as: htmlTag,
6061
6094
  gap,
6062
6095
  rowGap,
6063
6096
  columnGap,
@@ -6072,7 +6105,12 @@ var Split = (_a) => {
6072
6105
  maxWidth,
6073
6106
  maxHeight
6074
6107
  }, props),
6075
- 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
6076
6114
  );
6077
6115
  };
6078
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,
@@ -5346,6 +5359,8 @@ var TabsNav = styled34.nav`
5346
5359
  -ms-overflow-style: none;
5347
5360
  scrollbar-width: none;
5348
5361
 
5362
+ ${(props) => props.hasBottomBorder && "border-bottom: 1px solid var(--lns-color-border)"}
5363
+
5349
5364
  ${(props) => props.scrollOffset && getSize("padding-left", props.scrollOffset)};
5350
5365
 
5351
5366
  &::-webkit-scrollbar {
@@ -5400,7 +5415,7 @@ var TabWrapper = styled34.button`
5400
5415
  appearance: none;
5401
5416
  font: inherit;
5402
5417
  background: transparent;
5403
- border: none;
5418
+ border: 0;
5404
5419
  ${getRadius("medium")};
5405
5420
  cursor: pointer;
5406
5421
  display: inline-flex;
@@ -5505,12 +5520,14 @@ var Tabs = (_a) => {
5505
5520
  children,
5506
5521
  scrollOffset,
5507
5522
  hasFullTabs,
5508
- isPilledDesign
5523
+ isPilledDesign,
5524
+ hasBottomBorder = false
5509
5525
  } = _b, props = __objRest(_b, [
5510
5526
  "children",
5511
5527
  "scrollOffset",
5512
5528
  "hasFullTabs",
5513
- "isPilledDesign"
5529
+ "isPilledDesign",
5530
+ "hasBottomBorder"
5514
5531
  ]);
5515
5532
  const tabsContent = isPilledDesign ? /* @__PURE__ */ React43.createElement(
5516
5533
  TabsNavPilled,
@@ -5519,7 +5536,15 @@ var Tabs = (_a) => {
5519
5536
  scrollOffset
5520
5537
  }, props),
5521
5538
  children
5522
- ) : /* @__PURE__ */ React43.createElement(TabsNav, __spreadValues({ hasFullTabs, scrollOffset }, props), children);
5539
+ ) : /* @__PURE__ */ React43.createElement(
5540
+ TabsNav,
5541
+ __spreadValues({
5542
+ hasFullTabs,
5543
+ scrollOffset,
5544
+ hasBottomBorder
5545
+ }, props),
5546
+ children
5547
+ );
5523
5548
  if (scrollOffset) {
5524
5549
  return /* @__PURE__ */ React43.createElement(Wrapper, { scrollOffset }, tabsContent);
5525
5550
  }
@@ -5728,7 +5753,7 @@ var Illustration = (_a) => {
5728
5753
  var illustration_default = Illustration;
5729
5754
 
5730
5755
  // src/components/split/split.tsx
5731
- import React47 from "react";
5756
+ import React47, { Children, cloneElement } from "react";
5732
5757
  import { css as css5 } from "@emotion/core";
5733
5758
  import styled38 from "@emotion/styled";
5734
5759
  var getSizeStyles = (props) => css5`
@@ -5750,6 +5775,7 @@ var SplitWrapper = styled38.div`
5750
5775
  ${(props) => props.rowGap && getSize("row-gap", props.rowGap)};
5751
5776
  ${(props) => props.columnGap && getSize("column-gap", props.columnGap)};
5752
5777
  ${(props) => getSizeStyles(props)};
5778
+ ${(props) => getListContainer(props.as)};
5753
5779
  `;
5754
5780
  var SplitSectionWrapper = styled38.div`
5755
5781
  ${(props) => getResponsiveNumber("flex-grow", props.grow)};
@@ -5769,6 +5795,7 @@ var SplitSection = (_a) => {
5769
5795
  minHeight,
5770
5796
  maxWidth,
5771
5797
  maxHeight,
5798
+ htmlTag = "div",
5772
5799
  className,
5773
5800
  style
5774
5801
  } = _b, props = __objRest(_b, [
@@ -5782,6 +5809,7 @@ var SplitSection = (_a) => {
5782
5809
  "minHeight",
5783
5810
  "maxWidth",
5784
5811
  "maxHeight",
5812
+ "htmlTag",
5785
5813
  "className",
5786
5814
  "style"
5787
5815
  ]);
@@ -5791,6 +5819,7 @@ var SplitSection = (_a) => {
5791
5819
  return /* @__PURE__ */ React47.createElement(
5792
5820
  SplitSectionWrapper,
5793
5821
  __spreadValues({
5822
+ as: htmlTag,
5794
5823
  grow,
5795
5824
  shrink,
5796
5825
  basis,
@@ -5820,6 +5849,7 @@ var Split = (_a) => {
5820
5849
  minHeight,
5821
5850
  maxWidth,
5822
5851
  maxHeight,
5852
+ htmlTag = "div",
5823
5853
  className,
5824
5854
  style
5825
5855
  } = _b, props = __objRest(_b, [
@@ -5837,6 +5867,7 @@ var Split = (_a) => {
5837
5867
  "minHeight",
5838
5868
  "maxWidth",
5839
5869
  "maxHeight",
5870
+ "htmlTag",
5840
5871
  "className",
5841
5872
  "style"
5842
5873
  ]);
@@ -5846,6 +5877,7 @@ var Split = (_a) => {
5846
5877
  return /* @__PURE__ */ React47.createElement(
5847
5878
  SplitWrapper,
5848
5879
  __spreadValues({
5880
+ as: htmlTag,
5849
5881
  gap,
5850
5882
  rowGap,
5851
5883
  columnGap,
@@ -5860,7 +5892,12 @@ var Split = (_a) => {
5860
5892
  maxWidth,
5861
5893
  maxHeight
5862
5894
  }, props),
5863
- 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
5864
5901
  );
5865
5902
  };
5866
5903
  var split_default = Split;
@@ -7547,6 +7584,7 @@ export {
7547
7584
  getCssVarsFromObject,
7548
7585
  getFocusRing,
7549
7586
  getFontWeight,
7587
+ getListContainer,
7550
7588
  getMediaCss,
7551
7589
  getPlacement,
7552
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>, ArrangeProps, object>;
4
- type ArrangeProps = {
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
- declare const Arrange: ({ children, width, height, minWidth, minHeight, maxWidth, maxHeight, gap, columns, rows, alignItems, justifyContent, justifyItems, alignContent, autoFlow, className, style, ...props }: ArrangeProps & React.ComponentProps<typeof ArrangeWrapper> & Omit<LensDivProps, keyof ArrangeProps & React.ComponentProps<typeof ArrangeWrapper>>) => React.JSX.Element;
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>, SplitProps, object>;
4
- declare const SplitSectionWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, SplitSectionProps, object>;
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;
@@ -2,12 +2,13 @@ import React from 'react';
2
2
  import { LensButtonProps } from '../../types';
3
3
  declare const TabWrapper: import("@emotion/styled").StyledComponent<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, TabWrapperProps, object>;
4
4
  export declare const Tab: ({ children, isActive, htmlTag, icon, ...props }: TabProps & React.ComponentProps<typeof TabWrapper> & Omit<LensButtonProps, keyof TabProps & React.ComponentProps<typeof TabWrapper>>) => React.JSX.Element;
5
- declare const Tabs: ({ children, scrollOffset, hasFullTabs, isPilledDesign, ...props }: TabsProps) => React.JSX.Element;
5
+ declare const Tabs: ({ children, scrollOffset, hasFullTabs, isPilledDesign, hasBottomBorder, ...props }: TabsProps) => React.JSX.Element;
6
6
  type TabsProps = {
7
7
  scrollOffset?: number | string;
8
8
  hasFullTabs?: boolean;
9
9
  children?: React.ReactNode;
10
10
  isPilledDesign?: boolean;
11
+ hasBottomBorder?: boolean;
11
12
  };
12
13
  type TabProps = {
13
14
  isActive?: boolean;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "11.30.4",
3
+ "version": "11.32.0",
4
4
  "packageManager": "pnpm@9.8.0",
5
5
  "scripts": {
6
6
  "preinstall": "npx only-allow pnpm",