@companix/uikit 0.0.33 → 0.0.35

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 (90) hide show
  1. package/dist/Avatar/Avatar.scss +64 -0
  2. package/dist/Avatar/helpers.d.ts +10 -0
  3. package/dist/Avatar/index.d.ts +8 -0
  4. package/dist/Avatar/types.d.ts +2 -0
  5. package/dist/Icon/index.d.ts +2 -3
  6. package/dist/Segments/Segments.scss +57 -0
  7. package/dist/Segments/index.d.ts +11 -0
  8. package/dist/bundle.es.js +86 -80
  9. package/dist/bundle.es10.js +78 -39
  10. package/dist/bundle.es11.js +26 -36
  11. package/dist/bundle.es12.js +75 -56
  12. package/dist/bundle.es13.js +39 -19
  13. package/dist/bundle.es14.js +36 -33
  14. package/dist/bundle.es15.js +54 -23
  15. package/dist/bundle.es16.js +21 -45
  16. package/dist/bundle.es17.js +29 -19
  17. package/dist/bundle.es18.js +21 -25
  18. package/dist/bundle.es19.js +45 -38
  19. package/dist/bundle.es2.js +42 -45
  20. package/dist/bundle.es20.js +21 -14
  21. package/dist/bundle.es21.js +28 -33
  22. package/dist/bundle.es22.js +38 -21
  23. package/dist/bundle.es23.js +12 -38
  24. package/dist/bundle.es24.js +32 -114
  25. package/dist/bundle.es25.js +20 -120
  26. package/dist/bundle.es26.js +40 -72
  27. package/dist/bundle.es27.js +115 -32
  28. package/dist/bundle.es28.js +120 -11
  29. package/dist/bundle.es29.js +71 -83
  30. package/dist/bundle.es3.js +2 -8
  31. package/dist/bundle.es30.js +31 -20
  32. package/dist/bundle.es31.js +11 -6
  33. package/dist/bundle.es32.js +83 -32
  34. package/dist/bundle.es33.js +21 -21
  35. package/dist/bundle.es34.js +6 -10
  36. package/dist/bundle.es35.js +33 -23
  37. package/dist/bundle.es36.js +20 -37
  38. package/dist/bundle.es37.js +10 -50
  39. package/dist/bundle.es38.js +22 -40
  40. package/dist/bundle.es39.js +38 -8
  41. package/dist/bundle.es4.js +44 -10
  42. package/dist/bundle.es40.js +48 -21
  43. package/dist/bundle.es41.js +42 -86
  44. package/dist/bundle.es42.js +8 -17
  45. package/dist/bundle.es43.js +24 -19
  46. package/dist/bundle.es44.js +24 -24
  47. package/dist/bundle.es45.js +77 -29
  48. package/dist/bundle.es46.js +18 -3
  49. package/dist/bundle.es47.js +20 -5
  50. package/dist/bundle.es48.js +24 -14
  51. package/dist/bundle.es49.js +39 -14
  52. package/dist/bundle.es5.js +8 -85
  53. package/dist/bundle.es50.js +3 -3
  54. package/dist/bundle.es51.js +5 -3
  55. package/dist/bundle.es52.js +13 -69
  56. package/dist/bundle.es53.js +13 -67
  57. package/dist/bundle.es54.js +3 -70
  58. package/dist/bundle.es55.js +3 -12
  59. package/dist/bundle.es56.js +68 -41
  60. package/dist/bundle.es57.js +67 -14
  61. package/dist/bundle.es58.js +69 -31
  62. package/dist/bundle.es59.js +12 -70
  63. package/dist/bundle.es6.js +11 -85
  64. package/dist/bundle.es60.js +43 -20
  65. package/dist/bundle.es61.js +15 -2
  66. package/dist/bundle.es62.js +32 -14
  67. package/dist/bundle.es63.js +69 -19
  68. package/dist/bundle.es64.js +14 -2
  69. package/dist/bundle.es65.js +17 -18
  70. package/dist/bundle.es67.js +76 -20
  71. package/dist/bundle.es68.js +45 -72
  72. package/dist/bundle.es69.js +20 -49
  73. package/dist/bundle.es7.js +84 -79
  74. package/dist/bundle.es70.js +2 -2
  75. package/dist/bundle.es71.js +21 -14
  76. package/dist/bundle.es72.js +2 -3
  77. package/dist/bundle.es73.js +20 -3
  78. package/dist/bundle.es74.js +14 -20
  79. package/dist/bundle.es75.js +2 -2
  80. package/dist/bundle.es76.js +3 -20
  81. package/dist/bundle.es77.js +3 -2
  82. package/dist/bundle.es78.js +22 -0
  83. package/dist/bundle.es79.js +4 -0
  84. package/dist/bundle.es8.js +83 -24
  85. package/dist/bundle.es80.js +22 -0
  86. package/dist/bundle.es81.js +4 -0
  87. package/dist/bundle.es9.js +20 -73
  88. package/dist/index.d.ts +6 -0
  89. package/dist/index.scss +2 -0
  90. package/package.json +2 -1
@@ -0,0 +1,64 @@
1
+ @use '../mixins.scss';
2
+
3
+ .avatar {
4
+ position: relative;
5
+ box-sizing: border-box;
6
+ display: flex;
7
+ flex-shrink: 0;
8
+ align-items: center;
9
+ justify-content: center;
10
+ background-size: cover;
11
+ isolation: isolate;
12
+
13
+ @include mixins.use-styles(avatar);
14
+
15
+ &-image {
16
+ object-fit: cover;
17
+ display: block;
18
+ width: 100%;
19
+ height: 100%;
20
+ color: transparent;
21
+ text-indent: 10000px;
22
+ border: 0;
23
+ border-radius: inherit;
24
+ }
25
+
26
+ &-icon {
27
+ position: absolute;
28
+ top: auto;
29
+ left: auto;
30
+ }
31
+
32
+ &-initials {
33
+ line-height: 1;
34
+ text-align: center;
35
+ text-transform: uppercase;
36
+
37
+ @include mixins.use-styles(avatar, initials);
38
+ }
39
+
40
+ &-border {
41
+ box-sizing: border-box;
42
+ pointer-events: none;
43
+ border-radius: inherit;
44
+ transform-origin: left top;
45
+
46
+ @include mixins.use-styles(avatar, border);
47
+ }
48
+
49
+ &-content {
50
+ display: inherit;
51
+ align-items: inherit;
52
+ justify-content: inherit;
53
+ border-radius: inherit;
54
+ }
55
+
56
+ &-border,
57
+ &-content {
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ width: 100%;
62
+ height: 100%;
63
+ }
64
+ }
@@ -0,0 +1,10 @@
1
+ export type GetInitialsFontSizeType = (avatarSize: number) => number;
2
+ export declare const getInitialsFontSize: GetInitialsFontSizeType;
3
+ export declare function getFallbackIconSizeByImageBaseSize(imageSize: number): 12 | 16 | 20 | 24 | 28 | 36;
4
+ export declare namespace getFallbackIconSizeByImageBaseSize {
5
+ let MAX_SIZE: 36;
6
+ }
7
+ export declare function getBadgeIconSizeByImageBaseSize(imageSize: number): 12 | 16 | 20 | 24;
8
+ export declare namespace getBadgeIconSizeByImageBaseSize {
9
+ let MAX_SIZE: 24;
10
+ }
@@ -0,0 +1,8 @@
1
+ import { AvatarSize } from './types';
2
+ export interface AvatarProps extends React.ImgHTMLAttributes<HTMLElement> {
3
+ size?: AvatarSize;
4
+ noBorder?: boolean;
5
+ fallbackIcon?: React.ReactElement;
6
+ initials?: string;
7
+ }
8
+ export declare const Avatar: ({ alt, crossOrigin, decoding, loading, referrerPolicy, sizes, size, src, srcSet, useMap, initials, noBorder, fallbackIcon: fallbackIconProp, children }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const avatarSizes: readonly [16, 20, 24, 28, 32, 36, 40, 44, 48, 56, 64, 72, 80, 88, 96];
2
+ export type AvatarSize = (typeof avatarSizes)[number];
@@ -1,7 +1,6 @@
1
1
  import { IconDefinition } from '@fortawesome/free-solid-svg-icons';
2
- export interface IconProps {
2
+ export interface IconProps extends React.SVGProps<SVGSVGElement> {
3
3
  icon: IconDefinition;
4
4
  size?: 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl';
5
- className?: string;
6
5
  }
7
- export declare const Icon: import('react').ForwardRefExoticComponent<IconProps & import('react').RefAttributes<SVGSVGElement>>;
6
+ export declare const Icon: import('react').ForwardRefExoticComponent<Omit<IconProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,57 @@
1
+ @use '../mixins.scss';
2
+
3
+ .segments {
4
+ position: relative;
5
+ display: flex;
6
+ width: 100%;
7
+ height: 100%;
8
+ border-radius: inherit;
9
+ transition: all 100ms ease-out;
10
+
11
+ &-container {
12
+ width: 100%;
13
+ box-sizing: border-box;
14
+
15
+ @include mixins.use-styles(segment-control, container);
16
+ }
17
+
18
+ &-slider {
19
+ position: absolute;
20
+ top: 0;
21
+ bottom: 0;
22
+ left: 0;
23
+ width: calc(100% / var(--uikit--options));
24
+ border-radius: inherit;
25
+ transform: translateX(calc(var(--uikit--current-index) * 100%));
26
+ transform-origin: 0 0;
27
+ transition: transform 150ms;
28
+
29
+ @include mixins.use-styles(segment-control, slider);
30
+ }
31
+
32
+ &-option {
33
+ position: relative;
34
+ box-sizing: border-box;
35
+ display: flex;
36
+ flex: 1;
37
+ align-items: center;
38
+ justify-content: center;
39
+ height: 100%;
40
+ cursor: pointer;
41
+ user-select: none;
42
+ background: transparent;
43
+ border: 0;
44
+ border-radius: inherit;
45
+ transition: color 100ms ease-out;
46
+
47
+ &:not([data-active]):hover {
48
+ @include mixins.use-styles(segment-control, option, hover);
49
+ }
50
+
51
+ &:not([data-active]):active {
52
+ @include mixins.use-styles(segment-control, option, active);
53
+ }
54
+
55
+ @include mixins.use-styles(segment-control, option);
56
+ }
57
+ }
@@ -0,0 +1,11 @@
1
+ interface SegmentOption<T> {
2
+ label: React.ReactNode;
3
+ value: T;
4
+ }
5
+ export interface SegmentsProps<T> {
6
+ value: T;
7
+ onChange: (value: T) => void;
8
+ options: SegmentOption<T>[];
9
+ }
10
+ export declare const Segments: <T extends number | string>({ value, onChange, options }: SegmentsProps<T>) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
package/dist/bundle.es.js CHANGED
@@ -1,82 +1,88 @@
1
- import { Button as e } from "./bundle.es2.js";
2
- import { ButtonGroup as p } from "./bundle.es3.js";
3
- import { Spinner as x } from "./bundle.es4.js";
4
- import { Scrollable as a } from "./bundle.es5.js";
5
- import { ImitateScroll as l } from "./bundle.es6.js";
6
- import { Popover as n } from "./bundle.es7.js";
7
- import { Tooltip as u } from "./bundle.es8.js";
8
- import { Select as g } from "./bundle.es9.js";
9
- import { Input as h } from "./bundle.es10.js";
10
- import { OptionItem as I } from "./bundle.es11.js";
11
- import { NumberInput as d } from "./bundle.es12.js";
12
- import { OptionsList as v } from "./bundle.es13.js";
13
- import { Checkbox as B } from "./bundle.es14.js";
14
- import { Switch as k } from "./bundle.es15.js";
15
- import { Radio as y, RadioGroup as C } from "./bundle.es16.js";
16
- import { Drawer as L } from "./bundle.es17.js";
17
- import { Dialog as F } from "./bundle.es18.js";
18
- import { AlertDialog as j } from "./bundle.es19.js";
19
- import { LoadingButton as z } from "./bundle.es20.js";
20
- import { Tabs as H } from "./bundle.es21.js";
21
- import { Countdown as K } from "./bundle.es22.js";
22
- import { TextArea as Q } from "./bundle.es23.js";
23
- import { SelectTags as V } from "./bundle.es24.js";
24
- import { DatePicker as X } from "./bundle.es25.js";
25
- import { DateInput as Z } from "./bundle.es26.js";
26
- import { FileOverlay as $ } from "./bundle.es27.js";
27
- import { FormGroup as ro } from "./bundle.es28.js";
28
- import { TimePicker as to } from "./bundle.es29.js";
29
- import { Icon as mo } from "./bundle.es30.js";
30
- import { ProgressBar as fo } from "./bundle.es31.js";
31
- import { ThemeProvider as io, useTheme as lo } from "./bundle.es32.js";
32
- import { ColorSchemeScript as no, colorSchemeScript as so } from "./bundle.es33.js";
33
- import { useLocalStorage as So } from "./bundle.es34.js";
34
- import { createAlertAgent as To } from "./bundle.es35.js";
35
- import { createToaster as Do } from "./bundle.es36.js";
36
- import { Toast as Po } from "./bundle.es37.js";
37
- import { DialogShell as vo, createDialogsRegistry as Ao } from "./bundle.es38.js";
38
- import { createPopoversRegistry as Ro } from "./bundle.es39.js";
1
+ import { Avatar as e } from "./bundle.es2.js";
2
+ import { avatarSizes as p } from "./bundle.es3.js";
3
+ import { Button as x } from "./bundle.es4.js";
4
+ import { ButtonGroup as a } from "./bundle.es5.js";
5
+ import { Spinner as l } from "./bundle.es6.js";
6
+ import { Scrollable as n } from "./bundle.es7.js";
7
+ import { ImitateScroll as S } from "./bundle.es8.js";
8
+ import { Segments as g } from "./bundle.es9.js";
9
+ import { Popover as h } from "./bundle.es10.js";
10
+ import { Tooltip as v } from "./bundle.es11.js";
11
+ import { Select as P } from "./bundle.es12.js";
12
+ import { Input as A } from "./bundle.es13.js";
13
+ import { OptionItem as B } from "./bundle.es14.js";
14
+ import { NumberInput as k } from "./bundle.es15.js";
15
+ import { OptionsList as y } from "./bundle.es16.js";
16
+ import { Checkbox as G } from "./bundle.es17.js";
17
+ import { Switch as O } from "./bundle.es18.js";
18
+ import { Radio as z, RadioGroup as N } from "./bundle.es19.js";
19
+ import { Drawer as q } from "./bundle.es20.js";
20
+ import { Dialog as H } from "./bundle.es21.js";
21
+ import { AlertDialog as K } from "./bundle.es22.js";
22
+ import { LoadingButton as Q } from "./bundle.es23.js";
23
+ import { Tabs as V } from "./bundle.es24.js";
24
+ import { Countdown as X } from "./bundle.es25.js";
25
+ import { TextArea as Z } from "./bundle.es26.js";
26
+ import { SelectTags as $ } from "./bundle.es27.js";
27
+ import { DatePicker as ro } from "./bundle.es28.js";
28
+ import { DateInput as to } from "./bundle.es29.js";
29
+ import { FileOverlay as mo } from "./bundle.es30.js";
30
+ import { FormGroup as fo } from "./bundle.es31.js";
31
+ import { TimePicker as io } from "./bundle.es32.js";
32
+ import { Icon as co } from "./bundle.es33.js";
33
+ import { ProgressBar as so } from "./bundle.es34.js";
34
+ import { ThemeProvider as uo, useTheme as go } from "./bundle.es35.js";
35
+ import { ColorSchemeScript as ho, colorSchemeScript as Do } from "./bundle.es36.js";
36
+ import { useLocalStorage as Io } from "./bundle.es37.js";
37
+ import { createAlertAgent as Ao } from "./bundle.es38.js";
38
+ import { createToaster as Bo } from "./bundle.es39.js";
39
+ import { Toast as ko } from "./bundle.es40.js";
40
+ import { DialogShell as yo, createDialogsRegistry as Co } from "./bundle.es41.js";
41
+ import { createPopoversRegistry as Lo } from "./bundle.es42.js";
39
42
  export {
40
- j as AlertDialog,
41
- e as Button,
42
- p as ButtonGroup,
43
- B as Checkbox,
44
- no as ColorSchemeScript,
45
- K as Countdown,
46
- Z as DateInput,
47
- X as DatePicker,
48
- F as Dialog,
49
- vo as DialogShell,
50
- L as Drawer,
51
- $ as FileOverlay,
52
- ro as FormGroup,
53
- mo as Icon,
54
- l as ImitateScroll,
55
- h as Input,
56
- z as LoadingButton,
57
- d as NumberInput,
58
- I as OptionItem,
59
- v as OptionsList,
60
- n as Popover,
61
- fo as ProgressBar,
62
- y as Radio,
63
- C as RadioGroup,
64
- a as Scrollable,
65
- g as Select,
66
- V as SelectTags,
67
- x as Spinner,
68
- k as Switch,
69
- H as Tabs,
70
- Q as TextArea,
71
- io as ThemeProvider,
72
- to as TimePicker,
73
- Po as Toast,
74
- u as Tooltip,
75
- so as colorSchemeScript,
76
- To as createAlertAgent,
77
- Ao as createDialogsRegistry,
78
- Ro as createPopoversRegistry,
79
- Do as createToaster,
80
- So as useLocalStorage,
81
- lo as useTheme
43
+ K as AlertDialog,
44
+ e as Avatar,
45
+ x as Button,
46
+ a as ButtonGroup,
47
+ G as Checkbox,
48
+ ho as ColorSchemeScript,
49
+ X as Countdown,
50
+ to as DateInput,
51
+ ro as DatePicker,
52
+ H as Dialog,
53
+ yo as DialogShell,
54
+ q as Drawer,
55
+ mo as FileOverlay,
56
+ fo as FormGroup,
57
+ co as Icon,
58
+ S as ImitateScroll,
59
+ A as Input,
60
+ Q as LoadingButton,
61
+ k as NumberInput,
62
+ B as OptionItem,
63
+ y as OptionsList,
64
+ h as Popover,
65
+ so as ProgressBar,
66
+ z as Radio,
67
+ N as RadioGroup,
68
+ n as Scrollable,
69
+ g as Segments,
70
+ P as Select,
71
+ $ as SelectTags,
72
+ l as Spinner,
73
+ O as Switch,
74
+ V as Tabs,
75
+ Z as TextArea,
76
+ uo as ThemeProvider,
77
+ io as TimePicker,
78
+ ko as Toast,
79
+ v as Tooltip,
80
+ p as avatarSizes,
81
+ Do as colorSchemeScript,
82
+ Ao as createAlertAgent,
83
+ Co as createDialogsRegistry,
84
+ Lo as createPopoversRegistry,
85
+ Bo as createToaster,
86
+ Io as useLocalStorage,
87
+ go as useTheme
82
88
  };
@@ -1,43 +1,82 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as b, useRef as R } from "react";
3
- import { mergeRefs as c } from "react-merge-refs";
4
- import { InputElement as x } from "./bundle.es44.js";
5
- import { InputContainer as I } from "./bundle.es45.js";
6
- import g from "classnames";
7
- const N = b(
8
- ({
9
- onChange: m,
10
- onValueChange: f,
11
- readOnly: i,
12
- inputClassName: o,
13
- value: p,
14
- placeholder: n,
15
- mask: d,
16
- inputType: s = "text",
17
- maskChar: u,
18
- inputRef: a,
19
- ...e
20
- }, l) => {
21
- const r = R(null);
22
- return /* @__PURE__ */ t(I, { ref: l, inputRef: r, ...e, children: /* @__PURE__ */ t(
23
- x,
1
+ import { jsxs as t, jsx as r } from "react/jsx-runtime";
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((a, i) => {
7
+ const {
8
+ children: n,
9
+ sideOffset: s,
10
+ matchTarget: l,
11
+ onAnimationEnd: c,
12
+ onAnimationStart: m,
13
+ onOpenAutoFocus: d,
14
+ onCloseAutoFocus: f,
15
+ triggerRef: p,
16
+ triggerProps: h,
17
+ open: g,
18
+ content: u,
19
+ onOpenChange: v,
20
+ align: C,
21
+ disabled: x,
22
+ minimal: w,
23
+ className: L,
24
+ fitMaxHeight: N = !0,
25
+ zIndex: O = 100,
26
+ side: A,
27
+ showArrows: P
28
+ } = a, e = k(null), b = () => {
29
+ e.current && e.current.click();
30
+ }, y = (R) => {
31
+ x && R.preventDefault();
32
+ };
33
+ return /* @__PURE__ */ t(o.Root, { open: g, onOpenChange: v, children: [
34
+ /* @__PURE__ */ r(o.Trigger, { ref: p, ...h, onClick: y, asChild: !0, children: n }),
35
+ /* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ t(
36
+ o.Content,
24
37
  {
25
- type: s,
26
- ref: c([r, a]),
27
- className: g("form-input form-input-base", o),
28
- "aria-disabled": e.disabled,
29
- onChange: m,
30
- onValueChange: f,
31
- value: p,
32
- placeholder: n,
33
- disabled: e.disabled,
34
- readOnly: i,
35
- maskChar: u,
36
- mask: d
38
+ ref: i,
39
+ className: M("popover", L),
40
+ side: A,
41
+ align: C,
42
+ "data-appearance": w ? "minimal" : "default",
43
+ "data-match-target": l,
44
+ sideOffset: s ?? 6,
45
+ avoidCollisions: !0,
46
+ arrowPadding: 10,
47
+ style: { zIndex: O },
48
+ onAnimationStart: m,
49
+ onAnimationEnd: c,
50
+ onOpenAutoFocus: d,
51
+ onCloseAutoFocus: f,
52
+ children: [
53
+ /* @__PURE__ */ r(o.Close, { ref: e, style: { display: "none" } }),
54
+ P && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ t("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
55
+ /* @__PURE__ */ r(
56
+ "path",
57
+ {
58
+ className: "popover-arrow-border",
59
+ d: "M 18.112 -2.704 C 19.127 -3.64 19.999 -5.626 19.999 -7.001 L 19.999 18.999 C 19.999 17.621 19.131 15.642 18.111 14.702 L 10.927 8.084 C 9.69 6.944 9.694 5.05 10.927 3.914 L 18.112 -2.704 Z",
60
+ style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
61
+ transform: "matrix(0, -1, 1, 0, 0.000001, 0)"
62
+ }
63
+ ),
64
+ /* @__PURE__ */ r(
65
+ "path",
66
+ {
67
+ className: "popover-arrow-fill",
68
+ d: "M 17.789 -2.965 C 19.009 -4.09 19.999 -6.341 19.999 -7.995 L 19.999 -10.001 L 19.999 19.999 L 19.999 17.994 C 19.999 16.34 19.016 14.094 17.789 12.964 L 10.606 6.348 C 9.796 5.602 9.804 4.388 10.606 3.648 L 17.789 -2.966 L 17.789 -2.965 Z",
69
+ style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
70
+ transform: "matrix(0, -1, 1, 0, 0, 0)"
71
+ }
72
+ )
73
+ ] }) }) }),
74
+ /* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": B(N), children: u({ close: b }) })
75
+ ]
37
76
  }
38
- ) });
39
- }
40
- );
77
+ ) })
78
+ ] });
79
+ });
41
80
  export {
42
- N as Input
81
+ D as Popover
43
82
  };
@@ -1,38 +1,28 @@
1
- import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import N from "classnames";
3
- import { Icon as v } from "./bundle.es30.js";
4
- import { attr as t } from "@companix/utils-browser";
5
- import { forwardRef as k } from "react";
6
- import { f as x } from "./bundle.es46.js";
7
- const E = k(
8
- ({ title: s, icon: c, active: e, label: n, disabled: a, minimal: r, onClick: d, className: l, ...m }, p) => {
9
- const f = (h) => {
10
- a || d?.(h);
11
- };
12
- return /* @__PURE__ */ i(
13
- "div",
14
- {
15
- ref: p,
16
- ...m,
17
- className: N("option", l),
18
- "data-selected": t(e),
19
- "data-disabled": t(a),
20
- "data-minimal": t(r),
21
- onClick: f,
22
- children: [
23
- /* @__PURE__ */ i("div", { className: "option-content", children: [
24
- c && /* @__PURE__ */ o("div", { className: "option-icon", children: c }),
25
- /* @__PURE__ */ i("div", { className: "option-content-layout", children: [
26
- /* @__PURE__ */ o("div", { className: "option-title", children: s }),
27
- n && /* @__PURE__ */ o("div", { className: "option-label", children: n })
28
- ] })
29
- ] }),
30
- e && !r && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(v, { icon: x.faCheck }) })
31
- ]
32
- }
33
- );
34
- }
35
- );
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { useState as p } from "react";
3
+ import { Popover as m } from "./bundle.es10.js";
4
+ const f = ({ children: e, content: t, side: r }) => {
5
+ const [s, o] = p(!1);
6
+ return /* @__PURE__ */ n(
7
+ m,
8
+ {
9
+ showArrows: !0,
10
+ className: "tooltip",
11
+ open: s,
12
+ side: r,
13
+ content: () => t,
14
+ triggerProps: {
15
+ onMouseEnter: () => {
16
+ o(!0);
17
+ },
18
+ onMouseLeave: () => {
19
+ o(!1);
20
+ }
21
+ },
22
+ children: e
23
+ }
24
+ );
25
+ };
36
26
  export {
37
- E as OptionItem
27
+ f as Tooltip
38
28
  };