@mackin.com/styleguide 8.2.0 → 8.2.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.
Files changed (3) hide show
  1. package/index.d.ts +7 -1
  2. package/index.js +57 -4
  3. 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
- 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, ToggleButton, ToggleButtonGroup, ToggleButtonGroupProps, ToggleButtonProps, TogglePasswordInput, Tr, WaitingIndicator, calcDynamicThemeProps, defaultTheme, enumToEntities, getCurrencyDisplay, getFileSizeDisplay, useAccordianState, useBooleanChanged, useIgnoreMount, useMediaQuery, useScrollbarSize, useThemeSafely, useWaiting };
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
@@ -118,7 +118,6 @@ const calcDynamicThemeProps = (theme) => {
118
118
  theme.controls.focusOutlineRequiredShadow = `0px 0px 4px 2px ${theme.colors.focusOutlineRequired}`;
119
119
  theme.controls.dividerBorder = `${theme.controls.dividerThickness} solid ${theme.colors.divider}`;
120
120
  theme.controls.inputErrorMinHeight = `calc(${theme.fonts.sizeSmall} * 1.5 + 4px)`;
121
- theme.controls.buttonBoxShadow = theme.controls.boxShadow;
122
121
  theme.mediaQueries.desktop = `@media(min-width:${theme.breakpoints.desktop})`;
123
122
  theme.mediaQueries.tablet = `@media(min-width:${theme.breakpoints.tablet})`;
124
123
  };
@@ -181,6 +180,8 @@ const defaultTheme = {
181
180
  height: '44px',
182
181
  heightSmall: '34px',
183
182
  boxShadow: '2px 2px 4px rgba(0, 0, 0, 0.25)',
183
+ headerBoxShadow: '0px 2px 12px 6px rgba(0, 0, 0, 0.2)',
184
+ buttonBoxShadow: '2px 2px 4px rgba(0, 0, 0, 0.25)',
184
185
  hoverBrightness: 'brightness(0.75)',
185
186
  transitionDuration: '0.25s',
186
187
  transitionEasing: 'ease-in-out',
@@ -194,8 +195,6 @@ const defaultTheme = {
194
195
  dividerMargin: '1rem',
195
196
  dividerBorder: '',
196
197
  dividerThickness: '2px',
197
- headerBoxShadow: '0px 2px 12px 6px rgba(0, 0, 0, 0.2)',
198
- buttonBoxShadow: '',
199
198
  inputErrorMinHeight: '',
200
199
  paragraphPadding: '1rem'
201
200
  },
@@ -4430,7 +4429,7 @@ select,
4430
4429
  textarea {
4431
4430
  font-family: inherit; /* 1 */
4432
4431
  font-size: 100%; /* 1 */
4433
- line-height: 1.15; /* 1 */
4432
+ /* line-height: 1.15; This causes issues with Chrome buttons. */
4434
4433
  margin: 0; /* 2 */
4435
4434
  }
4436
4435
 
@@ -4612,6 +4611,59 @@ const Link = (props) => {
4612
4611
  React__namespace.createElement(LinkContent, Object.assign({}, props))));
4613
4612
  };
4614
4613
 
4614
+ const ThemeRenderer = (p) => {
4615
+ const { backgroundColor, color } = p, theme = __rest(p, ["backgroundColor", "color"]);
4616
+ const flatTheme = flatten(theme);
4617
+ const entries = lodash.orderBy(Object.entries(flatTheme), x => x[0]);
4618
+ return (React__namespace.createElement(Table, { caption: (React__namespace.createElement("div", null,
4619
+ React__namespace.createElement(Text, { tag: "h1", align: "center" }, "Theme"),
4620
+ 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({
4621
+ backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : '#eee7ca',
4622
+ color: color !== null && color !== void 0 ? color : 'black'
4623
+ }) },
4624
+ React__namespace.createElement("thead", null,
4625
+ React__namespace.createElement(Tr, null,
4626
+ React__namespace.createElement(Th, { align: "left" }, "Property"),
4627
+ React__namespace.createElement(Th, { align: "left" }, "Value"))),
4628
+ React__namespace.createElement("tbody", null, entries.map(([key, value]) => {
4629
+ let colorBox;
4630
+ if (/color/i.test(key)) {
4631
+ colorBox = (React__namespace.createElement("span", { className: css.css({
4632
+ display: 'inline-block',
4633
+ border: '1px solid black',
4634
+ width: 24,
4635
+ height: 24,
4636
+ backgroundColor: value
4637
+ }) }));
4638
+ }
4639
+ return (React__namespace.createElement(Tr, { key: key },
4640
+ React__namespace.createElement(Td, { align: "left" }, key),
4641
+ React__namespace.createElement(Td, { align: "left" },
4642
+ React__namespace.createElement("div", { className: css.css({
4643
+ display: 'flex',
4644
+ alignItems: 'center',
4645
+ gap: '1rem'
4646
+ }) },
4647
+ value,
4648
+ " ",
4649
+ colorBox))));
4650
+ }))));
4651
+ };
4652
+ const flatten = (obj, parent, path = 'theme') => {
4653
+ const flatObj = parent !== null && parent !== void 0 ? parent : {};
4654
+ for (const prop in obj) {
4655
+ const value = obj[prop];
4656
+ const fullPath = `${path}.${prop}`;
4657
+ if (typeof value !== 'object') {
4658
+ flatObj[fullPath] = value;
4659
+ }
4660
+ else {
4661
+ flatten(value, flatObj, fullPath);
4662
+ }
4663
+ }
4664
+ return flatObj;
4665
+ };
4666
+
4615
4667
  exports.Accordian = Accordian;
4616
4668
  exports.Autocomplete = Autocomplete;
4617
4669
  exports.Backdrop = Backdrop$1;
@@ -4668,6 +4720,7 @@ exports.TextInput = TextInput;
4668
4720
  exports.Th = Th;
4669
4721
  exports.ThSort = ThSort;
4670
4722
  exports.ThemeProvider = ThemeProvider;
4723
+ exports.ThemeRenderer = ThemeRenderer;
4671
4724
  exports.ToggleButton = ToggleButton;
4672
4725
  exports.ToggleButtonGroup = ToggleButtonGroup;
4673
4726
  exports.TogglePasswordInput = TogglePasswordInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mackin.com/styleguide",
3
- "version": "8.2.0",
3
+ "version": "8.2.3",
4
4
  "description": "",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",