@invoicebox/ui 0.1.0-alpha.263 → 0.1.0-alpha.265

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.
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  type TOption<TEntity> = {
3
3
  value: string;
4
4
  entity: TEntity;
5
+ isDisabled?: boolean;
5
6
  };
6
7
  export type TProps<TEntity> = {
7
8
  isOpen: boolean;
@@ -55,6 +55,7 @@ var EntityAutocompleteOptionsDrawer = exports.EntityAutocompleteOptionsDrawer =
55
55
  key: "".concat(option.value).concat(index),
56
56
  tabIndex: -1,
57
57
  type: "button",
58
+ disabled: option.isDisabled,
58
59
  onClick: handleSelect,
59
60
  "data-index": JSON.stringify(index)
60
61
  }, renderOption(option));
@@ -72,7 +72,8 @@ var commonArgs = {
72
72
  entity: {
73
73
  id: '2',
74
74
  name: 'Name two'
75
- }
75
+ },
76
+ isDisabled: true
76
77
  }, {
77
78
  value: '3',
78
79
  entity: {
@@ -18,7 +18,7 @@ var InputWrapper = exports.InputWrapper = _styledComponents["default"].div.withC
18
18
  var OptionWrapper = exports.OptionWrapper = _styledComponents["default"].button.withConfig({
19
19
  displayName: "styles__OptionWrapper",
20
20
  componentId: "sc-r0dl76-2"
21
- })(["width:100%;background:transparent;border:none;cursor:pointer;outline:none;color:inherit;"]);
21
+ })(["width:100%;background:transparent;border:none;cursor:pointer;outline:none;color:inherit;&:disabled{opacity:0.7;cursor:not-allowed;}"]);
22
22
  var ContentWrapper = exports.ContentWrapper = _styledComponents["default"].div.withConfig({
23
23
  displayName: "styles__ContentWrapper",
24
24
  componentId: "sc-r0dl76-3"
@@ -1,4 +1,9 @@
1
- export declare const selectOptions: {
1
+ export declare const selectOptions: ({
2
2
  label: string;
3
3
  value: string;
4
- }[];
4
+ isDisabled?: undefined;
5
+ } | {
6
+ label: string;
7
+ value: string;
8
+ isDisabled: boolean;
9
+ })[];
@@ -12,10 +12,12 @@ var selectOptions = exports.selectOptions = [{
12
12
  value: 'option-2'
13
13
  }, {
14
14
  label: 'Option 3',
15
- value: 'option-3'
15
+ value: 'option-3',
16
+ isDisabled: true
16
17
  }, {
17
18
  label: 'Option 4',
18
- value: 'option-4'
19
+ value: 'option-4',
20
+ isDisabled: true
19
21
  }, {
20
22
  label: 'Option 5',
21
23
  value: 'option-5'
@@ -3,6 +3,7 @@ import { TSizes } from '../../../constants';
3
3
  type TOption = {
4
4
  value: string;
5
5
  entity?: any;
6
+ isDisabled?: boolean;
6
7
  };
7
8
  type TFieldProps = Pick<InputHTMLAttributes<HTMLInputElement>, 'name' | 'onBlur' | 'onFocus' | 'autoFocus' | 'readOnly'> & {
8
9
  value: string;
@@ -139,6 +139,7 @@ var Autocomplete = exports.Autocomplete = /*#__PURE__*/(0, _react.forwardRef)(fu
139
139
  key: "".concat(option.value).concat(index),
140
140
  tabIndex: -1,
141
141
  type: "button",
142
+ disabled: option.isDisabled,
142
143
  onClick: handleSelect,
143
144
  "data-index": JSON.stringify(index)
144
145
  }, renderOption ? renderOption(option) : /*#__PURE__*/_react["default"].createElement(_AutocompleteDefaultOption.AutocompleteDefaultOption, {
@@ -30,7 +30,7 @@ var OptionWrapperWithPadding = exports.OptionWrapperWithPadding = _styledCompone
30
30
  var OptionWrapper = exports.OptionWrapper = _styledComponents["default"].button.withConfig({
31
31
  displayName: "styles__OptionWrapper",
32
32
  componentId: "sc-1fp3ia8-3"
33
- })(["width:100%;background:transparent;border:none;cursor:pointer;outline:none;color:inherit;padding:0;"]);
33
+ })(["width:100%;background:transparent;border:none;cursor:pointer;outline:none;color:inherit;padding:0;&:disabled{opacity:0.7;cursor:not-allowed;}"]);
34
34
  var ChildrenWrapper = exports.ChildrenWrapper = _styledComponents["default"].div.withConfig({
35
35
  displayName: "styles__ChildrenWrapper",
36
36
  componentId: "sc-1fp3ia8-4"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invoicebox/ui",
3
- "version": "0.1.0-alpha.263",
3
+ "version": "0.1.0-alpha.265",
4
4
  "description": "Invoicebox UI",
5
5
  "license": "Apache License 2.0",
6
6
  "scripts": {