@divayth/brick-ui 0.6.1 → 0.7.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.
- package/dist/app/ModalProvider.d.ts.map +1 -0
- package/dist/{ui/Modal → app}/ModalProvider.js +1 -1
- package/dist/app/Provider.d.ts +7 -8
- package/dist/app/Provider.d.ts.map +1 -1
- package/dist/app/Provider.js +16 -57
- package/dist/app/ThemeProvider.d.ts +14 -0
- package/dist/app/ThemeProvider.d.ts.map +1 -0
- package/dist/app/ThemeProvider.js +43 -0
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.d.ts.map +1 -1
- package/dist/index.js +44 -42
- package/dist/styles.css +1 -1
- package/dist/ui/Date/DateInput.d.ts +1 -1
- package/dist/ui/Date/DateInput.d.ts.map +1 -1
- package/dist/ui/Date/DateInput.js +14 -14
- package/dist/ui/Field/Field.d.ts +1 -1
- package/dist/ui/Field/Field.d.ts.map +1 -1
- package/dist/ui/Flex/Flex.d.ts +3 -3
- package/dist/ui/Flex/Flex.d.ts.map +1 -1
- package/dist/ui/Flex/Flex.js +12 -14
- package/dist/ui/Flex/constants.d.ts +1 -1
- package/dist/ui/Flex/constants.d.ts.map +1 -1
- package/dist/ui/Flex/index.d.ts +2 -0
- package/dist/ui/Flex/index.d.ts.map +1 -0
- package/dist/ui/Grid/Grid.types.d.ts +2 -2
- package/dist/ui/Grid/Grid.types.d.ts.map +1 -1
- package/dist/ui/Input/Input.d.ts +1 -1
- package/dist/ui/Input/Input.d.ts.map +1 -1
- package/dist/ui/Input/Input.js +31 -27
- package/dist/ui/Input/index.d.ts +2 -0
- package/dist/ui/Input/index.d.ts.map +1 -0
- package/dist/ui/Modal/Modal.d.ts +8 -6
- package/dist/ui/Modal/Modal.d.ts.map +1 -1
- package/dist/ui/Modal/Modal.js +87 -103
- package/dist/ui/Modal/Modal.module.css.js +17 -17
- package/dist/ui/Modal/ModalContext.js +2 -2
- package/dist/ui/Modal/index.d.ts +4 -0
- package/dist/ui/Modal/index.d.ts.map +1 -0
- package/dist/ui/MultipleChip/MultipleChip.d.ts +1 -1
- package/dist/ui/MultipleChip/MultipleChip.d.ts.map +1 -1
- package/dist/ui/NoData/NoData.d.ts +1 -1
- package/dist/ui/NoData/NoData.d.ts.map +1 -1
- package/dist/ui/Select/Select.types.d.ts +1 -1
- package/dist/ui/Select/Select.types.d.ts.map +1 -1
- package/dist/ui/Select/SelectOptions.js +1 -1
- package/dist/ui/Sticky/Sticky.d.ts +1 -1
- package/dist/ui/Sticky/Sticky.d.ts.map +1 -1
- package/dist/ui/Tabs/TabsList.d.ts +1 -1
- package/dist/ui/Tabs/TabsList.d.ts.map +1 -1
- package/dist/ui/Textarea/Textarea.d.ts +1 -1
- package/dist/ui/Textarea/Textarea.d.ts.map +1 -1
- package/dist/ui/Tooltip/Tooltip.js +15 -15
- package/dist/ui/index.d.ts +3 -5
- package/dist/ui/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/ui/Modal/ModalProvider.d.ts.map +0 -1
- /package/dist/{ui/Modal → app}/ModalProvider.d.ts +0 -0
- /package/dist/app/{Provider.module.css.js → ThemeProvider.module.css.js} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
3
3
|
import { useState as O, useRef as S } from "react";
|
|
4
4
|
import { useComposedRefs as j } from "@radix-ui/react-compose-refs";
|
|
5
|
-
import
|
|
5
|
+
import l from "clsx";
|
|
6
6
|
import { CalendarDays as F } from "lucide-react";
|
|
7
7
|
import { DayPicker as k } from "react-day-picker";
|
|
8
8
|
import { ru as w, enUS as M } from "react-day-picker/locale";
|
|
@@ -12,12 +12,12 @@ import { Input as W } from "../Input/Input.js";
|
|
|
12
12
|
import { Popover as a } from "../Popover/Popover.js";
|
|
13
13
|
import { formatDate as q } from "../../lib/dates.js";
|
|
14
14
|
/* empty css */
|
|
15
|
-
import
|
|
15
|
+
import p from "./DateInput.module.css.js";
|
|
16
16
|
const _ = ({
|
|
17
|
-
value:
|
|
17
|
+
value: r,
|
|
18
18
|
onChange: f,
|
|
19
19
|
calendarProps: u,
|
|
20
|
-
disabled:
|
|
20
|
+
disabled: o,
|
|
21
21
|
className: d,
|
|
22
22
|
endIcon: g,
|
|
23
23
|
label: n,
|
|
@@ -28,43 +28,43 @@ const _ = ({
|
|
|
28
28
|
className: D,
|
|
29
29
|
autoFocus: y = !0,
|
|
30
30
|
animate: P = !0,
|
|
31
|
-
defaultMonth: R =
|
|
31
|
+
defaultMonth: R = r ?? void 0,
|
|
32
32
|
...v
|
|
33
33
|
} = u ?? {};
|
|
34
|
-
return /* @__PURE__ */ e(a.Root, { open: m && !
|
|
34
|
+
return /* @__PURE__ */ e(a.Root, { open: m && !o, onOpenChange: i, children: /* @__PURE__ */ I(U, { direction: "col", gap: "none", className: "relative", children: [
|
|
35
35
|
/* @__PURE__ */ e(a.Trigger, { children: /* @__PURE__ */ e(
|
|
36
36
|
W,
|
|
37
37
|
{
|
|
38
38
|
ref: N,
|
|
39
|
-
value: q(
|
|
39
|
+
value: q(r, s),
|
|
40
40
|
type: "text",
|
|
41
41
|
readOnly: !0,
|
|
42
|
-
disabled:
|
|
42
|
+
disabled: o,
|
|
43
43
|
label: n,
|
|
44
44
|
endIcon: g ?? F,
|
|
45
45
|
"aria-haspopup": "dialog",
|
|
46
|
-
"aria-expanded": m && !
|
|
47
|
-
className:
|
|
46
|
+
"aria-expanded": m && !o,
|
|
47
|
+
className: l({ "cursor-pointer": !o }, d),
|
|
48
48
|
...x
|
|
49
49
|
}
|
|
50
50
|
) }),
|
|
51
51
|
/* @__PURE__ */ e(
|
|
52
52
|
a.Content,
|
|
53
53
|
{
|
|
54
|
-
container: t.current?.closest("dialog"),
|
|
54
|
+
container: t.current?.closest('dialog, [role="dialog"]'),
|
|
55
55
|
align: "start",
|
|
56
56
|
"aria-label": n ?? C.chooseDate,
|
|
57
|
-
className:
|
|
57
|
+
className: p.dropdown,
|
|
58
58
|
children: /* @__PURE__ */ e(
|
|
59
59
|
k,
|
|
60
60
|
{
|
|
61
|
-
className: p
|
|
61
|
+
className: l(p.calendar, D),
|
|
62
62
|
autoFocus: y,
|
|
63
63
|
animate: P,
|
|
64
64
|
mode: "single",
|
|
65
65
|
locale: s.startsWith("ru") ? w : M,
|
|
66
66
|
defaultMonth: R,
|
|
67
|
-
selected:
|
|
67
|
+
selected: r ?? void 0,
|
|
68
68
|
onSelect: (c) => {
|
|
69
69
|
c && (f?.(c), i(!1), t.current?.focus());
|
|
70
70
|
},
|
package/dist/ui/Field/Field.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LucideIcon } from 'lucide-react';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
|
-
import { type FlexProps } from '../Flex/
|
|
3
|
+
import { type FlexProps } from '../Flex/index.js';
|
|
4
4
|
import type { Size } from '../../lib/sizes.js';
|
|
5
5
|
export type ControlSize = Exclude<Size, 'xs' | 'xl'>;
|
|
6
6
|
export interface FieldControlProps extends ComponentProps<'div'> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/ui/Field/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/ui/Field/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAI1C,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC;AAErD,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC9D,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,wBAAwB,SAAS,gCAIrD,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,OAAO,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,KAAK,GAAI,gCAAgC,eAAe,gCAMpE,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,0CAKrB,iBAAiB,gCASnB,CAAC;AAEF,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,MAAM,CAAC;IAC5D,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CAC5B;AAED,eAAO,MAAM,IAAI,GAAI,wDAKlB,cAAc,gCAQhB,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAC7D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,KAAK,GAAI,gCAAgC,eAAe,gCAIpE,CAAC;AAEF,eAAO,MAAM,KAAK;mCAhE2B,SAAS;4CAUA,eAAe;wDAalE,iBAAiB;mEAqBjB,cAAc;4CAcqC,eAAe;CAMX,CAAC"}
|
package/dist/ui/Flex/Flex.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
import { type AlignItemsType, type DirectionType, type GapType, type
|
|
2
|
+
import { type AlignItemsType, type DirectionType, type GapType, type JustifyContentType } from './constants.js';
|
|
3
3
|
export interface FlexProps extends ComponentProps<'div'> {
|
|
4
4
|
direction?: DirectionType;
|
|
5
5
|
alignItems?: AlignItemsType;
|
|
6
|
-
justifyContent?:
|
|
6
|
+
justifyContent?: JustifyContentType;
|
|
7
7
|
gap?: GapType;
|
|
8
8
|
}
|
|
9
|
-
export declare const Flex: ({
|
|
9
|
+
export declare const Flex: ({ direction, gap, justifyContent, alignItems, className, ...props }: FlexProps) => import("react").JSX.Element;
|
|
10
10
|
//# sourceMappingURL=Flex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/ui/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/ui/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,aAAa,EAElB,KAAK,OAAO,EAEZ,KAAK,kBAAkB,EACxB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,KAAK,CAAC;IACtD,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACpC,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,IAAI,GAAI,qEAOlB,SAAS,gCAYX,CAAC"}
|
package/dist/ui/Flex/Flex.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import { jsx as _ } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
direction: t = "row",
|
|
2
|
+
import { cn as e } from "../../lib/cn.js";
|
|
3
|
+
import { JUSTIFY_CONTENT_SX as I, ALIGN_ITEMS_SX as N, DIRECTION_SX as T, GAP_SX as c } from "./constants.js";
|
|
4
|
+
const x = ({
|
|
5
|
+
direction: r = "row",
|
|
7
6
|
gap: o = "md",
|
|
8
|
-
justifyContent:
|
|
7
|
+
justifyContent: t = "start",
|
|
9
8
|
alignItems: m = "stretch",
|
|
10
9
|
className: s,
|
|
11
10
|
...S
|
|
12
11
|
}) => /* @__PURE__ */ _(
|
|
13
12
|
"div",
|
|
14
13
|
{
|
|
15
|
-
className:
|
|
14
|
+
className: e(
|
|
16
15
|
"flex",
|
|
17
|
-
|
|
18
|
-
T[
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
c[o],
|
|
17
|
+
T[r],
|
|
18
|
+
N[m],
|
|
19
|
+
I[t],
|
|
21
20
|
s
|
|
22
21
|
),
|
|
23
|
-
...S
|
|
24
|
-
children: r
|
|
22
|
+
...S
|
|
25
23
|
}
|
|
26
24
|
);
|
|
27
25
|
export {
|
|
28
|
-
|
|
26
|
+
x as Flex
|
|
29
27
|
};
|
|
@@ -24,7 +24,7 @@ export declare const GAP_SX: {
|
|
|
24
24
|
readonly xl: "gap-8";
|
|
25
25
|
};
|
|
26
26
|
export type AlignItemsType = keyof typeof ALIGN_ITEMS_SX;
|
|
27
|
-
export type
|
|
27
|
+
export type JustifyContentType = keyof typeof JUSTIFY_CONTENT_SX;
|
|
28
28
|
export type DirectionType = keyof typeof DIRECTION_SX;
|
|
29
29
|
export type GapType = Size | 'none';
|
|
30
30
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/ui/Flex/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;CAKrB,CAAC;AAEX,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;;;CAOT,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,cAAc,CAAC;AAEzD,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/ui/Flex/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAO,MAAM,cAAc;;;;;CAKjB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;CAKrB,CAAC;AAEX,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;;;CAOT,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,cAAc,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAEjE,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,YAAY,CAAC;AAEtD,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Flex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
import type { AlignItemsType,
|
|
2
|
+
import type { AlignItemsType, JustifyContentType } from '../Flex/constants.js';
|
|
3
3
|
import type { ResponsiveSize } from '../../lib/getResponsiveSize.js';
|
|
4
4
|
import type { Size } from '../../lib/sizes.js';
|
|
5
5
|
export type GridGap = Size | 'none';
|
|
@@ -11,7 +11,7 @@ export interface GridRootProps extends ComponentProps<'div'> {
|
|
|
11
11
|
rowGap?: ResponsiveValue<GridGap>;
|
|
12
12
|
columnGap?: ResponsiveValue<GridGap>;
|
|
13
13
|
align?: AlignItemsType;
|
|
14
|
-
justify?:
|
|
14
|
+
justify?: JustifyContentType;
|
|
15
15
|
}
|
|
16
16
|
export interface GridItemProps extends ComponentProps<'div'> {
|
|
17
17
|
size?: GridItemSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.types.d.ts","sourceRoot":"","sources":["../../../src/ui/Grid/Grid.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"Grid.types.d.ts","sourceRoot":"","sources":["../../../src/ui/Grid/Grid.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC;AAEpC,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,GAAG,MAAM,CAAC;AAEnE,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC1D,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,MAAM,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,eAAe,CAAC,cAAc,GAAG,MAAM,CAAC,CAAC;CAClD"}
|
package/dist/ui/Input/Input.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export interface InputControlProps {
|
|
|
10
10
|
fullWidth?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export type InputProps = InputControlProps & Omit<ComponentProps<'input'>, 'size'>;
|
|
13
|
-
export declare const Input: ({ id: idProps, label, error, size, fullWidth, className, startIcon, endIcon, ...inputProps }: InputProps) => import("react").JSX.Element;
|
|
13
|
+
export declare const Input: ({ id: idProps, label, error, size, fullWidth, className, startIcon, endIcon, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, ...inputProps }: InputProps) => import("react").JSX.Element;
|
|
14
14
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/ui/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAS,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/ui/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAS,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,KAAK,WAAW,EAAS,MAAM,oBAAoB,CAAC;AAK7D,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,iBAAiB,GACtC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,CAAC;AAE1C,eAAO,MAAM,KAAK,GAAI,4JAYnB,UAAU,gCA6BZ,CAAC"}
|
package/dist/ui/Input/Input.js
CHANGED
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useId as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
const
|
|
2
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useId as I } from "react";
|
|
4
|
+
import { Field as i } from "../Field/Field.js";
|
|
5
|
+
import { cn as j } from "../../lib/cn.js";
|
|
6
|
+
import t from "./Input.module.css.js";
|
|
7
|
+
const g = ({
|
|
8
8
|
id: l,
|
|
9
|
-
label:
|
|
10
|
-
error:
|
|
11
|
-
size:
|
|
9
|
+
label: a,
|
|
10
|
+
error: o,
|
|
11
|
+
size: m = "md",
|
|
12
12
|
fullWidth: p = !1,
|
|
13
13
|
className: f,
|
|
14
|
-
startIcon:
|
|
15
|
-
endIcon:
|
|
16
|
-
|
|
14
|
+
startIcon: n,
|
|
15
|
+
endIcon: d,
|
|
16
|
+
"aria-describedby": u,
|
|
17
|
+
"aria-invalid": h,
|
|
18
|
+
...b
|
|
17
19
|
}) => {
|
|
18
|
-
const
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
20
|
+
const v = I(), e = l ?? v, s = o ? `${e}-error` : void 0, w = [u, s].filter(Boolean).join(" ") || void 0;
|
|
21
|
+
return /* @__PURE__ */ c(i.Root, { className: p ? "w-full" : "w-auto", children: [
|
|
22
|
+
a && /* @__PURE__ */ r(i.Label, { htmlFor: e, label: a }),
|
|
23
|
+
/* @__PURE__ */ c(i.Control, { size: m, children: [
|
|
24
|
+
n && /* @__PURE__ */ r(i.Icon, { icon: n }),
|
|
23
25
|
/* @__PURE__ */ r(
|
|
24
26
|
"input",
|
|
25
27
|
{
|
|
26
|
-
id:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
id: e,
|
|
29
|
+
"aria-invalid": o ? !0 : h,
|
|
30
|
+
"aria-describedby": w,
|
|
31
|
+
className: j(
|
|
32
|
+
t.input,
|
|
33
|
+
o && t.error,
|
|
34
|
+
n && t.withStartIcon,
|
|
35
|
+
d && t.withEndIcon,
|
|
32
36
|
f
|
|
33
37
|
),
|
|
34
|
-
...
|
|
38
|
+
...b
|
|
35
39
|
}
|
|
36
40
|
),
|
|
37
|
-
|
|
41
|
+
d && /* @__PURE__ */ r(i.Icon, { icon: d, position: "end" })
|
|
38
42
|
] }),
|
|
39
|
-
|
|
43
|
+
o && /* @__PURE__ */ r(i.Error, { id: s, error: o })
|
|
40
44
|
] });
|
|
41
45
|
};
|
|
42
46
|
export {
|
|
43
|
-
|
|
47
|
+
g as Input
|
|
44
48
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/ui/Modal/Modal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
2
|
import { type ButtonProps } from '../Button/index.js';
|
|
3
|
-
import { type FlexProps } from '../Flex/
|
|
3
|
+
import { type FlexProps } from '../Flex/index.js';
|
|
4
4
|
export declare const MODAL_SIZE: {
|
|
5
5
|
readonly xs: "xs";
|
|
6
6
|
readonly sm: "sm";
|
|
@@ -14,18 +14,20 @@ export interface ModalRootProps {
|
|
|
14
14
|
size?: ModalSize;
|
|
15
15
|
className?: string;
|
|
16
16
|
closeDisabled?: boolean;
|
|
17
|
+
open?: boolean;
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
19
|
'aria-label'?: string;
|
|
18
20
|
}
|
|
19
21
|
interface HeaderProps extends FlexProps {
|
|
22
|
+
text: string | ReactElement;
|
|
20
23
|
closeLabel?: string;
|
|
21
24
|
startIcon?: ReactNode;
|
|
22
25
|
withCloseButton?: boolean;
|
|
23
26
|
}
|
|
24
27
|
export declare const Modal: {
|
|
25
|
-
Root: ({ children, size, className, closeDisabled, "aria-label": ariaLabel, }: ModalRootProps) => import("react").JSX.Element;
|
|
26
|
-
Header: ({ children, startIcon, withCloseButton, closeLabel, ...props }: HeaderProps) => import("react").JSX.Element;
|
|
27
|
-
Content: ({
|
|
28
|
-
Footer: ({ children, justifyContent, ...props }: FlexProps) => import("react").JSX.Element;
|
|
28
|
+
Root: ({ children, size, className, closeDisabled, open, onOpenChange, "aria-label": ariaLabel, }: ModalRootProps) => import("react").JSX.Element;
|
|
29
|
+
Header: ({ text, children, startIcon, withCloseButton, closeLabel, ...props }: HeaderProps) => import("react").JSX.Element;
|
|
30
|
+
Content: ({ className, ...props }: FlexProps) => import("react").JSX.Element;
|
|
29
31
|
Cancel: ({ children, onClick, disabled, ...props }: ButtonProps) => import("react").JSX.Element;
|
|
30
32
|
Confirm: ({ children, type, ...props }: ButtonProps) => import("react").JSX.Element;
|
|
31
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/ui/Modal/Modal.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/ui/Modal/Modal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAMf,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAShD,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AACX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAWrE,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AA6DD,UAAU,WAAY,SAAQ,SAAS;IACrC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAoED,eAAO,MAAM,KAAK;uGA5Hf,cAAc;mFAiEd,WAAW;uCA0B4B,SAAS;wDAIQ,WAAW;4CAoBZ,WAAW;CASN,CAAC"}
|
package/dist/ui/Modal/Modal.js
CHANGED
|
@@ -1,130 +1,114 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
2
|
+
import { jsx as o, jsxs as x } from "react/jsx-runtime";
|
|
3
|
+
import { useContext as M, useRef as y, useCallback as E, useMemo as N, createContext as P } from "react";
|
|
4
|
+
import { X as R } from "lucide-react";
|
|
5
|
+
import { Dialog as u } from "radix-ui";
|
|
6
6
|
import { useProvider as p } from "../../app/Provider.js";
|
|
7
|
-
import { Button as
|
|
7
|
+
import { Button as b } from "../Button/Button.js";
|
|
8
8
|
import { Flex as v } from "../Flex/Flex.js";
|
|
9
|
-
import { IconButton as
|
|
10
|
-
import { Text as
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
|
|
9
|
+
import { IconButton as D } from "../IconButton/IconButton.js";
|
|
10
|
+
import { Text as F } from "../Text/Text.js";
|
|
11
|
+
import { cn as g } from "../../lib/cn.js";
|
|
12
|
+
import { useModal as I } from "./ModalContext.js";
|
|
13
|
+
import i from "./Modal.module.css.js";
|
|
14
|
+
const j = {
|
|
14
15
|
xs: "xs",
|
|
15
16
|
sm: "sm",
|
|
16
17
|
md: "md",
|
|
17
18
|
lg: "lg",
|
|
18
19
|
xl: "xl"
|
|
19
|
-
},
|
|
20
|
+
}, C = P(
|
|
20
21
|
{}
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
closeDisabled: r = !1,
|
|
30
|
-
"aria-label": c
|
|
22
|
+
), k = ({
|
|
23
|
+
children: e,
|
|
24
|
+
size: r = j.md,
|
|
25
|
+
className: s,
|
|
26
|
+
closeDisabled: t = !1,
|
|
27
|
+
open: m = !0,
|
|
28
|
+
onOpenChange: n,
|
|
29
|
+
"aria-label": a
|
|
31
30
|
}) => {
|
|
32
|
-
const { closeModal:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const e = i.current;
|
|
38
|
-
if (!e) return;
|
|
39
|
-
e.showModal();
|
|
40
|
-
const y = L();
|
|
41
|
-
return () => {
|
|
42
|
-
e.close(), y();
|
|
43
|
-
};
|
|
44
|
-
}, []);
|
|
45
|
-
const f = (e) => {
|
|
46
|
-
if (e.target !== e.currentTarget) return !1;
|
|
47
|
-
const { left: y, right: k, top: I, bottom: O } = e.currentTarget.getBoundingClientRect();
|
|
48
|
-
return e.clientX < y || e.clientX > k || e.clientY < I || e.clientY > O;
|
|
49
|
-
};
|
|
50
|
-
return /* @__PURE__ */ s(x.Provider, { value: u, children: /* @__PURE__ */ s(
|
|
51
|
-
"dialog",
|
|
31
|
+
const { closeModal: l } = I(), d = y(null), f = E(() => {
|
|
32
|
+
n ? n(!1) : l();
|
|
33
|
+
}, [n, l]), h = N(() => ({ closeDisabled: t, closeModal: f }), [t, f]);
|
|
34
|
+
return /* @__PURE__ */ o(C.Provider, { value: h, children: /* @__PURE__ */ o(
|
|
35
|
+
u.Root,
|
|
52
36
|
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"aria-labelledby": c ? void 0 : d,
|
|
57
|
-
"aria-label": c,
|
|
58
|
-
onCancel: (e) => {
|
|
59
|
-
e.preventDefault(), r || a();
|
|
60
|
-
},
|
|
61
|
-
onPointerDown: (e) => {
|
|
62
|
-
t.current = f(e);
|
|
63
|
-
},
|
|
64
|
-
onClick: (e) => {
|
|
65
|
-
!r && t.current && f(e) && a(), t.current = !1;
|
|
37
|
+
open: m,
|
|
38
|
+
onOpenChange: (c) => {
|
|
39
|
+
!c && !t && f();
|
|
66
40
|
},
|
|
67
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ x(u.Portal, { children: [
|
|
42
|
+
/* @__PURE__ */ o(u.Overlay, { className: i.overlay }),
|
|
43
|
+
/* @__PURE__ */ o(
|
|
44
|
+
u.Content,
|
|
45
|
+
{
|
|
46
|
+
className: g(i.root, i[r], s),
|
|
47
|
+
"aria-describedby": void 0,
|
|
48
|
+
"aria-label": a,
|
|
49
|
+
onEscapeKeyDown: (c) => {
|
|
50
|
+
t && c.preventDefault();
|
|
51
|
+
},
|
|
52
|
+
onInteractOutside: (c) => {
|
|
53
|
+
t && c.preventDefault();
|
|
54
|
+
},
|
|
55
|
+
onOpenAutoFocus: () => {
|
|
56
|
+
d.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
57
|
+
},
|
|
58
|
+
onCloseAutoFocus: (c) => {
|
|
59
|
+
d.current?.isConnected && (c.preventDefault(), d.current.focus());
|
|
60
|
+
},
|
|
61
|
+
...a ? { "aria-labelledby": void 0 } : {},
|
|
62
|
+
children: /* @__PURE__ */ o(v, { direction: "col", gap: "md", className: i.layout, children: e })
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] })
|
|
68
66
|
}
|
|
69
67
|
) });
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
}, w = ({
|
|
69
|
+
text: e,
|
|
70
|
+
children: r,
|
|
71
|
+
startIcon: s,
|
|
72
|
+
withCloseButton: t = !0,
|
|
73
|
+
closeLabel: m,
|
|
74
|
+
...n
|
|
76
75
|
}) => {
|
|
77
|
-
const { messages: a } = p(), {
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
-
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
const { messages: a } = p(), { closeDisabled: l, closeModal: d } = M(C);
|
|
77
|
+
return /* @__PURE__ */ x(v, { justifyContent: "between", alignItems: "start", ...n, children: [
|
|
78
|
+
s,
|
|
79
|
+
/* @__PURE__ */ o(u.Title, { asChild: !0, children: typeof e == "string" ? /* @__PURE__ */ o(F, { size: "xl", weight: "medium", children: e }) : e }),
|
|
80
|
+
r,
|
|
81
|
+
t && /* @__PURE__ */ o(
|
|
82
|
+
D,
|
|
83
83
|
{
|
|
84
|
-
className:
|
|
84
|
+
className: i.close,
|
|
85
85
|
color: "secondary",
|
|
86
|
-
"aria-label":
|
|
87
|
-
disabled:
|
|
88
|
-
onClick:
|
|
89
|
-
children: /* @__PURE__ */
|
|
86
|
+
"aria-label": m ?? a.close,
|
|
87
|
+
disabled: l,
|
|
88
|
+
onClick: d,
|
|
89
|
+
children: /* @__PURE__ */ o(R, {})
|
|
90
90
|
}
|
|
91
91
|
)
|
|
92
92
|
] });
|
|
93
|
-
},
|
|
94
|
-
const
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
if (!t) return;
|
|
98
|
-
const d = () => i(t.scrollHeight > t.clientHeight), u = new ResizeObserver(d);
|
|
99
|
-
return u.observe(t), Array.from(t.children).forEach((f) => u.observe(f)), d(), () => u.disconnect();
|
|
100
|
-
}, [o]), /* @__PURE__ */ s(
|
|
101
|
-
v,
|
|
102
|
-
{
|
|
103
|
-
ref: c,
|
|
104
|
-
className: E(m.content, { [m.scrollable]: a }, n),
|
|
105
|
-
...r,
|
|
106
|
-
children: o
|
|
107
|
-
}
|
|
108
|
-
);
|
|
109
|
-
}, _ = ({ children: o, justifyContent: n = "end", ...l }) => /* @__PURE__ */ s(v, { direction: "row", justifyContent: n, ...l, children: o }), q = ({ children: o, onClick: n, disabled: l, ...r }) => {
|
|
110
|
-
const { messages: c } = p(), { closeModal: a } = h(), { closeDisabled: i } = M(x);
|
|
111
|
-
return /* @__PURE__ */ s(
|
|
112
|
-
S,
|
|
93
|
+
}, A = ({ className: e, ...r }) => /* @__PURE__ */ o(v, { className: g(i.content, e), ...r }), O = ({ children: e, onClick: r, disabled: s, ...t }) => {
|
|
94
|
+
const { messages: m } = p(), { closeDisabled: n, closeModal: a } = M(C);
|
|
95
|
+
return /* @__PURE__ */ o(
|
|
96
|
+
b,
|
|
113
97
|
{
|
|
114
98
|
variant: "outlined",
|
|
115
|
-
disabled:
|
|
116
|
-
onClick: (
|
|
117
|
-
|
|
99
|
+
disabled: s || n,
|
|
100
|
+
onClick: (l) => {
|
|
101
|
+
n || (r?.(l), l.defaultPrevented || a());
|
|
118
102
|
},
|
|
119
|
-
...
|
|
120
|
-
children:
|
|
103
|
+
...t,
|
|
104
|
+
children: e === void 0 ? m.cancel : e
|
|
121
105
|
}
|
|
122
106
|
);
|
|
123
|
-
},
|
|
124
|
-
const { messages:
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
},
|
|
107
|
+
}, T = ({ children: e, type: r = "submit", ...s }) => {
|
|
108
|
+
const { messages: t } = p();
|
|
109
|
+
return /* @__PURE__ */ o(b, { type: r, ...s, children: e === void 0 ? t.confirm : e });
|
|
110
|
+
}, J = { Root: k, Header: w, Content: A, Cancel: O, Confirm: T };
|
|
127
111
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
112
|
+
j as MODAL_SIZE,
|
|
113
|
+
J as Modal
|
|
130
114
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
const o = "
|
|
1
|
+
const o = "_root_1oqf7_2", _ = "_overlay_1oqf7_21", t = "_layout_1oqf7_28", s = "_content_1oqf7_32", c = "_xs_1oqf7_40", l = "_sm_1oqf7_41", n = "_md_1oqf7_42", e = "_lg_1oqf7_43", f = "_xl_1oqf7_44", q = "_close_1oqf7_46", a = {
|
|
2
2
|
root: o,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
xs:
|
|
3
|
+
overlay: _,
|
|
4
|
+
layout: t,
|
|
5
|
+
content: s,
|
|
6
|
+
xs: c,
|
|
7
7
|
sm: l,
|
|
8
|
-
md:
|
|
9
|
-
lg:
|
|
10
|
-
xl:
|
|
11
|
-
close:
|
|
8
|
+
md: n,
|
|
9
|
+
lg: e,
|
|
10
|
+
xl: f,
|
|
11
|
+
close: q
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
q as close,
|
|
15
|
+
s as content,
|
|
16
16
|
a as default,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
t as layout,
|
|
18
|
+
e as lg,
|
|
19
|
+
n as md,
|
|
20
|
+
_ as overlay,
|
|
20
21
|
o as root,
|
|
21
|
-
s as scrollable,
|
|
22
22
|
l as sm,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
f as xl,
|
|
24
|
+
c as xs
|
|
25
25
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,KAAK,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|