@caspeco/casper-ui-library 7.10.0 → 7.11.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/components/combobox/combobox-button.d.ts.map +1 -1
- package/dist/components/combobox/combobox-button.js +33 -37
- package/dist/components/table/table-content.d.ts +5 -1
- package/dist/components/table/table-content.d.ts.map +1 -1
- package/dist/components/table/table-content.js +23 -21
- package/dist/components/table/table-header-dropdown.d.ts +3 -1
- package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
- package/dist/components/table/table-header-dropdown.js +22 -21
- package/dist/components/table/table-header-row.d.ts +3 -1
- package/dist/components/table/table-header-row.d.ts.map +1 -1
- package/dist/components/table/table-header-row.js +62 -60
- package/dist/theme/theme-config/components/combobox-theme.d.ts +20 -1
- package/dist/theme/theme-config/components/combobox-theme.d.ts.map +1 -1
- package/dist/theme/theme-config/components/combobox-theme.js +21 -4
- package/dist/theme/theme-config/components/input-theme.d.ts +16 -23
- package/dist/theme/theme-config/components/input-theme.d.ts.map +1 -1
- package/dist/theme/theme-config/components/input-theme.js +36 -24
- package/dist/theme/theme-config/components/select-theme.d.ts +16 -23
- package/dist/theme/theme-config/components/select-theme.d.ts.map +1 -1
- package/dist/theme/theme-config/components/textarea-theme.d.ts.map +1 -1
- package/dist/theme/theme-config/components/textarea-theme.js +33 -20
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-button.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-button.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAsBlD,wBAAgB,cAAc,CAAC,EAC9B,EAAE,EACF,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,cAAc,GACd,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"combobox-button.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-button.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAsBlD,wBAAgB,cAAc,CAAC,EAC9B,EAAE,EACF,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,cAAc,GACd,EAAE,kBAAkB,2CAgMpB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { useStyleConfig as
|
|
3
|
-
import { Fragment as
|
|
2
|
+
import { useStyleConfig as X, Flex as c, Box as d, Input as $ } from "@chakra-ui/react";
|
|
3
|
+
import { Fragment as D } from "react";
|
|
4
4
|
import { ComboboxItem as E } from "./combobox-item.js";
|
|
5
5
|
import { Tag as K } from "../tag/tag.js";
|
|
6
6
|
import { Icon as U } from "../icon/icon.js";
|
|
7
7
|
import { Icons as q } from "../icon/types.js";
|
|
8
8
|
import { ThemeColorVariable as r, ThemeSpaceVariable as u, ThemeRadiusVariable as G, ThemeIconSizeVariable as J } from "../../theme/theme-types.js";
|
|
9
|
-
function
|
|
9
|
+
function R() {
|
|
10
10
|
return /* @__PURE__ */ i(
|
|
11
11
|
d,
|
|
12
12
|
{
|
|
@@ -27,50 +27,50 @@ function j() {
|
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
function oo({
|
|
30
|
-
id:
|
|
30
|
+
id: j,
|
|
31
31
|
asPlainText: e,
|
|
32
32
|
inputValue: h,
|
|
33
33
|
selectedItems: n,
|
|
34
|
-
displayItems:
|
|
35
|
-
toggleItem:
|
|
34
|
+
displayItems: B,
|
|
35
|
+
toggleItem: x,
|
|
36
36
|
highlightState: l,
|
|
37
37
|
openState: a,
|
|
38
38
|
parentStrings: V,
|
|
39
39
|
size: W,
|
|
40
40
|
variant: v,
|
|
41
41
|
label: S,
|
|
42
|
-
placeHolderText:
|
|
42
|
+
placeHolderText: C,
|
|
43
43
|
isDisabled: b,
|
|
44
|
-
isReadOnly:
|
|
45
|
-
isInvalid:
|
|
44
|
+
isReadOnly: s,
|
|
45
|
+
isInvalid: m,
|
|
46
46
|
collapsed: k,
|
|
47
|
-
hasPendingDelete:
|
|
48
|
-
setHasPendingDelete:
|
|
47
|
+
hasPendingDelete: w,
|
|
48
|
+
setHasPendingDelete: t,
|
|
49
49
|
setInputValue: O,
|
|
50
50
|
onSearch: y,
|
|
51
51
|
isSingleSelect: z
|
|
52
52
|
}) {
|
|
53
|
-
const A =
|
|
54
|
-
if (o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), a.isOpen ?
|
|
53
|
+
const A = X("Combobox", { size: W, variant: v }), F = (o) => {
|
|
54
|
+
if (o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), a.isOpen ? x(B[l.index]) : a.open()), o.key === "Escape") {
|
|
55
55
|
if (!a.isOpen) return;
|
|
56
56
|
o.preventDefault(), o.stopPropagation(), a.close(), e || (O(""), y?.(""));
|
|
57
57
|
}
|
|
58
|
-
o.key === "Backspace" ? h.length === 0 && n.length > 0 && !e && (
|
|
59
|
-
},
|
|
58
|
+
o.key === "Backspace" ? h.length === 0 && n.length > 0 && !e && (w ? (x(n[n.length - 1]), t(!1)) : t(!0)) : t(!1), o.key === "ArrowDown" && (a.isOpen ? l.next() : a.open()), o.key === "ArrowUp" && (a.isOpen ? l.previous() : a.open());
|
|
59
|
+
}, L = (o) => {
|
|
60
60
|
o.preventDefault(), o.stopPropagation();
|
|
61
61
|
const p = o.target.value;
|
|
62
62
|
O(p), y?.(p), l.set(0), a.open();
|
|
63
|
-
},
|
|
63
|
+
}, g = n[0], _ = n[n.length - 1], N = a.isOpen || e || C;
|
|
64
64
|
return /* @__PURE__ */ f(
|
|
65
65
|
c,
|
|
66
66
|
{
|
|
67
67
|
__css: A,
|
|
68
68
|
"aria-disabled": b,
|
|
69
|
-
"aria-readonly":
|
|
70
|
-
"aria-invalid":
|
|
69
|
+
"aria-readonly": s,
|
|
70
|
+
"aria-invalid": m,
|
|
71
71
|
borderRadius: G.Small,
|
|
72
72
|
padding: u.Small,
|
|
73
|
-
_focusWithin:
|
|
73
|
+
_focusWithin: m ? {
|
|
74
74
|
borderColor: r.Error,
|
|
75
75
|
boxShadow: `0 0 0 4px ${r.ErrorContainer}`,
|
|
76
76
|
backgroundColor: r.Surface
|
|
@@ -79,10 +79,6 @@ function oo({
|
|
|
79
79
|
boxShadow: `0 0 0 4px ${r.InfoContainer}`,
|
|
80
80
|
backgroundColor: r.Surface
|
|
81
81
|
},
|
|
82
|
-
_disabled: {
|
|
83
|
-
borderColor: "transparent",
|
|
84
|
-
backgroundColor: r.SurfaceDisabled
|
|
85
|
-
},
|
|
86
82
|
children: [
|
|
87
83
|
/* @__PURE__ */ f(
|
|
88
84
|
c,
|
|
@@ -101,13 +97,13 @@ function oo({
|
|
|
101
97
|
whiteSpace: "nowrap",
|
|
102
98
|
textOverflow: "ellipsis",
|
|
103
99
|
children: [
|
|
104
|
-
n.length > 3 && /* @__PURE__ */ i(
|
|
105
|
-
n.length > 2 && /* @__PURE__ */ i(
|
|
100
|
+
n.length > 3 && /* @__PURE__ */ i(R, {}),
|
|
101
|
+
n.length > 2 && /* @__PURE__ */ i(R, {}),
|
|
106
102
|
n.length > 1 && /* @__PURE__ */ i(K, { children: n.length - 1 }),
|
|
107
103
|
/* @__PURE__ */ i(
|
|
108
104
|
E,
|
|
109
105
|
{
|
|
110
|
-
isDeleting:
|
|
106
|
+
isDeleting: w,
|
|
111
107
|
item: _,
|
|
112
108
|
asPlainText: e
|
|
113
109
|
}
|
|
@@ -119,11 +115,11 @@ function oo({
|
|
|
119
115
|
{
|
|
120
116
|
item: o,
|
|
121
117
|
asPlainText: e,
|
|
122
|
-
isDeleting: p === n.length - 1 &&
|
|
118
|
+
isDeleting: p === n.length - 1 && w
|
|
123
119
|
},
|
|
124
120
|
o.id
|
|
125
121
|
))),
|
|
126
|
-
e && n.length > 0 &&
|
|
122
|
+
e && n.length > 0 && g && h === g.label && V[g.id]?.map((o) => /* @__PURE__ */ f(D, { children: [
|
|
127
123
|
/* @__PURE__ */ i(
|
|
128
124
|
d,
|
|
129
125
|
{
|
|
@@ -137,19 +133,19 @@ function oo({
|
|
|
137
133
|
/* @__PURE__ */ i(d, { color: r.OnSurfaceSubdued, children: "/" })
|
|
138
134
|
] }, o)),
|
|
139
135
|
/* @__PURE__ */ i(
|
|
140
|
-
|
|
136
|
+
$,
|
|
141
137
|
{
|
|
142
|
-
id:
|
|
138
|
+
id: j,
|
|
143
139
|
isDisabled: b,
|
|
144
|
-
isReadOnly:
|
|
145
|
-
isInvalid:
|
|
146
|
-
onKeyDown:
|
|
140
|
+
isReadOnly: s,
|
|
141
|
+
isInvalid: m,
|
|
142
|
+
onKeyDown: F,
|
|
147
143
|
variant: "unstyled",
|
|
148
144
|
value: h,
|
|
149
145
|
autoComplete: "off",
|
|
150
146
|
minWidth: u.XLarge,
|
|
151
|
-
onChange:
|
|
152
|
-
placeholder:
|
|
147
|
+
onChange: L,
|
|
148
|
+
placeholder: C,
|
|
153
149
|
border: "none",
|
|
154
150
|
flex: 1,
|
|
155
151
|
color: r.OnSurface,
|
|
@@ -161,7 +157,7 @@ function oo({
|
|
|
161
157
|
cursor: "not-allowed",
|
|
162
158
|
color: r.OnSurfaceSubdued
|
|
163
159
|
},
|
|
164
|
-
sx:
|
|
160
|
+
sx: N ? {} : {
|
|
165
161
|
position: "absolute",
|
|
166
162
|
width: "1px",
|
|
167
163
|
height: "1px",
|
|
@@ -182,7 +178,7 @@ function oo({
|
|
|
182
178
|
{
|
|
183
179
|
icon: q.TreeViewCollapse,
|
|
184
180
|
size: J.Small,
|
|
185
|
-
color: b
|
|
181
|
+
color: b ? r.OnSurfaceSubdued : r.OnSurface
|
|
186
182
|
}
|
|
187
183
|
) })
|
|
188
184
|
]
|
|
@@ -43,8 +43,12 @@ export interface TableContentProps<TData extends TableData = TableData> {
|
|
|
43
43
|
* Enables virtualization for the table rows to improve performance with large datasets.
|
|
44
44
|
*/
|
|
45
45
|
virtualization?: VirtualizationOptions;
|
|
46
|
+
/**
|
|
47
|
+
* Anchor portals to a referenced layer. Defaults to document body.
|
|
48
|
+
*/
|
|
49
|
+
portalContainerRef?: React.RefObject<HTMLElement | null>;
|
|
46
50
|
}
|
|
47
|
-
declare const TableContentInner: <TData extends TableData>({ onClickRow, onRowClickIndication, hideTableHeaderDropdown, showRowHoverStyle, stickyHeaders, virtualization, ...props }: TableContentProps<TData> & ThemeStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
declare const TableContentInner: <TData extends TableData>({ onClickRow, onRowClickIndication, hideTableHeaderDropdown, showRowHoverStyle, stickyHeaders, virtualization, portalContainerRef, ...props }: TableContentProps<TData> & ThemeStyleProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
52
|
export declare const TableContent: typeof TableContentInner;
|
|
49
53
|
export {};
|
|
50
54
|
//# sourceMappingURL=table-content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-content.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE,UAAU,qBAAqB;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS;IACrE;;OAEG;IACH,UAAU,CAAC,EAAE,CACZ,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KACnF,IAAI,CAAC;IAEV;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"table-content.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnE,UAAU,qBAAqB;IAC9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS;IACrE;;OAEG;IACH,UAAU,CAAC,EAAE,CACZ,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,EACxB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,mBAAmB,CAAC,KACnF,IAAI,CAAC;IAEV;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC;;OAEG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;CACzD;AAED,QAAA,MAAM,iBAAiB,GAAI,KAAK,SAAS,SAAS,EAAE,+IASjD,iBAAiB,CAAC,KAAK,CAAC,GAAG,eAAe,4CAuJ5C,CAAC;AAEF,eAAO,MAAM,YAAY,EAA8B,OAAO,iBAAiB,CAAC"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsxs as S, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { Table as
|
|
3
|
-
import { useVirtualizer as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
import { TableHeaderRow as
|
|
2
|
+
import { Table as E, Thead as M, Box as $, Tbody as y } from "@chakra-ui/react";
|
|
3
|
+
import { useVirtualizer as D } from "../../node_modules/@tanstack/react-virtual/dist/esm/index.js";
|
|
4
|
+
import { memo as L, useRef as O, useMemo as u } from "react";
|
|
5
|
+
import { useTableContext as Y } from "./table-context.js";
|
|
6
|
+
import { TableHeaderRow as k } from "./table-header-row.js";
|
|
7
7
|
import { TableRow as v } from "./table-row.js";
|
|
8
|
-
const
|
|
8
|
+
const q = ({
|
|
9
9
|
onClickRow: m,
|
|
10
10
|
onRowClickIndication: b,
|
|
11
11
|
hideTableHeaderDropdown: w,
|
|
12
12
|
showRowHoverStyle: g = !0,
|
|
13
13
|
stickyHeaders: h,
|
|
14
14
|
virtualization: a,
|
|
15
|
-
|
|
15
|
+
portalContainerRef: R,
|
|
16
|
+
...z
|
|
16
17
|
}) => {
|
|
17
|
-
const t =
|
|
18
|
+
const t = Y(), i = O(null), B = u(() => h ? {
|
|
18
19
|
position: "sticky",
|
|
19
20
|
top: 0,
|
|
20
21
|
zIndex: 1
|
|
@@ -29,7 +30,7 @@ const k = ({
|
|
|
29
30
|
t.sorting,
|
|
30
31
|
t.data
|
|
31
32
|
]
|
|
32
|
-
), p = c.length, l = !!a, f = a?.estimateRowHeight ?? 40, x = a?.overscan ?? 5,
|
|
33
|
+
), p = c.length, l = !!a, f = a?.estimateRowHeight ?? 40, x = a?.overscan ?? 5, H = a?.height ?? "600px", I = u(
|
|
33
34
|
() => ({
|
|
34
35
|
count: p,
|
|
35
36
|
getScrollElement: () => i.current,
|
|
@@ -41,7 +42,7 @@ const k = ({
|
|
|
41
42
|
}
|
|
42
43
|
}),
|
|
43
44
|
[l, f, x, p]
|
|
44
|
-
), C =
|
|
45
|
+
), C = D(I), n = l ? C.getVirtualItems() : [], _ = () => {
|
|
45
46
|
if (!l)
|
|
46
47
|
return /* @__PURE__ */ e(y, { children: c.map((s) => {
|
|
47
48
|
const r = s.getVisibleCells();
|
|
@@ -63,12 +64,12 @@ const k = ({
|
|
|
63
64
|
n.map((s) => {
|
|
64
65
|
const r = c[s.index];
|
|
65
66
|
if (!r) return null;
|
|
66
|
-
const
|
|
67
|
+
const j = r.getVisibleCells();
|
|
67
68
|
return /* @__PURE__ */ e(
|
|
68
69
|
v,
|
|
69
70
|
{
|
|
70
71
|
row: r,
|
|
71
|
-
visibleCells:
|
|
72
|
+
visibleCells: j,
|
|
72
73
|
onClickRow: m,
|
|
73
74
|
onRowClickIndication: b,
|
|
74
75
|
showRowHoverStyle: g
|
|
@@ -78,23 +79,24 @@ const k = ({
|
|
|
78
79
|
}),
|
|
79
80
|
d > 0 && /* @__PURE__ */ e("tr", { style: { height: `${d}px` }, "aria-hidden": "true", children: /* @__PURE__ */ e("td", { colSpan: V }) })
|
|
80
81
|
] });
|
|
81
|
-
}, T = /* @__PURE__ */ S(
|
|
82
|
-
/* @__PURE__ */ e(
|
|
83
|
-
|
|
82
|
+
}, T = /* @__PURE__ */ S(E, { ...z, id: t.id, children: [
|
|
83
|
+
/* @__PURE__ */ e(M, { style: B, children: t.table.getHeaderGroups().map((o) => /* @__PURE__ */ e(
|
|
84
|
+
k,
|
|
84
85
|
{
|
|
85
86
|
headerGroup: o,
|
|
86
|
-
hideTableHeaderDropdown: w
|
|
87
|
+
hideTableHeaderDropdown: w,
|
|
88
|
+
portalContainerRef: R
|
|
87
89
|
},
|
|
88
90
|
o.id
|
|
89
91
|
)) }),
|
|
90
|
-
|
|
92
|
+
_()
|
|
91
93
|
] });
|
|
92
94
|
return l ? /* @__PURE__ */ e(
|
|
93
|
-
|
|
95
|
+
$,
|
|
94
96
|
{
|
|
95
97
|
ref: i,
|
|
96
98
|
overflowY: "auto",
|
|
97
|
-
height:
|
|
99
|
+
height: H,
|
|
98
100
|
position: "relative",
|
|
99
101
|
tabIndex: -1,
|
|
100
102
|
outline: "none",
|
|
@@ -103,7 +105,7 @@ const k = ({
|
|
|
103
105
|
children: T
|
|
104
106
|
}
|
|
105
107
|
) : T;
|
|
106
|
-
},
|
|
108
|
+
}, Q = L(q);
|
|
107
109
|
export {
|
|
108
|
-
|
|
110
|
+
Q as TableContent
|
|
109
111
|
};
|
|
@@ -12,7 +12,9 @@ type TableHeaderDropdownProps<TData extends TableData> = {
|
|
|
12
12
|
columnVisibility: VisibilityState;
|
|
13
13
|
localeString: Locales;
|
|
14
14
|
};
|
|
15
|
-
declare const TableHeaderDropdownComponent: <TData extends TableData>({ header, breakingContentState, onBreakingContentChange, setBreakingContentState, headerGroup, sorting, setSorting, localeString, }: TableHeaderDropdownProps<TData>
|
|
15
|
+
declare const TableHeaderDropdownComponent: <TData extends TableData>({ header, breakingContentState, onBreakingContentChange, setBreakingContentState, headerGroup, sorting, setSorting, localeString, portalContainerRef, }: TableHeaderDropdownProps<TData> & {
|
|
16
|
+
portalContainerRef?: React.RefObject<HTMLElement | null>;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export declare const TableHeaderDropdown: typeof TableHeaderDropdownComponent;
|
|
17
19
|
export {};
|
|
18
20
|
//# sourceMappingURL=table-header-dropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-header-dropdown.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-dropdown.tsx"],"names":[],"mappings":"AAWA,OAAO,EAGN,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnD,KAAK,wBAAwB,CAAC,KAAK,SAAS,SAAS,IAAI;IACxD,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IACzC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAClF,uBAAuB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC;IACxF,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,gBAAgB,EAAE,eAAe,CAAC;IAClC,YAAY,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,4BAA4B,GAAI,KAAK,SAAS,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"table-header-dropdown.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-dropdown.tsx"],"names":[],"mappings":"AAWA,OAAO,EAGN,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnD,KAAK,wBAAwB,CAAC,KAAK,SAAS,SAAS,IAAI;IACxD,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IACzC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAClF,uBAAuB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC;IACxF,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1C,gBAAgB,EAAE,eAAe,CAAC;IAClC,YAAY,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,4BAA4B,GAAI,KAAK,SAAS,SAAS,EAAE,yJAU5D,wBAAwB,CAAC,KAAK,CAAC,GAAG;IAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAAE,4CA0IhG,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAyC,OAAO,4BAA4B,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as d, Fragment as a, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { Portal as
|
|
3
|
-
import { flexRender as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { useTableContext as
|
|
2
|
+
import { Portal as j } from "@chakra-ui/react";
|
|
3
|
+
import { flexRender as A } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
+
import { memo as L, useCallback as D, useMemo as p } from "react";
|
|
5
|
+
import { useTableContext as R } from "./table-context.js";
|
|
6
6
|
import { translations as U } from "./translations.js";
|
|
7
7
|
import { Icon as S } from "../icon/icon.js";
|
|
8
8
|
import { Icons as l } from "../icon/types.js";
|
|
@@ -11,10 +11,10 @@ import { Text as r } from "../text/text.js";
|
|
|
11
11
|
import { MenuDivider as k } from "../menu/menu-divider.js";
|
|
12
12
|
import { Switch as X } from "../switch/switch.js";
|
|
13
13
|
import { Menu as v } from "../menu/menu.js";
|
|
14
|
-
import { MenuBoxButton as
|
|
15
|
-
import { MenuList as
|
|
16
|
-
import { ThemeIconSizeVariable as F, ThemeColorVariable as w, ThemeSpaceVariable as
|
|
17
|
-
const
|
|
14
|
+
import { MenuBoxButton as $ } from "../menu/menu-box-button.js";
|
|
15
|
+
import { MenuList as q } from "../menu/menu-list.js";
|
|
16
|
+
import { ThemeIconSizeVariable as F, ThemeColorVariable as w, ThemeSpaceVariable as J, ThemeFontSizeVariable as z } from "../../theme/theme-types.js";
|
|
17
|
+
const K = ({
|
|
18
18
|
header: o,
|
|
19
19
|
breakingContentState: m,
|
|
20
20
|
onBreakingContentChange: h,
|
|
@@ -22,9 +22,10 @@ const J = ({
|
|
|
22
22
|
headerGroup: g,
|
|
23
23
|
sorting: u,
|
|
24
24
|
setSorting: f,
|
|
25
|
-
localeString: V
|
|
25
|
+
localeString: V,
|
|
26
|
+
portalContainerRef: y
|
|
26
27
|
}) => {
|
|
27
|
-
const e = U[V],
|
|
28
|
+
const e = U[V], H = R(), { getTableFilterMethods: s } = H, T = D(
|
|
28
29
|
(i) => {
|
|
29
30
|
const c = {
|
|
30
31
|
...m,
|
|
@@ -36,18 +37,18 @@ const J = ({
|
|
|
36
37
|
), b = D(
|
|
37
38
|
(i) => {
|
|
38
39
|
const c = i.getIndex();
|
|
39
|
-
g.forEach((
|
|
40
|
-
|
|
41
|
-
const { column: M } =
|
|
40
|
+
g.forEach((E) => {
|
|
41
|
+
E.headers.forEach((O, I) => {
|
|
42
|
+
const { column: M } = O;
|
|
42
43
|
i.getIsPinned() ? I >= c && M.pin(!1) : I <= c && M.pin("left");
|
|
43
44
|
});
|
|
44
45
|
});
|
|
45
46
|
},
|
|
46
47
|
[g]
|
|
47
|
-
),
|
|
48
|
+
), P = p(() => /* @__PURE__ */ d(a, { children: [
|
|
48
49
|
u.find((i) => i.id === o.column.id) && (u.find((i) => i.desc) ? /* @__PURE__ */ n(S, { icon: l.SortDesc, size: F.XSmall }) : /* @__PURE__ */ n(S, { icon: l.SortAsc, size: F.XSmall })),
|
|
49
50
|
o.column.columnDef.header
|
|
50
|
-
] }), [o.column.columnDef.header, o.column.id, u]), x = p(() => s()?.canFilterOnColumn(o.column.id) ?? !1, [o.column.id, s]),
|
|
51
|
+
] }), [o.column.columnDef.header, o.column.id, u]), x = p(() => s()?.canFilterOnColumn(o.column.id) ?? !1, [o.column.id, s]), B = p(() => /* @__PURE__ */ d(a, { children: [
|
|
51
52
|
/* @__PURE__ */ n(
|
|
52
53
|
t,
|
|
53
54
|
{
|
|
@@ -101,7 +102,7 @@ const J = ({
|
|
|
101
102
|
]);
|
|
102
103
|
return /* @__PURE__ */ n(v, { isLazy: !0, children: ({ isOpen: i }) => /* @__PURE__ */ d(a, { children: [
|
|
103
104
|
/* @__PURE__ */ n(
|
|
104
|
-
|
|
105
|
+
$,
|
|
105
106
|
{
|
|
106
107
|
color: w.OnBackgroundSubdued,
|
|
107
108
|
textTransform: "none",
|
|
@@ -109,15 +110,15 @@ const J = ({
|
|
|
109
110
|
h: "40px",
|
|
110
111
|
display: "flex",
|
|
111
112
|
alignItems: "center",
|
|
112
|
-
padding: `0px 0px 0px ${
|
|
113
|
+
padding: `0px 0px 0px ${J.Small}`,
|
|
113
114
|
backgroundColor: i ? w.BackgroundDisabled : "unset",
|
|
114
115
|
w: "100%",
|
|
115
|
-
children:
|
|
116
|
+
children: A(P, o.getContext())
|
|
116
117
|
}
|
|
117
118
|
),
|
|
118
|
-
/* @__PURE__ */ n(
|
|
119
|
+
/* @__PURE__ */ n(j, { containerRef: y, children: /* @__PURE__ */ n(q, { fontSize: z.Medium, children: B }) })
|
|
119
120
|
] }) });
|
|
120
|
-
},
|
|
121
|
+
}, un = L(K);
|
|
121
122
|
export {
|
|
122
|
-
|
|
123
|
+
un as TableHeaderDropdown
|
|
123
124
|
};
|
|
@@ -4,7 +4,9 @@ type TableHeaderRowProps<TData extends TableData> = {
|
|
|
4
4
|
headerGroup: HeaderGroup<TableRow<TData>>;
|
|
5
5
|
hideTableHeaderDropdown: boolean | undefined;
|
|
6
6
|
};
|
|
7
|
-
declare const TableHeaderRowComponent: <TData extends TableData>({ headerGroup, hideTableHeaderDropdown, }: TableHeaderRowProps<TData>
|
|
7
|
+
declare const TableHeaderRowComponent: <TData extends TableData>({ headerGroup, hideTableHeaderDropdown, portalContainerRef, }: TableHeaderRowProps<TData> & {
|
|
8
|
+
portalContainerRef?: React.RefObject<HTMLElement | null>;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export declare const TableHeaderRow: typeof TableHeaderRowComponent;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=table-header-row.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-header-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-row.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAYlF,OAAO,KAAK,EAAmB,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEpE,KAAK,mBAAmB,CAAC,KAAK,SAAS,SAAS,IAAI;IACnD,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,QAAA,MAAM,uBAAuB,GAAI,KAAK,SAAS,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"table-header-row.d.ts","sourceRoot":"","sources":["../../../lib/components/table/table-header-row.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAYlF,OAAO,KAAK,EAAmB,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEpE,KAAK,mBAAmB,CAAC,KAAK,SAAS,SAAS,IAAI;IACnD,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,QAAA,MAAM,uBAAuB,GAAI,KAAK,SAAS,SAAS,EAAE,+DAIvD,mBAAmB,CAAC,KAAK,CAAC,GAAG;IAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAAE,4CA2F3F,CAAC;AAuJF,eAAO,MAAM,cAAc,EAAoC,OAAO,uBAAuB,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { Tr as B, Th as
|
|
1
|
+
import { jsx as e, Fragment as u, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { Tr as B, Th as b, useMediaQuery as v, Portal as M } from "@chakra-ui/react";
|
|
3
3
|
import { flexRender as T } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
4
|
-
import { memo as y, useCallback as
|
|
5
|
-
import { useTableContext as
|
|
4
|
+
import { memo as y, useCallback as C, useMemo as A } from "react";
|
|
5
|
+
import { useTableContext as p } from "./table-context.js";
|
|
6
6
|
import { TableHeaderDropdown as V } from "./table-header-dropdown.js";
|
|
7
|
-
import { translations as
|
|
7
|
+
import { translations as x } from "./translations.js";
|
|
8
8
|
import { Box as g } from "../box/box.js";
|
|
9
|
-
import { Flex as
|
|
9
|
+
import { Flex as w } from "../flex/flex.js";
|
|
10
10
|
import { Divider as z } from "../divider/divider.js";
|
|
11
11
|
import { Menu as D } from "../menu/menu.js";
|
|
12
12
|
import { MenuButton as F } from "../menu/menu-button.js";
|
|
13
|
-
import { Icons as
|
|
13
|
+
import { Icons as R } from "../icon/types.js";
|
|
14
14
|
import { MenuList as H } from "../menu/menu-list.js";
|
|
15
15
|
import { Checkbox as P } from "../checkbox/checkbox.js";
|
|
16
16
|
import { MenuItem as L } from "../menu/menu-item.js";
|
|
@@ -19,21 +19,22 @@ import { Button as O } from "../button/button.js";
|
|
|
19
19
|
import { ThemeColorVariable as d, ThemeSpaceVariable as m, ThemeFontSizeVariable as j, ThemeFontVariable as $ } from "../../theme/theme-types.js";
|
|
20
20
|
const W = ({
|
|
21
21
|
headerGroup: o,
|
|
22
|
-
hideTableHeaderDropdown:
|
|
22
|
+
hideTableHeaderDropdown: r,
|
|
23
|
+
portalContainerRef: a
|
|
23
24
|
}) => {
|
|
24
|
-
const n =
|
|
25
|
-
const
|
|
25
|
+
const n = p(), s = !!n.getRowActions, i = C((t) => {
|
|
26
|
+
const l = t.getIsPinned();
|
|
26
27
|
return {
|
|
27
|
-
position:
|
|
28
|
-
left:
|
|
29
|
-
backgroundColor:
|
|
30
|
-
zIndex:
|
|
31
|
-
width:
|
|
32
|
-
maxWidth:
|
|
28
|
+
position: l ? "sticky" : "relative",
|
|
29
|
+
left: l ? `${t.getStart("left")}px` : void 0,
|
|
30
|
+
backgroundColor: l ? d.Background : void 0,
|
|
31
|
+
zIndex: l ? 1 : 0,
|
|
32
|
+
width: t.getSize(),
|
|
33
|
+
maxWidth: t.getSize()
|
|
33
34
|
};
|
|
34
|
-
}, []),
|
|
35
|
-
return /* @__PURE__ */ e(
|
|
36
|
-
|
|
35
|
+
}, []), c = (n.selectedRowIds?.length ?? 0) > 0 && (n.selectionActions?.length ?? 0) > 0;
|
|
36
|
+
return /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(B, { children: c ? /* @__PURE__ */ e(
|
|
37
|
+
b,
|
|
37
38
|
{
|
|
38
39
|
colSpan: o.headers.length,
|
|
39
40
|
sx: {
|
|
@@ -48,27 +49,27 @@ const W = ({
|
|
|
48
49
|
zIndex: 1,
|
|
49
50
|
style: {
|
|
50
51
|
borderBottom: `1px solid ${d.OnBackgroundBorder}`,
|
|
51
|
-
paddingLeft:
|
|
52
|
+
paddingLeft: s ? "24px" : void 0
|
|
52
53
|
},
|
|
53
|
-
children: /* @__PURE__ */ e(
|
|
54
|
+
children: /* @__PURE__ */ e(I, { showSelectAll: !0, children: /* @__PURE__ */ e(Q, {}) })
|
|
54
55
|
}
|
|
55
|
-
) : /* @__PURE__ */ e(
|
|
56
|
-
const { column:
|
|
56
|
+
) : /* @__PURE__ */ e(u, { children: o.headers.map((t) => {
|
|
57
|
+
const { column: l } = t, h = l.getIndex() === 0;
|
|
57
58
|
return /* @__PURE__ */ e(
|
|
58
|
-
|
|
59
|
+
b,
|
|
59
60
|
{
|
|
60
61
|
className: "tableHeaderCell",
|
|
61
|
-
isNumeric:
|
|
62
|
-
zIndex:
|
|
62
|
+
isNumeric: l.columnDef.meta?.isNumeric,
|
|
63
|
+
zIndex: l.getIsPinned() ? 2 : 1,
|
|
63
64
|
style: {
|
|
64
|
-
...
|
|
65
|
+
...i(l),
|
|
65
66
|
borderBottom: `1px solid ${d.OnBackgroundBorder}`,
|
|
66
|
-
paddingLeft:
|
|
67
|
+
paddingLeft: h && s ? "24px" : void 0
|
|
67
68
|
},
|
|
68
|
-
children: /* @__PURE__ */ e(
|
|
69
|
+
children: /* @__PURE__ */ e(I, { showSelectAll: n.canSelectRows && h, children: /* @__PURE__ */ e(u, { children: r ? /* @__PURE__ */ e(g, { paddingLeft: m.Small, children: T(t.column.columnDef.header, t.getContext()) }) : /* @__PURE__ */ e(
|
|
69
70
|
V,
|
|
70
71
|
{
|
|
71
|
-
header:
|
|
72
|
+
header: t,
|
|
72
73
|
breakingContentState: n.breakingContentState,
|
|
73
74
|
columnVisibility: n.columnVisibility,
|
|
74
75
|
headerGroup: n.table.getHeaderGroups(),
|
|
@@ -76,42 +77,43 @@ const W = ({
|
|
|
76
77
|
setBreakingContentState: n.setBreakingContentState,
|
|
77
78
|
setSorting: n.setSorting,
|
|
78
79
|
sorting: n.sorting,
|
|
79
|
-
onBreakingContentChange: n.onBreakingContentChange
|
|
80
|
+
onBreakingContentChange: n.onBreakingContentChange,
|
|
81
|
+
portalContainerRef: a
|
|
80
82
|
}
|
|
81
83
|
) }) })
|
|
82
84
|
},
|
|
83
|
-
|
|
85
|
+
t.id
|
|
84
86
|
);
|
|
85
87
|
}) }) }, o.id) });
|
|
86
|
-
},
|
|
88
|
+
}, I = ({ showSelectAll: o, children: r }) => o ? /* @__PURE__ */ f(w, { w: "100%", align: "center", children: [
|
|
87
89
|
/* @__PURE__ */ e(g, { justifyContent: "center", alignItems: "center", children: /* @__PURE__ */ e(E, {}) }),
|
|
88
|
-
|
|
89
|
-
] }) : /* @__PURE__ */ e(
|
|
90
|
-
const o =
|
|
90
|
+
r
|
|
91
|
+
] }) : /* @__PURE__ */ e(u, { children: r }), E = () => {
|
|
92
|
+
const o = p(), r = C(
|
|
91
93
|
(s) => {
|
|
92
|
-
const i = s.target.checked,
|
|
93
|
-
i ? o.setSelectedRowIds((t) => [.../* @__PURE__ */ new Set([...t, ...
|
|
94
|
+
const i = s.target.checked, c = o.getSelectableRowIds();
|
|
95
|
+
i ? o.setSelectedRowIds((t) => [.../* @__PURE__ */ new Set([...t, ...c])]) : o.setSelectedRowIds((t) => t.filter((l) => !c.includes(l)));
|
|
94
96
|
},
|
|
95
97
|
[o]
|
|
96
|
-
), { allIsSelected:
|
|
97
|
-
const i = o.table.getRowModel().flatRows,
|
|
98
|
+
), { allIsSelected: a, shouldShowIndeterminateState: n } = A(() => {
|
|
99
|
+
const i = o.table.getRowModel().flatRows, c = new Set(o.selectedRowIds), t = o.getSelectableRowIds(), l = t.length > 0 && t.every((S) => c.has(S)), h = i.some((S) => c.has(S.id));
|
|
98
100
|
return {
|
|
99
|
-
allIsSelected:
|
|
100
|
-
shouldShowIndeterminateState:
|
|
101
|
+
allIsSelected: l,
|
|
102
|
+
shouldShowIndeterminateState: h && !l
|
|
101
103
|
};
|
|
102
104
|
}, [o]);
|
|
103
105
|
return /* @__PURE__ */ e(
|
|
104
106
|
P,
|
|
105
107
|
{
|
|
106
|
-
isChecked:
|
|
107
|
-
isIndeterminate:
|
|
108
|
-
onChange:
|
|
108
|
+
isChecked: a,
|
|
109
|
+
isIndeterminate: n,
|
|
110
|
+
onChange: r
|
|
109
111
|
}
|
|
110
112
|
);
|
|
111
113
|
}, Q = () => {
|
|
112
|
-
const { localeString: o, selectedRowIds:
|
|
113
|
-
return /* @__PURE__ */
|
|
114
|
-
|
|
114
|
+
const { localeString: o, selectedRowIds: r = [], selectionActions: a = [] } = p(), n = x[o], [s] = v("(min-width: 48em)"), i = a.length > 3 || !s, c = r.length === 1 ? n.selectedSingular.replace("{count}", "1") : n.selected.replace("{count}", r.length.toString());
|
|
115
|
+
return /* @__PURE__ */ f(
|
|
116
|
+
w,
|
|
115
117
|
{
|
|
116
118
|
gap: m.Medium,
|
|
117
119
|
align: "center",
|
|
@@ -127,30 +129,30 @@ const W = ({
|
|
|
127
129
|
fontSize: j.Medium,
|
|
128
130
|
whiteSpace: "nowrap",
|
|
129
131
|
style: { fontVariantNumeric: "normal" },
|
|
130
|
-
children:
|
|
132
|
+
children: c
|
|
131
133
|
}
|
|
132
134
|
),
|
|
133
135
|
/* @__PURE__ */ e(g, { children: /* @__PURE__ */ e(z, { orientation: "vertical", height: "20px" }) }),
|
|
134
|
-
/* @__PURE__ */ e(
|
|
135
|
-
/* @__PURE__ */ e(F, { variant: "ghost", rightIcon:
|
|
136
|
-
/* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(H, { children:
|
|
137
|
-
] }) :
|
|
136
|
+
/* @__PURE__ */ e(w, { gap: m.Small, align: "center", children: i ? /* @__PURE__ */ f(D, { children: [
|
|
137
|
+
/* @__PURE__ */ e(F, { variant: "ghost", rightIcon: R.TreeViewCollapse, children: n.action }),
|
|
138
|
+
/* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(H, { children: a.map((t) => /* @__PURE__ */ e(k, { isMenuItem: !0, action: t }, t.name)) }) })
|
|
139
|
+
] }) : a.map((t) => /* @__PURE__ */ e(k, { isMenuItem: !1, action: t }, t.name)) })
|
|
138
140
|
]
|
|
139
141
|
}
|
|
140
142
|
);
|
|
141
|
-
},
|
|
142
|
-
const { selectedRowIds:
|
|
143
|
-
|
|
144
|
-
}, [
|
|
145
|
-
return o ? /* @__PURE__ */ e(L, { onClick: i, children:
|
|
143
|
+
}, k = ({ isMenuItem: o, action: r }) => {
|
|
144
|
+
const { selectedRowIds: a, localeString: n } = p(), s = x[n], i = C(() => {
|
|
145
|
+
r.onClick(a || []);
|
|
146
|
+
}, [r, a]);
|
|
147
|
+
return o ? /* @__PURE__ */ e(L, { onClick: i, children: r.variant === "delete" ? /* @__PURE__ */ e(g, { as: "span", color: d.Error, children: r.name }) : r.name }) : r.variant === "delete" ? /* @__PURE__ */ e(
|
|
146
148
|
N,
|
|
147
149
|
{
|
|
148
150
|
onClick: i,
|
|
149
|
-
icon:
|
|
151
|
+
icon: R.Delete,
|
|
150
152
|
"aria-label": s.deleteSelectedRows,
|
|
151
153
|
variant: "ghost"
|
|
152
154
|
}
|
|
153
|
-
) : /* @__PURE__ */ e(O, { onClick: i, variant: "ghost", children:
|
|
155
|
+
) : /* @__PURE__ */ e(O, { onClick: i, variant: "ghost", children: r.name });
|
|
154
156
|
}, de = y(W);
|
|
155
157
|
export {
|
|
156
158
|
de as TableHeaderRow
|
|
@@ -23,6 +23,14 @@ export declare const comboboxConfig: {
|
|
|
23
23
|
background: ThemeColorVariable;
|
|
24
24
|
color: ThemeColorVariable;
|
|
25
25
|
borderColor: ThemeColorVariable;
|
|
26
|
+
'&[aria-disabled="true"]': {
|
|
27
|
+
backgroundColor: ThemeColorVariable;
|
|
28
|
+
color: ThemeColorVariable;
|
|
29
|
+
};
|
|
30
|
+
'&[aria-readonly="true"]': {
|
|
31
|
+
backgroundColor: ThemeColorVariable;
|
|
32
|
+
color: ThemeColorVariable;
|
|
33
|
+
};
|
|
26
34
|
"@media(hover: hover)": {
|
|
27
35
|
'&:hover:not(:focus-within):not([aria-disabled="true"]):not([aria-readonly="true"])': {
|
|
28
36
|
borderColor: ThemeColorVariable;
|
|
@@ -32,6 +40,17 @@ export declare const comboboxConfig: {
|
|
|
32
40
|
ghost: {
|
|
33
41
|
background: string;
|
|
34
42
|
color: ThemeColorVariable;
|
|
43
|
+
'&[aria-disabled="true"]': {
|
|
44
|
+
backgroundColor: string;
|
|
45
|
+
color: ThemeColorVariable;
|
|
46
|
+
};
|
|
47
|
+
'&[aria-readonly="true"]': {
|
|
48
|
+
backgroundColor: string;
|
|
49
|
+
color: ThemeColorVariable;
|
|
50
|
+
".combobox-dropdown-icon": {
|
|
51
|
+
opacity: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
35
54
|
'&:not([aria-disabled="true"]):not([aria-readonly="true"]) .combobox-dropdown-icon': {
|
|
36
55
|
opacity: number;
|
|
37
56
|
};
|
|
@@ -41,7 +60,7 @@ export declare const comboboxConfig: {
|
|
|
41
60
|
};
|
|
42
61
|
};
|
|
43
62
|
"@media(hover: hover)": {
|
|
44
|
-
|
|
63
|
+
'&:hover:not(:focus-within):not([aria-disabled="true"])': {
|
|
45
64
|
backgroundColor: ThemeColorVariable;
|
|
46
65
|
".combobox-dropdown-icon": {
|
|
47
66
|
opacity: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/combobox-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"combobox-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/combobox-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAiG5E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIzB,CAAC"}
|
|
@@ -6,12 +6,10 @@ const a = {
|
|
|
6
6
|
border: `${e.XSmall} transparent`,
|
|
7
7
|
'&[aria-disabled="true"]': {
|
|
8
8
|
borderColor: "transparent",
|
|
9
|
-
backgroundColor: o.SurfaceDisabled,
|
|
10
9
|
cursor: "not-allowed"
|
|
11
10
|
},
|
|
12
11
|
'&[aria-readonly="true"]': {
|
|
13
|
-
borderColor: "transparent"
|
|
14
|
-
backgroundColor: o.SurfaceDisabled
|
|
12
|
+
borderColor: "transparent"
|
|
15
13
|
},
|
|
16
14
|
'&[aria-invalid="true"]': {
|
|
17
15
|
borderColor: o.Error,
|
|
@@ -30,6 +28,14 @@ const a = {
|
|
|
30
28
|
background: o.Surface,
|
|
31
29
|
color: o.OnSurface,
|
|
32
30
|
borderColor: o.OnSurfaceBorder,
|
|
31
|
+
'&[aria-disabled="true"]': {
|
|
32
|
+
backgroundColor: o.SurfaceDisabled,
|
|
33
|
+
color: o.OnSurfaceSubdued
|
|
34
|
+
},
|
|
35
|
+
'&[aria-readonly="true"]': {
|
|
36
|
+
backgroundColor: o.SurfaceDisabled,
|
|
37
|
+
color: o.OnSurface
|
|
38
|
+
},
|
|
33
39
|
"@media(hover: hover)": {
|
|
34
40
|
'&:hover:not(:focus-within):not([aria-disabled="true"]):not([aria-readonly="true"])': {
|
|
35
41
|
borderColor: o.OnSurface
|
|
@@ -39,6 +45,17 @@ const a = {
|
|
|
39
45
|
ghost: {
|
|
40
46
|
background: "none",
|
|
41
47
|
color: o.OnSurface,
|
|
48
|
+
'&[aria-disabled="true"]': {
|
|
49
|
+
backgroundColor: "transparent",
|
|
50
|
+
color: o.OnSurfaceSubdued
|
|
51
|
+
},
|
|
52
|
+
'&[aria-readonly="true"]': {
|
|
53
|
+
backgroundColor: "transparent",
|
|
54
|
+
color: o.OnSurface,
|
|
55
|
+
".combobox-dropdown-icon": {
|
|
56
|
+
opacity: 1
|
|
57
|
+
}
|
|
58
|
+
},
|
|
42
59
|
'&:not([aria-disabled="true"]):not([aria-readonly="true"]) .combobox-dropdown-icon': {
|
|
43
60
|
opacity: 0
|
|
44
61
|
},
|
|
@@ -48,7 +65,7 @@ const a = {
|
|
|
48
65
|
}
|
|
49
66
|
},
|
|
50
67
|
"@media(hover: hover)": {
|
|
51
|
-
|
|
68
|
+
'&:hover:not(:focus-within):not([aria-disabled="true"])': {
|
|
52
69
|
backgroundColor: o.SurfaceDisabled,
|
|
53
70
|
".combobox-dropdown-icon": {
|
|
54
71
|
opacity: 1
|
|
@@ -121,6 +121,21 @@ export declare const inputConfig: {
|
|
|
121
121
|
borderColor: string;
|
|
122
122
|
background: string;
|
|
123
123
|
color: ThemeColorToken;
|
|
124
|
+
_hover: undefined;
|
|
125
|
+
_disabled: {
|
|
126
|
+
cursor: string;
|
|
127
|
+
background: string;
|
|
128
|
+
color: ThemeColorToken;
|
|
129
|
+
borderColor: string;
|
|
130
|
+
opacity: number;
|
|
131
|
+
};
|
|
132
|
+
_readOnly: {
|
|
133
|
+
color: ThemeColorToken;
|
|
134
|
+
background: string;
|
|
135
|
+
userSelect: string;
|
|
136
|
+
opacity: number;
|
|
137
|
+
borderColor: string;
|
|
138
|
+
};
|
|
124
139
|
_focus: {
|
|
125
140
|
border: ThemeBorderToken;
|
|
126
141
|
borderColor: ThemeColorToken;
|
|
@@ -128,10 +143,7 @@ export declare const inputConfig: {
|
|
|
128
143
|
backgroundColor: ThemeColorToken;
|
|
129
144
|
};
|
|
130
145
|
"@media(hover: hover)": {
|
|
131
|
-
"&:hover": {
|
|
132
|
-
borderColor: ThemeColorToken;
|
|
133
|
-
};
|
|
134
|
-
"&:hover:not(:focus)": {
|
|
146
|
+
"&:hover:not(:focus):not(:disabled)": {
|
|
135
147
|
backgroundColor: ThemeColorToken;
|
|
136
148
|
borderColor: string;
|
|
137
149
|
};
|
|
@@ -146,29 +158,10 @@ export declare const inputConfig: {
|
|
|
146
158
|
paddingInlineStart: ThemeSpaceToken;
|
|
147
159
|
paddingInlineEnd: ThemeSpaceToken;
|
|
148
160
|
width: string;
|
|
149
|
-
_disabled: {
|
|
150
|
-
cursor: string;
|
|
151
|
-
background: ThemeColorToken;
|
|
152
|
-
color: ThemeColorToken;
|
|
153
|
-
border: number;
|
|
154
|
-
opacity: number;
|
|
155
|
-
};
|
|
156
|
-
_readOnly: {
|
|
157
|
-
color: ThemeColorToken;
|
|
158
|
-
background: ThemeColorToken;
|
|
159
|
-
userSelect: string;
|
|
160
|
-
opacity: number;
|
|
161
|
-
border: number;
|
|
162
|
-
};
|
|
163
161
|
_placeholder: {
|
|
164
162
|
color: ThemeColorToken;
|
|
165
163
|
opacity: number;
|
|
166
164
|
};
|
|
167
|
-
_hover: {
|
|
168
|
-
borderColor: ThemeColorToken;
|
|
169
|
-
_disabled: undefined;
|
|
170
|
-
_readOnly: undefined;
|
|
171
|
-
};
|
|
172
165
|
};
|
|
173
166
|
addon: {
|
|
174
167
|
color: ThemeColorToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/input-theme.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"input-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/input-theme.ts"],"names":[],"mappings":"AAIA,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,MAAM,iBAAiB,CAAC;AA8JzB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMtB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createMultiStyleConfigHelpers as
|
|
2
|
-
import { isTouchScreenDevice as
|
|
1
|
+
import { createMultiStyleConfigHelpers as s, defineStyle as l } from "@chakra-ui/react";
|
|
2
|
+
import { isTouchScreenDevice as b } from "../../theme-helper.js";
|
|
3
3
|
import { ThemeColorVariable as n } from "../../theme-types.js";
|
|
4
|
-
import { ThemeColorToken as o, ThemeSpaceToken as r, ThemeRadiusToken as t, ThemeBorderToken as
|
|
5
|
-
import { inputAnatomy as
|
|
6
|
-
const { definePartsStyle:
|
|
7
|
-
fontFamily:
|
|
4
|
+
import { ThemeColorToken as o, ThemeSpaceToken as r, ThemeRadiusToken as t, ThemeBorderToken as a, ThemeFontToken as f, ThemeFontSizeToken as i } from "../theme-tokens.js";
|
|
5
|
+
import { inputAnatomy as m } from "../../../packages/casper-ui-library/node_modules/@chakra-ui/anatomy/dist/esm/components.js";
|
|
6
|
+
const { definePartsStyle: d, defineMultiStyleConfig: p } = s(m.keys), c = {
|
|
7
|
+
fontFamily: f.Body,
|
|
8
8
|
color: o.OnSurface,
|
|
9
|
-
border:
|
|
9
|
+
border: a.XSmall,
|
|
10
10
|
borderColor: o.OnSurfaceBorder,
|
|
11
11
|
background: o.Surface,
|
|
12
12
|
borderRadius: t.Small,
|
|
@@ -40,7 +40,7 @@ const { definePartsStyle: a, defineMultiStyleConfig: p } = f(b.keys), c = {
|
|
|
40
40
|
boxShadow: `0 0 0 4px ${n.InfoContainer}`
|
|
41
41
|
},
|
|
42
42
|
_hover: {
|
|
43
|
-
borderColor:
|
|
43
|
+
borderColor: b() ? o.OnSurfaceBorder : o.OnSurface,
|
|
44
44
|
_disabled: void 0,
|
|
45
45
|
_readOnly: void 0
|
|
46
46
|
}
|
|
@@ -79,65 +79,77 @@ const { definePartsStyle: a, defineMultiStyleConfig: p } = f(b.keys), c = {
|
|
|
79
79
|
px: r.Small
|
|
80
80
|
})
|
|
81
81
|
}, g = {
|
|
82
|
-
lg:
|
|
82
|
+
lg: d({
|
|
83
83
|
field: e.lg,
|
|
84
84
|
addon: e.lg,
|
|
85
85
|
element: e.lg
|
|
86
86
|
}),
|
|
87
|
-
md:
|
|
87
|
+
md: d({
|
|
88
88
|
field: e.md,
|
|
89
89
|
addon: e.md,
|
|
90
90
|
element: e.md
|
|
91
91
|
}),
|
|
92
|
-
sm:
|
|
92
|
+
sm: d({
|
|
93
93
|
field: e.sm,
|
|
94
94
|
addon: e.sm,
|
|
95
95
|
element: e.sm
|
|
96
96
|
})
|
|
97
|
-
},
|
|
97
|
+
}, C = d({
|
|
98
98
|
field: {
|
|
99
99
|
...c,
|
|
100
|
-
border:
|
|
100
|
+
border: a.XSmall,
|
|
101
101
|
borderColor: "transparent",
|
|
102
102
|
background: "none",
|
|
103
103
|
color: o.OnSurface,
|
|
104
|
+
_hover: void 0,
|
|
105
|
+
_disabled: {
|
|
106
|
+
cursor: "not-allowed",
|
|
107
|
+
background: "none",
|
|
108
|
+
color: o.OnSurfaceSubdued,
|
|
109
|
+
borderColor: "transparent",
|
|
110
|
+
opacity: 1
|
|
111
|
+
},
|
|
112
|
+
_readOnly: {
|
|
113
|
+
color: o.OnSurface,
|
|
114
|
+
background: "none",
|
|
115
|
+
userSelect: "text",
|
|
116
|
+
opacity: 1,
|
|
117
|
+
borderColor: "transparent"
|
|
118
|
+
},
|
|
104
119
|
_focus: {
|
|
105
|
-
border:
|
|
120
|
+
border: a.XSmall,
|
|
106
121
|
borderColor: o.Info,
|
|
107
122
|
boxShadow: `0 0 0 4px ${n.InfoContainer}`,
|
|
108
123
|
backgroundColor: o.Surface
|
|
109
124
|
},
|
|
110
125
|
"@media(hover: hover)": {
|
|
111
|
-
"&:hover": {
|
|
112
|
-
borderColor: o.Info
|
|
113
|
-
},
|
|
114
|
-
"&:hover:not(:focus)": {
|
|
126
|
+
"&:hover:not(:focus):not(:disabled)": {
|
|
115
127
|
backgroundColor: o.SurfaceDisabled,
|
|
116
128
|
borderColor: "transparent"
|
|
117
129
|
}
|
|
118
130
|
},
|
|
119
131
|
_invalid: {
|
|
120
|
-
border:
|
|
132
|
+
border: a.XSmall,
|
|
121
133
|
borderColor: o.Error,
|
|
122
134
|
boxShadow: `0 0 0 4px ${n.ErrorContainer}`
|
|
123
135
|
}
|
|
124
136
|
},
|
|
125
137
|
addon: u,
|
|
126
138
|
element: S
|
|
127
|
-
}),
|
|
139
|
+
}), h = {
|
|
128
140
|
outline: {
|
|
129
141
|
field: c,
|
|
130
142
|
addon: u,
|
|
131
143
|
element: S
|
|
132
144
|
},
|
|
133
|
-
ghost:
|
|
134
|
-
},
|
|
145
|
+
ghost: C
|
|
146
|
+
}, T = p({
|
|
135
147
|
sizes: g,
|
|
136
|
-
variants:
|
|
148
|
+
variants: h,
|
|
137
149
|
defaultProps: {
|
|
138
150
|
variant: "outline"
|
|
139
151
|
}
|
|
140
152
|
});
|
|
141
153
|
export {
|
|
142
|
-
|
|
154
|
+
T as inputConfig
|
|
143
155
|
};
|
|
@@ -98,6 +98,21 @@ export declare const selectConfig: {
|
|
|
98
98
|
borderColor?: string | undefined;
|
|
99
99
|
background?: string | undefined;
|
|
100
100
|
color?: ThemeColorToken | undefined;
|
|
101
|
+
_hover?: undefined;
|
|
102
|
+
_disabled?: {
|
|
103
|
+
cursor: string;
|
|
104
|
+
background: string;
|
|
105
|
+
color: ThemeColorToken;
|
|
106
|
+
borderColor: string;
|
|
107
|
+
opacity: number;
|
|
108
|
+
} | undefined;
|
|
109
|
+
_readOnly?: {
|
|
110
|
+
color: ThemeColorToken;
|
|
111
|
+
background: string;
|
|
112
|
+
userSelect: string;
|
|
113
|
+
opacity: number;
|
|
114
|
+
borderColor: string;
|
|
115
|
+
} | undefined;
|
|
101
116
|
_focus?: {
|
|
102
117
|
border: import('../theme-tokens.js').ThemeBorderToken;
|
|
103
118
|
borderColor: ThemeColorToken;
|
|
@@ -105,10 +120,7 @@ export declare const selectConfig: {
|
|
|
105
120
|
backgroundColor: ThemeColorToken;
|
|
106
121
|
} | undefined;
|
|
107
122
|
"@media(hover: hover)"?: {
|
|
108
|
-
"&:hover": {
|
|
109
|
-
borderColor: ThemeColorToken;
|
|
110
|
-
};
|
|
111
|
-
"&:hover:not(:focus)": {
|
|
123
|
+
"&:hover:not(:focus):not(:disabled)": {
|
|
112
124
|
backgroundColor: ThemeColorToken;
|
|
113
125
|
borderColor: string;
|
|
114
126
|
};
|
|
@@ -123,29 +135,10 @@ export declare const selectConfig: {
|
|
|
123
135
|
paddingInlineStart?: import('../theme-tokens.js').ThemeSpaceToken | undefined;
|
|
124
136
|
paddingInlineEnd?: import('../theme-tokens.js').ThemeSpaceToken | undefined;
|
|
125
137
|
width?: string | undefined;
|
|
126
|
-
_disabled?: {
|
|
127
|
-
cursor: string;
|
|
128
|
-
background: ThemeColorToken;
|
|
129
|
-
color: ThemeColorToken;
|
|
130
|
-
border: number;
|
|
131
|
-
opacity: number;
|
|
132
|
-
} | undefined;
|
|
133
|
-
_readOnly?: {
|
|
134
|
-
color: ThemeColorToken;
|
|
135
|
-
background: ThemeColorToken;
|
|
136
|
-
userSelect: string;
|
|
137
|
-
opacity: number;
|
|
138
|
-
border: number;
|
|
139
|
-
} | undefined;
|
|
140
138
|
_placeholder?: {
|
|
141
139
|
color: ThemeColorToken;
|
|
142
140
|
opacity: number;
|
|
143
141
|
} | undefined;
|
|
144
|
-
_hover?: {
|
|
145
|
-
borderColor: ThemeColorToken;
|
|
146
|
-
_disabled: undefined;
|
|
147
|
-
_readOnly: undefined;
|
|
148
|
-
} | undefined;
|
|
149
142
|
};
|
|
150
143
|
icon: {
|
|
151
144
|
fontSize: ThemeFontSizeToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/select-theme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA8CtE,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"select-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/select-theme.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA8CtE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/textarea-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAqB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"textarea-theme.d.ts","sourceRoot":"","sources":["../../../../lib/theme/theme-config/components/textarea-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAqB,MAAM,kBAAkB,CAAC;AA2FtF,eAAO,MAAM,cAAc,EAAE,0BAQ3B,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineStyleConfig as d } from "@chakra-ui/react";
|
|
2
2
|
import { isTouchScreenDevice as n } from "../../theme-helper.js";
|
|
3
|
-
import { ThemeColorVariable as
|
|
4
|
-
import { ThemeColorToken as o, ThemeBorderToken as
|
|
3
|
+
import { ThemeColorVariable as e } from "../../theme-types.js";
|
|
4
|
+
import { ThemeColorToken as o, ThemeBorderToken as r, ThemeSpaceToken as l, ThemeRadiusToken as t, ThemeFontToken as c } from "../theme-tokens.js";
|
|
5
5
|
const a = {
|
|
6
6
|
fontFamily: c.Body,
|
|
7
7
|
color: o.OnSurface,
|
|
8
|
-
border:
|
|
8
|
+
border: r.XSmall,
|
|
9
9
|
borderColor: o.OnSurfaceBorder,
|
|
10
10
|
background: o.Surface,
|
|
11
|
-
borderRadius:
|
|
11
|
+
borderRadius: t.Small,
|
|
12
12
|
paddingX: l.Medium,
|
|
13
13
|
paddingY: "12px",
|
|
14
14
|
width: "100%",
|
|
@@ -32,7 +32,7 @@ const a = {
|
|
|
32
32
|
},
|
|
33
33
|
_invalid: {
|
|
34
34
|
borderColor: o.Error,
|
|
35
|
-
boxShadow: `0 0 0 4px ${
|
|
35
|
+
boxShadow: `0 0 0 4px ${e.ErrorContainer}`
|
|
36
36
|
},
|
|
37
37
|
_hover: {
|
|
38
38
|
borderColor: n() ? o.OnSurfaceBorder : o.OnSurface,
|
|
@@ -41,39 +41,52 @@ const a = {
|
|
|
41
41
|
},
|
|
42
42
|
_focus: {
|
|
43
43
|
borderColor: o.Info,
|
|
44
|
-
boxShadow: `0 0 0 4px ${
|
|
44
|
+
boxShadow: `0 0 0 4px ${e.InfoContainer}`
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, i = {
|
|
47
47
|
...a,
|
|
48
|
-
border:
|
|
48
|
+
border: r.XSmall,
|
|
49
|
+
borderColor: "transparent",
|
|
50
|
+
_hover: void 0,
|
|
51
|
+
_disabled: {
|
|
52
|
+
cursor: "not-allowed",
|
|
53
|
+
background: "none",
|
|
54
|
+
color: o.OnSurfaceSubdued,
|
|
55
|
+
borderColor: "transparent",
|
|
56
|
+
opacity: 1
|
|
57
|
+
},
|
|
58
|
+
_readOnly: {
|
|
59
|
+
color: o.OnSurface,
|
|
60
|
+
background: "none",
|
|
61
|
+
userSelect: "text",
|
|
62
|
+
opacity: 1,
|
|
63
|
+
borderColor: "transparent"
|
|
64
|
+
},
|
|
49
65
|
_focus: {
|
|
50
|
-
border:
|
|
66
|
+
border: r.XSmall,
|
|
51
67
|
borderColor: o.Info,
|
|
52
|
-
boxShadow: `0 0 0 4px ${
|
|
68
|
+
boxShadow: `0 0 0 4px ${e.InfoContainer}`
|
|
53
69
|
},
|
|
54
70
|
"@media(hover: hover)": {
|
|
55
|
-
"&:hover": {
|
|
56
|
-
borderColor: o.Info
|
|
57
|
-
},
|
|
58
|
-
"&:hover:not(:focus)": {
|
|
71
|
+
"&:hover:not(:focus):not(:disabled)": {
|
|
59
72
|
backgroundColor: o.SurfaceDisabled,
|
|
60
|
-
borderColor:
|
|
73
|
+
borderColor: "transparent"
|
|
61
74
|
}
|
|
62
75
|
},
|
|
63
76
|
_invalid: {
|
|
64
|
-
border:
|
|
77
|
+
border: r.XSmall,
|
|
65
78
|
borderColor: o.Error,
|
|
66
|
-
boxShadow: `0 0 0 4px ${
|
|
79
|
+
boxShadow: `0 0 0 4px ${e.ErrorContainer}`
|
|
67
80
|
}
|
|
68
|
-
},
|
|
81
|
+
}, f = d({
|
|
69
82
|
variants: {
|
|
70
83
|
unstyled: a,
|
|
71
|
-
ghost:
|
|
84
|
+
ghost: i
|
|
72
85
|
},
|
|
73
86
|
defaultProps: {
|
|
74
87
|
variant: "unstyled"
|
|
75
88
|
}
|
|
76
89
|
});
|
|
77
90
|
export {
|
|
78
|
-
|
|
91
|
+
f as textareaConfig
|
|
79
92
|
};
|