@caspeco/casper-ui-library 9.6.1 → 9.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/components/collapsible/collapsible.composition.d.ts +4 -0
- package/dist/components/collapsible/collapsible.composition.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.d.ts +3 -0
- package/dist/components/collapsible/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.js +117 -0
- package/dist/components/collapsible/collapsible.spec.d.ts +2 -0
- package/dist/components/collapsible/collapsible.spec.d.ts.map +1 -0
- package/dist/components/collapsible/collapsible.visual.test.d.ts +2 -0
- package/dist/components/collapsible/collapsible.visual.test.d.ts.map +1 -0
- package/dist/components/collapsible/index.d.ts +3 -0
- package/dist/components/collapsible/index.d.ts.map +1 -0
- package/dist/components/collapsible/translations.d.ts +32 -0
- package/dist/components/collapsible/translations.d.ts.map +1 -0
- package/dist/components/collapsible/translations.js +30 -0
- package/dist/components/collapsible/types.d.ts +15 -0
- package/dist/components/collapsible/types.d.ts.map +1 -0
- package/dist/components/form-control/form-control.d.ts +1 -1
- package/dist/components/form-control/form-control.d.ts.map +1 -1
- package/dist/components/modal/modal.d.ts +2 -2
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/modal/modal.js +14 -16
- package/dist/components/textarea/textarea.d.ts +2 -2
- package/dist/components/textarea/textarea.d.ts.map +1 -1
- package/dist/components/textarea/textarea.js +8 -9
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.js +9 -9
- package/dist/hooks/use-remove-attributes.d.ts +14 -0
- package/dist/hooks/use-remove-attributes.d.ts.map +1 -0
- package/dist/hooks/use-remove-attributes.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +667 -665
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const DefaultState: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const CollapsedState: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const NonCollapsibleContent: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=collapsible.composition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/collapsible.composition.tsx"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,+CAIxB,CAAC;AAEF,eAAO,MAAM,cAAc,+CAI1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,+CAIjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/collapsible.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIhD,eAAO,MAAM,WAAW,GAAI,yDAKzB,gBAAgB,4CAwFlB,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
2
|
+
import { Collapsible as o, Box as a, Flex as R } from "@chakra-ui/react";
|
|
3
|
+
import { useState as m, useRef as y, useLayoutEffect as O } from "react";
|
|
4
|
+
import { useRemoveAttributes as S } from "../../hooks/use-remove-attributes.js";
|
|
5
|
+
import { translations as f } from "./translations.js";
|
|
6
|
+
import { ThemeSpaceVariable as D, ThemeColorVariable as d } from "../../theme/theme-types.js";
|
|
7
|
+
import { ExpandIcon as E } from "../icon/icons/expand-icon.js";
|
|
8
|
+
const s = "200ms", k = ({
|
|
9
|
+
children: h,
|
|
10
|
+
collapsedHeight: r,
|
|
11
|
+
defaultExpanded: b = !0,
|
|
12
|
+
locale: l = "en-US"
|
|
13
|
+
}) => {
|
|
14
|
+
const [g, C] = m(b), [c, x] = m(!0), i = y(null), t = c ? g : !0;
|
|
15
|
+
return S(i, ["inert"], !t), O(() => {
|
|
16
|
+
const n = i.current;
|
|
17
|
+
if (!n) return;
|
|
18
|
+
const p = () => {
|
|
19
|
+
const v = n.getBoundingClientRect().height;
|
|
20
|
+
x(v > r);
|
|
21
|
+
};
|
|
22
|
+
p();
|
|
23
|
+
const u = new ResizeObserver(p);
|
|
24
|
+
return u.observe(n), () => {
|
|
25
|
+
u.disconnect();
|
|
26
|
+
};
|
|
27
|
+
}, [r]), /* @__PURE__ */ e(
|
|
28
|
+
o.Root,
|
|
29
|
+
{
|
|
30
|
+
collapsedHeight: r,
|
|
31
|
+
open: t,
|
|
32
|
+
onOpenChange: ({ open: n }) => {
|
|
33
|
+
C(n);
|
|
34
|
+
},
|
|
35
|
+
children: /* @__PURE__ */ I(a, { position: "relative", children: [
|
|
36
|
+
/* @__PURE__ */ e(
|
|
37
|
+
o.Content,
|
|
38
|
+
{
|
|
39
|
+
_open: {
|
|
40
|
+
animationDuration: s
|
|
41
|
+
},
|
|
42
|
+
_closed: {
|
|
43
|
+
animationDuration: s
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ e(a, { ref: i, children: h })
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
!t && /* @__PURE__ */ e(T, {}),
|
|
49
|
+
c && /* @__PURE__ */ e(
|
|
50
|
+
R,
|
|
51
|
+
{
|
|
52
|
+
css: t ? {
|
|
53
|
+
position: "relative"
|
|
54
|
+
} : {
|
|
55
|
+
position: "absolute",
|
|
56
|
+
bottom: 0,
|
|
57
|
+
left: 0,
|
|
58
|
+
right: 0,
|
|
59
|
+
transform: `translateY(${D.XSmall})`
|
|
60
|
+
},
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
justifyContent: "center",
|
|
63
|
+
width: "100%",
|
|
64
|
+
children: /* @__PURE__ */ e(o.Trigger, { children: /* @__PURE__ */ e(
|
|
65
|
+
o.Indicator,
|
|
66
|
+
{
|
|
67
|
+
width: 40,
|
|
68
|
+
height: 40,
|
|
69
|
+
display: "flex",
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
justifyContent: "center",
|
|
72
|
+
transition: `transform ${s} ease`,
|
|
73
|
+
"aria-label": t ? f[l].collapseContent : f[l].expandContent,
|
|
74
|
+
_open: { transform: "rotate(180deg)" },
|
|
75
|
+
children: /* @__PURE__ */ e(E, {})
|
|
76
|
+
}
|
|
77
|
+
) })
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}, T = () => /* @__PURE__ */ e(
|
|
84
|
+
a,
|
|
85
|
+
{
|
|
86
|
+
"data-testid": "blur-overlay",
|
|
87
|
+
css: {
|
|
88
|
+
position: "absolute",
|
|
89
|
+
bottom: 0,
|
|
90
|
+
left: 0,
|
|
91
|
+
right: 0,
|
|
92
|
+
height: "36px",
|
|
93
|
+
pointerEvents: "none",
|
|
94
|
+
"&::before": {
|
|
95
|
+
content: '""',
|
|
96
|
+
position: "absolute",
|
|
97
|
+
top: 0,
|
|
98
|
+
left: 0,
|
|
99
|
+
right: 0,
|
|
100
|
+
height: "20px",
|
|
101
|
+
background: `linear-gradient(to bottom, rgba(255, 255, 255, 0.00) 2.18%, ${d.Surface} 97.81%)`
|
|
102
|
+
},
|
|
103
|
+
"&::after": {
|
|
104
|
+
content: '""',
|
|
105
|
+
position: "absolute",
|
|
106
|
+
bottom: 0,
|
|
107
|
+
left: 0,
|
|
108
|
+
right: 0,
|
|
109
|
+
height: "calc(100% - 20px)",
|
|
110
|
+
background: d.Surface
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
export {
|
|
116
|
+
k as Collapsible
|
|
117
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.spec.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/collapsible.spec.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.visual.test.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/collapsible.visual.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type Locales = "en-US" | "nb-NO" | "da-DK" | "sv-SE" | "en-GB" | "fr-FR" | "nl-BE";
|
|
2
|
+
export declare const translations: {
|
|
3
|
+
"sv-SE": {
|
|
4
|
+
collapseContent: string;
|
|
5
|
+
expandContent: string;
|
|
6
|
+
};
|
|
7
|
+
"en-US": {
|
|
8
|
+
collapseContent: string;
|
|
9
|
+
expandContent: string;
|
|
10
|
+
};
|
|
11
|
+
"en-GB": {
|
|
12
|
+
collapseContent: string;
|
|
13
|
+
expandContent: string;
|
|
14
|
+
};
|
|
15
|
+
"nb-NO": {
|
|
16
|
+
collapseContent: string;
|
|
17
|
+
expandContent: string;
|
|
18
|
+
};
|
|
19
|
+
"da-DK": {
|
|
20
|
+
collapseContent: string;
|
|
21
|
+
expandContent: string;
|
|
22
|
+
};
|
|
23
|
+
"fr-FR": {
|
|
24
|
+
collapseContent: string;
|
|
25
|
+
expandContent: string;
|
|
26
|
+
};
|
|
27
|
+
"nl-BE": {
|
|
28
|
+
collapseContent: string;
|
|
29
|
+
expandContent: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/translations.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAO1F,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBxB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const n = {
|
|
2
|
+
collapseContent: "Collapse content",
|
|
3
|
+
expandContent: "Expand content"
|
|
4
|
+
}, e = {
|
|
5
|
+
"sv-SE": {
|
|
6
|
+
collapseContent: "Kollapsa innehåll",
|
|
7
|
+
expandContent: "Expandera innehåll"
|
|
8
|
+
},
|
|
9
|
+
"en-US": n,
|
|
10
|
+
"en-GB": n,
|
|
11
|
+
"nb-NO": {
|
|
12
|
+
collapseContent: "Skjul innhold",
|
|
13
|
+
expandContent: "Vis innhold"
|
|
14
|
+
},
|
|
15
|
+
"da-DK": {
|
|
16
|
+
collapseContent: "Skjul indhold",
|
|
17
|
+
expandContent: "Vis indhold"
|
|
18
|
+
},
|
|
19
|
+
"fr-FR": {
|
|
20
|
+
collapseContent: "Réduire le contenu",
|
|
21
|
+
expandContent: "Afficher le contenu"
|
|
22
|
+
},
|
|
23
|
+
"nl-BE": {
|
|
24
|
+
collapseContent: "Inhoud samenvouwen",
|
|
25
|
+
expandContent: "Inhoud uitvouwen"
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
e as translations
|
|
30
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { Locales } from './translations.js';
|
|
3
|
+
export type CollapsibleProps = PropsWithChildren<{
|
|
4
|
+
/** The height (in pixels) at which the content should be collapsed. If the content's height is less than or equal to this value, it will not be collapsible. */
|
|
5
|
+
collapsedHeight: number;
|
|
6
|
+
/** Whether the content should be expanded by default. */
|
|
7
|
+
defaultExpanded?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Locale used for translation of text contents native to the collapsible, such as aria-labels for the trigger button.
|
|
10
|
+
* Defaults to 'en-US'.
|
|
11
|
+
*/
|
|
12
|
+
locale?: Locales;
|
|
13
|
+
}>;
|
|
14
|
+
export type { Locales };
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/collapsible/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAChD,gKAAgK;IAChK,eAAe,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC,CAAC;AAEH,YAAY,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ThemeStyleProps } from '../../theme/index.js';
|
|
2
2
|
import { Field as ChakraField } from '@chakra-ui/react';
|
|
3
|
-
type ChakraFormControlProperties = Pick<ChakraField.RootProps, "
|
|
3
|
+
type ChakraFormControlProperties = Pick<ChakraField.RootProps, "id" | "children">;
|
|
4
4
|
type CustomProps = {
|
|
5
5
|
isDisabled?: boolean;
|
|
6
6
|
isReadOnly?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-control.d.ts","sourceRoot":"","sources":["../../../lib/components/form-control/form-control.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAExD,KAAK,2BAA2B,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"form-control.d.ts","sourceRoot":"","sources":["../../../lib/components/form-control/form-control.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAExD,KAAK,2BAA2B,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,GAAG,UAAU,CAAC,CAAC;AAElF,KAAK,WAAW,GAAG;IAElB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,2BAA2B,GAAG,eAAe,CAAC;AAE3F;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC3B,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,GAAG,KAAK,EACR,EAAE,gBAAgB,2CAYlB"}
|
|
@@ -11,8 +11,8 @@ type CustomModalProperties = {
|
|
|
11
11
|
returnFocusOnClose?: boolean;
|
|
12
12
|
onCloseComplete?: () => void;
|
|
13
13
|
};
|
|
14
|
-
type ChakraDialogProperties = Pick<ChakraDialog.RootProps, "children" | "
|
|
14
|
+
type ChakraDialogProperties = Pick<ChakraDialog.RootProps, "children" | "id" | "scrollBehavior" | "lazyMount">;
|
|
15
15
|
export type ModalProps = CustomModalProperties & ChakraDialogProperties;
|
|
16
|
-
export declare function Modal({ children, isOpen, onClose, closeOnOverlayClick, closeOnEsc, onCloseComplete, returnFocusOnClose, size, scrollBehavior, isCentered,
|
|
16
|
+
export declare function Modal({ children, isOpen, onClose, closeOnOverlayClick, closeOnEsc, onCloseComplete, returnFocusOnClose, size, scrollBehavior, isCentered, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export {};
|
|
18
18
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,IAAI,YAAY,EAItB,MAAM,kBAAkB,CAAC;AAI1B,KAAK,qBAAqB,GAAG;IAC5B;2EACuE;IACvE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAG1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,KAAK,sBAAsB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../lib/components/modal/modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,IAAI,YAAY,EAItB,MAAM,kBAAkB,CAAC;AAI1B,KAAK,qBAAqB,GAAG;IAC5B;2EACuE;IACvE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAG1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,KAAK,sBAAsB,GAAG,IAAI,CACjC,YAAY,CAAC,SAAS,EACtB,UAAU,GAAG,IAAI,GAAG,gBAAgB,GAAG,WAAW,CAClD,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;AAExE,wBAAgB,KAAK,CAAC,EACrB,QAAQ,EACR,MAAM,EACN,OAAO,EACP,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,kBAAyB,EACzB,IAAW,EACX,cAAyB,EACzB,UAAiB,EACjB,GAAG,KAAK,EACR,EAAE,UAAU,2CAoCZ"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useBreakpointValue as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { ModalBodyContext as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as e, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { useBreakpointValue as O, Dialog as o, Portal as b } from "@chakra-ui/react";
|
|
3
|
+
import { useState as B } from "react";
|
|
4
|
+
import { ModalBodyContext as E } from "./modal-body-context.js";
|
|
5
|
+
function k({
|
|
6
6
|
children: n,
|
|
7
7
|
isOpen: r,
|
|
8
8
|
onClose: i,
|
|
@@ -13,14 +13,13 @@ function M({
|
|
|
13
13
|
size: m = "sm",
|
|
14
14
|
scrollBehavior: c = "inside",
|
|
15
15
|
isCentered: p = !0,
|
|
16
|
-
|
|
17
|
-
...f
|
|
16
|
+
...u
|
|
18
17
|
}) {
|
|
19
|
-
const [h,
|
|
20
|
-
function x
|
|
21
|
-
|
|
18
|
+
const [h, f] = B(null), t = O({ base: "bottomSheet", md: void 0 });
|
|
19
|
+
function v(x) {
|
|
20
|
+
x.open || i?.();
|
|
22
21
|
}
|
|
23
|
-
return /* @__PURE__ */ e(
|
|
22
|
+
return /* @__PURE__ */ e(E.Provider, { value: { bodyElement: h, setBodyElement: f }, children: /* @__PURE__ */ e(
|
|
24
23
|
o.Root,
|
|
25
24
|
{
|
|
26
25
|
variant: t,
|
|
@@ -31,12 +30,11 @@ function M({
|
|
|
31
30
|
closeOnInteractOutside: a,
|
|
32
31
|
closeOnEscape: l,
|
|
33
32
|
open: r,
|
|
34
|
-
onOpenChange:
|
|
33
|
+
onOpenChange: v,
|
|
35
34
|
restoreFocus: d,
|
|
36
35
|
onExitComplete: s,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
children: /* @__PURE__ */ O(B, { children: [
|
|
36
|
+
...u,
|
|
37
|
+
children: /* @__PURE__ */ C(b, { children: [
|
|
40
38
|
/* @__PURE__ */ e(o.Backdrop, { "data-variant": t }),
|
|
41
39
|
/* @__PURE__ */ e(o.Positioner, { children: /* @__PURE__ */ e(o.Content, { children: n }) })
|
|
42
40
|
] })
|
|
@@ -44,5 +42,5 @@ function M({
|
|
|
44
42
|
) });
|
|
45
43
|
}
|
|
46
44
|
export {
|
|
47
|
-
|
|
45
|
+
k as Modal
|
|
48
46
|
};
|
|
@@ -8,8 +8,8 @@ type CustomProperties = {
|
|
|
8
8
|
isRequired?: boolean;
|
|
9
9
|
};
|
|
10
10
|
type CustomStyleProps = CustomChakraBoxProps & LayoutProps & MarginProps & PaddingProps & CustomProperties;
|
|
11
|
-
type ChakraTextareaProperties = Pick<ChakraTextareaProps, "id" | "name" | "placeholder" | "rows" | "value" | "defaultValue" | "onChange" | "onBlur" | "onFocus" | "onKeyDown" | "resize"
|
|
11
|
+
type ChakraTextareaProperties = Pick<ChakraTextareaProps, "id" | "name" | "placeholder" | "rows" | "value" | "defaultValue" | "onChange" | "onBlur" | "onFocus" | "onKeyDown" | "resize" | "autoresize">;
|
|
12
12
|
export type TextareaProps = ChakraTextareaProperties & CustomStyleProps;
|
|
13
|
-
export declare const Textarea: React.ForwardRefExoticComponent<
|
|
13
|
+
export declare const Textarea: React.ForwardRefExoticComponent<ChakraTextareaProperties & CustomChakraBoxProps & LayoutProps & MarginProps & PaddingProps & CustomProperties & React.RefAttributes<HTMLTextAreaElement>>;
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../lib/components/textarea/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EAA8B,KAAK,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,gBAAgB,GAAG;IACvB,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAG/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,KAAK,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAE3G,KAAK,wBAAwB,GAAG,IAAI,CACnC,mBAAmB,EACjB,IAAI,GACJ,MAAM,GACN,aAAa,GACb,MAAM,GACN,OAAO,GACP,cAAc,GACd,UAAU,GACV,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../lib/components/textarea/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5F,OAAO,EAA8B,KAAK,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,gBAAgB,GAAG;IACvB,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAG/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,KAAK,gBAAgB,GAAG,oBAAoB,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAE3G,KAAK,wBAAwB,GAAG,IAAI,CACnC,mBAAmB,EACjB,IAAI,GACJ,MAAM,GACN,aAAa,GACb,MAAM,GACN,OAAO,GACP,cAAc,GACd,UAAU,GACV,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,GACR,YAAY,CACd,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,wBAAwB,GAAG,gBAAgB,CAAC;AAExE,eAAO,MAAM,QAAQ,2LAanB,CAAC"}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Textarea as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { Textarea as f } from "@chakra-ui/react";
|
|
3
3
|
import m from "react";
|
|
4
4
|
const p = m.forwardRef((e, r) => {
|
|
5
|
-
const { isDisabled: a, isReadOnly: t, isRequired:
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
|
|
5
|
+
const { isDisabled: a, isReadOnly: t, isRequired: i, resize: s, ...o } = e;
|
|
6
|
+
return /* @__PURE__ */ d(
|
|
7
|
+
f,
|
|
8
8
|
{
|
|
9
|
-
resize:
|
|
10
|
-
autoresize: o,
|
|
9
|
+
resize: s,
|
|
11
10
|
ref: r,
|
|
12
11
|
disabled: a,
|
|
13
12
|
readOnly: t,
|
|
14
|
-
required:
|
|
15
|
-
...
|
|
13
|
+
required: i,
|
|
14
|
+
...o
|
|
16
15
|
}
|
|
17
16
|
);
|
|
18
17
|
});
|
|
@@ -2,7 +2,7 @@ import { CustomChakraBoxProps, LayoutProps, MarginProps, PaddingProps, Typograph
|
|
|
2
2
|
import { Tooltip as ChakraTooltip, GridProps } from '@chakra-ui/react';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
type Positioning = NonNullable<ChakraTooltip.RootProps["positioning"]>;
|
|
5
|
-
export type TooltipProps = Pick<ChakraTooltip.RootProps, "children"
|
|
5
|
+
export type TooltipProps = Pick<ChakraTooltip.RootProps, "children" | "disabled"> & CustomChakraBoxProps & PaddingProps & MarginProps & LayoutProps & GridProps & TypographyProps & {
|
|
6
6
|
placement?: Positioning["placement"];
|
|
7
7
|
label?: ReactNode;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../lib/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAMN,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAU,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,KAAK,WAAW,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../lib/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAMN,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAU,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,KAAK,WAAW,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;AAEvE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC,GAChF,oBAAoB,GACpB,YAAY,GACZ,WAAW,GACX,WAAW,GACX,SAAS,GACT,eAAe,GAAG;IAEjB,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,gHAwC1C"}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsx as e, Fragment as b, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { Tooltip as r, Portal as
|
|
3
|
-
import { ThemeSpaceVariable as l, ThemeFontSizeVariable as
|
|
4
|
-
function w(
|
|
2
|
+
import { Tooltip as r, Portal as T } from "@chakra-ui/react";
|
|
3
|
+
import { ThemeSpaceVariable as l, ThemeFontSizeVariable as f, ThemeFontVariable as u, ThemeColorVariable as t, ThemeRadiusVariable as S } from "../../theme/theme-types.js";
|
|
4
|
+
function w(a) {
|
|
5
5
|
const {
|
|
6
6
|
children: o,
|
|
7
7
|
label: n,
|
|
8
8
|
placement: m = "bottom",
|
|
9
9
|
p: s = l.Small,
|
|
10
|
-
fontSize: c =
|
|
10
|
+
fontSize: c = f.Small,
|
|
11
11
|
fontFamily: d = u.Body,
|
|
12
|
-
disabled: h
|
|
12
|
+
disabled: h,
|
|
13
13
|
...p
|
|
14
|
-
} =
|
|
14
|
+
} = a;
|
|
15
15
|
return h ? o : /* @__PURE__ */ e(b, { children: /* @__PURE__ */ i(r.Root, { positioning: { placement: m }, ...p, children: [
|
|
16
16
|
/* @__PURE__ */ e(r.Trigger, { asChild: !0, children: /* @__PURE__ */ e("span", { children: o }) }),
|
|
17
|
-
/* @__PURE__ */ e(
|
|
17
|
+
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(r.Positioner, { children: /* @__PURE__ */ i(
|
|
18
18
|
r.Content,
|
|
19
19
|
{
|
|
20
20
|
p: s,
|
|
21
21
|
borderRadius: S.Medium,
|
|
22
22
|
fontSize: c,
|
|
23
23
|
fontFamily: d,
|
|
24
|
-
css: { "--tooltip-bg":
|
|
25
|
-
color:
|
|
24
|
+
css: { "--tooltip-bg": t.OnSurface },
|
|
25
|
+
color: t.Surface,
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ e(r.Arrow, { css: { "--arrow-size": l.Small }, children: /* @__PURE__ */ e(r.ArrowTip, {}) }),
|
|
28
28
|
n
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Watches an element and strips the given attributes whenever they are added to
|
|
4
|
+
* it or its descendants, keeping them interactive / unstyled even when a parent
|
|
5
|
+
* component would otherwise set those attributes.
|
|
6
|
+
*
|
|
7
|
+
* @param ref - Ref to the root element to observe.
|
|
8
|
+
* @param attributes - One or more attribute names to remove (e.g. `["inert"]`).
|
|
9
|
+
* @param active - Whether the hook should run. Set to `false` when observation
|
|
10
|
+
* is not needed so the MutationObserver is not running unnecessarily.
|
|
11
|
+
* Defaults to `true`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useRemoveAttributes: (ref: RefObject<HTMLElement | null>, attributes: string[], active?: boolean) => void;
|
|
14
|
+
//# sourceMappingURL=use-remove-attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-remove-attributes.d.ts","sourceRoot":"","sources":["../../lib/hooks/use-remove-attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,OAAO,CAAC;AAElD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAC/B,KAAK,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAClC,YAAY,MAAM,EAAE,EACpB,gBAAa,SAoBb,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect as b } from "react";
|
|
2
|
+
const f = (o, e, u = !0) => {
|
|
3
|
+
b(() => {
|
|
4
|
+
const t = o.current;
|
|
5
|
+
if (!u || !t || e.length === 0) return;
|
|
6
|
+
const n = () => {
|
|
7
|
+
for (const r of e)
|
|
8
|
+
t.removeAttribute(r), t.querySelectorAll(`[${r}]`).forEach((c) => c.removeAttribute(r));
|
|
9
|
+
};
|
|
10
|
+
n();
|
|
11
|
+
const s = new MutationObserver(n);
|
|
12
|
+
return s.observe(t, { subtree: !0, attributes: !0, attributeFilter: e }), () => s.disconnect();
|
|
13
|
+
}, [o, u, e]);
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
f as useRemoveAttributes
|
|
17
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './components/breadcrumbs/index.js';
|
|
|
9
9
|
export * from './components/button/index.js';
|
|
10
10
|
export * from './components/checkbox/index.js';
|
|
11
11
|
export * from './components/checkbox-group/index.js';
|
|
12
|
+
export * from './components/collapsible/index.js';
|
|
12
13
|
export * from './components/combobox/index.js';
|
|
13
14
|
export * from './components/date-picker/index.js';
|
|
14
15
|
export * from './components/divider/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AAExB,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cA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