@kimen/react 0.4.0 → 0.5.0

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.
Files changed (333) hide show
  1. package/NOTICE +3 -7
  2. package/README.md +7 -2
  3. package/dist/ki-accordion.d.ts +1 -1
  4. package/dist/ki-accordion.js +1 -4
  5. package/dist/ki-accordion.js.map +1 -1
  6. package/dist/ki-ai-label.d.ts +1 -1
  7. package/dist/ki-ai-label.js +1 -4
  8. package/dist/ki-ai-label.js.map +1 -1
  9. package/dist/ki-alert.d.ts +1 -1
  10. package/dist/ki-alert.js +1 -4
  11. package/dist/ki-alert.js.map +1 -1
  12. package/dist/ki-audio.d.ts +1 -1
  13. package/dist/ki-audio.js +1 -4
  14. package/dist/ki-audio.js.map +1 -1
  15. package/dist/ki-avatar-group.d.ts +1 -1
  16. package/dist/ki-avatar-group.js +1 -4
  17. package/dist/ki-avatar-group.js.map +1 -1
  18. package/dist/ki-avatar.d.ts +1 -1
  19. package/dist/ki-avatar.js +1 -4
  20. package/dist/ki-avatar.js.map +1 -1
  21. package/dist/ki-badge.d.ts +1 -1
  22. package/dist/ki-badge.js +1 -4
  23. package/dist/ki-badge.js.map +1 -1
  24. package/dist/ki-breadcrumb-item.d.ts +1 -1
  25. package/dist/ki-breadcrumb-item.js +1 -4
  26. package/dist/ki-breadcrumb-item.js.map +1 -1
  27. package/dist/ki-breadcrumb.d.ts +1 -1
  28. package/dist/ki-breadcrumb.js +1 -4
  29. package/dist/ki-breadcrumb.js.map +1 -1
  30. package/dist/ki-button-group.d.ts +1 -1
  31. package/dist/ki-button-group.js +1 -4
  32. package/dist/ki-button-group.js.map +1 -1
  33. package/dist/ki-button.d.ts +1 -1
  34. package/dist/ki-button.js +1 -4
  35. package/dist/ki-button.js.map +1 -1
  36. package/dist/ki-card.d.ts +1 -1
  37. package/dist/ki-card.js +1 -4
  38. package/dist/ki-card.js.map +1 -1
  39. package/dist/ki-carousel-item.d.ts +1 -1
  40. package/dist/ki-carousel-item.js +1 -4
  41. package/dist/ki-carousel-item.js.map +1 -1
  42. package/dist/ki-carousel.d.ts +1 -1
  43. package/dist/ki-carousel.js +1 -4
  44. package/dist/ki-carousel.js.map +1 -1
  45. package/dist/ki-checkbox-group.d.ts +1 -1
  46. package/dist/ki-checkbox-group.js +1 -4
  47. package/dist/ki-checkbox-group.js.map +1 -1
  48. package/dist/ki-checkbox.d.ts +1 -1
  49. package/dist/ki-checkbox.js +1 -4
  50. package/dist/ki-checkbox.js.map +1 -1
  51. package/dist/ki-chip-group.d.ts +1 -1
  52. package/dist/ki-chip-group.js +1 -4
  53. package/dist/ki-chip-group.js.map +1 -1
  54. package/dist/ki-chip.d.ts +1 -1
  55. package/dist/ki-chip.js +1 -4
  56. package/dist/ki-chip.js.map +1 -1
  57. package/dist/ki-citation.d.ts +1 -1
  58. package/dist/ki-citation.js +1 -4
  59. package/dist/ki-citation.js.map +1 -1
  60. package/dist/ki-code-block.d.ts +1 -1
  61. package/dist/ki-code-block.js +1 -4
  62. package/dist/ki-code-block.js.map +1 -1
  63. package/dist/ki-code-input.d.ts +1 -1
  64. package/dist/ki-code-input.js +1 -4
  65. package/dist/ki-code-input.js.map +1 -1
  66. package/dist/ki-combobox.d.ts +1 -1
  67. package/dist/ki-combobox.js +1 -4
  68. package/dist/ki-combobox.js.map +1 -1
  69. package/dist/ki-confirmation.d.ts +1 -1
  70. package/dist/ki-confirmation.js +1 -4
  71. package/dist/ki-confirmation.js.map +1 -1
  72. package/dist/ki-conversation.d.ts +1 -1
  73. package/dist/ki-conversation.js +1 -4
  74. package/dist/ki-conversation.js.map +1 -1
  75. package/dist/ki-copy-button.d.ts +1 -1
  76. package/dist/ki-copy-button.js +1 -4
  77. package/dist/ki-copy-button.js.map +1 -1
  78. package/dist/ki-counter.d.ts +1 -1
  79. package/dist/ki-counter.js +1 -4
  80. package/dist/ki-counter.js.map +1 -1
  81. package/dist/ki-date-picker.d.ts +1 -1
  82. package/dist/ki-date-picker.js +1 -4
  83. package/dist/ki-date-picker.js.map +1 -1
  84. package/dist/ki-details.d.ts +1 -1
  85. package/dist/ki-details.js +1 -4
  86. package/dist/ki-details.js.map +1 -1
  87. package/dist/ki-dialog.d.ts +1 -1
  88. package/dist/ki-dialog.js +1 -4
  89. package/dist/ki-dialog.js.map +1 -1
  90. package/dist/ki-divider.d.ts +1 -1
  91. package/dist/ki-divider.js +1 -4
  92. package/dist/ki-divider.js.map +1 -1
  93. package/dist/ki-drawer.d.ts +1 -1
  94. package/dist/ki-drawer.js +1 -4
  95. package/dist/ki-drawer.js.map +1 -1
  96. package/dist/ki-empty-state.d.ts +1 -1
  97. package/dist/ki-empty-state.js +1 -4
  98. package/dist/ki-empty-state.js.map +1 -1
  99. package/dist/ki-fab-menu-item.d.ts +1 -1
  100. package/dist/ki-fab-menu-item.js +1 -4
  101. package/dist/ki-fab-menu-item.js.map +1 -1
  102. package/dist/ki-fab-menu.d.ts +1 -1
  103. package/dist/ki-fab-menu.js +1 -4
  104. package/dist/ki-fab-menu.js.map +1 -1
  105. package/dist/ki-fab.d.ts +1 -1
  106. package/dist/ki-fab.js +1 -4
  107. package/dist/ki-fab.js.map +1 -1
  108. package/dist/ki-feature-icon.d.ts +1 -1
  109. package/dist/ki-feature-icon.js +1 -4
  110. package/dist/ki-feature-icon.js.map +1 -1
  111. package/dist/ki-file-upload.d.ts +1 -1
  112. package/dist/ki-file-upload.js +1 -4
  113. package/dist/ki-file-upload.js.map +1 -1
  114. package/dist/ki-format-date.d.ts +1 -1
  115. package/dist/ki-format-date.js +1 -4
  116. package/dist/ki-format-date.js.map +1 -1
  117. package/dist/ki-format-number.d.ts +1 -1
  118. package/dist/ki-format-number.js +1 -4
  119. package/dist/ki-format-number.js.map +1 -1
  120. package/dist/ki-grid.d.ts +1 -1
  121. package/dist/ki-grid.js +1 -4
  122. package/dist/ki-grid.js.map +1 -1
  123. package/dist/ki-icon-button.d.ts +1 -1
  124. package/dist/ki-icon-button.js +1 -4
  125. package/dist/ki-icon-button.js.map +1 -1
  126. package/dist/ki-icon.d.ts +1 -1
  127. package/dist/ki-icon.js +1 -4
  128. package/dist/ki-icon.js.map +1 -1
  129. package/dist/ki-image.d.ts +1 -1
  130. package/dist/ki-image.js +1 -4
  131. package/dist/ki-image.js.map +1 -1
  132. package/dist/ki-indicator.d.ts +1 -1
  133. package/dist/ki-indicator.js +1 -4
  134. package/dist/ki-indicator.js.map +1 -1
  135. package/dist/ki-input.d.ts +1 -1
  136. package/dist/ki-input.js +1 -4
  137. package/dist/ki-input.js.map +1 -1
  138. package/dist/ki-link.d.ts +1 -1
  139. package/dist/ki-link.js +1 -4
  140. package/dist/ki-link.js.map +1 -1
  141. package/dist/ki-list-item.d.ts +1 -1
  142. package/dist/ki-list-item.js +1 -4
  143. package/dist/ki-list-item.js.map +1 -1
  144. package/dist/ki-list.d.ts +1 -1
  145. package/dist/ki-list.js +1 -4
  146. package/dist/ki-list.js.map +1 -1
  147. package/dist/ki-markdown.d.ts +1 -1
  148. package/dist/ki-markdown.js +1 -4
  149. package/dist/ki-markdown.js.map +1 -1
  150. package/dist/ki-menu-group.d.ts +1 -1
  151. package/dist/ki-menu-group.js +1 -4
  152. package/dist/ki-menu-group.js.map +1 -1
  153. package/dist/ki-menu-item.d.ts +1 -1
  154. package/dist/ki-menu-item.js +1 -4
  155. package/dist/ki-menu-item.js.map +1 -1
  156. package/dist/ki-menu.d.ts +1 -1
  157. package/dist/ki-menu.js +1 -4
  158. package/dist/ki-menu.js.map +1 -1
  159. package/dist/ki-message.d.ts +1 -1
  160. package/dist/ki-message.js +1 -4
  161. package/dist/ki-message.js.map +1 -1
  162. package/dist/ki-mobile-nav-item.d.ts +1 -1
  163. package/dist/ki-mobile-nav-item.js +1 -4
  164. package/dist/ki-mobile-nav-item.js.map +1 -1
  165. package/dist/ki-mobile-nav.d.ts +1 -1
  166. package/dist/ki-mobile-nav.js +1 -4
  167. package/dist/ki-mobile-nav.js.map +1 -1
  168. package/dist/ki-note.d.ts +1 -1
  169. package/dist/ki-note.js +1 -4
  170. package/dist/ki-note.js.map +1 -1
  171. package/dist/ki-number-input.d.ts +1 -1
  172. package/dist/ki-number-input.js +1 -4
  173. package/dist/ki-number-input.js.map +1 -1
  174. package/dist/ki-option.d.ts +1 -1
  175. package/dist/ki-option.js +1 -4
  176. package/dist/ki-option.js.map +1 -1
  177. package/dist/ki-pagination.d.ts +1 -1
  178. package/dist/ki-pagination.js +1 -4
  179. package/dist/ki-pagination.js.map +1 -1
  180. package/dist/ki-popover.d.ts +1 -1
  181. package/dist/ki-popover.js +1 -4
  182. package/dist/ki-popover.js.map +1 -1
  183. package/dist/ki-progress.d.ts +1 -1
  184. package/dist/ki-progress.js +1 -4
  185. package/dist/ki-progress.js.map +1 -1
  186. package/dist/ki-prompt-input.d.ts +1 -1
  187. package/dist/ki-prompt-input.js +1 -4
  188. package/dist/ki-prompt-input.js.map +1 -1
  189. package/dist/ki-qr.d.ts +1 -1
  190. package/dist/ki-qr.js +1 -4
  191. package/dist/ki-qr.js.map +1 -1
  192. package/dist/ki-radio-group.d.ts +1 -1
  193. package/dist/ki-radio-group.js +1 -4
  194. package/dist/ki-radio-group.js.map +1 -1
  195. package/dist/ki-radio.d.ts +1 -1
  196. package/dist/ki-radio.js +1 -4
  197. package/dist/ki-radio.js.map +1 -1
  198. package/dist/ki-rating.d.ts +1 -1
  199. package/dist/ki-rating.js +1 -4
  200. package/dist/ki-rating.js.map +1 -1
  201. package/dist/ki-reasoning.d.ts +1 -1
  202. package/dist/ki-reasoning.js +1 -4
  203. package/dist/ki-reasoning.js.map +1 -1
  204. package/dist/ki-relative-time.d.ts +1 -1
  205. package/dist/ki-relative-time.js +1 -4
  206. package/dist/ki-relative-time.js.map +1 -1
  207. package/dist/ki-scroller.d.ts +1 -1
  208. package/dist/ki-scroller.js +1 -4
  209. package/dist/ki-scroller.js.map +1 -1
  210. package/dist/ki-search-suggestion.d.ts +1 -1
  211. package/dist/ki-search-suggestion.js +1 -4
  212. package/dist/ki-search-suggestion.js.map +1 -1
  213. package/dist/ki-search.d.ts +1 -1
  214. package/dist/ki-search.js +1 -4
  215. package/dist/ki-search.js.map +1 -1
  216. package/dist/ki-segment.d.ts +1 -1
  217. package/dist/ki-segment.js +1 -4
  218. package/dist/ki-segment.js.map +1 -1
  219. package/dist/ki-segmented-control.d.ts +1 -1
  220. package/dist/ki-segmented-control.js +1 -4
  221. package/dist/ki-segmented-control.js.map +1 -1
  222. package/dist/ki-select.d.ts +1 -1
  223. package/dist/ki-select.js +1 -4
  224. package/dist/ki-select.js.map +1 -1
  225. package/dist/ki-sidebar-group.d.ts +1 -1
  226. package/dist/ki-sidebar-group.js +1 -4
  227. package/dist/ki-sidebar-group.js.map +1 -1
  228. package/dist/ki-sidebar-item.d.ts +1 -1
  229. package/dist/ki-sidebar-item.js +1 -4
  230. package/dist/ki-sidebar-item.js.map +1 -1
  231. package/dist/ki-sidebar.d.ts +1 -1
  232. package/dist/ki-sidebar.js +1 -4
  233. package/dist/ki-sidebar.js.map +1 -1
  234. package/dist/ki-skeleton.d.ts +1 -1
  235. package/dist/ki-skeleton.js +1 -4
  236. package/dist/ki-skeleton.js.map +1 -1
  237. package/dist/ki-slider.d.ts +1 -1
  238. package/dist/ki-slider.js +1 -4
  239. package/dist/ki-slider.js.map +1 -1
  240. package/dist/ki-source.d.ts +1 -1
  241. package/dist/ki-source.js +1 -4
  242. package/dist/ki-source.js.map +1 -1
  243. package/dist/ki-sources.d.ts +1 -1
  244. package/dist/ki-sources.js +1 -4
  245. package/dist/ki-sources.js.map +1 -1
  246. package/dist/ki-spinner.d.ts +1 -1
  247. package/dist/ki-spinner.js +1 -4
  248. package/dist/ki-spinner.js.map +1 -1
  249. package/dist/ki-stack.d.ts +1 -1
  250. package/dist/ki-stack.js +1 -4
  251. package/dist/ki-stack.js.map +1 -1
  252. package/dist/ki-stat.d.ts +1 -1
  253. package/dist/ki-stat.js +1 -4
  254. package/dist/ki-stat.js.map +1 -1
  255. package/dist/ki-status.d.ts +1 -1
  256. package/dist/ki-status.js +1 -4
  257. package/dist/ki-status.js.map +1 -1
  258. package/dist/ki-step.d.ts +1 -1
  259. package/dist/ki-step.js +1 -4
  260. package/dist/ki-step.js.map +1 -1
  261. package/dist/ki-stepper.d.ts +1 -1
  262. package/dist/ki-stepper.js +1 -4
  263. package/dist/ki-stepper.js.map +1 -1
  264. package/dist/ki-suggestion.d.ts +1 -1
  265. package/dist/ki-suggestion.js +1 -4
  266. package/dist/ki-suggestion.js.map +1 -1
  267. package/dist/ki-suggestions.d.ts +1 -1
  268. package/dist/ki-suggestions.js +1 -4
  269. package/dist/ki-suggestions.js.map +1 -1
  270. package/dist/ki-switch.d.ts +1 -1
  271. package/dist/ki-switch.js +1 -4
  272. package/dist/ki-switch.js.map +1 -1
  273. package/dist/ki-tab-panel.d.ts +1 -1
  274. package/dist/ki-tab-panel.js +1 -4
  275. package/dist/ki-tab-panel.js.map +1 -1
  276. package/dist/ki-tab.d.ts +1 -1
  277. package/dist/ki-tab.js +1 -4
  278. package/dist/ki-tab.js.map +1 -1
  279. package/dist/ki-table.d.ts +1 -1
  280. package/dist/ki-table.js +1 -4
  281. package/dist/ki-table.js.map +1 -1
  282. package/dist/ki-tabs.d.ts +1 -1
  283. package/dist/ki-tabs.js +1 -4
  284. package/dist/ki-tabs.js.map +1 -1
  285. package/dist/ki-textarea.d.ts +1 -1
  286. package/dist/ki-textarea.js +1 -4
  287. package/dist/ki-textarea.js.map +1 -1
  288. package/dist/ki-time-input.d.ts +1 -1
  289. package/dist/ki-time-input.js +1 -4
  290. package/dist/ki-time-input.js.map +1 -1
  291. package/dist/ki-timeline-item.d.ts +1 -1
  292. package/dist/ki-timeline-item.js +1 -4
  293. package/dist/ki-timeline-item.js.map +1 -1
  294. package/dist/ki-timeline.d.ts +1 -1
  295. package/dist/ki-timeline.js +1 -4
  296. package/dist/ki-timeline.js.map +1 -1
  297. package/dist/ki-toast.d.ts +1 -1
  298. package/dist/ki-toast.js +1 -4
  299. package/dist/ki-toast.js.map +1 -1
  300. package/dist/ki-toaster.d.ts +1 -1
  301. package/dist/ki-toaster.js +1 -4
  302. package/dist/ki-toaster.js.map +1 -1
  303. package/dist/ki-tool-call.d.ts +1 -1
  304. package/dist/ki-tool-call.js +1 -4
  305. package/dist/ki-tool-call.js.map +1 -1
  306. package/dist/ki-toolbar.d.ts +1 -1
  307. package/dist/ki-toolbar.js +1 -4
  308. package/dist/ki-toolbar.js.map +1 -1
  309. package/dist/ki-tooltip.d.ts +1 -1
  310. package/dist/ki-tooltip.js +1 -4
  311. package/dist/ki-tooltip.js.map +1 -1
  312. package/dist/ki-top-nav.d.ts +1 -1
  313. package/dist/ki-top-nav.js +1 -4
  314. package/dist/ki-top-nav.js.map +1 -1
  315. package/dist/ki-tree-item.d.ts +1 -1
  316. package/dist/ki-tree-item.js +1 -4
  317. package/dist/ki-tree-item.js.map +1 -1
  318. package/dist/ki-tree.d.ts +1 -1
  319. package/dist/ki-tree.js +1 -4
  320. package/dist/ki-tree.js.map +1 -1
  321. package/dist/ki-video.d.ts +1 -1
  322. package/dist/ki-video.js +1 -4
  323. package/dist/ki-video.js.map +1 -1
  324. package/dist/runtime.d.ts +19 -0
  325. package/dist/runtime.js +91 -0
  326. package/dist/runtime.js.map +1 -0
  327. package/package.json +4 -5
  328. package/dist/stencil-runtime/create-component-ICzm58MY.js +0 -40
  329. package/dist/stencil-runtime/create-component-ICzm58MY.js.map +0 -1
  330. package/dist/stencil-runtime/create-component.d.ts +0 -24
  331. package/dist/stencil-runtime/runtime.d.ts +0 -2
  332. package/dist/stencil-runtime/runtime.js +0 -5
  333. package/dist/stencil-runtime/runtime.js.map +0 -1
package/dist/ki-tree.js CHANGED
@@ -4,14 +4,11 @@
4
4
  * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  */
6
6
  /* eslint-disable */
7
- import React from 'react';
8
- import { createComponent } from './stencil-runtime/runtime.js';
7
+ import { createComponent } from './runtime.js';
9
8
  import { KiTree as KiTreeElement, defineCustomElement as defineKiTree } from '@kimen/elements/components/ki-tree.js';
10
9
  export const KiTree = /*@__PURE__*/ createComponent({
11
10
  tagName: 'ki-tree',
12
11
  elementClass: KiTreeElement,
13
- // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
14
- react: React,
15
12
  events: {
16
13
  onKiSelectionChange: 'ki-selection-change'
17
14
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ki-tree.js","sourceRoot":"","sources":["../src/ki-tree.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;GAGG;AAEH,oBAAoB;AAEpB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAAsC,CAAC;AAEvE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,mBAAmB,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAQrH,MAAM,CAAC,MAAM,MAAM,GAA0E,aAAa,CAAC,eAAe,CAAiD;IACvK,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,aAAa;IAC3B,0GAA0G;IAC1G,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,mBAAmB,EAAE,qBAAqB;KAC3B;IACjB,mBAAmB,EAAE,YAAY;CACpC,CAAC,CAAC","sourcesContent":["'use client';\n\n/**\n * This file was automatically generated by the Stencil React Output Target.\n * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\n/* eslint-disable */\n\nimport React from 'react';\nimport { createComponent } from '@stencil/react-output-target/runtime';\nimport type { Components } from '@kimen/elements/components';\nimport { KiTree as KiTreeElement, defineCustomElement as defineKiTree } from '@kimen/elements/components/ki-tree.js';\nimport type { KiTreeCustomEvent } from '@kimen/elements/components';\nimport type { StencilReactComponent, EventName } from '@stencil/react-output-target/runtime';\n\nexport type KiTreeEvents = {\n onKiSelectionChange: EventName<KiTreeCustomEvent<{ selectedItems: HTMLKiTreeItemElement[] }>>\n};\n\nexport const KiTree: StencilReactComponent<KiTreeElement, KiTreeEvents, Components.KiTree> = /*@__PURE__*/ createComponent<KiTreeElement, KiTreeEvents, Components.KiTree>({\n tagName: 'ki-tree',\n elementClass: KiTreeElement,\n // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.\n react: React,\n events: {\n onKiSelectionChange: 'ki-selection-change'\n } as KiTreeEvents,\n defineCustomElement: defineKiTree,\n});\n"]}
1
+ {"version":3,"file":"ki-tree.js","sourceRoot":"","sources":["../src/ki-tree.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;GAGG;AAEH,oBAAoB;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,mBAAmB,IAAI,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAQrH,MAAM,CAAC,MAAM,MAAM,GAA0E,aAAa,CAAC,eAAe,CAAiD;IACvK,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,aAAa;IAC3B,MAAM,EAAE;QACN,mBAAmB,EAAE,qBAAqB;KAC3B;IACjB,mBAAmB,EAAE,YAAY;CACpC,CAAC,CAAC","sourcesContent":["'use client';\n\n/**\n * This file was automatically generated by the Stencil React Output Target.\n * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\n/* eslint-disable */\n\nimport { createComponent } from './runtime.js';\nimport type { Components } from '@kimen/elements/components';\nimport { KiTree as KiTreeElement, defineCustomElement as defineKiTree } from '@kimen/elements/components/ki-tree.js';\nimport type { KiTreeCustomEvent } from '@kimen/elements/components';\nimport type { StencilReactComponent, EventName } from './runtime.js';\n\nexport type KiTreeEvents = {\n onKiSelectionChange: EventName<KiTreeCustomEvent<{ selectedItems: HTMLKiTreeItemElement[] }>>\n};\n\nexport const KiTree: StencilReactComponent<KiTreeElement, KiTreeEvents, Components.KiTree> = /*@__PURE__*/ createComponent<KiTreeElement, KiTreeEvents, Components.KiTree>({\n tagName: 'ki-tree',\n elementClass: KiTreeElement,\n events: {\n onKiSelectionChange: 'ki-selection-change'\n } as KiTreeEvents,\n defineCustomElement: defineKiTree,\n});\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { Components } from '@kimen/elements/components';
2
2
  import { KiVideo as KiVideoElement } from '@kimen/elements/components/ki-video.js';
3
- import type { StencilReactComponent } from './stencil-runtime/runtime.js';
3
+ import type { StencilReactComponent } from './runtime.js';
4
4
  export type KiVideoEvents = NonNullable<unknown>;
5
5
  export declare const KiVideo: StencilReactComponent<KiVideoElement, KiVideoEvents, Components.KiVideo, 'label'>;
package/dist/ki-video.js CHANGED
@@ -4,14 +4,11 @@
4
4
  * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
5
5
  */
6
6
  /* eslint-disable */
7
- import React from 'react';
8
- import { createComponent } from './stencil-runtime/runtime.js';
7
+ import { createComponent } from './runtime.js';
9
8
  import { KiVideo as KiVideoElement, defineCustomElement as defineKiVideo } from '@kimen/elements/components/ki-video.js';
10
9
  export const KiVideo = /*@__PURE__*/ createComponent({
11
10
  tagName: 'ki-video',
12
11
  elementClass: KiVideoElement,
13
- // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
14
- react: React,
15
12
  events: {},
16
13
  defineCustomElement: defineKiVideo,
17
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ki-video.js","sourceRoot":"","sources":["../src/ki-video.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;GAGG;AAEH,oBAAoB;AAEpB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,8BAAsC,CAAC;AAEvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,mBAAmB,IAAI,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAKzH,MAAM,CAAC,MAAM,OAAO,GAAsF,aAAa,CAAC,eAAe,CAA6D;IAChM,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,cAAc;IAC5B,0GAA0G;IAC1G,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,EAAmB;IAC3B,mBAAmB,EAAE,aAAa;CACrC,CAAC,CAAC","sourcesContent":["'use client';\n\n/**\n * This file was automatically generated by the Stencil React Output Target.\n * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\n/* eslint-disable */\n\nimport React from 'react';\nimport { createComponent } from '@stencil/react-output-target/runtime';\nimport type { Components } from '@kimen/elements/components';\nimport { KiVideo as KiVideoElement, defineCustomElement as defineKiVideo } from '@kimen/elements/components/ki-video.js';\nimport type { StencilReactComponent } from '@stencil/react-output-target/runtime';\n\nexport type KiVideoEvents = NonNullable<unknown>;\n\nexport const KiVideo: StencilReactComponent<KiVideoElement, KiVideoEvents, Components.KiVideo, 'label'> = /*@__PURE__*/ createComponent<KiVideoElement, KiVideoEvents, Components.KiVideo, 'label'>({\n tagName: 'ki-video',\n elementClass: KiVideoElement,\n // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.\n react: React,\n events: {} as KiVideoEvents,\n defineCustomElement: defineKiVideo,\n});\n"]}
1
+ {"version":3,"file":"ki-video.js","sourceRoot":"","sources":["../src/ki-video.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;GAGG;AAEH,oBAAoB;AAEpB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,mBAAmB,IAAI,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAKzH,MAAM,CAAC,MAAM,OAAO,GAAsF,aAAa,CAAC,eAAe,CAA6D;IAChM,OAAO,EAAE,UAAU;IACnB,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,EAAmB;IAC3B,mBAAmB,EAAE,aAAa;CACrC,CAAC,CAAC","sourcesContent":["'use client';\n\n/**\n * This file was automatically generated by the Stencil React Output Target.\n * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\n/* eslint-disable */\n\nimport { createComponent } from './runtime.js';\nimport type { Components } from '@kimen/elements/components';\nimport { KiVideo as KiVideoElement, defineCustomElement as defineKiVideo } from '@kimen/elements/components/ki-video.js';\nimport type { StencilReactComponent } from './runtime.js';\n\nexport type KiVideoEvents = NonNullable<unknown>;\n\nexport const KiVideo: StencilReactComponent<KiVideoElement, KiVideoEvents, Components.KiVideo, 'label'> = /*@__PURE__*/ createComponent<KiVideoElement, KiVideoEvents, Components.KiVideo, 'label'>({\n tagName: 'ki-video',\n elementClass: KiVideoElement,\n events: {} as KiVideoEvents,\n defineCustomElement: defineKiVideo,\n});\n"]}
@@ -0,0 +1,19 @@
1
+ import type { FunctionComponent, HTMLAttributes, RefAttributes } from 'react';
2
+ export type EventName<T extends Event = Event> = string & {
3
+ __eventType: T;
4
+ };
5
+ type EventNames = Record<string, string>;
6
+ type NoEvents = {};
7
+ type StencilProps<I extends HTMLElement, E extends EventNames, C, R extends keyof C> = Omit<HTMLAttributes<I>, keyof E> & Partial<{
8
+ [K in keyof E]: E[K] extends EventName<infer T> ? (event: T) => void : (event: any) => void;
9
+ }> & Required<Pick<C, R>> & Partial<Omit<C, R>> & RefAttributes<I>;
10
+ export type StencilReactComponent<I extends HTMLElement, E extends EventNames = NoEvents, C = Omit<I, keyof HTMLElement>, R extends keyof C = never> = FunctionComponent<StencilProps<I, E, C, R>>;
11
+ export declare function createComponent<I extends HTMLElement, E extends EventNames = NoEvents, C = Omit<I, keyof HTMLElement>, R extends keyof C = never>({ tagName, elementClass, events, defineCustomElement, }: {
12
+ tagName: string;
13
+ elementClass: {
14
+ prototype: I;
15
+ };
16
+ events: E;
17
+ defineCustomElement: () => void;
18
+ }): StencilReactComponent<I, E, C, R>;
19
+ export {};
@@ -0,0 +1,91 @@
1
+ import { createElement, forwardRef, useCallback, useEffect, useLayoutEffect, useRef } from 'react';
2
+ const useCommitEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;
3
+ const reactOnly = new Set(['children', 'localName', 'style']);
4
+ const classTokens = (value) => value.match(/\S+/gu) ?? [];
5
+ export function createComponent({ tagName, elementClass, events, defineCustomElement, }) {
6
+ defineCustomElement();
7
+ const eventNames = events;
8
+ const eventName = (key) => (Object.hasOwn(events, key) ? eventNames[key] : undefined);
9
+ const Component = forwardRef((props, ref) => {
10
+ const host = useRef(null);
11
+ const previous = useRef({});
12
+ const listeners = useRef(new Map());
13
+ const previousClass = useRef('');
14
+ const { className, class: legacyClass, ...rest } = props;
15
+ const nextClass = (className ?? legacyClass ?? '');
16
+ const reactProps = {};
17
+ const elementProps = {};
18
+ for (const key of Object.keys(rest)) {
19
+ const useProperty = !reactOnly.has(key) && (key in elementClass.prototype || eventName(key) !== undefined);
20
+ (useProperty ? elementProps : reactProps)[key] = rest[key];
21
+ }
22
+ useCommitEffect(() => {
23
+ const node = host.current;
24
+ if (!node)
25
+ return;
26
+ const properties = node;
27
+ const old = previous.current;
28
+ for (const key of new Set([...Object.keys(elementProps), ...Object.keys(old)])) {
29
+ const value = elementProps[key];
30
+ const event = eventName(key);
31
+ if (event) {
32
+ const listener = listeners.current.get(event);
33
+ if (typeof value === 'function') {
34
+ // Keep the wrapper's registration separate from native listeners
35
+ // that might use the same callback, and preserve listener order.
36
+ if (listener)
37
+ listener.handleEvent = value;
38
+ else {
39
+ const registration = { handleEvent: value };
40
+ listeners.current.set(event, registration);
41
+ node.addEventListener(event, registration);
42
+ }
43
+ }
44
+ else if (listener) {
45
+ node.removeEventListener(event, listener);
46
+ listeners.current.delete(event);
47
+ }
48
+ }
49
+ else {
50
+ properties[key] = value;
51
+ if (value == null && key in HTMLElement.prototype)
52
+ node.removeAttribute(key);
53
+ }
54
+ }
55
+ previous.current = elementProps;
56
+ // Stencil also owns classes on the host, including hydration and scope markers.
57
+ if (previousClass.current !== nextClass) {
58
+ const desired = classTokens(nextClass);
59
+ for (const token of classTokens(previousClass.current)) {
60
+ if (!desired.includes(token))
61
+ node.classList.remove(token);
62
+ }
63
+ node.classList.add(...desired);
64
+ previousClass.current = nextClass;
65
+ }
66
+ });
67
+ useCommitEffect(() => {
68
+ const node = host.current;
69
+ if (!node)
70
+ return;
71
+ const registrations = listeners.current;
72
+ node.removeAttribute('defer-hydration');
73
+ return () => {
74
+ for (const [event, listener] of registrations)
75
+ node.removeEventListener(event, listener);
76
+ registrations.clear();
77
+ };
78
+ }, []);
79
+ const attach = useCallback((node) => {
80
+ host.current = node;
81
+ if (typeof ref === 'function')
82
+ ref(node);
83
+ else if (ref)
84
+ ref.current = node;
85
+ }, [ref]);
86
+ return createElement(tagName, { ...reactProps, ref: attach, suppressHydrationWarning: true });
87
+ });
88
+ Component.displayName = tagName;
89
+ return Component;
90
+ }
91
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AA2BnG,MAAM,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC;AACpF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAC9D,MAAM,WAAW,GAAG,CAAC,KAAa,EAAY,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;AAE5E,MAAM,UAAU,eAAe,CAK7B,EACA,OAAO,EACP,YAAY,EACZ,MAAM,EACN,mBAAmB,GAMpB;IACC,mBAAmB,EAAE,CAAC;IACtB,MAAM,UAAU,GAAe,MAAM,CAAC;IACtC,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,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AAE,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;IACH,SAAS,CAAC,WAAW,GAAG,OAAO,CAAC;IAChC,OAAO,SAAyD,CAAC;AACnE,CAAC","sourcesContent":["import { createElement, forwardRef, useCallback, useEffect, useLayoutEffect, useRef } from 'react';\nimport type { FunctionComponent, HTMLAttributes, RefAttributes } from 'react';\n\nexport type EventName<T extends Event = Event> = string & { __eventType: T };\ntype EventNames = Record<string, string>;\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/consistent-type-definitions -- preserve the generated default event type\ntype NoEvents = {};\ntype StencilProps<I extends HTMLElement, E extends EventNames, C, R extends keyof C> = Omit<\n HTMLAttributes<I>,\n keyof E\n> &\n Partial<{\n // Match the generated event type, including the fallback for an untyped name.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- preserve the wrapper's existing event signature\n [K in keyof E]: E[K] extends EventName<infer T> ? (event: T) => void : (event: any) => void;\n }> &\n Required<Pick<C, R>> &\n Partial<Omit<C, R>> &\n RefAttributes<I>;\n\nexport type StencilReactComponent<\n I extends HTMLElement,\n E extends EventNames = NoEvents,\n C = Omit<I, keyof HTMLElement>,\n R extends keyof C = never,\n> = FunctionComponent<StencilProps<I, E, C, R>>;\n\nconst useCommitEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\nconst reactOnly = new Set(['children', 'localName', 'style']);\nconst classTokens = (value: string): string[] => value.match(/\\S+/gu) ?? [];\n\nexport function createComponent<\n I extends HTMLElement,\n E extends EventNames = NoEvents,\n C = Omit<I, keyof HTMLElement>,\n R extends keyof C = never,\n>({\n tagName,\n elementClass,\n events,\n defineCustomElement,\n}: {\n tagName: string;\n elementClass: { prototype: I };\n events: E;\n defineCustomElement: () => void;\n}): StencilReactComponent<I, E, C, R> {\n defineCustomElement();\n const eventNames: EventNames = events;\n const eventName = (key: string) => (Object.hasOwn(events, key) ? eventNames[key] : undefined);\n\n const Component = forwardRef<I, StencilProps<I, E, C, R>>((props, ref) => {\n const host = useRef<I | null>(null);\n const previous = useRef<Record<string, unknown>>({});\n const listeners = useRef(new Map<string, EventListenerObject>());\n const previousClass = useRef('');\n const { className, class: legacyClass, ...rest } = props as Record<string, unknown>;\n const nextClass = (className ?? legacyClass ?? '') as string;\n const reactProps: Record<string, unknown> = {};\n const elementProps: Record<string, unknown> = {};\n for (const key of Object.keys(rest)) {\n const useProperty =\n !reactOnly.has(key) && (key in elementClass.prototype || eventName(key) !== undefined);\n (useProperty ? elementProps : reactProps)[key] = rest[key];\n }\n\n useCommitEffect(() => {\n const node = host.current;\n if (!node) return;\n const properties = node as unknown as Record<string, unknown>;\n const old = previous.current;\n for (const key of new Set([...Object.keys(elementProps), ...Object.keys(old)])) {\n const value = elementProps[key];\n const event = eventName(key);\n if (event) {\n const listener = listeners.current.get(event);\n if (typeof value === 'function') {\n // Keep the wrapper's registration separate from native listeners\n // that might use the same callback, and preserve listener order.\n if (listener) listener.handleEvent = value as EventListener;\n else {\n const registration = { handleEvent: value as EventListener };\n listeners.current.set(event, registration);\n node.addEventListener(event, registration);\n }\n } else if (listener) {\n node.removeEventListener(event, listener);\n listeners.current.delete(event);\n }\n } else {\n properties[key] = value;\n if (value == null && key in HTMLElement.prototype) node.removeAttribute(key);\n }\n }\n previous.current = elementProps;\n\n // Stencil also owns classes on the host, including hydration and scope markers.\n if (previousClass.current !== nextClass) {\n const desired = classTokens(nextClass);\n for (const token of classTokens(previousClass.current)) {\n if (!desired.includes(token)) node.classList.remove(token);\n }\n node.classList.add(...desired);\n previousClass.current = nextClass;\n }\n });\n\n useCommitEffect(() => {\n const node = host.current;\n if (!node) return;\n const registrations = listeners.current;\n node.removeAttribute('defer-hydration');\n return () => {\n for (const [event, listener] of registrations) node.removeEventListener(event, listener);\n registrations.clear();\n };\n }, []);\n\n const attach = useCallback(\n (node: I | null) => {\n host.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref],\n );\n return createElement(tagName, { ...reactProps, ref: attach, suppressHydrationWarning: true });\n });\n Component.displayName = tagName;\n return Component as unknown as StencilReactComponent<I, E, C, R>;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimen/react",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "description": "Generated React bindings for the Kimen ki-* web components (spec 034): typed props from the component contract, ki-* custom events as callback props, tree-shakable per-component imports. Client-side rendering; generated from the same source of truth as every other Kimen artifact and never hand-edited.",
@@ -28,13 +28,12 @@
28
28
  }
29
29
  },
30
30
  "scripts": {
31
- "build": "tsc -b --pretty false && node scripts/vendor-runtime.mjs",
32
- "test": "node --test scripts/vendor-runtime.test.mjs && vitest run --project react-wrapper-node",
31
+ "build": "tsc -b --pretty false && node scripts/check-runtime-imports.mjs",
32
+ "test": "vitest run --project react-wrapper-node",
33
33
  "test-browser-wrapper": "vitest run --project react-wrapper-browser"
34
34
  },
35
35
  "dependencies": {
36
- "@kimen/elements": "0.4.0",
37
- "@lit/react": "1.0.8"
36
+ "@kimen/elements": "0.5.0"
38
37
  },
39
38
  "peerDependencies": {
40
39
  "react": "^18 || ^19",
@@ -1,40 +0,0 @@
1
- import { createComponent as h } from "@lit/react";
2
- import n from "react";
3
- const p = (s) => s ? s.split(/\s+/).filter(Boolean) : [], w = (s, r, l) => {
4
- const o = new Set(p(r)), f = new Set(p(l)), c = [];
5
- for (const e of s)
6
- o.has(e) ? (c.push(e), o.delete(e)) : f.has(e) || c.push(e);
7
- for (const e of o)
8
- c.push(e);
9
- return c.join(" ");
10
- }, g = typeof window < "u" ? n.useLayoutEffect : n.useEffect, L = ({
11
- defineCustomElement: s,
12
- tagName: r,
13
- transformTag: l,
14
- ...o
15
- }) => {
16
- typeof s < "u" && s();
17
- const f = l ? l(r) : r, c = h({ ...o, tagName: f }), e = n.forwardRef((N, a) => {
18
- const {
19
- className: C,
20
- class: d,
21
- ...y
22
- } = N, u = C ?? d ?? "", m = n.useRef(null), i = n.useRef("");
23
- g(() => {
24
- const t = m.current;
25
- t === null || u === i.current || (t.className = w(Array.from(t.classList), u, i.current), i.current = u);
26
- });
27
- const R = n.useCallback(
28
- (t) => {
29
- m.current = t, typeof a == "function" ? a(t) : a != null && (a.current = t);
30
- },
31
- [a]
32
- );
33
- return n.createElement(c, { ...y, ref: R });
34
- });
35
- return e.displayName = o.displayName ?? f, e;
36
- };
37
- export {
38
- L as c
39
- };
40
- //# sourceMappingURL=create-component-ICzm58MY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-component-ICzm58MY.js","sources":["../src/runtime/create-component.ts"],"sourcesContent":["import type { EventName, Options } from '@lit/react';\nimport { createComponent as createComponentWrapper } from '@lit/react';\nimport React from 'react';\n\n// A key value map matching React prop names to event names.\ntype EventNames = Record<string, EventName | string>;\n\n// Type that's compatible with both React 18 and 19\ntype StencilProps<I extends HTMLElement, E extends EventNames, C, R extends keyof C = never> = Omit<\n React.HTMLAttributes<I>,\n keyof E\n> &\n Partial<{ [K in keyof E]: E[K] extends EventName<infer T> ? (event: T) => void : (event: any) => void }> &\n Required<Pick<C, R>> &\n Partial<Omit<C, R>> &\n React.RefAttributes<I>;\n\nexport type StencilReactComponent<\n I extends HTMLElement,\n E extends EventNames = {},\n C = Omit<I, keyof HTMLElement>,\n R extends keyof C = never,\n> = React.FunctionComponent<StencilProps<I, E, C, R>>;\n\nconst splitClassName = (className: string | undefined): string[] =>\n className ? className.split(/\\s+/).filter(Boolean) : [];\n\n/**\n * Merge the app's `className`/`class` with the classes the Stencil runtime\n * manages on the host. `@lit/react` maps `className` to `class` and rewrites it\n * wholesale on every render, which wipes runtime-added classes like `hydrated`,\n * `sc-*` scope classes, and state classes a design system relies on.\n */\nexport const mergeClassNames = (\n currentClasses: Iterable<string>,\n newClassName: string | undefined,\n oldClassName: string | undefined\n): string => {\n const incoming = new Set(splitClassName(newClassName));\n const previous = new Set(splitClassName(oldClassName));\n const finalClassNames: string[] = [];\n\n for (const className of currentClasses) {\n if (incoming.has(className)) {\n finalClassNames.push(className);\n incoming.delete(className);\n } else if (!previous.has(className)) {\n // Runtime-managed class the app never set, so keep it.\n finalClassNames.push(className);\n }\n // Anything else was set by the app last render and dropped now, so drop it.\n }\n\n // Whatever's left in `incoming` isn't on the element yet.\n for (const className of incoming) {\n finalClassNames.push(className);\n }\n\n return finalClassNames.join(' ');\n};\n\n// `useLayoutEffect` warns during server rendering and the reconciliation is\n// client-only anyway, so fall back to `useEffect` on the server.\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\n/**\n * Defines a custom element and creates a React component.\n * @public\n */\nexport const createComponent = <\n I extends HTMLElement,\n E extends EventNames = {},\n C = Omit<I, keyof HTMLElement>,\n R extends keyof C = never,\n>({\n defineCustomElement,\n tagName,\n transformTag,\n ...options\n}: Options<I, E> & {\n defineCustomElement: () => void;\n transformTag?: (tagName: string) => string;\n}): StencilReactComponent<I, E, C, R> => {\n if (typeof defineCustomElement !== 'undefined') {\n defineCustomElement();\n }\n const finalTagName = transformTag ? transformTag(tagName) : tagName;\n const ReactComponent = createComponentWrapper<I, E>({ ...options, tagName: finalTagName });\n\n /**\n * Withhold `className`/`class` from `@lit/react` so React never writes the\n * `class` attribute, then reconcile it against the live host in a layout\n * effect. See `mergeClassNames`.\n */\n const WrappedComponent = React.forwardRef<I, StencilProps<I, E, C, R>>((props, ref) => {\n const {\n className,\n class: classProp,\n ...restProps\n } = props as StencilProps<I, E, C, R> & {\n className?: string;\n class?: string;\n };\n const incomingClassName = className ?? classProp ?? '';\n\n const elementRef = React.useRef<I | null>(null);\n const previousClassName = React.useRef<string>('');\n\n useIsomorphicLayoutEffect(() => {\n const element = elementRef.current;\n if (element === null || incomingClassName === previousClassName.current) {\n return;\n }\n element.className = mergeClassNames(Array.from(element.classList), incomingClassName, previousClassName.current);\n previousClassName.current = incomingClassName;\n });\n\n const setRef = React.useCallback(\n (node: I | null) => {\n elementRef.current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref !== null && ref !== undefined) {\n (ref as React.MutableRefObject<I | null>).current = node;\n }\n },\n [ref]\n );\n\n return React.createElement(ReactComponent, { ...restProps, ref: setRef } as any);\n });\n\n WrappedComponent.displayName = options.displayName ?? finalTagName;\n\n return WrappedComponent as unknown as StencilReactComponent<I, E, C, R>;\n};\n"],"names":["splitClassName","className","mergeClassNames","currentClasses","newClassName","oldClassName","incoming","previous","finalClassNames","useIsomorphicLayoutEffect","React","createComponent","defineCustomElement","tagName","transformTag","options","finalTagName","ReactComponent","createComponentWrapper","WrappedComponent","props","ref","classProp","restProps","incomingClassName","elementRef","previousClassName","element","setRef","node"],"mappings":";;AAwBA,MAAMA,IAAiB,CAACC,MACtBA,IAAYA,EAAU,MAAM,KAAK,EAAE,OAAO,OAAO,IAAI,CAAA,GAQ1CC,IAAkB,CAC7BC,GACAC,GACAC,MACW;AACX,QAAMC,IAAW,IAAI,IAAIN,EAAeI,CAAY,CAAC,GAC/CG,IAAW,IAAI,IAAIP,EAAeK,CAAY,CAAC,GAC/CG,IAA4B,CAAA;AAElC,aAAWP,KAAaE;AACtB,IAAIG,EAAS,IAAIL,CAAS,KACxBO,EAAgB,KAAKP,CAAS,GAC9BK,EAAS,OAAOL,CAAS,KACfM,EAAS,IAAIN,CAAS,KAEhCO,EAAgB,KAAKP,CAAS;AAMlC,aAAWA,KAAaK;AACtB,IAAAE,EAAgB,KAAKP,CAAS;AAGhC,SAAOO,EAAgB,KAAK,GAAG;AACjC,GAIMC,IAA4B,OAAO,SAAW,MAAcC,EAAM,kBAAkBA,EAAM,WAMnFC,IAAkB,CAK7B;AAAA,EACA,qBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGC;AACL,MAGyC;AACvC,EAAI,OAAOH,IAAwB,OACjCA,EAAA;AAEF,QAAMI,IAAeF,IAAeA,EAAaD,CAAO,IAAIA,GACtDI,IAAiBC,EAA6B,EAAE,GAAGH,GAAS,SAASC,GAAc,GAOnFG,IAAmBT,EAAM,WAAwC,CAACU,GAAOC,MAAQ;AACrF,UAAM;AAAA,MACJ,WAAApB;AAAA,MACA,OAAOqB;AAAA,MACP,GAAGC;AAAA,IAAA,IACDH,GAIEI,IAAoBvB,KAAaqB,KAAa,IAE9CG,IAAaf,EAAM,OAAiB,IAAI,GACxCgB,IAAoBhB,EAAM,OAAe,EAAE;AAEjD,IAAAD,EAA0B,MAAM;AAC9B,YAAMkB,IAAUF,EAAW;AAC3B,MAAIE,MAAY,QAAQH,MAAsBE,EAAkB,YAGhEC,EAAQ,YAAYzB,EAAgB,MAAM,KAAKyB,EAAQ,SAAS,GAAGH,GAAmBE,EAAkB,OAAO,GAC/GA,EAAkB,UAAUF;AAAA,IAC9B,CAAC;AAED,UAAMI,IAASlB,EAAM;AAAA,MACnB,CAACmB,MAAmB;AAClB,QAAAJ,EAAW,UAAUI,GACjB,OAAOR,KAAQ,aACjBA,EAAIQ,CAAI,IACCR,KAAQ,SAChBA,EAAyC,UAAUQ;AAAA,MAExD;AAAA,MACA,CAACR,CAAG;AAAA,IAAA;AAGN,WAAOX,EAAM,cAAcO,GAAgB,EAAE,GAAGM,GAAW,KAAKK,GAAe;AAAA,EACjF,CAAC;AAED,SAAAT,EAAiB,cAAcJ,EAAQ,eAAeC,GAE/CG;AACT;"}
@@ -1,24 +0,0 @@
1
- import { EventName, Options } from '@lit/react';
2
- import { default as React } from 'react';
3
-
4
- type EventNames = Record<string, EventName | string>;
5
- type StencilProps<I extends HTMLElement, E extends EventNames, C, R extends keyof C = never> = Omit<React.HTMLAttributes<I>, keyof E> & Partial<{
6
- [K in keyof E]: E[K] extends EventName<infer T> ? (event: T) => void : (event: any) => void;
7
- }> & Required<Pick<C, R>> & Partial<Omit<C, R>> & React.RefAttributes<I>;
8
- export type StencilReactComponent<I extends HTMLElement, E extends EventNames = {}, C = Omit<I, keyof HTMLElement>, R extends keyof C = never> = React.FunctionComponent<StencilProps<I, E, C, R>>;
9
- /**
10
- * Merge the app's `className`/`class` with the classes the Stencil runtime
11
- * manages on the host. `@lit/react` maps `className` to `class` and rewrites it
12
- * wholesale on every render, which wipes runtime-added classes like `hydrated`,
13
- * `sc-*` scope classes, and state classes a design system relies on.
14
- */
15
- export declare const mergeClassNames: (currentClasses: Iterable<string>, newClassName: string | undefined, oldClassName: string | undefined) => string;
16
- /**
17
- * Defines a custom element and creates a React component.
18
- * @public
19
- */
20
- export declare const createComponent: <I extends HTMLElement, E extends EventNames = {}, C = Omit<I, keyof HTMLElement>, R extends keyof C = never>({ defineCustomElement, tagName, transformTag, ...options }: Options<I, E> & {
21
- defineCustomElement: () => void;
22
- transformTag?: (tagName: string) => string;
23
- }) => StencilReactComponent<I, E, C, R>;
24
- export {};
@@ -1,2 +0,0 @@
1
- export type { EventName, Options } from '@lit/react';
2
- export { createComponent, type StencilReactComponent } from './create-component.js';
@@ -1,5 +0,0 @@
1
- import { c as r } from "./create-component-ICzm58MY.js";
2
- export {
3
- r as createComponent
4
- };
5
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}