@hexure/ui 1.13.23 → 1.13.25
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 +16 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/AppMenu/AppMenu.d.ts +1 -0
- package/dist/cjs/types/components/Button/Button.d.ts +2 -0
- package/dist/cjs/types/components/Input/Input.d.ts +1 -0
- package/dist/esm/index.js +16 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/AppMenu/AppMenu.d.ts +1 -0
- package/dist/esm/types/components/Button/Button.d.ts +2 -0
- package/dist/esm/types/components/Input/Input.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -261,7 +261,7 @@ const Badge$1 = styled.span `
|
|
|
261
261
|
margin-right: ${props => (props.$small ? '-5px' : '-10px')};
|
|
262
262
|
`;
|
|
263
263
|
const Button = (_a) => {
|
|
264
|
-
var { badge, children, disabled = false, icon, isForm = false, loading = false, margin = '', onClick, small = false, format = 'primary', toolTip } = _a, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format", "toolTip"]);
|
|
264
|
+
var { badge, children, disabled = false, icon, isForm = false, loading = false, margin = '', onClick, small = false, format = 'primary', toolTip, title = '' } = _a, accessibleProps = __rest(_a, ["badge", "children", "disabled", "icon", "isForm", "loading", "margin", "onClick", "small", "format", "toolTip", "title"]);
|
|
265
265
|
const theme = React.useContext(styled.ThemeContext) || EditableTheme;
|
|
266
266
|
const has_children = children && children.length > 0;
|
|
267
267
|
const button_type_mapping = {
|
|
@@ -295,7 +295,7 @@ const Button = (_a) => {
|
|
|
295
295
|
},
|
|
296
296
|
};
|
|
297
297
|
const format_styles = button_type_mapping[format];
|
|
298
|
-
const button_view = (React.createElement(StyledButton, Object.assign({ "$bg_color": format_styles.background_color, "$border_color": format_styles.border_color, "$disabled": disabled || loading, "$hasChildren": !!has_children, "$margin": margin, "$small": small, onClick: disabled || loading ? undefined : onClick, type: isForm ? 'submit' : undefined }, accessibleProps),
|
|
298
|
+
const button_view = (React.createElement(StyledButton, Object.assign({ "$bg_color": format_styles.background_color, "$border_color": format_styles.border_color, "$disabled": disabled || loading, "$hasChildren": !!has_children, "$margin": margin, "$small": small, onClick: disabled || loading ? undefined : onClick, title: title, type: isForm ? 'submit' : undefined }, accessibleProps),
|
|
299
299
|
children ? (React.createElement(Label$5, { "$content_color": format_styles.content_color, "$small": small }, children)) : null,
|
|
300
300
|
icon && !badge ? (React.createElement(StyledIcon$5, { "$hasChildren": !!has_children },
|
|
301
301
|
React.createElement(Icon, { color: format ? format_styles.content_color : '#fff', path: loading ? js.mdiLoading : icon, size: small ? '20px' : '24px', spin: loading }))) : null,
|
|
@@ -554,9 +554,12 @@ const SidebarContainer = styled.div `
|
|
|
554
554
|
padding: 12px 0px;
|
|
555
555
|
width: ${props => (props.$isOpen ? props.$width : '60px')};
|
|
556
556
|
`;
|
|
557
|
-
const MenuWrapper$1 = styled.
|
|
557
|
+
const MenuWrapper$1 = styled.button `
|
|
558
558
|
display: flex;
|
|
559
559
|
align-items: center;
|
|
560
|
+
border: 0px;
|
|
561
|
+
background-color: transparent;
|
|
562
|
+
padding-left: 0px;
|
|
560
563
|
border-left-width: 4px;
|
|
561
564
|
border-left-style: solid;
|
|
562
565
|
border-left-color: ${props => (props.$active ? props.$color.Hex : 'transparent')};
|
|
@@ -636,7 +639,7 @@ const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px' }) => {
|
|
|
636
639
|
return (React.createElement(SidebarContainer, { "$isOpen": !collapsed, "$width": defaultWidth },
|
|
637
640
|
React.createElement(SidebarMenuContainer, null, menu.map(nav_item => {
|
|
638
641
|
return (React.createElement(React.Fragment, { key: nav_item.label },
|
|
639
|
-
React.createElement(MenuWrapper$1, { "$active": !!nav_item.is_active, "$color": theme.PRIMARY_COLOR, onClick: nav_item.onClick },
|
|
642
|
+
React.createElement(MenuWrapper$1, { "$active": !!nav_item.is_active, "$color": theme.PRIMARY_COLOR, onClick: nav_item.onClick, title: collapsed ? (nav_item === null || nav_item === void 0 ? void 0 : nav_item.title) || nav_item.label : '' },
|
|
640
643
|
React.createElement(MenuIcon, { "$active": !!nav_item.is_active, path: nav_item.icon }),
|
|
641
644
|
collapsed ? null : (React.createElement(MenuLabel, { "$active": nav_item.is_active, "$color": theme.PRIMARY_COLOR }, nav_item.label))),
|
|
642
645
|
nav_item.is_active && nav_item.menu && !collapsed ? (React.createElement(SubMenu, null, nav_item.menu.map(menu_item => (React.createElement(SubMenuItem, { "$active": menu_item.is_active, "$color": theme.PRIMARY_COLOR, key: menu_item.label, onClick: menu_item.onClick }, menu_item.label))))) : null));
|
|
@@ -1651,7 +1654,9 @@ const StyledInput = styled.input `
|
|
|
1651
1654
|
font-weight: 400;
|
|
1652
1655
|
font-family: ${FontStyles.DEFAULT};
|
|
1653
1656
|
line-height: 1.28em;
|
|
1654
|
-
color: ${props =>
|
|
1657
|
+
color: ${props => props.$showErrorTextColor && props.$invalid && !props.$readOnly
|
|
1658
|
+
? Colors.RED.Hex
|
|
1659
|
+
: Colors.BLACK.Hex};
|
|
1655
1660
|
position: relative;
|
|
1656
1661
|
height: ${props => props.$height || 'auto'};
|
|
1657
1662
|
padding: 10px;
|
|
@@ -1674,7 +1679,9 @@ const StyledTextArea = styled.textarea `
|
|
|
1674
1679
|
height: ${props => props.$height || 'auto'};
|
|
1675
1680
|
font-family: 'Roboto', Helvetica, Arial, sans-serif;
|
|
1676
1681
|
line-height: 1.28em;
|
|
1677
|
-
color: ${
|
|
1682
|
+
color: ${props => props.$showErrorTextColor && props.$invalid && !props.$readOnly
|
|
1683
|
+
? Colors.RED.Hex
|
|
1684
|
+
: Colors.BLACK.Hex};
|
|
1678
1685
|
position: relative;
|
|
1679
1686
|
padding: 10px;
|
|
1680
1687
|
opacity: 1;
|
|
@@ -1785,7 +1792,7 @@ const Loader$1 = styled.div `
|
|
|
1785
1792
|
const Input$1 = (_a) => {
|
|
1786
1793
|
var { format, suffix, height, invalid, loading, max, maxLength, min, onBlur, onChange, onFocus, onKeyDown,
|
|
1787
1794
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1788
|
-
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, type = 'text', value = '' } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "type", "value"]);
|
|
1795
|
+
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '' } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value"]);
|
|
1789
1796
|
const [show_options, setShowOptions] = React.useState(false);
|
|
1790
1797
|
const [internalValue, setInternalValue] = React.useState(value);
|
|
1791
1798
|
const [internalSuggestedValues, setInternalSuggestedValues] = React.useState(suggestedValues || []);
|
|
@@ -1852,7 +1859,7 @@ const Input$1 = (_a) => {
|
|
|
1852
1859
|
formatted_value = formatAsSsn(internalValue);
|
|
1853
1860
|
}
|
|
1854
1861
|
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length },
|
|
1855
|
-
React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, maxLength: maxLength, onBlur: readOnly
|
|
1862
|
+
React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, maxLength: maxLength, onBlur: readOnly
|
|
1856
1863
|
? e => e.preventDefault()
|
|
1857
1864
|
: e => {
|
|
1858
1865
|
if (onBlur)
|
|
@@ -1872,7 +1879,7 @@ const Input$1 = (_a) => {
|
|
|
1872
1879
|
showCharCount ? (React.createElement(CharacterCount, null,
|
|
1873
1880
|
internalValue.length,
|
|
1874
1881
|
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length },
|
|
1875
|
-
React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, max: max, maxLength: maxLength, min: min, onBlur: readOnly
|
|
1882
|
+
React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, max: max, maxLength: maxLength, min: min, onBlur: readOnly
|
|
1876
1883
|
? e => e.preventDefault()
|
|
1877
1884
|
: e => {
|
|
1878
1885
|
if (onBlur)
|