@hexure/ui 1.6.2 → 1.6.3

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.
@@ -31,6 +31,10 @@ export declare const Colors: {
31
31
  Hex: string;
32
32
  Rgb: string;
33
33
  };
34
+ SUBTLE_GRAY: {
35
+ Hex: string;
36
+ Rgb: string;
37
+ };
34
38
  };
35
39
  export declare const FontStyles: {
36
40
  DEFAULT: string;
@@ -1,10 +1,11 @@
1
- import { FC } from 'react';
1
+ import React, { FC } from 'react';
2
2
  import { AccessibleProps } from '../../utils/Accessibility';
3
3
  export interface TagProps extends AccessibleProps {
4
4
  /** It is used to select tag-type either default or removable. */
5
- color?: 'PRIMARY' | 'GREEN' | 'RED' | 'YELLOW' | 'BLACK';
5
+ color?: 'PRIMARY' | 'GREEN' | 'RED' | 'YELLOW' | 'BLACK' | 'SUBTLE_GRAY';
6
6
  /** It is used to give label to tag. */
7
- children: string | number;
7
+ children: string | React.ReactNode;
8
+ /** Method to run when the tag is clicked */
8
9
  onClick?: (e?: any) => void;
9
10
  /** It is callback function called when user wants to close the tag. */
10
11
  removable?: boolean;
package/dist/esm/index.js CHANGED
@@ -2024,6 +2024,10 @@ var Colors = {
2024
2024
  Hex: '#E7E6E6',
2025
2025
  Rgb: '231, 230, 230',
2026
2026
  },
2027
+ SUBTLE_GRAY: {
2028
+ Hex: '#f5f5f5',
2029
+ Rgb: '245, 245, 245',
2030
+ },
2027
2031
  };
2028
2032
  var FontStyles = {
2029
2033
  DEFAULT: '"Roboto", Helvetica, Arial, sans-serif',
@@ -3150,15 +3154,15 @@ var templateObject_1$3, templateObject_2$3, templateObject_3$2;
3150
3154
 
3151
3155
  var Wrapper$1 = styled.div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n display: inline-block;\n border-radius: 4px;\n padding: 4px 6px;\n background: ", ";\n color: #ffffff;\n box-sizing: border-box;\n cursor: ", ";\n"], ["\n display: inline-block;\n border-radius: 4px;\n padding: 4px 6px;\n background: ", ";\n color: #ffffff;\n box-sizing: border-box;\n cursor: ", ";\n"])), function (props) { return Colors[props.$color].Hex; }, function (props) { return (props.$removable ? 'pointer' : 'default'); });
3152
3156
  var Content = styled.div(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
3153
- var Label = styled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n color: #ffffff;\n font-size: ", ";\n font-weight: 500;\n font-family: ", ";\n line-height: 1.2em;\n"], ["\n color: #ffffff;\n font-size: ", ";\n font-weight: 500;\n font-family: ", ";\n line-height: 1.2em;\n"])), FontSizes.SMALL, FontStyles.DEFAULT);
3157
+ var Label = styled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n color: ", ";\n font-size: ", ";\n font-weight: 500;\n font-family: ", ";\n line-height: 1.2em;\n"], ["\n color: ", ";\n font-size: ", ";\n font-weight: 500;\n font-family: ", ";\n line-height: 1.2em;\n"])), function (props) { return (props.$color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff'); }, FontSizes.SMALL, FontStyles.DEFAULT);
3154
3158
  var Remove = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-left: 10px;\n display: flex;\n align-items: center;\n"], ["\n margin-left: 10px;\n display: flex;\n align-items: center;\n"])));
3155
3159
  var Tag = function (_a) {
3156
3160
  var children = _a.children, _b = _a.color, color = _b === void 0 ? 'PRIMARY' : _b, removable = _a.removable, onClick = _a.onClick, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick"]);
3157
3161
  return (React.createElement(Wrapper$1, __assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps),
3158
3162
  React.createElement(Content, null,
3159
- React.createElement(Label, null, children),
3163
+ React.createElement(Label, { "$color": color }, children),
3160
3164
  removable ? (React.createElement(Remove, null,
3161
- React.createElement(Icon, { color: '#ffffff', path: mdiClose, size: '15px' }))) : null)));
3165
+ React.createElement(Icon, { color: color === 'SUBTLE_GRAY' ? '#000000' : '#ffffff', path: mdiClose, size: '15px' }))) : null)));
3162
3166
  };
3163
3167
  var templateObject_1$2, templateObject_2$2, templateObject_3$1, templateObject_4;
3164
3168