@apipass/design-system 1.21.0 → 1.22.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/lib/embedded-styles.js +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/ui/components/Widget/Widget.cjs +1 -1
- package/dist/lib/ui/components/Widget/Widget.cjs.map +1 -1
- package/dist/lib/ui/components/Widget/Widget.js +73 -27
- package/dist/lib/ui/components/Widget/Widget.js.map +1 -1
- package/dist/types/ui/components/Widget/Widget.d.ts +16 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../../vendor/clsx/dist/clsx.cjs"),i=require("react");;/* empty css */const y=require("../../primitives/Tooltip/Tooltip.cjs"),z=require("../../icons/IconInfo.cjs"),B=require("../../icons/IconChevronDown.cjs"),u=require("../../primitives/IconButton/IconButton.cjs"),S=i.forwardRef(function({title:g,description:o,descriptionButtonLabel:x,headerActions:n,isCollapsible:s,collapseButtonLabel:m,expandButtonLabel:h,collapsed:a,defaultCollapsed:j,onCollapsedChange:r,children:w,className:f,...v},I){const d=i.useId(),c=a!==void 0,[p,N]=i.useState(j??!1),t=s===!0&&(c?a===!0:p);function q(){const l=!t;c||N(l),r==null||r(l)}return e.jsxs("div",{ref:I,className:b.clsx("widget",f),...v,"data-collapsed":t||void 0,children:[e.jsxs("div",{className:"widget-header widget-drag-handle",children:[e.jsxs("span",{className:"widget-header-title-group",children:[e.jsx("span",{className:"widget-header-title",children:g}),o&&e.jsx(y.Tooltip,{content:o,placement:"bottom",offset:4,children:e.jsx(u.IconButton,{"aria-label":x,variant:"subtle",size:"small",className:"widget-header-description-trigger",children:e.jsx(z.IconInfo,{size:"14"})})})]}),(n||s)&&e.jsxs("div",{className:"widget-header-actions",children:[n,s&&e.jsx(u.IconButton,{"aria-label":t?h:m,"aria-expanded":!t,"aria-controls":d,variant:"subtle",size:"small",className:"widget-header-collapse-trigger",onPress:q,children:e.jsx(B.IconChevronDown,{size:"16",className:"widget-header-collapse-indicator"})})]})]}),e.jsx("div",{id:d,className:"widget-body",hidden:t,children:w})]})});exports.Widget=S;
|
|
2
2
|
//# sourceMappingURL=Widget.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Widget.cjs","sources":["../../../../../src/ui/components/Widget/Widget.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type ComponentPropsWithoutRef, type ReactNode, forwardRef } from \"react\";\nimport { IconInfo } from \"icons\";\nimport { IconButton, Tooltip } from \"primitives\";\nimport \"./widget.css\";\n\ntype WidgetDescriptionProps =\n | { description?: undefined; descriptionButtonLabel?: undefined }\n | { description: ReactNode; descriptionButtonLabel: string };\n\nexport type WidgetProps = Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> &\n WidgetDescriptionProps & {\n title: ReactNode;\n headerActions?: ReactNode;\n };\n\nexport const Widget = forwardRef<HTMLDivElement, WidgetProps>(function Widget(\n {
|
|
1
|
+
{"version":3,"file":"Widget.cjs","sources":["../../../../../src/ui/components/Widget/Widget.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type ComponentPropsWithoutRef, type ReactNode, forwardRef, useId, useState } from \"react\";\nimport { IconChevronDown, IconInfo } from \"icons\";\nimport { IconButton, Tooltip } from \"primitives\";\nimport \"./widget.css\";\n\ntype WidgetDescriptionProps =\n | { description?: undefined; descriptionButtonLabel?: undefined }\n | { description: ReactNode; descriptionButtonLabel: string };\n\ntype WidgetCollapseProps =\n | {\n isCollapsible?: false;\n collapseButtonLabel?: undefined;\n expandButtonLabel?: undefined;\n collapsed?: undefined;\n defaultCollapsed?: undefined;\n onCollapsedChange?: undefined;\n }\n | {\n isCollapsible: true;\n collapseButtonLabel: string;\n expandButtonLabel: string;\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n };\n\nexport type WidgetProps = Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> &\n WidgetDescriptionProps &\n WidgetCollapseProps & {\n title: ReactNode;\n headerActions?: ReactNode;\n };\n\nexport const Widget = forwardRef<HTMLDivElement, WidgetProps>(function Widget(\n {\n title,\n description,\n descriptionButtonLabel,\n headerActions,\n isCollapsible,\n collapseButtonLabel,\n expandButtonLabel,\n collapsed,\n defaultCollapsed,\n onCollapsedChange,\n children,\n className,\n ...props\n },\n ref,\n) {\n const bodyId: string = useId();\n const isCollapsedControlled: boolean = collapsed !== undefined;\n const [uncontrolledCollapsed, setUncontrolledCollapsed] = useState<boolean>(\n defaultCollapsed ?? false,\n );\n const isCollapsed: boolean =\n isCollapsible === true && (isCollapsedControlled ? collapsed === true : uncontrolledCollapsed);\n\n function toggleCollapsed(): void {\n const nextCollapsed: boolean = !isCollapsed;\n if (!isCollapsedControlled) setUncontrolledCollapsed(nextCollapsed);\n onCollapsedChange?.(nextCollapsed);\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\"widget\", className)}\n {...props}\n data-collapsed={isCollapsed || undefined}\n >\n <div className=\"widget-header widget-drag-handle\">\n <span className=\"widget-header-title-group\">\n <span className=\"widget-header-title\">{title}</span>\n {description && (\n <Tooltip content={description} placement=\"bottom\" offset={4}>\n <IconButton\n aria-label={descriptionButtonLabel}\n variant=\"subtle\"\n size=\"small\"\n className=\"widget-header-description-trigger\"\n >\n <IconInfo size=\"14\" />\n </IconButton>\n </Tooltip>\n )}\n </span>\n {(headerActions || isCollapsible) && (\n <div className=\"widget-header-actions\">\n {headerActions}\n {isCollapsible && (\n <IconButton\n aria-label={isCollapsed ? expandButtonLabel : collapseButtonLabel}\n aria-expanded={!isCollapsed}\n aria-controls={bodyId}\n variant=\"subtle\"\n size=\"small\"\n className=\"widget-header-collapse-trigger\"\n onPress={toggleCollapsed}\n >\n <IconChevronDown size=\"16\" className=\"widget-header-collapse-indicator\" />\n </IconButton>\n )}\n </div>\n )}\n </div>\n <div id={bodyId} className=\"widget-body\" hidden={isCollapsed}>\n {children}\n </div>\n </div>\n );\n});\n"],"names":["Widget","forwardRef","title","description","descriptionButtonLabel","headerActions","isCollapsible","collapseButtonLabel","expandButtonLabel","collapsed","defaultCollapsed","onCollapsedChange","children","className","props","ref","bodyId","useId","isCollapsedControlled","uncontrolledCollapsed","setUncontrolledCollapsed","useState","isCollapsed","toggleCollapsed","nextCollapsed","jsxs","clsx","jsx","Tooltip","IconButton","IconInfo","IconChevronDown"],"mappings":"uZAmCaA,EAASC,EAAAA,WAAwC,SAC5D,CACE,MAAAC,EACA,YAAAC,EACA,uBAAAC,EACA,cAAAC,EACA,cAAAC,EACA,oBAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,iBAAAC,EACA,kBAAAC,EACA,SAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EACAC,EACA,CACA,MAAMC,EAAiBC,EAAAA,MAAA,EACjBC,EAAiCT,IAAc,OAC/C,CAACU,EAAuBC,CAAwB,EAAIC,EAAAA,SACxDX,GAAoB,EAAA,EAEhBY,EACJhB,IAAkB,KAASY,EAAwBT,IAAc,GAAOU,GAE1E,SAASI,GAAwB,CAC/B,MAAMC,EAAyB,CAACF,EAC3BJ,GAAuBE,EAAyBI,CAAa,EAClEb,GAAA,MAAAA,EAAoBa,EACtB,CAEA,OACEC,EAAAA,KAAC,MAAA,CACC,IAAAV,EACA,UAAWW,EAAAA,KAAK,SAAUb,CAAS,EAClC,GAAGC,EACJ,iBAAgBQ,GAAe,OAE/B,SAAA,CAAAG,EAAAA,KAAC,MAAA,CAAI,UAAU,mCACb,SAAA,CAAAA,EAAAA,KAAC,OAAA,CAAK,UAAU,4BACd,SAAA,CAAAE,EAAAA,IAAC,OAAA,CAAK,UAAU,sBAAuB,SAAAzB,EAAM,EAC5CC,SACEyB,UAAA,CAAQ,QAASzB,EAAa,UAAU,SAAS,OAAQ,EACxD,SAAAwB,EAAAA,IAACE,EAAAA,WAAA,CACC,aAAYzB,EACZ,QAAQ,SACR,KAAK,QACL,UAAU,oCAEV,SAAAuB,EAAAA,IAACG,EAAAA,SAAA,CAAS,KAAK,IAAA,CAAK,CAAA,CAAA,CACtB,CACF,CAAA,EAEJ,GACEzB,GAAiBC,IACjBmB,EAAAA,KAAC,MAAA,CAAI,UAAU,wBACZ,SAAA,CAAApB,EACAC,GACCqB,EAAAA,IAACE,EAAAA,WAAA,CACC,aAAYP,EAAcd,EAAoBD,EAC9C,gBAAe,CAACe,EAChB,gBAAeN,EACf,QAAQ,SACR,KAAK,QACL,UAAU,iCACV,QAASO,EAET,SAAAI,EAAAA,IAACI,kBAAA,CAAgB,KAAK,KAAK,UAAU,kCAAA,CAAmC,CAAA,CAAA,CAC1E,CAAA,CAEJ,CAAA,EAEJ,EACAJ,MAAC,OAAI,GAAIX,EAAQ,UAAU,cAAc,OAAQM,EAC9C,SAAAV,CAAA,CACH,CAAA,CAAA,CAAA,CAGN,CAAC"}
|
|
@@ -1,32 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as j } from "../../../vendor/clsx/dist/clsx.js";
|
|
3
|
+
import { forwardRef as y, useId as W, useState as B } from "react";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { Tooltip as
|
|
6
|
-
import { IconInfo as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
5
|
+
import { Tooltip as D } from "../../primitives/Tooltip/Tooltip.js";
|
|
6
|
+
import { IconInfo as P } from "../../icons/IconInfo.js";
|
|
7
|
+
import { IconChevronDown as R } from "../../icons/IconChevronDown.js";
|
|
8
|
+
import { IconButton as m } from "../../primitives/IconButton/IconButton.js";
|
|
9
|
+
const J = y(function({
|
|
10
|
+
title: p,
|
|
11
|
+
description: a,
|
|
12
|
+
descriptionButtonLabel: f,
|
|
13
|
+
headerActions: d,
|
|
14
|
+
isCollapsible: i,
|
|
15
|
+
collapseButtonLabel: g,
|
|
16
|
+
expandButtonLabel: h,
|
|
17
|
+
collapsed: s,
|
|
18
|
+
defaultCollapsed: u,
|
|
19
|
+
onCollapsedChange: o,
|
|
20
|
+
children: w,
|
|
21
|
+
className: v,
|
|
22
|
+
...N
|
|
23
|
+
}, x) {
|
|
24
|
+
const l = W(), c = s !== void 0, [I, b] = B(
|
|
25
|
+
u ?? !1
|
|
26
|
+
), t = i === !0 && (c ? s === !0 : I);
|
|
27
|
+
function z() {
|
|
28
|
+
const n = !t;
|
|
29
|
+
c || b(n), o == null || o(n);
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ r(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
ref: x,
|
|
35
|
+
className: j("widget", v),
|
|
36
|
+
...N,
|
|
37
|
+
"data-collapsed": t || void 0,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ r("div", { className: "widget-header widget-drag-handle", children: [
|
|
40
|
+
/* @__PURE__ */ r("span", { className: "widget-header-title-group", children: [
|
|
41
|
+
/* @__PURE__ */ e("span", { className: "widget-header-title", children: p }),
|
|
42
|
+
a && /* @__PURE__ */ e(D, { content: a, placement: "bottom", offset: 4, children: /* @__PURE__ */ e(
|
|
43
|
+
m,
|
|
44
|
+
{
|
|
45
|
+
"aria-label": f,
|
|
46
|
+
variant: "subtle",
|
|
47
|
+
size: "small",
|
|
48
|
+
className: "widget-header-description-trigger",
|
|
49
|
+
children: /* @__PURE__ */ e(P, { size: "14" })
|
|
50
|
+
}
|
|
51
|
+
) })
|
|
52
|
+
] }),
|
|
53
|
+
(d || i) && /* @__PURE__ */ r("div", { className: "widget-header-actions", children: [
|
|
54
|
+
d,
|
|
55
|
+
i && /* @__PURE__ */ e(
|
|
56
|
+
m,
|
|
57
|
+
{
|
|
58
|
+
"aria-label": t ? h : g,
|
|
59
|
+
"aria-expanded": !t,
|
|
60
|
+
"aria-controls": l,
|
|
61
|
+
variant: "subtle",
|
|
62
|
+
size: "small",
|
|
63
|
+
className: "widget-header-collapse-trigger",
|
|
64
|
+
onPress: z,
|
|
65
|
+
children: /* @__PURE__ */ e(R, { size: "16", className: "widget-header-collapse-indicator" })
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] })
|
|
69
|
+
] }),
|
|
70
|
+
/* @__PURE__ */ e("div", { id: l, className: "widget-body", hidden: t, children: w })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
);
|
|
28
74
|
});
|
|
29
75
|
export {
|
|
30
|
-
|
|
76
|
+
J as Widget
|
|
31
77
|
};
|
|
32
78
|
//# sourceMappingURL=Widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Widget.js","sources":["../../../../../src/ui/components/Widget/Widget.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type ComponentPropsWithoutRef, type ReactNode, forwardRef } from \"react\";\nimport { IconInfo } from \"icons\";\nimport { IconButton, Tooltip } from \"primitives\";\nimport \"./widget.css\";\n\ntype WidgetDescriptionProps =\n | { description?: undefined; descriptionButtonLabel?: undefined }\n | { description: ReactNode; descriptionButtonLabel: string };\n\nexport type WidgetProps = Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> &\n WidgetDescriptionProps & {\n title: ReactNode;\n headerActions?: ReactNode;\n };\n\nexport const Widget = forwardRef<HTMLDivElement, WidgetProps>(function Widget(\n {
|
|
1
|
+
{"version":3,"file":"Widget.js","sources":["../../../../../src/ui/components/Widget/Widget.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type ComponentPropsWithoutRef, type ReactNode, forwardRef, useId, useState } from \"react\";\nimport { IconChevronDown, IconInfo } from \"icons\";\nimport { IconButton, Tooltip } from \"primitives\";\nimport \"./widget.css\";\n\ntype WidgetDescriptionProps =\n | { description?: undefined; descriptionButtonLabel?: undefined }\n | { description: ReactNode; descriptionButtonLabel: string };\n\ntype WidgetCollapseProps =\n | {\n isCollapsible?: false;\n collapseButtonLabel?: undefined;\n expandButtonLabel?: undefined;\n collapsed?: undefined;\n defaultCollapsed?: undefined;\n onCollapsedChange?: undefined;\n }\n | {\n isCollapsible: true;\n collapseButtonLabel: string;\n expandButtonLabel: string;\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n };\n\nexport type WidgetProps = Omit<ComponentPropsWithoutRef<\"div\">, \"title\"> &\n WidgetDescriptionProps &\n WidgetCollapseProps & {\n title: ReactNode;\n headerActions?: ReactNode;\n };\n\nexport const Widget = forwardRef<HTMLDivElement, WidgetProps>(function Widget(\n {\n title,\n description,\n descriptionButtonLabel,\n headerActions,\n isCollapsible,\n collapseButtonLabel,\n expandButtonLabel,\n collapsed,\n defaultCollapsed,\n onCollapsedChange,\n children,\n className,\n ...props\n },\n ref,\n) {\n const bodyId: string = useId();\n const isCollapsedControlled: boolean = collapsed !== undefined;\n const [uncontrolledCollapsed, setUncontrolledCollapsed] = useState<boolean>(\n defaultCollapsed ?? false,\n );\n const isCollapsed: boolean =\n isCollapsible === true && (isCollapsedControlled ? collapsed === true : uncontrolledCollapsed);\n\n function toggleCollapsed(): void {\n const nextCollapsed: boolean = !isCollapsed;\n if (!isCollapsedControlled) setUncontrolledCollapsed(nextCollapsed);\n onCollapsedChange?.(nextCollapsed);\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\"widget\", className)}\n {...props}\n data-collapsed={isCollapsed || undefined}\n >\n <div className=\"widget-header widget-drag-handle\">\n <span className=\"widget-header-title-group\">\n <span className=\"widget-header-title\">{title}</span>\n {description && (\n <Tooltip content={description} placement=\"bottom\" offset={4}>\n <IconButton\n aria-label={descriptionButtonLabel}\n variant=\"subtle\"\n size=\"small\"\n className=\"widget-header-description-trigger\"\n >\n <IconInfo size=\"14\" />\n </IconButton>\n </Tooltip>\n )}\n </span>\n {(headerActions || isCollapsible) && (\n <div className=\"widget-header-actions\">\n {headerActions}\n {isCollapsible && (\n <IconButton\n aria-label={isCollapsed ? expandButtonLabel : collapseButtonLabel}\n aria-expanded={!isCollapsed}\n aria-controls={bodyId}\n variant=\"subtle\"\n size=\"small\"\n className=\"widget-header-collapse-trigger\"\n onPress={toggleCollapsed}\n >\n <IconChevronDown size=\"16\" className=\"widget-header-collapse-indicator\" />\n </IconButton>\n )}\n </div>\n )}\n </div>\n <div id={bodyId} className=\"widget-body\" hidden={isCollapsed}>\n {children}\n </div>\n </div>\n );\n});\n"],"names":["Widget","forwardRef","title","description","descriptionButtonLabel","headerActions","isCollapsible","collapseButtonLabel","expandButtonLabel","collapsed","defaultCollapsed","onCollapsedChange","children","className","props","ref","bodyId","useId","isCollapsedControlled","uncontrolledCollapsed","setUncontrolledCollapsed","useState","isCollapsed","toggleCollapsed","nextCollapsed","jsxs","clsx","jsx","Tooltip","IconButton","IconInfo","IconChevronDown"],"mappings":";;;;;;;;AAmCO,MAAMA,IAASC,EAAwC,SAC5D;AAAA,EACE,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAiBC,EAAA,GACjBC,IAAiCT,MAAc,QAC/C,CAACU,GAAuBC,CAAwB,IAAIC;AAAA,IACxDX,KAAoB;AAAA,EAAA,GAEhBY,IACJhB,MAAkB,OAASY,IAAwBT,MAAc,KAAOU;AAE1E,WAASI,IAAwB;AAC/B,UAAMC,IAAyB,CAACF;AAChC,IAAKJ,KAAuBE,EAAyBI,CAAa,GAClEb,KAAA,QAAAA,EAAoBa;AAAA,EACtB;AAEA,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAV;AAAA,MACA,WAAWW,EAAK,UAAUb,CAAS;AAAA,MAClC,GAAGC;AAAA,MACJ,kBAAgBQ,KAAe;AAAA,MAE/B,UAAA;AAAA,QAAA,gBAAAG,EAAC,OAAA,EAAI,WAAU,oCACb,UAAA;AAAA,UAAA,gBAAAA,EAAC,QAAA,EAAK,WAAU,6BACd,UAAA;AAAA,YAAA,gBAAAE,EAAC,QAAA,EAAK,WAAU,uBAAuB,UAAAzB,GAAM;AAAA,YAC5CC,uBACEyB,GAAA,EAAQ,SAASzB,GAAa,WAAU,UAAS,QAAQ,GACxD,UAAA,gBAAAwB;AAAA,cAACE;AAAA,cAAA;AAAA,gBACC,cAAYzB;AAAA,gBACZ,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,WAAU;AAAA,gBAEV,UAAA,gBAAAuB,EAACG,GAAA,EAAS,MAAK,KAAA,CAAK;AAAA,cAAA;AAAA,YAAA,EACtB,CACF;AAAA,UAAA,GAEJ;AAAA,WACEzB,KAAiBC,MACjB,gBAAAmB,EAAC,OAAA,EAAI,WAAU,yBACZ,UAAA;AAAA,YAAApB;AAAA,YACAC,KACC,gBAAAqB;AAAA,cAACE;AAAA,cAAA;AAAA,gBACC,cAAYP,IAAcd,IAAoBD;AAAA,gBAC9C,iBAAe,CAACe;AAAA,gBAChB,iBAAeN;AAAA,gBACf,SAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,WAAU;AAAA,gBACV,SAASO;AAAA,gBAET,UAAA,gBAAAI,EAACI,GAAA,EAAgB,MAAK,MAAK,WAAU,mCAAA,CAAmC;AAAA,cAAA;AAAA,YAAA;AAAA,UAC1E,EAAA,CAEJ;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAJ,EAAC,SAAI,IAAIX,GAAQ,WAAU,eAAc,QAAQM,GAC9C,UAAAV,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
|
|
@@ -7,7 +7,22 @@ type WidgetDescriptionProps = {
|
|
|
7
7
|
description: ReactNode;
|
|
8
8
|
descriptionButtonLabel: string;
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
type WidgetCollapseProps = {
|
|
11
|
+
isCollapsible?: false;
|
|
12
|
+
collapseButtonLabel?: undefined;
|
|
13
|
+
expandButtonLabel?: undefined;
|
|
14
|
+
collapsed?: undefined;
|
|
15
|
+
defaultCollapsed?: undefined;
|
|
16
|
+
onCollapsedChange?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
isCollapsible: true;
|
|
19
|
+
collapseButtonLabel: string;
|
|
20
|
+
expandButtonLabel: string;
|
|
21
|
+
collapsed?: boolean;
|
|
22
|
+
defaultCollapsed?: boolean;
|
|
23
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
24
|
+
};
|
|
25
|
+
export type WidgetProps = Omit<ComponentPropsWithoutRef<"div">, "title"> & WidgetDescriptionProps & WidgetCollapseProps & {
|
|
11
26
|
title: ReactNode;
|
|
12
27
|
headerActions?: ReactNode;
|
|
13
28
|
};
|