@loomhq/lens 10.92.0 → 10.93.1

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
  import React from 'react';
2
2
  declare const LogoWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, LogoWrapperProps, object>;
3
- declare const Logo: ({ variant, maxWidth, symbolColor, wordmarkColor, brand, ...props }: LogoProps & React.ComponentProps<typeof LogoWrapper>) => JSX.Element;
3
+ declare const Logo: ({ variant, maxWidth, symbolColor, wordmarkColor, brand, customId, ...props }: LogoProps & React.ComponentProps<typeof LogoWrapper>) => JSX.Element;
4
4
  export declare const availableVariants: string[];
5
5
  declare type LogoProps = {
6
6
  variant?: 'combined' | 'symbol' | 'wordmark';
@@ -8,6 +8,7 @@ declare type LogoProps = {
8
8
  maxWidth?: number | string;
9
9
  symbolColor?: string;
10
10
  wordmarkColor?: string;
11
+ customId?: string;
11
12
  };
12
13
  declare type LogoWrapperProps = {
13
14
  variant?: 'combined' | 'symbol' | 'wordmark';
@@ -12,29 +12,31 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import React from 'react';
13
13
  import { getSize, getColorValue } from '../../utilities';
14
14
  import styled from '@emotion/styled';
15
- const LoomAiGradientDef = (React.createElement("defs", null,
16
- React.createElement("radialGradient", { id: "gradient1", cx: "50%", cy: "50%", r: "100%", fx: "0%", fy: "0%" },
17
- React.createElement("stop", { offset: "30%", stopColor: "#97ACFD" }),
18
- React.createElement("stop", { offset: "33%", stopColor: "#B3B2F4" }),
19
- React.createElement("stop", { offset: "43%", stopColor: "#DEB0E0" }),
20
- React.createElement("stop", { offset: "50%", stopColor: "#DFC6E5" }),
21
- React.createElement("stop", { offset: "72%", stopColor: "#6663F6" })),
22
- React.createElement("radialGradient", { id: "gradient2", r: "100%", fx: "40%", fy: "72%" },
23
- React.createElement("stop", { offset: "20%", stopColor: "#615CF500" }),
24
- React.createElement("stop", { offset: "32%", stopColor: "#615CF550" }),
25
- React.createElement("stop", { offset: "48%", stopColor: "#6663F6" })),
26
- React.createElement("radialGradient", { id: "gradient3", r: "100%", fx: "0%", fy: "100%" },
27
- React.createElement("stop", { offset: "25%", stopColor: "#6663F6" }),
28
- React.createElement("stop", { offset: "38%", stopColor: "#6E68F450" }),
29
- React.createElement("stop", { offset: "45%", stopColor: "#6E68F400" }))));
15
+ const LoomAiGradientDef = (customId) => {
16
+ return (React.createElement("defs", null,
17
+ React.createElement("radialGradient", { id: `ai-logo-${customId}-gradient-1`, cx: "50%", cy: "50%", r: "100%", fx: "0%", fy: "0%" },
18
+ React.createElement("stop", { offset: "30%", stopColor: "#97ACFD" }),
19
+ React.createElement("stop", { offset: "33%", stopColor: "#B3B2F4" }),
20
+ React.createElement("stop", { offset: "43%", stopColor: "#DEB0E0" }),
21
+ React.createElement("stop", { offset: "50%", stopColor: "#DFC6E5" }),
22
+ React.createElement("stop", { offset: "72%", stopColor: "#6663F6" })),
23
+ React.createElement("radialGradient", { id: `ai-logo-${customId}-gradient-2`, r: "100%", fx: "40%", fy: "72%" },
24
+ React.createElement("stop", { offset: "20%", stopColor: "#615CF500" }),
25
+ React.createElement("stop", { offset: "32%", stopColor: "#615CF550" }),
26
+ React.createElement("stop", { offset: "48%", stopColor: "#6663F6" })),
27
+ React.createElement("radialGradient", { id: `ai-logo-${customId}-gradient-3`, r: "100%", fx: "0%", fy: "100%" },
28
+ React.createElement("stop", { offset: "25%", stopColor: "#6663F6" }),
29
+ React.createElement("stop", { offset: "38%", stopColor: "#6E68F450" }),
30
+ React.createElement("stop", { offset: "45%", stopColor: "#6E68F400" }))));
31
+ };
30
32
  const symbolLogoPath = 'M30 15.4433C30 16.6091 29.0933 16.8581 27.9562 16.9301C22.5158 17.2323 16.7962 22.686 16.4795 28.112C16.422 29.2634 16.173 30.1702 15.0072 30.1702C13.8414 30.1702 13.578 29.2634 13.5205 28.0976C13.2038 22.686 7.48416 17.2323 2.05814 16.9301C0.906735 16.8581 0 16.6091 0 15.4433C0 14.2775 0.906735 14.043 2.05814 13.971C7.48416 13.6687 13.2038 7.65433 13.5205 2.22831C13.578 1.0769 13.827 0.170166 15.0072 0.170166C16.1874 0.170166 16.422 1.0769 16.4795 2.22831C16.7962 7.65433 22.5158 13.6687 27.9419 13.971C29.0933 14.043 30 14.2919 30 15.4433Z';
31
33
  const SymbolLogoSvg = (_a) => {
32
- var { brand, symbolColor } = _a, props = __rest(_a, ["brand", "symbolColor"]);
34
+ var { brand, symbolColor, customId } = _a, props = __rest(_a, ["brand", "symbolColor", "customId"]);
33
35
  switch (brand) {
34
36
  case 'ai':
35
37
  return (React.createElement("svg", Object.assign({ viewBox: "0 0 30 31", fill: "none" }, props), !symbolColor ? (React.createElement(React.Fragment, null,
36
- LoomAiGradientDef,
37
- [...Array(3)].map((_, i) => (React.createElement("path", { key: i, d: symbolLogoPath, fill: `url(#gradient${i + 1})` }))))) : (React.createElement("path", { d: symbolLogoPath, fill: getColorValue(symbolColor) }))));
38
+ LoomAiGradientDef(customId),
39
+ [...Array(3)].map((_, i) => (React.createElement("path", { key: i, d: symbolLogoPath, fill: `url(#ai-logo-${customId}-gradient-${i + 1}` }))))) : (React.createElement("path", { d: symbolLogoPath, fill: getColorValue(symbolColor) }))));
38
40
  default:
39
41
  return (React.createElement("svg", Object.assign({ viewBox: "0 0 31 30", fill: "none" }, props),
40
42
  React.createElement("path", { d: "M30.01 13.43h-9.142l7.917-4.57-1.57-2.72-7.918 4.57 4.57-7.915-2.72-1.57-4.571 7.913V0h-3.142v9.139L8.863 1.225l-2.721 1.57 4.57 7.913L2.796 6.14 1.225 8.86l7.917 4.57H0v3.141h9.141l-7.916 4.57 1.57 2.72 7.918-4.57-4.571 7.915 2.72 1.57 4.572-7.914V30h3.142v-9.334l4.655 8.06 2.551-1.472-4.656-8.062 8.087 4.668 1.571-2.72-7.916-4.57h9.141v-3.14h.001zm-15.005 5.84a4.271 4.271 0 11-.001-8.542 4.271 4.271 0 01.001 8.542z", fill: symbolColor
@@ -60,13 +62,13 @@ const WordmarkLogoSvg = (_a) => {
60
62
  };
61
63
  const combinedLogoPath = 'M100 7.76427C100 8.35691 99.539 8.48348 98.961 8.52007C96.1953 8.67371 93.2877 11.4461 93.1267 14.2045C93.0975 14.7898 92.9709 15.2508 92.3783 15.2508C91.7856 15.2508 91.6517 14.7898 91.6225 14.1972C91.4615 11.4461 88.5539 8.67371 85.7955 8.52007C85.2102 8.48348 84.7492 8.35691 84.7492 7.76427C84.7492 7.17162 85.2102 7.05237 85.7955 7.01578C88.5539 6.86213 91.4615 3.80464 91.6225 1.04628C91.6517 0.460948 91.7783 0 92.3783 0C92.9782 0 93.0975 0.460948 93.1267 1.04628C93.2877 3.80464 96.1953 6.86213 98.9537 7.01578C99.539 7.05237 100 7.17894 100 7.76427Z';
62
64
  const CombinedLogoSvg = (_a) => {
63
- var { brand, wordmarkColor, symbolColor } = _a, props = __rest(_a, ["brand", "wordmarkColor", "symbolColor"]);
65
+ var { brand, wordmarkColor, symbolColor, customId } = _a, props = __rest(_a, ["brand", "wordmarkColor", "symbolColor", "customId"]);
64
66
  switch (brand) {
65
67
  case 'ai':
66
68
  return (React.createElement("svg", Object.assign({ viewBox: "0 0 100 30", fill: "none" }, props),
67
69
  !symbolColor ? (React.createElement(React.Fragment, null,
68
- LoomAiGradientDef,
69
- [...Array(3)].map((_, i) => (React.createElement("path", { key: i, d: combinedLogoPath, fill: `url(#gradient${i + 1})` }))))) : (React.createElement("path", { d: combinedLogoPath, fill: getColorValue(symbolColor) })),
70
+ LoomAiGradientDef(customId),
71
+ [...Array(3)].map((_, i) => (React.createElement("path", { key: i, d: combinedLogoPath, fill: `url(#ai-logo-${customId}-gradient-${i + 1}` }))))) : (React.createElement("path", { d: combinedLogoPath, fill: getColorValue(symbolColor) })),
70
72
  React.createElement("g", { fill: wordmarkColor },
71
73
  React.createElement("path", { d: "M4.1997 29.5909H0.570312V9.83386H4.1997V29.5909Z" }),
72
74
  React.createElement("path", { d: "M12.3563 26.6983C14.1301 26.6983 15.7674 25.4157 15.7674 22.8778C15.7674 20.34 14.1301 19.0574 12.3563 19.0574C10.5826 19.0574 8.94526 20.34 8.94526 22.8778C8.94526 25.3884 10.5826 26.6983 12.3563 26.6983ZM12.3563 15.7555C16.3678 15.7555 19.3968 18.73 19.3968 22.8778C19.3968 26.9984 16.3678 30.0002 12.3563 30.0002C8.34491 30.0002 5.31587 26.9984 5.31587 22.8778C5.31587 18.73 8.34491 15.7555 12.3563 15.7555Z" }),
@@ -94,10 +96,10 @@ const LogoWrapper = styled.span `
94
96
  }
95
97
  `;
96
98
  const Logo = (_a) => {
97
- var { variant = 'combined', maxWidth, symbolColor, wordmarkColor = 'body', brand = 'loom' } = _a, props = __rest(_a, ["variant", "maxWidth", "symbolColor", "wordmarkColor", "brand"]);
99
+ var { variant = 'combined', maxWidth, symbolColor, wordmarkColor = 'body', brand = 'loom', customId = '' } = _a, props = __rest(_a, ["variant", "maxWidth", "symbolColor", "wordmarkColor", "brand", "customId"]);
98
100
  return (React.createElement(LogoWrapper, Object.assign({ "aria-label": brand, variant: variant, maxWidth: maxWidth }, props),
99
- variant === 'combined' && (React.createElement(CombinedLogoSvg, { brand: brand, symbolColor: symbolColor, wordmarkColor: getColorValue(wordmarkColor), className: "lns-logoSvg" })),
100
- variant === 'symbol' && (React.createElement(SymbolLogoSvg, { brand: brand, symbolColor: symbolColor, className: "lns-logoSvg" })),
101
+ variant === 'combined' && (React.createElement(CombinedLogoSvg, { brand: brand, symbolColor: symbolColor, wordmarkColor: getColorValue(wordmarkColor), customId: customId, className: "lns-logoSvg" })),
102
+ variant === 'symbol' && (React.createElement(SymbolLogoSvg, { brand: brand, symbolColor: symbolColor, customId: customId, className: "lns-logoSvg" })),
101
103
  variant === 'wordmark' && (React.createElement(WordmarkLogoSvg, { brand: brand, wordmarkColor: getColorValue(wordmarkColor), className: "lns-logoSvg" }))));
102
104
  };
103
105
  export const availableVariants = ['combined', 'symbol', 'wordmark'];
@@ -9,7 +9,7 @@ declare type VariantsProps = {
9
9
  export declare const variants: VariantsProps;
10
10
  export declare const lineHeightToPx: (size: any) => number;
11
11
  declare const TextWrapper: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, TextWrapperProps, object>;
12
- declare const Text: ({ children, size, color, isInline, isDimmed, fontWeight, hasEllipsis, ellipsisLines, variant, htmlTag, alignment, sizeMinMax, ...props }: TextProps & React.ComponentProps<typeof TextWrapper>) => JSX.Element;
12
+ declare const Text: ({ children, size, color, isInline, isDimmed, fontWeight, hasEllipsis, ellipsisLines, noWrap, variant, htmlTag, alignment, sizeMinMax, ...props }: TextProps & React.ComponentProps<typeof TextWrapper>) => JSX.Element;
13
13
  export declare const availableSizes: string[];
14
14
  export declare const deprecatedSizes: string[];
15
15
  export declare const availableFontWeights: string[];
@@ -24,6 +24,7 @@ interface TextProps {
24
24
  isInline?: boolean;
25
25
  isDimmed?: boolean;
26
26
  hasEllipsis?: boolean;
27
+ noWrap?: boolean;
27
28
  ellipsisLines?: number;
28
29
  htmlTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'p' | 'span' | 'div';
29
30
  children?: React.ReactNode;
@@ -59,7 +59,9 @@ const TextWrapper = styled.span `
59
59
  -webkit-box-orient: vertical;
60
60
  -webkit-line-clamp: ${props.ellipsisLines};
61
61
  `};
62
-
62
+ ${props => !props.hasEllipsis &&
63
+ props.noWrap &&
64
+ 'white-space: nowrap; overflow: hidden;'};
63
65
  ${props => props.sizeMinMax &&
64
66
  `
65
67
  min-height: 0vw;
@@ -77,11 +79,11 @@ const TextWrapper = styled.span `
77
79
  `}
78
80
  `;
79
81
  const Text = (_a) => {
80
- var { children, size = 'body-md', color, isInline, isDimmed, fontWeight = 'book', hasEllipsis, ellipsisLines, variant, htmlTag = 'span', alignment, sizeMinMax } = _a, props = __rest(_a, ["children", "size", "color", "isInline", "isDimmed", "fontWeight", "hasEllipsis", "ellipsisLines", "variant", "htmlTag", "alignment", "sizeMinMax"]);
82
+ var { children, size = 'body-md', color, isInline, isDimmed, fontWeight = 'book', hasEllipsis, ellipsisLines, noWrap, variant, htmlTag = 'span', alignment, sizeMinMax } = _a, props = __rest(_a, ["children", "size", "color", "isInline", "isDimmed", "fontWeight", "hasEllipsis", "ellipsisLines", "noWrap", "variant", "htmlTag", "alignment", "sizeMinMax"]);
81
83
  if (isDimmed) {
82
84
  console.warn(textIsDimmedDeprecated);
83
85
  }
84
- return (React.createElement(TextWrapper, Object.assign({ size: variant ? variants[variant].size : size, color: color, isInline: isInline, isDimmed: isDimmed, fontWeight: variant ? variants[variant].fontWeight : fontWeight, hasEllipsis: hasEllipsis, ellipsisLines: ellipsisLines, variant: variant, as: htmlTag, alignment: alignment, sizeMinMax: sizeMinMax }, props), children));
86
+ return (React.createElement(TextWrapper, Object.assign({ size: variant ? variants[variant].size : size, color: color, isInline: isInline, isDimmed: isDimmed, fontWeight: variant ? variants[variant].fontWeight : fontWeight, hasEllipsis: hasEllipsis, ellipsisLines: ellipsisLines, noWrap: noWrap, variant: variant, as: htmlTag, alignment: alignment, sizeMinMax: sizeMinMax }, props), children));
85
87
  };
86
88
  export const availableSizes = [
87
89
  'body-sm',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.92.0",
3
+ "version": "10.93.1",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",