@bysages/react 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/{ai-B3vbpXlK.mjs → ai-B0o-dsAf.mjs} +1 -1
  2. package/dist/{ai-prompt-input-k34KssHJ.mjs → ai-prompt-input-Cl9ulICF.mjs} +1 -1
  3. package/dist/components/ai/index.mjs +1 -1
  4. package/dist/components/ai-prompt-input/index.d.mts +1 -1
  5. package/dist/components/ai-prompt-input/index.mjs +1 -1
  6. package/dist/components/autocomplete/index.d.mts +4 -1
  7. package/dist/components/autocomplete/index.mjs +9 -6
  8. package/dist/components/cascade-select/index.d.mts +4 -1
  9. package/dist/components/cascade-select/index.mjs +36 -33
  10. package/dist/components/color-picker/index.d.mts +9 -1
  11. package/dist/components/color-picker/index.mjs +36 -29
  12. package/dist/components/combobox/index.d.mts +9 -1
  13. package/dist/components/combobox/index.mjs +14 -8
  14. package/dist/components/command/index.d.mts +4 -1
  15. package/dist/components/command/index.mjs +71 -68
  16. package/dist/components/date-picker/index.d.mts +9 -1
  17. package/dist/components/date-picker/index.mjs +27 -21
  18. package/dist/components/dialog/index.d.mts +20 -3
  19. package/dist/components/dialog/index.mjs +28 -12
  20. package/dist/components/drawer/index.d.mts +19 -3
  21. package/dist/components/drawer/index.mjs +18 -12
  22. package/dist/components/floating-panel/index.d.mts +19 -3
  23. package/dist/components/floating-panel/index.mjs +34 -28
  24. package/dist/components/hover-card/index.d.mts +17 -3
  25. package/dist/components/hover-card/index.mjs +14 -8
  26. package/dist/components/image-viewer/index.d.mts +1 -1
  27. package/dist/components/image-viewer/index.mjs +1 -1
  28. package/dist/components/media-player/index.mjs +1 -1
  29. package/dist/components/mentions/index.d.mts +1 -1
  30. package/dist/components/mentions/index.mjs +1 -1
  31. package/dist/components/menu/index.d.mts +10 -2
  32. package/dist/components/menu/index.mjs +12 -6
  33. package/dist/components/menubar/index.d.mts +4 -1
  34. package/dist/components/menubar/index.mjs +12 -9
  35. package/dist/components/navigation-menu/index.d.mts +9 -1
  36. package/dist/components/navigation-menu/index.mjs +7 -1
  37. package/dist/components/pagination/index.d.mts +2 -2
  38. package/dist/components/popconfirm/index.d.mts +5 -2
  39. package/dist/components/popconfirm/index.mjs +31 -28
  40. package/dist/components/popover/index.d.mts +1 -1
  41. package/dist/components/popover/index.mjs +20 -14
  42. package/dist/components/select/index.d.mts +1 -1
  43. package/dist/components/select/index.mjs +1 -1
  44. package/dist/components/split-button/index.d.mts +4 -1
  45. package/dist/components/split-button/index.mjs +12 -9
  46. package/dist/components/table/index.d.mts +21 -1
  47. package/dist/components/table/index.mjs +24 -9
  48. package/dist/components/tooltip/index.d.mts +17 -3
  49. package/dist/components/tooltip/index.mjs +8 -2
  50. package/dist/components/tour/index.d.mts +20 -3
  51. package/dist/components/tour/index.mjs +16 -10
  52. package/dist/components/tree-select/index.d.mts +5 -2
  53. package/dist/components/tree-select/index.mjs +38 -35
  54. package/dist/components/typography/index.d.mts +10 -6
  55. package/dist/components/typography/index.mjs +9 -1
  56. package/dist/floating-BhcDRgnx.d.mts +7 -0
  57. package/dist/floating-CMR7cvmA.mjs +33 -0
  58. package/dist/generative/index.mjs +1 -1
  59. package/dist/{image-viewer-BYiXpi1X.mjs → image-viewer-BPTApdoP.mjs} +32 -29
  60. package/dist/{index-DcpvCyt6.d.mts → index-CEYybyEQ.d.mts} +8 -3
  61. package/dist/{index-DczfbPCg.d.mts → index-DZ2S5rMj.d.mts} +10 -2
  62. package/dist/index-j02dTkfc.d.mts +37 -0
  63. package/dist/{index-D4C52fI7.d.mts → index-n9VlNO7D.d.mts} +4 -1
  64. package/dist/index.d.mts +8 -8
  65. package/dist/index.mjs +6 -6
  66. package/dist/{media-player-CO2Cczl-.mjs → media-player-DxG0EYz7.mjs} +1 -1
  67. package/dist/{mentions-De7ChJbl.mjs → mentions-B59tQDPt.mjs} +31 -25
  68. package/dist/{select-DQ5669_K.mjs → select-BLFqfeVw.mjs} +20 -14
  69. package/package.json +2 -2
  70. package/dist/index-BVdkcSSY.d.mts +0 -22
@@ -1,13 +1,13 @@
1
1
  import { t as useElementId } from "./id-Ctic_3o8.mjs";
2
2
  import { t as withSelfRoot } from "./family-Co1YsN4N.mjs";
3
3
  import { Field } from "./components/field/index.mjs";
4
+ import { t as FloatingPortal } from "./floating-CMR7cvmA.mjs";
4
5
  import { Icon } from "./components/icon/index.mjs";
5
6
  import { Popover as Popover$1 } from "./components/popover/index.mjs";
6
7
  import { injectComponentStyle } from "@bysages/core/styling";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
8
9
  import { Fragment as Fragment$1, useRef, useState } from "react";
9
10
  import { Popover } from "@ark-ui/react/popover";
10
- import { Portal } from "@ark-ui/react/portal";
11
11
  // src/components/mentions/use-mentions.ts
12
12
  /** The detection machinery behind a mention field: watch the caret,
13
13
  * offer the matching candidates, and answer for the keys that drive
@@ -234,7 +234,7 @@ function MentionsPopup({ size, matches, active, onInsert, onActiveChange, ...res
234
234
  * its own anatomy (the textarea rides where the host puts it) and the
235
235
  * vessel still points at the right place. Shares the detection state
236
236
  * with the host through `useMentions`. */
237
- function MentionsVesselImpl({ size = "md", open = false, matches = [], active = 0, anchor = null, placement = "bottom-start", onInsert, onActiveChange, onOpenChange, id }) {
237
+ function MentionsVesselImpl({ portal = false, size = "md", open = false, matches = [], active = 0, anchor = null, placement = "bottom-start", onInsert, onActiveChange, onOpenChange, id }) {
238
238
  injectComponentStyle("mentions");
239
239
  const hostId = useElementId("mentions", { id });
240
240
  return /* @__PURE__ */ jsx(Popover.Root, {
@@ -246,21 +246,24 @@ function MentionsVesselImpl({ size = "md", open = false, matches = [], active =
246
246
  placement,
247
247
  getAnchorRect: () => anchor?.getBoundingClientRect() ?? null
248
248
  },
249
- children: /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, { children: /* @__PURE__ */ jsx(Popover.Content, {
250
- asChild: true,
251
- children: /* @__PURE__ */ jsx(MentionsPopup, {
252
- size,
253
- matches,
254
- active,
255
- onInsert,
256
- onActiveChange,
257
- id: `${hostId}:popup`
258
- })
259
- }) }) })
249
+ children: /* @__PURE__ */ jsx(FloatingPortal, {
250
+ portal,
251
+ children: /* @__PURE__ */ jsx(Popover.Positioner, { children: /* @__PURE__ */ jsx(Popover.Content, {
252
+ asChild: true,
253
+ children: /* @__PURE__ */ jsx(MentionsPopup, {
254
+ size,
255
+ matches,
256
+ active,
257
+ onInsert,
258
+ onActiveChange,
259
+ id: `${hostId}:popup`
260
+ })
261
+ }) })
262
+ })
260
263
  });
261
264
  }
262
265
  const MentionsVessel = withSelfRoot(MentionsVesselImpl);
263
- function MentionsImpl({ items = [], value, trigger = "@", triggers, insertOnSelect = true, commitKeys, placement = "bottom-start", placeholder, autoresize = false, invalid = false, size = "md", onValueChange, onSelect, children, ...rest }) {
266
+ function MentionsImpl({ portal = false, items = [], value, trigger = "@", triggers, insertOnSelect = true, commitKeys, placement = "bottom-start", placeholder, autoresize = false, invalid = false, size = "md", onValueChange, onSelect, children, ...rest }) {
264
267
  const hostId = useElementId("mentions", rest);
265
268
  const [internal, setInternal] = useState("");
266
269
  const fieldRef = useRef(null);
@@ -317,17 +320,20 @@ function MentionsImpl({ items = [], value, trigger = "@", triggers, insertOnSele
317
320
  "data-scope": "mentions",
318
321
  "data-part": "textarea"
319
322
  })
320
- }), /* @__PURE__ */ jsx(Popover.Positioner, { children: /* @__PURE__ */ jsx(Popover.Content, {
321
- asChild: true,
322
- children: /* @__PURE__ */ jsx(MentionsPopup, {
323
- size,
324
- matches: mentions.matches,
325
- active: mentions.active,
326
- onInsert: mentions.insert,
327
- onActiveChange: mentions.setActive,
328
- id: `${hostId}:vessel:popup`
329
- })
330
- }) })]
323
+ }), /* @__PURE__ */ jsx(FloatingPortal, {
324
+ portal,
325
+ children: /* @__PURE__ */ jsx(Popover.Positioner, { children: /* @__PURE__ */ jsx(Popover.Content, {
326
+ asChild: true,
327
+ children: /* @__PURE__ */ jsx(MentionsPopup, {
328
+ size,
329
+ matches: mentions.matches,
330
+ active: mentions.active,
331
+ onInsert: mentions.insert,
332
+ onActiveChange: mentions.setActive,
333
+ id: `${hostId}:vessel:popup`
334
+ })
335
+ }) })
336
+ })]
331
337
  }), children]
332
338
  });
333
339
  }
@@ -1,5 +1,6 @@
1
1
  import { r as iconNode } from "./icon-C9udWCyz.mjs";
2
2
  import { t as useElementId } from "./id-Ctic_3o8.mjs";
3
+ import { n as definePositioner, t as FloatingPortal } from "./floating-CMR7cvmA.mjs";
3
4
  import { injectComponentStyle } from "@bysages/core/styling";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { useMemo } from "react";
@@ -58,7 +59,8 @@ function SelectRoot(props) {
58
59
  function toArkValue(value) {
59
60
  return value === void 0 || value === "" ? [] : Array.isArray(value) ? value : [value];
60
61
  }
61
- function SelectFacade({ value, defaultValue, options, multiple = false, deselectable = false, clearable = true, disabled = false, invalid = false, required = false, readOnly = false, label, groupLabel, placeholder, name, form, autoComplete, size = "md", onValueChange }) {
62
+ const SelectPositioner = definePositioner(Select.Positioner);
63
+ function SelectFacade({ portal = false, value, defaultValue, options, multiple = false, deselectable = false, clearable = true, disabled = false, invalid = false, required = false, readOnly = false, label, groupLabel, placeholder, name, form, autoComplete, size = "md", onValueChange }) {
62
64
  const collection = useMemo(() => createListCollection({ items: options }), [options]);
63
65
  return /* @__PURE__ */ jsxs(SelectRoot, {
64
66
  size,
@@ -93,19 +95,22 @@ function SelectFacade({ value, defaultValue, options, multiple = false, deselect
93
95
  height: 14
94
96
  }) })
95
97
  ] }),
96
- /* @__PURE__ */ jsx(Select.Positioner, { children: /* @__PURE__ */ jsx(Select.Content, { children: groupLabel ? /* @__PURE__ */ jsxs(Select.ItemGroup, { children: [/* @__PURE__ */ jsx(Select.ItemGroupLabel, { children: groupLabel }), collection.items.map((item) => /* @__PURE__ */ jsxs(Select.Item, {
97
- item,
98
- children: [/* @__PURE__ */ jsx(Select.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Select.ItemIndicator, { children: iconNode("check", {
99
- width: 14,
100
- height: 14
101
- }) })]
102
- }, item.value))] }) : /* @__PURE__ */ jsx(Select.List, { children: collection.items.map((item) => /* @__PURE__ */ jsxs(Select.Item, {
103
- item,
104
- children: [/* @__PURE__ */ jsx(Select.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Select.ItemIndicator, { children: iconNode("check", {
105
- width: 14,
106
- height: 14
107
- }) })]
108
- }, item.value)) }) }) }),
98
+ /* @__PURE__ */ jsx(FloatingPortal, {
99
+ portal,
100
+ children: /* @__PURE__ */ jsx(Select.Positioner, { children: /* @__PURE__ */ jsx(Select.Content, { children: groupLabel ? /* @__PURE__ */ jsxs(Select.ItemGroup, { children: [/* @__PURE__ */ jsx(Select.ItemGroupLabel, { children: groupLabel }), collection.items.map((item) => /* @__PURE__ */ jsxs(Select.Item, {
101
+ item,
102
+ children: [/* @__PURE__ */ jsx(Select.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Select.ItemIndicator, { children: iconNode("check", {
103
+ width: 14,
104
+ height: 14
105
+ }) })]
106
+ }, item.value))] }) : /* @__PURE__ */ jsx(Select.List, { children: collection.items.map((item) => /* @__PURE__ */ jsxs(Select.Item, {
107
+ item,
108
+ children: [/* @__PURE__ */ jsx(Select.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Select.ItemIndicator, { children: iconNode("check", {
109
+ width: 14,
110
+ height: 14
111
+ }) })]
112
+ }, item.value)) }) }) })
113
+ }),
109
114
  /* @__PURE__ */ jsx(Select.HiddenSelect, {})
110
115
  ]
111
116
  });
@@ -113,6 +118,7 @@ function SelectFacade({ value, defaultValue, options, multiple = false, deselect
113
118
  SelectFacade.displayName = "SSelect";
114
119
  const Select$1 = Object.assign(SelectFacade, {
115
120
  ...Select,
121
+ Positioner: SelectPositioner,
116
122
  Root: SelectRoot
117
123
  });
118
124
  injectComponentStyle("select");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bysages/react",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "By Sages Elements components for React — styled by the paper-and-ink design tokens",
5
5
  "keywords": [
6
6
  "accessible",
@@ -52,7 +52,7 @@
52
52
  "@tanstack/react-virtual": "3.14.25",
53
53
  "@zag-js/cascade-select": "1.47.0",
54
54
  "@zag-js/react": "1.47.0",
55
- "@bysages/core": "0.5.0"
55
+ "@bysages/core": "0.6.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@json-render/core": "0.21.4",
@@ -1,22 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { Popover } from "@ark-ui/react/popover";
3
- type PopoverPlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
4
- interface PopoverFacadeProps {
5
- open?: boolean;
6
- defaultOpen?: boolean;
7
- trigger?: ReactNode;
8
- content?: string;
9
- label: string;
10
- description?: string;
11
- disabled?: boolean;
12
- placement?: PopoverPlacement;
13
- children?: ReactNode;
14
- onOpenChange?: (open: boolean) => void;
15
- }
16
- declare function PopoverFacade({ open, defaultOpen, trigger, content, label, description, disabled, placement, children, onOpenChange }: PopoverFacadeProps): import("react").JSX.Element;
17
- declare namespace PopoverFacade {
18
- var displayName: string;
19
- }
20
- type PopoverParts = typeof Popover;
21
- declare const Popover$1: typeof PopoverFacade & PopoverParts;
22
- export { PopoverFacadeProps as n, Popover$1 as t };