@harnessio/ui 1.0.0 → 1.0.1
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
CHANGED
|
@@ -13,6 +13,7 @@ import { CheckboxTreeGroupProps as CheckboxTreeGroupProps_2 } from './checkbox-t
|
|
|
13
13
|
import { CheckboxTreeItemProps as CheckboxTreeItemProps_2 } from './checkbox-tree-types';
|
|
14
14
|
import { CheckboxTreeRootProps as CheckboxTreeRootProps_2 } from './checkbox-tree-types';
|
|
15
15
|
import { ClassAttributes } from 'react';
|
|
16
|
+
import { ClassNames } from 'react-day-picker';
|
|
16
17
|
import { ClassProp } from 'class-variance-authority/types';
|
|
17
18
|
import { ClipboardEventHandler } from 'react';
|
|
18
19
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
@@ -28,6 +29,7 @@ import { Context } from 'react';
|
|
|
28
29
|
import { CSSProperties } from 'react';
|
|
29
30
|
import { DateRange } from 'react-day-picker';
|
|
30
31
|
import { DayPicker } from 'react-day-picker';
|
|
32
|
+
import { DayPickerRangeProps } from 'react-day-picker';
|
|
31
33
|
import { default as default_2 } from 'react';
|
|
32
34
|
import { default as default_3 } from 'embla-carousel-react';
|
|
33
35
|
import { DetailedHTMLProps } from 'react';
|
|
@@ -1392,11 +1394,15 @@ export declare interface DataTableProps<TData> {
|
|
|
1392
1394
|
/* Excluded from this release type: _enableColumnResizing */
|
|
1393
1395
|
}
|
|
1394
1396
|
|
|
1397
|
+
export declare type DateRangeCalendarProps = Omit<DayPickerRangeProps, 'mode' | 'numberOfMonths' | 'selected' | 'onSelect' | 'month' | 'onMonthChange' | 'classNames'>;
|
|
1398
|
+
|
|
1395
1399
|
export declare interface DateRangeFilterOptionConfig<T extends string = string> extends FilterOptionConfigBase<T, DateRangeValue> {
|
|
1396
1400
|
type: FilterFieldTypes.DateRange;
|
|
1397
1401
|
filterFieldConfig?: {
|
|
1398
1402
|
presets?: DateRangePreset[];
|
|
1399
1403
|
showCustomRange?: boolean;
|
|
1404
|
+
calendarProps?: DateRangeCalendarProps;
|
|
1405
|
+
calendarClassNames?: ClassNames;
|
|
1400
1406
|
};
|
|
1401
1407
|
}
|
|
1402
1408
|
|
package/dist/components.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as e, B as t, j as o, E as r, k as i, r as n, L as l, S as b, s as p, t as c, c as g } from "./index-D5R6ImST.js";
|
|
2
2
|
import { B as m, x as d, I as S, y as T, r as C, z as I, T as h, v as F, h as y, E as V, F as D, w as P } from "./button-Cp3s42Ug.js";
|
|
3
|
-
import { bJ as A, G as B, A as M, t as x, v as w, o as f, p as v, bg as k, I as N, bs as E, ad as W, c8 as R, Y as G, V as H, bm as O, an as _, aP as U, aQ as z, aS as K, aR as j, c2 as X, aa as q, ab as J, b5 as Q, z as Y, q as Z, F as $, am as aa, al as sa, C as ea, Z as ta, ah as oa, bd as ra, g as ia, bp as na, at as la, Q as ba, O as pa, bj as ca, bq as ga, br as ua, aJ as ma, D as da, j as Sa, cd as Ta, bk as Ca, bT as Ia, _ as ha, b4 as Fa, af as ya, f as Va, ai as Da, c9 as Pa, ae as La, aB as Aa, aA as Ba, aC as Ma, az as xa, b3 as wa, bf as fa, a7 as va, bS as ka, a2 as Na, a4 as Ea, a3 as Wa, ak as Ra, bK as Ga, H as Ha, E as Oa, bb as _a, aq as Ua, a9 as za, ca as Ka, X as ja, $ as Xa, bN as qa, bO as Ja, bM as Qa, a0 as Ya, l as Za, L as $a, M as as, ap as ss, cb as es, r as ts, a1 as os, aT as rs, a6 as is, ay as ns, ax as ls, aF as bs, bl as ps, N as cs, aO as gs, n as us, bQ as ms, c7 as ds, P as Ss, R as Ts, b_ as Cs, k as Is, aN as hs, as as Fs, a$ as ys, a_ as Vs, aU as Ds, aZ as Ps, aV as Ls, aW as As, aX as Bs, aY as Ms, ac as xs, b0 as ws, be as fs, b6 as vs, bZ as ks, aL as Ns, aK as Es, c5 as Ws, bW as Rs, B as Gs, bR as Hs, w as Os, c6 as _s, a8 as Us, aM as zs, aw as Ks, b as js, bE as Xs, bx as qs, c3 as Js, aH as Qs, c4 as Ys, y as Zs, bi as $s, S as ae, J as se, K as ee, av as te, bh as oe, c as re, aG as ie, bA as ne, bv as le, d as be, cc as pe, bB as ce, bC as ge, au as ue, a as me, bo as de, T as Se, bc as Te, bP as Ce, a5 as Ie, bH as he, b9 as Fe, b8 as ye, ba as Ve, c1 as De, ar as Pe, b2 as Le, bF as Ae, U as Be, bu as Me, bt as xe, bG as we, bw as fe, m as ve, W as ke, h as Ne, aj as Ee, bX as We, ao as Re, bI as Ge, bV as He, bY as Oe, bL as _e, b$ as Ue, aE as ze, aD as Ke, bU as je, bD as Xe, bz as qe, by as Je, e as Qe, s as Ye, bn as Ze, c0 as $e, ag as at, ce as st, b7 as et, b1 as tt, x as ot, u as rt, aI as it } from "./index-
|
|
3
|
+
import { bJ as A, G as B, A as M, t as x, v as w, o as f, p as v, bg as k, I as N, bs as E, ad as W, c8 as R, Y as G, V as H, bm as O, an as _, aP as U, aQ as z, aS as K, aR as j, c2 as X, aa as q, ab as J, b5 as Q, z as Y, q as Z, F as $, am as aa, al as sa, C as ea, Z as ta, ah as oa, bd as ra, g as ia, bp as na, at as la, Q as ba, O as pa, bj as ca, bq as ga, br as ua, aJ as ma, D as da, j as Sa, cd as Ta, bk as Ca, bT as Ia, _ as ha, b4 as Fa, af as ya, f as Va, ai as Da, c9 as Pa, ae as La, aB as Aa, aA as Ba, aC as Ma, az as xa, b3 as wa, bf as fa, a7 as va, bS as ka, a2 as Na, a4 as Ea, a3 as Wa, ak as Ra, bK as Ga, H as Ha, E as Oa, bb as _a, aq as Ua, a9 as za, ca as Ka, X as ja, $ as Xa, bN as qa, bO as Ja, bM as Qa, a0 as Ya, l as Za, L as $a, M as as, ap as ss, cb as es, r as ts, a1 as os, aT as rs, a6 as is, ay as ns, ax as ls, aF as bs, bl as ps, N as cs, aO as gs, n as us, bQ as ms, c7 as ds, P as Ss, R as Ts, b_ as Cs, k as Is, aN as hs, as as Fs, a$ as ys, a_ as Vs, aU as Ds, aZ as Ps, aV as Ls, aW as As, aX as Bs, aY as Ms, ac as xs, b0 as ws, be as fs, b6 as vs, bZ as ks, aL as Ns, aK as Es, c5 as Ws, bW as Rs, B as Gs, bR as Hs, w as Os, c6 as _s, a8 as Us, aM as zs, aw as Ks, b as js, bE as Xs, bx as qs, c3 as Js, aH as Qs, c4 as Ys, y as Zs, bi as $s, S as ae, J as se, K as ee, av as te, bh as oe, c as re, aG as ie, bA as ne, bv as le, d as be, cc as pe, bB as ce, bC as ge, au as ue, a as me, bo as de, T as Se, bc as Te, bP as Ce, a5 as Ie, bH as he, b9 as Fe, b8 as ye, ba as Ve, c1 as De, ar as Pe, b2 as Le, bF as Ae, U as Be, bu as Me, bt as xe, bG as we, bw as fe, m as ve, W as ke, h as Ne, aj as Ee, bX as We, ao as Re, bI as Ge, bV as He, bY as Oe, bL as _e, b$ as Ue, aE as ze, aD as Ke, bU as je, bD as Xe, bz as qe, by as Je, e as Qe, s as Ye, bn as Ze, c0 as $e, ag as at, ce as st, b7 as et, b1 as tt, x as ot, u as rt, aI as it } from "./index-3Pv9mwF4.js";
|
|
4
4
|
import { L as lt, T as bt, b as pt, d as ct, e as gt, f as ut, t as mt } from "./toggle-group-XLnJ7UgK.js";
|
|
5
5
|
export {
|
|
6
6
|
A as AccentColor,
|
|
@@ -170741,26 +170741,34 @@ const _T = (e, t) => {
|
|
|
170741
170741
|
);
|
|
170742
170742
|
}) })
|
|
170743
170743
|
] })
|
|
170744
|
-
] }), Dke = ({
|
|
170745
|
-
|
|
170744
|
+
] }), Dke = ({
|
|
170745
|
+
filter: e,
|
|
170746
|
+
presets: t,
|
|
170747
|
+
showCustomRange: n = !0,
|
|
170748
|
+
onUpdateFilter: r,
|
|
170749
|
+
calendarProps: a,
|
|
170750
|
+
calendarClassNames: i
|
|
170751
|
+
}) => {
|
|
170752
|
+
const [o, s] = he(
|
|
170746
170753
|
e.value ? { from: new Date(e.value.from), to: new Date(e.value.to) } : void 0
|
|
170747
|
-
), [
|
|
170754
|
+
), [l, c] = he(e.value ? new Date(e.value.from) : /* @__PURE__ */ new Date());
|
|
170748
170755
|
be(() => {
|
|
170749
|
-
e.value ? (
|
|
170756
|
+
e.value ? (s({ from: new Date(e.value.from), to: new Date(e.value.to) }), c(new Date(e.value.from))) : (s(void 0), c(/* @__PURE__ */ new Date()));
|
|
170750
170757
|
}, [e.value]);
|
|
170751
|
-
const
|
|
170752
|
-
const
|
|
170753
|
-
|
|
170754
|
-
},
|
|
170758
|
+
const u = t ?? Ike(), d = u.filter((h) => h.group === "recommended"), p = u.filter((h) => h.group === "relative"), m = u.filter((h) => h.group === "calendar"), g = (h) => {
|
|
170759
|
+
const b = h.getRange();
|
|
170760
|
+
s({ from: b.from, to: b.to }), r({ from: b.from, to: b.to, preset: h.value });
|
|
170761
|
+
}, E = /* @__PURE__ */ _(
|
|
170755
170762
|
gp,
|
|
170756
170763
|
{
|
|
170764
|
+
...a,
|
|
170757
170765
|
mode: "range",
|
|
170758
170766
|
numberOfMonths: 2,
|
|
170759
|
-
selected:
|
|
170760
|
-
month:
|
|
170761
|
-
onMonthChange:
|
|
170762
|
-
onSelect: (
|
|
170763
|
-
|
|
170767
|
+
selected: o,
|
|
170768
|
+
month: l,
|
|
170769
|
+
onMonthChange: c,
|
|
170770
|
+
onSelect: (h) => {
|
|
170771
|
+
s(h), h != null && h.from && (h != null && h.to) && r({ from: h.from, to: h.to, preset: "CUSTOM" });
|
|
170764
170772
|
},
|
|
170765
170773
|
classNames: {
|
|
170766
170774
|
months: "flex flex-row space-x-cn-md",
|
|
@@ -170769,19 +170777,20 @@ const _T = (e, t) => {
|
|
|
170769
170777
|
"[&:has(>.day-range-end)]:rounded-r-cn-3 [&:has(>.day-range-start)]:rounded-l-cn-3 first:[&:has([aria-selected])]:rounded-l-cn-3 last:[&:has([aria-selected])]:rounded-r-cn-3",
|
|
170770
170778
|
"[&:has([aria-selected])]:bg-cn-brand-primary/10 [&:has([aria-selected].day-outside)]:bg-cn-brand-primary/5 [&:has([aria-selected].day-range-end)]:rounded-r-cn-3"
|
|
170771
170779
|
),
|
|
170772
|
-
day_range_middle: "aria-selected:bg-transparent aria-selected:text-cn-1"
|
|
170780
|
+
day_range_middle: "aria-selected:bg-transparent aria-selected:text-cn-1",
|
|
170781
|
+
...i
|
|
170773
170782
|
}
|
|
170774
170783
|
}
|
|
170775
170784
|
);
|
|
170776
170785
|
return /* @__PURE__ */ _(
|
|
170777
170786
|
Oke,
|
|
170778
170787
|
{
|
|
170779
|
-
recommendedPresets:
|
|
170780
|
-
relativePresets:
|
|
170781
|
-
calendarPresets:
|
|
170788
|
+
recommendedPresets: d,
|
|
170789
|
+
relativePresets: p,
|
|
170790
|
+
calendarPresets: m,
|
|
170782
170791
|
showCustomRange: n,
|
|
170783
|
-
onPresetSelect:
|
|
170784
|
-
calendarContent:
|
|
170792
|
+
onPresetSelect: g,
|
|
170793
|
+
calendarContent: E
|
|
170785
170794
|
}
|
|
170786
170795
|
);
|
|
170787
170796
|
}, wke = xt("cn-multi-select-container", {
|
|
@@ -171110,7 +171119,7 @@ const Mke = (e, t) => {
|
|
|
171110
171119
|
onUpdateFilter: n,
|
|
171111
171120
|
setIsOpen: r
|
|
171112
171121
|
}) => {
|
|
171113
|
-
var i, o, s, l;
|
|
171122
|
+
var i, o, s, l, c, u;
|
|
171114
171123
|
const a = Ae(() => `filter-${Math.random().toString(36).slice(2, 11)}`, []);
|
|
171115
171124
|
if (!n) return null;
|
|
171116
171125
|
switch (t.type) {
|
|
@@ -171119,8 +171128,8 @@ const Mke = (e, t) => {
|
|
|
171119
171128
|
yke,
|
|
171120
171129
|
{
|
|
171121
171130
|
filter: e,
|
|
171122
|
-
onUpdateFilter: (
|
|
171123
|
-
n(
|
|
171131
|
+
onUpdateFilter: (p) => {
|
|
171132
|
+
n(p), p && r(!1);
|
|
171124
171133
|
}
|
|
171125
171134
|
}
|
|
171126
171135
|
);
|
|
@@ -171131,8 +171140,10 @@ const Mke = (e, t) => {
|
|
|
171131
171140
|
filter: e,
|
|
171132
171141
|
presets: (i = t.filterFieldConfig) == null ? void 0 : i.presets,
|
|
171133
171142
|
showCustomRange: (o = t.filterFieldConfig) == null ? void 0 : o.showCustomRange,
|
|
171134
|
-
|
|
171135
|
-
|
|
171143
|
+
calendarProps: (s = t.filterFieldConfig) == null ? void 0 : s.calendarProps,
|
|
171144
|
+
calendarClassNames: (l = t.filterFieldConfig) == null ? void 0 : l.calendarClassNames,
|
|
171145
|
+
onUpdateFilter: (p) => {
|
|
171146
|
+
n(p), p && r(!1);
|
|
171136
171147
|
}
|
|
171137
171148
|
}
|
|
171138
171149
|
);
|
|
@@ -171141,7 +171152,7 @@ const Mke = (e, t) => {
|
|
|
171141
171152
|
Lke,
|
|
171142
171153
|
{
|
|
171143
171154
|
filter: e,
|
|
171144
|
-
onUpdateFilter: (
|
|
171155
|
+
onUpdateFilter: (p) => n(p),
|
|
171145
171156
|
handleEnter: () => r(!1)
|
|
171146
171157
|
}
|
|
171147
171158
|
);
|
|
@@ -171151,49 +171162,49 @@ const Mke = (e, t) => {
|
|
|
171151
171162
|
{
|
|
171152
171163
|
filterValue: e.value,
|
|
171153
171164
|
...t.filterFieldConfig,
|
|
171154
|
-
onUpdateFilter: (
|
|
171155
|
-
n(
|
|
171165
|
+
onUpdateFilter: (p) => {
|
|
171166
|
+
n(p);
|
|
171156
171167
|
}
|
|
171157
171168
|
}
|
|
171158
171169
|
);
|
|
171159
171170
|
case zn.MultiSelect: {
|
|
171160
|
-
const
|
|
171171
|
+
const d = e;
|
|
171161
171172
|
return /* @__PURE__ */ _(
|
|
171162
171173
|
Rke,
|
|
171163
171174
|
{
|
|
171164
171175
|
...t.filterFieldConfig,
|
|
171165
|
-
filter:
|
|
171166
|
-
filterOption: ((
|
|
171167
|
-
onUpdateFilter: (
|
|
171176
|
+
filter: d.value || [],
|
|
171177
|
+
filterOption: ((c = t.filterFieldConfig) == null ? void 0 : c.options) || [],
|
|
171178
|
+
onUpdateFilter: (p) => n(p)
|
|
171168
171179
|
}
|
|
171169
171180
|
);
|
|
171170
171181
|
}
|
|
171171
171182
|
case zn.Custom: {
|
|
171172
|
-
const
|
|
171183
|
+
const d = e;
|
|
171173
171184
|
return t.filterFieldConfig.renderCustomComponent({
|
|
171174
|
-
value:
|
|
171175
|
-
onChange: (
|
|
171185
|
+
value: d.value,
|
|
171186
|
+
onChange: (p) => n(p)
|
|
171176
171187
|
});
|
|
171177
171188
|
}
|
|
171178
171189
|
case zn.Checkbox: {
|
|
171179
|
-
const
|
|
171190
|
+
const d = e, p = `checkbox-${a}`;
|
|
171180
171191
|
return /* @__PURE__ */ U(
|
|
171181
171192
|
Sr,
|
|
171182
171193
|
{
|
|
171183
171194
|
optional: !0,
|
|
171184
171195
|
className: "rounded-cn-3 bg-cn-gray-secondary border-cn-gray-outline cursor-pointer border px-cn-md py-cn-xs [&>.cn-label-text]:flex [&>.cn-label-text]:items-center [&>.cn-label-text]:gap-x-cn-2xs",
|
|
171185
|
-
htmlFor:
|
|
171196
|
+
htmlFor: p,
|
|
171186
171197
|
children: [
|
|
171187
171198
|
/* @__PURE__ */ _(
|
|
171188
171199
|
ji,
|
|
171189
171200
|
{
|
|
171190
|
-
id:
|
|
171191
|
-
checked:
|
|
171192
|
-
onCheckedChange: (
|
|
171201
|
+
id: p,
|
|
171202
|
+
checked: d.value,
|
|
171203
|
+
onCheckedChange: (m) => n(m),
|
|
171193
171204
|
className: "relative z-[1]"
|
|
171194
171205
|
}
|
|
171195
171206
|
),
|
|
171196
|
-
(
|
|
171207
|
+
(u = t.filterFieldConfig) == null ? void 0 : u.label
|
|
171197
171208
|
]
|
|
171198
171209
|
}
|
|
171199
171210
|
);
|
|
@@ -171203,7 +171214,7 @@ const Mke = (e, t) => {
|
|
|
171203
171214
|
xke,
|
|
171204
171215
|
{
|
|
171205
171216
|
filter: e.value || [],
|
|
171206
|
-
onUpdateFilter: (
|
|
171217
|
+
onUpdateFilter: (p) => n(p),
|
|
171207
171218
|
filterFieldConfig: t.filterFieldConfig
|
|
171208
171219
|
}
|
|
171209
171220
|
);
|
|
@@ -181667,4 +181678,4 @@ export {
|
|
|
181667
181678
|
zle as y,
|
|
181668
181679
|
ea as z
|
|
181669
181680
|
};
|
|
181670
|
-
//# sourceMappingURL=index-
|
|
181681
|
+
//# sourceMappingURL=index-3Pv9mwF4.js.map
|