@yourbestsoft/studio-screen-ui-kit 0.0.3 → 0.0.4

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.
@@ -1,500 +0,0 @@
1
- import { jsx as n, jsxs as m, Fragment as H } from "react/jsx-runtime";
2
- import i from "classnames";
3
- import K, { forwardRef as p, createContext as B, useState as R, useRef as I, useEffect as E, useContext as D } from "react";
4
- import { Eye as X, EyeOff as G, X as J, Search as Q } from "lucide-react";
5
- const U = "_text_4m304_1", Y = "_tertiary_4m304_1", Z = "_secondary_4m304_1", tt = "_primary_4m304_1", et = "_fullWidth_4m304_50", ot = "_buttonWithIcon_4m304_54", nt = "_content_4m304_61", st = "_shortcut_4m304_70", rt = "_disabled_4m304_82", f = {
6
- text: U,
7
- tertiary: Y,
8
- secondary: Z,
9
- primary: tt,
10
- fullWidth: et,
11
- buttonWithIcon: ot,
12
- content: nt,
13
- shortcut: st,
14
- disabled: rt
15
- }, ct = ({
16
- children: t,
17
- className: e,
18
- component: o = "button",
19
- disabled: r,
20
- fullWidth: c,
21
- icon: s,
22
- shortcut: a,
23
- variant: _ = "primary",
24
- ...d
25
- }, l) => {
26
- const g = /* @__PURE__ */ m("div", { className: f.buttonWithIcon, children: [
27
- /* @__PURE__ */ m("div", { className: f.content, children: [
28
- s,
29
- t
30
- ] }),
31
- /* @__PURE__ */ n("div", { className: f.shortcut, children: a })
32
- ] });
33
- return /* @__PURE__ */ n(
34
- o,
35
- {
36
- className: i(
37
- f[_],
38
- c && f.fullWidth,
39
- r && f.disabled,
40
- s && f.icon,
41
- e
42
- ),
43
- children: s ? g : t,
44
- disabled: r,
45
- ref: l,
46
- ...d
47
- }
48
- );
49
- }, Ee = p(ct), at = "_content_23x5h_1", it = "_header_23x5h_1", lt = "_root_23x5h_7", dt = "_contentAfterHeader_23x5h_22", T = {
50
- content: at,
51
- header: it,
52
- root: lt,
53
- contentAfterHeader: dt
54
- }, q = p(
55
- ({ className: t, ...e }, o) => /* @__PURE__ */ n("div", { className: i(T.root, t), ref: o, ...e })
56
- ), _t = p(
57
- ({ className: t, ignoreHeader: e, ...o }, r) => /* @__PURE__ */ n(
58
- "div",
59
- {
60
- className: i(
61
- T.content,
62
- !e && T.contentAfterHeader,
63
- t
64
- ),
65
- ref: r,
66
- ...o
67
- }
68
- )
69
- ), ut = p(
70
- ({ className: t, ...e }, o) => /* @__PURE__ */ n("div", { className: i(T.header, t), ref: o, ...e })
71
- ), Ie = Object.assign(q, {
72
- Content: _t,
73
- Header: ut,
74
- Root: q
75
- }), ht = "_root_1xfv8_1", gt = "_dropdownContent_1xfv8_6", mt = "_left_1xfv8_17", pt = "_center_1xfv8_21", bt = "_right_1xfv8_26", ft = "_top_1xfv8_30", Ct = "_bottom_1xfv8_34", vt = "_fixedPosition_1xfv8_38", k = {
76
- root: ht,
77
- dropdownContent: gt,
78
- left: mt,
79
- center: pt,
80
- right: bt,
81
- top: ft,
82
- bottom: Ct,
83
- fixedPosition: vt
84
- }, A = B(
85
- void 0
86
- ), V = () => {
87
- const t = D(A);
88
- if (!t)
89
- throw new Error("useDropDownContext must be used within a DropDown.Root");
90
- return t;
91
- }, x = [], wt = ({
92
- children: t,
93
- closeOnEsc: e = !0,
94
- closeOnOutsideClick: o = !0,
95
- defaultVisible: r = !1
96
- }) => {
97
- const [c, s] = R(r), a = I(null), _ = () => {
98
- c ? d() : (s(!0), a.current && x.push(a.current));
99
- }, d = () => {
100
- if (s(!1), a.current) {
101
- const l = x.indexOf(a.current);
102
- l !== -1 && x.splice(l, 1);
103
- }
104
- };
105
- return E(() => {
106
- if (!o) return;
107
- const l = (g) => {
108
- a.current && !a.current.contains(g.target) && d();
109
- };
110
- return document.addEventListener("mousedown", l), () => {
111
- document.removeEventListener("mousedown", l);
112
- };
113
- }, [o]), E(() => {
114
- if (!e) return;
115
- const l = (g) => {
116
- g.key === "Escape" && c && x[x.length - 1] === a.current && d();
117
- };
118
- return document.addEventListener("keydown", l), () => {
119
- document.removeEventListener("keydown", l);
120
- };
121
- }, [e, c]), /* @__PURE__ */ n(A.Provider, { value: { close: d, toggle: _, visible: c }, children: /* @__PURE__ */ n("div", { ref: a, className: k.root, children: t }) });
122
- }, Nt = ({ children: t }) => {
123
- const { toggle: e } = V();
124
- return /* @__PURE__ */ n("div", { onClick: e, children: t });
125
- }, xt = ({
126
- children: t,
127
- className: e,
128
- fixedPosition: o = !1,
129
- horizontal: r = "left",
130
- vertical: c = "bottom"
131
- }) => {
132
- const { visible: s } = V();
133
- return s ? /* @__PURE__ */ n(
134
- "div",
135
- {
136
- className: i(
137
- k.dropdownContent,
138
- k[r],
139
- k[c],
140
- { [k.fixedPosition]: o },
141
- e
142
- ),
143
- children: t
144
- }
145
- ) : null;
146
- }, Pe = { Content: xt, Root: wt, Trigger: Nt }, kt = "_dialogRoot_c30vs_1", yt = "_dialogTrigger_c30vs_5", Rt = "_dialogContent_c30vs_13", Dt = "_dialogClose_c30vs_25", Tt = "_dialogTitle_c30vs_33", $t = "_dialogSeparator_c30vs_38", v = {
147
- dialogRoot: kt,
148
- dialogTrigger: yt,
149
- dialogContent: Rt,
150
- dialogClose: Dt,
151
- dialogTitle: Tt,
152
- dialogSeparator: $t
153
- }, $ = K.createContext(null), St = ({
154
- children: t,
155
- isOpen: e,
156
- onStateChange: o
157
- }) => {
158
- const r = I(null), [c, s] = R(!1), a = e !== void 0 ? e : c, _ = (d) => {
159
- e === void 0 && s(d), o && o(d);
160
- };
161
- return /* @__PURE__ */ n($.Provider, { value: { dialogRef: r, isOpen: a, setIsOpen: _ }, children: /* @__PURE__ */ n("div", { className: v.dialogRoot, children: t }) });
162
- }, Ot = ({
163
- as: t,
164
- children: e,
165
- ...o
166
- }) => {
167
- const r = D($);
168
- if (!r) throw new Error("Trigger must be used within a Dialog.Root");
169
- const { dialogRef: c, setIsOpen: s } = r;
170
- return /* @__PURE__ */ n(
171
- t || "button",
172
- {
173
- onClick: () => {
174
- c.current?.showModal(), s(!0);
175
- },
176
- ...o,
177
- className: v.dialogTrigger,
178
- role: t && t !== "button" ? "button" : void 0,
179
- children: e
180
- }
181
- );
182
- }, Wt = p(
183
- ({ children: t, className: e, closeOnBackdropClick: o = !0 }, r) => {
184
- const c = D($);
185
- if (!c) throw new Error("Content must be used within a Dialog.Root");
186
- const { dialogRef: s, isOpen: a, setIsOpen: _ } = c, d = (l) => {
187
- o && l.target === s.current && (s.current?.close(), _(!1));
188
- };
189
- return /* @__PURE__ */ n(
190
- "dialog",
191
- {
192
- ref: s,
193
- className: i(v.dialogContent, e),
194
- onClick: d,
195
- open: a,
196
- children: /* @__PURE__ */ n("div", { onClick: (l) => l.stopPropagation(), children: t })
197
- }
198
- );
199
- }
200
- ), Et = ({
201
- as: t,
202
- children: e,
203
- ...o
204
- }) => {
205
- const r = D($);
206
- if (!r) throw new Error("Close must be used within a Dialog.Root");
207
- const { dialogRef: c, setIsOpen: s } = r;
208
- return /* @__PURE__ */ n(
209
- t || "button",
210
- {
211
- onClick: () => {
212
- c.current?.close(), s(!1);
213
- },
214
- ...o,
215
- className: v.dialogClose,
216
- role: t && t !== "button" ? "button" : void 0,
217
- children: e
218
- }
219
- );
220
- }, It = ({ children: t, className: e }) => /* @__PURE__ */ n("h2", { className: i(v.dialogTitle, e), children: t }), Pt = ({}) => /* @__PURE__ */ n("div", { className: v.dialogSeparator }), Le = {
221
- Close: Et,
222
- Content: Wt,
223
- Root: St,
224
- Separator: Pt,
225
- Title: It,
226
- Trigger: Ot
227
- }, Lt = "_sidebar_dg2au_12", qt = "_trigger_dg2au_16", Ft = "_content_dg2au_21", Ht = "_left_dg2au_34", Bt = "_open_dg2au_38", At = "_right_dg2au_42", Vt = "_bottom_dg2au_50", Mt = "_top_dg2au_63", C = {
228
- sidebar: Lt,
229
- trigger: qt,
230
- content: Ft,
231
- left: Ht,
232
- open: Bt,
233
- right: At,
234
- bottom: Vt,
235
- top: Mt
236
- }, M = B(
237
- void 0
238
- ), P = () => {
239
- const t = D(M);
240
- if (!t)
241
- throw new Error("useSidebarContext must be used within a SidebarProvider");
242
- return t;
243
- }, jt = ({ children: t, isOpen: e, setIsOpen: o }) => {
244
- const [r, c] = R(e);
245
- return /* @__PURE__ */ n(
246
- M.Provider,
247
- {
248
- value: {
249
- isOpen: r,
250
- setIsOpen: (s) => {
251
- c(s), o(s);
252
- }
253
- },
254
- children: t
255
- }
256
- );
257
- }, zt = ({ children: t }) => {
258
- const { setIsOpen: e } = P(), o = (r) => {
259
- r.preventDefault(), e(!0);
260
- };
261
- return /* @__PURE__ */ n("div", { className: C.trigger, onClick: o, children: t });
262
- }, Kt = ({
263
- children: t,
264
- className: e,
265
- closeOnOutsideClick: o = !0,
266
- position: r = "right"
267
- }) => {
268
- const { isOpen: c, setIsOpen: s } = P(), a = I(null);
269
- return E(() => {
270
- if (!o) return;
271
- const _ = (d) => {
272
- a.current && !a.current.contains(d.target) && s(!1);
273
- };
274
- return c && document.addEventListener("mousedown", _), () => {
275
- document.removeEventListener("mousedown", _);
276
- };
277
- }, [c, s, o]), /* @__PURE__ */ n(
278
- "div",
279
- {
280
- ref: a,
281
- className: i(
282
- C[r],
283
- C.content,
284
- {
285
- [C.close]: !c,
286
- [C.open]: c
287
- },
288
- e
289
- ),
290
- children: t
291
- }
292
- );
293
- }, Xt = ({ children: t }) => {
294
- const { setIsOpen: e } = P(), o = (r) => {
295
- r.preventDefault(), e(!1);
296
- };
297
- return /* @__PURE__ */ n("button", { className: C.close, onClick: o, children: t });
298
- }, qe = {
299
- Close: Xt,
300
- Content: Kt,
301
- Root: jt,
302
- Trigger: zt
303
- }, Gt = "_switcher_k6tdq_1", Jt = "_buttons_k6tdq_6", Qt = "_separator_k6tdq_10", W = {
304
- switcher: Gt,
305
- buttons: Jt,
306
- separator: Qt
307
- }, Fe = p(
308
- ({
309
- className: t,
310
- component: e,
311
- componentValues: o,
312
- containerProps: r,
313
- onChange: c,
314
- selectedValue: s,
315
- slot: a
316
- }, _) => {
317
- const [d, l] = R(
318
- s || o[0].value
319
- ), g = (h) => {
320
- l(h), c && c(h);
321
- };
322
- return /* @__PURE__ */ m("div", { ref: _, className: W.switcher, ...r, children: [
323
- /* @__PURE__ */ n("div", { className: i(W.buttons, t), children: o.map((h, w) => /* @__PURE__ */ n(
324
- e,
325
- {
326
- ...h,
327
- selected: d === h.value,
328
- onClick: () => g(h.value)
329
- },
330
- w
331
- )) }),
332
- a && /* @__PURE__ */ m(H, { children: [
333
- /* @__PURE__ */ n("div", { className: W.separator }),
334
- a
335
- ] })
336
- ] });
337
- }
338
- ), Ut = "_root_w2o37_13", Yt = "_header_w2o37_19", Zt = "_footer_w2o37_23", te = "_row_w2o37_28", ee = "_body_w2o37_40", oe = "_head_w2o37_19", ne = "_cell_w2o37_47", se = "_caption_w2o37_64", re = "_storiesFooterCellOne_w2o37_69", ce = "_storiesFooterCellTwo_w2o37_72", b = {
339
- root: Ut,
340
- header: Yt,
341
- footer: Zt,
342
- row: te,
343
- body: ee,
344
- head: oe,
345
- cell: ne,
346
- caption: se,
347
- storiesFooterCellOne: re,
348
- storiesFooterCellTwo: ce
349
- }, F = ({ children: t, className: e }) => /* @__PURE__ */ n("table", { className: i(b.root, e), children: t }), ae = ({ children: t, className: e }) => /* @__PURE__ */ n("caption", { className: i(b.caption, e), children: t }), ie = ({ children: t, className: e }) => /* @__PURE__ */ n("thead", { className: i(b.header, e), children: t }), le = ({ children: t, className: e, onClick: o }) => /* @__PURE__ */ n("tr", { className: i(b.row, e), onClick: o, children: t }), de = ({ children: t, className: e }) => /* @__PURE__ */ n("th", { className: i(b.head, e), children: t }), _e = ({ children: t, className: e }) => /* @__PURE__ */ n("tbody", { className: i(b.body, e), children: t }), ue = ({ children: t, className: e }) => /* @__PURE__ */ n("td", { className: i(b.cell, e), children: t }), he = ({ children: t, className: e }) => /* @__PURE__ */ n("tfoot", { className: i(b.footer, e), children: t }), He = Object.assign(F, {
350
- Body: _e,
351
- Caption: ae,
352
- Cell: ue,
353
- Footer: he,
354
- Head: de,
355
- Header: ie,
356
- Root: F,
357
- Row: le
358
- }), ge = "_inputContainer_iqbs3_1", me = "_input_iqbs3_1", pe = "_inputSearch_iqbs3_40", be = "_error_iqbs3_43", fe = "_button_iqbs3_58", Ce = "_buttonWithLabel_iqbs3_68", ve = "_resetSearchValue_iqbs3_73", we = "_searchOutline_iqbs3_80", Ne = "_errorMessage_iqbs3_87", u = {
359
- inputContainer: ge,
360
- input: me,
361
- inputSearch: pe,
362
- error: be,
363
- button: fe,
364
- buttonWithLabel: Ce,
365
- resetSearchValue: ve,
366
- searchOutline: we,
367
- errorMessage: Ne
368
- }, Be = p(({ className: t, error: e, label: o, onChange: r, required: c, ...s }, a) => {
369
- const [_, d] = R(!1), l = (w) => r(w.currentTarget.value), g = i(u.input, e && u.error, t);
370
- let h;
371
- if (!s.as || s.as === "input") {
372
- const { as: w, inputType: N, ...j } = s, S = N === "search", L = N === "password", z = _ ? "text" : "password";
373
- h = /* @__PURE__ */ m(H, { children: [
374
- /* @__PURE__ */ n(
375
- "input",
376
- {
377
- className: i(g, S && u.inputSearch),
378
- onChange: l,
379
- ref: a,
380
- type: L ? z : N,
381
- ...j
382
- }
383
- ),
384
- L && (_ ? /* @__PURE__ */ n(
385
- X,
386
- {
387
- strokeWidth: 2.5,
388
- width: 20,
389
- className: i(u.button, o && u.buttonWithLabel),
390
- onClick: () => d((O) => !O)
391
- }
392
- ) : /* @__PURE__ */ n(
393
- G,
394
- {
395
- strokeWidth: 2.5,
396
- width: 20,
397
- className: i(u.button, o && u.buttonWithLabel),
398
- onClick: () => d((O) => !O)
399
- }
400
- )),
401
- S && s.value && /* @__PURE__ */ n(
402
- J,
403
- {
404
- onClick: () => r(""),
405
- className: i(
406
- u.button,
407
- o && u.buttonWithLabel,
408
- u.resetSearchValue
409
- ),
410
- strokeWidth: 2.5,
411
- size: 24
412
- }
413
- ),
414
- S && /* @__PURE__ */ n(
415
- Q,
416
- {
417
- className: i(
418
- u.searchOutline,
419
- o && u.searchOutlineWithLabel
420
- ),
421
- size: 20
422
- }
423
- )
424
- ] });
425
- }
426
- if (s.as === "textarea") {
427
- const { as: w, ...N } = s;
428
- h = /* @__PURE__ */ n(
429
- "textarea",
430
- {
431
- className: g,
432
- onChange: l,
433
- ref: a,
434
- ...N
435
- }
436
- );
437
- }
438
- return /* @__PURE__ */ m("div", { className: u.root, children: [
439
- /* @__PURE__ */ m("span", { className: u.title, children: [
440
- o,
441
- c && /* @__PURE__ */ n("span", { className: u.titleError, children: "*" })
442
- ] }),
443
- /* @__PURE__ */ n("div", { className: u.inputContainer, children: h }),
444
- /* @__PURE__ */ n("div", { className: u.errorMessage, children: e })
445
- ] });
446
- }), xe = "_root_17w6h_1", ke = "_icon_17w6h_11", ye = "_active_17w6h_27", Re = "_disabled_17w6h_31", De = "_keybinding_17w6h_44", y = {
447
- root: xe,
448
- icon: ke,
449
- active: ye,
450
- disabled: Re,
451
- keybinding: De
452
- }, Ae = p(
453
- (t, e) => {
454
- const { classes: o, disabled: r, icon: c, isActive: s, keybinding: a, onClick: _, title: d } = t, l = Te(o, s, r);
455
- return /* @__PURE__ */ m("label", { className: y.root, title: d, children: [
456
- /* @__PURE__ */ n(
457
- "div",
458
- {
459
- className: l.icon,
460
- ref: e,
461
- tabIndex: r ? -1 : 0,
462
- role: "button",
463
- "aria-pressed": s,
464
- "aria-disabled": r,
465
- onClick: r ? void 0 : _,
466
- children: c
467
- }
468
- ),
469
- a && /* @__PURE__ */ n("span", { className: l.keybinding, children: a })
470
- ] });
471
- }
472
- ), Te = (t, e, o) => ({
473
- icon: i(
474
- y.icon,
475
- {
476
- [y.active]: e,
477
- [y.disabled]: o
478
- },
479
- t?.icon
480
- ),
481
- keybinding: i(y.keybinding, t?.keybinding)
482
- });
483
- export {
484
- Ee as B,
485
- q as C,
486
- Pe as D,
487
- M as S,
488
- He as T,
489
- ct as a,
490
- _t as b,
491
- ut as c,
492
- Ie as d,
493
- Le as e,
494
- qe as f,
495
- Fe as g,
496
- Be as h,
497
- Ae as i,
498
- P as u
499
- };
500
- //# sourceMappingURL=ToolIconButton-CH5GeW9N.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ToolIconButton-CH5GeW9N.js","sources":["../src/components/button/Button.tsx","../src/components/card/Card.tsx","../src/components/drop-down/DropDown.tsx","../src/components/dialog/Dialog.tsx","../src/components/sidebar/Sidebar.tsx","../src/components/switcher-buttons/SwitcherButtons.tsx","../src/components/table/Table.tsx","../src/components/text-field/text-field.tsx","../src/components/toolbar/tool-icon-button/ToolIconButton.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport {\n ComponentPropsWithoutRef,\n ElementRef,\n ElementType,\n ForwardedRef,\n ReactNode,\n forwardRef,\n} from 'react'\n\nimport { Replace } from '../../utils'\nimport s from './button.module.scss'\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'text'\ntype OwnProps<T extends ElementType> = {\n children?: ReactNode\n className?: string\n component?: T\n disabled?: boolean\n fullWidth?: boolean\n variant?: ButtonVariant\n icon?: ReactNode\n shortcut?: string\n}\n\nexport type ButtonProps<T extends ElementType> = Replace<\n ComponentPropsWithoutRef<T>,\n OwnProps<T>\n>\n\ntype ButtonRenderType = {\n (\n props: ButtonProps<'button'>,\n ref?: ForwardedRef<ElementRef<'button'>>\n ): ReactNode\n (\n props: ButtonProps<ElementType>,\n ref?: ForwardedRef<ElementRef<ElementType>>\n ): ReactNode\n}\n\nexport type ButtonComponent = {\n <T extends ElementType = 'button'>(\n props: ButtonProps<T> & { ref?: ForwardedRef<ElementRef<T>> }\n ): ReactNode\n}\n\nexport const ButtonRender: ButtonRenderType = (\n {\n children,\n className,\n component: Component = 'button',\n disabled,\n fullWidth,\n icon,\n shortcut,\n variant = 'primary',\n ...props\n },\n ref\n) => {\n const content = (\n <div className={s.buttonWithIcon}>\n <div className={s.content}>\n {icon}\n {children}\n </div>\n <div className={s.shortcut}>{shortcut}</div>\n </div>\n )\n\n return (\n <Component\n className={classNames(\n s[variant],\n fullWidth && s.fullWidth,\n disabled && s.disabled,\n icon && s.icon,\n className\n )}\n children={icon ? content : children}\n disabled={disabled}\n ref={ref}\n {...props}\n />\n )\n}\n\nexport const Button: ButtonComponent = forwardRef(ButtonRender)\n","import classNames from 'classnames'\nimport { ComponentPropsWithoutRef, ElementRef, forwardRef } from 'react'\n\nimport s from './card.module.scss'\n\nexport type CardProps = ComponentPropsWithoutRef<'div'>\n\nexport const CardRoot = forwardRef<ElementRef<'div'>, CardProps>(\n ({ className, ...props }, ref) => (\n <div className={classNames(s.root, className)} ref={ref} {...props} />\n )\n)\n\nexport type CardContentProps = CardProps & { ignoreHeader?: boolean }\n\nexport const CardContent = forwardRef<ElementRef<'div'>, CardContentProps>(\n ({ className, ignoreHeader, ...props }, ref) => (\n <div\n className={classNames(\n s.content,\n !ignoreHeader && s.contentAfterHeader,\n className\n )}\n ref={ref}\n {...props}\n />\n )\n)\n\nexport const CardHeader = forwardRef<ElementRef<'div'>, CardProps>(\n ({ className, ...props }, ref) => (\n <div className={classNames(s.header, className)} ref={ref} {...props} />\n )\n)\n\nexport const Card = Object.assign(CardRoot, {\n Content: CardContent,\n Header: CardHeader,\n Root: CardRoot,\n})\n","import classNames from 'classnames'\nimport {\n createContext,\n ReactNode,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react'\n\nimport styles from './drop-down.module.scss'\n\ninterface DropDownContextType {\n visible: boolean\n toggle: () => void\n close: () => void\n}\n\nconst DropDownContext = createContext<DropDownContextType | undefined>(\n undefined\n)\n\nconst useDropDownContext = () => {\n const context = useContext(DropDownContext)\n if (!context) {\n throw new Error('useDropDownContext must be used within a DropDown.Root')\n }\n return context\n}\n\ninterface RootProps {\n children: ReactNode\n defaultVisible?: boolean\n closeOnOutsideClick?: boolean\n closeOnEsc?: boolean\n}\n\nconst openDropDownStack: HTMLElement[] = []\n\nconst Root = ({\n children,\n closeOnEsc = true,\n closeOnOutsideClick = true,\n defaultVisible = false,\n}: RootProps) => {\n const [visible, setVisible] = useState(defaultVisible)\n const rootRef = useRef<HTMLDivElement>(null)\n\n const toggle = () => {\n if (!visible) {\n setVisible(true)\n if (rootRef.current) {\n openDropDownStack.push(rootRef.current)\n }\n } else {\n close()\n }\n }\n\n const close = () => {\n setVisible(false)\n if (rootRef.current) {\n const index = openDropDownStack.indexOf(rootRef.current)\n if (index !== -1) {\n openDropDownStack.splice(index, 1)\n }\n }\n }\n\n useEffect(() => {\n if (!closeOnOutsideClick) return\n\n const handleClickOutside = (event: MouseEvent) => {\n if (rootRef.current && !rootRef.current.contains(event.target as Node)) {\n close()\n }\n }\n\n document.addEventListener('mousedown', handleClickOutside)\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [closeOnOutsideClick])\n\n useEffect(() => {\n if (!closeOnEsc) return\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape' && visible) {\n const lastDropDown = openDropDownStack[openDropDownStack.length - 1]\n if (lastDropDown === rootRef.current) {\n close()\n }\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n return () => {\n document.removeEventListener('keydown', handleKeyDown)\n }\n }, [closeOnEsc, visible])\n\n return (\n <DropDownContext.Provider value={{ close, toggle, visible }}>\n <div ref={rootRef} className={styles.root}>\n {children}\n </div>\n </DropDownContext.Provider>\n )\n}\n\ninterface TriggerProps {\n children: ReactNode\n}\n\nconst Trigger = ({ children }: TriggerProps) => {\n const { toggle } = useDropDownContext()\n return <div onClick={toggle}>{children}</div>\n}\n\ninterface ContentProps {\n children: ReactNode\n horizontal?: 'left' | 'center' | 'right'\n vertical?: 'top' | 'bottom'\n className?: string\n fixedPosition?: boolean\n}\n\nconst Content = ({\n children,\n className,\n fixedPosition = false,\n horizontal = 'left',\n vertical = 'bottom',\n}: ContentProps) => {\n const { visible } = useDropDownContext()\n\n if (!visible) return null\n\n return (\n <div\n className={classNames(\n styles.dropdownContent,\n styles[horizontal],\n styles[vertical],\n { [styles.fixedPosition]: fixedPosition },\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport const DropDown = { Content, Root, Trigger }\n","import classNames from 'classnames'\nimport React, {\n useState,\n useRef,\n ReactNode,\n forwardRef,\n MouseEvent,\n ElementType,\n useContext,\n} from 'react'\n\nimport styles from './dialog.module.scss'\n\ninterface RootProps {\n children: React.ReactNode\n isOpen?: boolean\n onStateChange?: (isOpen: boolean) => void\n}\n\ninterface DialogContextProps {\n dialogRef: React.RefObject<HTMLDialogElement>\n isOpen: boolean\n setIsOpen: (state: boolean) => void\n}\nconst DialogContext = React.createContext<DialogContextProps | null>(null)\n\nconst Root = ({\n children,\n isOpen: externalIsOpen,\n onStateChange,\n}: RootProps) => {\n const dialogRef = useRef<HTMLDialogElement | null>(null)\n const [internalIsOpen, setInternalIsOpen] = useState(false)\n\n const isOpen = externalIsOpen !== undefined ? externalIsOpen : internalIsOpen\n const setIsOpen = (state: boolean) => {\n if (externalIsOpen === undefined) {\n setInternalIsOpen(state)\n }\n if (onStateChange) {\n onStateChange(state)\n }\n }\n\n return (\n <DialogContext.Provider value={{ dialogRef, isOpen, setIsOpen }}>\n <div className={styles.dialogRoot}>{children}</div>\n </DialogContext.Provider>\n )\n}\n\ninterface TriggerProps<T extends ElementType = 'button'> {\n as?: T\n children: ReactNode\n}\n\nconst Trigger = <T extends ElementType = 'button'>({\n as,\n children,\n ...props\n}: TriggerProps<T> & React.ComponentPropsWithoutRef<T>) => {\n const context = useContext(DialogContext)\n if (!context) throw new Error('Trigger must be used within a Dialog.Root')\n\n const { dialogRef, setIsOpen } = context\n const Component = as || 'button'\n\n const handleClick = () => {\n dialogRef.current?.showModal()\n setIsOpen(true)\n }\n\n return (\n <Component\n onClick={handleClick}\n {...props}\n className={styles.dialogTrigger}\n role={as && as !== 'button' ? 'button' : undefined}\n >\n {children}\n </Component>\n )\n}\n\ninterface ContentProps {\n children: ReactNode\n className?: string\n closeOnBackdropClick?: boolean\n}\n\nconst Content = forwardRef<HTMLDialogElement, ContentProps>(\n ({ children, className, closeOnBackdropClick = true }, _) => {\n const context = useContext(DialogContext)\n if (!context) throw new Error('Content must be used within a Dialog.Root')\n\n const { dialogRef, isOpen, setIsOpen } = context\n\n const handleBackdropClick = (event: MouseEvent<HTMLDialogElement>) => {\n if (closeOnBackdropClick && event.target === dialogRef.current) {\n dialogRef.current?.close()\n setIsOpen(false)\n }\n }\n\n return (\n <dialog\n ref={dialogRef}\n className={classNames(styles.dialogContent, className)}\n onClick={handleBackdropClick}\n open={isOpen}\n >\n <div onClick={(e) => e.stopPropagation()}>{children}</div>\n </dialog>\n )\n }\n)\n\ninterface CloseProps<T extends ElementType = 'button'> {\n as?: T\n children?: ReactNode\n}\n\nconst Close = <T extends ElementType = 'button'>({\n as,\n children,\n ...props\n}: CloseProps<T> & React.ComponentPropsWithoutRef<T>) => {\n const context = useContext(DialogContext)\n if (!context) throw new Error('Close must be used within a Dialog.Root')\n\n const { dialogRef, setIsOpen } = context\n const Component = as || 'button'\n\n const handleClick = () => {\n dialogRef.current?.close()\n setIsOpen(false)\n }\n\n return (\n <Component\n onClick={handleClick}\n {...props}\n className={styles.dialogClose}\n role={as && as !== 'button' ? 'button' : undefined}\n >\n {children}\n </Component>\n )\n}\n\ninterface TitleProps {\n children: ReactNode\n className?: string\n}\n\nconst Title = ({ children, className }: TitleProps) => {\n return (\n <h2 className={classNames(styles.dialogTitle, className)}>{children}</h2>\n )\n}\n\ninterface SeparatorProps {}\n\nconst Separator = ({}: SeparatorProps) => {\n return <div className={styles.dialogSeparator} />\n}\n\nexport const Dialog = {\n Close,\n Content,\n Root,\n Separator,\n Title,\n Trigger,\n}\n","import classNames from 'classnames'\nimport {\n createContext,\n MouseEvent,\n ReactNode,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react'\n\nimport styles from './sidebar.module.scss'\n\ntype SidebarContextProps = {\n isOpen: boolean\n setIsOpen: (isOpen: boolean) => void\n}\n\nexport const SidebarContext = createContext<SidebarContextProps | undefined>(\n undefined\n)\n\nexport const useSidebarContext = () => {\n const context = useContext(SidebarContext)\n if (!context) {\n throw new Error('useSidebarContext must be used within a SidebarProvider')\n }\n return context\n}\n\ntype SidebarRootProps = {\n isOpen: boolean\n setIsOpen: (isOpen: boolean) => void\n children: ReactNode\n}\n\nconst Root = ({ children, isOpen, setIsOpen }: SidebarRootProps) => {\n const [opened, setOpened] = useState(isOpen)\n\n return (\n <SidebarContext.Provider\n value={{\n isOpen: opened,\n setIsOpen: (open) => {\n setOpened(open)\n setIsOpen(open)\n },\n }}\n >\n {children}\n </SidebarContext.Provider>\n )\n}\n\ntype SidebarTriggerProps = {\n children: ReactNode\n}\n\nconst Trigger = ({ children }: SidebarTriggerProps) => {\n const { setIsOpen } = useSidebarContext()\n\n const onClickHandler = (event: MouseEvent<HTMLDivElement>) => {\n event.preventDefault()\n setIsOpen(true)\n }\n\n return (\n <div className={styles.trigger} onClick={onClickHandler}>\n {children}\n </div>\n )\n}\n\ntype SidebarContentProps = {\n position?: 'left' | 'right' | 'bottom' | 'top'\n children: ReactNode\n className?: string\n closeOnOutsideClick?: boolean\n}\n\nconst Content = ({\n children,\n className,\n closeOnOutsideClick = true,\n position = 'right',\n}: SidebarContentProps) => {\n const { isOpen, setIsOpen } = useSidebarContext()\n const contentRef = useRef<HTMLDivElement | null>(null)\n\n useEffect(() => {\n if (!closeOnOutsideClick) return\n\n const handleClickOutside = (event: Event) => {\n if (\n contentRef.current &&\n !contentRef.current.contains(event.target as Node)\n ) {\n setIsOpen(false)\n }\n }\n\n if (isOpen) {\n document.addEventListener('mousedown', handleClickOutside)\n }\n\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [isOpen, setIsOpen, closeOnOutsideClick])\n\n return (\n <div\n ref={contentRef}\n className={classNames(\n styles[position],\n styles.content,\n {\n [styles.close]: !isOpen,\n [styles.open]: isOpen,\n },\n className\n )}\n >\n {children}\n </div>\n )\n}\n\ntype SidebarCloseProps = {\n children: ReactNode\n}\n\nconst Close = ({ children }: SidebarCloseProps) => {\n const { setIsOpen } = useSidebarContext()\n\n const onClickHandler = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault()\n setIsOpen(false)\n }\n\n return (\n <button className={styles.close} onClick={onClickHandler}>\n {children}\n </button>\n )\n}\n\nexport const Sidebar = {\n Close,\n Content,\n Root,\n Trigger,\n}\n","import classNames from 'classnames'\nimport React, { ElementType, forwardRef, ReactNode, useState } from 'react'\n\nimport style from './switcher-buttons.module.scss'\n\ninterface ComponentValues {\n value: string\n [key: string]: any\n}\n\ninterface SwitcherProps {\n componentValues: ComponentValues[]\n defaultValue?: string\n onChange?: (value: string) => void\n selectedValue?: string\n component: ElementType\n containerProps?: React.HTMLAttributes<HTMLDivElement>\n slot?: ReactNode\n className?: string\n}\n\nexport const SwitcherButtons = forwardRef<HTMLDivElement, SwitcherProps>(\n (\n {\n className,\n component: Component,\n componentValues,\n containerProps,\n onChange,\n selectedValue,\n slot,\n },\n ref\n ) => {\n const [activeValue, setActiveValue] = useState<string>(\n selectedValue || componentValues[0].value\n )\n\n const onChangeHandler = (value: string) => {\n setActiveValue(value)\n if (onChange) onChange(value)\n }\n\n return (\n <div ref={ref} className={style.switcher} {...containerProps}>\n <div className={classNames(style.buttons, className)}>\n {componentValues.map((button, index) => (\n <Component\n key={index}\n {...button}\n selected={activeValue === button.value}\n onClick={() => onChangeHandler(button.value)}\n />\n ))}\n </div>\n {slot && (\n <>\n <div className={style.separator} />\n {slot}\n </>\n )}\n </div>\n )\n }\n)\n","import classNames from 'classnames'\nimport { MouseEventHandler, ReactNode } from 'react'\n\nimport s from './table.module.scss'\n\ninterface Props {\n children: ReactNode\n className?: string\n}\n\ninterface RootProps extends Props {}\nconst Root = ({ children, className }: RootProps) => {\n return <table className={classNames(s.root, className)}>{children}</table>\n}\n\ninterface CaptionProps extends Props {}\nconst Caption = ({ children, className }: CaptionProps) => {\n return (\n <caption className={classNames(s.caption, className)}>{children}</caption>\n )\n}\n\ninterface HeaderProps extends Props {}\nconst Header = ({ children, className }: HeaderProps) => {\n return <thead className={classNames(s.header, className)}>{children}</thead>\n}\n\ninterface RowProps extends Props {\n onClick?: MouseEventHandler<HTMLTableRowElement> | undefined\n}\nconst Row = ({ children, className, onClick }: RowProps) => {\n return (\n <tr className={classNames(s.row, className)} onClick={onClick}>\n {children}\n </tr>\n )\n}\n\ninterface HeadProps extends Props {}\nconst Head = ({ children, className }: HeadProps) => {\n return <th className={classNames(s.head, className)}>{children}</th>\n}\n\ninterface BodyProps extends Props {}\nconst Body = ({ children, className }: BodyProps) => {\n return <tbody className={classNames(s.body, className)}>{children}</tbody>\n}\n\ninterface CellProps extends Props {}\nconst Cell = ({ children, className }: CellProps) => {\n return <td className={classNames(s.cell, className)}>{children}</td>\n}\n\ninterface FooterProps extends Props {}\nconst Footer = ({ children, className }: FooterProps) => {\n return <tfoot className={classNames(s.footer, className)}>{children}</tfoot>\n}\n\nexport const Table = Object.assign(Root, {\n Body,\n Caption,\n Cell,\n Footer,\n Head,\n Header,\n Root,\n Row,\n})\n","import {\n ChangeEvent,\n ForwardedRef,\n ReactNode,\n forwardRef,\n useState,\n} from 'react'\n\nimport classNames from 'classnames'\n\nimport s from './text-field.module.scss'\nimport { X, Eye, Search, EyeOff } from 'lucide-react'\n\ntype SharedProps = {\n className?: string\n disabled?: boolean\n error?: string\n label?: string\n onBlur?: () => void\n onChange: (value: string) => void\n onFocus?: () => void\n placeholder?: string\n required?: boolean\n value: string\n}\n\nexport type TextFieldProps =\n | (SharedProps & {\n as?: 'input'\n inputType?: 'password' | 'search' | 'text'\n })\n | (SharedProps & { as: 'textarea' })\n\nexport type TextFieldComponent = {\n (\n props: Extract<TextFieldProps, { as: 'textarea' }> & {\n ref?: ForwardedRef<HTMLTextAreaElement>\n }\n ): ReactNode\n (\n props: Extract<TextFieldProps, { as?: 'input' }> & {\n ref?: ForwardedRef<HTMLInputElement>\n }\n ): ReactNode\n}\n\nexport const TextField: TextFieldComponent = forwardRef<\n HTMLInputElement | HTMLTextAreaElement,\n TextFieldProps\n>(({ className, error, label, onChange, required, ...props }, ref) => {\n const [showPassword, setShowPassword] = useState(false)\n\n const handleChange = (\n e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => onChange(e.currentTarget.value)\n\n const sharedClassName = classNames(s.input, error && s.error, className)\n let resolvedFragment: ReactNode\n\n if (!props.as || props.as === 'input') {\n const { as, inputType, ...restProps } = props\n const isSearch = inputType === 'search'\n const isPassword = inputType === 'password'\n const passwordFieldNextType = showPassword ? 'text' : 'password'\n\n resolvedFragment = (\n <>\n <input\n className={classNames(sharedClassName, isSearch && s.inputSearch)}\n onChange={handleChange}\n ref={ref as unknown as ForwardedRef<HTMLInputElement>}\n type={isPassword ? passwordFieldNextType : inputType}\n {...restProps}\n />\n {isPassword &&\n (showPassword ? (\n <Eye\n strokeWidth={2.5}\n width={20}\n className={classNames(s.button, label && s.buttonWithLabel)}\n onClick={() => setShowPassword((prev) => !prev)}\n />\n ) : (\n <EyeOff\n strokeWidth={2.5}\n width={20}\n className={classNames(s.button, label && s.buttonWithLabel)}\n onClick={() => setShowPassword((prev) => !prev)}\n />\n ))}\n {isSearch && props.value && (\n <X\n onClick={() => onChange('')}\n className={classNames(\n s.button,\n label && s.buttonWithLabel,\n s.resetSearchValue\n )}\n strokeWidth={2.5}\n size={24}\n />\n )}\n {isSearch && (\n <Search\n className={classNames(\n s.searchOutline,\n label && s.searchOutlineWithLabel\n )}\n size={20}\n />\n )}\n </>\n )\n }\n\n if (props.as === 'textarea') {\n const { as, ...restProps } = props\n\n resolvedFragment = (\n <textarea\n className={sharedClassName}\n onChange={handleChange}\n ref={ref as unknown as ForwardedRef<HTMLTextAreaElement>}\n {...restProps}\n />\n )\n }\n\n return (\n <div className={s.root}>\n <span className={s.title}>\n {label}\n {required && <span className={s.titleError}>*</span>}\n </span>\n <div className={s.inputContainer}>{resolvedFragment}</div>\n <div className={s.errorMessage}>{error}</div>\n </div>\n )\n})\n","import classNames from 'classnames'\nimport { ReactNode, forwardRef } from 'react'\n\nimport s from './tool-icon-button.module.scss'\n\nexport type ToolbarSlot = 'icon' | 'keybinding'\nexport type ToolbarClasses = { [P in ToolbarSlot]?: string }\n\ninterface Props {\n title?: string\n icon: ReactNode\n keybinding?: string\n aria_label?: string\n aria_keyshortcuts?: string\n classes?: ToolbarClasses\n name?: string\n id?: string\n isActive?: boolean\n disabled?: boolean\n onClick?: () => void\n}\n\nexport const ToolIconButton = forwardRef<HTMLDivElement, Props>(\n (props, ref) => {\n const { classes, disabled, icon, isActive, keybinding, onClick, title } =\n props\n\n const styles = getClasses(classes, isActive, disabled)\n\n return (\n <label className={s.root} title={title}>\n <div\n className={styles.icon}\n ref={ref}\n tabIndex={disabled ? -1 : 0}\n role=\"button\"\n aria-pressed={isActive}\n aria-disabled={disabled}\n onClick={!disabled ? onClick : undefined}\n >\n {icon}\n </div>\n {keybinding && <span className={styles.keybinding}>{keybinding}</span>}\n </label>\n )\n }\n)\n\nconst getClasses = (\n classes?: ToolbarClasses,\n isActive?: boolean,\n disabled?: boolean\n): Required<ToolbarClasses> => ({\n icon: classNames(\n s.icon,\n {\n [s.active]: isActive,\n [s.disabled]: disabled,\n },\n classes?.icon\n ),\n keybinding: classNames(s.keybinding, classes?.keybinding),\n})\n"],"names":["ButtonRender","children","className","Component","disabled","fullWidth","icon","shortcut","variant","props","ref","content","jsxs","s","jsx","classNames","Button","forwardRef","CardRoot","CardContent","ignoreHeader","CardHeader","Card","DropDownContext","createContext","useDropDownContext","context","useContext","openDropDownStack","Root","closeOnEsc","closeOnOutsideClick","defaultVisible","visible","setVisible","useState","rootRef","useRef","toggle","close","index","useEffect","handleClickOutside","event","handleKeyDown","styles","Trigger","Content","fixedPosition","horizontal","vertical","DropDown","DialogContext","React","externalIsOpen","onStateChange","dialogRef","internalIsOpen","setInternalIsOpen","isOpen","setIsOpen","state","as","closeOnBackdropClick","_","handleBackdropClick","e","Close","Title","Separator","Dialog","SidebarContext","useSidebarContext","opened","setOpened","open","onClickHandler","position","contentRef","Sidebar","SwitcherButtons","componentValues","containerProps","onChange","selectedValue","slot","activeValue","setActiveValue","onChangeHandler","value","style","button","Fragment","Caption","Header","Row","onClick","Head","Body","Cell","Footer","Table","TextField","error","label","required","showPassword","setShowPassword","handleChange","sharedClassName","resolvedFragment","inputType","restProps","isSearch","isPassword","passwordFieldNextType","Eye","prev","EyeOff","X","Search","ToolIconButton","classes","isActive","keybinding","title","getClasses"],"mappings":";;;;;;;;;;;;;;GA+CaA,KAAiC,CAC5C;AAAA,EACE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAWC,IAAY;AAAA,EACvB,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IACJ,gBAAAC,EAAC,OAAI,EAAA,WAAWC,EAAE,gBAChB,UAAA;AAAA,IAAC,gBAAAD,EAAA,OAAA,EAAI,WAAWC,EAAE,SACf,UAAA;AAAA,MAAAP;AAAA,MACAL;AAAA,IAAA,GACH;AAAA,IACC,gBAAAa,EAAA,OAAA,EAAI,WAAWD,EAAE,UAAW,UAASN,EAAA,CAAA;AAAA,EAAA,GACxC;AAIA,SAAA,gBAAAO;AAAA,IAACX;AAAA,IAAA;AAAA,MACC,WAAWY;AAAA,QACTF,EAAEL,CAAO;AAAA,QACTH,KAAaQ,EAAE;AAAA,QACfT,KAAYS,EAAE;AAAA,QACdP,KAAQO,EAAE;AAAA,QACVX;AAAA,MACF;AAAA,MACA,UAAUI,IAAOK,IAAUV;AAAA,MAC3B,UAAAG;AAAA,MACA,KAAAM;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EACN;AAEJ,GAEaO,KAA0BC,EAAWjB,EAAY;;;;;GCjFjDkB,IAAWD;AAAA,EACtB,CAAC,EAAE,WAAAf,GAAW,GAAGO,KAASC,MACxB,gBAAAI,EAAC,OAAI,EAAA,WAAWC,EAAWF,EAAE,MAAMX,CAAS,GAAG,KAAAQ,GAAW,GAAGD,EAAO,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