@divayth/brick-ui 0.8.0 → 0.10.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 (53) hide show
  1. package/dist/app/Provider.js +7 -7
  2. package/dist/app/ThemeProvider.js +6 -6
  3. package/dist/styles.css +1 -1
  4. package/dist/ui/DropdownMenu/DropdownMenu.js +17 -17
  5. package/dist/ui/FeedList/FeedList.d.ts +3 -1
  6. package/dist/ui/FeedList/FeedList.d.ts.map +1 -1
  7. package/dist/ui/FeedList/FeedList.js +32 -28
  8. package/dist/ui/Grid/Grid.d.ts +1 -1
  9. package/dist/ui/Grid/Grid.module.css.js +4 -4
  10. package/dist/ui/Grid/Grid.types.d.ts +0 -2
  11. package/dist/ui/Grid/Grid.types.d.ts.map +1 -1
  12. package/dist/ui/Grid/GridItem.d.ts +1 -1
  13. package/dist/ui/Grid/GridItem.d.ts.map +1 -1
  14. package/dist/ui/Grid/GridItem.js +25 -33
  15. package/dist/ui/Grid/GridRoot.js +30 -30
  16. package/dist/ui/Grid/index.d.ts +2 -0
  17. package/dist/ui/Grid/index.d.ts.map +1 -0
  18. package/dist/ui/IconButton/IconButton.d.ts +1 -1
  19. package/dist/ui/IconButton/IconButton.d.ts.map +1 -1
  20. package/dist/ui/IconButton/IconButton.js +1 -1
  21. package/dist/ui/IconButton/IconButton.module.css.js +30 -28
  22. package/dist/ui/List/List.d.ts.map +1 -1
  23. package/dist/ui/List/List.js +19 -19
  24. package/dist/ui/List/index.d.ts +2 -0
  25. package/dist/ui/List/index.d.ts.map +1 -0
  26. package/dist/ui/Modal/Modal.d.ts.map +1 -1
  27. package/dist/ui/Modal/Modal.js +56 -48
  28. package/dist/ui/ProgressBar/ProgressBar.d.ts.map +1 -1
  29. package/dist/ui/ProgressBar/ProgressBar.js +16 -13
  30. package/dist/ui/ProgressBar/index.d.ts +2 -0
  31. package/dist/ui/ProgressBar/index.d.ts.map +1 -0
  32. package/dist/ui/Tabs/Tab.d.ts +1 -1
  33. package/dist/ui/Tabs/Tab.d.ts.map +1 -1
  34. package/dist/ui/Tabs/Tab.js +6 -6
  35. package/dist/ui/Tabs/Tabs.module.css.js +10 -10
  36. package/dist/ui/Tabs/TabsList.d.ts.map +1 -1
  37. package/dist/ui/Tabs/TabsList.js +6 -6
  38. package/dist/ui/Tabs/index.d.ts +2 -0
  39. package/dist/ui/Tabs/index.d.ts.map +1 -0
  40. package/dist/ui/Text/Text.js +7 -7
  41. package/dist/ui/Text/index.d.ts +2 -0
  42. package/dist/ui/Text/index.d.ts.map +1 -0
  43. package/dist/ui/Textarea/Textarea.d.ts +1 -1
  44. package/dist/ui/Textarea/Textarea.d.ts.map +1 -1
  45. package/dist/ui/Textarea/Textarea.js +54 -50
  46. package/dist/ui/Textarea/index.d.ts +2 -0
  47. package/dist/ui/Textarea/index.d.ts.map +1 -0
  48. package/dist/ui/Tooltip/Tooltip.d.ts +7 -4
  49. package/dist/ui/Tooltip/Tooltip.d.ts.map +1 -1
  50. package/dist/ui/Tooltip/Tooltip.js +67 -39
  51. package/dist/ui/index.d.ts +6 -6
  52. package/dist/ui/index.d.ts.map +1 -1
  53. package/package.json +7 -7
@@ -1,20 +1,20 @@
1
1
  "use client";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import { twMerge as l } from "tailwind-merge";
4
- import { Flex as i } from "../Flex/Flex.js";
2
+ import { jsx as l } from "react/jsx-runtime";
3
+ import { Flex as e } from "../Flex/Flex.js";
4
+ import { cn as i } from "../../lib/cn.js";
5
5
  const f = ({
6
6
  children: r,
7
7
  direction: o = "row",
8
8
  className: t,
9
9
  ...a
10
- }) => /* @__PURE__ */ e(
11
- i,
10
+ }) => /* @__PURE__ */ l(
11
+ e,
12
12
  {
13
13
  role: "tablist",
14
14
  "aria-orientation": o === "row" ? "horizontal" : "vertical",
15
15
  direction: o,
16
16
  gap: "none",
17
- className: l(
17
+ className: i(
18
18
  "rounded-lg overflow-hidden",
19
19
  o === "row" ? "w-fit" : "w-full",
20
20
  t
@@ -0,0 +1,2 @@
1
+ export { type TabProps, Tabs, type TabsListProps, type TabsPanelProps, type TabsRootProps, useTabs } from './Tabs.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,IAAI,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { jsx as i } from "react/jsx-runtime";
3
- import { twMerge as m } from "tailwind-merge";
4
- import { useProvider as s } from "../../app/Provider.js";
2
+ import { jsx as m } from "react/jsx-runtime";
3
+ import { useProvider as r } from "../../app/Provider.js";
4
+ import { cn as s } from "../../lib/cn.js";
5
5
  import { getResponsiveSize as a } from "../../lib/getResponsiveSize.js";
6
6
  const f = {
7
7
  thin: "font-thin",
@@ -30,12 +30,12 @@ const f = {
30
30
  className: l,
31
31
  ...x
32
32
  }) => {
33
- const { isMobile: n } = s(), r = a(e, n);
34
- return /* @__PURE__ */ i(
33
+ const { isMobile: n } = r(), i = a(e, n);
34
+ return /* @__PURE__ */ m(
35
35
  "span",
36
36
  {
37
- className: m(
38
- d[r],
37
+ className: s(
38
+ d[i],
39
39
  f[o],
40
40
  l
41
41
  ),
@@ -0,0 +1,2 @@
1
+ export { Text, type TextProps } from './Text.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC"}
@@ -4,5 +4,5 @@ export type TextareaProps = InputControlProps & Omit<ComponentProps<'textarea'>,
4
4
  minRows?: number;
5
5
  maxRows?: number;
6
6
  };
7
- export declare const Textarea: ({ id: idProps, label, error, size, fullWidth, className, startIcon, endIcon, rows, minRows, maxRows, value, defaultValue, onInput, ref: forwardedRef, ...props }: TextareaProps) => import("react").JSX.Element;
7
+ export declare const Textarea: ({ id: idProps, label, error, size, fullWidth, className, startIcon, endIcon, rows, minRows, maxRows, value, defaultValue, onInput, ref: forwardedRef, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, ...props }: TextareaProps) => import("react").JSX.Element;
8
8
  //# sourceMappingURL=Textarea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/ui/Textarea/Textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAkC,MAAM,OAAO,CAAC;AAM5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAInD,MAAM,MAAM,aAAa,GAAG,iBAAiB,GACzC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,GAAG;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAqBJ,eAAO,MAAM,QAAQ,GAAI,kKAiBtB,aAAa,gCAqDf,CAAC"}
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/ui/Textarea/Textarea.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAkC,MAAM,OAAO,CAAC;AAK5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAKnD,MAAM,MAAM,aAAa,GAAG,iBAAiB,GACzC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,GAAG;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAqBJ,eAAO,MAAM,QAAQ,GAAI,gOAmBtB,aAAa,gCAyDf,CAAC"}
@@ -1,77 +1,81 @@
1
1
  "use client";
2
- import { jsxs as L, jsx as l } from "react/jsx-runtime";
3
- import { useId as W, useRef as j, useLayoutEffect as v } from "react";
4
- import { useComposedRefs as H } from "@radix-ui/react-compose-refs";
5
- import N from "clsx";
6
- import { Field as i } from "../Field/Field.js";
7
- import e from "../Input/Input.module.css.js";
8
- const T = (o, m, s) => {
9
- const n = Math.max(1, Math.floor(m)), d = Math.max(n, Math.floor(s ?? 1 / 0)), { paddingTop: f, paddingBottom: c, lineHeight: a } = getComputedStyle(o), h = parseFloat(f) + parseFloat(c);
10
- o.classList.add(e.measuring), o.rows = n;
2
+ import { jsxs as F, jsx as d } from "react/jsx-runtime";
3
+ import { useId as H, useRef as N, useLayoutEffect as S } from "react";
4
+ import { useComposedRefs as O } from "@radix-ui/react-compose-refs";
5
+ import { Field as n } from "../Field/Field.js";
6
+ import { cn as $ } from "../../lib/cn.js";
7
+ import i from "../Input/Input.module.css.js";
8
+ const I = (o, l, e) => {
9
+ const s = Math.max(1, Math.floor(l)), m = Math.max(s, Math.floor(e ?? 1 / 0)), { paddingTop: f, paddingBottom: a, lineHeight: c } = getComputedStyle(o), p = parseFloat(f) + parseFloat(a);
10
+ o.classList.add(i.measuring), o.rows = s;
11
11
  const r = Math.ceil(
12
- (o.scrollHeight - h) / parseFloat(a)
12
+ (o.scrollHeight - p) / parseFloat(c)
13
13
  );
14
- o.rows = Math.min(d, Math.max(n, r)), o.classList.remove(e.measuring);
15
- }, A = ({
14
+ o.rows = Math.min(m, Math.max(s, r)), o.classList.remove(i.measuring);
15
+ }, K = ({
16
16
  id: o,
17
- label: m,
18
- error: s,
19
- size: n = "md",
20
- fullWidth: d = !1,
17
+ label: l,
18
+ error: e,
19
+ size: s = "md",
20
+ fullWidth: m = !1,
21
21
  className: f,
22
- startIcon: c,
23
- endIcon: a,
24
- rows: h = 2,
25
- minRows: r = h,
26
- maxRows: p,
22
+ startIcon: a,
23
+ endIcon: c,
24
+ rows: p = 2,
25
+ minRows: r = p,
26
+ maxRows: h,
27
27
  value: g,
28
28
  defaultValue: M,
29
- onInput: b,
30
- ref: y,
31
- ...z
29
+ onInput: L,
30
+ ref: T,
31
+ "aria-describedby": j,
32
+ "aria-invalid": z,
33
+ ...C
32
34
  }) => {
33
- const C = W(), u = o ?? C, x = j(null), E = H(x, y);
34
- return v(() => {
35
- const t = x.current;
35
+ const E = H(), u = o ?? E, b = e ? `${u}-error` : void 0, W = [j, b].filter(Boolean).join(" ") || void 0, v = N(null), B = O(v, T);
36
+ return S(() => {
37
+ const t = v.current;
36
38
  if (!t) return;
37
- const w = () => T(t, r, p);
38
- w();
39
- let F = t.clientWidth;
40
- const I = new ResizeObserver(() => {
41
- F !== t.clientWidth && (F = t.clientWidth, w());
39
+ const x = () => I(t, r, h);
40
+ x();
41
+ let w = t.clientWidth;
42
+ const y = new ResizeObserver(() => {
43
+ w !== t.clientWidth && (w = t.clientWidth, x());
42
44
  });
43
- return I.observe(t), () => I.disconnect();
44
- }, [g, M, r, p]), /* @__PURE__ */ L(i.Root, { className: d ? "w-full" : "w-auto", children: [
45
- m && /* @__PURE__ */ l(i.Label, { htmlFor: u, label: m }),
46
- /* @__PURE__ */ L(i.Control, { size: n, multiline: !0, children: [
47
- c && /* @__PURE__ */ l(i.Icon, { icon: c }),
48
- /* @__PURE__ */ l(
45
+ return y.observe(t), () => y.disconnect();
46
+ }, [g, M, r, h]), /* @__PURE__ */ F(n.Root, { className: m ? "w-full" : "w-auto", children: [
47
+ l && /* @__PURE__ */ d(n.Label, { htmlFor: u, label: l }),
48
+ /* @__PURE__ */ F(n.Control, { size: s, multiline: !0, children: [
49
+ a && /* @__PURE__ */ d(n.Icon, { icon: a }),
50
+ /* @__PURE__ */ d(
49
51
  "textarea",
50
52
  {
51
- ref: E,
53
+ ref: B,
52
54
  id: u,
55
+ "aria-invalid": e ? !0 : z,
56
+ "aria-describedby": W,
53
57
  rows: Math.max(1, Math.floor(r)),
54
58
  value: g,
55
59
  defaultValue: M,
56
60
  onInput: (t) => {
57
- T(t.currentTarget, r, p), b?.(t);
61
+ I(t.currentTarget, r, h), L?.(t);
58
62
  },
59
- className: N(
60
- e.input,
61
- e.multiple,
62
- s && e.error,
63
- c && e.withStartIcon,
64
- a && e.withEndIcon,
63
+ className: $(
64
+ i.input,
65
+ i.multiple,
66
+ e && i.error,
67
+ a && i.withStartIcon,
68
+ c && i.withEndIcon,
65
69
  f
66
70
  ),
67
- ...z
71
+ ...C
68
72
  }
69
73
  ),
70
- a && /* @__PURE__ */ l(i.Icon, { icon: a, position: "end" })
74
+ c && /* @__PURE__ */ d(n.Icon, { icon: c, position: "end" })
71
75
  ] }),
72
- s && /* @__PURE__ */ l(i.Error, { id: `${u}-error`, error: s })
76
+ e && /* @__PURE__ */ d(n.Error, { id: b, error: e })
73
77
  ] });
74
78
  };
75
79
  export {
76
- A as Textarea
80
+ K as Textarea
77
81
  };
@@ -0,0 +1,2 @@
1
+ export { Textarea, type TextareaProps } from './Textarea.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Textarea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type ComponentProps, type PropsWithChildren } from 'react';
1
+ import { type ComponentProps, type PropsWithChildren, type ReactElement } from 'react';
2
2
  import { Tooltip as Primitive } from 'radix-ui';
3
3
  type Side = NonNullable<ComponentProps<typeof Primitive.Content>['side']>;
4
4
  type Placement = Side | `${Side}-start` | `${Side}-end`;
@@ -8,11 +8,14 @@ export interface TooltipRootProps extends PropsWithChildren {
8
8
  disabled?: boolean;
9
9
  }
10
10
  export type TooltipTriggerProps = ComponentProps<typeof Primitive.Trigger>;
11
- export type TooltipContentProps = ComponentProps<typeof Primitive.Content>;
11
+ export interface TooltipContentProps extends Omit<ComponentProps<typeof Primitive.Content>, 'children'> {
12
+ text: string | ReactElement;
13
+ anchor?: boolean;
14
+ }
12
15
  export declare const Tooltip: {
13
16
  Root: ({ children, placement, delay, disabled, }: TooltipRootProps) => import("react").JSX.Element;
14
- Trigger: ({ ref, ...props }: TooltipTriggerProps) => import("react").JSX.Element;
15
- Content: ({ children, className, sideOffset, collisionPadding, ...props }: TooltipContentProps) => import("react").JSX.Element;
17
+ Trigger: ({ ref, onFocus, ...props }: TooltipTriggerProps) => import("react").JSX.Element;
18
+ Content: ({ text, anchor, className, sideOffset, collisionPadding, ...props }: TooltipContentProps) => import("react").JSX.Element;
16
19
  };
17
20
  export {};
18
21
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/ui/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EAIvB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAOhD,KAAK,IAAI,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1E,KAAK,SAAS,GAAG,IAAI,GAAG,GAAG,IAAI,QAAQ,GAAG,GAAG,IAAI,MAAM,CAAC;AAExD,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAmCD,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAS3E,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAmC3E,eAAO,MAAM,OAAO;sDAhEjB,gBAAgB;iCAsBiB,mBAAmB;+EAepD,mBAAmB;CA2B2B,CAAC"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/ui/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAMlB,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAQhD,KAAK,IAAI,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1E,KAAK,SAAS,GAAG,IAAI,GAAG,GAAG,IAAI,QAAQ,GAAG,GAAG,IAAI,MAAM,CAAC;AAExD,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAsDD,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AA4B3E,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrG,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAsCD,eAAO,MAAM,OAAO;sDA5GjB,gBAAgB;0CAyC0B,mBAAmB;mFAsC7D,mBAAmB;CA6B2B,CAAC"}
@@ -1,46 +1,74 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
3
- import { createContext as u, useContext as d, useState as p, useMemo as h } from "react";
4
- import { useComposedRefs as C } from "@radix-ui/react-compose-refs";
5
- import { Tooltip as s } from "radix-ui";
6
- import { twMerge as T } from "tailwind-merge";
7
- import { Portal as x } from "../Portal/Portal.js";
8
- import R from "./Tooltip.module.css.js";
9
- const m = u({}), v = ({
10
- children: t,
11
- placement: o = "top",
12
- delay: r = 250,
13
- disabled: n = !1
2
+ import { jsx as n, jsxs as T } from "react/jsx-runtime";
3
+ import { createContext as v, useContext as h, useState as p, useCallback as C, useEffect as w, useMemo as E } from "react";
4
+ import { useComposedRefs as b } from "@radix-ui/react-compose-refs";
5
+ import { Tooltip as c } from "radix-ui";
6
+ import { Portal as y } from "../Portal/Portal.js";
7
+ import { Text as x } from "../Text/Text.js";
8
+ import { cn as L } from "../../lib/cn.js";
9
+ import D from "./Tooltip.module.css.js";
10
+ const m = v({}), R = ({
11
+ children: r,
12
+ placement: i = "top",
13
+ delay: s = 250,
14
+ disabled: l = !1
14
15
  }) => {
15
- const [l, c] = p(!1), [i, a] = p(null), g = h(
16
- () => ({ placement: o, trigger: i, setTrigger: a }),
17
- [o, i]
16
+ const [a, e] = p(!1), [t, g] = p(null), d = C((o) => {
17
+ g(o), o || e(!1);
18
+ }, []);
19
+ w(() => {
20
+ const o = () => e(!1), f = () => {
21
+ document.hidden && o();
22
+ };
23
+ return window.addEventListener("resize", o), window.addEventListener("blur", o), document.addEventListener("visibilitychange", f), () => {
24
+ window.removeEventListener("resize", o), window.removeEventListener("blur", o), document.removeEventListener("visibilitychange", f);
25
+ };
26
+ }, []);
27
+ const u = E(
28
+ () => ({ placement: i, trigger: t, setTrigger: d }),
29
+ [i, t, d]
18
30
  );
19
- return /* @__PURE__ */ e(m.Provider, { value: g, children: /* @__PURE__ */ e(s.Provider, { delayDuration: r, children: /* @__PURE__ */ e(s.Root, { open: l && !n, onOpenChange: c, children: t }) }) });
20
- }, w = ({ ref: t, ...o }) => {
21
- const { setTrigger: r } = d(m), n = C(r, t);
22
- return /* @__PURE__ */ e(s.Trigger, { asChild: !0, ref: n, ...o });
23
- }, y = ({
24
- children: t,
25
- className: o,
26
- sideOffset: r = 8,
27
- collisionPadding: n = 8,
28
- ...l
31
+ return /* @__PURE__ */ n(m.Provider, { value: u, children: /* @__PURE__ */ n(c.Provider, { delayDuration: s, children: /* @__PURE__ */ n(c.Root, { open: a && !l && !!t, onOpenChange: e, children: r }) }) });
32
+ }, k = ({ ref: r, onFocus: i, ...s }) => {
33
+ const { setTrigger: l } = h(m), a = b(l, r);
34
+ return /* @__PURE__ */ n(
35
+ c.Trigger,
36
+ {
37
+ asChild: !0,
38
+ ref: a,
39
+ onFocus: (e) => {
40
+ if (i?.(e), e.currentTarget.hasAttribute("data-tooltip-restore-focus")) {
41
+ e.preventDefault();
42
+ return;
43
+ }
44
+ const t = e.relatedTarget instanceof Element ? e.relatedTarget.closest('dialog, [role="dialog"]') : null;
45
+ t && t !== e.currentTarget.closest('dialog, [role="dialog"]') && e.preventDefault();
46
+ },
47
+ ...s
48
+ }
49
+ );
50
+ }, z = ({
51
+ text: r,
52
+ anchor: i = !0,
53
+ className: s,
54
+ sideOffset: l = 4,
55
+ collisionPadding: a = 8,
56
+ ...e
29
57
  }) => {
30
- const { placement: c, trigger: i } = d(m), [a, g = "center"] = c.split("-");
31
- return /* @__PURE__ */ e(x, { container: i?.closest('dialog, [role="dialog"]'), children: /* @__PURE__ */ f(
32
- s.Content,
58
+ const { placement: t, trigger: g } = h(m), [d, u = "center"] = t.split("-");
59
+ return /* @__PURE__ */ n(y, { container: g?.closest('dialog, [role="dialog"]'), children: /* @__PURE__ */ T(
60
+ c.Content,
33
61
  {
34
- side: a,
35
- align: g,
36
- sideOffset: r,
37
- collisionPadding: n,
38
- className: T(R.content, o),
39
- ...l,
62
+ side: d,
63
+ align: u,
64
+ sideOffset: l,
65
+ collisionPadding: a,
66
+ className: L(D.content, s),
67
+ ...e,
40
68
  children: [
41
- t,
42
- /* @__PURE__ */ e(
43
- s.Arrow,
69
+ typeof r == "string" ? /* @__PURE__ */ n(x, { size: "xs", className: "text-gray-1", children: r }) : r,
70
+ i && /* @__PURE__ */ n(
71
+ c.Arrow,
44
72
  {
45
73
  width: 12,
46
74
  height: 6,
@@ -50,7 +78,7 @@ const m = u({}), v = ({
50
78
  ]
51
79
  }
52
80
  ) });
53
- }, A = { Root: v, Trigger: w, Content: y };
81
+ }, S = { Root: R, Trigger: k, Content: z };
54
82
  export {
55
- A as Tooltip
83
+ S as Tooltip
56
84
  };
@@ -13,24 +13,24 @@ export { DropdownMenu, type DropdownMenuContentProps, type DropdownMenuItemProps
13
13
  export { FeedList, type FeedListProps } from './FeedList/FeedList.js';
14
14
  export { type ControlSize, Field, type FieldControlProps, type FieldErrorProps, type FieldIconProps, type FieldLabelProps, } from './Field/Field.js';
15
15
  export { Flex, type FlexProps } from './Flex/index.js';
16
- export { Grid, type GridGap, type GridItemProps, type GridItemSize, type GridRootProps, type ResponsiveValue, } from './Grid/Grid.js';
16
+ export { Grid, type GridGap, type GridItemProps, type GridItemSize, type GridRootProps, type ResponsiveValue, } from './Grid/index.js';
17
17
  export { IconButton, type IconButtonColor, type IconButtonProps, type IconButtonVariant, } from './IconButton/index.js';
18
18
  export { Input, type InputControlProps, type InputProps, } from './Input/index.js';
19
- export { List, type ListItemProps, type ListProps } from './List/List.js';
19
+ export { List, type ListItemProps, type ListProps } from './List/index.js';
20
20
  export { Modal, MODAL_SIZE, type ModalActions, ModalProvider, type ModalRootProps, type ModalSize, useModal, } from './Modal/index.js';
21
21
  export { MultipleChip, type MultipleChipOption, type MultipleChipProps, } from './MultipleChip/index.js';
22
22
  export { NoData, type NoDataProps } from './NoData/index.js';
23
23
  export { Popover, type PopoverContentProps, type PopoverRootProps, type PopoverTriggerProps, } from './Popover/Popover.js';
24
24
  export { Portal, type PortalProps } from './Portal/Portal.js';
25
- export { ProgressBar, type ProgressBarProps, } from './ProgressBar/ProgressBar.js';
25
+ export { ProgressBar, type ProgressBarProps, } from './ProgressBar/index.js';
26
26
  export { Select } from './Select/Select.js';
27
27
  export { type SelectCommonProps, type SelectControlProps, type SelectOption, type SelectProps, type SelectValue, } from './Select/Select.types.js';
28
28
  export { Skeleton, type SkeletonProps } from './Skeleton/index.js';
29
29
  export { Sticky, type StickyProps } from './Sticky/Sticky.js';
30
30
  export { TablePagination, type TablePaginationProps, } from './Table/components/pagination/TablePagination.js';
31
31
  export { type IColumn, SortOrder, type SortParams, Table, type TableBodyProps, type TableContextProps, type TableEmptyConfig, type TablePaginationConfig, type TablePaginationState, type TableParams, type TableProps, type TableSelectionState, type TableSortingState, useSelected, } from './Table/index.js';
32
- export { type TabProps, Tabs, type TabsListProps, type TabsPanelProps, type TabsRootProps, useTabs, } from './Tabs/Tabs.js';
33
- export { Text, type TextProps } from './Text/Text.js';
34
- export { Textarea, type TextareaProps } from './Textarea/Textarea.js';
32
+ export { type TabProps, Tabs, type TabsListProps, type TabsPanelProps, type TabsRootProps, useTabs, } from './Tabs/index.js';
33
+ export { Text, type TextProps } from './Text/index.js';
34
+ export { Textarea, type TextareaProps } from './Textarea/index.js';
35
35
  export { Tooltip, type TooltipContentProps, type TooltipRootProps, type TooltipTriggerProps, } from './Tooltip/Tooltip.js';
36
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EACL,IAAI,EACJ,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,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4
4
  "description": "React components for Brick UI",
5
5
  "type": "module",
6
6
  "files": [
@@ -44,12 +44,12 @@
44
44
  "tailwind-merge": "^3.7.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@eslint-react/eslint-plugin": "^5.28.8",
47
+ "@eslint-react/eslint-plugin": "5.28.8",
48
48
  "@eslint/js": "^9.39.5",
49
49
  "@fontsource-variable/inter": "^5.3.0",
50
- "@storybook/addon-docs": "^10.6.1",
51
- "@storybook/addon-vitest": "^10.6.1",
52
- "@storybook/react-vite": "^10.6.1",
50
+ "@storybook/addon-docs": "10.6.6",
51
+ "@storybook/addon-vitest": "10.6.6",
52
+ "@storybook/react-vite": "10.6.6",
53
53
  "@stylistic/eslint-plugin": "^5.10.0",
54
54
  "@tailwindcss/vite": "^4.0.0",
55
55
  "@types/js-cookie": "^3.0.6",
@@ -68,11 +68,11 @@
68
68
  "react": "^19.0.0",
69
69
  "react-dom": "^19.0.0",
70
70
  "rollup-plugin-preserve-directives": "^0.4.0",
71
- "storybook": "^10.6.1",
71
+ "storybook": "10.6.6",
72
72
  "tailwindcss": "^4.0.0",
73
73
  "tsc-alias": "^1.9.10",
74
74
  "typescript": "^5.0.0",
75
- "typescript-eslint": "^8.72.1",
75
+ "typescript-eslint": "^8.36.0",
76
76
  "vite": "^7.0.0",
77
77
  "vitest": "^5.1.0"
78
78
  },