@koide-labs/ui 0.0.15 → 0.1.1

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 (310) hide show
  1. package/dist/-utils.d.ts +2 -2
  2. package/dist/-utils.js +1 -1
  3. package/dist/{Button-DrPFFzo7.js → Button-BmcVHRRW.js} +2 -2
  4. package/dist/{CompositeRoot-CVk5a-pR.js → CompositeRoot-CCgh2M64.js} +6 -6
  5. package/dist/{FloatingPortal-tWyuKRSN.js → FloatingPortal-BQsQhvIr.js} +27 -27
  6. package/dist/{FloatingPortalLite-DVyq6YhV.js → FloatingPortalLite-_ECdFE7b.js} +1 -1
  7. package/dist/{InternalBackdrop-jYAiOJ8v.js → InternalBackdrop-BSMKU-hc.js} +13 -13
  8. package/dist/{LabelableContext-BMvjVwor.js → LabelableContext-Be1u-eFg.js} +2 -2
  9. package/dist/accordion.css +1 -0
  10. package/dist/alert-dialog.css +1 -0
  11. package/dist/anchor.css +1 -0
  12. package/dist/avatar.css +1 -0
  13. package/dist/badge.css +1 -0
  14. package/dist/button.css +1 -0
  15. package/dist/checkbox.css +1 -0
  16. package/dist/code.css +1 -0
  17. package/dist/collapse.css +1 -0
  18. package/dist/command.css +1 -0
  19. package/dist/components/accordion/accordion.d.ts +19 -0
  20. package/dist/components/accordion/accordion.js +701 -0
  21. package/dist/components/accordion/index.d.ts +1 -12
  22. package/dist/components/accordion/index.js +2 -697
  23. package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
  24. package/dist/components/alert-dialog/alert-dialog.js +138 -0
  25. package/dist/components/alert-dialog/index.d.ts +1 -26
  26. package/dist/components/alert-dialog/index.js +2 -134
  27. package/dist/components/anchor/anchor.d.ts +12 -0
  28. package/dist/components/anchor/anchor.js +21 -0
  29. package/dist/components/anchor/index.d.ts +1 -8
  30. package/dist/components/anchor/index.js +2 -19
  31. package/dist/components/avatar/avatar.d.ts +25 -0
  32. package/dist/components/avatar/avatar.js +161 -0
  33. package/dist/components/avatar/index.d.ts +1 -21
  34. package/dist/components/avatar/index.js +2 -159
  35. package/dist/components/badge/badge.d.ts +20 -0
  36. package/dist/components/badge/badge.js +42 -0
  37. package/dist/components/badge/index.d.ts +1 -16
  38. package/dist/components/badge/index.js +2 -40
  39. package/dist/components/button/button.d.ts +27 -0
  40. package/dist/components/button/button.js +47 -0
  41. package/dist/components/button/index.d.ts +1 -24
  42. package/dist/components/button/index.js +2 -45
  43. package/dist/components/checkbox/checkbox.d.ts +13 -0
  44. package/dist/components/checkbox/checkbox.js +269 -0
  45. package/dist/components/checkbox/index.d.ts +1 -9
  46. package/dist/components/checkbox/index.js +2 -267
  47. package/dist/components/code/code.d.ts +13 -0
  48. package/dist/components/code/code.js +1206 -0
  49. package/dist/components/code/index.d.ts +1 -9
  50. package/dist/components/code/index.js +2 -1204
  51. package/dist/components/collapse/collapse.d.ts +14 -0
  52. package/dist/components/collapse/collapse.js +35 -0
  53. package/dist/components/collapse/index.d.ts +1 -11
  54. package/dist/components/collapse/index.js +2 -33
  55. package/dist/components/command/command.d.ts +36 -0
  56. package/dist/components/command/command.js +1695 -0
  57. package/dist/components/command/index.d.ts +1 -15
  58. package/dist/components/command/index.js +2 -1693
  59. package/dist/components/context-menu/context-menu.d.ts +82 -0
  60. package/dist/components/context-menu/context-menu.js +1445 -0
  61. package/dist/components/context-menu/index.d.ts +1 -42
  62. package/dist/components/context-menu/index.js +2 -1442
  63. package/dist/components/dialog/dialog.d.ts +22 -0
  64. package/dist/components/dialog/dialog.js +140 -0
  65. package/dist/components/dialog/dialog.types.d.ts +38 -0
  66. package/dist/components/dialog/index.d.ts +1 -48
  67. package/dist/components/dialog/index.js +2 -136
  68. package/dist/components/heading/heading.d.ts +25 -0
  69. package/dist/components/heading/heading.js +36 -0
  70. package/dist/components/heading/index.d.ts +1 -44
  71. package/dist/components/heading/index.js +2 -49
  72. package/dist/components/icon/icon.d.ts +28 -0
  73. package/dist/components/icon/icon.js +43 -0
  74. package/dist/components/icon/{icon-names.d.ts → icon.types.d.ts} +4 -0
  75. package/dist/components/icon/icon.types.js +1 -0
  76. package/dist/components/icon/index.d.ts +2 -24
  77. package/dist/components/icon/index.js +2 -41
  78. package/dist/components/icon-button/icon-button.d.ts +16 -0
  79. package/dist/components/icon-button/icon-button.js +46 -0
  80. package/dist/components/icon-button/index.d.ts +1 -12
  81. package/dist/components/icon-button/index.js +2 -44
  82. package/dist/components/inline-code/index.d.ts +1 -6
  83. package/dist/components/inline-code/index.js +2 -20
  84. package/dist/components/inline-code/inline-code.d.ts +10 -0
  85. package/dist/components/inline-code/inline-code.js +25 -0
  86. package/dist/components/input/index.d.ts +1 -3
  87. package/dist/components/input/index.js +2 -117
  88. package/dist/components/input/input.d.ts +9 -0
  89. package/dist/components/input/input.js +126 -0
  90. package/dist/components/meter/index.d.ts +1 -18
  91. package/dist/components/meter/index.js +2 -163
  92. package/dist/components/meter/meter.d.ts +22 -0
  93. package/dist/components/meter/meter.js +165 -0
  94. package/dist/components/multiline-input/index.d.ts +1 -6
  95. package/dist/components/multiline-input/index.js +2 -98
  96. package/dist/components/multiline-input/multiline-input.d.ts +10 -0
  97. package/dist/components/multiline-input/multiline-input.js +100 -0
  98. package/dist/components/number-input/index.d.ts +1 -10
  99. package/dist/components/number-input/index.js +2 -1167
  100. package/dist/components/number-input/number-input.d.ts +14 -0
  101. package/dist/components/number-input/number-input.js +1169 -0
  102. package/dist/components/password-input/index.d.ts +1 -2
  103. package/dist/components/password-input/index.js +2 -27
  104. package/dist/components/password-input/password-input.d.ts +7 -0
  105. package/dist/components/password-input/password-input.js +29 -0
  106. package/dist/components/pill/index.d.ts +1 -13
  107. package/dist/components/pill/index.js +2 -36
  108. package/dist/components/pill/pill.d.ts +17 -0
  109. package/dist/components/pill/pill.js +38 -0
  110. package/dist/components/popover/index.d.ts +1 -21
  111. package/dist/components/popover/index.js +2 -634
  112. package/dist/components/popover/popover.d.ts +22 -0
  113. package/dist/components/popover/popover.js +634 -0
  114. package/dist/components/preview-card/index.d.ts +1 -17
  115. package/dist/components/preview-card/index.js +2 -400
  116. package/dist/components/preview-card/preview-card.d.ts +21 -0
  117. package/dist/components/preview-card/preview-card.js +402 -0
  118. package/dist/components/radio-group/index.d.ts +1 -0
  119. package/dist/components/radio-group/index.js +5 -0
  120. package/dist/components/radio-group/radio-group.d.ts +25 -0
  121. package/dist/components/{radio/index.js → radio-group/radio-group.js} +91 -90
  122. package/dist/components/search-bar/index.d.ts +1 -12
  123. package/dist/components/search-bar/index.js +2 -46
  124. package/dist/components/search-bar/search-bar.d.ts +16 -0
  125. package/dist/components/search-bar/search-bar.js +43 -0
  126. package/dist/components/select/index.d.ts +1 -16
  127. package/dist/components/select/index.js +2 -1261
  128. package/dist/components/select/select.d.ts +22 -0
  129. package/dist/components/select/select.js +1263 -0
  130. package/dist/components/separator/index.d.ts +1 -7
  131. package/dist/components/separator/index.js +2 -4
  132. package/dist/components/separator/separator.d.ts +10 -0
  133. package/dist/components/separator/separator.js +6 -0
  134. package/dist/components/slider/index.d.ts +1 -5
  135. package/dist/components/slider/index.js +2 -900
  136. package/dist/components/slider/slider.d.ts +10 -0
  137. package/dist/components/slider/slider.js +899 -0
  138. package/dist/components/spinner/index.d.ts +1 -2
  139. package/dist/components/spinner/index.js +2 -11
  140. package/dist/components/spinner/spinner.d.ts +7 -0
  141. package/dist/components/spinner/spinner.js +13 -0
  142. package/dist/components/stacked-avatars/index.d.ts +1 -14
  143. package/dist/components/stacked-avatars/index.js +2 -90
  144. package/dist/components/stacked-avatars/stacked-avatars.d.ts +18 -0
  145. package/dist/components/stacked-avatars/stacked-avatars.js +92 -0
  146. package/dist/components/status-banner/index.d.ts +1 -17
  147. package/dist/components/status-banner/index.js +2 -69
  148. package/dist/components/status-banner/status-banner.d.ts +22 -0
  149. package/dist/components/status-banner/status-banner.js +71 -0
  150. package/dist/components/surface/index.d.ts +2 -27
  151. package/dist/components/surface/index.js +2 -39
  152. package/dist/components/surface/surface.d.ts +26 -0
  153. package/dist/components/surface/surface.js +36 -0
  154. package/dist/components/surface/surface.types.d.ts +1 -0
  155. package/dist/components/surface/surface.types.js +1 -0
  156. package/dist/components/switch/index.d.ts +1 -5
  157. package/dist/components/switch/index.js +2 -194
  158. package/dist/components/switch/switch.d.ts +10 -0
  159. package/dist/components/switch/switch.js +193 -0
  160. package/dist/components/tabs/index.d.ts +1 -18
  161. package/dist/components/tabs/index.js +2 -507
  162. package/dist/components/tabs/tabs.d.ts +28 -0
  163. package/dist/components/tabs/tabs.js +511 -0
  164. package/dist/components/text/index.d.ts +1 -26
  165. package/dist/components/text/index.js +2 -46
  166. package/dist/components/text/text.d.ts +29 -0
  167. package/dist/components/text/text.js +48 -0
  168. package/dist/components/theme-provider/index.d.ts +1 -1
  169. package/dist/components/theme-provider/theme-provider.d.ts +8 -4
  170. package/dist/components/theme-provider/theme-provider.js +3 -3
  171. package/dist/components/timestamp/index.d.ts +1 -23
  172. package/dist/components/timestamp/index.js +2 -1390
  173. package/dist/components/timestamp/timestamp.d.ts +26 -0
  174. package/dist/components/timestamp/timestamp.js +1391 -0
  175. package/dist/components/toaster/index.d.ts +2 -0
  176. package/dist/components/toaster/index.js +7 -0
  177. package/dist/components/toaster/toaster.d.ts +7 -0
  178. package/dist/components/toaster/toaster.js +923 -0
  179. package/dist/components/{toast → toaster}/use-toast-manager.d.ts +3 -3
  180. package/dist/components/tooltip/index.d.ts +1 -14
  181. package/dist/components/tooltip/index.js +2 -710
  182. package/dist/components/tooltip/tooltip.d.ts +24 -0
  183. package/dist/components/tooltip/tooltip.js +9 -0
  184. package/dist/components/view/index.d.ts +2 -30
  185. package/dist/components/view/index.js +2 -79
  186. package/dist/components/view/view.d.ts +31 -0
  187. package/dist/components/view/view.js +83 -0
  188. package/dist/components/view/view.types.d.ts +5 -0
  189. package/dist/components/view/view.types.js +1 -0
  190. package/dist/components/visually-hidden/index.d.ts +5 -1
  191. package/dist/{composite-Bx7Szd_T.js → composite-BZzP-LlG.js} +3 -3
  192. package/dist/{composite-C9L5QmZL.js → composite-BwEK5cWH.js} +1 -1
  193. package/dist/context-menu.css +1 -0
  194. package/dist/{createBaseUIEventDetails-D8M2Yl-a.js → createBaseUIEventDetails-CCSfZ2vM.js} +7 -7
  195. package/dist/{detectBrowser-I-s3yzIE.js → detectBrowser-Bl8Ki_1I.js} +2 -2
  196. package/dist/dialog.css +1 -1
  197. package/dist/{dialog.module-BeF-6XAo.js → dialog.module-DsbQRp-d.js} +55 -55
  198. package/dist/{element-CZEOj04G.js → element-u5WgOZX1.js} +7 -7
  199. package/dist/{event-CKoGyQEJ.js → event-B89-Ng5h.js} +4 -4
  200. package/dist/{floating-ui.utils-C7pRWMZ_.js → floating-ui.utils-DUVaIF3G.js} +7 -7
  201. package/dist/{floating-ui.utils.dom-C7FS5id0.js → floating-ui.utils.dom-cbi420Pg.js} +4 -4
  202. package/dist/{getDisabledMountTransitionStyles-YfHPge6T.js → getDisabledMountTransitionStyles-E2x-_lte.js} +7 -7
  203. package/dist/heading.css +1 -0
  204. package/dist/icon-button.css +1 -0
  205. package/dist/icon.css +1 -0
  206. package/dist/index.d.ts +10 -10
  207. package/dist/index.js +86 -104
  208. package/dist/{inertValue-BCYGsdmf.js → inertValue-BTpPjX30.js} +1 -1
  209. package/dist/inline-code.css +1 -0
  210. package/dist/input.css +1 -1
  211. package/dist/input.module-CtE19OH8.js +8 -0
  212. package/dist/integrations/react-markdown/index.js +12 -12
  213. package/dist/meter.css +1 -0
  214. package/dist/number-input.css +1 -0
  215. package/dist/password-input.css +1 -0
  216. package/dist/pill.css +1 -0
  217. package/dist/popover.css +1 -0
  218. package/dist/preview-card.css +1 -0
  219. package/dist/radio-group.css +1 -0
  220. package/dist/safePolygon-DnkzOIur.js +558 -0
  221. package/dist/search-bar.css +1 -0
  222. package/dist/select.css +1 -0
  223. package/dist/{index-DVjyPAD4.js → separator-fh_wDZNf.js} +7 -11
  224. package/dist/separator.css +1 -0
  225. package/dist/slider.css +1 -0
  226. package/dist/spinner.css +1 -0
  227. package/dist/stacked-avatars.css +1 -0
  228. package/dist/status-banner.css +1 -0
  229. package/dist/styles/core.css +1 -1
  230. package/dist/surface.css +1 -0
  231. package/dist/switch.css +1 -0
  232. package/dist/tabs.css +1 -0
  233. package/dist/text.css +1 -0
  234. package/dist/timestamp.css +1 -0
  235. package/dist/toaster.css +1 -0
  236. package/dist/tooltip-oCp-elli.js +765 -0
  237. package/dist/tooltip.css +1 -0
  238. package/dist/transitions.css +1 -1
  239. package/dist/{transitions.module-CWX8e5cx.js → transitions.module-D9mMAtfI.js} +11 -11
  240. package/dist/{useAnimationFrame-451ugS_6.js → useAnimationFrame-DvK1s63A.js} +1 -1
  241. package/dist/{useButton-DfIwsdb8.js → useButton-d3_JgBNr.js} +3 -3
  242. package/dist/{useCompositeListItem-OkcAim_1.js → useCompositeListItem-CZp9WTnF.js} +2 -2
  243. package/dist/{useLabelableId-Ci_jDvmv.js → useLabelableId-CX4tcfzK.js} +3 -3
  244. package/dist/{useOpenChangeComplete-Dse9kY9E.js → useOpenChangeComplete-BHd-N7Ig.js} +5 -5
  245. package/dist/{useRender-CLx7dR_1.js → useRender-C3vlzS3t.js} +1 -1
  246. package/dist/{useRenderElement-DwToLA61.js → useRenderElement-DngNDu_P.js} +2 -2
  247. package/dist/{useRole-oDBdbuwQ.js → useRole-BD3OL1rr.js} +3 -3
  248. package/dist/{useStableCallback-CkTrVkNX.js → useStableCallback-DKZHlUAT.js} +1 -1
  249. package/dist/{useSyncedFloatingRootContext-Dorsv-jf.js → useSyncedFloatingRootContext-BB1vwkV-.js} +20 -20
  250. package/dist/{useTimeout-CflX-kz3.js → useTimeout-BNni6aw5.js} +1 -1
  251. package/dist/{useTransitionStatus-CUfcuGAV.js → useTransitionStatus-CmMyUh74.js} +1 -1
  252. package/dist/{useTypeahead-D85V2IUx.js → useTypeahead-BiL5IAVb.js} +11 -11
  253. package/dist/{useValueAsRef-HURLzret.js → useValueAsRef-B4EriRsI.js} +1 -1
  254. package/dist/{useValueChanged-DL757-yD.js → useValueChanged-MJRmEWz1.js} +1 -1
  255. package/dist/view.css +1 -1
  256. package/dist/view.module-Dj7wj0kk.js +6 -0
  257. package/dist/view2.css +1 -0
  258. package/package.json +1 -1
  259. package/dist/components/radio/index.d.ts +0 -13
  260. package/dist/components/toast/index.d.ts +0 -2
  261. package/dist/components/toast/index.js +0 -8
  262. package/dist/components/toast/toast.d.ts +0 -2
  263. package/dist/components/toast/toast.js +0 -921
  264. package/dist/components/tooltip/tooltip-arrow.d.ts +0 -3
  265. package/dist/components/tooltip/tooltip-arrow.js +0 -6
  266. package/dist/index10.css +0 -1
  267. package/dist/index11.css +0 -1
  268. package/dist/index12.css +0 -1
  269. package/dist/index13.css +0 -1
  270. package/dist/index14.css +0 -1
  271. package/dist/index15.css +0 -1
  272. package/dist/index16.css +0 -1
  273. package/dist/index17.css +0 -1
  274. package/dist/index18.css +0 -1
  275. package/dist/index19.css +0 -1
  276. package/dist/index20.css +0 -1
  277. package/dist/index21.css +0 -1
  278. package/dist/index22.css +0 -1
  279. package/dist/index23.css +0 -1
  280. package/dist/index24.css +0 -1
  281. package/dist/index25.css +0 -1
  282. package/dist/index26.css +0 -1
  283. package/dist/index27.css +0 -1
  284. package/dist/index28.css +0 -1
  285. package/dist/index29.css +0 -1
  286. package/dist/index3.css +0 -1
  287. package/dist/index30.css +0 -1
  288. package/dist/index31.css +0 -1
  289. package/dist/index32.css +0 -1
  290. package/dist/index33.css +0 -1
  291. package/dist/index34.css +0 -1
  292. package/dist/index35.css +0 -1
  293. package/dist/index36.css +0 -1
  294. package/dist/index37.css +0 -1
  295. package/dist/index4.css +0 -1
  296. package/dist/index5.css +0 -1
  297. package/dist/index6.css +0 -1
  298. package/dist/index7.css +0 -1
  299. package/dist/index8.css +0 -1
  300. package/dist/index9.css +0 -1
  301. package/dist/input.module-DDQY_Ij6.js +0 -7
  302. package/dist/safePolygon-DWy1dGKJ.js +0 -308
  303. package/dist/toast.css +0 -1
  304. package/dist/tooltip-arrow-cs6vjjqZ.js +0 -24
  305. package/dist/tooltip-arrow.css +0 -1
  306. package/dist/useHoverReferenceInteraction-SfOBPoXM.js +0 -264
  307. package/dist/usePopupAutoResize-CNR6Ekmx.js +0 -85
  308. package/dist/view.module-DfDLgJE0.js +0 -6
  309. /package/dist/components/{icon/icon-names.js → dialog/dialog.types.js} +0 -0
  310. /package/dist/components/{toast → toaster}/use-toast-manager.js +0 -0
@@ -0,0 +1,22 @@
1
+ import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
2
+ import { Button } from '../button';
3
+ import { BaseDialogProps } from './dialog.types';
4
+ interface DialogRootProps extends Omit<DialogPrimitive.Root.Props, "children">, BaseDialogProps {
5
+ /**
6
+ * Show close icon
7
+ */
8
+ closable?: boolean;
9
+ }
10
+ declare function DialogRoot({ title, description, trigger, width, background, centered, closable, children, className, ...props }: DialogRootProps): import("react/jsx-runtime").JSX.Element;
11
+ type DialogCloseProps = Button.Props;
12
+ declare function DialogClose(props: DialogCloseProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare const Dialog: typeof DialogRoot & {
14
+ Close: typeof DialogClose;
15
+ };
16
+ export declare namespace Dialog {
17
+ type Props = DialogRootProps;
18
+ namespace DialogClose {
19
+ type Props = DialogCloseProps;
20
+ }
21
+ }
22
+ export {};
@@ -0,0 +1,140 @@
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { c as f } from "../../clsx-OuTLNxxd.js";
3
+ import { t as h } from "../../transitions.module-D9mMAtfI.js";
4
+ import { u as y, D as T, a as b, b as O, c as k, d as v, e as N, s as n, f as S, g as w, h as B, i as P } from "../../dialog.module-DsbQRp-d.js";
5
+ import { Surface as j } from "../surface/surface.js";
6
+ import { View as V } from "../view/view.js";
7
+ import { Text as x } from "../text/text.js";
8
+ import { IconButton as $ } from "../icon-button/icon-button.js";
9
+ import { Button as z } from "../button/button.js";
10
+ import * as M from "react";
11
+ import { a as W } from "../../useRenderElement-DngNDu_P.js";
12
+ function q(t) {
13
+ const {
14
+ children: a,
15
+ open: r,
16
+ defaultOpen: l = !1,
17
+ onOpenChange: d,
18
+ onOpenChangeComplete: u,
19
+ disablePointerDismissal: i = !1,
20
+ modal: s = !0,
21
+ actionsRef: p,
22
+ handle: g,
23
+ triggerId: m,
24
+ defaultTriggerId: C = null
25
+ } = t, D = y(!0), _ = !!D, o = W(() => g?.store ?? new T({
26
+ open: r ?? l,
27
+ activeTriggerId: m !== void 0 ? m : C,
28
+ modal: s,
29
+ disablePointerDismissal: i,
30
+ nested: _
31
+ })).current;
32
+ o.useControlledProp("open", r, l), o.useControlledProp("activeTriggerId", m, C), o.useSyncedValues({
33
+ disablePointerDismissal: i,
34
+ nested: _,
35
+ modal: s
36
+ }), o.useContextCallback("onOpenChange", d), o.useContextCallback("onOpenChangeComplete", u);
37
+ const R = o.useState("payload");
38
+ b({
39
+ store: o,
40
+ actionsRef: p,
41
+ parentContext: D?.store.context
42
+ });
43
+ const I = M.useMemo(() => ({
44
+ store: o
45
+ }), [o]);
46
+ return /* @__PURE__ */ e(O.Provider, {
47
+ value: I,
48
+ children: typeof a == "function" ? a({
49
+ payload: R
50
+ }) : a
51
+ });
52
+ }
53
+ function A({
54
+ title: t,
55
+ description: a,
56
+ trigger: r,
57
+ width: l = "md",
58
+ background: d = "root",
59
+ centered: u,
60
+ closable: i,
61
+ children: s,
62
+ className: p,
63
+ ...g
64
+ }) {
65
+ return /* @__PURE__ */ c(q, { ...g, children: [
66
+ r ? /* @__PURE__ */ e(k, { render: r }) : null,
67
+ /* @__PURE__ */ c(v, { children: [
68
+ /* @__PURE__ */ e(
69
+ N,
70
+ {
71
+ className: f(
72
+ n.dialog__backdrop,
73
+ h.transition_opacity
74
+ )
75
+ }
76
+ ),
77
+ /* @__PURE__ */ e(
78
+ S,
79
+ {
80
+ className: f(
81
+ n.dialog__popup,
82
+ u && n.dialog__popup_centered,
83
+ h.transition_scale
84
+ ),
85
+ children: /* @__PURE__ */ c(
86
+ j,
87
+ {
88
+ background: d,
89
+ className: f(
90
+ n.dialog__content,
91
+ n[`dialog__content_width_${l}`],
92
+ p
93
+ ),
94
+ children: [
95
+ t || a ? /* @__PURE__ */ c(V, { className: n.dialog__header, children: [
96
+ t ? /* @__PURE__ */ e(x, { render: /* @__PURE__ */ e(w, {}), size: "2xl", children: t }) : null,
97
+ a ? /* @__PURE__ */ e(
98
+ x,
99
+ {
100
+ multiline: !0,
101
+ color: "dimmer",
102
+ render: /* @__PURE__ */ e(B, {}),
103
+ children: a
104
+ }
105
+ ) : null
106
+ ] }) : null,
107
+ s,
108
+ i ? /* @__PURE__ */ e(
109
+ P,
110
+ {
111
+ "data-framework-close": !0,
112
+ className: n.dialog__close,
113
+ render: /* @__PURE__ */ e(
114
+ $,
115
+ {
116
+ size: "sm",
117
+ icon: "close-line",
118
+ alt: "Close",
119
+ interactive: "no-fill"
120
+ }
121
+ )
122
+ }
123
+ ) : null
124
+ ]
125
+ }
126
+ )
127
+ }
128
+ )
129
+ ] })
130
+ ] });
131
+ }
132
+ function E(t) {
133
+ return /* @__PURE__ */ e(P, { render: /* @__PURE__ */ e(z, { ...t }) });
134
+ }
135
+ const Z = Object.assign(A, {
136
+ Close: E
137
+ });
138
+ export {
139
+ Z as Dialog
140
+ };
@@ -0,0 +1,38 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { Size } from '../../styles/tokens';
3
+ import { Background } from '../surface';
4
+ export interface BaseDialogProps {
5
+ /**
6
+ * The title of the dialog.
7
+ * Renders DialogPrimitive.Title at "2xl" size.
8
+ */
9
+ title?: string;
10
+ /**
11
+ * The description of the dialog.
12
+ * Renders DialogPrimitive.Description at default size & dimmer color.
13
+ */
14
+ description?: string;
15
+ /** Dialog content */
16
+ children?: ReactNode;
17
+ /**
18
+ * Specify trigger to open alert. You can still used a {@link https://base-ui.com/react/components/dialog#detached-triggers detached trigger}
19
+ */
20
+ trigger?: ReactElement;
21
+ /**
22
+ * Maximum width of the dialog. Defaults to "md".
23
+ */
24
+ width?: Extract<Size, "sm" | "md" | "lg">;
25
+ /**
26
+ * Override popup background. Defaults to "root"
27
+ */
28
+ background?: Background;
29
+ /**
30
+ * Vertically center dialog (or not). You probably shouldn't if you suspect
31
+ * content will overflow.
32
+ */
33
+ centered?: boolean;
34
+ /**
35
+ * Apply className to the dialog content
36
+ */
37
+ className?: string;
38
+ }
@@ -1,48 +1 @@
1
- import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
2
- import { ReactElement, ReactNode } from 'react';
3
- import { Size } from '../../styles/tokens';
4
- import { ButtonProps } from '../button';
5
- import { Background } from '../surface';
6
- export type BaseDialogProps = {
7
- /**
8
- * The title of the dialog.
9
- * Renders DialogPrimitive.Title at "2xl" size.
10
- */
11
- title?: string;
12
- /**
13
- * The description of the dialog.
14
- * Renders DialogPrimitive.Description at default size & dimmer color.
15
- */
16
- description?: string;
17
- /** Dialog content */
18
- children?: ReactNode;
19
- /**
20
- * Specify trigger to open alert. You can still used a {@link https://base-ui.com/react/components/dialog#detached-triggers detached trigger}
21
- */
22
- trigger?: ReactElement;
23
- /**
24
- * Maximum width of the dialog. Defaults to "md".
25
- */
26
- width?: Extract<Size, "sm" | "md" | "lg">;
27
- /**
28
- * Override popup background. Defaults to "root"
29
- */
30
- background?: Background;
31
- /**
32
- * Vertically center dialog (or not). You probably shouldn't if you suspect
33
- * content will overflow.
34
- */
35
- centered?: boolean;
36
- /**
37
- * Apply className to the dialog content
38
- */
39
- className?: string;
40
- };
41
- export type DialogProps = DialogPrimitive.Root.Props & BaseDialogProps & {
42
- /**
43
- * Show close icon
44
- */
45
- closable?: boolean;
46
- };
47
- export declare function Dialog({ title, description, trigger, width, background, centered, closable, children, className, ...props }: DialogProps): import("react/jsx-runtime").JSX.Element;
48
- export declare function DialogClose(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
1
+ export { Dialog } from './dialog';
@@ -1,139 +1,5 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
- import { c as f } from "../../clsx-OuTLNxxd.js";
4
- import { Button as y } from "../button/index.js";
5
- import { IconButton as T } from "../icon-button/index.js";
6
- import { Surface as b } from "../surface/index.js";
7
- import { Text as D } from "../text/index.js";
8
- import { View as k } from "../view/index.js";
9
- import { t as x } from "../../transitions.module-CWX8e5cx.js";
10
- import { u as v, a as N, D as O, b as S, c as w, d as B, e as V, f as j, s as a, g as z, h as $, i as P } from "../../dialog.module-BeF-6XAo.js";
11
- import * as M from "react";
12
- import { a as W } from "../../useRenderElement-DwToLA61.js";
13
- function q(t) {
14
- const {
15
- children: r,
16
- open: n,
17
- defaultOpen: l = !1,
18
- onOpenChange: d,
19
- onOpenChangeComplete: u,
20
- disablePointerDismissal: i = !1,
21
- modal: s = !0,
22
- actionsRef: p,
23
- handle: g,
24
- triggerId: m,
25
- defaultTriggerId: C = null
26
- } = t, _ = v(!0), h = !!_, o = W(() => g?.store ?? new S({
27
- open: n ?? l,
28
- activeTriggerId: m !== void 0 ? m : C,
29
- modal: s,
30
- disablePointerDismissal: i,
31
- nested: h
32
- })).current;
33
- o.useControlledProp("open", n, l), o.useControlledProp("activeTriggerId", m, C), o.useSyncedValues({
34
- disablePointerDismissal: i,
35
- nested: h,
36
- modal: s
37
- }), o.useContextCallback("onOpenChange", d), o.useContextCallback("onOpenChangeComplete", u);
38
- const I = o.useState("payload");
39
- N({
40
- store: o,
41
- actionsRef: p,
42
- parentContext: _?.store.context
43
- });
44
- const R = M.useMemo(() => ({
45
- store: o
46
- }), [o]);
47
- return /* @__PURE__ */ e(O.Provider, {
48
- value: R,
49
- children: typeof r == "function" ? r({
50
- payload: I
51
- }) : r
52
- });
53
- }
54
- function X({
55
- title: t,
56
- description: r,
57
- trigger: n,
58
- width: l = "md",
59
- background: d = "root",
60
- centered: u,
61
- closable: i,
62
- children: s,
63
- className: p,
64
- ...g
65
- }) {
66
- return /* @__PURE__ */ c(q, { ...g, children: [
67
- n ? /* @__PURE__ */ e(w, { render: n }) : null,
68
- /* @__PURE__ */ c(B, { children: [
69
- /* @__PURE__ */ e(
70
- V,
71
- {
72
- className: f(
73
- a.dialog__backdrop,
74
- x.transition_opacity
75
- )
76
- }
77
- ),
78
- /* @__PURE__ */ e(
79
- j,
80
- {
81
- className: f(
82
- a.dialog__popup,
83
- u && a.dialog__popup_centered,
84
- x.transition_scale
85
- ),
86
- children: /* @__PURE__ */ c(
87
- b,
88
- {
89
- background: d,
90
- className: f(
91
- a.dialog__content,
92
- a[`dialog__content_width_${l}`],
93
- p
94
- ),
95
- children: [
96
- t || r ? /* @__PURE__ */ c(k, { className: a.dialog__header, children: [
97
- t ? /* @__PURE__ */ e(D, { render: /* @__PURE__ */ e(z, {}), size: "2xl", children: t }) : null,
98
- r ? /* @__PURE__ */ e(
99
- D,
100
- {
101
- multiline: !0,
102
- color: "dimmer",
103
- render: /* @__PURE__ */ e($, {}),
104
- children: r
105
- }
106
- ) : null
107
- ] }) : null,
108
- s,
109
- i ? /* @__PURE__ */ e(
110
- P,
111
- {
112
- "data-framework-close": !0,
113
- className: a.dialog__close,
114
- render: /* @__PURE__ */ e(
115
- T,
116
- {
117
- size: "sm",
118
- icon: "close-line",
119
- alt: "Close",
120
- interactive: "no-fill"
121
- }
122
- )
123
- }
124
- ) : null
125
- ]
126
- }
127
- )
128
- }
129
- )
130
- ] })
131
- ] });
132
- }
133
- function Y(t) {
134
- return /* @__PURE__ */ e(P, { render: /* @__PURE__ */ e(y, { ...t }) });
135
- }
2
+ import { Dialog as i } from "./dialog.js";
136
3
  export {
137
- X as Dialog,
138
- Y as DialogClose
4
+ i as Dialog
139
5
  };
@@ -0,0 +1,25 @@
1
+ import { useRender } from '@base-ui/react';
2
+ import { Size } from '../../styles/tokens';
3
+ import { Text } from '../text';
4
+ type Level = 1 | 2 | 3 | 4 | 5 | 6;
5
+ interface HeadingProps extends useRender.ComponentProps<"h1"> {
6
+ /**
7
+ * Explicitly set heading level, which determines size.
8
+ * Defaults to level provided by section.
9
+ */
10
+ level?: Level;
11
+ /**
12
+ * Override text size.
13
+ * For example, you may want an h2 but render it as "sm".
14
+ */
15
+ size?: Size;
16
+ /**
17
+ * Override text color.
18
+ */
19
+ color?: Text.Props["color"];
20
+ }
21
+ declare function Heading({ level, size, color, render, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
22
+ export { Heading };
23
+ export declare namespace Heading {
24
+ type Props = HeadingProps;
25
+ }
@@ -0,0 +1,36 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { createContext as i, useContext as x } from "react";
3
+ import { Text as c } from "../text/text.js";
4
+ import { u as d } from "../../useRender-C3vlzS3t.js";
5
+ import { m as p } from "../../useRenderElement-DngNDu_P.js";
6
+ import '../../heading.css';const f = "_heading_m8x05_2", g = {
7
+ heading: f
8
+ }, u = i(0), h = {
9
+ 1: "3xl",
10
+ 2: "2xl",
11
+ 3: "xl",
12
+ 4: "lg",
13
+ 5: "md",
14
+ 6: "md"
15
+ };
16
+ function v(e = 1) {
17
+ return Math.max(Math.min(e, 6), 1);
18
+ }
19
+ function _({ level: e, size: o, color: n, render: r, ...m }) {
20
+ const s = x(u), t = v(e || s), a = d({
21
+ defaultTagName: `h${t}`,
22
+ render: r,
23
+ props: p(m, { className: g.heading })
24
+ });
25
+ return /* @__PURE__ */ l(
26
+ c,
27
+ {
28
+ render: a,
29
+ size: o || h[t],
30
+ color: n
31
+ }
32
+ );
33
+ }
34
+ export {
35
+ _ as Heading
36
+ };
@@ -1,44 +1 @@
1
- import { useRender } from '@base-ui/react';
2
- import { Size } from '../../styles/tokens';
3
- import { TextProps } from '../text';
4
- type Level = 1 | 2 | 3 | 4 | 5 | 6;
5
- export interface HeadingProps extends useRender.ComponentProps<"h1"> {
6
- /**
7
- * Explicitly set heading level, which determines size.
8
- * Defaults to level provided by section.
9
- */
10
- level?: Level;
11
- /**
12
- * Override text size.
13
- * For example, you may want an h2 but render it as "sm".
14
- */
15
- size?: Size;
16
- /**
17
- * Override text color.
18
- */
19
- color?: TextProps["color"];
20
- }
21
- export declare function Heading({ level, size, color, render, ...props }: HeadingProps): import("react/jsx-runtime").JSX.Element;
22
- export interface SectionProps extends useRender.ComponentProps<"section"> {
23
- /**
24
- * Explicitly set section level, but does not override heading level
25
- * Automatically increases by one level from the current section
26
- *
27
- * @example
28
- * <Section level={1}>
29
- * <Heading>1</Heading>
30
- * </Section>
31
- *
32
- * @example
33
- * <Section>
34
- * <Heading>1</Heading>
35
- * <Section>
36
- * <Heading>2</Heading>
37
- * <Heading level={6}>6</Heading>
38
- * </Section>
39
- * </Section>
40
- */
41
- level?: Level;
42
- }
43
- export declare function Section({ level, render, ...props }: SectionProps): import("react/jsx-runtime").JSX.Element;
44
- export {};
1
+ export { Heading } from './heading';
@@ -1,52 +1,5 @@
1
1
  "use client";
2
- import { jsx as m } from "react/jsx-runtime";
3
- import { createContext as f, useContext as i } from "react";
4
- import { Text as x } from "../text/index.js";
5
- import { u as c } from "../../useRender-CLx7dR_1.js";
6
- import { m as g } from "../../useRenderElement-DwToLA61.js";
7
- import '../../index11.css';const p = "_heading_qlffn_1", v = {
8
- heading: p
9
- }, h = {
10
- 1: "3xl",
11
- 2: "2xl",
12
- 3: "xl",
13
- 4: "lg",
14
- 5: "md",
15
- 6: "md"
16
- }, s = f(0);
17
- function _({
18
- level: e,
19
- size: t,
20
- color: n,
21
- render: o,
22
- ...r
23
- }) {
24
- const l = i(s), a = d(e || l), u = c({
25
- defaultTagName: `h${a}`,
26
- render: o,
27
- props: g(r, { className: v.heading })
28
- });
29
- return /* @__PURE__ */ m(
30
- x,
31
- {
32
- render: u,
33
- size: t || h[a],
34
- color: n
35
- }
36
- );
37
- }
38
- function M({ level: e, render: t, ...n }) {
39
- const o = i(s) ?? 0, r = d(e || o + 1), l = c({
40
- defaultTagName: "section",
41
- render: t,
42
- props: n
43
- });
44
- return /* @__PURE__ */ m(s.Provider, { value: r, children: l });
45
- }
46
- function d(e = 1) {
47
- return Math.max(Math.min(e, 6), 1);
48
- }
2
+ import { Heading as n } from "./heading.js";
49
3
  export {
50
- _ as Heading,
51
- M as Section
4
+ n as Heading
52
5
  };
@@ -0,0 +1,28 @@
1
+ import { ComponentProps } from 'react';
2
+ import { ColorToken, Size } from '../../styles/tokens';
3
+ import { IconName } from './icon.types';
4
+ interface IconProps extends Omit<ComponentProps<"svg">, "name"> {
5
+ /**
6
+ * Overrides the icon size provider.
7
+ * Defaults to "md".
8
+ */
9
+ size?: Size;
10
+ /** Icon name */
11
+ name: IconName;
12
+ /**
13
+ * Icon fill color
14
+ * You probably should provide a color token, but we allow any color
15
+ */
16
+ color?: ColorToken | (string & {});
17
+ /**
18
+ * Use like `img alt` attribute.
19
+ * Leave empty if icon is purely decorative.
20
+ */
21
+ alt?: string;
22
+ }
23
+ declare function Icon({ size, name, color, alt, className, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
24
+ export { Icon };
25
+ export declare namespace Icon {
26
+ type Props = IconProps;
27
+ type Name = IconName;
28
+ }
@@ -0,0 +1,43 @@
1
+ import { jsxs as t, jsx as o } from "react/jsx-runtime";
2
+ import { c as z } from "../../clsx-OuTLNxxd.js";
3
+ import "react";
4
+ import x from "remixicon/fonts/remixicon.symbol.svg";
5
+ import '../../icon.css';const m = "_icon_ol0rk_2", d = "_icon_size_sm_ol0rk_14", f = "_icon_size_md_ol0rk_19", p = "_icon_size_lg_ol0rk_23", k = "_icon_size_xl_ol0rk_27", g = "_icon_size_2xl_ol0rk_31", a = "_icon_size_3xl_ol0rk_35", s = {
6
+ icon: m,
7
+ icon_size_sm: d,
8
+ icon_size_md: f,
9
+ icon_size_lg: p,
10
+ icon_size_xl: k,
11
+ icon_size_2xl: g,
12
+ icon_size_3xl: a
13
+ };
14
+ function $({
15
+ size: n = "md",
16
+ name: c,
17
+ color: e,
18
+ alt: i,
19
+ className: l,
20
+ ...r
21
+ }) {
22
+ const _ = `${x}#ri-${c}`;
23
+ return /* @__PURE__ */ t(
24
+ "svg",
25
+ {
26
+ preserveAspectRatio: "xMidYMin",
27
+ viewBox: "0 0 24 24",
28
+ "aria-hidden": !i,
29
+ focusable: !1,
30
+ xmlns: "http://www.w3.org/2000/svg",
31
+ fill: e || "currentColor",
32
+ className: z(s.icon, s[`icon_size_${n}`], l),
33
+ ...r,
34
+ children: [
35
+ i ? /* @__PURE__ */ o("title", { children: i }) : null,
36
+ /* @__PURE__ */ o("use", { xlinkHref: _, href: _ })
37
+ ]
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ $ as Icon
43
+ };