@invoicebox/ui 0.1.0-alpha.174 → 0.1.0-alpha.176
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/dist/components/common/Dropdown/index.d.ts +1 -0
- package/dist/components/common/Dropdown/index.js +4 -2
- package/dist/components/common/Dropdown/index.stories.js +2 -1
- package/dist/components/form/Select/index.d.ts +2 -2
- package/dist/components/form/Select/index.js +4 -2
- package/dist/components/form/Select/index.stories.js +1 -0
- package/package.json +1 -1
|
@@ -32,7 +32,9 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
32
32
|
_ref$width = _ref.width,
|
|
33
33
|
width = _ref$width === void 0 ? 'auto' : _ref$width,
|
|
34
34
|
zIndex = _ref.zIndex,
|
|
35
|
-
onCloseTransitionEnd = _ref.onCloseTransitionEnd
|
|
35
|
+
onCloseTransitionEnd = _ref.onCloseTransitionEnd,
|
|
36
|
+
_ref$isTopPosition = _ref.isTopPosition,
|
|
37
|
+
isTopPosition = _ref$isTopPosition === void 0 ? false : _ref$isTopPosition;
|
|
36
38
|
var palette = (0, _palette.useComponentPalette)('dropdown');
|
|
37
39
|
var position = (0, _react.useRef)({
|
|
38
40
|
isAbove: true,
|
|
@@ -95,7 +97,7 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
95
97
|
belowHeight: belowHeight,
|
|
96
98
|
dropdownIndent: positionVertical
|
|
97
99
|
}) : {
|
|
98
|
-
isAbove:
|
|
100
|
+
isAbove: isTopPosition,
|
|
99
101
|
translateY: '0px'
|
|
100
102
|
};
|
|
101
103
|
}
|
|
@@ -29,7 +29,8 @@ var args = {
|
|
|
29
29
|
width: 'auto',
|
|
30
30
|
zIndex: 5,
|
|
31
31
|
onCloseTransitionEnd: (0, _addonActions.action)('closeTransitionEnd'),
|
|
32
|
-
children: Array(100).fill('children ').join('')
|
|
32
|
+
children: Array(100).fill('children ').join(''),
|
|
33
|
+
isTopPosition: false
|
|
33
34
|
};
|
|
34
35
|
var Default = exports.Default = {
|
|
35
36
|
args: _objectSpread(_objectSpread({}, args), {}, {
|
|
@@ -8,11 +8,11 @@ export type TGroup = {
|
|
|
8
8
|
label: string;
|
|
9
9
|
id: string;
|
|
10
10
|
};
|
|
11
|
-
export type TProps<TValue> = Pick<TInputProps, 'label' | 'hasError' | 'placeholder' | 'onFocus' | 'onBlur' | 'name'> & {
|
|
11
|
+
export type TProps<TValue> = Pick<TInputProps, 'label' | 'hasError' | 'placeholder' | 'onFocus' | 'onBlur' | 'name' | 'size'> & {
|
|
12
12
|
value: TValue | null;
|
|
13
13
|
onChange: (value: TValue | null) => void;
|
|
14
14
|
options: TOption<TValue>[];
|
|
15
15
|
groups?: TGroup[];
|
|
16
16
|
isResetButtonEnabled?: boolean;
|
|
17
17
|
};
|
|
18
|
-
export declare const Select: <TValue extends string | number>({ label, hasError, placeholder, onFocus, onBlur, name, value, onChange, options, groups, isResetButtonEnabled, }: TProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Select: <TValue extends string | number>({ label, hasError, placeholder, onFocus, onBlur, name, value, onChange, options, groups, isResetButtonEnabled, size, }: TProps<TValue>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -37,7 +37,8 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
37
37
|
_ref$groups = _ref.groups,
|
|
38
38
|
groups = _ref$groups === void 0 ? [] : _ref$groups,
|
|
39
39
|
_ref$isResetButtonEna = _ref.isResetButtonEnabled,
|
|
40
|
-
isResetButtonEnabled = _ref$isResetButtonEna === void 0 ? false : _ref$isResetButtonEna
|
|
40
|
+
isResetButtonEnabled = _ref$isResetButtonEna === void 0 ? false : _ref$isResetButtonEna,
|
|
41
|
+
size = _ref.size;
|
|
41
42
|
var palette = (0, _palette.useComponentPalette)('select');
|
|
42
43
|
var _useInputFocus = (0, _useInputFocus2.useInputFocus)({
|
|
43
44
|
onFocus: onFocus,
|
|
@@ -115,7 +116,8 @@ var Select = exports.Select = function Select(_ref) {
|
|
|
115
116
|
value: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || '',
|
|
116
117
|
name: name,
|
|
117
118
|
isOpen: isOpen,
|
|
118
|
-
onReset: isResetButtonEnabled ? handleReset : undefined
|
|
119
|
+
onReset: isResetButtonEnabled ? handleReset : undefined,
|
|
120
|
+
size: size
|
|
119
121
|
})), /*#__PURE__*/_react["default"].createElement(_Dropdown.Dropdown, {
|
|
120
122
|
isOpen: isOpen,
|
|
121
123
|
isAutoPosition: true,
|