@hexure/ui 1.6.1 → 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.
- package/dist/cjs/index.js +10 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/Theme.d.ts +4 -0
- package/dist/cjs/types/components/Tag/Tag.d.ts +4 -3
- package/dist/esm/index.js +10 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/Theme.d.ts +4 -0
- package/dist/esm/types/components/Tag/Tag.d.ts +4 -3
- package/dist/index.d.ts +3 -2
- package/package.json +1 -1
|
@@ -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 |
|
|
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',
|
|
@@ -2604,7 +2608,7 @@ var Wrapper$b = styled.div(templateObject_1$g || (templateObject_1$g = __makeTem
|
|
|
2604
2608
|
return ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0;
|
|
2605
2609
|
});
|
|
2606
2610
|
var Trigger$1 = styled.select(templateObject_2$e || (templateObject_2$e = __makeTemplateObject(["\n appearance: none;\n box-shadow: none;\n outline: none;\n border: none;\n color: ", ";\n font-size: ", ";\n font-weight: 400;\n font-family: ", ";\n line-height: 2.9em;\n background-color: transparent;\n background-image: none;\n cursor: pointer;\n width: 100%;\n box-sizing: border-box;\n padding: 0px 30px 0px 10px;\n box-sizing: border-box;\n position: relative;\n z-index: 2;\n"], ["\n appearance: none;\n box-shadow: none;\n outline: none;\n border: none;\n color: ", ";\n font-size: ", ";\n font-weight: 400;\n font-family: ", ";\n line-height: 2.9em;\n background-color: transparent;\n background-image: none;\n cursor: pointer;\n width: 100%;\n box-sizing: border-box;\n padding: 0px 30px 0px 10px;\n box-sizing: border-box;\n position: relative;\n z-index: 2;\n"])), Colors.BLACK.Hex, FontSizes.DEFAULT, FontStyles.DEFAULT);
|
|
2607
|
-
var IconWrapper$2 = styled
|
|
2611
|
+
var IconWrapper$2 = styled(Icon)(templateObject_3$c || (templateObject_3$c = __makeTemplateObject(["\n position: absolute;\n right: 9px;\n z-index: 1;\n"], ["\n position: absolute;\n right: 9px;\n z-index: 1;\n"])));
|
|
2608
2612
|
var Select = function (_a) {
|
|
2609
2613
|
var options = _a.options, optionGroups = _a.optionGroups, placeholder = _a.placeholder, readOnly = _a.readOnly, invalid = _a.invalid, value = _a.value, onChange = _a.onChange, style = _a.style, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "value", "onChange", "style"]);
|
|
2610
2614
|
return (React.createElement(Wrapper$b, { "$invalid": invalid, "$readOnly": readOnly, "$style": style },
|
|
@@ -2620,8 +2624,7 @@ var Select = function (_a) {
|
|
|
2620
2624
|
options.map(function (option, i) {
|
|
2621
2625
|
return (React.createElement("option", { key: i, value: option.value }, option.label || option.value));
|
|
2622
2626
|
})),
|
|
2623
|
-
React.createElement(IconWrapper$2,
|
|
2624
|
-
React.createElement(Icon, { color: Colors.BLACK.Hex, path: mdiChevronDown, size: '22px' }))));
|
|
2627
|
+
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, path: mdiChevronDown, size: '22px' })));
|
|
2625
2628
|
};
|
|
2626
2629
|
var templateObject_1$g, templateObject_2$e, templateObject_3$c;
|
|
2627
2630
|
|
|
@@ -3041,7 +3044,7 @@ var Trigger = styled.div(templateObject_2$6 || (templateObject_2$6 = __makeTempl
|
|
|
3041
3044
|
}
|
|
3042
3045
|
}, function (props) { return (props.$readOnly ? '#f5f5f5' : '#ffffff'); });
|
|
3043
3046
|
var Value = styled.div(templateObject_3$5 || (templateObject_3$5 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n line-height: 2.9em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n"], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n line-height: 2.9em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n"])), Colors.BLACK.Hex, FontStyles.DEFAULT, FontSizes.DEFAULT);
|
|
3044
|
-
var Options = styled.div(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n background: #fff;\n border-color: ", ";\n border-radius: 0px 0px 4px 4px;\n border-style: solid;\n border-top: none;\n border-width: 1px;\n left: 0;\n position: absolute;\n right: 0;\n z-index: 10;\n max-height: 220px;\n overflow: auto;\n"], ["\n background: #fff;\n border-color: ", ";\n border-radius: 0px 0px 4px 4px;\n border-style: solid;\n border-top: none;\n border-width: 1px;\n left: 0;\n position: absolute;\n right: 0;\n z-index: 10;\n max-height: 220px;\n overflow: auto;\n"])), Colors.PRIMARY.Hex);
|
|
3047
|
+
var Options = styled.div(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n background: #fff;\n box-shadow: 0px 5px 30px -15px rgba(0, 0, 0, 0.2);\n border-color: ", ";\n border-radius: 0px 0px 4px 4px;\n border-style: solid;\n border-top: none;\n border-width: 1px;\n left: 0;\n position: absolute;\n right: 0;\n z-index: 10;\n max-height: 220px;\n overflow: auto;\n"], ["\n background: #fff;\n box-shadow: 0px 5px 30px -15px rgba(0, 0, 0, 0.2);\n border-color: ", ";\n border-radius: 0px 0px 4px 4px;\n border-style: solid;\n border-top: none;\n border-width: 1px;\n left: 0;\n position: absolute;\n right: 0;\n z-index: 10;\n max-height: 220px;\n overflow: auto;\n"])), Colors.PRIMARY.Hex);
|
|
3045
3048
|
var Scrim = styled.div(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 9;\n"], ["\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 9;\n"])));
|
|
3046
3049
|
var MultiSelect = function (_a) {
|
|
3047
3050
|
var readOnly = _a.readOnly, _b = _a.displayCount, displayCount = _b === void 0 ? 3 : _b, invalid = _a.invalid, onChange = _a.onChange, _c = _a.options, options = _c === void 0 ? [] : _c, _d = _a.selected, selected = _d === void 0 ? [] : _d, showSelectAll = _a.showSelectAll, accessibleProps = __rest(_a, ["readOnly", "displayCount", "invalid", "onChange", "options", "selected", "showSelectAll"]);
|
|
@@ -3151,15 +3154,15 @@ var templateObject_1$3, templateObject_2$3, templateObject_3$2;
|
|
|
3151
3154
|
|
|
3152
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'); });
|
|
3153
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"])));
|
|
3154
|
-
var Label = styled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n color:
|
|
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);
|
|
3155
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"])));
|
|
3156
3159
|
var Tag = function (_a) {
|
|
3157
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"]);
|
|
3158
3161
|
return (React.createElement(Wrapper$1, __assign({ "$color": color, "$removable": removable, onClick: onClick }, accessibleProps),
|
|
3159
3162
|
React.createElement(Content, null,
|
|
3160
|
-
React.createElement(Label,
|
|
3163
|
+
React.createElement(Label, { "$color": color }, children),
|
|
3161
3164
|
removable ? (React.createElement(Remove, null,
|
|
3162
|
-
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)));
|
|
3163
3166
|
};
|
|
3164
3167
|
var templateObject_1$2, templateObject_2$2, templateObject_3$1, templateObject_4;
|
|
3165
3168
|
|