@viasat/beam-react 2.56.0 → 2.58.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/CHANGELOG.md +20 -0
- package/chunks/{DateField.Segment.CwhRnhtq.js → DateField.Segment.BMXzpxgl.js} +27 -26
- package/chunks/DateField.Segment.BqMaeKLk.js +1 -0
- package/chunks/use-isomorphic-layout-effect.browser.esm.CkGv31zs.js +1 -0
- package/chunks/use-isomorphic-layout-effect.browser.esm.DERp5kr6.js +5 -0
- package/lib/wip/DataTable/DataTable.columns.cjs.js +1 -0
- package/lib/wip/DataTable/DataTable.columns.d.ts +26 -0
- package/lib/wip/DataTable/DataTable.columns.es.js +10 -0
- package/lib/wip/DataTable/index.cjs.js +1 -1
- package/lib/wip/DataTable/index.d.ts +2 -0
- package/lib/wip/DataTable/index.es.js +13 -11
- package/lib/wip/DateField/DateField.Segment.cjs.js +1 -1
- package/lib/wip/DateField/DateField.Segment.es.js +3 -2
- package/lib/wip/DateField/DateField.Segments.cjs.js +1 -1
- package/lib/wip/DateField/DateField.Segments.es.js +1 -1
- package/lib/wip/DateField/DateField.cjs.js +1 -1
- package/lib/wip/DateField/DateField.devWarnings.cjs.js +1 -0
- package/lib/wip/DateField/DateField.devWarnings.d.ts +15 -0
- package/lib/wip/DateField/DateField.devWarnings.es.js +22 -0
- package/lib/wip/DateField/DateField.es.js +186 -177
- package/lib/wip/DateField/DateField.utils.cjs.js +1 -1
- package/lib/wip/DateField/DateField.utils.d.ts +7 -5
- package/lib/wip/DateField/DateField.utils.es.js +84 -70
- package/lib/wip/ErrorBoundary/ErrorBoundary.cjs.js +1 -0
- package/lib/wip/ErrorBoundary/ErrorBoundary.d.ts +28 -0
- package/lib/wip/ErrorBoundary/ErrorBoundary.es.js +19 -0
- package/lib/wip/ErrorBoundary/index.cjs.js +1 -0
- package/lib/wip/ErrorBoundary/index.d.ts +2 -0
- package/lib/wip/ErrorBoundary/index.es.js +4 -0
- package/lib/wip/index.cjs.js +1 -1
- package/lib/wip/index.d.ts +1 -0
- package/lib/wip/index.es.js +17 -13
- package/package.json +7 -7
- package/utils/hooks/useId.cjs.js +1 -1
- package/utils/hooks/useId.es.js +7 -8
- package/chunks/DateField.Segment.CqFLhMYA.js +0 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import "../../../chunks/constants.Cruz2A1w.js";
|
|
2
2
|
import { a as S } from "../../../chunks/helpers.CiQfGwdc.js";
|
|
3
|
-
import { SEGMENT_MAX_LENGTH as
|
|
4
|
-
const
|
|
3
|
+
import { SEGMENT_MAX_LENGTH as g } from "./DateField.validation.es.js";
|
|
4
|
+
const l = "en-US", h = new Intl.DateTimeFormat("en-US", { month: "long" }), $ = (t) => h.format(new Date(2e3, t - 1, 1)), d = 31, c = 12, p = 1, T = 9999, M = (t, e, n) => Math.min(n, Math.max(e, t)), A = (t, e) => ((t - 1) % e + e) % e + 1, E = 2024, k = (t, e) => e == null ? 31 : new Date(t ?? E, e, 0).getDate(), X = () => {
|
|
5
5
|
const t = /* @__PURE__ */ new Date();
|
|
6
6
|
return { day: t.getDate(), month: t.getMonth() + 1, year: t.getFullYear() };
|
|
7
|
-
},
|
|
7
|
+
}, s = (t) => t instanceof Date && !Number.isNaN(t.getTime()), b = (t, e, n, r) => {
|
|
8
8
|
if (n === "min") return t === "year" ? null : 1;
|
|
9
9
|
if (n === "max")
|
|
10
|
-
return t === "year" ? null : t === "day" ? r.daysInMonth :
|
|
10
|
+
return t === "year" ? null : t === "day" ? r.daysInMonth : c;
|
|
11
11
|
if (e == null) {
|
|
12
12
|
if (t === "year") return r.today.year;
|
|
13
|
-
const
|
|
14
|
-
return n > 0 ? 1 :
|
|
13
|
+
const m = t === "day" ? d : c;
|
|
14
|
+
return n > 0 ? 1 : m;
|
|
15
15
|
}
|
|
16
|
-
if (t === "year") return M(e + n,
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
},
|
|
16
|
+
if (t === "year") return M(e + n, p, T);
|
|
17
|
+
const a = t === "day" ? d : c;
|
|
18
|
+
return A(e + n, a);
|
|
19
|
+
}, N = { day: "", month: "", year: "" }, w = (t) => {
|
|
20
20
|
const { day: e, month: n, year: r } = t;
|
|
21
21
|
if (e == null || n == null || r == null) return null;
|
|
22
|
-
const
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
const r =
|
|
26
|
-
return !(
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
29
|
-
const r =
|
|
30
|
-
return
|
|
31
|
-
},
|
|
32
|
-
if (!
|
|
22
|
+
const a = new Date(r, n - 1, e);
|
|
23
|
+
return a.setFullYear(r), Number.isNaN(a.getTime()) || a.getFullYear() !== r || a.getMonth() !== n - 1 || a.getDate() !== e ? null : a;
|
|
24
|
+
}, H = (t, e) => t == null && e == null ? !0 : t == null || e == null ? !1 : t.getTime() === e.getTime(), o = S, U = (t) => s(t) ? o(t) : null, B = (t, e, n) => {
|
|
25
|
+
const r = o(t);
|
|
26
|
+
return !(s(e) && r < o(e) || s(n) && r > o(n));
|
|
27
|
+
}, D = (t, e) => s(t) && s(e) && o(t) > o(e), G = (t, e, n) => {
|
|
28
|
+
if (D(e, n)) return t;
|
|
29
|
+
const r = o(t);
|
|
30
|
+
return s(e) && r < o(e) ? new Date(e.getFullYear(), e.getMonth(), e.getDate()) : s(n) && r > o(n) ? new Date(n.getFullYear(), n.getMonth(), n.getDate()) : t;
|
|
31
|
+
}, j = (t) => {
|
|
32
|
+
if (!s(t)) return "";
|
|
33
33
|
const e = String(t.getFullYear()).padStart(4, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0");
|
|
34
34
|
return `${e}-${n}-${r}`;
|
|
35
|
-
},
|
|
36
|
-
(e) => !
|
|
35
|
+
}, _ = (t) => t.type === "literal", F = (t) => t.filter(
|
|
36
|
+
(e) => !_(e)
|
|
37
37
|
).map((e) => e.type), P = new Date(2020, 0, 2), R = /* @__PURE__ */ new Set([
|
|
38
38
|
8206,
|
|
39
39
|
8207,
|
|
@@ -46,87 +46,101 @@ const m = new Intl.DateTimeFormat("en-US", { month: "long" }), L = (t) => m.form
|
|
|
46
46
|
8295,
|
|
47
47
|
8296,
|
|
48
48
|
8297
|
|
49
|
-
]),
|
|
49
|
+
]), I = (t) => [...t].filter((e) => !R.has(e.codePointAt(0) ?? -1)).join(""), Y = /* @__PURE__ */ new Set(["day", "month", "year", "literal"]), y = 3, f = (t) => {
|
|
50
50
|
try {
|
|
51
51
|
const e = new Intl.DateTimeFormat(t, {
|
|
52
52
|
year: "numeric",
|
|
53
53
|
month: "2-digit",
|
|
54
54
|
day: "2-digit",
|
|
55
55
|
calendar: "gregory"
|
|
56
|
-
}).formatToParts(P).filter((r) =>
|
|
56
|
+
}).formatToParts(P).filter((r) => Y.has(r.type)).map((r) => ({
|
|
57
57
|
type: r.type,
|
|
58
|
-
value: r.type === "literal" ?
|
|
59
|
-
})), n =
|
|
60
|
-
return n.length ===
|
|
58
|
+
value: r.type === "literal" ? I(r.value) : ""
|
|
59
|
+
})), n = F(e);
|
|
60
|
+
return n.length === y && new Set(n).size === y ? e : null;
|
|
61
61
|
} catch {
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
let e = t;
|
|
64
|
+
}, u = /* @__PURE__ */ new Map(), L = (t) => {
|
|
66
65
|
try {
|
|
67
|
-
|
|
66
|
+
return new Intl.Locale(t).toString();
|
|
68
67
|
} catch {
|
|
69
|
-
|
|
68
|
+
return t.toLowerCase();
|
|
70
69
|
}
|
|
71
|
-
|
|
70
|
+
}, C = (t) => {
|
|
71
|
+
try {
|
|
72
|
+
return Intl.DateTimeFormat.supportedLocalesOf([t]).length > 0;
|
|
73
|
+
} catch {
|
|
74
|
+
return !1;
|
|
75
|
+
}
|
|
76
|
+
}, z = (t) => {
|
|
77
|
+
const e = L(t), n = u.get(e);
|
|
72
78
|
if (n) return n;
|
|
73
|
-
const r =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
const r = C(t);
|
|
80
|
+
!r && process.env.NODE_ENV !== "production" && console.warn(
|
|
81
|
+
`DateField: locale "${t}" is not supported; falling back to ${l}.`
|
|
82
|
+
);
|
|
83
|
+
const a = (r ? f(t) : null) ?? f(l);
|
|
84
|
+
if (!a)
|
|
85
|
+
throw new Error(
|
|
86
|
+
`DateField: Intl cannot resolve ${l} date parts`
|
|
87
|
+
);
|
|
88
|
+
return u.set(e, a), a;
|
|
89
|
+
}, W = () => u.clear(), q = (t) => s(t) ? {
|
|
78
90
|
day: String(t.getDate()).padStart(2, "0"),
|
|
79
91
|
month: String(t.getMonth() + 1).padStart(2, "0"),
|
|
80
92
|
year: String(t.getFullYear()).padStart(4, "0")
|
|
81
|
-
} :
|
|
82
|
-
if (e === "" || t === "year" && e.length <
|
|
93
|
+
} : N, i = (t, e) => {
|
|
94
|
+
if (e === "" || t === "year" && e.length < g.year) return null;
|
|
83
95
|
const n = parseInt(e, 10);
|
|
84
96
|
return Number.isNaN(n) || n === 0 ? null : n;
|
|
85
|
-
},
|
|
97
|
+
}, J = (t) => w({
|
|
86
98
|
day: i("day", t.day),
|
|
87
99
|
month: i("month", t.month),
|
|
88
100
|
year: i("year", t.year)
|
|
89
|
-
}),
|
|
90
|
-
displayValue: e.padStart(
|
|
101
|
+
}), Q = (t, e) => e === "" ? "" : e.padStart(g[t], "0"), Z = (t, e, n) => e === "" ? { displayValue: n, isPlaceholder: !0 } : {
|
|
102
|
+
displayValue: e.padStart(g[t], "0"),
|
|
91
103
|
isPlaceholder: !1
|
|
92
|
-
},
|
|
104
|
+
}, v = (t) => {
|
|
93
105
|
const e = window.getSelection();
|
|
94
106
|
if (!e) return;
|
|
95
107
|
const n = document.createRange();
|
|
96
108
|
n.selectNodeContents(t), e.removeAllRanges(), e.addRange(n);
|
|
97
|
-
},
|
|
109
|
+
}, x = (t) => {
|
|
98
110
|
var n;
|
|
99
111
|
if (!t) return;
|
|
100
112
|
const e = (n = window.getSelection) == null ? void 0 : n.call(window);
|
|
101
113
|
e && e.rangeCount > 0 && t.contains(e.anchorNode) && e.removeAllRanges();
|
|
102
114
|
};
|
|
103
115
|
export {
|
|
104
|
-
|
|
105
|
-
l as
|
|
116
|
+
d as DAY_SPIN_MAX,
|
|
117
|
+
l as DEFAULT_LOCALE,
|
|
118
|
+
c as MONTH_MAX,
|
|
106
119
|
T as YEAR_MAX,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
120
|
+
p as YEAR_MIN,
|
|
121
|
+
W as __clearDatePartsCache,
|
|
122
|
+
b as adjustSegmentValue,
|
|
110
123
|
M as clamp,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
G as clampDateToRange,
|
|
125
|
+
x as clearSelectionWithin,
|
|
126
|
+
U as dateKeyOrNull,
|
|
127
|
+
w as deriveValue,
|
|
128
|
+
J as deriveValueFromText,
|
|
129
|
+
z as getDateParts,
|
|
130
|
+
k as getDaysInMonth,
|
|
131
|
+
$ as getMonthName,
|
|
132
|
+
Z as getSegmentDisplay,
|
|
133
|
+
F as getSegmentOrder,
|
|
134
|
+
B as isDateInRange,
|
|
135
|
+
_ as isLiteralPart,
|
|
136
|
+
D as isMinMaxMisconfigured,
|
|
137
|
+
H as isSameDateValue,
|
|
138
|
+
s as isValidDate,
|
|
139
|
+
Q as normalizeSegmentText,
|
|
126
140
|
i as segmentNumber,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
141
|
+
q as segmentTextFromValue,
|
|
142
|
+
v as selectElementContents,
|
|
143
|
+
j as toISODateString,
|
|
144
|
+
X as todayParts,
|
|
145
|
+
A as wrapInRange
|
|
132
146
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react");class a extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,o){var r,t;(t=(r=this.props).onError)==null||t.call(r,e,o)}render(){return this.state.hasError?this.props.fallback:this.props.children}}exports.ErrorBoundary=a;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component, ErrorInfo, ReactNode } from 'react';
|
|
2
|
+
export interface ErrorBoundaryProps {
|
|
3
|
+
/** Rendered normally; a render/commit error anywhere below is caught. */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Rendered instead of `children` once a descendant throws. */
|
|
6
|
+
fallback: ReactNode;
|
|
7
|
+
/** Called when an error is caught — use for logging/telemetry. */
|
|
8
|
+
onError?: (error: Error, info: ErrorInfo) => void;
|
|
9
|
+
}
|
|
10
|
+
interface ErrorBoundaryState {
|
|
11
|
+
hasError: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Generic React error boundary: renders `fallback` when a descendant throws
|
|
15
|
+
* during render or commit, instead of letting the error crash the whole tree.
|
|
16
|
+
* Consumers own the fallback UI and any logging via `onError`.
|
|
17
|
+
*
|
|
18
|
+
* Must be a class component — React exposes error boundaries only through the
|
|
19
|
+
* `getDerivedStateFromError` / `componentDidCatch` lifecycle, which has no hook
|
|
20
|
+
* equivalent.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
23
|
+
state: ErrorBoundaryState;
|
|
24
|
+
static getDerivedStateFromError(): ErrorBoundaryState;
|
|
25
|
+
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
26
|
+
render(): ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component as e } from "react";
|
|
2
|
+
class p extends e {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(...arguments), this.state = { hasError: !1 };
|
|
5
|
+
}
|
|
6
|
+
static getDerivedStateFromError() {
|
|
7
|
+
return { hasError: !0 };
|
|
8
|
+
}
|
|
9
|
+
componentDidCatch(o, s) {
|
|
10
|
+
var r, t;
|
|
11
|
+
(t = (r = this.props).onError) == null || t.call(r, o, s);
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
p as ErrorBoundary
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./ErrorBoundary.cjs.js");exports.ErrorBoundary=r.ErrorBoundary;
|
package/lib/wip/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DataTable/DataTable.cjs.js"),l=require("./DataTable/DataTable.Header.cjs.js"),t=require("./DataTable/DataTable.Toolbar.cjs.js"),b=require("./DataTable/DataTable.Head.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DataTable/DataTable.cjs.js"),l=require("./DataTable/DataTable.Header.cjs.js"),t=require("./DataTable/DataTable.Toolbar.cjs.js"),b=require("./DataTable/DataTable.Head.cjs.js"),r=require("./DataTable/DataTable.ColumnHeader.cjs.js"),o=require("./DataTable/DataTable.Body.cjs.js"),T=require("./DataTable/DataTable.Row.cjs.js"),_=require("./DataTable/DataTable.Cell.cjs.js"),i=require("./DataTable/DataTable.Footer.cjs.js"),a=require("./DataTable/DataTable.context.cjs.js"),D=require("./DataTable/useBeamTable.cjs.js"),u=require("./DataTable/DataTable.columns.cjs.js"),n=require("./DateField/DateField.cjs.js"),d=require("./ErrorBoundary/ErrorBoundary.cjs.js");exports.DataTable=e.DataTable;exports.DataTableHeader=l.DataTableHeader;exports.DataTableToolbar=t.DataTableToolbar;exports.DataTableHead=b.DataTableHead;exports.DataTableColumnHeader=r.DataTableColumnHeader;exports.DataTableBody=o.DataTableBody;exports.DataTableRow=T.DataTableRow;exports.DataTableCell=_.DataTableCell;exports.DataTableFooter=i.DataTableFooter;exports.DataTableProvider=a.DataTableProvider;exports.useDataTable=a.useDataTable;exports.useBeamTable=D.useBeamTable;exports.createBeamColumn=u.createBeamColumn;exports.DateField=n.DateField;exports.ErrorBoundary=d.ErrorBoundary;
|
package/lib/wip/index.d.ts
CHANGED
package/lib/wip/index.es.js
CHANGED
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { DataTable as o } from "./DataTable/DataTable.es.js";
|
|
2
2
|
import { DataTableHeader as t } from "./DataTable/DataTable.Header.es.js";
|
|
3
3
|
import { DataTableToolbar as m } from "./DataTable/DataTable.Toolbar.es.js";
|
|
4
|
-
import { DataTableHead as
|
|
5
|
-
import { DataTableColumnHeader as
|
|
4
|
+
import { DataTableHead as p } from "./DataTable/DataTable.Head.es.js";
|
|
5
|
+
import { DataTableColumnHeader as b } from "./DataTable/DataTable.ColumnHeader.es.js";
|
|
6
6
|
import { DataTableBody as D } from "./DataTable/DataTable.Body.es.js";
|
|
7
7
|
import { DataTableRow as u } from "./DataTable/DataTable.Row.es.js";
|
|
8
|
-
import { DataTableCell as
|
|
9
|
-
import { DataTableFooter as
|
|
10
|
-
import { DataTableProvider as
|
|
11
|
-
import { useBeamTable as
|
|
8
|
+
import { DataTableCell as n } from "./DataTable/DataTable.Cell.es.js";
|
|
9
|
+
import { DataTableFooter as H } from "./DataTable/DataTable.Footer.es.js";
|
|
10
|
+
import { DataTableProvider as s, useDataTable as y } from "./DataTable/DataTable.context.es.js";
|
|
11
|
+
import { useBeamTable as c } from "./DataTable/useBeamTable.es.js";
|
|
12
|
+
import { createBeamColumn as w } from "./DataTable/DataTable.columns.es.js";
|
|
12
13
|
import { DateField as P } from "./DateField/DateField.es.js";
|
|
14
|
+
import { ErrorBoundary as g } from "./ErrorBoundary/ErrorBoundary.es.js";
|
|
13
15
|
export {
|
|
14
16
|
o as DataTable,
|
|
15
17
|
D as DataTableBody,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
n as DataTableCell,
|
|
19
|
+
b as DataTableColumnHeader,
|
|
20
|
+
H as DataTableFooter,
|
|
21
|
+
p as DataTableHead,
|
|
20
22
|
t as DataTableHeader,
|
|
21
|
-
|
|
23
|
+
s as DataTableProvider,
|
|
22
24
|
u as DataTableRow,
|
|
23
25
|
m as DataTableToolbar,
|
|
24
26
|
P as DateField,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
g as ErrorBoundary,
|
|
28
|
+
w as createBeamColumn,
|
|
29
|
+
c as useBeamTable,
|
|
30
|
+
y as useDataTable
|
|
27
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.58.0",
|
|
4
4
|
"description": "React component library for the Beam design system",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Viasat",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@viasat/beam-fonts": "2.
|
|
64
|
-
"@viasat/beam-shared": "2.
|
|
65
|
-
"@viasat/beam-styles": "2.
|
|
66
|
-
"@viasat/beam-tokens": "2.
|
|
67
|
-
"@viasat/beam-icons": "2.
|
|
68
|
-
"@viasat/beam-react-claude-plugin": "2.
|
|
63
|
+
"@viasat/beam-fonts": "2.58.0",
|
|
64
|
+
"@viasat/beam-shared": "2.58.0",
|
|
65
|
+
"@viasat/beam-styles": "2.58.0",
|
|
66
|
+
"@viasat/beam-tokens": "2.58.0",
|
|
67
|
+
"@viasat/beam-icons": "2.58.0",
|
|
68
|
+
"@viasat/beam-react-claude-plugin": "2.58.0",
|
|
69
69
|
"clsx": "^1.2.1",
|
|
70
70
|
"@floating-ui/react": "^0.26.18",
|
|
71
71
|
"@stepperize/react": "^5.1.5",
|
package/utils/hooks/useId.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),a=require("../safeReact.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),a=require("../../chunks/use-isomorphic-layout-effect.browser.esm.CkGv31zs.js"),i=require("../safeReact.cjs.js"),f=require("../../chunks/constants.CgMu0_1M.js");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const r=l(u);let s=!1,d=0;const c=()=>`${f.prefix}-${Math.random().toString(36).slice(2,6)}${d++}`;function g(){const[e,t]=r.useState(()=>s?c():void 0);return a.index(()=>{e==null&&t(c())},[]),r.useEffect(()=>{s=!0},[]),e}const p=i.SafeReact.useId,b=p||g;exports.useId=b;
|
package/utils/hooks/useId.es.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as t from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { SafeReact as
|
|
2
|
+
import { i as n } from "../../chunks/use-isomorphic-layout-effect.browser.esm.DERp5kr6.js";
|
|
3
|
+
import { SafeReact as i } from "../safeReact.es.js";
|
|
4
4
|
import { p as a } from "../../chunks/constants.Cruz2A1w.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const r = () => `${a}-${Math.random().toString(36).slice(2, 6)}${u++}`;
|
|
5
|
+
let o = !1, f = 0;
|
|
6
|
+
const r = () => `${a}-${Math.random().toString(36).slice(2, 6)}${f++}`;
|
|
8
7
|
function c() {
|
|
9
8
|
const [e, s] = t.useState(
|
|
10
9
|
() => (
|
|
@@ -12,13 +11,13 @@ function c() {
|
|
|
12
11
|
o ? r() : void 0
|
|
13
12
|
)
|
|
14
13
|
);
|
|
15
|
-
return
|
|
14
|
+
return n(() => {
|
|
16
15
|
e == null && s(r());
|
|
17
16
|
}, []), t.useEffect(() => {
|
|
18
17
|
o = !0;
|
|
19
18
|
}, []), e;
|
|
20
19
|
}
|
|
21
|
-
const d =
|
|
20
|
+
const d = i.useId, p = d || c;
|
|
22
21
|
export {
|
|
23
|
-
|
|
22
|
+
p as useId
|
|
24
23
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var j=require("../assets/DateField.css");const R=require("react/jsx-runtime"),$=require("clsx"),d=require("react"),k=require("./classNames.BFQUGnCN.js"),y=require("../lib/wip/DateField/DateField.utils.cjs.js"),I="date-field",{baseClassNamePrefix:S,classModifierPrefix:w,subElementClassPrefix:s}=k.getBEMClassNames(I),c={field:`${s}field`,segments:`${s}segments`,segment:`${s}segment`,separator:`${s}separator`,srStatus:`${s}sr-status`},_={"bm-light":"bm-light","bm-dark":"bm-dark","bm-inverse":"bm-inverse","bm-enterprise":"bm-enterprise","bm-consumer":"bm-consumer","bm-date-field":"bm-date-field","bm-date-field--disabled":"bm-date-field--disabled","bm-date-field--error":"bm-date-field--error","bm-date-field__field":"bm-date-field__field","bm-date-field__segment":"bm-date-field__segment","bm-date-field--read-only":"bm-date-field--read-only","bm-date-field--fluid":"bm-date-field--fluid","bm-date-field__segments":"bm-date-field__segments","bm-date-field__separator":"bm-date-field__separator","bm-date-field__sr-status":"bm-date-field__sr-status"},B={day:"day",month:"month",year:"year"},L=({type:i,value:g,valueMin:p,valueMax:C,displayValue:n,isPlaceholder:x,valueText:v,invalid:E,role:l,isActive:t,disabled:m,readOnly:o,onFocus:h,onBlur:D,onInput:N,onKeyDown:F,segmentRef:f})=>{const a=!m&&!o,b=d.useRef(null),M=d.useCallback(e=>{b.current=e,f(e)},[f]),q=e=>{if(!a)return;const u=e.currentTarget,r=e.nativeEvent.data;r!=null&&r.length===1&&N(i,r),u.textContent!==n&&(u.textContent=n)};d.useLayoutEffect(()=>{if(!t||!a)return;const e=b.current;e&&y.selectElementContents(e)},[n,t,a]);const P=l==="spinbutton"?{"aria-valuenow":g??void 0,"aria-valuemin":p,"aria-valuemax":C,"aria-valuetext":v}:{"aria-multiline":!1};return R.jsx("span",{ref:M,role:l,"aria-label":B[i],...P,"aria-disabled":m||void 0,"aria-readonly":o||void 0,"aria-invalid":E||void 0,contentEditable:a&&t,suppressContentEditableWarning:!0,tabIndex:t?0:-1,inputMode:a?"numeric":void 0,spellCheck:!1,autoCorrect:"off",autoCapitalize:"off","data-segment":i,"data-active":t,"data-placeholder":x,onFocus:h,onBlur:D,onInput:q,onKeyDown:e=>F(i,e),onMouseUp:e=>e.preventDefault(),className:$(_[c.segment]),children:n})};exports.DateFieldSegment=L;exports.baseClassNamePrefix=S;exports.classModifierPrefix=w;exports.staticDateFieldClassNames=c;exports.styles=_;
|