@loomhq/lens 10.42.0 → 10.43.7

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/colors.d.ts CHANGED
@@ -6,7 +6,7 @@ declare type HslaColor = {
6
6
  };
7
7
  declare const BaseColors: readonly ["red", "blurpleLight", "blurpleMedium", "blurple", "blurpleDark", "offWhite", "blueLight", "blue", "blueDark", "orangeLight", "orange", "orangeDark", "tealLight", "teal", "tealDark", "yellowLight", "yellow", "yellowDark"];
8
8
  declare const GreyColors: readonly ["grey8", "grey7", "grey6", "grey5", "grey4", "grey3", "grey2", "grey1", "white"];
9
- declare const SharedColors: readonly ["primary", "primaryHover", "primaryActive", "focusRing", "record", "recordHover", "recordActive", "success", "danger", "dangerHover", "dangerActive", "backdrop", "disabledContent", "highlight"];
9
+ declare const SharedColors: readonly ["primary", "primaryHover", "primaryActive", "focusRing", "record", "recordHover", "recordActive", "success", "danger", "dangerHover", "dangerActive", "backdrop", "backdropDark", "disabledContent", "highlight"];
10
10
  declare const SemanticColors: readonly ["body", "bodyDimmed", "background", "backgroundHover", "backgroundActive", "backgroundSecondary", "backgroundSecondary2", "overlay", "border", "disabledBackground", "formFieldBorder", "formFieldBackground", "buttonBorder", "upgrade", "upgradeHover", "upgradeActive", "tabBackground", "discoveryBackground", "discoveryLightBackground", "discoveryTitle", "discoveryHighlight"];
11
11
  declare type ThemesColorVariant = Record<typeof SharedColors[number] | typeof SemanticColors[number], HslaColor>;
12
12
  declare type ThemesColors = {
package/dist/colors.js CHANGED
@@ -42,6 +42,7 @@ const SharedColors = [
42
42
  'dangerHover',
43
43
  'dangerActive',
44
44
  'backdrop',
45
+ 'backdropDark',
45
46
  'disabledContent',
46
47
  'highlight',
47
48
  ];
@@ -78,6 +79,7 @@ const activeIncrease = 31.6;
78
79
  const bodyDimmedAlpha = 0.6;
79
80
  const borderAlpha = 0.2;
80
81
  const backdropAlpha = 0.5;
82
+ const backdropDarkAlpha = 0.8;
81
83
  const focusRingAlpha = 0.5;
82
84
  const buttonBorderAlpha = 0.25;
83
85
  const tabBackgroundAlpha = 0.15;
@@ -125,6 +127,7 @@ const themeSharedColors = {
125
127
  dangerHover: darken(hslaBaseColors.red, hoverIncrease),
126
128
  dangerActive: darken(hslaBaseColors.red, activeIncrease),
127
129
  backdrop: alpha(hslaGreys.grey8, backdropAlpha),
130
+ backdropDark: alpha(hslaGreys.grey8, backdropDarkAlpha),
128
131
  disabledContent: hslaGreys.grey5,
129
132
  highlight: {
130
133
  h: hslaBaseColors.blurpleLight.h,
@@ -7,8 +7,9 @@ const buildGlobalStylesheet = (rootElement = ':root', bodyElement = 'body') => {
7
7
  return `
8
8
  ${rootElement} {
9
9
  font-size: 100%;
10
- --lns-radius-thread-full: var(--lns-radius-medium);
11
10
  --lns-radius-thread-large: var(--lns-radius-medium);
11
+ --lns-radius-thread-xlarge: var(--lns-radius-medium);
12
+ --lns-radius-thread-full: var(--lns-radius-medium);
12
13
  }
13
14
  ${bodyElement} {
14
15
  font-family: circular, -apple-system, BlinkMacSystemFont, Segoe UI,
@@ -59,7 +59,15 @@ const Container = (_a) => {
59
59
  return (React.createElement(ContainerWrapper, Object.assign({ backgroundColor: backgroundColor, contentColor: contentColor, borderColor: borderColor, radius: radius, borderSide: borderSide, shadow: shadow, padding: padding, paddingLeft: paddingX || paddingLeft, paddingRight: paddingX || paddingRight, paddingTop: paddingY || paddingTop, paddingBottom: paddingY || paddingBottom, margin: margin, marginLeft: marginX || marginLeft, marginRight: marginX || marginRight, marginTop: marginY || marginTop, marginBottom: marginY || marginBottom, width: width, height: height, minWidth: minWidth, minHeight: minHeight, maxWidth: maxWidth, maxHeight: maxHeight, as: htmlTag, position: position, top: top, bottom: bottom, left: left, right: right, overflow: overflow, zIndex: zIndex, borderWidth: borderWidth }, props), children));
60
60
  };
61
61
  export const availableBorderSides = ['all', 'left', 'right', 'top', 'bottom'];
62
- export const availableRadii = ['medium', 'large', 'xlarge', 'full'];
62
+ export const availableRadii = [
63
+ 'medium',
64
+ 'large',
65
+ 'xlarge',
66
+ 'full',
67
+ 'thdMediumToLarge',
68
+ 'thdMediumToXlarge',
69
+ 'thdMediumToFull',
70
+ ];
63
71
  export const availableHtmlTags = [
64
72
  'div',
65
73
  'header',
@@ -137,15 +137,26 @@ const CustomHeader = ({ selectedOptionValue, selectedItem, trigger, getToggleBut
137
137
  };
138
138
  return trigger(triggerContent, buttonProps());
139
139
  };
140
+ const getSelectedOption = (value, options) => options.find(o => o.value === value);
141
+ const didSelectedOptionValueChange = (selectedOptionValue, prevSelectedItem) => {
142
+ return Boolean(prevSelectedItem && selectedOptionValue !== prevSelectedItem.value);
143
+ };
140
144
  const Select = (_a) => {
141
145
  var { container, onChange, menuZIndex = 1100, menuMaxWidth, menuMaxHeight = 34, selectedOptionValue, onOuterClick, options, placeholder, isDisabled, onOpenChange, trigger } = _a, props = __rest(_a, ["container", "onChange", "menuZIndex", "menuMaxWidth", "menuMaxHeight", "selectedOptionValue", "onOuterClick", "options", "placeholder", "isDisabled", "onOpenChange", "trigger"]);
142
146
  const environment = getDownshiftEnvironment(container);
143
147
  const [downshiftIsOpen, setDownshiftIsOpen] = useState(false);
148
+ const [prevSelectedItem, setPrevSelectedItem] = useState(getSelectedOption(selectedOptionValue, options));
149
+ const [selectedItem, setSelectedItem] = useState(prevSelectedItem);
150
+ const onDownshiftChange = item => {
151
+ setSelectedItem(item);
152
+ onChange && onChange(item ? item : '');
153
+ };
144
154
  const downshiftProps = {
145
155
  itemToString: item => (item ? item.value : ''),
146
- onChange: onChange && (item => onChange(item ? item : '')),
156
+ onChange: onDownshiftChange,
147
157
  onOuterClick,
148
158
  environment,
159
+ selectedItem,
149
160
  };
150
161
  if (environment) {
151
162
  downshiftProps.environment = environment;
@@ -158,6 +169,13 @@ const Select = (_a) => {
158
169
  auto: true,
159
170
  snap: true,
160
171
  });
172
+ useEffect(() => {
173
+ if (didSelectedOptionValueChange(selectedOptionValue, prevSelectedItem)) {
174
+ const selectedItem = getSelectedOption(selectedOptionValue, options);
175
+ setPrevSelectedItem(selectedItem);
176
+ setSelectedItem(selectedItem);
177
+ }
178
+ }, [selectedOptionValue, options, prevSelectedItem]);
161
179
  useEffect(() => {
162
180
  onOpenChange && onOpenChange(downshiftIsOpen);
163
181
  }, [downshiftIsOpen, onOpenChange]);
@@ -60,7 +60,7 @@ export const formFieldVariables = getCssVarsFromObject(undefined, {
60
60
  formFieldBorderWidth: '1px',
61
61
  formFieldBorderWidthFocus: '2px',
62
62
  formFieldHeight: u(4.5),
63
- formFieldRadius: 'var(--lns-radius-thread-full)',
63
+ formFieldRadius: 'var(--lns-radius-thread-xlarge)',
64
64
  formFieldHorizontalPadding: u(1.5),
65
65
  formFieldBorderShadow: `
66
66
  inset 0 0 0 var(--lns-formFieldBorderWidth) var(--lns-color-formFieldBorder)
@@ -50,6 +50,9 @@ export namespace radii {
50
50
  const xlarge_1: string;
51
51
  export { xlarge_1 as xlarge };
52
52
  export const full: string;
53
+ export const thdMediumToLarge: string;
54
+ export const thdMediumToXlarge: string;
55
+ export const thdMediumToFull: string;
53
56
  }
54
57
  export namespace shadows {
55
58
  const small_1: string;
package/dist/variables.js CHANGED
@@ -35,8 +35,11 @@ export const fontWeights = {
35
35
  export const radii = {
36
36
  medium: u(1),
37
37
  large: u(2),
38
- xlarge: u(4),
38
+ xlarge: u(3),
39
39
  full: u(999),
40
+ thdMediumToLarge: 'var(--lns-radius-thread-large)',
41
+ thdMediumToXlarge: 'var(--lns-radius-thread-xlarge)',
42
+ thdMediumToFull: 'var(--lns-radius-thread-full)',
40
43
  };
41
44
  export const shadows = {
42
45
  small: `0 ${u(0.5)} ${u(1.25)} hsla(0, 0%, 0%, 0.05)`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomhq/lens",
3
- "version": "10.42.0",
3
+ "version": "10.43.7",
4
4
  "scripts": {
5
5
  "dev": "next",
6
6
  "build:next": "next build",
@@ -50,6 +50,7 @@
50
50
  "@mdx-js/loader": "^2.0.0",
51
51
  "@mdx-js/react": "^2.0.0",
52
52
  "@next/mdx": "^12.1.0",
53
+ "@types/node": "^18.7.2",
53
54
  "@types/react": "^17.0.3",
54
55
  "@typescript-eslint/eslint-plugin": "^4.22.0",
55
56
  "@typescript-eslint/parser": "^4.22.0",
@@ -76,7 +77,7 @@
76
77
  "react-dom": "^17.0.2",
77
78
  "react-live": "^2.4.1",
78
79
  "react-typeform-embed": "^0.2.1",
79
- "semantic-release": "^17.0.1",
80
+ "semantic-release": "^19.0.3",
80
81
  "tinycolor2": "^1.4.1",
81
82
  "typeface-inter": "^3.11.2",
82
83
  "typescript": "^4.2.3"