@splunk/react-ui 4.24.0 → 4.25.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 (38) hide show
  1. package/Button.js +8 -7
  2. package/ButtonSimple.js +40 -39
  3. package/CHANGELOG.md +11 -0
  4. package/Code.js +193 -100
  5. package/Color.js +18 -15
  6. package/JSONTree.js +1 -1
  7. package/Modal.js +55 -55
  8. package/RadioList.js +12 -11
  9. package/cypress/README.md +11 -0
  10. package/cypress/support/commands.ts +1 -0
  11. package/cypress/support/component.ts +0 -1
  12. package/cypress/tsconfig.cypress.json +14 -0
  13. package/package.json +12 -12
  14. package/types/src/Button/Button.d.ts +4 -2
  15. package/types/src/Button/docs/examples/Block.d.ts +2 -2
  16. package/types/src/Button/docs/examples/Dimmed.d.ts +2 -0
  17. package/types/src/Button/docs/examples/Disabled.d.ts +2 -2
  18. package/types/src/Button/docs/examples/Icons.d.ts +2 -2
  19. package/types/src/Button/docs/examples/Menus.d.ts +2 -2
  20. package/types/src/Button/docs/examples/To.d.ts +2 -2
  21. package/types/src/Button/docs/examples/Truncated.d.ts +2 -2
  22. package/types/src/Button/docs/examples/prisma/Basic.d.ts +2 -2
  23. package/types/src/Button/docs/examples/prisma/Block.d.ts +2 -2
  24. package/types/src/Button/docs/examples/prisma/Dimmed.d.ts +2 -0
  25. package/types/src/Button/docs/examples/prisma/Disabled.d.ts +2 -2
  26. package/types/src/Button/docs/examples/prisma/Menus.d.ts +2 -2
  27. package/types/src/Button/docs/examples/prisma/To.d.ts +2 -2
  28. package/types/src/Button/docs/examples/prisma/Truncated.d.ts +2 -2
  29. package/types/src/ButtonSimple/ButtonSimple.d.ts +4 -2
  30. package/types/src/Color/Color.d.ts +5 -3
  31. package/types/src/JSONTree/JSONTree.d.ts +1 -1
  32. package/types/src/Modal/Header.d.ts +0 -2
  33. package/types/src/Modal/Modal.d.ts +1 -0
  34. package/types/src/Modal/ModalContext.d.ts +1 -0
  35. package/types/src/RadioList/RadioList.d.ts +27 -27
  36. package/types/src/RadioList/RadioListContext.d.ts +5 -4
  37. package/types/unit-test-setup-testing-library.d.ts +1 -0
  38. package/types/src/Modal/docs/examples/prisma/TypicalUsage.d.ts +0 -2
@@ -58,7 +58,7 @@ interface JSONTreePropsBase {
58
58
  */
59
59
  overflow?: 'wrap' | 'scroll';
60
60
  /**
61
- * If set to `true`, using `shift + click` or `shift + enter` will expand or collapse all descendant nodes
61
+ * If set to `true`, using `shift + click` or `shift + enter` will expand all descendant nodes
62
62
  * of the tree at once. A tooltip is added to the expand all / collapse all button to indicate that this feature
63
63
  * is enabled.
64
64
  */
@@ -20,12 +20,10 @@ interface HeaderPropsBase {
20
20
  title?: string;
21
21
  /**
22
22
  * Used as the subheading. Only shown if `title` is also present.
23
- * @includeTheme prisma
24
23
  */
25
24
  subtitle?: React.ReactNode;
26
25
  /**
27
26
  * The icon to show before the title.
28
- * @includeTheme prisma
29
27
  */
30
28
  icon?: React.ReactNode;
31
29
  }
@@ -53,6 +53,7 @@ declare class Modal extends Component<ModalProps> {
53
53
  private initialFocusTimeoutId;
54
54
  private initialFocus;
55
55
  private headerTitleId;
56
+ private headerSubtitleId;
56
57
  static propTypes: React.WeakValidationMap<ClassComponentProps<ModalPropsBase, Required<Pick<ModalPropsBase, "open" | "divider" | "initialFocus">>, "div", never>>;
57
58
  static defaultProps: Required<Pick<ModalPropsBase, "open" | "divider" | "initialFocus">>;
58
59
  static Header: typeof Header;
@@ -2,6 +2,7 @@
2
2
  export interface ModalContext {
3
3
  divider?: 'header' | 'footer' | 'both' | 'none';
4
4
  titleId?: string;
5
+ subtitleId?: string;
5
6
  }
6
7
  export declare const ModalContext: import("react").Context<ModalContext>;
7
8
  export default ModalContext;
@@ -13,47 +13,47 @@ interface RadioListPropsBase {
13
13
  * `children` should be `RadioList.Option`s.
14
14
  */
15
15
  children?: React.ReactNode;
16
- disabled?: boolean;
17
- /** The name is returned with onChange events, which can be used to identify the
18
- * control when multiple controls share an onChange callback.
19
- * A randomly generated name is used if one is not provided. */
20
- name?: string;
21
- /** Changes the layout of the RadioList. */
22
- direction?: 'column' | 'row';
23
- /**
24
- * Highlight the field as having an error. The buttons and labels will turn red.
25
- */
26
- error?: boolean;
27
- /** The current selected value. Setting this value makes the property controlled. A
28
- * callback is required.
29
- */
30
- value?: RadioListValueTypes;
31
16
  /**
32
17
  * Set this property instead of value to make value uncontrolled.
33
18
  */
34
19
  defaultValue?: RadioListValueTypes;
20
+ /**
21
+ * When placed in a ControlGroup, this is automatically set to the ControlGroup's help component.
22
+ * @private
23
+ */
24
+ describedBy?: string;
25
+ /** Changes the layout of the RadioList. */
26
+ direction?: 'column' | 'row';
27
+ disabled?: boolean;
35
28
  /**
36
29
  * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
37
30
  */
38
31
  elementRef?: React.Ref<HTMLDivElement>;
39
32
  /**
40
- * A callback to receive the change events.
41
- * If value is set, this callback is required. This must set the value prop to retain the
42
- * change.
33
+ * Highlight the field as having an error. The buttons and labels will turn red.
43
34
  */
44
- onChange?: RadioListChangeHandler;
45
- /** @private. */
46
- required?: boolean;
35
+ error?: boolean;
47
36
  /**
48
37
  * When placed in a ControlGroup, this is automatically set to the ControlGroup's label.
49
38
  * @private
50
39
  */
51
40
  labelledBy?: string;
41
+ /** The name is returned with onChange events, which can be used to identify the
42
+ * control when multiple controls share an onChange callback.
43
+ * A randomly generated name is used if one is not provided. */
44
+ name?: string;
52
45
  /**
53
- * When placed in a ControlGroup, this is automatically set to the ControlGroup's help component.
54
- * @private
46
+ * A callback to receive the change events.
47
+ * If value is set, this callback is required. This must set the value prop to retain the
48
+ * change.
55
49
  */
56
- describedBy?: string;
50
+ onChange?: RadioListChangeHandler;
51
+ /** @private. */
52
+ required?: boolean;
53
+ /** The current selected value. Setting this value makes the property controlled. A
54
+ * callback is required.
55
+ */
56
+ value?: RadioListValueTypes;
57
57
  }
58
58
  interface RadioListPropsBaseControlled extends RadioListPropsBase {
59
59
  value: RadioListValueTypes;
@@ -69,19 +69,19 @@ declare type RadioListProps = ComponentProps<RadioListPropsBaseControlled | Radi
69
69
  declare function RadioList({ children, defaultValue: defaultValueProp, describedBy, direction, disabled, error, labelledBy, name: nameProp, onChange, required, value: valueProp, ...otherProps }: RadioListProps): JSX.Element;
70
70
  declare namespace RadioList {
71
71
  var propTypes: {
72
- direction: PropTypes.Requireable<string>;
73
72
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
74
73
  defaultValue: PropTypes.Requireable<any>;
74
+ describedBy: PropTypes.Requireable<string>;
75
+ direction: PropTypes.Requireable<string>;
75
76
  disabled: PropTypes.Requireable<boolean>;
76
77
  elementRef: PropTypes.Requireable<object>;
77
78
  error: PropTypes.Requireable<boolean>;
79
+ labelledBy: PropTypes.Requireable<string>;
78
80
  name: PropTypes.Requireable<string>;
79
81
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
80
82
  /** @private. */
81
83
  required: PropTypes.Requireable<boolean>;
82
84
  value: PropTypes.Requireable<any>;
83
- labelledBy: PropTypes.Requireable<string>;
84
- describedBy: PropTypes.Requireable<string>;
85
85
  };
86
86
  var Option: typeof import("./Option").default;
87
87
  }
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { RadioListChangeHandler, RadioListValueTypes } from './RadioList';
3
3
  export interface RadioListContext {
4
- value?: RadioListValueTypes;
5
- onChange?: RadioListChangeHandler;
6
- name?: string;
7
- error?: boolean;
8
4
  disabled?: boolean;
5
+ error?: boolean;
6
+ name?: string;
7
+ onChange?: RadioListChangeHandler;
8
+ required?: boolean;
9
+ value?: RadioListValueTypes;
9
10
  }
10
11
  export declare const RadioListContext: import("react").Context<RadioListContext>;
11
12
  export default RadioListContext;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -1,2 +0,0 @@
1
- declare function TypicalUsage(): JSX.Element;
2
- export default TypicalUsage;