@itwin/itwinui-react 3.0.0-dev.8 → 3.0.0-dev.9

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 (61) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/cjs/core/Buttons/DropdownButton/DropdownButton.js +7 -19
  3. package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +4 -4
  4. package/cjs/core/Buttons/SplitButton/SplitButton.js +53 -31
  5. package/cjs/core/ComboBox/ComboBox.d.ts +2 -2
  6. package/cjs/core/ComboBox/ComboBox.js +32 -24
  7. package/cjs/core/ComboBox/ComboBoxInput.js +29 -21
  8. package/cjs/core/ComboBox/ComboBoxMenu.js +73 -93
  9. package/cjs/core/ComboBox/helpers.d.ts +4 -1
  10. package/cjs/core/DropdownMenu/DropdownMenu.d.ts +6 -5
  11. package/cjs/core/DropdownMenu/DropdownMenu.js +59 -55
  12. package/cjs/core/Header/HeaderDropdownButton.js +1 -2
  13. package/cjs/core/Header/HeaderSplitButton.js +1 -2
  14. package/cjs/core/Menu/Menu.js +1 -1
  15. package/cjs/core/Menu/MenuItem.js +77 -55
  16. package/cjs/core/Select/Select.d.ts +5 -5
  17. package/cjs/core/Select/Select.js +74 -93
  18. package/cjs/core/Table/columns/actionColumn.js +3 -7
  19. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +36 -41
  20. package/cjs/core/Table/filters/FilterToggle.js +3 -2
  21. package/cjs/core/Tile/Tile.js +21 -22
  22. package/cjs/core/index.d.ts +1 -1
  23. package/cjs/core/index.js +8 -1
  24. package/cjs/core/utils/components/InputContainer.d.ts +4 -4
  25. package/cjs/core/utils/components/InputContainer.js +7 -3
  26. package/cjs/core/utils/components/Popover.d.ts +113 -27
  27. package/cjs/core/utils/components/Popover.js +156 -118
  28. package/cjs/styles.js +2 -5
  29. package/esm/core/Buttons/DropdownButton/DropdownButton.js +8 -24
  30. package/esm/core/Buttons/SplitButton/SplitButton.d.ts +4 -4
  31. package/esm/core/Buttons/SplitButton/SplitButton.js +53 -28
  32. package/esm/core/ComboBox/ComboBox.d.ts +2 -2
  33. package/esm/core/ComboBox/ComboBox.js +33 -24
  34. package/esm/core/ComboBox/ComboBoxInput.js +22 -21
  35. package/esm/core/ComboBox/ComboBoxMenu.js +67 -87
  36. package/esm/core/ComboBox/helpers.d.ts +4 -1
  37. package/esm/core/DropdownMenu/DropdownMenu.d.ts +6 -5
  38. package/esm/core/DropdownMenu/DropdownMenu.js +64 -56
  39. package/esm/core/Header/HeaderDropdownButton.js +1 -2
  40. package/esm/core/Header/HeaderSplitButton.js +1 -2
  41. package/esm/core/Menu/Menu.js +7 -2
  42. package/esm/core/Menu/MenuItem.js +84 -52
  43. package/esm/core/Select/Select.d.ts +5 -5
  44. package/esm/core/Select/Select.js +74 -90
  45. package/esm/core/Table/columns/actionColumn.js +3 -7
  46. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +36 -41
  47. package/esm/core/Table/filters/FilterToggle.js +3 -2
  48. package/esm/core/Tile/Tile.js +21 -22
  49. package/esm/core/index.d.ts +1 -1
  50. package/esm/core/index.js +1 -0
  51. package/esm/core/utils/components/InputContainer.d.ts +4 -4
  52. package/esm/core/utils/components/InputContainer.js +7 -2
  53. package/esm/core/utils/components/Popover.d.ts +113 -27
  54. package/esm/core/utils/components/Popover.js +175 -118
  55. package/esm/styles.js +2 -5
  56. package/package.json +2 -4
  57. package/styles.css +3 -3
  58. package/cjs/core/ComboBox/ComboBoxDropdown.d.ts +0 -7
  59. package/cjs/core/ComboBox/ComboBoxDropdown.js +0 -43
  60. package/esm/core/ComboBox/ComboBoxDropdown.d.ts +0 -7
  61. package/esm/core/ComboBox/ComboBoxDropdown.js +0 -37
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import type { PopoverProps, PolymorphicForwardRefComponent } from '../utils/index.js';
3
- type ComboBoxDropdownProps = PopoverProps & {
4
- children: JSX.Element;
5
- };
6
- export declare const ComboBoxDropdown: PolymorphicForwardRefComponent<"div", ComboBoxDropdownProps>;
7
- export {};
@@ -1,43 +0,0 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
3
- exports.ComboBoxDropdown = void 0;
4
- const tslib_1 = require('tslib');
5
- /*---------------------------------------------------------------------------------------------
6
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
7
- * See LICENSE.md in the project root for license terms and full copyright notice.
8
- *--------------------------------------------------------------------------------------------*/
9
- const React = tslib_1.__importStar(require('react'));
10
- const index_js_1 = require('../utils/index.js');
11
- const helpers_js_1 = require('./helpers.js');
12
- exports.ComboBoxDropdown = React.forwardRef((props, forwardedRef) => {
13
- const { children, ...rest } = props;
14
- const { isOpen } = (0, index_js_1.useSafeContext)(
15
- helpers_js_1.ComboBoxStateContext,
16
- );
17
- const dispatch = (0, index_js_1.useSafeContext)(
18
- helpers_js_1.ComboBoxActionContext,
19
- );
20
- const { inputRef } = (0, index_js_1.useSafeContext)(
21
- helpers_js_1.ComboBoxRefsContext,
22
- );
23
- // sync internal isOpen state with user's visible prop
24
- React.useEffect(() => {
25
- if (props.visible != undefined) {
26
- dispatch({ type: props.visible ? 'open' : 'close' });
27
- }
28
- }, [dispatch, props.visible]);
29
- return React.createElement(index_js_1.Popover, {
30
- placement: 'bottom-start',
31
- visible: isOpen,
32
- onClickOutside: React.useCallback(() => {
33
- dispatch({ type: 'close' });
34
- }, [dispatch]),
35
- animation: 'shift-away',
36
- duration: 200,
37
- reference: inputRef,
38
- ref: forwardedRef,
39
- content: children,
40
- ...rest,
41
- });
42
- });
43
- exports.ComboBoxDropdown.displayName = 'ComboBoxDropdown';
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- import type { PopoverProps, PolymorphicForwardRefComponent } from '../utils/index.js';
3
- type ComboBoxDropdownProps = PopoverProps & {
4
- children: JSX.Element;
5
- };
6
- export declare const ComboBoxDropdown: PolymorphicForwardRefComponent<"div", ComboBoxDropdownProps>;
7
- export {};
@@ -1,37 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- import * as React from 'react';
6
- import { Popover, useSafeContext } from '../utils/index.js';
7
- import {
8
- ComboBoxStateContext,
9
- ComboBoxActionContext,
10
- ComboBoxRefsContext,
11
- } from './helpers.js';
12
- export const ComboBoxDropdown = React.forwardRef((props, forwardedRef) => {
13
- const { children, ...rest } = props;
14
- const { isOpen } = useSafeContext(ComboBoxStateContext);
15
- const dispatch = useSafeContext(ComboBoxActionContext);
16
- const { inputRef } = useSafeContext(ComboBoxRefsContext);
17
- // sync internal isOpen state with user's visible prop
18
- React.useEffect(() => {
19
- if (props.visible != undefined) {
20
- dispatch({ type: props.visible ? 'open' : 'close' });
21
- }
22
- }, [dispatch, props.visible]);
23
- return React.createElement(Popover, {
24
- placement: 'bottom-start',
25
- visible: isOpen,
26
- onClickOutside: React.useCallback(() => {
27
- dispatch({ type: 'close' });
28
- }, [dispatch]),
29
- animation: 'shift-away',
30
- duration: 200,
31
- reference: inputRef,
32
- ref: forwardedRef,
33
- content: children,
34
- ...rest,
35
- });
36
- });
37
- ComboBoxDropdown.displayName = 'ComboBoxDropdown';