@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.
@@ -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 = ["innerAs"],
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 SelectButtonInner = /*#__PURE__*/forwardRef(function (_ref2, forwardedRef) {
22
- var _ref2$innerAs = _ref2.innerAs,
23
- innerAs = _ref2$innerAs === void 0 ? 'div' : _ref2$innerAs,
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: SelectButtonInner,
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","SelectButtonInner","innerAs","InputButton","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\nconst SelectButtonInner = forwardRef<\n HTMLButtonElement,\n SelectProps & { innerAs?: ElementType<any> }\n>(({ innerAs = 'div', ...props }, forwardedRef) => {\n const InputButton: FC<SelectProps & RefAttributes<HTMLButtonElement>> =\n Input as any;\n\n return (\n <InputButton as={innerAs} ref={forwardedRef} tabIndex={0} {...props} />\n );\n});\n\nexport const SelectButton = forwardRef<\n HTMLButtonElement,\n SelectProps & MenuButtonProps\n>(({ as, children, ...props }, ref) => (\n <BaseMenuButton as={SelectButtonInner} innerAs={as} ref={ref} {...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,IAAME,iBAAiB,gBAAGV,UAAU,CAGlC,iBAAgCK,YAAhC,EAAiD;EAAA,0BAA9CM,OAA8C;EAAA,IAA9CA,OAA8C,8BAApC,KAAoC;EAAA,IAA1BH,KAA0B;;EACjD,IAAMI,WAA+D,GACnET,KADF;EAGA,oBACE,KAAC,WAAD;IAAa,EAAE,EAAEQ,OAAjB;IAA0B,GAAG,EAAEN,YAA/B;IAA6C,QAAQ,EAAE;EAAvD,GAA8DG,KAA9D,EADF;AAGD,CAVmC,CAApC;AAYA,OAAO,IAAMK,YAAY,gBAAGb,UAAU,CAGpC,iBAA6Bc,GAA7B;EAAA,IAAGR,EAAH,SAAGA,EAAH;EAAA,IAAOS,QAAP,SAAOA,QAAP;EAAA,IAAoBP,KAApB;;EAAA,oBACA,KAAC,cAAD;IAAgB,EAAE,EAAEE,iBAApB;IAAuC,OAAO,EAAEJ,EAAhD;IAAoD,GAAG,EAAEQ;EAAzD,GAAkEN,KAAlE;IAAA,UACGO;EADH,GADA;AAAA,CAHoC,CAA/B"}
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"}