asma-ui-core 3.78.2 → 3.78.4
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/asma-ui-core.css +1 -1
- package/dist/components/custom/pathfinder-card/PathfinderCard.js +26 -27
- package/dist/datetime/components/date-picker/components/DatePickerButton.js +4 -4
- package/dist/datetime/components/time-picker/TimePickerInput.js +9 -9
- package/dist/datetime/components/time-picker/components/HelperText.js +1 -1
- package/dist/src/datetime/helpers/cn.d.ts +1 -2
- package/dist/src/datetime/shared-components/ClockOutlineIcon.d.ts +1 -2
- package/dist/src/table/helpers/cn.d.ts +1 -2
- package/dist/src/table/shared-components/CheckIcon.d.ts +8 -0
- package/dist/src/table/shared-components/CircleWarningOutlineIcon.d.ts +1 -2
- package/dist/src/table/shared-components/PinIcon.d.ts +1 -2
- package/dist/src/tokens.test.d.ts +1 -0
- package/dist/table/components/StyledTableIndex.js +1 -1
- package/dist/table/components/columns/action-column/components/HeaderActionMenu.js +14 -14
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +16 -16
- package/dist/table/components/table-header/TableHeader.js +4 -4
- package/dist/table/shared-components/CheckIcon.js +5 -11
- package/dist/table/shared-components/StyledCheckbox.js +1 -1
- package/dist/table/shared-components/StyledMenuItem.js +1 -1
- package/dist/table/shared-components/menu-item/index.js +1 -1
- package/package.json +1 -1
- package/src/styles/color-variables/defaultTokens.css +11 -0
- package/src/styles/color-variables/fretexTokens.css +3 -3
- package/src/styles/color-variables/jadeTokens.css +11 -0
- package/src/styles/components-colors/inputVariables.css +12 -3
- package/tw-configs/twConfigs.json +6 -6
- package/dist/datetime/helpers/cn.js +0 -7
- package/dist/datetime/shared-components/ClockOutlineIcon.js +0 -18
- package/dist/src/datetime/shared-components/ExpandIcon.d.ts +0 -2
- package/dist/src/datetime/shared-components/StyledTooltip.d.ts +0 -1
- package/dist/src/table/shared-components/ChevronUpIcon.d.ts +0 -2
- package/dist/src/table/shared-components/FilterIcon.d.ts +0 -2
- package/dist/table/helpers/cn.js +0 -7
- package/dist/table/shared-components/CircleWarningOutlineIcon.js +0 -26
- package/dist/table/shared-components/PinIcon.js +0 -19
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { ChevronDownIcon as
|
|
3
|
-
import { ChevronUpIcon as
|
|
1
|
+
import { cn as C } from "../../../helpers/cn.js";
|
|
2
|
+
import { ChevronDownIcon as j } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
|
+
import { ChevronUpIcon as z } from "../../icons/chevron-up-icon/ChevronUpIcon.js";
|
|
4
4
|
import h from "./Pathfinder.module.js";
|
|
5
|
-
import { useCallback as
|
|
6
|
-
import { Fragment as D, jsx as e, jsxs as
|
|
7
|
-
var _ = typeof window < "u" ?
|
|
5
|
+
import { useCallback as R, useEffect as M, useLayoutEffect as O, useMemo as y, useRef as k, useState as x, useSyncExternalStore as P } from "react";
|
|
6
|
+
import { Fragment as D, jsx as e, jsxs as I } from "react/jsx-runtime";
|
|
7
|
+
var _ = typeof window < "u" ? O : M;
|
|
8
8
|
function q() {
|
|
9
|
-
const [i, n] = x(null), d =
|
|
9
|
+
const [i, n] = x(null), d = R((t) => {
|
|
10
10
|
n(t);
|
|
11
|
-
}, []), s =
|
|
11
|
+
}, []), s = R(() => i ? Math.floor(i.getBoundingClientRect().width) : 0, [i]);
|
|
12
12
|
return {
|
|
13
13
|
ref: d,
|
|
14
|
-
width: P(
|
|
14
|
+
width: P(R((t) => {
|
|
15
15
|
if (!i || typeof ResizeObserver > "u") return () => {
|
|
16
|
-
console.log("Node is missing or ResizeObserver is undefined");
|
|
17
16
|
};
|
|
18
17
|
let a = 0;
|
|
19
18
|
const o = new ResizeObserver(() => {
|
|
@@ -32,15 +31,15 @@ function A(i) {
|
|
|
32
31
|
});
|
|
33
32
|
}
|
|
34
33
|
function K(i) {
|
|
35
|
-
const { items: n, leadSlot: d, actionSlot: s } = i, t =
|
|
34
|
+
const { items: n, leadSlot: d, actionSlot: s } = i, t = k({}), a = k(null), o = k(null), [l, v] = x({
|
|
36
35
|
itemWidths: {},
|
|
37
36
|
leadWidth: 0,
|
|
38
37
|
actionWidth: 0
|
|
39
|
-
}), f =
|
|
38
|
+
}), f = k(l);
|
|
40
39
|
M(() => {
|
|
41
40
|
f.current = l;
|
|
42
41
|
}, [l]);
|
|
43
|
-
const p =
|
|
42
|
+
const p = R((r) => (m) => {
|
|
44
43
|
t.current[r] = m;
|
|
45
44
|
}, []);
|
|
46
45
|
return _(() => {
|
|
@@ -76,7 +75,7 @@ function U(i) {
|
|
|
76
75
|
}
|
|
77
76
|
return a;
|
|
78
77
|
}
|
|
79
|
-
function
|
|
78
|
+
function b({ item: i, compact: n }) {
|
|
80
79
|
return /* @__PURE__ */ e(D, { children: i.render({ compact: n }) });
|
|
81
80
|
}
|
|
82
81
|
function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot: t, className: a, leadReservePx: o = 140, actionReservePx: l = 44 }) {
|
|
@@ -86,10 +85,10 @@ function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
|
|
|
86
85
|
actionSlot: t
|
|
87
86
|
}), w = y(() => {
|
|
88
87
|
if (n) return r;
|
|
89
|
-
const c = 24, L = 24,
|
|
88
|
+
const c = 24, L = 24, B = s ? Math.max(o, m.leadWidth + 12) : 0, F = t ? Math.max(l, m.actionWidth) : 0;
|
|
90
89
|
return U({
|
|
91
90
|
items: r,
|
|
92
|
-
availableWidth: Math.max(0, f - c - L -
|
|
91
|
+
availableWidth: Math.max(0, f - c - L - B - F - 24),
|
|
93
92
|
gapPx: 12,
|
|
94
93
|
itemWidths: m.itemWidths
|
|
95
94
|
});
|
|
@@ -103,9 +102,9 @@ function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
|
|
|
103
102
|
l,
|
|
104
103
|
m
|
|
105
104
|
]), N = p && w.length < Math.min(2, r.length), E = N ? r.slice(0, 2) : w;
|
|
106
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ I("div", {
|
|
107
106
|
ref: v,
|
|
108
|
-
className:
|
|
107
|
+
className: C(h.root, p ? "overflow-hidden" : "overflow-visible", a),
|
|
109
108
|
"aria-expanded": n,
|
|
110
109
|
role: "button",
|
|
111
110
|
tabIndex: 0,
|
|
@@ -114,27 +113,27 @@ function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
|
|
|
114
113
|
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), d());
|
|
115
114
|
},
|
|
116
115
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
className:
|
|
116
|
+
/* @__PURE__ */ I("div", {
|
|
117
|
+
className: C(h.shell, p ? h.shellCompact : h.shellExpanded),
|
|
119
118
|
children: [s ? /* @__PURE__ */ e("div", {
|
|
120
119
|
className: "shrink-0",
|
|
121
120
|
children: s
|
|
122
121
|
}) : null, /* @__PURE__ */ e("div", {
|
|
123
122
|
className: h.content,
|
|
124
123
|
children: p ? /* @__PURE__ */ e("div", {
|
|
125
|
-
className:
|
|
124
|
+
className: C(h.compactItems, N && h.compactItemsStacked),
|
|
126
125
|
children: E.map((c) => /* @__PURE__ */ e("div", {
|
|
127
126
|
className: "shrink-0 whitespace-nowrap",
|
|
128
|
-
children: /* @__PURE__ */ e(
|
|
127
|
+
children: /* @__PURE__ */ e(b, {
|
|
129
128
|
item: c,
|
|
130
129
|
compact: p
|
|
131
130
|
})
|
|
132
131
|
}, c.id))
|
|
133
|
-
}) : /* @__PURE__ */
|
|
132
|
+
}) : /* @__PURE__ */ I("div", {
|
|
134
133
|
className: h.expandedItems,
|
|
135
134
|
children: [r.map((c) => /* @__PURE__ */ e("div", {
|
|
136
135
|
className: "shrink-0 whitespace-nowrap",
|
|
137
|
-
children: /* @__PURE__ */ e(
|
|
136
|
+
children: /* @__PURE__ */ e(b, {
|
|
138
137
|
item: c,
|
|
139
138
|
compact: p
|
|
140
139
|
})
|
|
@@ -150,12 +149,12 @@ function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
|
|
|
150
149
|
}),
|
|
151
150
|
/* @__PURE__ */ e("div", {
|
|
152
151
|
className: h.chevron,
|
|
153
|
-
children: n ? /* @__PURE__ */ e(
|
|
152
|
+
children: n ? /* @__PURE__ */ e(z, { className: "size-6" }) : /* @__PURE__ */ e(j, { className: "size-6" })
|
|
154
153
|
}),
|
|
155
154
|
/* @__PURE__ */ e("div", {
|
|
156
155
|
"aria-hidden": !0,
|
|
157
156
|
className: h.measureLayer,
|
|
158
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ I("div", {
|
|
159
158
|
className: h.measureRow,
|
|
160
159
|
children: [
|
|
161
160
|
s ? /* @__PURE__ */ e("div", {
|
|
@@ -168,7 +167,7 @@ function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
|
|
|
168
167
|
r.map((c) => /* @__PURE__ */ e("div", {
|
|
169
168
|
ref: g(c.id),
|
|
170
169
|
className: "shrink-0 whitespace-nowrap",
|
|
171
|
-
children: /* @__PURE__ */ e(
|
|
170
|
+
children: /* @__PURE__ */ e(b, {
|
|
172
171
|
item: c,
|
|
173
172
|
compact: !0
|
|
174
173
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cn as n } from "../../../../helpers/cn.js";
|
|
2
|
+
import { StyledButton as i } from "../../../shared-components/button/StyledButton.js";
|
|
3
3
|
import { OutlineCalendarMonth as l } from "../../../shared-components/OutlineCalendarMonth.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
-
var h = ({ onClick: e, disabled: t, localeCode: o }) => /* @__PURE__ */ r(
|
|
6
|
+
var h = ({ onClick: e, disabled: t, localeCode: o }) => /* @__PURE__ */ r(i, {
|
|
7
7
|
type: "button",
|
|
8
8
|
size: "large",
|
|
9
9
|
dataTest: "DatePickerButton",
|
|
@@ -15,7 +15,7 @@ var h = ({ onClick: e, disabled: t, localeCode: o }) => /* @__PURE__ */ r(n, {
|
|
|
15
15
|
variant: "outlined",
|
|
16
16
|
disabled: t,
|
|
17
17
|
onClick: (a) => !t && e(a),
|
|
18
|
-
className:
|
|
18
|
+
className: n(t && "cursor-not-allowed")
|
|
19
19
|
});
|
|
20
20
|
export {
|
|
21
21
|
h as DatePickerButton
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ClockOutlineIcon as E } from "../../../components/icons/clock-outline-icon/ClockOutlineIcon.js";
|
|
2
|
+
import { StyledInputField as I } from "../../../components/inputs/input-field/StyledInputField.js";
|
|
3
|
+
import { useInputMask as N } from "../../../helpers/inputMask.js";
|
|
4
|
+
import { HelperText as w, defaultTimePickerHelperMessages as y } from "./components/HelperText.js";
|
|
5
5
|
import { useEffect as M, useRef as P } from "react";
|
|
6
6
|
import { jsx as r, jsxs as R } from "react/jsx-runtime";
|
|
7
7
|
var O = (x) => {
|
|
8
|
-
const { placeholder: c, disabled: e, inputClassName: f, dataTest: n, width: l, error: u, helperText: h, label: g, locale: T = "en", popupState: a, handleChange: k, isValidTime: p, isValidEndTime: m, localValue: C, title: d, readOnly: t } = x, b =
|
|
8
|
+
const { placeholder: c, disabled: e, inputClassName: f, dataTest: n, width: l, error: u, helperText: h, label: g, locale: T = "en", popupState: a, handleChange: k, isValidTime: p, isValidEndTime: m, localValue: C, title: d, readOnly: t } = x, b = N({
|
|
9
9
|
mask: "xx:xx",
|
|
10
10
|
maskChar: "x",
|
|
11
11
|
showMask: !1
|
|
@@ -17,7 +17,7 @@ var O = (x) => {
|
|
|
17
17
|
children: [d && /* @__PURE__ */ r("div", {
|
|
18
18
|
className: "pb-1 font-roboto font-semibold text-delta-800",
|
|
19
19
|
children: d
|
|
20
|
-
}), /* @__PURE__ */ r(
|
|
20
|
+
}), /* @__PURE__ */ r(I, {
|
|
21
21
|
inputRef: b,
|
|
22
22
|
autoComplete: "off",
|
|
23
23
|
type: "text",
|
|
@@ -26,13 +26,13 @@ var O = (x) => {
|
|
|
26
26
|
placeholder: c,
|
|
27
27
|
size: "small",
|
|
28
28
|
error: i,
|
|
29
|
-
helperText: /* @__PURE__ */ r(
|
|
29
|
+
helperText: /* @__PURE__ */ r(w, {
|
|
30
30
|
isValidTime: p,
|
|
31
31
|
isValidEndTime: m,
|
|
32
32
|
error: i,
|
|
33
33
|
localization: T,
|
|
34
34
|
helperText: h,
|
|
35
|
-
messages:
|
|
35
|
+
messages: y
|
|
36
36
|
}),
|
|
37
37
|
onChange: k,
|
|
38
38
|
slotProps: {
|
|
@@ -41,7 +41,7 @@ var O = (x) => {
|
|
|
41
41
|
onMouseDown: (o) => {
|
|
42
42
|
!e && !t && a.open(o);
|
|
43
43
|
},
|
|
44
|
-
endAdornment: /* @__PURE__ */ r(
|
|
44
|
+
endAdornment: /* @__PURE__ */ r(E, {
|
|
45
45
|
width: 24,
|
|
46
46
|
height: 24,
|
|
47
47
|
className: e ? "text-delta-300" : "text-delta-700",
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function cn(...inputs: ClassValue[]): string;
|
|
1
|
+
export { cn } from '../../helpers/cn';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function ClockOutlineIcon(props: SVGProps<SVGSVGElement>): JSX.Element;
|
|
1
|
+
export { ClockOutlineIcon } from '../../components/icons/clock-outline-icon';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function cn(...inputs: ClassValue[]): string;
|
|
1
|
+
export { cn } from '../../helpers/cn';
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { SVGProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The core `CheckIcon` (identical artwork and viewBox) wrapped only to preserve the table copy's
|
|
4
|
+
* historical `1rem` default size — the core default is 24px, and table call sites override `width`
|
|
5
|
+
* but not `height`, so a plain re-export would change the rendered glyph. ASMA-8134.
|
|
6
|
+
*
|
|
7
|
+
* The core icon also carries `aria-hidden='true'`, which the table copy was missing: these glyphs
|
|
8
|
+
* are decorative cell adornments, so hiding them from the a11y tree is the intended behaviour.
|
|
9
|
+
*/
|
|
2
10
|
export declare function CheckIcon(props: SVGProps<SVGSVGElement>): JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function CircleWarningOutlineIcon(props: SVGProps<SVGSVGElement>): JSX.Element;
|
|
1
|
+
export { CircleWarningOutlineIcon } from '../../components/icons/warning-circle-icon';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function PinIcon(props: SVGProps<SVGSVGElement>): JSX.Element;
|
|
1
|
+
export { PinIcon } from '../../components/icons/pin-icon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as p } from "
|
|
1
|
+
import { cn as p } from "../../helpers/cn.js";
|
|
2
2
|
import { RootContextProvider as te } from "../context/RootContext.js";
|
|
3
3
|
import { mobileView as oe, useWindowWidthSize as re } from "../hooks/useWindowWidthSize.hook.js";
|
|
4
4
|
import { useStyledTable as ne } from "../hooks/useStyledTable.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cn as v } from "../../../../../helpers/cn.js";
|
|
2
|
+
import { PinIcon as D } from "../../../../../components/icons/pin-icon/PinIcon.js";
|
|
3
|
+
import { message as _ } from "../../../../../components/feedback/snack-bar/message.js";
|
|
4
|
+
import { StyledPopover as T } from "../../../../../components/utils/popover/StyledPopover.js";
|
|
3
5
|
import { INTERNAL_COLUMN_IDS as S } from "../../../../types.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useToggleMenuVisibility as L } from "../../../../hooks/useToggleMenuVisibility.hook.js";
|
|
8
|
-
import { PinIcon as k } from "../../../../shared-components/PinIcon.js";
|
|
6
|
+
import { StyledCheckbox as A } from "../../../../shared-components/StyledCheckbox.js";
|
|
7
|
+
import { StyledTooltip as L } from "../../../../shared-components/tooltip/index.js";
|
|
8
|
+
import { useToggleMenuVisibility as k } from "../../../../hooks/useToggleMenuVisibility.hook.js";
|
|
9
9
|
import m from "./TableActions.module.js";
|
|
10
10
|
import d from "./HeaderActionMenu.module.js";
|
|
11
11
|
import { DotsHorizontalIcon as H } from "../../../../shared-components/DotsHorizontalIcon.js";
|
|
@@ -36,7 +36,7 @@ function q({ id: n, disabled: u, children: p }) {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
function fe({ headerData: n, locale: u }) {
|
|
39
|
-
const { anchorEl: p, open: c, handleClose: h, handleOpen: b } =
|
|
39
|
+
const { anchorEl: p, open: c, handleClose: h, handleOpen: b } = k(), g = n.table.getAllLeafColumns().some((e) => e.getCanHide() && !e.getIsVisible() && !S.includes(e.id)), l = n.table.getAllLeafColumns(), y = (e) => {
|
|
40
40
|
const { active: r, over: t } = e;
|
|
41
41
|
!r || !t || r.id === t.id || l.find((i) => i.id === t.id)?.columnDef.fixedLeft || l.find((i) => i.id === t.id)?.columnDef.fixedRight || n.table.setColumnOrder((i) => {
|
|
42
42
|
const a = R(i ?? []).length ? i : n.table.getAllLeafColumns().map((C) => C.id);
|
|
@@ -52,8 +52,8 @@ function fe({ headerData: n, locale: u }) {
|
|
|
52
52
|
"aria-expanded": c,
|
|
53
53
|
className: m["actions-header"],
|
|
54
54
|
onClick: b,
|
|
55
|
-
children: [/* @__PURE__ */ o(
|
|
56
|
-
}), /* @__PURE__ */ f(
|
|
55
|
+
children: [/* @__PURE__ */ o(D, { className: m["pin-icon"] }), g && /* @__PURE__ */ o("div", { className: m["pin-indicator"] })]
|
|
56
|
+
}), /* @__PURE__ */ f(T, {
|
|
57
57
|
anchorEl: p,
|
|
58
58
|
anchorOrigin: {
|
|
59
59
|
horizontal: "left",
|
|
@@ -83,7 +83,7 @@ function fe({ headerData: n, locale: u }) {
|
|
|
83
83
|
return r && t ? i = s.column_reorder_and_hidden : r ? i = s.column_reorder : t && (i = s.column_hidden), /* @__PURE__ */ o(q, {
|
|
84
84
|
id: e.id,
|
|
85
85
|
disabled: r,
|
|
86
|
-
children: ({ listeners: a, attributes: C }) => /* @__PURE__ */ o(
|
|
86
|
+
children: ({ listeners: a, attributes: C }) => /* @__PURE__ */ o(L, {
|
|
87
87
|
title: i,
|
|
88
88
|
arrow: !0,
|
|
89
89
|
children: /* @__PURE__ */ f("button", {
|
|
@@ -104,11 +104,11 @@ function fe({ headerData: n, locale: u }) {
|
|
|
104
104
|
userSelect: "none",
|
|
105
105
|
WebkitTouchCallout: "none"
|
|
106
106
|
},
|
|
107
|
-
className:
|
|
107
|
+
className: v(d["drag-icon"], r ? d["drag-icon--disabled"] : d["drag-icon--enabled"])
|
|
108
108
|
}),
|
|
109
109
|
/* @__PURE__ */ o("span", {
|
|
110
110
|
className: "px-2",
|
|
111
|
-
children: /* @__PURE__ */ o(
|
|
111
|
+
children: /* @__PURE__ */ o(A, {
|
|
112
112
|
readOnly: t,
|
|
113
113
|
dataTest: `${e.id}-column-visibility-checkbox`,
|
|
114
114
|
size: "small",
|
|
@@ -135,7 +135,7 @@ function fe({ headerData: n, locale: u }) {
|
|
|
135
135
|
variant: "text",
|
|
136
136
|
className: "h-10",
|
|
137
137
|
onClick: () => {
|
|
138
|
-
n.table.resetColumnOrder(),
|
|
138
|
+
n.table.resetColumnOrder(), _.info(s.column_order_reset, { closeButton: !0 });
|
|
139
139
|
},
|
|
140
140
|
children: s.reset_order
|
|
141
141
|
})
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CircleWarningOutlineIcon as S } from "../../../../../components/icons/warning-circle-icon/CircleWarningOutlineIcon.js";
|
|
2
|
+
import { StyledPopover as A } from "../../../../../components/utils/popover/StyledPopover.js";
|
|
3
|
+
import { StyledMenuList as O } from "../../../../../components/navigation/menu/StyledMenuList.js";
|
|
4
|
+
import { isCustomAction as j } from "../../../../types.js";
|
|
4
5
|
import { StyledTooltip as g } from "../../../../shared-components/tooltip/index.js";
|
|
5
|
-
import { useToggleMenuVisibility as
|
|
6
|
-
import { StyledButton as
|
|
7
|
-
import { DotsVerticalIcon as
|
|
8
|
-
import { StyledMenuItem as
|
|
9
|
-
import { CircleWarningOutlineIcon as R } from "../../../../shared-components/CircleWarningOutlineIcon.js";
|
|
6
|
+
import { useToggleMenuVisibility as k } from "../../../../hooks/useToggleMenuVisibility.hook.js";
|
|
7
|
+
import { StyledButton as F } from "../../../../shared-components/button/StyledButton.js";
|
|
8
|
+
import { DotsVerticalIcon as I } from "../../../../shared-components/DotsVerticalIcon.js";
|
|
9
|
+
import { StyledMenuItem as R } from "../../../../shared-components/StyledMenuItem.js";
|
|
10
10
|
import w, { useEffect as V, useMemo as z, useState as D } from "react";
|
|
11
11
|
import { jsx as t, jsxs as b } from "react/jsx-runtime";
|
|
12
12
|
function X({ tableData: o, actions: v, rowActionsState: C }) {
|
|
13
|
-
const { anchorEl: x, open: a, handleClose: i, handleOpen: P } =
|
|
13
|
+
const { anchorEl: x, open: a, handleClose: i, handleOpen: P } = k(), l = v(o.row), n = C?.(o.row) ?? { state: "enabled" }, p = o.table.options.meta?.locale, y = p === "no" ? "Ingen handlinger tilgjengelig" : "No actions available", N = p === "no" ? "Radhandlinger" : "Row actions", T = z(() => l.every((e) => "component" in e ? !1 : e.hide), [l]), u = l.length > 0 && !T, m = n.state === "enabled" && !u, M = n.state !== "hidden" && (u || m || n.state === "disabled"), [c, s] = D(!1);
|
|
14
14
|
if (V(() => {
|
|
15
15
|
if (!c) return;
|
|
16
16
|
const e = window.setTimeout(() => s(!1), 1600);
|
|
17
17
|
return () => window.clearTimeout(e);
|
|
18
18
|
}, [c]), !M) return /* @__PURE__ */ t("div", { className: "flex w-[40px] items-center justify-center" });
|
|
19
|
-
const d = n.state === "disabled", f = /* @__PURE__ */ t(
|
|
19
|
+
const d = n.state === "disabled", f = /* @__PURE__ */ t(F, {
|
|
20
20
|
dataTest: "row-actions-button",
|
|
21
21
|
"aria-label": N,
|
|
22
22
|
"aria-haspopup": "true",
|
|
@@ -33,7 +33,7 @@ function X({ tableData: o, actions: v, rowActionsState: C }) {
|
|
|
33
33
|
onMouseUp: (e) => {
|
|
34
34
|
e.stopPropagation(), e.preventDefault();
|
|
35
35
|
},
|
|
36
|
-
children: /* @__PURE__ */ t(
|
|
36
|
+
children: /* @__PURE__ */ t(I, {
|
|
37
37
|
className: d ? "text-delta-300" : "text-delta-700",
|
|
38
38
|
width: 20,
|
|
39
39
|
height: 20
|
|
@@ -60,7 +60,7 @@ function X({ tableData: o, actions: v, rowActionsState: C }) {
|
|
|
60
60
|
},
|
|
61
61
|
children: f
|
|
62
62
|
})
|
|
63
|
-
}) : f, n.state === "enabled" && /* @__PURE__ */ t(
|
|
63
|
+
}) : f, n.state === "enabled" && /* @__PURE__ */ t(A, {
|
|
64
64
|
open: a,
|
|
65
65
|
anchorEl: x,
|
|
66
66
|
onClose: () => {
|
|
@@ -79,14 +79,14 @@ function X({ tableData: o, actions: v, rowActionsState: C }) {
|
|
|
79
79
|
},
|
|
80
80
|
children: m ? /* @__PURE__ */ b("div", {
|
|
81
81
|
className: "flex items-center gap-2 p-3 text-base text-delta-700",
|
|
82
|
-
children: [/* @__PURE__ */ t(
|
|
82
|
+
children: [/* @__PURE__ */ t(S, {
|
|
83
83
|
width: 20,
|
|
84
84
|
height: 20
|
|
85
85
|
}), /* @__PURE__ */ t("span", { children: y })]
|
|
86
|
-
}) : /* @__PURE__ */ t(
|
|
86
|
+
}) : /* @__PURE__ */ t(O, {
|
|
87
87
|
disablePadding: !0,
|
|
88
88
|
children: l.map((e, h) => {
|
|
89
|
-
if (
|
|
89
|
+
if (j(e)) {
|
|
90
90
|
const r = e.component(o.row, i);
|
|
91
91
|
return w.isValidElement(r) ? /* @__PURE__ */ t(w.Fragment, { children: r }, h) : null;
|
|
92
92
|
}
|
|
@@ -94,7 +94,7 @@ function X({ tableData: o, actions: v, rowActionsState: C }) {
|
|
|
94
94
|
title: e?.tooltipTitle,
|
|
95
95
|
arrow: !0,
|
|
96
96
|
placement: e?.tooltipPlacement ?? "left",
|
|
97
|
-
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(
|
|
97
|
+
children: /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(R, {
|
|
98
98
|
className: e.className,
|
|
99
99
|
disabled: e.disabled,
|
|
100
100
|
onClick: () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cn as b } from "../../../helpers/cn.js";
|
|
2
|
+
import { ACTIONS_COLUMN_ID as j } from "../../types.js";
|
|
3
3
|
import p from "../StyledTable.module.js";
|
|
4
4
|
import { TableHeaderCell as a } from "./TableHeaderCell.js";
|
|
5
5
|
import "react";
|
|
@@ -8,14 +8,14 @@ import "@tanstack/react-table";
|
|
|
8
8
|
function q({ table: x, styledTableProps: o, tableCanResize: m, tableWidth: l, columnWindow: { paddingLeft: i, paddingRight: c, indexes: H } }) {
|
|
9
9
|
const { stickyHeader: S = !1, tableHeaderRef: g, tableHeaderStyle: D = {} } = o, y = x.getHeaderGroups(), N = { ...D };
|
|
10
10
|
return /* @__PURE__ */ n("thead", {
|
|
11
|
-
className:
|
|
11
|
+
className: b(p["table-header"], S && p["table-header--sticky"], o.tableHeaderClassName),
|
|
12
12
|
style: N,
|
|
13
13
|
ref: g,
|
|
14
14
|
children: y.map((f) => {
|
|
15
15
|
const s = f.headers.map((e, t, r) => ({
|
|
16
16
|
header: e,
|
|
17
17
|
left: r.slice(0, t).reduce((d, u) => d + (u.column.getSize() ?? 0), 0)
|
|
18
|
-
})), W = s.filter(({ header: e }) => e.column.columnDef.fixedLeft), _ = s.filter(({ header: e }) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), h = s.filter(({ header: e }) => !!e.column.columnDef.fixedRight || e.column.id === "actions"), w = h.some(({ header: e }) => e.column.id ===
|
|
18
|
+
})), W = s.filter(({ header: e }) => e.column.columnDef.fixedLeft), _ = s.filter(({ header: e }) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), h = s.filter(({ header: e }) => !!e.column.columnDef.fixedRight || e.column.id === "actions"), w = h.some(({ header: e }) => e.column.id === j), C = h.map((e, t, r) => ({
|
|
19
19
|
...e,
|
|
20
20
|
right: r.slice(t + 1).reduce((d, u) => d + (u.header.column.getSize() ?? 0), 0) + (w ? -1 : 0)
|
|
21
21
|
})), O = H.reduce((e, t) => {
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import { jsx as
|
|
3
|
-
function h(
|
|
4
|
-
return /* @__PURE__ */ r
|
|
5
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1
|
+
import { CheckIcon as r } from "../../components/icons/check-icon/CheckIcon.js";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
function h(o) {
|
|
4
|
+
return /* @__PURE__ */ e(r, {
|
|
6
5
|
width: "1rem",
|
|
7
6
|
height: "1rem",
|
|
8
|
-
|
|
9
|
-
...t,
|
|
10
|
-
children: /* @__PURE__ */ r("path", {
|
|
11
|
-
fill: "currentColor",
|
|
12
|
-
d: "M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"
|
|
13
|
-
})
|
|
7
|
+
...o
|
|
14
8
|
});
|
|
15
9
|
}
|
|
16
10
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as u } from "
|
|
1
|
+
import { cn as u } from "../../helpers/cn.js";
|
|
2
2
|
import { jsx as x } from "react/jsx-runtime";
|
|
3
3
|
var d = ({ children: o, disabled: e, selected: n, className: a, classes: l, onClick: r, onMouseDown: i, onMouseUp: m }) => /* @__PURE__ */ x("li", {
|
|
4
4
|
role: "menuitem",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as i } from "
|
|
1
|
+
import { cn as i } from "../../../helpers/cn.js";
|
|
2
2
|
import { CheckIcon as l } from "../CheckIcon.js";
|
|
3
3
|
import { jsx as m, jsxs as s } from "react/jsx-runtime";
|
|
4
4
|
var g = ({ children: n, selected: o, disabled: e, className: a, onClick: t }) => /* @__PURE__ */ s("li", {
|
package/package.json
CHANGED
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
--colors-alpha-600: var(--colors-blue-600);
|
|
7
7
|
--colors-alpha-700: var(--colors-blue-700);
|
|
8
8
|
--colors-beta-100: var(--colors-red-100);
|
|
9
|
+
/* Focus-indicator shade for the three error-button *-focused-border-color rules.
|
|
10
|
+
Chosen by measurement on the rendered baseline, not by ramp position:
|
|
11
|
+
2.4.7 Focus Visible (AA) PASS - a ring renders where contained/outlined/text
|
|
12
|
+
previously painted none.
|
|
13
|
+
1.4.11 Non-text Contrast(AA) PASS - contained 8.37:1 against white on both sides
|
|
14
|
+
(a 1px white inset separates it from the fill,
|
|
15
|
+
itself 4.96:1); outlined and text 8.37:1 vs
|
|
16
|
+
page and 6.56:1 vs fill.
|
|
17
|
+
2.4.13 Focus Appearance(AAA) not claimed, outside this library's AA scope.
|
|
18
|
+
See docs/a11y-contrast.md (F-15) for the derivation and per-theme numbers. */
|
|
19
|
+
--colors-beta-400: var(--colors-red-700);
|
|
9
20
|
--colors-beta-500: var(--colors-red-500);
|
|
10
21
|
--colors-beta-600: var(--colors-red-600);
|
|
11
22
|
--colors-beta-700: var(--colors-red-700);
|
|
@@ -178,8 +178,8 @@
|
|
|
178
178
|
--colors-button-textWhite-common-disabled-bg-color: transparent;
|
|
179
179
|
--colors-button-textWhite-common-disabled-border-color: transparent;
|
|
180
180
|
|
|
181
|
-
--colors-
|
|
182
|
-
--colors-
|
|
181
|
+
--colors-btn-bg-mini-action: var(--colors-zinc-100);
|
|
182
|
+
--colors-btn-bg-mini-action-hover: var(--colors-gama-700);
|
|
183
183
|
--colors-link-text-hover: var(--colors-red-700);
|
|
184
184
|
--colors-link-text-standart: var(--colors-gray-500);
|
|
185
185
|
--colors-link-text-active: var(--colors-red-700);
|
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
--colors-app-directory-button-select-recipient-bg: var(--colors-slate-500);
|
|
189
189
|
--colors-btn-task-status-bg: var(--colors-green-100);
|
|
190
190
|
--colors-chat-ticket-message-bg: var(--colors-alpha-500);
|
|
191
|
-
--colors-
|
|
191
|
+
--colors-topbar-text: #ffffff;
|
|
192
192
|
|
|
193
193
|
--colors-menu-text-active: var(--colors-beta-700);
|
|
194
194
|
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
[data-theme='greenish'] {
|
|
2
2
|
--colors-beta-100: var(--colors-red-100);
|
|
3
|
+
/* Focus-indicator shade for the three error-button *-focused-border-color rules.
|
|
4
|
+
Chosen by measurement on the rendered baseline, not by ramp position:
|
|
5
|
+
2.4.7 Focus Visible (AA) PASS - a ring renders where contained/outlined/text
|
|
6
|
+
previously painted none.
|
|
7
|
+
1.4.11 Non-text Contrast(AA) PASS - contained 8.37:1 against white on both sides
|
|
8
|
+
(a 1px white inset separates it from the fill,
|
|
9
|
+
itself 4.96:1); outlined and text 8.37:1 vs
|
|
10
|
+
page and 6.56:1 vs fill.
|
|
11
|
+
2.4.13 Focus Appearance(AAA) not claimed, outside this library's AA scope.
|
|
12
|
+
See docs/a11y-contrast.md (F-15) for the derivation and per-theme numbers. */
|
|
13
|
+
--colors-beta-400: var(--colors-red-700);
|
|
3
14
|
--colors-beta-500: var(--colors-red-500);
|
|
4
15
|
--colors-beta-600: var(--colors-red-600);
|
|
5
16
|
--colors-beta-700: var(--colors-red-700);
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Declared on :root as well as the theme blocks: a host page that renders without any
|
|
3
|
+
* data-theme attribute must still get valid --colors-input-* / --input-* values (otherwise every
|
|
4
|
+
* var() below is invalid-at-computed-value-time and StyledTextarea falls back to inherited or
|
|
5
|
+
* initial colors). All three themes share these values today, so listing :root alongside them is
|
|
6
|
+
* exact -- the theme selectors stay in place, and because they come later in the selector list
|
|
7
|
+
* they continue to win on equal specificity once a theme starts overriding a token.
|
|
8
|
+
*/
|
|
9
|
+
:root,
|
|
1
10
|
[data-theme='default'],
|
|
2
11
|
[data-theme='fretex'],
|
|
3
12
|
[data-theme='greenish'] {
|
|
@@ -65,7 +74,7 @@
|
|
|
65
74
|
--colors-input-notEditable-focus-bg-color: var(--colors-delta-50);
|
|
66
75
|
--colors-input-notEditable-disabled-bg-color: var(--colors-delta-50);
|
|
67
76
|
--colors-input-notEditable-text-color: var(--colors-delta-800);
|
|
68
|
-
--colors-input-
|
|
77
|
+
--colors-input-notEditable-hover-text-color: var(--colors-delta-800);
|
|
69
78
|
--colors-input-notEditable-active-text-color: var(--colors-delta-800);
|
|
70
79
|
--colors-input-notEditable-focus-text-color: var(--colors-delta-800);
|
|
71
80
|
--colors-input-notEditable-disabled-text-color: var(--colors-delta-300);
|
|
@@ -95,10 +104,10 @@
|
|
|
95
104
|
--colors-input-readOnly-focus-bg-color: transparent;
|
|
96
105
|
--colors-input-readOnly-disabled-bg-color: transparent;
|
|
97
106
|
--colors-input-readOnly-text-color: var(--colors-delta-800);
|
|
98
|
-
--colors-input-
|
|
107
|
+
--colors-input-readOnly-hover-text-color: var(--colors-delta-800);
|
|
99
108
|
--colors-input-readOnly-active-text-color: var(--colors-delta-800);
|
|
100
109
|
--colors-input-readOnly-focus-text-color: var(--colors-delta-800);
|
|
101
|
-
--colors-input-readOnly-
|
|
110
|
+
--colors-input-readOnly-disabled-text-color: var(--colors-delta-300);
|
|
102
111
|
--input-readOnly-cursor: text;
|
|
103
112
|
--input-readOnly-hover-cursor: text;
|
|
104
113
|
--input-readOnly-active-cursor: text;
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"delta-700": "var(--colors-delta-700)",
|
|
38
38
|
"delta-800": "var(--colors-delta-800)",
|
|
39
39
|
"delta-900": "var(--colors-delta-900)",
|
|
40
|
-
"delta-9000": "var(--colors-
|
|
40
|
+
"delta-9000": "var(--colors-delta-9000)",
|
|
41
41
|
"sigma-700": "var(--colors-sigma-700)",
|
|
42
42
|
"theta-100": "var(--colors-theta-100)",
|
|
43
43
|
"theta-200": "var(--colors-theta-200)",
|
|
@@ -83,11 +83,11 @@
|
|
|
83
83
|
"btn-bg-mini-action-hover": "var(--colors-btn-bg-mini-action-hover)",
|
|
84
84
|
"chat-ticket-message-bg": "var(--colors-chat-ticket-message-bg)",
|
|
85
85
|
"colors-topbar-text": "var(--colors-topbar-text)",
|
|
86
|
-
"custom-grey-01": "hsl(var(--
|
|
87
|
-
"custom-grey-02": "hsl(var(--
|
|
88
|
-
"custom-grey-03": "hsl(var(--
|
|
89
|
-
"custom-grey-04": "hsl(var(--
|
|
90
|
-
"custom-grey-06": "hsl(var(--
|
|
86
|
+
"custom-grey-01": "hsl(var(--colors-cardea--grey-01) / <alpha-value>)",
|
|
87
|
+
"custom-grey-02": "hsl(var(--colors-cardea--grey-02) / <alpha-value>)",
|
|
88
|
+
"custom-grey-03": "hsl(var(--colors-cardea--grey-03) / <alpha-value>)",
|
|
89
|
+
"custom-grey-04": "hsl(var(--colors-cardea--grey-04) / <alpha-value>)",
|
|
90
|
+
"custom-grey-06": "hsl(var(--colors-cardea--grey-06) / <alpha-value>)"
|
|
91
91
|
},
|
|
92
92
|
"boxShadow": {
|
|
93
93
|
"ash": "-1px 8px 18px -20px black",
|