impact-nova 1.7.7 → 1.7.9

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.
@@ -1,107 +1,126 @@
1
- import { jsx as c, jsxs as C } from "react/jsx-runtime";
2
- import { useState as s, useRef as O, useCallback as A, useMemo as H, useEffect as _ } from "react";
3
- import { AgGridWrapper as E } from "../ag-grid-react/index.js";
1
+ import { jsx as i, jsxs as D } from "react/jsx-runtime";
2
+ import { useState as l, useRef as O, useCallback as H, useMemo as b, useEffect as A, memo as E } from "react";
3
+ import { AgGridWrapper as F } from "../ag-grid-react/index.js";
4
4
  import { cn as y } from "../../../lib/utils.js";
5
- import { DataTableContext as D, useDataTable as P } from "./data-table-context.js";
6
- import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as F } from "./data-table-constants.js";
7
- import { AG_GRID_VALUE_FORMATTERS as N } from "../ag-grid-react/value-formatters.js";
8
- const R = {
5
+ import { DataTableContext as N, DataTableSheetPortalContext as M, useDataTable as z, useDataTableSheetPortal as I } from "./data-table-context.js";
6
+ import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as j } from "./data-table-constants.js";
7
+ import { AG_GRID_VALUE_FORMATTERS as k } from "../ag-grid-react/value-formatters.js";
8
+ const w = {
9
9
  default: 46,
10
10
  compact: 30,
11
11
  comfort: 52
12
- }, G = (o) => {
12
+ }, P = (o) => {
13
13
  if (o)
14
14
  return o.map((e) => {
15
15
  if ("children" in e && e.children)
16
16
  return {
17
17
  ...e,
18
- children: G(e.children)
18
+ children: P(e.children)
19
19
  };
20
20
  const t = e;
21
21
  return !t.valueFormatter && (t.type === "numericColumn" || t.type === "number") ? {
22
22
  ...t,
23
- valueFormatter: N.number
23
+ valueFormatter: k.number
24
24
  } : t;
25
25
  });
26
- }, W = ({
26
+ }, q = ({
27
27
  children: o,
28
28
  className: e
29
29
  }) => {
30
- const [t, d] = s(null), [r, u] = s(null), [i, p] = s("medium"), [f, h] = s("full"), [a, m] = s("default"), [g, x] = s(!1), l = O(0), T = A((n) => {
31
- l.current = Math.max(0, l.current + n), x(l.current > 0);
32
- }, []), b = A((n) => {
33
- d(n);
34
- }, []), v = {
30
+ const [t, r] = l(null), [n, p] = l(null), [s, h] = l("medium"), [c, d] = l("full"), [u, f] = l("default"), [g, S] = l(!1), m = O(0), x = H((v) => {
31
+ m.current = Math.max(0, m.current + v), S(m.current > 0);
32
+ }, []), T = H((v) => {
33
+ r(v);
34
+ }, []), a = {
35
35
  small: "12px",
36
36
  medium: "14px",
37
37
  large: "16px"
38
- }[i], S = `${R[a]}px`;
39
- return /* @__PURE__ */ c(D.Provider, { value: {
38
+ }[s], R = `${w[u]}px`, C = b(() => ({
40
39
  gridApi: t,
41
- registerApi: b,
42
- sheetTarget: r,
43
- setSheetTarget: u,
44
- scopedSheetOpen: g,
45
- registerScopedSheetDepth: T,
46
- fontSize: i,
47
- setFontSize: p,
48
- numericFormat: f,
49
- setNumericFormat: h,
50
- rowHeight: a,
51
- setRowHeight: m
52
- }, children: /* @__PURE__ */ c(
40
+ registerApi: T,
41
+ registerScopedSheetDepth: x,
42
+ fontSize: s,
43
+ setFontSize: h,
44
+ numericFormat: c,
45
+ setNumericFormat: d,
46
+ rowHeight: u,
47
+ setRowHeight: f
48
+ }), [
49
+ t,
50
+ T,
51
+ x,
52
+ s,
53
+ h,
54
+ c,
55
+ d,
56
+ u,
57
+ f
58
+ ]), G = b(() => ({
59
+ sheetTarget: n,
60
+ setSheetTarget: p,
61
+ scopedSheetOpen: g
62
+ }), [n, p, g]);
63
+ return /* @__PURE__ */ i(N.Provider, { value: C, children: /* @__PURE__ */ i(M.Provider, { value: G, children: /* @__PURE__ */ i(
53
64
  "div",
54
65
  {
55
66
  "data-component": "data-table",
56
67
  className: y("flex flex-col w-full min-h-0 rounded-[inherit]", e),
57
68
  style: {
58
- "--ag-font-size": v,
59
- "--ag-row-height": S
69
+ "--ag-font-size": a,
70
+ "--ag-row-height": R
60
71
  },
61
72
  children: o
62
73
  }
63
- ) });
64
- }, w = {
74
+ ) }) });
75
+ }, _ = {
65
76
  full: "full_no",
66
77
  k: "thou",
67
78
  m: "mil",
68
79
  b: "bil"
69
- };
70
- function X(o) {
80
+ }, L = E(function() {
81
+ const { setSheetTarget: e, scopedSheetOpen: t } = I();
82
+ return /* @__PURE__ */ i(
83
+ "div",
84
+ {
85
+ ref: e,
86
+ className: "absolute inset-0 pointer-events-none z-[39] flex overflow-x-hidden overflow-y-visible",
87
+ style: t ? { minHeight: j } : void 0
88
+ }
89
+ );
90
+ });
91
+ function J(o) {
71
92
  const {
72
93
  registerApi: e,
73
- setSheetTarget: t,
74
- rowHeight: d,
94
+ rowHeight: t,
75
95
  gridApi: r,
76
- scopedSheetOpen: u,
77
- numericFormat: i
78
- } = P(), {
96
+ numericFormat: n
97
+ } = z(), {
79
98
  className: p,
80
- onGridReady: f,
99
+ onGridReady: s,
81
100
  rowHeight: h,
82
- context: a,
83
- columnDefs: m,
84
- maintainColumnOrder: g = !0,
85
- ...x
86
- } = o, l = R[d], T = h ?? l, b = H(() => G(m), [m]), v = H(() => ({
87
- ...a,
88
- formatType: w[i]
89
- }), [a, i]);
90
- _(() => {
101
+ context: c,
102
+ columnDefs: d,
103
+ maintainColumnOrder: u = !0,
104
+ ...f
105
+ } = o, g = w[t], S = h ?? g, m = b(() => P(d), [d]), x = b(() => ({
106
+ ...c,
107
+ formatType: _[n]
108
+ }), [c, n]);
109
+ A(() => {
91
110
  r?.resetRowHeights();
92
- }, [d, r]), _(() => {
111
+ }, [t, r]), A(() => {
93
112
  if (r) {
94
- const n = r.getGridOption("context") || {};
113
+ const a = r.getGridOption("context") || {};
95
114
  r.setGridOption("context", {
96
- ...n,
97
- formatType: w[i]
115
+ ...a,
116
+ formatType: _[n]
98
117
  }), r.refreshCells({ force: !0 });
99
118
  }
100
- }, [i, r]);
101
- const S = (n) => {
102
- e(n.api), f?.(n);
103
- };
104
- return /* @__PURE__ */ C(
119
+ }, [n, r]);
120
+ const T = H((a) => {
121
+ e(a.api), s?.(a);
122
+ }, [e, s]);
123
+ return /* @__PURE__ */ D(
105
124
  "div",
106
125
  {
107
126
  className: y(
@@ -109,35 +128,28 @@ function X(o) {
109
128
  p
110
129
  ),
111
130
  children: [
112
- /* @__PURE__ */ c(
113
- E,
131
+ /* @__PURE__ */ i(
132
+ F,
114
133
  {
115
- ...x,
116
- columnDefs: b,
117
- rowHeight: T,
118
- onGridReady: S,
119
- context: v,
120
- maintainColumnOrder: g
134
+ ...f,
135
+ columnDefs: m,
136
+ rowHeight: S,
137
+ onGridReady: T,
138
+ context: x,
139
+ maintainColumnOrder: u
121
140
  }
122
141
  ),
123
- /* @__PURE__ */ c(
124
- "div",
125
- {
126
- ref: t,
127
- className: "absolute inset-0 pointer-events-none z-[39] flex overflow-x-hidden overflow-y-visible",
128
- style: u ? { minHeight: F } : void 0
129
- }
130
- )
142
+ /* @__PURE__ */ i(L, {})
131
143
  ]
132
144
  }
133
145
  );
134
146
  }
135
- const U = ({
147
+ const K = ({
136
148
  children: o,
137
149
  className: e
138
- }) => /* @__PURE__ */ c("div", { "data-component": "data-table-toolbar", className: y("flex items-center justify-between px-4 py-3 shrink-0 bg-canvas-elevated rounded-t-[inherit]", e), children: o });
150
+ }) => /* @__PURE__ */ i("div", { "data-component": "data-table-toolbar", className: y("flex items-center justify-between px-4 py-3 shrink-0 bg-canvas-elevated rounded-t-[inherit]", e), children: o });
139
151
  export {
140
- W as DataTable,
141
- X as DataTableContent,
142
- U as DataTableToolbar
152
+ q as DataTable,
153
+ J as DataTableContent,
154
+ K as DataTableToolbar
143
155
  };
@@ -1,29 +1,33 @@
1
1
  import { DataTable as t, DataTableContent as T, DataTableToolbar as o } from "./data-table.js";
2
2
  import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as D, TABLE_VIEWPORT_SHELL_EXPANDED_CLASS as l } from "./data-table-constants.js";
3
3
  import { DataTableColumnList as n } from "./data-table-column-list.js";
4
- import { DataTableContext as S, useDataTable as m } from "./data-table-context.js";
5
- import { DataTableFormatOptions as E } from "./data-table-format-options.js";
6
- import { DataTableSheet as x, DataTableSheetContent as f, DataTableSheetHeader as V, DataTableSheetTrigger as u } from "./data-table-sheet.js";
7
- import { DataTableViewMenuContent as C, DataTableViewMenuDensity as s, DataTableViewMenuSettingsItem as A, DataTableViewMenuTrigger as H, DataTableViewMenuViewportExpand as L } from "./data-table-view-menu.js";
8
- import { DataTableSavedViews as g } from "./data-table-saved-views.js";
4
+ import { DataTableContext as i, DataTableSheetPortalContext as p, useDataTable as m, useDataTableSheetPortal as x } from "./data-table-context.js";
5
+ import { DataTableFormatOptions as _ } from "./data-table-format-options.js";
6
+ import { DataTableSheet as s, DataTableSheetContent as f, DataTableSheetHeader as h, DataTableSheetTrigger as C, useDataTableSheet as V, useDataTableSheetApi as w } from "./data-table-sheet.js";
7
+ import { DataTableViewMenuContent as H, DataTableViewMenuDensity as L, DataTableViewMenuSettingsItem as M, DataTableViewMenuTrigger as P, DataTableViewMenuViewportExpand as g } from "./data-table-view-menu.js";
8
+ import { DataTableSavedViews as O } from "./data-table-saved-views.js";
9
9
  export {
10
10
  D as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX,
11
11
  t as DataTable,
12
12
  n as DataTableColumnList,
13
13
  T as DataTableContent,
14
- S as DataTableContext,
15
- E as DataTableFormatOptions,
16
- g as DataTableSavedViews,
17
- x as DataTableSheet,
14
+ i as DataTableContext,
15
+ _ as DataTableFormatOptions,
16
+ O as DataTableSavedViews,
17
+ s as DataTableSheet,
18
18
  f as DataTableSheetContent,
19
- V as DataTableSheetHeader,
20
- u as DataTableSheetTrigger,
19
+ h as DataTableSheetHeader,
20
+ p as DataTableSheetPortalContext,
21
+ C as DataTableSheetTrigger,
21
22
  o as DataTableToolbar,
22
- C as DataTableViewMenuContent,
23
- s as DataTableViewMenuDensity,
24
- A as DataTableViewMenuSettingsItem,
25
- H as DataTableViewMenuTrigger,
26
- L as DataTableViewMenuViewportExpand,
23
+ H as DataTableViewMenuContent,
24
+ L as DataTableViewMenuDensity,
25
+ M as DataTableViewMenuSettingsItem,
26
+ P as DataTableViewMenuTrigger,
27
+ g as DataTableViewMenuViewportExpand,
27
28
  l as TABLE_VIEWPORT_SHELL_EXPANDED_CLASS,
28
- m as useDataTable
29
+ m as useDataTable,
30
+ V as useDataTableSheet,
31
+ w as useDataTableSheetApi,
32
+ x as useDataTableSheetPortal
29
33
  };
@@ -3,9 +3,10 @@ import { HelperTextPosition } from './types/helper-text.types';
3
3
  import * as React from "react";
4
4
  declare const textareaVariants: (props?: {
5
5
  isError?: boolean;
6
+ size?: "sm" | "md" | "lg" | "default";
6
7
  disabled?: boolean;
7
8
  } & import('class-variance-authority/types').ClassProp) => string;
8
- export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "disabled">, VariantProps<typeof textareaVariants> {
9
+ export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "disabled" | "size">, VariantProps<typeof textareaVariants> {
9
10
  label?: string;
10
11
  helperText?: React.ReactNode;
11
12
  /** @default "absolute" */
@@ -1,104 +1,112 @@
1
- import { jsxs as e, jsx as d, Fragment as w } from "react/jsx-runtime";
1
+ import { jsxs as e, jsx as a, Fragment as N } from "react/jsx-runtime";
2
2
  import * as m from "react";
3
- import { cva as N } from "class-variance-authority";
4
- import { Info as f } from "../../icons/index.js";
5
- import { cn as t } from "../../lib/utils.js";
6
- const y = N(
7
- "flex min-h-20 w-full rounded-md border border-field bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-content-empty focus-visible:outline-none focus-visible:border-brand hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke md:text-sm",
3
+ import { cva as y } from "class-variance-authority";
4
+ import { Info as x } from "../../icons/index.js";
5
+ import { cn as d } from "../../lib/utils.js";
6
+ const z = y(
7
+ "flex w-full rounded-md border border-field bg-transparent px-3 py-2 text-sm font-medium shadow-sm transition-colors placeholder:font-medium placeholder:text-content-empty focus-visible:outline-none focus-visible:border-brand hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
8
8
  {
9
9
  variants: {
10
10
  isError: {
11
11
  true: "border-destructive hover:border-destructive",
12
12
  false: ""
13
13
  },
14
+ size: {
15
+ default: "min-h-20",
16
+ sm: "min-h-14",
17
+ md: "min-h-[72px]",
18
+ lg: "min-h-32"
19
+ },
14
20
  disabled: {
15
- true: "cursor-not-allowed opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
21
+ true: "cursor-not-allowed opacity-100 bg-disabled-surface border-stroke text-disabled-foreground placeholder:text-disabled-foreground hover:border-stroke",
16
22
  false: ""
17
23
  }
18
24
  },
19
25
  defaultVariants: {
26
+ size: "default",
20
27
  isError: !1
21
28
  }
22
29
  }
23
- ), k = m.forwardRef(
30
+ ), C = m.forwardRef(
24
31
  ({
25
32
  className: b,
26
33
  label: u,
27
- helperText: s,
28
- helperTextPosition: l = "absolute",
29
- characterLimit: c,
30
- isError: a,
31
- disabled: r,
32
- value: i,
33
- onChange: g,
34
+ helperText: l,
35
+ helperTextPosition: s = "absolute",
36
+ characterLimit: o,
37
+ isError: t,
38
+ size: g,
39
+ disabled: i,
40
+ value: r,
41
+ onChange: v,
34
42
  ...n
35
- }, v) => {
36
- const [p, o] = m.useState(0);
43
+ }, p) => {
44
+ const [h, c] = m.useState(0);
37
45
  m.useEffect(() => {
38
- i ? o(String(i).length) : n.defaultValue && o(String(n.defaultValue).length);
39
- }, [i, n.defaultValue]);
40
- const h = (x) => {
41
- o(x.target.value.length), g?.(x);
46
+ r ? c(String(r).length) : n.defaultValue && c(String(n.defaultValue).length);
47
+ }, [r, n.defaultValue]);
48
+ const w = (f) => {
49
+ c(f.target.value.length), v?.(f);
42
50
  };
43
51
  return /* @__PURE__ */ e("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", children: [
44
52
  /* @__PURE__ */ e("div", { className: "flex flex-col gap-[6px]", children: [
45
53
  u && /* @__PURE__ */ e(
46
54
  "label",
47
55
  {
48
- className: t(
56
+ className: d(
49
57
  "text-xs font-medium leading-[18px] text-content-tertiary",
50
- r && "opacity-70",
51
- a && "text-destructive"
58
+ i && "opacity-70",
59
+ t && "text-destructive"
52
60
  ),
53
61
  children: [
54
62
  u,
55
63
  " ",
56
- n.required && /* @__PURE__ */ d("span", { className: "text-destructive", children: "*" })
64
+ n.required && /* @__PURE__ */ a("span", { className: "text-destructive", children: "*" })
57
65
  ]
58
66
  }
59
67
  ),
60
68
  /* @__PURE__ */ e(
61
69
  "div",
62
70
  {
63
- className: t(
64
- s && l === "absolute" && "relative"
71
+ className: d(
72
+ l && s === "absolute" && "relative"
65
73
  ),
66
74
  children: [
67
- /* @__PURE__ */ d(
75
+ /* @__PURE__ */ a(
68
76
  "textarea",
69
77
  {
70
- className: t(
71
- y({ isError: a, disabled: r, className: b }),
78
+ className: d(
79
+ z({ isError: t, size: g, disabled: i, className: b }),
72
80
  "bg-canvas",
73
- r && "bg-disabled-surface"
81
+ i && "bg-disabled-surface"
74
82
  ),
75
- ref: v,
76
- disabled: !!r,
77
- value: i,
78
- onChange: h,
83
+ ref: p,
84
+ disabled: !!i,
85
+ value: r,
86
+ onChange: w,
79
87
  "data-component": "textarea",
80
88
  ...n
81
89
  }
82
90
  ),
83
- s && l === "absolute" && /* @__PURE__ */ e(
91
+ l && s === "absolute" && /* @__PURE__ */ e(
84
92
  "div",
85
93
  {
86
- className: t(
94
+ className: d(
87
95
  "absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-[6px] text-[12px] font-medium leading-[18px] text-navigation-muted",
88
- a && "text-destructive"
96
+ t && "text-destructive"
89
97
  ),
90
98
  children: [
91
- /* @__PURE__ */ d(
92
- f,
99
+ /* @__PURE__ */ a(
100
+ x,
93
101
  {
94
102
  size: "xs",
95
- className: t(
103
+ className: d(
96
104
  "shrink-0",
97
- a ? "text-destructive" : "text-content-muted"
105
+ t ? "text-destructive" : "text-content-muted"
98
106
  )
99
107
  }
100
108
  ),
101
- /* @__PURE__ */ d("p", { className: "min-w-0", children: s })
109
+ /* @__PURE__ */ a("p", { className: "min-w-0", children: l })
102
110
  ]
103
111
  }
104
112
  )
@@ -106,47 +114,44 @@ const y = N(
106
114
  }
107
115
  )
108
116
  ] }),
109
- (s && l === "flow" || c) && /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-[6px]", children: [
110
- /* @__PURE__ */ d(
117
+ (l && s === "flow" || o) && /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-[6px]", children: [
118
+ /* @__PURE__ */ a(
111
119
  "div",
112
120
  {
113
- className: t(
121
+ className: d(
114
122
  "flex min-w-0 flex-1 items-center gap-[6px]",
115
- a && "text-destructive"
123
+ t && "text-destructive"
116
124
  ),
117
- children: s && l === "flow" && /* @__PURE__ */ e(w, { children: [
118
- /* @__PURE__ */ d(
119
- f,
125
+ children: l && s === "flow" && /* @__PURE__ */ e(N, { children: [
126
+ /* @__PURE__ */ a(
127
+ x,
120
128
  {
121
129
  size: "xs",
122
- className: t(
123
- "shrink-0",
124
- a ? "text-destructive" : "text-content-muted"
125
- )
130
+ color: t ? "destructive" : "muted"
126
131
  }
127
132
  ),
128
- /* @__PURE__ */ d(
133
+ /* @__PURE__ */ a(
129
134
  "p",
130
135
  {
131
- className: t(
136
+ className: d(
132
137
  "min-w-0 text-[12px] font-medium leading-[18px] text-navigation-muted",
133
- a && "text-destructive"
138
+ t && "text-destructive"
134
139
  ),
135
- children: s
140
+ children: l
136
141
  }
137
142
  )
138
143
  ] })
139
144
  }
140
145
  ),
141
- c && /* @__PURE__ */ e(
146
+ o && /* @__PURE__ */ e(
142
147
  "div",
143
148
  {
144
149
  className: "text-[12px] font-medium leading-[18px] text-navigation-muted text-right",
145
150
  "data-component": "character-count-indicator",
146
151
  children: [
147
- p,
152
+ h,
148
153
  "/",
149
- c
154
+ o
150
155
  ]
151
156
  }
152
157
  )
@@ -154,7 +159,7 @@ const y = N(
154
159
  ] });
155
160
  }
156
161
  );
157
- k.displayName = "Textarea";
162
+ C.displayName = "Textarea";
158
163
  export {
159
- k as Textarea
164
+ C as Textarea
160
165
  };