@orianatech/pire 1.4.1 → 1.5.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/core/Avatar.d.ts.map +1 -1
- package/dist/components/core/Badge.d.ts.map +1 -1
- package/dist/components/core/Button.d.ts.map +1 -1
- package/dist/components/core/Card.d.ts.map +1 -1
- package/dist/components/core/Heading.d.ts.map +1 -1
- package/dist/components/core/Icon.d.ts.map +1 -1
- package/dist/components/core/IconButton.d.ts.map +1 -1
- package/dist/components/core/Kbd.d.ts.map +1 -1
- package/dist/components/core/SegmentedControl.d.ts.map +1 -1
- package/dist/components/core/Separator.d.ts.map +1 -1
- package/dist/components/core/Tag.d.ts.map +1 -1
- package/dist/components/core/Text.d.ts.map +1 -1
- package/dist/components/core/icon-map.d.ts.map +1 -1
- package/dist/components/data/BarChart.d.ts.map +1 -1
- package/dist/components/data/ChartFrame.d.ts.map +1 -1
- package/dist/components/data/DataTable.d.ts.map +1 -1
- package/dist/components/data/DescriptionList.d.ts.map +1 -1
- package/dist/components/data/DonutChart.d.ts.map +1 -1
- package/dist/components/data/FilterBar.d.ts.map +1 -1
- package/dist/components/data/KpiTile.d.cts +1 -1
- package/dist/components/data/KpiTile.d.ts +1 -1
- package/dist/components/data/KpiTile.d.ts.map +1 -1
- package/dist/components/data/LineChart.d.ts.map +1 -1
- package/dist/components/data/LinkList.d.ts.map +1 -1
- package/dist/components/data/ObjectHeader.d.ts.map +1 -1
- package/dist/components/data/RecordCard.d.ts.map +1 -1
- package/dist/components/data/ViewSwitcher.d.cts +1 -1
- package/dist/components/data/ViewSwitcher.d.ts +1 -1
- package/dist/components/data/ViewSwitcher.d.ts.map +1 -1
- package/dist/components/data/chartGeometry.d.ts.map +1 -1
- package/dist/components/feedback/Dialog.d.cts +1 -1
- package/dist/components/feedback/Dialog.d.ts +1 -1
- package/dist/components/feedback/Dialog.d.ts.map +1 -1
- package/dist/components/feedback/InlineMessage.d.ts.map +1 -1
- package/dist/components/feedback/ProgressBar.d.cts +1 -1
- package/dist/components/feedback/ProgressBar.d.ts +1 -1
- package/dist/components/feedback/ProgressBar.d.ts.map +1 -1
- package/dist/components/feedback/Skeleton.d.ts.map +1 -1
- package/dist/components/feedback/Toast.d.cts +1 -1
- package/dist/components/feedback/Toast.d.ts +1 -1
- package/dist/components/feedback/Toast.d.ts.map +1 -1
- package/dist/components/feedback/Tooltip.d.ts.map +1 -1
- package/dist/components/forms/Checkbox.d.ts.map +1 -1
- package/dist/components/forms/ChoiceCardGroup.d.ts.map +1 -1
- package/dist/components/forms/ComboBox.d.ts.map +1 -1
- package/dist/components/forms/DatePicker.d.ts.map +1 -1
- package/dist/components/forms/DateRangePicker.d.ts.map +1 -1
- package/dist/components/forms/FileUpload.d.ts.map +1 -1
- package/dist/components/forms/FormField.d.ts.map +1 -1
- package/dist/components/forms/Input.d.ts.map +1 -1
- package/dist/components/forms/MultiComboBox.d.ts.map +1 -1
- package/dist/components/forms/NumberField.d.ts.map +1 -1
- package/dist/components/forms/QuantityStepper.d.ts.map +1 -1
- package/dist/components/forms/Radio.d.ts.map +1 -1
- package/dist/components/forms/Select.d.ts.map +1 -1
- package/dist/components/forms/Switch.d.ts.map +1 -1
- package/dist/components/forms/TextArea.d.ts.map +1 -1
- package/dist/components/forms/ValueHelpField.d.cts +1 -1
- package/dist/components/forms/ValueHelpField.d.ts +1 -1
- package/dist/components/forms/ValueHelpField.d.ts.map +1 -1
- package/dist/components/forms/dateValues.d.ts.map +1 -1
- package/dist/components/layout/PageBand.d.ts.map +1 -1
- package/dist/components/layout/SectionHeader.d.ts.map +1 -1
- package/dist/components/layout/SelectionBar.d.ts.map +1 -1
- package/dist/components/layout/SplitPane.d.ts.map +1 -1
- package/dist/components/navigation/Breadcrumb.d.ts.map +1 -1
- package/dist/components/navigation/Menu.d.ts.map +1 -1
- package/dist/components/navigation/Pagination.d.cts +1 -1
- package/dist/components/navigation/Pagination.d.ts +1 -1
- package/dist/components/navigation/Pagination.d.ts.map +1 -1
- package/dist/components/navigation/Ribbon.d.ts.map +1 -1
- package/dist/components/navigation/ShellBar.d.ts.map +1 -1
- package/dist/components/navigation/ShellRail.d.ts.map +1 -1
- package/dist/components/navigation/SideNav.d.cts +9 -1
- package/dist/components/navigation/SideNav.d.ts +9 -1
- package/dist/components/navigation/SideNav.d.ts.map +1 -1
- package/dist/components/navigation/Tabs.d.ts.map +1 -1
- package/dist/components/patterns/AppLauncher.d.cts +1 -1
- package/dist/components/patterns/AppLauncher.d.ts +1 -1
- package/dist/components/patterns/AppLauncher.d.ts.map +1 -1
- package/dist/components/patterns/CommandPalette.d.ts.map +1 -1
- package/dist/components/patterns/ConfirmDialog.d.cts +1 -1
- package/dist/components/patterns/ConfirmDialog.d.ts +1 -1
- package/dist/components/patterns/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/patterns/EmptyState.d.ts.map +1 -1
- package/dist/components/patterns/FileDropZone.d.ts.map +1 -1
- package/dist/components/patterns/NumPad.d.ts.map +1 -1
- package/dist/components/patterns/SidePanel.d.cts +1 -1
- package/dist/components/patterns/SidePanel.d.ts +1 -1
- package/dist/components/patterns/SidePanel.d.ts.map +1 -1
- package/dist/components/patterns/ValueHelpDialog.d.cts +1 -1
- package/dist/components/patterns/ValueHelpDialog.d.ts +1 -1
- package/dist/components/patterns/ValueHelpDialog.d.ts.map +1 -1
- package/dist/components.css +3653 -691
- package/dist/i18n/PireIntlProvider.d.ts.map +1 -1
- package/dist/index.cjs +612 -249
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -17
- package/dist/index.d.ts +17 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +627 -251
- package/dist/index.js.map +1 -1
- package/dist/tokens/base.css +64 -13
- package/dist/tokens/colors.css +156 -78
- package/dist/tokens/elevation.css +20 -16
- package/dist/tokens/fonts.css +49 -7
- package/dist/tokens/motion.css +15 -12
- package/dist/tokens/spacing.css +41 -16
- package/dist/tokens/themes.css +88 -32
- package/dist/tokens/typography.css +43 -36
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -557,9 +557,26 @@ var import_react_aria_components3 = require("react-aria-components");
|
|
|
557
557
|
// src/components/feedback/Tooltip.tsx
|
|
558
558
|
var React2 = __toESM(require("react"), 1);
|
|
559
559
|
var import_react_aria_components2 = require("react-aria-components");
|
|
560
|
-
var import_jsx_runtime3 =
|
|
560
|
+
var import_jsx_runtime3 = (
|
|
561
|
+
// `Focusable` also dev-warns when the element it clones onto has neither a native
|
|
562
|
+
// interactive tag nor an ARIA widget role — a bare `<span>` is neither. Every disabled
|
|
563
|
+
// control this wraps (`IconButton`, `Button`, …) is button-shaped, so `role="button"` plus
|
|
564
|
+
// `aria-disabled` describes the wrapper the same way its disabled child already describes
|
|
565
|
+
// itself, and is what lets the accessible name (from the child's own text or `aria-label`)
|
|
566
|
+
// reach the element that actually holds focus. No static `tabIndex` here on purpose: it
|
|
567
|
+
// would win over the one `Focusable` computes at clone time (react-aria's `mergeProps` lets
|
|
568
|
+
// a prop already on this element beat the one it supplies), silently making the span
|
|
569
|
+
// unfocusable again and reintroducing the defect this file exists to fix. A real `<button>`
|
|
570
|
+
// is not an option either: `children` is very often a button itself (`IconButton`), and a
|
|
571
|
+
// button nested in a button is invalid HTML that browsers repair by breaking the DOM tree.
|
|
572
|
+
// biome-ignore lint/a11y/useFocusableInteractive: tabIndex is added by Focusable's clone, not statically — see above.
|
|
573
|
+
// biome-ignore lint/a11y/useSemanticElements: a real <button> would nest inside the disabled child, which is often one itself — see above.
|
|
574
|
+
require("react/jsx-runtime")
|
|
575
|
+
);
|
|
561
576
|
function Tooltip({ label, placement = "top", delay = 500, children }) {
|
|
562
|
-
const props = React2.isValidElement(
|
|
577
|
+
const props = React2.isValidElement(
|
|
578
|
+
children
|
|
579
|
+
) ? children.props : void 0;
|
|
563
580
|
const isDisabledChild = props?.isDisabled === true || props?.disabled === true;
|
|
564
581
|
const target = React2.isValidElement(children) && !isDisabledChild ? React2.cloneElement(children, { className: cx(children.props.className, "pire-tooltip-target") }) : isDisabledChild ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "pire-tooltip-target", role: "button", "aria-disabled": "true", children }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "pire-tooltip-target", children });
|
|
565
582
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_aria_components2.TooltipTrigger, { delay, closeDelay: 0, children: [
|
|
@@ -806,10 +823,7 @@ var esMessages = {
|
|
|
806
823
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
807
824
|
var MessagesContext = React5.createContext(enMessages);
|
|
808
825
|
function PireIntlProvider({ messages, children }) {
|
|
809
|
-
const value = React5.useMemo(
|
|
810
|
-
() => messages ? { ...enMessages, ...messages } : enMessages,
|
|
811
|
-
[messages]
|
|
812
|
-
);
|
|
826
|
+
const value = React5.useMemo(() => messages ? { ...enMessages, ...messages } : enMessages, [messages]);
|
|
813
827
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MessagesContext.Provider, { value, children });
|
|
814
828
|
}
|
|
815
829
|
function usePireMessages() {
|
|
@@ -824,37 +838,64 @@ function useMessage(key, override) {
|
|
|
824
838
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
825
839
|
var Tag = React6.forwardRef(function Tag2({ children, onRemove, isDisabled, category, className, ...rest }, ref) {
|
|
826
840
|
const msg = usePireMessages();
|
|
827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
842
|
+
"span",
|
|
843
|
+
{
|
|
844
|
+
ref,
|
|
845
|
+
className: cx("pire-tag", className),
|
|
846
|
+
"data-disabled": isDisabled ? "true" : void 0,
|
|
847
|
+
...rest,
|
|
848
|
+
children: [
|
|
849
|
+
category ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "pire-tag-swatch", "data-category": category, "aria-hidden": "true" }) : null,
|
|
850
|
+
children,
|
|
851
|
+
onRemove ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
852
|
+
import_react_aria_components4.Button,
|
|
853
|
+
{
|
|
854
|
+
className: "pire-tag-remove",
|
|
855
|
+
isDisabled,
|
|
856
|
+
onPress: onRemove,
|
|
857
|
+
"aria-label": typeof children === "string" ? msg.tagRemoveNamed.replace("{name}", children) : msg.tagRemove,
|
|
858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "x", size: 12 })
|
|
859
|
+
}
|
|
860
|
+
) : null
|
|
861
|
+
]
|
|
862
|
+
}
|
|
863
|
+
);
|
|
841
864
|
});
|
|
842
865
|
|
|
843
866
|
// src/components/core/Card.tsx
|
|
844
867
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
845
|
-
function Card({
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
868
|
+
function Card({
|
|
869
|
+
title,
|
|
870
|
+
subtitle,
|
|
871
|
+
icon,
|
|
872
|
+
actions,
|
|
873
|
+
footer,
|
|
874
|
+
interactive,
|
|
875
|
+
children,
|
|
876
|
+
className,
|
|
877
|
+
...rest
|
|
878
|
+
}) {
|
|
879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
880
|
+
"section",
|
|
881
|
+
{
|
|
882
|
+
className: cx("pire-card", className),
|
|
883
|
+
"data-interactive": interactive ? "true" : void 0,
|
|
884
|
+
...rest,
|
|
885
|
+
children: [
|
|
886
|
+
title || actions ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { className: "pire-card-head", children: [
|
|
887
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: icon, size: 20, style: { color: "var(--text-secondary)" } }) : null,
|
|
888
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
889
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "pire-card-title", children: title }),
|
|
890
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "pire-card-sub", style: { margin: 0 }, children: subtitle }) : null
|
|
891
|
+
] }),
|
|
892
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", gap: "var(--sp-1)" }, children: actions }) : null
|
|
893
|
+
] }) : null,
|
|
894
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "pire-card-body", children }) : null,
|
|
895
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("footer", { className: "pire-card-foot", children: footer }) : null
|
|
896
|
+
]
|
|
897
|
+
}
|
|
898
|
+
);
|
|
858
899
|
}
|
|
859
900
|
|
|
860
901
|
// src/components/core/Avatar.tsx
|
|
@@ -889,7 +930,10 @@ function SegmentedControl({
|
|
|
889
930
|
style,
|
|
890
931
|
...rest
|
|
891
932
|
}) {
|
|
892
|
-
const selected = React8.useMemo(
|
|
933
|
+
const selected = React8.useMemo(
|
|
934
|
+
() => new Set(value ? [value] : defaultValue ? [defaultValue] : []),
|
|
935
|
+
[value, defaultValue]
|
|
936
|
+
);
|
|
893
937
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
894
938
|
import_react_aria_components5.ToggleButtonGroup,
|
|
895
939
|
{
|
|
@@ -1038,7 +1082,17 @@ function Kbd({ children, size = "md", className, ...rest }) {
|
|
|
1038
1082
|
|
|
1039
1083
|
// src/components/forms/FormField.tsx
|
|
1040
1084
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1041
|
-
function FormField({
|
|
1085
|
+
function FormField({
|
|
1086
|
+
label,
|
|
1087
|
+
htmlFor,
|
|
1088
|
+
isRequired,
|
|
1089
|
+
hint,
|
|
1090
|
+
error,
|
|
1091
|
+
layout = "stacked",
|
|
1092
|
+
children,
|
|
1093
|
+
className,
|
|
1094
|
+
...rest
|
|
1095
|
+
}) {
|
|
1042
1096
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: cx("pire-field", className), "data-layout": layout, ...rest, children: [
|
|
1043
1097
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("label", { className: "pire-field-label", htmlFor, children: [
|
|
1044
1098
|
label,
|
|
@@ -1160,11 +1214,14 @@ function TextArea({
|
|
|
1160
1214
|
...rest
|
|
1161
1215
|
}) {
|
|
1162
1216
|
const innerRef = React11.useRef(null);
|
|
1163
|
-
const ref = React11.useCallback(
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1217
|
+
const ref = React11.useCallback(
|
|
1218
|
+
(node) => {
|
|
1219
|
+
innerRef.current = node;
|
|
1220
|
+
if (typeof textAreaRef === "function") textAreaRef(node);
|
|
1221
|
+
else if (textAreaRef) textAreaRef.current = node;
|
|
1222
|
+
},
|
|
1223
|
+
[textAreaRef]
|
|
1224
|
+
);
|
|
1168
1225
|
const grow = React11.useCallback(() => {
|
|
1169
1226
|
const el = innerRef.current;
|
|
1170
1227
|
if (!el || !autoGrow) return;
|
|
@@ -1284,7 +1341,16 @@ function Select({
|
|
|
1284
1341
|
className: "pire-listbox",
|
|
1285
1342
|
items,
|
|
1286
1343
|
renderEmptyState: () => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: emptyLabel ?? msg.selectEmpty }),
|
|
1287
|
-
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1344
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1345
|
+
import_react_aria_components11.ListBoxItem,
|
|
1346
|
+
{
|
|
1347
|
+
className: "pire-option",
|
|
1348
|
+
id: item.value,
|
|
1349
|
+
textValue: item.label,
|
|
1350
|
+
isDisabled: item.isDisabled,
|
|
1351
|
+
children: item.label
|
|
1352
|
+
}
|
|
1353
|
+
)
|
|
1288
1354
|
}
|
|
1289
1355
|
) })
|
|
1290
1356
|
]
|
|
@@ -1308,7 +1374,14 @@ function Checkbox({ label, hint, children, className, ...rest }) {
|
|
|
1308
1374
|
// src/components/forms/Radio.tsx
|
|
1309
1375
|
var import_react_aria_components13 = require("react-aria-components");
|
|
1310
1376
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1311
|
-
function RadioGroup({
|
|
1377
|
+
function RadioGroup({
|
|
1378
|
+
label,
|
|
1379
|
+
description,
|
|
1380
|
+
errorMessage,
|
|
1381
|
+
children,
|
|
1382
|
+
className,
|
|
1383
|
+
...rest
|
|
1384
|
+
}) {
|
|
1312
1385
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_aria_components13.RadioGroup, { className: cx("pire-field", className), validationBehavior: "aria", ...rest, children: [
|
|
1313
1386
|
label ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_aria_components13.Label, { className: "pire-field-label", children: label }) : null,
|
|
1314
1387
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "pire-radiogroup", children }),
|
|
@@ -1371,12 +1444,21 @@ function ChoiceCardGroup({
|
|
|
1371
1444
|
label,
|
|
1372
1445
|
isRequired ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-field-req", "aria-hidden": "true", children: "*" }) : null
|
|
1373
1446
|
] }) : null,
|
|
1374
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1447
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "pire-choicecards", style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }, children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1448
|
+
import_react_aria_components15.Radio,
|
|
1449
|
+
{
|
|
1450
|
+
value: option.id,
|
|
1451
|
+
className: "pire-choicecard",
|
|
1452
|
+
isDisabled: option.isDisabled,
|
|
1453
|
+
children: [
|
|
1454
|
+
option.icon ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: option.icon, size: 20 }) : null,
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-label", children: option.label }),
|
|
1456
|
+
option.description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-desc", children: option.description }) : null,
|
|
1457
|
+
option.preview ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "pire-choicecard-preview", "aria-hidden": "true", children: option.preview }) : null
|
|
1458
|
+
]
|
|
1459
|
+
},
|
|
1460
|
+
option.id
|
|
1461
|
+
)) }),
|
|
1380
1462
|
description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components15.Text, { slot: "description", className: "pire-field-hint", children: description }) : null,
|
|
1381
1463
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_aria_components15.FieldError, { className: "pire-field-error", children: errorMessage })
|
|
1382
1464
|
]
|
|
@@ -1480,7 +1562,16 @@ function ComboBox({
|
|
|
1480
1562
|
children: clearLabel ?? msg.inputClear
|
|
1481
1563
|
}
|
|
1482
1564
|
) : null,
|
|
1483
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1566
|
+
import_react_aria_components16.Button,
|
|
1567
|
+
{
|
|
1568
|
+
className: "pire-iconbtn",
|
|
1569
|
+
"data-size": "sm",
|
|
1570
|
+
"aria-label": msg.comboBoxShowSuggestions,
|
|
1571
|
+
style: { width: 20, height: 20 },
|
|
1572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Icon, { name: "chevron-down", size: 16 })
|
|
1573
|
+
}
|
|
1574
|
+
)
|
|
1484
1575
|
]
|
|
1485
1576
|
}
|
|
1486
1577
|
),
|
|
@@ -1495,10 +1586,19 @@ function ComboBox({
|
|
|
1495
1586
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1496
1587
|
} : void 0,
|
|
1497
1588
|
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1498
|
-
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1589
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1590
|
+
import_react_aria_components16.ListBoxItem,
|
|
1591
|
+
{
|
|
1592
|
+
className: "pire-option",
|
|
1593
|
+
id: item.value,
|
|
1594
|
+
textValue: item.label,
|
|
1595
|
+
isDisabled: item.isDisabled,
|
|
1596
|
+
children: [
|
|
1597
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "pire-option-label", children: item.label }),
|
|
1598
|
+
item.secondary ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1599
|
+
]
|
|
1600
|
+
}
|
|
1601
|
+
)
|
|
1502
1602
|
}
|
|
1503
1603
|
) })
|
|
1504
1604
|
]
|
|
@@ -1622,7 +1722,16 @@ function MultiComboBox({
|
|
|
1622
1722
|
}
|
|
1623
1723
|
)
|
|
1624
1724
|
] }),
|
|
1625
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1726
|
+
import_react_aria_components17.Button,
|
|
1727
|
+
{
|
|
1728
|
+
className: "pire-iconbtn",
|
|
1729
|
+
"data-size": "sm",
|
|
1730
|
+
"aria-label": msg.comboBoxShowSuggestions,
|
|
1731
|
+
style: { width: 20, height: 20 },
|
|
1732
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "chevron-down", size: 16 })
|
|
1733
|
+
}
|
|
1734
|
+
)
|
|
1626
1735
|
]
|
|
1627
1736
|
}
|
|
1628
1737
|
),
|
|
@@ -1638,10 +1747,19 @@ function MultiComboBox({
|
|
|
1638
1747
|
if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) onLoadMore();
|
|
1639
1748
|
} : void 0,
|
|
1640
1749
|
renderEmptyState: showsStatus ? () => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pire-listbox-status", role: "status", "aria-live": "polite", children: isLoading ? loadingLabel ?? msg.comboBoxLoading : emptyLabel }) : void 0,
|
|
1641
|
-
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1750
|
+
children: (item) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
1751
|
+
import_react_aria_components17.ListBoxItem,
|
|
1752
|
+
{
|
|
1753
|
+
className: "pire-option",
|
|
1754
|
+
id: item.value,
|
|
1755
|
+
textValue: item.label,
|
|
1756
|
+
isDisabled: item.isDisabled,
|
|
1757
|
+
children: [
|
|
1758
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pire-option-label", children: item.label }),
|
|
1759
|
+
item.secondary ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "pire-option-secondary", children: item.secondary }) : null
|
|
1760
|
+
]
|
|
1761
|
+
}
|
|
1762
|
+
)
|
|
1645
1763
|
}
|
|
1646
1764
|
) })
|
|
1647
1765
|
]
|
|
@@ -1801,7 +1919,15 @@ function NumberField({
|
|
|
1801
1919
|
"data-readonly": rest.isReadOnly ? "true" : void 0,
|
|
1802
1920
|
"data-stepper": stepperLayout,
|
|
1803
1921
|
children: [
|
|
1804
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1922
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1923
|
+
import_react_aria_components18.Button,
|
|
1924
|
+
{
|
|
1925
|
+
slot: "decrement",
|
|
1926
|
+
className: "pire-qty-btn",
|
|
1927
|
+
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "minus", size: 16 })
|
|
1929
|
+
}
|
|
1930
|
+
) : null,
|
|
1805
1931
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1806
1932
|
import_react_aria_components18.Input,
|
|
1807
1933
|
{
|
|
@@ -1813,10 +1939,34 @@ function NumberField({
|
|
|
1813
1939
|
),
|
|
1814
1940
|
suffix ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "pire-affix", children: suffix }) : null,
|
|
1815
1941
|
showsClear ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ClearButton, { label: clearLabel ?? msg.inputClear, onClear: () => handleChange(NaN) }) : null,
|
|
1816
|
-
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1942
|
+
!hideStepper && stepperLayout === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1943
|
+
import_react_aria_components18.Button,
|
|
1944
|
+
{
|
|
1945
|
+
slot: "increment",
|
|
1946
|
+
className: "pire-qty-btn",
|
|
1947
|
+
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "plus", size: 16 })
|
|
1949
|
+
}
|
|
1950
|
+
) : null,
|
|
1817
1951
|
hideStepper ? null : stepperLayout === "inline" ? null : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "pire-stepper", children: [
|
|
1818
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1819
|
-
|
|
1952
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1953
|
+
import_react_aria_components18.Button,
|
|
1954
|
+
{
|
|
1955
|
+
slot: "increment",
|
|
1956
|
+
className: "pire-stepper-btn",
|
|
1957
|
+
"aria-label": incrementLabel ?? msg.numberFieldIncrease,
|
|
1958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "plus", size: 10 })
|
|
1959
|
+
}
|
|
1960
|
+
),
|
|
1961
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1962
|
+
import_react_aria_components18.Button,
|
|
1963
|
+
{
|
|
1964
|
+
slot: "decrement",
|
|
1965
|
+
className: "pire-stepper-btn",
|
|
1966
|
+
"aria-label": decrementLabel ?? msg.numberFieldDecrease,
|
|
1967
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "minus", size: 10 })
|
|
1968
|
+
}
|
|
1969
|
+
)
|
|
1820
1970
|
] })
|
|
1821
1971
|
]
|
|
1822
1972
|
}
|
|
@@ -1947,7 +2097,16 @@ function DatePicker({
|
|
|
1947
2097
|
children: [
|
|
1948
2098
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.DateInput, { className: "pire-datefield", children: (segment) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.DateSegment, { segment, className: "pire-datesegment" }) }),
|
|
1949
2099
|
showsClear ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ClearButton2, { label: clearLabel ?? msg.inputClear }) : null,
|
|
1950
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2100
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2101
|
+
import_react_aria_components19.Button,
|
|
2102
|
+
{
|
|
2103
|
+
className: "pire-iconbtn",
|
|
2104
|
+
"data-size": "sm",
|
|
2105
|
+
"aria-label": msg.datePickerOpenCalendar,
|
|
2106
|
+
style: { width: 24, height: 24 },
|
|
2107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "calendar", size: 16 })
|
|
2108
|
+
}
|
|
2109
|
+
)
|
|
1951
2110
|
]
|
|
1952
2111
|
}
|
|
1953
2112
|
),
|
|
@@ -1955,9 +2114,27 @@ function DatePicker({
|
|
|
1955
2114
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.FieldError, { className: "pire-field-error", children: errorMessage }),
|
|
1956
2115
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Popover, { className: "pire-popover", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Dialog, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components19.Calendar, { className: "pire-calendar", children: [
|
|
1957
2116
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { className: "pire-calendar-head", children: [
|
|
1958
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2117
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2118
|
+
import_react_aria_components19.Button,
|
|
2119
|
+
{
|
|
2120
|
+
slot: "previous",
|
|
2121
|
+
className: "pire-iconbtn",
|
|
2122
|
+
"data-size": "sm",
|
|
2123
|
+
"aria-label": msg.datePickerPreviousMonth,
|
|
2124
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "chevron-left", size: 16 })
|
|
2125
|
+
}
|
|
2126
|
+
),
|
|
1959
2127
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.Heading, { className: "pire-calendar-title" }),
|
|
1960
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2128
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2129
|
+
import_react_aria_components19.Button,
|
|
2130
|
+
{
|
|
2131
|
+
slot: "next",
|
|
2132
|
+
className: "pire-iconbtn",
|
|
2133
|
+
"data-size": "sm",
|
|
2134
|
+
"aria-label": msg.datePickerNextMonth,
|
|
2135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { name: "chevron-right", size: 16 })
|
|
2136
|
+
}
|
|
2137
|
+
)
|
|
1961
2138
|
] }),
|
|
1962
2139
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_aria_components19.CalendarGrid, { className: "pire-calendar-grid", children: [
|
|
1963
2140
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.CalendarGridHeader, { children: (day) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_aria_components19.CalendarHeaderCell, { children: day }) }),
|
|
@@ -2044,7 +2221,9 @@ function DateRangePicker({
|
|
|
2044
2221
|
onChange(null);
|
|
2045
2222
|
return;
|
|
2046
2223
|
}
|
|
2047
|
-
onChange(
|
|
2224
|
+
onChange(
|
|
2225
|
+
valueFormat === "iso" ? { start: next.start.toString(), end: next.end.toString() } : { start: next.start, end: next.end }
|
|
2226
|
+
);
|
|
2048
2227
|
};
|
|
2049
2228
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2050
2229
|
import_react_aria_components20.DateRangePicker,
|
|
@@ -2239,7 +2418,13 @@ function Skeleton({ shape = "text", width, height, className, style, ...rest })
|
|
|
2239
2418
|
);
|
|
2240
2419
|
}
|
|
2241
2420
|
var BAR_WIDTHS = ["72%", "54%", "86%", "63%"];
|
|
2242
|
-
function SkeletonTableRow({
|
|
2421
|
+
function SkeletonTableRow({
|
|
2422
|
+
columns,
|
|
2423
|
+
density = "regular",
|
|
2424
|
+
className,
|
|
2425
|
+
style,
|
|
2426
|
+
...rest
|
|
2427
|
+
}) {
|
|
2243
2428
|
const cells = typeof columns === "number" ? Array.from({ length: columns }, () => ({})) : columns;
|
|
2244
2429
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2245
2430
|
"div",
|
|
@@ -2251,18 +2436,15 @@ function SkeletonTableRow({ columns, density = "regular", className, style, ...r
|
|
|
2251
2436
|
...rest,
|
|
2252
2437
|
children: cells.map((c, i) => {
|
|
2253
2438
|
const align = c.numeric ? "right" : c.align ?? "left";
|
|
2254
|
-
return (
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
"
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
},
|
|
2264
|
-
i
|
|
2265
|
-
)
|
|
2439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2440
|
+
"div",
|
|
2441
|
+
{
|
|
2442
|
+
className: "pire-skeleton-cell",
|
|
2443
|
+
"data-align": align,
|
|
2444
|
+
style: { width: c.width, flex: c.width ? "0 0 auto" : void 0 },
|
|
2445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Skeleton, { width: BAR_WIDTHS[i % BAR_WIDTHS.length] })
|
|
2446
|
+
},
|
|
2447
|
+
i
|
|
2266
2448
|
);
|
|
2267
2449
|
})
|
|
2268
2450
|
}
|
|
@@ -2316,10 +2498,11 @@ function DataTable({
|
|
|
2316
2498
|
break;
|
|
2317
2499
|
}
|
|
2318
2500
|
if (typeof column.width !== "number") {
|
|
2319
|
-
if (IS_DEV2)
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2501
|
+
if (IS_DEV2)
|
|
2502
|
+
warnOnce2(
|
|
2503
|
+
`pin-width:${column.key}`,
|
|
2504
|
+
`DataTable column "${column.key}" is pinned but has no numeric width, so its offset cannot be computed. It will scroll.`
|
|
2505
|
+
);
|
|
2323
2506
|
broke = "width";
|
|
2324
2507
|
break;
|
|
2325
2508
|
}
|
|
@@ -2423,7 +2606,9 @@ function DataTable({
|
|
|
2423
2606
|
{
|
|
2424
2607
|
size: 12,
|
|
2425
2608
|
name: sort?.key === c.key ? sort.dir === "asc" ? "arrow-up" : "arrow-down" : "chevrons-up-down",
|
|
2426
|
-
style: {
|
|
2609
|
+
style: {
|
|
2610
|
+
color: sort?.key === c.key ? "var(--accent-subtle-fg)" : "var(--text-tertiary)"
|
|
2611
|
+
}
|
|
2427
2612
|
}
|
|
2428
2613
|
) : null
|
|
2429
2614
|
] })
|
|
@@ -2432,44 +2617,53 @@ function DataTable({
|
|
|
2432
2617
|
)
|
|
2433
2618
|
))
|
|
2434
2619
|
] }),
|
|
2435
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
{
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
import_react_aria_components22.Cell,
|
|
2455
|
-
{
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2620
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2621
|
+
import_react_aria_components22.TableBody,
|
|
2622
|
+
{
|
|
2623
|
+
renderEmptyState: () => isLoading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "pire-table-loading", role: "status", "aria-live": "polite", children: [
|
|
2624
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "pire-sr-only", children: loadingLabel ?? msg.dataTableLoading }),
|
|
2625
|
+
Array.from({ length: skeletonRows }, (_, i) => (
|
|
2626
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows are positional.
|
|
2627
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SkeletonTableRow, { columns: skeletonColumns, density }, i)
|
|
2628
|
+
))
|
|
2629
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pire-table-empty", children: emptyLabel ?? msg.dataTableEmpty }),
|
|
2630
|
+
children: body.flatMap((row) => {
|
|
2631
|
+
const rowIsDisabled = presentation.get(row.id)?.isDisabled;
|
|
2632
|
+
const record = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2633
|
+
import_react_aria_components22.Row,
|
|
2634
|
+
{
|
|
2635
|
+
id: row.id,
|
|
2636
|
+
className: cx("pire-tr", presentation.get(row.id)?.className),
|
|
2637
|
+
"data-pressable": onRowAction && !rowIsDisabled ? "true" : void 0,
|
|
2638
|
+
children: [
|
|
2639
|
+
hasCheckboxColumn ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-td", ...pinProps(null), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Checkbox, { slot: "selection", "aria-label": msg.dataTableSelectRow }) }) : null,
|
|
2640
|
+
columns.map((c) => {
|
|
2641
|
+
const pin = pinProps(c.key);
|
|
2642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2643
|
+
import_react_aria_components22.Cell,
|
|
2644
|
+
{
|
|
2645
|
+
className: "pire-td",
|
|
2646
|
+
"data-numeric": c.numeric ? "true" : void 0,
|
|
2647
|
+
"data-tone": c.tone?.(row) ?? void 0,
|
|
2648
|
+
...pin,
|
|
2649
|
+
style: { ...pin.style, textAlign: c.align && !c.numeric ? c.align : void 0 },
|
|
2650
|
+
children: c.render ? c.render(row) : row[c.key]
|
|
2651
|
+
},
|
|
2652
|
+
c.key
|
|
2653
|
+
);
|
|
2654
|
+
})
|
|
2655
|
+
]
|
|
2656
|
+
},
|
|
2657
|
+
row.id
|
|
2658
|
+
);
|
|
2659
|
+
if (!renderExpanded || !expanded.has(String(row.id))) return [record];
|
|
2660
|
+
return [
|
|
2661
|
+
record,
|
|
2662
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Row, { id: expandedKey(row.id), className: "pire-tr-expanded", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-td-expanded", colSpan: spanAll, children: renderExpanded(row) }) }, expandedKey(row.id))
|
|
2663
|
+
];
|
|
2664
|
+
})
|
|
2665
|
+
}
|
|
2666
|
+
),
|
|
2473
2667
|
footer && !isLoading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.TableFooter, { className: "pire-tfoot", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_aria_components22.Row, { id: "__pire_footer__", className: "pire-tr-footer", children: [
|
|
2474
2668
|
hasCheckboxColumn ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_aria_components22.Cell, { className: "pire-tf", ...pinProps(null) }) : null,
|
|
2475
2669
|
columns.map((c, i) => {
|
|
@@ -2539,10 +2733,17 @@ function ValueHelpDialog({
|
|
|
2539
2733
|
onClose,
|
|
2540
2734
|
footer: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
2541
2735
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { variant: "tertiary", onPress: onClose, children: msg.valueHelpDialogCancel }),
|
|
2542
|
-
isMultiple ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2736
|
+
isMultiple ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2737
|
+
Button,
|
|
2738
|
+
{
|
|
2739
|
+
variant: "primary",
|
|
2740
|
+
onPress: () => {
|
|
2741
|
+
onConfirm?.(selectedKeys ?? []);
|
|
2742
|
+
onClose?.();
|
|
2743
|
+
},
|
|
2744
|
+
children: msg.valueHelpConfirm
|
|
2745
|
+
}
|
|
2746
|
+
) : null
|
|
2546
2747
|
] }),
|
|
2547
2748
|
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "var(--sp-3)" }, children: [
|
|
2548
2749
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
@@ -2563,28 +2764,35 @@ function ValueHelpDialog({
|
|
|
2563
2764
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { size: "sm", variant: "tertiary", onPress: () => onSelectionChange?.([]), children: msg.valueHelpClearSelection }),
|
|
2564
2765
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "pire-valuehelp-count", children: msg.valueHelpSelectedCount.replace("{count}", String(selectedKeys?.length ?? 0)) })
|
|
2565
2766
|
] }) : null,
|
|
2566
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2567
|
-
|
|
2568
|
-
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2569
|
-
} : void 0, style: { overflow: "auto", maxHeight: "48vh" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2570
|
-
DataTable,
|
|
2767
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2768
|
+
"div",
|
|
2571
2769
|
{
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2770
|
+
onScroll: onLoadMore ? (event) => {
|
|
2771
|
+
const el = event.currentTarget;
|
|
2772
|
+
if (el.scrollHeight - el.scrollTop - el.clientHeight < 64) onLoadMore();
|
|
2773
|
+
} : void 0,
|
|
2774
|
+
style: { overflow: "auto", maxHeight: "48vh" },
|
|
2775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2776
|
+
DataTable,
|
|
2777
|
+
{
|
|
2778
|
+
"aria-label": typeof title === "string" ? title : msg.valueHelpDialogTitle,
|
|
2779
|
+
density: "condensed",
|
|
2780
|
+
columns,
|
|
2781
|
+
rows: filtered,
|
|
2782
|
+
isLoading,
|
|
2783
|
+
emptyLabel: emptyLabel ?? msg.valueHelpDialogEmpty,
|
|
2784
|
+
selectable: isMultiple ? "multiple" : void 0,
|
|
2785
|
+
hideSelectAll: isMultiple,
|
|
2786
|
+
selected: isMultiple ? selectedKeys : void 0,
|
|
2787
|
+
onSelectionChange: isMultiple ? onSelectionChange : void 0,
|
|
2788
|
+
onRowAction: isMultiple ? void 0 : (row) => {
|
|
2789
|
+
onSelect?.(row);
|
|
2790
|
+
onClose?.();
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
)
|
|
2586
2794
|
}
|
|
2587
|
-
)
|
|
2795
|
+
)
|
|
2588
2796
|
] })
|
|
2589
2797
|
}
|
|
2590
2798
|
);
|
|
@@ -2730,7 +2938,9 @@ function screenFiles(files, { maxSize, acceptedFileTypes }) {
|
|
|
2730
2938
|
continue;
|
|
2731
2939
|
}
|
|
2732
2940
|
if (acceptedFileTypes?.length) {
|
|
2733
|
-
const ok = acceptedFileTypes.some(
|
|
2941
|
+
const ok = acceptedFileTypes.some(
|
|
2942
|
+
(t) => t.startsWith(".") ? file.name.toLowerCase().endsWith(t.toLowerCase()) : t.endsWith("/*") ? file.type.startsWith(t.slice(0, -1)) : file.type === t
|
|
2943
|
+
);
|
|
2734
2944
|
if (!ok) {
|
|
2735
2945
|
rejected.push({ file, reason: "type" });
|
|
2736
2946
|
continue;
|
|
@@ -2767,9 +2977,12 @@ function FileUpload({
|
|
|
2767
2977
|
const [uncontrolled, setUncontrolled] = React21.useState(defaultValue ?? []);
|
|
2768
2978
|
const files = value ?? uncontrolled;
|
|
2769
2979
|
const created = React21.useRef([]);
|
|
2770
|
-
React21.useEffect(
|
|
2771
|
-
|
|
2772
|
-
|
|
2980
|
+
React21.useEffect(
|
|
2981
|
+
() => () => {
|
|
2982
|
+
for (const url of created.current) URL.revokeObjectURL(url);
|
|
2983
|
+
},
|
|
2984
|
+
[]
|
|
2985
|
+
);
|
|
2773
2986
|
const commit = (next) => {
|
|
2774
2987
|
if (value === void 0) setUncontrolled(next);
|
|
2775
2988
|
onChange?.(next);
|
|
@@ -2890,14 +3103,7 @@ var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
|
2890
3103
|
function Menu({ minWidth, className, style, ...rest }) {
|
|
2891
3104
|
const width = typeof minWidth === "number" ? `${minWidth}px` : minWidth;
|
|
2892
3105
|
const menuStyle = width == null ? style : { ["--pire-menu-min-w"]: width, ...style };
|
|
2893
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2894
|
-
import_react_aria_components26.Menu,
|
|
2895
|
-
{
|
|
2896
|
-
className: cx("pire-menu", className),
|
|
2897
|
-
style: menuStyle,
|
|
2898
|
-
...rest
|
|
2899
|
-
}
|
|
2900
|
-
);
|
|
3106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria_components26.Menu, { className: cx("pire-menu", className), style: menuStyle, ...rest });
|
|
2901
3107
|
}
|
|
2902
3108
|
var shortcutKeys = (shortcut) => {
|
|
2903
3109
|
if (shortcut == null) return [];
|
|
@@ -2926,7 +3132,14 @@ function MenuItem({
|
|
|
2926
3132
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-label", children }),
|
|
2927
3133
|
description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-desc", children: description }) : null
|
|
2928
3134
|
] }),
|
|
2929
|
-
keys.length ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3135
|
+
keys.length ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "pire-menu-item-shortcut", children: keys.map((cap, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3136
|
+
Kbd,
|
|
3137
|
+
{
|
|
3138
|
+
size: "sm",
|
|
3139
|
+
children: cap
|
|
3140
|
+
},
|
|
3141
|
+
`${cap}-${index}`
|
|
3142
|
+
)) }) : null
|
|
2930
3143
|
]
|
|
2931
3144
|
}
|
|
2932
3145
|
);
|
|
@@ -2961,6 +3174,7 @@ function SideNav({
|
|
|
2961
3174
|
onExpandedChange,
|
|
2962
3175
|
collapsed,
|
|
2963
3176
|
railFlyout = true,
|
|
3177
|
+
bordered = true,
|
|
2964
3178
|
footer,
|
|
2965
3179
|
className,
|
|
2966
3180
|
...rest
|
|
@@ -3069,6 +3283,7 @@ function SideNav({
|
|
|
3069
3283
|
{
|
|
3070
3284
|
className: cx("pire-sidenav", className),
|
|
3071
3285
|
"data-collapsed": collapsed ? "true" : void 0,
|
|
3286
|
+
"data-bordered": bordered ? void 0 : "false",
|
|
3072
3287
|
"aria-label": msg.sideNavLabel,
|
|
3073
3288
|
...rest,
|
|
3074
3289
|
children: [
|
|
@@ -3260,7 +3475,9 @@ function childrenOfType(children, type, what, parent) {
|
|
|
3260
3475
|
}
|
|
3261
3476
|
if (!React24.isValidElement(child) || child.type !== type) {
|
|
3262
3477
|
const isWrapper = React24.isValidElement(child) && typeof child.type !== "string" && !CONFIG_ELEMENTS.has(child.type);
|
|
3263
|
-
throw new Error(
|
|
3478
|
+
throw new Error(
|
|
3479
|
+
`[pire] ${parent} accepts only ${what} as children, and got ${describe(child)}.` + (isWrapper ? ` Configuration elements are read, not rendered, so ${parent} cannot see through a wrapper component.` : "")
|
|
3480
|
+
);
|
|
3264
3481
|
}
|
|
3265
3482
|
out.push({ ...child.props, key: child.key != null ? String(child.key) : `${path}${i}` });
|
|
3266
3483
|
});
|
|
@@ -3271,13 +3488,24 @@ function childrenOfType(children, type, what, parent) {
|
|
|
3271
3488
|
function readTabs(children) {
|
|
3272
3489
|
return childrenOfType(children, RibbonTab, "Ribbon.Tab", "Ribbon").map((tab) => ({
|
|
3273
3490
|
...tab,
|
|
3274
|
-
groups: childrenOfType(tab.children, RibbonGroup, "Ribbon.Group", "Ribbon.Tab").map(
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3491
|
+
groups: childrenOfType(tab.children, RibbonGroup, "Ribbon.Group", "Ribbon.Tab").map(
|
|
3492
|
+
(group) => ({
|
|
3493
|
+
...group,
|
|
3494
|
+
commands: childrenOfType(
|
|
3495
|
+
group.children,
|
|
3496
|
+
RibbonCommand,
|
|
3497
|
+
"Ribbon.Command",
|
|
3498
|
+
"Ribbon.Group"
|
|
3499
|
+
)
|
|
3500
|
+
})
|
|
3501
|
+
)
|
|
3278
3502
|
}));
|
|
3279
3503
|
}
|
|
3280
|
-
function Command({
|
|
3504
|
+
function Command({
|
|
3505
|
+
command,
|
|
3506
|
+
selectionCount,
|
|
3507
|
+
inBar
|
|
3508
|
+
}) {
|
|
3281
3509
|
const size = inBar ? "sm" : command.size ?? "sm";
|
|
3282
3510
|
const isDisabled = command.isDisabled || command.requiresSelection === true && selectionCount === 0;
|
|
3283
3511
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
@@ -3324,7 +3552,13 @@ function useTrailingOverflow() {
|
|
|
3324
3552
|
}, []);
|
|
3325
3553
|
return [ref, overflow];
|
|
3326
3554
|
}
|
|
3327
|
-
function Surface({
|
|
3555
|
+
function Surface({
|
|
3556
|
+
className,
|
|
3557
|
+
id,
|
|
3558
|
+
label,
|
|
3559
|
+
trailing,
|
|
3560
|
+
children
|
|
3561
|
+
}) {
|
|
3328
3562
|
const [scrollRef, overflow] = useTrailingOverflow();
|
|
3329
3563
|
const domId = id ? { id } : {};
|
|
3330
3564
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_aria_components31.Toolbar, { ...domId, className, "aria-label": label, children: [
|
|
@@ -3365,10 +3599,13 @@ function Ribbon({
|
|
|
3365
3599
|
const [ownTab, setOwnTab] = React24.useState(defaultValue);
|
|
3366
3600
|
const requested = value ?? ownTab;
|
|
3367
3601
|
const selected = visible.some((tab) => tab.id === requested) ? requested : fallback;
|
|
3368
|
-
const select = React24.useCallback(
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3602
|
+
const select = React24.useCallback(
|
|
3603
|
+
(id) => {
|
|
3604
|
+
setOwnTab(id);
|
|
3605
|
+
onChange?.(id);
|
|
3606
|
+
},
|
|
3607
|
+
[onChange]
|
|
3608
|
+
);
|
|
3372
3609
|
const hadSelection = React24.useRef(false);
|
|
3373
3610
|
React24.useEffect(() => {
|
|
3374
3611
|
const has = count > 0;
|
|
@@ -3464,7 +3701,15 @@ var KIND_ICON = {
|
|
|
3464
3701
|
warning: "alert-triangle",
|
|
3465
3702
|
error: "alert-octagon"
|
|
3466
3703
|
};
|
|
3467
|
-
function InlineMessage({
|
|
3704
|
+
function InlineMessage({
|
|
3705
|
+
kind = "info",
|
|
3706
|
+
title,
|
|
3707
|
+
action,
|
|
3708
|
+
onClose,
|
|
3709
|
+
children,
|
|
3710
|
+
className,
|
|
3711
|
+
...rest
|
|
3712
|
+
}) {
|
|
3468
3713
|
const msg = usePireMessages();
|
|
3469
3714
|
const assertive = kind === "error" || kind === "warning";
|
|
3470
3715
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
@@ -3497,7 +3742,14 @@ var KIND_ICON2 = {
|
|
|
3497
3742
|
warning: "alert-triangle",
|
|
3498
3743
|
error: "alert-octagon"
|
|
3499
3744
|
};
|
|
3500
|
-
function Toast({
|
|
3745
|
+
function Toast({
|
|
3746
|
+
kind = "success",
|
|
3747
|
+
onClose,
|
|
3748
|
+
position = "bottom-center",
|
|
3749
|
+
children,
|
|
3750
|
+
className,
|
|
3751
|
+
...rest
|
|
3752
|
+
}) {
|
|
3501
3753
|
const msg = usePireMessages();
|
|
3502
3754
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3503
3755
|
"div",
|
|
@@ -3516,21 +3768,36 @@ function Toast({ kind = "success", onClose, position = "bottom-center", children
|
|
|
3516
3768
|
);
|
|
3517
3769
|
}
|
|
3518
3770
|
var ToastContext = React25.createContext(null);
|
|
3519
|
-
function ToastProvider({
|
|
3771
|
+
function ToastProvider({
|
|
3772
|
+
children,
|
|
3773
|
+
timeout = 6e3
|
|
3774
|
+
}) {
|
|
3520
3775
|
const msg = usePireMessages();
|
|
3521
3776
|
const [toasts, setToasts] = React25.useState([]);
|
|
3522
3777
|
const close = React25.useCallback((id) => setToasts((t) => t.filter((x) => x.id !== id)), []);
|
|
3523
|
-
const add = React25.useCallback(
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3778
|
+
const add = React25.useCallback(
|
|
3779
|
+
(toast) => {
|
|
3780
|
+
const id = Math.random().toString(36).slice(2);
|
|
3781
|
+
setToasts((t) => [...t, { ...toast, id }]);
|
|
3782
|
+
const ms = toast.timeout ?? timeout;
|
|
3783
|
+
if (ms > 0) setTimeout(() => close(id), ms);
|
|
3784
|
+
return id;
|
|
3785
|
+
},
|
|
3786
|
+
[close, timeout]
|
|
3787
|
+
);
|
|
3530
3788
|
const value = React25.useMemo(() => ({ add, close }), [add, close]);
|
|
3531
3789
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(ToastContext.Provider, { value, children: [
|
|
3532
3790
|
children,
|
|
3533
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "pire-toast-region", role: "region", "aria-label": msg.toastRegionLabel, children: toasts.map((t) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
3792
|
+
Toast,
|
|
3793
|
+
{
|
|
3794
|
+
kind: t.kind,
|
|
3795
|
+
onClose: () => close(t.id),
|
|
3796
|
+
style: { position: "static", transform: "none" },
|
|
3797
|
+
children: t.message
|
|
3798
|
+
},
|
|
3799
|
+
t.id
|
|
3800
|
+
)) })
|
|
3534
3801
|
] });
|
|
3535
3802
|
}
|
|
3536
3803
|
function useToast() {
|
|
@@ -3578,7 +3845,17 @@ function KpiTile({
|
|
|
3578
3845
|
|
|
3579
3846
|
// src/components/data/ObjectHeader.tsx
|
|
3580
3847
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3581
|
-
function ObjectHeader({
|
|
3848
|
+
function ObjectHeader({
|
|
3849
|
+
title,
|
|
3850
|
+
subtitle,
|
|
3851
|
+
id,
|
|
3852
|
+
breadcrumb,
|
|
3853
|
+
badge,
|
|
3854
|
+
facts,
|
|
3855
|
+
actions,
|
|
3856
|
+
className,
|
|
3857
|
+
...rest
|
|
3858
|
+
}) {
|
|
3582
3859
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: cx("pire-objheader", className), ...rest, children: [
|
|
3583
3860
|
breadcrumb,
|
|
3584
3861
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "pire-objheader-row", children: [
|
|
@@ -3594,7 +3871,15 @@ function ObjectHeader({ title, subtitle, id, breadcrumb, badge, facts, actions,
|
|
|
3594
3871
|
] }),
|
|
3595
3872
|
facts?.length ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dl", { className: "pire-facts", style: { margin: 0 }, children: facts.map((fact) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
3596
3873
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("dt", { className: "pire-fact-label", children: fact.label }),
|
|
3597
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3874
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3875
|
+
"dd",
|
|
3876
|
+
{
|
|
3877
|
+
className: "pire-fact-value",
|
|
3878
|
+
"data-numeric": fact.numeric ? "true" : void 0,
|
|
3879
|
+
style: { margin: 0 },
|
|
3880
|
+
children: fact.value
|
|
3881
|
+
}
|
|
3882
|
+
)
|
|
3598
3883
|
] }, fact.label)) }) : null
|
|
3599
3884
|
] });
|
|
3600
3885
|
}
|
|
@@ -3633,7 +3918,14 @@ function FilterBar({
|
|
|
3633
3918
|
|
|
3634
3919
|
// src/components/data/DescriptionList.tsx
|
|
3635
3920
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3636
|
-
function DescriptionList({
|
|
3921
|
+
function DescriptionList({
|
|
3922
|
+
items,
|
|
3923
|
+
layout = "rows",
|
|
3924
|
+
columns = 3,
|
|
3925
|
+
className,
|
|
3926
|
+
style,
|
|
3927
|
+
...rest
|
|
3928
|
+
}) {
|
|
3637
3929
|
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3638
3930
|
"dl",
|
|
3639
3931
|
{
|
|
@@ -3691,10 +3983,7 @@ function linearScale(values, tickCount = 4, startAtZero = true) {
|
|
|
3691
3983
|
const min = toStepPrecision(Math.floor(low / step + EDGE_TOLERANCE) * step);
|
|
3692
3984
|
const max = toStepPrecision(Math.ceil(high / step - EDGE_TOLERANCE) * step);
|
|
3693
3985
|
const stepCount = Math.round((max - min) / step);
|
|
3694
|
-
const ticks = Array.from(
|
|
3695
|
-
{ length: stepCount + 1 },
|
|
3696
|
-
(_, index) => toStepPrecision(min + index * step)
|
|
3697
|
-
);
|
|
3986
|
+
const ticks = Array.from({ length: stepCount + 1 }, (_, index) => toStepPrecision(min + index * step));
|
|
3698
3987
|
return { min, max, ticks };
|
|
3699
3988
|
}
|
|
3700
3989
|
function scalePosition(value, scale) {
|
|
@@ -3722,10 +4011,14 @@ function warnOnDonutShape(series, categoryCount, chartLabel) {
|
|
|
3722
4011
|
complaints.push(`it has ${series.length} series but a donut draws one \u2014 the rest are ignored`);
|
|
3723
4012
|
}
|
|
3724
4013
|
if (categoryCount > VIZ_SLOT_COUNT) {
|
|
3725
|
-
complaints.push(
|
|
4014
|
+
complaints.push(
|
|
4015
|
+
`it has ${categoryCount} segments and the palette defines ${VIZ_SLOT_COUNT}; past about four, slices stop being readable at all \u2014 group the tail into "Other"`
|
|
4016
|
+
);
|
|
3726
4017
|
}
|
|
3727
4018
|
if (series[0]?.values.some((value) => value != null && value < 0)) {
|
|
3728
|
-
complaints.push(
|
|
4019
|
+
complaints.push(
|
|
4020
|
+
"it contains negative values, which have no part-to-whole meaning \u2014 a signed measure belongs in a bar chart"
|
|
4021
|
+
);
|
|
3729
4022
|
}
|
|
3730
4023
|
if (complaints.length === 0) return;
|
|
3731
4024
|
warnedCharts.add(`donut:${chartLabel}`);
|
|
@@ -3738,7 +4031,9 @@ function flatValues(series) {
|
|
|
3738
4031
|
return series.flatMap((one) => one.values);
|
|
3739
4032
|
}
|
|
3740
4033
|
function alignToCategories(series, categoryCount) {
|
|
3741
|
-
return series.map(
|
|
4034
|
+
return series.map(
|
|
4035
|
+
(one) => one.values.length <= categoryCount ? one : { ...one, values: one.values.slice(0, categoryCount) }
|
|
4036
|
+
);
|
|
3742
4037
|
}
|
|
3743
4038
|
|
|
3744
4039
|
// src/components/data/ChartFrame.tsx
|
|
@@ -3997,10 +4292,12 @@ function LineChart({
|
|
|
3997
4292
|
},
|
|
3998
4293
|
tick
|
|
3999
4294
|
)),
|
|
4000
|
-
categories.map(
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4295
|
+
categories.map(
|
|
4296
|
+
(category, index) => index % labelEvery === 0 ? (
|
|
4297
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4298
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("text", { x: xAt(index), y: height - 6, textAnchor: "middle", children: category }, index)
|
|
4299
|
+
) : null
|
|
4300
|
+
)
|
|
4004
4301
|
] }),
|
|
4005
4302
|
showArea && series[0] ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4006
4303
|
"path",
|
|
@@ -4011,19 +4308,20 @@ function LineChart({
|
|
|
4011
4308
|
}
|
|
4012
4309
|
) : null,
|
|
4013
4310
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-line", fill: "none", children: series.map((one, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("path", { d: pathFor(one.values), stroke: seriesColor(one, index) }, one.id)) }),
|
|
4014
|
-
withMarkers ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-marker", children: series.map(
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4311
|
+
withMarkers ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("g", { className: "pire-chart-marker", children: series.map(
|
|
4312
|
+
(one, seriesIndex) => one.values.map(
|
|
4313
|
+
(value, index) => value == null ? null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
4314
|
+
"circle",
|
|
4315
|
+
{
|
|
4316
|
+
cx: xAt(index),
|
|
4317
|
+
cy: yAt(value),
|
|
4318
|
+
r: 4,
|
|
4319
|
+
fill: seriesColor(one, seriesIndex)
|
|
4320
|
+
},
|
|
4321
|
+
`${one.id}-${index}`
|
|
4322
|
+
)
|
|
4025
4323
|
)
|
|
4026
|
-
)
|
|
4324
|
+
) }) : null
|
|
4027
4325
|
]
|
|
4028
4326
|
}
|
|
4029
4327
|
) : null,
|
|
@@ -4031,7 +4329,9 @@ function LineChart({
|
|
|
4031
4329
|
"div",
|
|
4032
4330
|
{
|
|
4033
4331
|
className: "pire-chart-hover",
|
|
4034
|
-
style: {
|
|
4332
|
+
style: {
|
|
4333
|
+
inset: `${PLOT_INSET.top}px ${PLOT_INSET.right}px ${PLOT_INSET.bottom}px ${PLOT_INSET.left}px`
|
|
4334
|
+
},
|
|
4035
4335
|
children: categories.map((category, categoryIndex) => (
|
|
4036
4336
|
// biome-ignore lint/suspicious/noArrayIndexKey: categories are positional and repeat legitimately (two quarters both labelled "Q1").
|
|
4037
4337
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "pire-chart-band", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("span", { className: "pire-chart-tip", role: "presentation", children: [
|
|
@@ -4171,15 +4471,31 @@ function LinkList({ items, onSelect, emphasis = "key", className, ...rest }) {
|
|
|
4171
4471
|
|
|
4172
4472
|
// src/components/data/RecordCard.tsx
|
|
4173
4473
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4174
|
-
function RecordCard({
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4474
|
+
function RecordCard({
|
|
4475
|
+
title,
|
|
4476
|
+
subtitle,
|
|
4477
|
+
icon,
|
|
4478
|
+
action,
|
|
4479
|
+
isDisabled,
|
|
4480
|
+
className,
|
|
4481
|
+
...rest
|
|
4482
|
+
}) {
|
|
4483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
4484
|
+
"div",
|
|
4485
|
+
{
|
|
4486
|
+
className: cx("pire-recordcard", className),
|
|
4487
|
+
"data-disabled": isDisabled ? "true" : void 0,
|
|
4488
|
+
...rest,
|
|
4489
|
+
children: [
|
|
4490
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-tile", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: icon, size: 20 }) }) : null,
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("span", { className: "pire-recordcard-body", children: [
|
|
4492
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-title", children: title }),
|
|
4493
|
+
subtitle ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-sub", children: subtitle }) : null
|
|
4494
|
+
] }),
|
|
4495
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "pire-recordcard-action", children: action }) : null
|
|
4496
|
+
]
|
|
4497
|
+
}
|
|
4498
|
+
);
|
|
4183
4499
|
}
|
|
4184
4500
|
|
|
4185
4501
|
// src/components/data/ViewSwitcher.tsx
|
|
@@ -4279,7 +4595,14 @@ function SectionHeader({ title, meta, actions, className, ...rest }) {
|
|
|
4279
4595
|
|
|
4280
4596
|
// src/components/layout/SelectionBar.tsx
|
|
4281
4597
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4282
|
-
function SelectionBar({
|
|
4598
|
+
function SelectionBar({
|
|
4599
|
+
count,
|
|
4600
|
+
noun = "record",
|
|
4601
|
+
children,
|
|
4602
|
+
actions,
|
|
4603
|
+
className,
|
|
4604
|
+
...rest
|
|
4605
|
+
}) {
|
|
4283
4606
|
if (!count) return null;
|
|
4284
4607
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: cx("pire-selectionbar", className), role: "status", "aria-live": "polite", ...rest, children: [
|
|
4285
4608
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("span", { className: "pire-selectionbar-count", children: [
|
|
@@ -4378,7 +4701,14 @@ function ConfirmDialog({
|
|
|
4378
4701
|
// pairs with an explicit role for the same reason.
|
|
4379
4702
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "pire-confirm-facts", role: "group", "aria-label": msg.confirmDialogFactsLabel, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DescriptionList, { layout: "rows", items: facts }) })
|
|
4380
4703
|
) : null,
|
|
4381
|
-
consequence ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4704
|
+
consequence ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
4705
|
+
InlineMessage,
|
|
4706
|
+
{
|
|
4707
|
+
kind: tone === "danger" ? "error" : "warning",
|
|
4708
|
+
style: { marginBottom: children ? "var(--sp-3)" : 0 },
|
|
4709
|
+
children: consequence
|
|
4710
|
+
}
|
|
4711
|
+
) : null,
|
|
4382
4712
|
children
|
|
4383
4713
|
]
|
|
4384
4714
|
}
|
|
@@ -4419,10 +4749,13 @@ function CommandPalette({
|
|
|
4419
4749
|
for (const group of groups) for (const item of group.items) byId.set(item.id, searchableText(item));
|
|
4420
4750
|
return byId;
|
|
4421
4751
|
}, [groups]);
|
|
4422
|
-
const filter = React28.useCallback(
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4752
|
+
const filter = React28.useCallback(
|
|
4753
|
+
(textValue, inputValue, node) => {
|
|
4754
|
+
if (node.parentKey === RESULTS_SECTION_KEY) return true;
|
|
4755
|
+
return contains(searchableById.get(String(node.key)) ?? textValue, inputValue);
|
|
4756
|
+
},
|
|
4757
|
+
[contains, searchableById]
|
|
4758
|
+
);
|
|
4426
4759
|
const handleInputChange = (value) => {
|
|
4427
4760
|
setQuery(value);
|
|
4428
4761
|
onSearch?.(value);
|
|
@@ -4549,7 +4882,10 @@ function AppLauncher({
|
|
|
4549
4882
|
if (isFilteredExternally) return sections;
|
|
4550
4883
|
const q = query.trim();
|
|
4551
4884
|
if (!q) return sections;
|
|
4552
|
-
return sections.map((section) => ({
|
|
4885
|
+
return sections.map((section) => ({
|
|
4886
|
+
...section,
|
|
4887
|
+
items: section.items.filter((i) => contains(searchableText2(i), q))
|
|
4888
|
+
})).filter((section) => section.items.length > 0);
|
|
4553
4889
|
}, [sections, query, isFilteredExternally, contains]);
|
|
4554
4890
|
const isEmpty = !isLoading && visible.length === 0;
|
|
4555
4891
|
const label = ariaLabel ?? msg.appLauncherLabel;
|
|
@@ -4606,7 +4942,13 @@ function AppLauncher({
|
|
|
4606
4942
|
onAction?.(item.id);
|
|
4607
4943
|
},
|
|
4608
4944
|
children: [
|
|
4609
|
-
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4945
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
4946
|
+
Icon,
|
|
4947
|
+
{
|
|
4948
|
+
name: item.icon,
|
|
4949
|
+
size: (section.variant ?? "tile") === "tile" ? 20 : 16
|
|
4950
|
+
}
|
|
4951
|
+
) }) : null,
|
|
4610
4952
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("span", { className: "pire-launcher-item-text", children: [
|
|
4611
4953
|
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-label", children: item.label }),
|
|
4612
4954
|
showsDescription ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: "pire-launcher-item-desc", children: item.description }) : null
|
|
@@ -4627,7 +4969,16 @@ function AppLauncher({
|
|
|
4627
4969
|
// src/components/patterns/SidePanel.tsx
|
|
4628
4970
|
var import_react_aria_components37 = require("react-aria-components");
|
|
4629
4971
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4630
|
-
function SidePanel({
|
|
4972
|
+
function SidePanel({
|
|
4973
|
+
isOpen,
|
|
4974
|
+
title,
|
|
4975
|
+
subtitle,
|
|
4976
|
+
width = 400,
|
|
4977
|
+
children,
|
|
4978
|
+
footer,
|
|
4979
|
+
onClose,
|
|
4980
|
+
className
|
|
4981
|
+
}) {
|
|
4631
4982
|
const msg = usePireMessages();
|
|
4632
4983
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
4633
4984
|
import_react_aria_components37.ModalOverlay,
|
|
@@ -4655,7 +5006,15 @@ function SidePanel({ isOpen, title, subtitle, width = 400, children, footer, onC
|
|
|
4655
5006
|
|
|
4656
5007
|
// src/components/patterns/EmptyState.tsx
|
|
4657
5008
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4658
|
-
function EmptyState({
|
|
5009
|
+
function EmptyState({
|
|
5010
|
+
icon = "file-text",
|
|
5011
|
+
title,
|
|
5012
|
+
action,
|
|
5013
|
+
compact,
|
|
5014
|
+
children,
|
|
5015
|
+
className,
|
|
5016
|
+
...rest
|
|
5017
|
+
}) {
|
|
4659
5018
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: cx("pire-empty", className), "data-compact": compact ? "true" : void 0, ...rest, children: [
|
|
4660
5019
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Icon, { name: icon, size: 24, className: "pire-empty-icon" }),
|
|
4661
5020
|
title ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("p", { className: "pire-empty-title", style: { margin: 0 }, children: title }) : null,
|
|
@@ -4728,22 +5087,25 @@ function NumPad({
|
|
|
4728
5087
|
}) {
|
|
4729
5088
|
const msg = usePireMessages();
|
|
4730
5089
|
const containerRef = React30.useRef(null);
|
|
4731
|
-
const applyKey = React30.useCallback(
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
5090
|
+
const applyKey = React30.useCallback(
|
|
5091
|
+
(key) => {
|
|
5092
|
+
if (isDisabled) return;
|
|
5093
|
+
if (key.value === "backspace") {
|
|
5094
|
+
onChange(value.slice(0, -1));
|
|
5095
|
+
return;
|
|
5096
|
+
}
|
|
5097
|
+
if (key.value === "clear") {
|
|
5098
|
+
onChange("");
|
|
5099
|
+
return;
|
|
5100
|
+
}
|
|
5101
|
+
if (isInsertable(key.value)) {
|
|
5102
|
+
onChange(value + key.value);
|
|
5103
|
+
return;
|
|
5104
|
+
}
|
|
5105
|
+
onAction?.(key.value);
|
|
5106
|
+
},
|
|
5107
|
+
[isDisabled, value, onChange, onAction]
|
|
5108
|
+
);
|
|
4747
5109
|
useNumPadKeyboard((keyValue) => applyKey({ value: keyValue }), isDisabled, containerRef);
|
|
4748
5110
|
const keys = [...BASE_KEYS, ...extraKeys];
|
|
4749
5111
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
@@ -4813,9 +5175,12 @@ function FileDropZone({
|
|
|
4813
5175
|
const [uncontrolled, setUncontrolled] = React31.useState(defaultValue ?? []);
|
|
4814
5176
|
const files = value ?? uncontrolled;
|
|
4815
5177
|
const created = React31.useRef([]);
|
|
4816
|
-
React31.useEffect(
|
|
4817
|
-
|
|
4818
|
-
|
|
5178
|
+
React31.useEffect(
|
|
5179
|
+
() => () => {
|
|
5180
|
+
for (const url of created.current) URL.revokeObjectURL(url);
|
|
5181
|
+
},
|
|
5182
|
+
[]
|
|
5183
|
+
);
|
|
4819
5184
|
const commit = (next) => {
|
|
4820
5185
|
if (value === void 0) setUncontrolled(next);
|
|
4821
5186
|
onChange?.(next);
|
|
@@ -4846,9 +5211,7 @@ function FileDropZone({
|
|
|
4846
5211
|
"data-height": height,
|
|
4847
5212
|
isDisabled: isDisabled || isReadOnly,
|
|
4848
5213
|
onDrop: async (e) => {
|
|
4849
|
-
const dropped = await Promise.all(
|
|
4850
|
-
e.items.filter(import_react_aria_components38.isFileDropItem).map((item) => item.getFile())
|
|
4851
|
-
);
|
|
5214
|
+
const dropped = await Promise.all(e.items.filter(import_react_aria_components38.isFileDropItem).map((item) => item.getFile()));
|
|
4852
5215
|
accept(dropped);
|
|
4853
5216
|
},
|
|
4854
5217
|
children: [
|