omigar-ui 1.0.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.
Potentially problematic release.
This version of omigar-ui might be problematic. Click here for more details.
- package/LICENSE +201 -0
- package/README.md +14 -0
- package/dist/README.md +14 -0
- package/dist/index.css +684 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +397 -0
- package/dist/index.d.ts +397 -0
- package/dist/index.js +974 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +944 -0
- package/dist/index.mjs.map +1 -0
- package/dist/package.json +187 -0
- package/package.json +187 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,944 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
var __export = (target, all) => {
|
|
33
|
+
for (var name in all)
|
|
34
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/shared/ui/display/Typography/Typography.tsx
|
|
38
|
+
import classnames from "classnames";
|
|
39
|
+
import { forwardRef } from "react";
|
|
40
|
+
|
|
41
|
+
// src/shared/ui/display/Typography/typography.module.css
|
|
42
|
+
var typography_exports = {};
|
|
43
|
+
__export(typography_exports, {
|
|
44
|
+
default: () => typography_default
|
|
45
|
+
});
|
|
46
|
+
var typography_default = {};
|
|
47
|
+
|
|
48
|
+
// src/shared/ui/display/Typography/Typography.tsx
|
|
49
|
+
import { jsx } from "react/jsx-runtime";
|
|
50
|
+
var Typography = forwardRef(function Typography2(_a, propRef) {
|
|
51
|
+
var _b = _a, { variant = "body1", component, children, className } = _b, typographyProps = __objRest(_b, ["variant", "component", "children", "className"]);
|
|
52
|
+
let componentByVariant = "span";
|
|
53
|
+
switch (variant) {
|
|
54
|
+
case "h1":
|
|
55
|
+
componentByVariant = "h1";
|
|
56
|
+
break;
|
|
57
|
+
case "h2":
|
|
58
|
+
componentByVariant = "h2";
|
|
59
|
+
break;
|
|
60
|
+
case "h3":
|
|
61
|
+
componentByVariant = "h3";
|
|
62
|
+
break;
|
|
63
|
+
case "h4":
|
|
64
|
+
componentByVariant = "h4";
|
|
65
|
+
break;
|
|
66
|
+
case "h5":
|
|
67
|
+
componentByVariant = "h5";
|
|
68
|
+
break;
|
|
69
|
+
case "h6":
|
|
70
|
+
case "subtitle1":
|
|
71
|
+
case "subtitle2":
|
|
72
|
+
componentByVariant = "h6";
|
|
73
|
+
break;
|
|
74
|
+
case "body1":
|
|
75
|
+
case "body2":
|
|
76
|
+
componentByVariant = "p";
|
|
77
|
+
break;
|
|
78
|
+
case "button":
|
|
79
|
+
case "caption":
|
|
80
|
+
case "overline":
|
|
81
|
+
default:
|
|
82
|
+
componentByVariant = "span";
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
const Component = component || componentByVariant;
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
Component,
|
|
88
|
+
__spreadProps(__spreadValues({
|
|
89
|
+
className: classnames(typography_exports[variant], className)
|
|
90
|
+
}, typographyProps), {
|
|
91
|
+
ref: propRef,
|
|
92
|
+
children
|
|
93
|
+
})
|
|
94
|
+
);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// src/shared/ui/display/Popover/Popover.tsx
|
|
98
|
+
import classnames3 from "classnames";
|
|
99
|
+
|
|
100
|
+
// src/shared/ui/display/Popover/ui/PopoverContent/PopoverContent.tsx
|
|
101
|
+
import { FloatingFocusManager, FloatingPortal, useMergeRefs } from "@floating-ui/react";
|
|
102
|
+
import classnames2 from "classnames";
|
|
103
|
+
import { forwardRef as forwardRef2, useContext } from "react";
|
|
104
|
+
|
|
105
|
+
// src/shared/ui/display/Popover/ui/PopoverProvider/constants/PopoverContext.ts
|
|
106
|
+
import { createContext } from "react";
|
|
107
|
+
var PopoverContext = createContext(null);
|
|
108
|
+
|
|
109
|
+
// src/shared/ui/display/Popover/ui/PopoverContent/PopoverContent.tsx
|
|
110
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
111
|
+
var PopoverContent = forwardRef2(function PopoverContent2(_a, propRef) {
|
|
112
|
+
var _b = _a, { style, children, className } = _b, props = __objRest(_b, ["style", "children", "className"]);
|
|
113
|
+
const context = useContext(PopoverContext);
|
|
114
|
+
if (!context) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const _a2 = context, { context: floatingContext } = _a2, otherContext = __objRest(_a2, ["context"]);
|
|
118
|
+
const ref = useMergeRefs([otherContext.refs.setFloating, propRef]);
|
|
119
|
+
if (!floatingContext.open) return null;
|
|
120
|
+
const floatingProps = otherContext.getFloatingProps(props);
|
|
121
|
+
const _b2 = floatingProps, { className: floatingClassName } = _b2, restFloatingProps = __objRest(_b2, ["className"]);
|
|
122
|
+
const mergedClassName = classnames2(className, floatingClassName);
|
|
123
|
+
return /* @__PURE__ */ jsx2(FloatingPortal, { root: otherContext.root, children: /* @__PURE__ */ jsx2(
|
|
124
|
+
FloatingFocusManager,
|
|
125
|
+
{
|
|
126
|
+
context: floatingContext,
|
|
127
|
+
modal: otherContext.modal,
|
|
128
|
+
initialFocus: otherContext.initialFocus,
|
|
129
|
+
children: /* @__PURE__ */ jsx2(
|
|
130
|
+
"div",
|
|
131
|
+
__spreadProps(__spreadValues({
|
|
132
|
+
ref,
|
|
133
|
+
className: mergedClassName,
|
|
134
|
+
style: __spreadValues(__spreadValues({}, otherContext.floatingStyles), style)
|
|
135
|
+
}, restFloatingProps), {
|
|
136
|
+
children
|
|
137
|
+
})
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
) });
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// src/shared/ui/display/Popover/ui/PopoverProvider/hooks/usePopover.ts
|
|
144
|
+
import {
|
|
145
|
+
autoUpdate,
|
|
146
|
+
flip,
|
|
147
|
+
offset,
|
|
148
|
+
shift,
|
|
149
|
+
useClick,
|
|
150
|
+
useDismiss,
|
|
151
|
+
useFloating,
|
|
152
|
+
useHover,
|
|
153
|
+
useInteractions,
|
|
154
|
+
useRole
|
|
155
|
+
} from "@floating-ui/react";
|
|
156
|
+
import { useMemo, useState } from "react";
|
|
157
|
+
function usePopover(props = {}) {
|
|
158
|
+
const {
|
|
159
|
+
initialOpen = false,
|
|
160
|
+
placement = "bottom",
|
|
161
|
+
modal,
|
|
162
|
+
initialFocus,
|
|
163
|
+
root: root6,
|
|
164
|
+
open: controlledOpen,
|
|
165
|
+
onOpenChange: setControlledOpen,
|
|
166
|
+
containerOffset = 12,
|
|
167
|
+
showOnHover = false
|
|
168
|
+
} = props;
|
|
169
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(initialOpen);
|
|
170
|
+
const open = controlledOpen != null ? controlledOpen : uncontrolledOpen;
|
|
171
|
+
const setOpen = setControlledOpen != null ? setControlledOpen : setUncontrolledOpen;
|
|
172
|
+
const data = useFloating({
|
|
173
|
+
placement,
|
|
174
|
+
open,
|
|
175
|
+
onOpenChange: setOpen,
|
|
176
|
+
whileElementsMounted: autoUpdate,
|
|
177
|
+
middleware: [
|
|
178
|
+
offset(containerOffset),
|
|
179
|
+
flip({
|
|
180
|
+
crossAxis: placement.includes("-"),
|
|
181
|
+
fallbackAxisSideDirection: "end",
|
|
182
|
+
padding: 5
|
|
183
|
+
}),
|
|
184
|
+
shift({ padding: 5 })
|
|
185
|
+
]
|
|
186
|
+
});
|
|
187
|
+
const { context } = data;
|
|
188
|
+
const hover = useHover(context, {
|
|
189
|
+
enabled: showOnHover && controlledOpen === void 0
|
|
190
|
+
});
|
|
191
|
+
const click = useClick(context, {
|
|
192
|
+
enabled: !showOnHover
|
|
193
|
+
});
|
|
194
|
+
const dismiss = useDismiss(context);
|
|
195
|
+
const role = useRole(context);
|
|
196
|
+
const interactions = useInteractions([hover, click, dismiss, role]);
|
|
197
|
+
return useMemo(
|
|
198
|
+
() => __spreadProps(__spreadValues(__spreadValues({
|
|
199
|
+
open,
|
|
200
|
+
setOpen
|
|
201
|
+
}, interactions), data), {
|
|
202
|
+
modal,
|
|
203
|
+
initialFocus,
|
|
204
|
+
root: root6
|
|
205
|
+
}),
|
|
206
|
+
[open, setOpen, interactions, data, modal, root6, initialFocus]
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// src/shared/ui/display/Popover/ui/PopoverProvider/PopoverProvider.tsx
|
|
211
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
212
|
+
var PopoverProvider = (props) => {
|
|
213
|
+
const _a = props, { children, modal, initialFocus } = _a, options = __objRest(_a, ["children", "modal", "initialFocus"]);
|
|
214
|
+
const popover = usePopover(__spreadValues({ modal, initialFocus }, options));
|
|
215
|
+
return /* @__PURE__ */ jsx3(PopoverContext.Provider, { value: popover, children });
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// src/shared/ui/display/Popover/ui/PopoverTrigger/PopoverTrigger.tsx
|
|
219
|
+
import { useMergeRefs as useMergeRefs2 } from "@floating-ui/react";
|
|
220
|
+
import { cloneElement, forwardRef as forwardRef3, isValidElement, useContext as useContext2 } from "react";
|
|
221
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
222
|
+
var PopoverTrigger = forwardRef3(
|
|
223
|
+
function PopoverTrigger2(_a, propRef) {
|
|
224
|
+
var _b = _a, { children, wrapTrigger = false, className } = _b, props = __objRest(_b, ["children", "wrapTrigger", "className"]);
|
|
225
|
+
const context = useContext2(PopoverContext);
|
|
226
|
+
const childrenRef = children.ref;
|
|
227
|
+
const ref = useMergeRefs2([context == null ? void 0 : context.refs.setReference, propRef, childrenRef]);
|
|
228
|
+
if (!context) {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
if (!wrapTrigger && isValidElement(children)) {
|
|
232
|
+
return cloneElement(
|
|
233
|
+
children,
|
|
234
|
+
context.getReferenceProps(__spreadProps(__spreadValues(__spreadValues({
|
|
235
|
+
ref,
|
|
236
|
+
className
|
|
237
|
+
}, props), children.props), {
|
|
238
|
+
"data-state": context.open ? "open" : "closed"
|
|
239
|
+
}))
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
return /* @__PURE__ */ jsx4(
|
|
243
|
+
"div",
|
|
244
|
+
__spreadProps(__spreadValues({
|
|
245
|
+
ref,
|
|
246
|
+
className,
|
|
247
|
+
"data-state": context.open ? "open" : "closed"
|
|
248
|
+
}, context.getReferenceProps(props)), {
|
|
249
|
+
children
|
|
250
|
+
})
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
// src/shared/ui/display/Popover/Popover.tsx
|
|
256
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
257
|
+
function Popover(props) {
|
|
258
|
+
const {
|
|
259
|
+
description,
|
|
260
|
+
initialOpen,
|
|
261
|
+
placement,
|
|
262
|
+
wrapTrigger,
|
|
263
|
+
containerOffset,
|
|
264
|
+
root: root6,
|
|
265
|
+
modal = false,
|
|
266
|
+
initialFocus = -1,
|
|
267
|
+
open,
|
|
268
|
+
onOpenChange,
|
|
269
|
+
showOnHover,
|
|
270
|
+
children,
|
|
271
|
+
classes
|
|
272
|
+
} = props;
|
|
273
|
+
if (!children) {
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
if (!description) {
|
|
277
|
+
return children;
|
|
278
|
+
}
|
|
279
|
+
return /* @__PURE__ */ jsxs(
|
|
280
|
+
PopoverProvider,
|
|
281
|
+
{
|
|
282
|
+
placement,
|
|
283
|
+
initialOpen,
|
|
284
|
+
open,
|
|
285
|
+
onOpenChange,
|
|
286
|
+
containerOffset,
|
|
287
|
+
root: root6,
|
|
288
|
+
modal,
|
|
289
|
+
initialFocus,
|
|
290
|
+
showOnHover,
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ jsx5(
|
|
293
|
+
PopoverTrigger,
|
|
294
|
+
{
|
|
295
|
+
wrapTrigger,
|
|
296
|
+
className: classnames3(wrapTrigger ? void 0 : void 0, classes == null ? void 0 : classes.trigger),
|
|
297
|
+
children
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ jsx5(PopoverContent, { className: classnames3(void 0, classes == null ? void 0 : classes.content), children: description })
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// src/shared/ui/display/Popover/ui/Arrow/Arrow.tsx
|
|
307
|
+
import { useContext as useContext3 } from "react";
|
|
308
|
+
|
|
309
|
+
// src/shared/ui/icons/index.ts
|
|
310
|
+
var icons_exports = {};
|
|
311
|
+
__export(icons_exports, {
|
|
312
|
+
ArrowDropDownIcon: () => ArrowDropDownIcon,
|
|
313
|
+
ArrowDropUpIcon: () => ArrowDropUpIcon,
|
|
314
|
+
ArrowLeft: () => ArrowLeft,
|
|
315
|
+
ArrowRight: () => ArrowRight,
|
|
316
|
+
BookmarkIcon: () => BookmarkIcon,
|
|
317
|
+
ButtonsIcon: () => ButtonsIcon,
|
|
318
|
+
CheckboxDeselectedIcon: () => CheckboxDeselectedIcon,
|
|
319
|
+
CheckboxIcon: () => CheckboxIcon,
|
|
320
|
+
CheckboxSeveralIcon: () => CheckboxSeveralIcon,
|
|
321
|
+
CheckboxesIcon: () => CheckboxesIcon,
|
|
322
|
+
DarkModeIcon: () => DarkModeIcon,
|
|
323
|
+
DeleteIcon: () => DeleteIcon,
|
|
324
|
+
DoneIcon: () => DoneIcon,
|
|
325
|
+
EditIcon: () => EditIcon,
|
|
326
|
+
FilterIcon: () => FilterIcon,
|
|
327
|
+
IconsIcon: () => IconsIcon,
|
|
328
|
+
InfoIcon: () => InfoIcon,
|
|
329
|
+
LightModeIcon: () => LightModeIcon,
|
|
330
|
+
ListIcon: () => ListIcon,
|
|
331
|
+
MenuIcon: () => MenuIcon,
|
|
332
|
+
PaperIcon: () => PaperIcon,
|
|
333
|
+
PopoverIcon: () => PopoverIcon,
|
|
334
|
+
SaveIcon: () => SaveIcon,
|
|
335
|
+
SearchIcon: () => SearchIcon,
|
|
336
|
+
SettingsIcon: () => SettingsIcon,
|
|
337
|
+
TypographyIcon: () => TypographyIcon
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
// src/shared/ui/icons/ui/Icon.tsx
|
|
341
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
342
|
+
var Icon = (props) => {
|
|
343
|
+
const { componentSize = "medium", className, children } = props;
|
|
344
|
+
let size = 24;
|
|
345
|
+
switch (componentSize) {
|
|
346
|
+
case "small":
|
|
347
|
+
size = 16;
|
|
348
|
+
break;
|
|
349
|
+
case "large":
|
|
350
|
+
size = 32;
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
return /* @__PURE__ */ jsx6(
|
|
354
|
+
"svg",
|
|
355
|
+
{
|
|
356
|
+
width: size,
|
|
357
|
+
height: size,
|
|
358
|
+
viewBox: "0 0 24 24",
|
|
359
|
+
fill: "currentColor",
|
|
360
|
+
className,
|
|
361
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
362
|
+
children
|
|
363
|
+
}
|
|
364
|
+
);
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
// src/shared/ui/icons/ArrowDropDownIcon.tsx
|
|
368
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
369
|
+
var ArrowDropDownIcon = (props) => /* @__PURE__ */ jsx7(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx7("path", { d: "M7 10l5 5 5-5z" }) }));
|
|
370
|
+
|
|
371
|
+
// src/shared/ui/icons/ArrowDropUpIcon.tsx
|
|
372
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
373
|
+
var ArrowDropUpIcon = (props) => /* @__PURE__ */ jsx8(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx8("path", { d: "M7 14l5-5 5 5z" }) }));
|
|
374
|
+
|
|
375
|
+
// src/shared/ui/icons/ArrowLeft.tsx
|
|
376
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
377
|
+
var ArrowLeft = (props) => /* @__PURE__ */ jsx9(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx9("path", { d: "m14 7-5 5 5 5z" }) }));
|
|
378
|
+
|
|
379
|
+
// src/shared/ui/icons/ArrowRight.tsx
|
|
380
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
381
|
+
var ArrowRight = (props) => /* @__PURE__ */ jsx10(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx10("path", { d: "m10 17 5-5-5-5z" }) }));
|
|
382
|
+
|
|
383
|
+
// src/shared/ui/icons/CheckboxIcon.tsx
|
|
384
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
385
|
+
var CheckboxIcon = (props) => /* @__PURE__ */ jsx11(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx11("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) }));
|
|
386
|
+
|
|
387
|
+
// src/shared/ui/icons/CheckboxSeveralIcon.tsx
|
|
388
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
389
|
+
var CheckboxSeveralIcon = (props) => /* @__PURE__ */ jsx12(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx12(
|
|
390
|
+
"path",
|
|
391
|
+
{
|
|
392
|
+
d: `M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0
|
|
393
|
+
2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2zm0-4H7V7h10v2z`
|
|
394
|
+
}
|
|
395
|
+
) }));
|
|
396
|
+
|
|
397
|
+
// src/shared/ui/icons/CheckboxDeselectedIcon.tsx
|
|
398
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
399
|
+
var CheckboxDeselectedIcon = (props) => /* @__PURE__ */ jsx13(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx13("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14z" }) }));
|
|
400
|
+
|
|
401
|
+
// src/shared/ui/icons/ButtonsIcon.tsx
|
|
402
|
+
import { jsx as jsx14, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
403
|
+
var ButtonsIcon = (props) => /* @__PURE__ */ jsxs2(Icon, __spreadProps(__spreadValues({}, props), { children: [
|
|
404
|
+
/* @__PURE__ */ jsx14("rect", { x: "3.5", y: "7", width: "11", height: "4", rx: "2", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
405
|
+
/* @__PURE__ */ jsx14("rect", { x: "9.5", y: "13", width: "11", height: "4", rx: "2", fill: "none", stroke: "currentColor", strokeWidth: "1.6" })
|
|
406
|
+
] }));
|
|
407
|
+
|
|
408
|
+
// src/shared/ui/icons/DeleteIcon.tsx
|
|
409
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
410
|
+
var DeleteIcon = (props) => /* @__PURE__ */ jsx15(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx15("path", { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" }) }));
|
|
411
|
+
|
|
412
|
+
// src/shared/ui/icons/DoneIcon.tsx
|
|
413
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
414
|
+
var DoneIcon = (props) => /* @__PURE__ */ jsx16(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx16("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) }));
|
|
415
|
+
|
|
416
|
+
// src/shared/ui/icons/FilterIcon.tsx
|
|
417
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
418
|
+
var FilterIcon = (props) => /* @__PURE__ */ jsx17(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx17("path", { d: "M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z" }) }));
|
|
419
|
+
|
|
420
|
+
// src/shared/ui/icons/InfoIcon.tsx
|
|
421
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
422
|
+
var InfoIcon = (props) => /* @__PURE__ */ jsx18(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx18(
|
|
423
|
+
"path",
|
|
424
|
+
{
|
|
425
|
+
d: `M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10
|
|
426
|
+
10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z`
|
|
427
|
+
}
|
|
428
|
+
) }));
|
|
429
|
+
|
|
430
|
+
// src/shared/ui/icons/IconsIcon.tsx
|
|
431
|
+
import { jsx as jsx19, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
432
|
+
var IconsIcon = (props) => /* @__PURE__ */ jsxs3(Icon, __spreadProps(__spreadValues({}, props), { children: [
|
|
433
|
+
/* @__PURE__ */ jsx19("rect", { x: "4", y: "4", width: "6", height: "6", rx: "1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
434
|
+
/* @__PURE__ */ jsx19("rect", { x: "14", y: "4", width: "6", height: "6", rx: "1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
435
|
+
/* @__PURE__ */ jsx19("rect", { x: "4", y: "14", width: "6", height: "6", rx: "1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
436
|
+
/* @__PURE__ */ jsx19("rect", { x: "14", y: "14", width: "6", height: "6", rx: "1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.6" })
|
|
437
|
+
] }));
|
|
438
|
+
|
|
439
|
+
// src/shared/ui/icons/ListIcon.tsx
|
|
440
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
441
|
+
var ListIcon = (props) => /* @__PURE__ */ jsx20(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx20("path", { d: "M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z" }) }));
|
|
442
|
+
|
|
443
|
+
// src/shared/ui/icons/MenuIcon.tsx
|
|
444
|
+
import { jsx as jsx21, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
445
|
+
var MenuIcon = (props) => /* @__PURE__ */ jsxs4(Icon, __spreadProps(__spreadValues({}, props), { children: [
|
|
446
|
+
/* @__PURE__ */ jsx21("line", { x1: "4", y1: "7", x2: "20", y2: "7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }),
|
|
447
|
+
/* @__PURE__ */ jsx21("line", { x1: "4", y1: "12", x2: "20", y2: "12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }),
|
|
448
|
+
/* @__PURE__ */ jsx21("line", { x1: "4", y1: "17", x2: "20", y2: "17", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
449
|
+
] }));
|
|
450
|
+
|
|
451
|
+
// src/shared/ui/icons/PaperIcon.tsx
|
|
452
|
+
import { jsx as jsx22, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
453
|
+
var PaperIcon = (props) => /* @__PURE__ */ jsxs5(Icon, __spreadProps(__spreadValues({}, props), { children: [
|
|
454
|
+
/* @__PURE__ */ jsx22("rect", { x: "5", y: "3", width: "12", height: "18", rx: "2", ry: "2", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
455
|
+
/* @__PURE__ */ jsx22("line", { x1: "8", y1: "8", x2: "14", y2: "8", stroke: "currentColor", strokeWidth: "1.4" }),
|
|
456
|
+
/* @__PURE__ */ jsx22("line", { x1: "8", y1: "11", x2: "14", y2: "11", stroke: "currentColor", strokeWidth: "1.4" }),
|
|
457
|
+
/* @__PURE__ */ jsx22("line", { x1: "8", y1: "14", x2: "12.5", y2: "14", stroke: "currentColor", strokeWidth: "1.4" })
|
|
458
|
+
] }));
|
|
459
|
+
|
|
460
|
+
// src/shared/ui/icons/PopoverIcon.tsx
|
|
461
|
+
import { jsx as jsx23, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
462
|
+
var PopoverIcon = (props) => /* @__PURE__ */ jsxs6(Icon, __spreadProps(__spreadValues({}, props), { children: [
|
|
463
|
+
/* @__PURE__ */ jsx23("rect", { x: "4", y: "5", width: "16", height: "10", rx: "2", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
464
|
+
/* @__PURE__ */ jsx23(
|
|
465
|
+
"path",
|
|
466
|
+
{
|
|
467
|
+
d: "M10 15.5 12 19l2-3.5",
|
|
468
|
+
fill: "none",
|
|
469
|
+
stroke: "currentColor",
|
|
470
|
+
strokeWidth: "1.6",
|
|
471
|
+
strokeLinecap: "round",
|
|
472
|
+
strokeLinejoin: "round"
|
|
473
|
+
}
|
|
474
|
+
)
|
|
475
|
+
] }));
|
|
476
|
+
|
|
477
|
+
// src/shared/ui/icons/TypographyIcon.tsx
|
|
478
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
479
|
+
var TypographyIcon = (props) => /* @__PURE__ */ jsx24(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx24("path", { d: "M6 7V5h12v2h-5v12h-2V7H6Z", fill: "currentColor" }) }));
|
|
480
|
+
|
|
481
|
+
// src/shared/ui/icons/CheckboxesIcon.tsx
|
|
482
|
+
import { jsx as jsx25, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
483
|
+
var CheckboxesIcon = (props) => /* @__PURE__ */ jsxs7(Icon, __spreadProps(__spreadValues({}, props), { children: [
|
|
484
|
+
/* @__PURE__ */ jsx25("rect", { x: "5", y: "5", width: "6", height: "6", rx: "1.2", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
485
|
+
/* @__PURE__ */ jsx25("rect", { x: "5", y: "13", width: "6", height: "6", rx: "1.2", fill: "none", stroke: "currentColor", strokeWidth: "1.6" }),
|
|
486
|
+
/* @__PURE__ */ jsx25(
|
|
487
|
+
"path",
|
|
488
|
+
{
|
|
489
|
+
d: "M15 7.5 16.8 9.3 20 6",
|
|
490
|
+
fill: "none",
|
|
491
|
+
stroke: "currentColor",
|
|
492
|
+
strokeWidth: "1.7",
|
|
493
|
+
strokeLinecap: "round",
|
|
494
|
+
strokeLinejoin: "round"
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ jsx25("rect", { x: "14", y: "13", width: "6", height: "6", rx: "1.2", fill: "none", stroke: "currentColor", strokeWidth: "1.6" })
|
|
498
|
+
] }));
|
|
499
|
+
|
|
500
|
+
// src/shared/ui/icons/SearchIcon.tsx
|
|
501
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
502
|
+
var SearchIcon = (props) => /* @__PURE__ */ jsx26(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx26(
|
|
503
|
+
"path",
|
|
504
|
+
{
|
|
505
|
+
d: `M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5
|
|
506
|
+
6.5 6.5 0 1 0 9.5 16
|
|
507
|
+
c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5
|
|
508
|
+
zm-6 0C7.01 14 5 11.99 5 9.5
|
|
509
|
+
S7.01 5 9.5 5 14 7.01 14 9.5
|
|
510
|
+
11.99 14 9.5 14z`
|
|
511
|
+
}
|
|
512
|
+
) }));
|
|
513
|
+
|
|
514
|
+
// src/shared/ui/icons/SettingsIcon.tsx
|
|
515
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
516
|
+
var SettingsIcon = (props) => /* @__PURE__ */ jsx27(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx27("path", { d: "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" }) }));
|
|
517
|
+
|
|
518
|
+
// src/shared/ui/icons/EditIcon.tsx
|
|
519
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
520
|
+
var EditIcon = (props) => /* @__PURE__ */ jsx28(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx28("path", { d: "M18.3688 3.29L20.7088 5.63C21.0988 6.02 21.0988 6.65 20.7088 7.04L18.8788 8.87L15.1288 5.12L16.9588 3.29C17.1488 3.1 17.3988 3 17.6588 3C17.9188 3 18.1688 3.09 18.3688 3.29ZM2.99878 17.25V21H6.74878L17.8088 9.94L14.0588 6.19L2.99878 17.25ZM5.91878 19H4.99878V18.08L14.0588 9.02L14.9788 9.94L5.91878 19Z" }) }));
|
|
521
|
+
|
|
522
|
+
// src/shared/ui/icons/BookmarkIcon.tsx
|
|
523
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
524
|
+
var BookmarkIcon = (props) => /* @__PURE__ */ jsx29(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx29("path", { d: "M17 3H7c-1.1 0-2 .9-2 2v16l7-3 7 3V5c0-1.1-.9-2-2-2zm0 15-5-2.18L7 18V5h10v13z" }) }));
|
|
525
|
+
|
|
526
|
+
// src/shared/ui/icons/SaveIcon.tsx
|
|
527
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
528
|
+
var SaveIcon = (props) => /* @__PURE__ */ jsx30(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx30(
|
|
529
|
+
"path",
|
|
530
|
+
{
|
|
531
|
+
d: `M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9
|
|
532
|
+
2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3
|
|
533
|
+
1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z`
|
|
534
|
+
}
|
|
535
|
+
) }));
|
|
536
|
+
|
|
537
|
+
// src/shared/ui/icons/DarkModeIcon.tsx
|
|
538
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
539
|
+
var DarkModeIcon = (props) => /* @__PURE__ */ jsx31(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx31(
|
|
540
|
+
"path",
|
|
541
|
+
{
|
|
542
|
+
d: `M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98
|
|
543
|
+
1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1`
|
|
544
|
+
}
|
|
545
|
+
) }));
|
|
546
|
+
|
|
547
|
+
// src/shared/ui/icons/LightModeIcon.tsx
|
|
548
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
549
|
+
var LightModeIcon = (props) => /* @__PURE__ */ jsx32(Icon, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx32(
|
|
550
|
+
"path",
|
|
551
|
+
{
|
|
552
|
+
d: `M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2
|
|
553
|
+
13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18
|
|
554
|
+
0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11
|
|
555
|
+
2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0
|
|
556
|
+
18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99
|
|
557
|
+
4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39
|
|
558
|
+
1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39
|
|
559
|
+
1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03
|
|
560
|
+
0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39
|
|
561
|
+
1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06
|
|
562
|
+
1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z`
|
|
563
|
+
}
|
|
564
|
+
) }));
|
|
565
|
+
|
|
566
|
+
// src/shared/ui/display/Popover/ui/Arrow/Arrow.tsx
|
|
567
|
+
import { Fragment, jsx as jsx33, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
568
|
+
function Arrow() {
|
|
569
|
+
const popoverContext = useContext3(PopoverContext);
|
|
570
|
+
return /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
571
|
+
(popoverContext == null ? void 0 : popoverContext.placement.startsWith("bottom")) && (popoverContext.open ? /* @__PURE__ */ jsx33(ArrowDropUpIcon, {}) : /* @__PURE__ */ jsx33(ArrowDropDownIcon, {})),
|
|
572
|
+
(popoverContext == null ? void 0 : popoverContext.placement.startsWith("top")) && (popoverContext.open ? /* @__PURE__ */ jsx33(ArrowDropDownIcon, {}) : /* @__PURE__ */ jsx33(ArrowDropUpIcon, {})),
|
|
573
|
+
(popoverContext == null ? void 0 : popoverContext.placement.startsWith("right")) && (popoverContext.open ? /* @__PURE__ */ jsx33(ArrowLeft, {}) : /* @__PURE__ */ jsx33(ArrowRight, {})),
|
|
574
|
+
(popoverContext == null ? void 0 : popoverContext.placement.startsWith("left")) && (popoverContext.open ? /* @__PURE__ */ jsx33(ArrowRight, {}) : /* @__PURE__ */ jsx33(ArrowLeft, {}))
|
|
575
|
+
] });
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// src/shared/ui/controls/Button/Button.tsx
|
|
579
|
+
import classnames4 from "classnames";
|
|
580
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
581
|
+
|
|
582
|
+
// src/shared/ui/controls/Button/button.module.css
|
|
583
|
+
var button_exports = {};
|
|
584
|
+
__export(button_exports, {
|
|
585
|
+
default: () => button_default
|
|
586
|
+
});
|
|
587
|
+
var button_default = {};
|
|
588
|
+
|
|
589
|
+
// src/shared/ui/controls/Button/Button.tsx
|
|
590
|
+
import { Fragment as Fragment2, jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
591
|
+
var Button = forwardRef4(function Button2(_a, propRef) {
|
|
592
|
+
var _b = _a, {
|
|
593
|
+
variant = "filled",
|
|
594
|
+
componentSize = "medium",
|
|
595
|
+
icon,
|
|
596
|
+
isActive,
|
|
597
|
+
isLoading = false,
|
|
598
|
+
loadingText,
|
|
599
|
+
className,
|
|
600
|
+
children,
|
|
601
|
+
classes,
|
|
602
|
+
disabled
|
|
603
|
+
} = _b, buttonProps = __objRest(_b, [
|
|
604
|
+
"variant",
|
|
605
|
+
"componentSize",
|
|
606
|
+
"icon",
|
|
607
|
+
"isActive",
|
|
608
|
+
"isLoading",
|
|
609
|
+
"loadingText",
|
|
610
|
+
"className",
|
|
611
|
+
"children",
|
|
612
|
+
"classes",
|
|
613
|
+
"disabled"
|
|
614
|
+
]);
|
|
615
|
+
const isDisabled = disabled || isLoading;
|
|
616
|
+
return /* @__PURE__ */ jsx34(
|
|
617
|
+
"button",
|
|
618
|
+
__spreadProps(__spreadValues({
|
|
619
|
+
className: classnames4(
|
|
620
|
+
void 0,
|
|
621
|
+
button_exports[variant],
|
|
622
|
+
button_exports[componentSize],
|
|
623
|
+
!icon ? void 0 : !children ? void 0 : void 0,
|
|
624
|
+
isActive ? void 0 : void 0,
|
|
625
|
+
isLoading ? void 0 : void 0,
|
|
626
|
+
className,
|
|
627
|
+
classes == null ? void 0 : classes.root
|
|
628
|
+
),
|
|
629
|
+
disabled: isDisabled
|
|
630
|
+
}, buttonProps), {
|
|
631
|
+
ref: propRef,
|
|
632
|
+
children: /* @__PURE__ */ jsx34("span", { className: classnames4(void 0, classes == null ? void 0 : classes.stateLayer), children: isLoading ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
633
|
+
/* @__PURE__ */ jsx34("span", { className: void 0, "aria-hidden": "true" }),
|
|
634
|
+
loadingText || "Loading..."
|
|
635
|
+
] }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
636
|
+
icon,
|
|
637
|
+
children
|
|
638
|
+
] }) })
|
|
639
|
+
})
|
|
640
|
+
);
|
|
641
|
+
});
|
|
642
|
+
|
|
643
|
+
// src/shared/ui/controls/ButtonsGroup/ButtonsGroup.tsx
|
|
644
|
+
import classNames from "classnames";
|
|
645
|
+
import { cloneElement as cloneElement2, isValidElement as isValidElement2, useRef } from "react";
|
|
646
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
647
|
+
var ButtonsGroup = (props) => {
|
|
648
|
+
const {
|
|
649
|
+
children,
|
|
650
|
+
fillEvenly: fillEvenly2 = false,
|
|
651
|
+
orientation = "horizontal",
|
|
652
|
+
wrap: wrap2 = false,
|
|
653
|
+
overflow: overflow2 = false,
|
|
654
|
+
noGap: noGap2 = false,
|
|
655
|
+
merged: merged2 = false,
|
|
656
|
+
"aria-label": ariaLabel,
|
|
657
|
+
"aria-labelledby": ariaLabelledBy,
|
|
658
|
+
disabled = false,
|
|
659
|
+
classes
|
|
660
|
+
} = props;
|
|
661
|
+
const groupRef = useRef(null);
|
|
662
|
+
const handleKeyDown = (event) => {
|
|
663
|
+
var _a, _b;
|
|
664
|
+
if (disabled) return;
|
|
665
|
+
const { key } = event;
|
|
666
|
+
const isVertical = orientation === "vertical";
|
|
667
|
+
const isHorizontal = orientation === "horizontal";
|
|
668
|
+
if (isVertical && (key === "ArrowUp" || key === "ArrowDown") || isHorizontal && (key === "ArrowLeft" || key === "ArrowRight")) {
|
|
669
|
+
event.preventDefault();
|
|
670
|
+
const buttons = Array.from(
|
|
671
|
+
((_a = groupRef.current) == null ? void 0 : _a.querySelectorAll("button:not([disabled])")) || []
|
|
672
|
+
);
|
|
673
|
+
const activeButton = document.activeElement;
|
|
674
|
+
const currentIndex = buttons.indexOf(activeButton);
|
|
675
|
+
if (currentIndex === -1) return;
|
|
676
|
+
let nextIndex = currentIndex;
|
|
677
|
+
if (isVertical && key === "ArrowUp" || isHorizontal && key === "ArrowLeft") {
|
|
678
|
+
nextIndex = currentIndex > 0 ? currentIndex - 1 : buttons.length - 1;
|
|
679
|
+
} else if (isVertical && key === "ArrowDown" || isHorizontal && key === "ArrowRight") {
|
|
680
|
+
nextIndex = currentIndex < buttons.length - 1 ? currentIndex + 1 : 0;
|
|
681
|
+
}
|
|
682
|
+
(_b = buttons[nextIndex]) == null ? void 0 : _b.focus();
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
const enhancedChildren = Array.isArray(children) ? children.map((child, index) => {
|
|
686
|
+
var _a;
|
|
687
|
+
if (isValidElement2(child)) {
|
|
688
|
+
return cloneElement2(child, {
|
|
689
|
+
key: child.key || index,
|
|
690
|
+
"aria-posinset": index + 1,
|
|
691
|
+
"aria-setsize": children.length,
|
|
692
|
+
disabled: disabled || ((_a = child.props) == null ? void 0 : _a.disabled)
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
return child;
|
|
696
|
+
}) : children;
|
|
697
|
+
return /* @__PURE__ */ jsx35(
|
|
698
|
+
"div",
|
|
699
|
+
{
|
|
700
|
+
ref: groupRef,
|
|
701
|
+
className: classNames(
|
|
702
|
+
void 0,
|
|
703
|
+
{
|
|
704
|
+
[void 0]: fillEvenly2,
|
|
705
|
+
[void 0]: orientation === "vertical",
|
|
706
|
+
[void 0]: wrap2,
|
|
707
|
+
[void 0]: overflow2,
|
|
708
|
+
["styledScroll"]: overflow2,
|
|
709
|
+
[void 0]: noGap2,
|
|
710
|
+
[void 0]: merged2
|
|
711
|
+
},
|
|
712
|
+
classes == null ? void 0 : classes.root
|
|
713
|
+
),
|
|
714
|
+
role: "group",
|
|
715
|
+
"aria-label": ariaLabel,
|
|
716
|
+
"aria-labelledby": ariaLabelledBy,
|
|
717
|
+
onKeyDown: handleKeyDown,
|
|
718
|
+
tabIndex: -1,
|
|
719
|
+
children: enhancedChildren
|
|
720
|
+
}
|
|
721
|
+
);
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
// src/shared/ui/controls/Checkbox/Checkbox.tsx
|
|
725
|
+
import classnames5 from "classnames";
|
|
726
|
+
import { useEffect, useRef as useRef2 } from "react";
|
|
727
|
+
import { mergeRefs } from "react-merge-refs";
|
|
728
|
+
import { v4 as uuidv4 } from "uuid";
|
|
729
|
+
|
|
730
|
+
// src/shared/ui/controls/Checkbox/checkbox.module.css
|
|
731
|
+
var checkbox_exports = {};
|
|
732
|
+
__export(checkbox_exports, {
|
|
733
|
+
default: () => checkbox_default
|
|
734
|
+
});
|
|
735
|
+
var checkbox_default = {};
|
|
736
|
+
|
|
737
|
+
// src/shared/ui/controls/Checkbox/Checkbox.tsx
|
|
738
|
+
import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
739
|
+
function Checkbox(props) {
|
|
740
|
+
const _a = props, { label: label2, several: several2, componentSize = "medium", classes, id, ref } = _a, inputProps = __objRest(_a, ["label", "several", "componentSize", "classes", "id", "ref"]);
|
|
741
|
+
const inputRef = useRef2(null);
|
|
742
|
+
const inputId = id != null ? id : uuidv4();
|
|
743
|
+
useEffect(() => {
|
|
744
|
+
const mouseupListener = function() {
|
|
745
|
+
this.classList.remove(void 0);
|
|
746
|
+
};
|
|
747
|
+
const mousedownListener = function() {
|
|
748
|
+
this.classList.add(void 0);
|
|
749
|
+
};
|
|
750
|
+
if (inputRef == null ? void 0 : inputRef.current) {
|
|
751
|
+
inputRef.current.addEventListener("mousedown", mousedownListener);
|
|
752
|
+
inputRef.current.addEventListener("mouseup", mouseupListener);
|
|
753
|
+
}
|
|
754
|
+
return () => {
|
|
755
|
+
if (inputRef == null ? void 0 : inputRef.current) {
|
|
756
|
+
inputRef.current.removeEventListener("mousedown", mousedownListener);
|
|
757
|
+
inputRef.current.removeEventListener("mouseup", mouseupListener);
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
}, [inputRef]);
|
|
761
|
+
useEffect(() => {
|
|
762
|
+
if (inputRef == null ? void 0 : inputRef.current) {
|
|
763
|
+
inputRef.current.indeterminate = Boolean(several2) && !Boolean(inputProps.checked);
|
|
764
|
+
}
|
|
765
|
+
}, [several2, inputProps.checked]);
|
|
766
|
+
return /* @__PURE__ */ jsxs10(
|
|
767
|
+
"div",
|
|
768
|
+
{
|
|
769
|
+
className: classnames5(
|
|
770
|
+
void 0,
|
|
771
|
+
{ [void 0]: !label2 },
|
|
772
|
+
checkbox_exports[componentSize],
|
|
773
|
+
classes == null ? void 0 : classes.root
|
|
774
|
+
),
|
|
775
|
+
children: [
|
|
776
|
+
/* @__PURE__ */ jsx36(
|
|
777
|
+
"input",
|
|
778
|
+
__spreadValues({
|
|
779
|
+
ref: mergeRefs([inputRef, ref]),
|
|
780
|
+
type: "checkbox",
|
|
781
|
+
className: classnames5(void 0, classes == null ? void 0 : classes.input),
|
|
782
|
+
id: inputId,
|
|
783
|
+
title: label2
|
|
784
|
+
}, inputProps)
|
|
785
|
+
),
|
|
786
|
+
/* @__PURE__ */ jsxs10("label", { htmlFor: inputId, className: classnames5(void 0, classes == null ? void 0 : classes.label), title: label2, children: [
|
|
787
|
+
several2 ? /* @__PURE__ */ jsx36("span", { className: classnames5(void 0, void 0, classes == null ? void 0 : classes.checkbox), children: /* @__PURE__ */ jsx36(CheckboxSeveralIcon, {}) }) : /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
788
|
+
/* @__PURE__ */ jsx36("span", { className: classnames5(void 0, void 0, classes == null ? void 0 : classes.checkbox), children: /* @__PURE__ */ jsx36(CheckboxDeselectedIcon, {}) }),
|
|
789
|
+
/* @__PURE__ */ jsx36("span", { className: classnames5(void 0, void 0, classes == null ? void 0 : classes.checkbox), children: /* @__PURE__ */ jsx36(CheckboxIcon, {}) })
|
|
790
|
+
] }),
|
|
791
|
+
!!label2 && /* @__PURE__ */ jsx36(Fragment3, { children: componentSize === "large" ? /* @__PURE__ */ jsx36(Typography, { variant: "subtitle1", className: classnames5(void 0, classes == null ? void 0 : classes.labelText), children: label2 }) : /* @__PURE__ */ jsx36(Typography, { variant: "subtitle2", className: classnames5(void 0, classes == null ? void 0 : classes.labelText), children: label2 }) })
|
|
792
|
+
] })
|
|
793
|
+
]
|
|
794
|
+
}
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// src/shared/ui/surfaces/Paper/Paper.tsx
|
|
799
|
+
import classnames6 from "classnames";
|
|
800
|
+
|
|
801
|
+
// src/shared/ui/surfaces/Paper/paper.module.css
|
|
802
|
+
var paper_exports = {};
|
|
803
|
+
__export(paper_exports, {
|
|
804
|
+
default: () => paper_default
|
|
805
|
+
});
|
|
806
|
+
var paper_default = {};
|
|
807
|
+
|
|
808
|
+
// src/shared/ui/surfaces/Paper/Paper.tsx
|
|
809
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
810
|
+
var Paper = (props) => {
|
|
811
|
+
const { shadow = "none", overlay = "none", children, classes } = props;
|
|
812
|
+
return /* @__PURE__ */ jsx37(
|
|
813
|
+
"div",
|
|
814
|
+
{
|
|
815
|
+
className: classnames6(
|
|
816
|
+
void 0,
|
|
817
|
+
shadow !== "none" && paper_exports[`shadow${shadow}`],
|
|
818
|
+
overlay !== "none" && paper_exports[`overlay${overlay}`],
|
|
819
|
+
classes == null ? void 0 : classes.root
|
|
820
|
+
),
|
|
821
|
+
children
|
|
822
|
+
}
|
|
823
|
+
);
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
// src/shared/ui/surfaces/Card/Card.tsx
|
|
827
|
+
import classNames2 from "classnames";
|
|
828
|
+
import { jsx as jsx38, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
829
|
+
function Card(props) {
|
|
830
|
+
const { shadow, overlay, header: header2, media: media2, mediaPosition = "top", footer: footer2, children, classes } = props;
|
|
831
|
+
return /* @__PURE__ */ jsxs11(Paper, { shadow, overlay, classes: { root: classNames2(void 0, classes == null ? void 0 : classes.root) }, children: [
|
|
832
|
+
!!header2 && /* @__PURE__ */ jsx38("div", { className: void 0, children: header2 }),
|
|
833
|
+
mediaPosition === "top" && !!media2 && /* @__PURE__ */ jsx38("div", { className: void 0, children: media2 }),
|
|
834
|
+
/* @__PURE__ */ jsx38("div", { className: classNames2(void 0, classes == null ? void 0 : classes.body), children }),
|
|
835
|
+
mediaPosition === "bottom" && !!media2 && /* @__PURE__ */ jsx38("div", { className: void 0, children: media2 }),
|
|
836
|
+
!!footer2 && /* @__PURE__ */ jsx38("div", { className: classNames2(void 0, classes == null ? void 0 : classes.footer), children: footer2 })
|
|
837
|
+
] });
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// src/shared/providers/ThemeProvider/ThemeProvider.tsx
|
|
841
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
842
|
+
|
|
843
|
+
// src/shared/contexts/ThemeContext/ThemeContext.ts
|
|
844
|
+
import { createContext as createContext2 } from "react";
|
|
845
|
+
var ThemeContext = createContext2(void 0);
|
|
846
|
+
|
|
847
|
+
// raw-css:C:\Users\omi\Documents\projects\omigar-ui\src\shared\styles\dark.css
|
|
848
|
+
var dark_default = {};
|
|
849
|
+
|
|
850
|
+
// raw-css:C:\Users\omi\Documents\projects\omigar-ui\src\shared\styles\light.css
|
|
851
|
+
var light_default = {};
|
|
852
|
+
|
|
853
|
+
// src/shared/providers/ThemeProvider/ThemeProvider.tsx
|
|
854
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
855
|
+
var themes = [
|
|
856
|
+
{ name: "light", css: light_default },
|
|
857
|
+
{ name: "dark", css: dark_default }
|
|
858
|
+
];
|
|
859
|
+
var ThemeProvider = ({ children }) => {
|
|
860
|
+
const [theme, setThemeState] = useState2(() => {
|
|
861
|
+
const savedTheme = localStorage.getItem("theme");
|
|
862
|
+
if (savedTheme) {
|
|
863
|
+
return savedTheme;
|
|
864
|
+
}
|
|
865
|
+
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
866
|
+
return "dark";
|
|
867
|
+
}
|
|
868
|
+
return "light";
|
|
869
|
+
});
|
|
870
|
+
const setTheme = (newTheme) => {
|
|
871
|
+
setThemeState(newTheme);
|
|
872
|
+
localStorage.setItem("theme", newTheme);
|
|
873
|
+
};
|
|
874
|
+
const toggleTheme = () => {
|
|
875
|
+
setTheme(theme === "light" ? "dark" : "light");
|
|
876
|
+
};
|
|
877
|
+
useEffect2(() => {
|
|
878
|
+
const applyTheme = (themeName) => {
|
|
879
|
+
let style = document.getElementById("theme-style");
|
|
880
|
+
if (!style) {
|
|
881
|
+
style = document.createElement("style");
|
|
882
|
+
style.id = "theme-style";
|
|
883
|
+
document.head.appendChild(style);
|
|
884
|
+
}
|
|
885
|
+
const matchedTheme = themes == null ? void 0 : themes.find((t) => t.name === themeName);
|
|
886
|
+
style.textContent = (matchedTheme == null ? void 0 : matchedTheme.css) || themes[0].css;
|
|
887
|
+
};
|
|
888
|
+
applyTheme(theme);
|
|
889
|
+
}, [theme]);
|
|
890
|
+
useEffect2(() => {
|
|
891
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
892
|
+
const handleChange = (e) => {
|
|
893
|
+
if (!localStorage.getItem("theme")) {
|
|
894
|
+
setThemeState(e.matches ? "dark" : "light");
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
898
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
899
|
+
}, []);
|
|
900
|
+
const value = {
|
|
901
|
+
theme,
|
|
902
|
+
toggleTheme,
|
|
903
|
+
setTheme
|
|
904
|
+
};
|
|
905
|
+
return /* @__PURE__ */ jsx39(ThemeContext.Provider, { value, children });
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
// src/shared/hooks/useTheme.ts
|
|
909
|
+
import { useContext as useContext4 } from "react";
|
|
910
|
+
function useTheme() {
|
|
911
|
+
const context = useContext4(ThemeContext);
|
|
912
|
+
return context || null;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
// src/shared/hooks/useThemeWithFallback.ts
|
|
916
|
+
import { useContext as useContext5 } from "react";
|
|
917
|
+
function useThemeWithFallback() {
|
|
918
|
+
const context = useContext5(ThemeContext);
|
|
919
|
+
if (context) {
|
|
920
|
+
return context;
|
|
921
|
+
}
|
|
922
|
+
return {
|
|
923
|
+
theme: "light",
|
|
924
|
+
toggleTheme: () => {
|
|
925
|
+
},
|
|
926
|
+
setTheme: () => {
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
export {
|
|
931
|
+
Button,
|
|
932
|
+
ButtonsGroup,
|
|
933
|
+
Card,
|
|
934
|
+
Checkbox,
|
|
935
|
+
Paper,
|
|
936
|
+
Popover,
|
|
937
|
+
Arrow as PopoverArrow,
|
|
938
|
+
ThemeProvider,
|
|
939
|
+
Typography,
|
|
940
|
+
icons_exports as icons,
|
|
941
|
+
useTheme,
|
|
942
|
+
useThemeWithFallback
|
|
943
|
+
};
|
|
944
|
+
//# sourceMappingURL=index.mjs.map
|