@vaadin/react-components 25.3.0-beta2 → 25.3.0-beta3

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/TabSheet.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"TabSheet.d.ts","sourceRoot":"","sources":["src/TabSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,IAAI,cAAc,EACrC,MAAM,yBAAyB,CAAC;AAGjC,cAAc,yBAAyB,CAAC;AAExC,KAAK,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,gBAAgB,SAAS,CAAC;AAiB9D,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;AAyCnE,QAAA,MAAM,iBAAiB;;;uDAAuB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"TabSheet.d.ts","sourceRoot":"","sources":["src/TabSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,IAAI,cAAc,EACrC,MAAM,yBAAyB,CAAC;AAGjC,cAAc,yBAAyB,CAAC;AAExC,KAAK,gBAAgB,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,gBAAgB,SAAS,CAAC;AAa9D,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,CAAC;AA8CnE,QAAA,MAAM,iBAAiB;;;uDAAuB,CAAC;AAE/C,OAAO,EAAE,iBAAiB,IAAI,QAAQ,EAAE,CAAC"}
package/TabSheet.js CHANGED
@@ -1,2 +1,2 @@
1
- var c=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},i=(e,t,o,b)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of M(t))!R.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(b=P(t,n))||b.enumerable});return e},r=(e,t,o)=>(i(e,t,"default"),o&&i(o,t,"default"));export*from"@vaadin/tabsheet/vaadin-tabsheet.js";import m,{forwardRef as V}from"react";var p={};S(p,{Tab:()=>h,TabElement:()=>E});r(p,U);import*as U from"@vaadin/tabs/vaadin-tab.js";import{Tab as E}from"@vaadin/tabs/vaadin-tab.js";import*as u from"react";import{createComponent as N}from"./utils/createComponent.js";var _={},h=N({elementClass:E,events:_,react:u,tagName:"vaadin-tab"});import{TabSheet as I}from"@vaadin/tabsheet/vaadin-tabsheet.js";import*as W from"react";import{createComponent as w}from"./utils/createComponent.js";var k={onItemsChanged:"items-changed",onSelectedChanged:"selected-changed"},f=w({elementClass:I,events:k,react:W,tagName:"vaadin-tabsheet"});var s={};S(s,{Tabs:()=>l,TabsElement:()=>y});r(s,ae);import*as ae from"@vaadin/tabs/vaadin-tabs.js";import{Tabs as y}from"@vaadin/tabs/vaadin-tabs.js";import*as F from"react";import{createComponent as A}from"./utils/createComponent.js";var O={onItemsChanged:"items-changed",onSelectedChanged:"selected-changed"},l=A({elementClass:y,events:O,react:F,tagName:"vaadin-tabs"});import{jsx as g,jsxs as D}from"react/jsx-runtime";import{createElement as B}from"react";var v=e=>null,q=0,d=new WeakMap;function T(e){return e.props.id?e.props.id:(d.has(e)||d.set(e,"tabsheet-tab-"+q++),d.get(e))}function z(e,t){let{children:o,...b}=e,n=m.Children.toArray(o).filter(a=>m.isValidElement(a)&&a.type===v),C=m.Children.toArray(o).filter(a=>m.isValidElement(a)&&a.type!==v);return D(f,{...b,ref:t,children:[n.length>0?g(l,{slot:"tabs",children:n.map(a=>{let{children:G,label:H,...x}=a.props;return B(h,{...x,id:T(a),key:T(a)},a.props.label)})}):null,n.map(a=>g("div",{style:{display:"contents"},tab:T(a),children:a.props.children},T(a))),C]})}var be=V(z);export{be as TabSheet,I as TabSheetElement,v as TabSheetTab};
1
+ var y=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var E=(t,e)=>{for(var a in e)y(t,a,{get:e[a],enumerable:!0})},S=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of N(e))!_.call(t,n)&&n!==a&&y(t,n,{get:()=>e[n],enumerable:!(r=u(e,n))||r.enumerable});return t},p=(t,e,a)=>(S(t,e,"default"),a&&S(a,e,"default"));export*from"@vaadin/tabsheet/vaadin-tabsheet.js";import m,{forwardRef as z,useId as B}from"react";var s={};E(s,{Tab:()=>h,TabElement:()=>f});p(s,X);import*as X from"@vaadin/tabs/vaadin-tab.js";import{Tab as f}from"@vaadin/tabs/vaadin-tab.js";import*as I from"react";import{createComponent as W}from"./utils/createComponent.js";var k={},h=W({elementClass:f,events:k,react:I,tagName:"vaadin-tab"});import{TabSheet as w}from"@vaadin/tabsheet/vaadin-tabsheet.js";import*as F from"react";import{createComponent as A}from"./utils/createComponent.js";var O={onItemsChanged:"items-changed",onSelectedChanged:"selected-changed"},v=A({elementClass:w,events:O,react:F,tagName:"vaadin-tabsheet"});var b={};E(b,{Tabs:()=>i,TabsElement:()=>g});p(b,ne);import*as ne from"@vaadin/tabs/vaadin-tabs.js";import{Tabs as g}from"@vaadin/tabs/vaadin-tabs.js";import*as V from"react";import{createComponent as $}from"./utils/createComponent.js";var q={onItemsChanged:"items-changed",onSelectedChanged:"selected-changed"},i=$({elementClass:g,events:q,react:V,tagName:"vaadin-tabs"});import{jsx as P,jsxs as H}from"react/jsx-runtime";import{createElement as G}from"react";var C=t=>null;function x(t,e,a){if(t.props.id)return t.props.id;let r=t.key??String(a);return`${e}tab${r}`}function D(t,e){let{children:a,...r}=t,n=B(),T=m.Children.toArray(a).filter(o=>m.isValidElement(o)&&o.type===C),M=m.Children.toArray(a).filter(o=>m.isValidElement(o)&&o.type!==C);return H(v,{...r,ref:e,children:[T.length>0?P(i,{slot:"tabs",children:T.map((o,d)=>{let{children:l,label:J,...R}=o.props,c=x(o,n,d);return G(h,{...R,id:c,key:c},o.props.label)})}):null,T.map((o,d)=>{let l=x(o,n,d);return P("div",{style:{display:"contents"},tab:l,children:o.props.children},l)}),M]})}var Te=z(D);export{Te as TabSheet,w as TabSheetElement,C as TabSheetTab};
2
2
  //# sourceMappingURL=TabSheet.js.map
package/TabSheet.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["src/TabSheet.tsx", "src/Tab.ts", "src/generated/Tab.ts", "src/generated/TabSheet.ts", "src/Tabs.ts", "src/generated/Tabs.ts"],
4
- "sourcesContent": ["export * from \"@vaadin/tabsheet/vaadin-tabsheet.js\";\nimport React, { forwardRef, type ForwardedRef, type ReactNode } from 'react';\nimport { Tab, type TabProps } from './Tab.js';\nimport {\n TabSheet as _TabSheet,\n type TabSheetElement,\n type TabSheetProps as _TabSheetProps,\n} from './generated/TabSheet.js';\nimport { Tabs } from './Tabs.js';\n\nexport * from './generated/TabSheet.js';\n\ntype TabSheetTabProps = Omit<TabProps, 'selected' | 'value'> & {\n /**\n * The label of the tab.\n */\n label?: ReactNode;\n};\n\ntype TabSheetTab = React.ReactElement<TabSheetTabProps>;\n\n/**\n * `TabSheetTab` is a helper component designed for creating tabs within a `<TabSheet/>`.\n * Use this component as a direct child of the `<TabSheet/>` component.\n * It accepts a `label` property, which can be either a string or a React node.\n * The children of the component will be rendered as the content of the tab.\n *\n * ### Usage\n *\n * ```tsx\n * <TabSheet>\n * <TabSheetTab label=\"Dashboard\">\n * <div>This is the Dashboard tab content</div>\n * </TabSheetTab>\n *\n * <TabSheetTab label={<i>Payment</i>}>\n * <div>This is the Payment tab content</div>\n * </TabSheetTab>\n * </TabSheet>\n * ```\n */\nexport const TabSheetTab = (_props: TabSheetTabProps) => null;\n\nlet uniqueId = 0;\nconst generatedTabIds = new WeakMap<TabSheetTab, string>();\nfunction getTabId(tab: TabSheetTab) {\n if (tab.props.id) {\n // Support custom id for a tabsheet tab\n return tab.props.id;\n }\n\n if (!generatedTabIds.has(tab)) {\n // Generate a temporary id for the tab while it's being rendered\n generatedTabIds.set(tab, 'tabsheet-tab-' + uniqueId++);\n }\n return generatedTabIds.get(tab);\n}\n\nexport type TabSheetProps = Partial<Omit<_TabSheetProps, 'items'>>;\n\nfunction TabSheet(props: TabSheetProps, ref: ForwardedRef<TabSheetElement>) {\n const { children, ...tabSheetRest } = props;\n\n // The direct TabSheetTab children of the TabSheet\n const tabs = React.Children.toArray(children).filter((child): child is TabSheetTab => {\n return React.isValidElement(child) && child.type === TabSheetTab;\n });\n\n // All the other children of the TabSheet\n const remainingChildren = React.Children.toArray(children).filter((child) => {\n return React.isValidElement(child) && child.type !== TabSheetTab;\n });\n\n return (\n <_TabSheet {...tabSheetRest} ref={ref}>\n {tabs.length > 0 ? (\n <Tabs slot=\"tabs\">\n {tabs.map((child) => {\n const { children, label, ...tabRest } = child.props;\n return (\n <Tab {...tabRest} id={getTabId(child)} key={getTabId(child)}>\n {child.props.label}\n </Tab>\n );\n })}\n </Tabs>\n ) : null}\n\n {tabs.map((child) => (\n <div style={{ display: 'contents' }} {...{ tab: getTabId(child) }} key={getTabId(child)}>\n {child.props.children}\n </div>\n ))}\n\n {remainingChildren}\n </_TabSheet>\n );\n}\n\nconst ForwardedTabSheet = forwardRef(TabSheet);\n\nexport { ForwardedTabSheet as TabSheet };\n", "export * from \"@vaadin/tabs/vaadin-tab.js\";\nexport * from './generated/Tab.js';\n", "import type {} from \"@lit/react\";\nimport { Tab as TabElement, } from \"@vaadin/tabs/vaadin-tab.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabElement, };\nexport type TabEventMap = Readonly<{}>;\nconst events = {} as TabEventMap;\nexport type TabProps = WebComponentProps<TabElement, TabEventMap>;\nexport const Tab = createComponent({\n elementClass: TabElement, events, react: React, tagName: \"vaadin-tab\"\n});\n", "import type { EventName } from \"@lit/react\";\nimport { TabSheet as TabSheetElement, type TabSheetEventMap as _TabSheetEventMap, } from \"@vaadin/tabsheet/vaadin-tabsheet.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabSheetElement, };\nexport type TabSheetEventMap = Readonly<{\n onItemsChanged: EventName<_TabSheetEventMap[\"items-changed\"]>;\n onSelectedChanged: EventName<_TabSheetEventMap[\"selected-changed\"]>;\n}>;\nconst events = { onItemsChanged: \"items-changed\", onSelectedChanged: \"selected-changed\" } as TabSheetEventMap;\nexport type TabSheetProps = WebComponentProps<TabSheetElement, TabSheetEventMap>;\nexport const TabSheet = createComponent({\n elementClass: TabSheetElement, events, react: React, tagName: \"vaadin-tabsheet\"\n});\n", "export * from \"@vaadin/tabs/vaadin-tabs.js\";\nexport * from './generated/Tabs.js';\n", "import type { EventName } from \"@lit/react\";\nimport { Tabs as TabsElement, type TabsEventMap as _TabsEventMap, } from \"@vaadin/tabs/vaadin-tabs.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabsElement, };\nexport type TabsEventMap = Readonly<{\n onItemsChanged: EventName<_TabsEventMap[\"items-changed\"]>;\n onSelectedChanged: EventName<_TabsEventMap[\"selected-changed\"]>;\n}>;\nconst events = { onItemsChanged: \"items-changed\", onSelectedChanged: \"selected-changed\" } as TabsEventMap;\nexport type TabsProps = WebComponentProps<TabsElement, TabsEventMap>;\nexport const Tabs = createComponent({\n elementClass: TabsElement, events, react: React, tagName: \"vaadin-tabs\"\n});\n"],
5
- "mappings": "kaAAA,WAAc,sCACd,OAAOA,GAAS,cAAAC,MAAqD,QCDrE,IAAAC,EAAA,GAAAC,EAAAD,EAAA,SAAAE,EAAA,eAAAC,IAAAC,EAAAJ,EAAAK,GAAA,UAAAA,MAAc,6BCCd,OAAS,OAAOC,MAAmB,6BACnC,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAGxD,IAAMC,EAAS,CAAC,EAEHC,EAAMC,EAAgB,CAC/B,aAAcC,EAAY,OAAAH,EAAQ,MAAOI,EAAO,QAAS,YAC7D,CAAC,ECTD,OAAS,YAAYC,MAAoE,sCACzF,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAMxD,IAAMC,EAAS,CAAE,eAAgB,gBAAiB,kBAAmB,kBAAmB,EAE3EC,EAAWC,EAAgB,CACpC,aAAcC,EAAiB,OAAAH,EAAQ,MAAOI,EAAO,QAAS,iBAClE,CAAC,ECbD,IAAAC,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,IAAAC,EAAAJ,EAAAK,IAAA,UAAAA,OAAc,8BCCd,OAAS,QAAQC,MAAwD,8BACzE,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAMxD,IAAMC,EAAS,CAAE,eAAgB,gBAAiB,kBAAmB,kBAAmB,EAE3EC,EAAOC,EAAgB,CAChC,aAAcC,EAAa,OAAAH,EAAQ,MAAOI,EAAO,QAAS,aAC9D,CAAC,EL6DG,OAEI,OAAAC,EAFJ,QAAAC,MAAA,oBAMU,wBAAAC,MAAA,QAvCP,IAAMC,EAAeC,GAA6B,KAErDC,EAAW,EACTC,EAAkB,IAAI,QAC5B,SAASC,EAASC,EAAkB,CAClC,OAAIA,EAAI,MAAM,GAELA,EAAI,MAAM,IAGdF,EAAgB,IAAIE,CAAG,GAE1BF,EAAgB,IAAIE,EAAK,gBAAkBH,GAAU,EAEhDC,EAAgB,IAAIE,CAAG,EAChC,CAIA,SAASC,EAASC,EAAsBC,EAAoC,CAC1E,GAAM,CAAE,SAAAC,EAAU,GAAGC,CAAa,EAAIH,EAGhCI,EAAOC,EAAM,SAAS,QAAQH,CAAQ,EAAE,OAAQI,GAC7CD,EAAM,eAAeC,CAAK,GAAKA,EAAM,OAASb,CACtD,EAGKc,EAAoBF,EAAM,SAAS,QAAQH,CAAQ,EAAE,OAAQI,GAC1DD,EAAM,eAAeC,CAAK,GAAKA,EAAM,OAASb,CACtD,EAED,OACEF,EAACQ,EAAA,CAAW,GAAGI,EAAc,IAAKF,EAC/B,UAAAG,EAAK,OAAS,EACbd,EAACkB,EAAA,CAAK,KAAK,OACR,SAAAJ,EAAK,IAAKE,GAAU,CACnB,GAAM,CAAE,SAAAJ,EAAU,MAAAO,EAAO,GAAGC,CAAQ,EAAIJ,EAAM,MAC9C,OACEd,EAACmB,EAAA,CAAK,GAAGD,EAAS,GAAIb,EAASS,CAAK,EAAG,IAAKT,EAASS,CAAK,GACvDA,EAAM,MAAM,KACf,CAEJ,CAAC,EACH,EACE,KAEHF,EAAK,IAAKE,GACThB,EAAC,OAAI,MAAO,CAAE,QAAS,UAAW,EAAS,IAAKO,EAASS,CAAK,EAC3D,SAAAA,EAAM,MAAM,UADyDT,EAASS,CAAK,CAEtF,CACD,EAEAC,GACH,CAEJ,CAEA,IAAMK,GAAoBC,EAAWd,CAAQ",
6
- "names": ["React", "forwardRef", "Tab_exports", "__export", "Tab", "TabElement", "__reExport", "vaadin_tab_star", "TabElement", "React", "createComponent", "events", "Tab", "createComponent", "TabElement", "React", "TabSheetElement", "React", "createComponent", "events", "TabSheet", "createComponent", "TabSheetElement", "React", "Tabs_exports", "__export", "Tabs", "TabsElement", "__reExport", "vaadin_tabs_star", "TabsElement", "React", "createComponent", "events", "Tabs", "createComponent", "TabsElement", "React", "jsx", "jsxs", "createElement", "TabSheetTab", "_props", "uniqueId", "generatedTabIds", "getTabId", "tab", "TabSheet", "props", "ref", "children", "tabSheetRest", "tabs", "React", "child", "remainingChildren", "Tabs", "label", "tabRest", "Tab", "ForwardedTabSheet", "forwardRef"]
4
+ "sourcesContent": ["export * from \"@vaadin/tabsheet/vaadin-tabsheet.js\";\nimport React, { forwardRef, useId, type ForwardedRef, type ReactNode } from 'react';\nimport { Tab, type TabProps } from './Tab.js';\nimport {\n TabSheet as _TabSheet,\n type TabSheetElement,\n type TabSheetProps as _TabSheetProps,\n} from './generated/TabSheet.js';\nimport { Tabs } from './Tabs.js';\n\nexport * from './generated/TabSheet.js';\n\ntype TabSheetTabProps = Omit<TabProps, 'selected' | 'value'> & {\n /**\n * The label of the tab.\n */\n label?: ReactNode;\n};\n\ntype TabSheetTab = React.ReactElement<TabSheetTabProps>;\n\n/**\n * `TabSheetTab` is a helper component designed for creating tabs within a `<TabSheet/>`.\n * Use this component as a direct child of the `<TabSheet/>` component.\n * It accepts a `label` property, which can be either a string or a React node.\n * The children of the component will be rendered as the content of the tab.\n *\n * ### Usage\n *\n * ```tsx\n * <TabSheet>\n * <TabSheetTab label=\"Dashboard\">\n * <div>This is the Dashboard tab content</div>\n * </TabSheetTab>\n *\n * <TabSheetTab label={<i>Payment</i>}>\n * <div>This is the Payment tab content</div>\n * </TabSheetTab>\n * </TabSheet>\n * ```\n */\nexport const TabSheetTab = (_props: TabSheetTabProps) => null;\n\nfunction getTabId(tab: TabSheetTab, instanceId: string, index: number) {\n if (tab.props.id) {\n // Support custom id for a tabsheet tab\n return tab.props.id;\n }\n\n // Derive a stable id from the TabSheet instance id and the child's key.\n const key = tab.key ?? String(index);\n return `${instanceId}tab${key}`;\n}\n\nexport type TabSheetProps = Partial<Omit<_TabSheetProps, 'items'>>;\n\nfunction TabSheet(props: TabSheetProps, ref: ForwardedRef<TabSheetElement>) {\n const { children, ...tabSheetRest } = props;\n const instanceId = useId();\n\n // The direct TabSheetTab children of the TabSheet\n const tabs = React.Children.toArray(children).filter((child): child is TabSheetTab => {\n return React.isValidElement(child) && child.type === TabSheetTab;\n });\n\n // All the other children of the TabSheet\n const remainingChildren = React.Children.toArray(children).filter((child) => {\n return React.isValidElement(child) && child.type !== TabSheetTab;\n });\n\n return (\n <_TabSheet {...tabSheetRest} ref={ref}>\n {tabs.length > 0 ? (\n <Tabs slot=\"tabs\">\n {tabs.map((child, index) => {\n const { children, label, ...tabRest } = child.props;\n const tabId = getTabId(child, instanceId, index);\n return (\n <Tab {...tabRest} id={tabId} key={tabId}>\n {child.props.label}\n </Tab>\n );\n })}\n </Tabs>\n ) : null}\n\n {tabs.map((child, index) => {\n const tabId = getTabId(child, instanceId, index);\n return (\n <div style={{ display: 'contents' }} {...{ tab: tabId }} key={tabId}>\n {child.props.children}\n </div>\n );\n })}\n\n {remainingChildren}\n </_TabSheet>\n );\n}\n\nconst ForwardedTabSheet = forwardRef(TabSheet);\n\nexport { ForwardedTabSheet as TabSheet };\n", "export * from \"@vaadin/tabs/vaadin-tab.js\";\nexport * from './generated/Tab.js';\n", "import type {} from \"@lit/react\";\nimport { Tab as TabElement, } from \"@vaadin/tabs/vaadin-tab.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabElement, };\nexport type TabEventMap = Readonly<{}>;\nconst events = {} as TabEventMap;\nexport type TabProps = WebComponentProps<TabElement, TabEventMap>;\nexport const Tab = createComponent({\n elementClass: TabElement, events, react: React, tagName: \"vaadin-tab\"\n});\n", "import type { EventName } from \"@lit/react\";\nimport { TabSheet as TabSheetElement, type TabSheetEventMap as _TabSheetEventMap, } from \"@vaadin/tabsheet/vaadin-tabsheet.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabSheetElement, };\nexport type TabSheetEventMap = Readonly<{\n onItemsChanged: EventName<_TabSheetEventMap[\"items-changed\"]>;\n onSelectedChanged: EventName<_TabSheetEventMap[\"selected-changed\"]>;\n}>;\nconst events = { onItemsChanged: \"items-changed\", onSelectedChanged: \"selected-changed\" } as TabSheetEventMap;\nexport type TabSheetProps = WebComponentProps<TabSheetElement, TabSheetEventMap>;\nexport const TabSheet = createComponent({\n elementClass: TabSheetElement, events, react: React, tagName: \"vaadin-tabsheet\"\n});\n", "export * from \"@vaadin/tabs/vaadin-tabs.js\";\nexport * from './generated/Tabs.js';\n", "import type { EventName } from \"@lit/react\";\nimport { Tabs as TabsElement, type TabsEventMap as _TabsEventMap, } from \"@vaadin/tabs/vaadin-tabs.js\";\nimport * as React from \"react\";\nimport { createComponent, type WebComponentProps } from \"../utils/createComponent.js\";\nexport { TabsElement, };\nexport type TabsEventMap = Readonly<{\n onItemsChanged: EventName<_TabsEventMap[\"items-changed\"]>;\n onSelectedChanged: EventName<_TabsEventMap[\"selected-changed\"]>;\n}>;\nconst events = { onItemsChanged: \"items-changed\", onSelectedChanged: \"selected-changed\" } as TabsEventMap;\nexport type TabsProps = WebComponentProps<TabsElement, TabsEventMap>;\nexport const Tabs = createComponent({\n elementClass: TabsElement, events, react: React, tagName: \"vaadin-tabs\"\n});\n"],
5
+ "mappings": "kaAAA,WAAc,sCACd,OAAOA,GAAS,cAAAC,EAAY,SAAAC,MAAgD,QCD5E,IAAAC,EAAA,GAAAC,EAAAD,EAAA,SAAAE,EAAA,eAAAC,IAAAC,EAAAJ,EAAAK,GAAA,UAAAA,MAAc,6BCCd,OAAS,OAAOC,MAAmB,6BACnC,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAGxD,IAAMC,EAAS,CAAC,EAEHC,EAAMC,EAAgB,CAC/B,aAAcC,EAAY,OAAAH,EAAQ,MAAOI,EAAO,QAAS,YAC7D,CAAC,ECTD,OAAS,YAAYC,MAAoE,sCACzF,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAMxD,IAAMC,EAAS,CAAE,eAAgB,gBAAiB,kBAAmB,kBAAmB,EAE3EC,EAAWC,EAAgB,CACpC,aAAcC,EAAiB,OAAAH,EAAQ,MAAOI,EAAO,QAAS,iBAClE,CAAC,ECbD,IAAAC,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,IAAAC,EAAAJ,EAAAK,IAAA,UAAAA,OAAc,8BCCd,OAAS,QAAQC,MAAwD,8BACzE,UAAYC,MAAW,QACvB,OAAS,mBAAAC,MAA+C,6BAMxD,IAAMC,EAAS,CAAE,eAAgB,gBAAiB,kBAAmB,kBAAmB,EAE3EC,EAAOC,EAAgB,CAChC,aAAcC,EAAa,OAAAH,EAAQ,MAAOI,EAAO,QAAS,aAC9D,CAAC,EL0DG,OAEI,OAAAC,EAFJ,QAAAC,MAAA,oBAOU,wBAAAC,MAAA,QArCP,IAAMC,EAAeC,GAA6B,KAEzD,SAASC,EAASC,EAAkBC,EAAoBC,EAAe,CACrE,GAAIF,EAAI,MAAM,GAEZ,OAAOA,EAAI,MAAM,GAInB,IAAMG,EAAMH,EAAI,KAAO,OAAOE,CAAK,EACnC,MAAO,GAAGD,CAAU,MAAME,CAAG,EAC/B,CAIA,SAASC,EAASC,EAAsBC,EAAoC,CAC1E,GAAM,CAAE,SAAAC,EAAU,GAAGC,CAAa,EAAIH,EAChCJ,EAAaQ,EAAM,EAGnBC,EAAOC,EAAM,SAAS,QAAQJ,CAAQ,EAAE,OAAQK,GAC7CD,EAAM,eAAeC,CAAK,GAAKA,EAAM,OAASf,CACtD,EAGKgB,EAAoBF,EAAM,SAAS,QAAQJ,CAAQ,EAAE,OAAQK,GAC1DD,EAAM,eAAeC,CAAK,GAAKA,EAAM,OAASf,CACtD,EAED,OACEF,EAACS,EAAA,CAAW,GAAGI,EAAc,IAAKF,EAC/B,UAAAI,EAAK,OAAS,EACbhB,EAACoB,EAAA,CAAK,KAAK,OACR,SAAAJ,EAAK,IAAI,CAACE,EAAOV,IAAU,CAC1B,GAAM,CAAE,SAAAK,EAAU,MAAAQ,EAAO,GAAGC,CAAQ,EAAIJ,EAAM,MACxCK,EAAQlB,EAASa,EAAOX,EAAYC,CAAK,EAC/C,OACEN,EAACsB,EAAA,CAAK,GAAGF,EAAS,GAAIC,EAAO,IAAKA,GAC/BL,EAAM,MAAM,KACf,CAEJ,CAAC,EACH,EACE,KAEHF,EAAK,IAAI,CAACE,EAAOV,IAAU,CAC1B,IAAMe,EAAQlB,EAASa,EAAOX,EAAYC,CAAK,EAC/C,OACER,EAAC,OAAI,MAAO,CAAE,QAAS,UAAW,EAAS,IAAKuB,EAC7C,SAAAL,EAAM,MAAM,UAD+CK,CAE9D,CAEJ,CAAC,EAEAJ,GACH,CAEJ,CAEA,IAAMM,GAAoBC,EAAWhB,CAAQ",
6
+ "names": ["React", "forwardRef", "useId", "Tab_exports", "__export", "Tab", "TabElement", "__reExport", "vaadin_tab_star", "TabElement", "React", "createComponent", "events", "Tab", "createComponent", "TabElement", "React", "TabSheetElement", "React", "createComponent", "events", "TabSheet", "createComponent", "TabSheetElement", "React", "Tabs_exports", "__export", "Tabs", "TabsElement", "__reExport", "vaadin_tabs_star", "TabsElement", "React", "createComponent", "events", "Tabs", "createComponent", "TabsElement", "React", "jsx", "jsxs", "createElement", "TabSheetTab", "_props", "getTabId", "tab", "instanceId", "index", "key", "TabSheet", "props", "ref", "children", "tabSheetRest", "useId", "tabs", "React", "child", "remainingChildren", "Tabs", "label", "tabRest", "tabId", "Tab", "ForwardedTabSheet", "forwardRef"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/react-components",
3
- "version": "25.3.0-beta2",
3
+ "version": "25.3.0-beta3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -27,70 +27,70 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@lit/react": "^1.0.7",
30
- "@vaadin/a11y-base": "25.3.0-beta2",
31
- "@vaadin/accordion": "25.3.0-beta2",
32
- "@vaadin/app-layout": "25.3.0-beta2",
33
- "@vaadin/avatar": "25.3.0-beta2",
34
- "@vaadin/avatar-group": "25.3.0-beta2",
35
- "@vaadin/badge": "25.3.0-beta2",
36
- "@vaadin/breadcrumbs": "25.3.0-beta2",
37
- "@vaadin/button": "25.3.0-beta2",
38
- "@vaadin/card": "25.3.0-beta2",
39
- "@vaadin/checkbox": "25.3.0-beta2",
40
- "@vaadin/checkbox-group": "25.3.0-beta2",
41
- "@vaadin/combo-box": "25.3.0-beta2",
42
- "@vaadin/component-base": "25.3.0-beta2",
43
- "@vaadin/confirm-dialog": "25.3.0-beta2",
44
- "@vaadin/context-menu": "25.3.0-beta2",
45
- "@vaadin/custom-field": "25.3.0-beta2",
46
- "@vaadin/date-picker": "25.3.0-beta2",
47
- "@vaadin/date-time-picker": "25.3.0-beta2",
48
- "@vaadin/details": "25.3.0-beta2",
49
- "@vaadin/dialog": "25.3.0-beta2",
50
- "@vaadin/email-field": "25.3.0-beta2",
51
- "@vaadin/field-base": "25.3.0-beta2",
52
- "@vaadin/field-highlighter": "25.3.0-beta2",
53
- "@vaadin/form-layout": "25.3.0-beta2",
54
- "@vaadin/grid": "25.3.0-beta2",
55
- "@vaadin/horizontal-layout": "25.3.0-beta2",
56
- "@vaadin/icon": "25.3.0-beta2",
57
- "@vaadin/icons": "25.3.0-beta2",
58
- "@vaadin/input-container": "25.3.0-beta2",
59
- "@vaadin/integer-field": "25.3.0-beta2",
60
- "@vaadin/item": "25.3.0-beta2",
61
- "@vaadin/list-box": "25.3.0-beta2",
62
- "@vaadin/lit-renderer": "25.3.0-beta2",
63
- "@vaadin/login": "25.3.0-beta2",
64
- "@vaadin/markdown": "25.3.0-beta2",
65
- "@vaadin/master-detail-layout": "25.3.0-beta2",
66
- "@vaadin/menu-bar": "25.3.0-beta2",
67
- "@vaadin/message-input": "25.3.0-beta2",
68
- "@vaadin/message-list": "25.3.0-beta2",
69
- "@vaadin/multi-select-combo-box": "25.3.0-beta2",
70
- "@vaadin/notification": "25.3.0-beta2",
71
- "@vaadin/number-field": "25.3.0-beta2",
72
- "@vaadin/overlay": "25.3.0-beta2",
73
- "@vaadin/password-field": "25.3.0-beta2",
74
- "@vaadin/popover": "25.3.0-beta2",
75
- "@vaadin/progress-bar": "25.3.0-beta2",
76
- "@vaadin/radio-group": "25.3.0-beta2",
77
- "@vaadin/scroller": "25.3.0-beta2",
78
- "@vaadin/select": "25.3.0-beta2",
79
- "@vaadin/side-nav": "25.3.0-beta2",
80
- "@vaadin/slider": "25.3.0-beta2",
81
- "@vaadin/split-layout": "25.3.0-beta2",
82
- "@vaadin/switch": "25.3.0-beta2",
83
- "@vaadin/tabs": "25.3.0-beta2",
84
- "@vaadin/tabsheet": "25.3.0-beta2",
85
- "@vaadin/text-area": "25.3.0-beta2",
86
- "@vaadin/text-field": "25.3.0-beta2",
87
- "@vaadin/time-picker": "25.3.0-beta2",
88
- "@vaadin/tooltip": "25.3.0-beta2",
89
- "@vaadin/upload": "25.3.0-beta2",
90
- "@vaadin/vaadin-lumo-styles": "25.3.0-beta2",
91
- "@vaadin/vaadin-themable-mixin": "25.3.0-beta2",
92
- "@vaadin/vertical-layout": "25.3.0-beta2",
93
- "@vaadin/virtual-list": "25.3.0-beta2"
30
+ "@vaadin/a11y-base": "25.3.0-beta3",
31
+ "@vaadin/accordion": "25.3.0-beta3",
32
+ "@vaadin/app-layout": "25.3.0-beta3",
33
+ "@vaadin/avatar": "25.3.0-beta3",
34
+ "@vaadin/avatar-group": "25.3.0-beta3",
35
+ "@vaadin/badge": "25.3.0-beta3",
36
+ "@vaadin/breadcrumbs": "25.3.0-beta3",
37
+ "@vaadin/button": "25.3.0-beta3",
38
+ "@vaadin/card": "25.3.0-beta3",
39
+ "@vaadin/checkbox": "25.3.0-beta3",
40
+ "@vaadin/checkbox-group": "25.3.0-beta3",
41
+ "@vaadin/combo-box": "25.3.0-beta3",
42
+ "@vaadin/component-base": "25.3.0-beta3",
43
+ "@vaadin/confirm-dialog": "25.3.0-beta3",
44
+ "@vaadin/context-menu": "25.3.0-beta3",
45
+ "@vaadin/custom-field": "25.3.0-beta3",
46
+ "@vaadin/date-picker": "25.3.0-beta3",
47
+ "@vaadin/date-time-picker": "25.3.0-beta3",
48
+ "@vaadin/details": "25.3.0-beta3",
49
+ "@vaadin/dialog": "25.3.0-beta3",
50
+ "@vaadin/email-field": "25.3.0-beta3",
51
+ "@vaadin/field-base": "25.3.0-beta3",
52
+ "@vaadin/field-highlighter": "25.3.0-beta3",
53
+ "@vaadin/form-layout": "25.3.0-beta3",
54
+ "@vaadin/grid": "25.3.0-beta3",
55
+ "@vaadin/horizontal-layout": "25.3.0-beta3",
56
+ "@vaadin/icon": "25.3.0-beta3",
57
+ "@vaadin/icons": "25.3.0-beta3",
58
+ "@vaadin/input-container": "25.3.0-beta3",
59
+ "@vaadin/integer-field": "25.3.0-beta3",
60
+ "@vaadin/item": "25.3.0-beta3",
61
+ "@vaadin/list-box": "25.3.0-beta3",
62
+ "@vaadin/lit-renderer": "25.3.0-beta3",
63
+ "@vaadin/login": "25.3.0-beta3",
64
+ "@vaadin/markdown": "25.3.0-beta3",
65
+ "@vaadin/master-detail-layout": "25.3.0-beta3",
66
+ "@vaadin/menu-bar": "25.3.0-beta3",
67
+ "@vaadin/message-input": "25.3.0-beta3",
68
+ "@vaadin/message-list": "25.3.0-beta3",
69
+ "@vaadin/multi-select-combo-box": "25.3.0-beta3",
70
+ "@vaadin/notification": "25.3.0-beta3",
71
+ "@vaadin/number-field": "25.3.0-beta3",
72
+ "@vaadin/overlay": "25.3.0-beta3",
73
+ "@vaadin/password-field": "25.3.0-beta3",
74
+ "@vaadin/popover": "25.3.0-beta3",
75
+ "@vaadin/progress-bar": "25.3.0-beta3",
76
+ "@vaadin/radio-group": "25.3.0-beta3",
77
+ "@vaadin/scroller": "25.3.0-beta3",
78
+ "@vaadin/select": "25.3.0-beta3",
79
+ "@vaadin/side-nav": "25.3.0-beta3",
80
+ "@vaadin/slider": "25.3.0-beta3",
81
+ "@vaadin/split-layout": "25.3.0-beta3",
82
+ "@vaadin/switch": "25.3.0-beta3",
83
+ "@vaadin/tabs": "25.3.0-beta3",
84
+ "@vaadin/tabsheet": "25.3.0-beta3",
85
+ "@vaadin/text-area": "25.3.0-beta3",
86
+ "@vaadin/text-field": "25.3.0-beta3",
87
+ "@vaadin/time-picker": "25.3.0-beta3",
88
+ "@vaadin/tooltip": "25.3.0-beta3",
89
+ "@vaadin/upload": "25.3.0-beta3",
90
+ "@vaadin/vaadin-lumo-styles": "25.3.0-beta3",
91
+ "@vaadin/vaadin-themable-mixin": "25.3.0-beta3",
92
+ "@vaadin/vertical-layout": "25.3.0-beta3",
93
+ "@vaadin/virtual-list": "25.3.0-beta3"
94
94
  },
95
95
  "author": "Vaadin Ltd.",
96
96
  "license": "Apache-2.0",
@@ -1,2 +1,2 @@
1
- import{createComponent as n}from"@lit/react";window.Vaadin??={},window.Vaadin.registrations??=[],window.Vaadin.registrations.push({is:"@vaadin/react-components",version:"25.3.0-beta2"});function o(e){const{elementClass:t}=e;return n("_properties"in t?{...e,elementClass:{name:t.name,prototype:{...t._properties,hidden:Boolean}}}:e)}function r(e){return o(e)}export{o as createComponent,r as createThemedComponent};
1
+ import{createComponent as n}from"@lit/react";window.Vaadin??={},window.Vaadin.registrations??=[],window.Vaadin.registrations.push({is:"@vaadin/react-components",version:"25.3.0-beta3"});function o(e){const{elementClass:t}=e;return n("_properties"in t?{...e,elementClass:{name:t.name,prototype:{...t._properties,hidden:Boolean}}}:e)}function r(e){return o(e)}export{o as createComponent,r as createThemedComponent};
2
2
  //# sourceMappingURL=createComponent.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/utils/createComponent.ts"],
4
- "sourcesContent": ["import { createComponent as _createComponent, type EventName } from '@lit/react';\nimport type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';\nimport type React from 'react';\nimport type { RefAttributes } from 'react';\n\ndeclare const __VERSION__: string;\n\ndeclare global {\n interface VaadinRegistration {\n is: string;\n version: string;\n }\n\n interface Vaadin {\n registrations?: VaadinRegistration[];\n }\n\n interface Window {\n // @ts-expect-error: Different declaration from one of the dependencies.\n Vaadin?: Vaadin;\n }\n}\n\nwindow.Vaadin ??= {};\nwindow.Vaadin.registrations ??= [];\nwindow.Vaadin.registrations.push({\n is: '@vaadin/react-components',\n version: /* updated-by-script */ '25.3.0-beta2',\n});\n\n// TODO: Remove when types from @lit-labs/react are exported\nexport type EventNames = Record<string, EventName | string>;\ntype Constructor<T> = { new (): T; name: string };\ntype PolymerConstructor<T> = Constructor<T> & { _properties: Record<string, unknown> };\ntype Options<I extends HTMLElement, E extends EventNames = {}> = Readonly<{\n displayName?: string;\n elementClass: Constructor<I> | PolymerConstructor<I>;\n events?: E;\n react: typeof window.React;\n tagName: string;\n}>;\n\n// A map of expected event listener types based on EventNames.\ntype EventListeners<R extends EventNames> = {\n [K in keyof R]?: R[K] extends EventName ? (e: R[K]['__eventType']) => void : (e: Event) => void;\n};\n\n// Props derived from custom element class. Currently has limitations of making\n// all properties optional and also surfaces life cycle methods in autocomplete.\n// TODO: LoginOverlay has \"autofocus\" property, so we add it back manually.\ntype ElementProps<I> = Partial<Omit<I, keyof HTMLElement>> & { autofocus?: boolean };\n\n// Acceptable props to the React component.\ntype ComponentProps<I, E extends EventNames = {}> = Omit<\n React.HTMLAttributes<I>,\n // Prefer type of provided event handler props or those on element over\n // built-in HTMLAttributes\n keyof E | keyof ElementProps<I>\n> &\n EventListeners<E> &\n ElementProps<I>;\n\nexport type ThemedWebComponentProps<I extends HTMLElement, E extends EventNames = {}> = ComponentProps<I, E> & {\n /**\n * Attribute that can be used by the component to apply built-in style variants,\n * or to propagate its value to the sub-components in Shadow DOM.\n *\n * @see ThemePropertyMixinClass#_theme\n */\n theme?: string;\n};\n\ntype AllWebComponentProps<I extends HTMLElement, E extends EventNames = {}> = I extends ThemePropertyMixinClass\n ? ThemedWebComponentProps<I, E>\n : ComponentProps<I, E>;\n\nexport type WebComponentProps<I extends HTMLElement, E extends EventNames = {}> = Partial<AllWebComponentProps<I, E>>;\n\n/**\n * The type of a React component created from a Vaadin web component.\n */\nexport type ReactWebComponent<I extends HTMLElement, E extends EventNames = {}> = (\n props: WebComponentProps<I, E> & RefAttributes<I>,\n) => React.ReactElement | null;\n\n/**\n * The type of a React component that always accepts a `theme` property, even if\n * the underlying web component does not use `ThemableMixin` / does not expose\n * `ThemePropertyMixinClass` in its type. Used for components that support theme\n * variants through the `theme` attribute without the mixin.\n */\nexport type ThemedReactWebComponent<I extends HTMLElement, E extends EventNames = {}> = (\n props: Partial<ThemedWebComponentProps<I, E>> & RefAttributes<I>,\n) => React.ReactElement | null;\n\n// We need a separate declaration here; otherwise, the TypeScript fails into the\n// endless loop trying to resolve the typings.\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>(\n options: Options<I, E>,\n): ReactWebComponent<I, E>;\n\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>(options: Options<I, E>): any {\n const { elementClass } = options;\n\n return _createComponent(\n '_properties' in elementClass\n ? {\n ...options,\n // TODO: improve or remove the Polymer workaround\n // 'createComponent' relies on key presence on the custom element class,\n // but Polymer defines properties on the prototype when the first element\n // is created. Workaround: pass a mock object with properties in\n // the prototype.\n elementClass: {\n // @ts-expect-error: it is a specific workaround for Polymer classes.\n name: elementClass.name,\n prototype: { ...elementClass._properties, hidden: Boolean },\n },\n }\n : options,\n );\n}\n\n// A separate declaration is needed here for the same reason as `createComponent`.\nexport function createThemedComponent<I extends HTMLElement, E extends EventNames = {}>(\n options: Options<I, E>,\n): ThemedReactWebComponent<I, E>;\n\n// Creates a React component that always accepts a `theme` property, regardless of\n// whether the underlying web component uses `ThemableMixin`. This only widens the\n// type: the runtime is identical to `createComponent`. `@lit/react` already forwards\n// any prop that is not defined on the element prototype (such as `theme` on a\n// non-`ThemableMixin` element) to the DOM as an attribute, so no runtime change is\n// needed \u2014 this function exists purely to expose `theme` at the type level.\nexport function createThemedComponent<I extends HTMLElement, E extends EventNames = {}>(options: Options<I, E>): any {\n return createComponent(options);\n}\n"],
4
+ "sourcesContent": ["import { createComponent as _createComponent, type EventName } from '@lit/react';\nimport type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';\nimport type React from 'react';\nimport type { RefAttributes } from 'react';\n\ndeclare const __VERSION__: string;\n\ndeclare global {\n interface VaadinRegistration {\n is: string;\n version: string;\n }\n\n interface Vaadin {\n registrations?: VaadinRegistration[];\n }\n\n interface Window {\n // @ts-expect-error: Different declaration from one of the dependencies.\n Vaadin?: Vaadin;\n }\n}\n\nwindow.Vaadin ??= {};\nwindow.Vaadin.registrations ??= [];\nwindow.Vaadin.registrations.push({\n is: '@vaadin/react-components',\n version: /* updated-by-script */ '25.3.0-beta3',\n});\n\n// TODO: Remove when types from @lit-labs/react are exported\nexport type EventNames = Record<string, EventName | string>;\ntype Constructor<T> = { new (): T; name: string };\ntype PolymerConstructor<T> = Constructor<T> & { _properties: Record<string, unknown> };\ntype Options<I extends HTMLElement, E extends EventNames = {}> = Readonly<{\n displayName?: string;\n elementClass: Constructor<I> | PolymerConstructor<I>;\n events?: E;\n react: typeof window.React;\n tagName: string;\n}>;\n\n// A map of expected event listener types based on EventNames.\ntype EventListeners<R extends EventNames> = {\n [K in keyof R]?: R[K] extends EventName ? (e: R[K]['__eventType']) => void : (e: Event) => void;\n};\n\n// Props derived from custom element class. Currently has limitations of making\n// all properties optional and also surfaces life cycle methods in autocomplete.\n// TODO: LoginOverlay has \"autofocus\" property, so we add it back manually.\ntype ElementProps<I> = Partial<Omit<I, keyof HTMLElement>> & { autofocus?: boolean };\n\n// Acceptable props to the React component.\ntype ComponentProps<I, E extends EventNames = {}> = Omit<\n React.HTMLAttributes<I>,\n // Prefer type of provided event handler props or those on element over\n // built-in HTMLAttributes\n keyof E | keyof ElementProps<I>\n> &\n EventListeners<E> &\n ElementProps<I>;\n\nexport type ThemedWebComponentProps<I extends HTMLElement, E extends EventNames = {}> = ComponentProps<I, E> & {\n /**\n * Attribute that can be used by the component to apply built-in style variants,\n * or to propagate its value to the sub-components in Shadow DOM.\n *\n * @see ThemePropertyMixinClass#_theme\n */\n theme?: string;\n};\n\ntype AllWebComponentProps<I extends HTMLElement, E extends EventNames = {}> = I extends ThemePropertyMixinClass\n ? ThemedWebComponentProps<I, E>\n : ComponentProps<I, E>;\n\nexport type WebComponentProps<I extends HTMLElement, E extends EventNames = {}> = Partial<AllWebComponentProps<I, E>>;\n\n/**\n * The type of a React component created from a Vaadin web component.\n */\nexport type ReactWebComponent<I extends HTMLElement, E extends EventNames = {}> = (\n props: WebComponentProps<I, E> & RefAttributes<I>,\n) => React.ReactElement | null;\n\n/**\n * The type of a React component that always accepts a `theme` property, even if\n * the underlying web component does not use `ThemableMixin` / does not expose\n * `ThemePropertyMixinClass` in its type. Used for components that support theme\n * variants through the `theme` attribute without the mixin.\n */\nexport type ThemedReactWebComponent<I extends HTMLElement, E extends EventNames = {}> = (\n props: Partial<ThemedWebComponentProps<I, E>> & RefAttributes<I>,\n) => React.ReactElement | null;\n\n// We need a separate declaration here; otherwise, the TypeScript fails into the\n// endless loop trying to resolve the typings.\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>(\n options: Options<I, E>,\n): ReactWebComponent<I, E>;\n\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>(options: Options<I, E>): any {\n const { elementClass } = options;\n\n return _createComponent(\n '_properties' in elementClass\n ? {\n ...options,\n // TODO: improve or remove the Polymer workaround\n // 'createComponent' relies on key presence on the custom element class,\n // but Polymer defines properties on the prototype when the first element\n // is created. Workaround: pass a mock object with properties in\n // the prototype.\n elementClass: {\n // @ts-expect-error: it is a specific workaround for Polymer classes.\n name: elementClass.name,\n prototype: { ...elementClass._properties, hidden: Boolean },\n },\n }\n : options,\n );\n}\n\n// A separate declaration is needed here for the same reason as `createComponent`.\nexport function createThemedComponent<I extends HTMLElement, E extends EventNames = {}>(\n options: Options<I, E>,\n): ThemedReactWebComponent<I, E>;\n\n// Creates a React component that always accepts a `theme` property, regardless of\n// whether the underlying web component uses `ThemableMixin`. This only widens the\n// type: the runtime is identical to `createComponent`. `@lit/react` already forwards\n// any prop that is not defined on the element prototype (such as `theme` on a\n// non-`ThemableMixin` element) to the DOM as an attribute, so no runtime change is\n// needed \u2014 this function exists purely to expose `theme` at the type level.\nexport function createThemedComponent<I extends HTMLElement, E extends EventNames = {}>(options: Options<I, E>): any {\n return createComponent(options);\n}\n"],
5
5
  "mappings": "AAAA,OAAS,mBAAmBA,MAAwC,aAuBpE,OAAO,SAAW,CAAC,EACnB,OAAO,OAAO,gBAAkB,CAAC,EACjC,OAAO,OAAO,cAAc,KAAK,CAC/B,GAAI,2BACJ,QAAiC,cACnC,CAAC,EAyEM,SAASC,EAAkEC,EAA6B,CAC7G,KAAM,CAAE,aAAAC,CAAa,EAAID,EAEzB,OAAOF,EACL,gBAAiBG,EACb,CACE,GAAGD,EAMH,aAAc,CAEZ,KAAMC,EAAa,KACnB,UAAW,CAAE,GAAGA,EAAa,YAAa,OAAQ,OAAQ,CAC5D,CACF,EACAD,CACN,CACF,CAaO,SAASE,EAAwEF,EAA6B,CACnH,OAAOD,EAAgBC,CAAO,CAChC",
6
6
  "names": ["_createComponent", "createComponent", "options", "elementClass", "createThemedComponent"]
7
7
  }