@harnessio/ui 0.5.31 → 0.5.32
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.d.ts +3 -0
- package/dist/components.js +2 -2
- package/dist/context.d.ts +2 -0
- package/dist/context.js +2 -2
- package/dist/{index-ClcK7tOh.js → index-BDvZojvk.js} +808 -806
- package/dist/index-BDvZojvk.js.map +1 -0
- package/dist/{index-jQ4ikgt8.js → index-C1RaM8Ec.js} +2 -2
- package/dist/{index-jQ4ikgt8.js.map → index-C1RaM8Ec.js.map} +1 -1
- package/dist/{index-Siy3uNs-.js → index-C8uMG0Qh.js} +23 -23
- package/dist/{index-Siy3uNs-.js.map → index-C8uMG0Qh.js.map} +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/dist/index-ClcK7tOh.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a7 as f, g as v, ah as g, ai as P, aj as h, ak as T, h as E, al as b, a3 as w, u as j, f as y, d as D, k as S } from "./index-
|
|
1
|
+
import { a7 as f, g as v, ah as g, ai as P, aj as h, ak as T, h as E, al as b, a3 as w, u as j, f as y, d as D, k as S } from "./index-BDvZojvk.js";
|
|
2
2
|
import { b as _, C as M, M as O, R, o as k, m as z, u as B } from "./use-resize-observer-B-bXbUjU.js";
|
|
3
3
|
import { jsx as i, jsxs as N } from "react/jsx-runtime";
|
|
4
4
|
import { createContext as u, useContext as C, useState as a, useCallback as q, useMemo as A } from "react";
|
|
@@ -71,4 +71,4 @@ export {
|
|
|
71
71
|
U as i,
|
|
72
72
|
G as u
|
|
73
73
|
};
|
|
74
|
-
//# sourceMappingURL=index-
|
|
74
|
+
//# sourceMappingURL=index-C1RaM8Ec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-C1RaM8Ec.js","sources":["../src/context/component-context.tsx","../src/context/exit-confirm-context.tsx"],"sourcesContent":["// ComponentContext.tsx\n\nimport React, { createContext, ReactNode, RefAttributes, useContext } from 'react'\n\nimport { RbacButtonProps, RbacMoreActionsTooltipProps, RbacSplitButtonProps } from '@components/rbac'\n\ninterface ComponentContextValue {\n RbacButton: React.ComponentType<RbacButtonProps & RefAttributes<HTMLButtonElement>>\n RbacSplitButton: <T extends string>(props: RbacSplitButtonProps<T>) => JSX.Element\n RbacMoreActionsTooltip: React.ForwardRefExoticComponent<\n RbacMoreActionsTooltipProps & RefAttributes<HTMLButtonElement>\n >\n}\n\nconst ComponentContext = createContext<ComponentContextValue | undefined>(undefined)\n\nexport const ComponentProvider = ({\n components,\n children\n}: {\n components: ComponentContextValue\n children: ReactNode\n}) => {\n return <ComponentContext.Provider value={components}>{children}</ComponentContext.Provider>\n}\n\nexport const useComponents = () => {\n const ctx = useContext(ComponentContext)\n if (!ctx) throw new Error('useComponents must be used within ComponentProvider')\n return ctx\n}\n","import { createContext, useCallback, useContext, useMemo, useState } from 'react'\n\nimport { ExitConfirmDialog, ExitConfirmOptions } from '../components/dialogs/exit-confirm-dialog'\n\nexport interface ExitConfirmContextType {\n show: (options: ExitConfirmOptions) => void\n}\n\nexport const ExitConfirmContext = createContext<ExitConfirmContextType>({\n show: (_options: ExitConfirmOptions) => undefined\n})\n\nexport function ExitConfirmProvider({ children }: { children: React.ReactNode }) {\n const [confirm, setConfirm] = useState<ExitConfirmOptions>()\n const [open, setOpen] = useState(false)\n\n const show = useCallback(\n (confirmOptions?: ExitConfirmOptions) => {\n setConfirm(confirmOptions)\n setOpen(true)\n },\n [setOpen]\n )\n\n const onConfirm = () => {\n confirm?.onConfirm?.()\n setOpen(false)\n }\n\n const onCancel = () => {\n confirm?.onCancel?.()\n setOpen(false)\n }\n\n const value = useMemo(() => ({ show }), [show])\n\n return (\n <ExitConfirmContext.Provider value={value}>\n {children}\n <ExitConfirmDialog {...confirm} onCancel={onCancel} onConfirm={onConfirm} open={open} />\n </ExitConfirmContext.Provider>\n )\n}\n\nexport const useExitConfirm = () => {\n const context = useContext(ExitConfirmContext)\n if (!context) {\n throw new Error('useExitConfirm must be used within a ExitConfirmProvider')\n }\n return context\n}\n"],"names":["ComponentContext","createContext","ComponentProvider","components","children","useComponents","ctx","useContext","ExitConfirmContext","_options","ExitConfirmProvider","confirm","setConfirm","useState","open","setOpen","show","useCallback","confirmOptions","onConfirm","_a","onCancel","value","useMemo","jsxs","ExitConfirmDialog","useExitConfirm","context"],"mappings":";;;;AAcA,MAAMA,IAAmBC,EAAiD,MAAS,GAEtEC,IAAoB,CAAC;AAAA,EAChC,YAAAC;AAAA,EACA,UAAAC;AACF,wBAIUJ,EAAiB,UAAjB,EAA0B,OAAOG,GAAa,UAAAC,GAAS,GAGpDC,IAAgB,MAAM;AAC3B,QAAAC,IAAMC,EAAWP,CAAgB;AACvC,MAAI,CAACM,EAAW,OAAA,IAAI,MAAM,qDAAqD;AACxE,SAAAA;AACT,GCtBaE,IAAqBP,EAAsC;AAAA,EACtE,MAAM,CAACQ,MAAiC;AAAA;AAC1C,CAAC;AAEe,SAAAC,EAAoB,EAAE,UAAAN,KAA2C;AAC/E,QAAM,CAACO,GAASC,CAAU,IAAIC,EAA6B,GACrD,CAACC,GAAMC,CAAO,IAAIF,EAAS,EAAK,GAEhCG,IAAOC;AAAA,IACX,CAACC,MAAwC;AACvC,MAAAN,EAAWM,CAAc,GACzBH,EAAQ,EAAI;AAAA,IACd;AAAA,IACA,CAACA,CAAO;AAAA,EACV,GAEMI,IAAY,MAAM;;AACtB,KAAAC,IAAAT,KAAA,gBAAAA,EAAS,cAAT,QAAAS,EAAA,KAAAT,IACAI,EAAQ,EAAK;AAAA,EACf,GAEMM,IAAW,MAAM;;AACrB,KAAAD,IAAAT,KAAA,gBAAAA,EAAS,aAAT,QAAAS,EAAA,KAAAT,IACAI,EAAQ,EAAK;AAAA,EACf,GAEMO,IAAQC,EAAQ,OAAO,EAAE,MAAAP,MAAS,CAACA,CAAI,CAAC;AAE9C,SACG,gBAAAQ,EAAAhB,EAAmB,UAAnB,EAA4B,OAAAc,GAC1B,UAAA;AAAA,IAAAlB;AAAA,sBACAqB,GAAmB,EAAA,GAAGd,GAAS,UAAAU,GAAoB,WAAAF,GAAsB,MAAAL,EAAY,CAAA;AAAA,EAAA,GACxF;AAEJ;AAEO,MAAMY,IAAiB,MAAM;AAC5B,QAAAC,IAAUpB,EAAWC,CAAkB;AAC7C,MAAI,CAACmB;AACG,UAAA,IAAI,MAAM,0DAA0D;AAErE,SAAAA;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var H$ = Object.defineProperty;
|
|
2
2
|
var Y$ = (e, t, n) => t in e ? H$(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var de = (e, t, n) => Y$(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { c as It, T as x4, R as Mv, D as kv, a as Pv, u as xd, C as og, b as L4, B as Je, I as me, P as Fv, d as M4, O as sg, e as Uv, S as Xi, f as z$, L as Fs, g as V$, h as q$, i as Cs, j as yt, k as Fn, l as ju, m as Or, n as Ld, o as Bv, p as $a, q as Dn, r as Ar, s as mt, t as Dr, v as lg, A as Gv, w as Hv, x as mi, y as k4, z as P4, E as $$, F as F4, G as U4, H as B4, J as G4, K as H4, M as Y4, N as z4, Q as ci, U as st, V as Rs, W as ji, X as Md, _ as Ve, Y as Rn, Z as V4, $ as Ra, a0 as Fa, a1 as W$, a2 as cg, a3 as K$, a4 as Ul, a5 as q4, a6 as Q$, a7 as X$, a8 as j$, a9 as Z$, aa as J$, ab as eW, ac as tW, ad as nW, ae as rW, af as aW, ag as iW } from "./index-
|
|
4
|
+
import { c as It, T as x4, R as Mv, D as kv, a as Pv, u as xd, C as og, b as L4, B as Je, I as me, P as Fv, d as M4, O as sg, e as Uv, S as Xi, f as z$, L as Fs, g as V$, h as q$, i as Cs, j as yt, k as Fn, l as ju, m as Or, n as Ld, o as Bv, p as $a, q as Dn, r as Ar, s as mt, t as Dr, v as lg, A as Gv, w as Hv, x as mi, y as k4, z as P4, E as $$, F as F4, G as U4, H as B4, J as G4, K as H4, M as Y4, N as z4, Q as ci, U as st, V as Rs, W as ji, X as Md, _ as Ve, Y as Rn, Z as V4, $ as Ra, a0 as Fa, a1 as W$, a2 as cg, a3 as K$, a4 as Ul, a5 as q4, a6 as Q$, a7 as X$, a8 as j$, a9 as Z$, aa as J$, ab as eW, ac as tW, ad as nW, ae as rW, af as aW, ag as iW } from "./index-BDvZojvk.js";
|
|
5
5
|
import { jsx as g, jsxs as B, Fragment as lt } from "react/jsx-runtime";
|
|
6
6
|
import * as S from "react";
|
|
7
7
|
import se, { forwardRef as ge, useMemo as xe, useLayoutEffect as dc, useEffect as be, createContext as Bt, useContext as dt, useRef as Le, useCallback as Pe, Children as pc, useState as ve, cloneElement as Do, memo as Qa, useReducer as oW, isValidElement as aa, createElement as sW, Fragment as Vi, useImperativeHandle as Yv } from "react";
|
|
@@ -177165,38 +177165,38 @@ const w4e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
177165
177165
|
Right: O4e,
|
|
177166
177166
|
Root: D$
|
|
177167
177167
|
}, Symbol.toStringTag, { value: "Module" })), U2 = ge(
|
|
177168
|
-
({ className: e, children: t, icon: n,
|
|
177169
|
-
const { Link:
|
|
177170
|
-
const { title:
|
|
177171
|
-
return /* @__PURE__ */ B(Je, { size: "2xs", variant: "ghost", iconOnly:
|
|
177172
|
-
|
|
177173
|
-
|
|
177174
|
-
] },
|
|
177175
|
-
}) }) : null, [
|
|
177168
|
+
({ className: e, children: t, icon: n, iconColor: r, hideIcon: a, isActive: i, link: o, isFolder: s, actionButtons: l, ...c }, u) => {
|
|
177169
|
+
const { Link: d } = fr(), p = !a, m = xe(() => l ? /* @__PURE__ */ g(tt.Horizontal, { gap: "none", children: l == null ? void 0 : l.map((f, E) => {
|
|
177170
|
+
const { title: h, iconOnly: b = !0, iconName: T, iconProps: v, ...R } = f;
|
|
177171
|
+
return /* @__PURE__ */ B(Je, { size: "2xs", variant: "ghost", iconOnly: b, ...R, children: [
|
|
177172
|
+
T && /* @__PURE__ */ g(me, { name: T, ...v }),
|
|
177173
|
+
h
|
|
177174
|
+
] }, E);
|
|
177175
|
+
}) }) : null, [l]), _ = $(
|
|
177176
177176
|
"cn-file-tree-item",
|
|
177177
177177
|
{
|
|
177178
|
-
"cn-file-tree-item-wrapper cn-file-tree-item-leaf": !
|
|
177179
|
-
"cn-file-tree-item-active": !
|
|
177178
|
+
"cn-file-tree-item-wrapper cn-file-tree-item-leaf": !s,
|
|
177179
|
+
"cn-file-tree-item-active": !s && i
|
|
177180
177180
|
},
|
|
177181
177181
|
e
|
|
177182
177182
|
);
|
|
177183
|
-
return
|
|
177184
|
-
|
|
177183
|
+
return o ? /* @__PURE__ */ B(
|
|
177184
|
+
d,
|
|
177185
177185
|
{
|
|
177186
|
-
ref:
|
|
177187
|
-
to:
|
|
177188
|
-
className:
|
|
177189
|
-
...
|
|
177186
|
+
ref: u,
|
|
177187
|
+
to: o,
|
|
177188
|
+
className: _,
|
|
177189
|
+
...c,
|
|
177190
177190
|
children: [
|
|
177191
|
-
|
|
177191
|
+
p && /* @__PURE__ */ g(me, { name: n, size: "md", color: r }),
|
|
177192
177192
|
/* @__PURE__ */ g(Te, { className: "flex-1", align: "left", color: "inherit", truncate: !0, children: t }),
|
|
177193
|
-
|
|
177193
|
+
m
|
|
177194
177194
|
]
|
|
177195
177195
|
}
|
|
177196
|
-
) : /* @__PURE__ */ B(tt.Flex, { ref:
|
|
177197
|
-
|
|
177196
|
+
) : /* @__PURE__ */ B(tt.Flex, { ref: u, className: _, as: "button", ...c, children: [
|
|
177197
|
+
p && /* @__PURE__ */ g(me, { name: n, size: "md", color: r }),
|
|
177198
177198
|
/* @__PURE__ */ g(Te, { className: "flex-1", align: "left", color: "inherit", truncate: !0, children: t }),
|
|
177199
|
-
|
|
177199
|
+
m
|
|
177200
177200
|
] });
|
|
177201
177201
|
}
|
|
177202
177202
|
);
|
|
@@ -179906,4 +179906,4 @@ export {
|
|
|
179906
179906
|
Mse as y,
|
|
179907
179907
|
xi as z
|
|
179908
179908
|
};
|
|
179909
|
-
//# sourceMappingURL=index-
|
|
179909
|
+
//# sourceMappingURL=index-C8uMG0Qh.js.map
|