@uncinc/uncinc-react-kitchen-sink 2.20.8 → 2.20.10

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.
@@ -11,12 +11,15 @@ declare namespace Picture {
11
11
  namespace propTypes {
12
12
  let onLoad: PropTypes.Requireable<(...args: any[]) => any>;
13
13
  let alt: PropTypes.Requireable<string>;
14
+ let role: PropTypes.Requireable<string>;
14
15
  }
15
16
  namespace defaultProps {
16
17
  export function onLoad_1(): void;
17
18
  export { onLoad_1 as onLoad };
18
19
  let alt_1: null;
19
20
  export { alt_1 as alt };
21
+ let role_1: undefined;
22
+ export { role_1 as role };
20
23
  }
21
24
  }
22
25
  import React from 'react';
@@ -119,10 +119,12 @@ var Picture = function Picture(_ref) {
119
119
  };
120
120
  Picture.propTypes = {
121
121
  onLoad: PropTypes.func,
122
- alt: PropTypes.string
122
+ alt: PropTypes.string,
123
+ role: PropTypes.oneOf(['presentation', 'none'])
123
124
  };
124
125
  Picture.defaultProps = {
125
126
  onLoad: function onLoad() {},
126
- alt: null
127
+ alt: null,
128
+ role: undefined
127
129
  };
128
130
  export default Picture;
@@ -4,6 +4,7 @@ declare namespace Image {
4
4
  let propTypes: {
5
5
  onLoad: PropTypes.Requireable<(...args: any[]) => any>;
6
6
  alt: PropTypes.Requireable<string>;
7
+ role: PropTypes.Requireable<string>;
7
8
  src: PropTypes.Validator<{}>;
8
9
  lazyload: PropTypes.Requireable<boolean>;
9
10
  aspectRatio: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
@@ -1,11 +1,20 @@
1
1
  import { type RefObject } from 'react';
2
- export interface UseDialogHelpersOptions<T extends HTMLElement> {
2
+ export type UseDialogHelpersOptions<T extends HTMLElement> = {
3
3
  id?: string;
4
4
  wrapperElement: RefObject<T>;
5
5
  closeFunction: () => void;
6
6
  isOpen: boolean;
7
7
  disableClosers: boolean;
8
- }
8
+ } & ({
9
+ ariaLabel: string;
10
+ ariaLabelledBy?: never;
11
+ } | {
12
+ ariaLabel?: never;
13
+ ariaLabelledBy: string;
14
+ } | {
15
+ ariaLabel?: never;
16
+ ariaLabelledBy?: never;
17
+ });
9
18
  /**
10
19
  * Hook to allow you to implement your own Dialog component.
11
20
  * This takes care of focus, and closing the Dialog by
@@ -15,7 +24,8 @@ export default function useDialogHelpers<T extends HTMLElement>(options: UseDial
15
24
  readonly id: string;
16
25
  readonly labelId: string;
17
26
  readonly dialogHelpersProps: {
27
+ 'aria-labelledby'?: string | undefined;
28
+ 'aria-label'?: string | undefined;
18
29
  role: string;
19
- 'aria-labelledby': string;
20
30
  };
21
31
  };
@@ -1,3 +1,9 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
7
  import { useEffect } from 'react';
2
8
  import { v4 as uuidv4 } from 'uuid';
3
9
  import useClickOutside from './useClickOutside';
@@ -14,7 +20,9 @@ export default function useDialogHelpers(options) {
14
20
  wrapperElement = options.wrapperElement,
15
21
  closeFunction = options.closeFunction,
16
22
  isOpen = options.isOpen,
17
- disableClosers = options.disableClosers;
23
+ disableClosers = options.disableClosers,
24
+ ariaLabel = options.ariaLabel,
25
+ ariaLabelledBy = options.ariaLabelledBy;
18
26
 
19
27
  /**
20
28
  * Allows you to disable these two hooks.
@@ -72,10 +80,13 @@ export default function useDialogHelpers(options) {
72
80
  * Create a labelId for A11Y
73
81
  */
74
82
  var labelId = "".concat(id, "-label");
75
- var dialogHelpersProps = {
76
- role: 'dialog',
77
- 'aria-labelledby': labelId
78
- };
83
+ var dialogHelpersProps = _objectSpread(_objectSpread({
84
+ role: 'dialog'
85
+ }, ariaLabel && {
86
+ 'aria-label': ariaLabel
87
+ }), ariaLabelledBy && {
88
+ 'aria-labelledby': ariaLabelledBy
89
+ });
79
90
  return {
80
91
  id: id,
81
92
  labelId: labelId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uncinc/uncinc-react-kitchen-sink",
3
- "version": "2.20.8",
3
+ "version": "2.20.10",
4
4
  "description": "Default React components that are easily extended.",
5
5
  "author": "uncinc",
6
6
  "license": "MIT",