@veracity/vui 0.3.2 → 0.5.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 (209) hide show
  1. package/avatar/avatar.js +1 -1
  2. package/button/button.d.ts +15 -1
  3. package/button/button.js +3 -3
  4. package/button/button.types.d.ts +4 -4
  5. package/button/consts.js +2 -2
  6. package/button/theme.d.ts +2 -0
  7. package/button/theme.js +3 -2
  8. package/buttonGroup/buttonGroup.d.ts +1 -1
  9. package/buttonGroup/buttonGroup.js +1 -1
  10. package/buttonGroup/helpers.js +3 -1
  11. package/checkbox/checkbox.d.ts +1 -1
  12. package/core/consts.d.ts +7 -0
  13. package/core/consts.js +8 -1
  14. package/core/index.d.ts +1 -0
  15. package/core/index.js +1 -0
  16. package/core/links.d.ts +20 -0
  17. package/core/links.js +173 -0
  18. package/dialog/consts.d.ts +3 -0
  19. package/dialog/consts.js +30 -0
  20. package/dialog/context.d.ts +4 -0
  21. package/dialog/context.js +23 -0
  22. package/dialog/dialog.d.ts +26 -0
  23. package/dialog/dialog.js +122 -0
  24. package/dialog/dialog.types.d.ts +47 -0
  25. package/dialog/dialogBody.d.ts +9 -0
  26. package/dialog/dialogBody.js +85 -0
  27. package/dialog/dialogCancelButton.d.ts +4 -0
  28. package/dialog/dialogCancelButton.js +30 -0
  29. package/dialog/dialogCloseButton.d.ts +4 -0
  30. package/dialog/dialogCloseButton.js +30 -0
  31. package/dialog/dialogFooter.d.ts +4 -0
  32. package/dialog/dialogFooter.js +45 -0
  33. package/dialog/dialogHeader.d.ts +4 -0
  34. package/dialog/dialogHeader.js +53 -0
  35. package/dialog/dialogIcon.d.ts +4 -0
  36. package/dialog/dialogIcon.js +32 -0
  37. package/dialog/dialogSubmitButton.d.ts +4 -0
  38. package/dialog/dialogSubmitButton.js +28 -0
  39. package/dialog/dialogTitle.d.ts +4 -0
  40. package/dialog/dialogTitle.js +30 -0
  41. package/dialog/index.d.ts +13 -0
  42. package/dialog/index.js +30 -0
  43. package/dialog/theme.d.ts +22 -0
  44. package/dialog/theme.js +28 -0
  45. package/footer/context.d.ts +4 -0
  46. package/footer/context.js +23 -0
  47. package/footer/footer.d.ts +2 -0
  48. package/footer/footer.js +11 -29
  49. package/footer/footer.types.d.ts +19 -16
  50. package/footer/footerColumn.d.ts +2 -218
  51. package/footer/footerColumn.js +16 -2
  52. package/footer/footerContent.d.ts +3 -0
  53. package/footer/footerContent.js +28 -0
  54. package/footer/footerHeading.js +2 -1
  55. package/footer/footerLink.js +2 -1
  56. package/footer/footerRow.js +2 -1
  57. package/footer/footerSection.js +4 -3
  58. package/footer/footerTrademark.d.ts +3 -5
  59. package/footer/footerTrademark.js +23 -6
  60. package/footer/helpers.d.ts +7 -10
  61. package/footer/helpers.js +91 -33
  62. package/footer/index.d.ts +1 -1
  63. package/footer/index.js +1 -1
  64. package/footer/theme.js +1 -1
  65. package/grid/grid.d.ts +5 -0
  66. package/{header/headerLink.js → grid/grid.js} +17 -13
  67. package/grid/grid.types.d.ts +3 -0
  68. package/grid/grid.types.js +2 -0
  69. package/grid/index.d.ts +3 -0
  70. package/grid/index.js +20 -0
  71. package/grid/theme.d.ts +7 -0
  72. package/grid/theme.js +12 -0
  73. package/header/context.d.ts +2 -2
  74. package/header/context.js +3 -3
  75. package/header/header.d.ts +11 -10
  76. package/header/header.js +36 -21
  77. package/header/header.types.d.ts +54 -39
  78. package/header/headerAccount.d.ts +8 -0
  79. package/header/{headerProfile.js → headerAccount.js} +32 -45
  80. package/header/headerAccount.types.d.ts +35 -0
  81. package/header/headerAccount.types.js +2 -0
  82. package/header/headerAccountUserInfo.d.ts +4 -0
  83. package/header/headerAccountUserInfo.js +46 -0
  84. package/header/headerContent.d.ts +2 -3
  85. package/header/headerContent.js +3 -3
  86. package/header/headerCreateAccount.js +8 -5
  87. package/header/headerDivider.js +2 -2
  88. package/header/headerLinkItem.d.ts +4 -0
  89. package/header/headerLinkItem.js +53 -0
  90. package/header/headerLogo.js +8 -10
  91. package/header/headerMainLinks.d.ts +4 -0
  92. package/header/{headerLinks.js → headerMainLinks.js} +10 -7
  93. package/header/headerMobileContent.js +4 -3
  94. package/header/headerMobileToggle.d.ts +2 -2
  95. package/header/headerMobileToggle.js +6 -7
  96. package/header/headerNotifications.js +8 -8
  97. package/header/headerServices.d.ts +5 -1
  98. package/header/headerServices.js +23 -14
  99. package/header/headerServicesMessage.d.ts +4 -0
  100. package/header/headerServicesMessage.js +49 -0
  101. package/header/headerSignIn.js +5 -3
  102. package/header/helpers.d.ts +8 -0
  103. package/header/helpers.js +115 -0
  104. package/header/index.d.ts +8 -3
  105. package/header/index.js +8 -3
  106. package/header/loggedInHeader.d.ts +1 -1
  107. package/header/loggedInHeader.js +16 -12
  108. package/header/loggedOutHeader.js +15 -12
  109. package/header/theme.d.ts +62 -7
  110. package/header/theme.js +53 -12
  111. package/icons/baseIcons/fas/fasCalendarAlt.js +1 -1
  112. package/index.d.ts +4 -0
  113. package/index.js +4 -0
  114. package/input/consts.js +2 -2
  115. package/input/input.js +1 -1
  116. package/input/input.types.d.ts +3 -3
  117. package/link/link.types.d.ts +4 -4
  118. package/link/linkText.js +1 -1
  119. package/list/listHeading.js +1 -1
  120. package/list/listItem.js +2 -2
  121. package/list/theme.d.ts +2 -4
  122. package/list/theme.js +2 -4
  123. package/menu/menuItem.js +7 -22
  124. package/menu/menuList.js +1 -1
  125. package/modal/ModalBackdrop.d.ts +4 -0
  126. package/modal/ModalBackdrop.js +37 -0
  127. package/modal/ModalContent.d.ts +4 -0
  128. package/modal/ModalContent.js +38 -0
  129. package/modal/context.d.ts +4 -0
  130. package/modal/context.js +23 -0
  131. package/modal/focusLock.d.ts +9 -0
  132. package/modal/focusLock.js +47 -0
  133. package/modal/focusLock.types.d.ts +28 -0
  134. package/modal/focusLock.types.js +2 -0
  135. package/modal/index.d.ts +9 -0
  136. package/modal/index.js +26 -0
  137. package/modal/modal.d.ts +15 -0
  138. package/modal/modal.js +113 -0
  139. package/modal/modal.types.d.ts +46 -0
  140. package/modal/modal.types.js +2 -0
  141. package/modal/modalManager.d.ts +12 -0
  142. package/modal/modalManager.js +33 -0
  143. package/modal/theme.d.ts +8 -0
  144. package/modal/theme.js +14 -0
  145. package/notification/consts.js +2 -2
  146. package/notification/notification.types.d.ts +1 -2
  147. package/notification/theme.js +1 -1
  148. package/package.json +3 -1
  149. package/popover/popover.d.ts +1 -1
  150. package/popover/popover.js +5 -4
  151. package/popover/popoverContent.js +1 -1
  152. package/popover/popoverTrigger.js +7 -2
  153. package/popover/usePopover.js +7 -9
  154. package/popover/usePopover.types.d.ts +1 -1
  155. package/portal/index.d.ts +3 -0
  156. package/portal/index.js +20 -0
  157. package/portal/portal.d.ts +5 -0
  158. package/portal/portal.js +56 -0
  159. package/portal/portal.types.d.ts +7 -0
  160. package/portal/portal.types.js +2 -0
  161. package/radio/radio.d.ts +1 -1
  162. package/radio/radioGroup.js +1 -1
  163. package/svg/svg.js +9 -7
  164. package/svg/svg.types.d.ts +2 -2
  165. package/system/custom.d.ts +0 -4
  166. package/system/custom.js +1 -15
  167. package/system/effects.d.ts +4 -4
  168. package/system/grids.d.ts +5 -3
  169. package/system/system.d.ts +2 -2
  170. package/system/system.js +1 -1
  171. package/system/transitions.d.ts +1 -1
  172. package/tag/tag.js +1 -2
  173. package/tag/tag.types.d.ts +3 -4
  174. package/tag/theme.d.ts +1 -0
  175. package/tag/theme.js +2 -1
  176. package/textarea/textarea.js +2 -2
  177. package/theme/components.d.ts +101 -11
  178. package/theme/components.js +48 -42
  179. package/theme/defaultTheme.d.ts +130 -12
  180. package/theme/foundations/gridTemplateColumns.d.ts +15 -0
  181. package/theme/foundations/gridTemplateColumns.js +16 -0
  182. package/theme/foundations/gridTemplateRows.d.ts +9 -0
  183. package/theme/foundations/gridTemplateRows.js +10 -0
  184. package/theme/foundations/index.d.ts +29 -1
  185. package/theme/foundations/index.js +6 -0
  186. package/theme/foundations/timingFunctions.d.ts +2 -0
  187. package/theme/foundations/timingFunctions.js +3 -0
  188. package/theme/foundations/zIndices.d.ts +6 -1
  189. package/theme/foundations/zIndices.js +6 -1
  190. package/theme/types.d.ts +9 -1
  191. package/utils/assertion.d.ts +2 -0
  192. package/utils/assertion.js +6 -1
  193. package/utils/function.d.ts +4 -0
  194. package/utils/function.js +19 -1
  195. package/utils/index.d.ts +1 -0
  196. package/utils/index.js +1 -0
  197. package/utils/number.d.ts +2 -0
  198. package/utils/number.js +10 -0
  199. package/utils/object.js +9 -17
  200. package/utils/react.d.ts +12 -5
  201. package/utils/react.js +69 -9
  202. package/utils/types.d.ts +4 -2
  203. package/footer/consts.d.ts +0 -72
  204. package/footer/consts.js +0 -132
  205. package/header/headerLink.d.ts +0 -4
  206. package/header/headerLinks.d.ts +0 -4
  207. package/header/headerProfile.d.ts +0 -4
  208. package/header/headerProfile.types.d.ts +0 -35
  209. /package/{header/headerProfile.types.js → dialog/dialog.types.js} +0 -0
@@ -2,6 +2,6 @@
2
2
  /* eslint-disable */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.default = {
5
- details: [32, 32, [], '', 'M9 0C8.44772 0 8 0.447715 8 1V4H5C3.34315 4 2 5.34315 2 7V10H30V7C30 5.34315 28.6569 4 27 4H24V1C24 0.447715 23.5523 0 23 0H21C20.4477 0 20 0.447715 20 1V4H12V1C12 0.447715 11.5523 0 11 0H9Z M30 12H2V29C2 30.6569 3.34315 32 5 32H27C28.6569 32 30 30.6569 30 29V12ZM22 17C22 16.4477 22.4477 16 23 16H25C25.5523 16 26 16.4477 26 17V19C26 19.5523 25.5523 20 25 20H23C22.4477 20 22 19.5523 22 19V17ZM23 24C22.4477 24 22 24.4477 22 25V27C22 27.5523 22.4477 28 23 28H25C25.5523 28 26 27.5523 26 27V25C26 24.4477 25.5523 24 25 24H23ZM14 17C14 16.4477 14.4477 16 15 16H17C17.5523 16 18 16.4477 18 17V19C18 19.5523 17.5523 20 17 20H15C14.4477 20 14 19.5523 14 19V17ZM7 16C6.44772 16 6 16.4477 6 17V19C6 19.5523 6.44772 20 7 20H9C9.55228 20 10 19.5523 10 19V17C10 16.4477 9.55228 16 9 16H7ZM14 25C14 24.4477 14.4477 24 15 24H17C17.5523 24 18 24.4477 18 25V27C18 27.5523 17.5523 28 17 28H15C14.4477 28 14 27.5523 14 27V25ZM7 24C6.44772 24 6 24.4477 6 25V27C6 27.5523 6.44772 28 7 28H9C9.55228 28 10 27.5523 10 27V25C10 24.4477 9.55228 24 9 24H7Z'],
5
+ details: [448, 512, [], '', 'M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm320-196c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM192 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM64 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z'],
6
6
  name: 'fasCalendarAlt'
7
7
  };
package/index.d.ts CHANGED
@@ -5,8 +5,10 @@ export * from './buttonGroup';
5
5
  export * from './card';
6
6
  export * from './checkbox';
7
7
  export * from './core';
8
+ export * from './dialog';
8
9
  export * from './divider';
9
10
  export * from './footer';
11
+ export * from './grid';
10
12
  export * from './header';
11
13
  export * from './heading';
12
14
  export * from './icon';
@@ -16,10 +18,12 @@ export * from './input';
16
18
  export * from './link';
17
19
  export * from './list';
18
20
  export * from './menu';
21
+ export * from './modal';
19
22
  export * from './notification';
20
23
  export * from './p';
21
24
  export * from './panel';
22
25
  export * from './popover';
26
+ export * from './portal';
23
27
  export * from './radio';
24
28
  export * from './skeleton';
25
29
  export * from './spinner';
package/index.js CHANGED
@@ -17,8 +17,10 @@ __exportStar(require("./buttonGroup"), exports);
17
17
  __exportStar(require("./card"), exports);
18
18
  __exportStar(require("./checkbox"), exports);
19
19
  __exportStar(require("./core"), exports);
20
+ __exportStar(require("./dialog"), exports);
20
21
  __exportStar(require("./divider"), exports);
21
22
  __exportStar(require("./footer"), exports);
23
+ __exportStar(require("./grid"), exports);
22
24
  __exportStar(require("./header"), exports);
23
25
  __exportStar(require("./heading"), exports);
24
26
  __exportStar(require("./icon"), exports);
@@ -28,10 +30,12 @@ __exportStar(require("./input"), exports);
28
30
  __exportStar(require("./link"), exports);
29
31
  __exportStar(require("./list"), exports);
30
32
  __exportStar(require("./menu"), exports);
33
+ __exportStar(require("./modal"), exports);
31
34
  __exportStar(require("./notification"), exports);
32
35
  __exportStar(require("./p"), exports);
33
36
  __exportStar(require("./panel"), exports);
34
37
  __exportStar(require("./popover"), exports);
38
+ __exportStar(require("./portal"), exports);
35
39
  __exportStar(require("./radio"), exports);
36
40
  __exportStar(require("./skeleton"), exports);
37
41
  __exportStar(require("./spinner"), exports);
package/input/consts.js CHANGED
@@ -13,8 +13,8 @@ exports.inputStateMapping = {
13
13
  colorScheme: 'grey',
14
14
  iconProps: {
15
15
  animation: 'vui-spin 0.6s linear infinite',
16
- fill: ['blue.20', 'blue.50'],
17
- icon: 'fadSpinnerThird'
16
+ name: 'fadSpinnerThird',
17
+ pathFill: ['blue.20', 'blue.50']
18
18
  }
19
19
  },
20
20
  success: {
package/input/input.js CHANGED
@@ -74,7 +74,7 @@ var context_1 = require("./context");
74
74
  var helpers_1 = require("./helpers");
75
75
  var inputIcon_1 = __importDefault(require("./inputIcon"));
76
76
  var inputInput_1 = __importDefault(require("./inputInput"));
77
- exports.InputBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tbackground-color: white;\n\tborder-radius: md;\n\tborder-width: 1px;\n\tdisplay: flex;\n\toutline: none;\n\tposition: relative;\n\ttransition-duration: fast;\n\twidth: 100%;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t}\n"], ["\n\talign-items: center;\n\tbackground-color: white;\n\tborder-radius: md;\n\tborder-width: 1px;\n\tdisplay: flex;\n\toutline: none;\n\tposition: relative;\n\ttransition-duration: fast;\n\twidth: 100%;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t}\n"
77
+ exports.InputBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tbackground-color: white;\n\tborder-radius: md;\n\tborder-width: 1px;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\toutline: none;\n\tposition: relative;\n\ttransition-duration: fast;\n\twidth: 100%;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t}\n"], ["\n\talign-items: center;\n\tbackground-color: white;\n\tborder-radius: md;\n\tborder-width: 1px;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\toutline: none;\n\tposition: relative;\n\ttransition-duration: fast;\n\twidth: 100%;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t}\n"
78
78
  /**
79
79
  * Displays an input element wrapped in a div to allow extra content, like counter, side icons or buttons.
80
80
  * Forwards many relevant props to the inner input. Handles different states, like loading or error.
@@ -2,7 +2,7 @@
2
2
  import { IconProp, IconProps } from '../icon';
3
3
  import { SystemProps } from '../system';
4
4
  import { ThemingProps } from '../theme';
5
- import { AnyElement, ChangeEventHandler, FocusEventHandler, PropsOf } from '../utils';
5
+ import { ChangeEventHandler, FocusEventHandler, PropsOf } from '../utils';
6
6
  export declare type InputInputProps = PropsOf<'input', SystemProps>;
7
7
  export declare type InputProps = SystemProps & ThemingProps<'Input'> & {
8
8
  /** Passed to the inner input. */
@@ -16,9 +16,9 @@ export declare type InputProps = SystemProps & ThemingProps<'Input'> & {
16
16
  /** Passed to the inner input. */
17
17
  disabled?: boolean;
18
18
  /** Socket displaying an icon on the left. */
19
- iconLeft?: IconProp | AnyElement;
19
+ iconLeft?: IconProp | JSX.Element;
20
20
  /** Socket displaying an icon on the right. */
21
- iconRight?: IconProp | AnyElement;
21
+ iconRight?: IconProp | JSX.Element;
22
22
  /** Socket rendering a custom input element. */
23
23
  input?: React.ReactNode;
24
24
  /** Props object passed to the inner input. */
@@ -1,7 +1,7 @@
1
+ /// <reference types="react" />
1
2
  import { IconProp } from '../icon';
2
3
  import { SystemProps, TypographyProps } from '../system';
3
4
  import { ThemingProps } from '../theme';
4
- import { AnyElement } from '../utils';
5
5
  export declare type LinkProps = SystemProps & ThemingProps<'Link'> & {
6
6
  /** Available theme colors for this component. @default blue */
7
7
  colorScheme?: 'blue' | 'white';
@@ -10,15 +10,15 @@ export declare type LinkProps = SystemProps & ThemingProps<'Link'> & {
10
10
  /** Alias for hoverTextDecoration prop. @deprecated */
11
11
  hoverDecoration?: TypographyProps['textDecoration'];
12
12
  /** Socket displaying an icon on the left. */
13
- iconLeft?: IconProp | AnyElement;
13
+ iconLeft?: IconProp | JSX.Element;
14
14
  /** Socket displaying an icon on the right. */
15
- iconRight?: IconProp | AnyElement;
15
+ iconRight?: IconProp | JSX.Element;
16
16
  /** Opens the link in new tab with appropriate attributes. */
17
17
  isExternal?: boolean;
18
18
  /** Displays permanent underline. */
19
19
  isUnderlined?: boolean;
20
20
  /** Socket displaying text within the Link. */
21
- text?: number | string | AnyElement;
21
+ text?: number | string | JSX.Element;
22
22
  /** Alias for fontWeight prop. @deprecated */
23
23
  weight?: TypographyProps['fontWeight'];
24
24
  };
package/link/linkText.js CHANGED
@@ -22,7 +22,7 @@ var context_1 = require("./context");
22
22
  /** Displays text of the Link. */
23
23
  exports.LinkText = (0, core_1.vui)(function (props, ref) {
24
24
  var styles = (0, core_1.useStyleConfig)('Link', __assign(__assign({}, (0, context_1.useLink)()), props));
25
- return react_1.default.createElement(t_1.default, __assign({ className: "vui-linkText", fontSize: "inherit", ref: ref }, styles.text, props));
25
+ return (react_1.default.createElement(t_1.default, __assign({ className: "vui-linkText", fontSize: "inherit", ref: ref, transitionDuration: "unset" }, styles.text, props)));
26
26
  });
27
27
  exports.LinkText.displayName = 'LinkText';
28
28
  exports.default = exports.LinkText;
@@ -22,7 +22,7 @@ var context_1 = require("./context");
22
22
  /** Displays a heading within the List. */
23
23
  exports.ListHeading = (0, core_1.vui)(function (props, ref) {
24
24
  var styles = (0, core_1.useStyleConfig)('List', __assign(__assign({}, (0, context_1.useList)()), props));
25
- return (react_1.default.createElement(t_1.T, __assign({ className: "vui-listHeading", display: "inline-block", px: 2, py: 1, ref: ref, weight: "demi" }, styles.heading, props)));
25
+ return (react_1.default.createElement(t_1.T, __assign({ className: "vui-listHeading", color: "grey.60", display: "inline-block", px: 2, py: 1, ref: ref, size: "sm", textTransform: "uppercase", weight: "medium" }, styles.heading, props)));
26
26
  });
27
27
  exports.ListHeading.displayName = 'ListHeading';
28
28
  exports.default = exports.ListHeading;
package/list/listItem.js CHANGED
@@ -58,7 +58,7 @@ var listIcon_1 = __importDefault(require("./listIcon"));
58
58
  var listText_1 = __importDefault(require("./listText"));
59
59
  /** Used as optional content wrapper when list item should be a link. */
60
60
  var ListItemLink = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(link_1.default, __assign({ borderRadius: "none", h: "100%", px: 2, ref: ref, variant: "plain", w: "100%" }, props))); });
61
- exports.ListItemBase = core_1.styled.liBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tline-height: normal;\n\tmargin-bottom: 1px;\n\toutline: none;\n\ttransition-duration: fast;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t\tuser-select: none;\n\t}\n"], ["\n\tdisplay: flex;\n\tline-height: normal;\n\tmargin-bottom: 1px;\n\toutline: none;\n\ttransition-duration: fast;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t\tuser-select: none;\n\t}\n"
61
+ exports.ListItemBase = core_1.styled.liBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tline-height: normal;\n\toutline: none;\n\ttransition-duration: fast;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t\tuser-select: none;\n\t}\n"], ["\n\tdisplay: flex;\n\tline-height: normal;\n\toutline: none;\n\ttransition-duration: fast;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t\tuser-select: none;\n\t}\n"
62
62
  /**
63
63
  * Displays a list item with text and optional icons. Can be shown as interactive or selected.
64
64
  * Optionally wraps the content with an <a> element when rendering a link.
@@ -71,7 +71,7 @@ exports.ListItemBase = core_1.styled.liBox(templateObject_1 || (templateObject_1
71
71
  exports.ListItem = (0, core_1.vui)(function (props, ref) {
72
72
  var mergedProps = __assign(__assign({}, (0, context_1.useList)()), props);
73
73
  var children = mergedProps.children, center = mergedProps.center, centerH = mergedProps.centerH, _a = mergedProps.centerV, centerV = _a === void 0 ? true : _a, className = mergedProps.className, column = mergedProps.column, disabled = mergedProps.disabled, iconLeft = mergedProps.iconLeft, iconRight = mergedProps.iconRight, isInteractiveProp = mergedProps.isInteractive, isSelected = mergedProps.isSelected, isTruncated = mergedProps.isTruncated, itemLeft = mergedProps.itemLeft, itemRight = mergedProps.itemRight, linkProps = mergedProps.linkProps, onClick = mergedProps.onClick, text = mergedProps.text, rest = __rest(mergedProps, ["children", "center", "centerH", "centerV", "className", "column", "disabled", "iconLeft", "iconRight", "isInteractive", "isSelected", "isTruncated", "itemLeft", "itemRight", "linkProps", "onClick", "text"]);
74
- var styles = (0, core_1.useStyleConfig)('List', mergedProps);
74
+ var styles = (0, core_1.useStyleConfig)('List', (0, context_1.useList)());
75
75
  var _b = styles.item, activeBg = _b.activeBg, hoverBg = _b.hoverBg, selectedBg = _b.selectedBg, itemStyles = __rest(_b, ["activeBg", "hoverBg", "selectedBg"]);
76
76
  var isLinkItem = linkProps !== undefined;
77
77
  var isInteractive = isInteractiveProp || isLinkItem || onClick !== undefined;
package/list/theme.d.ts CHANGED
@@ -58,8 +58,7 @@ declare const _default: {
58
58
  };
59
59
  item: {
60
60
  display: string;
61
- h: undefined;
62
- lineHeight: number;
61
+ h: string;
63
62
  };
64
63
  };
65
64
  unordered: {
@@ -70,8 +69,7 @@ declare const _default: {
70
69
  };
71
70
  item: {
72
71
  display: string;
73
- h: undefined;
74
- lineHeight: number;
72
+ h: string;
75
73
  };
76
74
  };
77
75
  };
package/list/theme.js CHANGED
@@ -65,8 +65,7 @@ var variants = {
65
65
  },
66
66
  item: {
67
67
  display: 'list-item',
68
- h: undefined,
69
- lineHeight: 1.5
68
+ h: ''
70
69
  }
71
70
  },
72
71
  unordered: {
@@ -77,8 +76,7 @@ var variants = {
77
76
  },
78
77
  item: {
79
78
  display: 'list-item',
80
- h: undefined,
81
- lineHeight: 1.5
79
+ h: ''
82
80
  }
83
81
  }
84
82
  };
package/menu/menuItem.js CHANGED
@@ -10,25 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
13
  var __rest = (this && this.__rest) || function (s, e) {
33
14
  var t = {};
34
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -40,12 +21,16 @@ var __rest = (this && this.__rest) || function (s, e) {
40
21
  }
41
22
  return t;
42
23
  };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
43
27
  Object.defineProperty(exports, "__esModule", { value: true });
44
28
  exports.MenuItem = void 0;
45
- var react_1 = __importStar(require("react"));
29
+ var react_1 = __importDefault(require("react"));
46
30
  var core_1 = require("../core");
47
31
  var list_1 = require("../list");
48
32
  var popover_1 = require("../popover");
33
+ var utils_1 = require("../utils");
49
34
  var context_1 = require("./context");
50
35
  /** Displays a list item and by default closes the menu on click. */
51
36
  exports.MenuItem = (0, core_1.vui)(function (props, ref) {
@@ -54,10 +39,10 @@ exports.MenuItem = (0, core_1.vui)(function (props, ref) {
54
39
  var instance = ((_a = (0, popover_1.usePopoverContext)()) !== null && _a !== void 0 ? _a : {}).instance;
55
40
  var _c = (_b = (0, context_1.useMenuContext)()) !== null && _b !== void 0 ? _b : {}, closeOnSelect = _c.closeOnSelect, menuProps = __rest(_c, ["closeOnSelect"]);
56
41
  var styles = (0, core_1.useStyleConfig)('Menu', __assign(__assign({}, menuProps), props));
57
- var onClick = (0, react_1.useCallback)(function (e) {
42
+ var onClick = (0, utils_1.useCallbackRef)(function (e) {
58
43
  onClickProp === null || onClickProp === void 0 ? void 0 : onClickProp(e);
59
44
  closeOnSelect && (instance === null || instance === void 0 ? void 0 : instance.hide());
60
- }, [closeOnSelect, instance]);
45
+ });
61
46
  return react_1.default.createElement(list_1.ListItem, __assign({ className: "vui-menuItem", isInteractive: true, onClick: onClick, ref: ref }, styles.item, rest));
62
47
  });
63
48
  exports.MenuItem.displayName = 'MenuItem';
package/menu/menuList.js CHANGED
@@ -36,7 +36,7 @@ exports.MenuList = (0, core_1.vui)(function (props, ref) {
36
36
  var contentProps = props.contentProps, contentRef = props.contentRef, rest = __rest(props, ["contentProps", "contentRef"]);
37
37
  var styles = (0, core_1.useStyleConfig)('Menu', __assign(__assign({}, (0, context_1.useMenuContext)()), props));
38
38
  return (react_1.default.createElement(popover_1.PopoverContent, __assign({ ref: contentRef }, contentProps),
39
- react_1.default.createElement(list_1.default, __assign({ className: "vui-menuList", py: 1, ref: ref }, styles.list, rest))));
39
+ react_1.default.createElement(list_1.default, __assign({ className: "vui-menuList", py: 1, ref: ref, w: "100%" }, styles.list, rest))));
40
40
  });
41
41
  exports.MenuList.displayName = 'MenuList';
42
42
  exports.MenuList.Divider = list_1.default.Divider;
@@ -0,0 +1,4 @@
1
+ export declare const ModalBackdropBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
2
+ /** Displays a dark overlay underneath modal content, but on top of page content. */
3
+ export declare const ModalBackdrop: import("../core").VuiComponent<"div", import("..").SystemProps>;
4
+ export default ModalBackdrop;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.ModalBackdrop = exports.ModalBackdropBase = void 0;
22
+ var react_1 = __importDefault(require("react"));
23
+ var core_1 = require("../core");
24
+ var theme_1 = require("../theme");
25
+ var utils_1 = require("../utils");
26
+ var context_1 = require("./context");
27
+ exports.ModalBackdropBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tanimation: vui-fadeIn 0.3s ease;\n\tbackground-color: ", ";\n\tinset: 0px;\n\tposition: fixed;\n\tz-index: modal;\n"], ["\n\tanimation: vui-fadeIn 0.3s ease;\n\tbackground-color: ", ";\n\tinset: 0px;\n\tposition: fixed;\n\tz-index: modal;\n"
28
+ /** Displays a dark overlay underneath modal content, but on top of page content. */
29
+ ])), (0, utils_1.hexToRGBA)(theme_1.colors.prussian[80], 0.6));
30
+ /** Displays a dark overlay underneath modal content, but on top of page content. */
31
+ exports.ModalBackdrop = (0, core_1.vui)(function (props, ref) {
32
+ var styles = (0, core_1.useStyleConfig)('Modal', (0, context_1.useModalContext)());
33
+ return react_1.default.createElement(exports.ModalBackdropBase, __assign({ className: "vui-modalBackdrop", ref: ref }, styles.backdrop, props));
34
+ });
35
+ exports.ModalBackdrop.displayName = 'ModalBackdrop';
36
+ exports.default = exports.ModalBackdrop;
37
+ var templateObject_1;
@@ -0,0 +1,4 @@
1
+ export declare const ModalContentBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
2
+ /** Wraps the content provided to the Modal component. */
3
+ export declare const ModalContent: import("../core").VuiComponent<"div", import("..").SystemProps>;
4
+ export default ModalContent;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.ModalContent = exports.ModalContentBase = void 0;
22
+ var react_1 = __importDefault(require("react"));
23
+ var core_1 = require("../core");
24
+ var utils_1 = require("../utils");
25
+ var context_1 = require("./context");
26
+ exports.ModalContentBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tinset: 0px;\n\tposition: fixed;\n\tz-index: modal;\n"], ["\n\tdisplay: flex;\n\tinset: 0px;\n\tposition: fixed;\n\tz-index: modal;\n"
27
+ /** Wraps the content provided to the Modal component. */
28
+ ])));
29
+ /** Wraps the content provided to the Modal component. */
30
+ exports.ModalContent = (0, core_1.vui)(function (props, ref) {
31
+ var _a;
32
+ var onBackdropClick = ((_a = (0, context_1.useModalContext)()) !== null && _a !== void 0 ? _a : {}).onBackdropClick;
33
+ var styles = (0, core_1.useStyleConfig)('Modal', (0, context_1.useModalContext)());
34
+ return (react_1.default.createElement(exports.ModalContentBase, __assign({ className: "vui-modalContent", ref: ref, tabIndex: -1 }, styles.content, props, { onClick: (0, utils_1.callAll)(props.onClick, onBackdropClick) })));
35
+ });
36
+ exports.ModalContent.displayName = 'ModalContent';
37
+ exports.default = exports.ModalContent;
38
+ var templateObject_1;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { ModalContext } from './modal.types';
3
+ declare const ModalProvider: import("react").Provider<ModalContext>, useModalContext: () => ModalContext;
4
+ export { ModalProvider, useModalContext };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __read = (this && this.__read) || function (o, n) {
3
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
4
+ if (!m) return o;
5
+ var i = m.call(o), r, ar = [], e;
6
+ try {
7
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
+ }
9
+ catch (error) { e = { error: error }; }
10
+ finally {
11
+ try {
12
+ if (r && !r.done && (m = i["return"])) m.call(i);
13
+ }
14
+ finally { if (e) throw e.error; }
15
+ }
16
+ return ar;
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.useModalContext = exports.ModalProvider = void 0;
20
+ var utils_1 = require("../utils");
21
+ var _a = __read((0, utils_1.createContext)({ isOptional: true }), 2), ModalProvider = _a[0], useModalContext = _a[1];
22
+ exports.ModalProvider = ModalProvider;
23
+ exports.useModalContext = useModalContext;
@@ -0,0 +1,9 @@
1
+ import { FC } from 'react';
2
+ import { FocusLockProps } from './focusLock.types';
3
+ /**
4
+ * Traps the focus within the provided content. That is, tabbing with keyboard will
5
+ * only cycle through the children and won't leave the boundary of the FocusLock.
6
+ * This behavior enhances accessibility of the Modal component.
7
+ */
8
+ export declare const FocusLock: FC<FocusLockProps>;
9
+ export default FocusLock;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
11
+ }) : function(o, v) {
12
+ o["default"] = v;
13
+ });
14
+ var __importStar = (this && this.__importStar) || function (mod) {
15
+ if (mod && mod.__esModule) return mod;
16
+ var result = {};
17
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
+ __setModuleDefault(result, mod);
19
+ return result;
20
+ };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.FocusLock = void 0;
26
+ var react_1 = __importStar(require("react"));
27
+ var react_focus_lock_1 = __importDefault(require("react-focus-lock"));
28
+ /**
29
+ * Traps the focus within the provided content. That is, tabbing with keyboard will
30
+ * only cycle through the children and won't leave the boundary of the FocusLock.
31
+ * This behavior enhances accessibility of the Modal component.
32
+ */
33
+ var FocusLock = function (props) {
34
+ var autoFocus = props.autoFocus, children = props.children, crossFrame = props.crossFrame, finalFocusRef = props.finalFocusRef, initialFocusRef = props.initialFocusRef, isDisabled = props.isDisabled, persistentFocus = props.persistentFocus, returnFocusProp = props.returnFocus;
35
+ var onActivation = react_1.default.useCallback(function () {
36
+ var _a;
37
+ (_a = initialFocusRef === null || initialFocusRef === void 0 ? void 0 : initialFocusRef.current) === null || _a === void 0 ? void 0 : _a.focus();
38
+ }, [initialFocusRef]);
39
+ var onDeactivation = (0, react_1.useCallback)(function () {
40
+ var _a;
41
+ (_a = finalFocusRef === null || finalFocusRef === void 0 ? void 0 : finalFocusRef.current) === null || _a === void 0 ? void 0 : _a.focus();
42
+ }, [finalFocusRef]);
43
+ var returnFocus = returnFocusProp && !finalFocusRef;
44
+ return (react_1.default.createElement(react_focus_lock_1.default, { autoFocus: autoFocus, crossFrame: crossFrame, disabled: isDisabled, onActivation: onActivation, onDeactivation: onDeactivation, persistentFocus: persistentFocus, returnFocus: returnFocus }, children));
45
+ };
46
+ exports.FocusLock = FocusLock;
47
+ exports.default = exports.FocusLock;
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ export declare type FocusableElement = {
3
+ focus(options?: FocusOptions): void;
4
+ };
5
+ export declare type FocusLockProps = {
6
+ /**
7
+ * The first focuable element within the 'children' will be auto-focused once 'FocusLock' mounts.
8
+ * @default true
9
+ */
10
+ autoFocus?: boolean;
11
+ /**
12
+ * Enables aggressive focus capturing within iframes.
13
+ * - 'true' keeps focus in the lock, no matter where the lock is active.
14
+ * - 'false' allows focus to move outside of iframe, if enabled inside iframe.
15
+ * @default true
16
+ */
17
+ crossFrame?: boolean;
18
+ /** 'ref' of the element to return focus to when FocusLock unmounts. */
19
+ finalFocusRef?: React.RefObject<FocusableElement>;
20
+ /** 'ref' of the element to receive focus initially when FocusLock mounts. */
21
+ initialFocusRef?: React.RefObject<FocusableElement>;
22
+ /** Disables focus trapping. */
23
+ isDisabled?: boolean;
24
+ /** Disables text selections inside, and outside focus lock. */
25
+ persistentFocus?: boolean;
26
+ /** Focus will be returned to the element that triggered the FocusLock once it unmounts. */
27
+ returnFocus?: boolean;
28
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export * from './context';
2
+ export * from './focusLock';
3
+ export * from './focusLock.types';
4
+ export * from './modal';
5
+ export { default as Modal } from './modal';
6
+ export * from './modal.types';
7
+ export * from './modalBackdrop';
8
+ export * from './modalContent';
9
+ export * from './modalManager';
package/modal/index.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.Modal = void 0;
17
+ __exportStar(require("./context"), exports);
18
+ __exportStar(require("./focusLock"), exports);
19
+ __exportStar(require("./focusLock.types"), exports);
20
+ __exportStar(require("./modal"), exports);
21
+ var modal_1 = require("./modal");
22
+ Object.defineProperty(exports, "Modal", { enumerable: true, get: function () { return __importDefault(modal_1).default; } });
23
+ __exportStar(require("./modal.types"), exports);
24
+ __exportStar(require("./modalBackdrop"), exports);
25
+ __exportStar(require("./modalContent"), exports);
26
+ __exportStar(require("./modalManager"), exports);
@@ -0,0 +1,15 @@
1
+ import { VuiComponent } from '../core';
2
+ import { ModalProps } from './modal.types';
3
+ import ModalBackdrop from './ModalBackdrop';
4
+ import ModalContent from './ModalContent';
5
+ /**
6
+ * Displays provided content on top of a dark backdrop element with fixed position.
7
+ * By default uses Portal for content and closes when clicking backdrop or pressing 'Escape'.
8
+ * Uses focus and scroll lock to achieve proper accessibility.
9
+ * More about accessibility: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/dialog_role
10
+ */
11
+ export declare const Modal: VuiComponent<"div", ModalProps> & {
12
+ Backdrop: typeof ModalBackdrop;
13
+ Content: typeof ModalContent;
14
+ };
15
+ export default Modal;