oolib 2.178.5 → 2.180.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.
@@ -27,11 +27,12 @@ exports.default = {
27
27
  icon: true,
28
28
  fill: true,
29
29
  size: true,
30
- weight: true
30
+ weight: true,
31
+ badgeColor: true,
31
32
  },
32
33
  add: {
33
- variant: {
34
- name: "Variant",
34
+ colorPreset: {
35
+ name: "Color Preset",
35
36
  description: "Select an icon from the available set.",
36
37
  options: [
37
38
  "Postive",
@@ -46,7 +47,7 @@ exports.default = {
46
47
  "In Progress": "inProgress",
47
48
  "Warning": "warning",
48
49
  "Negative": "negative",
49
- "Special": "speical",
50
+ "Special": "special",
50
51
  "Default": "default"
51
52
  },
52
53
  control: { type: "select" },
@@ -21,7 +21,7 @@ var GenTag_1 = require("./utils/GenTag");
21
21
  var tagArgTypes_1 = require("./utils/tagArgTypes");
22
22
  exports.default = {
23
23
  title: "Oolib V 2.0/Components/Tags/Tag Link",
24
- argTypes: __assign({}, (0, tagArgTypes_1.commonArgTypes)({ exclude: { icon: true } })),
24
+ argTypes: __assign({}, (0, tagArgTypes_1.commonArgTypes)({ exclude: { icon: true, badgeColor: true, } })),
25
25
  args: __assign({}, (0, tagArgTypes_1.commonTagArgTypes)("Tag Link")),
26
26
  };
27
27
  var Tag_Link = function (args) {
@@ -12,6 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.commonArgTypes = exports.commonTagArgTypes = void 0;
15
+ var __1 = require("../../../../..");
15
16
  var icons_1 = require("../../../../../icons");
16
17
  var commonTagArgTypes = function (display) {
17
18
  return {
@@ -91,6 +92,16 @@ var commonArgTypes = function (_a) {
91
92
  defaultValue: { summary: "none" },
92
93
  type: { summary: "string" },
93
94
  }
95
+ },
96
+ badgeColor: {
97
+ name: "Badge Color",
98
+ description: "Select an color from the available set.",
99
+ options: __1.colors2,
100
+ control: { type: "select" },
101
+ table: {
102
+ defaultValue: { summary: "none" },
103
+ type: { summary: "string" },
104
+ }
94
105
  }
95
106
  };
96
107
  // Filter out excluded types
@@ -7,8 +7,9 @@ export interface TagInterface {
7
7
  icon?: string;
8
8
  onClick?: React.MouseEventHandler<HTMLElement>;
9
9
  weight?: "bold" | "light" | "default";
10
- variant?: "clear" | "link";
10
+ variant?: "clear" | "link" | "default";
11
11
  typo?: any;
12
12
  style?: any;
13
+ badgeColor?: string;
13
14
  }
14
- export declare const Tag: ({ id, fill, size, display, icon, weight, onClick, variant, typo, style }: TagInterface) => React.JSX.Element;
15
+ export declare const Tag: ({ id, fill, size, display, icon, weight, onClick, variant, typo, badgeColor, style }: TagInterface) => React.JSX.Element;
@@ -12,11 +12,12 @@ var styled_components_1 = require("styled-components");
12
12
  var themes_1 = require("../../../../themes");
13
13
  var grey40 = themes_1.colors.grey40;
14
14
  var Tag = function (_a) {
15
- var id = _a.id, fill = _a.fill, size = _a.size, display = _a.display, icon = _a.icon, weight = _a.weight, onClick = _a.onClick, variant = _a.variant, typo = _a.typo, style = _a.style;
15
+ var id = _a.id, _b = _a.fill, fill = _b === void 0 ? "solid" : _b, _c = _a.size, size = _c === void 0 ? "S" : _c, display = _a.display, icon = _a.icon, weight = _a.weight, onClick = _a.onClick, variant = _a.variant, typo = _a.typo, badgeColor = _a.badgeColor, style = _a.style;
16
16
  var Icon = icons_1.icons[icon];
17
17
  var theme = (0, styled_components_1.useTheme)();
18
18
  var Typo = typo || styled_2.Styled_UI_CAPTION_DF;
19
- return (react_1.default.createElement(styled_1.StyledTag, { id: id, fill: fill || "solid", size: size || "S", icon: icon, onClick: onClick, variant: variant, colors: theme === null || theme === void 0 ? void 0 : theme.colors, style: style },
19
+ return (react_1.default.createElement(styled_1.StyledTag, { id: id, fill: fill, size: size, icon: icon, onClick: onClick, variant: variant, colors: theme === null || theme === void 0 ? void 0 : theme.colors, style: style },
20
+ badgeColor && react_1.default.createElement("div", { style: { background: badgeColor, width: "1rem", height: "1rem", borderRadius: "50%", marginRight: "0.2rem" } }),
20
21
  react_1.default.createElement(Typo, { weight: weight },
21
22
  " ",
22
23
  display,
@@ -59,7 +59,7 @@ var commonTagStyles = function (_a) {
59
59
  "\n padding: 0.1rem 0.5rem;\n border-radius: 4px;\n gap: 0.1rem;\n padding-right: ".concat(icon ? "0.4rem" : "0.5rem", ";\n ")
60
60
  : size === "S" ?
61
61
  "\n padding: 0.4rem 1rem;\n border-radius: 1.2rem;\n gap: 0.2rem;\n padding-right: ".concat(icon ? "0.8rem" : "1rem", ";\n\n ")
62
- :
62
+ : // M Not in the design yet, might need in the future
63
63
  " \n padding: 0.1rem 0.5rem;\n border-radius: 4px;\n gap: 0.1rem;\n padding-right: ".concat(icon ? "0.4rem" : "0.5rem", ";\n\n "), "\n\n background-color: ").concat(fill === "solid" ? grey5 : white, ";\n outline: ").concat(fill === "outline" ? "1px solid ".concat(grey10) : "none", ";\n\n");
64
64
  };
65
65
  var variants = function (_a) {
@@ -7,5 +7,6 @@ export interface TagClearProps {
7
7
  fill?: string;
8
8
  size?: "XS" | "S";
9
9
  weight?: "bold" | "light" | "default";
10
+ badgeColor?: string;
10
11
  }
11
12
  export declare const TagClear: FunctionComponent<TagClearProps>;
@@ -7,7 +7,7 @@ exports.TagClear = void 0;
7
7
  var react_1 = __importDefault(require("react"));
8
8
  var Tag_1 = require("../Tag");
9
9
  var TagClear = function (_a) {
10
- var id = _a.id, display = _a.display, size = _a.size, onClick = _a.onClick, fill = _a.fill, weight = _a.weight;
11
- return (react_1.default.createElement(Tag_1.Tag, { id: id, display: display, icon: "X", size: size, onClick: onClick, variant: "clear", fill: fill, weight: weight }));
10
+ var id = _a.id, display = _a.display, size = _a.size, onClick = _a.onClick, fill = _a.fill, weight = _a.weight, badgeColor = _a.badgeColor;
11
+ return (react_1.default.createElement(Tag_1.Tag, { id: id, display: display, icon: "X", size: size, onClick: onClick, variant: "clear", fill: fill, weight: weight, badgeColor: badgeColor }));
12
12
  };
13
13
  exports.TagClear = TagClear;
@@ -1,5 +1,5 @@
1
- export function getTagDisplayStyles({ variant }: {
2
- variant: any;
1
+ export function getTagDisplayStyles({ colorPreset }: {
2
+ colorPreset: any;
3
3
  }): {
4
4
  backgroundColor: string;
5
5
  backdropFilter?: undefined;
@@ -4,8 +4,8 @@ exports.getTagDisplayStyles = void 0;
4
4
  var themes_1 = require("../../../../themes");
5
5
  var grey40 = themes_1.colors.grey40, green = themes_1.colors.green, yellow = themes_1.colors.yellow, blue = themes_1.colors.blue, error = themes_1.colors.error, purple = themes_1.colors.purple;
6
6
  var getTagDisplayStyles = function (_a) {
7
- var variant = _a.variant;
8
- switch (variant) {
7
+ var colorPreset = _a.colorPreset;
8
+ switch (colorPreset) {
9
9
  case "positive":
10
10
  return {
11
11
  backgroundColor: green,
@@ -9,6 +9,6 @@ export interface TagDisplayInterface extends Omit<TagInterface, 'variant'> {
9
9
  fill?: string;
10
10
  icon?: string;
11
11
  weight?: "bold" | "light" | "default";
12
- variant: 'positive' | 'inProgress' | 'warning' | 'negative' | 'special' | "default";
12
+ colorPreset: 'positive' | 'inProgress' | 'warning' | 'negative' | 'special' | "default";
13
13
  }
14
14
  export declare const TagDisplay: React.FunctionComponent<TagDisplayInterface>;
@@ -25,7 +25,7 @@ var TagDisplay = function (_a) {
25
25
  var id = _a.id, display = _a.display, size = _a.size,
26
26
  // tagColor,
27
27
  // textColor,
28
- fill = _a.fill, icon = _a.icon, _b = _a.variant, variant = _b === void 0 ? 'default' : _b, weight = _a.weight;
29
- return (react_1.default.createElement(Tag_1.Tag, { weight: weight, id: id, display: display, icon: icon, size: size, fill: fill, style: __assign({ padding: "0.25rem 0.5rem", borderRadius: "4px", color: white }, (0, getTagDisplayStyles_1.getTagDisplayStyles)({ variant: variant })), typo: Typo2_1.UI_TAG_DF }));
28
+ fill = _a.fill, icon = _a.icon, _b = _a.colorPreset, colorPreset = _b === void 0 ? 'default' : _b, weight = _a.weight;
29
+ return (react_1.default.createElement(Tag_1.Tag, { weight: weight, id: id, display: display, icon: icon, size: size, fill: fill, style: __assign({ padding: "0.25rem 0.5rem", borderRadius: "4px", color: white }, (0, getTagDisplayStyles_1.getTagDisplayStyles)({ colorPreset: colorPreset })), typo: Typo2_1.UI_TAG_DF }));
30
30
  };
31
31
  exports.TagDisplay = TagDisplay;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.178.5",
3
+ "version": "2.180.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",