reshaped 2.6.0 → 2.6.2

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 +1 @@
1
- .root{display:inline;text-underline-offset:calc(var(--rs-unit-x1) / 2)}.root.--color-primary{color:var(--rs-color-foreground-primary)}.root.--color-critical{color:var(--rs-color-foreground-critical)}.root.--color-positive{color:var(--rs-color-foreground-positive)}.root.--color-inherit{color:currentcolor}.root.--variant-plain{opacity:1;transition:opacity var(--rs-duration-fast) var(--rs-easing-standard)}.root.--variant-plain:hover:not(.--disabled){opacity:.6}.root.--variant-underline{text-decoration:underline;text-decoration-color:currentcolor;transition:text-decoration-color var(--rs-duration-fast) var(--rs-easing-standard)}.root.--variant-underline:hover:not(.--disabled){text-decoration-color:transparent}.root.--disabled{color:var(--rs-color-foreground-disabled);opacity:1;text-decoration:none}.root.--with-icon{align-items:center;display:inline-flex;gap:calc(1em / 3.5)}
1
+ .root{display:inline;text-underline-offset:calc(var(--rs-unit-x1) / 2)}.root.--color-primary{color:var(--rs-color-foreground-primary)}.root.--color-critical{color:var(--rs-color-foreground-critical)}.root.--color-positive{color:var(--rs-color-foreground-positive)}.root.--color-inherit{color:inherit}.root.--variant-plain{opacity:1;transition:opacity var(--rs-duration-fast) var(--rs-easing-standard)}.root.--variant-plain:hover:not(.--disabled){opacity:.6}.root.--variant-underline{text-decoration:underline;text-decoration-color:currentcolor;transition:text-decoration-color var(--rs-duration-fast) var(--rs-easing-standard)}.root.--variant-underline:hover:not(.--disabled){text-decoration-color:transparent}.root.--disabled{color:var(--rs-color-foreground-disabled);opacity:1;text-decoration:none}.root.--with-icon{align-items:center;display:inline-flex;gap:calc(1em / 3.5)}
@@ -7,7 +7,7 @@ import Theme from "../Theme/index.js";
7
7
  import Text from "../Text/index.js";
8
8
  import s from "./Toast.module.css";
9
9
  const Toast = (props) => {
10
- const { size = "small", text, children, color = "inverted", icon, title, actionsSlot, startSlot, collapsed, attributes, } = props;
10
+ const { size = "small", text, children, color = "inverted", icon, title, actionsSlot, startSlot, collapsed, className, attributes, } = props;
11
11
  let backgroundColor = color === "inverted" || color === "neutral" ? "elevation-overlay" : color;
12
12
  if (color === "neutral")
13
13
  backgroundColor = collapsed ? "neutral" : "elevation-overlay";
@@ -23,7 +23,7 @@ const Toast = (props) => {
23
23
  title,
24
24
  " ")),
25
25
  React.createElement(Text, { variant: "body-3", as: textTagName }, text)));
26
- const toastNode = (React.createElement(View, { backgroundColor: backgroundColor, borderColor: borderColor, padding: 4, borderRadius: "medium", animated: true, direction: "row", gap: 3, align: isLarge ? "start" : "center", className: s.toast, attributes: attributes },
26
+ const toastNode = (React.createElement(View, { backgroundColor: backgroundColor, borderColor: borderColor, padding: 4, borderRadius: "medium", animated: true, direction: "row", gap: 3, align: isLarge ? "start" : "center", className: [s.toast, className], attributes: attributes },
27
27
  icon && React.createElement(Icon, { size: 5, svg: icon, className: s.icon }),
28
28
  startSlot && !icon && React.createElement(View.Item, null, startSlot),
29
29
  React.createElement(View.Item, { grow: true },
@@ -14,6 +14,7 @@ export type Props = {
14
14
  children?: React.ReactNode;
15
15
  actionsSlot?: React.ReactNode;
16
16
  color?: "neutral" | "primary" | "critical" | "positive" | "inverted";
17
+ className?: G.ClassName;
17
18
  attributes?: G.Attributes<"div", Props>;
18
19
  };
19
20
  export type ProviderProps = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reshaped",
3
3
  "description": "Professionally crafted design system in React & Figma for building products of any scale and complexity",
4
- "version": "2.6.0",
4
+ "version": "2.6.2",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "email": "hello@reshaped.so",
7
7
  "homepage": "https://reshaped.so",
@@ -34,6 +34,18 @@ const getOnColor = (args) => {
34
34
  g: (1 - bgColor.a) * baseColor.g + bgColor.a * bgColor.g,
35
35
  b: (1 - bgColor.a) * baseColor.b + bgColor.a * bgColor.b,
36
36
  };
37
- return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? darkHexColor : lightHexColor;
37
+ const lrgb = [];
38
+ [r, g, b].forEach(function (c) {
39
+ c = c / 255;
40
+ if (c <= 0.03928) {
41
+ c = c / 12.92;
42
+ }
43
+ else {
44
+ c = Math.pow((c + 0.055) / 1.055, 2.4);
45
+ }
46
+ lrgb.push(c);
47
+ });
48
+ const lum = 0.2126 * lrgb[0] + 0.7152 * lrgb[1] + 0.0722 * lrgb[2];
49
+ return lum > 0.179 ? darkHexColor : lightHexColor;
38
50
  };
39
51
  exports.getOnColor = getOnColor;