@muraldevkit/ui-toolkit 1.27.1 → 1.29.0

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 (110) hide show
  1. package/dist/index.js +2 -1
  2. package/dist/index.js.LICENSE.txt +8 -0
  3. package/dist/src/components/text/MrlText/MrlText.d.ts +21 -0
  4. package/dist/{components → src/components}/text/MrlTextHeading/MrlTextHeading.d.ts +2 -3
  5. package/dist/{components → src/components}/text/constants.d.ts +3 -7
  6. package/dist/src/hooks/index.d.ts +1 -0
  7. package/dist/src/hooks/useVirtualKeyboard/index.d.ts +1 -0
  8. package/dist/src/hooks/useVirtualKeyboard/useVirtualKeyboard.d.ts +24 -0
  9. package/dist/{index.d.ts → src/index.d.ts} +1 -0
  10. package/dist/{utils → src/utils}/index.d.ts +1 -0
  11. package/dist/src/utils/scrollToElementWithLabel/index.d.ts +1 -0
  12. package/dist/src/utils/scrollToElementWithLabel/scrollToElementWithLabel.d.ts +6 -0
  13. package/dist/src/utils/setAttributes/setAttributes.test.d.ts +1 -0
  14. package/dist/styles/MrlModal/global.scss +3 -5
  15. package/dist/styles/MrlText/variables.scss +0 -17
  16. package/dist/tests/mocks/patchGetBoundingRect.d.ts +7 -0
  17. package/package.json +1 -1
  18. package/dist/components/text/MrlText/MrlText.d.ts +0 -38
  19. /package/dist/{components → src/components}/button/MrlAnimatedIconButton/MrlAnimatedIconButton.d.ts +0 -0
  20. /package/dist/{components → src/components}/button/MrlAnimatedIconButton/index.d.ts +0 -0
  21. /package/dist/{components → src/components}/button/MrlButton/MrlButton.d.ts +0 -0
  22. /package/dist/{components → src/components}/button/MrlButton/index.d.ts +0 -0
  23. /package/dist/{components → src/components}/button/MrlIconButton/MrlIconButton.d.ts +0 -0
  24. /package/dist/{components → src/components}/button/MrlIconButton/index.d.ts +0 -0
  25. /package/dist/{components → src/components}/button/constants.d.ts +0 -0
  26. /package/dist/{components → src/components}/button/helpers.d.ts +0 -0
  27. /package/dist/{components → src/components}/button/index.d.ts +0 -0
  28. /package/dist/{components → src/components}/divider/MrlDivider/MrlDivider.d.ts +0 -0
  29. /package/dist/{components → src/components}/divider/MrlDivider/index.d.ts +0 -0
  30. /package/dist/{components → src/components}/divider/constants.d.ts +0 -0
  31. /package/dist/{components → src/components}/divider/index.d.ts +0 -0
  32. /package/dist/{components → src/components}/focus-trap/MrlFocusTrap/MrlFocusTrap.d.ts +0 -0
  33. /package/dist/{components → src/components}/focus-trap/MrlFocusTrap/index.d.ts +0 -0
  34. /package/dist/{components → src/components}/focus-trap/index.d.ts +0 -0
  35. /package/dist/{components → src/components}/form/checkbox/MrlCheckbox/MrlCheckbox.d.ts +0 -0
  36. /package/dist/{components → src/components}/form/checkbox/MrlCheckbox/index.d.ts +0 -0
  37. /package/dist/{components → src/components}/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +0 -0
  38. /package/dist/{components → src/components}/form/checkbox/MrlCheckboxStandalone/index.d.ts +0 -0
  39. /package/dist/{components → src/components}/form/constants.d.ts +0 -0
  40. /package/dist/{components → src/components}/form/fieldset/MrlFieldset/MrlFieldset.d.ts +0 -0
  41. /package/dist/{components → src/components}/form/fieldset/MrlFieldset/index.d.ts +0 -0
  42. /package/dist/{components → src/components}/form/index.d.ts +0 -0
  43. /package/dist/{components → src/components}/form/label/MrlLabel/MrlLabel.d.ts +0 -0
  44. /package/dist/{components → src/components}/form/label/MrlLabel/index.d.ts +0 -0
  45. /package/dist/{components → src/components}/form/select/MrlSelect/MrlSelect.d.ts +0 -0
  46. /package/dist/{components → src/components}/form/select/MrlSelect/index.d.ts +0 -0
  47. /package/dist/{components → src/components}/form/select/MrlSelectItem/MrlSelectItem.d.ts +0 -0
  48. /package/dist/{components → src/components}/form/select/MrlSelectItem/index.d.ts +0 -0
  49. /package/dist/{components → src/components}/form/select/MrlSelectMenu/MrlSelectMenu.d.ts +0 -0
  50. /package/dist/{components → src/components}/form/select/MrlSelectMenu/index.d.ts +0 -0
  51. /package/dist/{components → src/components}/form/select/context/SelectContext.d.ts +0 -0
  52. /package/dist/{components → src/components}/form/select/index.d.ts +0 -0
  53. /package/dist/{components → src/components}/form/text-input/MrlTextInput/MrlTextInput.d.ts +0 -0
  54. /package/dist/{components → src/components}/form/text-input/MrlTextInput/MrlTextInputRightIcon.d.ts +0 -0
  55. /package/dist/{components → src/components}/form/text-input/MrlTextInput/index.d.ts +0 -0
  56. /package/dist/{components → src/components}/form/text-input/MrlTextInput/useActiveColor.d.ts +0 -0
  57. /package/dist/{components → src/components}/form/textarea/MrlTextarea/MrlTextarea.d.ts +0 -0
  58. /package/dist/{components → src/components}/form/textarea/MrlTextarea/index.d.ts +0 -0
  59. /package/dist/{components → src/components}/form/utils.d.ts +0 -0
  60. /package/dist/{components → src/components}/index.d.ts +0 -0
  61. /package/dist/{components → src/components}/link/MrlLink/MrlLink.d.ts +0 -0
  62. /package/dist/{components → src/components}/link/constants.d.ts +0 -0
  63. /package/dist/{components → src/components}/link/index.d.ts +0 -0
  64. /package/dist/{components → src/components}/modal/MrlModal/index.d.ts +0 -0
  65. /package/dist/{components → src/components}/modal/MrlModalContent/index.d.ts +0 -0
  66. /package/dist/{components → src/components}/modal/MrlModalFooter/index.d.ts +0 -0
  67. /package/dist/{components → src/components}/modal/MrlModalHeader/index.d.ts +0 -0
  68. /package/dist/{components → src/components}/modal/MrlModalHeaderNative/index.d.ts +0 -0
  69. /package/dist/{components → src/components}/modal/constants.d.ts +0 -0
  70. /package/dist/{components → src/components}/modal/demo/ModalWithDevices.d.ts +0 -0
  71. /package/dist/{components → src/components}/modal/demo/ModalWithTriggerDemo.d.ts +0 -0
  72. /package/dist/{components → src/components}/modal/index.d.ts +0 -0
  73. /package/dist/{components → src/components}/notification/MrlBlockNotification/MrlBlockNotification.d.ts +0 -0
  74. /package/dist/{components → src/components}/notification/MrlBlockNotification/index.d.ts +0 -0
  75. /package/dist/{components → src/components}/notification/constants.d.ts +0 -0
  76. /package/dist/{components → src/components}/notification/index.d.ts +0 -0
  77. /package/dist/{components → src/components}/svg/MrlSvg/MrlSvg.d.ts +0 -0
  78. /package/dist/{components → src/components}/svg/MrlSvg/index.d.ts +0 -0
  79. /package/dist/{components → src/components}/svg/MrlSvgAnimate/MrlSvgAnimate.d.ts +0 -0
  80. /package/dist/{components → src/components}/svg/MrlSvgAnimate/index.d.ts +0 -0
  81. /package/dist/{components → src/components}/svg/config.d.ts +0 -0
  82. /package/dist/{components → src/components}/svg/constants.d.ts +0 -0
  83. /package/dist/{components → src/components}/svg/index.d.ts +0 -0
  84. /package/dist/{components → src/components}/text/MrlText/index.d.ts +0 -0
  85. /package/dist/{components → src/components}/text/MrlTextHeading/index.d.ts +0 -0
  86. /package/dist/{components → src/components}/text/index.d.ts +0 -0
  87. /package/dist/{components → src/components}/tooltip/MrlTooltip/MrlTooltip.d.ts +0 -0
  88. /package/dist/{components → src/components}/tooltip/MrlTooltip/index.d.ts +0 -0
  89. /package/dist/{components → src/components}/tooltip/MrlTooltipContent/MrlTooltipContent.d.ts +0 -0
  90. /package/dist/{components → src/components}/tooltip/MrlTooltipContent/index.d.ts +0 -0
  91. /package/dist/{components → src/components}/tooltip/constants.d.ts +0 -0
  92. /package/dist/{components → src/components}/tooltip/index.d.ts +0 -0
  93. /package/dist/{components → src/components}/tooltip/utils.d.ts +0 -0
  94. /package/dist/{contexts → src/contexts}/MrlDeviceProvider/MrlDeviceProvider.d.ts +0 -0
  95. /package/dist/{contexts → src/contexts}/MrlDeviceProvider/index.d.ts +0 -0
  96. /package/dist/{contexts → src/contexts}/index.d.ts +0 -0
  97. /package/dist/{utils → src/utils}/checkInvalidAttributes/index.d.ts +0 -0
  98. /package/dist/{utils → src/utils}/commonProps/index.d.ts +0 -0
  99. /package/dist/{utils → src/utils}/getCamelCase/getCamelCase.d.ts +0 -0
  100. /package/dist/{utils → src/utils}/getCamelCase/getCamelCase.test.d.ts +0 -0
  101. /package/dist/{utils → src/utils}/getCamelCase/index.d.ts +0 -0
  102. /package/dist/{utils → src/utils}/isElementScrollable/index.d.ts +0 -0
  103. /package/dist/{utils → src/utils}/isObject/index.d.ts +0 -0
  104. /package/dist/{utils → src/utils}/isObject/isObject.d.ts +0 -0
  105. /package/dist/{utils → src/utils}/isObject/isObject.test.d.ts +0 -0
  106. /package/dist/{utils → src/utils}/noop/index.d.ts +0 -0
  107. /package/dist/{utils/setAttributes/setAttributes.test.d.ts → src/utils/scrollToElementWithLabel/scrollToElementWithLabel.test.d.ts} +0 -0
  108. /package/dist/{utils → src/utils}/setAttributes/index.d.ts +0 -0
  109. /package/dist/{utils → src/utils}/setAttributes/setAttributes.d.ts +0 -0
  110. /package/dist/{utils → src/utils}/trapFocus/index.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Lodash <https://lodash.com/>
4
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
5
+ * Released under MIT license <https://lodash.com/license>
6
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
7
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8
+ */
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { AttrsObject } from '../../../utils';
3
+ import { TextSizes } from '../constants';
4
+ interface MrlTextProps {
5
+ /** Applies additional HTML attributes to the text element */
6
+ attrs?: AttrsObject;
7
+ /** Children to be rendered within the text component */
8
+ children?: React.ReactNode | string;
9
+ /** Visual size of the text element */
10
+ size?: TextSizes;
11
+ /** Textual content when it's a static string; if you have nested elements, use children to provide content */
12
+ text?: string;
13
+ }
14
+ /**
15
+ * MrlText Component
16
+ *
17
+ * @param {MrlTextProps} props - MrlText component props
18
+ * @returns a paragraph element
19
+ */
20
+ export declare function MrlText(props: MrlTextProps): JSX.Element;
21
+ export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AttrsObject } from '../../../utils';
3
- import { LevelType, HeadingSizes, TextSizes, TextHierarchies, HeadingKinds } from '../constants';
3
+ import { LevelType, HeadingHierarchies, HeadingSizes, TextSizes, HeadingKinds } from '../constants';
4
4
  interface MrlTextHeadingProps {
5
5
  /** Applies additional HTML attributes to the text element */
6
6
  attrs?: AttrsObject;
@@ -16,9 +16,8 @@ interface MrlTextHeadingProps {
16
16
  */
17
17
  size?: HeadingSizes | TextSizes;
18
18
  /** Clear and concise description of the content that the heading describes */
19
+ hierarchy?: HeadingHierarchies;
19
20
  text?: string;
20
- /** Hierarchy level within the use case and sizing scales */
21
- hierarchy?: TextHierarchies;
22
21
  }
23
22
  /**
24
23
  * MuralTextHeading component
@@ -1,16 +1,10 @@
1
1
  import { AttrsObject } from '../../utils';
2
2
  export type TextSizes = 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large';
3
- export type TextHierarchies = 'primary' | 'secondary';
4
- export type TextKinds = 'default' | 'body' | 'meta' | 'supporting';
5
3
  export interface TextDefaults {
6
4
  attrs: AttrsObject;
7
- hierarchy: TextHierarchies;
8
5
  size: TextSizes;
9
- kind: TextKinds;
10
6
  }
11
7
  export declare const textAllowedValues: {
12
- hierarchy: string[];
13
- kind: string[];
14
8
  sizes: string[];
15
9
  };
16
10
  /**
@@ -21,9 +15,10 @@ export declare const textDefaults: TextDefaults;
21
15
  export type LevelType = '1' | '2' | '3' | '4' | '5' | '6';
22
16
  export type HeadingKinds = 'poster' | 'display' | 'headline' | 'title';
23
17
  export type HeadingSizes = 'small' | 'medium' | 'large';
18
+ export type HeadingHierarchies = 'primary' | 'secondary';
24
19
  export interface HeadingDefaults {
25
20
  attrs: AttrsObject;
26
- hierarchy: TextHierarchies;
21
+ hierarchy: HeadingHierarchies;
27
22
  kind: HeadingKinds;
28
23
  level: LevelType;
29
24
  size: HeadingSizes | TextSizes;
@@ -33,6 +28,7 @@ export interface HeadingDefaults {
33
28
  * used for Storybook and testing
34
29
  */
35
30
  export declare const headingAllowedValues: {
31
+ hierarchy: string[];
36
32
  kinds: string[];
37
33
  level: string[];
38
34
  sizes: string[];
@@ -0,0 +1 @@
1
+ export * from './useVirtualKeyboard';
@@ -0,0 +1 @@
1
+ export * from './useVirtualKeyboard';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Custom event name for the virtual keyboard.
3
+ */
4
+ export declare const MRL_VIRTUAL_KEYBOARD_EVENT_NAME = "mrl-virtual-keyboard";
5
+ /**
6
+ * Virtual keyboard event with the keyboard height information.
7
+ */
8
+ export type MrlVirtualKeyboardEvent = CustomEvent<{
9
+ height: number;
10
+ }>;
11
+ /**
12
+ * Utility function to dispatch MrlKeyboardEvent from consumer
13
+ *
14
+ * @param height the height of the virtual keyboard, 0 if closed
15
+ */
16
+ export declare function dispatchMrlKeyboardEvent(height: number): void;
17
+ /**
18
+ * Hook to access the virtual keyboard height
19
+ *
20
+ * @param disabled If disabled will always return 0
21
+ * @param content If a content is passed, this hook will return the height of the overlap between content and keyboard
22
+ * @returns virtual keyboard height or 0 if there isn't any.
23
+ */
24
+ export declare function useVirtualKeyboard(disabled: boolean, content?: HTMLElement | null): number;
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
2
  export * from './utils';
3
3
  export * from './contexts';
4
+ export * from './hooks';
@@ -4,3 +4,4 @@ export * from './isObject';
4
4
  export * from './setAttributes';
5
5
  export * from './noop';
6
6
  export * from './trapFocus';
7
+ export * from './scrollToElementWithLabel';
@@ -0,0 +1 @@
1
+ export { scrollToElementWithLabel } from './scrollToElementWithLabel';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Scroll element into view. If is an input or textarea, will scroll to it or the higher label associated to it.
3
+ *
4
+ * @param element to be scrolled into view
5
+ */
6
+ export declare function scrollToElementWithLabel(element: Element): void;
@@ -16,11 +16,9 @@
16
16
 
17
17
  .mrl-native-modal,
18
18
  .mrl-display-modal {
19
- max-height: calc(100vh - var(--mrl-spacing-09) - var(--mrl-spacing-08));
20
- min-height: min(
21
- var(--mrl-modal-max-height),
22
- calc(100vh - var(--mrl-spacing-09) - var(--mrl-spacing-08))
23
- );
19
+ height: min(var(--mrl-modal-max-height), 100vh - var(--mrl-spacing-09) - var(--mrl-spacing-08));
20
+ margin-bottom: initial;
21
+ max-height: initial;
24
22
  }
25
23
  }
26
24
 
@@ -20,20 +20,3 @@
20
20
  }
21
21
  }
22
22
  }
23
-
24
- .MrlText--secondary {
25
- --mrl-text-weight: var(--mrl-type-weight-text-secondary);
26
- }
27
-
28
- .MrlText--body {
29
- --mrl-text-height: var(--mrl-type-line-height-text);
30
- --mrl-text-weight: var(--mrl-type-weight-text);
31
- --mrl-text-size: var(--mrl-type-size-text-xsmall);
32
- }
33
-
34
- .MrlText--meta,
35
- .MrlText--supporting {
36
- --mrl-text-height: var(--mrl-type-line-height-text);
37
- --mrl-text-weight: var(--mrl-type-weight-title-secondary);
38
- --mrl-text-size: var(--mrl-type-size-text-xxsmall);
39
- }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * getBoundingRect is not properly implemented in JSDom (it returns always 0). This function allows to set a hardcoded response for it.
3
+ *
4
+ * @param element the DOM to be patched
5
+ * @param patch a DOMReact to be returned by getBoundingReact
6
+ */
7
+ export declare function patchGetBoundingRect(element: HTMLElement, patch: Partial<DOMRect>): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "1.27.1",
3
+ "version": "1.29.0",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import { AttrsObject } from '../../../utils';
3
- import { TextHierarchies, TextKinds, TextSizes } from '../constants';
4
- interface CommonProps {
5
- /** Applies additional HTML attributes to the text element */
6
- attrs?: AttrsObject;
7
- /** Children to be rendered within the text component */
8
- children?: React.ReactNode | string;
9
- /** Hierarchy level within the use case and sizing scales */
10
- hierarchy?: TextHierarchies;
11
- /** Textual content when it's a static string; if you have nested elements, use children to provide content */
12
- text?: string;
13
- }
14
- interface DefaultKindWithSize extends CommonProps {
15
- /**
16
- * Visual kind of the text
17
- * If the value is default it allows to change the "size" prop
18
- */
19
- kind: 'default';
20
- /** Visual size of the text, only applies if kind="default" */
21
- size: TextSizes;
22
- }
23
- interface KindWithoutSize extends CommonProps {
24
- /**
25
- * Visual kind of the text
26
- * If the value is default it allows to change the "size" prop
27
- */
28
- kind: Exclude<TextKinds, 'default'>;
29
- }
30
- type MrlTextProps = DefaultKindWithSize | KindWithoutSize;
31
- /**
32
- * MrlText Component
33
- *
34
- * @param {MrlTextProps} props - MrlText component props
35
- * @returns a paragraph element
36
- */
37
- export declare function MrlText(props: MrlTextProps): JSX.Element;
38
- export {};
File without changes
File without changes
File without changes
File without changes
File without changes