@itwin/itwinui-react 1.24.0 → 1.27.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 (130) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/cjs/core/Buttons/Button/Button.d.ts +1 -1
  3. package/cjs/core/Buttons/Button/Button.js +4 -5
  4. package/cjs/core/Buttons/IconButton/IconButton.js +2 -3
  5. package/cjs/core/Checkbox/Checkbox.d.ts +11 -0
  6. package/cjs/core/Checkbox/Checkbox.js +14 -4
  7. package/cjs/core/ColorPicker/ColorBuilder.js +1 -1
  8. package/cjs/core/ColorPicker/ColorInputPanel.js +43 -21
  9. package/cjs/core/ColorPicker/ColorPalette.js +1 -1
  10. package/cjs/core/ColorPicker/ColorPicker.js +2 -2
  11. package/cjs/core/ColorPicker/ColorPickerContext.d.ts +2 -2
  12. package/cjs/core/ColorPicker/ColorSwatch.d.ts +1 -1
  13. package/cjs/core/ColorPicker/ColorSwatch.js +10 -6
  14. package/cjs/core/ComboBox/ComboBox.d.ts +2 -2
  15. package/cjs/core/DatePicker/DatePicker.d.ts +1 -1
  16. package/cjs/core/ErrorPage/ErrorPage.d.ts +2 -1
  17. package/cjs/core/ErrorPage/ErrorPage.js +3 -2
  18. package/cjs/core/InformationPanel/InformationPanel.d.ts +4 -1
  19. package/cjs/core/InformationPanel/InformationPanel.js +4 -1
  20. package/cjs/core/InformationPanel/InformationPanelContent.d.ts +42 -0
  21. package/cjs/core/InformationPanel/InformationPanelContent.js +66 -0
  22. package/cjs/core/InformationPanel/index.d.ts +2 -0
  23. package/cjs/core/InformationPanel/index.js +3 -1
  24. package/cjs/core/Label/Label.d.ts +31 -0
  25. package/cjs/core/Label/Label.js +53 -0
  26. package/cjs/core/Label/index.d.ts +4 -0
  27. package/cjs/core/Label/index.js +10 -0
  28. package/cjs/core/LabeledInput/LabeledInput.d.ts +2 -2
  29. package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
  30. package/cjs/core/Menu/MenuItem.d.ts +1 -1
  31. package/cjs/core/Modal/ModalButtonBar.d.ts +2 -1
  32. package/cjs/core/Modal/ModalButtonBar.js +3 -2
  33. package/cjs/core/Table/Table.d.ts +8 -0
  34. package/cjs/core/Table/Table.js +71 -10
  35. package/cjs/core/Table/TableCell.js +1 -1
  36. package/cjs/core/Table/TablePaginator.d.ts +7 -7
  37. package/cjs/core/Table/TablePaginator.js +20 -10
  38. package/cjs/core/Table/TableRowMemoized.d.ts +21 -0
  39. package/cjs/core/Table/TableRowMemoized.js +6 -3
  40. package/cjs/core/Table/actionHandlers/resizeHandler.d.ts +51 -0
  41. package/cjs/core/Table/actionHandlers/resizeHandler.js +22 -0
  42. package/cjs/core/Table/actionHandlers/selectHandler.d.ts +10 -7
  43. package/cjs/core/Table/hooks/index.d.ts +1 -0
  44. package/cjs/core/Table/hooks/index.js +3 -1
  45. package/cjs/core/Table/hooks/useResizeColumns.d.ts +5 -0
  46. package/cjs/core/Table/hooks/useResizeColumns.js +271 -0
  47. package/cjs/core/Table/utils.d.ts +1 -1
  48. package/cjs/core/Table/utils.js +8 -2
  49. package/cjs/core/Tabs/Tabs.d.ts +4 -0
  50. package/cjs/core/Tabs/Tabs.js +23 -29
  51. package/cjs/core/index.d.ts +6 -4
  52. package/cjs/core/index.js +6 -2
  53. package/cjs/core/utils/color/ColorValue.d.ts +1 -0
  54. package/cjs/core/utils/color/ColorValue.js +96 -84
  55. package/cjs/core/utils/components/MiddleTextTruncation.d.ts +21 -0
  56. package/cjs/core/utils/components/MiddleTextTruncation.js +56 -0
  57. package/cjs/core/utils/components/index.d.ts +1 -0
  58. package/cjs/core/utils/components/index.js +1 -0
  59. package/cjs/core/utils/hooks/index.d.ts +1 -0
  60. package/cjs/core/utils/hooks/index.js +1 -0
  61. package/cjs/core/utils/hooks/useContainerWidth.d.ts +17 -0
  62. package/cjs/core/utils/hooks/useContainerWidth.js +50 -0
  63. package/cjs/core/utils/hooks/useOverflow.d.ts +1 -1
  64. package/cjs/core/utils/hooks/useOverflow.js +30 -17
  65. package/cjs/types/react-table-config.d.ts +16 -3
  66. package/esm/core/Buttons/Button/Button.d.ts +1 -1
  67. package/esm/core/Buttons/Button/Button.js +4 -5
  68. package/esm/core/Buttons/IconButton/IconButton.js +2 -3
  69. package/esm/core/Checkbox/Checkbox.d.ts +11 -0
  70. package/esm/core/Checkbox/Checkbox.js +14 -4
  71. package/esm/core/ColorPicker/ColorBuilder.js +1 -1
  72. package/esm/core/ColorPicker/ColorInputPanel.js +43 -21
  73. package/esm/core/ColorPicker/ColorPalette.js +1 -1
  74. package/esm/core/ColorPicker/ColorPicker.js +2 -2
  75. package/esm/core/ColorPicker/ColorPickerContext.d.ts +2 -2
  76. package/esm/core/ColorPicker/ColorSwatch.d.ts +1 -1
  77. package/esm/core/ColorPicker/ColorSwatch.js +10 -6
  78. package/esm/core/ComboBox/ComboBox.d.ts +2 -2
  79. package/esm/core/DatePicker/DatePicker.d.ts +1 -1
  80. package/esm/core/ErrorPage/ErrorPage.d.ts +2 -1
  81. package/esm/core/ErrorPage/ErrorPage.js +3 -2
  82. package/esm/core/InformationPanel/InformationPanel.d.ts +4 -1
  83. package/esm/core/InformationPanel/InformationPanel.js +4 -1
  84. package/esm/core/InformationPanel/InformationPanelContent.d.ts +42 -0
  85. package/esm/core/InformationPanel/InformationPanelContent.js +59 -0
  86. package/esm/core/InformationPanel/index.d.ts +2 -0
  87. package/esm/core/InformationPanel/index.js +1 -0
  88. package/esm/core/Label/Label.d.ts +31 -0
  89. package/esm/core/Label/Label.js +46 -0
  90. package/esm/core/Label/index.d.ts +4 -0
  91. package/esm/core/Label/index.js +6 -0
  92. package/esm/core/LabeledInput/LabeledInput.d.ts +2 -2
  93. package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +1 -1
  94. package/esm/core/Menu/MenuItem.d.ts +1 -1
  95. package/esm/core/Modal/ModalButtonBar.d.ts +2 -1
  96. package/esm/core/Modal/ModalButtonBar.js +3 -2
  97. package/esm/core/Table/Table.d.ts +8 -0
  98. package/esm/core/Table/Table.js +73 -12
  99. package/esm/core/Table/TableCell.js +1 -1
  100. package/esm/core/Table/TablePaginator.d.ts +7 -7
  101. package/esm/core/Table/TablePaginator.js +21 -11
  102. package/esm/core/Table/TableRowMemoized.d.ts +21 -0
  103. package/esm/core/Table/TableRowMemoized.js +4 -2
  104. package/esm/core/Table/actionHandlers/resizeHandler.d.ts +51 -0
  105. package/esm/core/Table/actionHandlers/resizeHandler.js +17 -0
  106. package/esm/core/Table/actionHandlers/selectHandler.d.ts +10 -7
  107. package/esm/core/Table/hooks/index.d.ts +1 -0
  108. package/esm/core/Table/hooks/index.js +1 -0
  109. package/esm/core/Table/hooks/useResizeColumns.d.ts +5 -0
  110. package/esm/core/Table/hooks/useResizeColumns.js +267 -0
  111. package/esm/core/Table/utils.d.ts +1 -1
  112. package/esm/core/Table/utils.js +8 -2
  113. package/esm/core/Tabs/Tabs.d.ts +4 -0
  114. package/esm/core/Tabs/Tabs.js +24 -30
  115. package/esm/core/index.d.ts +6 -4
  116. package/esm/core/index.js +3 -2
  117. package/esm/core/utils/color/ColorValue.d.ts +1 -0
  118. package/esm/core/utils/color/ColorValue.js +96 -84
  119. package/esm/core/utils/components/MiddleTextTruncation.d.ts +21 -0
  120. package/esm/core/utils/components/MiddleTextTruncation.js +49 -0
  121. package/esm/core/utils/components/index.d.ts +1 -0
  122. package/esm/core/utils/components/index.js +1 -0
  123. package/esm/core/utils/hooks/index.d.ts +1 -0
  124. package/esm/core/utils/hooks/index.js +1 -0
  125. package/esm/core/utils/hooks/useContainerWidth.d.ts +17 -0
  126. package/esm/core/utils/hooks/useContainerWidth.js +43 -0
  127. package/esm/core/utils/hooks/useOverflow.d.ts +1 -1
  128. package/esm/core/utils/hooks/useOverflow.js +30 -17
  129. package/esm/types/react-table-config.d.ts +16 -3
  130. package/package.json +13 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.27.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.26.1...v1.27.0) (2021-12-14)
4
+
5
+ ### What's new
6
+
7
+ * **Checkbox:** Add visibility (eyeball) checkbox using `variant` prop ([#470](https://www.github.com/iTwin/iTwinUI-react/issues/470)) ([cda4416](https://www.github.com/iTwin/iTwinUI-react/commit/cda44162a5b40686228c542ab0251b6861dd8359))
8
+ * **ComboBox:** Add `status` prop ([#473](https://www.github.com/iTwin/iTwinUI-react/issues/473)) ([8f5f098](https://www.github.com/iTwin/iTwinUI-react/commit/8f5f09804a541cab8c2add6417e57b9693e69714))
9
+ * **Table:** Add `rowsPerPageLabel` to paginator localization ([#427](https://www.github.com/iTwin/iTwinUI-react/issues/427)) ([52d5c86](https://www.github.com/iTwin/iTwinUI-react/commit/52d5c86efc569238221a7e39cad2d17636c7f9b8))
10
+ * **Table:** Added column resizing using `isResizable` prop ([#448](https://www.github.com/iTwin/iTwinUI-react/issues/448)) ([4c25fe1](https://www.github.com/iTwin/iTwinUI-react/commit/4c25fe1ec5de8f2f6bf771c4adf11bc6ad5e0dd2))
11
+ * **Tabs:** Add `wrapperClassName` prop ([#451](https://www.github.com/iTwin/iTwinUI-react/issues/451)) ([574480a](https://www.github.com/iTwin/iTwinUI-react/commit/574480a8cd7cc92b95a79d2d53ddae0b39d6c5f5))
12
+
13
+ ### Fixes
14
+
15
+ * **ErrorPage:** Add `className` and `style` props ([#479](https://www.github.com/iTwin/iTwinUI-react/issues/479)) ([74f9060](https://www.github.com/iTwin/iTwinUI-react/commit/74f906058b12adb85f2653a0b4e7a1d808df1ef5))
16
+ * **ModalButtonBar:** Add `className` and `style` props ([#474](https://www.github.com/iTwin/iTwinUI-react/issues/474)) ([2228cc7](https://www.github.com/iTwin/iTwinUI-react/commit/2228cc7ad56c5f1a104abb93b33107af30de62c9))
17
+
18
+ ### [1.26.1](https://www.github.com/iTwin/iTwinUI-react/compare/v1.26.0...v1.26.1) (2021-12-03)
19
+
20
+ ### Fixes
21
+
22
+ * **MiddleTextTruncation:** Fix resizing by adding flex grow ([#455](https://www.github.com/iTwin/iTwinUI-react/issues/455)) ([17cd7fb](https://www.github.com/iTwin/iTwinUI-react/commit/17cd7fbbef9f5c35a121d664922fb1a5706be037))
23
+
24
+ ## [1.26.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.25.0...v1.26.0) (2021-11-30)
25
+
26
+ ### What's new
27
+
28
+ * **InformationPanel:** Add `InformationPanelContent` for inner rows ([#433](https://www.github.com/iTwin/iTwinUI-react/issues/433)) ([a706bcb](https://www.github.com/iTwin/iTwinUI-react/commit/a706bcb04f9af512131d9ed08fef1529314d2bb1))
29
+ * **MiddleTextTruncation:** Utility to truncate text with ellipsis in the middle ([#330](https://www.github.com/iTwin/iTwinUI-react/issues/330)) ([371b56f](https://www.github.com/iTwin/iTwinUI-react/commit/371b56fa9150fdd110c92d05b3944f376d37441c))
30
+
31
+ ### Fixes
32
+
33
+ * **DatePicker:** Make date arg required in `onChange` ([#437](https://www.github.com/iTwin/iTwinUI-react/issues/437)) ([ee79248](https://www.github.com/iTwin/iTwinUI-react/commit/ee792488a10e43a9b0f8ea6d77c30ef1897eb86c))
34
+ * **Table:** Don't show paginator when there is only one page ([#441](https://www.github.com/iTwin/iTwinUI-react/issues/441)) ([e40cbc8](https://www.github.com/iTwin/iTwinUI-react/commit/e40cbc81929da14ea2754e5d847c0efe8af70203))
35
+
36
+ ## [1.25.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.24.0...v1.25.0) (2021-11-16)
37
+
38
+ ### What's new
39
+
40
+ * **Label:** Add new standalone `Label` component ([#431](https://www.github.com/iTwin/iTwinUI-react/issues/431)) ([8e40b69](https://www.github.com/iTwin/iTwinUI-react/commit/8e40b69d2b5e9272c01e528cdfd75060357069a8))
41
+
42
+ ### Fixes
43
+
44
+ * **ColorPicker:** Upgrade color conversion to remove rounding issues ([#425](https://www.github.com/iTwin/iTwinUI-react/issues/425)) ([1ce4905](https://www.github.com/iTwin/iTwinUI-react/commit/1ce4905219325080b5a6a4e5de200101d5b0860e))
45
+ * **Table:** Fixed pagniator to handle a large number of items ([#428](https://www.github.com/iTwin/iTwinUI-react/issues/428)) ([1d947fc](https://www.github.com/iTwin/iTwinUI-react/commit/1d947fc3f55091b9b6da1ed7e7fa167b931cb8a0))
46
+
3
47
  ## [1.24.0](https://www.github.com/iTwin/iTwinUI-react/compare/v1.23.2...v1.24.0) (2021-11-09)
4
48
 
5
49
  ### What's new
@@ -43,7 +43,7 @@ export declare const Button: React.ForwardRefExoticComponent<{
43
43
  * Use 'borderless' to hide outline.
44
44
  * @default 'default'
45
45
  */
46
- styleType?: "cta" | "high-visibility" | "default" | "borderless" | undefined;
46
+ styleType?: "default" | "cta" | "high-visibility" | "borderless" | undefined;
47
47
  /**
48
48
  * Icon shown before the main button content.
49
49
  */
@@ -47,18 +47,17 @@ exports.Button = react_1.default.forwardRef(function (props, ref) {
47
47
  var _a;
48
48
  var children = props.children, className = props.className, size = props.size, style = props.style, _b = props.styleType, styleType = _b === void 0 ? 'default' : _b, _c = props.type, type = _c === void 0 ? 'button' : _c, startIcon = props.startIcon, endIcon = props.endIcon, rest = __rest(props, ["children", "className", "size", "style", "styleType", "type", "startIcon", "endIcon"]);
49
49
  (0, utils_1.useTheme)();
50
- return (react_1.default.createElement("button", __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', (_a = {},
50
+ return (react_1.default.createElement("button", __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', "iui-" + styleType, (_a = {},
51
51
  _a["iui-" + size] = !!size,
52
- _a["iui-" + styleType] = styleType !== 'default',
53
52
  _a), className), style: style, type: type }, rest),
54
53
  startIcon &&
55
54
  react_1.default.cloneElement(startIcon, {
56
- className: (0, classnames_1.default)('iui-icon', startIcon.props.className),
55
+ className: (0, classnames_1.default)('iui-button-icon', startIcon.props.className),
57
56
  }),
58
- children && react_1.default.createElement("span", { className: 'iui-label' }, children),
57
+ children && react_1.default.createElement("span", { className: 'iui-button-label' }, children),
59
58
  endIcon &&
60
59
  react_1.default.cloneElement(endIcon, {
61
- className: (0, classnames_1.default)('iui-icon', endIcon.props.className),
60
+ className: (0, classnames_1.default)('iui-button-icon', endIcon.props.className),
62
61
  })));
63
62
  });
64
63
  exports.default = exports.Button;
@@ -44,12 +44,11 @@ exports.IconButton = react_1.default.forwardRef(function (props, ref) {
44
44
  var _a;
45
45
  var isActive = props.isActive, children = props.children, _b = props.styleType, styleType = _b === void 0 ? 'default' : _b, size = props.size, _c = props.type, type = _c === void 0 ? 'button' : _c, className = props.className, rest = __rest(props, ["isActive", "children", "styleType", "size", "type", "className"]);
46
46
  (0, utils_1.useTheme)();
47
- return (react_1.default.createElement("button", __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', (_a = {},
47
+ return (react_1.default.createElement("button", __assign({ ref: ref, className: (0, classnames_1.default)('iui-button', "iui-" + styleType, (_a = {},
48
48
  _a["iui-" + size] = !!size,
49
- _a["iui-" + styleType] = styleType !== 'default',
50
49
  _a['iui-active'] = isActive,
51
50
  _a), className), type: type }, rest), react_1.default.cloneElement(children, {
52
- className: (0, classnames_1.default)('iui-icon', children.props.className),
51
+ className: (0, classnames_1.default)('iui-button-icon', children.props.className),
53
52
  'aria-hidden': true,
54
53
  })));
55
54
  });
@@ -14,6 +14,11 @@ export declare type CheckboxProps = {
14
14
  * Status of checkbox.
15
15
  */
16
16
  status?: 'positive' | 'warning' | 'negative';
17
+ /**
18
+ * Type of checkbox, regular or eyeball checkbox that is used for visibility.
19
+ * @default 'default'
20
+ */
21
+ variant?: 'default' | 'eyeball';
17
22
  /**
18
23
  * Set focus on checkbox.
19
24
  */
@@ -41,6 +46,7 @@ export declare type CheckboxProps = {
41
46
  * <Checkbox label='Positive Checkbox' status='positive' />
42
47
  * <Checkbox label='Warning Checkbox' status='warning' />
43
48
  * <Checkbox label='Negative Checkbox' status='negative' />
49
+ * <Checkbox label='Visibility Checkbox' variant='eyeball' />
44
50
  */
45
51
  export declare const Checkbox: React.ForwardRefExoticComponent<{
46
52
  /**
@@ -56,6 +62,11 @@ export declare const Checkbox: React.ForwardRefExoticComponent<{
56
62
  * Status of checkbox.
57
63
  */
58
64
  status?: "positive" | "warning" | "negative" | undefined;
65
+ /**
66
+ * Type of checkbox, regular or eyeball checkbox that is used for visibility.
67
+ * @default 'default'
68
+ */
69
+ variant?: "default" | "eyeball" | undefined;
59
70
  /**
60
71
  * Set focus on checkbox.
61
72
  */
@@ -44,10 +44,11 @@ require("@itwin/itwinui-css/css/inputs.css");
44
44
  * <Checkbox label='Positive Checkbox' status='positive' />
45
45
  * <Checkbox label='Warning Checkbox' status='warning' />
46
46
  * <Checkbox label='Negative Checkbox' status='negative' />
47
+ * <Checkbox label='Visibility Checkbox' variant='eyeball' />
47
48
  */
48
49
  exports.Checkbox = react_1.default.forwardRef(function (props, ref) {
49
50
  var _a;
50
- var className = props.className, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.indeterminate, indeterminate = _c === void 0 ? false : _c, label = props.label, status = props.status, setFocus = props.setFocus, _d = props.isLoading, isLoading = _d === void 0 ? false : _d, style = props.style, checkmarkClassName = props.checkmarkClassName, checkmarkStyle = props.checkmarkStyle, rest = __rest(props, ["className", "disabled", "indeterminate", "label", "status", "setFocus", "isLoading", "style", "checkmarkClassName", "checkmarkStyle"]);
51
+ var className = props.className, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.indeterminate, indeterminate = _c === void 0 ? false : _c, label = props.label, status = props.status, _d = props.variant, variant = _d === void 0 ? 'default' : _d, setFocus = props.setFocus, _e = props.isLoading, isLoading = _e === void 0 ? false : _e, style = props.style, checkmarkClassName = props.checkmarkClassName, checkmarkStyle = props.checkmarkStyle, rest = __rest(props, ["className", "disabled", "indeterminate", "label", "status", "variant", "setFocus", "isLoading", "style", "checkmarkClassName", "checkmarkStyle"]);
51
52
  (0, utils_1.useTheme)();
52
53
  var inputElementRef = react_1.default.useRef(null);
53
54
  var refs = (0, utils_1.useMergedRefs)(inputElementRef, ref);
@@ -64,18 +65,27 @@ exports.Checkbox = react_1.default.forwardRef(function (props, ref) {
64
65
  : inputElementRef.current.checked;
65
66
  }
66
67
  });
68
+ var defaultCheckbox = (react_1.default.createElement("svg", { viewBox: '0 0 16 16', "aria-hidden": 'true', focusable: 'false' },
69
+ react_1.default.createElement("path", { className: 'iui-check', d: 'M6,14L0,8l2-2l4,4l8-8l2,2L6,14z' }),
70
+ react_1.default.createElement("path", { className: 'iui-check-partial', d: 'm1 6.5h14v3h-14z' })));
71
+ var visibilityCheckbox = (react_1.default.createElement("svg", { viewBox: '0 0 16 16', "aria-hidden": 'true', focusable: 'false' },
72
+ react_1.default.createElement("path", { className: 'iui-check', d: 'm8 2.99051a8.81883 8.81883 0 0 0 -8 4.95062 8.74664 8.74664 0 0 0 8 5.06836 8.63266 8.63266 0 0 0 8-5.06836 8.83631 8.83631 0 0 0 -8-4.95062zm-1.31445 1.86981a1.47663 1.47663 0 1 1 -1.47663 1.47668 1.47665 1.47665 0 0 1 1.47663-1.47668zm1.31445 6.64917a7.17486 7.17486 0 0 1 -6.30475-3.55237 7.4952 7.4952 0 0 1 2.81475-2.6336 3.83956 3.83956 0 1 0 6.98126.00244 7.522 7.522 0 0 1 2.81774 2.63916 7.09785 7.09785 0 0 1 -6.309 3.54437z' }),
73
+ react_1.default.createElement("g", { className: 'iui-check-partial' },
74
+ react_1.default.createElement("path", { d: 'm8 3v7.9a4.01179 4.01179 0 0 0 4-4 6.7509 6.7509 0 0 0 -.2-1.4l.1.1a6.89429 6.89429 0 0 1 2.4 2.4 8.39088 8.39088 0 0 1 -2.3 2.3 6.89412 6.89412 0 0 1 -3.9 1.2c-.03345 0-.06653-.00677-.1-.0072v1.5072a8.90686 8.90686 0 0 0 8-5 8.90686 8.90686 0 0 0 -8-5z', opacity: '.33' }),
75
+ react_1.default.createElement("path", { d: 'm8 0a1 1 0 0 0 -1 1v2.07135a8.91637 8.91637 0 0 0 -7 4.92865 8.91637 8.91637 0 0 0 7 4.92865v2.07135a1 1 0 0 0 2 0v-14a1 1 0 0 0 -1-1zm-1.5 4.9a1.55426 1.55426 0 0 1 .5.087v2.81451a1.40746 1.40746 0 0 1 -.5.09849 1.538 1.538 0 0 1 -1.5-1.5 1.53794 1.53794 0 0 1 1.5-1.5zm-2.3 5.4a6.97279 6.97279 0 0 1 -2.5-2.3 6.89429 6.89429 0 0 1 2.4-2.4c.1 0 .1-.1.2-.1a3.194 3.194 0 0 0 -.3 1.4 4.0047 4.0047 0 0 0 3 3.857v.65289a6.37491 6.37491 0 0 1 -2.8-1.10989z' })),
76
+ react_1.default.createElement("path", { className: 'iui-uncheck', d: 'm1.70671 12.879 11.17218-11.17219 1.4142 1.4142-11.17218 11.17218zm.99329-1.679 1.1-1.1a5.06317 5.06317 0 0 1 -2-2.1 7.48268 7.48268 0 0 1 6.2-3.5 4.86877 4.86877 0 0 1 1.2.1l1.3-1.3a10.07431 10.07431 0 0 0 -2.5-.3 8.84129 8.84129 0 0 0 -8 5 8.42455 8.42455 0 0 0 2.7 3.2zm10.7-6.4-1.1 1.1a7.08625 7.08625 0 0 1 2 2.1 7.50323 7.50323 0 0 1 -6.2 3.5 8.31665 8.31665 0 0 1 -1.3-.2l-1.3 1.3a8.909 8.909 0 0 0 6.4-.5 9.04344 9.04344 0 0 0 4.1-4.1 9.168 9.168 0 0 0 -2.6-3.2z' })));
67
77
  return (react_1.default.createElement("label", { className: (0, classnames_1.default)('iui-checkbox', (_a = {
68
78
  'iui-disabled': disabled
69
79
  },
70
80
  _a["iui-" + status] = !!status,
71
81
  _a['iui-loading'] = isLoading,
82
+ _a['iui-checkbox-visibility'] = variant === 'eyeball',
72
83
  _a), className), style: style },
73
84
  react_1.default.createElement("input", __assign({ disabled: disabled || isLoading, type: 'checkbox', ref: refs }, rest)),
74
85
  react_1.default.createElement("span", { className: (0, classnames_1.default)('iui-checkbox-checkmark', checkmarkClassName), style: checkmarkStyle },
75
86
  isLoading && react_1.default.createElement(ProgressIndicators_1.ProgressRadial, { indeterminate: true }),
76
- !isLoading && (react_1.default.createElement("svg", { viewBox: '0 0 16 16', "aria-hidden": 'true', focusable: 'false' },
77
- react_1.default.createElement("path", { className: 'iui-check', d: 'M6,14L0,8l2-2l4,4l8-8l2,2L6,14z' }),
78
- react_1.default.createElement("path", { className: 'iui-check-partial', d: 'm1 6.5h14v3h-14z' })))),
87
+ !isLoading &&
88
+ (variant === 'default' ? defaultCheckbox : visibilityCheckbox)),
79
89
  label && react_1.default.createElement("span", { className: 'iui-label' }, label)));
80
90
  });
81
91
  exports.default = exports.Checkbox;
@@ -92,7 +92,7 @@ exports.ColorBuilder = react_1.default.forwardRef(function (props, ref) {
92
92
  };
93
93
  // Update slider change
94
94
  var updateHueSlider = react_1.default.useCallback(function (huePercent, selectionChanged) {
95
- var hue = Math.round(huePercent);
95
+ var hue = Number(huePercent.toFixed(2));
96
96
  var newHsvColor = {
97
97
  h: hue,
98
98
  s: hsvColor.s,
@@ -50,6 +50,7 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
50
50
  var _a, _b, _c, _d, _f, _g, _h, _j;
51
51
  var defaultColorFormat = props.defaultColorFormat, _k = props.allowedColorFormats, allowedColorFormats = _k === void 0 ? ['hsl', 'rgb', 'hex'] : _k, className = props.className, rest = __rest(props, ["defaultColorFormat", "allowedColorFormats", "className"]);
52
52
  (0, utils_1.useTheme)();
53
+ var inputsContainerRef = react_1.default.useRef(null);
53
54
  var _l = (0, ColorPickerContext_1.useColorPickerContext)(), activeColor = _l.activeColor, applyHsvColorChange = _l.applyHsvColorChange, hsvColor = _l.hsvColor, showAlpha = _l.showAlpha;
54
55
  var _m = react_1.default.useState(defaultColorFormat), currentFormat = _m[0], setCurrentFormat = _m[1];
55
56
  react_1.default.useEffect(function () {
@@ -58,14 +59,14 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
58
59
  // need to use state since input may have parsing error
59
60
  var _o = react_1.default.useState(['', '', '', '']), input = _o[0], setInput = _o[1];
60
61
  react_1.default.useEffect(function () {
61
- var _a, _b, _c, _d;
62
+ var _a, _b;
62
63
  if (currentFormat === 'hsl') {
63
64
  var hsl = activeColor.toHslColor();
64
65
  setInput([
65
- hsvColor.h.toString(),
66
- hsl.s.toString(),
67
- hsl.l.toString(),
68
- (_b = (_a = hsl.a) === null || _a === void 0 ? void 0 : _a.toFixed(2)) !== null && _b !== void 0 ? _b : (activeColor.getAlpha() / 255).toFixed(2),
66
+ utils_1.ColorValue.getFormattedColorNumber(hsvColor.h),
67
+ utils_1.ColorValue.getFormattedColorNumber(hsl.s),
68
+ utils_1.ColorValue.getFormattedColorNumber(hsl.l),
69
+ utils_1.ColorValue.getFormattedColorNumber((_a = hsl.a) !== null && _a !== void 0 ? _a : activeColor.getAlpha() / 255, 2),
69
70
  ]);
70
71
  }
71
72
  else if (currentFormat === 'rgb') {
@@ -74,7 +75,7 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
74
75
  rgb.r.toString(),
75
76
  rgb.g.toString(),
76
77
  rgb.b.toString(),
77
- (_d = (_c = rgb.a) === null || _c === void 0 ? void 0 : _c.toFixed(2)) !== null && _d !== void 0 ? _d : (activeColor.getAlpha() / 255).toFixed(2),
78
+ utils_1.ColorValue.getFormattedColorNumber((_b = rgb.a) !== null && _b !== void 0 ? _b : activeColor.getAlpha() / 255, 2),
78
79
  ]);
79
80
  }
80
81
  else {
@@ -89,6 +90,11 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
89
90
  allowedColorFormats.length]) !== null && _a !== void 0 ? _a : allowedColorFormats[0];
90
91
  setCurrentFormat(newFormat);
91
92
  }, [currentFormat, allowedColorFormats]);
93
+ var isFocusInside = function (focused) {
94
+ return !!(focused &&
95
+ inputsContainerRef.current &&
96
+ inputsContainerRef.current.contains(focused));
97
+ };
92
98
  var handleColorInputChange = function () {
93
99
  var color;
94
100
  if (currentFormat === 'hex') {
@@ -142,7 +148,7 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
142
148
  color = utils_1.ColorValue.create({ r: r, g: g, b: b, a: a });
143
149
  }
144
150
  if (color) {
145
- applyHsvColorChange(color.toHsvColor(), true);
151
+ applyHsvColorChange(color.toHsvColor(), true, color);
146
152
  }
147
153
  };
148
154
  var hexInputField = (react_1.default.createElement(utils_1.InputContainer, { status: validHexInput ? undefined : 'negative' },
@@ -164,7 +170,7 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
164
170
  react_1.default.createElement(utils_1.InputContainer, { status: Number(input[0]) < 0 || Number(input[0]) > 360
165
171
  ? 'negative'
166
172
  : undefined },
167
- react_1.default.createElement(Input_1.Input, { size: 'small', type: 'number', min: '0', max: '359', placeholder: 'H', value: (_a = input[0]) !== null && _a !== void 0 ? _a : '', onChange: function (event) {
173
+ react_1.default.createElement(Input_1.Input, { size: 'small', type: 'number', min: '0', max: '359', step: '.1', placeholder: 'H', value: (_a = input[0]) !== null && _a !== void 0 ? _a : '', onChange: function (event) {
168
174
  setInput([event.target.value, input[1], input[2], input[3]]);
169
175
  }, onKeyDown: function (event) {
170
176
  if (event.key === 'Enter') {
@@ -173,12 +179,14 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
173
179
  }
174
180
  }, onBlur: function (event) {
175
181
  event.preventDefault();
176
- handleColorInputChange();
182
+ if (!isFocusInside(event.relatedTarget)) {
183
+ handleColorInputChange();
184
+ }
177
185
  } })),
178
186
  react_1.default.createElement(utils_1.InputContainer, { status: Number(input[1]) < 0 || Number(input[1]) > 100
179
187
  ? 'negative'
180
188
  : undefined },
181
- react_1.default.createElement(Input_1.Input, { size: 'small', type: 'number', min: '0', max: '100', placeholder: 'S', value: (_b = input[1]) !== null && _b !== void 0 ? _b : '', onChange: function (event) {
189
+ react_1.default.createElement(Input_1.Input, { size: 'small', type: 'number', min: '0', max: '100', step: '.1', placeholder: 'S', value: (_b = input[1]) !== null && _b !== void 0 ? _b : '', onChange: function (event) {
182
190
  setInput([input[0], event.target.value, input[2], input[3]]);
183
191
  }, onKeyDown: function (event) {
184
192
  if (event.key === 'Enter') {
@@ -187,12 +195,14 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
187
195
  }
188
196
  }, onBlur: function (event) {
189
197
  event.preventDefault();
190
- handleColorInputChange();
198
+ if (!isFocusInside(event.relatedTarget)) {
199
+ handleColorInputChange();
200
+ }
191
201
  } })),
192
202
  react_1.default.createElement(utils_1.InputContainer, { status: Number(input[2]) < 0 || Number(input[2]) > 100
193
203
  ? 'negative'
194
204
  : undefined },
195
- react_1.default.createElement(Input_1.Input, { size: 'small', type: 'number', min: '0', max: '100', placeholder: 'L', value: (_c = input[2]) !== null && _c !== void 0 ? _c : '', onChange: function (event) {
205
+ react_1.default.createElement(Input_1.Input, { size: 'small', type: 'number', min: '0', max: '100', step: '.1', placeholder: 'L', value: (_c = input[2]) !== null && _c !== void 0 ? _c : '', onChange: function (event) {
196
206
  setInput([input[0], input[1], event.target.value, input[3]]);
197
207
  }, onKeyDown: function (event) {
198
208
  if (event.key === 'Enter') {
@@ -201,7 +211,9 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
201
211
  }
202
212
  }, onBlur: function (event) {
203
213
  event.preventDefault();
204
- handleColorInputChange();
214
+ if (!isFocusInside(event.relatedTarget)) {
215
+ handleColorInputChange();
216
+ }
205
217
  } })),
206
218
  showAlpha && (react_1.default.createElement(utils_1.InputContainer, { status: Number(input[3]) < 0 || Number(input[3]) > 1
207
219
  ? 'negative'
@@ -215,7 +227,9 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
215
227
  }
216
228
  }, onBlur: function (event) {
217
229
  event.preventDefault();
218
- handleColorInputChange();
230
+ if (!isFocusInside(event.relatedTarget)) {
231
+ handleColorInputChange();
232
+ }
219
233
  } })))));
220
234
  var rgbInputs = (react_1.default.createElement(react_1.default.Fragment, null,
221
235
  react_1.default.createElement(utils_1.InputContainer, { status: Number(input[0]) < 0 || Number(input[0]) > 255
@@ -230,7 +244,9 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
230
244
  }
231
245
  }, onBlur: function (event) {
232
246
  event.preventDefault();
233
- handleColorInputChange();
247
+ if (!isFocusInside(event.relatedTarget)) {
248
+ handleColorInputChange();
249
+ }
234
250
  } })),
235
251
  react_1.default.createElement(utils_1.InputContainer, { status: Number(input[1]) < 0 || Number(input[1]) > 255
236
252
  ? 'negative'
@@ -244,7 +260,9 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
244
260
  }
245
261
  }, onBlur: function (event) {
246
262
  event.preventDefault();
247
- handleColorInputChange();
263
+ if (!isFocusInside(event.relatedTarget)) {
264
+ handleColorInputChange();
265
+ }
248
266
  } })),
249
267
  react_1.default.createElement(utils_1.InputContainer, { status: Number(input[2]) < 0 || Number(input[2]) > 255
250
268
  ? 'negative'
@@ -258,7 +276,9 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
258
276
  }
259
277
  }, onBlur: function (event) {
260
278
  event.preventDefault();
261
- handleColorInputChange();
279
+ if (!isFocusInside(event.relatedTarget)) {
280
+ handleColorInputChange();
281
+ }
262
282
  } })),
263
283
  showAlpha && (react_1.default.createElement(utils_1.InputContainer, { status: Number(input[3]) < 0 || Number(input[3]) > 1
264
284
  ? 'negative'
@@ -272,7 +292,9 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
272
292
  }
273
293
  }, onBlur: function (event) {
274
294
  event.preventDefault();
275
- handleColorInputChange();
295
+ if (!isFocusInside(event.relatedTarget)) {
296
+ handleColorInputChange();
297
+ }
276
298
  } })))));
277
299
  return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-color-input-wrapper', className), ref: ref }, rest),
278
300
  react_1.default.createElement("div", { className: 'iui-color-picker-section-label' }, showAlpha && currentFormat != 'hex'
@@ -282,9 +304,9 @@ exports.ColorInputPanel = react_1.default.forwardRef(function (props, ref) {
282
304
  allowedColorFormats.length > 1 && (react_1.default.createElement(Buttons_1.IconButton, { styleType: 'borderless', onClick: swapColorFormat, size: 'small' },
283
305
  react_1.default.createElement("svg", { viewBox: '0 0 16 16', className: 'iui-icon', "aria-hidden": true },
284
306
  react_1.default.createElement("path", { d: 'm5 15-3.78125-3.5 3.78125-3.5v2h8v3h-8zm6-7 3.78125-3.5-3.78125-3.5v2h-8v3h8z' })))),
285
- react_1.default.createElement("div", { className: 'iui-color-input-fields' },
307
+ react_1.default.createElement("div", { ref: inputsContainerRef, className: 'iui-color-input-fields' },
286
308
  currentFormat === 'hex' && hexInputField,
287
- currentFormat === 'hsl' && hslInputs,
288
- currentFormat === 'rgb' && rgbInputs))));
309
+ currentFormat === 'rgb' && rgbInputs,
310
+ currentFormat === 'hsl' && hslInputs))));
289
311
  });
290
312
  exports.default = exports.ColorInputPanel;
@@ -129,7 +129,7 @@ exports.ColorPalette = react_1.default.forwardRef(function (props, ref) {
129
129
  event.preventDefault();
130
130
  onChangeComplete === null || onChangeComplete === void 0 ? void 0 : onChangeComplete(color);
131
131
  setActiveColor(color);
132
- }, isActive: color.toHslString(true) === activeColor.toHslString(true) }));
132
+ }, isActive: color.equals(activeColor) }));
133
133
  }))));
134
134
  });
135
135
  exports.default = exports.ColorPalette;
@@ -86,10 +86,10 @@ var ColorPicker = function (props) {
86
86
  setHsvColor(inColor.toHsvColor());
87
87
  }
88
88
  }, [inColor]);
89
- var applyHsvColorChange = react_1.default.useCallback(function (newColor, selectionChanged) {
89
+ var applyHsvColorChange = react_1.default.useCallback(function (newColor, selectionChanged, newColorValue) {
90
90
  // save the HSV values
91
91
  setHsvColor(newColor);
92
- var newActiveColor = utils_1.ColorValue.create(newColor);
92
+ var newActiveColor = newColorValue !== null && newColorValue !== void 0 ? newColorValue : utils_1.ColorValue.create(newColor);
93
93
  // Only update selected color when dragging is done
94
94
  if (selectionChanged) {
95
95
  onChangeComplete === null || onChangeComplete === void 0 ? void 0 : onChangeComplete(newActiveColor);
@@ -5,7 +5,7 @@ export declare const ColorPickerContext: React.Context<{
5
5
  setActiveColor: (color: ColorValue | ((prevColor: ColorValue) => ColorValue)) => void;
6
6
  hsvColor: HsvColor;
7
7
  onChangeComplete?: ((color: ColorValue) => void) | undefined;
8
- applyHsvColorChange: (newColor: HsvColor, selectionChanged: boolean) => void;
8
+ applyHsvColorChange: (newColor: HsvColor, selectionChanged: boolean, newColorValue?: ColorValue | undefined) => void;
9
9
  showAlpha: boolean;
10
10
  } | undefined>;
11
11
  export declare const useColorPickerContext: () => {
@@ -13,6 +13,6 @@ export declare const useColorPickerContext: () => {
13
13
  setActiveColor: (color: ColorValue | ((prevColor: ColorValue) => ColorValue)) => void;
14
14
  hsvColor: HsvColor;
15
15
  onChangeComplete?: ((color: ColorValue) => void) | undefined;
16
- applyHsvColorChange: (newColor: HsvColor, selectionChanged: boolean) => void;
16
+ applyHsvColorChange: (newColor: HsvColor, selectionChanged: boolean, newColorValue?: ColorValue | undefined) => void;
17
17
  showAlpha: boolean;
18
18
  };
@@ -17,5 +17,5 @@ export declare type ColorSwatchProps = {
17
17
  * <ColorSwatch color='#23450b' onClick={onClick}/>
18
18
  * <ColorSwatch color={{ r: 255, g: 255, b: 0 }} onClick={onClick}/>
19
19
  */
20
- export declare const ColorSwatch: React.ForwardRefExoticComponent<Pick<ColorSwatchProps, "dir" | "slot" | "style" | "title" | "id" | "role" | "children" | "className" | "accessKey" | "draggable" | "hidden" | "lang" | "translate" | "prefix" | "contentEditable" | "inputMode" | "tabIndex" | "onFocus" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "isActive" | "key"> & React.RefAttributes<HTMLDivElement>>;
20
+ export declare const ColorSwatch: React.ForwardRefExoticComponent<Pick<ColorSwatchProps, "dir" | "slot" | "style" | "title" | "id" | "role" | "children" | "className" | "accessKey" | "draggable" | "hidden" | "lang" | "translate" | "prefix" | "contentEditable" | "inputMode" | "tabIndex" | "onFocus" | "color" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "isActive" | "key"> & React.RefAttributes<HTMLDivElement>>;
21
21
  export default ColorSwatch;
@@ -42,14 +42,18 @@ var ColorPicker_1 = require("./ColorPicker");
42
42
  * <ColorSwatch color={{ r: 255, g: 255, b: 0 }} onClick={onClick}/>
43
43
  */
44
44
  exports.ColorSwatch = react_1.default.forwardRef(function (props, ref) {
45
- var _a, _b, _c;
46
45
  var color = props.color, style = props.style, onClick = props.onClick, isActive = props.isActive, className = props.className, rest = __rest(props, ["color", "style", "onClick", "isActive", "className"]);
47
46
  (0, utils_1.useTheme)();
48
- var c = typeof color === 'string'
49
- ? color
50
- : (0, ColorPicker_1.getColorValue)(color).toHslString(true);
51
- var _style = color && ((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--swatch-color: " + c))
52
- ? __assign({ '--swatch-color': c }, style) : __assign({ backgroundColor: c }, style);
47
+ var colorString = react_1.default.useMemo(function () {
48
+ return typeof color === 'string'
49
+ ? color
50
+ : (0, ColorPicker_1.getColorValue)(color).toHslString(true);
51
+ }, [color]);
52
+ var _style = react_1.default.useMemo(function () {
53
+ var _a, _b, _c;
54
+ return ((_c = (_b = (_a = (0, utils_1.getWindow)()) === null || _a === void 0 ? void 0 : _a.CSS) === null || _b === void 0 ? void 0 : _b.supports) === null || _c === void 0 ? void 0 : _c.call(_b, "--swatch-color: " + colorString))
55
+ ? __assign({ '--swatch-color': colorString }, style) : __assign({ backgroundColor: colorString }, style);
56
+ }, [colorString, style]);
53
57
  return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-color-swatch', { 'iui-active': isActive }, className), style: _style, onClick: onClick, tabIndex: isActive ? 0 : -1, "aria-selected": isActive, ref: ref }, rest)));
54
58
  });
55
59
  exports.default = exports.ColorSwatch;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { InputProps } from '../Input';
3
3
  import { SelectOption } from '../Select';
4
- import { PopoverProps, CommonProps } from '../utils';
4
+ import { PopoverProps, CommonProps, InputContainerProps } from '../utils';
5
5
  import 'tippy.js/animations/shift-away.css';
6
6
  export declare type ComboBoxProps<T> = {
7
7
  /**
@@ -33,7 +33,7 @@ export declare type ComboBoxProps<T> = {
33
33
  * @default 'No options found'
34
34
  */
35
35
  emptyStateMessage?: string;
36
- } & Omit<CommonProps, 'title'>;
36
+ } & Pick<InputContainerProps, 'status'> & Omit<CommonProps, 'title'>;
37
37
  /**
38
38
  * ComboBox component that allows typing a value to filter the options in dropdown list.
39
39
  * Values can be selected either using mouse clicks or using the Enter key.
@@ -18,7 +18,7 @@ export declare type DatePickerProps = {
18
18
  /**
19
19
  * Callback when date is changed.
20
20
  */
21
- onChange?: (date?: Date) => void;
21
+ onChange?: (date: Date) => void;
22
22
  /**
23
23
  * Pass localized week days (start from sunday) and months.
24
24
  * Use helper function `generateLocalizedStrings` to generate strings using `Intl.DateTimeFormat`.
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { CommonProps } from '../utils';
2
3
  import '@itwin/itwinui-css/css/non-ideal-state.css';
3
4
  export declare type ErrorPageType = '401' | '403' | '404' | '500' | '502' | '503' | 'generic';
4
5
  export declare type ErrorTypeTranslations = {
@@ -45,7 +46,7 @@ export declare type ErrorPageProps = {
45
46
  * Used to translate default error messages, if no specific @errorName passed in
46
47
  */
47
48
  translatedErrorMessages?: ErrorTypeTranslations;
48
- };
49
+ } & Omit<CommonProps, 'title'>;
49
50
  /**
50
51
  * A stylized display to communicate common http errors.
51
52
  * @example
@@ -40,6 +40,7 @@ var Error_1 = __importDefault(require("@itwin/itwinui-illustrations-react/cjs/il
40
40
  var react_1 = __importDefault(require("react"));
41
41
  var Button_1 = require("../Buttons/Button");
42
42
  var utils_1 = require("../utils");
43
+ var classnames_1 = __importDefault(require("classnames"));
43
44
  require("@itwin/itwinui-css/css/non-ideal-state.css");
44
45
  /**
45
46
  * A stylized display to communicate common http errors.
@@ -47,7 +48,7 @@ require("@itwin/itwinui-css/css/non-ideal-state.css");
47
48
  * <ErrorPage errorType='401' />
48
49
  */
49
50
  var ErrorPage = function (props) {
50
- var errorType = props.errorType, errorName = props.errorName, errorMessage = props.errorMessage, primaryButtonHandle = props.primaryButtonHandle, primaryButtonLabel = props.primaryButtonLabel, secondaryButtonHandle = props.secondaryButtonHandle, secondaryButtonLabel = props.secondaryButtonLabel, translatedErrorMessages = props.translatedErrorMessages, rest = __rest(props, ["errorType", "errorName", "errorMessage", "primaryButtonHandle", "primaryButtonLabel", "secondaryButtonHandle", "secondaryButtonLabel", "translatedErrorMessages"]);
51
+ var errorType = props.errorType, errorName = props.errorName, errorMessage = props.errorMessage, primaryButtonHandle = props.primaryButtonHandle, primaryButtonLabel = props.primaryButtonLabel, secondaryButtonHandle = props.secondaryButtonHandle, secondaryButtonLabel = props.secondaryButtonLabel, translatedErrorMessages = props.translatedErrorMessages, className = props.className, rest = __rest(props, ["errorType", "errorName", "errorMessage", "primaryButtonHandle", "primaryButtonLabel", "secondaryButtonHandle", "secondaryButtonLabel", "translatedErrorMessages", "className"]);
51
52
  (0, utils_1.useTheme)();
52
53
  var defaultErrorMessages = __assign({ badGateway: 'Bad gateway', error: 'Error', forbidden: 'Forbidden', internalServerError: 'Internal server error', pageNotFound: 'Page not found', serviceUnavailable: 'Service unavailable', unauthorized: 'Unauthorized' }, translatedErrorMessages);
53
54
  function getErrorIcon() {
@@ -127,7 +128,7 @@ var ErrorPage = function (props) {
127
128
  primaryButton,
128
129
  secondaryButton));
129
130
  }
130
- return (react_1.default.createElement("div", __assign({ className: 'iui-non-ideal-state' }, rest),
131
+ return (react_1.default.createElement("div", __assign({ className: (0, classnames_1.default)('iui-non-ideal-state', className) }, rest),
131
132
  getErrorIcon(),
132
133
  react_1.default.createElement("div", { className: 'iui-non-ideal-state-title' }, getHeadingMessage()),
133
134
  errorMessage && (react_1.default.createElement("div", { className: 'iui-non-ideal-state-description' }, errorMessage)),
@@ -35,7 +35,10 @@ export declare type InformationPanelProps = {
35
35
  * <Text variant='subheading'>InfoPanel heading</Text>
36
36
  * </InformationPanelHeader>
37
37
  * <InformationPanelBody>
38
- * <span>Info panel content</span>
38
+ * <Text>Metadata</Text>
39
+ * <InformationPanelContent ... />
40
+ * <Text>Attributes</Text>
41
+ * <InformationPanelContent ... />
39
42
  * </InformationPanelBody>
40
43
  * </InformationPanel>
41
44
  * </InformationPanelWrapper>
@@ -47,7 +47,10 @@ require("@itwin/itwinui-css/css/information-panel.css");
47
47
  * <Text variant='subheading'>InfoPanel heading</Text>
48
48
  * </InformationPanelHeader>
49
49
  * <InformationPanelBody>
50
- * <span>Info panel content</span>
50
+ * <Text>Metadata</Text>
51
+ * <InformationPanelContent ... />
52
+ * <Text>Attributes</Text>
53
+ * <InformationPanelContent ... />
51
54
  * </InformationPanelBody>
52
55
  * </InformationPanel>
53
56
  * </InformationPanelWrapper>