@divayth/brick-ui 0.0.14 → 0.1.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 (49) hide show
  1. package/README.md +15 -3
  2. package/dist/app/Provider.d.ts +3 -5
  3. package/dist/app/Provider.d.ts.map +1 -1
  4. package/dist/app/Provider.js +46 -37
  5. package/dist/index.js +54 -46
  6. package/dist/lib/dates.d.ts +5 -0
  7. package/dist/lib/dates.d.ts.map +1 -0
  8. package/dist/lib/dates.js +12 -0
  9. package/dist/lib/index.d.ts +2 -3
  10. package/dist/lib/index.d.ts.map +1 -1
  11. package/dist/lib/themes.d.ts +39 -0
  12. package/dist/lib/themes.d.ts.map +1 -1
  13. package/dist/lib/{defaultThemes.js → themes.js} +20 -2
  14. package/dist/styles.css +1 -1
  15. package/dist/ui/Date/DateInput.d.ts +2 -3
  16. package/dist/ui/Date/DateInput.d.ts.map +1 -1
  17. package/dist/ui/Date/DateInput.js +70 -89
  18. package/dist/ui/Date/DateInput.module.css.js +5 -5
  19. package/dist/ui/DateText/DateText.d.ts +0 -1
  20. package/dist/ui/DateText/DateText.d.ts.map +1 -1
  21. package/dist/ui/DateText/DateText.js +9 -10
  22. package/dist/ui/Drawer/Drawer.d.ts +1 -1
  23. package/dist/ui/Drawer/Drawer.d.ts.map +1 -1
  24. package/dist/ui/Drawer/Drawer.js +50 -53
  25. package/dist/ui/FeedScroll/FeedScroll.d.ts.map +1 -1
  26. package/dist/ui/FeedScroll/FeedScroll.js +30 -33
  27. package/dist/ui/IconButton/IconButton.module.css.js +21 -21
  28. package/dist/ui/Popover/Popover.d.ts +14 -0
  29. package/dist/ui/Popover/Popover.d.ts.map +1 -0
  30. package/dist/ui/Popover/Popover.js +26 -0
  31. package/dist/ui/Portal/Portal.d.ts +6 -0
  32. package/dist/ui/Portal/Portal.d.ts.map +1 -0
  33. package/dist/ui/Portal/Portal.js +12 -0
  34. package/dist/ui/Select/Select.d.ts.map +1 -1
  35. package/dist/ui/Select/Select.js +105 -173
  36. package/dist/ui/Select/Select.module.css.js +18 -20
  37. package/dist/ui/Tooltip/Tooltip.d.ts +18 -0
  38. package/dist/ui/Tooltip/Tooltip.d.ts.map +1 -0
  39. package/dist/ui/Tooltip/Tooltip.js +44 -0
  40. package/dist/ui/Tooltip/Tooltip.module.css.js +7 -0
  41. package/dist/ui/index.d.ts +3 -0
  42. package/dist/ui/index.d.ts.map +1 -1
  43. package/package.json +9 -3
  44. package/src/theme.css +30 -0
  45. package/dist/lib/defaultThemes.d.ts +0 -35
  46. package/dist/lib/defaultThemes.d.ts.map +0 -1
  47. package/dist/lib/theme.d.ts +0 -7
  48. package/dist/lib/theme.d.ts.map +0 -1
  49. package/dist/lib/theme.js +0 -15
@@ -1,190 +1,122 @@
1
1
  "use client";
2
- import { jsxs as p, jsx as i, Fragment as F } from "react/jsx-runtime";
3
- import { useRef as C, useState as R, useEffect as q, useId as B } from "react";
4
- import { createPortal as j } from "react-dom";
5
- import { Field as w } from "../Field/Field.js";
6
- import { Flex as M } from "../Flex/Flex.js";
7
- import { IconButton as W } from "../IconButton/IconButton.js";
8
- import { Text as _ } from "../Text/Text.js";
9
- import { useProvider as z } from "../../app/Provider.js";
10
- import { clsx as O } from "clsx";
11
- import { ChevronDown as A, X as K } from "lucide-react";
12
- import o from "./Select.module.css.js";
13
- const U = {
2
+ import { jsx as r, jsxs as s, Fragment as O } from "react/jsx-runtime";
3
+ import { useRef as P, useState as w, useId as R } from "react";
4
+ import { Popover as m } from "../Popover/Popover.js";
5
+ import { Field as d } from "../Field/Field.js";
6
+ import { Flex as j } from "../Flex/Flex.js";
7
+ import { IconButton as k } from "../IconButton/IconButton.js";
8
+ import { Text as q } from "../Text/Text.js";
9
+ import { useProvider as A } from "../../app/Provider.js";
10
+ import { clsx as x } from "clsx";
11
+ import { ChevronDown as D, X as E } from "lucide-react";
12
+ import t from "./Select.module.css.js";
13
+ const T = {
14
14
  sm: 16,
15
15
  md: 20,
16
16
  lg: 24
17
- }, V = (d, f) => d ? /* @__PURE__ */ p(F, { children: [
18
- d.icon,
19
- /* @__PURE__ */ i(_, { className: o.value, children: d.label ?? String(d.value ?? "") })
20
- ] }) : f ? /* @__PURE__ */ i("span", { className: O(o.value, o.placeholder), children: f }) : /* @__PURE__ */ i("span", { className: o.value }), ie = ({
21
- value: d,
22
- onChange: f,
23
- label: x,
24
- disabled: a,
25
- options: y = [],
26
- placeholder: b,
27
- error: v,
28
- withArrow: k = !0,
29
- clearable: L = !0,
30
- className: H,
31
- size: E = "md",
32
- variant: T = "filled"
17
+ }, _ = (n, l) => n ? /* @__PURE__ */ s(O, { children: [
18
+ n.icon,
19
+ /* @__PURE__ */ r(q, { className: t.value, children: n.label ?? String(n.value ?? "") })
20
+ ] }) : l ? /* @__PURE__ */ r("span", { className: x(t.value, t.placeholder), children: l }) : /* @__PURE__ */ r("span", { className: t.value }), U = ({
21
+ value: n,
22
+ onChange: l,
23
+ label: f,
24
+ disabled: o,
25
+ options: g = [],
26
+ placeholder: N,
27
+ error: c,
28
+ withArrow: b = !0,
29
+ clearable: S = !0,
30
+ className: y,
31
+ size: p = "md",
32
+ variant: C = "filled"
33
33
  }) => {
34
- const { messages: $ } = z(), h = y.find((e) => e.value === d), c = C(null), N = C(null), [t, l] = R({
35
- isOpen: !1,
36
- portalTarget: null,
37
- top: 0,
38
- left: 0,
39
- width: 0,
40
- maxHeight: 320,
41
- direction: "down"
42
- });
43
- q(() => {
44
- if (!t.isOpen) return;
45
- if (a) {
46
- l((r) => ({ ...r, isOpen: !1 }));
47
- return;
48
- }
49
- const e = (r) => {
50
- r.key === "Escape" && (r.preventDefault(), r.stopPropagation(), l((s) => ({ ...s, isOpen: !1 })), c.current?.querySelector("button")?.focus());
51
- };
52
- document.addEventListener("keydown", e, !0);
53
- const n = (r) => {
54
- const s = r.target;
55
- s instanceof Node && (c.current?.contains(s) || N.current?.contains(s) || l((g) => ({ ...g, isOpen: !1 })));
56
- };
57
- document.addEventListener("mousedown", n), document.addEventListener("touchstart", n);
58
- const m = (r) => {
59
- r.target instanceof Node && N.current?.contains(r.target) || l((s) => ({ ...s, isOpen: !1 }));
60
- };
61
- return document.addEventListener("scroll", m, !0), window.addEventListener("resize", m), () => {
62
- document.removeEventListener("keydown", e, !0), document.removeEventListener("mousedown", n), document.removeEventListener("touchstart", n), document.removeEventListener("scroll", m, !0), window.removeEventListener("resize", m);
63
- };
64
- }, [t.isOpen, a]);
65
- const u = B(), D = (e) => {
66
- a || (f?.(e.value), l((n) => ({ ...n, isOpen: !1 })), c.current?.querySelector("button")?.focus());
67
- }, I = (e) => {
68
- e.preventDefault(), e.stopPropagation(), f?.(void 0), l((n) => ({ ...n, isOpen: !1 })), c.current?.querySelector("button")?.focus();
69
- }, P = () => {
70
- if (!a) {
71
- if (!t.isOpen && c.current) {
72
- const e = c.current.getBoundingClientRect(), n = 4, m = Math.min(320, y.length * 40 + 8), r = window.innerHeight - e.bottom - n, s = e.top - n, g = r < m && s > r, S = Math.min(e.width, window.innerWidth - n * 2);
73
- l({
74
- isOpen: !0,
75
- portalTarget: c.current.closest("dialog") ?? document.body,
76
- direction: g ? "up" : "down",
77
- left: Math.max(
78
- n,
79
- Math.min(e.left, window.innerWidth - S - n)
80
- ),
81
- width: S,
82
- maxHeight: Math.max(0, Math.min(320, g ? s : r)),
83
- top: g ? e.top : e.bottom
84
- });
85
- return;
86
- }
87
- l((e) => ({
88
- ...e,
89
- isOpen: !e.isOpen
90
- }));
91
- }
34
+ const { messages: $ } = A(), i = g.find((e) => e.value === n), u = P(null), [v, h] = w(!1), a = R(), I = (e) => {
35
+ o || (l?.(e.value), h(!1), u.current?.querySelector("button")?.focus());
36
+ }, F = (e) => {
37
+ e.preventDefault(), e.stopPropagation(), l?.(void 0), h(!1), u.current?.querySelector("button")?.focus();
92
38
  };
93
- return /* @__PURE__ */ p(w.Root, { className: H, children: [
94
- x && /* @__PURE__ */ i(w.Label, { htmlFor: u, label: x }),
95
- /* @__PURE__ */ i(w.Control, { size: E, children: /* @__PURE__ */ p(
39
+ return /* @__PURE__ */ r(m.Root, { open: v && !o, onOpenChange: h, children: /* @__PURE__ */ s(d.Root, { className: y, children: [
40
+ f && /* @__PURE__ */ r(d.Label, { htmlFor: a, label: f }),
41
+ /* @__PURE__ */ r(d.Control, { size: p, children: /* @__PURE__ */ r(m.Anchor, { children: /* @__PURE__ */ s(
96
42
  "div",
97
43
  {
98
- ref: c,
99
- className: O(o.root, {
100
- [o.error]: v,
101
- [o.disabled]: a
44
+ ref: u,
45
+ className: x(t.select, t[C], {
46
+ [t.error]: c,
47
+ [t.disabled]: o
102
48
  }),
103
49
  children: [
104
- /* @__PURE__ */ p("div", { className: O(o.select, o[T]), children: [
105
- /* @__PURE__ */ p(
106
- "button",
107
- {
108
- id: u,
109
- type: "button",
110
- className: o.trigger,
111
- onClick: P,
112
- disabled: a,
113
- "aria-expanded": t.isOpen,
114
- "aria-haspopup": "listbox",
115
- "aria-controls": t.isOpen ? `${u}-options` : void 0,
116
- "aria-invalid": v ? !0 : void 0,
117
- "aria-describedby": v ? `${u}-error` : void 0,
118
- children: [
119
- V(h, b),
120
- k && !(h && L) && /* @__PURE__ */ i(
121
- A,
122
- {
123
- size: U[E],
124
- className: o.arrow,
125
- "aria-hidden": "true"
126
- }
127
- )
128
- ]
129
- }
130
- ),
131
- h && L && /* @__PURE__ */ i(
132
- W,
133
- {
134
- size: E,
135
- color: "secondary",
136
- onClick: I,
137
- className: o.clear,
138
- disabled: a,
139
- "aria-label": $.clear,
140
- children: /* @__PURE__ */ i(K, {})
141
- }
142
- )
143
- ] }),
144
- t.isOpen && !a && j(
145
- /* @__PURE__ */ i(
146
- M,
147
- {
148
- ref: N,
149
- id: `${u}-options`,
150
- role: "listbox",
151
- "aria-label": x ?? b,
152
- direction: "col",
153
- gap: "xs",
154
- className: O(o.dropdown),
155
- style: {
156
- position: "fixed",
157
- left: t.left,
158
- top: t.direction === "down" ? t.top + 4 : t.top - 4,
159
- width: t.width,
160
- maxHeight: t.maxHeight,
161
- transform: t.direction === "up" ? "translateY(-100%)" : void 0
162
- },
163
- children: y.map((e) => /* @__PURE__ */ i(
164
- "button",
50
+ /* @__PURE__ */ r(m.Trigger, { children: /* @__PURE__ */ s(
51
+ "button",
52
+ {
53
+ id: a,
54
+ type: "button",
55
+ className: t.trigger,
56
+ disabled: o,
57
+ "aria-expanded": v && !o,
58
+ "aria-haspopup": "listbox",
59
+ "aria-controls": v && !o ? `${a}-options` : void 0,
60
+ "aria-invalid": c ? !0 : void 0,
61
+ "aria-describedby": c ? `${a}-error` : void 0,
62
+ children: [
63
+ _(i, N),
64
+ b && !(i && S) && /* @__PURE__ */ r(
65
+ D,
165
66
  {
166
- role: "option",
167
- "aria-selected": h?.value === e.value,
168
- onClick: () => D(e),
169
- type: "button",
170
- className: h?.value === e.value ? o.active : void 0,
171
- children: /* @__PURE__ */ p(M, { alignItems: "center", children: [
172
- e.icon,
173
- e.label ?? String(e.value ?? "")
174
- ] })
175
- },
176
- `${typeof e.value}:${String(e.value)}`
177
- ))
178
- }
179
- ),
180
- t.portalTarget ?? document.body
67
+ size: T[p],
68
+ className: t.arrow,
69
+ "aria-hidden": "true"
70
+ }
71
+ )
72
+ ]
73
+ }
74
+ ) }),
75
+ i && S && /* @__PURE__ */ r(
76
+ k,
77
+ {
78
+ size: p,
79
+ color: "secondary",
80
+ onClick: F,
81
+ className: t.clear,
82
+ disabled: o,
83
+ "aria-label": $.clear,
84
+ children: /* @__PURE__ */ r(E, {})
85
+ }
86
+ ),
87
+ /* @__PURE__ */ r(
88
+ m.Content,
89
+ {
90
+ container: u.current?.closest("dialog"),
91
+ role: "listbox",
92
+ align: "start",
93
+ sideOffset: 4,
94
+ id: `${a}-options`,
95
+ "aria-label": f ?? N,
96
+ className: t.dropdown,
97
+ children: g.map((e) => /* @__PURE__ */ r(
98
+ "button",
99
+ {
100
+ role: "option",
101
+ "aria-selected": i?.value === e.value,
102
+ onClick: () => I(e),
103
+ type: "button",
104
+ className: i?.value === e.value ? t.active : void 0,
105
+ children: /* @__PURE__ */ s(j, { alignItems: "center", children: [
106
+ e.icon,
107
+ e.label ?? String(e.value ?? "")
108
+ ] })
109
+ },
110
+ `${typeof e.value}:${String(e.value)}`
111
+ ))
112
+ }
181
113
  )
182
114
  ]
183
115
  }
184
- ) }),
185
- v && /* @__PURE__ */ i(w.Error, { id: `${u}-error`, error: v })
186
- ] });
116
+ ) }) }),
117
+ c && /* @__PURE__ */ r(d.Error, { id: `${a}-error`, error: c })
118
+ ] }) });
187
119
  };
188
120
  export {
189
- ie as Select
121
+ U as Select
190
122
  };
@@ -1,31 +1,29 @@
1
- const o = "_root_1flo3_2", l = "_select_1flo3_8", _ = "_filled_1flo3_20", e = "_outlined_1flo3_25", r = "_trigger_1flo3_29", t = "_value_1flo3_45", c = "_arrow_1flo3_54", d = "_clear_1flo3_59", s = "_placeholder_1flo3_64", a = "_disabled_1flo3_69", n = "_active_1flo3_80", f = "_error_1flo3_85", i = "_dropdown_1flo3_91", p = {
2
- root: o,
3
- select: l,
4
- filled: _,
5
- outlined: e,
6
- trigger: r,
1
+ const e = "_select_1y7vn_2", _ = "_disabled_1y7vn_18", o = "_error_1y7vn_18", n = "_outlined_1y7vn_22", r = "_filled_1y7vn_26", l = "_trigger_1y7vn_35", t = "_value_1y7vn_51", c = "_arrow_1y7vn_60", d = "_clear_1y7vn_65", s = "_placeholder_1y7vn_70", a = "_active_1y7vn_87", v = "_dropdown_1y7vn_96", i = {
2
+ select: e,
3
+ disabled: _,
4
+ error: o,
5
+ outlined: n,
6
+ filled: r,
7
+ trigger: l,
7
8
  value: t,
8
9
  arrow: c,
9
10
  clear: d,
10
11
  placeholder: s,
11
- disabled: a,
12
- active: n,
13
- error: f,
14
- dropdown: i
12
+ active: a,
13
+ dropdown: v
15
14
  };
16
15
  export {
17
- n as active,
16
+ a as active,
18
17
  c as arrow,
19
18
  d as clear,
20
- p as default,
21
- a as disabled,
22
- i as dropdown,
23
- f as error,
24
- _ as filled,
25
- e as outlined,
19
+ i as default,
20
+ _ as disabled,
21
+ v as dropdown,
22
+ o as error,
23
+ r as filled,
24
+ n as outlined,
26
25
  s as placeholder,
27
- o as root,
28
- l as select,
29
- r as trigger,
26
+ e as select,
27
+ l as trigger,
30
28
  t as value
31
29
  };
@@ -0,0 +1,18 @@
1
+ import { type ComponentProps, type PropsWithChildren } from "react";
2
+ import { Tooltip as Primitive } from "radix-ui";
3
+ type Side = NonNullable<ComponentProps<typeof Primitive.Content>["side"]>;
4
+ type Placement = Side | `${Side}-start` | `${Side}-end`;
5
+ export interface TooltipRootProps extends PropsWithChildren {
6
+ placement?: Placement;
7
+ delay?: number;
8
+ disabled?: boolean;
9
+ }
10
+ export type TooltipTriggerProps = ComponentProps<typeof Primitive.Trigger>;
11
+ export type TooltipContentProps = ComponentProps<typeof Primitive.Content>;
12
+ export declare const Tooltip: {
13
+ Root: ({ children, placement, delay, disabled, }: TooltipRootProps) => import("react").JSX.Element;
14
+ Trigger: ({ ref, ...props }: TooltipTriggerProps) => import("react").JSX.Element;
15
+ Content: ({ className, sideOffset, collisionPadding, ...props }: TooltipContentProps) => import("react").JSX.Element;
16
+ };
17
+ export {};
18
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/ui/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACvB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAMhD,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;AA2B3E,eAAO,MAAM,OAAO;sDAxDjB,gBAAgB;iCAsBiB,mBAAmB;qEAcpD,mBAAmB;CAoB2B,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { useContext as a, useState as g, useMemo as d, createContext as u } from "react";
4
+ import { Tooltip as i } from "radix-ui";
5
+ import { useComposedRefs as C } from "@radix-ui/react-compose-refs";
6
+ import { twMerge as T } from "tailwind-merge";
7
+ import { Portal as h } from "../Portal/Portal.js";
8
+ import x from "./Tooltip.module.css.js";
9
+ const p = u({}), R = ({
10
+ children: e,
11
+ placement: o = "top",
12
+ delay: r = 250,
13
+ disabled: n = !1
14
+ }) => {
15
+ const [c, l] = g(!1), [s, m] = g(null), f = d(
16
+ () => ({ placement: o, trigger: s, setTrigger: m }),
17
+ [o, s]
18
+ );
19
+ return /* @__PURE__ */ t(p.Provider, { value: f, children: /* @__PURE__ */ t(i.Provider, { delayDuration: r, children: /* @__PURE__ */ t(i.Root, { open: c && !n, onOpenChange: l, children: e }) }) });
20
+ }, v = ({ ref: e, ...o }) => {
21
+ const { setTrigger: r } = a(p), n = C(r, e);
22
+ return /* @__PURE__ */ t(i.Trigger, { asChild: !0, ref: n, ...o });
23
+ }, P = ({
24
+ className: e,
25
+ sideOffset: o = 8,
26
+ collisionPadding: r = 8,
27
+ ...n
28
+ }) => {
29
+ const { placement: c, trigger: l } = a(p), [s, m = "center"] = c.split("-");
30
+ return /* @__PURE__ */ t(h, { container: l?.closest("dialog"), children: /* @__PURE__ */ t(
31
+ i.Content,
32
+ {
33
+ side: s,
34
+ align: m,
35
+ sideOffset: o,
36
+ collisionPadding: r,
37
+ className: T(x.content, e),
38
+ ...n
39
+ }
40
+ ) });
41
+ }, S = { Root: R, Trigger: v, Content: P };
42
+ export {
43
+ S as Tooltip
44
+ };
@@ -0,0 +1,7 @@
1
+ const t = "_content_r1cxn_2", n = {
2
+ content: t
3
+ };
4
+ export {
5
+ t as content,
6
+ n as default
7
+ };
@@ -1,4 +1,7 @@
1
1
  export { Text, type TextProps } from "./Text/Text.js";
2
+ export { Portal, type PortalProps } from "./Portal/Portal.js";
3
+ export { Popover, type PopoverRootProps, type PopoverTriggerProps, type PopoverContentProps, } from "./Popover/Popover.js";
4
+ export { Tooltip, type TooltipRootProps, type TooltipTriggerProps, type TooltipContentProps, } from "./Tooltip/Tooltip.js";
2
5
  export { Flex, type FlexProps } from "./Flex/Flex.js";
3
6
  export { Button, type ButtonProps } from "./Button/Button.js";
4
7
  export { Card, type CardProps } from "./Card/Card.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EACL,IAAI,EACJ,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,eAAe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,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EACL,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@divayth/brick-ui",
3
- "version": "0.0.14",
3
+ "version": "0.1.0",
4
4
  "description": "React components for Brick UI",
5
5
  "type": "module",
6
6
  "files": [
7
- "dist"
7
+ "dist",
8
+ "src/theme.css"
8
9
  ],
9
10
  "sideEffects": [
10
11
  "**/*.css"
@@ -14,7 +15,8 @@
14
15
  "types": "./dist/index.d.ts",
15
16
  "import": "./dist/index.js"
16
17
  },
17
- "./styles.css": "./dist/styles.css"
18
+ "./styles.css": "./dist/styles.css",
19
+ "./theme.css": "./src/theme.css"
18
20
  },
19
21
  "scripts": {
20
22
  "build": "vite build && tsc -p tsconfig.build.json",
@@ -28,8 +30,11 @@
28
30
  "react-dom": "^19.0.0"
29
31
  },
30
32
  "dependencies": {
33
+ "@radix-ui/react-compose-refs": "^1.1.5",
34
+ "radix-ui": "^1.8.1",
31
35
  "clsx": "^2.1.1",
32
36
  "dayjs": "^1.11.23",
37
+ "js-cookie": "^3.0.8",
33
38
  "lucide-react": "^1.57.0",
34
39
  "react-day-picker": "^10.0.2",
35
40
  "tailwind-merge": "^3.7.0"
@@ -39,6 +44,7 @@
39
44
  "@storybook/addon-docs": "^10.3.6",
40
45
  "@storybook/react-vite": "^10.3.6",
41
46
  "@tailwindcss/vite": "^4.0.0",
47
+ "@types/js-cookie": "^3.0.6",
42
48
  "@types/node": "^22.0.0",
43
49
  "@types/react": "^19.0.0",
44
50
  "@types/react-dom": "^19.0.0",
package/src/theme.css ADDED
@@ -0,0 +1,30 @@
1
+ @theme static {
2
+ --color-primary-1: #365dcc;
3
+ --color-primary-2: #365dcc52;
4
+ --color-primary-3: #edf1ff;
5
+ --color-primary-hover: #2e50b8;
6
+ --color-primary-solid: var(--color-primary-1);
7
+ --color-primary-solid-hover: var(--color-primary-hover);
8
+ --color-primary-text-inverted: #ffffff;
9
+ --color-error-1: #c9363e;
10
+ --color-error-2: #c9363e52;
11
+ --color-error-3: #fff0f0;
12
+ --color-info-1: #3068b2;
13
+ --color-info-2: #3068b252;
14
+ --color-info-3: #edf4ff;
15
+ --color-success-1: #18794e;
16
+ --color-success-2: #18794e52;
17
+ --color-success-3: #eaf7ee;
18
+ --color-warning-1: #99620f;
19
+ --color-warning-2: #99620f52;
20
+ --color-warning-3: #fff5df;
21
+ --color-gray-1: #626875;
22
+ --color-gray-2: #dce0e8;
23
+ --color-gray-3: #f0f2f6;
24
+ --color-background-primary: #ffffff;
25
+ --color-background-secondary: #f6f7fb;
26
+ --color-text-primary: #20232d;
27
+ --color-disabled-background: #f2f2f2;
28
+ --color-disabled-border: #dedede;
29
+ --color-disabled-text: #808080;
30
+ }
@@ -1,35 +0,0 @@
1
- export declare const defaultThemes: {
2
- light: {};
3
- dark: {
4
- colorScheme: "dark";
5
- "background-primary": string;
6
- "background-secondary": string;
7
- "text-primary": string;
8
- "disabled-background": string;
9
- "disabled-border": string;
10
- "disabled-text": string;
11
- "gray-1": string;
12
- "gray-2": string;
13
- "gray-3": string;
14
- "primary-1": string;
15
- "primary-2": string;
16
- "primary-3": string;
17
- "primary-hover": string;
18
- "primary-solid": string;
19
- "primary-solid-hover": string;
20
- "primary-text-inverted": string;
21
- "error-1": string;
22
- "error-2": string;
23
- "error-3": string;
24
- "info-1": string;
25
- "info-2": string;
26
- "info-3": string;
27
- "success-1": string;
28
- "success-2": string;
29
- "success-3": string;
30
- "warning-1": string;
31
- "warning-2": string;
32
- "warning-3": string;
33
- };
34
- };
35
- //# sourceMappingURL=defaultThemes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaultThemes.d.ts","sourceRoot":"","sources":["../../src/lib/defaultThemes.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCN,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { CSSProperties } from "react";
2
- import { defaultThemes } from "./defaultThemes.js";
3
- import type { ThemeMap } from "./themes.js";
4
- export declare const THEME_COOKIE = "theme";
5
- export type Theme = keyof typeof defaultThemes;
6
- export declare const getThemeStyle: (theme: string, themes?: ThemeMap) => CSSProperties;
7
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/lib/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,YAAY,UAAU,CAAC;AACpC,MAAM,MAAM,KAAK,GAAG,MAAM,OAAO,aAAa,CAAC;AAE/C,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,EAAE,SAAS,QAAQ,KAAG,aAWhE,CAAC"}
package/dist/lib/theme.js DELETED
@@ -1,15 +0,0 @@
1
- import { defaultThemes as l } from "./defaultThemes.js";
2
- const a = "theme", i = (e, o) => {
3
- const t = l[e], { colorScheme: r = e === "dark" ? "dark" : "light", ...c } = {
4
- ...t,
5
- ...o?.[e]
6
- };
7
- return {
8
- colorScheme: r,
9
- ...Object.fromEntries(Object.entries(c).map(([s, n]) => [`--color-${s}`, n]))
10
- };
11
- };
12
- export {
13
- a as THEME_COOKIE,
14
- i as getThemeStyle
15
- };