diff --git a/dist/components/Collapsible.d.ts b/dist/components/Collapsible.d.ts index b290bf8..7bf4400 100644 --- a/dist/components/Collapsible.d.ts +++ b/dist/components/Collapsible.d.ts @@ -1,4 +1,4 @@ -import { ReactNode } from 'react'; +import { CSSProperties, ReactNode } from 'react'; import { BoxProps } from './Box'; type Props = Partial<{ /** Buttons or other content to render inline with the button */ @@ -11,6 +11,8 @@ type Props = Partial<{ open: boolean; /** Text to display on the button for collapsing */ title: ReactNode; + /** Custom styles for the child nodes */ + childStyles: CSSProperties; }> & BoxProps; /** * ## Collapsible diff --git a/dist/components/Collapsible.js b/dist/components/Collapsible.js index e06ad25..eae33fc 100644 --- a/dist/components/Collapsible.js +++ b/dist/components/Collapsible.js @@ -1,35 +1,36 @@ -import { jsxs as n, jsx as e } from "react/jsx-runtime"; -import { useState as p } from "react"; -import { Box as t } from "./Box.js"; -import { Button as b } from "./Button.js"; -function x(o) { +import { jsxs as i, jsx as e } from "react/jsx-runtime"; +import { useState as b } from "react"; +import { Box as n } from "./Box.js"; +import { Button as u } from "./Button.js"; +function T(o) { const { children: r, child_mt: s = 1, - color: m, - title: a, - buttons: c, - icon: i, - ...d - } = o, [l, h] = p(o.open); - return /* @__PURE__ */ n(t, { mb: 1, children: [ - /* @__PURE__ */ n("div", { className: "Table", children: [ + childStyles: m, + color: a, + title: d, + buttons: t, + icon: c, + ...h + } = o, [l, p] = b(o.open); + return /* @__PURE__ */ i(n, { mb: 1, children: [ + /* @__PURE__ */ i("div", { className: "Table", children: [ /* @__PURE__ */ e("div", { className: "Table__cell", children: /* @__PURE__ */ e( - b, + u, { fluid: !0, - color: m, - icon: i || (l ? "chevron-down" : "chevron-right"), - onClick: () => h(!l), - ...d, - children: a + color: a, + icon: c || (l ? "chevron-down" : "chevron-right"), + onClick: () => p(!l), + ...h, + children: d } ) }), - c && /* @__PURE__ */ e("div", { className: "Table__cell Table__cell--collapsing", children: c }) + t && /* @__PURE__ */ e("div", { className: "Table__cell Table__cell--collapsing", children: t }) ] }), - l && /* @__PURE__ */ e(t, { mt: s, children: r }) + l && /* @__PURE__ */ e(n, { mt: s, style: m, children: r }) ] }); } export { - x as Collapsible + T as Collapsible }; diff --git a/package.json b/package.json index 2cb7617..5ada34a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tgui-core", - "version": "1.5.7", + "version": "1.6.1", "description": "TGUI core component library", "keywords": ["TGUI", "library", "typescript"], "files": ["dist"],