@splunk/react-ui 4.16.3 → 4.17.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.
- package/Accordion.js +13 -13
- package/Anchor.js +2 -2
- package/Animation.js +4 -4
- package/AnimationToggle.js +2 -2
- package/Box.js +2 -2
- package/Button.js +98 -244
- package/ButtonGroup.js +4 -4
- package/ButtonSimple.js +6 -6
- package/CHANGELOG.md +43 -2
- package/Calendar.js +73 -274
- package/Card.js +75 -227
- package/CardLayout.js +2 -2
- package/Chip.js +40 -211
- package/Clickable.js +10 -10
- package/CloseButton.js +34 -202
- package/Code.js +27 -20
- package/CollapsiblePanel.js +74 -228
- package/Color.js +62 -319
- package/ColumnLayout.js +6 -6
- package/ComboBox.js +32 -32
- package/Concertina.js +38 -38
- package/ControlGroup.js +20 -20
- package/Date.js +22 -22
- package/DefinitionList.js +2 -2
- package/Divider.js +2 -2
- package/Dropdown.js +29 -29
- package/DualListbox.d.ts +2 -0
- package/DualListbox.js +1780 -0
- package/EventListener.js +4 -4
- package/File.js +85 -250
- package/FormRows.js +60 -215
- package/Heading.js +39 -27
- package/Image.js +73 -227
- package/JSONTree.js +18 -18
- package/Layer.js +30 -30
- package/Link.js +60 -28
- package/List.js +9 -9
- package/MIGRATION.md +28 -0
- package/Markdown.js +21 -21
- package/Menu.js +180 -371
- package/Message.js +137 -407
- package/MessageBar.js +168 -398
- package/Modal.js +31 -31
- package/ModalLayer.js +6 -6
- package/Monogram.js +4 -4
- package/Multiselect.js +2297 -2525
- package/Number.js +32 -32
- package/Paginator.js +92 -321
- package/Paragraph.js +2 -2
- package/Popover.js +123 -123
- package/Progress.js +15 -15
- package/RadioBar.js +23 -19
- package/RadioList.js +13 -12
- package/Resize.js +18 -18
- package/ResultsMenu.js +21 -21
- package/ScreenReaderContent.js +2 -2
- package/Scroll.js +33 -33
- package/ScrollContainerContext.js +13 -13
- package/Search.js +34 -32
- package/Select.js +220 -367
- package/SidePanel.js +12 -12
- package/Slider.js +28 -28
- package/SlidingPanels.js +29 -29
- package/SplitButton.js +59 -62
- package/StaticContent.js +4 -4
- package/StepBar.js +35 -238
- package/Switch.js +23 -23
- package/TabBar.js +30 -44
- package/TabLayout.js +30 -28
- package/Table.js +292 -586
- package/Text.js +109 -322
- package/TextArea.js +160 -366
- package/Tooltip.js +23 -23
- package/TransitionOpen.js +21 -21
- package/Typography.js +32 -28
- package/WaitSpinner.js +2 -2
- package/docker-compose.yml +19 -7
- package/package.json +10 -11
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/Button/icons/CaretSmallDown.d.ts +2 -0
- package/types/src/Button/icons/External.d.ts +2 -0
- package/types/src/Code/Code.d.ts +6 -1
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +0 -1
- package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +11 -0
- package/types/src/Date/Icon.d.ts +1 -1
- package/types/src/Dropdown/docs/examples/Submenu.d.ts +2 -0
- package/types/src/DualListbox/DualListbox.d.ts +87 -0
- package/types/src/DualListbox/DualListboxContext.d.ts +27 -0
- package/types/src/DualListbox/Label.d.ts +37 -0
- package/types/src/DualListbox/Listbox.d.ts +54 -0
- package/types/src/DualListbox/ListboxContext.d.ts +32 -0
- package/types/src/DualListbox/Option.d.ts +35 -0
- package/types/src/DualListbox/ScreenReaderWrapper.d.ts +4 -0
- package/types/src/DualListbox/ToolbarButton.d.ts +38 -0
- package/types/src/DualListbox/ToolbarContext.d.ts +21 -0
- package/types/src/DualListbox/docs/examples/Basic.d.ts +2 -0
- package/types/src/DualListbox/docs/examples/Controlled.d.ts +2 -0
- package/types/src/DualListbox/docs/examples/Fill.d.ts +2 -0
- package/types/src/DualListbox/index.d.ts +2 -0
- package/types/src/DualListbox/listboxUtils.d.ts +4 -0
- package/types/src/File/Icon.d.ts +1 -1
- package/types/src/File/IconCloud.d.ts +1 -1
- package/types/src/File/PaperClip.d.ts +1 -1
- package/types/src/File/Retry.d.ts +1 -1
- package/types/src/File/Trash.d.ts +1 -1
- package/types/src/File/docs/examples/Progress.d.ts +1 -15
- package/types/src/FormRows/icons/FormRowsPlusIcon.d.ts +2 -0
- package/types/src/Heading/Heading.d.ts +12 -4
- package/types/src/Heading/docs/examples/Variant.d.ts +2 -0
- package/types/src/Image/Image.d.ts +1 -1
- package/types/src/Image/icons/Cross.d.ts +2 -0
- package/types/src/Link/icons/External.d.ts +2 -0
- package/types/src/Menu/Divider.d.ts +1 -0
- package/types/src/Menu/Heading.d.ts +1 -0
- package/types/src/Menu/Item.d.ts +5 -2
- package/types/src/Menu/Menu.d.ts +3 -1
- package/types/src/Menu/icons/External.d.ts +2 -0
- package/types/src/Number/IncrementIcon.d.ts +1 -1
- package/types/src/RadioBar/RadioBar.d.ts +1 -1
- package/types/src/Search/Option.d.ts +9 -0
- package/types/src/Select/OptionBase.d.ts +9 -0
- package/types/src/Select/icons/CaretSmallDown.d.ts +2 -0
- package/types/src/Select/icons/Search.d.ts +2 -0
- package/types/src/SplitButton/SplitButton.d.ts +8 -3
- package/types/src/SplitButton/docs/examples/Block.d.ts +1 -0
- package/types/src/TabLayout/TabLayout.d.ts +0 -1
- package/types/src/Table/HeadInner.d.ts +2 -2
- package/types/src/Table/icons/ExpansionRow.d.ts +6 -0
- package/types/src/Table/icons/HeadExpandRows.d.ts +1 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -1
- package/types/src/Text/IconOutlinedView.d.ts +1 -1
- package/types/src/Tooltip/InfoIcon.d.ts +1 -1
- package/types/src/Typography/Typography.d.ts +4 -7
- package/types/src/useRovingFocus/index.d.ts +2 -0
- package/types/src/useRovingFocus/useRovingFocus.d.ts +27 -0
- package/useForceUpdate.js +2 -2
- package/useKeyPress.js +2 -2
- package/usePrevious.js +2 -2
- package/useRovingFocus.d.ts +2 -0
- package/useRovingFocus.js +237 -0
- package/Dockerfile.enterprise.storybook +0 -7
- package/Dockerfile.prisma.storybook +0 -7
- package/Dockerfile.visual +0 -10
- package/types/src/File/docs/examples/CustomChildren.d.ts +0 -12
- package/types/src/File/docs/examples/prisma/Progress.d.ts +0 -1
- package/types/src/Select/matchUtils.d.ts +0 -12
- package/types/src/SplitButton/docs/examples/prisma/Basic.d.ts +0 -1
- package/types/src/SplitButton/docs/examples/prisma/Disabled.d.ts +0 -1
- package/types/src/Table/HeadExpandRowsIcon.d.ts +0 -1
- package/types/src/icons/Alert.d.ts +0 -2
- package/types/src/icons/AlertFilled.d.ts +0 -2
- package/types/src/icons/CaretDown.d.ts +0 -2
- package/types/src/icons/CaretRight.d.ts +0 -2
- package/types/src/icons/Check.d.ts +0 -2
- package/types/src/icons/ChevronDown.d.ts +0 -2
- package/types/src/icons/ChevronLeft.d.ts +0 -2
- package/types/src/icons/ChevronRight.d.ts +0 -2
- package/types/src/icons/CrossMark.d.ts +0 -2
- package/types/src/icons/External.d.ts +0 -2
- package/types/src/icons/InfoFilled.d.ts +0 -2
- package/types/src/icons/More.d.ts +0 -2
- package/types/src/icons/MoreVertical.d.ts +0 -2
- package/types/src/icons/Plus.d.ts +0 -2
- package/types/src/icons/SVG.d.ts +0 -4
- package/types/src/icons/Search.d.ts +0 -2
- package/types/src/icons/Sort.d.ts +0 -2
- package/types/src/icons/SortedDown.d.ts +0 -2
- package/types/src/icons/SortedUp.d.ts +0 -2
- package/types/src/icons/Success.d.ts +0 -2
- package/types/src/icons/SuccessFilled.d.ts +0 -2
- package/types/src/icons/ThemedIcon.d.ts +0 -29
- package/types/src/icons/WarningFilled.d.ts +0 -2
- package/types/src/icons/types.d.ts +0 -11
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface ExpansionRowIconProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
expanded?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const StyledExpansionRowIcon: import("styled-components").StyledComponent<({ className, expanded }: ExpansionRowIconProps) => JSX.Element, any, {}, never>;
|
|
6
|
+
export default StyledExpansionRowIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function HeadExpandRows(): JSX.Element;
|
|
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { TypographyVariant, TypographyParams } from '@splunk/themes/mixins';
|
|
4
4
|
import { ComponentProps } from '../utils/types';
|
|
5
5
|
declare type TypographyElementTypes = 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'blockquote' | 'dd' | 'dl' | 'dt' | 'figcaption' | 'figure' | 'li' | 'ol' | 'ul' | 'pre' | 'abbr' | 'cite' | 'code' | 'data' | 'dfn' | 'em' | 'u' | 'time' | 'sup' | 'sub' | 'strong' | 'small' | 'samp' | 's' | 'var' | 'ruby' | 'rt' | 'rp';
|
|
6
|
-
|
|
6
|
+
declare type DeprecatedTypographyWeightValues = 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
7
|
+
interface TypographyPropsBase extends Omit<TypographyParams, 'weight'> {
|
|
7
8
|
/**
|
|
8
9
|
* Text and inline icons
|
|
9
10
|
* */
|
|
@@ -46,20 +47,17 @@ interface TypographyPropsBase extends TypographyParams {
|
|
|
46
47
|
* Number or equivalent string can be used.
|
|
47
48
|
* See: [font-weight | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
|
|
48
49
|
*/
|
|
49
|
-
weight?:
|
|
50
|
+
weight?: DeprecatedTypographyWeightValues | 'light' | 'normal' | 'semiBold' | 'bold' | 'extraBold' | 'heavy';
|
|
50
51
|
/**
|
|
51
52
|
* Apply a reset to the element's margin and padding. This defaults to true if using a `variant`.
|
|
52
53
|
*/
|
|
53
54
|
withReset?: boolean;
|
|
54
55
|
}
|
|
55
56
|
declare type TypographyProps = ComponentProps<TypographyPropsBase, TypographyElementTypes>;
|
|
56
|
-
declare type AllTypographyParams = {
|
|
57
|
-
[P in keyof TypographyParams]-?: boolean;
|
|
58
|
-
};
|
|
59
57
|
/**
|
|
60
58
|
* Typography renders text content with styling based on the Splunk Design System.
|
|
61
59
|
*/
|
|
62
|
-
export declare function Typography({ children, as, elementRef, ...otherProps }: TypographyProps): JSX.Element;
|
|
60
|
+
export declare function Typography({ children, as, elementRef, variant, family, size, lineHeight, color, weight, withReset, ...otherProps }: TypographyProps): JSX.Element;
|
|
63
61
|
export declare namespace Typography {
|
|
64
62
|
var propTypes: {
|
|
65
63
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
@@ -75,4 +73,3 @@ export declare namespace Typography {
|
|
|
75
73
|
};
|
|
76
74
|
}
|
|
77
75
|
export default Typography;
|
|
78
|
-
export { AllTypographyParams };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a private hook not intended for use outside @splunk/react-ui
|
|
3
|
+
*
|
|
4
|
+
* Handles "roving focus" for a group of elements inside a containing element.
|
|
5
|
+
* Elements inside the element that "rovingFocusProps" are set on will act a single tab stop
|
|
6
|
+
* with arrow keys moving focus between them.
|
|
7
|
+
* See https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets#managing_focus_inside_groups
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* import React from 'react';
|
|
11
|
+
* import useRovingFocus from '@splunk/react-ui/useRovingFocus';
|
|
12
|
+
*
|
|
13
|
+
* const rovingFocusProps = useRovingFocus();
|
|
14
|
+
*
|
|
15
|
+
* <div {...rovingFocusProps}>
|
|
16
|
+
* <button type="button">first</button>
|
|
17
|
+
* <button type="button">second</button>
|
|
18
|
+
* </div>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function useRovingFocus(): {
|
|
22
|
+
ref: (element: HTMLDivElement | null) => void;
|
|
23
|
+
onBlur: (e: React.FocusEvent) => void;
|
|
24
|
+
onFocus: (e: React.FocusEvent) => void;
|
|
25
|
+
onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
26
|
+
};
|
|
27
|
+
export default useRovingFocus;
|
package/useForceUpdate.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 241);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -94,7 +94,7 @@ module.exports = require("react");
|
|
|
94
94
|
|
|
95
95
|
/***/ }),
|
|
96
96
|
|
|
97
|
-
/***/
|
|
97
|
+
/***/ 241:
|
|
98
98
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
99
|
|
|
100
100
|
"use strict";
|
package/useKeyPress.js
CHANGED
|
@@ -82,12 +82,12 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 167);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
89
89
|
|
|
90
|
-
/***/
|
|
90
|
+
/***/ 167:
|
|
91
91
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
92
92
|
|
|
93
93
|
"use strict";
|
package/usePrevious.js
CHANGED
|
@@ -82,7 +82,7 @@ module.exports =
|
|
|
82
82
|
/******/
|
|
83
83
|
/******/
|
|
84
84
|
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 242);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -94,7 +94,7 @@ module.exports = require("react");
|
|
|
94
94
|
|
|
95
95
|
/***/ }),
|
|
96
96
|
|
|
97
|
-
/***/
|
|
97
|
+
/***/ 242:
|
|
98
98
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
99
|
|
|
100
100
|
"use strict";
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
module.exports =
|
|
2
|
+
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
+
/******/ // The module cache
|
|
4
|
+
/******/ var installedModules = {};
|
|
5
|
+
/******/
|
|
6
|
+
/******/ // The require function
|
|
7
|
+
/******/ function __webpack_require__(moduleId) {
|
|
8
|
+
/******/
|
|
9
|
+
/******/ // Check if module is in cache
|
|
10
|
+
/******/ if(installedModules[moduleId]) {
|
|
11
|
+
/******/ return installedModules[moduleId].exports;
|
|
12
|
+
/******/ }
|
|
13
|
+
/******/ // Create a new module (and put it into the cache)
|
|
14
|
+
/******/ var module = installedModules[moduleId] = {
|
|
15
|
+
/******/ i: moduleId,
|
|
16
|
+
/******/ l: false,
|
|
17
|
+
/******/ exports: {}
|
|
18
|
+
/******/ };
|
|
19
|
+
/******/
|
|
20
|
+
/******/ // Execute the module function
|
|
21
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
+
/******/
|
|
23
|
+
/******/ // Flag the module as loaded
|
|
24
|
+
/******/ module.l = true;
|
|
25
|
+
/******/
|
|
26
|
+
/******/ // Return the exports of the module
|
|
27
|
+
/******/ return module.exports;
|
|
28
|
+
/******/ }
|
|
29
|
+
/******/
|
|
30
|
+
/******/
|
|
31
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
+
/******/ __webpack_require__.m = modules;
|
|
33
|
+
/******/
|
|
34
|
+
/******/ // expose the module cache
|
|
35
|
+
/******/ __webpack_require__.c = installedModules;
|
|
36
|
+
/******/
|
|
37
|
+
/******/ // define getter function for harmony exports
|
|
38
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
+
/******/ }
|
|
42
|
+
/******/ };
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // define __esModule on exports
|
|
45
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
+
/******/ }
|
|
49
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
+
/******/ };
|
|
51
|
+
/******/
|
|
52
|
+
/******/ // create a fake namespace object
|
|
53
|
+
/******/ // mode & 1: value is a module id, require it
|
|
54
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
+
/******/ // mode & 4: return value when already ns object
|
|
56
|
+
/******/ // mode & 8|1: behave like require
|
|
57
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
+
/******/ if(mode & 8) return value;
|
|
60
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
+
/******/ var ns = Object.create(null);
|
|
62
|
+
/******/ __webpack_require__.r(ns);
|
|
63
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
+
/******/ return ns;
|
|
66
|
+
/******/ };
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
+
/******/ __webpack_require__.n = function(module) {
|
|
70
|
+
/******/ var getter = module && module.__esModule ?
|
|
71
|
+
/******/ function getDefault() { return module['default']; } :
|
|
72
|
+
/******/ function getModuleExports() { return module; };
|
|
73
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
+
/******/ return getter;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
+
/******/
|
|
80
|
+
/******/ // __webpack_public_path__
|
|
81
|
+
/******/ __webpack_require__.p = "";
|
|
82
|
+
/******/
|
|
83
|
+
/******/
|
|
84
|
+
/******/ // Load entry module and return exports
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 243);
|
|
86
|
+
/******/ })
|
|
87
|
+
/************************************************************************/
|
|
88
|
+
/******/ ({
|
|
89
|
+
|
|
90
|
+
/***/ 2:
|
|
91
|
+
/***/ (function(module, exports) {
|
|
92
|
+
|
|
93
|
+
module.exports = require("react");
|
|
94
|
+
|
|
95
|
+
/***/ }),
|
|
96
|
+
|
|
97
|
+
/***/ 243:
|
|
98
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
99
|
+
|
|
100
|
+
"use strict";
|
|
101
|
+
// ESM COMPAT FLAG
|
|
102
|
+
__webpack_require__.r(__webpack_exports__);
|
|
103
|
+
|
|
104
|
+
// EXPORTS
|
|
105
|
+
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ useRovingFocus_useRovingFocus; });
|
|
106
|
+
|
|
107
|
+
// EXTERNAL MODULE: external "react"
|
|
108
|
+
var external_react_ = __webpack_require__(2);
|
|
109
|
+
|
|
110
|
+
// EXTERNAL MODULE: external "@splunk/ui-utils/focus"
|
|
111
|
+
var focus_ = __webpack_require__(29);
|
|
112
|
+
|
|
113
|
+
// EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
|
|
114
|
+
var keyboard_ = __webpack_require__(7);
|
|
115
|
+
|
|
116
|
+
// CONCATENATED MODULE: ./src/useRovingFocus/useRovingFocus.tsx
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
function focusElement(element) {
|
|
122
|
+
if (element instanceof HTMLElement && element.focus) {
|
|
123
|
+
element.focus();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* This is a private hook not intended for use outside @splunk/react-ui
|
|
128
|
+
*
|
|
129
|
+
* Handles "roving focus" for a group of elements inside a containing element.
|
|
130
|
+
* Elements inside the element that "rovingFocusProps" are set on will act a single tab stop
|
|
131
|
+
* with arrow keys moving focus between them.
|
|
132
|
+
* See https://developer.mozilla.org/en-US/docs/Web/Accessibility/Keyboard-navigable_JavaScript_widgets#managing_focus_inside_groups
|
|
133
|
+
*
|
|
134
|
+
* ```
|
|
135
|
+
* import React from 'react';
|
|
136
|
+
* import useRovingFocus from '@splunk/react-ui/useRovingFocus';
|
|
137
|
+
*
|
|
138
|
+
* const rovingFocusProps = useRovingFocus();
|
|
139
|
+
*
|
|
140
|
+
* <div {...rovingFocusProps}>
|
|
141
|
+
* <button type="button">first</button>
|
|
142
|
+
* <button type="button">second</button>
|
|
143
|
+
* </div>
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
function useRovingFocus() {
|
|
149
|
+
var activeItemIndex = Object(external_react_["useRef"])(0);
|
|
150
|
+
var actionItemsRef = Object(external_react_["useRef"])([]);
|
|
151
|
+
|
|
152
|
+
var updateActiveItem = function updateActiveItem(newActiveindex) {
|
|
153
|
+
activeItemIndex.current = newActiveindex;
|
|
154
|
+
actionItemsRef.current.forEach(function (el, index) {
|
|
155
|
+
return index === activeItemIndex.current ? el.removeAttribute('tabindex') : el.setAttribute('tabindex', '-1');
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
var handleItemsMount = function handleItemsMount(element) {
|
|
160
|
+
actionItemsRef.current = element != null ? Object(focus_["getSortedTabbableElements"])(element, {
|
|
161
|
+
ignoreTabIndex: true
|
|
162
|
+
}) : [];
|
|
163
|
+
updateActiveItem(activeItemIndex.current);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
var handleBlur = function handleBlur(e) {
|
|
167
|
+
var focusOnActionItem = e.relatedTarget instanceof Element && actionItemsRef.current.includes(e.relatedTarget);
|
|
168
|
+
|
|
169
|
+
if (!focusOnActionItem) {
|
|
170
|
+
updateActiveItem(0);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
var handleFocus = function handleFocus(e) {
|
|
175
|
+
var focusIndex = e.target instanceof Element ? actionItemsRef.current.indexOf(e.target) : -1;
|
|
176
|
+
|
|
177
|
+
if (focusIndex >= 0) {
|
|
178
|
+
updateActiveItem(focusIndex);
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
183
|
+
if (e.nativeEvent.target instanceof HTMLElement) {
|
|
184
|
+
var index = actionItemsRef.current.indexOf(e.nativeEvent.target);
|
|
185
|
+
|
|
186
|
+
if (index >= 0) {
|
|
187
|
+
var key = Object(keyboard_["keycode"])(e.nativeEvent);
|
|
188
|
+
var newIndex = -1;
|
|
189
|
+
|
|
190
|
+
if (key === 'left') {
|
|
191
|
+
newIndex = index - 1;
|
|
192
|
+
} else if (key === 'right') {
|
|
193
|
+
newIndex = index + 1;
|
|
194
|
+
} else if (key === 'home') {
|
|
195
|
+
newIndex = 0;
|
|
196
|
+
} else if (key === 'end') {
|
|
197
|
+
newIndex = actionItemsRef.current.length - 1;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (newIndex >= 0) {
|
|
201
|
+
e.preventDefault();
|
|
202
|
+
focusElement(actionItemsRef.current[newIndex]);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
return {
|
|
209
|
+
ref: handleItemsMount,
|
|
210
|
+
onBlur: handleBlur,
|
|
211
|
+
onFocus: handleFocus,
|
|
212
|
+
onKeyDown: handleKeyDown
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* harmony default export */ var useRovingFocus_useRovingFocus = (useRovingFocus);
|
|
217
|
+
// CONCATENATED MODULE: ./src/useRovingFocus/index.ts
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
/***/ }),
|
|
222
|
+
|
|
223
|
+
/***/ 29:
|
|
224
|
+
/***/ (function(module, exports) {
|
|
225
|
+
|
|
226
|
+
module.exports = require("@splunk/ui-utils/focus");
|
|
227
|
+
|
|
228
|
+
/***/ }),
|
|
229
|
+
|
|
230
|
+
/***/ 7:
|
|
231
|
+
/***/ (function(module, exports) {
|
|
232
|
+
|
|
233
|
+
module.exports = require("@splunk/ui-utils/keyboard");
|
|
234
|
+
|
|
235
|
+
/***/ })
|
|
236
|
+
|
|
237
|
+
/******/ });
|
package/Dockerfile.visual
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
2
|
-
import { FileRequestAddHandler } from '@splunk/react-ui/File';
|
|
3
|
-
declare class CustomChildren extends Component<{}, {
|
|
4
|
-
filename?: string;
|
|
5
|
-
}> {
|
|
6
|
-
private fileReader;
|
|
7
|
-
constructor(props: {});
|
|
8
|
-
handleAddFiles: FileRequestAddHandler;
|
|
9
|
-
handleRemoveFile: () => void;
|
|
10
|
-
render(): JSX.Element;
|
|
11
|
-
}
|
|
12
|
-
export default CustomChildren;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Progress(): JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface MatchCharacter {
|
|
2
|
-
index: number;
|
|
3
|
-
value: string;
|
|
4
|
-
}
|
|
5
|
-
export interface MatchOption {
|
|
6
|
-
itemKey: string;
|
|
7
|
-
label: string;
|
|
8
|
-
value: string | number | boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const charFromMatchOption: (option: MatchOption | null, charIndex: number) => string;
|
|
11
|
-
declare const fuzzyMatch: (options: MatchOption[], matchChar: MatchCharacter) => MatchOption[];
|
|
12
|
-
export { charFromMatchOption, fuzzyMatch };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Basic(): JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function Disabled(): JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function HeadExpandRowsIcon(): JSX.Element;
|
package/types/src/icons/SVG.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { IconProps } from './types';
|
|
4
|
-
interface ThemedIconProps extends IconProps {
|
|
5
|
-
Enterprise: React.FunctionComponent<any>;
|
|
6
|
-
Prisma24: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
7
|
-
Prisma20?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
8
|
-
Prisma16?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
9
|
-
}
|
|
10
|
-
declare function Icon({ Enterprise, Prisma24, Prisma20, Prisma16, prismaSize, inline, enterpriseSize, enterpriseWidth, enterpriseHeight, screenReaderText, ...otherProps }: ThemedIconProps): JSX.Element;
|
|
11
|
-
declare namespace Icon {
|
|
12
|
-
var propTypes: {
|
|
13
|
-
Enterprise: PropTypes.Requireable<(...args: any[]) => any>;
|
|
14
|
-
enterpriseSize: PropTypes.Requireable<React.ReactText>;
|
|
15
|
-
enterpriseWidth: PropTypes.Requireable<React.ReactText>;
|
|
16
|
-
enterpriseHeight: PropTypes.Requireable<React.ReactText>;
|
|
17
|
-
Prisma24: PropTypes.Validator<(...args: any[]) => any>;
|
|
18
|
-
Prisma20: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
-
Prisma16: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
|
-
prismaSize: PropTypes.Requireable<string>;
|
|
21
|
-
inline: PropTypes.Requireable<boolean>;
|
|
22
|
-
screenReaderText: PropTypes.Requireable<string>;
|
|
23
|
-
};
|
|
24
|
-
var defaultProps: {
|
|
25
|
-
inline: boolean;
|
|
26
|
-
prismaSize: string;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export default Icon;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from '../utils/types';
|
|
2
|
-
interface IconPropsBase {
|
|
3
|
-
enterpriseSize?: number | string;
|
|
4
|
-
enterpriseWidth?: number | string;
|
|
5
|
-
enterpriseHeight?: number | string;
|
|
6
|
-
prismaSize?: 'medium' | 'small';
|
|
7
|
-
inline?: boolean;
|
|
8
|
-
screenReaderText?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare type IconProps = ComponentProps<IconPropsBase, 'svg'>;
|
|
11
|
-
export {};
|