@kirana-ui/react 0.1.1 → 0.2.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 (161) hide show
  1. package/llms.txt +1601 -223
  2. package/package.json +14 -2
  3. package/skills/kirana-ui-primitives/SKILL.md +142 -0
  4. package/src/accordion.d.ts +26 -15
  5. package/src/accordion.js +11 -10
  6. package/src/accordion.js.map +1 -1
  7. package/src/agent.d.ts +1 -0
  8. package/src/agent.js +1 -0
  9. package/src/alert-dialog.d.ts +3 -2
  10. package/src/autocomplete.d.ts +3 -2
  11. package/src/autosize.d.ts +5 -2
  12. package/src/autosize.js +2 -2
  13. package/src/autosize.js.map +1 -1
  14. package/src/avatar.d.ts +12 -8
  15. package/src/avatar.js +18 -9
  16. package/src/avatar.js.map +1 -1
  17. package/src/button.d.ts +4 -2
  18. package/src/button.js +3 -3
  19. package/src/button.js.map +1 -1
  20. package/src/calendar.d.ts +49 -28
  21. package/src/calendar.js +7 -3
  22. package/src/calendar.js.map +1 -1
  23. package/src/carousel.d.ts +25 -15
  24. package/src/carousel.js +3 -3
  25. package/src/carousel.js.map +1 -1
  26. package/src/checkbox.d.ts +10 -7
  27. package/src/checkbox.js +18 -12
  28. package/src/checkbox.js.map +1 -1
  29. package/src/collapsible.d.ts +12 -8
  30. package/src/collapsible.js +8 -7
  31. package/src/collapsible.js.map +1 -1
  32. package/src/combobox.d.ts +88 -60
  33. package/src/combobox.js +44 -31
  34. package/src/combobox.js.map +1 -1
  35. package/src/command.d.ts +30 -21
  36. package/src/command.js +14 -7
  37. package/src/command.js.map +1 -1
  38. package/src/context-menu.d.ts +3 -2
  39. package/src/date-field.d.ts +25 -13
  40. package/src/date-field.js +7 -3
  41. package/src/date-field.js.map +1 -1
  42. package/src/date-picker.d.ts +31 -40
  43. package/src/date-picker.js +3 -3
  44. package/src/date-picker.js.map +1 -1
  45. package/src/dialog.d.ts +45 -35
  46. package/src/dialog.js +12 -8
  47. package/src/dialog.js.map +1 -1
  48. package/src/direction.d.ts +1 -0
  49. package/src/direction.js.map +1 -1
  50. package/src/drawer.d.ts +3 -2
  51. package/src/element.d.ts +12 -0
  52. package/src/element.js +20 -0
  53. package/src/element.js.map +1 -0
  54. package/src/field.d.ts +24 -16
  55. package/src/field.js +9 -7
  56. package/src/field.js.map +1 -1
  57. package/src/fieldset.d.ts +10 -5
  58. package/src/fieldset.js +4 -5
  59. package/src/fieldset.js.map +1 -1
  60. package/src/form.d.ts +5 -2
  61. package/src/form.js +6 -6
  62. package/src/form.js.map +1 -1
  63. package/src/hover-card.d.ts +16 -10
  64. package/src/hover-card.js +1 -1
  65. package/src/hover-card.js.map +1 -1
  66. package/src/hover-popup.d.ts +24 -14
  67. package/src/hover-popup.js +5 -13
  68. package/src/hover-popup.js.map +1 -1
  69. package/src/index.d.ts +13 -3
  70. package/src/input.d.ts +4 -2
  71. package/src/input.js +3 -3
  72. package/src/input.js.map +1 -1
  73. package/src/label.d.ts +4 -1
  74. package/src/label.js +3 -3
  75. package/src/label.js.map +1 -1
  76. package/src/listbox.d.ts +23 -15
  77. package/src/listbox.js +4 -5
  78. package/src/listbox.js.map +1 -1
  79. package/src/menu.d.ts +83 -65
  80. package/src/menu.js +10 -18
  81. package/src/menu.js.map +1 -1
  82. package/src/menubar.d.ts +5 -3
  83. package/src/menubar.js +3 -3
  84. package/src/menubar.js.map +1 -1
  85. package/src/message-scroller.d.ts +15 -9
  86. package/src/message-scroller.js +3 -3
  87. package/src/message-scroller.js.map +1 -1
  88. package/src/meter.d.ts +18 -9
  89. package/src/meter.js +1 -1
  90. package/src/meter.js.map +1 -1
  91. package/src/navigation-menu.d.ts +50 -40
  92. package/src/navigation-menu.js +15 -24
  93. package/src/navigation-menu.js.map +1 -1
  94. package/src/number-field.d.ts +19 -12
  95. package/src/number-field.js +6 -10
  96. package/src/number-field.js.map +1 -1
  97. package/src/otp.d.ts +24 -15
  98. package/src/otp.js +7 -13
  99. package/src/otp.js.map +1 -1
  100. package/src/pagination.d.ts +26 -16
  101. package/src/pagination.js +3 -3
  102. package/src/pagination.js.map +1 -1
  103. package/src/popover.d.ts +30 -21
  104. package/src/popover.js +9 -13
  105. package/src/popover.js.map +1 -1
  106. package/src/progress.d.ts +18 -9
  107. package/src/progress.js +1 -1
  108. package/src/progress.js.map +1 -1
  109. package/src/qr-code.d.ts +12 -7
  110. package/src/qr-code.js +3 -3
  111. package/src/qr-code.js.map +1 -1
  112. package/src/radio-group.d.ts +17 -11
  113. package/src/radio-group.js +16 -19
  114. package/src/radio-group.js.map +1 -1
  115. package/src/resizable.d.ts +13 -8
  116. package/src/resizable.js +3 -3
  117. package/src/resizable.js.map +1 -1
  118. package/src/runtime.d.ts +89 -15
  119. package/src/runtime.js +112 -19
  120. package/src/runtime.js.map +1 -1
  121. package/src/scroll-area.d.ts +26 -15
  122. package/src/scroll-area.js +9 -6
  123. package/src/scroll-area.js.map +1 -1
  124. package/src/select.d.ts +65 -45
  125. package/src/select.js +40 -35
  126. package/src/select.js.map +1 -1
  127. package/src/separator.d.ts +4 -2
  128. package/src/separator.js +3 -3
  129. package/src/separator.js.map +1 -1
  130. package/src/slider.d.ts +35 -20
  131. package/src/slider.js +17 -18
  132. package/src/slider.js.map +1 -1
  133. package/src/switch.d.ts +10 -6
  134. package/src/switch.js +11 -9
  135. package/src/switch.js.map +1 -1
  136. package/src/tabs.d.ts +22 -14
  137. package/src/tabs.js +5 -6
  138. package/src/tabs.js.map +1 -1
  139. package/src/testing.d.ts +1 -0
  140. package/src/testing.js +1 -0
  141. package/src/toast.d.ts +59 -23
  142. package/src/toast.js +59 -13
  143. package/src/toast.js.map +1 -1
  144. package/src/toggle-group.d.ts +5 -2
  145. package/src/toggle-group.js +3 -3
  146. package/src/toggle-group.js.map +1 -1
  147. package/src/toggle.d.ts +4 -2
  148. package/src/toggle.js +3 -3
  149. package/src/toggle.js.map +1 -1
  150. package/src/toolbar.d.ts +26 -11
  151. package/src/toolbar.js +23 -13
  152. package/src/toolbar.js.map +1 -1
  153. package/src/tooltip.d.ts +16 -10
  154. package/src/tooltip.js +1 -1
  155. package/src/tooltip.js.map +1 -1
  156. package/src/use-render.d.ts +38 -0
  157. package/src/use-render.js +50 -0
  158. package/src/use-render.js.map +1 -0
  159. package/src/value-bar.d.ts +19 -11
  160. package/src/value-bar.js +8 -5
  161. package/src/value-bar.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","names":["BodyPortal"],"sources":["../../../../packages/react/src/popover.tsx"],"sourcesContent":["import { defined } from \"@kirana-ui/core\"\nimport type { PositionOptions } from \"@kirana-ui/core\"\nimport { createPopover } from \"@kirana-ui/core/popover\"\nimport type { Popover as Controller, PopoverProps } from \"@kirana-ui/core/popover\"\nimport { createContext, useContext } from \"react\"\nimport type { ReactElement, ReactNode } from \"react\"\n\nimport { Portal as BodyPortal, useController, usePart, useSignal } from \"./runtime.tsx\"\nimport type { PartComponentProps } from \"./runtime.tsx\"\n\nconst Context = createContext<Controller | null>(null)\n/** For a component made of this one's parts: a date picker. */\nexport { Context as PopoverContext }\n\nfunction usePopover(part: string): Controller {\n const controller = useContext(Context)\n if (!controller) throw new Error(`<Popover.${part}> must be inside <Popover.Root>`)\n return controller\n}\n\nexport type RootProps = Omit<PopoverProps, \"id\"> & { id?: string; children?: ReactNode }\n\nfunction Root({ children, ...props }: RootProps): ReactElement {\n const controller = useController(createPopover, props)\n return <Context.Provider value={controller}>{children}</Context.Provider>\n}\n\nfunction Portal({ children }: { children?: ReactNode }): ReactElement | null {\n const mounted = useSignal(usePopover(\"Portal\").mounted)\n return mounted ? <BodyPortal>{children}</BodyPortal> : null\n}\n\nexport type PositionerProps = PartComponentProps & Partial<PositionOptions>\n\nfunction Positioner({\n side,\n align,\n sideOffset,\n alignOffset,\n collisionPadding,\n ...props\n}: PositionerProps) {\n const controller = usePopover(\"Positioner\")\n // Written while rendering, so the first placement (made when the element attaches, before\n // this component's effects) reads them. Nothing re-renders for it: the core compares.\n controller.positioning.set(defined({ side, align, sideOffset, alignOffset, collisionPadding }))\n return usePart(controller.positioner, \"div\", props)\n}\n\nconst Trigger = (props: PartComponentProps) =>\n usePart(usePopover(\"Trigger\").trigger, \"button\", props)\nconst Popup = (props: PartComponentProps) => usePart(usePopover(\"Popup\").popup, \"div\", props)\nconst Title = (props: PartComponentProps) => usePart(usePopover(\"Title\").title, \"h2\", props)\nconst Description = (props: PartComponentProps) =>\n usePart(usePopover(\"Description\").description, \"p\", props)\nconst Close = (props: PartComponentProps) => usePart(usePopover(\"Close\").close, \"button\", props)\n\nexport const Popover = { Root, Trigger, Portal, Positioner, Popup, Title, Description, Close }\n"],"mappings":";;;;;;AAUA,MAAM,UAAU,cAAiC,IAAI;AAIrD,SAAS,WAAW,MAA0B;CAC5C,MAAM,aAAa,WAAW,OAAO;CACrC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,YAAY,KAAK,gCAAgC;CAClF,OAAO;AACT;AAIA,SAAS,KAAK,EAAE,UAAU,GAAG,SAAkC;CAC7D,MAAM,aAAa,cAAc,eAAe,KAAK;CACrD,OAAO,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EAAa;CAA2B,CAAA;AAC1E;AAEA,SAAS,OAAO,EAAE,YAA2D;CAE3E,OADgB,UAAU,WAAW,QAAQ,CAAC,CAAC,OAClC,IAAI,oBAACA,UAAD,EAAa,SAAqB,CAAA,IAAI;AACzD;AAIA,SAAS,WAAW,EAClB,MACA,OACA,YACA,aACA,kBACA,GAAG,SACe;CAClB,MAAM,aAAa,WAAW,YAAY;CAG1C,WAAW,YAAY,IAAI,QAAQ;EAAE;EAAM;EAAO;EAAY;EAAa;CAAiB,CAAC,CAAC;CAC9F,OAAO,QAAQ,WAAW,YAAY,OAAO,KAAK;AACpD;AAEA,MAAM,WAAW,UACf,QAAQ,WAAW,SAAS,CAAC,CAAC,SAAS,UAAU,KAAK;AACxD,MAAM,SAAS,UAA8B,QAAQ,WAAW,OAAO,CAAC,CAAC,OAAO,OAAO,KAAK;AAC5F,MAAM,SAAS,UAA8B,QAAQ,WAAW,OAAO,CAAC,CAAC,OAAO,MAAM,KAAK;AAC3F,MAAM,eAAe,UACnB,QAAQ,WAAW,aAAa,CAAC,CAAC,aAAa,KAAK,KAAK;AAC3D,MAAM,SAAS,UAA8B,QAAQ,WAAW,OAAO,CAAC,CAAC,OAAO,UAAU,KAAK;AAE/F,MAAa,UAAU;CAAE;CAAM;CAAS;CAAQ;CAAY;CAAO;CAAO;CAAa;AAAM"}
1
+ {"version":3,"file":"popover.js","names":["BodyPortal"],"sources":["../../../../packages/react/src/popover.tsx"],"sourcesContent":["import type { StateOf } from \"@kirana-ui/core\"\nimport { createPopover } from \"@kirana-ui/core/popover\"\nimport type { Popover as Controller, PopoverProps } from \"@kirana-ui/core/popover\"\nimport type { Vocabulary } from \"@kirana-ui/core/vocabulary\"\nimport { createContext, useContext } from \"react\"\nimport type { ReactElement, ReactNode } from \"react\"\n\nimport {\n Portal as BodyPortal,\n parts,\n useController,\n usePart,\n usePositioning,\n useSignal,\n} from \"./runtime.tsx\"\nimport type { PartComponentProps, PortalProps, PositionerOptions } from \"./runtime.tsx\"\n\nexport type { PortalProps }\n\ntype Parts = Vocabulary[\"popover\"]\n\n/**\n * The popover its parts are inside. Exported for a component that is made of one (a date picker\n * provides its own to the popover's parts).\n */\nconst Context = createContext<Controller | null>(null)\n/** For a component made of this one's parts: a date picker. */\nexport { Context as PopoverContext }\n\nfunction usePopover(part: string): Controller {\n const controller = useContext(Context)\n if (!controller) throw new Error(`<Popover.${part}> must be inside <Popover.Root>`)\n return controller\n}\n\nexport type RootProps = Omit<PopoverProps, \"id\"> & { id?: string; children?: ReactNode }\n\nfunction Root({ children, ...props }: RootProps): ReactElement {\n const controller = useController(createPopover, props)\n return <Context.Provider value={controller}>{children}</Context.Provider>\n}\n\nfunction Portal({ children }: PortalProps): ReactElement | null {\n const mounted = useSignal(usePopover(\"Portal\").mounted)\n return mounted ? <BodyPortal>{children}</BodyPortal> : null\n}\n\nexport type PositionerProps = PartComponentProps<\n \"div\",\n StateOf<Parts[\"positioner\"]>,\n PositionerOptions\n>\n\nfunction Positioner(props: PositionerProps): ReactElement {\n const controller = usePopover(\"Positioner\")\n return usePart(controller.positioner, \"div\", usePositioning(controller.positioning, props))\n}\n\nexport type TriggerProps = PartComponentProps<\"button\", StateOf<Parts[\"trigger\"]>>\nexport type PopupProps = PartComponentProps<\"div\", StateOf<Parts[\"popup\"]>>\nexport type TitleProps = PartComponentProps<\"h2\", StateOf<Parts[\"title\"]>>\nexport type DescriptionProps = PartComponentProps<\"p\", StateOf<Parts[\"description\"]>>\nexport type CloseProps = PartComponentProps<\"button\", StateOf<Parts[\"close\"]>>\n\nconst Trigger = (props: TriggerProps) => usePart(usePopover(\"Trigger\").trigger, \"button\", props)\nconst Popup = (props: PopupProps) => usePart(usePopover(\"Popup\").popup, \"div\", props)\nconst Title = (props: TitleProps) => usePart(usePopover(\"Title\").title, \"h2\", props)\nconst Description = (props: DescriptionProps) =>\n usePart(usePopover(\"Description\").description, \"p\", props)\nconst Close = (props: CloseProps) => usePart(usePopover(\"Close\").close, \"button\", props)\n\nexport const Popover = /* @__PURE__ */ parts(\"Popover\", {\n Root,\n Trigger,\n Portal,\n Positioner,\n Popup,\n Title,\n Description,\n Close,\n})\n"],"mappings":";;;;;;;;;AAyBA,MAAM,UAAU,cAAiC,IAAI;AAIrD,SAAS,WAAW,MAA0B;CAC5C,MAAM,aAAa,WAAW,OAAO;CACrC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,YAAY,KAAK,gCAAgC;CAClF,OAAO;AACT;AAIA,SAAS,KAAK,EAAE,UAAU,GAAG,SAAkC;CAC7D,MAAM,aAAa,cAAc,eAAe,KAAK;CACrD,OAAO,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EAAa;CAA2B,CAAA;AAC1E;AAEA,SAAS,OAAO,EAAE,YAA8C;CAE9D,OADgB,UAAU,WAAW,QAAQ,CAAC,CAAC,OAClC,IAAI,oBAACA,UAAD,EAAa,SAAqB,CAAA,IAAI;AACzD;AAQA,SAAS,WAAW,OAAsC;CACxD,MAAM,aAAa,WAAW,YAAY;CAC1C,OAAO,QAAQ,WAAW,YAAY,OAAO,eAAe,WAAW,aAAa,KAAK,CAAC;AAC5F;AAQA,MAAM,WAAW,UAAwB,QAAQ,WAAW,SAAS,CAAC,CAAC,SAAS,UAAU,KAAK;AAC/F,MAAM,SAAS,UAAsB,QAAQ,WAAW,OAAO,CAAC,CAAC,OAAO,OAAO,KAAK;AACpF,MAAM,SAAS,UAAsB,QAAQ,WAAW,OAAO,CAAC,CAAC,OAAO,MAAM,KAAK;AACnF,MAAM,eAAe,UACnB,QAAQ,WAAW,aAAa,CAAC,CAAC,aAAa,KAAK,KAAK;AAC3D,MAAM,SAAS,UAAsB,QAAQ,WAAW,OAAO,CAAC,CAAC,OAAO,UAAU,KAAK;AAEvF,MAAa,UAA0B,sBAAM,WAAW;CACtD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC"}
package/src/progress.d.ts CHANGED
@@ -1,13 +1,22 @@
1
1
  import { PartComponentProps } from "./runtime.js";
2
+ import { ValueOptions } from "./value-bar.js";
3
+ import { StateOf } from "@kirana-ui/core";
4
+ import { ProgressProps } from "@kirana-ui/core/progress";
5
+ import { Vocabulary } from "@kirana-ui/core/vocabulary";
6
+ type Parts = Vocabulary["progress"];
7
+ export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<ProgressProps, "id"> & {
8
+ id?: string;
9
+ }>;
10
+ export type TrackProps = PartComponentProps<"div", StateOf<Parts["track"]>>;
11
+ export type IndicatorProps = PartComponentProps<"div", StateOf<Parts["indicator"]>>;
12
+ export type ValueProps = PartComponentProps<"span", StateOf<Parts["value"]>, ValueOptions>;
13
+ export type LabelProps = PartComponentProps<"span", StateOf<Parts["label"]>>;
2
14
  export declare const Progress: {
3
- Root: ({ value, min, max, format, locale, getAriaValueText, id, ...rest }: Omit<import("@kirana-ui/core/meter").ValueBarProps, "id"> & {
4
- id?: string;
5
- } & PartComponentProps<undefined>) => import("react").ReactElement;
6
- Track: (props: PartComponentProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
7
- Indicator: (props: PartComponentProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
8
- Value: ({ children, ...props }: Omit<PartComponentProps<undefined>, "children"> & {
9
- children?: ((text: string | undefined) => import("react").ReactNode) | undefined;
10
- }) => import("react").ReactElement;
11
- Label: (props: PartComponentProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
15
+ Root: (props: RootProps) => import("react").ReactElement;
16
+ Track: (props: TrackProps) => import("react").ReactElement;
17
+ Indicator: (props: IndicatorProps) => import("react").ReactElement;
18
+ Value: (props: ValueProps) => import("react").ReactElement;
19
+ Label: (props: LabelProps) => import("react").ReactElement;
12
20
  };
21
+ export {};
13
22
  //# sourceMappingURL=progress.d.ts.map
package/src/progress.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { valueBar } from "./value-bar.js";
2
2
  import { createProgress } from "@kirana-ui/core/progress";
3
3
  // src/progress.tsx
4
- const Progress = valueBar("Progress", createProgress);
4
+ const Progress = /* @__PURE__ */ valueBar("Progress", createProgress);
5
5
  export { Progress };
6
6
 
7
7
  //# sourceMappingURL=progress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress.js","names":[],"sources":["../../../../packages/react/src/progress.tsx"],"sourcesContent":["import { createProgress } from \"@kirana-ui/core/progress\"\n\nimport { valueBar } from \"./value-bar.tsx\"\n\nexport const Progress = valueBar(\"Progress\", createProgress)\n"],"mappings":";;;AAIA,MAAa,WAAW,SAAS,YAAY,cAAc"}
1
+ {"version":3,"file":"progress.js","names":[],"sources":["../../../../packages/react/src/progress.tsx"],"sourcesContent":["import type { StateOf } from \"@kirana-ui/core\"\nimport { createProgress } from \"@kirana-ui/core/progress\"\nimport type { ProgressProps } from \"@kirana-ui/core/progress\"\nimport type { Vocabulary } from \"@kirana-ui/core/vocabulary\"\n\nimport type { PartComponentProps } from \"./runtime.tsx\"\nimport { valueBar } from \"./value-bar.tsx\"\nimport type { ValueOptions } from \"./value-bar.tsx\"\n\ntype Parts = Vocabulary[\"progress\"]\n\nexport type RootProps = PartComponentProps<\n \"div\",\n StateOf<Parts[\"root\"]>,\n Omit<ProgressProps, \"id\"> & { id?: string }\n>\nexport type TrackProps = PartComponentProps<\"div\", StateOf<Parts[\"track\"]>>\nexport type IndicatorProps = PartComponentProps<\"div\", StateOf<Parts[\"indicator\"]>>\nexport type ValueProps = PartComponentProps<\"span\", StateOf<Parts[\"value\"]>, ValueOptions>\nexport type LabelProps = PartComponentProps<\"span\", StateOf<Parts[\"label\"]>>\n\nexport const Progress = /* @__PURE__ */ valueBar<\n ProgressProps,\n {\n Root: RootProps\n Track: TrackProps\n Indicator: IndicatorProps\n Value: ValueProps\n Label: LabelProps\n }\n>(\"Progress\", createProgress)\n"],"mappings":";;;AAqBA,MAAa,WAA2B,yBAStC,YAAY,cAAc"}
package/src/qr-code.d.ts CHANGED
@@ -1,16 +1,21 @@
1
1
  import { PartComponentProps } from "./runtime.js";
2
+ import { StateOf } from "@kirana-ui/core";
2
3
  import { ReactElement } from "react";
3
4
  import { QrCodeProps } from "@kirana-ui/core/qr-code";
4
- export type RootProps = Omit<QrCodeProps, "id"> & {
5
+ import { Vocabulary } from "@kirana-ui/core/vocabulary";
6
+ type Parts = Vocabulary["qrCode"];
7
+ export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<QrCodeProps, "id"> & {
5
8
  id?: string;
6
- } & PartComponentProps;
9
+ }>;
7
10
  declare function Root({ value, correction, id, ...rest }: RootProps): ReactElement;
8
- declare const Frame: (props: PartComponentProps) => ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
9
- declare const Pattern: (props: PartComponentProps) => ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
11
+ export type FrameProps = PartComponentProps<"svg", StateOf<Parts["frame"]>>;
12
+ declare const Frame: (props: FrameProps) => ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
13
+ export type PatternProps = PartComponentProps<"path", StateOf<Parts["pattern"]>>;
14
+ declare const Pattern: (props: PatternProps) => ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
10
15
  export declare const QrCode: {
11
- Root: typeof Root;
12
- Frame: typeof Frame;
13
- Pattern: typeof Pattern;
16
+ readonly Root: typeof Root;
17
+ readonly Frame: typeof Frame;
18
+ readonly Pattern: typeof Pattern;
14
19
  };
15
20
  export {};
16
21
  //# sourceMappingURL=qr-code.d.ts.map
package/src/qr-code.js CHANGED
@@ -1,4 +1,4 @@
1
- import { useController, usePart } from "./runtime.js";
1
+ import { parts, useController, usePart } from "./runtime.js";
2
2
  import { createContext, useContext } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import { createQrCode } from "@kirana-ui/core/qr-code";
@@ -22,11 +22,11 @@ function Root({ value, correction, id, ...rest }) {
22
22
  }
23
23
  const Frame = (props) => usePart(useQrCode("Frame").frame, "svg", props);
24
24
  const Pattern = (props) => usePart(useQrCode("Pattern").pattern, "path", props);
25
- const QrCode = {
25
+ const QrCode = /* @__PURE__ */ parts("QrCode", {
26
26
  Root,
27
27
  Frame,
28
28
  Pattern
29
- };
29
+ });
30
30
  export { QrCode };
31
31
 
32
32
  //# sourceMappingURL=qr-code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"qr-code.js","names":[],"sources":["../../../../packages/react/src/qr-code.tsx"],"sourcesContent":["import { createQrCode } from \"@kirana-ui/core/qr-code\"\nimport type { QrCode as Controller, QrCodeProps } from \"@kirana-ui/core/qr-code\"\nimport { createContext, useContext } from \"react\"\nimport type { ReactElement } from \"react\"\n\nimport { useController, usePart } from \"./runtime.tsx\"\nimport type { PartComponentProps } from \"./runtime.tsx\"\n\nconst Context = createContext<Controller | null>(null)\n\nfunction useQrCode(part: string): Controller {\n const controller = useContext(Context)\n if (!controller) throw new Error(`<QrCode.${part}> must be inside <QrCode.Root>`)\n return controller\n}\n\nexport type RootProps = Omit<QrCodeProps, \"id\"> & { id?: string } & PartComponentProps\n\nfunction Root({ value, correction, id, ...rest }: RootProps): ReactElement {\n const controller = useController<QrCodeProps, Controller>(createQrCode, {\n value,\n correction,\n id,\n })\n return (\n <Context.Provider value={controller}>{usePart(controller.root, \"div\", rest)}</Context.Provider>\n )\n}\n\nconst Frame = (props: PartComponentProps) => usePart(useQrCode(\"Frame\").frame, \"svg\", props)\nconst Pattern = (props: PartComponentProps) => usePart(useQrCode(\"Pattern\").pattern, \"path\", props)\n\nexport const QrCode = { Root, Frame, Pattern }\n"],"mappings":";;;;;AAQA,MAAM,UAAU,cAAiC,IAAI;AAErD,SAAS,UAAU,MAA0B;CAC3C,MAAM,aAAa,WAAW,OAAO;CACrC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,WAAW,KAAK,+BAA+B;CAChF,OAAO;AACT;AAIA,SAAS,KAAK,EAAE,OAAO,YAAY,IAAI,GAAG,QAAiC;CACzE,MAAM,aAAa,cAAuC,cAAc;EACtE;EACA;EACA;CACF,CAAC;CACD,OACE,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EAAa,UAAA,QAAQ,WAAW,MAAM,OAAO,IAAI;CAAoB,CAAA;AAElG;AAEA,MAAM,SAAS,UAA8B,QAAQ,UAAU,OAAO,CAAC,CAAC,OAAO,OAAO,KAAK;AAC3F,MAAM,WAAW,UAA8B,QAAQ,UAAU,SAAS,CAAC,CAAC,SAAS,QAAQ,KAAK;AAElG,MAAa,SAAS;CAAE;CAAM;CAAO;AAAQ"}
1
+ {"version":3,"file":"qr-code.js","names":[],"sources":["../../../../packages/react/src/qr-code.tsx"],"sourcesContent":["import type { StateOf } from \"@kirana-ui/core\"\nimport { createQrCode } from \"@kirana-ui/core/qr-code\"\nimport type { QrCode as Controller, QrCodeProps } from \"@kirana-ui/core/qr-code\"\nimport type { Vocabulary } from \"@kirana-ui/core/vocabulary\"\nimport { createContext, useContext } from \"react\"\nimport type { ReactElement } from \"react\"\n\nimport { parts, useController, usePart } from \"./runtime.tsx\"\nimport type { PartComponentProps } from \"./runtime.tsx\"\n\ntype Parts = Vocabulary[\"qrCode\"]\n\nconst Context = createContext<Controller | null>(null)\n\nfunction useQrCode(part: string): Controller {\n const controller = useContext(Context)\n if (!controller) throw new Error(`<QrCode.${part}> must be inside <QrCode.Root>`)\n return controller\n}\n\nexport type RootProps = PartComponentProps<\n \"div\",\n StateOf<Parts[\"root\"]>,\n Omit<QrCodeProps, \"id\"> & { id?: string }\n>\n\nfunction Root({ value, correction, id, ...rest }: RootProps): ReactElement {\n const controller = useController<QrCodeProps, Controller>(createQrCode, {\n value,\n correction,\n id,\n })\n return (\n <Context.Provider value={controller}>{usePart(controller.root, \"div\", rest)}</Context.Provider>\n )\n}\n\nexport type FrameProps = PartComponentProps<\"svg\", StateOf<Parts[\"frame\"]>>\n\nconst Frame = (props: FrameProps) => usePart(useQrCode(\"Frame\").frame, \"svg\", props)\nexport type PatternProps = PartComponentProps<\"path\", StateOf<Parts[\"pattern\"]>>\n\nconst Pattern = (props: PatternProps) => usePart(useQrCode(\"Pattern\").pattern, \"path\", props)\n\nexport const QrCode = /* @__PURE__ */ parts(\"QrCode\", { Root, Frame, Pattern })\n"],"mappings":";;;;;AAYA,MAAM,UAAU,cAAiC,IAAI;AAErD,SAAS,UAAU,MAA0B;CAC3C,MAAM,aAAa,WAAW,OAAO;CACrC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,WAAW,KAAK,+BAA+B;CAChF,OAAO;AACT;AAQA,SAAS,KAAK,EAAE,OAAO,YAAY,IAAI,GAAG,QAAiC;CACzE,MAAM,aAAa,cAAuC,cAAc;EACtE;EACA;EACA;CACF,CAAC;CACD,OACE,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EAAa,UAAA,QAAQ,WAAW,MAAM,OAAO,IAAI;CAAoB,CAAA;AAElG;AAIA,MAAM,SAAS,UAAsB,QAAQ,UAAU,OAAO,CAAC,CAAC,OAAO,OAAO,KAAK;AAGnF,MAAM,WAAW,UAAwB,QAAQ,UAAU,SAAS,CAAC,CAAC,SAAS,QAAQ,KAAK;AAE5F,MAAa,SAAyB,sBAAM,UAAU;CAAE;CAAM;CAAO;AAAQ,CAAC"}
@@ -1,24 +1,30 @@
1
1
  import { PartComponentProps } from "./runtime.js";
2
+ import { StateOf } from "@kirana-ui/core";
2
3
  import { ReactElement } from "react";
3
4
  import { RadioGroupProps } from "@kirana-ui/core/radio-group";
4
- export type RootProps<Value> = Omit<RadioGroupProps<Value>, "id"> & {
5
+ import { Vocabulary } from "@kirana-ui/core/vocabulary";
6
+ type Parts = Vocabulary["radioGroup"];
7
+ /** `Value` is what tells an item from the others: the type of `value`. */
8
+ export type RootProps<Value = unknown> = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<RadioGroupProps<Value>, "id"> & {
5
9
  id?: string;
6
- } & PartComponentProps;
7
- declare function Root<Value>({ value, defaultValue, onValueChange, disabled, readOnly, required, name, form, id, ...rest }: RootProps<Value>): ReactElement;
8
- export interface ItemProps extends PartComponentProps {
10
+ }>;
11
+ declare function Root<Value = unknown>({ value, defaultValue, onValueChange, disabled, readOnly, required, name, form, id, ...rest }: RootProps<Value>): ReactElement;
12
+ export type ItemProps = PartComponentProps<"span", StateOf<Parts["item"]>, {
13
+ /** What the group's value is while this item is the chosen one. */
9
14
  value: unknown;
15
+ /** Disables this item: it cannot be chosen. */
10
16
  disabled?: boolean;
11
- }
12
- declare function Item({ value, disabled, children, ...rest }: ItemProps): ReactElement;
13
- export interface IndicatorProps extends PartComponentProps {
17
+ }>;
18
+ declare function Item({ value, disabled, ...rest }: ItemProps): ReactElement;
19
+ export type IndicatorProps = PartComponentProps<"span", StateOf<Parts["indicator"]>, {
14
20
  /** Keeps the mark in the page while its item is not the chosen one. */
15
21
  keepMounted?: boolean;
16
- }
22
+ }>;
17
23
  declare function Indicator({ keepMounted, ...props }: IndicatorProps): ReactElement | null;
18
24
  export declare const RadioGroup: {
19
- Root: typeof Root;
20
- Item: typeof Item;
21
- Indicator: typeof Indicator;
25
+ readonly Root: typeof Root;
26
+ readonly Item: typeof Item;
27
+ readonly Indicator: typeof Indicator;
22
28
  };
23
29
  export {};
24
30
  //# sourceMappingURL=radio-group.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { DirectionContext } from "./direction-context.js";
2
2
  import { FieldContext } from "./field-context.js";
3
- import { useController, useMount, useOptions, usePart, useSignal } from "./runtime.js";
3
+ import { PartElement, parts, useController, useMount, useOptions, usePart, useSignal } from "./runtime.js";
4
4
  import { defined, within } from "@kirana-ui/core";
5
5
  import { createContext, useContext, useMemo } from "react";
6
- import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { createRadioGroup } from "@kirana-ui/core/radio-group";
8
8
  // src/radio-group.tsx
9
9
  const Context = createContext(null);
@@ -33,14 +33,17 @@ function Root({ value, defaultValue, onValueChange, disabled, readOnly, required
33
33
  });
34
34
  return /* @__PURE__ */ jsx(Context.Provider, {
35
35
  value: controller,
36
- children: /* @__PURE__ */ jsx(RootElement, { ...rest })
36
+ children: /* @__PURE__ */ jsx(PartElement, {
37
+ of: controller.root,
38
+ tag: "div",
39
+ ...rest
40
+ })
37
41
  });
38
42
  }
39
- const RootElement = (props) => usePart(useRadioGroup("Root").root, "div", props);
40
- function Item({ value, disabled, children, ...rest }) {
43
+ function Item({ value, disabled, ...rest }) {
41
44
  const controller = useRadioGroup("Item");
42
45
  const options = useOptions({ disabled });
43
- const parts = useMemo(() => {
46
+ const made = useMemo(() => {
44
47
  const read = () => defined(options.get());
45
48
  return {
46
49
  item: controller.item(value, read),
@@ -53,18 +56,12 @@ function Item({ value, disabled, children, ...rest }) {
53
56
  ]);
54
57
  return /* @__PURE__ */ jsx(ItemContext.Provider, {
55
58
  value,
56
- children: /* @__PURE__ */ jsxs(PartElement, {
57
- part: parts.item,
58
- tag: "span",
59
- ...rest,
60
- children: [children, /* @__PURE__ */ jsx(PartElement, {
61
- part: parts.input,
62
- tag: "input"
63
- })]
64
- })
59
+ children: usePart(made.item, "span", rest, void 0, (content) => /* @__PURE__ */ jsxs(Fragment$1, { children: [content, /* @__PURE__ */ jsx(PartElement, {
60
+ of: made.input,
61
+ tag: "input"
62
+ })] }))
65
63
  });
66
64
  }
67
- const PartElement = ({ part, tag, ...props }) => usePart(part, tag, props);
68
65
  function Indicator({ keepMounted, ...props }) {
69
66
  const controller = useRadioGroup("Indicator");
70
67
  const value = useContext(ItemContext);
@@ -72,16 +69,16 @@ function Indicator({ keepMounted, ...props }) {
72
69
  useMount(indicator);
73
70
  if (!useSignal(indicator.mounted) && !keepMounted) return null;
74
71
  return /* @__PURE__ */ jsx(PartElement, {
75
- part: indicator.part,
72
+ of: indicator.part,
76
73
  tag: "span",
77
74
  ...props
78
75
  });
79
76
  }
80
- const RadioGroup = {
77
+ const RadioGroup = /* @__PURE__ */ parts("RadioGroup", {
81
78
  Root,
82
79
  Item,
83
80
  Indicator
84
- };
81
+ });
85
82
  export { RadioGroup };
86
83
 
87
84
  //# sourceMappingURL=radio-group.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","names":[],"sources":["../../../../packages/react/src/radio-group.tsx"],"sourcesContent":["import { defined, within } from \"@kirana-ui/core\"\nimport type { Part } from \"@kirana-ui/core\"\nimport { createRadioGroup } from \"@kirana-ui/core/radio-group\"\nimport type { RadioGroup as Controller, RadioGroupProps } from \"@kirana-ui/core/radio-group\"\nimport { createContext, useContext, useMemo } from \"react\"\nimport type { ReactElement } from \"react\"\n\nimport { DirectionContext } from \"./direction-context.ts\"\nimport { FieldContext } from \"./field-context.ts\"\nimport { useController, useMount, useOptions, usePart, useSignal } from \"./runtime.tsx\"\nimport type { PartComponentProps } from \"./runtime.tsx\"\n\nconst Context = createContext<Controller | null>(null)\nconst ItemContext = createContext<unknown>(undefined)\n\nfunction useRadioGroup(part: string): Controller {\n const controller = useContext(Context)\n if (!controller) throw new Error(`<RadioGroup.${part}> must be inside <RadioGroup.Root>`)\n return controller\n}\n\nexport type RootProps<Value> = Omit<RadioGroupProps<Value>, \"id\"> & {\n id?: string\n} & PartComponentProps\n\nfunction Root<Value>({\n value,\n defaultValue,\n onValueChange,\n disabled,\n readOnly,\n required,\n name,\n form,\n id,\n ...rest\n}: RootProps<Value>): ReactElement {\n const field = useContext(FieldContext) ?? undefined\n const direction = useContext(DirectionContext) ?? undefined\n const create = within(createRadioGroup<Value>, { field, direction })\n const controller = useController(create, {\n value: value as Value | null | undefined,\n defaultValue: defaultValue as Value | null | undefined,\n onValueChange,\n disabled,\n readOnly,\n required,\n name,\n form,\n id,\n }) as unknown as Controller\n return (\n <Context.Provider value={controller}>\n <RootElement {...rest} />\n </Context.Provider>\n )\n}\n\nconst RootElement = (props: PartComponentProps) => usePart(useRadioGroup(\"Root\").root, \"div\", props)\n\nexport interface ItemProps extends PartComponentProps {\n value: unknown\n disabled?: boolean\n}\n\nfunction Item({ value, disabled, children, ...rest }: ItemProps): ReactElement {\n const controller = useRadioGroup(\"Item\")\n const options = useOptions({ disabled })\n const parts = useMemo(() => {\n const read = () => defined(options.get())\n return { item: controller.item(value, read), input: controller.itemInput(value, read) }\n }, [controller, value, options])\n return (\n <ItemContext.Provider value={value}>\n <PartElement part={parts.item} tag=\"span\" {...rest}>\n {children}\n <PartElement part={parts.input} tag=\"input\" />\n </PartElement>\n </ItemContext.Provider>\n )\n}\n\nconst PartElement = ({ part, tag, ...props }: PartComponentProps & { part: Part; tag: string }) =>\n usePart(part, tag, props)\n\nexport interface IndicatorProps extends PartComponentProps {\n /** Keeps the mark in the page while its item is not the chosen one. */\n keepMounted?: boolean\n}\n\nfunction Indicator({ keepMounted, ...props }: IndicatorProps): ReactElement | null {\n const controller = useRadioGroup(\"Indicator\")\n const value = useContext(ItemContext)\n const indicator = useMemo(() => controller.indicator(value), [controller, value])\n useMount(indicator)\n const mounted = useSignal(indicator.mounted)\n if (!mounted && !keepMounted) return null\n return <PartElement part={indicator.part} tag=\"span\" {...props} />\n}\n\nexport const RadioGroup = { Root, Item, Indicator }\n"],"mappings":";;;;;;;;AAYA,MAAM,UAAU,cAAiC,IAAI;AACrD,MAAM,cAAc,cAAuB,KAAA,CAAS;AAEpD,SAAS,cAAc,MAA0B;CAC/C,MAAM,aAAa,WAAW,OAAO;CACrC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,eAAe,KAAK,mCAAmC;CACxF,OAAO;AACT;AAMA,SAAS,KAAY,EACnB,OACA,cACA,eACA,UACA,UACA,UACA,MACA,MACA,IACA,GAAG,QAC8B;CACjC,MAAM,QAAQ,WAAW,YAAY,KAAK,KAAA;CAC1C,MAAM,YAAY,WAAW,gBAAgB,KAAK,KAAA;CAClD,MAAM,SAAS,OAAO,kBAAyB;EAAE;EAAO;CAAU,CAAC;CACnE,MAAM,aAAa,cAAc,QAAQ;EAChC;EACO;EACd;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OACE,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EACvB,UAAA,oBAAC,aAAD,EAAa,GAAI,KAAO,CAAA;CACR,CAAA;AAEtB;AAEA,MAAM,eAAe,UAA8B,QAAQ,cAAc,MAAM,CAAC,CAAC,MAAM,OAAO,KAAK;AAOnG,SAAS,KAAK,EAAE,OAAO,UAAU,UAAU,GAAG,QAAiC;CAC7E,MAAM,aAAa,cAAc,MAAM;CACvC,MAAM,UAAU,WAAW,EAAE,SAAS,CAAC;CACvC,MAAM,QAAQ,cAAc;EAC1B,MAAM,aAAa,QAAQ,QAAQ,IAAI,CAAC;EACxC,OAAO;GAAE,MAAM,WAAW,KAAK,OAAO,IAAI;GAAG,OAAO,WAAW,UAAU,OAAO,IAAI;EAAE;CACxF,GAAG;EAAC;EAAY;EAAO;CAAO,CAAC;CAC/B,OACE,oBAAC,YAAY,UAAb;EAA6B;EAC3B,UAAA,qBAAC,aAAD;GAAa,MAAM,MAAM;GAAM,KAAI;GAAO,GAAI;GAA9C,UAAA,CACG,UACD,oBAAC,aAAD;IAAa,MAAM,MAAM;IAAO,KAAI;GAAS,CAAA,CAClC;;CACO,CAAA;AAE1B;AAEA,MAAM,eAAe,EAAE,MAAM,KAAK,GAAG,YACnC,QAAQ,MAAM,KAAK,KAAK;AAO1B,SAAS,UAAU,EAAE,aAAa,GAAG,SAA8C;CACjF,MAAM,aAAa,cAAc,WAAW;CAC5C,MAAM,QAAQ,WAAW,WAAW;CACpC,MAAM,YAAY,cAAc,WAAW,UAAU,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC;CAChF,SAAS,SAAS;CAElB,IAAI,CADY,UAAU,UAAU,OACzB,KAAK,CAAC,aAAa,OAAO;CACrC,OAAO,oBAAC,aAAD;EAAa,MAAM,UAAU;EAAM,KAAI;EAAO,GAAI;CAAQ,CAAA;AACnE;AAEA,MAAa,aAAa;CAAE;CAAM;CAAM;AAAU"}
1
+ {"version":3,"file":"radio-group.js","names":[],"sources":["../../../../packages/react/src/radio-group.tsx"],"sourcesContent":["import { defined, within } from \"@kirana-ui/core\"\nimport type { StateOf } from \"@kirana-ui/core\"\nimport { createRadioGroup } from \"@kirana-ui/core/radio-group\"\nimport type { RadioGroup as Controller, RadioGroupProps } from \"@kirana-ui/core/radio-group\"\nimport type { Vocabulary } from \"@kirana-ui/core/vocabulary\"\nimport { createContext, useContext, useMemo } from \"react\"\nimport type { ReactElement } from \"react\"\n\nimport { DirectionContext } from \"./direction-context.ts\"\nimport { FieldContext } from \"./field-context.ts\"\nimport {\n PartElement,\n parts,\n useController,\n useMount,\n useOptions,\n usePart,\n useSignal,\n} from \"./runtime.tsx\"\nimport type { PartComponentProps } from \"./runtime.tsx\"\n\ntype Parts = Vocabulary[\"radioGroup\"]\n\nconst Context = createContext<Controller | null>(null)\nconst ItemContext = createContext<unknown>(undefined)\n\nfunction useRadioGroup(part: string): Controller {\n const controller = useContext(Context)\n if (!controller) throw new Error(`<RadioGroup.${part}> must be inside <RadioGroup.Root>`)\n return controller\n}\n\n/** `Value` is what tells an item from the others: the type of `value`. */\nexport type RootProps<Value = unknown> = PartComponentProps<\n \"div\",\n StateOf<Parts[\"root\"]>,\n Omit<RadioGroupProps<Value>, \"id\"> & { id?: string }\n>\n\nfunction Root<Value = unknown>({\n value,\n defaultValue,\n onValueChange,\n disabled,\n readOnly,\n required,\n name,\n form,\n id,\n ...rest\n}: RootProps<Value>): ReactElement {\n const field = useContext(FieldContext) ?? undefined\n const direction = useContext(DirectionContext) ?? undefined\n const create = within(createRadioGroup<Value>, { field, direction })\n const controller: Controller = useController(create, {\n value,\n defaultValue,\n onValueChange,\n disabled,\n readOnly,\n required,\n name,\n form,\n id,\n })\n return (\n <Context.Provider value={controller}>\n <PartElement of={controller.root} tag=\"div\" {...rest} />\n </Context.Provider>\n )\n}\n\nexport type ItemProps = PartComponentProps<\n \"span\",\n StateOf<Parts[\"item\"]>,\n {\n /** What the group's value is while this item is the chosen one. */\n value: unknown\n /** Disables this item: it cannot be chosen. */\n disabled?: boolean\n }\n>\n\nfunction Item({ value, disabled, ...rest }: ItemProps): ReactElement {\n const controller = useRadioGroup(\"Item\")\n const options = useOptions({ disabled })\n const made = useMemo(() => {\n const read = () => defined(options.get())\n return { item: controller.item(value, read), input: controller.itemInput(value, read) }\n }, [controller, value, options])\n return (\n <ItemContext.Provider value={value}>\n {usePart(made.item, \"span\", rest, undefined, (content) => (\n // Its native input is the element's last child, whatever element the caller asked for.\n <>\n {content}\n <PartElement of={made.input} tag=\"input\" />\n </>\n ))}\n </ItemContext.Provider>\n )\n}\n\nexport type IndicatorProps = PartComponentProps<\n \"span\",\n StateOf<Parts[\"indicator\"]>,\n {\n /** Keeps the mark in the page while its item is not the chosen one. */\n keepMounted?: boolean\n }\n>\n\nfunction Indicator({ keepMounted, ...props }: IndicatorProps): ReactElement | null {\n const controller = useRadioGroup(\"Indicator\")\n const value = useContext(ItemContext)\n const indicator = useMemo(() => controller.indicator(value), [controller, value])\n useMount(indicator)\n const mounted = useSignal(indicator.mounted)\n if (!mounted && !keepMounted) return null\n return <PartElement of={indicator.part} tag=\"span\" {...props} />\n}\n\nexport const RadioGroup = /* @__PURE__ */ parts(\"RadioGroup\", { Root, Item, Indicator })\n"],"mappings":";;;;;;;;AAuBA,MAAM,UAAU,cAAiC,IAAI;AACrD,MAAM,cAAc,cAAuB,KAAA,CAAS;AAEpD,SAAS,cAAc,MAA0B;CAC/C,MAAM,aAAa,WAAW,OAAO;CACrC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,eAAe,KAAK,mCAAmC;CACxF,OAAO;AACT;AASA,SAAS,KAAsB,EAC7B,OACA,cACA,eACA,UACA,UACA,UACA,MACA,MACA,IACA,GAAG,QAC8B;CACjC,MAAM,QAAQ,WAAW,YAAY,KAAK,KAAA;CAC1C,MAAM,YAAY,WAAW,gBAAgB,KAAK,KAAA;CAClD,MAAM,SAAS,OAAO,kBAAyB;EAAE;EAAO;CAAU,CAAC;CACnE,MAAM,aAAyB,cAAc,QAAQ;EACnD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OACE,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EACvB,UAAA,oBAAC,aAAD;GAAa,IAAI,WAAW;GAAM,KAAI;GAAM,GAAI;EAAO,CAAA;CACvC,CAAA;AAEtB;AAaA,SAAS,KAAK,EAAE,OAAO,UAAU,GAAG,QAAiC;CACnE,MAAM,aAAa,cAAc,MAAM;CACvC,MAAM,UAAU,WAAW,EAAE,SAAS,CAAC;CACvC,MAAM,OAAO,cAAc;EACzB,MAAM,aAAa,QAAQ,QAAQ,IAAI,CAAC;EACxC,OAAO;GAAE,MAAM,WAAW,KAAK,OAAO,IAAI;GAAG,OAAO,WAAW,UAAU,OAAO,IAAI;EAAE;CACxF,GAAG;EAAC;EAAY;EAAO;CAAO,CAAC;CAC/B,OACE,oBAAC,YAAY,UAAb;EAA6B;EAC1B,UAAA,QAAQ,KAAK,MAAM,QAAQ,MAAM,KAAA,IAAY,YAE5C,qBAAA,YAAA,EAAA,UAAA,CACG,SACD,oBAAC,aAAD;GAAa,IAAI,KAAK;GAAO,KAAI;EAAS,CAAA,CAC1C,EAAA,CAAA,CACH;CACmB,CAAA;AAE1B;AAWA,SAAS,UAAU,EAAE,aAAa,GAAG,SAA8C;CACjF,MAAM,aAAa,cAAc,WAAW;CAC5C,MAAM,QAAQ,WAAW,WAAW;CACpC,MAAM,YAAY,cAAc,WAAW,UAAU,KAAK,GAAG,CAAC,YAAY,KAAK,CAAC;CAChF,SAAS,SAAS;CAElB,IAAI,CADY,UAAU,UAAU,OACzB,KAAK,CAAC,aAAa,OAAO;CACrC,OAAO,oBAAC,aAAD;EAAa,IAAI,UAAU;EAAM,KAAI;EAAO,GAAI;CAAQ,CAAA;AACjE;AAEA,MAAa,aAA6B,sBAAM,cAAc;CAAE;CAAM;CAAM;AAAU,CAAC"}
@@ -1,19 +1,24 @@
1
1
  import { PartComponentProps } from "./runtime.js";
2
+ import { StateOf } from "@kirana-ui/core";
2
3
  import { ReactElement } from "react";
3
4
  import { ResizablePanelOptions, ResizableProps } from "@kirana-ui/core/resizable";
4
- export type GroupProps = Omit<ResizableProps, "id"> & {
5
+ import { Vocabulary } from "@kirana-ui/core/vocabulary";
6
+ type Parts = Vocabulary["resizable"];
7
+ export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, Omit<ResizableProps, "id"> & {
5
8
  id?: string;
6
- } & PartComponentProps;
9
+ }>;
7
10
  declare function Group({ orientation, onSizesChange, keyboardStep, disabled, id, ...rest }: GroupProps): ReactElement;
8
- export type PanelProps = PartComponentProps & ResizablePanelOptions;
11
+ export type PanelProps = PartComponentProps<"div", StateOf<Parts["panel"]>, ResizablePanelOptions>;
9
12
  declare function Panel({ defaultSize, minSize, maxSize, ...props }: PanelProps): ReactElement;
10
- declare function Handle({ disabled, ...props }: PartComponentProps & {
13
+ export type HandleProps = PartComponentProps<"div", StateOf<Parts["handle"]>, {
14
+ /** Disables this handle: it cannot be dragged or moved with the keyboard. */
11
15
  disabled?: boolean;
12
- }): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
16
+ }>;
17
+ declare function Handle({ disabled, ...props }: HandleProps): ReactElement;
13
18
  export declare const Resizable: {
14
- Group: typeof Group;
15
- Panel: typeof Panel;
16
- Handle: typeof Handle;
19
+ readonly Group: typeof Group;
20
+ readonly Panel: typeof Panel;
21
+ readonly Handle: typeof Handle;
17
22
  };
18
23
  export {};
19
24
  //# sourceMappingURL=resizable.d.ts.map
package/src/resizable.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DirectionContext } from "./direction-context.js";
2
- import { useController, useOptions, usePart } from "./runtime.js";
2
+ import { parts, useController, useOptions, usePart } from "./runtime.js";
3
3
  import { defined, within } from "@kirana-ui/core";
4
4
  import { createContext, useContext, useMemo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -41,11 +41,11 @@ function Handle({ disabled, ...props }) {
41
41
  const part = useMemo(() => controller.handle(() => defined(options.get())), [controller, options]);
42
42
  return usePart(part, "div", props);
43
43
  }
44
- const Resizable = {
44
+ const Resizable = /* @__PURE__ */ parts("Resizable", {
45
45
  Group,
46
46
  Panel,
47
47
  Handle
48
- };
48
+ });
49
49
  export { Resizable };
50
50
 
51
51
  //# sourceMappingURL=resizable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resizable.js","names":[],"sources":["../../../../packages/react/src/resizable.tsx"],"sourcesContent":["import { defined, within } from \"@kirana-ui/core\"\nimport { createResizable } from \"@kirana-ui/core/resizable\"\nimport type {\n Resizable as Controller,\n ResizablePanelOptions,\n ResizableProps,\n} from \"@kirana-ui/core/resizable\"\nimport { createContext, useContext, useMemo } from \"react\"\nimport type { ReactElement } from \"react\"\n\nimport { DirectionContext } from \"./direction-context.ts\"\nimport { useController, useOptions, usePart } from \"./runtime.tsx\"\nimport type { PartComponentProps } from \"./runtime.tsx\"\n\nconst Context = createContext<Controller | null>(null)\n\nfunction useResizable(part: string): Controller {\n const controller = useContext(Context)\n if (!controller) throw new Error(`<Resizable.${part}> must be inside <Resizable.Group>`)\n return controller\n}\n\nexport type GroupProps = Omit<ResizableProps, \"id\"> & { id?: string } & PartComponentProps\n\nfunction Group({\n orientation,\n onSizesChange,\n keyboardStep,\n disabled,\n id,\n ...rest\n}: GroupProps): ReactElement {\n const direction = useContext(DirectionContext) ?? undefined\n const controller = useController<ResizableProps, Controller>(\n within(createResizable, { direction }),\n { orientation, onSizesChange, keyboardStep, disabled, id }\n )\n return (\n <Context.Provider value={controller}>{usePart(controller.group, \"div\", rest)}</Context.Provider>\n )\n}\n\nexport type PanelProps = PartComponentProps & ResizablePanelOptions\n\nfunction Panel({ defaultSize, minSize, maxSize, ...props }: PanelProps): ReactElement {\n const controller = useResizable(\"Panel\")\n const options = useOptions({ defaultSize, minSize, maxSize })\n const part = useMemo(() => controller.panel(() => defined(options.get())), [controller, options])\n return usePart(part, \"div\", props)\n}\n\nfunction Handle({ disabled, ...props }: PartComponentProps & { disabled?: boolean }) {\n const controller = useResizable(\"Handle\")\n const options = useOptions({ disabled })\n const part = useMemo(() => controller.handle(() => defined(options.get())), [controller, options])\n return usePart(part, \"div\", props)\n}\n\nexport const Resizable = { Group, Panel, Handle }\n"],"mappings":";;;;;;;AAcA,MAAM,UAAU,cAAiC,IAAI;AAErD,SAAS,aAAa,MAA0B;CAC9C,MAAM,aAAa,WAAW,OAAO;CACrC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,cAAc,KAAK,mCAAmC;CACvF,OAAO;AACT;AAIA,SAAS,MAAM,EACb,aACA,eACA,cACA,UACA,IACA,GAAG,QACwB;CAC3B,MAAM,YAAY,WAAW,gBAAgB,KAAK,KAAA;CAClD,MAAM,aAAa,cACjB,OAAO,iBAAiB,EAAE,UAAU,CAAC,GACrC;EAAE;EAAa;EAAe;EAAc;EAAU;CAAG,CAC3D;CACA,OACE,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EAAa,UAAA,QAAQ,WAAW,OAAO,OAAO,IAAI;CAAoB,CAAA;AAEnG;AAIA,SAAS,MAAM,EAAE,aAAa,SAAS,SAAS,GAAG,SAAmC;CACpF,MAAM,aAAa,aAAa,OAAO;CACvC,MAAM,UAAU,WAAW;EAAE;EAAa;EAAS;CAAQ,CAAC;CAC5D,MAAM,OAAO,cAAc,WAAW,YAAY,QAAQ,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC;CAChG,OAAO,QAAQ,MAAM,OAAO,KAAK;AACnC;AAEA,SAAS,OAAO,EAAE,UAAU,GAAG,SAAsD;CACnF,MAAM,aAAa,aAAa,QAAQ;CACxC,MAAM,UAAU,WAAW,EAAE,SAAS,CAAC;CACvC,MAAM,OAAO,cAAc,WAAW,aAAa,QAAQ,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC;CACjG,OAAO,QAAQ,MAAM,OAAO,KAAK;AACnC;AAEA,MAAa,YAAY;CAAE;CAAO;CAAO;AAAO"}
1
+ {"version":3,"file":"resizable.js","names":[],"sources":["../../../../packages/react/src/resizable.tsx"],"sourcesContent":["import { defined, within } from \"@kirana-ui/core\"\nimport type { StateOf } from \"@kirana-ui/core\"\nimport { createResizable } from \"@kirana-ui/core/resizable\"\nimport type {\n Resizable as Controller,\n ResizablePanelOptions,\n ResizableProps,\n} from \"@kirana-ui/core/resizable\"\nimport type { Vocabulary } from \"@kirana-ui/core/vocabulary\"\nimport { createContext, useContext, useMemo } from \"react\"\nimport type { ReactElement } from \"react\"\n\nimport { DirectionContext } from \"./direction-context.ts\"\nimport { parts, useController, useOptions, usePart } from \"./runtime.tsx\"\nimport type { PartComponentProps } from \"./runtime.tsx\"\n\ntype Parts = Vocabulary[\"resizable\"]\n\nconst Context = createContext<Controller | null>(null)\n\nfunction useResizable(part: string): Controller {\n const controller = useContext(Context)\n if (!controller) throw new Error(`<Resizable.${part}> must be inside <Resizable.Group>`)\n return controller\n}\n\nexport type GroupProps = PartComponentProps<\n \"div\",\n StateOf<Parts[\"group\"]>,\n Omit<ResizableProps, \"id\"> & { id?: string }\n>\n\nfunction Group({\n orientation,\n onSizesChange,\n keyboardStep,\n disabled,\n id,\n ...rest\n}: GroupProps): ReactElement {\n const direction = useContext(DirectionContext) ?? undefined\n const controller = useController<ResizableProps, Controller>(\n within(createResizable, { direction }),\n { orientation, onSizesChange, keyboardStep, disabled, id }\n )\n return (\n <Context.Provider value={controller}>{usePart(controller.group, \"div\", rest)}</Context.Provider>\n )\n}\n\nexport type PanelProps = PartComponentProps<\"div\", StateOf<Parts[\"panel\"]>, ResizablePanelOptions>\n\nfunction Panel({ defaultSize, minSize, maxSize, ...props }: PanelProps): ReactElement {\n const controller = useResizable(\"Panel\")\n const options = useOptions({ defaultSize, minSize, maxSize })\n const part = useMemo(() => controller.panel(() => defined(options.get())), [controller, options])\n return usePart(part, \"div\", props)\n}\n\nexport type HandleProps = PartComponentProps<\n \"div\",\n StateOf<Parts[\"handle\"]>,\n {\n /** Disables this handle: it cannot be dragged or moved with the keyboard. */\n disabled?: boolean\n }\n>\n\nfunction Handle({ disabled, ...props }: HandleProps): ReactElement {\n const controller = useResizable(\"Handle\")\n const options = useOptions({ disabled })\n const part = useMemo(() => controller.handle(() => defined(options.get())), [controller, options])\n return usePart(part, \"div\", props)\n}\n\nexport const Resizable = /* @__PURE__ */ parts(\"Resizable\", { Group, Panel, Handle })\n"],"mappings":";;;;;;;AAkBA,MAAM,UAAU,cAAiC,IAAI;AAErD,SAAS,aAAa,MAA0B;CAC9C,MAAM,aAAa,WAAW,OAAO;CACrC,IAAI,CAAC,YAAY,MAAM,IAAI,MAAM,cAAc,KAAK,mCAAmC;CACvF,OAAO;AACT;AAQA,SAAS,MAAM,EACb,aACA,eACA,cACA,UACA,IACA,GAAG,QACwB;CAC3B,MAAM,YAAY,WAAW,gBAAgB,KAAK,KAAA;CAClD,MAAM,aAAa,cACjB,OAAO,iBAAiB,EAAE,UAAU,CAAC,GACrC;EAAE;EAAa;EAAe;EAAc;EAAU;CAAG,CAC3D;CACA,OACE,oBAAC,QAAQ,UAAT;EAAkB,OAAO;EAAa,UAAA,QAAQ,WAAW,OAAO,OAAO,IAAI;CAAoB,CAAA;AAEnG;AAIA,SAAS,MAAM,EAAE,aAAa,SAAS,SAAS,GAAG,SAAmC;CACpF,MAAM,aAAa,aAAa,OAAO;CACvC,MAAM,UAAU,WAAW;EAAE;EAAa;EAAS;CAAQ,CAAC;CAC5D,MAAM,OAAO,cAAc,WAAW,YAAY,QAAQ,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC;CAChG,OAAO,QAAQ,MAAM,OAAO,KAAK;AACnC;AAWA,SAAS,OAAO,EAAE,UAAU,GAAG,SAAoC;CACjE,MAAM,aAAa,aAAa,QAAQ;CACxC,MAAM,UAAU,WAAW,EAAE,SAAS,CAAC;CACvC,MAAM,OAAO,cAAc,WAAW,aAAa,QAAQ,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC;CACjG,OAAO,QAAQ,MAAM,OAAO,KAAK;AACnC;AAEA,MAAa,YAA4B,sBAAM,aAAa;CAAE;CAAO;CAAO;AAAO,CAAC"}
package/src/runtime.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Part, ReadonlySignal } from "@kirana-ui/core";
2
- import { ReactElement, ReactNode, Ref, useLayoutEffect } from "react";
1
+ import { Anchor, Part, PartEvent, PartState, PositionOptions, ReadonlySignal, Signal } from "@kirana-ui/core";
2
+ import { ClassAttributes, ComponentPropsWithoutRef, HTMLAttributes, JSX, ReactElement, ReactNode, Ref, RefCallback, RefObject, SyntheticEvent, useLayoutEffect } from "react";
3
3
  /** A layout effect in the browser, an effect (which never runs) on a server. */
4
4
  export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
5
5
  /** A core signal's value, re-rendering when it changes. */
@@ -25,25 +25,96 @@ export declare function useMount(mounted: {
25
25
  }): void;
26
26
  /** A part's own options as a core signal that follows each render, after it commits. */
27
27
  export declare function useOptions<T extends Record<string, unknown>>(options: T): ReadonlySignal<T>;
28
- export type RenderProp<State = undefined> = ReactElement<Record<string, unknown>> | ((props: Record<string, unknown>, state: State) => ReactElement);
29
- export interface PartComponentProps<State = undefined> {
30
- /** Renders the part as another element or component. The part's attributes still win. */
28
+ /** The elements a part is drawn as, by their tag: `"button"`, `"div"`, `"svg"`. */
29
+ export type PartTag = keyof JSX.IntrinsicElements;
30
+ /** The element a tag draws: an `HTMLButtonElement` for `"button"`. */
31
+ export type ElementOf<Tag extends PartTag> = JSX.IntrinsicElements[Tag] extends ClassAttributes<infer Drawn> ? Drawn : Element;
32
+ type Hearing<Prop> = Prop extends ((event: infer Heard) => infer Answer) ? Heard extends SyntheticEvent ? (event: PartEvent<Heard>) => Answer : Prop : Prop;
33
+ /**
34
+ * The props a `render` function is handed, to spread on what it draws: the part's attributes,
35
+ * its handlers and its ref, with the caller's under them. An attribute of one kind of element
36
+ * (`href`, `type`) is among them unnamed, as `unknown`.
37
+ */
38
+ export type RenderedProps = HTMLAttributes<HTMLElement> & {
39
+ ref?: RefCallback<HTMLElement> | undefined;
40
+ } & Record<string, unknown>;
41
+ /**
42
+ * What `render` takes: an element, drawn with the part's props merged over its own, or a
43
+ * function given the part's props and its state.
44
+ */
45
+ export type RenderProp<State = PartState> = ReactElement<Record<string, unknown>> | ((props: RenderedProps, state: State) => ReactElement);
46
+ /**
47
+ * A part's props: its element's own (`Tag`'s attributes and handlers, a `ref` to that
48
+ * element), `render`, and the part's own props (`Own`) in place of the element's of the same
49
+ * name. `State` is what a `render` function is told of the part.
50
+ */
51
+ export type PartComponentProps<Tag extends PartTag = "div", State = PartState, Own = unknown> = { [Name in keyof ComponentPropsWithoutRef<Tag> as Name extends keyof Own ? never : Name]: Hearing<ComponentPropsWithoutRef<Tag>[Name]>; } & Own & {
52
+ /**
53
+ * Renders the part as another element or component. An element's own props lie over the
54
+ * props handed to the part, and the part's own (its role, its state, its handlers) over
55
+ * both; a function is given the part's props and its state (`open`, `side` …, read from
56
+ * its `data-*` attributes).
57
+ */
31
58
  render?: RenderProp<State> | undefined;
32
- children?: ReactNode;
33
- ref?: Ref<HTMLElement> | undefined;
34
- [attribute: string]: unknown;
35
- }
59
+ ref?: Ref<ElementOf<Tag>> | undefined;
60
+ };
61
+ /**
62
+ * Renders a part: its element (or the caller's `render`), and the part's DOM work attached to
63
+ * the element. Three layers of props, lowest first: what was handed to the part, the `render`
64
+ * element's own, the part's. A higher layer wins an attribute; classes join; styles are merged
65
+ * property by property; every handler of an event runs, lowest first, and
66
+ * `event.preventKiranaHandler()` in a caller's stops the part's. The `render` element's own
67
+ * children are drawn when it has any, and both its ref and the part's `ref` get the element.
68
+ * `hold` is for a part that keeps something of its own in its element (a hidden input): it is
69
+ * given the content and returns what the element holds, whoever drew the element.
70
+ */
71
+ export declare function usePart<Tag extends PartTag, State = PartState>(part: Part, tag: Tag, props: PartComponentProps<Tag, State>, state?: State, hold?: (content: ReactNode) => ReactNode): ReactElement;
36
72
  /**
37
- * Renders a part: its element (or the caller's `render`), with the caller's props merged under
38
- * the part's, and the part's DOM work attached to the element.
73
+ * A component that is handed its caller's `ref` on every React the package takes, under the
74
+ * name DevTools shows it by. React 19 gives a component its `ref` among its props, which is
75
+ * where a part reads it; before, only a `forwardRef` component was given one, so there the
76
+ * component is drawn by one that puts the ref back among the props. Its type is its own
77
+ * either way, so one that is generic stays generic. One that already has a name keeps it.
39
78
  */
40
- export declare function usePart<State = undefined>(part: Part, tag: string, { render, ref, ...caller }: PartComponentProps<State>, state?: State): ReactElement;
79
+ export declare function component<Drawn extends (props: never) => ReactNode>(name: string, draw: Drawn): Drawn;
80
+ /**
81
+ * A component's parts, each one a `component` named `Name.Part`. A part that is another
82
+ * component's (a date picker's trigger is a popover's) is the same component there and here.
83
+ */
84
+ export declare function parts<const Parts extends Record<string, unknown>>(name: string, all: Parts): Parts;
85
+ /**
86
+ * A part's element as a component of its own, for a part that is not always in the page: the
87
+ * part decides, and draws this when it is. It takes the part's props, with the part it is the
88
+ * element `of`, its tag, and what the element holds of the part's own (`hold`, as `usePart`'s).
89
+ */
90
+ export declare const PartElement: <Tag extends PartTag, State = PartState>({ of, tag, hold, ...props }: PartComponentProps<Tag, State> & {
91
+ of: Part;
92
+ tag: Tag;
93
+ hold?: ((content: ReactNode) => ReactNode) | undefined;
94
+ }) => ReactElement;
95
+ /** A positioner's own props: where its popup goes, and what it is placed against. */
96
+ export type PositionerOptions = Partial<Omit<PositionOptions, "anchor">> & {
97
+ /**
98
+ * What the popup is placed against, when that is not its trigger: an element, a ref to one,
99
+ * a place in the viewport (an object with `getBoundingClientRect`), or a function that gives
100
+ * one. It may change while the popup is open: the popup follows.
101
+ */
102
+ anchor?: Anchor | RefObject<Element | null> | (() => Anchor | null | undefined) | null | undefined;
103
+ };
104
+ /** A positioner's props: where its popup goes and what it is placed against, and its element's. */
105
+ export type PositionerProps<State = PartState> = PartComponentProps<"div", State, PositionerOptions>;
106
+ /**
107
+ * A positioner's own props, written where its placement reads them: the one place they are
108
+ * named. Gives back what is left, for the part's element.
109
+ */
110
+ export declare function usePositioning<Props extends PositionerOptions>(positioning: Signal<Partial<PositionOptions>>, { side, align, sideOffset, alignOffset, collisionPadding, anchor, ...rest }: Props): Omit<Props, keyof PositionerOptions>;
41
111
  /**
42
112
  * A text input whose text is the core's own (a combobox's, a number field's): its `value` is
43
113
  * given to React as the input's default. To React a `value` with no `onChange` is an input
44
114
  * that cannot be typed in; the core writes the text itself, as it changes.
45
115
  */
46
116
  export declare function useOwnText(part: Part): Part;
117
+ /** What `PortalProvider` takes. */
47
118
  export interface PortalProviderProps {
48
119
  /** Where the popups inside are drawn; the end of `<body>` while it is not given. */
49
120
  container?: HTMLElement | null | undefined;
@@ -54,8 +125,11 @@ export interface PortalProviderProps {
54
125
  * the page (a shadow root's host, a full-screen element, a frame) in place of `<body>`.
55
126
  */
56
127
  export declare function PortalProvider({ container, children }: PortalProviderProps): ReactElement;
57
- /** Its children in a container at the end of the page, once the page has hydrated. */
58
- export declare function Portal({ children }: {
128
+ /** Draws no element of its own: its children at the end of `<body>`, or where a `PortalProvider` says. */
129
+ export interface PortalProps {
59
130
  children?: ReactNode;
60
- }): ReactElement | null;
131
+ }
132
+ /** Its children in a container at the end of the page, once the page has hydrated. */
133
+ export declare function Portal({ children }: PortalProps): ReactElement | null;
134
+ export type { PartEvent };
61
135
  //# sourceMappingURL=runtime.d.ts.map