@ludo.ninja/components 2.1.83 → 2.1.85

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,5 +1,5 @@
1
1
  import { identitySchema as schema } from '@ludo.ninja/api';
2
- export interface IUser extends Pick<schema.IIdentity, 'userId' | 'wallets' | 'newUser' | 'inviteCode' | 'role'> {
2
+ export interface IUser extends Pick<schema.IIdentity, 'userId' | 'wallets' | 'newUser' | 'inviteCode' | 'role' | 'reftypeColor' | 'reftypeName'> {
3
3
  authToken: string;
4
4
  refreshToken: string;
5
5
  }
@@ -0,0 +1,10 @@
1
+ import { identitySchema as schema } from '@ludo.ninja/api';
2
+ import { CSSProperties } from "react";
3
+ type BadgeProps = {
4
+ color?: schema.IReftypeColor | null;
5
+ title?: string | null;
6
+ className?: string;
7
+ style?: CSSProperties;
8
+ };
9
+ declare const Badge: ({ color, title, className, style }: BadgeProps) => import("react/jsx-runtime").JSX.Element | null;
10
+ export default Badge;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ const api_1 = require("@ludo.ninja/api");
5
+ const Badge = ({ color, title = '', className, style }) => {
6
+ const COLOR_MAP = {
7
+ [api_1.identitySchema.IReftypeColor.Green]: '#5FD068',
8
+ [api_1.identitySchema.IReftypeColor.Blue]: '#43A5FF',
9
+ [api_1.identitySchema.IReftypeColor.Purple]: '#A533FF',
10
+ };
11
+ if (!color || !COLOR_MAP[color])
12
+ return null;
13
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, style: style, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("title", { children: title }), (0, jsx_runtime_1.jsx)("circle", { cx: "10", cy: "10", r: "10", fill: "url(#paint0_radial_16741_41169)" }), (0, jsx_runtime_1.jsx)("g", { filter: "url(#filter0_d_16741_41169)", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.55904 10C5.94956 9.60952 6.58272 9.60952 6.97325 10L8.82167 11.7641L13.5858 7C13.9763 6.60947 14.6095 6.60948 15 7C15.3905 7.39052 15.3905 8.02369 15 8.41421L9.52877 13.8854C9.13825 14.276 8.50508 14.276 8.11456 13.8854L5.55904 11.4143C5.16851 11.0237 5.16851 10.3906 5.55904 10Z", fill: "white" }) }), (0, jsx_runtime_1.jsxs)("defs", { children: [(0, jsx_runtime_1.jsxs)("filter", { id: "filter0_d_16741_41169", x: "1.26614", y: "2.70715", width: "18.0267", height: "15.4712", filterUnits: "userSpaceOnUse", colorInterpolationFilters: "sRGB", children: [(0, jsx_runtime_1.jsx)("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), (0, jsx_runtime_1.jsx)("feColorMatrix", { in: "SourceAlpha", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0", result: "hardAlpha" }), (0, jsx_runtime_1.jsx)("feOffset", {}), (0, jsx_runtime_1.jsx)("feGaussianBlur", { stdDeviation: "2" }), (0, jsx_runtime_1.jsx)("feComposite", { in2: "hardAlpha", operator: "out" }), (0, jsx_runtime_1.jsx)("feColorMatrix", { type: "matrix", values: "0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0" }), (0, jsx_runtime_1.jsx)("feBlend", { mode: "normal", in2: "BackgroundImageFix", result: "effect1_dropShadow_16741_41169" }), (0, jsx_runtime_1.jsx)("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_dropShadow_16741_41169", result: "shape" })] }), (0, jsx_runtime_1.jsxs)("radialGradient", { id: "paint0_radial_16741_41169", cx: "0", cy: "0", r: "1", gradientUnits: "userSpaceOnUse", gradientTransform: "translate(10 10) rotate(90) scale(10)", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0.748", stopColor: COLOR_MAP[color] }), (0, jsx_runtime_1.jsx)("stop", { offset: "1", stopColor: COLOR_MAP[color], stopOpacity: "0" })] })] })] }));
14
+ };
15
+ exports.default = Badge;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.1.83",
3
+ "version": "2.1.85",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",