@mackin.com/styleguide 8.2.1 → 8.2.2
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/index.d.ts +7 -1
- package/index.js +53 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1049,4 +1049,10 @@ interface LinkProps extends LinkContentProps, React.DetailedHTMLProps<React.Anch
|
|
|
1049
1049
|
}
|
|
1050
1050
|
declare const Link: (props: LinkProps) => JSX.Element;
|
|
1051
1051
|
|
|
1052
|
-
|
|
1052
|
+
interface ThemeRendererProps extends MackinTheme {
|
|
1053
|
+
backgroundColor?: string;
|
|
1054
|
+
color?: string;
|
|
1055
|
+
}
|
|
1056
|
+
declare const ThemeRenderer: (p: ThemeRendererProps) => JSX.Element;
|
|
1057
|
+
|
|
1058
|
+
export { Accordian, AccordianProps, Alignment, Autocomplete, AutocompleteProps, AutocompleteValue, Backdrop$1 as Backdrop, Backdrop as Backdrop2, BoundMemoryPager, BoundStaticPager, Button, ButtonProps, Calendar, CalendarProps, Checkbox, CheckboxProps, ConfirmModal, ConfirmModalProps, CopyButton, DateInput, DateInputProps, Divider, ErrorModal, FileUploader, Form, FormColumnRow, FormFlexRow, FormProps, GlobalStyles, Header, Highlight, ICONS, Icon, Image, ImageProps, InfoPanel, InfoTip, InfoTipProps, Input, InputProps, ItemPager, Label, LabelProps, Link, LinkProps, List, ListItem, ListItemProps, ListProps, MackinTheme, Modal, Nav, NormalizeCss, NumberInput, NumberInputProps, OmniLink, OmniLinkProps, PagedResult, Pager, PagerProps, Picker, PickerOption, PickerProps, PickerValue, Popover, ProgressBar, ProgressBarProps, SearchBox, SearchBoxProps, Slider, TabHeader, TabHeaderProps, TabLocker, Table, Td, TdCurrency, TdNumber, Text, TextArea, TextAreaProps, TextInput, TextInputProps, TextProps, Th, ThSort, ThemeProvider, ThemeRenderer, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
|
package/index.js
CHANGED
|
@@ -4430,7 +4430,7 @@ select,
|
|
|
4430
4430
|
textarea {
|
|
4431
4431
|
font-family: inherit; /* 1 */
|
|
4432
4432
|
font-size: 100%; /* 1 */
|
|
4433
|
-
line-height: 1
|
|
4433
|
+
/* line-height: 1.15; This causes issues with Chrome buttons. */
|
|
4434
4434
|
margin: 0; /* 2 */
|
|
4435
4435
|
}
|
|
4436
4436
|
|
|
@@ -4612,6 +4612,57 @@ const Link = (props) => {
|
|
|
4612
4612
|
React__namespace.createElement(LinkContent, Object.assign({}, props))));
|
|
4613
4613
|
};
|
|
4614
4614
|
|
|
4615
|
+
const ThemeRenderer = (p) => {
|
|
4616
|
+
const { backgroundColor, color } = p, theme = __rest(p, ["backgroundColor", "color"]);
|
|
4617
|
+
return (React__namespace.createElement(Table, { caption: (React__namespace.createElement("div", null,
|
|
4618
|
+
React__namespace.createElement(Text, { tag: "h1", align: "center" }, "Theme"),
|
|
4619
|
+
React__namespace.createElement(Text, { tag: "p", align: "center", italics: true }, "Background color applied to show colors with alpha ('rgba(X, X, X, 0.X)')"))), className: css.css({
|
|
4620
|
+
backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : '#eee7ca',
|
|
4621
|
+
color: color !== null && color !== void 0 ? color : 'black'
|
|
4622
|
+
}) },
|
|
4623
|
+
React__namespace.createElement("thead", null,
|
|
4624
|
+
React__namespace.createElement(Tr, null,
|
|
4625
|
+
React__namespace.createElement(Th, { align: "left" }, "Property"),
|
|
4626
|
+
React__namespace.createElement(Th, { align: "left" }, "Value"))),
|
|
4627
|
+
React__namespace.createElement("tbody", null, Object.entries(flatten(theme)).map(([key, value]) => {
|
|
4628
|
+
let colorBox;
|
|
4629
|
+
if (/color/i.test(key)) {
|
|
4630
|
+
colorBox = (React__namespace.createElement("span", { className: css.css({
|
|
4631
|
+
display: 'inline-block',
|
|
4632
|
+
border: '1px solid black',
|
|
4633
|
+
width: 24,
|
|
4634
|
+
height: 24,
|
|
4635
|
+
backgroundColor: value
|
|
4636
|
+
}) }));
|
|
4637
|
+
}
|
|
4638
|
+
return (React__namespace.createElement(Tr, { key: key },
|
|
4639
|
+
React__namespace.createElement(Td, { align: "left" }, key),
|
|
4640
|
+
React__namespace.createElement(Td, { align: "left" },
|
|
4641
|
+
React__namespace.createElement("div", { className: css.css({
|
|
4642
|
+
display: 'flex',
|
|
4643
|
+
alignItems: 'center',
|
|
4644
|
+
gap: '1rem'
|
|
4645
|
+
}) },
|
|
4646
|
+
value,
|
|
4647
|
+
" ",
|
|
4648
|
+
colorBox))));
|
|
4649
|
+
}))));
|
|
4650
|
+
};
|
|
4651
|
+
const flatten = (obj, parent, path = 'theme') => {
|
|
4652
|
+
const flatObj = parent !== null && parent !== void 0 ? parent : {};
|
|
4653
|
+
for (const prop in obj) {
|
|
4654
|
+
const value = obj[prop];
|
|
4655
|
+
const fullPath = `${path}.${prop}`;
|
|
4656
|
+
if (typeof value !== 'object') {
|
|
4657
|
+
flatObj[fullPath] = value;
|
|
4658
|
+
}
|
|
4659
|
+
else {
|
|
4660
|
+
flatten(value, flatObj, fullPath);
|
|
4661
|
+
}
|
|
4662
|
+
}
|
|
4663
|
+
return flatObj;
|
|
4664
|
+
};
|
|
4665
|
+
|
|
4615
4666
|
exports.Accordian = Accordian;
|
|
4616
4667
|
exports.Autocomplete = Autocomplete;
|
|
4617
4668
|
exports.Backdrop = Backdrop$1;
|
|
@@ -4668,6 +4719,7 @@ exports.TextInput = TextInput;
|
|
|
4668
4719
|
exports.Th = Th;
|
|
4669
4720
|
exports.ThSort = ThSort;
|
|
4670
4721
|
exports.ThemeProvider = ThemeProvider;
|
|
4722
|
+
exports.ThemeRenderer = ThemeRenderer;
|
|
4671
4723
|
exports.ToggleButton = ToggleButton;
|
|
4672
4724
|
exports.ToggleButtonGroup = ToggleButtonGroup;
|
|
4673
4725
|
exports.TogglePasswordInput = TogglePasswordInput;
|