@dmsi/wedgekit-react 2.0.2 → 2.1.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/Button.d.ts +5 -1
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/DateInput.d.ts.map +1 -1
- package/dist/components/DateInput.js +154 -121
- package/dist/components/Link.d.ts +2 -1
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/Link.js +20 -18
- package/dist/components/MainBar.d.ts +3 -1
- package/dist/components/MainBar.d.ts.map +1 -1
- package/dist/components/MainBar.js +19 -18
- package/dist/components/MobileDataGrid/index.d.ts +2 -0
- package/dist/components/MobileDataGrid/index.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/index.js +35 -34
- package/dist/components/Stack.d.ts +1 -1
- package/dist/components/Stack.d.ts.map +1 -1
- package/dist/components/Stack.js +73 -73
- package/dist/components/Stepper.d.ts +11 -3
- package/dist/components/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper.js +117 -82
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +130 -128
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, ButtonHTMLAttributes, Ref } from 'react';
|
|
1
|
+
import { ReactNode, ButtonHTMLAttributes, AnchorHTMLAttributes, Ref } from 'react';
|
|
2
2
|
type BaseButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
3
3
|
ref?: Ref<HTMLButtonElement>;
|
|
4
4
|
as?: React.ElementType;
|
|
@@ -9,6 +9,10 @@ type BaseButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
colorClassName?: string;
|
|
11
11
|
href?: string;
|
|
12
|
+
/** Only meaningful when `as="a"`. */
|
|
13
|
+
target?: AnchorHTMLAttributes<HTMLAnchorElement>["target"];
|
|
14
|
+
/** Only meaningful when `as="a"`. */
|
|
15
|
+
rel?: AnchorHTMLAttributes<HTMLAnchorElement>["rel"];
|
|
12
16
|
id?: string;
|
|
13
17
|
testid?: string;
|
|
14
18
|
isLoading?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAWnF,KAAK,eAAe,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GAAG;IACjF,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC7B,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB,OAAO,CAAC,EACJ,SAAS,GACT,WAAW,GACX,UAAU,GACV,sBAAsB,GACtB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,YAAY,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,MAAM,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC3D,qCAAqC;IACrC,GAAG,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAC;IACrD,EAA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AAW,2CAiLb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/components/DateInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/components/DateInput.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAcpD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,KAAK,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG;IACjD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC;IACzD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,MAAM,EACN,KAAK,EACL,QAAQ,EACR,WAA0B,EAC1B,QAAQ,EACR,QAAgB,EAChB,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,cAAc,2CAwThB"}
|
|
@@ -1,194 +1,227 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
import { jsxs as $, jsx as l, Fragment as _ } from "react/jsx-runtime";
|
|
3
|
+
import { useState as D, useRef as k, useEffect as I, useLayoutEffect as J } from "react";
|
|
4
|
+
import { createPortal as Q } from "react-dom";
|
|
5
|
+
import { clsx as Z } from "../node_modules/clsx/dist/clsx.js";
|
|
6
|
+
import { InputBase as O } from "./Input.js";
|
|
7
|
+
import { CalendarRange as T } from "./CalendarRange.js";
|
|
8
|
+
import { Icon as ee } from "./Icon.js";
|
|
9
|
+
import { findDocumentRoot as te } from "../utils.js";
|
|
10
|
+
import { useMatchesMobile as ne } from "../hooks/useMatchesMedia.js";
|
|
11
|
+
import { isValidDate as b, calculateCursorPosition as oe } from "../utils/date.js";
|
|
12
|
+
import { formatDateWithDashes as re, formatInputValueWithDashes as A, parseInputDateWithDashes as E } from "../utils/date-patch-dashes.js";
|
|
13
|
+
import { marginTopUsingComponentGap as ae } from "../classNames.js";
|
|
14
|
+
function xe({
|
|
15
|
+
id: r,
|
|
16
|
+
testid: d,
|
|
17
|
+
value: z,
|
|
18
|
+
onChange: y,
|
|
19
|
+
placeholder: K = "MM/DD/YYYY",
|
|
20
|
+
disabled: j,
|
|
21
|
+
readOnly: h = !1,
|
|
22
|
+
label: H,
|
|
23
|
+
isDateAvailable: V,
|
|
24
|
+
disableManualInput: q,
|
|
25
|
+
theme: M,
|
|
26
|
+
...X
|
|
25
27
|
}) {
|
|
26
|
-
const [
|
|
28
|
+
const [C, f] = D(!1), [x, g] = D(""), [B, p] = D(!1), w = k(null), s = k(null), P = k(null), c = ne(), [F, G] = D({
|
|
27
29
|
top: 0,
|
|
28
30
|
left: 0,
|
|
29
|
-
width: 0
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
width: 0,
|
|
32
|
+
openAbove: !1
|
|
33
|
+
}), u = z;
|
|
34
|
+
I(() => {
|
|
35
|
+
B || g(N(u));
|
|
36
|
+
}, [u, B]), J(() => {
|
|
37
|
+
C && m();
|
|
38
|
+
}, [C]);
|
|
39
|
+
const m = () => {
|
|
40
|
+
if (P.current) {
|
|
41
|
+
const e = P.current.getBoundingClientRect(), t = window.innerWidth, a = window.innerHeight, n = 340, i = 400;
|
|
42
|
+
let o = e.left;
|
|
43
|
+
o + n > t && (o = e.right - n, o < 0 && (o = Math.max(0, (t - n) / 2)));
|
|
44
|
+
const v = o + window.scrollX, W = a - e.bottom, U = e.top, Y = W < i && U > W;
|
|
45
|
+
let R;
|
|
46
|
+
Y ? R = e.top + window.scrollY - i - 4 : R = e.bottom + window.scrollY + 4, G({ top: R, left: v, width: e.width, openAbove: Y });
|
|
44
47
|
}
|
|
45
48
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const e = new ResizeObserver(
|
|
49
|
-
return
|
|
50
|
-
e.disconnect(), window.removeEventListener("scroll",
|
|
49
|
+
I(() => {
|
|
50
|
+
m();
|
|
51
|
+
const e = new ResizeObserver(m);
|
|
52
|
+
return s.current && e.observe(s.current), window.addEventListener("scroll", m), () => {
|
|
53
|
+
e.disconnect(), window.removeEventListener("scroll", m);
|
|
51
54
|
};
|
|
52
|
-
}, []),
|
|
55
|
+
}, []), I(() => {
|
|
53
56
|
const e = (t) => {
|
|
54
|
-
t.key === "Escape" &&
|
|
57
|
+
t.key === "Escape" && w.current && (f(!1), s.current?.blur());
|
|
55
58
|
};
|
|
56
59
|
return document.addEventListener("keydown", e), () => {
|
|
57
60
|
document.removeEventListener("keydown", e);
|
|
58
61
|
};
|
|
59
62
|
});
|
|
60
|
-
function
|
|
61
|
-
|
|
63
|
+
function L(e) {
|
|
64
|
+
y(e), f(!1), p(!1);
|
|
62
65
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
66
|
+
const S = () => {
|
|
67
|
+
h || f(!0);
|
|
65
68
|
};
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
|
|
69
|
+
return /* @__PURE__ */ $("div", { className: "relative", children: [
|
|
70
|
+
/* @__PURE__ */ l(
|
|
71
|
+
O,
|
|
69
72
|
{
|
|
70
|
-
id:
|
|
71
|
-
testid:
|
|
73
|
+
id: r,
|
|
74
|
+
testid: d,
|
|
72
75
|
ref: (e) => {
|
|
73
|
-
|
|
76
|
+
s.current = e;
|
|
74
77
|
},
|
|
75
|
-
...
|
|
76
|
-
wrapperRef:
|
|
77
|
-
value:
|
|
78
|
-
placeholder:
|
|
79
|
-
disabled:
|
|
80
|
-
readOnly:
|
|
81
|
-
after: /* @__PURE__ */
|
|
82
|
-
onFocus:
|
|
78
|
+
...X,
|
|
79
|
+
wrapperRef: P,
|
|
80
|
+
value: x,
|
|
81
|
+
placeholder: K,
|
|
82
|
+
disabled: j,
|
|
83
|
+
readOnly: h,
|
|
84
|
+
after: /* @__PURE__ */ l(ee, { name: "calendar_month" }),
|
|
85
|
+
onFocus: q ? (e) => {
|
|
83
86
|
e.preventDefault(), e.stopPropagation(), e.currentTarget.blur();
|
|
84
|
-
} :
|
|
87
|
+
} : S,
|
|
85
88
|
onClick: () => {
|
|
86
|
-
|
|
89
|
+
S();
|
|
87
90
|
},
|
|
88
91
|
onChange: (e) => {
|
|
89
|
-
if (
|
|
90
|
-
const t = e.target.value,
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
if (
|
|
95
|
-
const
|
|
92
|
+
if (h) return;
|
|
93
|
+
const t = e.target.value, a = e.target.selectionStart || 0;
|
|
94
|
+
p(!0);
|
|
95
|
+
const n = A(t);
|
|
96
|
+
g(n), requestAnimationFrame(() => {
|
|
97
|
+
if (s.current) {
|
|
98
|
+
const o = oe(
|
|
96
99
|
t,
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
n,
|
|
101
|
+
a
|
|
99
102
|
);
|
|
100
|
-
|
|
103
|
+
s.current.setSelectionRange(o, o);
|
|
101
104
|
}
|
|
102
105
|
});
|
|
103
|
-
const
|
|
104
|
-
|
|
106
|
+
const i = E(n);
|
|
107
|
+
i && b(i) && y(i);
|
|
105
108
|
},
|
|
106
109
|
onBlur: () => {
|
|
107
|
-
|
|
108
|
-
const e =
|
|
109
|
-
(!e || !
|
|
110
|
+
p(!1);
|
|
111
|
+
const e = E(x);
|
|
112
|
+
(!e || !b(e)) && g(N(u));
|
|
110
113
|
},
|
|
111
114
|
onKeyDown: (e) => {
|
|
112
115
|
if (e.key === "Backspace") {
|
|
113
|
-
const t = e.target,
|
|
114
|
-
if (
|
|
116
|
+
const t = e.target, a = t.selectionStart || 0, n = t.value;
|
|
117
|
+
if (a > 0 && n[a - 1] === "/") {
|
|
115
118
|
e.preventDefault();
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
-
const
|
|
120
|
-
|
|
119
|
+
const i = n.slice(0, a - 2) + n.slice(a), o = A(i);
|
|
120
|
+
g(o), requestAnimationFrame(() => {
|
|
121
|
+
if (s.current) {
|
|
122
|
+
const v = Math.max(0, a - 2);
|
|
123
|
+
s.current.setSelectionRange(v, v);
|
|
121
124
|
}
|
|
122
|
-
}),
|
|
125
|
+
}), p(!0);
|
|
123
126
|
return;
|
|
124
127
|
}
|
|
125
128
|
}
|
|
126
129
|
if (e.key === "Enter") {
|
|
127
|
-
const t =
|
|
128
|
-
t &&
|
|
130
|
+
const t = E(x);
|
|
131
|
+
t && b(t) && (y(t), f(!1), p(!1));
|
|
129
132
|
}
|
|
130
133
|
},
|
|
131
|
-
label:
|
|
134
|
+
label: H,
|
|
132
135
|
secondaryIconColor: !0
|
|
133
136
|
}
|
|
134
137
|
),
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
C && !h && Q(
|
|
139
|
+
/* @__PURE__ */ $(_, { children: [
|
|
140
|
+
/* @__PURE__ */ l(
|
|
138
141
|
"div",
|
|
139
142
|
{
|
|
140
|
-
className:
|
|
141
|
-
|
|
143
|
+
className: Z(
|
|
144
|
+
"fixed inset-0 z-30",
|
|
145
|
+
c && "overflow-y-auto bg-neutral-600/50"
|
|
146
|
+
),
|
|
147
|
+
"data-theme": M,
|
|
148
|
+
onClick: () => f(!1),
|
|
142
149
|
onMouseDown: (e) => {
|
|
143
|
-
e.preventDefault();
|
|
150
|
+
c || e.preventDefault();
|
|
144
151
|
},
|
|
145
152
|
onWheel: (e) => {
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
if (!c) {
|
|
154
|
+
const t = document.scrollingElement ?? document.documentElement;
|
|
155
|
+
t.scrollTop += e.deltaY, t.scrollLeft += e.deltaX;
|
|
156
|
+
}
|
|
148
157
|
},
|
|
149
158
|
onTouchMove: (e) => {
|
|
150
|
-
e.stopPropagation();
|
|
159
|
+
c || e.stopPropagation();
|
|
151
160
|
},
|
|
152
|
-
style: { touchAction: "pan-y pan-x" },
|
|
153
|
-
"aria-hidden": "true"
|
|
161
|
+
style: { touchAction: c ? "auto" : "pan-y pan-x" },
|
|
162
|
+
"aria-hidden": "true",
|
|
163
|
+
children: c && /* @__PURE__ */ l("div", { className: "min-h-full flex items-start justify-center py-4 px-2", children: /* @__PURE__ */ l(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
ref: (e) => {
|
|
167
|
+
w.current = e;
|
|
168
|
+
},
|
|
169
|
+
className: "bg-background-primary-normal rounded-base shadow-4 max-w-full",
|
|
170
|
+
onClick: (e) => e.stopPropagation(),
|
|
171
|
+
children: /* @__PURE__ */ l(
|
|
172
|
+
T,
|
|
173
|
+
{
|
|
174
|
+
id: r ? `${r}-calendar` : void 0,
|
|
175
|
+
testid: d ? `${d}-calendar` : void 0,
|
|
176
|
+
from: u,
|
|
177
|
+
to: u,
|
|
178
|
+
onChange: L,
|
|
179
|
+
cardStyle: !0,
|
|
180
|
+
mode: "single",
|
|
181
|
+
disableRange: !0,
|
|
182
|
+
isDateAvailable: V
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
) })
|
|
154
187
|
}
|
|
155
188
|
),
|
|
156
|
-
/* @__PURE__ */
|
|
189
|
+
!c && /* @__PURE__ */ l(
|
|
157
190
|
"div",
|
|
158
191
|
{
|
|
159
192
|
ref: (e) => {
|
|
160
|
-
|
|
193
|
+
w.current = e;
|
|
161
194
|
},
|
|
162
|
-
className: `absolute z-50 ${
|
|
163
|
-
"data-theme":
|
|
195
|
+
className: `absolute z-50 ${ae}`,
|
|
196
|
+
"data-theme": M,
|
|
164
197
|
style: {
|
|
165
|
-
top: `${
|
|
166
|
-
left: `${
|
|
198
|
+
top: `${F.top}px`,
|
|
199
|
+
left: `${F.left}px`
|
|
167
200
|
},
|
|
168
|
-
children: /* @__PURE__ */
|
|
169
|
-
|
|
201
|
+
children: /* @__PURE__ */ l(
|
|
202
|
+
T,
|
|
170
203
|
{
|
|
171
|
-
id:
|
|
172
|
-
testid:
|
|
173
|
-
from:
|
|
174
|
-
to:
|
|
175
|
-
onChange:
|
|
204
|
+
id: r ? `${r}-calendar` : void 0,
|
|
205
|
+
testid: d ? `${d}-calendar` : void 0,
|
|
206
|
+
from: u,
|
|
207
|
+
to: u,
|
|
208
|
+
onChange: L,
|
|
176
209
|
cardStyle: !0,
|
|
177
210
|
mode: "single",
|
|
178
211
|
disableRange: !0,
|
|
179
|
-
isDateAvailable:
|
|
212
|
+
isDateAvailable: V
|
|
180
213
|
}
|
|
181
214
|
)
|
|
182
215
|
}
|
|
183
216
|
)
|
|
184
217
|
] }),
|
|
185
|
-
|
|
218
|
+
te(w.current)
|
|
186
219
|
)
|
|
187
220
|
] });
|
|
188
221
|
}
|
|
189
|
-
function
|
|
190
|
-
return !
|
|
222
|
+
function N(r) {
|
|
223
|
+
return !r || !b(r) ? "" : re(r);
|
|
191
224
|
}
|
|
192
225
|
export {
|
|
193
|
-
|
|
226
|
+
xe as DateInput
|
|
194
227
|
};
|
|
@@ -10,7 +10,8 @@ export type LinkProps = AsProps & TextAttributes & TypographyProps & {
|
|
|
10
10
|
underline?: boolean;
|
|
11
11
|
id?: string;
|
|
12
12
|
testid?: string;
|
|
13
|
+
block?: boolean;
|
|
13
14
|
addOverflow?: boolean;
|
|
14
15
|
};
|
|
15
|
-
export declare function Link({ as, className, variant, typographyStyle, disabled, color, paddedY, align, underline, testid, active, addOverflow, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function Link({ as, className, variant, typographyStyle, disabled, color, paddedY, align, underline, testid, active, block, addOverflow, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/components/Link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGpE,MAAM,MAAM,SAAS,GAAG,OAAO,GAC7B,cAAc,GACd,eAAe,GAAG;IAChB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C,eAAe,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB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IAAI,CAAC,EACnB,EAAQ,EACR,SAAS,EACT,OAAmB,EACnB,eAA6B,EAC7B,QAAgB,EAChB,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAiB,EACjB,MAAM,EACN,MAAM,EACN,KAAa,EACb,WAAW,EACX,GAAG,KAAK,EACT,EAAE,SAAS,2CAmFX"}
|
package/dist/components/Link.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
2
|
import { clsx as e } from "../node_modules/clsx/dist/clsx.js";
|
|
3
|
-
import { baseTransition as
|
|
4
|
-
function
|
|
3
|
+
import { baseTransition as D, typography as l, componentPaddingY as I } from "../classNames.js";
|
|
4
|
+
function T({
|
|
5
5
|
as: x = "a",
|
|
6
6
|
className: s,
|
|
7
7
|
variant: r = "primary",
|
|
@@ -11,23 +11,24 @@ function P({
|
|
|
11
11
|
paddedY: p,
|
|
12
12
|
align: i,
|
|
13
13
|
underline: d = !1,
|
|
14
|
-
testid:
|
|
14
|
+
testid: f,
|
|
15
15
|
active: n,
|
|
16
|
-
|
|
16
|
+
block: m = !1,
|
|
17
|
+
addOverflow: u,
|
|
17
18
|
...a
|
|
18
19
|
}) {
|
|
19
|
-
const
|
|
20
|
+
const y = x, v = r === "primary" && !t && e(
|
|
20
21
|
n ? "text-text-link-active" : "text-text-link-normal",
|
|
21
22
|
"hover:text-text-link-hover active:text-text-link-active"
|
|
22
|
-
),
|
|
23
|
+
), h = r === "secondary" && !t && e(
|
|
23
24
|
n ? "text-text-link-active" : "text-text-primary-normal",
|
|
24
25
|
"hover:text-text-link-hover active:text-text-link-active"
|
|
25
|
-
),
|
|
26
|
+
), S = r === "critical" && !t && e(
|
|
26
27
|
n ? "text-text-action-critical-active" : "text-text-action-critical-normal",
|
|
27
28
|
"hover:text-text-action-critical-hover active:text-text-action-critical-active"
|
|
28
|
-
),
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
29
|
+
), k = t && r === "critical" && e("text-text-action-critical-disabled"), g = t && ["primary", "secondary"].includes(r) && e("text-text-link-disabled"), w = t && e("pointer-events-none cursor-default"), j = d ? "decoration-current" : "decoration-decoration-underline", Y = p && I;
|
|
30
|
+
return /* @__PURE__ */ C(
|
|
31
|
+
y,
|
|
31
32
|
{
|
|
32
33
|
className: e(
|
|
33
34
|
"inline",
|
|
@@ -36,22 +37,23 @@ function P({
|
|
|
36
37
|
!t && "hover:decoration-current",
|
|
37
38
|
!t && "active:decoration-decoration-underline",
|
|
38
39
|
"flex flex-col items-center justify-center",
|
|
39
|
-
|
|
40
|
-
u,
|
|
40
|
+
D,
|
|
41
41
|
v,
|
|
42
42
|
h,
|
|
43
43
|
S,
|
|
44
44
|
k,
|
|
45
45
|
g,
|
|
46
46
|
w,
|
|
47
|
+
j,
|
|
47
48
|
o === "caption" && l.caption,
|
|
48
49
|
o === "paragraph" && l.paragraph,
|
|
49
50
|
i === "left" && "text-left",
|
|
50
51
|
i === "center" && "text-center",
|
|
51
52
|
i === "right" && "text-right",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
s
|
|
53
|
+
Y,
|
|
54
|
+
u && "whitespace-nowrap text-ellipsis overflow-hidden",
|
|
55
|
+
s,
|
|
56
|
+
m ? "w-full" : "w-fit"
|
|
55
57
|
),
|
|
56
58
|
...a,
|
|
57
59
|
style: {
|
|
@@ -60,10 +62,10 @@ function P({
|
|
|
60
62
|
},
|
|
61
63
|
"aria-disabled": t,
|
|
62
64
|
tabIndex: t ? -1 : void 0,
|
|
63
|
-
"data-testid":
|
|
65
|
+
"data-testid": f
|
|
64
66
|
}
|
|
65
67
|
);
|
|
66
68
|
}
|
|
67
69
|
export {
|
|
68
|
-
|
|
70
|
+
T as Link
|
|
69
71
|
};
|
|
@@ -8,7 +8,9 @@ type MainBarProps = {
|
|
|
8
8
|
mobileRightContent?: ReactNode;
|
|
9
9
|
cart?: ReactNode;
|
|
10
10
|
footer?: boolean;
|
|
11
|
+
/** When true, centers content vertically with symmetric padding instead of the default flush-to-bottom padding (which exists so tab-strip content, e.g. `NavigationTabs`, sits attached to the bar's bottom edge). Useful for non-tab content like icon buttons. */
|
|
12
|
+
centerContent?: boolean;
|
|
11
13
|
};
|
|
12
|
-
export declare function MainBar({ id, testid, leftContent: left, rightContent: right, mobileLeftContent: mobileLeft, mobileRightContent: mobileRight, footer, cart, }: ComponentProps<"div"> & MainBarProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function MainBar({ id, testid, leftContent: left, rightContent: right, mobileLeftContent: mobileLeft, mobileRightContent: mobileRight, footer, centerContent, cart, }: ComponentProps<"div"> & MainBarProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export {};
|
|
14
16
|
//# sourceMappingURL=MainBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainBar.d.ts","sourceRoot":"","sources":["../../src/components/MainBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASlD,KAAK,YAAY,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAE/B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MainBar.d.ts","sourceRoot":"","sources":["../../src/components/MainBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASlD,KAAK,YAAY,GAAG;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAE/B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oQAAoQ;IACpQ,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACtB,EAAE,EACF,MAAM,EACN,WAAW,EAAE,IAAI,EACjB,YAAY,EAAE,KAAK,EACnB,iBAAiB,EAAE,UAAU,EAC7B,kBAAkB,EAAE,WAAW,EAC/B,MAAc,EACd,aAAqB,EACrB,IAAI,GACL,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,2CA6DtC"}
|
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
1
|
+
import { jsx as e, Fragment as f, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { clsx as n } from "../node_modules/clsx/dist/clsx.js";
|
|
3
|
-
import { layoutGap as
|
|
3
|
+
import { layoutGap as s, layoutGroupGap as x, containerPaddingX as g, containerPaddingY as u, componentPaddingTopUsingComponentGap2xMobile as b } from "../classNames.js";
|
|
4
4
|
function w({
|
|
5
|
-
id:
|
|
6
|
-
testid:
|
|
5
|
+
id: c,
|
|
6
|
+
testid: l,
|
|
7
7
|
leftContent: a,
|
|
8
8
|
rightContent: o,
|
|
9
|
-
mobileLeftContent:
|
|
9
|
+
mobileLeftContent: i,
|
|
10
10
|
mobileRightContent: d,
|
|
11
|
-
footer:
|
|
12
|
-
|
|
11
|
+
footer: m = !1,
|
|
12
|
+
centerContent: p = !1,
|
|
13
|
+
cart: t
|
|
13
14
|
}) {
|
|
14
|
-
return !a && !o ? /* @__PURE__ */ e(
|
|
15
|
+
return !a && !o ? /* @__PURE__ */ e(f, {}) : /* @__PURE__ */ r(
|
|
15
16
|
"div",
|
|
16
17
|
{
|
|
17
|
-
id:
|
|
18
|
-
"data-testid":
|
|
18
|
+
id: c,
|
|
19
|
+
"data-testid": l,
|
|
19
20
|
className: n(
|
|
20
21
|
"min-h-mobile-container-padding",
|
|
21
22
|
"bg-background-brand-normal items-center justify-between",
|
|
22
23
|
"z-10 shadow-4",
|
|
23
24
|
"flex",
|
|
24
|
-
f,
|
|
25
25
|
x,
|
|
26
|
-
|
|
26
|
+
g,
|
|
27
|
+
m ? u : p ? "py-[calc((var(--spacing-mobile-component-gap)_+_8px)_/_2)] desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap" : b
|
|
27
28
|
),
|
|
28
29
|
children: [
|
|
29
30
|
a && /* @__PURE__ */ e(
|
|
30
31
|
"div",
|
|
31
32
|
{
|
|
32
|
-
className: n("hidden desktop:flex items-center flex-1 min-w-0 overflow-x-auto no-scrollbar",
|
|
33
|
+
className: n("hidden desktop:flex items-center flex-1 min-w-0 overflow-x-auto no-scrollbar", s),
|
|
33
34
|
children: a
|
|
34
35
|
}
|
|
35
36
|
),
|
|
36
|
-
(o ||
|
|
37
|
+
(o || t) && /* @__PURE__ */ r(
|
|
37
38
|
"div",
|
|
38
39
|
{
|
|
39
40
|
className: n(
|
|
40
41
|
"hidden desktop:flex items-center ml-auto",
|
|
41
|
-
|
|
42
|
+
s
|
|
42
43
|
),
|
|
43
44
|
children: [
|
|
44
45
|
o,
|
|
45
|
-
o &&
|
|
46
|
-
|
|
46
|
+
o && t && /* @__PURE__ */ e("div", { className: "h-14 w-px bg-background-on-action-primary-normal" }),
|
|
47
|
+
t
|
|
47
48
|
]
|
|
48
49
|
}
|
|
49
50
|
),
|
|
50
|
-
|
|
51
|
+
i && /* @__PURE__ */ e("div", { className: n("flex items-center desktop:hidden flex-1 min-w-0 overflow-x-auto no-scrollbar"), children: i }),
|
|
51
52
|
d && /* @__PURE__ */ e("div", { className: n("flex items-center desktop:hidden"), children: d })
|
|
52
53
|
]
|
|
53
54
|
}
|
|
@@ -21,6 +21,8 @@ export type MobileDataGridProps<T> = {
|
|
|
21
21
|
hideHeader?: boolean;
|
|
22
22
|
rowActions?: RowActions<T>;
|
|
23
23
|
rounded?: boolean;
|
|
24
|
+
/** When true, constrains the grid's height to leave room for the page's own footer below it. When false (default), the grid fills all available height — meant for views with no footer of their own, e.g. an external iframe embed. */
|
|
25
|
+
reserveFooterSpace?: boolean;
|
|
24
26
|
};
|
|
25
27
|
export declare function MobileDataGrid<T extends RowData>(props: MobileDataGridProps<T> & ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MobileDataGrid/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IACnC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IACxB,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,MAAM,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACjE,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAChD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1C,UAAU,EAAE,MAAM,CAAC,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE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