@gunkin/uiify 0.0.1-alpha → 0.0.3-alpha

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 (218) hide show
  1. package/dist/components/accordion/Accordion.d.ts +2 -2
  2. package/dist/components/accordion/Accordion.d.ts.map +1 -1
  3. package/dist/components/accordion/Accordion.js +1 -2
  4. package/dist/components/accordion/Accordion.js.map +1 -1
  5. package/dist/components/alert-modal/AlertModal.d.ts +1 -1
  6. package/dist/components/alert-modal/AlertModal.d.ts.map +1 -1
  7. package/dist/components/alert-modal/AlertModal.js +5 -8
  8. package/dist/components/alert-modal/AlertModal.js.map +1 -1
  9. package/dist/components/alert-modal/AlertModalParts.d.ts +4 -29
  10. package/dist/components/alert-modal/AlertModalParts.d.ts.map +1 -1
  11. package/dist/components/alert-modal/AlertModalParts.js +29 -36
  12. package/dist/components/alert-modal/AlertModalParts.js.map +1 -1
  13. package/dist/components/alert-modal/types.d.ts +0 -3
  14. package/dist/components/alert-modal/types.d.ts.map +1 -1
  15. package/dist/components/behavior.css +107 -49
  16. package/dist/components/behavior.css.map +1 -1
  17. package/dist/components/breadcrumb/Breadcrumb.js +1 -1
  18. package/dist/components/breadcrumb/Breadcrumb.js.map +1 -1
  19. package/dist/components/button/Button.d.ts.map +1 -1
  20. package/dist/components/button/Button.js +1 -0
  21. package/dist/components/button/Button.js.map +1 -1
  22. package/dist/components/candle-chart/CandleChart.d.ts.map +1 -1
  23. package/dist/components/candle-chart/CandleChart.js +39 -55
  24. package/dist/components/candle-chart/CandleChart.js.map +1 -1
  25. package/dist/components/candle-chart/client/CandleChartClient.js.map +1 -1
  26. package/dist/components/carousel/CarouselMarkup.d.ts.map +1 -1
  27. package/dist/components/carousel/CarouselMarkup.js +26 -45
  28. package/dist/components/carousel/CarouselMarkup.js.map +1 -1
  29. package/dist/components/carousel/carousel-markup.d.ts +0 -1
  30. package/dist/components/carousel/carousel-markup.d.ts.map +1 -1
  31. package/dist/components/carousel/carousel-markup.js +0 -5
  32. package/dist/components/carousel/carousel-markup.js.map +1 -1
  33. package/dist/components/carousel/client/carousel-controller.js +2 -2
  34. package/dist/components/carousel/client/carousel-controller.js.map +1 -1
  35. package/dist/components/carousel/client/carousel-controls.d.ts.map +1 -1
  36. package/dist/components/carousel/client/carousel-controls.js +3 -5
  37. package/dist/components/carousel/client/carousel-controls.js.map +1 -1
  38. package/dist/components/carousel/client/carousel-drag.js +1 -1
  39. package/dist/components/carousel/client/carousel-drag.js.map +1 -1
  40. package/dist/components/carousel/client/carousel-observer.js +2 -2
  41. package/dist/components/carousel/client/carousel-observer.js.map +1 -1
  42. package/dist/components/carousel/fade/fade-controller.js +2 -2
  43. package/dist/components/carousel/fade/fade-controller.js.map +1 -1
  44. package/dist/components/carousel/fade/fade-swipe.js +1 -1
  45. package/dist/components/carousel/fade/fade-swipe.js.map +1 -1
  46. package/dist/components/carousel/index.d.ts +1 -1
  47. package/dist/components/carousel/index.d.ts.map +1 -1
  48. package/dist/components/carousel/index.js.map +1 -1
  49. package/dist/components/carousel/types.d.ts +0 -13
  50. package/dist/components/carousel/types.d.ts.map +1 -1
  51. package/dist/components/checkbox/Checkbox.d.ts.map +1 -1
  52. package/dist/components/checkbox/Checkbox.js +3 -2
  53. package/dist/components/checkbox/Checkbox.js.map +1 -1
  54. package/dist/components/combobox/Combobox.d.ts.map +1 -1
  55. package/dist/components/combobox/Combobox.js +7 -1
  56. package/dist/components/combobox/Combobox.js.map +1 -1
  57. package/dist/components/combobox/types.d.ts +1 -0
  58. package/dist/components/combobox/types.d.ts.map +1 -1
  59. package/dist/components/context-menu/ContextMenu.d.ts.map +1 -1
  60. package/dist/components/context-menu/ContextMenu.js +21 -4
  61. package/dist/components/context-menu/ContextMenu.js.map +1 -1
  62. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  63. package/dist/components/drawer/Drawer.js +15 -0
  64. package/dist/components/drawer/Drawer.js.map +1 -1
  65. package/dist/components/drawer/DrawerNative.d.ts +1 -1
  66. package/dist/components/drawer/DrawerNative.d.ts.map +1 -1
  67. package/dist/components/drawer/DrawerNative.js +28 -13
  68. package/dist/components/drawer/DrawerNative.js.map +1 -1
  69. package/dist/components/drawer/types.d.ts +0 -2
  70. package/dist/components/drawer/types.d.ts.map +1 -1
  71. package/dist/components/dropdown-menu/DropdownMenu.d.ts.map +1 -1
  72. package/dist/components/dropdown-menu/DropdownMenu.js +2 -1
  73. package/dist/components/dropdown-menu/DropdownMenu.js.map +1 -1
  74. package/dist/components/dropdown-menu/DropdownMenuBar.d.ts +1 -1
  75. package/dist/components/dropdown-menu/DropdownMenuBar.d.ts.map +1 -1
  76. package/dist/components/dropdown-menu/DropdownMenuBar.js +12 -2
  77. package/dist/components/dropdown-menu/DropdownMenuBar.js.map +1 -1
  78. package/dist/components/dropdown-menu/types.d.ts +1 -0
  79. package/dist/components/dropdown-menu/types.d.ts.map +1 -1
  80. package/dist/components/enhance/listeners.js +1 -1
  81. package/dist/components/enhance/listeners.js.map +1 -1
  82. package/dist/components/enhance/sync.d.ts.map +1 -1
  83. package/dist/components/enhance/sync.js +7 -4
  84. package/dist/components/enhance/sync.js.map +1 -1
  85. package/dist/components/field/Field.d.ts.map +1 -1
  86. package/dist/components/field/Field.js +6 -0
  87. package/dist/components/field/Field.js.map +1 -1
  88. package/dist/components/file-upload/FileUpload.d.ts.map +1 -1
  89. package/dist/components/file-upload/FileUpload.js +8 -2
  90. package/dist/components/file-upload/FileUpload.js.map +1 -1
  91. package/dist/components/file-upload/types.d.ts +1 -0
  92. package/dist/components/file-upload/types.d.ts.map +1 -1
  93. package/dist/components/hover-card/HoverCard.d.ts.map +1 -1
  94. package/dist/components/hover-card/HoverCard.js +2 -0
  95. package/dist/components/hover-card/HoverCard.js.map +1 -1
  96. package/dist/components/input/Input.d.ts.map +1 -1
  97. package/dist/components/input/Input.js +1 -0
  98. package/dist/components/input/Input.js.map +1 -1
  99. package/dist/components/internal/choice-family/ChoiceGroup.d.ts +1 -2
  100. package/dist/components/internal/choice-family/ChoiceGroup.d.ts.map +1 -1
  101. package/dist/components/internal/choice-family/ChoiceGroup.js +5 -6
  102. package/dist/components/internal/choice-family/ChoiceGroup.js.map +1 -1
  103. package/dist/components/internal/choice-family/types.d.ts +0 -4
  104. package/dist/components/internal/choice-family/types.d.ts.map +1 -1
  105. package/dist/components/line-chart/LineChart.d.ts.map +1 -1
  106. package/dist/components/line-chart/LineChart.js +30 -38
  107. package/dist/components/line-chart/LineChart.js.map +1 -1
  108. package/dist/components/line-chart/client/LineChartClient.js.map +1 -1
  109. package/dist/components/modal/Modal.d.ts +1 -1
  110. package/dist/components/modal/Modal.d.ts.map +1 -1
  111. package/dist/components/modal/Modal.js +4 -6
  112. package/dist/components/modal/Modal.js.map +1 -1
  113. package/dist/components/modal/ModalParts.d.ts +3 -30
  114. package/dist/components/modal/ModalParts.d.ts.map +1 -1
  115. package/dist/components/modal/ModalParts.js +20 -17
  116. package/dist/components/modal/ModalParts.js.map +1 -1
  117. package/dist/components/modal/client/ModalClientContent.d.ts.map +1 -1
  118. package/dist/components/modal/client/ModalClientContent.js +5 -2
  119. package/dist/components/modal/client/ModalClientContent.js.map +1 -1
  120. package/dist/components/modal/types.d.ts +0 -2
  121. package/dist/components/modal/types.d.ts.map +1 -1
  122. package/dist/components/otp-input/OtpInput.d.ts.map +1 -1
  123. package/dist/components/otp-input/OtpInput.js +3 -0
  124. package/dist/components/otp-input/OtpInput.js.map +1 -1
  125. package/dist/components/popup/Popup.d.ts.map +1 -1
  126. package/dist/components/popup/Popup.js +8 -3
  127. package/dist/components/popup/Popup.js.map +1 -1
  128. package/dist/components/popup/PopupParts.d.ts +3 -26
  129. package/dist/components/popup/PopupParts.d.ts.map +1 -1
  130. package/dist/components/popup/PopupParts.js +27 -18
  131. package/dist/components/popup/PopupParts.js.map +1 -1
  132. package/dist/components/radio-group/RadioGroup.d.ts.map +1 -1
  133. package/dist/components/radio-group/RadioGroup.js +0 -1
  134. package/dist/components/radio-group/RadioGroup.js.map +1 -1
  135. package/dist/components/select/Select.d.ts.map +1 -1
  136. package/dist/components/select/Select.js +1 -0
  137. package/dist/components/select/Select.js.map +1 -1
  138. package/dist/components/slider/Slider.d.ts.map +1 -1
  139. package/dist/components/slider/Slider.js +1 -0
  140. package/dist/components/slider/Slider.js.map +1 -1
  141. package/dist/components/spinner/Spinner.d.ts.map +1 -1
  142. package/dist/components/spinner/Spinner.js +2 -2
  143. package/dist/components/spinner/Spinner.js.map +1 -1
  144. package/dist/components/spinner/types.d.ts +1 -1
  145. package/dist/components/spinner/types.d.ts.map +1 -1
  146. package/dist/components/stepper/Stepper.js +2 -2
  147. package/dist/components/stepper/Stepper.js.map +1 -1
  148. package/dist/components/switch/Switch.d.ts.map +1 -1
  149. package/dist/components/switch/Switch.js +1 -0
  150. package/dist/components/switch/Switch.js.map +1 -1
  151. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  152. package/dist/components/tabs/Tabs.js +1 -3
  153. package/dist/components/tabs/Tabs.js.map +1 -1
  154. package/dist/components/tags-input/TagsInput.d.ts.map +1 -1
  155. package/dist/components/tags-input/TagsInput.js +6 -1
  156. package/dist/components/tags-input/TagsInput.js.map +1 -1
  157. package/dist/components/tags-input/types.d.ts +1 -0
  158. package/dist/components/tags-input/types.d.ts.map +1 -1
  159. package/dist/components/textarea/Textarea.d.ts.map +1 -1
  160. package/dist/components/textarea/Textarea.js +1 -0
  161. package/dist/components/textarea/Textarea.js.map +1 -1
  162. package/dist/components/toast/Toast.d.ts.map +1 -1
  163. package/dist/components/toast/Toast.js +2 -1
  164. package/dist/components/toast/Toast.js.map +1 -1
  165. package/dist/components/toast/ToastElements.d.ts.map +1 -1
  166. package/dist/components/toast/ToastElements.js +4 -1
  167. package/dist/components/toast/ToastElements.js.map +1 -1
  168. package/dist/components/toggle/Toggle.d.ts.map +1 -1
  169. package/dist/components/toggle/Toggle.js +1 -0
  170. package/dist/components/toggle/Toggle.js.map +1 -1
  171. package/dist/components/toolbar/Toolbar.d.ts.map +1 -1
  172. package/dist/components/toolbar/Toolbar.js +5 -3
  173. package/dist/components/toolbar/Toolbar.js.map +1 -1
  174. package/dist/components/toolbar/ToolbarShell.d.ts.map +1 -1
  175. package/dist/components/toolbar/ToolbarShell.js +8 -5
  176. package/dist/components/toolbar/ToolbarShell.js.map +1 -1
  177. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  178. package/dist/components/tooltip/Tooltip.js +2 -0
  179. package/dist/components/tooltip/Tooltip.js.map +1 -1
  180. package/dist/components/virtual-scroll/VirtualScroll.d.ts.map +1 -1
  181. package/dist/components/virtual-scroll/VirtualScroll.js +42 -46
  182. package/dist/components/virtual-scroll/VirtualScroll.js.map +1 -1
  183. package/dist/components/virtual-scroll/VirtualScrollRowShell.d.ts +1 -1
  184. package/dist/components/virtual-scroll/VirtualScrollRowShell.js +3 -3
  185. package/dist/components/virtual-scroll/VirtualScrollRowShell.js.map +1 -1
  186. package/dist/components/virtual-scroll/index.d.ts +1 -1
  187. package/dist/components/virtual-scroll/index.d.ts.map +1 -1
  188. package/dist/components/virtual-scroll/index.js.map +1 -1
  189. package/dist/components/virtual-scroll/types.d.ts +5 -0
  190. package/dist/components/virtual-scroll/types.d.ts.map +1 -1
  191. package/dist/components/virtual-scroll/types.js.map +1 -1
  192. package/dist/components/virtual-scroll/virtual-scroll-axis.d.ts +9 -0
  193. package/dist/components/virtual-scroll/virtual-scroll-axis.d.ts.map +1 -0
  194. package/dist/components/virtual-scroll/virtual-scroll-axis.js +18 -0
  195. package/dist/components/virtual-scroll/virtual-scroll-axis.js.map +1 -0
  196. package/dist/components/virtual-scroll/virtual-scroll-scroll-sync.js +2 -2
  197. package/dist/components/virtual-scroll/virtual-scroll-scroll-sync.js.map +1 -1
  198. package/dist/core/render-native-invoker.d.ts +6 -3
  199. package/dist/core/render-native-invoker.d.ts.map +1 -1
  200. package/dist/core/render-native-invoker.js +5 -3
  201. package/dist/core/render-native-invoker.js.map +1 -1
  202. package/dist/elements/choice/Choice.d.ts +2 -2
  203. package/dist/elements/choice/Choice.js +1 -1
  204. package/dist/elements/choice/Choice.js.map +1 -1
  205. package/dist/elements/choice/types.d.ts +1 -1
  206. package/dist/elements/choice/types.d.ts.map +1 -1
  207. package/dist/elements/dialog/Dialog.d.ts +3 -3
  208. package/dist/elements/dialog/Dialog.d.ts.map +1 -1
  209. package/dist/elements/dialog/Dialog.js +5 -3
  210. package/dist/elements/dialog/Dialog.js.map +1 -1
  211. package/dist/elements/popover/Popover.d.ts +6 -5
  212. package/dist/elements/popover/Popover.d.ts.map +1 -1
  213. package/dist/elements/popover/Popover.js +8 -4
  214. package/dist/elements/popover/Popover.js.map +1 -1
  215. package/dist/styles/index.css +1 -1
  216. package/dist/styles/tailwind.css +33 -35
  217. package/dist/styles/tokens.css +1 -1
  218. package/package.json +7 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/line-chart/client/LineChartClient.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\nimport type { CSSProperties, ElementType, ReactElement, Ref } from \"react\";\nimport { useChartViewport } from \"../../../hooks/use-chart-viewport.js\";\nimport { useMergedRefs } from \"../../../hooks/use-merged-refs.js\";\nimport { LineChart } from \"../LineChart.js\";\nimport type { LineChartPointerPosition, LineChartProps } from \"../types.js\";\n\ninterface CursorState extends LineChartPointerPosition {}\n\ninterface InteractiveLineStyle extends CSSProperties {\n \"--line-scale\": string;\n}\n\n/**\n * `.line-chart__plot`'s fixed price-axis column (4.5rem) plus its grid gap\n * (0.75rem) — see line-chart.css. `useChartViewport` measures the whole\n * `<figure>`, but points only ever get the width left over after this\n * column, so it must be subtracted before sizing `minItemWidth`.\n */\nconst Y_AXIS_COLUMN_WIDTH = 72 + 12;\n\nexport function LineChartClient<TAs extends ElementType = \"figure\">(\n props: LineChartProps<TAs>,\n): ReactElement | null {\n const {\n data,\n ref: consumerRef,\n style: consumerStyle,\n onPointClick: consumerOnPointClick,\n onPointPointerLeave: consumerOnPointPointerLeave,\n onPointPointerMove: consumerOnPointPointerMove,\n ...consumerProps\n } = props as LineChartProps<\"figure\"> & {\n ref?: Ref<HTMLElement>;\n style?: CSSProperties;\n };\n const viewport = useChartViewport({\n itemCount: data.length,\n measuredWidthOffset: Y_AXIS_COLUMN_WIDTH,\n minItemWidth: 24,\n });\n const [cursor, setCursor] = useState<CursorState | null>(null);\n const [selectedPointIndex, setSelectedPointIndex] = useState<number | undefined>();\n const chartRef = useMergedRefs<HTMLElement>(viewport.ref, consumerRef);\n const handlePointClick = useCallback(\n (index: number) => {\n setSelectedPointIndex(index);\n consumerOnPointClick?.(index);\n },\n [consumerOnPointClick],\n );\n const handlePointPointerLeave = useCallback(() => {\n setCursor(null);\n consumerOnPointPointerLeave?.();\n }, [consumerOnPointPointerLeave]);\n const handlePointPointerMove = useCallback(\n (position: LineChartPointerPosition) => {\n setCursor(position);\n consumerOnPointPointerMove?.(position);\n },\n [consumerOnPointPointerMove],\n );\n\n const style: InteractiveLineStyle = {\n ...consumerStyle,\n \"--line-scale\": String(viewport.scale),\n };\n const chartProps = {\n ...consumerProps,\n data,\n activePointIndex: cursor?.index,\n cursorY: cursor?.offsetY,\n interactive: true,\n onPointClick: handlePointClick,\n onPointPointerLeave: handlePointPointerLeave,\n onPointPointerMove: handlePointPointerMove,\n ref: chartRef,\n selectedPointIndex,\n style,\n } as LineChartProps<\"figure\">;\n\n return <LineChart {...chartProps} />;\n}\nLineChartClient.displayName = \"LineChartClient\";\n"],"mappings":";AAmFS;AAjFT,SAAS,aAAa,gBAAgB;AAEtC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAe1B,MAAM,sBAAsB,KAAK;AAE1B,SAAS,gBACd,OACqB;AACrB,QAAM;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,OAAO;AAAA,IACP,cAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AAIJ,QAAM,WAAW,iBAAiB;AAAA,IAChC,WAAW,KAAK;AAAA,IAChB,qBAAqB;AAAA,IACrB,cAAc;AAAA,EAChB,CAAC;AACD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA6B,IAAI;AAC7D,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAA6B;AACjF,QAAM,WAAW,cAA2B,SAAS,KAAK,WAAW;AACrE,QAAM,mBAAmB;AAAA,IACvB,CAAC,UAAkB;AACjB,4BAAsB,KAAK;AAC3B,6BAAuB,KAAK;AAAA,IAC9B;AAAA,IACA,CAAC,oBAAoB;AAAA,EACvB;AACA,QAAM,0BAA0B,YAAY,MAAM;AAChD,cAAU,IAAI;AACd,kCAA8B;AAAA,EAChC,GAAG,CAAC,2BAA2B,CAAC;AAChC,QAAM,yBAAyB;AAAA,IAC7B,CAAC,aAAuC;AACtC,gBAAU,QAAQ;AAClB,mCAA6B,QAAQ;AAAA,IACvC;AAAA,IACA,CAAC,0BAA0B;AAAA,EAC7B;AAEA,QAAM,QAA8B;AAAA,IAClC,GAAG;AAAA,IACH,gBAAgB,OAAO,SAAS,KAAK;AAAA,EACvC;AACA,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH;AAAA,IACA,kBAAkB,QAAQ;AAAA,IAC1B,SAAS,QAAQ;AAAA,IACjB,aAAa;AAAA,IACb,cAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IACpB,KAAK;AAAA,IACL;AAAA,IACA;AAAA,EACF;AAEA,SAAO,oBAAC,aAAW,GAAG,YAAY;AACpC;AACA,gBAAgB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/line-chart/client/LineChartClient.tsx"],"sourcesContent":["\"use client\";\n\nimport { useCallback, useState } from \"react\";\nimport type { CSSProperties, ElementType, ReactElement, Ref } from \"react\";\nimport { useChartViewport } from \"../../../hooks/use-chart-viewport.js\";\nimport { useMergedRefs } from \"../../../hooks/use-merged-refs.js\";\nimport { LineChart } from \"../LineChart.js\";\nimport type { LineChartPointerPosition, LineChartProps } from \"../types.js\";\n\ninterface CursorState extends LineChartPointerPosition {}\n\ninterface InteractiveLineStyle extends CSSProperties {\n \"--line-scale\": string;\n}\n\n/**\n * `[data-part=\"plot\"]`'s fixed price-axis column (4.5rem) plus its grid gap\n * (0.75rem) — see line-chart.css. `useChartViewport` measures the whole\n * `<figure>`, but points only ever get the width left over after this\n * column, so it must be subtracted before sizing `minItemWidth`.\n */\nconst Y_AXIS_COLUMN_WIDTH = 72 + 12;\n\nexport function LineChartClient<TAs extends ElementType = \"figure\">(\n props: LineChartProps<TAs>,\n): ReactElement | null {\n const {\n data,\n ref: consumerRef,\n style: consumerStyle,\n onPointClick: consumerOnPointClick,\n onPointPointerLeave: consumerOnPointPointerLeave,\n onPointPointerMove: consumerOnPointPointerMove,\n ...consumerProps\n } = props as LineChartProps<\"figure\"> & {\n ref?: Ref<HTMLElement>;\n style?: CSSProperties;\n };\n const viewport = useChartViewport({\n itemCount: data.length,\n measuredWidthOffset: Y_AXIS_COLUMN_WIDTH,\n minItemWidth: 24,\n });\n const [cursor, setCursor] = useState<CursorState | null>(null);\n const [selectedPointIndex, setSelectedPointIndex] = useState<number | undefined>();\n const chartRef = useMergedRefs<HTMLElement>(viewport.ref, consumerRef);\n const handlePointClick = useCallback(\n (index: number) => {\n setSelectedPointIndex(index);\n consumerOnPointClick?.(index);\n },\n [consumerOnPointClick],\n );\n const handlePointPointerLeave = useCallback(() => {\n setCursor(null);\n consumerOnPointPointerLeave?.();\n }, [consumerOnPointPointerLeave]);\n const handlePointPointerMove = useCallback(\n (position: LineChartPointerPosition) => {\n setCursor(position);\n consumerOnPointPointerMove?.(position);\n },\n [consumerOnPointPointerMove],\n );\n\n const style: InteractiveLineStyle = {\n ...consumerStyle,\n \"--line-scale\": String(viewport.scale),\n };\n const chartProps = {\n ...consumerProps,\n data,\n activePointIndex: cursor?.index,\n cursorY: cursor?.offsetY,\n interactive: true,\n onPointClick: handlePointClick,\n onPointPointerLeave: handlePointPointerLeave,\n onPointPointerMove: handlePointPointerMove,\n ref: chartRef,\n selectedPointIndex,\n style,\n } as LineChartProps<\"figure\">;\n\n return <LineChart {...chartProps} />;\n}\nLineChartClient.displayName = \"LineChartClient\";\n"],"mappings":";AAmFS;AAjFT,SAAS,aAAa,gBAAgB;AAEtC,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,iBAAiB;AAe1B,MAAM,sBAAsB,KAAK;AAE1B,SAAS,gBACd,OACqB;AACrB,QAAM;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,OAAO;AAAA,IACP,cAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IACpB,GAAG;AAAA,EACL,IAAI;AAIJ,QAAM,WAAW,iBAAiB;AAAA,IAChC,WAAW,KAAK;AAAA,IAChB,qBAAqB;AAAA,IACrB,cAAc;AAAA,EAChB,CAAC;AACD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAA6B,IAAI;AAC7D,QAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAA6B;AACjF,QAAM,WAAW,cAA2B,SAAS,KAAK,WAAW;AACrE,QAAM,mBAAmB;AAAA,IACvB,CAAC,UAAkB;AACjB,4BAAsB,KAAK;AAC3B,6BAAuB,KAAK;AAAA,IAC9B;AAAA,IACA,CAAC,oBAAoB;AAAA,EACvB;AACA,QAAM,0BAA0B,YAAY,MAAM;AAChD,cAAU,IAAI;AACd,kCAA8B;AAAA,EAChC,GAAG,CAAC,2BAA2B,CAAC;AAChC,QAAM,yBAAyB;AAAA,IAC7B,CAAC,aAAuC;AACtC,gBAAU,QAAQ;AAClB,mCAA6B,QAAQ;AAAA,IACvC;AAAA,IACA,CAAC,0BAA0B;AAAA,EAC7B;AAEA,QAAM,QAA8B;AAAA,IAClC,GAAG;AAAA,IACH,gBAAgB,OAAO,SAAS,KAAK;AAAA,EACvC;AACA,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH;AAAA,IACA,kBAAkB,QAAQ;AAAA,IAC1B,SAAS,QAAQ;AAAA,IACjB,aAAa;AAAA,IACb,cAAc;AAAA,IACd,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IACpB,KAAK;AAAA,IACL;AAAA,IACA;AAAA,EACF;AAEA,SAAO,oBAAC,aAAW,GAAG,YAAY;AACpC;AACA,gBAAgB,cAAc;","names":[]}
@@ -5,7 +5,7 @@ import type { ModalProps } from "./types.js";
5
5
  * with title/description ids, one close button. Controlled or initially open
6
6
  * dialogs use `ModalClientContent` from `@gunkin/uiify/components/modal/client`.
7
7
  */
8
- export declare function Modal({ id, trigger, title, description, children, closeLabel, triggerClassName, className, closeClassName, }: ModalProps): ReactElement;
8
+ export declare function Modal({ id, trigger, title, description, children, closeLabel, className, }: ModalProps): ReactElement;
9
9
  export declare namespace Modal {
10
10
  var displayName: string;
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,EACpB,EAAE,EACF,OAAO,EACP,KAAK,EACL,WAAW,EACX,QAAQ,EACR,UAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,cAAc,GACf,EAAE,UAAU,GAAG,YAAY,CAwB3B;yBAlCe,KAAK"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,EACpB,EAAE,EACF,OAAO,EACP,KAAK,EACL,WAAW,EACX,QAAQ,EACR,UAAoB,EACpB,SAAS,GACV,EAAE,UAAU,GAAG,YAAY,CAoB3B;yBA5Be,KAAK"}
@@ -7,14 +7,12 @@ function Modal({
7
7
  description,
8
8
  children,
9
9
  closeLabel = "Close",
10
- triggerClassName,
11
- className,
12
- closeClassName
10
+ className
13
11
  }) {
14
12
  const titleId = `${id}-title`;
15
13
  const descriptionId = `${id}-description`;
16
- return /* @__PURE__ */ jsxs("div", { "data-uiify-dialog-scope": "", "data-uiify-modal-scope": "", children: [
17
- /* @__PURE__ */ jsx(ModalTrigger, { className: triggerClassName, target: id, children: trigger }),
14
+ return /* @__PURE__ */ jsxs("div", { "data-part": "root", "data-uiify-modal": "", children: [
15
+ /* @__PURE__ */ jsx(ModalTrigger, { target: id, children: trigger }),
18
16
  /* @__PURE__ */ jsxs(
19
17
  ModalContent,
20
18
  {
@@ -26,7 +24,7 @@ function Modal({
26
24
  /* @__PURE__ */ jsx("h2", { id: titleId, children: title }),
27
25
  description === void 0 ? null : /* @__PURE__ */ jsx("p", { id: descriptionId, children: description }),
28
26
  children,
29
- /* @__PURE__ */ jsx(ModalClose, { className: closeClassName, target: id, children: closeLabel })
27
+ /* @__PURE__ */ jsx(ModalClose, { target: id, children: closeLabel })
30
28
  ]
31
29
  }
32
30
  )
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { ModalClose, ModalContent, ModalTrigger } from \"./ModalParts.js\";\nimport type { ModalProps } from \"./types.js\";\n\n/**\n * Convenience shell over the native parts: one trigger, one modal `<dialog>`\n * with title/description ids, one close button. Controlled or initially open\n * dialogs use `ModalClientContent` from `@gunkin/uiify/components/modal/client`.\n */\nexport function Modal({\n id,\n trigger,\n title,\n description,\n children,\n closeLabel = \"Close\",\n triggerClassName,\n className,\n closeClassName,\n}: ModalProps): ReactElement {\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n\n return (\n <div data-uiify-dialog-scope=\"\" data-uiify-modal-scope=\"\">\n <ModalTrigger className={triggerClassName} target={id}>\n {trigger}\n </ModalTrigger>\n <ModalContent\n aria-describedby={description === undefined ? undefined : descriptionId}\n aria-labelledby={titleId}\n className={className}\n id={id}\n >\n <h2 id={titleId}>{title}</h2>\n {description === undefined ? null : <p id={descriptionId}>{description}</p>}\n {children}\n <ModalClose className={closeClassName} target={id}>\n {closeLabel}\n </ModalClose>\n </ModalContent>\n </div>\n );\n}\nModal.displayName = \"Modal\";\n"],"mappings":"AAyBM,cAGA,YAHA;AAxBN,SAAS,YAAY,cAAc,oBAAoB;AAQhD,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF,GAA6B;AAC3B,QAAM,UAAU,GAAG,EAAE;AACrB,QAAM,gBAAgB,GAAG,EAAE;AAE3B,SACE,qBAAC,SAAI,2BAAwB,IAAG,0BAAuB,IACrD;AAAA,wBAAC,gBAAa,WAAW,kBAAkB,QAAQ,IAChD,mBACH;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,oBAAkB,gBAAgB,SAAY,SAAY;AAAA,QAC1D,mBAAiB;AAAA,QACjB;AAAA,QACA;AAAA,QAEA;AAAA,8BAAC,QAAG,IAAI,SAAU,iBAAM;AAAA,UACvB,gBAAgB,SAAY,OAAO,oBAAC,OAAE,IAAI,eAAgB,uBAAY;AAAA,UACtE;AAAA,UACD,oBAAC,cAAW,WAAW,gBAAgB,QAAQ,IAC5C,sBACH;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AACA,MAAM,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/modal/Modal.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport { ModalClose, ModalContent, ModalTrigger } from \"./ModalParts.js\";\nimport type { ModalProps } from \"./types.js\";\n\n/**\n * Convenience shell over the native parts: one trigger, one modal `<dialog>`\n * with title/description ids, one close button. Controlled or initially open\n * dialogs use `ModalClientContent` from `@gunkin/uiify/components/modal/client`.\n */\nexport function Modal({\n id,\n trigger,\n title,\n description,\n children,\n closeLabel = \"Close\",\n className,\n}: ModalProps): ReactElement {\n const titleId = `${id}-title`;\n const descriptionId = `${id}-description`;\n\n return (\n <div data-part=\"root\" data-uiify-modal=\"\">\n <ModalTrigger target={id}>{trigger}</ModalTrigger>\n <ModalContent\n aria-describedby={description === undefined ? undefined : descriptionId}\n aria-labelledby={titleId}\n className={className}\n id={id}\n >\n <h2 id={titleId}>{title}</h2>\n {description === undefined ? null : <p id={descriptionId}>{description}</p>}\n {children}\n <ModalClose target={id}>{closeLabel}</ModalClose>\n </ModalContent>\n </div>\n );\n}\nModal.displayName = \"Modal\";\n"],"mappings":"AAuBM,cACA,YADA;AAtBN,SAAS,YAAY,cAAc,oBAAoB;AAQhD,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AACF,GAA6B;AAC3B,QAAM,UAAU,GAAG,EAAE;AACrB,QAAM,gBAAgB,GAAG,EAAE;AAE3B,SACE,qBAAC,SAAI,aAAU,QAAO,oBAAiB,IACrC;AAAA,wBAAC,gBAAa,QAAQ,IAAK,mBAAQ;AAAA,IACnC;AAAA,MAAC;AAAA;AAAA,QACC,oBAAkB,gBAAgB,SAAY,SAAY;AAAA,QAC1D,mBAAiB;AAAA,QACjB;AAAA,QACA;AAAA,QAEA;AAAA,8BAAC,QAAG,IAAI,SAAU,iBAAM;AAAA,UACvB,gBAAgB,SAAY,OAAO,oBAAC,OAAE,IAAI,eAAgB,uBAAY;AAAA,UACtE;AAAA,UACD,oBAAC,cAAW,QAAQ,IAAK,sBAAW;AAAA;AAAA;AAAA,IACtC;AAAA,KACF;AAEJ;AACA,MAAM,cAAc;","names":[]}
@@ -1,43 +1,16 @@
1
1
  import type { ElementType, ReactElement } from "react";
2
2
  import type { ModalCloseProps, ModalContentProps, ModalTriggerProps } from "./types.js";
3
- /**
4
- * Opens `target` modally through the browser: no React handler, works before hydration.
5
- *
6
- * Built on `@gunkin/uiify/elements/dialog`'s `Dialog.Trigger` (aliased — the element and this
7
- * component share a name), which already
8
- * emits `data-uiify-dialog-trigger`; this part adds its own `data-uiify-modal-trigger`.
9
- *
10
- * Calls the element directly as a function rather than rendering `<ElementDialogTrigger>`:
11
- * `Dialog.Trigger` has no hooks and no state (Tier 0, enforced by
12
- * elements/architecture.test.ts), so it is safe to invoke like any other pure function, and
13
- * doing so skips a `jsx()` call — measurable at this component's byte budget (`.size-limit.json`).
14
- */
3
+ /** Native modal invoker with modal identity and trigger anatomy. */
15
4
  export declare function ModalTrigger<TAs extends ElementType = "button">(props: ModalTriggerProps<TAs>): ReactElement;
16
5
  export declare namespace ModalTrigger {
17
6
  var displayName: string;
18
7
  }
19
- /**
20
- * A plain, initially closed `<dialog>`; the accessible name is the consumer's responsibility.
21
- *
22
- * Mirrors `@gunkin/uiify/elements/dialog`'s `Dialog.Content` markup and marker
23
- * (`data-uiify-dialog-content`) exactly, plus this component's own
24
- * `data-uiify-modal-content`. Written inline rather than rendered through the element:
25
- * `Dialog.Content`'s type requires an accessible name (aria-labelledby xor aria-label), and
26
- * `ModalContentProps` deliberately does not
27
- * tighten to match, since this part is a public, generic native part in its own right, not
28
- * only an implementation detail of the `Modal` convenience shell (which always supplies one).
29
- */
8
+ /** Native modal dialog content with modal identity and content anatomy. */
30
9
  export declare function ModalContent(props: ModalContentProps): ReactElement;
31
10
  export declare namespace ModalContent {
32
11
  var displayName: string;
33
12
  }
34
- /**
35
- * Requests closing `target` (fires the cancelable `cancel` event first).
36
- *
37
- * Built on `@gunkin/uiify/elements/dialog`'s `Dialog.Close`, which already emits
38
- * `data-uiify-dialog-close`; this part adds its own `data-uiify-modal-close`. See
39
- * `ModalTrigger` for why this calls the element as a function instead of rendering it.
40
- */
13
+ /** Native modal close invoker. */
41
14
  export declare function ModalClose<TAs extends ElementType = "button">(props: ModalCloseProps<TAs>): ReactElement;
42
15
  export declare namespace ModalClose {
43
16
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ModalParts.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalParts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAMvD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExF;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC7D,KAAK,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAC5B,YAAY,CAQd;yBAVe,YAAY;;;AAa5B;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAOnE;yBAPe,YAAY;;;AAU5B;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC3D,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,GAC1B,YAAY,CAQd;yBAVe,UAAU"}
1
+ {"version":3,"file":"ModalParts.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalParts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExF,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC7D,KAAK,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAC5B,YAAY,CAWd;yBAbe,YAAY;;;AAgB5B,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAOnE;yBAPe,YAAY;;;AAU5B,kCAAkC;AAClC,wBAAgB,UAAU,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC3D,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,GAC1B,YAAY,CAWd;yBAbe,UAAU"}
@@ -1,31 +1,34 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import {
3
- DialogClose as ElementDialogClose,
4
- DialogTrigger as ElementDialogTrigger
5
- } from "../../elements/dialog/index.js";
2
+ import { renderNativeInvoker } from "@gunkin/uiify/core/render";
6
3
  function ModalTrigger(props) {
7
4
  const { as, target, ...consumerProps } = props;
8
- return ElementDialogTrigger({
9
- ...consumerProps,
10
- ...as === void 0 ? {} : { as },
11
- "data-uiify-modal-trigger": "",
12
- target
13
- });
5
+ return renderNativeInvoker(
6
+ as,
7
+ "data-uiify-modal",
8
+ "trigger",
9
+ "show-modal",
10
+ target,
11
+ consumerProps,
12
+ { button: true }
13
+ );
14
14
  }
15
15
  ModalTrigger.displayName = "ModalTrigger";
16
16
  function ModalContent(props) {
17
17
  const { children, ...dialogProps } = props;
18
- return /* @__PURE__ */ jsx("dialog", { ...dialogProps, "data-uiify-dialog-content": "", "data-uiify-modal-content": "", children });
18
+ return /* @__PURE__ */ jsx("dialog", { ...dialogProps, "data-part": "content", "data-uiify-modal": "", children });
19
19
  }
20
20
  ModalContent.displayName = "ModalContent";
21
21
  function ModalClose(props) {
22
22
  const { as, target, ...consumerProps } = props;
23
- return ElementDialogClose({
24
- ...consumerProps,
25
- ...as === void 0 ? {} : { as },
26
- "data-uiify-modal-close": "",
27
- target
28
- });
23
+ return renderNativeInvoker(
24
+ as,
25
+ "data-uiify-modal",
26
+ "close",
27
+ "request-close",
28
+ target,
29
+ consumerProps,
30
+ { button: true, variant: "ghost" }
31
+ );
29
32
  }
30
33
  ModalClose.displayName = "ModalClose";
31
34
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/modal/ModalParts.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport {\n DialogClose as ElementDialogClose,\n DialogTrigger as ElementDialogTrigger,\n} from \"../../elements/dialog/index.js\";\nimport type { DialogCloseProps, DialogTriggerProps } from \"../../elements/dialog/index.js\";\nimport type { ModalCloseProps, ModalContentProps, ModalTriggerProps } from \"./types.js\";\n\n/**\n * Opens `target` modally through the browser: no React handler, works before hydration.\n *\n * Built on `@gunkin/uiify/elements/dialog`'s `Dialog.Trigger` (aliased — the element and this\n * component share a name), which already\n * emits `data-uiify-dialog-trigger`; this part adds its own `data-uiify-modal-trigger`.\n *\n * Calls the element directly as a function rather than rendering `<ElementDialogTrigger>`:\n * `Dialog.Trigger` has no hooks and no state (Tier 0, enforced by\n * elements/architecture.test.ts), so it is safe to invoke like any other pure function, and\n * doing so skips a `jsx()` call — measurable at this component's byte budget (`.size-limit.json`).\n */\nexport function ModalTrigger<TAs extends ElementType = \"button\">(\n props: ModalTriggerProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as ModalTriggerProps<\"button\">;\n return ElementDialogTrigger({\n ...consumerProps,\n ...(as === undefined ? {} : { as }),\n \"data-uiify-modal-trigger\": \"\",\n target,\n } as unknown as DialogTriggerProps<TAs>);\n}\nModalTrigger.displayName = \"ModalTrigger\";\n\n/**\n * A plain, initially closed `<dialog>`; the accessible name is the consumer's responsibility.\n *\n * Mirrors `@gunkin/uiify/elements/dialog`'s `Dialog.Content` markup and marker\n * (`data-uiify-dialog-content`) exactly, plus this component's own\n * `data-uiify-modal-content`. Written inline rather than rendered through the element:\n * `Dialog.Content`'s type requires an accessible name (aria-labelledby xor aria-label), and\n * `ModalContentProps` deliberately does not\n * tighten to match, since this part is a public, generic native part in its own right, not\n * only an implementation detail of the `Modal` convenience shell (which always supplies one).\n */\nexport function ModalContent(props: ModalContentProps): ReactElement {\n const { children, ...dialogProps } = props;\n return (\n <dialog {...dialogProps} data-uiify-dialog-content=\"\" data-uiify-modal-content=\"\">\n {children}\n </dialog>\n );\n}\nModalContent.displayName = \"ModalContent\";\n\n/**\n * Requests closing `target` (fires the cancelable `cancel` event first).\n *\n * Built on `@gunkin/uiify/elements/dialog`'s `Dialog.Close`, which already emits\n * `data-uiify-dialog-close`; this part adds its own `data-uiify-modal-close`. See\n * `ModalTrigger` for why this calls the element as a function instead of rendering it.\n */\nexport function ModalClose<TAs extends ElementType = \"button\">(\n props: ModalCloseProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as ModalCloseProps<\"button\">;\n return ElementDialogClose({\n ...consumerProps,\n ...(as === undefined ? {} : { as }),\n \"data-uiify-modal-close\": \"\",\n target,\n } as unknown as DialogCloseProps<TAs>);\n}\nModalClose.displayName = \"ModalClose\";\n"],"mappings":"AA+CI;AA9CJ;AAAA,EACE,eAAe;AAAA,EACf,iBAAiB;AAAA,OACZ;AAgBA,SAAS,aACd,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO,qBAAqB;AAAA,IAC1B,GAAG;AAAA,IACH,GAAI,OAAO,SAAY,CAAC,IAAI,EAAE,GAAG;AAAA,IACjC,4BAA4B;AAAA,IAC5B;AAAA,EACF,CAAuC;AACzC;AACA,aAAa,cAAc;AAapB,SAAS,aAAa,OAAwC;AACnE,QAAM,EAAE,UAAU,GAAG,YAAY,IAAI;AACrC,SACE,oBAAC,YAAQ,GAAG,aAAa,6BAA0B,IAAG,4BAAyB,IAC5E,UACH;AAEJ;AACA,aAAa,cAAc;AASpB,SAAS,WACd,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO,mBAAmB;AAAA,IACxB,GAAG;AAAA,IACH,GAAI,OAAO,SAAY,CAAC,IAAI,EAAE,GAAG;AAAA,IACjC,0BAA0B;AAAA,IAC1B;AAAA,EACF,CAAqC;AACvC;AACA,WAAW,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/modal/ModalParts.tsx"],"sourcesContent":["import type { ElementType, ReactElement } from \"react\";\nimport { renderNativeInvoker } from \"@gunkin/uiify/core/render\";\nimport type { ModalCloseProps, ModalContentProps, ModalTriggerProps } from \"./types.js\";\n\n/** Native modal invoker with modal identity and trigger anatomy. */\nexport function ModalTrigger<TAs extends ElementType = \"button\">(\n props: ModalTriggerProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as ModalTriggerProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-modal\",\n \"trigger\",\n \"show-modal\",\n target,\n consumerProps as Record<string, unknown>,\n { button: true },\n );\n}\nModalTrigger.displayName = \"ModalTrigger\";\n\n/** Native modal dialog content with modal identity and content anatomy. */\nexport function ModalContent(props: ModalContentProps): ReactElement {\n const { children, ...dialogProps } = props;\n return (\n <dialog {...dialogProps} data-part=\"content\" data-uiify-modal=\"\">\n {children}\n </dialog>\n );\n}\nModalContent.displayName = \"ModalContent\";\n\n/** Native modal close invoker. */\nexport function ModalClose<TAs extends ElementType = \"button\">(\n props: ModalCloseProps<TAs>,\n): ReactElement {\n const { as, target, ...consumerProps } = props as ModalCloseProps<\"button\">;\n return renderNativeInvoker(\n as,\n \"data-uiify-modal\",\n \"close\",\n \"request-close\",\n target,\n consumerProps as Record<string, unknown>,\n { button: true, variant: \"ghost\" },\n );\n}\nModalClose.displayName = \"ModalClose\";\n"],"mappings":"AAyBI;AAxBJ,SAAS,2BAA2B;AAI7B,SAAS,aACd,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,QAAQ,KAAK;AAAA,EACjB;AACF;AACA,aAAa,cAAc;AAGpB,SAAS,aAAa,OAAwC;AACnE,QAAM,EAAE,UAAU,GAAG,YAAY,IAAI;AACrC,SACE,oBAAC,YAAQ,GAAG,aAAa,aAAU,WAAU,oBAAiB,IAC3D,UACH;AAEJ;AACA,aAAa,cAAc;AAGpB,SAAS,WACd,OACc;AACd,QAAM,EAAE,IAAI,QAAQ,GAAG,cAAc,IAAI;AACzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,QAAQ,MAAM,SAAS,QAAQ;AAAA,EACnC;AACF;AACA,WAAW,cAAc;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ModalClientContent.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/client/ModalClientContent.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAM3D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,CAoG/E;yBApGe,kBAAkB"}
1
+ {"version":3,"file":"ModalClientContent.d.ts","sourceRoot":"","sources":["../../../../src/components/modal/client/ModalClientContent.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAM3D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,CA4G/E;yBA5Ge,kBAAkB"}
@@ -59,14 +59,17 @@ function ModalClientContent(props) {
59
59
  onClick?.(event);
60
60
  if (event.defaultPrevented || !closeOnBackdropClick) return;
61
61
  if (event.target !== event.currentTarget) return;
62
+ const box = event.currentTarget.getBoundingClientRect();
63
+ const onBackdrop = event.clientX < box.left || event.clientX > box.right || event.clientY < box.top || event.clientY > box.bottom;
64
+ if (!onBackdrop) return;
62
65
  event.currentTarget.requestClose();
63
66
  };
64
67
  return /* @__PURE__ */ jsx(
65
68
  "dialog",
66
69
  {
67
70
  ...dialogProps,
68
- "data-uiify-dialog-content": "",
69
- "data-uiify-modal-content": "",
71
+ "data-part": "content",
72
+ "data-uiify-modal": "",
70
73
  onClick: handleClick,
71
74
  ref: mergedRef,
72
75
  suppressHydrationWarning: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/modal/client/ModalClientContent.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useReducer, useRef, useState } from \"react\";\nimport type { MouseEvent, ReactElement } from \"react\";\nimport { useMergedRefs } from \"@gunkin/uiify/hooks\";\nimport type { ModalClientContentProps } from \"../types.js\";\n\nfunction increment(count: number): number {\n return count + 1;\n}\n\n/**\n * Controlled/initially-open adapter over a native modal `<dialog>`.\n *\n * The browser stays the owner of modality: opening is `showModal()`, closing is\n * `close()`, and every change — invoker command, Escape, `requestClose()`,\n * `form method=\"dialog\"`, programmatic — is observed through the single native\n * `toggle` event (Chrome 132, Firefox 133, Safari 26). SSR never emits `open`;\n * `defaultOpen` and controlled `open` are applied after mount.\n */\nexport function ModalClientContent(props: ModalClientContentProps): ReactElement {\n const {\n children,\n closeOnBackdropClick = false,\n defaultOpen = false,\n onClick,\n onOpenChange,\n open,\n ref,\n ...dialogProps\n } = props;\n\n const elementRef = useRef<HTMLDialogElement | null>(null);\n const mergedRef = useMergedRefs<HTMLDialogElement>(elementRef, ref);\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n // Bumped on every native toggle so the sync effect re-runs after the parent\n // has had its render: a controlling parent that rejected the change is then\n // reconciled by reverting the element.\n const [nativeVersion, recordNativeToggle] = useReducer(increment, 0);\n const controlled = open !== undefined;\n const wantOpen = controlled ? open : uncontrolledOpen;\n\n const wantOpenRef = useRef(wantOpen);\n wantOpenRef.current = wantOpen;\n const onOpenChangeRef = useRef(onOpenChange);\n onOpenChangeRef.current = onOpenChange;\n // One-shot: has the first-mount reconciliation below already run?\n const reconciledRef = useRef(false);\n\n useEffect(() => {\n const dialog = elementRef.current;\n if (!dialog) return;\n if (!reconciledRef.current) {\n reconciledRef.current = true;\n // SSR markup is always closed. If the dialog is already open at mount,\n // that can only mean a native invoker command opened it in the window\n // between initial paint and this effect running — the `toggle` event\n // fired with no listener attached yet, and that notification is\n // otherwise lost forever. Recover it exactly like a native toggle.\n //\n // The reverse (closed at mount) is never reconciled: it's indistinguishable\n // from \"nothing happened\" versus a pre-hydration open+close cycle that\n // netted back to closed, and it's also the normal starting shape for\n // defaultOpen (open before hydration) is reconciled when the DOM catches up.\n if (dialog.open && !wantOpenRef.current) {\n if (!controlled) setUncontrolledOpen(true);\n onOpenChangeRef.current?.(true);\n // Defer enacting show/close to the next pass, once the controlling\n // parent (if any) has had a chance to react to the report above —\n // the DOM already matches what was just reported, so there is\n // nothing to enact this pass regardless.\n recordNativeToggle();\n return;\n }\n }\n if (wantOpen && !dialog.open) dialog.showModal();\n else if (!wantOpen && dialog.open) dialog.close();\n // `controlled` is read above (line 66) and must be a dependency; the sibling\n // `toggle`-listener effect below lists it for the same reason.\n }, [nativeVersion, wantOpen, controlled]);\n\n useEffect(() => {\n const dialog = elementRef.current;\n if (!dialog) return;\n const onToggle = (event: Event): void => {\n const next = (event as ToggleEvent).newState === \"open\";\n // Programmatic changes already match the desired state; only report\n // changes the browser initiated.\n if (next === wantOpenRef.current) return;\n if (!controlled) setUncontrolledOpen(next);\n onOpenChangeRef.current?.(next);\n recordNativeToggle();\n };\n dialog.addEventListener(\"toggle\", onToggle);\n return () => dialog.removeEventListener(\"toggle\", onToggle);\n }, [controlled]);\n\n const handleClick = (event: MouseEvent<HTMLDialogElement>): void => {\n onClick?.(event);\n if (event.defaultPrevented || !closeOnBackdropClick) return;\n if (event.target !== event.currentTarget) return;\n (event.currentTarget as HTMLDialogElement & { requestClose(): void }).requestClose();\n };\n\n return (\n <dialog\n {...dialogProps}\n data-uiify-dialog-content=\"\"\n data-uiify-modal-content=\"\"\n onClick={handleClick}\n ref={mergedRef}\n // SSR markup is always closed, but the browser may have already opened this\n // dialog via a native invoker command before hydration (see the effect above,\n // which reconciles exactly that). React's hydration diff otherwise flags the\n // resulting `open` mismatch as an error; it is the documented recovery path.\n suppressHydrationWarning\n >\n {children}\n </dialog>\n );\n}\nModalClientContent.displayName = \"ModalClientContent\";\n"],"mappings":";AAyGI;AAvGJ,SAAS,WAAW,YAAY,QAAQ,gBAAgB;AAExD,SAAS,qBAAqB;AAG9B,SAAS,UAAU,OAAuB;AACxC,SAAO,QAAQ;AACjB;AAWO,SAAS,mBAAmB,OAA8C;AAC/E,QAAM;AAAA,IACJ;AAAA,IACA,uBAAuB;AAAA,IACvB,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,aAAa,OAAiC,IAAI;AACxD,QAAM,YAAY,cAAiC,YAAY,GAAG;AAClE,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,WAAW;AAIpE,QAAM,CAAC,eAAe,kBAAkB,IAAI,WAAW,WAAW,CAAC;AACnE,QAAM,aAAa,SAAS;AAC5B,QAAM,WAAW,aAAa,OAAO;AAErC,QAAM,cAAc,OAAO,QAAQ;AACnC,cAAY,UAAU;AACtB,QAAM,kBAAkB,OAAO,YAAY;AAC3C,kBAAgB,UAAU;AAE1B,QAAM,gBAAgB,OAAO,KAAK;AAElC,YAAU,MAAM;AACd,UAAM,SAAS,WAAW;AAC1B,QAAI,CAAC,OAAQ;AACb,QAAI,CAAC,cAAc,SAAS;AAC1B,oBAAc,UAAU;AAWxB,UAAI,OAAO,QAAQ,CAAC,YAAY,SAAS;AACvC,YAAI,CAAC,WAAY,qBAAoB,IAAI;AACzC,wBAAgB,UAAU,IAAI;AAK9B,2BAAmB;AACnB;AAAA,MACF;AAAA,IACF;AACA,QAAI,YAAY,CAAC,OAAO,KAAM,QAAO,UAAU;AAAA,aACtC,CAAC,YAAY,OAAO,KAAM,QAAO,MAAM;AAAA,EAGlD,GAAG,CAAC,eAAe,UAAU,UAAU,CAAC;AAExC,YAAU,MAAM;AACd,UAAM,SAAS,WAAW;AAC1B,QAAI,CAAC,OAAQ;AACb,UAAM,WAAW,CAAC,UAAuB;AACvC,YAAM,OAAQ,MAAsB,aAAa;AAGjD,UAAI,SAAS,YAAY,QAAS;AAClC,UAAI,CAAC,WAAY,qBAAoB,IAAI;AACzC,sBAAgB,UAAU,IAAI;AAC9B,yBAAmB;AAAA,IACrB;AACA,WAAO,iBAAiB,UAAU,QAAQ;AAC1C,WAAO,MAAM,OAAO,oBAAoB,UAAU,QAAQ;AAAA,EAC5D,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,cAAc,CAAC,UAA+C;AAClE,cAAU,KAAK;AACf,QAAI,MAAM,oBAAoB,CAAC,qBAAsB;AACrD,QAAI,MAAM,WAAW,MAAM,cAAe;AAC1C,IAAC,MAAM,cAA+D,aAAa;AAAA,EACrF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,6BAA0B;AAAA,MAC1B,4BAAyB;AAAA,MACzB,SAAS;AAAA,MACT,KAAK;AAAA,MAKL,0BAAwB;AAAA,MAEvB;AAAA;AAAA,EACH;AAEJ;AACA,mBAAmB,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/modal/client/ModalClientContent.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useReducer, useRef, useState } from \"react\";\nimport type { MouseEvent, ReactElement } from \"react\";\nimport { useMergedRefs } from \"@gunkin/uiify/hooks\";\nimport type { ModalClientContentProps } from \"../types.js\";\n\nfunction increment(count: number): number {\n return count + 1;\n}\n\n/**\n * Controlled/initially-open adapter over a native modal `<dialog>`.\n *\n * The browser stays the owner of modality: opening is `showModal()`, closing is\n * `close()`, and every change — invoker command, Escape, `requestClose()`,\n * `form method=\"dialog\"`, programmatic — is observed through the single native\n * `toggle` event (Chrome 132, Firefox 133, Safari 26). SSR never emits `open`;\n * `defaultOpen` and controlled `open` are applied after mount.\n */\nexport function ModalClientContent(props: ModalClientContentProps): ReactElement {\n const {\n children,\n closeOnBackdropClick = false,\n defaultOpen = false,\n onClick,\n onOpenChange,\n open,\n ref,\n ...dialogProps\n } = props;\n\n const elementRef = useRef<HTMLDialogElement | null>(null);\n const mergedRef = useMergedRefs<HTMLDialogElement>(elementRef, ref);\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n // Bumped on every native toggle so the sync effect re-runs after the parent\n // has had its render: a controlling parent that rejected the change is then\n // reconciled by reverting the element.\n const [nativeVersion, recordNativeToggle] = useReducer(increment, 0);\n const controlled = open !== undefined;\n const wantOpen = controlled ? open : uncontrolledOpen;\n\n const wantOpenRef = useRef(wantOpen);\n wantOpenRef.current = wantOpen;\n const onOpenChangeRef = useRef(onOpenChange);\n onOpenChangeRef.current = onOpenChange;\n // One-shot: has the first-mount reconciliation below already run?\n const reconciledRef = useRef(false);\n\n useEffect(() => {\n const dialog = elementRef.current;\n if (!dialog) return;\n if (!reconciledRef.current) {\n reconciledRef.current = true;\n // SSR markup is always closed. If the dialog is already open at mount,\n // that can only mean a native invoker command opened it in the window\n // between initial paint and this effect running — the `toggle` event\n // fired with no listener attached yet, and that notification is\n // otherwise lost forever. Recover it exactly like a native toggle.\n //\n // The reverse (closed at mount) is never reconciled: it's indistinguishable\n // from \"nothing happened\" versus a pre-hydration open+close cycle that\n // netted back to closed, and it's also the normal starting shape for\n // defaultOpen (open before hydration) is reconciled when the DOM catches up.\n if (dialog.open && !wantOpenRef.current) {\n if (!controlled) setUncontrolledOpen(true);\n onOpenChangeRef.current?.(true);\n // Defer enacting show/close to the next pass, once the controlling\n // parent (if any) has had a chance to react to the report above —\n // the DOM already matches what was just reported, so there is\n // nothing to enact this pass regardless.\n recordNativeToggle();\n return;\n }\n }\n if (wantOpen && !dialog.open) dialog.showModal();\n else if (!wantOpen && dialog.open) dialog.close();\n // `controlled` is read above (line 66) and must be a dependency; the sibling\n // `toggle`-listener effect below lists it for the same reason.\n }, [nativeVersion, wantOpen, controlled]);\n\n useEffect(() => {\n const dialog = elementRef.current;\n if (!dialog) return;\n const onToggle = (event: Event): void => {\n const next = (event as ToggleEvent).newState === \"open\";\n // Programmatic changes already match the desired state; only report\n // changes the browser initiated.\n if (next === wantOpenRef.current) return;\n if (!controlled) setUncontrolledOpen(next);\n onOpenChangeRef.current?.(next);\n recordNativeToggle();\n };\n dialog.addEventListener(\"toggle\", onToggle);\n return () => dialog.removeEventListener(\"toggle\", onToggle);\n }, [controlled]);\n\n const handleClick = (event: MouseEvent<HTMLDialogElement>): void => {\n onClick?.(event);\n if (event.defaultPrevented || !closeOnBackdropClick) return;\n if (event.target !== event.currentTarget) return;\n // A click on dialog padding targets the dialog too; only outside its border box is backdrop.\n const box = event.currentTarget.getBoundingClientRect(); // banned-read-ok: one read per user click, never per frame\n const onBackdrop =\n event.clientX < box.left ||\n event.clientX > box.right ||\n event.clientY < box.top ||\n event.clientY > box.bottom;\n if (!onBackdrop) return;\n (event.currentTarget as HTMLDialogElement & { requestClose(): void }).requestClose();\n };\n\n return (\n <dialog\n {...dialogProps}\n data-part=\"content\"\n data-uiify-modal=\"\"\n onClick={handleClick}\n ref={mergedRef}\n // SSR markup is always closed, but the browser may have already opened this\n // dialog via a native invoker command before hydration (see the effect above,\n // which reconciles exactly that). React's hydration diff otherwise flags the\n // resulting `open` mismatch as an error; it is the documented recovery path.\n suppressHydrationWarning\n >\n {children}\n </dialog>\n );\n}\nModalClientContent.displayName = \"ModalClientContent\";\n"],"mappings":";AAiHI;AA/GJ,SAAS,WAAW,YAAY,QAAQ,gBAAgB;AAExD,SAAS,qBAAqB;AAG9B,SAAS,UAAU,OAAuB;AACxC,SAAO,QAAQ;AACjB;AAWO,SAAS,mBAAmB,OAA8C;AAC/E,QAAM;AAAA,IACJ;AAAA,IACA,uBAAuB;AAAA,IACvB,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,aAAa,OAAiC,IAAI;AACxD,QAAM,YAAY,cAAiC,YAAY,GAAG;AAClE,QAAM,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sBAAsB;AACtD,UAAM,aACJ,MAAM,UAAU,IAAI,QACpB,MAAM,UAAU,IAAI,SACpB,MAAM,UAAU,IAAI,OACpB,MAAM,UAAU,IAAI;AACtB,QAAI,CAAC,WAAY;AACjB,IAAC,MAAM,cAA+D,aAAa;AAAA,EACrF;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,aAAU;AAAA,MACV,oBAAiB;AAAA,MACjB,SAAS;AAAA,MACT,KAAK;AAAA,MAKL,0BAAwB;AAAA,MAEvB;AAAA;AAAA,EACH;AAEJ;AACA,mBAAmB,cAAc;","names":[]}
@@ -7,9 +7,7 @@ export interface ModalProps {
7
7
  readonly description?: ReactNode;
8
8
  readonly children?: ReactNode;
9
9
  readonly closeLabel?: ReactNode;
10
- readonly triggerClassName?: string;
11
10
  readonly className?: string;
12
- readonly closeClassName?: string;
13
11
  }
14
12
  /** Own props of the native `show-modal` invoker. */
15
13
  export interface ModalTriggerOwnProps {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/modal/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC;IAChC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,SAAS,CAAC,EAA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Root(props) {
69
69
  defaultTag: "div",
70
70
  props: {
71
71
  ...consumerProps,
72
+ "data-uiify-otp-input": "",
72
73
  "data-disabled": disabled ? "" : void 0,
73
74
  "data-complete": value.length === length ? "" : void 0,
74
75
  onClick: composeEventHandlers(consumerOnClick, handleClick)
@@ -94,6 +95,7 @@ function OtpInputSlot(props) {
94
95
  props: {
95
96
  ...consumerProps,
96
97
  "aria-hidden": true,
98
+ "data-part": "slot",
97
99
  "data-active": active ? "" : void 0,
98
100
  "data-disabled": disabled ? "" : void 0,
99
101
  "data-filled": filled ? "" : void 0,
@@ -151,6 +153,7 @@ function OtpInputHiddenInput(props) {
151
153
  defaultTag: "input",
152
154
  props: {
153
155
  ...consumerProps,
156
+ "data-part": "control",
154
157
  id: inputId,
155
158
  ref: hiddenInputRef,
156
159
  type: mask ? "password" : "text",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/otp-input/OtpInput.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n useCallback,\n useMemo,\n useRef,\n useState,\n type ClipboardEvent,\n type CSSProperties,\n type ElementType,\n type KeyboardEvent,\n type ReactElement,\n type SyntheticEvent,\n} from \"react\";\nimport { useControllableState, useId } from \"@gunkin/uiify/hooks\";\nimport { createPartContext } from \"@gunkin/uiify/core\";\nimport { composeEventHandlers } from \"@gunkin/uiify/core/compose-event-handlers\";\nimport { useRenderElement } from \"@gunkin/uiify/core/render\";\nimport type { PolymorphicProps } from \"@gunkin/uiify/core/render\";\nimport type {\n OtpInputType,\n OtpInputContextValue,\n OtpInputRootProps,\n OtpInputSlotProps,\n OtpInputHiddenInputProps,\n} from \"./types.js\";\n\nconst [OtpInputProvider, useOtpInputContext] = createPartContext<OtpInputContextValue>(\"OtpInput\");\n\nfunction sanitizeValue(raw: string, type: OtpInputType, maxLength: number): string {\n const pattern = type === \"numeric\" ? /\\d/g : /[a-zA-Z0-9]/g;\n return (raw.match(pattern) ?? []).join(\"\").slice(0, maxLength);\n}\n\nexport function OtpInputRoot<TAs extends ElementType = \"div\">(\n props: OtpInputRootProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n length = 6,\n value: controlledValue,\n defaultValue = \"\",\n onChange,\n onComplete,\n type = \"numeric\",\n mask = false,\n disabled = false,\n autoFocus = false,\n ...consumerProps\n } = props as OtpInputRootProps<ElementType>;\n\n const hiddenInputRef = useRef<HTMLInputElement>(null);\n const [focused, setFocused] = useState(false);\n const [value, setValue] = useControllableState<string>({\n value: controlledValue,\n defaultValue,\n onChange,\n });\n\n const updateValue = useCallback(\n (nextRaw: string) => {\n const next = sanitizeValue(nextRaw, type, length);\n setValue(next);\n if (next.length === length) onComplete?.(next);\n },\n [length, onComplete, setValue, type],\n );\n\n const { onClick: consumerOnClick } = consumerProps as {\n onClick?: (event: SyntheticEvent<HTMLElement>) => void;\n };\n\n const handleClick = () => hiddenInputRef.current?.focus();\n\n const activeIndex = focused ? Math.min(value.length, length - 1) : -1;\n const contextValue = useMemo<OtpInputContextValue>(\n () => ({\n activeIndex,\n autoFocus,\n disabled,\n hiddenInputRef,\n length,\n mask,\n onHiddenBlur: () => setFocused(false),\n onHiddenFocus: () => setFocused(true),\n type,\n updateValue,\n value,\n }),\n [activeIndex, autoFocus, disabled, length, mask, type, updateValue, value],\n );\n\n const element = useRenderElement({\n as,\n defaultTag: \"div\",\n props: {\n ...consumerProps,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-complete\": value.length === length ? \"\" : undefined,\n onClick: composeEventHandlers(consumerOnClick, handleClick),\n },\n render,\n state: { disabled, mask, type },\n });\n\n return <OtpInputProvider value={contextValue}>{element}</OtpInputProvider>;\n}\nOtpInputRoot.displayName = \"OtpInputRoot\";\n\nexport function OtpInputSlot<TAs extends ElementType = \"div\">(\n props: OtpInputSlotProps<TAs>,\n): ReactElement | null {\n const { as, render, index, ...consumerProps } = props as OtpInputSlotProps<ElementType>;\n const { activeIndex, disabled, length, mask, value } = useOtpInputContext(\"Slot\");\n\n if (index < 0 || index >= length) {\n throw new Error(`OtpInput.Slot index ${index} is out of range for length ${length}`);\n }\n\n const char = value[index] ?? \"\";\n const active = activeIndex === index;\n const filled = char !== \"\";\n\n return useRenderElement({\n as,\n defaultTag: \"div\",\n props: {\n ...consumerProps,\n \"aria-hidden\": true,\n \"data-active\": active ? \"\" : undefined,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-filled\": filled ? \"\" : undefined,\n \"data-index\": index,\n children: mask && filled ? \"•\" : char,\n },\n render,\n state: { active, filled },\n });\n}\n\nexport function OtpInputHiddenInput<TAs extends ElementType = \"input\">(\n props: OtpInputHiddenInputProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n autoFocus: autoFocusProp,\n style: consumerStyle,\n ...consumerProps\n } = props as PolymorphicProps<\"input\", { readonly autoFocus?: boolean }>;\n\n const {\n autoFocus: rootAutoFocus,\n disabled,\n hiddenInputRef,\n length,\n mask,\n onHiddenBlur,\n onHiddenFocus,\n type,\n updateValue,\n value,\n } = useOtpInputContext(\"HiddenInput\");\n const inputId = useId();\n const autoFocus = autoFocusProp ?? rootAutoFocus;\n const {\n onBlur: consumerOnBlur,\n onChange: consumerOnChange,\n onFocus: consumerOnFocus,\n onKeyDown: consumerOnKeyDown,\n onPaste: consumerOnPaste,\n } = consumerProps as {\n onBlur?: (event: SyntheticEvent<HTMLInputElement>) => void;\n onChange?: (event: SyntheticEvent<HTMLInputElement>) => void;\n onFocus?: (event: SyntheticEvent<HTMLInputElement>) => void;\n onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n onPaste?: (event: ClipboardEvent<HTMLInputElement>) => void;\n };\n\n const handleChange = (event: SyntheticEvent<HTMLInputElement>) => {\n updateValue(event.currentTarget.value);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Backspace\" && value.length > 0) {\n event.preventDefault();\n updateValue(value.slice(0, -1));\n }\n };\n\n const handlePaste = (event: ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault();\n updateValue(event.clipboardData.getData(\"text\"));\n };\n\n return useRenderElement({\n as,\n defaultTag: \"input\",\n props: {\n ...consumerProps,\n id: inputId,\n ref: hiddenInputRef,\n type: mask ? \"password\" : \"text\",\n inputMode: type === \"numeric\" ? \"numeric\" : \"text\",\n autoComplete: \"one-time-code\",\n autoFocus: autoFocus || undefined,\n disabled: disabled || undefined,\n \"aria-label\": \"One-time code\",\n value,\n maxLength: length,\n onChange: composeEventHandlers(consumerOnChange, handleChange),\n onFocus: composeEventHandlers(consumerOnFocus, onHiddenFocus),\n onBlur: composeEventHandlers(consumerOnBlur, onHiddenBlur),\n onKeyDown: composeEventHandlers(consumerOnKeyDown, handleKeyDown),\n onPaste: composeEventHandlers(consumerOnPaste, handlePaste),\n style: {\n ...consumerStyle,\n position: \"absolute\",\n opacity: 0,\n pointerEvents: \"none\",\n width: 1,\n height: 1,\n } as CSSProperties,\n },\n render,\n state: { disabled },\n });\n}\n\nexport const OtpInput = {\n Root: OtpInputRoot,\n Slot: OtpInputSlot,\n HiddenInput: OtpInputHiddenInput,\n};\n"],"mappings":";AA0GS;AAxGT;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP,SAAS,sBAAsB,aAAa;AAC5C,SAAS,yBAAyB;AAClC,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AAUjC,MAAM,CAAC,kBAAkB,kBAAkB,IAAI,kBAAwC,UAAU;AAEjG,SAAS,cAAc,KAAa,MAAoB,WAA2B;AACjF,QAAM,UAAU,SAAS,YAAY,QAAQ;AAC7C,UAAQ,IAAI,MAAM,OAAO,KAAK,CAAC,GAAG,KAAK,EAAE,EAAE,MAAM,GAAG,SAAS;AAC/D;AAEO,SAAS,aACd,OACqB;AACrB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,OAAO;AAAA,IACP,eAAe;AAAA,IACf;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,OAAO;AAAA,IACP,W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EACvC;AAEA,QAAM,gBAAgB,CAAC,UAA2C;AAChE,QAAI,MAAM,QAAQ,eAAe,MAAM,SAAS,GAAG;AACjD,YAAM,eAAe;AACrB,kBAAY,MAAM,MAAM,GAAG,EAAE,CAAC;AAAA,IAChC;AAAA,EACF;AAEA,QAAM,cAAc,CAAC,UAA4C;AAC/D,UAAM,eAAe;AACrB,gBAAY,MAAM,cAAc,QAAQ,MAAM,CAAC;AAAA,EACjD;AAEA,SAAO,iBAAiB;AAAA,IACtB;AAAA,IACA,YAAY;AAAA,IACZ,OAAO;AAAA,MACL,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,KAAK;AAAA,MACL,MAAM,OAAO,aAAa;AAAA,MAC1B,WAAW,SAAS,YAAY,YAAY;AAAA,MAC5C,cAAc;AAAA,MACd,WAAW,aAAa;AAAA,MACxB,UAAU,YAAY;AAAA,MACtB,cAAc;AAAA,MACd;AAAA,MACA,WAAW;AAAA,MACX,UAAU,qBAAqB,kBAAkB,YAAY;AAAA,MAC7D,SAAS,qBAAqB,iBAAiB,aAAa;AAAA,MAC5D,QAAQ,qBAAqB,gBAAgB,YAAY;AAAA,MACzD,WAAW,qBAAqB,mBAAmB,aAAa;AAAA,MAChE,SAAS,qBAAqB,iBAAiB,WAAW;AAAA,MAC1D,OAAO;AAAA,QACL,GAAG;AAAA,QACH,UAAU;AAAA,QACV,SAAS;AAAA,QACT,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,EACpB,CAAC;AACH;AAEO,MAAM,WAAW;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AACf;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/otp-input/OtpInput.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n useCallback,\n useMemo,\n useRef,\n useState,\n type ClipboardEvent,\n type CSSProperties,\n type ElementType,\n type KeyboardEvent,\n type ReactElement,\n type SyntheticEvent,\n} from \"react\";\nimport { useControllableState, useId } from \"@gunkin/uiify/hooks\";\nimport { createPartContext } from \"@gunkin/uiify/core\";\nimport { composeEventHandlers } from \"@gunkin/uiify/core/compose-event-handlers\";\nimport { useRenderElement } from \"@gunkin/uiify/core/render\";\nimport type { PolymorphicProps } from \"@gunkin/uiify/core/render\";\nimport type {\n OtpInputType,\n OtpInputContextValue,\n OtpInputRootProps,\n OtpInputSlotProps,\n OtpInputHiddenInputProps,\n} from \"./types.js\";\n\nconst [OtpInputProvider, useOtpInputContext] = createPartContext<OtpInputContextValue>(\"OtpInput\");\n\nfunction sanitizeValue(raw: string, type: OtpInputType, maxLength: number): string {\n const pattern = type === \"numeric\" ? /\\d/g : /[a-zA-Z0-9]/g;\n return (raw.match(pattern) ?? []).join(\"\").slice(0, maxLength);\n}\n\nexport function OtpInputRoot<TAs extends ElementType = \"div\">(\n props: OtpInputRootProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n length = 6,\n value: controlledValue,\n defaultValue = \"\",\n onChange,\n onComplete,\n type = \"numeric\",\n mask = false,\n disabled = false,\n autoFocus = false,\n ...consumerProps\n } = props as OtpInputRootProps<ElementType>;\n\n const hiddenInputRef = useRef<HTMLInputElement>(null);\n const [focused, setFocused] = useState(false);\n const [value, setValue] = useControllableState<string>({\n value: controlledValue,\n defaultValue,\n onChange,\n });\n\n const updateValue = useCallback(\n (nextRaw: string) => {\n const next = sanitizeValue(nextRaw, type, length);\n setValue(next);\n if (next.length === length) onComplete?.(next);\n },\n [length, onComplete, setValue, type],\n );\n\n const { onClick: consumerOnClick } = consumerProps as {\n onClick?: (event: SyntheticEvent<HTMLElement>) => void;\n };\n\n const handleClick = () => hiddenInputRef.current?.focus();\n\n const activeIndex = focused ? Math.min(value.length, length - 1) : -1;\n const contextValue = useMemo<OtpInputContextValue>(\n () => ({\n activeIndex,\n autoFocus,\n disabled,\n hiddenInputRef,\n length,\n mask,\n onHiddenBlur: () => setFocused(false),\n onHiddenFocus: () => setFocused(true),\n type,\n updateValue,\n value,\n }),\n [activeIndex, autoFocus, disabled, length, mask, type, updateValue, value],\n );\n\n const element = useRenderElement({\n as,\n defaultTag: \"div\",\n props: {\n ...consumerProps,\n \"data-uiify-otp-input\": \"\",\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-complete\": value.length === length ? \"\" : undefined,\n onClick: composeEventHandlers(consumerOnClick, handleClick),\n },\n render,\n state: { disabled, mask, type },\n });\n\n return <OtpInputProvider value={contextValue}>{element}</OtpInputProvider>;\n}\nOtpInputRoot.displayName = \"OtpInputRoot\";\n\nexport function OtpInputSlot<TAs extends ElementType = \"div\">(\n props: OtpInputSlotProps<TAs>,\n): ReactElement | null {\n const { as, render, index, ...consumerProps } = props as OtpInputSlotProps<ElementType>;\n const { activeIndex, disabled, length, mask, value } = useOtpInputContext(\"Slot\");\n\n if (index < 0 || index >= length) {\n throw new Error(`OtpInput.Slot index ${index} is out of range for length ${length}`);\n }\n\n const char = value[index] ?? \"\";\n const active = activeIndex === index;\n const filled = char !== \"\";\n\n return useRenderElement({\n as,\n defaultTag: \"div\",\n props: {\n ...consumerProps,\n \"aria-hidden\": true,\n \"data-part\": \"slot\",\n \"data-active\": active ? \"\" : undefined,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-filled\": filled ? \"\" : undefined,\n \"data-index\": index,\n children: mask && filled ? \"•\" : char,\n },\n render,\n state: { active, filled },\n });\n}\n\nexport function OtpInputHiddenInput<TAs extends ElementType = \"input\">(\n props: OtpInputHiddenInputProps<TAs>,\n): ReactElement | null {\n const {\n as,\n render,\n autoFocus: autoFocusProp,\n style: consumerStyle,\n ...consumerProps\n } = props as PolymorphicProps<\"input\", { readonly autoFocus?: boolean }>;\n\n const {\n autoFocus: rootAutoFocus,\n disabled,\n hiddenInputRef,\n length,\n mask,\n onHiddenBlur,\n onHiddenFocus,\n type,\n updateValue,\n value,\n } = useOtpInputContext(\"HiddenInput\");\n const inputId = useId();\n const autoFocus = autoFocusProp ?? rootAutoFocus;\n const {\n onBlur: consumerOnBlur,\n onChange: consumerOnChange,\n onFocus: consumerOnFocus,\n onKeyDown: consumerOnKeyDown,\n onPaste: consumerOnPaste,\n } = consumerProps as {\n onBlur?: (event: SyntheticEvent<HTMLInputElement>) => void;\n onChange?: (event: SyntheticEvent<HTMLInputElement>) => void;\n onFocus?: (event: SyntheticEvent<HTMLInputElement>) => void;\n onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n onPaste?: (event: ClipboardEvent<HTMLInputElement>) => void;\n };\n\n const handleChange = (event: SyntheticEvent<HTMLInputElement>) => {\n updateValue(event.currentTarget.value);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === \"Backspace\" && value.length > 0) {\n event.preventDefault();\n updateValue(value.slice(0, -1));\n }\n };\n\n const handlePaste = (event: ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault();\n updateValue(event.clipboardData.getData(\"text\"));\n };\n\n return useRenderElement({\n as,\n defaultTag: \"input\",\n props: {\n ...consumerProps,\n \"data-part\": \"control\",\n id: inputId,\n ref: hiddenInputRef,\n type: mask ? \"password\" : \"text\",\n inputMode: type === \"numeric\" ? \"numeric\" : \"text\",\n autoComplete: \"one-time-code\",\n autoFocus: autoFocus || undefined,\n disabled: disabled || undefined,\n \"aria-label\": \"One-time code\",\n value,\n maxLength: length,\n onChange: composeEventHandlers(consumerOnChange, handleChange),\n onFocus: composeEventHandlers(consumerOnFocus, onHiddenFocus),\n onBlur: composeEventHandlers(consumerOnBlur, onHiddenBlur),\n onKeyDown: composeEventHandlers(consumerOnKeyDown, handleKeyDown),\n onPaste: composeEventHandlers(consumerOnPaste, handlePaste),\n style: {\n ...consumerStyle,\n position: \"absolute\",\n opacity: 0,\n pointerEvents: \"none\",\n width: 1,\n height: 1,\n } as CSSProperties,\n },\n render,\n state: { disabled },\n });\n}\n\nexport const OtpInput = {\n Root: OtpInputRoot,\n Slot: OtpInputSlot,\n H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AA,MACX,UAAU,qBAAqB,kBAAkB,YAAY;AAAA,MAC7D,SAAS,qBAAqB,iBAAiB,aAAa;AAAA,MAC5D,QAAQ,qBAAqB,gBAAgB,YAAY;AAAA,MACzD,WAAW,qBAAqB,mBAAmB,aAAa;AAAA,MAChE,SAAS,qBAAqB,iBAAiB,WAAW;AAAA,MAC1D,OAAO;AAAA,QACL,GAAG;AAAA,QACH,UAAU;AAAA,QACV,SAAS;AAAA,QACT,eAAe;AAAA,QACf,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,EACpB,CAAC;AACH;AAEO,MAAM,WAAW;AAAA,EACtB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,aAAa;AACf;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/popup/Popup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAa,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAKV,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAmDpB,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,GAAG,IAAI,CA2BpE;yBA3Be,SAAS;;;AA8BzB,wBAAgB,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,GAAG,IAAI,CAuBlF;yBAvBe,YAAY;;;AA0B5B,wBAAgB,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,GAAG,IAAI,CA2ClF;yBA3Ce,YAAY;;;AA8C5B,wBAAgB,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,GAAG,IAAI,CAkB9E;yBAlBe,UAAU;;;AA2B1B,eAAO,MAAM,KAAK;;;;;CAKjB,CAAC"}
1
+ {"version":3,"file":"Popup.d.ts","sourceRoot":"","sources":["../../../src/components/popup/Popup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAa,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAKV,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAmDpB,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,GAAG,IAAI,CA0BpE;yBA1Be,SAAS;;;AA6BzB,wBAAgB,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,GAAG,IAAI,CAyBlF;yBAzBe,YAAY;;;AA4B5B,wBAAgB,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,YAAY,GAAG,IAAI,CA6ClF;yBA7Ce,YAAY;;;AAgD5B,wBAAgB,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,GAAG,IAAI,CAoB9E;yBApBe,UAAU;;;AA6B1B,eAAO,MAAM,KAAK;;;;;CAKjB,CAAC"}
@@ -55,9 +55,8 @@ function PopupRoot(props) {
55
55
  {
56
56
  ...consumerProps,
57
57
  ...className ? { className } : {},
58
- // Emit both the current marker and the deprecated marker during the compatibility window.
59
- "data-uiify-popover-root": "",
60
- "data-uiify-popup-root": ""
58
+ "data-part": "root",
59
+ "data-uiify-popup": ""
61
60
  },
62
61
  enhancedChildren
63
62
  );
@@ -74,6 +73,8 @@ function PopupTrigger(props) {
74
73
  {
75
74
  ...consumerProps,
76
75
  ...createAnchorTriggerProps(anchorName, consumerProps.style),
76
+ "data-part": "trigger",
77
+ "data-uiify-popup": "",
77
78
  "aria-controls": __popupId,
78
79
  "aria-expanded": false,
79
80
  className,
@@ -119,6 +120,8 @@ function PopupContent(props) {
119
120
  side
120
121
  }),
121
122
  ...className ? { className } : {},
123
+ "data-part": "content",
124
+ "data-uiify-popup": "",
122
125
  id: __popupId,
123
126
  popover: __mode
124
127
  },
@@ -136,6 +139,8 @@ function PopupClose(props) {
136
139
  {
137
140
  ...consumerProps,
138
141
  ...className ? { className } : {},
142
+ "data-part": "close",
143
+ "data-uiify-popup": "",
139
144
  command: "hide-popover",
140
145
  commandfor: __popupId,
141
146
  type: "button"
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/popup/Popup.tsx"],"sourcesContent":["import { Children, createElement, isValidElement } from \"react\";\nimport type { CSSProperties, ReactElement, ReactNode } from \"react\";\nimport type {\n AnchorSide,\n AnchorAlign,\n PopupInjectedProps,\n PopupPartName,\n PopupRootProps,\n PopupTriggerInternalProps,\n PopupContentInternalProps,\n PopupCloseInternalProps,\n} from \"./types.js\";\n\nfunction anchorNameForId(id: string): string {\n return `--${id}-anchor`;\n}\n\nfunction createAnchorTriggerProps(anchorName: string, consumerStyle?: CSSProperties) {\n return {\n \"data-anchor\": \"\",\n style: { ...consumerStyle, \"--uiify-anchor\": anchorName } as CSSProperties,\n } as const;\n}\n\nfunction createAnchorPositionerProps({\n align,\n anchorName,\n consumerStyle,\n side,\n}: {\n readonly align: AnchorAlign;\n readonly anchorName: string;\n readonly consumerStyle?: CSSProperties | undefined;\n readonly side: AnchorSide;\n}) {\n return {\n \"data-align\": align,\n \"data-anchor\": \"\",\n \"data-positioning\": \"native\" as const,\n \"data-side\": side,\n style: { ...consumerStyle, \"--uiify-anchor\": anchorName } as CSSProperties,\n };\n}\n\nconst POPOVER_PART = Symbol.for(\"@gunkin/uiify/popup/part\");\n\nfunction markPopupPart<T>(component: T, part: PopupPartName): T {\n Object.defineProperty(component, POPOVER_PART, { enumerable: false, value: part });\n return component;\n}\n\nfunction getPopupPart(type: unknown): PopupPartName | undefined {\n if (typeof type === \"function\" || (typeof type === \"object\" && type !== null)) {\n return (type as Record<symbol, PopupPartName | undefined>)[POPOVER_PART];\n }\n return undefined;\n}\n\nfunction isPopupPart(type: unknown, part: PopupPartName): boolean {\n return getPopupPart(type) === part;\n}\n\nexport function PopupRoot(props: PopupRootProps): ReactElement | null {\n const { children, className, id, mode = \"auto\", ...consumerProps } = props;\n\n const enhancedChildren = Children.map(children, (child: ReactNode) => {\n if (!isValidElement<PopupInjectedProps>(child)) return child;\n const part = getPopupPart(child.type);\n if (part === \"trigger\" || part === \"content\" || part === \"close\") {\n return createElement(child.type, {\n ...(child.props as Record<string, unknown>),\n __mode: mode,\n __popupId: id,\n });\n }\n return child;\n });\n\n return createElement(\n \"div\",\n {\n ...consumerProps,\n ...(className ? { className } : {}),\n // Emit both the current marker and the deprecated marker during the compatibility window.\n \"data-uiify-popover-root\": \"\",\n \"data-uiify-popup-root\": \"\",\n },\n enhancedChildren,\n );\n}\nPopupRoot.displayName = \"PopupRoot\";\n\nexport function PopupTrigger(props: PopupTriggerInternalProps): ReactElement | null {\n const { children, className, __mode: _mode, __popupId, ...consumerProps } = props;\n\n if (!__popupId) {\n throw new Error(\"Popup.Trigger must be used within Popup.Root\");\n }\n\n const anchorName = anchorNameForId(__popupId);\n\n return createElement(\n \"button\",\n {\n ...consumerProps,\n ...createAnchorTriggerProps(anchorName, consumerProps.style),\n \"aria-controls\": __popupId,\n \"aria-expanded\": false,\n className,\n command: \"toggle-popover\",\n commandfor: __popupId,\n type: \"button\",\n },\n children,\n );\n}\nPopupTrigger.displayName = \"PopupTrigger\";\n\nexport function PopupContent(props: PopupContentInternalProps): ReactElement | null {\n const {\n align = \"center\",\n children,\n className,\n side = \"bottom\",\n __mode = \"auto\",\n __popupId,\n ...consumerProps\n } = props;\n\n if (!__popupId) {\n throw new Error(\"Popup.Content must be used within Popup.Root\");\n }\n\n const anchorName = anchorNameForId(__popupId);\n\n const enhancedChildren = Children.map(children, (child: ReactNode) => {\n if (isValidElement<PopupInjectedProps>(child) && isPopupPart(child.type, \"close\")) {\n return createElement(child.type, {\n ...(child.props as Record<string, unknown>),\n __popupId,\n });\n }\n return child;\n });\n\n return createElement(\n \"div\",\n {\n ...consumerProps,\n ...createAnchorPositionerProps({\n align,\n anchorName,\n consumerStyle: consumerProps.style,\n side,\n }),\n ...(className ? { className } : {}),\n id: __popupId,\n popover: __mode,\n },\n enhancedChildren,\n );\n}\nPopupContent.displayName = \"PopupContent\";\n\nexport function PopupClose(props: PopupCloseInternalProps): ReactElement | null {\n const { children, className, __mode: _mode, __popupId, ...consumerProps } = props;\n\n if (!__popupId) {\n throw new Error(\"Popup.Close must be used within Popup.Root\");\n }\n\n return createElement(\n \"button\",\n {\n ...consumerProps,\n ...(className ? { className } : {}),\n command: \"hide-popover\",\n commandfor: __popupId,\n type: \"button\",\n },\n children,\n );\n}\nPopupClose.displayName = \"PopupClose\";\n\nmarkPopupPart(PopupTrigger, \"trigger\");\n\nmarkPopupPart(PopupContent, \"content\");\n\nmarkPopupPart(PopupClose, \"close\");\n\nexport const Popup = {\n Close: PopupClose,\n Content: PopupContent,\n Root: PopupRoot,\n Trigger: PopupTrigger,\n};\n"],"mappings":"AAAA,SAAS,UAAU,eAAe,sBAAsB;AAaxD,SAAS,gBAAgB,IAAoB;AAC3C,SAAO,KAAK,EAAE;AAChB;AAEA,SAAS,yBAAyB,YAAoB,eAA+B;AACnF,SAAO;AAAA,IACL,eAAe;AAAA,IACf,OAAO,EAAE,GAAG,eAAe,kBAAkB,WAAW;AAAA,EAC1D;AACF;AAEA,SAAS,4BAA4B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,SAAO;AAAA,IACL,cAAc;AAAA,IACd,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,aAAa;AAAA,IACb,OAAO,EAAE,GAAG,eAAe,kBAAkB,WAAW;AAAA,EAC1D;AACF;AAEA,MAAM,eAAe,uBAAO,IAAI,0BAA0B;AAE1D,SAAS,cAAiB,WAAc,MAAwB;AAC9D,SAAO,eAAe,WAAW,cAAc,EAAE,YAAY,OAAO,OAAO,KAAK,CAAC;AACjF,SAAO;AACT;AAEA,SAAS,aAAa,MAA0C;AAC9D,MAAI,OAAO,SAAS,cAAe,OAAO,SAAS,YAAY,SAAS,MAAO;AAC7E,WAAQ,KAAmD,YAAY;AAAA,EACzE;AACA,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ACX;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/popup/Popup.tsx"],"sourcesContent":["import { Children, createElement, isValidElement } from \"react\";\nimport type { CSSProperties, ReactElement, ReactNode } from \"react\";\nimport type {\n AnchorSide,\n AnchorAlign,\n PopupInjectedProps,\n PopupPartName,\n PopupRootProps,\n PopupTriggerInternalProps,\n PopupContentInternalProps,\n PopupCloseInternalProps,\n} from \"./types.js\";\n\nfunction anchorNameForId(id: string): string {\n return `--${id}-anchor`;\n}\n\nfunction createAnchorTriggerProps(anchorName: string, consumerStyle?: CSSProperties) {\n return {\n \"data-anchor\": \"\",\n style: { ...consumerStyle, \"--uiify-anchor\": anchorName } as CSSProperties,\n } as const;\n}\n\nfunction createAnchorPositionerProps({\n align,\n anchorName,\n consumerStyle,\n side,\n}: {\n readonly align: AnchorAlign;\n readonly anchorName: string;\n readonly consumerStyle?: CSSProperties | undefined;\n readonly side: AnchorSide;\n}) {\n return {\n \"data-align\": align,\n \"data-anchor\": \"\",\n \"data-positioning\": \"native\" as const,\n \"data-side\": side,\n style: { ...consumerStyle, \"--uiify-anchor\": anchorName } as CSSProperties,\n };\n}\n\nconst POPOVER_PART = Symbol.for(\"@gunkin/uiify/popup/part\");\n\nfunction markPopupPart<T>(component: T, part: PopupPartName): T {\n Object.defineProperty(component, POPOVER_PART, { enumerable: false, value: part });\n return component;\n}\n\nfunction getPopupPart(type: unknown): PopupPartName | undefined {\n if (typeof type === \"function\" || (typeof type === \"object\" && type !== null)) {\n return (type as Record<symbol, PopupPartName | undefined>)[POPOVER_PART];\n }\n return undefined;\n}\n\nfunction isPopupPart(type: unknown, part: PopupPartName): boolean {\n return getPopupPart(type) === part;\n}\n\nexport function PopupRoot(props: PopupRootProps): ReactElement | null {\n const { children, className, id, mode = \"auto\", ...consumerProps } = props;\n\n const enhancedChildren = Children.map(children, (child: ReactNode) => {\n if (!isValidElement<PopupInjectedProps>(child)) return child;\n const part = getPopupPart(child.type);\n if (part === \"trigger\" || part === \"content\" || part === \"close\") {\n return createElement(child.type, {\n ...(child.props as Record<string, unknown>),\n __mode: mode,\n __popupId: id,\n });\n }\n return child;\n });\n\n return createElement(\n \"div\",\n {\n ...consumerProps,\n ...(className ? { className } : {}),\n \"data-part\": \"root\",\n \"data-uiify-popup\": \"\",\n },\n enhancedChildren,\n );\n}\nPopupRoot.displayName = \"PopupRoot\";\n\nexport function PopupTrigger(props: PopupTriggerInternalProps): ReactElement | null {\n const { children, className, __mode: _mode, __popupId, ...consumerProps } = props;\n\n if (!__popupId) {\n throw new Error(\"Popup.Trigger must be used within Popup.Root\");\n }\n\n const anchorName = anchorNameForId(__popupId);\n\n return createElement(\n \"button\",\n {\n ...consumerProps,\n ...createAnchorTriggerProps(anchorName, consumerProps.style),\n \"data-part\": \"trigger\",\n \"data-uiify-popup\": \"\",\n \"aria-controls\": __popupId,\n \"aria-expanded\": false,\n className,\n command: \"toggle-popover\",\n commandfor: __popupId,\n type: \"button\",\n },\n children,\n );\n}\nPopupTrigger.displayName = \"PopupTrigger\";\n\nexport function PopupContent(props: PopupContentInternalProps): ReactElement | null {\n const {\n align = \"center\",\n children,\n className,\n side = \"bottom\",\n __mode = \"auto\",\n __popupId,\n ...consumerProps\n } = props;\n\n if (!__popupId) {\n throw new Error(\"Popup.Content must be used within Popup.Root\");\n }\n\n const anchorName = anchorNameForId(__popupId);\n\n const enhancedChildren = Children.map(children, (child: ReactNode) => {\n if (isValidElement<PopupInjectedProps>(child) && isPopupPart(child.type, \"close\")) {\n return createElement(child.type, {\n ...(child.props as Record<string, unknown>),\n __popupId,\n });\n }\n return child;\n });\n\n return createElement(\n \"div\",\n {\n ...consumerProps,\n ...createAnchorPositionerProps({\n align,\n anchorName,\n consumerStyle: consumerProps.style,\n side,\n }),\n ...(className ? { className } : {}),\n \"data-part\": \"content\",\n \"data-uiify-popup\": \"\",\n id: __popupId,\n popover: __mode,\n },\n enhancedChildren,\n );\n}\nPopupContent.displayName = \"PopupContent\";\n\nexport function PopupClose(props: PopupCloseInternalProps): ReactElement | null {\n const { children, className, __mode: _mode, __popupId, ...consumerProps } = props;\n\n if (!__popupId) {\n throw new Error(\"Popup.Close must be used within Popup.Root\");\n }\n\n return createElement(\n \"button\",\n {\n ...consumerProps,\n ...(className ? { className } : {}),\n \"data-part\": \"close\",\n \"data-uiify-popup\": \"\",\n command: \"hide-popover\",\n commandfor: __popupId,\n type: \"button\",\n },\n children,\n );\n}\nPopupClose.displayName = \"PopupClose\";\n\nmarkPopupPart(PopupTrigger, \"trigger\");\n\nmarkPopupPart(PopupContent, \"content\");\n\nmarkPopupPart(PopupClose, \"close\");\n\nexport const Popup = {\n Close: PopupClose,\n Content: PopupContent,\n Root: PopupRoot,\n Trigger: PopupTrigger,\n};\n"],"mappings":"AAAA,SAAS,UAAU,eAAe,sBAAsB;AAaxD,SAAS,gBAAgB,IAAoB;AAC3C,SAAO,KAAK,EAAE;AAChB;AAEA,SAAS,yBAAyB,YAAoB,eAA+B;AACnF,SAAO;AAAA,IACL,eAAe;AAAA,IACf,OAAO,EAAE,GAAG,eAAe,kBAAkB,WAAW;AAAA,EAC1D;AACF;AAEA,SAAS,4BAA4B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,SAAO;AAAA,IACL,cAAc;AAAA,IACd,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,aAAa;AAAA,IACb,OAAO,EAAE,GAAG,eAAe,kBAAkB,WAAW;AAAA,EAC1D;AACF;AAEA,MAAM,eAAe,uBAAO,IAAI,0BAA0B;AAE1D,SAAS,cAAiB,WAAc,MAAwB;AAC9D,SAAO,eAAe,WAAW,cAAc,EAAE,YAAY,OAAO,OAAO,KAAK,CAAC;AACjF,SAAO;AACT;AAEA,SAAS,aAAa,MAA0C;AAC9D,MAAI,OAAO,SAAS,cAAe,OAAO,SAAS,YAAY,SAAS,MAAO;AAC7E,WAAQ,KAAmD,YAAY;AAAA,EACzE;AACA,SAAO;AACT;AAEA,SAAS,YAAY,MAA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A,EACnB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AACX;","names":[]}
@@ -1,39 +1,16 @@
1
1
  import type { ElementType, ReactElement } from "react";
2
2
  import type { PopupCloseProps, PopupContentProps, PopupTriggerProps } from "./types.js";
3
- /**
4
- * Toggles `target`; light dismiss, Escape and nesting are handled by the browser.
5
- *
6
- * Built on `@gunkin/uiify/elements/popover`'s `Popover.Trigger`, which already emits
7
- * `data-uiify-popover-trigger` — the deprecated marker this component used to emit itself
8
- * now comes free from the element, so the
9
- * duplicate emission is deleted; this part adds only its own `data-uiify-popup-trigger`.
10
- * Calls the element as a plain function rather than rendering
11
- * `<ElementPopoverTrigger>`: Tier 0, no hooks (enforced by elements/architecture.test.ts), so
12
- * this is safe, and it skips a `jsx()` call — see ModalParts.tsx's `ModalTrigger` for the same
13
- * pattern and the byte-budget reasoning.
14
- */
3
+ /** Native popover trigger with popup identity and trigger anatomy. */
15
4
  export declare function PopupTrigger<TAs extends ElementType = "button">(props: PopupTriggerProps<TAs>): ReactElement;
16
5
  export declare namespace PopupTrigger {
17
6
  var displayName: string;
18
7
  }
19
- /**
20
- * The popover surface. `data-side`/`data-align` drive the optional anchor CSS in @gunkin/uiify/styles.
21
- *
22
- * Built on `@gunkin/uiify/elements/popover`'s `Popover.Surface`, which already emits
23
- * `data-uiify-popover-surface`; this part adds its own `data-uiify-popup-content` and the
24
- * deprecated `data-uiify-popover-content` (a different string from the element's own marker,
25
- * so additive — unlike Trigger/Close above).
26
- */
8
+ /** Native popover surface with popup identity and content anatomy. */
27
9
  export declare function PopupContent(props: PopupContentProps): ReactElement;
28
10
  export declare namespace PopupContent {
29
11
  var displayName: string;
30
12
  }
31
- /**
32
- * Hides `target`.
33
- *
34
- * Built on `@gunkin/uiify/elements/popover`'s `Popover.Close` (`action="hide"`), which already emits
35
- * `data-uiify-popover-close`; this part adds its own `data-uiify-popup-close`.
36
- */
13
+ /** Native popover close invoker. */
37
14
  export declare function PopupClose<TAs extends ElementType = "button">(props: PopupCloseProps<TAs>): ReactElement;
38
15
  export declare namespace PopupClose {
39
16
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"PopupParts.d.ts","sourceRoot":"","sources":["../../../src/components/popup/PopupParts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAWvD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExF;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC7D,KAAK,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAC5B,YAAY,CAQd;yBAVe,YAAY;;;AAa5B;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAMnE;yBANe,YAAY;;;AAS5B;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC3D,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,GAC1B,YAAY,CAQd;yBAVe,UAAU"}
1
+ {"version":3,"file":"PopupParts.d.ts","sourceRoot":"","sources":["../../../src/components/popup/PopupParts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExF,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC7D,KAAK,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAC5B,YAAY,CAUd;yBAZe,YAAY;;;AAe5B,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAenE;yBAfe,YAAY;;;AAkB5B,oCAAoC;AACpC,wBAAgB,UAAU,CAAC,GAAG,SAAS,WAAW,GAAG,QAAQ,EAC3D,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC,GAC1B,YAAY,CAUd;yBAZe,UAAU"}
@@ -1,33 +1,42 @@
1
- import {
2
- PopoverClose as ElementPopoverClose,
3
- PopoverSurface as ElementPopoverSurface,
4
- PopoverTrigger as ElementPopoverTrigger
5
- } from "../../elements/popover/index.js";
1
+ import { createElement } from "react";
6
2
  function PopupTrigger(props) {
7
3
  const { as, target, ...consumerProps } = props;
8
- return ElementPopoverTrigger({
4
+ return createElement(as ?? "button", {
9
5
  ...consumerProps,
10
- ...as === void 0 ? {} : { as },
11
- "data-uiify-popup-trigger": "",
12
- target
6
+ "data-part": "trigger",
7
+ "data-uiify-popup": "",
8
+ popoverTarget: target,
9
+ popoverTargetAction: "toggle",
10
+ type: "button"
13
11
  });
14
12
  }
15
13
  PopupTrigger.displayName = "PopupTrigger";
16
14
  function PopupContent(props) {
17
- return ElementPopoverSurface({
18
- ...props,
19
- "data-uiify-popover-content": "",
20
- "data-uiify-popup-content": ""
21
- });
15
+ const { align = "center", children, mode = "auto", side = "bottom", ...consumerProps } = props;
16
+ return createElement(
17
+ "div",
18
+ {
19
+ ...consumerProps,
20
+ "data-align": align,
21
+ "data-part": "content",
22
+ "data-positioning": "native",
23
+ "data-side": side,
24
+ "data-uiify-popup": "",
25
+ popover: mode
26
+ },
27
+ children
28
+ );
22
29
  }
23
30
  PopupContent.displayName = "PopupContent";
24
31
  function PopupClose(props) {
25
32
  const { as, target, ...consumerProps } = props;
26
- return ElementPopoverClose({
33
+ return createElement(as ?? "button", {
27
34
  ...consumerProps,
28
- ...as === void 0 ? {} : { as },
29
- "data-uiify-popup-close": "",
30
- target
35
+ "data-part": "close",
36
+ "data-uiify-popup": "",
37
+ popoverTarget: target,
38
+ popoverTargetAction: "hide",
39
+ type: "button"
31
40
  });
32
41
  }
33
42
  PopupClose.displayName = "PopupClose";