haze-ui 1.18.2 → 1.19.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 (102) hide show
  1. package/dist/components/Accordion/index.js +3 -0
  2. package/dist/components/Affix/index.js +2 -0
  3. package/dist/components/Alert/index.js +2 -0
  4. package/dist/components/ApprovalCard/index.js +2 -0
  5. package/dist/components/AspectRatio/index.js +2 -0
  6. package/dist/components/Avatar/index.js +2 -0
  7. package/dist/components/BackToTop/index.js +2 -0
  8. package/dist/components/Badge/index.js +2 -0
  9. package/dist/components/Banner/index.js +2 -0
  10. package/dist/components/BottomSheet/index.js +2 -0
  11. package/dist/components/Breadcrumb/index.js +3 -0
  12. package/dist/components/Button/index.js +3 -0
  13. package/dist/components/Card/index.js +2 -0
  14. package/dist/components/Carousel/index.js +3 -0
  15. package/dist/components/ChatContainer/index.js +2 -0
  16. package/dist/components/ChatInput/index.js +2 -0
  17. package/dist/components/ChatMessage/index.js +2 -0
  18. package/dist/components/Checkbox/index.js +3 -0
  19. package/dist/components/Chip/index.js +2 -0
  20. package/dist/components/CodeBlock/index.js +2 -0
  21. package/dist/components/Collapsible/index.js +2 -0
  22. package/dist/components/ColorPicker/index.js +3 -0
  23. package/dist/components/Combobox/index.js +3 -0
  24. package/dist/components/Command/index.js +2 -0
  25. package/dist/components/ConfirmDialog/index.js +2 -0
  26. package/dist/components/Container/index.js +2 -0
  27. package/dist/components/ContextMenu/index.js +6 -0
  28. package/dist/components/ConversationList/index.js +3 -0
  29. package/dist/components/DateRangePicker/index.js +3 -0
  30. package/dist/components/Datepicker/index.js +3 -0
  31. package/dist/components/Dialog/index.js +2 -0
  32. package/dist/components/DiffViewer/index.js +2 -0
  33. package/dist/components/Disclosure/index.js +2 -0
  34. package/dist/components/Divider/index.js +2 -0
  35. package/dist/components/Drawer/index.js +2 -0
  36. package/dist/components/DropdownMenu/index.js +6 -0
  37. package/dist/components/Empty/index.js +2 -0
  38. package/dist/components/FileInput/index.js +2 -0
  39. package/dist/components/Flex/index.js +2 -0
  40. package/dist/components/Grid/index.js +3 -0
  41. package/dist/components/Icon/index.js +2 -0
  42. package/dist/components/Image/index.js +2 -0
  43. package/dist/components/InlineEdit/index.js +2 -0
  44. package/dist/components/Input/index.js +3 -0
  45. package/dist/components/List/index.js +3 -0
  46. package/dist/components/LogViewer/index.js +2 -0
  47. package/dist/components/MarkdownRenderer/index.js +2 -0
  48. package/dist/components/Menu/index.js +4 -0
  49. package/dist/components/ModelPicker/index.js +2 -0
  50. package/dist/components/NavigationBar/index.js +3 -0
  51. package/dist/components/NumberInput/index.js +3 -0
  52. package/dist/components/OTPInput/index.js +3 -0
  53. package/dist/components/Pagination/index.js +2 -0
  54. package/dist/components/PasswordInput/index.js +3 -0
  55. package/dist/components/Popover/Popover.js +5 -0
  56. package/dist/components/Popover/index.js +2 -0
  57. package/dist/components/Progress/index.js +2 -0
  58. package/dist/components/Radio/index.js +4 -0
  59. package/dist/components/Rating/index.js +3 -0
  60. package/dist/components/Resizable/index.js +2 -0
  61. package/dist/components/ScrollArea/index.js +2 -0
  62. package/dist/components/Segmented/index.js +3 -0
  63. package/dist/components/Select/index.js +4 -0
  64. package/dist/components/Skeleton/index.js +2 -0
  65. package/dist/components/Slider/index.js +3 -0
  66. package/dist/components/Spinner/index.js +2 -0
  67. package/dist/components/Stat/index.js +2 -0
  68. package/dist/components/StepTimeline/index.js +2 -0
  69. package/dist/components/Stepper/index.js +3 -0
  70. package/dist/components/StreamingText/index.js +2 -0
  71. package/dist/components/SwipeAction/index.js +2 -0
  72. package/dist/components/Switch/index.js +3 -0
  73. package/dist/components/Table/index.js +6 -0
  74. package/dist/components/Tabs/index.js +5 -0
  75. package/dist/components/Tag/index.js +2 -0
  76. package/dist/components/TagGroup/index.js +3 -0
  77. package/dist/components/TagInput/index.js +3 -0
  78. package/dist/components/Textarea/index.js +3 -0
  79. package/dist/components/ThinkingIndicator/index.js +2 -0
  80. package/dist/components/TimePicker/index.js +3 -0
  81. package/dist/components/Timeline/index.js +2 -0
  82. package/dist/components/Toast/Toast.js +42 -15
  83. package/dist/components/Toast/ToastContainer.js +35 -26
  84. package/dist/components/Toast/index.js +4 -0
  85. package/dist/components/TokenCounter/index.js +2 -0
  86. package/dist/components/ToolCallCard/index.js +2 -0
  87. package/dist/components/Tooltip/index.js +2 -0
  88. package/dist/components/Transfer/index.js +3 -0
  89. package/dist/components/Tree/index.js +2 -0
  90. package/dist/components/Typography/index.js +2 -0
  91. package/dist/components/Upload/index.js +3 -0
  92. package/dist/components/VirtualList/index.js +2 -0
  93. package/dist/css/toast.css +2 -2
  94. package/dist/form/FormItem.js +1 -1
  95. package/dist/form/index.js +2 -0
  96. package/dist/haze-ui.css +2 -2
  97. package/dist/tokens/index.js +4 -0
  98. package/dist/types/components/Toast/ToastContainer.d.ts +13 -2
  99. package/dist/types/form/FormItem.d.ts +3 -2
  100. package/dist/types/utils/floating.d.ts +13 -0
  101. package/dist/utils/floating.js +44 -22
  102. package/package.json +17 -1
@@ -0,0 +1,3 @@
1
+ import e from "./Accordion.js";
2
+ import t from "./AccordionItem.js";
3
+ export { e as Accordion, t as AccordionItem };
@@ -0,0 +1,2 @@
1
+ import e from "./Affix.js";
2
+ export { e as Affix };
@@ -0,0 +1,2 @@
1
+ import e from "./Alert.js";
2
+ export { e as Alert };
@@ -0,0 +1,2 @@
1
+ import e from "./ApprovalCard.js";
2
+ export { e as ApprovalCard };
@@ -0,0 +1,2 @@
1
+ import e from "./AspectRatio.js";
2
+ export { e as AspectRatio };
@@ -0,0 +1,2 @@
1
+ import e from "./Avatar.js";
2
+ export { e as Avatar };
@@ -0,0 +1,2 @@
1
+ import e from "./BackToTop.js";
2
+ export { e as BackToTop };
@@ -0,0 +1,2 @@
1
+ import e from "./Badge.js";
2
+ export { e as Badge };
@@ -0,0 +1,2 @@
1
+ import e from "./Banner.js";
2
+ export { e as Banner };
@@ -0,0 +1,2 @@
1
+ import e from "./BottomSheet.js";
2
+ export { e as BottomSheet };
@@ -0,0 +1,3 @@
1
+ import e from "./Breadcrumb.js";
2
+ import t from "./BreadcrumbItem.js";
3
+ export { e as Breadcrumb, t as BreadcrumbItem };
@@ -0,0 +1,3 @@
1
+ import e from "./Button.js";
2
+ import t from "./ButtonLink.js";
3
+ export { e as Button, t as ButtonLink };
@@ -0,0 +1,2 @@
1
+ import e from "./Card.js";
2
+ export { e as Card };
@@ -0,0 +1,3 @@
1
+ import e from "./Carousel.js";
2
+ import t from "./CarouselSlide.js";
3
+ export { e as Carousel, t as CarouselSlide };
@@ -0,0 +1,2 @@
1
+ import e from "./ChatContainer.js";
2
+ export { e as ChatContainer };
@@ -0,0 +1,2 @@
1
+ import e from "./ChatInput.js";
2
+ export { e as ChatInput };
@@ -0,0 +1,2 @@
1
+ import e from "./ChatMessage.js";
2
+ export { e as ChatMessage };
@@ -0,0 +1,3 @@
1
+ import e from "./CheckboxCore.js";
2
+ import t from "./Checkbox.js";
3
+ export { t as Checkbox, e as CheckboxCore };
@@ -0,0 +1,2 @@
1
+ import e from "./Chip.js";
2
+ export { e as Chip };
@@ -0,0 +1,2 @@
1
+ import e from "./CodeBlock.js";
2
+ export { e as CodeBlock };
@@ -0,0 +1,2 @@
1
+ import { Collapsible as e, CollapsibleContent as t, CollapsibleTrigger as n } from "./Collapsible.js";
2
+ export { e as Collapsible, t as CollapsibleContent, n as CollapsibleTrigger };
@@ -0,0 +1,3 @@
1
+ import e from "./ColorPickerCore.js";
2
+ import t from "./ColorPicker.js";
3
+ export { t as ColorPicker, e as ColorPickerCore };
@@ -0,0 +1,3 @@
1
+ import e from "./ComboboxOption.js";
2
+ import t from "./Combobox.js";
3
+ export { t as Combobox, e as ComboboxOption };
@@ -0,0 +1,2 @@
1
+ import e, { CommandInput as t, CommandItem as n, CommandList as r } from "./Command.js";
2
+ export { e as Command, t as CommandInput, n as CommandItem, r as CommandList };
@@ -0,0 +1,2 @@
1
+ import e from "./ConfirmDialog.js";
2
+ export { e as ConfirmDialog };
@@ -0,0 +1,2 @@
1
+ import e from "./Container.js";
2
+ export { e as Container };
@@ -0,0 +1,6 @@
1
+ import e from "./ContextMenu.js";
2
+ import t from "./ContextMenuTrigger.js";
3
+ import n from "./ContextMenuContent.js";
4
+ import r from "./ContextMenuItem.js";
5
+ import i from "./ContextMenuSeparator.js";
6
+ export { e as ContextMenu, n as ContextMenuContent, r as ContextMenuItem, i as ContextMenuSeparator, t as ContextMenuTrigger };
@@ -0,0 +1,3 @@
1
+ import e from "./ConversationList.js";
2
+ import t from "./ConversationItem.js";
3
+ export { t as ConversationItem, e as ConversationList };
@@ -0,0 +1,3 @@
1
+ import e from "./DateRangePickerCore.js";
2
+ import t from "./DateRangePicker.js";
3
+ export { t as DateRangePicker, e as DateRangePickerCore };
@@ -0,0 +1,3 @@
1
+ import e from "./DatepickerCore.js";
2
+ import t from "./Datepicker.js";
3
+ export { t as Datepicker, e as DatepickerCore };
@@ -0,0 +1,2 @@
1
+ import e from "./Dialog.js";
2
+ export { e as Dialog };
@@ -0,0 +1,2 @@
1
+ import e from "./DiffViewer.js";
2
+ export { e as DiffViewer };
@@ -0,0 +1,2 @@
1
+ import e from "./Disclosure.js";
2
+ export { e as Disclosure };
@@ -0,0 +1,2 @@
1
+ import e from "./Divider.js";
2
+ export { e as Divider };
@@ -0,0 +1,2 @@
1
+ import e from "./Drawer.js";
2
+ export { e as Drawer };
@@ -0,0 +1,6 @@
1
+ import e from "./DropdownMenu.js";
2
+ import t from "./DropdownMenuTrigger.js";
3
+ import n from "./DropdownMenuContent.js";
4
+ import r from "./DropdownMenuItem.js";
5
+ import i from "./DropdownMenuSeparator.js";
6
+ export { e as DropdownMenu, n as DropdownMenuContent, r as DropdownMenuItem, i as DropdownMenuSeparator, t as DropdownMenuTrigger };
@@ -0,0 +1,2 @@
1
+ import e from "./Empty.js";
2
+ export { e as Empty };
@@ -0,0 +1,2 @@
1
+ import e from "./FileInput.js";
2
+ export { e as FileInput };
@@ -0,0 +1,2 @@
1
+ import e from "./Flex.js";
2
+ export { e as Flex };
@@ -0,0 +1,3 @@
1
+ import e from "./Grid.js";
2
+ import t from "./GridItem.js";
3
+ export { e as Grid, t as GridItem };
@@ -0,0 +1,2 @@
1
+ import e from "./Icon.js";
2
+ export { e as Icon };
@@ -0,0 +1,2 @@
1
+ import e from "./Image.js";
2
+ export { e as Image };
@@ -0,0 +1,2 @@
1
+ import e from "./InlineEdit.js";
2
+ export { e as InlineEdit };
@@ -0,0 +1,3 @@
1
+ import e from "./InputCore.js";
2
+ import t from "./Input.js";
3
+ export { t as Input, e as InputCore };
@@ -0,0 +1,3 @@
1
+ import e from "./List.js";
2
+ import t from "./ListItem.js";
3
+ export { e as List, t as ListItem };
@@ -0,0 +1,2 @@
1
+ import e from "./LogViewer.js";
2
+ export { e as LogViewer };
@@ -0,0 +1,2 @@
1
+ import e from "./MarkdownRenderer.js";
2
+ export { e as MarkdownRenderer };
@@ -0,0 +1,4 @@
1
+ import e from "./Menu.js";
2
+ import t from "./MenuItem.js";
3
+ import n from "./MenuDivider.js";
4
+ export { e as Menu, n as MenuDivider, t as MenuItem };
@@ -0,0 +1,2 @@
1
+ import e from "./ModelPicker.js";
2
+ export { e as ModelPicker };
@@ -0,0 +1,3 @@
1
+ import e from "./NavigationBar.js";
2
+ import t from "./NavLink.js";
3
+ export { t as NavLink, e as NavigationBar };
@@ -0,0 +1,3 @@
1
+ import e from "./NumberInputCore.js";
2
+ import t from "./NumberInput.js";
3
+ export { t as NumberInput, e as NumberInputCore };
@@ -0,0 +1,3 @@
1
+ import e from "./OTPInputCore.js";
2
+ import t from "./OTPInput.js";
3
+ export { t as OTPInput, e as OTPInputCore };
@@ -0,0 +1,2 @@
1
+ import e from "./Pagination.js";
2
+ export { e as Pagination };
@@ -0,0 +1,3 @@
1
+ import e from "./PasswordInputCore.js";
2
+ import t from "./PasswordInput.js";
3
+ export { t as PasswordInput, e as PasswordInputCore };
@@ -19,10 +19,15 @@ function l({ content: l, open: u, className: d, children: f }) {
19
19
  ref: g,
20
20
  style: v.triggerStyle,
21
21
  role: "button",
22
+ tabIndex: 0,
23
+ "aria-haspopup": "true",
22
24
  "aria-expanded": p,
23
25
  "aria-controls": h,
24
26
  onPointerDown: v.onTriggerPointerDown,
25
27
  onClick: v.onTriggerClick,
28
+ onKeyDown: (e) => {
29
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), v.onTriggerClick());
30
+ },
26
31
  children: f
27
32
  }), /* @__PURE__ */ n(e, {
28
33
  ref: _,
@@ -0,0 +1,2 @@
1
+ import e from "./Popover.js";
2
+ export { e as Popover };
@@ -0,0 +1,2 @@
1
+ import e from "./Progress.js";
2
+ export { e as Progress };
@@ -0,0 +1,4 @@
1
+ import e from "./Radio.js";
2
+ import t from "./RadioGroupCore.js";
3
+ import n from "./RadioGroup.js";
4
+ export { e as Radio, n as RadioGroup, t as RadioGroupCore };
@@ -0,0 +1,3 @@
1
+ import e from "./RatingCore.js";
2
+ import t from "./Rating.js";
3
+ export { t as Rating, e as RatingCore };
@@ -0,0 +1,2 @@
1
+ import { ResizableGroup as e, ResizableHandle as t, ResizablePanel as n } from "./Resizable.js";
2
+ export { e as ResizableGroup, t as ResizableHandle, n as ResizablePanel };
@@ -0,0 +1,2 @@
1
+ import e from "./ScrollArea.js";
2
+ export { e as ScrollArea };
@@ -0,0 +1,3 @@
1
+ import e from "./SegmentedCore.js";
2
+ import t from "./Segmented.js";
3
+ export { t as Segmented, e as SegmentedCore };
@@ -0,0 +1,4 @@
1
+ import e from "./SelectCore.js";
2
+ import t from "./Select.js";
3
+ import n from "./Option.js";
4
+ export { n as Option, t as Select, e as SelectCore };
@@ -0,0 +1,2 @@
1
+ import e from "./Skeleton.js";
2
+ export { e as Skeleton };
@@ -0,0 +1,3 @@
1
+ import e from "./SliderCore.js";
2
+ import t from "./Slider.js";
3
+ export { t as Slider, e as SliderCore };
@@ -0,0 +1,2 @@
1
+ import e from "./Spinner.js";
2
+ export { e as Spinner };
@@ -0,0 +1,2 @@
1
+ import { Stat as e, StatGroup as t } from "./Stat.js";
2
+ export { e as Stat, t as StatGroup };
@@ -0,0 +1,2 @@
1
+ import e, { StepTimelineItem as t } from "./StepTimeline.js";
2
+ export { e as StepTimeline, t as StepTimelineItem };
@@ -0,0 +1,3 @@
1
+ import e from "./Stepper.js";
2
+ import t from "./Step.js";
3
+ export { t as Step, e as Stepper };
@@ -0,0 +1,2 @@
1
+ import e from "./StreamingText.js";
2
+ export { e as StreamingText };
@@ -0,0 +1,2 @@
1
+ import e from "./SwipeAction.js";
2
+ export { e as SwipeAction };
@@ -0,0 +1,3 @@
1
+ import e from "./SwitchCore.js";
2
+ import t from "./Switch.js";
3
+ export { t as Switch, e as SwitchCore };
@@ -0,0 +1,6 @@
1
+ import e from "./Table.js";
2
+ import t from "./TableHead.js";
3
+ import n from "./TableBody.js";
4
+ import r from "./TableRow.js";
5
+ import i from "./TableCell.js";
6
+ export { e as Table, n as TableBody, i as TableCell, t as TableHead, r as TableRow };
@@ -0,0 +1,5 @@
1
+ import e from "./Tabs.js";
2
+ import t from "./TabList.js";
3
+ import n from "./Tab.js";
4
+ import r from "./TabPanel.js";
5
+ export { n as Tab, t as TabList, r as TabPanel, e as Tabs };
@@ -0,0 +1,2 @@
1
+ import e from "./Tag.js";
2
+ export { e as Tag };
@@ -0,0 +1,3 @@
1
+ import e from "./TagGroup.js";
2
+ import t from "./TagGroupItem.js";
3
+ export { e as TagGroup, t as TagGroupItem };
@@ -0,0 +1,3 @@
1
+ import e from "./TagInputCore.js";
2
+ import t from "./TagInput.js";
3
+ export { t as TagInput, e as TagInputCore };
@@ -0,0 +1,3 @@
1
+ import e from "./TextareaCore.js";
2
+ import t from "./Textarea.js";
3
+ export { t as Textarea, e as TextareaCore };
@@ -0,0 +1,2 @@
1
+ import e from "./ThinkingIndicator.js";
2
+ export { e as ThinkingIndicator };
@@ -0,0 +1,3 @@
1
+ import e from "./TimePickerCore.js";
2
+ import t from "./TimePicker.js";
3
+ export { t as TimePicker, e as TimePickerCore };
@@ -0,0 +1,2 @@
1
+ import { Timeline as e, TimelineItem as t } from "./Timeline.js";
2
+ export { e as Timeline, t as TimelineItem };
@@ -2,33 +2,60 @@
2
2
  import { classnames as e } from "../../utils/classnames.js";
3
3
  /* empty css */
4
4
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { useEffect as r } from "react";
5
+ import { useCallback as r, useEffect as i, useRef as a } from "react";
6
6
  //#region src/lib/components/Toast/Toast.tsx
7
- var i = "haze-Toast__base", a = {
7
+ var o = "haze-Toast__base", s = {
8
8
  info: "haze-Toast__info",
9
9
  success: "haze-Toast__success",
10
10
  warning: "haze-Toast__warning",
11
11
  danger: "haze-Toast__danger"
12
- }, o = "haze-Toast__contentStyle", s = "haze-Toast__closeBtn";
13
- function c({ variant: c = "info", onClose: l, duration: u, children: d }) {
14
- return r(() => {
15
- if (u <= 0) return;
16
- let e = setTimeout(l, u);
17
- return () => clearTimeout(e);
18
- }, [u, l]), /* @__PURE__ */ n("div", {
12
+ }, c = "haze-Toast__contentStyle", l = "haze-Toast__closeBtn";
13
+ function u({ variant: u = "info", onClose: d, duration: f, children: p }) {
14
+ let m = a(f), h = a(0), g = a(null), _ = a(!1), v = a(!1), y = a(d);
15
+ i(() => {
16
+ y.current = d;
17
+ }, [d]);
18
+ let b = r(() => {
19
+ g.current !== null && (clearTimeout(g.current), g.current = null, m.current = Math.max(0, m.current - (Date.now() - h.current)));
20
+ }, []), x = r(() => {
21
+ g.current !== null || m.current <= 0 || (h.current = Date.now(), g.current = setTimeout(() => {
22
+ g.current = null, y.current();
23
+ }, m.current));
24
+ }, []), S = r(() => {
25
+ _.current || v.current ? b() : x();
26
+ }, [b, x]);
27
+ return i(() => {
28
+ if (!(f <= 0)) return m.current = f, !_.current && !v.current && x(), b;
29
+ }, [
30
+ f,
31
+ x,
32
+ b
33
+ ]), /* @__PURE__ */ n("div", {
19
34
  role: "alert",
20
- className: e([i, a[c]]),
35
+ onPointerEnter: () => {
36
+ _.current = !0, S();
37
+ },
38
+ onPointerLeave: () => {
39
+ _.current = !1, S();
40
+ },
41
+ onFocus: () => {
42
+ v.current = !0, S();
43
+ },
44
+ onBlur: () => {
45
+ v.current = !1, S();
46
+ },
47
+ className: e([o, s[u]]),
21
48
  children: [/* @__PURE__ */ t("div", {
22
- className: o,
23
- children: d
49
+ className: c,
50
+ children: p
24
51
  }), /* @__PURE__ */ t("button", {
25
52
  type: "button",
26
- className: s,
53
+ className: l,
27
54
  "aria-label": "Close",
28
- onClick: l,
55
+ onClick: d,
29
56
  children: "×"
30
57
  })]
31
58
  });
32
59
  }
33
60
  //#endregion
34
- export { c as default };
61
+ export { u as default };
@@ -1,36 +1,45 @@
1
1
 
2
- import e from "./Toast.js";
3
- import { ToastProvider as t } from "./ToastContext.js";
2
+ import { classnames as e } from "../../utils/classnames.js";
3
+ import t from "./Toast.js";
4
+ import { ToastProvider as n } from "./ToastContext.js";
4
5
  /* empty css */
5
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
- import { useCallback as i, useRef as a, useState as o } from "react";
6
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
7
+ import { useCallback as a, useRef as o, useState as s } from "react";
7
8
  //#region src/lib/components/Toast/ToastContainer.tsx
8
- var s = "haze-ToastContainer__container";
9
- function c({ children: c }) {
10
- let [l, u] = o([]), d = a(0), f = i((e) => {
11
- d.current += 1, u((t) => [...t, {
12
- ...e,
13
- id: d.current
14
- }]);
15
- }, []), p = i((e) => {
16
- u((t) => t.filter((t) => t.id !== e));
9
+ var c = "haze-ToastContainer__containerBase", l = {
10
+ "top-left": "haze-ToastContainer__top-left",
11
+ "top-right": "haze-ToastContainer__top-right",
12
+ "bottom-left": "haze-ToastContainer__bottom-left",
13
+ "bottom-right": "haze-ToastContainer__bottom-right"
14
+ };
15
+ function u({ children: u, maxCount: d, placement: f = "bottom-right" }) {
16
+ let [p, m] = s([]), h = o(0), g = a((e) => {
17
+ h.current += 1, m((t) => {
18
+ let n = [...t, {
19
+ ...e,
20
+ id: h.current
21
+ }];
22
+ return d === void 0 || n.length <= d ? n : n.slice(n.length - d);
23
+ });
24
+ }, [d]), _ = a((e) => {
25
+ m((t) => t.filter((t) => t.id !== e));
17
26
  }, []);
18
- return /* @__PURE__ */ r(t, {
27
+ return /* @__PURE__ */ i(n, {
19
28
  value: {
20
- toasts: l,
21
- addToast: f,
22
- removeToast: p
29
+ toasts: p,
30
+ addToast: g,
31
+ removeToast: _
23
32
  },
24
- children: [c, /* @__PURE__ */ n("div", {
25
- className: s,
26
- children: l.map((t) => /* @__PURE__ */ n(e, {
27
- variant: t.variant,
28
- duration: t.duration,
29
- onClose: () => p(t.id),
30
- children: t.content
31
- }, t.id))
33
+ children: [u, /* @__PURE__ */ r("div", {
34
+ className: e([c, l[f]]),
35
+ children: p.map((e) => /* @__PURE__ */ r(t, {
36
+ variant: e.variant,
37
+ duration: e.duration,
38
+ onClose: () => _(e.id),
39
+ children: e.content
40
+ }, e.id))
32
41
  })]
33
42
  });
34
43
  }
35
44
  //#endregion
36
- export { c as default };
45
+ export { u as default, l as toastPlacements };
@@ -0,0 +1,4 @@
1
+ import e from "./Toast.js";
2
+ import t from "./ToastContainer.js";
3
+ import n from "./useToast.js";
4
+ export { e as Toast, t as ToastContainer, n as useToast };
@@ -0,0 +1,2 @@
1
+ import e from "./TokenCounter.js";
2
+ export { e as TokenCounter };
@@ -0,0 +1,2 @@
1
+ import e from "./ToolCallCard.js";
2
+ export { e as ToolCallCard };
@@ -0,0 +1,2 @@
1
+ import e from "./Tooltip.js";
2
+ export { e as Tooltip };
@@ -0,0 +1,3 @@
1
+ import e from "./TransferCore.js";
2
+ import t from "./Transfer.js";
3
+ export { t as Transfer, e as TransferCore };
@@ -0,0 +1,2 @@
1
+ import e from "./Tree.js";
2
+ export { e as Tree };
@@ -0,0 +1,2 @@
1
+ import { Paragraph as e, Text as t, Title as n } from "./Typography.js";
2
+ export { e as Paragraph, t as Text, n as Title };
@@ -0,0 +1,3 @@
1
+ import e from "./UploadCore.js";
2
+ import t from "./Upload.js";
3
+ export { t as Upload, e as UploadCore };
@@ -0,0 +1,2 @@
1
+ import e from "./VirtualList.js";
2
+ export { e as VirtualList };
@@ -1,3 +1,3 @@
1
1
  /* haze-ui toast — generated by scripts/split-css.mjs, do not edit */
2
- .haze-Toast__base{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:var(--haze-space-3);padding:var(--haze-space-3) var(--haze-space-4);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal);box-shadow:var(--haze-shadow-lg);pointer-events:auto;animation:.2s ease-out toastIn-haze-Toast__base;display:flex}@keyframes toastIn-haze-Toast__base{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.haze-Toast__info{background:var(--haze-color-bg);color:var(--haze-color-text);border:1px solid var(--haze-color-border)}.haze-Toast__success{background:color-mix(in srgb, var(--haze-color-success) 10%, var(--haze-color-bg));color:var(--haze-color-success);border:1px solid color-mix(in srgb, var(--haze-color-success) 25%, transparent)}.haze-Toast__warning{background:color-mix(in srgb, var(--haze-color-warning) 10%, var(--haze-color-bg));color:var(--haze-color-warning);border:1px solid color-mix(in srgb, var(--haze-color-warning) 25%, transparent)}.haze-Toast__danger{background:color-mix(in srgb, var(--haze-color-danger) 10%, var(--haze-color-bg));color:var(--haze-color-danger);border:1px solid color-mix(in srgb, var(--haze-color-danger) 25%, transparent)}.haze-Toast__contentStyle{flex:1}.haze-Toast__closeBtn{appearance:none;color:inherit;cursor:pointer;font-size:var(--haze-text-lg);opacity:.6;background:0 0;border:none;padding:0;line-height:1;transition:opacity .15s}.haze-Toast__closeBtn:hover{opacity:1}
3
- .haze-ToastContainer__container{bottom:calc(var(--haze-space-4) + env(safe-area-inset-bottom));right:calc(var(--haze-space-4) + env(safe-area-inset-right));z-index:9999;gap:var(--haze-space-2);pointer-events:none;flex-direction:column;display:flex;position:fixed}
2
+ .haze-Toast__base{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:var(--haze-space-3);padding:var(--haze-space-3) var(--haze-space-4);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal);box-shadow:var(--haze-shadow-lg);pointer-events:auto;animation:.2s ease-out toastIn-haze-Toast__base;display:flex}@keyframes toastIn-haze-Toast__base{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.haze-Toast__info{background:var(--haze-color-bg);color:var(--haze-color-text);border:1px solid var(--haze-color-border)}.haze-Toast__success{background:color-mix(in srgb, var(--haze-color-success) 10%, var(--haze-color-bg));color:var(--haze-color-text);border:1px solid color-mix(in srgb, var(--haze-color-success) 25%, transparent)}.haze-Toast__warning{background:color-mix(in srgb, var(--haze-color-warning) 10%, var(--haze-color-bg));color:var(--haze-color-text);border:1px solid color-mix(in srgb, var(--haze-color-warning) 25%, transparent)}.haze-Toast__danger{background:color-mix(in srgb, var(--haze-color-danger) 10%, var(--haze-color-bg));color:var(--haze-color-text);border:1px solid color-mix(in srgb, var(--haze-color-danger) 25%, transparent)}.haze-Toast__contentStyle{flex:1}.haze-Toast__closeBtn{appearance:none;color:inherit;cursor:pointer;font-size:var(--haze-text-lg);opacity:.6;background:0 0;border:none;justify-content:center;align-items:center;min-width:24px;min-height:24px;padding:0;line-height:1;transition:opacity .15s;display:inline-flex}.haze-Toast__closeBtn:hover{opacity:1}
3
+ .haze-ToastContainer__containerBase{z-index:9999;gap:var(--haze-space-2);pointer-events:none;flex-direction:column;display:flex;position:fixed}.haze-ToastContainer__top-left{top:calc(var(--haze-space-4) + env(safe-area-inset-top));left:calc(var(--haze-space-4) + env(safe-area-inset-left))}.haze-ToastContainer__top-right{top:calc(var(--haze-space-4) + env(safe-area-inset-top));right:calc(var(--haze-space-4) + env(safe-area-inset-right))}.haze-ToastContainer__bottom-left{bottom:calc(var(--haze-space-4) + env(safe-area-inset-bottom));left:calc(var(--haze-space-4) + env(safe-area-inset-left))}.haze-ToastContainer__bottom-right{bottom:calc(var(--haze-space-4) + env(safe-area-inset-bottom));right:calc(var(--haze-space-4) + env(safe-area-inset-right))}
@@ -36,12 +36,12 @@ function c({ form: c, name: l, label: u, validate: d, mode: f, validateDebounce:
36
36
  ...S ? S(D) : { value: D },
37
37
  children: C
38
38
  }) : v ? /* @__PURE__ */ t(v, {
39
+ ...y,
39
40
  id: T,
40
41
  "aria-invalid": j || void 0,
41
42
  "aria-describedby": j ? E : void 0,
42
43
  onBlur: k,
43
44
  onChange: (e) => O(N(e)),
44
- ...y,
45
45
  ...S ? S(D) : { value: D }
46
46
  }) : C({
47
47
  id: T,
@@ -0,0 +1,2 @@
1
+ import e from "./FormItem.js";
2
+ export { e as FormItem };
package/dist/haze-ui.css CHANGED
@@ -115,8 +115,8 @@
115
115
  .haze-ThinkingIndicator__wrapper{align-items:center;gap:var(--haze-space-2);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);color:var(--haze-color-text-muted);padding:var(--haze-space-2) 0;display:inline-flex}.haze-ThinkingIndicator__dots{gap:var(--haze-space-1);display:inline-flex}@keyframes bounce-haze-ThinkingIndicator__dots{0%,80%,to{transform:translateY(0)}40%{transform:translateY(-.375rem)}}.haze-ThinkingIndicator__dot{border-radius:var(--haze-radius-full);background:var(--haze-color-text-muted);width:.375rem;height:.375rem;animation:1.4s ease-in-out infinite bounce}.haze-ThinkingIndicator__dot2{animation-delay:.16s}.haze-ThinkingIndicator__dot3{animation-delay:.32s}
116
116
  .haze-TimePickerCore__input{width:100%;padding:var(--haze-space-2) var(--haze-space-3);border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);background:var(--haze-color-bg);color:var(--haze-color-text);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);outline:none;transition:border-color .15s,box-shadow .15s}.haze-TimePickerCore__input:focus{border-color:var(--haze-color-primary);box-shadow:0 0 0 3px var(--haze-color-focus-ring)}.haze-TimePickerCore__input:disabled{opacity:.5;cursor:not-allowed}.haze-TimePickerCore__input::-webkit-input-placeholder{color:var(--haze-color-text-muted)}.haze-TimePickerCore__input::placeholder{color:var(--haze-color-text-muted)}.haze-TimePickerCore__input:-ms-placeholder-shown{color:var(--haze-color-text-muted)}.haze-TimePickerCore__input::placeholder{color:var(--haze-color-text-muted)}
117
117
  .haze-Timeline__base{font-family:var(--haze-font-sans);flex-direction:column;display:flex}.haze-Timeline__item{gap:var(--haze-space-3);padding-bottom:var(--haze-space-6);display:flex;position:relative}.haze-Timeline__item:last-child{padding-bottom:0}.haze-Timeline__dotWrapper{flex-direction:column;flex-shrink:0;align-items:center;display:flex}.haze-Timeline__dot{border-radius:var(--haze-radius-full);background:var(--haze-color-border);z-index:1;flex-shrink:0;width:12px;height:12px}.haze-Timeline__primary{background:var(--haze-color-primary)}.haze-Timeline__success{background:var(--haze-color-success)}.haze-Timeline__warning{background:var(--haze-color-warning)}.haze-Timeline__danger{background:var(--haze-color-danger)}.haze-Timeline__line{background:var(--haze-color-border);width:2px;margin-top:var(--haze-space-1);flex:1}.haze-Timeline__content{flex:1;min-width:0}.haze-Timeline__titleStyle{font-size:var(--haze-text-sm);font-weight:var(--haze-weight-medium);color:var(--haze-color-text)}.haze-Timeline__descStyle,.haze-Timeline__timeStyle{font-size:var(--haze-text-xs);color:var(--haze-color-text-muted);margin-top:var(--haze-space-1)}
118
- .haze-Toast__base{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:var(--haze-space-3);padding:var(--haze-space-3) var(--haze-space-4);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal);box-shadow:var(--haze-shadow-lg);pointer-events:auto;animation:.2s ease-out toastIn-haze-Toast__base;display:flex}@keyframes toastIn-haze-Toast__base{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.haze-Toast__info{background:var(--haze-color-bg);color:var(--haze-color-text);border:1px solid var(--haze-color-border)}.haze-Toast__success{background:color-mix(in srgb, var(--haze-color-success) 10%, var(--haze-color-bg));color:var(--haze-color-success);border:1px solid color-mix(in srgb, var(--haze-color-success) 25%, transparent)}.haze-Toast__warning{background:color-mix(in srgb, var(--haze-color-warning) 10%, var(--haze-color-bg));color:var(--haze-color-warning);border:1px solid color-mix(in srgb, var(--haze-color-warning) 25%, transparent)}.haze-Toast__danger{background:color-mix(in srgb, var(--haze-color-danger) 10%, var(--haze-color-bg));color:var(--haze-color-danger);border:1px solid color-mix(in srgb, var(--haze-color-danger) 25%, transparent)}.haze-Toast__contentStyle{flex:1}.haze-Toast__closeBtn{appearance:none;color:inherit;cursor:pointer;font-size:var(--haze-text-lg);opacity:.6;background:0 0;border:none;padding:0;line-height:1;transition:opacity .15s}.haze-Toast__closeBtn:hover{opacity:1}
119
- .haze-ToastContainer__container{bottom:calc(var(--haze-space-4) + env(safe-area-inset-bottom));right:calc(var(--haze-space-4) + env(safe-area-inset-right));z-index:9999;gap:var(--haze-space-2);pointer-events:none;flex-direction:column;display:flex;position:fixed}
118
+ .haze-Toast__base{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:var(--haze-space-3);padding:var(--haze-space-3) var(--haze-space-4);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);line-height:var(--haze-leading-normal);box-shadow:var(--haze-shadow-lg);pointer-events:auto;animation:.2s ease-out toastIn-haze-Toast__base;display:flex}@keyframes toastIn-haze-Toast__base{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.haze-Toast__info{background:var(--haze-color-bg);color:var(--haze-color-text);border:1px solid var(--haze-color-border)}.haze-Toast__success{background:color-mix(in srgb, var(--haze-color-success) 10%, var(--haze-color-bg));color:var(--haze-color-text);border:1px solid color-mix(in srgb, var(--haze-color-success) 25%, transparent)}.haze-Toast__warning{background:color-mix(in srgb, var(--haze-color-warning) 10%, var(--haze-color-bg));color:var(--haze-color-text);border:1px solid color-mix(in srgb, var(--haze-color-warning) 25%, transparent)}.haze-Toast__danger{background:color-mix(in srgb, var(--haze-color-danger) 10%, var(--haze-color-bg));color:var(--haze-color-text);border:1px solid color-mix(in srgb, var(--haze-color-danger) 25%, transparent)}.haze-Toast__contentStyle{flex:1}.haze-Toast__closeBtn{appearance:none;color:inherit;cursor:pointer;font-size:var(--haze-text-lg);opacity:.6;background:0 0;border:none;justify-content:center;align-items:center;min-width:24px;min-height:24px;padding:0;line-height:1;transition:opacity .15s;display:inline-flex}.haze-Toast__closeBtn:hover{opacity:1}
119
+ .haze-ToastContainer__containerBase{z-index:9999;gap:var(--haze-space-2);pointer-events:none;flex-direction:column;display:flex;position:fixed}.haze-ToastContainer__top-left{top:calc(var(--haze-space-4) + env(safe-area-inset-top));left:calc(var(--haze-space-4) + env(safe-area-inset-left))}.haze-ToastContainer__top-right{top:calc(var(--haze-space-4) + env(safe-area-inset-top));right:calc(var(--haze-space-4) + env(safe-area-inset-right))}.haze-ToastContainer__bottom-left{bottom:calc(var(--haze-space-4) + env(safe-area-inset-bottom));left:calc(var(--haze-space-4) + env(safe-area-inset-left))}.haze-ToastContainer__bottom-right{bottom:calc(var(--haze-space-4) + env(safe-area-inset-bottom));right:calc(var(--haze-space-4) + env(safe-area-inset-right))}
120
120
  .haze-TokenCounter__wrapper{font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);color:var(--haze-color-text-muted)}.haze-TokenCounter__bar{background:var(--haze-color-muted);border-radius:var(--haze-radius-full);height:.25rem;margin-top:var(--haze-space-1);overflow:hidden}.haze-TokenCounter__fill{border-radius:var(--haze-radius-full);height:100%;transition:width .3s}.haze-TokenCounter__fillNormal{background:var(--haze-color-primary)}.haze-TokenCounter__fillWarning{background:var(--haze-color-warning,#eab308)}.haze-TokenCounter__fillDanger{background:var(--haze-color-danger,#dc2626)}.haze-TokenCounter__info{-webkit-box-pack:justify;-ms-flex-pack:space-between;justify-content:space-between;align-items:baseline;display:flex}.haze-TokenCounter__count{font-variant-numeric:tabular-nums}
121
121
  .haze-ToolCallCard__card{border:1px solid var(--haze-color-border);border-radius:var(--haze-radius-md);font-family:var(--haze-font-sans);font-size:var(--haze-text-sm);overflow:hidden}.haze-ToolCallCard__header{align-items:center;gap:var(--haze-space-2);padding:var(--haze-space-2) var(--haze-space-3);background:var(--haze-color-muted);font-family:var(--haze-font-mono);font-size:var(--haze-text-xs);display:flex}.haze-ToolCallCard__statusIcon{border-radius:var(--haze-radius-full);flex-shrink:0;width:.5rem;height:.5rem}.haze-ToolCallCard__statusPending{background:var(--haze-color-text-muted)}.haze-ToolCallCard__statusRunning{background:var(--haze-color-primary);animation:1.5s infinite pulse}.haze-ToolCallCard__statusDone{background:var(--haze-color-success,#16a34a)}.haze-ToolCallCard__statusError{background:var(--haze-color-danger,#dc2626)}.haze-ToolCallCard__body{padding:var(--haze-space-3)}.haze-ToolCallCard__section{margin-bottom:var(--haze-space-2)}.haze-ToolCallCard__sectionLabel{font-size:var(--haze-text-xs);color:var(--haze-color-text-muted);margin-bottom:var(--haze-space-1);text-transform:uppercase;letter-spacing:.05em}.haze-ToolCallCard__content{font-family:var(--haze-font-mono);font-size:var(--haze-text-xs);white-space:pre-wrap;word-break:break-all;color:var(--haze-color-text)}
122
122
  .haze-Tooltip__wrapper{display:inline-flex;position:relative}.haze-Tooltip__bubble{padding:var(--haze-space-1) var(--haze-space-2);border-radius:var(--haze-radius-md);background:var(--haze-color-text);color:var(--haze-color-text-inverse);font-family:var(--haze-font-sans);font-size:var(--haze-text-xs);line-height:var(--haze-leading-normal);white-space:nowrap;pointer-events:none}
@@ -0,0 +1,4 @@
1
+ import { darkTheme as e, lightTheme as t } from "./colors.js";
2
+ import { spacing as n } from "./spacing.js";
3
+ import { typography as r } from "./typography.js";
4
+ export { e as darkTheme, t as lightTheme, n as spacing, r as typography };
@@ -1,6 +1,17 @@
1
1
  import type { ReactNode } from 'react';
2
+ type ToastPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
2
3
  type ToastContainerProps = {
3
4
  children: ReactNode;
5
+ /** Max simultaneous toasts; the oldest one is dropped on overflow. */
6
+ maxCount?: number;
7
+ /** Viewport edge the stack is pinned to. */
8
+ placement?: ToastPlacement;
4
9
  };
5
- export default function ToastContainer({ children }: ToastContainerProps): import("react").JSX.Element;
6
- export type { ToastContainerProps };
10
+ export declare const toastPlacements: {
11
+ readonly 'top-left': import("@linaria/core").LinariaClassName;
12
+ readonly 'top-right': import("@linaria/core").LinariaClassName;
13
+ readonly 'bottom-left': import("@linaria/core").LinariaClassName;
14
+ readonly 'bottom-right': import("@linaria/core").LinariaClassName;
15
+ };
16
+ export default function ToastContainer({ children, maxCount, placement, }: ToastContainerProps): import("react").JSX.Element;
17
+ export type { ToastContainerProps, ToastPlacement };
@@ -49,8 +49,9 @@ export type FormItemAsProps = {
49
49
  * precedence over the children render-prop. */
50
50
  as?: ComponentType<any>;
51
51
  /** Extra props spread onto the `as` component. They land before the
52
- * value props, so `value`/`valueToProps` win conflicts — the same
53
- * precedence react-f0rm's `Field` uses. */
52
+ * bridge wiring and the value props, so `id`, `aria-*`, `onBlur`,
53
+ * `onChange` and `value`/`valueToProps` win conflicts — the same
54
+ * precedence as the input channel and react-f0rm's `Field`. */
54
55
  asProps?: Record<string, any>;
55
56
  /** Converts what the control passes to its `onChange` into the field
56
57
  * value. Defaults to identity — haze cores' `onChange` emits the next
@@ -65,6 +65,19 @@ export type FloatingBehavior = {
65
65
  export declare function useFloating({ open, setOpen, triggerRef, panelRef, }: UseFloatingOptions): FloatingBehavior;
66
66
  /** x-class entries placing the panel relative to the trigger, per tier. */
67
67
  export declare function floatingPlacementClasses(behavior: Pick<FloatingBehavior, 'native' | 'anchored'>, placement: FloatingPlacement): (string | false)[];
68
+ /**
69
+ * Place a fixed panel from the trigger's rect (tier 2). Centers compute
70
+ * from the panel's own rect, so this needs layout — fine in real engines,
71
+ * and unreachable in jsdom where the fallback tier renders instead.
72
+ *
73
+ * Viewport awareness: a placement that would push the panel past the
74
+ * viewport edge flips to the opposite side when that side has room for
75
+ * it (bottom↔top, left↔right — the secondary-axis alignment stays as
76
+ * chosen); when neither side fits, the position is clamped into the
77
+ * viewport instead. Exported for direct testing like
78
+ * `supportsNativePopover` above.
79
+ */
80
+ export declare function placeFloatingPanel(panel: HTMLElement, trigger: HTMLElement, placement: FloatingPlacement): void;
68
81
  /**
69
82
  * Tier 2 positioning: place the panel under/over/beside the trigger and
70
83
  * re-place on scroll/resize while open. No-op on the anchored and
@@ -113,28 +113,50 @@ function L(e, t) {
113
113
  }
114
114
  function R(e, t, n) {
115
115
  if (n === "point") return;
116
- let r = t.getBoundingClientRect(), i = e.getBoundingClientRect(), a = r.left + r.width / 2 - i.width / 2, o = r.top + r.height / 2 - i.height / 2;
117
- switch (n) {
118
- case "bottom":
119
- case "bottom-span":
120
- e.style.top = `${r.bottom + L(e, "marginTop")}px`, e.style.left = `${r.left}px`;
121
- return;
122
- case "bottom-center":
123
- e.style.top = `${r.bottom + L(e, "marginTop")}px`, e.style.left = `${a}px`;
124
- return;
125
- case "bottom-end":
126
- e.style.top = `${r.bottom + L(e, "marginTop")}px`, e.style.left = `${r.right - i.width}px`;
127
- return;
128
- case "top":
129
- e.style.top = `${r.top - i.height - L(e, "marginBottom")}px`, e.style.left = `${a}px`;
130
- return;
131
- case "left":
132
- e.style.top = `${o}px`, e.style.left = `${r.left - i.width - L(e, "marginRight")}px`;
133
- return;
134
- case "right":
135
- e.style.top = `${o}px`, e.style.left = `${r.right + L(e, "marginLeft")}px`;
136
- return;
116
+ let r = t.getBoundingClientRect(), i = e.getBoundingClientRect(), a = {
117
+ width: window.innerWidth,
118
+ height: window.innerHeight
119
+ }, o = r.left + r.width / 2 - i.width / 2, s = r.top + r.height / 2 - i.height / 2, c = {
120
+ below: L(e, "marginTop"),
121
+ above: L(e, "marginBottom"),
122
+ after: L(e, "marginLeft"),
123
+ before: L(e, "marginRight")
124
+ }, l = (e, t) => ({
125
+ top: e === "bottom" ? r.bottom + c.below : r.top - i.height - c.above,
126
+ left: t === "start" ? r.left : t === "end" ? r.right - i.width : o
127
+ }), u = (e) => ({
128
+ top: s,
129
+ left: e === "right" ? r.right + c.after : r.left - i.width - c.before
130
+ }), d = {
131
+ bottom: {
132
+ side: "bottom",
133
+ align: "start"
134
+ },
135
+ "bottom-span": {
136
+ side: "bottom",
137
+ align: "start"
138
+ },
139
+ "bottom-center": {
140
+ side: "bottom",
141
+ align: "center"
142
+ },
143
+ "bottom-end": {
144
+ side: "bottom",
145
+ align: "end"
146
+ },
147
+ top: {
148
+ side: "top",
149
+ align: "center"
150
+ }
151
+ }, { top: f, left: p } = n === "left" || n === "right" ? u(n) : l(d[n].side, d[n].align);
152
+ if (n === "left" || n === "right") {
153
+ let e = n === "right" ? p + i.width > a.width : p < 0, t = n === "right" ? r.left - i.width - c.before >= 0 : r.right + i.width + c.after <= a.width;
154
+ e && t && ({top: f, left: p} = u(n === "right" ? "left" : "right"));
155
+ } else {
156
+ let { side: e, align: t } = d[n], o = e === "bottom" ? f + i.height > a.height : f < 0, s = e === "bottom" ? r.top - i.height - c.above >= 0 : r.bottom + i.height + c.below <= a.height;
157
+ o && s && ({top: f, left: p} = l(e === "bottom" ? "top" : "bottom", t));
137
158
  }
159
+ f = Math.min(Math.max(f, 0), Math.max(0, a.height - i.height)), p = Math.min(Math.max(p, 0), Math.max(0, a.width - i.width)), e.style.top = `${f}px`, e.style.left = `${p}px`;
138
160
  }
139
161
  function z({ behavior: e, placement: t }) {
140
162
  let { native: n, anchored: i, open: a, triggerRef: o, panelRef: s } = e;
@@ -178,4 +200,4 @@ function B({ behavior: n, placement: r, visualClass: i, className: a, style: o,
178
200
  });
179
201
  }
180
202
  //#endregion
181
- export { B as FloatingPanel, I as floatingPlacementClasses, l as supportsAnchorPositioning, c as supportsNativePopover, F as useFloating, z as useFloatingPosition };
203
+ export { B as FloatingPanel, I as floatingPlacementClasses, R as placeFloatingPanel, l as supportsAnchorPositioning, c as supportsNativePopover, F as useFloating, z as useFloatingPosition };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haze-ui",
3
- "version": "1.18.2",
3
+ "version": "1.19.0",
4
4
  "type": "module",
5
5
  "description": "A React UI component library powered by react-use-control and Linaria",
6
6
  "main": "./dist/index.js",
@@ -12,6 +12,21 @@
12
12
  "import": "./dist/index.js",
13
13
  "default": "./dist/index.js"
14
14
  },
15
+ "./components/*": {
16
+ "types": "./dist/types/components/*/index.d.ts",
17
+ "import": "./dist/components/*/index.js",
18
+ "default": "./dist/components/*/index.js"
19
+ },
20
+ "./form": {
21
+ "types": "./dist/types/form/index.d.ts",
22
+ "import": "./dist/form/index.js",
23
+ "default": "./dist/form/index.js"
24
+ },
25
+ "./tokens": {
26
+ "types": "./dist/types/tokens/index.d.ts",
27
+ "import": "./dist/tokens/index.js",
28
+ "default": "./dist/tokens/index.js"
29
+ },
15
30
  "./styles.css": "./dist/haze-ui.css",
16
31
  "./css/*": "./dist/css/*"
17
32
  },
@@ -59,6 +74,7 @@
59
74
  "react-use-control": "^1.5.0"
60
75
  },
61
76
  "devDependencies": {
77
+ "@axe-core/playwright": "^4.13.0",
62
78
  "@babel/core": "^8.0.1",
63
79
  "@babel/preset-env": "^8.0.2",
64
80
  "@babel/preset-typescript": "^8.0.1",