@companix/uikit 0.1.40 → 0.1.42

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.
@@ -18,10 +18,12 @@ export interface PopoverProps {
18
18
  showArrows?: boolean;
19
19
  minimal?: boolean;
20
20
  sideOffset?: number;
21
+ alignOffset?: number;
21
22
  matchTarget?: 'width' | 'min-width';
22
23
  className?: string;
23
24
  fitMaxHeight?: boolean;
24
25
  disabled?: boolean;
25
26
  zIndex?: number;
27
+ style?: React.CSSProperties;
26
28
  }
27
29
  export declare const Popover: import('react').ForwardRefExoticComponent<PopoverProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,58 +1,61 @@
1
1
  import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
2
  import * as o from "@radix-ui/react-popover";
3
- import { attr as B } from "@companix/utils-browser";
4
- import M from "classnames";
5
- import { forwardRef as j, useRef as k } from "react";
6
- const D = j((i, n) => {
3
+ import { attr as j } from "@companix/utils-browser";
4
+ import k from "classnames";
5
+ import { forwardRef as F, useRef as T } from "react";
6
+ const H = F((i, n) => {
7
7
  const {
8
8
  children: s,
9
9
  sideOffset: l,
10
- matchTarget: c,
11
- onAnimationEnd: m,
12
- onAnimationStart: d,
10
+ alignOffset: c,
11
+ matchTarget: m,
12
+ onAnimationEnd: d,
13
+ onAnimationStart: f,
13
14
  onOpenAutoFocus: p,
14
- onCloseAutoFocus: f,
15
- triggerRef: h,
16
- triggerProps: g,
17
- open: u,
18
- content: v,
19
- onOpenChange: C,
20
- align: x,
21
- disabled: w,
22
- minimal: L,
23
- className: N,
24
- fitMaxHeight: O = !0,
25
- zIndex: P = 9999,
26
- side: A,
27
- showArrows: b
28
- } = i, e = k(null), y = () => {
15
+ onCloseAutoFocus: h,
16
+ style: g,
17
+ triggerRef: u,
18
+ triggerProps: v,
19
+ open: C,
20
+ content: x,
21
+ onOpenChange: w,
22
+ align: L,
23
+ disabled: O,
24
+ minimal: N,
25
+ className: P,
26
+ fitMaxHeight: y = !0,
27
+ zIndex: A = 9999,
28
+ side: b,
29
+ showArrows: R
30
+ } = i, e = T(null), B = () => {
29
31
  e.current && e.current.click();
30
- }, R = (t) => {
31
- w && t.preventDefault();
32
+ }, M = (t) => {
33
+ O && t.preventDefault();
32
34
  };
33
- return /* @__PURE__ */ a(o.Root, { open: u, onOpenChange: C, children: [
34
- /* @__PURE__ */ r(o.Trigger, { ref: h, ...g, onClick: R, asChild: !0, children: s }),
35
+ return /* @__PURE__ */ a(o.Root, { open: C, onOpenChange: w, children: [
36
+ /* @__PURE__ */ r(o.Trigger, { ref: u, ...v, onClick: M, asChild: !0, children: s }),
35
37
  /* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ a(
36
38
  o.Content,
37
39
  {
38
40
  ref: n,
39
- className: M("popover", N),
40
- side: A,
41
- align: x,
42
- "data-appearance": L ? "minimal" : "default",
43
- "data-match-target": c,
41
+ className: k("popover", P),
42
+ side: b,
43
+ align: L,
44
+ "data-appearance": N ? "minimal" : "default",
45
+ "data-match-target": m,
44
46
  sideOffset: l ?? 6,
47
+ alignOffset: c,
45
48
  avoidCollisions: !0,
46
49
  arrowPadding: 10,
47
- style: { zIndex: P },
48
- onAnimationStart: d,
49
- onAnimationEnd: m,
50
+ style: { zIndex: A, ...g },
51
+ onAnimationStart: f,
52
+ onAnimationEnd: d,
50
53
  onOpenAutoFocus: p,
51
- onCloseAutoFocus: f,
54
+ onCloseAutoFocus: h,
52
55
  onWheel: (t) => t.stopPropagation(),
53
56
  children: [
54
57
  /* @__PURE__ */ r(o.Close, { ref: e, style: { display: "none" } }),
55
- b && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ a("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
58
+ R && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ a("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
56
59
  /* @__PURE__ */ r(
57
60
  "path",
58
61
  {
@@ -72,12 +75,12 @@ const D = j((i, n) => {
72
75
  }
73
76
  )
74
77
  ] }) }) }),
75
- /* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": B(O), children: v({ close: y }) })
78
+ /* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": j(y), children: x({ close: B }) })
76
79
  ]
77
80
  }
78
81
  ) })
79
82
  ] });
80
83
  });
81
84
  export {
82
- D as Popover
85
+ H as Popover
83
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companix/uikit",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "main": "./dist/bundle.es.js",
5
5
  "module": "./dist/bundle.es.js",
6
6
  "types": "./dist/index.d.ts",