@moda/om 16.2.0 → 16.2.1

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 (116) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/index.cjs.js +310 -278
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +309 -277
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/styles.css +1 -1
  7. package/package.json +18 -8
  8. package/src/components/AspectRatioBox/AspectRatioBox.tsx +4 -4
  9. package/src/components/AspectRatioBox/index.ts +1 -1
  10. package/src/components/Badge/Badge.stories.tsx +5 -5
  11. package/src/components/Badge/Badge.test.tsx +1 -1
  12. package/src/components/Breadcrumbs/Breadcrumb/Breadcrumb.tsx +6 -6
  13. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +6 -6
  14. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +2 -2
  15. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  16. package/src/components/Breakpoint/Breakpoint.stories.tsx +10 -9
  17. package/src/components/Breakpoint/Breakpoint.test.tsx +2 -2
  18. package/src/components/Breakpoint/generateMediaQuery.ts +5 -4
  19. package/src/components/Button/Button.stories.tsx +4 -4
  20. package/src/components/Checkbox/Checkbox.stories.tsx +5 -5
  21. package/src/components/Checkbox/Checkbox.test.tsx +3 -3
  22. package/src/components/Checkbox/Checkbox.tsx +4 -4
  23. package/src/components/Clickable/Clickable.stories.tsx +3 -3
  24. package/src/components/ColorSwatch/ColorSwatch.stories.tsx +11 -11
  25. package/src/components/ColorSwatch/ColorSwatch.test.tsx +1 -1
  26. package/src/components/ColorSwatch/ColorSwatch.tsx +1 -1
  27. package/src/components/Constrain/Constrain.stories.tsx +1 -1
  28. package/src/components/Constrain/ExceedConstrain.stories.tsx +2 -2
  29. package/src/components/ControlLink/ControlLink.stories.tsx +1 -1
  30. package/src/components/ControlLink/index.ts +1 -1
  31. package/src/components/CreditCardNumberInput/CreditCardNumberInput.stories.tsx +1 -1
  32. package/src/components/CreditCardNumberInput/CreditCardNumberInput.test.tsx +4 -4
  33. package/src/components/CreditCardNumberInput/CreditCardNumberInput.tsx +1 -0
  34. package/src/components/DefinitionList/DefinitionList.stories.tsx +3 -3
  35. package/src/components/DefinitionList/DefinitionList.test.tsx +1 -1
  36. package/src/components/Divider/Divider.stories.tsx +4 -4
  37. package/src/components/Divider/Divider.test.tsx +1 -1
  38. package/src/components/Divider/Divider.tsx +1 -1
  39. package/src/components/Divider/NoLineDivider.tsx +1 -1
  40. package/src/components/Divider/TwoLineDivider.tsx +1 -1
  41. package/src/components/Expandable/Expandable.stories.tsx +8 -8
  42. package/src/components/Expandable/Expandable.test.tsx +1 -1
  43. package/src/components/Expandable/Expandable.tsx +3 -2
  44. package/src/components/Field/Field.stories.tsx +4 -4
  45. package/src/components/Field/Field.test.tsx +7 -7
  46. package/src/components/Field/Field.tsx +5 -5
  47. package/src/components/Field/index.ts +1 -0
  48. package/src/components/Loading/Loading.test.tsx +1 -1
  49. package/src/components/Loading/Loading.tsx +2 -1
  50. package/src/components/Modal/Modal.test.tsx +2 -2
  51. package/src/components/ModalOverlay/ModalOverlay.test.tsx +2 -2
  52. package/src/components/ModalOverlay/ModalOverlay.tsx +2 -2
  53. package/src/components/Overlay/Overlay.stories.tsx +1 -1
  54. package/src/components/Paginator/Paginator.tsx +3 -3
  55. package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
  56. package/src/components/PasswordInput/PasswordInput.tsx +6 -6
  57. package/src/components/Popover/Popover.stories.tsx +1 -1
  58. package/src/components/Popover/Popover.tsx +10 -7
  59. package/src/components/PromoBanner/PromoBanner.stories.tsx +9 -9
  60. package/src/components/PromoBanner/PromoBanner.tsx +1 -1
  61. package/src/components/RadioButton/RadioButton.stories.tsx +2 -2
  62. package/src/components/RadioButton/RadioButton.tsx +4 -4
  63. package/src/components/SearchInput/SearchInput.stories.tsx +2 -2
  64. package/src/components/SearchInput/SearchInput.test.tsx +1 -1
  65. package/src/components/SearchInput/SearchInput.tsx +3 -3
  66. package/src/components/Select/MultiSelect.tsx +7 -7
  67. package/src/components/Select/Select.stories.tsx +15 -14
  68. package/src/components/Select/Select.test.tsx +13 -13
  69. package/src/components/Select/Select.tsx +7 -7
  70. package/src/components/Select/SelectOption.tsx +1 -1
  71. package/src/components/Select/SelectOptions.tsx +5 -5
  72. package/src/components/SelectableButton/SelectableButton.stories.tsx +1 -1
  73. package/src/components/Shape/ArcWindow.tsx +10 -10
  74. package/src/components/Shape/Bradley.tsx +4 -4
  75. package/src/components/Shape/Brancusi.tsx +4 -4
  76. package/src/components/Shape/Circle.tsx +10 -10
  77. package/src/components/Shape/Diamond.tsx +10 -10
  78. package/src/components/Shape/Keyhole.tsx +4 -4
  79. package/src/components/Shape/Mirror.tsx +4 -4
  80. package/src/components/Shape/Oval.tsx +4 -4
  81. package/src/components/Shape/Triangle.tsx +7 -7
  82. package/src/components/Shape/Window.tsx +4 -4
  83. package/src/components/Stack/Stack.stories.tsx +3 -3
  84. package/src/components/Stack/Stack.test.tsx +1 -1
  85. package/src/components/Tabs/TabList.tsx +1 -1
  86. package/src/components/Tabs/TabPanel.tsx +1 -1
  87. package/src/components/Tabs/TabPanels.tsx +1 -1
  88. package/src/components/Tabs/Tabs.stories.tsx +2 -2
  89. package/src/components/Tabs/Tabs.test.tsx +2 -2
  90. package/src/components/Tabs/Tabs.tsx +7 -1
  91. package/src/components/Tag/Tag.tsx +6 -5
  92. package/src/components/Text/Text.stories.tsx +5 -5
  93. package/src/components/Text/Text.test.tsx +1 -1
  94. package/src/components/TextInput/TextInput.stories.tsx +1 -1
  95. package/src/components/TextInput/TextInput.test.tsx +1 -1
  96. package/src/components/Textarea/Textarea.stories.tsx +1 -1
  97. package/src/components/Textarea/Textarea.test.tsx +3 -3
  98. package/src/components/Toast/Toast.stories.tsx +1 -1
  99. package/src/components/Toast/Toast.test.tsx +1 -1
  100. package/src/components/Toast/Toast.tsx +6 -6
  101. package/src/components/VerticalDivider/VerticalDivider.stories.tsx +3 -3
  102. package/src/components/VerticalDivider/VerticalDivider.test.tsx +2 -2
  103. package/src/hooks/useKeyboardListNavigation.spec.ts +2 -1
  104. package/src/hooks/useKeyboardListNavigation.ts +2 -0
  105. package/src/hooks/useUpdateEffect.ts +1 -0
  106. package/src/index.ts +2 -2
  107. package/src/mixins/font-smoothing/font-smoothing.stories.tsx +8 -8
  108. package/src/mixins/overflow-scroll/overflow-scroll.stories.tsx +2 -2
  109. package/src/mixins/stack/stack.stories.tsx +5 -6
  110. package/src/mixins/thin-underline/thin-underline.stories.tsx +1 -1
  111. package/src/mixins/visually-hidden/visually-hidden.stories.tsx +1 -1
  112. package/src/utilities/States/State.tsx +3 -2
  113. package/src/utilities/States/States.tsx +4 -3
  114. package/src/utilities/States/StatesProps.tsx +5 -2
  115. package/src/utilities/States/isRenderProps.ts +1 -0
  116. package/src/utilities/States/stringifyProps.tsx +1 -0
@@ -4,6 +4,7 @@ import { StatesProps } from './StatesProps';
4
4
  import './State.scss';
5
5
 
6
6
  interface Props {
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
8
  props: any;
8
9
  children: JSX.Element | RenderProps;
9
10
  }
@@ -13,10 +14,10 @@ export const State: React.FC<Props> = ({ props, children, ...rest }) => {
13
14
  const innerChildren = isRenderProps(children) ? children(props) : children;
14
15
 
15
16
  return (
16
- <div className='State' {...rest}>
17
+ <div className="State" {...rest}>
17
18
  {Specimen}
18
19
 
19
- <code className='State__props'>
20
+ <code className="State__props">
20
21
  <StatesProps props={props}>{innerChildren}</StatesProps>
21
22
  </code>
22
23
  </div>
@@ -4,15 +4,16 @@ import { State } from './State';
4
4
  import './States.scss';
5
5
 
6
6
  export interface Props {
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
8
  states?: any[];
8
9
  children: JSX.Element | RenderProps;
9
10
  }
10
11
 
11
12
  export const States: React.FC<Props> = ({ states = [{}], children, ...rest }) => {
12
13
  return (
13
- <div className='States'>
14
- {states.map((props, i) => (
15
- <State key={i} props={props} {...rest}>
14
+ <div className="States">
15
+ {states.map((props, index) => (
16
+ <State key={index} props={props} {...rest}>
16
17
  {children}
17
18
  </State>
18
19
  ))}
@@ -1,22 +1,25 @@
1
1
  import React from 'react';
2
2
  import { Stack } from '../../components/Stack';
3
+ import { omit } from '../omit';
3
4
  import { isRenderProps } from './isRenderProps';
4
5
  import { stringifyProps } from './stringifyProps';
5
- import { omit } from '../omit';
6
6
  import './StatesProps.scss';
7
7
 
8
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
9
  interface Props {
9
10
  children: any;
10
11
  props: any;
11
12
  }
13
+ /* eslint-enable @typescript-eslint/no-explicit-any */
12
14
 
15
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
16
  const isEmpty = (obj?: any) => Object.entries(obj || {}).length === 0;
14
17
 
15
18
  export const StatesProps: React.FC<Props> = ({ props, children }) => {
16
19
  const childrenProps = omit(children.props, ...Object.keys(props || {}));
17
20
 
18
21
  return (
19
- <Stack className='StatesProps' space={2} direction='horizontal'>
22
+ <Stack className="StatesProps" space={2} direction="horizontal">
20
23
  <span>{children.type.displayName || children.type.name}</span>
21
24
  {!isEmpty(props) && <strong>{stringifyProps(props)}</strong>}
22
25
  {!isRenderProps(children) && !isEmpty(childrenProps) && (
@@ -1,4 +1,5 @@
1
1
  export type RenderProps = {
2
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
3
  (props: any): JSX.Element;
3
4
  };
4
5
 
@@ -4,6 +4,7 @@ const truncate = (string: string, maxLength = 25) => {
4
4
  return `${string.substring(0, maxLength)}${ellipsis ? '...' : ''}`;
5
5
  };
6
6
 
7
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
8
  export const stringifyProps = (props: any) => {
8
9
  const stringifiedProps = Object.entries(props || {}).reduce((memo: string, [key, value]) => {
9
10
  if (key === 'children') return `${memo} children={...}`;