@basic-ui/material 1.0.0-alpha.19 → 1.0.0-alpha.20
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/build/cjs/index.js +3 -14
- package/build/cjs/index.js.map +1 -1
- package/build/esm/Select/styledComponents.js +8 -19
- package/build/esm/Select/styledComponents.js.map +1 -1
- package/build/tsconfig-build.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/Menu/ContextMenu.story.tsx +34 -0
- package/src/Select/styledComponents.tsx +2 -14
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["as"],
|
|
4
|
-
_excluded2 = ["
|
|
5
|
-
_excluded3 = ["as", "children"];
|
|
4
|
+
_excluded2 = ["as", "children"];
|
|
6
5
|
import { forwardRef } from 'react';
|
|
7
6
|
import { MenuButton as BaseMenuButton } from '@basic-ui/core';
|
|
8
7
|
import { Input } from '../TextField/Input';
|
|
@@ -18,27 +17,17 @@ export var Select = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
18
17
|
ref: forwardedRef
|
|
19
18
|
}, props));
|
|
20
19
|
});
|
|
21
|
-
var
|
|
22
|
-
var _ref2$
|
|
23
|
-
|
|
20
|
+
export var SelectButton = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
21
|
+
var _ref2$as = _ref2.as,
|
|
22
|
+
as = _ref2$as === void 0 ? 'div' : _ref2$as,
|
|
23
|
+
children = _ref2.children,
|
|
24
24
|
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
25
25
|
|
|
26
|
-
var InputButton = Input;
|
|
27
|
-
return /*#__PURE__*/_jsx(InputButton, _extends({
|
|
28
|
-
as: innerAs,
|
|
29
|
-
ref: forwardedRef,
|
|
30
|
-
tabIndex: 0
|
|
31
|
-
}, props));
|
|
32
|
-
});
|
|
33
|
-
export var SelectButton = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
34
|
-
var as = _ref3.as,
|
|
35
|
-
children = _ref3.children,
|
|
36
|
-
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
37
|
-
|
|
38
26
|
return /*#__PURE__*/_jsx(BaseMenuButton, _extends(_extends({
|
|
39
|
-
as:
|
|
27
|
+
as: Input,
|
|
40
28
|
innerAs: as,
|
|
41
|
-
ref: ref
|
|
29
|
+
ref: ref,
|
|
30
|
+
tabIndex: 0
|
|
42
31
|
}, props), {}, {
|
|
43
32
|
children: children
|
|
44
33
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styledComponents.js","names":["forwardRef","MenuButton","BaseMenuButton","Input","Select","forwardedRef","as","asProp","props","InputSelect","
|
|
1
|
+
{"version":3,"file":"styledComponents.js","names":["forwardRef","MenuButton","BaseMenuButton","Input","Select","forwardedRef","as","asProp","props","InputSelect","SelectButton","ref","children"],"sources":["../../../src/Select/styledComponents.tsx"],"sourcesContent":["import type {\n ElementType,\n FC,\n RefAttributes,\n SelectHTMLAttributes,\n} from 'react';\nimport { forwardRef } from 'react';\nimport type { MenuButtonProps } from '@basic-ui/core';\nimport { MenuButton as BaseMenuButton } from '@basic-ui/core';\n\nimport type { Theme } from '../theme';\nimport { Input } from '../TextField/Input';\n\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n as?: ElementType<any>;\n variant?: 'filled' | 'outlined';\n hasLabel?: boolean;\n theme: Theme;\n leadingIcon?: boolean;\n}\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n ({ as: asProp = 'select', ...props }, forwardedRef) => {\n const InputSelect: FC<SelectProps & RefAttributes<HTMLSelectElement>> =\n Input as any;\n\n return <InputSelect as={asProp} ref={forwardedRef} {...props} />;\n }\n);\n\nexport const SelectButton = forwardRef<\n HTMLButtonElement,\n SelectProps & MenuButtonProps\n>(({ as = 'div', children, ...props }, ref) => (\n <BaseMenuButton as={Input} innerAs={as} ref={ref} tabIndex={0} {...props}>\n {children}\n </BaseMenuButton>\n));\n"],"mappings":";;;;AAMA,SAASA,UAAT,QAA2B,OAA3B;AAEA,SAASC,UAAU,IAAIC,cAAvB,QAA6C,gBAA7C;AAGA,SAASC,KAAT,QAAsB,oBAAtB;;AAUA,OAAO,IAAMC,MAAM,gBAAGJ,UAAU,CAC9B,gBAAsCK,YAAtC,EAAuD;EAAA,mBAApDC,EAAoD;EAAA,IAAhDC,MAAgD,wBAAvC,QAAuC;EAAA,IAA1BC,KAA0B;;EACrD,IAAMC,WAA+D,GACnEN,KADF;EAGA,oBAAO,KAAC,WAAD;IAAa,EAAE,EAAEI,MAAjB;IAAyB,GAAG,EAAEF;EAA9B,GAAgDG,KAAhD,EAAP;AACD,CAN6B,CAAzB;AASP,OAAO,IAAME,YAAY,gBAAGV,UAAU,CAGpC,iBAAqCW,GAArC;EAAA,qBAAGL,EAAH;EAAA,IAAGA,EAAH,yBAAQ,KAAR;EAAA,IAAeM,QAAf,SAAeA,QAAf;EAAA,IAA4BJ,KAA5B;;EAAA,oBACA,KAAC,cAAD;IAAgB,EAAE,EAAEL,KAApB;IAA2B,OAAO,EAAEG,EAApC;IAAwC,GAAG,EAAEK,GAA7C;IAAkD,QAAQ,EAAE;EAA5D,GAAmEH,KAAnE;IAAA,UACGI;EADH,GADA;AAAA,CAHoC,CAA/B"}
|